From: Andrea Bianco Date: Sat, 21 Dec 2019 07:07:10 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.0 X-Git-Tag: 2.4.1~1 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=a89d9421e881a31f9af9da35f21f88d59b30ad2d;p=motion2.git Built motion from commit (unavailable).|2.4.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index c56e2a5..8de59da 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.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": "2019-12-20T23:58:19.684Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.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": "2019-12-21T06:58:24.788Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1348edd..53ae328 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.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": "2019-12-20T23:58:19.684Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.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": "2019-12-21T06:58:24.788Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 3d7ae6e..c95f2e3 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 _0x3e74=['contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','sequelize','VIRTUAL','getDataValue','contactManager','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x1096e7,_0x5c9642){var _0x3ffe74=function(_0x53a277){while(--_0x53a277){_0x1096e7['push'](_0x1096e7['shift']());}};_0x3ffe74(++_0x5c9642);}(_0x3e74,0x175));var _0x43e7=function(_0x5848fd,_0x53b475){_0x5848fd=_0x5848fd-0x0;var _0x9b18c5=_0x3e74[_0x5848fd];return _0x9b18c5;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'get':function(_0x287a1d){return this[_0x43e7('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x43e7('0x3'),'integration',_0x43e7('0x4'),_0x43e7('0x5'),_0x43e7('0x6'),_0x43e7('0x7'),_0x43e7('0x8'),'script']],'msg':_0x43e7('0x9')}},'comment':_0x43e7('0x9')},'data1':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':_0x43e7('0xb')},'data2':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x43e7('0xa')](0x1000)},'data6':{'type':Sequelize[_0x43e7('0xa')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x55ca=['sequelize','exports','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x53604f,_0x2f672b){var _0x2bff98=function(_0x4656b3){while(--_0x4656b3){_0x53604f['push'](_0x53604f['shift']());}};_0x2bff98(++_0x2f672b);}(_0x55ca,0x126));var _0xa55c=function(_0x58ee96,_0x5affd5){_0x58ee96=_0x58ee96-0x0;var _0xb346aa=_0x55ca[_0x58ee96];return _0xb346aa;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5edc58){return this['getDataValue'](_0xa55c('0x2'));}},'action':{'type':Sequelize[_0xa55c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa55c('0x4'),_0xa55c('0x5'),_0xa55c('0x6'),_0xa55c('0x7'),_0xa55c('0x8'),_0xa55c('0x9'),_0xa55c('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xa55c('0xb')},'data1':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':_0xa55c('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data5':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data6':{'type':Sequelize[_0xa55c('0x3')]},'data7':{'type':Sequelize[_0xa55c('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 02fa83e..5f5ca4e 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 _0x0189=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','name','send','body','find','params','Action','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1bae58,_0x4415ad){var _0x38f5df=function(_0xf223bb){while(--_0xf223bb){_0x1bae58['push'](_0x1bae58['shift']());}};_0x38f5df(++_0x4415ad);}(_0x0189,0x6d));var _0x9018=function(_0x47a583,_0x20c52a){_0x47a583=_0x47a583-0x0;var _0x39cfc3=_0x0189[_0x47a583];return _0x39cfc3;};'use strict';var pdf=require(_0x9018('0x0'));var emlformat=require(_0x9018('0x1'));var rimraf=require(_0x9018('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9018('0x3'));var rp=require('request-promise');var moment=require(_0x9018('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9018('0x5'));var path=require('path');var sox=require(_0x9018('0x6'));var csv=require(_0x9018('0x7'));var ejs=require(_0x9018('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9018('0x9'));var jsforce=require(_0x9018('0xa'));var deskjs=require(_0x9018('0xb'));var toCsv=require(_0x9018('0x7'));var querystring=require(_0x9018('0xc'));var Papa=require(_0x9018('0xd'));var Redis=require(_0x9018('0xe'));var authService=require(_0x9018('0xf'));var qs=require(_0x9018('0x10'));var hardwareService=require(_0x9018('0x11'));var logger=require(_0x9018('0x12'))(_0x9018('0x13'));var utils=require('../../config/utils');var config=require(_0x9018('0x14'));var db=require(_0x9018('0x15'))['db'];function respondWithStatusCode(_0x4a4500,_0x10479f){_0x10479f=_0x10479f||0xcc;return function(_0x5f4424){if(_0x5f4424){return _0x4a4500[_0x9018('0x16')](_0x10479f);}return _0x4a4500[_0x9018('0x17')](_0x10479f)[_0x9018('0x18')]();};}function respondWithResult(_0x14bbb5,_0x75f9f2){_0x75f9f2=_0x75f9f2||0xc8;return function(_0x2fb1c7){if(_0x2fb1c7){return _0x14bbb5[_0x9018('0x17')](_0x75f9f2)[_0x9018('0x19')](_0x2fb1c7);}};}function respondWithFilteredResult(_0x4fff3d,_0x59d782){return function(_0x2b4752){if(_0x2b4752){var _0x147c16=_0x2b4752[_0x9018('0x1a')],_0x3a191a=_0x59d782[_0x9018('0x1b')],_0x31ca5b=_0x59d782[_0x9018('0x1b')]+_0x59d782[_0x9018('0x1c')],_0x4290a7;if(_0x31ca5b>=_0x147c16){_0x31ca5b=_0x147c16;_0x4290a7=0xc8;}else{_0x4290a7=0xce;}_0x4fff3d[_0x9018('0x17')](_0x4290a7);return _0x4fff3d[_0x9018('0x1d')](_0x9018('0x1e'),_0x3a191a+'-'+_0x31ca5b+'/'+_0x147c16)['json'](_0x2b4752);}return null;};}function patchUpdates(_0xd56dfe){return function(_0x5c4cde){try{jsonpatch[_0x9018('0x1f')](_0x5c4cde,_0xd56dfe,!![]);}catch(_0x2283df){return BPromise['reject'](_0x2283df);}return _0x5c4cde['save']();};}function saveUpdates(_0x50ae81,_0x819172){return function(_0x44ac88){if(_0x44ac88){return _0x44ac88['update'](_0x50ae81)[_0x9018('0x20')](function(_0x41b141){return _0x41b141;});}return null;};}function removeEntity(_0x3640a0,_0x1bb09d){return function(_0x24f142){if(_0x24f142){return _0x24f142[_0x9018('0x21')]()[_0x9018('0x20')](function(){_0x3640a0[_0x9018('0x17')](0xcc)[_0x9018('0x18')]();});}};}function handleEntityNotFound(_0x28d180,_0xfc2197){return function(_0x3737b1){if(!_0x3737b1){_0x28d180[_0x9018('0x16')](0x194);}return _0x3737b1;};}function handleError(_0xa6f942,_0x507a2c){_0x507a2c=_0x507a2c||0x1f4;return function(_0xe32fee){logger[_0x9018('0x22')](_0xe32fee['stack']);if(_0xe32fee[_0x9018('0x23')]){delete _0xe32fee[_0x9018('0x23')];}_0xa6f942['status'](_0x507a2c)[_0x9018('0x24')](_0xe32fee);};}exports['update']=function(_0x4d7866,_0xeb58df){if(_0x4d7866[_0x9018('0x25')]['id']){delete _0x4d7866['body']['id'];}return db['Action'][_0x9018('0x26')]({'where':{'id':_0x4d7866[_0x9018('0x27')]['id']}})['then'](handleEntityNotFound(_0xeb58df,null))['then'](saveUpdates(_0x4d7866[_0x9018('0x25')],null))[_0x9018('0x20')](respondWithResult(_0xeb58df,null))['catch'](handleError(_0xeb58df,null));};exports['destroy']=function(_0x576f28,_0x4a2ad1){return db[_0x9018('0x28')][_0x9018('0x26')]({'where':{'id':_0x576f28[_0x9018('0x27')]['id']}})[_0x9018('0x20')](handleEntityNotFound(_0x4a2ad1,null))[_0x9018('0x20')](removeEntity(_0x4a2ad1,null))[_0x9018('0x29')](handleError(_0x4a2ad1,null));}; \ No newline at end of file +var _0x63b2=['find','catch','params','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','body','Action'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x63b2,0xdf));var _0x263b=function(_0x2aa3bc,_0x2509ca){_0x2aa3bc=_0x2aa3bc-0x0;var _0x44af7e=_0x63b2[_0x2aa3bc];return _0x44af7e;};'use strict';var pdf=require(_0x263b('0x0'));var emlformat=require(_0x263b('0x1'));var rimraf=require(_0x263b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x263b('0x3'));var rp=require('request-promise');var moment=require(_0x263b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x263b('0x5'));var util=require(_0x263b('0x6'));var path=require(_0x263b('0x7'));var sox=require(_0x263b('0x8'));var csv=require('to-csv');var ejs=require(_0x263b('0x9'));var fs=require('fs');var _=require(_0x263b('0xa'));var squel=require(_0x263b('0xb'));var crypto=require(_0x263b('0xc'));var jsforce=require(_0x263b('0xd'));var deskjs=require(_0x263b('0xe'));var toCsv=require(_0x263b('0xf'));var querystring=require(_0x263b('0x10'));var Papa=require(_0x263b('0x11'));var Redis=require('ioredis');var authService=require(_0x263b('0x12'));var qs=require(_0x263b('0x13'));var hardwareService=require(_0x263b('0x14'));var logger=require(_0x263b('0x15'))(_0x263b('0x16'));var utils=require(_0x263b('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45ce4b,_0x2e49a5){_0x2e49a5=_0x2e49a5||0xcc;return function(_0x472f9e){if(_0x472f9e){return _0x45ce4b['sendStatus'](_0x2e49a5);}return _0x45ce4b['status'](_0x2e49a5)[_0x263b('0x18')]();};}function respondWithResult(_0x2f6794,_0x1bb67b){_0x1bb67b=_0x1bb67b||0xc8;return function(_0x2ee606){if(_0x2ee606){return _0x2f6794[_0x263b('0x19')](_0x1bb67b)[_0x263b('0x1a')](_0x2ee606);}};}function respondWithFilteredResult(_0x200a3b,_0x3c9f0d){return function(_0x2c2f76){if(_0x2c2f76){var _0x3868b0=_0x2c2f76[_0x263b('0x1b')],_0x5d4c46=_0x3c9f0d['offset'],_0x39cd7c=_0x3c9f0d[_0x263b('0x1c')]+_0x3c9f0d[_0x263b('0x1d')],_0x4ff3a9;if(_0x39cd7c>=_0x3868b0){_0x39cd7c=_0x3868b0;_0x4ff3a9=0xc8;}else{_0x4ff3a9=0xce;}_0x200a3b[_0x263b('0x19')](_0x4ff3a9);return _0x200a3b[_0x263b('0x1e')](_0x263b('0x1f'),_0x5d4c46+'-'+_0x39cd7c+'/'+_0x3868b0)[_0x263b('0x1a')](_0x2c2f76);}return null;};}function patchUpdates(_0x3e6f92){return function(_0x15a76a){try{jsonpatch['apply'](_0x15a76a,_0x3e6f92,!![]);}catch(_0x6f3ce0){return BPromise[_0x263b('0x20')](_0x6f3ce0);}return _0x15a76a['save']();};}function saveUpdates(_0x260075,_0x2d9852){return function(_0x4904fa){if(_0x4904fa){return _0x4904fa[_0x263b('0x21')](_0x260075)[_0x263b('0x22')](function(_0x17ec02){return _0x17ec02;});}return null;};}function removeEntity(_0x307992,_0x7f739a){return function(_0x47e841){if(_0x47e841){return _0x47e841[_0x263b('0x23')]()[_0x263b('0x22')](function(){_0x307992['status'](0xcc)[_0x263b('0x18')]();});}};}function handleEntityNotFound(_0x9d610a,_0x18b700){return function(_0x301825){if(!_0x301825){_0x9d610a['sendStatus'](0x194);}return _0x301825;};}function handleError(_0x1b21c5,_0x450300){_0x450300=_0x450300||0x1f4;return function(_0x3cf3b){logger['error'](_0x3cf3b[_0x263b('0x24')]);if(_0x3cf3b[_0x263b('0x25')]){delete _0x3cf3b[_0x263b('0x25')];}_0x1b21c5[_0x263b('0x19')](_0x450300)[_0x263b('0x26')](_0x3cf3b);};}exports[_0x263b('0x21')]=function(_0x5cc722,_0x2c6df1){if(_0x5cc722['body']['id']){delete _0x5cc722[_0x263b('0x27')]['id'];}return db[_0x263b('0x28')][_0x263b('0x29')]({'where':{'id':_0x5cc722['params']['id']}})['then'](handleEntityNotFound(_0x2c6df1,null))[_0x263b('0x22')](saveUpdates(_0x5cc722['body'],null))['then'](respondWithResult(_0x2c6df1,null))[_0x263b('0x2a')](handleError(_0x2c6df1,null));};exports['destroy']=function(_0x11261b,_0x132fd7){return db['Action'][_0x263b('0x29')]({'where':{'id':_0x11261b[_0x263b('0x2b')]['id']}})[_0x263b('0x22')](handleEntityNotFound(_0x132fd7,null))[_0x263b('0x22')](removeEntity(_0x132fd7,null))['catch'](handleError(_0x132fd7,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e949439..3df04a2 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 _0x5b6c=['../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ac33a,_0x52f6f8){var _0x3b6b87=function(_0x3251a1){while(--_0x3251a1){_0x1ac33a['push'](_0x1ac33a['shift']());}};_0x3b6b87(++_0x52f6f8);}(_0x5b6c,0x130));var _0xc5b6=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5b6c[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xc5b6('0x0'));var util=require(_0xc5b6('0x1'));var logger=require(_0xc5b6('0x2'))('api');var moment=require(_0xc5b6('0x3'));var BPromise=require(_0xc5b6('0x4'));var rp=require(_0xc5b6('0x5'));var fs=require('fs');var path=require(_0xc5b6('0x6'));var rimraf=require(_0xc5b6('0x7'));var config=require(_0xc5b6('0x8'));var attributes=require(_0xc5b6('0x9'));module[_0xc5b6('0xa')]=function(_0x2254f6,_0x4859c3){return _0x2254f6[_0xc5b6('0xb')](_0xc5b6('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4278=['bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api','moment'];(function(_0x335a2c,_0x528ab6){var _0x2ad33a=function(_0x6119c1){while(--_0x6119c1){_0x335a2c['push'](_0x335a2c['shift']());}};_0x2ad33a(++_0x528ab6);}(_0x4278,0x1a8));var _0x8427=function(_0x315c20,_0x383c61){_0x315c20=_0x315c20-0x0;var _0x6d17c7=_0x4278[_0x315c20];return _0x6d17c7;};'use strict';var _=require(_0x8427('0x0'));var util=require(_0x8427('0x1'));var logger=require(_0x8427('0x2'))(_0x8427('0x3'));var moment=require(_0x8427('0x4'));var BPromise=require(_0x8427('0x5'));var rp=require(_0x8427('0x6'));var fs=require('fs');var path=require(_0x8427('0x7'));var rimraf=require(_0x8427('0x8'));var config=require('../../config/environment');var attributes=require(_0x8427('0x9'));module[_0x8427('0xa')]=function(_0x4bb3e8,_0x83cb45){return _0x4bb3e8[_0x8427('0xb')](_0x8427('0xc'),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 cd2e104..f23d6cb 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 _0x7250=['../../config/environment','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5f4f98,_0x4e75b0){var _0x7cfb84=function(_0x45e7c5){while(--_0x45e7c5){_0x5f4f98['push'](_0x5f4f98['shift']());}};_0x7cfb84(++_0x4e75b0);}(_0x7250,0x1b1));var _0x0725=function(_0x2a7890,_0x32e9b1){_0x2a7890=_0x2a7890-0x0;var _0x2bd9a3=_0x7250[_0x2a7890];return _0x2bd9a3;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require('moment');var BPromise=require(_0x0725('0x2'));var rs=require(_0x0725('0x3'));var fs=require('fs');var Redis=require(_0x0725('0x4'));var db=require(_0x0725('0x5'))['db'];var utils=require(_0x0725('0x6'));var logger=require(_0x0725('0x7'))('rpc');var config=require(_0x0725('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0725('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b8653,_0x14a2a7,_0x415a9c){return new BPromise(function(_0x49bed0,_0x2f34e5){return client[_0x0725('0xa')](_0x4b8653,_0x415a9c)[_0x0725('0xb')](function(_0xc12c1e){logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));logger['debug'](_0x0725('0xf'),_0x14a2a7,_0x0725('0xe'),JSON[_0x0725('0x10')](_0xc12c1e));if(_0xc12c1e['error']){if(_0xc12c1e['error'][_0x0725('0x11')]===0x1f4){logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);return _0x2f34e5(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e['error'][_0x0725('0x13')]);return _0x49bed0(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}else{logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));_0x49bed0(_0xc12c1e['result']['message']);}})[_0x0725('0x14')](function(_0x58777d){logger[_0x0725('0x12')]('Action,\x20%s,\x20%s',_0x14a2a7,_0x58777d);_0x2f34e5(_0x58777d);});});} \ No newline at end of file +var _0x0ef0=['code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0x0ef0,0x80));var _0x00ef=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0x0ef0[_0x49588f];return _0x41b293;};'use strict';var _=require(_0x00ef('0x0'));var util=require(_0x00ef('0x1'));var moment=require('moment');var BPromise=require(_0x00ef('0x2'));var rs=require(_0x00ef('0x3'));var fs=require('fs');var Redis=require(_0x00ef('0x4'));var db=require(_0x00ef('0x5'))['db'];var utils=require(_0x00ef('0x6'));var logger=require(_0x00ef('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x00ef('0x8'));var client=jayson[_0x00ef('0x9')][_0x00ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19321c,_0x50cbde,_0x303c49){return new BPromise(function(_0x3dd5cd,_0x2ee1a6){return client[_0x00ef('0xb')](_0x19321c,_0x303c49)[_0x00ef('0xc')](function(_0x4984c2){logger[_0x00ef('0xd')](_0x00ef('0xe'),_0x50cbde,_0x00ef('0xf'));logger['debug'](_0x00ef('0x10'),_0x50cbde,'request\x20sent',JSON[_0x00ef('0x11')](_0x4984c2));if(_0x4984c2[_0x00ef('0x12')]){if(_0x4984c2[_0x00ef('0x12')][_0x00ef('0x13')]===0x1f4){logger[_0x00ef('0x12')]('Action,\x20%s,\x20%s',_0x50cbde,_0x4984c2[_0x00ef('0x12')]['message']);return _0x2ee1a6(_0x4984c2[_0x00ef('0x12')][_0x00ef('0x14')]);}logger[_0x00ef('0x12')]('Action,\x20%s,\x20%s',_0x50cbde,_0x4984c2[_0x00ef('0x12')]['message']);return _0x3dd5cd(_0x4984c2['error'][_0x00ef('0x14')]);}else{logger[_0x00ef('0xd')](_0x00ef('0xe'),_0x50cbde,_0x00ef('0xf'));_0x3dd5cd(_0x4984c2['result'][_0x00ef('0x14')]);}})['catch'](function(_0xbd149a){logger[_0x00ef('0x12')](_0x00ef('0xe'),_0x50cbde,_0xbd149a);_0x2ee1a6(_0xbd149a);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 65110da..493e43f 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 _0x99cd=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','exports','multer','path'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x99cd,0x1df));var _0xd99c=function(_0x1c3ea7,_0x24984c){_0x1c3ea7=_0x1c3ea7-0x0;var _0x58b998=_0x99cd[_0x1c3ea7];return _0x58b998;};'use strict';var multer=require(_0xd99c('0x0'));var util=require('util');var path=require(_0xd99c('0x1'));var timeout=require(_0xd99c('0x2'));var express=require(_0xd99c('0x3'));var router=express[_0xd99c('0x4')]();var auth=require(_0xd99c('0x5'));var interaction=require(_0xd99c('0x6'));var config=require(_0xd99c('0x7'));var controller=require(_0xd99c('0x8'));router[_0xd99c('0x9')](_0xd99c('0xa'),auth['isAuthenticated'](),controller[_0xd99c('0xb')]);router['delete'](_0xd99c('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd99c('0xc')]=router; \ No newline at end of file +var _0x7275=['put','delete','isAuthenticated','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x172850,_0x30cf58){var _0x2bcd4d=function(_0x4e79f1){while(--_0x4e79f1){_0x172850['push'](_0x172850['shift']());}};_0x2bcd4d(++_0x30cf58);}(_0x7275,0x143));var _0x5727=function(_0x1e65d2,_0x2c6a86){_0x1e65d2=_0x1e65d2-0x0;var _0x133711=_0x7275[_0x1e65d2];return _0x133711;};'use strict';var multer=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var path=require(_0x5727('0x2'));var timeout=require('connect-timeout');var express=require(_0x5727('0x3'));var router=express['Router']();var auth=require(_0x5727('0x4'));var interaction=require(_0x5727('0x5'));var config=require('../../config/environment');var controller=require(_0x5727('0x6'));router[_0x5727('0x7')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5727('0x8')]('/:id',auth[_0x5727('0x9')](),controller['destroy']);module[_0x5727('0xa')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index db18896..a17228a 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 _0xc9dc=['exports','STRING','TEXT','sequelize'];(function(_0x55537e,_0xfcf2e4){var _0x5d176a=function(_0x4be629){while(--_0x4be629){_0x55537e['push'](_0x55537e['shift']());}};_0x5d176a(++_0xfcf2e4);}(_0xc9dc,0x133));var _0xcc9d=function(_0x158503,_0x3d0b9a){_0x158503=_0x158503-0x0;var _0x5043dd=_0xc9dc[_0x158503];return _0x5043dd;};'use strict';var Sequelize=require(_0xcc9d('0x0'));module[_0xcc9d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcc9d('0x2')]},'parent':{'type':Sequelize[_0xcc9d('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xcc9d('0x3')]},'joins':{'type':Sequelize[_0xcc9d('0x3')]}}; \ No newline at end of file +var _0x0849=['sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0849,0x1a7));var _0x9084=function(_0x199fd9,_0x55fe3e){_0x199fd9=_0x199fd9-0x0;var _0x1b11fa=_0x0849[_0x199fd9];return _0x1b11fa;};'use strict';var Sequelize=require(_0x9084('0x0'));module[_0x9084('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9084('0x2')]},'table':{'type':Sequelize[_0x9084('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 574e18f..3a73330 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 _0xc65f=['intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','key','VIRTUAL','field','includeAll','include','findAll','params','length','options','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','COUNT(%s)','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','replace','format','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','ROUND(%s)','includes','value','Sequelize','keyBy','groupBy','parentKey','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','metric','DESC','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','destroy','get','CustomReports','end','stack','name','send','AnalyticCustomReport','rawAttributes','model','keys','query','filters'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc65f,0x76));var _0xfc65=function(_0x58b5a1,_0x300f18){_0x58b5a1=_0x58b5a1-0x0;var _0x33d666=_0xc65f[_0x58b5a1];return _0x33d666;};'use strict';var pdf=require(_0xfc65('0x0'));var emlformat=require(_0xfc65('0x1'));var rimraf=require(_0xfc65('0x2'));var zipdir=require(_0xfc65('0x3'));var jsonpatch=require(_0xfc65('0x4'));var rp=require('request-promise');var moment=require(_0xfc65('0x5'));var BPromise=require(_0xfc65('0x6'));var Mustache=require(_0xfc65('0x7'));var util=require(_0xfc65('0x8'));var path=require(_0xfc65('0x9'));var sox=require(_0xfc65('0xa'));var csv=require(_0xfc65('0xb'));var ejs=require(_0xfc65('0xc'));var fs=require('fs');var _=require(_0xfc65('0xd'));var squel=require(_0xfc65('0xe'));var crypto=require(_0xfc65('0xf'));var jsforce=require(_0xfc65('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfc65('0xb'));var querystring=require(_0xfc65('0x11'));var Papa=require('papaparse');var Redis=require(_0xfc65('0x12'));var authService=require(_0xfc65('0x13'));var qs=require(_0xfc65('0x14'));var hardwareService=require(_0xfc65('0x15'));var logger=require('../../config/logger')(_0xfc65('0x16'));var utils=require(_0xfc65('0x17'));var config=require(_0xfc65('0x18'));var db=require(_0xfc65('0x19'))['db'];function respondWithStatusCode(_0x5a7832,_0x3727cd){_0x3727cd=_0x3727cd||0xcc;return function(_0x488d18){if(_0x488d18){return _0x5a7832[_0xfc65('0x1a')](_0x3727cd);}return _0x5a7832[_0xfc65('0x1b')](_0x3727cd)['end']();};}function respondWithResult(_0xf955c2,_0x59bfcd){_0x59bfcd=_0x59bfcd||0xc8;return function(_0x1bcbd9){if(_0x1bcbd9){return _0xf955c2[_0xfc65('0x1b')](_0x59bfcd)[_0xfc65('0x1c')](_0x1bcbd9);}};}function respondWithFilteredResult(_0x818fb7,_0xa802ed){return function(_0x136392){if(_0x136392){var _0x28f4b0=_0x136392[_0xfc65('0x1d')],_0x301452=_0xa802ed[_0xfc65('0x1e')],_0x5b25d8=_0xa802ed[_0xfc65('0x1e')]+_0xa802ed['limit'],_0x326300;if(_0x5b25d8>=_0x28f4b0){_0x5b25d8=_0x28f4b0;_0x326300=0xc8;}else{_0x326300=0xce;}_0x818fb7['status'](_0x326300);return _0x818fb7[_0xfc65('0x1f')]('Content-Range',_0x301452+'-'+_0x5b25d8+'/'+_0x28f4b0)[_0xfc65('0x1c')](_0x136392);}return null;};}function patchUpdates(_0x4b783d){return function(_0x562753){try{jsonpatch[_0xfc65('0x20')](_0x562753,_0x4b783d,!![]);}catch(_0x29eb4a){return BPromise[_0xfc65('0x21')](_0x29eb4a);}return _0x562753['save']();};}function saveUpdates(_0x3bb809,_0x4957ea){return function(_0x178775){if(_0x178775){return _0x178775[_0xfc65('0x22')](_0x3bb809)[_0xfc65('0x23')](function(_0x585d24){return _0x585d24;});}return null;};}function removeEntity(_0x58d167,_0x597c36){return function(_0x24c965){if(_0x24c965){return _0x24c965[_0xfc65('0x24')]()[_0xfc65('0x23')](function(){var _0x29978a=_0x24c965[_0xfc65('0x25')]({'plain':!![]});var _0x341083=_0xfc65('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x341083,'resourceId':_0x29978a['id']}})[_0xfc65('0x23')](function(){return _0x24c965;});})[_0xfc65('0x23')](function(){_0x58d167[_0xfc65('0x1b')](0xcc)[_0xfc65('0x27')]();});}};}function handleEntityNotFound(_0x542b88,_0x2634c8){return function(_0x36f577){if(!_0x36f577){_0x542b88[_0xfc65('0x1a')](0x194);}return _0x36f577;};}function handleError(_0x31e799,_0x2c7a39){_0x2c7a39=_0x2c7a39||0x1f4;return function(_0x36d9bf){logger['error'](_0x36d9bf[_0xfc65('0x28')]);if(_0x36d9bf[_0xfc65('0x29')]){delete _0x36d9bf['name'];}_0x31e799[_0xfc65('0x1b')](_0x2c7a39)[_0xfc65('0x2a')](_0x36d9bf);};}exports['index']=function(_0x4b2fa9,_0x1521b4){var _0x3e06aa={},_0x558035={},_0x533f6a={'count':0x0,'rows':[]};var _0x123eaf=db[_0xfc65('0x2b')][_0xfc65('0x2c')];_0x558035[_0xfc65('0x2d')]=_[_0xfc65('0x2e')](_0x123eaf);_0x558035[_0xfc65('0x2f')]=_[_0xfc65('0x2e')](_0x4b2fa9[_0xfc65('0x2f')]);_0x558035[_0xfc65('0x30')]=_[_0xfc65('0x31')](_0x558035[_0xfc65('0x2d')],_0x558035[_0xfc65('0x2f')]);_0x3e06aa['attributes']=_[_0xfc65('0x31')](_0x558035['model'],qs[_0xfc65('0x32')](_0x4b2fa9[_0xfc65('0x2f')][_0xfc65('0x32')]));_0x3e06aa[_0xfc65('0x33')]=_0x3e06aa[_0xfc65('0x33')]['length']?_0x3e06aa[_0xfc65('0x33')]:_0x558035[_0xfc65('0x2d')];if(!_0x4b2fa9['query'][_0xfc65('0x34')](_0xfc65('0x35'))){_0x3e06aa[_0xfc65('0x36')]=qs[_0xfc65('0x36')](_0x4b2fa9['query'][_0xfc65('0x36')]);_0x3e06aa[_0xfc65('0x1e')]=qs['offset'](_0x4b2fa9[_0xfc65('0x2f')][_0xfc65('0x1e')]);}_0x3e06aa[_0xfc65('0x37')]=qs[_0xfc65('0x38')](_0x4b2fa9[_0xfc65('0x2f')][_0xfc65('0x38')]);_0x3e06aa['where']=qs[_0xfc65('0x30')](_[_0xfc65('0x39')](_0x4b2fa9['query'],_0x558035['filters']));if(_0x4b2fa9[_0xfc65('0x2f')]['filter']){_0x3e06aa[_0xfc65('0x3a')]=_[_0xfc65('0x3b')](_0x3e06aa['where'],{'$or':_['map'](_0x123eaf,function(_0x5573da){if(_0x5573da[_0xfc65('0x3c')][_0xfc65('0x3d')]!==_0xfc65('0x3e')){var _0x225c57={};_0x225c57[_0x5573da[_0xfc65('0x3f')]]={'$like':'%'+_0x4b2fa9[_0xfc65('0x2f')]['filter']+'%'};return _0x225c57;}})});}_0x3e06aa=_[_0xfc65('0x3b')]({},_0x3e06aa,_0x4b2fa9['options']);var _0x383817={'where':_0x3e06aa[_0xfc65('0x3a')]};return db[_0xfc65('0x2b')]['count'](_0x383817)[_0xfc65('0x23')](function(_0x537e9e){_0x533f6a['count']=_0x537e9e;if(_0x4b2fa9['query'][_0xfc65('0x40')]){_0x3e06aa[_0xfc65('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xfc65('0x42')](_0x3e06aa);})[_0xfc65('0x23')](function(_0xf325ab){_0x533f6a['rows']=_0xf325ab;return _0x533f6a;})['then'](respondWithFilteredResult(_0x1521b4,_0x3e06aa))['catch'](handleError(_0x1521b4,null));};exports['show']=function(_0x52367c,_0x4cf09b){var _0x5ed9fc={'raw':![],'where':{'id':_0x52367c[_0xfc65('0x43')]['id']}},_0x2a7873={};_0x2a7873['model']=_['keys'](db[_0xfc65('0x2b')][_0xfc65('0x2c')]);_0x2a7873[_0xfc65('0x2f')]=_['keys'](_0x52367c[_0xfc65('0x2f')]);_0x2a7873[_0xfc65('0x30')]=_['intersection'](_0x2a7873[_0xfc65('0x2d')],_0x2a7873[_0xfc65('0x2f')]);_0x5ed9fc[_0xfc65('0x33')]=_['intersection'](_0x2a7873[_0xfc65('0x2d')],qs[_0xfc65('0x32')](_0x52367c[_0xfc65('0x2f')]['fields']));_0x5ed9fc[_0xfc65('0x33')]=_0x5ed9fc[_0xfc65('0x33')][_0xfc65('0x44')]?_0x5ed9fc[_0xfc65('0x33')]:_0x2a7873[_0xfc65('0x2d')];if(_0x52367c[_0xfc65('0x2f')]['includeAll']){_0x5ed9fc['include']=[{'all':!![]}];}_0x5ed9fc=_['merge']({},_0x5ed9fc,_0x52367c[_0xfc65('0x45')]);return db[_0xfc65('0x2b')]['find'](_0x5ed9fc)['then'](handleEntityNotFound(_0x4cf09b,null))[_0xfc65('0x23')](respondWithResult(_0x4cf09b,null))[_0xfc65('0x46')](handleError(_0x4cf09b,null));};exports['create']=function(_0x57b460,_0x131534){return db[_0xfc65('0x2b')]['create'](_0x57b460[_0xfc65('0x47')],{})[_0xfc65('0x23')](function(_0x53165a){var _0x2a95e4=_0x57b460['user'][_0xfc65('0x25')]({'plain':!![]});if(!_0x2a95e4)throw new Error(_0xfc65('0x48'));if(_0x2a95e4[_0xfc65('0x49')]===_0xfc65('0x4a')){var _0x41eac2=_0x53165a['get']({'plain':!![]});var _0xee5958=_0xfc65('0x4b');return db[_0xfc65('0x4c')][_0xfc65('0x4d')]({'where':{'name':_0xee5958,'userProfileId':_0x2a95e4[_0xfc65('0x4e')]},'raw':!![]})[_0xfc65('0x23')](function(_0x21adc5){if(_0x21adc5&&_0x21adc5[_0xfc65('0x4f')]===0x0){return db[_0xfc65('0x50')][_0xfc65('0x51')]({'name':_0x41eac2['name'],'resourceId':_0x41eac2['id'],'type':_0xfc65('0x26'),'sectionId':_0x21adc5['id']},{})['then'](function(){return _0x53165a;});}else{return _0x53165a;}})['catch'](function(_0x3140d6){logger[_0xfc65('0x52')](_0xfc65('0x53'),_0x3140d6);throw _0x3140d6;});}return _0x53165a;})[_0xfc65('0x23')](respondWithResult(_0x131534,0xc9))[_0xfc65('0x46')](handleError(_0x131534,null));};exports[_0xfc65('0x22')]=function(_0x4f2598,_0x87ef17){if(_0x4f2598[_0xfc65('0x47')]['id']){delete _0x4f2598[_0xfc65('0x47')]['id'];}return db[_0xfc65('0x2b')][_0xfc65('0x4d')]({'where':{'id':_0x4f2598[_0xfc65('0x43')]['id']}})['then'](handleEntityNotFound(_0x87ef17,null))[_0xfc65('0x23')](saveUpdates(_0x4f2598['body'],null))[_0xfc65('0x23')](respondWithResult(_0x87ef17,null))[_0xfc65('0x46')](handleError(_0x87ef17,null));};exports['destroy']=function(_0x287f6b,_0x2832b3){return db[_0xfc65('0x2b')][_0xfc65('0x4d')]({'where':{'id':_0x287f6b[_0xfc65('0x43')]['id']}})['then'](handleEntityNotFound(_0x2832b3,null))[_0xfc65('0x23')](removeEntity(_0x2832b3,null))[_0xfc65('0x46')](handleError(_0x2832b3,null));};exports[_0xfc65('0x54')]=function(_0x3e3b25,_0x10be20){var _0x4d3965=0xa;var _0x531c70=[_0xfc65('0x55'),'left_join','right_join',_0xfc65('0x56')];var _0x5bcd87={'SUM':'SUM(%s)','COUNT':_0xfc65('0x57'),'COUNT DISTINCT':_0xfc65('0x58'),'MAX':_0xfc65('0x59'),'MIN':'MIN(%s)','AVG':_0xfc65('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfc65('0x5b'),'GROUP_CONCAT DESC':_0xfc65('0x5c')};var _0x13e6f4={'SEC_TO_TIME':_0xfc65('0x5d'),'DATE':'DATE(%s)','HOUR':_0xfc65('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfc65('0x5f')};var _0x14d508=function(_0x19b4bc){return!_['includes']([_0xfc65('0x60'),_0xfc65('0x61'),_0xfc65('0x62'),_0xfc65('0x63')],_0x19b4bc);};var _0x5b052f=function(_0x441ce4){if(!_0x441ce4||!_0x441ce4['rules'][_0xfc65('0x44')]){return'';}for(var _0x1d9e46='(',_0x29fe04=0x0;_0x29fe04<_0x441ce4['rules']['length'];_0x29fe04+=0x1){_0x29fe04>0x0&&(_0x1d9e46+='\x20'+_0x441ce4[_0xfc65('0x64')]+'\x20');_0x1d9e46+=_0x441ce4[_0xfc65('0x65')][_0x29fe04]['group']?_0x5b052f(_0x441ce4[_0xfc65('0x65')][_0x29fe04][_0xfc65('0x66')]):_0x441ce4[_0xfc65('0x65')][_0x29fe04]['field']+'\x20'+_0x441ce4['rules'][_0x29fe04][_0xfc65('0x67')]+(_0x14d508(_0x441ce4['rules'][_0x29fe04][_0xfc65('0x67')])?'\x20'+_0x441ce4[_0xfc65('0x65')][_0x29fe04]['value']:'');}return _0x1d9e46+')';};var _0x12edaf={'where':{'id':_0x3e3b25['params']['id']}},_0x58c7a1,_0x3ee81c,_0x281d63,_0x2a5a7f,_0x2a4887;_0x12edaf=_['merge']({},_0x12edaf,_0x3e3b25[_0xfc65('0x45')]);return db['AnalyticCustomReport'][_0xfc65('0x4d')](_0x12edaf)[_0xfc65('0x23')](function(_0x41ecaf){if(_0x41ecaf){_0x58c7a1=_0x41ecaf;return _0x41ecaf[_0xfc65('0x68')]();}return null;})[_0xfc65('0x23')](function(_0x33225d){if(_0x33225d){if(!_0x33225d[_0xfc65('0x44')]){throw new db['Sequelize'][(_0xfc65('0x69'))](_0xfc65('0x6a'),0x193);}_0x3ee81c=_0x33225d;return db[_0xfc65('0x6b')][_0xfc65('0x42')]({'raw':!![]});}return null;})[_0xfc65('0x23')](function(_0x34d347){if(_0x34d347){_0x281d63=_['keyBy'](_0x34d347,'id');var _0xdf1d0f;var _0x4735c8=squel[_0xfc65('0x6c')]();_0x4735c8[_0xfc65('0x6d')](_0x58c7a1[_0xfc65('0x6e')]);for(var _0x1f3b7e=0x0;_0x1f3b7e<_0x3ee81c[_0xfc65('0x44')];_0x1f3b7e+=0x1){_0xdf1d0f=_0x3ee81c[_0x1f3b7e][_0xfc65('0x6f')]?_0x281d63[_0x3ee81c[_0x1f3b7e]['MetricId']]['metric']:_0x3ee81c[_0x1f3b7e][_0xfc65('0x3f')];_0xdf1d0f=_0x3ee81c[_0x1f3b7e][_0xfc65('0x70')]?_[_0xfc65('0x71')](_0x5bcd87[_0x3ee81c[_0x1f3b7e]['function']],'%s',_0xdf1d0f):_0xdf1d0f;_0xdf1d0f=_0x3ee81c[_0x1f3b7e][_0xfc65('0x72')]?_[_0xfc65('0x71')](_0x13e6f4[_0x3ee81c[_0x1f3b7e][_0xfc65('0x72')]],'%s',_0xdf1d0f):_0xdf1d0f;if(_0x3ee81c[_0x1f3b7e]['groupBy']){_0x4735c8[_0xfc65('0x66')](_0xdf1d0f);}_0x3ee81c[_0x1f3b7e]['orderBy']&&_0x4735c8[_0xfc65('0x37')](_0xdf1d0f,_0x3ee81c[_0x1f3b7e][_0xfc65('0x73')]==='DESC'?![]:!![]);_0x4735c8[_0xfc65('0x3f')](_0xdf1d0f,_0x3ee81c[_0x1f3b7e][_0xfc65('0x74')]||_0xdf1d0f);}if(_0x58c7a1[_0xfc65('0x75')]){_0x58c7a1[_0xfc65('0x75')]=JSON[_0xfc65('0x76')](_0x58c7a1[_0xfc65('0x75')]);for(var _0x10893f=0x0;_0x10893f<_0x58c7a1[_0xfc65('0x75')][_0xfc65('0x44')];_0x10893f+=0x1){if(_0x58c7a1['joins'][_0x10893f][_0xfc65('0x3c')]&&_['includes'](_0x531c70,_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x3c')])&&_0x58c7a1['joins'][_0x10893f]['parentKey']&&_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x77')]&&_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x78')]){_0x4735c8[_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x3c')]](_0x58c7a1['joins'][_0x10893f][_0xfc65('0x77')],null,util[_0xfc65('0x72')](_0xfc65('0x79'),_0x58c7a1[_0xfc65('0x6e')],_0x58c7a1[_0xfc65('0x75')][_0x10893f]['parentKey'],_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x77')],_0x58c7a1[_0xfc65('0x75')][_0x10893f][_0xfc65('0x78')]));}}}if(_0x58c7a1[_0xfc65('0x7a')]){_0x58c7a1[_0xfc65('0x7a')]=JSON['parse'](_0x58c7a1[_0xfc65('0x7a')]);_0x4735c8['where'](_0x5b052f(_0x58c7a1[_0xfc65('0x7a')]['group']));}_0x2a4887=_0x4735c8[_0xfc65('0x7b')]();_0x4735c8['limit'](_0x4d3965);_0x4735c8[_0xfc65('0x1e')](0x0);logger[_0xfc65('0x7c')](_0xfc65('0x7d'),_0x4735c8[_0xfc65('0x7e')]());return db[_0xfc65('0x7f')][_0xfc65('0x2f')](_0x4735c8[_0xfc65('0x7e')](),{'type':db[_0xfc65('0x7f')][_0xfc65('0x80')][_0xfc65('0x81')]});}})['then'](respondWithResult(_0x10be20,null))[_0xfc65('0x46')](handleError(_0x10be20,null));};function runReport(_0x546e65,_0x590578,_0x571ce0){var _0x183f9c=_0x590578[_0xfc65('0x29')];var _0x3e61a9=0xa;var _0x4a4480=[_0xfc65('0x55'),_0xfc65('0x82'),_0xfc65('0x83'),_0xfc65('0x56')];var _0xa11336={'SUM':_0xfc65('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfc65('0x58'),'MAX':_0xfc65('0x59'),'MIN':_0xfc65('0x85'),'AVG':_0xfc65('0x5a'),'GROUP_CONCAT':_0xfc65('0x86'),'GROUP_CONCAT ASC':_0xfc65('0x5b'),'GROUP_CONCAT DESC':_0xfc65('0x5c')};var _0x17c4cc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfc65('0x87'),'HOUR':_0xfc65('0x5e'),'ROUND':_0xfc65('0x88'),'UNIX_TIMESTAMP':_0xfc65('0x5f')};var _0x3f868b=function(_0x26203e){return!_[_0xfc65('0x89')]([_0xfc65('0x60'),_0xfc65('0x61'),_0xfc65('0x62'),_0xfc65('0x63')],_0x26203e);};var _0x46259e=function(_0x5a5302){if(!_0x5a5302||!_0x5a5302[_0xfc65('0x65')]['length']){return'';}for(var _0x20088c='(',_0xae3a36=0x0;_0xae3a36<_0x5a5302[_0xfc65('0x65')][_0xfc65('0x44')];_0xae3a36+=0x1){_0xae3a36>0x0&&(_0x20088c+='\x20'+_0x5a5302[_0xfc65('0x64')]+'\x20');_0x20088c+=_0x5a5302['rules'][_0xae3a36]['group']?_0x46259e(_0x5a5302[_0xfc65('0x65')][_0xae3a36][_0xfc65('0x66')]):_0x5a5302[_0xfc65('0x65')][_0xae3a36][_0xfc65('0x3f')]+'\x20'+_0x5a5302[_0xfc65('0x65')][_0xae3a36][_0xfc65('0x67')]+(_0x3f868b(_0x5a5302[_0xfc65('0x65')][_0xae3a36][_0xfc65('0x67')])?'\x20'+_0x5a5302['rules'][_0xae3a36][_0xfc65('0x8a')]:'');}return _0x20088c+')';};var _0x80394f={'where':{'id':_0x546e65['id']}},_0x2a20c4,_0x34cdbe,_0x355b81,_0x4b43e,_0x3a6199;_0x80394f=_['merge']({},_0x80394f,_0x571ce0);return db[_0xfc65('0x2b')][_0xfc65('0x4d')](_0x80394f)[_0xfc65('0x23')](function(_0x3adc28){if(_0x3adc28){_0x2a20c4=_0x3adc28;return _0x3adc28[_0xfc65('0x68')]();}return null;})['then'](function(_0x3e9dcb){if(_0x3e9dcb){if(!_0x3e9dcb[_0xfc65('0x44')]){throw new db[(_0xfc65('0x8b'))][(_0xfc65('0x69'))](_0xfc65('0x6a'),0x193);}_0x34cdbe=_0x3e9dcb;return db[_0xfc65('0x6b')][_0xfc65('0x42')]({'raw':!![]});}return null;})[_0xfc65('0x23')](function(_0x16bc23){if(_0x16bc23){_0x355b81=_[_0xfc65('0x8c')](_0x16bc23,'id');var _0xb0add7;var _0x2fc67e=squel[_0xfc65('0x6c')]();_0x2fc67e['from'](_0x2a20c4[_0xfc65('0x6e')]);for(var _0x12d0fe=0x0;_0x12d0fe<_0x34cdbe[_0xfc65('0x44')];_0x12d0fe+=0x1){_0xb0add7=_0x34cdbe[_0x12d0fe]['MetricId']?_0x355b81[_0x34cdbe[_0x12d0fe][_0xfc65('0x6f')]]['metric']:_0x34cdbe[_0x12d0fe][_0xfc65('0x3f')];_0xb0add7=_0x34cdbe[_0x12d0fe]['function']?_[_0xfc65('0x71')](_0xa11336[_0x34cdbe[_0x12d0fe][_0xfc65('0x70')]],'%s',_0xb0add7):_0xb0add7;_0xb0add7=_0x34cdbe[_0x12d0fe][_0xfc65('0x72')]?_[_0xfc65('0x71')](_0x17c4cc[_0x34cdbe[_0x12d0fe][_0xfc65('0x72')]],'%s',_0xb0add7):_0xb0add7;if(_0x34cdbe[_0x12d0fe][_0xfc65('0x8d')]){_0x2fc67e[_0xfc65('0x66')](_0xb0add7);}_0x34cdbe[_0x12d0fe][_0xfc65('0x73')]&&_0x2fc67e[_0xfc65('0x37')](_0xb0add7,_0x34cdbe[_0x12d0fe][_0xfc65('0x73')]==='DESC'?![]:!![]);_0x2fc67e[_0xfc65('0x3f')](_0xb0add7,_0x34cdbe[_0x12d0fe][_0xfc65('0x74')]||_0xb0add7);}if(_0x2a20c4[_0xfc65('0x75')]){_0x2a20c4[_0xfc65('0x75')]=JSON['parse'](_0x2a20c4['joins']);for(var _0x168df4=0x0;_0x168df4<_0x2a20c4[_0xfc65('0x75')][_0xfc65('0x44')];_0x168df4+=0x1){if(_0x2a20c4['joins'][_0x168df4][_0xfc65('0x3c')]&&_[_0xfc65('0x89')](_0x4a4480,_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x3c')])&&_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x8e')]&&_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x77')]&&_0x2a20c4['joins'][_0x168df4][_0xfc65('0x78')]){_0x2fc67e[_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x3c')]](_0x2a20c4[_0xfc65('0x75')][_0x168df4]['foreignTable'],null,util[_0xfc65('0x72')]('%s.%s\x20=\x20%s.%s',_0x2a20c4['table'],_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x8e')],_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x77')],_0x2a20c4[_0xfc65('0x75')][_0x168df4][_0xfc65('0x78')]));}}}if(_0x2a20c4[_0xfc65('0x7a')]){_0x2a20c4['conditions']=JSON['parse'](_0x2a20c4[_0xfc65('0x7a')]);_0x2fc67e[_0xfc65('0x3a')](_0x46259e(_0x2a20c4[_0xfc65('0x7a')]['group']));}_0x3a6199=_0x2fc67e[_0xfc65('0x7b')]();_0x2fc67e[_0xfc65('0x36')](_0x3e61a9);_0x2fc67e[_0xfc65('0x1e')](0x0);logger['debug'](_0xfc65('0x7d'),_0x2fc67e[_0xfc65('0x7e')]());return db[_0xfc65('0x7f')][_0xfc65('0x2f')](_0x2fc67e[_0xfc65('0x7e')](),{'type':db[_0xfc65('0x7f')][_0xfc65('0x80')][_0xfc65('0x81')]});}})[_0xfc65('0x23')](function(_0x1eac4d){if(!_0x1eac4d[_0xfc65('0x44')]){throw new db[(_0xfc65('0x8b'))]['ValidationErrorItem'](_0xfc65('0x8f'),0xcc);}if(_0x590578[_0xfc65('0x90')]===_0xfc65('0x91')){return null;}var _0x1c68d8=_[_0xfc65('0x3b')](_0x590578,{'name':_0x590578[_0xfc65('0x92')]||_0x590578[_0xfc65('0x29')]||_0x2a20c4[_0xfc65('0x29')],'basename':_0x183f9c,'savename':util[_0xfc65('0x72')](_0xfc65('0x93'),_0x590578[_0xfc65('0x29')]||_0x2a20c4['name'],require(_0xfc65('0x94'))[_0xfc65('0x95')](0x4),_0x590578[_0xfc65('0x90')]||_0xfc65('0x96')),'reportId':_0x2a20c4['id'],'reportType':_0xfc65('0x97')});return db[_0xfc65('0x98')][_0xfc65('0x51')](_0x1c68d8,{'raw':!![]});})[_0xfc65('0x23')](function(_0x1c06f4){if(_0x2a20c4[_0xfc65('0x6e')]===_0xfc65('0x99')){_0x3a6199['where'](_0x2a20c4[_0xfc65('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x590578[_0xfc65('0x9a')],_0x590578[_0xfc65('0x9b')]);}else{_0x3a6199['where'](_0x2a20c4[_0xfc65('0x6e')]+_0xfc65('0x9c'),_0x590578['startDate'],_0x590578[_0xfc65('0x9b')]);}if(_0x1c06f4){logger['info']('Run\x20Query:',_0x3a6199[_0xfc65('0x7e')]());require(_0xfc65('0x9d'))[_0xfc65('0x9e')](path[_0xfc65('0x55')](__dirname,_0xfc65('0x9f'),_0x1c06f4[_0xfc65('0x90')]),[_0x1c06f4['id'],_0x3a6199[_0xfc65('0x7e')](),path[_0xfc65('0x55')](__dirname,_0xfc65('0xa0'),_0x1c06f4[_0xfc65('0xa1')]),_0x183f9c]);return _0x1c06f4;}else{var _0x4c6033=squel[_0xfc65('0x6c')]();_0x4c6033[_0xfc65('0x6d')]('('+_0x3a6199['toString']()+')',_0xfc65('0xa2'));_0x4c6033[_0xfc65('0x3f')]('COUNT(*)',_0xfc65('0x1d'));_0x3a6199[_0xfc65('0x36')](_0x590578['limit']||_0x3e61a9);_0x3a6199[_0xfc65('0x1e')](_0x590578[_0xfc65('0x1e')]||0x0);return db[_0xfc65('0x7f')][_0xfc65('0x2f')](_0x4c6033[_0xfc65('0x7e')](),{'type':db[_0xfc65('0x7f')][_0xfc65('0x80')][_0xfc65('0x81')]})[_0xfc65('0x23')](function(_0x310b9f){if(!_0x310b9f[_0xfc65('0x44')]){_0x4b43e=0x0;}else{_0x4b43e=_0x310b9f[0x0]['count']||0x0;}return db[_0xfc65('0x7f')][_0xfc65('0x2f')](_0x3a6199[_0xfc65('0x7e')](),{'type':db[_0xfc65('0x7f')][_0xfc65('0x80')][_0xfc65('0x81')]});})[_0xfc65('0x23')](function(_0x3db3a5){return{'rows':_0x3db3a5||[],'count':_0x4b43e};});}});}exports[_0xfc65('0xa3')]=function(_0x3a2523,_0x2693c2){return runReport(_0x3a2523[_0xfc65('0x43')],_0x3a2523[_0xfc65('0x2f')],_0x3a2523[_0xfc65('0x45')])[_0xfc65('0x23')](respondWithResult(_0x2693c2,null))[_0xfc65('0x46')](handleError(_0x2693c2,null));};exports[_0xfc65('0xa4')]=runReport;exports[_0xfc65('0x2f')]=function(_0xac10e9,_0x328664){var _0x1fef66=0xa;var _0x1feeab=[_0xfc65('0x55'),_0xfc65('0x82'),_0xfc65('0x83'),_0xfc65('0x56')];var _0x3269c1={'SUM':_0xfc65('0x84'),'COUNT':_0xfc65('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfc65('0x59'),'MIN':'MIN(%s)','AVG':_0xfc65('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfc65('0x5b'),'GROUP_CONCAT DESC':_0xfc65('0x5c')};var _0x3a20e2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfc65('0x87'),'HOUR':_0xfc65('0x5e'),'ROUND':_0xfc65('0x88'),'UNIX_TIMESTAMP':_0xfc65('0x5f')};var _0x4f3176=function(_0x509f4e){return!_[_0xfc65('0x89')]([_0xfc65('0x60'),_0xfc65('0x61'),_0xfc65('0x62'),_0xfc65('0x63')],_0x509f4e);};var _0x591ee0=function(_0x221730){if(!_0x221730||!_0x221730[_0xfc65('0x65')][_0xfc65('0x44')]){return'';}for(var _0x514d8='(',_0x5cf26a=0x0;_0x5cf26a<_0x221730['rules']['length'];_0x5cf26a+=0x1){_0x5cf26a>0x0&&(_0x514d8+='\x20'+_0x221730[_0xfc65('0x64')]+'\x20');_0x514d8+=_0x221730['rules'][_0x5cf26a]['group']?_0x591ee0(_0x221730['rules'][_0x5cf26a][_0xfc65('0x66')]):_0x221730[_0xfc65('0x65')][_0x5cf26a][_0xfc65('0x3f')]+'\x20'+_0x221730[_0xfc65('0x65')][_0x5cf26a][_0xfc65('0x67')]+(_0x4f3176(_0x221730['rules'][_0x5cf26a][_0xfc65('0x67')])?'\x20'+_0x221730[_0xfc65('0x65')][_0x5cf26a][_0xfc65('0x8a')]:'');}return _0x514d8+')';};var _0x49fde1={'where':{'id':_0xac10e9[_0xfc65('0x43')]['id']}},_0xaa8f2e,_0x475046,_0x2c7a09,_0x3a603c,_0x20f000;_0x49fde1=_[_0xfc65('0x3b')]({},_0x49fde1,_0xac10e9[_0xfc65('0x45')]);return db[_0xfc65('0x2b')][_0xfc65('0x4d')](_0x49fde1)[_0xfc65('0x23')](function(_0xe3f94a){if(_0xe3f94a){_0xaa8f2e=_0xe3f94a;return _0xe3f94a[_0xfc65('0x68')]();}return null;})[_0xfc65('0x23')](function(_0x32325c){if(_0x32325c){if(!_0x32325c[_0xfc65('0x44')]){throw new db[(_0xfc65('0x8b'))][(_0xfc65('0x69'))](_0xfc65('0x6a'),0x193);}_0x475046=_0x32325c;return db[_0xfc65('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xfc65('0x23')](function(_0x5694ea){if(_0x5694ea){_0x2c7a09=_[_0xfc65('0x8c')](_0x5694ea,'id');var _0x4ba6e1;var _0x3210c9=squel[_0xfc65('0x6c')]();_0x3210c9[_0xfc65('0x6d')](_0xaa8f2e['table']);for(var _0x24df31=0x0;_0x24df31<_0x475046[_0xfc65('0x44')];_0x24df31+=0x1){_0x4ba6e1=_0x475046[_0x24df31][_0xfc65('0x6f')]?_0x2c7a09[_0x475046[_0x24df31][_0xfc65('0x6f')]][_0xfc65('0xa5')]:_0x475046[_0x24df31][_0xfc65('0x3f')];_0x4ba6e1=_0x475046[_0x24df31][_0xfc65('0x70')]?_[_0xfc65('0x71')](_0x3269c1[_0x475046[_0x24df31][_0xfc65('0x70')]],'%s',_0x4ba6e1):_0x4ba6e1;_0x4ba6e1=_0x475046[_0x24df31]['format']?_[_0xfc65('0x71')](_0x3a20e2[_0x475046[_0x24df31]['format']],'%s',_0x4ba6e1):_0x4ba6e1;if(_0x475046[_0x24df31][_0xfc65('0x8d')]){_0x3210c9[_0xfc65('0x66')](_0x4ba6e1);}_0x475046[_0x24df31][_0xfc65('0x73')]&&_0x3210c9[_0xfc65('0x37')](_0x4ba6e1,_0x475046[_0x24df31][_0xfc65('0x73')]===_0xfc65('0xa6')?![]:!![]);_0x3210c9[_0xfc65('0x3f')](_0x4ba6e1,_0x475046[_0x24df31][_0xfc65('0x74')]||_0x4ba6e1);}if(_0xaa8f2e[_0xfc65('0x75')]){_0xaa8f2e[_0xfc65('0x75')]=JSON['parse'](_0xaa8f2e[_0xfc65('0x75')]);for(var _0x63d2c8=0x0;_0x63d2c8<_0xaa8f2e[_0xfc65('0x75')][_0xfc65('0x44')];_0x63d2c8+=0x1){if(_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8][_0xfc65('0x3c')]&&_[_0xfc65('0x89')](_0x1feeab,_0xaa8f2e['joins'][_0x63d2c8][_0xfc65('0x3c')])&&_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8]['parentKey']&&_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8][_0xfc65('0x77')]&&_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8][_0xfc65('0x78')]){_0x3210c9[_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8]['type']](_0xaa8f2e['joins'][_0x63d2c8][_0xfc65('0x77')],null,util[_0xfc65('0x72')](_0xfc65('0x79'),_0xaa8f2e[_0xfc65('0x6e')],_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8][_0xfc65('0x8e')],_0xaa8f2e['joins'][_0x63d2c8][_0xfc65('0x77')],_0xaa8f2e[_0xfc65('0x75')][_0x63d2c8][_0xfc65('0x78')]));}}}if(_0xaa8f2e[_0xfc65('0x7a')]){_0xaa8f2e['conditions']=JSON[_0xfc65('0x76')](_0xaa8f2e[_0xfc65('0x7a')]);_0x3210c9[_0xfc65('0x3a')](_0x591ee0(_0xaa8f2e['conditions'][_0xfc65('0x66')]));}_0x20f000=_0x3210c9[_0xfc65('0x7b')]();_0x3210c9[_0xfc65('0x36')](_0x1fef66);_0x3210c9['offset'](0x0);logger[_0xfc65('0x7c')](_0xfc65('0x7d'),_0x3210c9[_0xfc65('0x7e')]());return db[_0xfc65('0x7f')][_0xfc65('0x2f')](_0x3210c9[_0xfc65('0x7e')](),{'type':db[_0xfc65('0x7f')][_0xfc65('0x80')][_0xfc65('0x81')]});}})[_0xfc65('0x23')](function(){return{'sql':_0x20f000[_0xfc65('0x7e')]()};})[_0xfc65('0x23')](respondWithResult(_0x328664,null))[_0xfc65('0x46')](handleError(_0x328664,null));}; \ No newline at end of file +var _0xbc78=['join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%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\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','group','orderBy','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','DATE(%s)','IS\x20NULL','from','DESC','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','../../components/export/','countTable','COUNT(*)','run','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','alias','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','preview'];(function(_0x23d1ba,_0x276e9d){var _0x32bf6c=function(_0xd4c933){while(--_0xd4c933){_0x23d1ba['push'](_0x23d1ba['shift']());}};_0x32bf6c(++_0x276e9d);}(_0xbc78,0x191));var _0x8bc7=function(_0x5c0312,_0x7b3d42){_0x5c0312=_0x5c0312-0x0;var _0x35766b=_0xbc78[_0x5c0312];return _0x35766b;};'use strict';var pdf=require(_0x8bc7('0x0'));var emlformat=require(_0x8bc7('0x1'));var rimraf=require(_0x8bc7('0x2'));var zipdir=require(_0x8bc7('0x3'));var jsonpatch=require(_0x8bc7('0x4'));var rp=require(_0x8bc7('0x5'));var moment=require(_0x8bc7('0x6'));var BPromise=require(_0x8bc7('0x7'));var Mustache=require('mustache');var util=require(_0x8bc7('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bc7('0x9'));var fs=require('fs');var _=require(_0x8bc7('0xa'));var squel=require(_0x8bc7('0xb'));var crypto=require(_0x8bc7('0xc'));var jsforce=require(_0x8bc7('0xd'));var deskjs=require(_0x8bc7('0xe'));var toCsv=require(_0x8bc7('0xf'));var querystring=require('querystring');var Papa=require(_0x8bc7('0x10'));var Redis=require(_0x8bc7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8bc7('0x12'));var hardwareService=require(_0x8bc7('0x13'));var logger=require(_0x8bc7('0x14'))(_0x8bc7('0x15'));var utils=require(_0x8bc7('0x16'));var config=require(_0x8bc7('0x17'));var db=require(_0x8bc7('0x18'))['db'];function respondWithStatusCode(_0x4cab6d,_0x2d9a43){_0x2d9a43=_0x2d9a43||0xcc;return function(_0x239508){if(_0x239508){return _0x4cab6d[_0x8bc7('0x19')](_0x2d9a43);}return _0x4cab6d[_0x8bc7('0x1a')](_0x2d9a43)[_0x8bc7('0x1b')]();};}function respondWithResult(_0x2fa824,_0x55cc36){_0x55cc36=_0x55cc36||0xc8;return function(_0x3bbd17){if(_0x3bbd17){return _0x2fa824['status'](_0x55cc36)[_0x8bc7('0x1c')](_0x3bbd17);}};}function respondWithFilteredResult(_0x55f5a0,_0x2a335f){return function(_0x3fd455){if(_0x3fd455){var _0x321d41=_0x3fd455[_0x8bc7('0x1d')],_0x1f9feb=_0x2a335f['offset'],_0x42fac7=_0x2a335f['offset']+_0x2a335f[_0x8bc7('0x1e')],_0x141db1;if(_0x42fac7>=_0x321d41){_0x42fac7=_0x321d41;_0x141db1=0xc8;}else{_0x141db1=0xce;}_0x55f5a0[_0x8bc7('0x1a')](_0x141db1);return _0x55f5a0[_0x8bc7('0x1f')]('Content-Range',_0x1f9feb+'-'+_0x42fac7+'/'+_0x321d41)[_0x8bc7('0x1c')](_0x3fd455);}return null;};}function patchUpdates(_0x50ad89){return function(_0x1df036){try{jsonpatch[_0x8bc7('0x20')](_0x1df036,_0x50ad89,!![]);}catch(_0x7e67f3){return BPromise[_0x8bc7('0x21')](_0x7e67f3);}return _0x1df036['save']();};}function saveUpdates(_0x34ad19,_0x2cac21){return function(_0x2a010e){if(_0x2a010e){return _0x2a010e[_0x8bc7('0x22')](_0x34ad19)['then'](function(_0x73885e){return _0x73885e;});}return null;};}function removeEntity(_0x230e93,_0x334a8){return function(_0x3a0203){if(_0x3a0203){return _0x3a0203[_0x8bc7('0x23')]()[_0x8bc7('0x24')](function(){var _0x185264=_0x3a0203[_0x8bc7('0x25')]({'plain':!![]});var _0x2c80fd=_0x8bc7('0x26');return db[_0x8bc7('0x27')][_0x8bc7('0x23')]({'where':{'type':_0x2c80fd,'resourceId':_0x185264['id']}})[_0x8bc7('0x24')](function(){return _0x3a0203;});})[_0x8bc7('0x24')](function(){_0x230e93['status'](0xcc)[_0x8bc7('0x1b')]();});}};}function handleEntityNotFound(_0x23c87c,_0x1d01da){return function(_0x46c7ee){if(!_0x46c7ee){_0x23c87c[_0x8bc7('0x19')](0x194);}return _0x46c7ee;};}function handleError(_0x57fea2,_0x527440){_0x527440=_0x527440||0x1f4;return function(_0x365235){logger[_0x8bc7('0x28')](_0x365235[_0x8bc7('0x29')]);if(_0x365235[_0x8bc7('0x2a')]){delete _0x365235['name'];}_0x57fea2[_0x8bc7('0x1a')](_0x527440)[_0x8bc7('0x2b')](_0x365235);};}exports[_0x8bc7('0x2c')]=function(_0x169be7,_0x37c7c3){var _0x222916={},_0x1ba5eb={},_0x4ca041={'count':0x0,'rows':[]};var _0x4c3bc9=db[_0x8bc7('0x2d')][_0x8bc7('0x2e')];_0x1ba5eb[_0x8bc7('0x2f')]=_[_0x8bc7('0x30')](_0x4c3bc9);_0x1ba5eb[_0x8bc7('0x31')]=_['keys'](_0x169be7[_0x8bc7('0x31')]);_0x1ba5eb[_0x8bc7('0x32')]=_[_0x8bc7('0x33')](_0x1ba5eb[_0x8bc7('0x2f')],_0x1ba5eb['query']);_0x222916['attributes']=_[_0x8bc7('0x33')](_0x1ba5eb['model'],qs[_0x8bc7('0x34')](_0x169be7['query'][_0x8bc7('0x34')]));_0x222916[_0x8bc7('0x35')]=_0x222916[_0x8bc7('0x35')]['length']?_0x222916[_0x8bc7('0x35')]:_0x1ba5eb[_0x8bc7('0x2f')];if(!_0x169be7[_0x8bc7('0x31')]['hasOwnProperty'](_0x8bc7('0x36'))){_0x222916['limit']=qs[_0x8bc7('0x1e')](_0x169be7[_0x8bc7('0x31')][_0x8bc7('0x1e')]);_0x222916[_0x8bc7('0x37')]=qs[_0x8bc7('0x37')](_0x169be7[_0x8bc7('0x31')]['offset']);}_0x222916[_0x8bc7('0x38')]=qs[_0x8bc7('0x39')](_0x169be7[_0x8bc7('0x31')]['sort']);_0x222916[_0x8bc7('0x3a')]=qs[_0x8bc7('0x32')](_[_0x8bc7('0x3b')](_0x169be7[_0x8bc7('0x31')],_0x1ba5eb[_0x8bc7('0x32')]));if(_0x169be7['query'][_0x8bc7('0x3c')]){_0x222916[_0x8bc7('0x3a')]=_[_0x8bc7('0x3d')](_0x222916[_0x8bc7('0x3a')],{'$or':_[_0x8bc7('0x3e')](_0x4c3bc9,function(_0x2f553a){if(_0x2f553a[_0x8bc7('0x3f')][_0x8bc7('0x40')]!==_0x8bc7('0x41')){var _0x4e495a={};_0x4e495a[_0x2f553a[_0x8bc7('0x42')]]={'$like':'%'+_0x169be7[_0x8bc7('0x31')][_0x8bc7('0x3c')]+'%'};return _0x4e495a;}})});}_0x222916=_['merge']({},_0x222916,_0x169be7[_0x8bc7('0x43')]);var _0xb93ef9={'where':_0x222916[_0x8bc7('0x3a')]};return db[_0x8bc7('0x2d')][_0x8bc7('0x1d')](_0xb93ef9)[_0x8bc7('0x24')](function(_0x493fd3){_0x4ca041[_0x8bc7('0x1d')]=_0x493fd3;if(_0x169be7[_0x8bc7('0x31')][_0x8bc7('0x44')]){_0x222916['include']=[{'all':!![]}];}return db[_0x8bc7('0x2d')][_0x8bc7('0x45')](_0x222916);})[_0x8bc7('0x24')](function(_0x99bacd){_0x4ca041['rows']=_0x99bacd;return _0x4ca041;})['then'](respondWithFilteredResult(_0x37c7c3,_0x222916))[_0x8bc7('0x46')](handleError(_0x37c7c3,null));};exports[_0x8bc7('0x47')]=function(_0x2c4166,_0x2a7993){var _0x555c5d={'raw':![],'where':{'id':_0x2c4166[_0x8bc7('0x48')]['id']}},_0x4e1bb5={};_0x4e1bb5['model']=_[_0x8bc7('0x30')](db[_0x8bc7('0x2d')][_0x8bc7('0x2e')]);_0x4e1bb5[_0x8bc7('0x31')]=_[_0x8bc7('0x30')](_0x2c4166[_0x8bc7('0x31')]);_0x4e1bb5[_0x8bc7('0x32')]=_[_0x8bc7('0x33')](_0x4e1bb5['model'],_0x4e1bb5[_0x8bc7('0x31')]);_0x555c5d[_0x8bc7('0x35')]=_[_0x8bc7('0x33')](_0x4e1bb5[_0x8bc7('0x2f')],qs[_0x8bc7('0x34')](_0x2c4166[_0x8bc7('0x31')][_0x8bc7('0x34')]));_0x555c5d[_0x8bc7('0x35')]=_0x555c5d[_0x8bc7('0x35')][_0x8bc7('0x49')]?_0x555c5d[_0x8bc7('0x35')]:_0x4e1bb5['model'];if(_0x2c4166['query'][_0x8bc7('0x44')]){_0x555c5d['include']=[{'all':!![]}];}_0x555c5d=_[_0x8bc7('0x3d')]({},_0x555c5d,_0x2c4166['options']);return db[_0x8bc7('0x2d')][_0x8bc7('0x4a')](_0x555c5d)[_0x8bc7('0x24')](handleEntityNotFound(_0x2a7993,null))[_0x8bc7('0x24')](respondWithResult(_0x2a7993,null))[_0x8bc7('0x46')](handleError(_0x2a7993,null));};exports['create']=function(_0x21c56b,_0x1b04f8){return db['AnalyticCustomReport'][_0x8bc7('0x4b')](_0x21c56b[_0x8bc7('0x4c')],{})['then'](function(_0x369595){var _0x413e28=_0x21c56b[_0x8bc7('0x4d')]['get']({'plain':!![]});if(!_0x413e28)throw new Error(_0x8bc7('0x4e'));if(_0x413e28[_0x8bc7('0x4f')]===_0x8bc7('0x4d')){var _0x17fe8a=_0x369595[_0x8bc7('0x25')]({'plain':!![]});var _0x2cc68b=_0x8bc7('0x50');return db[_0x8bc7('0x51')][_0x8bc7('0x4a')]({'where':{'name':_0x2cc68b,'userProfileId':_0x413e28[_0x8bc7('0x52')]},'raw':!![]})['then'](function(_0x465b66){if(_0x465b66&&_0x465b66[_0x8bc7('0x53')]===0x0){return db[_0x8bc7('0x27')][_0x8bc7('0x4b')]({'name':_0x17fe8a[_0x8bc7('0x2a')],'resourceId':_0x17fe8a['id'],'type':'CustomReports','sectionId':_0x465b66['id']},{})[_0x8bc7('0x24')](function(){return _0x369595;});}else{return _0x369595;}})[_0x8bc7('0x46')](function(_0x586685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x586685);throw _0x586685;});}return _0x369595;})[_0x8bc7('0x24')](respondWithResult(_0x1b04f8,0xc9))[_0x8bc7('0x46')](handleError(_0x1b04f8,null));};exports[_0x8bc7('0x22')]=function(_0x1fbcf8,_0x4f812f){if(_0x1fbcf8[_0x8bc7('0x4c')]['id']){delete _0x1fbcf8['body']['id'];}return db['AnalyticCustomReport'][_0x8bc7('0x4a')]({'where':{'id':_0x1fbcf8[_0x8bc7('0x48')]['id']}})[_0x8bc7('0x24')](handleEntityNotFound(_0x4f812f,null))[_0x8bc7('0x24')](saveUpdates(_0x1fbcf8['body'],null))[_0x8bc7('0x24')](respondWithResult(_0x4f812f,null))[_0x8bc7('0x46')](handleError(_0x4f812f,null));};exports[_0x8bc7('0x23')]=function(_0x4da822,_0x5a580a){return db[_0x8bc7('0x2d')]['find']({'where':{'id':_0x4da822[_0x8bc7('0x48')]['id']}})[_0x8bc7('0x24')](handleEntityNotFound(_0x5a580a,null))[_0x8bc7('0x24')](removeEntity(_0x5a580a,null))[_0x8bc7('0x46')](handleError(_0x5a580a,null));};exports[_0x8bc7('0x54')]=function(_0x171cc7,_0x3f29c5){var _0x55b889=0xa;var _0x54940f=[_0x8bc7('0x55'),_0x8bc7('0x56'),_0x8bc7('0x57'),_0x8bc7('0x58')];var _0x20471a={'SUM':_0x8bc7('0x59'),'COUNT':_0x8bc7('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8bc7('0x5b'),'MIN':_0x8bc7('0x5c'),'AVG':_0x8bc7('0x5d'),'GROUP_CONCAT':_0x8bc7('0x5e'),'GROUP_CONCAT ASC':_0x8bc7('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x51b5e7={'SEC_TO_TIME':_0x8bc7('0x60'),'DATE':'DATE(%s)','HOUR':_0x8bc7('0x61'),'ROUND':_0x8bc7('0x62'),'UNIX_TIMESTAMP':_0x8bc7('0x63')};var _0x2412d7=function(_0x1c1931){return!_[_0x8bc7('0x64')](['IS\x20NULL',_0x8bc7('0x65'),_0x8bc7('0x66'),_0x8bc7('0x67')],_0x1c1931);};var _0x23ddf6=function(_0x840511){if(!_0x840511||!_0x840511[_0x8bc7('0x68')][_0x8bc7('0x49')]){return'';}for(var _0xf7a9fa='(',_0x4f6290=0x0;_0x4f6290<_0x840511[_0x8bc7('0x68')][_0x8bc7('0x49')];_0x4f6290+=0x1){_0x4f6290>0x0&&(_0xf7a9fa+='\x20'+_0x840511[_0x8bc7('0x69')]+'\x20');_0xf7a9fa+=_0x840511[_0x8bc7('0x68')][_0x4f6290]['group']?_0x23ddf6(_0x840511[_0x8bc7('0x68')][_0x4f6290]['group']):_0x840511[_0x8bc7('0x68')][_0x4f6290][_0x8bc7('0x42')]+'\x20'+_0x840511[_0x8bc7('0x68')][_0x4f6290][_0x8bc7('0x6a')]+(_0x2412d7(_0x840511[_0x8bc7('0x68')][_0x4f6290][_0x8bc7('0x6a')])?'\x20'+_0x840511[_0x8bc7('0x68')][_0x4f6290][_0x8bc7('0x6b')]:'');}return _0xf7a9fa+')';};var _0x452887={'where':{'id':_0x171cc7[_0x8bc7('0x48')]['id']}},_0x213608,_0x2352b0,_0x3b5fee,_0x47b749,_0x222971;_0x452887=_[_0x8bc7('0x3d')]({},_0x452887,_0x171cc7[_0x8bc7('0x43')]);return db[_0x8bc7('0x2d')]['find'](_0x452887)[_0x8bc7('0x24')](function(_0x5ded77){if(_0x5ded77){_0x213608=_0x5ded77;return _0x5ded77[_0x8bc7('0x6c')]();}return null;})[_0x8bc7('0x24')](function(_0x4b54e8){if(_0x4b54e8){if(!_0x4b54e8[_0x8bc7('0x49')]){throw new db[(_0x8bc7('0x6d'))][(_0x8bc7('0x6e'))](_0x8bc7('0x6f'),0x193);}_0x2352b0=_0x4b54e8;return db[_0x8bc7('0x70')][_0x8bc7('0x45')]({'raw':!![]});}return null;})[_0x8bc7('0x24')](function(_0x64c7bc){if(_0x64c7bc){_0x3b5fee=_[_0x8bc7('0x71')](_0x64c7bc,'id');var _0x3563d4;var _0xb2c2dc=squel[_0x8bc7('0x72')]();_0xb2c2dc['from'](_0x213608[_0x8bc7('0x73')]);for(var _0x3a05a8=0x0;_0x3a05a8<_0x2352b0['length'];_0x3a05a8+=0x1){_0x3563d4=_0x2352b0[_0x3a05a8][_0x8bc7('0x74')]?_0x3b5fee[_0x2352b0[_0x3a05a8]['MetricId']][_0x8bc7('0x75')]:_0x2352b0[_0x3a05a8]['field'];_0x3563d4=_0x2352b0[_0x3a05a8][_0x8bc7('0x76')]?_[_0x8bc7('0x77')](_0x20471a[_0x2352b0[_0x3a05a8]['function']],'%s',_0x3563d4):_0x3563d4;_0x3563d4=_0x2352b0[_0x3a05a8]['format']?_['replace'](_0x51b5e7[_0x2352b0[_0x3a05a8][_0x8bc7('0x78')]],'%s',_0x3563d4):_0x3563d4;if(_0x2352b0[_0x3a05a8][_0x8bc7('0x79')]){_0xb2c2dc[_0x8bc7('0x7a')](_0x3563d4);}_0x2352b0[_0x3a05a8][_0x8bc7('0x7b')]&&_0xb2c2dc[_0x8bc7('0x38')](_0x3563d4,_0x2352b0[_0x3a05a8][_0x8bc7('0x7b')]==='DESC'?![]:!![]);_0xb2c2dc['field'](_0x3563d4,_0x2352b0[_0x3a05a8]['alias']||_0x3563d4);}if(_0x213608['joins']){_0x213608['joins']=JSON['parse'](_0x213608[_0x8bc7('0x7c')]);for(var _0x55beb7=0x0;_0x55beb7<_0x213608[_0x8bc7('0x7c')]['length'];_0x55beb7+=0x1){if(_0x213608[_0x8bc7('0x7c')][_0x55beb7]['type']&&_[_0x8bc7('0x64')](_0x54940f,_0x213608[_0x8bc7('0x7c')][_0x55beb7][_0x8bc7('0x3f')])&&_0x213608[_0x8bc7('0x7c')][_0x55beb7]['parentKey']&&_0x213608[_0x8bc7('0x7c')][_0x55beb7]['foreignTable']&&_0x213608['joins'][_0x55beb7][_0x8bc7('0x7d')]){_0xb2c2dc[_0x213608[_0x8bc7('0x7c')][_0x55beb7][_0x8bc7('0x3f')]](_0x213608[_0x8bc7('0x7c')][_0x55beb7][_0x8bc7('0x7e')],null,util[_0x8bc7('0x78')](_0x8bc7('0x7f'),_0x213608[_0x8bc7('0x73')],_0x213608[_0x8bc7('0x7c')][_0x55beb7][_0x8bc7('0x80')],_0x213608['joins'][_0x55beb7][_0x8bc7('0x7e')],_0x213608[_0x8bc7('0x7c')][_0x55beb7][_0x8bc7('0x7d')]));}}}if(_0x213608['conditions']){_0x213608[_0x8bc7('0x81')]=JSON[_0x8bc7('0x82')](_0x213608['conditions']);_0xb2c2dc[_0x8bc7('0x3a')](_0x23ddf6(_0x213608[_0x8bc7('0x81')]['group']));}_0x222971=_0xb2c2dc[_0x8bc7('0x83')]();_0xb2c2dc[_0x8bc7('0x1e')](_0x55b889);_0xb2c2dc[_0x8bc7('0x37')](0x0);logger[_0x8bc7('0x84')]('Limited\x20Query:',_0xb2c2dc[_0x8bc7('0x85')]());return db[_0x8bc7('0x86')][_0x8bc7('0x31')](_0xb2c2dc[_0x8bc7('0x85')](),{'type':db[_0x8bc7('0x86')][_0x8bc7('0x87')][_0x8bc7('0x88')]});}})[_0x8bc7('0x24')](respondWithResult(_0x3f29c5,null))[_0x8bc7('0x46')](handleError(_0x3f29c5,null));};function runReport(_0x235704,_0x2a71ef,_0x57c497){var _0x534ed6=_0x2a71ef[_0x8bc7('0x2a')];var _0x888501=0xa;var _0x554f61=[_0x8bc7('0x55'),_0x8bc7('0x56'),_0x8bc7('0x57'),_0x8bc7('0x58')];var _0x52ec17={'SUM':_0x8bc7('0x59'),'COUNT':_0x8bc7('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8bc7('0x5b'),'MIN':_0x8bc7('0x5c'),'AVG':_0x8bc7('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8bc7('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4a11b1={'SEC_TO_TIME':_0x8bc7('0x60'),'DATE':_0x8bc7('0x89'),'HOUR':_0x8bc7('0x61'),'ROUND':_0x8bc7('0x62'),'UNIX_TIMESTAMP':_0x8bc7('0x63')};var _0x84d991=function(_0x3557e9){return!_['includes']([_0x8bc7('0x8a'),'IS\x20NOT\x20NULL',_0x8bc7('0x66'),_0x8bc7('0x67')],_0x3557e9);};var _0x1cc498=function(_0x3d9e4c){if(!_0x3d9e4c||!_0x3d9e4c[_0x8bc7('0x68')][_0x8bc7('0x49')]){return'';}for(var _0x202450='(',_0x3f2ba7=0x0;_0x3f2ba7<_0x3d9e4c[_0x8bc7('0x68')]['length'];_0x3f2ba7+=0x1){_0x3f2ba7>0x0&&(_0x202450+='\x20'+_0x3d9e4c[_0x8bc7('0x69')]+'\x20');_0x202450+=_0x3d9e4c[_0x8bc7('0x68')][_0x3f2ba7][_0x8bc7('0x7a')]?_0x1cc498(_0x3d9e4c[_0x8bc7('0x68')][_0x3f2ba7][_0x8bc7('0x7a')]):_0x3d9e4c[_0x8bc7('0x68')][_0x3f2ba7][_0x8bc7('0x42')]+'\x20'+_0x3d9e4c[_0x8bc7('0x68')][_0x3f2ba7][_0x8bc7('0x6a')]+(_0x84d991(_0x3d9e4c[_0x8bc7('0x68')][_0x3f2ba7][_0x8bc7('0x6a')])?'\x20'+_0x3d9e4c['rules'][_0x3f2ba7]['value']:'');}return _0x202450+')';};var _0x16af75={'where':{'id':_0x235704['id']}},_0x3198bf,_0x380b1b,_0x4eac8a,_0x2612b9,_0x2f80a0;_0x16af75=_[_0x8bc7('0x3d')]({},_0x16af75,_0x57c497);return db['AnalyticCustomReport'][_0x8bc7('0x4a')](_0x16af75)[_0x8bc7('0x24')](function(_0x581ed5){if(_0x581ed5){_0x3198bf=_0x581ed5;return _0x581ed5[_0x8bc7('0x6c')]();}return null;})[_0x8bc7('0x24')](function(_0x368c7b){if(_0x368c7b){if(!_0x368c7b[_0x8bc7('0x49')]){throw new db[(_0x8bc7('0x6d'))]['ValidationErrorItem'](_0x8bc7('0x6f'),0x193);}_0x380b1b=_0x368c7b;return db[_0x8bc7('0x70')]['findAll']({'raw':!![]});}return null;})[_0x8bc7('0x24')](function(_0x5af7b1){if(_0x5af7b1){_0x4eac8a=_[_0x8bc7('0x71')](_0x5af7b1,'id');var _0x328b7c;var _0xf2b9c7=squel[_0x8bc7('0x72')]();_0xf2b9c7[_0x8bc7('0x8b')](_0x3198bf['table']);for(var _0xe386f3=0x0;_0xe386f3<_0x380b1b[_0x8bc7('0x49')];_0xe386f3+=0x1){_0x328b7c=_0x380b1b[_0xe386f3]['MetricId']?_0x4eac8a[_0x380b1b[_0xe386f3]['MetricId']]['metric']:_0x380b1b[_0xe386f3][_0x8bc7('0x42')];_0x328b7c=_0x380b1b[_0xe386f3]['function']?_['replace'](_0x52ec17[_0x380b1b[_0xe386f3][_0x8bc7('0x76')]],'%s',_0x328b7c):_0x328b7c;_0x328b7c=_0x380b1b[_0xe386f3]['format']?_[_0x8bc7('0x77')](_0x4a11b1[_0x380b1b[_0xe386f3][_0x8bc7('0x78')]],'%s',_0x328b7c):_0x328b7c;if(_0x380b1b[_0xe386f3][_0x8bc7('0x79')]){_0xf2b9c7[_0x8bc7('0x7a')](_0x328b7c);}_0x380b1b[_0xe386f3]['orderBy']&&_0xf2b9c7[_0x8bc7('0x38')](_0x328b7c,_0x380b1b[_0xe386f3][_0x8bc7('0x7b')]===_0x8bc7('0x8c')?![]:!![]);_0xf2b9c7['field'](_0x328b7c,_0x380b1b[_0xe386f3]['alias']||_0x328b7c);}if(_0x3198bf[_0x8bc7('0x7c')]){_0x3198bf[_0x8bc7('0x7c')]=JSON[_0x8bc7('0x82')](_0x3198bf[_0x8bc7('0x7c')]);for(var _0x5949f4=0x0;_0x5949f4<_0x3198bf[_0x8bc7('0x7c')][_0x8bc7('0x49')];_0x5949f4+=0x1){if(_0x3198bf[_0x8bc7('0x7c')][_0x5949f4]['type']&&_['includes'](_0x554f61,_0x3198bf['joins'][_0x5949f4]['type'])&&_0x3198bf[_0x8bc7('0x7c')][_0x5949f4][_0x8bc7('0x80')]&&_0x3198bf[_0x8bc7('0x7c')][_0x5949f4][_0x8bc7('0x7e')]&&_0x3198bf[_0x8bc7('0x7c')][_0x5949f4]['foreignKey']){_0xf2b9c7[_0x3198bf[_0x8bc7('0x7c')][_0x5949f4][_0x8bc7('0x3f')]](_0x3198bf[_0x8bc7('0x7c')][_0x5949f4][_0x8bc7('0x7e')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3198bf[_0x8bc7('0x73')],_0x3198bf['joins'][_0x5949f4]['parentKey'],_0x3198bf[_0x8bc7('0x7c')][_0x5949f4][_0x8bc7('0x7e')],_0x3198bf[_0x8bc7('0x7c')][_0x5949f4]['foreignKey']));}}}if(_0x3198bf['conditions']){_0x3198bf['conditions']=JSON['parse'](_0x3198bf[_0x8bc7('0x81')]);_0xf2b9c7[_0x8bc7('0x3a')](_0x1cc498(_0x3198bf[_0x8bc7('0x81')]['group']));}_0x2f80a0=_0xf2b9c7['clone']();_0xf2b9c7['limit'](_0x888501);_0xf2b9c7[_0x8bc7('0x37')](0x0);logger['debug'](_0x8bc7('0x8d'),_0xf2b9c7[_0x8bc7('0x85')]());return db[_0x8bc7('0x86')][_0x8bc7('0x31')](_0xf2b9c7[_0x8bc7('0x85')](),{'type':db['sequelize'][_0x8bc7('0x87')][_0x8bc7('0x88')]});}})['then'](function(_0x4a09bc){if(!_0x4a09bc[_0x8bc7('0x49')]){throw new db[(_0x8bc7('0x6d'))][(_0x8bc7('0x6e'))](_0x8bc7('0x8e'),0xcc);}if(_0x2a71ef[_0x8bc7('0x8f')]===_0x8bc7('0x90')){return null;}var _0x12cb49=_[_0x8bc7('0x3d')](_0x2a71ef,{'name':_0x2a71ef[_0x8bc7('0x91')]||_0x2a71ef['name']||_0x3198bf[_0x8bc7('0x2a')],'basename':_0x534ed6,'savename':util[_0x8bc7('0x78')](_0x8bc7('0x92'),_0x2a71ef['name']||_0x3198bf['name'],require('randomstring')[_0x8bc7('0x93')](0x4),_0x2a71ef[_0x8bc7('0x8f')]||_0x8bc7('0x94')),'reportId':_0x3198bf['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x12cb49,{'raw':!![]});})[_0x8bc7('0x24')](function(_0x3a14be){if(_0x3198bf[_0x8bc7('0x73')]==='cdr'){_0x2f80a0[_0x8bc7('0x3a')](_0x3198bf['table']+_0x8bc7('0x95'),_0x2a71ef['startDate'],_0x2a71ef[_0x8bc7('0x96')]);}else{_0x2f80a0[_0x8bc7('0x3a')](_0x3198bf[_0x8bc7('0x73')]+_0x8bc7('0x97'),_0x2a71ef[_0x8bc7('0x98')],_0x2a71ef[_0x8bc7('0x96')]);}if(_0x3a14be){logger['info'](_0x8bc7('0x99'),_0x2f80a0['toString']());require(_0x8bc7('0x9a'))['fork'](path['join'](__dirname,_0x8bc7('0x9b'),_0x3a14be[_0x8bc7('0x8f')]),[_0x3a14be['id'],_0x2f80a0['toString'](),path[_0x8bc7('0x55')](__dirname,'../../files/reports',_0x3a14be['savename']),_0x534ed6]);return _0x3a14be;}else{var _0x44dd4d=squel[_0x8bc7('0x72')]();_0x44dd4d['from']('('+_0x2f80a0[_0x8bc7('0x85')]()+')',_0x8bc7('0x9c'));_0x44dd4d[_0x8bc7('0x42')](_0x8bc7('0x9d'),_0x8bc7('0x1d'));_0x2f80a0[_0x8bc7('0x1e')](_0x2a71ef['limit']||_0x888501);_0x2f80a0['offset'](_0x2a71ef[_0x8bc7('0x37')]||0x0);return db['sequelize']['query'](_0x44dd4d['toString'](),{'type':db[_0x8bc7('0x86')][_0x8bc7('0x87')][_0x8bc7('0x88')]})[_0x8bc7('0x24')](function(_0x148754){if(!_0x148754[_0x8bc7('0x49')]){_0x2612b9=0x0;}else{_0x2612b9=_0x148754[0x0][_0x8bc7('0x1d')]||0x0;}return db[_0x8bc7('0x86')][_0x8bc7('0x31')](_0x2f80a0['toString'](),{'type':db[_0x8bc7('0x86')][_0x8bc7('0x87')][_0x8bc7('0x88')]});})[_0x8bc7('0x24')](function(_0x36c78e){return{'rows':_0x36c78e||[],'count':_0x2612b9};});}});}exports[_0x8bc7('0x9e')]=function(_0xb4f3d1,_0x3b57c5){return runReport(_0xb4f3d1[_0x8bc7('0x48')],_0xb4f3d1[_0x8bc7('0x31')],_0xb4f3d1['options'])['then'](respondWithResult(_0x3b57c5,null))['catch'](handleError(_0x3b57c5,null));};exports['runReport']=runReport;exports[_0x8bc7('0x31')]=function(_0x45f224,_0x3c82b1){var _0x672877=0xa;var _0x456833=[_0x8bc7('0x55'),_0x8bc7('0x56'),_0x8bc7('0x57'),_0x8bc7('0x58')];var _0x247e07={'SUM':_0x8bc7('0x59'),'COUNT':_0x8bc7('0x5a'),'COUNT DISTINCT':_0x8bc7('0x9f'),'MAX':_0x8bc7('0x5b'),'MIN':_0x8bc7('0x5c'),'AVG':_0x8bc7('0x5d'),'GROUP_CONCAT':_0x8bc7('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8bc7('0xa0')};var _0x3aaa06={'SEC_TO_TIME':_0x8bc7('0x60'),'DATE':_0x8bc7('0x89'),'HOUR':_0x8bc7('0x61'),'ROUND':_0x8bc7('0x62'),'UNIX_TIMESTAMP':_0x8bc7('0x63')};var _0x3ab3ce=function(_0x5ee493){return!_[_0x8bc7('0x64')](['IS\x20NULL',_0x8bc7('0x65'),_0x8bc7('0x66'),_0x8bc7('0x67')],_0x5ee493);};var _0x405585=function(_0x4bc094){if(!_0x4bc094||!_0x4bc094[_0x8bc7('0x68')]['length']){return'';}for(var _0x49a09a='(',_0xb4f426=0x0;_0xb4f426<_0x4bc094['rules'][_0x8bc7('0x49')];_0xb4f426+=0x1){_0xb4f426>0x0&&(_0x49a09a+='\x20'+_0x4bc094['operator']+'\x20');_0x49a09a+=_0x4bc094['rules'][_0xb4f426][_0x8bc7('0x7a')]?_0x405585(_0x4bc094[_0x8bc7('0x68')][_0xb4f426][_0x8bc7('0x7a')]):_0x4bc094[_0x8bc7('0x68')][_0xb4f426][_0x8bc7('0x42')]+'\x20'+_0x4bc094['rules'][_0xb4f426]['condition']+(_0x3ab3ce(_0x4bc094[_0x8bc7('0x68')][_0xb4f426]['condition'])?'\x20'+_0x4bc094[_0x8bc7('0x68')][_0xb4f426][_0x8bc7('0x6b')]:'');}return _0x49a09a+')';};var _0x292b25={'where':{'id':_0x45f224[_0x8bc7('0x48')]['id']}},_0xa220f0,_0x34c90e,_0x518ff7,_0x3827e9,_0x4aa4b7;_0x292b25=_[_0x8bc7('0x3d')]({},_0x292b25,_0x45f224[_0x8bc7('0x43')]);return db[_0x8bc7('0x2d')][_0x8bc7('0x4a')](_0x292b25)[_0x8bc7('0x24')](function(_0x50fecd){if(_0x50fecd){_0xa220f0=_0x50fecd;return _0x50fecd[_0x8bc7('0x6c')]();}return null;})['then'](function(_0x16ba31){if(_0x16ba31){if(!_0x16ba31['length']){throw new db[(_0x8bc7('0x6d'))][(_0x8bc7('0x6e'))](_0x8bc7('0x6f'),0x193);}_0x34c90e=_0x16ba31;return db[_0x8bc7('0x70')][_0x8bc7('0x45')]({'raw':!![]});}return null;})[_0x8bc7('0x24')](function(_0x30ff8d){if(_0x30ff8d){_0x518ff7=_[_0x8bc7('0x71')](_0x30ff8d,'id');var _0x7bb5cb;var _0x4dd79f=squel[_0x8bc7('0x72')]();_0x4dd79f[_0x8bc7('0x8b')](_0xa220f0[_0x8bc7('0x73')]);for(var _0xf0d9be=0x0;_0xf0d9be<_0x34c90e['length'];_0xf0d9be+=0x1){_0x7bb5cb=_0x34c90e[_0xf0d9be]['MetricId']?_0x518ff7[_0x34c90e[_0xf0d9be]['MetricId']][_0x8bc7('0x75')]:_0x34c90e[_0xf0d9be][_0x8bc7('0x42')];_0x7bb5cb=_0x34c90e[_0xf0d9be]['function']?_[_0x8bc7('0x77')](_0x247e07[_0x34c90e[_0xf0d9be][_0x8bc7('0x76')]],'%s',_0x7bb5cb):_0x7bb5cb;_0x7bb5cb=_0x34c90e[_0xf0d9be][_0x8bc7('0x78')]?_[_0x8bc7('0x77')](_0x3aaa06[_0x34c90e[_0xf0d9be][_0x8bc7('0x78')]],'%s',_0x7bb5cb):_0x7bb5cb;if(_0x34c90e[_0xf0d9be][_0x8bc7('0x79')]){_0x4dd79f[_0x8bc7('0x7a')](_0x7bb5cb);}_0x34c90e[_0xf0d9be]['orderBy']&&_0x4dd79f[_0x8bc7('0x38')](_0x7bb5cb,_0x34c90e[_0xf0d9be][_0x8bc7('0x7b')]===_0x8bc7('0x8c')?![]:!![]);_0x4dd79f['field'](_0x7bb5cb,_0x34c90e[_0xf0d9be][_0x8bc7('0xa1')]||_0x7bb5cb);}if(_0xa220f0[_0x8bc7('0x7c')]){_0xa220f0[_0x8bc7('0x7c')]=JSON[_0x8bc7('0x82')](_0xa220f0[_0x8bc7('0x7c')]);for(var _0x26367c=0x0;_0x26367c<_0xa220f0['joins'][_0x8bc7('0x49')];_0x26367c+=0x1){if(_0xa220f0[_0x8bc7('0x7c')][_0x26367c]['type']&&_['includes'](_0x456833,_0xa220f0[_0x8bc7('0x7c')][_0x26367c]['type'])&&_0xa220f0[_0x8bc7('0x7c')][_0x26367c][_0x8bc7('0x80')]&&_0xa220f0['joins'][_0x26367c][_0x8bc7('0x7e')]&&_0xa220f0[_0x8bc7('0x7c')][_0x26367c]['foreignKey']){_0x4dd79f[_0xa220f0['joins'][_0x26367c][_0x8bc7('0x3f')]](_0xa220f0[_0x8bc7('0x7c')][_0x26367c]['foreignTable'],null,util['format'](_0x8bc7('0x7f'),_0xa220f0['table'],_0xa220f0[_0x8bc7('0x7c')][_0x26367c][_0x8bc7('0x80')],_0xa220f0[_0x8bc7('0x7c')][_0x26367c][_0x8bc7('0x7e')],_0xa220f0[_0x8bc7('0x7c')][_0x26367c][_0x8bc7('0x7d')]));}}}if(_0xa220f0[_0x8bc7('0x81')]){_0xa220f0['conditions']=JSON[_0x8bc7('0x82')](_0xa220f0[_0x8bc7('0x81')]);_0x4dd79f[_0x8bc7('0x3a')](_0x405585(_0xa220f0[_0x8bc7('0x81')][_0x8bc7('0x7a')]));}_0x4aa4b7=_0x4dd79f[_0x8bc7('0x83')]();_0x4dd79f[_0x8bc7('0x1e')](_0x672877);_0x4dd79f[_0x8bc7('0x37')](0x0);logger[_0x8bc7('0x84')]('Limited\x20Query:',_0x4dd79f['toString']());return db[_0x8bc7('0x86')][_0x8bc7('0x31')](_0x4dd79f[_0x8bc7('0x85')](),{'type':db[_0x8bc7('0x86')]['QueryTypes'][_0x8bc7('0x88')]});}})[_0x8bc7('0x24')](function(){return{'sql':_0x4aa4b7[_0x8bc7('0x85')]()};})['then'](respondWithResult(_0x3c82b1,null))['catch'](handleError(_0x3c82b1,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index a840efb..2d363f0 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 _0xca56=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0xba8d75,_0x22c956){var _0x2332b8=function(_0x4d306d){while(--_0x4d306d){_0xba8d75['push'](_0xba8d75['shift']());}};_0x2332b8(++_0x22c956);}(_0xca56,0xd2));var _0x6ca5=function(_0xd76f55,_0xce240c){_0xd76f55=_0xd76f55-0x0;var _0x461d64=_0xca56[_0xd76f55];return _0x461d64;};'use strict';var _=require(_0x6ca5('0x0'));var util=require(_0x6ca5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6ca5('0x2'));var BPromise=require(_0x6ca5('0x3'));var rp=require(_0x6ca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ca5('0x5'));var config=require(_0x6ca5('0x6'));var attributes=require(_0x6ca5('0x7'));module['exports']=function(_0xda0f55,_0x277969){return _0xda0f55['define'](_0x6ca5('0x8'),attributes,{'tableName':_0x6ca5('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56f6=['bluebird','request-promise','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment'];(function(_0x4f81be,_0x48f84e){var _0x2a91b=function(_0x348665){while(--_0x348665){_0x4f81be['push'](_0x4f81be['shift']());}};_0x2a91b(++_0x48f84e);}(_0x56f6,0xc5));var _0x656f=function(_0x1a6306,_0xeb7474){_0x1a6306=_0x1a6306-0x0;var _0x488a4d=_0x56f6[_0x1a6306];return _0x488a4d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x656f('0x0'))(_0x656f('0x1'));var moment=require(_0x656f('0x2'));var BPromise=require(_0x656f('0x3'));var rp=require(_0x656f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x656f('0x5'));var attributes=require(_0x656f('0x6'));module['exports']=function(_0x258878,_0x5cbabc){return _0x258878[_0x656f('0x7')](_0x656f('0x8'),attributes,{'tableName':_0x656f('0x9'),'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 6bb9494..69b02d8 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 _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0x2ce530,_0x49a863){var _0x16e8d5=function(_0x5b868d){while(--_0x5b868d){_0x2ce530['push'](_0x2ce530['shift']());}};_0x16e8d5(++_0x49a863);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x17ede9,_0x27d731){var _0x35b71d=function(_0x30f681){while(--_0x30f681){_0x17ede9['push'](_0x17ede9['shift']());}};_0x35b71d(++_0x27d731);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0c1d1e9..0826a24 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 _0x6a55=['run','/:id/query','query','create','put','update','delete','destroy','exports','multer','express','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x245731,_0x4ffc70){var _0x5f5857=function(_0x214441){while(--_0x214441){_0x245731['push'](_0x245731['shift']());}};_0x5f5857(++_0x4ffc70);}(_0x6a55,0xdb));var _0x56a5=function(_0x3c08ea,_0x419b25){_0x3c08ea=_0x3c08ea-0x0;var _0x4b6e51=_0x6a55[_0x3c08ea];return _0x4b6e51;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x56a5('0x2'));var config=require('../../config/environment');var controller=require(_0x56a5('0x3'));router['get']('/',auth[_0x56a5('0x4')](),controller[_0x56a5('0x5')]);router[_0x56a5('0x6')](_0x56a5('0x7'),auth[_0x56a5('0x4')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x6')](_0x56a5('0x9'),auth['isAuthenticated'](),controller[_0x56a5('0xa')]);router[_0x56a5('0x6')](_0x56a5('0xb'),auth[_0x56a5('0x4')](),controller[_0x56a5('0xc')]);router[_0x56a5('0x6')](_0x56a5('0xd'),auth[_0x56a5('0x4')](),controller[_0x56a5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x56a5('0xf')]);router[_0x56a5('0x10')](_0x56a5('0x7'),auth[_0x56a5('0x4')](),controller[_0x56a5('0x11')]);router[_0x56a5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x56a5('0x13')]);module[_0x56a5('0x14')]=router; \ No newline at end of file +var _0x5fdc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0x5fdc,0x127));var _0xc5fd=function(_0x208621,_0x3253a4){_0x208621=_0x208621-0x0;var _0x30c561=_0x5fdc[_0x208621];return _0x30c561;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var auth=require(_0xc5fd('0x6'));var interaction=require(_0xc5fd('0x7'));var config=require(_0xc5fd('0x8'));var controller=require(_0xc5fd('0x9'));router[_0xc5fd('0xa')]('/',auth[_0xc5fd('0xb')](),controller[_0xc5fd('0xc')]);router[_0xc5fd('0xa')](_0xc5fd('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc5fd('0xe'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0xf')]);router[_0xc5fd('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0xa')](_0xc5fd('0x11'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0x12')]);router[_0xc5fd('0x13')]('/',auth['isAuthenticated'](),controller[_0xc5fd('0x14')]);router['put']('/:id',auth[_0xc5fd('0xb')](),controller[_0xc5fd('0x15')]);router[_0xc5fd('0x16')](_0xc5fd('0xd'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0x17')]);module[_0xc5fd('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1ffe8c8..6f2390e 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 _0x79ce=['sequelize','STRING','TEXT'];(function(_0x4abab5,_0x459b2a){var _0x170bae=function(_0x83a946){while(--_0x83a946){_0x4abab5['push'](_0x4abab5['shift']());}};_0x170bae(++_0x459b2a);}(_0x79ce,0x13b));var _0xe79c=function(_0x23f860,_0x17e90f){_0x23f860=_0x23f860-0x0;var _0x26d28e=_0x79ce[_0x23f860];return _0x26d28e;};'use strict';var Sequelize=require(_0xe79c('0x0'));module['exports']={'name':{'type':Sequelize[_0xe79c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe79c('0x1')]},'conditions':{'type':Sequelize[_0xe79c('0x2')]},'joins':{'type':Sequelize[_0xe79c('0x2')]}}; \ No newline at end of file +var _0x729a=['exports','STRING','TEXT','sequelize'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x729a,0x143));var _0xa729=function(_0x211c6f,_0xb94824){_0x211c6f=_0x211c6f-0x0;var _0x37c0dc=_0x729a[_0x211c6f];return _0x37c0dc;};'use strict';var Sequelize=require(_0xa729('0x0'));module[_0xa729('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa729('0x2')]},'parent':{'type':Sequelize[_0xa729('0x2')]},'table':{'type':Sequelize[_0xa729('0x2')]},'conditions':{'type':Sequelize[_0xa729('0x3')]},'joins':{'type':Sequelize[_0xa729('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 835c456..b808d29 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 _0x5374=['table','MetricId','metric','function','replace','format','groupBy','order','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','IS\x20NULL','IS\x20EMPTY','ValidationErrorItem','DESC','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','output','../../files/reports','savename','countTable','run','runReport','COUNT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','Content-Range','apply','save','update','get','DefaultReports','UserProfileResource','destroy','then','end','error','stack','send','index','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','map','type','key','field','merge','options','AnalyticDefaultReport','count','includeAll','include','findAll','params','rawAttributes','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','AnalyticMetric','keyBy','select','from'];(function(_0x35734f,_0x2556b4){var _0x17a1d5=function(_0x4e6acd){while(--_0x4e6acd){_0x35734f['push'](_0x35734f['shift']());}};_0x17a1d5(++_0x2556b4);}(_0x5374,0xd6));var _0x4537=function(_0x140a94,_0x89e517){_0x140a94=_0x140a94-0x0;var _0x2ee341=_0x5374[_0x140a94];return _0x2ee341;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4537('0x0'));var rimraf=require(_0x4537('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4537('0x2'));var rp=require(_0x4537('0x3'));var moment=require(_0x4537('0x4'));var BPromise=require(_0x4537('0x5'));var Mustache=require(_0x4537('0x6'));var util=require(_0x4537('0x7'));var path=require(_0x4537('0x8'));var sox=require('sox');var csv=require(_0x4537('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4537('0xa'));var squel=require(_0x4537('0xb'));var crypto=require(_0x4537('0xc'));var jsforce=require(_0x4537('0xd'));var deskjs=require(_0x4537('0xe'));var toCsv=require(_0x4537('0x9'));var querystring=require(_0x4537('0xf'));var Papa=require(_0x4537('0x10'));var Redis=require(_0x4537('0x11'));var authService=require(_0x4537('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4537('0x13'));var logger=require(_0x4537('0x14'))(_0x4537('0x15'));var utils=require('../../config/utils');var config=require(_0x4537('0x16'));var db=require(_0x4537('0x17'))['db'];function respondWithStatusCode(_0x502380,_0x53390b){_0x53390b=_0x53390b||0xcc;return function(_0x2d25d6){if(_0x2d25d6){return _0x502380[_0x4537('0x18')](_0x53390b);}return _0x502380[_0x4537('0x19')](_0x53390b)['end']();};}function respondWithResult(_0x4427a2,_0x422a94){_0x422a94=_0x422a94||0xc8;return function(_0x300103){if(_0x300103){return _0x4427a2[_0x4537('0x19')](_0x422a94)['json'](_0x300103);}};}function respondWithFilteredResult(_0x361f03,_0x3760e9){return function(_0x2958ce){if(_0x2958ce){var _0x4518e7=_0x2958ce['count'],_0x3df8ce=_0x3760e9[_0x4537('0x1a')],_0x18e263=_0x3760e9[_0x4537('0x1a')]+_0x3760e9[_0x4537('0x1b')],_0x3edcc2;if(_0x18e263>=_0x4518e7){_0x18e263=_0x4518e7;_0x3edcc2=0xc8;}else{_0x3edcc2=0xce;}_0x361f03['status'](_0x3edcc2);return _0x361f03['set'](_0x4537('0x1c'),_0x3df8ce+'-'+_0x18e263+'/'+_0x4518e7)['json'](_0x2958ce);}return null;};}function patchUpdates(_0x444001){return function(_0x3ee925){try{jsonpatch[_0x4537('0x1d')](_0x3ee925,_0x444001,!![]);}catch(_0x1e097f){return BPromise['reject'](_0x1e097f);}return _0x3ee925[_0x4537('0x1e')]();};}function saveUpdates(_0x5e9e42,_0x18ede4){return function(_0x78c80e){if(_0x78c80e){return _0x78c80e[_0x4537('0x1f')](_0x5e9e42)['then'](function(_0x5f46b8){return _0x5f46b8;});}return null;};}function removeEntity(_0x3930aa,_0x2e88df){return function(_0x17356d){if(_0x17356d){return _0x17356d['destroy']()['then'](function(){var _0xf1c901=_0x17356d[_0x4537('0x20')]({'plain':!![]});var _0x8b094a=_0x4537('0x21');return db[_0x4537('0x22')][_0x4537('0x23')]({'where':{'type':_0x8b094a,'resourceId':_0xf1c901['id']}})[_0x4537('0x24')](function(){return _0x17356d;});})[_0x4537('0x24')](function(){_0x3930aa[_0x4537('0x19')](0xcc)[_0x4537('0x25')]();});}};}function handleEntityNotFound(_0x21b70d,_0xc38a27){return function(_0x4fb2f3){if(!_0x4fb2f3){_0x21b70d['sendStatus'](0x194);}return _0x4fb2f3;};}function handleError(_0x2e83e4,_0x52670a){_0x52670a=_0x52670a||0x1f4;return function(_0x1ca0d6){logger[_0x4537('0x26')](_0x1ca0d6[_0x4537('0x27')]);if(_0x1ca0d6['name']){delete _0x1ca0d6['name'];}_0x2e83e4['status'](_0x52670a)[_0x4537('0x28')](_0x1ca0d6);};}exports[_0x4537('0x29')]=function(_0x2aaa2b,_0x487405){var _0xe9e363={},_0x42fe40={},_0x286921={'count':0x0,'rows':[]};var _0x18bfd4=db['AnalyticDefaultReport']['rawAttributes'];_0x42fe40[_0x4537('0x2a')]=_[_0x4537('0x2b')](_0x18bfd4);_0x42fe40['query']=_['keys'](_0x2aaa2b[_0x4537('0x2c')]);_0x42fe40[_0x4537('0x2d')]=_[_0x4537('0x2e')](_0x42fe40[_0x4537('0x2a')],_0x42fe40[_0x4537('0x2c')]);_0xe9e363[_0x4537('0x2f')]=_['intersection'](_0x42fe40[_0x4537('0x2a')],qs[_0x4537('0x30')](_0x2aaa2b['query'][_0x4537('0x30')]));_0xe9e363[_0x4537('0x2f')]=_0xe9e363[_0x4537('0x2f')]['length']?_0xe9e363[_0x4537('0x2f')]:_0x42fe40[_0x4537('0x2a')];if(!_0x2aaa2b[_0x4537('0x2c')]['hasOwnProperty'](_0x4537('0x31'))){_0xe9e363[_0x4537('0x1b')]=qs['limit'](_0x2aaa2b['query'][_0x4537('0x1b')]);_0xe9e363[_0x4537('0x1a')]=qs[_0x4537('0x1a')](_0x2aaa2b[_0x4537('0x2c')][_0x4537('0x1a')]);}_0xe9e363['order']=qs[_0x4537('0x32')](_0x2aaa2b[_0x4537('0x2c')][_0x4537('0x32')]);_0xe9e363[_0x4537('0x33')]=qs['filters'](_[_0x4537('0x34')](_0x2aaa2b[_0x4537('0x2c')],_0x42fe40[_0x4537('0x2d')]));if(_0x2aaa2b[_0x4537('0x2c')][_0x4537('0x35')]){_0xe9e363[_0x4537('0x33')]=_['merge'](_0xe9e363['where'],{'$or':_[_0x4537('0x36')](_0x18bfd4,function(_0x5202f2){if(_0x5202f2[_0x4537('0x37')][_0x4537('0x38')]!=='VIRTUAL'){var _0x36c52c={};_0x36c52c[_0x5202f2[_0x4537('0x39')]]={'$like':'%'+_0x2aaa2b[_0x4537('0x2c')][_0x4537('0x35')]+'%'};return _0x36c52c;}})});}_0xe9e363=_[_0x4537('0x3a')]({},_0xe9e363,_0x2aaa2b[_0x4537('0x3b')]);var _0x33f12e={'where':_0xe9e363['where']};return db[_0x4537('0x3c')][_0x4537('0x3d')](_0x33f12e)[_0x4537('0x24')](function(_0x31449a){_0x286921[_0x4537('0x3d')]=_0x31449a;if(_0x2aaa2b[_0x4537('0x2c')][_0x4537('0x3e')]){_0xe9e363[_0x4537('0x3f')]=[{'all':!![]}];}return db[_0x4537('0x3c')][_0x4537('0x40')](_0xe9e363);})[_0x4537('0x24')](function(_0x3eb7b2){_0x286921['rows']=_0x3eb7b2;return _0x286921;})[_0x4537('0x24')](respondWithFilteredResult(_0x487405,_0xe9e363))['catch'](handleError(_0x487405,null));};exports['show']=function(_0x5f4210,_0x39f089){var _0x1420a1={'raw':!![],'where':{'id':_0x5f4210[_0x4537('0x41')]['id']}},_0x461866={};_0x461866[_0x4537('0x2a')]=_[_0x4537('0x2b')](db['AnalyticDefaultReport'][_0x4537('0x42')]);_0x461866['query']=_[_0x4537('0x2b')](_0x5f4210['query']);_0x461866['filters']=_[_0x4537('0x2e')](_0x461866['model'],_0x461866[_0x4537('0x2c')]);_0x1420a1[_0x4537('0x2f')]=_[_0x4537('0x2e')](_0x461866['model'],qs[_0x4537('0x30')](_0x5f4210[_0x4537('0x2c')][_0x4537('0x30')]));_0x1420a1[_0x4537('0x2f')]=_0x1420a1[_0x4537('0x2f')][_0x4537('0x43')]?_0x1420a1['attributes']:_0x461866['model'];if(_0x5f4210[_0x4537('0x2c')][_0x4537('0x3e')]){_0x1420a1['include']=[{'all':!![]}];}_0x1420a1=_[_0x4537('0x3a')]({},_0x1420a1,_0x5f4210[_0x4537('0x3b')]);return db[_0x4537('0x3c')][_0x4537('0x44')](_0x1420a1)['then'](handleEntityNotFound(_0x39f089,null))[_0x4537('0x24')](respondWithResult(_0x39f089,null))[_0x4537('0x45')](handleError(_0x39f089,null));};exports[_0x4537('0x46')]=function(_0x5ffaa1,_0x3f979c){return db['AnalyticDefaultReport'][_0x4537('0x46')](_0x5ffaa1[_0x4537('0x47')],{})['then'](function(_0x45fd27){var _0x45e451=_0x5ffaa1['user'][_0x4537('0x20')]({'plain':!![]});if(!_0x45e451)throw new Error(_0x4537('0x48'));if(_0x45e451[_0x4537('0x49')]==='user'){var _0x26dd7c=_0x45fd27[_0x4537('0x20')]({'plain':!![]});var _0x5a98c8=_0x4537('0x4a');return db[_0x4537('0x4b')][_0x4537('0x44')]({'where':{'name':_0x5a98c8,'userProfileId':_0x45e451[_0x4537('0x4c')]},'raw':!![]})['then'](function(_0x55bdfa){if(_0x55bdfa&&_0x55bdfa[_0x4537('0x4d')]===0x0){return db[_0x4537('0x22')][_0x4537('0x46')]({'name':_0x26dd7c[_0x4537('0x4e')],'resourceId':_0x26dd7c['id'],'type':_0x4537('0x21'),'sectionId':_0x55bdfa['id']},{})[_0x4537('0x24')](function(){return _0x45fd27;});}else{return _0x45fd27;}})[_0x4537('0x45')](function(_0x5e60b4){logger[_0x4537('0x26')](_0x4537('0x4f'),_0x5e60b4);throw _0x5e60b4;});}return _0x45fd27;})[_0x4537('0x24')](respondWithResult(_0x3f979c,0xc9))[_0x4537('0x45')](handleError(_0x3f979c,null));};exports[_0x4537('0x1f')]=function(_0x3f7124,_0xc03a27){if(_0x3f7124['body']['id']){delete _0x3f7124[_0x4537('0x47')]['id'];}return db['AnalyticDefaultReport'][_0x4537('0x44')]({'where':{'id':_0x3f7124[_0x4537('0x41')]['id']}})[_0x4537('0x24')](handleEntityNotFound(_0xc03a27,null))[_0x4537('0x24')](saveUpdates(_0x3f7124[_0x4537('0x47')],null))['then'](respondWithResult(_0xc03a27,null))[_0x4537('0x45')](handleError(_0xc03a27,null));};exports[_0x4537('0x23')]=function(_0x3cdcdb,_0x5c7f5f){return db[_0x4537('0x3c')][_0x4537('0x44')]({'where':{'id':_0x3cdcdb['params']['id']}})[_0x4537('0x24')](handleEntityNotFound(_0x5c7f5f,null))[_0x4537('0x24')](removeEntity(_0x5c7f5f,null))[_0x4537('0x45')](handleError(_0x5c7f5f,null));};exports['preview']=function(_0x3fc042,_0x64ff18){var _0x314dab=0xa;var _0x50f85e=[_0x4537('0x50'),_0x4537('0x51'),_0x4537('0x52'),'cross_join'];var _0x5d014b={'SUM':_0x4537('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4537('0x54'),'MAX':_0x4537('0x55'),'MIN':_0x4537('0x56'),'AVG':_0x4537('0x57'),'GROUP_CONCAT':_0x4537('0x58'),'GROUP_CONCAT ASC':_0x4537('0x59'),'GROUP_CONCAT DESC':_0x4537('0x5a')};var _0x46b785={'SEC_TO_TIME':_0x4537('0x5b'),'DATE':_0x4537('0x5c'),'HOUR':_0x4537('0x5d'),'ROUND':_0x4537('0x5e'),'UNIX_TIMESTAMP':_0x4537('0x5f')};var _0x330d4d=function(_0x56ebd5){return!_[_0x4537('0x60')](['IS\x20NULL',_0x4537('0x61'),'IS\x20EMPTY',_0x4537('0x62')],_0x56ebd5);};var _0x286dd6=function(_0x36acd7){if(!_0x36acd7||!_0x36acd7['rules']['length']){return'';}for(var _0x3cb18c='(',_0x43a90c=0x0;_0x43a90c<_0x36acd7[_0x4537('0x63')]['length'];_0x43a90c+=0x1){_0x43a90c>0x0&&(_0x3cb18c+='\x20'+_0x36acd7[_0x4537('0x64')]+'\x20');_0x3cb18c+=_0x36acd7[_0x4537('0x63')][_0x43a90c][_0x4537('0x65')]?_0x286dd6(_0x36acd7[_0x4537('0x63')][_0x43a90c][_0x4537('0x65')]):_0x36acd7[_0x4537('0x63')][_0x43a90c][_0x4537('0x39')]+'\x20'+_0x36acd7[_0x4537('0x63')][_0x43a90c]['condition']+(_0x330d4d(_0x36acd7[_0x4537('0x63')][_0x43a90c][_0x4537('0x66')])?'\x20'+_0x36acd7[_0x4537('0x63')][_0x43a90c][_0x4537('0x67')]:'');}return _0x3cb18c+')';};var _0x54b140={'where':{'id':_0x3fc042[_0x4537('0x41')]['id']}},_0xd4dbd1,_0x14f6f0,_0x40789b,_0x328b04,_0x7aaeb3;_0x54b140=_[_0x4537('0x3a')]({},_0x54b140,_0x3fc042[_0x4537('0x3b')]);return db['AnalyticDefaultReport'][_0x4537('0x44')](_0x54b140)[_0x4537('0x24')](function(_0x266390){if(_0x266390){_0xd4dbd1=_0x266390;return _0x266390[_0x4537('0x68')]();}return null;})['then'](function(_0x25e968){if(_0x25e968){if(!_0x25e968[_0x4537('0x43')]){throw new db[(_0x4537('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x14f6f0=_0x25e968;return db[_0x4537('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x4537('0x24')](function(_0x32326a){if(_0x32326a){_0x40789b=_[_0x4537('0x6b')](_0x32326a,'id');var _0x143866;var _0x323d87=squel[_0x4537('0x6c')]();_0x323d87[_0x4537('0x6d')](_0xd4dbd1[_0x4537('0x6e')]);for(var _0x44b433=0x0;_0x44b433<_0x14f6f0[_0x4537('0x43')];_0x44b433+=0x1){_0x143866=_0x14f6f0[_0x44b433]['MetricId']?_0x40789b[_0x14f6f0[_0x44b433][_0x4537('0x6f')]][_0x4537('0x70')]:_0x14f6f0[_0x44b433]['field'];_0x143866=_0x14f6f0[_0x44b433][_0x4537('0x71')]?_[_0x4537('0x72')](_0x5d014b[_0x14f6f0[_0x44b433][_0x4537('0x71')]],'%s',_0x143866):_0x143866;_0x143866=_0x14f6f0[_0x44b433][_0x4537('0x73')]?_[_0x4537('0x72')](_0x46b785[_0x14f6f0[_0x44b433][_0x4537('0x73')]],'%s',_0x143866):_0x143866;if(_0x14f6f0[_0x44b433][_0x4537('0x74')]){_0x323d87[_0x4537('0x65')](_0x143866);}_0x14f6f0[_0x44b433]['orderBy']&&_0x323d87[_0x4537('0x75')](_0x143866,_0x14f6f0[_0x44b433][_0x4537('0x76')]==='DESC'?![]:!![]);_0x323d87[_0x4537('0x39')](_0x143866,_0x14f6f0[_0x44b433][_0x4537('0x77')]||_0x143866);}if(_0xd4dbd1[_0x4537('0x78')]){_0xd4dbd1[_0x4537('0x78')]=JSON[_0x4537('0x79')](_0xd4dbd1[_0x4537('0x78')]);for(var _0x28f13d=0x0;_0x28f13d<_0xd4dbd1['joins'][_0x4537('0x43')];_0x28f13d+=0x1){if(_0xd4dbd1[_0x4537('0x78')][_0x28f13d][_0x4537('0x37')]&&_[_0x4537('0x60')](_0x50f85e,_0xd4dbd1[_0x4537('0x78')][_0x28f13d]['type'])&&_0xd4dbd1[_0x4537('0x78')][_0x28f13d][_0x4537('0x7a')]&&_0xd4dbd1['joins'][_0x28f13d][_0x4537('0x7b')]&&_0xd4dbd1[_0x4537('0x78')][_0x28f13d][_0x4537('0x7c')]){_0x323d87[_0xd4dbd1['joins'][_0x28f13d]['type']](_0xd4dbd1[_0x4537('0x78')][_0x28f13d][_0x4537('0x7b')],null,util[_0x4537('0x73')](_0x4537('0x7d'),_0xd4dbd1['table'],_0xd4dbd1[_0x4537('0x78')][_0x28f13d]['parentKey'],_0xd4dbd1[_0x4537('0x78')][_0x28f13d][_0x4537('0x7b')],_0xd4dbd1['joins'][_0x28f13d]['foreignKey']));}}}if(_0xd4dbd1[_0x4537('0x7e')]){_0xd4dbd1[_0x4537('0x7e')]=JSON[_0x4537('0x79')](_0xd4dbd1[_0x4537('0x7e')]);_0x323d87[_0x4537('0x33')](_0x286dd6(_0xd4dbd1[_0x4537('0x7e')][_0x4537('0x65')]));}_0x7aaeb3=_0x323d87[_0x4537('0x7f')]();_0x323d87[_0x4537('0x1b')](_0x314dab);_0x323d87[_0x4537('0x1a')](0x0);logger[_0x4537('0x80')](_0x4537('0x81'),_0x323d87[_0x4537('0x82')]());return db[_0x4537('0x83')][_0x4537('0x2c')](_0x323d87['toString'](),{'type':db[_0x4537('0x83')][_0x4537('0x84')][_0x4537('0x85')]});}})[_0x4537('0x24')](respondWithResult(_0x64ff18,null))[_0x4537('0x45')](handleError(_0x64ff18,null));};function runReport(_0x1a0dbc,_0x15bbe8,_0x13b29c){var _0x31e901=_0x15bbe8[_0x4537('0x4e')];var _0x33723b=0xa;var _0x5548a4=['join',_0x4537('0x51'),'right_join',_0x4537('0x86')];var _0x5e6aab={'SUM':_0x4537('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4537('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4537('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4537('0x59'),'GROUP_CONCAT DESC':_0x4537('0x5a')};var _0x1b0fdb={'SEC_TO_TIME':_0x4537('0x5b'),'DATE':_0x4537('0x5c'),'HOUR':_0x4537('0x5d'),'ROUND':_0x4537('0x5e'),'UNIX_TIMESTAMP':_0x4537('0x5f')};var _0x2ab978=function(_0x5cbf1b){return!_[_0x4537('0x60')]([_0x4537('0x87'),_0x4537('0x61'),_0x4537('0x88'),_0x4537('0x62')],_0x5cbf1b);};var _0x127864=function(_0x4562d6){if(!_0x4562d6||!_0x4562d6['rules'][_0x4537('0x43')]){return'';}for(var _0x3b54f7='(',_0x1dcc55=0x0;_0x1dcc55<_0x4562d6[_0x4537('0x63')]['length'];_0x1dcc55+=0x1){_0x1dcc55>0x0&&(_0x3b54f7+='\x20'+_0x4562d6[_0x4537('0x64')]+'\x20');_0x3b54f7+=_0x4562d6['rules'][_0x1dcc55][_0x4537('0x65')]?_0x127864(_0x4562d6[_0x4537('0x63')][_0x1dcc55][_0x4537('0x65')]):_0x4562d6[_0x4537('0x63')][_0x1dcc55][_0x4537('0x39')]+'\x20'+_0x4562d6[_0x4537('0x63')][_0x1dcc55][_0x4537('0x66')]+(_0x2ab978(_0x4562d6['rules'][_0x1dcc55][_0x4537('0x66')])?'\x20'+_0x4562d6[_0x4537('0x63')][_0x1dcc55][_0x4537('0x67')]:'');}return _0x3b54f7+')';};var _0x48e608={'where':{'id':_0x1a0dbc['id']}},_0x3e8e08,_0xe7325e,_0x324cbf,_0x370c95,_0x569e1d;_0x48e608=_['merge']({},_0x48e608,_0x13b29c);return db[_0x4537('0x3c')][_0x4537('0x44')](_0x48e608)[_0x4537('0x24')](function(_0x2b70a9){if(_0x2b70a9){_0x3e8e08=_0x2b70a9;return _0x2b70a9[_0x4537('0x68')]();}return null;})['then'](function(_0x2bc9ad){if(_0x2bc9ad){if(!_0x2bc9ad[_0x4537('0x43')]){throw new db[(_0x4537('0x69'))][(_0x4537('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe7325e=_0x2bc9ad;return db['AnalyticMetric'][_0x4537('0x40')]({'raw':!![]});}return null;})[_0x4537('0x24')](function(_0x373e9c){if(_0x373e9c){_0x324cbf=_[_0x4537('0x6b')](_0x373e9c,'id');var _0x4c1f41;var _0x180c2c=squel['select']();_0x180c2c[_0x4537('0x6d')](_0x3e8e08[_0x4537('0x6e')]);for(var _0x3b8bc3=0x0;_0x3b8bc3<_0xe7325e['length'];_0x3b8bc3+=0x1){_0x4c1f41=_0xe7325e[_0x3b8bc3][_0x4537('0x6f')]?_0x324cbf[_0xe7325e[_0x3b8bc3][_0x4537('0x6f')]][_0x4537('0x70')]:_0xe7325e[_0x3b8bc3][_0x4537('0x39')];_0x4c1f41=_0xe7325e[_0x3b8bc3]['function']?_[_0x4537('0x72')](_0x5e6aab[_0xe7325e[_0x3b8bc3]['function']],'%s',_0x4c1f41):_0x4c1f41;_0x4c1f41=_0xe7325e[_0x3b8bc3][_0x4537('0x73')]?_[_0x4537('0x72')](_0x1b0fdb[_0xe7325e[_0x3b8bc3][_0x4537('0x73')]],'%s',_0x4c1f41):_0x4c1f41;if(_0xe7325e[_0x3b8bc3][_0x4537('0x74')]){_0x180c2c['group'](_0x4c1f41);}_0xe7325e[_0x3b8bc3][_0x4537('0x76')]&&_0x180c2c[_0x4537('0x75')](_0x4c1f41,_0xe7325e[_0x3b8bc3][_0x4537('0x76')]===_0x4537('0x8a')?![]:!![]);_0x180c2c[_0x4537('0x39')](_0x4c1f41,_0xe7325e[_0x3b8bc3]['alias']||_0x4c1f41);}if(_0x3e8e08[_0x4537('0x78')]){_0x3e8e08[_0x4537('0x78')]=JSON[_0x4537('0x79')](_0x3e8e08[_0x4537('0x78')]);for(var _0x553f7f=0x0;_0x553f7f<_0x3e8e08['joins']['length'];_0x553f7f+=0x1){if(_0x3e8e08['joins'][_0x553f7f]['type']&&_[_0x4537('0x60')](_0x5548a4,_0x3e8e08[_0x4537('0x78')][_0x553f7f][_0x4537('0x37')])&&_0x3e8e08['joins'][_0x553f7f][_0x4537('0x7a')]&&_0x3e8e08[_0x4537('0x78')][_0x553f7f]['foreignTable']&&_0x3e8e08[_0x4537('0x78')][_0x553f7f][_0x4537('0x7c')]){_0x180c2c[_0x3e8e08[_0x4537('0x78')][_0x553f7f][_0x4537('0x37')]](_0x3e8e08[_0x4537('0x78')][_0x553f7f]['foreignTable'],null,util['format'](_0x4537('0x7d'),_0x3e8e08[_0x4537('0x6e')],_0x3e8e08[_0x4537('0x78')][_0x553f7f]['parentKey'],_0x3e8e08[_0x4537('0x78')][_0x553f7f][_0x4537('0x7b')],_0x3e8e08[_0x4537('0x78')][_0x553f7f][_0x4537('0x7c')]));}}}if(_0x3e8e08[_0x4537('0x7e')]){_0x3e8e08[_0x4537('0x7e')]=JSON['parse'](_0x3e8e08[_0x4537('0x7e')]);_0x180c2c[_0x4537('0x33')](_0x127864(_0x3e8e08[_0x4537('0x7e')][_0x4537('0x65')]));}_0x569e1d=_0x180c2c['clone']();_0x180c2c[_0x4537('0x1b')](_0x33723b);_0x180c2c[_0x4537('0x1a')](0x0);logger[_0x4537('0x80')](_0x4537('0x81'),_0x180c2c['toString']());return db[_0x4537('0x83')]['query'](_0x180c2c[_0x4537('0x82')](),{'type':db['sequelize'][_0x4537('0x84')][_0x4537('0x85')]});}})[_0x4537('0x24')](function(_0x3d347c){if(!_0x3d347c[_0x4537('0x43')]){throw new db['Sequelize'][(_0x4537('0x89'))](_0x4537('0x8b'),0xcc);}if(_0x15bbe8['output']===_0x4537('0x8c')){return null;}var _0xed4885=_[_0x4537('0x3a')](_0x15bbe8,{'name':_0x15bbe8[_0x4537('0x8d')]||_0x15bbe8[_0x4537('0x4e')]||_0x3e8e08[_0x4537('0x4e')],'basename':_0x31e901,'savename':util['format'](_0x4537('0x8e'),_0x15bbe8[_0x4537('0x4e')]||_0x3e8e08[_0x4537('0x4e')],require(_0x4537('0x8f'))[_0x4537('0x90')](0x4),_0x15bbe8['output']||_0x4537('0x91')),'reportId':_0x3e8e08['id'],'reportType':_0x4537('0x92')});return db['AnalyticExtractedReport'][_0x4537('0x46')](_0xed4885,{'raw':!![]});})[_0x4537('0x24')](function(_0x393d64){if(_0x3e8e08['table']===_0x4537('0x93')){_0x569e1d['where'](_0x3e8e08['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x15bbe8[_0x4537('0x94')],_0x15bbe8[_0x4537('0x95')]);}else{_0x569e1d['where'](_0x3e8e08[_0x4537('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x15bbe8['startDate'],_0x15bbe8[_0x4537('0x95')]);}if(_0x393d64){logger['info'](_0x4537('0x96'),_0x569e1d[_0x4537('0x82')]());require(_0x4537('0x97'))[_0x4537('0x98')](path[_0x4537('0x50')](__dirname,_0x4537('0x99'),_0x393d64[_0x4537('0x9a')]),[_0x393d64['id'],_0x569e1d[_0x4537('0x82')](),path[_0x4537('0x50')](__dirname,_0x4537('0x9b'),_0x393d64[_0x4537('0x9c')]),_0x31e901]);return _0x393d64;}else{var _0x260ce2=squel[_0x4537('0x6c')]();_0x260ce2[_0x4537('0x6d')]('('+_0x569e1d[_0x4537('0x82')]()+')',_0x4537('0x9d'));_0x260ce2[_0x4537('0x39')]('COUNT(*)','count');_0x569e1d[_0x4537('0x1b')](_0x15bbe8[_0x4537('0x1b')]||_0x33723b);_0x569e1d[_0x4537('0x1a')](_0x15bbe8[_0x4537('0x1a')]||0x0);return db[_0x4537('0x83')][_0x4537('0x2c')](_0x260ce2[_0x4537('0x82')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x3c1e31){if(!_0x3c1e31[_0x4537('0x43')]){_0x370c95=0x0;}else{_0x370c95=_0x3c1e31[0x0][_0x4537('0x3d')]||0x0;}return db['sequelize'][_0x4537('0x2c')](_0x569e1d[_0x4537('0x82')](),{'type':db[_0x4537('0x83')][_0x4537('0x84')][_0x4537('0x85')]});})[_0x4537('0x24')](function(_0x32ba18){return{'rows':_0x32ba18||[],'count':_0x370c95};});}});}exports[_0x4537('0x9e')]=function(_0x3efb0e,_0x4f2dc1){return runReport(_0x3efb0e[_0x4537('0x41')],_0x3efb0e[_0x4537('0x2c')],_0x3efb0e['options'])['then'](respondWithResult(_0x4f2dc1,null))[_0x4537('0x45')](handleError(_0x4f2dc1,null));};exports[_0x4537('0x9f')]=runReport;exports[_0x4537('0x2c')]=function(_0x905ff9,_0xd78fb1){var _0x6bdf18=0xa;var _0x1956c7=[_0x4537('0x50'),'left_join',_0x4537('0x52'),_0x4537('0x86')];var _0x48768e={'SUM':'SUM(%s)','COUNT':_0x4537('0xa0'),'COUNT DISTINCT':_0x4537('0x54'),'MAX':_0x4537('0x55'),'MIN':_0x4537('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4537('0x58'),'GROUP_CONCAT ASC':_0x4537('0x59'),'GROUP_CONCAT DESC':_0x4537('0x5a')};var _0x41c2cd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4537('0x5c'),'HOUR':_0x4537('0x5d'),'ROUND':_0x4537('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x406c83=function(_0x104099){return!_[_0x4537('0x60')]([_0x4537('0x87'),_0x4537('0x61'),_0x4537('0x88'),_0x4537('0x62')],_0x104099);};var _0x50026e=function(_0x1d68e7){if(!_0x1d68e7||!_0x1d68e7['rules'][_0x4537('0x43')]){return'';}for(var _0x132ad0='(',_0x20a266=0x0;_0x20a266<_0x1d68e7[_0x4537('0x63')]['length'];_0x20a266+=0x1){_0x20a266>0x0&&(_0x132ad0+='\x20'+_0x1d68e7[_0x4537('0x64')]+'\x20');_0x132ad0+=_0x1d68e7[_0x4537('0x63')][_0x20a266][_0x4537('0x65')]?_0x50026e(_0x1d68e7['rules'][_0x20a266][_0x4537('0x65')]):_0x1d68e7[_0x4537('0x63')][_0x20a266]['field']+'\x20'+_0x1d68e7[_0x4537('0x63')][_0x20a266][_0x4537('0x66')]+(_0x406c83(_0x1d68e7[_0x4537('0x63')][_0x20a266][_0x4537('0x66')])?'\x20'+_0x1d68e7[_0x4537('0x63')][_0x20a266][_0x4537('0x67')]:'');}return _0x132ad0+')';};var _0x566d8f={'where':{'id':_0x905ff9['params']['id']}},_0x39c8b0,_0x16bee9,_0x432837,_0x1f4e77,_0x2bb3d7;_0x566d8f=_[_0x4537('0x3a')]({},_0x566d8f,_0x905ff9[_0x4537('0x3b')]);return db[_0x4537('0x3c')][_0x4537('0x44')](_0x566d8f)[_0x4537('0x24')](function(_0x1ec036){if(_0x1ec036){_0x39c8b0=_0x1ec036;return _0x1ec036['getFields']();}return null;})[_0x4537('0x24')](function(_0x2f0a7f){if(_0x2f0a7f){if(!_0x2f0a7f[_0x4537('0x43')]){throw new db[(_0x4537('0x69'))][(_0x4537('0x89'))](_0x4537('0xa1'),0x193);}_0x16bee9=_0x2f0a7f;return db[_0x4537('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x4537('0x24')](function(_0x1792a3){if(_0x1792a3){_0x432837=_[_0x4537('0x6b')](_0x1792a3,'id');var _0x39419b;var _0x4394b5=squel[_0x4537('0x6c')]();_0x4394b5['from'](_0x39c8b0[_0x4537('0x6e')]);for(var _0x33dfa9=0x0;_0x33dfa9<_0x16bee9[_0x4537('0x43')];_0x33dfa9+=0x1){_0x39419b=_0x16bee9[_0x33dfa9]['MetricId']?_0x432837[_0x16bee9[_0x33dfa9][_0x4537('0x6f')]][_0x4537('0x70')]:_0x16bee9[_0x33dfa9][_0x4537('0x39')];_0x39419b=_0x16bee9[_0x33dfa9][_0x4537('0x71')]?_[_0x4537('0x72')](_0x48768e[_0x16bee9[_0x33dfa9][_0x4537('0x71')]],'%s',_0x39419b):_0x39419b;_0x39419b=_0x16bee9[_0x33dfa9]['format']?_[_0x4537('0x72')](_0x41c2cd[_0x16bee9[_0x33dfa9][_0x4537('0x73')]],'%s',_0x39419b):_0x39419b;if(_0x16bee9[_0x33dfa9][_0x4537('0x74')]){_0x4394b5[_0x4537('0x65')](_0x39419b);}_0x16bee9[_0x33dfa9][_0x4537('0x76')]&&_0x4394b5[_0x4537('0x75')](_0x39419b,_0x16bee9[_0x33dfa9][_0x4537('0x76')]===_0x4537('0x8a')?![]:!![]);_0x4394b5[_0x4537('0x39')](_0x39419b,_0x16bee9[_0x33dfa9][_0x4537('0x77')]||_0x39419b);}if(_0x39c8b0[_0x4537('0x78')]){_0x39c8b0[_0x4537('0x78')]=JSON[_0x4537('0x79')](_0x39c8b0[_0x4537('0x78')]);for(var _0x3da359=0x0;_0x3da359<_0x39c8b0[_0x4537('0x78')]['length'];_0x3da359+=0x1){if(_0x39c8b0[_0x4537('0x78')][_0x3da359][_0x4537('0x37')]&&_[_0x4537('0x60')](_0x1956c7,_0x39c8b0[_0x4537('0x78')][_0x3da359][_0x4537('0x37')])&&_0x39c8b0['joins'][_0x3da359]['parentKey']&&_0x39c8b0[_0x4537('0x78')][_0x3da359][_0x4537('0x7b')]&&_0x39c8b0[_0x4537('0x78')][_0x3da359][_0x4537('0x7c')]){_0x4394b5[_0x39c8b0[_0x4537('0x78')][_0x3da359]['type']](_0x39c8b0[_0x4537('0x78')][_0x3da359]['foreignTable'],null,util[_0x4537('0x73')](_0x4537('0x7d'),_0x39c8b0[_0x4537('0x6e')],_0x39c8b0['joins'][_0x3da359]['parentKey'],_0x39c8b0[_0x4537('0x78')][_0x3da359]['foreignTable'],_0x39c8b0[_0x4537('0x78')][_0x3da359][_0x4537('0x7c')]));}}}if(_0x39c8b0[_0x4537('0x7e')]){_0x39c8b0[_0x4537('0x7e')]=JSON[_0x4537('0x79')](_0x39c8b0[_0x4537('0x7e')]);_0x4394b5['where'](_0x50026e(_0x39c8b0[_0x4537('0x7e')][_0x4537('0x65')]));}_0x2bb3d7=_0x4394b5[_0x4537('0x7f')]();_0x4394b5[_0x4537('0x1b')](_0x6bdf18);_0x4394b5[_0x4537('0x1a')](0x0);logger['debug'](_0x4537('0x81'),_0x4394b5[_0x4537('0x82')]());return db[_0x4537('0x83')]['query'](_0x4394b5[_0x4537('0x82')](),{'type':db[_0x4537('0x83')][_0x4537('0x84')][_0x4537('0x85')]});}})[_0x4537('0x24')](function(){return{'sql':_0x2bb3d7[_0x4537('0x82')]()};})[_0x4537('0x24')](respondWithResult(_0xd78fb1,null))[_0x4537('0x45')](handleError(_0xd78fb1,null));}; \ No newline at end of file +var _0x3c57=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','operator','getFields','findAll','select','%s.%s\x20=\x20%s.%s','debug','SELECT','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','fork','../../components/export/','countTable','run','runReport','SUM(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x3c57,0x8c));var _0x73c5=function(_0x1d1a88,_0xd0a2c8){_0x1d1a88=_0x1d1a88-0x0;var _0x14ea4d=_0x3c57[_0x1d1a88];return _0x14ea4d;};'use strict';var pdf=require(_0x73c5('0x0'));var emlformat=require(_0x73c5('0x1'));var rimraf=require(_0x73c5('0x2'));var zipdir=require(_0x73c5('0x3'));var jsonpatch=require(_0x73c5('0x4'));var rp=require(_0x73c5('0x5'));var moment=require(_0x73c5('0x6'));var BPromise=require(_0x73c5('0x7'));var Mustache=require(_0x73c5('0x8'));var util=require(_0x73c5('0x9'));var path=require(_0x73c5('0xa'));var sox=require(_0x73c5('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x73c5('0xc'));var crypto=require(_0x73c5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x73c5('0xe'));var toCsv=require(_0x73c5('0xf'));var querystring=require(_0x73c5('0x10'));var Papa=require(_0x73c5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x73c5('0x12'));var hardwareService=require(_0x73c5('0x13'));var logger=require(_0x73c5('0x14'))(_0x73c5('0x15'));var utils=require(_0x73c5('0x16'));var config=require(_0x73c5('0x17'));var db=require(_0x73c5('0x18'))['db'];function respondWithStatusCode(_0x20a1ba,_0x2aa9fe){_0x2aa9fe=_0x2aa9fe||0xcc;return function(_0x199632){if(_0x199632){return _0x20a1ba[_0x73c5('0x19')](_0x2aa9fe);}return _0x20a1ba[_0x73c5('0x1a')](_0x2aa9fe)[_0x73c5('0x1b')]();};}function respondWithResult(_0x562f4b,_0x2d65ff){_0x2d65ff=_0x2d65ff||0xc8;return function(_0x4baf8e){if(_0x4baf8e){return _0x562f4b[_0x73c5('0x1a')](_0x2d65ff)[_0x73c5('0x1c')](_0x4baf8e);}};}function respondWithFilteredResult(_0x1c991c,_0x4a8b1b){return function(_0x627e8e){if(_0x627e8e){var _0x6e64fd=_0x627e8e[_0x73c5('0x1d')],_0x4b1c64=_0x4a8b1b[_0x73c5('0x1e')],_0x334075=_0x4a8b1b['offset']+_0x4a8b1b[_0x73c5('0x1f')],_0x2f5d3c;if(_0x334075>=_0x6e64fd){_0x334075=_0x6e64fd;_0x2f5d3c=0xc8;}else{_0x2f5d3c=0xce;}_0x1c991c[_0x73c5('0x1a')](_0x2f5d3c);return _0x1c991c[_0x73c5('0x20')]('Content-Range',_0x4b1c64+'-'+_0x334075+'/'+_0x6e64fd)['json'](_0x627e8e);}return null;};}function patchUpdates(_0x200dfd){return function(_0x2d8c8c){try{jsonpatch[_0x73c5('0x21')](_0x2d8c8c,_0x200dfd,!![]);}catch(_0x5399ab){return BPromise['reject'](_0x5399ab);}return _0x2d8c8c[_0x73c5('0x22')]();};}function saveUpdates(_0x5d9d14,_0x1b5289){return function(_0xfda816){if(_0xfda816){return _0xfda816[_0x73c5('0x23')](_0x5d9d14)[_0x73c5('0x24')](function(_0x59315b){return _0x59315b;});}return null;};}function removeEntity(_0x319ec4,_0x58df4b){return function(_0x451ed2){if(_0x451ed2){return _0x451ed2[_0x73c5('0x25')]()[_0x73c5('0x24')](function(){var _0x11c703=_0x451ed2['get']({'plain':!![]});var _0x4c298c=_0x73c5('0x26');return db[_0x73c5('0x27')][_0x73c5('0x25')]({'where':{'type':_0x4c298c,'resourceId':_0x11c703['id']}})['then'](function(){return _0x451ed2;});})[_0x73c5('0x24')](function(){_0x319ec4['status'](0xcc)[_0x73c5('0x1b')]();});}};}function handleEntityNotFound(_0x49887d,_0x2ac97f){return function(_0x59184f){if(!_0x59184f){_0x49887d['sendStatus'](0x194);}return _0x59184f;};}function handleError(_0x10d21a,_0x4ce2f8){_0x4ce2f8=_0x4ce2f8||0x1f4;return function(_0x517ffe){logger[_0x73c5('0x28')](_0x517ffe['stack']);if(_0x517ffe[_0x73c5('0x29')]){delete _0x517ffe[_0x73c5('0x29')];}_0x10d21a[_0x73c5('0x1a')](_0x4ce2f8)['send'](_0x517ffe);};}exports[_0x73c5('0x2a')]=function(_0x2f1dc9,_0x4b1dca){var _0x143f01={},_0x109576={},_0x26ab14={'count':0x0,'rows':[]};var _0x243bab=db[_0x73c5('0x2b')][_0x73c5('0x2c')];_0x109576[_0x73c5('0x2d')]=_[_0x73c5('0x2e')](_0x243bab);_0x109576[_0x73c5('0x2f')]=_['keys'](_0x2f1dc9[_0x73c5('0x2f')]);_0x109576[_0x73c5('0x30')]=_[_0x73c5('0x31')](_0x109576[_0x73c5('0x2d')],_0x109576[_0x73c5('0x2f')]);_0x143f01[_0x73c5('0x32')]=_[_0x73c5('0x31')](_0x109576['model'],qs[_0x73c5('0x33')](_0x2f1dc9[_0x73c5('0x2f')][_0x73c5('0x33')]));_0x143f01['attributes']=_0x143f01[_0x73c5('0x32')]['length']?_0x143f01[_0x73c5('0x32')]:_0x109576[_0x73c5('0x2d')];if(!_0x2f1dc9[_0x73c5('0x2f')][_0x73c5('0x34')](_0x73c5('0x35'))){_0x143f01[_0x73c5('0x1f')]=qs[_0x73c5('0x1f')](_0x2f1dc9[_0x73c5('0x2f')]['limit']);_0x143f01['offset']=qs[_0x73c5('0x1e')](_0x2f1dc9[_0x73c5('0x2f')]['offset']);}_0x143f01[_0x73c5('0x36')]=qs[_0x73c5('0x37')](_0x2f1dc9[_0x73c5('0x2f')][_0x73c5('0x37')]);_0x143f01[_0x73c5('0x38')]=qs[_0x73c5('0x30')](_[_0x73c5('0x39')](_0x2f1dc9[_0x73c5('0x2f')],_0x109576[_0x73c5('0x30')]));if(_0x2f1dc9[_0x73c5('0x2f')]['filter']){_0x143f01[_0x73c5('0x38')]=_[_0x73c5('0x3a')](_0x143f01[_0x73c5('0x38')],{'$or':_[_0x73c5('0x3b')](_0x243bab,function(_0x37ff71){if(_0x37ff71[_0x73c5('0x3c')][_0x73c5('0x3d')]!=='VIRTUAL'){var _0x2bd4d0={};_0x2bd4d0[_0x37ff71['field']]={'$like':'%'+_0x2f1dc9[_0x73c5('0x2f')]['filter']+'%'};return _0x2bd4d0;}})});}_0x143f01=_[_0x73c5('0x3a')]({},_0x143f01,_0x2f1dc9[_0x73c5('0x3e')]);var _0x393734={'where':_0x143f01['where']};return db[_0x73c5('0x2b')][_0x73c5('0x1d')](_0x393734)[_0x73c5('0x24')](function(_0x409bc7){_0x26ab14[_0x73c5('0x1d')]=_0x409bc7;if(_0x2f1dc9[_0x73c5('0x2f')][_0x73c5('0x3f')]){_0x143f01['include']=[{'all':!![]}];}return db['AnalyticDefaultReport']['findAll'](_0x143f01);})[_0x73c5('0x24')](function(_0x9347ed){_0x26ab14[_0x73c5('0x40')]=_0x9347ed;return _0x26ab14;})['then'](respondWithFilteredResult(_0x4b1dca,_0x143f01))[_0x73c5('0x41')](handleError(_0x4b1dca,null));};exports[_0x73c5('0x42')]=function(_0x4aa413,_0x56467d){var _0x49dab7={'raw':!![],'where':{'id':_0x4aa413[_0x73c5('0x43')]['id']}},_0x59b46d={};_0x59b46d[_0x73c5('0x2d')]=_['keys'](db[_0x73c5('0x2b')]['rawAttributes']);_0x59b46d[_0x73c5('0x2f')]=_['keys'](_0x4aa413[_0x73c5('0x2f')]);_0x59b46d[_0x73c5('0x30')]=_[_0x73c5('0x31')](_0x59b46d[_0x73c5('0x2d')],_0x59b46d[_0x73c5('0x2f')]);_0x49dab7[_0x73c5('0x32')]=_[_0x73c5('0x31')](_0x59b46d[_0x73c5('0x2d')],qs[_0x73c5('0x33')](_0x4aa413[_0x73c5('0x2f')][_0x73c5('0x33')]));_0x49dab7['attributes']=_0x49dab7[_0x73c5('0x32')][_0x73c5('0x44')]?_0x49dab7[_0x73c5('0x32')]:_0x59b46d[_0x73c5('0x2d')];if(_0x4aa413[_0x73c5('0x2f')]['includeAll']){_0x49dab7[_0x73c5('0x45')]=[{'all':!![]}];}_0x49dab7=_[_0x73c5('0x3a')]({},_0x49dab7,_0x4aa413['options']);return db[_0x73c5('0x2b')][_0x73c5('0x46')](_0x49dab7)[_0x73c5('0x24')](handleEntityNotFound(_0x56467d,null))[_0x73c5('0x24')](respondWithResult(_0x56467d,null))[_0x73c5('0x41')](handleError(_0x56467d,null));};exports[_0x73c5('0x47')]=function(_0xb79f26,_0x1062f5){return db['AnalyticDefaultReport'][_0x73c5('0x47')](_0xb79f26[_0x73c5('0x48')],{})[_0x73c5('0x24')](function(_0x2fa393){var _0x6e6ce4=_0xb79f26[_0x73c5('0x49')][_0x73c5('0x4a')]({'plain':!![]});if(!_0x6e6ce4)throw new Error(_0x73c5('0x4b'));if(_0x6e6ce4[_0x73c5('0x4c')]==='user'){var _0x5745bd=_0x2fa393[_0x73c5('0x4a')]({'plain':!![]});var _0x3c97dd=_0x73c5('0x4d');return db[_0x73c5('0x4e')]['find']({'where':{'name':_0x3c97dd,'userProfileId':_0x6e6ce4[_0x73c5('0x4f')]},'raw':!![]})[_0x73c5('0x24')](function(_0xfb1b21){if(_0xfb1b21&&_0xfb1b21['autoAssociation']===0x0){return db[_0x73c5('0x27')][_0x73c5('0x47')]({'name':_0x5745bd[_0x73c5('0x29')],'resourceId':_0x5745bd['id'],'type':_0x73c5('0x26'),'sectionId':_0xfb1b21['id']},{})[_0x73c5('0x24')](function(){return _0x2fa393;});}else{return _0x2fa393;}})['catch'](function(_0x2412b0){logger[_0x73c5('0x28')](_0x73c5('0x50'),_0x2412b0);throw _0x2412b0;});}return _0x2fa393;})['then'](respondWithResult(_0x1062f5,0xc9))['catch'](handleError(_0x1062f5,null));};exports['update']=function(_0xaedb33,_0x301fdd){if(_0xaedb33[_0x73c5('0x48')]['id']){delete _0xaedb33[_0x73c5('0x48')]['id'];}return db[_0x73c5('0x2b')]['find']({'where':{'id':_0xaedb33[_0x73c5('0x43')]['id']}})[_0x73c5('0x24')](handleEntityNotFound(_0x301fdd,null))[_0x73c5('0x24')](saveUpdates(_0xaedb33[_0x73c5('0x48')],null))[_0x73c5('0x24')](respondWithResult(_0x301fdd,null))['catch'](handleError(_0x301fdd,null));};exports[_0x73c5('0x25')]=function(_0x4268ad,_0x252767){return db['AnalyticDefaultReport'][_0x73c5('0x46')]({'where':{'id':_0x4268ad[_0x73c5('0x43')]['id']}})[_0x73c5('0x24')](handleEntityNotFound(_0x252767,null))[_0x73c5('0x24')](removeEntity(_0x252767,null))[_0x73c5('0x41')](handleError(_0x252767,null));};exports[_0x73c5('0x51')]=function(_0x19877a,_0x1c75f8){var _0x497ea2=0xa;var _0x15959e=[_0x73c5('0x52'),_0x73c5('0x53'),'right_join',_0x73c5('0x54')];var _0x5be2cd={'SUM':'SUM(%s)','COUNT':_0x73c5('0x55'),'COUNT DISTINCT':_0x73c5('0x56'),'MAX':_0x73c5('0x57'),'MIN':_0x73c5('0x58'),'AVG':_0x73c5('0x59'),'GROUP_CONCAT':_0x73c5('0x5a'),'GROUP_CONCAT ASC':_0x73c5('0x5b'),'GROUP_CONCAT DESC':_0x73c5('0x5c')};var _0xb489ac={'SEC_TO_TIME':_0x73c5('0x5d'),'DATE':_0x73c5('0x5e'),'HOUR':_0x73c5('0x5f'),'ROUND':_0x73c5('0x60'),'UNIX_TIMESTAMP':_0x73c5('0x61')};var _0x52ec1e=function(_0x4c180e){return!_[_0x73c5('0x62')]([_0x73c5('0x63'),_0x73c5('0x64'),_0x73c5('0x65'),_0x73c5('0x66')],_0x4c180e);};var _0x35e078=function(_0x482785){if(!_0x482785||!_0x482785[_0x73c5('0x67')][_0x73c5('0x44')]){return'';}for(var _0x35d5e0='(',_0x36ce9f=0x0;_0x36ce9f<_0x482785[_0x73c5('0x67')][_0x73c5('0x44')];_0x36ce9f+=0x1){_0x36ce9f>0x0&&(_0x35d5e0+='\x20'+_0x482785['operator']+'\x20');_0x35d5e0+=_0x482785['rules'][_0x36ce9f][_0x73c5('0x68')]?_0x35e078(_0x482785[_0x73c5('0x67')][_0x36ce9f][_0x73c5('0x68')]):_0x482785[_0x73c5('0x67')][_0x36ce9f][_0x73c5('0x69')]+'\x20'+_0x482785[_0x73c5('0x67')][_0x36ce9f][_0x73c5('0x6a')]+(_0x52ec1e(_0x482785[_0x73c5('0x67')][_0x36ce9f]['condition'])?'\x20'+_0x482785[_0x73c5('0x67')][_0x36ce9f][_0x73c5('0x6b')]:'');}return _0x35d5e0+')';};var _0x132922={'where':{'id':_0x19877a['params']['id']}},_0x3847ba,_0x55dfc5,_0x560459,_0x17e428,_0x1abff4;_0x132922=_[_0x73c5('0x3a')]({},_0x132922,_0x19877a[_0x73c5('0x3e')]);return db['AnalyticDefaultReport'][_0x73c5('0x46')](_0x132922)[_0x73c5('0x24')](function(_0x1e02d3){if(_0x1e02d3){_0x3847ba=_0x1e02d3;return _0x1e02d3['getFields']();}return null;})[_0x73c5('0x24')](function(_0x74b049){if(_0x74b049){if(!_0x74b049['length']){throw new db[(_0x73c5('0x6c'))][(_0x73c5('0x6d'))](_0x73c5('0x6e'),0x193);}_0x55dfc5=_0x74b049;return db[_0x73c5('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xdad4e){if(_0xdad4e){_0x560459=_[_0x73c5('0x70')](_0xdad4e,'id');var _0x3de132;var _0x2e0b71=squel['select']();_0x2e0b71[_0x73c5('0x71')](_0x3847ba[_0x73c5('0x72')]);for(var _0x5c35f0=0x0;_0x5c35f0<_0x55dfc5['length'];_0x5c35f0+=0x1){_0x3de132=_0x55dfc5[_0x5c35f0][_0x73c5('0x73')]?_0x560459[_0x55dfc5[_0x5c35f0][_0x73c5('0x73')]][_0x73c5('0x74')]:_0x55dfc5[_0x5c35f0][_0x73c5('0x69')];_0x3de132=_0x55dfc5[_0x5c35f0][_0x73c5('0x75')]?_[_0x73c5('0x76')](_0x5be2cd[_0x55dfc5[_0x5c35f0][_0x73c5('0x75')]],'%s',_0x3de132):_0x3de132;_0x3de132=_0x55dfc5[_0x5c35f0]['format']?_['replace'](_0xb489ac[_0x55dfc5[_0x5c35f0][_0x73c5('0x77')]],'%s',_0x3de132):_0x3de132;if(_0x55dfc5[_0x5c35f0][_0x73c5('0x78')]){_0x2e0b71[_0x73c5('0x68')](_0x3de132);}_0x55dfc5[_0x5c35f0]['orderBy']&&_0x2e0b71['order'](_0x3de132,_0x55dfc5[_0x5c35f0][_0x73c5('0x79')]===_0x73c5('0x7a')?![]:!![]);_0x2e0b71[_0x73c5('0x69')](_0x3de132,_0x55dfc5[_0x5c35f0][_0x73c5('0x7b')]||_0x3de132);}if(_0x3847ba[_0x73c5('0x7c')]){_0x3847ba[_0x73c5('0x7c')]=JSON[_0x73c5('0x7d')](_0x3847ba['joins']);for(var _0xa96b54=0x0;_0xa96b54<_0x3847ba[_0x73c5('0x7c')][_0x73c5('0x44')];_0xa96b54+=0x1){if(_0x3847ba[_0x73c5('0x7c')][_0xa96b54]['type']&&_['includes'](_0x15959e,_0x3847ba[_0x73c5('0x7c')][_0xa96b54]['type'])&&_0x3847ba[_0x73c5('0x7c')][_0xa96b54][_0x73c5('0x7e')]&&_0x3847ba[_0x73c5('0x7c')][_0xa96b54][_0x73c5('0x7f')]&&_0x3847ba[_0x73c5('0x7c')][_0xa96b54]['foreignKey']){_0x2e0b71[_0x3847ba[_0x73c5('0x7c')][_0xa96b54]['type']](_0x3847ba[_0x73c5('0x7c')][_0xa96b54][_0x73c5('0x7f')],null,util[_0x73c5('0x77')]('%s.%s\x20=\x20%s.%s',_0x3847ba[_0x73c5('0x72')],_0x3847ba[_0x73c5('0x7c')][_0xa96b54][_0x73c5('0x7e')],_0x3847ba[_0x73c5('0x7c')][_0xa96b54][_0x73c5('0x7f')],_0x3847ba['joins'][_0xa96b54][_0x73c5('0x80')]));}}}if(_0x3847ba['conditions']){_0x3847ba[_0x73c5('0x81')]=JSON['parse'](_0x3847ba[_0x73c5('0x81')]);_0x2e0b71[_0x73c5('0x38')](_0x35e078(_0x3847ba['conditions']['group']));}_0x1abff4=_0x2e0b71[_0x73c5('0x82')]();_0x2e0b71[_0x73c5('0x1f')](_0x497ea2);_0x2e0b71[_0x73c5('0x1e')](0x0);logger['debug'](_0x73c5('0x83'),_0x2e0b71['toString']());return db[_0x73c5('0x84')][_0x73c5('0x2f')](_0x2e0b71[_0x73c5('0x85')](),{'type':db[_0x73c5('0x84')][_0x73c5('0x86')]['SELECT']});}})[_0x73c5('0x24')](respondWithResult(_0x1c75f8,null))[_0x73c5('0x41')](handleError(_0x1c75f8,null));};function runReport(_0x4a420f,_0x5baf1d,_0xd96610){var _0x56cbd7=_0x5baf1d[_0x73c5('0x29')];var _0x1c3fac=0xa;var _0x4b6773=['join',_0x73c5('0x53'),_0x73c5('0x87'),_0x73c5('0x54')];var _0x21edd3={'SUM':'SUM(%s)','COUNT':_0x73c5('0x55'),'COUNT DISTINCT':_0x73c5('0x56'),'MAX':_0x73c5('0x57'),'MIN':_0x73c5('0x58'),'AVG':_0x73c5('0x59'),'GROUP_CONCAT':_0x73c5('0x5a'),'GROUP_CONCAT ASC':_0x73c5('0x5b'),'GROUP_CONCAT DESC':_0x73c5('0x5c')};var _0x4ae3dd={'SEC_TO_TIME':_0x73c5('0x5d'),'DATE':_0x73c5('0x5e'),'HOUR':_0x73c5('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2bc06f=function(_0x404ddd){return!_[_0x73c5('0x62')]([_0x73c5('0x63'),_0x73c5('0x64'),'IS\x20EMPTY',_0x73c5('0x66')],_0x404ddd);};var _0x85e905=function(_0x22b60d){if(!_0x22b60d||!_0x22b60d['rules'][_0x73c5('0x44')]){return'';}for(var _0x1890ac='(',_0x51c164=0x0;_0x51c164<_0x22b60d[_0x73c5('0x67')][_0x73c5('0x44')];_0x51c164+=0x1){_0x51c164>0x0&&(_0x1890ac+='\x20'+_0x22b60d[_0x73c5('0x88')]+'\x20');_0x1890ac+=_0x22b60d[_0x73c5('0x67')][_0x51c164][_0x73c5('0x68')]?_0x85e905(_0x22b60d[_0x73c5('0x67')][_0x51c164][_0x73c5('0x68')]):_0x22b60d['rules'][_0x51c164][_0x73c5('0x69')]+'\x20'+_0x22b60d[_0x73c5('0x67')][_0x51c164][_0x73c5('0x6a')]+(_0x2bc06f(_0x22b60d[_0x73c5('0x67')][_0x51c164][_0x73c5('0x6a')])?'\x20'+_0x22b60d[_0x73c5('0x67')][_0x51c164]['value']:'');}return _0x1890ac+')';};var _0x5e1593={'where':{'id':_0x4a420f['id']}},_0x2a2c7a,_0x497207,_0x166a5d,_0x263e8c,_0x352800;_0x5e1593=_[_0x73c5('0x3a')]({},_0x5e1593,_0xd96610);return db[_0x73c5('0x2b')][_0x73c5('0x46')](_0x5e1593)['then'](function(_0x27d499){if(_0x27d499){_0x2a2c7a=_0x27d499;return _0x27d499[_0x73c5('0x89')]();}return null;})[_0x73c5('0x24')](function(_0x3e4508){if(_0x3e4508){if(!_0x3e4508[_0x73c5('0x44')]){throw new db[(_0x73c5('0x6c'))][(_0x73c5('0x6d'))](_0x73c5('0x6e'),0x193);}_0x497207=_0x3e4508;return db['AnalyticMetric'][_0x73c5('0x8a')]({'raw':!![]});}return null;})['then'](function(_0x28efc6){if(_0x28efc6){_0x166a5d=_[_0x73c5('0x70')](_0x28efc6,'id');var _0x5c881a;var _0x53f094=squel[_0x73c5('0x8b')]();_0x53f094[_0x73c5('0x71')](_0x2a2c7a[_0x73c5('0x72')]);for(var _0x52de2a=0x0;_0x52de2a<_0x497207[_0x73c5('0x44')];_0x52de2a+=0x1){_0x5c881a=_0x497207[_0x52de2a][_0x73c5('0x73')]?_0x166a5d[_0x497207[_0x52de2a][_0x73c5('0x73')]]['metric']:_0x497207[_0x52de2a]['field'];_0x5c881a=_0x497207[_0x52de2a][_0x73c5('0x75')]?_['replace'](_0x21edd3[_0x497207[_0x52de2a][_0x73c5('0x75')]],'%s',_0x5c881a):_0x5c881a;_0x5c881a=_0x497207[_0x52de2a][_0x73c5('0x77')]?_['replace'](_0x4ae3dd[_0x497207[_0x52de2a][_0x73c5('0x77')]],'%s',_0x5c881a):_0x5c881a;if(_0x497207[_0x52de2a][_0x73c5('0x78')]){_0x53f094[_0x73c5('0x68')](_0x5c881a);}_0x497207[_0x52de2a][_0x73c5('0x79')]&&_0x53f094['order'](_0x5c881a,_0x497207[_0x52de2a]['orderBy']===_0x73c5('0x7a')?![]:!![]);_0x53f094[_0x73c5('0x69')](_0x5c881a,_0x497207[_0x52de2a][_0x73c5('0x7b')]||_0x5c881a);}if(_0x2a2c7a[_0x73c5('0x7c')]){_0x2a2c7a[_0x73c5('0x7c')]=JSON[_0x73c5('0x7d')](_0x2a2c7a[_0x73c5('0x7c')]);for(var _0x73ed4d=0x0;_0x73ed4d<_0x2a2c7a[_0x73c5('0x7c')][_0x73c5('0x44')];_0x73ed4d+=0x1){if(_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x3c')]&&_['includes'](_0x4b6773,_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x3c')])&&_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x7e')]&&_0x2a2c7a['joins'][_0x73ed4d][_0x73c5('0x7f')]&&_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x80')]){_0x53f094[_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x3c')]](_0x2a2c7a['joins'][_0x73ed4d][_0x73c5('0x7f')],null,util[_0x73c5('0x77')](_0x73c5('0x8c'),_0x2a2c7a[_0x73c5('0x72')],_0x2a2c7a['joins'][_0x73ed4d][_0x73c5('0x7e')],_0x2a2c7a[_0x73c5('0x7c')][_0x73ed4d][_0x73c5('0x7f')],_0x2a2c7a['joins'][_0x73ed4d][_0x73c5('0x80')]));}}}if(_0x2a2c7a[_0x73c5('0x81')]){_0x2a2c7a[_0x73c5('0x81')]=JSON['parse'](_0x2a2c7a[_0x73c5('0x81')]);_0x53f094[_0x73c5('0x38')](_0x85e905(_0x2a2c7a['conditions'][_0x73c5('0x68')]));}_0x352800=_0x53f094[_0x73c5('0x82')]();_0x53f094[_0x73c5('0x1f')](_0x1c3fac);_0x53f094[_0x73c5('0x1e')](0x0);logger[_0x73c5('0x8d')](_0x73c5('0x83'),_0x53f094['toString']());return db[_0x73c5('0x84')][_0x73c5('0x2f')](_0x53f094[_0x73c5('0x85')](),{'type':db['sequelize'][_0x73c5('0x86')][_0x73c5('0x8e')]});}})[_0x73c5('0x24')](function(_0x22dc2f){if(!_0x22dc2f[_0x73c5('0x44')]){throw new db[(_0x73c5('0x6c'))][(_0x73c5('0x6d'))](_0x73c5('0x8f'),0xcc);}if(_0x5baf1d[_0x73c5('0x90')]===_0x73c5('0x91')){return null;}var _0x3d9b6c=_['merge'](_0x5baf1d,{'name':_0x5baf1d[_0x73c5('0x92')]||_0x5baf1d[_0x73c5('0x29')]||_0x2a2c7a[_0x73c5('0x29')],'basename':_0x56cbd7,'savename':util['format']('%s-%s.%s',_0x5baf1d['name']||_0x2a2c7a[_0x73c5('0x29')],require(_0x73c5('0x93'))[_0x73c5('0x94')](0x4),_0x5baf1d[_0x73c5('0x90')]||_0x73c5('0x95')),'reportId':_0x2a2c7a['id'],'reportType':'default'});return db[_0x73c5('0x96')][_0x73c5('0x47')](_0x3d9b6c,{'raw':!![]});})['then'](function(_0x346842){if(_0x2a2c7a[_0x73c5('0x72')]==='cdr'){_0x352800[_0x73c5('0x38')](_0x2a2c7a[_0x73c5('0x72')]+_0x73c5('0x97'),_0x5baf1d[_0x73c5('0x98')],_0x5baf1d[_0x73c5('0x99')]);}else{_0x352800[_0x73c5('0x38')](_0x2a2c7a['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5baf1d[_0x73c5('0x98')],_0x5baf1d[_0x73c5('0x99')]);}if(_0x346842){logger[_0x73c5('0x9a')](_0x73c5('0x9b'),_0x352800[_0x73c5('0x85')]());require('child_process')[_0x73c5('0x9c')](path['join'](__dirname,_0x73c5('0x9d'),_0x346842[_0x73c5('0x90')]),[_0x346842['id'],_0x352800['toString'](),path['join'](__dirname,'../../files/reports',_0x346842['savename']),_0x56cbd7]);return _0x346842;}else{var _0x23d7c9=squel[_0x73c5('0x8b')]();_0x23d7c9[_0x73c5('0x71')]('('+_0x352800[_0x73c5('0x85')]()+')',_0x73c5('0x9e'));_0x23d7c9['field']('COUNT(*)',_0x73c5('0x1d'));_0x352800['limit'](_0x5baf1d[_0x73c5('0x1f')]||_0x1c3fac);_0x352800['offset'](_0x5baf1d[_0x73c5('0x1e')]||0x0);return db['sequelize'][_0x73c5('0x2f')](_0x23d7c9['toString'](),{'type':db['sequelize'][_0x73c5('0x86')]['SELECT']})['then'](function(_0x168955){if(!_0x168955[_0x73c5('0x44')]){_0x263e8c=0x0;}else{_0x263e8c=_0x168955[0x0][_0x73c5('0x1d')]||0x0;}return db[_0x73c5('0x84')]['query'](_0x352800['toString'](),{'type':db[_0x73c5('0x84')][_0x73c5('0x86')]['SELECT']});})[_0x73c5('0x24')](function(_0x27f7fc){return{'rows':_0x27f7fc||[],'count':_0x263e8c};});}});}exports[_0x73c5('0x9f')]=function(_0xaf7b8a,_0x39a8dd){return runReport(_0xaf7b8a['params'],_0xaf7b8a[_0x73c5('0x2f')],_0xaf7b8a[_0x73c5('0x3e')])[_0x73c5('0x24')](respondWithResult(_0x39a8dd,null))[_0x73c5('0x41')](handleError(_0x39a8dd,null));};exports[_0x73c5('0xa0')]=runReport;exports[_0x73c5('0x2f')]=function(_0x336967,_0x3b4a18){var _0x1cdf79=0xa;var _0x1af7f6=['join',_0x73c5('0x53'),'right_join',_0x73c5('0x54')];var _0x5c0b41={'SUM':_0x73c5('0xa1'),'COUNT':_0x73c5('0x55'),'COUNT DISTINCT':_0x73c5('0x56'),'MAX':_0x73c5('0x57'),'MIN':_0x73c5('0x58'),'AVG':_0x73c5('0x59'),'GROUP_CONCAT':_0x73c5('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x73c5('0x5c')};var _0x5e83a1={'SEC_TO_TIME':_0x73c5('0x5d'),'DATE':_0x73c5('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x73c5('0x60'),'UNIX_TIMESTAMP':_0x73c5('0x61')};var _0x492932=function(_0x419254){return!_[_0x73c5('0x62')]([_0x73c5('0x63'),_0x73c5('0x64'),_0x73c5('0x65'),'IS\x20NOT\x20EMPTY'],_0x419254);};var _0x3011a2=function(_0x4e7d0){if(!_0x4e7d0||!_0x4e7d0['rules'][_0x73c5('0x44')]){return'';}for(var _0x116e03='(',_0x4df133=0x0;_0x4df133<_0x4e7d0[_0x73c5('0x67')][_0x73c5('0x44')];_0x4df133+=0x1){_0x4df133>0x0&&(_0x116e03+='\x20'+_0x4e7d0[_0x73c5('0x88')]+'\x20');_0x116e03+=_0x4e7d0[_0x73c5('0x67')][_0x4df133][_0x73c5('0x68')]?_0x3011a2(_0x4e7d0['rules'][_0x4df133]['group']):_0x4e7d0[_0x73c5('0x67')][_0x4df133]['field']+'\x20'+_0x4e7d0['rules'][_0x4df133][_0x73c5('0x6a')]+(_0x492932(_0x4e7d0['rules'][_0x4df133][_0x73c5('0x6a')])?'\x20'+_0x4e7d0[_0x73c5('0x67')][_0x4df133][_0x73c5('0x6b')]:'');}return _0x116e03+')';};var _0x103252={'where':{'id':_0x336967[_0x73c5('0x43')]['id']}},_0x16fe27,_0x275db8,_0x1a469a,_0x5b1723,_0x51c15c;_0x103252=_[_0x73c5('0x3a')]({},_0x103252,_0x336967[_0x73c5('0x3e')]);return db[_0x73c5('0x2b')][_0x73c5('0x46')](_0x103252)[_0x73c5('0x24')](function(_0x2c94da){if(_0x2c94da){_0x16fe27=_0x2c94da;return _0x2c94da[_0x73c5('0x89')]();}return null;})[_0x73c5('0x24')](function(_0x3401b3){if(_0x3401b3){if(!_0x3401b3[_0x73c5('0x44')]){throw new db[(_0x73c5('0x6c'))][(_0x73c5('0x6d'))](_0x73c5('0x6e'),0x193);}_0x275db8=_0x3401b3;return db['AnalyticMetric'][_0x73c5('0x8a')]({'raw':!![]});}return null;})[_0x73c5('0x24')](function(_0x3c949f){if(_0x3c949f){_0x1a469a=_[_0x73c5('0x70')](_0x3c949f,'id');var _0x241017;var _0x3c163f=squel[_0x73c5('0x8b')]();_0x3c163f['from'](_0x16fe27[_0x73c5('0x72')]);for(var _0x2a78a3=0x0;_0x2a78a3<_0x275db8[_0x73c5('0x44')];_0x2a78a3+=0x1){_0x241017=_0x275db8[_0x2a78a3]['MetricId']?_0x1a469a[_0x275db8[_0x2a78a3][_0x73c5('0x73')]]['metric']:_0x275db8[_0x2a78a3][_0x73c5('0x69')];_0x241017=_0x275db8[_0x2a78a3][_0x73c5('0x75')]?_[_0x73c5('0x76')](_0x5c0b41[_0x275db8[_0x2a78a3][_0x73c5('0x75')]],'%s',_0x241017):_0x241017;_0x241017=_0x275db8[_0x2a78a3][_0x73c5('0x77')]?_['replace'](_0x5e83a1[_0x275db8[_0x2a78a3][_0x73c5('0x77')]],'%s',_0x241017):_0x241017;if(_0x275db8[_0x2a78a3][_0x73c5('0x78')]){_0x3c163f['group'](_0x241017);}_0x275db8[_0x2a78a3][_0x73c5('0x79')]&&_0x3c163f[_0x73c5('0x36')](_0x241017,_0x275db8[_0x2a78a3][_0x73c5('0x79')]==='DESC'?![]:!![]);_0x3c163f[_0x73c5('0x69')](_0x241017,_0x275db8[_0x2a78a3]['alias']||_0x241017);}if(_0x16fe27[_0x73c5('0x7c')]){_0x16fe27[_0x73c5('0x7c')]=JSON[_0x73c5('0x7d')](_0x16fe27[_0x73c5('0x7c')]);for(var _0x1ada0d=0x0;_0x1ada0d<_0x16fe27[_0x73c5('0x7c')][_0x73c5('0x44')];_0x1ada0d+=0x1){if(_0x16fe27[_0x73c5('0x7c')][_0x1ada0d][_0x73c5('0x3c')]&&_['includes'](_0x1af7f6,_0x16fe27[_0x73c5('0x7c')][_0x1ada0d]['type'])&&_0x16fe27[_0x73c5('0x7c')][_0x1ada0d]['parentKey']&&_0x16fe27['joins'][_0x1ada0d][_0x73c5('0x7f')]&&_0x16fe27[_0x73c5('0x7c')][_0x1ada0d][_0x73c5('0x80')]){_0x3c163f[_0x16fe27[_0x73c5('0x7c')][_0x1ada0d][_0x73c5('0x3c')]](_0x16fe27[_0x73c5('0x7c')][_0x1ada0d][_0x73c5('0x7f')],null,util['format'](_0x73c5('0x8c'),_0x16fe27[_0x73c5('0x72')],_0x16fe27[_0x73c5('0x7c')][_0x1ada0d]['parentKey'],_0x16fe27[_0x73c5('0x7c')][_0x1ada0d][_0x73c5('0x7f')],_0x16fe27[_0x73c5('0x7c')][_0x1ada0d]['foreignKey']));}}}if(_0x16fe27['conditions']){_0x16fe27[_0x73c5('0x81')]=JSON[_0x73c5('0x7d')](_0x16fe27['conditions']);_0x3c163f[_0x73c5('0x38')](_0x3011a2(_0x16fe27['conditions'][_0x73c5('0x68')]));}_0x51c15c=_0x3c163f[_0x73c5('0x82')]();_0x3c163f[_0x73c5('0x1f')](_0x1cdf79);_0x3c163f[_0x73c5('0x1e')](0x0);logger[_0x73c5('0x8d')](_0x73c5('0x83'),_0x3c163f[_0x73c5('0x85')]());return db[_0x73c5('0x84')][_0x73c5('0x2f')](_0x3c163f[_0x73c5('0x85')](),{'type':db[_0x73c5('0x84')][_0x73c5('0x86')][_0x73c5('0x8e')]});}})[_0x73c5('0x24')](function(){return{'sql':_0x51c15c[_0x73c5('0x85')]()};})[_0x73c5('0x24')](respondWithResult(_0x3b4a18,null))[_0x73c5('0x41')](handleError(_0x3b4a18,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 0ad216e..267f1bf 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 _0x9030=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9030,0x1f2));var _0x0903=function(_0x13d1ae,_0x19e2a3){_0x13d1ae=_0x13d1ae-0x0;var _0x114116=_0x9030[_0x13d1ae];return _0x114116;};'use strict';var _=require(_0x0903('0x0'));var util=require(_0x0903('0x1'));var logger=require(_0x0903('0x2'))(_0x0903('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0903('0x4'));var fs=require('fs');var path=require(_0x0903('0x5'));var rimraf=require(_0x0903('0x6'));var config=require('../../config/environment');var attributes=require(_0x0903('0x7'));module[_0x0903('0x8')]=function(_0x1818a8,_0xf5b01e){return _0x1818a8[_0x0903('0x9')](_0x0903('0xa'),attributes,{'tableName':_0x0903('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0a7=['analytics_default_reports','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x171a8a,_0x2c6407){var _0x178cbc=function(_0x17cec0){while(--_0x17cec0){_0x171a8a['push'](_0x171a8a['shift']());}};_0x178cbc(++_0x2c6407);}(_0xc0a7,0x121));var _0x7c0a=function(_0x526104,_0x5abb46){_0x526104=_0x526104-0x0;var _0x1a9374=_0xc0a7[_0x526104];return _0x1a9374;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c0a('0x0'))(_0x7c0a('0x1'));var moment=require(_0x7c0a('0x2'));var BPromise=require(_0x7c0a('0x3'));var rp=require(_0x7c0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c0a('0x5'));var config=require(_0x7c0a('0x6'));var attributes=require(_0x7c0a('0x7'));module[_0x7c0a('0x8')]=function(_0x94cda8,_0x2a300f){return _0x94cda8[_0x7c0a('0x9')](_0x7c0a('0xa'),attributes,{'tableName':_0x7c0a('0xb'),'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 ea04fef..a24fd2c 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4101d6,_0x4906a2){var _0x48c5d6=function(_0x7936d2){while(--_0x7936d2){_0x4101d6['push'](_0x4101d6['shift']());}};_0x48c5d6(++_0x4906a2);}(_0xaa88,0x137));var _0x8aa8=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0xaa88[_0x5f382f];return _0x3bb11b;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x0713=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1354f0,_0x213db6){var _0x3c23c1=function(_0x57d4fa){while(--_0x57d4fa){_0x1354f0['push'](_0x1354f0['shift']());}};_0x3c23c1(++_0x213db6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 49167ae..6a5d624 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 _0x347b=['create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/query','query','post'];(function(_0x5c54c6,_0x592383){var _0x56b332=function(_0x58e38d){while(--_0x58e38d){_0x5c54c6['push'](_0x5c54c6['shift']());}};_0x56b332(++_0x592383);}(_0x347b,0x69));var _0xb347=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x347b[_0x466a1a];return _0x577165;};'use strict';var multer=require(_0xb347('0x0'));var util=require(_0xb347('0x1'));var path=require(_0xb347('0x2'));var timeout=require(_0xb347('0x3'));var express=require('express');var router=express[_0xb347('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb347('0x5'));var config=require('../../config/environment');var controller=require(_0xb347('0x6'));router[_0xb347('0x7')]('/',auth[_0xb347('0x8')](),controller['index']);router[_0xb347('0x7')](_0xb347('0x9'),auth[_0xb347('0x8')](),controller['show']);router[_0xb347('0x7')](_0xb347('0xa'),auth[_0xb347('0x8')](),controller[_0xb347('0xb')]);router[_0xb347('0x7')]('/:id/run',auth[_0xb347('0x8')](),controller['run']);router[_0xb347('0x7')](_0xb347('0xc'),auth[_0xb347('0x8')](),controller[_0xb347('0xd')]);router[_0xb347('0xe')]('/',auth[_0xb347('0x8')](),controller[_0xb347('0xf')]);router[_0xb347('0x10')](_0xb347('0x9'),auth[_0xb347('0x8')](),controller[_0xb347('0x11')]);router[_0xb347('0x12')](_0xb347('0x9'),auth[_0xb347('0x8')](),controller['destroy']);module[_0xb347('0x13')]=router; \ No newline at end of file +var _0xb2b9=['isAuthenticated','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','index','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb2b9,0x1d7));var _0x9b2b=function(_0x59d498,_0x39e3e7){_0x59d498=_0x59d498-0x0;var _0x42f0e9=_0xb2b9[_0x59d498];return _0x42f0e9;};'use strict';var multer=require(_0x9b2b('0x0'));var util=require(_0x9b2b('0x1'));var path=require(_0x9b2b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9b2b('0x3'));var interaction=require(_0x9b2b('0x4'));var config=require(_0x9b2b('0x5'));var controller=require(_0x9b2b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b2b('0x7')]);router['get'](_0x9b2b('0x8'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('0xa')]);router[_0x9b2b('0xb')](_0x9b2b('0xc'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('0xd')]);router[_0x9b2b('0xb')](_0x9b2b('0xe'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('0xf')]);router[_0x9b2b('0xb')](_0x9b2b('0x10'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('0x11')]);router[_0x9b2b('0x12')]('/',auth[_0x9b2b('0x9')](),controller[_0x9b2b('0x13')]);router[_0x9b2b('0x14')](_0x9b2b('0x8'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('0x15')]);router[_0x9b2b('0x16')](_0x9b2b('0x8'),auth[_0x9b2b('0x9')](),controller[_0x9b2b('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 758f1fa..36296d4 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 _0x1660=['STRING','ENUM','pdf','xlsx','csv','Loading','manual','UNSIGNED','moment'];(function(_0x7f586c,_0x5e9243){var _0xa316c4=function(_0x162f48){while(--_0x162f48){_0x7f586c['push'](_0x7f586c['shift']());}};_0xa316c4(++_0x5e9243);}(_0x1660,0xe9));var _0x0166=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x1660[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0166('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0166('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x0166('0x2')]('csv',_0x0166('0x3'),_0x0166('0x4')),'allowNull':![],'defaultValue':_0x0166('0x5')},'savename':{'type':Sequelize[_0x0166('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x0166('0x1')],'defaultValue':_0x0166('0x6')},'type':{'type':Sequelize[_0x0166('0x2')](_0x0166('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x0166('0x8')]},'reportType':{'type':Sequelize[_0x0166('0x1')]}}; \ No newline at end of file +var _0x9320=['sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0x9320,0x82));var _0x0932=function(_0x44e847,_0x313561){_0x44e847=_0x44e847-0x0;var _0x351c4a=_0x9320[_0x44e847];return _0x351c4a;};'use strict';var Sequelize=require(_0x0932('0x0'));var moment=require(_0x0932('0x1'));module['exports']={'name':{'type':Sequelize[_0x0932('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0932('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0932('0x3')](_0x0932('0x4'),_0x0932('0x5'),_0x0932('0x6')),'allowNull':![],'defaultValue':_0x0932('0x4')},'savename':{'type':Sequelize[_0x0932('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0932('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x0932('0x2')],'defaultValue':_0x0932('0x8')},'type':{'type':Sequelize[_0x0932('0x3')](_0x0932('0x9'),_0x0932('0xa')),'allowNull':![],'defaultValue':_0x0932('0x9')},'reportId':{'type':Sequelize[_0x0932('0xb')](0xb)[_0x0932('0xc')]},'reportType':{'type':Sequelize[_0x0932('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 29cc88c..8141079 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 _0x3e88=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','get','ExtractedReports','stack','name','send','AnalyticExtractedReport','rawAttributes','model','intersection','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','type','key','field','options','includeAll','include','rows','catch','show','keys','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js'];(function(_0x204a63,_0x4dc00a){var _0x389f09=function(_0x2e22c1){while(--_0x2e22c1){_0x204a63['push'](_0x204a63['shift']());}};_0x389f09(++_0x4dc00a);}(_0x3e88,0x111));var _0x83e8=function(_0xf9b62,_0x1a2210){_0xf9b62=_0xf9b62-0x0;var _0x42e775=_0x3e88[_0xf9b62];return _0x42e775;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x83e8('0x0'));var rimraf=require(_0x83e8('0x1'));var zipdir=require(_0x83e8('0x2'));var jsonpatch=require(_0x83e8('0x3'));var rp=require(_0x83e8('0x4'));var moment=require('moment');var BPromise=require(_0x83e8('0x5'));var Mustache=require(_0x83e8('0x6'));var util=require(_0x83e8('0x7'));var path=require(_0x83e8('0x8'));var sox=require(_0x83e8('0x9'));var csv=require(_0x83e8('0xa'));var ejs=require(_0x83e8('0xb'));var fs=require('fs');var _=require(_0x83e8('0xc'));var squel=require('squel');var crypto=require(_0x83e8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x83e8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x83e8('0xf'));var Papa=require(_0x83e8('0x10'));var Redis=require(_0x83e8('0x11'));var authService=require(_0x83e8('0x12'));var qs=require(_0x83e8('0x13'));var hardwareService=require(_0x83e8('0x14'));var logger=require('../../config/logger')(_0x83e8('0x15'));var utils=require(_0x83e8('0x16'));var config=require(_0x83e8('0x17'));var db=require(_0x83e8('0x18'))['db'];function respondWithStatusCode(_0x2df05a,_0x5392fd){_0x5392fd=_0x5392fd||0xcc;return function(_0x5b665e){if(_0x5b665e){return _0x2df05a[_0x83e8('0x19')](_0x5392fd);}return _0x2df05a[_0x83e8('0x1a')](_0x5392fd)[_0x83e8('0x1b')]();};}function respondWithResult(_0x2d0641,_0x359dac){_0x359dac=_0x359dac||0xc8;return function(_0x599250){if(_0x599250){return _0x2d0641[_0x83e8('0x1a')](_0x359dac)[_0x83e8('0x1c')](_0x599250);}};}function respondWithFilteredResult(_0x4bdac6,_0x3ce647){return function(_0x1d9e31){if(_0x1d9e31){var _0x32f773=_0x1d9e31[_0x83e8('0x1d')],_0x44df6e=_0x3ce647['offset'],_0x6e03ff=_0x3ce647[_0x83e8('0x1e')]+_0x3ce647['limit'],_0xb9c14e;if(_0x6e03ff>=_0x32f773){_0x6e03ff=_0x32f773;_0xb9c14e=0xc8;}else{_0xb9c14e=0xce;}_0x4bdac6[_0x83e8('0x1a')](_0xb9c14e);return _0x4bdac6[_0x83e8('0x1f')](_0x83e8('0x20'),_0x44df6e+'-'+_0x6e03ff+'/'+_0x32f773)[_0x83e8('0x1c')](_0x1d9e31);}return null;};}function patchUpdates(_0x1edf1f){return function(_0x4d2072){try{jsonpatch['apply'](_0x4d2072,_0x1edf1f,!![]);}catch(_0x48b0a2){return BPromise['reject'](_0x48b0a2);}return _0x4d2072[_0x83e8('0x21')]();};}function saveUpdates(_0x402fde,_0x517667){return function(_0x495732){if(_0x495732){return _0x495732[_0x83e8('0x22')](_0x402fde)[_0x83e8('0x23')](function(_0x3b55eb){return _0x3b55eb;});}return null;};}function removeEntity(_0x2d4396,_0xa6558b){return function(_0x2bc974){if(_0x2bc974){return _0x2bc974[_0x83e8('0x24')]()[_0x83e8('0x23')](function(){var _0x1ab71e=_0x2bc974[_0x83e8('0x25')]({'plain':!![]});var _0x169a6e=_0x83e8('0x26');return db['UserProfileResource'][_0x83e8('0x24')]({'where':{'type':_0x169a6e,'resourceId':_0x1ab71e['id']}})[_0x83e8('0x23')](function(){return _0x2bc974;});})[_0x83e8('0x23')](function(){_0x2d4396['status'](0xcc)[_0x83e8('0x1b')]();});}};}function handleEntityNotFound(_0x7e3fab,_0x36e4c9){return function(_0xe5dfb8){if(!_0xe5dfb8){_0x7e3fab[_0x83e8('0x19')](0x194);}return _0xe5dfb8;};}function handleError(_0x211bcd,_0x220933){_0x220933=_0x220933||0x1f4;return function(_0x74fba0){logger['error'](_0x74fba0[_0x83e8('0x27')]);if(_0x74fba0[_0x83e8('0x28')]){delete _0x74fba0[_0x83e8('0x28')];}_0x211bcd[_0x83e8('0x1a')](_0x220933)[_0x83e8('0x29')](_0x74fba0);};}exports['index']=function(_0x40cf96,_0x4f1005){var _0x2df70a={},_0x19ce25={},_0x32fa32={'count':0x0,'rows':[]};var _0x1bffab=db[_0x83e8('0x2a')][_0x83e8('0x2b')];_0x19ce25[_0x83e8('0x2c')]=_['keys'](_0x1bffab);_0x19ce25['query']=_['keys'](_0x40cf96['query']);_0x19ce25['filters']=_[_0x83e8('0x2d')](_0x19ce25[_0x83e8('0x2c')],_0x19ce25[_0x83e8('0x2e')]);_0x2df70a[_0x83e8('0x2f')]=_[_0x83e8('0x2d')](_0x19ce25[_0x83e8('0x2c')],qs['fields'](_0x40cf96['query']['fields']));_0x2df70a[_0x83e8('0x2f')]=_0x2df70a[_0x83e8('0x2f')][_0x83e8('0x30')]?_0x2df70a['attributes']:_0x19ce25[_0x83e8('0x2c')];if(!_0x40cf96[_0x83e8('0x2e')][_0x83e8('0x31')](_0x83e8('0x32'))){_0x2df70a[_0x83e8('0x33')]=qs[_0x83e8('0x33')](_0x40cf96['query']['limit']);_0x2df70a[_0x83e8('0x1e')]=qs['offset'](_0x40cf96[_0x83e8('0x2e')][_0x83e8('0x1e')]);}_0x2df70a[_0x83e8('0x34')]=qs['sort'](_0x40cf96[_0x83e8('0x2e')][_0x83e8('0x35')]);_0x2df70a['where']=qs[_0x83e8('0x36')](_[_0x83e8('0x37')](_0x40cf96[_0x83e8('0x2e')],_0x19ce25['filters']));if(_0x40cf96[_0x83e8('0x2e')][_0x83e8('0x38')]){_0x2df70a[_0x83e8('0x39')]=_[_0x83e8('0x3a')](_0x2df70a[_0x83e8('0x39')],{'$or':_[_0x83e8('0x3b')](_0x1bffab,function(_0x3f15d5){if(_0x3f15d5[_0x83e8('0x3c')][_0x83e8('0x3d')]!=='VIRTUAL'){var _0x3ea47e={};_0x3ea47e[_0x3f15d5[_0x83e8('0x3e')]]={'$like':'%'+_0x40cf96['query'][_0x83e8('0x38')]+'%'};return _0x3ea47e;}})});}_0x2df70a=_[_0x83e8('0x3a')]({},_0x2df70a,_0x40cf96[_0x83e8('0x3f')]);var _0x1cd2b9={'where':_0x2df70a[_0x83e8('0x39')]};return db[_0x83e8('0x2a')]['count'](_0x1cd2b9)[_0x83e8('0x23')](function(_0x485805){_0x32fa32[_0x83e8('0x1d')]=_0x485805;if(_0x40cf96[_0x83e8('0x2e')][_0x83e8('0x40')]){_0x2df70a[_0x83e8('0x41')]=[{'all':!![]}];}return db[_0x83e8('0x2a')]['findAll'](_0x2df70a);})['then'](function(_0x55abc6){_0x32fa32[_0x83e8('0x42')]=_0x55abc6;return _0x32fa32;})[_0x83e8('0x23')](respondWithFilteredResult(_0x4f1005,_0x2df70a))[_0x83e8('0x43')](handleError(_0x4f1005,null));};exports[_0x83e8('0x44')]=function(_0x5c95a8,_0x41bac8){var _0x458ffd={'raw':!![],'where':{'id':_0x5c95a8['params']['id']}},_0x2d44c8={};_0x2d44c8[_0x83e8('0x2c')]=_[_0x83e8('0x45')](db[_0x83e8('0x2a')]['rawAttributes']);_0x2d44c8[_0x83e8('0x2e')]=_[_0x83e8('0x45')](_0x5c95a8[_0x83e8('0x2e')]);_0x2d44c8[_0x83e8('0x36')]=_[_0x83e8('0x2d')](_0x2d44c8[_0x83e8('0x2c')],_0x2d44c8[_0x83e8('0x2e')]);_0x458ffd['attributes']=_[_0x83e8('0x2d')](_0x2d44c8[_0x83e8('0x2c')],qs[_0x83e8('0x46')](_0x5c95a8['query']['fields']));_0x458ffd['attributes']=_0x458ffd[_0x83e8('0x2f')][_0x83e8('0x30')]?_0x458ffd[_0x83e8('0x2f')]:_0x2d44c8[_0x83e8('0x2c')];if(_0x5c95a8[_0x83e8('0x2e')][_0x83e8('0x40')]){_0x458ffd[_0x83e8('0x41')]=[{'all':!![]}];}_0x458ffd=_[_0x83e8('0x3a')]({},_0x458ffd,_0x5c95a8[_0x83e8('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x458ffd)[_0x83e8('0x23')](handleEntityNotFound(_0x41bac8,null))[_0x83e8('0x23')](respondWithResult(_0x41bac8,null))[_0x83e8('0x43')](handleError(_0x41bac8,null));};exports[_0x83e8('0x47')]=function(_0x45deb0,_0x31a882){return db[_0x83e8('0x2a')][_0x83e8('0x47')](_0x45deb0['body'],{})['then'](function(_0x554476){var _0x5e4918=_0x45deb0[_0x83e8('0x48')][_0x83e8('0x25')]({'plain':!![]});if(!_0x5e4918)throw new Error(_0x83e8('0x49'));if(_0x5e4918[_0x83e8('0x4a')]==='user'){var _0x3eef93=_0x554476[_0x83e8('0x25')]({'plain':!![]});var _0x510ece=_0x83e8('0x26');return db[_0x83e8('0x4b')][_0x83e8('0x4c')]({'where':{'name':_0x510ece,'userProfileId':_0x5e4918[_0x83e8('0x4d')]},'raw':!![]})['then'](function(_0x328ddc){if(_0x328ddc&&_0x328ddc[_0x83e8('0x4e')]===0x0){return db[_0x83e8('0x4f')][_0x83e8('0x47')]({'name':_0x3eef93[_0x83e8('0x28')],'resourceId':_0x3eef93['id'],'type':_0x328ddc[_0x83e8('0x28')],'sectionId':_0x328ddc['id']},{})['then'](function(){return _0x554476;});}else{return _0x554476;}})[_0x83e8('0x43')](function(_0x33a257){logger[_0x83e8('0x50')](_0x83e8('0x51'),_0x33a257);throw _0x33a257;});}return _0x554476;})[_0x83e8('0x23')](respondWithResult(_0x31a882,0xc9))[_0x83e8('0x43')](handleError(_0x31a882,null));};exports['update']=function(_0x43f5ba,_0x3a62e8){if(_0x43f5ba[_0x83e8('0x52')]['id']){delete _0x43f5ba[_0x83e8('0x52')]['id'];}return db[_0x83e8('0x2a')][_0x83e8('0x4c')]({'where':{'id':_0x43f5ba['params']['id']}})[_0x83e8('0x23')](handleEntityNotFound(_0x3a62e8,null))[_0x83e8('0x23')](saveUpdates(_0x43f5ba['body'],null))['then'](respondWithResult(_0x3a62e8,null))[_0x83e8('0x43')](handleError(_0x3a62e8,null));};exports['destroy']=function(_0x40d621,_0x24e8d8){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x40d621[_0x83e8('0x53')]['id']}})[_0x83e8('0x23')](handleEntityNotFound(_0x24e8d8,null))[_0x83e8('0x23')](removeEntity(_0x24e8d8,null))[_0x83e8('0x43')](handleError(_0x24e8d8,null));};exports[_0x83e8('0x54')]=function(_0xfb348c,_0x58f3d8,_0x1fb5a7){return db[_0x83e8('0x2a')][_0x83e8('0x4c')]({'where':{'id':_0xfb348c[_0x83e8('0x53')]['id']},'attributes':[_0x83e8('0x28'),_0x83e8('0x55'),_0x83e8('0x56'),_0x83e8('0x57')],'raw':!![]})[_0x83e8('0x23')](handleEntityNotFound(_0x58f3d8,null))[_0x83e8('0x23')](function(_0x4bbc43){if(_0x4bbc43){if(!fs[_0x83e8('0x58')](path[_0x83e8('0x59')](config['root'],_0x83e8('0x5a'),_0x4bbc43[_0x83e8('0x56')]))){throw new db[(_0x83e8('0x5b'))]['ValidationError'](_0x83e8('0x5c'));}if(_0xfb348c[_0x83e8('0x2e')][_0x83e8('0x5d')]){return _0x58f3d8[_0x83e8('0x19')](0xc8);}return _0x58f3d8[_0x83e8('0x54')](path[_0x83e8('0x59')](config[_0x83e8('0x5e')],'server/files/reports',_0x4bbc43[_0x83e8('0x56')]),util['format'](_0x83e8('0x5f'),_0x4bbc43[_0x83e8('0x55')]||_0x4bbc43[_0x83e8('0x28')],_0x4bbc43[_0x83e8('0x57')]['toLowerCase']()));}})[_0x83e8('0x43')](handleError(_0x58f3d8,null));}; \ No newline at end of file +var _0xd808=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','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','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x1e8582,_0x160375){var _0x5678c8=function(_0x1a6b3a){while(--_0x1a6b3a){_0x1e8582['push'](_0x1e8582['shift']());}};_0x5678c8(++_0x160375);}(_0xd808,0x1d1));var _0x8d80=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xd808[_0x503950];return _0x1657a9;};'use strict';var pdf=require(_0x8d80('0x0'));var emlformat=require(_0x8d80('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8d80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d80('0x3'));var BPromise=require(_0x8d80('0x4'));var Mustache=require(_0x8d80('0x5'));var util=require(_0x8d80('0x6'));var path=require('path');var sox=require(_0x8d80('0x7'));var csv=require(_0x8d80('0x8'));var ejs=require(_0x8d80('0x9'));var fs=require('fs');var _=require(_0x8d80('0xa'));var squel=require(_0x8d80('0xb'));var crypto=require(_0x8d80('0xc'));var jsforce=require(_0x8d80('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8d80('0x8'));var querystring=require(_0x8d80('0xe'));var Papa=require(_0x8d80('0xf'));var Redis=require(_0x8d80('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8d80('0x11'));var hardwareService=require(_0x8d80('0x12'));var logger=require('../../config/logger')(_0x8d80('0x13'));var utils=require(_0x8d80('0x14'));var config=require('../../config/environment');var db=require(_0x8d80('0x15'))['db'];function respondWithStatusCode(_0x54814a,_0x34035f){_0x34035f=_0x34035f||0xcc;return function(_0x58b4b8){if(_0x58b4b8){return _0x54814a[_0x8d80('0x16')](_0x34035f);}return _0x54814a[_0x8d80('0x17')](_0x34035f)[_0x8d80('0x18')]();};}function respondWithResult(_0x2c4c82,_0x2c69ac){_0x2c69ac=_0x2c69ac||0xc8;return function(_0x3f339c){if(_0x3f339c){return _0x2c4c82[_0x8d80('0x17')](_0x2c69ac)[_0x8d80('0x19')](_0x3f339c);}};}function respondWithFilteredResult(_0x28de84,_0x17101c){return function(_0x1e22c2){if(_0x1e22c2){var _0x4d9309=_0x1e22c2[_0x8d80('0x1a')],_0x12822d=_0x17101c['offset'],_0x31de58=_0x17101c[_0x8d80('0x1b')]+_0x17101c[_0x8d80('0x1c')],_0x5aab03;if(_0x31de58>=_0x4d9309){_0x31de58=_0x4d9309;_0x5aab03=0xc8;}else{_0x5aab03=0xce;}_0x28de84[_0x8d80('0x17')](_0x5aab03);return _0x28de84[_0x8d80('0x1d')](_0x8d80('0x1e'),_0x12822d+'-'+_0x31de58+'/'+_0x4d9309)[_0x8d80('0x19')](_0x1e22c2);}return null;};}function patchUpdates(_0x318c25){return function(_0x18648e){try{jsonpatch[_0x8d80('0x1f')](_0x18648e,_0x318c25,!![]);}catch(_0x5da6b9){return BPromise['reject'](_0x5da6b9);}return _0x18648e[_0x8d80('0x20')]();};}function saveUpdates(_0x440c3a,_0x112889){return function(_0x580a93){if(_0x580a93){return _0x580a93[_0x8d80('0x21')](_0x440c3a)[_0x8d80('0x22')](function(_0x8ecad4){return _0x8ecad4;});}return null;};}function removeEntity(_0xbab808,_0x2789a8){return function(_0x39a246){if(_0x39a246){return _0x39a246[_0x8d80('0x23')]()[_0x8d80('0x22')](function(){var _0x5f39ae=_0x39a246['get']({'plain':!![]});var _0x4addad=_0x8d80('0x24');return db[_0x8d80('0x25')][_0x8d80('0x23')]({'where':{'type':_0x4addad,'resourceId':_0x5f39ae['id']}})[_0x8d80('0x22')](function(){return _0x39a246;});})[_0x8d80('0x22')](function(){_0xbab808[_0x8d80('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376e49,_0x300d73){return function(_0x16a4e8){if(!_0x16a4e8){_0x376e49['sendStatus'](0x194);}return _0x16a4e8;};}function handleError(_0x449dbd,_0x1ef918){_0x1ef918=_0x1ef918||0x1f4;return function(_0x1ef314){logger[_0x8d80('0x26')](_0x1ef314[_0x8d80('0x27')]);if(_0x1ef314[_0x8d80('0x28')]){delete _0x1ef314[_0x8d80('0x28')];}_0x449dbd['status'](_0x1ef918)[_0x8d80('0x29')](_0x1ef314);};}exports[_0x8d80('0x2a')]=function(_0x1057c8,_0x2f3414){var _0x3f0dcb={},_0x32609f={},_0x5c9b8a={'count':0x0,'rows':[]};var _0x364d99=db[_0x8d80('0x2b')][_0x8d80('0x2c')];_0x32609f[_0x8d80('0x2d')]=_['keys'](_0x364d99);_0x32609f[_0x8d80('0x2e')]=_['keys'](_0x1057c8[_0x8d80('0x2e')]);_0x32609f[_0x8d80('0x2f')]=_[_0x8d80('0x30')](_0x32609f[_0x8d80('0x2d')],_0x32609f[_0x8d80('0x2e')]);_0x3f0dcb['attributes']=_['intersection'](_0x32609f['model'],qs[_0x8d80('0x31')](_0x1057c8[_0x8d80('0x2e')][_0x8d80('0x31')]));_0x3f0dcb[_0x8d80('0x32')]=_0x3f0dcb[_0x8d80('0x32')]['length']?_0x3f0dcb[_0x8d80('0x32')]:_0x32609f['model'];if(!_0x1057c8['query'][_0x8d80('0x33')](_0x8d80('0x34'))){_0x3f0dcb[_0x8d80('0x1c')]=qs[_0x8d80('0x1c')](_0x1057c8[_0x8d80('0x2e')]['limit']);_0x3f0dcb['offset']=qs[_0x8d80('0x1b')](_0x1057c8['query'][_0x8d80('0x1b')]);}_0x3f0dcb[_0x8d80('0x35')]=qs[_0x8d80('0x36')](_0x1057c8[_0x8d80('0x2e')][_0x8d80('0x36')]);_0x3f0dcb['where']=qs[_0x8d80('0x2f')](_['pick'](_0x1057c8[_0x8d80('0x2e')],_0x32609f[_0x8d80('0x2f')]));if(_0x1057c8[_0x8d80('0x2e')][_0x8d80('0x37')]){_0x3f0dcb[_0x8d80('0x38')]=_[_0x8d80('0x39')](_0x3f0dcb['where'],{'$or':_[_0x8d80('0x3a')](_0x364d99,function(_0x351f47){if(_0x351f47[_0x8d80('0x3b')][_0x8d80('0x3c')]!=='VIRTUAL'){var _0xbd8707={};_0xbd8707[_0x351f47[_0x8d80('0x3d')]]={'$like':'%'+_0x1057c8[_0x8d80('0x2e')][_0x8d80('0x37')]+'%'};return _0xbd8707;}})});}_0x3f0dcb=_[_0x8d80('0x39')]({},_0x3f0dcb,_0x1057c8[_0x8d80('0x3e')]);var _0x3e6813={'where':_0x3f0dcb[_0x8d80('0x38')]};return db[_0x8d80('0x2b')]['count'](_0x3e6813)['then'](function(_0x1b3ae5){_0x5c9b8a[_0x8d80('0x1a')]=_0x1b3ae5;if(_0x1057c8[_0x8d80('0x2e')][_0x8d80('0x3f')]){_0x3f0dcb[_0x8d80('0x40')]=[{'all':!![]}];}return db[_0x8d80('0x2b')][_0x8d80('0x41')](_0x3f0dcb);})['then'](function(_0x1d5a89){_0x5c9b8a[_0x8d80('0x42')]=_0x1d5a89;return _0x5c9b8a;})['then'](respondWithFilteredResult(_0x2f3414,_0x3f0dcb))['catch'](handleError(_0x2f3414,null));};exports[_0x8d80('0x43')]=function(_0x5ec464,_0x479966){var _0x5cf0f5={'raw':!![],'where':{'id':_0x5ec464[_0x8d80('0x44')]['id']}},_0x485463={};_0x485463[_0x8d80('0x2d')]=_[_0x8d80('0x45')](db[_0x8d80('0x2b')]['rawAttributes']);_0x485463[_0x8d80('0x2e')]=_[_0x8d80('0x45')](_0x5ec464[_0x8d80('0x2e')]);_0x485463['filters']=_[_0x8d80('0x30')](_0x485463[_0x8d80('0x2d')],_0x485463[_0x8d80('0x2e')]);_0x5cf0f5[_0x8d80('0x32')]=_[_0x8d80('0x30')](_0x485463[_0x8d80('0x2d')],qs['fields'](_0x5ec464[_0x8d80('0x2e')]['fields']));_0x5cf0f5[_0x8d80('0x32')]=_0x5cf0f5[_0x8d80('0x32')][_0x8d80('0x46')]?_0x5cf0f5['attributes']:_0x485463[_0x8d80('0x2d')];if(_0x5ec464[_0x8d80('0x2e')][_0x8d80('0x3f')]){_0x5cf0f5[_0x8d80('0x40')]=[{'all':!![]}];}_0x5cf0f5=_['merge']({},_0x5cf0f5,_0x5ec464[_0x8d80('0x3e')]);return db[_0x8d80('0x2b')][_0x8d80('0x47')](_0x5cf0f5)[_0x8d80('0x22')](handleEntityNotFound(_0x479966,null))[_0x8d80('0x22')](respondWithResult(_0x479966,null))[_0x8d80('0x48')](handleError(_0x479966,null));};exports[_0x8d80('0x49')]=function(_0x43c1ba,_0x47be32){return db[_0x8d80('0x2b')][_0x8d80('0x49')](_0x43c1ba[_0x8d80('0x4a')],{})['then'](function(_0x449a81){var _0x5a3db1=_0x43c1ba[_0x8d80('0x4b')][_0x8d80('0x4c')]({'plain':!![]});if(!_0x5a3db1)throw new Error(_0x8d80('0x4d'));if(_0x5a3db1[_0x8d80('0x4e')]==='user'){var _0x149932=_0x449a81[_0x8d80('0x4c')]({'plain':!![]});var _0x271068=_0x8d80('0x24');return db[_0x8d80('0x4f')][_0x8d80('0x47')]({'where':{'name':_0x271068,'userProfileId':_0x5a3db1[_0x8d80('0x50')]},'raw':!![]})[_0x8d80('0x22')](function(_0x3f35ee){if(_0x3f35ee&&_0x3f35ee[_0x8d80('0x51')]===0x0){return db[_0x8d80('0x25')][_0x8d80('0x49')]({'name':_0x149932[_0x8d80('0x28')],'resourceId':_0x149932['id'],'type':_0x3f35ee['name'],'sectionId':_0x3f35ee['id']},{})['then'](function(){return _0x449a81;});}else{return _0x449a81;}})['catch'](function(_0x105542){logger[_0x8d80('0x26')](_0x8d80('0x52'),_0x105542);throw _0x105542;});}return _0x449a81;})[_0x8d80('0x22')](respondWithResult(_0x47be32,0xc9))[_0x8d80('0x48')](handleError(_0x47be32,null));};exports[_0x8d80('0x21')]=function(_0x2aaed1,_0x2b3021){if(_0x2aaed1['body']['id']){delete _0x2aaed1[_0x8d80('0x4a')]['id'];}return db[_0x8d80('0x2b')]['find']({'where':{'id':_0x2aaed1[_0x8d80('0x44')]['id']}})[_0x8d80('0x22')](handleEntityNotFound(_0x2b3021,null))[_0x8d80('0x22')](saveUpdates(_0x2aaed1[_0x8d80('0x4a')],null))[_0x8d80('0x22')](respondWithResult(_0x2b3021,null))[_0x8d80('0x48')](handleError(_0x2b3021,null));};exports[_0x8d80('0x23')]=function(_0x337e0a,_0x5c66dc){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x337e0a['params']['id']}})['then'](handleEntityNotFound(_0x5c66dc,null))[_0x8d80('0x22')](removeEntity(_0x5c66dc,null))['catch'](handleError(_0x5c66dc,null));};exports['download']=function(_0x3a0642,_0x59c161,_0x2e0dd0){return db[_0x8d80('0x2b')][_0x8d80('0x47')]({'where':{'id':_0x3a0642[_0x8d80('0x44')]['id']},'attributes':['name',_0x8d80('0x53'),_0x8d80('0x54'),_0x8d80('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x59c161,null))['then'](function(_0x348fc9){if(_0x348fc9){if(!fs[_0x8d80('0x56')](path[_0x8d80('0x57')](config['root'],_0x8d80('0x58'),_0x348fc9[_0x8d80('0x54')]))){throw new db[(_0x8d80('0x59'))][(_0x8d80('0x5a'))](_0x8d80('0x5b'));}if(_0x3a0642[_0x8d80('0x2e')][_0x8d80('0x5c')]){return _0x59c161[_0x8d80('0x16')](0xc8);}return _0x59c161[_0x8d80('0x5d')](path[_0x8d80('0x57')](config[_0x8d80('0x5e')],_0x8d80('0x58'),_0x348fc9[_0x8d80('0x54')]),util[_0x8d80('0x5f')]('%s.%s',_0x348fc9['basename']||_0x348fc9['name'],_0x348fc9[_0x8d80('0x55')]['toLowerCase']()));}})[_0x8d80('0x48')](handleError(_0x59c161,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 26a16e0..82302b4 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 _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x525514,_0x5d7876){var _0x426944=function(_0x16bd27){while(--_0x16bd27){_0x525514['push'](_0x525514['shift']());}};_0x426944(++_0x5d7876);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x2eb2[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'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 e0e77fc..0e91e88 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 _0xdfad=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ab5a0,_0x8007ea){var _0x108b5d=function(_0xe7daba){while(--_0xe7daba){_0x3ab5a0['push'](_0x3ab5a0['shift']());}};_0x108b5d(++_0x8007ea);}(_0xdfad,0xd3));var _0xddfa=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xdfad[_0x3c504b];return _0x2e5354;};'use strict';var _=require('lodash');var util=require(_0xddfa('0x0'));var moment=require(_0xddfa('0x1'));var BPromise=require(_0xddfa('0x2'));var rs=require(_0xddfa('0x3'));var fs=require('fs');var Redis=require(_0xddfa('0x4'));var db=require(_0xddfa('0x5'))['db'];var utils=require(_0xddfa('0x6'));var logger=require(_0xddfa('0x7'))(_0xddfa('0x8'));var config=require(_0xddfa('0x9'));var jayson=require(_0xddfa('0xa'));var client=jayson[_0xddfa('0xb')][_0xddfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x465bf0,_0xca5108,_0x288638){return new BPromise(function(_0x11f4fb,_0x16fbef){return client[_0xddfa('0xd')](_0x465bf0,_0x288638)[_0xddfa('0xe')](function(_0x24b4d1){logger[_0xddfa('0xf')](_0xddfa('0x10'),_0xca5108,'request\x20sent');logger[_0xddfa('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xca5108,_0xddfa('0x12'),JSON[_0xddfa('0x13')](_0x24b4d1));if(_0x24b4d1['error']){if(_0x24b4d1[_0xddfa('0x14')][_0xddfa('0x15')]===0x1f4){logger['error'](_0xddfa('0x10'),_0xca5108,_0x24b4d1['error'][_0xddfa('0x16')]);return _0x16fbef(_0x24b4d1['error'][_0xddfa('0x16')]);}logger[_0xddfa('0x14')](_0xddfa('0x10'),_0xca5108,_0x24b4d1[_0xddfa('0x14')][_0xddfa('0x16')]);return _0x11f4fb(_0x24b4d1['error'][_0xddfa('0x16')]);}else{logger[_0xddfa('0xf')](_0xddfa('0x10'),_0xca5108,'request\x20sent');_0x11f4fb(_0x24b4d1[_0xddfa('0x17')][_0xddfa('0x16')]);}})[_0xddfa('0x18')](function(_0x687a7f){logger[_0xddfa('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xca5108,_0x687a7f);_0x16fbef(_0x687a7f);});});} \ No newline at end of file +var _0xc1bc=['../../config/logger','rpc','../../config/environment','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4cb819,_0x382986){var _0x33fb18=function(_0x211d5e){while(--_0x211d5e){_0x4cb819['push'](_0x4cb819['shift']());}};_0x33fb18(++_0x382986);}(_0xc1bc,0x173));var _0xcc1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc1bc[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xcc1b('0x0'));var util=require(_0xcc1b('0x1'));var moment=require('moment');var BPromise=require(_0xcc1b('0x2'));var rs=require(_0xcc1b('0x3'));var fs=require('fs');var Redis=require(_0xcc1b('0x4'));var db=require(_0xcc1b('0x5'))['db'];var utils=require(_0xcc1b('0x6'));var logger=require(_0xcc1b('0x7'))(_0xcc1b('0x8'));var config=require(_0xcc1b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcc1b('0xa')][_0xcc1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x172878,_0x5ca729,_0x4a45b9){return new BPromise(function(_0x16c769,_0x594ff8){return client[_0xcc1b('0xc')](_0x172878,_0x4a45b9)['then'](function(_0x24becd){logger['info'](_0xcc1b('0xd'),_0x5ca729,_0xcc1b('0xe'));logger[_0xcc1b('0xf')](_0xcc1b('0x10'),_0x5ca729,'request\x20sent',JSON[_0xcc1b('0x11')](_0x24becd));if(_0x24becd[_0xcc1b('0x12')]){if(_0x24becd['error']['code']===0x1f4){logger[_0xcc1b('0x12')](_0xcc1b('0xd'),_0x5ca729,_0x24becd[_0xcc1b('0x12')][_0xcc1b('0x13')]);return _0x594ff8(_0x24becd[_0xcc1b('0x12')]['message']);}logger[_0xcc1b('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca729,_0x24becd[_0xcc1b('0x12')]['message']);return _0x16c769(_0x24becd[_0xcc1b('0x12')][_0xcc1b('0x13')]);}else{logger['info'](_0xcc1b('0xd'),_0x5ca729,_0xcc1b('0xe'));_0x16c769(_0x24becd['result'][_0xcc1b('0x13')]);}})[_0xcc1b('0x14')](function(_0x4c8acf){logger['error'](_0xcc1b('0xd'),_0x5ca729,_0x4c8acf);_0x594ff8(_0x4c8acf);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c0e7b90..f969d19 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 _0xdf56=['show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated'];(function(_0x22f3ba,_0x246f25){var _0x6a3f4c=function(_0x48feba){while(--_0x48feba){_0x22f3ba['push'](_0x22f3ba['shift']());}};_0x6a3f4c(++_0x246f25);}(_0xdf56,0x87));var _0x6df5=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0xdf56[_0x4032e3];return _0x34f51a;};'use strict';var multer=require(_0x6df5('0x0'));var util=require(_0x6df5('0x1'));var path=require(_0x6df5('0x2'));var timeout=require('connect-timeout');var express=require(_0x6df5('0x3'));var router=express[_0x6df5('0x4')]();var auth=require(_0x6df5('0x5'));var interaction=require(_0x6df5('0x6'));var config=require('../../config/environment');var controller=require(_0x6df5('0x7'));router[_0x6df5('0x8')]('/',auth['isAuthenticated'](),controller[_0x6df5('0x9')]);router[_0x6df5('0x8')](_0x6df5('0xa'),auth[_0x6df5('0xb')](),controller[_0x6df5('0xc')]);router[_0x6df5('0x8')](_0x6df5('0xd'),auth[_0x6df5('0xb')](),controller[_0x6df5('0xe')]);router[_0x6df5('0xf')]('/',auth[_0x6df5('0xb')](),controller['create']);router[_0x6df5('0x10')](_0x6df5('0xa'),auth['isAuthenticated'](),controller[_0x6df5('0x11')]);router[_0x6df5('0x12')](_0x6df5('0xa'),auth[_0x6df5('0xb')](),controller[_0x6df5('0x13')]);module[_0x6df5('0x14')]=router; \ No newline at end of file +var _0x40d3=['/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x63f06b,_0x2953ec){var _0x4f0985=function(_0x1f3a33){while(--_0x1f3a33){_0x63f06b['push'](_0x63f06b['shift']());}};_0x4f0985(++_0x2953ec);}(_0x40d3,0x1d8));var _0x340d=function(_0xbf3faa,_0x579cde){_0xbf3faa=_0xbf3faa-0x0;var _0x2eef63=_0x40d3[_0xbf3faa];return _0x2eef63;};'use strict';var multer=require(_0x340d('0x0'));var util=require(_0x340d('0x1'));var path=require('path');var timeout=require(_0x340d('0x2'));var express=require(_0x340d('0x3'));var router=express[_0x340d('0x4')]();var auth=require(_0x340d('0x5'));var interaction=require(_0x340d('0x6'));var config=require(_0x340d('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x340d('0x8')]('/',auth[_0x340d('0x9')](),controller[_0x340d('0xa')]);router[_0x340d('0x8')](_0x340d('0xb'),auth['isAuthenticated'](),controller[_0x340d('0xc')]);router[_0x340d('0x8')](_0x340d('0xd'),auth[_0x340d('0x9')](),controller[_0x340d('0xe')]);router[_0x340d('0xf')]('/',auth[_0x340d('0x9')](),controller[_0x340d('0x10')]);router[_0x340d('0x11')](_0x340d('0xb'),auth[_0x340d('0x9')](),controller['update']);router[_0x340d('0x12')]('/:id',auth[_0x340d('0x9')](),controller[_0x340d('0x13')]);module[_0x340d('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 f0b878e..d2c989d 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 _0x6319=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x13fb15,_0x2ec1ee){var _0xc8b40e=function(_0x462db8){while(--_0x462db8){_0x13fb15['push'](_0x13fb15['shift']());}};_0xc8b40e(++_0x2ec1ee);}(_0x6319,0x1f3));var _0x9631=function(_0xf50ab3,_0x17096c){_0xf50ab3=_0xf50ab3-0x0;var _0x51ef36=_0x6319[_0xf50ab3];return _0x51ef36;};'use strict';var Sequelize=require(_0x9631('0x0'));module[_0x9631('0x1')]={'field':{'type':Sequelize[_0x9631('0x2')]},'alias':{'type':Sequelize[_0x9631('0x3')]},'function':{'type':Sequelize[_0x9631('0x3')]},'format':{'type':Sequelize[_0x9631('0x3')]},'groupBy':{'type':Sequelize[_0x9631('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9631('0x3')]},'custom':{'type':Sequelize[_0x9631('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xbf75=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xbf75,0x84));var _0x5bf7=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbf75[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0x5bf7('0x0'));module[_0x5bf7('0x1')]={'field':{'type':Sequelize[_0x5bf7('0x2')]},'alias':{'type':Sequelize[_0x5bf7('0x3')]},'function':{'type':Sequelize[_0x5bf7('0x3')]},'format':{'type':Sequelize[_0x5bf7('0x3')]},'groupBy':{'type':Sequelize[_0x5bf7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5bf7('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 3e7086e..be09521 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 _0xfb5a=['name','send','index','AnalyticFieldReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','bulkCreate','body','ids','AnalyticCustomReport','findOne','sequelize','transaction','map','CustomReportId','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xfb5a,0x126));var _0xafb5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb5a[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xafb5('0x0'));var emlformat=require(_0xafb5('0x1'));var rimraf=require(_0xafb5('0x2'));var zipdir=require(_0xafb5('0x3'));var jsonpatch=require(_0xafb5('0x4'));var rp=require(_0xafb5('0x5'));var moment=require('moment');var BPromise=require(_0xafb5('0x6'));var Mustache=require(_0xafb5('0x7'));var util=require(_0xafb5('0x8'));var path=require(_0xafb5('0x9'));var sox=require(_0xafb5('0xa'));var csv=require('to-csv');var ejs=require(_0xafb5('0xb'));var fs=require('fs');var _=require(_0xafb5('0xc'));var squel=require(_0xafb5('0xd'));var crypto=require(_0xafb5('0xe'));var jsforce=require(_0xafb5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xafb5('0x10'));var querystring=require(_0xafb5('0x11'));var Papa=require(_0xafb5('0x12'));var Redis=require(_0xafb5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xafb5('0x14'))(_0xafb5('0x15'));var utils=require(_0xafb5('0x16'));var config=require(_0xafb5('0x17'));var db=require(_0xafb5('0x18'))['db'];function respondWithStatusCode(_0x3f3e86,_0x48c3c2){_0x48c3c2=_0x48c3c2||0xcc;return function(_0x4d5bff){if(_0x4d5bff){return _0x3f3e86[_0xafb5('0x19')](_0x48c3c2);}return _0x3f3e86[_0xafb5('0x1a')](_0x48c3c2)['end']();};}function respondWithResult(_0x32c23b,_0x48c566){_0x48c566=_0x48c566||0xc8;return function(_0x3d3c6e){if(_0x3d3c6e){return _0x32c23b[_0xafb5('0x1a')](_0x48c566)[_0xafb5('0x1b')](_0x3d3c6e);}};}function respondWithFilteredResult(_0x17e387,_0x5b3fcf){return function(_0x4ca366){if(_0x4ca366){var _0x3a2b74=_0x4ca366[_0xafb5('0x1c')],_0x12bc3f=_0x5b3fcf['offset'],_0x4bbaef=_0x5b3fcf[_0xafb5('0x1d')]+_0x5b3fcf[_0xafb5('0x1e')],_0xb1f19a;if(_0x4bbaef>=_0x3a2b74){_0x4bbaef=_0x3a2b74;_0xb1f19a=0xc8;}else{_0xb1f19a=0xce;}_0x17e387[_0xafb5('0x1a')](_0xb1f19a);return _0x17e387[_0xafb5('0x1f')](_0xafb5('0x20'),_0x12bc3f+'-'+_0x4bbaef+'/'+_0x3a2b74)['json'](_0x4ca366);}return null;};}function patchUpdates(_0x936741){return function(_0x47a28e){try{jsonpatch[_0xafb5('0x21')](_0x47a28e,_0x936741,!![]);}catch(_0x26b48d){return BPromise[_0xafb5('0x22')](_0x26b48d);}return _0x47a28e[_0xafb5('0x23')]();};}function saveUpdates(_0x230717,_0x59891e){return function(_0x5a4a81){if(_0x5a4a81){return _0x5a4a81[_0xafb5('0x24')](_0x230717)[_0xafb5('0x25')](function(_0x33c961){return _0x33c961;});}return null;};}function removeEntity(_0x4a8f85,_0x26cdb2){return function(_0x46f1fe){if(_0x46f1fe){return _0x46f1fe[_0xafb5('0x26')]()[_0xafb5('0x25')](function(){_0x4a8f85[_0xafb5('0x1a')](0xcc)[_0xafb5('0x27')]();});}};}function handleEntityNotFound(_0x31f53e,_0x53bc3a){return function(_0x54e7e3){if(!_0x54e7e3){_0x31f53e[_0xafb5('0x19')](0x194);}return _0x54e7e3;};}function handleError(_0x4b74ff,_0x255be0){_0x255be0=_0x255be0||0x1f4;return function(_0x26b705){logger[_0xafb5('0x28')](_0x26b705[_0xafb5('0x29')]);if(_0x26b705[_0xafb5('0x2a')]){delete _0x26b705[_0xafb5('0x2a')];}_0x4b74ff[_0xafb5('0x1a')](_0x255be0)[_0xafb5('0x2b')](_0x26b705);};}exports[_0xafb5('0x2c')]=function(_0x490869,_0x1090d6){var _0x3291bc={},_0x31d3b8={},_0x26fc7b={'count':0x0,'rows':[]};var _0x2dd36d=db[_0xafb5('0x2d')][_0xafb5('0x2e')];_0x31d3b8[_0xafb5('0x2f')]=_['keys'](_0x2dd36d);_0x31d3b8[_0xafb5('0x30')]=_[_0xafb5('0x31')](_0x490869[_0xafb5('0x30')]);_0x31d3b8[_0xafb5('0x32')]=_[_0xafb5('0x33')](_0x31d3b8[_0xafb5('0x2f')],_0x31d3b8[_0xafb5('0x30')]);_0x3291bc[_0xafb5('0x34')]=_[_0xafb5('0x33')](_0x31d3b8['model'],qs[_0xafb5('0x35')](_0x490869[_0xafb5('0x30')][_0xafb5('0x35')]));_0x3291bc['attributes']=_0x3291bc[_0xafb5('0x34')][_0xafb5('0x36')]?_0x3291bc[_0xafb5('0x34')]:_0x31d3b8[_0xafb5('0x2f')];if(!_0x490869[_0xafb5('0x30')]['hasOwnProperty'](_0xafb5('0x37'))){_0x3291bc[_0xafb5('0x1e')]=qs[_0xafb5('0x1e')](_0x490869['query'][_0xafb5('0x1e')]);_0x3291bc[_0xafb5('0x1d')]=qs[_0xafb5('0x1d')](_0x490869[_0xafb5('0x30')]['offset']);}_0x3291bc[_0xafb5('0x38')]=qs[_0xafb5('0x39')](_0x490869[_0xafb5('0x30')][_0xafb5('0x39')]);_0x3291bc['where']=qs[_0xafb5('0x32')](_[_0xafb5('0x3a')](_0x490869['query'],_0x31d3b8[_0xafb5('0x32')]));if(_0x490869['query'][_0xafb5('0x3b')]){_0x3291bc[_0xafb5('0x3c')]=_[_0xafb5('0x3d')](_0x3291bc[_0xafb5('0x3c')],{'$or':_['map'](_0x2dd36d,function(_0x369751){if(_0x369751[_0xafb5('0x3e')][_0xafb5('0x3f')]!==_0xafb5('0x40')){var _0x16dce6={};_0x16dce6[_0x369751['field']]={'$like':'%'+_0x490869['query']['filter']+'%'};return _0x16dce6;}})});}_0x3291bc=_[_0xafb5('0x3d')]({},_0x3291bc,_0x490869[_0xafb5('0x41')]);var _0x25f437={'where':_0x3291bc['where']};return db[_0xafb5('0x2d')][_0xafb5('0x1c')](_0x25f437)[_0xafb5('0x25')](function(_0x5f31ef){_0x26fc7b[_0xafb5('0x1c')]=_0x5f31ef;if(_0x490869['query'][_0xafb5('0x42')]){_0x3291bc[_0xafb5('0x43')]=[{'all':!![]}];}return db[_0xafb5('0x2d')]['findAll'](_0x3291bc);})[_0xafb5('0x25')](function(_0x4d4c91){_0x26fc7b[_0xafb5('0x44')]=_0x4d4c91;return _0x26fc7b;})[_0xafb5('0x25')](respondWithFilteredResult(_0x1090d6,_0x3291bc))[_0xafb5('0x45')](handleError(_0x1090d6,null));};exports[_0xafb5('0x46')]=function(_0xd8d6de,_0xcd5557){var _0x56640a={'raw':![],'where':{'id':_0xd8d6de[_0xafb5('0x47')]['id']}},_0x3616ad={};_0x3616ad[_0xafb5('0x2f')]=_[_0xafb5('0x31')](db['AnalyticFieldReport'][_0xafb5('0x2e')]);_0x3616ad['query']=_[_0xafb5('0x31')](_0xd8d6de[_0xafb5('0x30')]);_0x3616ad['filters']=_[_0xafb5('0x33')](_0x3616ad[_0xafb5('0x2f')],_0x3616ad[_0xafb5('0x30')]);_0x56640a[_0xafb5('0x34')]=_[_0xafb5('0x33')](_0x3616ad['model'],qs[_0xafb5('0x35')](_0xd8d6de[_0xafb5('0x30')]['fields']));_0x56640a[_0xafb5('0x34')]=_0x56640a[_0xafb5('0x34')]['length']?_0x56640a['attributes']:_0x3616ad[_0xafb5('0x2f')];if(_0xd8d6de[_0xafb5('0x30')]['includeAll']){_0x56640a[_0xafb5('0x43')]=[{'all':!![]}];}_0x56640a=_[_0xafb5('0x3d')]({},_0x56640a,_0xd8d6de[_0xafb5('0x41')]);return db[_0xafb5('0x2d')][_0xafb5('0x48')](_0x56640a)[_0xafb5('0x25')](handleEntityNotFound(_0xcd5557,null))[_0xafb5('0x25')](respondWithResult(_0xcd5557,null))[_0xafb5('0x45')](handleError(_0xcd5557,null));};exports['create']=function(_0x33a014,_0x31832f){return db['AnalyticFieldReport'][_0xafb5('0x49')](_0x33a014['body'],{})[_0xafb5('0x25')](respondWithResult(_0x31832f,0xc9))[_0xafb5('0x45')](handleError(_0x31832f,null));};exports[_0xafb5('0x4a')]=function(_0x13d962,_0x6acf34){return db[_0xafb5('0x2d')][_0xafb5('0x4a')](_0x13d962[_0xafb5('0x4b')],{'raw':![],'individualHooks':!![]})[_0xafb5('0x25')](respondWithResult(_0x6acf34,0xc9))[_0xafb5('0x45')](handleError(_0x6acf34,null));};exports[_0xafb5('0x24')]=function(_0x2737ec,_0x42bcf3){if(_0x2737ec[_0xafb5('0x4b')]['id']){delete _0x2737ec['body']['id'];}return db[_0xafb5('0x2d')][_0xafb5('0x48')]({'where':{'id':_0x2737ec[_0xafb5('0x47')]['id']}})[_0xafb5('0x25')](handleEntityNotFound(_0x42bcf3,null))[_0xafb5('0x25')](saveUpdates(_0x2737ec[_0xafb5('0x4b')],null))[_0xafb5('0x25')](respondWithResult(_0x42bcf3,null))[_0xafb5('0x45')](handleError(_0x42bcf3,null));};exports['destroy']=function(_0x5eac2c,_0x5c7c30){return db[_0xafb5('0x2d')][_0xafb5('0x48')]({'where':{'id':_0x5eac2c[_0xafb5('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c7c30,null))[_0xafb5('0x25')](removeEntity(_0x5c7c30,null))['catch'](handleError(_0x5c7c30,null));};exports['bulkDestroy']=function(_0x29d42b,_0x547569){return db[_0xafb5('0x2d')][_0xafb5('0x26')]({'where':{'id':_0x29d42b[_0xafb5('0x30')][_0xafb5('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xafb5('0x25')](respondWithResult(_0x547569,0xcc))[_0xafb5('0x45')](handleError(_0x547569,null));};exports['addFields']=function(_0x2e9f92,_0x4b88a1,_0x39ada0){return db[_0xafb5('0x4d')][_0xafb5('0x4e')]({'where':{'id':_0x2e9f92['params']['id']}})[_0xafb5('0x25')](handleEntityNotFound(_0x4b88a1,null))['then'](function(_0x145fb8){if(_0x145fb8){return db[_0xafb5('0x4f')][_0xafb5('0x50')](function(_0x25b429){return db[_0xafb5('0x2d')][_0xafb5('0x26')]({'where':{'CustomReportId':_0x2e9f92[_0xafb5('0x47')]['id']},'transaction':_0x25b429})[_0xafb5('0x25')](function(_0x47360e){var _0x329196=_[_0xafb5('0x51')](_0x2e9f92[_0xafb5('0x4b')],function(_0x1c3f56){delete _0x1c3f56['id'];_0x1c3f56[_0xafb5('0x52')]=_0x2e9f92['params']['id'];return _0x1c3f56;});return db[_0xafb5('0x2d')][_0xafb5('0x4a')](_0x329196,{'transaction':_0x25b429});});})[_0xafb5('0x25')](function(){return db[_0xafb5('0x2d')][_0xafb5('0x53')]({'where':{'CustomReportId':_0x2e9f92[_0xafb5('0x47')]['id']}});});}})['then'](respondWithResult(_0x4b88a1,null))[_0xafb5('0x45')](handleError(_0x4b88a1,null));}; \ No newline at end of file +var _0x059d=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','json','apply','reject','then','error','name','send','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','AnalyticFieldReport','count','includeAll','findAll','rows','catch','params','include','find','create','body','bulkCreate','update','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','request-promise','mustache','path'];(function(_0x1d9505,_0x47bf8b){var _0x1a083f=function(_0x371ef7){while(--_0x371ef7){_0x1d9505['push'](_0x1d9505['shift']());}};_0x1a083f(++_0x47bf8b);}(_0x059d,0x12b));var _0xd059=function(_0x2a9ac3,_0x38e19f){_0x2a9ac3=_0x2a9ac3-0x0;var _0x134261=_0x059d[_0x2a9ac3];return _0x134261;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd059('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd059('0x1'));var rp=require(_0xd059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd059('0x3'));var util=require('util');var path=require(_0xd059('0x4'));var sox=require(_0xd059('0x5'));var csv=require(_0xd059('0x6'));var ejs=require(_0xd059('0x7'));var fs=require('fs');var _=require(_0xd059('0x8'));var squel=require(_0xd059('0x9'));var crypto=require(_0xd059('0xa'));var jsforce=require(_0xd059('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd059('0xc'));var Papa=require(_0xd059('0xd'));var Redis=require(_0xd059('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd059('0xf'));var hardwareService=require(_0xd059('0x10'));var logger=require(_0xd059('0x11'))(_0xd059('0x12'));var utils=require('../../config/utils');var config=require(_0xd059('0x13'));var db=require(_0xd059('0x14'))['db'];function respondWithStatusCode(_0x440147,_0x5b51f7){_0x5b51f7=_0x5b51f7||0xcc;return function(_0x858159){if(_0x858159){return _0x440147[_0xd059('0x15')](_0x5b51f7);}return _0x440147['status'](_0x5b51f7)['end']();};}function respondWithResult(_0x4ca6d7,_0x3c6b8f){_0x3c6b8f=_0x3c6b8f||0xc8;return function(_0x415c1d){if(_0x415c1d){return _0x4ca6d7[_0xd059('0x16')](_0x3c6b8f)['json'](_0x415c1d);}};}function respondWithFilteredResult(_0x18d92f,_0x350c28){return function(_0x58cb73){if(_0x58cb73){var _0x23e096=_0x58cb73['count'],_0x26551a=_0x350c28[_0xd059('0x17')],_0x309d0=_0x350c28['offset']+_0x350c28[_0xd059('0x18')],_0x16c32e;if(_0x309d0>=_0x23e096){_0x309d0=_0x23e096;_0x16c32e=0xc8;}else{_0x16c32e=0xce;}_0x18d92f['status'](_0x16c32e);return _0x18d92f[_0xd059('0x19')]('Content-Range',_0x26551a+'-'+_0x309d0+'/'+_0x23e096)[_0xd059('0x1a')](_0x58cb73);}return null;};}function patchUpdates(_0x140d73){return function(_0x40a16e){try{jsonpatch[_0xd059('0x1b')](_0x40a16e,_0x140d73,!![]);}catch(_0x298eac){return BPromise[_0xd059('0x1c')](_0x298eac);}return _0x40a16e['save']();};}function saveUpdates(_0x5e34b2,_0x3525d1){return function(_0x54b221){if(_0x54b221){return _0x54b221['update'](_0x5e34b2)[_0xd059('0x1d')](function(_0x1247ec){return _0x1247ec;});}return null;};}function removeEntity(_0x5dfbaf,_0x44c956){return function(_0xbf2ada){if(_0xbf2ada){return _0xbf2ada['destroy']()[_0xd059('0x1d')](function(){_0x5dfbaf[_0xd059('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74a25d,_0x42e4a0){return function(_0x11e996){if(!_0x11e996){_0x74a25d[_0xd059('0x15')](0x194);}return _0x11e996;};}function handleError(_0x4ae42b,_0x576f83){_0x576f83=_0x576f83||0x1f4;return function(_0x11e568){logger[_0xd059('0x1e')](_0x11e568['stack']);if(_0x11e568[_0xd059('0x1f')]){delete _0x11e568[_0xd059('0x1f')];}_0x4ae42b[_0xd059('0x16')](_0x576f83)[_0xd059('0x20')](_0x11e568);};}exports[_0xd059('0x21')]=function(_0x3bf31c,_0x36fd79){var _0x7c345b={},_0x5be55b={},_0x924d24={'count':0x0,'rows':[]};var _0x325bd3=db['AnalyticFieldReport'][_0xd059('0x22')];_0x5be55b[_0xd059('0x23')]=_['keys'](_0x325bd3);_0x5be55b[_0xd059('0x24')]=_[_0xd059('0x25')](_0x3bf31c[_0xd059('0x24')]);_0x5be55b[_0xd059('0x26')]=_[_0xd059('0x27')](_0x5be55b[_0xd059('0x23')],_0x5be55b[_0xd059('0x24')]);_0x7c345b['attributes']=_[_0xd059('0x27')](_0x5be55b[_0xd059('0x23')],qs[_0xd059('0x28')](_0x3bf31c['query']['fields']));_0x7c345b[_0xd059('0x29')]=_0x7c345b[_0xd059('0x29')][_0xd059('0x2a')]?_0x7c345b[_0xd059('0x29')]:_0x5be55b[_0xd059('0x23')];if(!_0x3bf31c['query'][_0xd059('0x2b')]('nolimit')){_0x7c345b['limit']=qs[_0xd059('0x18')](_0x3bf31c[_0xd059('0x24')][_0xd059('0x18')]);_0x7c345b['offset']=qs[_0xd059('0x17')](_0x3bf31c[_0xd059('0x24')][_0xd059('0x17')]);}_0x7c345b[_0xd059('0x2c')]=qs['sort'](_0x3bf31c[_0xd059('0x24')][_0xd059('0x2d')]);_0x7c345b['where']=qs[_0xd059('0x26')](_[_0xd059('0x2e')](_0x3bf31c[_0xd059('0x24')],_0x5be55b[_0xd059('0x26')]));if(_0x3bf31c[_0xd059('0x24')]['filter']){_0x7c345b[_0xd059('0x2f')]=_[_0xd059('0x30')](_0x7c345b['where'],{'$or':_[_0xd059('0x31')](_0x325bd3,function(_0x55be5b){if(_0x55be5b[_0xd059('0x32')][_0xd059('0x33')]!==_0xd059('0x34')){var _0x27ed3e={};_0x27ed3e[_0x55be5b[_0xd059('0x35')]]={'$like':'%'+_0x3bf31c[_0xd059('0x24')][_0xd059('0x36')]+'%'};return _0x27ed3e;}})});}_0x7c345b=_[_0xd059('0x30')]({},_0x7c345b,_0x3bf31c[_0xd059('0x37')]);var _0x416011={'where':_0x7c345b['where']};return db[_0xd059('0x38')][_0xd059('0x39')](_0x416011)[_0xd059('0x1d')](function(_0x4e5faa){_0x924d24[_0xd059('0x39')]=_0x4e5faa;if(_0x3bf31c['query'][_0xd059('0x3a')]){_0x7c345b['include']=[{'all':!![]}];}return db[_0xd059('0x38')][_0xd059('0x3b')](_0x7c345b);})[_0xd059('0x1d')](function(_0x1935b3){_0x924d24[_0xd059('0x3c')]=_0x1935b3;return _0x924d24;})[_0xd059('0x1d')](respondWithFilteredResult(_0x36fd79,_0x7c345b))[_0xd059('0x3d')](handleError(_0x36fd79,null));};exports['show']=function(_0x1b5dc9,_0x586828){var _0x3b6640={'raw':![],'where':{'id':_0x1b5dc9[_0xd059('0x3e')]['id']}},_0x37e2bd={};_0x37e2bd[_0xd059('0x23')]=_['keys'](db['AnalyticFieldReport'][_0xd059('0x22')]);_0x37e2bd['query']=_[_0xd059('0x25')](_0x1b5dc9[_0xd059('0x24')]);_0x37e2bd[_0xd059('0x26')]=_['intersection'](_0x37e2bd[_0xd059('0x23')],_0x37e2bd[_0xd059('0x24')]);_0x3b6640[_0xd059('0x29')]=_[_0xd059('0x27')](_0x37e2bd[_0xd059('0x23')],qs[_0xd059('0x28')](_0x1b5dc9[_0xd059('0x24')]['fields']));_0x3b6640[_0xd059('0x29')]=_0x3b6640[_0xd059('0x29')][_0xd059('0x2a')]?_0x3b6640[_0xd059('0x29')]:_0x37e2bd[_0xd059('0x23')];if(_0x1b5dc9[_0xd059('0x24')][_0xd059('0x3a')]){_0x3b6640[_0xd059('0x3f')]=[{'all':!![]}];}_0x3b6640=_[_0xd059('0x30')]({},_0x3b6640,_0x1b5dc9[_0xd059('0x37')]);return db['AnalyticFieldReport'][_0xd059('0x40')](_0x3b6640)['then'](handleEntityNotFound(_0x586828,null))[_0xd059('0x1d')](respondWithResult(_0x586828,null))[_0xd059('0x3d')](handleError(_0x586828,null));};exports[_0xd059('0x41')]=function(_0x159965,_0x9648ea){return db['AnalyticFieldReport']['create'](_0x159965[_0xd059('0x42')],{})['then'](respondWithResult(_0x9648ea,0xc9))[_0xd059('0x3d')](handleError(_0x9648ea,null));};exports[_0xd059('0x43')]=function(_0x38f37a,_0x3fa190){return db[_0xd059('0x38')]['bulkCreate'](_0x38f37a[_0xd059('0x42')],{'raw':![],'individualHooks':!![]})[_0xd059('0x1d')](respondWithResult(_0x3fa190,0xc9))[_0xd059('0x3d')](handleError(_0x3fa190,null));};exports[_0xd059('0x44')]=function(_0x14fc21,_0x619bf){if(_0x14fc21[_0xd059('0x42')]['id']){delete _0x14fc21[_0xd059('0x42')]['id'];}return db['AnalyticFieldReport'][_0xd059('0x40')]({'where':{'id':_0x14fc21[_0xd059('0x3e')]['id']}})[_0xd059('0x1d')](handleEntityNotFound(_0x619bf,null))[_0xd059('0x1d')](saveUpdates(_0x14fc21[_0xd059('0x42')],null))[_0xd059('0x1d')](respondWithResult(_0x619bf,null))['catch'](handleError(_0x619bf,null));};exports[_0xd059('0x45')]=function(_0x37e76e,_0x5e5f72){return db[_0xd059('0x38')][_0xd059('0x40')]({'where':{'id':_0x37e76e[_0xd059('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5e5f72,null))[_0xd059('0x1d')](removeEntity(_0x5e5f72,null))[_0xd059('0x3d')](handleError(_0x5e5f72,null));};exports[_0xd059('0x46')]=function(_0x1eb7b6,_0x256d3e){return db[_0xd059('0x38')][_0xd059('0x45')]({'where':{'id':_0x1eb7b6[_0xd059('0x24')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xd059('0x1d')](respondWithResult(_0x256d3e,0xcc))[_0xd059('0x3d')](handleError(_0x256d3e,null));};exports[_0xd059('0x47')]=function(_0x28d3e3,_0x33b777,_0x3c8786){return db[_0xd059('0x48')][_0xd059('0x49')]({'where':{'id':_0x28d3e3[_0xd059('0x3e')]['id']}})[_0xd059('0x1d')](handleEntityNotFound(_0x33b777,null))[_0xd059('0x1d')](function(_0x575276){if(_0x575276){return db[_0xd059('0x4a')]['transaction'](function(_0xbd7eaf){return db[_0xd059('0x38')]['destroy']({'where':{'CustomReportId':_0x28d3e3[_0xd059('0x3e')]['id']},'transaction':_0xbd7eaf})['then'](function(_0x2dcb41){var _0x1c6bd7=_[_0xd059('0x31')](_0x28d3e3[_0xd059('0x42')],function(_0x40dee0){delete _0x40dee0['id'];_0x40dee0[_0xd059('0x4b')]=_0x28d3e3[_0xd059('0x3e')]['id'];return _0x40dee0;});return db[_0xd059('0x38')][_0xd059('0x43')](_0x1c6bd7,{'transaction':_0xbd7eaf});});})[_0xd059('0x1d')](function(){return db[_0xd059('0x38')][_0xd059('0x3b')]({'where':{'CustomReportId':_0x28d3e3['params']['id']}});});}})['then'](respondWithResult(_0x33b777,null))[_0xd059('0x3d')](handleError(_0x33b777,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9ef9f51..1b0b0b7 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 _0x2967=['exports','define','AnalyticFieldReport','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0xf15be4,_0x2c2591){var _0x2b6849=function(_0x544282){while(--_0x544282){_0xf15be4['push'](_0xf15be4['shift']());}};_0x2b6849(++_0x2c2591);}(_0x2967,0x16b));var _0x7296=function(_0x2d69e1,_0x43f881){_0x2d69e1=_0x2d69e1-0x0;var _0x9b5140=_0x2967[_0x2d69e1];return _0x9b5140;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7296('0x0'))(_0x7296('0x1'));var moment=require('moment');var BPromise=require(_0x7296('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7296('0x3'));var rimraf=require(_0x7296('0x4'));var config=require(_0x7296('0x5'));var attributes=require(_0x7296('0x6'));module[_0x7296('0x7')]=function(_0x5275fc,_0x22562e){return _0x5275fc[_0x7296('0x8')](_0x7296('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9c1=['analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb9c1,0xc1));var _0x1b9c=function(_0x5480e5,_0x1de2f9){_0x5480e5=_0x5480e5-0x0;var _0x5621b9=_0xb9c1[_0x5480e5];return _0x5621b9;};'use strict';var _=require(_0x1b9c('0x0'));var util=require('util');var logger=require(_0x1b9c('0x1'))(_0x1b9c('0x2'));var moment=require(_0x1b9c('0x3'));var BPromise=require(_0x1b9c('0x4'));var rp=require(_0x1b9c('0x5'));var fs=require('fs');var path=require(_0x1b9c('0x6'));var rimraf=require(_0x1b9c('0x7'));var config=require(_0x1b9c('0x8'));var attributes=require(_0x1b9c('0x9'));module['exports']=function(_0x1e5f3a,_0x2a8336){return _0x1e5f3a['define'](_0x1b9c('0xa'),attributes,{'tableName':_0x1b9c('0xb'),'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 66a466c..5d8d3bd 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 _0x307e=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x475dce,_0x1754ff){var _0x40687a=function(_0xdfa78a){while(--_0xdfa78a){_0x475dce['push'](_0x475dce['shift']());}};_0x40687a(++_0x1754ff);}(_0x307e,0xc9));var _0xe307=function(_0x598ac1,_0x44b355){_0x598ac1=_0x598ac1-0x0;var _0x514171=_0x307e[_0x598ac1];return _0x514171;};'use strict';var _=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var moment=require(_0xe307('0x2'));var BPromise=require(_0xe307('0x3'));var rs=require(_0xe307('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe307('0x5'))['db'];var utils=require(_0xe307('0x6'));var logger=require('../../config/logger')(_0xe307('0x7'));var config=require('../../config/environment');var jayson=require(_0xe307('0x8'));var client=jayson[_0xe307('0x9')][_0xe307('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59e5b7,_0x528e79,_0x3645ea){return new BPromise(function(_0x40b840,_0x5598d4){return client[_0xe307('0xb')](_0x59e5b7,_0x3645ea)[_0xe307('0xc')](function(_0x26d257){logger[_0xe307('0xd')](_0xe307('0xe'),_0x528e79,_0xe307('0xf'));logger[_0xe307('0x10')](_0xe307('0x11'),_0x528e79,_0xe307('0xf'),JSON[_0xe307('0x12')](_0x26d257));if(_0x26d257[_0xe307('0x13')]){if(_0x26d257[_0xe307('0x13')][_0xe307('0x14')]===0x1f4){logger[_0xe307('0x13')](_0xe307('0xe'),_0x528e79,_0x26d257[_0xe307('0x13')]['message']);return _0x5598d4(_0x26d257[_0xe307('0x13')][_0xe307('0x15')]);}logger['error'](_0xe307('0xe'),_0x528e79,_0x26d257[_0xe307('0x13')][_0xe307('0x15')]);return _0x40b840(_0x26d257[_0xe307('0x13')][_0xe307('0x15')]);}else{logger[_0xe307('0xd')](_0xe307('0xe'),_0x528e79,'request\x20sent');_0x40b840(_0x26d257[_0xe307('0x16')][_0xe307('0x15')]);}})[_0xe307('0x17')](function(_0x2a48e9){logger[_0xe307('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x528e79,_0x2a48e9);_0x5598d4(_0x2a48e9);});});} \ No newline at end of file +var _0xb091=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x521f44,_0x178b58){var _0x645635=function(_0x48c2dc){while(--_0x48c2dc){_0x521f44['push'](_0x521f44['shift']());}};_0x645635(++_0x178b58);}(_0xb091,0x16e));var _0x1b09=function(_0x9d4fe0,_0x387546){_0x9d4fe0=_0x9d4fe0-0x0;var _0x1090e1=_0xb091[_0x9d4fe0];return _0x1090e1;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 59f5fa0..5bbe8db 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 _0xd64b=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','bulkCreate','addFields','put','update','/destroy_many','bulkDestroy','delete','destroy','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0xd64b,0xc1));var _0xbd64=function(_0x23c3f4,_0x24f0b3){_0x23c3f4=_0x23c3f4-0x0;var _0x82f0f1=_0xd64b[_0x23c3f4];return _0x82f0f1;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var auth=require(_0xbd64('0x4'));var interaction=require(_0xbd64('0x5'));var config=require(_0xbd64('0x6'));var controller=require('./analyticFieldReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbd64('0x7')](_0xbd64('0x8'),auth[_0xbd64('0x9')](),controller[_0xbd64('0xa')]);router[_0xbd64('0xb')]('/',auth[_0xbd64('0x9')](),controller[_0xbd64('0xc')]);router['post']('/create_many',auth[_0xbd64('0x9')](),controller[_0xbd64('0xd')]);router[_0xbd64('0xb')]('/:id/create_many',auth[_0xbd64('0x9')](),controller[_0xbd64('0xe')]);router[_0xbd64('0xf')](_0xbd64('0x8'),auth['isAuthenticated'](),controller[_0xbd64('0x10')]);router['delete'](_0xbd64('0x11'),auth[_0xbd64('0x9')](),controller[_0xbd64('0x12')]);router[_0xbd64('0x13')](_0xbd64('0x8'),auth[_0xbd64('0x9')](),controller[_0xbd64('0x14')]);module[_0xbd64('0x15')]=router; \ No newline at end of file +var _0x5db8=['express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','show','post','bulkCreate','/:id/create_many','/:id','delete','bulkDestroy','destroy','exports','multer','util','path'];(function(_0x562349,_0x25ee3f){var _0x33a802=function(_0x485c8d){while(--_0x485c8d){_0x562349['push'](_0x562349['shift']());}};_0x33a802(++_0x25ee3f);}(_0x5db8,0xbb));var _0x85db=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x5db8[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var auth=require(_0x85db('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x85db('0x6'));router[_0x85db('0x7')]('/',auth[_0x85db('0x8')](),controller[_0x85db('0x9')]);router['get']('/:id',auth[_0x85db('0x8')](),controller[_0x85db('0xa')]);router[_0x85db('0xb')]('/',auth[_0x85db('0x8')](),controller['create']);router[_0x85db('0xb')]('/create_many',auth[_0x85db('0x8')](),controller[_0x85db('0xc')]);router[_0x85db('0xb')](_0x85db('0xd'),auth['isAuthenticated'](),controller['addFields']);router['put'](_0x85db('0xe'),auth[_0x85db('0x8')](),controller['update']);router[_0x85db('0xf')]('/destroy_many',auth[_0x85db('0x8')](),controller[_0x85db('0x10')]);router[_0x85db('0xf')](_0x85db('0xe'),auth[_0x85db('0x8')](),controller[_0x85db('0x11')]);module[_0x85db('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 85e3ccf..8600bcc 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 _0xbcc8=['name','STRING'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0xbcc8,0x79));var _0x8bcc=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0xbcc8[_0x1e17eb];return _0x4de4c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8bcc('0x0')],'allowNull':![],'unique':_0x8bcc('0x1')},'table':{'type':Sequelize[_0x8bcc('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8bcc('0x0')]}}; \ No newline at end of file +var _0x2b78=['name','sequelize','exports','STRING'];(function(_0x49d563,_0x39ee4d){var _0x2e39ed=function(_0x44429b){while(--_0x44429b){_0x49d563['push'](_0x49d563['shift']());}};_0x2e39ed(++_0x39ee4d);}(_0x2b78,0x14d));var _0x82b7=function(_0x131712,_0x2ed068){_0x131712=_0x131712-0x0;var _0x292b97=_0x2b78[_0x131712];return _0x292b97;};'use strict';var Sequelize=require(_0x82b7('0x0'));module[_0x82b7('0x1')]={'name':{'type':Sequelize[_0x82b7('0x2')],'allowNull':![],'unique':_0x82b7('0x3')},'table':{'type':Sequelize[_0x82b7('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x82b7('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index c292ac6..4850f58 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 _0xee4a=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','field','options','includeAll','include','findAll','catch','show','params','find','create','body','user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x4ec590,_0x4be468){var _0x8bdcd2=function(_0x5a91d6){while(--_0x5a91d6){_0x4ec590['push'](_0x4ec590['shift']());}};_0x8bdcd2(++_0x4be468);}(_0xee4a,0xe8));var _0xaee4=function(_0x4baadf,_0x3a36da){_0x4baadf=_0x4baadf-0x0;var _0xe9de1=_0xee4a[_0x4baadf];return _0xe9de1;};'use strict';var pdf=require(_0xaee4('0x0'));var emlformat=require(_0xaee4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaee4('0x2'));var jsonpatch=require(_0xaee4('0x3'));var rp=require(_0xaee4('0x4'));var moment=require(_0xaee4('0x5'));var BPromise=require(_0xaee4('0x6'));var Mustache=require(_0xaee4('0x7'));var util=require(_0xaee4('0x8'));var path=require(_0xaee4('0x9'));var sox=require(_0xaee4('0xa'));var csv=require(_0xaee4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaee4('0xc'));var squel=require('squel');var crypto=require(_0xaee4('0xd'));var jsforce=require(_0xaee4('0xe'));var deskjs=require(_0xaee4('0xf'));var toCsv=require(_0xaee4('0xb'));var querystring=require(_0xaee4('0x10'));var Papa=require('papaparse');var Redis=require(_0xaee4('0x11'));var authService=require(_0xaee4('0x12'));var qs=require(_0xaee4('0x13'));var hardwareService=require(_0xaee4('0x14'));var logger=require(_0xaee4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaee4('0x16'));var db=require(_0xaee4('0x17'))['db'];function respondWithStatusCode(_0x15e941,_0x4bc269){_0x4bc269=_0x4bc269||0xcc;return function(_0x246b78){if(_0x246b78){return _0x15e941['sendStatus'](_0x4bc269);}return _0x15e941['status'](_0x4bc269)[_0xaee4('0x18')]();};}function respondWithResult(_0x5ef732,_0x11c175){_0x11c175=_0x11c175||0xc8;return function(_0x538281){if(_0x538281){return _0x5ef732[_0xaee4('0x19')](_0x11c175)[_0xaee4('0x1a')](_0x538281);}};}function respondWithFilteredResult(_0x59a23f,_0x15e2a5){return function(_0x5c4595){if(_0x5c4595){var _0x26b0e6=_0x5c4595[_0xaee4('0x1b')],_0x4868b0=_0x15e2a5[_0xaee4('0x1c')],_0x518cd8=_0x15e2a5[_0xaee4('0x1c')]+_0x15e2a5[_0xaee4('0x1d')],_0x42ad9d;if(_0x518cd8>=_0x26b0e6){_0x518cd8=_0x26b0e6;_0x42ad9d=0xc8;}else{_0x42ad9d=0xce;}_0x59a23f[_0xaee4('0x19')](_0x42ad9d);return _0x59a23f[_0xaee4('0x1e')](_0xaee4('0x1f'),_0x4868b0+'-'+_0x518cd8+'/'+_0x26b0e6)[_0xaee4('0x1a')](_0x5c4595);}return null;};}function patchUpdates(_0x5a097){return function(_0x6dae48){try{jsonpatch[_0xaee4('0x20')](_0x6dae48,_0x5a097,!![]);}catch(_0x371d4d){return BPromise[_0xaee4('0x21')](_0x371d4d);}return _0x6dae48['save']();};}function saveUpdates(_0x265f65,_0x21277e){return function(_0x2abcc9){if(_0x2abcc9){return _0x2abcc9[_0xaee4('0x22')](_0x265f65)[_0xaee4('0x23')](function(_0x2c8048){return _0x2c8048;});}return null;};}function removeEntity(_0x4e7157,_0x3709df){return function(_0x18306b){if(_0x18306b){return _0x18306b[_0xaee4('0x24')]()['then'](function(){var _0x4b6752=_0x18306b[_0xaee4('0x25')]({'plain':!![]});var _0x19fd29='Metrics';return db[_0xaee4('0x26')][_0xaee4('0x24')]({'where':{'type':_0x19fd29,'resourceId':_0x4b6752['id']}})[_0xaee4('0x23')](function(){return _0x18306b;});})[_0xaee4('0x23')](function(){_0x4e7157['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x140108,_0x54697a){return function(_0x572235){if(!_0x572235){_0x140108[_0xaee4('0x27')](0x194);}return _0x572235;};}function handleError(_0x3c217c,_0x2b7413){_0x2b7413=_0x2b7413||0x1f4;return function(_0x241fab){logger[_0xaee4('0x28')](_0x241fab[_0xaee4('0x29')]);if(_0x241fab['name']){delete _0x241fab[_0xaee4('0x2a')];}_0x3c217c[_0xaee4('0x19')](_0x2b7413)[_0xaee4('0x2b')](_0x241fab);};}exports[_0xaee4('0x2c')]=function(_0x31343b,_0x468cf6){var _0x5b22d5={},_0x31e683={},_0x572295={'count':0x0,'rows':[]};var _0x5856cc=db[_0xaee4('0x2d')][_0xaee4('0x2e')];_0x31e683[_0xaee4('0x2f')]=_['keys'](_0x5856cc);_0x31e683['query']=_[_0xaee4('0x30')](_0x31343b['query']);_0x31e683['filters']=_['intersection'](_0x31e683[_0xaee4('0x2f')],_0x31e683[_0xaee4('0x31')]);_0x5b22d5[_0xaee4('0x32')]=_[_0xaee4('0x33')](_0x31e683[_0xaee4('0x2f')],qs[_0xaee4('0x34')](_0x31343b['query'][_0xaee4('0x34')]));_0x5b22d5[_0xaee4('0x32')]=_0x5b22d5[_0xaee4('0x32')][_0xaee4('0x35')]?_0x5b22d5['attributes']:_0x31e683[_0xaee4('0x2f')];if(!_0x31343b['query'][_0xaee4('0x36')](_0xaee4('0x37'))){_0x5b22d5[_0xaee4('0x1d')]=qs['limit'](_0x31343b['query'][_0xaee4('0x1d')]);_0x5b22d5['offset']=qs[_0xaee4('0x1c')](_0x31343b['query'][_0xaee4('0x1c')]);}_0x5b22d5[_0xaee4('0x38')]=qs[_0xaee4('0x39')](_0x31343b[_0xaee4('0x31')][_0xaee4('0x39')]);_0x5b22d5[_0xaee4('0x3a')]=qs['filters'](_[_0xaee4('0x3b')](_0x31343b[_0xaee4('0x31')],_0x31e683[_0xaee4('0x3c')]));if(_0x31343b[_0xaee4('0x31')][_0xaee4('0x3d')]){_0x5b22d5[_0xaee4('0x3a')]=_[_0xaee4('0x3e')](_0x5b22d5['where'],{'$or':_[_0xaee4('0x3f')](_0x5856cc,function(_0x4f67f0){if(_0x4f67f0[_0xaee4('0x40')]['key']!=='VIRTUAL'){var _0x4f42c3={};_0x4f42c3[_0x4f67f0[_0xaee4('0x41')]]={'$like':'%'+_0x31343b['query'][_0xaee4('0x3d')]+'%'};return _0x4f42c3;}})});}_0x5b22d5=_['merge']({},_0x5b22d5,_0x31343b[_0xaee4('0x42')]);var _0x536ed2={'where':_0x5b22d5[_0xaee4('0x3a')]};return db['AnalyticMetric'][_0xaee4('0x1b')](_0x536ed2)[_0xaee4('0x23')](function(_0x28c747){_0x572295['count']=_0x28c747;if(_0x31343b[_0xaee4('0x31')][_0xaee4('0x43')]){_0x5b22d5[_0xaee4('0x44')]=[{'all':!![]}];}return db[_0xaee4('0x2d')][_0xaee4('0x45')](_0x5b22d5);})['then'](function(_0x2bb6a2){_0x572295['rows']=_0x2bb6a2;return _0x572295;})[_0xaee4('0x23')](respondWithFilteredResult(_0x468cf6,_0x5b22d5))[_0xaee4('0x46')](handleError(_0x468cf6,null));};exports[_0xaee4('0x47')]=function(_0x55a140,_0x40a16d){var _0xba1a45={'raw':!![],'where':{'id':_0x55a140[_0xaee4('0x48')]['id']}},_0x5740d5={};_0x5740d5[_0xaee4('0x2f')]=_[_0xaee4('0x30')](db['AnalyticMetric'][_0xaee4('0x2e')]);_0x5740d5[_0xaee4('0x31')]=_[_0xaee4('0x30')](_0x55a140[_0xaee4('0x31')]);_0x5740d5[_0xaee4('0x3c')]=_[_0xaee4('0x33')](_0x5740d5[_0xaee4('0x2f')],_0x5740d5[_0xaee4('0x31')]);_0xba1a45[_0xaee4('0x32')]=_[_0xaee4('0x33')](_0x5740d5[_0xaee4('0x2f')],qs[_0xaee4('0x34')](_0x55a140[_0xaee4('0x31')][_0xaee4('0x34')]));_0xba1a45[_0xaee4('0x32')]=_0xba1a45[_0xaee4('0x32')][_0xaee4('0x35')]?_0xba1a45[_0xaee4('0x32')]:_0x5740d5['model'];if(_0x55a140[_0xaee4('0x31')][_0xaee4('0x43')]){_0xba1a45[_0xaee4('0x44')]=[{'all':!![]}];}_0xba1a45=_[_0xaee4('0x3e')]({},_0xba1a45,_0x55a140[_0xaee4('0x42')]);return db[_0xaee4('0x2d')][_0xaee4('0x49')](_0xba1a45)[_0xaee4('0x23')](handleEntityNotFound(_0x40a16d,null))[_0xaee4('0x23')](respondWithResult(_0x40a16d,null))[_0xaee4('0x46')](handleError(_0x40a16d,null));};exports['create']=function(_0x5044f6,_0x29c912){return db[_0xaee4('0x2d')][_0xaee4('0x4a')](_0x5044f6[_0xaee4('0x4b')],{})[_0xaee4('0x23')](function(_0x3cdd7d){var _0x22347a=_0x5044f6[_0xaee4('0x4c')][_0xaee4('0x25')]({'plain':!![]});if(!_0x22347a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22347a[_0xaee4('0x4d')]===_0xaee4('0x4c')){var _0x7683c3=_0x3cdd7d[_0xaee4('0x25')]({'plain':!![]});var _0x136d3a=_0xaee4('0x4e');return db[_0xaee4('0x4f')][_0xaee4('0x49')]({'where':{'name':_0x136d3a,'userProfileId':_0x22347a[_0xaee4('0x50')]},'raw':!![]})[_0xaee4('0x23')](function(_0x28831f){if(_0x28831f&&_0x28831f[_0xaee4('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x7683c3[_0xaee4('0x2a')],'resourceId':_0x7683c3['id'],'type':_0x28831f[_0xaee4('0x2a')],'sectionId':_0x28831f['id']},{})[_0xaee4('0x23')](function(){return _0x3cdd7d;});}else{return _0x3cdd7d;}})[_0xaee4('0x46')](function(_0x2468bd){logger['error'](_0xaee4('0x52'),_0x2468bd);throw _0x2468bd;});}return _0x3cdd7d;})[_0xaee4('0x23')](respondWithResult(_0x29c912,0xc9))[_0xaee4('0x46')](handleError(_0x29c912,null));};exports[_0xaee4('0x22')]=function(_0x4448b5,_0x5b30d3){if(_0x4448b5[_0xaee4('0x4b')]['id']){delete _0x4448b5[_0xaee4('0x4b')]['id'];}return db[_0xaee4('0x2d')][_0xaee4('0x49')]({'where':{'id':_0x4448b5['params']['id']}})[_0xaee4('0x23')](handleEntityNotFound(_0x5b30d3,null))[_0xaee4('0x23')](saveUpdates(_0x4448b5['body'],null))['then'](respondWithResult(_0x5b30d3,null))[_0xaee4('0x46')](handleError(_0x5b30d3,null));};exports[_0xaee4('0x24')]=function(_0x1a371b,_0x25475c){return db[_0xaee4('0x2d')][_0xaee4('0x49')]({'where':{'id':_0x1a371b[_0xaee4('0x48')]['id']}})[_0xaee4('0x23')](handleEntityNotFound(_0x25475c,null))[_0xaee4('0x23')](removeEntity(_0x25475c,null))[_0xaee4('0x46')](handleError(_0x25475c,null));}; \ No newline at end of file +var _0x36c8=['include','rows','catch','show','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','Metrics','end','error','name','send','index','AnalyticMetric','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x2d8ea1,_0x492cab){var _0x1785aa=function(_0x1a8f31){while(--_0x1a8f31){_0x2d8ea1['push'](_0x2d8ea1['shift']());}};_0x1785aa(++_0x492cab);}(_0x36c8,0xf0));var _0x836c=function(_0x268c6d,_0x4684ae){_0x268c6d=_0x268c6d-0x0;var _0x2060c6=_0x36c8[_0x268c6d];return _0x2060c6;};'use strict';var pdf=require(_0x836c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x836c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x836c('0x2'));var rp=require(_0x836c('0x3'));var moment=require(_0x836c('0x4'));var BPromise=require(_0x836c('0x5'));var Mustache=require(_0x836c('0x6'));var util=require(_0x836c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x836c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x836c('0x9'));var squel=require('squel');var crypto=require(_0x836c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x836c('0xb'));var toCsv=require(_0x836c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x836c('0xc'));var authService=require(_0x836c('0xd'));var qs=require(_0x836c('0xe'));var hardwareService=require(_0x836c('0xf'));var logger=require(_0x836c('0x10'))('api');var utils=require(_0x836c('0x11'));var config=require(_0x836c('0x12'));var db=require(_0x836c('0x13'))['db'];function respondWithStatusCode(_0x313186,_0x197bb5){_0x197bb5=_0x197bb5||0xcc;return function(_0x5d502f){if(_0x5d502f){return _0x313186[_0x836c('0x14')](_0x197bb5);}return _0x313186[_0x836c('0x15')](_0x197bb5)['end']();};}function respondWithResult(_0x19b04c,_0x1674a6){_0x1674a6=_0x1674a6||0xc8;return function(_0x228334){if(_0x228334){return _0x19b04c[_0x836c('0x15')](_0x1674a6)[_0x836c('0x16')](_0x228334);}};}function respondWithFilteredResult(_0x1ecf1f,_0x2552cc){return function(_0x63da4){if(_0x63da4){var _0x658343=_0x63da4[_0x836c('0x17')],_0x26e41a=_0x2552cc[_0x836c('0x18')],_0x3e78ac=_0x2552cc[_0x836c('0x18')]+_0x2552cc[_0x836c('0x19')],_0x86cd9d;if(_0x3e78ac>=_0x658343){_0x3e78ac=_0x658343;_0x86cd9d=0xc8;}else{_0x86cd9d=0xce;}_0x1ecf1f[_0x836c('0x15')](_0x86cd9d);return _0x1ecf1f[_0x836c('0x1a')](_0x836c('0x1b'),_0x26e41a+'-'+_0x3e78ac+'/'+_0x658343)['json'](_0x63da4);}return null;};}function patchUpdates(_0x104bb4){return function(_0x441e78){try{jsonpatch[_0x836c('0x1c')](_0x441e78,_0x104bb4,!![]);}catch(_0x4fac95){return BPromise[_0x836c('0x1d')](_0x4fac95);}return _0x441e78['save']();};}function saveUpdates(_0x249879,_0x4985ac){return function(_0x379fe7){if(_0x379fe7){return _0x379fe7[_0x836c('0x1e')](_0x249879)[_0x836c('0x1f')](function(_0x4fc873){return _0x4fc873;});}return null;};}function removeEntity(_0x3fd3ee,_0xd1766c){return function(_0x165937){if(_0x165937){return _0x165937[_0x836c('0x20')]()[_0x836c('0x1f')](function(){var _0x58adbc=_0x165937['get']({'plain':!![]});var _0x23f2e7=_0x836c('0x21');return db['UserProfileResource'][_0x836c('0x20')]({'where':{'type':_0x23f2e7,'resourceId':_0x58adbc['id']}})['then'](function(){return _0x165937;});})[_0x836c('0x1f')](function(){_0x3fd3ee[_0x836c('0x15')](0xcc)[_0x836c('0x22')]();});}};}function handleEntityNotFound(_0x366bc8,_0x5bf872){return function(_0x5d985a){if(!_0x5d985a){_0x366bc8[_0x836c('0x14')](0x194);}return _0x5d985a;};}function handleError(_0x418587,_0x4ac849){_0x4ac849=_0x4ac849||0x1f4;return function(_0x4ef07c){logger[_0x836c('0x23')](_0x4ef07c['stack']);if(_0x4ef07c[_0x836c('0x24')]){delete _0x4ef07c[_0x836c('0x24')];}_0x418587['status'](_0x4ac849)[_0x836c('0x25')](_0x4ef07c);};}exports[_0x836c('0x26')]=function(_0x182a8a,_0x4d2736){var _0x549abc={},_0x30ddc2={},_0x38109e={'count':0x0,'rows':[]};var _0x56c001=db[_0x836c('0x27')][_0x836c('0x28')];_0x30ddc2['model']=_[_0x836c('0x29')](_0x56c001);_0x30ddc2[_0x836c('0x2a')]=_[_0x836c('0x29')](_0x182a8a[_0x836c('0x2a')]);_0x30ddc2['filters']=_[_0x836c('0x2b')](_0x30ddc2[_0x836c('0x2c')],_0x30ddc2['query']);_0x549abc[_0x836c('0x2d')]=_[_0x836c('0x2b')](_0x30ddc2[_0x836c('0x2c')],qs['fields'](_0x182a8a['query'][_0x836c('0x2e')]));_0x549abc['attributes']=_0x549abc['attributes']['length']?_0x549abc[_0x836c('0x2d')]:_0x30ddc2[_0x836c('0x2c')];if(!_0x182a8a['query'][_0x836c('0x2f')](_0x836c('0x30'))){_0x549abc[_0x836c('0x19')]=qs[_0x836c('0x19')](_0x182a8a['query']['limit']);_0x549abc[_0x836c('0x18')]=qs[_0x836c('0x18')](_0x182a8a[_0x836c('0x2a')]['offset']);}_0x549abc[_0x836c('0x31')]=qs[_0x836c('0x32')](_0x182a8a[_0x836c('0x2a')][_0x836c('0x32')]);_0x549abc[_0x836c('0x33')]=qs[_0x836c('0x34')](_[_0x836c('0x35')](_0x182a8a[_0x836c('0x2a')],_0x30ddc2[_0x836c('0x34')]));if(_0x182a8a['query'][_0x836c('0x36')]){_0x549abc['where']=_[_0x836c('0x37')](_0x549abc[_0x836c('0x33')],{'$or':_[_0x836c('0x38')](_0x56c001,function(_0x4cd3a9){if(_0x4cd3a9['type']['key']!==_0x836c('0x39')){var _0x3d12d2={};_0x3d12d2[_0x4cd3a9['field']]={'$like':'%'+_0x182a8a[_0x836c('0x2a')][_0x836c('0x36')]+'%'};return _0x3d12d2;}})});}_0x549abc=_[_0x836c('0x37')]({},_0x549abc,_0x182a8a[_0x836c('0x3a')]);var _0x2abcc9={'where':_0x549abc['where']};return db[_0x836c('0x27')]['count'](_0x2abcc9)[_0x836c('0x1f')](function(_0x17aeb2){_0x38109e[_0x836c('0x17')]=_0x17aeb2;if(_0x182a8a[_0x836c('0x2a')][_0x836c('0x3b')]){_0x549abc[_0x836c('0x3c')]=[{'all':!![]}];}return db[_0x836c('0x27')]['findAll'](_0x549abc);})[_0x836c('0x1f')](function(_0x2f7a36){_0x38109e[_0x836c('0x3d')]=_0x2f7a36;return _0x38109e;})[_0x836c('0x1f')](respondWithFilteredResult(_0x4d2736,_0x549abc))[_0x836c('0x3e')](handleError(_0x4d2736,null));};exports[_0x836c('0x3f')]=function(_0x526f2c,_0x28fc11){var _0x3a9cb9={'raw':!![],'where':{'id':_0x526f2c[_0x836c('0x40')]['id']}},_0xbb9ed1={};_0xbb9ed1[_0x836c('0x2c')]=_[_0x836c('0x29')](db['AnalyticMetric'][_0x836c('0x28')]);_0xbb9ed1[_0x836c('0x2a')]=_[_0x836c('0x29')](_0x526f2c['query']);_0xbb9ed1[_0x836c('0x34')]=_['intersection'](_0xbb9ed1[_0x836c('0x2c')],_0xbb9ed1[_0x836c('0x2a')]);_0x3a9cb9['attributes']=_['intersection'](_0xbb9ed1[_0x836c('0x2c')],qs['fields'](_0x526f2c[_0x836c('0x2a')]['fields']));_0x3a9cb9['attributes']=_0x3a9cb9['attributes'][_0x836c('0x41')]?_0x3a9cb9[_0x836c('0x2d')]:_0xbb9ed1[_0x836c('0x2c')];if(_0x526f2c['query'][_0x836c('0x3b')]){_0x3a9cb9['include']=[{'all':!![]}];}_0x3a9cb9=_['merge']({},_0x3a9cb9,_0x526f2c[_0x836c('0x3a')]);return db[_0x836c('0x27')][_0x836c('0x42')](_0x3a9cb9)[_0x836c('0x1f')](handleEntityNotFound(_0x28fc11,null))['then'](respondWithResult(_0x28fc11,null))['catch'](handleError(_0x28fc11,null));};exports[_0x836c('0x43')]=function(_0x4c5fc0,_0x34da53){return db[_0x836c('0x27')][_0x836c('0x43')](_0x4c5fc0['body'],{})[_0x836c('0x1f')](function(_0x3ff207){var _0x3ccbad=_0x4c5fc0[_0x836c('0x44')][_0x836c('0x45')]({'plain':!![]});if(!_0x3ccbad)throw new Error(_0x836c('0x46'));if(_0x3ccbad['role']===_0x836c('0x44')){var _0x18e429=_0x3ff207[_0x836c('0x45')]({'plain':!![]});var _0x4c14ec='Metrics';return db[_0x836c('0x47')]['find']({'where':{'name':_0x4c14ec,'userProfileId':_0x3ccbad[_0x836c('0x48')]},'raw':!![]})[_0x836c('0x1f')](function(_0xb996d1){if(_0xb996d1&&_0xb996d1['autoAssociation']===0x0){return db[_0x836c('0x49')][_0x836c('0x43')]({'name':_0x18e429[_0x836c('0x24')],'resourceId':_0x18e429['id'],'type':_0xb996d1[_0x836c('0x24')],'sectionId':_0xb996d1['id']},{})[_0x836c('0x1f')](function(){return _0x3ff207;});}else{return _0x3ff207;}})[_0x836c('0x3e')](function(_0x277dff){logger[_0x836c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x277dff);throw _0x277dff;});}return _0x3ff207;})[_0x836c('0x1f')](respondWithResult(_0x34da53,0xc9))[_0x836c('0x3e')](handleError(_0x34da53,null));};exports[_0x836c('0x1e')]=function(_0x5e4828,_0x21b670){if(_0x5e4828[_0x836c('0x4a')]['id']){delete _0x5e4828['body']['id'];}return db[_0x836c('0x27')][_0x836c('0x42')]({'where':{'id':_0x5e4828[_0x836c('0x40')]['id']}})[_0x836c('0x1f')](handleEntityNotFound(_0x21b670,null))[_0x836c('0x1f')](saveUpdates(_0x5e4828[_0x836c('0x4a')],null))['then'](respondWithResult(_0x21b670,null))[_0x836c('0x3e')](handleError(_0x21b670,null));};exports[_0x836c('0x20')]=function(_0x357cf1,_0x10c552){return db['AnalyticMetric'][_0x836c('0x42')]({'where':{'id':_0x357cf1['params']['id']}})[_0x836c('0x1f')](handleEntityNotFound(_0x10c552,null))[_0x836c('0x1f')](removeEntity(_0x10c552,null))[_0x836c('0x3e')](handleError(_0x10c552,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 274b5fc..31ed273 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 _0x894b=['request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','moment'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0x894b,0x104));var _0xb894=function(_0x3edf4a,_0x3159e1){_0x3edf4a=_0x3edf4a-0x0;var _0x4242a9=_0x894b[_0x3edf4a];return _0x4242a9;};'use strict';var _=require(_0xb894('0x0'));var util=require(_0xb894('0x1'));var logger=require(_0xb894('0x2'))('api');var moment=require(_0xb894('0x3'));var BPromise=require('bluebird');var rp=require(_0xb894('0x4'));var fs=require('fs');var path=require(_0xb894('0x5'));var rimraf=require(_0xb894('0x6'));var config=require('../../config/environment');var attributes=require(_0xb894('0x7'));module[_0xb894('0x8')]=function(_0x4e8b5b,_0x3227ab){return _0x4e8b5b[_0xb894('0x9')](_0xb894('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1303=['util','../../config/logger','moment','bluebird','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1303,0x117));var _0x3130=function(_0x35a6f8,_0x2a19d0){_0x35a6f8=_0x35a6f8-0x0;var _0x11d2da=_0x1303[_0x35a6f8];return _0x11d2da;};'use strict';var _=require(_0x3130('0x0'));var util=require(_0x3130('0x1'));var logger=require(_0x3130('0x2'))('api');var moment=require(_0x3130('0x3'));var BPromise=require(_0x3130('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3130('0x5'));var config=require('../../config/environment');var attributes=require(_0x3130('0x6'));module['exports']=function(_0x20feb8,_0x4c2dd9){return _0x20feb8[_0x3130('0x7')](_0x3130('0x8'),attributes,{'tableName':_0x3130('0x9'),'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 7018350..fb14a82 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 _0x7a08=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0x7a08,0x11e));var _0x87a0=function(_0x57d867,_0x2ee50b){_0x57d867=_0x57d867-0x0;var _0x33d270=_0x7a08[_0x57d867];return _0x33d270;};'use strict';var _=require(_0x87a0('0x0'));var util=require(_0x87a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x87a0('0x2'));var fs=require('fs');var Redis=require(_0x87a0('0x3'));var db=require(_0x87a0('0x4'))['db'];var utils=require(_0x87a0('0x5'));var logger=require(_0x87a0('0x6'))(_0x87a0('0x7'));var config=require(_0x87a0('0x8'));var jayson=require(_0x87a0('0x9'));var client=jayson[_0x87a0('0xa')][_0x87a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xde806e,_0x584442,_0x27736f){return new BPromise(function(_0x1bb04b,_0x18185c){return client[_0x87a0('0xc')](_0xde806e,_0x27736f)[_0x87a0('0xd')](function(_0x515301){logger['info'](_0x87a0('0xe'),_0x584442,_0x87a0('0xf'));logger[_0x87a0('0x10')](_0x87a0('0x11'),_0x584442,_0x87a0('0xf'),JSON['stringify'](_0x515301));if(_0x515301[_0x87a0('0x12')]){if(_0x515301[_0x87a0('0x12')][_0x87a0('0x13')]===0x1f4){logger['error'](_0x87a0('0xe'),_0x584442,_0x515301[_0x87a0('0x12')][_0x87a0('0x14')]);return _0x18185c(_0x515301[_0x87a0('0x12')]['message']);}logger[_0x87a0('0x12')](_0x87a0('0xe'),_0x584442,_0x515301[_0x87a0('0x12')]['message']);return _0x1bb04b(_0x515301[_0x87a0('0x12')][_0x87a0('0x14')]);}else{logger[_0x87a0('0x15')](_0x87a0('0xe'),_0x584442,'request\x20sent');_0x1bb04b(_0x515301[_0x87a0('0x16')]['message']);}})[_0x87a0('0x17')](function(_0x410490){logger[_0x87a0('0x12')](_0x87a0('0xe'),_0x584442,_0x410490);_0x18185c(_0x410490);});});} \ No newline at end of file +var _0x6ff1=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xdc1244,_0x4b2996){var _0x49a32f=function(_0x560d63){while(--_0x560d63){_0xdc1244['push'](_0xdc1244['shift']());}};_0x49a32f(++_0x4b2996);}(_0x6ff1,0x10a));var _0x16ff=function(_0x207659,_0x27d07c){_0x207659=_0x207659-0x0;var _0x53250a=_0x6ff1[_0x207659];return _0x53250a;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var moment=require(_0x16ff('0x2'));var BPromise=require(_0x16ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x16ff('0x5'))(_0x16ff('0x6'));var config=require(_0x16ff('0x7'));var jayson=require(_0x16ff('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x560612,_0x4e6fbf,_0x133612){return new BPromise(function(_0x218c28,_0x3b368c){return client[_0x16ff('0x9')](_0x560612,_0x133612)[_0x16ff('0xa')](function(_0xc1a41){logger[_0x16ff('0xb')](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));logger[_0x16ff('0xe')](_0x16ff('0xf'),_0x4e6fbf,_0x16ff('0xd'),JSON[_0x16ff('0x10')](_0xc1a41));if(_0xc1a41[_0x16ff('0x11')]){if(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x12')]===0x1f4){logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x3b368c(_0xc1a41['error']['message']);}logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x218c28(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);}else{logger['info'](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));_0x218c28(_0xc1a41[_0x16ff('0x14')]['message']);}})[_0x16ff('0x15')](function(_0x43b519){logger[_0x16ff('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4e6fbf,_0x43b519);_0x3b368c(_0x43b519);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 2bed550..582eb12 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 _0x36ee=['./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5bc138,_0x3b2050){var _0x58c7a3=function(_0x446a74){while(--_0x446a74){_0x5bc138['push'](_0x5bc138['shift']());}};_0x58c7a3(++_0x3b2050);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')]('/',auth[_0xe36e('0x8')](),controller[_0xe36e('0x9')]);router[_0xe36e('0x7')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller['show']);router[_0xe36e('0xb')]('/',auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router[_0xe36e('0xd')](_0xe36e('0xa'),auth['isAuthenticated'](),controller[_0xe36e('0xe')]);router['delete'](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller[_0xe36e('0xf')]);module[_0xe36e('0x10')]=router; \ No newline at end of file +var _0x955f=['path','connect-timeout','express','../../components/auth/service','./analyticMetric.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x955f,0x1eb));var _0xf955=function(_0x5e9402,_0x3df7a3){_0x5e9402=_0x5e9402-0x0;var _0x3fc0d1=_0x955f[_0x5e9402];return _0x3fc0d1;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var auth=require(_0xf955('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf955('0x6'));router['get']('/',auth[_0xf955('0x7')](),controller[_0xf955('0x8')]);router[_0xf955('0x9')]('/:id',auth[_0xf955('0x7')](),controller[_0xf955('0xa')]);router['post']('/',auth[_0xf955('0x7')](),controller[_0xf955('0xb')]);router[_0xf955('0xc')](_0xf955('0xd'),auth[_0xf955('0x7')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/:id',auth[_0xf955('0x7')](),controller['destroy']);module[_0xf955('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5d070a0..5694551 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 _0xe3de=['exports','TEXT','sequelize'];(function(_0x305f09,_0x1f8401){var _0x58020c=function(_0x39abf5){while(--_0x39abf5){_0x305f09['push'](_0x305f09['shift']());}};_0x58020c(++_0x1f8401);}(_0xe3de,0xc5));var _0xee3d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe3de[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xee3d('0x0'));module[_0xee3d('0x1')]={'tree':{'type':Sequelize[_0xee3d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6a24=['TEXT','sequelize','exports'];(function(_0x1a80bb,_0x1efe24){var _0x22898b=function(_0x29a4ee){while(--_0x29a4ee){_0x1a80bb['push'](_0x1a80bb['shift']());}};_0x22898b(++_0x1efe24);}(_0x6a24,0xca));var _0x46a2=function(_0x40c7b9,_0x4145c1){_0x40c7b9=_0x40c7b9-0x0;var _0xe787b6=_0x6a24[_0x40c7b9];return _0xe787b6;};'use strict';var Sequelize=require(_0x46a2('0x0'));module[_0x46a2('0x1')]={'tree':{'type':Sequelize[_0x46a2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 437df48..234c646 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 _0x78b0=['ejs','squel','jsforce','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x4ad669,_0x4915e0){var _0x2c433b=function(_0x2130bd){while(--_0x2130bd){_0x4ad669['push'](_0x4ad669['shift']());}};_0x2c433b(++_0x4915e0);}(_0x78b0,0x78));var _0x078b=function(_0x1c52ab,_0x1a3462){_0x1c52ab=_0x1c52ab-0x0;var _0x129bcb=_0x78b0[_0x1c52ab];return _0x129bcb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x078b('0x0'));var rimraf=require(_0x078b('0x1'));var zipdir=require(_0x078b('0x2'));var jsonpatch=require(_0x078b('0x3'));var rp=require(_0x078b('0x4'));var moment=require(_0x078b('0x5'));var BPromise=require(_0x078b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x078b('0x7'));var sox=require(_0x078b('0x8'));var csv=require(_0x078b('0x9'));var ejs=require(_0x078b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x078b('0xb'));var crypto=require('crypto');var jsforce=require(_0x078b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x078b('0x9'));var querystring=require('querystring');var Papa=require(_0x078b('0xd'));var Redis=require(_0x078b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x078b('0xf'));var logger=require(_0x078b('0x10'))(_0x078b('0x11'));var utils=require(_0x078b('0x12'));var config=require(_0x078b('0x13'));var db=require(_0x078b('0x14'))['db'];function respondWithStatusCode(_0x1b8a28,_0x408668){_0x408668=_0x408668||0xcc;return function(_0x2de474){if(_0x2de474){return _0x1b8a28[_0x078b('0x15')](_0x408668);}return _0x1b8a28[_0x078b('0x16')](_0x408668)[_0x078b('0x17')]();};}function respondWithResult(_0x52d5d5,_0x153bec){_0x153bec=_0x153bec||0xc8;return function(_0x317d2c){if(_0x317d2c){return _0x52d5d5['status'](_0x153bec)[_0x078b('0x18')](_0x317d2c);}};}function respondWithFilteredResult(_0x5c410c,_0x551f8d){return function(_0x23d034){if(_0x23d034){var _0x28b18d=_0x23d034['count'],_0x1e7b7e=_0x551f8d[_0x078b('0x19')],_0x175ebb=_0x551f8d[_0x078b('0x19')]+_0x551f8d[_0x078b('0x1a')],_0x206eec;if(_0x175ebb>=_0x28b18d){_0x175ebb=_0x28b18d;_0x206eec=0xc8;}else{_0x206eec=0xce;}_0x5c410c['status'](_0x206eec);return _0x5c410c[_0x078b('0x1b')](_0x078b('0x1c'),_0x1e7b7e+'-'+_0x175ebb+'/'+_0x28b18d)[_0x078b('0x18')](_0x23d034);}return null;};}function patchUpdates(_0x179f89){return function(_0x1f5d1d){try{jsonpatch['apply'](_0x1f5d1d,_0x179f89,!![]);}catch(_0x144b54){return BPromise['reject'](_0x144b54);}return _0x1f5d1d[_0x078b('0x1d')]();};}function saveUpdates(_0xa32e40,_0x450e72){return function(_0xa09277){if(_0xa09277){return _0xa09277[_0x078b('0x1e')](_0xa32e40)[_0x078b('0x1f')](function(_0x506891){return _0x506891;});}return null;};}function removeEntity(_0x272324,_0x1d9398){return function(_0x415b28){if(_0x415b28){return _0x415b28[_0x078b('0x20')]()[_0x078b('0x1f')](function(){_0x272324[_0x078b('0x16')](0xcc)[_0x078b('0x17')]();});}};}function handleEntityNotFound(_0xc20ab7,_0x9e1de9){return function(_0x2ce106){if(!_0x2ce106){_0xc20ab7[_0x078b('0x15')](0x194);}return _0x2ce106;};}function handleError(_0x48f0c1,_0x2483b5){_0x2483b5=_0x2483b5||0x1f4;return function(_0x330bfa){logger['error'](_0x330bfa['stack']);if(_0x330bfa[_0x078b('0x21')]){delete _0x330bfa['name'];}_0x48f0c1[_0x078b('0x16')](_0x2483b5)[_0x078b('0x22')](_0x330bfa);};}exports[_0x078b('0x23')]=function(_0x215036,_0xd7d483){var _0x112fba={},_0x40c28b={},_0x3bf805={'count':0x0,'rows':[]};var _0x341865=db[_0x078b('0x24')][_0x078b('0x25')];_0x40c28b[_0x078b('0x26')]=_['keys'](_0x341865);_0x40c28b['query']=_[_0x078b('0x27')](_0x215036[_0x078b('0x28')]);_0x40c28b[_0x078b('0x29')]=_[_0x078b('0x2a')](_0x40c28b['model'],_0x40c28b['query']);_0x112fba['attributes']=_[_0x078b('0x2a')](_0x40c28b[_0x078b('0x26')],qs[_0x078b('0x2b')](_0x215036[_0x078b('0x28')]['fields']));_0x112fba['attributes']=_0x112fba[_0x078b('0x2c')][_0x078b('0x2d')]?_0x112fba['attributes']:_0x40c28b['model'];if(!_0x215036[_0x078b('0x28')][_0x078b('0x2e')](_0x078b('0x2f'))){_0x112fba[_0x078b('0x1a')]=qs[_0x078b('0x1a')](_0x215036['query'][_0x078b('0x1a')]);_0x112fba[_0x078b('0x19')]=qs[_0x078b('0x19')](_0x215036[_0x078b('0x28')][_0x078b('0x19')]);}_0x112fba['order']=qs[_0x078b('0x30')](_0x215036[_0x078b('0x28')][_0x078b('0x30')]);_0x112fba[_0x078b('0x31')]=qs[_0x078b('0x29')](_['pick'](_0x215036[_0x078b('0x28')],_0x40c28b['filters']));if(_0x215036[_0x078b('0x28')][_0x078b('0x32')]){_0x112fba[_0x078b('0x31')]=_['merge'](_0x112fba[_0x078b('0x31')],{'$or':_['map'](_0x341865,function(_0x393d82){if(_0x393d82[_0x078b('0x33')]['key']!==_0x078b('0x34')){var _0x44bc32={};_0x44bc32[_0x393d82['field']]={'$like':'%'+_0x215036['query']['filter']+'%'};return _0x44bc32;}})});}_0x112fba=_[_0x078b('0x35')]({},_0x112fba,_0x215036[_0x078b('0x36')]);var _0x5e4deb={'where':_0x112fba['where']};return db['AnalyticTreeReport'][_0x078b('0x37')](_0x5e4deb)[_0x078b('0x1f')](function(_0x5d3e4a){_0x3bf805[_0x078b('0x37')]=_0x5d3e4a;if(_0x215036[_0x078b('0x28')][_0x078b('0x38')]){_0x112fba[_0x078b('0x39')]=[{'all':!![]}];}return db[_0x078b('0x24')][_0x078b('0x3a')](_0x112fba);})['then'](function(_0x360742){_0x3bf805['rows']=_0x360742;return _0x3bf805;})[_0x078b('0x1f')](respondWithFilteredResult(_0xd7d483,_0x112fba))[_0x078b('0x3b')](handleError(_0xd7d483,null));};exports[_0x078b('0x3c')]=function(_0x546a90,_0x927f5a){var _0x4c4ed9={'raw':!![],'where':{'id':_0x546a90[_0x078b('0x3d')]['id']}},_0xc6d964={};_0xc6d964['model']=_[_0x078b('0x27')](db[_0x078b('0x24')][_0x078b('0x25')]);_0xc6d964[_0x078b('0x28')]=_[_0x078b('0x27')](_0x546a90[_0x078b('0x28')]);_0xc6d964[_0x078b('0x29')]=_[_0x078b('0x2a')](_0xc6d964['model'],_0xc6d964[_0x078b('0x28')]);_0x4c4ed9[_0x078b('0x2c')]=_[_0x078b('0x2a')](_0xc6d964[_0x078b('0x26')],qs[_0x078b('0x2b')](_0x546a90[_0x078b('0x28')][_0x078b('0x2b')]));_0x4c4ed9[_0x078b('0x2c')]=_0x4c4ed9[_0x078b('0x2c')]['length']?_0x4c4ed9[_0x078b('0x2c')]:_0xc6d964['model'];if(_0x546a90[_0x078b('0x28')][_0x078b('0x38')]){_0x4c4ed9[_0x078b('0x39')]=[{'all':!![]}];}_0x4c4ed9=_[_0x078b('0x35')]({},_0x4c4ed9,_0x546a90['options']);return db[_0x078b('0x24')]['find'](_0x4c4ed9)[_0x078b('0x1f')](handleEntityNotFound(_0x927f5a,null))[_0x078b('0x1f')](respondWithResult(_0x927f5a,null))[_0x078b('0x3b')](handleError(_0x927f5a,null));};exports[_0x078b('0x3e')]=function(_0x4b40f9,_0x42ea41){return db[_0x078b('0x24')][_0x078b('0x3e')](_0x4b40f9[_0x078b('0x3f')],{})[_0x078b('0x1f')](respondWithResult(_0x42ea41,0xc9))[_0x078b('0x3b')](handleError(_0x42ea41,null));};exports['update']=function(_0x58c261,_0x31b212){if(_0x58c261['body']['id']){delete _0x58c261[_0x078b('0x3f')]['id'];}return db[_0x078b('0x24')]['find']({'where':{'id':_0x58c261[_0x078b('0x3d')]['id']}})[_0x078b('0x1f')](handleEntityNotFound(_0x31b212,null))[_0x078b('0x1f')](saveUpdates(_0x58c261[_0x078b('0x3f')],null))[_0x078b('0x1f')](respondWithResult(_0x31b212,null))[_0x078b('0x3b')](handleError(_0x31b212,null));};exports[_0x078b('0x20')]=function(_0x2adece,_0x4137e4){return db[_0x078b('0x24')][_0x078b('0x40')]({'where':{'id':_0x2adece[_0x078b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4137e4,null))[_0x078b('0x1f')](removeEntity(_0x4137e4,null))[_0x078b('0x3b')](handleError(_0x4137e4,null));}; \ No newline at end of file +var _0x77c1=['set','Content-Range','reject','save','update','then','destroy','error','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','includeAll','include','findAll','rows','catch','show','params','options','body','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x77c1,0x141));var _0x177c=function(_0x5960e5,_0x3c4252){_0x5960e5=_0x5960e5-0x0;var _0x172b83=_0x77c1[_0x5960e5];return _0x172b83;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x177c('0x0'));var rimraf=require(_0x177c('0x1'));var zipdir=require(_0x177c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x177c('0x3'));var Mustache=require('mustache');var util=require(_0x177c('0x4'));var path=require(_0x177c('0x5'));var sox=require(_0x177c('0x6'));var csv=require('to-csv');var ejs=require(_0x177c('0x7'));var fs=require('fs');var _=require(_0x177c('0x8'));var squel=require('squel');var crypto=require(_0x177c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x177c('0xa'));var toCsv=require(_0x177c('0xb'));var querystring=require(_0x177c('0xc'));var Papa=require(_0x177c('0xd'));var Redis=require(_0x177c('0xe'));var authService=require(_0x177c('0xf'));var qs=require(_0x177c('0x10'));var hardwareService=require(_0x177c('0x11'));var logger=require(_0x177c('0x12'))(_0x177c('0x13'));var utils=require('../../config/utils');var config=require(_0x177c('0x14'));var db=require(_0x177c('0x15'))['db'];function respondWithStatusCode(_0x33eadb,_0x1aa9a3){_0x1aa9a3=_0x1aa9a3||0xcc;return function(_0x4e46c5){if(_0x4e46c5){return _0x33eadb[_0x177c('0x16')](_0x1aa9a3);}return _0x33eadb[_0x177c('0x17')](_0x1aa9a3)[_0x177c('0x18')]();};}function respondWithResult(_0x54fc94,_0x3fa8b3){_0x3fa8b3=_0x3fa8b3||0xc8;return function(_0x26d1ad){if(_0x26d1ad){return _0x54fc94['status'](_0x3fa8b3)[_0x177c('0x19')](_0x26d1ad);}};}function respondWithFilteredResult(_0x15c5e2,_0x191a87){return function(_0xc78484){if(_0xc78484){var _0xe50580=_0xc78484[_0x177c('0x1a')],_0x39987b=_0x191a87[_0x177c('0x1b')],_0x3ac610=_0x191a87[_0x177c('0x1b')]+_0x191a87[_0x177c('0x1c')],_0x3de77c;if(_0x3ac610>=_0xe50580){_0x3ac610=_0xe50580;_0x3de77c=0xc8;}else{_0x3de77c=0xce;}_0x15c5e2['status'](_0x3de77c);return _0x15c5e2[_0x177c('0x1d')](_0x177c('0x1e'),_0x39987b+'-'+_0x3ac610+'/'+_0xe50580)[_0x177c('0x19')](_0xc78484);}return null;};}function patchUpdates(_0x5db09f){return function(_0x28ab47){try{jsonpatch['apply'](_0x28ab47,_0x5db09f,!![]);}catch(_0x4d62b4){return BPromise[_0x177c('0x1f')](_0x4d62b4);}return _0x28ab47[_0x177c('0x20')]();};}function saveUpdates(_0x4db4cf,_0x49fcaa){return function(_0xba17c6){if(_0xba17c6){return _0xba17c6[_0x177c('0x21')](_0x4db4cf)[_0x177c('0x22')](function(_0x4c5398){return _0x4c5398;});}return null;};}function removeEntity(_0x285e03,_0xbd94f){return function(_0x3dc7f1){if(_0x3dc7f1){return _0x3dc7f1[_0x177c('0x23')]()['then'](function(){_0x285e03[_0x177c('0x17')](0xcc)[_0x177c('0x18')]();});}};}function handleEntityNotFound(_0x4f6b9f,_0x1852d3){return function(_0x53d45e){if(!_0x53d45e){_0x4f6b9f[_0x177c('0x16')](0x194);}return _0x53d45e;};}function handleError(_0x49b271,_0x400f1b){_0x400f1b=_0x400f1b||0x1f4;return function(_0xff899){logger[_0x177c('0x24')](_0xff899['stack']);if(_0xff899[_0x177c('0x25')]){delete _0xff899[_0x177c('0x25')];}_0x49b271[_0x177c('0x17')](_0x400f1b)[_0x177c('0x26')](_0xff899);};}exports[_0x177c('0x27')]=function(_0x4d24d0,_0x2bf82b){var _0x30db98={},_0x254a2a={},_0x7f59f3={'count':0x0,'rows':[]};var _0x1d9517=db[_0x177c('0x28')][_0x177c('0x29')];_0x254a2a[_0x177c('0x2a')]=_['keys'](_0x1d9517);_0x254a2a['query']=_[_0x177c('0x2b')](_0x4d24d0['query']);_0x254a2a[_0x177c('0x2c')]=_['intersection'](_0x254a2a[_0x177c('0x2a')],_0x254a2a['query']);_0x30db98['attributes']=_[_0x177c('0x2d')](_0x254a2a[_0x177c('0x2a')],qs[_0x177c('0x2e')](_0x4d24d0[_0x177c('0x2f')][_0x177c('0x2e')]));_0x30db98[_0x177c('0x30')]=_0x30db98[_0x177c('0x30')][_0x177c('0x31')]?_0x30db98[_0x177c('0x30')]:_0x254a2a[_0x177c('0x2a')];if(!_0x4d24d0[_0x177c('0x2f')][_0x177c('0x32')](_0x177c('0x33'))){_0x30db98[_0x177c('0x1c')]=qs[_0x177c('0x1c')](_0x4d24d0[_0x177c('0x2f')]['limit']);_0x30db98['offset']=qs[_0x177c('0x1b')](_0x4d24d0[_0x177c('0x2f')][_0x177c('0x1b')]);}_0x30db98[_0x177c('0x34')]=qs[_0x177c('0x35')](_0x4d24d0[_0x177c('0x2f')][_0x177c('0x35')]);_0x30db98[_0x177c('0x36')]=qs[_0x177c('0x2c')](_['pick'](_0x4d24d0[_0x177c('0x2f')],_0x254a2a[_0x177c('0x2c')]));if(_0x4d24d0[_0x177c('0x2f')][_0x177c('0x37')]){_0x30db98['where']=_[_0x177c('0x38')](_0x30db98['where'],{'$or':_[_0x177c('0x39')](_0x1d9517,function(_0x5e36fb){if(_0x5e36fb[_0x177c('0x3a')][_0x177c('0x3b')]!=='VIRTUAL'){var _0xc36921={};_0xc36921[_0x5e36fb[_0x177c('0x3c')]]={'$like':'%'+_0x4d24d0[_0x177c('0x2f')]['filter']+'%'};return _0xc36921;}})});}_0x30db98=_[_0x177c('0x38')]({},_0x30db98,_0x4d24d0['options']);var _0x24bb2b={'where':_0x30db98[_0x177c('0x36')]};return db['AnalyticTreeReport'][_0x177c('0x1a')](_0x24bb2b)['then'](function(_0x2979cc){_0x7f59f3[_0x177c('0x1a')]=_0x2979cc;if(_0x4d24d0['query'][_0x177c('0x3d')]){_0x30db98[_0x177c('0x3e')]=[{'all':!![]}];}return db[_0x177c('0x28')][_0x177c('0x3f')](_0x30db98);})['then'](function(_0x24f30f){_0x7f59f3[_0x177c('0x40')]=_0x24f30f;return _0x7f59f3;})[_0x177c('0x22')](respondWithFilteredResult(_0x2bf82b,_0x30db98))[_0x177c('0x41')](handleError(_0x2bf82b,null));};exports[_0x177c('0x42')]=function(_0x2d9c8e,_0x3350f0){var _0x40e476={'raw':!![],'where':{'id':_0x2d9c8e[_0x177c('0x43')]['id']}},_0x2dd3cf={};_0x2dd3cf['model']=_[_0x177c('0x2b')](db['AnalyticTreeReport'][_0x177c('0x29')]);_0x2dd3cf[_0x177c('0x2f')]=_[_0x177c('0x2b')](_0x2d9c8e['query']);_0x2dd3cf[_0x177c('0x2c')]=_[_0x177c('0x2d')](_0x2dd3cf[_0x177c('0x2a')],_0x2dd3cf[_0x177c('0x2f')]);_0x40e476[_0x177c('0x30')]=_['intersection'](_0x2dd3cf[_0x177c('0x2a')],qs['fields'](_0x2d9c8e[_0x177c('0x2f')][_0x177c('0x2e')]));_0x40e476['attributes']=_0x40e476[_0x177c('0x30')][_0x177c('0x31')]?_0x40e476['attributes']:_0x2dd3cf[_0x177c('0x2a')];if(_0x2d9c8e['query'][_0x177c('0x3d')]){_0x40e476[_0x177c('0x3e')]=[{'all':!![]}];}_0x40e476=_[_0x177c('0x38')]({},_0x40e476,_0x2d9c8e[_0x177c('0x44')]);return db['AnalyticTreeReport']['find'](_0x40e476)[_0x177c('0x22')](handleEntityNotFound(_0x3350f0,null))['then'](respondWithResult(_0x3350f0,null))[_0x177c('0x41')](handleError(_0x3350f0,null));};exports['create']=function(_0x281443,_0x3b3140){return db[_0x177c('0x28')]['create'](_0x281443[_0x177c('0x45')],{})[_0x177c('0x22')](respondWithResult(_0x3b3140,0xc9))[_0x177c('0x41')](handleError(_0x3b3140,null));};exports['update']=function(_0x1024f9,_0x15367b){if(_0x1024f9[_0x177c('0x45')]['id']){delete _0x1024f9['body']['id'];}return db[_0x177c('0x28')]['find']({'where':{'id':_0x1024f9[_0x177c('0x43')]['id']}})[_0x177c('0x22')](handleEntityNotFound(_0x15367b,null))[_0x177c('0x22')](saveUpdates(_0x1024f9[_0x177c('0x45')],null))[_0x177c('0x22')](respondWithResult(_0x15367b,null))['catch'](handleError(_0x15367b,null));};exports[_0x177c('0x23')]=function(_0x4fcf2e,_0x67c79b){return db[_0x177c('0x28')]['find']({'where':{'id':_0x4fcf2e['params']['id']}})[_0x177c('0x22')](handleEntityNotFound(_0x67c79b,null))[_0x177c('0x22')](removeEntity(_0x67c79b,null))['catch'](handleError(_0x67c79b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 57ae385..c5d9240 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 _0x1a9d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x484bf4,_0x2b975c){var _0x31c683=function(_0x1cdda2){while(--_0x1cdda2){_0x484bf4['push'](_0x484bf4['shift']());}};_0x31c683(++_0x2b975c);}(_0x1a9d,0xfe));var _0xd1a9=function(_0x467385,_0x5cd46d){_0x467385=_0x467385-0x0;var _0x3839ca=_0x1a9d[_0x467385];return _0x3839ca;};'use strict';var _=require(_0xd1a9('0x0'));var util=require(_0xd1a9('0x1'));var logger=require(_0xd1a9('0x2'))(_0xd1a9('0x3'));var moment=require(_0xd1a9('0x4'));var BPromise=require(_0xd1a9('0x5'));var rp=require(_0xd1a9('0x6'));var fs=require('fs');var path=require(_0xd1a9('0x7'));var rimraf=require(_0xd1a9('0x8'));var config=require(_0xd1a9('0x9'));var attributes=require(_0xd1a9('0xa'));module[_0xd1a9('0xb')]=function(_0x44e6d9,_0x4fd590){return _0x44e6d9[_0xd1a9('0xc')](_0xd1a9('0xd'),attributes,{'tableName':_0xd1a9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0df3=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x12a041,_0x4f0380){var _0x25cb3=function(_0x225abf){while(--_0x225abf){_0x12a041['push'](_0x12a041['shift']());}};_0x25cb3(++_0x4f0380);}(_0x0df3,0x79));var _0x30df=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x0df3[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0x30df('0x0'));var util=require('util');var logger=require(_0x30df('0x1'))(_0x30df('0x2'));var moment=require(_0x30df('0x3'));var BPromise=require(_0x30df('0x4'));var rp=require(_0x30df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30df('0x6'));var config=require(_0x30df('0x7'));var attributes=require(_0x30df('0x8'));module[_0x30df('0x9')]=function(_0x5cca0c,_0x8abbc0){return _0x5cca0c[_0x30df('0xa')](_0x30df('0xb'),attributes,{'tableName':_0x30df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 9a372d4..7f9ab48 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 _0xee6c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x31b6c7,_0x1235ea){var _0x3588b3=function(_0x33b779){while(--_0x33b779){_0x31b6c7['push'](_0x31b6c7['shift']());}};_0x3588b3(++_0x1235ea);}(_0xee6c,0x1c7));var _0xcee6=function(_0x5a4814,_0x4aef4f){_0x5a4814=_0x5a4814-0x0;var _0x405eda=_0xee6c[_0x5a4814];return _0x405eda;};'use strict';var _=require(_0xcee6('0x0'));var util=require(_0xcee6('0x1'));var moment=require(_0xcee6('0x2'));var BPromise=require('bluebird');var rs=require(_0xcee6('0x3'));var fs=require('fs');var Redis=require(_0xcee6('0x4'));var db=require(_0xcee6('0x5'))['db'];var utils=require(_0xcee6('0x6'));var logger=require(_0xcee6('0x7'))('rpc');var config=require(_0xcee6('0x8'));var jayson=require(_0xcee6('0x9'));var client=jayson[_0xcee6('0xa')][_0xcee6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32ac22,_0xd04848,_0x5f0748){return new BPromise(function(_0x14100f,_0x3584cc){return client[_0xcee6('0xc')](_0x32ac22,_0x5f0748)[_0xcee6('0xd')](function(_0xf6a4cc){logger[_0xcee6('0xe')](_0xcee6('0xf'),_0xd04848,_0xcee6('0x10'));logger[_0xcee6('0x11')](_0xcee6('0x12'),_0xd04848,_0xcee6('0x10'),JSON['stringify'](_0xf6a4cc));if(_0xf6a4cc['error']){if(_0xf6a4cc[_0xcee6('0x13')][_0xcee6('0x14')]===0x1f4){logger[_0xcee6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0xd04848,_0xf6a4cc[_0xcee6('0x13')][_0xcee6('0x15')]);return _0x3584cc(_0xf6a4cc[_0xcee6('0x13')][_0xcee6('0x15')]);}logger['error'](_0xcee6('0xf'),_0xd04848,_0xf6a4cc['error'][_0xcee6('0x15')]);return _0x14100f(_0xf6a4cc['error'][_0xcee6('0x15')]);}else{logger[_0xcee6('0xe')](_0xcee6('0xf'),_0xd04848,'request\x20sent');_0x14100f(_0xf6a4cc[_0xcee6('0x16')][_0xcee6('0x15')]);}})['catch'](function(_0x3a020b){logger[_0xcee6('0x13')](_0xcee6('0xf'),_0xd04848,_0x3a020b);_0x3584cc(_0x3a020b);});});} \ No newline at end of file +var _0x4280=['catch','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4037e6,_0x3175e3){var _0x2f1643=function(_0x2aefb0){while(--_0x2aefb0){_0x4037e6['push'](_0x4037e6['shift']());}};_0x2f1643(++_0x3175e3);}(_0x4280,0x1ef));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0428('0x0'));var util=require(_0x0428('0x1'));var moment=require(_0x0428('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0428('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0428('0x4'));var config=require(_0x0428('0x5'));var jayson=require(_0x0428('0x6'));var client=jayson[_0x0428('0x7')][_0x0428('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56cec3,_0x12a1d4,_0x2e536f){return new BPromise(function(_0x441172,_0xa1ec56){return client['request'](_0x56cec3,_0x2e536f)['then'](function(_0x5c1088){logger[_0x0428('0x9')](_0x0428('0xa'),_0x12a1d4,_0x0428('0xb'));logger[_0x0428('0xc')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x12a1d4,_0x0428('0xb'),JSON[_0x0428('0xd')](_0x5c1088));if(_0x5c1088[_0x0428('0xe')]){if(_0x5c1088[_0x0428('0xe')][_0x0428('0xf')]===0x1f4){logger[_0x0428('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x12a1d4,_0x5c1088[_0x0428('0xe')][_0x0428('0x10')]);return _0xa1ec56(_0x5c1088['error'][_0x0428('0x10')]);}logger[_0x0428('0xe')](_0x0428('0xa'),_0x12a1d4,_0x5c1088[_0x0428('0xe')][_0x0428('0x10')]);return _0x441172(_0x5c1088['error']['message']);}else{logger[_0x0428('0x9')](_0x0428('0xa'),_0x12a1d4,_0x0428('0xb'));_0x441172(_0x5c1088[_0x0428('0x11')]['message']);}})[_0x0428('0x12')](function(_0x53947c){logger[_0x0428('0xe')](_0x0428('0xa'),_0x12a1d4,_0x53947c);_0xa1ec56(_0x53947c);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c240626..fe1e794 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 _0xdef4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','destroy','multer','util','path'];(function(_0x1686ea,_0x186c0e){var _0x34b18d=function(_0x9710ed){while(--_0x9710ed){_0x1686ea['push'](_0x1686ea['shift']());}};_0x34b18d(++_0x186c0e);}(_0xdef4,0x15d));var _0x4def=function(_0x590649,_0x28f93d){_0x590649=_0x590649-0x0;var _0x4e1806=_0xdef4[_0x590649];return _0x4e1806;};'use strict';var multer=require(_0x4def('0x0'));var util=require(_0x4def('0x1'));var path=require(_0x4def('0x2'));var timeout=require(_0x4def('0x3'));var express=require(_0x4def('0x4'));var router=express['Router']();var auth=require(_0x4def('0x5'));var interaction=require(_0x4def('0x6'));var config=require(_0x4def('0x7'));var controller=require(_0x4def('0x8'));router['get']('/',auth[_0x4def('0x9')](),controller[_0x4def('0xa')]);router['get'](_0x4def('0xb'),auth[_0x4def('0x9')](),controller[_0x4def('0xc')]);router[_0x4def('0xd')]('/',auth['isAuthenticated'](),controller[_0x4def('0xe')]);router['put'](_0x4def('0xb'),auth[_0x4def('0x9')](),controller['update']);router['delete'](_0x4def('0xb'),auth[_0x4def('0x9')](),controller[_0x4def('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbd1b=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd1b,0x1b6));var _0xbbd1=function(_0x48a931,_0x216546){_0x48a931=_0x48a931-0x0;var _0x2952f3=_0xbd1b[_0x48a931];return _0x2952f3;};'use strict';var multer=require(_0xbbd1('0x0'));var util=require(_0xbbd1('0x1'));var path=require(_0xbbd1('0x2'));var timeout=require(_0xbbd1('0x3'));var express=require('express');var router=express[_0xbbd1('0x4')]();var auth=require(_0xbbd1('0x5'));var interaction=require(_0xbbd1('0x6'));var config=require(_0xbbd1('0x7'));var controller=require(_0xbbd1('0x8'));router[_0xbbd1('0x9')]('/',auth['isAuthenticated'](),controller[_0xbbd1('0xa')]);router[_0xbbd1('0x9')](_0xbbd1('0xb'),auth[_0xbbd1('0xc')](),controller[_0xbbd1('0xd')]);router[_0xbbd1('0xe')]('/',auth[_0xbbd1('0xc')](),controller['create']);router[_0xbbd1('0xf')](_0xbbd1('0xb'),auth['isAuthenticated'](),controller[_0xbbd1('0x10')]);router['delete'](_0xbbd1('0xb'),auth[_0xbbd1('0xc')](),controller[_0xbbd1('0x11')]);module[_0xbbd1('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e80225c..344804a 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 _0xeb9e=['exports','STRING'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xeb9e,0xe2));var _0xeeb9=function(_0x35a5cd,_0x497d7b){_0x35a5cd=_0x35a5cd-0x0;var _0x5e1c9c=_0xeb9e[_0x35a5cd];return _0x5e1c9c;};'use strict';var Sequelize=require('sequelize');module[_0xeeb9('0x0')]={'name':{'type':Sequelize[_0xeeb9('0x1')]},'basename':{'type':Sequelize[_0xeeb9('0x1')]},'type':{'type':Sequelize[_0xeeb9('0x1')]}}; \ No newline at end of file +var _0x2c20=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c20,0x1cd));var _0x02c2=function(_0x5ee790,_0x4cd4e3){_0x5ee790=_0x5ee790-0x0;var _0x124f0e=_0x2c20[_0x5ee790];return _0x124f0e;};'use strict';var Sequelize=require('sequelize');module[_0x02c2('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x02c2('0x1')]},'type':{'type':Sequelize[_0x02c2('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 4798326..38a3b22 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 _0x5377=['update','body','params','create','originalname','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','key','field','options','Attachment','count','includeAll','findAll','rows','catch','show','rawAttributes','include','find'];(function(_0x5e26e8,_0x98e66){var _0x49256e=function(_0x1c61c5){while(--_0x1c61c5){_0x5e26e8['push'](_0x5e26e8['shift']());}};_0x49256e(++_0x98e66);}(_0x5377,0x19e));var _0x7537=function(_0x7183ab,_0x4459ae){_0x7183ab=_0x7183ab-0x0;var _0x2b4b8f=_0x5377[_0x7183ab];return _0x2b4b8f;};'use strict';var pdf=require(_0x7537('0x0'));var emlformat=require(_0x7537('0x1'));var rimraf=require(_0x7537('0x2'));var zipdir=require(_0x7537('0x3'));var jsonpatch=require(_0x7537('0x4'));var rp=require(_0x7537('0x5'));var moment=require('moment');var BPromise=require(_0x7537('0x6'));var Mustache=require('mustache');var util=require(_0x7537('0x7'));var path=require(_0x7537('0x8'));var sox=require('sox');var csv=require(_0x7537('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7537('0xa'));var crypto=require(_0x7537('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7537('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7537('0xd'));var Papa=require(_0x7537('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7537('0xf'));var hardwareService=require(_0x7537('0x10'));var logger=require(_0x7537('0x11'))(_0x7537('0x12'));var utils=require(_0x7537('0x13'));var config=require(_0x7537('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37fc60,_0x3449ee){_0x3449ee=_0x3449ee||0xcc;return function(_0x487df7){if(_0x487df7){return _0x37fc60[_0x7537('0x15')](_0x3449ee);}return _0x37fc60[_0x7537('0x16')](_0x3449ee)[_0x7537('0x17')]();};}function respondWithResult(_0xcbd60e,_0x16c953){_0x16c953=_0x16c953||0xc8;return function(_0x3843d3){if(_0x3843d3){return _0xcbd60e[_0x7537('0x16')](_0x16c953)[_0x7537('0x18')](_0x3843d3);}};}function respondWithFilteredResult(_0x1f1639,_0x57a0c4){return function(_0x4dc3d5){if(_0x4dc3d5){var _0x21001a=_0x4dc3d5['count'],_0x45eab5=_0x57a0c4[_0x7537('0x19')],_0x4631aa=_0x57a0c4['offset']+_0x57a0c4[_0x7537('0x1a')],_0x3e97c8;if(_0x4631aa>=_0x21001a){_0x4631aa=_0x21001a;_0x3e97c8=0xc8;}else{_0x3e97c8=0xce;}_0x1f1639['status'](_0x3e97c8);return _0x1f1639[_0x7537('0x1b')](_0x7537('0x1c'),_0x45eab5+'-'+_0x4631aa+'/'+_0x21001a)['json'](_0x4dc3d5);}return null;};}function patchUpdates(_0x1f1328){return function(_0x2c7e30){try{jsonpatch[_0x7537('0x1d')](_0x2c7e30,_0x1f1328,!![]);}catch(_0x5c29ae){return BPromise[_0x7537('0x1e')](_0x5c29ae);}return _0x2c7e30[_0x7537('0x1f')]();};}function saveUpdates(_0xe96acf,_0x444615){return function(_0x38f69f){if(_0x38f69f){return _0x38f69f['update'](_0xe96acf)[_0x7537('0x20')](function(_0x61788f){return _0x61788f;});}return null;};}function removeEntity(_0x2e23d6,_0x3c264b){return function(_0x415b0c){if(_0x415b0c){return _0x415b0c['destroy']()['then'](function(){_0x2e23d6[_0x7537('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417919,_0xf849ac){return function(_0x214a37){if(!_0x214a37){_0x417919['sendStatus'](0x194);}return _0x214a37;};}function handleError(_0x3deb30,_0x2101c5){_0x2101c5=_0x2101c5||0x1f4;return function(_0x438597){logger[_0x7537('0x21')](_0x438597[_0x7537('0x22')]);if(_0x438597['name']){delete _0x438597[_0x7537('0x23')];}_0x3deb30[_0x7537('0x16')](_0x2101c5)[_0x7537('0x24')](_0x438597);};}exports[_0x7537('0x25')]=function(_0x5dbe29,_0x33299f){var _0xc7c951={},_0x5044ea={},_0x4b55b8={'count':0x0,'rows':[]};var _0x47ba5f=db['Attachment']['rawAttributes'];_0x5044ea['model']=_['keys'](_0x47ba5f);_0x5044ea[_0x7537('0x26')]=_[_0x7537('0x27')](_0x5dbe29['query']);_0x5044ea['filters']=_[_0x7537('0x28')](_0x5044ea[_0x7537('0x29')],_0x5044ea['query']);_0xc7c951[_0x7537('0x2a')]=_['intersection'](_0x5044ea['model'],qs[_0x7537('0x2b')](_0x5dbe29[_0x7537('0x26')][_0x7537('0x2b')]));_0xc7c951['attributes']=_0xc7c951[_0x7537('0x2a')][_0x7537('0x2c')]?_0xc7c951[_0x7537('0x2a')]:_0x5044ea['model'];if(!_0x5dbe29[_0x7537('0x26')][_0x7537('0x2d')](_0x7537('0x2e'))){_0xc7c951['limit']=qs[_0x7537('0x1a')](_0x5dbe29[_0x7537('0x26')][_0x7537('0x1a')]);_0xc7c951[_0x7537('0x19')]=qs[_0x7537('0x19')](_0x5dbe29[_0x7537('0x26')][_0x7537('0x19')]);}_0xc7c951['order']=qs[_0x7537('0x2f')](_0x5dbe29['query'][_0x7537('0x2f')]);_0xc7c951[_0x7537('0x30')]=qs[_0x7537('0x31')](_[_0x7537('0x32')](_0x5dbe29[_0x7537('0x26')],_0x5044ea[_0x7537('0x31')]));if(_0x5dbe29[_0x7537('0x26')]['filter']){_0xc7c951[_0x7537('0x30')]=_[_0x7537('0x33')](_0xc7c951[_0x7537('0x30')],{'$or':_['map'](_0x47ba5f,function(_0x3e2455){if(_0x3e2455[_0x7537('0x34')][_0x7537('0x35')]!=='VIRTUAL'){var _0x574ecd={};_0x574ecd[_0x3e2455[_0x7537('0x36')]]={'$like':'%'+_0x5dbe29['query']['filter']+'%'};return _0x574ecd;}})});}_0xc7c951=_[_0x7537('0x33')]({},_0xc7c951,_0x5dbe29[_0x7537('0x37')]);var _0x5ab701={'where':_0xc7c951['where']};return db[_0x7537('0x38')][_0x7537('0x39')](_0x5ab701)[_0x7537('0x20')](function(_0x597c7d){_0x4b55b8[_0x7537('0x39')]=_0x597c7d;if(_0x5dbe29[_0x7537('0x26')][_0x7537('0x3a')]){_0xc7c951['include']=[{'all':!![]}];}return db[_0x7537('0x38')][_0x7537('0x3b')](_0xc7c951);})[_0x7537('0x20')](function(_0x4a9a2c){_0x4b55b8[_0x7537('0x3c')]=_0x4a9a2c;return _0x4b55b8;})[_0x7537('0x20')](respondWithFilteredResult(_0x33299f,_0xc7c951))[_0x7537('0x3d')](handleError(_0x33299f,null));};exports[_0x7537('0x3e')]=function(_0x3c5347,_0x23bff9){var _0x41e0e6={'raw':!![],'where':{'id':_0x3c5347['params']['id']}},_0x411e6a={};_0x411e6a[_0x7537('0x29')]=_['keys'](db[_0x7537('0x38')][_0x7537('0x3f')]);_0x411e6a['query']=_[_0x7537('0x27')](_0x3c5347[_0x7537('0x26')]);_0x411e6a[_0x7537('0x31')]=_[_0x7537('0x28')](_0x411e6a[_0x7537('0x29')],_0x411e6a[_0x7537('0x26')]);_0x41e0e6[_0x7537('0x2a')]=_['intersection'](_0x411e6a[_0x7537('0x29')],qs[_0x7537('0x2b')](_0x3c5347['query'][_0x7537('0x2b')]));_0x41e0e6[_0x7537('0x2a')]=_0x41e0e6[_0x7537('0x2a')][_0x7537('0x2c')]?_0x41e0e6[_0x7537('0x2a')]:_0x411e6a['model'];if(_0x3c5347[_0x7537('0x26')]['includeAll']){_0x41e0e6[_0x7537('0x40')]=[{'all':!![]}];}_0x41e0e6=_[_0x7537('0x33')]({},_0x41e0e6,_0x3c5347['options']);return db[_0x7537('0x38')][_0x7537('0x41')](_0x41e0e6)[_0x7537('0x20')](handleEntityNotFound(_0x23bff9,null))[_0x7537('0x20')](respondWithResult(_0x23bff9,null))[_0x7537('0x3d')](handleError(_0x23bff9,null));};exports[_0x7537('0x42')]=function(_0x22da27,_0x25d0c3){if(_0x22da27[_0x7537('0x43')]['id']){delete _0x22da27[_0x7537('0x43')]['id'];}return db[_0x7537('0x38')][_0x7537('0x41')]({'where':{'id':_0x22da27[_0x7537('0x44')]['id']}})[_0x7537('0x20')](handleEntityNotFound(_0x25d0c3,null))[_0x7537('0x20')](saveUpdates(_0x22da27[_0x7537('0x43')],null))[_0x7537('0x20')](respondWithResult(_0x25d0c3,null))['catch'](handleError(_0x25d0c3,null));};exports['destroy']=function(_0x2ce599,_0x47547f){return db['Attachment']['find']({'where':{'id':_0x2ce599[_0x7537('0x44')]['id']}})[_0x7537('0x20')](handleEntityNotFound(_0x47547f,null))[_0x7537('0x20')](removeEntity(_0x47547f,null))[_0x7537('0x3d')](handleError(_0x47547f,null));};exports[_0x7537('0x45')]=function(_0x205a47,_0x5c8717,_0x4167c8){_0x205a47[_0x7537('0x43')][_0x7537('0x23')]=_0x205a47['file'][_0x7537('0x46')];_0x205a47['body']['basename']=_0x205a47[_0x7537('0x47')][_0x7537('0x48')];_0x205a47['body'][_0x7537('0x34')]=_0x205a47[_0x7537('0x47')][_0x7537('0x49')];return db[_0x7537('0x38')][_0x7537('0x45')](_0x205a47['body'])['then'](respondWithResult(_0x5c8717,0xc9))[_0x7537('0x3d')](handleError(_0x5c8717,null));};exports[_0x7537('0x4a')]=function(_0x48d590,_0x140e8a,_0x2d8ee2){return db[_0x7537('0x38')][_0x7537('0x4b')]({'where':{'id':_0x48d590[_0x7537('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x140e8a,null))[_0x7537('0x20')](function(_0x533118){if(_0x533118){return _0x140e8a[_0x7537('0x4a')](path[_0x7537('0x4c')](config[_0x7537('0x4d')],_0x7537('0x4e'),_0x533118[_0x7537('0x4f')]));}})[_0x7537('0x3d')](handleError(_0x140e8a,null));}; \ No newline at end of file +var _0x429e=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','Attachment','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','map','type','field','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','file','originalname','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x429e,0x17e));var _0xe429=function(_0x1aa864,_0xc3fb36){_0x1aa864=_0x1aa864-0x0;var _0x2f01d5=_0x429e[_0x1aa864];return _0x2f01d5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe429('0x0'));var rimraf=require(_0xe429('0x1'));var zipdir=require(_0xe429('0x2'));var jsonpatch=require(_0xe429('0x3'));var rp=require(_0xe429('0x4'));var moment=require(_0xe429('0x5'));var BPromise=require(_0xe429('0x6'));var Mustache=require(_0xe429('0x7'));var util=require(_0xe429('0x8'));var path=require(_0xe429('0x9'));var sox=require(_0xe429('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe429('0xb'));var squel=require('squel');var crypto=require(_0xe429('0xc'));var jsforce=require(_0xe429('0xd'));var deskjs=require(_0xe429('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe429('0xf'));var Papa=require(_0xe429('0x10'));var Redis=require(_0xe429('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe429('0x12'));var hardwareService=require(_0xe429('0x13'));var logger=require(_0xe429('0x14'))(_0xe429('0x15'));var utils=require(_0xe429('0x16'));var config=require(_0xe429('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d819,_0x2ba68f){_0x2ba68f=_0x2ba68f||0xcc;return function(_0x4b4b7f){if(_0x4b4b7f){return _0x20d819[_0xe429('0x18')](_0x2ba68f);}return _0x20d819[_0xe429('0x19')](_0x2ba68f)['end']();};}function respondWithResult(_0x4a5798,_0x5445d0){_0x5445d0=_0x5445d0||0xc8;return function(_0x5b9d11){if(_0x5b9d11){return _0x4a5798[_0xe429('0x19')](_0x5445d0)['json'](_0x5b9d11);}};}function respondWithFilteredResult(_0x35d8e6,_0x167aca){return function(_0x171d98){if(_0x171d98){var _0x18e822=_0x171d98[_0xe429('0x1a')],_0x5c4177=_0x167aca['offset'],_0x205a25=_0x167aca[_0xe429('0x1b')]+_0x167aca[_0xe429('0x1c')],_0x452919;if(_0x205a25>=_0x18e822){_0x205a25=_0x18e822;_0x452919=0xc8;}else{_0x452919=0xce;}_0x35d8e6[_0xe429('0x19')](_0x452919);return _0x35d8e6['set'](_0xe429('0x1d'),_0x5c4177+'-'+_0x205a25+'/'+_0x18e822)['json'](_0x171d98);}return null;};}function patchUpdates(_0x272fc4){return function(_0x49d64e){try{jsonpatch[_0xe429('0x1e')](_0x49d64e,_0x272fc4,!![]);}catch(_0x35b65c){return BPromise[_0xe429('0x1f')](_0x35b65c);}return _0x49d64e[_0xe429('0x20')]();};}function saveUpdates(_0x53098b,_0xf294aa){return function(_0x58118a){if(_0x58118a){return _0x58118a[_0xe429('0x21')](_0x53098b)['then'](function(_0x40d6d9){return _0x40d6d9;});}return null;};}function removeEntity(_0x2c717c,_0x140f27){return function(_0x4d69ab){if(_0x4d69ab){return _0x4d69ab[_0xe429('0x22')]()[_0xe429('0x23')](function(){_0x2c717c[_0xe429('0x19')](0xcc)[_0xe429('0x24')]();});}};}function handleEntityNotFound(_0x40746f,_0x120b44){return function(_0x1cf21f){if(!_0x1cf21f){_0x40746f[_0xe429('0x18')](0x194);}return _0x1cf21f;};}function handleError(_0x14c6ae,_0x4ee2a8){_0x4ee2a8=_0x4ee2a8||0x1f4;return function(_0x34920c){logger['error'](_0x34920c[_0xe429('0x25')]);if(_0x34920c['name']){delete _0x34920c[_0xe429('0x26')];}_0x14c6ae[_0xe429('0x19')](_0x4ee2a8)[_0xe429('0x27')](_0x34920c);};}exports['index']=function(_0x48792f,_0x59e0e8){var _0x590e4b={},_0x1c4681={},_0x3f31f9={'count':0x0,'rows':[]};var _0xc448c7=db[_0xe429('0x28')][_0xe429('0x29')];_0x1c4681[_0xe429('0x2a')]=_[_0xe429('0x2b')](_0xc448c7);_0x1c4681[_0xe429('0x2c')]=_[_0xe429('0x2b')](_0x48792f[_0xe429('0x2c')]);_0x1c4681['filters']=_[_0xe429('0x2d')](_0x1c4681[_0xe429('0x2a')],_0x1c4681[_0xe429('0x2c')]);_0x590e4b[_0xe429('0x2e')]=_[_0xe429('0x2d')](_0x1c4681['model'],qs[_0xe429('0x2f')](_0x48792f[_0xe429('0x2c')][_0xe429('0x2f')]));_0x590e4b[_0xe429('0x2e')]=_0x590e4b[_0xe429('0x2e')][_0xe429('0x30')]?_0x590e4b[_0xe429('0x2e')]:_0x1c4681[_0xe429('0x2a')];if(!_0x48792f['query'][_0xe429('0x31')]('nolimit')){_0x590e4b[_0xe429('0x1c')]=qs[_0xe429('0x1c')](_0x48792f[_0xe429('0x2c')]['limit']);_0x590e4b['offset']=qs['offset'](_0x48792f['query'][_0xe429('0x1b')]);}_0x590e4b['order']=qs[_0xe429('0x32')](_0x48792f[_0xe429('0x2c')][_0xe429('0x32')]);_0x590e4b[_0xe429('0x33')]=qs[_0xe429('0x34')](_[_0xe429('0x35')](_0x48792f[_0xe429('0x2c')],_0x1c4681['filters']));if(_0x48792f['query']['filter']){_0x590e4b[_0xe429('0x33')]=_[_0xe429('0x36')](_0x590e4b['where'],{'$or':_[_0xe429('0x37')](_0xc448c7,function(_0x5834b8){if(_0x5834b8[_0xe429('0x38')]['key']!=='VIRTUAL'){var _0x2469f1={};_0x2469f1[_0x5834b8[_0xe429('0x39')]]={'$like':'%'+_0x48792f[_0xe429('0x2c')][_0xe429('0x3a')]+'%'};return _0x2469f1;}})});}_0x590e4b=_[_0xe429('0x36')]({},_0x590e4b,_0x48792f[_0xe429('0x3b')]);var _0x1d1b4c={'where':_0x590e4b[_0xe429('0x33')]};return db['Attachment'][_0xe429('0x1a')](_0x1d1b4c)[_0xe429('0x23')](function(_0x1b065e){_0x3f31f9[_0xe429('0x1a')]=_0x1b065e;if(_0x48792f[_0xe429('0x2c')][_0xe429('0x3c')]){_0x590e4b[_0xe429('0x3d')]=[{'all':!![]}];}return db[_0xe429('0x28')][_0xe429('0x3e')](_0x590e4b);})[_0xe429('0x23')](function(_0x33a7f5){_0x3f31f9[_0xe429('0x3f')]=_0x33a7f5;return _0x3f31f9;})[_0xe429('0x23')](respondWithFilteredResult(_0x59e0e8,_0x590e4b))[_0xe429('0x40')](handleError(_0x59e0e8,null));};exports[_0xe429('0x41')]=function(_0x5cbc0e,_0x3760d4){var _0x55d242={'raw':!![],'where':{'id':_0x5cbc0e[_0xe429('0x42')]['id']}},_0x56b198={};_0x56b198[_0xe429('0x2a')]=_['keys'](db[_0xe429('0x28')]['rawAttributes']);_0x56b198[_0xe429('0x2c')]=_['keys'](_0x5cbc0e[_0xe429('0x2c')]);_0x56b198[_0xe429('0x34')]=_[_0xe429('0x2d')](_0x56b198['model'],_0x56b198[_0xe429('0x2c')]);_0x55d242['attributes']=_[_0xe429('0x2d')](_0x56b198[_0xe429('0x2a')],qs[_0xe429('0x2f')](_0x5cbc0e[_0xe429('0x2c')]['fields']));_0x55d242['attributes']=_0x55d242['attributes'][_0xe429('0x30')]?_0x55d242[_0xe429('0x2e')]:_0x56b198['model'];if(_0x5cbc0e['query'][_0xe429('0x3c')]){_0x55d242[_0xe429('0x3d')]=[{'all':!![]}];}_0x55d242=_[_0xe429('0x36')]({},_0x55d242,_0x5cbc0e[_0xe429('0x3b')]);return db['Attachment'][_0xe429('0x43')](_0x55d242)['then'](handleEntityNotFound(_0x3760d4,null))[_0xe429('0x23')](respondWithResult(_0x3760d4,null))[_0xe429('0x40')](handleError(_0x3760d4,null));};exports['update']=function(_0x1bbbc0,_0x1dcd57){if(_0x1bbbc0[_0xe429('0x44')]['id']){delete _0x1bbbc0['body']['id'];}return db[_0xe429('0x28')]['find']({'where':{'id':_0x1bbbc0[_0xe429('0x42')]['id']}})[_0xe429('0x23')](handleEntityNotFound(_0x1dcd57,null))[_0xe429('0x23')](saveUpdates(_0x1bbbc0['body'],null))[_0xe429('0x23')](respondWithResult(_0x1dcd57,null))[_0xe429('0x40')](handleError(_0x1dcd57,null));};exports[_0xe429('0x22')]=function(_0xefeba7,_0x18827e){return db[_0xe429('0x28')][_0xe429('0x43')]({'where':{'id':_0xefeba7[_0xe429('0x42')]['id']}})['then'](handleEntityNotFound(_0x18827e,null))[_0xe429('0x23')](removeEntity(_0x18827e,null))[_0xe429('0x40')](handleError(_0x18827e,null));};exports[_0xe429('0x45')]=function(_0x849e43,_0x5d4286,_0x59763a){_0x849e43[_0xe429('0x44')][_0xe429('0x26')]=_0x849e43[_0xe429('0x46')][_0xe429('0x47')];_0x849e43[_0xe429('0x44')]['basename']=_0x849e43[_0xe429('0x46')][_0xe429('0x48')];_0x849e43['body']['type']=_0x849e43[_0xe429('0x46')][_0xe429('0x49')];return db[_0xe429('0x28')]['create'](_0x849e43[_0xe429('0x44')])['then'](respondWithResult(_0x5d4286,0xc9))[_0xe429('0x40')](handleError(_0x5d4286,null));};exports[_0xe429('0x4a')]=function(_0x54fb3b,_0x4ae966,_0x211452){return db[_0xe429('0x28')][_0xe429('0x4b')]({'where':{'id':_0x54fb3b[_0xe429('0x42')]['id']},'raw':!![]})[_0xe429('0x23')](handleEntityNotFound(_0x4ae966,null))[_0xe429('0x23')](function(_0x18a63c){if(_0x18a63c){return _0x4ae966[_0xe429('0x4a')](path[_0xe429('0x4c')](config[_0xe429('0x4d')],_0xe429('0x4e'),_0x18a63c[_0xe429('0x4f')]));}})[_0xe429('0x40')](handleError(_0x4ae966,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 24e5c47..2fe7a13 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 _0x24cd=['util','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash'];(function(_0x44ee67,_0x391c43){var _0x1630a3=function(_0x49337a){while(--_0x49337a){_0x44ee67['push'](_0x44ee67['shift']());}};_0x1630a3(++_0x391c43);}(_0x24cd,0x83));var _0xd24c=function(_0x14f155,_0x14fb30){_0x14f155=_0x14f155-0x0;var _0x2a92a5=_0x24cd[_0x14f155];return _0x2a92a5;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var logger=require('../../config/logger')(_0xd24c('0x2'));var moment=require('moment');var BPromise=require(_0xd24c('0x3'));var rp=require(_0xd24c('0x4'));var fs=require('fs');var path=require(_0xd24c('0x5'));var rimraf=require('rimraf');var config=require(_0xd24c('0x6'));var attributes=require(_0xd24c('0x7'));module['exports']=function(_0x1c30fc,_0x2721be){return _0x1c30fc[_0xd24c('0x8')](_0xd24c('0x9'),attributes,{'tableName':_0xd24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','attachments'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0a12,0xb8));var _0x20a1=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x0a12[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('Attachment',attributes,{'tableName':_0x20a1('0x7'),'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 d42a7f8..a514000 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 _0x1ec9=['error','code','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3014c9,_0x21045d){var _0x5a1d43=function(_0x219162){while(--_0x219162){_0x3014c9['push'](_0x3014c9['shift']());}};_0x5a1d43(++_0x21045d);}(_0x1ec9,0xa1));var _0x91ec=function(_0x3e8fb6,_0xbba889){_0x3e8fb6=_0x3e8fb6-0x0;var _0x1eb094=_0x1ec9[_0x3e8fb6];return _0x1eb094;};'use strict';var _=require(_0x91ec('0x0'));var util=require(_0x91ec('0x1'));var moment=require(_0x91ec('0x2'));var BPromise=require(_0x91ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91ec('0x4'));var db=require(_0x91ec('0x5'))['db'];var utils=require(_0x91ec('0x6'));var logger=require(_0x91ec('0x7'))(_0x91ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x91ec('0x9'));var client=jayson[_0x91ec('0xa')][_0x91ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a4450,_0x39da19,_0x2f0d7a){return new BPromise(function(_0x11fb7e,_0x335be0){return client[_0x91ec('0xc')](_0x1a4450,_0x2f0d7a)[_0x91ec('0xd')](function(_0x546c24){logger[_0x91ec('0xe')](_0x91ec('0xf'),_0x39da19,_0x91ec('0x10'));logger[_0x91ec('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x39da19,'request\x20sent',JSON[_0x91ec('0x12')](_0x546c24));if(_0x546c24[_0x91ec('0x13')]){if(_0x546c24['error'][_0x91ec('0x14')]===0x1f4){logger['error'](_0x91ec('0xf'),_0x39da19,_0x546c24[_0x91ec('0x13')][_0x91ec('0x15')]);return _0x335be0(_0x546c24[_0x91ec('0x13')]['message']);}logger[_0x91ec('0x13')](_0x91ec('0xf'),_0x39da19,_0x546c24[_0x91ec('0x13')][_0x91ec('0x15')]);return _0x11fb7e(_0x546c24[_0x91ec('0x13')][_0x91ec('0x15')]);}else{logger[_0x91ec('0xe')](_0x91ec('0xf'),_0x39da19,_0x91ec('0x10'));_0x11fb7e(_0x546c24[_0x91ec('0x16')][_0x91ec('0x15')]);}})['catch'](function(_0x74f758){logger[_0x91ec('0x13')](_0x91ec('0xf'),_0x39da19,_0x74f758);_0x335be0(_0x74f758);});});}exports['CreateAttachment']=function(_0x50d92b){var _0x3617f3=this;return new Promise(function(_0x35c429,_0x27e904){return db[_0x91ec('0x17')][_0x91ec('0x18')](_0x50d92b[_0x91ec('0x19')],{'raw':_0x50d92b[_0x91ec('0x1a')]?_0x50d92b[_0x91ec('0x1a')][_0x91ec('0x1b')]===undefined?!![]:![]:!![]})[_0x91ec('0xd')](function(_0x1d38bb){logger['info'](_0x91ec('0x1c'),_0x50d92b);logger[_0x91ec('0x11')](_0x91ec('0x1c'),_0x50d92b,JSON[_0x91ec('0x12')](_0x1d38bb));_0x35c429(_0x1d38bb);})[_0x91ec('0x1d')](function(_0x55d479){logger[_0x91ec('0x13')](_0x91ec('0x1c'),_0x55d479[_0x91ec('0x15')],_0x50d92b);_0x27e904(_0x3617f3[_0x91ec('0x13')](0x1f4,_0x55d479['message']));});});}; \ No newline at end of file +var _0xe85f=['moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','CreateAttachment','Attachment','create','body','options','raw','then','debug','stringify','catch','lodash','util'];(function(_0x90d97f,_0x48818f){var _0x3ec4cf=function(_0x6232ae){while(--_0x6232ae){_0x90d97f['push'](_0x90d97f['shift']());}};_0x3ec4cf(++_0x48818f);}(_0xe85f,0x116));var _0xfe85=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe85f[_0x307d86];return _0x361745;};'use strict';var _=require(_0xfe85('0x0'));var util=require(_0xfe85('0x1'));var moment=require(_0xfe85('0x2'));var BPromise=require(_0xfe85('0x3'));var rs=require(_0xfe85('0x4'));var fs=require('fs');var Redis=require(_0xfe85('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe85('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe85('0x7'));var client=jayson[_0xfe85('0x8')][_0xfe85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b3a12,_0x304949,_0x2512c3){return new BPromise(function(_0x96ed43,_0x39421b){return client[_0xfe85('0xa')](_0x1b3a12,_0x2512c3)['then'](function(_0x20cd32){logger[_0xfe85('0xb')](_0xfe85('0xc'),_0x304949,_0xfe85('0xd'));logger['debug'](_0xfe85('0xe'),_0x304949,_0xfe85('0xd'),JSON['stringify'](_0x20cd32));if(_0x20cd32['error']){if(_0x20cd32[_0xfe85('0xf')]['code']===0x1f4){logger[_0xfe85('0xf')](_0xfe85('0xc'),_0x304949,_0x20cd32[_0xfe85('0xf')][_0xfe85('0x10')]);return _0x39421b(_0x20cd32['error'][_0xfe85('0x10')]);}logger['error'](_0xfe85('0xc'),_0x304949,_0x20cd32['error']['message']);return _0x96ed43(_0x20cd32[_0xfe85('0xf')]['message']);}else{logger['info'](_0xfe85('0xc'),_0x304949,_0xfe85('0xd'));_0x96ed43(_0x20cd32[_0xfe85('0x11')][_0xfe85('0x10')]);}})['catch'](function(_0x29037a){logger['error'](_0xfe85('0xc'),_0x304949,_0x29037a);_0x39421b(_0x29037a);});});}exports[_0xfe85('0x12')]=function(_0x400b8a){var _0x4e38eb=this;return new Promise(function(_0x1d406a,_0x29675b){return db[_0xfe85('0x13')][_0xfe85('0x14')](_0x400b8a[_0xfe85('0x15')],{'raw':_0x400b8a[_0xfe85('0x16')]?_0x400b8a[_0xfe85('0x16')][_0xfe85('0x17')]===undefined?!![]:![]:!![]})[_0xfe85('0x18')](function(_0x8764c0){logger[_0xfe85('0xb')]('CreateAttachment',_0x400b8a);logger[_0xfe85('0x19')]('CreateAttachment',_0x400b8a,JSON[_0xfe85('0x1a')](_0x8764c0));_0x1d406a(_0x8764c0);})[_0xfe85('0x1b')](function(_0x5d25f1){logger[_0xfe85('0xf')](_0xfe85('0x12'),_0x5d25f1[_0xfe85('0x10')],_0x400b8a);_0x29675b(_0x4e38eb['error'](0x1f4,_0x5d25f1['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2d3058e..10f6349 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 _0xa902=['index','/:id','show','download','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','post','single','file','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./attachment.controller','get','isAuthenticated'];(function(_0x10fdc3,_0x2ac01f){var _0xd7c0c2=function(_0x12180d){while(--_0x12180d){_0x10fdc3['push'](_0x10fdc3['shift']());}};_0xd7c0c2(++_0x2ac01f);}(_0xa902,0x8d));var _0x2a90=function(_0x43f084,_0xb48804){_0x43f084=_0x43f084-0x0;var _0x2a6dde=_0xa902[_0x43f084];return _0x2a6dde;};'use strict';var multer=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var path=require(_0x2a90('0x2'));var timeout=require(_0x2a90('0x3'));var express=require(_0x2a90('0x4'));var router=express['Router']();var auth=require(_0x2a90('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a90('0x6'));router[_0x2a90('0x7')]('/',auth[_0x2a90('0x8')](),controller[_0x2a90('0x9')]);router[_0x2a90('0x7')](_0x2a90('0xa'),auth['isAuthenticated'](),controller[_0x2a90('0xb')]);router['get']('/:id/download',auth[_0x2a90('0x8')](),controller[_0x2a90('0xc')]);var upload=multer({'storage':multer[_0x2a90('0xd')]({'destination':function(_0x2b0a20,_0x18a60e,_0x56550f){_0x56550f(null,path[_0x2a90('0xe')](config[_0x2a90('0xf')],_0x2a90('0x10')));},'filename':function(_0x305954,_0x541e22,_0x40e6aa){_0x40e6aa(null,util['format'](_0x2a90('0x11'),Date['now'](),_0x541e22[_0x2a90('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2a90('0x13')]('/',upload[_0x2a90('0x14')](_0x2a90('0x15')),controller['create']);router['put']('/:id',auth[_0x2a90('0x8')](),controller[_0x2a90('0x16')]);router['delete'](_0x2a90('0xa'),auth[_0x2a90('0x8')](),controller[_0x2a90('0x17')]);module[_0x2a90('0x18')]=router; \ No newline at end of file +var _0x6b61=['create','put','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','isAuthenticated','index','/:id','get','/:id/download','join','root','server/files/attachments/','originalname','replace','post','single','file'];(function(_0xe3c2f7,_0x4d4d34){var _0x5b3d38=function(_0x117735){while(--_0x117735){_0xe3c2f7['push'](_0xe3c2f7['shift']());}};_0x5b3d38(++_0x4d4d34);}(_0x6b61,0x16a));var _0x16b6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b61[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x16b6('0x0'));var util=require('util');var path=require(_0x16b6('0x1'));var timeout=require(_0x16b6('0x2'));var express=require(_0x16b6('0x3'));var router=express[_0x16b6('0x4')]();var auth=require(_0x16b6('0x5'));var interaction=require(_0x16b6('0x6'));var config=require(_0x16b6('0x7'));var controller=require(_0x16b6('0x8'));router['get']('/',auth[_0x16b6('0x9')](),controller[_0x16b6('0xa')]);router['get'](_0x16b6('0xb'),auth[_0x16b6('0x9')](),controller['show']);router[_0x16b6('0xc')](_0x16b6('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x282385,_0x4cdac4,_0x95f3c5){_0x95f3c5(null,path[_0x16b6('0xe')](config[_0x16b6('0xf')],_0x16b6('0x10')));},'filename':function(_0x3c93a4,_0x2114e4,_0x4773e6){_0x4773e6(null,util['format']('%s-%s',Date['now'](),_0x2114e4[_0x16b6('0x11')][_0x16b6('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x16b6('0x13')]('/',upload[_0x16b6('0x14')](_0x16b6('0x15')),controller[_0x16b6('0x16')]);router[_0x16b6('0x17')]('/:id',auth[_0x16b6('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c83b2c9..67b2892 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 _0x7676=['callbackURL','map','emails','admin','user','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport','passport-google-oauth20','../../mysqldb','signToken','authenticate','google','/login','email','callback','use','clientID','clientSecret','secret'];(function(_0xd09eea,_0x454068){var _0x3e0e09=function(_0x12b1d1){while(--_0x12b1d1){_0xd09eea['push'](_0xd09eea['shift']());}};_0x3e0e09(++_0x454068);}(_0x7676,0xb8));var _0x6767=function(_0x695165,_0x4b4863){_0x695165=_0x695165-0x0;var _0x378bb0=_0x7676[_0x695165];return _0x378bb0;};'use strict';var _=require(_0x6767('0x0'));var passport=require(_0x6767('0x1'));var GoogleStrategy=require(_0x6767('0x2'))['Strategy'];var db=require(_0x6767('0x3'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x6767('0x4')];exports['login']=passport[_0x6767('0x5')](_0x6767('0x6'),{'failureRedirect':_0x6767('0x7'),'scope':['profile',_0x6767('0x8')],'session':![]});exports[_0x6767('0x9')]=passport[_0x6767('0x5')]('google',{'failureRedirect':_0x6767('0x7'),'session':![]});passport[_0x6767('0xa')](new GoogleStrategy({'clientID':config[_0x6767('0x6')]?config[_0x6767('0x6')][_0x6767('0xb')]:'id','clientSecret':config[_0x6767('0x6')]?config[_0x6767('0x6')][_0x6767('0xc')]:_0x6767('0xd'),'callbackURL':config[_0x6767('0x6')]?config[_0x6767('0x6')][_0x6767('0xe')]:''},function(_0x47b7a4,_0x462927,_0x3f68e5,_0xa6edf){db['User']['find']({'where':{'email':_[_0x6767('0xf')](_0x3f68e5[_0x6767('0x10')],'value'),'role':{'$or':[_0x6767('0x11'),_0x6767('0x12'),'agent']}}})[_0x6767('0x13')](function(_0x36026f){if(_0x36026f){return _0xa6edf(null,_0x36026f);}_0xa6edf(_0x6767('0x14'));})[_0x6767('0x15')](function(_0x549d80){_0xa6edf(_0x549d80);});})); \ No newline at end of file +var _0x535d=['catch','lodash','passport','Strategy','../../mysqldb','signToken','login','authenticate','google','/login','profile','use','clientID','secret','callbackURL','User','find','map','emails','admin','then'];(function(_0x170eb7,_0x1ac59b){var _0x4dfeac=function(_0x350592){while(--_0x350592){_0x170eb7['push'](_0x170eb7['shift']());}};_0x4dfeac(++_0x1ac59b);}(_0x535d,0xe8));var _0xd535=function(_0x1fdedb,_0x454ae1){_0x1fdedb=_0x1fdedb-0x0;var _0x2b0bfc=_0x535d[_0x1fdedb];return _0x2b0bfc;};'use strict';var _=require(_0xd535('0x0'));var passport=require(_0xd535('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xd535('0x2')];var db=require(_0xd535('0x3'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xd535('0x4')];exports[_0xd535('0x5')]=passport[_0xd535('0x6')](_0xd535('0x7'),{'failureRedirect':_0xd535('0x8'),'scope':[_0xd535('0x9'),'email'],'session':![]});exports['callback']=passport[_0xd535('0x6')](_0xd535('0x7'),{'failureRedirect':'/login','session':![]});passport[_0xd535('0xa')](new GoogleStrategy({'clientID':config['google']?config[_0xd535('0x7')][_0xd535('0xb')]:'id','clientSecret':config[_0xd535('0x7')]?config[_0xd535('0x7')]['clientSecret']:_0xd535('0xc'),'callbackURL':config[_0xd535('0x7')]?config[_0xd535('0x7')][_0xd535('0xd')]:''},function(_0x4c0692,_0x2f9373,_0x2cc69b,_0x3794d9){db[_0xd535('0xe')][_0xd535('0xf')]({'where':{'email':_[_0xd535('0x10')](_0x2cc69b[_0xd535('0x11')],'value'),'role':{'$or':[_0xd535('0x12'),'user','agent']}}})[_0xd535('0x13')](function(_0x2bf442){if(_0x2bf442){return _0x3794d9(null,_0x2bf442);}_0x3794d9('Incorrect\x20username\x20and/or\x20password');})[_0xd535('0x14')](function(_0x338042){_0x3794d9(_0x338042);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index cd50ef6..f36969a 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 _0x3317=['login','/callback','callback','exports','passport','./authGoogle.controller','../../components/auth/service','setTokenCookie'];(function(_0x53f8b5,_0x2cc3fd){var _0x50e3f0=function(_0x23dd12){while(--_0x23dd12){_0x53f8b5['push'](_0x53f8b5['shift']());}};_0x50e3f0(++_0x2cc3fd);}(_0x3317,0x184));var _0x7331=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x3317[_0x5f09c5];return _0x426ad9;};'use strict';var express=require('express');var passport=require(_0x7331('0x0'));var router=express['Router']();var controller=require(_0x7331('0x1'));var setTokenCookie=require(_0x7331('0x2'))[_0x7331('0x3')];router['get']('/',controller[_0x7331('0x4')]);router['get'](_0x7331('0x5'),controller[_0x7331('0x6')],setTokenCookie);module[_0x7331('0x7')]=router; \ No newline at end of file +var _0x2884=['setTokenCookie','login','get','/callback','callback','express','passport','./authGoogle.controller','../../components/auth/service'];(function(_0x4a4256,_0x542ee2){var _0x5a6fc4=function(_0x1a370e){while(--_0x1a370e){_0x4a4256['push'](_0x4a4256['shift']());}};_0x5a6fc4(++_0x542ee2);}(_0x2884,0x191));var _0x4288=function(_0x29f476,_0x2db883){_0x29f476=_0x29f476-0x0;var _0x18ded1=_0x2884[_0x29f476];return _0x18ded1;};'use strict';var express=require(_0x4288('0x0'));var passport=require(_0x4288('0x1'));var router=express['Router']();var controller=require(_0x4288('0x2'));var setTokenCookie=require(_0x4288('0x3'))[_0x4288('0x4')];router['get']('/',controller[_0x4288('0x5')]);router[_0x4288('0x6')](_0x4288('0x7'),controller[_0x4288('0x8')],setTokenCookie);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index cbd9184..a1e38ed 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 _0xeca6=['save','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','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','securePassword','resetPasswordToken','Password\x20reset!','util','passport-local','Strategy','bluebird','jayson/promise','lodash','api','randomstring','../../mysqldb','../../components/auth/service','signToken','client','http','role','agent','User','then','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','authenticate','Incorrect\x20username\x20and/or\x20password','MailAccount','name','email','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires'];(function(_0x2de223,_0x2de0ab){var _0x56b8f3=function(_0x39fb9c){while(--_0x39fb9c){_0x2de223['push'](_0x2de223['shift']());}};_0x56b8f3(++_0x2de0ab);}(_0xeca6,0x1de));var _0x6eca=function(_0x226257,_0x17ca64){_0x226257=_0x226257-0x0;var _0x76cd9e=_0xeca6[_0x226257];return _0x76cd9e;};'use strict';var util=require(_0x6eca('0x0'));var passport=require('passport');var LocalStrategy=require(_0x6eca('0x1'))[_0x6eca('0x2')];var BPromise=require(_0x6eca('0x3'));var jayson=require(_0x6eca('0x4'));var _=require(_0x6eca('0x5'));var logger=require('../../config/logger')(_0x6eca('0x6'));var rs=require(_0x6eca('0x7'));var db=require(_0x6eca('0x8'))['db'];var signToken=require(_0x6eca('0x9'))[_0x6eca('0xa')];var client=jayson[_0x6eca('0xb')][_0x6eca('0xc')]({'port':0x232b});var getLicense=function(_0x3e08ec){return new BPromise(function(_0x38aa68,_0xc642f2){var _0x43f9b3=0x0;_0x3e08ec[_0x6eca('0xd')]!==_0x6eca('0xe')&&_0x38aa68(_0x3e08ec);return db[_0x6eca('0xf')]['count']({'where':{'role':_0x6eca('0xe'),'online':!![],'id':{'$ne':_0x3e08ec['id']}}})[_0x6eca('0x10')](function(_0x132242){_0x43f9b3=_0x132242;return require(_0x6eca('0x11'))[_0x6eca('0x12')]();})['then'](function(_0x5316a9){if(_0x5316a9&&_0x5316a9[_0x6eca('0x13')]&&_0x43f9b3>=_0x5316a9[_0x6eca('0x13')]){return _0xc642f2({'message':_0x6eca('0x14')});}return _0x38aa68(_0x3e08ec);})[_0x6eca('0x15')](function(_0x90264){return _0xc642f2(_0x90264);});});};function localAuthenticate(_0x3e9c3e,_0x356049,_0x33aef4,_0x39262b){_0x3e9c3e[_0x6eca('0x16')]({'where':{'name':_0x356049,'role':{'$or':[_0x6eca('0x17'),'user',_0x6eca('0xe')]}}})[_0x6eca('0x10')](function(_0x42d6a9){if(!_0x42d6a9||_0x42d6a9&&_0x42d6a9['name']!==_0x356049){return _0x39262b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}return getLicense(_0x42d6a9);})[_0x6eca('0x10')](function(_0x547ac9){_0x547ac9[_0x6eca('0x18')](_0x33aef4,function(_0x2b8813,_0x2fc6ea){if(_0x2b8813){return _0x39262b(_0x2b8813);}if(!_0x2fc6ea){return _0x39262b(null,![],{'message':_0x6eca('0x19')});}else{return _0x39262b(null,_0x547ac9);}});})[_0x6eca('0x15')](function(_0x5bca79){_0x39262b(_0x5bca79);});}function sendServiceMail(_0x5d8f6c){return db[_0x6eca('0x1a')][_0x6eca('0x16')]({'where':{'service':!![]},'attributes':['id',_0x6eca('0x1b'),_0x6eca('0x1c')],'include':[{'model':db[_0x6eca('0x1d')],'as':'Smtp'}]})[_0x6eca('0x10')](function(_0x33ebb3){if(!_0x33ebb3){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x40a95b={'tls':{'rejectUnauthorized':![]}};if(_0x33ebb3[_0x6eca('0x1e')][_0x6eca('0x1f')]){_0x40a95b[_0x6eca('0x1f')]=_0x33ebb3[_0x6eca('0x1e')]['service'];}else{_0x40a95b[_0x6eca('0x20')]=_0x33ebb3[_0x6eca('0x1e')][_0x6eca('0x20')];_0x40a95b[_0x6eca('0x21')]=_0x33ebb3['Smtp']['port'];_0x40a95b[_0x6eca('0x22')]=_0x33ebb3['Smtp']['secure'];}if(_0x33ebb3[_0x6eca('0x1e')]['authentication']){_0x40a95b[_0x6eca('0x23')]={'user':_0x33ebb3[_0x6eca('0x1e')][_0x6eca('0x24')],'pass':_0x33ebb3[_0x6eca('0x1e')][_0x6eca('0x25')]};}var _0x10fd05={'account':_0x40a95b,'message':_[_0x6eca('0x26')]({'from':util[_0x6eca('0x27')](_0x6eca('0x28'),_0x33ebb3[_0x6eca('0x1b')],_0x33ebb3['email']||_0x33ebb3[_0x6eca('0x1e')]['user'])},_0x5d8f6c)};return client['request'](_0x6eca('0x29'),_0x10fd05);})[_0x6eca('0x10')](function(_0x350b8e){if(_0x350b8e[_0x6eca('0x2a')]){throw new Error(util[_0x6eca('0x27')](_0x6eca('0x2b'),_0x350b8e[_0x6eca('0x2a')][_0x6eca('0x2c')]||JSON[_0x6eca('0x2d')](_0x350b8e[_0x6eca('0x2a')])));}return!![];});}function handleError(_0x211105,_0x59cc67,_0x3e9c64){return _0x211105[_0x6eca('0x2e')](_0x59cc67||0x1f4)[_0x6eca('0x2f')]({'message':_0x3e9c64?_0x3e9c64[_0x6eca('0x2c')]||_0x3e9c64:''});}function checkPasswordPattern(_0x9bd4f4,_0x15d33a,_0x4a5ab0){if(_0x4a5ab0){var _0x29227f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29227f[_0x6eca('0x30')](_0x15d33a)){return _0x9bd4f4;}else{throw new Error(_0x6eca('0x31'));}}else{return _0x9bd4f4;}}exports[_0x6eca('0x32')]=function(_0x181435,_0x2619bb,_0x178bfc){passport[_0x6eca('0x18')](_0x6eca('0x33'),function(_0xc52aba,_0x81b096,_0x55c1e4){var _0x2ce065=_0xc52aba||_0x55c1e4;if(_0x2ce065){return handleError(_0x2619bb,0x191,_0x2ce065);}if(!_0x81b096){return handleError(_0x2619bb,0x194,{'message':_0x6eca('0x34')});}var _0x4c4f52=signToken(_0x81b096['id'],_0x81b096[_0x6eca('0xd')]);_0x2619bb[_0x6eca('0x35')]({'id':_0x81b096['id'],'token':_0x4c4f52,'statusCall':'','isAlreadyLogged':_0x81b096[_0x6eca('0x36')]});})(_0x181435,_0x2619bb,_0x178bfc);};exports[_0x6eca('0x37')]=function(_0x1b1999,_0x4555ec,_0x428fe9){if(!_0x1b1999[_0x6eca('0x38')][_0x6eca('0x1c')]){return handleError(_0x4555ec,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1850b0=rs['generate']();_0x1b1999[_0x6eca('0x38')][_0x6eca('0x1c')]=_0x1b1999[_0x6eca('0x38')][_0x6eca('0x1c')][_0x6eca('0x39')]()[_0x6eca('0x3a')]();return db['User'][_0x6eca('0x16')]({'where':{'email':_0x1b1999['body'][_0x6eca('0x1c')]}})[_0x6eca('0x10')](function(_0x54adae){if(!_0x54adae){throw new Error(_0x6eca('0x3b'));}_0x54adae['resetPasswordToken']=_0x1850b0;_0x54adae[_0x6eca('0x3c')]=Date['now']()+0x36ee80;return _0x54adae[_0x6eca('0x3d')]();})[_0x6eca('0x10')](function(){return sendServiceMail({'to':_0x1b1999[_0x6eca('0x38')][_0x6eca('0x1c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6eca('0x3e')+_0x6eca('0x3f')+_0x1b1999[_0x6eca('0x40')]['host']+_0x6eca('0x41')+_0x1850b0+'\x0a\x0a'+_0x6eca('0x42')});})[_0x6eca('0x10')](function(){_0x4555ec[_0x6eca('0x2e')](0xc8)['send']({'message':_0x6eca('0x43')});})[_0x6eca('0x15')](function(_0x28d926){return handleError(_0x4555ec,0x1f4,_0x28d926);});};exports[_0x6eca('0x44')]=function(_0x2f76bf,_0x3790a4,_0x54163d){var _0x261e51;return db['User'][_0x6eca('0x16')]({'where':{'resetPasswordToken':_0x2f76bf[_0x6eca('0x45')][_0x6eca('0x46')],'resetPasswordExpires':{'$gt':Date[_0x6eca('0x47')]()}}})[_0x6eca('0x10')](function(_0x1d4037){_0x261e51=_0x1d4037;if(!_0x261e51){throw new Error(_0x6eca('0x48'));}return db['Setting']['findOne']({'attributes':['id','securePassword']});})[_0x6eca('0x10')](function(_0x55b868){return checkPasswordPattern(_0x55b868,_0x2f76bf[_0x6eca('0x38')][_0x6eca('0x49')],_0x55b868[_0x6eca('0x4a')]);})[_0x6eca('0x10')](function(){_0x261e51['password']=_0x2f76bf[_0x6eca('0x38')][_0x6eca('0x49')];_0x261e51[_0x6eca('0x4b')]=null;_0x261e51[_0x6eca('0x3c')]=null;return _0x261e51[_0x6eca('0x3d')]();})['then'](function(){_0x3790a4[_0x6eca('0x2e')](0xc8)['send']({'message':_0x6eca('0x4c')});})[_0x6eca('0x15')](function(_0x11dcf6){return handleError(_0x3790a4,0x1f4,_0x11dcf6);});};passport['use'](new LocalStrategy({'usernameField':_0x6eca('0x1b'),'passwordField':'password'},function(_0xa7ab5e,_0x9108fd,_0x5793e3){return localAuthenticate(db['User'],_0xa7ab5e,_0x9108fd,_0x5793e3);})); \ No newline at end of file +var _0x1d85=['login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','email','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','findOne','securePassword','password','use','util','passport','passport-local','jayson/promise','../../config/logger','../../components/auth/service','signToken','client','http','agent','User','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','user','Incorrect\x20username\x20and/or\x20password','authenticate','name','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','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~!@#$%^&-_=+[{]}.'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x1d85,0x12d));var _0x51d8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x1d85[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0x51d8('0x0'));var passport=require(_0x51d8('0x1'));var LocalStrategy=require(_0x51d8('0x2'))['Strategy'];var BPromise=require('bluebird');var jayson=require(_0x51d8('0x3'));var _=require('lodash');var logger=require(_0x51d8('0x4'))('api');var rs=require('randomstring');var db=require('../../mysqldb')['db'];var signToken=require(_0x51d8('0x5'))[_0x51d8('0x6')];var client=jayson[_0x51d8('0x7')][_0x51d8('0x8')]({'port':0x232b});var getLicense=function(_0x5057d1){return new BPromise(function(_0x1c0bea,_0x11c455){var _0x147bb4=0x0;_0x5057d1['role']!==_0x51d8('0x9')&&_0x1c0bea(_0x5057d1);return db[_0x51d8('0xa')]['count']({'where':{'role':_0x51d8('0x9'),'online':!![],'id':{'$ne':_0x5057d1['id']}}})[_0x51d8('0xb')](function(_0x3ef62f){_0x147bb4=_0x3ef62f;return require('../../config/license/util')[_0x51d8('0xc')]();})['then'](function(_0x4efe31){if(_0x4efe31&&_0x4efe31[_0x51d8('0xd')]&&_0x147bb4>=_0x4efe31[_0x51d8('0xd')]){return _0x11c455({'message':_0x51d8('0xe')});}return _0x1c0bea(_0x5057d1);})[_0x51d8('0xf')](function(_0x4d80ad){return _0x11c455(_0x4d80ad);});});};function localAuthenticate(_0x3160fd,_0x131717,_0x4fd116,_0x4a18bc){_0x3160fd[_0x51d8('0x10')]({'where':{'name':_0x131717,'role':{'$or':['admin',_0x51d8('0x11'),'agent']}}})['then'](function(_0x127272){if(!_0x127272||_0x127272&&_0x127272['name']!==_0x131717){return _0x4a18bc(null,![],{'message':_0x51d8('0x12')});}return getLicense(_0x127272);})[_0x51d8('0xb')](function(_0x3ac0d4){_0x3ac0d4[_0x51d8('0x13')](_0x4fd116,function(_0x1e1abe,_0x3a3a49){if(_0x1e1abe){return _0x4a18bc(_0x1e1abe);}if(!_0x3a3a49){return _0x4a18bc(null,![],{'message':_0x51d8('0x12')});}else{return _0x4a18bc(null,_0x3ac0d4);}});})['catch'](function(_0x1f1056){_0x4a18bc(_0x1f1056);});}function sendServiceMail(_0x32e699){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x51d8('0x14'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x51d8('0x15')}]})[_0x51d8('0xb')](function(_0x25d522){if(!_0x25d522){throw new Error(_0x51d8('0x16'));}var _0x28e20d={'tls':{'rejectUnauthorized':![]}};if(_0x25d522[_0x51d8('0x15')][_0x51d8('0x17')]){_0x28e20d[_0x51d8('0x17')]=_0x25d522['Smtp'][_0x51d8('0x17')];}else{_0x28e20d[_0x51d8('0x18')]=_0x25d522[_0x51d8('0x15')]['host'];_0x28e20d[_0x51d8('0x19')]=_0x25d522[_0x51d8('0x15')][_0x51d8('0x19')];_0x28e20d['secure']=_0x25d522['Smtp'][_0x51d8('0x1a')];}if(_0x25d522[_0x51d8('0x15')]['authentication']){_0x28e20d[_0x51d8('0x1b')]={'user':_0x25d522[_0x51d8('0x15')][_0x51d8('0x11')],'pass':_0x25d522[_0x51d8('0x15')][_0x51d8('0x1c')]};}var _0xcde26={'account':_0x28e20d,'message':_['merge']({'from':util[_0x51d8('0x1d')](_0x51d8('0x1e'),_0x25d522[_0x51d8('0x14')],_0x25d522['email']||_0x25d522[_0x51d8('0x15')][_0x51d8('0x11')])},_0x32e699)};return client[_0x51d8('0x1f')]('SendMail',_0xcde26);})['then'](function(_0x479228){if(_0x479228[_0x51d8('0x20')]){throw new Error(util[_0x51d8('0x1d')](_0x51d8('0x21'),_0x479228['error'][_0x51d8('0x22')]||JSON[_0x51d8('0x23')](_0x479228[_0x51d8('0x20')])));}return!![];});}function handleError(_0x6f7877,_0x1ff852,_0x268b89){return _0x6f7877[_0x51d8('0x24')](_0x1ff852||0x1f4)[_0x51d8('0x25')]({'message':_0x268b89?_0x268b89['message']||_0x268b89:''});}function checkPasswordPattern(_0x475ad5,_0x562189,_0x352044){if(_0x352044){var _0x4fbed5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fbed5['test'](_0x562189)){return _0x475ad5;}else{throw new Error(_0x51d8('0x26'));}}else{return _0x475ad5;}}exports[_0x51d8('0x27')]=function(_0x3842ed,_0x450c31,_0x54e50f){passport[_0x51d8('0x13')]('local',function(_0x8429cf,_0x41848c,_0x1c4fda){var _0x4831bc=_0x8429cf||_0x1c4fda;if(_0x4831bc){return handleError(_0x450c31,0x191,_0x4831bc);}if(!_0x41848c){return handleError(_0x450c31,0x194,{'message':_0x51d8('0x28')});}var _0x2b4090=signToken(_0x41848c['id'],_0x41848c['role']);_0x450c31['json']({'id':_0x41848c['id'],'token':_0x2b4090,'statusCall':'','isAlreadyLogged':_0x41848c[_0x51d8('0x29')]});})(_0x3842ed,_0x450c31,_0x54e50f);};exports[_0x51d8('0x2a')]=function(_0x1c551e,_0x4fecd9,_0x568b6c){if(!_0x1c551e[_0x51d8('0x2b')][_0x51d8('0x2c')]){return handleError(_0x4fecd9,0x1f4,{'message':_0x51d8('0x2d')});}var _0x3a99c7=rs[_0x51d8('0x2e')]();_0x1c551e['body'][_0x51d8('0x2c')]=_0x1c551e[_0x51d8('0x2b')]['email'][_0x51d8('0x2f')]()[_0x51d8('0x30')]();return db[_0x51d8('0xa')][_0x51d8('0x10')]({'where':{'email':_0x1c551e[_0x51d8('0x2b')]['email']}})[_0x51d8('0xb')](function(_0x3e8a3d){if(!_0x3e8a3d){throw new Error(_0x51d8('0x31'));}_0x3e8a3d[_0x51d8('0x32')]=_0x3a99c7;_0x3e8a3d[_0x51d8('0x33')]=Date['now']()+0x36ee80;return _0x3e8a3d[_0x51d8('0x34')]();})['then'](function(){return sendServiceMail({'to':_0x1c551e[_0x51d8('0x2b')][_0x51d8('0x2c')],'subject':_0x51d8('0x35'),'text':_0x51d8('0x36')+_0x51d8('0x37')+_0x51d8('0x38')+_0x1c551e[_0x51d8('0x39')][_0x51d8('0x18')]+'/reset/'+_0x3a99c7+'\x0a\x0a'+_0x51d8('0x3a')});})[_0x51d8('0xb')](function(){_0x4fecd9[_0x51d8('0x24')](0xc8)[_0x51d8('0x25')]({'message':_0x51d8('0x3b')});})[_0x51d8('0xf')](function(_0x108d75){return handleError(_0x4fecd9,0x1f4,_0x108d75);});};exports['reset']=function(_0x3f999f,_0x43be8c,_0x51ca2c){var _0x31f50e;return db[_0x51d8('0xa')]['find']({'where':{'resetPasswordToken':_0x3f999f['params'][_0x51d8('0x3c')],'resetPasswordExpires':{'$gt':Date[_0x51d8('0x3d')]()}}})['then'](function(_0x2fd0ed){_0x31f50e=_0x2fd0ed;if(!_0x31f50e){throw new Error(_0x51d8('0x3e'));}return db[_0x51d8('0x3f')][_0x51d8('0x40')]({'attributes':['id',_0x51d8('0x41')]});})[_0x51d8('0xb')](function(_0x5da46d){return checkPasswordPattern(_0x5da46d,_0x3f999f['body']['password'],_0x5da46d['securePassword']);})[_0x51d8('0xb')](function(){_0x31f50e[_0x51d8('0x42')]=_0x3f999f['body'][_0x51d8('0x42')];_0x31f50e[_0x51d8('0x32')]=null;_0x31f50e[_0x51d8('0x33')]=null;return _0x31f50e[_0x51d8('0x34')]();})['then'](function(){_0x43be8c['status'](0xc8)[_0x51d8('0x25')]({'message':'Password\x20reset!'});})['catch'](function(_0x2d56d3){return handleError(_0x43be8c,0x1f4,_0x2d56d3);});};passport[_0x51d8('0x43')](new LocalStrategy({'usernameField':'name','passwordField':_0x51d8('0x42')},function(_0x3b2463,_0x14d327,_0x5c9372){return localAuthenticate(db[_0x51d8('0xa')],_0x3b2463,_0x14d327,_0x5c9372);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 33dc649..42769c2 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 _0xf24c=['express','Router','./authLocal.controller','post','login','/forgot','forgot','reset'];(function(_0x5b512f,_0x11c43e){var _0x3fae0d=function(_0x328629){while(--_0x328629){_0x5b512f['push'](_0x5b512f['shift']());}};_0x3fae0d(++_0x11c43e);}(_0xf24c,0x88));var _0xcf24=function(_0x1c1c7b,_0x2a8416){_0x1c1c7b=_0x1c1c7b-0x0;var _0x1b17e3=_0xf24c[_0x1c1c7b];return _0x1b17e3;};'use strict';var express=require(_0xcf24('0x0'));var router=express[_0xcf24('0x1')]();var controller=require(_0xcf24('0x2'));router[_0xcf24('0x3')]('/',controller[_0xcf24('0x4')]);router[_0xcf24('0x3')](_0xcf24('0x5'),controller[_0xcf24('0x6')]);router[_0xcf24('0x3')]('/reset/:token',controller[_0xcf24('0x7')]);module['exports']=router; \ No newline at end of file +var _0x1fe2=['exports','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0x1fe2,0x179));var _0x21fe=function(_0x201e50,_0x4ba50d){_0x201e50=_0x201e50-0x0;var _0x45f516=_0x1fe2[_0x201e50];return _0x45f516;};'use strict';var express=require('express');var router=express[_0x21fe('0x0')]();var controller=require(_0x21fe('0x1'));router[_0x21fe('0x2')]('/',controller[_0x21fe('0x3')]);router[_0x21fe('0x2')](_0x21fe('0x4'),controller[_0x21fe('0x5')]);router[_0x21fe('0x2')](_0x21fe('0x6'),controller['reset']);module[_0x21fe('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8ffc1d0..c7aadc7 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 _0x96d8=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x1c79c9,_0xa28548){var _0x5c40a5=function(_0x58ecd4){while(--_0x58ecd4){_0x1c79c9['push'](_0x1c79c9['shift']());}};_0x5c40a5(++_0xa28548);}(_0x96d8,0x1e2));var _0x896d=function(_0xa35a64,_0x3919a2){_0xa35a64=_0xa35a64-0x0;var _0x46048c=_0x96d8[_0xa35a64];return _0x46048c;};'use strict';var Sequelize=require(_0x896d('0x0'));module[_0x896d('0x1')]={'name':{'type':Sequelize[_0x896d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x896d('0x2')]},'description':{'type':Sequelize[_0x896d('0x2')]},'status':{'type':Sequelize[_0x896d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x896d('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6372=['STRING','BOOLEAN','sequelize'];(function(_0x494ee0,_0x34df78){var _0x1ea4bd=function(_0xcdb963){while(--_0xcdb963){_0x494ee0['push'](_0x494ee0['shift']());}};_0x1ea4bd(++_0x34df78);}(_0x6372,0x1b8));var _0x2637=function(_0x2c8d0,_0x2bdf4c){_0x2c8d0=_0x2c8d0-0x0;var _0x1372bb=_0x6372[_0x2c8d0];return _0x1372bb;};'use strict';var Sequelize=require(_0x2637('0x0'));module['exports']={'name':{'type':Sequelize[_0x2637('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2637('0x1')]},'status':{'type':Sequelize[_0x2637('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 78050f9..9f97bc4 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 _0x28f5=['set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','addActions','getActions','Action','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit'];(function(_0x316efa,_0x20a1e1){var _0x4d96cc=function(_0x4a0648){while(--_0x4a0648){_0x316efa['push'](_0x316efa['shift']());}};_0x4d96cc(++_0x20a1e1);}(_0x28f5,0x80));var _0x528f=function(_0x46e9ea,_0x53478d){_0x46e9ea=_0x46e9ea-0x0;var _0x4033be=_0x28f5[_0x46e9ea];return _0x4033be;};'use strict';var pdf=require(_0x528f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x528f('0x1'));var zipdir=require(_0x528f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x528f('0x3'));var moment=require('moment');var BPromise=require(_0x528f('0x4'));var Mustache=require('mustache');var util=require(_0x528f('0x5'));var path=require(_0x528f('0x6'));var sox=require(_0x528f('0x7'));var csv=require(_0x528f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x528f('0x9'));var crypto=require(_0x528f('0xa'));var jsforce=require(_0x528f('0xb'));var deskjs=require(_0x528f('0xc'));var toCsv=require(_0x528f('0x8'));var querystring=require('querystring');var Papa=require(_0x528f('0xd'));var Redis=require('ioredis');var authService=require(_0x528f('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x528f('0xf'));var logger=require('../../config/logger')(_0x528f('0x10'));var utils=require(_0x528f('0x11'));var config=require(_0x528f('0x12'));var db=require(_0x528f('0x13'))['db'];function respondWithStatusCode(_0x1efea6,_0x24f2a1){_0x24f2a1=_0x24f2a1||0xcc;return function(_0x5649a1){if(_0x5649a1){return _0x1efea6['sendStatus'](_0x24f2a1);}return _0x1efea6['status'](_0x24f2a1)[_0x528f('0x14')]();};}function respondWithResult(_0x4f3c7f,_0x2fe9f8){_0x2fe9f8=_0x2fe9f8||0xc8;return function(_0x354b0c){if(_0x354b0c){return _0x4f3c7f[_0x528f('0x15')](_0x2fe9f8)[_0x528f('0x16')](_0x354b0c);}};}function respondWithFilteredResult(_0x32085d,_0x376aa4){return function(_0x2820ea){if(_0x2820ea){var _0x248c77=_0x2820ea[_0x528f('0x17')],_0x1da29b=_0x376aa4[_0x528f('0x18')],_0x7adb0b=_0x376aa4[_0x528f('0x18')]+_0x376aa4[_0x528f('0x19')],_0x135bff;if(_0x7adb0b>=_0x248c77){_0x7adb0b=_0x248c77;_0x135bff=0xc8;}else{_0x135bff=0xce;}_0x32085d['status'](_0x135bff);return _0x32085d[_0x528f('0x1a')](_0x528f('0x1b'),_0x1da29b+'-'+_0x7adb0b+'/'+_0x248c77)[_0x528f('0x16')](_0x2820ea);}return null;};}function patchUpdates(_0x13fe56){return function(_0x42255a){try{jsonpatch[_0x528f('0x1c')](_0x42255a,_0x13fe56,!![]);}catch(_0x5025f9){return BPromise['reject'](_0x5025f9);}return _0x42255a[_0x528f('0x1d')]();};}function saveUpdates(_0x23a209,_0x44ab3c){return function(_0x131e05){if(_0x131e05){return _0x131e05[_0x528f('0x1e')](_0x23a209)['then'](function(_0x49dbf9){return _0x49dbf9;});}return null;};}function removeEntity(_0x21b49a,_0x41a9d4){return function(_0x48c9a3){if(_0x48c9a3){return _0x48c9a3[_0x528f('0x1f')]()[_0x528f('0x20')](function(){_0x21b49a[_0x528f('0x15')](0xcc)[_0x528f('0x14')]();});}};}function handleEntityNotFound(_0x2e7b81,_0x58a592){return function(_0x4b8422){if(!_0x4b8422){_0x2e7b81[_0x528f('0x21')](0x194);}return _0x4b8422;};}function handleError(_0x5b1cc3,_0x1e95fb){_0x1e95fb=_0x1e95fb||0x1f4;return function(_0x18c760){logger['error'](_0x18c760[_0x528f('0x22')]);if(_0x18c760[_0x528f('0x23')]){delete _0x18c760[_0x528f('0x23')];}_0x5b1cc3['status'](_0x1e95fb)[_0x528f('0x24')](_0x18c760);};}exports[_0x528f('0x25')]=function(_0x4a21bd,_0x4e5a68){var _0x3a4993={},_0x30680a={},_0x1bb426={'count':0x0,'rows':[]};var _0x132e66=db[_0x528f('0x26')][_0x528f('0x27')];_0x30680a[_0x528f('0x28')]=_['keys'](_0x132e66);_0x30680a['query']=_[_0x528f('0x29')](_0x4a21bd[_0x528f('0x2a')]);_0x30680a[_0x528f('0x2b')]=_[_0x528f('0x2c')](_0x30680a['model'],_0x30680a[_0x528f('0x2a')]);_0x3a4993[_0x528f('0x2d')]=_[_0x528f('0x2c')](_0x30680a[_0x528f('0x28')],qs['fields'](_0x4a21bd[_0x528f('0x2a')]['fields']));_0x3a4993[_0x528f('0x2d')]=_0x3a4993[_0x528f('0x2d')][_0x528f('0x2e')]?_0x3a4993[_0x528f('0x2d')]:_0x30680a['model'];if(!_0x4a21bd[_0x528f('0x2a')][_0x528f('0x2f')](_0x528f('0x30'))){_0x3a4993[_0x528f('0x19')]=qs[_0x528f('0x19')](_0x4a21bd[_0x528f('0x2a')][_0x528f('0x19')]);_0x3a4993[_0x528f('0x18')]=qs['offset'](_0x4a21bd['query'][_0x528f('0x18')]);}_0x3a4993[_0x528f('0x31')]=qs[_0x528f('0x32')](_0x4a21bd[_0x528f('0x2a')][_0x528f('0x32')]);_0x3a4993[_0x528f('0x33')]=qs['filters'](_[_0x528f('0x34')](_0x4a21bd[_0x528f('0x2a')],_0x30680a[_0x528f('0x2b')]));if(_0x4a21bd[_0x528f('0x2a')][_0x528f('0x35')]){_0x3a4993[_0x528f('0x33')]=_[_0x528f('0x36')](_0x3a4993[_0x528f('0x33')],{'$or':_[_0x528f('0x37')](_0x132e66,function(_0x52b8da){if(_0x52b8da['type']['key']!==_0x528f('0x38')){var _0x287f81={};_0x287f81[_0x52b8da['field']]={'$like':'%'+_0x4a21bd['query']['filter']+'%'};return _0x287f81;}})});}_0x3a4993=_[_0x528f('0x36')]({},_0x3a4993,_0x4a21bd[_0x528f('0x39')]);var _0x470a5d={'where':_0x3a4993['where']};return db[_0x528f('0x26')][_0x528f('0x17')](_0x470a5d)[_0x528f('0x20')](function(_0x20be8a){_0x1bb426['count']=_0x20be8a;if(_0x4a21bd[_0x528f('0x2a')][_0x528f('0x3a')]){_0x3a4993[_0x528f('0x3b')]=[{'all':!![]}];}return db[_0x528f('0x26')][_0x528f('0x3c')](_0x3a4993);})['then'](function(_0x312632){_0x1bb426['rows']=_0x312632;return _0x1bb426;})['then'](respondWithFilteredResult(_0x4e5a68,_0x3a4993))[_0x528f('0x3d')](handleError(_0x4e5a68,null));};exports[_0x528f('0x3e')]=function(_0x2b1c2a,_0x56c459){var _0x474850={'raw':![],'where':{'id':_0x2b1c2a[_0x528f('0x3f')]['id']}},_0x33dfe6={};_0x33dfe6[_0x528f('0x28')]=_[_0x528f('0x29')](db[_0x528f('0x26')]['rawAttributes']);_0x33dfe6[_0x528f('0x2a')]=_[_0x528f('0x29')](_0x2b1c2a[_0x528f('0x2a')]);_0x33dfe6[_0x528f('0x2b')]=_['intersection'](_0x33dfe6[_0x528f('0x28')],_0x33dfe6[_0x528f('0x2a')]);_0x474850[_0x528f('0x2d')]=_['intersection'](_0x33dfe6[_0x528f('0x28')],qs[_0x528f('0x40')](_0x2b1c2a[_0x528f('0x2a')][_0x528f('0x40')]));_0x474850[_0x528f('0x2d')]=_0x474850[_0x528f('0x2d')][_0x528f('0x2e')]?_0x474850['attributes']:_0x33dfe6[_0x528f('0x28')];if(_0x2b1c2a[_0x528f('0x2a')][_0x528f('0x3a')]){_0x474850[_0x528f('0x3b')]=[{'all':!![]}];}_0x474850=_[_0x528f('0x36')]({},_0x474850,_0x2b1c2a[_0x528f('0x39')]);return db[_0x528f('0x26')][_0x528f('0x41')](_0x474850)[_0x528f('0x20')](handleEntityNotFound(_0x56c459,null))[_0x528f('0x20')](respondWithResult(_0x56c459,null))[_0x528f('0x3d')](handleError(_0x56c459,null));};exports[_0x528f('0x42')]=function(_0x261287,_0x2eadcd){return db['Automation'][_0x528f('0x42')](_0x261287['body'],{})[_0x528f('0x20')](respondWithResult(_0x2eadcd,0xc9))['catch'](handleError(_0x2eadcd,null));};exports[_0x528f('0x1e')]=function(_0x356dd9,_0x38fe06){if(_0x356dd9[_0x528f('0x43')]['id']){delete _0x356dd9[_0x528f('0x43')]['id'];}return db[_0x528f('0x26')][_0x528f('0x41')]({'where':{'id':_0x356dd9['params']['id']}})[_0x528f('0x20')](handleEntityNotFound(_0x38fe06,null))['then'](saveUpdates(_0x356dd9[_0x528f('0x43')],null))[_0x528f('0x20')](respondWithResult(_0x38fe06,null))[_0x528f('0x3d')](handleError(_0x38fe06,null));};exports[_0x528f('0x1f')]=function(_0xaceaae,_0x27fca3){return db[_0x528f('0x26')][_0x528f('0x41')]({'where':{'id':_0xaceaae[_0x528f('0x3f')]['id']}})[_0x528f('0x20')](handleEntityNotFound(_0x27fca3,null))['then'](removeEntity(_0x27fca3,null))[_0x528f('0x3d')](handleError(_0x27fca3,null));};exports[_0x528f('0x44')]=function(_0x160ec9,_0x61f804,_0x5be2ca){return db[_0x528f('0x45')][_0x528f('0x41')]({'where':{'id':_0x160ec9[_0x528f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x61f804,null))[_0x528f('0x20')](function(_0x531407){if(_0x531407){return _0x531407[_0x528f('0x44')](_0x160ec9['body'][_0x528f('0x46')],_[_0x528f('0x47')](_0x160ec9['body'],[_0x528f('0x46'),'id'])||{});}})[_0x528f('0x20')](respondWithResult(_0x61f804,null))['catch'](handleError(_0x61f804,null));};exports['getConditions']=function(_0x488d55,_0xfe7376,_0x4429dd){var _0x1b0909={};var _0x45f85f={};var _0x35d70f;var _0x47b986;return db[_0x528f('0x26')][_0x528f('0x48')]({'where':{'id':_0x488d55[_0x528f('0x3f')]['id']}})[_0x528f('0x20')](handleEntityNotFound(_0xfe7376,null))[_0x528f('0x20')](function(_0x4874ce){if(_0x4874ce){_0x35d70f=_0x4874ce;_0x45f85f['model']=_[_0x528f('0x29')](db['Condition'][_0x528f('0x27')]);_0x45f85f['query']=_[_0x528f('0x29')](_0x488d55['query']);_0x45f85f[_0x528f('0x2b')]=_['intersection'](_0x45f85f['model'],_0x45f85f[_0x528f('0x2a')]);_0x1b0909[_0x528f('0x2d')]=_[_0x528f('0x2c')](_0x45f85f[_0x528f('0x28')],qs[_0x528f('0x40')](_0x488d55[_0x528f('0x2a')][_0x528f('0x40')]));_0x1b0909['attributes']=_0x1b0909[_0x528f('0x2d')][_0x528f('0x2e')]?_0x1b0909[_0x528f('0x2d')]:_0x45f85f['model'];_0x1b0909[_0x528f('0x31')]=qs[_0x528f('0x32')](_0x488d55['query'][_0x528f('0x32')]);_0x1b0909[_0x528f('0x33')]=qs[_0x528f('0x2b')](_[_0x528f('0x34')](_0x488d55['query'],_0x45f85f[_0x528f('0x2b')]));if(_0x488d55['query']['filter']){_0x1b0909[_0x528f('0x33')]=_[_0x528f('0x36')](_0x1b0909[_0x528f('0x33')],{'$or':_[_0x528f('0x37')](_0x1b0909[_0x528f('0x2d')],function(_0xe9648f){var _0x41cb18={};_0x41cb18[_0xe9648f]={'$like':'%'+_0x488d55[_0x528f('0x2a')]['filter']+'%'};return _0x41cb18;})});}_0x1b0909=_['merge']({},_0x1b0909,_0x488d55[_0x528f('0x39')]);return _0x35d70f[_0x528f('0x49')](_0x1b0909);}})[_0x528f('0x20')](function(_0xecb2bc){if(_0xecb2bc){_0x47b986=_0xecb2bc[_0x528f('0x2e')];if(!_0x488d55[_0x528f('0x2a')][_0x528f('0x2f')]('nolimit')){_0x1b0909['limit']=qs['limit'](_0x488d55[_0x528f('0x2a')][_0x528f('0x19')]);_0x1b0909[_0x528f('0x18')]=qs[_0x528f('0x18')](_0x488d55[_0x528f('0x2a')][_0x528f('0x18')]);}return _0x35d70f['getConditions'](_0x1b0909);}})['then'](function(_0x3cdb9c){if(_0x3cdb9c){return _0x3cdb9c?{'count':_0x47b986,'rows':_0x3cdb9c}:null;}})['then'](respondWithResult(_0xfe7376,null))[_0x528f('0x3d')](handleError(_0xfe7376,null));};exports['addActions']=function(_0xa865cd,_0x32c52a,_0x6de95d){return db['Action'][_0x528f('0x41')]({'where':{'id':_0xa865cd[_0x528f('0x3f')]['id']}})[_0x528f('0x20')](handleEntityNotFound(_0x32c52a,null))[_0x528f('0x20')](function(_0x4e3b6d){if(_0x4e3b6d){return _0x4e3b6d[_0x528f('0x4a')](_0xa865cd[_0x528f('0x43')][_0x528f('0x46')],_[_0x528f('0x47')](_0xa865cd['body'],[_0x528f('0x46'),'id'])||{});}})[_0x528f('0x20')](respondWithResult(_0x32c52a,null))[_0x528f('0x3d')](handleError(_0x32c52a,null));};exports[_0x528f('0x4b')]=function(_0x1ce792,_0x2794f4,_0x388a20){var _0x4ddea3={};var _0x267b42={};var _0x31fcfa;var _0x511a04;return db['Automation'][_0x528f('0x48')]({'where':{'id':_0x1ce792[_0x528f('0x3f')]['id']}})[_0x528f('0x20')](handleEntityNotFound(_0x2794f4,null))['then'](function(_0x2b84f3){if(_0x2b84f3){_0x31fcfa=_0x2b84f3;_0x267b42[_0x528f('0x28')]=_[_0x528f('0x29')](db[_0x528f('0x4c')][_0x528f('0x27')]);_0x267b42[_0x528f('0x2a')]=_[_0x528f('0x29')](_0x1ce792[_0x528f('0x2a')]);_0x267b42['filters']=_[_0x528f('0x2c')](_0x267b42[_0x528f('0x28')],_0x267b42[_0x528f('0x2a')]);_0x4ddea3[_0x528f('0x2d')]=_[_0x528f('0x2c')](_0x267b42['model'],qs[_0x528f('0x40')](_0x1ce792[_0x528f('0x2a')][_0x528f('0x40')]));_0x4ddea3[_0x528f('0x2d')]=_0x4ddea3[_0x528f('0x2d')]['length']?_0x4ddea3['attributes']:_0x267b42[_0x528f('0x28')];_0x4ddea3[_0x528f('0x31')]=qs[_0x528f('0x32')](_0x1ce792['query'][_0x528f('0x32')]);_0x4ddea3['where']=qs[_0x528f('0x2b')](_[_0x528f('0x34')](_0x1ce792[_0x528f('0x2a')],_0x267b42[_0x528f('0x2b')]));if(_0x1ce792['query']['filter']){_0x4ddea3[_0x528f('0x33')]=_[_0x528f('0x36')](_0x4ddea3[_0x528f('0x33')],{'$or':_[_0x528f('0x37')](_0x4ddea3[_0x528f('0x2d')],function(_0x3ad914){var _0x1a064e={};_0x1a064e[_0x3ad914]={'$like':'%'+_0x1ce792[_0x528f('0x2a')][_0x528f('0x35')]+'%'};return _0x1a064e;})});}_0x4ddea3=_['merge']({},_0x4ddea3,_0x1ce792['options']);return _0x31fcfa['getActions'](_0x4ddea3);}})['then'](function(_0xc268d9){if(_0xc268d9){_0x511a04=_0xc268d9[_0x528f('0x2e')];if(!_0x1ce792[_0x528f('0x2a')][_0x528f('0x2f')](_0x528f('0x30'))){_0x4ddea3[_0x528f('0x19')]=qs['limit'](_0x1ce792[_0x528f('0x2a')][_0x528f('0x19')]);_0x4ddea3[_0x528f('0x18')]=qs['offset'](_0x1ce792[_0x528f('0x2a')]['offset']);}return _0x31fcfa[_0x528f('0x4b')](_0x4ddea3);}})[_0x528f('0x20')](function(_0x1b4cf1){if(_0x1b4cf1){return _0x1b4cf1?{'count':_0x511a04,'rows':_0x1b4cf1}:null;}})['then'](respondWithResult(_0x2794f4,null))[_0x528f('0x3d')](handleError(_0x2794f4,null));}; \ No newline at end of file +var _0x9b79=['options','include','catch','params','includeAll','find','create','body','update','addConditions','ids','getConditions','findOne','Condition','addActions','Action','getActions','pick','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','json','reject','save','then','destroy','sendStatus','error','name','send','index','Automation','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','map','key','VIRTUAL','field','merge'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9b79,0x143));var _0x99b7=function(_0x7a9beb,_0x4fc7a4){_0x7a9beb=_0x7a9beb-0x0;var _0x43533e=_0x9b79[_0x7a9beb];return _0x43533e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x99b7('0x0'));var rimraf=require(_0x99b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b7('0x2'));var rp=require(_0x99b7('0x3'));var moment=require('moment');var BPromise=require(_0x99b7('0x4'));var Mustache=require(_0x99b7('0x5'));var util=require('util');var path=require(_0x99b7('0x6'));var sox=require(_0x99b7('0x7'));var csv=require(_0x99b7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x99b7('0x9'));var crypto=require(_0x99b7('0xa'));var jsforce=require(_0x99b7('0xb'));var deskjs=require(_0x99b7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x99b7('0xd'));var Papa=require(_0x99b7('0xe'));var Redis=require(_0x99b7('0xf'));var authService=require(_0x99b7('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99b7('0x11'))(_0x99b7('0x12'));var utils=require(_0x99b7('0x13'));var config=require('../../config/environment');var db=require(_0x99b7('0x14'))['db'];function respondWithStatusCode(_0x51a2ca,_0x1763ac){_0x1763ac=_0x1763ac||0xcc;return function(_0x25245e){if(_0x25245e){return _0x51a2ca['sendStatus'](_0x1763ac);}return _0x51a2ca[_0x99b7('0x15')](_0x1763ac)[_0x99b7('0x16')]();};}function respondWithResult(_0x109eb9,_0x5cf89b){_0x5cf89b=_0x5cf89b||0xc8;return function(_0x56ce92){if(_0x56ce92){return _0x109eb9[_0x99b7('0x15')](_0x5cf89b)['json'](_0x56ce92);}};}function respondWithFilteredResult(_0x2ff833,_0x35d5e7){return function(_0x285181){if(_0x285181){var _0x56eeac=_0x285181[_0x99b7('0x17')],_0x289bad=_0x35d5e7[_0x99b7('0x18')],_0x52a58f=_0x35d5e7[_0x99b7('0x18')]+_0x35d5e7[_0x99b7('0x19')],_0x3ce9fb;if(_0x52a58f>=_0x56eeac){_0x52a58f=_0x56eeac;_0x3ce9fb=0xc8;}else{_0x3ce9fb=0xce;}_0x2ff833[_0x99b7('0x15')](_0x3ce9fb);return _0x2ff833[_0x99b7('0x1a')]('Content-Range',_0x289bad+'-'+_0x52a58f+'/'+_0x56eeac)[_0x99b7('0x1b')](_0x285181);}return null;};}function patchUpdates(_0x54dd2b){return function(_0xdfbec1){try{jsonpatch['apply'](_0xdfbec1,_0x54dd2b,!![]);}catch(_0x2dba04){return BPromise[_0x99b7('0x1c')](_0x2dba04);}return _0xdfbec1[_0x99b7('0x1d')]();};}function saveUpdates(_0x4c283d,_0x12bfa5){return function(_0x44e429){if(_0x44e429){return _0x44e429['update'](_0x4c283d)[_0x99b7('0x1e')](function(_0x30d442){return _0x30d442;});}return null;};}function removeEntity(_0x15646f,_0x48b971){return function(_0x4139f1){if(_0x4139f1){return _0x4139f1[_0x99b7('0x1f')]()[_0x99b7('0x1e')](function(){_0x15646f[_0x99b7('0x15')](0xcc)[_0x99b7('0x16')]();});}};}function handleEntityNotFound(_0x3b157b,_0x672cae){return function(_0x4b157c){if(!_0x4b157c){_0x3b157b[_0x99b7('0x20')](0x194);}return _0x4b157c;};}function handleError(_0x3695c7,_0x510114){_0x510114=_0x510114||0x1f4;return function(_0x1b1584){logger[_0x99b7('0x21')](_0x1b1584['stack']);if(_0x1b1584[_0x99b7('0x22')]){delete _0x1b1584[_0x99b7('0x22')];}_0x3695c7['status'](_0x510114)[_0x99b7('0x23')](_0x1b1584);};}exports[_0x99b7('0x24')]=function(_0x82d9dc,_0x512b93){var _0x55f523={},_0x5e2c91={},_0x404910={'count':0x0,'rows':[]};var _0x370078=db[_0x99b7('0x25')][_0x99b7('0x26')];_0x5e2c91[_0x99b7('0x27')]=_[_0x99b7('0x28')](_0x370078);_0x5e2c91[_0x99b7('0x29')]=_[_0x99b7('0x28')](_0x82d9dc[_0x99b7('0x29')]);_0x5e2c91['filters']=_[_0x99b7('0x2a')](_0x5e2c91[_0x99b7('0x27')],_0x5e2c91[_0x99b7('0x29')]);_0x55f523[_0x99b7('0x2b')]=_[_0x99b7('0x2a')](_0x5e2c91[_0x99b7('0x27')],qs['fields'](_0x82d9dc[_0x99b7('0x29')][_0x99b7('0x2c')]));_0x55f523[_0x99b7('0x2b')]=_0x55f523[_0x99b7('0x2b')][_0x99b7('0x2d')]?_0x55f523[_0x99b7('0x2b')]:_0x5e2c91['model'];if(!_0x82d9dc[_0x99b7('0x29')]['hasOwnProperty'](_0x99b7('0x2e'))){_0x55f523[_0x99b7('0x19')]=qs[_0x99b7('0x19')](_0x82d9dc['query']['limit']);_0x55f523[_0x99b7('0x18')]=qs[_0x99b7('0x18')](_0x82d9dc[_0x99b7('0x29')][_0x99b7('0x18')]);}_0x55f523[_0x99b7('0x2f')]=qs['sort'](_0x82d9dc[_0x99b7('0x29')][_0x99b7('0x30')]);_0x55f523['where']=qs[_0x99b7('0x31')](_['pick'](_0x82d9dc[_0x99b7('0x29')],_0x5e2c91[_0x99b7('0x31')]));if(_0x82d9dc[_0x99b7('0x29')][_0x99b7('0x32')]){_0x55f523[_0x99b7('0x33')]=_['merge'](_0x55f523[_0x99b7('0x33')],{'$or':_[_0x99b7('0x34')](_0x370078,function(_0x25ab46){if(_0x25ab46['type'][_0x99b7('0x35')]!==_0x99b7('0x36')){var _0x407c31={};_0x407c31[_0x25ab46[_0x99b7('0x37')]]={'$like':'%'+_0x82d9dc[_0x99b7('0x29')][_0x99b7('0x32')]+'%'};return _0x407c31;}})});}_0x55f523=_[_0x99b7('0x38')]({},_0x55f523,_0x82d9dc[_0x99b7('0x39')]);var _0x21a9db={'where':_0x55f523[_0x99b7('0x33')]};return db[_0x99b7('0x25')][_0x99b7('0x17')](_0x21a9db)[_0x99b7('0x1e')](function(_0x200330){_0x404910['count']=_0x200330;if(_0x82d9dc[_0x99b7('0x29')]['includeAll']){_0x55f523[_0x99b7('0x3a')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x55f523);})[_0x99b7('0x1e')](function(_0x275922){_0x404910['rows']=_0x275922;return _0x404910;})['then'](respondWithFilteredResult(_0x512b93,_0x55f523))[_0x99b7('0x3b')](handleError(_0x512b93,null));};exports['show']=function(_0x6c285a,_0x111c95){var _0x3c8853={'raw':![],'where':{'id':_0x6c285a[_0x99b7('0x3c')]['id']}},_0xc9e401={};_0xc9e401[_0x99b7('0x27')]=_[_0x99b7('0x28')](db[_0x99b7('0x25')][_0x99b7('0x26')]);_0xc9e401[_0x99b7('0x29')]=_[_0x99b7('0x28')](_0x6c285a[_0x99b7('0x29')]);_0xc9e401[_0x99b7('0x31')]=_[_0x99b7('0x2a')](_0xc9e401['model'],_0xc9e401[_0x99b7('0x29')]);_0x3c8853[_0x99b7('0x2b')]=_[_0x99b7('0x2a')](_0xc9e401['model'],qs[_0x99b7('0x2c')](_0x6c285a[_0x99b7('0x29')]['fields']));_0x3c8853[_0x99b7('0x2b')]=_0x3c8853[_0x99b7('0x2b')][_0x99b7('0x2d')]?_0x3c8853[_0x99b7('0x2b')]:_0xc9e401['model'];if(_0x6c285a[_0x99b7('0x29')][_0x99b7('0x3d')]){_0x3c8853[_0x99b7('0x3a')]=[{'all':!![]}];}_0x3c8853=_['merge']({},_0x3c8853,_0x6c285a[_0x99b7('0x39')]);return db[_0x99b7('0x25')][_0x99b7('0x3e')](_0x3c8853)[_0x99b7('0x1e')](handleEntityNotFound(_0x111c95,null))[_0x99b7('0x1e')](respondWithResult(_0x111c95,null))[_0x99b7('0x3b')](handleError(_0x111c95,null));};exports[_0x99b7('0x3f')]=function(_0x224a8a,_0x42b0c2){return db[_0x99b7('0x25')][_0x99b7('0x3f')](_0x224a8a[_0x99b7('0x40')],{})['then'](respondWithResult(_0x42b0c2,0xc9))[_0x99b7('0x3b')](handleError(_0x42b0c2,null));};exports[_0x99b7('0x41')]=function(_0x5875f7,_0x44e9b6){if(_0x5875f7[_0x99b7('0x40')]['id']){delete _0x5875f7[_0x99b7('0x40')]['id'];}return db[_0x99b7('0x25')][_0x99b7('0x3e')]({'where':{'id':_0x5875f7[_0x99b7('0x3c')]['id']}})[_0x99b7('0x1e')](handleEntityNotFound(_0x44e9b6,null))[_0x99b7('0x1e')](saveUpdates(_0x5875f7[_0x99b7('0x40')],null))['then'](respondWithResult(_0x44e9b6,null))[_0x99b7('0x3b')](handleError(_0x44e9b6,null));};exports[_0x99b7('0x1f')]=function(_0xf222fc,_0x30b7ee){return db[_0x99b7('0x25')][_0x99b7('0x3e')]({'where':{'id':_0xf222fc['params']['id']}})[_0x99b7('0x1e')](handleEntityNotFound(_0x30b7ee,null))[_0x99b7('0x1e')](removeEntity(_0x30b7ee,null))[_0x99b7('0x3b')](handleError(_0x30b7ee,null));};exports[_0x99b7('0x42')]=function(_0x1d0fe7,_0x16e640,_0x372f84){return db['Condition'][_0x99b7('0x3e')]({'where':{'id':_0x1d0fe7[_0x99b7('0x3c')]['id']}})[_0x99b7('0x1e')](handleEntityNotFound(_0x16e640,null))[_0x99b7('0x1e')](function(_0x450664){if(_0x450664){return _0x450664[_0x99b7('0x42')](_0x1d0fe7[_0x99b7('0x40')][_0x99b7('0x43')],_['omit'](_0x1d0fe7[_0x99b7('0x40')],[_0x99b7('0x43'),'id'])||{});}})['then'](respondWithResult(_0x16e640,null))[_0x99b7('0x3b')](handleError(_0x16e640,null));};exports[_0x99b7('0x44')]=function(_0x2d6580,_0x3a4bb5,_0x165872){var _0x40b72a={};var _0x4ea1f7={};var _0x325cff;var _0xccb949;return db[_0x99b7('0x25')][_0x99b7('0x45')]({'where':{'id':_0x2d6580[_0x99b7('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3a4bb5,null))[_0x99b7('0x1e')](function(_0x5c6da5){if(_0x5c6da5){_0x325cff=_0x5c6da5;_0x4ea1f7[_0x99b7('0x27')]=_[_0x99b7('0x28')](db[_0x99b7('0x46')][_0x99b7('0x26')]);_0x4ea1f7[_0x99b7('0x29')]=_[_0x99b7('0x28')](_0x2d6580[_0x99b7('0x29')]);_0x4ea1f7['filters']=_[_0x99b7('0x2a')](_0x4ea1f7['model'],_0x4ea1f7[_0x99b7('0x29')]);_0x40b72a[_0x99b7('0x2b')]=_['intersection'](_0x4ea1f7[_0x99b7('0x27')],qs['fields'](_0x2d6580[_0x99b7('0x29')][_0x99b7('0x2c')]));_0x40b72a[_0x99b7('0x2b')]=_0x40b72a[_0x99b7('0x2b')][_0x99b7('0x2d')]?_0x40b72a[_0x99b7('0x2b')]:_0x4ea1f7['model'];_0x40b72a['order']=qs[_0x99b7('0x30')](_0x2d6580['query'][_0x99b7('0x30')]);_0x40b72a[_0x99b7('0x33')]=qs['filters'](_['pick'](_0x2d6580[_0x99b7('0x29')],_0x4ea1f7[_0x99b7('0x31')]));if(_0x2d6580[_0x99b7('0x29')][_0x99b7('0x32')]){_0x40b72a['where']=_['merge'](_0x40b72a[_0x99b7('0x33')],{'$or':_[_0x99b7('0x34')](_0x40b72a[_0x99b7('0x2b')],function(_0x1d6c20){var _0x46e5e2={};_0x46e5e2[_0x1d6c20]={'$like':'%'+_0x2d6580[_0x99b7('0x29')]['filter']+'%'};return _0x46e5e2;})});}_0x40b72a=_[_0x99b7('0x38')]({},_0x40b72a,_0x2d6580[_0x99b7('0x39')]);return _0x325cff['getConditions'](_0x40b72a);}})[_0x99b7('0x1e')](function(_0x38ec7e){if(_0x38ec7e){_0xccb949=_0x38ec7e['length'];if(!_0x2d6580[_0x99b7('0x29')]['hasOwnProperty'](_0x99b7('0x2e'))){_0x40b72a['limit']=qs[_0x99b7('0x19')](_0x2d6580['query'][_0x99b7('0x19')]);_0x40b72a[_0x99b7('0x18')]=qs[_0x99b7('0x18')](_0x2d6580[_0x99b7('0x29')][_0x99b7('0x18')]);}return _0x325cff[_0x99b7('0x44')](_0x40b72a);}})[_0x99b7('0x1e')](function(_0x391bd1){if(_0x391bd1){return _0x391bd1?{'count':_0xccb949,'rows':_0x391bd1}:null;}})[_0x99b7('0x1e')](respondWithResult(_0x3a4bb5,null))['catch'](handleError(_0x3a4bb5,null));};exports[_0x99b7('0x47')]=function(_0x59061e,_0x483dfe,_0x14cf62){return db[_0x99b7('0x48')][_0x99b7('0x3e')]({'where':{'id':_0x59061e[_0x99b7('0x3c')]['id']}})['then'](handleEntityNotFound(_0x483dfe,null))[_0x99b7('0x1e')](function(_0x4975e3){if(_0x4975e3){return _0x4975e3[_0x99b7('0x47')](_0x59061e['body'][_0x99b7('0x43')],_['omit'](_0x59061e[_0x99b7('0x40')],[_0x99b7('0x43'),'id'])||{});}})[_0x99b7('0x1e')](respondWithResult(_0x483dfe,null))[_0x99b7('0x3b')](handleError(_0x483dfe,null));};exports[_0x99b7('0x49')]=function(_0x15d9f2,_0x490179,_0xeb7a30){var _0x47ab3={};var _0x546c8e={};var _0x5eb725;var _0xd783fa;return db[_0x99b7('0x25')][_0x99b7('0x45')]({'where':{'id':_0x15d9f2['params']['id']}})[_0x99b7('0x1e')](handleEntityNotFound(_0x490179,null))[_0x99b7('0x1e')](function(_0x45e146){if(_0x45e146){_0x5eb725=_0x45e146;_0x546c8e['model']=_[_0x99b7('0x28')](db['Action']['rawAttributes']);_0x546c8e[_0x99b7('0x29')]=_[_0x99b7('0x28')](_0x15d9f2[_0x99b7('0x29')]);_0x546c8e[_0x99b7('0x31')]=_[_0x99b7('0x2a')](_0x546c8e[_0x99b7('0x27')],_0x546c8e['query']);_0x47ab3[_0x99b7('0x2b')]=_[_0x99b7('0x2a')](_0x546c8e[_0x99b7('0x27')],qs[_0x99b7('0x2c')](_0x15d9f2['query'][_0x99b7('0x2c')]));_0x47ab3[_0x99b7('0x2b')]=_0x47ab3[_0x99b7('0x2b')][_0x99b7('0x2d')]?_0x47ab3[_0x99b7('0x2b')]:_0x546c8e[_0x99b7('0x27')];_0x47ab3['order']=qs[_0x99b7('0x30')](_0x15d9f2[_0x99b7('0x29')]['sort']);_0x47ab3['where']=qs['filters'](_[_0x99b7('0x4a')](_0x15d9f2[_0x99b7('0x29')],_0x546c8e[_0x99b7('0x31')]));if(_0x15d9f2[_0x99b7('0x29')]['filter']){_0x47ab3['where']=_[_0x99b7('0x38')](_0x47ab3['where'],{'$or':_[_0x99b7('0x34')](_0x47ab3[_0x99b7('0x2b')],function(_0xe60ccc){var _0xd0e293={};_0xd0e293[_0xe60ccc]={'$like':'%'+_0x15d9f2[_0x99b7('0x29')]['filter']+'%'};return _0xd0e293;})});}_0x47ab3=_[_0x99b7('0x38')]({},_0x47ab3,_0x15d9f2[_0x99b7('0x39')]);return _0x5eb725[_0x99b7('0x49')](_0x47ab3);}})['then'](function(_0x743db3){if(_0x743db3){_0xd783fa=_0x743db3[_0x99b7('0x2d')];if(!_0x15d9f2[_0x99b7('0x29')][_0x99b7('0x4b')]('nolimit')){_0x47ab3[_0x99b7('0x19')]=qs[_0x99b7('0x19')](_0x15d9f2[_0x99b7('0x29')][_0x99b7('0x19')]);_0x47ab3[_0x99b7('0x18')]=qs[_0x99b7('0x18')](_0x15d9f2[_0x99b7('0x29')][_0x99b7('0x18')]);}return _0x5eb725[_0x99b7('0x49')](_0x47ab3);}})[_0x99b7('0x1e')](function(_0x5a32e7){if(_0x5a32e7){return _0x5a32e7?{'count':_0xd783fa,'rows':_0x5a32e7}:null;}})[_0x99b7('0x1e')](respondWithResult(_0x490179,null))[_0x99b7('0x3b')](handleError(_0x490179,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c46171f..34ccbd0 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 _0x7038=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','tools_automations'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x7038,0x1c3));var _0x8703=function(_0x1ed55c,_0x59a37a){_0x1ed55c=_0x1ed55c-0x0;var _0x2dee95=_0x7038[_0x1ed55c];return _0x2dee95;};'use strict';var _=require(_0x8703('0x0'));var util=require(_0x8703('0x1'));var logger=require('../../config/logger')(_0x8703('0x2'));var moment=require(_0x8703('0x3'));var BPromise=require(_0x8703('0x4'));var rp=require(_0x8703('0x5'));var fs=require('fs');var path=require(_0x8703('0x6'));var rimraf=require(_0x8703('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x8703('0x8')]=function(_0x1270da,_0x303d25){return _0x1270da[_0x8703('0x9')]('Automation',attributes,{'tableName':_0x8703('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x983f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x983f,0x98));var _0xf983=function(_0x1209dc,_0x34ad47){_0x1209dc=_0x1209dc-0x0;var _0x76520f=_0x983f[_0x1209dc];return _0x76520f;};'use strict';var _=require(_0xf983('0x0'));var util=require(_0xf983('0x1'));var logger=require('../../config/logger')(_0xf983('0x2'));var moment=require(_0xf983('0x3'));var BPromise=require(_0xf983('0x4'));var rp=require(_0xf983('0x5'));var fs=require('fs');var path=require(_0xf983('0x6'));var rimraf=require(_0xf983('0x7'));var config=require(_0xf983('0x8'));var attributes=require(_0xf983('0x9'));module['exports']=function(_0x2ab5e1,_0x1ce88e){return _0x2ab5e1['define'](_0xf983('0xa'),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 3a7f78c..77da7ba 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 _0x1107=['request\x20sent','debug','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1107,0xd8));var _0x7110=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x1107[_0x108d5f];return _0x456ea3;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var moment=require(_0x7110('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7110('0x3'));var db=require(_0x7110('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7110('0x5'))(_0x7110('0x6'));var config=require(_0x7110('0x7'));var jayson=require(_0x7110('0x8'));var client=jayson[_0x7110('0x9')][_0x7110('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b340,_0xe978a,_0x10df10){return new BPromise(function(_0x3925e6,_0x129706){return client[_0x7110('0xb')](_0x38b340,_0x10df10)[_0x7110('0xc')](function(_0x4960b1){logger[_0x7110('0xd')]('Automation,\x20%s,\x20%s',_0xe978a,_0x7110('0xe'));logger[_0x7110('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0xe978a,_0x7110('0xe'),JSON[_0x7110('0x10')](_0x4960b1));if(_0x4960b1[_0x7110('0x11')]){if(_0x4960b1[_0x7110('0x11')][_0x7110('0x12')]===0x1f4){logger[_0x7110('0x11')](_0x7110('0x13'),_0xe978a,_0x4960b1[_0x7110('0x11')][_0x7110('0x14')]);return _0x129706(_0x4960b1['error'][_0x7110('0x14')]);}logger['error'](_0x7110('0x13'),_0xe978a,_0x4960b1['error'][_0x7110('0x14')]);return _0x3925e6(_0x4960b1[_0x7110('0x11')][_0x7110('0x14')]);}else{logger[_0x7110('0xd')](_0x7110('0x13'),_0xe978a,_0x7110('0xe'));_0x3925e6(_0x4960b1[_0x7110('0x15')]['message']);}})[_0x7110('0x16')](function(_0x5cb6f4){logger[_0x7110('0x11')](_0x7110('0x13'),_0xe978a,_0x5cb6f4);_0x129706(_0x5cb6f4);});});} \ No newline at end of file +var _0x9df6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Automation,\x20%s,\x20%s','util','moment'];(function(_0x36cbba,_0x5b3ffa){var _0x33d4d3=function(_0x484737){while(--_0x484737){_0x36cbba['push'](_0x36cbba['shift']());}};_0x33d4d3(++_0x5b3ffa);}(_0x9df6,0xe2));var _0x69df=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x9df6[_0x3635ce];return _0x97ecd0;};'use strict';var _=require('lodash');var util=require(_0x69df('0x0'));var moment=require(_0x69df('0x1'));var BPromise=require('bluebird');var rs=require(_0x69df('0x2'));var fs=require('fs');var Redis=require(_0x69df('0x3'));var db=require(_0x69df('0x4'))['db'];var utils=require(_0x69df('0x5'));var logger=require('../../config/logger')(_0x69df('0x6'));var config=require(_0x69df('0x7'));var jayson=require(_0x69df('0x8'));var client=jayson[_0x69df('0x9')][_0x69df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7567,_0x462c34,_0xe8d968){return new BPromise(function(_0x485636,_0x5b3fcb){return client['request'](_0x5a7567,_0xe8d968)[_0x69df('0xb')](function(_0x593bae){logger['info']('Automation,\x20%s,\x20%s',_0x462c34,'request\x20sent');logger[_0x69df('0xc')](_0x69df('0xd'),_0x462c34,_0x69df('0xe'),JSON[_0x69df('0xf')](_0x593bae));if(_0x593bae[_0x69df('0x10')]){if(_0x593bae[_0x69df('0x10')]['code']===0x1f4){logger[_0x69df('0x10')]('Automation,\x20%s,\x20%s',_0x462c34,_0x593bae['error']['message']);return _0x5b3fcb(_0x593bae['error'][_0x69df('0x11')]);}logger[_0x69df('0x10')]('Automation,\x20%s,\x20%s',_0x462c34,_0x593bae[_0x69df('0x10')]['message']);return _0x485636(_0x593bae[_0x69df('0x10')][_0x69df('0x11')]);}else{logger['info'](_0x69df('0x12'),_0x462c34,_0x69df('0xe'));_0x485636(_0x593bae['result']['message']);}})['catch'](function(_0x4b43f6){logger['error'](_0x69df('0x12'),_0x462c34,_0x4b43f6);_0x5b3fcb(_0x4b43f6);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 471d3a2..7686d14 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 _0xe65d=['../../components/interaction/service','../../config/environment','index','/:id','get','/:id/conditions','isAuthenticated','getConditions','getActions','create','post','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x314199,_0x43383f){var _0x578512=function(_0x1d06fa){while(--_0x1d06fa){_0x314199['push'](_0x314199['shift']());}};_0x578512(++_0x43383f);}(_0xe65d,0x90));var _0xde65=function(_0x2b02e9,_0x395d58){_0x2b02e9=_0x2b02e9-0x0;var _0x5c2caa=_0xe65d[_0x2b02e9];return _0x5c2caa;};'use strict';var multer=require(_0xde65('0x0'));var util=require(_0xde65('0x1'));var path=require(_0xde65('0x2'));var timeout=require(_0xde65('0x3'));var express=require(_0xde65('0x4'));var router=express[_0xde65('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xde65('0x6'));var config=require(_0xde65('0x7'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xde65('0x8')]);router['get'](_0xde65('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xde65('0xa')](_0xde65('0xb'),auth[_0xde65('0xc')](),controller[_0xde65('0xd')]);router['get']('/:id/actions',auth[_0xde65('0xc')](),controller[_0xde65('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xde65('0xf')]);router[_0xde65('0x10')](_0xde65('0xb'),auth['isAuthenticated'](),controller[_0xde65('0x11')]);router[_0xde65('0x10')](_0xde65('0x12'),auth[_0xde65('0xc')](),controller[_0xde65('0x13')]);router[_0xde65('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xde65('0x15')]);router[_0xde65('0x16')](_0xde65('0x9'),auth[_0xde65('0xc')](),controller[_0xde65('0x17')]);module[_0xde65('0x18')]=router; \ No newline at end of file +var _0x9e31=['index','/:id','show','/:id/actions','getActions','create','/:id/conditions','addConditions','post','addActions','put','update','delete','destroy','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x255d92,_0x593f1f){var _0x2e518a=function(_0x4461d0){while(--_0x4461d0){_0x255d92['push'](_0x255d92['shift']());}};_0x2e518a(++_0x593f1f);}(_0x9e31,0x7c));var _0x19e3=function(_0x4533d2,_0x286fa0){_0x4533d2=_0x4533d2-0x0;var _0xc2f27d=_0x9e31[_0x4533d2];return _0xc2f27d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x19e3('0x0'));var router=express[_0x19e3('0x1')]();var auth=require(_0x19e3('0x2'));var interaction=require(_0x19e3('0x3'));var config=require(_0x19e3('0x4'));var controller=require(_0x19e3('0x5'));router[_0x19e3('0x6')]('/',auth[_0x19e3('0x7')](),controller[_0x19e3('0x8')]);router['get'](_0x19e3('0x9'),auth[_0x19e3('0x7')](),controller[_0x19e3('0xa')]);router[_0x19e3('0x6')]('/:id/conditions',auth[_0x19e3('0x7')](),controller['getConditions']);router[_0x19e3('0x6')](_0x19e3('0xb'),auth['isAuthenticated'](),controller[_0x19e3('0xc')]);router['post']('/',auth[_0x19e3('0x7')](),controller[_0x19e3('0xd')]);router['post'](_0x19e3('0xe'),auth[_0x19e3('0x7')](),controller[_0x19e3('0xf')]);router[_0x19e3('0x10')]('/:id/actions',auth[_0x19e3('0x7')](),controller[_0x19e3('0x11')]);router[_0x19e3('0x12')](_0x19e3('0x9'),auth[_0x19e3('0x7')](),controller[_0x19e3('0x13')]);router[_0x19e3('0x14')](_0x19e3('0x9'),auth['isAuthenticated'](),controller[_0x19e3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 319a004..a084539 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 _0x4860=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','DESC','ASC','sequelize','exports','STRING','name'];(function(_0x103079,_0x511a5b){var _0x18f2bc=function(_0x130cc1){while(--_0x130cc1){_0x103079['push'](_0x103079['shift']());}};_0x18f2bc(++_0x511a5b);}(_0x4860,0x83));var _0x0486=function(_0x2fa912,_0x284fb8){_0x2fa912=_0x2fa912-0x0;var _0x51a7cb=_0x4860[_0x2fa912];return _0x51a7cb;};'use strict';var Sequelize=require(_0x0486('0x0'));module[_0x0486('0x1')]={'name':{'type':Sequelize[_0x0486('0x2')],'unique':_0x0486('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0486('0x4')](_0x0486('0x5')),'allowNull':![],'defaultValue':_0x0486('0x5')},'description':{'type':Sequelize[_0x0486('0x2')]},'active':{'type':Sequelize[_0x0486('0x6')],'defaultValue':0x0,'comment':_0x0486('0x7')},'limitCalls':{'type':Sequelize[_0x0486('0x8')](0x4)[_0x0486('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0486('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0486('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0486('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0486('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0486('0x8')](0x3)[_0x0486('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0486('0x8')](0x5)[_0x0486('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0486('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x0486('0x8')](0x3)[_0x0486('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0486('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0486('0x8')](0x3)[_0x0486('0x9')],'defaultValue':0x3,'comment':_0x0486('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0486('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0486('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0486('0xe')},'dialTimezone':{'type':Sequelize[_0x0486('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0486('0x2')],'defaultValue':_0x0486('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0486('0x4')]('always',_0x0486('0x10'),_0x0486('0x11')),'defaultValue':_0x0486('0x12')},'dialAMDActive':{'type':Sequelize[_0x0486('0x6')],'defaultValue':0x0,'comment':_0x0486('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0486('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0486('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0486('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0486('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0486('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x0486('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0486('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0486('0x8')](0x9)[_0x0486('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0486('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0486('0x8')](0x9)[_0x0486('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0486('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0486('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0486('0x4')](_0x0486('0x19'),_0x0486('0x1a')),'defaultValue':_0x0486('0x19')},'dialPrefix':{'type':Sequelize[_0x0486('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0486('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0486('0x8')](0x3)[_0x0486('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file +var _0x87da=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name'];(function(_0x3dcfd9,_0x231da5){var _0x4e76cc=function(_0x4d1214){while(--_0x4d1214){_0x3dcfd9['push'](_0x3dcfd9['shift']());}};_0x4e76cc(++_0x231da5);}(_0x87da,0xf4));var _0xa87d=function(_0x2492b0,_0x4110eb){_0x2492b0=_0x2492b0-0x0;var _0x4a30b8=_0x87da[_0x2492b0];return _0x4a30b8;};'use strict';var Sequelize=require(_0xa87d('0x0'));module[_0xa87d('0x1')]={'name':{'type':Sequelize[_0xa87d('0x2')],'unique':_0xa87d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa87d('0x4')](_0xa87d('0x5')),'allowNull':![],'defaultValue':_0xa87d('0x5')},'description':{'type':Sequelize[_0xa87d('0x2')]},'active':{'type':Sequelize[_0xa87d('0x6')],'defaultValue':0x0,'comment':_0xa87d('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa87d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa87d('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa87d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa87d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa87d('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa87d('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa87d('0xa')](0x5)[_0xa87d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa87d('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'defaultValue':0x3,'comment':_0xa87d('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa87d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa87d('0xf')},'dialTimezone':{'type':Sequelize[_0xa87d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xa87d('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa87d('0x11'),_0xa87d('0x12'),'onlyIfOpen'),'defaultValue':_0xa87d('0x11')},'dialAMDActive':{'type':Sequelize[_0xa87d('0x6')],'defaultValue':0x0,'comment':_0xa87d('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa87d('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa87d('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa87d('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa87d('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa87d('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa87d('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa87d('0xa')](0x5)[_0xa87d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa87d('0xa')](0x9)[_0xa87d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa87d('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa87d('0x1b'),_0xa87d('0x1c')),'defaultValue':_0xa87d('0x1b')},'dialPrefix':{'type':Sequelize[_0xa87d('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa87d('0xa')](0x3)[_0xa87d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa87d('0x1d')},'dialCutDigit':{'type':Sequelize[_0xa87d('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa87d('0x1e')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4a32bc2..16f232d 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 _0x22fb=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','field','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','find','omit','updatedAt','createdAt','role','autoAssociation','getHoppers','findOne','CmHopper','length','map','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','NOW()','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?','onlyIfOpen','scheduledAt','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','fast-json-patch','request-promise'];(function(_0x5ecff9,_0x473070){var _0x5e1415=function(_0x3c34a1){while(--_0x3c34a1){_0x5ecff9['push'](_0x5ecff9['shift']());}};_0x5e1415(++_0x473070);}(_0x22fb,0x192));var _0xb22f=function(_0x2e8292,_0x4be6ab){_0x2e8292=_0x2e8292-0x0;var _0xd4d0f=_0x22fb[_0x2e8292];return _0xd4d0f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb22f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb22f('0x1'));var rp=require(_0xb22f('0x2'));var moment=require(_0xb22f('0x3'));var BPromise=require(_0xb22f('0x4'));var Mustache=require(_0xb22f('0x5'));var util=require('util');var path=require(_0xb22f('0x6'));var sox=require(_0xb22f('0x7'));var csv=require(_0xb22f('0x8'));var ejs=require(_0xb22f('0x9'));var fs=require('fs');var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x8'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var hardwareService=require(_0xb22f('0x13'));var logger=require(_0xb22f('0x14'))(_0xb22f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1caf67,_0x4923d3){_0x4923d3=_0x4923d3||0xcc;return function(_0x4bb02a){if(_0x4bb02a){return _0x1caf67['sendStatus'](_0x4923d3);}return _0x1caf67[_0xb22f('0x16')](_0x4923d3)[_0xb22f('0x17')]();};}function respondWithResult(_0x4ae6bb,_0x2f046d){_0x2f046d=_0x2f046d||0xc8;return function(_0x390c53){if(_0x390c53){return _0x4ae6bb[_0xb22f('0x16')](_0x2f046d)['json'](_0x390c53);}};}function respondWithFilteredResult(_0x318a39,_0x5f1590){return function(_0x36e2a8){if(_0x36e2a8){var _0x4f9108=_0x36e2a8[_0xb22f('0x18')],_0x2187fc=_0x5f1590[_0xb22f('0x19')],_0x514a8f=_0x5f1590['offset']+_0x5f1590[_0xb22f('0x1a')],_0x160417;if(_0x514a8f>=_0x4f9108){_0x514a8f=_0x4f9108;_0x160417=0xc8;}else{_0x160417=0xce;}_0x318a39['status'](_0x160417);return _0x318a39[_0xb22f('0x1b')](_0xb22f('0x1c'),_0x2187fc+'-'+_0x514a8f+'/'+_0x4f9108)[_0xb22f('0x1d')](_0x36e2a8);}return null;};}function patchUpdates(_0x1f515d){return function(_0x139bb6){try{jsonpatch[_0xb22f('0x1e')](_0x139bb6,_0x1f515d,!![]);}catch(_0x5c843b){return BPromise[_0xb22f('0x1f')](_0x5c843b);}return _0x139bb6['save']();};}function saveUpdates(_0x3e05ce,_0x3878d8){return function(_0x316f11){if(_0x316f11){return _0x316f11[_0xb22f('0x20')](_0x3e05ce)[_0xb22f('0x21')](function(_0x4bbb12){return _0x4bbb12;});}return null;};}function removeEntity(_0x47d5cf,_0x3da442){return function(_0x19e480){if(_0x19e480){return _0x19e480[_0xb22f('0x22')]()[_0xb22f('0x21')](function(){var _0x39c05a=_0x19e480[_0xb22f('0x23')]({'plain':!![]});var _0x201764=_0xb22f('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x201764,'resourceId':_0x39c05a['id']}})[_0xb22f('0x21')](function(){return _0x19e480;});})[_0xb22f('0x21')](function(){_0x47d5cf['status'](0xcc)[_0xb22f('0x17')]();});}};}function handleEntityNotFound(_0x4364f5,_0x4f2986){return function(_0x4687f2){if(!_0x4687f2){_0x4364f5[_0xb22f('0x25')](0x194);}return _0x4687f2;};}function handleError(_0x4dfb62,_0x3e471f){_0x3e471f=_0x3e471f||0x1f4;return function(_0x2c4a9e){logger[_0xb22f('0x26')](_0x2c4a9e[_0xb22f('0x27')]);if(_0x2c4a9e[_0xb22f('0x28')]){delete _0x2c4a9e[_0xb22f('0x28')];}_0x4dfb62[_0xb22f('0x16')](_0x3e471f)[_0xb22f('0x29')](_0x2c4a9e);};}exports['index']=function(_0x483cc3,_0x5d86a1){var _0x2f6b97={},_0x557d96={},_0x327200={'count':0x0,'rows':[]};var _0xc7f33b=db[_0xb22f('0x2a')][_0xb22f('0x2b')];_0x557d96[_0xb22f('0x2c')]=_['keys'](_0xc7f33b);_0x557d96['query']=_[_0xb22f('0x2d')](_0x483cc3[_0xb22f('0x2e')]);_0x557d96[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x557d96['model'],_0x557d96[_0xb22f('0x2e')]);_0x2f6b97[_0xb22f('0x31')]=_['intersection'](_0x557d96[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x2f6b97[_0xb22f('0x31')]=_0x2f6b97['attributes']['length']?_0x2f6b97[_0xb22f('0x31')]:_0x557d96[_0xb22f('0x2c')];if(!_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x33')](_0xb22f('0x34'))){_0x2f6b97[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x1a')]);_0x2f6b97['offset']=qs[_0xb22f('0x19')](_0x483cc3['query']['offset']);}_0x2f6b97[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x36')]);_0x2f6b97[_0xb22f('0x37')]=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x483cc3[_0xb22f('0x2e')],_0x557d96[_0xb22f('0x2f')]));if(_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x39')]){_0x2f6b97[_0xb22f('0x37')]=_[_0xb22f('0x3a')](_0x2f6b97['where'],{'$or':_['map'](_0xc7f33b,function(_0x3e5ade){if(_0x3e5ade[_0xb22f('0x3b')][_0xb22f('0x3c')]!=='VIRTUAL'){var _0xea3cc8={};_0xea3cc8[_0x3e5ade[_0xb22f('0x3d')]]={'$like':'%'+_0x483cc3['query']['filter']+'%'};return _0xea3cc8;}})});}_0x2f6b97=_[_0xb22f('0x3a')]({},_0x2f6b97,_0x483cc3['options']);var _0x234d17={'where':_0x2f6b97['where']};return db[_0xb22f('0x2a')][_0xb22f('0x18')](_0x234d17)[_0xb22f('0x21')](function(_0x52a3c7){_0x327200[_0xb22f('0x18')]=_0x52a3c7;if(_0x483cc3[_0xb22f('0x2e')][_0xb22f('0x3e')]){_0x2f6b97['include']=[{'all':!![]}];}return db[_0xb22f('0x2a')][_0xb22f('0x3f')](_0x2f6b97);})[_0xb22f('0x21')](function(_0x476ff6){_0x327200[_0xb22f('0x40')]=_0x476ff6;return _0x327200;})[_0xb22f('0x21')](respondWithFilteredResult(_0x5d86a1,_0x2f6b97))[_0xb22f('0x41')](handleError(_0x5d86a1,null));};exports[_0xb22f('0x42')]=function(_0xcb55d3,_0x42e834){var _0x58db7e={'raw':![],'where':{'id':_0xcb55d3[_0xb22f('0x43')]['id']}},_0x37817a={};_0x37817a['model']=_[_0xb22f('0x2d')](db['Campaign']['rawAttributes']);_0x37817a[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0xcb55d3[_0xb22f('0x2e')]);_0x37817a[_0xb22f('0x2f')]=_['intersection'](_0x37817a[_0xb22f('0x2c')],_0x37817a['query']);_0x58db7e[_0xb22f('0x31')]=_[_0xb22f('0x30')](_0x37817a[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0xcb55d3[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x58db7e['attributes']=_0x58db7e[_0xb22f('0x31')]['length']?_0x58db7e[_0xb22f('0x31')]:_0x37817a[_0xb22f('0x2c')];if(_0xcb55d3['query'][_0xb22f('0x3e')]){_0x58db7e[_0xb22f('0x44')]=[{'all':!![]}];}_0x58db7e=_['merge']({},_0x58db7e,_0xcb55d3['options']);return db[_0xb22f('0x2a')]['find'](_0x58db7e)[_0xb22f('0x21')](handleEntityNotFound(_0x42e834,null))[_0xb22f('0x21')](respondWithResult(_0x42e834,null))[_0xb22f('0x41')](handleError(_0x42e834,null));};exports[_0xb22f('0x45')]=function(_0x490536,_0x2780ee){return db[_0xb22f('0x2a')]['create'](_0x490536[_0xb22f('0x46')],{})[_0xb22f('0x21')](function(_0x411723){var _0x291e0c=_0x490536[_0xb22f('0x47')]['get']({'plain':!![]});if(!_0x291e0c)throw new Error(_0xb22f('0x48'));if(_0x291e0c['role']==='user'){var _0x3fb0ac=_0x411723[_0xb22f('0x23')]({'plain':!![]});var _0x203ff2=_0xb22f('0x24');return db[_0xb22f('0x49')]['find']({'where':{'name':_0x203ff2,'userProfileId':_0x291e0c[_0xb22f('0x4a')]},'raw':!![]})['then'](function(_0x2d9683){if(_0x2d9683&&_0x2d9683['autoAssociation']===0x0){return db[_0xb22f('0x4b')][_0xb22f('0x45')]({'name':_0x3fb0ac[_0xb22f('0x28')],'resourceId':_0x3fb0ac['id'],'type':_0x2d9683['name'],'sectionId':_0x2d9683['id']},{})[_0xb22f('0x21')](function(){return _0x411723;});}else{return _0x411723;}})[_0xb22f('0x41')](function(_0x57bca4){logger[_0xb22f('0x26')](_0xb22f('0x4c'),_0x57bca4);throw _0x57bca4;});}return _0x411723;})['then'](respondWithResult(_0x2780ee,0xc9))['catch'](handleError(_0x2780ee,null));};exports[_0xb22f('0x4d')]=function(_0x1a847d,_0x5af426){var _0xba9da8={'raw':![],'where':{'id':_0x1a847d['params']['id']}},_0x26bc0d={};_0x26bc0d['model']=_[_0xb22f('0x2d')](db[_0xb22f('0x2a')]['rawAttributes']);_0xba9da8[_0xb22f('0x31')]=_[_0xb22f('0x30')](_0x26bc0d[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x1a847d['query'][_0xb22f('0x32')]));_0xba9da8[_0xb22f('0x31')]=_0xba9da8['attributes']['length']?_0xba9da8[_0xb22f('0x31')]:_0x26bc0d[_0xb22f('0x2c')];if(_0x1a847d[_0xb22f('0x2e')][_0xb22f('0x3e')]){_0xba9da8['include']=[{'all':!![]}];}_0xba9da8=_[_0xb22f('0x3a')]({},_0xba9da8,_0x1a847d[_0xb22f('0x4e')]);return db['Campaign'][_0xb22f('0x4f')](_0xba9da8)[_0xb22f('0x21')](handleEntityNotFound(_0x5af426,null))[_0xb22f('0x21')](function(_0x1bfd19){if(_0x1bfd19){var _0x4310e0=_0x1bfd19[_0xb22f('0x23')]({'plain':!![]});_0x4310e0=qs[_0xb22f('0x50')](_0x4310e0,['id','createdAt',_0xb22f('0x51')]);_0x1a847d[_0xb22f('0x46')]=_[_0xb22f('0x50')](_0x1a847d[_0xb22f('0x46')],['id',_0xb22f('0x52'),'updatedAt']);return db['Campaign'][_0xb22f('0x45')](_[_0xb22f('0x3a')](_0x4310e0,_0x1a847d[_0xb22f('0x46')]),{'include':_0x1a847d['query'][_0xb22f('0x3e')]?[{'all':!![]}]:undefined})[_0xb22f('0x21')](function(_0x453b9b){var _0x321d5f=_0x1a847d[_0xb22f('0x47')][_0xb22f('0x23')]({'plain':!![]});if(!_0x321d5f)throw new Error(_0xb22f('0x48'));if(_0x321d5f[_0xb22f('0x53')]==='user'){var _0x552624=_0x453b9b[_0xb22f('0x23')]({'plain':!![]});var _0x24caa4='IvrCampaigns';return db['UserProfileSection'][_0xb22f('0x4f')]({'where':{'name':_0x24caa4,'userProfileId':_0x321d5f[_0xb22f('0x4a')]},'raw':!![]})['then'](function(_0x5796ea){if(_0x5796ea&&_0x5796ea[_0xb22f('0x54')]===0x0){return db['UserProfileResource'][_0xb22f('0x45')]({'name':_0x552624[_0xb22f('0x28')],'resourceId':_0x552624['id'],'type':_0x5796ea[_0xb22f('0x28')],'sectionId':_0x5796ea['id']},{})['then'](function(){return _0x453b9b;});}else{return _0x453b9b;}})['catch'](function(_0x14db56){logger['error'](_0xb22f('0x4c'),_0x14db56);throw _0x14db56;});}return _0x453b9b;});}})[_0xb22f('0x21')](respondWithResult(_0x5af426,0xc9))[_0xb22f('0x41')](handleError(_0x5af426,null));};exports['update']=function(_0x55fdf1,_0x2988a2){if(_0x55fdf1['body']['id']){delete _0x55fdf1[_0xb22f('0x46')]['id'];}return db[_0xb22f('0x2a')][_0xb22f('0x4f')]({'where':{'id':_0x55fdf1['params']['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x2988a2,null))['then'](saveUpdates(_0x55fdf1[_0xb22f('0x46')],null))[_0xb22f('0x21')](respondWithResult(_0x2988a2,null))[_0xb22f('0x41')](handleError(_0x2988a2,null));};exports[_0xb22f('0x22')]=function(_0x2d33d9,_0x1558e1){return db[_0xb22f('0x2a')][_0xb22f('0x4f')]({'where':{'id':_0x2d33d9[_0xb22f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1558e1,null))[_0xb22f('0x21')](removeEntity(_0x1558e1,null))[_0xb22f('0x41')](handleError(_0x1558e1,null));};exports[_0xb22f('0x55')]=function(_0x5778f2,_0x18d55b,_0x3765a1){var _0x418be8={'raw':!![],'where':{}};var _0x194490={};var _0x492280={'count':0x0,'rows':[]};return db['Campaign'][_0xb22f('0x56')]({'where':{'id':_0x5778f2['params']['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x18d55b,null))[_0xb22f('0x21')](function(_0x3a8183){if(_0x3a8183){_0x194490[_0xb22f('0x2c')]=_[_0xb22f('0x2d')](db[_0xb22f('0x57')][_0xb22f('0x2b')]);_0x194490[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0x5778f2[_0xb22f('0x2e')]);_0x194490[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x194490[_0xb22f('0x2c')],_0x194490['query']);_0x418be8[_0xb22f('0x31')]=_[_0xb22f('0x30')](_0x194490[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x5778f2[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x418be8[_0xb22f('0x31')]=_0x418be8[_0xb22f('0x31')][_0xb22f('0x58')]?_0x418be8[_0xb22f('0x31')]:_0x194490[_0xb22f('0x2c')];if(!_0x5778f2[_0xb22f('0x2e')]['hasOwnProperty']('nolimit')){_0x418be8['limit']=qs[_0xb22f('0x1a')](_0x5778f2[_0xb22f('0x2e')]['limit']);_0x418be8[_0xb22f('0x19')]=qs[_0xb22f('0x19')](_0x5778f2['query'][_0xb22f('0x19')]);}_0x418be8[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x5778f2[_0xb22f('0x2e')][_0xb22f('0x36')]);_0x418be8['where']=qs['filters'](_['pick'](_0x5778f2[_0xb22f('0x2e')],_0x194490[_0xb22f('0x2f')]));_0x418be8[_0xb22f('0x37')]['CampaignId']=_0x3a8183['id'];if(_0x5778f2[_0xb22f('0x2e')][_0xb22f('0x39')]){_0x418be8['where']=_[_0xb22f('0x3a')](_0x418be8[_0xb22f('0x37')],{'$or':_[_0xb22f('0x59')](_0x418be8[_0xb22f('0x31')],function(_0x38547c){var _0x387eeb={};_0x387eeb[_0x38547c]={'$like':'%'+_0x5778f2[_0xb22f('0x2e')][_0xb22f('0x39')]+'%'};return _0x387eeb;})});}_0x418be8=_[_0xb22f('0x3a')]({},_0x418be8,_0x5778f2[_0xb22f('0x4e')]);return db['CmHopper'][_0xb22f('0x18')]({'where':_0x418be8[_0xb22f('0x37')]})[_0xb22f('0x21')](function(_0x13ef04){_0x492280[_0xb22f('0x18')]=_0x13ef04;if(_0x5778f2[_0xb22f('0x2e')][_0xb22f('0x3e')]){_0x418be8['include']=[{'all':!![]}];}return db[_0xb22f('0x57')][_0xb22f('0x3f')](_0x418be8);})[_0xb22f('0x21')](function(_0x182abe){_0x492280[_0xb22f('0x40')]=_0x182abe;return _0x492280;});}})[_0xb22f('0x21')](respondWithFilteredResult(_0x18d55b,_0x418be8))['catch'](handleError(_0x18d55b,null));};exports[_0xb22f('0x5a')]=function(_0x83cc7e,_0x5edfc7,_0x154454){var _0x5ba395={'raw':!![],'where':{}};var _0x53d73a={};var _0x5deaac={'count':0x0,'rows':[]};return db[_0xb22f('0x2a')]['findOne']({'where':{'id':_0x83cc7e[_0xb22f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5edfc7,null))['then'](function(_0x348981){if(_0x348981){_0x53d73a[_0xb22f('0x2c')]=_['keys'](db['CmHopperHistory'][_0xb22f('0x2b')]);_0x53d73a[_0xb22f('0x2e')]=_['keys'](_0x83cc7e[_0xb22f('0x2e')]);_0x53d73a['filters']=_['intersection'](_0x53d73a[_0xb22f('0x2c')],_0x53d73a[_0xb22f('0x2e')]);_0x5ba395[_0xb22f('0x31')]=_['intersection'](_0x53d73a['model'],qs['fields'](_0x83cc7e[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x5ba395[_0xb22f('0x31')]=_0x5ba395[_0xb22f('0x31')]['length']?_0x5ba395[_0xb22f('0x31')]:_0x53d73a[_0xb22f('0x2c')];if(!_0x83cc7e[_0xb22f('0x2e')][_0xb22f('0x33')](_0xb22f('0x34'))){_0x5ba395['limit']=qs[_0xb22f('0x1a')](_0x83cc7e['query']['limit']);_0x5ba395[_0xb22f('0x19')]=qs[_0xb22f('0x19')](_0x83cc7e[_0xb22f('0x2e')]['offset']);}_0x5ba395[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x83cc7e[_0xb22f('0x2e')][_0xb22f('0x36')]);_0x5ba395[_0xb22f('0x37')]=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x83cc7e[_0xb22f('0x2e')],_0x53d73a[_0xb22f('0x2f')]));_0x5ba395[_0xb22f('0x37')][_0xb22f('0x5b')]=_0x348981['id'];if(_0x83cc7e['query']['filter']){_0x5ba395[_0xb22f('0x37')]=_[_0xb22f('0x3a')](_0x5ba395['where'],{'$or':_[_0xb22f('0x59')](_0x5ba395[_0xb22f('0x31')],function(_0x102f85){var _0x25fbd1={};_0x25fbd1[_0x102f85]={'$like':'%'+_0x83cc7e[_0xb22f('0x2e')][_0xb22f('0x39')]+'%'};return _0x25fbd1;})});}_0x5ba395=_[_0xb22f('0x3a')]({},_0x5ba395,_0x83cc7e[_0xb22f('0x4e')]);return db['CmHopperHistory'][_0xb22f('0x18')]({'where':_0x5ba395[_0xb22f('0x37')]})[_0xb22f('0x21')](function(_0x526f05){_0x5deaac[_0xb22f('0x18')]=_0x526f05;if(_0x83cc7e[_0xb22f('0x2e')][_0xb22f('0x3e')]){_0x5ba395['include']=[{'all':!![]}];}return db[_0xb22f('0x5c')]['findAll'](_0x5ba395);})[_0xb22f('0x21')](function(_0x385780){_0x5deaac[_0xb22f('0x40')]=_0x385780;return _0x5deaac;});}})[_0xb22f('0x21')](respondWithFilteredResult(_0x5edfc7,_0x5ba395))[_0xb22f('0x41')](handleError(_0x5edfc7,null));};exports[_0xb22f('0x5d')]=function(_0x2a2ce7,_0xaffc3,_0x2076bf){var _0x571656={'raw':!![],'where':{}};var _0x8ec7bb={};var _0x8b864e={'count':0x0,'rows':[]};return db[_0xb22f('0x2a')]['findOne']({'where':{'id':_0x2a2ce7[_0xb22f('0x43')]['id']}})['then'](handleEntityNotFound(_0xaffc3,null))['then'](function(_0x4a5ab1){if(_0x4a5ab1){_0x8ec7bb[_0xb22f('0x2c')]=_[_0xb22f('0x2d')](db[_0xb22f('0x5e')][_0xb22f('0x2b')]);_0x8ec7bb[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0x2a2ce7[_0xb22f('0x2e')]);_0x8ec7bb['filters']=_[_0xb22f('0x30')](_0x8ec7bb[_0xb22f('0x2c')],_0x8ec7bb[_0xb22f('0x2e')]);_0x571656[_0xb22f('0x31')]=_[_0xb22f('0x30')](_0x8ec7bb[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x2a2ce7[_0xb22f('0x2e')]['fields']));_0x571656[_0xb22f('0x31')]=_0x571656[_0xb22f('0x31')][_0xb22f('0x58')]?_0x571656[_0xb22f('0x31')]:_0x8ec7bb[_0xb22f('0x2c')];if(!_0x2a2ce7[_0xb22f('0x2e')][_0xb22f('0x33')](_0xb22f('0x34'))){_0x571656[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x2a2ce7[_0xb22f('0x2e')]['limit']);_0x571656[_0xb22f('0x19')]=qs['offset'](_0x2a2ce7[_0xb22f('0x2e')][_0xb22f('0x19')]);}_0x571656['order']=qs['sort'](_0x2a2ce7[_0xb22f('0x2e')][_0xb22f('0x36')]);_0x571656[_0xb22f('0x37')]=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x2a2ce7[_0xb22f('0x2e')],_0x8ec7bb['filters']));_0x571656[_0xb22f('0x37')]['CampaignId']=_0x4a5ab1['id'];if(_0x2a2ce7[_0xb22f('0x2e')]['filter']){_0x571656['where']=_[_0xb22f('0x3a')](_0x571656['where'],{'$or':_[_0xb22f('0x59')](_0x571656[_0xb22f('0x31')],function(_0x37f612){var _0x4e9fc2={};_0x4e9fc2[_0x37f612]={'$like':'%'+_0x2a2ce7[_0xb22f('0x2e')][_0xb22f('0x39')]+'%'};return _0x4e9fc2;})});}_0x571656=_[_0xb22f('0x3a')]({},_0x571656,_0x2a2ce7[_0xb22f('0x4e')]);return db['CmHopperFinal'][_0xb22f('0x18')]({'where':_0x571656[_0xb22f('0x37')]})['then'](function(_0x495755){_0x8b864e[_0xb22f('0x18')]=_0x495755;if(_0x2a2ce7[_0xb22f('0x2e')]['includeAll']){_0x571656['include']=[{'all':!![]}];}return db[_0xb22f('0x5e')][_0xb22f('0x3f')](_0x571656);})[_0xb22f('0x21')](function(_0x3df89c){_0x8b864e['rows']=_0x3df89c;return _0x8b864e;});}})[_0xb22f('0x21')](respondWithFilteredResult(_0xaffc3,_0x571656))[_0xb22f('0x41')](handleError(_0xaffc3,null));};exports[_0xb22f('0x5f')]=function(_0x3e7bf4,_0x4c8219,_0x16a201){var _0x5d5796={'raw':!![],'where':{}};var _0x135b93={};var _0x4d6249={'count':0x0,'rows':[]};return db['Campaign'][_0xb22f('0x56')]({'where':{'id':_0x3e7bf4['params']['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x4c8219,null))[_0xb22f('0x21')](function(_0xe3a900){if(_0xe3a900){_0x135b93[_0xb22f('0x2c')]=_['keys'](db[_0xb22f('0x60')][_0xb22f('0x2b')]);_0x135b93[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0x3e7bf4[_0xb22f('0x2e')]);_0x135b93[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x135b93['model'],_0x135b93['query']);_0x5d5796[_0xb22f('0x31')]=_['intersection'](_0x135b93[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x3e7bf4[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x5d5796[_0xb22f('0x31')]=_0x5d5796[_0xb22f('0x31')]['length']?_0x5d5796[_0xb22f('0x31')]:_0x135b93[_0xb22f('0x2c')];if(!_0x3e7bf4[_0xb22f('0x2e')]['hasOwnProperty']('nolimit')){_0x5d5796[_0xb22f('0x1a')]=qs['limit'](_0x3e7bf4['query'][_0xb22f('0x1a')]);_0x5d5796[_0xb22f('0x19')]=qs[_0xb22f('0x19')](_0x3e7bf4['query']['offset']);}_0x5d5796[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x3e7bf4['query']['sort']);_0x5d5796['where']=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x3e7bf4[_0xb22f('0x2e')],_0x135b93[_0xb22f('0x2f')]));_0x5d5796['where'][_0xb22f('0x5b')]=_0xe3a900['id'];if(_0x3e7bf4['query'][_0xb22f('0x39')]){_0x5d5796[_0xb22f('0x37')]=_[_0xb22f('0x3a')](_0x5d5796[_0xb22f('0x37')],{'$or':_[_0xb22f('0x59')](_0x5d5796['attributes'],function(_0x489e11){var _0x19c82b={};_0x19c82b[_0x489e11]={'$like':'%'+_0x3e7bf4[_0xb22f('0x2e')][_0xb22f('0x39')]+'%'};return _0x19c82b;})});}_0x5d5796=_[_0xb22f('0x3a')]({},_0x5d5796,_0x3e7bf4['options']);return db[_0xb22f('0x60')][_0xb22f('0x18')]({'where':_0x5d5796[_0xb22f('0x37')]})[_0xb22f('0x21')](function(_0x204d02){_0x4d6249['count']=_0x204d02;if(_0x3e7bf4['query']['includeAll']){_0x5d5796[_0xb22f('0x44')]=[{'all':!![]}];}return db[_0xb22f('0x60')][_0xb22f('0x3f')](_0x5d5796);})['then'](function(_0x3c3f8b){_0x4d6249[_0xb22f('0x40')]=_0x3c3f8b;return _0x4d6249;});}})[_0xb22f('0x21')](respondWithFilteredResult(_0x4c8219,_0x5d5796))[_0xb22f('0x41')](handleError(_0x4c8219,null));};exports[_0xb22f('0x61')]=function(_0x2de83a,_0x41e957,_0x504330){var _0x57391f={};var _0x54a4e6={};var _0x123d14;var _0x27749d;return db['Campaign'][_0xb22f('0x56')]({'where':{'id':_0x2de83a[_0xb22f('0x43')]['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x41e957,null))[_0xb22f('0x21')](function(_0x4b3963){if(_0x4b3963){_0x123d14=_0x4b3963;_0x54a4e6[_0xb22f('0x2c')]=_[_0xb22f('0x2d')](db['CmList'][_0xb22f('0x2b')]);_0x54a4e6[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0x2de83a[_0xb22f('0x2e')]);_0x54a4e6[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x54a4e6[_0xb22f('0x2c')],_0x54a4e6['query']);_0x57391f[_0xb22f('0x31')]=_['intersection'](_0x54a4e6[_0xb22f('0x2c')],qs[_0xb22f('0x32')](_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x57391f[_0xb22f('0x31')]=_0x57391f[_0xb22f('0x31')][_0xb22f('0x58')]?_0x57391f[_0xb22f('0x31')]:_0x54a4e6['model'];_0x57391f[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x36')]);_0x57391f['where']=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x2de83a[_0xb22f('0x2e')],_0x54a4e6[_0xb22f('0x2f')]));if(_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x39')]){_0x57391f['where']=_['merge'](_0x57391f[_0xb22f('0x37')],{'$or':_[_0xb22f('0x59')](_0x57391f[_0xb22f('0x31')],function(_0x5bc2dd){var _0x58a52d={};_0x58a52d[_0x5bc2dd]={'$like':'%'+_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x39')]+'%'};return _0x58a52d;})});}_0x57391f=_[_0xb22f('0x3a')]({},_0x57391f,_0x2de83a['options']);return _0x123d14['getLists'](_0x57391f);}})[_0xb22f('0x21')](function(_0x1de24e){if(_0x1de24e){_0x27749d=_0x1de24e[_0xb22f('0x58')];if(!_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x33')]('nolimit')){_0x57391f['limit']=qs[_0xb22f('0x1a')](_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x1a')]);_0x57391f[_0xb22f('0x19')]=qs['offset'](_0x2de83a[_0xb22f('0x2e')][_0xb22f('0x19')]);}return _0x123d14[_0xb22f('0x61')](_0x57391f);}})[_0xb22f('0x21')](function(_0xa9dd61){if(_0xa9dd61){return _0xa9dd61?{'count':_0x27749d,'rows':_0xa9dd61}:null;}})['then'](respondWithResult(_0x41e957,null))['catch'](handleError(_0x41e957,null));};exports['addLists']=function(_0x1742cb,_0x338ac2,_0x39416e){var _0xb0c1fa,_0x45b1e2;return db[_0xb22f('0x2a')][_0xb22f('0x4f')]({'where':{'id':_0x1742cb['params']['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x338ac2,null))[_0xb22f('0x21')](function(_0x3e4ec0){if(_0x3e4ec0){_0x45b1e2=_0x3e4ec0;return _0x3e4ec0[_0xb22f('0x62')](_0x1742cb[_0xb22f('0x46')]['ids'],_[_0xb22f('0x50')](_0x1742cb['body'],[_0xb22f('0x63'),'id'])||{});}return null;})[_0xb22f('0x64')](function(_0x426703){var _0x1a6771;_0xb0c1fa=_0x426703||[];var _0x3423a7=[];if(_0x426703){for(var _0x44e60d=0x0;_0x44e60d<_0x426703['length'];_0x44e60d+=0x1){var _0x25d917=_0x426703[_0x44e60d]['get']({'plain':!![]});_0x45b1e2['dialCheckDuplicateType']=_0x1742cb['body'][_0xb22f('0x65')]?_0x1742cb[_0xb22f('0x46')][_0xb22f('0x65')]:_0x45b1e2[_0xb22f('0x65')];switch(_0x45b1e2[_0xb22f('0x65')]){case _0xb22f('0x66'):_0x1a6771=squel[_0xb22f('0x67')]()[_0xb22f('0x68')](_0xb22f('0x69'))[_0xb22f('0x6a')]([_0xb22f('0x6b'),'scheduledAt',_0xb22f('0x6c'),_0xb22f('0x6d'),_0xb22f('0x5b'),_0xb22f('0x52'),'updatedAt'],squel[_0xb22f('0x6e')]()[_0xb22f('0x3d')](_0xb22f('0x6b'),_0xb22f('0x6b'))[_0xb22f('0x3d')](_0xb22f('0x6f'),'scheduledAt')[_0xb22f('0x3d')]('id',_0xb22f('0x6c'))[_0xb22f('0x3d')](_0x25d917[_0xb22f('0x70')][_0xb22f('0x71')](),_0xb22f('0x6d'))[_0xb22f('0x3d')](_0x1742cb[_0xb22f('0x43')]['id'][_0xb22f('0x71')](),_0xb22f('0x5b'))[_0xb22f('0x3d')](_0xb22f('0x6f'),_0xb22f('0x52'))[_0xb22f('0x3d')](_0xb22f('0x6f'),_0xb22f('0x51'))[_0xb22f('0x72')](_0xb22f('0x73'))[_0xb22f('0x37')](_0xb22f('0x74'))[_0xb22f('0x37')](_0xb22f('0x75'),_0x25d917[_0xb22f('0x70')][_0xb22f('0x71')]())[_0xb22f('0x37')](_0xb22f('0x76'))[_0xb22f('0x37')](_0xb22f('0x77'),squel[_0xb22f('0x6e')]()['field'](_0xb22f('0x78'))[_0xb22f('0x72')](_0xb22f('0x79'))[_0xb22f('0x37')](_0xb22f('0x7a'),_0x1742cb[_0xb22f('0x43')]['id'][_0xb22f('0x71')]()))[_0xb22f('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb22f('0x6e')]()[_0xb22f('0x3d')]('COALESCE(phone,\x27\x27)')[_0xb22f('0x72')](_0xb22f('0x69'))[_0xb22f('0x37')](_0xb22f('0x7a'),_0x1742cb[_0xb22f('0x43')]['id'][_0xb22f('0x71')]())))[_0xb22f('0x71')]();break;case _0xb22f('0x7b'):_0x1a6771=squel[_0xb22f('0x67')]()[_0xb22f('0x68')](_0xb22f('0x69'))[_0xb22f('0x6a')]([_0xb22f('0x6b'),_0xb22f('0x7c'),_0xb22f('0x6c'),_0xb22f('0x6d'),_0xb22f('0x5b'),_0xb22f('0x52'),'updatedAt'],squel['select']()['field'](_0xb22f('0x6b'),'phone')['field'](_0xb22f('0x6f'),'scheduledAt')[_0xb22f('0x3d')]('id','ContactId')['field'](_0x25d917[_0xb22f('0x70')][_0xb22f('0x71')](),'ListId')[_0xb22f('0x3d')](_0x1742cb['params']['id'][_0xb22f('0x71')](),_0xb22f('0x5b'))[_0xb22f('0x3d')](_0xb22f('0x6f'),'createdAt')[_0xb22f('0x3d')](_0xb22f('0x6f'),_0xb22f('0x51'))['from']('cm_contacts')[_0xb22f('0x37')](_0xb22f('0x74'))[_0xb22f('0x37')](_0xb22f('0x75'),_0x25d917['CmListId'][_0xb22f('0x71')]())[_0xb22f('0x37')](_0xb22f('0x76'))[_0xb22f('0x37')](_0xb22f('0x77'),squel['select']()[_0xb22f('0x3d')](_0xb22f('0x7d'))[_0xb22f('0x72')](_0xb22f('0x69'))[_0xb22f('0x37')](_0xb22f('0x7a'),_0x1742cb[_0xb22f('0x43')]['id']['toString']())))['toString']();break;default:_0x1a6771=squel['insert']()[_0xb22f('0x68')](_0xb22f('0x69'))[_0xb22f('0x6a')]([_0xb22f('0x6b'),_0xb22f('0x7c'),'ContactId',_0xb22f('0x6d'),_0xb22f('0x5b'),_0xb22f('0x52'),'updatedAt'],squel[_0xb22f('0x6e')]()[_0xb22f('0x3d')](_0xb22f('0x6b'),_0xb22f('0x6b'))[_0xb22f('0x3d')](_0xb22f('0x6f'),_0xb22f('0x7c'))[_0xb22f('0x3d')]('id','ContactId')[_0xb22f('0x3d')](_0x25d917[_0xb22f('0x70')]['toString'](),_0xb22f('0x6d'))[_0xb22f('0x3d')](_0x1742cb[_0xb22f('0x43')]['id'][_0xb22f('0x71')](),_0xb22f('0x5b'))['field'](_0xb22f('0x6f'),_0xb22f('0x52'))['field']('NOW()',_0xb22f('0x51'))[_0xb22f('0x72')](_0xb22f('0x73'))[_0xb22f('0x37')](_0xb22f('0x74'))['where'](_0xb22f('0x75'),_0x25d917[_0xb22f('0x70')][_0xb22f('0x71')]())['where'](_0xb22f('0x76')))[_0xb22f('0x71')]();}_0x3423a7[_0xb22f('0x7e')](db['sequelize'][_0xb22f('0x2e')](_0x1a6771));}return BPromise[_0xb22f('0x7f')](_0x3423a7);}})[_0xb22f('0x21')](function(){return _0xb0c1fa;})['then'](respondWithResult(_0x338ac2,null))['catch'](handleError(_0x338ac2,null));};exports[_0xb22f('0x80')]=function(_0x156449,_0x285b35,_0x58b9ce){return db[_0xb22f('0x2a')][_0xb22f('0x4f')]({'where':{'id':_0x156449['params']['id']}})['then'](handleEntityNotFound(_0x285b35,null))['then'](function(_0x294d03){if(_0x294d03){return _0x294d03['removeLists'](_0x156449['query'][_0xb22f('0x63')]);}})[_0xb22f('0x21')](function(_0x42dc44){if(_0x42dc44){return db['CmHopper']['destroy']({'where':{'ListId':_0x156449['query'][_0xb22f('0x63')],'CampaignId':_0x156449[_0xb22f('0x43')]['id']}})[_0xb22f('0x21')](function(){return _0x42dc44;});}})[_0xb22f('0x21')](respondWithStatusCode(_0x285b35,null))['catch'](handleError(_0x285b35,null));};exports[_0xb22f('0x81')]=function(_0x413b66,_0x55012f,_0x4dd8f1){var _0x77ec44={'raw':!![],'where':{}};var _0x24fb48={};var _0x5c2181={'count':0x0,'rows':[]};return db[_0xb22f('0x2a')][_0xb22f('0x56')]({'where':{'id':_0x413b66[_0xb22f('0x43')]['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x55012f,null))[_0xb22f('0x21')](function(_0x260fb0){if(_0x260fb0){_0x24fb48[_0xb22f('0x2c')]=_[_0xb22f('0x2d')](db[_0xb22f('0x82')]['rawAttributes']);_0x24fb48[_0xb22f('0x2e')]=_[_0xb22f('0x2d')](_0x413b66[_0xb22f('0x2e')]);_0x24fb48[_0xb22f('0x2f')]=_[_0xb22f('0x30')](_0x24fb48[_0xb22f('0x2c')],_0x24fb48[_0xb22f('0x2e')]);_0x77ec44[_0xb22f('0x31')]=_[_0xb22f('0x30')](_0x24fb48[_0xb22f('0x2c')],qs['fields'](_0x413b66[_0xb22f('0x2e')][_0xb22f('0x32')]));_0x77ec44[_0xb22f('0x31')]=_0x77ec44[_0xb22f('0x31')][_0xb22f('0x58')]?_0x77ec44[_0xb22f('0x31')]:_0x24fb48[_0xb22f('0x2c')];if(!_0x413b66['query'][_0xb22f('0x33')]('nolimit')){_0x77ec44['limit']=qs[_0xb22f('0x1a')](_0x413b66[_0xb22f('0x2e')][_0xb22f('0x1a')]);_0x77ec44[_0xb22f('0x19')]=qs[_0xb22f('0x19')](_0x413b66[_0xb22f('0x2e')][_0xb22f('0x19')]);}_0x77ec44[_0xb22f('0x35')]=qs[_0xb22f('0x36')](_0x413b66[_0xb22f('0x2e')]['sort']);_0x77ec44[_0xb22f('0x37')]=qs[_0xb22f('0x2f')](_[_0xb22f('0x38')](_0x413b66[_0xb22f('0x2e')],_0x24fb48[_0xb22f('0x2f')]));_0x77ec44[_0xb22f('0x37')][_0xb22f('0x5b')]=_0x260fb0['id'];if(_0x413b66[_0xb22f('0x2e')][_0xb22f('0x39')]){_0x77ec44[_0xb22f('0x37')]=_[_0xb22f('0x3a')](_0x77ec44['where'],{'$or':_[_0xb22f('0x59')](_0x77ec44['attributes'],function(_0x22df34){var _0x1af625={};_0x1af625[_0x22df34]={'$like':'%'+_0x413b66[_0xb22f('0x2e')]['filter']+'%'};return _0x1af625;})});}_0x77ec44=_['merge']({},_0x77ec44,_0x413b66[_0xb22f('0x4e')]);return db[_0xb22f('0x82')][_0xb22f('0x18')]({'where':_0x77ec44[_0xb22f('0x37')]})[_0xb22f('0x21')](function(_0x4acd24){_0x5c2181['count']=_0x4acd24;if(_0x413b66[_0xb22f('0x2e')][_0xb22f('0x3e')]){_0x77ec44[_0xb22f('0x44')]=[{'all':!![]}];}return db[_0xb22f('0x82')][_0xb22f('0x3f')](_0x77ec44);})[_0xb22f('0x21')](function(_0x3de682){_0x5c2181[_0xb22f('0x40')]=_0x3de682;return _0x5c2181;});}})[_0xb22f('0x21')](respondWithFilteredResult(_0x55012f,_0x77ec44))[_0xb22f('0x41')](handleError(_0x55012f,null));};exports[_0xb22f('0x83')]=function(_0x5073de,_0x413fc9,_0x1a2746){var _0x25bec3,_0x30a80b;return db[_0xb22f('0x2a')]['find']({'where':{'id':_0x5073de[_0xb22f('0x43')]['id']}})['then'](handleEntityNotFound(_0x413fc9,null))[_0xb22f('0x21')](function(_0x5308a0){if(_0x5308a0){_0x30a80b=_0x5308a0;return _0x5308a0[_0xb22f('0x83')](_0x5073de[_0xb22f('0x46')]['ids'],_['omit'](_0x5073de['body'],[_0xb22f('0x63'),'id'])||{});}return null;})['spread'](function(_0x5082ed){var _0x73d6b6;_0x25bec3=_0x5082ed||[];var _0x207fc8=[];if(_0x5082ed){for(var _0x5e7eeb=0x0;_0x5e7eeb<_0x5082ed[_0xb22f('0x58')];_0x5e7eeb+=0x1){var _0x885337=_0x5082ed[_0x5e7eeb][_0xb22f('0x23')]({'plain':!![]});_0x73d6b6=squel[_0xb22f('0x67')]()[_0xb22f('0x68')](_0xb22f('0x84'))[_0xb22f('0x6a')](['phone',_0xb22f('0x6c'),'ListId',_0xb22f('0x5b'),'createdAt',_0xb22f('0x51')],squel[_0xb22f('0x6e')]()['field'](_0xb22f('0x6b'),'phone')[_0xb22f('0x3d')]('id',_0xb22f('0x6c'))[_0xb22f('0x3d')](_0x885337[_0xb22f('0x70')][_0xb22f('0x71')](),_0xb22f('0x6d'))[_0xb22f('0x3d')](_0x5073de[_0xb22f('0x43')]['id'][_0xb22f('0x71')](),_0xb22f('0x5b'))[_0xb22f('0x3d')](_0xb22f('0x6f'),_0xb22f('0x52'))['field'](_0xb22f('0x6f'),_0xb22f('0x51'))['from'](_0xb22f('0x73'))[_0xb22f('0x37')](_0xb22f('0x74'))['where'](_0xb22f('0x75'),_0x885337[_0xb22f('0x70')][_0xb22f('0x71')]())[_0xb22f('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0xb22f('0x71')]();_0x207fc8[_0xb22f('0x7e')](db[_0xb22f('0x85')][_0xb22f('0x2e')](_0x73d6b6));}return BPromise[_0xb22f('0x7f')](_0x207fc8);}})['then'](function(){return _0x25bec3;})[_0xb22f('0x21')](respondWithResult(_0x413fc9,null))[_0xb22f('0x41')](handleError(_0x413fc9,null));};exports[_0xb22f('0x86')]=function(_0x1c3f22,_0x200805,_0x1a72cb){return db[_0xb22f('0x2a')]['find']({'where':{'id':_0x1c3f22[_0xb22f('0x43')]['id']}})[_0xb22f('0x21')](handleEntityNotFound(_0x200805,null))['then'](function(_0x30d337){if(_0x30d337){return _0x30d337[_0xb22f('0x86')](_0x1c3f22[_0xb22f('0x2e')][_0xb22f('0x63')]);}})['then'](function(_0x49396c){if(_0x49396c){return db[_0xb22f('0x60')][_0xb22f('0x22')]({'where':{'ListId':_0x1c3f22[_0xb22f('0x2e')]['ids'],'CampaignId':_0x1c3f22[_0xb22f('0x43')]['id']}})[_0xb22f('0x21')](function(){return _0x49396c;});}})[_0xb22f('0x21')](respondWithStatusCode(_0x200805,null))[_0xb22f('0x41')](handleError(_0x200805,null));}; \ No newline at end of file +var _0xfc1e=['role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','nolimit','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','NOW()','CmListId','toString','from','cm_contacts','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','stack','name','send','Campaign','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2bbc59,_0x36dbb6){var _0x45c1e3=function(_0x44e5ff){while(--_0x44e5ff){_0x2bbc59['push'](_0x2bbc59['shift']());}};_0x45c1e3(++_0x36dbb6);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xfc1e[_0x19babd];return _0x314eaf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xefc1('0x0'));var jsonpatch=require(_0xefc1('0x1'));var rp=require(_0xefc1('0x2'));var moment=require(_0xefc1('0x3'));var BPromise=require(_0xefc1('0x4'));var Mustache=require('mustache');var util=require(_0xefc1('0x5'));var path=require(_0xefc1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xefc1('0x7'));var fs=require('fs');var _=require(_0xefc1('0x8'));var squel=require(_0xefc1('0x9'));var crypto=require(_0xefc1('0xa'));var jsforce=require(_0xefc1('0xb'));var deskjs=require(_0xefc1('0xc'));var toCsv=require(_0xefc1('0xd'));var querystring=require(_0xefc1('0xe'));var Papa=require(_0xefc1('0xf'));var Redis=require(_0xefc1('0x10'));var authService=require(_0xefc1('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xefc1('0x12'));var logger=require(_0xefc1('0x13'))(_0xefc1('0x14'));var utils=require(_0xefc1('0x15'));var config=require(_0xefc1('0x16'));var db=require(_0xefc1('0x17'))['db'];function respondWithStatusCode(_0x152fab,_0x4293db){_0x4293db=_0x4293db||0xcc;return function(_0x41dc08){if(_0x41dc08){return _0x152fab[_0xefc1('0x18')](_0x4293db);}return _0x152fab[_0xefc1('0x19')](_0x4293db)['end']();};}function respondWithResult(_0x404e21,_0x27381c){_0x27381c=_0x27381c||0xc8;return function(_0x1c7ea5){if(_0x1c7ea5){return _0x404e21[_0xefc1('0x19')](_0x27381c)[_0xefc1('0x1a')](_0x1c7ea5);}};}function respondWithFilteredResult(_0x120efb,_0x40a2fd){return function(_0x209334){if(_0x209334){var _0x4d42cd=_0x209334['count'],_0x1e1418=_0x40a2fd[_0xefc1('0x1b')],_0x1cc6d9=_0x40a2fd[_0xefc1('0x1b')]+_0x40a2fd[_0xefc1('0x1c')],_0x26d9de;if(_0x1cc6d9>=_0x4d42cd){_0x1cc6d9=_0x4d42cd;_0x26d9de=0xc8;}else{_0x26d9de=0xce;}_0x120efb[_0xefc1('0x19')](_0x26d9de);return _0x120efb[_0xefc1('0x1d')](_0xefc1('0x1e'),_0x1e1418+'-'+_0x1cc6d9+'/'+_0x4d42cd)[_0xefc1('0x1a')](_0x209334);}return null;};}function patchUpdates(_0x126052){return function(_0x5da8b0){try{jsonpatch[_0xefc1('0x1f')](_0x5da8b0,_0x126052,!![]);}catch(_0x1aaaa0){return BPromise[_0xefc1('0x20')](_0x1aaaa0);}return _0x5da8b0['save']();};}function saveUpdates(_0x577315,_0x4694c3){return function(_0x492d7d){if(_0x492d7d){return _0x492d7d[_0xefc1('0x21')](_0x577315)['then'](function(_0x1fd87f){return _0x1fd87f;});}return null;};}function removeEntity(_0x34bfdd,_0x4bb454){return function(_0x2f5190){if(_0x2f5190){return _0x2f5190[_0xefc1('0x22')]()[_0xefc1('0x23')](function(){var _0x3d6532=_0x2f5190[_0xefc1('0x24')]({'plain':!![]});var _0xdeb673='IvrCampaigns';return db[_0xefc1('0x25')][_0xefc1('0x22')]({'where':{'type':_0xdeb673,'resourceId':_0x3d6532['id']}})['then'](function(){return _0x2f5190;});})[_0xefc1('0x23')](function(){_0x34bfdd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21aa3b,_0x84a5c0){return function(_0x3eb944){if(!_0x3eb944){_0x21aa3b[_0xefc1('0x18')](0x194);}return _0x3eb944;};}function handleError(_0x452363,_0x3ee133){_0x3ee133=_0x3ee133||0x1f4;return function(_0x538145){logger['error'](_0x538145[_0xefc1('0x26')]);if(_0x538145[_0xefc1('0x27')]){delete _0x538145[_0xefc1('0x27')];}_0x452363[_0xefc1('0x19')](_0x3ee133)[_0xefc1('0x28')](_0x538145);};}exports['index']=function(_0x33c2f7,_0x3f6e1a){var _0x55f900={},_0x486a5b={},_0x1c58e7={'count':0x0,'rows':[]};var _0x344ce8=db[_0xefc1('0x29')]['rawAttributes'];_0x486a5b[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](_0x344ce8);_0x486a5b[_0xefc1('0x2c')]=_[_0xefc1('0x2b')](_0x33c2f7[_0xefc1('0x2c')]);_0x486a5b[_0xefc1('0x2d')]=_[_0xefc1('0x2e')](_0x486a5b[_0xefc1('0x2a')],_0x486a5b['query']);_0x55f900[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x486a5b[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x33c2f7[_0xefc1('0x2c')][_0xefc1('0x30')]));_0x55f900[_0xefc1('0x2f')]=_0x55f900[_0xefc1('0x2f')]['length']?_0x55f900[_0xefc1('0x2f')]:_0x486a5b[_0xefc1('0x2a')];if(!_0x33c2f7[_0xefc1('0x2c')][_0xefc1('0x31')]('nolimit')){_0x55f900[_0xefc1('0x1c')]=qs['limit'](_0x33c2f7[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x55f900[_0xefc1('0x1b')]=qs[_0xefc1('0x1b')](_0x33c2f7['query'][_0xefc1('0x1b')]);}_0x55f900[_0xefc1('0x32')]=qs[_0xefc1('0x33')](_0x33c2f7['query'][_0xefc1('0x33')]);_0x55f900['where']=qs['filters'](_[_0xefc1('0x34')](_0x33c2f7['query'],_0x486a5b[_0xefc1('0x2d')]));if(_0x33c2f7[_0xefc1('0x2c')][_0xefc1('0x35')]){_0x55f900[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x55f900['where'],{'$or':_[_0xefc1('0x38')](_0x344ce8,function(_0x2be6d5){if(_0x2be6d5['type'][_0xefc1('0x39')]!==_0xefc1('0x3a')){var _0x319e94={};_0x319e94[_0x2be6d5[_0xefc1('0x3b')]]={'$like':'%'+_0x33c2f7['query'][_0xefc1('0x35')]+'%'};return _0x319e94;}})});}_0x55f900=_[_0xefc1('0x37')]({},_0x55f900,_0x33c2f7[_0xefc1('0x3c')]);var _0x228ee8={'where':_0x55f900[_0xefc1('0x36')]};return db[_0xefc1('0x29')][_0xefc1('0x3d')](_0x228ee8)[_0xefc1('0x23')](function(_0xa6c759){_0x1c58e7['count']=_0xa6c759;if(_0x33c2f7[_0xefc1('0x2c')][_0xefc1('0x3e')]){_0x55f900[_0xefc1('0x3f')]=[{'all':!![]}];}return db[_0xefc1('0x29')][_0xefc1('0x40')](_0x55f900);})[_0xefc1('0x23')](function(_0x435e7a){_0x1c58e7['rows']=_0x435e7a;return _0x1c58e7;})[_0xefc1('0x23')](respondWithFilteredResult(_0x3f6e1a,_0x55f900))[_0xefc1('0x41')](handleError(_0x3f6e1a,null));};exports[_0xefc1('0x42')]=function(_0x44c944,_0x4db686){var _0x274318={'raw':![],'where':{'id':_0x44c944[_0xefc1('0x43')]['id']}},_0x41ba73={};_0x41ba73['model']=_[_0xefc1('0x2b')](db[_0xefc1('0x29')][_0xefc1('0x44')]);_0x41ba73[_0xefc1('0x2c')]=_[_0xefc1('0x2b')](_0x44c944['query']);_0x41ba73[_0xefc1('0x2d')]=_['intersection'](_0x41ba73[_0xefc1('0x2a')],_0x41ba73[_0xefc1('0x2c')]);_0x274318[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x41ba73['model'],qs[_0xefc1('0x30')](_0x44c944['query'][_0xefc1('0x30')]));_0x274318[_0xefc1('0x2f')]=_0x274318['attributes'][_0xefc1('0x45')]?_0x274318[_0xefc1('0x2f')]:_0x41ba73[_0xefc1('0x2a')];if(_0x44c944[_0xefc1('0x2c')][_0xefc1('0x3e')]){_0x274318[_0xefc1('0x3f')]=[{'all':!![]}];}_0x274318=_[_0xefc1('0x37')]({},_0x274318,_0x44c944[_0xefc1('0x3c')]);return db['Campaign'][_0xefc1('0x46')](_0x274318)[_0xefc1('0x23')](handleEntityNotFound(_0x4db686,null))[_0xefc1('0x23')](respondWithResult(_0x4db686,null))['catch'](handleError(_0x4db686,null));};exports[_0xefc1('0x47')]=function(_0x5bbfa2,_0x3f7721){return db[_0xefc1('0x29')][_0xefc1('0x47')](_0x5bbfa2[_0xefc1('0x48')],{})['then'](function(_0x28a6d1){var _0x5a9a3c=_0x5bbfa2[_0xefc1('0x49')][_0xefc1('0x24')]({'plain':!![]});if(!_0x5a9a3c)throw new Error(_0xefc1('0x4a'));if(_0x5a9a3c[_0xefc1('0x4b')]==='user'){var _0x50c8d5=_0x28a6d1[_0xefc1('0x24')]({'plain':!![]});var _0x2d262c=_0xefc1('0x4c');return db[_0xefc1('0x4d')][_0xefc1('0x46')]({'where':{'name':_0x2d262c,'userProfileId':_0x5a9a3c[_0xefc1('0x4e')]},'raw':!![]})['then'](function(_0x44c24e){if(_0x44c24e&&_0x44c24e[_0xefc1('0x4f')]===0x0){return db[_0xefc1('0x25')][_0xefc1('0x47')]({'name':_0x50c8d5[_0xefc1('0x27')],'resourceId':_0x50c8d5['id'],'type':_0x44c24e['name'],'sectionId':_0x44c24e['id']},{})[_0xefc1('0x23')](function(){return _0x28a6d1;});}else{return _0x28a6d1;}})[_0xefc1('0x41')](function(_0x1d810d){logger[_0xefc1('0x50')](_0xefc1('0x51'),_0x1d810d);throw _0x1d810d;});}return _0x28a6d1;})['then'](respondWithResult(_0x3f7721,0xc9))['catch'](handleError(_0x3f7721,null));};exports[_0xefc1('0x52')]=function(_0x5ccfd0,_0x50994a){var _0x10fa08={'raw':![],'where':{'id':_0x5ccfd0[_0xefc1('0x43')]['id']}},_0x23dbb1={};_0x23dbb1[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db[_0xefc1('0x29')]['rawAttributes']);_0x10fa08[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x23dbb1[_0xefc1('0x2a')],qs['fields'](_0x5ccfd0[_0xefc1('0x2c')]['fields']));_0x10fa08[_0xefc1('0x2f')]=_0x10fa08[_0xefc1('0x2f')][_0xefc1('0x45')]?_0x10fa08[_0xefc1('0x2f')]:_0x23dbb1[_0xefc1('0x2a')];if(_0x5ccfd0[_0xefc1('0x2c')][_0xefc1('0x3e')]){_0x10fa08[_0xefc1('0x3f')]=[{'all':!![]}];}_0x10fa08=_[_0xefc1('0x37')]({},_0x10fa08,_0x5ccfd0[_0xefc1('0x3c')]);return db[_0xefc1('0x29')]['find'](_0x10fa08)[_0xefc1('0x23')](handleEntityNotFound(_0x50994a,null))[_0xefc1('0x23')](function(_0x2306db){if(_0x2306db){var _0x1ca2d7=_0x2306db[_0xefc1('0x24')]({'plain':!![]});_0x1ca2d7=qs['omit'](_0x1ca2d7,['id',_0xefc1('0x53'),_0xefc1('0x54')]);_0x5ccfd0[_0xefc1('0x48')]=_['omit'](_0x5ccfd0['body'],['id',_0xefc1('0x53'),_0xefc1('0x54')]);return db[_0xefc1('0x29')][_0xefc1('0x47')](_['merge'](_0x1ca2d7,_0x5ccfd0[_0xefc1('0x48')]),{'include':_0x5ccfd0[_0xefc1('0x2c')][_0xefc1('0x3e')]?[{'all':!![]}]:undefined})[_0xefc1('0x23')](function(_0x463ca3){var _0x21c7b0=_0x5ccfd0[_0xefc1('0x49')]['get']({'plain':!![]});if(!_0x21c7b0)throw new Error(_0xefc1('0x4a'));if(_0x21c7b0[_0xefc1('0x4b')]===_0xefc1('0x49')){var _0xb222b1=_0x463ca3['get']({'plain':!![]});var _0x30b450=_0xefc1('0x4c');return db['UserProfileSection'][_0xefc1('0x46')]({'where':{'name':_0x30b450,'userProfileId':_0x21c7b0[_0xefc1('0x4e')]},'raw':!![]})[_0xefc1('0x23')](function(_0x423d4c){if(_0x423d4c&&_0x423d4c[_0xefc1('0x4f')]===0x0){return db[_0xefc1('0x25')][_0xefc1('0x47')]({'name':_0xb222b1[_0xefc1('0x27')],'resourceId':_0xb222b1['id'],'type':_0x423d4c['name'],'sectionId':_0x423d4c['id']},{})[_0xefc1('0x23')](function(){return _0x463ca3;});}else{return _0x463ca3;}})['catch'](function(_0x2f19d3){logger[_0xefc1('0x50')](_0xefc1('0x51'),_0x2f19d3);throw _0x2f19d3;});}return _0x463ca3;});}})['then'](respondWithResult(_0x50994a,0xc9))[_0xefc1('0x41')](handleError(_0x50994a,null));};exports['update']=function(_0x47ceef,_0x175695){if(_0x47ceef[_0xefc1('0x48')]['id']){delete _0x47ceef['body']['id'];}return db[_0xefc1('0x29')]['find']({'where':{'id':_0x47ceef[_0xefc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x175695,null))['then'](saveUpdates(_0x47ceef[_0xefc1('0x48')],null))[_0xefc1('0x23')](respondWithResult(_0x175695,null))[_0xefc1('0x41')](handleError(_0x175695,null));};exports[_0xefc1('0x22')]=function(_0x37d469,_0x398a5c){return db['Campaign'][_0xefc1('0x46')]({'where':{'id':_0x37d469['params']['id']}})['then'](handleEntityNotFound(_0x398a5c,null))['then'](removeEntity(_0x398a5c,null))['catch'](handleError(_0x398a5c,null));};exports[_0xefc1('0x55')]=function(_0x16e87a,_0x597d68,_0x59a4d3){var _0x4c7e68={'raw':!![],'where':{}};var _0x4a717b={};var _0x1971f4={'count':0x0,'rows':[]};return db[_0xefc1('0x29')][_0xefc1('0x56')]({'where':{'id':_0x16e87a[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x597d68,null))[_0xefc1('0x23')](function(_0x3a7790){if(_0x3a7790){_0x4a717b['model']=_['keys'](db[_0xefc1('0x57')][_0xefc1('0x44')]);_0x4a717b['query']=_['keys'](_0x16e87a['query']);_0x4a717b[_0xefc1('0x2d')]=_[_0xefc1('0x2e')](_0x4a717b[_0xefc1('0x2a')],_0x4a717b[_0xefc1('0x2c')]);_0x4c7e68[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x4a717b[_0xefc1('0x2a')],qs['fields'](_0x16e87a[_0xefc1('0x2c')][_0xefc1('0x30')]));_0x4c7e68[_0xefc1('0x2f')]=_0x4c7e68[_0xefc1('0x2f')]['length']?_0x4c7e68[_0xefc1('0x2f')]:_0x4a717b[_0xefc1('0x2a')];if(!_0x16e87a[_0xefc1('0x2c')]['hasOwnProperty']('nolimit')){_0x4c7e68[_0xefc1('0x1c')]=qs[_0xefc1('0x1c')](_0x16e87a[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x4c7e68[_0xefc1('0x1b')]=qs['offset'](_0x16e87a[_0xefc1('0x2c')][_0xefc1('0x1b')]);}_0x4c7e68['order']=qs[_0xefc1('0x33')](_0x16e87a[_0xefc1('0x2c')][_0xefc1('0x33')]);_0x4c7e68['where']=qs[_0xefc1('0x2d')](_[_0xefc1('0x34')](_0x16e87a[_0xefc1('0x2c')],_0x4a717b[_0xefc1('0x2d')]));_0x4c7e68[_0xefc1('0x36')][_0xefc1('0x58')]=_0x3a7790['id'];if(_0x16e87a['query'][_0xefc1('0x35')]){_0x4c7e68[_0xefc1('0x36')]=_['merge'](_0x4c7e68['where'],{'$or':_[_0xefc1('0x38')](_0x4c7e68[_0xefc1('0x2f')],function(_0x2608db){var _0x3ef13d={};_0x3ef13d[_0x2608db]={'$like':'%'+_0x16e87a[_0xefc1('0x2c')][_0xefc1('0x35')]+'%'};return _0x3ef13d;})});}_0x4c7e68=_[_0xefc1('0x37')]({},_0x4c7e68,_0x16e87a[_0xefc1('0x3c')]);return db[_0xefc1('0x57')][_0xefc1('0x3d')]({'where':_0x4c7e68[_0xefc1('0x36')]})['then'](function(_0x22d3f3){_0x1971f4[_0xefc1('0x3d')]=_0x22d3f3;if(_0x16e87a['query'][_0xefc1('0x3e')]){_0x4c7e68[_0xefc1('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xefc1('0x40')](_0x4c7e68);})[_0xefc1('0x23')](function(_0x30a07b){_0x1971f4[_0xefc1('0x59')]=_0x30a07b;return _0x1971f4;});}})['then'](respondWithFilteredResult(_0x597d68,_0x4c7e68))['catch'](handleError(_0x597d68,null));};exports[_0xefc1('0x5a')]=function(_0x503141,_0x59a08b,_0x331a79){var _0x2455b5={'raw':!![],'where':{}};var _0x5bb6ce={};var _0x2528b1={'count':0x0,'rows':[]};return db[_0xefc1('0x29')][_0xefc1('0x56')]({'where':{'id':_0x503141[_0xefc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x59a08b,null))['then'](function(_0x1eca62){if(_0x1eca62){_0x5bb6ce[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db['CmHopperHistory']['rawAttributes']);_0x5bb6ce[_0xefc1('0x2c')]=_[_0xefc1('0x2b')](_0x503141[_0xefc1('0x2c')]);_0x5bb6ce['filters']=_[_0xefc1('0x2e')](_0x5bb6ce[_0xefc1('0x2a')],_0x5bb6ce['query']);_0x2455b5[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x5bb6ce[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x503141[_0xefc1('0x2c')][_0xefc1('0x30')]));_0x2455b5['attributes']=_0x2455b5['attributes'][_0xefc1('0x45')]?_0x2455b5['attributes']:_0x5bb6ce[_0xefc1('0x2a')];if(!_0x503141[_0xefc1('0x2c')][_0xefc1('0x31')]('nolimit')){_0x2455b5[_0xefc1('0x1c')]=qs[_0xefc1('0x1c')](_0x503141[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x2455b5[_0xefc1('0x1b')]=qs[_0xefc1('0x1b')](_0x503141['query'][_0xefc1('0x1b')]);}_0x2455b5[_0xefc1('0x32')]=qs['sort'](_0x503141[_0xefc1('0x2c')][_0xefc1('0x33')]);_0x2455b5[_0xefc1('0x36')]=qs[_0xefc1('0x2d')](_[_0xefc1('0x34')](_0x503141['query'],_0x5bb6ce[_0xefc1('0x2d')]));_0x2455b5[_0xefc1('0x36')][_0xefc1('0x58')]=_0x1eca62['id'];if(_0x503141[_0xefc1('0x2c')][_0xefc1('0x35')]){_0x2455b5[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x2455b5[_0xefc1('0x36')],{'$or':_[_0xefc1('0x38')](_0x2455b5['attributes'],function(_0x77cd2d){var _0x183711={};_0x183711[_0x77cd2d]={'$like':'%'+_0x503141[_0xefc1('0x2c')]['filter']+'%'};return _0x183711;})});}_0x2455b5=_['merge']({},_0x2455b5,_0x503141[_0xefc1('0x3c')]);return db[_0xefc1('0x5b')][_0xefc1('0x3d')]({'where':_0x2455b5[_0xefc1('0x36')]})[_0xefc1('0x23')](function(_0x5d457c){_0x2528b1[_0xefc1('0x3d')]=_0x5d457c;if(_0x503141[_0xefc1('0x2c')]['includeAll']){_0x2455b5[_0xefc1('0x3f')]=[{'all':!![]}];}return db[_0xefc1('0x5b')][_0xefc1('0x40')](_0x2455b5);})[_0xefc1('0x23')](function(_0x3d9883){_0x2528b1['rows']=_0x3d9883;return _0x2528b1;});}})['then'](respondWithFilteredResult(_0x59a08b,_0x2455b5))[_0xefc1('0x41')](handleError(_0x59a08b,null));};exports['getHopperFinals']=function(_0x2e64cd,_0x12df49,_0x16e5a3){var _0x2b5605={'raw':!![],'where':{}};var _0x365459={};var _0x438138={'count':0x0,'rows':[]};return db[_0xefc1('0x29')][_0xefc1('0x56')]({'where':{'id':_0x2e64cd['params']['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x12df49,null))[_0xefc1('0x23')](function(_0x18fd1a){if(_0x18fd1a){_0x365459[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db[_0xefc1('0x5c')][_0xefc1('0x44')]);_0x365459[_0xefc1('0x2c')]=_[_0xefc1('0x2b')](_0x2e64cd[_0xefc1('0x2c')]);_0x365459[_0xefc1('0x2d')]=_['intersection'](_0x365459[_0xefc1('0x2a')],_0x365459[_0xefc1('0x2c')]);_0x2b5605[_0xefc1('0x2f')]=_['intersection'](_0x365459[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x2e64cd['query']['fields']));_0x2b5605[_0xefc1('0x2f')]=_0x2b5605[_0xefc1('0x2f')][_0xefc1('0x45')]?_0x2b5605[_0xefc1('0x2f')]:_0x365459[_0xefc1('0x2a')];if(!_0x2e64cd[_0xefc1('0x2c')][_0xefc1('0x31')]('nolimit')){_0x2b5605[_0xefc1('0x1c')]=qs['limit'](_0x2e64cd[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x2b5605[_0xefc1('0x1b')]=qs[_0xefc1('0x1b')](_0x2e64cd['query']['offset']);}_0x2b5605[_0xefc1('0x32')]=qs['sort'](_0x2e64cd['query'][_0xefc1('0x33')]);_0x2b5605[_0xefc1('0x36')]=qs[_0xefc1('0x2d')](_[_0xefc1('0x34')](_0x2e64cd['query'],_0x365459['filters']));_0x2b5605[_0xefc1('0x36')][_0xefc1('0x58')]=_0x18fd1a['id'];if(_0x2e64cd['query'][_0xefc1('0x35')]){_0x2b5605['where']=_[_0xefc1('0x37')](_0x2b5605[_0xefc1('0x36')],{'$or':_[_0xefc1('0x38')](_0x2b5605['attributes'],function(_0x35c690){var _0x42ee5e={};_0x42ee5e[_0x35c690]={'$like':'%'+_0x2e64cd[_0xefc1('0x2c')][_0xefc1('0x35')]+'%'};return _0x42ee5e;})});}_0x2b5605=_['merge']({},_0x2b5605,_0x2e64cd['options']);return db[_0xefc1('0x5c')][_0xefc1('0x3d')]({'where':_0x2b5605[_0xefc1('0x36')]})[_0xefc1('0x23')](function(_0x2801b8){_0x438138[_0xefc1('0x3d')]=_0x2801b8;if(_0x2e64cd[_0xefc1('0x2c')]['includeAll']){_0x2b5605['include']=[{'all':!![]}];}return db[_0xefc1('0x5c')][_0xefc1('0x40')](_0x2b5605);})['then'](function(_0x30ed55){_0x438138[_0xefc1('0x59')]=_0x30ed55;return _0x438138;});}})['then'](respondWithFilteredResult(_0x12df49,_0x2b5605))[_0xefc1('0x41')](handleError(_0x12df49,null));};exports[_0xefc1('0x5d')]=function(_0x489a80,_0x5cf16a,_0x158cb6){var _0x1a54f2={'raw':!![],'where':{}};var _0x57d0e6={};var _0x484b67={'count':0x0,'rows':[]};return db[_0xefc1('0x29')][_0xefc1('0x56')]({'where':{'id':_0x489a80['params']['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x5cf16a,null))[_0xefc1('0x23')](function(_0x5118e8){if(_0x5118e8){_0x57d0e6[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db[_0xefc1('0x5e')][_0xefc1('0x44')]);_0x57d0e6['query']=_[_0xefc1('0x2b')](_0x489a80[_0xefc1('0x2c')]);_0x57d0e6[_0xefc1('0x2d')]=_[_0xefc1('0x2e')](_0x57d0e6[_0xefc1('0x2a')],_0x57d0e6['query']);_0x1a54f2['attributes']=_[_0xefc1('0x2e')](_0x57d0e6[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x489a80[_0xefc1('0x2c')][_0xefc1('0x30')]));_0x1a54f2[_0xefc1('0x2f')]=_0x1a54f2[_0xefc1('0x2f')][_0xefc1('0x45')]?_0x1a54f2[_0xefc1('0x2f')]:_0x57d0e6[_0xefc1('0x2a')];if(!_0x489a80[_0xefc1('0x2c')][_0xefc1('0x31')](_0xefc1('0x5f'))){_0x1a54f2[_0xefc1('0x1c')]=qs[_0xefc1('0x1c')](_0x489a80[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x1a54f2[_0xefc1('0x1b')]=qs['offset'](_0x489a80[_0xefc1('0x2c')][_0xefc1('0x1b')]);}_0x1a54f2[_0xefc1('0x32')]=qs[_0xefc1('0x33')](_0x489a80[_0xefc1('0x2c')][_0xefc1('0x33')]);_0x1a54f2['where']=qs['filters'](_[_0xefc1('0x34')](_0x489a80[_0xefc1('0x2c')],_0x57d0e6['filters']));_0x1a54f2[_0xefc1('0x36')]['CampaignId']=_0x5118e8['id'];if(_0x489a80['query'][_0xefc1('0x35')]){_0x1a54f2[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x1a54f2[_0xefc1('0x36')],{'$or':_[_0xefc1('0x38')](_0x1a54f2[_0xefc1('0x2f')],function(_0x461041){var _0x5498b2={};_0x5498b2[_0x461041]={'$like':'%'+_0x489a80[_0xefc1('0x2c')][_0xefc1('0x35')]+'%'};return _0x5498b2;})});}_0x1a54f2=_['merge']({},_0x1a54f2,_0x489a80[_0xefc1('0x3c')]);return db[_0xefc1('0x5e')][_0xefc1('0x3d')]({'where':_0x1a54f2['where']})[_0xefc1('0x23')](function(_0x5bdefa){_0x484b67['count']=_0x5bdefa;if(_0x489a80[_0xefc1('0x2c')][_0xefc1('0x3e')]){_0x1a54f2[_0xefc1('0x3f')]=[{'all':!![]}];}return db[_0xefc1('0x5e')][_0xefc1('0x40')](_0x1a54f2);})['then'](function(_0x1020fb){_0x484b67['rows']=_0x1020fb;return _0x484b67;});}})[_0xefc1('0x23')](respondWithFilteredResult(_0x5cf16a,_0x1a54f2))[_0xefc1('0x41')](handleError(_0x5cf16a,null));};exports[_0xefc1('0x60')]=function(_0x20d50a,_0x4f630a,_0x316884){var _0x114ac0={};var _0x4194ad={};var _0x5b48b7;var _0x1606d3;return db[_0xefc1('0x29')][_0xefc1('0x56')]({'where':{'id':_0x20d50a[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x4f630a,null))['then'](function(_0x4705f0){if(_0x4705f0){_0x5b48b7=_0x4705f0;_0x4194ad[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db['CmList'][_0xefc1('0x44')]);_0x4194ad[_0xefc1('0x2c')]=_[_0xefc1('0x2b')](_0x20d50a[_0xefc1('0x2c')]);_0x4194ad[_0xefc1('0x2d')]=_[_0xefc1('0x2e')](_0x4194ad[_0xefc1('0x2a')],_0x4194ad[_0xefc1('0x2c')]);_0x114ac0[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x4194ad[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x20d50a[_0xefc1('0x2c')]['fields']));_0x114ac0[_0xefc1('0x2f')]=_0x114ac0[_0xefc1('0x2f')][_0xefc1('0x45')]?_0x114ac0[_0xefc1('0x2f')]:_0x4194ad[_0xefc1('0x2a')];_0x114ac0[_0xefc1('0x32')]=qs[_0xefc1('0x33')](_0x20d50a[_0xefc1('0x2c')]['sort']);_0x114ac0[_0xefc1('0x36')]=qs['filters'](_['pick'](_0x20d50a['query'],_0x4194ad[_0xefc1('0x2d')]));if(_0x20d50a[_0xefc1('0x2c')][_0xefc1('0x35')]){_0x114ac0['where']=_[_0xefc1('0x37')](_0x114ac0[_0xefc1('0x36')],{'$or':_[_0xefc1('0x38')](_0x114ac0[_0xefc1('0x2f')],function(_0x3a9ae7){var _0x3888e9={};_0x3888e9[_0x3a9ae7]={'$like':'%'+_0x20d50a[_0xefc1('0x2c')][_0xefc1('0x35')]+'%'};return _0x3888e9;})});}_0x114ac0=_['merge']({},_0x114ac0,_0x20d50a[_0xefc1('0x3c')]);return _0x5b48b7[_0xefc1('0x60')](_0x114ac0);}})[_0xefc1('0x23')](function(_0x419744){if(_0x419744){_0x1606d3=_0x419744[_0xefc1('0x45')];if(!_0x20d50a['query'][_0xefc1('0x31')]('nolimit')){_0x114ac0['limit']=qs[_0xefc1('0x1c')](_0x20d50a[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x114ac0[_0xefc1('0x1b')]=qs['offset'](_0x20d50a[_0xefc1('0x2c')][_0xefc1('0x1b')]);}return _0x5b48b7['getLists'](_0x114ac0);}})[_0xefc1('0x23')](function(_0x1db80c){if(_0x1db80c){return _0x1db80c?{'count':_0x1606d3,'rows':_0x1db80c}:null;}})[_0xefc1('0x23')](respondWithResult(_0x4f630a,null))['catch'](handleError(_0x4f630a,null));};exports[_0xefc1('0x61')]=function(_0x258d43,_0x5821c9,_0x5e7676){var _0x62405c,_0x544d06;return db[_0xefc1('0x29')][_0xefc1('0x46')]({'where':{'id':_0x258d43[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x5821c9,null))[_0xefc1('0x23')](function(_0x320598){if(_0x320598){_0x544d06=_0x320598;return _0x320598['addLists'](_0x258d43[_0xefc1('0x48')][_0xefc1('0x62')],_[_0xefc1('0x63')](_0x258d43['body'],[_0xefc1('0x62'),'id'])||{});}return null;})[_0xefc1('0x64')](function(_0x282684){var _0x370c6f;_0x62405c=_0x282684||[];var _0x40802e=[];if(_0x282684){for(var _0x1d9f46=0x0;_0x1d9f46<_0x282684[_0xefc1('0x45')];_0x1d9f46+=0x1){var _0x347bd9=_0x282684[_0x1d9f46][_0xefc1('0x24')]({'plain':!![]});_0x544d06[_0xefc1('0x65')]=_0x258d43[_0xefc1('0x48')][_0xefc1('0x65')]?_0x258d43[_0xefc1('0x48')][_0xefc1('0x65')]:_0x544d06[_0xefc1('0x65')];switch(_0x544d06[_0xefc1('0x65')]){case _0xefc1('0x66'):_0x370c6f=squel['insert']()['into'](_0xefc1('0x67'))[_0xefc1('0x68')](['phone',_0xefc1('0x69'),_0xefc1('0x6a'),_0xefc1('0x6b'),_0xefc1('0x58'),_0xefc1('0x53'),_0xefc1('0x54')],squel[_0xefc1('0x6c')]()[_0xefc1('0x3b')](_0xefc1('0x6d'),_0xefc1('0x6d'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x69'))[_0xefc1('0x3b')]('id',_0xefc1('0x6a'))[_0xefc1('0x3b')](_0x347bd9[_0xefc1('0x6f')][_0xefc1('0x70')](),_0xefc1('0x6b'))[_0xefc1('0x3b')](_0x258d43[_0xefc1('0x43')]['id'][_0xefc1('0x70')](),'CampaignId')['field'](_0xefc1('0x6e'),'createdAt')[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x54'))[_0xefc1('0x71')](_0xefc1('0x72'))[_0xefc1('0x36')]('deletedAt\x20IS\x20NULL')[_0xefc1('0x36')]('ListId\x20=\x20?',_0x347bd9['CmListId'][_0xefc1('0x70')]())[_0xefc1('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0xefc1('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0xefc1('0x6c')]()[_0xefc1('0x3b')](_0xefc1('0x73'))[_0xefc1('0x71')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x258d43[_0xefc1('0x43')]['id']['toString']()))[_0xefc1('0x36')](_0xefc1('0x74'),squel['select']()[_0xefc1('0x3b')](_0xefc1('0x75'))[_0xefc1('0x71')](_0xefc1('0x67'))['where'](_0xefc1('0x76'),_0x258d43[_0xefc1('0x43')]['id']['toString']())))['toString']();break;case _0xefc1('0x77'):_0x370c6f=squel[_0xefc1('0x78')]()[_0xefc1('0x79')]('cm_hopper')['fromQuery']([_0xefc1('0x6d'),_0xefc1('0x69'),_0xefc1('0x6a'),_0xefc1('0x6b'),_0xefc1('0x58'),_0xefc1('0x53'),_0xefc1('0x54')],squel['select']()[_0xefc1('0x3b')](_0xefc1('0x6d'),_0xefc1('0x6d'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x69'))[_0xefc1('0x3b')]('id',_0xefc1('0x6a'))[_0xefc1('0x3b')](_0x347bd9[_0xefc1('0x6f')][_0xefc1('0x70')](),_0xefc1('0x6b'))['field'](_0x258d43[_0xefc1('0x43')]['id'][_0xefc1('0x70')](),'CampaignId')[_0xefc1('0x3b')]('NOW()',_0xefc1('0x53'))[_0xefc1('0x3b')]('NOW()',_0xefc1('0x54'))[_0xefc1('0x71')](_0xefc1('0x72'))[_0xefc1('0x36')](_0xefc1('0x7a'))[_0xefc1('0x36')](_0xefc1('0x7b'),_0x347bd9[_0xefc1('0x6f')][_0xefc1('0x70')]())[_0xefc1('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0xefc1('0x36')](_0xefc1('0x74'),squel[_0xefc1('0x6c')]()[_0xefc1('0x3b')](_0xefc1('0x75'))['from'](_0xefc1('0x67'))['where'](_0xefc1('0x76'),_0x258d43['params']['id'][_0xefc1('0x70')]())))[_0xefc1('0x70')]();break;default:_0x370c6f=squel['insert']()[_0xefc1('0x79')]('cm_hopper')[_0xefc1('0x68')]([_0xefc1('0x6d'),_0xefc1('0x69'),_0xefc1('0x6a'),_0xefc1('0x6b'),'CampaignId',_0xefc1('0x53'),_0xefc1('0x54')],squel[_0xefc1('0x6c')]()[_0xefc1('0x3b')](_0xefc1('0x6d'),_0xefc1('0x6d'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x69'))[_0xefc1('0x3b')]('id',_0xefc1('0x6a'))['field'](_0x347bd9[_0xefc1('0x6f')][_0xefc1('0x70')](),_0xefc1('0x6b'))['field'](_0x258d43[_0xefc1('0x43')]['id']['toString'](),_0xefc1('0x58'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x53'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x54'))[_0xefc1('0x71')](_0xefc1('0x72'))[_0xefc1('0x36')]('deletedAt\x20IS\x20NULL')[_0xefc1('0x36')](_0xefc1('0x7b'),_0x347bd9['CmListId'][_0xefc1('0x70')]())[_0xefc1('0x36')](_0xefc1('0x7c')))[_0xefc1('0x70')]();}_0x40802e[_0xefc1('0x7d')](db[_0xefc1('0x7e')]['query'](_0x370c6f));}return BPromise['all'](_0x40802e);}})[_0xefc1('0x23')](function(){return _0x62405c;})[_0xefc1('0x23')](respondWithResult(_0x5821c9,null))['catch'](handleError(_0x5821c9,null));};exports[_0xefc1('0x7f')]=function(_0x28611b,_0x31074f,_0x1c9d9c){return db['Campaign'][_0xefc1('0x46')]({'where':{'id':_0x28611b[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x31074f,null))[_0xefc1('0x23')](function(_0x446d23){if(_0x446d23){return _0x446d23[_0xefc1('0x7f')](_0x28611b[_0xefc1('0x2c')][_0xefc1('0x62')]);}})[_0xefc1('0x23')](function(_0x328d7c){if(_0x328d7c){return db[_0xefc1('0x57')][_0xefc1('0x22')]({'where':{'ListId':_0x28611b[_0xefc1('0x2c')]['ids'],'CampaignId':_0x28611b[_0xefc1('0x43')]['id']}})['then'](function(){return _0x328d7c;});}})[_0xefc1('0x23')](respondWithStatusCode(_0x31074f,null))[_0xefc1('0x41')](handleError(_0x31074f,null));};exports[_0xefc1('0x80')]=function(_0x57df77,_0x1af9f5,_0x109c9e){var _0x2d340f={'raw':!![],'where':{}};var _0x5263c3={};var _0x229779={'count':0x0,'rows':[]};return db[_0xefc1('0x29')]['findOne']({'where':{'id':_0x57df77[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x1af9f5,null))[_0xefc1('0x23')](function(_0x3c9cd6){if(_0x3c9cd6){_0x5263c3[_0xefc1('0x2a')]=_[_0xefc1('0x2b')](db[_0xefc1('0x81')][_0xefc1('0x44')]);_0x5263c3['query']=_[_0xefc1('0x2b')](_0x57df77[_0xefc1('0x2c')]);_0x5263c3['filters']=_[_0xefc1('0x2e')](_0x5263c3['model'],_0x5263c3[_0xefc1('0x2c')]);_0x2d340f[_0xefc1('0x2f')]=_[_0xefc1('0x2e')](_0x5263c3[_0xefc1('0x2a')],qs[_0xefc1('0x30')](_0x57df77['query'][_0xefc1('0x30')]));_0x2d340f[_0xefc1('0x2f')]=_0x2d340f[_0xefc1('0x2f')]['length']?_0x2d340f[_0xefc1('0x2f')]:_0x5263c3['model'];if(!_0x57df77[_0xefc1('0x2c')][_0xefc1('0x31')](_0xefc1('0x5f'))){_0x2d340f[_0xefc1('0x1c')]=qs[_0xefc1('0x1c')](_0x57df77[_0xefc1('0x2c')][_0xefc1('0x1c')]);_0x2d340f[_0xefc1('0x1b')]=qs['offset'](_0x57df77[_0xefc1('0x2c')][_0xefc1('0x1b')]);}_0x2d340f[_0xefc1('0x32')]=qs['sort'](_0x57df77[_0xefc1('0x2c')]['sort']);_0x2d340f[_0xefc1('0x36')]=qs['filters'](_[_0xefc1('0x34')](_0x57df77['query'],_0x5263c3[_0xefc1('0x2d')]));_0x2d340f['where'][_0xefc1('0x58')]=_0x3c9cd6['id'];if(_0x57df77[_0xefc1('0x2c')][_0xefc1('0x35')]){_0x2d340f[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x2d340f['where'],{'$or':_['map'](_0x2d340f[_0xefc1('0x2f')],function(_0x4b777f){var _0x162d7e={};_0x162d7e[_0x4b777f]={'$like':'%'+_0x57df77['query'][_0xefc1('0x35')]+'%'};return _0x162d7e;})});}_0x2d340f=_[_0xefc1('0x37')]({},_0x2d340f,_0x57df77[_0xefc1('0x3c')]);return db[_0xefc1('0x81')]['count']({'where':_0x2d340f[_0xefc1('0x36')]})[_0xefc1('0x23')](function(_0x5880ea){_0x229779[_0xefc1('0x3d')]=_0x5880ea;if(_0x57df77[_0xefc1('0x2c')][_0xefc1('0x3e')]){_0x2d340f[_0xefc1('0x3f')]=[{'all':!![]}];}return db['CmList'][_0xefc1('0x40')](_0x2d340f);})[_0xefc1('0x23')](function(_0x9df2bb){_0x229779[_0xefc1('0x59')]=_0x9df2bb;return _0x229779;});}})[_0xefc1('0x23')](respondWithFilteredResult(_0x1af9f5,_0x2d340f))[_0xefc1('0x41')](handleError(_0x1af9f5,null));};exports[_0xefc1('0x82')]=function(_0x5d6ebe,_0x22e00b,_0x5466c7){var _0x1923f6,_0x5cfd2a;return db[_0xefc1('0x29')][_0xefc1('0x46')]({'where':{'id':_0x5d6ebe['params']['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x22e00b,null))['then'](function(_0x21b0ad){if(_0x21b0ad){_0x5cfd2a=_0x21b0ad;return _0x21b0ad[_0xefc1('0x82')](_0x5d6ebe[_0xefc1('0x48')][_0xefc1('0x62')],_['omit'](_0x5d6ebe[_0xefc1('0x48')],[_0xefc1('0x62'),'id'])||{});}return null;})[_0xefc1('0x64')](function(_0x49d7d6){var _0x49f917;_0x1923f6=_0x49d7d6||[];var _0x5c1528=[];if(_0x49d7d6){for(var _0x1f6e2a=0x0;_0x1f6e2a<_0x49d7d6[_0xefc1('0x45')];_0x1f6e2a+=0x1){var _0x577c34=_0x49d7d6[_0x1f6e2a][_0xefc1('0x24')]({'plain':!![]});_0x49f917=squel[_0xefc1('0x78')]()[_0xefc1('0x79')](_0xefc1('0x83'))['fromQuery']([_0xefc1('0x6d'),_0xefc1('0x6a'),_0xefc1('0x6b'),'CampaignId',_0xefc1('0x53'),_0xefc1('0x54')],squel['select']()[_0xefc1('0x3b')](_0xefc1('0x6d'),_0xefc1('0x6d'))[_0xefc1('0x3b')]('id',_0xefc1('0x6a'))[_0xefc1('0x3b')](_0x577c34[_0xefc1('0x6f')][_0xefc1('0x70')](),'ListId')[_0xefc1('0x3b')](_0x5d6ebe[_0xefc1('0x43')]['id'][_0xefc1('0x70')](),_0xefc1('0x58'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x53'))[_0xefc1('0x3b')](_0xefc1('0x6e'),_0xefc1('0x54'))[_0xefc1('0x71')](_0xefc1('0x72'))[_0xefc1('0x36')]('deletedAt\x20IS\x20NULL')[_0xefc1('0x36')](_0xefc1('0x7b'),_0x577c34['CmListId'][_0xefc1('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x5c1528[_0xefc1('0x7d')](db['sequelize'][_0xefc1('0x2c')](_0x49f917));}return BPromise['all'](_0x5c1528);}})[_0xefc1('0x23')](function(){return _0x1923f6;})[_0xefc1('0x23')](respondWithResult(_0x22e00b,null))[_0xefc1('0x41')](handleError(_0x22e00b,null));};exports['removeBlackLists']=function(_0x56f46c,_0x1f429b,_0x16fe8b){return db[_0xefc1('0x29')]['find']({'where':{'id':_0x56f46c[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](handleEntityNotFound(_0x1f429b,null))[_0xefc1('0x23')](function(_0x5cbc76){if(_0x5cbc76){return _0x5cbc76[_0xefc1('0x84')](_0x56f46c[_0xefc1('0x2c')]['ids']);}})['then'](function(_0x9779c8){if(_0x9779c8){return db[_0xefc1('0x5e')]['destroy']({'where':{'ListId':_0x56f46c[_0xefc1('0x2c')][_0xefc1('0x62')],'CampaignId':_0x56f46c[_0xefc1('0x43')]['id']}})[_0xefc1('0x23')](function(){return _0x9779c8;});}})['then'](respondWithStatusCode(_0x1f429b,null))[_0xefc1('0x41')](handleError(_0x1f429b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a1f9df3..435d971 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 _0xb522=['rimraf','../../config/environment','./campaign.attributes','define','campaigns','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33a275,_0x112bbf){var _0xbd9832=function(_0x1e8358){while(--_0x1e8358){_0x33a275['push'](_0x33a275['shift']());}};_0xbd9832(++_0x112bbf);}(_0xb522,0x89));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2b52('0x0'));var logger=require(_0x2b52('0x1'))(_0x2b52('0x2'));var moment=require(_0x2b52('0x3'));var BPromise=require(_0x2b52('0x4'));var rp=require(_0x2b52('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b52('0x6'));var config=require(_0x2b52('0x7'));var attributes=require(_0x2b52('0x8'));module['exports']=function(_0x4cfd6e,_0x11380f){return _0x4cfd6e[_0x2b52('0x9')]('Campaign',attributes,{'tableName':_0x2b52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25f8=['../../config/environment','./campaign.attributes','define','campaigns','util','../../config/logger','moment','path','rimraf'];(function(_0x52cdc1,_0x32e3ac){var _0x7796d1=function(_0x53ae95){while(--_0x53ae95){_0x52cdc1['push'](_0x52cdc1['shift']());}};_0x7796d1(++_0x32e3ac);}(_0x25f8,0xc1));var _0x825f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x25f8[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x825f('0x0'));var logger=require(_0x825f('0x1'))('api');var moment=require(_0x825f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x825f('0x3'));var rimraf=require(_0x825f('0x4'));var config=require(_0x825f('0x5'));var attributes=require(_0x825f('0x6'));module['exports']=function(_0xc81ef8,_0x5bfa3c){return _0xc81ef8[_0x825f('0x7')]('Campaign',attributes,{'tableName':_0x825f('0x8'),'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 c4ed808..657739a 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 _0x3f3f=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3a0ec8,_0x3f1ee4){var _0x25cc1f=function(_0x131f86){while(--_0x131f86){_0x3a0ec8['push'](_0x3a0ec8['shift']());}};_0x25cc1f(++_0x3f1ee4);}(_0x3f3f,0x19c));var _0xf3f3=function(_0xae0c01,_0x449c99){_0xae0c01=_0xae0c01-0x0;var _0x913e86=_0x3f3f[_0xae0c01];return _0x913e86;};'use strict';var _=require(_0xf3f3('0x0'));var util=require(_0xf3f3('0x1'));var moment=require(_0xf3f3('0x2'));var BPromise=require(_0xf3f3('0x3'));var rs=require(_0xf3f3('0x4'));var fs=require('fs');var Redis=require(_0xf3f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3f3('0x6'));var logger=require('../../config/logger')(_0xf3f3('0x7'));var config=require(_0xf3f3('0x8'));var jayson=require(_0xf3f3('0x9'));var client=jayson[_0xf3f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5353e4,_0x4193c6,_0x34db77){return new BPromise(function(_0x2751d6,_0x54a547){return client[_0xf3f3('0xb')](_0x5353e4,_0x34db77)[_0xf3f3('0xc')](function(_0x2f46c7){logger[_0xf3f3('0xd')](_0xf3f3('0xe'),_0x4193c6,_0xf3f3('0xf'));logger[_0xf3f3('0x10')](_0xf3f3('0x11'),_0x4193c6,_0xf3f3('0xf'),JSON['stringify'](_0x2f46c7));if(_0x2f46c7[_0xf3f3('0x12')]){if(_0x2f46c7[_0xf3f3('0x12')][_0xf3f3('0x13')]===0x1f4){logger[_0xf3f3('0x12')](_0xf3f3('0xe'),_0x4193c6,_0x2f46c7[_0xf3f3('0x12')][_0xf3f3('0x14')]);return _0x54a547(_0x2f46c7['error']['message']);}logger[_0xf3f3('0x12')](_0xf3f3('0xe'),_0x4193c6,_0x2f46c7[_0xf3f3('0x12')]['message']);return _0x2751d6(_0x2f46c7['error']['message']);}else{logger[_0xf3f3('0xd')](_0xf3f3('0xe'),_0x4193c6,_0xf3f3('0xf'));_0x2751d6(_0x2f46c7[_0xf3f3('0x15')]['message']);}})['catch'](function(_0x4e24e1){logger[_0xf3f3('0x12')](_0xf3f3('0xe'),_0x4193c6,_0x4e24e1);_0x54a547(_0x4e24e1);});});}exports[_0xf3f3('0x16')]=function(_0x4cedb8){var _0x341579=this;return new Promise(function(_0x480fd2,_0x5ae861){return db[_0xf3f3('0x17')][_0xf3f3('0x18')]({'raw':_0x4cedb8[_0xf3f3('0x19')]?_0x4cedb8['options'][_0xf3f3('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cedb8[_0xf3f3('0x19')]?_0x4cedb8['options'][_0xf3f3('0x1b')]||null:null,'attributes':_0x4cedb8['options']?_0x4cedb8['options'][_0xf3f3('0x1c')]||null:null,'limit':_0x4cedb8[_0xf3f3('0x19')]?_0x4cedb8[_0xf3f3('0x19')][_0xf3f3('0x1d')]||null:null,'include':_0x4cedb8[_0xf3f3('0x19')]?_0x4cedb8[_0xf3f3('0x19')][_0xf3f3('0x1e')]?_['map'](_0x4cedb8[_0xf3f3('0x19')][_0xf3f3('0x1e')],function(_0x230e41){return{'model':db[_0x230e41[_0xf3f3('0x1f')]],'as':_0x230e41['as'],'attributes':_0x230e41['attributes'],'include':_0x230e41[_0xf3f3('0x1e')]?_[_0xf3f3('0x20')](_0x230e41[_0xf3f3('0x1e')],function(_0x371a66){return{'model':db[_0x371a66[_0xf3f3('0x1f')]],'as':_0x371a66['as'],'attributes':_0x371a66['attributes'],'include':_0x371a66['include']?_[_0xf3f3('0x20')](_0x371a66[_0xf3f3('0x1e')],function(_0x29c02d){return{'model':db[_0x29c02d[_0xf3f3('0x1f')]],'as':_0x29c02d['as'],'attributes':_0x29c02d[_0xf3f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf3f3('0xc')](function(_0x5000f2){logger['info'](_0xf3f3('0x16'),_0x4cedb8);logger['debug'](_0xf3f3('0x16'),_0x4cedb8,JSON['stringify'](_0x5000f2));_0x480fd2(_0x5000f2);})['catch'](function(_0x3b11cb){logger[_0xf3f3('0x12')](_0xf3f3('0x16'),_0x3b11cb[_0xf3f3('0x14')],_0x4cedb8);_0x5ae861(_0x341579['error'](0x1f4,_0x3b11cb[_0xf3f3('0x14')]));});});}; \ No newline at end of file +var _0xaced=['message','result','catch','GetCampaign','Campaign','options','where','attributes','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d46fe,_0x3ba62a){var _0x66dfaf=function(_0x17ade6){while(--_0x17ade6){_0x2d46fe['push'](_0x2d46fe['shift']());}};_0x66dfaf(++_0x3ba62a);}(_0xaced,0x9d));var _0xdace=function(_0x28c516,_0x367f3c){_0x28c516=_0x28c516-0x0;var _0x234051=_0xaced[_0x28c516];return _0x234051;};'use strict';var _=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var moment=require(_0xdace('0x2'));var BPromise=require('bluebird');var rs=require(_0xdace('0x3'));var fs=require('fs');var Redis=require(_0xdace('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdace('0x5'))(_0xdace('0x6'));var config=require(_0xdace('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdace('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a896f,_0x512d01,_0xb730de){return new BPromise(function(_0x5eb164,_0x3c2f41){return client[_0xdace('0x9')](_0x1a896f,_0xb730de)[_0xdace('0xa')](function(_0x4e9fd7){logger[_0xdace('0xb')](_0xdace('0xc'),_0x512d01,_0xdace('0xd'));logger[_0xdace('0xe')](_0xdace('0xf'),_0x512d01,_0xdace('0xd'),JSON['stringify'](_0x4e9fd7));if(_0x4e9fd7[_0xdace('0x10')]){if(_0x4e9fd7['error']['code']===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x512d01,_0x4e9fd7[_0xdace('0x10')][_0xdace('0x11')]);return _0x3c2f41(_0x4e9fd7[_0xdace('0x10')][_0xdace('0x11')]);}logger[_0xdace('0x10')]('Campaign,\x20%s,\x20%s',_0x512d01,_0x4e9fd7[_0xdace('0x10')][_0xdace('0x11')]);return _0x5eb164(_0x4e9fd7[_0xdace('0x10')][_0xdace('0x11')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x512d01,_0xdace('0xd'));_0x5eb164(_0x4e9fd7[_0xdace('0x12')][_0xdace('0x11')]);}})[_0xdace('0x13')](function(_0x4ee0fb){logger[_0xdace('0x10')](_0xdace('0xc'),_0x512d01,_0x4ee0fb);_0x3c2f41(_0x4ee0fb);});});}exports[_0xdace('0x14')]=function(_0x38cf4b){var _0x1a2ab8=this;return new Promise(function(_0x340fd6,_0x59e80a){return db[_0xdace('0x15')]['findAll']({'raw':_0x38cf4b['options']?_0x38cf4b[_0xdace('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x38cf4b[_0xdace('0x16')]?_0x38cf4b[_0xdace('0x16')][_0xdace('0x17')]||null:null,'attributes':_0x38cf4b['options']?_0x38cf4b[_0xdace('0x16')][_0xdace('0x18')]||null:null,'limit':_0x38cf4b[_0xdace('0x16')]?_0x38cf4b[_0xdace('0x16')]['limit']||null:null,'include':_0x38cf4b[_0xdace('0x16')]?_0x38cf4b[_0xdace('0x16')][_0xdace('0x19')]?_[_0xdace('0x1a')](_0x38cf4b[_0xdace('0x16')]['include'],function(_0x112f67){return{'model':db[_0x112f67[_0xdace('0x1b')]],'as':_0x112f67['as'],'attributes':_0x112f67[_0xdace('0x18')],'include':_0x112f67[_0xdace('0x19')]?_[_0xdace('0x1a')](_0x112f67[_0xdace('0x19')],function(_0x159b29){return{'model':db[_0x159b29['model']],'as':_0x159b29['as'],'attributes':_0x159b29[_0xdace('0x18')],'include':_0x159b29[_0xdace('0x19')]?_[_0xdace('0x1a')](_0x159b29[_0xdace('0x19')],function(_0x4aba63){return{'model':db[_0x4aba63['model']],'as':_0x4aba63['as'],'attributes':_0x4aba63[_0xdace('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdace('0xa')](function(_0x605fc5){logger[_0xdace('0xb')](_0xdace('0x14'),_0x38cf4b);logger[_0xdace('0xe')](_0xdace('0x14'),_0x38cf4b,JSON[_0xdace('0x1c')](_0x605fc5));_0x340fd6(_0x605fc5);})['catch'](function(_0x57af93){logger[_0xdace('0x10')](_0xdace('0x14'),_0x57af93[_0xdace('0x11')],_0x38cf4b);_0x59e80a(_0x1a2ab8['error'](0x1f4,_0x57af93[_0xdace('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d60bd61..6062a3a 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 _0xc76e=['isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','/:id','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get'];(function(_0x3a9a94,_0x50bd57){var _0x34bef2=function(_0x389a95){while(--_0x389a95){_0x3a9a94['push'](_0x3a9a94['shift']());}};_0x34bef2(++_0x50bd57);}(_0xc76e,0x1b6));var _0xec76=function(_0x2f82de,_0x85c7b7){_0x2f82de=_0x2f82de-0x0;var _0x3cb2c7=_0xc76e[_0x2f82de];return _0x3cb2c7;};'use strict';var multer=require(_0xec76('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec76('0x1'));var express=require(_0xec76('0x2'));var router=express[_0xec76('0x3')]();var auth=require(_0xec76('0x4'));var interaction=require(_0xec76('0x5'));var config=require(_0xec76('0x6'));var controller=require(_0xec76('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xec76('0x8')]);router[_0xec76('0x9')]('/:id',auth[_0xec76('0xa')](),controller[_0xec76('0xb')]);router[_0xec76('0x9')](_0xec76('0xc'),auth[_0xec76('0xa')](),controller[_0xec76('0xd')]);router[_0xec76('0x9')]('/:id/hopper_histories',auth[_0xec76('0xa')](),controller[_0xec76('0xe')]);router[_0xec76('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xec76('0xf')]);router['get'](_0xec76('0x10'),auth[_0xec76('0xa')](),controller[_0xec76('0x11')]);router[_0xec76('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xec76('0x12')]);router[_0xec76('0x9')](_0xec76('0x13'),auth[_0xec76('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0xec76('0xa')](),controller['create']);router[_0xec76('0x14')](_0xec76('0x15'),auth['isAuthenticated'](),controller[_0xec76('0x16')]);router[_0xec76('0x14')]('/:id/lists',auth[_0xec76('0xa')](),controller[_0xec76('0x17')]);router[_0xec76('0x14')](_0xec76('0x13'),auth[_0xec76('0xa')](),controller[_0xec76('0x18')]);router['put'](_0xec76('0x19'),auth[_0xec76('0xa')](),controller['update']);router[_0xec76('0x1a')](_0xec76('0x19'),auth[_0xec76('0xa')](),controller[_0xec76('0x1b')]);router[_0xec76('0x1a')](_0xec76('0x1c'),auth[_0xec76('0xa')](),controller[_0xec76('0x1d')]);router[_0xec76('0x1a')](_0xec76('0x13'),auth[_0xec76('0xa')](),controller[_0xec76('0x1e')]);module[_0xec76('0x1f')]=router; \ No newline at end of file +var _0xb40d=['getBlackLists','post','clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists'];(function(_0x1ca500,_0x163e17){var _0x3e8cfe=function(_0x2f57c9){while(--_0x2f57c9){_0x1ca500['push'](_0x1ca500['shift']());}};_0x3e8cfe(++_0x163e17);}(_0xb40d,0x65));var _0xdb40=function(_0x544024,_0x2f92ee){_0x544024=_0x544024-0x0;var _0x41542b=_0xb40d[_0x544024];return _0x41542b;};'use strict';var multer=require(_0xdb40('0x0'));var util=require(_0xdb40('0x1'));var path=require('path');var timeout=require(_0xdb40('0x2'));var express=require(_0xdb40('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdb40('0x4'));var config=require(_0xdb40('0x5'));var controller=require(_0xdb40('0x6'));router[_0xdb40('0x7')]('/',auth[_0xdb40('0x8')](),controller['index']);router['get'](_0xdb40('0x9'),auth[_0xdb40('0x8')](),controller[_0xdb40('0xa')]);router[_0xdb40('0x7')](_0xdb40('0xb'),auth[_0xdb40('0x8')](),controller[_0xdb40('0xc')]);router['get'](_0xdb40('0xd'),auth[_0xdb40('0x8')](),controller['getHopperHistories']);router['get'](_0xdb40('0xe'),auth[_0xdb40('0x8')](),controller['getHopperFinals']);router['get'](_0xdb40('0xf'),auth['isAuthenticated'](),controller[_0xdb40('0x10')]);router[_0xdb40('0x7')]('/:id/lists',auth[_0xdb40('0x8')](),controller[_0xdb40('0x11')]);router[_0xdb40('0x7')](_0xdb40('0x12'),auth[_0xdb40('0x8')](),controller[_0xdb40('0x13')]);router[_0xdb40('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdb40('0x14')]('/:id/clone',auth[_0xdb40('0x8')](),controller[_0xdb40('0x15')]);router[_0xdb40('0x14')](_0xdb40('0x16'),auth[_0xdb40('0x8')](),controller[_0xdb40('0x17')]);router['post']('/:id/blacklists',auth[_0xdb40('0x8')](),controller[_0xdb40('0x18')]);router[_0xdb40('0x19')](_0xdb40('0x9'),auth[_0xdb40('0x8')](),controller['update']);router[_0xdb40('0x1a')](_0xdb40('0x9'),auth[_0xdb40('0x8')](),controller[_0xdb40('0x1b')]);router[_0xdb40('0x1a')](_0xdb40('0x16'),auth[_0xdb40('0x8')](),controller[_0xdb40('0x1c')]);router[_0xdb40('0x1a')](_0xdb40('0x12'),auth[_0xdb40('0x8')](),controller[_0xdb40('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 5501402..8f77ddd 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 _0xabc7=['TEXT','VIRTUAL','getDataValue','exports','STRING'];(function(_0x5a0253,_0x32b2b6){var _0x3e07c9=function(_0x16e829){while(--_0x16e829){_0x5a0253['push'](_0x5a0253['shift']());}};_0x3e07c9(++_0x32b2b6);}(_0xabc7,0x1bb));var _0x7abc=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xabc7[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x7abc('0x0')]={'key':{'type':Sequelize[_0x7abc('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7abc('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7abc('0x3')],'get':function(){return this[_0x7abc('0x4')]('key');}}}; \ No newline at end of file +var _0x9aef=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x91eed6,_0x1f3aeb){var _0x5e9ef7=function(_0x2704ab){while(--_0x2704ab){_0x91eed6['push'](_0x91eed6['shift']());}};_0x5e9ef7(++_0x1f3aeb);}(_0x9aef,0x13e));var _0xf9ae=function(_0x1844ee,_0x116b76){_0x1844ee=_0x1844ee-0x0;var _0x16d564=_0x9aef[_0x1844ee];return _0x16d564;};'use strict';var Sequelize=require(_0xf9ae('0x0'));module[_0xf9ae('0x1')]={'key':{'type':Sequelize[_0xf9ae('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf9ae('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf9ae('0x2')]},'name':{'type':Sequelize[_0xf9ae('0x4')],'get':function(){return this[_0xf9ae('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5172cd6..b6e51b7 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 _0xdafa=['zip-dir','fast-json-patch','moment','bluebird','util','path','sox','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','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','field','merge','options','CannedAnswer','includeAll','rows','catch','params','include','find','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf'];(function(_0x50fa76,_0x6dec10){var _0x6e3cb8=function(_0x1c1f58){while(--_0x1c1f58){_0x50fa76['push'](_0x50fa76['shift']());}};_0x6e3cb8(++_0x6dec10);}(_0xdafa,0x102));var _0xadaf=function(_0x31a849,_0x3f20ae){_0x31a849=_0x31a849-0x0;var _0x365a14=_0xdafa[_0x31a849];return _0x365a14;};'use strict';var pdf=require(_0xadaf('0x0'));var emlformat=require(_0xadaf('0x1'));var rimraf=require(_0xadaf('0x2'));var zipdir=require(_0xadaf('0x3'));var jsonpatch=require(_0xadaf('0x4'));var rp=require('request-promise');var moment=require(_0xadaf('0x5'));var BPromise=require(_0xadaf('0x6'));var Mustache=require('mustache');var util=require(_0xadaf('0x7'));var path=require(_0xadaf('0x8'));var sox=require(_0xadaf('0x9'));var csv=require(_0xadaf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xadaf('0xb'));var squel=require(_0xadaf('0xc'));var crypto=require(_0xadaf('0xd'));var jsforce=require(_0xadaf('0xe'));var deskjs=require(_0xadaf('0xf'));var toCsv=require(_0xadaf('0xa'));var querystring=require(_0xadaf('0x10'));var Papa=require(_0xadaf('0x11'));var Redis=require(_0xadaf('0x12'));var authService=require(_0xadaf('0x13'));var qs=require(_0xadaf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadaf('0x15'))(_0xadaf('0x16'));var utils=require(_0xadaf('0x17'));var config=require(_0xadaf('0x18'));var db=require(_0xadaf('0x19'))['db'];function respondWithStatusCode(_0x475964,_0x1427e3){_0x1427e3=_0x1427e3||0xcc;return function(_0xa1d42e){if(_0xa1d42e){return _0x475964[_0xadaf('0x1a')](_0x1427e3);}return _0x475964[_0xadaf('0x1b')](_0x1427e3)[_0xadaf('0x1c')]();};}function respondWithResult(_0x5887ce,_0x1decd9){_0x1decd9=_0x1decd9||0xc8;return function(_0xfe2392){if(_0xfe2392){return _0x5887ce[_0xadaf('0x1b')](_0x1decd9)[_0xadaf('0x1d')](_0xfe2392);}};}function respondWithFilteredResult(_0xaf9e69,_0x478de6){return function(_0x26e672){if(_0x26e672){var _0x39fd4c=_0x26e672[_0xadaf('0x1e')],_0x432295=_0x478de6['offset'],_0x55c03f=_0x478de6[_0xadaf('0x1f')]+_0x478de6[_0xadaf('0x20')],_0x10e92c;if(_0x55c03f>=_0x39fd4c){_0x55c03f=_0x39fd4c;_0x10e92c=0xc8;}else{_0x10e92c=0xce;}_0xaf9e69[_0xadaf('0x1b')](_0x10e92c);return _0xaf9e69['set'](_0xadaf('0x21'),_0x432295+'-'+_0x55c03f+'/'+_0x39fd4c)[_0xadaf('0x1d')](_0x26e672);}return null;};}function patchUpdates(_0x38c94b){return function(_0x3d9a18){try{jsonpatch[_0xadaf('0x22')](_0x3d9a18,_0x38c94b,!![]);}catch(_0x113324){return BPromise['reject'](_0x113324);}return _0x3d9a18[_0xadaf('0x23')]();};}function saveUpdates(_0xd89b71,_0x31c3ad){return function(_0x2ef2b9){if(_0x2ef2b9){return _0x2ef2b9['update'](_0xd89b71)['then'](function(_0x463f63){return _0x463f63;});}return null;};}function removeEntity(_0x11b3ba,_0x2dd114){return function(_0x4287bb){if(_0x4287bb){return _0x4287bb['destroy']()[_0xadaf('0x24')](function(){var _0x306c52=_0x4287bb[_0xadaf('0x25')]({'plain':!![]});var _0xca180a=_0xadaf('0x26');return db[_0xadaf('0x27')][_0xadaf('0x28')]({'where':{'type':_0xca180a,'resourceId':_0x306c52['id']}})[_0xadaf('0x24')](function(){return _0x4287bb;});})['then'](function(){_0x11b3ba[_0xadaf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x261518,_0x1c03af){return function(_0x31b14b){if(!_0x31b14b){_0x261518[_0xadaf('0x1a')](0x194);}return _0x31b14b;};}function handleError(_0x558b22,_0x3e266e){_0x3e266e=_0x3e266e||0x1f4;return function(_0x56d29e){logger['error'](_0x56d29e[_0xadaf('0x29')]);if(_0x56d29e[_0xadaf('0x2a')]){delete _0x56d29e[_0xadaf('0x2a')];}_0x558b22[_0xadaf('0x1b')](_0x3e266e)['send'](_0x56d29e);};}exports[_0xadaf('0x2b')]=function(_0x3d324c,_0x5ca3f3){var _0x304265={},_0xa3a944={},_0x44dbb2={'count':0x0,'rows':[]};var _0x580cf2=db['CannedAnswer'][_0xadaf('0x2c')];_0xa3a944[_0xadaf('0x2d')]=_[_0xadaf('0x2e')](_0x580cf2);_0xa3a944['query']=_[_0xadaf('0x2e')](_0x3d324c['query']);_0xa3a944[_0xadaf('0x2f')]=_[_0xadaf('0x30')](_0xa3a944['model'],_0xa3a944[_0xadaf('0x31')]);_0x304265[_0xadaf('0x32')]=_[_0xadaf('0x30')](_0xa3a944[_0xadaf('0x2d')],qs[_0xadaf('0x33')](_0x3d324c[_0xadaf('0x31')][_0xadaf('0x33')]));_0x304265[_0xadaf('0x32')]=_0x304265[_0xadaf('0x32')][_0xadaf('0x34')]?_0x304265[_0xadaf('0x32')]:_0xa3a944[_0xadaf('0x2d')];if(!_0x3d324c[_0xadaf('0x31')][_0xadaf('0x35')](_0xadaf('0x36'))){_0x304265[_0xadaf('0x20')]=qs['limit'](_0x3d324c[_0xadaf('0x31')][_0xadaf('0x20')]);_0x304265[_0xadaf('0x1f')]=qs[_0xadaf('0x1f')](_0x3d324c[_0xadaf('0x31')]['offset']);}_0x304265['order']=qs['sort'](_0x3d324c[_0xadaf('0x31')][_0xadaf('0x37')]);_0x304265['where']=qs['filters'](_[_0xadaf('0x38')](_0x3d324c['query'],_0xa3a944['filters']));if(_0x3d324c['query'][_0xadaf('0x39')]){_0x304265[_0xadaf('0x3a')]=_['merge'](_0x304265['where'],{'$or':_['map'](_0x580cf2,function(_0x11f5ae){if(_0x11f5ae['type']['key']!==_0xadaf('0x3b')){var _0x3e057f={};_0x3e057f[_0x11f5ae[_0xadaf('0x3c')]]={'$like':'%'+_0x3d324c[_0xadaf('0x31')][_0xadaf('0x39')]+'%'};return _0x3e057f;}})});}_0x304265=_[_0xadaf('0x3d')]({},_0x304265,_0x3d324c[_0xadaf('0x3e')]);var _0x3b0c84={'where':_0x304265[_0xadaf('0x3a')]};return db[_0xadaf('0x3f')][_0xadaf('0x1e')](_0x3b0c84)[_0xadaf('0x24')](function(_0x542fbf){_0x44dbb2[_0xadaf('0x1e')]=_0x542fbf;if(_0x3d324c[_0xadaf('0x31')][_0xadaf('0x40')]){_0x304265['include']=[{'all':!![]}];}return db[_0xadaf('0x3f')]['findAll'](_0x304265);})[_0xadaf('0x24')](function(_0x3c27ce){_0x44dbb2[_0xadaf('0x41')]=_0x3c27ce;return _0x44dbb2;})['then'](respondWithFilteredResult(_0x5ca3f3,_0x304265))[_0xadaf('0x42')](handleError(_0x5ca3f3,null));};exports['show']=function(_0xab035b,_0x1ff339){var _0x1ad8b2={'raw':!![],'where':{'id':_0xab035b[_0xadaf('0x43')]['id']}},_0x30f4e0={};_0x30f4e0[_0xadaf('0x2d')]=_['keys'](db[_0xadaf('0x3f')][_0xadaf('0x2c')]);_0x30f4e0['query']=_[_0xadaf('0x2e')](_0xab035b[_0xadaf('0x31')]);_0x30f4e0[_0xadaf('0x2f')]=_[_0xadaf('0x30')](_0x30f4e0[_0xadaf('0x2d')],_0x30f4e0[_0xadaf('0x31')]);_0x1ad8b2[_0xadaf('0x32')]=_[_0xadaf('0x30')](_0x30f4e0['model'],qs[_0xadaf('0x33')](_0xab035b[_0xadaf('0x31')][_0xadaf('0x33')]));_0x1ad8b2['attributes']=_0x1ad8b2[_0xadaf('0x32')][_0xadaf('0x34')]?_0x1ad8b2[_0xadaf('0x32')]:_0x30f4e0[_0xadaf('0x2d')];if(_0xab035b[_0xadaf('0x31')][_0xadaf('0x40')]){_0x1ad8b2[_0xadaf('0x44')]=[{'all':!![]}];}_0x1ad8b2=_[_0xadaf('0x3d')]({},_0x1ad8b2,_0xab035b['options']);return db[_0xadaf('0x3f')][_0xadaf('0x45')](_0x1ad8b2)[_0xadaf('0x24')](handleEntityNotFound(_0x1ff339,null))[_0xadaf('0x24')](respondWithResult(_0x1ff339,null))[_0xadaf('0x42')](handleError(_0x1ff339,null));};exports[_0xadaf('0x46')]=function(_0x21746c,_0x381e90){if(_0x21746c[_0xadaf('0x47')]['id']){delete _0x21746c[_0xadaf('0x47')]['id'];}return db[_0xadaf('0x3f')][_0xadaf('0x45')]({'where':{'id':_0x21746c[_0xadaf('0x43')]['id']}})['then'](handleEntityNotFound(_0x381e90,null))[_0xadaf('0x24')](saveUpdates(_0x21746c[_0xadaf('0x47')],null))[_0xadaf('0x24')](respondWithResult(_0x381e90,null))[_0xadaf('0x42')](handleError(_0x381e90,null));};exports[_0xadaf('0x28')]=function(_0x54f676,_0x3ae716){return db[_0xadaf('0x3f')]['find']({'where':{'id':_0x54f676['params']['id']}})[_0xadaf('0x24')](handleEntityNotFound(_0x3ae716,null))['then'](removeEntity(_0x3ae716,null))[_0xadaf('0x42')](handleError(_0x3ae716,null));};exports[_0xadaf('0x48')]=function(_0x330769,_0x160efe){var _0x20c1f7={'key':_0x330769[_0xadaf('0x47')][_0xadaf('0x49')]};if(_0x330769['body'][_0xadaf('0x4a')]){_0x20c1f7['MailAccountId']=_0x330769[_0xadaf('0x47')][_0xadaf('0x4a')];}else if(_0x330769[_0xadaf('0x47')][_0xadaf('0x4b')]){_0x20c1f7[_0xadaf('0x4b')]=_0x330769[_0xadaf('0x47')]['SmsAccountId'];}else if(_0x330769[_0xadaf('0x47')]['OpenchannelAccountId']){_0x20c1f7[_0xadaf('0x4c')]=_0x330769[_0xadaf('0x47')][_0xadaf('0x4c')];}else if(_0x330769[_0xadaf('0x47')][_0xadaf('0x4d')]){_0x20c1f7[_0xadaf('0x4d')]=_0x330769[_0xadaf('0x47')]['ChatWebsiteId'];}return db['CannedAnswer'][_0xadaf('0x45')]({'where':_0x20c1f7})[_0xadaf('0x24')](function(_0x4e0670){if(_0x4e0670){throw new db[(_0xadaf('0x4e'))][(_0xadaf('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xadaf('0x3f')][_0xadaf('0x48')](_0x330769[_0xadaf('0x47')]);})[_0xadaf('0x24')](function(_0x1d9b32){var _0x27e516=_0x330769['user'][_0xadaf('0x25')]({'plain':!![]});if(!_0x27e516)throw new Error(_0xadaf('0x50'));if(_0x27e516[_0xadaf('0x51')]===_0xadaf('0x52')){var _0x311ebe=_0x1d9b32[_0xadaf('0x25')]({'plain':!![]});return db[_0xadaf('0x53')][_0xadaf('0x45')]({'where':{'name':_0xadaf('0x26'),'userProfileId':_0x27e516['userProfileId']},'raw':!![]})[_0xadaf('0x24')](function(_0x63156a){if(_0x63156a&&_0x63156a[_0xadaf('0x54')]===0x0){return db[_0xadaf('0x27')]['create']({'name':_0x311ebe[_0xadaf('0x2a')],'resourceId':_0x311ebe['id'],'type':_0x63156a[_0xadaf('0x2a')],'sectionId':_0x63156a['id']},{})[_0xadaf('0x24')](function(){return _0x1d9b32;});}else{return _0x1d9b32;}})[_0xadaf('0x42')](function(_0x1b0aea){logger[_0xadaf('0x55')](_0xadaf('0x56'),_0x1b0aea);throw _0x1b0aea;});}return _0x1d9b32;})[_0xadaf('0x24')](respondWithResult(_0x160efe,0xc9))[_0xadaf('0x42')](handleError(_0x160efe,null));}; \ No newline at end of file +var _0x059f=['UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','merge','include','catch','show','params','CannedAnswer','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','get','CannedAnswers'];(function(_0x52224d,_0x55aacd){var _0x2f1ed0=function(_0x53f9c0){while(--_0x53f9c0){_0x52224d['push'](_0x52224d['shift']());}};_0x2f1ed0(++_0x55aacd);}(_0x059f,0x141));var _0xf059=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x059f[_0x3f2a90];return _0xb46279;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf059('0x0'));var rimraf=require(_0xf059('0x1'));var zipdir=require(_0xf059('0x2'));var jsonpatch=require(_0xf059('0x3'));var rp=require(_0xf059('0x4'));var moment=require(_0xf059('0x5'));var BPromise=require(_0xf059('0x6'));var Mustache=require(_0xf059('0x7'));var util=require(_0xf059('0x8'));var path=require(_0xf059('0x9'));var sox=require(_0xf059('0xa'));var csv=require(_0xf059('0xb'));var ejs=require(_0xf059('0xc'));var fs=require('fs');var _=require(_0xf059('0xd'));var squel=require(_0xf059('0xe'));var crypto=require(_0xf059('0xf'));var jsforce=require(_0xf059('0x10'));var deskjs=require(_0xf059('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf059('0x12'));var Papa=require(_0xf059('0x13'));var Redis=require(_0xf059('0x14'));var authService=require(_0xf059('0x15'));var qs=require(_0xf059('0x16'));var hardwareService=require(_0xf059('0x17'));var logger=require(_0xf059('0x18'))(_0xf059('0x19'));var utils=require(_0xf059('0x1a'));var config=require(_0xf059('0x1b'));var db=require(_0xf059('0x1c'))['db'];function respondWithStatusCode(_0x239f28,_0x303d70){_0x303d70=_0x303d70||0xcc;return function(_0x1e5354){if(_0x1e5354){return _0x239f28[_0xf059('0x1d')](_0x303d70);}return _0x239f28[_0xf059('0x1e')](_0x303d70)[_0xf059('0x1f')]();};}function respondWithResult(_0x36242d,_0x2056cb){_0x2056cb=_0x2056cb||0xc8;return function(_0x55d26a){if(_0x55d26a){return _0x36242d[_0xf059('0x1e')](_0x2056cb)[_0xf059('0x20')](_0x55d26a);}};}function respondWithFilteredResult(_0x161482,_0x27acb9){return function(_0x145735){if(_0x145735){var _0x38abaf=_0x145735[_0xf059('0x21')],_0x5daae8=_0x27acb9[_0xf059('0x22')],_0x2f82a9=_0x27acb9[_0xf059('0x22')]+_0x27acb9[_0xf059('0x23')],_0x4e62dc;if(_0x2f82a9>=_0x38abaf){_0x2f82a9=_0x38abaf;_0x4e62dc=0xc8;}else{_0x4e62dc=0xce;}_0x161482[_0xf059('0x1e')](_0x4e62dc);return _0x161482[_0xf059('0x24')]('Content-Range',_0x5daae8+'-'+_0x2f82a9+'/'+_0x38abaf)['json'](_0x145735);}return null;};}function patchUpdates(_0xae0cf){return function(_0x5481e8){try{jsonpatch[_0xf059('0x25')](_0x5481e8,_0xae0cf,!![]);}catch(_0x3d3bc4){return BPromise[_0xf059('0x26')](_0x3d3bc4);}return _0x5481e8[_0xf059('0x27')]();};}function saveUpdates(_0x3d25c1,_0x5e7857){return function(_0x4ab6b3){if(_0x4ab6b3){return _0x4ab6b3['update'](_0x3d25c1)[_0xf059('0x28')](function(_0x5b6e18){return _0x5b6e18;});}return null;};}function removeEntity(_0x2ec149,_0x1da0c5){return function(_0x1a568f){if(_0x1a568f){return _0x1a568f['destroy']()['then'](function(){var _0x16759a=_0x1a568f[_0xf059('0x29')]({'plain':!![]});var _0x4326f6=_0xf059('0x2a');return db[_0xf059('0x2b')][_0xf059('0x2c')]({'where':{'type':_0x4326f6,'resourceId':_0x16759a['id']}})['then'](function(){return _0x1a568f;});})[_0xf059('0x28')](function(){_0x2ec149[_0xf059('0x1e')](0xcc)[_0xf059('0x1f')]();});}};}function handleEntityNotFound(_0xb32418,_0x10c458){return function(_0x4485ec){if(!_0x4485ec){_0xb32418[_0xf059('0x1d')](0x194);}return _0x4485ec;};}function handleError(_0x254cfd,_0x2aca8f){_0x2aca8f=_0x2aca8f||0x1f4;return function(_0x2b971c){logger[_0xf059('0x2d')](_0x2b971c[_0xf059('0x2e')]);if(_0x2b971c[_0xf059('0x2f')]){delete _0x2b971c[_0xf059('0x2f')];}_0x254cfd['status'](_0x2aca8f)[_0xf059('0x30')](_0x2b971c);};}exports[_0xf059('0x31')]=function(_0x323341,_0xca7506){var _0x59de41={},_0x5d0b3c={},_0x6c2096={'count':0x0,'rows':[]};var _0x1723c3=db['CannedAnswer'][_0xf059('0x32')];_0x5d0b3c[_0xf059('0x33')]=_[_0xf059('0x34')](_0x1723c3);_0x5d0b3c['query']=_[_0xf059('0x34')](_0x323341[_0xf059('0x35')]);_0x5d0b3c['filters']=_[_0xf059('0x36')](_0x5d0b3c[_0xf059('0x33')],_0x5d0b3c[_0xf059('0x35')]);_0x59de41['attributes']=_['intersection'](_0x5d0b3c[_0xf059('0x33')],qs[_0xf059('0x37')](_0x323341[_0xf059('0x35')][_0xf059('0x37')]));_0x59de41[_0xf059('0x38')]=_0x59de41['attributes'][_0xf059('0x39')]?_0x59de41[_0xf059('0x38')]:_0x5d0b3c[_0xf059('0x33')];if(!_0x323341[_0xf059('0x35')][_0xf059('0x3a')](_0xf059('0x3b'))){_0x59de41[_0xf059('0x23')]=qs[_0xf059('0x23')](_0x323341[_0xf059('0x35')]['limit']);_0x59de41[_0xf059('0x22')]=qs['offset'](_0x323341[_0xf059('0x35')]['offset']);}_0x59de41[_0xf059('0x3c')]=qs[_0xf059('0x3d')](_0x323341['query'][_0xf059('0x3d')]);_0x59de41[_0xf059('0x3e')]=qs[_0xf059('0x3f')](_[_0xf059('0x40')](_0x323341['query'],_0x5d0b3c[_0xf059('0x3f')]));if(_0x323341['query'][_0xf059('0x41')]){_0x59de41[_0xf059('0x3e')]=_['merge'](_0x59de41[_0xf059('0x3e')],{'$or':_[_0xf059('0x42')](_0x1723c3,function(_0x28e167){if(_0x28e167['type'][_0xf059('0x43')]!==_0xf059('0x44')){var _0x1579c7={};_0x1579c7[_0x28e167['field']]={'$like':'%'+_0x323341['query'][_0xf059('0x41')]+'%'};return _0x1579c7;}})});}_0x59de41=_[_0xf059('0x45')]({},_0x59de41,_0x323341['options']);var _0x56252e={'where':_0x59de41[_0xf059('0x3e')]};return db['CannedAnswer']['count'](_0x56252e)['then'](function(_0x32ef13){_0x6c2096[_0xf059('0x21')]=_0x32ef13;if(_0x323341[_0xf059('0x35')]['includeAll']){_0x59de41[_0xf059('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x59de41);})[_0xf059('0x28')](function(_0x31ce09){_0x6c2096['rows']=_0x31ce09;return _0x6c2096;})[_0xf059('0x28')](respondWithFilteredResult(_0xca7506,_0x59de41))[_0xf059('0x47')](handleError(_0xca7506,null));};exports[_0xf059('0x48')]=function(_0x1674b8,_0x86b30){var _0x2734df={'raw':!![],'where':{'id':_0x1674b8[_0xf059('0x49')]['id']}},_0x47ea3c={};_0x47ea3c[_0xf059('0x33')]=_['keys'](db[_0xf059('0x4a')][_0xf059('0x32')]);_0x47ea3c[_0xf059('0x35')]=_[_0xf059('0x34')](_0x1674b8[_0xf059('0x35')]);_0x47ea3c['filters']=_[_0xf059('0x36')](_0x47ea3c['model'],_0x47ea3c[_0xf059('0x35')]);_0x2734df[_0xf059('0x38')]=_[_0xf059('0x36')](_0x47ea3c[_0xf059('0x33')],qs['fields'](_0x1674b8[_0xf059('0x35')][_0xf059('0x37')]));_0x2734df[_0xf059('0x38')]=_0x2734df[_0xf059('0x38')][_0xf059('0x39')]?_0x2734df[_0xf059('0x38')]:_0x47ea3c[_0xf059('0x33')];if(_0x1674b8[_0xf059('0x35')][_0xf059('0x4b')]){_0x2734df[_0xf059('0x46')]=[{'all':!![]}];}_0x2734df=_[_0xf059('0x45')]({},_0x2734df,_0x1674b8['options']);return db[_0xf059('0x4a')][_0xf059('0x4c')](_0x2734df)[_0xf059('0x28')](handleEntityNotFound(_0x86b30,null))[_0xf059('0x28')](respondWithResult(_0x86b30,null))[_0xf059('0x47')](handleError(_0x86b30,null));};exports['update']=function(_0x2b3610,_0x12292a){if(_0x2b3610[_0xf059('0x4d')]['id']){delete _0x2b3610[_0xf059('0x4d')]['id'];}return db['CannedAnswer'][_0xf059('0x4c')]({'where':{'id':_0x2b3610[_0xf059('0x49')]['id']}})['then'](handleEntityNotFound(_0x12292a,null))[_0xf059('0x28')](saveUpdates(_0x2b3610[_0xf059('0x4d')],null))[_0xf059('0x28')](respondWithResult(_0x12292a,null))[_0xf059('0x47')](handleError(_0x12292a,null));};exports[_0xf059('0x2c')]=function(_0x340f99,_0x3a2b0e){return db['CannedAnswer'][_0xf059('0x4c')]({'where':{'id':_0x340f99[_0xf059('0x49')]['id']}})[_0xf059('0x28')](handleEntityNotFound(_0x3a2b0e,null))[_0xf059('0x28')](removeEntity(_0x3a2b0e,null))[_0xf059('0x47')](handleError(_0x3a2b0e,null));};exports['create']=function(_0x15363d,_0x413abb){var _0x48b413={'key':_0x15363d[_0xf059('0x4d')]['key']};if(_0x15363d[_0xf059('0x4d')]['MailAccountId']){_0x48b413[_0xf059('0x4e')]=_0x15363d['body']['MailAccountId'];}else if(_0x15363d['body'][_0xf059('0x4f')]){_0x48b413[_0xf059('0x4f')]=_0x15363d[_0xf059('0x4d')][_0xf059('0x4f')];}else if(_0x15363d[_0xf059('0x4d')]['OpenchannelAccountId']){_0x48b413[_0xf059('0x50')]=_0x15363d[_0xf059('0x4d')]['OpenchannelAccountId'];}else if(_0x15363d[_0xf059('0x4d')]['ChatWebsiteId']){_0x48b413[_0xf059('0x51')]=_0x15363d[_0xf059('0x4d')]['ChatWebsiteId'];}return db[_0xf059('0x4a')][_0xf059('0x4c')]({'where':_0x48b413})[_0xf059('0x28')](function(_0x2a1237){if(_0x2a1237){throw new db[(_0xf059('0x52'))][(_0xf059('0x53'))](_0xf059('0x54'));}return db['CannedAnswer'][_0xf059('0x55')](_0x15363d[_0xf059('0x4d')]);})[_0xf059('0x28')](function(_0x181c97){var _0x562afc=_0x15363d[_0xf059('0x56')]['get']({'plain':!![]});if(!_0x562afc)throw new Error(_0xf059('0x57'));if(_0x562afc[_0xf059('0x58')]==='user'){var _0xb09bd2=_0x181c97[_0xf059('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xf059('0x4c')]({'where':{'name':_0xf059('0x2a'),'userProfileId':_0x562afc['userProfileId']},'raw':!![]})[_0xf059('0x28')](function(_0xe02d06){if(_0xe02d06&&_0xe02d06[_0xf059('0x59')]===0x0){return db[_0xf059('0x2b')]['create']({'name':_0xb09bd2[_0xf059('0x2f')],'resourceId':_0xb09bd2['id'],'type':_0xe02d06['name'],'sectionId':_0xe02d06['id']},{})[_0xf059('0x28')](function(){return _0x181c97;});}else{return _0x181c97;}})['catch'](function(_0x33ff7e){logger[_0xf059('0x2d')](_0xf059('0x5a'),_0x33ff7e);throw _0x33ff7e;});}return _0x181c97;})['then'](respondWithResult(_0x413abb,0xc9))[_0xf059('0x47')](handleError(_0x413abb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index c832ad6..6d9e9a2 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 _0xc9aa=['path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a7552,_0xf1ba17){var _0x5b31a0=function(_0x42904a){while(--_0x42904a){_0x5a7552['push'](_0x5a7552['shift']());}};_0x5b31a0(++_0xf1ba17);}(_0xc9aa,0x14c));var _0xac9a=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0xc9aa[_0x9c3c56];return _0x2dd782;};'use strict';var _=require('lodash');var util=require(_0xac9a('0x0'));var logger=require(_0xac9a('0x1'))(_0xac9a('0x2'));var moment=require(_0xac9a('0x3'));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(_0xac9a('0x9'));module['exports']=function(_0x27fcb4,_0x217036){return _0x27fcb4[_0xac9a('0xa')](_0xac9a('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac9a('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1e62=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5bb6fe,_0xcd0458){var _0x3a94d6=function(_0x552cd2){while(--_0x552cd2){_0x5bb6fe['push'](_0x5bb6fe['shift']());}};_0x3a94d6(++_0xcd0458);}(_0x1e62,0x179));var _0x21e6=function(_0x260cfb,_0x5277a7){_0x260cfb=_0x260cfb-0x0;var _0x4ced2a=_0x1e62[_0x260cfb];return _0x4ced2a;};'use strict';var _=require(_0x21e6('0x0'));var util=require('util');var logger=require(_0x21e6('0x1'))(_0x21e6('0x2'));var moment=require(_0x21e6('0x3'));var BPromise=require(_0x21e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21e6('0x5'));var rimraf=require(_0x21e6('0x6'));var config=require(_0x21e6('0x7'));var attributes=require(_0x21e6('0x8'));module['exports']=function(_0x2e7fd8,_0x4ab68e){return _0x2e7fd8[_0x21e6('0x9')](_0x21e6('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21e6('0xb'),'collate':_0x21e6('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d48757e..0e31441 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 _0xce07=['client','http','request','then','info','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','CannedAnswer,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x28f284,_0x149e6b){var _0x3c1629=function(_0x21b804){while(--_0x21b804){_0x28f284['push'](_0x28f284['shift']());}};_0x3c1629(++_0x149e6b);}(_0xce07,0x188));var _0x7ce0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xce07[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ce0('0x0'));var BPromise=require(_0x7ce0('0x1'));var rs=require(_0x7ce0('0x2'));var fs=require('fs');var Redis=require(_0x7ce0('0x3'));var db=require(_0x7ce0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ce0('0x5'))('rpc');var config=require(_0x7ce0('0x6'));var jayson=require(_0x7ce0('0x7'));var client=jayson[_0x7ce0('0x8')][_0x7ce0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44fa4b,_0x54805c,_0x4bf194){return new BPromise(function(_0x4d137b,_0x2ac42b){return client[_0x7ce0('0xa')](_0x44fa4b,_0x4bf194)[_0x7ce0('0xb')](function(_0x58d398){logger[_0x7ce0('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x54805c,'request\x20sent');logger['debug'](_0x7ce0('0xd'),_0x54805c,'request\x20sent',JSON['stringify'](_0x58d398));if(_0x58d398[_0x7ce0('0xe')]){if(_0x58d398[_0x7ce0('0xe')][_0x7ce0('0xf')]===0x1f4){logger[_0x7ce0('0xe')](_0x7ce0('0x10'),_0x54805c,_0x58d398['error']['message']);return _0x2ac42b(_0x58d398[_0x7ce0('0xe')][_0x7ce0('0x11')]);}logger[_0x7ce0('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x54805c,_0x58d398[_0x7ce0('0xe')]['message']);return _0x4d137b(_0x58d398['error']['message']);}else{logger[_0x7ce0('0xc')](_0x7ce0('0x10'),_0x54805c,'request\x20sent');_0x4d137b(_0x58d398[_0x7ce0('0x12')][_0x7ce0('0x11')]);}})[_0x7ce0('0x13')](function(_0x48caf9){logger[_0x7ce0('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x54805c,_0x48caf9);_0x2ac42b(_0x48caf9);});});} \ No newline at end of file +var _0x02bd=['jayson/promise','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x02bd,0xe8));var _0xd02b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x02bd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd02b('0x0'));var util=require('util');var moment=require(_0xd02b('0x1'));var BPromise=require(_0xd02b('0x2'));var rs=require(_0xd02b('0x3'));var fs=require('fs');var Redis=require(_0xd02b('0x4'));var db=require(_0xd02b('0x5'))['db'];var utils=require(_0xd02b('0x6'));var logger=require(_0xd02b('0x7'))(_0xd02b('0x8'));var config=require(_0xd02b('0x9'));var jayson=require(_0xd02b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x572f1e,_0xef109c,_0x4d26b5){return new BPromise(function(_0x490671,_0xc47602){return client[_0xd02b('0xb')](_0x572f1e,_0x4d26b5)[_0xd02b('0xc')](function(_0x54d98f){logger['info'](_0xd02b('0xd'),_0xef109c,_0xd02b('0xe'));logger[_0xd02b('0xf')](_0xd02b('0x10'),_0xef109c,_0xd02b('0xe'),JSON[_0xd02b('0x11')](_0x54d98f));if(_0x54d98f[_0xd02b('0x12')]){if(_0x54d98f[_0xd02b('0x12')][_0xd02b('0x13')]===0x1f4){logger[_0xd02b('0x12')](_0xd02b('0xd'),_0xef109c,_0x54d98f[_0xd02b('0x12')]['message']);return _0xc47602(_0x54d98f[_0xd02b('0x12')][_0xd02b('0x14')]);}logger['error'](_0xd02b('0xd'),_0xef109c,_0x54d98f['error'][_0xd02b('0x14')]);return _0x490671(_0x54d98f[_0xd02b('0x12')]['message']);}else{logger[_0xd02b('0x15')](_0xd02b('0xd'),_0xef109c,_0xd02b('0xe'));_0x490671(_0x54d98f['result'][_0xd02b('0x14')]);}})['catch'](function(_0x33e99b){logger[_0xd02b('0x12')](_0xd02b('0xd'),_0xef109c,_0x33e99b);_0xc47602(_0x33e99b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index e2eb0a1..047f00a 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 _0x9d88=['delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','update'];(function(_0x5e4737,_0x2f6e7c){var _0x33730b=function(_0x53d2c4){while(--_0x53d2c4){_0x5e4737['push'](_0x5e4737['shift']());}};_0x33730b(++_0x2f6e7c);}(_0x9d88,0x1a6));var _0x89d8=function(_0x3f69a3,_0x1b1eaf){_0x3f69a3=_0x3f69a3-0x0;var _0x300f2b=_0x9d88[_0x3f69a3];return _0x300f2b;};'use strict';var multer=require(_0x89d8('0x0'));var util=require('util');var path=require(_0x89d8('0x1'));var timeout=require(_0x89d8('0x2'));var express=require(_0x89d8('0x3'));var router=express[_0x89d8('0x4')]();var auth=require(_0x89d8('0x5'));var interaction=require(_0x89d8('0x6'));var config=require(_0x89d8('0x7'));var controller=require('./cannedAnswer.controller');router[_0x89d8('0x8')]('/',auth['isAuthenticated'](),controller[_0x89d8('0x9')]);router[_0x89d8('0x8')]('/:id',auth[_0x89d8('0xa')](),controller[_0x89d8('0xb')]);router[_0x89d8('0xc')]('/',auth[_0x89d8('0xa')](),controller['create']);router[_0x89d8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x89d8('0xe')]);router[_0x89d8('0xf')](_0x89d8('0x10'),auth['isAuthenticated'](),controller[_0x89d8('0x11')]);module[_0x89d8('0x12')]=router; \ No newline at end of file +var _0x3977=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x1aad88,_0x551794){var _0x1bbfe9=function(_0x1636ed){while(--_0x1636ed){_0x1aad88['push'](_0x1aad88['shift']());}};_0x1bbfe9(++_0x551794);}(_0x3977,0x78));var _0x7397=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3977[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7397('0x0'));var util=require(_0x7397('0x1'));var path=require(_0x7397('0x2'));var timeout=require(_0x7397('0x3'));var express=require(_0x7397('0x4'));var router=express[_0x7397('0x5')]();var auth=require(_0x7397('0x6'));var interaction=require(_0x7397('0x7'));var config=require(_0x7397('0x8'));var controller=require(_0x7397('0x9'));router[_0x7397('0xa')]('/',auth[_0x7397('0xb')](),controller[_0x7397('0xc')]);router[_0x7397('0xa')](_0x7397('0xd'),auth[_0x7397('0xb')](),controller['show']);router[_0x7397('0xe')]('/',auth[_0x7397('0xb')](),controller['create']);router[_0x7397('0xf')](_0x7397('0xd'),auth[_0x7397('0xb')](),controller[_0x7397('0x10')]);router[_0x7397('0x11')](_0x7397('0xd'),auth[_0x7397('0xb')](),controller[_0x7397('0x12')]);module[_0x7397('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9ea2967..0fc99ea 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 _0x1ff1=['STRING','INTEGER','exports','DATE'];(function(_0x567ad2,_0x505529){var _0x13334e=function(_0x24a9ab){while(--_0x24a9ab){_0x567ad2['push'](_0x567ad2['shift']());}};_0x13334e(++_0x505529);}(_0x1ff1,0xfe));var _0x11ff=function(_0x15798e,_0x244b08){_0x15798e=_0x15798e-0x0;var _0xa28849=_0x1ff1[_0x15798e];return _0xa28849;};'use strict';var Sequelize=require('sequelize');module[_0x11ff('0x0')]={'calldate':{'type':Sequelize[_0x11ff('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x11ff('0x2')]},'src':{'type':Sequelize[_0x11ff('0x2')]},'dst':{'type':Sequelize[_0x11ff('0x2')]},'dcontext':{'type':Sequelize[_0x11ff('0x2')]},'channel':{'type':Sequelize[_0x11ff('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x11ff('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x11ff('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x11ff('0x2')]},'amaflags':{'type':Sequelize[_0x11ff('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x11ff('0x2')]},'userfield':{'type':Sequelize[_0x11ff('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x11ff('0x2')]},'peeraccount':{'type':Sequelize[_0x11ff('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc214=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x16300f,_0x47cc2b){var _0x4f20b0=function(_0x1d002c){while(--_0x1d002c){_0x16300f['push'](_0x16300f['shift']());}};_0x4f20b0(++_0x47cc2b);}(_0xc214,0xa6));var _0x4c21=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc214[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4c21('0x0')],'allowNull':![],'defaultValue':_0x4c21('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4c21('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x4c21('0x2')]},'channel':{'type':Sequelize[_0x4c21('0x2')]},'dstchannel':{'type':Sequelize[_0x4c21('0x2')]},'lastapp':{'type':Sequelize[_0x4c21('0x2')]},'lastdata':{'type':Sequelize[_0x4c21('0x2')]},'duration':{'type':Sequelize[_0x4c21('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4c21('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4c21('0x2')]},'amaflags':{'type':Sequelize[_0x4c21('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4c21('0x2')]},'userfield':{'type':Sequelize[_0x4c21('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x4c21('0x2')]},'peeraccount':{'type':Sequelize[_0x4c21('0x2')]},'type':{'type':Sequelize[_0x4c21('0x2')]},'tag':{'type':Sequelize[_0x4c21('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 279f375..0038009 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0xcceb4e,_0x16b9cd){var _0x458bda=function(_0x2efa9c){while(--_0x2efa9c){_0xcceb4e['push'](_0xcceb4e['shift']());}};_0x458bda(++_0x16b9cd);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x3ed25d,_0x6c37b2){var _0x5e0998=function(_0x3e53a4){while(--_0x3e53a4){_0x3ed25d['push'](_0x3ed25d['shift']());}};_0x5e0998(++_0x6c37b2);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index df65afd..d9073b9 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 _0xc3db=['request-promise','path','../../config/environment','exports','define','Cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x417db1,_0x45604d){var _0x1a88ab=function(_0x3bf690){while(--_0x3bf690){_0x417db1['push'](_0x417db1['shift']());}};_0x1a88ab(++_0x45604d);}(_0xc3db,0x1ac));var _0xbc3d=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xc3db[_0xcd5a3d];return _0xd43207;};'use strict';var _=require(_0xbc3d('0x0'));var util=require(_0xbc3d('0x1'));var logger=require(_0xbc3d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbc3d('0x3'));var rp=require(_0xbc3d('0x4'));var fs=require('fs');var path=require(_0xbc3d('0x5'));var rimraf=require('rimraf');var config=require(_0xbc3d('0x6'));var attributes=require('./cdr.attributes');module[_0xbc3d('0x7')]=function(_0x1de23f,_0x168730){return _0x1de23f[_0xbc3d('0x8')](_0xbc3d('0x9'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xbc3d('0xa'),'fields':[_0xbc3d('0xa')]},{'name':_0xbc3d('0xb'),'fields':[_0xbc3d('0xb')]},{'name':_0xbc3d('0xc'),'fields':['disposition']},{'name':'dst','fields':[_0xbc3d('0xd')]},{'name':_0xbc3d('0xe'),'fields':['src']},{'name':_0xbc3d('0xf'),'fields':[_0xbc3d('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5cff=['define','Cdr','cdr','accountcode','calldate','disposition','dst','src','lodash','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x5cff,0xf8));var _0xf5cf=function(_0x29821c,_0x5132f5){_0x29821c=_0x29821c-0x0;var _0x38f5bc=_0x5cff[_0x29821c];return _0x38f5bc;};'use strict';var _=require(_0xf5cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5cf('0x1'));var moment=require('moment');var BPromise=require(_0xf5cf('0x2'));var rp=require(_0xf5cf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5cf('0x4'));var config=require(_0xf5cf('0x5'));var attributes=require('./cdr.attributes');module[_0xf5cf('0x6')]=function(_0x58663e,_0x5b90b1){return _0x58663e[_0xf5cf('0x7')](_0xf5cf('0x8'),attributes,{'tableName':_0xf5cf('0x9'),'paranoid':![],'indexes':[{'name':_0xf5cf('0xa'),'fields':[_0xf5cf('0xa')]},{'name':_0xf5cf('0xb'),'fields':[_0xf5cf('0xb')]},{'name':_0xf5cf('0xc'),'fields':[_0xf5cf('0xc')]},{'name':_0xf5cf('0xd'),'fields':[_0xf5cf('0xd')]},{'name':'src','fields':[_0xf5cf('0xe')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 9fa300a..c520623 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 _0xa189=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x12e65e,_0x1f8da8){var _0x5804fc=function(_0x131c25){while(--_0x131c25){_0x12e65e['push'](_0x12e65e['shift']());}};_0x5804fc(++_0x1f8da8);}(_0xa189,0xec));var _0x9a18=function(_0x4d7293,_0x185712){_0x4d7293=_0x4d7293-0x0;var _0x55a59d=_0xa189[_0x4d7293];return _0x55a59d;};'use strict';var _=require(_0x9a18('0x0'));var util=require('util');var moment=require(_0x9a18('0x1'));var BPromise=require(_0x9a18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a18('0x3'));var db=require(_0x9a18('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a18('0x5'))(_0x9a18('0x6'));var config=require(_0x9a18('0x7'));var jayson=require(_0x9a18('0x8'));var client=jayson[_0x9a18('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57eb10,_0x7977ad,_0xe6af14){return new BPromise(function(_0x57392f,_0x3b4fb6){return client[_0x9a18('0xa')](_0x57eb10,_0xe6af14)[_0x9a18('0xb')](function(_0x4f2ff3){logger[_0x9a18('0xc')]('Cdr,\x20%s,\x20%s',_0x7977ad,_0x9a18('0xd'));logger[_0x9a18('0xe')](_0x9a18('0xf'),_0x7977ad,_0x9a18('0xd'),JSON[_0x9a18('0x10')](_0x4f2ff3));if(_0x4f2ff3['error']){if(_0x4f2ff3[_0x9a18('0x11')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x7977ad,_0x4f2ff3[_0x9a18('0x11')]['message']);return _0x3b4fb6(_0x4f2ff3[_0x9a18('0x11')][_0x9a18('0x12')]);}logger[_0x9a18('0x11')](_0x9a18('0x13'),_0x7977ad,_0x4f2ff3[_0x9a18('0x11')][_0x9a18('0x12')]);return _0x57392f(_0x4f2ff3[_0x9a18('0x11')][_0x9a18('0x12')]);}else{logger[_0x9a18('0xc')](_0x9a18('0x13'),_0x7977ad,_0x9a18('0xd'));_0x57392f(_0x4f2ff3[_0x9a18('0x14')]['message']);}})[_0x9a18('0x15')](function(_0x3371eb){logger[_0x9a18('0x11')](_0x9a18('0x13'),_0x7977ad,_0x3371eb);_0x3b4fb6(_0x3371eb);});});} \ No newline at end of file +var _0xaea1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x6b2a4b,_0x2aea1f){var _0x596d48=function(_0x518a40){while(--_0x518a40){_0x6b2a4b['push'](_0x6b2a4b['shift']());}};_0x596d48(++_0x2aea1f);}(_0xaea1,0x1b1));var _0x1aea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaea1[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1aea('0x0'));var util=require(_0x1aea('0x1'));var moment=require(_0x1aea('0x2'));var BPromise=require(_0x1aea('0x3'));var rs=require(_0x1aea('0x4'));var fs=require('fs');var Redis=require(_0x1aea('0x5'));var db=require(_0x1aea('0x6'))['db'];var utils=require(_0x1aea('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1aea('0x8'));var jayson=require(_0x1aea('0x9'));var client=jayson[_0x1aea('0xa')][_0x1aea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x504fa2,_0xa8639b,_0x1d25f8){return new BPromise(function(_0xc61fac,_0x1765ed){return client[_0x1aea('0xc')](_0x504fa2,_0x1d25f8)[_0x1aea('0xd')](function(_0x5b706b){logger[_0x1aea('0xe')]('Cdr,\x20%s,\x20%s',_0xa8639b,'request\x20sent');logger['debug'](_0x1aea('0xf'),_0xa8639b,_0x1aea('0x10'),JSON[_0x1aea('0x11')](_0x5b706b));if(_0x5b706b['error']){if(_0x5b706b[_0x1aea('0x12')][_0x1aea('0x13')]===0x1f4){logger['error'](_0x1aea('0x14'),_0xa8639b,_0x5b706b['error'][_0x1aea('0x15')]);return _0x1765ed(_0x5b706b[_0x1aea('0x12')]['message']);}logger[_0x1aea('0x12')](_0x1aea('0x14'),_0xa8639b,_0x5b706b['error'][_0x1aea('0x15')]);return _0xc61fac(_0x5b706b['error']['message']);}else{logger['info'](_0x1aea('0x14'),_0xa8639b,_0x1aea('0x10'));_0xc61fac(_0x5b706b[_0x1aea('0x16')][_0x1aea('0x15')]);}})['catch'](function(_0x59acd9){logger['error'](_0x1aea('0x14'),_0xa8639b,_0x59acd9);_0x1765ed(_0x59acd9);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 2a3a689..b3a9edc 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 _0x453a=['../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x1ffa41,_0xc3996b){var _0x1f3a1a=function(_0x24ca80){while(--_0x24ca80){_0x1ffa41['push'](_0x1ffa41['shift']());}};_0x1f3a1a(++_0xc3996b);}(_0x453a,0x8b));var _0xa453=function(_0x59820d,_0xc8e6ba){_0x59820d=_0x59820d-0x0;var _0x3c72b1=_0x453a[_0x59820d];return _0x3c72b1;};'use strict';var multer=require(_0xa453('0x0'));var util=require(_0xa453('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa453('0x2'));var router=express[_0xa453('0x3')]();var auth=require(_0xa453('0x4'));var interaction=require(_0xa453('0x5'));var config=require(_0xa453('0x6'));var controller=require(_0xa453('0x7'));router[_0xa453('0x8')]('/',auth[_0xa453('0x9')](),controller['index']);router[_0xa453('0x8')](_0xa453('0xa'),auth[_0xa453('0x9')](),controller['describe']);router[_0xa453('0x8')](_0xa453('0xb'),auth['isAuthenticated'](),controller[_0xa453('0xc')]);router[_0xa453('0xd')]('/',auth['isAuthenticated'](),controller[_0xa453('0xe')]);router['put'](_0xa453('0xb'),auth[_0xa453('0x9')](),controller[_0xa453('0xf')]);router[_0xa453('0x10')](_0xa453('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa453('0x11')]=router; \ No newline at end of file +var _0xb420=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','index','get','/describe','isAuthenticated','/:id','create','put','delete','exports','multer','path'];(function(_0x190065,_0x1da768){var _0xb540a7=function(_0x1e06d4){while(--_0x1e06d4){_0x190065['push'](_0x190065['shift']());}};_0xb540a7(++_0x1da768);}(_0xb420,0x6a));var _0x0b42=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb420[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0b42('0x0'));var util=require('util');var path=require(_0x0b42('0x1'));var timeout=require(_0x0b42('0x2'));var express=require(_0x0b42('0x3'));var router=express[_0x0b42('0x4')]();var auth=require(_0x0b42('0x5'));var interaction=require(_0x0b42('0x6'));var config=require(_0x0b42('0x7'));var controller=require(_0x0b42('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0b42('0x9')]);router[_0x0b42('0xa')](_0x0b42('0xb'),auth[_0x0b42('0xc')](),controller['describe']);router[_0x0b42('0xa')](_0x0b42('0xd'),auth[_0x0b42('0xc')](),controller['show']);router['post']('/',auth[_0x0b42('0xc')](),controller[_0x0b42('0xe')]);router[_0x0b42('0xf')](_0x0b42('0xd'),auth[_0x0b42('0xc')](),controller['update']);router[_0x0b42('0x10')](_0x0b42('0xd'),auth[_0x0b42('0xc')](),controller['destroy']);module[_0x0b42('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index ce8feee..c542160 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 _0x6c45=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x2f596b,_0x9c274d){var _0x38fcce=function(_0x460dbb){while(--_0x460dbb){_0x2f596b['push'](_0x2f596b['shift']());}};_0x38fcce(++_0x9c274d);}(_0x6c45,0xb1));var _0x56c4=function(_0x21566d,_0x5d1d14){_0x21566d=_0x21566d-0x0;var _0x56c0aa=_0x6c45[_0x21566d];return _0x56c0aa;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x56c4('0x2')],'allowNull':![],'defaultValue':_0x56c4('0x3')},'appdata':{'type':Sequelize[_0x56c4('0x4')]()},'description':{'type':Sequelize[_0x56c4('0x2')]},'interval':{'type':Sequelize[_0x56c4('0x2')],'defaultValue':_0x56c4('0x5')}}; \ No newline at end of file +var _0x04cc=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x1bfd6d,_0x42188c){var _0x2fcd76=function(_0x1fe190){while(--_0x1fe190){_0x1bfd6d['push'](_0x1bfd6d['shift']());}};_0x2fcd76(++_0x42188c);}(_0x04cc,0x11a));var _0xc04c=function(_0x557bf4,_0x1f8dad){_0x557bf4=_0x557bf4-0x0;var _0x2916e2=_0x04cc[_0x557bf4];return _0x2916e2;};'use strict';var Sequelize=require(_0xc04c('0x0'));module[_0xc04c('0x1')]={'priority':{'type':Sequelize[_0xc04c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc04c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc04c('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc04c('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 81d6593..379d492 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 _0x03f2=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','includeAll','merge','options','find','catch','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03f2,0x95));var _0x203f=function(_0x108c68,_0x562c35){_0x108c68=_0x108c68-0x0;var _0x1e5e6e=_0x03f2[_0x108c68];return _0x1e5e6e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x203f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x203f('0x1'));var rp=require(_0x203f('0x2'));var moment=require(_0x203f('0x3'));var BPromise=require(_0x203f('0x4'));var Mustache=require('mustache');var util=require(_0x203f('0x5'));var path=require('path');var sox=require(_0x203f('0x6'));var csv=require('to-csv');var ejs=require(_0x203f('0x7'));var fs=require('fs');var _=require(_0x203f('0x8'));var squel=require(_0x203f('0x9'));var crypto=require('crypto');var jsforce=require(_0x203f('0xa'));var deskjs=require(_0x203f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x203f('0xc'));var Papa=require(_0x203f('0xd'));var Redis=require(_0x203f('0xe'));var authService=require(_0x203f('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x203f('0x10'));var logger=require(_0x203f('0x11'))(_0x203f('0x12'));var utils=require('../../config/utils');var config=require(_0x203f('0x13'));var db=require(_0x203f('0x14'))['db'];function respondWithStatusCode(_0x2ad792,_0xbdfd63){_0xbdfd63=_0xbdfd63||0xcc;return function(_0xd254a9){if(_0xd254a9){return _0x2ad792[_0x203f('0x15')](_0xbdfd63);}return _0x2ad792['status'](_0xbdfd63)[_0x203f('0x16')]();};}function respondWithResult(_0x3f306f,_0x3e49e8){_0x3e49e8=_0x3e49e8||0xc8;return function(_0x265a13){if(_0x265a13){return _0x3f306f[_0x203f('0x17')](_0x3e49e8)[_0x203f('0x18')](_0x265a13);}};}function respondWithFilteredResult(_0x237844,_0x41d027){return function(_0x578375){if(_0x578375){var _0x2f2574=_0x578375[_0x203f('0x19')],_0x311071=_0x41d027['offset'],_0x2c63dd=_0x41d027[_0x203f('0x1a')]+_0x41d027[_0x203f('0x1b')],_0x19980c;if(_0x2c63dd>=_0x2f2574){_0x2c63dd=_0x2f2574;_0x19980c=0xc8;}else{_0x19980c=0xce;}_0x237844[_0x203f('0x17')](_0x19980c);return _0x237844[_0x203f('0x1c')](_0x203f('0x1d'),_0x311071+'-'+_0x2c63dd+'/'+_0x2f2574)[_0x203f('0x18')](_0x578375);}return null;};}function patchUpdates(_0x56c749){return function(_0x402ddb){try{jsonpatch[_0x203f('0x1e')](_0x402ddb,_0x56c749,!![]);}catch(_0x130c8c){return BPromise['reject'](_0x130c8c);}return _0x402ddb['save']();};}function saveUpdates(_0x40aecf,_0x46b1c9){return function(_0xdc1a67){if(_0xdc1a67){return _0xdc1a67['update'](_0x40aecf)[_0x203f('0x1f')](function(_0x214382){return _0x214382;});}return null;};}function removeEntity(_0xcea7f1,_0x3cc729){return function(_0x2e068d){if(_0x2e068d){return _0x2e068d[_0x203f('0x20')]()[_0x203f('0x1f')](function(){_0xcea7f1[_0x203f('0x17')](0xcc)[_0x203f('0x16')]();});}};}function handleEntityNotFound(_0x4f750a,_0x2a6677){return function(_0x1efe74){if(!_0x1efe74){_0x4f750a[_0x203f('0x15')](0x194);}return _0x1efe74;};}function handleError(_0x566334,_0x57725a){_0x57725a=_0x57725a||0x1f4;return function(_0x4be47b){logger[_0x203f('0x21')](_0x4be47b[_0x203f('0x22')]);if(_0x4be47b[_0x203f('0x23')]){delete _0x4be47b[_0x203f('0x23')];}_0x566334[_0x203f('0x17')](_0x57725a)[_0x203f('0x24')](_0x4be47b);};}exports[_0x203f('0x25')]=function(_0x5b6132,_0x5071e0){var _0xf58e78={'raw':!![],'where':{'id':_0x5b6132[_0x203f('0x26')]['id']}},_0x3065f6={};_0x3065f6[_0x203f('0x27')]=_[_0x203f('0x28')](db[_0x203f('0x29')][_0x203f('0x2a')]);_0x3065f6[_0x203f('0x2b')]=_[_0x203f('0x28')](_0x5b6132[_0x203f('0x2b')]);_0x3065f6['filters']=_[_0x203f('0x2c')](_0x3065f6[_0x203f('0x27')],_0x3065f6['query']);_0xf58e78['attributes']=_[_0x203f('0x2c')](_0x3065f6[_0x203f('0x27')],qs[_0x203f('0x2d')](_0x5b6132[_0x203f('0x2b')][_0x203f('0x2d')]));_0xf58e78['attributes']=_0xf58e78[_0x203f('0x2e')]['length']?_0xf58e78[_0x203f('0x2e')]:_0x3065f6[_0x203f('0x27')];if(_0x5b6132[_0x203f('0x2b')][_0x203f('0x2f')]){_0xf58e78['include']=[{'all':!![]}];}_0xf58e78=_[_0x203f('0x30')]({},_0xf58e78,_0x5b6132[_0x203f('0x31')]);return db['ChatApplication'][_0x203f('0x32')](_0xf58e78)[_0x203f('0x1f')](handleEntityNotFound(_0x5071e0,null))[_0x203f('0x1f')](respondWithResult(_0x5071e0,null))[_0x203f('0x33')](handleError(_0x5071e0,null));};exports[_0x203f('0x34')]=function(_0x262138,_0x5c599e){if(_0x262138[_0x203f('0x35')]['id']){delete _0x262138[_0x203f('0x35')]['id'];}return db[_0x203f('0x29')][_0x203f('0x32')]({'where':{'id':_0x262138[_0x203f('0x26')]['id']}})['then'](handleEntityNotFound(_0x5c599e,null))[_0x203f('0x1f')](saveUpdates(_0x262138['body'],null))['then'](respondWithResult(_0x5c599e,null))['catch'](handleError(_0x5c599e,null));};exports[_0x203f('0x20')]=function(_0xf8a879,_0x2c6682){return db['ChatApplication']['find']({'where':{'id':_0xf8a879[_0x203f('0x26')]['id']}})[_0x203f('0x1f')](handleEntityNotFound(_0x2c6682,null))[_0x203f('0x1f')](removeEntity(_0x2c6682,null))[_0x203f('0x33')](handleError(_0x2c6682,null));}; \ No newline at end of file +var _0x1ef8=['query','intersection','attributes','length','include','merge','options','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes'];(function(_0x524baa,_0x3536a4){var _0xf0fd1e=function(_0x663174){while(--_0x663174){_0x524baa['push'](_0x524baa['shift']());}};_0xf0fd1e(++_0x3536a4);}(_0x1ef8,0x1b2));var _0x81ef=function(_0x56c578,_0x5b3979){_0x56c578=_0x56c578-0x0;var _0xf3b4d6=_0x1ef8[_0x56c578];return _0xf3b4d6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x81ef('0x0'));var zipdir=require(_0x81ef('0x1'));var jsonpatch=require(_0x81ef('0x2'));var rp=require(_0x81ef('0x3'));var moment=require('moment');var BPromise=require(_0x81ef('0x4'));var Mustache=require(_0x81ef('0x5'));var util=require(_0x81ef('0x6'));var path=require('path');var sox=require(_0x81ef('0x7'));var csv=require(_0x81ef('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x81ef('0x9'));var squel=require(_0x81ef('0xa'));var crypto=require('crypto');var jsforce=require(_0x81ef('0xb'));var deskjs=require(_0x81ef('0xc'));var toCsv=require(_0x81ef('0x8'));var querystring=require(_0x81ef('0xd'));var Papa=require(_0x81ef('0xe'));var Redis=require('ioredis');var authService=require(_0x81ef('0xf'));var qs=require(_0x81ef('0x10'));var hardwareService=require(_0x81ef('0x11'));var logger=require(_0x81ef('0x12'))('api');var utils=require(_0x81ef('0x13'));var config=require(_0x81ef('0x14'));var db=require(_0x81ef('0x15'))['db'];function respondWithStatusCode(_0x47369d,_0x2b0689){_0x2b0689=_0x2b0689||0xcc;return function(_0x3858eb){if(_0x3858eb){return _0x47369d[_0x81ef('0x16')](_0x2b0689);}return _0x47369d[_0x81ef('0x17')](_0x2b0689)[_0x81ef('0x18')]();};}function respondWithResult(_0x20a324,_0x202d40){_0x202d40=_0x202d40||0xc8;return function(_0x33e9a8){if(_0x33e9a8){return _0x20a324[_0x81ef('0x17')](_0x202d40)[_0x81ef('0x19')](_0x33e9a8);}};}function respondWithFilteredResult(_0x102940,_0x9cb497){return function(_0x55e19f){if(_0x55e19f){var _0x41d740=_0x55e19f[_0x81ef('0x1a')],_0x52838f=_0x9cb497['offset'],_0x3dc46d=_0x9cb497['offset']+_0x9cb497['limit'],_0x27f98b;if(_0x3dc46d>=_0x41d740){_0x3dc46d=_0x41d740;_0x27f98b=0xc8;}else{_0x27f98b=0xce;}_0x102940['status'](_0x27f98b);return _0x102940[_0x81ef('0x1b')](_0x81ef('0x1c'),_0x52838f+'-'+_0x3dc46d+'/'+_0x41d740)[_0x81ef('0x19')](_0x55e19f);}return null;};}function patchUpdates(_0x2c1f13){return function(_0x97bf52){try{jsonpatch[_0x81ef('0x1d')](_0x97bf52,_0x2c1f13,!![]);}catch(_0x31d811){return BPromise[_0x81ef('0x1e')](_0x31d811);}return _0x97bf52['save']();};}function saveUpdates(_0x2b5a7c,_0x22bbc6){return function(_0x174242){if(_0x174242){return _0x174242[_0x81ef('0x1f')](_0x2b5a7c)[_0x81ef('0x20')](function(_0x4e4a8){return _0x4e4a8;});}return null;};}function removeEntity(_0xc5fa99,_0x3c7a12){return function(_0x226eb7){if(_0x226eb7){return _0x226eb7['destroy']()[_0x81ef('0x20')](function(){_0xc5fa99[_0x81ef('0x17')](0xcc)[_0x81ef('0x18')]();});}};}function handleEntityNotFound(_0x19758b,_0x21cb5b){return function(_0x527e18){if(!_0x527e18){_0x19758b[_0x81ef('0x16')](0x194);}return _0x527e18;};}function handleError(_0x399566,_0x4022da){_0x4022da=_0x4022da||0x1f4;return function(_0x597283){logger[_0x81ef('0x21')](_0x597283[_0x81ef('0x22')]);if(_0x597283[_0x81ef('0x23')]){delete _0x597283['name'];}_0x399566[_0x81ef('0x17')](_0x4022da)[_0x81ef('0x24')](_0x597283);};}exports[_0x81ef('0x25')]=function(_0x1bccee,_0x4c44ac){var _0x3c32fb={'raw':!![],'where':{'id':_0x1bccee[_0x81ef('0x26')]['id']}},_0x4228e6={};_0x4228e6[_0x81ef('0x27')]=_[_0x81ef('0x28')](db[_0x81ef('0x29')][_0x81ef('0x2a')]);_0x4228e6[_0x81ef('0x2b')]=_[_0x81ef('0x28')](_0x1bccee[_0x81ef('0x2b')]);_0x4228e6['filters']=_[_0x81ef('0x2c')](_0x4228e6[_0x81ef('0x27')],_0x4228e6[_0x81ef('0x2b')]);_0x3c32fb['attributes']=_['intersection'](_0x4228e6[_0x81ef('0x27')],qs['fields'](_0x1bccee[_0x81ef('0x2b')]['fields']));_0x3c32fb[_0x81ef('0x2d')]=_0x3c32fb[_0x81ef('0x2d')][_0x81ef('0x2e')]?_0x3c32fb[_0x81ef('0x2d')]:_0x4228e6[_0x81ef('0x27')];if(_0x1bccee[_0x81ef('0x2b')]['includeAll']){_0x3c32fb[_0x81ef('0x2f')]=[{'all':!![]}];}_0x3c32fb=_[_0x81ef('0x30')]({},_0x3c32fb,_0x1bccee[_0x81ef('0x31')]);return db['ChatApplication'][_0x81ef('0x32')](_0x3c32fb)[_0x81ef('0x20')](handleEntityNotFound(_0x4c44ac,null))['then'](respondWithResult(_0x4c44ac,null))[_0x81ef('0x33')](handleError(_0x4c44ac,null));};exports[_0x81ef('0x1f')]=function(_0x471611,_0x3e100d){if(_0x471611[_0x81ef('0x34')]['id']){delete _0x471611[_0x81ef('0x34')]['id'];}return db[_0x81ef('0x29')]['find']({'where':{'id':_0x471611[_0x81ef('0x26')]['id']}})[_0x81ef('0x20')](handleEntityNotFound(_0x3e100d,null))[_0x81ef('0x20')](saveUpdates(_0x471611[_0x81ef('0x34')],null))[_0x81ef('0x20')](respondWithResult(_0x3e100d,null))[_0x81ef('0x33')](handleError(_0x3e100d,null));};exports['destroy']=function(_0x19b395,_0x163f16){return db['ChatApplication'][_0x81ef('0x32')]({'where':{'id':_0x19b395[_0x81ef('0x26')]['id']}})[_0x81ef('0x20')](handleEntityNotFound(_0x163f16,null))[_0x81ef('0x20')](removeEntity(_0x163f16,null))['catch'](handleError(_0x163f16,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ada6ed4..c069653 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 _0x9754=['request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x9754,0x96));var _0x4975=function(_0x45c58a,_0x417a6c){_0x45c58a=_0x45c58a-0x0;var _0xf3a07=_0x9754[_0x45c58a];return _0xf3a07;};'use strict';var _=require(_0x4975('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4975('0x1'));var moment=require(_0x4975('0x2'));var BPromise=require(_0x4975('0x3'));var rp=require(_0x4975('0x4'));var fs=require('fs');var path=require(_0x4975('0x5'));var rimraf=require(_0x4975('0x6'));var config=require(_0x4975('0x7'));var attributes=require(_0x4975('0x8'));module['exports']=function(_0x3e5663,_0x32c43c){return _0x3e5663[_0x4975('0x9')](_0x4975('0xa'),attributes,{'tableName':_0x4975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4975('0xc'),'collate':_0x4975('0xd')});}; \ No newline at end of file +var _0x9d4b=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d84ee,_0x27624d){var _0x148672=function(_0x39396f){while(--_0x39396f){_0x2d84ee['push'](_0x2d84ee['shift']());}};_0x148672(++_0x27624d);}(_0x9d4b,0x18f));var _0xb9d4=function(_0x7c652,_0x10b81e){_0x7c652=_0x7c652-0x0;var _0xf96bc2=_0x9d4b[_0x7c652];return _0xf96bc2;};'use strict';var _=require(_0xb9d4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb9d4('0x1'));var moment=require(_0xb9d4('0x2'));var BPromise=require(_0xb9d4('0x3'));var rp=require(_0xb9d4('0x4'));var fs=require('fs');var path=require(_0xb9d4('0x5'));var rimraf=require(_0xb9d4('0x6'));var config=require(_0xb9d4('0x7'));var attributes=require(_0xb9d4('0x8'));module[_0xb9d4('0x9')]=function(_0x2b0dd7,_0x3645bf){return _0x2b0dd7[_0xb9d4('0xa')]('ChatApplication',attributes,{'tableName':_0xb9d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9d4('0xc'),'collate':_0xb9d4('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index c9c883a..642a8f1 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 _0xe073=['error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','debug','request\x20sent'];(function(_0xc104e6,_0x4b1d3c){var _0x32317c=function(_0xa73fac){while(--_0xa73fac){_0xc104e6['push'](_0xc104e6['shift']());}};_0x32317c(++_0x4b1d3c);}(_0xe073,0x10b));var _0x3e07=function(_0x4245e0,_0x5a23b5){_0x4245e0=_0x4245e0-0x0;var _0x2298e9=_0xe073[_0x4245e0];return _0x2298e9;};'use strict';var _=require(_0x3e07('0x0'));var util=require(_0x3e07('0x1'));var moment=require(_0x3e07('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e07('0x3'));var fs=require('fs');var Redis=require(_0x3e07('0x4'));var db=require(_0x3e07('0x5'))['db'];var utils=require(_0x3e07('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e07('0x7'));var jayson=require(_0x3e07('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3377,_0x351129,_0x63e9df){return new BPromise(function(_0x330b67,_0x2bc582){return client[_0x3e07('0x9')](_0x1c3377,_0x63e9df)[_0x3e07('0xa')](function(_0x323ac3){logger['info']('ChatApplication,\x20%s,\x20%s',_0x351129,'request\x20sent');logger[_0x3e07('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x351129,_0x3e07('0xc'),JSON['stringify'](_0x323ac3));if(_0x323ac3['error']){if(_0x323ac3[_0x3e07('0xd')][_0x3e07('0xe')]===0x1f4){logger['error'](_0x3e07('0xf'),_0x351129,_0x323ac3['error'][_0x3e07('0x10')]);return _0x2bc582(_0x323ac3['error'][_0x3e07('0x10')]);}logger[_0x3e07('0xd')](_0x3e07('0xf'),_0x351129,_0x323ac3[_0x3e07('0xd')]['message']);return _0x330b67(_0x323ac3[_0x3e07('0xd')][_0x3e07('0x10')]);}else{logger[_0x3e07('0x11')]('ChatApplication,\x20%s,\x20%s',_0x351129,'request\x20sent');_0x330b67(_0x323ac3[_0x3e07('0x12')][_0x3e07('0x10')]);}})[_0x3e07('0x13')](function(_0x254307){logger[_0x3e07('0xd')](_0x3e07('0xf'),_0x351129,_0x254307);_0x2bc582(_0x254307);});});} \ No newline at end of file +var _0x75ec=['request','then','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x26a0b6,_0x1a009c){var _0x1e1cdd=function(_0x59813d){while(--_0x59813d){_0x26a0b6['push'](_0x26a0b6['shift']());}};_0x1e1cdd(++_0x1a009c);}(_0x75ec,0xac));var _0xc75e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x75ec[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc75e('0x0'));var util=require(_0xc75e('0x1'));var moment=require(_0xc75e('0x2'));var BPromise=require(_0xc75e('0x3'));var rs=require(_0xc75e('0x4'));var fs=require('fs');var Redis=require(_0xc75e('0x5'));var db=require(_0xc75e('0x6'))['db'];var utils=require(_0xc75e('0x7'));var logger=require('../../config/logger')(_0xc75e('0x8'));var config=require('../../config/environment');var jayson=require(_0xc75e('0x9'));var client=jayson[_0xc75e('0xa')][_0xc75e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f63ab,_0x17fb43,_0x442bf3){return new BPromise(function(_0xcfe083,_0x803d42){return client[_0xc75e('0xc')](_0x1f63ab,_0x442bf3)[_0xc75e('0xd')](function(_0x414c2e){logger[_0xc75e('0xe')]('ChatApplication,\x20%s,\x20%s',_0x17fb43,'request\x20sent');logger['debug'](_0xc75e('0xf'),_0x17fb43,_0xc75e('0x10'),JSON['stringify'](_0x414c2e));if(_0x414c2e['error']){if(_0x414c2e[_0xc75e('0x11')][_0xc75e('0x12')]===0x1f4){logger[_0xc75e('0x11')](_0xc75e('0x13'),_0x17fb43,_0x414c2e['error']['message']);return _0x803d42(_0x414c2e[_0xc75e('0x11')][_0xc75e('0x14')]);}logger[_0xc75e('0x11')]('ChatApplication,\x20%s,\x20%s',_0x17fb43,_0x414c2e[_0xc75e('0x11')]['message']);return _0xcfe083(_0x414c2e['error'][_0xc75e('0x14')]);}else{logger[_0xc75e('0xe')]('ChatApplication,\x20%s,\x20%s',_0x17fb43,_0xc75e('0x10'));_0xcfe083(_0x414c2e[_0xc75e('0x15')][_0xc75e('0x14')]);}})[_0xc75e('0x16')](function(_0x25cb4f){logger[_0xc75e('0x11')](_0xc75e('0x13'),_0x17fb43,_0x25cb4f);_0x803d42(_0x25cb4f);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b796d1e..0bc9ed8 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 _0xbd19=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xbd19,0x16c));var _0x9bd1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xbd19[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var path=require(_0x9bd1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bd1('0x3')]();var auth=require(_0x9bd1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9bd1('0x5'));var controller=require(_0x9bd1('0x6'));router[_0x9bd1('0x7')](_0x9bd1('0x8'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xa')]);router[_0x9bd1('0xb')](_0x9bd1('0x8'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xc')]);router[_0x9bd1('0xd')](_0x9bd1('0x8'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xe')]);module[_0x9bd1('0xf')]=router; \ No newline at end of file +var _0x2b09=['util','connect-timeout','express','Router','../../components/auth/service','get','/:id','show','put','isAuthenticated','update','destroy','exports','multer'];(function(_0x25e3b3,_0x27b4cb){var _0x2b4502=function(_0x17a86d){while(--_0x17a86d){_0x25e3b3['push'](_0x25e3b3['shift']());}};_0x2b4502(++_0x27b4cb);}(_0x2b09,0xd1));var _0x92b0=function(_0x37e9e6,_0x1482cf){_0x37e9e6=_0x37e9e6-0x0;var _0x903605=_0x2b09[_0x37e9e6];return _0x903605;};'use strict';var multer=require(_0x92b0('0x0'));var util=require(_0x92b0('0x1'));var path=require('path');var timeout=require(_0x92b0('0x2'));var express=require(_0x92b0('0x3'));var router=express[_0x92b0('0x4')]();var auth=require(_0x92b0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x92b0('0x6')](_0x92b0('0x7'),auth['isAuthenticated'](),controller[_0x92b0('0x8')]);router[_0x92b0('0x9')](_0x92b0('0x7'),auth[_0x92b0('0xa')](),controller[_0x92b0('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x92b0('0xc')]);module[_0x92b0('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index f8b36cd..c6845ae 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 _0xc7c3=['exports','STRING','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc7c3,0x143));var _0x3c7c=function(_0x21ee43,_0x2c2357){_0x21ee43=_0x21ee43-0x0;var _0x56f0c7=_0xc7c3[_0x21ee43];return _0x56f0c7;};'use strict';var Sequelize=require(_0x3c7c('0x0'));module[_0x3c7c('0x1')]={'name':{'type':Sequelize[_0x3c7c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x726c=['exports','STRING','BOOLEAN','sequelize'];(function(_0x56e4f4,_0x21e66f){var _0x5b499b=function(_0x58cb85){while(--_0x58cb85){_0x56e4f4['push'](_0x56e4f4['shift']());}};_0x5b499b(++_0x21e66f);}(_0x726c,0x197));var _0xc726=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x726c[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0xc726('0x0'));module[_0xc726('0x1')]={'name':{'type':Sequelize[_0xc726('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc726('0x2')]},'write':{'type':Sequelize[_0xc726('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b47a264..7192a3e 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 _0xf86f=['stringify','error','message','result','catch','status','end','offset','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','index','ChatGroup','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','map','key','options','count','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','getUnread','user','toInteger','addMembers','ids','User','order','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x47ee23,_0x58aad2){var _0x5b4718=function(_0x25cd81){while(--_0x25cd81){_0x47ee23['push'](_0x47ee23['shift']());}};_0x5b4718(++_0x58aad2);}(_0xf86f,0xae));var _0xff86=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0xf86f[_0x20cf8a];return _0x54e165;};'use strict';var pdf=require(_0xff86('0x0'));var emlformat=require(_0xff86('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xff86('0x2'));var rp=require(_0xff86('0x3'));var moment=require('moment');var BPromise=require(_0xff86('0x4'));var Mustache=require('mustache');var util=require(_0xff86('0x5'));var path=require('path');var sox=require(_0xff86('0x6'));var csv=require('to-csv');var ejs=require(_0xff86('0x7'));var fs=require('fs');var _=require(_0xff86('0x8'));var squel=require('squel');var crypto=require(_0xff86('0x9'));var jsforce=require(_0xff86('0xa'));var deskjs=require(_0xff86('0xb'));var toCsv=require(_0xff86('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xff86('0xd'));var authService=require(_0xff86('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff86('0xf'))(_0xff86('0x10'));var utils=require('../../config/utils');var config=require(_0xff86('0x11'));var db=require(_0xff86('0x12'))['db'];config['redis']=_[_0xff86('0x13')](config[_0xff86('0x14')],{'host':_0xff86('0x15'),'port':0x18eb});var socket=require(_0xff86('0x16'))(new Redis(config[_0xff86('0x14')]));require(_0xff86('0x17'))[_0xff86('0x18')](socket);var jayson=require(_0xff86('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5dff45,_0xbcfe99,_0x1fa187){if(_0x1fa187){var _0x2b9f36=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b9f36[_0xff86('0x1a')](_0xbcfe99)){return _0x5dff45;}else{throw new Error(_0xff86('0x1b'));}}else{return _0x5dff45;}}function respondWithRpcPromise(_0x418bb8,_0x130e3b,_0x8f5e4e,_0x2b4d1a){return new BPromise(function(_0x5dc65f,_0x226783){var _0x376506=_0x2b4d1a||client;return _0x376506['request'](_0x418bb8,_0x8f5e4e)[_0xff86('0x1c')](function(_0x44b68d){logger[_0xff86('0x1d')](_0xff86('0x1e'),_0x130e3b,_0xff86('0x1f'));logger[_0xff86('0x20')](_0xff86('0x21'),_0x130e3b,_0xff86('0x1f'),JSON[_0xff86('0x22')](_0x44b68d));if(_0x44b68d[_0xff86('0x23')]){if(_0x44b68d['error']['code']===0x1f4){logger[_0xff86('0x23')](_0xff86('0x1e'),_0x130e3b,_0x44b68d[_0xff86('0x23')]['message']);return _0x226783(_0x44b68d[_0xff86('0x23')][_0xff86('0x24')]);}logger[_0xff86('0x23')](_0xff86('0x1e'),_0x130e3b,_0x44b68d[_0xff86('0x23')][_0xff86('0x24')]);return _0x5dc65f(_0x44b68d[_0xff86('0x23')]['message']);}else{logger['info'](_0xff86('0x1e'),_0x130e3b,_0xff86('0x1f'));_0x5dc65f(_0x44b68d[_0xff86('0x25')][_0xff86('0x24')]);}})[_0xff86('0x26')](function(_0x51bd29){logger['error']('ChatGroup,\x20%s,\x20%s',_0x130e3b,_0x51bd29);_0x226783(_0x51bd29);});});}function respondWithStatusCode(_0x644be5,_0x22c954){_0x22c954=_0x22c954||0xcc;return function(_0x563024){if(_0x563024){return _0x644be5['sendStatus'](_0x22c954);}return _0x644be5[_0xff86('0x27')](_0x22c954)[_0xff86('0x28')]();};}function respondWithResult(_0x19d3c5,_0x4d0278){_0x4d0278=_0x4d0278||0xc8;return function(_0x490dd6){if(_0x490dd6){return _0x19d3c5[_0xff86('0x27')](_0x4d0278)['json'](_0x490dd6);}};}function respondWithFilteredResult(_0x4ee6b4,_0x157a4e){return function(_0x4cda56){if(_0x4cda56){var _0x23ee40=_0x4cda56['count'],_0x335649=_0x157a4e[_0xff86('0x29')],_0x1e1c2f=_0x157a4e['offset']+_0x157a4e['limit'],_0x4f784a;if(_0x1e1c2f>=_0x23ee40){_0x1e1c2f=_0x23ee40;_0x4f784a=0xc8;}else{_0x4f784a=0xce;}_0x4ee6b4[_0xff86('0x27')](_0x4f784a);return _0x4ee6b4[_0xff86('0x2a')](_0xff86('0x2b'),_0x335649+'-'+_0x1e1c2f+'/'+_0x23ee40)[_0xff86('0x2c')](_0x4cda56);}return null;};}function patchUpdates(_0x89e942){return function(_0x4a6c5e){try{jsonpatch[_0xff86('0x2d')](_0x4a6c5e,_0x89e942,!![]);}catch(_0x41f39f){return BPromise[_0xff86('0x2e')](_0x41f39f);}return _0x4a6c5e[_0xff86('0x2f')]();};}function saveUpdates(_0x2730eb,_0x3d3b74){return function(_0x5b1d5a){if(_0x5b1d5a){return _0x5b1d5a[_0xff86('0x30')](_0x2730eb)[_0xff86('0x1c')](function(_0x332a9c){return _0x332a9c;});}return null;};}function removeEntity(_0x2b3516,_0x3c34a7){return function(_0x499f26){if(_0x499f26){return _0x499f26['destroy']()['then'](function(){_0x2b3516[_0xff86('0x27')](0xcc)[_0xff86('0x28')]();});}};}function handleEntityNotFound(_0x5c4bd9,_0x432ddc){return function(_0x479769){if(!_0x479769){_0x5c4bd9[_0xff86('0x31')](0x194);}return _0x479769;};}function handleError(_0xa8cf71,_0x658312){_0x658312=_0x658312||0x1f4;return function(_0x550f70){logger[_0xff86('0x23')](_0x550f70[_0xff86('0x32')]);if(_0x550f70[_0xff86('0x33')]){delete _0x550f70[_0xff86('0x33')];}_0xa8cf71[_0xff86('0x27')](_0x658312)[_0xff86('0x34')](_0x550f70);};}exports[_0xff86('0x35')]=function(_0x1925bb,_0x297a5e){var _0x5036f1={},_0x4c6b36={},_0x1d66ba={'count':0x0,'rows':[]};var _0x376bdb=db[_0xff86('0x36')]['rawAttributes'];_0x4c6b36[_0xff86('0x37')]=_[_0xff86('0x38')](_0x376bdb);_0x4c6b36[_0xff86('0x39')]=_[_0xff86('0x38')](_0x1925bb[_0xff86('0x39')]);_0x4c6b36['filters']=_[_0xff86('0x3a')](_0x4c6b36[_0xff86('0x37')],_0x4c6b36[_0xff86('0x39')]);_0x5036f1['attributes']=_[_0xff86('0x3a')](_0x4c6b36[_0xff86('0x37')],qs[_0xff86('0x3b')](_0x1925bb[_0xff86('0x39')][_0xff86('0x3b')]));_0x5036f1[_0xff86('0x3c')]=_0x5036f1[_0xff86('0x3c')][_0xff86('0x3d')]?_0x5036f1[_0xff86('0x3c')]:_0x4c6b36[_0xff86('0x37')];if(!_0x1925bb[_0xff86('0x39')][_0xff86('0x3e')](_0xff86('0x3f'))){_0x5036f1[_0xff86('0x40')]=qs[_0xff86('0x40')](_0x1925bb[_0xff86('0x39')][_0xff86('0x40')]);_0x5036f1[_0xff86('0x29')]=qs['offset'](_0x1925bb[_0xff86('0x39')][_0xff86('0x29')]);}_0x5036f1['order']=qs[_0xff86('0x41')](_0x1925bb[_0xff86('0x39')][_0xff86('0x41')]);_0x5036f1[_0xff86('0x42')]=qs[_0xff86('0x43')](_[_0xff86('0x44')](_0x1925bb[_0xff86('0x39')],_0x4c6b36[_0xff86('0x43')]));if(_0x1925bb['query'][_0xff86('0x45')]){_0x5036f1['where']=_[_0xff86('0x46')](_0x5036f1['where'],{'$or':_[_0xff86('0x47')](_0x376bdb,function(_0x370eeb){if(_0x370eeb['type'][_0xff86('0x48')]!=='VIRTUAL'){var _0x58668a={};_0x58668a[_0x370eeb['field']]={'$like':'%'+_0x1925bb['query']['filter']+'%'};return _0x58668a;}})});}_0x5036f1=_['merge']({},_0x5036f1,_0x1925bb[_0xff86('0x49')]);var _0x2d11ff={'where':_0x5036f1[_0xff86('0x42')]};return db[_0xff86('0x36')][_0xff86('0x4a')](_0x2d11ff)[_0xff86('0x1c')](function(_0x935b07){_0x1d66ba[_0xff86('0x4a')]=_0x935b07;if(_0x1925bb[_0xff86('0x39')]['includeAll']){_0x5036f1[_0xff86('0x4b')]=[{'all':!![]}];}return db[_0xff86('0x36')][_0xff86('0x4c')](_0x5036f1);})[_0xff86('0x1c')](function(_0x50d9ca){_0x1d66ba[_0xff86('0x4d')]=_0x50d9ca;return _0x1d66ba;})[_0xff86('0x1c')](respondWithFilteredResult(_0x297a5e,_0x5036f1))[_0xff86('0x26')](handleError(_0x297a5e,null));};exports[_0xff86('0x4e')]=function(_0x875e1e,_0x1ee8e6){var _0x3aa3d3={'raw':!![],'where':{'id':_0x875e1e[_0xff86('0x4f')]['id']}},_0x1c35d5={};_0x1c35d5['model']=_[_0xff86('0x38')](db[_0xff86('0x36')][_0xff86('0x50')]);_0x1c35d5[_0xff86('0x39')]=_[_0xff86('0x38')](_0x875e1e['query']);_0x1c35d5[_0xff86('0x43')]=_[_0xff86('0x3a')](_0x1c35d5[_0xff86('0x37')],_0x1c35d5[_0xff86('0x39')]);_0x3aa3d3[_0xff86('0x3c')]=_[_0xff86('0x3a')](_0x1c35d5[_0xff86('0x37')],qs[_0xff86('0x3b')](_0x875e1e[_0xff86('0x39')][_0xff86('0x3b')]));_0x3aa3d3[_0xff86('0x3c')]=_0x3aa3d3[_0xff86('0x3c')][_0xff86('0x3d')]?_0x3aa3d3[_0xff86('0x3c')]:_0x1c35d5[_0xff86('0x37')];if(_0x875e1e[_0xff86('0x39')][_0xff86('0x51')]){_0x3aa3d3[_0xff86('0x4b')]=[{'all':!![]}];}_0x3aa3d3=_['merge']({},_0x3aa3d3,_0x875e1e[_0xff86('0x49')]);return db[_0xff86('0x36')][_0xff86('0x52')](_0x3aa3d3)[_0xff86('0x1c')](handleEntityNotFound(_0x1ee8e6,null))[_0xff86('0x1c')](respondWithResult(_0x1ee8e6,null))[_0xff86('0x26')](handleError(_0x1ee8e6,null));};exports[_0xff86('0x53')]=function(_0x46a600,_0x4b1ecf){return db['ChatGroup'][_0xff86('0x53')](_0x46a600[_0xff86('0x54')],{})['then'](respondWithResult(_0x4b1ecf,0xc9))[_0xff86('0x26')](handleError(_0x4b1ecf,null));};exports[_0xff86('0x30')]=function(_0x470f4e,_0x12a3d0){if(_0x470f4e[_0xff86('0x54')]['id']){delete _0x470f4e[_0xff86('0x54')]['id'];}return db[_0xff86('0x36')][_0xff86('0x52')]({'where':{'id':_0x470f4e[_0xff86('0x4f')]['id']}})[_0xff86('0x1c')](handleEntityNotFound(_0x12a3d0,null))[_0xff86('0x1c')](saveUpdates(_0x470f4e[_0xff86('0x54')],null))[_0xff86('0x1c')](respondWithResult(_0x12a3d0,null))['catch'](handleError(_0x12a3d0,null));};exports[_0xff86('0x55')]=function(_0x392bad,_0x43b8af){return db[_0xff86('0x36')]['find']({'where':{'id':_0x392bad['params']['id']}})['then'](handleEntityNotFound(_0x43b8af,null))[_0xff86('0x1c')](removeEntity(_0x43b8af,null))[_0xff86('0x26')](handleError(_0x43b8af,null));};exports[_0xff86('0x56')]=function(_0x3c08d8,_0x56dea0){return db['ChatGroup'][_0xff86('0x56')]()[_0xff86('0x1c')](respondWithResult(_0x56dea0,null))['catch'](handleError(_0x56dea0,null));};exports[_0xff86('0x57')]=function(_0x3b4530,_0x13bfb6,_0x16aa08){return db['ChatInternalMessage'][_0xff86('0x4a')]({'where':{'ChatGroupId':_0x3b4530[_0xff86('0x4f')]['id'],'ToId':_0x3b4530[_0xff86('0x58')]['id'],'read':![]}})['then'](function(_0x398636){return{'id':_[_0xff86('0x59')](_0x3b4530['params']['id']),'count':_0x398636};})['then'](respondWithResult(_0x13bfb6,null))[_0xff86('0x26')](handleError(_0x13bfb6,null));};exports[_0xff86('0x5a')]=function(_0x3c5dca,_0x590a3f,_0x101002){return db[_0xff86('0x36')][_0xff86('0x52')]({'where':{'id':_0x3c5dca[_0xff86('0x4f')]['id']}})['then'](handleEntityNotFound(_0x590a3f,null))[_0xff86('0x1c')](function(_0x53b389){if(_0x53b389){return _0x53b389[_0xff86('0x5a')](_0x3c5dca[_0xff86('0x54')][_0xff86('0x5b')],_['omit'](_0x3c5dca['body'],[_0xff86('0x5b'),'id'])||{});}})[_0xff86('0x1c')](respondWithResult(_0x590a3f,null))[_0xff86('0x26')](handleError(_0x590a3f,null));};exports['getMembers']=function(_0x522224,_0x1045f6,_0x23aea3){var _0x290591={};var _0x3d5793={};var _0x1f2457;var _0x53ea75;return db[_0xff86('0x36')]['findOne']({'where':{'id':_0x522224[_0xff86('0x4f')]['id']}})[_0xff86('0x1c')](handleEntityNotFound(_0x1045f6,null))[_0xff86('0x1c')](function(_0x1ee3d6){if(_0x1ee3d6){_0x1f2457=_0x1ee3d6;_0x3d5793[_0xff86('0x37')]=_[_0xff86('0x38')](db[_0xff86('0x5c')][_0xff86('0x50')]);_0x3d5793['query']=_[_0xff86('0x38')](_0x522224[_0xff86('0x39')]);_0x3d5793['filters']=_[_0xff86('0x3a')](_0x3d5793[_0xff86('0x37')],_0x3d5793[_0xff86('0x39')]);_0x290591[_0xff86('0x3c')]=_[_0xff86('0x3a')](_0x3d5793[_0xff86('0x37')],qs[_0xff86('0x3b')](_0x522224[_0xff86('0x39')][_0xff86('0x3b')]));_0x290591[_0xff86('0x3c')]=_0x290591[_0xff86('0x3c')]['length']?_0x290591[_0xff86('0x3c')]:_0x3d5793[_0xff86('0x37')];_0x290591[_0xff86('0x5d')]=qs[_0xff86('0x41')](_0x522224[_0xff86('0x39')]['sort']);_0x290591[_0xff86('0x42')]=qs[_0xff86('0x43')](_[_0xff86('0x44')](_0x522224[_0xff86('0x39')],_0x3d5793[_0xff86('0x43')]));if(_0x522224[_0xff86('0x39')][_0xff86('0x45')]){_0x290591[_0xff86('0x42')]=_[_0xff86('0x46')](_0x290591['where'],{'$or':_[_0xff86('0x47')](_0x290591['attributes'],function(_0x148b10){var _0x220897={};_0x220897[_0x148b10]={'$like':'%'+_0x522224['query'][_0xff86('0x45')]+'%'};return _0x220897;})});}_0x290591=_[_0xff86('0x46')]({},_0x290591,_0x522224[_0xff86('0x49')]);return _0x1f2457[_0xff86('0x5e')](_0x290591);}})[_0xff86('0x1c')](function(_0x3cf715){if(_0x3cf715){_0x53ea75=_0x3cf715[_0xff86('0x3d')];if(!_0x522224[_0xff86('0x39')]['hasOwnProperty'](_0xff86('0x3f'))){_0x290591['limit']=qs['limit'](_0x522224[_0xff86('0x39')][_0xff86('0x40')]);_0x290591[_0xff86('0x29')]=qs['offset'](_0x522224[_0xff86('0x39')][_0xff86('0x29')]);}return _0x1f2457[_0xff86('0x5e')](_0x290591);}})[_0xff86('0x1c')](function(_0x2207b2){if(_0x2207b2){return _0x2207b2?{'count':_0x53ea75,'rows':_0x2207b2}:null;}})['then'](respondWithResult(_0x1045f6,null))['catch'](handleError(_0x1045f6,null));};exports['removeMembers']=function(_0x55af0f,_0x309a1d,_0x23fa4a){return db[_0xff86('0x36')][_0xff86('0x52')]({'where':{'id':_0x55af0f[_0xff86('0x4f')]['id']}})['then'](handleEntityNotFound(_0x309a1d,null))[_0xff86('0x1c')](function(_0x4e0262){if(_0x4e0262){return _0x4e0262[_0xff86('0x5f')](_0x55af0f['query'][_0xff86('0x5b')]);}})[_0xff86('0x1c')](respondWithStatusCode(_0x309a1d,null))['catch'](handleError(_0x309a1d,null));};exports[_0xff86('0x60')]=function(_0x214e50,_0x93db17,_0x254fd4){if(_0x214e50['body']['id']){delete _0x214e50[_0xff86('0x54')]['id'];}return db[_0xff86('0x36')][_0xff86('0x52')]({'where':{'id':_0x214e50['params']['id']}})[_0xff86('0x1c')](handleEntityNotFound(_0x93db17,null))[_0xff86('0x1c')](function(_0x50daac){if(_0x50daac){_0x214e50['body'][_0xff86('0x61')]=_0x50daac['id'];return db[_0xff86('0x62')][_0xff86('0x53')](_0x214e50['body']);}})[_0xff86('0x1c')](respondWithResult(_0x93db17,null))[_0xff86('0x26')](handleError(_0x93db17,null));};exports[_0xff86('0x63')]=function(_0x17393a,_0x271fcc,_0x3900be){var _0x528002={};var _0x19fb7e={};var _0x446c5e;var _0x25e475;return db['ChatGroup'][_0xff86('0x64')]({'where':{'id':_0x17393a[_0xff86('0x4f')]['id']}})[_0xff86('0x1c')](handleEntityNotFound(_0x271fcc,null))['then'](function(_0xcdad7e){if(_0xcdad7e){_0x446c5e=_0xcdad7e;_0x19fb7e[_0xff86('0x37')]=_[_0xff86('0x38')](db[_0xff86('0x62')][_0xff86('0x50')]);_0x19fb7e[_0xff86('0x39')]=_[_0xff86('0x38')](_0x17393a[_0xff86('0x39')]);_0x19fb7e[_0xff86('0x43')]=_[_0xff86('0x3a')](_0x19fb7e[_0xff86('0x37')],_0x19fb7e['query']);_0x528002[_0xff86('0x3c')]=_[_0xff86('0x3a')](_0x19fb7e[_0xff86('0x37')],qs['fields'](_0x17393a[_0xff86('0x39')][_0xff86('0x3b')]));_0x528002['attributes']=_0x528002[_0xff86('0x3c')][_0xff86('0x3d')]?_0x528002[_0xff86('0x3c')]:_0x19fb7e['model'];_0x528002[_0xff86('0x5d')]=qs['sort'](_0x17393a[_0xff86('0x39')][_0xff86('0x41')]);_0x528002['where']=qs['filters'](_[_0xff86('0x44')](_0x17393a[_0xff86('0x39')],_0x19fb7e[_0xff86('0x43')]));if(_0x17393a['query'][_0xff86('0x45')]){_0x528002['where']=_['merge'](_0x528002[_0xff86('0x42')],{'$or':_['map'](_0x528002[_0xff86('0x3c')],function(_0x30e628){var _0x31804e={};_0x31804e[_0x30e628]={'$like':'%'+_0x17393a[_0xff86('0x39')][_0xff86('0x45')]+'%'};return _0x31804e;})});}if(_0x17393a[_0xff86('0x39')][_0xff86('0x65')]){var _0x2e69a5=_0x17393a[_0xff86('0x39')][_0xff86('0x65')]['split'](',');var _0xc59da1={};_0xc59da1[_0x2e69a5[0x0]]={'$gte':moment(_0x2e69a5[0x1])[_0xff86('0x66')](_0xff86('0x67'))};_0x528002[_0xff86('0x42')]=_['merge'](_0x528002[_0xff86('0x42')],_0xc59da1);}_0x528002=_['merge']({},_0x528002,_0x17393a[_0xff86('0x49')]);return _0x446c5e[_0xff86('0x63')](_0x528002);}})[_0xff86('0x1c')](function(_0x20a621){if(_0x20a621){_0x25e475=_0x20a621[_0xff86('0x3d')];if(!_0x17393a['query']['hasOwnProperty']('nolimit')){_0x528002[_0xff86('0x40')]=qs[_0xff86('0x40')](_0x17393a['query']['limit']);_0x528002[_0xff86('0x29')]=qs[_0xff86('0x29')](_0x17393a[_0xff86('0x39')][_0xff86('0x29')]);}return _0x446c5e['getMessages'](_0x528002);}})['then'](function(_0x116b09){if(_0x116b09){return _0x116b09?{'count':_0x25e475,'rows':_0x116b09}:null;}})[_0xff86('0x1c')](respondWithResult(_0x271fcc,null))[_0xff86('0x26')](handleError(_0x271fcc,null));}; \ No newline at end of file +var _0xd196=['order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','destroy','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','sendStatus','status','count','offset','Content-Range','json','reject','save','update','end','stack','name','send','index','ChatGroup','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd196,0x1de));var _0x6d19=function(_0xf2682d,_0x48f012){_0xf2682d=_0xf2682d-0x0;var _0x53dea0=_0xd196[_0xf2682d];return _0x53dea0;};'use strict';var pdf=require(_0x6d19('0x0'));var emlformat=require(_0x6d19('0x1'));var rimraf=require(_0x6d19('0x2'));var zipdir=require(_0x6d19('0x3'));var jsonpatch=require(_0x6d19('0x4'));var rp=require(_0x6d19('0x5'));var moment=require('moment');var BPromise=require(_0x6d19('0x6'));var Mustache=require(_0x6d19('0x7'));var util=require(_0x6d19('0x8'));var path=require(_0x6d19('0x9'));var sox=require(_0x6d19('0xa'));var csv=require('to-csv');var ejs=require(_0x6d19('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6d19('0xc'));var crypto=require(_0x6d19('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6d19('0xe'));var toCsv=require(_0x6d19('0xf'));var querystring=require(_0x6d19('0x10'));var Papa=require(_0x6d19('0x11'));var Redis=require('ioredis');var authService=require(_0x6d19('0x12'));var qs=require(_0x6d19('0x13'));var hardwareService=require(_0x6d19('0x14'));var logger=require(_0x6d19('0x15'))(_0x6d19('0x16'));var utils=require(_0x6d19('0x17'));var config=require(_0x6d19('0x18'));var db=require(_0x6d19('0x19'))['db'];config[_0x6d19('0x1a')]=_[_0x6d19('0x1b')](config[_0x6d19('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d19('0x1c'))(new Redis(config[_0x6d19('0x1a')]));require('./chatGroup.socket')[_0x6d19('0x1d')](socket);var jayson=require(_0x6d19('0x1e'));var client=jayson[_0x6d19('0x1f')][_0x6d19('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2687e3,_0x3733e6,_0x329472){if(_0x329472){var _0x54ca76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54ca76[_0x6d19('0x21')](_0x3733e6)){return _0x2687e3;}else{throw new Error(_0x6d19('0x22'));}}else{return _0x2687e3;}}function respondWithRpcPromise(_0x1cd3e8,_0x2e306c,_0x454855,_0x166aae){return new BPromise(function(_0x6ead79,_0x2f776a){var _0x16a7f0=_0x166aae||client;return _0x16a7f0[_0x6d19('0x23')](_0x1cd3e8,_0x454855)[_0x6d19('0x24')](function(_0x3bcd52){logger[_0x6d19('0x25')]('ChatGroup,\x20%s,\x20%s',_0x2e306c,_0x6d19('0x26'));logger[_0x6d19('0x27')](_0x6d19('0x28'),_0x2e306c,_0x6d19('0x26'),JSON['stringify'](_0x3bcd52));if(_0x3bcd52[_0x6d19('0x29')]){if(_0x3bcd52[_0x6d19('0x29')][_0x6d19('0x2a')]===0x1f4){logger[_0x6d19('0x29')](_0x6d19('0x2b'),_0x2e306c,_0x3bcd52['error'][_0x6d19('0x2c')]);return _0x2f776a(_0x3bcd52[_0x6d19('0x29')][_0x6d19('0x2c')]);}logger['error'](_0x6d19('0x2b'),_0x2e306c,_0x3bcd52['error'][_0x6d19('0x2c')]);return _0x6ead79(_0x3bcd52['error'][_0x6d19('0x2c')]);}else{logger['info'](_0x6d19('0x2b'),_0x2e306c,'request\x20sent');_0x6ead79(_0x3bcd52['result']['message']);}})[_0x6d19('0x2d')](function(_0x3c2a6e){logger[_0x6d19('0x29')](_0x6d19('0x2b'),_0x2e306c,_0x3c2a6e);_0x2f776a(_0x3c2a6e);});});}function respondWithStatusCode(_0x377f12,_0x2e48bb){_0x2e48bb=_0x2e48bb||0xcc;return function(_0x5c674b){if(_0x5c674b){return _0x377f12[_0x6d19('0x2e')](_0x2e48bb);}return _0x377f12['status'](_0x2e48bb)['end']();};}function respondWithResult(_0x25fb0d,_0x482d05){_0x482d05=_0x482d05||0xc8;return function(_0x5c87db){if(_0x5c87db){return _0x25fb0d[_0x6d19('0x2f')](_0x482d05)['json'](_0x5c87db);}};}function respondWithFilteredResult(_0x1bf83d,_0x23fd37){return function(_0x1eeb00){if(_0x1eeb00){var _0x614c15=_0x1eeb00[_0x6d19('0x30')],_0x41b8f2=_0x23fd37[_0x6d19('0x31')],_0x2d147e=_0x23fd37[_0x6d19('0x31')]+_0x23fd37['limit'],_0x13d0bc;if(_0x2d147e>=_0x614c15){_0x2d147e=_0x614c15;_0x13d0bc=0xc8;}else{_0x13d0bc=0xce;}_0x1bf83d[_0x6d19('0x2f')](_0x13d0bc);return _0x1bf83d['set'](_0x6d19('0x32'),_0x41b8f2+'-'+_0x2d147e+'/'+_0x614c15)[_0x6d19('0x33')](_0x1eeb00);}return null;};}function patchUpdates(_0x470c90){return function(_0x3b97af){try{jsonpatch['apply'](_0x3b97af,_0x470c90,!![]);}catch(_0x18d45f){return BPromise[_0x6d19('0x34')](_0x18d45f);}return _0x3b97af[_0x6d19('0x35')]();};}function saveUpdates(_0x4eb17e,_0x3f7805){return function(_0x255233){if(_0x255233){return _0x255233[_0x6d19('0x36')](_0x4eb17e)['then'](function(_0x5f5c44){return _0x5f5c44;});}return null;};}function removeEntity(_0x366065,_0x2d8341){return function(_0x231266){if(_0x231266){return _0x231266['destroy']()['then'](function(){_0x366065[_0x6d19('0x2f')](0xcc)[_0x6d19('0x37')]();});}};}function handleEntityNotFound(_0x342af3,_0x4890af){return function(_0x414caa){if(!_0x414caa){_0x342af3['sendStatus'](0x194);}return _0x414caa;};}function handleError(_0x3ea96a,_0x4b2e53){_0x4b2e53=_0x4b2e53||0x1f4;return function(_0x3c5d82){logger[_0x6d19('0x29')](_0x3c5d82[_0x6d19('0x38')]);if(_0x3c5d82[_0x6d19('0x39')]){delete _0x3c5d82[_0x6d19('0x39')];}_0x3ea96a[_0x6d19('0x2f')](_0x4b2e53)[_0x6d19('0x3a')](_0x3c5d82);};}exports[_0x6d19('0x3b')]=function(_0x5effcd,_0x59230a){var _0xaaf162={},_0x43072d={},_0xf81b9e={'count':0x0,'rows':[]};var _0x3e6a9=db[_0x6d19('0x3c')]['rawAttributes'];_0x43072d[_0x6d19('0x3d')]=_['keys'](_0x3e6a9);_0x43072d['query']=_[_0x6d19('0x3e')](_0x5effcd[_0x6d19('0x3f')]);_0x43072d[_0x6d19('0x40')]=_[_0x6d19('0x41')](_0x43072d['model'],_0x43072d[_0x6d19('0x3f')]);_0xaaf162[_0x6d19('0x42')]=_[_0x6d19('0x41')](_0x43072d['model'],qs['fields'](_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x43')]));_0xaaf162[_0x6d19('0x42')]=_0xaaf162['attributes'][_0x6d19('0x44')]?_0xaaf162[_0x6d19('0x42')]:_0x43072d[_0x6d19('0x3d')];if(!_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x45')](_0x6d19('0x46'))){_0xaaf162['limit']=qs[_0x6d19('0x47')](_0x5effcd['query'][_0x6d19('0x47')]);_0xaaf162[_0x6d19('0x31')]=qs['offset'](_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x31')]);}_0xaaf162[_0x6d19('0x48')]=qs['sort'](_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x49')]);_0xaaf162['where']=qs['filters'](_[_0x6d19('0x4a')](_0x5effcd[_0x6d19('0x3f')],_0x43072d['filters']));if(_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x4b')]){_0xaaf162[_0x6d19('0x4c')]=_[_0x6d19('0x4d')](_0xaaf162[_0x6d19('0x4c')],{'$or':_[_0x6d19('0x4e')](_0x3e6a9,function(_0x3129b4){if(_0x3129b4[_0x6d19('0x4f')]['key']!==_0x6d19('0x50')){var _0xbdce22={};_0xbdce22[_0x3129b4[_0x6d19('0x51')]]={'$like':'%'+_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x4b')]+'%'};return _0xbdce22;}})});}_0xaaf162=_['merge']({},_0xaaf162,_0x5effcd[_0x6d19('0x52')]);var _0x5f4b3e={'where':_0xaaf162[_0x6d19('0x4c')]};return db['ChatGroup'][_0x6d19('0x30')](_0x5f4b3e)[_0x6d19('0x24')](function(_0x367955){_0xf81b9e[_0x6d19('0x30')]=_0x367955;if(_0x5effcd[_0x6d19('0x3f')][_0x6d19('0x53')]){_0xaaf162[_0x6d19('0x54')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0xaaf162);})[_0x6d19('0x24')](function(_0xa984f3){_0xf81b9e[_0x6d19('0x55')]=_0xa984f3;return _0xf81b9e;})[_0x6d19('0x24')](respondWithFilteredResult(_0x59230a,_0xaaf162))[_0x6d19('0x2d')](handleError(_0x59230a,null));};exports[_0x6d19('0x56')]=function(_0xdb4a48,_0x774ffd){var _0x477af4={'raw':!![],'where':{'id':_0xdb4a48[_0x6d19('0x57')]['id']}},_0x4d578c={};_0x4d578c[_0x6d19('0x3d')]=_[_0x6d19('0x3e')](db[_0x6d19('0x3c')][_0x6d19('0x58')]);_0x4d578c[_0x6d19('0x3f')]=_[_0x6d19('0x3e')](_0xdb4a48[_0x6d19('0x3f')]);_0x4d578c[_0x6d19('0x40')]=_['intersection'](_0x4d578c[_0x6d19('0x3d')],_0x4d578c[_0x6d19('0x3f')]);_0x477af4['attributes']=_[_0x6d19('0x41')](_0x4d578c[_0x6d19('0x3d')],qs[_0x6d19('0x43')](_0xdb4a48[_0x6d19('0x3f')][_0x6d19('0x43')]));_0x477af4['attributes']=_0x477af4['attributes'][_0x6d19('0x44')]?_0x477af4[_0x6d19('0x42')]:_0x4d578c[_0x6d19('0x3d')];if(_0xdb4a48[_0x6d19('0x3f')][_0x6d19('0x53')]){_0x477af4[_0x6d19('0x54')]=[{'all':!![]}];}_0x477af4=_[_0x6d19('0x4d')]({},_0x477af4,_0xdb4a48[_0x6d19('0x52')]);return db['ChatGroup'][_0x6d19('0x59')](_0x477af4)[_0x6d19('0x24')](handleEntityNotFound(_0x774ffd,null))['then'](respondWithResult(_0x774ffd,null))[_0x6d19('0x2d')](handleError(_0x774ffd,null));};exports[_0x6d19('0x5a')]=function(_0x4822a6,_0x3de428){return db[_0x6d19('0x3c')][_0x6d19('0x5a')](_0x4822a6[_0x6d19('0x5b')],{})[_0x6d19('0x24')](respondWithResult(_0x3de428,0xc9))[_0x6d19('0x2d')](handleError(_0x3de428,null));};exports[_0x6d19('0x36')]=function(_0x200f92,_0xb0a011){if(_0x200f92[_0x6d19('0x5b')]['id']){delete _0x200f92[_0x6d19('0x5b')]['id'];}return db[_0x6d19('0x3c')][_0x6d19('0x59')]({'where':{'id':_0x200f92[_0x6d19('0x57')]['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0xb0a011,null))['then'](saveUpdates(_0x200f92[_0x6d19('0x5b')],null))[_0x6d19('0x24')](respondWithResult(_0xb0a011,null))['catch'](handleError(_0xb0a011,null));};exports[_0x6d19('0x5c')]=function(_0x5c8eb8,_0x581c55){return db[_0x6d19('0x3c')][_0x6d19('0x59')]({'where':{'id':_0x5c8eb8['params']['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0x581c55,null))[_0x6d19('0x24')](removeEntity(_0x581c55,null))['catch'](handleError(_0x581c55,null));};exports[_0x6d19('0x5d')]=function(_0x19dcac,_0x38d6b0){return db[_0x6d19('0x3c')][_0x6d19('0x5d')]()[_0x6d19('0x24')](respondWithResult(_0x38d6b0,null))[_0x6d19('0x2d')](handleError(_0x38d6b0,null));};exports['getUnread']=function(_0x163ef9,_0x2cdd9c,_0x36c96d){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x163ef9[_0x6d19('0x57')]['id'],'ToId':_0x163ef9[_0x6d19('0x5e')]['id'],'read':![]}})[_0x6d19('0x24')](function(_0xd3717a){return{'id':_[_0x6d19('0x5f')](_0x163ef9[_0x6d19('0x57')]['id']),'count':_0xd3717a};})[_0x6d19('0x24')](respondWithResult(_0x2cdd9c,null))[_0x6d19('0x2d')](handleError(_0x2cdd9c,null));};exports[_0x6d19('0x60')]=function(_0x2fcef5,_0x34b435,_0x20a543){return db[_0x6d19('0x3c')][_0x6d19('0x59')]({'where':{'id':_0x2fcef5[_0x6d19('0x57')]['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0x34b435,null))[_0x6d19('0x24')](function(_0x4affdc){if(_0x4affdc){return _0x4affdc[_0x6d19('0x60')](_0x2fcef5[_0x6d19('0x5b')][_0x6d19('0x61')],_[_0x6d19('0x62')](_0x2fcef5['body'],[_0x6d19('0x61'),'id'])||{});}})['then'](respondWithResult(_0x34b435,null))[_0x6d19('0x2d')](handleError(_0x34b435,null));};exports[_0x6d19('0x63')]=function(_0x52a59c,_0x3b575c,_0x2d28a8){var _0x4d95ce={};var _0x3f57d0={};var _0x4a1988;var _0x1eaa43;return db[_0x6d19('0x3c')][_0x6d19('0x64')]({'where':{'id':_0x52a59c[_0x6d19('0x57')]['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0x3b575c,null))[_0x6d19('0x24')](function(_0x46bedc){if(_0x46bedc){_0x4a1988=_0x46bedc;_0x3f57d0[_0x6d19('0x3d')]=_[_0x6d19('0x3e')](db[_0x6d19('0x65')]['rawAttributes']);_0x3f57d0[_0x6d19('0x3f')]=_[_0x6d19('0x3e')](_0x52a59c['query']);_0x3f57d0[_0x6d19('0x40')]=_[_0x6d19('0x41')](_0x3f57d0[_0x6d19('0x3d')],_0x3f57d0[_0x6d19('0x3f')]);_0x4d95ce[_0x6d19('0x42')]=_[_0x6d19('0x41')](_0x3f57d0[_0x6d19('0x3d')],qs['fields'](_0x52a59c['query'][_0x6d19('0x43')]));_0x4d95ce['attributes']=_0x4d95ce[_0x6d19('0x42')][_0x6d19('0x44')]?_0x4d95ce['attributes']:_0x3f57d0[_0x6d19('0x3d')];_0x4d95ce[_0x6d19('0x48')]=qs[_0x6d19('0x49')](_0x52a59c[_0x6d19('0x3f')][_0x6d19('0x49')]);_0x4d95ce[_0x6d19('0x4c')]=qs['filters'](_[_0x6d19('0x4a')](_0x52a59c[_0x6d19('0x3f')],_0x3f57d0[_0x6d19('0x40')]));if(_0x52a59c['query']['filter']){_0x4d95ce[_0x6d19('0x4c')]=_[_0x6d19('0x4d')](_0x4d95ce[_0x6d19('0x4c')],{'$or':_['map'](_0x4d95ce[_0x6d19('0x42')],function(_0x106978){var _0x53a5cc={};_0x53a5cc[_0x106978]={'$like':'%'+_0x52a59c[_0x6d19('0x3f')]['filter']+'%'};return _0x53a5cc;})});}_0x4d95ce=_[_0x6d19('0x4d')]({},_0x4d95ce,_0x52a59c['options']);return _0x4a1988[_0x6d19('0x63')](_0x4d95ce);}})['then'](function(_0x3224dc){if(_0x3224dc){_0x1eaa43=_0x3224dc[_0x6d19('0x44')];if(!_0x52a59c['query'][_0x6d19('0x45')](_0x6d19('0x46'))){_0x4d95ce[_0x6d19('0x47')]=qs[_0x6d19('0x47')](_0x52a59c[_0x6d19('0x3f')][_0x6d19('0x47')]);_0x4d95ce[_0x6d19('0x31')]=qs['offset'](_0x52a59c[_0x6d19('0x3f')][_0x6d19('0x31')]);}return _0x4a1988['getMembers'](_0x4d95ce);}})['then'](function(_0x58cfcc){if(_0x58cfcc){return _0x58cfcc?{'count':_0x1eaa43,'rows':_0x58cfcc}:null;}})['then'](respondWithResult(_0x3b575c,null))[_0x6d19('0x2d')](handleError(_0x3b575c,null));};exports[_0x6d19('0x66')]=function(_0x3f3453,_0x27c904,_0x2958ca){return db[_0x6d19('0x3c')][_0x6d19('0x59')]({'where':{'id':_0x3f3453['params']['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0x27c904,null))['then'](function(_0x9fafad){if(_0x9fafad){return _0x9fafad[_0x6d19('0x66')](_0x3f3453['query']['ids']);}})['then'](respondWithStatusCode(_0x27c904,null))[_0x6d19('0x2d')](handleError(_0x27c904,null));};exports['addMessage']=function(_0x284756,_0x1754dd,_0x33c790){if(_0x284756[_0x6d19('0x5b')]['id']){delete _0x284756['body']['id'];}return db['ChatGroup'][_0x6d19('0x59')]({'where':{'id':_0x284756[_0x6d19('0x57')]['id']}})['then'](handleEntityNotFound(_0x1754dd,null))[_0x6d19('0x24')](function(_0x277972){if(_0x277972){_0x284756['body'][_0x6d19('0x67')]=_0x277972['id'];return db[_0x6d19('0x68')][_0x6d19('0x5a')](_0x284756['body']);}})[_0x6d19('0x24')](respondWithResult(_0x1754dd,null))[_0x6d19('0x2d')](handleError(_0x1754dd,null));};exports['getMessages']=function(_0x5b37e9,_0x543db,_0x5ecc95){var _0x1cc985={};var _0x31c039={};var _0x1d0c6d;var _0x4865c9;return db[_0x6d19('0x3c')][_0x6d19('0x64')]({'where':{'id':_0x5b37e9[_0x6d19('0x57')]['id']}})[_0x6d19('0x24')](handleEntityNotFound(_0x543db,null))[_0x6d19('0x24')](function(_0x3d7b5a){if(_0x3d7b5a){_0x1d0c6d=_0x3d7b5a;_0x31c039[_0x6d19('0x3d')]=_['keys'](db[_0x6d19('0x68')][_0x6d19('0x58')]);_0x31c039[_0x6d19('0x3f')]=_[_0x6d19('0x3e')](_0x5b37e9[_0x6d19('0x3f')]);_0x31c039[_0x6d19('0x40')]=_['intersection'](_0x31c039['model'],_0x31c039[_0x6d19('0x3f')]);_0x1cc985[_0x6d19('0x42')]=_[_0x6d19('0x41')](_0x31c039['model'],qs['fields'](_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x43')]));_0x1cc985[_0x6d19('0x42')]=_0x1cc985[_0x6d19('0x42')][_0x6d19('0x44')]?_0x1cc985['attributes']:_0x31c039[_0x6d19('0x3d')];_0x1cc985[_0x6d19('0x48')]=qs[_0x6d19('0x49')](_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x49')]);_0x1cc985[_0x6d19('0x4c')]=qs['filters'](_[_0x6d19('0x4a')](_0x5b37e9[_0x6d19('0x3f')],_0x31c039[_0x6d19('0x40')]));if(_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x4b')]){_0x1cc985[_0x6d19('0x4c')]=_[_0x6d19('0x4d')](_0x1cc985[_0x6d19('0x4c')],{'$or':_[_0x6d19('0x4e')](_0x1cc985['attributes'],function(_0x615909){var _0x1e263d={};_0x1e263d[_0x615909]={'$like':'%'+_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x4b')]+'%'};return _0x1e263d;})});}if(_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x69')]){var _0x1ec0e5=_0x5b37e9[_0x6d19('0x3f')]['$gte'][_0x6d19('0x6a')](',');var _0x572f0f={};_0x572f0f[_0x1ec0e5[0x0]]={'$gte':moment(_0x1ec0e5[0x1])[_0x6d19('0x6b')](_0x6d19('0x6c'))};_0x1cc985['where']=_[_0x6d19('0x4d')](_0x1cc985[_0x6d19('0x4c')],_0x572f0f);}_0x1cc985=_[_0x6d19('0x4d')]({},_0x1cc985,_0x5b37e9[_0x6d19('0x52')]);return _0x1d0c6d[_0x6d19('0x6d')](_0x1cc985);}})[_0x6d19('0x24')](function(_0x48c9da){if(_0x48c9da){_0x4865c9=_0x48c9da['length'];if(!_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x45')](_0x6d19('0x46'))){_0x1cc985['limit']=qs[_0x6d19('0x47')](_0x5b37e9['query'][_0x6d19('0x47')]);_0x1cc985['offset']=qs['offset'](_0x5b37e9[_0x6d19('0x3f')][_0x6d19('0x31')]);}return _0x1d0c6d['getMessages'](_0x1cc985);}})[_0x6d19('0x24')](function(_0xa04c60){if(_0xa04c60){return _0xa04c60?{'count':_0x4865c9,'rows':_0xa04c60}:null;}})[_0x6d19('0x24')](respondWithResult(_0x543db,null))['catch'](handleError(_0x543db,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b6f9cc1..ec8958a 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 _0x840a=['../../mysqldb','ChatGroup','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0xca91ed,_0x10836c){var _0x5e7e6b=function(_0x43222d){while(--_0x43222d){_0xca91ed['push'](_0xca91ed['shift']());}};_0x5e7e6b(++_0x10836c);}(_0x840a,0x98));var _0xa840=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x840a[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xa840('0x0'));var ChatGroup=require(_0xa840('0x1'))['db'][_0xa840('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa840('0x3')](0x0);var events={'afterCreate':_0xa840('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49ddb5){return function(_0x2836ea,_0x105a03,_0x214fa1){ChatGroupEvents[_0xa840('0x5')](_0x49ddb5+':'+_0x2836ea['id'],_0x2836ea);ChatGroupEvents['emit'](_0x49ddb5,_0x2836ea);_0x214fa1(null);};}for(var e in events){if(events[_0xa840('0x6')](e)){var event=events[e];ChatGroup[_0xa840('0x7')](e,emitEvent(event));}}module[_0xa840('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x1f65=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x3f8e5e,_0x45dd58){var _0x1214cb=function(_0x518f8a){while(--_0x518f8a){_0x3f8e5e['push'](_0x3f8e5e['shift']());}};_0x1214cb(++_0x45dd58);}(_0x1f65,0xd4));var _0x51f6=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0x1f65[_0x2d0d9f];return _0x30243d;};'use strict';var EventEmitter=require(_0x51f6('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x51f6('0x1')](0x0);var events={'afterCreate':_0x51f6('0x2'),'afterUpdate':_0x51f6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2c659c){return function(_0x189ce4,_0xb20b67,_0x2674f0){ChatGroupEvents['emit'](_0x2c659c+':'+_0x189ce4['id'],_0x189ce4);ChatGroupEvents[_0x51f6('0x4')](_0x2c659c,_0x189ce4);_0x2674f0(null);};}for(var e in events){if(events[_0x51f6('0x5')](e)){var event=events[e];ChatGroup[_0x51f6('0x6')](e,emitEvent(event));}}module[_0x51f6('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 77da300..7aace02 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 _0xb39c=['path','rimraf','chat_groups','lodash','../../config/logger','api','moment'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xb39c,0x161));var _0xcb39=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb39c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xcb39('0x0'));var util=require('util');var logger=require(_0xcb39('0x1'))(_0xcb39('0x2'));var moment=require(_0xcb39('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb39('0x4'));var rimraf=require(_0xcb39('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x24f133,_0x5c9c73){return _0x24f133['define']('ChatGroup',attributes,{'tableName':_0xcb39('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccbb=['define','chat_groups','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xccbb,0x183));var _0xbccb=function(_0x46a2a5,_0x352566){_0x46a2a5=_0x46a2a5-0x0;var _0x563554=_0xccbb[_0x46a2a5];return _0x563554;};'use strict';var _=require(_0xbccb('0x0'));var util=require(_0xbccb('0x1'));var logger=require(_0xbccb('0x2'))('api');var moment=require(_0xbccb('0x3'));var BPromise=require(_0xbccb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbccb('0x5'));var config=require(_0xbccb('0x6'));var attributes=require(_0xbccb('0x7'));module[_0xbccb('0x8')]=function(_0x1e981c,_0x37fe23){return _0x1e981c[_0xbccb('0x9')]('ChatGroup',attributes,{'tableName':_0xbccb('0xa'),'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 433f353..e4c6c2c 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 _0xe107=['rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatGroup.socket','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x17355e,_0x25c87f){var _0xfd03d=function(_0x5f338d){while(--_0x5f338d){_0x17355e['push'](_0x17355e['shift']());}};_0xfd03d(++_0x25c87f);}(_0xe107,0xb3));var _0x7e10=function(_0x2026de,_0x26da76){_0x2026de=_0x2026de-0x0;var _0x2547a6=_0xe107[_0x2026de];return _0x2547a6;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7e10('0x8')]=_[_0x7e10('0x9')](config[_0x7e10('0x8')],{'host':_0x7e10('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e10('0xb'))['register'](socket);function respondWithRpcPromise(_0x4e6825,_0x82e6f3,_0x303f73){return new BPromise(function(_0x2b2850,_0x2bd58a){return client[_0x7e10('0xc')](_0x4e6825,_0x303f73)['then'](function(_0x3576c2){logger['info'](_0x7e10('0xd'),_0x82e6f3,_0x7e10('0xe'));logger[_0x7e10('0xf')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x82e6f3,_0x7e10('0xe'),JSON[_0x7e10('0x10')](_0x3576c2));if(_0x3576c2[_0x7e10('0x11')]){if(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x12')]===0x1f4){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2bd58a(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2b2850(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}else{logger[_0x7e10('0x14')](_0x7e10('0xd'),_0x82e6f3,'request\x20sent');_0x2b2850(_0x3576c2[_0x7e10('0x15')][_0x7e10('0x13')]);}})[_0x7e10('0x16')](function(_0x5d9da3){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x5d9da3);_0x2bd58a(_0x5d9da3);});});} \ No newline at end of file +var _0xcb99=['rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','info','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x47b608,_0x4d3482){var _0x4d75ab=function(_0x2ba846){while(--_0x2ba846){_0x47b608['push'](_0x47b608['shift']());}};_0x4d75ab(++_0x4d3482);}(_0xcb99,0x8b));var _0x9cb9=function(_0x5f13cd,_0x3daaf8){_0x5f13cd=_0x5f13cd-0x0;var _0x827cb7=_0xcb99[_0x5f13cd];return _0x827cb7;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});config[_0x9cb9('0x8')]=_[_0x9cb9('0x9')](config[_0x9cb9('0x8')],{'host':_0x9cb9('0xa'),'port':0x18eb});var socket=require(_0x9cb9('0xb'))(new Redis(config[_0x9cb9('0x8')]));require(_0x9cb9('0xc'))[_0x9cb9('0xd')](socket);function respondWithRpcPromise(_0x48d99a,_0x5264c9,_0xe6d275){return new BPromise(function(_0x392f93,_0x1b4fa6){return client['request'](_0x48d99a,_0xe6d275)[_0x9cb9('0xe')](function(_0x3d38f1){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5264c9,_0x9cb9('0xf'));logger[_0x9cb9('0x10')](_0x9cb9('0x11'),_0x5264c9,_0x9cb9('0xf'),JSON['stringify'](_0x3d38f1));if(_0x3d38f1[_0x9cb9('0x12')]){if(_0x3d38f1[_0x9cb9('0x12')][_0x9cb9('0x13')]===0x1f4){logger[_0x9cb9('0x12')](_0x9cb9('0x14'),_0x5264c9,_0x3d38f1[_0x9cb9('0x12')][_0x9cb9('0x15')]);return _0x1b4fa6(_0x3d38f1[_0x9cb9('0x12')][_0x9cb9('0x15')]);}logger[_0x9cb9('0x12')](_0x9cb9('0x14'),_0x5264c9,_0x3d38f1[_0x9cb9('0x12')][_0x9cb9('0x15')]);return _0x392f93(_0x3d38f1[_0x9cb9('0x12')][_0x9cb9('0x15')]);}else{logger[_0x9cb9('0x16')](_0x9cb9('0x14'),_0x5264c9,_0x9cb9('0xf'));_0x392f93(_0x3d38f1['result']['message']);}})[_0x9cb9('0x17')](function(_0x50169f){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5264c9,_0x50169f);_0x1b4fa6(_0x50169f);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index e61a7ac..77bc82b 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 _0x6d2e=['chatGroup:','save','remove','update','register','length'];(function(_0x126bb1,_0x2a7974){var _0x17d2d2=function(_0x410149){while(--_0x410149){_0x126bb1['push'](_0x126bb1['shift']());}};_0x17d2d2(++_0x2a7974);}(_0x6d2e,0x97));var _0xe6d2=function(_0x5f51d2,_0x4f0133){_0x5f51d2=_0x5f51d2-0x0;var _0x24bf08=_0x6d2e[_0x5f51d2];return _0x24bf08;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xe6d2('0x0'),_0xe6d2('0x1'),_0xe6d2('0x2')];function createListener(_0x3ff4b6,_0x412889){return function(_0xf81df7){_0x412889['emit'](_0x3ff4b6,_0xf81df7);};}function removeListener(_0x2dee74,_0x5dc6e4){return function(){ChatGroupEvents['removeListener'](_0x2dee74,_0x5dc6e4);};}exports[_0xe6d2('0x3')]=function(_0x2b4bf0){for(var _0x3c0fab=0x0,_0x4d9c9f=events[_0xe6d2('0x4')];_0x3c0fab<_0x4d9c9f;_0x3c0fab++){var _0x53906e=events[_0x3c0fab];var _0x2e227e=createListener(_0xe6d2('0x5')+_0x53906e,_0x2b4bf0);ChatGroupEvents['on'](_0x53906e,_0x2e227e);}}; \ No newline at end of file +var _0x6732=['./chatGroup.events','save','remove','update','length','chatGroup:'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x2673('0x0'));var events=[_0x2673('0x1'),_0x2673('0x2'),_0x2673('0x3')];function createListener(_0x56629a,_0x3b698e){return function(_0x36e1ba){_0x3b698e['emit'](_0x56629a,_0x36e1ba);};}function removeListener(_0xfef746,_0x3ac2c4){return function(){ChatGroupEvents['removeListener'](_0xfef746,_0x3ac2c4);};}exports['register']=function(_0x90d6e5){for(var _0x2ec408=0x0,_0x513795=events[_0x2673('0x4')];_0x2ec408<_0x513795;_0x2ec408++){var _0x5fe50=events[_0x2ec408];var _0xc1ed83=createListener(_0x2673('0x5')+_0x5fe50,_0x90d6e5);ChatGroupEvents['on'](_0x5fe50,_0xc1ed83);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5c42547..9c65a63 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 _0x62a0=['show','/:id/unread','getUnread','getMembers','getMessages','post','/:id/members','addMembers','addMessage','put','delete','removeMembers','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x4b6a8b,_0x3d07ad){var _0x3661fc=function(_0x493369){while(--_0x493369){_0x4b6a8b['push'](_0x4b6a8b['shift']());}};_0x3661fc(++_0x3d07ad);}(_0x62a0,0x18d));var _0x062a=function(_0x4e6d56,_0x3a7f7b){_0x4e6d56=_0x4e6d56-0x0;var _0x415041=_0x62a0[_0x4e6d56];return _0x415041;};'use strict';var multer=require(_0x062a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x062a('0x1'));var express=require(_0x062a('0x2'));var router=express['Router']();var auth=require(_0x062a('0x3'));var interaction=require(_0x062a('0x4'));var config=require('../../config/environment');var controller=require(_0x062a('0x5'));router['get']('/',auth[_0x062a('0x6')](),controller[_0x062a('0x7')]);router[_0x062a('0x8')]('/describe',auth[_0x062a('0x6')](),controller[_0x062a('0x9')]);router[_0x062a('0x8')](_0x062a('0xa'),auth['isAuthenticated'](),controller[_0x062a('0xb')]);router[_0x062a('0x8')](_0x062a('0xc'),auth[_0x062a('0x6')](),controller[_0x062a('0xd')]);router[_0x062a('0x8')]('/:id/members',auth[_0x062a('0x6')](),controller[_0x062a('0xe')]);router[_0x062a('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x062a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x062a('0x10')](_0x062a('0x11'),auth[_0x062a('0x6')](),controller[_0x062a('0x12')]);router[_0x062a('0x10')]('/:id/messages',auth[_0x062a('0x6')](),controller[_0x062a('0x13')]);router[_0x062a('0x14')](_0x062a('0xa'),auth[_0x062a('0x6')](),controller['update']);router[_0x062a('0x15')](_0x062a('0xa'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x062a('0x11'),auth['isAuthenticated'](),controller[_0x062a('0x16')]);module[_0x062a('0x17')]=router; \ No newline at end of file +var _0x7b15=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router'];(function(_0xd45aa5,_0x35dcd4){var _0x388c83=function(_0x2ceb0f){while(--_0x2ceb0f){_0xd45aa5['push'](_0xd45aa5['shift']());}};_0x388c83(++_0x35dcd4);}(_0x7b15,0x10a));var _0x57b1=function(_0x9342a5,_0x1ff33f){_0x9342a5=_0x9342a5-0x0;var _0x2acc1f=_0x7b15[_0x9342a5];return _0x2acc1f;};'use strict';var multer=require(_0x57b1('0x0'));var util=require('util');var path=require(_0x57b1('0x1'));var timeout=require(_0x57b1('0x2'));var express=require('express');var router=express[_0x57b1('0x3')]();var auth=require(_0x57b1('0x4'));var interaction=require(_0x57b1('0x5'));var config=require(_0x57b1('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x57b1('0x7')](),controller['index']);router['get'](_0x57b1('0x8'),auth['isAuthenticated'](),controller[_0x57b1('0x9')]);router[_0x57b1('0xa')]('/:id',auth[_0x57b1('0x7')](),controller[_0x57b1('0xb')]);router['get'](_0x57b1('0xc'),auth[_0x57b1('0x7')](),controller['getUnread']);router['get'](_0x57b1('0xd'),auth[_0x57b1('0x7')](),controller[_0x57b1('0xe')]);router[_0x57b1('0xa')](_0x57b1('0xf'),auth[_0x57b1('0x7')](),controller[_0x57b1('0x10')]);router[_0x57b1('0x11')]('/',auth[_0x57b1('0x7')](),controller[_0x57b1('0x12')]);router[_0x57b1('0x11')](_0x57b1('0xd'),auth[_0x57b1('0x7')](),controller[_0x57b1('0x13')]);router[_0x57b1('0x11')](_0x57b1('0xf'),auth[_0x57b1('0x7')](),controller[_0x57b1('0x14')]);router['put'](_0x57b1('0x15'),auth['isAuthenticated'](),controller[_0x57b1('0x16')]);router[_0x57b1('0x17')](_0x57b1('0x15'),auth[_0x57b1('0x7')](),controller[_0x57b1('0x18')]);router[_0x57b1('0x17')](_0x57b1('0xd'),auth['isAuthenticated'](),controller[_0x57b1('0x19')]);module[_0x57b1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4de6744..d06e0b4 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 _0x1be1=['thumb','TEXT','STRING','DATE','ENUM','out','BOOLEAN','INTEGER','star'];(function(_0x3c8cfb,_0x26995a){var _0x5767ea=function(_0x4aaee6){while(--_0x4aaee6){_0x3c8cfb['push'](_0x3c8cfb['shift']());}};_0x5767ea(++_0x26995a);}(_0x1be1,0x192));var _0x11be=function(_0x28da1a,_0xcb2f2){_0x28da1a=_0x28da1a-0x0;var _0x3e7bdf=_0x1be1[_0x28da1a];return _0x3e7bdf;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x11be('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x11be('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x2')},'ratingMessage':{'type':Sequelize[_0x11be('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x11be('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x11be('0x6')]},'disposition':{'type':Sequelize[_0x11be('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x11be('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x11be('0x5')]},'osVersion':{'type':Sequelize[_0x11be('0x5')]},'deviceModel':{'type':Sequelize[_0x11be('0x5')]},'deviceVendor':{'type':Sequelize[_0x11be('0x5')]},'deviceType':{'type':Sequelize[_0x11be('0x5')]},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0x11be('0x5')]},'formData':{'type':Sequelize[_0x11be('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x11be('0x6')]},'lastMsgAt':{'type':Sequelize[_0x11be('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x11be('0x7')]('in',_0x11be('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9348=['star','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb'];(function(_0x2ba95c,_0x4c7bcb){var _0x2d4cb3=function(_0x342cf5){while(--_0x342cf5){_0x2ba95c['push'](_0x2ba95c['shift']());}};_0x2d4cb3(++_0x4c7bcb);}(_0x9348,0x10d));var _0x8934=function(_0x41ee82,_0x4b5cf1){_0x41ee82=_0x41ee82-0x0;var _0x1560af=_0x9348[_0x41ee82];return _0x1560af;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'closed':{'type':Sequelize[_0x8934('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8934('0x3')]},'ratingType':{'type':Sequelize[_0x8934('0x4')]('star',_0x8934('0x5')),'defaultValue':_0x8934('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x8934('0x7')]},'mailTranscript':{'type':Sequelize[_0x8934('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8934('0x9')]},'disposition':{'type':Sequelize[_0x8934('0x8')]},'note':{'type':Sequelize[_0x8934('0x8')]},'browserName':{'type':Sequelize[_0x8934('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8934('0x8')]},'osVersion':{'type':Sequelize[_0x8934('0x8')]},'deviceModel':{'type':Sequelize[_0x8934('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8934('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x8934('0x9')]},'lastMsgAt':{'type':Sequelize[_0x8934('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x8934('0x4')]('in',_0x8934('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8934('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ceeaed1..ccd40e6 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 _0xaec0=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','count','offset','limit','status','set','Content-Range','json','save','update','stack','name','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','select','field','color','tools_tags','from','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','parse','advancedFilter','forEach','createdAt','value','utc','format','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','LIKE','c.firstName','\x20<\x20?','map','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','read','%s\x20=\x200','having','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','`Messages.count`\x20=\x200','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','Users','Tags','rows','show','params','rawAttributes','includeAll','include','options','find','create','ChatInteraction','body','destroy','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','type','mimetype','Attachment','findOne','attachId','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','ChatMessage','Messages','User','ChatWebsite','CmContact','%s%d','customer','Visitor','agentIdentifier','System','agent_alias','fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','alias','addTags','Tag','emit','chatInteractionTags:save','removeTags','download','unix','server','files','tmp','transcript-%d-%s.zip','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','pipe','createWriteStream','out','Contact','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x31c5d4,_0x2dead5){var _0x25c02e=function(_0x491b87){while(--_0x491b87){_0x31c5d4['push'](_0x31c5d4['shift']());}};_0x25c02e(++_0x2dead5);}(_0xaec0,0x100));var _0x0aec=function(_0x581f5e,_0x529699){_0x581f5e=_0x581f5e-0x0;var _0x1acdf2=_0xaec0[_0x581f5e];return _0x1acdf2;};'use strict';var pdf=require(_0x0aec('0x0'));var emlformat=require(_0x0aec('0x1'));var rimraf=require(_0x0aec('0x2'));var zipdir=require(_0x0aec('0x3'));var jsonpatch=require(_0x0aec('0x4'));var rp=require(_0x0aec('0x5'));var moment=require(_0x0aec('0x6'));var BPromise=require(_0x0aec('0x7'));var Mustache=require(_0x0aec('0x8'));var util=require(_0x0aec('0x9'));var path=require('path');var sox=require(_0x0aec('0xa'));var csv=require(_0x0aec('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0aec('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0aec('0xd'));var toCsv=require(_0x0aec('0xb'));var querystring=require(_0x0aec('0xe'));var Papa=require(_0x0aec('0xf'));var Redis=require(_0x0aec('0x10'));var authService=require(_0x0aec('0x11'));var qs=require(_0x0aec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0aec('0x13'))(_0x0aec('0x14'));var utils=require(_0x0aec('0x15'));var config=require(_0x0aec('0x16'));var db=require(_0x0aec('0x17'))['db'];config[_0x0aec('0x18')]=_[_0x0aec('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0aec('0x1a'))(new Redis(config[_0x0aec('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x0aec('0x1b'));var client=jayson[_0x0aec('0x1c')][_0x0aec('0x1d')]({'port':0x232b});var client9004=jayson['client'][_0x0aec('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x10746d,_0x205cac,_0x397e1c){if(_0x397e1c){var _0x3f0021=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f0021[_0x0aec('0x1e')](_0x205cac)){return _0x10746d;}else{throw new Error(_0x0aec('0x1f'));}}else{return _0x10746d;}}function respondWithRpcPromise(_0x2d8265,_0x4eed53,_0x49c89d,_0x42096e){return new BPromise(function(_0x55157e,_0x8a0050){var _0x3232fe=_0x42096e||client;return _0x3232fe['request'](_0x2d8265,_0x49c89d)[_0x0aec('0x20')](function(_0x280d26){logger['info'](_0x0aec('0x21'),_0x4eed53,_0x0aec('0x22'));logger[_0x0aec('0x23')](_0x0aec('0x24'),_0x4eed53,'request\x20sent',JSON[_0x0aec('0x25')](_0x280d26));if(_0x280d26[_0x0aec('0x26')]){if(_0x280d26[_0x0aec('0x26')][_0x0aec('0x27')]===0x1f4){logger[_0x0aec('0x26')](_0x0aec('0x21'),_0x4eed53,_0x280d26[_0x0aec('0x26')][_0x0aec('0x28')]);return _0x8a0050(_0x280d26['error']['message']);}logger['error'](_0x0aec('0x21'),_0x4eed53,_0x280d26[_0x0aec('0x26')]['message']);return _0x55157e(_0x280d26[_0x0aec('0x26')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4eed53,_0x0aec('0x22'));_0x55157e(_0x280d26[_0x0aec('0x29')][_0x0aec('0x28')]);}})[_0x0aec('0x2a')](function(_0x233053){logger[_0x0aec('0x26')](_0x0aec('0x21'),_0x4eed53,_0x233053);_0x8a0050(_0x233053);});});}function respondWithStatusCode(_0xdc4c58,_0x52160a){_0x52160a=_0x52160a||0xcc;return function(_0x43ee5a){if(_0x43ee5a){return _0xdc4c58[_0x0aec('0x2b')](_0x52160a);}return _0xdc4c58['status'](_0x52160a)[_0x0aec('0x2c')]();};}function respondWithResult(_0x2d1756,_0x6c0491){_0x6c0491=_0x6c0491||0xc8;return function(_0x2d8e81){if(_0x2d8e81){return _0x2d1756['status'](_0x6c0491)['json'](_0x2d8e81);}};}function respondWithFilteredResult(_0x4e1238,_0x277d0a){return function(_0xe3e919){if(_0xe3e919){var _0x46ac7b=_0xe3e919[_0x0aec('0x2d')],_0x142c10=_0x277d0a[_0x0aec('0x2e')],_0x398c50=_0x277d0a['offset']+_0x277d0a[_0x0aec('0x2f')],_0x10793b;if(_0x398c50>=_0x46ac7b){_0x398c50=_0x46ac7b;_0x10793b=0xc8;}else{_0x10793b=0xce;}_0x4e1238[_0x0aec('0x30')](_0x10793b);return _0x4e1238[_0x0aec('0x31')](_0x0aec('0x32'),_0x142c10+'-'+_0x398c50+'/'+_0x46ac7b)[_0x0aec('0x33')](_0xe3e919);}return null;};}function patchUpdates(_0x286709){return function(_0x45762b){try{jsonpatch['apply'](_0x45762b,_0x286709,!![]);}catch(_0x3187d4){return BPromise['reject'](_0x3187d4);}return _0x45762b[_0x0aec('0x34')]();};}function saveUpdates(_0x3dcbaf,_0x27cc4a){return function(_0x4aa6c0){if(_0x4aa6c0){return _0x4aa6c0[_0x0aec('0x35')](_0x3dcbaf)[_0x0aec('0x20')](function(_0x24cd1e){return _0x24cd1e;});}return null;};}function removeEntity(_0x1d2dac,_0x49a693){return function(_0x367d45){if(_0x367d45){return _0x367d45['destroy']()['then'](function(){_0x1d2dac['status'](0xcc)[_0x0aec('0x2c')]();});}};}function handleEntityNotFound(_0x573c1c,_0x3a7f05){return function(_0x3ced81){if(!_0x3ced81){_0x573c1c[_0x0aec('0x2b')](0x194);}return _0x3ced81;};}function handleError(_0x44e3be,_0x4f864f){_0x4f864f=_0x4f864f||0x1f4;return function(_0x28f1cc){logger[_0x0aec('0x26')](_0x28f1cc[_0x0aec('0x36')]);if(_0x28f1cc['name']){delete _0x28f1cc[_0x0aec('0x37')];}_0x44e3be[_0x0aec('0x30')](_0x4f864f)['send'](_0x28f1cc);};}exports[_0x0aec('0x38')]=function(_0x40a418,_0x4505a2){var _0x270fe0={},_0x9b918a={},_0x411f36={'count':0x0,'rows':[]};var _0x107d70=db['ChatInteraction']['rawAttributes'];_0x9b918a[_0x0aec('0x39')]=_[_0x0aec('0x3a')](_0x107d70);_0x9b918a[_0x0aec('0x3b')]=_[_0x0aec('0x3a')](_0x40a418[_0x0aec('0x3b')]);_0x9b918a[_0x0aec('0x3c')]=_[_0x0aec('0x3d')](_0x9b918a[_0x0aec('0x39')],_0x9b918a[_0x0aec('0x3b')]);_0x270fe0['attributes']=_[_0x0aec('0x3d')](_0x9b918a['model'],qs[_0x0aec('0x3e')](_0x40a418[_0x0aec('0x3b')]['fields']));_0x270fe0[_0x0aec('0x3f')]=_0x270fe0['attributes'][_0x0aec('0x40')]?_0x270fe0[_0x0aec('0x3f')]:_0x9b918a[_0x0aec('0x39')];if(!_0x40a418[_0x0aec('0x3b')][_0x0aec('0x41')](_0x0aec('0x42'))){_0x270fe0[_0x0aec('0x2f')]=qs[_0x0aec('0x2f')](_0x40a418['query'][_0x0aec('0x2f')]);_0x270fe0['offset']=qs[_0x0aec('0x2e')](_0x40a418[_0x0aec('0x3b')]['offset']);}_0x270fe0['order']=qs[_0x0aec('0x43')](_0x40a418['query']['sort']);_0x270fe0[_0x0aec('0x44')]=qs[_0x0aec('0x3c')](_['pick'](_0x40a418[_0x0aec('0x3b')],_0x9b918a[_0x0aec('0x3c')]));var _0xe3efba=[];var _0xf6fd75=squel[_0x0aec('0x45')]()['field']('id')[_0x0aec('0x46')](_0x0aec('0x37'))[_0x0aec('0x46')](_0x0aec('0x47'))['from'](_0x0aec('0x48'));var _0x5882fc=squel[_0x0aec('0x45')]()['field']('COUNT(*)')[_0x0aec('0x49')](_0x0aec('0x4a'),'me')[_0x0aec('0x44')](_0x0aec('0x4b'))[_0x0aec('0x44')](_0x0aec('0x4c'))['where'](_0x0aec('0x4d'));var _0x369c5a=squel[_0x0aec('0x45')]()[_0x0aec('0x46')](_0x0aec('0x4e'))[_0x0aec('0x46')](_0x0aec('0x4f'))[_0x0aec('0x49')](_0x0aec('0x50'),'ui')[_0x0aec('0x51')](_0x0aec('0x52'),'u',_0x0aec('0x53'));var _0x482db0=squel['select']()[_0x0aec('0x49')]('chat_interactions','i')['left_join']('user_has_chat_interactions','ui','ui.UserId\x20=\x20i.UserId')[_0x0aec('0x51')](_0x0aec('0x52'),'u','u.id\x20=\x20ui.UserId')[_0x0aec('0x51')](_0x0aec('0x54'),'c',_0x0aec('0x55'))[_0x0aec('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x0aec('0x51')]('chat_websites','a',_0x0aec('0x56'))['left_join'](_0x0aec('0x4a'),'me',_0x0aec('0x4b'));var _0x23a1a5=squel['expr']();if(_0x40a418[_0x0aec('0x3b')]['advancedFilter']){var _0x5f155f=JSON[_0x0aec('0x57')](_0x40a418[_0x0aec('0x3b')][_0x0aec('0x58')]);_[_0x0aec('0x3a')](_0x5f155f)[_0x0aec('0x59')](function(_0x456f81){var _0x2566b4=_0x5f155f[_0x456f81];if(_0x456f81===_0x0aec('0x5a')){var _0x5094b8=moment(_0x2566b4[_0x0aec('0x5b')]['dateStart'])['startOf']('day')[_0x0aec('0x5c')]()[_0x0aec('0x5d')]();var _0x12c4f8=moment(_0x12c4f8)[_0x0aec('0x5c')]()[_0x0aec('0x5e')](_0x0aec('0x5f'))[_0x0aec('0x5d')]();_0x23a1a5[_0x0aec('0x60')](_0x0aec('0x61'),_0x5094b8,_0x12c4f8);}else{if(_[_0x0aec('0x62')](_0x2566b4[_0x0aec('0x63')])){_0x2566b4['condition']['forEach'](function(_0x1b0419){switch(_0x2566b4[_0x0aec('0x63')][_0x0aec('0x5b')]){case'IS':if(_0x456f81!==_0x0aec('0x64')&&_0x456f81!==_0x0aec('0x65')){if(_['isArray'](_0x2566b4['value'])&&_0x2566b4[_0x0aec('0x5b')]['length']>0x1){_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x67'),_0x2566b4[_0x0aec('0x5b')]);}else{_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x68'),_0x2566b4['value'][0x0]);}}break;case'=':_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x68'),_0x2566b4[_0x0aec('0x5b')]);break;case'LIKE':if(_0x456f81===_0x0aec('0x69')){_0x23a1a5['and']('c.firstName'+_0x0aec('0x6a'),'%'+_0x2566b4[_0x0aec('0x5b')]+'%');_0x23a1a5['or'](_0x0aec('0x6b')+_0x0aec('0x6a'),'%'+_0x2566b4[_0x0aec('0x5b')]+'%');_0x23a1a5['or'](_0x0aec('0x6c')+_0x0aec('0x6a'),'%'+_0x2566b4['value']+'%');}else{_0x23a1a5[_0x0aec('0x60')](_0x2566b4['tableAlias']+'.'+_0x456f81+_0x0aec('0x6a'),'%'+_0x2566b4['value']+'%');}break;case'>':_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x6d'),_0x2566b4['value']);break;case'<':_0x23a1a5[_0x0aec('0x60')](_0x2566b4['tableAlias']+'.'+_0x456f81+'\x20<\x20?',_0x2566b4[_0x0aec('0x5b')]);break;}});}else{switch(_0x2566b4[_0x0aec('0x63')][_0x0aec('0x5b')]){case'IS':if(_0x456f81!==_0x0aec('0x64')&&_0x456f81!=='Messages.count'){if(_[_0x0aec('0x62')](_0x2566b4['value'])&&_0x2566b4[_0x0aec('0x5b')]['length']>0x1){_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+'\x20IN\x20?',_0x2566b4[_0x0aec('0x5b')]);}else{_0x23a1a5[_0x0aec('0x60')](_0x2566b4['tableAlias']+'.'+_0x456f81+'\x20=\x20?',_0x2566b4[_0x0aec('0x5b')][0x0]);}}break;case'=':_0x23a1a5['and'](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x68'),_0x2566b4[_0x0aec('0x5b')]);break;case _0x0aec('0x6e'):if(_0x456f81===_0x0aec('0x69')){_0x23a1a5[_0x0aec('0x60')](_0x0aec('0x6f')+_0x0aec('0x6a'),'%'+_0x2566b4[_0x0aec('0x5b')]+'%');_0x23a1a5['or'](_0x0aec('0x6b')+_0x0aec('0x6a'),'%'+_0x2566b4['value']+'%');_0x23a1a5['or']('c.email'+'\x20LIKE\x20?','%'+_0x2566b4[_0x0aec('0x5b')]+'%');}else{_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x6a'),'%'+_0x2566b4[_0x0aec('0x5b')]+'%');}break;case'>':_0x23a1a5[_0x0aec('0x60')](_0x2566b4['tableAlias']+'.'+_0x456f81+_0x0aec('0x6d'),_0x2566b4[_0x0aec('0x5b')]);break;case'<':_0x23a1a5[_0x0aec('0x60')](_0x2566b4[_0x0aec('0x66')]+'.'+_0x456f81+_0x0aec('0x70'),_0x2566b4[_0x0aec('0x5b')]);break;}}}});}else{var _0x18c5e0=_(Object[_0x0aec('0x3a')](_0x40a418[_0x0aec('0x3b')]))[_0x0aec('0x71')](function(_0x3cc0e8){return _0x107d70[_0x0aec('0x41')](_0x3cc0e8)?_0x3cc0e8:undefined;})[_0x0aec('0x72')](function(_0x26c08e){return!_[_0x0aec('0x73')](_0x26c08e);})[_0x0aec('0x5b')]();if(!_[_0x0aec('0x74')](_0x18c5e0)){_0x18c5e0[_0x0aec('0x59')](function(_0x48b1ff){if(_0x48b1ff===_0x0aec('0x75')){_0x482db0[_0x0aec('0x44')](_0x0aec('0x76'),[][_0x0aec('0x77')](_0x40a418[_0x0aec('0x3b')][_0x48b1ff]));}else if(_0x48b1ff===_0x0aec('0x5a')){var _0x2c285d=JSON['parse'](_0x40a418[_0x0aec('0x3b')][_0x48b1ff])[_0x0aec('0x78')];var _0x40a637=JSON[_0x0aec('0x57')](_0x40a418['query'][_0x48b1ff])[_0x0aec('0x79')];_0x482db0[_0x0aec('0x44')](_0x0aec('0x61'),_0x2c285d,_0x40a637);}else{_0x482db0[_0x0aec('0x44')]('i.'+_0x48b1ff+_0x0aec('0x68'),_0x40a418[_0x0aec('0x3b')][_0x48b1ff]);}});}if(_0x40a418[_0x0aec('0x3b')][_0x0aec('0x72')]){var _0x38be88=_0x40a418[_0x0aec('0x3b')][_0x0aec('0x72')][_0x0aec('0x7a')]('\x5c','\x5c\x5c')[_0x0aec('0x7a')]('\x27\x27',_0x0aec('0x7b'));if(qs['isNumeric'](_0x38be88)){_0x23a1a5['or'](_0x0aec('0x7c'),_0x38be88+'%');}else{var _0x16ad11=[];_0x38be88[_0x0aec('0x7d')]('\x20')[_0x0aec('0x59')](function(_0x233756){_0x16ad11[_0x0aec('0x7e')]('+'+_0x233756[_0x0aec('0x7f')]());});var _0x60964=_0x16ad11[_0x0aec('0x80')]('\x20');_0x23a1a5['or'](_0x0aec('0x81'),_0x60964)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x38be88+'%');}}}_0x482db0['where'](_0x23a1a5);if(_0x270fe0[_0x0aec('0x82')]){_0x270fe0[_0x0aec('0x82')][_0x0aec('0x59')](function(_0x4d0823){_0x482db0[_0x0aec('0x82')]('i.'+_0x4d0823[0x0],_0x4d0823[0x1]===_0x0aec('0x83')?![]:!![]);});}_0x482db0['group'](_0x0aec('0x84'));var _0x3e2535={'type':db[_0x0aec('0x85')][_0x0aec('0x86')][_0x0aec('0x87')],'raw':!![]};var _0x344315=_0x482db0[_0x0aec('0x88')]()[_0x0aec('0x46')](_0x0aec('0x89'));if(!_0x40a418[_0x0aec('0x3b')]['advancedFilter']){if(_0x40a418['query'][_0x0aec('0x8a')]){if(_0x40a418[_0x0aec('0x3b')][_0x0aec('0x8a')]==0x1){_0x344315[_0x0aec('0x44')](util['format'](_0x0aec('0x8b'),_0x5882fc[_0x0aec('0x7f')]()));_0x482db0['having']('`Messages.count`\x20=\x200');}else{_0x344315[_0x0aec('0x44')](util['format']('%s\x20>\x200',_0x5882fc[_0x0aec('0x7f')]()));_0x482db0[_0x0aec('0x8c')](_0x0aec('0x8d'));}}if(_0x40a418[_0x0aec('0x3b')]['tag']){var _0x31b235=_[_0x0aec('0x62')](_0x40a418[_0x0aec('0x3b')][_0x0aec('0x8e')])?_0x40a418[_0x0aec('0x3b')]['tag']:new Array(_0x40a418[_0x0aec('0x3b')][_0x0aec('0x8e')]);var _0x42127e=squel[_0x0aec('0x8f')]();_0x31b235['forEach'](function(_0x1e3322){_0x42127e['or'](_0x0aec('0x90'),'%,'+_0x1e3322+',%');});_0x482db0[_0x0aec('0x8c')](_0x42127e);_0x344315['left_join'](_0x0aec('0x91'),'it',_0x0aec('0x92'));_0x344315['left_join']('tools_tags','t',_0x0aec('0x93'));_0x344315[_0x0aec('0x44')]('t.id\x20IN\x20?',_0x31b235);}}else{var _0x5f155f=JSON[_0x0aec('0x57')](_0x40a418[_0x0aec('0x3b')][_0x0aec('0x58')]);_[_0x0aec('0x3a')](_0x5f155f)[_0x0aec('0x59')](function(_0x3a632b){var _0x2be210=_0x5f155f[_0x3a632b];if(_0x3a632b===_0x0aec('0x64')){var _0x32b287=_0x2be210['value'];var _0x413113=squel[_0x0aec('0x8f')]();_0x32b287[_0x0aec('0x59')](function(_0x49f8cd){_0x413113['or'](_0x0aec('0x90'),'%,'+_0x49f8cd+',%');});_0x482db0[_0x0aec('0x8c')](_0x413113);_0x344315[_0x0aec('0x51')]('mail_interaction_has_tags','it',_0x0aec('0x94'));_0x344315[_0x0aec('0x51')]('tools_tags','t',_0x0aec('0x93'));_0x344315[_0x0aec('0x44')](_0x0aec('0x95'),_0x32b287);}else if(_0x3a632b===_0x0aec('0x65')){if(_0x2be210[_0x0aec('0x5b')][_0x0aec('0x40')]===0x1){if(_0x2be210['value'][0x0]===0x1){_0x344315[_0x0aec('0x44')](util[_0x0aec('0x5d')](_0x0aec('0x8b'),_0x5882fc[_0x0aec('0x7f')]()));_0x482db0[_0x0aec('0x8c')](_0x0aec('0x96'));}else{_0x344315[_0x0aec('0x44')](util[_0x0aec('0x5d')]('%s\x20>\x200',_0x5882fc['toString']()));_0x482db0[_0x0aec('0x8c')]('`Messages.count`\x20>\x200');}}}});}db[_0x0aec('0x97')][_0x0aec('0x3b')](_0x344315['toString'](),_0x3e2535)[_0x0aec('0x20')](function(_0x54cc9b){_0x411f36[_0x0aec('0x2d')]=_0x54cc9b[_0x0aec('0x40')];if(_0x411f36[_0x0aec('0x2d')]===0x0)return[];return db[_0x0aec('0x97')][_0x0aec('0x3b')](_0xf6fd75[_0x0aec('0x7f')](),_0x3e2535)[_0x0aec('0x20')](function(_0x2c391b){_0xe3efba=_[_0x0aec('0x98')](_0x2c391b,'id');_0x3e2535=_[_0x0aec('0x99')](_0x3e2535,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x482db0[_0x0aec('0x46')](_0x5882fc,_0x0aec('0x65'));_0x482db0[_0x0aec('0x46')](_0x0aec('0x9a'),_0x0aec('0x9b'));_0x482db0['field'](_0x0aec('0x9c'));_0x482db0['field']('c.firstName','Contact.firstName');_0x482db0[_0x0aec('0x46')](_0x0aec('0x6b'),'Contact.lastName');_0x482db0[_0x0aec('0x46')]('c.email',_0x0aec('0x9d'));_0x482db0[_0x0aec('0x46')](_0x0aec('0x9e'),_0x0aec('0x9f'));_0x482db0[_0x0aec('0x46')](_0x0aec('0xa0'),_0x0aec('0xa1'));_0x482db0[_0x0aec('0x46')](_0x0aec('0xa2'),_0x0aec('0xa3'));_0x482db0[_0x0aec('0x46')](_0x0aec('0xa4'),'User.name');_0x482db0['field'](_0x0aec('0xa5'),_0x0aec('0xa6'));_0x482db0[_0x0aec('0x51')](_0x0aec('0x91'),'it','it.ChatInteractionId\x20=\x20i.id');_0x482db0[_0x0aec('0x51')]('tools_tags','t',_0x0aec('0x93'));_0x482db0[_0x0aec('0x2f')](_0x270fe0[_0x0aec('0x2f')]);_0x482db0[_0x0aec('0x2e')](_0x270fe0['offset']);return db[_0x0aec('0x97')]['query'](_0x482db0[_0x0aec('0x7f')](),_0x3e2535);})['then'](function(_0x49b62e){_0x369c5a['where'](_0x0aec('0xa7'),_[_0x0aec('0x71')](_0x49b62e,'id'));return db[_0x0aec('0x97')][_0x0aec('0x3b')](_0x369c5a['toString'](),_0x3e2535)[_0x0aec('0x20')](function(_0x4a9975){var _0x49a848=_[_0x0aec('0xa8')](_0x4a9975,_0x0aec('0xa9'));_0x49b62e['forEach'](function(_0x22659c){if(_0x49a848[_0x22659c['id']]){_0x22659c[_0x0aec('0xaa')]=_[_0x0aec('0x71')](_0x49a848[_0x22659c['id']],function(_0x50de9f){return{'id':_0x50de9f['id']};});}if(_0x22659c[_0x0aec('0xa6')]){_0x22659c[_0x0aec('0xab')]=[];_0x22659c['TagIds'][_0x0aec('0x7d')](',')['forEach'](function(_0xea59bb){_0x22659c[_0x0aec('0xab')][_0x0aec('0x7e')](_0xe3efba[_0xea59bb]);});}delete _0x22659c[_0x0aec('0xa6')];});return _0x49b62e;});});})[_0x0aec('0x20')](function(_0x395291){_0x411f36[_0x0aec('0xac')]=_0x395291;return _0x411f36;})[_0x0aec('0x20')](respondWithFilteredResult(_0x4505a2,_0x270fe0))['catch'](handleError(_0x4505a2,null));};exports[_0x0aec('0xad')]=function(_0x34d24e,_0x2b73c4){var _0xa41548={'raw':![],'where':{'id':_0x34d24e[_0x0aec('0xae')]['id']}},_0x574de3={};_0x574de3[_0x0aec('0x39')]=_[_0x0aec('0x3a')](db['ChatInteraction'][_0x0aec('0xaf')]);_0x574de3[_0x0aec('0x3b')]=_[_0x0aec('0x3a')](_0x34d24e['query']);_0x574de3[_0x0aec('0x3c')]=_[_0x0aec('0x3d')](_0x574de3['model'],_0x574de3[_0x0aec('0x3b')]);_0xa41548[_0x0aec('0x3f')]=_[_0x0aec('0x3d')](_0x574de3[_0x0aec('0x39')],qs['fields'](_0x34d24e[_0x0aec('0x3b')]['fields']));_0xa41548['attributes']=_0xa41548[_0x0aec('0x3f')]['length']?_0xa41548['attributes']:_0x574de3['model'];if(_0x34d24e[_0x0aec('0x3b')][_0x0aec('0xb0')]){_0xa41548[_0x0aec('0xb1')]=[{'all':!![]}];}_0xa41548=_[_0x0aec('0x99')]({},_0xa41548,_0x34d24e[_0x0aec('0xb2')]);return db['ChatInteraction'][_0x0aec('0xb3')](_0xa41548)[_0x0aec('0x20')](handleEntityNotFound(_0x2b73c4,null))[_0x0aec('0x20')](respondWithResult(_0x2b73c4,null))[_0x0aec('0x2a')](handleError(_0x2b73c4,null));};exports[_0x0aec('0xb4')]=function(_0x42f87a,_0x200535){return db[_0x0aec('0xb5')][_0x0aec('0xb4')](_0x42f87a[_0x0aec('0xb6')],{})[_0x0aec('0x20')](respondWithResult(_0x200535,0xc9))[_0x0aec('0x2a')](handleError(_0x200535,null));};exports[_0x0aec('0x35')]=function(_0x1d050,_0x3672f8){if(_0x1d050[_0x0aec('0xb6')]['id']){delete _0x1d050[_0x0aec('0xb6')]['id'];}return db[_0x0aec('0xb5')][_0x0aec('0xb3')]({'where':{'id':_0x1d050['params']['id']}})['then'](handleEntityNotFound(_0x3672f8,null))[_0x0aec('0x20')](saveUpdates(_0x1d050[_0x0aec('0xb6')],null))['then'](respondWithResult(_0x3672f8,null))[_0x0aec('0x2a')](handleError(_0x3672f8,null));};exports[_0x0aec('0xb7')]=function(_0x3a40b2,_0x31b4c0){return db[_0x0aec('0xb5')]['find']({'where':{'id':_0x3a40b2[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0x31b4c0,null))[_0x0aec('0x20')](removeEntity(_0x31b4c0,null))[_0x0aec('0x2a')](handleError(_0x31b4c0,null));};exports['describe']=function(_0xa0b742,_0x2310aa){return db[_0x0aec('0xb5')][_0x0aec('0xb8')]()[_0x0aec('0x20')](respondWithResult(_0x2310aa,null))[_0x0aec('0x2a')](handleError(_0x2310aa,null));};exports['customUpdate']=function(_0xb15a04,_0xce880d){if(_0xb15a04[_0x0aec('0xb6')]['id']){delete _0xb15a04[_0x0aec('0xb6')]['id'];}return db[_0x0aec('0xb5')][_0x0aec('0xb3')]({'where':{'id':_0xb15a04[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0xce880d,null))['then'](saveUpdates(_0xb15a04[_0x0aec('0xb6')],null))[_0x0aec('0x20')](respondWithResult(_0xce880d,null))[_0x0aec('0x2a')](handleError(_0xce880d,null));};exports['abandon']=function(_0x1c01a8,_0x3bc9ed,_0xacee22){if(_0x1c01a8[_0x0aec('0xb6')]['id']){delete _0x1c01a8[_0x0aec('0xb6')]['id'];}return db[_0x0aec('0xb5')]['find']({'where':{'id':_0x1c01a8[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](function(_0x5f2618){if(!_0x5f2618){logger[_0x0aec('0x26')](_0x0aec('0xb9'),_0x0aec('0xba'),0x194,_0x0aec('0xbb'));_0x3bc9ed[_0x0aec('0x2b')](0x194);}else{if(_0x5f2618[_0x0aec('0xbc')]){throw new db[(_0x0aec('0x85'))]['ValidationError'](_0x0aec('0xbd'));}}return _0x5f2618;})[_0x0aec('0x20')](function(_0xf7e0a){if(_0xf7e0a){return _0xf7e0a['update']({'closed':_0x1c01a8[_0x0aec('0xb6')][_0x0aec('0xbe')],'disposition':_0x1c01a8[_0x0aec('0xb6')]['disposition']})['then'](function(_0x2cf27f){return _0x2cf27f;});}})[_0x0aec('0x20')](function(_0x4af9a4){return respondWithRpcPromise(_0x0aec('0xbf'),'abandon',_0x1c01a8[_0x0aec('0xb6')],client9004);})[_0x0aec('0x20')](respondWithResult(_0x3bc9ed,null))[_0x0aec('0x2a')](handleError(_0x3bc9ed,null));};exports[_0x0aec('0xc0')]=function(_0x3c85c2,_0x5ef918,_0x1ffdc8){_0x3c85c2['body'][_0x0aec('0x37')]=_0x3c85c2['file'][_0x0aec('0xc1')];_0x3c85c2[_0x0aec('0xb6')][_0x0aec('0xc2')]=_0x3c85c2[_0x0aec('0xc3')][_0x0aec('0xc4')];_0x3c85c2['body'][_0x0aec('0xc5')]=_0x3c85c2['file'][_0x0aec('0xc6')];return db[_0x0aec('0xc7')][_0x0aec('0xb4')](_0x3c85c2[_0x0aec('0xb6')])[_0x0aec('0x20')](respondWithResult(_0x5ef918,0xc9))[_0x0aec('0x2a')](handleError(_0x5ef918,null));};exports['attachmentDownload']=function(_0x3e4554,_0x3e8270,_0x1aa423){return db[_0x0aec('0xb5')]['findOne']({'where':{'id':_0x3e4554['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3e8270,null))[_0x0aec('0x20')](function(_0x3e8ddd){if(_0x3e8ddd){if(_0x3e8ddd['closed']){return _0x3e8270['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x0aec('0xc7')][_0x0aec('0xc8')]({'where':{'id':_0x3e4554[_0x0aec('0x3b')][_0x0aec('0xc9')]},'raw':!![]})[_0x0aec('0x20')](handleEntityNotFound(_0x3e8270,null));}})[_0x0aec('0x20')](function(_0x4aab75){if(_0x4aab75){return _0x3e8270['download'](path[_0x0aec('0x80')](config[_0x0aec('0xca')],_0x0aec('0xcb'),_0x4aab75[_0x0aec('0xc2')]));}})[_0x0aec('0x2a')](handleError(_0x3e8270,null));};exports[_0x0aec('0xcc')]=function(_0x395d22,_0x125bd2){var _0x3bd3fd=null;var _0x5c8769=null;var _0x57b869=null;var _0x523afb=null;if(_0x395d22[_0x0aec('0xb6')]['id']){delete _0x395d22[_0x0aec('0xb6')]['id'];}if(_0x395d22[_0x0aec('0xb6')][_0x0aec('0xcd')]){_0x523afb=path[_0x0aec('0x80')](config['root'],_0x0aec('0xce'),util[_0x0aec('0x5d')]('transcript-%s.txt',Date['now']()));_0x395d22[_0x0aec('0xb6')]['pathTranscript']=_0x523afb;}return db['ChatInteraction'][_0x0aec('0xb3')]({'where':{'id':_0x395d22[_0x0aec('0xae')]['id']},'include':[{'model':db[_0x0aec('0xcf')],'as':_0x0aec('0xd0'),'include':[{'model':db[_0x0aec('0xd1')],'as':_0x0aec('0xd1')}]}]})[_0x0aec('0x20')](handleEntityNotFound(_0x125bd2,null))[_0x0aec('0x20')](saveUpdates(_0x395d22[_0x0aec('0xb6')],null))[_0x0aec('0x20')](function(_0x33ac7d){if(_0x33ac7d){_0x3bd3fd=_0x33ac7d;return db[_0x0aec('0xd2')][_0x0aec('0xb3')]({'where':{'id':_0x3bd3fd['ChatWebsiteId']}});}})[_0x0aec('0x20')](function(_0x3ea75e){if(_0x3ea75e){_0x57b869=_0x3ea75e;return db[_0x0aec('0xd3')][_0x0aec('0xb3')]({'where':{'id':_0x3bd3fd[_0x0aec('0x69')]}});}})[_0x0aec('0x20')](function(_0x35ef17){if(_0x35ef17){_0x5c8769=_0x35ef17;if(_0x523afb){var _0x1e6839=null;for(var _0x3de84a=0x1;_0x3de84a<_0x3bd3fd[_0x0aec('0xd0')]['length'];++_0x3de84a){_0x1e6839=_0x3bd3fd[_0x0aec('0xd0')][_0x3de84a];var _0xb011a=_0x1e6839[_0x0aec('0xbc')]?util[_0x0aec('0x5d')](_0x0aec('0xd4'),_0x57b869['agentAlias'],_0x1e6839[_0x0aec('0xbc')]):'System';var _0x5dfd11=_0x395d22[_0x0aec('0xb6')][_0x0aec('0xd5')]||util['format'](_0x0aec('0xd4'),_0x0aec('0xd6'),_0x1e6839[_0x0aec('0x69')]);switch(_0x57b869[_0x0aec('0xd7')]){case'website_alias':_0xb011a=_0x1e6839[_0x0aec('0xbc')]?util[_0x0aec('0x5d')](_0x0aec('0xd4'),_0x57b869['agentAlias'],_0x1e6839[_0x0aec('0xbc')]):_0x0aec('0xd8');break;case _0x0aec('0xd9'):_0xb011a=_0x1e6839[_0x0aec('0xbc')]?_0x1e6839[_0x0aec('0xd1')]['alias']||_0x1e6839[_0x0aec('0xd1')][_0x0aec('0xda')]:_0x0aec('0xd8');break;case'agent_fullname':_0xb011a=_0x1e6839['UserId']?_0x1e6839['User']['fullname']:_0x0aec('0xd8');break;default:_0xb011a=_0x1e6839['UserId']?util['format'](_0x0aec('0xd4'),_0x57b869[_0x0aec('0xdb')],_0x1e6839[_0x0aec('0xbc')]):_0x0aec('0xd8');}var _0x3537ea=util[_0x0aec('0x5d')](_0x0aec('0xdc'),moment(_0x1e6839[_0x0aec('0x5a')])['format'](_0x0aec('0xdd')),_0x1e6839[_0x0aec('0xde')]==='in'?_0x5dfd11:_0xb011a,_0x1e6839['body']);if(!_0x1e6839[_0x0aec('0xdf')]){fs['appendFileSync'](_0x523afb,_0x3537ea);}}return db[_0x0aec('0xe0')][_0x0aec('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x0aec('0xe1')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x1b0591){if(_0x1b0591&&_0x1b0591['Smtp']&&_0x395d22[_0x0aec('0xb6')]){var _0x3028c4={'tls':{'rejectUnauthorized':![]}};if(_0x1b0591[_0x0aec('0xe2')][_0x0aec('0xe3')]){_0x3028c4['service']=_0x1b0591[_0x0aec('0xe2')][_0x0aec('0xe3')];}else{_0x3028c4[_0x0aec('0xe4')]=_0x1b0591['Smtp'][_0x0aec('0xe4')];_0x3028c4[_0x0aec('0xe5')]=_0x1b0591[_0x0aec('0xe2')][_0x0aec('0xe5')];_0x3028c4[_0x0aec('0xe6')]=_0x1b0591['Smtp'][_0x0aec('0xe6')];}if(_0x1b0591[_0x0aec('0xe2')]['authentication']){_0x3028c4['auth']={'user':_0x1b0591[_0x0aec('0xe2')][_0x0aec('0xe7')],'pass':_0x1b0591[_0x0aec('0xe2')]['pass']};}return respondWithRpcPromise(_0x0aec('0xe8'),_0x0aec('0xe9'),{'account':_0x3028c4,'message':{'from':util[_0x0aec('0x5d')](_0x0aec('0xea'),_0x1b0591['name'],_0x1b0591[_0x0aec('0xeb')]||_0x1b0591['Smtp']['user']),'to':_0x395d22['body'][_0x0aec('0xcd')],'subject':_0x0aec('0xec'),'text':util[_0x0aec('0x5d')](_0x0aec('0xed'),_0x395d22[_0x0aec('0xb6')][_0x0aec('0xcd')]),'attachments':[{'path':_0x523afb}]}})['then'](function(){return _0x3bd3fd;})['catch'](function(_0x3327e2){console[_0x0aec('0x26')](_0x3327e2);});}else{return _0x3bd3fd;}})['then'](respondWithStatusCode(_0x125bd2,0xc8))['catch'](handleError(_0x125bd2,null));};exports['addMessage']=function(_0x5d7621,_0x4134db,_0x11c8b2){return db['ChatMessage'][_0x0aec('0xb3')]({'where':{'id':_0x5d7621[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0x4134db,null))[_0x0aec('0x20')](function(_0x181f58){if(_0x181f58){return _0x181f58['addMessage'](_0x5d7621[_0x0aec('0xb6')][_0x0aec('0xee')],_[_0x0aec('0xef')](_0x5d7621[_0x0aec('0xb6')],[_0x0aec('0xee'),'id'])||{});}})[_0x0aec('0x20')](respondWithResult(_0x4134db,null))[_0x0aec('0x2a')](handleError(_0x4134db,null));};exports[_0x0aec('0xf0')]=function(_0x3e4f91,_0x428b43,_0x5ebde0){var _0x53bd5f={'raw':![],'where':{}};var _0x3c4dfa={};var _0x1e6227={'count':0x0,'rows':[]};return db[_0x0aec('0xb5')][_0x0aec('0xc8')]({'where':{'id':_0x3e4f91[_0x0aec('0xae')]['id']}})['then'](handleEntityNotFound(_0x428b43,null))['then'](function(_0x55bdcf){if(_0x55bdcf){_0x3c4dfa[_0x0aec('0x39')]=_[_0x0aec('0x3a')](db[_0x0aec('0xcf')][_0x0aec('0xaf')]);_0x3c4dfa['query']=_[_0x0aec('0x3a')](_0x3e4f91[_0x0aec('0x3b')]);_0x3c4dfa[_0x0aec('0x3c')]=_[_0x0aec('0x3d')](_0x3c4dfa[_0x0aec('0x39')],_0x3c4dfa[_0x0aec('0x3b')]);_0x53bd5f[_0x0aec('0x3f')]=_[_0x0aec('0x3d')](_0x3c4dfa[_0x0aec('0x39')],qs[_0x0aec('0x3e')](_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0x3e')]));_0x53bd5f['attributes']=_0x53bd5f['attributes'][_0x0aec('0x40')]?_0x53bd5f[_0x0aec('0x3f')]:_0x3c4dfa['model'];if(!_0x3e4f91[_0x0aec('0x3b')]['hasOwnProperty'](_0x0aec('0x42'))){_0x53bd5f['limit']=qs['limit'](_0x3e4f91['query'][_0x0aec('0x2f')]);_0x53bd5f[_0x0aec('0x2e')]=qs[_0x0aec('0x2e')](_0x3e4f91['query'][_0x0aec('0x2e')]);}_0x53bd5f[_0x0aec('0x82')]=qs['sort'](_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0x43')]);_0x53bd5f[_0x0aec('0x44')]=qs[_0x0aec('0x3c')](_[_0x0aec('0xf1')](_0x3e4f91[_0x0aec('0x3b')],_0x3c4dfa[_0x0aec('0x3c')]));_0x53bd5f[_0x0aec('0x44')]['ChatInteractionId']=_0x55bdcf['id'];if(_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0x72')]){_0x53bd5f[_0x0aec('0x44')]=_[_0x0aec('0x99')](_0x53bd5f[_0x0aec('0x44')],{'$or':_[_0x0aec('0x71')](_0x53bd5f['attributes'],function(_0x20e6f7){var _0x196083={};_0x196083[_0x20e6f7]={'$like':'%'+_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0x72')]+'%'};return _0x196083;})});}if(_0x3e4f91[_0x0aec('0x3b')]['$gte']){var _0x12cfc6=_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0x78')]['split'](',');var _0x1e9a87={};_0x1e9a87[_0x12cfc6[0x0]]={'$gte':moment(_0x12cfc6[0x1])[_0x0aec('0x5d')](_0x0aec('0xf2'))};_0x53bd5f['where']=_[_0x0aec('0x99')](_0x53bd5f[_0x0aec('0x44')],_0x1e9a87);}_0x53bd5f=_['merge']({},_0x53bd5f,_0x3e4f91['options']);return db[_0x0aec('0xcf')][_0x0aec('0x2d')]({'where':_0x53bd5f['where']})[_0x0aec('0x20')](function(_0x1807aa){_0x1e6227[_0x0aec('0x2d')]=_0x1807aa;if(_0x3e4f91[_0x0aec('0x3b')][_0x0aec('0xb0')]){_0x53bd5f[_0x0aec('0xb1')]=[{'all':!![]}];}return db[_0x0aec('0xcf')][_0x0aec('0xf3')](_0x53bd5f);})[_0x0aec('0x20')](function(_0xcaaef7){_0x1e6227[_0x0aec('0xac')]=_0xcaaef7;return _0x1e6227;});}})[_0x0aec('0x20')](respondWithFilteredResult(_0x428b43,_0x53bd5f))[_0x0aec('0x2a')](handleError(_0x428b43,null));};exports[_0x0aec('0xf4')]=function(_0x52223d,_0x4b1803,_0x26367c){var _0x2b989f={'where':{}},_0x9cf7a7={},_0x56674f={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x52223d[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0x4b1803,null))[_0x0aec('0x20')](function(_0x59353f){if(_0x59353f){_0x9cf7a7[_0x0aec('0x39')]=_[_0x0aec('0x3a')](db['ChatMessage'][_0x0aec('0xaf')]);_0x9cf7a7[_0x0aec('0x3b')]=_[_0x0aec('0x3a')](_0x52223d['query']);_0x9cf7a7[_0x0aec('0x3c')]=_[_0x0aec('0x3d')](_0x9cf7a7[_0x0aec('0x39')],_0x9cf7a7[_0x0aec('0x3b')]);_0x2b989f[_0x0aec('0x3f')]=_[_0x0aec('0x3d')](_0x9cf7a7[_0x0aec('0x39')],qs['fields'](_0x52223d[_0x0aec('0x3b')]['fields']));_0x2b989f['attributes']=_0x2b989f[_0x0aec('0x3f')][_0x0aec('0x40')]?_0x2b989f[_0x0aec('0x3f')]:_0x9cf7a7[_0x0aec('0x39')];if(!_0x52223d[_0x0aec('0x3b')]['hasOwnProperty'](_0x0aec('0x42'))){_0x2b989f[_0x0aec('0x2f')]=qs[_0x0aec('0x2f')](_0x52223d['query'][_0x0aec('0x2f')]);_0x2b989f[_0x0aec('0x2e')]=qs[_0x0aec('0x2e')](_0x52223d[_0x0aec('0x3b')][_0x0aec('0x2e')]);}_0x2b989f[_0x0aec('0x82')]=qs[_0x0aec('0x43')](_0x52223d['query']['sort']);_0x2b989f[_0x0aec('0x44')]=qs['filters'](_[_0x0aec('0xf1')](_0x52223d[_0x0aec('0x3b')],_0x9cf7a7['filters']));_0x2b989f[_0x0aec('0x44')]['ChatInteractionId']=_0x59353f['id'];if(_0x52223d[_0x0aec('0x3b')][_0x0aec('0x72')]){_0x2b989f[_0x0aec('0x44')]=_[_0x0aec('0x99')](_0x2b989f[_0x0aec('0x44')],{'$or':_[_0x0aec('0x71')](_0x2b989f['attributes'],function(_0x15b3cb){var _0x4d89fc={};_0x4d89fc[_0x15b3cb]={'$like':'%'+_0x52223d[_0x0aec('0x3b')][_0x0aec('0x72')]+'%'};return _0x4d89fc;})});}_0x2b989f[_0x0aec('0x44')][_0x0aec('0xdf')]=![];if(_0x52223d['query']['id']){_0x2b989f[_0x0aec('0x44')]['id']={'$gt':_0x52223d[_0x0aec('0x3b')]['id']};}_0x2b989f=_[_0x0aec('0x99')]({},_0x2b989f,_0x52223d['options']);return db[_0x0aec('0xcf')][_0x0aec('0x2d')]({'where':_0x2b989f[_0x0aec('0x44')]})[_0x0aec('0x20')](function(_0x1e8f4c){_0x56674f[_0x0aec('0x2d')]=_0x1e8f4c;_0x2b989f[_0x0aec('0xb1')]=[];if(_0x52223d[_0x0aec('0x3b')]['includeAgent']){_0x2b989f[_0x0aec('0xb1')][_0x0aec('0x7e')]({'model':db['User'],'as':_0x0aec('0xd1'),'attributes':['id','fullname',_0x0aec('0xf5')]});}if(_0x52223d[_0x0aec('0x3b')][_0x0aec('0xb0')]){_0x2b989f[_0x0aec('0xb1')]=[{'all':!![]}];}return db[_0x0aec('0xcf')][_0x0aec('0xf3')](_0x2b989f);})[_0x0aec('0x20')](function(_0x325cab){_0x56674f[_0x0aec('0xac')]=_0x325cab;return _0x56674f;});}})[_0x0aec('0x20')](respondWithFilteredResult(_0x4b1803,_0x2b989f))[_0x0aec('0x2a')](handleError(_0x4b1803,null));};exports[_0x0aec('0xf6')]=function(_0x4f9a21,_0x2d3970,_0x1a99e1){return db[_0x0aec('0xb5')][_0x0aec('0xb3')]({'where':{'id':_0x4f9a21[_0x0aec('0xae')]['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0x2d3970,null))[_0x0aec('0x20')](function(_0x5cb6c4){if(_0x5cb6c4){return _0x5cb6c4['setTags'](_0x4f9a21[_0x0aec('0xb6')][_0x0aec('0xee')],_['omit'](_0x4f9a21[_0x0aec('0xb6')],['ids','id'])||{})['spread'](function(){return db[_0x0aec('0xf7')][_0x0aec('0xf3')]({'attributes':['id',_0x0aec('0x37'),_0x0aec('0x47')],'where':{'id':_0x4f9a21[_0x0aec('0xb6')]['ids']}});})['then'](function(_0x36d946){socket[_0x0aec('0xf8')](_0x0aec('0xf9'),{'id':Number(_0x4f9a21['params']['id']),'tags':_0x36d946||[]});return{'id':Number(_0x4f9a21['params']['id']),'tags':_0x36d946||[]};});}})[_0x0aec('0x20')](respondWithResult(_0x2d3970,null))[_0x0aec('0x2a')](handleError(_0x2d3970,null));};exports[_0x0aec('0xfa')]=function(_0x108672,_0x1a5b78,_0x24f1a0){return db[_0x0aec('0xb5')][_0x0aec('0xb3')]({'where':{'id':_0x108672['params']['id']}})[_0x0aec('0x20')](handleEntityNotFound(_0x1a5b78,null))['then'](function(_0x4a91e3){if(_0x4a91e3){return _0x4a91e3['removeTags'](_0x108672[_0x0aec('0x3b')][_0x0aec('0xee')]);}})[_0x0aec('0x20')](respondWithStatusCode(_0x1a5b78,null))[_0x0aec('0x2a')](handleError(_0x1a5b78,null));};exports[_0x0aec('0xfb')]=function(_0x2cab9e,_0x59f9a3){var _0xa81243=moment()[_0x0aec('0xfc')]()['toString']();var _0x17bc45=path[_0x0aec('0x80')](config[_0x0aec('0xca')],_0x0aec('0xfd'),_0x0aec('0xfe'),_0x0aec('0xff'));var _0x443bba=path[_0x0aec('0x80')](config[_0x0aec('0xca')],_0x0aec('0xfd'),_0x0aec('0xfe'),'attachments');var _0x2abc52=path[_0x0aec('0x80')](_0x17bc45,_0xa81243);var _0x46f3e1=util[_0x0aec('0x5d')](_0x0aec('0x100'),_0x2cab9e['params']['id'],_0xa81243);var _0x7b2e4e=path[_0x0aec('0x80')](_0x17bc45,_0x46f3e1);var _0x3693e9=![];return db[_0x0aec('0xb5')][_0x0aec('0xb3')]({'where':{'id':_0x2cab9e[_0x0aec('0xae')]['id']},'include':[{'model':db[_0x0aec('0xcf')],'as':_0x0aec('0xd0'),'attributes':['id',_0x0aec('0xb6'),'createdAt',_0x0aec('0xde'),_0x0aec('0xdf')],'include':[{'model':db[_0x0aec('0xd1')],'as':_0x0aec('0xd1'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x0aec('0xd3')],'as':'Contact','attributes':['id','firstName',_0x0aec('0x101')],'raw':!![]},{'model':db[_0x0aec('0xc7')],'as':_0x0aec('0xc7'),'raw':!![]}]},{'model':db[_0x0aec('0xd2')],'as':_0x0aec('0x102'),'attributes':['id','name']},{'model':db[_0x0aec('0xd1')],'as':_0x0aec('0x103'),'attributes':['id','fullname']}]})[_0x0aec('0x20')](handleEntityNotFound(_0x59f9a3,null))[_0x0aec('0x20')](function(_0x518c46){if(_0x518c46){var _0x548e09=_0x518c46[_0x0aec('0x104')]({'plain':!![]});_0x3693e9=!![];var _0x5f1492={'format':'A4','border':_0x0aec('0x105'),'header':{'height':_0x0aec('0x106'),'contents':{'first':_0x0aec('0x107')}},'footer':{'height':_0x0aec('0x108'),'contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x0aec('0x5d')](_0x0aec('0x109'),_0x0aec('0x10a'),_0x548e09['id']),moment()['format'](_0x0aec('0x10b'))[_0x0aec('0x7f')]())}}};fs[_0x0aec('0x10c')](_0x2abc52);var _0x1660e6={'channel':_0x0aec('0x10a'),'account':_0x548e09['Account'][_0x0aec('0x37')],'agent':_0x548e09[_0x0aec('0x103')]?_0x548e09[_0x0aec('0x103')][_0x0aec('0xda')]:_0x0aec('0x10d'),'createdAt':moment(_0x548e09['createdAt'])[_0x0aec('0x5d')](_0x0aec('0xf2'))[_0x0aec('0x7f')](),'closedAt':_0x548e09[_0x0aec('0xbe')]?moment(_0x548e09[_0x0aec('0x10e')])[_0x0aec('0x5d')](_0x0aec('0xf2'))[_0x0aec('0x7f')]():'','disposition':_0x548e09['disposition'],'chatInfo':{'browser':_0x548e09[_0x0aec('0x10f')],'os':_0x548e09[_0x0aec('0x110')],'referer':_0x548e09[_0x0aec('0x111')],'customerIp':_0x548e09[_0x0aec('0x112')]},'messages':_(_0x548e09[_0x0aec('0xd0')])[_0x0aec('0x113')]()[_0x0aec('0x72')]({'secret':![]})['map'](function(_0x1ed3c8){if(_0x1ed3c8[_0x0aec('0xc7')]){var _0x1b9211=path[_0x0aec('0x80')](_0x443bba,_0x1ed3c8[_0x0aec('0xc7')]['basename']);if(fs[_0x0aec('0x114')](_0x1b9211)){fs[_0x0aec('0x115')](_0x1b9211)[_0x0aec('0x116')](fs[_0x0aec('0x117')](path[_0x0aec('0x80')](_0x2abc52,_0x1ed3c8['Attachment'][_0x0aec('0xc2')])));}}return{'date':moment(_0x1ed3c8['createdAt'])[_0x0aec('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1ed3c8[_0x0aec('0xde')]===_0x0aec('0x118')?_0x1ed3c8['User']?_0x1ed3c8[_0x0aec('0xd1')][_0x0aec('0xda')]:_0x0aec('0xd8'):_0x1ed3c8[_0x0aec('0x119')][_0x0aec('0x11a')]+(_0x1ed3c8[_0x0aec('0x119')][_0x0aec('0x101')]?'\x20'+_0x1ed3c8[_0x0aec('0x119')]['lastName']:''),'body':_0x1ed3c8[_0x0aec('0xc7')]?_0x1ed3c8[_0x0aec('0xc7')][_0x0aec('0xc2')]:_0x1ed3c8['body'],'direction':_0x1ed3c8[_0x0aec('0xde')]===_0x0aec('0x118')?'A':'C','secret':_0x1ed3c8[_0x0aec('0xdf')],'attachment':_0x1ed3c8[_0x0aec('0xc7')]};})[_0x0aec('0x5b')]()};return ejs[_0x0aec('0x11b')](path[_0x0aec('0x80')](config[_0x0aec('0xca')],_0x0aec('0xfd'),_0x0aec('0x11c'),_0x0aec('0x11d')),{'interaction':_0x1660e6})[_0x0aec('0x20')](function(_0x4ff164){return new BPromise(function(_0x833d7e,_0x313161){pdf[_0x0aec('0xb4')](_0x4ff164,_0x5f1492)[_0x0aec('0x11e')](path[_0x0aec('0x80')](_0x2abc52,_0x0aec('0x11f')+_0x548e09['id']+'-'+_0xa81243+'.pdf'),function(_0x4626fe,_0x53e77f){if(_0x4626fe)return _0x313161(_0x4626fe);_0x833d7e(_0x53e77f);});});});}})[_0x0aec('0x20')](function(){if(_0x3693e9){return new BPromise(function(_0x519123,_0x2f65be){zipdir(_0x2abc52,{'saveTo':_0x7b2e4e},function(_0x2ad72e,_0x2502f5){if(_0x2ad72e)return _0x2f65be(_0x2ad72e);return _0x519123(_0x2502f5);});})[_0x0aec('0x20')](function(){return new BPromise(function(_0x190a4d,_0x1dc405){rimraf(_0x2abc52,function(_0x1f8d40){if(_0x1f8d40)_0x1dc405(_0x1f8d40);return _0x190a4d();});});})[_0x0aec('0x20')](function(){return _0x59f9a3['download'](_0x7b2e4e,_0x46f3e1,function(_0x45f8d5){if(_0x45f8d5){console[_0x0aec('0x120')](_0x0aec('0x121'),_0x45f8d5);}else{fs[_0x0aec('0x122')](_0x7b2e4e);}});});}else{return _0x59f9a3[_0x0aec('0x2b')](0xc8);}})[_0x0aec('0x2a')](handleError(_0x59f9a3,null));}; \ No newline at end of file +var _0x3126=['Users','Tags','push','rows','show','params','intersection','fields','options','catch','create','body','update','find','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','file','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','root','server/files/attachments/','basename','close','mailTranscript','transcript-%s.txt','now','ChatMessage','Messages','User','ChatWebsite','CmContact','agentAlias','customer','%s%d','Visitor','website_alias','System','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','Smtp','service','host','port','secure','user','pass','sendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','include','findAll','alias','includeAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','transcript-%d-%s.zip','firstName','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','mkdirSync','Chat','Account','N.A.','osName','referer','tail','existsSync','createReadStream','createWriteStream','out','Contact','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','then','destroy','sendStatus','name','send','index','ChatInteraction','rawAttributes','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','select','field','color','from','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.read\x20=\x20false','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','forEach','value','dateStart','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','tableAlias','\x20=\x20?','LIKE','ContactId','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','TagId','\x20IN\x20?','c.firstName','map','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','having','%s\x20>\x200','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20IN\x20?','mail_interaction_has_tags','%s\x20=\x200','sequelize','keyBy','merge','Messages.count','a.key','Account.key','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','u.fullname','User.name','TagIds','t.id\x20=\x20it.TagId','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3126,0x193));var _0x6312=function(_0x36d0c4,_0x452840){_0x36d0c4=_0x36d0c4-0x0;var _0x39e9fd=_0x3126[_0x36d0c4];return _0x39e9fd;};'use strict';var pdf=require(_0x6312('0x0'));var emlformat=require(_0x6312('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6312('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6312('0x3'));var moment=require(_0x6312('0x4'));var BPromise=require(_0x6312('0x5'));var Mustache=require(_0x6312('0x6'));var util=require(_0x6312('0x7'));var path=require(_0x6312('0x8'));var sox=require(_0x6312('0x9'));var csv=require(_0x6312('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6312('0xb'));var squel=require(_0x6312('0xc'));var crypto=require(_0x6312('0xd'));var jsforce=require(_0x6312('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6312('0xf'));var Papa=require('papaparse');var Redis=require(_0x6312('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6312('0x11'));var logger=require('../../config/logger')(_0x6312('0x12'));var utils=require(_0x6312('0x13'));var config=require(_0x6312('0x14'));var db=require(_0x6312('0x15'))['db'];config['redis']=_[_0x6312('0x16')](config[_0x6312('0x17')],{'host':_0x6312('0x18'),'port':0x18eb});var socket=require(_0x6312('0x19'))(new Redis(config[_0x6312('0x17')]));require(_0x6312('0x1a'))[_0x6312('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6312('0x1c')][_0x6312('0x1d')]({'port':0x232b});var client9004=jayson[_0x6312('0x1c')][_0x6312('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x56ff03,_0x4dbb86,_0x40fdc9){if(_0x40fdc9){var _0x27bc9f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27bc9f['test'](_0x4dbb86)){return _0x56ff03;}else{throw new Error(_0x6312('0x1e'));}}else{return _0x56ff03;}}function respondWithRpcPromise(_0x135449,_0x2d642b,_0x362aa1,_0x2aefa8){return new BPromise(function(_0x2756b1,_0x28e3e3){var _0x126d02=_0x2aefa8||client;return _0x126d02[_0x6312('0x1f')](_0x135449,_0x362aa1)['then'](function(_0xf2a43a){logger[_0x6312('0x20')](_0x6312('0x21'),_0x2d642b,_0x6312('0x22'));logger[_0x6312('0x23')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2d642b,_0x6312('0x22'),JSON[_0x6312('0x24')](_0xf2a43a));if(_0xf2a43a[_0x6312('0x25')]){if(_0xf2a43a[_0x6312('0x25')][_0x6312('0x26')]===0x1f4){logger[_0x6312('0x25')](_0x6312('0x21'),_0x2d642b,_0xf2a43a[_0x6312('0x25')][_0x6312('0x27')]);return _0x28e3e3(_0xf2a43a[_0x6312('0x25')][_0x6312('0x27')]);}logger[_0x6312('0x25')](_0x6312('0x21'),_0x2d642b,_0xf2a43a[_0x6312('0x25')][_0x6312('0x27')]);return _0x2756b1(_0xf2a43a[_0x6312('0x25')][_0x6312('0x27')]);}else{logger[_0x6312('0x20')](_0x6312('0x21'),_0x2d642b,_0x6312('0x22'));_0x2756b1(_0xf2a43a[_0x6312('0x28')][_0x6312('0x27')]);}})['catch'](function(_0xed7c3){logger[_0x6312('0x25')](_0x6312('0x21'),_0x2d642b,_0xed7c3);_0x28e3e3(_0xed7c3);});});}function respondWithStatusCode(_0x2db6ad,_0x1f82ba){_0x1f82ba=_0x1f82ba||0xcc;return function(_0x4331c7){if(_0x4331c7){return _0x2db6ad['sendStatus'](_0x1f82ba);}return _0x2db6ad[_0x6312('0x29')](_0x1f82ba)[_0x6312('0x2a')]();};}function respondWithResult(_0x66399a,_0x47af72){_0x47af72=_0x47af72||0xc8;return function(_0x21c21c){if(_0x21c21c){return _0x66399a[_0x6312('0x29')](_0x47af72)[_0x6312('0x2b')](_0x21c21c);}};}function respondWithFilteredResult(_0x39fd30,_0x2a824d){return function(_0xb39dff){if(_0xb39dff){var _0x4e1873=_0xb39dff[_0x6312('0x2c')],_0x14d8ce=_0x2a824d[_0x6312('0x2d')],_0x3b0de5=_0x2a824d[_0x6312('0x2d')]+_0x2a824d[_0x6312('0x2e')],_0x30d1f6;if(_0x3b0de5>=_0x4e1873){_0x3b0de5=_0x4e1873;_0x30d1f6=0xc8;}else{_0x30d1f6=0xce;}_0x39fd30[_0x6312('0x29')](_0x30d1f6);return _0x39fd30[_0x6312('0x2f')](_0x6312('0x30'),_0x14d8ce+'-'+_0x3b0de5+'/'+_0x4e1873)[_0x6312('0x2b')](_0xb39dff);}return null;};}function patchUpdates(_0x5e6104){return function(_0x569420){try{jsonpatch['apply'](_0x569420,_0x5e6104,!![]);}catch(_0x7729ec){return BPromise['reject'](_0x7729ec);}return _0x569420['save']();};}function saveUpdates(_0x5c1df6,_0x282664){return function(_0x1399cc){if(_0x1399cc){return _0x1399cc['update'](_0x5c1df6)[_0x6312('0x31')](function(_0x2d8b68){return _0x2d8b68;});}return null;};}function removeEntity(_0x1b9269,_0x505ee5){return function(_0x150068){if(_0x150068){return _0x150068[_0x6312('0x32')]()['then'](function(){_0x1b9269[_0x6312('0x29')](0xcc)[_0x6312('0x2a')]();});}};}function handleEntityNotFound(_0x2e5875,_0x1743b0){return function(_0x15f1b0){if(!_0x15f1b0){_0x2e5875[_0x6312('0x33')](0x194);}return _0x15f1b0;};}function handleError(_0x5761c7,_0x7ce6b7){_0x7ce6b7=_0x7ce6b7||0x1f4;return function(_0x3745b2){logger[_0x6312('0x25')](_0x3745b2['stack']);if(_0x3745b2[_0x6312('0x34')]){delete _0x3745b2[_0x6312('0x34')];}_0x5761c7[_0x6312('0x29')](_0x7ce6b7)[_0x6312('0x35')](_0x3745b2);};}exports[_0x6312('0x36')]=function(_0x34436b,_0x7f1242){var _0xd8042d={},_0x4ba91c={},_0x247802={'count':0x0,'rows':[]};var _0x14ec68=db[_0x6312('0x37')][_0x6312('0x38')];_0x4ba91c[_0x6312('0x39')]=_['keys'](_0x14ec68);_0x4ba91c[_0x6312('0x3a')]=_[_0x6312('0x3b')](_0x34436b[_0x6312('0x3a')]);_0x4ba91c['filters']=_['intersection'](_0x4ba91c[_0x6312('0x39')],_0x4ba91c[_0x6312('0x3a')]);_0xd8042d[_0x6312('0x3c')]=_['intersection'](_0x4ba91c[_0x6312('0x39')],qs['fields'](_0x34436b[_0x6312('0x3a')]['fields']));_0xd8042d[_0x6312('0x3c')]=_0xd8042d[_0x6312('0x3c')][_0x6312('0x3d')]?_0xd8042d[_0x6312('0x3c')]:_0x4ba91c[_0x6312('0x39')];if(!_0x34436b[_0x6312('0x3a')][_0x6312('0x3e')](_0x6312('0x3f'))){_0xd8042d[_0x6312('0x2e')]=qs['limit'](_0x34436b['query'][_0x6312('0x2e')]);_0xd8042d[_0x6312('0x2d')]=qs['offset'](_0x34436b[_0x6312('0x3a')][_0x6312('0x2d')]);}_0xd8042d[_0x6312('0x40')]=qs['sort'](_0x34436b[_0x6312('0x3a')][_0x6312('0x41')]);_0xd8042d['where']=qs['filters'](_[_0x6312('0x42')](_0x34436b[_0x6312('0x3a')],_0x4ba91c[_0x6312('0x43')]));var _0x52b397=[];var _0x571b5c=squel[_0x6312('0x44')]()[_0x6312('0x45')]('id')[_0x6312('0x45')](_0x6312('0x34'))['field'](_0x6312('0x46'))[_0x6312('0x47')]('tools_tags');var _0x34d09c=squel[_0x6312('0x44')]()[_0x6312('0x45')](_0x6312('0x48'))[_0x6312('0x47')](_0x6312('0x49'),'me')[_0x6312('0x4a')](_0x6312('0x4b'))[_0x6312('0x4a')]('me.direction\x20=\x20\x27in\x27')[_0x6312('0x4a')](_0x6312('0x4c'));var _0x213350=squel[_0x6312('0x44')]()[_0x6312('0x45')]('u.id')[_0x6312('0x45')](_0x6312('0x4d'))['from'](_0x6312('0x4e'),'ui')[_0x6312('0x4f')](_0x6312('0x50'),'u',_0x6312('0x51'));var _0x5aed07=squel[_0x6312('0x44')]()['from'](_0x6312('0x52'),'i')[_0x6312('0x4f')](_0x6312('0x4e'),'ui',_0x6312('0x53'))['left_join']('users','u',_0x6312('0x51'))[_0x6312('0x4f')](_0x6312('0x54'),'c',_0x6312('0x55'))[_0x6312('0x4f')](_0x6312('0x50'),'o',_0x6312('0x56'))['left_join'](_0x6312('0x57'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x6312('0x4f')]('chat_messages','me',_0x6312('0x4b'));var _0x46769b=squel['expr']();if(_0x34436b[_0x6312('0x3a')]['advancedFilter']){var _0x3d689f=JSON['parse'](_0x34436b[_0x6312('0x3a')]['advancedFilter']);_[_0x6312('0x3b')](_0x3d689f)[_0x6312('0x58')](function(_0x7ede4f){var _0xa175b9=_0x3d689f[_0x7ede4f];if(_0x7ede4f==='createdAt'){var _0x370c85=moment(_0xa175b9[_0x6312('0x59')][_0x6312('0x5a')])[_0x6312('0x5b')](_0x6312('0x5c'))[_0x6312('0x5d')]()[_0x6312('0x5e')]();var _0x2302f2=moment(_0x2302f2)[_0x6312('0x5d')]()['endOf'](_0x6312('0x5c'))[_0x6312('0x5e')]();_0x46769b[_0x6312('0x5f')](_0x6312('0x60'),_0x370c85,_0x2302f2);}else{if(_[_0x6312('0x61')](_0xa175b9[_0x6312('0x62')])){_0xa175b9[_0x6312('0x62')][_0x6312('0x58')](function(_0x1de492){switch(_0xa175b9['condition'][_0x6312('0x59')]){case'IS':if(_0x7ede4f!=='TagId'&&_0x7ede4f!=='Messages.count'){if(_[_0x6312('0x61')](_0xa175b9['value'])&&_0xa175b9[_0x6312('0x59')][_0x6312('0x3d')]>0x1){_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+'\x20IN\x20?',_0xa175b9[_0x6312('0x59')]);}else{_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x64'),_0xa175b9[_0x6312('0x59')][0x0]);}}break;case'=':_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x64'),_0xa175b9[_0x6312('0x59')]);break;case _0x6312('0x65'):if(_0x7ede4f===_0x6312('0x66')){_0x46769b[_0x6312('0x5f')]('c.firstName'+'\x20LIKE\x20?','%'+_0xa175b9[_0x6312('0x59')]+'%');_0x46769b['or'](_0x6312('0x67')+'\x20LIKE\x20?','%'+_0xa175b9[_0x6312('0x59')]+'%');_0x46769b['or'](_0x6312('0x68')+_0x6312('0x69'),'%'+_0xa175b9['value']+'%');}else{_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x69'),'%'+_0xa175b9[_0x6312('0x59')]+'%');}break;case'>':_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x6a'),_0xa175b9['value']);break;case'<':_0x46769b[_0x6312('0x5f')](_0xa175b9['tableAlias']+'.'+_0x7ede4f+_0x6312('0x6b'),_0xa175b9[_0x6312('0x59')]);break;}});}else{switch(_0xa175b9[_0x6312('0x62')]['value']){case'IS':if(_0x7ede4f!==_0x6312('0x6c')&&_0x7ede4f!=='Messages.count'){if(_[_0x6312('0x61')](_0xa175b9[_0x6312('0x59')])&&_0xa175b9['value'][_0x6312('0x3d')]>0x1){_0x46769b['and'](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x6d'),_0xa175b9[_0x6312('0x59')]);}else{_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x64'),_0xa175b9[_0x6312('0x59')][0x0]);}}break;case'=':_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x64'),_0xa175b9[_0x6312('0x59')]);break;case _0x6312('0x65'):if(_0x7ede4f===_0x6312('0x66')){_0x46769b['and'](_0x6312('0x6e')+_0x6312('0x69'),'%'+_0xa175b9['value']+'%');_0x46769b['or']('c.lastName'+_0x6312('0x69'),'%'+_0xa175b9[_0x6312('0x59')]+'%');_0x46769b['or']('c.email'+_0x6312('0x69'),'%'+_0xa175b9[_0x6312('0x59')]+'%');}else{_0x46769b['and'](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x69'),'%'+_0xa175b9['value']+'%');}break;case'>':_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x6a'),_0xa175b9[_0x6312('0x59')]);break;case'<':_0x46769b[_0x6312('0x5f')](_0xa175b9[_0x6312('0x63')]+'.'+_0x7ede4f+_0x6312('0x6b'),_0xa175b9['value']);break;}}}});}else{var _0x3d59a4=_(Object[_0x6312('0x3b')](_0x34436b['query']))[_0x6312('0x6f')](function(_0x41d665){return _0x14ec68[_0x6312('0x3e')](_0x41d665)?_0x41d665:undefined;})[_0x6312('0x70')](function(_0x5377d3){return!_[_0x6312('0x71')](_0x5377d3);})['value']();if(!_[_0x6312('0x72')](_0x3d59a4)){_0x3d59a4['forEach'](function(_0x29fcc3){if(_0x29fcc3===_0x6312('0x73')){_0x5aed07[_0x6312('0x4a')](_0x6312('0x74'),[][_0x6312('0x75')](_0x34436b['query'][_0x29fcc3]));}else if(_0x29fcc3===_0x6312('0x76')){var _0x2778ae=JSON[_0x6312('0x77')](_0x34436b[_0x6312('0x3a')][_0x29fcc3])[_0x6312('0x78')];var _0x10d2d2=JSON['parse'](_0x34436b[_0x6312('0x3a')][_0x29fcc3])[_0x6312('0x79')];_0x5aed07[_0x6312('0x4a')](_0x6312('0x60'),_0x2778ae,_0x10d2d2);}else{_0x5aed07['where']('i.'+_0x29fcc3+'\x20=\x20?',_0x34436b[_0x6312('0x3a')][_0x29fcc3]);}});}if(_0x34436b[_0x6312('0x3a')][_0x6312('0x70')]){var _0x2431a1=_0x34436b['query'][_0x6312('0x70')][_0x6312('0x7a')]('\x5c','\x5c\x5c')[_0x6312('0x7a')]('\x27\x27',_0x6312('0x7b'));if(qs['isNumeric'](_0x2431a1)){_0x46769b['or'](_0x6312('0x7c'),_0x2431a1+'%');}else{var _0x584fe6=[];_0x2431a1[_0x6312('0x7d')]('\x20')[_0x6312('0x58')](function(_0x38f8b9){_0x584fe6['push']('+'+_0x38f8b9[_0x6312('0x7e')]());});var _0x255e7e=_0x584fe6[_0x6312('0x7f')]('\x20');_0x46769b['or'](_0x6312('0x80'),_0x255e7e)['or'](_0x6312('0x81'),_0x2431a1+'%');}}}_0x5aed07[_0x6312('0x4a')](_0x46769b);if(_0xd8042d['order']){_0xd8042d['order'][_0x6312('0x58')](function(_0x26038a){_0x5aed07[_0x6312('0x40')]('i.'+_0x26038a[0x0],_0x26038a[0x1]==='DESC'?![]:!![]);});}_0x5aed07[_0x6312('0x82')]('i.id');var _0x27f413={'type':db[_0x6312('0x83')][_0x6312('0x84')]['SELECT'],'raw':!![]};var _0x3bf768=_0x5aed07['clone']()[_0x6312('0x45')](_0x6312('0x48'));if(!_0x34436b[_0x6312('0x3a')]['advancedFilter']){if(_0x34436b[_0x6312('0x3a')]['read']){if(_0x34436b['query']['read']==0x1){_0x3bf768[_0x6312('0x4a')](util[_0x6312('0x5e')]('%s\x20=\x200',_0x34d09c[_0x6312('0x7e')]()));_0x5aed07[_0x6312('0x85')]('`Messages.count`\x20=\x200');}else{_0x3bf768[_0x6312('0x4a')](util[_0x6312('0x5e')](_0x6312('0x86'),_0x34d09c['toString']()));_0x5aed07[_0x6312('0x85')](_0x6312('0x87'));}}if(_0x34436b[_0x6312('0x3a')][_0x6312('0x88')]){var _0x1c7787=_[_0x6312('0x61')](_0x34436b[_0x6312('0x3a')][_0x6312('0x88')])?_0x34436b[_0x6312('0x3a')][_0x6312('0x88')]:new Array(_0x34436b[_0x6312('0x3a')][_0x6312('0x88')]);var _0x19c35e=squel[_0x6312('0x89')]();_0x1c7787[_0x6312('0x58')](function(_0x8777c6){_0x19c35e['or'](_0x6312('0x8a'),'%,'+_0x8777c6+',%');});_0x5aed07[_0x6312('0x85')](_0x19c35e);_0x3bf768['left_join'](_0x6312('0x8b'),'it',_0x6312('0x8c'));_0x3bf768['left_join'](_0x6312('0x8d'),'t','t.id\x20=\x20it.TagId');_0x3bf768['where'](_0x6312('0x8e'),_0x1c7787);}}else{var _0x3d689f=JSON[_0x6312('0x77')](_0x34436b[_0x6312('0x3a')]['advancedFilter']);_[_0x6312('0x3b')](_0x3d689f)[_0x6312('0x58')](function(_0x2e4e79){var _0x4017e=_0x3d689f[_0x2e4e79];if(_0x2e4e79===_0x6312('0x6c')){var _0x1f3c01=_0x4017e[_0x6312('0x59')];var _0x4f696d=squel['expr']();_0x1f3c01['forEach'](function(_0xa90332){_0x4f696d['or'](_0x6312('0x8a'),'%,'+_0xa90332+',%');});_0x5aed07[_0x6312('0x85')](_0x4f696d);_0x3bf768[_0x6312('0x4f')](_0x6312('0x8f'),'it','it.MailInteractionId\x20=\x20i.id');_0x3bf768[_0x6312('0x4f')](_0x6312('0x8d'),'t','t.id\x20=\x20it.TagId');_0x3bf768['where'](_0x6312('0x8e'),_0x1f3c01);}else if(_0x2e4e79==='Messages.count'){if(_0x4017e[_0x6312('0x59')]['length']===0x1){if(_0x4017e['value'][0x0]===0x1){_0x3bf768[_0x6312('0x4a')](util[_0x6312('0x5e')](_0x6312('0x90'),_0x34d09c[_0x6312('0x7e')]()));_0x5aed07[_0x6312('0x85')]('`Messages.count`\x20=\x200');}else{_0x3bf768[_0x6312('0x4a')](util['format'](_0x6312('0x86'),_0x34d09c[_0x6312('0x7e')]()));_0x5aed07[_0x6312('0x85')]('`Messages.count`\x20>\x200');}}}});}db['sequelize'][_0x6312('0x3a')](_0x3bf768[_0x6312('0x7e')](),_0x27f413)[_0x6312('0x31')](function(_0x50d591){_0x247802[_0x6312('0x2c')]=_0x50d591[_0x6312('0x3d')];if(_0x247802[_0x6312('0x2c')]===0x0)return[];return db[_0x6312('0x91')]['query'](_0x571b5c[_0x6312('0x7e')](),_0x27f413)['then'](function(_0x11cf4e){_0x52b397=_[_0x6312('0x92')](_0x11cf4e,'id');_0x27f413=_[_0x6312('0x93')](_0x27f413,{'model':db[_0x6312('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5aed07['field'](_0x34d09c,_0x6312('0x94'));_0x5aed07[_0x6312('0x45')](_0x6312('0x95'),_0x6312('0x96'));_0x5aed07[_0x6312('0x45')]('i.*');_0x5aed07['field'](_0x6312('0x6e'),_0x6312('0x97'));_0x5aed07[_0x6312('0x45')]('c.lastName',_0x6312('0x98'));_0x5aed07[_0x6312('0x45')](_0x6312('0x68'),'Contact.email');_0x5aed07[_0x6312('0x45')](_0x6312('0x99'),_0x6312('0x9a'));_0x5aed07[_0x6312('0x45')](_0x6312('0x9b'),_0x6312('0x9c'));_0x5aed07[_0x6312('0x45')]('c.fax',_0x6312('0x9d'));_0x5aed07['field'](_0x6312('0x9e'),_0x6312('0x9f'));_0x5aed07[_0x6312('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6312('0xa0'));_0x5aed07[_0x6312('0x4f')](_0x6312('0x8b'),'it',_0x6312('0x8c'));_0x5aed07[_0x6312('0x4f')](_0x6312('0x8d'),'t',_0x6312('0xa1'));_0x5aed07['limit'](_0xd8042d['limit']);_0x5aed07[_0x6312('0x2d')](_0xd8042d[_0x6312('0x2d')]);return db[_0x6312('0x91')]['query'](_0x5aed07[_0x6312('0x7e')](),_0x27f413);})[_0x6312('0x31')](function(_0x44388e){_0x213350[_0x6312('0x4a')](_0x6312('0xa2'),_['map'](_0x44388e,'id'));return db[_0x6312('0x91')][_0x6312('0x3a')](_0x213350[_0x6312('0x7e')](),_0x27f413)['then'](function(_0x20940c){var _0x357f16=_[_0x6312('0xa3')](_0x20940c,_0x6312('0xa4'));_0x44388e[_0x6312('0x58')](function(_0x49d05c){if(_0x357f16[_0x49d05c['id']]){_0x49d05c[_0x6312('0xa5')]=_[_0x6312('0x6f')](_0x357f16[_0x49d05c['id']],function(_0x3a0b9f){return{'id':_0x3a0b9f['id']};});}if(_0x49d05c[_0x6312('0xa0')]){_0x49d05c['Tags']=[];_0x49d05c['TagIds'][_0x6312('0x7d')](',')['forEach'](function(_0xd7a66a){_0x49d05c[_0x6312('0xa6')][_0x6312('0xa7')](_0x52b397[_0xd7a66a]);});}delete _0x49d05c['TagIds'];});return _0x44388e;});});})[_0x6312('0x31')](function(_0x2e4ca2){_0x247802[_0x6312('0xa8')]=_0x2e4ca2;return _0x247802;})[_0x6312('0x31')](respondWithFilteredResult(_0x7f1242,_0xd8042d))['catch'](handleError(_0x7f1242,null));};exports[_0x6312('0xa9')]=function(_0x27e0f3,_0x204260){var _0x940f8={'raw':![],'where':{'id':_0x27e0f3[_0x6312('0xaa')]['id']}},_0x57bf96={};_0x57bf96['model']=_[_0x6312('0x3b')](db[_0x6312('0x37')][_0x6312('0x38')]);_0x57bf96[_0x6312('0x3a')]=_['keys'](_0x27e0f3[_0x6312('0x3a')]);_0x57bf96[_0x6312('0x43')]=_['intersection'](_0x57bf96[_0x6312('0x39')],_0x57bf96[_0x6312('0x3a')]);_0x940f8[_0x6312('0x3c')]=_[_0x6312('0xab')](_0x57bf96['model'],qs['fields'](_0x27e0f3[_0x6312('0x3a')][_0x6312('0xac')]));_0x940f8[_0x6312('0x3c')]=_0x940f8[_0x6312('0x3c')][_0x6312('0x3d')]?_0x940f8[_0x6312('0x3c')]:_0x57bf96['model'];if(_0x27e0f3[_0x6312('0x3a')]['includeAll']){_0x940f8['include']=[{'all':!![]}];}_0x940f8=_['merge']({},_0x940f8,_0x27e0f3[_0x6312('0xad')]);return db[_0x6312('0x37')]['find'](_0x940f8)[_0x6312('0x31')](handleEntityNotFound(_0x204260,null))[_0x6312('0x31')](respondWithResult(_0x204260,null))[_0x6312('0xae')](handleError(_0x204260,null));};exports['create']=function(_0x4a66a4,_0x3e1b48){return db[_0x6312('0x37')][_0x6312('0xaf')](_0x4a66a4[_0x6312('0xb0')],{})['then'](respondWithResult(_0x3e1b48,0xc9))[_0x6312('0xae')](handleError(_0x3e1b48,null));};exports[_0x6312('0xb1')]=function(_0x2e5f4b,_0x21a86d){if(_0x2e5f4b[_0x6312('0xb0')]['id']){delete _0x2e5f4b[_0x6312('0xb0')]['id'];}return db[_0x6312('0x37')][_0x6312('0xb2')]({'where':{'id':_0x2e5f4b[_0x6312('0xaa')]['id']}})[_0x6312('0x31')](handleEntityNotFound(_0x21a86d,null))[_0x6312('0x31')](saveUpdates(_0x2e5f4b[_0x6312('0xb0')],null))['then'](respondWithResult(_0x21a86d,null))[_0x6312('0xae')](handleError(_0x21a86d,null));};exports[_0x6312('0x32')]=function(_0x171621,_0x47f98e){return db[_0x6312('0x37')][_0x6312('0xb2')]({'where':{'id':_0x171621[_0x6312('0xaa')]['id']}})[_0x6312('0x31')](handleEntityNotFound(_0x47f98e,null))[_0x6312('0x31')](removeEntity(_0x47f98e,null))['catch'](handleError(_0x47f98e,null));};exports['describe']=function(_0x458ad6,_0x164667){return db[_0x6312('0x37')][_0x6312('0xb3')]()[_0x6312('0x31')](respondWithResult(_0x164667,null))[_0x6312('0xae')](handleError(_0x164667,null));};exports[_0x6312('0xb4')]=function(_0x35e851,_0x38e7ef){if(_0x35e851[_0x6312('0xb0')]['id']){delete _0x35e851[_0x6312('0xb0')]['id'];}return db['ChatInteraction'][_0x6312('0xb2')]({'where':{'id':_0x35e851[_0x6312('0xaa')]['id']}})['then'](handleEntityNotFound(_0x38e7ef,null))[_0x6312('0x31')](saveUpdates(_0x35e851[_0x6312('0xb0')],null))[_0x6312('0x31')](respondWithResult(_0x38e7ef,null))['catch'](handleError(_0x38e7ef,null));};exports['abandon']=function(_0x3aa91e,_0x4f9a41,_0x45131a){if(_0x3aa91e['body']['id']){delete _0x3aa91e[_0x6312('0xb0')]['id'];}return db[_0x6312('0x37')][_0x6312('0xb2')]({'where':{'id':_0x3aa91e['params']['id']}})[_0x6312('0x31')](function(_0x39b9fb){if(!_0x39b9fb){logger['error'](_0x6312('0xb5'),'abandon',0x194,_0x6312('0xb6'));_0x4f9a41[_0x6312('0x33')](0x194);}else{if(_0x39b9fb[_0x6312('0xb7')]){throw new db[(_0x6312('0x83'))][(_0x6312('0xb8'))](_0x6312('0xb9'));}}return _0x39b9fb;})['then'](function(_0x3f5ee8){if(_0x3f5ee8){return _0x3f5ee8['update']({'closed':_0x3aa91e['body'][_0x6312('0xba')],'disposition':_0x3aa91e[_0x6312('0xb0')][_0x6312('0xbb')]})['then'](function(_0x17ba41){return _0x17ba41;});}})[_0x6312('0x31')](function(_0x153322){return respondWithRpcPromise(_0x6312('0xbc'),_0x6312('0xbd'),_0x3aa91e['body'],client9004);})['then'](respondWithResult(_0x4f9a41,null))[_0x6312('0xae')](handleError(_0x4f9a41,null));};exports['attachmentUpload']=function(_0x1c7820,_0x2f3324,_0x4ca3db){_0x1c7820[_0x6312('0xb0')][_0x6312('0x34')]=_0x1c7820[_0x6312('0xbe')]['originalname'];_0x1c7820['body']['basename']=_0x1c7820[_0x6312('0xbe')][_0x6312('0xbf')];_0x1c7820[_0x6312('0xb0')][_0x6312('0xc0')]=_0x1c7820[_0x6312('0xbe')][_0x6312('0xc1')];return db[_0x6312('0xc2')][_0x6312('0xaf')](_0x1c7820[_0x6312('0xb0')])['then'](respondWithResult(_0x2f3324,0xc9))[_0x6312('0xae')](handleError(_0x2f3324,null));};exports[_0x6312('0xc3')]=function(_0x275d66,_0xf1361a,_0x32f471){return db[_0x6312('0x37')][_0x6312('0xc4')]({'where':{'id':_0x275d66[_0x6312('0xaa')]['id']},'raw':!![]})[_0x6312('0x31')](handleEntityNotFound(_0xf1361a,null))[_0x6312('0x31')](function(_0x503d13){if(_0x503d13){if(_0x503d13[_0x6312('0xba')]){return _0xf1361a[_0x6312('0x29')](0x193)[_0x6312('0x2b')]({'status':0x193,'message':_0x6312('0xc5')});}return db['Attachment'][_0x6312('0xc4')]({'where':{'id':_0x275d66[_0x6312('0x3a')]['attachId']},'raw':!![]})[_0x6312('0x31')](handleEntityNotFound(_0xf1361a,null));}})[_0x6312('0x31')](function(_0x21678f){if(_0x21678f){return _0xf1361a[_0x6312('0xc6')](path['join'](config[_0x6312('0xc7')],_0x6312('0xc8'),_0x21678f[_0x6312('0xc9')]));}})[_0x6312('0xae')](handleError(_0xf1361a,null));};exports[_0x6312('0xca')]=function(_0x135f78,_0x25c5c2){var _0x4c3525=null;var _0x17844b=null;var _0x4a3807=null;var _0x2907be=null;if(_0x135f78[_0x6312('0xb0')]['id']){delete _0x135f78['body']['id'];}if(_0x135f78['body'][_0x6312('0xcb')]){_0x2907be=path[_0x6312('0x7f')](config[_0x6312('0xc7')],'server/files/chat/upload/',util['format'](_0x6312('0xcc'),Date[_0x6312('0xcd')]()));_0x135f78['body']['pathTranscript']=_0x2907be;}return db[_0x6312('0x37')]['find']({'where':{'id':_0x135f78[_0x6312('0xaa')]['id']},'include':[{'model':db[_0x6312('0xce')],'as':_0x6312('0xcf'),'include':[{'model':db[_0x6312('0xd0')],'as':_0x6312('0xd0')}]}]})['then'](handleEntityNotFound(_0x25c5c2,null))['then'](saveUpdates(_0x135f78['body'],null))[_0x6312('0x31')](function(_0x18130d){if(_0x18130d){_0x4c3525=_0x18130d;return db[_0x6312('0xd1')][_0x6312('0xb2')]({'where':{'id':_0x4c3525[_0x6312('0x73')]}});}})['then'](function(_0x5bc0bb){if(_0x5bc0bb){_0x4a3807=_0x5bc0bb;return db[_0x6312('0xd2')][_0x6312('0xb2')]({'where':{'id':_0x4c3525['ContactId']}});}})['then'](function(_0x15c2d1){if(_0x15c2d1){_0x17844b=_0x15c2d1;if(_0x2907be){var _0x540e2e=null;for(var _0x37971d=0x1;_0x37971d<_0x4c3525[_0x6312('0xcf')][_0x6312('0x3d')];++_0x37971d){_0x540e2e=_0x4c3525[_0x6312('0xcf')][_0x37971d];var _0xee1715=_0x540e2e[_0x6312('0xb7')]?util[_0x6312('0x5e')]('%s%d',_0x4a3807[_0x6312('0xd3')],_0x540e2e[_0x6312('0xb7')]):'System';var _0x3e4715=_0x135f78[_0x6312('0xb0')][_0x6312('0xd4')]||util['format'](_0x6312('0xd5'),_0x6312('0xd6'),_0x540e2e[_0x6312('0x66')]);switch(_0x4a3807['agentIdentifier']){case _0x6312('0xd7'):_0xee1715=_0x540e2e[_0x6312('0xb7')]?util[_0x6312('0x5e')](_0x6312('0xd5'),_0x4a3807[_0x6312('0xd3')],_0x540e2e[_0x6312('0xb7')]):_0x6312('0xd8');break;case _0x6312('0xd9'):_0xee1715=_0x540e2e[_0x6312('0xb7')]?_0x540e2e['User']['alias']||_0x540e2e['User'][_0x6312('0xda')]:_0x6312('0xd8');break;case _0x6312('0xdb'):_0xee1715=_0x540e2e['UserId']?_0x540e2e['User'][_0x6312('0xda')]:'System';break;default:_0xee1715=_0x540e2e[_0x6312('0xb7')]?util[_0x6312('0x5e')]('%s%d',_0x4a3807[_0x6312('0xd3')],_0x540e2e[_0x6312('0xb7')]):_0x6312('0xd8');}var _0x4ce86d=util[_0x6312('0x5e')](_0x6312('0xdc'),moment(_0x540e2e[_0x6312('0x76')])[_0x6312('0x5e')]('MM/DD/YYYY\x20HH:mm:ss'),_0x540e2e[_0x6312('0xdd')]==='in'?_0x3e4715:_0xee1715,_0x540e2e['body']);if(!_0x540e2e[_0x6312('0xde')]){fs['appendFileSync'](_0x2907be,_0x4ce86d);}}return db[_0x6312('0xdf')][_0x6312('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6312('0xe0'),'raw':!![]}]});}}})[_0x6312('0x31')](function(_0x120ee0){if(_0x120ee0&&_0x120ee0[_0x6312('0xe0')]&&_0x135f78[_0x6312('0xb0')]){var _0x24c4ce={'tls':{'rejectUnauthorized':![]}};if(_0x120ee0[_0x6312('0xe0')][_0x6312('0xe1')]){_0x24c4ce[_0x6312('0xe1')]=_0x120ee0[_0x6312('0xe0')][_0x6312('0xe1')];}else{_0x24c4ce['host']=_0x120ee0[_0x6312('0xe0')][_0x6312('0xe2')];_0x24c4ce[_0x6312('0xe3')]=_0x120ee0[_0x6312('0xe0')][_0x6312('0xe3')];_0x24c4ce[_0x6312('0xe4')]=_0x120ee0[_0x6312('0xe0')][_0x6312('0xe4')];}if(_0x120ee0[_0x6312('0xe0')]['authentication']){_0x24c4ce['auth']={'user':_0x120ee0[_0x6312('0xe0')][_0x6312('0xe5')],'pass':_0x120ee0[_0x6312('0xe0')][_0x6312('0xe6')]};}return respondWithRpcPromise('SendMail',_0x6312('0xe7'),{'account':_0x24c4ce,'message':{'from':util[_0x6312('0x5e')]('\x22%s\x22\x20<%s>',_0x120ee0['name'],_0x120ee0[_0x6312('0xe8')]||_0x120ee0[_0x6312('0xe0')][_0x6312('0xe5')]),'to':_0x135f78[_0x6312('0xb0')][_0x6312('0xcb')],'subject':_0x6312('0xe9'),'text':util[_0x6312('0x5e')](_0x6312('0xea'),_0x135f78[_0x6312('0xb0')][_0x6312('0xcb')]),'attachments':[{'path':_0x2907be}]}})[_0x6312('0x31')](function(){return _0x4c3525;})[_0x6312('0xae')](function(_0x8f1695){console[_0x6312('0x25')](_0x8f1695);});}else{return _0x4c3525;}})[_0x6312('0x31')](respondWithStatusCode(_0x25c5c2,0xc8))[_0x6312('0xae')](handleError(_0x25c5c2,null));};exports['addMessage']=function(_0x56f0ac,_0x5b6320,_0x2dcd87){return db[_0x6312('0xce')][_0x6312('0xb2')]({'where':{'id':_0x56f0ac[_0x6312('0xaa')]['id']}})['then'](handleEntityNotFound(_0x5b6320,null))['then'](function(_0x5a143c){if(_0x5a143c){return _0x5a143c[_0x6312('0xeb')](_0x56f0ac[_0x6312('0xb0')][_0x6312('0xec')],_[_0x6312('0xed')](_0x56f0ac['body'],[_0x6312('0xec'),'id'])||{});}})['then'](respondWithResult(_0x5b6320,null))[_0x6312('0xae')](handleError(_0x5b6320,null));};exports[_0x6312('0xee')]=function(_0x6d1c4e,_0x51e6e4,_0x7ef9c9){var _0x207a65={'raw':![],'where':{}};var _0x27be6e={};var _0x169522={'count':0x0,'rows':[]};return db[_0x6312('0x37')]['findOne']({'where':{'id':_0x6d1c4e[_0x6312('0xaa')]['id']}})[_0x6312('0x31')](handleEntityNotFound(_0x51e6e4,null))[_0x6312('0x31')](function(_0xa67a84){if(_0xa67a84){_0x27be6e[_0x6312('0x39')]=_[_0x6312('0x3b')](db[_0x6312('0xce')][_0x6312('0x38')]);_0x27be6e[_0x6312('0x3a')]=_[_0x6312('0x3b')](_0x6d1c4e[_0x6312('0x3a')]);_0x27be6e[_0x6312('0x43')]=_[_0x6312('0xab')](_0x27be6e[_0x6312('0x39')],_0x27be6e[_0x6312('0x3a')]);_0x207a65[_0x6312('0x3c')]=_[_0x6312('0xab')](_0x27be6e[_0x6312('0x39')],qs['fields'](_0x6d1c4e[_0x6312('0x3a')]['fields']));_0x207a65['attributes']=_0x207a65[_0x6312('0x3c')][_0x6312('0x3d')]?_0x207a65['attributes']:_0x27be6e['model'];if(!_0x6d1c4e['query'][_0x6312('0x3e')](_0x6312('0x3f'))){_0x207a65['limit']=qs[_0x6312('0x2e')](_0x6d1c4e[_0x6312('0x3a')]['limit']);_0x207a65[_0x6312('0x2d')]=qs[_0x6312('0x2d')](_0x6d1c4e[_0x6312('0x3a')][_0x6312('0x2d')]);}_0x207a65['order']=qs[_0x6312('0x41')](_0x6d1c4e[_0x6312('0x3a')][_0x6312('0x41')]);_0x207a65[_0x6312('0x4a')]=qs['filters'](_[_0x6312('0x42')](_0x6d1c4e[_0x6312('0x3a')],_0x27be6e['filters']));_0x207a65['where'][_0x6312('0xa4')]=_0xa67a84['id'];if(_0x6d1c4e[_0x6312('0x3a')]['filter']){_0x207a65['where']=_[_0x6312('0x93')](_0x207a65[_0x6312('0x4a')],{'$or':_[_0x6312('0x6f')](_0x207a65['attributes'],function(_0x3e67a4){var _0x541a5d={};_0x541a5d[_0x3e67a4]={'$like':'%'+_0x6d1c4e['query']['filter']+'%'};return _0x541a5d;})});}if(_0x6d1c4e['query'][_0x6312('0x78')]){var _0xdbaf9a=_0x6d1c4e[_0x6312('0x3a')][_0x6312('0x78')]['split'](',');var _0x49f76c={};_0x49f76c[_0xdbaf9a[0x0]]={'$gte':moment(_0xdbaf9a[0x1])['format'](_0x6312('0xef'))};_0x207a65[_0x6312('0x4a')]=_[_0x6312('0x93')](_0x207a65['where'],_0x49f76c);}_0x207a65=_['merge']({},_0x207a65,_0x6d1c4e[_0x6312('0xad')]);return db[_0x6312('0xce')][_0x6312('0x2c')]({'where':_0x207a65[_0x6312('0x4a')]})[_0x6312('0x31')](function(_0x5b8e37){_0x169522[_0x6312('0x2c')]=_0x5b8e37;if(_0x6d1c4e[_0x6312('0x3a')]['includeAll']){_0x207a65[_0x6312('0xf0')]=[{'all':!![]}];}return db[_0x6312('0xce')][_0x6312('0xf1')](_0x207a65);})['then'](function(_0x3221f8){_0x169522[_0x6312('0xa8')]=_0x3221f8;return _0x169522;});}})[_0x6312('0x31')](respondWithFilteredResult(_0x51e6e4,_0x207a65))[_0x6312('0xae')](handleError(_0x51e6e4,null));};exports['getMyMessages']=function(_0x101325,_0x3d7955,_0xaf71b3){var _0x383022={'where':{}},_0xdd970e={},_0x509144={'count':0x0,'rows':[]};return db[_0x6312('0x37')][_0x6312('0xc4')]({'where':{'id':_0x101325[_0x6312('0xaa')]['id']}})['then'](handleEntityNotFound(_0x3d7955,null))[_0x6312('0x31')](function(_0xfbf050){if(_0xfbf050){_0xdd970e[_0x6312('0x39')]=_[_0x6312('0x3b')](db[_0x6312('0xce')]['rawAttributes']);_0xdd970e['query']=_[_0x6312('0x3b')](_0x101325[_0x6312('0x3a')]);_0xdd970e['filters']=_['intersection'](_0xdd970e[_0x6312('0x39')],_0xdd970e[_0x6312('0x3a')]);_0x383022[_0x6312('0x3c')]=_[_0x6312('0xab')](_0xdd970e[_0x6312('0x39')],qs[_0x6312('0xac')](_0x101325[_0x6312('0x3a')][_0x6312('0xac')]));_0x383022['attributes']=_0x383022[_0x6312('0x3c')][_0x6312('0x3d')]?_0x383022[_0x6312('0x3c')]:_0xdd970e[_0x6312('0x39')];if(!_0x101325[_0x6312('0x3a')]['hasOwnProperty'](_0x6312('0x3f'))){_0x383022['limit']=qs[_0x6312('0x2e')](_0x101325['query'][_0x6312('0x2e')]);_0x383022[_0x6312('0x2d')]=qs[_0x6312('0x2d')](_0x101325[_0x6312('0x3a')][_0x6312('0x2d')]);}_0x383022[_0x6312('0x40')]=qs[_0x6312('0x41')](_0x101325['query'][_0x6312('0x41')]);_0x383022['where']=qs['filters'](_[_0x6312('0x42')](_0x101325[_0x6312('0x3a')],_0xdd970e['filters']));_0x383022['where'][_0x6312('0xa4')]=_0xfbf050['id'];if(_0x101325['query'][_0x6312('0x70')]){_0x383022[_0x6312('0x4a')]=_['merge'](_0x383022[_0x6312('0x4a')],{'$or':_[_0x6312('0x6f')](_0x383022[_0x6312('0x3c')],function(_0x2bb0ba){var _0x4086c0={};_0x4086c0[_0x2bb0ba]={'$like':'%'+_0x101325['query']['filter']+'%'};return _0x4086c0;})});}_0x383022[_0x6312('0x4a')][_0x6312('0xde')]=![];if(_0x101325[_0x6312('0x3a')]['id']){_0x383022['where']['id']={'$gt':_0x101325[_0x6312('0x3a')]['id']};}_0x383022=_[_0x6312('0x93')]({},_0x383022,_0x101325[_0x6312('0xad')]);return db[_0x6312('0xce')][_0x6312('0x2c')]({'where':_0x383022['where']})[_0x6312('0x31')](function(_0x49421f){_0x509144[_0x6312('0x2c')]=_0x49421f;_0x383022['include']=[];if(_0x101325[_0x6312('0x3a')]['includeAgent']){_0x383022[_0x6312('0xf0')]['push']({'model':db[_0x6312('0xd0')],'as':_0x6312('0xd0'),'attributes':['id','fullname',_0x6312('0xf2')]});}if(_0x101325[_0x6312('0x3a')][_0x6312('0xf3')]){_0x383022[_0x6312('0xf0')]=[{'all':!![]}];}return db[_0x6312('0xce')][_0x6312('0xf1')](_0x383022);})['then'](function(_0x26bd9f){_0x509144[_0x6312('0xa8')]=_0x26bd9f;return _0x509144;});}})['then'](respondWithFilteredResult(_0x3d7955,_0x383022))[_0x6312('0xae')](handleError(_0x3d7955,null));};exports[_0x6312('0xf4')]=function(_0x400c5b,_0x27c4db,_0x3a5a83){return db['ChatInteraction'][_0x6312('0xb2')]({'where':{'id':_0x400c5b[_0x6312('0xaa')]['id']}})[_0x6312('0x31')](handleEntityNotFound(_0x27c4db,null))[_0x6312('0x31')](function(_0x564971){if(_0x564971){return _0x564971['setTags'](_0x400c5b[_0x6312('0xb0')][_0x6312('0xec')],_[_0x6312('0xed')](_0x400c5b['body'],[_0x6312('0xec'),'id'])||{})[_0x6312('0xf5')](function(){return db['Tag'][_0x6312('0xf1')]({'attributes':['id',_0x6312('0x34'),_0x6312('0x46')],'where':{'id':_0x400c5b[_0x6312('0xb0')]['ids']}});})[_0x6312('0x31')](function(_0x413253){socket[_0x6312('0xf6')](_0x6312('0xf7'),{'id':Number(_0x400c5b[_0x6312('0xaa')]['id']),'tags':_0x413253||[]});return{'id':Number(_0x400c5b['params']['id']),'tags':_0x413253||[]};});}})['then'](respondWithResult(_0x27c4db,null))[_0x6312('0xae')](handleError(_0x27c4db,null));};exports[_0x6312('0xf8')]=function(_0x497f69,_0x1d8f26,_0x2ee006){return db[_0x6312('0x37')][_0x6312('0xb2')]({'where':{'id':_0x497f69[_0x6312('0xaa')]['id']}})[_0x6312('0x31')](handleEntityNotFound(_0x1d8f26,null))[_0x6312('0x31')](function(_0x163560){if(_0x163560){return _0x163560[_0x6312('0xf8')](_0x497f69[_0x6312('0x3a')]['ids']);}})[_0x6312('0x31')](respondWithStatusCode(_0x1d8f26,null))[_0x6312('0xae')](handleError(_0x1d8f26,null));};exports['download']=function(_0x3ff48e,_0x587cc9){var _0x268b2a=moment()[_0x6312('0xf9')]()[_0x6312('0x7e')]();var _0x4a37b8=path[_0x6312('0x7f')](config[_0x6312('0xc7')],'server','files',_0x6312('0xfa'));var _0xce59f8=path[_0x6312('0x7f')](config[_0x6312('0xc7')],_0x6312('0xfb'),_0x6312('0xfc'),'attachments');var _0x258135=path[_0x6312('0x7f')](_0x4a37b8,_0x268b2a);var _0x4095ed=util[_0x6312('0x5e')](_0x6312('0xfd'),_0x3ff48e['params']['id'],_0x268b2a);var _0x36a6b0=path[_0x6312('0x7f')](_0x4a37b8,_0x4095ed);var _0x59015d=![];return db[_0x6312('0x37')][_0x6312('0xb2')]({'where':{'id':_0x3ff48e[_0x6312('0xaa')]['id']},'include':[{'model':db[_0x6312('0xce')],'as':_0x6312('0xcf'),'attributes':['id',_0x6312('0xb0'),'createdAt','direction',_0x6312('0xde')],'include':[{'model':db[_0x6312('0xd0')],'as':'User','attributes':['id',_0x6312('0xda')],'raw':!![]},{'model':db[_0x6312('0xd2')],'as':'Contact','attributes':['id',_0x6312('0xfe'),'lastName'],'raw':!![]},{'model':db[_0x6312('0xc2')],'as':_0x6312('0xc2'),'raw':!![]}]},{'model':db[_0x6312('0xd1')],'as':'Account','attributes':['id',_0x6312('0x34')]},{'model':db['User'],'as':_0x6312('0xff'),'attributes':['id',_0x6312('0xda')]}]})[_0x6312('0x31')](handleEntityNotFound(_0x587cc9,null))['then'](function(_0x1cb32a){if(_0x1cb32a){var _0x54cc5c=_0x1cb32a[_0x6312('0x100')]({'plain':!![]});_0x59015d=!![];var _0x5c2b13={'format':'A4','border':_0x6312('0x101'),'header':{'height':_0x6312('0x102'),'contents':{'first':_0x6312('0x103')}},'footer':{'height':_0x6312('0x104'),'contents':{'default':util[_0x6312('0x5e')](_0x6312('0x105'),util[_0x6312('0x5e')]('%s\x20#%d','Chat',_0x54cc5c['id']),moment()[_0x6312('0x5e')](_0x6312('0x106'))['toString']())}}};fs[_0x6312('0x107')](_0x258135);var _0x117b0d={'channel':_0x6312('0x108'),'account':_0x54cc5c[_0x6312('0x109')]['name'],'agent':_0x54cc5c[_0x6312('0xff')]?_0x54cc5c[_0x6312('0xff')][_0x6312('0xda')]:_0x6312('0x10a'),'createdAt':moment(_0x54cc5c[_0x6312('0x76')])[_0x6312('0x5e')](_0x6312('0xef'))['toString'](),'closedAt':_0x54cc5c['closed']?moment(_0x54cc5c['closedAt'])['format'](_0x6312('0xef'))['toString']():'','disposition':_0x54cc5c[_0x6312('0xbb')],'chatInfo':{'browser':_0x54cc5c['browserName'],'os':_0x54cc5c[_0x6312('0x10b')],'referer':_0x54cc5c[_0x6312('0x10c')],'customerIp':_0x54cc5c['customerIp']},'messages':_(_0x54cc5c['Messages'])[_0x6312('0x10d')]()['filter']({'secret':![]})[_0x6312('0x6f')](function(_0x1a6ab5){if(_0x1a6ab5['Attachment']){var _0x1c62e2=path[_0x6312('0x7f')](_0xce59f8,_0x1a6ab5['Attachment'][_0x6312('0xc9')]);if(fs[_0x6312('0x10e')](_0x1c62e2)){fs[_0x6312('0x10f')](_0x1c62e2)['pipe'](fs[_0x6312('0x110')](path[_0x6312('0x7f')](_0x258135,_0x1a6ab5['Attachment']['basename'])));}}return{'date':moment(_0x1a6ab5[_0x6312('0x76')])[_0x6312('0x5e')](_0x6312('0xef'))['toString'](),'sender':_0x1a6ab5[_0x6312('0xdd')]===_0x6312('0x111')?_0x1a6ab5[_0x6312('0xd0')]?_0x1a6ab5[_0x6312('0xd0')][_0x6312('0xda')]:_0x6312('0xd8'):_0x1a6ab5[_0x6312('0x112')][_0x6312('0xfe')]+(_0x1a6ab5['Contact']['lastName']?'\x20'+_0x1a6ab5[_0x6312('0x112')][_0x6312('0x113')]:''),'body':_0x1a6ab5[_0x6312('0xc2')]?_0x1a6ab5[_0x6312('0xc2')][_0x6312('0xc9')]:_0x1a6ab5[_0x6312('0xb0')],'direction':_0x1a6ab5['direction']===_0x6312('0x111')?'A':'C','secret':_0x1a6ab5[_0x6312('0xde')],'attachment':_0x1a6ab5[_0x6312('0xc2')]};})[_0x6312('0x59')]()};return ejs[_0x6312('0x114')](path[_0x6312('0x7f')](config[_0x6312('0xc7')],_0x6312('0xfb'),_0x6312('0x115'),_0x6312('0x116')),{'interaction':_0x117b0d})[_0x6312('0x31')](function(_0x1b3c66){return new BPromise(function(_0x22929c,_0xd291ad){pdf[_0x6312('0xaf')](_0x1b3c66,_0x5c2b13)[_0x6312('0x117')](path[_0x6312('0x7f')](_0x258135,_0x6312('0x118')+_0x54cc5c['id']+'-'+_0x268b2a+_0x6312('0x119')),function(_0x42995a,_0x39ed73){if(_0x42995a)return _0xd291ad(_0x42995a);_0x22929c(_0x39ed73);});});});}})['then'](function(){if(_0x59015d){return new BPromise(function(_0x408d72,_0x3f2829){zipdir(_0x258135,{'saveTo':_0x36a6b0},function(_0x4b210d,_0x212ea8){if(_0x4b210d)return _0x3f2829(_0x4b210d);return _0x408d72(_0x212ea8);});})[_0x6312('0x31')](function(){return new BPromise(function(_0x5ba5c8,_0x55fca8){rimraf(_0x258135,function(_0x3dc60b){if(_0x3dc60b)_0x55fca8(_0x3dc60b);return _0x5ba5c8();});});})['then'](function(){return _0x587cc9['download'](_0x36a6b0,_0x4095ed,function(_0x2a68ac){if(_0x2a68ac){console[_0x6312('0x11a')](_0x6312('0x11b'),_0x2a68ac);}else{fs['unlinkSync'](_0x36a6b0);}});});}else{return _0x587cc9[_0x6312('0x33')](0xc8);}})[_0x6312('0xae')](handleError(_0x587cc9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index b9ffff9..b8ce70c 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 _0xc264=['remove','hasOwnProperty','exports','ChatInteraction','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc264,0xe1));var _0x4c26=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xc264[_0x199c03];return _0x11a7d4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x4c26('0x0')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c26('0x1'),'afterUpdate':_0x4c26('0x2'),'afterDestroy':_0x4c26('0x3')};function emitEvent(_0x34840b){return function(_0x43e6a1,_0x2daba5,_0xcf8708){ChatInteractionEvents['emit'](_0x34840b+':'+_0x43e6a1['id'],_0x43e6a1);ChatInteractionEvents['emit'](_0x34840b,_0x43e6a1);_0xcf8708(null);};}for(var e in events){if(events[_0x4c26('0x4')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x4c26('0x5')]=ChatInteractionEvents; \ No newline at end of file +var _0x21f2=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x470ff9,_0x3fb3dd){var _0x4d1a0d=function(_0x717ed4){while(--_0x717ed4){_0x470ff9['push'](_0x470ff9['shift']());}};_0x4d1a0d(++_0x3fb3dd);}(_0x21f2,0x1e3));var _0x221f=function(_0x1c2c1f,_0x23881c){_0x1c2c1f=_0x1c2c1f-0x0;var _0x3bbfba=_0x21f2[_0x1c2c1f];return _0x3bbfba;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x221f('0x0'))['db']['ChatInteraction'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x221f('0x1')](0x0);var events={'afterCreate':_0x221f('0x2'),'afterUpdate':_0x221f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x46c4ba){return function(_0x146bdb,_0x1e992d,_0x2a9af7){ChatInteractionEvents[_0x221f('0x4')](_0x46c4ba+':'+_0x146bdb['id'],_0x146bdb);ChatInteractionEvents[_0x221f('0x4')](_0x46c4ba,_0x146bdb);_0x2a9af7(null);};}for(var e in events){if(events[_0x221f('0x5')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x221f('0x6')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index bdf5364..4e9cbf1 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xe706,0xa3));var _0x6e70=function(_0x30ebff,_0x434cc4){_0x30ebff=_0x30ebff-0x0;var _0x421101=_0xe706[_0x30ebff];return _0x421101;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x188ed3,_0x3c4843,_0x449b48){if(_0x188ed3[_0x6e70('0xe')](_0x6e70('0xf'))){_0x188ed3[_0x6e70('0x10')]=moment()[_0x6e70('0x11')](_0x6e70('0x12'));}_0x449b48(null,_0x188ed3);}},'charset':_0x6e70('0x13'),'collate':_0x6e70('0x14')});}; \ No newline at end of file +var _0x8603=['rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path'];(function(_0x54e01a,_0x51b796){var _0x3ca62c=function(_0x3ce501){while(--_0x3ce501){_0x54e01a['push'](_0x54e01a['shift']());}};_0x3ca62c(++_0x51b796);}(_0x8603,0x190));var _0x3860=function(_0x52ab89,_0x58a774){_0x52ab89=_0x52ab89-0x0;var _0x5e689d=_0x8603[_0x52ab89];return _0x5e689d;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4aba10,_0x5c7350,_0x5b1ac8){if(_0x4aba10[_0x3860('0xa')](_0x3860('0xb'))){_0x4aba10['closedAt']=moment()[_0x3860('0xc')](_0x3860('0xd'));}_0x5b1ac8(null,_0x4aba10);}},'charset':'utf8mb4','collate':_0x3860('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ed33b9d..b2415ed 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 _0x9c0d=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','update','options','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','then','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0xf66a25,_0x527689){var _0x231422=function(_0x164b05){while(--_0x164b05){_0xf66a25['push'](_0xf66a25['shift']());}};_0x231422(++_0x527689);}(_0x9c0d,0x128));var _0xd9c0=function(_0xe091a,_0x2430bf){_0xe091a=_0xe091a-0x0;var _0x59bd7b=_0x9c0d[_0xe091a];return _0x59bd7b;};'use strict';var _=require(_0xd9c0('0x0'));var util=require(_0xd9c0('0x1'));var moment=require(_0xd9c0('0x2'));var BPromise=require(_0xd9c0('0x3'));var rs=require(_0xd9c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9c0('0x5'))['db'];var utils=require(_0xd9c0('0x6'));var logger=require(_0xd9c0('0x7'))('rpc');var config=require(_0xd9c0('0x8'));var jayson=require(_0xd9c0('0x9'));var client=jayson[_0xd9c0('0xa')][_0xd9c0('0xb')]({'port':0x232a});config[_0xd9c0('0xc')]=_[_0xd9c0('0xd')](config[_0xd9c0('0xc')],{'host':_0xd9c0('0xe'),'port':0x18eb});var socket=require(_0xd9c0('0xf'))(new Redis(config['redis']));require(_0xd9c0('0x10'))[_0xd9c0('0x11')](socket);function respondWithRpcPromise(_0x48e961,_0x58ab6e,_0x4a8df0){return new BPromise(function(_0x2e75c7,_0x4c9210){return client[_0xd9c0('0x12')](_0x48e961,_0x4a8df0)['then'](function(_0x56a269){logger[_0xd9c0('0x13')](_0xd9c0('0x14'),_0x58ab6e,_0xd9c0('0x15'));logger[_0xd9c0('0x16')](_0xd9c0('0x17'),_0x58ab6e,_0xd9c0('0x15'),JSON[_0xd9c0('0x18')](_0x56a269));if(_0x56a269[_0xd9c0('0x19')]){if(_0x56a269[_0xd9c0('0x19')]['code']===0x1f4){logger[_0xd9c0('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x58ab6e,_0x56a269[_0xd9c0('0x19')][_0xd9c0('0x1a')]);return _0x4c9210(_0x56a269[_0xd9c0('0x19')][_0xd9c0('0x1a')]);}logger[_0xd9c0('0x19')](_0xd9c0('0x14'),_0x58ab6e,_0x56a269[_0xd9c0('0x19')][_0xd9c0('0x1a')]);return _0x2e75c7(_0x56a269[_0xd9c0('0x19')][_0xd9c0('0x1a')]);}else{logger[_0xd9c0('0x13')](_0xd9c0('0x14'),_0x58ab6e,_0xd9c0('0x15'));_0x2e75c7(_0x56a269[_0xd9c0('0x1b')][_0xd9c0('0x1a')]);}})[_0xd9c0('0x1c')](function(_0x470444){logger[_0xd9c0('0x19')](_0xd9c0('0x14'),_0x58ab6e,_0x470444);_0x4c9210(_0x470444);});});}exports[_0xd9c0('0x1d')]=function(_0x299ba9){var _0x42adda=this;return new Promise(function(_0x31a923,_0xa6d58c){return db['ChatInteraction'][_0xd9c0('0x1e')](_0x299ba9['body'],{'raw':_0x299ba9[_0xd9c0('0x1f')]?_0x299ba9[_0xd9c0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x299ba9[_0xd9c0('0x1f')]?_0x299ba9['options'][_0xd9c0('0x20')]||null:null,'attributes':_0x299ba9['options']?_0x299ba9['options'][_0xd9c0('0x21')]||null:null,'limit':_0x299ba9[_0xd9c0('0x1f')]?_0x299ba9[_0xd9c0('0x1f')][_0xd9c0('0x22')]||null:null})['then'](function(_0x1f199f){logger['info'](_0xd9c0('0x1d'),_0x299ba9);logger['debug'](_0xd9c0('0x1d'),_0x299ba9,JSON[_0xd9c0('0x18')](_0x1f199f));_0x31a923(_0x1f199f);})['catch'](function(_0x122f37){logger[_0xd9c0('0x19')]('UpdateChatInteraction',_0x122f37['message'],_0x299ba9);_0xa6d58c(_0x42adda['error'](0x1f4,_0x122f37[_0xd9c0('0x1a')]));});});};exports[_0xd9c0('0x23')]=function(_0xb1a0a7){return new Promise(function(_0x42870d,_0xcb05e8){return db[_0xd9c0('0x24')][_0xd9c0('0x25')]({'where':_0xb1a0a7[_0xd9c0('0x1f')]?_0xb1a0a7[_0xd9c0('0x1f')]['where']||null:null})[_0xd9c0('0x26')](function(_0x8b452b){if(_0x8b452b){return _0x8b452b[_0xd9c0('0x27')](_0xb1a0a7[_0xd9c0('0x28')][_0xd9c0('0x29')],_[_0xd9c0('0x2a')](_0xb1a0a7[_0xd9c0('0x28')],[_0xd9c0('0x29'),'id'])||{});}})[_0xd9c0('0x2b')](function(_0x472496){logger[_0xd9c0('0x13')](_0xd9c0('0x2c'),_0xb1a0a7);logger[_0xd9c0('0x16')](_0xd9c0('0x2c'),_0xb1a0a7,JSON[_0xd9c0('0x18')](_0x472496));_0x42870d(_0x472496);})[_0xd9c0('0x1c')](function(_0x513046){logger[_0xd9c0('0x19')](_0xd9c0('0x2c'),_0x513046['message'],_0xb1a0a7);_0xcb05e8(_this[_0xd9c0('0x19')](0x1f4,_0x513046[_0xd9c0('0x1a')]));});});}; \ No newline at end of file +var _0x8fb1=['http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','debug','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8fb1,0x171));var _0x18fb=function(_0x3a4586,_0x189ab7){_0x3a4586=_0x3a4586-0x0;var _0x539603=_0x8fb1[_0x3a4586];return _0x539603;};'use strict';var _=require(_0x18fb('0x0'));var util=require(_0x18fb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x18fb('0x2'));var fs=require('fs');var Redis=require(_0x18fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x18fb('0x4'))(_0x18fb('0x5'));var config=require(_0x18fb('0x6'));var jayson=require(_0x18fb('0x7'));var client=jayson[_0x18fb('0x8')][_0x18fb('0x9')]({'port':0x232a});config[_0x18fb('0xa')]=_[_0x18fb('0xb')](config[_0x18fb('0xa')],{'host':_0x18fb('0xc'),'port':0x18eb});var socket=require(_0x18fb('0xd'))(new Redis(config[_0x18fb('0xa')]));require(_0x18fb('0xe'))[_0x18fb('0xf')](socket);function respondWithRpcPromise(_0x2ee669,_0x32a671,_0x15010e){return new BPromise(function(_0x53f5ec,_0x881977){return client[_0x18fb('0x10')](_0x2ee669,_0x15010e)['then'](function(_0x488bab){logger[_0x18fb('0x11')](_0x18fb('0x12'),_0x32a671,_0x18fb('0x13'));logger['debug'](_0x18fb('0x14'),_0x32a671,_0x18fb('0x13'),JSON[_0x18fb('0x15')](_0x488bab));if(_0x488bab[_0x18fb('0x16')]){if(_0x488bab['error']['code']===0x1f4){logger[_0x18fb('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x32a671,_0x488bab[_0x18fb('0x16')][_0x18fb('0x17')]);return _0x881977(_0x488bab[_0x18fb('0x16')]['message']);}logger[_0x18fb('0x16')](_0x18fb('0x12'),_0x32a671,_0x488bab[_0x18fb('0x16')]['message']);return _0x53f5ec(_0x488bab[_0x18fb('0x16')]['message']);}else{logger['info'](_0x18fb('0x12'),_0x32a671,_0x18fb('0x13'));_0x53f5ec(_0x488bab[_0x18fb('0x18')][_0x18fb('0x17')]);}})['catch'](function(_0x57dda8){logger['error'](_0x18fb('0x12'),_0x32a671,_0x57dda8);_0x881977(_0x57dda8);});});}exports[_0x18fb('0x19')]=function(_0x46c53c){var _0x83b0b7=this;return new Promise(function(_0x166194,_0x3f7874){return db[_0x18fb('0x1a')][_0x18fb('0x1b')](_0x46c53c[_0x18fb('0x1c')],{'raw':_0x46c53c[_0x18fb('0x1d')]?_0x46c53c[_0x18fb('0x1d')][_0x18fb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46c53c[_0x18fb('0x1d')]?_0x46c53c['options'][_0x18fb('0x1f')]||null:null,'attributes':_0x46c53c[_0x18fb('0x1d')]?_0x46c53c[_0x18fb('0x1d')][_0x18fb('0x20')]||null:null,'limit':_0x46c53c[_0x18fb('0x1d')]?_0x46c53c['options']['limit']||null:null})[_0x18fb('0x21')](function(_0x38f89e){logger[_0x18fb('0x11')]('UpdateChatInteraction',_0x46c53c);logger[_0x18fb('0x22')]('UpdateChatInteraction',_0x46c53c,JSON[_0x18fb('0x15')](_0x38f89e));_0x166194(_0x38f89e);})[_0x18fb('0x23')](function(_0x3eaa49){logger[_0x18fb('0x16')](_0x18fb('0x19'),_0x3eaa49['message'],_0x46c53c);_0x3f7874(_0x83b0b7[_0x18fb('0x16')](0x1f4,_0x3eaa49[_0x18fb('0x17')]));});});};exports[_0x18fb('0x24')]=function(_0x30ace0){return new Promise(function(_0x4c3694,_0x778e57){return db['ChatInteraction'][_0x18fb('0x25')]({'where':_0x30ace0[_0x18fb('0x1d')]?_0x30ace0[_0x18fb('0x1d')][_0x18fb('0x1f')]||null:null})[_0x18fb('0x21')](function(_0x196bd8){if(_0x196bd8){return _0x196bd8[_0x18fb('0x26')](_0x30ace0[_0x18fb('0x1c')][_0x18fb('0x27')],_[_0x18fb('0x28')](_0x30ace0[_0x18fb('0x1c')],[_0x18fb('0x27'),'id'])||{});}})['spread'](function(_0x1c2b35){logger[_0x18fb('0x11')](_0x18fb('0x29'),_0x30ace0);logger['debug'](_0x18fb('0x29'),_0x30ace0,JSON[_0x18fb('0x15')](_0x1c2b35));_0x4c3694(_0x1c2b35);})[_0x18fb('0x23')](function(_0x4d1472){logger['error'](_0x18fb('0x29'),_0x4d1472[_0x18fb('0x17')],_0x30ace0);_0x778e57(_this[_0x18fb('0x16')](0x1f4,_0x4d1472['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9cfaca8..523e0d5 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 _0xe809=['./chatInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe809,0xa1));var _0x9e80=function(_0x898e9c,_0x5d6336){_0x898e9c=_0x898e9c-0x0;var _0x3c4cc2=_0xe809[_0x898e9c];return _0x3c4cc2;};'use strict';var ChatInteractionEvents=require(_0x9e80('0x0'));var events=['save',_0x9e80('0x1'),_0x9e80('0x2')];function createListener(_0x5eabeb,_0x14707c){return function(_0x798271){_0x14707c[_0x9e80('0x3')](_0x5eabeb,_0x798271);};}function removeListener(_0x18458d,_0x4dc555){return function(){ChatInteractionEvents[_0x9e80('0x4')](_0x18458d,_0x4dc555);};}exports[_0x9e80('0x5')]=function(_0x5ab337){for(var _0x248609=0x0,_0x53cbad=events[_0x9e80('0x6')];_0x248609<_0x53cbad;_0x248609++){var _0x4c9d10=events[_0x248609];var _0x35dcb9=createListener('chatInteraction:'+_0x4c9d10,_0x5ab337);ChatInteractionEvents['on'](_0x4c9d10,_0x35dcb9);}}; \ No newline at end of file +var _0x809a=['./chatInteraction.events','save','remove','update','removeListener','chatInteraction:'];(function(_0x5eda7f,_0xec4a47){var _0x5b0679=function(_0x4cc91d){while(--_0x4cc91d){_0x5eda7f['push'](_0x5eda7f['shift']());}};_0x5b0679(++_0xec4a47);}(_0x809a,0x186));var _0xa809=function(_0x54d73b,_0x34fec1){_0x54d73b=_0x54d73b-0x0;var _0x551925=_0x809a[_0x54d73b];return _0x551925;};'use strict';var ChatInteractionEvents=require(_0xa809('0x0'));var events=[_0xa809('0x1'),_0xa809('0x2'),_0xa809('0x3')];function createListener(_0x162892,_0x4a33df){return function(_0x5ed68f){_0x4a33df['emit'](_0x162892,_0x5ed68f);};}function removeListener(_0x571022,_0x548fb6){return function(){ChatInteractionEvents[_0xa809('0x4')](_0x571022,_0x548fb6);};}exports['register']=function(_0x2c6237){for(var _0x4a161d=0x0,_0x1920ea=events['length'];_0x4a161d<_0x1920ea;_0x4a161d++){var _0x1458fe=events[_0x4a161d];var _0x4f1545=createListener(_0xa809('0x5')+_0x1458fe,_0x2c6237);ChatInteractionEvents['on'](_0x1458fe,_0x4f1545);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 48e1df0..a39d62e 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 _0x4fc2=['%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','addTags','tracked','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join','server/files/attachments/','format'];(function(_0x562513,_0xc33e89){var _0x34c279=function(_0x20716f){while(--_0x20716f){_0x562513['push'](_0x562513['shift']());}};_0x34c279(++_0xc33e89);}(_0x4fc2,0x111));var _0x24fc=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0x4fc2[_0x331298];return _0x3824bc;};'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('0xd')](),controller[_0x24fc('0xe')]);router['get'](_0x24fc('0xf'),auth[_0x24fc('0xd')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x8')](_0x24fc('0x11'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x12')]);router[_0x24fc('0x8')]('/:id/my_messages',auth[_0x24fc('0xd')](),controller[_0x24fc('0x13')]);router['get'](_0x24fc('0x14'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x16')]('/',auth[_0x24fc('0xa')](),controller[_0x24fc('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a0971,_0x18c0a7,_0x2ffed3){_0x2ffed3(null,path[_0x24fc('0x18')](config['root'],_0x24fc('0x19')));},'filename':function(_0x588543,_0x4af098,_0x3385c7){_0x3385c7(null,util[_0x24fc('0x1a')](_0x24fc('0x1b'),Date[_0x24fc('0x1c')](),_0x4af098['originalname'][_0x24fc('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x24fc('0x16')](_0x24fc('0x1e'),upload[_0x24fc('0x1f')]('file'),controller[_0x24fc('0x20')]);router[_0x24fc('0x16')](_0x24fc('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x24fc('0x21')]);router[_0x24fc('0x16')](_0x24fc('0x22'),auth[_0x24fc('0xa')](),interaction['tracked'](_0x24fc('0x23'),'chatinteraction:addtags'),controller[_0x24fc('0x24')]);router['put'](_0x24fc('0xc'),auth[_0x24fc('0xa')](),interaction[_0x24fc('0x25')]('chat',_0x24fc('0x26')),controller['update']);router[_0x24fc('0x27')](_0x24fc('0x28'),controller[_0x24fc('0x29')]);router[_0x24fc('0x27')](_0x24fc('0x2a'),auth[_0x24fc('0xd')](),controller[_0x24fc('0x2b')]);router[_0x24fc('0x27')](_0x24fc('0x2c'),controller[_0x24fc('0x2d')]);router['delete'](_0x24fc('0xc'),auth[_0x24fc('0xa')](),interaction[_0x24fc('0x25')]('chat',_0x24fc('0x2e')),controller[_0x24fc('0x2f')]);router[_0x24fc('0x30')](_0x24fc('0x22'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x31')]);module['exports']=router; \ No newline at end of file +var _0x3c81=['chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','close','delete','destroy','exports','multer','util','connect-timeout','express','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x3ba537,_0x56b969){var _0x585c1a=function(_0x1dd30b){while(--_0x1dd30b){_0x3ba537['push'](_0x3ba537['shift']());}};_0x585c1a(++_0x56b969);}(_0x3c81,0x102));var _0x13c8=function(_0x5b9bb5,_0x2764fa){_0x5b9bb5=_0x5b9bb5-0x0;var _0x48720e=_0x3c81[_0x5b9bb5];return _0x48720e;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13c8('0x4'));router[_0x13c8('0x5')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0x7')]);router[_0x13c8('0x5')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller['describe']);router[_0x13c8('0x5')]('/:id',auth[_0x13c8('0x9')](),controller[_0x13c8('0xa')]);router[_0x13c8('0x5')](_0x13c8('0xb'),auth[_0x13c8('0x9')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x5')](_0x13c8('0xd'),auth[_0x13c8('0x6')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x5')](_0x13c8('0xf'),auth[_0x13c8('0x9')](),controller[_0x13c8('0x10')]);router['get'](_0x13c8('0x11'),auth[_0x13c8('0x6')](),controller[_0x13c8('0x12')]);router[_0x13c8('0x13')]('/',auth['isAuthenticated'](),controller[_0x13c8('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d7a88,_0x589636,_0x126359){_0x126359(null,path['join'](config[_0x13c8('0x15')],_0x13c8('0x16')));},'filename':function(_0x23f64e,_0x7cbfb,_0x5d7906){_0x5d7906(null,util[_0x13c8('0x17')](_0x13c8('0x18'),Date[_0x13c8('0x19')](),_0x7cbfb[_0x13c8('0x1a')][_0x13c8('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x13c8('0x13')](_0x13c8('0x1c'),upload[_0x13c8('0x1d')](_0x13c8('0x1e')),controller[_0x13c8('0x1f')]);router[_0x13c8('0x13')]('/:id/messages',auth[_0x13c8('0x9')](),controller[_0x13c8('0x20')]);router[_0x13c8('0x13')](_0x13c8('0x21'),auth['isAuthenticated'](),interaction[_0x13c8('0x22')](_0x13c8('0x23'),_0x13c8('0x24')),controller[_0x13c8('0x25')]);router[_0x13c8('0x26')](_0x13c8('0x27'),auth['isAuthenticated'](),interaction[_0x13c8('0x22')](_0x13c8('0x23'),_0x13c8('0x28')),controller[_0x13c8('0x29')]);router['put'](_0x13c8('0x2a'),controller[_0x13c8('0x2b')]);router['put']('/:id/abandon',auth[_0x13c8('0x9')](),controller[_0x13c8('0x2c')]);router['put']('/:id/close',controller[_0x13c8('0x2d')]);router[_0x13c8('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0x13c8('0x22')]('chat','chatinteraction:destroy'),controller[_0x13c8('0x2f')]);router[_0x13c8('0x2e')](_0x13c8('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0x13c8('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 8e231a0..0b8a932 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 _0x6931=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x17658d,_0x929205){var _0x13112b=function(_0x156c33){while(--_0x156c33){_0x17658d['push'](_0x17658d['shift']());}};_0x13112b(++_0x929205);}(_0x6931,0x1a9));var _0x1693=function(_0x277be6,_0x533aea){_0x277be6=_0x277be6-0x0;var _0xbb733c=_0x6931[_0x277be6];return _0xbb733c;};'use strict';var Sequelize=require(_0x1693('0x0'));module[_0x1693('0x1')]={'body':{'type':Sequelize[_0x1693('0x2')](_0x1693('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1693('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1693('0x5')]}}; \ No newline at end of file +var _0x7e27=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x395f05,_0x39c8cd){var _0x206933=function(_0x24973c){while(--_0x24973c){_0x395f05['push'](_0x395f05['shift']());}};_0x206933(++_0x39c8cd);}(_0x7e27,0xdd));var _0x77e2=function(_0x2974e4,_0x2029b0){_0x2974e4=_0x2974e4-0x0;var _0x241980=_0x7e27[_0x2974e4];return _0x241980;};'use strict';var Sequelize=require(_0x77e2('0x0'));module[_0x77e2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x77e2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x77e2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x77e2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a794dce..9d2dd91 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 _0xa41a=['role','push','FromId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','limit','set','save','update','destroy','then','error','stack','name','index','ChatInternalMessage','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource'];(function(_0xb64f57,_0x40ae83){var _0x38e161=function(_0x42c751){while(--_0x42c751){_0xb64f57['push'](_0xb64f57['shift']());}};_0x38e161(++_0x40ae83);}(_0xa41a,0x6b));var _0xaa41=function(_0x5ac450,_0x553b50){_0x5ac450=_0x5ac450-0x0;var _0x4aaacf=_0xa41a[_0x5ac450];return _0x4aaacf;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var Redis=require(_0xaa41('0x10'));var authService=require(_0xaa41('0x11'));var qs=require(_0xaa41('0x12'));var hardwareService=require(_0xaa41('0x13'));var logger=require(_0xaa41('0x14'))(_0xaa41('0x15'));var utils=require('../../config/utils');var config=require(_0xaa41('0x16'));var db=require(_0xaa41('0x17'))['db'];config['redis']=_['defaults'](config[_0xaa41('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa41('0x19'))(new Redis(config[_0xaa41('0x18')]));require(_0xaa41('0x1a'))[_0xaa41('0x1b')](socket);function respondWithStatusCode(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xcc;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1c')](_0x4eaf81);}return _0x6f9ade[_0xaa41('0x1d')](_0x4eaf81)[_0xaa41('0x1e')]();};}function respondWithResult(_0x2a6988,_0x2005ae){_0x2005ae=_0x2005ae||0xc8;return function(_0x1e1e02){if(_0x1e1e02){return _0x2a6988['status'](_0x2005ae)[_0xaa41('0x1f')](_0x1e1e02);}};}function respondWithFilteredResult(_0x16b930,_0x4210fa){return function(_0x391b01){if(_0x391b01){var _0x230a6a=_0x391b01[_0xaa41('0x20')],_0xd20ddf=_0x4210fa['offset'],_0x29efe5=_0x4210fa['offset']+_0x4210fa[_0xaa41('0x21')],_0x46e6d3;if(_0x29efe5>=_0x230a6a){_0x29efe5=_0x230a6a;_0x46e6d3=0xc8;}else{_0x46e6d3=0xce;}_0x16b930[_0xaa41('0x1d')](_0x46e6d3);return _0x16b930[_0xaa41('0x22')]('Content-Range',_0xd20ddf+'-'+_0x29efe5+'/'+_0x230a6a)[_0xaa41('0x1f')](_0x391b01);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x23')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x24')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x25')]()[_0xaa41('0x26')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x1c')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x27')](_0x2d0ac0[_0xaa41('0x28')]);if(_0x2d0ac0[_0xaa41('0x29')]){delete _0x2d0ac0[_0xaa41('0x29')];}_0x59707f[_0xaa41('0x1d')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x2a')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={},_0x1d8c2b={},_0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=db[_0xaa41('0x2b')]['rawAttributes'];_0x1d8c2b[_0xaa41('0x2c')]=_['keys'](_0x30f88e);_0x1d8c2b['query']=_[_0xaa41('0x2d')](_0x1f0275[_0xaa41('0x2e')]);_0x1d8c2b['filters']=_[_0xaa41('0x2f')](_0x1d8c2b[_0xaa41('0x2c')],_0x1d8c2b['query']);_0x9a16e3['attributes']=_['intersection'](_0x1d8c2b[_0xaa41('0x2c')],qs[_0xaa41('0x30')](_0x1f0275[_0xaa41('0x2e')][_0xaa41('0x30')]));_0x9a16e3['attributes']=_0x9a16e3[_0xaa41('0x31')][_0xaa41('0x32')]?_0x9a16e3[_0xaa41('0x31')]:_0x1d8c2b['model'];if(!_0x1f0275[_0xaa41('0x2e')][_0xaa41('0x33')](_0xaa41('0x34'))){_0x9a16e3['limit']=qs[_0xaa41('0x21')](_0x1f0275[_0xaa41('0x2e')]['limit']);_0x9a16e3[_0xaa41('0x35')]=qs[_0xaa41('0x35')](_0x1f0275[_0xaa41('0x2e')]['offset']);}_0x9a16e3[_0xaa41('0x36')]=qs['sort'](_0x1f0275[_0xaa41('0x2e')][_0xaa41('0x37')]);_0x9a16e3[_0xaa41('0x38')]=qs['filters'](_['pick'](_0x1f0275['query'],_0x1d8c2b[_0xaa41('0x39')]));if(_0x1f0275[_0xaa41('0x2e')][_0xaa41('0x3a')]){_0x9a16e3[_0xaa41('0x38')]=_['merge'](_0x9a16e3['where'],{'$or':_[_0xaa41('0x3b')](_0x30f88e,function(_0x5673c){if(_0x5673c[_0xaa41('0x3c')][_0xaa41('0x3d')]!==_0xaa41('0x3e')){var _0x203d83={};_0x203d83[_0x5673c[_0xaa41('0x3f')]]={'$like':'%'+_0x1f0275['query'][_0xaa41('0x3a')]+'%'};return _0x203d83;}})});}_0x9a16e3=_[_0xaa41('0x40')]({},_0x9a16e3,_0x1f0275[_0xaa41('0x41')]);var _0x27817f={'where':_0x9a16e3['where']};return db['ChatInternalMessage'][_0xaa41('0x20')](_0x27817f)[_0xaa41('0x26')](function(_0x5eae08){_0x4466a3[_0xaa41('0x20')]=_0x5eae08;if(_0x1f0275['query'][_0xaa41('0x42')]){_0x9a16e3[_0xaa41('0x43')]=[{'all':!![]}];}return db[_0xaa41('0x2b')][_0xaa41('0x44')](_0x9a16e3);})[_0xaa41('0x26')](function(_0x12ba1a){_0x4466a3[_0xaa41('0x45')]=_0x12ba1a;return _0x4466a3;})[_0xaa41('0x26')](respondWithFilteredResult(_0x63c18c,_0x9a16e3))['catch'](handleError(_0x63c18c,null));};exports[_0xaa41('0x46')]=function(_0x2abf39,_0x35c685){var _0x398c35={'raw':!![],'where':{'id':_0x2abf39[_0xaa41('0x47')]['id']}},_0xc84fb8={};_0xc84fb8['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0xc84fb8[_0xaa41('0x2e')]=_[_0xaa41('0x2d')](_0x2abf39[_0xaa41('0x2e')]);_0xc84fb8[_0xaa41('0x39')]=_[_0xaa41('0x2f')](_0xc84fb8[_0xaa41('0x2c')],_0xc84fb8[_0xaa41('0x2e')]);_0x398c35['attributes']=_[_0xaa41('0x2f')](_0xc84fb8['model'],qs['fields'](_0x2abf39[_0xaa41('0x2e')]['fields']));_0x398c35['attributes']=_0x398c35['attributes'][_0xaa41('0x32')]?_0x398c35['attributes']:_0xc84fb8[_0xaa41('0x2c')];if(_0x2abf39[_0xaa41('0x2e')]['includeAll']){_0x398c35['include']=[{'all':!![]}];}_0x398c35=_[_0xaa41('0x40')]({},_0x398c35,_0x2abf39[_0xaa41('0x41')]);return db[_0xaa41('0x2b')][_0xaa41('0x48')](_0x398c35)[_0xaa41('0x26')](handleEntityNotFound(_0x35c685,null))[_0xaa41('0x26')](respondWithResult(_0x35c685,null))[_0xaa41('0x49')](handleError(_0x35c685,null));};exports[_0xaa41('0x4a')]=function(_0x2fa6ec,_0x4e1ac4){return db[_0xaa41('0x2b')][_0xaa41('0x4a')](_0x2fa6ec[_0xaa41('0x4b')],{})[_0xaa41('0x26')](respondWithResult(_0x4e1ac4,0xc9))[_0xaa41('0x49')](handleError(_0x4e1ac4,null));};exports[_0xaa41('0x24')]=function(_0x538b12,_0x406824){if(_0x538b12[_0xaa41('0x4b')]['id']){delete _0x538b12[_0xaa41('0x4b')]['id'];}return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x538b12[_0xaa41('0x47')]['id']}})['then'](handleEntityNotFound(_0x406824,null))['then'](saveUpdates(_0x538b12[_0xaa41('0x4b')],null))[_0xaa41('0x26')](respondWithResult(_0x406824,null))[_0xaa41('0x49')](handleError(_0x406824,null));};exports['destroy']=function(_0xb4773b,_0x3e1a73){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0xb4773b[_0xaa41('0x47')]['id']}})[_0xaa41('0x26')](handleEntityNotFound(_0x3e1a73,null))[_0xaa41('0x26')](removeEntity(_0x3e1a73,null))[_0xaa41('0x49')](handleError(_0x3e1a73,null));};exports[_0xaa41('0x4c')]=function(_0x237b8a,_0x333a9f){return db[_0xaa41('0x2b')]['describe']()[_0xaa41('0x26')](respondWithResult(_0x333a9f,null))['catch'](handleError(_0x333a9f,null));};function wrapUser(_0x5ae65e){return function(_0x1bdcd6){var _0x446b=_0x5ae65e[_0xaa41('0x4d')]({'plain':!![]});_0x446b[_0xaa41('0x4e')]=[];if(_0x1bdcd6){_0x446b[_0xaa41('0x4f')]=_0x1bdcd6[_0xaa41('0x50')];_0x446b[_0xaa41('0x51')]=_0x1bdcd6;}else{_0x446b[_0xaa41('0x4f')]=moment(0x0)['format'](_0xaa41('0x52'));_0x446b[_0xaa41('0x51')]={};}return _0x446b;};}exports[_0xaa41('0x53')]=function(_0x4f9e92,_0x2e0f53,_0x35f664){var _0x4cf674=[];return db[_0xaa41('0x54')][_0xaa41('0x44')]({'where':{'role':[_0xaa41('0x55'),'admin',_0xaa41('0x56')]},'attributes':['id',_0xaa41('0x57'),'name','role',_0xaa41('0x58'),_0xaa41('0x59'),_0xaa41('0x5a'),'lastLoginAt',_0xaa41('0x5b'),_0xaa41('0x5c')],'order':qs[_0xaa41('0x37')](_0xaa41('0x5d')),'include':[{'model':db[_0xaa41('0x5e')],'as':'VoiceQueues','attributes':['id',_0xaa41('0x29'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3ba305){if(_0x3ba305){var _0x52ae7f=_0x4f9e92[_0xaa41('0x56')][_0xaa41('0x4d')]({'plain':!![]});if(!_0x52ae7f)throw new Error(_0xaa41('0x5f'));if(_0x52ae7f['role']===_0xaa41('0x56')){return db[_0xaa41('0x60')][_0xaa41('0x48')]({'where':{'name':_0xaa41('0x61'),'userProfileId':_0x52ae7f[_0xaa41('0x62')]},'raw':!![]})[_0xaa41('0x26')](function(_0xc56018){if(_0xc56018){if(_0xc56018[_0xaa41('0x63')]===0x0){return db[_0xaa41('0x64')]['findAll']({'where':{'sectionId':_0xc56018['id']},'raw':!![]})[_0xaa41('0x26')](function(_0x40cdfc){var _0xce10a9=[];if(_['isEmpty'](_0x40cdfc)){_0xce10a9=_[_0xaa41('0x3a')](_0x3ba305,function(_0x2caf5c){if(_0x2caf5c[_0xaa41('0x65')]!==_0xaa41('0x55')){return _0x2caf5c;}});return _0xce10a9;}else{for(var _0x2c8ccf=0x0;_0x2c8ccf<_0x3ba305[_0xaa41('0x32')];_0x2c8ccf++){var _0x320ce7=_0x3ba305[_0x2c8ccf];if(_0x320ce7['role']==='agent'){var _0x5cb34d=_['find'](_0x40cdfc,function(_0x4ec357){return _0x4ec357['resourceId']===_0x320ce7['id'];});if(_0x5cb34d)_0xce10a9[_0xaa41('0x66')](_0x320ce7);}else{_0xce10a9['push'](_0x320ce7);}}return _0xce10a9;}});}else{return _0x3ba305;}}else{var _0x576e6e=_[_0xaa41('0x3a')](_0x3ba305,function(_0x40a524){if(_0x40a524[_0xaa41('0x65')]!==_0xaa41('0x55')){return _0x40a524;}});return _0x576e6e;}});}else{return _0x3ba305;}}})['then'](function(_0x244d41){var _0x2a8313=[];if(_0x244d41){_0x4cf674=_0x244d41;for(var _0x1ddb6c=0x0;_0x1ddb6c<_0x244d41[_0xaa41('0x32')];_0x1ddb6c+=0x1){_0x4cf674[_0x1ddb6c][_0xaa41('0x4e')]=[];_0x2a8313[_0xaa41('0x66')](db[_0xaa41('0x2b')][_0xaa41('0x48')]({'where':{'FromId':[_0x4f9e92[_0xaa41('0x56')]['id'],_0x244d41[_0x1ddb6c]['id']],'ToId':[_0x4f9e92['user']['id'],_0x244d41[_0x1ddb6c]['id']],'ChatGroupId':null},'attributes':['id',_0xaa41('0x50'),_0xaa41('0x67'),'ToId','read','body'],'order':qs[_0xaa41('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaa41('0x26')](wrapUser(_0x244d41[_0x1ddb6c])));}return BPromise['all'](_0x2a8313);}return[];})[_0xaa41('0x26')](function(_0x18d18b){return{'rows':_0x18d18b,'count':_0x18d18b['length']};})[_0xaa41('0x26')](respondWithResult(_0x2e0f53,null))[_0xaa41('0x49')](handleError(_0x2e0f53,null));}; \ No newline at end of file +var _0x6aa7=['options','count','include','findAll','rows','catch','show','params','length','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x5a2d6e,_0x3d3a47){var _0x30ff59=function(_0x2b5e6a){while(--_0x2b5e6a){_0x5a2d6e['push'](_0x5a2d6e['shift']());}};_0x30ff59(++_0x3d3a47);}(_0x6aa7,0x178));var _0x76aa=function(_0x314e21,_0xc5596){_0x314e21=_0x314e21-0x0;var _0x225ff3=_0x6aa7[_0x314e21];return _0x225ff3;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var hardwareService=require(_0x76aa('0x11'));var logger=require(_0x76aa('0x12'))(_0x76aa('0x13'));var utils=require(_0x76aa('0x14'));var config=require(_0x76aa('0x15'));var db=require(_0x76aa('0x16'))['db'];config[_0x76aa('0x17')]=_['defaults'](config[_0x76aa('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0x18'))(new Redis(config[_0x76aa('0x17')]));require(_0x76aa('0x19'))[_0x76aa('0x1a')](socket);function respondWithStatusCode(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xcc;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1b')](_0x4e309f);}return _0x10432c['status'](_0x4e309f)[_0x76aa('0x1c')]();};}function respondWithResult(_0x319bf1,_0x5cf594){_0x5cf594=_0x5cf594||0xc8;return function(_0x2111c7){if(_0x2111c7){return _0x319bf1['status'](_0x5cf594)[_0x76aa('0x1d')](_0x2111c7);}};}function respondWithFilteredResult(_0x5181d2,_0x1515e9){return function(_0x413cf6){if(_0x413cf6){var _0x2ab30b=_0x413cf6['count'],_0x21c16d=_0x1515e9['offset'],_0xa1bc7=_0x1515e9[_0x76aa('0x1e')]+_0x1515e9[_0x76aa('0x1f')],_0x3ead3f;if(_0xa1bc7>=_0x2ab30b){_0xa1bc7=_0x2ab30b;_0x3ead3f=0xc8;}else{_0x3ead3f=0xce;}_0x5181d2[_0x76aa('0x20')](_0x3ead3f);return _0x5181d2[_0x76aa('0x21')](_0x76aa('0x22'),_0x21c16d+'-'+_0xa1bc7+'/'+_0x2ab30b)[_0x76aa('0x1d')](_0x413cf6);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x20')](0xcc)[_0x76aa('0x1c')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x1b')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x20')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=db[_0x76aa('0x2d')][_0x76aa('0x2e')];_0x365ff8[_0x76aa('0x2f')]=_[_0x76aa('0x30')](_0x1e90b9);_0x365ff8[_0x76aa('0x31')]=_[_0x76aa('0x30')](_0x3fcb7f['query']);_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0x365ff8[_0x76aa('0x2f')],_0x365ff8[_0x76aa('0x31')]);_0x994550[_0x76aa('0x34')]=_[_0x76aa('0x33')](_0x365ff8[_0x76aa('0x2f')],qs['fields'](_0x3fcb7f[_0x76aa('0x31')][_0x76aa('0x35')]));_0x994550['attributes']=_0x994550[_0x76aa('0x34')]['length']?_0x994550[_0x76aa('0x34')]:_0x365ff8['model'];if(!_0x3fcb7f[_0x76aa('0x31')]['hasOwnProperty']('nolimit')){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x31')][_0x76aa('0x1f')]);_0x994550['offset']=qs['offset'](_0x3fcb7f[_0x76aa('0x31')][_0x76aa('0x1e')]);}_0x994550[_0x76aa('0x36')]=qs[_0x76aa('0x37')](_0x3fcb7f[_0x76aa('0x31')]['sort']);_0x994550[_0x76aa('0x38')]=qs['filters'](_['pick'](_0x3fcb7f[_0x76aa('0x31')],_0x365ff8[_0x76aa('0x32')]));if(_0x3fcb7f[_0x76aa('0x31')][_0x76aa('0x39')]){_0x994550['where']=_[_0x76aa('0x3a')](_0x994550[_0x76aa('0x38')],{'$or':_[_0x76aa('0x3b')](_0x1e90b9,function(_0x4e131a){if(_0x4e131a[_0x76aa('0x3c')][_0x76aa('0x3d')]!==_0x76aa('0x3e')){var _0x147c03={};_0x147c03[_0x4e131a[_0x76aa('0x3f')]]={'$like':'%'+_0x3fcb7f[_0x76aa('0x31')][_0x76aa('0x39')]+'%'};return _0x147c03;}})});}_0x994550=_[_0x76aa('0x3a')]({},_0x994550,_0x3fcb7f[_0x76aa('0x40')]);var _0x5f022a={'where':_0x994550[_0x76aa('0x38')]};return db[_0x76aa('0x2d')][_0x76aa('0x41')](_0x5f022a)[_0x76aa('0x27')](function(_0x64612e){_0x2dec94[_0x76aa('0x41')]=_0x64612e;if(_0x3fcb7f['query']['includeAll']){_0x994550[_0x76aa('0x42')]=[{'all':!![]}];}return db[_0x76aa('0x2d')][_0x76aa('0x43')](_0x994550);})[_0x76aa('0x27')](function(_0x50599f){_0x2dec94[_0x76aa('0x44')]=_0x50599f;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))[_0x76aa('0x45')](handleError(_0x5a8030,null));};exports[_0x76aa('0x46')]=function(_0x1138b5,_0x4aa2f3){var _0x13dafe={'raw':!![],'where':{'id':_0x1138b5[_0x76aa('0x47')]['id']}},_0x556f59={};_0x556f59['model']=_['keys'](db['ChatInternalMessage'][_0x76aa('0x2e')]);_0x556f59['query']=_['keys'](_0x1138b5['query']);_0x556f59[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0x556f59[_0x76aa('0x2f')],_0x556f59[_0x76aa('0x31')]);_0x13dafe[_0x76aa('0x34')]=_['intersection'](_0x556f59[_0x76aa('0x2f')],qs[_0x76aa('0x35')](_0x1138b5[_0x76aa('0x31')][_0x76aa('0x35')]));_0x13dafe[_0x76aa('0x34')]=_0x13dafe['attributes'][_0x76aa('0x48')]?_0x13dafe[_0x76aa('0x34')]:_0x556f59['model'];if(_0x1138b5[_0x76aa('0x31')]['includeAll']){_0x13dafe[_0x76aa('0x42')]=[{'all':!![]}];}_0x13dafe=_[_0x76aa('0x3a')]({},_0x13dafe,_0x1138b5[_0x76aa('0x40')]);return db[_0x76aa('0x2d')][_0x76aa('0x49')](_0x13dafe)[_0x76aa('0x27')](handleEntityNotFound(_0x4aa2f3,null))[_0x76aa('0x27')](respondWithResult(_0x4aa2f3,null))[_0x76aa('0x45')](handleError(_0x4aa2f3,null));};exports[_0x76aa('0x4a')]=function(_0x3946bd,_0x5e4967){return db[_0x76aa('0x2d')]['create'](_0x3946bd[_0x76aa('0x4b')],{})[_0x76aa('0x27')](respondWithResult(_0x5e4967,0xc9))[_0x76aa('0x45')](handleError(_0x5e4967,null));};exports[_0x76aa('0x26')]=function(_0x5ca721,_0x5a3d9c){if(_0x5ca721[_0x76aa('0x4b')]['id']){delete _0x5ca721['body']['id'];}return db[_0x76aa('0x2d')][_0x76aa('0x49')]({'where':{'id':_0x5ca721[_0x76aa('0x47')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x5a3d9c,null))[_0x76aa('0x27')](saveUpdates(_0x5ca721[_0x76aa('0x4b')],null))['then'](respondWithResult(_0x5a3d9c,null))['catch'](handleError(_0x5a3d9c,null));};exports[_0x76aa('0x28')]=function(_0x1eafb2,_0x1708d4){return db[_0x76aa('0x2d')][_0x76aa('0x49')]({'where':{'id':_0x1eafb2[_0x76aa('0x47')]['id']}})['then'](handleEntityNotFound(_0x1708d4,null))[_0x76aa('0x27')](removeEntity(_0x1708d4,null))[_0x76aa('0x45')](handleError(_0x1708d4,null));};exports[_0x76aa('0x4c')]=function(_0x4b3d2a,_0x30d930){return db['ChatInternalMessage'][_0x76aa('0x4c')]()['then'](respondWithResult(_0x30d930,null))[_0x76aa('0x45')](handleError(_0x30d930,null));};function wrapUser(_0x4449c1){return function(_0x3c63e5){var _0xd39920=_0x4449c1[_0x76aa('0x4d')]({'plain':!![]});_0xd39920[_0x76aa('0x4e')]=[];if(_0x3c63e5){_0xd39920[_0x76aa('0x4f')]=_0x3c63e5['createdAt'];_0xd39920[_0x76aa('0x50')]=_0x3c63e5;}else{_0xd39920['lastMessageAt']=moment(0x0)[_0x76aa('0x51')](_0x76aa('0x52'));_0xd39920[_0x76aa('0x50')]={};}return _0xd39920;};}exports[_0x76aa('0x53')]=function(_0x3fa7ec,_0x28f8aa,_0x336024){var _0x57941d=[];return db[_0x76aa('0x54')][_0x76aa('0x43')]({'where':{'role':[_0x76aa('0x55'),_0x76aa('0x56'),'user']},'attributes':['id',_0x76aa('0x57'),_0x76aa('0x2b'),_0x76aa('0x58'),_0x76aa('0x59'),_0x76aa('0x5a'),_0x76aa('0x5b'),'lastLoginAt',_0x76aa('0x5c'),_0x76aa('0x5d')],'order':qs[_0x76aa('0x37')](_0x76aa('0x5e')),'include':[{'model':db[_0x76aa('0x5f')],'as':_0x76aa('0x60'),'attributes':['id',_0x76aa('0x2b'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x2c59a6){if(_0x2c59a6){var _0x3b0d8a=_0x3fa7ec['user'][_0x76aa('0x4d')]({'plain':!![]});if(!_0x3b0d8a)throw new Error(_0x76aa('0x61'));if(_0x3b0d8a['role']===_0x76aa('0x62')){return db[_0x76aa('0x63')][_0x76aa('0x49')]({'where':{'name':_0x76aa('0x64'),'userProfileId':_0x3b0d8a[_0x76aa('0x65')]},'raw':!![]})[_0x76aa('0x27')](function(_0x3376ec){if(_0x3376ec){if(_0x3376ec[_0x76aa('0x66')]===0x0){return db[_0x76aa('0x67')]['findAll']({'where':{'sectionId':_0x3376ec['id']},'raw':!![]})[_0x76aa('0x27')](function(_0x49156c){var _0x40e746=[];if(_[_0x76aa('0x68')](_0x49156c)){_0x40e746=_[_0x76aa('0x39')](_0x2c59a6,function(_0x16cc85){if(_0x16cc85[_0x76aa('0x58')]!==_0x76aa('0x55')){return _0x16cc85;}});return _0x40e746;}else{for(var _0x18c4b8=0x0;_0x18c4b8<_0x2c59a6[_0x76aa('0x48')];_0x18c4b8++){var _0x2f1263=_0x2c59a6[_0x18c4b8];if(_0x2f1263['role']===_0x76aa('0x55')){var _0x3d4025=_[_0x76aa('0x49')](_0x49156c,function(_0xe5957d){return _0xe5957d[_0x76aa('0x69')]===_0x2f1263['id'];});if(_0x3d4025)_0x40e746[_0x76aa('0x6a')](_0x2f1263);}else{_0x40e746[_0x76aa('0x6a')](_0x2f1263);}}return _0x40e746;}});}else{return _0x2c59a6;}}else{var _0x157540=_['filter'](_0x2c59a6,function(_0x364d05){if(_0x364d05['role']!==_0x76aa('0x55')){return _0x364d05;}});return _0x157540;}});}else{return _0x2c59a6;}}})[_0x76aa('0x27')](function(_0x3e97f8){var _0x2c2710=[];if(_0x3e97f8){_0x57941d=_0x3e97f8;for(var _0x3a82fe=0x0;_0x3a82fe<_0x3e97f8[_0x76aa('0x48')];_0x3a82fe+=0x1){_0x57941d[_0x3a82fe][_0x76aa('0x4e')]=[];_0x2c2710['push'](db[_0x76aa('0x2d')][_0x76aa('0x49')]({'where':{'FromId':[_0x3fa7ec['user']['id'],_0x3e97f8[_0x3a82fe]['id']],'ToId':[_0x3fa7ec['user']['id'],_0x3e97f8[_0x3a82fe]['id']],'ChatGroupId':null},'attributes':['id',_0x76aa('0x6b'),_0x76aa('0x6c'),'ToId',_0x76aa('0x6d'),_0x76aa('0x4b')],'order':qs[_0x76aa('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x76aa('0x27')](wrapUser(_0x3e97f8[_0x3a82fe])));}return BPromise['all'](_0x2c2710);}return[];})[_0x76aa('0x27')](function(_0x1178e5){return{'rows':_0x1178e5,'count':_0x1178e5[_0x76aa('0x48')]};})[_0x76aa('0x27')](respondWithResult(_0x28f8aa,null))['catch'](handleError(_0x28f8aa,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5548317..b2a5eff 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 _0xf7bf=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x41f2f5,_0x14f33c){var _0x3d49f1=function(_0x300207){while(--_0x300207){_0x41f2f5['push'](_0x41f2f5['shift']());}};_0x3d49f1(++_0x14f33c);}(_0xf7bf,0x19a));var _0xff7b=function(_0x189a66,_0x245d35){_0x189a66=_0x189a66-0x0;var _0x44fb31=_0xf7bf[_0x189a66];return _0x44fb31;};'use strict';var EventEmitter=require(_0xff7b('0x0'));var ChatInternalMessage=require(_0xff7b('0x1'))['db'][_0xff7b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xff7b('0x3')](0x0);var events={'afterCreate':_0xff7b('0x4'),'afterUpdate':'update','afterDestroy':_0xff7b('0x5')};function emitEvent(_0x2176ce){return function(_0xf08e5a,_0x1b95fe,_0x5bebb8){ChatInternalMessageEvents[_0xff7b('0x6')](_0x2176ce+':'+_0xf08e5a['id'],_0xf08e5a);ChatInternalMessageEvents[_0xff7b('0x6')](_0x2176ce,_0xf08e5a);_0x5bebb8(null);};}for(var e in events){if(events[_0xff7b('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xff7b('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6ec2=['hasOwnProperty','hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x558f41,_0x369667){var _0x2c6484=function(_0x1fd98e){while(--_0x1fd98e){_0x558f41['push'](_0x558f41['shift']());}};_0x2c6484(++_0x369667);}(_0x6ec2,0x19b));var _0x26ec=function(_0x1dafbd,_0x1b8584){_0x1dafbd=_0x1dafbd-0x0;var _0x641eb3=_0x6ec2[_0x1dafbd];return _0x641eb3;};'use strict';var EventEmitter=require(_0x26ec('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x26ec('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x26ec('0x2'),'afterDestroy':_0x26ec('0x3')};function emitEvent(_0x25e514){return function(_0x344c7a,_0x172d3d,_0x44e7dd){ChatInternalMessageEvents[_0x26ec('0x4')](_0x25e514+':'+_0x344c7a['id'],_0x344c7a);ChatInternalMessageEvents['emit'](_0x25e514,_0x344c7a);_0x44e7dd(null);};}for(var e in events){if(events[_0x26ec('0x5')](e)){var event=events[e];ChatInternalMessage[_0x26ec('0x6')](e,emitEvent(event));}}module[_0x26ec('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 8123ef8..b2e99f2 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 _0xe315=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xe315,0x84));var _0x5e31=function(_0x5d28e0,_0x39199c){_0x5d28e0=_0x5d28e0-0x0;var _0x156b18=_0xe315[_0x5d28e0];return _0x156b18;};'use strict';var _=require(_0x5e31('0x0'));var util=require(_0x5e31('0x1'));var logger=require(_0x5e31('0x2'))(_0x5e31('0x3'));var moment=require('moment');var BPromise=require(_0x5e31('0x4'));var rp=require(_0x5e31('0x5'));var fs=require('fs');var path=require(_0x5e31('0x6'));var rimraf=require(_0x5e31('0x7'));var config=require(_0x5e31('0x8'));var attributes=require(_0x5e31('0x9'));module[_0x5e31('0xa')]=function(_0x27a6e6,_0x938111){return _0x27a6e6[_0x5e31('0xb')](_0x5e31('0xc'),attributes,{'tableName':_0x5e31('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xee91=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','./chatInternalMessage.attributes','exports','define'];(function(_0x1f20b9,_0x103315){var _0x5d641c=function(_0x1fc6ac){while(--_0x1fc6ac){_0x1f20b9['push'](_0x1f20b9['shift']());}};_0x5d641c(++_0x103315);}(_0xee91,0x12f));var _0x1ee9=function(_0x3d03c3,_0x51940c){_0x3d03c3=_0x3d03c3-0x0;var _0x4af2ca=_0xee91[_0x3d03c3];return _0x4af2ca;};'use strict';var _=require(_0x1ee9('0x0'));var util=require(_0x1ee9('0x1'));var logger=require(_0x1ee9('0x2'))('api');var moment=require(_0x1ee9('0x3'));var BPromise=require(_0x1ee9('0x4'));var rp=require(_0x1ee9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ee9('0x6'));module[_0x1ee9('0x7')]=function(_0x2df8ab,_0x3d3ca7){return _0x2df8ab[_0x1ee9('0x8')](_0x1ee9('0x9'),attributes,{'tableName':_0x1ee9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ee9('0xb'),'collate':_0x1ee9('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 4d867a1..9126716 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 _0x3dc9=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3c77bd,_0x1f8ce7){var _0x3ce348=function(_0x47e4d1){while(--_0x47e4d1){_0x3c77bd['push'](_0x3c77bd['shift']());}};_0x3ce348(++_0x1f8ce7);}(_0x3dc9,0x120));var _0x93dc=function(_0x18e925,_0x4996a8){_0x18e925=_0x18e925-0x0;var _0x3834cb=_0x3dc9[_0x18e925];return _0x3834cb;};'use strict';var _=require(_0x93dc('0x0'));var util=require(_0x93dc('0x1'));var moment=require(_0x93dc('0x2'));var BPromise=require(_0x93dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93dc('0x4'));var db=require(_0x93dc('0x5'))['db'];var utils=require(_0x93dc('0x6'));var logger=require(_0x93dc('0x7'))(_0x93dc('0x8'));var config=require('../../config/environment');var jayson=require(_0x93dc('0x9'));var client=jayson[_0x93dc('0xa')][_0x93dc('0xb')]({'port':0x232a});config[_0x93dc('0xc')]=_[_0x93dc('0xd')](config[_0x93dc('0xc')],{'host':_0x93dc('0xe'),'port':0x18eb});var socket=require(_0x93dc('0xf'))(new Redis(config['redis']));require(_0x93dc('0x10'))['register'](socket);function respondWithRpcPromise(_0x2ea369,_0x78abbe,_0x4acc40){return new BPromise(function(_0x479261,_0x411ac5){return client['request'](_0x2ea369,_0x4acc40)[_0x93dc('0x11')](function(_0x2e65fd){logger[_0x93dc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x78abbe,_0x93dc('0x13'));logger[_0x93dc('0x14')](_0x93dc('0x15'),_0x78abbe,'request\x20sent',JSON[_0x93dc('0x16')](_0x2e65fd));if(_0x2e65fd['error']){if(_0x2e65fd[_0x93dc('0x17')][_0x93dc('0x18')]===0x1f4){logger[_0x93dc('0x17')](_0x93dc('0x19'),_0x78abbe,_0x2e65fd[_0x93dc('0x17')][_0x93dc('0x1a')]);return _0x411ac5(_0x2e65fd[_0x93dc('0x17')][_0x93dc('0x1a')]);}logger[_0x93dc('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x78abbe,_0x2e65fd['error']['message']);return _0x479261(_0x2e65fd[_0x93dc('0x17')][_0x93dc('0x1a')]);}else{logger[_0x93dc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x78abbe,'request\x20sent');_0x479261(_0x2e65fd[_0x93dc('0x1b')][_0x93dc('0x1a')]);}})[_0x93dc('0x1c')](function(_0x11da46){logger[_0x93dc('0x17')](_0x93dc('0x19'),_0x78abbe,_0x11da46);_0x411ac5(_0x11da46);});});} \ No newline at end of file +var _0xe389=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3a2e87,_0x3ae82f){var _0xcbfdfd=function(_0x135da9){while(--_0x135da9){_0x3a2e87['push'](_0x3a2e87['shift']());}};_0xcbfdfd(++_0x3ae82f);}(_0xe389,0x1b9));var _0x9e38=function(_0x58a3b1,_0x5bb0de){_0x58a3b1=_0x58a3b1-0x0;var _0x450e55=_0xe389[_0x58a3b1];return _0x450e55;};'use strict';var _=require(_0x9e38('0x0'));var util=require(_0x9e38('0x1'));var moment=require('moment');var BPromise=require(_0x9e38('0x2'));var rs=require(_0x9e38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e38('0x4'))['db'];var utils=require(_0x9e38('0x5'));var logger=require(_0x9e38('0x6'))(_0x9e38('0x7'));var config=require(_0x9e38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e38('0x9')][_0x9e38('0xa')]({'port':0x232a});config[_0x9e38('0xb')]=_[_0x9e38('0xc')](config[_0x9e38('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x9e38('0xd')](socket);function respondWithRpcPromise(_0x2611a8,_0x1122d3,_0x241ff4){return new BPromise(function(_0x1a8216,_0x326bcc){return client[_0x9e38('0xe')](_0x2611a8,_0x241ff4)[_0x9e38('0xf')](function(_0x245c4e){logger[_0x9e38('0x10')](_0x9e38('0x11'),_0x1122d3,_0x9e38('0x12'));logger[_0x9e38('0x13')](_0x9e38('0x14'),_0x1122d3,_0x9e38('0x12'),JSON['stringify'](_0x245c4e));if(_0x245c4e[_0x9e38('0x15')]){if(_0x245c4e[_0x9e38('0x15')][_0x9e38('0x16')]===0x1f4){logger[_0x9e38('0x15')](_0x9e38('0x11'),_0x1122d3,_0x245c4e[_0x9e38('0x15')][_0x9e38('0x17')]);return _0x326bcc(_0x245c4e['error'][_0x9e38('0x17')]);}logger[_0x9e38('0x15')](_0x9e38('0x11'),_0x1122d3,_0x245c4e['error'][_0x9e38('0x17')]);return _0x1a8216(_0x245c4e[_0x9e38('0x15')]['message']);}else{logger['info'](_0x9e38('0x11'),_0x1122d3,_0x9e38('0x12'));_0x1a8216(_0x245c4e[_0x9e38('0x18')][_0x9e38('0x17')]);}})[_0x9e38('0x19')](function(_0x5b36c0){logger[_0x9e38('0x15')](_0x9e38('0x11'),_0x1122d3,_0x5b36c0);_0x326bcc(_0x5b36c0);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 6887a9a..c647d0f 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 _0xeae3=['removeListener','length','./chatInternalMessage.events','save','update'];(function(_0x3f609e,_0x53c1ae){var _0x4e3456=function(_0x52ea03){while(--_0x52ea03){_0x3f609e['push'](_0x3f609e['shift']());}};_0x4e3456(++_0x53c1ae);}(_0xeae3,0x138));var _0x3eae=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0xeae3[_0x28edda];return _0x21f4a4;};'use strict';var ChatInternalMessageEvents=require(_0x3eae('0x0'));var events=[_0x3eae('0x1'),'remove',_0x3eae('0x2')];function createListener(_0x1af6f2,_0xc5327c){return function(_0x5e7584){_0xc5327c['emit'](_0x1af6f2,_0x5e7584);};}function removeListener(_0x497d0b,_0x8cec3f){return function(){ChatInternalMessageEvents[_0x3eae('0x3')](_0x497d0b,_0x8cec3f);};}exports['register']=function(_0x2d802f){for(var _0x3c54d5=0x0,_0x41b0a0=events[_0x3eae('0x4')];_0x3c54d5<_0x41b0a0;_0x3c54d5++){var _0x4f6cfd=events[_0x3c54d5];var _0xba0ba3=createListener('chatInternalMessage:'+_0x4f6cfd,_0x2d802f);ChatInternalMessageEvents['on'](_0x4f6cfd,_0xba0ba3);}}; \ No newline at end of file +var _0x13f4=['update','emit','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0x13f4,0xe5));var _0x413f=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x13f4[_0x2726ad];return _0xd87993;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x413f('0x0'),_0x413f('0x1'),_0x413f('0x2')];function createListener(_0x3c5620,_0x39d22e){return function(_0x52e30f){_0x39d22e[_0x413f('0x3')](_0x3c5620,_0x52e30f);};}function removeListener(_0x37704d,_0x2b0312){return function(){ChatInternalMessageEvents[_0x413f('0x4')](_0x37704d,_0x2b0312);};}exports[_0x413f('0x5')]=function(_0x5ace71){for(var _0x33f115=0x0,_0x20a29d=events['length'];_0x33f115<_0x20a29d;_0x33f115++){var _0x26ea59=events[_0x33f115];var _0x521ba0=createListener(_0x413f('0x6')+_0x26ea59,_0x5ace71);ChatInternalMessageEvents['on'](_0x26ea59,_0x521ba0);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3d53a3f..df670e5 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 _0x806d=['exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','create','update','delete','destroy'];(function(_0x3a53aa,_0xae276f){var _0xe542bc=function(_0x410f7a){while(--_0x410f7a){_0x3a53aa['push'](_0x3a53aa['shift']());}};_0xe542bc(++_0xae276f);}(_0x806d,0x131));var _0xd806=function(_0x1cee7e,_0x2a9447){_0x1cee7e=_0x1cee7e-0x0;var _0x5c7b6b=_0x806d[_0x1cee7e];return _0x5c7b6b;};'use strict';var multer=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var path=require(_0xd806('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xd806('0x3'));var interaction=require(_0xd806('0x4'));var config=require('../../config/environment');var controller=require(_0xd806('0x5'));router['get']('/',auth[_0xd806('0x6')](),controller[_0xd806('0x7')]);router[_0xd806('0x8')](_0xd806('0x9'),auth[_0xd806('0x6')](),controller[_0xd806('0xa')]);router[_0xd806('0x8')]('/users',auth[_0xd806('0x6')](),controller[_0xd806('0xb')]);router[_0xd806('0x8')](_0xd806('0xc'),auth['isAuthenticated'](),controller[_0xd806('0xd')]);router['post']('/',auth[_0xd806('0x6')](),controller[_0xd806('0xe')]);router['put'](_0xd806('0xc'),controller[_0xd806('0xf')]);router[_0xd806('0x10')](_0xd806('0xc'),auth[_0xd806('0x6')](),controller[_0xd806('0x11')]);module[_0xd806('0x12')]=router; \ No newline at end of file +var _0x7380=['../../config/environment','./chatInternalMessage.controller','get','/describe','/users','isAuthenticated','getUsers','post','create','/:id','delete','destroy','exports','util','path','Router','../../components/auth/service'];(function(_0x56ee6d,_0x195268){var _0x4f6357=function(_0x406775){while(--_0x406775){_0x56ee6d['push'](_0x56ee6d['shift']());}};_0x4f6357(++_0x195268);}(_0x7380,0x172));var _0x0738=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x7380[_0x1e3671];return _0x48d5f5;};'use strict';var multer=require('multer');var util=require(_0x0738('0x0'));var path=require(_0x0738('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0738('0x2')]();var auth=require(_0x0738('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0738('0x4'));var controller=require(_0x0738('0x5'));router[_0x0738('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0738('0x6')](_0x0738('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x0738('0x6')](_0x0738('0x8'),auth[_0x0738('0x9')](),controller[_0x0738('0xa')]);router['get']('/:id',auth[_0x0738('0x9')](),controller['show']);router[_0x0738('0xb')]('/',auth[_0x0738('0x9')](),controller[_0x0738('0xc')]);router['put'](_0x0738('0xd'),controller['update']);router[_0x0738('0xe')](_0x0738('0xd'),auth[_0x0738('0x9')](),controller[_0x0738('0xf')]);module[_0x0738('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 646926b..5833ae5 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 _0x554f=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x554f,0x17f));var _0xf554=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x554f[_0x4d8666];return _0x37175b;};'use strict';var Sequelize=require(_0xf554('0x0'));module[_0xf554('0x1')]={'body':{'type':Sequelize[_0xf554('0x2')](_0xf554('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf554('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf554('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf554('0x5')]('in','out'),'defaultValue':_0xf554('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf554('0x7')]}}; \ No newline at end of file +var _0xb69a=['TEXT','medium','BOOLEAN','ENUM','sequelize'];(function(_0x4fc463,_0x45cca5){var _0x3c00ea=function(_0x38633c){while(--_0x38633c){_0x4fc463['push'](_0x4fc463['shift']());}};_0x3c00ea(++_0x45cca5);}(_0xb69a,0xb8));var _0xab69=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb69a[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xab69('0x0'));module['exports']={'body':{'type':Sequelize[_0xab69('0x1')](_0xab69('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab69('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xab69('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xab69('0x4')]('in','out'),'defaultValue':'out','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 a2f81ed..544d0c5 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 _0x0de6=['json','apply','save','update','stack','name','index','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params','options','catch','create','body','find','destroy','describe','chat-interactions','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','reject','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','Content-Range'];(function(_0xd343,_0x47ddff){var _0x4886fa=function(_0x481048){while(--_0x481048){_0xd343['push'](_0xd343['shift']());}};_0x4886fa(++_0x47ddff);}(_0x0de6,0xc7));var _0x60de=function(_0x55c407,_0x209968){_0x55c407=_0x55c407-0x0;var _0xe9e660=_0x0de6[_0x55c407];return _0xe9e660;};'use strict';var pdf=require(_0x60de('0x0'));var emlformat=require(_0x60de('0x1'));var rimraf=require(_0x60de('0x2'));var zipdir=require(_0x60de('0x3'));var jsonpatch=require(_0x60de('0x4'));var rp=require(_0x60de('0x5'));var moment=require(_0x60de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x60de('0x7'));var util=require(_0x60de('0x8'));var path=require(_0x60de('0x9'));var sox=require(_0x60de('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x60de('0xb'));var squel=require('squel');var crypto=require(_0x60de('0xc'));var jsforce=require(_0x60de('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x60de('0xe'));var querystring=require(_0x60de('0xf'));var Papa=require(_0x60de('0x10'));var Redis=require(_0x60de('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60de('0x12'));var hardwareService=require(_0x60de('0x13'));var logger=require(_0x60de('0x14'))(_0x60de('0x15'));var utils=require(_0x60de('0x16'));var config=require(_0x60de('0x17'));var db=require(_0x60de('0x18'))['db'];config[_0x60de('0x19')]=_[_0x60de('0x1a')](config[_0x60de('0x19')],{'host':_0x60de('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x60de('0x1c'))[_0x60de('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x60de('0x1e')][_0x60de('0x1f')]({'port':0x232c});var client9002=jayson[_0x60de('0x1e')][_0x60de('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x381bea,_0x1f5711,_0x1077bb){if(_0x1077bb){var _0x5da4ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5da4ce['test'](_0x1f5711)){return _0x381bea;}else{throw new Error(_0x60de('0x20'));}}else{return _0x381bea;}}function respondWithRpcPromise(_0x99782a,_0x4e375a,_0x44855a,_0x30b14c){return new BPromise(function(_0x188402,_0x225119){var _0x134675=_0x30b14c||client;return _0x134675[_0x60de('0x21')](_0x99782a,_0x44855a)[_0x60de('0x22')](function(_0x1d1b6c){logger[_0x60de('0x23')](_0x60de('0x24'),_0x4e375a,_0x60de('0x25'));logger[_0x60de('0x26')](_0x60de('0x27'),_0x4e375a,_0x60de('0x25'),JSON[_0x60de('0x28')](_0x1d1b6c));if(_0x1d1b6c['error']){if(_0x1d1b6c[_0x60de('0x29')][_0x60de('0x2a')]===0x1f4){logger[_0x60de('0x29')](_0x60de('0x24'),_0x4e375a,_0x1d1b6c[_0x60de('0x29')][_0x60de('0x2b')]);return _0x225119(_0x1d1b6c[_0x60de('0x29')][_0x60de('0x2b')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4e375a,_0x1d1b6c[_0x60de('0x29')][_0x60de('0x2b')]);return _0x188402(_0x1d1b6c['error'][_0x60de('0x2b')]);}else{logger[_0x60de('0x23')]('ChatMessage,\x20%s,\x20%s',_0x4e375a,_0x60de('0x25'));_0x188402(_0x1d1b6c[_0x60de('0x2c')][_0x60de('0x2b')]);}})['catch'](function(_0x192874){logger[_0x60de('0x29')]('ChatMessage,\x20%s,\x20%s',_0x4e375a,_0x192874);_0x225119(_0x192874);});});}function respondWithStatusCode(_0x38fbde,_0x2942b0){_0x2942b0=_0x2942b0||0xcc;return function(_0x6efde3){if(_0x6efde3){return _0x38fbde[_0x60de('0x2d')](_0x2942b0);}return _0x38fbde[_0x60de('0x2e')](_0x2942b0)[_0x60de('0x2f')]();};}function respondWithResult(_0x5c7169,_0x1737ec){_0x1737ec=_0x1737ec||0xc8;return function(_0x2bfcde){if(_0x2bfcde){return _0x5c7169[_0x60de('0x2e')](_0x1737ec)['json'](_0x2bfcde);}};}function respondWithFilteredResult(_0x437b56,_0x7424c2){return function(_0x247c5d){if(_0x247c5d){var _0x3491ea=_0x247c5d[_0x60de('0x30')],_0x2f7aff=_0x7424c2[_0x60de('0x31')],_0x1b63af=_0x7424c2[_0x60de('0x31')]+_0x7424c2['limit'],_0x392d3c;if(_0x1b63af>=_0x3491ea){_0x1b63af=_0x3491ea;_0x392d3c=0xc8;}else{_0x392d3c=0xce;}_0x437b56[_0x60de('0x2e')](_0x392d3c);return _0x437b56['set'](_0x60de('0x32'),_0x2f7aff+'-'+_0x1b63af+'/'+_0x3491ea)[_0x60de('0x33')](_0x247c5d);}return null;};}function patchUpdates(_0x59f001){return function(_0x136196){try{jsonpatch[_0x60de('0x34')](_0x136196,_0x59f001,!![]);}catch(_0x5338c9){return BPromise['reject'](_0x5338c9);}return _0x136196[_0x60de('0x35')]();};}function saveUpdates(_0x28f6bf,_0x36d546){return function(_0x18d506){if(_0x18d506){return _0x18d506[_0x60de('0x36')](_0x28f6bf)[_0x60de('0x22')](function(_0x4cafe2){return _0x4cafe2;});}return null;};}function removeEntity(_0xb93d51,_0x173230){return function(_0x5a6f25){if(_0x5a6f25){return _0x5a6f25['destroy']()[_0x60de('0x22')](function(){_0xb93d51[_0x60de('0x2e')](0xcc)[_0x60de('0x2f')]();});}};}function handleEntityNotFound(_0x4f1c31,_0x37840c){return function(_0x260030){if(!_0x260030){_0x4f1c31[_0x60de('0x2d')](0x194);}return _0x260030;};}function handleError(_0x160738,_0x4fdf8d){_0x4fdf8d=_0x4fdf8d||0x1f4;return function(_0x40de27){logger[_0x60de('0x29')](_0x40de27[_0x60de('0x37')]);if(_0x40de27['name']){delete _0x40de27[_0x60de('0x38')];}_0x160738['status'](_0x4fdf8d)['send'](_0x40de27);};}exports[_0x60de('0x39')]=function(_0x377ee9,_0x4822a4){var _0x205f5d={},_0x3c779f={},_0x26ecee={'count':0x0,'rows':[]};var _0x3138c4=db[_0x60de('0x3a')][_0x60de('0x3b')];_0x3c779f[_0x60de('0x3c')]=_[_0x60de('0x3d')](_0x3138c4);_0x3c779f[_0x60de('0x3e')]=_[_0x60de('0x3d')](_0x377ee9[_0x60de('0x3e')]);_0x3c779f[_0x60de('0x3f')]=_[_0x60de('0x40')](_0x3c779f['model'],_0x3c779f[_0x60de('0x3e')]);_0x205f5d[_0x60de('0x41')]=_['intersection'](_0x3c779f[_0x60de('0x3c')],qs['fields'](_0x377ee9['query'][_0x60de('0x42')]));_0x205f5d[_0x60de('0x41')]=_0x205f5d[_0x60de('0x41')][_0x60de('0x43')]?_0x205f5d[_0x60de('0x41')]:_0x3c779f[_0x60de('0x3c')];if(!_0x377ee9[_0x60de('0x3e')][_0x60de('0x44')](_0x60de('0x45'))){_0x205f5d[_0x60de('0x46')]=qs[_0x60de('0x46')](_0x377ee9[_0x60de('0x3e')][_0x60de('0x46')]);_0x205f5d[_0x60de('0x31')]=qs['offset'](_0x377ee9['query'][_0x60de('0x31')]);}_0x205f5d['order']=qs[_0x60de('0x47')](_0x377ee9[_0x60de('0x3e')][_0x60de('0x47')]);_0x205f5d[_0x60de('0x48')]=qs[_0x60de('0x3f')](_['pick'](_0x377ee9['query'],_0x3c779f[_0x60de('0x3f')]));if(_0x377ee9[_0x60de('0x3e')][_0x60de('0x49')]){_0x205f5d['where']=_[_0x60de('0x4a')](_0x205f5d['where'],{'$or':_[_0x60de('0x4b')](_0x3138c4,function(_0x5e3929){if(_0x5e3929[_0x60de('0x4c')][_0x60de('0x4d')]!==_0x60de('0x4e')){var _0x31397f={};_0x31397f[_0x5e3929[_0x60de('0x4f')]]={'$like':'%'+_0x377ee9['query'][_0x60de('0x49')]+'%'};return _0x31397f;}})});}_0x205f5d=_[_0x60de('0x4a')]({},_0x205f5d,_0x377ee9['options']);var _0x2b94ca={'where':_0x205f5d[_0x60de('0x48')]};return db[_0x60de('0x3a')][_0x60de('0x30')](_0x2b94ca)[_0x60de('0x22')](function(_0x4617da){_0x26ecee[_0x60de('0x30')]=_0x4617da;if(_0x377ee9[_0x60de('0x3e')][_0x60de('0x50')]){_0x205f5d[_0x60de('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x205f5d);})['then'](function(_0x409ff1){_0x26ecee[_0x60de('0x52')]=_0x409ff1;return _0x26ecee;})[_0x60de('0x22')](respondWithFilteredResult(_0x4822a4,_0x205f5d))['catch'](handleError(_0x4822a4,null));};exports[_0x60de('0x53')]=function(_0x2ed72f,_0xe56d35){var _0x3915d2={'raw':!![],'where':{'id':_0x2ed72f[_0x60de('0x54')]['id']}},_0x1f3e66={};_0x1f3e66[_0x60de('0x3c')]=_[_0x60de('0x3d')](db[_0x60de('0x3a')]['rawAttributes']);_0x1f3e66['query']=_[_0x60de('0x3d')](_0x2ed72f[_0x60de('0x3e')]);_0x1f3e66[_0x60de('0x3f')]=_['intersection'](_0x1f3e66[_0x60de('0x3c')],_0x1f3e66[_0x60de('0x3e')]);_0x3915d2[_0x60de('0x41')]=_['intersection'](_0x1f3e66[_0x60de('0x3c')],qs[_0x60de('0x42')](_0x2ed72f[_0x60de('0x3e')][_0x60de('0x42')]));_0x3915d2[_0x60de('0x41')]=_0x3915d2['attributes'][_0x60de('0x43')]?_0x3915d2[_0x60de('0x41')]:_0x1f3e66[_0x60de('0x3c')];if(_0x2ed72f['query'][_0x60de('0x50')]){_0x3915d2[_0x60de('0x51')]=[{'all':!![]}];}_0x3915d2=_[_0x60de('0x4a')]({},_0x3915d2,_0x2ed72f[_0x60de('0x55')]);return db[_0x60de('0x3a')]['find'](_0x3915d2)['then'](handleEntityNotFound(_0xe56d35,null))[_0x60de('0x22')](respondWithResult(_0xe56d35,null))[_0x60de('0x56')](handleError(_0xe56d35,null));};exports['create']=function(_0x4dade8,_0x18f2ba){return db['ChatMessage'][_0x60de('0x57')](_0x4dade8[_0x60de('0x58')],{})[_0x60de('0x22')](respondWithResult(_0x18f2ba,0xc9))[_0x60de('0x56')](handleError(_0x18f2ba,null));};exports[_0x60de('0x36')]=function(_0x2e6104,_0x2a887c){if(_0x2e6104[_0x60de('0x58')]['id']){delete _0x2e6104[_0x60de('0x58')]['id'];}return db[_0x60de('0x3a')][_0x60de('0x59')]({'where':{'id':_0x2e6104[_0x60de('0x54')]['id']}})['then'](handleEntityNotFound(_0x2a887c,null))[_0x60de('0x22')](saveUpdates(_0x2e6104[_0x60de('0x58')],null))[_0x60de('0x22')](respondWithResult(_0x2a887c,null))[_0x60de('0x56')](handleError(_0x2a887c,null));};exports[_0x60de('0x5a')]=function(_0x126232,_0x2e836d){return db[_0x60de('0x3a')][_0x60de('0x59')]({'where':{'id':_0x126232['params']['id']}})['then'](handleEntityNotFound(_0x2e836d,null))[_0x60de('0x22')](removeEntity(_0x2e836d,null))[_0x60de('0x56')](handleError(_0x2e836d,null));};exports[_0x60de('0x5b')]=function(_0x993585,_0x12806e){return db[_0x60de('0x3a')][_0x60de('0x5b')]()[_0x60de('0x22')](respondWithResult(_0x12806e,null))[_0x60de('0x56')](handleError(_0x12806e,null));};var interaction_log=require('../../config/logger')(_0x60de('0x5c'));exports['accept']=function(_0x3679e7,_0x3ddbba,_0x502df5){var _0x19991d={'channel':_0x60de('0x5d')};if(_0x3679e7[_0x60de('0x58')]['id']){delete _0x3679e7[_0x60de('0x58')]['id'];}_0x3679e7[_0x60de('0x58')][_0x60de('0x5e')]=!![];_0x3679e7[_0x60de('0x58')]['readAt']=moment()['format'](_0x60de('0x5f'));_0x3679e7[_0x60de('0x58')]['UserId']=_0x3679e7[_0x60de('0x58')][_0x60de('0x60')]||_0x3679e7[_0x60de('0x61')]['id'];return db[_0x60de('0x3a')][_0x60de('0x59')]({'where':{'id':_0x3679e7['params']['id'],'UserId':null},'include':[{'model':db[_0x60de('0x62')],'as':'Contact'}]})[_0x60de('0x22')](handleEntityNotFound(_0x3ddbba,null))[_0x60de('0x22')](saveUpdates(_0x3679e7['body'],null))[_0x60de('0x22')](function(_0x4d8603){if(_0x4d8603){_0x19991d[_0x60de('0x2b')]=_0x4d8603[_0x60de('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x60de('0x59')]({'where':{'id':_0x4d8603[_0x60de('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3ddbba,null))['then'](function(_0x3559ba){if(_0x3559ba){return _0x3559ba[_0x60de('0x36')]({'UserId':_0x3679e7[_0x60de('0x58')][_0x60de('0x60')],'read1stAt':_['isNil'](_0x3559ba[_0x60de('0x65')])?moment()[_0x60de('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x60de('0x22')](function(_0x5234fb){if(_0x5234fb){_0x19991d[_0x60de('0x67')]=_0x5234fb[_0x60de('0x63')]({'plain':!![]});interaction_log['info'](_0x60de('0x68'),_0x3679e7[_0x60de('0x61')]['id'],_0x3679e7['user'][_0x60de('0x38')],_0x3679e7[_0x60de('0x61')][_0x60de('0x69')],_0x19991d[_0x60de('0x67')]['id'],_0x3679e7[_0x60de('0x58')]?JSON[_0x60de('0x28')](_0x3679e7['body']):_0x60de('0x6a'));return respondWithRpcPromise(_0x60de('0x6b'),_0x60de('0x6c'),_0x19991d);}return null;})['then'](function(_0x1cf1a5){if(_0x1cf1a5){if(_0x3679e7['body']['manual']){_0x19991d[_0x60de('0x2b')][_0x60de('0x6d')]=util['format'](_0x60de('0x6e'),_0x3679e7[_0x60de('0x61')][_0x60de('0x38')]);_0x19991d[_0x60de('0x2b')][_0x60de('0x6f')]=_0x19991d['channel'];_0x19991d[_0x60de('0x2b')][_0x60de('0x70')]=_0x60de('0x71');return respondWithRpcPromise(_0x60de('0x72'),_0x60de('0x72'),{'event':_0x60de('0x73'),'message':_[_0x60de('0x4a')](_0x19991d[_0x60de('0x2b')],JSON[_0x60de('0x74')](_0x19991d[_0x60de('0x67')][_0x60de('0x75')]))},client9002)[_0x60de('0x22')](function(){return _0x19991d;});}return _0x19991d;}return null;})[_0x60de('0x22')](respondWithResult(_0x3ddbba,null))[_0x60de('0x56')](handleError(_0x3ddbba,null));};var interaction_log=require(_0x60de('0x14'))(_0x60de('0x5c'));exports[_0x60de('0x76')]=function(_0x48d812,_0x959c01,_0x395b83){var _0x561bdd={'agent':{},'channel':_0x60de('0x5d')};if(_0x48d812[_0x60de('0x58')]['id']){delete _0x48d812[_0x60de('0x58')]['id'];}_0x48d812[_0x60de('0x58')]['UserId']=_0x48d812[_0x60de('0x58')]['UserId']||_0x48d812[_0x60de('0x61')]['id'];_0x561bdd[_0x60de('0x77')]['id']=_0x48d812['body']['UserId'];return db[_0x60de('0x3a')][_0x60de('0x59')]({'where':{'id':_0x48d812[_0x60de('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x959c01,null))[_0x60de('0x22')](function(_0x417d11){if(_0x417d11){_0x561bdd[_0x60de('0x2b')]=_0x417d11[_0x60de('0x63')]({'plain':!![]});return db[_0x60de('0x78')][_0x60de('0x59')]({'where':{'id':_0x417d11['ChatInteractionId']}});}return null;})[_0x60de('0x22')](handleEntityNotFound(_0x959c01,null))[_0x60de('0x22')](function(_0x4a69b5){if(_0x4a69b5){_0x561bdd['interaction']=_0x4a69b5['get']({'plain':!![]});interaction_log['info'](_0x60de('0x79'),_0x48d812[_0x60de('0x61')]['id'],_0x48d812['user'][_0x60de('0x38')],_0x48d812[_0x60de('0x61')][_0x60de('0x69')],_0x561bdd[_0x60de('0x67')]['id'],_0x48d812['body']?JSON[_0x60de('0x28')](_0x48d812[_0x60de('0x58')]):_0x60de('0x6a'));return respondWithRpcPromise(_0x60de('0x7a'),_0x60de('0x7b'),_0x561bdd);}return null;})[_0x60de('0x22')](function(_0x2069ec){if(_0x2069ec){_0x2069ec[_0x60de('0x2b')][_0x60de('0x6d')]=util[_0x60de('0x66')]('SIP/%s',_0x48d812[_0x60de('0x61')][_0x60de('0x38')]);_0x2069ec[_0x60de('0x2b')]['channel']=_0x561bdd[_0x60de('0x6f')];_0x2069ec[_0x60de('0x2b')][_0x60de('0x70')]=_0x60de('0x76');respondWithRpcPromise(_0x60de('0x72'),'EventManager',{'event':_0x60de('0x7c'),'message':_0x2069ec['message']},client9002);return _0x561bdd;}return null;})[_0x60de('0x22')](respondWithResult(_0x959c01,null))[_0x60de('0x56')](handleError(_0x959c01,null));}; \ No newline at end of file +var _0x18e0=['merge','map','type','VIRTUAL','filter','options','includeAll','findAll','rows','rawAttributes','include','create','body','update','find','params','destroy','describe','../../config/logger','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','name','ChatMessage','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x5f0c2e,_0x33309f){var _0x1c2dda=function(_0x205be4){while(--_0x205be4){_0x5f0c2e['push'](_0x5f0c2e['shift']());}};_0x1c2dda(++_0x33309f);}(_0x18e0,0xa2));var _0x018e=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x18e0[_0x556927];return _0x5f1235;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x018e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x018e('0x1'));var jsonpatch=require(_0x018e('0x2'));var rp=require(_0x018e('0x3'));var moment=require('moment');var BPromise=require(_0x018e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x018e('0x5'));var sox=require(_0x018e('0x6'));var csv=require(_0x018e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x018e('0x8'));var crypto=require(_0x018e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x018e('0xa'));var toCsv=require(_0x018e('0x7'));var querystring=require(_0x018e('0xb'));var Papa=require(_0x018e('0xc'));var Redis=require(_0x018e('0xd'));var authService=require(_0x018e('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x018e('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x018e('0x10'));var db=require(_0x018e('0x11'))['db'];config[_0x018e('0x12')]=_[_0x018e('0x13')](config[_0x018e('0x12')],{'host':_0x018e('0x14'),'port':0x18eb});var socket=require(_0x018e('0x15'))(new Redis(config[_0x018e('0x12')]));require(_0x018e('0x16'))['register'](socket);var jayson=require(_0x018e('0x17'));var client=jayson[_0x018e('0x18')][_0x018e('0x19')]({'port':0x232c});var client9002=jayson[_0x018e('0x18')][_0x018e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5bfd6e,_0x275c21,_0x142f1e){if(_0x142f1e){var _0x41cbd8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41cbd8[_0x018e('0x1a')](_0x275c21)){return _0x5bfd6e;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5bfd6e;}}function respondWithRpcPromise(_0x1949f4,_0x3fb2fa,_0x4d46aa,_0x2f85fd){return new BPromise(function(_0x237ba1,_0x6fc4a3){var _0xdf15f8=_0x2f85fd||client;return _0xdf15f8[_0x018e('0x1b')](_0x1949f4,_0x4d46aa)['then'](function(_0x2e18b2){logger[_0x018e('0x1c')](_0x018e('0x1d'),_0x3fb2fa,_0x018e('0x1e'));logger[_0x018e('0x1f')](_0x018e('0x20'),_0x3fb2fa,_0x018e('0x1e'),JSON['stringify'](_0x2e18b2));if(_0x2e18b2[_0x018e('0x21')]){if(_0x2e18b2[_0x018e('0x21')][_0x018e('0x22')]===0x1f4){logger[_0x018e('0x21')](_0x018e('0x1d'),_0x3fb2fa,_0x2e18b2['error']['message']);return _0x6fc4a3(_0x2e18b2[_0x018e('0x21')][_0x018e('0x23')]);}logger[_0x018e('0x21')](_0x018e('0x1d'),_0x3fb2fa,_0x2e18b2[_0x018e('0x21')][_0x018e('0x23')]);return _0x237ba1(_0x2e18b2[_0x018e('0x21')][_0x018e('0x23')]);}else{logger[_0x018e('0x1c')](_0x018e('0x1d'),_0x3fb2fa,_0x018e('0x1e'));_0x237ba1(_0x2e18b2[_0x018e('0x24')]['message']);}})[_0x018e('0x25')](function(_0x289931){logger[_0x018e('0x21')](_0x018e('0x1d'),_0x3fb2fa,_0x289931);_0x6fc4a3(_0x289931);});});}function respondWithStatusCode(_0x2167e6,_0x184990){_0x184990=_0x184990||0xcc;return function(_0x407fda){if(_0x407fda){return _0x2167e6[_0x018e('0x26')](_0x184990);}return _0x2167e6[_0x018e('0x27')](_0x184990)[_0x018e('0x28')]();};}function respondWithResult(_0x55e64b,_0x29455a){_0x29455a=_0x29455a||0xc8;return function(_0x1a4726){if(_0x1a4726){return _0x55e64b['status'](_0x29455a)[_0x018e('0x29')](_0x1a4726);}};}function respondWithFilteredResult(_0x2ebdfa,_0x471e30){return function(_0x2836b1){if(_0x2836b1){var _0x13929e=_0x2836b1[_0x018e('0x2a')],_0x42da91=_0x471e30['offset'],_0x47af9d=_0x471e30[_0x018e('0x2b')]+_0x471e30[_0x018e('0x2c')],_0x2db83e;if(_0x47af9d>=_0x13929e){_0x47af9d=_0x13929e;_0x2db83e=0xc8;}else{_0x2db83e=0xce;}_0x2ebdfa[_0x018e('0x27')](_0x2db83e);return _0x2ebdfa[_0x018e('0x2d')](_0x018e('0x2e'),_0x42da91+'-'+_0x47af9d+'/'+_0x13929e)['json'](_0x2836b1);}return null;};}function patchUpdates(_0xafd399){return function(_0x18afcd){try{jsonpatch[_0x018e('0x2f')](_0x18afcd,_0xafd399,!![]);}catch(_0x502763){return BPromise[_0x018e('0x30')](_0x502763);}return _0x18afcd['save']();};}function saveUpdates(_0x437da4,_0x17398e){return function(_0x5d47a7){if(_0x5d47a7){return _0x5d47a7['update'](_0x437da4)[_0x018e('0x31')](function(_0x359e03){return _0x359e03;});}return null;};}function removeEntity(_0x31a675,_0x37f8f6){return function(_0x3b52f7){if(_0x3b52f7){return _0x3b52f7['destroy']()[_0x018e('0x31')](function(){_0x31a675[_0x018e('0x27')](0xcc)[_0x018e('0x28')]();});}};}function handleEntityNotFound(_0x55dbda,_0x5a2741){return function(_0x14dbe3){if(!_0x14dbe3){_0x55dbda[_0x018e('0x26')](0x194);}return _0x14dbe3;};}function handleError(_0x3f72a8,_0x41be1e){_0x41be1e=_0x41be1e||0x1f4;return function(_0x40483f){logger[_0x018e('0x21')](_0x40483f['stack']);if(_0x40483f[_0x018e('0x32')]){delete _0x40483f[_0x018e('0x32')];}_0x3f72a8['status'](_0x41be1e)['send'](_0x40483f);};}exports['index']=function(_0x3b6e6a,_0x8ed5c){var _0x21c0a7={},_0x1705b7={},_0x46344c={'count':0x0,'rows':[]};var _0x58867c=db[_0x018e('0x33')]['rawAttributes'];_0x1705b7[_0x018e('0x34')]=_[_0x018e('0x35')](_0x58867c);_0x1705b7[_0x018e('0x36')]=_[_0x018e('0x35')](_0x3b6e6a['query']);_0x1705b7[_0x018e('0x37')]=_[_0x018e('0x38')](_0x1705b7['model'],_0x1705b7['query']);_0x21c0a7[_0x018e('0x39')]=_['intersection'](_0x1705b7[_0x018e('0x34')],qs[_0x018e('0x3a')](_0x3b6e6a['query'][_0x018e('0x3a')]));_0x21c0a7[_0x018e('0x39')]=_0x21c0a7[_0x018e('0x39')][_0x018e('0x3b')]?_0x21c0a7[_0x018e('0x39')]:_0x1705b7[_0x018e('0x34')];if(!_0x3b6e6a[_0x018e('0x36')][_0x018e('0x3c')]('nolimit')){_0x21c0a7[_0x018e('0x2c')]=qs[_0x018e('0x2c')](_0x3b6e6a['query'][_0x018e('0x2c')]);_0x21c0a7[_0x018e('0x2b')]=qs[_0x018e('0x2b')](_0x3b6e6a[_0x018e('0x36')][_0x018e('0x2b')]);}_0x21c0a7['order']=qs[_0x018e('0x3d')](_0x3b6e6a['query'][_0x018e('0x3d')]);_0x21c0a7[_0x018e('0x3e')]=qs[_0x018e('0x37')](_[_0x018e('0x3f')](_0x3b6e6a['query'],_0x1705b7[_0x018e('0x37')]));if(_0x3b6e6a[_0x018e('0x36')]['filter']){_0x21c0a7[_0x018e('0x3e')]=_[_0x018e('0x40')](_0x21c0a7[_0x018e('0x3e')],{'$or':_[_0x018e('0x41')](_0x58867c,function(_0x17a0ae){if(_0x17a0ae[_0x018e('0x42')]['key']!==_0x018e('0x43')){var _0x196b21={};_0x196b21[_0x17a0ae['field']]={'$like':'%'+_0x3b6e6a[_0x018e('0x36')][_0x018e('0x44')]+'%'};return _0x196b21;}})});}_0x21c0a7=_[_0x018e('0x40')]({},_0x21c0a7,_0x3b6e6a[_0x018e('0x45')]);var _0x376541={'where':_0x21c0a7[_0x018e('0x3e')]};return db[_0x018e('0x33')][_0x018e('0x2a')](_0x376541)[_0x018e('0x31')](function(_0x35cafb){_0x46344c[_0x018e('0x2a')]=_0x35cafb;if(_0x3b6e6a['query'][_0x018e('0x46')]){_0x21c0a7['include']=[{'all':!![]}];}return db[_0x018e('0x33')][_0x018e('0x47')](_0x21c0a7);})['then'](function(_0x48fdb5){_0x46344c[_0x018e('0x48')]=_0x48fdb5;return _0x46344c;})['then'](respondWithFilteredResult(_0x8ed5c,_0x21c0a7))['catch'](handleError(_0x8ed5c,null));};exports['show']=function(_0x3e26b1,_0x16e8b0){var _0x22f1d4={'raw':!![],'where':{'id':_0x3e26b1['params']['id']}},_0xdca553={};_0xdca553[_0x018e('0x34')]=_[_0x018e('0x35')](db[_0x018e('0x33')][_0x018e('0x49')]);_0xdca553[_0x018e('0x36')]=_[_0x018e('0x35')](_0x3e26b1[_0x018e('0x36')]);_0xdca553[_0x018e('0x37')]=_['intersection'](_0xdca553[_0x018e('0x34')],_0xdca553[_0x018e('0x36')]);_0x22f1d4[_0x018e('0x39')]=_[_0x018e('0x38')](_0xdca553['model'],qs[_0x018e('0x3a')](_0x3e26b1[_0x018e('0x36')][_0x018e('0x3a')]));_0x22f1d4['attributes']=_0x22f1d4[_0x018e('0x39')][_0x018e('0x3b')]?_0x22f1d4['attributes']:_0xdca553[_0x018e('0x34')];if(_0x3e26b1[_0x018e('0x36')][_0x018e('0x46')]){_0x22f1d4[_0x018e('0x4a')]=[{'all':!![]}];}_0x22f1d4=_[_0x018e('0x40')]({},_0x22f1d4,_0x3e26b1[_0x018e('0x45')]);return db['ChatMessage']['find'](_0x22f1d4)[_0x018e('0x31')](handleEntityNotFound(_0x16e8b0,null))[_0x018e('0x31')](respondWithResult(_0x16e8b0,null))[_0x018e('0x25')](handleError(_0x16e8b0,null));};exports['create']=function(_0x45bdc3,_0x586dcc){return db['ChatMessage'][_0x018e('0x4b')](_0x45bdc3[_0x018e('0x4c')],{})[_0x018e('0x31')](respondWithResult(_0x586dcc,0xc9))['catch'](handleError(_0x586dcc,null));};exports[_0x018e('0x4d')]=function(_0x733476,_0x129dd7){if(_0x733476[_0x018e('0x4c')]['id']){delete _0x733476[_0x018e('0x4c')]['id'];}return db['ChatMessage'][_0x018e('0x4e')]({'where':{'id':_0x733476[_0x018e('0x4f')]['id']}})[_0x018e('0x31')](handleEntityNotFound(_0x129dd7,null))[_0x018e('0x31')](saveUpdates(_0x733476[_0x018e('0x4c')],null))[_0x018e('0x31')](respondWithResult(_0x129dd7,null))[_0x018e('0x25')](handleError(_0x129dd7,null));};exports[_0x018e('0x50')]=function(_0x268c9a,_0x3b1b5c){return db[_0x018e('0x33')][_0x018e('0x4e')]({'where':{'id':_0x268c9a[_0x018e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3b1b5c,null))[_0x018e('0x31')](removeEntity(_0x3b1b5c,null))[_0x018e('0x25')](handleError(_0x3b1b5c,null));};exports[_0x018e('0x51')]=function(_0x42de5c,_0x78dba3){return db['ChatMessage'][_0x018e('0x51')]()[_0x018e('0x31')](respondWithResult(_0x78dba3,null))[_0x018e('0x25')](handleError(_0x78dba3,null));};var interaction_log=require(_0x018e('0x52'))('chat-interactions');exports['accept']=function(_0x9f7cbc,_0xfe23d2,_0x53ed4b){var _0x44a9b4={'channel':_0x018e('0x53')};if(_0x9f7cbc[_0x018e('0x4c')]['id']){delete _0x9f7cbc['body']['id'];}_0x9f7cbc['body']['read']=!![];_0x9f7cbc[_0x018e('0x4c')]['readAt']=moment()[_0x018e('0x54')](_0x018e('0x55'));_0x9f7cbc[_0x018e('0x4c')][_0x018e('0x56')]=_0x9f7cbc[_0x018e('0x4c')][_0x018e('0x56')]||_0x9f7cbc['user']['id'];return db[_0x018e('0x33')][_0x018e('0x4e')]({'where':{'id':_0x9f7cbc[_0x018e('0x4f')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x018e('0x57')}]})[_0x018e('0x31')](handleEntityNotFound(_0xfe23d2,null))[_0x018e('0x31')](saveUpdates(_0x9f7cbc[_0x018e('0x4c')],null))[_0x018e('0x31')](function(_0x16d8ae){if(_0x16d8ae){_0x44a9b4[_0x018e('0x23')]=_0x16d8ae[_0x018e('0x58')]({'plain':!![]});return db[_0x018e('0x59')][_0x018e('0x4e')]({'where':{'id':_0x16d8ae[_0x018e('0x5a')]}});}return null;})[_0x018e('0x31')](handleEntityNotFound(_0xfe23d2,null))[_0x018e('0x31')](function(_0x57d566){if(_0x57d566){return _0x57d566['update']({'UserId':_0x9f7cbc['body'][_0x018e('0x56')],'read1stAt':_[_0x018e('0x5b')](_0x57d566[_0x018e('0x5c')])?moment()['format'](_0x018e('0x55')):undefined});}return null;})[_0x018e('0x31')](function(_0x4c089c){if(_0x4c089c){_0x44a9b4[_0x018e('0x5d')]=_0x4c089c[_0x018e('0x58')]({'plain':!![]});interaction_log[_0x018e('0x1c')](_0x018e('0x5e'),_0x9f7cbc[_0x018e('0x5f')]['id'],_0x9f7cbc['user']['name'],_0x9f7cbc[_0x018e('0x5f')][_0x018e('0x60')],_0x44a9b4[_0x018e('0x5d')]['id'],_0x9f7cbc['body']?JSON[_0x018e('0x61')](_0x9f7cbc['body']):_0x018e('0x62'));return respondWithRpcPromise(_0x018e('0x63'),_0x018e('0x64'),_0x44a9b4);}return null;})[_0x018e('0x31')](function(_0x427691){if(_0x427691){if(_0x9f7cbc['body']['manual']){_0x44a9b4[_0x018e('0x23')][_0x018e('0x65')]=util['format'](_0x018e('0x66'),_0x9f7cbc[_0x018e('0x5f')][_0x018e('0x32')]);_0x44a9b4[_0x018e('0x23')]['channel']=_0x44a9b4[_0x018e('0x67')];_0x44a9b4[_0x018e('0x23')][_0x018e('0x68')]='accept';return respondWithRpcPromise('EventManager',_0x018e('0x69'),{'event':'acceptmessage','message':_[_0x018e('0x40')](_0x44a9b4[_0x018e('0x23')],JSON[_0x018e('0x6a')](_0x44a9b4[_0x018e('0x5d')][_0x018e('0x6b')]))},client9002)[_0x018e('0x31')](function(){return _0x44a9b4;});}return _0x44a9b4;}return null;})[_0x018e('0x31')](respondWithResult(_0xfe23d2,null))[_0x018e('0x25')](handleError(_0xfe23d2,null));};var interaction_log=require(_0x018e('0x52'))(_0x018e('0x6c'));exports[_0x018e('0x30')]=function(_0xa3627f,_0x3b1f1b,_0x50dd1f){var _0x1d2ad5={'agent':{},'channel':_0x018e('0x53')};if(_0xa3627f['body']['id']){delete _0xa3627f[_0x018e('0x4c')]['id'];}_0xa3627f[_0x018e('0x4c')][_0x018e('0x56')]=_0xa3627f[_0x018e('0x4c')][_0x018e('0x56')]||_0xa3627f[_0x018e('0x5f')]['id'];_0x1d2ad5['agent']['id']=_0xa3627f[_0x018e('0x4c')][_0x018e('0x56')];return db[_0x018e('0x33')][_0x018e('0x4e')]({'where':{'id':_0xa3627f['params']['id'],'UserId':null}})[_0x018e('0x31')](handleEntityNotFound(_0x3b1f1b,null))[_0x018e('0x31')](function(_0x4aa311){if(_0x4aa311){_0x1d2ad5[_0x018e('0x23')]=_0x4aa311[_0x018e('0x58')]({'plain':!![]});return db[_0x018e('0x59')][_0x018e('0x4e')]({'where':{'id':_0x4aa311['ChatInteractionId']}});}return null;})[_0x018e('0x31')](handleEntityNotFound(_0x3b1f1b,null))[_0x018e('0x31')](function(_0x5de0ed){if(_0x5de0ed){_0x1d2ad5['interaction']=_0x5de0ed['get']({'plain':!![]});interaction_log[_0x018e('0x1c')](_0x018e('0x6d'),_0xa3627f['user']['id'],_0xa3627f[_0x018e('0x5f')][_0x018e('0x32')],_0xa3627f['user']['role'],_0x1d2ad5[_0x018e('0x5d')]['id'],_0xa3627f[_0x018e('0x4c')]?JSON[_0x018e('0x61')](_0xa3627f[_0x018e('0x4c')]):_0x018e('0x62'));return respondWithRpcPromise(_0x018e('0x6e'),_0x018e('0x6f'),_0x1d2ad5);}return null;})['then'](function(_0xb41881){if(_0xb41881){_0xb41881['message'][_0x018e('0x65')]=util[_0x018e('0x54')]('SIP/%s',_0xa3627f[_0x018e('0x5f')]['name']);_0xb41881['message'][_0x018e('0x67')]=_0x1d2ad5[_0x018e('0x67')];_0xb41881[_0x018e('0x23')][_0x018e('0x68')]=_0x018e('0x30');respondWithRpcPromise(_0x018e('0x69'),_0x018e('0x69'),{'event':_0x018e('0x70'),'message':_0xb41881[_0x018e('0x23')]},client9002);return _0x1d2ad5;}return null;})['then'](respondWithResult(_0x3b1f1b,null))[_0x018e('0x25')](handleError(_0x3b1f1b,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 74f5995..5094b24 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 _0x4898=['save','update','remove','emit','hasOwnProperty','../../mysqldb','ChatMessage'];(function(_0x28aa82,_0x48694c){var _0x58b20c=function(_0x5579cb){while(--_0x5579cb){_0x28aa82['push'](_0x28aa82['shift']());}};_0x58b20c(++_0x48694c);}(_0x4898,0x163));var _0x8489=function(_0x481234,_0x91186c){_0x481234=_0x481234-0x0;var _0x22c9e8=_0x4898[_0x481234];return _0x22c9e8;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8489('0x0'))['db'][_0x8489('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8489('0x2'),'afterUpdate':_0x8489('0x3'),'afterDestroy':_0x8489('0x4')};function emitEvent(_0x2636a5){return function(_0x5a11bc,_0x5dfecc,_0x19d45d){ChatMessageEvents[_0x8489('0x5')](_0x2636a5+':'+_0x5a11bc['id'],_0x5a11bc);ChatMessageEvents[_0x8489('0x5')](_0x2636a5,_0x5a11bc);_0x19d45d(null);};}for(var e in events){if(events[_0x8489('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x2180=['../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x29cdda,_0x4af63e){var _0x4c1c25=function(_0x8693c1){while(--_0x8693c1){_0x29cdda['push'](_0x29cdda['shift']());}};_0x4c1c25(++_0x4af63e);}(_0x2180,0xa0));var _0x0218=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2180[_0x513aa5];return _0x1a1a7c;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0218('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0218('0x1'),'afterUpdate':_0x0218('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4e54b6){return function(_0x2c52fb,_0x1b544e,_0x3f4211){ChatMessageEvents[_0x0218('0x3')](_0x4e54b6+':'+_0x2c52fb['id'],_0x2c52fb);ChatMessageEvents[_0x0218('0x3')](_0x4e54b6,_0x2c52fb);_0x3f4211(null);};}for(var e in events){if(events[_0x0218('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index deb6ea0..fc17619 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 _0x9c5b=['then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne'];(function(_0x1ddd63,_0x84aeb9){var _0x5a2bff=function(_0x279a36){while(--_0x279a36){_0x1ddd63['push'](_0x1ddd63['shift']());}};_0x5a2bff(++_0x84aeb9);}(_0x9c5b,0xa8));var _0xb9c5=function(_0x5215e6,_0x14c378){_0x5215e6=_0x5215e6-0x0;var _0x145c9c=_0x9c5b[_0x5215e6];return _0x145c9c;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var logger=require(_0xb9c5('0x1'))(_0xb9c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9c5('0x3'));var fs=require('fs');var path=require(_0xb9c5('0x4'));var rimraf=require(_0xb9c5('0x5'));var config=require(_0xb9c5('0x6'));var attributes=require('./chatMessage.attributes');module[_0xb9c5('0x7')]=function(_0x12d6f9,_0x406d97){return _0x12d6f9[_0xb9c5('0x8')]('ChatMessage',attributes,{'tableName':_0xb9c5('0x9'),'paranoid':![],'indexes':[{'name':_0xb9c5('0xa'),'fields':[_0xb9c5('0xb')],'type':_0xb9c5('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37a2a5,_0x59785e,_0x1e988b){var _0x519f64=_0x12d6f9[_0xb9c5('0xd')];var _0x474cd1=_0x37a2a5[_0xb9c5('0xe')]({'plain':!![]});if(_0x474cd1[_0xb9c5('0xf')][_0xb9c5('0x10')]()==='in'||_0x474cd1[_0xb9c5('0xf')][_0xb9c5('0x10')]()==='out'&&!_0x474cd1[_0xb9c5('0x11')]&&!_[_0xb9c5('0x12')](_0x474cd1[_0xb9c5('0x13')])){_0x519f64['ChatInteraction'][_0xb9c5('0x14')]({'where':{'id':_0x474cd1['ChatInteractionId']}})[_0xb9c5('0x15')](function(_0x516289){if(_0x516289){_0x516289[_0xb9c5('0x16')]({'lastMsgAt':_0x474cd1['createdAt'],'lastMsgDirection':_0x474cd1[_0xb9c5('0xf')]['toLowerCase']()});}})[_0xb9c5('0x17')](function(_0x34ba95){console[_0xb9c5('0x18')](_0x34ba95);});}_0x1e988b();}},'charset':_0xb9c5('0x19'),'collate':_0xb9c5('0x1a')});}; \ No newline at end of file +var _0xc75e=['models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatMessage','fti_chat_messages','body','FULLTEXT'];(function(_0x2672ce,_0x293180){var _0x56e634=function(_0x28ff01){while(--_0x28ff01){_0x2672ce['push'](_0x2672ce['shift']());}};_0x56e634(++_0x293180);}(_0xc75e,0xf7));var _0xec75=function(_0x232be0,_0x274db7){_0x232be0=_0x232be0-0x0;var _0x1f9d3f=_0xc75e[_0x232be0];return _0x1f9d3f;};'use strict';var _=require(_0xec75('0x0'));var util=require(_0xec75('0x1'));var logger=require(_0xec75('0x2'))(_0xec75('0x3'));var moment=require(_0xec75('0x4'));var BPromise=require(_0xec75('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec75('0x6'));var rimraf=require(_0xec75('0x7'));var config=require(_0xec75('0x8'));var attributes=require('./chatMessage.attributes');module[_0xec75('0x9')]=function(_0x351a9b,_0x179fbf){return _0x351a9b['define'](_0xec75('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xec75('0xb'),'fields':[_0xec75('0xc')],'type':_0xec75('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x332173,_0x2fa2c3,_0x30e6fc){var _0x18197a=_0x351a9b[_0xec75('0xe')];var _0x183546=_0x332173[_0xec75('0xf')]({'plain':!![]});if(_0x183546[_0xec75('0x10')][_0xec75('0x11')]()==='in'||_0x183546['direction'][_0xec75('0x11')]()===_0xec75('0x12')&&!_0x183546[_0xec75('0x13')]&&!_[_0xec75('0x14')](_0x183546['UserId'])){_0x18197a[_0xec75('0x15')][_0xec75('0x16')]({'where':{'id':_0x183546[_0xec75('0x17')]}})[_0xec75('0x18')](function(_0x5d1892){if(_0x5d1892){_0x5d1892[_0xec75('0x19')]({'lastMsgAt':_0x183546['createdAt'],'lastMsgDirection':_0x183546[_0xec75('0x10')][_0xec75('0x11')]()});}})[_0xec75('0x1a')](function(_0x31d696){console['error'](_0x31d696);});}_0x30e6fc();}},'charset':_0xec75('0x1b'),'collate':_0xec75('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 69e27f4..b71c699 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 _0xe7fb=['client','http','defaults','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ChatMessage','create','options','raw','CreateChatMessage','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xe7fb,0xcb));var _0xbe7f=function(_0x565778,_0x3cc8f0){_0x565778=_0x565778-0x0;var _0x4180eb=_0xe7fb[_0x565778];return _0x4180eb;};'use strict';var _=require(_0xbe7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe7f('0x1'));var fs=require('fs');var Redis=require(_0xbe7f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe7f('0x3'));var logger=require('../../config/logger')(_0xbe7f('0x4'));var config=require(_0xbe7f('0x5'));var jayson=require(_0xbe7f('0x6'));var client=jayson[_0xbe7f('0x7')][_0xbe7f('0x8')]({'port':0x232a});config['redis']=_[_0xbe7f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbe7f('0xa'))(new Redis(config[_0xbe7f('0xb')]));require(_0xbe7f('0xc'))[_0xbe7f('0xd')](socket);function respondWithRpcPromise(_0x5976e3,_0x3c2a3f,_0x58d45e){return new BPromise(function(_0x5fa2d9,_0x258f6d){return client[_0xbe7f('0xe')](_0x5976e3,_0x58d45e)[_0xbe7f('0xf')](function(_0x31361f){logger[_0xbe7f('0x10')](_0xbe7f('0x11'),_0x3c2a3f,_0xbe7f('0x12'));logger[_0xbe7f('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c2a3f,'request\x20sent',JSON[_0xbe7f('0x14')](_0x31361f));if(_0x31361f[_0xbe7f('0x15')]){if(_0x31361f['error'][_0xbe7f('0x16')]===0x1f4){logger[_0xbe7f('0x15')](_0xbe7f('0x11'),_0x3c2a3f,_0x31361f[_0xbe7f('0x15')][_0xbe7f('0x17')]);return _0x258f6d(_0x31361f[_0xbe7f('0x15')]['message']);}logger[_0xbe7f('0x15')](_0xbe7f('0x11'),_0x3c2a3f,_0x31361f['error'][_0xbe7f('0x17')]);return _0x5fa2d9(_0x31361f[_0xbe7f('0x15')]['message']);}else{logger[_0xbe7f('0x10')]('ChatMessage,\x20%s,\x20%s',_0x3c2a3f,'request\x20sent');_0x5fa2d9(_0x31361f[_0xbe7f('0x18')]['message']);}})['catch'](function(_0x40a97c){logger[_0xbe7f('0x15')](_0xbe7f('0x11'),_0x3c2a3f,_0x40a97c);_0x258f6d(_0x40a97c);});});}exports['CreateChatMessage']=function(_0x53dd3a){var _0x5ef31b=this;return new Promise(function(_0x4b28dc,_0x29ae51){return db[_0xbe7f('0x19')][_0xbe7f('0x1a')](_0x53dd3a['body'],{'raw':_0x53dd3a['options']?_0x53dd3a[_0xbe7f('0x1b')][_0xbe7f('0x1c')]===undefined?!![]:![]:!![]})[_0xbe7f('0xf')](function(_0x15cc28){logger[_0xbe7f('0x10')](_0xbe7f('0x1d'),_0x53dd3a);logger[_0xbe7f('0x13')](_0xbe7f('0x1d'),_0x53dd3a,JSON[_0xbe7f('0x14')](_0x15cc28));_0x4b28dc(_0x15cc28);})['catch'](function(_0x902299){logger[_0xbe7f('0x15')]('CreateChatMessage',_0x902299[_0xbe7f('0x17')],_0x53dd3a);_0x29ae51(_0x5ef31b[_0xbe7f('0x15')](0x1f4,_0x902299[_0xbe7f('0x17')]));});});}; \ No newline at end of file +var _0xec1e=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify','catch','util'];(function(_0x5a5083,_0x1f786d){var _0x474f36=function(_0x375ba6){while(--_0x375ba6){_0x5a5083['push'](_0x5a5083['shift']());}};_0x474f36(++_0x1f786d);}(_0xec1e,0x1b9));var _0xeec1=function(_0x72ec03,_0x593928){_0x72ec03=_0x72ec03-0x0;var _0x33e425=_0xec1e[_0x72ec03];return _0x33e425;};'use strict';var _=require('lodash');var util=require(_0xeec1('0x0'));var moment=require(_0xeec1('0x1'));var BPromise=require(_0xeec1('0x2'));var rs=require(_0xeec1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeec1('0x4'))['db'];var utils=require(_0xeec1('0x5'));var logger=require(_0xeec1('0x6'))(_0xeec1('0x7'));var config=require(_0xeec1('0x8'));var jayson=require(_0xeec1('0x9'));var client=jayson[_0xeec1('0xa')][_0xeec1('0xb')]({'port':0x232a});config[_0xeec1('0xc')]=_[_0xeec1('0xd')](config[_0xeec1('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeec1('0xc')]));require(_0xeec1('0xe'))[_0xeec1('0xf')](socket);function respondWithRpcPromise(_0x420f0f,_0x1dee4a,_0x2ffc4f){return new BPromise(function(_0x47efa1,_0x557783){return client[_0xeec1('0x10')](_0x420f0f,_0x2ffc4f)['then'](function(_0x3fa8b4){logger[_0xeec1('0x11')](_0xeec1('0x12'),_0x1dee4a,_0xeec1('0x13'));logger[_0xeec1('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1dee4a,_0xeec1('0x13'),JSON['stringify'](_0x3fa8b4));if(_0x3fa8b4[_0xeec1('0x15')]){if(_0x3fa8b4[_0xeec1('0x15')][_0xeec1('0x16')]===0x1f4){logger[_0xeec1('0x15')](_0xeec1('0x12'),_0x1dee4a,_0x3fa8b4[_0xeec1('0x15')][_0xeec1('0x17')]);return _0x557783(_0x3fa8b4[_0xeec1('0x15')][_0xeec1('0x17')]);}logger[_0xeec1('0x15')](_0xeec1('0x12'),_0x1dee4a,_0x3fa8b4['error'][_0xeec1('0x17')]);return _0x47efa1(_0x3fa8b4['error'][_0xeec1('0x17')]);}else{logger[_0xeec1('0x11')](_0xeec1('0x12'),_0x1dee4a,_0xeec1('0x13'));_0x47efa1(_0x3fa8b4[_0xeec1('0x18')][_0xeec1('0x17')]);}})['catch'](function(_0x26a039){logger[_0xeec1('0x15')](_0xeec1('0x12'),_0x1dee4a,_0x26a039);_0x557783(_0x26a039);});});}exports[_0xeec1('0x19')]=function(_0x53bf23){var _0xb73865=this;return new Promise(function(_0x19622a,_0x501a0d){return db[_0xeec1('0x1a')][_0xeec1('0x1b')](_0x53bf23[_0xeec1('0x1c')],{'raw':_0x53bf23['options']?_0x53bf23[_0xeec1('0x1d')][_0xeec1('0x1e')]===undefined?!![]:![]:!![]})[_0xeec1('0x1f')](function(_0x44b621){logger[_0xeec1('0x11')](_0xeec1('0x19'),_0x53bf23);logger['debug'](_0xeec1('0x19'),_0x53bf23,JSON[_0xeec1('0x20')](_0x44b621));_0x19622a(_0x44b621);})[_0xeec1('0x21')](function(_0x3e83d1){logger[_0xeec1('0x15')](_0xeec1('0x19'),_0x3e83d1['message'],_0x53bf23);_0x501a0d(_0xb73865[_0xeec1('0x15')](0x1f4,_0x3e83d1[_0xeec1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index c73f804..65888e4 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 _0xedd9=['removeListener','register','length','chatMessage:','save','remove','update','emit'];(function(_0x15ec70,_0x404c8d){var _0xd369a4=function(_0x1a6974){while(--_0x1a6974){_0x15ec70['push'](_0x15ec70['shift']());}};_0xd369a4(++_0x404c8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ff623,_0x8b6a6d){_0x2ff623=_0x2ff623-0x0;var _0x520067=_0xedd9[_0x2ff623];return _0x520067;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x70e0=['chatMessage:','./chatMessage.events','save','remove','emit','removeListener'];(function(_0x5a0287,_0x4bdef0){var _0x3d4873=function(_0x60b4ca){while(--_0x60b4ca){_0x5a0287['push'](_0x5a0287['shift']());}};_0x3d4873(++_0x4bdef0);}(_0x70e0,0x17b));var _0x070e=function(_0x24f715,_0x16b753){_0x24f715=_0x24f715-0x0;var _0x50f180=_0x70e0[_0x24f715];return _0x50f180;};'use strict';var ChatMessageEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatMessageEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatMessageEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index aa92a17..ccc11ba 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 _0x3b39=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','/:id','show','tracked','chatmessage:create','create','put','update','/:id/accept','reject','delete','exports','multer','util','connect-timeout','express'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x3b39,0x6f));var _0x93b3=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0x3b39[_0x367995];return _0x22daa8;};'use strict';var multer=require(_0x93b3('0x0'));var util=require(_0x93b3('0x1'));var path=require('path');var timeout=require(_0x93b3('0x2'));var express=require(_0x93b3('0x3'));var router=express[_0x93b3('0x4')]();var auth=require(_0x93b3('0x5'));var interaction=require(_0x93b3('0x6'));var config=require(_0x93b3('0x7'));var controller=require(_0x93b3('0x8'));router['get']('/',auth[_0x93b3('0x9')](),controller['index']);router[_0x93b3('0xa')](_0x93b3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x93b3('0xa')](_0x93b3('0xc'),auth[_0x93b3('0x9')](),controller[_0x93b3('0xd')]);router['post']('/',auth[_0x93b3('0x9')](),interaction[_0x93b3('0xe')]('chat',_0x93b3('0xf')),controller[_0x93b3('0x10')]);router[_0x93b3('0x11')](_0x93b3('0xc'),controller[_0x93b3('0x12')]);router['put'](_0x93b3('0x13'),auth[_0x93b3('0x9')](),controller['accept']);router[_0x93b3('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0x93b3('0x14')]);router[_0x93b3('0x15')](_0x93b3('0xc'),auth[_0x93b3('0x9')](),controller['destroy']);module[_0x93b3('0x16')]=router; \ No newline at end of file +var _0xa948=['isAuthenticated','describe','/:id','show','post','chat','chatmessage:create','create','put','update','reject','delete','destroy','exports','util','path','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0xa948,0x1dc));var _0x8a94=function(_0x2f8512,_0x271ada){_0x2f8512=_0x2f8512-0x0;var _0x53374e=_0xa948[_0x2f8512];return _0x53374e;};'use strict';var multer=require('multer');var util=require(_0x8a94('0x0'));var path=require(_0x8a94('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8a94('0x2'));var config=require(_0x8a94('0x3'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8a94('0x4')]);router[_0x8a94('0x5')](_0x8a94('0x6'),auth[_0x8a94('0x7')](),controller[_0x8a94('0x8')]);router[_0x8a94('0x5')](_0x8a94('0x9'),auth['isAuthenticated'](),controller[_0x8a94('0xa')]);router[_0x8a94('0xb')]('/',auth[_0x8a94('0x7')](),interaction['tracked'](_0x8a94('0xc'),_0x8a94('0xd')),controller[_0x8a94('0xe')]);router[_0x8a94('0xf')](_0x8a94('0x9'),controller[_0x8a94('0x10')]);router[_0x8a94('0xf')]('/:id/accept',auth[_0x8a94('0x7')](),controller['accept']);router['put']('/:id/reject',auth[_0x8a94('0x7')](),controller[_0x8a94('0x11')]);router[_0x8a94('0x12')](_0x8a94('0x9'),auth[_0x8a94('0x7')](),controller[_0x8a94('0x13')]);module[_0x8a94('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index bbd3434..49465b8 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 _0x331e=['exports','TEXT','medium','sequelize'];(function(_0x20fbbb,_0x38be7b){var _0x215d1c=function(_0x3be33c){while(--_0x3be33c){_0x20fbbb['push'](_0x20fbbb['shift']());}};_0x215d1c(++_0x38be7b);}(_0x331e,0x193));var _0xe331=function(_0x836c43,_0x5a3808){_0x836c43=_0x836c43-0x0;var _0x3f9fef=_0x331e[_0x836c43];return _0x3f9fef;};'use strict';var Sequelize=require(_0xe331('0x0'));module[_0xe331('0x1')]={'body':{'type':Sequelize[_0xe331('0x2')](_0xe331('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x0504=['exports','TEXT','medium'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x0504,0x147));var _0x4050=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x0504[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0x4050('0x0')]={'body':{'type':Sequelize[_0x4050('0x1')](_0x4050('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7ed0a79..b44e1fc 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 _0x8814=['destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','count','include','rows','catch','length','includeAll','find','create','body','params','describe','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','then'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x8814,0x1b8));var _0x4881=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x8814[_0x1f36bb];return _0xaf97fa;};'use strict';var pdf=require(_0x4881('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4881('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4881('0x2'));var moment=require(_0x4881('0x3'));var BPromise=require(_0x4881('0x4'));var Mustache=require(_0x4881('0x5'));var util=require('util');var path=require(_0x4881('0x6'));var sox=require(_0x4881('0x7'));var csv=require(_0x4881('0x8'));var ejs=require(_0x4881('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4881('0xa'));var crypto=require('crypto');var jsforce=require(_0x4881('0xb'));var deskjs=require(_0x4881('0xc'));var toCsv=require(_0x4881('0x8'));var querystring=require(_0x4881('0xd'));var Papa=require('papaparse');var Redis=require(_0x4881('0xe'));var authService=require(_0x4881('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4881('0x10'));var logger=require(_0x4881('0x11'))(_0x4881('0x12'));var utils=require(_0x4881('0x13'));var config=require(_0x4881('0x14'));var db=require(_0x4881('0x15'))['db'];function respondWithStatusCode(_0x530e9f,_0x3bfd56){_0x3bfd56=_0x3bfd56||0xcc;return function(_0x1aa300){if(_0x1aa300){return _0x530e9f[_0x4881('0x16')](_0x3bfd56);}return _0x530e9f[_0x4881('0x17')](_0x3bfd56)['end']();};}function respondWithResult(_0xe51f84,_0x35ab50){_0x35ab50=_0x35ab50||0xc8;return function(_0x20357a){if(_0x20357a){return _0xe51f84[_0x4881('0x17')](_0x35ab50)[_0x4881('0x18')](_0x20357a);}};}function respondWithFilteredResult(_0x4334ee,_0x534063){return function(_0x4bdffa){if(_0x4bdffa){var _0x527762=_0x4bdffa['count'],_0x5ad538=_0x534063[_0x4881('0x19')],_0x22df92=_0x534063[_0x4881('0x19')]+_0x534063[_0x4881('0x1a')],_0x5b6add;if(_0x22df92>=_0x527762){_0x22df92=_0x527762;_0x5b6add=0xc8;}else{_0x5b6add=0xce;}_0x4334ee['status'](_0x5b6add);return _0x4334ee['set']('Content-Range',_0x5ad538+'-'+_0x22df92+'/'+_0x527762)[_0x4881('0x18')](_0x4bdffa);}return null;};}function patchUpdates(_0x49b158){return function(_0x3a8a57){try{jsonpatch[_0x4881('0x1b')](_0x3a8a57,_0x49b158,!![]);}catch(_0x513bd1){return BPromise['reject'](_0x513bd1);}return _0x3a8a57['save']();};}function saveUpdates(_0x5e661e,_0x17556d){return function(_0x543c5e){if(_0x543c5e){return _0x543c5e['update'](_0x5e661e)[_0x4881('0x1c')](function(_0x20bc72){return _0x20bc72;});}return null;};}function removeEntity(_0x446eb4,_0x15e63f){return function(_0x347b35){if(_0x347b35){return _0x347b35[_0x4881('0x1d')]()['then'](function(){_0x446eb4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15aebc,_0x2727c4){return function(_0xb965c9){if(!_0xb965c9){_0x15aebc[_0x4881('0x16')](0x194);}return _0xb965c9;};}function handleError(_0x468cff,_0x337064){_0x337064=_0x337064||0x1f4;return function(_0x4cf5c3){logger[_0x4881('0x1e')](_0x4cf5c3[_0x4881('0x1f')]);if(_0x4cf5c3['name']){delete _0x4cf5c3[_0x4881('0x20')];}_0x468cff[_0x4881('0x17')](_0x337064)[_0x4881('0x21')](_0x4cf5c3);};}exports[_0x4881('0x22')]=function(_0x1d3a30,_0x590098){var _0x658ec9={},_0x2bf637={},_0x41b83f={'count':0x0,'rows':[]};var _0x5525eb=db[_0x4881('0x23')][_0x4881('0x24')];_0x2bf637['model']=_[_0x4881('0x25')](_0x5525eb);_0x2bf637[_0x4881('0x26')]=_[_0x4881('0x25')](_0x1d3a30[_0x4881('0x26')]);_0x2bf637[_0x4881('0x27')]=_['intersection'](_0x2bf637[_0x4881('0x28')],_0x2bf637[_0x4881('0x26')]);_0x658ec9[_0x4881('0x29')]=_[_0x4881('0x2a')](_0x2bf637[_0x4881('0x28')],qs[_0x4881('0x2b')](_0x1d3a30[_0x4881('0x26')][_0x4881('0x2b')]));_0x658ec9[_0x4881('0x29')]=_0x658ec9['attributes']['length']?_0x658ec9[_0x4881('0x29')]:_0x2bf637[_0x4881('0x28')];if(!_0x1d3a30['query'][_0x4881('0x2c')](_0x4881('0x2d'))){_0x658ec9['limit']=qs[_0x4881('0x1a')](_0x1d3a30[_0x4881('0x26')][_0x4881('0x1a')]);_0x658ec9['offset']=qs['offset'](_0x1d3a30[_0x4881('0x26')][_0x4881('0x19')]);}_0x658ec9[_0x4881('0x2e')]=qs['sort'](_0x1d3a30[_0x4881('0x26')][_0x4881('0x2f')]);_0x658ec9[_0x4881('0x30')]=qs['filters'](_[_0x4881('0x31')](_0x1d3a30[_0x4881('0x26')],_0x2bf637[_0x4881('0x27')]));if(_0x1d3a30[_0x4881('0x26')][_0x4881('0x32')]){_0x658ec9['where']=_[_0x4881('0x33')](_0x658ec9[_0x4881('0x30')],{'$or':_['map'](_0x5525eb,function(_0x29ec5c){if(_0x29ec5c[_0x4881('0x34')][_0x4881('0x35')]!==_0x4881('0x36')){var _0x30ffac={};_0x30ffac[_0x29ec5c['field']]={'$like':'%'+_0x1d3a30[_0x4881('0x26')][_0x4881('0x32')]+'%'};return _0x30ffac;}})});}_0x658ec9=_['merge']({},_0x658ec9,_0x1d3a30[_0x4881('0x37')]);var _0x22aae8={'where':_0x658ec9[_0x4881('0x30')]};return db['ChatOfflineMessage'][_0x4881('0x38')](_0x22aae8)[_0x4881('0x1c')](function(_0x432083){_0x41b83f[_0x4881('0x38')]=_0x432083;if(_0x1d3a30[_0x4881('0x26')]['includeAll']){_0x658ec9[_0x4881('0x39')]=[{'all':!![]}];}return db[_0x4881('0x23')]['findAll'](_0x658ec9);})['then'](function(_0x571cde){_0x41b83f[_0x4881('0x3a')]=_0x571cde;return _0x41b83f;})['then'](respondWithFilteredResult(_0x590098,_0x658ec9))[_0x4881('0x3b')](handleError(_0x590098,null));};exports['show']=function(_0x2aecef,_0x2818d3){var _0x374150={'raw':!![],'where':{'id':_0x2aecef['params']['id']}},_0x1808c4={};_0x1808c4[_0x4881('0x28')]=_['keys'](db[_0x4881('0x23')]['rawAttributes']);_0x1808c4['query']=_[_0x4881('0x25')](_0x2aecef[_0x4881('0x26')]);_0x1808c4[_0x4881('0x27')]=_[_0x4881('0x2a')](_0x1808c4[_0x4881('0x28')],_0x1808c4[_0x4881('0x26')]);_0x374150[_0x4881('0x29')]=_[_0x4881('0x2a')](_0x1808c4[_0x4881('0x28')],qs['fields'](_0x2aecef[_0x4881('0x26')][_0x4881('0x2b')]));_0x374150[_0x4881('0x29')]=_0x374150[_0x4881('0x29')][_0x4881('0x3c')]?_0x374150['attributes']:_0x1808c4[_0x4881('0x28')];if(_0x2aecef['query'][_0x4881('0x3d')]){_0x374150['include']=[{'all':!![]}];}_0x374150=_['merge']({},_0x374150,_0x2aecef[_0x4881('0x37')]);return db[_0x4881('0x23')][_0x4881('0x3e')](_0x374150)[_0x4881('0x1c')](handleEntityNotFound(_0x2818d3,null))[_0x4881('0x1c')](respondWithResult(_0x2818d3,null))[_0x4881('0x3b')](handleError(_0x2818d3,null));};exports[_0x4881('0x3f')]=function(_0x57c39d,_0x4bb11e){return db[_0x4881('0x23')]['create'](_0x57c39d['body'],{})[_0x4881('0x1c')](respondWithResult(_0x4bb11e,0xc9))[_0x4881('0x3b')](handleError(_0x4bb11e,null));};exports['update']=function(_0x699b38,_0x439c8c){if(_0x699b38[_0x4881('0x40')]['id']){delete _0x699b38[_0x4881('0x40')]['id'];}return db[_0x4881('0x23')][_0x4881('0x3e')]({'where':{'id':_0x699b38['params']['id']}})[_0x4881('0x1c')](handleEntityNotFound(_0x439c8c,null))['then'](saveUpdates(_0x699b38[_0x4881('0x40')],null))[_0x4881('0x1c')](respondWithResult(_0x439c8c,null))['catch'](handleError(_0x439c8c,null));};exports['destroy']=function(_0x18bb78,_0x58f9ac){return db[_0x4881('0x23')][_0x4881('0x3e')]({'where':{'id':_0x18bb78[_0x4881('0x41')]['id']}})[_0x4881('0x1c')](handleEntityNotFound(_0x58f9ac,null))[_0x4881('0x1c')](removeEntity(_0x58f9ac,null))[_0x4881('0x3b')](handleError(_0x58f9ac,null));};exports[_0x4881('0x42')]=function(_0x424032,_0x474fdc){return db[_0x4881('0x23')][_0x4881('0x42')]()[_0x4881('0x1c')](respondWithResult(_0x474fdc,null))[_0x4881('0x3b')](handleError(_0x474fdc,null));}; \ No newline at end of file +var _0x2fc9=['end','json','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','rows','catch','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status'];(function(_0x4df197,_0x4fa3ed){var _0x3e42c9=function(_0x483929){while(--_0x483929){_0x4df197['push'](_0x4df197['shift']());}};_0x3e42c9(++_0x4fa3ed);}(_0x2fc9,0xc2));var _0x92fc=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0x2fc9[_0xe4d6c6];return _0x3a8935;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x92fc('0x0'));var rimraf=require(_0x92fc('0x1'));var zipdir=require(_0x92fc('0x2'));var jsonpatch=require(_0x92fc('0x3'));var rp=require(_0x92fc('0x4'));var moment=require(_0x92fc('0x5'));var BPromise=require(_0x92fc('0x6'));var Mustache=require(_0x92fc('0x7'));var util=require(_0x92fc('0x8'));var path=require(_0x92fc('0x9'));var sox=require(_0x92fc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x92fc('0xb'));var crypto=require(_0x92fc('0xc'));var jsforce=require(_0x92fc('0xd'));var deskjs=require(_0x92fc('0xe'));var toCsv=require(_0x92fc('0xf'));var querystring=require(_0x92fc('0x10'));var Papa=require(_0x92fc('0x11'));var Redis=require('ioredis');var authService=require(_0x92fc('0x12'));var qs=require(_0x92fc('0x13'));var hardwareService=require(_0x92fc('0x14'));var logger=require('../../config/logger')(_0x92fc('0x15'));var utils=require(_0x92fc('0x16'));var config=require(_0x92fc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x566517,_0x113ad1){_0x113ad1=_0x113ad1||0xcc;return function(_0x2aff0d){if(_0x2aff0d){return _0x566517['sendStatus'](_0x113ad1);}return _0x566517[_0x92fc('0x18')](_0x113ad1)[_0x92fc('0x19')]();};}function respondWithResult(_0xb9fcb5,_0x1f5275){_0x1f5275=_0x1f5275||0xc8;return function(_0xf88abf){if(_0xf88abf){return _0xb9fcb5['status'](_0x1f5275)[_0x92fc('0x1a')](_0xf88abf);}};}function respondWithFilteredResult(_0x145a52,_0x208b7e){return function(_0x23a9ad){if(_0x23a9ad){var _0x5b3fba=_0x23a9ad['count'],_0x4c45f3=_0x208b7e[_0x92fc('0x1b')],_0x111f42=_0x208b7e[_0x92fc('0x1b')]+_0x208b7e[_0x92fc('0x1c')],_0x6de681;if(_0x111f42>=_0x5b3fba){_0x111f42=_0x5b3fba;_0x6de681=0xc8;}else{_0x6de681=0xce;}_0x145a52['status'](_0x6de681);return _0x145a52[_0x92fc('0x1d')](_0x92fc('0x1e'),_0x4c45f3+'-'+_0x111f42+'/'+_0x5b3fba)[_0x92fc('0x1a')](_0x23a9ad);}return null;};}function patchUpdates(_0x2602f7){return function(_0x22d671){try{jsonpatch[_0x92fc('0x1f')](_0x22d671,_0x2602f7,!![]);}catch(_0x207bde){return BPromise[_0x92fc('0x20')](_0x207bde);}return _0x22d671['save']();};}function saveUpdates(_0x13802a,_0x4eaeff){return function(_0x1e3bb1){if(_0x1e3bb1){return _0x1e3bb1[_0x92fc('0x21')](_0x13802a)[_0x92fc('0x22')](function(_0xb7751c){return _0xb7751c;});}return null;};}function removeEntity(_0x35d40e,_0x4584c8){return function(_0x2848f0){if(_0x2848f0){return _0x2848f0['destroy']()[_0x92fc('0x22')](function(){_0x35d40e[_0x92fc('0x18')](0xcc)[_0x92fc('0x19')]();});}};}function handleEntityNotFound(_0x4c89eb,_0x29e986){return function(_0x442576){if(!_0x442576){_0x4c89eb[_0x92fc('0x23')](0x194);}return _0x442576;};}function handleError(_0x56d955,_0x3161e9){_0x3161e9=_0x3161e9||0x1f4;return function(_0x23a6ed){logger[_0x92fc('0x24')](_0x23a6ed[_0x92fc('0x25')]);if(_0x23a6ed[_0x92fc('0x26')]){delete _0x23a6ed[_0x92fc('0x26')];}_0x56d955[_0x92fc('0x18')](_0x3161e9)[_0x92fc('0x27')](_0x23a6ed);};}exports[_0x92fc('0x28')]=function(_0x19ff2b,_0xea17d){var _0x1c0269={},_0x215e98={},_0x4ef103={'count':0x0,'rows':[]};var _0x373851=db[_0x92fc('0x29')][_0x92fc('0x2a')];_0x215e98[_0x92fc('0x2b')]=_[_0x92fc('0x2c')](_0x373851);_0x215e98[_0x92fc('0x2d')]=_[_0x92fc('0x2c')](_0x19ff2b['query']);_0x215e98[_0x92fc('0x2e')]=_[_0x92fc('0x2f')](_0x215e98[_0x92fc('0x2b')],_0x215e98['query']);_0x1c0269[_0x92fc('0x30')]=_[_0x92fc('0x2f')](_0x215e98[_0x92fc('0x2b')],qs[_0x92fc('0x31')](_0x19ff2b[_0x92fc('0x2d')]['fields']));_0x1c0269[_0x92fc('0x30')]=_0x1c0269[_0x92fc('0x30')][_0x92fc('0x32')]?_0x1c0269['attributes']:_0x215e98[_0x92fc('0x2b')];if(!_0x19ff2b[_0x92fc('0x2d')][_0x92fc('0x33')](_0x92fc('0x34'))){_0x1c0269[_0x92fc('0x1c')]=qs['limit'](_0x19ff2b[_0x92fc('0x2d')][_0x92fc('0x1c')]);_0x1c0269[_0x92fc('0x1b')]=qs[_0x92fc('0x1b')](_0x19ff2b['query'][_0x92fc('0x1b')]);}_0x1c0269['order']=qs['sort'](_0x19ff2b[_0x92fc('0x2d')][_0x92fc('0x35')]);_0x1c0269[_0x92fc('0x36')]=qs[_0x92fc('0x2e')](_[_0x92fc('0x37')](_0x19ff2b['query'],_0x215e98[_0x92fc('0x2e')]));if(_0x19ff2b[_0x92fc('0x2d')][_0x92fc('0x38')]){_0x1c0269[_0x92fc('0x36')]=_['merge'](_0x1c0269[_0x92fc('0x36')],{'$or':_[_0x92fc('0x39')](_0x373851,function(_0x189950){if(_0x189950[_0x92fc('0x3a')][_0x92fc('0x3b')]!==_0x92fc('0x3c')){var _0x643979={};_0x643979[_0x189950['field']]={'$like':'%'+_0x19ff2b['query']['filter']+'%'};return _0x643979;}})});}_0x1c0269=_[_0x92fc('0x3d')]({},_0x1c0269,_0x19ff2b[_0x92fc('0x3e')]);var _0x2e3230={'where':_0x1c0269['where']};return db[_0x92fc('0x29')][_0x92fc('0x3f')](_0x2e3230)[_0x92fc('0x22')](function(_0x22ceba){_0x4ef103['count']=_0x22ceba;if(_0x19ff2b[_0x92fc('0x2d')][_0x92fc('0x40')]){_0x1c0269['include']=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x1c0269);})[_0x92fc('0x22')](function(_0x2e0e82){_0x4ef103[_0x92fc('0x41')]=_0x2e0e82;return _0x4ef103;})['then'](respondWithFilteredResult(_0xea17d,_0x1c0269))[_0x92fc('0x42')](handleError(_0xea17d,null));};exports['show']=function(_0x2636f5,_0x776adf){var _0x1efaaf={'raw':!![],'where':{'id':_0x2636f5['params']['id']}},_0xb68def={};_0xb68def[_0x92fc('0x2b')]=_[_0x92fc('0x2c')](db[_0x92fc('0x29')][_0x92fc('0x2a')]);_0xb68def['query']=_[_0x92fc('0x2c')](_0x2636f5['query']);_0xb68def[_0x92fc('0x2e')]=_[_0x92fc('0x2f')](_0xb68def['model'],_0xb68def[_0x92fc('0x2d')]);_0x1efaaf[_0x92fc('0x30')]=_[_0x92fc('0x2f')](_0xb68def[_0x92fc('0x2b')],qs[_0x92fc('0x31')](_0x2636f5[_0x92fc('0x2d')][_0x92fc('0x31')]));_0x1efaaf[_0x92fc('0x30')]=_0x1efaaf['attributes'][_0x92fc('0x32')]?_0x1efaaf[_0x92fc('0x30')]:_0xb68def['model'];if(_0x2636f5[_0x92fc('0x2d')][_0x92fc('0x40')]){_0x1efaaf[_0x92fc('0x43')]=[{'all':!![]}];}_0x1efaaf=_[_0x92fc('0x3d')]({},_0x1efaaf,_0x2636f5[_0x92fc('0x3e')]);return db[_0x92fc('0x29')]['find'](_0x1efaaf)['then'](handleEntityNotFound(_0x776adf,null))[_0x92fc('0x22')](respondWithResult(_0x776adf,null))[_0x92fc('0x42')](handleError(_0x776adf,null));};exports[_0x92fc('0x44')]=function(_0x33d44f,_0x3ff492){return db[_0x92fc('0x29')][_0x92fc('0x44')](_0x33d44f['body'],{})[_0x92fc('0x22')](respondWithResult(_0x3ff492,0xc9))[_0x92fc('0x42')](handleError(_0x3ff492,null));};exports[_0x92fc('0x21')]=function(_0x4701f4,_0x5e75b9){if(_0x4701f4[_0x92fc('0x45')]['id']){delete _0x4701f4[_0x92fc('0x45')]['id'];}return db[_0x92fc('0x29')][_0x92fc('0x46')]({'where':{'id':_0x4701f4['params']['id']}})['then'](handleEntityNotFound(_0x5e75b9,null))[_0x92fc('0x22')](saveUpdates(_0x4701f4['body'],null))[_0x92fc('0x22')](respondWithResult(_0x5e75b9,null))[_0x92fc('0x42')](handleError(_0x5e75b9,null));};exports[_0x92fc('0x47')]=function(_0x1d60ef,_0xd6b09d){return db[_0x92fc('0x29')][_0x92fc('0x46')]({'where':{'id':_0x1d60ef['params']['id']}})[_0x92fc('0x22')](handleEntityNotFound(_0xd6b09d,null))[_0x92fc('0x22')](removeEntity(_0xd6b09d,null))['catch'](handleError(_0xd6b09d,null));};exports[_0x92fc('0x48')]=function(_0x509464,_0x2777db){return db[_0x92fc('0x29')]['describe']()['then'](respondWithResult(_0x2777db,null))[_0x92fc('0x42')](handleError(_0x2777db,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index dad09df..fe44a0a 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 _0x040f=['api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x698957,_0x1f8408){var _0x48e8bc=function(_0x55bfcf){while(--_0x55bfcf){_0x698957['push'](_0x698957['shift']());}};_0x48e8bc(++_0x1f8408);}(_0x040f,0xfc));var _0xf040=function(_0x54eaf1,_0x306d87){_0x54eaf1=_0x54eaf1-0x0;var _0x4c8295=_0x040f[_0x54eaf1];return _0x4c8295;};'use strict';var _=require(_0xf040('0x0'));var util=require(_0xf040('0x1'));var logger=require(_0xf040('0x2'))(_0xf040('0x3'));var moment=require(_0xf040('0x4'));var BPromise=require(_0xf040('0x5'));var rp=require(_0xf040('0x6'));var fs=require('fs');var path=require(_0xf040('0x7'));var rimraf=require('rimraf');var config=require(_0xf040('0x8'));var attributes=require(_0xf040('0x9'));module[_0xf040('0xa')]=function(_0x276933,_0x17c708){return _0x276933[_0xf040('0xb')](_0xf040('0xc'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf040('0xd'),'collate':_0xf040('0xe')});}; \ No newline at end of file +var _0xf51f=['chat_offline_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x33addc,_0x19a85a){var _0x4b8562=function(_0x4ce294){while(--_0x4ce294){_0x33addc['push'](_0x33addc['shift']());}};_0x4b8562(++_0x19a85a);}(_0xf51f,0xfe));var _0xff51=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0xf51f[_0x5a7112];return _0x3147f7;};'use strict';var _=require('lodash');var util=require(_0xff51('0x0'));var logger=require(_0xff51('0x1'))(_0xff51('0x2'));var moment=require(_0xff51('0x3'));var BPromise=require('bluebird');var rp=require(_0xff51('0x4'));var fs=require('fs');var path=require(_0xff51('0x5'));var rimraf=require(_0xff51('0x6'));var config=require(_0xff51('0x7'));var attributes=require(_0xff51('0x8'));module[_0xff51('0x9')]=function(_0x536a47,_0x3cdd8c){return _0x536a47[_0xff51('0xa')](_0xff51('0xb'),attributes,{'tableName':_0xff51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xff51('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index c694931..a2638f9 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 _0x0842=['info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x199629,_0xb7bf6c){var _0x2cbda1=function(_0x56984a){while(--_0x56984a){_0x199629['push'](_0x199629['shift']());}};_0x2cbda1(++_0xb7bf6c);}(_0x0842,0x10b));var _0x2084=function(_0x284622,_0x1e419f){_0x284622=_0x284622-0x0;var _0x4d48d6=_0x0842[_0x284622];return _0x4d48d6;};'use strict';var _=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var moment=require('moment');var BPromise=require(_0x2084('0x2'));var rs=require(_0x2084('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2084('0x4'))['db'];var utils=require(_0x2084('0x5'));var logger=require(_0x2084('0x6'))('rpc');var config=require(_0x2084('0x7'));var jayson=require(_0x2084('0x8'));var client=jayson[_0x2084('0x9')][_0x2084('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b683d,_0xc54a53,_0x194be7){return new BPromise(function(_0x74b8ff,_0x4d528b){return client[_0x2084('0xb')](_0x3b683d,_0x194be7)['then'](function(_0x38db39){logger['info'](_0x2084('0xc'),_0xc54a53,_0x2084('0xd'));logger[_0x2084('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xc54a53,_0x2084('0xd'),JSON[_0x2084('0xf')](_0x38db39));if(_0x38db39[_0x2084('0x10')]){if(_0x38db39[_0x2084('0x10')][_0x2084('0x11')]===0x1f4){logger['error'](_0x2084('0xc'),_0xc54a53,_0x38db39[_0x2084('0x10')][_0x2084('0x12')]);return _0x4d528b(_0x38db39[_0x2084('0x10')][_0x2084('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xc54a53,_0x38db39[_0x2084('0x10')][_0x2084('0x12')]);return _0x74b8ff(_0x38db39[_0x2084('0x10')][_0x2084('0x12')]);}else{logger[_0x2084('0x13')](_0x2084('0xc'),_0xc54a53,_0x2084('0xd'));_0x74b8ff(_0x38db39[_0x2084('0x14')]['message']);}})[_0x2084('0x15')](function(_0x49077d){logger['error'](_0x2084('0xc'),_0xc54a53,_0x49077d);_0x4d528b(_0x49077d);});});} \ No newline at end of file +var _0x7ef9=['jayson/promise','client','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x96c5db,_0x502246){var _0x589b2e=function(_0x132815){while(--_0x132815){_0x96c5db['push'](_0x96c5db['shift']());}};_0x589b2e(++_0x502246);}(_0x7ef9,0x19d));var _0x97ef=function(_0x36fb10,_0x173dd1){_0x36fb10=_0x36fb10-0x0;var _0x52fc0e=_0x7ef9[_0x36fb10];return _0x52fc0e;};'use strict';var _=require('lodash');var util=require(_0x97ef('0x0'));var moment=require(_0x97ef('0x1'));var BPromise=require(_0x97ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97ef('0x3'));var db=require(_0x97ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x97ef('0x5'));var config=require(_0x97ef('0x6'));var jayson=require(_0x97ef('0x7'));var client=jayson[_0x97ef('0x8')][_0x97ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3de49e,_0x4fe29e,_0x3b55a2){return new BPromise(function(_0x1d0344,_0xb4e3ca){return client[_0x97ef('0xa')](_0x3de49e,_0x3b55a2)[_0x97ef('0xb')](function(_0x8402bb){logger[_0x97ef('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4fe29e,'request\x20sent');logger[_0x97ef('0xd')](_0x97ef('0xe'),_0x4fe29e,_0x97ef('0xf'),JSON['stringify'](_0x8402bb));if(_0x8402bb['error']){if(_0x8402bb[_0x97ef('0x10')]['code']===0x1f4){logger[_0x97ef('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4fe29e,_0x8402bb['error']['message']);return _0xb4e3ca(_0x8402bb[_0x97ef('0x10')][_0x97ef('0x11')]);}logger[_0x97ef('0x10')](_0x97ef('0x12'),_0x4fe29e,_0x8402bb[_0x97ef('0x10')]['message']);return _0x1d0344(_0x8402bb[_0x97ef('0x10')][_0x97ef('0x11')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4fe29e,'request\x20sent');_0x1d0344(_0x8402bb[_0x97ef('0x13')]['message']);}})[_0x97ef('0x14')](function(_0x23ed2b){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x4fe29e,_0x23ed2b);_0xb4e3ca(_0x23ed2b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4288824..f014716 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 _0x0506=['../../components/interaction/service','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x25ac70,_0x5a380b){var _0x423271=function(_0x5d6f4e){while(--_0x5d6f4e){_0x25ac70['push'](_0x25ac70['shift']());}};_0x423271(++_0x5a380b);}(_0x0506,0x1d1));var _0x6050=function(_0x3a8877,_0x53d136){_0x3a8877=_0x3a8877-0x0;var _0x22568f=_0x0506[_0x3a8877];return _0x22568f;};'use strict';var multer=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var path=require(_0x6050('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6050('0x3'));var config=require('../../config/environment');var controller=require(_0x6050('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x6050('0x5')]);router[_0x6050('0x6')](_0x6050('0x7'),auth[_0x6050('0x8')](),controller[_0x6050('0x9')]);router[_0x6050('0x6')](_0x6050('0xa'),auth[_0x6050('0x8')](),controller['show']);router[_0x6050('0xb')]('/',auth['isAuthenticated'](),controller[_0x6050('0xc')]);router[_0x6050('0xd')](_0x6050('0xa'),auth[_0x6050('0x8')](),controller[_0x6050('0xe')]);router[_0x6050('0xf')](_0x6050('0xa'),auth[_0x6050('0x8')](),controller[_0x6050('0x10')]);module[_0x6050('0x11')]=router; \ No newline at end of file +var _0x0834=['/:id','show','post','create','put','update','delete','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x0834,0x18e));var _0x4083=function(_0x2ea10b,_0x1c26b9){_0x2ea10b=_0x2ea10b-0x0;var _0x50f1e6=_0x0834[_0x2ea10b];return _0x50f1e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4083('0x0'));var timeout=require(_0x4083('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4083('0x2'));var config=require(_0x4083('0x3'));var controller=require('./chatOfflineMessage.controller');router[_0x4083('0x4')]('/',auth[_0x4083('0x5')](),controller['index']);router[_0x4083('0x4')]('/describe',auth[_0x4083('0x5')](),controller[_0x4083('0x6')]);router[_0x4083('0x4')](_0x4083('0x7'),auth[_0x4083('0x5')](),controller[_0x4083('0x8')]);router[_0x4083('0x9')]('/',auth[_0x4083('0x5')](),controller[_0x4083('0xa')]);router[_0x4083('0xb')](_0x4083('0x7'),auth[_0x4083('0x5')](),controller[_0x4083('0xc')]);router[_0x4083('0xd')](_0x4083('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x4083('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 56260db..e83c1e9 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 _0x7854=['INTEGER','sequelize','exports','ENUM','mouseOver','timeout','STRING'];(function(_0x249855,_0x30bc55){var _0x3a5fb9=function(_0xf465b7){while(--_0xf465b7){_0x249855['push'](_0x249855['shift']());}};_0x3a5fb9(++_0x30bc55);}(_0x7854,0x189));var _0x4785=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x7854[_0x4503df];return _0x3f1b2b;};'use strict';var Sequelize=require(_0x4785('0x0'));module[_0x4785('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4785('0x2')](_0x4785('0x3'),_0x4785('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x4785('0x5')]},'timeout':{'type':Sequelize[_0x4785('0x6')]}}; \ No newline at end of file +var _0x4991=['timeout','INTEGER','sequelize','STRING','mouseOver'];(function(_0x12f5e7,_0x36b75e){var _0x264922=function(_0x5c6202){while(--_0x5c6202){_0x12f5e7['push'](_0x12f5e7['shift']());}};_0x264922(++_0x36b75e);}(_0x4991,0xf7));var _0x1499=function(_0x48e9c3,_0x10bccd){_0x48e9c3=_0x48e9c3-0x0;var _0x3c1e41=_0x4991[_0x48e9c3];return _0x3c1e41;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1499('0x2'),_0x1499('0x3')),'defaultValue':_0x1499('0x2')},'selector':{'type':Sequelize[_0x1499('0x1')]},'timeout':{'type':Sequelize[_0x1499('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 3a57a98..2f5838e 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 _0x9d05=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body'];(function(_0x54a2e5,_0x5a7708){var _0x8b1cb6=function(_0x10e4ad){while(--_0x10e4ad){_0x54a2e5['push'](_0x54a2e5['shift']());}};_0x8b1cb6(++_0x5a7708);}(_0x9d05,0x118));var _0x59d0=function(_0xae4bf8,_0x127980){_0xae4bf8=_0xae4bf8-0x0;var _0x4953cf=_0x9d05[_0xae4bf8];return _0x4953cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x59d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59d0('0x1'));var jsonpatch=require(_0x59d0('0x2'));var rp=require(_0x59d0('0x3'));var moment=require(_0x59d0('0x4'));var BPromise=require(_0x59d0('0x5'));var Mustache=require(_0x59d0('0x6'));var util=require(_0x59d0('0x7'));var path=require(_0x59d0('0x8'));var sox=require(_0x59d0('0x9'));var csv=require(_0x59d0('0xa'));var ejs=require(_0x59d0('0xb'));var fs=require('fs');var _=require(_0x59d0('0xc'));var squel=require(_0x59d0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x59d0('0xa'));var querystring=require(_0x59d0('0xe'));var Papa=require(_0x59d0('0xf'));var Redis=require('ioredis');var authService=require(_0x59d0('0x10'));var qs=require(_0x59d0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x59d0('0x12'));var config=require(_0x59d0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38945a,_0x45731d){_0x45731d=_0x45731d||0xcc;return function(_0x3fc98c){if(_0x3fc98c){return _0x38945a[_0x59d0('0x14')](_0x45731d);}return _0x38945a['status'](_0x45731d)[_0x59d0('0x15')]();};}function respondWithResult(_0x5e04a0,_0x14aa86){_0x14aa86=_0x14aa86||0xc8;return function(_0x278abf){if(_0x278abf){return _0x5e04a0[_0x59d0('0x16')](_0x14aa86)[_0x59d0('0x17')](_0x278abf);}};}function respondWithFilteredResult(_0x6d0c69,_0x2cc71f){return function(_0x1cd421){if(_0x1cd421){var _0x524c0e=_0x1cd421[_0x59d0('0x18')],_0x3637c1=_0x2cc71f[_0x59d0('0x19')],_0xa2ca1a=_0x2cc71f['offset']+_0x2cc71f[_0x59d0('0x1a')],_0x420cd0;if(_0xa2ca1a>=_0x524c0e){_0xa2ca1a=_0x524c0e;_0x420cd0=0xc8;}else{_0x420cd0=0xce;}_0x6d0c69['status'](_0x420cd0);return _0x6d0c69[_0x59d0('0x1b')](_0x59d0('0x1c'),_0x3637c1+'-'+_0xa2ca1a+'/'+_0x524c0e)['json'](_0x1cd421);}return null;};}function patchUpdates(_0xf3ff2a){return function(_0x3f4c12){try{jsonpatch[_0x59d0('0x1d')](_0x3f4c12,_0xf3ff2a,!![]);}catch(_0x3ffd6a){return BPromise['reject'](_0x3ffd6a);}return _0x3f4c12[_0x59d0('0x1e')]();};}function saveUpdates(_0x1a7068,_0x1053bf){return function(_0x3139ec){if(_0x3139ec){return _0x3139ec[_0x59d0('0x1f')](_0x1a7068)[_0x59d0('0x20')](function(_0x876510){return _0x876510;});}return null;};}function removeEntity(_0x563c48,_0x24048a){return function(_0x5801d8){if(_0x5801d8){return _0x5801d8[_0x59d0('0x21')]()[_0x59d0('0x20')](function(){_0x563c48[_0x59d0('0x16')](0xcc)[_0x59d0('0x15')]();});}};}function handleEntityNotFound(_0x33d4b7,_0x30d1b9){return function(_0x329c6e){if(!_0x329c6e){_0x33d4b7['sendStatus'](0x194);}return _0x329c6e;};}function handleError(_0x2d6f8c,_0x20d77f){_0x20d77f=_0x20d77f||0x1f4;return function(_0x5e9ea6){logger[_0x59d0('0x22')](_0x5e9ea6[_0x59d0('0x23')]);if(_0x5e9ea6['name']){delete _0x5e9ea6[_0x59d0('0x24')];}_0x2d6f8c['status'](_0x20d77f)['send'](_0x5e9ea6);};}exports[_0x59d0('0x25')]=function(_0x2f7642,_0x45b4e7){var _0x3164c3={'raw':!![],'where':{'id':_0x2f7642[_0x59d0('0x26')]['id']}},_0x3c540d={};_0x3c540d[_0x59d0('0x27')]=_[_0x59d0('0x28')](db[_0x59d0('0x29')][_0x59d0('0x2a')]);_0x3c540d[_0x59d0('0x2b')]=_['keys'](_0x2f7642['query']);_0x3c540d[_0x59d0('0x2c')]=_[_0x59d0('0x2d')](_0x3c540d['model'],_0x3c540d['query']);_0x3164c3[_0x59d0('0x2e')]=_[_0x59d0('0x2d')](_0x3c540d[_0x59d0('0x27')],qs[_0x59d0('0x2f')](_0x2f7642['query'][_0x59d0('0x2f')]));_0x3164c3[_0x59d0('0x2e')]=_0x3164c3[_0x59d0('0x2e')][_0x59d0('0x30')]?_0x3164c3['attributes']:_0x3c540d[_0x59d0('0x27')];if(_0x2f7642[_0x59d0('0x2b')][_0x59d0('0x31')]){_0x3164c3[_0x59d0('0x32')]=[{'all':!![]}];}_0x3164c3=_[_0x59d0('0x33')]({},_0x3164c3,_0x2f7642['options']);return db[_0x59d0('0x29')][_0x59d0('0x34')](_0x3164c3)[_0x59d0('0x20')](handleEntityNotFound(_0x45b4e7,null))[_0x59d0('0x20')](respondWithResult(_0x45b4e7,null))[_0x59d0('0x35')](handleError(_0x45b4e7,null));};exports[_0x59d0('0x36')]=function(_0x5bf6cd,_0x1235e5){return db[_0x59d0('0x29')][_0x59d0('0x36')](_0x5bf6cd[_0x59d0('0x37')],{})[_0x59d0('0x20')](respondWithResult(_0x1235e5,0xc9))['catch'](handleError(_0x1235e5,null));};exports[_0x59d0('0x1f')]=function(_0x4b36be,_0x359208){if(_0x4b36be['body']['id']){delete _0x4b36be[_0x59d0('0x37')]['id'];}return db['ChatProactiveAction'][_0x59d0('0x34')]({'where':{'id':_0x4b36be[_0x59d0('0x26')]['id']}})['then'](handleEntityNotFound(_0x359208,null))[_0x59d0('0x20')](saveUpdates(_0x4b36be[_0x59d0('0x37')],null))[_0x59d0('0x20')](respondWithResult(_0x359208,null))[_0x59d0('0x35')](handleError(_0x359208,null));};exports['destroy']=function(_0xaf526b,_0x1b7841){return db[_0x59d0('0x29')][_0x59d0('0x34')]({'where':{'id':_0xaf526b[_0x59d0('0x26')]['id']}})[_0x59d0('0x20')](handleEntityNotFound(_0x1b7841,null))[_0x59d0('0x20')](removeEntity(_0x1b7841,null))[_0x59d0('0x35')](handleError(_0x1b7841,null));}; \ No newline at end of file +var _0x5a3f=['../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','update','then','destroy','name','send','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x3dc482,_0x3d485b){var _0x2d52bd=function(_0x2b5a72){while(--_0x2b5a72){_0x3dc482['push'](_0x3dc482['shift']());}};_0x2d52bd(++_0x3d485b);}(_0x5a3f,0x181));var _0xf5a3=function(_0x395567,_0x13a108){_0x395567=_0x395567-0x0;var _0x20ce88=_0x5a3f[_0x395567];return _0x20ce88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf5a3('0x0'));var rimraf=require(_0xf5a3('0x1'));var zipdir=require(_0xf5a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf5a3('0x4'));var path=require(_0xf5a3('0x5'));var sox=require(_0xf5a3('0x6'));var csv=require(_0xf5a3('0x7'));var ejs=require(_0xf5a3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf5a3('0x9'));var crypto=require(_0xf5a3('0xa'));var jsforce=require(_0xf5a3('0xb'));var deskjs=require(_0xf5a3('0xc'));var toCsv=require(_0xf5a3('0x7'));var querystring=require(_0xf5a3('0xd'));var Papa=require('papaparse');var Redis=require(_0xf5a3('0xe'));var authService=require(_0xf5a3('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf5a3('0x10'));var logger=require('../../config/logger')(_0xf5a3('0x11'));var utils=require(_0xf5a3('0x12'));var config=require(_0xf5a3('0x13'));var db=require(_0xf5a3('0x14'))['db'];function respondWithStatusCode(_0x37c61f,_0x24a472){_0x24a472=_0x24a472||0xcc;return function(_0x4ca84c){if(_0x4ca84c){return _0x37c61f[_0xf5a3('0x15')](_0x24a472);}return _0x37c61f['status'](_0x24a472)[_0xf5a3('0x16')]();};}function respondWithResult(_0x2fe98b,_0x39cb72){_0x39cb72=_0x39cb72||0xc8;return function(_0x48440e){if(_0x48440e){return _0x2fe98b['status'](_0x39cb72)[_0xf5a3('0x17')](_0x48440e);}};}function respondWithFilteredResult(_0x51d7f1,_0x29d4e2){return function(_0x2b925b){if(_0x2b925b){var _0x3b61f1=_0x2b925b['count'],_0x49c893=_0x29d4e2[_0xf5a3('0x18')],_0x3fa3d5=_0x29d4e2[_0xf5a3('0x18')]+_0x29d4e2[_0xf5a3('0x19')],_0x3fc676;if(_0x3fa3d5>=_0x3b61f1){_0x3fa3d5=_0x3b61f1;_0x3fc676=0xc8;}else{_0x3fc676=0xce;}_0x51d7f1[_0xf5a3('0x1a')](_0x3fc676);return _0x51d7f1['set']('Content-Range',_0x49c893+'-'+_0x3fa3d5+'/'+_0x3b61f1)[_0xf5a3('0x17')](_0x2b925b);}return null;};}function patchUpdates(_0x30bd57){return function(_0x4c05d2){try{jsonpatch['apply'](_0x4c05d2,_0x30bd57,!![]);}catch(_0x4b3ec0){return BPromise['reject'](_0x4b3ec0);}return _0x4c05d2['save']();};}function saveUpdates(_0x4990bd,_0x2b4560){return function(_0x8c615d){if(_0x8c615d){return _0x8c615d[_0xf5a3('0x1b')](_0x4990bd)[_0xf5a3('0x1c')](function(_0x20c84b){return _0x20c84b;});}return null;};}function removeEntity(_0x120d58,_0x318ad5){return function(_0x2c4500){if(_0x2c4500){return _0x2c4500[_0xf5a3('0x1d')]()['then'](function(){_0x120d58[_0xf5a3('0x1a')](0xcc)[_0xf5a3('0x16')]();});}};}function handleEntityNotFound(_0x2700ec,_0x14a776){return function(_0x545dd5){if(!_0x545dd5){_0x2700ec[_0xf5a3('0x15')](0x194);}return _0x545dd5;};}function handleError(_0x9ca780,_0x4fa941){_0x4fa941=_0x4fa941||0x1f4;return function(_0x108cea){logger['error'](_0x108cea['stack']);if(_0x108cea[_0xf5a3('0x1e')]){delete _0x108cea[_0xf5a3('0x1e')];}_0x9ca780[_0xf5a3('0x1a')](_0x4fa941)[_0xf5a3('0x1f')](_0x108cea);};}exports['show']=function(_0xd31666,_0x5daec9){var _0x5dbbb0={'raw':!![],'where':{'id':_0xd31666[_0xf5a3('0x20')]['id']}},_0x304215={};_0x304215['model']=_[_0xf5a3('0x21')](db[_0xf5a3('0x22')]['rawAttributes']);_0x304215[_0xf5a3('0x23')]=_[_0xf5a3('0x21')](_0xd31666['query']);_0x304215[_0xf5a3('0x24')]=_[_0xf5a3('0x25')](_0x304215[_0xf5a3('0x26')],_0x304215[_0xf5a3('0x23')]);_0x5dbbb0[_0xf5a3('0x27')]=_[_0xf5a3('0x25')](_0x304215[_0xf5a3('0x26')],qs[_0xf5a3('0x28')](_0xd31666[_0xf5a3('0x23')][_0xf5a3('0x28')]));_0x5dbbb0[_0xf5a3('0x27')]=_0x5dbbb0[_0xf5a3('0x27')][_0xf5a3('0x29')]?_0x5dbbb0[_0xf5a3('0x27')]:_0x304215[_0xf5a3('0x26')];if(_0xd31666[_0xf5a3('0x23')][_0xf5a3('0x2a')]){_0x5dbbb0[_0xf5a3('0x2b')]=[{'all':!![]}];}_0x5dbbb0=_[_0xf5a3('0x2c')]({},_0x5dbbb0,_0xd31666[_0xf5a3('0x2d')]);return db[_0xf5a3('0x22')][_0xf5a3('0x2e')](_0x5dbbb0)[_0xf5a3('0x1c')](handleEntityNotFound(_0x5daec9,null))[_0xf5a3('0x1c')](respondWithResult(_0x5daec9,null))[_0xf5a3('0x2f')](handleError(_0x5daec9,null));};exports['create']=function(_0x35e6c1,_0x1db9d8){return db[_0xf5a3('0x22')][_0xf5a3('0x30')](_0x35e6c1['body'],{})[_0xf5a3('0x1c')](respondWithResult(_0x1db9d8,0xc9))[_0xf5a3('0x2f')](handleError(_0x1db9d8,null));};exports[_0xf5a3('0x1b')]=function(_0x19f80e,_0x50e513){if(_0x19f80e[_0xf5a3('0x31')]['id']){delete _0x19f80e[_0xf5a3('0x31')]['id'];}return db['ChatProactiveAction'][_0xf5a3('0x2e')]({'where':{'id':_0x19f80e[_0xf5a3('0x20')]['id']}})[_0xf5a3('0x1c')](handleEntityNotFound(_0x50e513,null))[_0xf5a3('0x1c')](saveUpdates(_0x19f80e[_0xf5a3('0x31')],null))[_0xf5a3('0x1c')](respondWithResult(_0x50e513,null))[_0xf5a3('0x2f')](handleError(_0x50e513,null));};exports['destroy']=function(_0x5f9579,_0x52abac){return db[_0xf5a3('0x22')][_0xf5a3('0x2e')]({'where':{'id':_0x5f9579[_0xf5a3('0x20')]['id']}})[_0xf5a3('0x1c')](handleEntityNotFound(_0x52abac,null))[_0xf5a3('0x1c')](removeEntity(_0x52abac,null))[_0xf5a3('0x2f')](handleError(_0x52abac,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c3902a4..67c0c94 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 _0x748c=['request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','bluebird'];(function(_0x42b860,_0x3a33a1){var _0xff5990=function(_0x5d9d28){while(--_0x5d9d28){_0x42b860['push'](_0x42b860['shift']());}};_0xff5990(++_0x3a33a1);}(_0x748c,0x125));var _0xc748=function(_0x34ab7c,_0x2722a5){_0x34ab7c=_0x34ab7c-0x0;var _0x1a71b6=_0x748c[_0x34ab7c];return _0x1a71b6;};'use strict';var _=require(_0xc748('0x0'));var util=require('util');var logger=require(_0xc748('0x1'))(_0xc748('0x2'));var moment=require('moment');var BPromise=require(_0xc748('0x3'));var rp=require(_0xc748('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc748('0x5'));var config=require(_0xc748('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xc748('0x7')]=function(_0x3430b0,_0x24977c){return _0x3430b0[_0xc748('0x8')](_0xc748('0x9'),attributes,{'tableName':_0xc748('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffc9=['chat_proactive_actions','../../config/logger','path','rimraf','exports','define','ChatProactiveAction'];(function(_0x5ad294,_0x1477c7){var _0x20a450=function(_0x3fa506){while(--_0x3fa506){_0x5ad294['push'](_0x5ad294['shift']());}};_0x20a450(++_0x1477c7);}(_0xffc9,0x151));var _0x9ffc=function(_0x4851c7,_0x1cb4a0){_0x4851c7=_0x4851c7-0x0;var _0x56a7d4=_0xffc9[_0x4851c7];return _0x56a7d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ffc('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ffc('0x1'));var rimraf=require(_0x9ffc('0x2'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x9ffc('0x3')]=function(_0xd3ffd0,_0x2baa47){return _0xd3ffd0[_0x9ffc('0x4')](_0x9ffc('0x5'),attributes,{'tableName':_0x9ffc('0x6'),'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 a183bbc..ad8e95c 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 _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x5b1a17,_0x32fd0c){var _0x17884=function(_0x4048ee){while(--_0x4048ee){_0x5b1a17['push'](_0x5b1a17['shift']());}};_0x17884(++_0x32fd0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2b096b,_0x383247){var _0x1d59e4=function(_0x132bb8){while(--_0x132bb8){_0x2b096b['push'](_0x2b096b['shift']());}};_0x1d59e4(++_0x383247);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\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);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7a030dd..f3510be 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 _0x9158=['show','post','create','update','delete','destroy','multer','util','path','express','../../components/auth/service','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0x9158,0x16e));var _0x8915=function(_0x556fca,_0x247877){_0x556fca=_0x556fca-0x0;var _0x1688f4=_0x9158[_0x556fca];return _0x1688f4;};'use strict';var multer=require(_0x8915('0x0'));var util=require(_0x8915('0x1'));var path=require(_0x8915('0x2'));var timeout=require('connect-timeout');var express=require(_0x8915('0x3'));var router=express['Router']();var auth=require(_0x8915('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8915('0x5'));router[_0x8915('0x6')](_0x8915('0x7'),auth[_0x8915('0x8')](),controller[_0x8915('0x9')]);router[_0x8915('0xa')]('/',auth[_0x8915('0x8')](),controller[_0x8915('0xb')]);router['put'](_0x8915('0x7'),auth[_0x8915('0x8')](),controller[_0x8915('0xc')]);router[_0x8915('0xd')](_0x8915('0x7'),auth[_0x8915('0x8')](),controller[_0x8915('0xe')]);module['exports']=router; \ No newline at end of file +var _0x02ce=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x36cf31,_0xc95a8c){var _0x544879=function(_0x6200d){while(--_0x6200d){_0x36cf31['push'](_0x36cf31['shift']());}};_0x544879(++_0xc95a8c);}(_0x02ce,0x1ac));var _0xe02c=function(_0x229a89,_0x5a9743){_0x229a89=_0x229a89-0x0;var _0x2a39d9=_0x02ce[_0x229a89];return _0x2a39d9;};'use strict';var multer=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var path=require(_0xe02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe02c('0x3'));var router=express['Router']();var auth=require(_0xe02c('0x4'));var interaction=require(_0xe02c('0x5'));var config=require(_0xe02c('0x6'));var controller=require(_0xe02c('0x7'));router[_0xe02c('0x8')](_0xe02c('0x9'),auth[_0xe02c('0xa')](),controller[_0xe02c('0xb')]);router[_0xe02c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe02c('0xd')](_0xe02c('0x9'),auth[_0xe02c('0xa')](),controller[_0xe02c('0xe')]);router[_0xe02c('0xf')](_0xe02c('0x9'),auth[_0xe02c('0xa')](),controller[_0xe02c('0x10')]);module[_0xe02c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 6134598..9c2e3cd 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 _0x39eb=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x7404bb,_0x3249a1){var _0x2d9af1=function(_0x29e3aa){while(--_0x29e3aa){_0x7404bb['push'](_0x7404bb['shift']());}};_0x2d9af1(++_0x3249a1);}(_0x39eb,0x1aa));var _0xb39e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x39eb[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xb39e('0x0'));module[_0xb39e('0x1')]={'name':{'type':Sequelize[_0xb39e('0x2')],'unique':_0xb39e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb39e('0x2')]},'timeout':{'type':Sequelize[_0xb39e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb39e('0x5'),_0xb39e('0x6'),_0xb39e('0x7'))}}; \ No newline at end of file +var _0x9819=['ENUM','sequelize','STRING','INTEGER'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x9819,0x161));var _0x9981=function(_0x4c952d,_0x3e4a49){_0x4c952d=_0x4c952d-0x0;var _0x2e9f24=_0x9819[_0x4c952d];return _0x2e9f24;};'use strict';var Sequelize=require(_0x9981('0x0'));module['exports']={'name':{'type':Sequelize[_0x9981('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9981('0x1')]},'timeout':{'type':Sequelize[_0x9981('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9981('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0ab37d9..b2e9c61 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 _0x5554=['role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','ChatQueueId','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','getTeams','findOne','Team','addTeams','teams','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','sendStatus','name','send','index','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','ChatQueue','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x56f55b,_0x1c02aa){var _0x232941=function(_0x3710c6){while(--_0x3710c6){_0x56f55b['push'](_0x56f55b['shift']());}};_0x232941(++_0x1c02aa);}(_0x5554,0x167));var _0x4555=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5554[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4555('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4555('0x1'));var rp=require(_0x4555('0x2'));var moment=require('moment');var BPromise=require(_0x4555('0x3'));var Mustache=require(_0x4555('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4555('0x5'));var csv=require(_0x4555('0x6'));var ejs=require(_0x4555('0x7'));var fs=require('fs');var _=require(_0x4555('0x8'));var squel=require(_0x4555('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4555('0xa'));var toCsv=require(_0x4555('0x6'));var querystring=require('querystring');var Papa=require(_0x4555('0xb'));var Redis=require(_0x4555('0xc'));var authService=require(_0x4555('0xd'));var qs=require(_0x4555('0xe'));var hardwareService=require(_0x4555('0xf'));var logger=require('../../config/logger')(_0x4555('0x10'));var utils=require(_0x4555('0x11'));var config=require(_0x4555('0x12'));var db=require(_0x4555('0x13'))['db'];config[_0x4555('0x14')]=_[_0x4555('0x15')](config[_0x4555('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x4555('0x16'))(new Redis(config[_0x4555('0x14')]));require(_0x4555('0x17'))[_0x4555('0x18')](socket);var jayson=require(_0x4555('0x19'));var client=jayson[_0x4555('0x1a')][_0x4555('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x48a92e,_0x492e1e,_0x15d809){if(_0x15d809){var _0x4b6587=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b6587['test'](_0x492e1e)){return _0x48a92e;}else{throw new Error(_0x4555('0x1c'));}}else{return _0x48a92e;}}function respondWithRpcPromise(_0x365e82,_0x13b2ba,_0x4b7c84,_0x45610d){return new BPromise(function(_0x591646,_0x5dc6da){var _0x5193f8=_0x45610d||client;return _0x5193f8[_0x4555('0x1d')](_0x365e82,_0x4b7c84)['then'](function(_0x51918b){logger[_0x4555('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x13b2ba,_0x4555('0x1f'));logger[_0x4555('0x20')](_0x4555('0x21'),_0x13b2ba,_0x4555('0x1f'),JSON[_0x4555('0x22')](_0x51918b));if(_0x51918b[_0x4555('0x23')]){if(_0x51918b[_0x4555('0x23')][_0x4555('0x24')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x13b2ba,_0x51918b[_0x4555('0x23')][_0x4555('0x25')]);return _0x5dc6da(_0x51918b[_0x4555('0x23')][_0x4555('0x25')]);}logger[_0x4555('0x23')](_0x4555('0x26'),_0x13b2ba,_0x51918b[_0x4555('0x23')][_0x4555('0x25')]);return _0x591646(_0x51918b[_0x4555('0x23')][_0x4555('0x25')]);}else{logger[_0x4555('0x1e')](_0x4555('0x26'),_0x13b2ba,_0x4555('0x1f'));_0x591646(_0x51918b[_0x4555('0x27')][_0x4555('0x25')]);}})['catch'](function(_0xcd73e0){logger[_0x4555('0x23')]('ChatQueue,\x20%s,\x20%s',_0x13b2ba,_0xcd73e0);_0x5dc6da(_0xcd73e0);});});}function respondWithStatusCode(_0x5c3c86,_0x1e3916){_0x1e3916=_0x1e3916||0xcc;return function(_0x2539a0){if(_0x2539a0){return _0x5c3c86['sendStatus'](_0x1e3916);}return _0x5c3c86['status'](_0x1e3916)[_0x4555('0x28')]();};}function respondWithResult(_0x7da6d2,_0x604786){_0x604786=_0x604786||0xc8;return function(_0x246a52){if(_0x246a52){return _0x7da6d2[_0x4555('0x29')](_0x604786)[_0x4555('0x2a')](_0x246a52);}};}function respondWithFilteredResult(_0x3cf177,_0x57d714){return function(_0x334a4d){if(_0x334a4d){var _0x4a522f=_0x334a4d[_0x4555('0x2b')],_0x52b9c1=_0x57d714[_0x4555('0x2c')],_0x47f34f=_0x57d714['offset']+_0x57d714[_0x4555('0x2d')],_0x135728;if(_0x47f34f>=_0x4a522f){_0x47f34f=_0x4a522f;_0x135728=0xc8;}else{_0x135728=0xce;}_0x3cf177['status'](_0x135728);return _0x3cf177[_0x4555('0x2e')](_0x4555('0x2f'),_0x52b9c1+'-'+_0x47f34f+'/'+_0x4a522f)[_0x4555('0x2a')](_0x334a4d);}return null;};}function patchUpdates(_0x35cdc0){return function(_0x56567d){try{jsonpatch[_0x4555('0x30')](_0x56567d,_0x35cdc0,!![]);}catch(_0x328a7d){return BPromise[_0x4555('0x31')](_0x328a7d);}return _0x56567d[_0x4555('0x32')]();};}function saveUpdates(_0x1fba54,_0x49e8be){return function(_0x9235cd){if(_0x9235cd){return _0x9235cd[_0x4555('0x33')](_0x1fba54)[_0x4555('0x34')](function(_0x216a92){return _0x216a92;});}return null;};}function removeEntity(_0x408406,_0x304f37){return function(_0x26d757){if(_0x26d757){return _0x26d757[_0x4555('0x35')]()[_0x4555('0x34')](function(){var _0x53f92f=_0x26d757[_0x4555('0x36')]({'plain':!![]});var _0x654e9f=_0x4555('0x37');return db['UserProfileResource'][_0x4555('0x35')]({'where':{'type':_0x654e9f,'resourceId':_0x53f92f['id']}})['then'](function(){return _0x26d757;});})[_0x4555('0x34')](function(){_0x408406[_0x4555('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31b4f8,_0x4fe839){return function(_0x43d3c7){if(!_0x43d3c7){_0x31b4f8[_0x4555('0x38')](0x194);}return _0x43d3c7;};}function handleError(_0x4361ff,_0x53f9d3){_0x53f9d3=_0x53f9d3||0x1f4;return function(_0x5df09e){logger[_0x4555('0x23')](_0x5df09e['stack']);if(_0x5df09e[_0x4555('0x39')]){delete _0x5df09e[_0x4555('0x39')];}_0x4361ff[_0x4555('0x29')](_0x53f9d3)[_0x4555('0x3a')](_0x5df09e);};}exports[_0x4555('0x3b')]=function(_0x2490eb,_0x583f57){var _0x9586d5={},_0x797960={},_0xf0630={'count':0x0,'rows':[]};var _0x53a599=db['ChatQueue'][_0x4555('0x3c')];_0x797960[_0x4555('0x3d')]=_['keys'](_0x53a599);_0x797960[_0x4555('0x3e')]=_['keys'](_0x2490eb[_0x4555('0x3e')]);_0x797960[_0x4555('0x3f')]=_['intersection'](_0x797960['model'],_0x797960[_0x4555('0x3e')]);_0x9586d5['attributes']=_[_0x4555('0x40')](_0x797960[_0x4555('0x3d')],qs[_0x4555('0x41')](_0x2490eb[_0x4555('0x3e')][_0x4555('0x41')]));_0x9586d5[_0x4555('0x42')]=_0x9586d5[_0x4555('0x42')][_0x4555('0x43')]?_0x9586d5[_0x4555('0x42')]:_0x797960[_0x4555('0x3d')];if(!_0x2490eb[_0x4555('0x3e')][_0x4555('0x44')](_0x4555('0x45'))){_0x9586d5['limit']=qs['limit'](_0x2490eb[_0x4555('0x3e')][_0x4555('0x2d')]);_0x9586d5[_0x4555('0x2c')]=qs['offset'](_0x2490eb[_0x4555('0x3e')]['offset']);}_0x9586d5[_0x4555('0x46')]=qs[_0x4555('0x47')](_0x2490eb[_0x4555('0x3e')][_0x4555('0x47')]);_0x9586d5[_0x4555('0x48')]=qs[_0x4555('0x3f')](_[_0x4555('0x49')](_0x2490eb[_0x4555('0x3e')],_0x797960[_0x4555('0x3f')]));if(_0x2490eb[_0x4555('0x3e')][_0x4555('0x4a')]){_0x9586d5[_0x4555('0x48')]=_[_0x4555('0x4b')](_0x9586d5[_0x4555('0x48')],{'$or':_['map'](_0x53a599,function(_0x43c1a9){if(_0x43c1a9[_0x4555('0x4c')][_0x4555('0x4d')]!==_0x4555('0x4e')){var _0x1ced5d={};_0x1ced5d[_0x43c1a9[_0x4555('0x4f')]]={'$like':'%'+_0x2490eb[_0x4555('0x3e')][_0x4555('0x4a')]+'%'};return _0x1ced5d;}})});}_0x9586d5=_[_0x4555('0x4b')]({},_0x9586d5,_0x2490eb[_0x4555('0x50')]);var _0x18f640={'where':_0x9586d5['where']};return db['ChatQueue'][_0x4555('0x2b')](_0x18f640)['then'](function(_0x1f94c8){_0xf0630[_0x4555('0x2b')]=_0x1f94c8;if(_0x2490eb[_0x4555('0x3e')][_0x4555('0x51')]){_0x9586d5[_0x4555('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0x4555('0x53')](_0x9586d5);})['then'](function(_0x1692aa){_0xf0630[_0x4555('0x54')]=_0x1692aa;return _0xf0630;})['then'](respondWithFilteredResult(_0x583f57,_0x9586d5))[_0x4555('0x55')](handleError(_0x583f57,null));};exports[_0x4555('0x56')]=function(_0x204382,_0xe2f2b2){var _0x9c99f9={'raw':!![],'where':{'id':_0x204382['params']['id']}},_0x3a829f={};_0x3a829f[_0x4555('0x3d')]=_['keys'](db[_0x4555('0x57')][_0x4555('0x3c')]);_0x3a829f[_0x4555('0x3e')]=_[_0x4555('0x58')](_0x204382['query']);_0x3a829f[_0x4555('0x3f')]=_[_0x4555('0x40')](_0x3a829f['model'],_0x3a829f[_0x4555('0x3e')]);_0x9c99f9[_0x4555('0x42')]=_[_0x4555('0x40')](_0x3a829f[_0x4555('0x3d')],qs['fields'](_0x204382['query']['fields']));_0x9c99f9['attributes']=_0x9c99f9['attributes'][_0x4555('0x43')]?_0x9c99f9[_0x4555('0x42')]:_0x3a829f['model'];if(_0x204382[_0x4555('0x3e')][_0x4555('0x51')]){_0x9c99f9['include']=[{'all':!![]}];}_0x9c99f9=_['merge']({},_0x9c99f9,_0x204382[_0x4555('0x50')]);return db['ChatQueue'][_0x4555('0x59')](_0x9c99f9)['then'](handleEntityNotFound(_0xe2f2b2,null))['then'](respondWithResult(_0xe2f2b2,null))[_0x4555('0x55')](handleError(_0xe2f2b2,null));};exports[_0x4555('0x5a')]=function(_0x424bd1,_0x5cd45b){return db[_0x4555('0x57')]['create'](_0x424bd1[_0x4555('0x5b')],{})[_0x4555('0x34')](function(_0x46642d){var _0x49de43=_0x424bd1[_0x4555('0x5c')][_0x4555('0x36')]({'plain':!![]});if(!_0x49de43)throw new Error(_0x4555('0x5d'));if(_0x49de43[_0x4555('0x5e')]===_0x4555('0x5c')){var _0x1000a5=_0x46642d[_0x4555('0x36')]({'plain':!![]});var _0x447880=_0x4555('0x37');return db[_0x4555('0x5f')][_0x4555('0x59')]({'where':{'name':_0x447880,'userProfileId':_0x49de43[_0x4555('0x60')]},'raw':!![]})[_0x4555('0x34')](function(_0x33cf99){if(_0x33cf99&&_0x33cf99['autoAssociation']===0x0){return db[_0x4555('0x61')][_0x4555('0x5a')]({'name':_0x1000a5['name'],'resourceId':_0x1000a5['id'],'type':_0x33cf99[_0x4555('0x39')],'sectionId':_0x33cf99['id']},{})[_0x4555('0x34')](function(){return _0x46642d;});}else{return _0x46642d;}})[_0x4555('0x55')](function(_0x1027a6){logger[_0x4555('0x23')](_0x4555('0x62'),_0x1027a6);throw _0x1027a6;});}return _0x46642d;})[_0x4555('0x34')](respondWithResult(_0x5cd45b,0xc9))[_0x4555('0x55')](handleError(_0x5cd45b,null));};exports['update']=function(_0x841e11,_0x5d98ff){if(_0x841e11[_0x4555('0x5b')]['id']){delete _0x841e11[_0x4555('0x5b')]['id'];}return db[_0x4555('0x57')][_0x4555('0x59')]({'where':{'id':_0x841e11[_0x4555('0x63')]['id']}})[_0x4555('0x34')](handleEntityNotFound(_0x5d98ff,null))[_0x4555('0x34')](saveUpdates(_0x841e11['body'],null))['then'](respondWithResult(_0x5d98ff,null))[_0x4555('0x55')](handleError(_0x5d98ff,null));};exports[_0x4555('0x35')]=function(_0x294216,_0x4783a4){return db['ChatQueue'][_0x4555('0x59')]({'where':{'id':_0x294216[_0x4555('0x63')]['id']}})[_0x4555('0x34')](handleEntityNotFound(_0x4783a4,null))[_0x4555('0x34')](removeEntity(_0x4783a4,null))[_0x4555('0x55')](handleError(_0x4783a4,null));};exports[_0x4555('0x64')]=function(_0x5e6a41,_0x23ce1a){return db['ChatQueue'][_0x4555('0x64')]()[_0x4555('0x34')](respondWithResult(_0x23ce1a,null))[_0x4555('0x55')](handleError(_0x23ce1a,null));};exports[_0x4555('0x65')]=function(_0x3b9def,_0x1b00cd,_0xbe131){var _0x45c726={'raw':!![],'where':{}},_0x1a2003={},_0x2908fb;return db[_0x4555('0x57')]['findOne']({'where':{'id':_0x3b9def[_0x4555('0x63')]['id']}})[_0x4555('0x34')](handleEntityNotFound(_0x1b00cd,null))[_0x4555('0x34')](function(_0x4c8a34){if(_0x4c8a34){_0x2908fb=_0x4c8a34[_0x4555('0x36')]({'plain':!![]});_0x1a2003[_0x4555('0x3d')]=_['keys'](db[_0x4555('0x66')][_0x4555('0x3c')]);_0x1a2003[_0x4555('0x3e')]=_['keys'](_0x3b9def[_0x4555('0x3e')]);_0x1a2003[_0x4555('0x3f')]=_[_0x4555('0x40')](_0x1a2003[_0x4555('0x3d')],_0x1a2003[_0x4555('0x3e')]);_0x45c726[_0x4555('0x42')]=_['intersection'](_0x1a2003[_0x4555('0x3d')],qs[_0x4555('0x41')](_0x3b9def[_0x4555('0x3e')][_0x4555('0x41')]));_0x45c726['attributes']=_0x45c726[_0x4555('0x42')]['length']?_0x45c726[_0x4555('0x42')]:_0x1a2003[_0x4555('0x3d')];if(!_0x3b9def[_0x4555('0x3e')][_0x4555('0x44')](_0x4555('0x45'))){_0x45c726['limit']=qs[_0x4555('0x2d')](_0x3b9def['query'][_0x4555('0x2d')]);_0x45c726[_0x4555('0x2c')]=qs['offset'](_0x3b9def[_0x4555('0x3e')]['offset']);}_0x45c726[_0x4555('0x46')]=qs[_0x4555('0x47')](_0x3b9def[_0x4555('0x3e')][_0x4555('0x47')]);_0x45c726[_0x4555('0x48')]=qs['filters'](_[_0x4555('0x49')](_0x3b9def[_0x4555('0x3e')],_0x1a2003['filters']));_0x45c726[_0x4555('0x48')][_0x4555('0x67')]=_0x4c8a34['id'];if(_0x3b9def[_0x4555('0x3e')][_0x4555('0x4a')]){_0x45c726[_0x4555('0x48')]=_[_0x4555('0x4b')](_0x45c726[_0x4555('0x48')],{'$or':_[_0x4555('0x68')](_0x45c726[_0x4555('0x42')],function(_0x6581e7){var _0x2d3ea8={};_0x2d3ea8[_0x6581e7]={'$like':'%'+_0x3b9def[_0x4555('0x3e')][_0x4555('0x4a')]+'%'};return _0x2d3ea8;})});}_0x45c726=_[_0x4555('0x4b')]({},_0x45c726,_0x3b9def['options']);return db[_0x4555('0x66')][_0x4555('0x53')](_0x45c726);}})[_0x4555('0x34')](function(_0xf769d5){if(_0xf769d5){return db[_0x4555('0x69')][_0x4555('0x6a')]({'where':{'id':_['map'](_0xf769d5,_0x4555('0x6b')),'role':_0x4555('0x6c')},'attributes':['id','name',_0x4555('0x6d'),_0x4555('0x6e'),'createdAt']});}})['then'](function(_0xde1265){if(_0xde1265){return{'count':_0xde1265[_0x4555('0x2b')],'rows':_['map'](_0xde1265[_0x4555('0x54')],function(_0x3512c){return{'membername':_0x3512c['name'],'UserId':_0x3512c['id'],'queue_name':_0x2908fb[_0x4555('0x39')],'ChatQueueId':_0x2908fb['id'],'interface':util['format']('%s/%s','SIP',_0x3512c[_0x4555('0x39')]),'penalty':0x0,'paused':_0x3512c[_0x4555('0x6d')],'createdAt':_0x3512c[_0x4555('0x6f')],'updatedAt':_0x3512c[_0x4555('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4555('0x34')](respondWithFilteredResult(_0x1b00cd,_0x45c726))[_0x4555('0x55')](handleError(_0x1b00cd,null));};exports[_0x4555('0x70')]=function(_0x9f97e8,_0x5b23a6,_0x21424f){var _0x4ae6b0={};var _0x5a6ab3={};var _0x266fa7;var _0x1ffc9c;return db[_0x4555('0x57')][_0x4555('0x71')]({'where':{'id':_0x9f97e8[_0x4555('0x63')]['id']}})['then'](handleEntityNotFound(_0x5b23a6,null))[_0x4555('0x34')](function(_0x2ff6c5){if(_0x2ff6c5){_0x266fa7=_0x2ff6c5;_0x5a6ab3['model']=_[_0x4555('0x58')](db[_0x4555('0x72')][_0x4555('0x3c')]);_0x5a6ab3[_0x4555('0x3e')]=_['keys'](_0x9f97e8[_0x4555('0x3e')]);_0x5a6ab3[_0x4555('0x3f')]=_[_0x4555('0x40')](_0x5a6ab3[_0x4555('0x3d')],_0x5a6ab3['query']);_0x4ae6b0[_0x4555('0x42')]=_['intersection'](_0x5a6ab3['model'],qs[_0x4555('0x41')](_0x9f97e8[_0x4555('0x3e')]['fields']));_0x4ae6b0['attributes']=_0x4ae6b0[_0x4555('0x42')][_0x4555('0x43')]?_0x4ae6b0[_0x4555('0x42')]:_0x5a6ab3['model'];_0x4ae6b0[_0x4555('0x46')]=qs[_0x4555('0x47')](_0x9f97e8[_0x4555('0x3e')][_0x4555('0x47')]);_0x4ae6b0['where']=qs[_0x4555('0x3f')](_[_0x4555('0x49')](_0x9f97e8[_0x4555('0x3e')],_0x5a6ab3[_0x4555('0x3f')]));if(_0x9f97e8['query'][_0x4555('0x4a')]){_0x4ae6b0[_0x4555('0x48')]=_[_0x4555('0x4b')](_0x4ae6b0[_0x4555('0x48')],{'$or':_['map'](_0x4ae6b0[_0x4555('0x42')],function(_0x2857d7){var _0x39fa9={};_0x39fa9[_0x2857d7]={'$like':'%'+_0x9f97e8[_0x4555('0x3e')]['filter']+'%'};return _0x39fa9;})});}_0x4ae6b0=_['merge']({},_0x4ae6b0,_0x9f97e8[_0x4555('0x50')]);return _0x266fa7[_0x4555('0x70')](_0x4ae6b0);}})[_0x4555('0x34')](function(_0x274975){if(_0x274975){_0x1ffc9c=_0x274975[_0x4555('0x43')];if(!_0x9f97e8[_0x4555('0x3e')][_0x4555('0x44')](_0x4555('0x45'))){_0x4ae6b0[_0x4555('0x2d')]=qs[_0x4555('0x2d')](_0x9f97e8['query'][_0x4555('0x2d')]);_0x4ae6b0[_0x4555('0x2c')]=qs[_0x4555('0x2c')](_0x9f97e8[_0x4555('0x3e')][_0x4555('0x2c')]);}return _0x266fa7[_0x4555('0x70')](_0x4ae6b0);}})[_0x4555('0x34')](function(_0x8f8eea){if(_0x8f8eea){return _0x8f8eea?{'count':_0x1ffc9c,'rows':_0x8f8eea}:null;}})['then'](respondWithResult(_0x5b23a6,null))['catch'](handleError(_0x5b23a6,null));};exports[_0x4555('0x73')]=function(_0x5ab246,_0x2f78f1,_0x19e037){var _0x5b4b27=_0x5ab246[_0x4555('0x5b')][_0x4555('0x74')];return db[_0x4555('0x72')][_0x4555('0x53')]({'where':{'id':_[_0x4555('0x68')](_0x5b4b27,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4555('0x75'),'attributes':['id','name',_0x4555('0x76'),_0x4555('0x77'),_0x4555('0x78')],'raw':!![]}]})['then'](function(_0x3fd36f){if(_0x3fd36f){var _0x22f745=_['flatMap'](_0x3fd36f,function(_0x287dc4){var _0x395e03=_0x287dc4['get']({'plain':!![]});return _0x395e03['Agents'];});return db[_0x4555('0x57')]['find']({'where':{'id':_0x5ab246[_0x4555('0x63')]['id']}})[_0x4555('0x34')](function(_0x538d8a){return db['sequelize'][_0x4555('0x79')](function(_0x585da6){return _0x538d8a['addTeams'](_['map'](_0x5b4b27,'id'),{'transaction':_0x585da6})['then'](function(){return BPromise[_0x4555('0x7a')](_0x22f745,function(_0x4111b8){return db[_0x4555('0x66')][_0x4555('0x7b')]({'where':{'UserId':_0x4111b8['id'],'ChatQueueId':_0x5ab246[_0x4555('0x63')]['id']},'transaction':_0x585da6});});})[_0x4555('0x34')](function(){_0x22f745[_0x4555('0x7c')](function(_0x350b3b){socket[_0x4555('0x7d')](_0x4555('0x7e'),{'UserId':_0x350b3b['id'],'ChatQueueId':_0x538d8a['id']});});});});});}})[_0x4555('0x34')](respondWithStatusCode(_0x2f78f1,null))['catch'](handleError(_0x2f78f1,null));};exports[_0x4555('0x7f')]=function(_0x262def,_0xac4c7,_0x4bbb66){return db[_0x4555('0x72')]['findAll']({'where':{'id':_0x262def[_0x4555('0x3e')][_0x4555('0x80')]},'attributes':['id'],'include':[{'model':db[_0x4555('0x69')],'as':_0x4555('0x75'),'attributes':['id'],'raw':!![]}]})[_0x4555('0x34')](handleEntityNotFound(_0xac4c7,null))['then'](function(_0x39ac9e){var _0x59fcdb=_[_0x4555('0x68')](_0x39ac9e,'id');var _0x3b8112=[];var _0x429731=[];var _0x1623fa=squel['select']();_0x1623fa[_0x4555('0x4f')](_0x4555('0x81'))[_0x4555('0x82')]('team_has_chat_queues','tq')['join'](_0x4555('0x83'),'ut',_0x4555('0x84'))[_0x4555('0x48')](_0x4555('0x85'),_0x262def['params']['id']);for(var _0x4ed103=0x0;_0x4ed103<_0x39ac9e[_0x4555('0x43')];_0x4ed103+=0x1){let _0x4c495a=_0x39ac9e[_0x4ed103];for(var _0x122f60=0x0;_0x122f60<_0x4c495a[_0x4555('0x75')][_0x4555('0x43')];_0x122f60+=0x1){let _0x2bacdb=_0x4c495a[_0x4555('0x75')][_0x122f60];var _0x21793b=_0x1623fa['clone']();_0x21793b['where'](_0x4555('0x86'),_0x2bacdb['id']);_0x429731[_0x4555('0x87')](db[_0x4555('0x88')][_0x4555('0x3e')](_0x21793b['toString'](),{'type':db['sequelize'][_0x4555('0x89')]['SELECT']})[_0x4555('0x34')](function(_0x2d1180){if(_0x2d1180[_0x4555('0x43')]===0x1){return _0x2bacdb['id'];}else{var _0x16a37d=_[_0x4555('0x8a')](_[_0x4555('0x68')](_0x2d1180,_0x4555('0x8b')),function(_0x5e45b1){return _[_0x4555('0x8c')](_0x59fcdb,_0x5e45b1);});if(_0x16a37d){return _0x2bacdb['id'];}}}));}}return BPromise[_0x4555('0x8d')](_0x429731)[_0x4555('0x34')](function(_0x281290){_0x3b8112=_(_0x3b8112)[_0x4555('0x8e')](_0x281290)[_0x4555('0x8f')]()['value']();return db[_0x4555('0x57')][_0x4555('0x59')]({'where':{'id':_0x262def[_0x4555('0x63')]['id']}})['then'](function(_0x416dbb){return db[_0x4555('0x88')][_0x4555('0x79')](function(_0x63a3e5){return _0x416dbb[_0x4555('0x7f')](_0x262def[_0x4555('0x3e')][_0x4555('0x80')],{'transaction':_0x63a3e5})[_0x4555('0x34')](function(){if(!_['isEmpty'](_0x3b8112)){return _0x416dbb[_0x4555('0x90')](_0x3b8112,{'transaction':_0x63a3e5});}})['then'](function(){_0x3b8112[_0x4555('0x7c')](function(_0x589cb3){socket[_0x4555('0x7d')](_0x4555('0x91'),{'UserId':_0x589cb3,'ChatQueueId':_0x416dbb['id']});});});});});});})['then'](respondWithStatusCode(_0xac4c7,null))['catch'](handleError(_0xac4c7,null));};exports[_0x4555('0x92')]=function(_0x2e1b6d,_0x31b5b7,_0x23aa87){return db[_0x4555('0x57')][_0x4555('0x59')]({'where':{'id':_0x2e1b6d[_0x4555('0x63')]['id']}})['then'](handleEntityNotFound(_0x31b5b7,null))[_0x4555('0x34')](function(_0x3e154f){if(_0x3e154f){return _0x3e154f[_0x4555('0x92')](_0x2e1b6d[_0x4555('0x5b')]['ids'],_[_0x4555('0x93')](_0x2e1b6d[_0x4555('0x5b')],[_0x4555('0x80'),'id'])||{})[_0x4555('0x94')](function(_0x444bd0){for(var _0x5853f6=0x0;_0x5853f6<_0x2e1b6d['body']['ids'][_0x4555('0x43')];_0x5853f6+=0x1){socket[_0x4555('0x7d')](_0x4555('0x7e'),{'UserId':_0x2e1b6d['body']['ids'][_0x5853f6],'ChatQueueId':_0x2e1b6d[_0x4555('0x63')]['id']});}return _0x444bd0;});}})[_0x4555('0x34')](respondWithResult(_0x31b5b7,null))[_0x4555('0x55')](handleError(_0x31b5b7,null));};exports[_0x4555('0x90')]=function(_0x1ac867,_0x36e222,_0x5f1e6a){return db['ChatQueue'][_0x4555('0x59')]({'where':{'id':_0x1ac867['params']['id']}})['then'](handleEntityNotFound(_0x36e222,null))[_0x4555('0x34')](function(_0x39ab6f){if(_0x39ab6f){return _0x39ab6f[_0x4555('0x90')](_0x1ac867[_0x4555('0x3e')][_0x4555('0x80')])[_0x4555('0x34')](function(){if(_[_0x4555('0x95')](_0x1ac867[_0x4555('0x3e')]['ids'])){for(var _0x4470ee=0x0;_0x4470ee<_0x1ac867[_0x4555('0x3e')][_0x4555('0x80')][_0x4555('0x43')];_0x4470ee+=0x1){socket[_0x4555('0x7d')](_0x4555('0x91'),{'UserId':Number(_0x1ac867[_0x4555('0x3e')][_0x4555('0x80')][_0x4470ee]),'ChatQueueId':Number(_0x1ac867['params']['id'])});}}else{socket[_0x4555('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x1ac867[_0x4555('0x3e')][_0x4555('0x80')]),'ChatQueueId':Number(_0x1ac867[_0x4555('0x63')]['id'])});}});}})[_0x4555('0x34')](respondWithStatusCode(_0x36e222,null))['catch'](handleError(_0x36e222,null));};exports['getAgents']=function(_0x7bbee2,_0x4dd4c0,_0x45ed53){var _0x9cd0c2={};var _0x178309={};var _0x30cb68;var _0x4a5450;return db['ChatQueue']['findOne']({'where':{'id':_0x7bbee2[_0x4555('0x63')]['id']}})['then'](handleEntityNotFound(_0x4dd4c0,null))[_0x4555('0x34')](function(_0x3ca016){if(_0x3ca016){_0x30cb68=_0x3ca016;_0x178309['model']=_[_0x4555('0x58')](db['User'][_0x4555('0x3c')]);_0x178309[_0x4555('0x3e')]=_['keys'](_0x7bbee2[_0x4555('0x3e')]);_0x178309[_0x4555('0x3f')]=_[_0x4555('0x40')](_0x178309[_0x4555('0x3d')],_0x178309[_0x4555('0x3e')]);_0x9cd0c2[_0x4555('0x42')]=_['intersection'](_0x178309[_0x4555('0x3d')],qs[_0x4555('0x41')](_0x7bbee2[_0x4555('0x3e')][_0x4555('0x41')]));_0x9cd0c2[_0x4555('0x42')]=_0x9cd0c2['attributes'][_0x4555('0x43')]?_0x9cd0c2['attributes']:_0x178309[_0x4555('0x3d')];_0x9cd0c2[_0x4555('0x46')]=qs[_0x4555('0x47')](_0x7bbee2[_0x4555('0x3e')][_0x4555('0x47')]);_0x9cd0c2[_0x4555('0x48')]=qs[_0x4555('0x3f')](_[_0x4555('0x49')](_0x7bbee2[_0x4555('0x3e')],_0x178309['filters']));if(_0x7bbee2[_0x4555('0x3e')][_0x4555('0x4a')]){_0x9cd0c2[_0x4555('0x48')]=_[_0x4555('0x4b')](_0x9cd0c2[_0x4555('0x48')],{'$or':_[_0x4555('0x68')](_0x9cd0c2[_0x4555('0x42')],function(_0x4ca430){var _0x514957={};_0x514957[_0x4ca430]={'$like':'%'+_0x7bbee2[_0x4555('0x3e')][_0x4555('0x4a')]+'%'};return _0x514957;})});}_0x9cd0c2=_[_0x4555('0x4b')]({},_0x9cd0c2,_0x7bbee2[_0x4555('0x50')]);return _0x30cb68['getAgents'](_0x9cd0c2);}})['then'](function(_0x2ed586){if(_0x2ed586){_0x4a5450=_0x2ed586['length'];if(!_0x7bbee2[_0x4555('0x3e')]['hasOwnProperty'](_0x4555('0x45'))){_0x9cd0c2[_0x4555('0x2d')]=qs[_0x4555('0x2d')](_0x7bbee2['query'][_0x4555('0x2d')]);_0x9cd0c2[_0x4555('0x2c')]=qs['offset'](_0x7bbee2['query']['offset']);}return _0x30cb68[_0x4555('0x96')](_0x9cd0c2);}})['then'](function(_0x504249){if(_0x504249){return _0x504249?{'count':_0x4a5450,'rows':_0x504249}:null;}})[_0x4555('0x34')](respondWithResult(_0x4dd4c0,null))['catch'](handleError(_0x4dd4c0,null));}; \ No newline at end of file +var _0x7398=['../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','findAll','rows','params','rawAttributes','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','findOne','Team','pick','addTeams','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','ids','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7398,0x124));var _0x8739=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x7398[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require(_0x8739('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8739('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8739('0x2'));var rp=require(_0x8739('0x3'));var moment=require(_0x8739('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8739('0x5'));var util=require(_0x8739('0x6'));var path=require(_0x8739('0x7'));var sox=require('sox');var csv=require(_0x8739('0x8'));var ejs=require(_0x8739('0x9'));var fs=require('fs');var _=require(_0x8739('0xa'));var squel=require(_0x8739('0xb'));var crypto=require(_0x8739('0xc'));var jsforce=require(_0x8739('0xd'));var deskjs=require(_0x8739('0xe'));var toCsv=require(_0x8739('0x8'));var querystring=require(_0x8739('0xf'));var Papa=require(_0x8739('0x10'));var Redis=require(_0x8739('0x11'));var authService=require(_0x8739('0x12'));var qs=require(_0x8739('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8739('0x14'))(_0x8739('0x15'));var utils=require(_0x8739('0x16'));var config=require(_0x8739('0x17'));var db=require(_0x8739('0x18'))['db'];config['redis']=_[_0x8739('0x19')](config[_0x8739('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8739('0x1b'))(new Redis(config[_0x8739('0x1a')]));require(_0x8739('0x1c'))[_0x8739('0x1d')](socket);var jayson=require(_0x8739('0x1e'));var client=jayson[_0x8739('0x1f')][_0x8739('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3e1ceb,_0x47cdd1,_0x348cba){if(_0x348cba){var _0x493f6e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x493f6e[_0x8739('0x21')](_0x47cdd1)){return _0x3e1ceb;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3e1ceb;}}function respondWithRpcPromise(_0x1a5d97,_0x29a109,_0x226755,_0x163efb){return new BPromise(function(_0x4f274c,_0x577659){var _0x14fa48=_0x163efb||client;return _0x14fa48[_0x8739('0x22')](_0x1a5d97,_0x226755)[_0x8739('0x23')](function(_0x37dba3){logger[_0x8739('0x24')](_0x8739('0x25'),_0x29a109,_0x8739('0x26'));logger[_0x8739('0x27')](_0x8739('0x28'),_0x29a109,_0x8739('0x26'),JSON[_0x8739('0x29')](_0x37dba3));if(_0x37dba3['error']){if(_0x37dba3[_0x8739('0x2a')][_0x8739('0x2b')]===0x1f4){logger[_0x8739('0x2a')](_0x8739('0x25'),_0x29a109,_0x37dba3[_0x8739('0x2a')][_0x8739('0x2c')]);return _0x577659(_0x37dba3[_0x8739('0x2a')]['message']);}logger[_0x8739('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x29a109,_0x37dba3[_0x8739('0x2a')][_0x8739('0x2c')]);return _0x4f274c(_0x37dba3[_0x8739('0x2a')][_0x8739('0x2c')]);}else{logger[_0x8739('0x24')](_0x8739('0x25'),_0x29a109,'request\x20sent');_0x4f274c(_0x37dba3[_0x8739('0x2d')][_0x8739('0x2c')]);}})[_0x8739('0x2e')](function(_0x3c0727){logger['error']('ChatQueue,\x20%s,\x20%s',_0x29a109,_0x3c0727);_0x577659(_0x3c0727);});});}function respondWithStatusCode(_0x283df6,_0x57aea7){_0x57aea7=_0x57aea7||0xcc;return function(_0x272ee4){if(_0x272ee4){return _0x283df6[_0x8739('0x2f')](_0x57aea7);}return _0x283df6[_0x8739('0x30')](_0x57aea7)[_0x8739('0x31')]();};}function respondWithResult(_0x18e322,_0x1f4828){_0x1f4828=_0x1f4828||0xc8;return function(_0x352322){if(_0x352322){return _0x18e322[_0x8739('0x30')](_0x1f4828)[_0x8739('0x32')](_0x352322);}};}function respondWithFilteredResult(_0x4927a6,_0x5e866a){return function(_0x87cf13){if(_0x87cf13){var _0x2f9bd8=_0x87cf13[_0x8739('0x33')],_0x270fae=_0x5e866a[_0x8739('0x34')],_0x4c808d=_0x5e866a[_0x8739('0x34')]+_0x5e866a[_0x8739('0x35')],_0x29f1f1;if(_0x4c808d>=_0x2f9bd8){_0x4c808d=_0x2f9bd8;_0x29f1f1=0xc8;}else{_0x29f1f1=0xce;}_0x4927a6[_0x8739('0x30')](_0x29f1f1);return _0x4927a6['set'](_0x8739('0x36'),_0x270fae+'-'+_0x4c808d+'/'+_0x2f9bd8)[_0x8739('0x32')](_0x87cf13);}return null;};}function patchUpdates(_0x1885f6){return function(_0x59ba13){try{jsonpatch[_0x8739('0x37')](_0x59ba13,_0x1885f6,!![]);}catch(_0x16778e){return BPromise[_0x8739('0x38')](_0x16778e);}return _0x59ba13['save']();};}function saveUpdates(_0x346133,_0x1d9b6a){return function(_0x555e8f){if(_0x555e8f){return _0x555e8f[_0x8739('0x39')](_0x346133)[_0x8739('0x23')](function(_0x3ac1c2){return _0x3ac1c2;});}return null;};}function removeEntity(_0x48cbd0,_0x33d550){return function(_0x252c16){if(_0x252c16){return _0x252c16[_0x8739('0x3a')]()[_0x8739('0x23')](function(){var _0x113ee1=_0x252c16[_0x8739('0x3b')]({'plain':!![]});var _0x499e7c=_0x8739('0x3c');return db[_0x8739('0x3d')][_0x8739('0x3a')]({'where':{'type':_0x499e7c,'resourceId':_0x113ee1['id']}})[_0x8739('0x23')](function(){return _0x252c16;});})[_0x8739('0x23')](function(){_0x48cbd0['status'](0xcc)[_0x8739('0x31')]();});}};}function handleEntityNotFound(_0x18920b,_0xdcc002){return function(_0x3ea63e){if(!_0x3ea63e){_0x18920b['sendStatus'](0x194);}return _0x3ea63e;};}function handleError(_0x16ace6,_0x57e2bd){_0x57e2bd=_0x57e2bd||0x1f4;return function(_0x1259df){logger[_0x8739('0x2a')](_0x1259df[_0x8739('0x3e')]);if(_0x1259df[_0x8739('0x3f')]){delete _0x1259df['name'];}_0x16ace6[_0x8739('0x30')](_0x57e2bd)[_0x8739('0x40')](_0x1259df);};}exports[_0x8739('0x41')]=function(_0x599706,_0x9503d7){var _0x3f67e8={},_0x59a23c={},_0x51a016={'count':0x0,'rows':[]};var _0x4ab57f=db[_0x8739('0x42')]['rawAttributes'];_0x59a23c[_0x8739('0x43')]=_[_0x8739('0x44')](_0x4ab57f);_0x59a23c[_0x8739('0x45')]=_['keys'](_0x599706[_0x8739('0x45')]);_0x59a23c['filters']=_['intersection'](_0x59a23c['model'],_0x59a23c[_0x8739('0x45')]);_0x3f67e8['attributes']=_['intersection'](_0x59a23c[_0x8739('0x43')],qs[_0x8739('0x46')](_0x599706[_0x8739('0x45')][_0x8739('0x46')]));_0x3f67e8[_0x8739('0x47')]=_0x3f67e8[_0x8739('0x47')][_0x8739('0x48')]?_0x3f67e8['attributes']:_0x59a23c[_0x8739('0x43')];if(!_0x599706['query'][_0x8739('0x49')](_0x8739('0x4a'))){_0x3f67e8[_0x8739('0x35')]=qs[_0x8739('0x35')](_0x599706[_0x8739('0x45')][_0x8739('0x35')]);_0x3f67e8['offset']=qs[_0x8739('0x34')](_0x599706[_0x8739('0x45')]['offset']);}_0x3f67e8[_0x8739('0x4b')]=qs[_0x8739('0x4c')](_0x599706[_0x8739('0x45')]['sort']);_0x3f67e8[_0x8739('0x4d')]=qs[_0x8739('0x4e')](_['pick'](_0x599706['query'],_0x59a23c[_0x8739('0x4e')]));if(_0x599706['query'][_0x8739('0x4f')]){_0x3f67e8[_0x8739('0x4d')]=_[_0x8739('0x50')](_0x3f67e8[_0x8739('0x4d')],{'$or':_[_0x8739('0x51')](_0x4ab57f,function(_0x28ae28){if(_0x28ae28['type']['key']!==_0x8739('0x52')){var _0x2f070e={};_0x2f070e[_0x28ae28['field']]={'$like':'%'+_0x599706['query']['filter']+'%'};return _0x2f070e;}})});}_0x3f67e8=_[_0x8739('0x50')]({},_0x3f67e8,_0x599706['options']);var _0x5510bc={'where':_0x3f67e8[_0x8739('0x4d')]};return db[_0x8739('0x42')]['count'](_0x5510bc)[_0x8739('0x23')](function(_0x5a875d){_0x51a016['count']=_0x5a875d;if(_0x599706['query'][_0x8739('0x53')]){_0x3f67e8['include']=[{'all':!![]}];}return db[_0x8739('0x42')][_0x8739('0x54')](_0x3f67e8);})[_0x8739('0x23')](function(_0x4f1e13){_0x51a016[_0x8739('0x55')]=_0x4f1e13;return _0x51a016;})['then'](respondWithFilteredResult(_0x9503d7,_0x3f67e8))[_0x8739('0x2e')](handleError(_0x9503d7,null));};exports['show']=function(_0x470087,_0x3d017c){var _0x39fee8={'raw':!![],'where':{'id':_0x470087[_0x8739('0x56')]['id']}},_0x5c4f8f={};_0x5c4f8f[_0x8739('0x43')]=_[_0x8739('0x44')](db[_0x8739('0x42')][_0x8739('0x57')]);_0x5c4f8f[_0x8739('0x45')]=_[_0x8739('0x44')](_0x470087[_0x8739('0x45')]);_0x5c4f8f[_0x8739('0x4e')]=_[_0x8739('0x58')](_0x5c4f8f[_0x8739('0x43')],_0x5c4f8f[_0x8739('0x45')]);_0x39fee8['attributes']=_['intersection'](_0x5c4f8f[_0x8739('0x43')],qs[_0x8739('0x46')](_0x470087['query'][_0x8739('0x46')]));_0x39fee8[_0x8739('0x47')]=_0x39fee8['attributes'][_0x8739('0x48')]?_0x39fee8[_0x8739('0x47')]:_0x5c4f8f['model'];if(_0x470087[_0x8739('0x45')][_0x8739('0x53')]){_0x39fee8[_0x8739('0x59')]=[{'all':!![]}];}_0x39fee8=_[_0x8739('0x50')]({},_0x39fee8,_0x470087[_0x8739('0x5a')]);return db[_0x8739('0x42')][_0x8739('0x5b')](_0x39fee8)[_0x8739('0x23')](handleEntityNotFound(_0x3d017c,null))[_0x8739('0x23')](respondWithResult(_0x3d017c,null))[_0x8739('0x2e')](handleError(_0x3d017c,null));};exports[_0x8739('0x5c')]=function(_0x593fd6,_0x1c1f4a){return db[_0x8739('0x42')][_0x8739('0x5c')](_0x593fd6[_0x8739('0x5d')],{})[_0x8739('0x23')](function(_0x449b15){var _0x3a59af=_0x593fd6[_0x8739('0x5e')][_0x8739('0x3b')]({'plain':!![]});if(!_0x3a59af)throw new Error(_0x8739('0x5f'));if(_0x3a59af[_0x8739('0x60')]===_0x8739('0x5e')){var _0x46b2d6=_0x449b15[_0x8739('0x3b')]({'plain':!![]});var _0x5d905f=_0x8739('0x3c');return db[_0x8739('0x61')]['find']({'where':{'name':_0x5d905f,'userProfileId':_0x3a59af[_0x8739('0x62')]},'raw':!![]})['then'](function(_0x39bbc8){if(_0x39bbc8&&_0x39bbc8[_0x8739('0x63')]===0x0){return db[_0x8739('0x3d')]['create']({'name':_0x46b2d6[_0x8739('0x3f')],'resourceId':_0x46b2d6['id'],'type':_0x39bbc8[_0x8739('0x3f')],'sectionId':_0x39bbc8['id']},{})['then'](function(){return _0x449b15;});}else{return _0x449b15;}})[_0x8739('0x2e')](function(_0x139070){logger[_0x8739('0x2a')](_0x8739('0x64'),_0x139070);throw _0x139070;});}return _0x449b15;})['then'](respondWithResult(_0x1c1f4a,0xc9))['catch'](handleError(_0x1c1f4a,null));};exports['update']=function(_0x48c046,_0x24419b){if(_0x48c046[_0x8739('0x5d')]['id']){delete _0x48c046[_0x8739('0x5d')]['id'];}return db[_0x8739('0x42')]['find']({'where':{'id':_0x48c046[_0x8739('0x56')]['id']}})[_0x8739('0x23')](handleEntityNotFound(_0x24419b,null))[_0x8739('0x23')](saveUpdates(_0x48c046['body'],null))['then'](respondWithResult(_0x24419b,null))['catch'](handleError(_0x24419b,null));};exports['destroy']=function(_0x4c085e,_0x8775bd){return db['ChatQueue']['find']({'where':{'id':_0x4c085e[_0x8739('0x56')]['id']}})[_0x8739('0x23')](handleEntityNotFound(_0x8775bd,null))[_0x8739('0x23')](removeEntity(_0x8775bd,null))[_0x8739('0x2e')](handleError(_0x8775bd,null));};exports[_0x8739('0x65')]=function(_0x5d7342,_0x4a771c){return db[_0x8739('0x42')][_0x8739('0x65')]()[_0x8739('0x23')](respondWithResult(_0x4a771c,null))[_0x8739('0x2e')](handleError(_0x4a771c,null));};exports[_0x8739('0x66')]=function(_0x2c8b8d,_0x22219b,_0x54b8bf){var _0x4ef174={'raw':!![],'where':{}},_0x4aad6a={},_0x193093;return db[_0x8739('0x42')]['findOne']({'where':{'id':_0x2c8b8d[_0x8739('0x56')]['id']}})[_0x8739('0x23')](handleEntityNotFound(_0x22219b,null))[_0x8739('0x23')](function(_0x516c5a){if(_0x516c5a){_0x193093=_0x516c5a['get']({'plain':!![]});_0x4aad6a[_0x8739('0x43')]=_[_0x8739('0x44')](db['UserChatQueue'][_0x8739('0x57')]);_0x4aad6a[_0x8739('0x45')]=_['keys'](_0x2c8b8d[_0x8739('0x45')]);_0x4aad6a[_0x8739('0x4e')]=_[_0x8739('0x58')](_0x4aad6a[_0x8739('0x43')],_0x4aad6a['query']);_0x4ef174[_0x8739('0x47')]=_[_0x8739('0x58')](_0x4aad6a[_0x8739('0x43')],qs['fields'](_0x2c8b8d[_0x8739('0x45')][_0x8739('0x46')]));_0x4ef174['attributes']=_0x4ef174['attributes'][_0x8739('0x48')]?_0x4ef174['attributes']:_0x4aad6a[_0x8739('0x43')];if(!_0x2c8b8d[_0x8739('0x45')][_0x8739('0x49')](_0x8739('0x4a'))){_0x4ef174['limit']=qs[_0x8739('0x35')](_0x2c8b8d[_0x8739('0x45')][_0x8739('0x35')]);_0x4ef174[_0x8739('0x34')]=qs[_0x8739('0x34')](_0x2c8b8d[_0x8739('0x45')][_0x8739('0x34')]);}_0x4ef174[_0x8739('0x4b')]=qs[_0x8739('0x4c')](_0x2c8b8d[_0x8739('0x45')]['sort']);_0x4ef174[_0x8739('0x4d')]=qs['filters'](_['pick'](_0x2c8b8d[_0x8739('0x45')],_0x4aad6a['filters']));_0x4ef174['where'][_0x8739('0x67')]=_0x516c5a['id'];if(_0x2c8b8d[_0x8739('0x45')][_0x8739('0x4f')]){_0x4ef174[_0x8739('0x4d')]=_[_0x8739('0x50')](_0x4ef174['where'],{'$or':_[_0x8739('0x51')](_0x4ef174[_0x8739('0x47')],function(_0x507832){var _0x371205={};_0x371205[_0x507832]={'$like':'%'+_0x2c8b8d[_0x8739('0x45')][_0x8739('0x4f')]+'%'};return _0x371205;})});}_0x4ef174=_[_0x8739('0x50')]({},_0x4ef174,_0x2c8b8d['options']);return db[_0x8739('0x68')][_0x8739('0x54')](_0x4ef174);}})[_0x8739('0x23')](function(_0x24d2fe){if(_0x24d2fe){return db[_0x8739('0x69')][_0x8739('0x6a')]({'where':{'id':_['map'](_0x24d2fe,_0x8739('0x6b')),'role':_0x8739('0x6c')},'attributes':['id',_0x8739('0x3f'),'chatPause',_0x8739('0x6d'),_0x8739('0x6e')]});}})['then'](function(_0x9b9dd7){if(_0x9b9dd7){return{'count':_0x9b9dd7['count'],'rows':_[_0x8739('0x51')](_0x9b9dd7[_0x8739('0x55')],function(_0xdfadc7){return{'membername':_0xdfadc7[_0x8739('0x3f')],'UserId':_0xdfadc7['id'],'queue_name':_0x193093['name'],'ChatQueueId':_0x193093['id'],'interface':util[_0x8739('0x6f')](_0x8739('0x70'),_0x8739('0x71'),_0xdfadc7['name']),'penalty':0x0,'paused':_0xdfadc7[_0x8739('0x72')],'createdAt':_0xdfadc7['createdAt'],'updatedAt':_0xdfadc7[_0x8739('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8739('0x23')](respondWithFilteredResult(_0x22219b,_0x4ef174))[_0x8739('0x2e')](handleError(_0x22219b,null));};exports[_0x8739('0x73')]=function(_0x5872df,_0x46087a,_0x2c06b4){var _0xc3c09e={};var _0x23a658={};var _0x20b563;var _0x2a75a2;return db[_0x8739('0x42')][_0x8739('0x74')]({'where':{'id':_0x5872df['params']['id']}})[_0x8739('0x23')](handleEntityNotFound(_0x46087a,null))['then'](function(_0x99f263){if(_0x99f263){_0x20b563=_0x99f263;_0x23a658[_0x8739('0x43')]=_[_0x8739('0x44')](db[_0x8739('0x75')][_0x8739('0x57')]);_0x23a658[_0x8739('0x45')]=_[_0x8739('0x44')](_0x5872df[_0x8739('0x45')]);_0x23a658['filters']=_[_0x8739('0x58')](_0x23a658[_0x8739('0x43')],_0x23a658['query']);_0xc3c09e[_0x8739('0x47')]=_[_0x8739('0x58')](_0x23a658[_0x8739('0x43')],qs[_0x8739('0x46')](_0x5872df['query']['fields']));_0xc3c09e[_0x8739('0x47')]=_0xc3c09e[_0x8739('0x47')]['length']?_0xc3c09e['attributes']:_0x23a658['model'];_0xc3c09e['order']=qs[_0x8739('0x4c')](_0x5872df['query']['sort']);_0xc3c09e['where']=qs[_0x8739('0x4e')](_[_0x8739('0x76')](_0x5872df[_0x8739('0x45')],_0x23a658[_0x8739('0x4e')]));if(_0x5872df[_0x8739('0x45')][_0x8739('0x4f')]){_0xc3c09e[_0x8739('0x4d')]=_[_0x8739('0x50')](_0xc3c09e['where'],{'$or':_['map'](_0xc3c09e['attributes'],function(_0x2599b1){var _0x5d2a4f={};_0x5d2a4f[_0x2599b1]={'$like':'%'+_0x5872df[_0x8739('0x45')][_0x8739('0x4f')]+'%'};return _0x5d2a4f;})});}_0xc3c09e=_[_0x8739('0x50')]({},_0xc3c09e,_0x5872df[_0x8739('0x5a')]);return _0x20b563[_0x8739('0x73')](_0xc3c09e);}})[_0x8739('0x23')](function(_0x1b847f){if(_0x1b847f){_0x2a75a2=_0x1b847f[_0x8739('0x48')];if(!_0x5872df['query'][_0x8739('0x49')]('nolimit')){_0xc3c09e[_0x8739('0x35')]=qs[_0x8739('0x35')](_0x5872df[_0x8739('0x45')][_0x8739('0x35')]);_0xc3c09e['offset']=qs['offset'](_0x5872df[_0x8739('0x45')]['offset']);}return _0x20b563['getTeams'](_0xc3c09e);}})[_0x8739('0x23')](function(_0x5f45ee){if(_0x5f45ee){return _0x5f45ee?{'count':_0x2a75a2,'rows':_0x5f45ee}:null;}})[_0x8739('0x23')](respondWithResult(_0x46087a,null))[_0x8739('0x2e')](handleError(_0x46087a,null));};exports[_0x8739('0x77')]=function(_0xfc0d27,_0x45380e,_0x437a92){var _0x1c2095=_0xfc0d27['body'][_0x8739('0x78')];return db[_0x8739('0x75')][_0x8739('0x54')]({'where':{'id':_[_0x8739('0x51')](_0x1c2095,'id')},'attributes':['id'],'include':[{'model':db[_0x8739('0x69')],'as':_0x8739('0x79'),'attributes':['id',_0x8739('0x3f'),_0x8739('0x7a'),_0x8739('0x7b'),_0x8739('0x7c')],'raw':!![]}]})[_0x8739('0x23')](function(_0x55c75f){if(_0x55c75f){var _0x9773a9=_[_0x8739('0x7d')](_0x55c75f,function(_0x2d230c){var _0x319fce=_0x2d230c[_0x8739('0x3b')]({'plain':!![]});return _0x319fce['Agents'];});return db['ChatQueue'][_0x8739('0x5b')]({'where':{'id':_0xfc0d27[_0x8739('0x56')]['id']}})[_0x8739('0x23')](function(_0x251b0f){return db[_0x8739('0x7e')][_0x8739('0x7f')](function(_0x524189){return _0x251b0f[_0x8739('0x77')](_[_0x8739('0x51')](_0x1c2095,'id'),{'transaction':_0x524189})['then'](function(){return BPromise[_0x8739('0x80')](_0x9773a9,function(_0x512dcc){return db[_0x8739('0x68')]['findOrCreate']({'where':{'UserId':_0x512dcc['id'],'ChatQueueId':_0xfc0d27[_0x8739('0x56')]['id']},'transaction':_0x524189});});})['then'](function(){_0x9773a9[_0x8739('0x81')](function(_0x103ed2){socket[_0x8739('0x82')](_0x8739('0x83'),{'UserId':_0x103ed2['id'],'ChatQueueId':_0x251b0f['id']});});});});});}})[_0x8739('0x23')](respondWithStatusCode(_0x45380e,null))[_0x8739('0x2e')](handleError(_0x45380e,null));};exports[_0x8739('0x84')]=function(_0x2be258,_0x25183d,_0x1acb30){return db[_0x8739('0x75')][_0x8739('0x54')]({'where':{'id':_0x2be258[_0x8739('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8739('0x69')],'as':_0x8739('0x79'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25183d,null))[_0x8739('0x23')](function(_0x1fbb0e){var _0x50c60f=_[_0x8739('0x51')](_0x1fbb0e,'id');var _0x59ac41=[];var _0x4fd55d=[];var _0x5bfad3=squel[_0x8739('0x85')]();_0x5bfad3[_0x8739('0x86')](_0x8739('0x87'))[_0x8739('0x88')](_0x8739('0x89'),'tq')[_0x8739('0x8a')](_0x8739('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8739('0x4d')](_0x8739('0x8c'),_0x2be258[_0x8739('0x56')]['id']);for(var _0xa8eab2=0x0;_0xa8eab2<_0x1fbb0e[_0x8739('0x48')];_0xa8eab2+=0x1){let _0x46d9c7=_0x1fbb0e[_0xa8eab2];for(var _0x2f9de0=0x0;_0x2f9de0<_0x46d9c7[_0x8739('0x79')][_0x8739('0x48')];_0x2f9de0+=0x1){let _0x1f2b0e=_0x46d9c7['Agents'][_0x2f9de0];var _0x3fadae=_0x5bfad3['clone']();_0x3fadae[_0x8739('0x4d')](_0x8739('0x8d'),_0x1f2b0e['id']);_0x4fd55d['push'](db['sequelize'][_0x8739('0x45')](_0x3fadae[_0x8739('0x8e')](),{'type':db[_0x8739('0x7e')][_0x8739('0x8f')][_0x8739('0x90')]})[_0x8739('0x23')](function(_0x3cd758){if(_0x3cd758[_0x8739('0x48')]===0x1){return _0x1f2b0e['id'];}else{var _0x12bde6=_[_0x8739('0x91')](_[_0x8739('0x51')](_0x3cd758,_0x8739('0x92')),function(_0x3bb175){return _['includes'](_0x50c60f,_0x3bb175);});if(_0x12bde6){return _0x1f2b0e['id'];}}}));}}return BPromise[_0x8739('0x93')](_0x4fd55d)[_0x8739('0x23')](function(_0x5d6852){_0x59ac41=_(_0x59ac41)['union'](_0x5d6852)[_0x8739('0x94')]()[_0x8739('0x95')]();return db[_0x8739('0x42')]['find']({'where':{'id':_0x2be258[_0x8739('0x56')]['id']}})[_0x8739('0x23')](function(_0x5cbd6c){return db[_0x8739('0x7e')][_0x8739('0x7f')](function(_0xaf8282){return _0x5cbd6c['removeTeams'](_0x2be258['query'][_0x8739('0x96')],{'transaction':_0xaf8282})[_0x8739('0x23')](function(){if(!_[_0x8739('0x97')](_0x59ac41)){return _0x5cbd6c['removeAgents'](_0x59ac41,{'transaction':_0xaf8282});}})[_0x8739('0x23')](function(){_0x59ac41[_0x8739('0x81')](function(_0x3dac0c){socket['emit'](_0x8739('0x98'),{'UserId':_0x3dac0c,'ChatQueueId':_0x5cbd6c['id']});});});});});});})[_0x8739('0x23')](respondWithStatusCode(_0x25183d,null))['catch'](handleError(_0x25183d,null));};exports[_0x8739('0x99')]=function(_0x1cac9d,_0x5d843e,_0x3b2521){return db[_0x8739('0x42')][_0x8739('0x5b')]({'where':{'id':_0x1cac9d[_0x8739('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d843e,null))['then'](function(_0x60e3f5){if(_0x60e3f5){return _0x60e3f5[_0x8739('0x99')](_0x1cac9d[_0x8739('0x5d')]['ids'],_['omit'](_0x1cac9d[_0x8739('0x5d')],[_0x8739('0x96'),'id'])||{})[_0x8739('0x9a')](function(_0xf8dd23){for(var _0x38a40b=0x0;_0x38a40b<_0x1cac9d[_0x8739('0x5d')][_0x8739('0x96')]['length'];_0x38a40b+=0x1){socket['emit'](_0x8739('0x83'),{'UserId':_0x1cac9d[_0x8739('0x5d')][_0x8739('0x96')][_0x38a40b],'ChatQueueId':_0x1cac9d['params']['id']});}return _0xf8dd23;});}})[_0x8739('0x23')](respondWithResult(_0x5d843e,null))[_0x8739('0x2e')](handleError(_0x5d843e,null));};exports[_0x8739('0x9b')]=function(_0x4249c5,_0x1fc63c,_0xc1bb36){return db[_0x8739('0x42')]['find']({'where':{'id':_0x4249c5['params']['id']}})['then'](handleEntityNotFound(_0x1fc63c,null))[_0x8739('0x23')](function(_0x46b988){if(_0x46b988){return _0x46b988[_0x8739('0x9b')](_0x4249c5[_0x8739('0x45')][_0x8739('0x96')])[_0x8739('0x23')](function(){if(_['isArray'](_0x4249c5[_0x8739('0x45')][_0x8739('0x96')])){for(var _0x418cea=0x0;_0x418cea<_0x4249c5[_0x8739('0x45')]['ids'][_0x8739('0x48')];_0x418cea+=0x1){socket[_0x8739('0x82')](_0x8739('0x98'),{'UserId':Number(_0x4249c5[_0x8739('0x45')][_0x8739('0x96')][_0x418cea]),'ChatQueueId':Number(_0x4249c5[_0x8739('0x56')]['id'])});}}else{socket[_0x8739('0x82')](_0x8739('0x98'),{'UserId':Number(_0x4249c5[_0x8739('0x45')]['ids']),'ChatQueueId':Number(_0x4249c5[_0x8739('0x56')]['id'])});}});}})[_0x8739('0x23')](respondWithStatusCode(_0x1fc63c,null))[_0x8739('0x2e')](handleError(_0x1fc63c,null));};exports['getAgents']=function(_0x1f9f8b,_0x4d537a,_0x9a613f){var _0x3cebec={};var _0x2c988f={};var _0x3de153;var _0x35bee9;return db[_0x8739('0x42')]['findOne']({'where':{'id':_0x1f9f8b['params']['id']}})[_0x8739('0x23')](handleEntityNotFound(_0x4d537a,null))['then'](function(_0x3a6dc6){if(_0x3a6dc6){_0x3de153=_0x3a6dc6;_0x2c988f[_0x8739('0x43')]=_[_0x8739('0x44')](db[_0x8739('0x69')][_0x8739('0x57')]);_0x2c988f[_0x8739('0x45')]=_[_0x8739('0x44')](_0x1f9f8b[_0x8739('0x45')]);_0x2c988f['filters']=_[_0x8739('0x58')](_0x2c988f[_0x8739('0x43')],_0x2c988f[_0x8739('0x45')]);_0x3cebec['attributes']=_[_0x8739('0x58')](_0x2c988f[_0x8739('0x43')],qs[_0x8739('0x46')](_0x1f9f8b['query'][_0x8739('0x46')]));_0x3cebec[_0x8739('0x47')]=_0x3cebec['attributes'][_0x8739('0x48')]?_0x3cebec[_0x8739('0x47')]:_0x2c988f[_0x8739('0x43')];_0x3cebec[_0x8739('0x4b')]=qs['sort'](_0x1f9f8b[_0x8739('0x45')][_0x8739('0x4c')]);_0x3cebec[_0x8739('0x4d')]=qs['filters'](_[_0x8739('0x76')](_0x1f9f8b[_0x8739('0x45')],_0x2c988f[_0x8739('0x4e')]));if(_0x1f9f8b[_0x8739('0x45')][_0x8739('0x4f')]){_0x3cebec[_0x8739('0x4d')]=_[_0x8739('0x50')](_0x3cebec[_0x8739('0x4d')],{'$or':_[_0x8739('0x51')](_0x3cebec[_0x8739('0x47')],function(_0x370837){var _0x4a7978={};_0x4a7978[_0x370837]={'$like':'%'+_0x1f9f8b[_0x8739('0x45')][_0x8739('0x4f')]+'%'};return _0x4a7978;})});}_0x3cebec=_[_0x8739('0x50')]({},_0x3cebec,_0x1f9f8b[_0x8739('0x5a')]);return _0x3de153[_0x8739('0x9c')](_0x3cebec);}})[_0x8739('0x23')](function(_0x30866e){if(_0x30866e){_0x35bee9=_0x30866e[_0x8739('0x48')];if(!_0x1f9f8b[_0x8739('0x45')][_0x8739('0x49')](_0x8739('0x4a'))){_0x3cebec[_0x8739('0x35')]=qs[_0x8739('0x35')](_0x1f9f8b[_0x8739('0x45')][_0x8739('0x35')]);_0x3cebec[_0x8739('0x34')]=qs[_0x8739('0x34')](_0x1f9f8b[_0x8739('0x45')][_0x8739('0x34')]);}return _0x3de153[_0x8739('0x9c')](_0x3cebec);}})[_0x8739('0x23')](function(_0x4b384b){if(_0x4b384b){return _0x4b384b?{'count':_0x35bee9,'rows':_0x4b384b}:null;}})['then'](respondWithResult(_0x4d537a,null))[_0x8739('0x2e')](handleError(_0x4d537a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8f590ca..91cc804 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 _0x544a=['events','../../mysqldb','ChatQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x544a,0x118));var _0xa544=function(_0x4fd977,_0x2c4208){_0x4fd977=_0x4fd977-0x0;var _0x577098=_0x544a[_0x4fd977];return _0x577098;};'use strict';var EventEmitter=require(_0xa544('0x0'));var ChatQueue=require(_0xa544('0x1'))['db'][_0xa544('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa544('0x3'),'afterDestroy':_0xa544('0x4')};function emitEvent(_0x1e1980){return function(_0xf2d6a0,_0x4b4677,_0x4cfd38){ChatQueueEvents['emit'](_0x1e1980+':'+_0xf2d6a0['id'],_0xf2d6a0);ChatQueueEvents[_0xa544('0x5')](_0x1e1980,_0xf2d6a0);_0x4cfd38(null);};}for(var e in events){if(events[_0xa544('0x6')](e)){var event=events[e];ChatQueue[_0xa544('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xea28=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xea28,0x13a));var _0x8ea2=function(_0xc937f2,_0x4bad11){_0xc937f2=_0xc937f2-0x0;var _0x2603fc=_0xea28[_0xc937f2];return _0x2603fc;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var ChatQueue=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8ea2('0x3')](0x0);var events={'afterCreate':_0x8ea2('0x4'),'afterUpdate':_0x8ea2('0x5'),'afterDestroy':_0x8ea2('0x6')};function emitEvent(_0x10f7bb){return function(_0x4b7cda,_0x9b45ab,_0x23aaf1){ChatQueueEvents[_0x8ea2('0x7')](_0x10f7bb+':'+_0x4b7cda['id'],_0x4b7cda);ChatQueueEvents['emit'](_0x10f7bb,_0x4b7cda);_0x23aaf1(null);};}for(var e in events){if(events[_0x8ea2('0x8')](e)){var event=events[e];ChatQueue[_0x8ea2('0x9')](e,emitEvent(event));}}module[_0x8ea2('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 217fb44..25991ce 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 _0x6170=['bluebird','request-promise','path','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x552869,_0x214bee){var _0x1b98a6=function(_0xd4a658){while(--_0xd4a658){_0x552869['push'](_0x552869['shift']());}};_0x1b98a6(++_0x214bee);}(_0x6170,0x17d));var _0x0617=function(_0x5e3d3e,_0x52c457){_0x5e3d3e=_0x5e3d3e-0x0;var _0x148191=_0x6170[_0x5e3d3e];return _0x148191;};'use strict';var _=require(_0x0617('0x0'));var util=require(_0x0617('0x1'));var logger=require(_0x0617('0x2'))(_0x0617('0x3'));var moment=require('moment');var BPromise=require(_0x0617('0x4'));var rp=require(_0x0617('0x5'));var fs=require('fs');var path=require(_0x0617('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x0617('0x7')]=function(_0x4cb118,_0x3bffba){return _0x4cb118[_0x0617('0x8')](_0x0617('0x9'),attributes,{'tableName':_0x0617('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3670=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x34ac8b,_0x37ee71){var _0x30c680=function(_0x507b66){while(--_0x507b66){_0x34ac8b['push'](_0x34ac8b['shift']());}};_0x30c680(++_0x37ee71);}(_0x3670,0x16c));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0367('0x0'));var logger=require(_0x0367('0x1'))(_0x0367('0x2'));var moment=require(_0x0367('0x3'));var BPromise=require(_0x0367('0x4'));var rp=require(_0x0367('0x5'));var fs=require('fs');var path=require(_0x0367('0x6'));var rimraf=require('rimraf');var config=require(_0x0367('0x7'));var attributes=require(_0x0367('0x8'));module[_0x0367('0x9')]=function(_0x1e2fc5,_0x81110e){return _0x1e2fc5[_0x0367('0xa')](_0x0367('0xb'),attributes,{'tableName':_0x0367('0xc'),'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 dce6c02..563702e 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 _0x2595=['limit','include','model','map','stringify','find','raw','ShowChatQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','request\x20sent','error','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','options','attributes'];(function(_0x5c52e6,_0x267012){var _0x25c3f9=function(_0xaf2ef2){while(--_0xaf2ef2){_0x5c52e6['push'](_0x5c52e6['shift']());}};_0x25c3f9(++_0x267012);}(_0x2595,0x120));var _0x5259=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x2595[_0x2dd390];return _0x3afe47;};'use strict';var _=require(_0x5259('0x0'));var util=require(_0x5259('0x1'));var moment=require(_0x5259('0x2'));var BPromise=require(_0x5259('0x3'));var rs=require(_0x5259('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5259('0x5'))['db'];var utils=require(_0x5259('0x6'));var logger=require(_0x5259('0x7'))('rpc');var config=require(_0x5259('0x8'));var jayson=require(_0x5259('0x9'));var client=jayson[_0x5259('0xa')][_0x5259('0xb')]({'port':0x232a});config[_0x5259('0xc')]=_[_0x5259('0xd')](config[_0x5259('0xc')],{'host':_0x5259('0xe'),'port':0x18eb});var socket=require(_0x5259('0xf'))(new Redis(config[_0x5259('0xc')]));require(_0x5259('0x10'))[_0x5259('0x11')](socket);function respondWithRpcPromise(_0x5e7155,_0x22f6db,_0x3fe17b){return new BPromise(function(_0x112e8a,_0x5a3b4c){return client[_0x5259('0x12')](_0x5e7155,_0x3fe17b)[_0x5259('0x13')](function(_0x3d8f97){logger[_0x5259('0x14')]('ChatQueue,\x20%s,\x20%s',_0x22f6db,'request\x20sent');logger[_0x5259('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22f6db,_0x5259('0x16'),JSON['stringify'](_0x3d8f97));if(_0x3d8f97[_0x5259('0x17')]){if(_0x3d8f97[_0x5259('0x17')]['code']===0x1f4){logger['error'](_0x5259('0x18'),_0x22f6db,_0x3d8f97['error'][_0x5259('0x19')]);return _0x5a3b4c(_0x3d8f97[_0x5259('0x17')][_0x5259('0x19')]);}logger[_0x5259('0x17')](_0x5259('0x18'),_0x22f6db,_0x3d8f97['error'][_0x5259('0x19')]);return _0x112e8a(_0x3d8f97[_0x5259('0x17')][_0x5259('0x19')]);}else{logger[_0x5259('0x14')]('ChatQueue,\x20%s,\x20%s',_0x22f6db,_0x5259('0x16'));_0x112e8a(_0x3d8f97[_0x5259('0x1a')][_0x5259('0x19')]);}})[_0x5259('0x1b')](function(_0x3b0603){logger['error'](_0x5259('0x18'),_0x22f6db,_0x3b0603);_0x5a3b4c(_0x3b0603);});});}exports['GetChatQueue']=function(_0x47a5c7){var _0x2319b7=this;return new Promise(function(_0x175db5,_0x31566f){return db[_0x5259('0x1c')][_0x5259('0x1d')]({'raw':_0x47a5c7[_0x5259('0x1e')]?_0x47a5c7[_0x5259('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x47a5c7['options']?_0x47a5c7[_0x5259('0x1e')]['where']||null:null,'attributes':_0x47a5c7['options']?_0x47a5c7[_0x5259('0x1e')][_0x5259('0x1f')]||null:null,'limit':_0x47a5c7[_0x5259('0x1e')]?_0x47a5c7[_0x5259('0x1e')][_0x5259('0x20')]||null:null,'include':_0x47a5c7['options']?_0x47a5c7['options']['include']?_['map'](_0x47a5c7[_0x5259('0x1e')][_0x5259('0x21')],function(_0x764f82){return{'model':db[_0x764f82[_0x5259('0x22')]],'as':_0x764f82['as'],'attributes':_0x764f82['attributes'],'include':_0x764f82[_0x5259('0x21')]?_[_0x5259('0x23')](_0x764f82[_0x5259('0x21')],function(_0x513ce7){return{'model':db[_0x513ce7[_0x5259('0x22')]],'as':_0x513ce7['as'],'attributes':_0x513ce7[_0x5259('0x1f')],'include':_0x513ce7[_0x5259('0x21')]?_['map'](_0x513ce7[_0x5259('0x21')],function(_0x40d837){return{'model':db[_0x40d837[_0x5259('0x22')]],'as':_0x40d837['as'],'attributes':_0x40d837[_0x5259('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fcc64){logger[_0x5259('0x14')]('GetChatQueue',_0x47a5c7);logger[_0x5259('0x15')]('GetChatQueue',_0x47a5c7,JSON[_0x5259('0x24')](_0x3fcc64));_0x175db5(_0x3fcc64);})[_0x5259('0x1b')](function(_0x3c88ff){logger[_0x5259('0x17')]('GetChatQueue',_0x3c88ff[_0x5259('0x19')],_0x47a5c7);_0x31566f(_0x2319b7[_0x5259('0x17')](0x1f4,_0x3c88ff[_0x5259('0x19')]));});});};exports['ShowChatQueue']=function(_0x3186f2){var _0xbbf96=this;return new Promise(function(_0x282bf,_0x1c0da8){return db[_0x5259('0x1c')][_0x5259('0x25')]({'raw':_0x3186f2[_0x5259('0x1e')]?_0x3186f2[_0x5259('0x1e')][_0x5259('0x26')]===undefined?!![]:![]:!![],'where':_0x3186f2[_0x5259('0x1e')]?_0x3186f2[_0x5259('0x1e')]['where']||null:null,'attributes':_0x3186f2[_0x5259('0x1e')]?_0x3186f2[_0x5259('0x1e')][_0x5259('0x1f')]||null:null,'include':_0x3186f2[_0x5259('0x1e')]?_0x3186f2[_0x5259('0x1e')][_0x5259('0x21')]?_[_0x5259('0x23')](_0x3186f2[_0x5259('0x1e')][_0x5259('0x21')],function(_0x285fd0){return{'model':db[_0x285fd0[_0x5259('0x22')]],'as':_0x285fd0['as'],'attributes':_0x285fd0[_0x5259('0x1f')],'include':_0x285fd0[_0x5259('0x21')]?_[_0x5259('0x23')](_0x285fd0[_0x5259('0x21')],function(_0x3ae35b){return{'model':db[_0x3ae35b[_0x5259('0x22')]],'as':_0x3ae35b['as'],'attributes':_0x3ae35b[_0x5259('0x1f')],'include':_0x3ae35b['include']?_[_0x5259('0x23')](_0x3ae35b[_0x5259('0x21')],function(_0x25cb73){return{'model':db[_0x25cb73[_0x5259('0x22')]],'as':_0x25cb73['as'],'attributes':_0x25cb73[_0x5259('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5259('0x13')](function(_0x1ed251){logger[_0x5259('0x14')](_0x5259('0x27'),_0x3186f2);logger[_0x5259('0x15')](_0x5259('0x27'),_0x3186f2,JSON[_0x5259('0x24')](_0x1ed251));_0x282bf(_0x1ed251);})[_0x5259('0x1b')](function(_0x923b20){logger[_0x5259('0x17')]('ShowChatQueue',_0x923b20['message'],_0x3186f2);_0x1c0da8(_0xbbf96[_0x5259('0x17')](0x1f4,_0x923b20[_0x5259('0x19')]));});});}; \ No newline at end of file +var _0xb305=['include','map','model','then','GetChatQueue','debug','ShowChatQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ChatQueue','findAll','options','raw','where','attributes','limit'];(function(_0x2fb004,_0x1acfa4){var _0x1f3c68=function(_0x3e2f6d){while(--_0x3e2f6d){_0x2fb004['push'](_0x2fb004['shift']());}};_0x1f3c68(++_0x1acfa4);}(_0xb305,0x103));var _0x5b30=function(_0x242f3a,_0x528b04){_0x242f3a=_0x242f3a-0x0;var _0x24bb79=_0xb305[_0x242f3a];return _0x24bb79;};'use strict';var _=require('lodash');var util=require(_0x5b30('0x0'));var moment=require(_0x5b30('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b30('0x2'));var fs=require('fs');var Redis=require(_0x5b30('0x3'));var db=require(_0x5b30('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b30('0x5'))(_0x5b30('0x6'));var config=require(_0x5b30('0x7'));var jayson=require(_0x5b30('0x8'));var client=jayson[_0x5b30('0x9')]['http']({'port':0x232a});config[_0x5b30('0xa')]=_[_0x5b30('0xb')](config['redis'],{'host':_0x5b30('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b30('0xa')]));require('./chatQueue.socket')[_0x5b30('0xd')](socket);function respondWithRpcPromise(_0x2cc94f,_0x10c180,_0x547688){return new BPromise(function(_0x18d4b7,_0x1cb428){return client[_0x5b30('0xe')](_0x2cc94f,_0x547688)['then'](function(_0x4397f1){logger[_0x5b30('0xf')](_0x5b30('0x10'),_0x10c180,_0x5b30('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10c180,_0x5b30('0x11'),JSON[_0x5b30('0x12')](_0x4397f1));if(_0x4397f1['error']){if(_0x4397f1[_0x5b30('0x13')]['code']===0x1f4){logger[_0x5b30('0x13')]('ChatQueue,\x20%s,\x20%s',_0x10c180,_0x4397f1[_0x5b30('0x13')][_0x5b30('0x14')]);return _0x1cb428(_0x4397f1[_0x5b30('0x13')][_0x5b30('0x14')]);}logger[_0x5b30('0x13')]('ChatQueue,\x20%s,\x20%s',_0x10c180,_0x4397f1[_0x5b30('0x13')][_0x5b30('0x14')]);return _0x18d4b7(_0x4397f1[_0x5b30('0x13')][_0x5b30('0x14')]);}else{logger[_0x5b30('0xf')]('ChatQueue,\x20%s,\x20%s',_0x10c180,_0x5b30('0x11'));_0x18d4b7(_0x4397f1['result'][_0x5b30('0x14')]);}})[_0x5b30('0x15')](function(_0x1250d9){logger[_0x5b30('0x13')](_0x5b30('0x10'),_0x10c180,_0x1250d9);_0x1cb428(_0x1250d9);});});}exports['GetChatQueue']=function(_0x1dc687){var _0x295c99=this;return new Promise(function(_0x6d3bf9,_0x5a0a64){return db[_0x5b30('0x16')][_0x5b30('0x17')]({'raw':_0x1dc687[_0x5b30('0x18')]?_0x1dc687[_0x5b30('0x18')][_0x5b30('0x19')]===undefined?!![]:![]:!![],'where':_0x1dc687[_0x5b30('0x18')]?_0x1dc687['options'][_0x5b30('0x1a')]||null:null,'attributes':_0x1dc687['options']?_0x1dc687[_0x5b30('0x18')][_0x5b30('0x1b')]||null:null,'limit':_0x1dc687['options']?_0x1dc687[_0x5b30('0x18')][_0x5b30('0x1c')]||null:null,'include':_0x1dc687[_0x5b30('0x18')]?_0x1dc687[_0x5b30('0x18')][_0x5b30('0x1d')]?_[_0x5b30('0x1e')](_0x1dc687[_0x5b30('0x18')][_0x5b30('0x1d')],function(_0x3644f9){return{'model':db[_0x3644f9[_0x5b30('0x1f')]],'as':_0x3644f9['as'],'attributes':_0x3644f9['attributes'],'include':_0x3644f9[_0x5b30('0x1d')]?_[_0x5b30('0x1e')](_0x3644f9[_0x5b30('0x1d')],function(_0x27edf3){return{'model':db[_0x27edf3[_0x5b30('0x1f')]],'as':_0x27edf3['as'],'attributes':_0x27edf3[_0x5b30('0x1b')],'include':_0x27edf3[_0x5b30('0x1d')]?_[_0x5b30('0x1e')](_0x27edf3[_0x5b30('0x1d')],function(_0x45f674){return{'model':db[_0x45f674[_0x5b30('0x1f')]],'as':_0x45f674['as'],'attributes':_0x45f674[_0x5b30('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b30('0x20')](function(_0x4abb8b){logger[_0x5b30('0xf')](_0x5b30('0x21'),_0x1dc687);logger[_0x5b30('0x22')]('GetChatQueue',_0x1dc687,JSON[_0x5b30('0x12')](_0x4abb8b));_0x6d3bf9(_0x4abb8b);})['catch'](function(_0x1dd91e){logger[_0x5b30('0x13')]('GetChatQueue',_0x1dd91e[_0x5b30('0x14')],_0x1dc687);_0x5a0a64(_0x295c99['error'](0x1f4,_0x1dd91e['message']));});});};exports[_0x5b30('0x23')]=function(_0xea108f){var _0x244d6d=this;return new Promise(function(_0x592e3a,_0xbf0fc5){return db['ChatQueue']['find']({'raw':_0xea108f['options']?_0xea108f[_0x5b30('0x18')][_0x5b30('0x19')]===undefined?!![]:![]:!![],'where':_0xea108f['options']?_0xea108f[_0x5b30('0x18')]['where']||null:null,'attributes':_0xea108f[_0x5b30('0x18')]?_0xea108f['options'][_0x5b30('0x1b')]||null:null,'include':_0xea108f[_0x5b30('0x18')]?_0xea108f[_0x5b30('0x18')][_0x5b30('0x1d')]?_['map'](_0xea108f[_0x5b30('0x18')][_0x5b30('0x1d')],function(_0x3c469e){return{'model':db[_0x3c469e[_0x5b30('0x1f')]],'as':_0x3c469e['as'],'attributes':_0x3c469e['attributes'],'include':_0x3c469e[_0x5b30('0x1d')]?_[_0x5b30('0x1e')](_0x3c469e[_0x5b30('0x1d')],function(_0x110d83){return{'model':db[_0x110d83[_0x5b30('0x1f')]],'as':_0x110d83['as'],'attributes':_0x110d83[_0x5b30('0x1b')],'include':_0x110d83[_0x5b30('0x1d')]?_[_0x5b30('0x1e')](_0x110d83[_0x5b30('0x1d')],function(_0x5977c9){return{'model':db[_0x5977c9['model']],'as':_0x5977c9['as'],'attributes':_0x5977c9['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b30('0x20')](function(_0x337aec){logger[_0x5b30('0xf')](_0x5b30('0x23'),_0xea108f);logger[_0x5b30('0x22')]('ShowChatQueue',_0xea108f,JSON[_0x5b30('0x12')](_0x337aec));_0x592e3a(_0x337aec);})['catch'](function(_0x3930af){logger[_0x5b30('0x13')]('ShowChatQueue',_0x3930af[_0x5b30('0x14')],_0xea108f);_0xbf0fc5(_0x244d6d[_0x5b30('0x13')](0x1f4,_0x3930af['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 0335f84..3e1a5bc 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4e30231..4041fe8 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 _0x35aa=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','removeAgents'];(function(_0x411863,_0x3ed4dc){var _0x2d28a9=function(_0x246c01){while(--_0x246c01){_0x411863['push'](_0x411863['shift']());}};_0x2d28a9(++_0x3ed4dc);}(_0x35aa,0xa2));var _0xa35a=function(_0x35cf3d,_0x5b755c){_0x35cf3d=_0x35cf3d-0x0;var _0x507252=_0x35aa[_0x35cf3d];return _0x507252;};'use strict';var multer=require(_0xa35a('0x0'));var util=require(_0xa35a('0x1'));var path=require(_0xa35a('0x2'));var timeout=require(_0xa35a('0x3'));var express=require('express');var router=express[_0xa35a('0x4')]();var auth=require(_0xa35a('0x5'));var interaction=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var controller=require(_0xa35a('0x8'));router[_0xa35a('0x9')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xb')]);router[_0xa35a('0x9')]('/describe',auth[_0xa35a('0xa')](),controller[_0xa35a('0xc')]);router[_0xa35a('0x9')](_0xa35a('0xd'),auth['isAuthenticated'](),controller[_0xa35a('0xe')]);router[_0xa35a('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xa35a('0xf')]);router[_0xa35a('0x9')](_0xa35a('0x10'),auth[_0xa35a('0xa')](),controller['getTeams']);router[_0xa35a('0x9')](_0xa35a('0x11'),auth['isAuthenticated'](),controller[_0xa35a('0x12')]);router[_0xa35a('0x13')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0x14')]);router[_0xa35a('0x13')](_0xa35a('0x10'),auth[_0xa35a('0xa')](),controller[_0xa35a('0x15')]);router[_0xa35a('0x13')](_0xa35a('0x11'),auth[_0xa35a('0xa')](),controller['addAgents']);router[_0xa35a('0x16')](_0xa35a('0xd'),auth[_0xa35a('0xa')](),controller[_0xa35a('0x17')]);router[_0xa35a('0x18')](_0xa35a('0xd'),auth[_0xa35a('0xa')](),controller['destroy']);router[_0xa35a('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa35a('0x19')]);router[_0xa35a('0x18')]('/:id/users',auth[_0xa35a('0xa')](),controller[_0xa35a('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xe2b9=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xe2b9,0xfc));var _0x9e2b=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0xe2b9[_0x4c2dfc];return _0xfd728d;};'use strict';var multer=require(_0x9e2b('0x0'));var util=require(_0x9e2b('0x1'));var path=require('path');var timeout=require(_0x9e2b('0x2'));var express=require('express');var router=express[_0x9e2b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9e2b('0x4'));var config=require('../../config/environment');var controller=require('./chatQueue.controller');router[_0x9e2b('0x5')]('/',auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x7')]);router['get'](_0x9e2b('0x8'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x9')]);router[_0x9e2b('0x5')](_0x9e2b('0xa'),auth[_0x9e2b('0x6')](),controller['show']);router[_0x9e2b('0x5')]('/:id/members',auth[_0x9e2b('0x6')](),controller[_0x9e2b('0xb')]);router[_0x9e2b('0x5')](_0x9e2b('0xc'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0xd')]);router[_0x9e2b('0x5')](_0x9e2b('0xe'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0xf')]);router[_0x9e2b('0x10')]('/',auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x11')]);router[_0x9e2b('0x10')](_0x9e2b('0xc'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x12')]);router['post'](_0x9e2b('0xe'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x13')]);router[_0x9e2b('0x14')](_0x9e2b('0xa'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x15')]);router[_0x9e2b('0x16')](_0x9e2b('0xa'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x17')]);router['delete'](_0x9e2b('0xc'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x18')]);router[_0x9e2b('0x16')](_0x9e2b('0xe'),auth[_0x9e2b('0x6')](),controller[_0x9e2b('0x19')]);module[_0x9e2b('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 9d14bc9..2c15941 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 _0x7c75=['sequelize','exports','STRING','DATE','moment'];(function(_0x59dcab,_0x5545d5){var _0x19f249=function(_0x1bba88){while(--_0x1bba88){_0x59dcab['push'](_0x59dcab['shift']());}};_0x19f249(++_0x5545d5);}(_0x7c75,0x1e4));var _0x57c7=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7c75[_0x31e29a];return _0x32d892;};'use strict';var moment=require(_0x57c7('0x0'));var Sequelize=require(_0x57c7('0x1'));module[_0x57c7('0x2')]={'uniqueid':{'type':Sequelize[_0x57c7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x57c7('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x57c7('0x4')]},'exitAt':{'type':Sequelize[_0x57c7('0x4')]},'reason':{'type':Sequelize[_0x57c7('0x3')]}}; \ No newline at end of file +var _0x66d0=['sequelize','exports','STRING','DATE'];(function(_0x133f81,_0x550e62){var _0x2eef30=function(_0x48e9bf){while(--_0x48e9bf){_0x133f81['push'](_0x133f81['shift']());}};_0x2eef30(++_0x550e62);}(_0x66d0,0xfc));var _0x066d=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0x66d0[_0x254d9f];return _0x1eedb9;};'use strict';var moment=require('moment');var Sequelize=require(_0x066d('0x0'));module[_0x066d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x066d('0x2')]},'joinAt':{'type':Sequelize[_0x066d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x066d('0x3')]},'exitAt':{'type':Sequelize[_0x066d('0x3')]},'reason':{'type':Sequelize[_0x066d('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 254d8e0..804b3d5 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 _0x0f79=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','destroy','error','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','catch','params','intersection','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x4c9485,_0x64ea54){var _0x5a3534=function(_0x3de70d){while(--_0x3de70d){_0x4c9485['push'](_0x4c9485['shift']());}};_0x5a3534(++_0x64ea54);}(_0x0f79,0x7c));var _0x90f7=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x0f79[_0x280f4a];return _0x1bb157;};'use strict';var pdf=require(_0x90f7('0x0'));var emlformat=require(_0x90f7('0x1'));var rimraf=require(_0x90f7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90f7('0x3'));var rp=require(_0x90f7('0x4'));var moment=require(_0x90f7('0x5'));var BPromise=require(_0x90f7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x90f7('0x7'));var sox=require(_0x90f7('0x8'));var csv=require(_0x90f7('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x90f7('0xa'));var squel=require(_0x90f7('0xb'));var crypto=require(_0x90f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x90f7('0xd'));var toCsv=require(_0x90f7('0x9'));var querystring=require(_0x90f7('0xe'));var Papa=require('papaparse');var Redis=require(_0x90f7('0xf'));var authService=require(_0x90f7('0x10'));var qs=require(_0x90f7('0x11'));var hardwareService=require(_0x90f7('0x12'));var logger=require(_0x90f7('0x13'))(_0x90f7('0x14'));var utils=require(_0x90f7('0x15'));var config=require(_0x90f7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x362e7b,_0x4be401){_0x4be401=_0x4be401||0xcc;return function(_0x2107d6){if(_0x2107d6){return _0x362e7b[_0x90f7('0x17')](_0x4be401);}return _0x362e7b[_0x90f7('0x18')](_0x4be401)[_0x90f7('0x19')]();};}function respondWithResult(_0x2dcb94,_0x2fc12e){_0x2fc12e=_0x2fc12e||0xc8;return function(_0x54059c){if(_0x54059c){return _0x2dcb94[_0x90f7('0x18')](_0x2fc12e)[_0x90f7('0x1a')](_0x54059c);}};}function respondWithFilteredResult(_0x353827,_0xd29e29){return function(_0x3f69c5){if(_0x3f69c5){var _0x4bc6bb=_0x3f69c5[_0x90f7('0x1b')],_0x2a36b7=_0xd29e29[_0x90f7('0x1c')],_0x33fd79=_0xd29e29['offset']+_0xd29e29[_0x90f7('0x1d')],_0x10d176;if(_0x33fd79>=_0x4bc6bb){_0x33fd79=_0x4bc6bb;_0x10d176=0xc8;}else{_0x10d176=0xce;}_0x353827['status'](_0x10d176);return _0x353827['set']('Content-Range',_0x2a36b7+'-'+_0x33fd79+'/'+_0x4bc6bb)[_0x90f7('0x1a')](_0x3f69c5);}return null;};}function patchUpdates(_0x2c805b){return function(_0x3b426e){try{jsonpatch['apply'](_0x3b426e,_0x2c805b,!![]);}catch(_0x4b5fad){return BPromise[_0x90f7('0x1e')](_0x4b5fad);}return _0x3b426e[_0x90f7('0x1f')]();};}function saveUpdates(_0x3167bd,_0x383dde){return function(_0x250b1c){if(_0x250b1c){return _0x250b1c[_0x90f7('0x20')](_0x3167bd)[_0x90f7('0x21')](function(_0x1a0f42){return _0x1a0f42;});}return null;};}function removeEntity(_0x5e433f,_0x3a8e6b){return function(_0x1f4d46){if(_0x1f4d46){return _0x1f4d46[_0x90f7('0x22')]()[_0x90f7('0x21')](function(){_0x5e433f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca62d,_0x34518e){return function(_0x5a7ee9){if(!_0x5a7ee9){_0x4ca62d[_0x90f7('0x17')](0x194);}return _0x5a7ee9;};}function handleError(_0x1b7712,_0x100330){_0x100330=_0x100330||0x1f4;return function(_0x2416a9){logger[_0x90f7('0x23')](_0x2416a9['stack']);if(_0x2416a9[_0x90f7('0x24')]){delete _0x2416a9[_0x90f7('0x24')];}_0x1b7712[_0x90f7('0x18')](_0x100330)[_0x90f7('0x25')](_0x2416a9);};}exports[_0x90f7('0x26')]=function(_0x209e83,_0x4a91f4){var _0x4cac03={},_0x4144c5={},_0x1b845b={'count':0x0,'rows':[]};var _0x4264a7=db[_0x90f7('0x27')][_0x90f7('0x28')];_0x4144c5[_0x90f7('0x29')]=_[_0x90f7('0x2a')](_0x4264a7);_0x4144c5[_0x90f7('0x2b')]=_['keys'](_0x209e83[_0x90f7('0x2b')]);_0x4144c5[_0x90f7('0x2c')]=_['intersection'](_0x4144c5[_0x90f7('0x29')],_0x4144c5[_0x90f7('0x2b')]);_0x4cac03[_0x90f7('0x2d')]=_['intersection'](_0x4144c5[_0x90f7('0x29')],qs[_0x90f7('0x2e')](_0x209e83[_0x90f7('0x2b')][_0x90f7('0x2e')]));_0x4cac03[_0x90f7('0x2d')]=_0x4cac03[_0x90f7('0x2d')][_0x90f7('0x2f')]?_0x4cac03[_0x90f7('0x2d')]:_0x4144c5[_0x90f7('0x29')];if(!_0x209e83[_0x90f7('0x2b')][_0x90f7('0x30')]('nolimit')){_0x4cac03[_0x90f7('0x1d')]=qs[_0x90f7('0x1d')](_0x209e83['query'][_0x90f7('0x1d')]);_0x4cac03[_0x90f7('0x1c')]=qs[_0x90f7('0x1c')](_0x209e83[_0x90f7('0x2b')][_0x90f7('0x1c')]);}_0x4cac03[_0x90f7('0x31')]=qs[_0x90f7('0x32')](_0x209e83[_0x90f7('0x2b')]['sort']);_0x4cac03['where']=qs[_0x90f7('0x2c')](_[_0x90f7('0x33')](_0x209e83['query'],_0x4144c5['filters']));if(_0x209e83[_0x90f7('0x2b')][_0x90f7('0x34')]){_0x4cac03[_0x90f7('0x35')]=_[_0x90f7('0x36')](_0x4cac03[_0x90f7('0x35')],{'$or':_[_0x90f7('0x37')](_0x4264a7,function(_0x523c41){if(_0x523c41[_0x90f7('0x38')]['key']!==_0x90f7('0x39')){var _0x5d6d45={};_0x5d6d45[_0x523c41[_0x90f7('0x3a')]]={'$like':'%'+_0x209e83[_0x90f7('0x2b')][_0x90f7('0x34')]+'%'};return _0x5d6d45;}})});}_0x4cac03=_[_0x90f7('0x36')]({},_0x4cac03,_0x209e83[_0x90f7('0x3b')]);var _0x256639={'where':_0x4cac03[_0x90f7('0x35')]};return db[_0x90f7('0x27')][_0x90f7('0x1b')](_0x256639)[_0x90f7('0x21')](function(_0x20dfe3){_0x1b845b[_0x90f7('0x1b')]=_0x20dfe3;if(_0x209e83[_0x90f7('0x2b')][_0x90f7('0x3c')]){_0x4cac03[_0x90f7('0x3d')]=[{'all':!![]}];}return db[_0x90f7('0x27')][_0x90f7('0x3e')](_0x4cac03);})[_0x90f7('0x21')](function(_0x3c8b52){_0x1b845b['rows']=_0x3c8b52;return _0x1b845b;})[_0x90f7('0x21')](respondWithFilteredResult(_0x4a91f4,_0x4cac03))[_0x90f7('0x3f')](handleError(_0x4a91f4,null));};exports['show']=function(_0x31f35d,_0x56068c){var _0x2bf3a2={'raw':!![],'where':{'id':_0x31f35d[_0x90f7('0x40')]['id']}},_0x1c754e={};_0x1c754e[_0x90f7('0x29')]=_['keys'](db[_0x90f7('0x27')][_0x90f7('0x28')]);_0x1c754e[_0x90f7('0x2b')]=_[_0x90f7('0x2a')](_0x31f35d[_0x90f7('0x2b')]);_0x1c754e['filters']=_[_0x90f7('0x41')](_0x1c754e[_0x90f7('0x29')],_0x1c754e[_0x90f7('0x2b')]);_0x2bf3a2[_0x90f7('0x2d')]=_[_0x90f7('0x41')](_0x1c754e['model'],qs[_0x90f7('0x2e')](_0x31f35d[_0x90f7('0x2b')]['fields']));_0x2bf3a2[_0x90f7('0x2d')]=_0x2bf3a2[_0x90f7('0x2d')]['length']?_0x2bf3a2['attributes']:_0x1c754e['model'];if(_0x31f35d[_0x90f7('0x2b')][_0x90f7('0x3c')]){_0x2bf3a2[_0x90f7('0x3d')]=[{'all':!![]}];}_0x2bf3a2=_[_0x90f7('0x36')]({},_0x2bf3a2,_0x31f35d[_0x90f7('0x3b')]);return db[_0x90f7('0x27')][_0x90f7('0x42')](_0x2bf3a2)[_0x90f7('0x21')](handleEntityNotFound(_0x56068c,null))[_0x90f7('0x21')](respondWithResult(_0x56068c,null))[_0x90f7('0x3f')](handleError(_0x56068c,null));};exports[_0x90f7('0x43')]=function(_0x2ee9b0,_0xb2233){return db['ChatQueueReport'][_0x90f7('0x43')](_0x2ee9b0[_0x90f7('0x44')],{})[_0x90f7('0x21')](respondWithResult(_0xb2233,0xc9))[_0x90f7('0x3f')](handleError(_0xb2233,null));};exports['update']=function(_0x4c52d5,_0x55ab91){if(_0x4c52d5['body']['id']){delete _0x4c52d5['body']['id'];}return db[_0x90f7('0x27')][_0x90f7('0x42')]({'where':{'id':_0x4c52d5[_0x90f7('0x40')]['id']}})['then'](handleEntityNotFound(_0x55ab91,null))[_0x90f7('0x21')](saveUpdates(_0x4c52d5[_0x90f7('0x44')],null))[_0x90f7('0x21')](respondWithResult(_0x55ab91,null))[_0x90f7('0x3f')](handleError(_0x55ab91,null));};exports['destroy']=function(_0x18636f,_0x27cb34){return db['ChatQueueReport']['find']({'where':{'id':_0x18636f['params']['id']}})[_0x90f7('0x21')](handleEntityNotFound(_0x27cb34,null))['then'](removeEntity(_0x27cb34,null))[_0x90f7('0x3f')](handleError(_0x27cb34,null));};exports['describe']=function(_0x41d212,_0x18b19d){return db['ChatQueueReport']['describe']()[_0x90f7('0x21')](respondWithResult(_0x18b19d,null))[_0x90f7('0x3f')](handleError(_0x18b19d,null));}; \ No newline at end of file +var _0x1b00=['Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','include','catch','show','params','includeAll','body','find','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x1b00,0x70));var _0x01b0=function(_0x36ba91,_0x508c78){_0x36ba91=_0x36ba91-0x0;var _0x5586a8=_0x1b00[_0x36ba91];return _0x5586a8;};'use strict';var pdf=require(_0x01b0('0x0'));var emlformat=require(_0x01b0('0x1'));var rimraf=require(_0x01b0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01b0('0x3'));var moment=require(_0x01b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01b0('0x5'));var util=require('util');var path=require(_0x01b0('0x6'));var sox=require(_0x01b0('0x7'));var csv=require(_0x01b0('0x8'));var ejs=require(_0x01b0('0x9'));var fs=require('fs');var _=require(_0x01b0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x01b0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x01b0('0xc'));var Papa=require('papaparse');var Redis=require(_0x01b0('0xd'));var authService=require(_0x01b0('0xe'));var qs=require(_0x01b0('0xf'));var hardwareService=require(_0x01b0('0x10'));var logger=require(_0x01b0('0x11'))(_0x01b0('0x12'));var utils=require(_0x01b0('0x13'));var config=require(_0x01b0('0x14'));var db=require(_0x01b0('0x15'))['db'];function respondWithStatusCode(_0x749fd8,_0x13bd0e){_0x13bd0e=_0x13bd0e||0xcc;return function(_0x892a69){if(_0x892a69){return _0x749fd8['sendStatus'](_0x13bd0e);}return _0x749fd8[_0x01b0('0x16')](_0x13bd0e)[_0x01b0('0x17')]();};}function respondWithResult(_0x479df6,_0x55abc8){_0x55abc8=_0x55abc8||0xc8;return function(_0x201257){if(_0x201257){return _0x479df6[_0x01b0('0x16')](_0x55abc8)[_0x01b0('0x18')](_0x201257);}};}function respondWithFilteredResult(_0x13cc21,_0xbadb15){return function(_0x33bdd9){if(_0x33bdd9){var _0x1f9a71=_0x33bdd9[_0x01b0('0x19')],_0x336509=_0xbadb15[_0x01b0('0x1a')],_0x30fbd3=_0xbadb15[_0x01b0('0x1a')]+_0xbadb15[_0x01b0('0x1b')],_0x4b8c0c;if(_0x30fbd3>=_0x1f9a71){_0x30fbd3=_0x1f9a71;_0x4b8c0c=0xc8;}else{_0x4b8c0c=0xce;}_0x13cc21[_0x01b0('0x16')](_0x4b8c0c);return _0x13cc21['set'](_0x01b0('0x1c'),_0x336509+'-'+_0x30fbd3+'/'+_0x1f9a71)[_0x01b0('0x18')](_0x33bdd9);}return null;};}function patchUpdates(_0x21d26c){return function(_0x1a0f6a){try{jsonpatch[_0x01b0('0x1d')](_0x1a0f6a,_0x21d26c,!![]);}catch(_0x462fd4){return BPromise[_0x01b0('0x1e')](_0x462fd4);}return _0x1a0f6a[_0x01b0('0x1f')]();};}function saveUpdates(_0xaebfe3,_0x515ed9){return function(_0x47e58c){if(_0x47e58c){return _0x47e58c[_0x01b0('0x20')](_0xaebfe3)[_0x01b0('0x21')](function(_0x41320b){return _0x41320b;});}return null;};}function removeEntity(_0x4ad41e,_0x47468e){return function(_0x157c94){if(_0x157c94){return _0x157c94['destroy']()[_0x01b0('0x21')](function(){_0x4ad41e[_0x01b0('0x16')](0xcc)[_0x01b0('0x17')]();});}};}function handleEntityNotFound(_0x18326c,_0x410131){return function(_0x851089){if(!_0x851089){_0x18326c[_0x01b0('0x22')](0x194);}return _0x851089;};}function handleError(_0x5de64f,_0x5862c1){_0x5862c1=_0x5862c1||0x1f4;return function(_0x379399){logger[_0x01b0('0x23')](_0x379399[_0x01b0('0x24')]);if(_0x379399[_0x01b0('0x25')]){delete _0x379399[_0x01b0('0x25')];}_0x5de64f[_0x01b0('0x16')](_0x5862c1)[_0x01b0('0x26')](_0x379399);};}exports[_0x01b0('0x27')]=function(_0x2c00aa,_0x36f388){var _0x32bfcd={},_0x4d7db5={},_0x6e142b={'count':0x0,'rows':[]};var _0x291ca5=db[_0x01b0('0x28')][_0x01b0('0x29')];_0x4d7db5[_0x01b0('0x2a')]=_['keys'](_0x291ca5);_0x4d7db5[_0x01b0('0x2b')]=_[_0x01b0('0x2c')](_0x2c00aa['query']);_0x4d7db5['filters']=_[_0x01b0('0x2d')](_0x4d7db5[_0x01b0('0x2a')],_0x4d7db5[_0x01b0('0x2b')]);_0x32bfcd[_0x01b0('0x2e')]=_[_0x01b0('0x2d')](_0x4d7db5[_0x01b0('0x2a')],qs[_0x01b0('0x2f')](_0x2c00aa[_0x01b0('0x2b')]['fields']));_0x32bfcd[_0x01b0('0x2e')]=_0x32bfcd['attributes'][_0x01b0('0x30')]?_0x32bfcd['attributes']:_0x4d7db5['model'];if(!_0x2c00aa[_0x01b0('0x2b')]['hasOwnProperty'](_0x01b0('0x31'))){_0x32bfcd['limit']=qs[_0x01b0('0x1b')](_0x2c00aa[_0x01b0('0x2b')][_0x01b0('0x1b')]);_0x32bfcd[_0x01b0('0x1a')]=qs[_0x01b0('0x1a')](_0x2c00aa[_0x01b0('0x2b')]['offset']);}_0x32bfcd[_0x01b0('0x32')]=qs[_0x01b0('0x33')](_0x2c00aa[_0x01b0('0x2b')][_0x01b0('0x33')]);_0x32bfcd[_0x01b0('0x34')]=qs[_0x01b0('0x35')](_['pick'](_0x2c00aa[_0x01b0('0x2b')],_0x4d7db5[_0x01b0('0x35')]));if(_0x2c00aa[_0x01b0('0x2b')][_0x01b0('0x36')]){_0x32bfcd['where']=_[_0x01b0('0x37')](_0x32bfcd[_0x01b0('0x34')],{'$or':_[_0x01b0('0x38')](_0x291ca5,function(_0x233891){if(_0x233891[_0x01b0('0x39')][_0x01b0('0x3a')]!==_0x01b0('0x3b')){var _0x3d0420={};_0x3d0420[_0x233891[_0x01b0('0x3c')]]={'$like':'%'+_0x2c00aa[_0x01b0('0x2b')][_0x01b0('0x36')]+'%'};return _0x3d0420;}})});}_0x32bfcd=_[_0x01b0('0x37')]({},_0x32bfcd,_0x2c00aa['options']);var _0x43c4d2={'where':_0x32bfcd['where']};return db[_0x01b0('0x28')][_0x01b0('0x19')](_0x43c4d2)['then'](function(_0x183034){_0x6e142b[_0x01b0('0x19')]=_0x183034;if(_0x2c00aa[_0x01b0('0x2b')]['includeAll']){_0x32bfcd[_0x01b0('0x3d')]=[{'all':!![]}];}return db[_0x01b0('0x28')]['findAll'](_0x32bfcd);})[_0x01b0('0x21')](function(_0x3a3aef){_0x6e142b['rows']=_0x3a3aef;return _0x6e142b;})[_0x01b0('0x21')](respondWithFilteredResult(_0x36f388,_0x32bfcd))[_0x01b0('0x3e')](handleError(_0x36f388,null));};exports[_0x01b0('0x3f')]=function(_0x458526,_0x467ffc){var _0x5e490f={'raw':!![],'where':{'id':_0x458526[_0x01b0('0x40')]['id']}},_0x2e0f1e={};_0x2e0f1e['model']=_['keys'](db[_0x01b0('0x28')][_0x01b0('0x29')]);_0x2e0f1e[_0x01b0('0x2b')]=_['keys'](_0x458526[_0x01b0('0x2b')]);_0x2e0f1e[_0x01b0('0x35')]=_[_0x01b0('0x2d')](_0x2e0f1e[_0x01b0('0x2a')],_0x2e0f1e[_0x01b0('0x2b')]);_0x5e490f[_0x01b0('0x2e')]=_['intersection'](_0x2e0f1e['model'],qs[_0x01b0('0x2f')](_0x458526[_0x01b0('0x2b')]['fields']));_0x5e490f[_0x01b0('0x2e')]=_0x5e490f[_0x01b0('0x2e')]['length']?_0x5e490f[_0x01b0('0x2e')]:_0x2e0f1e[_0x01b0('0x2a')];if(_0x458526[_0x01b0('0x2b')][_0x01b0('0x41')]){_0x5e490f[_0x01b0('0x3d')]=[{'all':!![]}];}_0x5e490f=_[_0x01b0('0x37')]({},_0x5e490f,_0x458526['options']);return db[_0x01b0('0x28')]['find'](_0x5e490f)[_0x01b0('0x21')](handleEntityNotFound(_0x467ffc,null))[_0x01b0('0x21')](respondWithResult(_0x467ffc,null))[_0x01b0('0x3e')](handleError(_0x467ffc,null));};exports['create']=function(_0x33cd37,_0x32678c){return db[_0x01b0('0x28')]['create'](_0x33cd37[_0x01b0('0x42')],{})['then'](respondWithResult(_0x32678c,0xc9))[_0x01b0('0x3e')](handleError(_0x32678c,null));};exports[_0x01b0('0x20')]=function(_0x1e55bc,_0x4e8aa8){if(_0x1e55bc[_0x01b0('0x42')]['id']){delete _0x1e55bc[_0x01b0('0x42')]['id'];}return db['ChatQueueReport'][_0x01b0('0x43')]({'where':{'id':_0x1e55bc[_0x01b0('0x40')]['id']}})[_0x01b0('0x21')](handleEntityNotFound(_0x4e8aa8,null))[_0x01b0('0x21')](saveUpdates(_0x1e55bc[_0x01b0('0x42')],null))['then'](respondWithResult(_0x4e8aa8,null))[_0x01b0('0x3e')](handleError(_0x4e8aa8,null));};exports[_0x01b0('0x44')]=function(_0x25748b,_0x42a55a){return db['ChatQueueReport'][_0x01b0('0x43')]({'where':{'id':_0x25748b[_0x01b0('0x40')]['id']}})['then'](handleEntityNotFound(_0x42a55a,null))[_0x01b0('0x21')](removeEntity(_0x42a55a,null))[_0x01b0('0x3e')](handleError(_0x42a55a,null));};exports[_0x01b0('0x45')]=function(_0x5d2260,_0x3ddd09){return db[_0x01b0('0x28')]['describe']()[_0x01b0('0x21')](respondWithResult(_0x3ddd09,null))[_0x01b0('0x3e')](handleError(_0x3ddd09,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index dbd6e61..32890e5 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 _0xb103=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatQueueReport'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb103,0xd9));var _0x3b10=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0xb103[_0x2f71f6];return _0x2b23ea;};'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('path');var rimraf=require(_0x3b10('0x7'));var config=require(_0x3b10('0x8'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x25bc1c,_0x2f6061){return _0x25bc1c[_0x3b10('0x9')](_0x3b10('0xa'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x3b10('0xb'),'fields':[_0x3b10('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63b9=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x341a90,_0x3c404a){var _0x59a06e=function(_0xe58561){while(--_0xe58561){_0x341a90['push'](_0x341a90['shift']());}};_0x59a06e(++_0x3c404a);}(_0x63b9,0x18c));var _0x963b=function(_0x59183d,_0x59da02){_0x59183d=_0x59183d-0x0;var _0x34a929=_0x63b9[_0x59183d];return _0x34a929;};'use strict';var _=require(_0x963b('0x0'));var util=require(_0x963b('0x1'));var logger=require(_0x963b('0x2'))(_0x963b('0x3'));var moment=require(_0x963b('0x4'));var BPromise=require('bluebird');var rp=require(_0x963b('0x5'));var fs=require('fs');var path=require(_0x963b('0x6'));var rimraf=require('rimraf');var config=require(_0x963b('0x7'));var attributes=require(_0x963b('0x8'));module[_0x963b('0x9')]=function(_0x50d5cc,_0x494d5e){return _0x50d5cc[_0x963b('0xa')](_0x963b('0xb'),attributes,{'tableName':_0x963b('0xc'),'paranoid':![],'indexes':[{'name':_0x963b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2e8de1a..313185e 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 _0x7ba3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','info','update','attributes','limit','then','UpdateChatQueueReport','util','moment'];(function(_0x18d262,_0x9b37b){var _0x58287d=function(_0x2030fc){while(--_0x2030fc){_0x18d262['push'](_0x18d262['shift']());}};_0x58287d(++_0x9b37b);}(_0x7ba3,0x115));var _0x37ba=function(_0x259a42,_0x2b4483){_0x259a42=_0x259a42-0x0;var _0x548d68=_0x7ba3[_0x259a42];return _0x548d68;};'use strict';var _=require('lodash');var util=require(_0x37ba('0x0'));var moment=require(_0x37ba('0x1'));var BPromise=require(_0x37ba('0x2'));var rs=require(_0x37ba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37ba('0x4'))['db'];var utils=require(_0x37ba('0x5'));var logger=require(_0x37ba('0x6'))('rpc');var config=require(_0x37ba('0x7'));var jayson=require(_0x37ba('0x8'));var client=jayson[_0x37ba('0x9')][_0x37ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3749fb,_0x1b2b8e,_0x34ff9e){return new BPromise(function(_0x243315,_0x393f07){return client[_0x37ba('0xb')](_0x3749fb,_0x34ff9e)['then'](function(_0x7fb12a){logger['info'](_0x37ba('0xc'),_0x1b2b8e,_0x37ba('0xd'));logger[_0x37ba('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1b2b8e,_0x37ba('0xd'),JSON[_0x37ba('0xf')](_0x7fb12a));if(_0x7fb12a[_0x37ba('0x10')]){if(_0x7fb12a[_0x37ba('0x10')]['code']===0x1f4){logger[_0x37ba('0x10')](_0x37ba('0xc'),_0x1b2b8e,_0x7fb12a[_0x37ba('0x10')][_0x37ba('0x11')]);return _0x393f07(_0x7fb12a[_0x37ba('0x10')]['message']);}logger[_0x37ba('0x10')](_0x37ba('0xc'),_0x1b2b8e,_0x7fb12a[_0x37ba('0x10')][_0x37ba('0x11')]);return _0x243315(_0x7fb12a[_0x37ba('0x10')][_0x37ba('0x11')]);}else{logger['info'](_0x37ba('0xc'),_0x1b2b8e,'request\x20sent');_0x243315(_0x7fb12a[_0x37ba('0x12')]['message']);}})[_0x37ba('0x13')](function(_0x3b7b85){logger['error'](_0x37ba('0xc'),_0x1b2b8e,_0x3b7b85);_0x393f07(_0x3b7b85);});});}exports[_0x37ba('0x14')]=function(_0x394580){var _0x4fcf18=this;return new Promise(function(_0x132521,_0x1004ff){return db[_0x37ba('0x15')]['create'](_0x394580[_0x37ba('0x16')],{'raw':_0x394580[_0x37ba('0x17')]?_0x394580[_0x37ba('0x17')][_0x37ba('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x452e4f){logger[_0x37ba('0x19')](_0x37ba('0x14'),_0x394580);logger['debug'](_0x37ba('0x14'),_0x394580,JSON['stringify'](_0x452e4f));_0x132521(_0x452e4f);})['catch'](function(_0xe1389d){logger[_0x37ba('0x10')]('CreateChatQueueReport',_0xe1389d[_0x37ba('0x11')],_0x394580);_0x1004ff(_0x4fcf18[_0x37ba('0x10')](0x1f4,_0xe1389d[_0x37ba('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x40a711){var _0x5bc81f=this;return new Promise(function(_0x370cf9,_0x4f13ab){return db['ChatQueueReport'][_0x37ba('0x1a')](_0x40a711[_0x37ba('0x16')],{'raw':_0x40a711['options']?_0x40a711[_0x37ba('0x17')][_0x37ba('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40a711[_0x37ba('0x17')]?_0x40a711[_0x37ba('0x17')]['where']||null:null,'attributes':_0x40a711[_0x37ba('0x17')]?_0x40a711['options'][_0x37ba('0x1b')]||null:null,'limit':_0x40a711[_0x37ba('0x17')]?_0x40a711[_0x37ba('0x17')][_0x37ba('0x1c')]||null:null})[_0x37ba('0x1d')](function(_0x2fd8f9){logger['info'](_0x37ba('0x1e'),_0x40a711);logger['debug'](_0x37ba('0x1e'),_0x40a711,JSON[_0x37ba('0xf')](_0x2fd8f9));_0x370cf9(_0x2fd8f9);})[_0x37ba('0x13')](function(_0x4010f4){logger[_0x37ba('0x10')]('UpdateChatQueueReport',_0x4010f4[_0x37ba('0x11')],_0x40a711);_0x4f13ab(_0x5bc81f[_0x37ba('0x10')](0x1f4,_0x4010f4[_0x37ba('0x11')]));});});}; \ No newline at end of file +var _0x1eb7=['ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','catch','UpdateChatQueueReport','update','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1eb7,0xa9));var _0x71eb=function(_0x497cd9,_0x4496e7){_0x497cd9=_0x497cd9-0x0;var _0xfb8bfe=_0x1eb7[_0x497cd9];return _0xfb8bfe;};'use strict';var _=require(_0x71eb('0x0'));var util=require(_0x71eb('0x1'));var moment=require('moment');var BPromise=require(_0x71eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71eb('0x3'));var db=require(_0x71eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x71eb('0x5'))(_0x71eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x71eb('0x7'));var client=jayson[_0x71eb('0x8')][_0x71eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1418,_0x3da029,_0x2cd7bd){return new BPromise(function(_0x5dfaba,_0x111742){return client[_0x71eb('0xa')](_0x4d1418,_0x2cd7bd)['then'](function(_0x16fb1a){logger[_0x71eb('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3da029,_0x71eb('0xc'));logger[_0x71eb('0xd')](_0x71eb('0xe'),_0x3da029,_0x71eb('0xc'),JSON[_0x71eb('0xf')](_0x16fb1a));if(_0x16fb1a[_0x71eb('0x10')]){if(_0x16fb1a[_0x71eb('0x10')]['code']===0x1f4){logger[_0x71eb('0x10')](_0x71eb('0x11'),_0x3da029,_0x16fb1a[_0x71eb('0x10')][_0x71eb('0x12')]);return _0x111742(_0x16fb1a[_0x71eb('0x10')][_0x71eb('0x12')]);}logger[_0x71eb('0x10')](_0x71eb('0x11'),_0x3da029,_0x16fb1a[_0x71eb('0x10')][_0x71eb('0x12')]);return _0x5dfaba(_0x16fb1a[_0x71eb('0x10')][_0x71eb('0x12')]);}else{logger[_0x71eb('0xb')](_0x71eb('0x11'),_0x3da029,_0x71eb('0xc'));_0x5dfaba(_0x16fb1a['result'][_0x71eb('0x12')]);}})['catch'](function(_0x5568fb){logger[_0x71eb('0x10')](_0x71eb('0x11'),_0x3da029,_0x5568fb);_0x111742(_0x5568fb);});});}exports[_0x71eb('0x13')]=function(_0x1a3106){var _0x196ccb=this;return new Promise(function(_0x459a3f,_0x222fad){return db[_0x71eb('0x14')][_0x71eb('0x15')](_0x1a3106[_0x71eb('0x16')],{'raw':_0x1a3106[_0x71eb('0x17')]?_0x1a3106[_0x71eb('0x17')][_0x71eb('0x18')]===undefined?!![]:![]:!![]})[_0x71eb('0x19')](function(_0x411fb3){logger['info'](_0x71eb('0x13'),_0x1a3106);logger[_0x71eb('0xd')]('CreateChatQueueReport',_0x1a3106,JSON[_0x71eb('0xf')](_0x411fb3));_0x459a3f(_0x411fb3);})[_0x71eb('0x1a')](function(_0x179860){logger[_0x71eb('0x10')](_0x71eb('0x13'),_0x179860[_0x71eb('0x12')],_0x1a3106);_0x222fad(_0x196ccb[_0x71eb('0x10')](0x1f4,_0x179860[_0x71eb('0x12')]));});});};exports[_0x71eb('0x1b')]=function(_0x2e2a0b){var _0x4b13e7=this;return new Promise(function(_0xe618af,_0x54fbc4){return db[_0x71eb('0x14')][_0x71eb('0x1c')](_0x2e2a0b[_0x71eb('0x16')],{'raw':_0x2e2a0b[_0x71eb('0x17')]?_0x2e2a0b[_0x71eb('0x17')][_0x71eb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e2a0b[_0x71eb('0x17')]?_0x2e2a0b[_0x71eb('0x17')]['where']||null:null,'attributes':_0x2e2a0b['options']?_0x2e2a0b[_0x71eb('0x17')][_0x71eb('0x1d')]||null:null,'limit':_0x2e2a0b[_0x71eb('0x17')]?_0x2e2a0b[_0x71eb('0x17')][_0x71eb('0x1e')]||null:null})[_0x71eb('0x19')](function(_0x1313be){logger[_0x71eb('0xb')]('UpdateChatQueueReport',_0x2e2a0b);logger[_0x71eb('0xd')](_0x71eb('0x1b'),_0x2e2a0b,JSON[_0x71eb('0xf')](_0x1313be));_0xe618af(_0x1313be);})[_0x71eb('0x1a')](function(_0x289fa7){logger[_0x71eb('0x10')](_0x71eb('0x1b'),_0x289fa7[_0x71eb('0x12')],_0x2e2a0b);_0x54fbc4(_0x4b13e7[_0x71eb('0x10')](0x1f4,_0x289fa7[_0x71eb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index d7b9a86..fbaa74f 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 _0x3a8f=['/:id','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0x3a8f,0xea));var _0xf3a8=function(_0x1d4a0c,_0x1a7f9b){_0x1d4a0c=_0x1d4a0c-0x0;var _0x50b26e=_0x3a8f[_0x1d4a0c];return _0x50b26e;};'use strict';var multer=require(_0xf3a8('0x0'));var util=require('util');var path=require(_0xf3a8('0x1'));var timeout=require(_0xf3a8('0x2'));var express=require(_0xf3a8('0x3'));var router=express[_0xf3a8('0x4')]();var auth=require(_0xf3a8('0x5'));var interaction=require(_0xf3a8('0x6'));var config=require(_0xf3a8('0x7'));var controller=require('./chatQueueReport.controller');router[_0xf3a8('0x8')]('/',auth[_0xf3a8('0x9')](),controller[_0xf3a8('0xa')]);router[_0xf3a8('0x8')](_0xf3a8('0xb'),auth['isAuthenticated'](),controller[_0xf3a8('0xc')]);router[_0xf3a8('0x8')](_0xf3a8('0xd'),auth[_0xf3a8('0x9')](),controller['show']);router[_0xf3a8('0xe')]('/',auth['isAuthenticated'](),controller[_0xf3a8('0xf')]);router[_0xf3a8('0x10')](_0xf3a8('0xd'),auth[_0xf3a8('0x9')](),controller['update']);router['delete'](_0xf3a8('0xd'),auth[_0xf3a8('0x9')](),controller[_0xf3a8('0x11')]);module[_0xf3a8('0x12')]=router; \ No newline at end of file +var _0xc078=['get','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','isAuthenticated','/describe'];(function(_0x3169e3,_0x81a855){var _0x3f0d48=function(_0x29fd00){while(--_0x29fd00){_0x3169e3['push'](_0x3169e3['shift']());}};_0x3f0d48(++_0x81a855);}(_0xc078,0x86));var _0x8c07=function(_0x1178eb,_0x2612ef){_0x1178eb=_0x1178eb-0x0;var _0x338576=_0xc078[_0x1178eb];return _0x338576;};'use strict';var multer=require(_0x8c07('0x0'));var util=require(_0x8c07('0x1'));var path=require(_0x8c07('0x2'));var timeout=require(_0x8c07('0x3'));var express=require(_0x8c07('0x4'));var router=express[_0x8c07('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c07('0x6'));var controller=require(_0x8c07('0x7'));router['get']('/',auth[_0x8c07('0x8')](),controller['index']);router['get'](_0x8c07('0x9'),auth[_0x8c07('0x8')](),controller['describe']);router[_0x8c07('0xa')](_0x8c07('0xb'),auth[_0x8c07('0x8')](),controller[_0x8c07('0xc')]);router[_0x8c07('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c07('0xe')](_0x8c07('0xb'),auth['isAuthenticated'](),controller[_0x8c07('0xf')]);router[_0x8c07('0x10')](_0x8c07('0xb'),auth[_0x8c07('0x8')](),controller['destroy']);module[_0x8c07('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e0c8654..0775038 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 _0x5991=['account','agent','queue','DATE','NOW','moment','exports','STRING','ENUM'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x5991,0x1eb));var _0x1599=function(_0x206a0d,_0x5e70d6){_0x206a0d=_0x206a0d-0x0;var _0x1a38d8=_0x5991[_0x206a0d];return _0x1a38d8;};'use strict';var moment=require(_0x1599('0x0'));var Sequelize=require('sequelize');module[_0x1599('0x1')]={'uniqueid':{'type':Sequelize[_0x1599('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1599('0x3')](_0x1599('0x4'),_0x1599('0x5'),'queue'),'allowNull':![],'defaultValue':_0x1599('0x6')},'transferredAt':{'type':Sequelize[_0x1599('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x1599('0x8')]}}; \ No newline at end of file +var _0xdfbf=['ENUM','agent','queue','NOW','moment','exports'];(function(_0x130f47,_0x1a011f){var _0x2d5195=function(_0x20442c){while(--_0x20442c){_0x130f47['push'](_0x130f47['shift']());}};_0x2d5195(++_0x1a011f);}(_0xdfbf,0x70));var _0xfdfb=function(_0x472fc6,_0x4a54e9){_0x472fc6=_0x472fc6-0x0;var _0x80f703=_0xdfbf[_0x472fc6];return _0x80f703;};'use strict';var moment=require(_0xfdfb('0x0'));var Sequelize=require('sequelize');module[_0xfdfb('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfdfb('0x2')]('account',_0xfdfb('0x3'),_0xfdfb('0x4')),'allowNull':![],'defaultValue':_0xfdfb('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xfdfb('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 825e963..04c4d4c 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 _0x3e76=['ChatTransferReport','findAll','rows','catch','show','params','length','find','create','update','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','reject','then','error','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include'];(function(_0x34c825,_0x44cad4){var _0x2fde13=function(_0x5ba245){while(--_0x5ba245){_0x34c825['push'](_0x34c825['shift']());}};_0x2fde13(++_0x44cad4);}(_0x3e76,0x1a5));var _0x63e7=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x3e76[_0x3a9661];return _0x5bb119;};'use strict';var pdf=require(_0x63e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x63e7('0x1'));var zipdir=require(_0x63e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63e7('0x3'));var moment=require(_0x63e7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x63e7('0x5'));var sox=require('sox');var csv=require(_0x63e7('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x63e7('0x7'));var squel=require(_0x63e7('0x8'));var crypto=require(_0x63e7('0x9'));var jsforce=require(_0x63e7('0xa'));var deskjs=require(_0x63e7('0xb'));var toCsv=require(_0x63e7('0x6'));var querystring=require(_0x63e7('0xc'));var Papa=require(_0x63e7('0xd'));var Redis=require(_0x63e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x63e7('0xf'));var hardwareService=require(_0x63e7('0x10'));var logger=require(_0x63e7('0x11'))(_0x63e7('0x12'));var utils=require(_0x63e7('0x13'));var config=require('../../config/environment');var db=require(_0x63e7('0x14'))['db'];function respondWithStatusCode(_0x1976d5,_0x60183f){_0x60183f=_0x60183f||0xcc;return function(_0x2141e9){if(_0x2141e9){return _0x1976d5[_0x63e7('0x15')](_0x60183f);}return _0x1976d5['status'](_0x60183f)[_0x63e7('0x16')]();};}function respondWithResult(_0x46b849,_0x311e2f){_0x311e2f=_0x311e2f||0xc8;return function(_0x28c22c){if(_0x28c22c){return _0x46b849[_0x63e7('0x17')](_0x311e2f)[_0x63e7('0x18')](_0x28c22c);}};}function respondWithFilteredResult(_0x4d6ebe,_0xbe5cef){return function(_0x1b0556){if(_0x1b0556){var _0x22f65b=_0x1b0556[_0x63e7('0x19')],_0x39f5b8=_0xbe5cef[_0x63e7('0x1a')],_0x39232e=_0xbe5cef[_0x63e7('0x1a')]+_0xbe5cef['limit'],_0x40e9b8;if(_0x39232e>=_0x22f65b){_0x39232e=_0x22f65b;_0x40e9b8=0xc8;}else{_0x40e9b8=0xce;}_0x4d6ebe['status'](_0x40e9b8);return _0x4d6ebe[_0x63e7('0x1b')]('Content-Range',_0x39f5b8+'-'+_0x39232e+'/'+_0x22f65b)['json'](_0x1b0556);}return null;};}function patchUpdates(_0x29e6b0){return function(_0x3b320f){try{jsonpatch[_0x63e7('0x1c')](_0x3b320f,_0x29e6b0,!![]);}catch(_0x43bca8){return BPromise[_0x63e7('0x1d')](_0x43bca8);}return _0x3b320f['save']();};}function saveUpdates(_0x2d82de,_0x5c9426){return function(_0x3fcf1d){if(_0x3fcf1d){return _0x3fcf1d['update'](_0x2d82de)[_0x63e7('0x1e')](function(_0x28c5a3){return _0x28c5a3;});}return null;};}function removeEntity(_0x3fee02,_0x51bdb1){return function(_0x2ab385){if(_0x2ab385){return _0x2ab385['destroy']()[_0x63e7('0x1e')](function(){_0x3fee02[_0x63e7('0x17')](0xcc)[_0x63e7('0x16')]();});}};}function handleEntityNotFound(_0x21d739,_0x1929f8){return function(_0x333876){if(!_0x333876){_0x21d739[_0x63e7('0x15')](0x194);}return _0x333876;};}function handleError(_0xd4f7e,_0x1bd370){_0x1bd370=_0x1bd370||0x1f4;return function(_0x4290ed){logger[_0x63e7('0x1f')](_0x4290ed['stack']);if(_0x4290ed['name']){delete _0x4290ed['name'];}_0xd4f7e[_0x63e7('0x17')](_0x1bd370)['send'](_0x4290ed);};}exports['index']=function(_0x43d75e,_0xef692f){var _0x2a338b={},_0x2602cc={},_0x44ee44={'count':0x0,'rows':[]};var _0x2625ec=db['ChatTransferReport'][_0x63e7('0x20')];_0x2602cc[_0x63e7('0x21')]=_[_0x63e7('0x22')](_0x2625ec);_0x2602cc[_0x63e7('0x23')]=_[_0x63e7('0x22')](_0x43d75e[_0x63e7('0x23')]);_0x2602cc[_0x63e7('0x24')]=_[_0x63e7('0x25')](_0x2602cc[_0x63e7('0x21')],_0x2602cc[_0x63e7('0x23')]);_0x2a338b[_0x63e7('0x26')]=_[_0x63e7('0x25')](_0x2602cc[_0x63e7('0x21')],qs[_0x63e7('0x27')](_0x43d75e[_0x63e7('0x23')]['fields']));_0x2a338b['attributes']=_0x2a338b['attributes']['length']?_0x2a338b[_0x63e7('0x26')]:_0x2602cc['model'];if(!_0x43d75e[_0x63e7('0x23')][_0x63e7('0x28')]('nolimit')){_0x2a338b[_0x63e7('0x29')]=qs[_0x63e7('0x29')](_0x43d75e[_0x63e7('0x23')][_0x63e7('0x29')]);_0x2a338b[_0x63e7('0x1a')]=qs[_0x63e7('0x1a')](_0x43d75e[_0x63e7('0x23')][_0x63e7('0x1a')]);}_0x2a338b[_0x63e7('0x2a')]=qs[_0x63e7('0x2b')](_0x43d75e[_0x63e7('0x23')][_0x63e7('0x2b')]);_0x2a338b['where']=qs[_0x63e7('0x24')](_[_0x63e7('0x2c')](_0x43d75e[_0x63e7('0x23')],_0x2602cc['filters']));if(_0x43d75e[_0x63e7('0x23')][_0x63e7('0x2d')]){_0x2a338b[_0x63e7('0x2e')]=_[_0x63e7('0x2f')](_0x2a338b['where'],{'$or':_['map'](_0x2625ec,function(_0x3c6169){if(_0x3c6169[_0x63e7('0x30')][_0x63e7('0x31')]!==_0x63e7('0x32')){var _0x4473f0={};_0x4473f0[_0x3c6169[_0x63e7('0x33')]]={'$like':'%'+_0x43d75e[_0x63e7('0x23')][_0x63e7('0x2d')]+'%'};return _0x4473f0;}})});}_0x2a338b=_[_0x63e7('0x2f')]({},_0x2a338b,_0x43d75e[_0x63e7('0x34')]);var _0x4f00a9={'where':_0x2a338b['where']};return db['ChatTransferReport'][_0x63e7('0x19')](_0x4f00a9)[_0x63e7('0x1e')](function(_0x2851a4){_0x44ee44[_0x63e7('0x19')]=_0x2851a4;if(_0x43d75e['query'][_0x63e7('0x35')]){_0x2a338b[_0x63e7('0x36')]=[{'all':!![]}];}return db[_0x63e7('0x37')][_0x63e7('0x38')](_0x2a338b);})[_0x63e7('0x1e')](function(_0x49be67){_0x44ee44[_0x63e7('0x39')]=_0x49be67;return _0x44ee44;})[_0x63e7('0x1e')](respondWithFilteredResult(_0xef692f,_0x2a338b))[_0x63e7('0x3a')](handleError(_0xef692f,null));};exports[_0x63e7('0x3b')]=function(_0x588e6c,_0x35787e){var _0x10e379={'raw':!![],'where':{'id':_0x588e6c[_0x63e7('0x3c')]['id']}},_0x5255d8={};_0x5255d8[_0x63e7('0x21')]=_[_0x63e7('0x22')](db[_0x63e7('0x37')]['rawAttributes']);_0x5255d8['query']=_['keys'](_0x588e6c[_0x63e7('0x23')]);_0x5255d8[_0x63e7('0x24')]=_[_0x63e7('0x25')](_0x5255d8[_0x63e7('0x21')],_0x5255d8[_0x63e7('0x23')]);_0x10e379[_0x63e7('0x26')]=_[_0x63e7('0x25')](_0x5255d8['model'],qs[_0x63e7('0x27')](_0x588e6c[_0x63e7('0x23')][_0x63e7('0x27')]));_0x10e379[_0x63e7('0x26')]=_0x10e379[_0x63e7('0x26')][_0x63e7('0x3d')]?_0x10e379[_0x63e7('0x26')]:_0x5255d8[_0x63e7('0x21')];if(_0x588e6c[_0x63e7('0x23')][_0x63e7('0x35')]){_0x10e379['include']=[{'all':!![]}];}_0x10e379=_[_0x63e7('0x2f')]({},_0x10e379,_0x588e6c[_0x63e7('0x34')]);return db[_0x63e7('0x37')][_0x63e7('0x3e')](_0x10e379)[_0x63e7('0x1e')](handleEntityNotFound(_0x35787e,null))[_0x63e7('0x1e')](respondWithResult(_0x35787e,null))[_0x63e7('0x3a')](handleError(_0x35787e,null));};exports['create']=function(_0x32b1b1,_0x3933ea){return db['ChatTransferReport'][_0x63e7('0x3f')](_0x32b1b1['body'],{})[_0x63e7('0x1e')](respondWithResult(_0x3933ea,0xc9))['catch'](handleError(_0x3933ea,null));};exports[_0x63e7('0x40')]=function(_0x5c9c2c,_0x5d9328){if(_0x5c9c2c[_0x63e7('0x41')]['id']){delete _0x5c9c2c['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5c9c2c[_0x63e7('0x3c')]['id']}})[_0x63e7('0x1e')](handleEntityNotFound(_0x5d9328,null))[_0x63e7('0x1e')](saveUpdates(_0x5c9c2c[_0x63e7('0x41')],null))[_0x63e7('0x1e')](respondWithResult(_0x5d9328,null))[_0x63e7('0x3a')](handleError(_0x5d9328,null));};exports[_0x63e7('0x42')]=function(_0x4737d4,_0x9a59ad){return db[_0x63e7('0x37')][_0x63e7('0x3e')]({'where':{'id':_0x4737d4[_0x63e7('0x3c')]['id']}})[_0x63e7('0x1e')](handleEntityNotFound(_0x9a59ad,null))['then'](removeEntity(_0x9a59ad,null))['catch'](handleError(_0x9a59ad,null));};exports[_0x63e7('0x43')]=function(_0xa1bae,_0x5654ee){return db[_0x63e7('0x37')][_0x63e7('0x43')]()[_0x63e7('0x1e')](respondWithResult(_0x5654ee,null))[_0x63e7('0x3a')](handleError(_0x5654ee,null));}; \ No newline at end of file +var _0x0e21=['show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x3b4e7d,_0x5649fc){var _0x25611d=function(_0x51aa9b){while(--_0x51aa9b){_0x3b4e7d['push'](_0x3b4e7d['shift']());}};_0x25611d(++_0x5649fc);}(_0x0e21,0x1b6));var _0x10e2=function(_0x515bd7,_0x2a0ad3){_0x515bd7=_0x515bd7-0x0;var _0x2e195f=_0x0e21[_0x515bd7];return _0x2e195f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x10e2('0x0'));var rimraf=require(_0x10e2('0x1'));var zipdir=require(_0x10e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10e2('0x3'));var moment=require(_0x10e2('0x4'));var BPromise=require(_0x10e2('0x5'));var Mustache=require(_0x10e2('0x6'));var util=require(_0x10e2('0x7'));var path=require(_0x10e2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x10e2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x10e2('0xa'));var crypto=require(_0x10e2('0xb'));var jsforce=require(_0x10e2('0xc'));var deskjs=require(_0x10e2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10e2('0xe'));var qs=require(_0x10e2('0xf'));var hardwareService=require(_0x10e2('0x10'));var logger=require(_0x10e2('0x11'))(_0x10e2('0x12'));var utils=require('../../config/utils');var config=require(_0x10e2('0x13'));var db=require(_0x10e2('0x14'))['db'];function respondWithStatusCode(_0x37db10,_0x4b925c){_0x4b925c=_0x4b925c||0xcc;return function(_0x2ad126){if(_0x2ad126){return _0x37db10[_0x10e2('0x15')](_0x4b925c);}return _0x37db10['status'](_0x4b925c)[_0x10e2('0x16')]();};}function respondWithResult(_0x386a74,_0x396478){_0x396478=_0x396478||0xc8;return function(_0x38fa9b){if(_0x38fa9b){return _0x386a74[_0x10e2('0x17')](_0x396478)[_0x10e2('0x18')](_0x38fa9b);}};}function respondWithFilteredResult(_0x38ecad,_0x440d0e){return function(_0x2eb93d){if(_0x2eb93d){var _0x1e0591=_0x2eb93d[_0x10e2('0x19')],_0x4d425e=_0x440d0e[_0x10e2('0x1a')],_0x132f4f=_0x440d0e['offset']+_0x440d0e[_0x10e2('0x1b')],_0x186ae7;if(_0x132f4f>=_0x1e0591){_0x132f4f=_0x1e0591;_0x186ae7=0xc8;}else{_0x186ae7=0xce;}_0x38ecad[_0x10e2('0x17')](_0x186ae7);return _0x38ecad[_0x10e2('0x1c')](_0x10e2('0x1d'),_0x4d425e+'-'+_0x132f4f+'/'+_0x1e0591)[_0x10e2('0x18')](_0x2eb93d);}return null;};}function patchUpdates(_0x3dd563){return function(_0x2346a5){try{jsonpatch[_0x10e2('0x1e')](_0x2346a5,_0x3dd563,!![]);}catch(_0x4ab135){return BPromise['reject'](_0x4ab135);}return _0x2346a5[_0x10e2('0x1f')]();};}function saveUpdates(_0x258c22,_0x54bc1e){return function(_0x4b2101){if(_0x4b2101){return _0x4b2101[_0x10e2('0x20')](_0x258c22)[_0x10e2('0x21')](function(_0x377bd7){return _0x377bd7;});}return null;};}function removeEntity(_0x57f91d,_0x271927){return function(_0x522a6b){if(_0x522a6b){return _0x522a6b[_0x10e2('0x22')]()['then'](function(){_0x57f91d[_0x10e2('0x17')](0xcc)[_0x10e2('0x16')]();});}};}function handleEntityNotFound(_0x485cb9,_0x130375){return function(_0x175ecf){if(!_0x175ecf){_0x485cb9['sendStatus'](0x194);}return _0x175ecf;};}function handleError(_0x55340c,_0x5d2598){_0x5d2598=_0x5d2598||0x1f4;return function(_0x37794e){logger[_0x10e2('0x23')](_0x37794e[_0x10e2('0x24')]);if(_0x37794e[_0x10e2('0x25')]){delete _0x37794e['name'];}_0x55340c[_0x10e2('0x17')](_0x5d2598)[_0x10e2('0x26')](_0x37794e);};}exports[_0x10e2('0x27')]=function(_0x2b0453,_0x5446a6){var _0x591891={},_0x542b8d={},_0x4dffd4={'count':0x0,'rows':[]};var _0x2af8cd=db[_0x10e2('0x28')][_0x10e2('0x29')];_0x542b8d['model']=_['keys'](_0x2af8cd);_0x542b8d['query']=_['keys'](_0x2b0453[_0x10e2('0x2a')]);_0x542b8d['filters']=_['intersection'](_0x542b8d['model'],_0x542b8d[_0x10e2('0x2a')]);_0x591891['attributes']=_[_0x10e2('0x2b')](_0x542b8d[_0x10e2('0x2c')],qs[_0x10e2('0x2d')](_0x2b0453['query'][_0x10e2('0x2d')]));_0x591891[_0x10e2('0x2e')]=_0x591891['attributes'][_0x10e2('0x2f')]?_0x591891[_0x10e2('0x2e')]:_0x542b8d['model'];if(!_0x2b0453[_0x10e2('0x2a')][_0x10e2('0x30')](_0x10e2('0x31'))){_0x591891[_0x10e2('0x1b')]=qs[_0x10e2('0x1b')](_0x2b0453[_0x10e2('0x2a')][_0x10e2('0x1b')]);_0x591891[_0x10e2('0x1a')]=qs['offset'](_0x2b0453['query'][_0x10e2('0x1a')]);}_0x591891[_0x10e2('0x32')]=qs[_0x10e2('0x33')](_0x2b0453['query'][_0x10e2('0x33')]);_0x591891['where']=qs[_0x10e2('0x34')](_[_0x10e2('0x35')](_0x2b0453[_0x10e2('0x2a')],_0x542b8d[_0x10e2('0x34')]));if(_0x2b0453[_0x10e2('0x2a')][_0x10e2('0x36')]){_0x591891[_0x10e2('0x37')]=_[_0x10e2('0x38')](_0x591891[_0x10e2('0x37')],{'$or':_[_0x10e2('0x39')](_0x2af8cd,function(_0xd56228){if(_0xd56228[_0x10e2('0x3a')][_0x10e2('0x3b')]!==_0x10e2('0x3c')){var _0x4c4f13={};_0x4c4f13[_0xd56228['field']]={'$like':'%'+_0x2b0453[_0x10e2('0x2a')][_0x10e2('0x36')]+'%'};return _0x4c4f13;}})});}_0x591891=_[_0x10e2('0x38')]({},_0x591891,_0x2b0453[_0x10e2('0x3d')]);var _0x39bcd3={'where':_0x591891[_0x10e2('0x37')]};return db['ChatTransferReport'][_0x10e2('0x19')](_0x39bcd3)[_0x10e2('0x21')](function(_0x157d9e){_0x4dffd4[_0x10e2('0x19')]=_0x157d9e;if(_0x2b0453[_0x10e2('0x2a')][_0x10e2('0x3e')]){_0x591891[_0x10e2('0x3f')]=[{'all':!![]}];}return db[_0x10e2('0x28')]['findAll'](_0x591891);})[_0x10e2('0x21')](function(_0x5ee1a9){_0x4dffd4[_0x10e2('0x40')]=_0x5ee1a9;return _0x4dffd4;})[_0x10e2('0x21')](respondWithFilteredResult(_0x5446a6,_0x591891))[_0x10e2('0x41')](handleError(_0x5446a6,null));};exports[_0x10e2('0x42')]=function(_0x3456ca,_0x3b827d){var _0x26e697={'raw':!![],'where':{'id':_0x3456ca[_0x10e2('0x43')]['id']}},_0x2d7be4={};_0x2d7be4[_0x10e2('0x2c')]=_['keys'](db[_0x10e2('0x28')][_0x10e2('0x29')]);_0x2d7be4['query']=_['keys'](_0x3456ca[_0x10e2('0x2a')]);_0x2d7be4[_0x10e2('0x34')]=_['intersection'](_0x2d7be4['model'],_0x2d7be4[_0x10e2('0x2a')]);_0x26e697[_0x10e2('0x2e')]=_[_0x10e2('0x2b')](_0x2d7be4[_0x10e2('0x2c')],qs[_0x10e2('0x2d')](_0x3456ca[_0x10e2('0x2a')][_0x10e2('0x2d')]));_0x26e697[_0x10e2('0x2e')]=_0x26e697['attributes'][_0x10e2('0x2f')]?_0x26e697[_0x10e2('0x2e')]:_0x2d7be4[_0x10e2('0x2c')];if(_0x3456ca[_0x10e2('0x2a')][_0x10e2('0x3e')]){_0x26e697['include']=[{'all':!![]}];}_0x26e697=_['merge']({},_0x26e697,_0x3456ca[_0x10e2('0x3d')]);return db['ChatTransferReport']['find'](_0x26e697)['then'](handleEntityNotFound(_0x3b827d,null))[_0x10e2('0x21')](respondWithResult(_0x3b827d,null))[_0x10e2('0x41')](handleError(_0x3b827d,null));};exports[_0x10e2('0x44')]=function(_0xc9bd,_0x5324a9){return db['ChatTransferReport']['create'](_0xc9bd[_0x10e2('0x45')],{})[_0x10e2('0x21')](respondWithResult(_0x5324a9,0xc9))[_0x10e2('0x41')](handleError(_0x5324a9,null));};exports['update']=function(_0x5addaa,_0x5b710f){if(_0x5addaa[_0x10e2('0x45')]['id']){delete _0x5addaa[_0x10e2('0x45')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5addaa[_0x10e2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b710f,null))['then'](saveUpdates(_0x5addaa[_0x10e2('0x45')],null))[_0x10e2('0x21')](respondWithResult(_0x5b710f,null))[_0x10e2('0x41')](handleError(_0x5b710f,null));};exports[_0x10e2('0x22')]=function(_0x20d41b,_0x5739e4){return db['ChatTransferReport'][_0x10e2('0x46')]({'where':{'id':_0x20d41b[_0x10e2('0x43')]['id']}})[_0x10e2('0x21')](handleEntityNotFound(_0x5739e4,null))[_0x10e2('0x21')](removeEntity(_0x5739e4,null))[_0x10e2('0x41')](handleError(_0x5739e4,null));};exports[_0x10e2('0x47')]=function(_0x512de1,_0x9d41b2){return db[_0x10e2('0x28')]['describe']()[_0x10e2('0x21')](respondWithResult(_0x9d41b2,null))['catch'](handleError(_0x9d41b2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d509d43..b0f6160 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 _0xa971=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x45270e,_0x18ef3c){var _0xe87eef=function(_0x52f235){while(--_0x52f235){_0x45270e['push'](_0x45270e['shift']());}};_0xe87eef(++_0x18ef3c);}(_0xa971,0xc4));var _0x1a97=function(_0xdbbd74,_0x128291){_0xdbbd74=_0xdbbd74-0x0;var _0x5b158a=_0xa971[_0xdbbd74];return _0x5b158a;};'use strict';var _=require(_0x1a97('0x0'));var util=require(_0x1a97('0x1'));var logger=require('../../config/logger')(_0x1a97('0x2'));var moment=require(_0x1a97('0x3'));var BPromise=require(_0x1a97('0x4'));var rp=require(_0x1a97('0x5'));var fs=require('fs');var path=require(_0x1a97('0x6'));var rimraf=require(_0x1a97('0x7'));var config=require(_0x1a97('0x8'));var attributes=require(_0x1a97('0x9'));module[_0x1a97('0xa')]=function(_0x3f2515,_0x15f12d){return _0x3f2515[_0x1a97('0xb')](_0x1a97('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1a97('0xd'),'fields':[_0x1a97('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78cb=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x592ca0,_0x30d956){var _0x2c2e71=function(_0x19310e){while(--_0x19310e){_0x592ca0['push'](_0x592ca0['shift']());}};_0x2c2e71(++_0x30d956);}(_0x78cb,0x1d7));var _0xb78c=function(_0x5c7677,_0x2e06cb){_0x5c7677=_0x5c7677-0x0;var _0x88e14c=_0x78cb[_0x5c7677];return _0x88e14c;};'use strict';var _=require(_0xb78c('0x0'));var util=require('util');var logger=require(_0xb78c('0x1'))(_0xb78c('0x2'));var moment=require(_0xb78c('0x3'));var BPromise=require(_0xb78c('0x4'));var rp=require(_0xb78c('0x5'));var fs=require('fs');var path=require(_0xb78c('0x6'));var rimraf=require(_0xb78c('0x7'));var config=require(_0xb78c('0x8'));var attributes=require(_0xb78c('0x9'));module[_0xb78c('0xa')]=function(_0x69d42f,_0x339b19){return _0x69d42f[_0xb78c('0xb')](_0xb78c('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb78c('0xd'),'fields':[_0xb78c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 257a825..6b70950 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 _0x16e4=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','util','moment'];(function(_0x1a6067,_0x9b4bc0){var _0x249a37=function(_0x4a8187){while(--_0x4a8187){_0x1a6067['push'](_0x1a6067['shift']());}};_0x249a37(++_0x9b4bc0);}(_0x16e4,0x97));var _0x416e=function(_0x46932d,_0x44c88f){_0x46932d=_0x46932d-0x0;var _0x4c52af=_0x16e4[_0x46932d];return _0x4c52af;};'use strict';var _=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var moment=require(_0x416e('0x2'));var BPromise=require(_0x416e('0x3'));var rs=require(_0x416e('0x4'));var fs=require('fs');var Redis=require(_0x416e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x416e('0x6'));var logger=require('../../config/logger')(_0x416e('0x7'));var config=require(_0x416e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x416e('0x9')][_0x416e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3431c4,_0x40b8be,_0x1eb20f){return new BPromise(function(_0x962b38,_0x12d57c){return client[_0x416e('0xb')](_0x3431c4,_0x1eb20f)[_0x416e('0xc')](function(_0x47bd90){logger[_0x416e('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x40b8be,_0x416e('0xe'));logger[_0x416e('0xf')](_0x416e('0x10'),_0x40b8be,'request\x20sent',JSON[_0x416e('0x11')](_0x47bd90));if(_0x47bd90[_0x416e('0x12')]){if(_0x47bd90[_0x416e('0x12')]['code']===0x1f4){logger[_0x416e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x40b8be,_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);return _0x12d57c(_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);}logger['error'](_0x416e('0x14'),_0x40b8be,_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);return _0x962b38(_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);}else{logger[_0x416e('0xd')](_0x416e('0x14'),_0x40b8be,_0x416e('0xe'));_0x962b38(_0x47bd90[_0x416e('0x15')]['message']);}})['catch'](function(_0x5d8852){logger[_0x416e('0x12')](_0x416e('0x14'),_0x40b8be,_0x5d8852);_0x12d57c(_0x5d8852);});});} \ No newline at end of file +var _0x4a06=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x23421f,_0x36948e){var _0x4933ce=function(_0x23a99e){while(--_0x23a99e){_0x23421f['push'](_0x23421f['shift']());}};_0x4933ce(++_0x36948e);}(_0x4a06,0x1f2));var _0x64a0=function(_0x215c63,_0x2d22c8){_0x215c63=_0x215c63-0x0;var _0x2e7c75=_0x4a06[_0x215c63];return _0x2e7c75;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var moment=require(_0x64a0('0x2'));var BPromise=require(_0x64a0('0x3'));var rs=require(_0x64a0('0x4'));var fs=require('fs');var Redis=require(_0x64a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64a0('0x6'));var logger=require(_0x64a0('0x7'))(_0x64a0('0x8'));var config=require(_0x64a0('0x9'));var jayson=require(_0x64a0('0xa'));var client=jayson[_0x64a0('0xb')][_0x64a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2914f1,_0x987eb5,_0x44f259){return new BPromise(function(_0x2060fa,_0x12c52b){return client[_0x64a0('0xd')](_0x2914f1,_0x44f259)[_0x64a0('0xe')](function(_0x47064f){logger['info'](_0x64a0('0xf'),_0x987eb5,_0x64a0('0x10'));logger['debug'](_0x64a0('0x11'),_0x987eb5,_0x64a0('0x10'),JSON[_0x64a0('0x12')](_0x47064f));if(_0x47064f[_0x64a0('0x13')]){if(_0x47064f[_0x64a0('0x13')][_0x64a0('0x14')]===0x1f4){logger['error'](_0x64a0('0xf'),_0x987eb5,_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);return _0x12c52b(_0x47064f['error'][_0x64a0('0x15')]);}logger[_0x64a0('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x987eb5,_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);return _0x2060fa(_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);}else{logger['info'](_0x64a0('0xf'),_0x987eb5,_0x64a0('0x10'));_0x2060fa(_0x47064f[_0x64a0('0x16')][_0x64a0('0x15')]);}})[_0x64a0('0x17')](function(_0x45008e){logger[_0x64a0('0x13')](_0x64a0('0xf'),_0x987eb5,_0x45008e);_0x12c52b(_0x45008e);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 94c53ca..1c53593 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 _0x8b08=['./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x560d51,_0x2783d2){var _0x3fbd29=function(_0x2a0867){while(--_0x2a0867){_0x560d51['push'](_0x560d51['shift']());}};_0x3fbd29(++_0x2783d2);}(_0x8b08,0xca));var _0x88b0=function(_0x4b88be,_0x59275d){_0x4b88be=_0x4b88be-0x0;var _0x14489a=_0x8b08[_0x4b88be];return _0x14489a;};'use strict';var multer=require(_0x88b0('0x0'));var util=require(_0x88b0('0x1'));var path=require(_0x88b0('0x2'));var timeout=require(_0x88b0('0x3'));var express=require(_0x88b0('0x4'));var router=express['Router']();var auth=require(_0x88b0('0x5'));var interaction=require(_0x88b0('0x6'));var config=require('../../config/environment');var controller=require(_0x88b0('0x7'));router['get']('/',auth[_0x88b0('0x8')](),controller[_0x88b0('0x9')]);router[_0x88b0('0xa')](_0x88b0('0xb'),auth[_0x88b0('0x8')](),controller[_0x88b0('0xc')]);router[_0x88b0('0xa')](_0x88b0('0xd'),auth[_0x88b0('0x8')](),controller[_0x88b0('0xe')]);router[_0x88b0('0xf')]('/',auth[_0x88b0('0x8')](),controller['create']);router[_0x88b0('0x10')](_0x88b0('0xd'),auth[_0x88b0('0x8')](),controller['update']);router['delete'](_0x88b0('0xd'),auth[_0x88b0('0x8')](),controller[_0x88b0('0x11')]);module[_0x88b0('0x12')]=router; \ No newline at end of file +var _0xdf4d=['./chatTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xdf4d,0x111));var _0xddf4=function(_0x318c24,_0x5bae1a){_0x318c24=_0x318c24-0x0;var _0x97a045=_0xdf4d[_0x318c24];return _0x97a045;};'use strict';var multer=require(_0xddf4('0x0'));var util=require(_0xddf4('0x1'));var path=require(_0xddf4('0x2'));var timeout=require(_0xddf4('0x3'));var express=require(_0xddf4('0x4'));var router=express['Router']();var auth=require(_0xddf4('0x5'));var interaction=require(_0xddf4('0x6'));var config=require('../../config/environment');var controller=require(_0xddf4('0x7'));router['get']('/',auth[_0xddf4('0x8')](),controller['index']);router['get'](_0xddf4('0x9'),auth[_0xddf4('0x8')](),controller[_0xddf4('0xa')]);router[_0xddf4('0xb')](_0xddf4('0xc'),auth['isAuthenticated'](),controller[_0xddf4('0xd')]);router[_0xddf4('0xe')]('/',auth[_0xddf4('0x8')](),controller[_0xddf4('0xf')]);router[_0xddf4('0x10')](_0xddf4('0xc'),auth['isAuthenticated'](),controller[_0xddf4('0x11')]);router[_0xddf4('0x12')](_0xddf4('0xc'),auth['isAuthenticated'](),controller[_0xddf4('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index ea92a67..d9635db 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 _0x4c75=['Form\x20properly\x20submitted','Form\x20submission\x20error','Note','thumb','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','#9f946a','BOOLEAN','ENUM','rounded','squared','Chat','Send','INTEGER','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x2ab7a9,_0x40bbfa){var _0x25bd40=function(_0x4504b1){while(--_0x4504b1){_0x2ab7a9['push'](_0x2ab7a9['shift']());}};_0x25bd40(++_0x40bbfa);}(_0x4c75,0xb1));var _0x54c7=function(_0x161f03,_0x5d141b){_0x161f03=_0x161f03-0x0;var _0x2f396f=_0x4c75[_0x161f03];return _0x2f396f;};'use strict';var Sequelize=require(_0x54c7('0x0'));var rs=require(_0x54c7('0x1'));module[_0x54c7('0x2')]={'name':{'type':Sequelize[_0x54c7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54c7('0x4')},'description':{'type':Sequelize[_0x54c7('0x3')]},'mapKey':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x5')},'mapKeyOffline':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x54c7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x54c7('0x3')],'allowNull':![],'defaultValue':_0x54c7('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x54c7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x54c7('0x3')]},'animation':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x54c7('0x8')](_0x54c7('0x9'),_0x54c7('0xa')),'defaultValue':_0x54c7('0x9')},'header_online':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0xb')},'offline_chat_button':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0xc')},'header_offline':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x54c7('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x54c7('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x10')},'noteTitle':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0xc')},'skipMessageButton':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM']('star',_0x54c7('0x12')),'defaultValue':_0x54c7('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x54c7('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x54c7('0x14')],'defaultValue':function(){return JSON[_0x54c7('0x15')]({'items':[{'type':_0x54c7('0x16'),'variable':null,'config':{'placeholder':_0x54c7('0x17'),'type':_0x54c7('0x18'),'required':!![]},'props':{'title':_0x54c7('0x17'),'helpText':''}},{'type':_0x54c7('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x54c7('0x5'),'type':_0x54c7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x54c7('0x19')](_0x54c7('0x1a'))?JSON[_0x54c7('0x1b')](this['getDataValue']('onlineForm')):{};},'set':function(_0x4600f5){return this[_0x54c7('0x1c')](_0x54c7('0x1a'),JSON['stringify'](_0x4600f5));}},'offlineForm':{'type':Sequelize[_0x54c7('0x14')],'defaultValue':function(){return JSON[_0x54c7('0x15')]({'items':[{'type':_0x54c7('0x16'),'props':{'title':_0x54c7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x54c7('0x5'),'type':'email'},'variable':null},{'type':_0x54c7('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x54c7('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x54c7('0x19')]('offlineForm')?JSON[_0x54c7('0x1b')](this['getDataValue'](_0x54c7('0x1f'))):{};},'set':function(_0x55e1cd){return this[_0x54c7('0x1c')]('offlineForm',JSON['stringify'](_0x55e1cd));}},'token':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':function(){return rs[_0x54c7('0x20')]();}},'autoclose':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x54c7('0x3')]},'forwardOffline':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x54c7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x54c7('0x21')},'waitingMessage':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x23')},'offlineMessageBody':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x54c7('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x54c7('0x3')]},'notificationTemplate':{'type':Sequelize[_0x54c7('0x14')],'defaultValue':function(){return _0x54c7('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x54c7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x54c7('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x54c7('0x3')],'allowNull':![],'defaultValue':_0x54c7('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x54c7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x54c7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':_0x54c7('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x54c7('0xd')],'comment':_0x54c7('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x54c7('0x7')],'defaultValue':![],'comment':_0x54c7('0x2d'),'set':function(_0x2e4d48){if(!_0x2e4d48)this[_0x54c7('0x1c')](_0x54c7('0x2e'),null);this[_0x54c7('0x1c')](_0x54c7('0x2f'),_0x2e4d48);}}}; \ No newline at end of file +var _0x29b9=['#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','#9f946a','#ffffff','INTEGER','rounded','squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Skip','ENUM','star','thumb','stringify','input','name','email','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate'];(function(_0x1c206c,_0x30bdcf){var _0x188aaa=function(_0x49ff11){while(--_0x49ff11){_0x1c206c['push'](_0x1c206c['shift']());}};_0x188aaa(++_0x30bdcf);}(_0x29b9,0x1e9));var _0x929b=function(_0x44cab9,_0x45f9ff){_0x44cab9=_0x44cab9-0x0;var _0x3394c9=_0x29b9[_0x44cab9];return _0x3394c9;};'use strict';var Sequelize=require(_0x929b('0x0'));var rs=require(_0x929b('0x1'));module[_0x929b('0x2')]={'name':{'type':Sequelize[_0x929b('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x929b('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x929b('0x3')]},'mapKey':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x929b('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x929b('0x3')],'allowNull':![],'defaultValue':_0x929b('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x929b('0x3')],'allowNull':![],'defaultValue':_0x929b('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x929b('0x3')],'allowNull':![],'defaultValue':_0x929b('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x929b('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x929b('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x929b('0x7'),_0x929b('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x9')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x929b('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x929b('0xb')},'download_transcript':{'type':Sequelize[_0x929b('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x929b('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x929b('0xe')]},'closingQuestion':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x10')},'noteTitle':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x929b('0xa')},'skipMessageButton':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x11')},'conditionAgreement':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x929b('0x12')](_0x929b('0x13'),_0x929b('0x14')),'defaultValue':_0x929b('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x929b('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x929b('0xe')],'defaultValue':function(){return JSON[_0x929b('0x15')]({'items':[{'type':_0x929b('0x16'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x929b('0x17'),'helpText':''}},{'type':_0x929b('0x16'),'props':{'title':_0x929b('0x18'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x929b('0x18')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x929b('0x19')](_0x929b('0x1a'))?JSON[_0x929b('0x1b')](this[_0x929b('0x19')](_0x929b('0x1a'))):{};},'set':function(_0x252645){return this[_0x929b('0x1c')](_0x929b('0x1a'),JSON[_0x929b('0x15')](_0x252645));}},'offlineForm':{'type':Sequelize[_0x929b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x929b('0x16'),'props':{'title':_0x929b('0x18'),'helpText':''},'config':{'required':!![],'placeholder':_0x929b('0x18'),'type':_0x929b('0x18')},'variable':null},{'type':_0x929b('0x1d'),'config':{'placeholder':_0x929b('0x1e')},'props':{'title':_0x929b('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x929b('0x19')](_0x929b('0x1f'))?JSON[_0x929b('0x1b')](this[_0x929b('0x19')](_0x929b('0x1f'))):{};},'set':function(_0x5b72b2){return this[_0x929b('0x1c')](_0x929b('0x1f'),JSON['stringify'](_0x5b72b2));}},'token':{'type':Sequelize[_0x929b('0x3')],'defaultValue':function(){return rs[_0x929b('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x929b('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x929b('0x3')]},'waitingTitle':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x929b('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x929b('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x23')},'skipUnmanaged':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x11')},'sendUnmanaged':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0xa')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x929b('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x929b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x929b('0xe')],'defaultValue':function(){return _0x929b('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x929b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x25')},'verticalAlignment':{'type':Sequelize[_0x929b('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x26')},'defaultTitle':{'type':Sequelize[_0x929b('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x929b('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x929b('0x3')],'allowNull':![],'defaultValue':_0x929b('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x929b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x929b('0x3')],'defaultValue':_0x929b('0x28')},'systemAvatar':{'type':Sequelize[_0x929b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x929b('0xc')],'defaultValue':![],'comment':_0x929b('0x29'),'set':function(_0x3b8ad5){if(!_0x3b8ad5)this[_0x929b('0x1c')](_0x929b('0x2a'),null);this[_0x929b('0x1c')](_0x929b('0x2b'),_0x3b8ad5);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 8fd5218..04d735d 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 _0x54ea=['orderBy','priority','asc','List','defaults','contact','firstName','customerIp','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','no\x20available\x20attributes','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','fullname','color','tag','Command','getSnippet','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','some','readFileSync','server/files/chat/iframe.js','utf8','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','field','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','account','applications','Applications','list'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54ea,0x80));var _0xa54e=function(_0x52aa38,_0x4d1ee9){_0x52aa38=_0x52aa38-0x0;var _0x5a587e=_0x54ea[_0x52aa38];return _0x5a587e;};'use strict';var pdf=require(_0xa54e('0x0'));var emlformat=require(_0xa54e('0x1'));var rimraf=require(_0xa54e('0x2'));var zipdir=require(_0xa54e('0x3'));var jsonpatch=require(_0xa54e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa54e('0x5'));var Mustache=require('mustache');var util=require(_0xa54e('0x6'));var path=require('path');var sox=require(_0xa54e('0x7'));var csv=require('to-csv');var ejs=require(_0xa54e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa54e('0x9'));var crypto=require(_0xa54e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa54e('0xb'));var toCsv=require(_0xa54e('0xc'));var querystring=require('querystring');var Papa=require(_0xa54e('0xd'));var Redis=require('ioredis');var authService=require(_0xa54e('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa54e('0xf'))(_0xa54e('0x10'));var utils=require('../../config/utils');var config=require(_0xa54e('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa54e('0x12')],{'host':_0xa54e('0x13'),'port':0x18eb});var socket=require(_0xa54e('0x14'))(new Redis(config[_0xa54e('0x12')]));require(_0xa54e('0x15'))[_0xa54e('0x16')](socket);var jayson=require(_0xa54e('0x17'));var client=jayson[_0xa54e('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xa54e('0x18')][_0xa54e('0x19')]({'port':0x232a});var client9003=jayson['client'][_0xa54e('0x19')]({'port':0x232b});function checkPasswordPattern(_0x286c3c,_0x4beaf3,_0xcbf790){if(_0xcbf790){var _0x591a34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x591a34['test'](_0x4beaf3)){return _0x286c3c;}else{throw new Error(_0xa54e('0x1a'));}}else{return _0x286c3c;}}function respondWithRpcPromise(_0xb7512a,_0x4ba5f6,_0x45b91d,_0x24f13b){return new BPromise(function(_0x31c106,_0x1d670d){var _0x335722=_0x24f13b||client;return _0x335722['request'](_0xb7512a,_0x45b91d)[_0xa54e('0x1b')](function(_0x426d72){logger[_0xa54e('0x1c')](_0xa54e('0x1d'),_0x4ba5f6,'request\x20sent');logger[_0xa54e('0x1e')](_0xa54e('0x1f'),_0x4ba5f6,_0xa54e('0x20'),JSON[_0xa54e('0x21')](_0x426d72));if(_0x426d72[_0xa54e('0x22')]){if(_0x426d72['error'][_0xa54e('0x23')]===0x1f4){logger[_0xa54e('0x22')](_0xa54e('0x1d'),_0x4ba5f6,_0x426d72[_0xa54e('0x22')][_0xa54e('0x24')]);return _0x1d670d(_0x426d72['error'][_0xa54e('0x24')]);}logger[_0xa54e('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x4ba5f6,_0x426d72['error'][_0xa54e('0x24')]);return _0x31c106(_0x426d72[_0xa54e('0x22')][_0xa54e('0x24')]);}else{logger[_0xa54e('0x1c')](_0xa54e('0x1d'),_0x4ba5f6,'request\x20sent');_0x31c106(_0x426d72[_0xa54e('0x25')]['message']);}})[_0xa54e('0x26')](function(_0xfcadca){logger[_0xa54e('0x22')](_0xa54e('0x1d'),_0x4ba5f6,_0xfcadca);_0x1d670d(_0xfcadca);});});}function respondWithStatusCode(_0x47a128,_0x2e11b0){_0x2e11b0=_0x2e11b0||0xcc;return function(_0x5aef57){if(_0x5aef57){return _0x47a128[_0xa54e('0x27')](_0x2e11b0);}return _0x47a128[_0xa54e('0x28')](_0x2e11b0)[_0xa54e('0x29')]();};}function respondWithResult(_0x19caf3,_0x35ca6f){_0x35ca6f=_0x35ca6f||0xc8;return function(_0x3cba30){if(_0x3cba30){return _0x19caf3['status'](_0x35ca6f)[_0xa54e('0x2a')](_0x3cba30);}};}function respondWithFilteredResult(_0x2457be,_0xc6e726){return function(_0x4d3288){if(_0x4d3288){var _0x7af16b=_0x4d3288[_0xa54e('0x2b')],_0x291811=_0xc6e726[_0xa54e('0x2c')],_0x14fa64=_0xc6e726[_0xa54e('0x2c')]+_0xc6e726[_0xa54e('0x2d')],_0x22a838;if(_0x14fa64>=_0x7af16b){_0x14fa64=_0x7af16b;_0x22a838=0xc8;}else{_0x22a838=0xce;}_0x2457be[_0xa54e('0x28')](_0x22a838);return _0x2457be[_0xa54e('0x2e')](_0xa54e('0x2f'),_0x291811+'-'+_0x14fa64+'/'+_0x7af16b)['json'](_0x4d3288);}return null;};}function patchUpdates(_0xfd3b3f){return function(_0x25b4f9){try{jsonpatch[_0xa54e('0x30')](_0x25b4f9,_0xfd3b3f,!![]);}catch(_0x1df2b){return BPromise[_0xa54e('0x31')](_0x1df2b);}return _0x25b4f9[_0xa54e('0x32')]();};}function saveUpdates(_0x1d6adf,_0x366a77){return function(_0x24d917){if(_0x24d917){return _0x24d917[_0xa54e('0x33')](_0x1d6adf)[_0xa54e('0x1b')](function(_0x49f132){return _0x49f132;});}return null;};}function removeEntity(_0x14d021,_0x413b9e){return function(_0xdd5e8f){if(_0xdd5e8f){return _0xdd5e8f[_0xa54e('0x34')]()['then'](function(){var _0x3d3ce8=_0xdd5e8f['get']({'plain':!![]});var _0x40dcfe=_0xa54e('0x35');return db[_0xa54e('0x36')][_0xa54e('0x34')]({'where':{'type':_0x40dcfe,'resourceId':_0x3d3ce8['id']}})[_0xa54e('0x1b')](function(){return _0xdd5e8f;});})['then'](function(){_0x14d021[_0xa54e('0x28')](0xcc)[_0xa54e('0x29')]();});}};}function handleEntityNotFound(_0x278b24,_0x10f4a8){return function(_0x4f96c1){if(!_0x4f96c1){_0x278b24[_0xa54e('0x27')](0x194);}return _0x4f96c1;};}function handleError(_0x291cd3,_0x16d1da){_0x16d1da=_0x16d1da||0x1f4;return function(_0x11ba51){logger[_0xa54e('0x22')](_0x11ba51[_0xa54e('0x37')]);if(_0x11ba51['name']){delete _0x11ba51[_0xa54e('0x38')];}_0x291cd3['status'](_0x16d1da)[_0xa54e('0x39')](_0x11ba51);};}exports['index']=function(_0x3c130c,_0x457527){var _0x15f822={'include':[{'model':db[_0xa54e('0x3a')],'as':_0xa54e('0x3b')}]},_0x58ec29={},_0x3b528a={'count':0x0,'rows':[]};var _0x50e565=db[_0xa54e('0x3c')][_0xa54e('0x3d')];_0x58ec29[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](_0x50e565);_0x58ec29[_0xa54e('0x40')]=_[_0xa54e('0x3f')](_0x3c130c['query']);_0x58ec29[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x58ec29[_0xa54e('0x3e')],_0x58ec29[_0xa54e('0x40')]);_0x15f822[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x58ec29[_0xa54e('0x3e')],qs[_0xa54e('0x44')](_0x3c130c['query'][_0xa54e('0x44')]));_0x15f822['attributes']=_0x15f822['attributes'][_0xa54e('0x45')]?_0x15f822[_0xa54e('0x43')]:_0x58ec29['model'];if(!_0x3c130c[_0xa54e('0x40')]['hasOwnProperty'](_0xa54e('0x46'))){_0x15f822['limit']=qs[_0xa54e('0x2d')](_0x3c130c[_0xa54e('0x40')][_0xa54e('0x2d')]);_0x15f822['offset']=qs[_0xa54e('0x2c')](_0x3c130c['query'][_0xa54e('0x2c')]);}_0x15f822[_0xa54e('0x47')]=qs[_0xa54e('0x48')](_0x3c130c[_0xa54e('0x40')][_0xa54e('0x48')]);_0x15f822[_0xa54e('0x49')]=qs[_0xa54e('0x41')](_[_0xa54e('0x4a')](_0x3c130c[_0xa54e('0x40')],_0x58ec29[_0xa54e('0x41')]));if(_0x3c130c[_0xa54e('0x40')][_0xa54e('0x4b')]){_0x15f822[_0xa54e('0x49')]=_['merge'](_0x15f822[_0xa54e('0x49')],{'$or':_[_0xa54e('0x4c')](_0x50e565,function(_0x95d2a6){if(_0x95d2a6[_0xa54e('0x4d')]['key']!=='VIRTUAL'){var _0x5ddfe8={};_0x5ddfe8[_0x95d2a6[_0xa54e('0x4e')]]={'$like':'%'+_0x3c130c['query']['filter']+'%'};return _0x5ddfe8;}})});}_0x15f822=_[_0xa54e('0x4f')]({},_0x15f822,_0x3c130c[_0xa54e('0x50')]);var _0x4fff42={'where':_0x15f822[_0xa54e('0x49')]};return db['ChatWebsite'][_0xa54e('0x2b')](_0x4fff42)[_0xa54e('0x1b')](function(_0x207284){_0x3b528a[_0xa54e('0x2b')]=_0x207284;if(_0x3c130c[_0xa54e('0x40')]['includeAll']){_0x15f822[_0xa54e('0x51')]=[{'all':!![]}];}return db[_0xa54e('0x3c')][_0xa54e('0x52')](_0x15f822);})[_0xa54e('0x1b')](function(_0x8fc06f){_0x3b528a[_0xa54e('0x53')]=_0x8fc06f;return _0x3b528a;})[_0xa54e('0x1b')](respondWithFilteredResult(_0x457527,_0x15f822))[_0xa54e('0x26')](handleError(_0x457527,null));};exports[_0xa54e('0x54')]=function(_0x543c89,_0x354ca4){var _0x34a744={'raw':![],'where':{'id':_0x543c89[_0xa54e('0x55')]['id']},'include':[{'model':db[_0xa54e('0x3a')],'as':_0xa54e('0x3b')}]},_0x5a1a38={};_0x5a1a38[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](db[_0xa54e('0x3c')]['rawAttributes']);_0x5a1a38[_0xa54e('0x40')]=_['keys'](_0x543c89[_0xa54e('0x40')]);_0x5a1a38[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x5a1a38[_0xa54e('0x3e')],_0x5a1a38[_0xa54e('0x40')]);_0x34a744[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x5a1a38['model'],qs[_0xa54e('0x44')](_0x543c89[_0xa54e('0x40')][_0xa54e('0x44')]));_0x34a744['attributes']=_0x34a744[_0xa54e('0x43')]['length']?_0x34a744['attributes']:_0x5a1a38[_0xa54e('0x3e')];if(_0x543c89[_0xa54e('0x40')][_0xa54e('0x56')]){_0x34a744[_0xa54e('0x51')]=[{'all':!![]}];}_0x34a744=_[_0xa54e('0x4f')]({},_0x34a744,_0x543c89[_0xa54e('0x50')]);return db[_0xa54e('0x3c')][_0xa54e('0x57')](_0x34a744)[_0xa54e('0x1b')](handleEntityNotFound(_0x354ca4,null))[_0xa54e('0x1b')](respondWithResult(_0x354ca4,null))[_0xa54e('0x26')](handleError(_0x354ca4,null));};exports[_0xa54e('0x58')]=function(_0x989431,_0x4d6e4b){return db[_0xa54e('0x3c')][_0xa54e('0x58')](_0x989431[_0xa54e('0x59')],{})['then'](function(_0x23c7b9){var _0x12a5bb=_0x989431['user'][_0xa54e('0x5a')]({'plain':!![]});if(!_0x12a5bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12a5bb[_0xa54e('0x5b')]===_0xa54e('0x5c')){var _0x2965b8=_0x23c7b9['get']({'plain':!![]});var _0x36de28=_0xa54e('0x35');return db[_0xa54e('0x5d')][_0xa54e('0x57')]({'where':{'name':_0x36de28,'userProfileId':_0x12a5bb[_0xa54e('0x5e')]},'raw':!![]})[_0xa54e('0x1b')](function(_0x12d76d){if(_0x12d76d&&_0x12d76d[_0xa54e('0x5f')]===0x0){return db[_0xa54e('0x36')]['create']({'name':_0x2965b8[_0xa54e('0x38')],'resourceId':_0x2965b8['id'],'type':_0x12d76d[_0xa54e('0x38')],'sectionId':_0x12d76d['id']},{})['then'](function(){return _0x23c7b9;});}else{return _0x23c7b9;}})[_0xa54e('0x26')](function(_0x506249){logger[_0xa54e('0x22')](_0xa54e('0x60'),_0x506249);throw _0x506249;});}return _0x23c7b9;})[_0xa54e('0x1b')](respondWithResult(_0x4d6e4b,0xc9))[_0xa54e('0x26')](handleError(_0x4d6e4b,null));};exports['update']=function(_0x51e840,_0x5841e2){if(_0x51e840['body']['id']){delete _0x51e840[_0xa54e('0x59')]['id'];}return db[_0xa54e('0x3c')]['find']({'where':{'id':_0x51e840['params']['id']},'include':[{'model':db[_0xa54e('0x3a')],'as':_0xa54e('0x3b')}]})[_0xa54e('0x1b')](handleEntityNotFound(_0x5841e2,null))[_0xa54e('0x1b')](saveUpdates(_0x51e840['body'],null))[_0xa54e('0x1b')](respondWithResult(_0x5841e2,null))[_0xa54e('0x26')](handleError(_0x5841e2,null));};exports[_0xa54e('0x34')]=function(_0x1cf39c,_0x3eae24){return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x1cf39c[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x3eae24,null))[_0xa54e('0x1b')](removeEntity(_0x3eae24,null))['catch'](handleError(_0x3eae24,null));};exports[_0xa54e('0x61')]=function(_0x4ff7d1,_0x19b0ff){return db[_0xa54e('0x3c')]['describe']()[_0xa54e('0x1b')](respondWithResult(_0x19b0ff,null))[_0xa54e('0x26')](handleError(_0x19b0ff,null));};exports[_0xa54e('0x62')]=function(_0x2f3f3a,_0x3c6c8e,_0x24fc68){if(_0x2f3f3a['body']['id']){delete _0x2f3f3a[_0xa54e('0x59')]['id'];}return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x2f3f3a[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x3c6c8e,null))[_0xa54e('0x1b')](function(_0x21077c){if(_0x21077c){_0x2f3f3a['body']['ChatWebsiteId']=_0x21077c['id'];return db[_0xa54e('0x63')]['create'](_0x2f3f3a[_0xa54e('0x59')]);}})[_0xa54e('0x1b')](respondWithResult(_0x3c6c8e,null))['catch'](handleError(_0x3c6c8e,null));};exports['getDispositions']=function(_0x3c75c0,_0x52a19b,_0xfd617d){var _0x4ad705={'raw':![],'where':{}};var _0x227a11={};var _0x10e72c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa54e('0x64')]({'where':{'id':_0x3c75c0[_0xa54e('0x55')]['id']}})['then'](handleEntityNotFound(_0x52a19b,null))[_0xa54e('0x1b')](function(_0x6a20cd){if(_0x6a20cd){_0x227a11[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](db[_0xa54e('0x63')]['rawAttributes']);_0x227a11[_0xa54e('0x40')]=_[_0xa54e('0x3f')](_0x3c75c0[_0xa54e('0x40')]);_0x227a11[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x227a11[_0xa54e('0x3e')],_0x227a11[_0xa54e('0x40')]);_0x4ad705[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x227a11['model'],qs['fields'](_0x3c75c0['query'][_0xa54e('0x44')]));_0x4ad705['attributes']=_0x4ad705['attributes'][_0xa54e('0x45')]?_0x4ad705[_0xa54e('0x43')]:_0x227a11[_0xa54e('0x3e')];if(!_0x3c75c0[_0xa54e('0x40')][_0xa54e('0x65')](_0xa54e('0x46'))){_0x4ad705['limit']=qs[_0xa54e('0x2d')](_0x3c75c0['query'][_0xa54e('0x2d')]);_0x4ad705[_0xa54e('0x2c')]=qs[_0xa54e('0x2c')](_0x3c75c0['query'][_0xa54e('0x2c')]);}_0x4ad705[_0xa54e('0x47')]=qs['sort'](_0x3c75c0[_0xa54e('0x40')][_0xa54e('0x48')]);_0x4ad705[_0xa54e('0x49')]=qs[_0xa54e('0x41')](_[_0xa54e('0x4a')](_0x3c75c0[_0xa54e('0x40')],_0x227a11[_0xa54e('0x41')]));_0x4ad705[_0xa54e('0x49')][_0xa54e('0x66')]=_0x6a20cd['id'];if(_0x3c75c0[_0xa54e('0x40')]['filter']){_0x4ad705[_0xa54e('0x49')]=_[_0xa54e('0x4f')](_0x4ad705[_0xa54e('0x49')],{'$or':_[_0xa54e('0x4c')](_0x4ad705[_0xa54e('0x43')],function(_0x196548){var _0x918318={};_0x918318[_0x196548]={'$like':'%'+_0x3c75c0['query'][_0xa54e('0x4b')]+'%'};return _0x918318;})});}_0x4ad705=_[_0xa54e('0x4f')]({},_0x4ad705,_0x3c75c0['options']);return db[_0xa54e('0x63')][_0xa54e('0x2b')]({'where':_0x4ad705['where']})['then'](function(_0x539368){_0x10e72c[_0xa54e('0x2b')]=_0x539368;if(_0x3c75c0[_0xa54e('0x40')][_0xa54e('0x56')]){_0x4ad705['include']=[{'all':!![]}];}return db[_0xa54e('0x63')][_0xa54e('0x52')](_0x4ad705);})[_0xa54e('0x1b')](function(_0x3e4407){_0x10e72c[_0xa54e('0x53')]=_0x3e4407;return _0x10e72c;});}})[_0xa54e('0x1b')](respondWithFilteredResult(_0x52a19b,_0x4ad705))[_0xa54e('0x26')](handleError(_0x52a19b,null));};exports[_0xa54e('0x67')]=function(_0x49adf6,_0x45cb27,_0x312643){return db['ChatWebsite'][_0xa54e('0x57')]({'where':{'id':_0x49adf6[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x45cb27,null))[_0xa54e('0x1b')](function(_0x2bc526){if(_0x2bc526){return _0x2bc526[_0xa54e('0x67')](_0x49adf6['query']['ids']);}})['then'](respondWithStatusCode(_0x45cb27,null))[_0xa54e('0x26')](handleError(_0x45cb27,null));};exports[_0xa54e('0x68')]=function(_0x3b52f6,_0x3f8faa,_0x169849){if(_0x3b52f6[_0xa54e('0x59')]['id']){delete _0x3b52f6[_0xa54e('0x59')]['id'];}return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x3b52f6['params']['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x3f8faa,null))[_0xa54e('0x1b')](function(_0x504002){if(_0x504002){_0x3b52f6['body']['ChatWebsiteId']=_0x504002['id'];return db[_0xa54e('0x69')][_0xa54e('0x58')](_0x3b52f6[_0xa54e('0x59')]);}})[_0xa54e('0x1b')](respondWithResult(_0x3f8faa,null))['catch'](handleError(_0x3f8faa,null));};exports['getAnswers']=function(_0x51b111,_0x5e8a25,_0x3ff0cb){var _0x477db9={'raw':![],'where':{}};var _0x261a81={};var _0x2035d3={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x51b111[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x5e8a25,null))[_0xa54e('0x1b')](function(_0x85b1f8){if(_0x85b1f8){_0x261a81[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](db[_0xa54e('0x69')][_0xa54e('0x3d')]);_0x261a81['query']=_[_0xa54e('0x3f')](_0x51b111['query']);_0x261a81['filters']=_[_0xa54e('0x42')](_0x261a81[_0xa54e('0x3e')],_0x261a81[_0xa54e('0x40')]);_0x477db9[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x261a81[_0xa54e('0x3e')],qs[_0xa54e('0x44')](_0x51b111[_0xa54e('0x40')][_0xa54e('0x44')]));_0x477db9['attributes']=_0x477db9[_0xa54e('0x43')]['length']?_0x477db9[_0xa54e('0x43')]:_0x261a81['model'];if(!_0x51b111[_0xa54e('0x40')]['hasOwnProperty'](_0xa54e('0x46'))){_0x477db9[_0xa54e('0x2d')]=qs['limit'](_0x51b111['query'][_0xa54e('0x2d')]);_0x477db9[_0xa54e('0x2c')]=qs[_0xa54e('0x2c')](_0x51b111[_0xa54e('0x40')][_0xa54e('0x2c')]);}_0x477db9['order']=qs[_0xa54e('0x48')](_0x51b111[_0xa54e('0x40')][_0xa54e('0x48')]);_0x477db9[_0xa54e('0x49')]=qs['filters'](_[_0xa54e('0x4a')](_0x51b111[_0xa54e('0x40')],_0x261a81[_0xa54e('0x41')]));_0x477db9[_0xa54e('0x49')][_0xa54e('0x66')]=_0x85b1f8['id'];if(_0x51b111['query'][_0xa54e('0x4b')]){_0x477db9[_0xa54e('0x49')]=_[_0xa54e('0x4f')](_0x477db9[_0xa54e('0x49')],{'$or':_['map'](_0x477db9[_0xa54e('0x43')],function(_0x5385ec){var _0x4dc0c5={};_0x4dc0c5[_0x5385ec]={'$like':'%'+_0x51b111['query'][_0xa54e('0x4b')]+'%'};return _0x4dc0c5;})});}_0x477db9=_[_0xa54e('0x4f')]({},_0x477db9,_0x51b111['options']);return db[_0xa54e('0x69')][_0xa54e('0x2b')]({'where':_0x477db9[_0xa54e('0x49')]})[_0xa54e('0x1b')](function(_0x512bce){_0x2035d3[_0xa54e('0x2b')]=_0x512bce;if(_0x51b111['query'][_0xa54e('0x56')]){_0x477db9['include']=[{'all':!![]}];}return db[_0xa54e('0x69')]['findAll'](_0x477db9);})[_0xa54e('0x1b')](function(_0x4be380){_0x2035d3[_0xa54e('0x53')]=_0x4be380;return _0x2035d3;});}})[_0xa54e('0x1b')](respondWithFilteredResult(_0x5e8a25,_0x477db9))[_0xa54e('0x26')](handleError(_0x5e8a25,null));};exports['removeAnswers']=function(_0x3e1f8e,_0x363d25,_0x2961ae){return db[_0xa54e('0x3c')]['find']({'where':{'id':_0x3e1f8e[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x363d25,null))['then'](function(_0x583b8a){if(_0x583b8a){return _0x583b8a['removeAnswers'](_0x3e1f8e[_0xa54e('0x40')][_0xa54e('0x6a')]);}})[_0xa54e('0x1b')](respondWithStatusCode(_0x363d25,null))[_0xa54e('0x26')](handleError(_0x363d25,null));};exports[_0xa54e('0x6b')]=function(_0x3d0ae6,_0x34fe8e,_0x1a889e){_0x3d0ae6[_0xa54e('0x59')][_0xa54e('0x6c')]=_0x3d0ae6[_0xa54e('0x6d')][_0xa54e('0x6e')];return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x3d0ae6[_0xa54e('0x55')]['id']}})['then'](handleEntityNotFound(_0x34fe8e,null))[_0xa54e('0x1b')](saveUpdates(_0x3d0ae6[_0xa54e('0x59')],null))['then'](respondWithResult(_0x34fe8e,null))['catch'](handleError(_0x34fe8e,null));};exports[_0xa54e('0x6f')]=function(_0x15dcf2,_0x1d2cfc,_0x39fd92){_0x15dcf2[_0xa54e('0x59')][_0xa54e('0x70')]=_0x15dcf2[_0xa54e('0x6d')][_0xa54e('0x6e')];return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x15dcf2['params']['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x1d2cfc,null))[_0xa54e('0x1b')](saveUpdates(_0x15dcf2[_0xa54e('0x59')],null))[_0xa54e('0x1b')](respondWithResult(_0x1d2cfc,null))[_0xa54e('0x26')](handleError(_0x1d2cfc,null));};exports['addCustomerAvatar']=function(_0x5dcd62,_0x43de63,_0x41a56b){_0x5dcd62[_0xa54e('0x59')][_0xa54e('0x71')]=_0x5dcd62[_0xa54e('0x6d')][_0xa54e('0x6e')];return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x5dcd62[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x43de63,null))['then'](saveUpdates(_0x5dcd62[_0xa54e('0x59')],null))[_0xa54e('0x1b')](respondWithResult(_0x43de63,null))[_0xa54e('0x26')](handleError(_0x43de63,null));};exports[_0xa54e('0x72')]=function(_0x130ad9,_0x5ab9d1,_0x3039ee){_0x130ad9['body']['systemAvatar']=_0x130ad9[_0xa54e('0x6d')][_0xa54e('0x6e')];return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x130ad9[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x5ab9d1,null))[_0xa54e('0x1b')](saveUpdates(_0x130ad9[_0xa54e('0x59')],null))[_0xa54e('0x1b')](respondWithResult(_0x5ab9d1,null))[_0xa54e('0x26')](handleError(_0x5ab9d1,null));};exports[_0xa54e('0x73')]=function(_0x3c4de5,_0x462921,_0x838adb){var _0x4b3462=path['join'](config[_0xa54e('0x74')],_0xa54e('0x75'));var _0x3ed37d={'where':{'id':_0x3c4de5[_0xa54e('0x55')]['id']},'attributes':['id',_0xa54e('0x6c')],'raw':!![]};var _0x2f8ddf=![];return require(_0xa54e('0x76'))[_0xa54e('0x77')]()[_0xa54e('0x1b')](function(_0x26f4aa){if(_0x26f4aa){_0x2f8ddf=_0x26f4aa[_0xa54e('0x78')];}})['then'](function(){return db[_0xa54e('0x3c')]['find'](_0x3ed37d);})[_0xa54e('0x1b')](handleEntityNotFound(_0x462921,null))['then'](function(_0x471a31){if(_0x471a31){if(!_[_0xa54e('0x79')](_0x471a31['sitepic'])){if(fs['existsSync'](path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x7b'),_0x471a31['sitepic']))&&_0x2f8ddf){_0x4b3462=path['join'](config[_0xa54e('0x74')],_0xa54e('0x7b'),_0x471a31[_0xa54e('0x6c')]);}}return _0x462921[_0xa54e('0x7c')](_0x4b3462);}})[_0xa54e('0x26')](handleError(_0x462921,null));};exports[_0xa54e('0x7d')]=function(_0x515057,_0x5acea9,_0x34cf67){var _0x523e2f=path[_0xa54e('0x7a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0xdb9fe8={'where':{'id':_0x515057[_0xa54e('0x55')]['id']},'attributes':['id',_0xa54e('0x70')],'raw':!![]};return db['ChatWebsite']['find'](_0xdb9fe8)[_0xa54e('0x1b')](handleEntityNotFound(_0x5acea9,null))[_0xa54e('0x1b')](function(_0x369d3b){if(_0x369d3b){if(!_[_0xa54e('0x79')](_0x369d3b[_0xa54e('0x70')])){if(fs[_0xa54e('0x7e')](path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x7f'),_0x369d3b['agentAvatar']))){_0x523e2f=path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x7f'),_0x369d3b['agentAvatar']);}}return _0x5acea9[_0xa54e('0x7c')](_0x523e2f);}})['catch'](handleError(_0x5acea9,null));};exports['getCustomerAvatar']=function(_0x1e5b8c,_0x50f110,_0x223f77){var _0x511646=path['join'](config[_0xa54e('0x74')],'server/files/images/avatars/customer_avatar.png');var _0x14014c={'where':{'id':_0x1e5b8c['params']['id']},'attributes':['id',_0xa54e('0x71'),'showCustomerAvatar'],'raw':!![]};return db[_0xa54e('0x3c')][_0xa54e('0x57')](_0x14014c)['then'](handleEntityNotFound(_0x50f110,null))[_0xa54e('0x1b')](function(_0x17545c){if(_0x17545c){if(!_[_0xa54e('0x79')](_0x17545c[_0xa54e('0x71')])){if(fs[_0xa54e('0x7e')](path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x7f'),_0x17545c[_0xa54e('0x71')]))&&_0x17545c[_0xa54e('0x80')]){_0x511646=path[_0xa54e('0x7a')](config[_0xa54e('0x74')],'server/files/images/avatars/',_0x17545c[_0xa54e('0x71')]);}}return _0x50f110[_0xa54e('0x7c')](_0x511646);}})[_0xa54e('0x26')](handleError(_0x50f110,null));};exports['getSystemAvatar']=function(_0x345625,_0x2b03b3,_0x4ba4e6){var _0x5abc3f=path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x81'));var _0x4aaaae={'where':{'id':_0x345625[_0xa54e('0x55')]['id']},'attributes':['id',_0xa54e('0x82')],'raw':!![]};return db['ChatWebsite'][_0xa54e('0x57')](_0x4aaaae)[_0xa54e('0x1b')](handleEntityNotFound(_0x2b03b3,null))[_0xa54e('0x1b')](function(_0x542e87){if(_0x542e87){if(!_[_0xa54e('0x79')](_0x542e87[_0xa54e('0x82')])){if(fs[_0xa54e('0x7e')](path[_0xa54e('0x7a')](config['root'],_0xa54e('0x7f'),_0x542e87[_0xa54e('0x82')]))){_0x5abc3f=path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0x7f'),_0x542e87[_0xa54e('0x82')]);}}return _0x2b03b3['download'](_0x5abc3f);}})[_0xa54e('0x26')](handleError(_0x2b03b3,null));};exports['notify']=function(_0x2d90e5,_0x1269b6,_0x2e65dd){var _0x26d418=require(_0xa54e('0x83'));var _0xa5e8e8=new _0x26d418();var _0x49f622=_0xa5e8e8[_0xa54e('0x84')](_0x2d90e5[_0xa54e('0x85')][_0xa54e('0x86')])[_0xa54e('0x87')]();var _0xa581c9={'body':_0x2d90e5['body'],'channel':_0xa54e('0x88')};var _0x338e27=[];var _0xd1bd21=[];var _0x1dfc2c={};var _0x21004a=![];return db[_0xa54e('0x89')]['describe']()[_0xa54e('0x1b')](function(_0x17cd52){if(!_0x17cd52){throw new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))]('no\x20available\x20attributes');}_0x338e27=_[_0xa54e('0x8c')](_[_0xa54e('0x3f')](_0x17cd52),[_0xa54e('0x8d'),_0xa54e('0x8e')]);_0xd1bd21=_[_0xa54e('0x8c')](_[_0xa54e('0x3f')](_0x17cd52),['createdAt','updatedAt',_0xa54e('0x8f'),_0xa54e('0x90')]);if(_0x2d90e5['body']['id']){delete _0x2d90e5[_0xa54e('0x59')]['id'];}if(_[_0xa54e('0x79')](_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x91')])){throw new db['Sequelize'][(_0xa54e('0x8b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2d90e5['body'][_0xa54e('0x59')])||_0x2d90e5['body'][_0xa54e('0x59')]===''){throw new db[(_0xa54e('0x8a'))]['ValidationError'](_0xa54e('0x92'));}if(_[_0xa54e('0x79')](_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x93')])){throw new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))](_0xa54e('0x94')+_0xd1bd21);}if(!_['includes'](_0xd1bd21,_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x93')])){throw new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))](_0xa54e('0x95')+_0xd1bd21);}_0x1dfc2c[_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x93')]]=_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x91')];})['then'](function(){return db['ChatWebsite'][_0xa54e('0x57')]({'where':{'id':_0x2d90e5['params']['id']},'include':[{'model':db[_0xa54e('0x96')],'as':'List','include':[{'model':db[_0xa54e('0x89')],'as':_0xa54e('0x97'),'where':_0x1dfc2c,'limit':0x1,'order':[[_0xa54e('0x8e'),_0xa54e('0x98')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xa54e('0x1b')](handleEntityNotFound(_0x1269b6,null))[_0xa54e('0x1b')](function(_0x58733e){if(_0x58733e&&_0x58733e['List']){_0xa581c9[_0xa54e('0x99')]=_0x58733e;_0xa581c9[_0xa54e('0x9a')]=_0x58733e[_0xa54e('0x9b')];_0xa581c9[_0xa54e('0x9c')]=_0x58733e['List'];_0xa581c9[_0xa54e('0x9a')]=_[_0xa54e('0x9d')](_0xa581c9['applications'],[_0xa54e('0x9e')],[_0xa54e('0x9f')]);if(_0xa581c9['account'][_0xa54e('0x9b')]){delete _0xa581c9['account'][_0xa54e('0x9b')];}if(_0xa581c9[_0xa54e('0x99')][_0xa54e('0xa0')]&&_0xa581c9[_0xa54e('0x99')][_0xa54e('0xa0')]['Contacts'][_0xa54e('0x45')]){return _0xa581c9[_0xa54e('0x99')]['List'][_0xa54e('0x97')][0x0];}var _0x5f267e=_[_0xa54e('0xa1')](_0x2d90e5['body'],{'firstName':_0x2d90e5[_0xa54e('0x59')]['from'],'ListId':_0x58733e[_0xa54e('0x90')]});_0x5f267e[_0x2d90e5[_0xa54e('0x59')][_0xa54e('0x93')]]=_0x2d90e5['body']['from'];return db[_0xa54e('0x89')][_0xa54e('0x58')](_0x5f267e,{'fields':_0x338e27,'raw':!![]});}})[_0xa54e('0x1b')](handleEntityNotFound(_0x1269b6,null))[_0xa54e('0x1b')](function(_0x20f66e){_0xa581c9[_0xa54e('0xa2')]=_0x20f66e;if(_0x20f66e){var _0x6e9e10={'ContactId':_0x20f66e['id'],'ChatWebsiteId':_0x2d90e5[_0xa54e('0x55')]['id'],'from':(_0x20f66e[_0xa54e('0xa3')]||'')+'\x20'+(_0x20f66e['lastName']||''),'customerIp':_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xa4')],'referer':_0x2d90e5['body'][_0xa54e('0xa5')],'browserName':_0x49f622[_0xa54e('0xa6')][_0xa54e('0x38')]&&_0x49f622[_0xa54e('0xa6')]['version']?util[_0xa54e('0xa7')](_0xa54e('0xa8'),_0x49f622['browser'][_0xa54e('0x38')],_0x49f622[_0xa54e('0xa6')][_0xa54e('0xa9')]):_0xa54e('0xaa'),'browserVersion':_0x49f622[_0xa54e('0xa6')][_0xa54e('0xa9')]||_0xa54e('0xaa'),'osName':util['format'](_0xa54e('0xa8'),_0x49f622['os'][_0xa54e('0x38')],_0x49f622['os'][_0xa54e('0xa9')]),'osVersion':_0x49f622['os'][_0xa54e('0xa9')],'deviceModel':_0x49f622['device'][_0xa54e('0x3e')]&&_0x49f622[_0xa54e('0xab')][_0xa54e('0xac')]?util[_0xa54e('0xa7')](_0xa54e('0xad'),_0x49f622[_0xa54e('0xab')][_0xa54e('0x3e')],_0x49f622['device']['vendor'],_0x49f622[_0xa54e('0xab')][_0xa54e('0x4d')]):null,'deviceVendor':_0x49f622['device'][_0xa54e('0xac')],'deviceType':_0x49f622[_0xa54e('0xab')][_0xa54e('0x4d')],'formData':JSON[_0xa54e('0x21')](_0x2d90e5['body'])};var _0x488ffc={'ChatWebsiteId':_0x2d90e5[_0xa54e('0x55')]['id'],'closed':![]};if(_0x2d90e5['body'][_0xa54e('0xae')]){_0x488ffc[_0xa54e('0xae')]=_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xae')];return db[_0xa54e('0xaf')]['find']({'where':_0x488ffc})[_0xa54e('0x1b')](function(_0x1b0c96){if(_0x1b0c96){return[_0x1b0c96,![]];}_0x6e9e10[_0xa54e('0xae')]=_0x2d90e5[_0xa54e('0x59')]['threadId'];_0x6e9e10[_0xa54e('0xb0')]=_0x2d90e5['body'][_0xa54e('0xb0')];return db[_0xa54e('0xaf')]['create'](_0x6e9e10)[_0xa54e('0x1b')](function(_0x9dbcca){return[_0x9dbcca,!![]];});});}_0x488ffc[_0xa54e('0xb1')]=_0x20f66e['id'];if(_0x2d90e5['body'][_0xa54e('0xb2')]&&_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xb2')]['id']){_0x488ffc['id']=_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xb2')]['id'];return db[_0xa54e('0xaf')][_0xa54e('0x57')]({'where':_0x488ffc})[_0xa54e('0x1b')](function(_0x2549ed){if(_0x2549ed){return[_0x2549ed,![]];}return db[_0xa54e('0xaf')]['create'](_0x6e9e10)[_0xa54e('0x1b')](function(_0xfa333b){return[_0xfa333b,!![]];});});}return db[_0xa54e('0xaf')][_0xa54e('0x58')](_0x6e9e10)[_0xa54e('0x1b')](function(_0x2a4713){return[_0x2a4713,!![]];});}})[_0xa54e('0xb3')](function(_0x138032,_0x6c81d8){if(_0x138032){_0x21004a=_0x6c81d8;if(!_0x6c81d8){var _0x38e4ce={'from':(_0xa581c9[_0xa54e('0xa2')][_0xa54e('0xa3')]||'')+'\x20'+(_0xa581c9[_0xa54e('0xa2')]['lastName']||'')};if(_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xae')]&&_0x2d90e5[_0xa54e('0x59')][_0xa54e('0xb4')]&&_0x2d90e5[_0xa54e('0x59')]['threadId']!=_0x2d90e5[_0xa54e('0x59')]['messageId']){_0x38e4ce[_0xa54e('0xae')]=_0x2d90e5[_0xa54e('0x59')]['messageId'];}return _0x138032['update'](_0x38e4ce);}else{return _0x138032;}}})[_0xa54e('0x1b')](function(_0x3017c3){_0xa581c9['interaction']=_0x3017c3[_0xa54e('0x5a')]({'plain':!![]});_0xa581c9[_0xa54e('0xb2')][_0xa54e('0xb5')]=_0x21004a;if(_0xa581c9[_0xa54e('0xb2')][_0xa54e('0xb5')]){if(_0xa581c9[_0xa54e('0x99')][_0xa54e('0xb6')]){_0xa581c9[_0xa54e('0x9a')][_0xa54e('0xb7')]({'id':0x0,'priority':_0xa581c9[_0xa54e('0x9a')][_0xa54e('0x45')]+0x1,'app':_0xa54e('0xb8'),'appdata':_0xa54e('0xb9'),'interval':_0xa54e('0xba')});}}return db[_0xa54e('0xbb')][_0xa54e('0x58')]({'body':_0x2d90e5['body'][_0xa54e('0x59')],'ChatWebsiteId':_0x2d90e5[_0xa54e('0x55')]['id'],'ChatInteractionId':_0x3017c3['id'],'direction':'in','ContactId':_0xa581c9['contact']['id'],'AttachmentId':_0x2d90e5['body']['AttachmentId']});})['then'](function(_0x43c97e){_0xa581c9[_0xa54e('0x24')]=_0x43c97e;if(_0xa581c9[_0xa54e('0xb2')][_0xa54e('0xbc')]){return db[_0xa54e('0xbd')]['find']({'attributes':['id',_0xa54e('0x38')],'where':{'id':_0xa581c9['interaction']['UserId']}})[_0xa54e('0x1b')](function(_0x2dae6c){if(_0x2dae6c){_0xa581c9[_0xa54e('0x9a')][_0xa54e('0xbe')]({'id':0x0,'priority':0x0,'app':_0xa54e('0xbf'),'appdata':_0x2dae6c[_0xa54e('0x38')]+','+(_0xa581c9[_0xa54e('0x99')][_0xa54e('0xc0')]||0xa),'interval':_0xa54e('0xba')});_0xa581c9[_0xa54e('0xc1')]=!![];}return respondWithRpcPromise(_0xa54e('0xc2'),_0xa54e('0xc3'),_0xa581c9);});}return respondWithRpcPromise('Start',_0xa54e('0xc3'),_0xa581c9);})['then'](function(_0x59c666){respondWithRpcPromise(_0xa54e('0xc4'),_0xa54e('0xc4'),{'event':_0xa54e('0xc5'),'message':_0x59c666},client9002);return _0x59c666;})[_0xa54e('0x1b')](respondWithResult(_0x1269b6,null))['catch'](handleError(_0x1269b6,null));};exports[_0xa54e('0xc6')]=function(_0x1ccdc2,_0x2fae5c,_0x180951){var _0x8e5143,_0x4ad974,_0x9d450d;var _0x2e3775=[];var _0x342dea=[];var _0x35fd64={};return db[_0xa54e('0x89')][_0xa54e('0x61')]()[_0xa54e('0x1b')](function(_0x31ce86){if(!_0x31ce86){throw new db[(_0xa54e('0x8a'))]['ValidationError'](_0xa54e('0xc7'));}_0x342dea=_['difference'](_['keys'](_0x31ce86),[_0xa54e('0x8d'),_0xa54e('0x8e')]);_0x2e3775=_[_0xa54e('0x8c')](_[_0xa54e('0x3f')](_0x31ce86),[_0xa54e('0x8d'),_0xa54e('0x8e'),'CompanyId',_0xa54e('0x90')]);if(_0x1ccdc2[_0xa54e('0x59')]['id']){delete _0x1ccdc2[_0xa54e('0x59')]['id'];}if(_[_0xa54e('0x79')](_0x1ccdc2['body'][_0xa54e('0x91')])){throw _0x2fae5c[_0xa54e('0x28')](0x1f4)[_0xa54e('0x39')](new db['Sequelize'][(_0xa54e('0x8b'))](_0xa54e('0xc8')));}if(_['isNil'](_0x1ccdc2[_0xa54e('0x59')][_0xa54e('0x59')])||_0x1ccdc2[_0xa54e('0x59')][_0xa54e('0x59')]===''){throw _0x2fae5c[_0xa54e('0x28')](0x1f4)[_0xa54e('0x39')](new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x1ccdc2['body'][_0xa54e('0xc9')])){throw _0x2fae5c['status'](0x1f4)['send'](new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))](_0xa54e('0xca')+_0x2e3775));}if(!_[_0xa54e('0xcb')](_0x2e3775,_0x1ccdc2['body'][_0xa54e('0xc9')])){throw _0x2fae5c[_0xa54e('0x28')](0x1f4)['send'](new db[(_0xa54e('0x8a'))][(_0xa54e('0x8b'))](_0xa54e('0xcc')+_0x2e3775));}_0x35fd64[_0x1ccdc2['body'][_0xa54e('0xc9')]]=_0x1ccdc2[_0xa54e('0x59')]['from'];})[_0xa54e('0x1b')](function(){return db['ChatWebsite'][_0xa54e('0x57')]({'where':{'id':_0x1ccdc2[_0xa54e('0x55')]['id']},'include':[{'model':db[_0xa54e('0x96')],'as':'List'}]});})[_0xa54e('0x1b')](handleEntityNotFound(_0x2fae5c,null))[_0xa54e('0x1b')](function(_0x59a8a6){if(_0x59a8a6&&_0x59a8a6['List']){_0x4ad974=_0x59a8a6;var _0x116d5e=_[_0xa54e('0xa1')](_0x1ccdc2['body'],{'firstName':_0x1ccdc2[_0xa54e('0x59')]['from'],'phone':_0x1ccdc2[_0xa54e('0x59')][_0xa54e('0x91')],'ListId':_0x59a8a6[_0xa54e('0x90')]});_0x116d5e[_0x1ccdc2[_0xa54e('0x59')][_0xa54e('0xc9')]]=_0x1ccdc2[_0xa54e('0x59')][_0xa54e('0x91')];return db[_0xa54e('0x89')][_0xa54e('0xcd')]({'where':_0x35fd64,'defaults':_0x116d5e});}})['spread'](function(_0x13eb0d){if(_0x13eb0d){_0x9d450d=_0x13eb0d;var _0x3fb2f3=fs['readFileSync'](path[_0xa54e('0x7a')](config[_0xa54e('0x74')],_0xa54e('0xce')),'utf8');var _0x2e26a7=ejs[_0xa54e('0xcf')](_0x3fb2f3,{'body':_[_0xa54e('0xd0')](_0x1ccdc2['body'][_0xa54e('0x59')]),'bodyTitle':_0x4ad974[_0xa54e('0xd1')]});return db[_0xa54e('0xd2')][_0xa54e('0x58')]({'body':_0x2e26a7,'ContactId':_0x13eb0d['id'],'ChatWebsiteId':_0x4ad974['id']});}})[_0xa54e('0x1b')](function(_0x10317a){if(_0x10317a){_0x8e5143=_0x10317a;return db[_0xa54e('0xd3')][_0xa54e('0x64')]({'where':{'service':!![]},'include':[{'model':db[_0xa54e('0xd4')],'as':_0xa54e('0xd5'),'raw':!![]}]});}})['then'](function(_0x1c7c3b){if(_0x1c7c3b&&_0x1c7c3b[_0xa54e('0xd5')]&&_0x4ad974[_0xa54e('0xd6')]){var _0x389761={'tls':{'rejectUnauthorized':![]}};if(_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xd7')]){_0x389761[_0xa54e('0xd7')]=_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xd7')];}else{_0x389761[_0xa54e('0xd8')]=_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xd8')];_0x389761[_0xa54e('0xd9')]=_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xd9')];_0x389761['secure']=_0x1c7c3b['Smtp'][_0xa54e('0xda')];}if(_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xdb')]){_0x389761[_0xa54e('0xdc')]={'user':_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0x5c')],'pass':_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0xdd')]};}return respondWithRpcPromise(_0xa54e('0xde'),_0xa54e('0xdf'),{'account':_0x389761,'message':{'from':util[_0xa54e('0xa7')](_0xa54e('0xe0'),_0x1c7c3b[_0xa54e('0x38')],_0x1c7c3b['email']||_0x1c7c3b[_0xa54e('0xd5')][_0xa54e('0x5c')]),'to':_0x4ad974[_0xa54e('0xd6')],'subject':_0x4ad974[_0xa54e('0xe1')],'text':_0x8e5143[_0xa54e('0x59')]}},client9003)[_0xa54e('0x1b')](function(){return _0x8e5143;})['catch'](function(_0x3e879b){console[_0xa54e('0x22')](_0x3e879b);});}})['then'](function(){if(_0x8e5143){return _0x8e5143;}})[_0xa54e('0x1b')](respondWithResult(_0x2fae5c,null))[_0xa54e('0x26')](handleError(_0x2fae5c,null));};exports['addInteraction']=function(_0x506161,_0x35db6a,_0x530fe2){return db[_0xa54e('0xaf')]['find']({'where':{'id':_0x506161[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x35db6a,null))[_0xa54e('0x1b')](function(_0x4ff1c0){if(_0x4ff1c0){return _0x4ff1c0[_0xa54e('0xe2')](_0x506161[_0xa54e('0x59')][_0xa54e('0x6a')],_[_0xa54e('0xe3')](_0x506161[_0xa54e('0x59')],[_0xa54e('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x35db6a,null))[_0xa54e('0x26')](handleError(_0x35db6a,null));};exports[_0xa54e('0xe4')]=function(_0x4e80ff,_0x4d4c80,_0x3a371a){var _0x207c12={'raw':![],'where':{}};var _0x282752={};var _0x3c8aed={'count':0x0,'rows':[]};return db[_0xa54e('0x3c')][_0xa54e('0x64')]({'where':{'id':_0x4e80ff[_0xa54e('0x55')]['id']}})['then'](handleEntityNotFound(_0x4d4c80,null))[_0xa54e('0x1b')](function(_0xaf288e){if(_0xaf288e){_0x282752[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](db[_0xa54e('0xaf')][_0xa54e('0x3d')]);_0x282752[_0xa54e('0x40')]=_[_0xa54e('0x3f')](_0x4e80ff['query']);_0x282752[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x282752[_0xa54e('0x3e')],_0x282752[_0xa54e('0x40')]);_0x207c12['attributes']=_['intersection'](_0x282752[_0xa54e('0x3e')],qs[_0xa54e('0x44')](_0x4e80ff['query'][_0xa54e('0x44')]));_0x207c12[_0xa54e('0x43')]=_0x207c12[_0xa54e('0x43')][_0xa54e('0x45')]?_0x207c12[_0xa54e('0x43')]:_0x282752['model'];if(!_0x4e80ff[_0xa54e('0x40')]['hasOwnProperty'](_0xa54e('0x46'))){_0x207c12['limit']=qs[_0xa54e('0x2d')](_0x4e80ff[_0xa54e('0x40')]['limit']);_0x207c12['offset']=qs[_0xa54e('0x2c')](_0x4e80ff['query']['offset']);}_0x207c12[_0xa54e('0x47')]=qs[_0xa54e('0x48')](_0x4e80ff[_0xa54e('0x40')][_0xa54e('0x48')]);_0x207c12['where']=qs['filters'](_[_0xa54e('0x4a')](_0x4e80ff['query'],_0x282752[_0xa54e('0x41')]));_0x207c12['where']['ChatWebsiteId']=_0xaf288e['id'];if(_0x4e80ff['query'][_0xa54e('0x4b')]){_0x207c12[_0xa54e('0x49')]=_[_0xa54e('0x4f')](_0x207c12[_0xa54e('0x49')],{'$or':_[_0xa54e('0x4c')](_0x207c12['attributes'],function(_0x1cd90c){var _0x580191={};_0x580191[_0x1cd90c]={'$like':'%'+_0x4e80ff[_0xa54e('0x40')][_0xa54e('0x4b')]+'%'};return _0x580191;})});}_0x207c12=_[_0xa54e('0x4f')]({},_0x207c12,_0x4e80ff[_0xa54e('0x50')]);return db['ChatInteraction'][_0xa54e('0x2b')]({'where':_0x207c12[_0xa54e('0x49')]})[_0xa54e('0x1b')](function(_0x2dc252){_0x3c8aed[_0xa54e('0x2b')]=_0x2dc252;if(_0x4e80ff[_0xa54e('0x40')]['includeAll']){_0x207c12[_0xa54e('0x51')]=[{'model':db[_0xa54e('0x89')],'as':_0xa54e('0xe5'),'required':![]},{'model':db[_0xa54e('0xbd')],'as':'Owner','attributes':[_0xa54e('0x38'),_0xa54e('0xe6'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa54e('0x38'),_0xa54e('0xe7')],'where':_0x4e80ff['query']['tag']?{'id':_0x4e80ff[_0xa54e('0x40')][_0xa54e('0xe8')]}:undefined,'required':_0x4e80ff['query'][_0xa54e('0xe8')]?!![]:![]}];}return db[_0xa54e('0xaf')]['findAll'](_0x207c12);})[_0xa54e('0x1b')](function(_0x805085){_0x3c8aed[_0xa54e('0x53')]=_0x805085;return _0x3c8aed;});}})[_0xa54e('0x1b')](respondWithFilteredResult(_0x4d4c80,_0x207c12))[_0xa54e('0x26')](handleError(_0x4d4c80,null));};function iftimePromise(_0x302057,_0x3efc33){return respondWithRpcPromise(_0xa54e('0xe9'),_0xa54e('0xea'),{'command':_0x3efc33[_0xa54e('0xeb')]?util[_0xa54e('0xa7')]('iftime\x20%s,%s',_0x302057[_0xa54e('0xec')],_0x3efc33[_0xa54e('0xeb')]):util[_0xa54e('0xa7')]('iftime\x20%s',_0x302057[_0xa54e('0xec')])},client9002)[_0xa54e('0x1b')](function(_0x4789c9){var _0x421a7c=_0x4789c9&&_0x4789c9[_0xa54e('0xed')](_0xa54e('0xee'))>=0x0?!![]:![];logger[_0xa54e('0x1c')](_0xa54e('0xef'),_0x3efc33['id'],_0x302057['id'],_0x302057[_0xa54e('0xec')],_0x421a7c?_0xa54e('0xf0'):_0xa54e('0xf1'),_0x3efc33['timezone']?_0x3efc33[_0xa54e('0xeb')]:_0xa54e('0xf2'));return _0x421a7c;})[_0xa54e('0x26')](function(_0x252219){logger[_0xa54e('0x22')](_0xa54e('0xef'),_0x3efc33['id'],_0x302057['id'],_0x302057[_0xa54e('0xec')],util[_0xa54e('0xf3')](_0x252219,{'showHidden':![],'depth':null}),_0x3efc33[_0xa54e('0xeb')]?_0x3efc33[_0xa54e('0xeb')]:'No\x20timezone');return![];});}exports[_0xa54e('0xea')]=function(_0x44f061,_0x9b6968,_0x44f8c9){var _0x56fedd=0x0;var _0x509158=0x0;var _0x44a5b7=![];var _0x14e142;var _0x135f56;return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0x44f061[_0xa54e('0x55')]['id']},'include':[{'model':db[_0xa54e('0xf4')],'as':_0xa54e('0xf4'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xa54e('0xec')],'raw':!![]}]}]})[_0xa54e('0x1b')](handleEntityNotFound(_0x9b6968,null))['then'](function(_0x1613a3){if(_0x1613a3){_0x14e142=_0x1613a3;return _0x1613a3[_0xa54e('0xf5')]({'raw':!![]});}})[_0xa54e('0x1b')](function(_0x318a0e){if(_0x14e142){if(_0x318a0e){_0x135f56=_0x318a0e;}}return require(_0xa54e('0x76'))['getLicense']();})['then'](function(_0x4b6a13){if(_0x4b6a13){_0x509158=_0x4b6a13[_0xa54e('0xf6')];_0x44a5b7=_0x4b6a13[_0xa54e('0x78')];}})[_0xa54e('0x1b')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x5cb831){_0x56fedd=_0x5cb831;if(_0x509158&&_0x5cb831>_0x509158){return db[_0xa54e('0xf7')]['findOne']({'where':{'id':0x1}})[_0xa54e('0x1b')](function(_0x322e22){if(_0x322e22){_0x322e22['increment'](_0xa54e('0xf8'));}});}})['then'](function(){if(_0x14e142['Interval']&&_0x14e142[_0xa54e('0xf4')][_0xa54e('0xf9')]){var _0x382239=[];for(var _0x248a1e=0x0;_0x248a1e<_0x14e142[_0xa54e('0xf4')][_0xa54e('0xf9')]['length'];_0x248a1e++){var _0x32c6b1=_0x14e142[_0xa54e('0xf4')][_0xa54e('0xf9')][_0x248a1e][_0xa54e('0x5a')]({'plain':!![]});_0x382239[_0xa54e('0xb7')](iftimePromise(_0x32c6b1,_0x14e142));}return BPromise['all'](_0x382239)[_0xa54e('0x1b')](function(_0x137382){return _[_0xa54e('0xfa')](_0x137382);});}else{return!![];}})[_0xa54e('0x1b')](function(_0x24593c){var _0x281780=fs[_0xa54e('0xfb')](path[_0xa54e('0x7a')](config['root'],_0xa54e('0xfc')),_0xa54e('0xfd'));var _0x296e31={'remote':_0x14e142[_0xa54e('0xfe')],'query':querystring['stringify'](_[_0xa54e('0x4f')](_0x14e142['get']({'plain':!![]}),{'customerIp':_0x44f061['headers'][_0xa54e('0xff')]||_0x44f061[_0xa54e('0x85')][_0xa54e('0x100')]||_0x44f061[_0xa54e('0x101')][_0xa54e('0x102')]||_0x44f061['ip'],'referer':_0x44f061[_0xa54e('0x85')][_0xa54e('0xa5')],'openedInteractions':_0x56fedd,'maxInteractions':_0x509158,'virtual':_0x44a5b7[_0xa54e('0xf6')],'online':_0x24593c,'custom':_0x44a5b7}))[_0xa54e('0x103')](/'/g,'\x5c\x27')};_0x9b6968[_0xa54e('0x39')](ejs[_0xa54e('0xcf')](Mustache['render'](_0x281780,_0x296e31),{'proactiveActions':_0x135f56,'alignment':_0x14e142[_0xa54e('0x104')],'verticalAlignment':_0x14e142[_0xa54e('0x105')]}));})[_0xa54e('0x26')](handleError(_0x9b6968,null));};exports[_0xa54e('0x106')]=function(_0x32e6f9,_0x5db750,_0x32b57a){return db[_0xa54e('0x3c')][_0xa54e('0x64')]({'where':{'id':_0x32e6f9[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x5db750,null))[_0xa54e('0x1b')](function(_0x28021b){if(_0x28021b){return db[_0xa54e('0x107')][_0xa54e('0x108')](function(_0x5648b7){return db[_0xa54e('0x109')][_0xa54e('0x34')]({'where':{'ChatWebsiteId':_0x32e6f9[_0xa54e('0x55')]['id']},'transaction':_0x5648b7})[_0xa54e('0x1b')](function(_0x4fc34a){var _0x401bd7=_[_0xa54e('0x4c')](_0x32e6f9[_0xa54e('0x59')],function(_0x296cf8){_0x296cf8[_0xa54e('0x66')]=_0x32e6f9[_0xa54e('0x55')]['id'];return _0x296cf8;});return db['ChatApplication'][_0xa54e('0x10a')](_0x401bd7,{'transaction':_0x5648b7});});})[_0xa54e('0x1b')](function(){return db['ChatApplication'][_0xa54e('0x10b')]({'where':{'ChatWebsiteId':_0x32e6f9[_0xa54e('0x55')]['id']},'order':'priority'});});}})[_0xa54e('0x1b')](respondWithResult(_0x5db750,null))[_0xa54e('0x26')](handleError(_0x5db750,null));};exports[_0xa54e('0x10c')]=function(_0x6de73d,_0x1940cf,_0xd3b975){var _0x275327={};var _0x11a558={};var _0x152c40;var _0x544484;return db[_0xa54e('0x3c')]['findOne']({'where':{'id':_0x6de73d[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x1940cf,null))['then'](function(_0x3ce205){if(_0x3ce205){_0x152c40=_0x3ce205;_0x11a558[_0xa54e('0x3e')]=_[_0xa54e('0x3f')](db[_0xa54e('0x109')][_0xa54e('0x3d')]);_0x11a558['query']=_[_0xa54e('0x3f')](_0x6de73d[_0xa54e('0x40')]);_0x11a558[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x11a558[_0xa54e('0x3e')],_0x11a558[_0xa54e('0x40')]);_0x275327['attributes']=_[_0xa54e('0x42')](_0x11a558[_0xa54e('0x3e')],qs[_0xa54e('0x44')](_0x6de73d[_0xa54e('0x40')]['fields']));_0x275327[_0xa54e('0x43')]=_0x275327[_0xa54e('0x43')][_0xa54e('0x45')]?_0x275327[_0xa54e('0x43')]:_0x11a558[_0xa54e('0x3e')];_0x275327['order']=qs['sort'](_0x6de73d[_0xa54e('0x40')]['sort']);_0x275327[_0xa54e('0x49')]=qs['filters'](_[_0xa54e('0x4a')](_0x6de73d['query'],_0x11a558[_0xa54e('0x41')]));if(_0x6de73d[_0xa54e('0x40')][_0xa54e('0x4b')]){_0x275327[_0xa54e('0x49')]=_[_0xa54e('0x4f')](_0x275327[_0xa54e('0x49')],{'$or':_['map'](_0x275327[_0xa54e('0x43')],function(_0x530acf){var _0x2704b3={};_0x2704b3[_0x530acf]={'$like':'%'+_0x6de73d['query'][_0xa54e('0x4b')]+'%'};return _0x2704b3;})});}_0x275327=_[_0xa54e('0x4f')]({},_0x275327,_0x6de73d[_0xa54e('0x50')]);return _0x152c40['getApplications'](_0x275327);}})[_0xa54e('0x1b')](function(_0x596553){if(_0x596553){_0x544484=_0x596553[_0xa54e('0x45')];if(!_0x6de73d[_0xa54e('0x40')]['hasOwnProperty'](_0xa54e('0x46'))){_0x275327['limit']=qs[_0xa54e('0x2d')](_0x6de73d[_0xa54e('0x40')][_0xa54e('0x2d')]);_0x275327[_0xa54e('0x2c')]=qs[_0xa54e('0x2c')](_0x6de73d['query'][_0xa54e('0x2c')]);}return _0x152c40[_0xa54e('0x10c')](_0x275327);}})[_0xa54e('0x1b')](function(_0xe53355){if(_0xe53355){return _0xe53355?{'count':_0x544484,'rows':_0xe53355}:null;}})['then'](respondWithResult(_0x1940cf,null))[_0xa54e('0x26')](handleError(_0x1940cf,null));};exports['addProactiveActions']=function(_0x3de1aa,_0x1d0231,_0x2246f3){return db[_0xa54e('0x10d')][_0xa54e('0x57')]({'where':{'id':_0x3de1aa[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x1d0231,null))[_0xa54e('0x1b')](function(_0x32efe4){if(_0x32efe4){return _0x32efe4[_0xa54e('0x10e')](_0x3de1aa['body'][_0xa54e('0x6a')],_['omit'](_0x3de1aa[_0xa54e('0x59')],[_0xa54e('0x6a'),'id'])||{});}})[_0xa54e('0x1b')](respondWithResult(_0x1d0231,null))[_0xa54e('0x26')](handleError(_0x1d0231,null));};exports[_0xa54e('0xf5')]=function(_0x5305f7,_0x3b8290,_0xd2c8cf){var _0x51033e={};var _0x8bc287={};var _0x129563;var _0x4c4a24;return db[_0xa54e('0x3c')][_0xa54e('0x64')]({'where':{'id':_0x5305f7[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x3b8290,null))[_0xa54e('0x1b')](function(_0x2edd87){if(_0x2edd87){_0x129563=_0x2edd87;_0x8bc287[_0xa54e('0x3e')]=_['keys'](db[_0xa54e('0x10f')]['rawAttributes']);_0x8bc287['query']=_[_0xa54e('0x3f')](_0x5305f7[_0xa54e('0x40')]);_0x8bc287[_0xa54e('0x41')]=_['intersection'](_0x8bc287['model'],_0x8bc287[_0xa54e('0x40')]);_0x51033e[_0xa54e('0x43')]=_['intersection'](_0x8bc287['model'],qs['fields'](_0x5305f7[_0xa54e('0x40')][_0xa54e('0x44')]));_0x51033e['attributes']=_0x51033e[_0xa54e('0x43')][_0xa54e('0x45')]?_0x51033e[_0xa54e('0x43')]:_0x8bc287[_0xa54e('0x3e')];_0x51033e[_0xa54e('0x47')]=qs[_0xa54e('0x48')](_0x5305f7[_0xa54e('0x40')][_0xa54e('0x48')]);_0x51033e[_0xa54e('0x49')]=qs[_0xa54e('0x41')](_['pick'](_0x5305f7['query'],_0x8bc287[_0xa54e('0x41')]));if(_0x5305f7[_0xa54e('0x40')][_0xa54e('0x4b')]){_0x51033e['where']=_[_0xa54e('0x4f')](_0x51033e['where'],{'$or':_['map'](_0x51033e[_0xa54e('0x43')],function(_0x10a3ab){var _0x3ab0c6={};_0x3ab0c6[_0x10a3ab]={'$like':'%'+_0x5305f7[_0xa54e('0x40')][_0xa54e('0x4b')]+'%'};return _0x3ab0c6;})});}_0x51033e=_['merge']({},_0x51033e,_0x5305f7['options']);return _0x129563['getProactiveActions'](_0x51033e);}})[_0xa54e('0x1b')](function(_0x3e5242){if(_0x3e5242){_0x4c4a24=_0x3e5242[_0xa54e('0x45')];if(!_0x5305f7['query'][_0xa54e('0x65')](_0xa54e('0x46'))){_0x51033e['limit']=qs[_0xa54e('0x2d')](_0x5305f7['query'][_0xa54e('0x2d')]);_0x51033e[_0xa54e('0x2c')]=qs[_0xa54e('0x2c')](_0x5305f7['query'][_0xa54e('0x2c')]);}return _0x129563['getProactiveActions'](_0x51033e);}})[_0xa54e('0x1b')](function(_0x188b9e){if(_0x188b9e){return _0x188b9e?{'count':_0x4c4a24,'rows':_0x188b9e}:null;}})['then'](respondWithResult(_0x3b8290,null))[_0xa54e('0x26')](handleError(_0x3b8290,null));};exports['getFields']=function(_0xa1ae52,_0x103672,_0x321b15){var _0x3abdb2=_0xa1ae52[_0xa54e('0x40')]['online']===_0xa54e('0x110')?_0xa54e('0x111'):_0xa54e('0x112');return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'attributes':['id',_0x3abdb2],'where':{'id':_0xa1ae52[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x103672,null))[_0xa54e('0x1b')](function(_0x62340d){if(_0x62340d){var _0x4f1ad6=_0x62340d[_0x3abdb2];var _0x3bc60f=_0x4f1ad6&&_0x4f1ad6[_0xa54e('0x113')]?_0x4f1ad6['items']:[];_0x103672[_0xa54e('0x39')]({'fromKey':_['isNil'](_0x4f1ad6[_0xa54e('0x114')])?undefined:_0x4f1ad6[_0xa54e('0x114')],'count':_0x3bc60f[_0xa54e('0x45')],'rows':_0x3bc60f});}})[_0xa54e('0x26')](handleError(_0x103672,null));};exports[_0xa54e('0x115')]=function(_0xc49910,_0x251681,_0x91fc0a){var _0x2ca056={'raw':!![],'where':{}};var _0x294a72={};var _0x5cf4d3={'count':0x0,'rows':[]};return db[_0xa54e('0x3c')][_0xa54e('0x64')]({'where':{'id':_0xc49910['params']['id']}})['then'](handleEntityNotFound(_0x251681,null))[_0xa54e('0x1b')](function(_0x216e72){if(_0x216e72){_0x294a72['model']=_['keys'](db['ChatOfflineMessage'][_0xa54e('0x3d')]);_0x294a72[_0xa54e('0x40')]=_['keys'](_0xc49910[_0xa54e('0x40')]);_0x294a72[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x294a72['model'],_0x294a72['query']);_0x2ca056[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x294a72['model'],qs['fields'](_0xc49910[_0xa54e('0x40')][_0xa54e('0x44')]));_0x2ca056[_0xa54e('0x43')]=_0x2ca056['attributes']['length']?_0x2ca056['attributes']:_0x294a72['model'];if(!_0xc49910[_0xa54e('0x40')][_0xa54e('0x65')]('nolimit')){_0x2ca056[_0xa54e('0x2d')]=qs['limit'](_0xc49910[_0xa54e('0x40')]['limit']);_0x2ca056[_0xa54e('0x2c')]=qs['offset'](_0xc49910[_0xa54e('0x40')][_0xa54e('0x2c')]);}_0x2ca056[_0xa54e('0x47')]=qs[_0xa54e('0x48')](_0xc49910[_0xa54e('0x40')]['sort']);_0x2ca056[_0xa54e('0x49')]=qs[_0xa54e('0x41')](_[_0xa54e('0x4a')](_0xc49910[_0xa54e('0x40')],_0x294a72[_0xa54e('0x41')]));_0x2ca056[_0xa54e('0x49')]['ChatWebsiteId']=_0x216e72['id'];if(_0xc49910['query'][_0xa54e('0x4b')]){_0x2ca056['where']=_[_0xa54e('0x4f')](_0x2ca056['where'],{'$or':_[_0xa54e('0x4c')](_0x2ca056['attributes'],function(_0x4b82e3){var _0x47a011={};_0x47a011[_0x4b82e3]={'$like':'%'+_0xc49910[_0xa54e('0x40')][_0xa54e('0x4b')]+'%'};return _0x47a011;})});}_0x2ca056=_[_0xa54e('0x4f')]({},_0x2ca056,_0xc49910['options']);return db[_0xa54e('0xd2')]['count']({'where':_0x2ca056[_0xa54e('0x49')]})[_0xa54e('0x1b')](function(_0x56f6f2){_0x5cf4d3[_0xa54e('0x2b')]=_0x56f6f2;if(_0xc49910[_0xa54e('0x40')][_0xa54e('0x56')]){_0x2ca056['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xa54e('0x52')](_0x2ca056);})[_0xa54e('0x1b')](function(_0x459f2f){_0x5cf4d3[_0xa54e('0x53')]=_0x459f2f;return _0x5cf4d3;});}})[_0xa54e('0x1b')](respondWithFilteredResult(_0x251681,_0x2ca056))[_0xa54e('0x26')](handleError(_0x251681,null));};exports[_0xa54e('0x116')]=function(_0xb705ca,_0x371227,_0xbe27b0){return db[_0xa54e('0x3c')][_0xa54e('0x57')]({'where':{'id':_0xb705ca[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x371227,null))[_0xa54e('0x1b')](function(_0x33e47d){if(_0x33e47d){return _0x33e47d[_0xa54e('0x116')](_0xb705ca[_0xa54e('0x59')]['ids'],_['omit'](_0xb705ca[_0xa54e('0x59')],[_0xa54e('0x6a'),'id'])||{})['spread'](function(_0x437dbd){for(var _0x39d3b1=0x0;_0x39d3b1<_0xb705ca[_0xa54e('0x59')]['ids'][_0xa54e('0x45')];_0x39d3b1+=0x1){socket[_0xa54e('0x117')](_0xa54e('0x118'),{'UserId':_0xb705ca['body'][_0xa54e('0x6a')][_0x39d3b1],'ChatWebsiteId':_0xb705ca['params']['id']});}return _0x437dbd;});}})[_0xa54e('0x1b')](respondWithResult(_0x371227,null))[_0xa54e('0x26')](handleError(_0x371227,null));};exports[_0xa54e('0x119')]=function(_0x2c46b9,_0x365fba,_0x523a5c){return db['ChatWebsite'][_0xa54e('0x57')]({'where':{'id':_0x2c46b9[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x365fba,null))[_0xa54e('0x1b')](function(_0x479da7){if(_0x479da7){return _0x479da7[_0xa54e('0x119')](_0x2c46b9[_0xa54e('0x40')]['ids'])[_0xa54e('0x1b')](function(){if(_[_0xa54e('0x11a')](_0x2c46b9[_0xa54e('0x40')][_0xa54e('0x6a')])){for(var _0x44e2a4=0x0;_0x44e2a4<_0x2c46b9[_0xa54e('0x40')][_0xa54e('0x6a')]['length'];_0x44e2a4+=0x1){socket[_0xa54e('0x117')](_0xa54e('0x11b'),{'UserId':Number(_0x2c46b9[_0xa54e('0x40')][_0xa54e('0x6a')][_0x44e2a4]),'ChatWebsiteId':Number(_0x2c46b9[_0xa54e('0x55')]['id'])});}}else{socket[_0xa54e('0x117')](_0xa54e('0x11b'),{'UserId':Number(_0x2c46b9[_0xa54e('0x40')][_0xa54e('0x6a')]),'ChatWebsiteId':Number(_0x2c46b9[_0xa54e('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x365fba,null))[_0xa54e('0x26')](handleError(_0x365fba,null));};exports[_0xa54e('0x11c')]=function(_0x311a1c,_0x5d1a8e,_0x3a934c){var _0x2153cb={};var _0x365a39={};var _0x223d7e;var _0x3cc016;return db[_0xa54e('0x3c')][_0xa54e('0x64')]({'where':{'id':_0x311a1c[_0xa54e('0x55')]['id']}})[_0xa54e('0x1b')](handleEntityNotFound(_0x5d1a8e,null))[_0xa54e('0x1b')](function(_0x220baf){if(_0x220baf){_0x223d7e=_0x220baf;_0x365a39[_0xa54e('0x3e')]=_['keys'](db['User']['rawAttributes']);_0x365a39[_0xa54e('0x40')]=_['keys'](_0x311a1c[_0xa54e('0x40')]);_0x365a39[_0xa54e('0x41')]=_[_0xa54e('0x42')](_0x365a39[_0xa54e('0x3e')],_0x365a39[_0xa54e('0x40')]);_0x2153cb[_0xa54e('0x43')]=_[_0xa54e('0x42')](_0x365a39[_0xa54e('0x3e')],qs[_0xa54e('0x44')](_0x311a1c[_0xa54e('0x40')][_0xa54e('0x44')]));_0x2153cb['attributes']=_0x2153cb[_0xa54e('0x43')][_0xa54e('0x45')]?_0x2153cb[_0xa54e('0x43')]:_0x365a39[_0xa54e('0x3e')];_0x2153cb[_0xa54e('0x47')]=qs[_0xa54e('0x48')](_0x311a1c['query'][_0xa54e('0x48')]);_0x2153cb['where']=qs['filters'](_[_0xa54e('0x4a')](_0x311a1c[_0xa54e('0x40')],_0x365a39[_0xa54e('0x41')]));if(_0x311a1c['query'][_0xa54e('0x4b')]){_0x2153cb[_0xa54e('0x49')]=_[_0xa54e('0x4f')](_0x2153cb[_0xa54e('0x49')],{'$or':_[_0xa54e('0x4c')](_0x2153cb[_0xa54e('0x43')],function(_0x51f9e4){var _0x49d988={};_0x49d988[_0x51f9e4]={'$like':'%'+_0x311a1c['query'][_0xa54e('0x4b')]+'%'};return _0x49d988;})});}_0x2153cb=_['merge']({},_0x2153cb,_0x311a1c[_0xa54e('0x50')]);return _0x223d7e[_0xa54e('0x11c')](_0x2153cb);}})['then'](function(_0x4d3f34){if(_0x4d3f34){_0x3cc016=_0x4d3f34[_0xa54e('0x45')];if(!_0x311a1c[_0xa54e('0x40')][_0xa54e('0x65')]('nolimit')){_0x2153cb[_0xa54e('0x2d')]=qs[_0xa54e('0x2d')](_0x311a1c['query'][_0xa54e('0x2d')]);_0x2153cb[_0xa54e('0x2c')]=qs[_0xa54e('0x2c')](_0x311a1c[_0xa54e('0x40')][_0xa54e('0x2c')]);}return _0x223d7e[_0xa54e('0x11c')](_0x2153cb);}})['then'](function(_0x120c42){if(_0x120c42){return _0x120c42?{'count':_0x3cc016,'rows':_0x120c42}:null;}})[_0xa54e('0x1b')](respondWithResult(_0x5d1a8e,null))[_0xa54e('0x26')](handleError(_0x5d1a8e,null));}; \ No newline at end of file +var _0xedbf=['../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','ChatWebsite','includeAll','include','findAll','rows','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addLogo','sitepic','agentAvatar','file','filename','addCustomerAvatar','systemAvatar','getLogo','join','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','sendMail','email','offlineMessageSubject','addInteraction','Contact','User','internal','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','Interval','Intervals','virtual','increment','all','some','server/files/chat/iframe.js','remote','headers','x-forwarded-for','x-real-ip','connection','replace','verticalAlignment','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','online','false','items','fromKey','getOfflineMessages','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0xedbf,0x103));var _0xfedb=function(_0x462150,_0x48ac37){_0x462150=_0x462150-0x0;var _0x28a15c=_0xedbf[_0x462150];return _0x28a15c;};'use strict';var pdf=require(_0xfedb('0x0'));var emlformat=require(_0xfedb('0x1'));var rimraf=require(_0xfedb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfedb('0x3'));var rp=require('request-promise');var moment=require(_0xfedb('0x4'));var BPromise=require(_0xfedb('0x5'));var Mustache=require(_0xfedb('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfedb('0x7'));var csv=require('to-csv');var ejs=require(_0xfedb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfedb('0x9'));var toCsv=require(_0xfedb('0xa'));var querystring=require(_0xfedb('0xb'));var Papa=require(_0xfedb('0xc'));var Redis=require(_0xfedb('0xd'));var authService=require(_0xfedb('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfedb('0xf'));var logger=require(_0xfedb('0x10'))(_0xfedb('0x11'));var utils=require(_0xfedb('0x12'));var config=require('../../config/environment');var db=require(_0xfedb('0x13'))['db'];config[_0xfedb('0x14')]=_[_0xfedb('0x15')](config[_0xfedb('0x14')],{'host':_0xfedb('0x16'),'port':0x18eb});var socket=require(_0xfedb('0x17'))(new Redis(config[_0xfedb('0x14')]));require('./chatWebsite.socket')[_0xfedb('0x18')](socket);var jayson=require(_0xfedb('0x19'));var client=jayson[_0xfedb('0x1a')][_0xfedb('0x1b')]({'port':0x232c});var client9002=jayson[_0xfedb('0x1a')][_0xfedb('0x1b')]({'port':0x232a});var client9003=jayson[_0xfedb('0x1a')][_0xfedb('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x5d7934,_0x22f0d1,_0x476f8c){if(_0x476f8c){var _0x4a3643=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a3643[_0xfedb('0x1c')](_0x22f0d1)){return _0x5d7934;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d7934;}}function respondWithRpcPromise(_0x749ab0,_0x22bf6e,_0x4da996,_0x1f286e){return new BPromise(function(_0x148435,_0x338468){var _0x3cef4b=_0x1f286e||client;return _0x3cef4b[_0xfedb('0x1d')](_0x749ab0,_0x4da996)[_0xfedb('0x1e')](function(_0x246081){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x22bf6e,_0xfedb('0x1f'));logger[_0xfedb('0x20')](_0xfedb('0x21'),_0x22bf6e,_0xfedb('0x1f'),JSON[_0xfedb('0x22')](_0x246081));if(_0x246081[_0xfedb('0x23')]){if(_0x246081['error'][_0xfedb('0x24')]===0x1f4){logger[_0xfedb('0x23')](_0xfedb('0x25'),_0x22bf6e,_0x246081['error']['message']);return _0x338468(_0x246081['error']['message']);}logger[_0xfedb('0x23')](_0xfedb('0x25'),_0x22bf6e,_0x246081[_0xfedb('0x23')][_0xfedb('0x26')]);return _0x148435(_0x246081[_0xfedb('0x23')][_0xfedb('0x26')]);}else{logger['info'](_0xfedb('0x25'),_0x22bf6e,_0xfedb('0x1f'));_0x148435(_0x246081[_0xfedb('0x27')][_0xfedb('0x26')]);}})[_0xfedb('0x28')](function(_0x47a0ea){logger[_0xfedb('0x23')](_0xfedb('0x25'),_0x22bf6e,_0x47a0ea);_0x338468(_0x47a0ea);});});}function respondWithStatusCode(_0x2e7506,_0x34b987){_0x34b987=_0x34b987||0xcc;return function(_0x38ea43){if(_0x38ea43){return _0x2e7506[_0xfedb('0x29')](_0x34b987);}return _0x2e7506[_0xfedb('0x2a')](_0x34b987)[_0xfedb('0x2b')]();};}function respondWithResult(_0x21333a,_0x55b826){_0x55b826=_0x55b826||0xc8;return function(_0x3cae66){if(_0x3cae66){return _0x21333a[_0xfedb('0x2a')](_0x55b826)[_0xfedb('0x2c')](_0x3cae66);}};}function respondWithFilteredResult(_0x339f60,_0x1a9cf8){return function(_0x543744){if(_0x543744){var _0x3f0461=_0x543744[_0xfedb('0x2d')],_0x5cfec0=_0x1a9cf8[_0xfedb('0x2e')],_0x1159ee=_0x1a9cf8[_0xfedb('0x2e')]+_0x1a9cf8[_0xfedb('0x2f')],_0x1c1158;if(_0x1159ee>=_0x3f0461){_0x1159ee=_0x3f0461;_0x1c1158=0xc8;}else{_0x1c1158=0xce;}_0x339f60[_0xfedb('0x2a')](_0x1c1158);return _0x339f60[_0xfedb('0x30')](_0xfedb('0x31'),_0x5cfec0+'-'+_0x1159ee+'/'+_0x3f0461)[_0xfedb('0x2c')](_0x543744);}return null;};}function patchUpdates(_0x59376e){return function(_0x55fc09){try{jsonpatch['apply'](_0x55fc09,_0x59376e,!![]);}catch(_0x4bd39d){return BPromise[_0xfedb('0x32')](_0x4bd39d);}return _0x55fc09[_0xfedb('0x33')]();};}function saveUpdates(_0x46d2c8,_0x15c9a5){return function(_0x3c81c0){if(_0x3c81c0){return _0x3c81c0[_0xfedb('0x34')](_0x46d2c8)[_0xfedb('0x1e')](function(_0x20d8c6){return _0x20d8c6;});}return null;};}function removeEntity(_0x2e8956,_0x2d3d1d){return function(_0x3137ed){if(_0x3137ed){return _0x3137ed[_0xfedb('0x35')]()[_0xfedb('0x1e')](function(){var _0x18535d=_0x3137ed[_0xfedb('0x36')]({'plain':!![]});var _0x46aa3f=_0xfedb('0x37');return db[_0xfedb('0x38')]['destroy']({'where':{'type':_0x46aa3f,'resourceId':_0x18535d['id']}})['then'](function(){return _0x3137ed;});})[_0xfedb('0x1e')](function(){_0x2e8956[_0xfedb('0x2a')](0xcc)[_0xfedb('0x2b')]();});}};}function handleEntityNotFound(_0x4fe75e,_0x50b85c){return function(_0x12cb93){if(!_0x12cb93){_0x4fe75e[_0xfedb('0x29')](0x194);}return _0x12cb93;};}function handleError(_0x58055c,_0x35b3c1){_0x35b3c1=_0x35b3c1||0x1f4;return function(_0x28b3a0){logger[_0xfedb('0x23')](_0x28b3a0[_0xfedb('0x39')]);if(_0x28b3a0[_0xfedb('0x3a')]){delete _0x28b3a0['name'];}_0x58055c['status'](_0x35b3c1)['send'](_0x28b3a0);};}exports[_0xfedb('0x3b')]=function(_0x93f3b3,_0x19e137){var _0x4dea25={'include':[{'model':db[_0xfedb('0x3c')],'as':_0xfedb('0x3d')}]},_0x321ae8={},_0x3a3238={'count':0x0,'rows':[]};var _0x593321=db['ChatWebsite'][_0xfedb('0x3e')];_0x321ae8[_0xfedb('0x3f')]=_['keys'](_0x593321);_0x321ae8[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x93f3b3[_0xfedb('0x40')]);_0x321ae8['filters']=_[_0xfedb('0x42')](_0x321ae8[_0xfedb('0x3f')],_0x321ae8[_0xfedb('0x40')]);_0x4dea25[_0xfedb('0x43')]=_[_0xfedb('0x42')](_0x321ae8[_0xfedb('0x3f')],qs['fields'](_0x93f3b3['query'][_0xfedb('0x44')]));_0x4dea25['attributes']=_0x4dea25[_0xfedb('0x43')][_0xfedb('0x45')]?_0x4dea25[_0xfedb('0x43')]:_0x321ae8[_0xfedb('0x3f')];if(!_0x93f3b3[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0x4dea25[_0xfedb('0x2f')]=qs['limit'](_0x93f3b3[_0xfedb('0x40')][_0xfedb('0x2f')]);_0x4dea25[_0xfedb('0x2e')]=qs[_0xfedb('0x2e')](_0x93f3b3['query']['offset']);}_0x4dea25[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x93f3b3[_0xfedb('0x40')]['sort']);_0x4dea25[_0xfedb('0x4a')]=qs[_0xfedb('0x4b')](_['pick'](_0x93f3b3[_0xfedb('0x40')],_0x321ae8['filters']));if(_0x93f3b3['query'][_0xfedb('0x4c')]){_0x4dea25[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0x4dea25[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x593321,function(_0x2723e4){if(_0x2723e4[_0xfedb('0x4f')][_0xfedb('0x50')]!==_0xfedb('0x51')){var _0x5a4472={};_0x5a4472[_0x2723e4[_0xfedb('0x52')]]={'$like':'%'+_0x93f3b3['query'][_0xfedb('0x4c')]+'%'};return _0x5a4472;}})});}_0x4dea25=_[_0xfedb('0x4d')]({},_0x4dea25,_0x93f3b3[_0xfedb('0x53')]);var _0x1f9c9a={'where':_0x4dea25[_0xfedb('0x4a')]};return db[_0xfedb('0x54')][_0xfedb('0x2d')](_0x1f9c9a)[_0xfedb('0x1e')](function(_0x306415){_0x3a3238['count']=_0x306415;if(_0x93f3b3[_0xfedb('0x40')][_0xfedb('0x55')]){_0x4dea25[_0xfedb('0x56')]=[{'all':!![]}];}return db[_0xfedb('0x54')][_0xfedb('0x57')](_0x4dea25);})[_0xfedb('0x1e')](function(_0x598f29){_0x3a3238[_0xfedb('0x58')]=_0x598f29;return _0x3a3238;})['then'](respondWithFilteredResult(_0x19e137,_0x4dea25))[_0xfedb('0x28')](handleError(_0x19e137,null));};exports[_0xfedb('0x59')]=function(_0x1640cb,_0x19850d){var _0x343e8a={'raw':![],'where':{'id':_0x1640cb[_0xfedb('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2a376b={};_0x2a376b['model']=_[_0xfedb('0x41')](db[_0xfedb('0x54')][_0xfedb('0x3e')]);_0x2a376b[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x1640cb[_0xfedb('0x40')]);_0x2a376b['filters']=_[_0xfedb('0x42')](_0x2a376b[_0xfedb('0x3f')],_0x2a376b[_0xfedb('0x40')]);_0x343e8a[_0xfedb('0x43')]=_['intersection'](_0x2a376b[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x1640cb[_0xfedb('0x40')]['fields']));_0x343e8a[_0xfedb('0x43')]=_0x343e8a['attributes'][_0xfedb('0x45')]?_0x343e8a[_0xfedb('0x43')]:_0x2a376b[_0xfedb('0x3f')];if(_0x1640cb['query'][_0xfedb('0x55')]){_0x343e8a[_0xfedb('0x56')]=[{'all':!![]}];}_0x343e8a=_[_0xfedb('0x4d')]({},_0x343e8a,_0x1640cb[_0xfedb('0x53')]);return db[_0xfedb('0x54')]['find'](_0x343e8a)['then'](handleEntityNotFound(_0x19850d,null))[_0xfedb('0x1e')](respondWithResult(_0x19850d,null))[_0xfedb('0x28')](handleError(_0x19850d,null));};exports['create']=function(_0x678a3d,_0x1294e2){return db[_0xfedb('0x54')]['create'](_0x678a3d[_0xfedb('0x5b')],{})[_0xfedb('0x1e')](function(_0x1d0d6f){var _0x4fe60e=_0x678a3d[_0xfedb('0x5c')][_0xfedb('0x36')]({'plain':!![]});if(!_0x4fe60e)throw new Error(_0xfedb('0x5d'));if(_0x4fe60e[_0xfedb('0x5e')]===_0xfedb('0x5c')){var _0x500223=_0x1d0d6f[_0xfedb('0x36')]({'plain':!![]});var _0x4f3009=_0xfedb('0x37');return db[_0xfedb('0x5f')][_0xfedb('0x60')]({'where':{'name':_0x4f3009,'userProfileId':_0x4fe60e[_0xfedb('0x61')]},'raw':!![]})[_0xfedb('0x1e')](function(_0x1e05f1){if(_0x1e05f1&&_0x1e05f1[_0xfedb('0x62')]===0x0){return db[_0xfedb('0x38')][_0xfedb('0x63')]({'name':_0x500223['name'],'resourceId':_0x500223['id'],'type':_0x1e05f1[_0xfedb('0x3a')],'sectionId':_0x1e05f1['id']},{})[_0xfedb('0x1e')](function(){return _0x1d0d6f;});}else{return _0x1d0d6f;}})[_0xfedb('0x28')](function(_0x41c444){logger[_0xfedb('0x23')](_0xfedb('0x64'),_0x41c444);throw _0x41c444;});}return _0x1d0d6f;})[_0xfedb('0x1e')](respondWithResult(_0x1294e2,0xc9))[_0xfedb('0x28')](handleError(_0x1294e2,null));};exports[_0xfedb('0x34')]=function(_0x28451a,_0x60da78){if(_0x28451a[_0xfedb('0x5b')]['id']){delete _0x28451a[_0xfedb('0x5b')]['id'];}return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x28451a['params']['id']},'include':[{'model':db[_0xfedb('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xfedb('0x1e')](handleEntityNotFound(_0x60da78,null))['then'](saveUpdates(_0x28451a[_0xfedb('0x5b')],null))[_0xfedb('0x1e')](respondWithResult(_0x60da78,null))[_0xfedb('0x28')](handleError(_0x60da78,null));};exports['destroy']=function(_0x52948b,_0x43ffc9){return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x52948b[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x43ffc9,null))[_0xfedb('0x1e')](removeEntity(_0x43ffc9,null))[_0xfedb('0x28')](handleError(_0x43ffc9,null));};exports[_0xfedb('0x65')]=function(_0x4b48a2,_0x1183a3){return db[_0xfedb('0x54')][_0xfedb('0x65')]()[_0xfedb('0x1e')](respondWithResult(_0x1183a3,null))[_0xfedb('0x28')](handleError(_0x1183a3,null));};exports[_0xfedb('0x66')]=function(_0x2828df,_0x5b8e26,_0x98878a){if(_0x2828df[_0xfedb('0x5b')]['id']){delete _0x2828df[_0xfedb('0x5b')]['id'];}return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x2828df[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x5b8e26,null))[_0xfedb('0x1e')](function(_0x2a5277){if(_0x2a5277){_0x2828df[_0xfedb('0x5b')]['ChatWebsiteId']=_0x2a5277['id'];return db[_0xfedb('0x67')][_0xfedb('0x63')](_0x2828df['body']);}})['then'](respondWithResult(_0x5b8e26,null))[_0xfedb('0x28')](handleError(_0x5b8e26,null));};exports['getDispositions']=function(_0x33d35d,_0x38952a,_0x359ca4){var _0xf354c8={'raw':![],'where':{}};var _0x2214f6={};var _0x46385a={'count':0x0,'rows':[]};return db[_0xfedb('0x54')][_0xfedb('0x68')]({'where':{'id':_0x33d35d[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x38952a,null))[_0xfedb('0x1e')](function(_0x451802){if(_0x451802){_0x2214f6[_0xfedb('0x3f')]=_['keys'](db[_0xfedb('0x67')][_0xfedb('0x3e')]);_0x2214f6['query']=_[_0xfedb('0x41')](_0x33d35d[_0xfedb('0x40')]);_0x2214f6[_0xfedb('0x4b')]=_[_0xfedb('0x42')](_0x2214f6['model'],_0x2214f6['query']);_0xf354c8['attributes']=_[_0xfedb('0x42')](_0x2214f6[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x33d35d[_0xfedb('0x40')][_0xfedb('0x44')]));_0xf354c8['attributes']=_0xf354c8[_0xfedb('0x43')][_0xfedb('0x45')]?_0xf354c8[_0xfedb('0x43')]:_0x2214f6[_0xfedb('0x3f')];if(!_0x33d35d['query']['hasOwnProperty'](_0xfedb('0x47'))){_0xf354c8[_0xfedb('0x2f')]=qs[_0xfedb('0x2f')](_0x33d35d['query'][_0xfedb('0x2f')]);_0xf354c8[_0xfedb('0x2e')]=qs['offset'](_0x33d35d[_0xfedb('0x40')][_0xfedb('0x2e')]);}_0xf354c8[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x33d35d[_0xfedb('0x40')][_0xfedb('0x49')]);_0xf354c8[_0xfedb('0x4a')]=qs[_0xfedb('0x4b')](_['pick'](_0x33d35d[_0xfedb('0x40')],_0x2214f6[_0xfedb('0x4b')]));_0xf354c8[_0xfedb('0x4a')][_0xfedb('0x69')]=_0x451802['id'];if(_0x33d35d[_0xfedb('0x40')][_0xfedb('0x4c')]){_0xf354c8[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0xf354c8[_0xfedb('0x4a')],{'$or':_['map'](_0xf354c8[_0xfedb('0x43')],function(_0x4eb31b){var _0x1c87f5={};_0x1c87f5[_0x4eb31b]={'$like':'%'+_0x33d35d[_0xfedb('0x40')]['filter']+'%'};return _0x1c87f5;})});}_0xf354c8=_['merge']({},_0xf354c8,_0x33d35d[_0xfedb('0x53')]);return db[_0xfedb('0x67')]['count']({'where':_0xf354c8[_0xfedb('0x4a')]})['then'](function(_0x14f5af){_0x46385a[_0xfedb('0x2d')]=_0x14f5af;if(_0x33d35d[_0xfedb('0x40')][_0xfedb('0x55')]){_0xf354c8[_0xfedb('0x56')]=[{'all':!![]}];}return db[_0xfedb('0x67')][_0xfedb('0x57')](_0xf354c8);})[_0xfedb('0x1e')](function(_0x1df762){_0x46385a[_0xfedb('0x58')]=_0x1df762;return _0x46385a;});}})[_0xfedb('0x1e')](respondWithFilteredResult(_0x38952a,_0xf354c8))['catch'](handleError(_0x38952a,null));};exports[_0xfedb('0x6a')]=function(_0x407f1c,_0x13bdcb,_0x20d43c){return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x407f1c[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13bdcb,null))[_0xfedb('0x1e')](function(_0xd14a3d){if(_0xd14a3d){return _0xd14a3d[_0xfedb('0x6a')](_0x407f1c['query'][_0xfedb('0x6b')]);}})['then'](respondWithStatusCode(_0x13bdcb,null))[_0xfedb('0x28')](handleError(_0x13bdcb,null));};exports[_0xfedb('0x6c')]=function(_0x1836e2,_0x297011,_0x1db2d1){if(_0x1836e2[_0xfedb('0x5b')]['id']){delete _0x1836e2[_0xfedb('0x5b')]['id'];}return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x1836e2[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x297011,null))[_0xfedb('0x1e')](function(_0xf58fda){if(_0xf58fda){_0x1836e2['body'][_0xfedb('0x69')]=_0xf58fda['id'];return db[_0xfedb('0x6d')][_0xfedb('0x63')](_0x1836e2[_0xfedb('0x5b')]);}})[_0xfedb('0x1e')](respondWithResult(_0x297011,null))[_0xfedb('0x28')](handleError(_0x297011,null));};exports[_0xfedb('0x6e')]=function(_0x5f52a5,_0x211d9e,_0x996a57){var _0x3cae54={'raw':![],'where':{}};var _0x376fbb={};var _0x4fb22a={'count':0x0,'rows':[]};return db[_0xfedb('0x54')]['findOne']({'where':{'id':_0x5f52a5[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x211d9e,null))[_0xfedb('0x1e')](function(_0x3d22bb){if(_0x3d22bb){_0x376fbb['model']=_['keys'](db['CannedAnswer'][_0xfedb('0x3e')]);_0x376fbb[_0xfedb('0x40')]=_['keys'](_0x5f52a5[_0xfedb('0x40')]);_0x376fbb[_0xfedb('0x4b')]=_['intersection'](_0x376fbb[_0xfedb('0x3f')],_0x376fbb[_0xfedb('0x40')]);_0x3cae54[_0xfedb('0x43')]=_['intersection'](_0x376fbb['model'],qs[_0xfedb('0x44')](_0x5f52a5[_0xfedb('0x40')][_0xfedb('0x44')]));_0x3cae54[_0xfedb('0x43')]=_0x3cae54['attributes'][_0xfedb('0x45')]?_0x3cae54[_0xfedb('0x43')]:_0x376fbb[_0xfedb('0x3f')];if(!_0x5f52a5[_0xfedb('0x40')]['hasOwnProperty'](_0xfedb('0x47'))){_0x3cae54['limit']=qs[_0xfedb('0x2f')](_0x5f52a5['query'][_0xfedb('0x2f')]);_0x3cae54[_0xfedb('0x2e')]=qs[_0xfedb('0x2e')](_0x5f52a5[_0xfedb('0x40')][_0xfedb('0x2e')]);}_0x3cae54[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x5f52a5[_0xfedb('0x40')]['sort']);_0x3cae54['where']=qs[_0xfedb('0x4b')](_[_0xfedb('0x6f')](_0x5f52a5['query'],_0x376fbb[_0xfedb('0x4b')]));_0x3cae54[_0xfedb('0x4a')][_0xfedb('0x69')]=_0x3d22bb['id'];if(_0x5f52a5[_0xfedb('0x40')][_0xfedb('0x4c')]){_0x3cae54[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0x3cae54[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x3cae54[_0xfedb('0x43')],function(_0x2b4148){var _0x5b3cbf={};_0x5b3cbf[_0x2b4148]={'$like':'%'+_0x5f52a5[_0xfedb('0x40')][_0xfedb('0x4c')]+'%'};return _0x5b3cbf;})});}_0x3cae54=_[_0xfedb('0x4d')]({},_0x3cae54,_0x5f52a5[_0xfedb('0x53')]);return db[_0xfedb('0x6d')][_0xfedb('0x2d')]({'where':_0x3cae54['where']})[_0xfedb('0x1e')](function(_0x3e3834){_0x4fb22a[_0xfedb('0x2d')]=_0x3e3834;if(_0x5f52a5[_0xfedb('0x40')][_0xfedb('0x55')]){_0x3cae54['include']=[{'all':!![]}];}return db[_0xfedb('0x6d')]['findAll'](_0x3cae54);})['then'](function(_0x2ecf0){_0x4fb22a['rows']=_0x2ecf0;return _0x4fb22a;});}})[_0xfedb('0x1e')](respondWithFilteredResult(_0x211d9e,_0x3cae54))[_0xfedb('0x28')](handleError(_0x211d9e,null));};exports[_0xfedb('0x70')]=function(_0x2991f5,_0x1edf8b,_0x418d25){return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x2991f5[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1edf8b,null))[_0xfedb('0x1e')](function(_0x44f54d){if(_0x44f54d){return _0x44f54d['removeAnswers'](_0x2991f5['query'][_0xfedb('0x6b')]);}})['then'](respondWithStatusCode(_0x1edf8b,null))[_0xfedb('0x28')](handleError(_0x1edf8b,null));};exports[_0xfedb('0x71')]=function(_0xb3abb9,_0x3fbb57,_0x358d05){_0xb3abb9[_0xfedb('0x5b')][_0xfedb('0x72')]=_0xb3abb9['file']['filename'];return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0xb3abb9['params']['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x3fbb57,null))[_0xfedb('0x1e')](saveUpdates(_0xb3abb9[_0xfedb('0x5b')],null))[_0xfedb('0x1e')](respondWithResult(_0x3fbb57,null))[_0xfedb('0x28')](handleError(_0x3fbb57,null));};exports['addAvatar']=function(_0x1f96b9,_0x239a0c,_0x57dc1b){_0x1f96b9[_0xfedb('0x5b')][_0xfedb('0x73')]=_0x1f96b9[_0xfedb('0x74')][_0xfedb('0x75')];return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x1f96b9[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x239a0c,null))['then'](saveUpdates(_0x1f96b9[_0xfedb('0x5b')],null))[_0xfedb('0x1e')](respondWithResult(_0x239a0c,null))[_0xfedb('0x28')](handleError(_0x239a0c,null));};exports[_0xfedb('0x76')]=function(_0x35e22c,_0xdcb610,_0x2a39b8){_0x35e22c[_0xfedb('0x5b')]['customerAvatar']=_0x35e22c[_0xfedb('0x74')]['filename'];return db[_0xfedb('0x54')]['find']({'where':{'id':_0x35e22c[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0xdcb610,null))[_0xfedb('0x1e')](saveUpdates(_0x35e22c[_0xfedb('0x5b')],null))[_0xfedb('0x1e')](respondWithResult(_0xdcb610,null))[_0xfedb('0x28')](handleError(_0xdcb610,null));};exports['addSystemAvatar']=function(_0x15b5f2,_0x3d4e49,_0x185ffc){_0x15b5f2[_0xfedb('0x5b')][_0xfedb('0x77')]=_0x15b5f2[_0xfedb('0x74')][_0xfedb('0x75')];return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x15b5f2[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d4e49,null))['then'](saveUpdates(_0x15b5f2[_0xfedb('0x5b')],null))[_0xfedb('0x1e')](respondWithResult(_0x3d4e49,null))[_0xfedb('0x28')](handleError(_0x3d4e49,null));};exports[_0xfedb('0x78')]=function(_0x467153,_0x62eeb0,_0x14d0f6){var _0x496635=path[_0xfedb('0x79')](config['root'],'server/files/images/logos/default_logo.png');var _0x136629={'where':{'id':_0x467153['params']['id']},'attributes':['id',_0xfedb('0x72')],'raw':!![]};var _0x181b4e=![];return require(_0xfedb('0x7a'))[_0xfedb('0x7b')]()[_0xfedb('0x1e')](function(_0x53ab49){if(_0x53ab49){_0x181b4e=_0x53ab49[_0xfedb('0x7c')];}})[_0xfedb('0x1e')](function(){return db[_0xfedb('0x54')]['find'](_0x136629);})['then'](handleEntityNotFound(_0x62eeb0,null))[_0xfedb('0x1e')](function(_0xbc3e63){if(_0xbc3e63){if(!_[_0xfedb('0x7d')](_0xbc3e63[_0xfedb('0x72')])){if(fs[_0xfedb('0x7e')](path['join'](config[_0xfedb('0x7f')],'server/files/images/logos/',_0xbc3e63['sitepic']))&&_0x181b4e){_0x496635=path[_0xfedb('0x79')](config['root'],_0xfedb('0x80'),_0xbc3e63[_0xfedb('0x72')]);}}return _0x62eeb0[_0xfedb('0x81')](_0x496635);}})[_0xfedb('0x28')](handleError(_0x62eeb0,null));};exports['getAvatar']=function(_0x50db0c,_0x1eb1ea,_0xfa00d2){var _0x39602c=path['join'](config[_0xfedb('0x7f')],'server/files/images/avatars/default_avatar.png');var _0xba0eb2={'where':{'id':_0x50db0c['params']['id']},'attributes':['id',_0xfedb('0x73')],'raw':!![]};return db['ChatWebsite'][_0xfedb('0x60')](_0xba0eb2)[_0xfedb('0x1e')](handleEntityNotFound(_0x1eb1ea,null))['then'](function(_0x224181){if(_0x224181){if(!_[_0xfedb('0x7d')](_0x224181[_0xfedb('0x73')])){if(fs[_0xfedb('0x7e')](path['join'](config[_0xfedb('0x7f')],'server/files/images/avatars/',_0x224181[_0xfedb('0x73')]))){_0x39602c=path[_0xfedb('0x79')](config['root'],'server/files/images/avatars/',_0x224181[_0xfedb('0x73')]);}}return _0x1eb1ea[_0xfedb('0x81')](_0x39602c);}})[_0xfedb('0x28')](handleError(_0x1eb1ea,null));};exports[_0xfedb('0x82')]=function(_0x2870de,_0x29ff79,_0x34858a){var _0x5def39=path[_0xfedb('0x79')](config[_0xfedb('0x7f')],_0xfedb('0x83'));var _0x527230={'where':{'id':_0x2870de[_0xfedb('0x5a')]['id']},'attributes':['id',_0xfedb('0x84'),'showCustomerAvatar'],'raw':!![]};return db[_0xfedb('0x54')][_0xfedb('0x60')](_0x527230)['then'](handleEntityNotFound(_0x29ff79,null))[_0xfedb('0x1e')](function(_0x162365){if(_0x162365){if(!_[_0xfedb('0x7d')](_0x162365['customerAvatar'])){if(fs[_0xfedb('0x7e')](path[_0xfedb('0x79')](config[_0xfedb('0x7f')],'server/files/images/avatars/',_0x162365[_0xfedb('0x84')]))&&_0x162365[_0xfedb('0x85')]){_0x5def39=path[_0xfedb('0x79')](config[_0xfedb('0x7f')],_0xfedb('0x86'),_0x162365[_0xfedb('0x84')]);}}return _0x29ff79[_0xfedb('0x81')](_0x5def39);}})['catch'](handleError(_0x29ff79,null));};exports[_0xfedb('0x87')]=function(_0x15dab5,_0x21cf73,_0x3c686e){var _0xc4b854=path[_0xfedb('0x79')](config[_0xfedb('0x7f')],_0xfedb('0x88'));var _0x1d586f={'where':{'id':_0x15dab5['params']['id']},'attributes':['id',_0xfedb('0x77')],'raw':!![]};return db[_0xfedb('0x54')][_0xfedb('0x60')](_0x1d586f)[_0xfedb('0x1e')](handleEntityNotFound(_0x21cf73,null))['then'](function(_0x3eb7af){if(_0x3eb7af){if(!_[_0xfedb('0x7d')](_0x3eb7af[_0xfedb('0x77')])){if(fs[_0xfedb('0x7e')](path['join'](config[_0xfedb('0x7f')],'server/files/images/avatars/',_0x3eb7af[_0xfedb('0x77')]))){_0xc4b854=path['join'](config[_0xfedb('0x7f')],_0xfedb('0x86'),_0x3eb7af[_0xfedb('0x77')]);}}return _0x21cf73[_0xfedb('0x81')](_0xc4b854);}})['catch'](handleError(_0x21cf73,null));};exports[_0xfedb('0x89')]=function(_0x2a1b05,_0x490734,_0x5afc54){var _0x1e7942=require(_0xfedb('0x8a'));var _0x4e4b4a=new _0x1e7942();var _0x92ae26=_0x4e4b4a[_0xfedb('0x8b')](_0x2a1b05['headers'][_0xfedb('0x8c')])[_0xfedb('0x8d')]();var _0x3baefc={'body':_0x2a1b05[_0xfedb('0x5b')],'channel':_0xfedb('0x8e')};var _0x18557a=[];var _0x12bb03=[];var _0x38d389={};var _0x485fe9=![];return db[_0xfedb('0x8f')][_0xfedb('0x65')]()[_0xfedb('0x1e')](function(_0x47be78){if(!_0x47be78){throw new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))](_0xfedb('0x92'));}_0x18557a=_[_0xfedb('0x93')](_[_0xfedb('0x41')](_0x47be78),[_0xfedb('0x94'),_0xfedb('0x95')]);_0x12bb03=_['difference'](_['keys'](_0x47be78),[_0xfedb('0x94'),_0xfedb('0x95'),'CompanyId',_0xfedb('0x96')]);if(_0x2a1b05[_0xfedb('0x5b')]['id']){delete _0x2a1b05[_0xfedb('0x5b')]['id'];}if(_[_0xfedb('0x7d')](_0x2a1b05[_0xfedb('0x5b')]['from'])){throw new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))](_0xfedb('0x97'));}if(_['isNil'](_0x2a1b05[_0xfedb('0x5b')]['body'])||_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0x5b')]===''){throw new db[(_0xfedb('0x90'))]['ValidationError'](_0xfedb('0x98'));}if(_[_0xfedb('0x7d')](_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0x99')])){throw new db[(_0xfedb('0x90'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12bb03);}if(!_[_0xfedb('0x9a')](_0x12bb03,_0x2a1b05[_0xfedb('0x5b')]['mapKey'])){throw new db[(_0xfedb('0x90'))]['ValidationError'](_0xfedb('0x9b')+_0x12bb03);}_0x38d389[_0x2a1b05[_0xfedb('0x5b')]['mapKey']]=_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0x9c')];})[_0xfedb('0x1e')](function(){return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x2a1b05[_0xfedb('0x5a')]['id']},'include':[{'model':db[_0xfedb('0x9d')],'as':_0xfedb('0x9e'),'include':[{'model':db['CmContact'],'as':_0xfedb('0x9f'),'where':_0x38d389,'limit':0x1,'order':[[_0xfedb('0x95'),_0xfedb('0xa0')]]}]},{'model':db[_0xfedb('0xa1')],'as':'Applications'}]});})[_0xfedb('0x1e')](handleEntityNotFound(_0x490734,null))['then'](function(_0x405605){if(_0x405605&&_0x405605[_0xfedb('0x9e')]){_0x3baefc[_0xfedb('0xa2')]=_0x405605;_0x3baefc[_0xfedb('0xa3')]=_0x405605[_0xfedb('0xa4')];_0x3baefc[_0xfedb('0xa5')]=_0x405605[_0xfedb('0x9e')];_0x3baefc[_0xfedb('0xa3')]=_[_0xfedb('0xa6')](_0x3baefc['applications'],[_0xfedb('0xa7')],[_0xfedb('0xa8')]);if(_0x3baefc[_0xfedb('0xa2')][_0xfedb('0xa4')]){delete _0x3baefc['account'][_0xfedb('0xa4')];}if(_0x3baefc['account'][_0xfedb('0x9e')]&&_0x3baefc[_0xfedb('0xa2')][_0xfedb('0x9e')][_0xfedb('0x9f')]['length']){return _0x3baefc[_0xfedb('0xa2')]['List'][_0xfedb('0x9f')][0x0];}var _0x1cc764=_['defaults'](_0x2a1b05[_0xfedb('0x5b')],{'firstName':_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0x9c')],'ListId':_0x405605[_0xfedb('0x96')]});_0x1cc764[_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0x99')]]=_0x2a1b05['body'][_0xfedb('0x9c')];return db['CmContact']['create'](_0x1cc764,{'fields':_0x18557a,'raw':!![]});}})[_0xfedb('0x1e')](handleEntityNotFound(_0x490734,null))[_0xfedb('0x1e')](function(_0x5236ac){_0x3baefc[_0xfedb('0xa9')]=_0x5236ac;if(_0x5236ac){var _0x3f1c40={'ContactId':_0x5236ac['id'],'ChatWebsiteId':_0x2a1b05[_0xfedb('0x5a')]['id'],'from':(_0x5236ac['firstName']||'')+'\x20'+(_0x5236ac['lastName']||''),'customerIp':_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xaa')],'referer':_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xab')],'browserName':_0x92ae26[_0xfedb('0xac')][_0xfedb('0x3a')]&&_0x92ae26[_0xfedb('0xac')][_0xfedb('0xad')]?util[_0xfedb('0xae')](_0xfedb('0xaf'),_0x92ae26[_0xfedb('0xac')][_0xfedb('0x3a')],_0x92ae26[_0xfedb('0xac')][_0xfedb('0xad')]):_0xfedb('0xb0'),'browserVersion':_0x92ae26[_0xfedb('0xac')][_0xfedb('0xad')]||_0xfedb('0xb0'),'osName':util['format']('%s\x20%s',_0x92ae26['os'][_0xfedb('0x3a')],_0x92ae26['os'][_0xfedb('0xad')]),'osVersion':_0x92ae26['os'][_0xfedb('0xad')],'deviceModel':_0x92ae26['device'][_0xfedb('0x3f')]&&_0x92ae26[_0xfedb('0xb1')][_0xfedb('0xb2')]?util[_0xfedb('0xae')](_0xfedb('0xb3'),_0x92ae26['device'][_0xfedb('0x3f')],_0x92ae26[_0xfedb('0xb1')][_0xfedb('0xb2')],_0x92ae26[_0xfedb('0xb1')][_0xfedb('0x4f')]):null,'deviceVendor':_0x92ae26[_0xfedb('0xb1')][_0xfedb('0xb2')],'deviceType':_0x92ae26[_0xfedb('0xb1')]['type'],'formData':JSON['stringify'](_0x2a1b05['body'])};var _0x17e952={'ChatWebsiteId':_0x2a1b05[_0xfedb('0x5a')]['id'],'closed':![]};if(_0x2a1b05['body'][_0xfedb('0xb4')]){_0x17e952[_0xfedb('0xb4')]=_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb4')];return db[_0xfedb('0xb5')][_0xfedb('0x60')]({'where':_0x17e952})[_0xfedb('0x1e')](function(_0x372268){if(_0x372268){return[_0x372268,![]];}_0x3f1c40[_0xfedb('0xb4')]=_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb4')];_0x3f1c40[_0xfedb('0xb6')]=_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb6')];return db[_0xfedb('0xb5')][_0xfedb('0x63')](_0x3f1c40)['then'](function(_0x139ce2){return[_0x139ce2,!![]];});});}_0x17e952[_0xfedb('0xb7')]=_0x5236ac['id'];if(_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb8')]&&_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb8')]['id']){_0x17e952['id']=_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb8')]['id'];return db[_0xfedb('0xb5')][_0xfedb('0x60')]({'where':_0x17e952})[_0xfedb('0x1e')](function(_0x2bc6f7){if(_0x2bc6f7){return[_0x2bc6f7,![]];}return db[_0xfedb('0xb5')][_0xfedb('0x63')](_0x3f1c40)[_0xfedb('0x1e')](function(_0x1398bd){return[_0x1398bd,!![]];});});}return db[_0xfedb('0xb5')]['create'](_0x3f1c40)['then'](function(_0x285675){return[_0x285675,!![]];});}})[_0xfedb('0xb9')](function(_0x5c66e9,_0x4f1ff6){if(_0x5c66e9){_0x485fe9=_0x4f1ff6;if(!_0x4f1ff6){var _0x23c007={'from':(_0x3baefc['contact'][_0xfedb('0xba')]||'')+'\x20'+(_0x3baefc['contact'][_0xfedb('0xbb')]||'')};if(_0x2a1b05[_0xfedb('0x5b')]['threadId']&&_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xbc')]&&_0x2a1b05[_0xfedb('0x5b')][_0xfedb('0xb4')]!=_0x2a1b05[_0xfedb('0x5b')]['messageId']){_0x23c007[_0xfedb('0xb4')]=_0x2a1b05[_0xfedb('0x5b')]['messageId'];}return _0x5c66e9['update'](_0x23c007);}else{return _0x5c66e9;}}})[_0xfedb('0x1e')](function(_0x4c246b){_0x3baefc[_0xfedb('0xb8')]=_0x4c246b[_0xfedb('0x36')]({'plain':!![]});_0x3baefc[_0xfedb('0xb8')][_0xfedb('0xbd')]=_0x485fe9;if(_0x3baefc[_0xfedb('0xb8')]['created']){if(_0x3baefc[_0xfedb('0xa2')][_0xfedb('0xbe')]){_0x3baefc['applications'][_0xfedb('0xbf')]({'id':0x0,'priority':_0x3baefc['applications']['length']+0x1,'app':'close','appdata':_0xfedb('0xc0'),'interval':_0xfedb('0xc1')});}}return db['ChatMessage'][_0xfedb('0x63')]({'body':_0x2a1b05[_0xfedb('0x5b')]['body'],'ChatWebsiteId':_0x2a1b05['params']['id'],'ChatInteractionId':_0x4c246b['id'],'direction':'in','ContactId':_0x3baefc[_0xfedb('0xa9')]['id'],'AttachmentId':_0x2a1b05['body'][_0xfedb('0xc2')]});})['then'](function(_0xa316d5){_0x3baefc['message']=_0xa316d5;if(_0x3baefc[_0xfedb('0xb8')][_0xfedb('0xc3')]){return db['User'][_0xfedb('0x60')]({'attributes':['id',_0xfedb('0x3a')],'where':{'id':_0x3baefc[_0xfedb('0xb8')]['UserId']}})[_0xfedb('0x1e')](function(_0x545fb3){if(_0x545fb3){_0x3baefc[_0xfedb('0xa3')][_0xfedb('0xc4')]({'id':0x0,'priority':0x0,'app':_0xfedb('0xc5'),'appdata':_0x545fb3[_0xfedb('0x3a')]+','+(_0x3baefc['account'][_0xfedb('0xc6')]||0xa),'interval':'*,*,*,*'});_0x3baefc['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x3baefc);});}return respondWithRpcPromise('Start',_0xfedb('0xc7'),_0x3baefc);})[_0xfedb('0x1e')](function(_0x21873a){respondWithRpcPromise('EventManager',_0xfedb('0xc8'),{'event':_0xfedb('0x89'),'message':_0x21873a},client9002);return _0x21873a;})[_0xfedb('0x1e')](respondWithResult(_0x490734,null))['catch'](handleError(_0x490734,null));};exports[_0xfedb('0xc9')]=function(_0x484843,_0x155e40,_0x4d9af5){var _0x25fc78,_0x493365,_0x3fea4d;var _0x8100b=[];var _0x1003c6=[];var _0x23b314={};return db[_0xfedb('0x8f')][_0xfedb('0x65')]()[_0xfedb('0x1e')](function(_0x12021e){if(!_0x12021e){throw new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))](_0xfedb('0x92'));}_0x1003c6=_[_0xfedb('0x93')](_[_0xfedb('0x41')](_0x12021e),[_0xfedb('0x94'),'updatedAt']);_0x8100b=_['difference'](_[_0xfedb('0x41')](_0x12021e),['createdAt','updatedAt',_0xfedb('0xca'),'ListId']);if(_0x484843[_0xfedb('0x5b')]['id']){delete _0x484843[_0xfedb('0x5b')]['id'];}if(_[_0xfedb('0x7d')](_0x484843['body']['from'])){throw _0x155e40['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xfedb('0x97')));}if(_[_0xfedb('0x7d')](_0x484843[_0xfedb('0x5b')][_0xfedb('0x5b')])||_0x484843[_0xfedb('0x5b')][_0xfedb('0x5b')]===''){throw _0x155e40[_0xfedb('0x2a')](0x1f4)[_0xfedb('0xcb')](new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))](_0xfedb('0x98')));}if(_[_0xfedb('0x7d')](_0x484843[_0xfedb('0x5b')][_0xfedb('0xcc')])){throw _0x155e40[_0xfedb('0x2a')](0x1f4)[_0xfedb('0xcb')](new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))](_0xfedb('0xcd')+_0x8100b));}if(!_[_0xfedb('0x9a')](_0x8100b,_0x484843['body']['mapKeyOffline'])){throw _0x155e40[_0xfedb('0x2a')](0x1f4)[_0xfedb('0xcb')](new db[(_0xfedb('0x90'))][(_0xfedb('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8100b));}_0x23b314[_0x484843[_0xfedb('0x5b')][_0xfedb('0xcc')]]=_0x484843['body'][_0xfedb('0x9c')];})[_0xfedb('0x1e')](function(){return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x484843['params']['id']},'include':[{'model':db[_0xfedb('0x9d')],'as':_0xfedb('0x9e')}]});})[_0xfedb('0x1e')](handleEntityNotFound(_0x155e40,null))['then'](function(_0x57b240){if(_0x57b240&&_0x57b240[_0xfedb('0x9e')]){_0x493365=_0x57b240;var _0xb55978=_[_0xfedb('0x15')](_0x484843[_0xfedb('0x5b')],{'firstName':_0x484843[_0xfedb('0x5b')][_0xfedb('0x9c')],'phone':_0x484843['body'][_0xfedb('0x9c')],'ListId':_0x57b240['ListId']});_0xb55978[_0x484843[_0xfedb('0x5b')][_0xfedb('0xcc')]]=_0x484843[_0xfedb('0x5b')][_0xfedb('0x9c')];return db[_0xfedb('0x8f')][_0xfedb('0xce')]({'where':_0x23b314,'defaults':_0xb55978});}})[_0xfedb('0xb9')](function(_0x4f0b26){if(_0x4f0b26){_0x3fea4d=_0x4f0b26;var _0x1933f3=fs['readFileSync'](path[_0xfedb('0x79')](config[_0xfedb('0x7f')],_0xfedb('0xcf')),_0xfedb('0xd0'));var _0x51828f=ejs[_0xfedb('0xd1')](_0x1933f3,{'body':_[_0xfedb('0xd2')](_0x484843[_0xfedb('0x5b')][_0xfedb('0x5b')]),'bodyTitle':_0x493365[_0xfedb('0xd3')]});return db[_0xfedb('0xd4')][_0xfedb('0x63')]({'body':_0x51828f,'ContactId':_0x4f0b26['id'],'ChatWebsiteId':_0x493365['id']});}})[_0xfedb('0x1e')](function(_0x1dead5){if(_0x1dead5){_0x25fc78=_0x1dead5;return db[_0xfedb('0xd5')][_0xfedb('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0xfedb('0xd6')],'as':_0xfedb('0xd7'),'raw':!![]}]});}})[_0xfedb('0x1e')](function(_0x9feffb){if(_0x9feffb&&_0x9feffb[_0xfedb('0xd7')]&&_0x493365[_0xfedb('0xd8')]){var _0x36d5fb={'tls':{'rejectUnauthorized':![]}};if(_0x9feffb['Smtp']['service']){_0x36d5fb[_0xfedb('0xd9')]=_0x9feffb['Smtp'][_0xfedb('0xd9')];}else{_0x36d5fb[_0xfedb('0xda')]=_0x9feffb[_0xfedb('0xd7')][_0xfedb('0xda')];_0x36d5fb[_0xfedb('0xdb')]=_0x9feffb['Smtp'][_0xfedb('0xdb')];_0x36d5fb[_0xfedb('0xdc')]=_0x9feffb[_0xfedb('0xd7')][_0xfedb('0xdc')];}if(_0x9feffb['Smtp'][_0xfedb('0xdd')]){_0x36d5fb[_0xfedb('0xde')]={'user':_0x9feffb[_0xfedb('0xd7')][_0xfedb('0x5c')],'pass':_0x9feffb[_0xfedb('0xd7')]['pass']};}return respondWithRpcPromise(_0xfedb('0xdf'),_0xfedb('0xe0'),{'account':_0x36d5fb,'message':{'from':util[_0xfedb('0xae')]('\x22%s\x22\x20<%s>',_0x9feffb[_0xfedb('0x3a')],_0x9feffb[_0xfedb('0xe1')]||_0x9feffb[_0xfedb('0xd7')][_0xfedb('0x5c')]),'to':_0x493365[_0xfedb('0xd8')],'subject':_0x493365[_0xfedb('0xe2')],'text':_0x25fc78[_0xfedb('0x5b')]}},client9003)[_0xfedb('0x1e')](function(){return _0x25fc78;})[_0xfedb('0x28')](function(_0x40ff47){console[_0xfedb('0x23')](_0x40ff47);});}})['then'](function(){if(_0x25fc78){return _0x25fc78;}})[_0xfedb('0x1e')](respondWithResult(_0x155e40,null))[_0xfedb('0x28')](handleError(_0x155e40,null));};exports[_0xfedb('0xe3')]=function(_0x4b9df1,_0x39e037,_0x2ce30b){return db[_0xfedb('0xb5')][_0xfedb('0x60')]({'where':{'id':_0x4b9df1[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x39e037,null))[_0xfedb('0x1e')](function(_0x314a4a){if(_0x314a4a){return _0x314a4a[_0xfedb('0xe3')](_0x4b9df1[_0xfedb('0x5b')][_0xfedb('0x6b')],_['omit'](_0x4b9df1[_0xfedb('0x5b')],['ids','id'])||{});}})[_0xfedb('0x1e')](respondWithResult(_0x39e037,null))[_0xfedb('0x28')](handleError(_0x39e037,null));};exports['getInteractions']=function(_0x3a51b9,_0x5ab5a9,_0x40a4c6){var _0x2911a9={'raw':![],'where':{}};var _0x1d7f86={};var _0x385fac={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3a51b9[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x5ab5a9,null))[_0xfedb('0x1e')](function(_0x1e4909){if(_0x1e4909){_0x1d7f86[_0xfedb('0x3f')]=_[_0xfedb('0x41')](db[_0xfedb('0xb5')][_0xfedb('0x3e')]);_0x1d7f86[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x3a51b9[_0xfedb('0x40')]);_0x1d7f86['filters']=_['intersection'](_0x1d7f86['model'],_0x1d7f86[_0xfedb('0x40')]);_0x2911a9['attributes']=_[_0xfedb('0x42')](_0x1d7f86[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x3a51b9[_0xfedb('0x40')][_0xfedb('0x44')]));_0x2911a9[_0xfedb('0x43')]=_0x2911a9['attributes']['length']?_0x2911a9[_0xfedb('0x43')]:_0x1d7f86[_0xfedb('0x3f')];if(!_0x3a51b9[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0x2911a9[_0xfedb('0x2f')]=qs[_0xfedb('0x2f')](_0x3a51b9['query'][_0xfedb('0x2f')]);_0x2911a9[_0xfedb('0x2e')]=qs[_0xfedb('0x2e')](_0x3a51b9['query'][_0xfedb('0x2e')]);}_0x2911a9[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x3a51b9['query'][_0xfedb('0x49')]);_0x2911a9[_0xfedb('0x4a')]=qs[_0xfedb('0x4b')](_['pick'](_0x3a51b9[_0xfedb('0x40')],_0x1d7f86[_0xfedb('0x4b')]));_0x2911a9[_0xfedb('0x4a')][_0xfedb('0x69')]=_0x1e4909['id'];if(_0x3a51b9[_0xfedb('0x40')]['filter']){_0x2911a9[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0x2911a9[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x2911a9[_0xfedb('0x43')],function(_0x278711){var _0x44d912={};_0x44d912[_0x278711]={'$like':'%'+_0x3a51b9['query'][_0xfedb('0x4c')]+'%'};return _0x44d912;})});}_0x2911a9=_['merge']({},_0x2911a9,_0x3a51b9['options']);return db[_0xfedb('0xb5')]['count']({'where':_0x2911a9[_0xfedb('0x4a')]})['then'](function(_0x31a556){_0x385fac['count']=_0x31a556;if(_0x3a51b9['query'][_0xfedb('0x55')]){_0x2911a9['include']=[{'model':db[_0xfedb('0x8f')],'as':_0xfedb('0xe4'),'required':![]},{'model':db[_0xfedb('0xe5')],'as':'Owner','attributes':['name','fullname',_0xfedb('0xe6')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfedb('0x3a'),'color'],'where':_0x3a51b9[_0xfedb('0x40')][_0xfedb('0xe7')]?{'id':_0x3a51b9['query'][_0xfedb('0xe7')]}:undefined,'required':_0x3a51b9['query'][_0xfedb('0xe7')]?!![]:![]}];}return db[_0xfedb('0xb5')][_0xfedb('0x57')](_0x2911a9);})[_0xfedb('0x1e')](function(_0x37de55){_0x385fac['rows']=_0x37de55;return _0x385fac;});}})[_0xfedb('0x1e')](respondWithFilteredResult(_0x5ab5a9,_0x2911a9))['catch'](handleError(_0x5ab5a9,null));};function iftimePromise(_0x3abdee,_0x572449){return respondWithRpcPromise('Command',_0xfedb('0xe8'),{'command':_0x572449[_0xfedb('0xe9')]?util[_0xfedb('0xae')](_0xfedb('0xea'),_0x3abdee[_0xfedb('0xeb')],_0x572449[_0xfedb('0xe9')]):util[_0xfedb('0xae')](_0xfedb('0xec'),_0x3abdee['interval'])},client9002)['then'](function(_0x3a4a01){var _0x311883=_0x3a4a01&&_0x3a4a01['indexOf'](_0xfedb('0xed'))>=0x0?!![]:![];logger[_0xfedb('0xee')](_0xfedb('0xef'),_0x572449['id'],_0x3abdee['id'],_0x3abdee[_0xfedb('0xeb')],_0x311883?_0xfedb('0xf0'):'OFFLINE',_0x572449[_0xfedb('0xe9')]?_0x572449[_0xfedb('0xe9')]:'No\x20timezone');return _0x311883;})['catch'](function(_0xc990a3){logger['error'](_0xfedb('0xef'),_0x572449['id'],_0x3abdee['id'],_0x3abdee['interval'],util[_0xfedb('0xf1')](_0xc990a3,{'showHidden':![],'depth':null}),_0x572449[_0xfedb('0xe9')]?_0x572449[_0xfedb('0xe9')]:_0xfedb('0xf2'));return![];});}exports[_0xfedb('0xe8')]=function(_0x5efb11,_0x414c45,_0x43ac6f){var _0x224a89=0x0;var _0x209de0=0x0;var _0x47a82d=![];var _0xeabe20;var _0x221827;return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x5efb11[_0xfedb('0x5a')]['id']},'include':[{'model':db['Interval'],'as':_0xfedb('0xf3'),'include':[{'model':db[_0xfedb('0xf3')],'as':_0xfedb('0xf4'),'attributes':['id',_0xfedb('0xeb')],'raw':!![]}]}]})[_0xfedb('0x1e')](handleEntityNotFound(_0x414c45,null))[_0xfedb('0x1e')](function(_0xece65b){if(_0xece65b){_0xeabe20=_0xece65b;return _0xece65b['getProactiveActions']({'raw':!![]});}})[_0xfedb('0x1e')](function(_0x22ab7d){if(_0xeabe20){if(_0x22ab7d){_0x221827=_0x22ab7d;}}return require(_0xfedb('0x7a'))[_0xfedb('0x7b')]();})[_0xfedb('0x1e')](function(_0x965477){if(_0x965477){_0x209de0=_0x965477[_0xfedb('0xf5')];_0x47a82d=_0x965477[_0xfedb('0x7c')];}})['then'](function(){return db['ChatInteraction'][_0xfedb('0x2d')]({'where':{'closed':![]}});})['then'](function(_0xa56ddb){_0x224a89=_0xa56ddb;if(_0x209de0&&_0xa56ddb>_0x209de0){return db['License']['findOne']({'where':{'id':0x1}})[_0xfedb('0x1e')](function(_0x51293c){if(_0x51293c){_0x51293c[_0xfedb('0xf6')]('chatLicenseExceeded');}});}})['then'](function(){if(_0xeabe20['Interval']&&_0xeabe20[_0xfedb('0xf3')]['Intervals']){var _0x324b8a=[];for(var _0x20024d=0x0;_0x20024d<_0xeabe20[_0xfedb('0xf3')][_0xfedb('0xf4')]['length'];_0x20024d++){var _0x10f619=_0xeabe20['Interval'][_0xfedb('0xf4')][_0x20024d]['get']({'plain':!![]});_0x324b8a[_0xfedb('0xbf')](iftimePromise(_0x10f619,_0xeabe20));}return BPromise[_0xfedb('0xf7')](_0x324b8a)[_0xfedb('0x1e')](function(_0x55f47d){return _[_0xfedb('0xf8')](_0x55f47d);});}else{return!![];}})[_0xfedb('0x1e')](function(_0x4ceff1){var _0x5a0bce=fs['readFileSync'](path[_0xfedb('0x79')](config[_0xfedb('0x7f')],_0xfedb('0xf9')),_0xfedb('0xd0'));var _0x1ad7b8={'remote':_0xeabe20[_0xfedb('0xfa')],'query':querystring['stringify'](_[_0xfedb('0x4d')](_0xeabe20[_0xfedb('0x36')]({'plain':!![]}),{'customerIp':_0x5efb11[_0xfedb('0xfb')][_0xfedb('0xfc')]||_0x5efb11[_0xfedb('0xfb')][_0xfedb('0xfd')]||_0x5efb11[_0xfedb('0xfe')]['remoteAddress']||_0x5efb11['ip'],'referer':_0x5efb11[_0xfedb('0xfb')][_0xfedb('0xab')],'openedInteractions':_0x224a89,'maxInteractions':_0x209de0,'virtual':_0x47a82d[_0xfedb('0xf5')],'online':_0x4ceff1,'custom':_0x47a82d}))[_0xfedb('0xff')](/'/g,'\x5c\x27')};_0x414c45[_0xfedb('0xcb')](ejs['render'](Mustache[_0xfedb('0xd1')](_0x5a0bce,_0x1ad7b8),{'proactiveActions':_0x221827,'alignment':_0xeabe20['alignment'],'verticalAlignment':_0xeabe20[_0xfedb('0x100')]}));})[_0xfedb('0x28')](handleError(_0x414c45,null));};exports[_0xfedb('0x101')]=function(_0x314752,_0xa5ddbf,_0x614f55){return db[_0xfedb('0x54')][_0xfedb('0x68')]({'where':{'id':_0x314752['params']['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0xa5ddbf,null))[_0xfedb('0x1e')](function(_0x5cd3a6){if(_0x5cd3a6){return db['sequelize'][_0xfedb('0x102')](function(_0x14cd88){return db['ChatApplication'][_0xfedb('0x35')]({'where':{'ChatWebsiteId':_0x314752[_0xfedb('0x5a')]['id']},'transaction':_0x14cd88})[_0xfedb('0x1e')](function(_0x3a54a2){var _0x26aabd=_[_0xfedb('0x4e')](_0x314752['body'],function(_0x1665b4){_0x1665b4[_0xfedb('0x69')]=_0x314752[_0xfedb('0x5a')]['id'];return _0x1665b4;});return db[_0xfedb('0xa1')][_0xfedb('0x103')](_0x26aabd,{'transaction':_0x14cd88});});})[_0xfedb('0x1e')](function(){return db['ChatApplication'][_0xfedb('0x104')]({'where':{'ChatWebsiteId':_0x314752[_0xfedb('0x5a')]['id']},'order':_0xfedb('0xa7')});});}})['then'](respondWithResult(_0xa5ddbf,null))[_0xfedb('0x28')](handleError(_0xa5ddbf,null));};exports[_0xfedb('0x105')]=function(_0x2e033d,_0x4ae681,_0x6fef06){var _0xe2c005={};var _0x2ee8de={};var _0x1c139d;var _0x5e1836;return db[_0xfedb('0x54')]['findOne']({'where':{'id':_0x2e033d[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x4ae681,null))[_0xfedb('0x1e')](function(_0x2d03da){if(_0x2d03da){_0x1c139d=_0x2d03da;_0x2ee8de['model']=_[_0xfedb('0x41')](db[_0xfedb('0xa1')]['rawAttributes']);_0x2ee8de[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x2e033d['query']);_0x2ee8de[_0xfedb('0x4b')]=_[_0xfedb('0x42')](_0x2ee8de['model'],_0x2ee8de[_0xfedb('0x40')]);_0xe2c005[_0xfedb('0x43')]=_[_0xfedb('0x42')](_0x2ee8de[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x2e033d[_0xfedb('0x40')]['fields']));_0xe2c005['attributes']=_0xe2c005[_0xfedb('0x43')][_0xfedb('0x45')]?_0xe2c005[_0xfedb('0x43')]:_0x2ee8de[_0xfedb('0x3f')];_0xe2c005['order']=qs[_0xfedb('0x49')](_0x2e033d[_0xfedb('0x40')][_0xfedb('0x49')]);_0xe2c005[_0xfedb('0x4a')]=qs[_0xfedb('0x4b')](_[_0xfedb('0x6f')](_0x2e033d[_0xfedb('0x40')],_0x2ee8de[_0xfedb('0x4b')]));if(_0x2e033d[_0xfedb('0x40')][_0xfedb('0x4c')]){_0xe2c005[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0xe2c005[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0xe2c005[_0xfedb('0x43')],function(_0x434964){var _0xaea0db={};_0xaea0db[_0x434964]={'$like':'%'+_0x2e033d[_0xfedb('0x40')][_0xfedb('0x4c')]+'%'};return _0xaea0db;})});}_0xe2c005=_['merge']({},_0xe2c005,_0x2e033d['options']);return _0x1c139d[_0xfedb('0x105')](_0xe2c005);}})['then'](function(_0x1cf88e){if(_0x1cf88e){_0x5e1836=_0x1cf88e[_0xfedb('0x45')];if(!_0x2e033d[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0xe2c005[_0xfedb('0x2f')]=qs[_0xfedb('0x2f')](_0x2e033d[_0xfedb('0x40')][_0xfedb('0x2f')]);_0xe2c005[_0xfedb('0x2e')]=qs[_0xfedb('0x2e')](_0x2e033d[_0xfedb('0x40')][_0xfedb('0x2e')]);}return _0x1c139d[_0xfedb('0x105')](_0xe2c005);}})[_0xfedb('0x1e')](function(_0x56e131){if(_0x56e131){return _0x56e131?{'count':_0x5e1836,'rows':_0x56e131}:null;}})[_0xfedb('0x1e')](respondWithResult(_0x4ae681,null))[_0xfedb('0x28')](handleError(_0x4ae681,null));};exports[_0xfedb('0x106')]=function(_0x56f80c,_0x117fe7,_0x4d0359){return db['chatProactiveAction']['find']({'where':{'id':_0x56f80c[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x117fe7,null))[_0xfedb('0x1e')](function(_0x3a5fed){if(_0x3a5fed){return _0x3a5fed[_0xfedb('0x106')](_0x56f80c[_0xfedb('0x5b')][_0xfedb('0x6b')],_['omit'](_0x56f80c['body'],[_0xfedb('0x6b'),'id'])||{});}})[_0xfedb('0x1e')](respondWithResult(_0x117fe7,null))[_0xfedb('0x28')](handleError(_0x117fe7,null));};exports[_0xfedb('0x107')]=function(_0x56aa96,_0x3693a6,_0x4d21f2){var _0x1cef6e={};var _0x786622={};var _0x26a0b2;var _0x3036cb;return db[_0xfedb('0x54')][_0xfedb('0x68')]({'where':{'id':_0x56aa96[_0xfedb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3693a6,null))[_0xfedb('0x1e')](function(_0x391800){if(_0x391800){_0x26a0b2=_0x391800;_0x786622['model']=_[_0xfedb('0x41')](db[_0xfedb('0x108')][_0xfedb('0x3e')]);_0x786622['query']=_[_0xfedb('0x41')](_0x56aa96[_0xfedb('0x40')]);_0x786622[_0xfedb('0x4b')]=_[_0xfedb('0x42')](_0x786622[_0xfedb('0x3f')],_0x786622[_0xfedb('0x40')]);_0x1cef6e['attributes']=_['intersection'](_0x786622['model'],qs[_0xfedb('0x44')](_0x56aa96[_0xfedb('0x40')][_0xfedb('0x44')]));_0x1cef6e[_0xfedb('0x43')]=_0x1cef6e[_0xfedb('0x43')]['length']?_0x1cef6e[_0xfedb('0x43')]:_0x786622['model'];_0x1cef6e[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x56aa96[_0xfedb('0x40')][_0xfedb('0x49')]);_0x1cef6e[_0xfedb('0x4a')]=qs['filters'](_[_0xfedb('0x6f')](_0x56aa96[_0xfedb('0x40')],_0x786622[_0xfedb('0x4b')]));if(_0x56aa96[_0xfedb('0x40')]['filter']){_0x1cef6e[_0xfedb('0x4a')]=_['merge'](_0x1cef6e[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x1cef6e[_0xfedb('0x43')],function(_0x22bb81){var _0x2bb541={};_0x2bb541[_0x22bb81]={'$like':'%'+_0x56aa96[_0xfedb('0x40')]['filter']+'%'};return _0x2bb541;})});}_0x1cef6e=_[_0xfedb('0x4d')]({},_0x1cef6e,_0x56aa96[_0xfedb('0x53')]);return _0x26a0b2[_0xfedb('0x107')](_0x1cef6e);}})[_0xfedb('0x1e')](function(_0x2b696b){if(_0x2b696b){_0x3036cb=_0x2b696b[_0xfedb('0x45')];if(!_0x56aa96[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0x1cef6e[_0xfedb('0x2f')]=qs[_0xfedb('0x2f')](_0x56aa96[_0xfedb('0x40')][_0xfedb('0x2f')]);_0x1cef6e[_0xfedb('0x2e')]=qs[_0xfedb('0x2e')](_0x56aa96[_0xfedb('0x40')]['offset']);}return _0x26a0b2['getProactiveActions'](_0x1cef6e);}})[_0xfedb('0x1e')](function(_0x7ea235){if(_0x7ea235){return _0x7ea235?{'count':_0x3036cb,'rows':_0x7ea235}:null;}})[_0xfedb('0x1e')](respondWithResult(_0x3693a6,null))[_0xfedb('0x28')](handleError(_0x3693a6,null));};exports['getFields']=function(_0x1c8deb,_0x3faaba,_0x255734){var _0x5934d5=_0x1c8deb[_0xfedb('0x40')][_0xfedb('0x109')]===_0xfedb('0x10a')?'offlineForm':'onlineForm';return db[_0xfedb('0x54')][_0xfedb('0x60')]({'attributes':['id',_0x5934d5],'where':{'id':_0x1c8deb[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x3faaba,null))[_0xfedb('0x1e')](function(_0x1296ad){if(_0x1296ad){var _0x267596=_0x1296ad[_0x5934d5];var _0x1b7520=_0x267596&&_0x267596[_0xfedb('0x10b')]?_0x267596[_0xfedb('0x10b')]:[];_0x3faaba[_0xfedb('0xcb')]({'fromKey':_[_0xfedb('0x7d')](_0x267596[_0xfedb('0x10c')])?undefined:_0x267596['fromKey'],'count':_0x1b7520[_0xfedb('0x45')],'rows':_0x1b7520});}})[_0xfedb('0x28')](handleError(_0x3faaba,null));};exports[_0xfedb('0x10d')]=function(_0x575019,_0x14a915,_0x32d269){var _0x294a18={'raw':!![],'where':{}};var _0x1f5373={};var _0x58ad22={'count':0x0,'rows':[]};return db[_0xfedb('0x54')][_0xfedb('0x68')]({'where':{'id':_0x575019[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x14a915,null))[_0xfedb('0x1e')](function(_0xeed9f8){if(_0xeed9f8){_0x1f5373[_0xfedb('0x3f')]=_[_0xfedb('0x41')](db[_0xfedb('0xd4')]['rawAttributes']);_0x1f5373[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x575019[_0xfedb('0x40')]);_0x1f5373['filters']=_[_0xfedb('0x42')](_0x1f5373[_0xfedb('0x3f')],_0x1f5373[_0xfedb('0x40')]);_0x294a18['attributes']=_[_0xfedb('0x42')](_0x1f5373[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x575019[_0xfedb('0x40')][_0xfedb('0x44')]));_0x294a18['attributes']=_0x294a18[_0xfedb('0x43')]['length']?_0x294a18[_0xfedb('0x43')]:_0x1f5373[_0xfedb('0x3f')];if(!_0x575019[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0x294a18[_0xfedb('0x2f')]=qs[_0xfedb('0x2f')](_0x575019['query'][_0xfedb('0x2f')]);_0x294a18['offset']=qs[_0xfedb('0x2e')](_0x575019['query'][_0xfedb('0x2e')]);}_0x294a18[_0xfedb('0x48')]=qs[_0xfedb('0x49')](_0x575019[_0xfedb('0x40')][_0xfedb('0x49')]);_0x294a18[_0xfedb('0x4a')]=qs['filters'](_[_0xfedb('0x6f')](_0x575019[_0xfedb('0x40')],_0x1f5373[_0xfedb('0x4b')]));_0x294a18[_0xfedb('0x4a')][_0xfedb('0x69')]=_0xeed9f8['id'];if(_0x575019[_0xfedb('0x40')][_0xfedb('0x4c')]){_0x294a18['where']=_[_0xfedb('0x4d')](_0x294a18[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x294a18['attributes'],function(_0x5c6a0e){var _0x3e42b2={};_0x3e42b2[_0x5c6a0e]={'$like':'%'+_0x575019[_0xfedb('0x40')][_0xfedb('0x4c')]+'%'};return _0x3e42b2;})});}_0x294a18=_[_0xfedb('0x4d')]({},_0x294a18,_0x575019[_0xfedb('0x53')]);return db[_0xfedb('0xd4')][_0xfedb('0x2d')]({'where':_0x294a18[_0xfedb('0x4a')]})[_0xfedb('0x1e')](function(_0x1ec410){_0x58ad22[_0xfedb('0x2d')]=_0x1ec410;if(_0x575019[_0xfedb('0x40')][_0xfedb('0x55')]){_0x294a18[_0xfedb('0x56')]=[{'all':!![]}];}return db[_0xfedb('0xd4')]['findAll'](_0x294a18);})[_0xfedb('0x1e')](function(_0x105798){_0x58ad22['rows']=_0x105798;return _0x58ad22;});}})['then'](respondWithFilteredResult(_0x14a915,_0x294a18))[_0xfedb('0x28')](handleError(_0x14a915,null));};exports['addAgents']=function(_0x1ab9c0,_0x582c53,_0x54fa97){return db['ChatWebsite'][_0xfedb('0x60')]({'where':{'id':_0x1ab9c0[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x582c53,null))[_0xfedb('0x1e')](function(_0x41b7fa){if(_0x41b7fa){return _0x41b7fa['addAgents'](_0x1ab9c0[_0xfedb('0x5b')][_0xfedb('0x6b')],_[_0xfedb('0x10e')](_0x1ab9c0['body'],[_0xfedb('0x6b'),'id'])||{})[_0xfedb('0xb9')](function(_0x509727){for(var _0x596acc=0x0;_0x596acc<_0x1ab9c0[_0xfedb('0x5b')]['ids']['length'];_0x596acc+=0x1){socket[_0xfedb('0x10f')](_0xfedb('0x110'),{'UserId':_0x1ab9c0[_0xfedb('0x5b')][_0xfedb('0x6b')][_0x596acc],'ChatWebsiteId':_0x1ab9c0[_0xfedb('0x5a')]['id']});}return _0x509727;});}})['then'](respondWithResult(_0x582c53,null))[_0xfedb('0x28')](handleError(_0x582c53,null));};exports[_0xfedb('0x111')]=function(_0x1e7462,_0x15bd87,_0x31ee9d){return db[_0xfedb('0x54')][_0xfedb('0x60')]({'where':{'id':_0x1e7462[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x15bd87,null))[_0xfedb('0x1e')](function(_0x321261){if(_0x321261){return _0x321261[_0xfedb('0x111')](_0x1e7462[_0xfedb('0x40')]['ids'])[_0xfedb('0x1e')](function(){if(_[_0xfedb('0x112')](_0x1e7462[_0xfedb('0x40')]['ids'])){for(var _0x292845=0x0;_0x292845<_0x1e7462[_0xfedb('0x40')][_0xfedb('0x6b')][_0xfedb('0x45')];_0x292845+=0x1){socket[_0xfedb('0x10f')](_0xfedb('0x113'),{'UserId':Number(_0x1e7462[_0xfedb('0x40')]['ids'][_0x292845]),'ChatWebsiteId':Number(_0x1e7462[_0xfedb('0x5a')]['id'])});}}else{socket[_0xfedb('0x10f')](_0xfedb('0x113'),{'UserId':Number(_0x1e7462['query']['ids']),'ChatWebsiteId':Number(_0x1e7462[_0xfedb('0x5a')]['id'])});}});}})[_0xfedb('0x1e')](respondWithStatusCode(_0x15bd87,null))[_0xfedb('0x28')](handleError(_0x15bd87,null));};exports[_0xfedb('0x114')]=function(_0x3b4087,_0x136b42,_0x59fa23){var _0x218e7a={};var _0x48d801={};var _0x48c46b;var _0x529a22;return db[_0xfedb('0x54')][_0xfedb('0x68')]({'where':{'id':_0x3b4087[_0xfedb('0x5a')]['id']}})[_0xfedb('0x1e')](handleEntityNotFound(_0x136b42,null))[_0xfedb('0x1e')](function(_0x35aa60){if(_0x35aa60){_0x48c46b=_0x35aa60;_0x48d801['model']=_['keys'](db['User'][_0xfedb('0x3e')]);_0x48d801[_0xfedb('0x40')]=_[_0xfedb('0x41')](_0x3b4087[_0xfedb('0x40')]);_0x48d801[_0xfedb('0x4b')]=_[_0xfedb('0x42')](_0x48d801[_0xfedb('0x3f')],_0x48d801[_0xfedb('0x40')]);_0x218e7a['attributes']=_[_0xfedb('0x42')](_0x48d801[_0xfedb('0x3f')],qs[_0xfedb('0x44')](_0x3b4087[_0xfedb('0x40')][_0xfedb('0x44')]));_0x218e7a['attributes']=_0x218e7a[_0xfedb('0x43')][_0xfedb('0x45')]?_0x218e7a[_0xfedb('0x43')]:_0x48d801[_0xfedb('0x3f')];_0x218e7a[_0xfedb('0x48')]=qs['sort'](_0x3b4087[_0xfedb('0x40')][_0xfedb('0x49')]);_0x218e7a[_0xfedb('0x4a')]=qs[_0xfedb('0x4b')](_[_0xfedb('0x6f')](_0x3b4087[_0xfedb('0x40')],_0x48d801[_0xfedb('0x4b')]));if(_0x3b4087[_0xfedb('0x40')][_0xfedb('0x4c')]){_0x218e7a[_0xfedb('0x4a')]=_[_0xfedb('0x4d')](_0x218e7a[_0xfedb('0x4a')],{'$or':_[_0xfedb('0x4e')](_0x218e7a[_0xfedb('0x43')],function(_0x412cf5){var _0x1f9f85={};_0x1f9f85[_0x412cf5]={'$like':'%'+_0x3b4087[_0xfedb('0x40')][_0xfedb('0x4c')]+'%'};return _0x1f9f85;})});}_0x218e7a=_[_0xfedb('0x4d')]({},_0x218e7a,_0x3b4087[_0xfedb('0x53')]);return _0x48c46b['getAgents'](_0x218e7a);}})[_0xfedb('0x1e')](function(_0x5d5b85){if(_0x5d5b85){_0x529a22=_0x5d5b85['length'];if(!_0x3b4087[_0xfedb('0x40')][_0xfedb('0x46')](_0xfedb('0x47'))){_0x218e7a[_0xfedb('0x2f')]=qs['limit'](_0x3b4087[_0xfedb('0x40')][_0xfedb('0x2f')]);_0x218e7a[_0xfedb('0x2e')]=qs['offset'](_0x3b4087[_0xfedb('0x40')][_0xfedb('0x2e')]);}return _0x48c46b[_0xfedb('0x114')](_0x218e7a);}})[_0xfedb('0x1e')](function(_0x5110dd){if(_0x5110dd){return _0x5110dd?{'count':_0x529a22,'rows':_0x5110dd}:null;}})['then'](respondWithResult(_0x136b42,null))['catch'](handleError(_0x136b42,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 022c8eb..13dc211 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 _0x0560=['ChatWebsite','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x0560,0x95));var _0x0056=function(_0x2b1d5e,_0x354e28){_0x2b1d5e=_0x2b1d5e-0x0;var _0x4cdb01=_0x0560[_0x2b1d5e];return _0x4cdb01;};'use strict';var EventEmitter=require(_0x0056('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x0056('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0056('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x553bee){return function(_0x161051,_0x59d979,_0x51848e){ChatWebsiteEvents[_0x0056('0x3')](_0x553bee+':'+_0x161051['id'],_0x161051);ChatWebsiteEvents[_0x0056('0x3')](_0x553bee,_0x161051);_0x51848e(null);};}for(var e in events){if(events[_0x0056('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x0056('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3fe7=['../../mysqldb','ChatWebsite','setMaxListeners','update','emit','hook','exports','events'];(function(_0x4cc9d5,_0x4fd790){var _0x287fcf=function(_0x18cc62){while(--_0x18cc62){_0x4cc9d5['push'](_0x4cc9d5['shift']());}};_0x287fcf(++_0x4fd790);}(_0x3fe7,0x97));var _0x73fe=function(_0x2376d1,_0x38eec4){_0x2376d1=_0x2376d1-0x0;var _0x443759=_0x3fe7[_0x2376d1];return _0x443759;};'use strict';var EventEmitter=require(_0x73fe('0x0'));var ChatWebsite=require(_0x73fe('0x1'))['db'][_0x73fe('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x73fe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73fe('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe9acab){return function(_0x59eeb1,_0xf81267,_0x12b9cb){ChatWebsiteEvents['emit'](_0xe9acab+':'+_0x59eeb1['id'],_0x59eeb1);ChatWebsiteEvents[_0x73fe('0x5')](_0xe9acab,_0x59eeb1);_0x12b9cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x73fe('0x6')](e,emitEvent(event));}}module[_0x73fe('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1700826..58e3171 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 _0x725f=['chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x52bfa5,_0x42cf21){var _0x26f80b=function(_0x73c5b0){while(--_0x73c5b0){_0x52bfa5['push'](_0x52bfa5['shift']());}};_0x26f80b(++_0x42cf21);}(_0x725f,0x8d));var _0xf725=function(_0x4fcb6f,_0x12dbab){_0x4fcb6f=_0x4fcb6f-0x0;var _0x47dbb2=_0x725f[_0x4fcb6f];return _0x47dbb2;};'use strict';var _=require(_0xf725('0x0'));var util=require(_0xf725('0x1'));var logger=require(_0xf725('0x2'))(_0xf725('0x3'));var moment=require(_0xf725('0x4'));var BPromise=require(_0xf725('0x5'));var rp=require(_0xf725('0x6'));var fs=require('fs');var path=require(_0xf725('0x7'));var rimraf=require(_0xf725('0x8'));var config=require('../../config/environment');var attributes=require(_0xf725('0x9'));module[_0xf725('0xa')]=function(_0x2383fb,_0x5789d3){return _0x2383fb[_0xf725('0xb')](_0xf725('0xc'),attributes,{'tableName':_0xf725('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b1a=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3b1a,0x9e));var _0xa3b1=function(_0xd8efb0,_0x2fb48b){_0xd8efb0=_0xd8efb0-0x0;var _0x3d962c=_0x3b1a[_0xd8efb0];return _0x3d962c;};'use strict';var _=require(_0xa3b1('0x0'));var util=require(_0xa3b1('0x1'));var logger=require(_0xa3b1('0x2'))(_0xa3b1('0x3'));var moment=require(_0xa3b1('0x4'));var BPromise=require(_0xa3b1('0x5'));var rp=require(_0xa3b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b1('0x7'));var config=require(_0xa3b1('0x8'));var attributes=require(_0xa3b1('0x9'));module['exports']=function(_0x3aea3c,_0x1c2c61){return _0x3aea3c[_0xa3b1('0xa')](_0xa3b1('0xb'),attributes,{'tableName':_0xa3b1('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 7f902dc..19af400 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 _0xa413=['then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x401620,_0x445233){var _0x14e3b4=function(_0xe572a8){while(--_0xe572a8){_0x401620['push'](_0x401620['shift']());}};_0x14e3b4(++_0x445233);}(_0xa413,0x1e5));var _0x3a41=function(_0x188d1e,_0x13290d){_0x188d1e=_0x188d1e-0x0;var _0x43027b=_0xa413[_0x188d1e];return _0x43027b;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});config[_0x3a41('0xa')]=_[_0x3a41('0xb')](config[_0x3a41('0xa')],{'host':_0x3a41('0xc'),'port':0x18eb});var socket=require(_0x3a41('0xd'))(new Redis(config['redis']));require(_0x3a41('0xe'))['register'](socket);function respondWithRpcPromise(_0x562882,_0x55371e,_0x3d1037){return new BPromise(function(_0x57ef75,_0x1554ab){return client['request'](_0x562882,_0x3d1037)[_0x3a41('0xf')](function(_0xccd84e){logger['info'](_0x3a41('0x10'),_0x55371e,_0x3a41('0x11'));logger[_0x3a41('0x12')](_0x3a41('0x13'),_0x55371e,_0x3a41('0x11'),JSON['stringify'](_0xccd84e));if(_0xccd84e[_0x3a41('0x14')]){if(_0xccd84e[_0x3a41('0x14')][_0x3a41('0x15')]===0x1f4){logger[_0x3a41('0x14')](_0x3a41('0x10'),_0x55371e,_0xccd84e[_0x3a41('0x14')][_0x3a41('0x16')]);return _0x1554ab(_0xccd84e[_0x3a41('0x14')][_0x3a41('0x16')]);}logger[_0x3a41('0x14')](_0x3a41('0x10'),_0x55371e,_0xccd84e['error'][_0x3a41('0x16')]);return _0x57ef75(_0xccd84e[_0x3a41('0x14')]['message']);}else{logger['info'](_0x3a41('0x10'),_0x55371e,_0x3a41('0x11'));_0x57ef75(_0xccd84e[_0x3a41('0x17')][_0x3a41('0x16')]);}})[_0x3a41('0x18')](function(_0x38c802){logger[_0x3a41('0x14')](_0x3a41('0x10'),_0x55371e,_0x38c802);_0x1554ab(_0x38c802);});});} \ No newline at end of file +var _0x0fd7=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','ChatWebsite,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird'];(function(_0x1afe40,_0x824761){var _0x243412=function(_0x3e31f6){while(--_0x3e31f6){_0x1afe40['push'](_0x1afe40['shift']());}};_0x243412(++_0x824761);}(_0x0fd7,0x9f));var _0x70fd=function(_0x374d50,_0x28252b){_0x374d50=_0x374d50-0x0;var _0x386ef8=_0x0fd7[_0x374d50];return _0x386ef8;};'use strict';var _=require(_0x70fd('0x0'));var util=require(_0x70fd('0x1'));var moment=require('moment');var BPromise=require(_0x70fd('0x2'));var rs=require(_0x70fd('0x3'));var fs=require('fs');var Redis=require(_0x70fd('0x4'));var db=require(_0x70fd('0x5'))['db'];var utils=require(_0x70fd('0x6'));var logger=require('../../config/logger')(_0x70fd('0x7'));var config=require(_0x70fd('0x8'));var jayson=require(_0x70fd('0x9'));var client=jayson['client'][_0x70fd('0xa')]({'port':0x232a});config['redis']=_[_0x70fd('0xb')](config[_0x70fd('0xc')],{'host':_0x70fd('0xd'),'port':0x18eb});var socket=require(_0x70fd('0xe'))(new Redis(config[_0x70fd('0xc')]));require(_0x70fd('0xf'))['register'](socket);function respondWithRpcPromise(_0x93667c,_0x399699,_0x2ee927){return new BPromise(function(_0x3d3869,_0x49614d){return client[_0x70fd('0x10')](_0x93667c,_0x2ee927)[_0x70fd('0x11')](function(_0x28f038){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x399699,_0x70fd('0x12'));logger['debug'](_0x70fd('0x13'),_0x399699,_0x70fd('0x12'),JSON['stringify'](_0x28f038));if(_0x28f038['error']){if(_0x28f038['error'][_0x70fd('0x14')]===0x1f4){logger[_0x70fd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x399699,_0x28f038['error'][_0x70fd('0x16')]);return _0x49614d(_0x28f038[_0x70fd('0x15')]['message']);}logger[_0x70fd('0x15')](_0x70fd('0x17'),_0x399699,_0x28f038[_0x70fd('0x15')][_0x70fd('0x16')]);return _0x3d3869(_0x28f038[_0x70fd('0x15')]['message']);}else{logger[_0x70fd('0x18')](_0x70fd('0x17'),_0x399699,'request\x20sent');_0x3d3869(_0x28f038[_0x70fd('0x19')][_0x70fd('0x16')]);}})[_0x70fd('0x1a')](function(_0x3d807e){logger[_0x70fd('0x15')](_0x70fd('0x17'),_0x399699,_0x3d807e);_0x49614d(_0x3d807e);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 840d500..f3eb13d 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 _0xbcba=['./chatWebsite.events','save','remove','emit','removeListener','register','length','chatWebsite:'];(function(_0x1722ad,_0x45535a){var _0xa05e85=function(_0x2a5f00){while(--_0x2a5f00){_0x1722ad['push'](_0x1722ad['shift']());}};_0xa05e85(++_0x45535a);}(_0xbcba,0x198));var _0xabcb=function(_0x5356e4,_0x3e2bfd){_0x5356e4=_0x5356e4-0x0;var _0x3639fe=_0xbcba[_0x5356e4];return _0x3639fe;};'use strict';var ChatWebsiteEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),_0xabcb('0x2'),'update'];function createListener(_0x47f3ed,_0x27a915){return function(_0x5b3f97){_0x27a915[_0xabcb('0x3')](_0x47f3ed,_0x5b3f97);};}function removeListener(_0x473eb8,_0x481ed8){return function(){ChatWebsiteEvents[_0xabcb('0x4')](_0x473eb8,_0x481ed8);};}exports[_0xabcb('0x5')]=function(_0x4231a2){for(var _0x5ae465=0x0,_0x54f296=events[_0xabcb('0x6')];_0x5ae465<_0x54f296;_0x5ae465++){var _0x81df73=events[_0x5ae465];var _0x26183e=createListener(_0xabcb('0x7')+_0x81df73,_0x4231a2);ChatWebsiteEvents['on'](_0x81df73,_0x26183e);}}; \ No newline at end of file +var _0xb7d8=['chatWebsite:','save','remove','update','emit','removeListener','length'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0xb7d8,0x197));var _0x8b7d=function(_0x2743f2,_0x42015c){_0x2743f2=_0x2743f2-0x0;var _0x467e73=_0xb7d8[_0x2743f2];return _0x467e73;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8b7d('0x0'),_0x8b7d('0x1'),_0x8b7d('0x2')];function createListener(_0x5eeaf2,_0x5a50ec){return function(_0x3ba2c1){_0x5a50ec[_0x8b7d('0x3')](_0x5eeaf2,_0x3ba2c1);};}function removeListener(_0x32e2e0,_0x493cb4){return function(){ChatWebsiteEvents[_0x8b7d('0x4')](_0x32e2e0,_0x493cb4);};}exports['register']=function(_0x1577d4){for(var _0x5d33c8=0x0,_0x168a60=events[_0x8b7d('0x5')];_0x5d33c8<_0x168a60;_0x5d33c8++){var _0x1242e0=events[_0x5d33c8];var _0x3c80db=createListener(_0x8b7d('0x6')+_0x1242e0,_0x1577d4);ChatWebsiteEvents['on'](_0x1242e0,_0x3c80db);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 06bb552..43db7f8 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 _0xa4de=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','addDisposition','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','/:id/logo','single','server/files/images/avatars/','%s-%s','file','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11b7d9,_0x4f953a){var _0x55ae9c=function(_0x1db77f){while(--_0x1db77f){_0x11b7d9['push'](_0x11b7d9['shift']());}};_0x55ae9c(++_0x4f953a);}(_0xa4de,0x10d));var _0xea4d=function(_0x3abbca,_0x194d89){_0x3abbca=_0x3abbca-0x0;var _0x22cf41=_0xa4de[_0x3abbca];return _0x22cf41;};'use strict';var multer=require(_0xea4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea4d('0x1'));var express=require(_0xea4d('0x2'));var router=express[_0xea4d('0x3')]();var auth=require(_0xea4d('0x4'));var interaction=require(_0xea4d('0x5'));var config=require(_0xea4d('0x6'));var controller=require(_0xea4d('0x7'));router[_0xea4d('0x8')]('/',auth[_0xea4d('0x9')](),controller[_0xea4d('0xa')]);router[_0xea4d('0x8')](_0xea4d('0xb'),auth['isAuthenticated'](),controller[_0xea4d('0xc')]);router['get'](_0xea4d('0xd'),auth[_0xea4d('0x9')](),controller[_0xea4d('0xe')]);router[_0xea4d('0x8')](_0xea4d('0xf'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x10')]);router[_0xea4d('0x8')](_0xea4d('0x11'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x12')]);router[_0xea4d('0x8')]('/:id/logo',controller[_0xea4d('0x13')]);router[_0xea4d('0x8')](_0xea4d('0x14'),controller[_0xea4d('0x15')]);router[_0xea4d('0x8')]('/:id/customer_avatar',controller[_0xea4d('0x16')]);router[_0xea4d('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xea4d('0x8')](_0xea4d('0x17'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x18')]);router[_0xea4d('0x8')](_0xea4d('0x19'),controller[_0xea4d('0x1a')]);router['get'](_0xea4d('0x1b'),auth['isAuthenticated'](),controller[_0xea4d('0x1c')]);router[_0xea4d('0x8')](_0xea4d('0x1d'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x1e')]);router[_0xea4d('0x8')]('/:id/fields',controller[_0xea4d('0x1f')]);router['get'](_0xea4d('0x20'),auth['isAuthenticated'](),controller[_0xea4d('0x21')]);router[_0xea4d('0x8')]('/:id/users',auth[_0xea4d('0x9')](),controller[_0xea4d('0x22')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea4d('0x23')]);router['post']('/:id/dispositions',auth[_0xea4d('0x9')](),controller[_0xea4d('0x24')]);router[_0xea4d('0x25')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xea4d('0x26')]);var upload=multer({'storage':multer[_0xea4d('0x27')]({'destination':function(_0x103fee,_0x53f919,_0xd2fa11){_0xd2fa11(null,path[_0xea4d('0x28')](config[_0xea4d('0x29')],_0xea4d('0x2a')));},'filename':function(_0xb47f12,_0x5ef167,_0x479731){_0x479731(null,util[_0xea4d('0x2b')]('%s-%s',Date[_0xea4d('0x2c')](),_0x5ef167['originalname']));}})});router[_0xea4d('0x25')](_0xea4d('0x2d'),upload[_0xea4d('0x2e')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x540b0c,_0x3b9bd4,_0x24fa5f){_0x24fa5f(null,path[_0xea4d('0x28')](config[_0xea4d('0x29')],_0xea4d('0x2f')));},'filename':function(_0x24c497,_0x376b7e,_0x563706){_0x563706(null,util[_0xea4d('0x2b')](_0xea4d('0x30'),Date['now'](),_0x376b7e['originalname']));}})});router[_0xea4d('0x25')]('/:id/avatar',upload[_0xea4d('0x2e')](_0xea4d('0x31')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x224000,_0x34a66b,_0x745d44){_0x745d44(null,path['join'](config[_0xea4d('0x29')],_0xea4d('0x2f')));},'filename':function(_0x455439,_0x15307f,_0x5e3860){_0x5e3860(null,util['format'](_0xea4d('0x30'),Date[_0xea4d('0x2c')](),_0x15307f[_0xea4d('0x32')]));}})});router[_0xea4d('0x25')](_0xea4d('0x33'),upload[_0xea4d('0x2e')](_0xea4d('0x31')),controller[_0xea4d('0x34')]);var upload=multer({'storage':multer[_0xea4d('0x27')]({'destination':function(_0x182784,_0x42ded4,_0x10b5e4){_0x10b5e4(null,path[_0xea4d('0x28')](config['root'],_0xea4d('0x2f')));},'filename':function(_0xf5f2ae,_0x233fb7,_0x34ab1d){_0x34ab1d(null,util[_0xea4d('0x2b')](_0xea4d('0x30'),Date[_0xea4d('0x2c')](),_0x233fb7['originalname']));}})});router[_0xea4d('0x25')](_0xea4d('0x35'),upload[_0xea4d('0x2e')](_0xea4d('0x31')),controller[_0xea4d('0x36')]);router[_0xea4d('0x25')](_0xea4d('0x37'),controller[_0xea4d('0x38')]);router[_0xea4d('0x25')](_0xea4d('0x39'),controller['offline']);router['post'](_0xea4d('0x17'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x3a')]);router[_0xea4d('0x25')]('/:id/applications',auth[_0xea4d('0x9')](),controller[_0xea4d('0x3b')]);router[_0xea4d('0x25')](_0xea4d('0x1d'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x3c')]);router[_0xea4d('0x25')](_0xea4d('0x3d'),auth[_0xea4d('0x9')](),controller['addAgents']);router[_0xea4d('0x3e')](_0xea4d('0xd'),auth['isAuthenticated'](),controller[_0xea4d('0x3f')]);router[_0xea4d('0x40')]('/:id',auth[_0xea4d('0x9')](),controller['destroy']);router[_0xea4d('0x40')](_0xea4d('0xf'),auth['isAuthenticated'](),controller[_0xea4d('0x41')]);router[_0xea4d('0x40')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xea4d('0x42')]);router[_0xea4d('0x40')](_0xea4d('0x3d'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x43')]);module[_0xea4d('0x44')]=router; \ No newline at end of file +var _0xfa2b=['getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','addDisposition','post','addAnswer','diskStorage','join','server/files/images/logos/','format','now','originalname','/:id/logo','single','addLogo','root','server/files/images/avatars/','%s-%s','file','addCustomerAvatar','/:id/notify','notify','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions'];(function(_0x2bacae,_0xa68196){var _0x4b3c1e=function(_0x1ab6f8){while(--_0x1ab6f8){_0x2bacae['push'](_0x2bacae['shift']());}};_0x4b3c1e(++_0xa68196);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x4fc850,_0x174200){_0x4fc850=_0x4fc850-0x0;var _0x520458=_0xfa2b[_0x4fc850];return _0x520458;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var timeout=require(_0xbfa2('0x3'));var express=require(_0xbfa2('0x4'));var router=express[_0xbfa2('0x5')]();var auth=require(_0xbfa2('0x6'));var interaction=require(_0xbfa2('0x7'));var config=require(_0xbfa2('0x8'));var controller=require(_0xbfa2('0x9'));router[_0xbfa2('0xa')]('/',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0xc')]);router[_0xbfa2('0xa')](_0xbfa2('0xd'),auth[_0xbfa2('0xb')](),controller['describe']);router[_0xbfa2('0xa')]('/:id',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0xe')]);router[_0xbfa2('0xa')](_0xbfa2('0xf'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x10')]);router[_0xbfa2('0xa')](_0xbfa2('0x11'),auth[_0xbfa2('0xb')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0xbfa2('0x12')]);router[_0xbfa2('0xa')](_0xbfa2('0x13'),controller[_0xbfa2('0x14')]);router[_0xbfa2('0xa')](_0xbfa2('0x15'),controller['getCustomerAvatar']);router[_0xbfa2('0xa')](_0xbfa2('0x16'),controller[_0xbfa2('0x17')]);router[_0xbfa2('0xa')](_0xbfa2('0x18'),auth['isAuthenticated'](),controller[_0xbfa2('0x19')]);router['get']('/:id/snippet',controller[_0xbfa2('0x1a')]);router['get']('/:id/applications',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x1b')]);router['get'](_0xbfa2('0x1c'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x1d')]);router[_0xbfa2('0xa')](_0xbfa2('0x1e'),controller[_0xbfa2('0x1f')]);router[_0xbfa2('0xa')]('/:id/offline_messages',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x20')]);router[_0xbfa2('0xa')]('/:id/users',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x21')]);router['post']('/',auth[_0xbfa2('0xb')](),controller['create']);router['post'](_0xbfa2('0xf'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x22')]);router[_0xbfa2('0x23')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbfa2('0x24')]);var upload=multer({'storage':multer[_0xbfa2('0x25')]({'destination':function(_0x5e6e80,_0x1a5249,_0x540d5c){_0x540d5c(null,path[_0xbfa2('0x26')](config['root'],_0xbfa2('0x27')));},'filename':function(_0xbe4d26,_0x8488e1,_0x38c5dc){_0x38c5dc(null,util[_0xbfa2('0x28')]('%s-%s',Date[_0xbfa2('0x29')](),_0x8488e1[_0xbfa2('0x2a')]));}})});router['post'](_0xbfa2('0x2b'),upload[_0xbfa2('0x2c')]('file'),controller[_0xbfa2('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16bc84,_0x56dd44,_0x8b7c9){_0x8b7c9(null,path[_0xbfa2('0x26')](config[_0xbfa2('0x2e')],_0xbfa2('0x2f')));},'filename':function(_0x49d563,_0x30cea7,_0x4aac4e){_0x4aac4e(null,util[_0xbfa2('0x28')](_0xbfa2('0x30'),Date[_0xbfa2('0x29')](),_0x30cea7['originalname']));}})});router[_0xbfa2('0x23')](_0xbfa2('0x13'),upload[_0xbfa2('0x2c')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d5050,_0x12069c,_0x55e318){_0x55e318(null,path[_0xbfa2('0x26')](config[_0xbfa2('0x2e')],_0xbfa2('0x2f')));},'filename':function(_0x206119,_0x53dd76,_0x2d20fe){_0x2d20fe(null,util[_0xbfa2('0x28')]('%s-%s',Date[_0xbfa2('0x29')](),_0x53dd76[_0xbfa2('0x2a')]));}})});router[_0xbfa2('0x23')](_0xbfa2('0x15'),upload[_0xbfa2('0x2c')](_0xbfa2('0x31')),controller[_0xbfa2('0x32')]);var upload=multer({'storage':multer[_0xbfa2('0x25')]({'destination':function(_0x787887,_0x5d6c57,_0x79c2bd){_0x79c2bd(null,path['join'](config[_0xbfa2('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x17c2d1,_0x2915ce,_0x1611b0){_0x1611b0(null,util[_0xbfa2('0x28')](_0xbfa2('0x30'),Date['now'](),_0x2915ce[_0xbfa2('0x2a')]));}})});router[_0xbfa2('0x23')](_0xbfa2('0x16'),upload[_0xbfa2('0x2c')](_0xbfa2('0x31')),controller['addSystemAvatar']);router['post'](_0xbfa2('0x33'),controller[_0xbfa2('0x34')]);router[_0xbfa2('0x23')]('/:id/offline',controller['offline']);router[_0xbfa2('0x23')](_0xbfa2('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xbfa2('0x23')](_0xbfa2('0x35'),auth['isAuthenticated'](),controller[_0xbfa2('0x36')]);router[_0xbfa2('0x23')](_0xbfa2('0x1c'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x37')]);router[_0xbfa2('0x23')](_0xbfa2('0x38'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x39')]);router[_0xbfa2('0x3a')](_0xbfa2('0x3b'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x3c')]);router[_0xbfa2('0x3d')](_0xbfa2('0x3b'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x3e')]);router['delete'](_0xbfa2('0xf'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x3f')]);router[_0xbfa2('0x3d')](_0xbfa2('0x11'),auth[_0xbfa2('0xb')](),controller['removeAnswers']);router[_0xbfa2('0x3d')]('/:id/users',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x40')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 1b24bbb..ec30fca 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 _0xe943=['exports','STRING','name','sequelize'];(function(_0x549356,_0x34e92e){var _0x2723ea=function(_0x5e50de){while(--_0x5e50de){_0x549356['push'](_0x549356['shift']());}};_0x2723ea(++_0x34e92e);}(_0xe943,0xe3));var _0x3e94=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xe943[_0x5e8c32];return _0x595f7b;};'use strict';var Sequelize=require(_0x3e94('0x0'));module[_0x3e94('0x1')]={'name':{'type':Sequelize[_0x3e94('0x2')],'unique':_0x3e94('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3e94('0x2')]},'companyId':{'type':Sequelize[_0x3e94('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3e94('0x2')]},'street':{'type':Sequelize[_0x3e94('0x2')]},'postalCode':{'type':Sequelize[_0x3e94('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3e94('0x2')]},'email':{'type':Sequelize[_0x3e94('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3e94('0x2')]},'sPostalCode':{'type':Sequelize[_0x3e94('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3e94('0x2')]},'description':{'type':Sequelize[_0x3e94('0x2')]}}; \ No newline at end of file +var _0xf86e=['name','STRING'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xf86e,0x1a3));var _0xef86=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0xf86e[_0x38ff1e];return _0x3755d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xef86('0x0')],'unique':_0xef86('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xef86('0x0')]},'website':{'type':Sequelize[_0xef86('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xef86('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xef86('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xef86('0x0')]},'country':{'type':Sequelize[_0xef86('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xef86('0x0')]},'sStreet':{'type':Sequelize[_0xef86('0x0')]},'sPostalCode':{'type':Sequelize[_0xef86('0x0')]},'sCity':{'type':Sequelize[_0xef86('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef86('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 56617d9..0ebfc81 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 _0x6e6f=['autoAssociation','params','CmContact','addContacts','ids','omit','map','nolimit','getContacts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','count','includeAll','include','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0xaf3a3c,_0x50f69f){var _0x16f43e=function(_0x256f36){while(--_0x256f36){_0xaf3a3c['push'](_0xaf3a3c['shift']());}};_0x16f43e(++_0x50f69f);}(_0x6e6f,0x1c6));var _0xf6e6=function(_0xf1f2e0,_0x37c415){_0xf1f2e0=_0xf1f2e0-0x0;var _0x991373=_0x6e6f[_0xf1f2e0];return _0x991373;};'use strict';var pdf=require(_0xf6e6('0x0'));var emlformat=require(_0xf6e6('0x1'));var rimraf=require(_0xf6e6('0x2'));var zipdir=require(_0xf6e6('0x3'));var jsonpatch=require(_0xf6e6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6e6('0x5'));var Mustache=require(_0xf6e6('0x6'));var util=require(_0xf6e6('0x7'));var path=require(_0xf6e6('0x8'));var sox=require(_0xf6e6('0x9'));var csv=require(_0xf6e6('0xa'));var ejs=require(_0xf6e6('0xb'));var fs=require('fs');var _=require(_0xf6e6('0xc'));var squel=require(_0xf6e6('0xd'));var crypto=require(_0xf6e6('0xe'));var jsforce=require(_0xf6e6('0xf'));var deskjs=require(_0xf6e6('0x10'));var toCsv=require(_0xf6e6('0xa'));var querystring=require('querystring');var Papa=require(_0xf6e6('0x11'));var Redis=require(_0xf6e6('0x12'));var authService=require(_0xf6e6('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf6e6('0x14'));var logger=require(_0xf6e6('0x15'))(_0xf6e6('0x16'));var utils=require(_0xf6e6('0x17'));var config=require('../../config/environment');var db=require(_0xf6e6('0x18'))['db'];function respondWithStatusCode(_0x2fb6f2,_0x3ea70e){_0x3ea70e=_0x3ea70e||0xcc;return function(_0xf30471){if(_0xf30471){return _0x2fb6f2['sendStatus'](_0x3ea70e);}return _0x2fb6f2[_0xf6e6('0x19')](_0x3ea70e)['end']();};}function respondWithResult(_0x5ed79a,_0x832531){_0x832531=_0x832531||0xc8;return function(_0x326cfc){if(_0x326cfc){return _0x5ed79a[_0xf6e6('0x19')](_0x832531)[_0xf6e6('0x1a')](_0x326cfc);}};}function respondWithFilteredResult(_0x37a88a,_0x50e6d0){return function(_0xe1d94f){if(_0xe1d94f){var _0x114c68=_0xe1d94f['count'],_0x134687=_0x50e6d0[_0xf6e6('0x1b')],_0x3ed42c=_0x50e6d0[_0xf6e6('0x1b')]+_0x50e6d0['limit'],_0x24a350;if(_0x3ed42c>=_0x114c68){_0x3ed42c=_0x114c68;_0x24a350=0xc8;}else{_0x24a350=0xce;}_0x37a88a[_0xf6e6('0x19')](_0x24a350);return _0x37a88a[_0xf6e6('0x1c')](_0xf6e6('0x1d'),_0x134687+'-'+_0x3ed42c+'/'+_0x114c68)['json'](_0xe1d94f);}return null;};}function patchUpdates(_0x3143ea){return function(_0x5c7c68){try{jsonpatch[_0xf6e6('0x1e')](_0x5c7c68,_0x3143ea,!![]);}catch(_0x373306){return BPromise[_0xf6e6('0x1f')](_0x373306);}return _0x5c7c68[_0xf6e6('0x20')]();};}function saveUpdates(_0xd6d5dd,_0x5be667){return function(_0x5050bf){if(_0x5050bf){return _0x5050bf[_0xf6e6('0x21')](_0xd6d5dd)['then'](function(_0x63f4a5){return _0x63f4a5;});}return null;};}function removeEntity(_0x534354,_0x320265){return function(_0x521b57){if(_0x521b57){return _0x521b57['destroy']()[_0xf6e6('0x22')](function(){var _0x402aa5=_0x521b57[_0xf6e6('0x23')]({'plain':!![]});var _0x189121=_0xf6e6('0x24');return db[_0xf6e6('0x25')][_0xf6e6('0x26')]({'where':{'type':_0x189121,'resourceId':_0x402aa5['id']}})['then'](function(){return _0x521b57;});})['then'](function(){_0x534354[_0xf6e6('0x19')](0xcc)[_0xf6e6('0x27')]();});}};}function handleEntityNotFound(_0x3db7bf,_0x3f1416){return function(_0x486c60){if(!_0x486c60){_0x3db7bf[_0xf6e6('0x28')](0x194);}return _0x486c60;};}function handleError(_0x3800b2,_0x2e5c57){_0x2e5c57=_0x2e5c57||0x1f4;return function(_0x4fb359){logger[_0xf6e6('0x29')](_0x4fb359[_0xf6e6('0x2a')]);if(_0x4fb359['name']){delete _0x4fb359[_0xf6e6('0x2b')];}_0x3800b2[_0xf6e6('0x19')](_0x2e5c57)[_0xf6e6('0x2c')](_0x4fb359);};}exports[_0xf6e6('0x2d')]=function(_0x45e874,_0x2e2c52){var _0x4e549d={},_0x2f2c0b={},_0x534b70={'count':0x0,'rows':[]};var _0x1ce11a=db[_0xf6e6('0x2e')]['rawAttributes'];_0x2f2c0b[_0xf6e6('0x2f')]=_[_0xf6e6('0x30')](_0x1ce11a);_0x2f2c0b[_0xf6e6('0x31')]=_[_0xf6e6('0x30')](_0x45e874[_0xf6e6('0x31')]);_0x2f2c0b[_0xf6e6('0x32')]=_[_0xf6e6('0x33')](_0x2f2c0b[_0xf6e6('0x2f')],_0x2f2c0b['query']);_0x4e549d[_0xf6e6('0x34')]=_[_0xf6e6('0x33')](_0x2f2c0b[_0xf6e6('0x2f')],qs[_0xf6e6('0x35')](_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x35')]));_0x4e549d[_0xf6e6('0x34')]=_0x4e549d[_0xf6e6('0x34')]['length']?_0x4e549d[_0xf6e6('0x34')]:_0x2f2c0b[_0xf6e6('0x2f')];if(!_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x36')]('nolimit')){_0x4e549d['limit']=qs[_0xf6e6('0x37')](_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x37')]);_0x4e549d['offset']=qs[_0xf6e6('0x1b')](_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x1b')]);}_0x4e549d[_0xf6e6('0x38')]=qs[_0xf6e6('0x39')](_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x39')]);_0x4e549d[_0xf6e6('0x3a')]=qs[_0xf6e6('0x32')](_[_0xf6e6('0x3b')](_0x45e874[_0xf6e6('0x31')],_0x2f2c0b[_0xf6e6('0x32')]));if(_0x45e874['query']['filter']){_0x4e549d[_0xf6e6('0x3a')]=_[_0xf6e6('0x3c')](_0x4e549d['where'],{'$or':_['map'](_0x1ce11a,function(_0xa88025){if(_0xa88025[_0xf6e6('0x3d')]['key']!==_0xf6e6('0x3e')){var _0xcd22d4={};_0xcd22d4[_0xa88025[_0xf6e6('0x3f')]]={'$like':'%'+_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x40')]+'%'};return _0xcd22d4;}})});}_0x4e549d=_[_0xf6e6('0x3c')]({},_0x4e549d,_0x45e874[_0xf6e6('0x41')]);var _0x18a259={'where':_0x4e549d[_0xf6e6('0x3a')]};return db['CmCompany'][_0xf6e6('0x42')](_0x18a259)[_0xf6e6('0x22')](function(_0x2fcf8d){_0x534b70['count']=_0x2fcf8d;if(_0x45e874[_0xf6e6('0x31')][_0xf6e6('0x43')]){_0x4e549d[_0xf6e6('0x44')]=[{'all':!![]}];}return db[_0xf6e6('0x2e')]['findAll'](_0x4e549d);})[_0xf6e6('0x22')](function(_0x468704){_0x534b70['rows']=_0x468704;return _0x534b70;})[_0xf6e6('0x22')](respondWithFilteredResult(_0x2e2c52,_0x4e549d))[_0xf6e6('0x45')](handleError(_0x2e2c52,null));};exports[_0xf6e6('0x46')]=function(_0x4d2ab3,_0x4a043a){var _0x399545={'raw':![],'where':{'id':_0x4d2ab3['params']['id']}},_0x3d57de={};_0x3d57de[_0xf6e6('0x2f')]=_['keys'](db[_0xf6e6('0x2e')]['rawAttributes']);_0x3d57de['query']=_['keys'](_0x4d2ab3[_0xf6e6('0x31')]);_0x3d57de[_0xf6e6('0x32')]=_['intersection'](_0x3d57de['model'],_0x3d57de[_0xf6e6('0x31')]);_0x399545[_0xf6e6('0x34')]=_[_0xf6e6('0x33')](_0x3d57de[_0xf6e6('0x2f')],qs[_0xf6e6('0x35')](_0x4d2ab3['query']['fields']));_0x399545[_0xf6e6('0x34')]=_0x399545[_0xf6e6('0x34')][_0xf6e6('0x47')]?_0x399545[_0xf6e6('0x34')]:_0x3d57de[_0xf6e6('0x2f')];if(_0x4d2ab3[_0xf6e6('0x31')][_0xf6e6('0x43')]){_0x399545['include']=[{'all':!![]}];}_0x399545=_[_0xf6e6('0x3c')]({},_0x399545,_0x4d2ab3[_0xf6e6('0x41')]);return db[_0xf6e6('0x2e')][_0xf6e6('0x48')](_0x399545)[_0xf6e6('0x22')](handleEntityNotFound(_0x4a043a,null))[_0xf6e6('0x22')](respondWithResult(_0x4a043a,null))[_0xf6e6('0x45')](handleError(_0x4a043a,null));};exports[_0xf6e6('0x49')]=function(_0x5c0c59,_0x436390){return db['CmCompany'][_0xf6e6('0x49')](_0x5c0c59[_0xf6e6('0x4a')],{})[_0xf6e6('0x22')](function(_0xfd9d2c){var _0x34513a=_0x5c0c59[_0xf6e6('0x4b')][_0xf6e6('0x23')]({'plain':!![]});if(!_0x34513a)throw new Error(_0xf6e6('0x4c'));if(_0x34513a[_0xf6e6('0x4d')]===_0xf6e6('0x4b')){var _0x22d630=_0xfd9d2c[_0xf6e6('0x23')]({'plain':!![]});var _0x38d5dc='Companies';return db[_0xf6e6('0x4e')][_0xf6e6('0x48')]({'where':{'name':_0x38d5dc,'userProfileId':_0x34513a[_0xf6e6('0x4f')]},'raw':!![]})[_0xf6e6('0x22')](function(_0x297f57){if(_0x297f57&&_0x297f57[_0xf6e6('0x50')]===0x0){return db[_0xf6e6('0x25')][_0xf6e6('0x49')]({'name':_0x22d630[_0xf6e6('0x2b')],'resourceId':_0x22d630['id'],'type':_0x297f57['name'],'sectionId':_0x297f57['id']},{})[_0xf6e6('0x22')](function(){return _0xfd9d2c;});}else{return _0xfd9d2c;}})[_0xf6e6('0x45')](function(_0x4d95a4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d95a4);throw _0x4d95a4;});}return _0xfd9d2c;})[_0xf6e6('0x22')](respondWithResult(_0x436390,0xc9))[_0xf6e6('0x45')](handleError(_0x436390,null));};exports[_0xf6e6('0x21')]=function(_0x3bddc8,_0x186509){if(_0x3bddc8[_0xf6e6('0x4a')]['id']){delete _0x3bddc8[_0xf6e6('0x4a')]['id'];}return db[_0xf6e6('0x2e')]['find']({'where':{'id':_0x3bddc8[_0xf6e6('0x51')]['id']}})[_0xf6e6('0x22')](handleEntityNotFound(_0x186509,null))[_0xf6e6('0x22')](saveUpdates(_0x3bddc8[_0xf6e6('0x4a')],null))['then'](respondWithResult(_0x186509,null))[_0xf6e6('0x45')](handleError(_0x186509,null));};exports[_0xf6e6('0x26')]=function(_0x5c9b19,_0x22810b){return db[_0xf6e6('0x2e')][_0xf6e6('0x48')]({'where':{'id':_0x5c9b19[_0xf6e6('0x51')]['id']}})[_0xf6e6('0x22')](handleEntityNotFound(_0x22810b,null))[_0xf6e6('0x22')](removeEntity(_0x22810b,null))[_0xf6e6('0x45')](handleError(_0x22810b,null));};exports['addContacts']=function(_0x2e506f,_0x33ef69,_0x49f747){return db[_0xf6e6('0x52')][_0xf6e6('0x48')]({'where':{'id':_0x2e506f[_0xf6e6('0x51')]['id']}})[_0xf6e6('0x22')](handleEntityNotFound(_0x33ef69,null))['then'](function(_0x2b66a5){if(_0x2b66a5){return _0x2b66a5[_0xf6e6('0x53')](_0x2e506f[_0xf6e6('0x4a')][_0xf6e6('0x54')],_[_0xf6e6('0x55')](_0x2e506f[_0xf6e6('0x4a')],[_0xf6e6('0x54'),'id'])||{});}})['then'](respondWithResult(_0x33ef69,null))[_0xf6e6('0x45')](handleError(_0x33ef69,null));};exports['getContacts']=function(_0x4f6bbd,_0x470127,_0x1ea70d){var _0x5f44d4={};var _0x1ac2af={};var _0x357df0;var _0xa7f66e;return db[_0xf6e6('0x2e')]['findOne']({'where':{'id':_0x4f6bbd['params']['id']}})[_0xf6e6('0x22')](handleEntityNotFound(_0x470127,null))[_0xf6e6('0x22')](function(_0x139cad){if(_0x139cad){_0x357df0=_0x139cad;_0x1ac2af[_0xf6e6('0x2f')]=_['keys'](db[_0xf6e6('0x52')]['rawAttributes']);_0x1ac2af[_0xf6e6('0x31')]=_[_0xf6e6('0x30')](_0x4f6bbd['query']);_0x1ac2af[_0xf6e6('0x32')]=_['intersection'](_0x1ac2af[_0xf6e6('0x2f')],_0x1ac2af[_0xf6e6('0x31')]);_0x5f44d4['attributes']=_[_0xf6e6('0x33')](_0x1ac2af[_0xf6e6('0x2f')],qs[_0xf6e6('0x35')](_0x4f6bbd['query'][_0xf6e6('0x35')]));_0x5f44d4['attributes']=_0x5f44d4['attributes']['length']?_0x5f44d4['attributes']:_0x1ac2af[_0xf6e6('0x2f')];_0x5f44d4[_0xf6e6('0x38')]=qs['sort'](_0x4f6bbd[_0xf6e6('0x31')][_0xf6e6('0x39')]);_0x5f44d4['where']=qs[_0xf6e6('0x32')](_[_0xf6e6('0x3b')](_0x4f6bbd[_0xf6e6('0x31')],_0x1ac2af['filters']));if(_0x4f6bbd['query'][_0xf6e6('0x40')]){_0x5f44d4['where']=_[_0xf6e6('0x3c')](_0x5f44d4[_0xf6e6('0x3a')],{'$or':_[_0xf6e6('0x56')](_0x5f44d4[_0xf6e6('0x34')],function(_0x1642ec){var _0x1765a7={};_0x1765a7[_0x1642ec]={'$like':'%'+_0x4f6bbd[_0xf6e6('0x31')]['filter']+'%'};return _0x1765a7;})});}_0x5f44d4=_['merge']({},_0x5f44d4,_0x4f6bbd[_0xf6e6('0x41')]);return _0x357df0['getContacts'](_0x5f44d4);}})['then'](function(_0x5d318a){if(_0x5d318a){_0xa7f66e=_0x5d318a[_0xf6e6('0x47')];if(!_0x4f6bbd[_0xf6e6('0x31')][_0xf6e6('0x36')](_0xf6e6('0x57'))){_0x5f44d4['limit']=qs[_0xf6e6('0x37')](_0x4f6bbd[_0xf6e6('0x31')]['limit']);_0x5f44d4['offset']=qs[_0xf6e6('0x1b')](_0x4f6bbd[_0xf6e6('0x31')][_0xf6e6('0x1b')]);}return _0x357df0[_0xf6e6('0x58')](_0x5f44d4);}})[_0xf6e6('0x22')](function(_0x2041a5){if(_0x2041a5){return _0x2041a5?{'count':_0xa7f66e,'rows':_0x2041a5}:null;}})[_0xf6e6('0x22')](respondWithResult(_0x470127,null))[_0xf6e6('0x45')](handleError(_0x470127,null));}; \ No newline at end of file +var _0xf04a=['set','Content-Range','reject','save','destroy','UserProfileResource','then','name','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','field','options','CmCompany','include','findAll','rows','catch','show','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','ids','omit','getContacts','CmContact','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x5b7b98,_0x4de053){var _0xa76299=function(_0x6e1d8b){while(--_0x6e1d8b){_0x5b7b98['push'](_0x5b7b98['shift']());}};_0xa76299(++_0x4de053);}(_0xf04a,0x8f));var _0xaf04=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf04a[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xaf04('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaf04('0x1'));var zipdir=require(_0xaf04('0x2'));var jsonpatch=require(_0xaf04('0x3'));var rp=require('request-promise');var moment=require(_0xaf04('0x4'));var BPromise=require(_0xaf04('0x5'));var Mustache=require(_0xaf04('0x6'));var util=require(_0xaf04('0x7'));var path=require(_0xaf04('0x8'));var sox=require(_0xaf04('0x9'));var csv=require('to-csv');var ejs=require(_0xaf04('0xa'));var fs=require('fs');var _=require(_0xaf04('0xb'));var squel=require(_0xaf04('0xc'));var crypto=require(_0xaf04('0xd'));var jsforce=require(_0xaf04('0xe'));var deskjs=require(_0xaf04('0xf'));var toCsv=require(_0xaf04('0x10'));var querystring=require(_0xaf04('0x11'));var Papa=require(_0xaf04('0x12'));var Redis=require(_0xaf04('0x13'));var authService=require(_0xaf04('0x14'));var qs=require(_0xaf04('0x15'));var hardwareService=require(_0xaf04('0x16'));var logger=require(_0xaf04('0x17'))(_0xaf04('0x18'));var utils=require(_0xaf04('0x19'));var config=require('../../config/environment');var db=require(_0xaf04('0x1a'))['db'];function respondWithStatusCode(_0xd10371,_0x27c008){_0x27c008=_0x27c008||0xcc;return function(_0x446b91){if(_0x446b91){return _0xd10371[_0xaf04('0x1b')](_0x27c008);}return _0xd10371[_0xaf04('0x1c')](_0x27c008)[_0xaf04('0x1d')]();};}function respondWithResult(_0x699022,_0x5a3733){_0x5a3733=_0x5a3733||0xc8;return function(_0x79ec49){if(_0x79ec49){return _0x699022['status'](_0x5a3733)[_0xaf04('0x1e')](_0x79ec49);}};}function respondWithFilteredResult(_0x30b7bb,_0x1e3d0e){return function(_0x3a4945){if(_0x3a4945){var _0x535bd5=_0x3a4945[_0xaf04('0x1f')],_0x571daf=_0x1e3d0e['offset'],_0x55815=_0x1e3d0e[_0xaf04('0x20')]+_0x1e3d0e['limit'],_0x3088d1;if(_0x55815>=_0x535bd5){_0x55815=_0x535bd5;_0x3088d1=0xc8;}else{_0x3088d1=0xce;}_0x30b7bb[_0xaf04('0x1c')](_0x3088d1);return _0x30b7bb[_0xaf04('0x21')](_0xaf04('0x22'),_0x571daf+'-'+_0x55815+'/'+_0x535bd5)[_0xaf04('0x1e')](_0x3a4945);}return null;};}function patchUpdates(_0x3d6895){return function(_0x1632f){try{jsonpatch['apply'](_0x1632f,_0x3d6895,!![]);}catch(_0x349bfd){return BPromise[_0xaf04('0x23')](_0x349bfd);}return _0x1632f[_0xaf04('0x24')]();};}function saveUpdates(_0x49675d,_0x2efc0d){return function(_0x3b7fff){if(_0x3b7fff){return _0x3b7fff['update'](_0x49675d)['then'](function(_0x4b355d){return _0x4b355d;});}return null;};}function removeEntity(_0x1d0044,_0xd9a3f5){return function(_0x2e802c){if(_0x2e802c){return _0x2e802c[_0xaf04('0x25')]()['then'](function(){var _0xefe12a=_0x2e802c['get']({'plain':!![]});var _0x115c49='Companies';return db[_0xaf04('0x26')][_0xaf04('0x25')]({'where':{'type':_0x115c49,'resourceId':_0xefe12a['id']}})[_0xaf04('0x27')](function(){return _0x2e802c;});})[_0xaf04('0x27')](function(){_0x1d0044[_0xaf04('0x1c')](0xcc)[_0xaf04('0x1d')]();});}};}function handleEntityNotFound(_0x2867f1,_0x1005b5){return function(_0x5cdad8){if(!_0x5cdad8){_0x2867f1[_0xaf04('0x1b')](0x194);}return _0x5cdad8;};}function handleError(_0xaee84b,_0x4b0dc8){_0x4b0dc8=_0x4b0dc8||0x1f4;return function(_0x59175b){logger['error'](_0x59175b['stack']);if(_0x59175b[_0xaf04('0x28')]){delete _0x59175b['name'];}_0xaee84b[_0xaf04('0x1c')](_0x4b0dc8)[_0xaf04('0x29')](_0x59175b);};}exports[_0xaf04('0x2a')]=function(_0x3c2bdc,_0xd22fae){var _0x3b2afb={},_0x358068={},_0x12d532={'count':0x0,'rows':[]};var _0x44ebfd=db['CmCompany'][_0xaf04('0x2b')];_0x358068[_0xaf04('0x2c')]=_[_0xaf04('0x2d')](_0x44ebfd);_0x358068['query']=_[_0xaf04('0x2d')](_0x3c2bdc[_0xaf04('0x2e')]);_0x358068['filters']=_['intersection'](_0x358068[_0xaf04('0x2c')],_0x358068['query']);_0x3b2afb[_0xaf04('0x2f')]=_[_0xaf04('0x30')](_0x358068[_0xaf04('0x2c')],qs['fields'](_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x31')]));_0x3b2afb[_0xaf04('0x2f')]=_0x3b2afb[_0xaf04('0x2f')][_0xaf04('0x32')]?_0x3b2afb['attributes']:_0x358068[_0xaf04('0x2c')];if(!_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x33')](_0xaf04('0x34'))){_0x3b2afb[_0xaf04('0x35')]=qs[_0xaf04('0x35')](_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x35')]);_0x3b2afb[_0xaf04('0x20')]=qs['offset'](_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x20')]);}_0x3b2afb[_0xaf04('0x36')]=qs['sort'](_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x37')]);_0x3b2afb[_0xaf04('0x38')]=qs[_0xaf04('0x39')](_[_0xaf04('0x3a')](_0x3c2bdc[_0xaf04('0x2e')],_0x358068[_0xaf04('0x39')]));if(_0x3c2bdc[_0xaf04('0x2e')][_0xaf04('0x3b')]){_0x3b2afb[_0xaf04('0x38')]=_[_0xaf04('0x3c')](_0x3b2afb[_0xaf04('0x38')],{'$or':_[_0xaf04('0x3d')](_0x44ebfd,function(_0x210e72){if(_0x210e72['type'][_0xaf04('0x3e')]!=='VIRTUAL'){var _0x1d9919={};_0x1d9919[_0x210e72[_0xaf04('0x3f')]]={'$like':'%'+_0x3c2bdc[_0xaf04('0x2e')]['filter']+'%'};return _0x1d9919;}})});}_0x3b2afb=_[_0xaf04('0x3c')]({},_0x3b2afb,_0x3c2bdc[_0xaf04('0x40')]);var _0x189aea={'where':_0x3b2afb['where']};return db[_0xaf04('0x41')][_0xaf04('0x1f')](_0x189aea)['then'](function(_0x273c8c){_0x12d532['count']=_0x273c8c;if(_0x3c2bdc['query']['includeAll']){_0x3b2afb[_0xaf04('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xaf04('0x43')](_0x3b2afb);})[_0xaf04('0x27')](function(_0x14a155){_0x12d532[_0xaf04('0x44')]=_0x14a155;return _0x12d532;})[_0xaf04('0x27')](respondWithFilteredResult(_0xd22fae,_0x3b2afb))[_0xaf04('0x45')](handleError(_0xd22fae,null));};exports[_0xaf04('0x46')]=function(_0x70e718,_0x32366a){var _0x441dc0={'raw':![],'where':{'id':_0x70e718['params']['id']}},_0x1fa80a={};_0x1fa80a['model']=_[_0xaf04('0x2d')](db[_0xaf04('0x41')][_0xaf04('0x2b')]);_0x1fa80a['query']=_[_0xaf04('0x2d')](_0x70e718['query']);_0x1fa80a[_0xaf04('0x39')]=_[_0xaf04('0x30')](_0x1fa80a[_0xaf04('0x2c')],_0x1fa80a[_0xaf04('0x2e')]);_0x441dc0[_0xaf04('0x2f')]=_[_0xaf04('0x30')](_0x1fa80a[_0xaf04('0x2c')],qs[_0xaf04('0x31')](_0x70e718[_0xaf04('0x2e')][_0xaf04('0x31')]));_0x441dc0[_0xaf04('0x2f')]=_0x441dc0[_0xaf04('0x2f')][_0xaf04('0x32')]?_0x441dc0[_0xaf04('0x2f')]:_0x1fa80a['model'];if(_0x70e718[_0xaf04('0x2e')]['includeAll']){_0x441dc0[_0xaf04('0x42')]=[{'all':!![]}];}_0x441dc0=_[_0xaf04('0x3c')]({},_0x441dc0,_0x70e718[_0xaf04('0x40')]);return db[_0xaf04('0x41')][_0xaf04('0x47')](_0x441dc0)[_0xaf04('0x27')](handleEntityNotFound(_0x32366a,null))[_0xaf04('0x27')](respondWithResult(_0x32366a,null))[_0xaf04('0x45')](handleError(_0x32366a,null));};exports[_0xaf04('0x48')]=function(_0x43426c,_0x28b5f6){return db[_0xaf04('0x41')]['create'](_0x43426c[_0xaf04('0x49')],{})[_0xaf04('0x27')](function(_0x239f0f){var _0x4947ef=_0x43426c['user'][_0xaf04('0x4a')]({'plain':!![]});if(!_0x4947ef)throw new Error(_0xaf04('0x4b'));if(_0x4947ef['role']==='user'){var _0x5f3a31=_0x239f0f[_0xaf04('0x4a')]({'plain':!![]});var _0x5a937d=_0xaf04('0x4c');return db['UserProfileSection'][_0xaf04('0x47')]({'where':{'name':_0x5a937d,'userProfileId':_0x4947ef[_0xaf04('0x4d')]},'raw':!![]})[_0xaf04('0x27')](function(_0x56b452){if(_0x56b452&&_0x56b452[_0xaf04('0x4e')]===0x0){return db[_0xaf04('0x26')][_0xaf04('0x48')]({'name':_0x5f3a31['name'],'resourceId':_0x5f3a31['id'],'type':_0x56b452[_0xaf04('0x28')],'sectionId':_0x56b452['id']},{})[_0xaf04('0x27')](function(){return _0x239f0f;});}else{return _0x239f0f;}})[_0xaf04('0x45')](function(_0x55e85b){logger[_0xaf04('0x4f')](_0xaf04('0x50'),_0x55e85b);throw _0x55e85b;});}return _0x239f0f;})[_0xaf04('0x27')](respondWithResult(_0x28b5f6,0xc9))[_0xaf04('0x45')](handleError(_0x28b5f6,null));};exports[_0xaf04('0x51')]=function(_0x51b9d1,_0xadc0f0){if(_0x51b9d1[_0xaf04('0x49')]['id']){delete _0x51b9d1[_0xaf04('0x49')]['id'];}return db[_0xaf04('0x41')]['find']({'where':{'id':_0x51b9d1[_0xaf04('0x52')]['id']}})[_0xaf04('0x27')](handleEntityNotFound(_0xadc0f0,null))['then'](saveUpdates(_0x51b9d1['body'],null))['then'](respondWithResult(_0xadc0f0,null))[_0xaf04('0x45')](handleError(_0xadc0f0,null));};exports[_0xaf04('0x25')]=function(_0x34f1b5,_0xb734f2){return db[_0xaf04('0x41')][_0xaf04('0x47')]({'where':{'id':_0x34f1b5[_0xaf04('0x52')]['id']}})['then'](handleEntityNotFound(_0xb734f2,null))[_0xaf04('0x27')](removeEntity(_0xb734f2,null))[_0xaf04('0x45')](handleError(_0xb734f2,null));};exports[_0xaf04('0x53')]=function(_0x41f08a,_0x5782b8,_0x2533b6){return db['CmContact']['find']({'where':{'id':_0x41f08a['params']['id']}})[_0xaf04('0x27')](handleEntityNotFound(_0x5782b8,null))[_0xaf04('0x27')](function(_0x271afa){if(_0x271afa){return _0x271afa['addContacts'](_0x41f08a['body'][_0xaf04('0x54')],_[_0xaf04('0x55')](_0x41f08a[_0xaf04('0x49')],['ids','id'])||{});}})[_0xaf04('0x27')](respondWithResult(_0x5782b8,null))['catch'](handleError(_0x5782b8,null));};exports[_0xaf04('0x56')]=function(_0x1c249c,_0x2dcfcb,_0x5daae4){var _0x4e9732={};var _0x4c019f={};var _0x17c608;var _0x4b55d3;return db[_0xaf04('0x41')]['findOne']({'where':{'id':_0x1c249c[_0xaf04('0x52')]['id']}})[_0xaf04('0x27')](handleEntityNotFound(_0x2dcfcb,null))[_0xaf04('0x27')](function(_0x184f9a){if(_0x184f9a){_0x17c608=_0x184f9a;_0x4c019f[_0xaf04('0x2c')]=_[_0xaf04('0x2d')](db[_0xaf04('0x57')][_0xaf04('0x2b')]);_0x4c019f[_0xaf04('0x2e')]=_[_0xaf04('0x2d')](_0x1c249c[_0xaf04('0x2e')]);_0x4c019f[_0xaf04('0x39')]=_[_0xaf04('0x30')](_0x4c019f[_0xaf04('0x2c')],_0x4c019f['query']);_0x4e9732['attributes']=_[_0xaf04('0x30')](_0x4c019f[_0xaf04('0x2c')],qs[_0xaf04('0x31')](_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x31')]));_0x4e9732[_0xaf04('0x2f')]=_0x4e9732[_0xaf04('0x2f')][_0xaf04('0x32')]?_0x4e9732[_0xaf04('0x2f')]:_0x4c019f['model'];_0x4e9732[_0xaf04('0x36')]=qs[_0xaf04('0x37')](_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x37')]);_0x4e9732[_0xaf04('0x38')]=qs['filters'](_[_0xaf04('0x3a')](_0x1c249c['query'],_0x4c019f[_0xaf04('0x39')]));if(_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x3b')]){_0x4e9732[_0xaf04('0x38')]=_[_0xaf04('0x3c')](_0x4e9732[_0xaf04('0x38')],{'$or':_[_0xaf04('0x3d')](_0x4e9732[_0xaf04('0x2f')],function(_0x6a4cfc){var _0x47f755={};_0x47f755[_0x6a4cfc]={'$like':'%'+_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x3b')]+'%'};return _0x47f755;})});}_0x4e9732=_[_0xaf04('0x3c')]({},_0x4e9732,_0x1c249c['options']);return _0x17c608[_0xaf04('0x56')](_0x4e9732);}})[_0xaf04('0x27')](function(_0x339522){if(_0x339522){_0x4b55d3=_0x339522[_0xaf04('0x32')];if(!_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x33')](_0xaf04('0x34'))){_0x4e9732[_0xaf04('0x35')]=qs[_0xaf04('0x35')](_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x35')]);_0x4e9732[_0xaf04('0x20')]=qs[_0xaf04('0x20')](_0x1c249c[_0xaf04('0x2e')][_0xaf04('0x20')]);}return _0x17c608[_0xaf04('0x56')](_0x4e9732);}})['then'](function(_0x43682d){if(_0x43682d){return _0x43682d?{'count':_0x4b55d3,'rows':_0x43682d}:null;}})[_0xaf04('0x27')](respondWithResult(_0x2dcfcb,null))[_0xaf04('0x45')](handleError(_0x2dcfcb,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 234d525..1c083fa 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 _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x1ba661,_0x14a59e){var _0x24324e=function(_0x5a5763){while(--_0x5a5763){_0x1ba661['push'](_0x1ba661['shift']());}};_0x24324e(++_0x14a59e);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x1779ef,_0x1d62cf){_0x1779ef=_0x1779ef-0x0;var _0x1f2520=_0xcf2f[_0x1779ef];return _0x1f2520;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5430=['../../config/logger','api','moment','bluebird','rimraf','exports','define','CmCompany','lodash','util'];(function(_0x440f79,_0x35bebb){var _0x232d8f=function(_0x43ff18){while(--_0x43ff18){_0x440f79['push'](_0x440f79['shift']());}};_0x232d8f(++_0x35bebb);}(_0x5430,0x10c));var _0x0543=function(_0x3291f6,_0x4b70ab){_0x3291f6=_0x3291f6-0x0;var _0x15c51a=_0x5430[_0x3291f6];return _0x15c51a;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x0543('0x7')]=function(_0x45b909,_0x9754ba){return _0x45b909[_0x0543('0x8')](_0x0543('0x9'),attributes,{'tableName':'cm_companies','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 fd1e278..5614407 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 _0xca6b=['code','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error'];(function(_0x5ee9fd,_0x3d2bf1){var _0xe714a1=function(_0x8b1e75){while(--_0x8b1e75){_0x5ee9fd['push'](_0x5ee9fd['shift']());}};_0xe714a1(++_0x3d2bf1);}(_0xca6b,0x18c));var _0xbca6=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xca6b[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0xbca6('0x0'));var moment=require(_0xbca6('0x1'));var BPromise=require(_0xbca6('0x2'));var rs=require(_0xbca6('0x3'));var fs=require('fs');var Redis=require(_0xbca6('0x4'));var db=require(_0xbca6('0x5'))['db'];var utils=require(_0xbca6('0x6'));var logger=require(_0xbca6('0x7'))('rpc');var config=require(_0xbca6('0x8'));var jayson=require(_0xbca6('0x9'));var client=jayson[_0xbca6('0xa')][_0xbca6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b1ccb,_0x4ef613,_0x5e73cd){return new BPromise(function(_0x12ff01,_0x12323b){return client[_0xbca6('0xc')](_0x5b1ccb,_0x5e73cd)['then'](function(_0x1d21ab){logger[_0xbca6('0xd')]('CmCompany,\x20%s,\x20%s',_0x4ef613,_0xbca6('0xe'));logger[_0xbca6('0xf')](_0xbca6('0x10'),_0x4ef613,'request\x20sent',JSON['stringify'](_0x1d21ab));if(_0x1d21ab[_0xbca6('0x11')]){if(_0x1d21ab[_0xbca6('0x11')][_0xbca6('0x12')]===0x1f4){logger[_0xbca6('0x11')]('CmCompany,\x20%s,\x20%s',_0x4ef613,_0x1d21ab[_0xbca6('0x11')][_0xbca6('0x13')]);return _0x12323b(_0x1d21ab['error'][_0xbca6('0x13')]);}logger['error'](_0xbca6('0x14'),_0x4ef613,_0x1d21ab[_0xbca6('0x11')][_0xbca6('0x13')]);return _0x12ff01(_0x1d21ab['error'][_0xbca6('0x13')]);}else{logger[_0xbca6('0xd')](_0xbca6('0x14'),_0x4ef613,_0xbca6('0xe'));_0x12ff01(_0x1d21ab[_0xbca6('0x15')][_0xbca6('0x13')]);}})[_0xbca6('0x16')](function(_0x43048f){logger['error']('CmCompany,\x20%s,\x20%s',_0x4ef613,_0x43048f);_0x12323b(_0x43048f);});});} \ No newline at end of file +var _0xda33=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3e4379,_0x548772){var _0x36d06f=function(_0x54eb5b){while(--_0x54eb5b){_0x3e4379['push'](_0x3e4379['shift']());}};_0x36d06f(++_0x548772);}(_0xda33,0xb7));var _0x3da3=function(_0x3847ed,_0x551125){_0x3847ed=_0x3847ed-0x0;var _0x277bd6=_0xda33[_0x3847ed];return _0x277bd6;};'use strict';var _=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var moment=require(_0x3da3('0x2'));var BPromise=require(_0x3da3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3da3('0x4'));var db=require(_0x3da3('0x5'))['db'];var utils=require(_0x3da3('0x6'));var logger=require(_0x3da3('0x7'))(_0x3da3('0x8'));var config=require(_0x3da3('0x9'));var jayson=require(_0x3da3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a60ec,_0x218ea3,_0x38b6a3){return new BPromise(function(_0x36a2a2,_0xde3b4e){return client[_0x3da3('0xb')](_0x4a60ec,_0x38b6a3)[_0x3da3('0xc')](function(_0x11daa3){logger[_0x3da3('0xd')](_0x3da3('0xe'),_0x218ea3,_0x3da3('0xf'));logger[_0x3da3('0x10')](_0x3da3('0x11'),_0x218ea3,_0x3da3('0xf'),JSON[_0x3da3('0x12')](_0x11daa3));if(_0x11daa3[_0x3da3('0x13')]){if(_0x11daa3[_0x3da3('0x13')][_0x3da3('0x14')]===0x1f4){logger[_0x3da3('0x13')](_0x3da3('0xe'),_0x218ea3,_0x11daa3[_0x3da3('0x13')]['message']);return _0xde3b4e(_0x11daa3[_0x3da3('0x13')][_0x3da3('0x15')]);}logger[_0x3da3('0x13')](_0x3da3('0xe'),_0x218ea3,_0x11daa3['error'][_0x3da3('0x15')]);return _0x36a2a2(_0x11daa3['error'][_0x3da3('0x15')]);}else{logger[_0x3da3('0xd')](_0x3da3('0xe'),_0x218ea3,'request\x20sent');_0x36a2a2(_0x11daa3['result'][_0x3da3('0x15')]);}})[_0x3da3('0x16')](function(_0x51cc46){logger['error']('CmCompany,\x20%s,\x20%s',_0x218ea3,_0x51cc46);_0xde3b4e(_0x51cc46);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 143be7c..ea731bd 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 _0xcf08=['path','connect-timeout','express','../../components/auth/service','./cmCompany.controller','isAuthenticated','index','get','/:id','show','/:id/contacts','getContacts','post','addContacts','put','destroy','multer','util'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xcf08,0x142));var _0x8cf0=function(_0x1445e8,_0x191d58){_0x1445e8=_0x1445e8-0x0;var _0x40dc6a=_0xcf08[_0x1445e8];return _0x40dc6a;};'use strict';var multer=require(_0x8cf0('0x0'));var util=require(_0x8cf0('0x1'));var path=require(_0x8cf0('0x2'));var timeout=require(_0x8cf0('0x3'));var express=require(_0x8cf0('0x4'));var router=express['Router']();var auth=require(_0x8cf0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8cf0('0x6'));router['get']('/',auth[_0x8cf0('0x7')](),controller[_0x8cf0('0x8')]);router[_0x8cf0('0x9')](_0x8cf0('0xa'),auth[_0x8cf0('0x7')](),controller[_0x8cf0('0xb')]);router[_0x8cf0('0x9')](_0x8cf0('0xc'),auth[_0x8cf0('0x7')](),controller[_0x8cf0('0xd')]);router[_0x8cf0('0xe')]('/',auth[_0x8cf0('0x7')](),controller['create']);router[_0x8cf0('0xe')](_0x8cf0('0xc'),auth[_0x8cf0('0x7')](),controller[_0x8cf0('0xf')]);router[_0x8cf0('0x10')](_0x8cf0('0xa'),auth[_0x8cf0('0x7')](),controller['update']);router['delete'](_0x8cf0('0xa'),auth[_0x8cf0('0x7')](),controller[_0x8cf0('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2a89=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/:id','show','/:id/contacts','post','put'];(function(_0x40fcd8,_0x3f9b88){var _0x3ba4d2=function(_0x19ac6c){while(--_0x19ac6c){_0x40fcd8['push'](_0x40fcd8['shift']());}};_0x3ba4d2(++_0x3f9b88);}(_0x2a89,0x180));var _0x92a8=function(_0x5cfc82,_0x162eb4){_0x5cfc82=_0x5cfc82-0x0;var _0x403fac=_0x2a89[_0x5cfc82];return _0x403fac;};'use strict';var multer=require(_0x92a8('0x0'));var util=require(_0x92a8('0x1'));var path=require(_0x92a8('0x2'));var timeout=require('connect-timeout');var express=require(_0x92a8('0x3'));var router=express[_0x92a8('0x4')]();var auth=require(_0x92a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92a8('0x6'));var controller=require(_0x92a8('0x7'));router[_0x92a8('0x8')]('/',auth[_0x92a8('0x9')](),controller['index']);router[_0x92a8('0x8')](_0x92a8('0xa'),auth['isAuthenticated'](),controller[_0x92a8('0xb')]);router['get'](_0x92a8('0xc'),auth[_0x92a8('0x9')](),controller['getContacts']);router['post']('/',auth[_0x92a8('0x9')](),controller['create']);router[_0x92a8('0xd')](_0x92a8('0xc'),auth[_0x92a8('0x9')](),controller['addContacts']);router[_0x92a8('0xe')]('/:id',auth[_0x92a8('0x9')](),controller[_0x92a8('0xf')]);router[_0x92a8('0x10')](_0x92a8('0xa'),auth['isAuthenticated'](),controller[_0x92a8('0x11')]);module[_0x92a8('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 867b89f..c0f1848 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 _0xd212=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd212,0x185));var _0x2d21=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xd212[_0x57d13b];return _0x467696;};'use strict';var _=require(_0x2d21('0x0'));var Sequelize=require(_0x2d21('0x1'));module[_0x2d21('0x2')]={'firstName':{'type':Sequelize[_0x2d21('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2d21('0x3')]},'street':{'type':Sequelize[_0x2d21('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2d21('0x3')]},'country':{'type':Sequelize[_0x2d21('0x3')]},'dateOfBirth':{'type':Sequelize[_0x2d21('0x3')]},'description':{'type':Sequelize[_0x2d21('0x4')]},'phone':{'type':Sequelize[_0x2d21('0x3')]},'mobile':{'type':Sequelize[_0x2d21('0x3')]},'fax':{'type':Sequelize[_0x2d21('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x2d21('0x3')]},'facebook':{'type':Sequelize[_0x2d21('0x3')]},'fb_data':{'type':Sequelize[_0x2d21('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x2d21('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2d21('0x3')]},'line':{'type':Sequelize[_0x2d21('0x3')]},'wechat':{'type':Sequelize[_0x2d21('0x3')]},'telegram':{'type':Sequelize[_0x2d21('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x2d21('0x5')](0x2)[_0x2d21('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2d21('0x7')],'defaultValue':Sequelize[_0x2d21('0x8')]}}; \ No newline at end of file +var _0x5fe9=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x33a80e,_0x2cf282){var _0x3bbcbd=function(_0x3dacee){while(--_0x3dacee){_0x33a80e['push'](_0x33a80e['shift']());}};_0x3bbcbd(++_0x2cf282);}(_0x5fe9,0x152));var _0x95fe=function(_0x543174,_0x232c2e){_0x543174=_0x543174-0x0;var _0x3c448a=_0x5fe9[_0x543174];return _0x3c448a;};'use strict';var _=require(_0x95fe('0x0'));var Sequelize=require(_0x95fe('0x1'));module[_0x95fe('0x2')]={'firstName':{'type':Sequelize[_0x95fe('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x95fe('0x3')]},'street':{'type':Sequelize[_0x95fe('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x95fe('0x3')]},'country':{'type':Sequelize[_0x95fe('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x95fe('0x4')]},'phone':{'type':Sequelize[_0x95fe('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x95fe('0x3')]},'url':{'type':Sequelize[_0x95fe('0x3')]},'facebook':{'type':Sequelize[_0x95fe('0x3')]},'fb_data':{'type':Sequelize[_0x95fe('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x95fe('0x3')]},'teams':{'type':Sequelize[_0x95fe('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x95fe('0x3')]},'wechat':{'type':Sequelize[_0x95fe('0x3')]},'telegram':{'type':Sequelize[_0x95fe('0x3')]},'UserId':{'type':Sequelize[_0x95fe('0x5')]},'priority':{'type':Sequelize[_0x95fe('0x5')](0x2)[_0x95fe('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x95fe('0x7')],'defaultValue':Sequelize[_0x95fe('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2ee5a00..855cc5f 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 _0xdc80=['merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','Tags','split','push','find','params','catch','startsWith','cf_','columnName','displayName','findAll','alias','custom','values','body','get','tags','join','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','each','duplicates','$or','ListId','findOrCreate','spread','show','CmCustomField','omit','map','format','$and','id\x20=\x20?','toParam','text','phone','getTags','findOne','Tag','rawAttributes','pick','options','setTags','CmHopper','ContactId','count','includeAll','include','rows','CmHopperHistory','getHopperFinals','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','pid','exit','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','then','destroy','error','stack','CmContact','describe','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','name','color','from','tools_tags','cm_contacts','expr','advancedFilter','parse','condition','isArray','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','filter','isEmpty','forEach','concat','replace','\x27\x27\x27\x27','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','DESC','group','c.id','Sequelize','QueryTypes','SELECT','clone','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','keyBy','sequelize','toString'];(function(_0x5ee4a5,_0x347ad9){var _0x40acf4=function(_0x563178){while(--_0x563178){_0x5ee4a5['push'](_0x5ee4a5['shift']());}};_0x40acf4(++_0x347ad9);}(_0xdc80,0x6d));var _0x0dc8=function(_0x56cc28,_0x4a921e){_0x56cc28=_0x56cc28-0x0;var _0x1f5798=_0xdc80[_0x56cc28];return _0x1f5798;};'use strict';var pdf=require(_0x0dc8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0dc8('0x1'));var zipdir=require(_0x0dc8('0x2'));var jsonpatch=require(_0x0dc8('0x3'));var rp=require(_0x0dc8('0x4'));var moment=require(_0x0dc8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0dc8('0x6'));var util=require(_0x0dc8('0x7'));var path=require(_0x0dc8('0x8'));var sox=require(_0x0dc8('0x9'));var csv=require(_0x0dc8('0xa'));var ejs=require(_0x0dc8('0xb'));var fs=require('fs');var _=require(_0x0dc8('0xc'));var squel=require(_0x0dc8('0xd'));var crypto=require(_0x0dc8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0dc8('0xf'));var toCsv=require(_0x0dc8('0xa'));var querystring=require(_0x0dc8('0x10'));var Papa=require(_0x0dc8('0x11'));var Redis=require('ioredis');var authService=require(_0x0dc8('0x12'));var qs=require(_0x0dc8('0x13'));var hardwareService=require(_0x0dc8('0x14'));var logger=require(_0x0dc8('0x15'))('api');var utils=require(_0x0dc8('0x16'));var config=require('../../config/environment');var db=require(_0x0dc8('0x17'))['db'];config[_0x0dc8('0x18')]=_[_0x0dc8('0x19')](config[_0x0dc8('0x18')],{'host':_0x0dc8('0x1a'),'port':0x18eb});var socket=require(_0x0dc8('0x1b'))(new Redis(config[_0x0dc8('0x18')]));require(_0x0dc8('0x1c'))[_0x0dc8('0x1d')](socket);function respondWithStatusCode(_0x31bd2b,_0x405a4a){_0x405a4a=_0x405a4a||0xcc;return function(_0x26c3c9){if(_0x26c3c9){return _0x31bd2b[_0x0dc8('0x1e')](_0x405a4a);}return _0x31bd2b[_0x0dc8('0x1f')](_0x405a4a)[_0x0dc8('0x20')]();};}function respondWithResult(_0x14ed64,_0x75aa7d){_0x75aa7d=_0x75aa7d||0xc8;return function(_0x4d5939){if(_0x4d5939){return _0x14ed64[_0x0dc8('0x1f')](_0x75aa7d)[_0x0dc8('0x21')](_0x4d5939);}};}function respondWithFilteredResult(_0x10f5b5,_0x1c5462){return function(_0x5806a6){if(_0x5806a6){var _0xab00b7=_0x5806a6['count'],_0x42ae4f=_0x1c5462['offset'],_0x5c4bf0=_0x1c5462[_0x0dc8('0x22')]+_0x1c5462[_0x0dc8('0x23')],_0x47c58e;if(_0x5c4bf0>=_0xab00b7){_0x5c4bf0=_0xab00b7;_0x47c58e=0xc8;}else{_0x47c58e=0xce;}_0x10f5b5[_0x0dc8('0x1f')](_0x47c58e);return _0x10f5b5['set'](_0x0dc8('0x24'),_0x42ae4f+'-'+_0x5c4bf0+'/'+_0xab00b7)[_0x0dc8('0x21')](_0x5806a6);}return null;};}function patchUpdates(_0x28f848){return function(_0x5705fc){try{jsonpatch[_0x0dc8('0x25')](_0x5705fc,_0x28f848,!![]);}catch(_0x276cc1){return BPromise[_0x0dc8('0x26')](_0x276cc1);}return _0x5705fc['save']();};}function saveUpdates(_0x13ce40,_0x5a0aa7){return function(_0x66d3e7){if(_0x66d3e7){return _0x66d3e7['update'](_0x13ce40)[_0x0dc8('0x27')](function(_0x121f48){return _0x121f48;});}return null;};}function removeEntity(_0x1eb941,_0x4bbc7e){return function(_0x241d70){if(_0x241d70){return _0x241d70[_0x0dc8('0x28')]()[_0x0dc8('0x27')](function(){_0x1eb941[_0x0dc8('0x1f')](0xcc)[_0x0dc8('0x20')]();});}};}function handleEntityNotFound(_0xcdaa0c,_0x53de6b){return function(_0xaf1a8d){if(!_0xaf1a8d){_0xcdaa0c[_0x0dc8('0x1e')](0x194);}return _0xaf1a8d;};}function handleError(_0x565158,_0x30c79e){_0x30c79e=_0x30c79e||0x1f4;return function(_0x2ece29){logger[_0x0dc8('0x29')](_0x2ece29[_0x0dc8('0x2a')]);if(_0x2ece29['name']){delete _0x2ece29['name'];}_0x565158['status'](_0x30c79e)['send'](_0x2ece29);};}exports['index']=function(_0x4a7e78,_0x1b40be){var _0x512a32={},_0x5346df={},_0xe6ab59={'count':0x0,'rows':[]};return db[_0x0dc8('0x2b')][_0x0dc8('0x2c')]()['then'](function(_0x19d4d3){_0x5346df[_0x0dc8('0x2d')]=_['keys'](_0x19d4d3);_0x5346df['query']=_[_0x0dc8('0x2e')](_0x4a7e78[_0x0dc8('0x2f')]);_0x5346df['filters']=_['intersection'](_0x5346df['model'],_0x5346df[_0x0dc8('0x2f')]);_0x512a32['attributes']=_[_0x0dc8('0x30')](_0x5346df['model'],qs[_0x0dc8('0x31')](_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x31')]));_0x512a32['attributes']=_0x512a32[_0x0dc8('0x32')][_0x0dc8('0x33')]?_0x512a32['attributes']:_0x5346df[_0x0dc8('0x2d')];if(!_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x34')](_0x0dc8('0x35'))){_0x512a32[_0x0dc8('0x23')]=qs[_0x0dc8('0x23')](_0x4a7e78[_0x0dc8('0x2f')]['limit']);_0x512a32[_0x0dc8('0x22')]=qs[_0x0dc8('0x22')](_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x22')]);}_0x512a32[_0x0dc8('0x36')]=qs[_0x0dc8('0x37')](_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x37')]);_0x512a32[_0x0dc8('0x38')]=qs[_0x0dc8('0x39')](_['pick'](_0x4a7e78[_0x0dc8('0x2f')],_0x5346df[_0x0dc8('0x39')]));var _0x1903dc=[];var _0xd386b7=squel[_0x0dc8('0x3a')]()['field']('id')[_0x0dc8('0x3b')](_0x0dc8('0x3c'))[_0x0dc8('0x3b')](_0x0dc8('0x3d'))[_0x0dc8('0x3e')](_0x0dc8('0x3f'));var _0x5f5b1c=squel[_0x0dc8('0x3a')]()[_0x0dc8('0x3e')](_0x0dc8('0x40'),'c')[_0x0dc8('0x38')]('c.deletedAt\x20IS\x20NULL');var _0x52390a=squel[_0x0dc8('0x41')]();if(_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x42')]){var _0x5142d2=JSON[_0x0dc8('0x43')](_0x4a7e78['query']['advancedFilter']);_[_0x0dc8('0x2e')](_0x5142d2)['forEach'](function(_0x3b560b){var _0x5c20fd=_0x5142d2[_0x3b560b];switch(_0x5c20fd[_0x0dc8('0x44')]){case'IS':if(_[_0x0dc8('0x45')](_0x5c20fd[_0x0dc8('0x46')])&&_0x5c20fd['value']['length']>0x1){_0x52390a[_0x0dc8('0x47')](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x49'),_0x5c20fd[_0x0dc8('0x46')]);}else{_0x52390a[_0x0dc8('0x47')](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x4a'),_0x5c20fd[_0x0dc8('0x46')][0x0]);}break;case'=':_0x52390a['and'](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x4a'),_0x5c20fd[_0x0dc8('0x46')]);break;case'LIKE':_0x52390a[_0x0dc8('0x47')](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x4b'),'%'+_0x5c20fd[_0x0dc8('0x46')]+'%');break;case'>':_0x52390a[_0x0dc8('0x47')](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x4c'),_0x5c20fd['value']);break;case'<':_0x52390a[_0x0dc8('0x47')](_0x5c20fd[_0x0dc8('0x48')]+'.'+_0x3b560b+_0x0dc8('0x4d'),_0x5c20fd['value']);break;}});}else{var _0xe07eea=_(Object[_0x0dc8('0x2e')](_0x4a7e78[_0x0dc8('0x2f')]))['map'](function(_0x582cf){return _0x19d4d3[_0x0dc8('0x34')](_0x582cf)?_0x582cf:undefined;})[_0x0dc8('0x4e')](function(_0x7b13c5){return!_['isNil'](_0x7b13c5);})[_0x0dc8('0x46')]();if(!_[_0x0dc8('0x4f')](_0xe07eea)){_0xe07eea[_0x0dc8('0x50')](function(_0x2a2df7){if(_0x2a2df7==='ListId'){_0x5f5b1c[_0x0dc8('0x38')]('c.ListId\x20IN\x20?',[][_0x0dc8('0x51')](_0x4a7e78[_0x0dc8('0x2f')][_0x2a2df7]));}else{_0x5f5b1c[_0x0dc8('0x38')]('c.'+_0x2a2df7+_0x0dc8('0x4a'),_0x4a7e78[_0x0dc8('0x2f')][_0x2a2df7]);}});}if(_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x4e')]){var _0x33c839=_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x4e')][_0x0dc8('0x52')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0dc8('0x53'));if(qs[_0x0dc8('0x54')](_0x33c839)){_0x52390a['or']('c.id\x20LIKE\x20?',_0x33c839+'%');_0x52390a['or'](_0x0dc8('0x55'),_0x33c839+'%');_0x52390a['or']('c.mobile\x20LIKE\x20?',_0x33c839+'%');_0x52390a['or'](_0x0dc8('0x56'),_0x33c839+'%');}else if(qs[_0x0dc8('0x57')](_0x33c839)){_0x52390a['or']('c.email\x20LIKE\x20?',_0x33c839+'%');}else{_0x52390a['or']('c.email\x20LIKE\x20?',_0x33c839+'%');_0x52390a['or'](_0x0dc8('0x58'),_0x33c839+'%');_0x52390a['or']('c.lastName\x20LIKE\x20?',_0x33c839+'%');}}}_0x5f5b1c['where'](_0x52390a);if(_0x512a32['order']){_0x512a32[_0x0dc8('0x36')][_0x0dc8('0x50')](function(_0x31aaa2){_0x5f5b1c[_0x0dc8('0x36')]('c.'+_0x31aaa2[0x0],_0x31aaa2[0x1]===_0x0dc8('0x59')?![]:!![]);});}_0x5f5b1c[_0x0dc8('0x5a')](_0x0dc8('0x5b'));var _0x1b46ee={'type':db[_0x0dc8('0x5c')][_0x0dc8('0x5d')][_0x0dc8('0x5e')],'raw':!![]};var _0x337d77=_0x5f5b1c[_0x0dc8('0x5f')]()['field']('COUNT(*)');if(!_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x42')]){if(_0x4a7e78[_0x0dc8('0x2f')]['tag']){var _0x1eaeb5=_['isArray'](_0x4a7e78[_0x0dc8('0x2f')][_0x0dc8('0x60')])?_0x4a7e78['query'][_0x0dc8('0x60')]:new Array(_0x4a7e78[_0x0dc8('0x2f')]['tag']);var _0x2bb5ae=squel['expr']();_0x1eaeb5[_0x0dc8('0x50')](function(_0x23e093){_0x2bb5ae['or'](_0x0dc8('0x61'),'%,'+_0x23e093+',%');});_0x5f5b1c[_0x0dc8('0x62')](_0x2bb5ae);_0x337d77[_0x0dc8('0x63')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20c.id');_0x337d77[_0x0dc8('0x63')](_0x0dc8('0x3f'),'t',_0x0dc8('0x64'));_0x337d77[_0x0dc8('0x38')](_0x0dc8('0x65'),_0x1eaeb5);}}db['sequelize'][_0x0dc8('0x2f')](_0xd386b7['toString'](),_0x1b46ee)['then'](function(_0x1fc8e4){_0x1903dc=_[_0x0dc8('0x66')](_0x1fc8e4,'id');return db[_0x0dc8('0x67')][_0x0dc8('0x2f')](_0x337d77[_0x0dc8('0x68')](),_0x1b46ee);})[_0x0dc8('0x27')](function(_0x1e1a8d){_0xe6ab59['count']=_0x1e1a8d['length'];_0x1b46ee=_[_0x0dc8('0x69')](_0x1b46ee,{'model':db[_0x0dc8('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5f5b1c[_0x0dc8('0x3b')](_0x0dc8('0x6a'));_0x5f5b1c[_0x0dc8('0x3b')](_0x0dc8('0x6b'),_0x0dc8('0x6c'));_0x5f5b1c[_0x0dc8('0x63')](_0x0dc8('0x6d'),'ct',_0x0dc8('0x6e'));_0x5f5b1c[_0x0dc8('0x63')](_0x0dc8('0x3f'),'t',_0x0dc8('0x64'));if(_0x512a32[_0x0dc8('0x23')]){_0x5f5b1c['limit'](_0x512a32['limit']);}if(_0x512a32['offset']){_0x5f5b1c['offset'](_0x512a32[_0x0dc8('0x22')]);}db[_0x0dc8('0x67')]['query'](_0x5f5b1c[_0x0dc8('0x68')](),_0x1b46ee)[_0x0dc8('0x27')](function(_0x378aea){_0x378aea['forEach'](function(_0x4ce5d2){if(_0x4ce5d2['TagIds']){_0x4ce5d2[_0x0dc8('0x6f')]=[];_0x4ce5d2[_0x0dc8('0x6c')][_0x0dc8('0x70')](',')['forEach'](function(_0x292571){_0x4ce5d2[_0x0dc8('0x6f')][_0x0dc8('0x71')](_0x1903dc[_0x292571]);});}delete _0x4ce5d2[_0x0dc8('0x6c')];});_0xe6ab59['rows']=_0x378aea;return _0xe6ab59;})['then'](respondWithFilteredResult(_0x1b40be,_0x512a32))['catch'](handleError(_0x1b40be,null));});});};exports[_0x0dc8('0x28')]=function(_0x52558f,_0x42e88e){return db['CmContact'][_0x0dc8('0x72')]({'where':{'id':_0x52558f[_0x0dc8('0x73')]['id']}})[_0x0dc8('0x27')](handleEntityNotFound(_0x42e88e,null))[_0x0dc8('0x27')](removeEntity(_0x42e88e,null))[_0x0dc8('0x74')](handleError(_0x42e88e,null));};exports[_0x0dc8('0x2c')]=function(_0x5738d1,_0xf1b4a7){return db[_0x0dc8('0x2b')]['describe']()[_0x0dc8('0x27')](function(_0x489185){for(var _0x234c2a=0x0;_0x234c2a\x20?','\x20<\x20?','map','isNil','forEach','ListId','c.ListId\x20IN\x20?','concat','filter','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','DESC','group','c.id','SELECT','clone','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','tools_tags','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','toString','keyBy','sequelize','count','length','merge','c.*','TagIds','Tags','split','push','catch','find','params','startsWith','columnName','CmCustomField','findAll','cf_','displayName','custom','type','values','body','get','mergeWith','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','create','join','each','duplicates','findOrCreate','spread','error','show','Tag','$and','omit','format','cf_%d','pickBy','isEmpty','table','setFields','id\x20=\x20?'];(function(_0x5c5999,_0x1b311e){var _0x13e286=function(_0x26f7b6){while(--_0x26f7b6){_0x5c5999['push'](_0x5c5999['shift']());}};_0x13e286(++_0x1b311e);}(_0x1d44,0x115));var _0x41d4=function(_0x3c24e7,_0x2031f6){_0x3c24e7=_0x3c24e7-0x0;var _0x41cbe9=_0x1d44[_0x3c24e7];return _0x41cbe9;};'use strict';var pdf=require(_0x41d4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41d4('0x1'));var jsonpatch=require(_0x41d4('0x2'));var rp=require(_0x41d4('0x3'));var moment=require(_0x41d4('0x4'));var BPromise=require(_0x41d4('0x5'));var Mustache=require('mustache');var util=require(_0x41d4('0x6'));var path=require(_0x41d4('0x7'));var sox=require(_0x41d4('0x8'));var csv=require(_0x41d4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x41d4('0xa'));var squel=require(_0x41d4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x41d4('0xc'));var toCsv=require(_0x41d4('0x9'));var querystring=require(_0x41d4('0xd'));var Papa=require('papaparse');var Redis=require(_0x41d4('0xe'));var authService=require(_0x41d4('0xf'));var qs=require(_0x41d4('0x10'));var hardwareService=require(_0x41d4('0x11'));var logger=require(_0x41d4('0x12'))(_0x41d4('0x13'));var utils=require('../../config/utils');var config=require(_0x41d4('0x14'));var db=require(_0x41d4('0x15'))['db'];config[_0x41d4('0x16')]=_[_0x41d4('0x17')](config[_0x41d4('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41d4('0x16')]));require('./cmContact.socket')[_0x41d4('0x18')](socket);function respondWithStatusCode(_0x588198,_0x31cb3c){_0x31cb3c=_0x31cb3c||0xcc;return function(_0x114f32){if(_0x114f32){return _0x588198[_0x41d4('0x19')](_0x31cb3c);}return _0x588198['status'](_0x31cb3c)[_0x41d4('0x1a')]();};}function respondWithResult(_0x4f4c0e,_0x1e5e65){_0x1e5e65=_0x1e5e65||0xc8;return function(_0x4beee2){if(_0x4beee2){return _0x4f4c0e[_0x41d4('0x1b')](_0x1e5e65)[_0x41d4('0x1c')](_0x4beee2);}};}function respondWithFilteredResult(_0x586334,_0x19e2f9){return function(_0x5e4eb1){if(_0x5e4eb1){var _0x430fda=_0x5e4eb1['count'],_0x32bb8e=_0x19e2f9[_0x41d4('0x1d')],_0x40e439=_0x19e2f9['offset']+_0x19e2f9[_0x41d4('0x1e')],_0x43fe22;if(_0x40e439>=_0x430fda){_0x40e439=_0x430fda;_0x43fe22=0xc8;}else{_0x43fe22=0xce;}_0x586334['status'](_0x43fe22);return _0x586334[_0x41d4('0x1f')]('Content-Range',_0x32bb8e+'-'+_0x40e439+'/'+_0x430fda)[_0x41d4('0x1c')](_0x5e4eb1);}return null;};}function patchUpdates(_0x56658b){return function(_0x51bf24){try{jsonpatch[_0x41d4('0x20')](_0x51bf24,_0x56658b,!![]);}catch(_0x466fd7){return BPromise[_0x41d4('0x21')](_0x466fd7);}return _0x51bf24['save']();};}function saveUpdates(_0x4feefa,_0x263c1f){return function(_0x2f623d){if(_0x2f623d){return _0x2f623d[_0x41d4('0x22')](_0x4feefa)[_0x41d4('0x23')](function(_0x2dfc0a){return _0x2dfc0a;});}return null;};}function removeEntity(_0x2306eb,_0x22ae8b){return function(_0xa7dd55){if(_0xa7dd55){return _0xa7dd55[_0x41d4('0x24')]()[_0x41d4('0x23')](function(){_0x2306eb['status'](0xcc)[_0x41d4('0x1a')]();});}};}function handleEntityNotFound(_0x61fc23,_0x560eaf){return function(_0xbeeb2c){if(!_0xbeeb2c){_0x61fc23[_0x41d4('0x19')](0x194);}return _0xbeeb2c;};}function handleError(_0x2733dc,_0x51db55){_0x51db55=_0x51db55||0x1f4;return function(_0x1a87ad){logger['error'](_0x1a87ad['stack']);if(_0x1a87ad['name']){delete _0x1a87ad[_0x41d4('0x25')];}_0x2733dc[_0x41d4('0x1b')](_0x51db55)[_0x41d4('0x26')](_0x1a87ad);};}exports[_0x41d4('0x27')]=function(_0x293ab2,_0x1b0592){var _0x568937={},_0x1f5151={},_0x478dbe={'count':0x0,'rows':[]};return db[_0x41d4('0x28')][_0x41d4('0x29')]()[_0x41d4('0x23')](function(_0x3dcb00){_0x1f5151[_0x41d4('0x2a')]=_[_0x41d4('0x2b')](_0x3dcb00);_0x1f5151[_0x41d4('0x2c')]=_[_0x41d4('0x2b')](_0x293ab2[_0x41d4('0x2c')]);_0x1f5151[_0x41d4('0x2d')]=_['intersection'](_0x1f5151[_0x41d4('0x2a')],_0x1f5151[_0x41d4('0x2c')]);_0x568937[_0x41d4('0x2e')]=_[_0x41d4('0x2f')](_0x1f5151[_0x41d4('0x2a')],qs[_0x41d4('0x30')](_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x30')]));_0x568937[_0x41d4('0x2e')]=_0x568937[_0x41d4('0x2e')]['length']?_0x568937[_0x41d4('0x2e')]:_0x1f5151[_0x41d4('0x2a')];if(!_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x31')]('nolimit')){_0x568937['limit']=qs[_0x41d4('0x1e')](_0x293ab2['query'][_0x41d4('0x1e')]);_0x568937['offset']=qs[_0x41d4('0x1d')](_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x1d')]);}_0x568937[_0x41d4('0x32')]=qs[_0x41d4('0x33')](_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x33')]);_0x568937[_0x41d4('0x34')]=qs['filters'](_[_0x41d4('0x35')](_0x293ab2[_0x41d4('0x2c')],_0x1f5151[_0x41d4('0x2d')]));var _0x3b6687=[];var _0x17d111=squel['select']()[_0x41d4('0x36')]('id')[_0x41d4('0x36')](_0x41d4('0x25'))[_0x41d4('0x36')](_0x41d4('0x37'))[_0x41d4('0x38')]('tools_tags');var _0x5a52e6=squel[_0x41d4('0x39')]()[_0x41d4('0x38')](_0x41d4('0x3a'),'c')[_0x41d4('0x34')](_0x41d4('0x3b'));var _0x3a221d=squel[_0x41d4('0x3c')]();if(_0x293ab2['query']['advancedFilter']){var _0x46731a=JSON['parse'](_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x3d')]);_['keys'](_0x46731a)['forEach'](function(_0x298c4a){var _0x289bc8=_0x46731a[_0x298c4a];switch(_0x289bc8['condition']){case'IS':if(_[_0x41d4('0x3e')](_0x289bc8[_0x41d4('0x3f')])&&_0x289bc8[_0x41d4('0x3f')]['length']>0x1){_0x3a221d['and'](_0x289bc8[_0x41d4('0x40')]+'.'+_0x298c4a+_0x41d4('0x41'),_0x289bc8[_0x41d4('0x3f')]);}else{_0x3a221d[_0x41d4('0x42')](_0x289bc8[_0x41d4('0x40')]+'.'+_0x298c4a+'\x20=\x20?',_0x289bc8[_0x41d4('0x3f')][0x0]);}break;case'=':_0x3a221d[_0x41d4('0x42')](_0x289bc8['tableAlias']+'.'+_0x298c4a+_0x41d4('0x43'),_0x289bc8[_0x41d4('0x3f')]);break;case _0x41d4('0x44'):_0x3a221d['and'](_0x289bc8[_0x41d4('0x40')]+'.'+_0x298c4a+_0x41d4('0x45'),'%'+_0x289bc8[_0x41d4('0x3f')]+'%');break;case'>':_0x3a221d[_0x41d4('0x42')](_0x289bc8['tableAlias']+'.'+_0x298c4a+_0x41d4('0x46'),_0x289bc8[_0x41d4('0x3f')]);break;case'<':_0x3a221d[_0x41d4('0x42')](_0x289bc8[_0x41d4('0x40')]+'.'+_0x298c4a+_0x41d4('0x47'),_0x289bc8[_0x41d4('0x3f')]);break;}});}else{var _0x283c32=_(Object[_0x41d4('0x2b')](_0x293ab2[_0x41d4('0x2c')]))[_0x41d4('0x48')](function(_0xa430b4){return _0x3dcb00[_0x41d4('0x31')](_0xa430b4)?_0xa430b4:undefined;})['filter'](function(_0xc11a95){return!_[_0x41d4('0x49')](_0xc11a95);})[_0x41d4('0x3f')]();if(!_['isEmpty'](_0x283c32)){_0x283c32[_0x41d4('0x4a')](function(_0x5ac929){if(_0x5ac929===_0x41d4('0x4b')){_0x5a52e6['where'](_0x41d4('0x4c'),[][_0x41d4('0x4d')](_0x293ab2[_0x41d4('0x2c')][_0x5ac929]));}else{_0x5a52e6[_0x41d4('0x34')]('c.'+_0x5ac929+_0x41d4('0x43'),_0x293ab2[_0x41d4('0x2c')][_0x5ac929]);}});}if(_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x4e')]){var _0x593694=_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x4e')][_0x41d4('0x4f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x41d4('0x50'));if(qs[_0x41d4('0x51')](_0x593694)){_0x3a221d['or'](_0x41d4('0x52'),_0x593694+'%');_0x3a221d['or']('c.phone\x20LIKE\x20?',_0x593694+'%');_0x3a221d['or'](_0x41d4('0x53'),_0x593694+'%');_0x3a221d['or'](_0x41d4('0x54'),_0x593694+'%');}else if(qs[_0x41d4('0x55')](_0x593694)){_0x3a221d['or']('c.email\x20LIKE\x20?',_0x593694+'%');}else{_0x3a221d['or'](_0x41d4('0x56'),_0x593694+'%');_0x3a221d['or'](_0x41d4('0x57'),_0x593694+'%');_0x3a221d['or'](_0x41d4('0x58'),_0x593694+'%');}}}_0x5a52e6[_0x41d4('0x34')](_0x3a221d);if(_0x568937[_0x41d4('0x32')]){_0x568937[_0x41d4('0x32')][_0x41d4('0x4a')](function(_0x34749d){_0x5a52e6[_0x41d4('0x32')]('c.'+_0x34749d[0x0],_0x34749d[0x1]===_0x41d4('0x59')?![]:!![]);});}_0x5a52e6[_0x41d4('0x5a')](_0x41d4('0x5b'));var _0x2fc5a4={'type':db['Sequelize']['QueryTypes'][_0x41d4('0x5c')],'raw':!![]};var _0x48d4a4=_0x5a52e6[_0x41d4('0x5d')]()[_0x41d4('0x36')](_0x41d4('0x5e'));if(!_0x293ab2['query']['advancedFilter']){if(_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x5f')]){var _0x1931e8=_[_0x41d4('0x3e')](_0x293ab2[_0x41d4('0x2c')]['tag'])?_0x293ab2[_0x41d4('0x2c')][_0x41d4('0x5f')]:new Array(_0x293ab2['query']['tag']);var _0x32c598=squel[_0x41d4('0x3c')]();_0x1931e8[_0x41d4('0x4a')](function(_0x570723){_0x32c598['or'](_0x41d4('0x60'),'%,'+_0x570723+',%');});_0x5a52e6[_0x41d4('0x61')](_0x32c598);_0x48d4a4['left_join'](_0x41d4('0x62'),'ct',_0x41d4('0x63'));_0x48d4a4[_0x41d4('0x64')](_0x41d4('0x65'),'t',_0x41d4('0x66'));_0x48d4a4['where'](_0x41d4('0x67'),_0x1931e8);}}db['sequelize']['query'](_0x17d111[_0x41d4('0x68')](),_0x2fc5a4)['then'](function(_0x16aee7){_0x3b6687=_[_0x41d4('0x69')](_0x16aee7,'id');return db[_0x41d4('0x6a')][_0x41d4('0x2c')](_0x48d4a4[_0x41d4('0x68')](),_0x2fc5a4);})[_0x41d4('0x23')](function(_0x254a14){_0x478dbe[_0x41d4('0x6b')]=_0x254a14[_0x41d4('0x6c')];_0x2fc5a4=_[_0x41d4('0x6d')](_0x2fc5a4,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5a52e6[_0x41d4('0x36')](_0x41d4('0x6e'));_0x5a52e6[_0x41d4('0x36')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x41d4('0x6f'));_0x5a52e6[_0x41d4('0x64')](_0x41d4('0x62'),'ct',_0x41d4('0x63'));_0x5a52e6[_0x41d4('0x64')](_0x41d4('0x65'),'t',_0x41d4('0x66'));if(_0x568937[_0x41d4('0x1e')]){_0x5a52e6['limit'](_0x568937[_0x41d4('0x1e')]);}if(_0x568937['offset']){_0x5a52e6[_0x41d4('0x1d')](_0x568937[_0x41d4('0x1d')]);}db['sequelize']['query'](_0x5a52e6[_0x41d4('0x68')](),_0x2fc5a4)['then'](function(_0x1000bc){_0x1000bc[_0x41d4('0x4a')](function(_0x5deaa1){if(_0x5deaa1[_0x41d4('0x6f')]){_0x5deaa1[_0x41d4('0x70')]=[];_0x5deaa1[_0x41d4('0x6f')][_0x41d4('0x71')](',')[_0x41d4('0x4a')](function(_0x1ec4da){_0x5deaa1['Tags'][_0x41d4('0x72')](_0x3b6687[_0x1ec4da]);});}delete _0x5deaa1['TagIds'];});_0x478dbe['rows']=_0x1000bc;return _0x478dbe;})[_0x41d4('0x23')](respondWithFilteredResult(_0x1b0592,_0x568937))[_0x41d4('0x73')](handleError(_0x1b0592,null));});});};exports['destroy']=function(_0x3a6c3d,_0x55756c){return db[_0x41d4('0x28')][_0x41d4('0x74')]({'where':{'id':_0x3a6c3d[_0x41d4('0x75')]['id']}})[_0x41d4('0x23')](handleEntityNotFound(_0x55756c,null))[_0x41d4('0x23')](removeEntity(_0x55756c,null))[_0x41d4('0x73')](handleError(_0x55756c,null));};exports[_0x41d4('0x29')]=function(_0x492ca3,_0x5d4829){return db['CmContact'][_0x41d4('0x29')]()['then'](function(_0x4311bb){for(var _0x3a2a4b=0x0;_0x3a2a4b{}\s\\|]/g,'-');_0x180bb2(null,util[_0xfce2('0x1f')](_0xfce2('0x20'),path[_0xfce2('0x21')](_0x2206ab[_0xfce2('0x1d')],path['extname'](_0x2206ab[_0xfce2('0x1d')])),Date[_0xfce2('0x22')](),path['extname'](_0x2206ab['originalname'])));}})});router[_0xfce2('0x14')](_0xfce2('0x23'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xfce2('0x1b')]({'destination':function(_0x43fdb6,_0x1927d1,_0x496c86){_0x496c86(null,path[_0xfce2('0x24')](config[_0xfce2('0x1c')],_0xfce2('0x25')));},'filename':function(_0x36a77a,_0x35de34,_0x2c8847){_0x35de34[_0xfce2('0x1d')]=_0x35de34[_0xfce2('0x1d')][_0xfce2('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c8847(null,util[_0xfce2('0x1f')](_0xfce2('0x20'),path[_0xfce2('0x21')](_0x35de34[_0xfce2('0x1d')],path[_0xfce2('0x26')](_0x35de34[_0xfce2('0x1d')])),Date[_0xfce2('0x22')](),path['extname'](_0x35de34[_0xfce2('0x1d')])));}})});router['post']('/upload',upload['single'](_0xfce2('0x27')),controller[_0xfce2('0x28')]);router[_0xfce2('0x14')](_0xfce2('0x29'),auth[_0xfce2('0xb')](),controller[_0xfce2('0x2a')]);router[_0xfce2('0x2b')](_0xfce2('0xd'),auth[_0xfce2('0xb')](),controller['update']);router[_0xfce2('0x2c')](_0xfce2('0xd'),auth[_0xfce2('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeae9=['/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','server/files/tmp','originalname','replace','format','basename','now','extname','/csv','single','file','uploadCsv','join','root','/upload','upload','import','put','update','delete','destroy','exports','util','path','express','Router','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xeae9,0x1c5));var _0x9eae=function(_0x28bc7c,_0x572ee9){_0x28bc7c=_0x28bc7c-0x0;var _0x40ccec=_0xeae9[_0x28bc7c];return _0x40ccec;};'use strict';var multer=require('multer');var util=require(_0x9eae('0x0'));var path=require(_0x9eae('0x1'));var timeout=require('connect-timeout');var express=require(_0x9eae('0x2'));var router=express[_0x9eae('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9eae('0x4'));var controller=require('./cmContact.controller');router['get']('/',auth[_0x9eae('0x5')](),controller[_0x9eae('0x6')]);router[_0x9eae('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x9eae('0x8')]);router[_0x9eae('0x7')](_0x9eae('0x9'),auth[_0x9eae('0x5')](),controller['show']);router[_0x9eae('0x7')](_0x9eae('0xa'),auth[_0x9eae('0x5')](),controller['getTags']);router[_0x9eae('0x7')](_0x9eae('0xb'),auth[_0x9eae('0x5')](),controller[_0x9eae('0xc')]);router[_0x9eae('0x7')](_0x9eae('0xd'),auth[_0x9eae('0x5')](),controller[_0x9eae('0xe')]);router[_0x9eae('0x7')](_0x9eae('0xf'),auth[_0x9eae('0x5')](),controller[_0x9eae('0x10')]);router[_0x9eae('0x7')](_0x9eae('0x11'),auth[_0x9eae('0x5')](),controller[_0x9eae('0x12')]);router[_0x9eae('0x13')](_0x9eae('0x14'),auth['isAuthenticated'](),controller[_0x9eae('0x15')]);router[_0x9eae('0x13')]('/',auth[_0x9eae('0x5')](),controller[_0x9eae('0x16')]);router['post'](_0x9eae('0x17'),auth['isAuthenticated'](),controller[_0x9eae('0x18')]);router['post'](_0x9eae('0xa'),auth[_0x9eae('0x5')](),controller['setTags']);var upload=multer({'storage':multer[_0x9eae('0x19')]({'destination':function(_0x191c65,_0x5d7518,_0x2b742c){_0x2b742c(null,path['join'](config['root'],_0x9eae('0x1a')));},'filename':function(_0x12d2e6,_0x1af5c3,_0x279fd5){_0x1af5c3[_0x9eae('0x1b')]=_0x1af5c3[_0x9eae('0x1b')][_0x9eae('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x279fd5(null,util[_0x9eae('0x1d')]('%s-%s%s',path[_0x9eae('0x1e')](_0x1af5c3['originalname'],path['extname'](_0x1af5c3[_0x9eae('0x1b')])),Date[_0x9eae('0x1f')](),path[_0x9eae('0x20')](_0x1af5c3[_0x9eae('0x1b')])));}})});router[_0x9eae('0x13')](_0x9eae('0x21'),upload[_0x9eae('0x22')](_0x9eae('0x23')),controller[_0x9eae('0x24')]);var upload=multer({'storage':multer[_0x9eae('0x19')]({'destination':function(_0x3d16f2,_0x154adb,_0x18a10f){_0x18a10f(null,path[_0x9eae('0x25')](config[_0x9eae('0x26')],_0x9eae('0x1a')));},'filename':function(_0x59b256,_0x41e1d4,_0x472968){_0x41e1d4[_0x9eae('0x1b')]=_0x41e1d4[_0x9eae('0x1b')][_0x9eae('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x472968(null,util[_0x9eae('0x1d')]('%s-%s%s',path['basename'](_0x41e1d4[_0x9eae('0x1b')],path[_0x9eae('0x20')](_0x41e1d4['originalname'])),Date[_0x9eae('0x1f')](),path['extname'](_0x41e1d4[_0x9eae('0x1b')])));}})});router[_0x9eae('0x13')](_0x9eae('0x27'),upload[_0x9eae('0x22')](_0x9eae('0x23')),controller[_0x9eae('0x28')]);router[_0x9eae('0x13')]('/upload/:id',auth[_0x9eae('0x5')](),controller[_0x9eae('0x29')]);router[_0x9eae('0x2a')](_0x9eae('0x9'),auth[_0x9eae('0x5')](),controller[_0x9eae('0x2b')]);router[_0x9eae('0x2c')](_0x9eae('0x9'),auth[_0x9eae('0x5')](),controller[_0x9eae('0x2d')]);module[_0x9eae('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 786ac16..154122f 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 _0xcded=['type','select','parse','values','isArray','stringify','BOOLEAN','lodash','exports','getDataValue','alias','STRING','setDataValue','TEXT','long'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcded,0xd9));var _0xdcde=function(_0x1863be,_0x3fb18f){_0x1863be=_0x1863be-0x0;var _0x5835e1=_0xcded[_0x1863be];return _0x5835e1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xdcde('0x0'));module[_0xdcde('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x10f8c1){return this[_0xdcde('0x2')](_0xdcde('0x3'));}},'alias':{'type':Sequelize[_0xdcde('0x4')],'allowNull':![],'set':function(_0x2e95bf){this[_0xdcde('0x5')](_0xdcde('0x3'),_0x2e95bf?_0x2e95bf:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xdcde('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xdcde('0x6')](_0xdcde('0x7')),'get':function(){if(this[_0xdcde('0x2')](_0xdcde('0x8'))===_0xdcde('0x9')){return JSON[_0xdcde('0xa')](this[_0xdcde('0x2')](_0xdcde('0xb')));}else{return this[_0xdcde('0x2')](_0xdcde('0xb'));}},'set':function(_0x424efe){if(Array[_0xdcde('0xc')](_0x424efe)){this[_0xdcde('0x5')]('values',JSON[_0xdcde('0xd')](_0x424efe));}else{this[_0xdcde('0x5')](_0xdcde('0xb'),_0x424efe);}}},'required':{'type':Sequelize[_0xdcde('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xf521=['values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','long','type','select'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf521,0x125));var _0x1f52=function(_0x3e6898,_0x25681e){_0x3e6898=_0x3e6898-0x0;var _0x419360=_0xf521[_0x3e6898];return _0x419360;};'use strict';var Sequelize=require(_0x1f52('0x0'));var _=require(_0x1f52('0x1'));module[_0x1f52('0x2')]={'name':{'type':Sequelize[_0x1f52('0x3')],'get':function(_0x232c96){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x1f52('0x4')],'allowNull':![],'set':function(_0x1190cc){this[_0x1f52('0x5')](_0x1f52('0x6'),_0x1190cc?_0x1190cc:this[_0x1f52('0x7')](_0x1f52('0x8')));}},'type':{'type':Sequelize[_0x1f52('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x1f52('0x9')](_0x1f52('0xa')),'get':function(){if(this[_0x1f52('0x7')](_0x1f52('0xb'))===_0x1f52('0xc')){return JSON['parse'](this[_0x1f52('0x7')](_0x1f52('0xd')));}else{return this['getDataValue'](_0x1f52('0xd'));}},'set':function(_0x30f07e){if(Array[_0x1f52('0xe')](_0x30f07e)){this['setDataValue']('values',JSON[_0x1f52('0xf')](_0x30f07e));}else{this['setDataValue'](_0x1f52('0xd'),_0x30f07e);}}},'required':{'type':Sequelize[_0x1f52('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index b873265..73f503a 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 _0x2427=['type','VIRTUAL','field','options','count','include','findAll','rows','catch','params','CmCustomField','length','includeAll','find','transaction','create','body','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','Content-Range','save','update','then','destroy','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x468f1f,_0xef02b2){var _0x2ebc8a=function(_0x544bd5){while(--_0x544bd5){_0x468f1f['push'](_0x468f1f['shift']());}};_0x2ebc8a(++_0xef02b2);}(_0x2427,0x165));var _0x7242=function(_0x153c8c,_0x1fae30){_0x153c8c=_0x153c8c-0x0;var _0x50de01=_0x2427[_0x153c8c];return _0x50de01;};'use strict';var pdf=require(_0x7242('0x0'));var emlformat=require(_0x7242('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7242('0x3'));var moment=require('moment');var BPromise=require(_0x7242('0x4'));var Mustache=require(_0x7242('0x5'));var util=require(_0x7242('0x6'));var path=require('path');var sox=require(_0x7242('0x7'));var csv=require('to-csv');var ejs=require(_0x7242('0x8'));var fs=require('fs');var _=require(_0x7242('0x9'));var squel=require(_0x7242('0xa'));var crypto=require(_0x7242('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7242('0xc'));var toCsv=require(_0x7242('0xd'));var querystring=require('querystring');var Papa=require(_0x7242('0xe'));var Redis=require(_0x7242('0xf'));var authService=require(_0x7242('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7242('0x11'));var logger=require(_0x7242('0x12'))(_0x7242('0x13'));var utils=require(_0x7242('0x14'));var config=require('../../config/environment');var db=require(_0x7242('0x15'))['db'];function respondWithStatusCode(_0xfee686,_0x4ea646){_0x4ea646=_0x4ea646||0xcc;return function(_0x2efc1e){if(_0x2efc1e){return _0xfee686[_0x7242('0x16')](_0x4ea646);}return _0xfee686[_0x7242('0x17')](_0x4ea646)['end']();};}function respondWithResult(_0x4bd60d,_0x25ed7a){_0x25ed7a=_0x25ed7a||0xc8;return function(_0x4e8042){if(_0x4e8042){return _0x4bd60d[_0x7242('0x17')](_0x25ed7a)[_0x7242('0x18')](_0x4e8042);}};}function respondWithFilteredResult(_0x294535,_0x994188){return function(_0x461f20){if(_0x461f20){var _0x13e8c9=_0x461f20['count'],_0x3ef574=_0x994188[_0x7242('0x19')],_0x4db26b=_0x994188[_0x7242('0x19')]+_0x994188['limit'],_0x157743;if(_0x4db26b>=_0x13e8c9){_0x4db26b=_0x13e8c9;_0x157743=0xc8;}else{_0x157743=0xce;}_0x294535['status'](_0x157743);return _0x294535['set'](_0x7242('0x1a'),_0x3ef574+'-'+_0x4db26b+'/'+_0x13e8c9)[_0x7242('0x18')](_0x461f20);}return null;};}function patchUpdates(_0x4ccca9){return function(_0x5c3ca2){try{jsonpatch['apply'](_0x5c3ca2,_0x4ccca9,!![]);}catch(_0x1214c4){return BPromise['reject'](_0x1214c4);}return _0x5c3ca2[_0x7242('0x1b')]();};}function saveUpdates(_0x5da4e6,_0x552a7d){return function(_0x32f42b){if(_0x32f42b){return _0x32f42b[_0x7242('0x1c')](_0x5da4e6)[_0x7242('0x1d')](function(_0xd68b73){return _0xd68b73;});}return null;};}function removeEntity(_0x2665ee,_0x298495){return function(_0x4bf6a6){if(_0x4bf6a6){return _0x4bf6a6[_0x7242('0x1e')]()[_0x7242('0x1d')](function(){_0x2665ee[_0x7242('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32cef6,_0x69b776){return function(_0xee9c58){if(!_0xee9c58){_0x32cef6[_0x7242('0x16')](0x194);}return _0xee9c58;};}function handleError(_0x3bf221,_0x15c180){_0x15c180=_0x15c180||0x1f4;return function(_0x3c8a86){logger['error'](_0x3c8a86['stack']);if(_0x3c8a86[_0x7242('0x1f')]){delete _0x3c8a86[_0x7242('0x1f')];}_0x3bf221[_0x7242('0x17')](_0x15c180)[_0x7242('0x20')](_0x3c8a86);};}exports[_0x7242('0x21')]=function(_0x241ec1,_0x251e8c){var _0x58da69={},_0xe41fb0={},_0xf28340={'count':0x0,'rows':[]};var _0x413a07=db['CmCustomField'][_0x7242('0x22')];_0xe41fb0[_0x7242('0x23')]=_[_0x7242('0x24')](_[_0x7242('0x25')](_0x413a07),[_0x7242('0x1f')]);_0xe41fb0[_0x7242('0x26')]=_['keys'](_0x241ec1[_0x7242('0x26')]);_0xe41fb0[_0x7242('0x27')]=_[_0x7242('0x28')](_0xe41fb0[_0x7242('0x23')],_0xe41fb0['query']);_0x58da69[_0x7242('0x29')]=_[_0x7242('0x28')](_0xe41fb0[_0x7242('0x23')],qs[_0x7242('0x2a')](_0x241ec1[_0x7242('0x26')]['fields']));_0x58da69[_0x7242('0x29')]=_0x58da69[_0x7242('0x29')]['length']?_0x58da69[_0x7242('0x29')]:_0xe41fb0[_0x7242('0x23')];if(!_0x241ec1[_0x7242('0x26')]['hasOwnProperty'](_0x7242('0x2b'))){_0x58da69['limit']=qs['limit'](_0x241ec1[_0x7242('0x26')]['limit']);_0x58da69[_0x7242('0x19')]=qs['offset'](_0x241ec1[_0x7242('0x26')][_0x7242('0x19')]);}_0x58da69[_0x7242('0x2c')]=qs['sort'](_0x241ec1['query'][_0x7242('0x2d')]);_0x58da69[_0x7242('0x2e')]=qs[_0x7242('0x27')](_[_0x7242('0x2f')](_0x241ec1[_0x7242('0x26')],_0xe41fb0[_0x7242('0x27')]));if(_0x241ec1['query'][_0x7242('0x30')]){_0x58da69['where']=_[_0x7242('0x31')](_0x58da69[_0x7242('0x2e')],{'$or':_[_0x7242('0x32')](_0x413a07,function(_0x1320f5){if(_0x1320f5[_0x7242('0x33')]['key']!==_0x7242('0x34')){var _0x260311={};_0x260311[_0x1320f5[_0x7242('0x35')]]={'$like':'%'+_0x241ec1[_0x7242('0x26')][_0x7242('0x30')]+'%'};return _0x260311;}})});}_0x58da69=_[_0x7242('0x31')]({},_0x58da69,_0x241ec1[_0x7242('0x36')]);var _0x1b0cb7={'where':_0x58da69[_0x7242('0x2e')]};return db['CmCustomField'][_0x7242('0x37')](_0x1b0cb7)[_0x7242('0x1d')](function(_0x41ddc9){_0xf28340[_0x7242('0x37')]=_0x41ddc9;if(_0x241ec1['query']['includeAll']){_0x58da69[_0x7242('0x38')]=[{'all':!![]}];}return db['CmCustomField'][_0x7242('0x39')](_0x58da69);})[_0x7242('0x1d')](function(_0x581f16){_0xf28340[_0x7242('0x3a')]=_0x581f16;return _0xf28340;})['then'](respondWithFilteredResult(_0x251e8c,_0x58da69))[_0x7242('0x3b')](handleError(_0x251e8c,null));};exports['show']=function(_0x19d1eb,_0x418b94){var _0x5a2e2c={'raw':!![],'where':{'id':_0x19d1eb[_0x7242('0x3c')]['id']}},_0x3749b7={};_0x3749b7[_0x7242('0x23')]=_[_0x7242('0x25')](db[_0x7242('0x3d')]['rawAttributes']);_0x3749b7[_0x7242('0x26')]=_['keys'](_0x19d1eb[_0x7242('0x26')]);_0x3749b7[_0x7242('0x27')]=_[_0x7242('0x28')](_0x3749b7['model'],_0x3749b7[_0x7242('0x26')]);_0x5a2e2c['attributes']=_['intersection'](_0x3749b7[_0x7242('0x23')],qs[_0x7242('0x2a')](_0x19d1eb['query']['fields']));_0x5a2e2c['attributes']=_0x5a2e2c[_0x7242('0x29')][_0x7242('0x3e')]?_0x5a2e2c['attributes']:_0x3749b7[_0x7242('0x23')];if(_0x19d1eb[_0x7242('0x26')][_0x7242('0x3f')]){_0x5a2e2c[_0x7242('0x38')]=[{'all':!![]}];}_0x5a2e2c=_[_0x7242('0x31')]({},_0x5a2e2c,_0x19d1eb[_0x7242('0x36')]);return db[_0x7242('0x3d')][_0x7242('0x40')](_0x5a2e2c)[_0x7242('0x1d')](handleEntityNotFound(_0x418b94,null))[_0x7242('0x1d')](respondWithResult(_0x418b94,null))['catch'](handleError(_0x418b94,null));};exports['create']=function(_0x162745,_0x1a55bb){return db['sequelize'][_0x7242('0x41')](function(_0x21f611){return db[_0x7242('0x3d')][_0x7242('0x42')](_0x162745[_0x7242('0x43')],{'transaction':_0x21f611});})[_0x7242('0x1d')](respondWithResult(_0x1a55bb,0xc9))[_0x7242('0x3b')](handleError(_0x1a55bb,null));};exports[_0x7242('0x1c')]=function(_0x4eae5e,_0x4851e0){if(_0x4eae5e['body']['id']){delete _0x4eae5e[_0x7242('0x43')]['id'];}return db[_0x7242('0x3d')]['find']({'where':{'id':_0x4eae5e[_0x7242('0x3c')]['id']}})[_0x7242('0x1d')](handleEntityNotFound(_0x4851e0,null))['then'](saveUpdates(_0x4eae5e[_0x7242('0x43')],null))[_0x7242('0x1d')](respondWithResult(_0x4851e0,null))[_0x7242('0x3b')](handleError(_0x4851e0,null));};exports[_0x7242('0x1e')]=function(_0x937c64,_0x21dc4f){return db[_0x7242('0x3d')][_0x7242('0x40')]({'where':{'id':_0x937c64[_0x7242('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21dc4f,null))[_0x7242('0x1d')](removeEntity(_0x21dc4f,null))[_0x7242('0x3b')](handleError(_0x21dc4f,null));}; \ No newline at end of file +var _0x7c40=['where','pick','filter','merge','type','key','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','sequelize','transaction','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','json','count','limit','status','set','apply','reject','update','then','error','stack','name','CmCustomField','model','differenceBy','keys','query','filters','intersection','attributes','fields','nolimit','offset','order','sort'];(function(_0x532b27,_0x4262b9){var _0x30ce08=function(_0x404878){while(--_0x404878){_0x532b27['push'](_0x532b27['shift']());}};_0x30ce08(++_0x4262b9);}(_0x7c40,0x12c));var _0x07c4=function(_0x2913b9,_0x5e6582){_0x2913b9=_0x2913b9-0x0;var _0x51cdf2=_0x7c40[_0x2913b9];return _0x51cdf2;};'use strict';var pdf=require(_0x07c4('0x0'));var emlformat=require(_0x07c4('0x1'));var rimraf=require(_0x07c4('0x2'));var zipdir=require(_0x07c4('0x3'));var jsonpatch=require(_0x07c4('0x4'));var rp=require(_0x07c4('0x5'));var moment=require(_0x07c4('0x6'));var BPromise=require(_0x07c4('0x7'));var Mustache=require('mustache');var util=require(_0x07c4('0x8'));var path=require(_0x07c4('0x9'));var sox=require(_0x07c4('0xa'));var csv=require(_0x07c4('0xb'));var ejs=require(_0x07c4('0xc'));var fs=require('fs');var _=require(_0x07c4('0xd'));var squel=require(_0x07c4('0xe'));var crypto=require('crypto');var jsforce=require(_0x07c4('0xf'));var deskjs=require(_0x07c4('0x10'));var toCsv=require(_0x07c4('0xb'));var querystring=require('querystring');var Papa=require(_0x07c4('0x11'));var Redis=require(_0x07c4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07c4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07c4('0x14'))(_0x07c4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x07c4('0x16'))['db'];function respondWithStatusCode(_0x488a94,_0x52f953){_0x52f953=_0x52f953||0xcc;return function(_0x1c26ac){if(_0x1c26ac){return _0x488a94[_0x07c4('0x17')](_0x52f953);}return _0x488a94['status'](_0x52f953)[_0x07c4('0x18')]();};}function respondWithResult(_0x22af4b,_0x17701d){_0x17701d=_0x17701d||0xc8;return function(_0x12bbc7){if(_0x12bbc7){return _0x22af4b['status'](_0x17701d)[_0x07c4('0x19')](_0x12bbc7);}};}function respondWithFilteredResult(_0x537f17,_0x49ee9a){return function(_0x11c5a6){if(_0x11c5a6){var _0x2a3df6=_0x11c5a6[_0x07c4('0x1a')],_0x463489=_0x49ee9a['offset'],_0xc0773c=_0x49ee9a['offset']+_0x49ee9a[_0x07c4('0x1b')],_0xbd510c;if(_0xc0773c>=_0x2a3df6){_0xc0773c=_0x2a3df6;_0xbd510c=0xc8;}else{_0xbd510c=0xce;}_0x537f17[_0x07c4('0x1c')](_0xbd510c);return _0x537f17[_0x07c4('0x1d')]('Content-Range',_0x463489+'-'+_0xc0773c+'/'+_0x2a3df6)[_0x07c4('0x19')](_0x11c5a6);}return null;};}function patchUpdates(_0x1a0525){return function(_0x51a5d2){try{jsonpatch[_0x07c4('0x1e')](_0x51a5d2,_0x1a0525,!![]);}catch(_0x4c00c9){return BPromise[_0x07c4('0x1f')](_0x4c00c9);}return _0x51a5d2['save']();};}function saveUpdates(_0x502325,_0x22e4b5){return function(_0x51f780){if(_0x51f780){return _0x51f780[_0x07c4('0x20')](_0x502325)[_0x07c4('0x21')](function(_0xc0a956){return _0xc0a956;});}return null;};}function removeEntity(_0x275a1f,_0x3b7f84){return function(_0x406832){if(_0x406832){return _0x406832['destroy']()[_0x07c4('0x21')](function(){_0x275a1f[_0x07c4('0x1c')](0xcc)[_0x07c4('0x18')]();});}};}function handleEntityNotFound(_0x1421a3,_0x4d7872){return function(_0x5de314){if(!_0x5de314){_0x1421a3['sendStatus'](0x194);}return _0x5de314;};}function handleError(_0x5d5148,_0x97140d){_0x97140d=_0x97140d||0x1f4;return function(_0x5b2f24){logger[_0x07c4('0x22')](_0x5b2f24[_0x07c4('0x23')]);if(_0x5b2f24[_0x07c4('0x24')]){delete _0x5b2f24[_0x07c4('0x24')];}_0x5d5148[_0x07c4('0x1c')](_0x97140d)['send'](_0x5b2f24);};}exports['index']=function(_0x1a6ea5,_0x2328ca){var _0x3381ae={},_0x56694d={},_0x4f88df={'count':0x0,'rows':[]};var _0x3e508b=db[_0x07c4('0x25')]['rawAttributes'];_0x56694d[_0x07c4('0x26')]=_[_0x07c4('0x27')](_[_0x07c4('0x28')](_0x3e508b),['name']);_0x56694d[_0x07c4('0x29')]=_[_0x07c4('0x28')](_0x1a6ea5[_0x07c4('0x29')]);_0x56694d[_0x07c4('0x2a')]=_[_0x07c4('0x2b')](_0x56694d[_0x07c4('0x26')],_0x56694d[_0x07c4('0x29')]);_0x3381ae[_0x07c4('0x2c')]=_[_0x07c4('0x2b')](_0x56694d['model'],qs[_0x07c4('0x2d')](_0x1a6ea5['query'][_0x07c4('0x2d')]));_0x3381ae[_0x07c4('0x2c')]=_0x3381ae[_0x07c4('0x2c')]['length']?_0x3381ae[_0x07c4('0x2c')]:_0x56694d['model'];if(!_0x1a6ea5[_0x07c4('0x29')]['hasOwnProperty'](_0x07c4('0x2e'))){_0x3381ae[_0x07c4('0x1b')]=qs[_0x07c4('0x1b')](_0x1a6ea5[_0x07c4('0x29')][_0x07c4('0x1b')]);_0x3381ae[_0x07c4('0x2f')]=qs[_0x07c4('0x2f')](_0x1a6ea5['query'][_0x07c4('0x2f')]);}_0x3381ae[_0x07c4('0x30')]=qs['sort'](_0x1a6ea5['query'][_0x07c4('0x31')]);_0x3381ae[_0x07c4('0x32')]=qs[_0x07c4('0x2a')](_[_0x07c4('0x33')](_0x1a6ea5[_0x07c4('0x29')],_0x56694d[_0x07c4('0x2a')]));if(_0x1a6ea5[_0x07c4('0x29')][_0x07c4('0x34')]){_0x3381ae['where']=_[_0x07c4('0x35')](_0x3381ae[_0x07c4('0x32')],{'$or':_['map'](_0x3e508b,function(_0x5ded26){if(_0x5ded26[_0x07c4('0x36')][_0x07c4('0x37')]!=='VIRTUAL'){var _0x426c39={};_0x426c39[_0x5ded26['field']]={'$like':'%'+_0x1a6ea5['query']['filter']+'%'};return _0x426c39;}})});}_0x3381ae=_[_0x07c4('0x35')]({},_0x3381ae,_0x1a6ea5[_0x07c4('0x38')]);var _0xe6a0a8={'where':_0x3381ae[_0x07c4('0x32')]};return db[_0x07c4('0x25')]['count'](_0xe6a0a8)['then'](function(_0x5c9c51){_0x4f88df[_0x07c4('0x1a')]=_0x5c9c51;if(_0x1a6ea5['query']['includeAll']){_0x3381ae[_0x07c4('0x39')]=[{'all':!![]}];}return db[_0x07c4('0x25')][_0x07c4('0x3a')](_0x3381ae);})['then'](function(_0x43cc53){_0x4f88df[_0x07c4('0x3b')]=_0x43cc53;return _0x4f88df;})[_0x07c4('0x21')](respondWithFilteredResult(_0x2328ca,_0x3381ae))[_0x07c4('0x3c')](handleError(_0x2328ca,null));};exports[_0x07c4('0x3d')]=function(_0x49b6e0,_0x40c74b){var _0x2b6ee2={'raw':!![],'where':{'id':_0x49b6e0['params']['id']}},_0xd46b16={};_0xd46b16[_0x07c4('0x26')]=_[_0x07c4('0x28')](db[_0x07c4('0x25')][_0x07c4('0x3e')]);_0xd46b16[_0x07c4('0x29')]=_[_0x07c4('0x28')](_0x49b6e0[_0x07c4('0x29')]);_0xd46b16[_0x07c4('0x2a')]=_[_0x07c4('0x2b')](_0xd46b16[_0x07c4('0x26')],_0xd46b16['query']);_0x2b6ee2[_0x07c4('0x2c')]=_[_0x07c4('0x2b')](_0xd46b16['model'],qs[_0x07c4('0x2d')](_0x49b6e0['query']['fields']));_0x2b6ee2['attributes']=_0x2b6ee2[_0x07c4('0x2c')]['length']?_0x2b6ee2[_0x07c4('0x2c')]:_0xd46b16[_0x07c4('0x26')];if(_0x49b6e0['query'][_0x07c4('0x3f')]){_0x2b6ee2[_0x07c4('0x39')]=[{'all':!![]}];}_0x2b6ee2=_[_0x07c4('0x35')]({},_0x2b6ee2,_0x49b6e0['options']);return db[_0x07c4('0x25')][_0x07c4('0x40')](_0x2b6ee2)['then'](handleEntityNotFound(_0x40c74b,null))['then'](respondWithResult(_0x40c74b,null))[_0x07c4('0x3c')](handleError(_0x40c74b,null));};exports[_0x07c4('0x41')]=function(_0x2338f1,_0x30a83a){return db[_0x07c4('0x42')][_0x07c4('0x43')](function(_0x2ebb25){return db[_0x07c4('0x25')][_0x07c4('0x41')](_0x2338f1['body'],{'transaction':_0x2ebb25});})[_0x07c4('0x21')](respondWithResult(_0x30a83a,0xc9))[_0x07c4('0x3c')](handleError(_0x30a83a,null));};exports[_0x07c4('0x20')]=function(_0x2e3865,_0x138753){if(_0x2e3865[_0x07c4('0x44')]['id']){delete _0x2e3865[_0x07c4('0x44')]['id'];}return db[_0x07c4('0x25')][_0x07c4('0x40')]({'where':{'id':_0x2e3865[_0x07c4('0x45')]['id']}})[_0x07c4('0x21')](handleEntityNotFound(_0x138753,null))[_0x07c4('0x21')](saveUpdates(_0x2e3865[_0x07c4('0x44')],null))['then'](respondWithResult(_0x138753,null))[_0x07c4('0x3c')](handleError(_0x138753,null));};exports['destroy']=function(_0x5589c5,_0x269e36){return db[_0x07c4('0x25')][_0x07c4('0x40')]({'where':{'id':_0x5589c5[_0x07c4('0x45')]['id']}})[_0x07c4('0x21')](handleEntityNotFound(_0x269e36,null))[_0x07c4('0x21')](removeEntity(_0x269e36,null))['catch'](handleError(_0x269e36,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e399b9c..c745318 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 _0x1077=['BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','get','transaction','type','text','TEXT','number','INTEGER','switch'];(function(_0x3c2ddd,_0x1b9a5c){var _0xe7a022=function(_0x246c25){while(--_0x246c25){_0x3c2ddd['push'](_0x3c2ddd['shift']());}};_0xe7a022(++_0x1b9a5c);}(_0x1077,0x1e3));var _0x7107=function(_0x409ec7,_0x6e06c9){_0x409ec7=_0x409ec7-0x0;var _0x5eb6f8=_0x1077[_0x409ec7];return _0x5eb6f8;};'use strict';var _=require(_0x7107('0x0'));var util=require(_0x7107('0x1'));var logger=require(_0x7107('0x2'))(_0x7107('0x3'));var moment=require(_0x7107('0x4'));var BPromise=require(_0x7107('0x5'));var rp=require(_0x7107('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7107('0x7'));var config=require(_0x7107('0x8'));var attributes=require(_0x7107('0x9'));module[_0x7107('0xa')]=function(_0x30f21d,_0x5ccd22){return _0x30f21d[_0x7107('0xb')]('CmCustomField',attributes,{'tableName':_0x7107('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fc44b,_0x14b6fb,_0x1263a2){var _0x13c544=_0x4fc44b[_0x7107('0xd')]({'plain':!![]});var _0x50400a={'type':_0x5ccd22['TEXT'],'transaction':_0x14b6fb[_0x7107('0xe')]};switch(_0x13c544[_0x7107('0xf')]){case _0x7107('0x10'):_0x50400a['type']=_0x5ccd22[_0x7107('0x11')];break;case _0x7107('0x12'):_0x50400a[_0x7107('0xf')]=_0x5ccd22[_0x7107('0x13')];break;case _0x7107('0x14'):_0x50400a[_0x7107('0xf')]=_0x5ccd22[_0x7107('0x15')];_0x50400a[_0x7107('0x16')]=![];break;}_0x30f21d[_0x7107('0x17')][_0x7107('0x18')](_0x7107('0x19'),util[_0x7107('0x1a')](_0x7107('0x1b'),_0x13c544['id']),_0x50400a);_0x1263a2();}}});}; \ No newline at end of file +var _0xb56e=['path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','transaction','type','text','TEXT','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','lodash','api','moment','bluebird'];(function(_0x1a422a,_0x3468fd){var _0x4dcab4=function(_0x24b700){while(--_0x24b700){_0x1a422a['push'](_0x1a422a['shift']());}};_0x4dcab4(++_0x3468fd);}(_0xb56e,0x1a0));var _0xeb56=function(_0x20a086,_0x15cef2){_0x20a086=_0x20a086-0x0;var _0x379cc3=_0xb56e[_0x20a086];return _0x379cc3;};'use strict';var _=require(_0xeb56('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeb56('0x1'));var moment=require(_0xeb56('0x2'));var BPromise=require(_0xeb56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb56('0x4'));var rimraf=require(_0xeb56('0x5'));var config=require('../../config/environment');var attributes=require(_0xeb56('0x6'));module[_0xeb56('0x7')]=function(_0x5ef4c2,_0x899c68){return _0x5ef4c2[_0xeb56('0x8')](_0xeb56('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x42b4f4,_0x314650,_0x5cfb26){var _0x153d45=_0x42b4f4['get']({'plain':!![]});var _0x3f0910={'type':_0x899c68['TEXT'],'transaction':_0x314650[_0xeb56('0xa')]};switch(_0x153d45[_0xeb56('0xb')]){case _0xeb56('0xc'):_0x3f0910['type']=_0x899c68[_0xeb56('0xd')];break;case'number':_0x3f0910[_0xeb56('0xb')]=_0x899c68['INTEGER'];break;case'switch':_0x3f0910[_0xeb56('0xb')]=_0x899c68[_0xeb56('0xe')];_0x3f0910[_0xeb56('0xf')]=![];break;}_0x5ef4c2[_0xeb56('0x10')][_0xeb56('0x11')]('cm_contacts',util[_0xeb56('0x12')](_0xeb56('0x13'),_0x153d45['id']),_0x3f0910);_0x5cfb26();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index d33b6a8..f79158a 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 _0x5fb1=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x117457,_0x805df8){var _0x4d5055=function(_0x5e8269){while(--_0x5e8269){_0x117457['push'](_0x117457['shift']());}};_0x4d5055(++_0x805df8);}(_0x5fb1,0x100));var _0x15fb=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x5fb1[_0xc87d08];return _0x30a714;};'use strict';var _=require('lodash');var util=require(_0x15fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x15fb('0x1'));var fs=require('fs');var Redis=require(_0x15fb('0x2'));var db=require(_0x15fb('0x3'))['db'];var utils=require(_0x15fb('0x4'));var logger=require(_0x15fb('0x5'))('rpc');var config=require(_0x15fb('0x6'));var jayson=require(_0x15fb('0x7'));var client=jayson[_0x15fb('0x8')][_0x15fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x514b28,_0x3f5b60,_0x58171b){return new BPromise(function(_0x46261d,_0x54c35a){return client[_0x15fb('0xa')](_0x514b28,_0x58171b)['then'](function(_0x46b47c){logger[_0x15fb('0xb')](_0x15fb('0xc'),_0x3f5b60,_0x15fb('0xd'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x3f5b60,_0x15fb('0xd'),JSON[_0x15fb('0xe')](_0x46b47c));if(_0x46b47c[_0x15fb('0xf')]){if(_0x46b47c[_0x15fb('0xf')][_0x15fb('0x10')]===0x1f4){logger[_0x15fb('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3f5b60,_0x46b47c[_0x15fb('0xf')]['message']);return _0x54c35a(_0x46b47c[_0x15fb('0xf')][_0x15fb('0x11')]);}logger[_0x15fb('0xf')](_0x15fb('0xc'),_0x3f5b60,_0x46b47c['error'][_0x15fb('0x11')]);return _0x46261d(_0x46b47c['error'][_0x15fb('0x11')]);}else{logger[_0x15fb('0xb')](_0x15fb('0xc'),_0x3f5b60,_0x15fb('0xd'));_0x46261d(_0x46b47c[_0x15fb('0x12')][_0x15fb('0x11')]);}})['catch'](function(_0x2d14e1){logger[_0x15fb('0xf')](_0x15fb('0xc'),_0x3f5b60,_0x2d14e1);_0x54c35a(_0x2d14e1);});});} \ No newline at end of file +var _0x4538=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s'];(function(_0x475295,_0x407028){var _0x5385df=function(_0x4a9fb7){while(--_0x4a9fb7){_0x475295['push'](_0x475295['shift']());}};_0x5385df(++_0x407028);}(_0x4538,0xb7));var _0x8453=function(_0x26e8aa,_0x6520ea){_0x26e8aa=_0x26e8aa-0x0;var _0x491a10=_0x4538[_0x26e8aa];return _0x491a10;};'use strict';var _=require(_0x8453('0x0'));var util=require(_0x8453('0x1'));var moment=require(_0x8453('0x2'));var BPromise=require(_0x8453('0x3'));var rs=require(_0x8453('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8453('0x5'))['db'];var utils=require(_0x8453('0x6'));var logger=require(_0x8453('0x7'))(_0x8453('0x8'));var config=require(_0x8453('0x9'));var jayson=require(_0x8453('0xa'));var client=jayson[_0x8453('0xb')][_0x8453('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5175f2,_0x2e405c,_0x5f4ee5){return new BPromise(function(_0x37038a,_0x2926a9){return client[_0x8453('0xd')](_0x5175f2,_0x5f4ee5)[_0x8453('0xe')](function(_0x5d1749){logger[_0x8453('0xf')](_0x8453('0x10'),_0x2e405c,'request\x20sent');logger[_0x8453('0x11')](_0x8453('0x12'),_0x2e405c,'request\x20sent',JSON[_0x8453('0x13')](_0x5d1749));if(_0x5d1749[_0x8453('0x14')]){if(_0x5d1749['error'][_0x8453('0x15')]===0x1f4){logger[_0x8453('0x14')](_0x8453('0x10'),_0x2e405c,_0x5d1749[_0x8453('0x14')][_0x8453('0x16')]);return _0x2926a9(_0x5d1749[_0x8453('0x14')][_0x8453('0x16')]);}logger[_0x8453('0x14')](_0x8453('0x10'),_0x2e405c,_0x5d1749[_0x8453('0x14')]['message']);return _0x37038a(_0x5d1749[_0x8453('0x14')]['message']);}else{logger['info'](_0x8453('0x10'),_0x2e405c,_0x8453('0x17'));_0x37038a(_0x5d1749[_0x8453('0x18')][_0x8453('0x16')]);}})['catch'](function(_0x20abd7){logger['error'](_0x8453('0x10'),_0x2e405c,_0x20abd7);_0x2926a9(_0x20abd7);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 4638552..d46a47a 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 _0x9b80=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b80,0xff));var _0x09b8=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x9b80[_0x1a21ff];return _0x25afc1;};'use strict';var multer=require('multer');var util=require(_0x09b8('0x0'));var path=require('path');var timeout=require(_0x09b8('0x1'));var express=require(_0x09b8('0x2'));var router=express['Router']();var auth=require(_0x09b8('0x3'));var interaction=require(_0x09b8('0x4'));var config=require(_0x09b8('0x5'));var controller=require('./cmCustomField.controller');router[_0x09b8('0x6')]('/',auth['isAuthenticated'](),controller[_0x09b8('0x7')]);router['get']('/:id',auth[_0x09b8('0x8')](),controller[_0x09b8('0x9')]);router[_0x09b8('0xa')]('/',auth[_0x09b8('0x8')](),controller[_0x09b8('0xb')]);router[_0x09b8('0xc')](_0x09b8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x09b8('0xe')](_0x09b8('0xd'),auth[_0x09b8('0x8')](),controller[_0x09b8('0xf')]);module[_0x09b8('0x10')]=router; \ No newline at end of file +var _0xc7c0=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x4d23f2,_0x42db51){var _0x5d0e95=function(_0x3b5bfb){while(--_0x3b5bfb){_0x4d23f2['push'](_0x4d23f2['shift']());}};_0x5d0e95(++_0x42db51);}(_0xc7c0,0x184));var _0x0c7c=function(_0x24780c,_0x2492e3){_0x24780c=_0x24780c-0x0;var _0x30c5d2=_0xc7c0[_0x24780c];return _0x30c5d2;};'use strict';var multer=require('multer');var util=require(_0x0c7c('0x0'));var path=require(_0x0c7c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c7c('0x2')]();var auth=require(_0x0c7c('0x3'));var interaction=require(_0x0c7c('0x4'));var config=require(_0x0c7c('0x5'));var controller=require(_0x0c7c('0x6'));router[_0x0c7c('0x7')]('/',auth[_0x0c7c('0x8')](),controller[_0x0c7c('0x9')]);router['get'](_0x0c7c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0c7c('0xb')]('/',auth[_0x0c7c('0x8')](),controller[_0x0c7c('0xc')]);router[_0x0c7c('0xd')]('/:id',auth[_0x0c7c('0x8')](),controller[_0x0c7c('0xe')]);router[_0x0c7c('0xf')](_0x0c7c('0xa'),auth[_0x0c7c('0x8')](),controller[_0x0c7c('0x10')]);module[_0x0c7c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b644cd3..4f079b7 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 _0x9fca=['INTEGER','contactListQueue','STRING','BOOLEAN','DATE','format'];(function(_0x383015,_0xb43004){var _0x6af896=function(_0x4dd023){while(--_0x4dd023){_0x383015['push'](_0x383015['shift']());}};_0x6af896(++_0xb43004);}(_0x9fca,0x1d0));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xa9fc('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0xa9fc('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa9fc('0x2')],'defaultValue':moment()[_0xa9fc('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xa9fc('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa9fc('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa9fc('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa9fc('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa9fc('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa9fc('0x4')],'unique':_0xa9fc('0x5')},'ListId':{'type':Sequelize[_0xa9fc('0x4')],'unique':_0xa9fc('0x5')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa9fc('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xa9fc('0x4')]}}; \ No newline at end of file +var _0xc5d0=['contactListQueue','moment','sequelize','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED'];(function(_0x3d0971,_0x7d6fa2){var _0x32e2c1=function(_0x2e1670){while(--_0x2e1670){_0x3d0971['push'](_0x3d0971['shift']());}};_0x32e2c1(++_0x7d6fa2);}(_0xc5d0,0xa3));var _0x0c5d=function(_0x41358a,_0x322144){_0x41358a=_0x41358a-0x0;var _0x8c40ce=_0xc5d0[_0x41358a];return _0x8c40ce;};'use strict';var moment=require(_0x0c5d('0x0'));var Sequelize=require(_0x0c5d('0x1'));module['exports']={'phone':{'type':Sequelize[_0x0c5d('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x0c5d('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0c5d('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0c5d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c5d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c5d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0c5d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0c5d('0x6')]},'priority':{'type':Sequelize[_0x0c5d('0x5')](0x2)[_0x0c5d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0c5d('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0c5d('0x5')],'unique':_0x0c5d('0x8')},'ListId':{'type':Sequelize[_0x0c5d('0x5')],'unique':_0x0c5d('0x8')},'UserId':{'type':Sequelize[_0x0c5d('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0c5d('0x8')},'CampaignId':{'type':Sequelize[_0x0c5d('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index be76cef..93cd0ec 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 _0x5d81=['CmHopper','rawAttributes','keys','query','filters','intersection','model','concat','$and','$or','$lte','$eq','$between','$in','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','updatedAt','state','statedesc','deleted','campaign','membername','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ContactId','firstName','lastName','isNil','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','map','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','VoiceQueue','Queue','dialActive','getOpenContacts','outbound','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x5d81,0x181));var _0x15d8=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x5d81[_0x2ff238];return _0x204a56;};'use strict';var pdf=require(_0x15d8('0x0'));var emlformat=require(_0x15d8('0x1'));var rimraf=require(_0x15d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15d8('0x3'));var rp=require(_0x15d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x15d8('0x5'));var sox=require('sox');var csv=require(_0x15d8('0x6'));var ejs=require(_0x15d8('0x7'));var fs=require('fs');var _=require(_0x15d8('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x15d8('0x9'));var deskjs=require(_0x15d8('0xa'));var toCsv=require('to-csv');var querystring=require(_0x15d8('0xb'));var Papa=require(_0x15d8('0xc'));var Redis=require(_0x15d8('0xd'));var authService=require(_0x15d8('0xe'));var qs=require(_0x15d8('0xf'));var hardwareService=require(_0x15d8('0x10'));var logger=require(_0x15d8('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x15d8('0x12'))['db'];function respondWithStatusCode(_0x2f3772,_0x2d2f1c){_0x2d2f1c=_0x2d2f1c||0xcc;return function(_0x292ba3){if(_0x292ba3){return _0x2f3772[_0x15d8('0x13')](_0x2d2f1c);}return _0x2f3772[_0x15d8('0x14')](_0x2d2f1c)[_0x15d8('0x15')]();};}function respondWithResult(_0x28b9fd,_0x31e579){_0x31e579=_0x31e579||0xc8;return function(_0x12bab6){if(_0x12bab6){return _0x28b9fd[_0x15d8('0x14')](_0x31e579)[_0x15d8('0x16')](_0x12bab6);}};}function respondWithFilteredResult(_0x4a57e8,_0x2dd192){return function(_0x5207ac){if(_0x5207ac){var _0x450927=_0x5207ac['count'],_0x26acb2=_0x2dd192[_0x15d8('0x17')],_0x63992=_0x2dd192['offset']+_0x2dd192[_0x15d8('0x18')],_0x1680fd;if(_0x63992>=_0x450927){_0x63992=_0x450927;_0x1680fd=0xc8;}else{_0x1680fd=0xce;}_0x4a57e8['status'](_0x1680fd);return _0x4a57e8[_0x15d8('0x19')](_0x15d8('0x1a'),_0x26acb2+'-'+_0x63992+'/'+_0x450927)[_0x15d8('0x16')](_0x5207ac);}return null;};}function patchUpdates(_0x4abc40){return function(_0x1f7211){try{jsonpatch[_0x15d8('0x1b')](_0x1f7211,_0x4abc40,!![]);}catch(_0x40f2e6){return BPromise[_0x15d8('0x1c')](_0x40f2e6);}return _0x1f7211[_0x15d8('0x1d')]();};}function saveUpdates(_0xda298a,_0x8799ce){return function(_0x1d2e58){if(_0x1d2e58){return _0x1d2e58[_0x15d8('0x1e')](_0xda298a)[_0x15d8('0x1f')](function(_0x488cc2){return _0x488cc2;});}return null;};}function removeEntity(_0x828243,_0x2dd9ca){return function(_0x6f1443){if(_0x6f1443){return _0x6f1443['destroy']()[_0x15d8('0x1f')](function(){_0x828243[_0x15d8('0x14')](0xcc)[_0x15d8('0x15')]();});}};}function handleEntityNotFound(_0x126be4,_0xc8693f){return function(_0x5f02ff){if(!_0x5f02ff){_0x126be4[_0x15d8('0x13')](0x194);}return _0x5f02ff;};}function handleError(_0x56fc54,_0x4df32a){_0x4df32a=_0x4df32a||0x1f4;return function(_0x5475a5){logger['error'](_0x5475a5[_0x15d8('0x20')]);if(_0x5475a5[_0x15d8('0x21')]){delete _0x5475a5[_0x15d8('0x21')];}_0x56fc54[_0x15d8('0x14')](_0x4df32a)['send'](_0x5475a5);};}exports[_0x15d8('0x22')]=function(_0x49a333,_0x142308){var _0xdad36c={},_0x2f052e={},_0x3a8fa0={'count':0x0,'rows':[]};var _0x2756c3=db[_0x15d8('0x23')][_0x15d8('0x24')];_0x2f052e['model']=_[_0x15d8('0x25')](_0x2756c3);_0x2f052e[_0x15d8('0x26')]=_[_0x15d8('0x25')](_0x49a333['query']);_0x2f052e[_0x15d8('0x27')]=_[_0x15d8('0x28')](_0x2f052e[_0x15d8('0x29')],_0x2f052e['query']);_0x2f052e[_0x15d8('0x27')]=_[_0x15d8('0x2a')](_0x2f052e[_0x15d8('0x27')],[_0x15d8('0x2b'),_0x15d8('0x2c'),'$gt','$gte','$lt',_0x15d8('0x2d'),'$ne',_0x15d8('0x2e'),'$not',_0x15d8('0x2f'),'$notBetween',_0x15d8('0x30'),'$notIn',_0x15d8('0x31'),_0x15d8('0x32'),_0x15d8('0x33'),'$notILike',_0x15d8('0x31'),_0x15d8('0x34'),_0x15d8('0x35'),'$contained',_0x15d8('0x36')]);_0xdad36c[_0x15d8('0x37')]=_[_0x15d8('0x28')](_0x2f052e[_0x15d8('0x29')],qs[_0x15d8('0x38')](_0x49a333[_0x15d8('0x26')][_0x15d8('0x38')]));_0xdad36c[_0x15d8('0x37')]=_0xdad36c[_0x15d8('0x37')][_0x15d8('0x39')]?_0xdad36c[_0x15d8('0x37')]:_0x2f052e[_0x15d8('0x29')];if(!_0x49a333[_0x15d8('0x26')]['hasOwnProperty'](_0x15d8('0x3a'))){_0xdad36c['limit']=qs[_0x15d8('0x18')](_0x49a333[_0x15d8('0x26')]['limit']);_0xdad36c['offset']=qs[_0x15d8('0x17')](_0x49a333[_0x15d8('0x26')][_0x15d8('0x17')]);}_0xdad36c[_0x15d8('0x3b')]=qs['sort'](_0x49a333[_0x15d8('0x26')][_0x15d8('0x3c')]);_0xdad36c['where']=qs[_0x15d8('0x27')](_[_0x15d8('0x3d')](_0x49a333[_0x15d8('0x26')],_0x2f052e[_0x15d8('0x27')]));if(_0x49a333[_0x15d8('0x26')][_0x15d8('0x3e')]){_0xdad36c[_0x15d8('0x3f')]=_[_0x15d8('0x40')](_0xdad36c['where'],{'$or':_['map'](_0x2756c3,function(_0x27b154){if(_0x27b154[_0x15d8('0x41')][_0x15d8('0x42')]!==_0x15d8('0x43')){var _0x580486={};_0x580486[_0x27b154[_0x15d8('0x44')]]={'$like':'%'+_0x49a333[_0x15d8('0x26')][_0x15d8('0x3e')]+'%'};return _0x580486;}})});}_0xdad36c=_['merge']({},_0xdad36c,_0x49a333[_0x15d8('0x45')]);var _0x3b1e80={'where':_0xdad36c[_0x15d8('0x3f')]};return db[_0x15d8('0x23')][_0x15d8('0x46')](_0x3b1e80)[_0x15d8('0x1f')](function(_0x3a7bd2){_0x3a8fa0['count']=_0x3a7bd2;if(_0x49a333[_0x15d8('0x26')][_0x15d8('0x47')]){_0xdad36c[_0x15d8('0x48')]=[{'all':!![]}];}return db[_0x15d8('0x23')][_0x15d8('0x49')](_0xdad36c);})[_0x15d8('0x1f')](function(_0x12dc28){_0x3a8fa0[_0x15d8('0x4a')]=_0x12dc28;return _0x3a8fa0;})[_0x15d8('0x1f')](respondWithFilteredResult(_0x142308,_0xdad36c))[_0x15d8('0x4b')](handleError(_0x142308,null));};exports['show']=function(_0x4bea7,_0x2abc31){var _0x20b29d={'raw':!![],'where':{'id':_0x4bea7[_0x15d8('0x4c')]['id']}},_0x3eb6c9={};_0x3eb6c9[_0x15d8('0x29')]=_['keys'](db[_0x15d8('0x23')][_0x15d8('0x24')]);_0x3eb6c9[_0x15d8('0x26')]=_[_0x15d8('0x25')](_0x4bea7[_0x15d8('0x26')]);_0x3eb6c9[_0x15d8('0x27')]=_[_0x15d8('0x28')](_0x3eb6c9[_0x15d8('0x29')],_0x3eb6c9[_0x15d8('0x26')]);_0x20b29d['attributes']=_[_0x15d8('0x28')](_0x3eb6c9[_0x15d8('0x29')],qs[_0x15d8('0x38')](_0x4bea7['query']['fields']));_0x20b29d[_0x15d8('0x37')]=_0x20b29d[_0x15d8('0x37')][_0x15d8('0x39')]?_0x20b29d[_0x15d8('0x37')]:_0x3eb6c9['model'];if(_0x4bea7['query'][_0x15d8('0x47')]){_0x20b29d[_0x15d8('0x48')]=[{'all':!![]}];}_0x20b29d=_[_0x15d8('0x40')]({},_0x20b29d,_0x4bea7['options']);return db[_0x15d8('0x23')][_0x15d8('0x4d')](_0x20b29d)[_0x15d8('0x1f')](handleEntityNotFound(_0x2abc31,null))[_0x15d8('0x1f')](respondWithResult(_0x2abc31,null))[_0x15d8('0x4b')](handleError(_0x2abc31,null));};exports[_0x15d8('0x4e')]=function(_0x5e682c,_0x2da400){return db['CmHopper']['create'](_0x5e682c[_0x15d8('0x4f')],{})[_0x15d8('0x1f')](respondWithResult(_0x2da400,0xc9))[_0x15d8('0x4b')](handleError(_0x2da400,null));};exports[_0x15d8('0x1e')]=function(_0x52b17f,_0x1308a8){if(_0x52b17f[_0x15d8('0x4f')]['id']){delete _0x52b17f['body']['id'];}return db[_0x15d8('0x23')][_0x15d8('0x4d')]({'where':{'id':_0x52b17f['params']['id']}})['then'](handleEntityNotFound(_0x1308a8,null))[_0x15d8('0x1f')](saveUpdates(_0x52b17f[_0x15d8('0x4f')],null))[_0x15d8('0x1f')](respondWithResult(_0x1308a8,null))[_0x15d8('0x4b')](handleError(_0x1308a8,null));};exports[_0x15d8('0x50')]=function(_0x118298,_0x935e34){return db[_0x15d8('0x23')][_0x15d8('0x50')]()[_0x15d8('0x1f')](respondWithResult(_0x935e34,null))['catch'](handleError(_0x935e34,null));};exports[_0x15d8('0x51')]=function(_0x2d31f6,_0x1b07b8){var _0x5a5744;return db[_0x15d8('0x23')][_0x15d8('0x4d')]({'where':{'id':_0x2d31f6['params']['id']}})[_0x15d8('0x1f')](handleEntityNotFound(_0x1b07b8,null))[_0x15d8('0x1f')](function(_0x28910e){if(_0x28910e){return _0x28910e[_0x15d8('0x51')]()[_0x15d8('0x1f')](function(_0x439617){return _0x439617;});}})[_0x15d8('0x1f')](function(_0xdbe72d){_0x5a5744=_0xdbe72d;if(_0xdbe72d){if(_0xdbe72d[_0x15d8('0x52')]||_0xdbe72d[_0x15d8('0x53')]){return db[_0xdbe72d[_0x15d8('0x52')]?'VoiceQueue':_0x15d8('0x54')][_0x15d8('0x4d')]({'where':{'id':_0xdbe72d[_0x15d8('0x52')]?_0xdbe72d['VoiceQueueId']:_0xdbe72d[_0x15d8('0x53')]},'attributes':['id',_0x15d8('0x21')],'raw':!![]});}}})[_0x15d8('0x1f')](function(_0x109866){var _0xfd53ff={};if(_0x109866){_[_0x15d8('0x40')](_0xfd53ff,_[_0x15d8('0x55')](_0x5a5744['dataValues'],['createdAt',_0x15d8('0x56'),'id']));_0xfd53ff[_0x15d8('0x57')]=0x15;_0xfd53ff[_0x15d8('0x58')]=_0x15d8('0x59');_0xfd53ff[_0x15d8('0x5a')]=_0x109866[_0x15d8('0x21')];_0xfd53ff[_0x15d8('0x5b')]=_0x2d31f6[_0x15d8('0x5c')][_0x15d8('0x21')];_0xfd53ff['UserId']=_0x2d31f6['user']['id'];_0xfd53ff[_0x15d8('0x59')]=!![];_0xfd53ff['deletedat']=moment()[_0x15d8('0x5d')](_0x15d8('0x5e'));_0xfd53ff[_0x15d8('0x5f')]=_0x5a5744[_0x15d8('0x60')];_0xfd53ff[_0x15d8('0x61')]=_0x5a5744[_0x15d8('0x52')]?_0x15d8('0x62'):'ivr';return db['CmContact'][_0x15d8('0x4d')]({'where':{'id':_0xfd53ff[_0x15d8('0x63')]},'attributes':[_0x15d8('0x64'),_0x15d8('0x65')]})[_0x15d8('0x1f')](function(_0x4bf429){if(!_[_0x15d8('0x66')](_0x1b07b8)&&!_[_0x15d8('0x66')](_0x4bf429['firstName'])){_0xfd53ff['calleridname']=_0x4bf429[_0x15d8('0x64')];if(!_[_0x15d8('0x66')](_0x4bf429['lastName'])){_0xfd53ff['calleridname']+='\x20'+_0x4bf429['lastName'];}}})[_0x15d8('0x67')](function(){return db[_0x15d8('0x68')][_0x15d8('0x4e')](_0xfd53ff);});}})[_0x15d8('0x1f')](function(){return _0x1b07b8[_0x15d8('0x14')](0xcc)['end']();})[_0x15d8('0x4b')](handleError(_0x1b07b8,null));};exports[_0x15d8('0x69')]=function(_0x176d65,_0xa69ed,_0x1fbe95){var _0x539169=[];return db[_0x15d8('0x6a')][_0x15d8('0x50')]()['then'](function(_0x24d6a7){_0x539169=_[_0x15d8('0x25')](_0x24d6a7);return _0x176d65[_0x15d8('0x5c')][_0x15d8('0x6b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x15d8('0x6c')},'attributes':['id',_0x15d8('0x6d')],'raw':!![]});})['then'](function(_0x12e358){if(_0x12e358&&_0x12e358[_0x15d8('0x39')]){return db[_0x15d8('0x6e')][_0x15d8('0x6f')](function(_0xc00679){var _0x4c50a3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x15d8('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x15d8('0x70')](_0x12e358,'id')},'$or':[{'UserId':null},{'UserId':_0x176d65[_0x15d8('0x5c')]['id']}]};var _0xa30bc1=[];if(_0x176d65[_0x15d8('0x4f')][_0x15d8('0x71')]&&_0x176d65[_0x15d8('0x4f')][_0x15d8('0x71')]===_0x15d8('0x72')){if(!_[_0x15d8('0x73')](_0x176d65[_0x15d8('0x4f')][_0x15d8('0x74')])){_0x4c50a3['id']={'$in':_0x176d65['body'][_0x15d8('0x74')]};}_0xa30bc1=[[_0x15d8('0x75'),_0x15d8('0x76')],[_0x15d8('0x77'),_0x12e358[0x0]['dialOrderByScheduledAt']==='ASC'?_0x15d8('0x78'):_0x15d8('0x76')],db[_0x15d8('0x6e')][_0x15d8('0x79')](_0x15d8('0x7a')),['id',_0x15d8('0x78')]];}else{if(!_[_0x15d8('0x73')](_0x176d65[_0x15d8('0x4f')][_0x15d8('0x74')])){_0x4c50a3['id']={'$notIn':_0x176d65[_0x15d8('0x4f')][_0x15d8('0x74')]};}_0xa30bc1=[['priority',_0x15d8('0x78')],[_0x15d8('0x77'),_0x12e358[0x0][_0x15d8('0x6d')]],db[_0x15d8('0x6e')][_0x15d8('0x79')](_0x15d8('0x7b')),['id',_0x15d8('0x76')]];}return db[_0x15d8('0x23')][_0x15d8('0x7c')]({'attributes':['id',_0x15d8('0x7d')],'where':_0x4c50a3,'order':_0xa30bc1,'transaction':_0xc00679,'lock':_0xc00679['LOCK'][_0x15d8('0x7e')],'include':[{'model':db[_0x15d8('0x6a')],'as':_0x15d8('0x7f'),'attributes':_0x539169,'include':[{'model':db[_0x15d8('0x80')],'as':_0x15d8('0x81'),'attributes':['id',_0x15d8('0x21')]}]},{'model':db[_0x15d8('0x82')],'as':'List','attributes':['id',_0x15d8('0x21')]},{'model':db[_0x15d8('0x83')],'as':_0x15d8('0x84'),'attributes':['id','name',_0x15d8('0x85')]}]})[_0x15d8('0x1f')](function(_0x6cfb36){if(_0x6cfb36){return _0x6cfb36['update']({'UserId':_0x176d65[_0x15d8('0x5c')]['id']},{'transaction':_0xc00679});}});});}})[_0x15d8('0x1f')](handleEntityNotFound(_0xa69ed,null))[_0x15d8('0x1f')](respondWithResult(_0xa69ed,null))['catch'](handleError(_0xa69ed,null));};exports[_0x15d8('0x86')]=function(_0x46c01e,_0x299232,_0x5d7173){return _0x46c01e[_0x15d8('0x5c')][_0x15d8('0x6b')]({'where':{'type':_0x15d8('0x87'),'dialActive':!![],'dialMethod':_0x15d8('0x6c')},'attributes':['id'],'raw':!![]})[_0x15d8('0x1f')](function(_0x10fb8c){if(_0x10fb8c&&_0x10fb8c[_0x15d8('0x39')]){return db[_0x15d8('0x23')][_0x15d8('0x46')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x15d8('0x5d')](_0x15d8('0x5e'))},'VoiceQueueId':{'$in':_[_0x15d8('0x70')](_0x10fb8c,'id')},'$or':[{'UserId':null},{'UserId':_0x46c01e[_0x15d8('0x5c')]['id']}]}});}return 0x0;})[_0x15d8('0x1f')](function(_0x423f5e){if(!_[_0x15d8('0x66')](_0x423f5e)&&_[_0x15d8('0x88')](_0x423f5e)){return _0x299232[_0x15d8('0x14')](0xc8)[_0x15d8('0x16')]({'contacts':_0x423f5e});}else{logger[_0x15d8('0x89')](_0x15d8('0x8a'),'getOpenContacts',0x194,_0x15d8('0x8b'));_0x299232['sendStatus'](0x194);}})[_0x15d8('0x4b')](handleError(_0x299232,null));}; \ No newline at end of file +var _0xfc2f=['where','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','update','params','describe','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','ivr','ContactId','firstName','calleridname','lastName','finally','getPreview','CmContact','outbound','preview','dialOrderByScheduledAt','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','CmCompany','CmList','List','dialActive','getOpenContacts','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','destroy','then','name','send','index','CmHopper','keys','query','model','concat','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick'];(function(_0x23fc73,_0x5b3357){var _0x3fb4ea=function(_0x3b1a7f){while(--_0x3b1a7f){_0x23fc73['push'](_0x23fc73['shift']());}};_0x3fb4ea(++_0x5b3357);}(_0xfc2f,0xd1));var _0xffc2=function(_0x572ff1,_0x5516b7){_0x572ff1=_0x572ff1-0x0;var _0x46d4df=_0xfc2f[_0x572ff1];return _0x46d4df;};'use strict';var pdf=require(_0xffc2('0x0'));var emlformat=require(_0xffc2('0x1'));var rimraf=require(_0xffc2('0x2'));var zipdir=require(_0xffc2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffc2('0x4'));var moment=require('moment');var BPromise=require(_0xffc2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xffc2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xffc2('0x7'));var fs=require('fs');var _=require(_0xffc2('0x8'));var squel=require(_0xffc2('0x9'));var crypto=require(_0xffc2('0xa'));var jsforce=require(_0xffc2('0xb'));var deskjs=require(_0xffc2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xffc2('0xd'));var Papa=require(_0xffc2('0xe'));var Redis=require(_0xffc2('0xf'));var authService=require(_0xffc2('0x10'));var qs=require(_0xffc2('0x11'));var hardwareService=require(_0xffc2('0x12'));var logger=require(_0xffc2('0x13'))('api');var utils=require(_0xffc2('0x14'));var config=require('../../config/environment');var db=require(_0xffc2('0x15'))['db'];function respondWithStatusCode(_0x3abed5,_0x149c8b){_0x149c8b=_0x149c8b||0xcc;return function(_0x1bf263){if(_0x1bf263){return _0x3abed5[_0xffc2('0x16')](_0x149c8b);}return _0x3abed5[_0xffc2('0x17')](_0x149c8b)[_0xffc2('0x18')]();};}function respondWithResult(_0x2b434f,_0x2a791a){_0x2a791a=_0x2a791a||0xc8;return function(_0x2fdad8){if(_0x2fdad8){return _0x2b434f[_0xffc2('0x17')](_0x2a791a)['json'](_0x2fdad8);}};}function respondWithFilteredResult(_0x49902f,_0x206ea4){return function(_0x5752ed){if(_0x5752ed){var _0x139e21=_0x5752ed[_0xffc2('0x19')],_0x2e5d78=_0x206ea4['offset'],_0x37182f=_0x206ea4['offset']+_0x206ea4[_0xffc2('0x1a')],_0xbde053;if(_0x37182f>=_0x139e21){_0x37182f=_0x139e21;_0xbde053=0xc8;}else{_0xbde053=0xce;}_0x49902f[_0xffc2('0x17')](_0xbde053);return _0x49902f[_0xffc2('0x1b')](_0xffc2('0x1c'),_0x2e5d78+'-'+_0x37182f+'/'+_0x139e21)['json'](_0x5752ed);}return null;};}function patchUpdates(_0x2cdd5d){return function(_0x40f588){try{jsonpatch[_0xffc2('0x1d')](_0x40f588,_0x2cdd5d,!![]);}catch(_0x2d3080){return BPromise[_0xffc2('0x1e')](_0x2d3080);}return _0x40f588[_0xffc2('0x1f')]();};}function saveUpdates(_0x1c76a2,_0x17e3da){return function(_0x286c26){if(_0x286c26){return _0x286c26['update'](_0x1c76a2)['then'](function(_0x3dbb2d){return _0x3dbb2d;});}return null;};}function removeEntity(_0x4eb785,_0x124b09){return function(_0x115769){if(_0x115769){return _0x115769[_0xffc2('0x20')]()[_0xffc2('0x21')](function(){_0x4eb785['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x210a51,_0x152a10){return function(_0x22ce2a){if(!_0x22ce2a){_0x210a51[_0xffc2('0x16')](0x194);}return _0x22ce2a;};}function handleError(_0x1a052d,_0xad6745){_0xad6745=_0xad6745||0x1f4;return function(_0x3241da){logger['error'](_0x3241da['stack']);if(_0x3241da[_0xffc2('0x22')]){delete _0x3241da['name'];}_0x1a052d[_0xffc2('0x17')](_0xad6745)[_0xffc2('0x23')](_0x3241da);};}exports[_0xffc2('0x24')]=function(_0x4e7fb0,_0x307938){var _0x379e88={},_0x28f8f2={},_0xecce4a={'count':0x0,'rows':[]};var _0x9c23fa=db[_0xffc2('0x25')]['rawAttributes'];_0x28f8f2['model']=_[_0xffc2('0x26')](_0x9c23fa);_0x28f8f2[_0xffc2('0x27')]=_[_0xffc2('0x26')](_0x4e7fb0[_0xffc2('0x27')]);_0x28f8f2['filters']=_['intersection'](_0x28f8f2[_0xffc2('0x28')],_0x28f8f2[_0xffc2('0x27')]);_0x28f8f2['filters']=_[_0xffc2('0x29')](_0x28f8f2['filters'],[_0xffc2('0x2a'),_0xffc2('0x2b'),_0xffc2('0x2c'),'$gte',_0xffc2('0x2d'),'$lte',_0xffc2('0x2e'),_0xffc2('0x2f'),_0xffc2('0x30'),_0xffc2('0x31'),_0xffc2('0x32'),'$in',_0xffc2('0x33'),_0xffc2('0x34'),_0xffc2('0x35'),_0xffc2('0x36'),_0xffc2('0x37'),_0xffc2('0x34'),_0xffc2('0x38'),'$contains','$contained',_0xffc2('0x39')]);_0x379e88['attributes']=_[_0xffc2('0x3a')](_0x28f8f2[_0xffc2('0x28')],qs[_0xffc2('0x3b')](_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x3b')]));_0x379e88['attributes']=_0x379e88[_0xffc2('0x3c')][_0xffc2('0x3d')]?_0x379e88[_0xffc2('0x3c')]:_0x28f8f2[_0xffc2('0x28')];if(!_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x3e')](_0xffc2('0x3f'))){_0x379e88[_0xffc2('0x1a')]=qs['limit'](_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x1a')]);_0x379e88['offset']=qs[_0xffc2('0x40')](_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x40')]);}_0x379e88[_0xffc2('0x41')]=qs[_0xffc2('0x42')](_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x42')]);_0x379e88['where']=qs[_0xffc2('0x43')](_[_0xffc2('0x44')](_0x4e7fb0[_0xffc2('0x27')],_0x28f8f2[_0xffc2('0x43')]));if(_0x4e7fb0[_0xffc2('0x27')]['filter']){_0x379e88[_0xffc2('0x45')]=_[_0xffc2('0x46')](_0x379e88[_0xffc2('0x45')],{'$or':_[_0xffc2('0x47')](_0x9c23fa,function(_0x51dd66){if(_0x51dd66[_0xffc2('0x48')][_0xffc2('0x49')]!==_0xffc2('0x4a')){var _0x19e074={};_0x19e074[_0x51dd66[_0xffc2('0x4b')]]={'$like':'%'+_0x4e7fb0[_0xffc2('0x27')][_0xffc2('0x4c')]+'%'};return _0x19e074;}})});}_0x379e88=_[_0xffc2('0x46')]({},_0x379e88,_0x4e7fb0[_0xffc2('0x4d')]);var _0x323c87={'where':_0x379e88[_0xffc2('0x45')]};return db[_0xffc2('0x25')][_0xffc2('0x19')](_0x323c87)[_0xffc2('0x21')](function(_0x2b701a){_0xecce4a[_0xffc2('0x19')]=_0x2b701a;if(_0x4e7fb0[_0xffc2('0x27')]['includeAll']){_0x379e88[_0xffc2('0x4e')]=[{'all':!![]}];}return db[_0xffc2('0x25')][_0xffc2('0x4f')](_0x379e88);})[_0xffc2('0x21')](function(_0x28db3d){_0xecce4a[_0xffc2('0x50')]=_0x28db3d;return _0xecce4a;})[_0xffc2('0x21')](respondWithFilteredResult(_0x307938,_0x379e88))[_0xffc2('0x51')](handleError(_0x307938,null));};exports['show']=function(_0x459490,_0x202a8e){var _0x474dbd={'raw':!![],'where':{'id':_0x459490['params']['id']}},_0x47c55b={};_0x47c55b['model']=_[_0xffc2('0x26')](db[_0xffc2('0x25')][_0xffc2('0x52')]);_0x47c55b['query']=_['keys'](_0x459490['query']);_0x47c55b[_0xffc2('0x43')]=_[_0xffc2('0x3a')](_0x47c55b[_0xffc2('0x28')],_0x47c55b[_0xffc2('0x27')]);_0x474dbd[_0xffc2('0x3c')]=_[_0xffc2('0x3a')](_0x47c55b[_0xffc2('0x28')],qs[_0xffc2('0x3b')](_0x459490[_0xffc2('0x27')][_0xffc2('0x3b')]));_0x474dbd['attributes']=_0x474dbd[_0xffc2('0x3c')][_0xffc2('0x3d')]?_0x474dbd[_0xffc2('0x3c')]:_0x47c55b[_0xffc2('0x28')];if(_0x459490[_0xffc2('0x27')][_0xffc2('0x53')]){_0x474dbd['include']=[{'all':!![]}];}_0x474dbd=_['merge']({},_0x474dbd,_0x459490['options']);return db['CmHopper'][_0xffc2('0x54')](_0x474dbd)['then'](handleEntityNotFound(_0x202a8e,null))[_0xffc2('0x21')](respondWithResult(_0x202a8e,null))[_0xffc2('0x51')](handleError(_0x202a8e,null));};exports[_0xffc2('0x55')]=function(_0xa285c8,_0x5db686){return db['CmHopper'][_0xffc2('0x55')](_0xa285c8[_0xffc2('0x56')],{})[_0xffc2('0x21')](respondWithResult(_0x5db686,0xc9))[_0xffc2('0x51')](handleError(_0x5db686,null));};exports[_0xffc2('0x57')]=function(_0x42cfb4,_0x47b926){if(_0x42cfb4[_0xffc2('0x56')]['id']){delete _0x42cfb4[_0xffc2('0x56')]['id'];}return db['CmHopper'][_0xffc2('0x54')]({'where':{'id':_0x42cfb4[_0xffc2('0x58')]['id']}})[_0xffc2('0x21')](handleEntityNotFound(_0x47b926,null))[_0xffc2('0x21')](saveUpdates(_0x42cfb4[_0xffc2('0x56')],null))[_0xffc2('0x21')](respondWithResult(_0x47b926,null))['catch'](handleError(_0x47b926,null));};exports[_0xffc2('0x59')]=function(_0x11cb8b,_0x125f0f){return db['CmHopper'][_0xffc2('0x59')]()[_0xffc2('0x21')](respondWithResult(_0x125f0f,null))[_0xffc2('0x51')](handleError(_0x125f0f,null));};exports['destroy']=function(_0x157ac8,_0x377822){var _0x239aa1;return db[_0xffc2('0x25')][_0xffc2('0x54')]({'where':{'id':_0x157ac8['params']['id']}})['then'](handleEntityNotFound(_0x377822,null))[_0xffc2('0x21')](function(_0x163a5c){if(_0x163a5c){return _0x163a5c[_0xffc2('0x20')]()[_0xffc2('0x21')](function(_0x5ade0d){return _0x5ade0d;});}})[_0xffc2('0x21')](function(_0x23618c){_0x239aa1=_0x23618c;if(_0x23618c){if(_0x23618c[_0xffc2('0x5a')]||_0x23618c['CampaignId']){return db[_0x23618c[_0xffc2('0x5a')]?_0xffc2('0x5b'):_0xffc2('0x5c')][_0xffc2('0x54')]({'where':{'id':_0x23618c[_0xffc2('0x5a')]?_0x23618c[_0xffc2('0x5a')]:_0x23618c['CampaignId']},'attributes':['id',_0xffc2('0x22')],'raw':!![]});}}})[_0xffc2('0x21')](function(_0x253dd5){var _0x4a5219={};if(_0x253dd5){_[_0xffc2('0x46')](_0x4a5219,_[_0xffc2('0x5d')](_0x239aa1[_0xffc2('0x5e')],['createdAt',_0xffc2('0x5f'),'id']));_0x4a5219[_0xffc2('0x60')]=0x15;_0x4a5219[_0xffc2('0x61')]=_0xffc2('0x62');_0x4a5219[_0xffc2('0x63')]=_0x253dd5[_0xffc2('0x22')];_0x4a5219['membername']=_0x157ac8[_0xffc2('0x64')][_0xffc2('0x22')];_0x4a5219[_0xffc2('0x65')]=_0x157ac8[_0xffc2('0x64')]['id'];_0x4a5219[_0xffc2('0x62')]=!![];_0x4a5219['deletedat']=moment()[_0xffc2('0x66')](_0xffc2('0x67'));_0x4a5219['calleridnum']=_0x239aa1['phone'];_0x4a5219[_0xffc2('0x68')]=_0x239aa1[_0xffc2('0x5a')]?_0xffc2('0x69'):_0xffc2('0x6a');return db['CmContact'][_0xffc2('0x54')]({'where':{'id':_0x4a5219[_0xffc2('0x6b')]},'attributes':['firstName','lastName']})[_0xffc2('0x21')](function(_0x19ebd5){if(!_['isNil'](_0x377822)&&!_['isNil'](_0x19ebd5[_0xffc2('0x6c')])){_0x4a5219[_0xffc2('0x6d')]=_0x19ebd5[_0xffc2('0x6c')];if(!_['isNil'](_0x19ebd5[_0xffc2('0x6e')])){_0x4a5219[_0xffc2('0x6d')]+='\x20'+_0x19ebd5[_0xffc2('0x6e')];}}})[_0xffc2('0x6f')](function(){return db['CmHopperFinal']['create'](_0x4a5219);});}})['then'](function(){return _0x377822['status'](0xcc)['end']();})['catch'](handleError(_0x377822,null));};exports[_0xffc2('0x70')]=function(_0x5f2f7c,_0x1b506a,_0x21e1fb){var _0x3d5f35=[];return db[_0xffc2('0x71')][_0xffc2('0x59')]()[_0xffc2('0x21')](function(_0xc28e1f){_0x3d5f35=_['keys'](_0xc28e1f);return _0x5f2f7c[_0xffc2('0x64')]['getVoiceQueues']({'where':{'type':_0xffc2('0x72'),'dialActive':!![],'dialMethod':_0xffc2('0x73')},'attributes':['id',_0xffc2('0x74')],'raw':!![]});})['then'](function(_0x78b9b4){if(_0x78b9b4&&_0x78b9b4[_0xffc2('0x3d')]){return db['sequelize']['transaction'](function(_0xd8dec8){var _0x583fbb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xffc2('0x67'))},'VoiceQueueId':{'$in':_[_0xffc2('0x47')](_0x78b9b4,'id')},'$or':[{'UserId':null},{'UserId':_0x5f2f7c[_0xffc2('0x64')]['id']}]};var _0x1b82a5=[];if(_0x5f2f7c[_0xffc2('0x56')][_0xffc2('0x75')]&&_0x5f2f7c['body'][_0xffc2('0x75')]===_0xffc2('0x76')){if(!_[_0xffc2('0x77')](_0x5f2f7c[_0xffc2('0x56')][_0xffc2('0x78')])){_0x583fbb['id']={'$in':_0x5f2f7c['body']['hopperIds']};}_0x1b82a5=[[_0xffc2('0x79'),_0xffc2('0x7a')],[_0xffc2('0x7b'),_0x78b9b4[0x0]['dialOrderByScheduledAt']==='ASC'?_0xffc2('0x7c'):_0xffc2('0x7a')],db[_0xffc2('0x7d')][_0xffc2('0x7e')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0xffc2('0x77')](_0x5f2f7c[_0xffc2('0x56')][_0xffc2('0x78')])){_0x583fbb['id']={'$notIn':_0x5f2f7c[_0xffc2('0x56')]['hopperIds']};}_0x1b82a5=[[_0xffc2('0x79'),_0xffc2('0x7c')],[_0xffc2('0x7b'),_0x78b9b4[0x0]['dialOrderByScheduledAt']],db[_0xffc2('0x7d')]['literal'](_0xffc2('0x7f')),['id',_0xffc2('0x7a')]];}return db[_0xffc2('0x25')][_0xffc2('0x80')]({'attributes':['id','scheduledat'],'where':_0x583fbb,'order':_0x1b82a5,'transaction':_0xd8dec8,'lock':_0xd8dec8[_0xffc2('0x81')][_0xffc2('0x82')],'include':[{'model':db[_0xffc2('0x71')],'as':'Contact','attributes':_0x3d5f35,'include':[{'model':db[_0xffc2('0x83')],'as':'Company','attributes':['id',_0xffc2('0x22')]}]},{'model':db[_0xffc2('0x84')],'as':_0xffc2('0x85'),'attributes':['id',_0xffc2('0x22')]},{'model':db[_0xffc2('0x5b')],'as':'Queue','attributes':['id','name',_0xffc2('0x86')]}]})['then'](function(_0x41302f){if(_0x41302f){return _0x41302f[_0xffc2('0x57')]({'UserId':_0x5f2f7c[_0xffc2('0x64')]['id']},{'transaction':_0xd8dec8});}});});}})[_0xffc2('0x21')](handleEntityNotFound(_0x1b506a,null))['then'](respondWithResult(_0x1b506a,null))['catch'](handleError(_0x1b506a,null));};exports[_0xffc2('0x87')]=function(_0x469e66,_0x3948c7,_0x322708){return _0x469e66[_0xffc2('0x64')]['getVoiceQueues']({'where':{'type':_0xffc2('0x72'),'dialActive':!![],'dialMethod':_0xffc2('0x73')},'attributes':['id'],'raw':!![]})[_0xffc2('0x21')](function(_0x4dca3c){if(_0x4dca3c&&_0x4dca3c['length']){return db[_0xffc2('0x25')][_0xffc2('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xffc2('0x66')](_0xffc2('0x67'))},'VoiceQueueId':{'$in':_[_0xffc2('0x47')](_0x4dca3c,'id')},'$or':[{'UserId':null},{'UserId':_0x469e66['user']['id']}]}});}return 0x0;})[_0xffc2('0x21')](function(_0x597796){if(!_['isNil'](_0x597796)&&_['isNumber'](_0x597796)){return _0x3948c7[_0xffc2('0x17')](0xc8)[_0xffc2('0x88')]({'contacts':_0x597796});}else{logger['error'](_0xffc2('0x89'),_0xffc2('0x87'),0x194,_0xffc2('0x8a'));_0x3948c7[_0xffc2('0x16')](0x194);}})[_0xffc2('0x51')](handleError(_0x3948c7,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f2b8421..9870eec 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 _0x4ded=['exports','define','CmHopper','cm_hopper','scheduledat','phone','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x536eca,_0x18b615){var _0x28f35f=function(_0x34bbbe){while(--_0x34bbbe){_0x536eca['push'](_0x536eca['shift']());}};_0x28f35f(++_0x18b615);}(_0x4ded,0x116));var _0xd4de=function(_0x1a57d9,_0x479c64){_0x1a57d9=_0x1a57d9-0x0;var _0x1ebe82=_0x4ded[_0x1a57d9];return _0x1ebe82;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var moment=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var rp=require(_0xd4de('0x6'));var fs=require('fs');var path=require(_0xd4de('0x7'));var rimraf=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var attributes=require(_0xd4de('0xa'));module[_0xd4de('0xb')]=function(_0x554a51,_0x23e5b9){return _0x554a51[_0xd4de('0xc')](_0xd4de('0xd'),attributes,{'tableName':_0xd4de('0xe'),'paranoid':![],'indexes':[{'name':_0xd4de('0xf'),'fields':[_0xd4de('0xf')]},{'name':'phone','fields':[_0xd4de('0x10')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x97c1=['phone','priority','lodash','util','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper'];(function(_0x57cf92,_0x1580c4){var _0x4a0677=function(_0x18f244){while(--_0x18f244){_0x57cf92['push'](_0x57cf92['shift']());}};_0x4a0677(++_0x1580c4);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var logger=require('../../config/logger')(_0x197c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x197c('0x3'));var fs=require('fs');var path=require(_0x197c('0x4'));var rimraf=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var attributes=require(_0x197c('0x7'));module['exports']=function(_0x5cbff6,_0x1cb6e1){return _0x5cbff6[_0x197c('0x8')](_0x197c('0x9'),attributes,{'tableName':_0x197c('0xa'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0x197c('0xb'),'fields':['phone']},{'name':_0x197c('0xc'),'fields':[_0x197c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c0314f1..99ce5fb 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 _0x4691=['CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','map','include','model','then','debug','stringify','find','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','transaction','order','UPDATE','keys','length','push','all','sequelize','CmHopperFinal','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','UserId','LOCK','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error'];(function(_0x1aa920,_0x299428){var _0x3cdb29=function(_0x38f164){while(--_0x38f164){_0x1aa920['push'](_0x1aa920['shift']());}};_0x3cdb29(++_0x299428);}(_0x4691,0x1bc));var _0x1469=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x4691[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x1469('0x0'));var util=require('util');var moment=require(_0x1469('0x1'));var BPromise=require(_0x1469('0x2'));var rs=require(_0x1469('0x3'));var fs=require('fs');var Redis=require(_0x1469('0x4'));var db=require(_0x1469('0x5'))['db'];var utils=require(_0x1469('0x6'));var logger=require(_0x1469('0x7'))(_0x1469('0x8'));var config=require(_0x1469('0x9'));var jayson=require(_0x1469('0xa'));var client=jayson[_0x1469('0xb')][_0x1469('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3442f7,_0x4ce327,_0x10d468){return new BPromise(function(_0x191efe,_0xc6c545){return client[_0x1469('0xd')](_0x3442f7,_0x10d468)['then'](function(_0x2b7faa){logger[_0x1469('0xe')]('CmHopper,\x20%s,\x20%s',_0x4ce327,_0x1469('0xf'));logger['debug'](_0x1469('0x10'),_0x4ce327,_0x1469('0xf'),JSON['stringify'](_0x2b7faa));if(_0x2b7faa[_0x1469('0x11')]){if(_0x2b7faa[_0x1469('0x11')]['code']===0x1f4){logger[_0x1469('0x11')](_0x1469('0x12'),_0x4ce327,_0x2b7faa['error']['message']);return _0xc6c545(_0x2b7faa[_0x1469('0x11')][_0x1469('0x13')]);}logger[_0x1469('0x11')](_0x1469('0x12'),_0x4ce327,_0x2b7faa[_0x1469('0x11')]['message']);return _0x191efe(_0x2b7faa[_0x1469('0x11')][_0x1469('0x13')]);}else{logger[_0x1469('0xe')]('CmHopper,\x20%s,\x20%s',_0x4ce327,_0x1469('0xf'));_0x191efe(_0x2b7faa['result']['message']);}})[_0x1469('0x14')](function(_0x30fd97){logger['error']('CmHopper,\x20%s,\x20%s',_0x4ce327,_0x30fd97);_0xc6c545(_0x30fd97);});});}exports[_0x1469('0x15')]=function(_0x9ce5f){var _0x361306=this;return new Promise(function(_0xedd3fc,_0x539ba2){return db[_0x1469('0x16')][_0x1469('0x17')]({'raw':_0x9ce5f['options']?_0x9ce5f[_0x1469('0x18')][_0x1469('0x19')]===undefined?!![]:![]:!![],'where':_0x9ce5f[_0x1469('0x18')]?_0x9ce5f[_0x1469('0x18')]['where']||null:null,'attributes':_0x9ce5f[_0x1469('0x18')]?_0x9ce5f['options'][_0x1469('0x1a')]||null:null,'limit':_0x9ce5f[_0x1469('0x18')]?_0x9ce5f[_0x1469('0x18')][_0x1469('0x1b')]||null:null,'include':_0x9ce5f[_0x1469('0x18')]?_0x9ce5f['options']['include']?_[_0x1469('0x1c')](_0x9ce5f[_0x1469('0x18')][_0x1469('0x1d')],function(_0x3c5191){return{'model':db[_0x3c5191[_0x1469('0x1e')]],'as':_0x3c5191['as'],'attributes':_0x3c5191['attributes'],'include':_0x3c5191[_0x1469('0x1d')]?_[_0x1469('0x1c')](_0x3c5191[_0x1469('0x1d')],function(_0x23e529){return{'model':db[_0x23e529[_0x1469('0x1e')]],'as':_0x23e529['as'],'attributes':_0x23e529[_0x1469('0x1a')],'include':_0x23e529[_0x1469('0x1d')]?_[_0x1469('0x1c')](_0x23e529[_0x1469('0x1d')],function(_0x3f08ba){return{'model':db[_0x3f08ba[_0x1469('0x1e')]],'as':_0x3f08ba['as'],'attributes':_0x3f08ba[_0x1469('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1469('0x1f')](function(_0x515d26){logger[_0x1469('0xe')]('GetCmHopper',_0x9ce5f);logger[_0x1469('0x20')](_0x1469('0x15'),_0x9ce5f,JSON[_0x1469('0x21')](_0x515d26));_0xedd3fc(_0x515d26);})['catch'](function(_0x4d836a){logger['error'](_0x1469('0x15'),_0x4d836a[_0x1469('0x13')],_0x9ce5f);_0x539ba2(_0x361306['error'](0x1f4,_0x4d836a[_0x1469('0x13')]));});});};exports['ShowCmHopper']=function(_0x4f6258){var _0x3045da=this;return new Promise(function(_0x5de423,_0x263bee){return db['CmHopper'][_0x1469('0x22')]({'raw':_0x4f6258[_0x1469('0x18')]?_0x4f6258[_0x1469('0x18')][_0x1469('0x19')]===undefined?!![]:![]:!![],'where':_0x4f6258[_0x1469('0x18')]?_0x4f6258['options'][_0x1469('0x23')]||null:null,'attributes':_0x4f6258[_0x1469('0x18')]?_0x4f6258[_0x1469('0x18')]['attributes']||null:null,'include':_0x4f6258[_0x1469('0x18')]?_0x4f6258[_0x1469('0x18')]['include']?_['map'](_0x4f6258[_0x1469('0x18')][_0x1469('0x1d')],function(_0x1e0a9f){return{'model':db[_0x1e0a9f[_0x1469('0x1e')]],'as':_0x1e0a9f['as'],'attributes':_0x1e0a9f[_0x1469('0x1a')],'include':_0x1e0a9f[_0x1469('0x1d')]?_[_0x1469('0x1c')](_0x1e0a9f[_0x1469('0x1d')],function(_0x23442c){return{'model':db[_0x23442c[_0x1469('0x1e')]],'as':_0x23442c['as'],'attributes':_0x23442c[_0x1469('0x1a')],'include':_0x23442c[_0x1469('0x1d')]?_[_0x1469('0x1c')](_0x23442c[_0x1469('0x1d')],function(_0x4cb955){return{'model':db[_0x4cb955[_0x1469('0x1e')]],'as':_0x4cb955['as'],'attributes':_0x4cb955[_0x1469('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1469('0x1f')](function(_0x1b0d60){logger[_0x1469('0xe')](_0x1469('0x24'),_0x4f6258);logger[_0x1469('0x20')](_0x1469('0x24'),_0x4f6258,JSON['stringify'](_0x1b0d60));_0x5de423(_0x1b0d60);})[_0x1469('0x14')](function(_0x440988){logger[_0x1469('0x11')](_0x1469('0x24'),_0x440988[_0x1469('0x13')],_0x4f6258);_0x263bee(_0x3045da[_0x1469('0x11')](0x1f4,_0x440988[_0x1469('0x13')]));});});};exports[_0x1469('0x25')]=function(_0x50e075){var _0x16bb72=this;return new Promise(function(_0x1989a4,_0x562597){return db[_0x1469('0x16')][_0x1469('0x26')](_0x50e075[_0x1469('0x27')],{'raw':_0x50e075[_0x1469('0x18')]?_0x50e075[_0x1469('0x18')][_0x1469('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5452ab){logger[_0x1469('0xe')](_0x1469('0x25'),_0x50e075);logger[_0x1469('0x20')](_0x1469('0x25'),_0x50e075,JSON[_0x1469('0x21')](_0x5452ab));_0x1989a4(_0x5452ab);})[_0x1469('0x14')](function(_0x3d705a){logger['error'](_0x1469('0x25'),_0x3d705a[_0x1469('0x13')],_0x50e075);_0x562597(_0x16bb72[_0x1469('0x11')](0x1f4,_0x3d705a[_0x1469('0x13')]));});});};exports[_0x1469('0x28')]=function(_0x266d99){var _0x8f1547=this;return new Promise(function(_0x592121,_0x49d801){return db['CmHopper'][_0x1469('0x29')](_0x266d99['body'],{'raw':_0x266d99[_0x1469('0x18')]?_0x266d99[_0x1469('0x18')][_0x1469('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x266d99[_0x1469('0x18')]?_0x266d99[_0x1469('0x18')][_0x1469('0x23')]||null:null,'attributes':_0x266d99[_0x1469('0x18')]?_0x266d99[_0x1469('0x18')][_0x1469('0x1a')]||null:null,'limit':_0x266d99[_0x1469('0x18')]?_0x266d99['options'][_0x1469('0x1b')]||null:null})[_0x1469('0x1f')](function(_0x426ed3){logger['info'](_0x1469('0x28'),_0x266d99);logger[_0x1469('0x20')](_0x1469('0x28'),_0x266d99,JSON[_0x1469('0x21')](_0x426ed3));_0x592121(_0x426ed3);})[_0x1469('0x14')](function(_0x431b43){logger['error']('UpdateCmHopper',_0x431b43['message'],_0x266d99);_0x49d801(_0x8f1547['error'](0x1f4,_0x431b43['message']));});});};exports['DestroyCmHopper']=function(_0x12c07b){var _0xab2367=this;return new Promise(function(_0x108e37,_0x525c49){return db['CmHopper'][_0x1469('0x2a')]({'where':_0x12c07b[_0x1469('0x18')]?_0x12c07b[_0x1469('0x18')][_0x1469('0x23')]||null:null})[_0x1469('0x1f')](function(_0x193503){logger[_0x1469('0xe')](_0x1469('0x2b'),_0x12c07b);logger[_0x1469('0x20')](_0x1469('0x2b'),_0x12c07b,JSON[_0x1469('0x21')](_0x193503));_0x108e37(_0x193503);})['catch'](function(_0x13be5a){logger['error']('DestroyCmHopper',_0x13be5a[_0x1469('0x13')],_0x12c07b);_0x525c49(_0xab2367[_0x1469('0x11')](0x1f4,_0x13be5a[_0x1469('0x13')]));});});};exports[_0x1469('0x2c')]=function(_0x43080a){var _0x4b2ed4=this;return new Promise(function(_0x3f28e2,_0x1f8156){return db['CmContact']['describe']()[_0x1469('0x1f')](function(_0x2492b8){return db['sequelize'][_0x1469('0x2d')](function(_0xde1efb){return db[_0x1469('0x16')]['findAll']({'where':_0x43080a[_0x1469('0x18')]?_0x43080a[_0x1469('0x18')][_0x1469('0x23')]||null:null,'attributes':_0x43080a[_0x1469('0x18')]?_0x43080a[_0x1469('0x18')][_0x1469('0x1a')]||null:null,'limit':_0x43080a['options']?_0x43080a[_0x1469('0x18')]['limit']||null:null,'order':_0x43080a[_0x1469('0x18')]?_0x43080a[_0x1469('0x18')][_0x1469('0x2e')]||null:null,'transaction':_0xde1efb,'lock':_0xde1efb['LOCK'][_0x1469('0x2f')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x1469('0x30')](_0x2492b8)}]})['then'](function(_0x33d8fd){var _0x5a2f52=[];for(var _0x36d7b2=0x0;_0x36d7b2<_0x33d8fd[_0x1469('0x31')];_0x36d7b2+=0x1){_0x5a2f52[_0x1469('0x32')](_0x33d8fd[_0x36d7b2][_0x1469('0x29')](_0x43080a[_0x1469('0x27')],{'transaction':_0xde1efb}));}return BPromise[_0x1469('0x33')](_0x5a2f52);});})[_0x1469('0x1f')](function(_0x48156b){logger[_0x1469('0xe')](_0x1469('0x2c'),_0x43080a);logger[_0x1469('0x20')]('GetContactDialer',_0x43080a,JSON[_0x1469('0x21')](_0x48156b));_0x3f28e2(_0x48156b);})[_0x1469('0x14')](function(_0x47df2f){logger[_0x1469('0x11')]('GetContactDialer',_0x47df2f[_0x1469('0x13')],_0x43080a);_0x1f8156(_0x4b2ed4[_0x1469('0x11')](0x1f4,_0x47df2f[_0x1469('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x50e5b6){var _0x430387=this;return new Promise(function(_0x3cf292,_0x500e76){return db[_0x1469('0x34')][_0x1469('0x2d')](function(_0x54b1f8){return db[_0x1469('0x35')]['create'](_0x50e5b6[_0x1469('0x27')],{'raw':_0x50e5b6['options']?_0x50e5b6[_0x1469('0x18')][_0x1469('0x19')]===undefined?!![]:![]:!![],'transaction':_0x54b1f8})[_0x1469('0x1f')](function(){return db[_0x1469('0x16')][_0x1469('0x2a')]({'where':_0x50e5b6['options']?_0x50e5b6[_0x1469('0x18')][_0x1469('0x23')]||null:null,'transaction':_0x54b1f8});});})['then'](function(_0x314d12){logger[_0x1469('0xe')](_0x1469('0x36'),_0x50e5b6);logger['debug'](_0x1469('0x36'),_0x50e5b6,JSON[_0x1469('0x21')](_0x314d12));_0x3cf292(_0x314d12);})[_0x1469('0x14')](function(_0xa07f77){logger['error'](_0x1469('0x36'),_0xa07f77['message'],_0x50e5b6);_0x500e76(_0x430387['error'](0x1f4,_0xa07f77[_0x1469('0x13')]));});});};exports['CountReScheduled']=function(_0x4f36cb){var _0x3597e5=this;return new Promise(function(_0x4270f5,_0x51b86e){return db[_0x1469('0x16')][_0x1469('0x17')]({'raw':_0x4f36cb[_0x1469('0x18')]?_0x4f36cb['options'][_0x1469('0x19')]===undefined?!![]:![]:!![],'where':_0x4f36cb[_0x1469('0x18')]?_0x4f36cb[_0x1469('0x18')][_0x1469('0x23')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1469('0x37'),db[_0x1469('0x34')]['fn']('IF',db[_0x1469('0x34')][_0x1469('0x38')](_0x1469('0x39')+util['format'](_0x1469('0x3a'),moment()[_0x1469('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x1469('0x3c')]]})[_0x1469('0x1f')](function(_0x574e43){logger[_0x1469('0xe')](_0x1469('0x3d'),_0x4f36cb);logger[_0x1469('0x20')](_0x1469('0x3d'),_0x4f36cb,JSON['stringify'](_0x574e43));_0x4270f5(_0x574e43);})[_0x1469('0x14')](function(_0x2cdf38){logger[_0x1469('0x11')](_0x1469('0x3d'),_0x2cdf38['message'],_0x4f36cb);_0x51b86e(_0x3597e5[_0x1469('0x11')](0x1f4,_0x2cdf38[_0x1469('0x13')]));});});};exports[_0x1469('0x3e')]=function(_0x4c5674){var _0x5abcea=this;return new Promise(function(_0x2dae87,_0x4fe964){return db['CmContact'][_0x1469('0x3f')]()[_0x1469('0x1f')](function(_0x1b1ba5){return db[_0x1469('0x34')]['transaction'](function(_0xc15931){return db[_0x1469('0x16')][_0x1469('0x17')]({'where':_0x4c5674[_0x1469('0x18')]?_0x4c5674[_0x1469('0x18')][_0x1469('0x23')]||null:null,'attributes':_0x4c5674['options']?_0x4c5674['options'][_0x1469('0x1a')]||null:null,'limit':0x1,'order':_0x4c5674['options']?_0x4c5674[_0x1469('0x18')][_0x1469('0x2e')]||null:null,'group':db[_0x1469('0x16')][_0x1469('0x40')],'transaction':_0xc15931,'lock':_0xc15931[_0x1469('0x41')][_0x1469('0x2f')],'include':_0x4c5674[_0x1469('0x18')]?_0x4c5674[_0x1469('0x18')]['include']?_[_0x1469('0x1c')](_0x4c5674[_0x1469('0x18')][_0x1469('0x1d')],function(_0x4d1875){return{'model':db[_0x4d1875[_0x1469('0x1e')]],'as':_0x4d1875['as'],'attributes':_0x4d1875[_0x1469('0x1a')],'include':_0x4d1875[_0x1469('0x1d')]?_['map'](_0x4d1875['include'],function(_0x6b2dea){return{'model':db[_0x6b2dea[_0x1469('0x1e')]],'as':_0x6b2dea['as'],'attributes':_0x6b2dea['attributes'],'include':_0x6b2dea[_0x1469('0x1d')]?_[_0x1469('0x1c')](_0x6b2dea[_0x1469('0x1d')],function(_0x42f21b){return{'model':db[_0x42f21b[_0x1469('0x1e')]],'as':_0x42f21b['as'],'attributes':_0x42f21b[_0x1469('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1469('0x1f')](function(_0x2fe18e){var _0x2732dd=[];for(var _0x53f68a=0x0;_0x53f68a<_0x2fe18e['length'];_0x53f68a+=0x1){_0x2732dd[_0x1469('0x32')](_0x2fe18e[_0x53f68a][_0x1469('0x29')](_0x4c5674[_0x1469('0x27')],{'transaction':_0xc15931}));}return BPromise[_0x1469('0x33')](_0x2732dd);});})['then'](function(_0x2ac58a){logger[_0x1469('0xe')]('GetContactRecallMe',_0x4c5674);logger[_0x1469('0x20')](_0x1469('0x3e'),_0x4c5674,JSON[_0x1469('0x21')](_0x2ac58a));_0x2dae87(_0x2ac58a);})['catch'](function(_0x214d8b){logger[_0x1469('0x11')](_0x1469('0x3e'),_0x214d8b['message'],_0x4c5674);_0x4fe964(_0x5abcea[_0x1469('0x11')](0x1f4,_0x214d8b[_0x1469('0x13')]));});});});}; \ No newline at end of file +var _0xbe35=['findAll','options','raw','where','limit','include','map','model','attributes','find','ShowCmHopper','catch','CreateCmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','length','push','all','lodash','util','moment','../../mysqldb','../../config/utils','rpc','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCmHopper','CmHopper'];(function(_0xa861aa,_0x2895a4){var _0x1e34de=function(_0x41ed53){while(--_0x41ed53){_0xa861aa['push'](_0xa861aa['shift']());}};_0x1e34de(++_0x2895a4);}(_0xbe35,0xa2));var _0x5be3=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xbe35[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x5be3('0x0'));var util=require(_0x5be3('0x1'));var moment=require(_0x5be3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5be3('0x3'))['db'];var utils=require(_0x5be3('0x4'));var logger=require('../../config/logger')(_0x5be3('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5be3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x785147,_0x1e8209,_0x4d9061){return new BPromise(function(_0x38c96a,_0x7c0014){return client['request'](_0x785147,_0x4d9061)[_0x5be3('0x7')](function(_0x5d9de7){logger[_0x5be3('0x8')](_0x5be3('0x9'),_0x1e8209,_0x5be3('0xa'));logger[_0x5be3('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1e8209,'request\x20sent',JSON[_0x5be3('0xc')](_0x5d9de7));if(_0x5d9de7['error']){if(_0x5d9de7[_0x5be3('0xd')]['code']===0x1f4){logger['error'](_0x5be3('0x9'),_0x1e8209,_0x5d9de7[_0x5be3('0xd')][_0x5be3('0xe')]);return _0x7c0014(_0x5d9de7[_0x5be3('0xd')][_0x5be3('0xe')]);}logger[_0x5be3('0xd')](_0x5be3('0x9'),_0x1e8209,_0x5d9de7[_0x5be3('0xd')][_0x5be3('0xe')]);return _0x38c96a(_0x5d9de7[_0x5be3('0xd')][_0x5be3('0xe')]);}else{logger[_0x5be3('0x8')](_0x5be3('0x9'),_0x1e8209,_0x5be3('0xa'));_0x38c96a(_0x5d9de7[_0x5be3('0xf')][_0x5be3('0xe')]);}})['catch'](function(_0x1c24e5){logger[_0x5be3('0xd')](_0x5be3('0x9'),_0x1e8209,_0x1c24e5);_0x7c0014(_0x1c24e5);});});}exports[_0x5be3('0x10')]=function(_0x4c300c){var _0x2225ec=this;return new Promise(function(_0xd45a30,_0x5bdf82){return db[_0x5be3('0x11')][_0x5be3('0x12')]({'raw':_0x4c300c[_0x5be3('0x13')]?_0x4c300c[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![],'where':_0x4c300c['options']?_0x4c300c[_0x5be3('0x13')][_0x5be3('0x15')]||null:null,'attributes':_0x4c300c[_0x5be3('0x13')]?_0x4c300c[_0x5be3('0x13')]['attributes']||null:null,'limit':_0x4c300c[_0x5be3('0x13')]?_0x4c300c[_0x5be3('0x13')][_0x5be3('0x16')]||null:null,'include':_0x4c300c[_0x5be3('0x13')]?_0x4c300c[_0x5be3('0x13')][_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x4c300c[_0x5be3('0x13')]['include'],function(_0x15e92d){return{'model':db[_0x15e92d[_0x5be3('0x19')]],'as':_0x15e92d['as'],'attributes':_0x15e92d[_0x5be3('0x1a')],'include':_0x15e92d[_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x15e92d[_0x5be3('0x17')],function(_0x17ff00){return{'model':db[_0x17ff00[_0x5be3('0x19')]],'as':_0x17ff00['as'],'attributes':_0x17ff00[_0x5be3('0x1a')],'include':_0x17ff00['include']?_['map'](_0x17ff00['include'],function(_0x561d92){return{'model':db[_0x561d92[_0x5be3('0x19')]],'as':_0x561d92['as'],'attributes':_0x561d92[_0x5be3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5be3('0x7')](function(_0x387f39){logger['info'](_0x5be3('0x10'),_0x4c300c);logger[_0x5be3('0xb')](_0x5be3('0x10'),_0x4c300c,JSON[_0x5be3('0xc')](_0x387f39));_0xd45a30(_0x387f39);})['catch'](function(_0x12b3c2){logger[_0x5be3('0xd')]('GetCmHopper',_0x12b3c2[_0x5be3('0xe')],_0x4c300c);_0x5bdf82(_0x2225ec[_0x5be3('0xd')](0x1f4,_0x12b3c2[_0x5be3('0xe')]));});});};exports['ShowCmHopper']=function(_0x4bbbd4){var _0x4bcb22=this;return new Promise(function(_0x3902f4,_0x5355c1){return db['CmHopper'][_0x5be3('0x1b')]({'raw':_0x4bbbd4[_0x5be3('0x13')]?_0x4bbbd4[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![],'where':_0x4bbbd4[_0x5be3('0x13')]?_0x4bbbd4[_0x5be3('0x13')][_0x5be3('0x15')]||null:null,'attributes':_0x4bbbd4[_0x5be3('0x13')]?_0x4bbbd4['options'][_0x5be3('0x1a')]||null:null,'include':_0x4bbbd4['options']?_0x4bbbd4[_0x5be3('0x13')][_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x4bbbd4[_0x5be3('0x13')]['include'],function(_0x542c75){return{'model':db[_0x542c75[_0x5be3('0x19')]],'as':_0x542c75['as'],'attributes':_0x542c75[_0x5be3('0x1a')],'include':_0x542c75[_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x542c75[_0x5be3('0x17')],function(_0xd150a7){return{'model':db[_0xd150a7[_0x5be3('0x19')]],'as':_0xd150a7['as'],'attributes':_0xd150a7[_0x5be3('0x1a')],'include':_0xd150a7[_0x5be3('0x17')]?_[_0x5be3('0x18')](_0xd150a7[_0x5be3('0x17')],function(_0x14333f){return{'model':db[_0x14333f[_0x5be3('0x19')]],'as':_0x14333f['as'],'attributes':_0x14333f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32d68d){logger[_0x5be3('0x8')]('ShowCmHopper',_0x4bbbd4);logger['debug'](_0x5be3('0x1c'),_0x4bbbd4,JSON[_0x5be3('0xc')](_0x32d68d));_0x3902f4(_0x32d68d);})[_0x5be3('0x1d')](function(_0x50314f){logger[_0x5be3('0xd')](_0x5be3('0x1c'),_0x50314f[_0x5be3('0xe')],_0x4bbbd4);_0x5355c1(_0x4bcb22[_0x5be3('0xd')](0x1f4,_0x50314f[_0x5be3('0xe')]));});});};exports[_0x5be3('0x1e')]=function(_0x4f78b6){var _0x22c596=this;return new Promise(function(_0xddc6dd,_0x5c0605){return db['CmHopper'][_0x5be3('0x1f')](_0x4f78b6['body'],{'raw':_0x4f78b6[_0x5be3('0x13')]?_0x4f78b6[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![]})[_0x5be3('0x7')](function(_0x37b3a2){logger['info'](_0x5be3('0x1e'),_0x4f78b6);logger[_0x5be3('0xb')](_0x5be3('0x1e'),_0x4f78b6,JSON[_0x5be3('0xc')](_0x37b3a2));_0xddc6dd(_0x37b3a2);})[_0x5be3('0x1d')](function(_0x5d3d8d){logger[_0x5be3('0xd')](_0x5be3('0x1e'),_0x5d3d8d[_0x5be3('0xe')],_0x4f78b6);_0x5c0605(_0x22c596['error'](0x1f4,_0x5d3d8d[_0x5be3('0xe')]));});});};exports[_0x5be3('0x20')]=function(_0x572e48){var _0xcae6b0=this;return new Promise(function(_0x35e396,_0x2b5a70){return db[_0x5be3('0x11')][_0x5be3('0x21')](_0x572e48[_0x5be3('0x22')],{'raw':_0x572e48[_0x5be3('0x13')]?_0x572e48[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x572e48['options']?_0x572e48[_0x5be3('0x13')][_0x5be3('0x15')]||null:null,'attributes':_0x572e48[_0x5be3('0x13')]?_0x572e48[_0x5be3('0x13')][_0x5be3('0x1a')]||null:null,'limit':_0x572e48[_0x5be3('0x13')]?_0x572e48[_0x5be3('0x13')][_0x5be3('0x16')]||null:null})[_0x5be3('0x7')](function(_0x278d72){logger[_0x5be3('0x8')](_0x5be3('0x20'),_0x572e48);logger[_0x5be3('0xb')](_0x5be3('0x20'),_0x572e48,JSON[_0x5be3('0xc')](_0x278d72));_0x35e396(_0x278d72);})['catch'](function(_0x295b9b){logger[_0x5be3('0xd')](_0x5be3('0x20'),_0x295b9b[_0x5be3('0xe')],_0x572e48);_0x2b5a70(_0xcae6b0[_0x5be3('0xd')](0x1f4,_0x295b9b[_0x5be3('0xe')]));});});};exports[_0x5be3('0x23')]=function(_0x33ef0d){var _0x3ba2e5=this;return new Promise(function(_0x346763,_0x410508){return db[_0x5be3('0x11')][_0x5be3('0x24')]({'where':_0x33ef0d[_0x5be3('0x13')]?_0x33ef0d['options'][_0x5be3('0x15')]||null:null})[_0x5be3('0x7')](function(_0x540ba1){logger[_0x5be3('0x8')]('DestroyCmHopper',_0x33ef0d);logger[_0x5be3('0xb')](_0x5be3('0x23'),_0x33ef0d,JSON[_0x5be3('0xc')](_0x540ba1));_0x346763(_0x540ba1);})[_0x5be3('0x1d')](function(_0x25269c){logger['error'](_0x5be3('0x23'),_0x25269c[_0x5be3('0xe')],_0x33ef0d);_0x410508(_0x3ba2e5[_0x5be3('0xd')](0x1f4,_0x25269c['message']));});});};exports[_0x5be3('0x25')]=function(_0x4f97dd){var _0x5c41ac=this;return new Promise(function(_0x3e18e4,_0x3146a5){return db[_0x5be3('0x26')][_0x5be3('0x27')]()[_0x5be3('0x7')](function(_0x1fbee0){return db[_0x5be3('0x28')][_0x5be3('0x29')](function(_0x646141){return db[_0x5be3('0x11')][_0x5be3('0x12')]({'where':_0x4f97dd[_0x5be3('0x13')]?_0x4f97dd[_0x5be3('0x13')]['where']||null:null,'attributes':_0x4f97dd[_0x5be3('0x13')]?_0x4f97dd[_0x5be3('0x13')][_0x5be3('0x1a')]||null:null,'limit':_0x4f97dd[_0x5be3('0x13')]?_0x4f97dd[_0x5be3('0x13')][_0x5be3('0x16')]||null:null,'order':_0x4f97dd[_0x5be3('0x13')]?_0x4f97dd[_0x5be3('0x13')][_0x5be3('0x2a')]||null:null,'transaction':_0x646141,'lock':_0x646141[_0x5be3('0x2b')][_0x5be3('0x2c')],'include':[{'model':db[_0x5be3('0x26')],'as':_0x5be3('0x2d'),'attributes':_['keys'](_0x1fbee0)}]})[_0x5be3('0x7')](function(_0x4913e3){var _0x14bf07=[];for(var _0x436929=0x0;_0x436929<_0x4913e3['length'];_0x436929+=0x1){_0x14bf07['push'](_0x4913e3[_0x436929]['update'](_0x4f97dd[_0x5be3('0x22')],{'transaction':_0x646141}));}return BPromise['all'](_0x14bf07);});})[_0x5be3('0x7')](function(_0x1c9d9e){logger['info'](_0x5be3('0x25'),_0x4f97dd);logger['debug'](_0x5be3('0x25'),_0x4f97dd,JSON['stringify'](_0x1c9d9e));_0x3e18e4(_0x1c9d9e);})['catch'](function(_0x2c8363){logger['error'](_0x5be3('0x25'),_0x2c8363['message'],_0x4f97dd);_0x3146a5(_0x5c41ac[_0x5be3('0xd')](0x1f4,_0x2c8363[_0x5be3('0xe')]));});});});};exports[_0x5be3('0x2e')]=function(_0x228bb8){var _0xaca518=this;return new Promise(function(_0x46feb8,_0x39613f){return db[_0x5be3('0x28')][_0x5be3('0x29')](function(_0x250c7e){return db[_0x5be3('0x2f')][_0x5be3('0x1f')](_0x228bb8[_0x5be3('0x22')],{'raw':_0x228bb8[_0x5be3('0x13')]?_0x228bb8[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![],'transaction':_0x250c7e})[_0x5be3('0x7')](function(){return db[_0x5be3('0x11')][_0x5be3('0x24')]({'where':_0x228bb8[_0x5be3('0x13')]?_0x228bb8['options'][_0x5be3('0x15')]||null:null,'transaction':_0x250c7e});});})[_0x5be3('0x7')](function(_0x5ee4e1){logger[_0x5be3('0x8')](_0x5be3('0x2e'),_0x228bb8);logger[_0x5be3('0xb')](_0x5be3('0x2e'),_0x228bb8,JSON[_0x5be3('0xc')](_0x5ee4e1));_0x46feb8(_0x5ee4e1);})['catch'](function(_0xff0db2){logger[_0x5be3('0xd')](_0x5be3('0x2e'),_0xff0db2[_0x5be3('0xe')],_0x228bb8);_0x39613f(_0xaca518['error'](0x1f4,_0xff0db2[_0x5be3('0xe')]));});});};exports[_0x5be3('0x30')]=function(_0xfde6c8){var _0x1c5c21=this;return new Promise(function(_0x452183,_0x5374f8){return db[_0x5be3('0x11')]['findAll']({'raw':_0xfde6c8[_0x5be3('0x13')]?_0xfde6c8[_0x5be3('0x13')][_0x5be3('0x14')]===undefined?!![]:![]:!![],'where':_0xfde6c8[_0x5be3('0x13')]?_0xfde6c8[_0x5be3('0x13')]['where']||null:null,'attributes':[[db[_0x5be3('0x28')]['fn']('COUNT',db[_0x5be3('0x28')]['fn']('IF',db[_0x5be3('0x28')][_0x5be3('0x31')](_0x5be3('0x32')+util['format'](_0x5be3('0x33'),moment()[_0x5be3('0x34')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x5be3('0x35')))),_0x5be3('0x36')]]})[_0x5be3('0x7')](function(_0x327220){logger[_0x5be3('0x8')](_0x5be3('0x30'),_0xfde6c8);logger[_0x5be3('0xb')]('CountReScheduled',_0xfde6c8,JSON[_0x5be3('0xc')](_0x327220));_0x452183(_0x327220);})[_0x5be3('0x1d')](function(_0xf57854){logger[_0x5be3('0xd')](_0x5be3('0x30'),_0xf57854[_0x5be3('0xe')],_0xfde6c8);_0x5374f8(_0x1c5c21[_0x5be3('0xd')](0x1f4,_0xf57854['message']));});});};exports[_0x5be3('0x37')]=function(_0x328b5a){var _0x3d4e8d=this;return new Promise(function(_0x236e9e,_0x3b1946){return db[_0x5be3('0x26')][_0x5be3('0x27')]()['then'](function(_0x173531){return db['sequelize'][_0x5be3('0x29')](function(_0x3ed9f3){return db[_0x5be3('0x11')][_0x5be3('0x12')]({'where':_0x328b5a[_0x5be3('0x13')]?_0x328b5a[_0x5be3('0x13')][_0x5be3('0x15')]||null:null,'attributes':_0x328b5a[_0x5be3('0x13')]?_0x328b5a['options']['attributes']||null:null,'limit':0x1,'order':_0x328b5a[_0x5be3('0x13')]?_0x328b5a[_0x5be3('0x13')]['order']||null:null,'group':db[_0x5be3('0x11')][_0x5be3('0x38')],'transaction':_0x3ed9f3,'lock':_0x3ed9f3[_0x5be3('0x2b')][_0x5be3('0x2c')],'include':_0x328b5a[_0x5be3('0x13')]?_0x328b5a[_0x5be3('0x13')][_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x328b5a[_0x5be3('0x13')]['include'],function(_0x13bc68){return{'model':db[_0x13bc68[_0x5be3('0x19')]],'as':_0x13bc68['as'],'attributes':_0x13bc68[_0x5be3('0x1a')],'include':_0x13bc68['include']?_[_0x5be3('0x18')](_0x13bc68[_0x5be3('0x17')],function(_0x19e519){return{'model':db[_0x19e519[_0x5be3('0x19')]],'as':_0x19e519['as'],'attributes':_0x19e519[_0x5be3('0x1a')],'include':_0x19e519[_0x5be3('0x17')]?_[_0x5be3('0x18')](_0x19e519[_0x5be3('0x17')],function(_0x1e89e3){return{'model':db[_0x1e89e3[_0x5be3('0x19')]],'as':_0x1e89e3['as'],'attributes':_0x1e89e3[_0x5be3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5be3('0x7')](function(_0x31d0a6){var _0x57c68a=[];for(var _0x3e8354=0x0;_0x3e8354<_0x31d0a6[_0x5be3('0x39')];_0x3e8354+=0x1){_0x57c68a[_0x5be3('0x3a')](_0x31d0a6[_0x3e8354]['update'](_0x328b5a[_0x5be3('0x22')],{'transaction':_0x3ed9f3}));}return BPromise[_0x5be3('0x3b')](_0x57c68a);});})['then'](function(_0x32e855){logger[_0x5be3('0x8')](_0x5be3('0x37'),_0x328b5a);logger[_0x5be3('0xb')]('GetContactRecallMe',_0x328b5a,JSON[_0x5be3('0xc')](_0x32e855));_0x236e9e(_0x32e855);})[_0x5be3('0x1d')](function(_0x4c0bc1){logger[_0x5be3('0xd')](_0x5be3('0x37'),_0x4c0bc1[_0x5be3('0xe')],_0x328b5a);_0x3b1946(_0x3d4e8d[_0x5be3('0xd')](0x1f4,_0x4c0bc1[_0x5be3('0xe')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 93834bf..e2956cc 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x3c2ecd,_0x410391){var _0x143530=function(_0x3fd3d0){while(--_0x3fd3d0){_0x3c2ecd['push'](_0x3c2ecd['shift']());}};_0x143530(++_0x410391);}(_0x7a54,0x106));var _0x47a5=function(_0x3e44ba,_0x2e3a2d){_0x3e44ba=_0x3e44ba-0x0;var _0x7cecc9=_0x7a54[_0x3e44ba];return _0x7cecc9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('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 63df15d..324dffa 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 _0x658e=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x3cff81,_0x1e0208){var _0x5d298a=function(_0x4bc39f){while(--_0x4bc39f){_0x3cff81['push'](_0x3cff81['shift']());}};_0x5d298a(++_0x1e0208);}(_0x658e,0x113));var _0xe658=function(_0x1154ce,_0x1b5bf8){_0x1154ce=_0x1154ce-0x0;var _0x57943d=_0x658e[_0x1154ce];return _0x57943d;};'use strict';var moment=require(_0xe658('0x0'));var Sequelize=require(_0xe658('0x1'));module[_0xe658('0x2')]={'phone':{'type':Sequelize[_0xe658('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe658('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xe658('0x4')],'unique':_0xe658('0x5')},'VoiceQueueId':{'type':Sequelize[_0xe658('0x4')],'unique':_0xe658('0x5')}}; \ No newline at end of file +var _0xc5e3=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x72e54,_0x46bc3a){var _0x5d22c6=function(_0x39046a){while(--_0x39046a){_0x72e54['push'](_0x72e54['shift']());}};_0x5d22c6(++_0x46bc3a);}(_0xc5e3,0x18d));var _0x3c5e=function(_0x230247,_0x40853b){_0x230247=_0x230247-0x0;var _0x433d5d=_0xc5e3[_0x230247];return _0x433d5d;};'use strict';var moment=require(_0x3c5e('0x0'));var Sequelize=require(_0x3c5e('0x1'));module[_0x3c5e('0x2')]={'phone':{'type':Sequelize[_0x3c5e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3c5e('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3c5e('0x4')],'unique':_0x3c5e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x3c5e('0x4')],'unique':_0x3c5e('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b7cdda7..fc0f8ab 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 _0x2573=['../../config/utils','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','destroy','error','stack','name','index','CmHopperBlack','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','count','includeAll','findAll','rows','catch','show','rawAttributes','include','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0x2573,0x10a));var _0x3257=function(_0x58f940,_0x1d4e48){_0x58f940=_0x58f940-0x0;var _0x437dda=_0x2573[_0x58f940];return _0x437dda;};'use strict';var pdf=require(_0x3257('0x0'));var emlformat=require(_0x3257('0x1'));var rimraf=require(_0x3257('0x2'));var zipdir=require(_0x3257('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3257('0x4'));var moment=require(_0x3257('0x5'));var BPromise=require(_0x3257('0x6'));var Mustache=require(_0x3257('0x7'));var util=require(_0x3257('0x8'));var path=require(_0x3257('0x9'));var sox=require(_0x3257('0xa'));var csv=require(_0x3257('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3257('0xc'));var squel=require('squel');var crypto=require(_0x3257('0xd'));var jsforce=require(_0x3257('0xe'));var deskjs=require(_0x3257('0xf'));var toCsv=require(_0x3257('0xb'));var querystring=require(_0x3257('0x10'));var Papa=require(_0x3257('0x11'));var Redis=require(_0x3257('0x12'));var authService=require(_0x3257('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3257('0x14'))(_0x3257('0x15'));var utils=require(_0x3257('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55dfe2,_0x91c128){_0x91c128=_0x91c128||0xcc;return function(_0x4f814d){if(_0x4f814d){return _0x55dfe2[_0x3257('0x17')](_0x91c128);}return _0x55dfe2[_0x3257('0x18')](_0x91c128)[_0x3257('0x19')]();};}function respondWithResult(_0x1ab3a3,_0x29d5b6){_0x29d5b6=_0x29d5b6||0xc8;return function(_0x2e35bf){if(_0x2e35bf){return _0x1ab3a3[_0x3257('0x18')](_0x29d5b6)[_0x3257('0x1a')](_0x2e35bf);}};}function respondWithFilteredResult(_0x550a9c,_0x4fbbc0){return function(_0x27fc14){if(_0x27fc14){var _0x41c432=_0x27fc14['count'],_0x300243=_0x4fbbc0[_0x3257('0x1b')],_0x472226=_0x4fbbc0[_0x3257('0x1b')]+_0x4fbbc0[_0x3257('0x1c')],_0x435423;if(_0x472226>=_0x41c432){_0x472226=_0x41c432;_0x435423=0xc8;}else{_0x435423=0xce;}_0x550a9c[_0x3257('0x18')](_0x435423);return _0x550a9c[_0x3257('0x1d')]('Content-Range',_0x300243+'-'+_0x472226+'/'+_0x41c432)['json'](_0x27fc14);}return null;};}function patchUpdates(_0x1012fe){return function(_0x554a7e){try{jsonpatch['apply'](_0x554a7e,_0x1012fe,!![]);}catch(_0x3e5a95){return BPromise[_0x3257('0x1e')](_0x3e5a95);}return _0x554a7e[_0x3257('0x1f')]();};}function saveUpdates(_0x41ccdd,_0x16623f){return function(_0x103f12){if(_0x103f12){return _0x103f12[_0x3257('0x20')](_0x41ccdd)[_0x3257('0x21')](function(_0x34db03){return _0x34db03;});}return null;};}function removeEntity(_0x256cd3,_0x1c5c28){return function(_0x5c49cd){if(_0x5c49cd){return _0x5c49cd[_0x3257('0x22')]()[_0x3257('0x21')](function(){_0x256cd3[_0x3257('0x18')](0xcc)[_0x3257('0x19')]();});}};}function handleEntityNotFound(_0x5a1dce,_0x11e36d){return function(_0x599e58){if(!_0x599e58){_0x5a1dce['sendStatus'](0x194);}return _0x599e58;};}function handleError(_0x2363e4,_0x1557e8){_0x1557e8=_0x1557e8||0x1f4;return function(_0x5c8572){logger[_0x3257('0x23')](_0x5c8572[_0x3257('0x24')]);if(_0x5c8572['name']){delete _0x5c8572[_0x3257('0x25')];}_0x2363e4[_0x3257('0x18')](_0x1557e8)['send'](_0x5c8572);};}exports[_0x3257('0x26')]=function(_0x186502,_0x4f6a82){var _0x29943e={},_0x2d6819={},_0x4b74d6={'count':0x0,'rows':[]};var _0x3e5313=db[_0x3257('0x27')]['rawAttributes'];_0x2d6819[_0x3257('0x28')]=_[_0x3257('0x29')](_0x3e5313);_0x2d6819['query']=_[_0x3257('0x29')](_0x186502[_0x3257('0x2a')]);_0x2d6819[_0x3257('0x2b')]=_[_0x3257('0x2c')](_0x2d6819[_0x3257('0x28')],_0x2d6819[_0x3257('0x2a')]);_0x29943e[_0x3257('0x2d')]=_['intersection'](_0x2d6819[_0x3257('0x28')],qs[_0x3257('0x2e')](_0x186502[_0x3257('0x2a')][_0x3257('0x2e')]));_0x29943e[_0x3257('0x2d')]=_0x29943e[_0x3257('0x2d')][_0x3257('0x2f')]?_0x29943e[_0x3257('0x2d')]:_0x2d6819[_0x3257('0x28')];if(!_0x186502[_0x3257('0x2a')][_0x3257('0x30')](_0x3257('0x31'))){_0x29943e[_0x3257('0x1c')]=qs[_0x3257('0x1c')](_0x186502[_0x3257('0x2a')][_0x3257('0x1c')]);_0x29943e[_0x3257('0x1b')]=qs[_0x3257('0x1b')](_0x186502[_0x3257('0x2a')]['offset']);}_0x29943e[_0x3257('0x32')]=qs[_0x3257('0x33')](_0x186502['query']['sort']);_0x29943e[_0x3257('0x34')]=qs[_0x3257('0x2b')](_[_0x3257('0x35')](_0x186502[_0x3257('0x2a')],_0x2d6819[_0x3257('0x2b')]));if(_0x186502[_0x3257('0x2a')][_0x3257('0x36')]){_0x29943e[_0x3257('0x34')]=_[_0x3257('0x37')](_0x29943e[_0x3257('0x34')],{'$or':_[_0x3257('0x38')](_0x3e5313,function(_0x3451ae){if(_0x3451ae[_0x3257('0x39')]['key']!=='VIRTUAL'){var _0x48f7b1={};_0x48f7b1[_0x3451ae[_0x3257('0x3a')]]={'$like':'%'+_0x186502[_0x3257('0x2a')][_0x3257('0x36')]+'%'};return _0x48f7b1;}})});}_0x29943e=_[_0x3257('0x37')]({},_0x29943e,_0x186502[_0x3257('0x3b')]);var _0x8f153a={'where':_0x29943e[_0x3257('0x34')]};return db[_0x3257('0x27')][_0x3257('0x3c')](_0x8f153a)[_0x3257('0x21')](function(_0x27adeb){_0x4b74d6[_0x3257('0x3c')]=_0x27adeb;if(_0x186502['query'][_0x3257('0x3d')]){_0x29943e['include']=[{'all':!![]}];}return db[_0x3257('0x27')][_0x3257('0x3e')](_0x29943e);})[_0x3257('0x21')](function(_0x48ab12){_0x4b74d6[_0x3257('0x3f')]=_0x48ab12;return _0x4b74d6;})[_0x3257('0x21')](respondWithFilteredResult(_0x4f6a82,_0x29943e))[_0x3257('0x40')](handleError(_0x4f6a82,null));};exports[_0x3257('0x41')]=function(_0xada3e5,_0x182c49){var _0x5340a8={'raw':!![],'where':{'id':_0xada3e5['params']['id']}},_0x594720={};_0x594720[_0x3257('0x28')]=_[_0x3257('0x29')](db[_0x3257('0x27')][_0x3257('0x42')]);_0x594720['query']=_[_0x3257('0x29')](_0xada3e5[_0x3257('0x2a')]);_0x594720[_0x3257('0x2b')]=_[_0x3257('0x2c')](_0x594720[_0x3257('0x28')],_0x594720['query']);_0x5340a8[_0x3257('0x2d')]=_['intersection'](_0x594720[_0x3257('0x28')],qs[_0x3257('0x2e')](_0xada3e5[_0x3257('0x2a')][_0x3257('0x2e')]));_0x5340a8[_0x3257('0x2d')]=_0x5340a8[_0x3257('0x2d')][_0x3257('0x2f')]?_0x5340a8['attributes']:_0x594720[_0x3257('0x28')];if(_0xada3e5['query'][_0x3257('0x3d')]){_0x5340a8[_0x3257('0x43')]=[{'all':!![]}];}_0x5340a8=_[_0x3257('0x37')]({},_0x5340a8,_0xada3e5[_0x3257('0x3b')]);return db[_0x3257('0x27')][_0x3257('0x44')](_0x5340a8)[_0x3257('0x21')](handleEntityNotFound(_0x182c49,null))[_0x3257('0x21')](respondWithResult(_0x182c49,null))[_0x3257('0x40')](handleError(_0x182c49,null));};exports[_0x3257('0x20')]=function(_0x57803e,_0x4f01df){if(_0x57803e['body']['id']){delete _0x57803e[_0x3257('0x45')]['id'];}return db[_0x3257('0x27')][_0x3257('0x44')]({'where':{'id':_0x57803e[_0x3257('0x46')]['id']}})[_0x3257('0x21')](handleEntityNotFound(_0x4f01df,null))[_0x3257('0x21')](saveUpdates(_0x57803e[_0x3257('0x45')],null))['then'](respondWithResult(_0x4f01df,null))['catch'](handleError(_0x4f01df,null));};exports[_0x3257('0x22')]=function(_0x4ced79,_0x4b1e83){return db[_0x3257('0x27')][_0x3257('0x44')]({'where':{'id':_0x4ced79[_0x3257('0x46')]['id']}})[_0x3257('0x21')](handleEntityNotFound(_0x4b1e83,null))[_0x3257('0x21')](removeEntity(_0x4b1e83,null))['catch'](handleError(_0x4b1e83,null));};exports[_0x3257('0x47')]=function(_0x5e88f4,_0x2988f6){return db[_0x3257('0x27')]['describe']()[_0x3257('0x21')](respondWithResult(_0x2988f6,null))['catch'](handleError(_0x2988f6,null));}; \ No newline at end of file +var _0x5fb3=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','index','CmHopperBlack','rawAttributes','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','map','key','VIRTUAL','includeAll','findAll','rows','show','params','length','include','options','find','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fb3,0x1dc));var _0x35fb=function(_0x542b75,_0x18e307){_0x542b75=_0x542b75-0x0;var _0x4dc1c5=_0x5fb3[_0x542b75];return _0x4dc1c5;};'use strict';var pdf=require(_0x35fb('0x0'));var emlformat=require(_0x35fb('0x1'));var rimraf=require(_0x35fb('0x2'));var zipdir=require(_0x35fb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35fb('0x4'));var moment=require(_0x35fb('0x5'));var BPromise=require(_0x35fb('0x6'));var Mustache=require('mustache');var util=require(_0x35fb('0x7'));var path=require(_0x35fb('0x8'));var sox=require('sox');var csv=require(_0x35fb('0x9'));var ejs=require(_0x35fb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x35fb('0xb'));var jsforce=require(_0x35fb('0xc'));var deskjs=require(_0x35fb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x35fb('0xe'));var Papa=require(_0x35fb('0xf'));var Redis=require(_0x35fb('0x10'));var authService=require(_0x35fb('0x11'));var qs=require(_0x35fb('0x12'));var hardwareService=require(_0x35fb('0x13'));var logger=require(_0x35fb('0x14'))('api');var utils=require(_0x35fb('0x15'));var config=require(_0x35fb('0x16'));var db=require(_0x35fb('0x17'))['db'];function respondWithStatusCode(_0xf838e5,_0x77fee2){_0x77fee2=_0x77fee2||0xcc;return function(_0x20dbeb){if(_0x20dbeb){return _0xf838e5[_0x35fb('0x18')](_0x77fee2);}return _0xf838e5[_0x35fb('0x19')](_0x77fee2)[_0x35fb('0x1a')]();};}function respondWithResult(_0x192c97,_0x513d6f){_0x513d6f=_0x513d6f||0xc8;return function(_0x2f9ce5){if(_0x2f9ce5){return _0x192c97[_0x35fb('0x19')](_0x513d6f)[_0x35fb('0x1b')](_0x2f9ce5);}};}function respondWithFilteredResult(_0x4459d7,_0xa21ed0){return function(_0x5dc0f0){if(_0x5dc0f0){var _0x421168=_0x5dc0f0[_0x35fb('0x1c')],_0x30a35c=_0xa21ed0[_0x35fb('0x1d')],_0x25981e=_0xa21ed0[_0x35fb('0x1d')]+_0xa21ed0[_0x35fb('0x1e')],_0x32dd0f;if(_0x25981e>=_0x421168){_0x25981e=_0x421168;_0x32dd0f=0xc8;}else{_0x32dd0f=0xce;}_0x4459d7[_0x35fb('0x19')](_0x32dd0f);return _0x4459d7[_0x35fb('0x1f')]('Content-Range',_0x30a35c+'-'+_0x25981e+'/'+_0x421168)['json'](_0x5dc0f0);}return null;};}function patchUpdates(_0x4d532e){return function(_0x4ea102){try{jsonpatch['apply'](_0x4ea102,_0x4d532e,!![]);}catch(_0x3fa6b3){return BPromise[_0x35fb('0x20')](_0x3fa6b3);}return _0x4ea102[_0x35fb('0x21')]();};}function saveUpdates(_0x3abbef,_0x564ef){return function(_0x320240){if(_0x320240){return _0x320240[_0x35fb('0x22')](_0x3abbef)[_0x35fb('0x23')](function(_0x1e1619){return _0x1e1619;});}return null;};}function removeEntity(_0x534a63,_0xa85472){return function(_0x4e69d6){if(_0x4e69d6){return _0x4e69d6[_0x35fb('0x24')]()[_0x35fb('0x23')](function(){_0x534a63['status'](0xcc)[_0x35fb('0x1a')]();});}};}function handleEntityNotFound(_0x5995c1,_0x34258e){return function(_0x4fc301){if(!_0x4fc301){_0x5995c1['sendStatus'](0x194);}return _0x4fc301;};}function handleError(_0x3fe9d7,_0xa34717){_0xa34717=_0xa34717||0x1f4;return function(_0x46ede9){logger[_0x35fb('0x25')](_0x46ede9[_0x35fb('0x26')]);if(_0x46ede9['name']){delete _0x46ede9[_0x35fb('0x27')];}_0x3fe9d7[_0x35fb('0x19')](_0xa34717)['send'](_0x46ede9);};}exports[_0x35fb('0x28')]=function(_0x5cf046,_0x2900d0){var _0xdc2c47={},_0x1ace4e={},_0x2af264={'count':0x0,'rows':[]};var _0x376e50=db[_0x35fb('0x29')][_0x35fb('0x2a')];_0x1ace4e['model']=_[_0x35fb('0x2b')](_0x376e50);_0x1ace4e['query']=_[_0x35fb('0x2b')](_0x5cf046['query']);_0x1ace4e[_0x35fb('0x2c')]=_[_0x35fb('0x2d')](_0x1ace4e['model'],_0x1ace4e[_0x35fb('0x2e')]);_0xdc2c47[_0x35fb('0x2f')]=_['intersection'](_0x1ace4e[_0x35fb('0x30')],qs['fields'](_0x5cf046[_0x35fb('0x2e')][_0x35fb('0x31')]));_0xdc2c47[_0x35fb('0x2f')]=_0xdc2c47[_0x35fb('0x2f')]['length']?_0xdc2c47[_0x35fb('0x2f')]:_0x1ace4e[_0x35fb('0x30')];if(!_0x5cf046['query'][_0x35fb('0x32')]('nolimit')){_0xdc2c47[_0x35fb('0x1e')]=qs['limit'](_0x5cf046[_0x35fb('0x2e')]['limit']);_0xdc2c47[_0x35fb('0x1d')]=qs[_0x35fb('0x1d')](_0x5cf046[_0x35fb('0x2e')]['offset']);}_0xdc2c47[_0x35fb('0x33')]=qs[_0x35fb('0x34')](_0x5cf046[_0x35fb('0x2e')]['sort']);_0xdc2c47[_0x35fb('0x35')]=qs[_0x35fb('0x2c')](_['pick'](_0x5cf046['query'],_0x1ace4e[_0x35fb('0x2c')]));if(_0x5cf046['query'][_0x35fb('0x36')]){_0xdc2c47[_0x35fb('0x35')]=_[_0x35fb('0x37')](_0xdc2c47[_0x35fb('0x35')],{'$or':_[_0x35fb('0x38')](_0x376e50,function(_0x1e6b3e){if(_0x1e6b3e['type'][_0x35fb('0x39')]!==_0x35fb('0x3a')){var _0x2e0812={};_0x2e0812[_0x1e6b3e['field']]={'$like':'%'+_0x5cf046[_0x35fb('0x2e')]['filter']+'%'};return _0x2e0812;}})});}_0xdc2c47=_[_0x35fb('0x37')]({},_0xdc2c47,_0x5cf046['options']);var _0x11c102={'where':_0xdc2c47[_0x35fb('0x35')]};return db[_0x35fb('0x29')][_0x35fb('0x1c')](_0x11c102)[_0x35fb('0x23')](function(_0x58c6b9){_0x2af264[_0x35fb('0x1c')]=_0x58c6b9;if(_0x5cf046[_0x35fb('0x2e')][_0x35fb('0x3b')]){_0xdc2c47['include']=[{'all':!![]}];}return db[_0x35fb('0x29')][_0x35fb('0x3c')](_0xdc2c47);})['then'](function(_0x1b1297){_0x2af264[_0x35fb('0x3d')]=_0x1b1297;return _0x2af264;})[_0x35fb('0x23')](respondWithFilteredResult(_0x2900d0,_0xdc2c47))['catch'](handleError(_0x2900d0,null));};exports[_0x35fb('0x3e')]=function(_0x424544,_0x2ae128){var _0x31a42f={'raw':!![],'where':{'id':_0x424544[_0x35fb('0x3f')]['id']}},_0x4c4c40={};_0x4c4c40[_0x35fb('0x30')]=_[_0x35fb('0x2b')](db[_0x35fb('0x29')][_0x35fb('0x2a')]);_0x4c4c40[_0x35fb('0x2e')]=_['keys'](_0x424544[_0x35fb('0x2e')]);_0x4c4c40['filters']=_[_0x35fb('0x2d')](_0x4c4c40[_0x35fb('0x30')],_0x4c4c40[_0x35fb('0x2e')]);_0x31a42f[_0x35fb('0x2f')]=_[_0x35fb('0x2d')](_0x4c4c40[_0x35fb('0x30')],qs[_0x35fb('0x31')](_0x424544[_0x35fb('0x2e')][_0x35fb('0x31')]));_0x31a42f[_0x35fb('0x2f')]=_0x31a42f[_0x35fb('0x2f')][_0x35fb('0x40')]?_0x31a42f[_0x35fb('0x2f')]:_0x4c4c40[_0x35fb('0x30')];if(_0x424544['query'][_0x35fb('0x3b')]){_0x31a42f[_0x35fb('0x41')]=[{'all':!![]}];}_0x31a42f=_[_0x35fb('0x37')]({},_0x31a42f,_0x424544[_0x35fb('0x42')]);return db['CmHopperBlack'][_0x35fb('0x43')](_0x31a42f)['then'](handleEntityNotFound(_0x2ae128,null))[_0x35fb('0x23')](respondWithResult(_0x2ae128,null))[_0x35fb('0x44')](handleError(_0x2ae128,null));};exports['update']=function(_0x4c16b3,_0x5be223){if(_0x4c16b3[_0x35fb('0x45')]['id']){delete _0x4c16b3[_0x35fb('0x45')]['id'];}return db[_0x35fb('0x29')][_0x35fb('0x43')]({'where':{'id':_0x4c16b3[_0x35fb('0x3f')]['id']}})[_0x35fb('0x23')](handleEntityNotFound(_0x5be223,null))[_0x35fb('0x23')](saveUpdates(_0x4c16b3[_0x35fb('0x45')],null))[_0x35fb('0x23')](respondWithResult(_0x5be223,null))[_0x35fb('0x44')](handleError(_0x5be223,null));};exports[_0x35fb('0x24')]=function(_0x375562,_0x5e5fb1){return db[_0x35fb('0x29')][_0x35fb('0x43')]({'where':{'id':_0x375562['params']['id']}})[_0x35fb('0x23')](handleEntityNotFound(_0x5e5fb1,null))['then'](removeEntity(_0x5e5fb1,null))[_0x35fb('0x44')](handleError(_0x5e5fb1,null));};exports[_0x35fb('0x46')]=function(_0x2748fc,_0x1c5de2){return db[_0x35fb('0x29')]['describe']()[_0x35fb('0x23')](respondWithResult(_0x1c5de2,null))['catch'](handleError(_0x1c5de2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1574528..6a1a4ae 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 _0xd6d6=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5e5337,_0x118f80){var _0x1fa719=function(_0x56586b){while(--_0x56586b){_0x5e5337['push'](_0x5e5337['shift']());}};_0x1fa719(++_0x118f80);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x450b9a,_0x4c970a){_0x450b9a=_0x450b9a-0x0;var _0x3f9bae=_0xd6d6[_0x450b9a];return _0x3f9bae;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','cm_hopper_black','lodash'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xe14d,0x1ee));var _0xde14=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe14d[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('CmHopperBlack',attributes,{'tableName':_0xde14('0xa'),'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 162daf0..81717cc 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 _0xd3c3=['CmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack'];(function(_0x2117e8,_0x239baf){var _0x5e6fc5=function(_0x305753){while(--_0x305753){_0x2117e8['push'](_0x2117e8['shift']());}};_0x5e6fc5(++_0x239baf);}(_0xd3c3,0x1d8));var _0x3d3c=function(_0x228852,_0x88aa18){_0x228852=_0x228852-0x0;var _0x4868ed=_0xd3c3[_0x228852];return _0x4868ed;};'use strict';var _=require(_0x3d3c('0x0'));var util=require(_0x3d3c('0x1'));var moment=require(_0x3d3c('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d3c('0x3'));var fs=require('fs');var Redis=require(_0x3d3c('0x4'));var db=require(_0x3d3c('0x5'))['db'];var utils=require(_0x3d3c('0x6'));var logger=require(_0x3d3c('0x7'))(_0x3d3c('0x8'));var config=require(_0x3d3c('0x9'));var jayson=require(_0x3d3c('0xa'));var client=jayson[_0x3d3c('0xb')][_0x3d3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ac9c9,_0x20f663,_0x230ab1){return new BPromise(function(_0x9a2860,_0x4b8a85){return client[_0x3d3c('0xd')](_0x3ac9c9,_0x230ab1)[_0x3d3c('0xe')](function(_0x12e766){logger[_0x3d3c('0xf')](_0x3d3c('0x10'),_0x20f663,_0x3d3c('0x11'));logger[_0x3d3c('0x12')](_0x3d3c('0x13'),_0x20f663,_0x3d3c('0x11'),JSON[_0x3d3c('0x14')](_0x12e766));if(_0x12e766[_0x3d3c('0x15')]){if(_0x12e766[_0x3d3c('0x15')][_0x3d3c('0x16')]===0x1f4){logger[_0x3d3c('0x15')](_0x3d3c('0x10'),_0x20f663,_0x12e766[_0x3d3c('0x15')]['message']);return _0x4b8a85(_0x12e766[_0x3d3c('0x15')]['message']);}logger['error'](_0x3d3c('0x10'),_0x20f663,_0x12e766[_0x3d3c('0x15')][_0x3d3c('0x17')]);return _0x9a2860(_0x12e766['error']['message']);}else{logger['info'](_0x3d3c('0x10'),_0x20f663,_0x3d3c('0x11'));_0x9a2860(_0x12e766['result']['message']);}})[_0x3d3c('0x18')](function(_0x156d73){logger[_0x3d3c('0x15')]('CmHopperBlack,\x20%s,\x20%s',_0x20f663,_0x156d73);_0x4b8a85(_0x156d73);});});}exports[_0x3d3c('0x19')]=function(_0x511833){var _0x54c75f=this;return new Promise(function(_0x10b0a4,_0x14db52){return db['CmHopperBlack']['findAll']({'raw':_0x511833[_0x3d3c('0x1a')]?_0x511833[_0x3d3c('0x1a')][_0x3d3c('0x1b')]===undefined?!![]:![]:!![],'where':_0x511833['options']?_0x511833[_0x3d3c('0x1a')][_0x3d3c('0x1c')]||null:null,'attributes':_0x511833[_0x3d3c('0x1a')]?_0x511833['options'][_0x3d3c('0x1d')]||null:null,'limit':_0x511833[_0x3d3c('0x1a')]?_0x511833[_0x3d3c('0x1a')][_0x3d3c('0x1e')]||null:null,'include':_0x511833[_0x3d3c('0x1a')]?_0x511833[_0x3d3c('0x1a')][_0x3d3c('0x1f')]?_['map'](_0x511833[_0x3d3c('0x1a')][_0x3d3c('0x1f')],function(_0x1918af){return{'model':db[_0x1918af['model']],'as':_0x1918af['as'],'attributes':_0x1918af[_0x3d3c('0x1d')],'include':_0x1918af[_0x3d3c('0x1f')]?_[_0x3d3c('0x20')](_0x1918af[_0x3d3c('0x1f')],function(_0x375724){return{'model':db[_0x375724[_0x3d3c('0x21')]],'as':_0x375724['as'],'attributes':_0x375724[_0x3d3c('0x1d')],'include':_0x375724[_0x3d3c('0x1f')]?_[_0x3d3c('0x20')](_0x375724[_0x3d3c('0x1f')],function(_0x55da5c){return{'model':db[_0x55da5c['model']],'as':_0x55da5c['as'],'attributes':_0x55da5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d3c('0xe')](function(_0x9ec3aa){logger[_0x3d3c('0xf')](_0x3d3c('0x19'),_0x511833);logger[_0x3d3c('0x12')](_0x3d3c('0x19'),_0x511833,JSON[_0x3d3c('0x14')](_0x9ec3aa));_0x10b0a4(_0x9ec3aa);})[_0x3d3c('0x18')](function(_0x128dcd){logger[_0x3d3c('0x15')]('GetCmHopperBlack',_0x128dcd[_0x3d3c('0x17')],_0x511833);_0x14db52(_0x54c75f[_0x3d3c('0x15')](0x1f4,_0x128dcd[_0x3d3c('0x17')]));});});};exports[_0x3d3c('0x22')]=function(_0x3364a7){var _0x9c7c3c=this;return new Promise(function(_0x20a72f,_0x1bc31d){return db[_0x3d3c('0x23')][_0x3d3c('0x24')](_0x3364a7['body'],{'raw':_0x3364a7[_0x3d3c('0x1a')]?_0x3364a7[_0x3d3c('0x1a')][_0x3d3c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3364a7['options']?_0x3364a7['options'][_0x3d3c('0x1c')]||null:null,'attributes':_0x3364a7['options']?_0x3364a7['options']['attributes']||null:null,'limit':_0x3364a7[_0x3d3c('0x1a')]?_0x3364a7[_0x3d3c('0x1a')][_0x3d3c('0x1e')]||null:null})[_0x3d3c('0xe')](function(_0x248a43){logger['info']('UpdateCmHopperBlack',_0x3364a7);logger[_0x3d3c('0x12')](_0x3d3c('0x22'),_0x3364a7,JSON[_0x3d3c('0x14')](_0x248a43));_0x20a72f(_0x248a43);})[_0x3d3c('0x18')](function(_0x512d60){logger[_0x3d3c('0x15')](_0x3d3c('0x22'),_0x512d60[_0x3d3c('0x17')],_0x3364a7);_0x1bc31d(_0x9c7c3c['error'](0x1f4,_0x512d60[_0x3d3c('0x17')]));});});};exports[_0x3d3c('0x25')]=function(_0x38740f){var _0x1ecbb8=this;return new Promise(function(_0xd26076,_0x121fcc){return db[_0x3d3c('0x23')][_0x3d3c('0x26')]({'where':_0x38740f['options']?_0x38740f[_0x3d3c('0x1a')][_0x3d3c('0x1c')]||null:null})['then'](function(_0x30528d){logger['info']('DestroyCmHopperBlack',_0x38740f);logger[_0x3d3c('0x12')](_0x3d3c('0x25'),_0x38740f,JSON['stringify'](_0x30528d));_0xd26076(_0x30528d);})[_0x3d3c('0x18')](function(_0x1f282c){logger[_0x3d3c('0x15')](_0x3d3c('0x25'),_0x1f282c[_0x3d3c('0x17')],_0x38740f);_0x121fcc(_0x1ecbb8['error'](0x1f4,_0x1f282c['message']));});});}; \ No newline at end of file +var _0x1a97=['attributes','then','GetCmHopperBlack','stringify','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperBlack','options','raw','where','limit','map','include','model'];(function(_0x4e8312,_0x4d33d1){var _0x26a227=function(_0x345fdf){while(--_0x345fdf){_0x4e8312['push'](_0x4e8312['shift']());}};_0x26a227(++_0x4d33d1);}(_0x1a97,0x1ac));var _0x71a9=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0x1a97[_0x20aadb];return _0x520018;};'use strict';var _=require('lodash');var util=require(_0x71a9('0x0'));var moment=require(_0x71a9('0x1'));var BPromise=require(_0x71a9('0x2'));var rs=require(_0x71a9('0x3'));var fs=require('fs');var Redis=require(_0x71a9('0x4'));var db=require(_0x71a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x71a9('0x6'))(_0x71a9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71a9('0x8')][_0x71a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dcfd8,_0x452826,_0x59b0cb){return new BPromise(function(_0x237b11,_0x3d9ca6){return client[_0x71a9('0xa')](_0x4dcfd8,_0x59b0cb)['then'](function(_0xc9af3e){logger[_0x71a9('0xb')](_0x71a9('0xc'),_0x452826,_0x71a9('0xd'));logger[_0x71a9('0xe')](_0x71a9('0xf'),_0x452826,_0x71a9('0xd'),JSON['stringify'](_0xc9af3e));if(_0xc9af3e[_0x71a9('0x10')]){if(_0xc9af3e[_0x71a9('0x10')]['code']===0x1f4){logger['error'](_0x71a9('0xc'),_0x452826,_0xc9af3e[_0x71a9('0x10')][_0x71a9('0x11')]);return _0x3d9ca6(_0xc9af3e[_0x71a9('0x10')][_0x71a9('0x11')]);}logger['error'](_0x71a9('0xc'),_0x452826,_0xc9af3e[_0x71a9('0x10')][_0x71a9('0x11')]);return _0x237b11(_0xc9af3e[_0x71a9('0x10')][_0x71a9('0x11')]);}else{logger[_0x71a9('0xb')](_0x71a9('0xc'),_0x452826,_0x71a9('0xd'));_0x237b11(_0xc9af3e['result'][_0x71a9('0x11')]);}})[_0x71a9('0x12')](function(_0x1d06a3){logger[_0x71a9('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x452826,_0x1d06a3);_0x3d9ca6(_0x1d06a3);});});}exports['GetCmHopperBlack']=function(_0x53b374){var _0x2f0e64=this;return new Promise(function(_0x221ef0,_0x31c1f5){return db[_0x71a9('0x13')]['findAll']({'raw':_0x53b374[_0x71a9('0x14')]?_0x53b374[_0x71a9('0x14')][_0x71a9('0x15')]===undefined?!![]:![]:!![],'where':_0x53b374[_0x71a9('0x14')]?_0x53b374['options'][_0x71a9('0x16')]||null:null,'attributes':_0x53b374[_0x71a9('0x14')]?_0x53b374[_0x71a9('0x14')]['attributes']||null:null,'limit':_0x53b374[_0x71a9('0x14')]?_0x53b374[_0x71a9('0x14')][_0x71a9('0x17')]||null:null,'include':_0x53b374[_0x71a9('0x14')]?_0x53b374[_0x71a9('0x14')]['include']?_[_0x71a9('0x18')](_0x53b374['options'][_0x71a9('0x19')],function(_0x393c99){return{'model':db[_0x393c99[_0x71a9('0x1a')]],'as':_0x393c99['as'],'attributes':_0x393c99[_0x71a9('0x1b')],'include':_0x393c99[_0x71a9('0x19')]?_[_0x71a9('0x18')](_0x393c99[_0x71a9('0x19')],function(_0x5d1100){return{'model':db[_0x5d1100[_0x71a9('0x1a')]],'as':_0x5d1100['as'],'attributes':_0x5d1100[_0x71a9('0x1b')],'include':_0x5d1100['include']?_['map'](_0x5d1100[_0x71a9('0x19')],function(_0x72f9b3){return{'model':db[_0x72f9b3[_0x71a9('0x1a')]],'as':_0x72f9b3['as'],'attributes':_0x72f9b3['attributes']};}):[]};}):[]};}):[]:[]})[_0x71a9('0x1c')](function(_0x1ee764){logger['info'](_0x71a9('0x1d'),_0x53b374);logger[_0x71a9('0xe')](_0x71a9('0x1d'),_0x53b374,JSON[_0x71a9('0x1e')](_0x1ee764));_0x221ef0(_0x1ee764);})['catch'](function(_0x41690f){logger[_0x71a9('0x10')]('GetCmHopperBlack',_0x41690f[_0x71a9('0x11')],_0x53b374);_0x31c1f5(_0x2f0e64['error'](0x1f4,_0x41690f[_0x71a9('0x11')]));});});};exports[_0x71a9('0x1f')]=function(_0x39d11c){var _0x16fd5a=this;return new Promise(function(_0x564755,_0x2d9871){return db[_0x71a9('0x13')]['update'](_0x39d11c[_0x71a9('0x20')],{'raw':_0x39d11c[_0x71a9('0x14')]?_0x39d11c['options'][_0x71a9('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39d11c[_0x71a9('0x14')]?_0x39d11c[_0x71a9('0x14')][_0x71a9('0x16')]||null:null,'attributes':_0x39d11c[_0x71a9('0x14')]?_0x39d11c[_0x71a9('0x14')]['attributes']||null:null,'limit':_0x39d11c['options']?_0x39d11c[_0x71a9('0x14')]['limit']||null:null})['then'](function(_0x3889d4){logger[_0x71a9('0xb')]('UpdateCmHopperBlack',_0x39d11c);logger['debug'](_0x71a9('0x1f'),_0x39d11c,JSON[_0x71a9('0x1e')](_0x3889d4));_0x564755(_0x3889d4);})['catch'](function(_0x25aeaa){logger['error'](_0x71a9('0x1f'),_0x25aeaa[_0x71a9('0x11')],_0x39d11c);_0x2d9871(_0x16fd5a[_0x71a9('0x10')](0x1f4,_0x25aeaa[_0x71a9('0x11')]));});});};exports[_0x71a9('0x21')]=function(_0x250a65){var _0x9d37a5=this;return new Promise(function(_0x23e82d,_0x644952){return db[_0x71a9('0x13')][_0x71a9('0x22')]({'where':_0x250a65['options']?_0x250a65[_0x71a9('0x14')][_0x71a9('0x16')]||null:null})[_0x71a9('0x1c')](function(_0x453ad7){logger['info'](_0x71a9('0x21'),_0x250a65);logger['debug'](_0x71a9('0x21'),_0x250a65,JSON[_0x71a9('0x1e')](_0x453ad7));_0x23e82d(_0x453ad7);})[_0x71a9('0x12')](function(_0x2e8745){logger[_0x71a9('0x10')](_0x71a9('0x21'),_0x2e8745[_0x71a9('0x11')],_0x250a65);_0x644952(_0x9d37a5[_0x71a9('0x10')](0x1f4,_0x2e8745[_0x71a9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d308aa9..3b25748 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 _0x57d4=['show','put','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe'];(function(_0x4336a6,_0xc235ca){var _0x4012f3=function(_0x1acacf){while(--_0x1acacf){_0x4336a6['push'](_0x4336a6['shift']());}};_0x4012f3(++_0xc235ca);}(_0x57d4,0x78));var _0x457d=function(_0x512157,_0x362976){_0x512157=_0x512157-0x0;var _0x42a90a=_0x57d4[_0x512157];return _0x42a90a;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var auth=require(_0x457d('0x5'));var interaction=require(_0x457d('0x6'));var config=require(_0x457d('0x7'));var controller=require(_0x457d('0x8'));router[_0x457d('0x9')]('/',auth[_0x457d('0xa')](),controller[_0x457d('0xb')]);router[_0x457d('0x9')]('/describe',auth[_0x457d('0xa')](),controller[_0x457d('0xc')]);router['get']('/:id',auth[_0x457d('0xa')](),controller[_0x457d('0xd')]);router[_0x457d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x457d('0xf')](_0x457d('0x10'),auth[_0x457d('0xa')](),controller[_0x457d('0x11')]);module[_0x457d('0x12')]=router; \ No newline at end of file +var _0x4756=['put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','index','get','/describe','describe','show'];(function(_0x450405,_0x2828c7){var _0x2246b6=function(_0x215d3f){while(--_0x215d3f){_0x450405['push'](_0x450405['shift']());}};_0x2246b6(++_0x2828c7);}(_0x4756,0xa6));var _0x6475=function(_0x413fd7,_0x534f15){_0x413fd7=_0x413fd7-0x0;var _0x57d26b=_0x4756[_0x413fd7];return _0x57d26b;};'use strict';var multer=require(_0x6475('0x0'));var util=require(_0x6475('0x1'));var path=require(_0x6475('0x2'));var timeout=require(_0x6475('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6475('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6475('0x5')]);router[_0x6475('0x6')](_0x6475('0x7'),auth['isAuthenticated'](),controller[_0x6475('0x8')]);router[_0x6475('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x6475('0x9')]);router[_0x6475('0xa')](_0x6475('0xb'),auth[_0x6475('0xc')](),controller[_0x6475('0xd')]);router[_0x6475('0xe')](_0x6475('0xb'),auth[_0x6475('0xc')](),controller['destroy']);module[_0x6475('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index afa1e4c..67d2139 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 _0xa196=['endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x10ad5c,_0x5cd5eb){var _0x2a0d9c=function(_0x280bce){while(--_0x280bce){_0x10ad5c['push'](_0x10ad5c['shift']());}};_0x2a0d9c(++_0x5cd5eb);}(_0xa196,0x111));var _0x6a19=function(_0xc3b181,_0x66e0c8){_0xc3b181=_0xc3b181-0x0;var _0x3b3289=_0xa196[_0xc3b181];return _0x3b3289;};'use strict';var Sequelize=require(_0x6a19('0x0'));var moment=require(_0x6a19('0x1'));module[_0x6a19('0x2')]={'state':{'type':Sequelize[_0x6a19('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x6a19('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6a19('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6a19('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6a19('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x6a19('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6a19('0x4')]},'starttime':{'type':Sequelize[_0x6a19('0x5')]},'responsetime':{'type':Sequelize[_0x6a19('0x5')]},'answertime':{'type':Sequelize[_0x6a19('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6a19('0x5')]},'ringtime':{'type':Sequelize[_0x6a19('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6a19('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6a19('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6a19('0x4')]},'campaign':{'type':Sequelize[_0x6a19('0x4')]},'campaigntype':{'type':Sequelize[_0x6a19('0x4')]},'membername':{'type':Sequelize[_0x6a19('0x4')]},'reason':{'type':Sequelize[_0x6a19('0x4')]},'disposition':{'type':Sequelize[_0x6a19('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xc438b9){var _0x4793bb=this[_0x6a19('0x6')](_0x6a19('0x7'));if(_0x4793bb&&_0xc438b9){this[_0x6a19('0x8')](_0x6a19('0x9'),moment(_0xc438b9)[_0x6a19('0xa')](moment(_0x4793bb),_0x6a19('0xb')));}return this[_0x6a19('0x8')](_0x6a19('0xc'),_0xc438b9);}},'amd':{'type':Sequelize[_0x6a19('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6a19('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6a19('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6a19('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6a19('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6a19('0x5')]},'deleted':{'type':Sequelize[_0x6a19('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6a19('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6a19('0x5')]}}; \ No newline at end of file +var _0xbb98=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','followuptime','diff','seconds','setDataValue'];(function(_0x19e146,_0x5ee698){var _0x52178e=function(_0x2c0c0b){while(--_0x2c0c0b){_0x19e146['push'](_0x19e146['shift']());}};_0x52178e(++_0x5ee698);}(_0xbb98,0x169));var _0x8bb9=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0xbb98[_0x20cf8a];return _0x54e165;};'use strict';var Sequelize=require(_0x8bb9('0x0'));var moment=require(_0x8bb9('0x1'));module[_0x8bb9('0x2')]={'state':{'type':Sequelize[_0x8bb9('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8bb9('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8bb9('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8bb9('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8bb9('0x4')]},'calleridnum':{'type':Sequelize[_0x8bb9('0x4')]},'calleridname':{'type':Sequelize[_0x8bb9('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8bb9('0x5')]},'answertime':{'type':Sequelize[_0x8bb9('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8bb9('0x5')]},'ringtime':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8bb9('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8bb9('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x8bb9('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8bb9('0x4')]},'disposition':{'type':Sequelize[_0x8bb9('0x4')]},'dispositionat':{'type':Sequelize[_0x8bb9('0x5')],'set':function(_0x33ee55){var _0xf68bca=this[_0x8bb9('0x6')]('endtime');if(_0xf68bca&&_0x33ee55){this['setDataValue'](_0x8bb9('0x7'),moment(_0x33ee55)[_0x8bb9('0x8')](moment(_0xf68bca),_0x8bb9('0x9')));}return this[_0x8bb9('0xa')]('dispositionat',_0x33ee55);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8bb9('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8bb9('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8bb9('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8bb9('0x5')]},'callback':{'type':Sequelize[_0x8bb9('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8bb9('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8bb9('0x5')]},'recallme':{'type':Sequelize[_0x8bb9('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8bb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 81af0ba..df66197 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 _0x1aa6=['key','VIRTUAL','field','merge','options','count','findAll','rows','catch','show','params','includeAll','include','find','describe','update','uniqueid','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','body','CampaignId\x20=\x20?','state\x20=\x204','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','apply','reject','then','end','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','map'];(function(_0x5185f6,_0x523708){var _0x204173=function(_0x68a0b1){while(--_0x68a0b1){_0x5185f6['push'](_0x5185f6['shift']());}};_0x204173(++_0x523708);}(_0x1aa6,0xcb));var _0x61aa=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x1aa6[_0x255d5b];return _0x3e141a;};'use strict';var pdf=require(_0x61aa('0x0'));var emlformat=require(_0x61aa('0x1'));var rimraf=require(_0x61aa('0x2'));var zipdir=require(_0x61aa('0x3'));var jsonpatch=require(_0x61aa('0x4'));var rp=require(_0x61aa('0x5'));var moment=require(_0x61aa('0x6'));var BPromise=require(_0x61aa('0x7'));var Mustache=require(_0x61aa('0x8'));var util=require(_0x61aa('0x9'));var path=require(_0x61aa('0xa'));var sox=require(_0x61aa('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x61aa('0xc'));var squel=require('squel');var crypto=require(_0x61aa('0xd'));var jsforce=require(_0x61aa('0xe'));var deskjs=require(_0x61aa('0xf'));var toCsv=require(_0x61aa('0x10'));var querystring=require(_0x61aa('0x11'));var Papa=require('papaparse');var Redis=require(_0x61aa('0x12'));var authService=require(_0x61aa('0x13'));var qs=require(_0x61aa('0x14'));var hardwareService=require(_0x61aa('0x15'));var logger=require('../../config/logger')(_0x61aa('0x16'));var utils=require(_0x61aa('0x17'));var config=require(_0x61aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d0969,_0x53d829){_0x53d829=_0x53d829||0xcc;return function(_0x30761a){if(_0x30761a){return _0x3d0969[_0x61aa('0x19')](_0x53d829);}return _0x3d0969['status'](_0x53d829)['end']();};}function respondWithResult(_0x250b3c,_0xf13949){_0xf13949=_0xf13949||0xc8;return function(_0x40716b){if(_0x40716b){return _0x250b3c[_0x61aa('0x1a')](_0xf13949)[_0x61aa('0x1b')](_0x40716b);}};}function respondWithFilteredResult(_0x10bbb3,_0x3613a2){return function(_0x5950f4){if(_0x5950f4){var _0x53ca18=_0x5950f4['count'],_0x2d98ca=_0x3613a2[_0x61aa('0x1c')],_0x576bc8=_0x3613a2[_0x61aa('0x1c')]+_0x3613a2['limit'],_0x2f0a79;if(_0x576bc8>=_0x53ca18){_0x576bc8=_0x53ca18;_0x2f0a79=0xc8;}else{_0x2f0a79=0xce;}_0x10bbb3[_0x61aa('0x1a')](_0x2f0a79);return _0x10bbb3['set']('Content-Range',_0x2d98ca+'-'+_0x576bc8+'/'+_0x53ca18)['json'](_0x5950f4);}return null;};}function patchUpdates(_0x49f78d){return function(_0x4f6252){try{jsonpatch[_0x61aa('0x1d')](_0x4f6252,_0x49f78d,!![]);}catch(_0x2dd08c){return BPromise[_0x61aa('0x1e')](_0x2dd08c);}return _0x4f6252['save']();};}function saveUpdates(_0x83adc6,_0x48e367){return function(_0x2a02bb){if(_0x2a02bb){return _0x2a02bb['update'](_0x83adc6)[_0x61aa('0x1f')](function(_0x6893d2){return _0x6893d2;});}return null;};}function removeEntity(_0xfe49bf,_0x189c4a){return function(_0x20600b){if(_0x20600b){return _0x20600b['destroy']()['then'](function(){_0xfe49bf[_0x61aa('0x1a')](0xcc)[_0x61aa('0x20')]();});}};}function handleEntityNotFound(_0x5d4ec0,_0x300c8f){return function(_0x3dccb3){if(!_0x3dccb3){_0x5d4ec0[_0x61aa('0x19')](0x194);}return _0x3dccb3;};}function handleError(_0x5d0fb,_0x20c5bb){_0x20c5bb=_0x20c5bb||0x1f4;return function(_0x12b9a7){logger['error'](_0x12b9a7[_0x61aa('0x21')]);if(_0x12b9a7[_0x61aa('0x22')]){delete _0x12b9a7['name'];}_0x5d0fb[_0x61aa('0x1a')](_0x20c5bb)[_0x61aa('0x23')](_0x12b9a7);};}exports[_0x61aa('0x24')]=function(_0x332d1b,_0x2a30ad){var _0x4d7827={},_0x7609f0={},_0x2b6a07={'count':0x0,'rows':[]};var _0x3009b9=db[_0x61aa('0x25')][_0x61aa('0x26')];_0x7609f0[_0x61aa('0x27')]=_[_0x61aa('0x28')](_0x3009b9);_0x7609f0['query']=_[_0x61aa('0x28')](_0x332d1b[_0x61aa('0x29')]);_0x7609f0[_0x61aa('0x2a')]=_[_0x61aa('0x2b')](_0x7609f0[_0x61aa('0x27')],_0x7609f0[_0x61aa('0x29')]);_0x4d7827['attributes']=_[_0x61aa('0x2b')](_0x7609f0[_0x61aa('0x27')],qs[_0x61aa('0x2c')](_0x332d1b['query'][_0x61aa('0x2c')]));_0x4d7827['attributes']=_0x4d7827[_0x61aa('0x2d')][_0x61aa('0x2e')]?_0x4d7827[_0x61aa('0x2d')]:_0x7609f0[_0x61aa('0x27')];if(!_0x332d1b[_0x61aa('0x29')]['hasOwnProperty'](_0x61aa('0x2f'))){_0x4d7827[_0x61aa('0x30')]=qs[_0x61aa('0x30')](_0x332d1b[_0x61aa('0x29')][_0x61aa('0x30')]);_0x4d7827[_0x61aa('0x1c')]=qs[_0x61aa('0x1c')](_0x332d1b[_0x61aa('0x29')]['offset']);}_0x4d7827[_0x61aa('0x31')]=qs[_0x61aa('0x32')](_0x332d1b[_0x61aa('0x29')][_0x61aa('0x32')]);_0x4d7827[_0x61aa('0x33')]=qs[_0x61aa('0x2a')](_[_0x61aa('0x34')](_0x332d1b[_0x61aa('0x29')],_0x7609f0[_0x61aa('0x2a')]));if(_0x332d1b[_0x61aa('0x29')][_0x61aa('0x35')]){_0x4d7827[_0x61aa('0x33')]=_['merge'](_0x4d7827['where'],{'$or':_[_0x61aa('0x36')](_0x3009b9,function(_0xd307){if(_0xd307['type'][_0x61aa('0x37')]!==_0x61aa('0x38')){var _0x21d32a={};_0x21d32a[_0xd307[_0x61aa('0x39')]]={'$like':'%'+_0x332d1b[_0x61aa('0x29')][_0x61aa('0x35')]+'%'};return _0x21d32a;}})});}_0x4d7827=_[_0x61aa('0x3a')]({},_0x4d7827,_0x332d1b[_0x61aa('0x3b')]);var _0x45cb7d={'where':_0x4d7827[_0x61aa('0x33')]};return db[_0x61aa('0x25')][_0x61aa('0x3c')](_0x45cb7d)['then'](function(_0x454cfd){_0x2b6a07[_0x61aa('0x3c')]=_0x454cfd;if(_0x332d1b[_0x61aa('0x29')]['includeAll']){_0x4d7827['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x61aa('0x3d')](_0x4d7827);})[_0x61aa('0x1f')](function(_0x1f9dc9){_0x2b6a07[_0x61aa('0x3e')]=_0x1f9dc9;return _0x2b6a07;})['then'](respondWithFilteredResult(_0x2a30ad,_0x4d7827))[_0x61aa('0x3f')](handleError(_0x2a30ad,null));};exports[_0x61aa('0x40')]=function(_0x5106a4,_0x13f80b){var _0x310225={'raw':!![],'where':{'id':_0x5106a4[_0x61aa('0x41')]['id']}},_0x1c0328={};_0x1c0328[_0x61aa('0x27')]=_[_0x61aa('0x28')](db[_0x61aa('0x25')][_0x61aa('0x26')]);_0x1c0328[_0x61aa('0x29')]=_[_0x61aa('0x28')](_0x5106a4[_0x61aa('0x29')]);_0x1c0328['filters']=_[_0x61aa('0x2b')](_0x1c0328[_0x61aa('0x27')],_0x1c0328[_0x61aa('0x29')]);_0x310225[_0x61aa('0x2d')]=_['intersection'](_0x1c0328[_0x61aa('0x27')],qs[_0x61aa('0x2c')](_0x5106a4[_0x61aa('0x29')]['fields']));_0x310225[_0x61aa('0x2d')]=_0x310225['attributes'][_0x61aa('0x2e')]?_0x310225[_0x61aa('0x2d')]:_0x1c0328[_0x61aa('0x27')];if(_0x5106a4[_0x61aa('0x29')][_0x61aa('0x42')]){_0x310225[_0x61aa('0x43')]=[{'all':!![]}];}_0x310225=_[_0x61aa('0x3a')]({},_0x310225,_0x5106a4[_0x61aa('0x3b')]);return db[_0x61aa('0x25')][_0x61aa('0x44')](_0x310225)[_0x61aa('0x1f')](handleEntityNotFound(_0x13f80b,null))[_0x61aa('0x1f')](respondWithResult(_0x13f80b,null))[_0x61aa('0x3f')](handleError(_0x13f80b,null));};exports[_0x61aa('0x45')]=function(_0x25cbea,_0x56b035){return db['CmHopperFinal'][_0x61aa('0x45')]()[_0x61aa('0x1f')](respondWithResult(_0x56b035,null))['catch'](handleError(_0x56b035,null));};exports[_0x61aa('0x46')]=function(_0x554603,_0x4ef50c){if(_0x554603['body']['uniqueid']){delete _0x554603['body'][_0x61aa('0x47')];}return db['CmHopperFinal'][_0x61aa('0x44')]({'where':{'uniqueid':_0x554603[_0x61aa('0x41')]['id']}})[_0x61aa('0x1f')](handleEntityNotFound(_0x4ef50c,null))[_0x61aa('0x1f')](saveUpdates(_0x554603['body'],null))[_0x61aa('0x1f')](respondWithResult(_0x4ef50c,null))[_0x61aa('0x3f')](handleError(_0x4ef50c,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x2c49d3,_0x33e2fc,_0x474ddb){return db['CmHopperFinal'][_0x61aa('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x2c49d3[_0x61aa('0x41')]['id']},'attributes':[[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')](_0x61aa('0x4b')))),_0x61aa('0x4c')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x61aa('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x61aa('0x48')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x61aa('0x4d')],[db[_0x61aa('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')](_0x61aa('0x4e')))),_0x61aa('0x4f')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db['sequelize']['fn']('IF',db[_0x61aa('0x48')]['literal'](_0x61aa('0x50')))),_0x61aa('0x51')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x61aa('0x52')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db['sequelize']['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')](_0x61aa('0x53')))),'reCallContacts'],[db['sequelize']['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')]['literal'](_0x61aa('0x54')))),_0x61aa('0x55')]]})[_0x61aa('0x1f')](handleEntityNotFound(_0x33e2fc,null))[_0x61aa('0x1f')](respondWithResult(_0x33e2fc,null))['catch'](handleError(_0x33e2fc,null));};exports[_0x61aa('0x56')]=function(_0x105b2a,_0x385d0b,_0x35e037){return db[_0x61aa('0x25')][_0x61aa('0x3d')]({'raw':![],'where':{'CampaignId':_0x105b2a[_0x61aa('0x41')]['id']},'attributes':[[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')](_0x61aa('0x4b')))),_0x61aa('0x4c')],[db['sequelize']['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')]['literal'](_0x61aa('0x57')))),_0x61aa('0x58')],[db['sequelize']['fn'](_0x61aa('0x49'),db['sequelize']['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')](_0x61aa('0x59')))),_0x61aa('0x4d')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')]['literal'](_0x61aa('0x4e')))),'congestionContacts'],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db['sequelize'][_0x61aa('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x61aa('0x51')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db['sequelize']['literal'](_0x61aa('0x5a')))),_0x61aa('0x52')],[db[_0x61aa('0x48')]['fn']('COUNT',db[_0x61aa('0x48')]['fn']('IF',db[_0x61aa('0x48')][_0x61aa('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0x61aa('0x5b')],[db[_0x61aa('0x48')]['fn'](_0x61aa('0x49'),db[_0x61aa('0x48')]['fn']('IF',db['sequelize'][_0x61aa('0x4a')](_0x61aa('0x54')))),_0x61aa('0x55')]]})[_0x61aa('0x1f')](handleEntityNotFound(_0x385d0b,null))[_0x61aa('0x1f')](respondWithResult(_0x385d0b,null))[_0x61aa('0x3f')](handleError(_0x385d0b,null));};exports[_0x61aa('0x5c')]=function(_0x2aac56,_0x2a9d07,_0x5312d3){return db[_0x61aa('0x5d')][_0x61aa('0x44')]({'where':{'id':_0x2aac56[_0x61aa('0x41')]['id']}})[_0x61aa('0x1f')](handleEntityNotFound(_0x2a9d07,null))[_0x61aa('0x1f')](function(_0x523d96){var _0x191e26;if(_0x523d96){_0x191e26=squel[_0x61aa('0x5e')]()[_0x61aa('0x5f')](_0x61aa('0x60'))['fromQuery']([_0x61aa('0x61'),_0x61aa('0x62'),_0x61aa('0x63'),_0x61aa('0x64'),_0x61aa('0x65'),_0x61aa('0x66'),_0x61aa('0x67')],squel[_0x61aa('0x68')]()[_0x61aa('0x39')](_0x61aa('0x69'),_0x61aa('0x61'))[_0x61aa('0x39')](_0x61aa('0x6a'),_0x61aa('0x62'))[_0x61aa('0x39')](_0x61aa('0x6b'),'ContactId')[_0x61aa('0x39')](_0x61aa('0x6c'),'ListId')[_0x61aa('0x39')](_0x61aa('0x6d'),_0x61aa('0x65'))[_0x61aa('0x39')](_0x61aa('0x6a'),'createdAt')[_0x61aa('0x39')]('NOW()',_0x61aa('0x67'))[_0x61aa('0x6e')](_0x61aa('0x6f'))[_0x61aa('0x33')](_0x61aa('0x70'),_0x2aac56[_0x61aa('0x41')]['id'][_0x61aa('0x71')]())[_0x61aa('0x33')](_0x61aa('0x72'),_0x2aac56['body'][_0x61aa('0x73')][_0x61aa('0x71')]())[_0x61aa('0x33')](_0x61aa('0x74'))[_0x61aa('0x33')](_0x61aa('0x75'),squel[_0x61aa('0x68')]()[_0x61aa('0x39')](_0x61aa('0x61'))[_0x61aa('0x6e')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x2aac56[_0x61aa('0x41')]['id'][_0x61aa('0x71')]()))['where'](_0x61aa('0x75'),squel[_0x61aa('0x68')]()[_0x61aa('0x39')](_0x61aa('0x76'))[_0x61aa('0x6e')]('cm_hopper_final')[_0x61aa('0x33')]('VoiceQueueId\x20=\x20?',_0x2aac56[_0x61aa('0x41')]['id'][_0x61aa('0x71')]())[_0x61aa('0x33')]('state\x20=\x204'))[_0x61aa('0x77')]('ContactId'))[_0x61aa('0x71')]();return db[_0x61aa('0x48')][_0x61aa('0x29')](_0x191e26);}return[];})[_0x61aa('0x1f')](respondWithResult(_0x2a9d07,null))[_0x61aa('0x3f')](handleError(_0x2a9d07,null));};exports[_0x61aa('0x78')]=function(_0x4ab929,_0x110c96,_0x33f675){return db[_0x61aa('0x79')][_0x61aa('0x44')]({'where':{'id':_0x4ab929[_0x61aa('0x41')]['id']}})[_0x61aa('0x1f')](handleEntityNotFound(_0x110c96,null))[_0x61aa('0x1f')](function(_0x4d916d){var _0x4bbe48;if(_0x4d916d){_0x4bbe48=squel[_0x61aa('0x5e')]()[_0x61aa('0x5f')]('cm_hopper')['fromQuery']([_0x61aa('0x61'),_0x61aa('0x62'),_0x61aa('0x63'),_0x61aa('0x64'),_0x61aa('0x7a'),_0x61aa('0x66'),'updatedAt'],squel[_0x61aa('0x68')]()['field'](_0x61aa('0x69'),_0x61aa('0x61'))[_0x61aa('0x39')](_0x61aa('0x6a'),'scheduledAt')[_0x61aa('0x39')](_0x61aa('0x6b'),_0x61aa('0x63'))['field'](_0x61aa('0x6c'),_0x61aa('0x64'))['field'](_0x61aa('0x7b'),'CampaignId')['field'](_0x61aa('0x6a'),_0x61aa('0x66'))['field']('NOW()','updatedAt')['from'](_0x61aa('0x6f'))[_0x61aa('0x33')]('CampaignId\x20=\x20?',_0x4ab929[_0x61aa('0x41')]['id'][_0x61aa('0x71')]())[_0x61aa('0x33')](_0x61aa('0x72'),_0x4ab929[_0x61aa('0x7c')]['state'][_0x61aa('0x71')]())[_0x61aa('0x33')](_0x61aa('0x74'))[_0x61aa('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x61aa('0x39')](_0x61aa('0x61'))[_0x61aa('0x6e')](_0x61aa('0x60'))['where'](_0x61aa('0x7d'),_0x4ab929['params']['id'][_0x61aa('0x71')]()))['where'](_0x61aa('0x75'),squel[_0x61aa('0x68')]()['field'](_0x61aa('0x76'))[_0x61aa('0x6e')](_0x61aa('0x6f'))['where']('CampaignId\x20=\x20?',_0x4ab929['params']['id'][_0x61aa('0x71')]())[_0x61aa('0x33')](_0x61aa('0x7e')))['group']('ContactId'))[_0x61aa('0x71')]();return db[_0x61aa('0x48')]['query'](_0x4bbe48);}return[];})[_0x61aa('0x1f')](respondWithResult(_0x110c96,null))[_0x61aa('0x3f')](handleError(_0x110c96,null));};exports['checkContactHopper']=function(_0x26da4a,_0x137a15,_0x35c8ec){return db[_0x61aa('0x7f')][_0x61aa('0x80')]({'where':{'VoiceQueueId':_0x26da4a[_0x61aa('0x7c')][_0x61aa('0x65')],'CampaignId':_0x26da4a[_0x61aa('0x7c')][_0x61aa('0x7a')],'ContactId':_0x26da4a[_0x61aa('0x7c')][_0x61aa('0x63')]}})[_0x61aa('0x1f')](handleEntityNotFound(_0x137a15,null))[_0x61aa('0x1f')](function(_0x2c6e2a){if(_0x2c6e2a){return _0x2c6e2a;}return null;})[_0x61aa('0x1f')](respondWithResult(_0x137a15,null))['catch'](handleError(_0x137a15,null));}; \ No newline at end of file +var _0xfdb5=['ContactId','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','json','apply','reject','save','destroy','then','name','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','map','type','key','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','find','catch','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','where','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group'];(function(_0x40c536,_0x59e1bb){var _0xe00415=function(_0x48c719){while(--_0x48c719){_0x40c536['push'](_0x40c536['shift']());}};_0xe00415(++_0x59e1bb);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xfdb5[_0x1589dd];return _0x1bddd1;};'use strict';var pdf=require(_0x5fdb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5fdb('0x1'));var zipdir=require(_0x5fdb('0x2'));var jsonpatch=require(_0x5fdb('0x3'));var rp=require(_0x5fdb('0x4'));var moment=require(_0x5fdb('0x5'));var BPromise=require(_0x5fdb('0x6'));var Mustache=require(_0x5fdb('0x7'));var util=require(_0x5fdb('0x8'));var path=require('path');var sox=require(_0x5fdb('0x9'));var csv=require('to-csv');var ejs=require(_0x5fdb('0xa'));var fs=require('fs');var _=require(_0x5fdb('0xb'));var squel=require(_0x5fdb('0xc'));var crypto=require(_0x5fdb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5fdb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5fdb('0xf'));var Papa=require(_0x5fdb('0x10'));var Redis=require(_0x5fdb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5fdb('0x12'));var hardwareService=require(_0x5fdb('0x13'));var logger=require(_0x5fdb('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5fdb('0x15'));var db=require(_0x5fdb('0x16'))['db'];function respondWithStatusCode(_0x1a063e,_0x3fd6){_0x3fd6=_0x3fd6||0xcc;return function(_0x3ee18f){if(_0x3ee18f){return _0x1a063e[_0x5fdb('0x17')](_0x3fd6);}return _0x1a063e['status'](_0x3fd6)[_0x5fdb('0x18')]();};}function respondWithResult(_0x464468,_0x202c67){_0x202c67=_0x202c67||0xc8;return function(_0x15fd60){if(_0x15fd60){return _0x464468[_0x5fdb('0x19')](_0x202c67)['json'](_0x15fd60);}};}function respondWithFilteredResult(_0x16a9ee,_0x36b2a1){return function(_0x5a7cc4){if(_0x5a7cc4){var _0x18ccfb=_0x5a7cc4[_0x5fdb('0x1a')],_0x374b9c=_0x36b2a1[_0x5fdb('0x1b')],_0x20d284=_0x36b2a1['offset']+_0x36b2a1['limit'],_0x495dae;if(_0x20d284>=_0x18ccfb){_0x20d284=_0x18ccfb;_0x495dae=0xc8;}else{_0x495dae=0xce;}_0x16a9ee[_0x5fdb('0x19')](_0x495dae);return _0x16a9ee[_0x5fdb('0x1c')]('Content-Range',_0x374b9c+'-'+_0x20d284+'/'+_0x18ccfb)[_0x5fdb('0x1d')](_0x5a7cc4);}return null;};}function patchUpdates(_0x1b4430){return function(_0x1032aa){try{jsonpatch[_0x5fdb('0x1e')](_0x1032aa,_0x1b4430,!![]);}catch(_0x2eb087){return BPromise[_0x5fdb('0x1f')](_0x2eb087);}return _0x1032aa[_0x5fdb('0x20')]();};}function saveUpdates(_0x8e68e5,_0xc91c1a){return function(_0x3f5198){if(_0x3f5198){return _0x3f5198['update'](_0x8e68e5)['then'](function(_0x558f7b){return _0x558f7b;});}return null;};}function removeEntity(_0x3ca1cd,_0x5c6884){return function(_0xc53b2c){if(_0xc53b2c){return _0xc53b2c[_0x5fdb('0x21')]()[_0x5fdb('0x22')](function(){_0x3ca1cd[_0x5fdb('0x19')](0xcc)[_0x5fdb('0x18')]();});}};}function handleEntityNotFound(_0x50cf4f,_0x32b9e7){return function(_0x1079c0){if(!_0x1079c0){_0x50cf4f[_0x5fdb('0x17')](0x194);}return _0x1079c0;};}function handleError(_0xb0bc11,_0x44be72){_0x44be72=_0x44be72||0x1f4;return function(_0x1290c6){logger['error'](_0x1290c6['stack']);if(_0x1290c6[_0x5fdb('0x23')]){delete _0x1290c6['name'];}_0xb0bc11[_0x5fdb('0x19')](_0x44be72)['send'](_0x1290c6);};}exports[_0x5fdb('0x24')]=function(_0x272f1f,_0x491586){var _0x564e16={},_0x22fe92={},_0x24ebff={'count':0x0,'rows':[]};var _0x3cd642=db[_0x5fdb('0x25')][_0x5fdb('0x26')];_0x22fe92[_0x5fdb('0x27')]=_[_0x5fdb('0x28')](_0x3cd642);_0x22fe92[_0x5fdb('0x29')]=_[_0x5fdb('0x28')](_0x272f1f[_0x5fdb('0x29')]);_0x22fe92[_0x5fdb('0x2a')]=_[_0x5fdb('0x2b')](_0x22fe92[_0x5fdb('0x27')],_0x22fe92[_0x5fdb('0x29')]);_0x564e16[_0x5fdb('0x2c')]=_['intersection'](_0x22fe92[_0x5fdb('0x27')],qs[_0x5fdb('0x2d')](_0x272f1f['query']['fields']));_0x564e16[_0x5fdb('0x2c')]=_0x564e16[_0x5fdb('0x2c')]['length']?_0x564e16[_0x5fdb('0x2c')]:_0x22fe92[_0x5fdb('0x27')];if(!_0x272f1f[_0x5fdb('0x29')][_0x5fdb('0x2e')](_0x5fdb('0x2f'))){_0x564e16[_0x5fdb('0x30')]=qs[_0x5fdb('0x30')](_0x272f1f[_0x5fdb('0x29')]['limit']);_0x564e16['offset']=qs[_0x5fdb('0x1b')](_0x272f1f[_0x5fdb('0x29')][_0x5fdb('0x1b')]);}_0x564e16[_0x5fdb('0x31')]=qs[_0x5fdb('0x32')](_0x272f1f['query']['sort']);_0x564e16['where']=qs['filters'](_[_0x5fdb('0x33')](_0x272f1f[_0x5fdb('0x29')],_0x22fe92[_0x5fdb('0x2a')]));if(_0x272f1f[_0x5fdb('0x29')][_0x5fdb('0x34')]){_0x564e16['where']=_['merge'](_0x564e16['where'],{'$or':_[_0x5fdb('0x35')](_0x3cd642,function(_0x2833d2){if(_0x2833d2[_0x5fdb('0x36')][_0x5fdb('0x37')]!==_0x5fdb('0x38')){var _0x198a3d={};_0x198a3d[_0x2833d2['field']]={'$like':'%'+_0x272f1f[_0x5fdb('0x29')][_0x5fdb('0x34')]+'%'};return _0x198a3d;}})});}_0x564e16=_[_0x5fdb('0x39')]({},_0x564e16,_0x272f1f[_0x5fdb('0x3a')]);var _0x14823e={'where':_0x564e16['where']};return db[_0x5fdb('0x25')]['count'](_0x14823e)[_0x5fdb('0x22')](function(_0x4d4a7a){_0x24ebff['count']=_0x4d4a7a;if(_0x272f1f['query']['includeAll']){_0x564e16[_0x5fdb('0x3b')]=[{'all':!![]}];}return db[_0x5fdb('0x25')][_0x5fdb('0x3c')](_0x564e16);})[_0x5fdb('0x22')](function(_0x33434f){_0x24ebff[_0x5fdb('0x3d')]=_0x33434f;return _0x24ebff;})[_0x5fdb('0x22')](respondWithFilteredResult(_0x491586,_0x564e16))['catch'](handleError(_0x491586,null));};exports[_0x5fdb('0x3e')]=function(_0x349724,_0x4eac52){var _0x391924={'raw':!![],'where':{'id':_0x349724[_0x5fdb('0x3f')]['id']}},_0x2e3fef={};_0x2e3fef['model']=_[_0x5fdb('0x28')](db['CmHopperFinal'][_0x5fdb('0x26')]);_0x2e3fef[_0x5fdb('0x29')]=_[_0x5fdb('0x28')](_0x349724[_0x5fdb('0x29')]);_0x2e3fef[_0x5fdb('0x2a')]=_[_0x5fdb('0x2b')](_0x2e3fef[_0x5fdb('0x27')],_0x2e3fef[_0x5fdb('0x29')]);_0x391924[_0x5fdb('0x2c')]=_[_0x5fdb('0x2b')](_0x2e3fef[_0x5fdb('0x27')],qs['fields'](_0x349724['query']['fields']));_0x391924['attributes']=_0x391924[_0x5fdb('0x2c')][_0x5fdb('0x40')]?_0x391924['attributes']:_0x2e3fef['model'];if(_0x349724[_0x5fdb('0x29')][_0x5fdb('0x41')]){_0x391924[_0x5fdb('0x3b')]=[{'all':!![]}];}_0x391924=_[_0x5fdb('0x39')]({},_0x391924,_0x349724[_0x5fdb('0x3a')]);return db[_0x5fdb('0x25')][_0x5fdb('0x42')](_0x391924)[_0x5fdb('0x22')](handleEntityNotFound(_0x4eac52,null))[_0x5fdb('0x22')](respondWithResult(_0x4eac52,null))[_0x5fdb('0x43')](handleError(_0x4eac52,null));};exports[_0x5fdb('0x44')]=function(_0x266c9d,_0x5cf35e){return db[_0x5fdb('0x25')][_0x5fdb('0x44')]()[_0x5fdb('0x22')](respondWithResult(_0x5cf35e,null))[_0x5fdb('0x43')](handleError(_0x5cf35e,null));};exports[_0x5fdb('0x45')]=function(_0xe1cad4,_0x372af7){if(_0xe1cad4[_0x5fdb('0x46')][_0x5fdb('0x47')]){delete _0xe1cad4[_0x5fdb('0x46')][_0x5fdb('0x47')];}return db[_0x5fdb('0x25')][_0x5fdb('0x42')]({'where':{'uniqueid':_0xe1cad4[_0x5fdb('0x3f')]['id']}})[_0x5fdb('0x22')](handleEntityNotFound(_0x372af7,null))[_0x5fdb('0x22')](saveUpdates(_0xe1cad4[_0x5fdb('0x46')],null))[_0x5fdb('0x22')](respondWithResult(_0x372af7,null))[_0x5fdb('0x43')](handleError(_0x372af7,null));};exports[_0x5fdb('0x48')]=function(_0x224fb1,_0x565198,_0x42b6f1){return db[_0x5fdb('0x25')][_0x5fdb('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x224fb1['params']['id']},'attributes':[[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db['sequelize'][_0x5fdb('0x4b')](_0x5fdb('0x4c')))),_0x5fdb('0x4d')],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x4e')))),_0x5fdb('0x4f')],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x51')))),'congestionContacts'],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5fdb('0x52')],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5fdb('0x53')],[db['sequelize']['fn']('COUNT',db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x54')))),_0x5fdb('0x55')],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x5fdb('0x56')]]})[_0x5fdb('0x22')](handleEntityNotFound(_0x565198,null))['then'](respondWithResult(_0x565198,null))[_0x5fdb('0x43')](handleError(_0x565198,null));};exports[_0x5fdb('0x57')]=function(_0x44ce38,_0x2f8216,_0x2cfadb){return db[_0x5fdb('0x25')]['findAll']({'raw':![],'where':{'CampaignId':_0x44ce38[_0x5fdb('0x3f')]['id']},'attributes':[[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x4c')))),'noSuchContacts'],[db['sequelize']['fn'](_0x5fdb('0x4a'),db['sequelize']['fn']('IF',db[_0x5fdb('0x49')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0x5fdb('0x58')],[db[_0x5fdb('0x49')]['fn']('COUNT',db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x51')))),'congestionContacts'],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')]['literal'](_0x5fdb('0x59')))),_0x5fdb('0x52')],[db[_0x5fdb('0x49')]['fn']('COUNT',db[_0x5fdb('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5fdb('0x5a')))),_0x5fdb('0x53')],[db[_0x5fdb('0x49')]['fn'](_0x5fdb('0x4a'),db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x54')))),'reCallContacts'],[db[_0x5fdb('0x49')]['fn']('COUNT',db[_0x5fdb('0x49')]['fn']('IF',db[_0x5fdb('0x49')][_0x5fdb('0x4b')](_0x5fdb('0x5b')))),'answeringMachine']]})[_0x5fdb('0x22')](handleEntityNotFound(_0x2f8216,null))[_0x5fdb('0x22')](respondWithResult(_0x2f8216,null))[_0x5fdb('0x43')](handleError(_0x2f8216,null));};exports[_0x5fdb('0x5c')]=function(_0x211730,_0xeb6f63,_0x343e9a){return db['VoiceQueue'][_0x5fdb('0x42')]({'where':{'id':_0x211730['params']['id']}})[_0x5fdb('0x22')](handleEntityNotFound(_0xeb6f63,null))[_0x5fdb('0x22')](function(_0x2a78bb){var _0x1f14dd;if(_0x2a78bb){_0x1f14dd=squel['insert']()['into'](_0x5fdb('0x5d'))[_0x5fdb('0x5e')](['phone',_0x5fdb('0x5f'),'ContactId',_0x5fdb('0x60'),_0x5fdb('0x61'),_0x5fdb('0x62'),_0x5fdb('0x63')],squel[_0x5fdb('0x64')]()[_0x5fdb('0x65')]('ANY_VALUE(calleridnum)',_0x5fdb('0x66'))[_0x5fdb('0x65')](_0x5fdb('0x67'),_0x5fdb('0x5f'))[_0x5fdb('0x65')](_0x5fdb('0x68'),'ContactId')[_0x5fdb('0x65')](_0x5fdb('0x69'),_0x5fdb('0x60'))[_0x5fdb('0x65')]('ANY_VALUE(VoiceQueueId)',_0x5fdb('0x61'))['field'](_0x5fdb('0x67'),_0x5fdb('0x62'))['field'](_0x5fdb('0x67'),'updatedAt')[_0x5fdb('0x6a')]('cm_hopper_final')[_0x5fdb('0x6b')](_0x5fdb('0x6c'),_0x211730[_0x5fdb('0x3f')]['id'][_0x5fdb('0x6d')]())['where'](_0x5fdb('0x6e'),_0x211730[_0x5fdb('0x46')][_0x5fdb('0x6f')]['toString']())[_0x5fdb('0x6b')](_0x5fdb('0x70'))['where'](_0x5fdb('0x71'),squel[_0x5fdb('0x64')]()[_0x5fdb('0x65')](_0x5fdb('0x66'))[_0x5fdb('0x6a')]('cm_hopper')[_0x5fdb('0x6b')](_0x5fdb('0x6c'),_0x211730[_0x5fdb('0x3f')]['id'][_0x5fdb('0x6d')]()))[_0x5fdb('0x6b')](_0x5fdb('0x71'),squel[_0x5fdb('0x64')]()[_0x5fdb('0x65')]('calleridnum')[_0x5fdb('0x6a')](_0x5fdb('0x72'))['where']('VoiceQueueId\x20=\x20?',_0x211730[_0x5fdb('0x3f')]['id'][_0x5fdb('0x6d')]())['where'](_0x5fdb('0x73')))[_0x5fdb('0x74')](_0x5fdb('0x75')))[_0x5fdb('0x6d')]();return db[_0x5fdb('0x49')][_0x5fdb('0x29')](_0x1f14dd);}return[];})[_0x5fdb('0x22')](respondWithResult(_0xeb6f63,null))['catch'](handleError(_0xeb6f63,null));};exports[_0x5fdb('0x76')]=function(_0x19e3b0,_0x1cd77a,_0x2cfd1d){return db[_0x5fdb('0x77')][_0x5fdb('0x42')]({'where':{'id':_0x19e3b0[_0x5fdb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cd77a,null))[_0x5fdb('0x22')](function(_0x391d14){var _0x4cd330;if(_0x391d14){_0x4cd330=squel[_0x5fdb('0x78')]()[_0x5fdb('0x79')](_0x5fdb('0x5d'))[_0x5fdb('0x5e')]([_0x5fdb('0x66'),_0x5fdb('0x5f'),_0x5fdb('0x75'),_0x5fdb('0x60'),_0x5fdb('0x7a'),_0x5fdb('0x62'),'updatedAt'],squel[_0x5fdb('0x64')]()['field'](_0x5fdb('0x7b'),_0x5fdb('0x66'))[_0x5fdb('0x65')](_0x5fdb('0x67'),'scheduledAt')[_0x5fdb('0x65')]('ANY_VALUE(ContactId)',_0x5fdb('0x75'))[_0x5fdb('0x65')](_0x5fdb('0x69'),_0x5fdb('0x60'))[_0x5fdb('0x65')](_0x5fdb('0x7c'),'CampaignId')[_0x5fdb('0x65')](_0x5fdb('0x67'),'createdAt')[_0x5fdb('0x65')](_0x5fdb('0x67'),_0x5fdb('0x63'))[_0x5fdb('0x6a')]('cm_hopper_final')[_0x5fdb('0x6b')](_0x5fdb('0x7d'),_0x19e3b0['params']['id']['toString']())['where'](_0x5fdb('0x6e'),_0x19e3b0[_0x5fdb('0x46')]['state']['toString']())['where'](_0x5fdb('0x70'))[_0x5fdb('0x6b')](_0x5fdb('0x71'),squel[_0x5fdb('0x64')]()['field'](_0x5fdb('0x66'))[_0x5fdb('0x6a')]('cm_hopper')[_0x5fdb('0x6b')]('CampaignId\x20=\x20?',_0x19e3b0[_0x5fdb('0x3f')]['id'][_0x5fdb('0x6d')]()))[_0x5fdb('0x6b')](_0x5fdb('0x71'),squel[_0x5fdb('0x64')]()[_0x5fdb('0x65')](_0x5fdb('0x7e'))[_0x5fdb('0x6a')]('cm_hopper_final')['where'](_0x5fdb('0x7d'),_0x19e3b0[_0x5fdb('0x3f')]['id'][_0x5fdb('0x6d')]())[_0x5fdb('0x6b')](_0x5fdb('0x73')))[_0x5fdb('0x74')](_0x5fdb('0x75')))[_0x5fdb('0x6d')]();return db[_0x5fdb('0x49')][_0x5fdb('0x29')](_0x4cd330);}return[];})[_0x5fdb('0x22')](respondWithResult(_0x1cd77a,null))[_0x5fdb('0x43')](handleError(_0x1cd77a,null));};exports[_0x5fdb('0x7f')]=function(_0x1603cf,_0x587cb3,_0x34fec0){return db[_0x5fdb('0x80')]['findOne']({'where':{'VoiceQueueId':_0x1603cf[_0x5fdb('0x46')][_0x5fdb('0x61')],'CampaignId':_0x1603cf[_0x5fdb('0x46')]['CampaignId'],'ContactId':_0x1603cf[_0x5fdb('0x46')]['ContactId']}})[_0x5fdb('0x22')](handleEntityNotFound(_0x587cb3,null))[_0x5fdb('0x22')](function(_0x2fffb7){if(_0x2fffb7){return _0x2fffb7;}return null;})[_0x5fdb('0x22')](respondWithResult(_0x587cb3,null))['catch'](handleError(_0x587cb3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 968f2d5..f3adbba 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 _0x7272=['path','./cmHopperFinal.attributes','define','calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2a4fac,_0x43192f){var _0x518b75=function(_0x5e8a90){while(--_0x5e8a90){_0x2a4fac['push'](_0x2a4fac['shift']());}};_0x518b75(++_0x43192f);}(_0x7272,0xd7));var _0x2727=function(_0xb7fe7,_0x2bad9c){_0xb7fe7=_0xb7fe7-0x0;var _0x3a471f=_0x7272[_0xb7fe7];return _0x3a471f;};'use strict';var _=require(_0x2727('0x0'));var util=require('util');var logger=require(_0x2727('0x1'))(_0x2727('0x2'));var moment=require('moment');var BPromise=require(_0x2727('0x3'));var rp=require(_0x2727('0x4'));var fs=require('fs');var path=require(_0x2727('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2727('0x6'));module['exports']=function(_0xf1c9f1,_0x5cd576){return _0xf1c9f1[_0x2727('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x2727('0x8'),'fields':[_0x2727('0x8')]},{'name':'uniqueid','fields':[_0x2727('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x526c=['../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x22b045,_0x4e2b0a){var _0x25ae65=function(_0x1ebb90){while(--_0x1ebb90){_0x22b045['push'](_0x22b045['shift']());}};_0x25ae65(++_0x4e2b0a);}(_0x526c,0x143));var _0xc526=function(_0x57dff9,_0x37bd67){_0x57dff9=_0x57dff9-0x0;var _0x346ae6=_0x526c[_0x57dff9];return _0x346ae6;};'use strict';var _=require(_0xc526('0x0'));var util=require(_0xc526('0x1'));var logger=require(_0xc526('0x2'))(_0xc526('0x3'));var moment=require(_0xc526('0x4'));var BPromise=require(_0xc526('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc526('0x6'));var rimraf=require('rimraf');var config=require(_0xc526('0x7'));var attributes=require(_0xc526('0x8'));module[_0xc526('0x9')]=function(_0x4ff2b4,_0x494266){return _0x4ff2b4[_0xc526('0xa')](_0xc526('0xb'),attributes,{'tableName':_0xc526('0xc'),'paranoid':![],'indexes':[{'name':_0xc526('0xd'),'fields':[_0xc526('0xd')]},{'name':_0xc526('0xe'),'fields':[_0xc526('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 4f0d288..6ffd285 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 _0xeb74=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateCmHopperFinal','CmHopperFinal','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x442a2e,_0xab4caa){var _0x438f7c=function(_0x5a1f0b){while(--_0x5a1f0b){_0x442a2e['push'](_0x442a2e['shift']());}};_0x438f7c(++_0xab4caa);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4f14f0,_0x4ad4a2){_0x4f14f0=_0x4f14f0-0x0;var _0x1eea10=_0xeb74[_0x4f14f0];return _0x1eea10;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')](_0x3b6d41['body'],{'raw':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![]})[_0x4eb7('0xc')](function(_0x32f0f5){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger['debug'](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x1c')](_0x32f0f5));_0x302e16(_0x32f0f5);})[_0x4eb7('0x16')](function(_0x164515){logger[_0x4eb7('0x11')](_0x4eb7('0x17'),_0x164515[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478[_0x4eb7('0x11')](0x1f4,_0x164515[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0xa902=['raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateCmHopperFinal','create','body','options'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa902,0x8d));var _0x2a90=function(_0x1385cc,_0x3f1a5f){_0x1385cc=_0x1385cc-0x0;var _0x39f044=_0xa902[_0x1385cc];return _0x39f044;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['CmHopperFinal'][_0x2a90('0x18')](_0x5c3e4b[_0x2a90('0x19')],{'raw':_0x5c3e4b[_0x2a90('0x1a')]?_0x5c3e4b[_0x2a90('0x1a')][_0x2a90('0x1b')]===undefined?!![]:![]:!![]})[_0x2a90('0xc')](function(_0x312cd5){logger[_0x2a90('0xd')](_0x2a90('0x17'),_0x5c3e4b);logger[_0x2a90('0xf')](_0x2a90('0x17'),_0x5c3e4b,JSON[_0x2a90('0x12')](_0x312cd5));_0x1d9a28(_0x312cd5);})['catch'](function(_0x3da7d0){logger[_0x2a90('0x13')](_0x2a90('0x17'),_0x3da7d0[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3da7d0[_0x2a90('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index bd2ee17..fb514e1 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 _0x3e74=['isAuthenticated','index','describe','/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x3e74,0x175));var _0x43e7=function(_0xa0151c,_0x2e1b3a){_0xa0151c=_0xa0151c-0x0;var _0x6210f0=_0x3e74[_0xa0151c];return _0x6210f0;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/campaign/countAttributes/:id',auth[_0x43e7('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xc')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x43e7('0x10'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router['put']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);module[_0x43e7('0x13')]=router; \ No newline at end of file +var _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x595a1f,_0x47b911){var _0x3fc087=function(_0x197c25){while(--_0x197c25){_0x595a1f['push'](_0x595a1f['shift']());}};_0x3fc087(++_0x47b911);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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('./cmHopperFinal.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('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5238ef9..5dbb8fd 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 _0x8ef6=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x229883,_0x24f0d2){var _0x28e0d5=function(_0x98dfb0){while(--_0x98dfb0){_0x229883['push'](_0x229883['shift']());}};_0x28e0d5(++_0x24f0d2);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3544d7,_0x11744b){_0x3544d7=_0x3544d7-0x0;var _0x1f169c=_0x8ef6[_0x3544d7];return _0x1f169c;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'state':{'type':Sequelize[_0x68ef('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x68ef('0x3')]},'scheduledat':{'type':Sequelize[_0x68ef('0x4')]},'countbusyretry':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x68ef('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x68ef('0x3')]},'originatecalleridname':{'type':Sequelize[_0x68ef('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'responsetime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'ringtime':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x68ef('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x68ef('0x3')]},'campaign':{'type':Sequelize[_0x68ef('0x3')]},'campaigntype':{'type':Sequelize[_0x68ef('0x3')]},'membername':{'type':Sequelize[_0x68ef('0x3')]},'reason':{'type':Sequelize[_0x68ef('0x3')]},'amd':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x68ef('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x68ef('0x4')]},'recallme':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x68ef('0x4')]},'edited':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xbcba=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbcba,0x6d));var _0xabcb=function(_0x1e5442,_0x1fa424){_0x1e5442=_0x1e5442-0x0;var _0x5d1a44=_0xbcba[_0x1e5442];return _0x5d1a44;};'use strict';var Sequelize=require(_0xabcb('0x0'));module[_0xabcb('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xabcb('0x2')]},'scheduledat':{'type':Sequelize[_0xabcb('0x3')]},'countbusyretry':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xabcb('0x2')]},'calleridnum':{'type':Sequelize[_0xabcb('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xabcb('0x3')]},'answertime':{'type':Sequelize[_0xabcb('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xabcb('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xabcb('0x2')]},'campaign':{'type':Sequelize[_0xabcb('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xabcb('0x2')]},'reason':{'type':Sequelize[_0xabcb('0x2')]},'amd':{'type':Sequelize[_0xabcb('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xabcb('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xabcb('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xabcb('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xabcb('0x3')]},'recallme':{'type':Sequelize[_0xabcb('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xabcb('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a7aa3a4..c67e060 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 _0xcc25=['where','filters','pick','map','type','VIRTUAL','field','filter','merge','options','CmHopperHistory','includeAll','include','catch','show','rawAttributes','find','create','body','describe','update','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','reject','save','then','error','stack','name','send','index','model','keys','query','intersection','fields','attributes','order'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0xcc25,0x1a2));var _0x5cc2=function(_0x432958,_0x2adce3){_0x432958=_0x432958-0x0;var _0x796ea5=_0xcc25[_0x432958];return _0x796ea5;};'use strict';var pdf=require(_0x5cc2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5cc2('0x1'));var zipdir=require(_0x5cc2('0x2'));var jsonpatch=require(_0x5cc2('0x3'));var rp=require(_0x5cc2('0x4'));var moment=require(_0x5cc2('0x5'));var BPromise=require(_0x5cc2('0x6'));var Mustache=require(_0x5cc2('0x7'));var util=require(_0x5cc2('0x8'));var path=require(_0x5cc2('0x9'));var sox=require('sox');var csv=require(_0x5cc2('0xa'));var ejs=require(_0x5cc2('0xb'));var fs=require('fs');var _=require(_0x5cc2('0xc'));var squel=require('squel');var crypto=require(_0x5cc2('0xd'));var jsforce=require(_0x5cc2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5cc2('0xa'));var querystring=require(_0x5cc2('0xf'));var Papa=require(_0x5cc2('0x10'));var Redis=require(_0x5cc2('0x11'));var authService=require(_0x5cc2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5cc2('0x13'));var logger=require(_0x5cc2('0x14'))(_0x5cc2('0x15'));var utils=require('../../config/utils');var config=require(_0x5cc2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x285a99,_0x3c67d4){_0x3c67d4=_0x3c67d4||0xcc;return function(_0x2d3e45){if(_0x2d3e45){return _0x285a99['sendStatus'](_0x3c67d4);}return _0x285a99[_0x5cc2('0x17')](_0x3c67d4)[_0x5cc2('0x18')]();};}function respondWithResult(_0x290727,_0x2871cc){_0x2871cc=_0x2871cc||0xc8;return function(_0x3a4f88){if(_0x3a4f88){return _0x290727[_0x5cc2('0x17')](_0x2871cc)[_0x5cc2('0x19')](_0x3a4f88);}};}function respondWithFilteredResult(_0x56c5b2,_0x23f9ad){return function(_0x35d136){if(_0x35d136){var _0x4c5646=_0x35d136[_0x5cc2('0x1a')],_0x2db28c=_0x23f9ad['offset'],_0x3683e6=_0x23f9ad[_0x5cc2('0x1b')]+_0x23f9ad[_0x5cc2('0x1c')],_0x264ad2;if(_0x3683e6>=_0x4c5646){_0x3683e6=_0x4c5646;_0x264ad2=0xc8;}else{_0x264ad2=0xce;}_0x56c5b2['status'](_0x264ad2);return _0x56c5b2['set']('Content-Range',_0x2db28c+'-'+_0x3683e6+'/'+_0x4c5646)[_0x5cc2('0x19')](_0x35d136);}return null;};}function patchUpdates(_0x49f9ba){return function(_0x41fe3a){try{jsonpatch['apply'](_0x41fe3a,_0x49f9ba,!![]);}catch(_0xe51075){return BPromise[_0x5cc2('0x1d')](_0xe51075);}return _0x41fe3a[_0x5cc2('0x1e')]();};}function saveUpdates(_0x19ec6f,_0x422dd2){return function(_0x188b53){if(_0x188b53){return _0x188b53['update'](_0x19ec6f)[_0x5cc2('0x1f')](function(_0x5c6d0d){return _0x5c6d0d;});}return null;};}function removeEntity(_0x445ef0,_0x5cc8fe){return function(_0x223135){if(_0x223135){return _0x223135['destroy']()[_0x5cc2('0x1f')](function(){_0x445ef0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de2c8,_0x532595){return function(_0x49927a){if(!_0x49927a){_0x5de2c8['sendStatus'](0x194);}return _0x49927a;};}function handleError(_0x397df1,_0xd57ce4){_0xd57ce4=_0xd57ce4||0x1f4;return function(_0x5a9f03){logger[_0x5cc2('0x20')](_0x5a9f03[_0x5cc2('0x21')]);if(_0x5a9f03[_0x5cc2('0x22')]){delete _0x5a9f03['name'];}_0x397df1[_0x5cc2('0x17')](_0xd57ce4)[_0x5cc2('0x23')](_0x5a9f03);};}exports[_0x5cc2('0x24')]=function(_0x10a47d,_0x5cf58d){var _0x1b50fa={},_0x562630={},_0x4b0706={'count':0x0,'rows':[]};var _0xd7cd2d=db['CmHopperHistory']['rawAttributes'];_0x562630[_0x5cc2('0x25')]=_[_0x5cc2('0x26')](_0xd7cd2d);_0x562630[_0x5cc2('0x27')]=_[_0x5cc2('0x26')](_0x10a47d[_0x5cc2('0x27')]);_0x562630['filters']=_['intersection'](_0x562630[_0x5cc2('0x25')],_0x562630[_0x5cc2('0x27')]);_0x1b50fa['attributes']=_[_0x5cc2('0x28')](_0x562630[_0x5cc2('0x25')],qs[_0x5cc2('0x29')](_0x10a47d[_0x5cc2('0x27')][_0x5cc2('0x29')]));_0x1b50fa[_0x5cc2('0x2a')]=_0x1b50fa[_0x5cc2('0x2a')]['length']?_0x1b50fa[_0x5cc2('0x2a')]:_0x562630[_0x5cc2('0x25')];if(!_0x10a47d[_0x5cc2('0x27')]['hasOwnProperty']('nolimit')){_0x1b50fa[_0x5cc2('0x1c')]=qs[_0x5cc2('0x1c')](_0x10a47d[_0x5cc2('0x27')]['limit']);_0x1b50fa['offset']=qs[_0x5cc2('0x1b')](_0x10a47d['query'][_0x5cc2('0x1b')]);}_0x1b50fa[_0x5cc2('0x2b')]=qs['sort'](_0x10a47d['query']['sort']);_0x1b50fa[_0x5cc2('0x2c')]=qs[_0x5cc2('0x2d')](_[_0x5cc2('0x2e')](_0x10a47d[_0x5cc2('0x27')],_0x562630[_0x5cc2('0x2d')]));if(_0x10a47d[_0x5cc2('0x27')]['filter']){_0x1b50fa[_0x5cc2('0x2c')]=_['merge'](_0x1b50fa[_0x5cc2('0x2c')],{'$or':_[_0x5cc2('0x2f')](_0xd7cd2d,function(_0x41273e){if(_0x41273e[_0x5cc2('0x30')]['key']!==_0x5cc2('0x31')){var _0x32e14d={};_0x32e14d[_0x41273e[_0x5cc2('0x32')]]={'$like':'%'+_0x10a47d['query'][_0x5cc2('0x33')]+'%'};return _0x32e14d;}})});}_0x1b50fa=_[_0x5cc2('0x34')]({},_0x1b50fa,_0x10a47d[_0x5cc2('0x35')]);var _0x5af285={'where':_0x1b50fa[_0x5cc2('0x2c')]};return db[_0x5cc2('0x36')][_0x5cc2('0x1a')](_0x5af285)['then'](function(_0x36e00c){_0x4b0706['count']=_0x36e00c;if(_0x10a47d[_0x5cc2('0x27')][_0x5cc2('0x37')]){_0x1b50fa[_0x5cc2('0x38')]=[{'all':!![]}];}return db[_0x5cc2('0x36')]['findAll'](_0x1b50fa);})[_0x5cc2('0x1f')](function(_0x4fdc7c){_0x4b0706['rows']=_0x4fdc7c;return _0x4b0706;})[_0x5cc2('0x1f')](respondWithFilteredResult(_0x5cf58d,_0x1b50fa))[_0x5cc2('0x39')](handleError(_0x5cf58d,null));};exports[_0x5cc2('0x3a')]=function(_0x311b5c,_0x382a79){var _0x44aea9={'raw':!![],'where':{'id':_0x311b5c['params']['id']}},_0x18320e={};_0x18320e[_0x5cc2('0x25')]=_['keys'](db[_0x5cc2('0x36')][_0x5cc2('0x3b')]);_0x18320e['query']=_[_0x5cc2('0x26')](_0x311b5c[_0x5cc2('0x27')]);_0x18320e[_0x5cc2('0x2d')]=_[_0x5cc2('0x28')](_0x18320e['model'],_0x18320e[_0x5cc2('0x27')]);_0x44aea9['attributes']=_[_0x5cc2('0x28')](_0x18320e['model'],qs[_0x5cc2('0x29')](_0x311b5c[_0x5cc2('0x27')][_0x5cc2('0x29')]));_0x44aea9['attributes']=_0x44aea9[_0x5cc2('0x2a')]['length']?_0x44aea9[_0x5cc2('0x2a')]:_0x18320e[_0x5cc2('0x25')];if(_0x311b5c[_0x5cc2('0x27')]['includeAll']){_0x44aea9[_0x5cc2('0x38')]=[{'all':!![]}];}_0x44aea9=_[_0x5cc2('0x34')]({},_0x44aea9,_0x311b5c[_0x5cc2('0x35')]);return db['CmHopperHistory'][_0x5cc2('0x3c')](_0x44aea9)[_0x5cc2('0x1f')](handleEntityNotFound(_0x382a79,null))[_0x5cc2('0x1f')](respondWithResult(_0x382a79,null))['catch'](handleError(_0x382a79,null));};exports[_0x5cc2('0x3d')]=function(_0x25a795,_0x3f0bb5){return db['CmHopperHistory'][_0x5cc2('0x3d')](_0x25a795[_0x5cc2('0x3e')],{})['then'](respondWithResult(_0x3f0bb5,0xc9))['catch'](handleError(_0x3f0bb5,null));};exports[_0x5cc2('0x3f')]=function(_0x272fe6,_0x153266){return db[_0x5cc2('0x36')][_0x5cc2('0x3f')]()[_0x5cc2('0x1f')](respondWithResult(_0x153266,null))['catch'](handleError(_0x153266,null));};exports[_0x5cc2('0x40')]=function(_0x156adf,_0x42ac72){if(_0x156adf[_0x5cc2('0x3e')][_0x5cc2('0x41')]){delete _0x156adf[_0x5cc2('0x3e')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x156adf['params']['id']}})[_0x5cc2('0x1f')](handleEntityNotFound(_0x42ac72,null))['then'](saveUpdates(_0x156adf[_0x5cc2('0x3e')],null))['then'](respondWithResult(_0x42ac72,null))[_0x5cc2('0x39')](handleError(_0x42ac72,null));}; \ No newline at end of file +var _0x396b=['set','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','params','fields','length','find','create','body','describe','uniqueid','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x396b,0xb7));var _0xb396=function(_0xe8aae2,_0x42c0e6){_0xe8aae2=_0xe8aae2-0x0;var _0x4588b5=_0x396b[_0xe8aae2];return _0x4588b5;};'use strict';var pdf=require(_0xb396('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb396('0x1'));var zipdir=require(_0xb396('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb396('0x3'));var moment=require(_0xb396('0x4'));var BPromise=require(_0xb396('0x5'));var Mustache=require('mustache');var util=require(_0xb396('0x6'));var path=require(_0xb396('0x7'));var sox=require(_0xb396('0x8'));var csv=require('to-csv');var ejs=require(_0xb396('0x9'));var fs=require('fs');var _=require(_0xb396('0xa'));var squel=require(_0xb396('0xb'));var crypto=require('crypto');var jsforce=require(_0xb396('0xc'));var deskjs=require(_0xb396('0xd'));var toCsv=require(_0xb396('0xe'));var querystring=require(_0xb396('0xf'));var Papa=require(_0xb396('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb396('0x11'));var hardwareService=require(_0xb396('0x12'));var logger=require(_0xb396('0x13'))(_0xb396('0x14'));var utils=require(_0xb396('0x15'));var config=require(_0xb396('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc10dae,_0x36c0e8){_0x36c0e8=_0x36c0e8||0xcc;return function(_0x1d6744){if(_0x1d6744){return _0xc10dae[_0xb396('0x17')](_0x36c0e8);}return _0xc10dae['status'](_0x36c0e8)[_0xb396('0x18')]();};}function respondWithResult(_0x40f598,_0x3db2c9){_0x3db2c9=_0x3db2c9||0xc8;return function(_0x384395){if(_0x384395){return _0x40f598[_0xb396('0x19')](_0x3db2c9)[_0xb396('0x1a')](_0x384395);}};}function respondWithFilteredResult(_0x29d5e3,_0xfbaf39){return function(_0x4c7b79){if(_0x4c7b79){var _0x531c5d=_0x4c7b79[_0xb396('0x1b')],_0x5d59f5=_0xfbaf39[_0xb396('0x1c')],_0x8dcf4f=_0xfbaf39[_0xb396('0x1c')]+_0xfbaf39[_0xb396('0x1d')],_0x5818ca;if(_0x8dcf4f>=_0x531c5d){_0x8dcf4f=_0x531c5d;_0x5818ca=0xc8;}else{_0x5818ca=0xce;}_0x29d5e3['status'](_0x5818ca);return _0x29d5e3[_0xb396('0x1e')]('Content-Range',_0x5d59f5+'-'+_0x8dcf4f+'/'+_0x531c5d)[_0xb396('0x1a')](_0x4c7b79);}return null;};}function patchUpdates(_0x3febbc){return function(_0x315f8f){try{jsonpatch['apply'](_0x315f8f,_0x3febbc,!![]);}catch(_0x3e77ee){return BPromise[_0xb396('0x1f')](_0x3e77ee);}return _0x315f8f[_0xb396('0x20')]();};}function saveUpdates(_0x302acb,_0x60da3d){return function(_0x17f5b3){if(_0x17f5b3){return _0x17f5b3[_0xb396('0x21')](_0x302acb)[_0xb396('0x22')](function(_0xe28c49){return _0xe28c49;});}return null;};}function removeEntity(_0x41acd5,_0x5ef3e1){return function(_0x1508b8){if(_0x1508b8){return _0x1508b8[_0xb396('0x23')]()[_0xb396('0x22')](function(){_0x41acd5['status'](0xcc)[_0xb396('0x18')]();});}};}function handleEntityNotFound(_0x314457,_0x58fdc0){return function(_0x4df69f){if(!_0x4df69f){_0x314457[_0xb396('0x17')](0x194);}return _0x4df69f;};}function handleError(_0x246615,_0x463891){_0x463891=_0x463891||0x1f4;return function(_0x839f51){logger[_0xb396('0x24')](_0x839f51[_0xb396('0x25')]);if(_0x839f51[_0xb396('0x26')]){delete _0x839f51['name'];}_0x246615['status'](_0x463891)['send'](_0x839f51);};}exports[_0xb396('0x27')]=function(_0x5dbd74,_0x4ac6eb){var _0x3e9dd2={},_0x110124={},_0x509180={'count':0x0,'rows':[]};var _0x8b8137=db['CmHopperHistory'][_0xb396('0x28')];_0x110124[_0xb396('0x29')]=_[_0xb396('0x2a')](_0x8b8137);_0x110124['query']=_['keys'](_0x5dbd74[_0xb396('0x2b')]);_0x110124['filters']=_[_0xb396('0x2c')](_0x110124[_0xb396('0x29')],_0x110124[_0xb396('0x2b')]);_0x3e9dd2[_0xb396('0x2d')]=_[_0xb396('0x2c')](_0x110124[_0xb396('0x29')],qs['fields'](_0x5dbd74['query']['fields']));_0x3e9dd2[_0xb396('0x2d')]=_0x3e9dd2[_0xb396('0x2d')]['length']?_0x3e9dd2[_0xb396('0x2d')]:_0x110124[_0xb396('0x29')];if(!_0x5dbd74[_0xb396('0x2b')][_0xb396('0x2e')](_0xb396('0x2f'))){_0x3e9dd2[_0xb396('0x1d')]=qs['limit'](_0x5dbd74[_0xb396('0x2b')][_0xb396('0x1d')]);_0x3e9dd2['offset']=qs[_0xb396('0x1c')](_0x5dbd74[_0xb396('0x2b')][_0xb396('0x1c')]);}_0x3e9dd2['order']=qs['sort'](_0x5dbd74[_0xb396('0x2b')][_0xb396('0x30')]);_0x3e9dd2[_0xb396('0x31')]=qs[_0xb396('0x32')](_[_0xb396('0x33')](_0x5dbd74['query'],_0x110124[_0xb396('0x32')]));if(_0x5dbd74[_0xb396('0x2b')][_0xb396('0x34')]){_0x3e9dd2[_0xb396('0x31')]=_[_0xb396('0x35')](_0x3e9dd2[_0xb396('0x31')],{'$or':_['map'](_0x8b8137,function(_0x1a24fb){if(_0x1a24fb[_0xb396('0x36')]['key']!==_0xb396('0x37')){var _0x2735f1={};_0x2735f1[_0x1a24fb['field']]={'$like':'%'+_0x5dbd74[_0xb396('0x2b')]['filter']+'%'};return _0x2735f1;}})});}_0x3e9dd2=_['merge']({},_0x3e9dd2,_0x5dbd74[_0xb396('0x38')]);var _0x5ccb6f={'where':_0x3e9dd2[_0xb396('0x31')]};return db[_0xb396('0x39')][_0xb396('0x1b')](_0x5ccb6f)[_0xb396('0x22')](function(_0x3923ee){_0x509180[_0xb396('0x1b')]=_0x3923ee;if(_0x5dbd74['query'][_0xb396('0x3a')]){_0x3e9dd2[_0xb396('0x3b')]=[{'all':!![]}];}return db[_0xb396('0x39')][_0xb396('0x3c')](_0x3e9dd2);})[_0xb396('0x22')](function(_0x397095){_0x509180[_0xb396('0x3d')]=_0x397095;return _0x509180;})['then'](respondWithFilteredResult(_0x4ac6eb,_0x3e9dd2))[_0xb396('0x3e')](handleError(_0x4ac6eb,null));};exports['show']=function(_0xff6583,_0xd26bef){var _0x713b6e={'raw':!![],'where':{'id':_0xff6583[_0xb396('0x3f')]['id']}},_0x2e629b={};_0x2e629b['model']=_[_0xb396('0x2a')](db[_0xb396('0x39')][_0xb396('0x28')]);_0x2e629b[_0xb396('0x2b')]=_[_0xb396('0x2a')](_0xff6583['query']);_0x2e629b[_0xb396('0x32')]=_['intersection'](_0x2e629b[_0xb396('0x29')],_0x2e629b[_0xb396('0x2b')]);_0x713b6e[_0xb396('0x2d')]=_[_0xb396('0x2c')](_0x2e629b['model'],qs['fields'](_0xff6583[_0xb396('0x2b')][_0xb396('0x40')]));_0x713b6e[_0xb396('0x2d')]=_0x713b6e[_0xb396('0x2d')][_0xb396('0x41')]?_0x713b6e[_0xb396('0x2d')]:_0x2e629b[_0xb396('0x29')];if(_0xff6583['query'][_0xb396('0x3a')]){_0x713b6e[_0xb396('0x3b')]=[{'all':!![]}];}_0x713b6e=_[_0xb396('0x35')]({},_0x713b6e,_0xff6583[_0xb396('0x38')]);return db[_0xb396('0x39')][_0xb396('0x42')](_0x713b6e)[_0xb396('0x22')](handleEntityNotFound(_0xd26bef,null))[_0xb396('0x22')](respondWithResult(_0xd26bef,null))[_0xb396('0x3e')](handleError(_0xd26bef,null));};exports[_0xb396('0x43')]=function(_0x50c8c0,_0x22de05){return db[_0xb396('0x39')][_0xb396('0x43')](_0x50c8c0[_0xb396('0x44')],{})[_0xb396('0x22')](respondWithResult(_0x22de05,0xc9))['catch'](handleError(_0x22de05,null));};exports['describe']=function(_0x5677cc,_0x4e5572){return db[_0xb396('0x39')][_0xb396('0x45')]()[_0xb396('0x22')](respondWithResult(_0x4e5572,null))['catch'](handleError(_0x4e5572,null));};exports[_0xb396('0x21')]=function(_0x4fa415,_0x4989e3){if(_0x4fa415[_0xb396('0x44')][_0xb396('0x46')]){delete _0x4fa415[_0xb396('0x44')][_0xb396('0x46')];}return db[_0xb396('0x39')]['find']({'where':{'uniqueid':_0x4fa415[_0xb396('0x3f')]['id']}})[_0xb396('0x22')](handleEntityNotFound(_0x4989e3,null))[_0xb396('0x22')](saveUpdates(_0x4fa415[_0xb396('0x44')],null))['then'](respondWithResult(_0x4989e3,null))[_0xb396('0x3e')](handleError(_0x4989e3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 48cd44d..b8de0da 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 _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x4d83d9,_0x25bdde){var _0x506915=function(_0x287c4b){while(--_0x287c4b){_0x4d83d9['push'](_0x4d83d9['shift']());}};_0x506915(++_0x25bdde);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x29c8da,_0xa2d181){var _0x170391=function(_0x321b6d){while(--_0x321b6d){_0x29c8da['push'](_0x29c8da['shift']());}};_0x170391(++_0xa2d181);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c328f36..f8b7a45 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 _0xc224=['request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','then','GetVoiceQueueHopperHistory','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x163366,_0x35d6d5){var _0x422d8a=function(_0x14e6c6){while(--_0x14e6c6){_0x163366['push'](_0x163366['shift']());}};_0x422d8a(++_0x35d6d5);}(_0xc224,0x15c));var _0x4c22=function(_0x25e5d6,_0x116c59){_0x25e5d6=_0x25e5d6-0x0;var _0x1168d5=_0xc224[_0x25e5d6];return _0x1168d5;};'use strict';var _=require(_0x4c22('0x0'));var util=require(_0x4c22('0x1'));var moment=require(_0x4c22('0x2'));var BPromise=require(_0x4c22('0x3'));var rs=require(_0x4c22('0x4'));var fs=require('fs');var Redis=require(_0x4c22('0x5'));var db=require(_0x4c22('0x6'))['db'];var utils=require(_0x4c22('0x7'));var logger=require('../../config/logger')(_0x4c22('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c22('0x9'));var client=jayson[_0x4c22('0xa')][_0x4c22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1f05,_0x20a45c,_0x1a1267){return new BPromise(function(_0x30389a,_0x584797){return client[_0x4c22('0xc')](_0x3a1f05,_0x1a1267)['then'](function(_0x3a31d6){logger['info'](_0x4c22('0xd'),_0x20a45c,_0x4c22('0xe'));logger[_0x4c22('0xf')](_0x4c22('0x10'),_0x20a45c,'request\x20sent',JSON[_0x4c22('0x11')](_0x3a31d6));if(_0x3a31d6[_0x4c22('0x12')]){if(_0x3a31d6['error']['code']===0x1f4){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);return _0x584797(_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);}logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6['error'][_0x4c22('0x13')]);return _0x30389a(_0x3a31d6[_0x4c22('0x12')]['message']);}else{logger[_0x4c22('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x20a45c,_0x4c22('0xe'));_0x30389a(_0x3a31d6[_0x4c22('0x15')][_0x4c22('0x13')]);}})[_0x4c22('0x16')](function(_0x4229a1){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x4229a1);_0x584797(_0x4229a1);});});}exports[_0x4c22('0x17')]=function(_0x1b9ee6){var _0x15c52e=this;return new Promise(function(_0x45de17,_0xab6ff9){return db[_0x4c22('0x18')][_0x4c22('0x19')](_0x1b9ee6[_0x4c22('0x1a')],{'raw':_0x1b9ee6[_0x4c22('0x1b')]?_0x1b9ee6[_0x4c22('0x1b')][_0x4c22('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x302307){logger[_0x4c22('0x14')](_0x4c22('0x17'),_0x1b9ee6);logger[_0x4c22('0xf')]('CreateCmHopperHistory',_0x1b9ee6,JSON[_0x4c22('0x11')](_0x302307));_0x45de17(_0x302307);})[_0x4c22('0x16')](function(_0x4bfc36){logger[_0x4c22('0x12')](_0x4c22('0x17'),_0x4bfc36[_0x4c22('0x13')],_0x1b9ee6);_0xab6ff9(_0x15c52e['error'](0x1f4,_0x4bfc36['message']));});});};exports['AvgHandleTime']=function(_0x81b495){var _0x4fcf29=this;return new Promise(function(_0xcac4bc,_0x53e5f3){return db['CmHopperHistory'][_0x4c22('0x1d')]({'raw':_0x81b495[_0x4c22('0x1b')]?_0x81b495[_0x4c22('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x81b495[_0x4c22('0x1b')]?_0x81b495[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')][_0x4c22('0x21')]('id')),'predictiveIntervalTotalCalls'],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x4c22('0x20'),db['sequelize']['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x23')))),_0x4c22('0x24')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x25')))),_0x4c22('0x26')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x27'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x27'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x28')))),_0x4c22('0x29')]]})['then'](function(_0x5d6857){logger[_0x4c22('0x14')]('AvgHandleTime',_0x81b495);logger['debug']('AvgHandleTime',_0x81b495,JSON['stringify'](_0x5d6857));_0xcac4bc(_0x5d6857);})['catch'](function(_0x289d2a){logger[_0x4c22('0x12')](_0x4c22('0x2a'),_0x289d2a['message'],_0x81b495);_0x53e5f3(_0x4fcf29[_0x4c22('0x12')](0x1f4,_0x289d2a['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1904f1){var _0x2cef36=this;return new Promise(function(_0x255d4e,_0x433780){return db[_0x4c22('0x18')]['findAll']({'raw':_0x1904f1[_0x4c22('0x1b')]?_0x1904f1[_0x4c22('0x1b')][_0x4c22('0x1c')]===undefined?!![]:![]:!![],'where':_0x1904f1[_0x4c22('0x1b')]?_0x1904f1[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[['campaign',_0x4c22('0x2b')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x2c')))),_0x4c22('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x4c22('0x2f')))),_0x4c22('0x30')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x31')))),_0x4c22('0x32')],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db['sequelize'][_0x4c22('0x22')](_0x4c22('0x33')))),_0x4c22('0x34')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db['sequelize'][_0x4c22('0x22')](_0x4c22('0x35')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x36')))),_0x4c22('0x37')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x38')))),_0x4c22('0x39')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x3a')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3b')))),_0x4c22('0x3c')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3d')))),'outboundRejectCallsDay'],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3e')))),_0x4c22('0x3f')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x4c22('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x4c22('0x40')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x41')))),'outboundReCallsDay']],'group':['campaign']})[_0x4c22('0x42')](function(_0x14e56d){logger[_0x4c22('0x14')](_0x4c22('0x43'),_0x1904f1);logger[_0x4c22('0xf')]('GetVoiceQueueHopperHistory',_0x1904f1,JSON[_0x4c22('0x11')](_0x14e56d));_0x255d4e(_0x14e56d);})[_0x4c22('0x16')](function(_0x765fca){logger[_0x4c22('0x12')]('GetVoiceQueueHopperHistory',_0x765fca['message'],_0x1904f1);_0x433780(_0x2cef36[_0x4c22('0x12')](0x1f4,_0x765fca['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5b559b){var _0x2f316d=this;return new Promise(function(_0x1c4fda,_0x17e356){return db['CmHopperHistory'][_0x4c22('0x1d')]({'raw':_0x5b559b['options']?_0x5b559b[_0x4c22('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b559b['options']?_0x5b559b[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[[_0x4c22('0x44'),_0x4c22('0x2b')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['col']('id')),_0x4c22('0x45')],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x2f')))),_0x4c22('0x46')]],'group':['campaign']})[_0x4c22('0x42')](function(_0x3f1f9a){logger[_0x4c22('0x14')]('GetCampaignHopperHistory',_0x5b559b);logger[_0x4c22('0xf')]('GetCampaignHopperHistory',_0x5b559b,JSON[_0x4c22('0x11')](_0x3f1f9a));_0x1c4fda(_0x3f1f9a);})[_0x4c22('0x16')](function(_0x1fa825){logger[_0x4c22('0x12')](_0x4c22('0x47'),_0x1fa825[_0x4c22('0x13')],_0x5b559b);_0x17e356(_0x2f316d['error'](0x1f4,_0x1fa825[_0x4c22('0x13')]));});});}; \ No newline at end of file +var _0xa25c=['predictiveIntervalAvgTalktime','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','then','stringify','AvgHandleTime','findAll','raw','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa25c,0x13f));var _0xca25=function(_0x13f0ab,_0x27f545){_0x13f0ab=_0x13f0ab-0x0;var _0x4b4acd=_0xa25c[_0x13f0ab];return _0x4b4acd;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var moment=require(_0xca25('0x1'));var BPromise=require(_0xca25('0x2'));var rs=require(_0xca25('0x3'));var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))('rpc');var config=require(_0xca25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e9352,_0xb2fc94,_0x3cee89){return new BPromise(function(_0x2c0b8c,_0x42a97a){return client[_0xca25('0xa')](_0x4e9352,_0x3cee89)['then'](function(_0x5d820c){logger[_0xca25('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0xb2fc94,_0xca25('0xc'));logger[_0xca25('0xd')](_0xca25('0xe'),_0xb2fc94,'request\x20sent',JSON['stringify'](_0x5d820c));if(_0x5d820c['error']){if(_0x5d820c[_0xca25('0xf')][_0xca25('0x10')]===0x1f4){logger[_0xca25('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0xb2fc94,_0x5d820c['error'][_0xca25('0x11')]);return _0x42a97a(_0x5d820c['error'][_0xca25('0x11')]);}logger[_0xca25('0xf')](_0xca25('0x12'),_0xb2fc94,_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);return _0x2c0b8c(_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);}else{logger[_0xca25('0xb')](_0xca25('0x12'),_0xb2fc94,_0xca25('0xc'));_0x2c0b8c(_0x5d820c[_0xca25('0x13')]['message']);}})[_0xca25('0x14')](function(_0x340c9b){logger['error'](_0xca25('0x12'),_0xb2fc94,_0x340c9b);_0x42a97a(_0x340c9b);});});}exports[_0xca25('0x15')]=function(_0x3705a0){var _0x18ec6f=this;return new Promise(function(_0x155cf2,_0x59997b){return db[_0xca25('0x16')][_0xca25('0x17')](_0x3705a0[_0xca25('0x18')],{'raw':_0x3705a0[_0xca25('0x19')]?_0x3705a0[_0xca25('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xca25('0x1a')](function(_0x3598c7){logger[_0xca25('0xb')](_0xca25('0x15'),_0x3705a0);logger[_0xca25('0xd')](_0xca25('0x15'),_0x3705a0,JSON[_0xca25('0x1b')](_0x3598c7));_0x155cf2(_0x3598c7);})['catch'](function(_0x48fdf5){logger[_0xca25('0xf')](_0xca25('0x15'),_0x48fdf5[_0xca25('0x11')],_0x3705a0);_0x59997b(_0x18ec6f[_0xca25('0xf')](0x1f4,_0x48fdf5[_0xca25('0x11')]));});});};exports[_0xca25('0x1c')]=function(_0x8cec43){var _0xb934da=this;return new Promise(function(_0x2f1f2a,_0x349364){return db[_0xca25('0x16')][_0xca25('0x1d')]({'raw':_0x8cec43['options']?_0x8cec43[_0xca25('0x19')][_0xca25('0x1e')]===undefined?!![]:![]:!![],'where':_0x8cec43[_0xca25('0x19')]?_0x8cec43[_0xca25('0x19')][_0xca25('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0xca25('0x20'),db[_0xca25('0x21')][_0xca25('0x22')]('id')),_0xca25('0x23')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x25')))),_0xca25('0x26')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x27')))),_0xca25('0x28')],[db['sequelize']['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')]['literal'](_0xca25('0x29')))),_0xca25('0x2a')],[db[_0xca25('0x21')]['fn'](_0xca25('0x2b'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')]['literal'](_0xca25('0x2c')))),'predictiveIntervalAvgHoldtime'],[db[_0xca25('0x21')]['fn'](_0xca25('0x2b'),db[_0xca25('0x21')]['fn']('IF',db['sequelize'][_0xca25('0x24')](_0xca25('0x2d')))),_0xca25('0x2e')]]})[_0xca25('0x1a')](function(_0x3c554f){logger['info'](_0xca25('0x1c'),_0x8cec43);logger[_0xca25('0xd')](_0xca25('0x1c'),_0x8cec43,JSON[_0xca25('0x1b')](_0x3c554f));_0x2f1f2a(_0x3c554f);})[_0xca25('0x14')](function(_0x10874c){logger[_0xca25('0xf')]('AvgHandleTime',_0x10874c['message'],_0x8cec43);_0x349364(_0xb934da[_0xca25('0xf')](0x1f4,_0x10874c[_0xca25('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x57c462){var _0x7d57bd=this;return new Promise(function(_0x3c51a3,_0x321272){return db['CmHopperHistory'][_0xca25('0x1d')]({'raw':_0x57c462[_0xca25('0x19')]?_0x57c462[_0xca25('0x19')][_0xca25('0x1e')]===undefined?!![]:![]:!![],'where':_0x57c462[_0xca25('0x19')]?_0x57c462[_0xca25('0x19')]['where']||null:null,'attributes':[[_0xca25('0x2f'),'name'],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x30')))),_0xca25('0x31')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db['sequelize']['fn']('IF',db[_0xca25('0x21')]['literal'](_0xca25('0x32')))),'outboundNoAnswerCallsDay'],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')]['literal'](_0xca25('0x25')))),'outboundAnswerCallsDay'],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db['sequelize']['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x33')))),_0xca25('0x34')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db['sequelize'][_0xca25('0x24')](_0xca25('0x35')))),'outboundCongestionCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x36')))),_0xca25('0x37')],[db['sequelize']['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xca25('0x38')],[db['sequelize']['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x39')))),_0xca25('0x3a')],[db['sequelize']['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x3b')))),_0xca25('0x3c')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x3d')))),_0xca25('0x3e')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),_0xca25('0x3f')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db['sequelize'][_0xca25('0x24')](_0xca25('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')]['fn']('IF',db[_0xca25('0x21')]['literal'](_0xca25('0x41')))),'outboundRejectCallsDay'],[db[_0xca25('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xca25('0x21')][_0xca25('0x24')](_0xca25('0x42')))),_0xca25('0x43')]],'group':['campaign']})['then'](function(_0xfaf8f5){logger['info'](_0xca25('0x44'),_0x57c462);logger[_0xca25('0xd')](_0xca25('0x44'),_0x57c462,JSON[_0xca25('0x1b')](_0xfaf8f5));_0x3c51a3(_0xfaf8f5);})[_0xca25('0x14')](function(_0x4d2f9c){logger['error'](_0xca25('0x44'),_0x4d2f9c[_0xca25('0x11')],_0x57c462);_0x321272(_0x7d57bd[_0xca25('0xf')](0x1f4,_0x4d2f9c[_0xca25('0x11')]));});});};exports[_0xca25('0x45')]=function(_0x46e254){var _0x57a0ec=this;return new Promise(function(_0x25ba04,_0x3abda1){return db[_0xca25('0x16')][_0xca25('0x1d')]({'raw':_0x46e254[_0xca25('0x19')]?_0x46e254[_0xca25('0x19')][_0xca25('0x1e')]===undefined?!![]:![]:!![],'where':_0x46e254[_0xca25('0x19')]?_0x46e254[_0xca25('0x19')]['where']||null:null,'attributes':[[_0xca25('0x2f'),_0xca25('0x46')],[db[_0xca25('0x21')]['fn'](_0xca25('0x20'),db[_0xca25('0x21')][_0xca25('0x22')]('id')),_0xca25('0x47')],[db[_0xca25('0x21')]['fn']('COUNT',db[_0xca25('0x21')]['fn']('IF',db['sequelize'][_0xca25('0x24')](_0xca25('0x25')))),_0xca25('0x48')]],'group':['campaign']})['then'](function(_0x575e02){logger[_0xca25('0xb')](_0xca25('0x45'),_0x46e254);logger[_0xca25('0xd')](_0xca25('0x45'),_0x46e254,JSON[_0xca25('0x1b')](_0x575e02));_0x25ba04(_0x575e02);})[_0xca25('0x14')](function(_0x2f3025){logger[_0xca25('0xf')]('GetCampaignHopperHistory',_0x2f3025[_0xca25('0x11')],_0x46e254);_0x3abda1(_0x57a0ec['error'](0x1f4,_0x2f3025['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fafe18e..c0462d0 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 _0x9957=['create','put','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x5d3d72,_0x1df620){var _0x5d2e5a=function(_0x133988){while(--_0x133988){_0x5d3d72['push'](_0x5d3d72['shift']());}};_0x5d2e5a(++_0x1df620);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['update']);module[_0x7995('0x11')]=router; \ No newline at end of file +var _0x3f27=['show','post','create','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id'];(function(_0x4ed361,_0x34abe9){var _0x2aebcb=function(_0x92912f){while(--_0x92912f){_0x4ed361['push'](_0x4ed361['shift']());}};_0x2aebcb(++_0x34abe9);}(_0x3f27,0x1f4));var _0x73f2=function(_0x298e25,_0xb191a3){_0x298e25=_0x298e25-0x0;var _0x4fd565=_0x3f27[_0x298e25];return _0x4fd565;};'use strict';var multer=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var path=require(_0x73f2('0x2'));var timeout=require(_0x73f2('0x3'));var express=require(_0x73f2('0x4'));var router=express['Router']();var auth=require(_0x73f2('0x5'));var interaction=require(_0x73f2('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x73f2('0x7')](),controller[_0x73f2('0x8')]);router[_0x73f2('0x9')](_0x73f2('0xa'),auth[_0x73f2('0x7')](),controller['describe']);router['get'](_0x73f2('0xb'),auth[_0x73f2('0x7')](),controller[_0x73f2('0xc')]);router[_0x73f2('0xd')]('/',auth[_0x73f2('0x7')](),controller[_0x73f2('0xe')]);router['put'](_0x73f2('0xb'),auth[_0x73f2('0x7')](),controller[_0x73f2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ad0398d..bd8a620 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 _0xda19=['STRING','exports'];(function(_0xd4fdb6,_0x4c712e){var _0x1dfa6e=function(_0x2f1414){while(--_0x2f1414){_0xd4fdb6['push'](_0xd4fdb6['shift']());}};_0x1dfa6e(++_0x4c712e);}(_0xda19,0xd5));var _0x9da1=function(_0x4a063f,_0x4af6e4){_0x4a063f=_0x4a063f-0x0;var _0x45f92f=_0xda19[_0x4a063f];return _0x45f92f;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c5a=['exports','name','STRING','sequelize'];(function(_0x20025e,_0x44c8e1){var _0x4a5ac4=function(_0x359a69){while(--_0x359a69){_0x20025e['push'](_0x20025e['shift']());}};_0x4a5ac4(++_0x44c8e1);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x20d57c,_0x561fce){_0x20d57c=_0x20d57c-0x0;var _0x20e407=_0x9c5a[_0x20d57c];return _0x20e407;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa9c5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa9c5('0x3')]},'dialPrefix':{'type':Sequelize[_0xa9c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0e6d16e..5cba9ae 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 _0x9c44=['query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','CmList','includeAll','include','findAll','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addContacts','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','concat','CustomFields','format','cf_%d','hasOwnProperty','getContactsCsv','CmContact','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','CmCustomField','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','rawAttributes','model','keys'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x49c4('0x13')]=_[_0x49c4('0x14')](config['redis'],{'host':_0x49c4('0x15'),'port':0x18eb});var socket=require(_0x49c4('0x16'))(new Redis(config['redis']));require(_0x49c4('0x17'))[_0x49c4('0x18')](socket);function respondWithStatusCode(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xcc;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x19')](_0x2decee);}return _0x21f15a[_0x49c4('0x1a')](_0x2decee)[_0x49c4('0x1b')]();};}function respondWithResult(_0x58d177,_0x3acd06){_0x3acd06=_0x3acd06||0xc8;return function(_0x141003){if(_0x141003){return _0x58d177[_0x49c4('0x1a')](_0x3acd06)[_0x49c4('0x1c')](_0x141003);}};}function respondWithFilteredResult(_0x2abc78,_0x53e3a2){return function(_0x44e607){if(_0x44e607){var _0x2891f4=_0x44e607[_0x49c4('0x1d')],_0x4c3253=_0x53e3a2[_0x49c4('0x1e')],_0x512650=_0x53e3a2['offset']+_0x53e3a2[_0x49c4('0x1f')],_0x3c782d;if(_0x512650>=_0x2891f4){_0x512650=_0x2891f4;_0x3c782d=0xc8;}else{_0x3c782d=0xce;}_0x2abc78['status'](_0x3c782d);return _0x2abc78[_0x49c4('0x20')](_0x49c4('0x21'),_0x4c3253+'-'+_0x512650+'/'+_0x2891f4)[_0x49c4('0x1c')](_0x44e607);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x22')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x23')](_0x280893);}return _0x382040[_0x49c4('0x24')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x25')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x26')]()['then'](function(){var _0x5850f2=_0x26c640[_0x49c4('0x27')]({'plain':!![]});var _0x9cb797='Lists';return db[_0x49c4('0x28')][_0x49c4('0x26')]({'where':{'type':_0x9cb797,'resourceId':_0x5850f2['id']}})[_0x49c4('0x29')](function(){return _0x26c640;});})[_0x49c4('0x29')](function(){_0x2263ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x449960,_0x53c199){return function(_0x3800b7){if(!_0x3800b7){_0x449960[_0x49c4('0x19')](0x194);}return _0x3800b7;};}function handleError(_0x3f1708,_0x372a47){_0x372a47=_0x372a47||0x1f4;return function(_0x5987ae){logger[_0x49c4('0x2a')](_0x5987ae[_0x49c4('0x2b')]);if(_0x5987ae[_0x49c4('0x2c')]){delete _0x5987ae[_0x49c4('0x2c')];}_0x3f1708[_0x49c4('0x1a')](_0x372a47)[_0x49c4('0x2d')](_0x5987ae);};}exports[_0x49c4('0x2e')]=function(_0x427b26,_0x17b50f){var _0x2cbd88={},_0x46f7ea={},_0x4ea6ea={'count':0x0,'rows':[]};var _0x4f4495=db['CmList'][_0x49c4('0x2f')];_0x46f7ea[_0x49c4('0x30')]=_[_0x49c4('0x31')](_0x4f4495);_0x46f7ea[_0x49c4('0x32')]=_[_0x49c4('0x31')](_0x427b26['query']);_0x46f7ea[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x46f7ea[_0x49c4('0x30')],_0x46f7ea[_0x49c4('0x32')]);_0x2cbd88['attributes']=_['intersection'](_0x46f7ea[_0x49c4('0x30')],qs[_0x49c4('0x35')](_0x427b26[_0x49c4('0x32')][_0x49c4('0x35')]));_0x2cbd88[_0x49c4('0x36')]=_0x2cbd88['attributes'][_0x49c4('0x37')]?_0x2cbd88[_0x49c4('0x36')]:_0x46f7ea[_0x49c4('0x30')];if(!_0x427b26['query']['hasOwnProperty'](_0x49c4('0x38'))){_0x2cbd88[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x427b26[_0x49c4('0x32')][_0x49c4('0x1f')]);_0x2cbd88[_0x49c4('0x1e')]=qs[_0x49c4('0x1e')](_0x427b26[_0x49c4('0x32')][_0x49c4('0x1e')]);}_0x2cbd88['order']=qs[_0x49c4('0x39')](_0x427b26['query'][_0x49c4('0x39')]);_0x2cbd88[_0x49c4('0x3a')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3b')](_0x427b26['query'],_0x46f7ea[_0x49c4('0x33')]));if(_0x427b26[_0x49c4('0x32')][_0x49c4('0x3c')]){_0x2cbd88['where']=_[_0x49c4('0x3d')](_0x2cbd88[_0x49c4('0x3a')],{'$or':_[_0x49c4('0x3e')](_0x4f4495,function(_0x5e5366){if(_0x5e5366[_0x49c4('0x3f')][_0x49c4('0x40')]!==_0x49c4('0x41')){var _0x2ba76a={};_0x2ba76a[_0x5e5366[_0x49c4('0x42')]]={'$like':'%'+_0x427b26[_0x49c4('0x32')][_0x49c4('0x3c')]+'%'};return _0x2ba76a;}})});}_0x2cbd88=_['merge']({},_0x2cbd88,_0x427b26[_0x49c4('0x43')]);var _0x20cd21={'where':_0x2cbd88[_0x49c4('0x3a')]};return db[_0x49c4('0x44')][_0x49c4('0x1d')](_0x20cd21)[_0x49c4('0x29')](function(_0x1be62d){_0x4ea6ea[_0x49c4('0x1d')]=_0x1be62d;if(_0x427b26[_0x49c4('0x32')][_0x49c4('0x45')]){_0x2cbd88[_0x49c4('0x46')]=[{'all':!![]}];}return db[_0x49c4('0x44')][_0x49c4('0x47')](_0x2cbd88);})['then'](function(_0x212366){_0x4ea6ea['rows']=_0x212366;return _0x4ea6ea;})[_0x49c4('0x29')](respondWithFilteredResult(_0x17b50f,_0x2cbd88))[_0x49c4('0x48')](handleError(_0x17b50f,null));};exports[_0x49c4('0x49')]=function(_0x1480da,_0x239327){var _0x281b83={'raw':![],'where':{'id':_0x1480da['params']['id']}},_0x4cbd0d={};_0x4cbd0d[_0x49c4('0x30')]=_[_0x49c4('0x31')](db[_0x49c4('0x44')][_0x49c4('0x2f')]);_0x4cbd0d['query']=_[_0x49c4('0x31')](_0x1480da[_0x49c4('0x32')]);_0x4cbd0d[_0x49c4('0x33')]=_[_0x49c4('0x34')](_0x4cbd0d[_0x49c4('0x30')],_0x4cbd0d[_0x49c4('0x32')]);_0x281b83[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x4cbd0d[_0x49c4('0x30')],qs['fields'](_0x1480da[_0x49c4('0x32')]['fields']));_0x281b83[_0x49c4('0x36')]=_0x281b83[_0x49c4('0x36')][_0x49c4('0x37')]?_0x281b83[_0x49c4('0x36')]:_0x4cbd0d[_0x49c4('0x30')];if(_0x1480da['query'][_0x49c4('0x45')]){_0x281b83[_0x49c4('0x46')]=[{'all':!![]}];}_0x281b83=_[_0x49c4('0x3d')]({},_0x281b83,_0x1480da[_0x49c4('0x43')]);return db[_0x49c4('0x44')][_0x49c4('0x4a')](_0x281b83)[_0x49c4('0x29')](handleEntityNotFound(_0x239327,null))['then'](respondWithResult(_0x239327,null))[_0x49c4('0x48')](handleError(_0x239327,null));};exports['create']=function(_0x3f7379,_0x906d3){return db[_0x49c4('0x44')][_0x49c4('0x4b')](_0x3f7379[_0x49c4('0x4c')],{})[_0x49c4('0x29')](function(_0x2c6be1){var _0x506c71=_0x3f7379[_0x49c4('0x4d')][_0x49c4('0x27')]({'plain':!![]});if(!_0x506c71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x506c71[_0x49c4('0x4e')]===_0x49c4('0x4d')){var _0xfbe179=_0x2c6be1[_0x49c4('0x27')]({'plain':!![]});var _0x52a8f7='Lists';return db[_0x49c4('0x4f')]['find']({'where':{'name':_0x52a8f7,'userProfileId':_0x506c71[_0x49c4('0x50')]},'raw':!![]})[_0x49c4('0x29')](function(_0x3811b2){if(_0x3811b2&&_0x3811b2[_0x49c4('0x51')]===0x0){return db[_0x49c4('0x28')][_0x49c4('0x4b')]({'name':_0xfbe179[_0x49c4('0x2c')],'resourceId':_0xfbe179['id'],'type':_0x3811b2['name'],'sectionId':_0x3811b2['id']},{})[_0x49c4('0x29')](function(){return _0x2c6be1;});}else{return _0x2c6be1;}})[_0x49c4('0x48')](function(_0x3936d3){logger[_0x49c4('0x2a')](_0x49c4('0x52'),_0x3936d3);throw _0x3936d3;});}return _0x2c6be1;})[_0x49c4('0x29')](respondWithResult(_0x906d3,0xc9))[_0x49c4('0x48')](handleError(_0x906d3,null));};exports[_0x49c4('0x25')]=function(_0x1e0b4f,_0x1856be){if(_0x1e0b4f['body']['id']){delete _0x1e0b4f['body']['id'];}return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x1e0b4f['params']['id']}})['then'](handleEntityNotFound(_0x1856be,null))[_0x49c4('0x29')](saveUpdates(_0x1e0b4f['body'],null))['then'](respondWithResult(_0x1856be,null))[_0x49c4('0x48')](handleError(_0x1856be,null));};exports[_0x49c4('0x26')]=function(_0x4a0a93,_0x38c480){return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x4a0a93[_0x49c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x38c480,null))[_0x49c4('0x29')](removeEntity(_0x38c480,null))[_0x49c4('0x48')](handleError(_0x38c480,null));};exports[_0x49c4('0x54')]=function(_0x208208,_0x73840f){return db[_0x49c4('0x44')]['describe']()['then'](respondWithResult(_0x73840f,null))[_0x49c4('0x48')](handleError(_0x73840f,null));};exports[_0x49c4('0x55')]=function(_0x2a6308,_0xf7a10f,_0x23288e){if(_0x2a6308[_0x49c4('0x4c')]['id']){delete _0x2a6308[_0x49c4('0x4c')]['id'];}return db['CmList'][_0x49c4('0x4a')]({'where':{'id':_0x2a6308[_0x49c4('0x53')]['id']}})['then'](handleEntityNotFound(_0xf7a10f,null))[_0x49c4('0x29')](function(_0x53690f){if(_0x53690f){_0x2a6308[_0x49c4('0x4c')][_0x49c4('0x56')]=_0x53690f['id'];return db[_0x49c4('0x57')][_0x49c4('0x4b')](_0x2a6308[_0x49c4('0x4c')]);}})[_0x49c4('0x29')](respondWithResult(_0xf7a10f,null))[_0x49c4('0x48')](handleError(_0xf7a10f,null));};exports[_0x49c4('0x58')]=function(_0x483770,_0x3894e0,_0x27b9c2){var _0x59dc8d={'raw':![],'where':{}};var _0x10dec7={};var _0x299e74={'count':0x0,'rows':[]};return db['CmList'][_0x49c4('0x59')]({'where':{'id':_0x483770[_0x49c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x3894e0,null))['then'](function(_0x589484){if(_0x589484){_0x10dec7['model']=_[_0x49c4('0x31')](db['Disposition'][_0x49c4('0x2f')]);_0x10dec7[_0x49c4('0x32')]=_['keys'](_0x483770[_0x49c4('0x32')]);_0x10dec7[_0x49c4('0x33')]=_['intersection'](_0x10dec7[_0x49c4('0x30')],_0x10dec7[_0x49c4('0x32')]);_0x59dc8d[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x10dec7['model'],qs[_0x49c4('0x35')](_0x483770[_0x49c4('0x32')][_0x49c4('0x35')]));_0x59dc8d[_0x49c4('0x36')]=_0x59dc8d['attributes'][_0x49c4('0x37')]?_0x59dc8d['attributes']:_0x10dec7['model'];if(!_0x483770['query']['hasOwnProperty'](_0x49c4('0x38'))){_0x59dc8d[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x483770[_0x49c4('0x32')]['limit']);_0x59dc8d['offset']=qs[_0x49c4('0x1e')](_0x483770[_0x49c4('0x32')][_0x49c4('0x1e')]);}_0x59dc8d[_0x49c4('0x5a')]=qs[_0x49c4('0x39')](_0x483770[_0x49c4('0x32')][_0x49c4('0x39')]);_0x59dc8d[_0x49c4('0x3a')]=qs['filters'](_[_0x49c4('0x3b')](_0x483770['query'],_0x10dec7[_0x49c4('0x33')]));_0x59dc8d[_0x49c4('0x3a')][_0x49c4('0x56')]=_0x589484['id'];if(_0x483770[_0x49c4('0x32')][_0x49c4('0x3c')]){_0x59dc8d[_0x49c4('0x3a')]=_[_0x49c4('0x3d')](_0x59dc8d[_0x49c4('0x3a')],{'$or':_[_0x49c4('0x3e')](_0x59dc8d[_0x49c4('0x36')],function(_0x1e3911){var _0x1c5315={};_0x1c5315[_0x1e3911]={'$like':'%'+_0x483770[_0x49c4('0x32')][_0x49c4('0x3c')]+'%'};return _0x1c5315;})});}_0x59dc8d=_[_0x49c4('0x3d')]({},_0x59dc8d,_0x483770[_0x49c4('0x43')]);return db[_0x49c4('0x57')][_0x49c4('0x1d')]({'where':_0x59dc8d['where']})['then'](function(_0x10f2ec){_0x299e74[_0x49c4('0x1d')]=_0x10f2ec;if(_0x483770['query'][_0x49c4('0x45')]){_0x59dc8d[_0x49c4('0x46')]=[{'all':!![]}];}return db[_0x49c4('0x57')][_0x49c4('0x47')](_0x59dc8d);})['then'](function(_0x5a14a5){_0x299e74['rows']=_0x5a14a5;return _0x299e74;});}})[_0x49c4('0x29')](respondWithFilteredResult(_0x3894e0,_0x59dc8d))[_0x49c4('0x48')](handleError(_0x3894e0,null));};exports[_0x49c4('0x5b')]=function(_0x2f4289,_0x118fc4,_0x146706){return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x2f4289[_0x49c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x118fc4,null))[_0x49c4('0x29')](function(_0x10fb84){if(_0x10fb84){return _0x10fb84[_0x49c4('0x5b')](_0x2f4289['query'][_0x49c4('0x5c')]);}})[_0x49c4('0x29')](respondWithStatusCode(_0x118fc4,null))[_0x49c4('0x48')](handleError(_0x118fc4,null));};exports[_0x49c4('0x5d')]=function(_0x1f25be,_0x2fd749,_0x35fa39){return db[_0x49c4('0x44')]['find']({'where':{'id':_0x1f25be[_0x49c4('0x53')]['id']}})[_0x49c4('0x29')](handleEntityNotFound(_0x2fd749,null))[_0x49c4('0x29')](function(_0x18e82b){if(_0x18e82b){var _0x1e948a=[];var _0x4a204d={'success':[],'errors':[]};return db['CmContact'][_0x49c4('0x54')]()['then'](function(_0x34cf49){if(_0x1f25be['body'][_0x49c4('0x5e')]&&_[_0x49c4('0x5f')](_0x1f25be[_0x49c4('0x4c')][_0x49c4('0x5e')])){if(_0x1f25be['body'][_0x49c4('0x5e')][_0x49c4('0x37')]){_0x1f25be[_0x49c4('0x4c')][_0x49c4('0x5e')]=_0x1f25be[_0x49c4('0x4c')][_0x49c4('0x5e')][_0x49c4('0x60')](';')+';';}else{_0x1f25be[_0x49c4('0x4c')][_0x49c4('0x5e')]=null;}}else{_0x1f25be[_0x49c4('0x4c')]['tags']=null;}if(_0x1f25be[_0x49c4('0x4c')]&&_[_0x49c4('0x5f')](_0x1f25be['body'])){for(var _0x15bee0=0x0;_0x15bee0<_0x1f25be['body'][_0x49c4('0x37')];_0x15bee0+=0x1){_0x1f25be[_0x49c4('0x4c')][_0x15bee0][_0x49c4('0x56')]=_0x1f25be[_0x49c4('0x53')]['id'];_0x1e948a[_0x49c4('0x61')](_0x1f25be['body'][_0x15bee0]);}return BPromise[_0x49c4('0x62')](_0x1e948a,function(_0x2329b6){return db['CmContact'][_0x49c4('0x4b')](_[_0x49c4('0x63')](_0x2329b6,['ids','id'])||{},{'fields':_[_0x49c4('0x31')](_0x34cf49),'raw':!![]})[_0x49c4('0x29')](function(_0x57b137){_0x4a204d[_0x49c4('0x64')][_0x49c4('0x61')](_0x57b137[_0x49c4('0x65')]);})[_0x49c4('0x48')](function(_0x4e1364){_0x4a204d[_0x49c4('0x66')][_0x49c4('0x61')]({'data':_0x2329b6,'error':_0x4e1364['message']});});})[_0x49c4('0x29')](function(_0x5f0188){return _0x4a204d;})['catch'](function(_0x32e27e){return _0x32e27e;});}else{_0x2fd749['status'](0x190)['json']({'message':_0x49c4('0x67')});}});}})[_0x49c4('0x29')](respondWithResult(_0x2fd749,null))['catch'](handleError(_0x2fd749,null));};exports[_0x49c4('0x68')]=function(_0x5c3509,_0x578f4b,_0x4c4bed){var _0x10d107;return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x5c3509[_0x49c4('0x53')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x49c4('0x29')](handleEntityNotFound(_0x578f4b,null))['then'](function(_0x2c560e){if(_0x2c560e){_0x10d107=_0x2c560e;return db['CmContact'][_0x49c4('0x2f')];}})[_0x49c4('0x29')](function(_0x1efb19){if(_0x1efb19){var _0x1076be={};var _0x12d060={};_0x12d060[_0x49c4('0x30')]=_[_0x49c4('0x69')](_['keys'](_0x1efb19),_[_0x49c4('0x3e')](_0x10d107[_0x49c4('0x6a')],function(_0x44a188){return util[_0x49c4('0x6b')](_0x49c4('0x6c'),_0x44a188['id']);}));_0x12d060['query']=_[_0x49c4('0x31')](_0x5c3509[_0x49c4('0x32')]);_0x12d060[_0x49c4('0x33')]=_['intersection'](_0x12d060['model'],_0x12d060[_0x49c4('0x32')]);_0x1076be[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x12d060[_0x49c4('0x30')],qs[_0x49c4('0x35')](_0x5c3509['query'][_0x49c4('0x35')]));_0x1076be[_0x49c4('0x36')]=_0x1076be[_0x49c4('0x36')][_0x49c4('0x37')]?_0x1076be['attributes']:_0x12d060['model'];if(!_0x5c3509[_0x49c4('0x32')][_0x49c4('0x6d')](_0x49c4('0x38'))){_0x1076be[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x5c3509['query'][_0x49c4('0x1f')]);_0x1076be[_0x49c4('0x1e')]=qs[_0x49c4('0x1e')](_0x5c3509[_0x49c4('0x32')][_0x49c4('0x1e')]);}_0x1076be[_0x49c4('0x5a')]=qs['sort'](_0x5c3509[_0x49c4('0x32')][_0x49c4('0x39')]);_0x1076be[_0x49c4('0x3a')]=qs[_0x49c4('0x33')](_['pick'](_0x5c3509['query'],_0x12d060[_0x49c4('0x33')]));_0x1076be['raw']=!![];if(_0x5c3509[_0x49c4('0x32')]['filter']){_0x1076be[_0x49c4('0x3a')]=_[_0x49c4('0x3d')](_0x1076be[_0x49c4('0x3a')],{'$or':_[_0x49c4('0x3e')](_0x1076be['attributes'],function(_0x4ad966){var _0x2e352e={};_0x2e352e[_0x4ad966]={'$like':'%'+_0x5c3509[_0x49c4('0x32')][_0x49c4('0x3c')]+'%'};return _0x2e352e;})});}_0x1076be=_['merge']({},_0x1076be,_0x5c3509['options']);return _0x10d107[_0x49c4('0x68')](_0x1076be);}})['then'](respondWithResult(_0x578f4b,null))['catch'](handleError(_0x578f4b,null));};exports[_0x49c4('0x6e')]=function(_0x5a2858,_0x22668b,_0x3cfa95){var _0x4fc419;return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x5a2858['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x49c4('0x6a')}]})['then'](handleEntityNotFound(_0x22668b,null))[_0x49c4('0x29')](function(_0x3b577b){if(_0x3b577b){_0x4fc419=_0x3b577b;return db[_0x49c4('0x6f')][_0x49c4('0x2f')];}})[_0x49c4('0x29')](function(_0x4483fc){if(_0x4483fc){var _0x2ecc6d={};var _0x5f07fa={};_0x5f07fa[_0x49c4('0x30')]=_[_0x49c4('0x69')](_[_0x49c4('0x31')](_0x4483fc),_[_0x49c4('0x3e')](_0x4fc419[_0x49c4('0x6a')],function(_0x5795e8){return util[_0x49c4('0x6b')]('cf_%d',_0x5795e8['id']);}));_0x5f07fa[_0x49c4('0x32')]=_[_0x49c4('0x31')](_0x5a2858[_0x49c4('0x32')]);_0x5f07fa[_0x49c4('0x33')]=_['intersection'](_0x5f07fa[_0x49c4('0x30')],_0x5f07fa[_0x49c4('0x32')]);_0x2ecc6d[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x5f07fa[_0x49c4('0x30')],qs[_0x49c4('0x35')](_0x5a2858['query'][_0x49c4('0x35')]));_0x2ecc6d['attributes']=_0x2ecc6d[_0x49c4('0x36')][_0x49c4('0x37')]?_0x2ecc6d[_0x49c4('0x36')]:_0x5f07fa[_0x49c4('0x30')];if(!_0x5a2858['query'][_0x49c4('0x6d')](_0x49c4('0x38'))){_0x2ecc6d['limit']=qs[_0x49c4('0x1f')](_0x5a2858[_0x49c4('0x32')]['limit']);_0x2ecc6d['offset']=qs[_0x49c4('0x1e')](_0x5a2858[_0x49c4('0x32')][_0x49c4('0x1e')]);}_0x2ecc6d[_0x49c4('0x5a')]=qs[_0x49c4('0x39')](_0x5a2858[_0x49c4('0x32')][_0x49c4('0x39')]);_0x2ecc6d[_0x49c4('0x3a')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3b')](_0x5a2858[_0x49c4('0x32')],_0x5f07fa['filters']));_0x2ecc6d['raw']=!![];if(_0x5a2858[_0x49c4('0x32')][_0x49c4('0x3c')]){_0x2ecc6d[_0x49c4('0x3a')]=_['merge'](_0x2ecc6d[_0x49c4('0x3a')],{'$or':_[_0x49c4('0x3e')](_0x2ecc6d['attributes'],function(_0xb082f4){var _0x5f44d2={};_0x5f44d2[_0xb082f4]={'$like':'%'+_0x5a2858[_0x49c4('0x32')][_0x49c4('0x3c')]+'%'};return _0x5f44d2;})});}_0x2ecc6d=_[_0x49c4('0x3d')]({},_0x2ecc6d,_0x5a2858[_0x49c4('0x43')]);return _0x4fc419['getContacts'](_0x2ecc6d);}})[_0x49c4('0x29')](function(_0x44a9e2){if(!_[_0x49c4('0x70')](_0x44a9e2)){var _0x431ff1=toCsv(_0x44a9e2);var _0x44a7e3=Date['now']();fs['writeFileSync'](util['format'](_0x49c4('0x71'),_0x4fc419['id'],_0x44a7e3),_0x431ff1);_0x22668b[_0x49c4('0x72')](_0x49c4('0x73'),_0x49c4('0x74')+util[_0x49c4('0x6b')]('list_%d_%s.csv',_0x4fc419['id'],_0x44a7e3));_0x22668b[_0x49c4('0x72')](_0x49c4('0x75'),_0x49c4('0x76'));return _0x22668b[_0x49c4('0x77')](util['format'](_0x49c4('0x71'),_0x4fc419['id'],_0x44a7e3));}else{return _0x22668b[_0x49c4('0x19')](0xcc);}})[_0x49c4('0x48')](handleError(_0x22668b,null));};exports[_0x49c4('0x78')]=function(_0x2fda4f,_0x561535,_0x1d9e1a){var _0x9b622d;delete _0x2fda4f[_0x49c4('0x4c')]['id'];return db['CmList'][_0x49c4('0x59')]({'where':{'id':_0x2fda4f[_0x49c4('0x53')]['id']}})[_0x49c4('0x29')](handleEntityNotFound(_0x561535,null))['then'](function(_0x97f579){if(_0x97f579){return db['sequelize']['transaction'](function(_0x2c2c7c){return db[_0x49c4('0x79')]['create'](_0x2fda4f[_0x49c4('0x4c')],{'transaction':_0x2c2c7c})[_0x49c4('0x29')](function(_0xf0bb4f){_0x9b622d=_0xf0bb4f;return _0x97f579[_0x49c4('0x7a')](_0xf0bb4f,{'transaction':_0x2c2c7c});})[_0x49c4('0x29')](function(){var _0x3a7559={'type':db[_0x49c4('0x7b')][_0x49c4('0x7c')],'transaction':_0x2c2c7c};switch(_0x2fda4f['body']['type']){case _0x49c4('0x7d'):_0x3a7559[_0x49c4('0x3f')]=db[_0x49c4('0x7b')]['TEXT'];break;case'number':_0x3a7559[_0x49c4('0x3f')]=db[_0x49c4('0x7b')][_0x49c4('0x7e')];break;case _0x49c4('0x7f'):_0x3a7559[_0x49c4('0x3f')]=db[_0x49c4('0x7b')][_0x49c4('0x80')];_0x3a7559[_0x49c4('0x81')]=![];break;default:}return db[_0x49c4('0x82')][_0x49c4('0x83')][_0x49c4('0x84')](_0x49c4('0x85'),util[_0x49c4('0x6b')](_0x49c4('0x86'),_0x9b622d['id']),_0x3a7559);})['then'](function(){return _0x9b622d;});});}})[_0x49c4('0x29')](respondWithResult(_0x561535,null))[_0x49c4('0x48')](handleError(_0x561535,null));};exports[_0x49c4('0x87')]=function(_0x318aaf,_0x4fc4c9,_0x53b6c3){var _0xb4a33d={};var _0x592cba={};var _0xfe2319;var _0x1ac087;return db[_0x49c4('0x44')][_0x49c4('0x59')]({'where':{'id':_0x318aaf[_0x49c4('0x53')]['id']}})[_0x49c4('0x29')](handleEntityNotFound(_0x4fc4c9,null))[_0x49c4('0x29')](function(_0xe9e187){if(_0xe9e187){_0xfe2319=_0xe9e187;_0x592cba[_0x49c4('0x30')]=_[_0x49c4('0x31')](db[_0x49c4('0x79')][_0x49c4('0x2f')]);_0x592cba['query']=_[_0x49c4('0x31')](_0x318aaf[_0x49c4('0x32')]);_0x592cba[_0x49c4('0x33')]=_['intersection'](_0x592cba[_0x49c4('0x30')],_0x592cba['query']);_0xb4a33d[_0x49c4('0x36')]=_[_0x49c4('0x34')](_0x592cba[_0x49c4('0x30')],qs[_0x49c4('0x35')](_0x318aaf['query'][_0x49c4('0x35')]));_0xb4a33d['attributes']=_0xb4a33d['attributes'][_0x49c4('0x37')]?_0xb4a33d[_0x49c4('0x36')]:_0x592cba[_0x49c4('0x30')];_0xb4a33d['order']=qs['sort'](_0x318aaf[_0x49c4('0x32')][_0x49c4('0x39')]);_0xb4a33d[_0x49c4('0x3a')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3b')](_0x318aaf[_0x49c4('0x32')],_0x592cba[_0x49c4('0x33')]));_0xb4a33d[_0x49c4('0x3a')]=_[_0x49c4('0x3d')](_0xb4a33d['where'],{'$or':[{'ListId':_0xe9e187['id']},{'ListId':null}]});if(_0x318aaf[_0x49c4('0x32')][_0x49c4('0x3c')]){_0xb4a33d['where']=_['merge'](_0xb4a33d[_0x49c4('0x3a')],{'$or':_['map'](_0xb4a33d[_0x49c4('0x36')],function(_0x4d278d){var _0x369679={};_0x369679[_0x4d278d]={'$like':'%'+_0x318aaf['query'][_0x49c4('0x3c')]+'%'};return _0x369679;})});}_0xb4a33d=_[_0x49c4('0x3d')]({},_0xb4a33d,_0x318aaf[_0x49c4('0x43')]);return db[_0x49c4('0x79')]['findAndCountAll'](_0xb4a33d);}})['then'](respondWithResult(_0x4fc4c9,null))[_0x49c4('0x48')](handleError(_0x4fc4c9,null));};exports[_0x49c4('0x88')]=function(_0x3ce256,_0x5737b4,_0x367d3d){return db[_0x49c4('0x44')]['find']({'where':{'id':_0x3ce256['params']['id']}})[_0x49c4('0x29')](handleEntityNotFound(_0x5737b4,null))[_0x49c4('0x29')](function(_0xa0698d){if(_0xa0698d){return _0xa0698d['addAgents'](_0x3ce256[_0x49c4('0x4c')][_0x49c4('0x5c')],_[_0x49c4('0x63')](_0x3ce256[_0x49c4('0x4c')],['ids','id'])||{})[_0x49c4('0x89')](function(_0x4a708e){for(var _0x4d0a28=0x0;_0x4d0a28<_0x3ce256[_0x49c4('0x4c')][_0x49c4('0x5c')][_0x49c4('0x37')];_0x4d0a28+=0x1){socket[_0x49c4('0x8a')]('userCmList:save',{'UserId':_0x3ce256[_0x49c4('0x4c')][_0x49c4('0x5c')][_0x4d0a28],'CmListId':_0x3ce256[_0x49c4('0x53')]['id']});}return _0x4a708e;});}})[_0x49c4('0x29')](respondWithResult(_0x5737b4,null))['catch'](handleError(_0x5737b4,null));};exports[_0x49c4('0x8b')]=function(_0x56e33b,_0x54db51,_0x29f48d){return db[_0x49c4('0x44')][_0x49c4('0x4a')]({'where':{'id':_0x56e33b['params']['id']}})[_0x49c4('0x29')](handleEntityNotFound(_0x54db51,null))['then'](function(_0x30b616){if(_0x30b616){return _0x30b616[_0x49c4('0x8b')](_0x56e33b[_0x49c4('0x32')][_0x49c4('0x5c')])[_0x49c4('0x29')](function(){if(_[_0x49c4('0x5f')](_0x56e33b[_0x49c4('0x32')]['ids'])){for(var _0x3808e6=0x0;_0x3808e6<_0x56e33b[_0x49c4('0x32')][_0x49c4('0x5c')][_0x49c4('0x37')];_0x3808e6+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x56e33b['query'][_0x49c4('0x5c')][_0x3808e6]),'CmListId':Number(_0x56e33b[_0x49c4('0x53')]['id'])});}}else{socket[_0x49c4('0x8a')](_0x49c4('0x8c'),{'UserId':Number(_0x56e33b[_0x49c4('0x32')][_0x49c4('0x5c')]),'CmListId':Number(_0x56e33b[_0x49c4('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x54db51,null))[_0x49c4('0x48')](handleError(_0x54db51,null));};exports[_0x49c4('0x8d')]=function(_0x565476,_0x479246,_0x4dbb25){var _0x8395b0={};var _0x1294e6={};var _0x145b3f;var _0x3d0013;return db[_0x49c4('0x44')][_0x49c4('0x59')]({'where':{'id':_0x565476[_0x49c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x479246,null))[_0x49c4('0x29')](function(_0x3226c4){if(_0x3226c4){_0x145b3f=_0x3226c4;_0x1294e6[_0x49c4('0x30')]=_[_0x49c4('0x31')](db['User'][_0x49c4('0x2f')]);_0x1294e6[_0x49c4('0x32')]=_[_0x49c4('0x31')](_0x565476[_0x49c4('0x32')]);_0x1294e6[_0x49c4('0x33')]=_['intersection'](_0x1294e6[_0x49c4('0x30')],_0x1294e6['query']);_0x8395b0['attributes']=_[_0x49c4('0x34')](_0x1294e6[_0x49c4('0x30')],qs[_0x49c4('0x35')](_0x565476[_0x49c4('0x32')][_0x49c4('0x35')]));_0x8395b0['attributes']=_0x8395b0[_0x49c4('0x36')][_0x49c4('0x37')]?_0x8395b0[_0x49c4('0x36')]:_0x1294e6['model'];_0x8395b0[_0x49c4('0x5a')]=qs[_0x49c4('0x39')](_0x565476['query'][_0x49c4('0x39')]);_0x8395b0[_0x49c4('0x3a')]=qs[_0x49c4('0x33')](_[_0x49c4('0x3b')](_0x565476[_0x49c4('0x32')],_0x1294e6[_0x49c4('0x33')]));if(_0x565476[_0x49c4('0x32')]['filter']){_0x8395b0[_0x49c4('0x3a')]=_[_0x49c4('0x3d')](_0x8395b0[_0x49c4('0x3a')],{'$or':_[_0x49c4('0x3e')](_0x8395b0[_0x49c4('0x36')],function(_0x49c583){var _0x34ce60={};_0x34ce60[_0x49c583]={'$like':'%'+_0x565476[_0x49c4('0x32')][_0x49c4('0x3c')]+'%'};return _0x34ce60;})});}_0x8395b0=_[_0x49c4('0x3d')]({},_0x8395b0,_0x565476[_0x49c4('0x43')]);return _0x145b3f['getAgents'](_0x8395b0);}})[_0x49c4('0x29')](function(_0xb14b89){if(_0xb14b89){_0x3d0013=_0xb14b89[_0x49c4('0x37')];if(!_0x565476[_0x49c4('0x32')][_0x49c4('0x6d')](_0x49c4('0x38'))){_0x8395b0[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x565476[_0x49c4('0x32')][_0x49c4('0x1f')]);_0x8395b0['offset']=qs[_0x49c4('0x1e')](_0x565476[_0x49c4('0x32')][_0x49c4('0x1e')]);}return _0x145b3f[_0x49c4('0x8d')](_0x8395b0);}})[_0x49c4('0x29')](function(_0x59de9c){if(_0x59de9c){return _0x59de9c?{'count':_0x3d0013,'rows':_0x59de9c}:null;}})['then'](respondWithResult(_0x479246,null))[_0x49c4('0x48')](handleError(_0x479246,null));}; \ No newline at end of file +var _0x9957=['spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','destroy','Lists','UserProfileResource','error','name','CmList','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','include','removeDispositions','addContacts','CmContact','tags','isArray','push','each','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','nolimit','raw','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','sequelize','Sequelize','TEXT','type','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','omit'];(function(_0x16fa8b,_0x2dab3d){var _0x58d1ac=function(_0x294bbe){while(--_0x294bbe){_0x16fa8b['push'](_0x16fa8b['shift']());}};_0x58d1ac(++_0x2dab3d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];config[_0x7995('0x19')]=_[_0x7995('0x1a')](config[_0x7995('0x19')],{'host':_0x7995('0x1b'),'port':0x18eb});var socket=require(_0x7995('0x1c'))(new Redis(config[_0x7995('0x19')]));require(_0x7995('0x1d'))['register'](socket);function respondWithStatusCode(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xcc;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1e')](_0x2b4e94);}return _0x58f5ad[_0x7995('0x1f')](_0x2b4e94)[_0x7995('0x20')]();};}function respondWithResult(_0x1a5310,_0x2202ce){_0x2202ce=_0x2202ce||0xc8;return function(_0x41cbf0){if(_0x41cbf0){return _0x1a5310['status'](_0x2202ce)[_0x7995('0x21')](_0x41cbf0);}};}function respondWithFilteredResult(_0x565d97,_0x2f832e){return function(_0x37f297){if(_0x37f297){var _0x43d4b8=_0x37f297['count'],_0x291317=_0x2f832e['offset'],_0x1e1415=_0x2f832e[_0x7995('0x22')]+_0x2f832e['limit'],_0x37a7d4;if(_0x1e1415>=_0x43d4b8){_0x1e1415=_0x43d4b8;_0x37a7d4=0xc8;}else{_0x37a7d4=0xce;}_0x565d97['status'](_0x37a7d4);return _0x565d97[_0x7995('0x23')](_0x7995('0x24'),_0x291317+'-'+_0x1e1415+'/'+_0x43d4b8)['json'](_0x37f297);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x25')](_0x3e4c54);}return _0x51f276[_0x7995('0x26')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x27')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x28')]()[_0x7995('0x27')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x29');return db[_0x7995('0x2a')][_0x7995('0x28')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x27')](function(){return _0x563799;});})[_0x7995('0x27')](function(){_0x204507['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1e')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1f')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=db[_0x7995('0x2d')]['rawAttributes'];_0x327a81['model']=_[_0x7995('0x2e')](_0x2e3493);_0x327a81['query']=_[_0x7995('0x2e')](_0x48e573[_0x7995('0x2f')]);_0x327a81[_0x7995('0x30')]=_[_0x7995('0x31')](_0x327a81[_0x7995('0x32')],_0x327a81['query']);_0xe6b0b3[_0x7995('0x33')]=_[_0x7995('0x31')](_0x327a81['model'],qs['fields'](_0x48e573['query'][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes'][_0x7995('0x35')]?_0xe6b0b3['attributes']:_0x327a81[_0x7995('0x32')];if(!_0x48e573[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0xe6b0b3['limit']=qs[_0x7995('0x37')](_0x48e573['query']['limit']);_0xe6b0b3[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x48e573['query'][_0x7995('0x22')]);}_0xe6b0b3[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x48e573[_0x7995('0x2f')][_0x7995('0x39')]);_0xe6b0b3['where']=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x48e573[_0x7995('0x2f')],_0x327a81[_0x7995('0x30')]));if(_0x48e573['query'][_0x7995('0x3b')]){_0xe6b0b3[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0xe6b0b3[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x2e3493,function(_0x1035dc){if(_0x1035dc['type'][_0x7995('0x3f')]!==_0x7995('0x40')){var _0x8a1be0={};_0x8a1be0[_0x1035dc[_0x7995('0x41')]]={'$like':'%'+_0x48e573[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x8a1be0;}})});}_0xe6b0b3=_[_0x7995('0x3d')]({},_0xe6b0b3,_0x48e573[_0x7995('0x42')]);var _0x1234e1={'where':_0xe6b0b3[_0x7995('0x3c')]};return db[_0x7995('0x2d')][_0x7995('0x43')](_0x1234e1)[_0x7995('0x27')](function(_0x53cda2){_0x2b874d['count']=_0x53cda2;if(_0x48e573[_0x7995('0x2f')][_0x7995('0x44')]){_0xe6b0b3['include']=[{'all':!![]}];}return db['CmList'][_0x7995('0x45')](_0xe6b0b3);})['then'](function(_0x504a33){_0x2b874d[_0x7995('0x46')]=_0x504a33;return _0x2b874d;})[_0x7995('0x27')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))[_0x7995('0x47')](handleError(_0x3573be,null));};exports['show']=function(_0x46ac4f,_0x5e85b9){var _0x3993b5={'raw':![],'where':{'id':_0x46ac4f['params']['id']}},_0x5a8881={};_0x5a8881[_0x7995('0x32')]=_[_0x7995('0x2e')](db[_0x7995('0x2d')][_0x7995('0x48')]);_0x5a8881['query']=_[_0x7995('0x2e')](_0x46ac4f[_0x7995('0x2f')]);_0x5a8881[_0x7995('0x30')]=_[_0x7995('0x31')](_0x5a8881['model'],_0x5a8881['query']);_0x3993b5[_0x7995('0x33')]=_['intersection'](_0x5a8881[_0x7995('0x32')],qs['fields'](_0x46ac4f[_0x7995('0x2f')]['fields']));_0x3993b5[_0x7995('0x33')]=_0x3993b5[_0x7995('0x33')]['length']?_0x3993b5[_0x7995('0x33')]:_0x5a8881[_0x7995('0x32')];if(_0x46ac4f[_0x7995('0x2f')][_0x7995('0x44')]){_0x3993b5['include']=[{'all':!![]}];}_0x3993b5=_[_0x7995('0x3d')]({},_0x3993b5,_0x46ac4f[_0x7995('0x42')]);return db[_0x7995('0x2d')]['find'](_0x3993b5)[_0x7995('0x27')](handleEntityNotFound(_0x5e85b9,null))[_0x7995('0x27')](respondWithResult(_0x5e85b9,null))[_0x7995('0x47')](handleError(_0x5e85b9,null));};exports[_0x7995('0x49')]=function(_0x255313,_0x51934b){return db[_0x7995('0x2d')][_0x7995('0x49')](_0x255313['body'],{})[_0x7995('0x27')](function(_0x5843ba){var _0x1d87f9=_0x255313[_0x7995('0x4a')][_0x7995('0x4b')]({'plain':!![]});if(!_0x1d87f9)throw new Error(_0x7995('0x4c'));if(_0x1d87f9[_0x7995('0x4d')]===_0x7995('0x4a')){var _0x1579b9=_0x5843ba['get']({'plain':!![]});var _0x427dcf=_0x7995('0x29');return db[_0x7995('0x4e')]['find']({'where':{'name':_0x427dcf,'userProfileId':_0x1d87f9[_0x7995('0x4f')]},'raw':!![]})[_0x7995('0x27')](function(_0x12d4b8){if(_0x12d4b8&&_0x12d4b8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1579b9[_0x7995('0x2c')],'resourceId':_0x1579b9['id'],'type':_0x12d4b8[_0x7995('0x2c')],'sectionId':_0x12d4b8['id']},{})['then'](function(){return _0x5843ba;});}else{return _0x5843ba;}})[_0x7995('0x47')](function(_0x29f300){logger[_0x7995('0x2b')](_0x7995('0x50'),_0x29f300);throw _0x29f300;});}return _0x5843ba;})[_0x7995('0x27')](respondWithResult(_0x51934b,0xc9))['catch'](handleError(_0x51934b,null));};exports[_0x7995('0x51')]=function(_0x4ab09f,_0x14fe7f){if(_0x4ab09f[_0x7995('0x52')]['id']){delete _0x4ab09f[_0x7995('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x4ab09f['params']['id']}})['then'](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x27')](saveUpdates(_0x4ab09f[_0x7995('0x52')],null))[_0x7995('0x27')](respondWithResult(_0x14fe7f,null))[_0x7995('0x47')](handleError(_0x14fe7f,null));};exports[_0x7995('0x28')]=function(_0x357e60,_0x1f4270){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x357e60[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x1f4270,null))[_0x7995('0x27')](removeEntity(_0x1f4270,null))[_0x7995('0x47')](handleError(_0x1f4270,null));};exports[_0x7995('0x55')]=function(_0x1ea1dc,_0x416133){return db[_0x7995('0x2d')][_0x7995('0x55')]()[_0x7995('0x27')](respondWithResult(_0x416133,null))['catch'](handleError(_0x416133,null));};exports[_0x7995('0x56')]=function(_0x630737,_0x3b8a54,_0x32c0d3){if(_0x630737['body']['id']){delete _0x630737['body']['id'];}return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x630737[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x3b8a54,null))['then'](function(_0x13cd7b){if(_0x13cd7b){_0x630737[_0x7995('0x52')][_0x7995('0x57')]=_0x13cd7b['id'];return db[_0x7995('0x58')]['create'](_0x630737['body']);}})[_0x7995('0x27')](respondWithResult(_0x3b8a54,null))[_0x7995('0x47')](handleError(_0x3b8a54,null));};exports[_0x7995('0x59')]=function(_0x1d69ce,_0x37072,_0x27c5cd){var _0x1d4689={'raw':![],'where':{}};var _0x1e2206={};var _0x984c23={'count':0x0,'rows':[]};return db['CmList'][_0x7995('0x5a')]({'where':{'id':_0x1d69ce[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x37072,null))[_0x7995('0x27')](function(_0x59c5aa){if(_0x59c5aa){_0x1e2206['model']=_[_0x7995('0x2e')](db[_0x7995('0x58')]['rawAttributes']);_0x1e2206[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x1d69ce[_0x7995('0x2f')]);_0x1e2206[_0x7995('0x30')]=_[_0x7995('0x31')](_0x1e2206['model'],_0x1e2206[_0x7995('0x2f')]);_0x1d4689['attributes']=_[_0x7995('0x31')](_0x1e2206[_0x7995('0x32')],qs[_0x7995('0x34')](_0x1d69ce[_0x7995('0x2f')][_0x7995('0x34')]));_0x1d4689[_0x7995('0x33')]=_0x1d4689[_0x7995('0x33')][_0x7995('0x35')]?_0x1d4689[_0x7995('0x33')]:_0x1e2206[_0x7995('0x32')];if(!_0x1d69ce[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0x1d4689[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x1d69ce[_0x7995('0x2f')][_0x7995('0x37')]);_0x1d4689[_0x7995('0x22')]=qs['offset'](_0x1d69ce['query'][_0x7995('0x22')]);}_0x1d4689[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x1d69ce[_0x7995('0x2f')]['sort']);_0x1d4689[_0x7995('0x3c')]=qs['filters'](_['pick'](_0x1d69ce[_0x7995('0x2f')],_0x1e2206[_0x7995('0x30')]));_0x1d4689[_0x7995('0x3c')][_0x7995('0x57')]=_0x59c5aa['id'];if(_0x1d69ce[_0x7995('0x2f')][_0x7995('0x3b')]){_0x1d4689[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x1d4689[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x1d4689['attributes'],function(_0x2dc1f7){var _0x8908cd={};_0x8908cd[_0x2dc1f7]={'$like':'%'+_0x1d69ce[_0x7995('0x2f')]['filter']+'%'};return _0x8908cd;})});}_0x1d4689=_[_0x7995('0x3d')]({},_0x1d4689,_0x1d69ce[_0x7995('0x42')]);return db[_0x7995('0x58')][_0x7995('0x43')]({'where':_0x1d4689[_0x7995('0x3c')]})[_0x7995('0x27')](function(_0x550a10){_0x984c23[_0x7995('0x43')]=_0x550a10;if(_0x1d69ce[_0x7995('0x2f')][_0x7995('0x44')]){_0x1d4689[_0x7995('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1d4689);})[_0x7995('0x27')](function(_0xfe1105){_0x984c23[_0x7995('0x46')]=_0xfe1105;return _0x984c23;});}})[_0x7995('0x27')](respondWithFilteredResult(_0x37072,_0x1d4689))['catch'](handleError(_0x37072,null));};exports[_0x7995('0x5c')]=function(_0x2c9eb6,_0x54b955,_0x480fdb){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x2c9eb6['params']['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x54b955,null))['then'](function(_0x3758f9){if(_0x3758f9){return _0x3758f9[_0x7995('0x5c')](_0x2c9eb6['query']['ids']);}})[_0x7995('0x27')](respondWithStatusCode(_0x54b955,null))['catch'](handleError(_0x54b955,null));};exports[_0x7995('0x5d')]=function(_0xa41fff,_0x3dd197,_0x45bd8a){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0xa41fff[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x3dd197,null))[_0x7995('0x27')](function(_0x117317){if(_0x117317){var _0x1ab590=[];var _0x16108c={'success':[],'errors':[]};return db[_0x7995('0x5e')][_0x7995('0x55')]()[_0x7995('0x27')](function(_0x3773de){if(_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]&&_[_0x7995('0x60')](_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')])){if(_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')][_0x7995('0x35')]){_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]=_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]['join'](';')+';';}else{_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]=null;}}else{_0xa41fff['body']['tags']=null;}if(_0xa41fff[_0x7995('0x52')]&&_[_0x7995('0x60')](_0xa41fff[_0x7995('0x52')])){for(var _0x38acda=0x0;_0x38acda<_0xa41fff[_0x7995('0x52')][_0x7995('0x35')];_0x38acda+=0x1){_0xa41fff['body'][_0x38acda][_0x7995('0x57')]=_0xa41fff[_0x7995('0x54')]['id'];_0x1ab590[_0x7995('0x61')](_0xa41fff[_0x7995('0x52')][_0x38acda]);}return BPromise[_0x7995('0x62')](_0x1ab590,function(_0x3f0bff){return db[_0x7995('0x5e')][_0x7995('0x49')](_['omit'](_0x3f0bff,[_0x7995('0x63'),'id'])||{},{'fields':_[_0x7995('0x2e')](_0x3773de),'raw':!![]})['then'](function(_0x479271){_0x16108c[_0x7995('0x64')][_0x7995('0x61')](_0x479271[_0x7995('0x65')]);})[_0x7995('0x47')](function(_0xe42797){_0x16108c['errors'][_0x7995('0x61')]({'data':_0x3f0bff,'error':_0xe42797[_0x7995('0x66')]});});})['then'](function(_0x209977){return _0x16108c;})[_0x7995('0x47')](function(_0x489bac){return _0x489bac;});}else{_0x3dd197[_0x7995('0x1f')](0x190)['json']({'message':_0x7995('0x67')});}});}})[_0x7995('0x27')](respondWithResult(_0x3dd197,null))[_0x7995('0x47')](handleError(_0x3dd197,null));};exports[_0x7995('0x68')]=function(_0x460fa6,_0x5d16da,_0x1f0506){var _0x345080;return db[_0x7995('0x2d')]['find']({'where':{'id':_0x460fa6[_0x7995('0x54')]['id']},'include':[{'model':db[_0x7995('0x69')],'as':_0x7995('0x6a')}]})[_0x7995('0x27')](handleEntityNotFound(_0x5d16da,null))['then'](function(_0x3356fd){if(_0x3356fd){_0x345080=_0x3356fd;return db[_0x7995('0x5e')][_0x7995('0x48')];}})['then'](function(_0x5358d4){if(_0x5358d4){var _0x3fc10={};var _0x333379={};_0x333379['model']=_['concat'](_[_0x7995('0x2e')](_0x5358d4),_[_0x7995('0x3e')](_0x345080[_0x7995('0x6a')],function(_0x2384c1){return util[_0x7995('0x6b')]('cf_%d',_0x2384c1['id']);}));_0x333379['query']=_[_0x7995('0x2e')](_0x460fa6['query']);_0x333379['filters']=_[_0x7995('0x31')](_0x333379[_0x7995('0x32')],_0x333379[_0x7995('0x2f')]);_0x3fc10['attributes']=_[_0x7995('0x31')](_0x333379[_0x7995('0x32')],qs[_0x7995('0x34')](_0x460fa6[_0x7995('0x2f')][_0x7995('0x34')]));_0x3fc10['attributes']=_0x3fc10[_0x7995('0x33')][_0x7995('0x35')]?_0x3fc10[_0x7995('0x33')]:_0x333379[_0x7995('0x32')];if(!_0x460fa6['query'][_0x7995('0x36')](_0x7995('0x6c'))){_0x3fc10['limit']=qs[_0x7995('0x37')](_0x460fa6[_0x7995('0x2f')]['limit']);_0x3fc10[_0x7995('0x22')]=qs['offset'](_0x460fa6[_0x7995('0x2f')]['offset']);}_0x3fc10[_0x7995('0x38')]=qs['sort'](_0x460fa6[_0x7995('0x2f')][_0x7995('0x39')]);_0x3fc10['where']=qs[_0x7995('0x30')](_['pick'](_0x460fa6['query'],_0x333379[_0x7995('0x30')]));_0x3fc10[_0x7995('0x6d')]=!![];if(_0x460fa6[_0x7995('0x2f')][_0x7995('0x3b')]){_0x3fc10['where']=_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x3c')],{'$or':_['map'](_0x3fc10['attributes'],function(_0xc2648d){var _0x4c8033={};_0x4c8033[_0xc2648d]={'$like':'%'+_0x460fa6[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x4c8033;})});}_0x3fc10=_[_0x7995('0x3d')]({},_0x3fc10,_0x460fa6['options']);return _0x345080['getContacts'](_0x3fc10);}})[_0x7995('0x27')](respondWithResult(_0x5d16da,null))['catch'](handleError(_0x5d16da,null));};exports[_0x7995('0x6e')]=function(_0x44891e,_0x14449c,_0x38bd35){var _0x4ff5e7;return db['CmList']['find']({'where':{'id':_0x44891e[_0x7995('0x54')]['id']},'include':[{'model':db[_0x7995('0x69')],'as':_0x7995('0x6a')}]})[_0x7995('0x27')](handleEntityNotFound(_0x14449c,null))[_0x7995('0x27')](function(_0x168e7f){if(_0x168e7f){_0x4ff5e7=_0x168e7f;return db['CmContact']['rawAttributes'];}})[_0x7995('0x27')](function(_0x5254e4){if(_0x5254e4){var _0x4cfd78={};var _0x17d00f={};_0x17d00f['model']=_['concat'](_[_0x7995('0x2e')](_0x5254e4),_[_0x7995('0x3e')](_0x4ff5e7[_0x7995('0x6a')],function(_0x5cef2e){return util[_0x7995('0x6b')](_0x7995('0x6f'),_0x5cef2e['id']);}));_0x17d00f[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x44891e[_0x7995('0x2f')]);_0x17d00f[_0x7995('0x30')]=_[_0x7995('0x31')](_0x17d00f[_0x7995('0x32')],_0x17d00f[_0x7995('0x2f')]);_0x4cfd78['attributes']=_[_0x7995('0x31')](_0x17d00f[_0x7995('0x32')],qs[_0x7995('0x34')](_0x44891e[_0x7995('0x2f')][_0x7995('0x34')]));_0x4cfd78['attributes']=_0x4cfd78[_0x7995('0x33')][_0x7995('0x35')]?_0x4cfd78[_0x7995('0x33')]:_0x17d00f['model'];if(!_0x44891e['query']['hasOwnProperty'](_0x7995('0x6c'))){_0x4cfd78[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x44891e[_0x7995('0x2f')][_0x7995('0x37')]);_0x4cfd78[_0x7995('0x22')]=qs['offset'](_0x44891e[_0x7995('0x2f')]['offset']);}_0x4cfd78[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x44891e[_0x7995('0x2f')][_0x7995('0x39')]);_0x4cfd78[_0x7995('0x3c')]=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x44891e[_0x7995('0x2f')],_0x17d00f[_0x7995('0x30')]));_0x4cfd78[_0x7995('0x6d')]=!![];if(_0x44891e[_0x7995('0x2f')]['filter']){_0x4cfd78[_0x7995('0x3c')]=_['merge'](_0x4cfd78[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x4cfd78['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x44891e[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x2a25eb;})});}_0x4cfd78=_[_0x7995('0x3d')]({},_0x4cfd78,_0x44891e[_0x7995('0x42')]);return _0x4ff5e7[_0x7995('0x68')](_0x4cfd78);}})[_0x7995('0x27')](function(_0x3a29b8){if(!_[_0x7995('0x70')](_0x3a29b8)){var _0x3c9b3c=toCsv(_0x3a29b8);var _0x2b9ade=Date[_0x7995('0x71')]();fs['writeFileSync'](util['format'](_0x7995('0x72'),_0x4ff5e7['id'],_0x2b9ade),_0x3c9b3c);_0x14449c[_0x7995('0x73')](_0x7995('0x74'),_0x7995('0x75')+util[_0x7995('0x6b')]('list_%d_%s.csv',_0x4ff5e7['id'],_0x2b9ade));_0x14449c[_0x7995('0x73')](_0x7995('0x76'),'text/csv');return _0x14449c[_0x7995('0x77')](util['format'](_0x7995('0x72'),_0x4ff5e7['id'],_0x2b9ade));}else{return _0x14449c[_0x7995('0x1e')](0xcc);}})[_0x7995('0x47')](handleError(_0x14449c,null));};exports['addCustomField']=function(_0x3501ac,_0x1cd9a0,_0x29dcaf){var _0x15ca94;delete _0x3501ac[_0x7995('0x52')]['id'];return db[_0x7995('0x2d')][_0x7995('0x5a')]({'where':{'id':_0x3501ac['params']['id']}})['then'](handleEntityNotFound(_0x1cd9a0,null))['then'](function(_0x406f82){if(_0x406f82){return db[_0x7995('0x78')]['transaction'](function(_0x4eb988){return db[_0x7995('0x69')][_0x7995('0x49')](_0x3501ac['body'],{'transaction':_0x4eb988})['then'](function(_0x538bd3){_0x15ca94=_0x538bd3;return _0x406f82['addCustomFields'](_0x538bd3,{'transaction':_0x4eb988});})[_0x7995('0x27')](function(){var _0x15ae93={'type':db[_0x7995('0x79')][_0x7995('0x7a')],'transaction':_0x4eb988};switch(_0x3501ac['body'][_0x7995('0x7b')]){case _0x7995('0x7c'):_0x15ae93['type']=db[_0x7995('0x79')][_0x7995('0x7a')];break;case _0x7995('0x7d'):_0x15ae93['type']=db[_0x7995('0x79')][_0x7995('0x7e')];break;case'switch':_0x15ae93[_0x7995('0x7b')]=db[_0x7995('0x79')][_0x7995('0x7f')];_0x15ae93[_0x7995('0x80')]=![];break;default:}return db[_0x7995('0x78')][_0x7995('0x81')][_0x7995('0x82')](_0x7995('0x83'),util[_0x7995('0x6b')](_0x7995('0x84'),_0x15ca94['id']),_0x15ae93);})[_0x7995('0x27')](function(){return _0x15ca94;});});}})[_0x7995('0x27')](respondWithResult(_0x1cd9a0,null))[_0x7995('0x47')](handleError(_0x1cd9a0,null));};exports['getCustomFields']=function(_0x154eff,_0x5f1ff2,_0x3603e8){var _0x3c551f={};var _0x59e356={};var _0x354058;var _0x2e6f4e;return db[_0x7995('0x2d')]['findOne']({'where':{'id':_0x154eff[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x5f1ff2,null))[_0x7995('0x27')](function(_0x413c96){if(_0x413c96){_0x354058=_0x413c96;_0x59e356[_0x7995('0x32')]=_[_0x7995('0x2e')](db[_0x7995('0x69')]['rawAttributes']);_0x59e356[_0x7995('0x2f')]=_['keys'](_0x154eff[_0x7995('0x2f')]);_0x59e356[_0x7995('0x30')]=_[_0x7995('0x31')](_0x59e356['model'],_0x59e356[_0x7995('0x2f')]);_0x3c551f['attributes']=_['intersection'](_0x59e356['model'],qs['fields'](_0x154eff[_0x7995('0x2f')][_0x7995('0x34')]));_0x3c551f['attributes']=_0x3c551f[_0x7995('0x33')][_0x7995('0x35')]?_0x3c551f['attributes']:_0x59e356[_0x7995('0x32')];_0x3c551f[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x154eff[_0x7995('0x2f')][_0x7995('0x39')]);_0x3c551f['where']=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x154eff[_0x7995('0x2f')],_0x59e356[_0x7995('0x30')]));_0x3c551f['where']=_[_0x7995('0x3d')](_0x3c551f[_0x7995('0x3c')],{'$or':[{'ListId':_0x413c96['id']},{'ListId':null}]});if(_0x154eff[_0x7995('0x2f')][_0x7995('0x3b')]){_0x3c551f[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x3c551f[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x3c551f[_0x7995('0x33')],function(_0x1fda95){var _0x5e08fa={};_0x5e08fa[_0x1fda95]={'$like':'%'+_0x154eff[_0x7995('0x2f')]['filter']+'%'};return _0x5e08fa;})});}_0x3c551f=_[_0x7995('0x3d')]({},_0x3c551f,_0x154eff[_0x7995('0x42')]);return db[_0x7995('0x69')]['findAndCountAll'](_0x3c551f);}})['then'](respondWithResult(_0x5f1ff2,null))[_0x7995('0x47')](handleError(_0x5f1ff2,null));};exports[_0x7995('0x85')]=function(_0x4c7dc8,_0x15ed0f,_0x5f1abc){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x4c7dc8[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x15ed0f,null))['then'](function(_0x4c090a){if(_0x4c090a){return _0x4c090a[_0x7995('0x85')](_0x4c7dc8[_0x7995('0x52')][_0x7995('0x63')],_[_0x7995('0x86')](_0x4c7dc8['body'],[_0x7995('0x63'),'id'])||{})[_0x7995('0x87')](function(_0x8b820b){for(var _0x241427=0x0;_0x241427<_0x4c7dc8[_0x7995('0x52')]['ids']['length'];_0x241427+=0x1){socket['emit'](_0x7995('0x88'),{'UserId':_0x4c7dc8[_0x7995('0x52')]['ids'][_0x241427],'CmListId':_0x4c7dc8[_0x7995('0x54')]['id']});}return _0x8b820b;});}})['then'](respondWithResult(_0x15ed0f,null))[_0x7995('0x47')](handleError(_0x15ed0f,null));};exports[_0x7995('0x89')]=function(_0x1e7398,_0x467913,_0x4f145e){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x1e7398[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x467913,null))[_0x7995('0x27')](function(_0x197adc){if(_0x197adc){return _0x197adc[_0x7995('0x89')](_0x1e7398[_0x7995('0x2f')][_0x7995('0x63')])[_0x7995('0x27')](function(){if(_[_0x7995('0x60')](_0x1e7398[_0x7995('0x2f')][_0x7995('0x63')])){for(var _0x2122af=0x0;_0x2122af<_0x1e7398['query'][_0x7995('0x63')]['length'];_0x2122af+=0x1){socket[_0x7995('0x8a')](_0x7995('0x8b'),{'UserId':Number(_0x1e7398['query'][_0x7995('0x63')][_0x2122af]),'CmListId':Number(_0x1e7398['params']['id'])});}}else{socket[_0x7995('0x8a')](_0x7995('0x8b'),{'UserId':Number(_0x1e7398['query']['ids']),'CmListId':Number(_0x1e7398['params']['id'])});}});}})[_0x7995('0x27')](respondWithStatusCode(_0x467913,null))[_0x7995('0x47')](handleError(_0x467913,null));};exports[_0x7995('0x8c')]=function(_0x2b7bc2,_0x566b48,_0x1ce3ff){var _0x2b2814={};var _0xc81297={};var _0x2de960;var _0x29c109;return db[_0x7995('0x2d')][_0x7995('0x5a')]({'where':{'id':_0x2b7bc2[_0x7995('0x54')]['id']}})['then'](handleEntityNotFound(_0x566b48,null))[_0x7995('0x27')](function(_0x5e12c4){if(_0x5e12c4){_0x2de960=_0x5e12c4;_0xc81297[_0x7995('0x32')]=_[_0x7995('0x2e')](db['User'][_0x7995('0x48')]);_0xc81297[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x2b7bc2[_0x7995('0x2f')]);_0xc81297[_0x7995('0x30')]=_[_0x7995('0x31')](_0xc81297['model'],_0xc81297[_0x7995('0x2f')]);_0x2b2814[_0x7995('0x33')]=_[_0x7995('0x31')](_0xc81297[_0x7995('0x32')],qs[_0x7995('0x34')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x34')]));_0x2b2814[_0x7995('0x33')]=_0x2b2814[_0x7995('0x33')][_0x7995('0x35')]?_0x2b2814[_0x7995('0x33')]:_0xc81297[_0x7995('0x32')];_0x2b2814[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x39')]);_0x2b2814[_0x7995('0x3c')]=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x2b7bc2[_0x7995('0x2f')],_0xc81297[_0x7995('0x30')]));if(_0x2b7bc2['query']['filter']){_0x2b2814[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x2b2814['where'],{'$or':_[_0x7995('0x3e')](_0x2b2814['attributes'],function(_0x2ce103){var _0x4b360b={};_0x4b360b[_0x2ce103]={'$like':'%'+_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x4b360b;})});}_0x2b2814=_[_0x7995('0x3d')]({},_0x2b2814,_0x2b7bc2[_0x7995('0x42')]);return _0x2de960[_0x7995('0x8c')](_0x2b2814);}})[_0x7995('0x27')](function(_0xd82313){if(_0xd82313){_0x29c109=_0xd82313[_0x7995('0x35')];if(!_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0x2b2814[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x37')]);_0x2b2814['offset']=qs[_0x7995('0x22')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x22')]);}return _0x2de960[_0x7995('0x8c')](_0x2b2814);}})['then'](function(_0x32c550){if(_0x32c550){return _0x32c550?{'count':_0x29c109,'rows':_0x32c550}:null;}})[_0x7995('0x27')](respondWithResult(_0x566b48,null))[_0x7995('0x47')](handleError(_0x566b48,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c67d8f8..088bb84 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 _0x8742=['../../mysqldb','CmList','setMaxListeners','save','hasOwnProperty','hook','events'];(function(_0x44ccc9,_0x444615){var _0x31fde0=function(_0x9335a6){while(--_0x9335a6){_0x44ccc9['push'](_0x44ccc9['shift']());}};_0x31fde0(++_0x444615);}(_0x8742,0x1a3));var _0x2874=function(_0x2c6732,_0x2a0987){_0x2c6732=_0x2c6732-0x0;var _0x7927eb=_0x8742[_0x2c6732];return _0x7927eb;};'use strict';var EventEmitter=require(_0x2874('0x0'));var CmList=require(_0x2874('0x1'))['db'][_0x2874('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x2874('0x3')](0x0);var events={'afterCreate':_0x2874('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21434b){return function(_0x5bffd0,_0x128f7d,_0x95dfa5){CmListEvents['emit'](_0x21434b+':'+_0x5bffd0['id'],_0x5bffd0);CmListEvents['emit'](_0x21434b,_0x5bffd0);_0x95dfa5(null);};}for(var e in events){if(events[_0x2874('0x5')](e)){var event=events[e];CmList[_0x2874('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x4934=['remove','emit','hasOwnProperty','exports','events','CmList'];(function(_0x226593,_0x3589de){var _0x8a0db=function(_0x485c53){while(--_0x485c53){_0x226593['push'](_0x226593['shift']());}};_0x8a0db(++_0x3589de);}(_0x4934,0x8e));var _0x4493=function(_0x40da3c,_0x21e6b4){_0x40da3c=_0x40da3c-0x0;var _0xd42a1a=_0x4934[_0x40da3c];return _0xd42a1a;};'use strict';var EventEmitter=require(_0x4493('0x0'));var CmList=require('../../mysqldb')['db'][_0x4493('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4493('0x2')};function emitEvent(_0x14a9b1){return function(_0x3b0a5b,_0x255134,_0x1e170a){CmListEvents[_0x4493('0x3')](_0x14a9b1+':'+_0x3b0a5b['id'],_0x3b0a5b);CmListEvents[_0x4493('0x3')](_0x14a9b1,_0x3b0a5b);_0x1e170a(null);};}for(var e in events){if(events[_0x4493('0x4')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x4493('0x5')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 1c3219b..c9112ac 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 _0xb43b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb43b,0xbf));var _0xbb43=function(_0x4cdb7f,_0x440ab3){_0x4cdb7f=_0x4cdb7f-0x0;var _0x21cf36=_0xb43b[_0x4cdb7f];return _0x21cf36;};'use strict';var _=require(_0xbb43('0x0'));var util=require('util');var logger=require(_0xbb43('0x1'))(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require(_0xbb43('0x5'));var fs=require('fs');var path=require(_0xbb43('0x6'));var rimraf=require(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var attributes=require(_0xbb43('0x9'));module[_0xbb43('0xa')]=function(_0x2e55f3,_0x51e44e){return _0x2e55f3[_0xbb43('0xb')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d9b=['util','../../config/logger','api','moment','path','../../config/environment','./cmList.attributes','define','lodash'];(function(_0x270a30,_0x6e2f77){var _0x10a26b=function(_0x4c212b){while(--_0x4c212b){_0x270a30['push'](_0x270a30['shift']());}};_0x10a26b(++_0x6e2f77);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var logger=require(_0xb8d9('0x2'))(_0xb8d9('0x3'));var moment=require(_0xb8d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d9('0x5'));var rimraf=require('rimraf');var config=require(_0xb8d9('0x6'));var attributes=require(_0xb8d9('0x7'));module['exports']=function(_0x5996e9,_0x529b0a){return _0x5996e9[_0xb8d9('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4c956cf..38e25f7 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 _0x290e=['request\x20sent','stringify','code','error','message','CmList,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./cmList.socket','request','then','info','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x33d7e7,_0x44e25f){var _0x4b8c45=function(_0x19ae5c){while(--_0x19ae5c){_0x33d7e7['push'](_0x33d7e7['shift']());}};_0x4b8c45(++_0x44e25f);}(_0x290e,0x77));var _0xe290=function(_0x374b4b,_0x45a235){_0x374b4b=_0x374b4b-0x0;var _0x3977b1=_0x290e[_0x374b4b];return _0x3977b1;};'use strict';var _=require(_0xe290('0x0'));var util=require(_0xe290('0x1'));var moment=require(_0xe290('0x2'));var BPromise=require(_0xe290('0x3'));var rs=require(_0xe290('0x4'));var fs=require('fs');var Redis=require(_0xe290('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe290('0x6'));var logger=require(_0xe290('0x7'))(_0xe290('0x8'));var config=require(_0xe290('0x9'));var jayson=require(_0xe290('0xa'));var client=jayson['client'][_0xe290('0xb')]({'port':0x232a});config['redis']=_[_0xe290('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe290('0xd'))(new Redis(config[_0xe290('0xe')]));require(_0xe290('0xf'))['register'](socket);function respondWithRpcPromise(_0x2920a6,_0x431b68,_0x2cbdd0){return new BPromise(function(_0x204c3d,_0x2351d2){return client[_0xe290('0x10')](_0x2920a6,_0x2cbdd0)[_0xe290('0x11')](function(_0x37ca5f){logger[_0xe290('0x12')]('CmList,\x20%s,\x20%s',_0x431b68,'request\x20sent');logger[_0xe290('0x13')](_0xe290('0x14'),_0x431b68,_0xe290('0x15'),JSON[_0xe290('0x16')](_0x37ca5f));if(_0x37ca5f['error']){if(_0x37ca5f['error'][_0xe290('0x17')]===0x1f4){logger[_0xe290('0x18')]('CmList,\x20%s,\x20%s',_0x431b68,_0x37ca5f[_0xe290('0x18')][_0xe290('0x19')]);return _0x2351d2(_0x37ca5f[_0xe290('0x18')]['message']);}logger[_0xe290('0x18')](_0xe290('0x1a'),_0x431b68,_0x37ca5f[_0xe290('0x18')][_0xe290('0x19')]);return _0x204c3d(_0x37ca5f[_0xe290('0x18')][_0xe290('0x19')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x431b68,_0xe290('0x15'));_0x204c3d(_0x37ca5f['result']['message']);}})[_0xe290('0x1b')](function(_0x176a49){logger['error'](_0xe290('0x1a'),_0x431b68,_0x176a49);_0x2351d2(_0x176a49);});});} \ No newline at end of file +var _0xe4c4=['../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x35364a,_0x29a537){var _0x332b09=function(_0xd7d48e){while(--_0xd7d48e){_0x35364a['push'](_0x35364a['shift']());}};_0x332b09(++_0x29a537);}(_0xe4c4,0x10e));var _0x4e4c=function(_0x375126,_0x514a8e){_0x375126=_0x375126-0x0;var _0x1f76bb=_0xe4c4[_0x375126];return _0x1f76bb;};'use strict';var _=require(_0x4e4c('0x0'));var util=require(_0x4e4c('0x1'));var moment=require('moment');var BPromise=require(_0x4e4c('0x2'));var rs=require(_0x4e4c('0x3'));var fs=require('fs');var Redis=require(_0x4e4c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e4c('0x5'));var logger=require(_0x4e4c('0x6'))('rpc');var config=require(_0x4e4c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e4c('0x8')]({'port':0x232a});config[_0x4e4c('0x9')]=_[_0x4e4c('0xa')](config[_0x4e4c('0x9')],{'host':_0x4e4c('0xb'),'port':0x18eb});var socket=require(_0x4e4c('0xc'))(new Redis(config[_0x4e4c('0x9')]));require(_0x4e4c('0xd'))[_0x4e4c('0xe')](socket);function respondWithRpcPromise(_0x4251b5,_0x1b544b,_0x418150){return new BPromise(function(_0x431c01,_0x223827){return client[_0x4e4c('0xf')](_0x4251b5,_0x418150)['then'](function(_0x630f62){logger[_0x4e4c('0x10')](_0x4e4c('0x11'),_0x1b544b,_0x4e4c('0x12'));logger[_0x4e4c('0x13')](_0x4e4c('0x14'),_0x1b544b,_0x4e4c('0x12'),JSON['stringify'](_0x630f62));if(_0x630f62[_0x4e4c('0x15')]){if(_0x630f62[_0x4e4c('0x15')]['code']===0x1f4){logger[_0x4e4c('0x15')]('CmList,\x20%s,\x20%s',_0x1b544b,_0x630f62[_0x4e4c('0x15')][_0x4e4c('0x16')]);return _0x223827(_0x630f62[_0x4e4c('0x15')]['message']);}logger[_0x4e4c('0x15')]('CmList,\x20%s,\x20%s',_0x1b544b,_0x630f62[_0x4e4c('0x15')][_0x4e4c('0x16')]);return _0x431c01(_0x630f62[_0x4e4c('0x15')][_0x4e4c('0x16')]);}else{logger[_0x4e4c('0x10')](_0x4e4c('0x11'),_0x1b544b,_0x4e4c('0x12'));_0x431c01(_0x630f62[_0x4e4c('0x17')][_0x4e4c('0x16')]);}})[_0x4e4c('0x18')](function(_0x1edea0){logger[_0x4e4c('0x15')](_0x4e4c('0x11'),_0x1b544b,_0x1edea0);_0x223827(_0x1edea0);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 748e147..12f4ca4 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 _0x3e27=['./cmList.events','update','emit','removeListener','register','length','cmList:'];(function(_0x557d88,_0x50f732){var _0x561e02=function(_0x3c5256){while(--_0x3c5256){_0x557d88['push'](_0x557d88['shift']());}};_0x561e02(++_0x50f732);}(_0x3e27,0x9a));var _0x73e2=function(_0x8cde77,_0x1667a1){_0x8cde77=_0x8cde77-0x0;var _0x24b97d=_0x3e27[_0x8cde77];return _0x24b97d;};'use strict';var CmListEvents=require(_0x73e2('0x0'));var events=['save','remove',_0x73e2('0x1')];function createListener(_0x5b6639,_0x3ab05c){return function(_0x2038e9){_0x3ab05c[_0x73e2('0x2')](_0x5b6639,_0x2038e9);};}function removeListener(_0x479caf,_0x531a5c){return function(){CmListEvents[_0x73e2('0x3')](_0x479caf,_0x531a5c);};}exports[_0x73e2('0x4')]=function(_0x28110a){for(var _0x172e17=0x0,_0x3bb855=events[_0x73e2('0x5')];_0x172e17<_0x3bb855;_0x172e17++){var _0x2d43eb=events[_0x172e17];var _0x20f882=createListener(_0x73e2('0x6')+_0x2d43eb,_0x28110a);CmListEvents['on'](_0x2d43eb,_0x20f882);}}; \ No newline at end of file +var _0x8867=['remove','update','emit','removeListener','register','cmList:','./cmList.events','save'];(function(_0x3861ea,_0x575bc2){var _0x95af48=function(_0x3555f4){while(--_0x3555f4){_0x3861ea['push'](_0x3861ea['shift']());}};_0x95af48(++_0x575bc2);}(_0x8867,0x11e));var _0x7886=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x8867[_0x5698a9];return _0x3be696;};'use strict';var CmListEvents=require(_0x7886('0x0'));var events=[_0x7886('0x1'),_0x7886('0x2'),_0x7886('0x3')];function createListener(_0x23181c,_0x1549ad){return function(_0x5937fb){_0x1549ad[_0x7886('0x4')](_0x23181c,_0x5937fb);};}function removeListener(_0x42c5e2,_0x541873){return function(){CmListEvents[_0x7886('0x5')](_0x42c5e2,_0x541873);};}exports[_0x7886('0x6')]=function(_0x3ad2f2){for(var _0x10e5e9=0x0,_0x4df78f=events['length'];_0x10e5e9<_0x4df78f;_0x10e5e9++){var _0x1fc319=events[_0x10e5e9];var _0x56d54e=createListener(_0x7886('0x7')+_0x1fc319,_0x3ad2f2);CmListEvents['on'](_0x1fc319,_0x56d54e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8f8a497..28af41b 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 _0x3dd5=['isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','/:id/dispositions','addContacts','addCustomField','addAgents','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../config/environment','./cmList.controller','get'];(function(_0x398a75,_0x199132){var _0x5e4aa1=function(_0x56fa78){while(--_0x56fa78){_0x398a75['push'](_0x398a75['shift']());}};_0x5e4aa1(++_0x199132);}(_0x3dd5,0x12f));var _0x53dd=function(_0xeb78ce,_0x305b80){_0xeb78ce=_0xeb78ce-0x0;var _0x2e03bd=_0x3dd5[_0xeb78ce];return _0x2e03bd;};'use strict';var multer=require(_0x53dd('0x0'));var util=require('util');var path=require(_0x53dd('0x1'));var timeout=require(_0x53dd('0x2'));var express=require('express');var router=express[_0x53dd('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x53dd('0x4'));var controller=require(_0x53dd('0x5'));router[_0x53dd('0x6')]('/',auth[_0x53dd('0x7')](),controller[_0x53dd('0x8')]);router[_0x53dd('0x6')](_0x53dd('0x9'),auth['isAuthenticated'](),controller[_0x53dd('0xa')]);router[_0x53dd('0x6')](_0x53dd('0xb'),auth[_0x53dd('0x7')](),controller[_0x53dd('0xc')]);router[_0x53dd('0x6')]('/:id/dispositions',auth[_0x53dd('0x7')](),controller[_0x53dd('0xd')]);router[_0x53dd('0x6')](_0x53dd('0xe'),auth[_0x53dd('0x7')](),controller['getContacts']);router[_0x53dd('0x6')](_0x53dd('0xf'),auth[_0x53dd('0x7')](),controller[_0x53dd('0x10')]);router[_0x53dd('0x6')](_0x53dd('0x11'),auth[_0x53dd('0x7')](),controller[_0x53dd('0x12')]);router[_0x53dd('0x6')](_0x53dd('0x13'),auth[_0x53dd('0x7')](),controller[_0x53dd('0x14')]);router[_0x53dd('0x15')]('/',auth[_0x53dd('0x7')](),controller['create']);router[_0x53dd('0x15')](_0x53dd('0x16'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x53dd('0x15')](_0x53dd('0xe'),auth['isAuthenticated'](),controller[_0x53dd('0x17')]);router[_0x53dd('0x15')](_0x53dd('0x11'),auth[_0x53dd('0x7')](),controller[_0x53dd('0x18')]);router[_0x53dd('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x53dd('0x19')]);router[_0x53dd('0x1a')](_0x53dd('0xb'),auth[_0x53dd('0x7')](),controller['update']);router[_0x53dd('0x1b')]('/:id',auth[_0x53dd('0x7')](),controller[_0x53dd('0x1c')]);router[_0x53dd('0x1b')](_0x53dd('0x16'),auth[_0x53dd('0x7')](),controller['removeDispositions']);router['delete'](_0x53dd('0x13'),auth[_0x53dd('0x7')](),controller[_0x53dd('0x1d')]);module[_0x53dd('0x1e')]=router; \ No newline at end of file +var _0x35c5=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','addDisposition','/:id/users','put','update','delete','destroy','removeDispositions','removeAgents'];(function(_0x2e476a,_0x1c655d){var _0x188142=function(_0x4936ef){while(--_0x4936ef){_0x2e476a['push'](_0x2e476a['shift']());}};_0x188142(++_0x1c655d);}(_0x35c5,0xef));var _0x535c=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x35c5[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require('multer');var util=require(_0x535c('0x0'));var path=require(_0x535c('0x1'));var timeout=require(_0x535c('0x2'));var express=require(_0x535c('0x3'));var router=express[_0x535c('0x4')]();var auth=require(_0x535c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x535c('0x6'));var controller=require(_0x535c('0x7'));router[_0x535c('0x8')]('/',auth[_0x535c('0x9')](),controller[_0x535c('0xa')]);router[_0x535c('0x8')](_0x535c('0xb'),auth[_0x535c('0x9')](),controller[_0x535c('0xc')]);router[_0x535c('0x8')](_0x535c('0xd'),auth[_0x535c('0x9')](),controller[_0x535c('0xe')]);router[_0x535c('0x8')](_0x535c('0xf'),auth[_0x535c('0x9')](),controller[_0x535c('0x10')]);router[_0x535c('0x8')](_0x535c('0x11'),auth['isAuthenticated'](),controller[_0x535c('0x12')]);router[_0x535c('0x8')](_0x535c('0x13'),auth[_0x535c('0x9')](),controller[_0x535c('0x14')]);router[_0x535c('0x8')](_0x535c('0x15'),auth[_0x535c('0x9')](),controller[_0x535c('0x16')]);router[_0x535c('0x8')]('/:id/users',auth[_0x535c('0x9')](),controller['getAgents']);router[_0x535c('0x17')]('/',auth['isAuthenticated'](),controller[_0x535c('0x18')]);router[_0x535c('0x17')]('/:id/dispositions',auth[_0x535c('0x9')](),controller[_0x535c('0x19')]);router[_0x535c('0x17')](_0x535c('0x11'),auth['isAuthenticated'](),controller['addContacts']);router[_0x535c('0x17')]('/:id/fields',auth[_0x535c('0x9')](),controller['addCustomField']);router[_0x535c('0x17')](_0x535c('0x1a'),auth['isAuthenticated'](),controller['addAgents']);router[_0x535c('0x1b')]('/:id',auth[_0x535c('0x9')](),controller[_0x535c('0x1c')]);router[_0x535c('0x1d')](_0x535c('0xd'),auth[_0x535c('0x9')](),controller[_0x535c('0x1e')]);router[_0x535c('0x1d')](_0x535c('0xf'),auth[_0x535c('0x9')](),controller[_0x535c('0x1f')]);router[_0x535c('0x1d')](_0x535c('0x1a'),auth['isAuthenticated'](),controller[_0x535c('0x20')]);module[_0x535c('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d25c4c9..c155e55 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 _0xfe77=['sequelize','exports','getDataValue','STRING'];(function(_0x2abf7f,_0x23b05a){var _0x248bce=function(_0x4c836d){while(--_0x4c836d){_0x2abf7f['push'](_0x2abf7f['shift']());}};_0x248bce(++_0x23b05a);}(_0xfe77,0x130));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7fe7('0x0'));module[_0x7fe7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x171bc5){return this[_0x7fe7('0x2')]('field');}},'field':{'type':Sequelize[_0x7fe7('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7fe7('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x21df=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x54b458,_0x4da21b){var _0x18d704=function(_0x3ca278){while(--_0x3ca278){_0x54b458['push'](_0x54b458['shift']());}};_0x18d704(++_0x4da21b);}(_0x21df,0xd0));var _0xf21d=function(_0x59bbab,_0x156377){_0x59bbab=_0x59bbab-0x0;var _0x4960fa=_0x21df[_0x59bbab];return _0x4960fa;};'use strict';var Sequelize=require(_0xf21d('0x0'));module[_0xf21d('0x1')]={'name':{'type':Sequelize[_0xf21d('0x2')],'get':function(_0x293b24){return this[_0xf21d('0x3')](_0xf21d('0x4'));}},'field':{'type':Sequelize[_0xf21d('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf21d('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index a872f99..928c00b 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 _0x9141=['json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','Condition','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end'];(function(_0x3bf0d0,_0x5e0101){var _0xc75912=function(_0x7a9ce1){while(--_0x7a9ce1){_0x3bf0d0['push'](_0x3bf0d0['shift']());}};_0xc75912(++_0x5e0101);}(_0x9141,0x1b2));var _0x1914=function(_0x60fe89,_0x2e146e){_0x60fe89=_0x60fe89-0x0;var _0x46910c=_0x9141[_0x60fe89];return _0x46910c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1914('0x0'));var rimraf=require(_0x1914('0x1'));var zipdir=require(_0x1914('0x2'));var jsonpatch=require(_0x1914('0x3'));var rp=require(_0x1914('0x4'));var moment=require(_0x1914('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1914('0x6'));var util=require(_0x1914('0x7'));var path=require(_0x1914('0x8'));var sox=require(_0x1914('0x9'));var csv=require(_0x1914('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1914('0xb'));var squel=require('squel');var crypto=require(_0x1914('0xc'));var jsforce=require(_0x1914('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1914('0xa'));var querystring=require(_0x1914('0xe'));var Papa=require(_0x1914('0xf'));var Redis=require(_0x1914('0x10'));var authService=require(_0x1914('0x11'));var qs=require(_0x1914('0x12'));var hardwareService=require(_0x1914('0x13'));var logger=require(_0x1914('0x14'))(_0x1914('0x15'));var utils=require(_0x1914('0x16'));var config=require(_0x1914('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x447902,_0x1439ec){_0x1439ec=_0x1439ec||0xcc;return function(_0x44536b){if(_0x44536b){return _0x447902['sendStatus'](_0x1439ec);}return _0x447902[_0x1914('0x18')](_0x1439ec)[_0x1914('0x19')]();};}function respondWithResult(_0x7ae899,_0x1dcd6c){_0x1dcd6c=_0x1dcd6c||0xc8;return function(_0xb0c9e0){if(_0xb0c9e0){return _0x7ae899['status'](_0x1dcd6c)[_0x1914('0x1a')](_0xb0c9e0);}};}function respondWithFilteredResult(_0x55ae60,_0x409b69){return function(_0x9f8615){if(_0x9f8615){var _0x409984=_0x9f8615[_0x1914('0x1b')],_0x2dba76=_0x409b69[_0x1914('0x1c')],_0xad2265=_0x409b69[_0x1914('0x1c')]+_0x409b69[_0x1914('0x1d')],_0x3bc903;if(_0xad2265>=_0x409984){_0xad2265=_0x409984;_0x3bc903=0xc8;}else{_0x3bc903=0xce;}_0x55ae60[_0x1914('0x18')](_0x3bc903);return _0x55ae60[_0x1914('0x1e')](_0x1914('0x1f'),_0x2dba76+'-'+_0xad2265+'/'+_0x409984)[_0x1914('0x1a')](_0x9f8615);}return null;};}function patchUpdates(_0x315ab3){return function(_0x15da02){try{jsonpatch[_0x1914('0x20')](_0x15da02,_0x315ab3,!![]);}catch(_0x1c9a31){return BPromise[_0x1914('0x21')](_0x1c9a31);}return _0x15da02['save']();};}function saveUpdates(_0x2e06b7,_0xe5663d){return function(_0x21c95f){if(_0x21c95f){return _0x21c95f[_0x1914('0x22')](_0x2e06b7)[_0x1914('0x23')](function(_0x4ea40b){return _0x4ea40b;});}return null;};}function removeEntity(_0xaa9275,_0x302a24){return function(_0x2c2c57){if(_0x2c2c57){return _0x2c2c57[_0x1914('0x24')]()['then'](function(){_0xaa9275[_0x1914('0x18')](0xcc)[_0x1914('0x19')]();});}};}function handleEntityNotFound(_0x36e151,_0x2cad79){return function(_0x35fdd2){if(!_0x35fdd2){_0x36e151['sendStatus'](0x194);}return _0x35fdd2;};}function handleError(_0x1a8722,_0x31b971){_0x31b971=_0x31b971||0x1f4;return function(_0x25e679){logger[_0x1914('0x25')](_0x25e679[_0x1914('0x26')]);if(_0x25e679[_0x1914('0x27')]){delete _0x25e679[_0x1914('0x27')];}_0x1a8722[_0x1914('0x18')](_0x31b971)[_0x1914('0x28')](_0x25e679);};}exports[_0x1914('0x22')]=function(_0xd6f065,_0x4885a4){if(_0xd6f065['body']['id']){delete _0xd6f065[_0x1914('0x29')]['id'];}return db[_0x1914('0x2a')]['find']({'where':{'id':_0xd6f065[_0x1914('0x2b')]['id']}})[_0x1914('0x23')](handleEntityNotFound(_0x4885a4,null))[_0x1914('0x23')](saveUpdates(_0xd6f065['body'],null))[_0x1914('0x23')](respondWithResult(_0x4885a4,null))[_0x1914('0x2c')](handleError(_0x4885a4,null));};exports['destroy']=function(_0x38052d,_0x5d28ee){return db[_0x1914('0x2a')][_0x1914('0x2d')]({'where':{'id':_0x38052d[_0x1914('0x2b')]['id']}})[_0x1914('0x23')](handleEntityNotFound(_0x5d28ee,null))[_0x1914('0x23')](removeEntity(_0x5d28ee,null))[_0x1914('0x2c')](handleError(_0x5d28ee,null));}; \ No newline at end of file +var _0x0290=['to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','Condition','find','params','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x37f0a1,_0x53ef46){var _0x32626e=function(_0x1f1458){while(--_0x1f1458){_0x37f0a1['push'](_0x37f0a1['shift']());}};_0x32626e(++_0x53ef46);}(_0x0290,0xa9));var _0x0029=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x0290[_0x42245d];return _0x4b211a;};'use strict';var pdf=require(_0x0029('0x0'));var emlformat=require(_0x0029('0x1'));var rimraf=require(_0x0029('0x2'));var zipdir=require(_0x0029('0x3'));var jsonpatch=require(_0x0029('0x4'));var rp=require('request-promise');var moment=require(_0x0029('0x5'));var BPromise=require(_0x0029('0x6'));var Mustache=require(_0x0029('0x7'));var util=require(_0x0029('0x8'));var path=require(_0x0029('0x9'));var sox=require(_0x0029('0xa'));var csv=require(_0x0029('0xb'));var ejs=require(_0x0029('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0029('0xd'));var crypto=require('crypto');var jsforce=require(_0x0029('0xe'));var deskjs=require(_0x0029('0xf'));var toCsv=require(_0x0029('0xb'));var querystring=require(_0x0029('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0029('0x11'));var qs=require(_0x0029('0x12'));var hardwareService=require(_0x0029('0x13'));var logger=require(_0x0029('0x14'))(_0x0029('0x15'));var utils=require(_0x0029('0x16'));var config=require(_0x0029('0x17'));var db=require(_0x0029('0x18'))['db'];function respondWithStatusCode(_0x3a0818,_0x13ca64){_0x13ca64=_0x13ca64||0xcc;return function(_0x4a35d8){if(_0x4a35d8){return _0x3a0818['sendStatus'](_0x13ca64);}return _0x3a0818[_0x0029('0x19')](_0x13ca64)[_0x0029('0x1a')]();};}function respondWithResult(_0x102cfd,_0x2cc8f2){_0x2cc8f2=_0x2cc8f2||0xc8;return function(_0x24286e){if(_0x24286e){return _0x102cfd[_0x0029('0x19')](_0x2cc8f2)[_0x0029('0x1b')](_0x24286e);}};}function respondWithFilteredResult(_0x1d868f,_0x32d313){return function(_0x45246a){if(_0x45246a){var _0x59905c=_0x45246a[_0x0029('0x1c')],_0x11afba=_0x32d313[_0x0029('0x1d')],_0x1e2e25=_0x32d313[_0x0029('0x1d')]+_0x32d313[_0x0029('0x1e')],_0x1c3fc1;if(_0x1e2e25>=_0x59905c){_0x1e2e25=_0x59905c;_0x1c3fc1=0xc8;}else{_0x1c3fc1=0xce;}_0x1d868f[_0x0029('0x19')](_0x1c3fc1);return _0x1d868f['set'](_0x0029('0x1f'),_0x11afba+'-'+_0x1e2e25+'/'+_0x59905c)[_0x0029('0x1b')](_0x45246a);}return null;};}function patchUpdates(_0x477cd9){return function(_0x21ed48){try{jsonpatch['apply'](_0x21ed48,_0x477cd9,!![]);}catch(_0x4bd5c9){return BPromise['reject'](_0x4bd5c9);}return _0x21ed48['save']();};}function saveUpdates(_0xac0868,_0x205852){return function(_0x20f58e){if(_0x20f58e){return _0x20f58e[_0x0029('0x20')](_0xac0868)[_0x0029('0x21')](function(_0x1ca034){return _0x1ca034;});}return null;};}function removeEntity(_0x3069c5,_0x58ae23){return function(_0x3c24c4){if(_0x3c24c4){return _0x3c24c4[_0x0029('0x22')]()[_0x0029('0x21')](function(){_0x3069c5[_0x0029('0x19')](0xcc)[_0x0029('0x1a')]();});}};}function handleEntityNotFound(_0xa98dc2,_0x3e6cbb){return function(_0x332c98){if(!_0x332c98){_0xa98dc2[_0x0029('0x23')](0x194);}return _0x332c98;};}function handleError(_0x52eda4,_0x2b3e3c){_0x2b3e3c=_0x2b3e3c||0x1f4;return function(_0x1ee022){logger[_0x0029('0x24')](_0x1ee022[_0x0029('0x25')]);if(_0x1ee022[_0x0029('0x26')]){delete _0x1ee022[_0x0029('0x26')];}_0x52eda4[_0x0029('0x19')](_0x2b3e3c)[_0x0029('0x27')](_0x1ee022);};}exports[_0x0029('0x20')]=function(_0x22dbeb,_0x598ec3){if(_0x22dbeb['body']['id']){delete _0x22dbeb['body']['id'];}return db[_0x0029('0x28')][_0x0029('0x29')]({'where':{'id':_0x22dbeb[_0x0029('0x2a')]['id']}})[_0x0029('0x21')](handleEntityNotFound(_0x598ec3,null))['then'](saveUpdates(_0x22dbeb[_0x0029('0x2b')],null))[_0x0029('0x21')](respondWithResult(_0x598ec3,null))[_0x0029('0x2c')](handleError(_0x598ec3,null));};exports[_0x0029('0x22')]=function(_0x2ca9d6,_0x48dff7){return db[_0x0029('0x28')][_0x0029('0x29')]({'where':{'id':_0x2ca9d6[_0x0029('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48dff7,null))['then'](removeEntity(_0x48dff7,null))[_0x0029('0x2c')](handleError(_0x48dff7,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 2b3e33c..2eae208 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 _0xb14c=['bluebird','request-promise','path','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','api'];(function(_0x2a13cc,_0x598df3){var _0xee83d=function(_0x598c27){while(--_0x598c27){_0x2a13cc['push'](_0x2a13cc['shift']());}};_0xee83d(++_0x598df3);}(_0xb14c,0xbc));var _0xcb14=function(_0x1896d2,_0x38e977){_0x1896d2=_0x1896d2-0x0;var _0xd06e7=_0xb14c[_0x1896d2];return _0xd06e7;};'use strict';var _=require(_0xcb14('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb14('0x1'));var moment=require('moment');var BPromise=require(_0xcb14('0x2'));var rp=require(_0xcb14('0x3'));var fs=require('fs');var path=require(_0xcb14('0x4'));var rimraf=require('rimraf');var config=require(_0xcb14('0x5'));var attributes=require(_0xcb14('0x6'));module['exports']=function(_0x1f2a6f,_0x3e6fed){return _0x1f2a6f[_0xcb14('0x7')](_0xcb14('0x8'),attributes,{'tableName':_0xcb14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e7b=['bluebird','request-promise','path','rimraf','./condition.attributes','define','tools_conditions','lodash','util','../../config/logger'];(function(_0x2f9915,_0x99104){var _0x584ad9=function(_0x20752d){while(--_0x20752d){_0x2f9915['push'](_0x2f9915['shift']());}};_0x584ad9(++_0x99104);}(_0x0e7b,0x129));var _0xb0e7=function(_0xc8da28,_0x52dbe3){_0xc8da28=_0xc8da28-0x0;var _0x221431=_0x0e7b[_0xc8da28];return _0x221431;};'use strict';var _=require(_0xb0e7('0x0'));var util=require(_0xb0e7('0x1'));var logger=require(_0xb0e7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb0e7('0x3'));var rp=require(_0xb0e7('0x4'));var fs=require('fs');var path=require(_0xb0e7('0x5'));var rimraf=require(_0xb0e7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb0e7('0x7'));module['exports']=function(_0x9807fa,_0x5831a5){return _0x9807fa[_0xb0e7('0x8')]('Condition',attributes,{'tableName':_0xb0e7('0x9'),'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 ccdb2fe..42af2ab 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 _0x928c=['error','code','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ebbab,_0x2cbfb4){var _0x253fbc=function(_0x379b90){while(--_0x379b90){_0x1ebbab['push'](_0x1ebbab['shift']());}};_0x253fbc(++_0x2cbfb4);}(_0x928c,0x102));var _0xc928=function(_0x16b031,_0x4b619e){_0x16b031=_0x16b031-0x0;var _0x5dbf0c=_0x928c[_0x16b031];return _0x5dbf0c;};'use strict';var _=require('lodash');var util=require(_0xc928('0x0'));var moment=require(_0xc928('0x1'));var BPromise=require('bluebird');var rs=require(_0xc928('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc928('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc928('0x4'))(_0xc928('0x5'));var config=require(_0xc928('0x6'));var jayson=require(_0xc928('0x7'));var client=jayson[_0xc928('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd723,_0x159f6d,_0x46218f){return new BPromise(function(_0x3e71f0,_0x1e775c){return client[_0xc928('0x9')](_0x2cd723,_0x46218f)['then'](function(_0x5e7515){logger['info'](_0xc928('0xa'),_0x159f6d,_0xc928('0xb'));logger[_0xc928('0xc')](_0xc928('0xd'),_0x159f6d,_0xc928('0xb'),JSON[_0xc928('0xe')](_0x5e7515));if(_0x5e7515[_0xc928('0xf')]){if(_0x5e7515['error'][_0xc928('0x10')]===0x1f4){logger['error'](_0xc928('0xa'),_0x159f6d,_0x5e7515[_0xc928('0xf')]['message']);return _0x1e775c(_0x5e7515['error'][_0xc928('0x11')]);}logger[_0xc928('0xf')](_0xc928('0xa'),_0x159f6d,_0x5e7515['error']['message']);return _0x3e71f0(_0x5e7515[_0xc928('0xf')][_0xc928('0x11')]);}else{logger[_0xc928('0x12')](_0xc928('0xa'),_0x159f6d,_0xc928('0xb'));_0x3e71f0(_0x5e7515[_0xc928('0x13')][_0xc928('0x11')]);}})[_0xc928('0x14')](function(_0x3d6030){logger[_0xc928('0xf')](_0xc928('0xa'),_0x159f6d,_0x3d6030);_0x1e775c(_0x3d6030);});});} \ No newline at end of file +var _0xe6b4=['../../config/environment','client','http','request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','info','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x173fd6,_0x33b2b5){var _0x43f6e1=function(_0x400c6f){while(--_0x400c6f){_0x173fd6['push'](_0x173fd6['shift']());}};_0x43f6e1(++_0x33b2b5);}(_0xe6b4,0xa2));var _0x4e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4e6b('0x0'));var moment=require('moment');var BPromise=require(_0x4e6b('0x1'));var rs=require(_0x4e6b('0x2'));var fs=require('fs');var Redis=require(_0x4e6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e6b('0x4'));var logger=require(_0x4e6b('0x5'))('rpc');var config=require(_0x4e6b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4e6b('0x7')][_0x4e6b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3399ca,_0x403e0d,_0x29216d){return new BPromise(function(_0x420a8c,_0x256f12){return client[_0x4e6b('0x9')](_0x3399ca,_0x29216d)[_0x4e6b('0xa')](function(_0x2614c5){logger['info']('Condition,\x20%s,\x20%s',_0x403e0d,_0x4e6b('0xb'));logger[_0x4e6b('0xc')](_0x4e6b('0xd'),_0x403e0d,_0x4e6b('0xb'),JSON[_0x4e6b('0xe')](_0x2614c5));if(_0x2614c5['error']){if(_0x2614c5[_0x4e6b('0xf')][_0x4e6b('0x10')]===0x1f4){logger[_0x4e6b('0xf')](_0x4e6b('0x11'),_0x403e0d,_0x2614c5[_0x4e6b('0xf')]['message']);return _0x256f12(_0x2614c5[_0x4e6b('0xf')][_0x4e6b('0x12')]);}logger[_0x4e6b('0xf')]('Condition,\x20%s,\x20%s',_0x403e0d,_0x2614c5['error']['message']);return _0x420a8c(_0x2614c5[_0x4e6b('0xf')]['message']);}else{logger[_0x4e6b('0x13')]('Condition,\x20%s,\x20%s',_0x403e0d,_0x4e6b('0xb'));_0x420a8c(_0x2614c5[_0x4e6b('0x14')][_0x4e6b('0x12')]);}})['catch'](function(_0xf77ff5){logger['error'](_0x4e6b('0x11'),_0x403e0d,_0xf77ff5);_0x256f12(_0xf77ff5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2db0893..239bdb3 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 _0x11cf=['/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x35352a,_0x570638){var _0x59fd4c=function(_0x237e42){while(--_0x237e42){_0x35352a['push'](_0x35352a['shift']());}};_0x59fd4c(++_0x570638);}(_0x11cf,0x6e));var _0xf11c=function(_0x3c7f69,_0x268948){_0x3c7f69=_0x3c7f69-0x0;var _0x25de73=_0x11cf[_0x3c7f69];return _0x25de73;};'use strict';var multer=require(_0xf11c('0x0'));var util=require(_0xf11c('0x1'));var path=require(_0xf11c('0x2'));var timeout=require(_0xf11c('0x3'));var express=require('express');var router=express[_0xf11c('0x4')]();var auth=require(_0xf11c('0x5'));var interaction=require(_0xf11c('0x6'));var config=require(_0xf11c('0x7'));var controller=require(_0xf11c('0x8'));router[_0xf11c('0x9')](_0xf11c('0xa'),auth[_0xf11c('0xb')](),controller['update']);router[_0xf11c('0xc')]('/:id',auth[_0xf11c('0xb')](),controller[_0xf11c('0xd')]);module[_0xf11c('0xe')]=router; \ No newline at end of file +var _0x7b11=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update'];(function(_0x210ab3,_0x45cb26){var _0x7b47ee=function(_0x176f04){while(--_0x176f04){_0x210ab3['push'](_0x210ab3['shift']());}};_0x7b47ee(++_0x45cb26);}(_0x7b11,0x195));var _0x17b1=function(_0x3aa967,_0x2489c4){_0x3aa967=_0x3aa967-0x0;var _0x15ec1f=_0x7b11[_0x3aa967];return _0x15ec1f;};'use strict';var multer=require(_0x17b1('0x0'));var util=require(_0x17b1('0x1'));var path=require('path');var timeout=require(_0x17b1('0x2'));var express=require(_0x17b1('0x3'));var router=express[_0x17b1('0x4')]();var auth=require(_0x17b1('0x5'));var interaction=require(_0x17b1('0x6'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x17b1('0x7')](_0x17b1('0x8'),auth[_0x17b1('0x9')](),controller[_0x17b1('0xa')]);router['delete']('/:id',auth[_0x17b1('0x9')](),controller[_0x17b1('0xb')]);module[_0x17b1('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1414e87..d956dde 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 _0x8b6c=['exports','name','sequelize'];(function(_0x5593be,_0x428b1a){var _0x40d8ca=function(_0x120a14){while(--_0x120a14){_0x5593be['push'](_0x5593be['shift']());}};_0x40d8ca(++_0x428b1a);}(_0x8b6c,0x1eb));var _0xc8b6=function(_0x4708dd,_0x23c992){_0x4708dd=_0x4708dd-0x0;var _0xe0fc97=_0x8b6c[_0x4708dd];return _0xe0fc97;};'use strict';var Sequelize=require(_0xc8b6('0x0'));module[_0xc8b6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc8b6('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6343=['exports','STRING','name','sequelize'];(function(_0x166ffe,_0x3f9dd0){var _0x256f2b=function(_0x3c7a3b){while(--_0x3c7a3b){_0x166ffe['push'](_0x166ffe['shift']());}};_0x256f2b(++_0x3f9dd0);}(_0x6343,0x13b));var _0x3634=function(_0x56adb3,_0x5603cf){_0x56adb3=_0x56adb3-0x0;var _0x3ad4cd=_0x6343[_0x56adb3];return _0x3ad4cd;};'use strict';var Sequelize=require(_0x3634('0x0'));module[_0x3634('0x1')]={'name':{'type':Sequelize[_0x3634('0x2')],'allowNull':![],'unique':_0x3634('0x3')},'description':{'type':Sequelize[_0x3634('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b55c8ad..e0ced22 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 _0xf35b=['multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','DashboardId','DashboardItem','findOne','getItems','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./dashboard.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','then','error','stack','name','index','Dashboard','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','CustomDashboards','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf35b,0x1e5));var _0xbf35=function(_0x359e45,_0x4a55ba){_0x359e45=_0x359e45-0x0;var _0x3369e1=_0xf35b[_0x359e45];return _0x3369e1;};'use strict';var pdf=require(_0xbf35('0x0'));var emlformat=require(_0xbf35('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf35('0x2'));var moment=require(_0xbf35('0x3'));var BPromise=require(_0xbf35('0x4'));var Mustache=require(_0xbf35('0x5'));var util=require(_0xbf35('0x6'));var path=require(_0xbf35('0x7'));var sox=require('sox');var csv=require(_0xbf35('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf35('0x9'));var squel=require(_0xbf35('0xa'));var crypto=require('crypto');var jsforce=require(_0xbf35('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbf35('0x8'));var querystring=require(_0xbf35('0xc'));var Papa=require(_0xbf35('0xd'));var Redis=require(_0xbf35('0xe'));var authService=require(_0xbf35('0xf'));var qs=require(_0xbf35('0x10'));var hardwareService=require(_0xbf35('0x11'));var logger=require(_0xbf35('0x12'))('api');var utils=require(_0xbf35('0x13'));var config=require(_0xbf35('0x14'));var db=require(_0xbf35('0x15'))['db'];config['redis']=_[_0xbf35('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf35('0x17'))(new Redis(config[_0xbf35('0x18')]));require(_0xbf35('0x19'))[_0xbf35('0x1a')](socket);function respondWithStatusCode(_0x518418,_0x3fccaa){_0x3fccaa=_0x3fccaa||0xcc;return function(_0x412cfd){if(_0x412cfd){return _0x518418[_0xbf35('0x1b')](_0x3fccaa);}return _0x518418['status'](_0x3fccaa)[_0xbf35('0x1c')]();};}function respondWithResult(_0x5d7fd9,_0x18d34b){_0x18d34b=_0x18d34b||0xc8;return function(_0x27232c){if(_0x27232c){return _0x5d7fd9[_0xbf35('0x1d')](_0x18d34b)[_0xbf35('0x1e')](_0x27232c);}};}function respondWithFilteredResult(_0x48a33c,_0x1b543f){return function(_0x1b30b0){if(_0x1b30b0){var _0x2bda05=_0x1b30b0[_0xbf35('0x1f')],_0x428422=_0x1b543f['offset'],_0x488427=_0x1b543f[_0xbf35('0x20')]+_0x1b543f[_0xbf35('0x21')],_0x17e74b;if(_0x488427>=_0x2bda05){_0x488427=_0x2bda05;_0x17e74b=0xc8;}else{_0x17e74b=0xce;}_0x48a33c[_0xbf35('0x1d')](_0x17e74b);return _0x48a33c[_0xbf35('0x22')](_0xbf35('0x23'),_0x428422+'-'+_0x488427+'/'+_0x2bda05)[_0xbf35('0x1e')](_0x1b30b0);}return null;};}function patchUpdates(_0x1ddae9){return function(_0x332410){try{jsonpatch['apply'](_0x332410,_0x1ddae9,!![]);}catch(_0x594ca0){return BPromise[_0xbf35('0x24')](_0x594ca0);}return _0x332410[_0xbf35('0x25')]();};}function saveUpdates(_0x469f3b,_0x26c68a){return function(_0x507c6c){if(_0x507c6c){return _0x507c6c[_0xbf35('0x26')](_0x469f3b)['then'](function(_0x57b8d8){return _0x57b8d8;});}return null;};}function removeEntity(_0x3a97e6,_0x7938ca){return function(_0x4591ea){if(_0x4591ea){return _0x4591ea[_0xbf35('0x27')]()['then'](function(){var _0x39b383=_0x4591ea[_0xbf35('0x28')]({'plain':!![]});var _0x15ef3f='CustomDashboards';return db['UserProfileResource'][_0xbf35('0x27')]({'where':{'type':_0x15ef3f,'resourceId':_0x39b383['id']}})[_0xbf35('0x29')](function(){return _0x4591ea;});})[_0xbf35('0x29')](function(){_0x3a97e6[_0xbf35('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4768a6,_0x21dd01){return function(_0x4241de){if(!_0x4241de){_0x4768a6[_0xbf35('0x1b')](0x194);}return _0x4241de;};}function handleError(_0x391d2e,_0x1d3d04){_0x1d3d04=_0x1d3d04||0x1f4;return function(_0x1e7fd5){logger[_0xbf35('0x2a')](_0x1e7fd5[_0xbf35('0x2b')]);if(_0x1e7fd5[_0xbf35('0x2c')]){delete _0x1e7fd5[_0xbf35('0x2c')];}_0x391d2e[_0xbf35('0x1d')](_0x1d3d04)['send'](_0x1e7fd5);};}exports[_0xbf35('0x2d')]=function(_0x3a4508,_0x36d43f){var _0x48a2fc={},_0x21edf0={},_0x1db38f={'count':0x0,'rows':[]};var _0x3e46c7=db[_0xbf35('0x2e')]['rawAttributes'];_0x21edf0['model']=_[_0xbf35('0x2f')](_0x3e46c7);_0x21edf0[_0xbf35('0x30')]=_[_0xbf35('0x2f')](_0x3a4508['query']);_0x21edf0[_0xbf35('0x31')]=_[_0xbf35('0x32')](_0x21edf0[_0xbf35('0x33')],_0x21edf0['query']);_0x48a2fc[_0xbf35('0x34')]=_['intersection'](_0x21edf0['model'],qs[_0xbf35('0x35')](_0x3a4508[_0xbf35('0x30')]['fields']));_0x48a2fc['attributes']=_0x48a2fc[_0xbf35('0x34')][_0xbf35('0x36')]?_0x48a2fc['attributes']:_0x21edf0[_0xbf35('0x33')];if(!_0x3a4508['query'][_0xbf35('0x37')](_0xbf35('0x38'))){_0x48a2fc[_0xbf35('0x21')]=qs[_0xbf35('0x21')](_0x3a4508[_0xbf35('0x30')]['limit']);_0x48a2fc[_0xbf35('0x20')]=qs[_0xbf35('0x20')](_0x3a4508['query'][_0xbf35('0x20')]);}_0x48a2fc[_0xbf35('0x39')]=qs[_0xbf35('0x3a')](_0x3a4508['query']['sort']);_0x48a2fc[_0xbf35('0x3b')]=qs[_0xbf35('0x31')](_[_0xbf35('0x3c')](_0x3a4508[_0xbf35('0x30')],_0x21edf0[_0xbf35('0x31')]));if(_0x3a4508[_0xbf35('0x30')][_0xbf35('0x3d')]){_0x48a2fc['where']=_[_0xbf35('0x3e')](_0x48a2fc[_0xbf35('0x3b')],{'$or':_[_0xbf35('0x3f')](_0x3e46c7,function(_0x20f8dd){if(_0x20f8dd[_0xbf35('0x40')]['key']!==_0xbf35('0x41')){var _0x59bc30={};_0x59bc30[_0x20f8dd[_0xbf35('0x42')]]={'$like':'%'+_0x3a4508[_0xbf35('0x30')][_0xbf35('0x3d')]+'%'};return _0x59bc30;}})});}_0x48a2fc=_[_0xbf35('0x3e')]({},_0x48a2fc,_0x3a4508[_0xbf35('0x43')]);var _0xd3970a={'where':_0x48a2fc[_0xbf35('0x3b')]};return db[_0xbf35('0x2e')][_0xbf35('0x1f')](_0xd3970a)[_0xbf35('0x29')](function(_0x389dce){_0x1db38f[_0xbf35('0x1f')]=_0x389dce;if(_0x3a4508[_0xbf35('0x30')][_0xbf35('0x44')]){_0x48a2fc[_0xbf35('0x45')]=[{'all':!![]}];}return db[_0xbf35('0x2e')]['findAll'](_0x48a2fc);})[_0xbf35('0x29')](function(_0x906ab4){_0x1db38f[_0xbf35('0x46')]=_0x906ab4;return _0x1db38f;})[_0xbf35('0x29')](respondWithFilteredResult(_0x36d43f,_0x48a2fc))[_0xbf35('0x47')](handleError(_0x36d43f,null));};exports[_0xbf35('0x48')]=function(_0x5c64b1,_0x1c7bd3){var _0x570c37={'raw':![],'where':{'id':_0x5c64b1[_0xbf35('0x49')]['id']}},_0xd43a5e={};_0xd43a5e[_0xbf35('0x33')]=_[_0xbf35('0x2f')](db[_0xbf35('0x2e')][_0xbf35('0x4a')]);_0xd43a5e[_0xbf35('0x30')]=_[_0xbf35('0x2f')](_0x5c64b1[_0xbf35('0x30')]);_0xd43a5e[_0xbf35('0x31')]=_[_0xbf35('0x32')](_0xd43a5e[_0xbf35('0x33')],_0xd43a5e[_0xbf35('0x30')]);_0x570c37['attributes']=_[_0xbf35('0x32')](_0xd43a5e[_0xbf35('0x33')],qs[_0xbf35('0x35')](_0x5c64b1['query']['fields']));_0x570c37[_0xbf35('0x34')]=_0x570c37[_0xbf35('0x34')][_0xbf35('0x36')]?_0x570c37['attributes']:_0xd43a5e[_0xbf35('0x33')];if(_0x5c64b1[_0xbf35('0x30')][_0xbf35('0x44')]){_0x570c37[_0xbf35('0x45')]=[{'all':!![]}];}_0x570c37=_[_0xbf35('0x3e')]({},_0x570c37,_0x5c64b1[_0xbf35('0x43')]);return db['Dashboard'][_0xbf35('0x4b')](_0x570c37)[_0xbf35('0x29')](handleEntityNotFound(_0x1c7bd3,null))[_0xbf35('0x29')](respondWithResult(_0x1c7bd3,null))[_0xbf35('0x47')](handleError(_0x1c7bd3,null));};exports['create']=function(_0x30fbf5,_0x108706){return db[_0xbf35('0x2e')][_0xbf35('0x4c')](_0x30fbf5['body'],{})[_0xbf35('0x29')](function(_0x19f169){var _0x9233ad=_0x30fbf5[_0xbf35('0x4d')][_0xbf35('0x28')]({'plain':!![]});if(!_0x9233ad)throw new Error(_0xbf35('0x4e'));if(_0x9233ad[_0xbf35('0x4f')]===_0xbf35('0x4d')){var _0x3ff28b=_0x19f169[_0xbf35('0x28')]({'plain':!![]});var _0x366aa1='CustomDashboards';return db[_0xbf35('0x50')][_0xbf35('0x4b')]({'where':{'name':_0x366aa1,'userProfileId':_0x9233ad[_0xbf35('0x51')]},'raw':!![]})[_0xbf35('0x29')](function(_0x53cc2e){if(_0x53cc2e&&_0x53cc2e[_0xbf35('0x52')]===0x0){return db[_0xbf35('0x53')][_0xbf35('0x4c')]({'name':_0x3ff28b['name'],'resourceId':_0x3ff28b['id'],'type':_0x53cc2e[_0xbf35('0x2c')],'sectionId':_0x53cc2e['id']},{})[_0xbf35('0x29')](function(){return _0x19f169;});}else{return _0x19f169;}})[_0xbf35('0x47')](function(_0x5c5bef){logger[_0xbf35('0x2a')](_0xbf35('0x54'),_0x5c5bef);throw _0x5c5bef;});}return _0x19f169;})[_0xbf35('0x29')](respondWithResult(_0x108706,0xc9))[_0xbf35('0x47')](handleError(_0x108706,null));};exports['clone']=function(_0x1e3df9,_0x5f5705){var _0x41eb0b={'raw':![],'where':{'id':_0x1e3df9[_0xbf35('0x49')]['id']}},_0x4bcd02={};_0x4bcd02[_0xbf35('0x33')]=_[_0xbf35('0x2f')](db[_0xbf35('0x2e')][_0xbf35('0x4a')]);_0x41eb0b[_0xbf35('0x34')]=_[_0xbf35('0x32')](_0x4bcd02[_0xbf35('0x33')],qs[_0xbf35('0x35')](_0x1e3df9[_0xbf35('0x30')][_0xbf35('0x35')]));_0x41eb0b[_0xbf35('0x34')]=_0x41eb0b['attributes']['length']?_0x41eb0b[_0xbf35('0x34')]:_0x4bcd02[_0xbf35('0x33')];if(_0x1e3df9[_0xbf35('0x30')]['includeAll']){_0x41eb0b['include']=[{'all':!![]}];}_0x41eb0b=_['merge']({},_0x41eb0b,_0x1e3df9['options']);return db[_0xbf35('0x2e')]['find'](_0x41eb0b)[_0xbf35('0x29')](handleEntityNotFound(_0x5f5705,null))[_0xbf35('0x29')](function(_0x8b46ac){if(_0x8b46ac){var _0x3cc79e=_0x8b46ac[_0xbf35('0x28')]({'plain':!![]});_0x3cc79e=qs[_0xbf35('0x55')](_0x3cc79e,['id',_0xbf35('0x56'),_0xbf35('0x57')]);_0x1e3df9[_0xbf35('0x58')]=_['omit'](_0x1e3df9[_0xbf35('0x58')],['id',_0xbf35('0x56'),'updatedAt']);return db['Dashboard']['create'](_[_0xbf35('0x3e')](_0x3cc79e,_0x1e3df9[_0xbf35('0x58')]),{'include':_0x1e3df9[_0xbf35('0x30')][_0xbf35('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x79b2e){var _0x3edfd0=_0x1e3df9[_0xbf35('0x4d')][_0xbf35('0x28')]({'plain':!![]});if(!_0x3edfd0)throw new Error(_0xbf35('0x4e'));if(_0x3edfd0[_0xbf35('0x4f')]===_0xbf35('0x4d')){var _0x151b8f=_0x79b2e[_0xbf35('0x28')]({'plain':!![]});var _0x24aa81=_0xbf35('0x59');return db[_0xbf35('0x50')][_0xbf35('0x4b')]({'where':{'name':_0x24aa81,'userProfileId':_0x3edfd0[_0xbf35('0x51')]},'raw':!![]})[_0xbf35('0x29')](function(_0x56ce6f){if(_0x56ce6f&&_0x56ce6f[_0xbf35('0x52')]===0x0){return db[_0xbf35('0x53')][_0xbf35('0x4c')]({'name':_0x151b8f[_0xbf35('0x2c')],'resourceId':_0x151b8f['id'],'type':_0x56ce6f[_0xbf35('0x2c')],'sectionId':_0x56ce6f['id']},{})['then'](function(){return _0x79b2e;});}else{return _0x79b2e;}})[_0xbf35('0x47')](function(_0x4a8727){logger[_0xbf35('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a8727);throw _0x4a8727;});}return _0x79b2e;});}})['then'](respondWithResult(_0x5f5705,0xc9))[_0xbf35('0x47')](handleError(_0x5f5705,null));};exports[_0xbf35('0x26')]=function(_0x5bc8aa,_0x2e64f8){if(_0x5bc8aa[_0xbf35('0x58')]['id']){delete _0x5bc8aa[_0xbf35('0x58')]['id'];}return db['Dashboard'][_0xbf35('0x4b')]({'where':{'id':_0x5bc8aa['params']['id']}})[_0xbf35('0x29')](handleEntityNotFound(_0x2e64f8,null))[_0xbf35('0x29')](saveUpdates(_0x5bc8aa[_0xbf35('0x58')],null))[_0xbf35('0x29')](respondWithResult(_0x2e64f8,null))[_0xbf35('0x47')](handleError(_0x2e64f8,null));};exports[_0xbf35('0x27')]=function(_0x262bb1,_0x12f836){return db[_0xbf35('0x2e')][_0xbf35('0x4b')]({'where':{'id':_0x262bb1[_0xbf35('0x49')]['id']}})[_0xbf35('0x29')](handleEntityNotFound(_0x12f836,null))[_0xbf35('0x29')](removeEntity(_0x12f836,null))[_0xbf35('0x47')](handleError(_0x12f836,null));};function widgetAttributes(_0x45b4ab){try{switch(_0x45b4ab[_0xbf35('0x40')]){case _0xbf35('0x5a'):return[{'name':'attrUrl','value':_0x45b4ab['attrUrl']||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab[_0xbf35('0x5b')][0x0][_0xbf35('0x5c')]:undefined)||_0xbf35('0x5d')}];case'custom':return[{'name':_0xbf35('0x5e'),'value':_0x45b4ab['attrPath']||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab['attrs'][0x0][_0xbf35('0x5c')]:undefined)||''}];case _0xbf35('0x5f'):return[{'name':_0xbf35('0x60'),'value':_0x45b4ab[_0xbf35('0x60')]||(_0x45b4ab['attrs']&&_0x45b4ab['attrs'][0x0]?_0x45b4ab[_0xbf35('0x5b')][0x0][_0xbf35('0x5c')]:undefined)||_0xbf35('0x61')},{'name':_0xbf35('0x62'),'value':_0x45b4ab[_0xbf35('0x62')]||(_0x45b4ab['attrs']&&_0x45b4ab[_0xbf35('0x5b')][0x1]?_0x45b4ab['attrs'][0x1][_0xbf35('0x5c')]:undefined)||_0xbf35('0x63')},{'name':_0xbf35('0x64'),'value':_0x45b4ab[_0xbf35('0x64')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab['attrs'][0x2]?_0x45b4ab['attrs'][0x2][_0xbf35('0x5c')]:undefined)||0xc}];case _0xbf35('0x65'):return[{'name':_0xbf35('0x66'),'value':_0x45b4ab[_0xbf35('0x66')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab['attrs'][0x0]['value']:undefined)||_0xbf35('0x67')},{'name':_0xbf35('0x68'),'value':_0x45b4ab[_0xbf35('0x68')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab['attrs'][0x1]?_0x45b4ab['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x45b4ab['attrFontSize']||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab['attrs'][0x2]?_0x45b4ab[_0xbf35('0x5b')][0x2][_0xbf35('0x5c')]:undefined)||0x14}];case _0xbf35('0x69'):case'pie-chart':return[{'name':_0xbf35('0x6a'),'value':_0x45b4ab['attrSerie1']||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab[_0xbf35('0x5b')][0x0][_0xbf35('0x5c')]:undefined)||_0xbf35('0x67')},{'name':_0xbf35('0x6b'),'value':_0x45b4ab[_0xbf35('0x6b')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x1]?_0x45b4ab['attrs'][0x1][_0xbf35('0x5c')]:undefined)||null},{'name':'attrSerie3','value':_0x45b4ab[_0xbf35('0x6c')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x2]?_0x45b4ab['attrs'][0x2][_0xbf35('0x5c')]:undefined)||null},{'name':_0xbf35('0x68'),'value':_0x45b4ab['attrVoiceQueues']||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab['attrs'][0x3]?_0x45b4ab['attrs'][0x3]['value']:undefined)||[]}];case _0xbf35('0x6d'):return[{'name':_0xbf35('0x6e'),'type':_0x45b4ab[_0xbf35('0x6f')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab[_0xbf35('0x5b')][0x0][_0xbf35('0x40')]:undefined)||null,'value':_0x45b4ab[_0xbf35('0x6e')]||(_0x45b4ab[_0xbf35('0x5b')]&&_0x45b4ab[_0xbf35('0x5b')][0x0]?_0x45b4ab[_0xbf35('0x5b')][0x0][_0xbf35('0x5c')]:undefined)||null},{'name':_0xbf35('0x70'),'value':_0x45b4ab[_0xbf35('0x70')]||(_0x45b4ab['attrs']&&_0x45b4ab[_0xbf35('0x5b')][0x1]?_0x45b4ab[_0xbf35('0x5b')][0x1][_0xbf35('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2f3e3c){logger[_0xbf35('0x2a')]('widgetAttributes:\x20%s',JSON[_0xbf35('0x71')](_0x2f3e3c));return[];}}exports['addItem']=function(_0x3d23e3,_0x516a56,_0x76e805){if(_0x3d23e3['body']['id']){delete _0x3d23e3[_0xbf35('0x58')]['id'];}return db['Dashboard'][_0xbf35('0x4b')]({'where':{'id':_0x3d23e3['params']['id']}})[_0xbf35('0x29')](handleEntityNotFound(_0x516a56,null))[_0xbf35('0x29')](function(_0x57a240){if(_0x57a240){_0x3d23e3[_0xbf35('0x58')][_0xbf35('0x72')]=_0x57a240['id'];_0x3d23e3[_0xbf35('0x58')]['attrs']=widgetAttributes(_0x3d23e3[_0xbf35('0x58')]);return db[_0xbf35('0x73')][_0xbf35('0x4c')](_0x3d23e3['body']);}})[_0xbf35('0x29')](respondWithResult(_0x516a56,null))[_0xbf35('0x47')](handleError(_0x516a56,null));};exports['getItems']=function(_0x5f12d3,_0x4894eb,_0x504717){var _0x14043f={};var _0x232481={};var _0x2d6a62;var _0x338c67;return db[_0xbf35('0x2e')][_0xbf35('0x74')]({'where':{'id':_0x5f12d3[_0xbf35('0x49')]['id']}})[_0xbf35('0x29')](handleEntityNotFound(_0x4894eb,null))[_0xbf35('0x29')](function(_0x1b8f98){if(_0x1b8f98){_0x2d6a62=_0x1b8f98;_0x232481[_0xbf35('0x33')]=_[_0xbf35('0x2f')](db[_0xbf35('0x73')][_0xbf35('0x4a')]);_0x232481[_0xbf35('0x30')]=_[_0xbf35('0x2f')](_0x5f12d3[_0xbf35('0x30')]);_0x232481[_0xbf35('0x31')]=_['intersection'](_0x232481[_0xbf35('0x33')],_0x232481[_0xbf35('0x30')]);_0x14043f[_0xbf35('0x34')]=_[_0xbf35('0x32')](_0x232481[_0xbf35('0x33')],qs[_0xbf35('0x35')](_0x5f12d3[_0xbf35('0x30')][_0xbf35('0x35')]));_0x14043f['attributes']=_0x14043f[_0xbf35('0x34')][_0xbf35('0x36')]?_0x14043f[_0xbf35('0x34')]:_0x232481['model'];_0x14043f['order']=qs['sort'](_0x5f12d3['query'][_0xbf35('0x3a')]);_0x14043f[_0xbf35('0x3b')]=qs[_0xbf35('0x31')](_['pick'](_0x5f12d3[_0xbf35('0x30')],_0x232481[_0xbf35('0x31')]));if(_0x5f12d3[_0xbf35('0x30')][_0xbf35('0x3d')]){_0x14043f[_0xbf35('0x3b')]=_['merge'](_0x14043f[_0xbf35('0x3b')],{'$or':_[_0xbf35('0x3f')](_0x14043f[_0xbf35('0x34')],function(_0x1bde08){var _0x13e3e2={};_0x13e3e2[_0x1bde08]={'$like':'%'+_0x5f12d3[_0xbf35('0x30')][_0xbf35('0x3d')]+'%'};return _0x13e3e2;})});}_0x14043f=_[_0xbf35('0x3e')]({},_0x14043f,_0x5f12d3[_0xbf35('0x43')]);return _0x2d6a62[_0xbf35('0x75')](_0x14043f);}})[_0xbf35('0x29')](function(_0xf74d){if(_0xf74d){_0x338c67=_0xf74d['length'];if(!_0x5f12d3[_0xbf35('0x30')]['hasOwnProperty']('nolimit')){_0x14043f[_0xbf35('0x21')]=qs[_0xbf35('0x21')](_0x5f12d3['query'][_0xbf35('0x21')]);_0x14043f[_0xbf35('0x20')]=qs[_0xbf35('0x20')](_0x5f12d3[_0xbf35('0x30')][_0xbf35('0x20')]);}return _0x2d6a62['getItems'](_0x14043f);}})['then'](function(_0x57cead){if(_0x57cead){return _0x57cead?{'count':_0x338c67,'rows':_0x57cead}:null;}})[_0xbf35('0x29')](respondWithResult(_0x4894eb,null))[_0xbf35('0x47')](handleError(_0x4894eb,null));}; \ No newline at end of file +var _0x1ae3=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','field','merge','options','include','findAll','rows','catch','show','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rawAttributes','omit','updatedAt','UserProfileResource','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','map','html-pdf','eml-format','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/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','index','Dashboard','model','keys','query','filters','intersection'];(function(_0x16329a,_0x315c26){var _0x5009f0=function(_0x3d3c1a){while(--_0x3d3c1a){_0x16329a['push'](_0x16329a['shift']());}};_0x5009f0(++_0x315c26);}(_0x1ae3,0x139));var _0x31ae=function(_0x2fd7d5,_0x3ac631){_0x2fd7d5=_0x2fd7d5-0x0;var _0x54bb19=_0x1ae3[_0x2fd7d5];return _0x54bb19;};'use strict';var pdf=require(_0x31ae('0x0'));var emlformat=require(_0x31ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x31ae('0x2'));var jsonpatch=require(_0x31ae('0x3'));var rp=require(_0x31ae('0x4'));var moment=require(_0x31ae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31ae('0x6'));var util=require(_0x31ae('0x7'));var path=require(_0x31ae('0x8'));var sox=require(_0x31ae('0x9'));var csv=require(_0x31ae('0xa'));var ejs=require(_0x31ae('0xb'));var fs=require('fs');var _=require(_0x31ae('0xc'));var squel=require(_0x31ae('0xd'));var crypto=require(_0x31ae('0xe'));var jsforce=require(_0x31ae('0xf'));var deskjs=require(_0x31ae('0x10'));var toCsv=require(_0x31ae('0xa'));var querystring=require(_0x31ae('0x11'));var Papa=require(_0x31ae('0x12'));var Redis=require(_0x31ae('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x31ae('0x14'));var hardwareService=require(_0x31ae('0x15'));var logger=require(_0x31ae('0x16'))('api');var utils=require(_0x31ae('0x17'));var config=require(_0x31ae('0x18'));var db=require('../../mysqldb')['db'];config[_0x31ae('0x19')]=_['defaults'](config[_0x31ae('0x19')],{'host':_0x31ae('0x1a'),'port':0x18eb});var socket=require(_0x31ae('0x1b'))(new Redis(config['redis']));require(_0x31ae('0x1c'))[_0x31ae('0x1d')](socket);function respondWithStatusCode(_0x201e43,_0x3ba04a){_0x3ba04a=_0x3ba04a||0xcc;return function(_0x2b1fc2){if(_0x2b1fc2){return _0x201e43[_0x31ae('0x1e')](_0x3ba04a);}return _0x201e43['status'](_0x3ba04a)[_0x31ae('0x1f')]();};}function respondWithResult(_0x11abd4,_0x1ec358){_0x1ec358=_0x1ec358||0xc8;return function(_0x314849){if(_0x314849){return _0x11abd4[_0x31ae('0x20')](_0x1ec358)[_0x31ae('0x21')](_0x314849);}};}function respondWithFilteredResult(_0x25be89,_0x379c51){return function(_0x5aa824){if(_0x5aa824){var _0xcd30cc=_0x5aa824[_0x31ae('0x22')],_0x58d574=_0x379c51[_0x31ae('0x23')],_0xf9dd56=_0x379c51[_0x31ae('0x23')]+_0x379c51[_0x31ae('0x24')],_0x1698d7;if(_0xf9dd56>=_0xcd30cc){_0xf9dd56=_0xcd30cc;_0x1698d7=0xc8;}else{_0x1698d7=0xce;}_0x25be89[_0x31ae('0x20')](_0x1698d7);return _0x25be89[_0x31ae('0x25')](_0x31ae('0x26'),_0x58d574+'-'+_0xf9dd56+'/'+_0xcd30cc)[_0x31ae('0x21')](_0x5aa824);}return null;};}function patchUpdates(_0x3917af){return function(_0x1e4e63){try{jsonpatch['apply'](_0x1e4e63,_0x3917af,!![]);}catch(_0x448cc2){return BPromise[_0x31ae('0x27')](_0x448cc2);}return _0x1e4e63[_0x31ae('0x28')]();};}function saveUpdates(_0x23d875,_0x5c60ef){return function(_0x2729b0){if(_0x2729b0){return _0x2729b0[_0x31ae('0x29')](_0x23d875)['then'](function(_0x27ccad){return _0x27ccad;});}return null;};}function removeEntity(_0x4969e3,_0xd24bd5){return function(_0x56f9c4){if(_0x56f9c4){return _0x56f9c4['destroy']()[_0x31ae('0x2a')](function(){var _0x24b720=_0x56f9c4[_0x31ae('0x2b')]({'plain':!![]});var _0x4c86ba='CustomDashboards';return db['UserProfileResource'][_0x31ae('0x2c')]({'where':{'type':_0x4c86ba,'resourceId':_0x24b720['id']}})['then'](function(){return _0x56f9c4;});})[_0x31ae('0x2a')](function(){_0x4969e3[_0x31ae('0x20')](0xcc)[_0x31ae('0x1f')]();});}};}function handleEntityNotFound(_0xb99935,_0x3bb96a){return function(_0x2e4222){if(!_0x2e4222){_0xb99935[_0x31ae('0x1e')](0x194);}return _0x2e4222;};}function handleError(_0x16ea63,_0x54676f){_0x54676f=_0x54676f||0x1f4;return function(_0x258e48){logger[_0x31ae('0x2d')](_0x258e48[_0x31ae('0x2e')]);if(_0x258e48[_0x31ae('0x2f')]){delete _0x258e48['name'];}_0x16ea63[_0x31ae('0x20')](_0x54676f)[_0x31ae('0x30')](_0x258e48);};}exports[_0x31ae('0x31')]=function(_0x2c278b,_0x2cee41){var _0x9f99eb={},_0x47b1ba={},_0x4d2172={'count':0x0,'rows':[]};var _0x508f3c=db[_0x31ae('0x32')]['rawAttributes'];_0x47b1ba[_0x31ae('0x33')]=_[_0x31ae('0x34')](_0x508f3c);_0x47b1ba['query']=_[_0x31ae('0x34')](_0x2c278b[_0x31ae('0x35')]);_0x47b1ba[_0x31ae('0x36')]=_[_0x31ae('0x37')](_0x47b1ba['model'],_0x47b1ba[_0x31ae('0x35')]);_0x9f99eb[_0x31ae('0x38')]=_['intersection'](_0x47b1ba['model'],qs['fields'](_0x2c278b[_0x31ae('0x35')][_0x31ae('0x39')]));_0x9f99eb[_0x31ae('0x38')]=_0x9f99eb[_0x31ae('0x38')][_0x31ae('0x3a')]?_0x9f99eb['attributes']:_0x47b1ba[_0x31ae('0x33')];if(!_0x2c278b[_0x31ae('0x35')][_0x31ae('0x3b')](_0x31ae('0x3c'))){_0x9f99eb[_0x31ae('0x24')]=qs[_0x31ae('0x24')](_0x2c278b[_0x31ae('0x35')][_0x31ae('0x24')]);_0x9f99eb[_0x31ae('0x23')]=qs[_0x31ae('0x23')](_0x2c278b[_0x31ae('0x35')][_0x31ae('0x23')]);}_0x9f99eb['order']=qs[_0x31ae('0x3d')](_0x2c278b[_0x31ae('0x35')]['sort']);_0x9f99eb[_0x31ae('0x3e')]=qs[_0x31ae('0x36')](_[_0x31ae('0x3f')](_0x2c278b[_0x31ae('0x35')],_0x47b1ba[_0x31ae('0x36')]));if(_0x2c278b['query'][_0x31ae('0x40')]){_0x9f99eb['where']=_['merge'](_0x9f99eb[_0x31ae('0x3e')],{'$or':_['map'](_0x508f3c,function(_0x322d7e){if(_0x322d7e['type']['key']!==_0x31ae('0x41')){var _0x32e451={};_0x32e451[_0x322d7e[_0x31ae('0x42')]]={'$like':'%'+_0x2c278b[_0x31ae('0x35')]['filter']+'%'};return _0x32e451;}})});}_0x9f99eb=_[_0x31ae('0x43')]({},_0x9f99eb,_0x2c278b[_0x31ae('0x44')]);var _0x1c88c4={'where':_0x9f99eb[_0x31ae('0x3e')]};return db[_0x31ae('0x32')][_0x31ae('0x22')](_0x1c88c4)['then'](function(_0x49276e){_0x4d2172[_0x31ae('0x22')]=_0x49276e;if(_0x2c278b[_0x31ae('0x35')]['includeAll']){_0x9f99eb[_0x31ae('0x45')]=[{'all':!![]}];}return db[_0x31ae('0x32')][_0x31ae('0x46')](_0x9f99eb);})[_0x31ae('0x2a')](function(_0x1f50db){_0x4d2172[_0x31ae('0x47')]=_0x1f50db;return _0x4d2172;})['then'](respondWithFilteredResult(_0x2cee41,_0x9f99eb))[_0x31ae('0x48')](handleError(_0x2cee41,null));};exports[_0x31ae('0x49')]=function(_0x20959f,_0x550363){var _0x26fb69={'raw':![],'where':{'id':_0x20959f['params']['id']}},_0x36ae0d={};_0x36ae0d[_0x31ae('0x33')]=_[_0x31ae('0x34')](db[_0x31ae('0x32')]['rawAttributes']);_0x36ae0d[_0x31ae('0x35')]=_[_0x31ae('0x34')](_0x20959f[_0x31ae('0x35')]);_0x36ae0d['filters']=_[_0x31ae('0x37')](_0x36ae0d[_0x31ae('0x33')],_0x36ae0d[_0x31ae('0x35')]);_0x26fb69['attributes']=_[_0x31ae('0x37')](_0x36ae0d[_0x31ae('0x33')],qs['fields'](_0x20959f[_0x31ae('0x35')][_0x31ae('0x39')]));_0x26fb69[_0x31ae('0x38')]=_0x26fb69[_0x31ae('0x38')][_0x31ae('0x3a')]?_0x26fb69[_0x31ae('0x38')]:_0x36ae0d[_0x31ae('0x33')];if(_0x20959f[_0x31ae('0x35')][_0x31ae('0x4a')]){_0x26fb69[_0x31ae('0x45')]=[{'all':!![]}];}_0x26fb69=_[_0x31ae('0x43')]({},_0x26fb69,_0x20959f['options']);return db[_0x31ae('0x32')]['find'](_0x26fb69)[_0x31ae('0x2a')](handleEntityNotFound(_0x550363,null))[_0x31ae('0x2a')](respondWithResult(_0x550363,null))[_0x31ae('0x48')](handleError(_0x550363,null));};exports[_0x31ae('0x4b')]=function(_0x381f2a,_0x1fcdde){return db[_0x31ae('0x32')][_0x31ae('0x4b')](_0x381f2a[_0x31ae('0x4c')],{})[_0x31ae('0x2a')](function(_0x27c296){var _0x11f221=_0x381f2a['user'][_0x31ae('0x2b')]({'plain':!![]});if(!_0x11f221)throw new Error(_0x31ae('0x4d'));if(_0x11f221[_0x31ae('0x4e')]===_0x31ae('0x4f')){var _0x41dd33=_0x27c296[_0x31ae('0x2b')]({'plain':!![]});var _0x22ffac=_0x31ae('0x50');return db[_0x31ae('0x51')][_0x31ae('0x52')]({'where':{'name':_0x22ffac,'userProfileId':_0x11f221['userProfileId']},'raw':!![]})[_0x31ae('0x2a')](function(_0x48bafb){if(_0x48bafb&&_0x48bafb[_0x31ae('0x53')]===0x0){return db['UserProfileResource'][_0x31ae('0x4b')]({'name':_0x41dd33['name'],'resourceId':_0x41dd33['id'],'type':_0x48bafb[_0x31ae('0x2f')],'sectionId':_0x48bafb['id']},{})[_0x31ae('0x2a')](function(){return _0x27c296;});}else{return _0x27c296;}})[_0x31ae('0x48')](function(_0xe561d6){logger[_0x31ae('0x2d')](_0x31ae('0x54'),_0xe561d6);throw _0xe561d6;});}return _0x27c296;})[_0x31ae('0x2a')](respondWithResult(_0x1fcdde,0xc9))[_0x31ae('0x48')](handleError(_0x1fcdde,null));};exports['clone']=function(_0x2e1b23,_0x2c3963){var _0x2b2e02={'raw':![],'where':{'id':_0x2e1b23[_0x31ae('0x55')]['id']}},_0x2ba983={};_0x2ba983[_0x31ae('0x33')]=_[_0x31ae('0x34')](db[_0x31ae('0x32')][_0x31ae('0x56')]);_0x2b2e02[_0x31ae('0x38')]=_['intersection'](_0x2ba983['model'],qs[_0x31ae('0x39')](_0x2e1b23[_0x31ae('0x35')][_0x31ae('0x39')]));_0x2b2e02['attributes']=_0x2b2e02[_0x31ae('0x38')][_0x31ae('0x3a')]?_0x2b2e02[_0x31ae('0x38')]:_0x2ba983[_0x31ae('0x33')];if(_0x2e1b23[_0x31ae('0x35')][_0x31ae('0x4a')]){_0x2b2e02[_0x31ae('0x45')]=[{'all':!![]}];}_0x2b2e02=_[_0x31ae('0x43')]({},_0x2b2e02,_0x2e1b23['options']);return db['Dashboard']['find'](_0x2b2e02)['then'](handleEntityNotFound(_0x2c3963,null))[_0x31ae('0x2a')](function(_0x579f2a){if(_0x579f2a){var _0x1f9a46=_0x579f2a[_0x31ae('0x2b')]({'plain':!![]});_0x1f9a46=qs[_0x31ae('0x57')](_0x1f9a46,['id','createdAt',_0x31ae('0x58')]);_0x2e1b23[_0x31ae('0x4c')]=_[_0x31ae('0x57')](_0x2e1b23[_0x31ae('0x4c')],['id','createdAt','updatedAt']);return db[_0x31ae('0x32')]['create'](_['merge'](_0x1f9a46,_0x2e1b23[_0x31ae('0x4c')]),{'include':_0x2e1b23['query'][_0x31ae('0x4a')]?[{'all':!![]}]:undefined})[_0x31ae('0x2a')](function(_0x208982){var _0x463cb5=_0x2e1b23[_0x31ae('0x4f')][_0x31ae('0x2b')]({'plain':!![]});if(!_0x463cb5)throw new Error(_0x31ae('0x4d'));if(_0x463cb5[_0x31ae('0x4e')]==='user'){var _0x30d744=_0x208982[_0x31ae('0x2b')]({'plain':!![]});var _0x2343d0=_0x31ae('0x50');return db[_0x31ae('0x51')][_0x31ae('0x52')]({'where':{'name':_0x2343d0,'userProfileId':_0x463cb5['userProfileId']},'raw':!![]})[_0x31ae('0x2a')](function(_0x27f6b6){if(_0x27f6b6&&_0x27f6b6[_0x31ae('0x53')]===0x0){return db[_0x31ae('0x59')][_0x31ae('0x4b')]({'name':_0x30d744['name'],'resourceId':_0x30d744['id'],'type':_0x27f6b6[_0x31ae('0x2f')],'sectionId':_0x27f6b6['id']},{})[_0x31ae('0x2a')](function(){return _0x208982;});}else{return _0x208982;}})[_0x31ae('0x48')](function(_0x3afd16){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3afd16);throw _0x3afd16;});}return _0x208982;});}})[_0x31ae('0x2a')](respondWithResult(_0x2c3963,0xc9))[_0x31ae('0x48')](handleError(_0x2c3963,null));};exports[_0x31ae('0x29')]=function(_0x19e141,_0x14508c){if(_0x19e141[_0x31ae('0x4c')]['id']){delete _0x19e141[_0x31ae('0x4c')]['id'];}return db[_0x31ae('0x32')][_0x31ae('0x52')]({'where':{'id':_0x19e141[_0x31ae('0x55')]['id']}})['then'](handleEntityNotFound(_0x14508c,null))[_0x31ae('0x2a')](saveUpdates(_0x19e141[_0x31ae('0x4c')],null))[_0x31ae('0x2a')](respondWithResult(_0x14508c,null))[_0x31ae('0x48')](handleError(_0x14508c,null));};exports[_0x31ae('0x2c')]=function(_0x531056,_0x1bb632){return db[_0x31ae('0x32')]['find']({'where':{'id':_0x531056[_0x31ae('0x55')]['id']}})[_0x31ae('0x2a')](handleEntityNotFound(_0x1bb632,null))['then'](removeEntity(_0x1bb632,null))['catch'](handleError(_0x1bb632,null));};function widgetAttributes(_0x3a8b7c){try{switch(_0x3a8b7c[_0x31ae('0x5a')]){case _0x31ae('0x5b'):return[{'name':'attrUrl','value':_0x3a8b7c[_0x31ae('0x5c')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c[_0x31ae('0x5d')][0x0][_0x31ae('0x5e')]:undefined)||_0x31ae('0x5f')}];case _0x31ae('0x60'):return[{'name':_0x31ae('0x61'),'value':_0x3a8b7c['attrPath']||(_0x3a8b7c['attrs']&&_0x3a8b7c['attrs'][0x0]?_0x3a8b7c[_0x31ae('0x5d')][0x0][_0x31ae('0x5e')]:undefined)||''}];case _0x31ae('0x62'):return[{'name':_0x31ae('0x63'),'value':_0x3a8b7c[_0x31ae('0x63')]||(_0x3a8b7c['attrs']&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c[_0x31ae('0x5d')][0x0]['value']:undefined)||_0x31ae('0x64')},{'name':'attrTimezone','value':_0x3a8b7c[_0x31ae('0x65')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x1]?_0x3a8b7c[_0x31ae('0x5d')][0x1][_0x31ae('0x5e')]:undefined)||'0.00'},{'name':_0x31ae('0x66'),'value':_0x3a8b7c[_0x31ae('0x66')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x2]?_0x3a8b7c[_0x31ae('0x5d')][0x2][_0x31ae('0x5e')]:undefined)||0xc}];case _0x31ae('0x67'):return[{'name':_0x31ae('0x68'),'value':_0x3a8b7c[_0x31ae('0x68')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c[_0x31ae('0x5d')][0x0][_0x31ae('0x5e')]:undefined)||'total'},{'name':_0x31ae('0x69'),'value':_0x3a8b7c[_0x31ae('0x69')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c['attrs'][0x1]?_0x3a8b7c[_0x31ae('0x5d')][0x1][_0x31ae('0x5e')]:undefined)||[]},{'name':_0x31ae('0x66'),'value':_0x3a8b7c['attrFontSize']||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x2]?_0x3a8b7c['attrs'][0x2][_0x31ae('0x5e')]:undefined)||0x14}];case _0x31ae('0x6a'):case _0x31ae('0x6b'):return[{'name':_0x31ae('0x6c'),'value':_0x3a8b7c[_0x31ae('0x6c')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c['attrs'][0x0][_0x31ae('0x5e')]:undefined)||_0x31ae('0x6d')},{'name':_0x31ae('0x6e'),'value':_0x3a8b7c['attrSerie2']||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x1]?_0x3a8b7c[_0x31ae('0x5d')][0x1][_0x31ae('0x5e')]:undefined)||null},{'name':_0x31ae('0x6f'),'value':_0x3a8b7c[_0x31ae('0x6f')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c['attrs'][0x2]?_0x3a8b7c[_0x31ae('0x5d')][0x2][_0x31ae('0x5e')]:undefined)||null},{'name':_0x31ae('0x69'),'value':_0x3a8b7c[_0x31ae('0x69')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x3]?_0x3a8b7c['attrs'][0x3]['value']:undefined)||[]}];case _0x31ae('0x70'):return[{'name':_0x31ae('0x71'),'type':_0x3a8b7c[_0x31ae('0x72')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c['attrs'][0x0][_0x31ae('0x5a')]:undefined)||null,'value':_0x3a8b7c[_0x31ae('0x71')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c[_0x31ae('0x5d')][0x0]?_0x3a8b7c[_0x31ae('0x5d')][0x0][_0x31ae('0x5e')]:undefined)||null},{'name':_0x31ae('0x73'),'value':_0x3a8b7c[_0x31ae('0x73')]||(_0x3a8b7c[_0x31ae('0x5d')]&&_0x3a8b7c['attrs'][0x1]?_0x3a8b7c[_0x31ae('0x5d')][0x1][_0x31ae('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x38fbfb){logger['error'](_0x31ae('0x74'),JSON[_0x31ae('0x75')](_0x38fbfb));return[];}}exports[_0x31ae('0x76')]=function(_0x18ab44,_0x1b3b01,_0x5c04f9){if(_0x18ab44[_0x31ae('0x4c')]['id']){delete _0x18ab44['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x18ab44[_0x31ae('0x55')]['id']}})[_0x31ae('0x2a')](handleEntityNotFound(_0x1b3b01,null))[_0x31ae('0x2a')](function(_0xfda015){if(_0xfda015){_0x18ab44[_0x31ae('0x4c')]['DashboardId']=_0xfda015['id'];_0x18ab44['body'][_0x31ae('0x5d')]=widgetAttributes(_0x18ab44[_0x31ae('0x4c')]);return db[_0x31ae('0x77')][_0x31ae('0x4b')](_0x18ab44[_0x31ae('0x4c')]);}})[_0x31ae('0x2a')](respondWithResult(_0x1b3b01,null))[_0x31ae('0x48')](handleError(_0x1b3b01,null));};exports[_0x31ae('0x78')]=function(_0x9b8b3e,_0x53e9b3,_0x3135b2){var _0x59881d={};var _0xc0bf01={};var _0x47e773;var _0x43c52b;return db[_0x31ae('0x32')][_0x31ae('0x79')]({'where':{'id':_0x9b8b3e[_0x31ae('0x55')]['id']}})[_0x31ae('0x2a')](handleEntityNotFound(_0x53e9b3,null))[_0x31ae('0x2a')](function(_0x232031){if(_0x232031){_0x47e773=_0x232031;_0xc0bf01[_0x31ae('0x33')]=_['keys'](db[_0x31ae('0x77')][_0x31ae('0x56')]);_0xc0bf01[_0x31ae('0x35')]=_[_0x31ae('0x34')](_0x9b8b3e['query']);_0xc0bf01[_0x31ae('0x36')]=_['intersection'](_0xc0bf01[_0x31ae('0x33')],_0xc0bf01[_0x31ae('0x35')]);_0x59881d[_0x31ae('0x38')]=_[_0x31ae('0x37')](_0xc0bf01[_0x31ae('0x33')],qs[_0x31ae('0x39')](_0x9b8b3e['query'][_0x31ae('0x39')]));_0x59881d[_0x31ae('0x38')]=_0x59881d['attributes'][_0x31ae('0x3a')]?_0x59881d[_0x31ae('0x38')]:_0xc0bf01[_0x31ae('0x33')];_0x59881d['order']=qs[_0x31ae('0x3d')](_0x9b8b3e[_0x31ae('0x35')]['sort']);_0x59881d[_0x31ae('0x3e')]=qs[_0x31ae('0x36')](_['pick'](_0x9b8b3e[_0x31ae('0x35')],_0xc0bf01['filters']));if(_0x9b8b3e[_0x31ae('0x35')][_0x31ae('0x40')]){_0x59881d[_0x31ae('0x3e')]=_[_0x31ae('0x43')](_0x59881d[_0x31ae('0x3e')],{'$or':_[_0x31ae('0x7a')](_0x59881d[_0x31ae('0x38')],function(_0x4138a5){var _0x3ce893={};_0x3ce893[_0x4138a5]={'$like':'%'+_0x9b8b3e['query'][_0x31ae('0x40')]+'%'};return _0x3ce893;})});}_0x59881d=_[_0x31ae('0x43')]({},_0x59881d,_0x9b8b3e[_0x31ae('0x44')]);return _0x47e773['getItems'](_0x59881d);}})['then'](function(_0x32409){if(_0x32409){_0x43c52b=_0x32409['length'];if(!_0x9b8b3e[_0x31ae('0x35')]['hasOwnProperty'](_0x31ae('0x3c'))){_0x59881d[_0x31ae('0x24')]=qs[_0x31ae('0x24')](_0x9b8b3e[_0x31ae('0x35')][_0x31ae('0x24')]);_0x59881d[_0x31ae('0x23')]=qs['offset'](_0x9b8b3e[_0x31ae('0x35')][_0x31ae('0x23')]);}return _0x47e773[_0x31ae('0x78')](_0x59881d);}})[_0x31ae('0x2a')](function(_0x48ea73){if(_0x48ea73){return _0x48ea73?{'count':_0x43c52b,'rows':_0x48ea73}:null;}})['then'](respondWithResult(_0x53e9b3,null))[_0x31ae('0x48')](handleError(_0x53e9b3,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index e84b0f9..6be77dc 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 _0xa809=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','Dashboard'];(function(_0x496d0e,_0x183c43){var _0x4c93fb=function(_0x765f9a){while(--_0x765f9a){_0x496d0e['push'](_0x496d0e['shift']());}};_0x4c93fb(++_0x183c43);}(_0xa809,0x16e));var _0x9a80=function(_0x25f25c,_0x77ec45){_0x25f25c=_0x25f25c-0x0;var _0x4d8a66=_0xa809[_0x25f25c];return _0x4d8a66;};'use strict';var EventEmitter=require(_0x9a80('0x0'));var Dashboard=require(_0x9a80('0x1'))['db'][_0x9a80('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9a80('0x3')](0x0);var events={'afterCreate':_0x9a80('0x4'),'afterUpdate':_0x9a80('0x5'),'afterDestroy':_0x9a80('0x6')};function emitEvent(_0x3f9a7b){return function(_0x490f70,_0x3c3802,_0x4b043d){DashboardEvents[_0x9a80('0x7')](_0x3f9a7b+':'+_0x490f70['id'],_0x490f70);DashboardEvents[_0x9a80('0x7')](_0x3f9a7b,_0x490f70);_0x4b043d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x9a80('0x8')]=DashboardEvents; \ No newline at end of file +var _0x60f3=['Dashboard','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x60f3,0xb2));var _0x360f=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x60f3[_0x58a4fe];return _0x697de2;};'use strict';var EventEmitter=require(_0x360f('0x0'));var Dashboard=require(_0x360f('0x1'))['db'][_0x360f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x360f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x261a97){return function(_0x28680b,_0x5dda96,_0xc817a0){DashboardEvents[_0x360f('0x4')](_0x261a97+':'+_0x28680b['id'],_0x28680b);DashboardEvents[_0x360f('0x4')](_0x261a97,_0x28680b);_0xc817a0(null);};}for(var e in events){if(events[_0x360f('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index ae6b557..e801ee6 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 _0x5f96=['api','moment','bluebird','request-promise','rimraf','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5f96,0x75));var _0x65f9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x5f96[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var logger=require(_0x65f9('0x2'))(_0x65f9('0x3'));var moment=require(_0x65f9('0x4'));var BPromise=require(_0x65f9('0x5'));var rp=require(_0x65f9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65f9('0x8'));module[_0x65f9('0x9')]=function(_0x5607f5,_0x41efdb){return _0x5607f5[_0x65f9('0xa')]('Dashboard',attributes,{'tableName':_0x65f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a39=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util'];(function(_0x15fc4e,_0x171ab9){var _0x212226=function(_0x16f90a){while(--_0x16f90a){_0x15fc4e['push'](_0x15fc4e['shift']());}};_0x212226(++_0x171ab9);}(_0x6a39,0x140));var _0x96a3=function(_0x1bd948,_0xd2639c){_0x1bd948=_0x1bd948-0x0;var _0x5cccf9=_0x6a39[_0x1bd948];return _0x5cccf9;};'use strict';var _=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var logger=require(_0x96a3('0x2'))(_0x96a3('0x3'));var moment=require(_0x96a3('0x4'));var BPromise=require(_0x96a3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96a3('0x6'));var rimraf=require(_0x96a3('0x7'));var config=require(_0x96a3('0x8'));var attributes=require(_0x96a3('0x9'));module[_0x96a3('0xa')]=function(_0x21f936,_0x2174a1){return _0x21f936[_0x96a3('0xb')](_0x96a3('0xc'),attributes,{'tableName':_0x96a3('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 1112b46..b8467e3 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 _0x41c2=['redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x5831a9,_0x123a62){var _0x2b8749=function(_0x4920fc){while(--_0x4920fc){_0x5831a9['push'](_0x5831a9['shift']());}};_0x2b8749(++_0x123a62);}(_0x41c2,0x163));var _0x241c=function(_0x42d0c8,_0x409f1e){_0x42d0c8=_0x42d0c8-0x0;var _0x1b449a=_0x41c2[_0x42d0c8];return _0x1b449a;};'use strict';var _=require(_0x241c('0x0'));var util=require(_0x241c('0x1'));var moment=require(_0x241c('0x2'));var BPromise=require('bluebird');var rs=require(_0x241c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x241c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x241c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x241c('0x6'));var client=jayson[_0x241c('0x7')][_0x241c('0x8')]({'port':0x232a});config[_0x241c('0x9')]=_[_0x241c('0xa')](config[_0x241c('0x9')],{'host':_0x241c('0xb'),'port':0x18eb});var socket=require(_0x241c('0xc'))(new Redis(config[_0x241c('0x9')]));require(_0x241c('0xd'))['register'](socket);function respondWithRpcPromise(_0x2941d5,_0x4a2bad,_0x24321d){return new BPromise(function(_0x4059aa,_0x233fca){return client[_0x241c('0xe')](_0x2941d5,_0x24321d)[_0x241c('0xf')](function(_0x4dd1b9){logger[_0x241c('0x10')]('Dashboard,\x20%s,\x20%s',_0x4a2bad,_0x241c('0x11'));logger[_0x241c('0x12')](_0x241c('0x13'),_0x4a2bad,_0x241c('0x11'),JSON['stringify'](_0x4dd1b9));if(_0x4dd1b9['error']){if(_0x4dd1b9[_0x241c('0x14')][_0x241c('0x15')]===0x1f4){logger['error'](_0x241c('0x16'),_0x4a2bad,_0x4dd1b9[_0x241c('0x14')][_0x241c('0x17')]);return _0x233fca(_0x4dd1b9[_0x241c('0x14')][_0x241c('0x17')]);}logger[_0x241c('0x14')](_0x241c('0x16'),_0x4a2bad,_0x4dd1b9[_0x241c('0x14')][_0x241c('0x17')]);return _0x4059aa(_0x4dd1b9[_0x241c('0x14')][_0x241c('0x17')]);}else{logger[_0x241c('0x10')](_0x241c('0x16'),_0x4a2bad,_0x241c('0x11'));_0x4059aa(_0x4dd1b9[_0x241c('0x18')][_0x241c('0x17')]);}})[_0x241c('0x19')](function(_0x3f0faf){logger['error']('Dashboard,\x20%s,\x20%s',_0x4a2bad,_0x3f0faf);_0x233fca(_0x3f0faf);});});} \ No newline at end of file +var _0xd4b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xd4b5,0x19e));var _0x5d4b=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xd4b5[_0x28578d];return _0x524826;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d4b('0x0'));var BPromise=require(_0x5d4b('0x1'));var rs=require(_0x5d4b('0x2'));var fs=require('fs');var Redis=require(_0x5d4b('0x3'));var db=require(_0x5d4b('0x4'))['db'];var utils=require(_0x5d4b('0x5'));var logger=require(_0x5d4b('0x6'))(_0x5d4b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d4b('0x8')][_0x5d4b('0x9')]({'port':0x232a});config[_0x5d4b('0xa')]=_[_0x5d4b('0xb')](config[_0x5d4b('0xa')],{'host':_0x5d4b('0xc'),'port':0x18eb});var socket=require(_0x5d4b('0xd'))(new Redis(config[_0x5d4b('0xa')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x2187ec,_0x397e6c,_0x23fa4f){return new BPromise(function(_0x5ac0a1,_0x2a155d){return client[_0x5d4b('0xe')](_0x2187ec,_0x23fa4f)[_0x5d4b('0xf')](function(_0x1e3cb0){logger[_0x5d4b('0x10')](_0x5d4b('0x11'),_0x397e6c,_0x5d4b('0x12'));logger['debug'](_0x5d4b('0x13'),_0x397e6c,_0x5d4b('0x12'),JSON[_0x5d4b('0x14')](_0x1e3cb0));if(_0x1e3cb0['error']){if(_0x1e3cb0[_0x5d4b('0x15')][_0x5d4b('0x16')]===0x1f4){logger[_0x5d4b('0x15')](_0x5d4b('0x11'),_0x397e6c,_0x1e3cb0[_0x5d4b('0x15')][_0x5d4b('0x17')]);return _0x2a155d(_0x1e3cb0[_0x5d4b('0x15')][_0x5d4b('0x17')]);}logger[_0x5d4b('0x15')]('Dashboard,\x20%s,\x20%s',_0x397e6c,_0x1e3cb0['error']['message']);return _0x5ac0a1(_0x1e3cb0[_0x5d4b('0x15')][_0x5d4b('0x17')]);}else{logger[_0x5d4b('0x10')](_0x5d4b('0x11'),_0x397e6c,_0x5d4b('0x12'));_0x5ac0a1(_0x1e3cb0[_0x5d4b('0x18')][_0x5d4b('0x17')]);}})[_0x5d4b('0x19')](function(_0x4e6b38){logger['error'](_0x5d4b('0x11'),_0x397e6c,_0x4e6b38);_0x2a155d(_0x4e6b38);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3adb670..d1693ba 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 _0x4ac8=['dashboard:','./dashboard.events','save','update','emit','removeListener','register','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4ac8,0x159));var _0x84ac=function(_0x4f69d6,_0x22705f){_0x4f69d6=_0x4f69d6-0x0;var _0x390323=_0x4ac8[_0x4f69d6];return _0x390323;};'use strict';var DashboardEvents=require(_0x84ac('0x0'));var events=[_0x84ac('0x1'),'remove',_0x84ac('0x2')];function createListener(_0x3bb836,_0x3ea797){return function(_0xe44d15){_0x3ea797[_0x84ac('0x3')](_0x3bb836,_0xe44d15);};}function removeListener(_0x145c52,_0x3f21a4){return function(){DashboardEvents[_0x84ac('0x4')](_0x145c52,_0x3f21a4);};}exports[_0x84ac('0x5')]=function(_0x1ff372){for(var _0x10330f=0x0,_0x31204e=events[_0x84ac('0x6')];_0x10330f<_0x31204e;_0x10330f++){var _0x17d567=events[_0x10330f];var _0x3fd8ff=createListener(_0x84ac('0x7')+_0x17d567,_0x1ff372);DashboardEvents['on'](_0x17d567,_0x3fd8ff);}}; \ No newline at end of file +var _0x4609=['register','length','dashboard:','./dashboard.events','update','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4609,0x137));var _0x9460=function(_0x2dd17b,_0x5b2258){_0x2dd17b=_0x2dd17b-0x0;var _0x23d067=_0x4609[_0x2dd17b];return _0x23d067;};'use strict';var DashboardEvents=require(_0x9460('0x0'));var events=['save','remove',_0x9460('0x1')];function createListener(_0x2be39f,_0x4f2bbc){return function(_0x4385fe){_0x4f2bbc[_0x9460('0x2')](_0x2be39f,_0x4385fe);};}function removeListener(_0xad7125,_0x5e5de6){return function(){DashboardEvents[_0x9460('0x3')](_0xad7125,_0x5e5de6);};}exports[_0x9460('0x4')]=function(_0x2cf4e8){for(var _0x1f0e9d=0x0,_0x295f62=events[_0x9460('0x5')];_0x1f0e9d<_0x295f62;_0x1f0e9d++){var _0x3149a4=events[_0x1f0e9d];var _0x3d7e03=createListener(_0x9460('0x6')+_0x3149a4,_0x2cf4e8);DashboardEvents['on'](_0x3149a4,_0x3d7e03);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 12ce5bf..e80b0c3 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 _0xefc3=['put','update','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','clone','addItem'];(function(_0x243de9,_0x1897bb){var _0x58e4bd=function(_0x342b42){while(--_0x342b42){_0x243de9['push'](_0x243de9['shift']());}};_0x58e4bd(++_0x1897bb);}(_0xefc3,0x1d2));var _0x3efc=function(_0x5d216c,_0x4cd733){_0x5d216c=_0x5d216c-0x0;var _0x138062=_0xefc3[_0x5d216c];return _0x138062;};'use strict';var multer=require('multer');var util=require(_0x3efc('0x0'));var path=require(_0x3efc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3efc('0x2')]();var auth=require(_0x3efc('0x3'));var interaction=require(_0x3efc('0x4'));var config=require(_0x3efc('0x5'));var controller=require(_0x3efc('0x6'));router[_0x3efc('0x7')]('/',auth[_0x3efc('0x8')](),controller[_0x3efc('0x9')]);router['get'](_0x3efc('0xa'),auth[_0x3efc('0x8')](),controller[_0x3efc('0xb')]);router['get'](_0x3efc('0xc'),auth['isAuthenticated'](),controller['getItems']);router[_0x3efc('0xd')]('/',auth[_0x3efc('0x8')](),controller[_0x3efc('0xe')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x3efc('0xf')]);router[_0x3efc('0xd')]('/:id/items',auth[_0x3efc('0x8')](),controller[_0x3efc('0x10')]);router[_0x3efc('0x11')]('/:id',auth[_0x3efc('0x8')](),controller[_0x3efc('0x12')]);router['delete'](_0x3efc('0xa'),auth[_0x3efc('0x8')](),controller[_0x3efc('0x13')]);module[_0x3efc('0x14')]=router; \ No newline at end of file +var _0xe791=['./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post','/:id/clone','addItem','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4a5ee0,_0x271788){var _0x4ba580=function(_0x2b8800){while(--_0x2b8800){_0x4a5ee0['push'](_0x4a5ee0['shift']());}};_0x4ba580(++_0x271788);}(_0xe791,0x109));var _0x1e79=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe791[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x1e79('0x0'));var util=require(_0x1e79('0x1'));var path=require(_0x1e79('0x2'));var timeout=require(_0x1e79('0x3'));var express=require(_0x1e79('0x4'));var router=express[_0x1e79('0x5')]();var auth=require(_0x1e79('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e79('0x7'));var controller=require(_0x1e79('0x8'));router[_0x1e79('0x9')]('/',auth[_0x1e79('0xa')](),controller[_0x1e79('0xb')]);router[_0x1e79('0x9')](_0x1e79('0xc'),auth[_0x1e79('0xa')](),controller['show']);router['get'](_0x1e79('0xd'),auth['isAuthenticated'](),controller[_0x1e79('0xe')]);router[_0x1e79('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e79('0xf')](_0x1e79('0x10'),auth[_0x1e79('0xa')](),controller['clone']);router[_0x1e79('0xf')](_0x1e79('0xd'),auth[_0x1e79('0xa')](),controller[_0x1e79('0x11')]);router[_0x1e79('0x12')](_0x1e79('0xc'),auth[_0x1e79('0xa')](),controller['update']);router['delete'](_0x1e79('0xc'),auth[_0x1e79('0xa')](),controller[_0x1e79('0x13')]);module[_0x1e79('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 30a0286..40f1f69 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 _0x8c57=['TEXT','long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','sequelize','squel','exports','STRING'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x8c57,0xf3));var _0x78c5=function(_0x4bd7e5,_0x3139ee){_0x4bd7e5=_0x4bd7e5-0x0;var _0x2f5300=_0x8c57[_0x4bd7e5];return _0x2f5300;};'use strict';var Sequelize=require(_0x78c5('0x0'));var squel=require(_0x78c5('0x1'));var _=require('lodash');module[_0x78c5('0x2')]={'title':{'type':Sequelize[_0x78c5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x78c5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x78c5('0x4')](_0x78c5('0x5')),'get':function(){try{return JSON[_0x78c5('0x6')](this[_0x78c5('0x7')]('attrs'));}catch(_0x4ffa56){return[];}},'set':function(_0x29eb1e){try{this[_0x78c5('0x8')](_0x78c5('0x9'),JSON[_0x78c5('0xa')](_0x29eb1e));}catch(_0x2b00e7){this[_0x78c5('0x8')](_0x78c5('0x9'),JSON[_0x78c5('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x78c5('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x78c5('0xb')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x78c5('0x3')],'allowNull':![],'defaultValue':_0x78c5('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x78c5('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x78c5('0x3')]}}; \ No newline at end of file +var _0x52ae=['#2196f3','sequelize','exports','STRING','parse','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0x4dd4be,_0x422956){var _0x3d81b6=function(_0x2b61ac){while(--_0x2b61ac){_0x4dd4be['push'](_0x4dd4be['shift']());}};_0x3d81b6(++_0x422956);}(_0x52ae,0x123));var _0xe52a=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x52ae[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0xe52a('0x0'));var squel=require('squel');var _=require('lodash');module[_0xe52a('0x1')]={'title':{'type':Sequelize[_0xe52a('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0xe52a('0x3')](this['getDataValue'](_0xe52a('0x4')));}catch(_0x131fed){return[];}},'set':function(_0x218f24){try{this['setDataValue'](_0xe52a('0x4'),JSON[_0xe52a('0x5')](_0x218f24));}catch(_0x22d622){this[_0xe52a('0x6')](_0xe52a('0x4'),JSON[_0xe52a('0x5')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe52a('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe52a('0x7')]},'col':{'type':Sequelize[_0xe52a('0x7')]},'background':{'type':Sequelize[_0xe52a('0x2')],'allowNull':![],'defaultValue':_0xe52a('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe52a('0x2')],'allowNull':![],'defaultValue':_0xe52a('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe52a('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 404cde9..c64ac83 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 _0x7a54=['web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','query','keys','intersection','attributes','fields','length','includeAll','include','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues'];(function(_0xb0da90,_0x1aaa03){var _0x5f20e2=function(_0x401a6a){while(--_0x401a6a){_0xb0da90['push'](_0xb0da90['shift']());}};_0x5f20e2(++_0x1aaa03);}(_0x7a54,0x106));var _0x47a5=function(_0x228bfc,_0xb229a6){_0x228bfc=_0x228bfc-0x0;var _0x173e68=_0x7a54[_0x228bfc];return _0x173e68;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){_0xe2dea9[_0x47a5('0x1a')](0xcc)[_0x47a5('0x26')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x19')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);if(_0x5b6c4e[_0x47a5('0x29')]){delete _0x5b6c4e[_0x47a5('0x29')];}_0x5686db[_0x47a5('0x1a')](_0x1ea9c8)[_0x47a5('0x2a')](_0x5b6c4e);};}exports[_0x47a5('0x2b')]=function(_0x136b14,_0x16631f){var _0x361bfa={'raw':![],'where':{'id':_0x136b14[_0x47a5('0x2c')]['id']}},_0x1127f8={};_0x1127f8[_0x47a5('0x2d')]=_['keys'](db[_0x47a5('0x2e')]['rawAttributes']);_0x1127f8[_0x47a5('0x2f')]=_[_0x47a5('0x30')](_0x136b14[_0x47a5('0x2f')]);_0x1127f8['filters']=_[_0x47a5('0x31')](_0x1127f8[_0x47a5('0x2d')],_0x1127f8[_0x47a5('0x2f')]);_0x361bfa[_0x47a5('0x32')]=_['intersection'](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14[_0x47a5('0x2f')]['fields']));_0x361bfa['attributes']=_0x361bfa[_0x47a5('0x32')][_0x47a5('0x34')]?_0x361bfa['attributes']:_0x1127f8[_0x47a5('0x2d')];if(_0x136b14['query'][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x36')]=[{'all':!![]}];}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);return db[_0x47a5('0x2e')]['find'](_0x361bfa)[_0x47a5('0x24')](handleEntityNotFound(_0x16631f,null))[_0x47a5('0x24')](respondWithResult(_0x16631f,null))[_0x47a5('0x37')](handleError(_0x16631f,null));};exports['destroy']=function(_0x18f7e9,_0x50c086){return db['DashboardItem'][_0x47a5('0x38')]({'where':{'id':_0x18f7e9['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x50c086,null))['then'](removeEntity(_0x50c086,null))[_0x47a5('0x37')](handleError(_0x50c086,null));};function widgetAttributes(_0x3534cb){try{switch(_0x3534cb[_0x47a5('0x39')]){case _0x47a5('0x3a'):return[{'name':_0x47a5('0x3b'),'value':_0x3534cb[_0x47a5('0x3b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x3d')}];case _0x47a5('0x3e'):return[{'name':'attrPath','value':_0x3534cb[_0x47a5('0x3f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x40')]:undefined)||''}];case _0x47a5('0x41'):return[{'name':'attrHourFormat','value':_0x3534cb[_0x47a5('0x42')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x0]?_0x3534cb['attrs'][0x0]['value']:undefined)||_0x47a5('0x43')},{'name':'attrTimezone','value':_0x3534cb[_0x47a5('0x44')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||_0x47a5('0x45')},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0xc}];case _0x47a5('0x47'):return[{'name':'attrMetric','value':_0x3534cb[_0x47a5('0x48')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x49')},{'name':'attrVoiceQueues','value':_0x3534cb['attrVoiceQueues']||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1]['value']:undefined)||[]},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x47a5('0x4a'),'value':_0x3534cb['attrSerie1']||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||_0x47a5('0x49')},{'name':_0x47a5('0x4b'),'value':_0x3534cb[_0x47a5('0x4b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x4c'),'value':_0x3534cb[_0x47a5('0x4c')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2]['value']:undefined)||null},{'name':_0x47a5('0x4d'),'value':_0x3534cb[_0x47a5('0x4d')]||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x3]?_0x3534cb[_0x47a5('0x3c')][0x3]['value']:undefined)||[]}];case _0x47a5('0x4e'):return[{'name':_0x47a5('0x4f'),'type':_0x3534cb['reportType']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x39')]:undefined)||null,'value':_0x3534cb[_0x47a5('0x4f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x50'),'value':_0x3534cb['attrRefresh']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ea93e){logger[_0x47a5('0x27')](_0x47a5('0x51'),JSON[_0x47a5('0x52')](_0x9ea93e));return[];}}exports['create']=function(_0x45cca5,_0x1c9a62){if(_0x45cca5[_0x47a5('0x53')]){_0x45cca5['body'][_0x47a5('0x3c')]=widgetAttributes(_0x45cca5['body']);}return db[_0x47a5('0x2e')][_0x47a5('0x54')](_0x45cca5[_0x47a5('0x53')],{})[_0x47a5('0x24')](respondWithResult(_0x1c9a62,0xc9))['catch'](handleError(_0x1c9a62,null));};exports[_0x47a5('0x23')]=function(_0x1e6de3,_0x2f66e9){if(_0x1e6de3[_0x47a5('0x53')]['id']){delete _0x1e6de3[_0x47a5('0x53')]['id'];}_0x1e6de3[_0x47a5('0x53')][_0x47a5('0x3c')]=widgetAttributes(_0x1e6de3['body']);return db[_0x47a5('0x2e')][_0x47a5('0x38')]({'where':{'id':_0x1e6de3[_0x47a5('0x2c')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2f66e9,null))[_0x47a5('0x24')](saveUpdates(_0x1e6de3[_0x47a5('0x53')],null))['then'](respondWithResult(_0x2f66e9,null))[_0x47a5('0x37')](handleError(_0x2f66e9,null));}; \ No newline at end of file +var _0x5f2f=['find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrRefresh','stringify','create','body','update','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','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','send','show','params','DashboardItem','rawAttributes','query','keys','model','attributes','fields','length','includeAll','include','merge','options'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e49c5,_0x237b45){_0x4e49c5=_0x4e49c5-0x0;var _0x801e1b=_0x5f2f[_0x4e49c5];return _0x801e1b;};'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 hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./dashboardItem.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)[_0xf5f2('0x1c')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x1b')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x28')]);if(_0x294414[_0xf5f2('0x29')]){delete _0x294414[_0xf5f2('0x29')];}_0x13a3be[_0xf5f2('0x1d')](_0x281ec8)[_0xf5f2('0x2a')](_0x294414);};}exports[_0xf5f2('0x2b')]=function(_0x5b6672,_0x53cb96){var _0x22c826={'raw':![],'where':{'id':_0x5b6672[_0xf5f2('0x2c')]['id']}},_0x14c829={};_0x14c829['model']=_['keys'](db[_0xf5f2('0x2d')][_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x5b6672[_0xf5f2('0x2f')]);_0x14c829['filters']=_['intersection'](_0x14c829[_0xf5f2('0x31')],_0x14c829['query']);_0x22c826[_0xf5f2('0x32')]=_['intersection'](_0x14c829[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829['model'];if(_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x35')]){_0x22c826[_0xf5f2('0x36')]=[{'all':!![]}];}_0x22c826=_[_0xf5f2('0x37')]({},_0x22c826,_0x5b6672[_0xf5f2('0x38')]);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')](_0x22c826)['then'](handleEntityNotFound(_0x53cb96,null))[_0xf5f2('0x27')](respondWithResult(_0x53cb96,null))[_0xf5f2('0x3a')](handleError(_0x53cb96,null));};exports['destroy']=function(_0x3fc168,_0x4b8c42){return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x3fc168[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x4b8c42,null))['then'](removeEntity(_0x4b8c42,null))['catch'](handleError(_0x4b8c42,null));};function widgetAttributes(_0x41088b){try{switch(_0x41088b[_0xf5f2('0x3b')]){case _0xf5f2('0x3c'):return[{'name':'attrUrl','value':_0x41088b[_0xf5f2('0x3d')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x40')}];case'custom':return[{'name':_0xf5f2('0x41'),'value':_0x41088b[_0xf5f2('0x41')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0]['value']:undefined)||''}];case _0xf5f2('0x42'):return[{'name':_0xf5f2('0x43'),'value':_0x41088b[_0xf5f2('0x43')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0xf5f2('0x44'),'value':_0x41088b[_0xf5f2('0x44')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x45')},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b['attrs'][0x2][_0xf5f2('0x3f')]:undefined)||0xc}];case _0xf5f2('0x47'):return[{'name':_0xf5f2('0x48'),'value':_0x41088b['attrMetric']||(_0x41088b['attrs']&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'total'},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||[]},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2][_0xf5f2('0x3f')]:undefined)||0x14}];case _0xf5f2('0x4a'):case _0xf5f2('0x4b'):return[{'name':'attrSerie1','value':_0x41088b[_0xf5f2('0x4c')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x4d')},{'name':_0xf5f2('0x4e'),'value':_0x41088b[_0xf5f2('0x4e')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||null},{'name':_0xf5f2('0x4f'),'value':_0x41088b[_0xf5f2('0x4f')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2]['value']:undefined)||null},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x3]?_0x41088b[_0xf5f2('0x3e')][0x3][_0xf5f2('0x3f')]:undefined)||[]}];case _0xf5f2('0x50'):return[{'name':'attrReport','type':_0x41088b['reportType']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3b')]:undefined)||null,'value':_0x41088b['attrReport']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0]['value']:undefined)||null},{'name':_0xf5f2('0x51'),'value':_0x41088b[_0xf5f2('0x51')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b['attrs'][0x1][_0xf5f2('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x2b782f){logger['error']('widgetAttributes:\x20%s',JSON[_0xf5f2('0x52')](_0x2b782f));return[];}}exports[_0xf5f2('0x53')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x54')]){_0x57782c[_0xf5f2('0x54')][_0xf5f2('0x3e')]=widgetAttributes(_0x57782c['body']);}return db['DashboardItem'][_0xf5f2('0x53')](_0x57782c[_0xf5f2('0x54')],{})['then'](respondWithResult(_0x22b645,0xc9))[_0xf5f2('0x3a')](handleError(_0x22b645,null));};exports[_0xf5f2('0x55')]=function(_0x255125,_0x14029e){if(_0x255125[_0xf5f2('0x54')]['id']){delete _0x255125[_0xf5f2('0x54')]['id'];}_0x255125[_0xf5f2('0x54')]['attrs']=widgetAttributes(_0x255125['body']);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x255125[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x14029e,null))[_0xf5f2('0x27')](saveUpdates(_0x255125['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x14029e,null))[_0xf5f2('0x3a')](handleError(_0x14029e,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 14c9b16..0a874c0 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 _0x63d4=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3bc984,_0x529bfd){var _0x48eece=function(_0x2c6c52){while(--_0x2c6c52){_0x3bc984['push'](_0x3bc984['shift']());}};_0x48eece(++_0x529bfd);}(_0x63d4,0x7d));var _0x463d=function(_0x16af1d,_0x33e8d7){_0x16af1d=_0x16af1d-0x0;var _0xd22559=_0x63d4[_0x16af1d];return _0xd22559;};'use strict';var EventEmitter=require(_0x463d('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x463d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x463d('0x2'),'afterDestroy':_0x463d('0x3')};function emitEvent(_0x55e0be){return function(_0x5b563,_0x15951b,_0x465e2c){DashboardItemEvents[_0x463d('0x4')](_0x55e0be+':'+_0x5b563['id'],_0x5b563);DashboardItemEvents['emit'](_0x55e0be,_0x5b563);_0x465e2c(null);};}for(var e in events){if(events[_0x463d('0x5')](e)){var event=events[e];DashboardItem[_0x463d('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x7f14=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x10f1de,_0x3f83be){var _0x4756b0=function(_0x207187){while(--_0x207187){_0x10f1de['push'](_0x10f1de['shift']());}};_0x4756b0(++_0x3f83be);}(_0x7f14,0x1df));var _0x47f1=function(_0x54d2b9,_0x36db14){_0x54d2b9=_0x54d2b9-0x0;var _0x404e9d=_0x7f14[_0x54d2b9];return _0x404e9d;};'use strict';var EventEmitter=require(_0x47f1('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x47f1('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x47f1('0x2')](0x0);var events={'afterCreate':_0x47f1('0x3'),'afterUpdate':_0x47f1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a6622){return function(_0x43a41e,_0x27ce0e,_0x21cce4){DashboardItemEvents[_0x47f1('0x5')](_0x5a6622+':'+_0x43a41e['id'],_0x43a41e);DashboardItemEvents[_0x47f1('0x5')](_0x5a6622,_0x43a41e);_0x21cce4(null);};}for(var e in events){if(events[_0x47f1('0x6')](e)){var event=events[e];DashboardItem[_0x47f1('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index fd4714f..c933aa4 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 _0x4571=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x4571,0x1af));var _0x1457=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x4571[_0x485abd];return _0x3379f1;};'use strict';var _=require(_0x1457('0x0'));var util=require(_0x1457('0x1'));var logger=require(_0x1457('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1457('0x3'));var rp=require(_0x1457('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1457('0x5'));var config=require(_0x1457('0x6'));var attributes=require(_0x1457('0x7'));module[_0x1457('0x8')]=function(_0x2671fd,_0x577dd0){return _0x2671fd[_0x1457('0x9')](_0x1457('0xa'),attributes,{'tableName':_0x1457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8827=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./dashboardItem.attributes'];(function(_0x1a0967,_0x51bc82){var _0x5a169f=function(_0x43fda2){while(--_0x43fda2){_0x1a0967['push'](_0x1a0967['shift']());}};_0x5a169f(++_0x51bc82);}(_0x8827,0xc0));var _0x7882=function(_0x1b4f53,_0x164ed1){_0x1b4f53=_0x1b4f53-0x0;var _0x3d87fd=_0x8827[_0x1b4f53];return _0x3d87fd;};'use strict';var _=require(_0x7882('0x0'));var util=require(_0x7882('0x1'));var logger=require(_0x7882('0x2'))(_0x7882('0x3'));var moment=require(_0x7882('0x4'));var BPromise=require(_0x7882('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7882('0x6'));var config=require('../../config/environment');var attributes=require(_0x7882('0x7'));module[_0x7882('0x8')]=function(_0x2f68bd,_0x4745f9){return _0x2f68bd[_0x7882('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 512bda0..5e65825 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 _0xd2ab=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboardItem.socket','register','request','then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x87ffd1,_0x33c60f){var _0x329551=function(_0x9b076c){while(--_0x9b076c){_0x87ffd1['push'](_0x87ffd1['shift']());}};_0x329551(++_0x33c60f);}(_0xd2ab,0x1da));var _0xbd2a=function(_0x47342d,_0x6f8714){_0x47342d=_0x47342d-0x0;var _0x39e624=_0xd2ab[_0x47342d];return _0x39e624;};'use strict';var _=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var moment=require(_0xbd2a('0x2'));var BPromise=require(_0xbd2a('0x3'));var rs=require(_0xbd2a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd2a('0x5'))['db'];var utils=require(_0xbd2a('0x6'));var logger=require(_0xbd2a('0x7'))(_0xbd2a('0x8'));var config=require(_0xbd2a('0x9'));var jayson=require(_0xbd2a('0xa'));var client=jayson[_0xbd2a('0xb')]['http']({'port':0x232a});config[_0xbd2a('0xc')]=_[_0xbd2a('0xd')](config['redis'],{'host':_0xbd2a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd2a('0xc')]));require(_0xbd2a('0xf'))[_0xbd2a('0x10')](socket);function respondWithRpcPromise(_0x3f7ae1,_0x102e43,_0x5c2be9){return new BPromise(function(_0x5a8a84,_0x337f0d){return client[_0xbd2a('0x11')](_0x3f7ae1,_0x5c2be9)[_0xbd2a('0x12')](function(_0x2d8665){logger['info']('DashboardItem,\x20%s,\x20%s',_0x102e43,_0xbd2a('0x13'));logger[_0xbd2a('0x14')](_0xbd2a('0x15'),_0x102e43,_0xbd2a('0x13'),JSON[_0xbd2a('0x16')](_0x2d8665));if(_0x2d8665[_0xbd2a('0x17')]){if(_0x2d8665[_0xbd2a('0x17')][_0xbd2a('0x18')]===0x1f4){logger[_0xbd2a('0x17')]('DashboardItem,\x20%s,\x20%s',_0x102e43,_0x2d8665['error'][_0xbd2a('0x19')]);return _0x337f0d(_0x2d8665[_0xbd2a('0x17')][_0xbd2a('0x19')]);}logger['error'](_0xbd2a('0x1a'),_0x102e43,_0x2d8665[_0xbd2a('0x17')][_0xbd2a('0x19')]);return _0x5a8a84(_0x2d8665[_0xbd2a('0x17')][_0xbd2a('0x19')]);}else{logger[_0xbd2a('0x1b')](_0xbd2a('0x1a'),_0x102e43,_0xbd2a('0x13'));_0x5a8a84(_0x2d8665[_0xbd2a('0x1c')][_0xbd2a('0x19')]);}})[_0xbd2a('0x1d')](function(_0x5d1c1f){logger[_0xbd2a('0x17')](_0xbd2a('0x1a'),_0x102e43,_0x5d1c1f);_0x337f0d(_0x5d1c1f);});});} \ No newline at end of file +var _0x80d8=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x2f729c,_0x45806a){var _0x5a9312=function(_0x23752d){while(--_0x23752d){_0x2f729c['push'](_0x2f729c['shift']());}};_0x5a9312(++_0x45806a);}(_0x80d8,0x12d));var _0x880d=function(_0x32aac9,_0x5eb63d){_0x32aac9=_0x32aac9-0x0;var _0x51bafd=_0x80d8[_0x32aac9];return _0x51bafd;};'use strict';var _=require(_0x880d('0x0'));var util=require('util');var moment=require(_0x880d('0x1'));var BPromise=require(_0x880d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x880d('0x3'))['db'];var utils=require(_0x880d('0x4'));var logger=require(_0x880d('0x5'))(_0x880d('0x6'));var config=require(_0x880d('0x7'));var jayson=require(_0x880d('0x8'));var client=jayson[_0x880d('0x9')]['http']({'port':0x232a});config[_0x880d('0xa')]=_[_0x880d('0xb')](config['redis'],{'host':_0x880d('0xc'),'port':0x18eb});var socket=require(_0x880d('0xd'))(new Redis(config[_0x880d('0xa')]));require(_0x880d('0xe'))[_0x880d('0xf')](socket);function respondWithRpcPromise(_0x5d5315,_0xd664b7,_0x1aefae){return new BPromise(function(_0x1654f1,_0x238a7a){return client[_0x880d('0x10')](_0x5d5315,_0x1aefae)[_0x880d('0x11')](function(_0x3e394f){logger['info'](_0x880d('0x12'),_0xd664b7,'request\x20sent');logger['debug'](_0x880d('0x13'),_0xd664b7,_0x880d('0x14'),JSON['stringify'](_0x3e394f));if(_0x3e394f[_0x880d('0x15')]){if(_0x3e394f[_0x880d('0x15')]['code']===0x1f4){logger['error'](_0x880d('0x12'),_0xd664b7,_0x3e394f[_0x880d('0x15')][_0x880d('0x16')]);return _0x238a7a(_0x3e394f[_0x880d('0x15')][_0x880d('0x16')]);}logger[_0x880d('0x15')](_0x880d('0x12'),_0xd664b7,_0x3e394f[_0x880d('0x15')]['message']);return _0x1654f1(_0x3e394f['error'][_0x880d('0x16')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0xd664b7,_0x880d('0x14'));_0x1654f1(_0x3e394f[_0x880d('0x17')][_0x880d('0x16')]);}})[_0x880d('0x18')](function(_0x122dba){logger[_0x880d('0x15')]('DashboardItem,\x20%s,\x20%s',_0xd664b7,_0x122dba);_0x238a7a(_0x122dba);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 48c49e5..08abecc 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 _0x9c44=['emit','removeListener','length','dashboardItem:','remove','update'];(function(_0x11c55e,_0xc1d1b1){var _0x175af8=function(_0x32fd50){while(--_0x32fd50){_0x11c55e['push'](_0x11c55e['shift']());}};_0x175af8(++_0xc1d1b1);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){DashboardItemEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);DashboardItemEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file +var _0x7217=['dashboardItem:','./dashboardItem.events','remove','update','removeListener','register','length'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0x7217,0x19e));var _0x7721=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x7217[_0x2d8fc2];return _0x3a9e53;};'use strict';var DashboardItemEvents=require(_0x7721('0x0'));var events=['save',_0x7721('0x1'),_0x7721('0x2')];function createListener(_0x1de988,_0x2a78d8){return function(_0x115ab3){_0x2a78d8['emit'](_0x1de988,_0x115ab3);};}function removeListener(_0x5bf160,_0x472a96){return function(){DashboardItemEvents[_0x7721('0x3')](_0x5bf160,_0x472a96);};}exports[_0x7721('0x4')]=function(_0x3fe47c){for(var _0xb239e0=0x0,_0xf7ff37=events[_0x7721('0x5')];_0xb239e0<_0xf7ff37;_0xb239e0++){var _0x21f680=events[_0xb239e0];var _0x225610=createListener(_0x7721('0x6')+_0x21f680,_0x3fe47c);DashboardItemEvents['on'](_0x21f680,_0x225610);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 0c36ec0..d07f931 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 _0x5354=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','show','post','isAuthenticated','create','put','update','delete','exports','util','path'];(function(_0x41ca16,_0x8224ad){var _0x42bf27=function(_0x1a5d30){while(--_0x1a5d30){_0x41ca16['push'](_0x41ca16['shift']());}};_0x42bf27(++_0x8224ad);}(_0x5354,0x130));var _0x4535=function(_0x3bde8e,_0x21cf00){_0x3bde8e=_0x3bde8e-0x0;var _0x48f9b0=_0x5354[_0x3bde8e];return _0x48f9b0;};'use strict';var multer=require('multer');var util=require(_0x4535('0x0'));var path=require(_0x4535('0x1'));var timeout=require(_0x4535('0x2'));var express=require(_0x4535('0x3'));var router=express['Router']();var auth=require(_0x4535('0x4'));var interaction=require(_0x4535('0x5'));var config=require(_0x4535('0x6'));var controller=require(_0x4535('0x7'));router['get'](_0x4535('0x8'),auth['isAuthenticated'](),controller[_0x4535('0x9')]);router[_0x4535('0xa')]('/',auth[_0x4535('0xb')](),controller[_0x4535('0xc')]);router[_0x4535('0xd')](_0x4535('0x8'),auth[_0x4535('0xb')](),controller[_0x4535('0xe')]);router[_0x4535('0xf')](_0x4535('0x8'),auth[_0x4535('0xb')](),controller['destroy']);module[_0x4535('0x10')]=router; \ No newline at end of file +var _0xc93b=['express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x537c88,_0x12ed11){var _0x510814=function(_0x4559f5){while(--_0x4559f5){_0x537c88['push'](_0x537c88['shift']());}};_0x510814(++_0x12ed11);}(_0xc93b,0x172));var _0xbc93=function(_0x34e79b,_0x488f5d){_0x34e79b=_0x34e79b-0x0;var _0xd05dfd=_0xc93b[_0x34e79b];return _0xd05dfd;};'use strict';var multer=require(_0xbc93('0x0'));var util=require(_0xbc93('0x1'));var path=require(_0xbc93('0x2'));var timeout=require(_0xbc93('0x3'));var express=require(_0xbc93('0x4'));var router=express[_0xbc93('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbc93('0x6'));var config=require(_0xbc93('0x7'));var controller=require('./dashboardItem.controller');router[_0xbc93('0x8')](_0xbc93('0x9'),auth[_0xbc93('0xa')](),controller[_0xbc93('0xb')]);router['post']('/',auth[_0xbc93('0xa')](),controller[_0xbc93('0xc')]);router['put']('/:id',auth[_0xbc93('0xa')](),controller[_0xbc93('0xd')]);router[_0xbc93('0xe')](_0xbc93('0x9'),auth[_0xbc93('0xa')](),controller[_0xbc93('0xf')]);module[_0xbc93('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 25f850f..c3abc99 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 _0xbe97=['STRING'];(function(_0x3a7f7b,_0x22f0f8){var _0x48b64b=function(_0x57ac88){while(--_0x57ac88){_0x3a7f7b['push'](_0x3a7f7b['shift']());}};_0x48b64b(++_0x22f0f8);}(_0xbe97,0x1e2));var _0x7be9=function(_0x4ff0cc,_0x1e4c4a){_0x4ff0cc=_0x4ff0cc-0x0;var _0x17a213=_0xbe97[_0x4ff0cc];return _0x17a213;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7be9('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x6b2a=['sequelize','exports','STRING'];(function(_0x303bf3,_0x3ec4f6){var _0x430f8c=function(_0x9d6952){while(--_0x9d6952){_0x303bf3['push'](_0x303bf3['shift']());}};_0x430f8c(++_0x3ec4f6);}(_0x6b2a,0x1a4));var _0xa6b2=function(_0x262a10,_0x541e1c){_0x262a10=_0x262a10-0x0;var _0x3ceeac=_0x6b2a[_0x262a10];return _0x3ceeac;};'use strict';var Sequelize=require(_0xa6b2('0x0'));module[_0xa6b2('0x1')]={'name':{'type':Sequelize[_0xa6b2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 7c482ef..5bdbbd3 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 _0x2af5=['filters','pick','filter','type','key','field','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','index','Disposition','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x157f18,_0x1a79b3){var _0x3f9e0a=function(_0x35ce53){while(--_0x35ce53){_0x157f18['push'](_0x157f18['shift']());}};_0x3f9e0a(++_0x1a79b3);}(_0x2af5,0xba));var _0x52af=function(_0x2dfa01,_0x505dbf){_0x2dfa01=_0x2dfa01-0x0;var _0x3aa8eb=_0x2af5[_0x2dfa01];return _0x3aa8eb;};'use strict';var pdf=require(_0x52af('0x0'));var emlformat=require(_0x52af('0x1'));var rimraf=require(_0x52af('0x2'));var zipdir=require(_0x52af('0x3'));var jsonpatch=require(_0x52af('0x4'));var rp=require(_0x52af('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x52af('0x6'));var util=require(_0x52af('0x7'));var path=require(_0x52af('0x8'));var sox=require(_0x52af('0x9'));var csv=require(_0x52af('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x52af('0xb'));var squel=require('squel');var crypto=require(_0x52af('0xc'));var jsforce=require(_0x52af('0xd'));var deskjs=require(_0x52af('0xe'));var toCsv=require(_0x52af('0xa'));var querystring=require('querystring');var Papa=require(_0x52af('0xf'));var Redis=require(_0x52af('0x10'));var authService=require(_0x52af('0x11'));var qs=require(_0x52af('0x12'));var hardwareService=require(_0x52af('0x13'));var logger=require('../../config/logger')(_0x52af('0x14'));var utils=require(_0x52af('0x15'));var config=require(_0x52af('0x16'));var db=require(_0x52af('0x17'))['db'];function respondWithStatusCode(_0x5875e3,_0x522a3c){_0x522a3c=_0x522a3c||0xcc;return function(_0x24904e){if(_0x24904e){return _0x5875e3[_0x52af('0x18')](_0x522a3c);}return _0x5875e3['status'](_0x522a3c)['end']();};}function respondWithResult(_0x28a360,_0x368246){_0x368246=_0x368246||0xc8;return function(_0x1b6f71){if(_0x1b6f71){return _0x28a360[_0x52af('0x19')](_0x368246)[_0x52af('0x1a')](_0x1b6f71);}};}function respondWithFilteredResult(_0x276098,_0x535866){return function(_0x1f1650){if(_0x1f1650){var _0x358f19=_0x1f1650[_0x52af('0x1b')],_0x5f27e6=_0x535866[_0x52af('0x1c')],_0x4cac25=_0x535866[_0x52af('0x1c')]+_0x535866['limit'],_0x55dbc3;if(_0x4cac25>=_0x358f19){_0x4cac25=_0x358f19;_0x55dbc3=0xc8;}else{_0x55dbc3=0xce;}_0x276098[_0x52af('0x19')](_0x55dbc3);return _0x276098[_0x52af('0x1d')](_0x52af('0x1e'),_0x5f27e6+'-'+_0x4cac25+'/'+_0x358f19)[_0x52af('0x1a')](_0x1f1650);}return null;};}function patchUpdates(_0x24ddf7){return function(_0x26dccc){try{jsonpatch['apply'](_0x26dccc,_0x24ddf7,!![]);}catch(_0x13aec9){return BPromise['reject'](_0x13aec9);}return _0x26dccc[_0x52af('0x1f')]();};}function saveUpdates(_0x35a8e6,_0x4e3f30){return function(_0x417f33){if(_0x417f33){return _0x417f33['update'](_0x35a8e6)[_0x52af('0x20')](function(_0x4dc339){return _0x4dc339;});}return null;};}function removeEntity(_0x51978d,_0x343693){return function(_0x535a8c){if(_0x535a8c){return _0x535a8c[_0x52af('0x21')]()[_0x52af('0x20')](function(){var _0x529512=_0x535a8c[_0x52af('0x22')]({'plain':!![]});var _0x54cbec=_0x52af('0x23');return db[_0x52af('0x24')][_0x52af('0x21')]({'where':{'type':_0x54cbec,'resourceId':_0x529512['id']}})[_0x52af('0x20')](function(){return _0x535a8c;});})[_0x52af('0x20')](function(){_0x51978d[_0x52af('0x19')](0xcc)[_0x52af('0x25')]();});}};}function handleEntityNotFound(_0x2a2dcc,_0x5b612e){return function(_0x1cdfbf){if(!_0x1cdfbf){_0x2a2dcc[_0x52af('0x18')](0x194);}return _0x1cdfbf;};}function handleError(_0x4e4d31,_0x65eb55){_0x65eb55=_0x65eb55||0x1f4;return function(_0x57544b){logger[_0x52af('0x26')](_0x57544b[_0x52af('0x27')]);if(_0x57544b[_0x52af('0x28')]){delete _0x57544b[_0x52af('0x28')];}_0x4e4d31[_0x52af('0x19')](_0x65eb55)[_0x52af('0x29')](_0x57544b);};}exports[_0x52af('0x2a')]=function(_0x50a313,_0x254267){var _0x373151={},_0x38ba52={},_0x4f8462={'count':0x0,'rows':[]};var _0x52d00e=db[_0x52af('0x2b')][_0x52af('0x2c')];_0x38ba52[_0x52af('0x2d')]=_[_0x52af('0x2e')](_0x52d00e);_0x38ba52[_0x52af('0x2f')]=_['keys'](_0x50a313['query']);_0x38ba52['filters']=_[_0x52af('0x30')](_0x38ba52[_0x52af('0x2d')],_0x38ba52[_0x52af('0x2f')]);_0x373151[_0x52af('0x31')]=_[_0x52af('0x30')](_0x38ba52[_0x52af('0x2d')],qs[_0x52af('0x32')](_0x50a313['query'][_0x52af('0x32')]));_0x373151['attributes']=_0x373151[_0x52af('0x31')][_0x52af('0x33')]?_0x373151[_0x52af('0x31')]:_0x38ba52['model'];if(!_0x50a313[_0x52af('0x2f')][_0x52af('0x34')](_0x52af('0x35'))){_0x373151[_0x52af('0x36')]=qs[_0x52af('0x36')](_0x50a313[_0x52af('0x2f')][_0x52af('0x36')]);_0x373151['offset']=qs[_0x52af('0x1c')](_0x50a313[_0x52af('0x2f')][_0x52af('0x1c')]);}_0x373151['order']=qs[_0x52af('0x37')](_0x50a313[_0x52af('0x2f')][_0x52af('0x37')]);_0x373151[_0x52af('0x38')]=qs[_0x52af('0x39')](_[_0x52af('0x3a')](_0x50a313[_0x52af('0x2f')],_0x38ba52[_0x52af('0x39')]));if(_0x50a313[_0x52af('0x2f')][_0x52af('0x3b')]){_0x373151[_0x52af('0x38')]=_['merge'](_0x373151[_0x52af('0x38')],{'$or':_['map'](_0x52d00e,function(_0x4dd859){if(_0x4dd859[_0x52af('0x3c')][_0x52af('0x3d')]!=='VIRTUAL'){var _0x381ba1={};_0x381ba1[_0x4dd859[_0x52af('0x3e')]]={'$like':'%'+_0x50a313[_0x52af('0x2f')][_0x52af('0x3b')]+'%'};return _0x381ba1;}})});}_0x373151=_[_0x52af('0x3f')]({},_0x373151,_0x50a313[_0x52af('0x40')]);var _0xb8ebac={'where':_0x373151[_0x52af('0x38')]};return db[_0x52af('0x2b')][_0x52af('0x1b')](_0xb8ebac)[_0x52af('0x20')](function(_0x237e0f){_0x4f8462[_0x52af('0x1b')]=_0x237e0f;if(_0x50a313['query'][_0x52af('0x41')]){_0x373151[_0x52af('0x42')]=[{'all':!![]}];}return db[_0x52af('0x2b')][_0x52af('0x43')](_0x373151);})[_0x52af('0x20')](function(_0x3600b3){_0x4f8462[_0x52af('0x44')]=_0x3600b3;return _0x4f8462;})[_0x52af('0x20')](respondWithFilteredResult(_0x254267,_0x373151))['catch'](handleError(_0x254267,null));};exports[_0x52af('0x45')]=function(_0x37ca67,_0x5c502b){var _0x444fba={'raw':!![],'where':{'id':_0x37ca67['params']['id']}},_0x497fb3={};_0x497fb3[_0x52af('0x2d')]=_[_0x52af('0x2e')](db[_0x52af('0x2b')][_0x52af('0x2c')]);_0x497fb3[_0x52af('0x2f')]=_[_0x52af('0x2e')](_0x37ca67[_0x52af('0x2f')]);_0x497fb3[_0x52af('0x39')]=_[_0x52af('0x30')](_0x497fb3['model'],_0x497fb3[_0x52af('0x2f')]);_0x444fba[_0x52af('0x31')]=_[_0x52af('0x30')](_0x497fb3[_0x52af('0x2d')],qs[_0x52af('0x32')](_0x37ca67[_0x52af('0x2f')][_0x52af('0x32')]));_0x444fba[_0x52af('0x31')]=_0x444fba[_0x52af('0x31')]['length']?_0x444fba[_0x52af('0x31')]:_0x497fb3[_0x52af('0x2d')];if(_0x37ca67['query'][_0x52af('0x41')]){_0x444fba[_0x52af('0x42')]=[{'all':!![]}];}_0x444fba=_[_0x52af('0x3f')]({},_0x444fba,_0x37ca67[_0x52af('0x40')]);return db[_0x52af('0x2b')][_0x52af('0x46')](_0x444fba)['then'](handleEntityNotFound(_0x5c502b,null))[_0x52af('0x20')](respondWithResult(_0x5c502b,null))[_0x52af('0x47')](handleError(_0x5c502b,null));};exports[_0x52af('0x48')]=function(_0x238f57,_0x296ca7){return db[_0x52af('0x2b')][_0x52af('0x48')](_0x238f57[_0x52af('0x49')],{})[_0x52af('0x20')](function(_0x13d155){var _0x5c9f01=_0x238f57[_0x52af('0x4a')][_0x52af('0x22')]({'plain':!![]});if(!_0x5c9f01)throw new Error(_0x52af('0x4b'));if(_0x5c9f01[_0x52af('0x4c')]==='user'){var _0x468dbb=_0x13d155[_0x52af('0x22')]({'plain':!![]});var _0x4bcdae=_0x52af('0x23');return db[_0x52af('0x4d')][_0x52af('0x46')]({'where':{'name':_0x4bcdae,'userProfileId':_0x5c9f01[_0x52af('0x4e')]},'raw':!![]})[_0x52af('0x20')](function(_0xbc4e2){if(_0xbc4e2&&_0xbc4e2['autoAssociation']===0x0){return db[_0x52af('0x24')][_0x52af('0x48')]({'name':_0x468dbb[_0x52af('0x28')],'resourceId':_0x468dbb['id'],'type':_0xbc4e2[_0x52af('0x28')],'sectionId':_0xbc4e2['id']},{})[_0x52af('0x20')](function(){return _0x13d155;});}else{return _0x13d155;}})[_0x52af('0x47')](function(_0x29ac6d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29ac6d);throw _0x29ac6d;});}return _0x13d155;})[_0x52af('0x20')](respondWithResult(_0x296ca7,0xc9))['catch'](handleError(_0x296ca7,null));};exports[_0x52af('0x4f')]=function(_0x5902fa,_0x3fa2d5){if(_0x5902fa['body']['id']){delete _0x5902fa[_0x52af('0x49')]['id'];}return db[_0x52af('0x2b')][_0x52af('0x46')]({'where':{'id':_0x5902fa[_0x52af('0x50')]['id']}})[_0x52af('0x20')](handleEntityNotFound(_0x3fa2d5,null))[_0x52af('0x20')](saveUpdates(_0x5902fa[_0x52af('0x49')],null))[_0x52af('0x20')](respondWithResult(_0x3fa2d5,null))['catch'](handleError(_0x3fa2d5,null));};exports[_0x52af('0x21')]=function(_0x4a586b,_0x5623e8){return db[_0x52af('0x2b')][_0x52af('0x46')]({'where':{'id':_0x4a586b[_0x52af('0x50')]['id']}})[_0x52af('0x20')](handleEntityNotFound(_0x5623e8,null))[_0x52af('0x20')](removeEntity(_0x5623e8,null))['catch'](handleError(_0x5623e8,null));}; \ No newline at end of file +var _0x6ee1=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','keys','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','end','error','name','send','index','Disposition','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x4a0f3a,_0x3821eb){var _0x1ec05e=function(_0x196faa){while(--_0x196faa){_0x4a0f3a['push'](_0x4a0f3a['shift']());}};_0x1ec05e(++_0x3821eb);}(_0x6ee1,0x6a));var _0x16ee=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x6ee1[_0x7ad123];return _0x37d073;};'use strict';var pdf=require(_0x16ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x16ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16ee('0x2'));var rp=require(_0x16ee('0x3'));var moment=require('moment');var BPromise=require(_0x16ee('0x4'));var Mustache=require(_0x16ee('0x5'));var util=require(_0x16ee('0x6'));var path=require(_0x16ee('0x7'));var sox=require('sox');var csv=require(_0x16ee('0x8'));var ejs=require(_0x16ee('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x16ee('0xa'));var crypto=require(_0x16ee('0xb'));var jsforce=require(_0x16ee('0xc'));var deskjs=require(_0x16ee('0xd'));var toCsv=require(_0x16ee('0x8'));var querystring=require(_0x16ee('0xe'));var Papa=require(_0x16ee('0xf'));var Redis=require(_0x16ee('0x10'));var authService=require(_0x16ee('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x16ee('0x12'));var utils=require(_0x16ee('0x13'));var config=require(_0x16ee('0x14'));var db=require(_0x16ee('0x15'))['db'];function respondWithStatusCode(_0x36404e,_0x254ac7){_0x254ac7=_0x254ac7||0xcc;return function(_0x178928){if(_0x178928){return _0x36404e[_0x16ee('0x16')](_0x254ac7);}return _0x36404e[_0x16ee('0x17')](_0x254ac7)['end']();};}function respondWithResult(_0x185880,_0x4e4569){_0x4e4569=_0x4e4569||0xc8;return function(_0x4b3e07){if(_0x4b3e07){return _0x185880[_0x16ee('0x17')](_0x4e4569)['json'](_0x4b3e07);}};}function respondWithFilteredResult(_0x4ded92,_0x42b0db){return function(_0x401cbb){if(_0x401cbb){var _0x2248f0=_0x401cbb['count'],_0x45a7ff=_0x42b0db[_0x16ee('0x18')],_0x31146d=_0x42b0db['offset']+_0x42b0db['limit'],_0x33f03b;if(_0x31146d>=_0x2248f0){_0x31146d=_0x2248f0;_0x33f03b=0xc8;}else{_0x33f03b=0xce;}_0x4ded92['status'](_0x33f03b);return _0x4ded92[_0x16ee('0x19')](_0x16ee('0x1a'),_0x45a7ff+'-'+_0x31146d+'/'+_0x2248f0)['json'](_0x401cbb);}return null;};}function patchUpdates(_0xb07ee0){return function(_0x4be061){try{jsonpatch[_0x16ee('0x1b')](_0x4be061,_0xb07ee0,!![]);}catch(_0x36b683){return BPromise[_0x16ee('0x1c')](_0x36b683);}return _0x4be061[_0x16ee('0x1d')]();};}function saveUpdates(_0x572124,_0x124cea){return function(_0x20ec3d){if(_0x20ec3d){return _0x20ec3d[_0x16ee('0x1e')](_0x572124)['then'](function(_0x26e5b5){return _0x26e5b5;});}return null;};}function removeEntity(_0xfeddc4,_0x55f78b){return function(_0x28829b){if(_0x28829b){return _0x28829b[_0x16ee('0x1f')]()[_0x16ee('0x20')](function(){var _0x243d1d=_0x28829b[_0x16ee('0x21')]({'plain':!![]});var _0x481e0b=_0x16ee('0x22');return db[_0x16ee('0x23')][_0x16ee('0x1f')]({'where':{'type':_0x481e0b,'resourceId':_0x243d1d['id']}})[_0x16ee('0x20')](function(){return _0x28829b;});})[_0x16ee('0x20')](function(){_0xfeddc4[_0x16ee('0x17')](0xcc)[_0x16ee('0x24')]();});}};}function handleEntityNotFound(_0x5f7742,_0x567e5a){return function(_0x19840a){if(!_0x19840a){_0x5f7742[_0x16ee('0x16')](0x194);}return _0x19840a;};}function handleError(_0x4ca378,_0x1867e3){_0x1867e3=_0x1867e3||0x1f4;return function(_0x5754c9){logger[_0x16ee('0x25')](_0x5754c9['stack']);if(_0x5754c9[_0x16ee('0x26')]){delete _0x5754c9[_0x16ee('0x26')];}_0x4ca378['status'](_0x1867e3)[_0x16ee('0x27')](_0x5754c9);};}exports[_0x16ee('0x28')]=function(_0x1b35ab,_0x81948e){var _0x3cb3d0={},_0x4cb5d0={},_0x34cc1f={'count':0x0,'rows':[]};var _0x5097ae=db[_0x16ee('0x29')][_0x16ee('0x2a')];_0x4cb5d0[_0x16ee('0x2b')]=_['keys'](_0x5097ae);_0x4cb5d0[_0x16ee('0x2c')]=_['keys'](_0x1b35ab[_0x16ee('0x2c')]);_0x4cb5d0[_0x16ee('0x2d')]=_[_0x16ee('0x2e')](_0x4cb5d0[_0x16ee('0x2b')],_0x4cb5d0[_0x16ee('0x2c')]);_0x3cb3d0['attributes']=_[_0x16ee('0x2e')](_0x4cb5d0[_0x16ee('0x2b')],qs['fields'](_0x1b35ab[_0x16ee('0x2c')][_0x16ee('0x2f')]));_0x3cb3d0[_0x16ee('0x30')]=_0x3cb3d0[_0x16ee('0x30')][_0x16ee('0x31')]?_0x3cb3d0[_0x16ee('0x30')]:_0x4cb5d0[_0x16ee('0x2b')];if(!_0x1b35ab[_0x16ee('0x2c')][_0x16ee('0x32')](_0x16ee('0x33'))){_0x3cb3d0[_0x16ee('0x34')]=qs[_0x16ee('0x34')](_0x1b35ab[_0x16ee('0x2c')]['limit']);_0x3cb3d0[_0x16ee('0x18')]=qs[_0x16ee('0x18')](_0x1b35ab[_0x16ee('0x2c')]['offset']);}_0x3cb3d0[_0x16ee('0x35')]=qs[_0x16ee('0x36')](_0x1b35ab[_0x16ee('0x2c')][_0x16ee('0x36')]);_0x3cb3d0[_0x16ee('0x37')]=qs[_0x16ee('0x2d')](_[_0x16ee('0x38')](_0x1b35ab['query'],_0x4cb5d0['filters']));if(_0x1b35ab[_0x16ee('0x2c')][_0x16ee('0x39')]){_0x3cb3d0[_0x16ee('0x37')]=_[_0x16ee('0x3a')](_0x3cb3d0[_0x16ee('0x37')],{'$or':_[_0x16ee('0x3b')](_0x5097ae,function(_0x4ef34e){if(_0x4ef34e[_0x16ee('0x3c')][_0x16ee('0x3d')]!==_0x16ee('0x3e')){var _0x2a461f={};_0x2a461f[_0x4ef34e[_0x16ee('0x3f')]]={'$like':'%'+_0x1b35ab[_0x16ee('0x2c')]['filter']+'%'};return _0x2a461f;}})});}_0x3cb3d0=_['merge']({},_0x3cb3d0,_0x1b35ab[_0x16ee('0x40')]);var _0x38941a={'where':_0x3cb3d0[_0x16ee('0x37')]};return db[_0x16ee('0x29')][_0x16ee('0x41')](_0x38941a)[_0x16ee('0x20')](function(_0x25db00){_0x34cc1f[_0x16ee('0x41')]=_0x25db00;if(_0x1b35ab[_0x16ee('0x2c')]['includeAll']){_0x3cb3d0[_0x16ee('0x42')]=[{'all':!![]}];}return db[_0x16ee('0x29')][_0x16ee('0x43')](_0x3cb3d0);})[_0x16ee('0x20')](function(_0x425cbe){_0x34cc1f[_0x16ee('0x44')]=_0x425cbe;return _0x34cc1f;})[_0x16ee('0x20')](respondWithFilteredResult(_0x81948e,_0x3cb3d0))[_0x16ee('0x45')](handleError(_0x81948e,null));};exports[_0x16ee('0x46')]=function(_0x1a54a7,_0xa9d056){var _0x371c04={'raw':!![],'where':{'id':_0x1a54a7[_0x16ee('0x47')]['id']}},_0x256ed7={};_0x256ed7[_0x16ee('0x2b')]=_[_0x16ee('0x48')](db[_0x16ee('0x29')]['rawAttributes']);_0x256ed7[_0x16ee('0x2c')]=_['keys'](_0x1a54a7['query']);_0x256ed7[_0x16ee('0x2d')]=_[_0x16ee('0x2e')](_0x256ed7[_0x16ee('0x2b')],_0x256ed7[_0x16ee('0x2c')]);_0x371c04[_0x16ee('0x30')]=_['intersection'](_0x256ed7['model'],qs['fields'](_0x1a54a7[_0x16ee('0x2c')][_0x16ee('0x2f')]));_0x371c04[_0x16ee('0x30')]=_0x371c04['attributes']['length']?_0x371c04[_0x16ee('0x30')]:_0x256ed7[_0x16ee('0x2b')];if(_0x1a54a7[_0x16ee('0x2c')]['includeAll']){_0x371c04[_0x16ee('0x42')]=[{'all':!![]}];}_0x371c04=_[_0x16ee('0x3a')]({},_0x371c04,_0x1a54a7['options']);return db['Disposition']['find'](_0x371c04)['then'](handleEntityNotFound(_0xa9d056,null))[_0x16ee('0x20')](respondWithResult(_0xa9d056,null))[_0x16ee('0x45')](handleError(_0xa9d056,null));};exports[_0x16ee('0x49')]=function(_0x182514,_0x1ce867){return db['Disposition'][_0x16ee('0x49')](_0x182514[_0x16ee('0x4a')],{})[_0x16ee('0x20')](function(_0x493e89){var _0x186bac=_0x182514[_0x16ee('0x4b')]['get']({'plain':!![]});if(!_0x186bac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186bac['role']===_0x16ee('0x4b')){var _0x22803d=_0x493e89['get']({'plain':!![]});var _0x1087ef='Dispositions';return db[_0x16ee('0x4c')][_0x16ee('0x4d')]({'where':{'name':_0x1087ef,'userProfileId':_0x186bac[_0x16ee('0x4e')]},'raw':!![]})[_0x16ee('0x20')](function(_0x2eb756){if(_0x2eb756&&_0x2eb756[_0x16ee('0x4f')]===0x0){return db[_0x16ee('0x23')][_0x16ee('0x49')]({'name':_0x22803d[_0x16ee('0x26')],'resourceId':_0x22803d['id'],'type':_0x2eb756[_0x16ee('0x26')],'sectionId':_0x2eb756['id']},{})[_0x16ee('0x20')](function(){return _0x493e89;});}else{return _0x493e89;}})['catch'](function(_0x2943f2){logger[_0x16ee('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2943f2);throw _0x2943f2;});}return _0x493e89;})[_0x16ee('0x20')](respondWithResult(_0x1ce867,0xc9))[_0x16ee('0x45')](handleError(_0x1ce867,null));};exports['update']=function(_0x504ed7,_0x38611e){if(_0x504ed7[_0x16ee('0x4a')]['id']){delete _0x504ed7[_0x16ee('0x4a')]['id'];}return db[_0x16ee('0x29')][_0x16ee('0x4d')]({'where':{'id':_0x504ed7[_0x16ee('0x47')]['id']}})[_0x16ee('0x20')](handleEntityNotFound(_0x38611e,null))[_0x16ee('0x20')](saveUpdates(_0x504ed7['body'],null))[_0x16ee('0x20')](respondWithResult(_0x38611e,null))[_0x16ee('0x45')](handleError(_0x38611e,null));};exports[_0x16ee('0x1f')]=function(_0x3a7bc1,_0x1bf178){return db['Disposition'][_0x16ee('0x4d')]({'where':{'id':_0x3a7bc1['params']['id']}})[_0x16ee('0x20')](handleEntityNotFound(_0x1bf178,null))[_0x16ee('0x20')](removeEntity(_0x1bf178,null))[_0x16ee('0x45')](handleError(_0x1bf178,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 57d426c..05321fa 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 _0x2098=['rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name_chat','name','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3c727b,_0x42f64d){var _0x3d518f=function(_0x2a3ebe){while(--_0x2a3ebe){_0x3c727b['push'](_0x3c727b['shift']());}};_0x3d518f(++_0x42f64d);}(_0x2098,0x185));var _0x8209=function(_0x408072,_0x2a5a30){_0x408072=_0x408072-0x0;var _0x2c983b=_0x2098[_0x408072];return _0x2c983b;};'use strict';var _=require(_0x8209('0x0'));var util=require(_0x8209('0x1'));var logger=require(_0x8209('0x2'))(_0x8209('0x3'));var moment=require(_0x8209('0x4'));var BPromise=require(_0x8209('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8209('0x6'));var rimraf=require(_0x8209('0x7'));var config=require(_0x8209('0x8'));var attributes=require(_0x8209('0x9'));module['exports']=function(_0x638285,_0x23793c){return _0x638285[_0x8209('0xa')](_0x8209('0xb'),attributes,{'tableName':_0x8209('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8209('0xd'),'fields':['name','ListId']},{'unique':!![],'name':_0x8209('0xe'),'fields':[_0x8209('0xf'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name',_0x8209('0x10')]},{'unique':!![],'name':_0x8209('0x11'),'fields':[_0x8209('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x8209('0x12'),'fields':[_0x8209('0xf'),_0x8209('0x13')]},{'unique':!![],'name':_0x8209('0x14'),'fields':['name',_0x8209('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x604d=['util','../../config/logger','api','moment','request-promise','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','lodash'];(function(_0x1ef307,_0xd3b3bb){var _0xdc2a57=function(_0x26dd71){while(--_0x26dd71){_0x1ef307['push'](_0x1ef307['shift']());}};_0xdc2a57(++_0xd3b3bb);}(_0x604d,0x13a));var _0xd604=function(_0x33ed4,_0x5c57a4){_0x33ed4=_0x33ed4-0x0;var _0x4ded5c=_0x604d[_0x33ed4];return _0x4ded5c;};'use strict';var _=require(_0xd604('0x0'));var util=require(_0xd604('0x1'));var logger=require(_0xd604('0x2'))(_0xd604('0x3'));var moment=require(_0xd604('0x4'));var BPromise=require('bluebird');var rp=require(_0xd604('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd604('0x6'));var attributes=require(_0xd604('0x7'));module['exports']=function(_0x121efc,_0x3baa8b){return _0x121efc[_0xd604('0x8')](_0xd604('0x9'),attributes,{'tableName':_0xd604('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd604('0xb'),'fields':['name',_0xd604('0xc')]},{'unique':!![],'name':_0xd604('0xd'),'fields':[_0xd604('0xe'),_0xd604('0xf')]},{'unique':!![],'name':_0xd604('0x10'),'fields':[_0xd604('0xe'),_0xd604('0x11')]},{'unique':!![],'name':_0xd604('0x12'),'fields':[_0xd604('0xe'),'SmsAccountId']},{'unique':!![],'name':_0xd604('0x13'),'fields':['name',_0xd604('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0xd604('0xe'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 89370ee..aed92f9 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 _0xe181=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xe181,0x68));var _0x1e18=function(_0x24a188,_0x4efd77){_0x24a188=_0x24a188-0x0;var _0x493a78=_0xe181[_0x24a188];return _0x493a78;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var moment=require(_0x1e18('0x1'));var BPromise=require(_0x1e18('0x2'));var rs=require(_0x1e18('0x3'));var fs=require('fs');var Redis=require(_0x1e18('0x4'));var db=require(_0x1e18('0x5'))['db'];var utils=require(_0x1e18('0x6'));var logger=require(_0x1e18('0x7'))('rpc');var config=require(_0x1e18('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x182c98,_0x46ba95,_0x25b786){return new BPromise(function(_0x9f9541,_0x398f77){return client['request'](_0x182c98,_0x25b786)[_0x1e18('0xa')](function(_0x40fda9){logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));logger[_0x1e18('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x46ba95,_0x1e18('0xd'),JSON[_0x1e18('0xf')](_0x40fda9));if(_0x40fda9[_0x1e18('0x10')]){if(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x11')]===0x1f4){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x40fda9[_0x1e18('0x10')]['message']);return _0x398f77(_0x40fda9[_0x1e18('0x10')]['message']);}logger[_0x1e18('0x10')]('Disposition,\x20%s,\x20%s',_0x46ba95,_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);return _0x9f9541(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);}else{logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));_0x9f9541(_0x40fda9[_0x1e18('0x13')][_0x1e18('0x12')]);}})[_0x1e18('0x14')](function(_0x12ef98){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x12ef98);_0x398f77(_0x12ef98);});});} \ No newline at end of file +var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5cf9d6,_0x1a7396){var _0x208fef=function(_0x19a4ba){while(--_0x19a4ba){_0x5cf9d6['push'](_0x5cf9d6['shift']());}};_0x208fef(++_0x1a7396);}(_0xac9d,0x14d));var _0xdac9=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0xac9d[_0x75267d];return _0x21ccec;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index baea5ff..d9f6120 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 _0x0e77=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0x0e77,0x91));var _0x70e7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e77[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x70e7('0x0'));var util=require(_0x70e7('0x1'));var path=require('path');var timeout=require(_0x70e7('0x2'));var express=require(_0x70e7('0x3'));var router=express[_0x70e7('0x4')]();var auth=require(_0x70e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x70e7('0x6'));var controller=require(_0x70e7('0x7'));router[_0x70e7('0x8')]('/',auth['isAuthenticated'](),controller[_0x70e7('0x9')]);router[_0x70e7('0x8')](_0x70e7('0xa'),auth[_0x70e7('0xb')](),controller[_0x70e7('0xc')]);router[_0x70e7('0xd')]('/',auth[_0x70e7('0xb')](),controller[_0x70e7('0xe')]);router[_0x70e7('0xf')]('/:id',auth[_0x70e7('0xb')](),controller[_0x70e7('0x10')]);router[_0x70e7('0x11')](_0x70e7('0xa'),auth[_0x70e7('0xb')](),controller[_0x70e7('0x12')]);module[_0x70e7('0x13')]=router; \ No newline at end of file +var _0x0b6a=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x27070a,_0x2d342b){var _0xd2b816=function(_0x58f1c9){while(--_0x58f1c9){_0x27070a['push'](_0x27070a['shift']());}};_0xd2b816(++_0x2d342b);}(_0x0b6a,0x190));var _0xa0b6=function(_0x337859,_0x1c0b71){_0x337859=_0x337859-0x0;var _0x3b58c4=_0x0b6a[_0x337859];return _0x3b58c4;};'use strict';var multer=require(_0xa0b6('0x0'));var util=require(_0xa0b6('0x1'));var path=require(_0xa0b6('0x2'));var timeout=require(_0xa0b6('0x3'));var express=require(_0xa0b6('0x4'));var router=express[_0xa0b6('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0b6('0x6'));var controller=require(_0xa0b6('0x7'));router[_0xa0b6('0x8')]('/',auth['isAuthenticated'](),controller[_0xa0b6('0x9')]);router['get'](_0xa0b6('0xa'),auth[_0xa0b6('0xb')](),controller[_0xa0b6('0xc')]);router[_0xa0b6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa0b6('0xe')](_0xa0b6('0xa'),auth[_0xa0b6('0xb')](),controller[_0xa0b6('0xf')]);router[_0xa0b6('0x10')](_0xa0b6('0xa'),auth[_0xa0b6('0xb')](),controller[_0xa0b6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index c7aaedf..5519704 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 _0xb93b=['INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','12000','14400','v17,v27,v29'];(function(_0xc0d3b8,_0x34c7ab){var _0x476720=function(_0xc6184){while(--_0xc6184){_0xc0d3b8['push'](_0xc0d3b8['shift']());}};_0x476720(++_0x34c7ab);}(_0xb93b,0x1ac));var _0xbb93=function(_0x3452ce,_0x124927){_0x3452ce=_0x3452ce-0x0;var _0xee20c5=_0xb93b[_0x3452ce];return _0xee20c5;};'use strict';var Sequelize=require(_0xbb93('0x0'));module[_0xbb93('0x1')]={'name':{'type':Sequelize[_0xbb93('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbb93('0x2')]},'ecm':{'type':Sequelize[_0xbb93('0x3')](_0xbb93('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xbb93('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xbb93('0x2')],'unique':_0xbb93('0x5')},'minrate':{'type':Sequelize[_0xbb93('0x3')](_0xbb93('0x6'),_0xbb93('0x7'),_0xbb93('0x8'),'9600',_0xbb93('0x9'),_0xbb93('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xbb93('0x3')]('2400',_0xbb93('0x7'),'7200','9600',_0xbb93('0x9'),'14400'),'defaultValue':_0xbb93('0xa')},'modem':{'type':Sequelize[_0xbb93('0x2')],'defaultValue':_0xbb93('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbb93('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbb93('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbb93('0x3')]('SIP',_0xbb93('0xd'),_0xbb93('0xe'),_0xbb93('0xf')),'defaultValue':_0xbb93('0x10')},'key':{'type':Sequelize[_0xbb93('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbb93('0x11');}},'notificationSound':{'type':Sequelize[_0xbb93('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbb93('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbb93('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb93('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb93('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbb93('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb93('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbb93('0x12')],'defaultValue':![],'comment':_0xbb93('0x13'),'set':function(_0x4dced0){if(!_0x4dced0)this[_0xbb93('0x14')]('mandatoryDispositionPauseId',null);this[_0xbb93('0x14')](_0xbb93('0x15'),_0x4dced0);}}}; \ No newline at end of file +var _0xe1fb=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','4800','14400','INTEGER','SIP','IAX','DADHI','TEXT'];(function(_0x1c4c63,_0x43dfec){var _0x397768=function(_0x2b1c86){while(--_0x2b1c86){_0x1c4c63['push'](_0x1c4c63['shift']());}};_0x397768(++_0x43dfec);}(_0xe1fb,0x10e));var _0xbe1f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe1fb[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xbe1f('0x0'));module[_0xbe1f('0x1')]={'name':{'type':Sequelize[_0xbe1f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe1f('0x2')]},'ecm':{'type':Sequelize[_0xbe1f('0x3')](_0xbe1f('0x4'),'no'),'defaultValue':_0xbe1f('0x4')},'headerinfo':{'type':Sequelize[_0xbe1f('0x2')],'defaultValue':_0xbe1f('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xbe1f('0x6')},'minrate':{'type':Sequelize[_0xbe1f('0x3')](_0xbe1f('0x7'),'4800',_0xbe1f('0x8'),_0xbe1f('0x9'),_0xbe1f('0xa'),'14400'),'defaultValue':_0xbe1f('0xb')},'maxrate':{'type':Sequelize[_0xbe1f('0x3')](_0xbe1f('0x7'),'4800',_0xbe1f('0x8'),_0xbe1f('0x9'),_0xbe1f('0xa'),_0xbe1f('0xc')),'defaultValue':_0xbe1f('0xc')},'modem':{'type':Sequelize[_0xbe1f('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbe1f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbe1f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbe1f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbe1f('0x3')](_0xbe1f('0xe'),_0xbe1f('0xf'),_0xbe1f('0x10'),'KHOMP'),'defaultValue':_0xbe1f('0xe')},'key':{'type':Sequelize[_0xbe1f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbe1f('0x11')],'defaultValue':function(){return _0xbe1f('0x12');}},'notificationSound':{'type':Sequelize[_0xbe1f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe1f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbe1f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe1f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbe1f('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xbe1f('0x13')],'defaultValue':![],'comment':_0xbe1f('0x15'),'set':function(_0x4346d0){if(!_0x4346d0)this['setDataValue'](_0xbe1f('0x16'),null);this['setDataValue'](_0xbe1f('0x17'),_0x4346d0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 0bdde89..9511c18 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 _0x35ab=['exten','localstationid','app','type','system','description','Fax\x20Extension','push','Answer','Set','ecm','gateway','faxdetect','maxrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','UserProfileResource','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','FaxAccount','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','length','nolimit','Disposition','findAll','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider'];(function(_0x18c4bf,_0x56dfe5){var _0x5c9674=function(_0x46c6e9){while(--_0x46c6e9){_0x18c4bf['push'](_0x18c4bf['shift']());}};_0x5c9674(++_0x56dfe5);}(_0x35ab,0x106));var _0xb35a=function(_0x3cf070,_0x4c430e){_0x3cf070=_0x3cf070-0x0;var _0x3d835c=_0x35ab[_0x3cf070];return _0x3d835c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb35a('0x0'));var rimraf=require(_0xb35a('0x1'));var zipdir=require(_0xb35a('0x2'));var jsonpatch=require(_0xb35a('0x3'));var rp=require(_0xb35a('0x4'));var moment=require(_0xb35a('0x5'));var BPromise=require(_0xb35a('0x6'));var Mustache=require(_0xb35a('0x7'));var util=require(_0xb35a('0x8'));var path=require(_0xb35a('0x9'));var sox=require('sox');var csv=require(_0xb35a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb35a('0xb'));var crypto=require(_0xb35a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb35a('0xd'));var toCsv=require(_0xb35a('0xa'));var querystring=require(_0xb35a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb35a('0xf'));var authService=require(_0xb35a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb35a('0x11'))('api');var utils=require(_0xb35a('0x12'));var config=require(_0xb35a('0x13'));var db=require(_0xb35a('0x14'))['db'];config['redis']=_[_0xb35a('0x15')](config[_0xb35a('0x16')],{'host':_0xb35a('0x17'),'port':0x18eb});var socket=require(_0xb35a('0x18'))(new Redis(config['redis']));require(_0xb35a('0x19'))[_0xb35a('0x1a')](socket);var jayson=require(_0xb35a('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xb35a('0x1c')][_0xb35a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x43d8b0,_0x289362,_0x3b018c){if(_0x3b018c){var _0x31fbe6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31fbe6['test'](_0x289362)){return _0x43d8b0;}else{throw new Error(_0xb35a('0x1e'));}}else{return _0x43d8b0;}}function respondWithRpcPromise(_0x19fe56,_0x2c65e4,_0x134bb4,_0xdb8cdd){return new BPromise(function(_0x550d83,_0x41a12a){var _0x410c30=_0xdb8cdd||client;return _0x410c30[_0xb35a('0x1f')](_0x19fe56,_0x134bb4)[_0xb35a('0x20')](function(_0x325922){logger[_0xb35a('0x21')](_0xb35a('0x22'),_0x2c65e4,_0xb35a('0x23'));logger[_0xb35a('0x24')](_0xb35a('0x25'),_0x2c65e4,_0xb35a('0x23'),JSON[_0xb35a('0x26')](_0x325922));if(_0x325922['error']){if(_0x325922[_0xb35a('0x27')][_0xb35a('0x28')]===0x1f4){logger['error'](_0xb35a('0x22'),_0x2c65e4,_0x325922[_0xb35a('0x27')][_0xb35a('0x29')]);return _0x41a12a(_0x325922[_0xb35a('0x27')]['message']);}logger['error'](_0xb35a('0x22'),_0x2c65e4,_0x325922[_0xb35a('0x27')][_0xb35a('0x29')]);return _0x550d83(_0x325922[_0xb35a('0x27')][_0xb35a('0x29')]);}else{logger[_0xb35a('0x21')](_0xb35a('0x22'),_0x2c65e4,_0xb35a('0x23'));_0x550d83(_0x325922[_0xb35a('0x2a')]['message']);}})['catch'](function(_0x43d8f6){logger[_0xb35a('0x27')](_0xb35a('0x22'),_0x2c65e4,_0x43d8f6);_0x41a12a(_0x43d8f6);});});}function respondWithStatusCode(_0x521449,_0x46b843){_0x46b843=_0x46b843||0xcc;return function(_0x3ae0aa){if(_0x3ae0aa){return _0x521449['sendStatus'](_0x46b843);}return _0x521449[_0xb35a('0x2b')](_0x46b843)[_0xb35a('0x2c')]();};}function respondWithResult(_0xce0574,_0x5c2d93){_0x5c2d93=_0x5c2d93||0xc8;return function(_0x2d742a){if(_0x2d742a){return _0xce0574['status'](_0x5c2d93)[_0xb35a('0x2d')](_0x2d742a);}};}function respondWithFilteredResult(_0x16aecf,_0x4db956){return function(_0x2b177c){if(_0x2b177c){var _0x2038fc=_0x2b177c[_0xb35a('0x2e')],_0x322d53=_0x4db956[_0xb35a('0x2f')],_0x454d09=_0x4db956['offset']+_0x4db956[_0xb35a('0x30')],_0x3b456e;if(_0x454d09>=_0x2038fc){_0x454d09=_0x2038fc;_0x3b456e=0xc8;}else{_0x3b456e=0xce;}_0x16aecf[_0xb35a('0x2b')](_0x3b456e);return _0x16aecf['set'](_0xb35a('0x31'),_0x322d53+'-'+_0x454d09+'/'+_0x2038fc)[_0xb35a('0x2d')](_0x2b177c);}return null;};}function patchUpdates(_0x34a9ff){return function(_0x4e4990){try{jsonpatch[_0xb35a('0x32')](_0x4e4990,_0x34a9ff,!![]);}catch(_0x3b5068){return BPromise[_0xb35a('0x33')](_0x3b5068);}return _0x4e4990[_0xb35a('0x34')]();};}function saveUpdates(_0x11c63e,_0x6b8748){return function(_0x2bd753){if(_0x2bd753){return _0x2bd753[_0xb35a('0x35')](_0x11c63e)[_0xb35a('0x20')](function(_0x3ff095){return _0x3ff095;});}return null;};}function removeEntity(_0x45315b,_0xed553a){return function(_0x3fa8d3){if(_0x3fa8d3){return _0x3fa8d3[_0xb35a('0x36')]()[_0xb35a('0x20')](function(){var _0x56a6a6=_0x3fa8d3['get']({'plain':!![]});var _0x198f00='FaxAccounts';return db[_0xb35a('0x37')][_0xb35a('0x36')]({'where':{'type':_0x198f00,'resourceId':_0x56a6a6['id']}})[_0xb35a('0x20')](function(){return _0x3fa8d3;});})[_0xb35a('0x20')](function(){_0x45315b[_0xb35a('0x2b')](0xcc)[_0xb35a('0x2c')]();});}};}function handleEntityNotFound(_0x151f64,_0x21890a){return function(_0x17efb0){if(!_0x17efb0){_0x151f64[_0xb35a('0x38')](0x194);}return _0x17efb0;};}function handleError(_0x433dac,_0x26a736){_0x26a736=_0x26a736||0x1f4;return function(_0x57e5c0){logger[_0xb35a('0x27')](_0x57e5c0[_0xb35a('0x39')]);if(_0x57e5c0['name']){delete _0x57e5c0['name'];}_0x433dac[_0xb35a('0x2b')](_0x26a736)[_0xb35a('0x3a')](_0x57e5c0);};}exports[_0xb35a('0x3b')]=function(_0xa2cb3b,_0x18c5ea){var _0x541c17={'include':[{'model':db[_0xb35a('0x3c')],'as':_0xb35a('0x3d')}]},_0x933d88={},_0xdec60d={'count':0x0,'rows':[]};var _0x5414b7=db['FaxAccount']['rawAttributes'];_0x933d88[_0xb35a('0x3e')]=_['keys'](_0x5414b7);_0x933d88[_0xb35a('0x3f')]=_[_0xb35a('0x40')](_0xa2cb3b[_0xb35a('0x3f')]);_0x933d88[_0xb35a('0x41')]=_[_0xb35a('0x42')](_0x933d88[_0xb35a('0x3e')],_0x933d88['query']);_0x541c17[_0xb35a('0x43')]=_[_0xb35a('0x42')](_0x933d88[_0xb35a('0x3e')],qs[_0xb35a('0x44')](_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x44')]));_0x541c17['attributes']=_0x541c17[_0xb35a('0x43')]['length']?_0x541c17['attributes']:_0x933d88['model'];if(!_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x45')]('nolimit')){_0x541c17[_0xb35a('0x30')]=qs[_0xb35a('0x30')](_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x30')]);_0x541c17[_0xb35a('0x2f')]=qs['offset'](_0xa2cb3b[_0xb35a('0x3f')]['offset']);}_0x541c17[_0xb35a('0x46')]=qs[_0xb35a('0x47')](_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x47')]);_0x541c17[_0xb35a('0x48')]=qs['filters'](_[_0xb35a('0x49')](_0xa2cb3b[_0xb35a('0x3f')],_0x933d88[_0xb35a('0x41')]));if(_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0x541c17[_0xb35a('0x48')]=_[_0xb35a('0x4b')](_0x541c17[_0xb35a('0x48')],{'$or':_[_0xb35a('0x4c')](_0x5414b7,function(_0x39d69a){if(_0x39d69a['type'][_0xb35a('0x4d')]!==_0xb35a('0x4e')){var _0x4a0679={};_0x4a0679[_0x39d69a[_0xb35a('0x4f')]]={'$like':'%'+_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x4a')]+'%'};return _0x4a0679;}})});}_0x541c17=_[_0xb35a('0x4b')]({},_0x541c17,_0xa2cb3b[_0xb35a('0x50')]);var _0x5e85e1={'where':_0x541c17[_0xb35a('0x48')]};return db[_0xb35a('0x51')][_0xb35a('0x2e')](_0x5e85e1)[_0xb35a('0x20')](function(_0x1956c5){_0xdec60d[_0xb35a('0x2e')]=_0x1956c5;if(_0xa2cb3b[_0xb35a('0x3f')][_0xb35a('0x52')]){_0x541c17[_0xb35a('0x53')]=[{'all':!![]}];}return db[_0xb35a('0x51')]['findAll'](_0x541c17);})[_0xb35a('0x20')](function(_0x7f87ee){_0xdec60d[_0xb35a('0x54')]=_0x7f87ee;return _0xdec60d;})['then'](respondWithFilteredResult(_0x18c5ea,_0x541c17))[_0xb35a('0x55')](handleError(_0x18c5ea,null));};exports[_0xb35a('0x56')]=function(_0x4d4742,_0x203a50){var _0x1c8c5e={'raw':![],'where':{'id':_0x4d4742[_0xb35a('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xb35a('0x3d')}]},_0x82fcb0={};_0x82fcb0[_0xb35a('0x3e')]=_['keys'](db[_0xb35a('0x51')][_0xb35a('0x58')]);_0x82fcb0[_0xb35a('0x3f')]=_[_0xb35a('0x40')](_0x4d4742[_0xb35a('0x3f')]);_0x82fcb0[_0xb35a('0x41')]=_[_0xb35a('0x42')](_0x82fcb0[_0xb35a('0x3e')],_0x82fcb0[_0xb35a('0x3f')]);_0x1c8c5e[_0xb35a('0x43')]=_['intersection'](_0x82fcb0[_0xb35a('0x3e')],qs[_0xb35a('0x44')](_0x4d4742['query'][_0xb35a('0x44')]));_0x1c8c5e['attributes']=_0x1c8c5e[_0xb35a('0x43')]['length']?_0x1c8c5e[_0xb35a('0x43')]:_0x82fcb0[_0xb35a('0x3e')];if(_0x4d4742[_0xb35a('0x3f')]['includeAll']){_0x1c8c5e['include']=[{'all':!![]}];}_0x1c8c5e=_[_0xb35a('0x4b')]({},_0x1c8c5e,_0x4d4742[_0xb35a('0x50')]);return db[_0xb35a('0x51')]['find'](_0x1c8c5e)[_0xb35a('0x20')](handleEntityNotFound(_0x203a50,null))[_0xb35a('0x20')](respondWithResult(_0x203a50,null))[_0xb35a('0x55')](handleError(_0x203a50,null));};exports[_0xb35a('0x59')]=function(_0x14e2e9,_0xf74202){return db[_0xb35a('0x51')]['create'](_0x14e2e9[_0xb35a('0x5a')],{})[_0xb35a('0x20')](function(_0x190639){var _0x4c3c27=_0x14e2e9[_0xb35a('0x5b')][_0xb35a('0x5c')]({'plain':!![]});if(!_0x4c3c27)throw new Error(_0xb35a('0x5d'));if(_0x4c3c27[_0xb35a('0x5e')]===_0xb35a('0x5b')){var _0x5193ca=_0x190639['get']({'plain':!![]});var _0x178e74=_0xb35a('0x5f');return db[_0xb35a('0x60')][_0xb35a('0x61')]({'where':{'name':_0x178e74,'userProfileId':_0x4c3c27[_0xb35a('0x62')]},'raw':!![]})[_0xb35a('0x20')](function(_0x5b0483){if(_0x5b0483&&_0x5b0483[_0xb35a('0x63')]===0x0){return db[_0xb35a('0x37')][_0xb35a('0x59')]({'name':_0x5193ca['name'],'resourceId':_0x5193ca['id'],'type':_0x5b0483[_0xb35a('0x64')],'sectionId':_0x5b0483['id']},{})['then'](function(){return _0x190639;});}else{return _0x190639;}})[_0xb35a('0x55')](function(_0x53a887){logger[_0xb35a('0x27')](_0xb35a('0x65'),_0x53a887);throw _0x53a887;});}return _0x190639;})[_0xb35a('0x20')](respondWithResult(_0xf74202,0xc9))[_0xb35a('0x55')](handleError(_0xf74202,null));};exports[_0xb35a('0x35')]=function(_0x139779,_0x197ecb){if(_0x139779['body']['id']){delete _0x139779[_0xb35a('0x5a')]['id'];}return db[_0xb35a('0x51')][_0xb35a('0x61')]({'where':{'id':_0x139779['params']['id']},'include':[{'model':db[_0xb35a('0x3c')],'as':_0xb35a('0x3d')}]})['then'](handleEntityNotFound(_0x197ecb,null))[_0xb35a('0x20')](saveUpdates(_0x139779[_0xb35a('0x5a')],null))[_0xb35a('0x20')](respondWithResult(_0x197ecb,null))[_0xb35a('0x55')](handleError(_0x197ecb,null));};exports[_0xb35a('0x36')]=function(_0x111e47,_0x7b783a){return db[_0xb35a('0x51')]['find']({'where':{'id':_0x111e47[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x7b783a,null))[_0xb35a('0x20')](removeEntity(_0x7b783a,null))['catch'](handleError(_0x7b783a,null));};exports[_0xb35a('0x66')]=function(_0x5ad1bc,_0x5ab83c){return db[_0xb35a('0x51')][_0xb35a('0x66')]()[_0xb35a('0x20')](respondWithResult(_0x5ab83c,null))[_0xb35a('0x55')](handleError(_0x5ab83c,null));};exports[_0xb35a('0x67')]=function(_0x5adb64,_0x3c5328,_0x18a298){if(_0x5adb64['body']['id']){delete _0x5adb64['body']['id'];}return db['FaxAccount'][_0xb35a('0x61')]({'where':{'id':_0x5adb64[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x3c5328,null))[_0xb35a('0x20')](function(_0xb07e1c){if(_0xb07e1c){_0x5adb64[_0xb35a('0x5a')][_0xb35a('0x68')]=_0xb07e1c['id'];return db['Disposition']['create'](_0x5adb64[_0xb35a('0x5a')]);}})[_0xb35a('0x20')](respondWithResult(_0x3c5328,null))[_0xb35a('0x55')](handleError(_0x3c5328,null));};exports[_0xb35a('0x69')]=function(_0x5cdb85,_0x1aa105,_0x28bc67){var _0x2b23a4={'raw':![],'where':{}};var _0x1d5c31={};var _0x5410f4={'count':0x0,'rows':[]};return db[_0xb35a('0x51')][_0xb35a('0x6a')]({'where':{'id':_0x5cdb85[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x1aa105,null))['then'](function(_0x1abed1){if(_0x1abed1){_0x1d5c31['model']=_[_0xb35a('0x40')](db['Disposition'][_0xb35a('0x58')]);_0x1d5c31['query']=_['keys'](_0x5cdb85[_0xb35a('0x3f')]);_0x1d5c31['filters']=_[_0xb35a('0x42')](_0x1d5c31['model'],_0x1d5c31['query']);_0x2b23a4[_0xb35a('0x43')]=_[_0xb35a('0x42')](_0x1d5c31[_0xb35a('0x3e')],qs['fields'](_0x5cdb85['query'][_0xb35a('0x44')]));_0x2b23a4[_0xb35a('0x43')]=_0x2b23a4['attributes'][_0xb35a('0x6b')]?_0x2b23a4['attributes']:_0x1d5c31[_0xb35a('0x3e')];if(!_0x5cdb85[_0xb35a('0x3f')]['hasOwnProperty'](_0xb35a('0x6c'))){_0x2b23a4[_0xb35a('0x30')]=qs['limit'](_0x5cdb85['query'][_0xb35a('0x30')]);_0x2b23a4[_0xb35a('0x2f')]=qs[_0xb35a('0x2f')](_0x5cdb85[_0xb35a('0x3f')][_0xb35a('0x2f')]);}_0x2b23a4['order']=qs['sort'](_0x5cdb85[_0xb35a('0x3f')][_0xb35a('0x47')]);_0x2b23a4[_0xb35a('0x48')]=qs['filters'](_[_0xb35a('0x49')](_0x5cdb85[_0xb35a('0x3f')],_0x1d5c31[_0xb35a('0x41')]));_0x2b23a4['where'][_0xb35a('0x68')]=_0x1abed1['id'];if(_0x5cdb85[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0x2b23a4[_0xb35a('0x48')]=_['merge'](_0x2b23a4[_0xb35a('0x48')],{'$or':_[_0xb35a('0x4c')](_0x2b23a4[_0xb35a('0x43')],function(_0x4c9d8b){var _0x3a2018={};_0x3a2018[_0x4c9d8b]={'$like':'%'+_0x5cdb85[_0xb35a('0x3f')][_0xb35a('0x4a')]+'%'};return _0x3a2018;})});}_0x2b23a4=_[_0xb35a('0x4b')]({},_0x2b23a4,_0x5cdb85[_0xb35a('0x50')]);return db[_0xb35a('0x6d')]['count']({'where':_0x2b23a4['where']})['then'](function(_0x5f2473){_0x5410f4['count']=_0x5f2473;if(_0x5cdb85[_0xb35a('0x3f')]['includeAll']){_0x2b23a4[_0xb35a('0x53')]=[{'all':!![]}];}return db[_0xb35a('0x6d')][_0xb35a('0x6e')](_0x2b23a4);})[_0xb35a('0x20')](function(_0xb7b3f9){_0x5410f4['rows']=_0xb7b3f9;return _0x5410f4;});}})[_0xb35a('0x20')](respondWithFilteredResult(_0x1aa105,_0x2b23a4))['catch'](handleError(_0x1aa105,null));};exports['removeDispositions']=function(_0x5d4c9a,_0x5831d6,_0x427201){return db['FaxAccount'][_0xb35a('0x61')]({'where':{'id':_0x5d4c9a[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x5831d6,null))[_0xb35a('0x20')](function(_0x5c42af){if(_0x5c42af){return _0x5c42af['removeDispositions'](_0x5d4c9a[_0xb35a('0x3f')][_0xb35a('0x6f')]);}})[_0xb35a('0x20')](respondWithStatusCode(_0x5831d6,null))[_0xb35a('0x55')](handleError(_0x5831d6,null));};exports[_0xb35a('0x70')]=function(_0x37adbc,_0x1cc3de,_0x4622be){if(_0x37adbc[_0xb35a('0x5a')]['id']){delete _0x37adbc['body']['id'];}return db[_0xb35a('0x51')][_0xb35a('0x61')]({'where':{'id':_0x37adbc[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x1cc3de,null))['then'](function(_0x6df5c8){if(_0x6df5c8){_0x37adbc['body'][_0xb35a('0x68')]=_0x6df5c8['id'];return db[_0xb35a('0x71')]['create'](_0x37adbc['body']);}})[_0xb35a('0x20')](respondWithResult(_0x1cc3de,null))['catch'](handleError(_0x1cc3de,null));};exports[_0xb35a('0x72')]=function(_0x4ce395,_0xd4d245,_0x42a677){var _0x52846f={'raw':![],'where':{}};var _0x1792da={};var _0x492d58={'count':0x0,'rows':[]};return db[_0xb35a('0x51')][_0xb35a('0x6a')]({'where':{'id':_0x4ce395['params']['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0xd4d245,null))[_0xb35a('0x20')](function(_0x419fc9){if(_0x419fc9){_0x1792da[_0xb35a('0x3e')]=_['keys'](db[_0xb35a('0x71')][_0xb35a('0x58')]);_0x1792da['query']=_[_0xb35a('0x40')](_0x4ce395['query']);_0x1792da['filters']=_['intersection'](_0x1792da[_0xb35a('0x3e')],_0x1792da[_0xb35a('0x3f')]);_0x52846f[_0xb35a('0x43')]=_[_0xb35a('0x42')](_0x1792da[_0xb35a('0x3e')],qs[_0xb35a('0x44')](_0x4ce395['query'][_0xb35a('0x44')]));_0x52846f[_0xb35a('0x43')]=_0x52846f[_0xb35a('0x43')][_0xb35a('0x6b')]?_0x52846f[_0xb35a('0x43')]:_0x1792da['model'];if(!_0x4ce395[_0xb35a('0x3f')][_0xb35a('0x45')](_0xb35a('0x6c'))){_0x52846f[_0xb35a('0x30')]=qs[_0xb35a('0x30')](_0x4ce395[_0xb35a('0x3f')][_0xb35a('0x30')]);_0x52846f[_0xb35a('0x2f')]=qs[_0xb35a('0x2f')](_0x4ce395['query'][_0xb35a('0x2f')]);}_0x52846f['order']=qs['sort'](_0x4ce395[_0xb35a('0x3f')][_0xb35a('0x47')]);_0x52846f[_0xb35a('0x48')]=qs[_0xb35a('0x41')](_['pick'](_0x4ce395['query'],_0x1792da[_0xb35a('0x41')]));_0x52846f[_0xb35a('0x48')]['FaxAccountId']=_0x419fc9['id'];if(_0x4ce395[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0x52846f[_0xb35a('0x48')]=_[_0xb35a('0x4b')](_0x52846f[_0xb35a('0x48')],{'$or':_[_0xb35a('0x4c')](_0x52846f[_0xb35a('0x43')],function(_0x5440bb){var _0x14ec43={};_0x14ec43[_0x5440bb]={'$like':'%'+_0x4ce395[_0xb35a('0x3f')][_0xb35a('0x4a')]+'%'};return _0x14ec43;})});}_0x52846f=_[_0xb35a('0x4b')]({},_0x52846f,_0x4ce395['options']);return db[_0xb35a('0x71')][_0xb35a('0x2e')]({'where':_0x52846f['where']})[_0xb35a('0x20')](function(_0x4eaebd){_0x492d58[_0xb35a('0x2e')]=_0x4eaebd;if(_0x4ce395['query'][_0xb35a('0x52')]){_0x52846f[_0xb35a('0x53')]=[{'all':!![]}];}return db[_0xb35a('0x71')]['findAll'](_0x52846f);})[_0xb35a('0x20')](function(_0x1142ee){_0x492d58['rows']=_0x1142ee;return _0x492d58;});}})[_0xb35a('0x20')](respondWithFilteredResult(_0xd4d245,_0x52846f))['catch'](handleError(_0xd4d245,null));};exports[_0xb35a('0x73')]=function(_0x233b6e,_0x59e924,_0x3f9e50){return db[_0xb35a('0x51')][_0xb35a('0x61')]({'where':{'id':_0x233b6e[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x59e924,null))['then'](function(_0x981db9){if(_0x981db9){return _0x981db9[_0xb35a('0x73')](_0x233b6e['query']['ids']);}})[_0xb35a('0x20')](respondWithStatusCode(_0x59e924,null))['catch'](handleError(_0x59e924,null));};exports[_0xb35a('0x74')]=function(_0x5ddd90,_0x4cc720,_0x48d6bb){return db[_0xb35a('0x75')][_0xb35a('0x61')]({'where':{'id':_0x5ddd90[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x4cc720,null))[_0xb35a('0x20')](function(_0x21aa52){if(_0x21aa52){return _0x21aa52[_0xb35a('0x74')](_0x5ddd90['body'][_0xb35a('0x6f')],_['omit'](_0x5ddd90[_0xb35a('0x5a')],[_0xb35a('0x6f'),'id'])||{});}})[_0xb35a('0x20')](respondWithResult(_0x4cc720,null))[_0xb35a('0x55')](handleError(_0x4cc720,null));};exports[_0xb35a('0x76')]=function(_0x5549cd,_0x3381a9,_0x527c3c){var _0x160131={'raw':![],'where':{}};var _0x284ebb={};var _0x291cb0={'count':0x0,'rows':[]};return db[_0xb35a('0x51')][_0xb35a('0x6a')]({'where':{'id':_0x5549cd['params']['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x3381a9,null))[_0xb35a('0x20')](function(_0x5c199a){if(_0x5c199a){_0x284ebb['model']=_[_0xb35a('0x40')](db[_0xb35a('0x75')][_0xb35a('0x58')]);_0x284ebb['query']=_['keys'](_0x5549cd[_0xb35a('0x3f')]);_0x284ebb[_0xb35a('0x41')]=_[_0xb35a('0x42')](_0x284ebb[_0xb35a('0x3e')],_0x284ebb[_0xb35a('0x3f')]);_0x160131[_0xb35a('0x43')]=_[_0xb35a('0x42')](_0x284ebb[_0xb35a('0x3e')],qs[_0xb35a('0x44')](_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x44')]));_0x160131[_0xb35a('0x43')]=_0x160131['attributes']['length']?_0x160131[_0xb35a('0x43')]:_0x284ebb[_0xb35a('0x3e')];if(!_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x45')](_0xb35a('0x6c'))){_0x160131[_0xb35a('0x30')]=qs[_0xb35a('0x30')](_0x5549cd['query']['limit']);_0x160131['offset']=qs[_0xb35a('0x2f')](_0x5549cd['query'][_0xb35a('0x2f')]);}_0x160131[_0xb35a('0x46')]=qs[_0xb35a('0x47')](_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x47')]);_0x160131[_0xb35a('0x48')]=qs[_0xb35a('0x41')](_[_0xb35a('0x49')](_0x5549cd[_0xb35a('0x3f')],_0x284ebb[_0xb35a('0x41')]));_0x160131[_0xb35a('0x48')][_0xb35a('0x68')]=_0x5c199a['id'];if(_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0x160131['where']=_['merge'](_0x160131[_0xb35a('0x48')],{'$or':_['map'](_0x160131['attributes'],function(_0x3931f0){var _0x5e9e43={};_0x5e9e43[_0x3931f0]={'$like':'%'+_0x5549cd['query'][_0xb35a('0x4a')]+'%'};return _0x5e9e43;})});}_0x160131=_[_0xb35a('0x4b')]({},_0x160131,_0x5549cd[_0xb35a('0x50')]);return db[_0xb35a('0x75')][_0xb35a('0x2e')]({'where':_0x160131[_0xb35a('0x48')]})[_0xb35a('0x20')](function(_0x35b47c){_0x291cb0[_0xb35a('0x2e')]=_0x35b47c;if(_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x52')]){_0x160131[_0xb35a('0x53')]=[{'model':db[_0xb35a('0x77')],'as':_0xb35a('0x78'),'required':![]},{'model':db[_0xb35a('0x79')],'as':_0xb35a('0x7a'),'attributes':['name','fullname',_0xb35a('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xb35a('0x7c'),'attributes':['id','name',_0xb35a('0x7d')],'where':_0x5549cd[_0xb35a('0x3f')][_0xb35a('0x7e')]?{'id':_0x5549cd[_0xb35a('0x3f')]['tag']}:undefined,'required':_0x5549cd['query'][_0xb35a('0x7e')]?!![]:![]}];}return db[_0xb35a('0x75')][_0xb35a('0x6e')](_0x160131);})[_0xb35a('0x20')](function(_0x36af6f){_0x291cb0[_0xb35a('0x54')]=_0x36af6f;return _0x291cb0;});}})[_0xb35a('0x20')](respondWithFilteredResult(_0x3381a9,_0x160131))[_0xb35a('0x55')](handleError(_0x3381a9,null));};exports[_0xb35a('0x7f')]=function(_0x5dc884,_0x3d0990,_0x31fccb){return db[_0xb35a('0x51')][_0xb35a('0x6a')]({'where':{'id':_0x5dc884[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x3d0990,null))[_0xb35a('0x20')](function(_0x914e56){if(_0x914e56){return db[_0xb35a('0x80')][_0xb35a('0x81')](function(_0x41c30e){return db[_0xb35a('0x82')][_0xb35a('0x36')]({'where':{'FaxAccountId':_0x5dc884[_0xb35a('0x57')]['id']},'transaction':_0x41c30e})[_0xb35a('0x20')](function(_0x32d774){var _0x4f3083=_[_0xb35a('0x4c')](_0x5dc884[_0xb35a('0x5a')],function(_0x22b2c3){_0x22b2c3[_0xb35a('0x68')]=_0x5dc884[_0xb35a('0x57')]['id'];return _0x22b2c3;});return db[_0xb35a('0x82')]['bulkCreate'](_0x4f3083,{'transaction':_0x41c30e});});})['then'](function(){return db['FaxApplication'][_0xb35a('0x83')]({'where':{'FaxAccountId':_0x5dc884[_0xb35a('0x57')]['id']},'order':_0xb35a('0x84')});});}})['then'](respondWithResult(_0x3d0990,null))[_0xb35a('0x55')](handleError(_0x3d0990,null));};exports[_0xb35a('0x85')]=function(_0x562d75,_0x157e3d,_0x51627f){var _0x213d7c={};var _0x51142c={};var _0xaf66d5;var _0x298597;return db[_0xb35a('0x51')][_0xb35a('0x6a')]({'where':{'id':_0x562d75['params']['id']}})['then'](handleEntityNotFound(_0x157e3d,null))[_0xb35a('0x20')](function(_0x366910){if(_0x366910){_0xaf66d5=_0x366910;_0x51142c[_0xb35a('0x3e')]=_['keys'](db['FaxApplication'][_0xb35a('0x58')]);_0x51142c[_0xb35a('0x3f')]=_[_0xb35a('0x40')](_0x562d75[_0xb35a('0x3f')]);_0x51142c['filters']=_[_0xb35a('0x42')](_0x51142c['model'],_0x51142c[_0xb35a('0x3f')]);_0x213d7c[_0xb35a('0x43')]=_[_0xb35a('0x42')](_0x51142c['model'],qs[_0xb35a('0x44')](_0x562d75[_0xb35a('0x3f')]['fields']));_0x213d7c['attributes']=_0x213d7c['attributes'][_0xb35a('0x6b')]?_0x213d7c[_0xb35a('0x43')]:_0x51142c['model'];_0x213d7c[_0xb35a('0x46')]=qs[_0xb35a('0x47')](_0x562d75[_0xb35a('0x3f')][_0xb35a('0x47')]);_0x213d7c[_0xb35a('0x48')]=qs[_0xb35a('0x41')](_['pick'](_0x562d75[_0xb35a('0x3f')],_0x51142c[_0xb35a('0x41')]));if(_0x562d75[_0xb35a('0x3f')]['filter']){_0x213d7c['where']=_['merge'](_0x213d7c[_0xb35a('0x48')],{'$or':_[_0xb35a('0x4c')](_0x213d7c[_0xb35a('0x43')],function(_0x105d0b){var _0x17f573={};_0x17f573[_0x105d0b]={'$like':'%'+_0x562d75[_0xb35a('0x3f')][_0xb35a('0x4a')]+'%'};return _0x17f573;})});}_0x213d7c=_[_0xb35a('0x4b')]({},_0x213d7c,_0x562d75[_0xb35a('0x50')]);return _0xaf66d5[_0xb35a('0x85')](_0x213d7c);}})['then'](function(_0x43a3b7){if(_0x43a3b7){_0x298597=_0x43a3b7[_0xb35a('0x6b')];if(!_0x562d75[_0xb35a('0x3f')]['hasOwnProperty'](_0xb35a('0x6c'))){_0x213d7c[_0xb35a('0x30')]=qs['limit'](_0x562d75[_0xb35a('0x3f')][_0xb35a('0x30')]);_0x213d7c[_0xb35a('0x2f')]=qs[_0xb35a('0x2f')](_0x562d75['query'][_0xb35a('0x2f')]);}return _0xaf66d5['getApplications'](_0x213d7c);}})[_0xb35a('0x20')](function(_0x306a01){if(_0x306a01){return _0x306a01?{'count':_0x298597,'rows':_0x306a01}:null;}})[_0xb35a('0x20')](respondWithResult(_0x157e3d,null))[_0xb35a('0x55')](handleError(_0x157e3d,null));};function Extension(_0xcdf464,_0x2e9384,_0x181f55,_0x21854f){this[_0xb35a('0x86')]=_0xb35a('0x87');this[_0xb35a('0x88')]=_0xcdf464[_0xb35a('0x89')];this[_0xb35a('0x8a')]=_0x21854f;this[_0xb35a('0x8b')]=_0xb35a('0x8c');this[_0xb35a('0x8d')]=_0xb35a('0x8e');this[_0xb35a('0x68')]=_0xcdf464['id'];this['priority']=_0x2e9384;this['appdata']=_0x181f55;}function createExtensionsReciveFax(_0x1be91f){var _0x10e7ed=0x1;var _0x6252ab=[];_0x6252ab[_0xb35a('0x8f')](new Extension(_0x1be91f,_0x10e7ed,'',_0xb35a('0x90')));_0x10e7ed+=0x1;_0x6252ab[_0xb35a('0x8f')](new Extension(_0x1be91f,_0x10e7ed,'CDR(type)=inbound-fax',_0xb35a('0x91')));_0x10e7ed+=0x1;for(var _0x270739 in _0x1be91f){if(_0x1be91f['hasOwnProperty'](_0x270739)&&(_0x270739===_0xb35a('0x92')||_0x270739===_0xb35a('0x89')||_0x270739===_0xb35a('0x93')||_0x270739===_0xb35a('0x94')||_0x270739==='headerinfo'||_0x270739===_0xb35a('0x95')||_0x270739==='minrate'||_0x270739===_0xb35a('0x96')||_0x270739===_0xb35a('0x97'))){_0x6252ab[_0xb35a('0x8f')](new Extension(_0x1be91f,_0x10e7ed,_0xb35a('0x98')+_0x270739+')='+_0x1be91f[_0x270739],'Set'));_0x10e7ed+=0x1;}}_0x6252ab[_0xb35a('0x8f')](new Extension(_0x1be91f,_0x10e7ed,'6','Wait'));_0x10e7ed+=0x1;_0x6252ab['push'](new Extension(_0x1be91f,_0x10e7ed,'/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',_0xb35a('0x99')));_0x10e7ed=0x0;return _0x6252ab;}exports[_0xb35a('0x9a')]=function(_0x24da14,_0x2f5718,_0x23bc1c){var _0x3387ff;return db[_0xb35a('0x80')][_0xb35a('0x81')](function(_0x485491){return db[_0xb35a('0x51')][_0xb35a('0x59')](_0x24da14['body'],{'transaction':_0x485491})[_0xb35a('0x20')](function(_0x3f861c){_0x3387ff=_0x3f861c[_0xb35a('0x5c')]({'plain':!![]});return db['VoiceExtension'][_0xb35a('0x9b')](createExtensionsReciveFax(_0x3387ff),{'transaction':_0x485491});});})[_0xb35a('0x20')](function(){return _0x3387ff;})[_0xb35a('0x20')](respondWithResult(_0x2f5718,null))[_0xb35a('0x55')](handleError(_0x2f5718,null));};exports[_0xb35a('0x9c')]=function(_0x15212d,_0x4b2c60,_0x1d308a){var _0x2e96c4;return db[_0xb35a('0x80')][_0xb35a('0x81')](function(_0x3792be){return db[_0xb35a('0x51')][_0xb35a('0x35')](_0x15212d[_0xb35a('0x5a')],{'where':{'id':_0x15212d[_0xb35a('0x5a')]['id']},'transaction':_0x3792be})[_0xb35a('0x20')](function(_0x4207af){return db['VoiceExtension'][_0xb35a('0x36')]({'where':{'FaxAccountId':_0x15212d[_0xb35a('0x5a')]['id']},'transaction':_0x3792be})[_0xb35a('0x20')](function(_0x3cc197){return db['VoiceExtension'][_0xb35a('0x9b')](createExtensionsReciveFax(_[_0xb35a('0x9d')](_0x15212d['body'],[_0xb35a('0x9e'),_0xb35a('0x4d'),_0xb35a('0x9f'),_0xb35a('0xa0'),_0xb35a('0xa1'),_0xb35a('0xa2')])),{'transaction':_0x3792be});});});})['then'](function(){return db[_0xb35a('0x51')][_0xb35a('0xa3')](_0x15212d[_0xb35a('0x5a')]['id']);})[_0xb35a('0x20')](respondWithResult(_0x4b2c60,null))['catch'](handleError(_0x4b2c60,null));};exports[_0xb35a('0xa4')]=function(_0x24a092,_0x46cdb3,_0x140c52){var _0xaf6eb3={'raw':!![],'where':{}};var _0x3455f5={};var _0xc5857e={'count':0x0,'rows':[]};return db[_0xb35a('0x51')]['findOne']({'where':{'id':_0x24a092['params']['id']}})['then'](handleEntityNotFound(_0x46cdb3,null))[_0xb35a('0x20')](function(_0x42f32e){if(_0x42f32e){_0x3455f5[_0xb35a('0x3e')]=_[_0xb35a('0x40')](db['FaxMessage'][_0xb35a('0x58')]);_0x3455f5[_0xb35a('0x3f')]=_[_0xb35a('0x40')](_0x24a092[_0xb35a('0x3f')]);_0x3455f5[_0xb35a('0x41')]=_[_0xb35a('0x42')](_0x3455f5[_0xb35a('0x3e')],_0x3455f5['query']);_0xaf6eb3[_0xb35a('0x43')]=_['intersection'](_0x3455f5['model'],qs[_0xb35a('0x44')](_0x24a092[_0xb35a('0x3f')]['fields']));_0xaf6eb3['attributes']=_0xaf6eb3[_0xb35a('0x43')][_0xb35a('0x6b')]?_0xaf6eb3[_0xb35a('0x43')]:_0x3455f5['model'];if(!_0x24a092[_0xb35a('0x3f')][_0xb35a('0x45')](_0xb35a('0x6c'))){_0xaf6eb3[_0xb35a('0x30')]=qs[_0xb35a('0x30')](_0x24a092[_0xb35a('0x3f')][_0xb35a('0x30')]);_0xaf6eb3[_0xb35a('0x2f')]=qs[_0xb35a('0x2f')](_0x24a092[_0xb35a('0x3f')][_0xb35a('0x2f')]);}_0xaf6eb3[_0xb35a('0x46')]=qs[_0xb35a('0x47')](_0x24a092[_0xb35a('0x3f')][_0xb35a('0x47')]);_0xaf6eb3[_0xb35a('0x48')]=qs[_0xb35a('0x41')](_['pick'](_0x24a092[_0xb35a('0x3f')],_0x3455f5[_0xb35a('0x41')]));_0xaf6eb3[_0xb35a('0x48')]['FaxAccountId']=_0x42f32e['id'];if(_0x24a092[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0xaf6eb3[_0xb35a('0x48')]=_[_0xb35a('0x4b')](_0xaf6eb3['where'],{'$or':_[_0xb35a('0x4c')](_0xaf6eb3[_0xb35a('0x43')],function(_0x39c7cc){var _0x44889a={};_0x44889a[_0x39c7cc]={'$like':'%'+_0x24a092['query']['filter']+'%'};return _0x44889a;})});}if(_0x24a092['query'][_0xb35a('0xa5')]){var _0x539d74=_0x24a092[_0xb35a('0x3f')][_0xb35a('0xa5')][_0xb35a('0xa6')](',');var _0x2bc9d2={};_0x2bc9d2[_0x539d74[0x0]]={'$gte':moment(_0x539d74[0x1])[_0xb35a('0xa7')](_0xb35a('0xa8'))};_0xaf6eb3[_0xb35a('0x48')]=_[_0xb35a('0x4b')](_0xaf6eb3[_0xb35a('0x48')],_0x2bc9d2);}_0xaf6eb3=_[_0xb35a('0x4b')]({},_0xaf6eb3,_0x24a092[_0xb35a('0x50')]);return db[_0xb35a('0xa9')][_0xb35a('0x2e')]({'where':_0xaf6eb3[_0xb35a('0x48')]})[_0xb35a('0x20')](function(_0x5352c8){_0xc5857e[_0xb35a('0x2e')]=_0x5352c8;if(_0x24a092['query']['includeAll']){_0xaf6eb3[_0xb35a('0x53')]=[{'all':!![]}];}return db[_0xb35a('0xa9')][_0xb35a('0x6e')](_0xaf6eb3);})[_0xb35a('0x20')](function(_0x32a0b7){_0xc5857e['rows']=_0x32a0b7;return _0xc5857e;});}})[_0xb35a('0x20')](respondWithFilteredResult(_0x46cdb3,_0xaf6eb3))[_0xb35a('0x55')](handleError(_0x46cdb3,null));};exports['send']=function(_0x2c77ad,_0xb4d2ab,_0x98406f){var _0x1081cf,_0x597156={},_0x5f23b8;if(_0x2c77ad[_0xb35a('0x5a')]['to']){_0x5f23b8=_0x2c77ad[_0xb35a('0x5a')]['to'][0x0];}return db[_0xb35a('0x51')][_0xb35a('0x61')]({'where':{'id':_0x2c77ad[_0xb35a('0x57')]['id']},'include':[{'model':db[_0xb35a('0xaa')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb35a('0xab'),'where':{'fax':_0x5f23b8},'limit':0x1,'order':[[_0xb35a('0xa0'),_0xb35a('0xac')]]}]}]})['then'](handleEntityNotFound(_0xb4d2ab,null))['then'](function(_0xaf6b62){_0x1081cf=_0xaf6b62;if(_0x2c77ad[_0xb35a('0x5a')]['attachments']&&_0x2c77ad[_0xb35a('0x5a')]['attachments'][_0xb35a('0x6b')]){for(var _0x1901d0=0x0;_0x1901d0<_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')]['length'];_0x1901d0+=0x1){_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][_0x1901d0]={'filename':_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][_0x1901d0][_0xb35a('0x64')],'id':_0x2c77ad['body'][_0xb35a('0xad')][_0x1901d0]['id'],'path':path[_0xb35a('0xae')](config['root'],_0xb35a('0xaf'),_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][_0x1901d0]['basename'])};}}return respondWithRpcPromise(_0xb35a('0xb0'),_0xb35a('0xb0'),{'FaxAccountId':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x57')]['id'])?undefined:_0x2c77ad[_0xb35a('0x57')]['id'],'path':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][0x0][_0xb35a('0x9')])?undefined:_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][0x0][_0xb35a('0x9')],'fax':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x5a')]['to'][0x0])?undefined:_0x2c77ad[_0xb35a('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x1081cf){if(_[_0xb35a('0xb1')](_0x2c77ad['body'][_0xb35a('0xb2')])){_0x2c77ad['body'][_0xb35a('0xb2')]=util['format'](_0xb35a('0xb3'),_0x1081cf[_0xb35a('0x64')],_0x1081cf[_0xb35a('0xb4')]);}if(_0x1081cf[_0xb35a('0xb5')]){if(_0x1081cf[_0xb35a('0xb5')][_0xb35a('0xab')][_0xb35a('0x6b')]){return _0x1081cf['List'][_0xb35a('0xab')][0x0];}else{return db[_0xb35a('0x77')][_0xb35a('0x59')](_[_0xb35a('0x15')](_0x2c77ad[_0xb35a('0x5a')],{'firstName':_0x2c77ad[_0xb35a('0x5a')]['to'][0x0],'phone':_0x2c77ad[_0xb35a('0x5a')]['to'][0x0],'fax':_0x2c77ad[_0xb35a('0x5a')]['to'][0x0],'ListId':_0x1081cf[_0xb35a('0xa2')]}));}}else{throw new Error(_0xb35a('0xb6'));}}else{throw new Error(_0xb35a('0xb7'));}})['then'](function(_0x891b47){if(_0x891b47){return db[_0xb35a('0x75')]['find']({'where':{'ContactId':_0x891b47['id'],'closed':![],'FaxAccountId':_0x1081cf['id']}})[_0xb35a('0x20')](function(_0x2bf7dd){if(_0x2bf7dd){return[_0x2bf7dd,![]];}return db[_0xb35a('0x75')]['create']({'UserId':_0x2c77ad[_0xb35a('0x5b')]['id'],'ContactId':_0x891b47['id'],'FaxAccountId':_0x1081cf['id'],'fax':_0x2c77ad[_0xb35a('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xb35a('0x4b')](_0x2c77ad[_0xb35a('0x5a')],{'read':![],'body':_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][0x0][_0xb35a('0xb8')],'FaxAccountId':_0x1081cf['id'],'UserId':_0x2c77ad[_0xb35a('0x5b')]['id'],'ContactId':_0x891b47['id'],'AttachmentId':_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][0x0]['id']})]},{'include':[{'model':db[_0xb35a('0xa9')],'as':_0xb35a('0xb9')}]})[_0xb35a('0x20')](function(_0x56b6b4){return[_0x56b6b4,!![]];});});}else{throw new Error(_0xb35a('0xba'));}})[_0xb35a('0xbb')](function(_0x46a808,_0x535bc5){if(_0x535bc5){return _0x46a808;}return db[_0xb35a('0xa9')][_0xb35a('0x59')]({'direction':'out','read':![],'body':_0x2c77ad[_0xb35a('0x5a')]['attachments'][0x0][_0xb35a('0xb8')],'FaxAccountId':_0x1081cf['id'],'FaxInteractionId':_0x46a808['id'],'UserId':_0x2c77ad['user']['id'],'ContactId':_0x46a808[_0xb35a('0xbc')],'AttachmentId':_0x2c77ad[_0xb35a('0x5a')][_0xb35a('0xad')][0x0]['id']})[_0xb35a('0x20')](function(_0x762dbd){_0x46a808[_0xb35a('0xbd')][_0xb35a('0xb9')]=[];_0x46a808['dataValues'][_0xb35a('0xb9')][_0xb35a('0x8f')](_0x762dbd[_0xb35a('0xbd')]);return _0x46a808;});})[_0xb35a('0x20')](function(_0x175900){respondWithRpcPromise(_0xb35a('0xbe'),_0xb35a('0xbe'),{'FaxAccountId':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x57')]['id'])?undefined:_0x2c77ad['params']['id'],'path':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x5a')]['attachments'][0x0][_0xb35a('0x9')])?undefined:_0x2c77ad['body'][_0xb35a('0xad')][0x0]['path'],'fax':_[_0xb35a('0xb1')](_0x2c77ad[_0xb35a('0x5a')]['to'][0x0])?undefined:_0x2c77ad[_0xb35a('0x5a')]['to'][0x0],'AttachmentId':_0x2c77ad['body'][_0xb35a('0xad')][0x0]['id']},client9002)[_0xb35a('0x20')](function(_0x46ace5){logger['info'](_0xb35a('0xbf'),_0x46ace5);})[_0xb35a('0x55')](function(_0x5d3b0a){logger['info'](_0xb35a('0xbf'),_0x5d3b0a);});return _0x175900;})[_0xb35a('0x20')](respondWithResult(_0xb4d2ab,null))[_0xb35a('0x55')](handleError(_0xb4d2ab,null));};exports[_0xb35a('0xc0')]=function(_0x2b6b4f,_0x5db1b8,_0x205a86){return db['FaxAccount'][_0xb35a('0x61')]({'where':{'id':_0x2b6b4f[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x5db1b8,null))[_0xb35a('0x20')](function(_0x38431a){if(_0x38431a){return _0x38431a[_0xb35a('0xc0')](_0x2b6b4f[_0xb35a('0x5a')]['ids'],_[_0xb35a('0x9d')](_0x2b6b4f[_0xb35a('0x5a')],[_0xb35a('0x6f'),'id'])||{})[_0xb35a('0xbb')](function(_0x310615){for(var _0x2c4801=0x0;_0x2c4801<_0x2b6b4f['body'][_0xb35a('0x6f')]['length'];_0x2c4801+=0x1){socket[_0xb35a('0xc1')](_0xb35a('0xc2'),{'UserId':_0x2b6b4f[_0xb35a('0x5a')][_0xb35a('0x6f')][_0x2c4801],'FaxAccountId':_0x2b6b4f[_0xb35a('0x57')]['id']});}return _0x310615;});}})[_0xb35a('0x20')](respondWithResult(_0x5db1b8,null))[_0xb35a('0x55')](handleError(_0x5db1b8,null));};exports[_0xb35a('0xc3')]=function(_0x4afbd7,_0x4f1ebd,_0x534db8){return db[_0xb35a('0x51')][_0xb35a('0x61')]({'where':{'id':_0x4afbd7[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x4f1ebd,null))['then'](function(_0x6dbd8b){if(_0x6dbd8b){return _0x6dbd8b[_0xb35a('0xc3')](_0x4afbd7[_0xb35a('0x3f')]['ids'])['then'](function(){if(_[_0xb35a('0xc4')](_0x4afbd7[_0xb35a('0x3f')]['ids'])){for(var _0x262337=0x0;_0x262337<_0x4afbd7[_0xb35a('0x3f')][_0xb35a('0x6f')][_0xb35a('0x6b')];_0x262337+=0x1){socket[_0xb35a('0xc1')](_0xb35a('0xc5'),{'UserId':Number(_0x4afbd7[_0xb35a('0x3f')][_0xb35a('0x6f')][_0x262337]),'FaxAccountId':Number(_0x4afbd7[_0xb35a('0x57')]['id'])});}}else{socket[_0xb35a('0xc1')](_0xb35a('0xc5'),{'UserId':Number(_0x4afbd7[_0xb35a('0x3f')][_0xb35a('0x6f')]),'FaxAccountId':Number(_0x4afbd7[_0xb35a('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f1ebd,null))['catch'](handleError(_0x4f1ebd,null));};exports[_0xb35a('0xc6')]=function(_0x12effb,_0x8f67b2,_0x3573fe){var _0x2c64f5={};var _0x2b7b1b={};var _0x483233;var _0x2106c7;return db['FaxAccount'][_0xb35a('0x6a')]({'where':{'id':_0x12effb[_0xb35a('0x57')]['id']}})[_0xb35a('0x20')](handleEntityNotFound(_0x8f67b2,null))[_0xb35a('0x20')](function(_0x49f1a9){if(_0x49f1a9){_0x483233=_0x49f1a9;_0x2b7b1b['model']=_[_0xb35a('0x40')](db[_0xb35a('0x79')]['rawAttributes']);_0x2b7b1b['query']=_[_0xb35a('0x40')](_0x12effb[_0xb35a('0x3f')]);_0x2b7b1b['filters']=_[_0xb35a('0x42')](_0x2b7b1b['model'],_0x2b7b1b[_0xb35a('0x3f')]);_0x2c64f5['attributes']=_['intersection'](_0x2b7b1b[_0xb35a('0x3e')],qs[_0xb35a('0x44')](_0x12effb[_0xb35a('0x3f')]['fields']));_0x2c64f5[_0xb35a('0x43')]=_0x2c64f5['attributes'][_0xb35a('0x6b')]?_0x2c64f5['attributes']:_0x2b7b1b[_0xb35a('0x3e')];_0x2c64f5[_0xb35a('0x46')]=qs[_0xb35a('0x47')](_0x12effb['query']['sort']);_0x2c64f5[_0xb35a('0x48')]=qs['filters'](_[_0xb35a('0x49')](_0x12effb[_0xb35a('0x3f')],_0x2b7b1b[_0xb35a('0x41')]));if(_0x12effb[_0xb35a('0x3f')][_0xb35a('0x4a')]){_0x2c64f5['where']=_['merge'](_0x2c64f5['where'],{'$or':_[_0xb35a('0x4c')](_0x2c64f5[_0xb35a('0x43')],function(_0x2503ac){var _0xefc655={};_0xefc655[_0x2503ac]={'$like':'%'+_0x12effb[_0xb35a('0x3f')][_0xb35a('0x4a')]+'%'};return _0xefc655;})});}_0x2c64f5=_[_0xb35a('0x4b')]({},_0x2c64f5,_0x12effb[_0xb35a('0x50')]);return _0x483233[_0xb35a('0xc6')](_0x2c64f5);}})[_0xb35a('0x20')](function(_0x237a00){if(_0x237a00){_0x2106c7=_0x237a00[_0xb35a('0x6b')];if(!_0x12effb['query'][_0xb35a('0x45')](_0xb35a('0x6c'))){_0x2c64f5['limit']=qs['limit'](_0x12effb[_0xb35a('0x3f')][_0xb35a('0x30')]);_0x2c64f5['offset']=qs[_0xb35a('0x2f')](_0x12effb[_0xb35a('0x3f')][_0xb35a('0x2f')]);}return _0x483233[_0xb35a('0xc6')](_0x2c64f5);}})[_0xb35a('0x20')](function(_0x1f0dc7){if(_0x1f0dc7){return _0x1f0dc7?{'count':_0x2106c7,'rows':_0x1f0dc7}:null;}})[_0xb35a('0x20')](respondWithResult(_0x8f67b2,null))['catch'](handleError(_0x8f67b2,null));}; \ No newline at end of file +var _0x688d=['path','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','spread','ContactId','dataValues','Messages','SendFax','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','test','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','reject','update','destroy','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','key','VIRTUAL','field','merge','options','FaxAccount','count','includeAll','include','findAll','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','Disposition','order','FaxAccountId','map','removeDispositions','ids','CannedAnswer','getAnswers','findOne','rows','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','description','push','Answer','Set','gateway','faxdetect','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','TrunkId','ListId','findById','getMessages','$gte','split','format','FaxMessage','CmList','CmContact','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil'];(function(_0x268e17,_0x3a9da9){var _0xf852a4=function(_0x4ed38c){while(--_0x4ed38c){_0x268e17['push'](_0x268e17['shift']());}};_0xf852a4(++_0x3a9da9);}(_0x688d,0xcf));var _0xd688=function(_0x20e3f7,_0x3d94f6){_0x20e3f7=_0x20e3f7-0x0;var _0x116736=_0x688d[_0x20e3f7];return _0x116736;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd688('0x0'));var rimraf=require(_0xd688('0x1'));var zipdir=require(_0xd688('0x2'));var jsonpatch=require(_0xd688('0x3'));var rp=require(_0xd688('0x4'));var moment=require(_0xd688('0x5'));var BPromise=require(_0xd688('0x6'));var Mustache=require(_0xd688('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd688('0x8'));var csv=require(_0xd688('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd688('0xa'));var jsforce=require(_0xd688('0xb'));var deskjs=require(_0xd688('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd688('0xd'));var Redis=require(_0xd688('0xe'));var authService=require(_0xd688('0xf'));var qs=require(_0xd688('0x10'));var hardwareService=require(_0xd688('0x11'));var logger=require(_0xd688('0x12'))(_0xd688('0x13'));var utils=require(_0xd688('0x14'));var config=require(_0xd688('0x15'));var db=require(_0xd688('0x16'))['db'];config[_0xd688('0x17')]=_[_0xd688('0x18')](config[_0xd688('0x17')],{'host':_0xd688('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd688('0x17')]));require(_0xd688('0x1a'))[_0xd688('0x1b')](socket);var jayson=require(_0xd688('0x1c'));var client=jayson[_0xd688('0x1d')][_0xd688('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xd688('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x491f53,_0x114a5d,_0x4c40c7){if(_0x4c40c7){var _0x1370dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1370dc[_0xd688('0x1f')](_0x114a5d)){return _0x491f53;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x491f53;}}function respondWithRpcPromise(_0x4bc0e7,_0x3c2bd8,_0x7287fd,_0x13eaf6){return new BPromise(function(_0x5221f0,_0x5f246a){var _0x2c2473=_0x13eaf6||client;return _0x2c2473[_0xd688('0x20')](_0x4bc0e7,_0x7287fd)[_0xd688('0x21')](function(_0x37f9c2){logger[_0xd688('0x22')](_0xd688('0x23'),_0x3c2bd8,_0xd688('0x24'));logger[_0xd688('0x25')](_0xd688('0x26'),_0x3c2bd8,_0xd688('0x24'),JSON[_0xd688('0x27')](_0x37f9c2));if(_0x37f9c2[_0xd688('0x28')]){if(_0x37f9c2['error'][_0xd688('0x29')]===0x1f4){logger['error'](_0xd688('0x23'),_0x3c2bd8,_0x37f9c2['error'][_0xd688('0x2a')]);return _0x5f246a(_0x37f9c2['error'][_0xd688('0x2a')]);}logger[_0xd688('0x28')]('FaxAccount,\x20%s,\x20%s',_0x3c2bd8,_0x37f9c2[_0xd688('0x28')][_0xd688('0x2a')]);return _0x5221f0(_0x37f9c2['error']['message']);}else{logger[_0xd688('0x22')]('FaxAccount,\x20%s,\x20%s',_0x3c2bd8,_0xd688('0x24'));_0x5221f0(_0x37f9c2[_0xd688('0x2b')][_0xd688('0x2a')]);}})[_0xd688('0x2c')](function(_0x294acf){logger[_0xd688('0x28')](_0xd688('0x23'),_0x3c2bd8,_0x294acf);_0x5f246a(_0x294acf);});});}function respondWithStatusCode(_0x1d962a,_0x5452f8){_0x5452f8=_0x5452f8||0xcc;return function(_0x2db961){if(_0x2db961){return _0x1d962a['sendStatus'](_0x5452f8);}return _0x1d962a[_0xd688('0x2d')](_0x5452f8)[_0xd688('0x2e')]();};}function respondWithResult(_0x4f19bb,_0x4041ac){_0x4041ac=_0x4041ac||0xc8;return function(_0x4c5779){if(_0x4c5779){return _0x4f19bb[_0xd688('0x2d')](_0x4041ac)[_0xd688('0x2f')](_0x4c5779);}};}function respondWithFilteredResult(_0x3b7d1e,_0x44e1e4){return function(_0x5413a4){if(_0x5413a4){var _0x204370=_0x5413a4['count'],_0x2af387=_0x44e1e4['offset'],_0x5d9471=_0x44e1e4[_0xd688('0x30')]+_0x44e1e4[_0xd688('0x31')],_0x41edd0;if(_0x5d9471>=_0x204370){_0x5d9471=_0x204370;_0x41edd0=0xc8;}else{_0x41edd0=0xce;}_0x3b7d1e[_0xd688('0x2d')](_0x41edd0);return _0x3b7d1e[_0xd688('0x32')]('Content-Range',_0x2af387+'-'+_0x5d9471+'/'+_0x204370)[_0xd688('0x2f')](_0x5413a4);}return null;};}function patchUpdates(_0x287b68){return function(_0x159ea2){try{jsonpatch['apply'](_0x159ea2,_0x287b68,!![]);}catch(_0x2b5b38){return BPromise[_0xd688('0x33')](_0x2b5b38);}return _0x159ea2['save']();};}function saveUpdates(_0x8f85a1,_0x16f730){return function(_0xd9bdc7){if(_0xd9bdc7){return _0xd9bdc7[_0xd688('0x34')](_0x8f85a1)['then'](function(_0x4b9a2e){return _0x4b9a2e;});}return null;};}function removeEntity(_0xf3bd88,_0x3a8a24){return function(_0x552a33){if(_0x552a33){return _0x552a33[_0xd688('0x35')]()['then'](function(){var _0x3b7221=_0x552a33['get']({'plain':!![]});var _0x265b09=_0xd688('0x36');return db[_0xd688('0x37')][_0xd688('0x35')]({'where':{'type':_0x265b09,'resourceId':_0x3b7221['id']}})[_0xd688('0x21')](function(){return _0x552a33;});})['then'](function(){_0xf3bd88[_0xd688('0x2d')](0xcc)[_0xd688('0x2e')]();});}};}function handleEntityNotFound(_0x5d11cd,_0x400e2e){return function(_0x4f5321){if(!_0x4f5321){_0x5d11cd['sendStatus'](0x194);}return _0x4f5321;};}function handleError(_0x3d75ff,_0x2fa8be){_0x2fa8be=_0x2fa8be||0x1f4;return function(_0x1ba44b){logger[_0xd688('0x28')](_0x1ba44b['stack']);if(_0x1ba44b[_0xd688('0x38')]){delete _0x1ba44b['name'];}_0x3d75ff['status'](_0x2fa8be)[_0xd688('0x39')](_0x1ba44b);};}exports[_0xd688('0x3a')]=function(_0x26eba3,_0x54cf8c){var _0x4802f2={'include':[{'model':db[_0xd688('0x3b')],'as':_0xd688('0x3c')}]},_0x4dc8e6={},_0x3eaad0={'count':0x0,'rows':[]};var _0x1fbdf4=db['FaxAccount'][_0xd688('0x3d')];_0x4dc8e6[_0xd688('0x3e')]=_['keys'](_0x1fbdf4);_0x4dc8e6[_0xd688('0x3f')]=_[_0xd688('0x40')](_0x26eba3[_0xd688('0x3f')]);_0x4dc8e6[_0xd688('0x41')]=_[_0xd688('0x42')](_0x4dc8e6[_0xd688('0x3e')],_0x4dc8e6[_0xd688('0x3f')]);_0x4802f2[_0xd688('0x43')]=_['intersection'](_0x4dc8e6['model'],qs['fields'](_0x26eba3[_0xd688('0x3f')]['fields']));_0x4802f2['attributes']=_0x4802f2['attributes'][_0xd688('0x44')]?_0x4802f2['attributes']:_0x4dc8e6[_0xd688('0x3e')];if(!_0x26eba3[_0xd688('0x3f')][_0xd688('0x45')](_0xd688('0x46'))){_0x4802f2[_0xd688('0x31')]=qs['limit'](_0x26eba3[_0xd688('0x3f')][_0xd688('0x31')]);_0x4802f2['offset']=qs['offset'](_0x26eba3[_0xd688('0x3f')][_0xd688('0x30')]);}_0x4802f2['order']=qs[_0xd688('0x47')](_0x26eba3[_0xd688('0x3f')]['sort']);_0x4802f2['where']=qs[_0xd688('0x41')](_[_0xd688('0x48')](_0x26eba3[_0xd688('0x3f')],_0x4dc8e6[_0xd688('0x41')]));if(_0x26eba3[_0xd688('0x3f')][_0xd688('0x49')]){_0x4802f2[_0xd688('0x4a')]=_['merge'](_0x4802f2[_0xd688('0x4a')],{'$or':_['map'](_0x1fbdf4,function(_0x2952e6){if(_0x2952e6[_0xd688('0x4b')][_0xd688('0x4c')]!==_0xd688('0x4d')){var _0x36febf={};_0x36febf[_0x2952e6[_0xd688('0x4e')]]={'$like':'%'+_0x26eba3[_0xd688('0x3f')][_0xd688('0x49')]+'%'};return _0x36febf;}})});}_0x4802f2=_[_0xd688('0x4f')]({},_0x4802f2,_0x26eba3[_0xd688('0x50')]);var _0x29749f={'where':_0x4802f2[_0xd688('0x4a')]};return db[_0xd688('0x51')][_0xd688('0x52')](_0x29749f)[_0xd688('0x21')](function(_0x441f6b){_0x3eaad0['count']=_0x441f6b;if(_0x26eba3[_0xd688('0x3f')][_0xd688('0x53')]){_0x4802f2[_0xd688('0x54')]=[{'all':!![]}];}return db[_0xd688('0x51')][_0xd688('0x55')](_0x4802f2);})[_0xd688('0x21')](function(_0x47ac98){_0x3eaad0['rows']=_0x47ac98;return _0x3eaad0;})[_0xd688('0x21')](respondWithFilteredResult(_0x54cf8c,_0x4802f2))[_0xd688('0x2c')](handleError(_0x54cf8c,null));};exports[_0xd688('0x56')]=function(_0x1046fa,_0x31c851){var _0x3ed6e3={'raw':![],'where':{'id':_0x1046fa[_0xd688('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd688('0x3c')}]},_0x5ab4e8={};_0x5ab4e8[_0xd688('0x3e')]=_['keys'](db[_0xd688('0x51')][_0xd688('0x3d')]);_0x5ab4e8[_0xd688('0x3f')]=_[_0xd688('0x40')](_0x1046fa[_0xd688('0x3f')]);_0x5ab4e8[_0xd688('0x41')]=_[_0xd688('0x42')](_0x5ab4e8[_0xd688('0x3e')],_0x5ab4e8[_0xd688('0x3f')]);_0x3ed6e3[_0xd688('0x43')]=_[_0xd688('0x42')](_0x5ab4e8[_0xd688('0x3e')],qs['fields'](_0x1046fa['query'][_0xd688('0x58')]));_0x3ed6e3['attributes']=_0x3ed6e3[_0xd688('0x43')][_0xd688('0x44')]?_0x3ed6e3[_0xd688('0x43')]:_0x5ab4e8[_0xd688('0x3e')];if(_0x1046fa[_0xd688('0x3f')]['includeAll']){_0x3ed6e3['include']=[{'all':!![]}];}_0x3ed6e3=_[_0xd688('0x4f')]({},_0x3ed6e3,_0x1046fa['options']);return db[_0xd688('0x51')][_0xd688('0x59')](_0x3ed6e3)[_0xd688('0x21')](handleEntityNotFound(_0x31c851,null))[_0xd688('0x21')](respondWithResult(_0x31c851,null))[_0xd688('0x2c')](handleError(_0x31c851,null));};exports[_0xd688('0x5a')]=function(_0x1f329a,_0x220b26){return db[_0xd688('0x51')]['create'](_0x1f329a['body'],{})[_0xd688('0x21')](function(_0x1d879f){var _0x1647ee=_0x1f329a['user']['get']({'plain':!![]});if(!_0x1647ee)throw new Error(_0xd688('0x5b'));if(_0x1647ee['role']==='user'){var _0x8367e9=_0x1d879f['get']({'plain':!![]});var _0x4a978d=_0xd688('0x36');return db['UserProfileSection'][_0xd688('0x59')]({'where':{'name':_0x4a978d,'userProfileId':_0x1647ee[_0xd688('0x5c')]},'raw':!![]})[_0xd688('0x21')](function(_0xf5a6c6){if(_0xf5a6c6&&_0xf5a6c6['autoAssociation']===0x0){return db[_0xd688('0x37')]['create']({'name':_0x8367e9[_0xd688('0x38')],'resourceId':_0x8367e9['id'],'type':_0xf5a6c6['name'],'sectionId':_0xf5a6c6['id']},{})[_0xd688('0x21')](function(){return _0x1d879f;});}else{return _0x1d879f;}})[_0xd688('0x2c')](function(_0x105c6f){logger['error'](_0xd688('0x5d'),_0x105c6f);throw _0x105c6f;});}return _0x1d879f;})[_0xd688('0x21')](respondWithResult(_0x220b26,0xc9))['catch'](handleError(_0x220b26,null));};exports[_0xd688('0x34')]=function(_0x458bb4,_0x184d9b){if(_0x458bb4['body']['id']){delete _0x458bb4[_0xd688('0x5e')]['id'];}return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x458bb4['params']['id']},'include':[{'model':db[_0xd688('0x3b')],'as':_0xd688('0x3c')}]})[_0xd688('0x21')](handleEntityNotFound(_0x184d9b,null))[_0xd688('0x21')](saveUpdates(_0x458bb4[_0xd688('0x5e')],null))[_0xd688('0x21')](respondWithResult(_0x184d9b,null))[_0xd688('0x2c')](handleError(_0x184d9b,null));};exports[_0xd688('0x35')]=function(_0x2e243c,_0x287bcf){return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x2e243c[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x287bcf,null))[_0xd688('0x21')](removeEntity(_0x287bcf,null))[_0xd688('0x2c')](handleError(_0x287bcf,null));};exports[_0xd688('0x5f')]=function(_0x37dab2,_0x2c128f){return db[_0xd688('0x51')][_0xd688('0x5f')]()[_0xd688('0x21')](respondWithResult(_0x2c128f,null))[_0xd688('0x2c')](handleError(_0x2c128f,null));};exports[_0xd688('0x60')]=function(_0x379836,_0x413ad1,_0x270d76){if(_0x379836[_0xd688('0x5e')]['id']){delete _0x379836[_0xd688('0x5e')]['id'];}return db[_0xd688('0x51')]['find']({'where':{'id':_0x379836[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x413ad1,null))[_0xd688('0x21')](function(_0x1e4dc5){if(_0x1e4dc5){_0x379836[_0xd688('0x5e')]['FaxAccountId']=_0x1e4dc5['id'];return db['Disposition'][_0xd688('0x5a')](_0x379836[_0xd688('0x5e')]);}})[_0xd688('0x21')](respondWithResult(_0x413ad1,null))['catch'](handleError(_0x413ad1,null));};exports[_0xd688('0x61')]=function(_0x55f4a6,_0x38a46d,_0x5c89db){var _0x41df61={'raw':![],'where':{}};var _0x4c043a={};var _0xf175d1={'count':0x0,'rows':[]};return db[_0xd688('0x51')]['findOne']({'where':{'id':_0x55f4a6[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x38a46d,null))[_0xd688('0x21')](function(_0x229e98){if(_0x229e98){_0x4c043a['model']=_[_0xd688('0x40')](db[_0xd688('0x62')][_0xd688('0x3d')]);_0x4c043a['query']=_[_0xd688('0x40')](_0x55f4a6[_0xd688('0x3f')]);_0x4c043a[_0xd688('0x41')]=_['intersection'](_0x4c043a['model'],_0x4c043a[_0xd688('0x3f')]);_0x41df61['attributes']=_[_0xd688('0x42')](_0x4c043a['model'],qs[_0xd688('0x58')](_0x55f4a6[_0xd688('0x3f')][_0xd688('0x58')]));_0x41df61[_0xd688('0x43')]=_0x41df61[_0xd688('0x43')][_0xd688('0x44')]?_0x41df61[_0xd688('0x43')]:_0x4c043a[_0xd688('0x3e')];if(!_0x55f4a6[_0xd688('0x3f')]['hasOwnProperty']('nolimit')){_0x41df61[_0xd688('0x31')]=qs[_0xd688('0x31')](_0x55f4a6[_0xd688('0x3f')][_0xd688('0x31')]);_0x41df61[_0xd688('0x30')]=qs['offset'](_0x55f4a6[_0xd688('0x3f')]['offset']);}_0x41df61[_0xd688('0x63')]=qs[_0xd688('0x47')](_0x55f4a6[_0xd688('0x3f')][_0xd688('0x47')]);_0x41df61[_0xd688('0x4a')]=qs[_0xd688('0x41')](_[_0xd688('0x48')](_0x55f4a6[_0xd688('0x3f')],_0x4c043a['filters']));_0x41df61[_0xd688('0x4a')][_0xd688('0x64')]=_0x229e98['id'];if(_0x55f4a6['query'][_0xd688('0x49')]){_0x41df61[_0xd688('0x4a')]=_[_0xd688('0x4f')](_0x41df61[_0xd688('0x4a')],{'$or':_[_0xd688('0x65')](_0x41df61[_0xd688('0x43')],function(_0x4fe646){var _0x135d93={};_0x135d93[_0x4fe646]={'$like':'%'+_0x55f4a6['query'][_0xd688('0x49')]+'%'};return _0x135d93;})});}_0x41df61=_[_0xd688('0x4f')]({},_0x41df61,_0x55f4a6[_0xd688('0x50')]);return db[_0xd688('0x62')][_0xd688('0x52')]({'where':_0x41df61['where']})['then'](function(_0x1e4eb){_0xf175d1[_0xd688('0x52')]=_0x1e4eb;if(_0x55f4a6[_0xd688('0x3f')][_0xd688('0x53')]){_0x41df61[_0xd688('0x54')]=[{'all':!![]}];}return db[_0xd688('0x62')][_0xd688('0x55')](_0x41df61);})[_0xd688('0x21')](function(_0x303de9){_0xf175d1['rows']=_0x303de9;return _0xf175d1;});}})[_0xd688('0x21')](respondWithFilteredResult(_0x38a46d,_0x41df61))[_0xd688('0x2c')](handleError(_0x38a46d,null));};exports[_0xd688('0x66')]=function(_0x2e0d26,_0xa9ccdb,_0x121f1c){return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x2e0d26['params']['id']}})[_0xd688('0x21')](handleEntityNotFound(_0xa9ccdb,null))[_0xd688('0x21')](function(_0x44b56f){if(_0x44b56f){return _0x44b56f['removeDispositions'](_0x2e0d26['query'][_0xd688('0x67')]);}})[_0xd688('0x21')](respondWithStatusCode(_0xa9ccdb,null))[_0xd688('0x2c')](handleError(_0xa9ccdb,null));};exports['addAnswer']=function(_0x4b0607,_0x2a151c,_0x16ea02){if(_0x4b0607['body']['id']){delete _0x4b0607[_0xd688('0x5e')]['id'];}return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x4b0607[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x2a151c,null))[_0xd688('0x21')](function(_0x14ec64){if(_0x14ec64){_0x4b0607[_0xd688('0x5e')][_0xd688('0x64')]=_0x14ec64['id'];return db[_0xd688('0x68')][_0xd688('0x5a')](_0x4b0607[_0xd688('0x5e')]);}})['then'](respondWithResult(_0x2a151c,null))['catch'](handleError(_0x2a151c,null));};exports[_0xd688('0x69')]=function(_0x337033,_0x5b7458,_0x29c1ba){var _0x411bc1={'raw':![],'where':{}};var _0x51b360={};var _0x28c9b8={'count':0x0,'rows':[]};return db[_0xd688('0x51')][_0xd688('0x6a')]({'where':{'id':_0x337033[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x5b7458,null))[_0xd688('0x21')](function(_0x4acfb7){if(_0x4acfb7){_0x51b360['model']=_[_0xd688('0x40')](db[_0xd688('0x68')]['rawAttributes']);_0x51b360[_0xd688('0x3f')]=_[_0xd688('0x40')](_0x337033[_0xd688('0x3f')]);_0x51b360['filters']=_[_0xd688('0x42')](_0x51b360[_0xd688('0x3e')],_0x51b360[_0xd688('0x3f')]);_0x411bc1['attributes']=_[_0xd688('0x42')](_0x51b360['model'],qs[_0xd688('0x58')](_0x337033[_0xd688('0x3f')][_0xd688('0x58')]));_0x411bc1[_0xd688('0x43')]=_0x411bc1[_0xd688('0x43')][_0xd688('0x44')]?_0x411bc1[_0xd688('0x43')]:_0x51b360[_0xd688('0x3e')];if(!_0x337033[_0xd688('0x3f')]['hasOwnProperty'](_0xd688('0x46'))){_0x411bc1[_0xd688('0x31')]=qs['limit'](_0x337033[_0xd688('0x3f')][_0xd688('0x31')]);_0x411bc1[_0xd688('0x30')]=qs['offset'](_0x337033[_0xd688('0x3f')][_0xd688('0x30')]);}_0x411bc1[_0xd688('0x63')]=qs[_0xd688('0x47')](_0x337033[_0xd688('0x3f')][_0xd688('0x47')]);_0x411bc1[_0xd688('0x4a')]=qs[_0xd688('0x41')](_[_0xd688('0x48')](_0x337033['query'],_0x51b360[_0xd688('0x41')]));_0x411bc1['where'][_0xd688('0x64')]=_0x4acfb7['id'];if(_0x337033['query'][_0xd688('0x49')]){_0x411bc1[_0xd688('0x4a')]=_[_0xd688('0x4f')](_0x411bc1[_0xd688('0x4a')],{'$or':_[_0xd688('0x65')](_0x411bc1['attributes'],function(_0x442ef6){var _0x528c05={};_0x528c05[_0x442ef6]={'$like':'%'+_0x337033[_0xd688('0x3f')][_0xd688('0x49')]+'%'};return _0x528c05;})});}_0x411bc1=_[_0xd688('0x4f')]({},_0x411bc1,_0x337033[_0xd688('0x50')]);return db[_0xd688('0x68')][_0xd688('0x52')]({'where':_0x411bc1[_0xd688('0x4a')]})['then'](function(_0x105a94){_0x28c9b8[_0xd688('0x52')]=_0x105a94;if(_0x337033[_0xd688('0x3f')][_0xd688('0x53')]){_0x411bc1[_0xd688('0x54')]=[{'all':!![]}];}return db[_0xd688('0x68')]['findAll'](_0x411bc1);})[_0xd688('0x21')](function(_0x2d92fd){_0x28c9b8[_0xd688('0x6b')]=_0x2d92fd;return _0x28c9b8;});}})[_0xd688('0x21')](respondWithFilteredResult(_0x5b7458,_0x411bc1))[_0xd688('0x2c')](handleError(_0x5b7458,null));};exports[_0xd688('0x6c')]=function(_0x1eceaa,_0x39f7f7,_0x688a9e){return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x1eceaa[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x39f7f7,null))[_0xd688('0x21')](function(_0x64866d){if(_0x64866d){return _0x64866d[_0xd688('0x6c')](_0x1eceaa[_0xd688('0x3f')][_0xd688('0x67')]);}})[_0xd688('0x21')](respondWithStatusCode(_0x39f7f7,null))[_0xd688('0x2c')](handleError(_0x39f7f7,null));};exports[_0xd688('0x6d')]=function(_0x5badad,_0xfd0eba,_0x1dc69d){return db['FaxInteraction'][_0xd688('0x59')]({'where':{'id':_0x5badad[_0xd688('0x57')]['id']}})['then'](handleEntityNotFound(_0xfd0eba,null))[_0xd688('0x21')](function(_0x365b89){if(_0x365b89){return _0x365b89[_0xd688('0x6d')](_0x5badad[_0xd688('0x5e')][_0xd688('0x67')],_[_0xd688('0x6e')](_0x5badad['body'],[_0xd688('0x67'),'id'])||{});}})[_0xd688('0x21')](respondWithResult(_0xfd0eba,null))[_0xd688('0x2c')](handleError(_0xfd0eba,null));};exports[_0xd688('0x6f')]=function(_0x501f77,_0x37bee2,_0x5e1d15){var _0x25ab96={'raw':![],'where':{}};var _0x45b6fd={};var _0x499d87={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x501f77[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x37bee2,null))['then'](function(_0x45350d){if(_0x45350d){_0x45b6fd[_0xd688('0x3e')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x45b6fd[_0xd688('0x3f')]=_[_0xd688('0x40')](_0x501f77[_0xd688('0x3f')]);_0x45b6fd[_0xd688('0x41')]=_[_0xd688('0x42')](_0x45b6fd['model'],_0x45b6fd[_0xd688('0x3f')]);_0x25ab96[_0xd688('0x43')]=_[_0xd688('0x42')](_0x45b6fd[_0xd688('0x3e')],qs[_0xd688('0x58')](_0x501f77[_0xd688('0x3f')]['fields']));_0x25ab96[_0xd688('0x43')]=_0x25ab96[_0xd688('0x43')][_0xd688('0x44')]?_0x25ab96[_0xd688('0x43')]:_0x45b6fd[_0xd688('0x3e')];if(!_0x501f77['query'][_0xd688('0x45')](_0xd688('0x46'))){_0x25ab96[_0xd688('0x31')]=qs[_0xd688('0x31')](_0x501f77[_0xd688('0x3f')][_0xd688('0x31')]);_0x25ab96['offset']=qs[_0xd688('0x30')](_0x501f77[_0xd688('0x3f')][_0xd688('0x30')]);}_0x25ab96[_0xd688('0x63')]=qs['sort'](_0x501f77['query']['sort']);_0x25ab96['where']=qs['filters'](_[_0xd688('0x48')](_0x501f77[_0xd688('0x3f')],_0x45b6fd[_0xd688('0x41')]));_0x25ab96[_0xd688('0x4a')][_0xd688('0x64')]=_0x45350d['id'];if(_0x501f77[_0xd688('0x3f')][_0xd688('0x49')]){_0x25ab96[_0xd688('0x4a')]=_[_0xd688('0x4f')](_0x25ab96[_0xd688('0x4a')],{'$or':_['map'](_0x25ab96[_0xd688('0x43')],function(_0x2b73e1){var _0x6e4867={};_0x6e4867[_0x2b73e1]={'$like':'%'+_0x501f77[_0xd688('0x3f')]['filter']+'%'};return _0x6e4867;})});}_0x25ab96=_[_0xd688('0x4f')]({},_0x25ab96,_0x501f77[_0xd688('0x50')]);return db[_0xd688('0x70')]['count']({'where':_0x25ab96[_0xd688('0x4a')]})['then'](function(_0x362772){_0x499d87[_0xd688('0x52')]=_0x362772;if(_0x501f77[_0xd688('0x3f')][_0xd688('0x53')]){_0x25ab96[_0xd688('0x54')]=[{'model':db['CmContact'],'as':_0xd688('0x71'),'required':![]},{'model':db[_0xd688('0x72')],'as':_0xd688('0x73'),'attributes':['name',_0xd688('0x74'),_0xd688('0x75')],'required':![]},{'model':db[_0xd688('0x76')],'as':_0xd688('0x77'),'attributes':['id',_0xd688('0x38'),'color'],'where':_0x501f77[_0xd688('0x3f')][_0xd688('0x78')]?{'id':_0x501f77[_0xd688('0x3f')][_0xd688('0x78')]}:undefined,'required':_0x501f77['query']['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x25ab96);})[_0xd688('0x21')](function(_0x13608e){_0x499d87[_0xd688('0x6b')]=_0x13608e;return _0x499d87;});}})[_0xd688('0x21')](respondWithFilteredResult(_0x37bee2,_0x25ab96))['catch'](handleError(_0x37bee2,null));};exports[_0xd688('0x79')]=function(_0x3fd4dd,_0x177f50,_0x41a57e){return db['FaxAccount'][_0xd688('0x6a')]({'where':{'id':_0x3fd4dd[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x177f50,null))[_0xd688('0x21')](function(_0x3e026f){if(_0x3e026f){return db[_0xd688('0x7a')][_0xd688('0x7b')](function(_0x48481f){return db['FaxApplication'][_0xd688('0x35')]({'where':{'FaxAccountId':_0x3fd4dd[_0xd688('0x57')]['id']},'transaction':_0x48481f})[_0xd688('0x21')](function(_0x297e30){var _0x36733f=_['map'](_0x3fd4dd['body'],function(_0x31a48f){_0x31a48f[_0xd688('0x64')]=_0x3fd4dd[_0xd688('0x57')]['id'];return _0x31a48f;});return db['FaxApplication']['bulkCreate'](_0x36733f,{'transaction':_0x48481f});});})[_0xd688('0x21')](function(){return db[_0xd688('0x7c')][_0xd688('0x7d')]({'where':{'FaxAccountId':_0x3fd4dd['params']['id']},'order':_0xd688('0x7e')});});}})['then'](respondWithResult(_0x177f50,null))[_0xd688('0x2c')](handleError(_0x177f50,null));};exports['getApplications']=function(_0x3c84db,_0x1088bb,_0x2830e3){var _0xf158cb={};var _0x1a30dd={};var _0x5b6341;var _0x3688f3;return db[_0xd688('0x51')][_0xd688('0x6a')]({'where':{'id':_0x3c84db[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x1088bb,null))[_0xd688('0x21')](function(_0x35ec42){if(_0x35ec42){_0x5b6341=_0x35ec42;_0x1a30dd[_0xd688('0x3e')]=_[_0xd688('0x40')](db[_0xd688('0x7c')]['rawAttributes']);_0x1a30dd['query']=_[_0xd688('0x40')](_0x3c84db['query']);_0x1a30dd[_0xd688('0x41')]=_[_0xd688('0x42')](_0x1a30dd[_0xd688('0x3e')],_0x1a30dd[_0xd688('0x3f')]);_0xf158cb[_0xd688('0x43')]=_[_0xd688('0x42')](_0x1a30dd[_0xd688('0x3e')],qs[_0xd688('0x58')](_0x3c84db[_0xd688('0x3f')]['fields']));_0xf158cb[_0xd688('0x43')]=_0xf158cb[_0xd688('0x43')]['length']?_0xf158cb[_0xd688('0x43')]:_0x1a30dd['model'];_0xf158cb[_0xd688('0x63')]=qs[_0xd688('0x47')](_0x3c84db[_0xd688('0x3f')][_0xd688('0x47')]);_0xf158cb[_0xd688('0x4a')]=qs[_0xd688('0x41')](_[_0xd688('0x48')](_0x3c84db[_0xd688('0x3f')],_0x1a30dd[_0xd688('0x41')]));if(_0x3c84db[_0xd688('0x3f')]['filter']){_0xf158cb[_0xd688('0x4a')]=_[_0xd688('0x4f')](_0xf158cb[_0xd688('0x4a')],{'$or':_[_0xd688('0x65')](_0xf158cb['attributes'],function(_0x383daa){var _0x2d4649={};_0x2d4649[_0x383daa]={'$like':'%'+_0x3c84db[_0xd688('0x3f')][_0xd688('0x49')]+'%'};return _0x2d4649;})});}_0xf158cb=_[_0xd688('0x4f')]({},_0xf158cb,_0x3c84db[_0xd688('0x50')]);return _0x5b6341[_0xd688('0x7f')](_0xf158cb);}})[_0xd688('0x21')](function(_0x1c5cc0){if(_0x1c5cc0){_0x3688f3=_0x1c5cc0[_0xd688('0x44')];if(!_0x3c84db[_0xd688('0x3f')]['hasOwnProperty'](_0xd688('0x46'))){_0xf158cb['limit']=qs[_0xd688('0x31')](_0x3c84db[_0xd688('0x3f')][_0xd688('0x31')]);_0xf158cb[_0xd688('0x30')]=qs[_0xd688('0x30')](_0x3c84db[_0xd688('0x3f')][_0xd688('0x30')]);}return _0x5b6341[_0xd688('0x7f')](_0xf158cb);}})[_0xd688('0x21')](function(_0x5b9404){if(_0x5b9404){return _0x5b9404?{'count':_0x3688f3,'rows':_0x5b9404}:null;}})[_0xd688('0x21')](respondWithResult(_0x1088bb,null))[_0xd688('0x2c')](handleError(_0x1088bb,null));};function Extension(_0x199444,_0x25699d,_0x2fdd91,_0x28cf2d){this[_0xd688('0x80')]=_0xd688('0x81');this[_0xd688('0x82')]=_0x199444[_0xd688('0x83')];this['app']=_0x28cf2d;this['type']='system';this[_0xd688('0x84')]='Fax\x20Extension';this[_0xd688('0x64')]=_0x199444['id'];this[_0xd688('0x7e')]=_0x25699d;this['appdata']=_0x2fdd91;}function createExtensionsReciveFax(_0x3f3dbb){var _0x25eb07=0x1;var _0x4957da=[];_0x4957da[_0xd688('0x85')](new Extension(_0x3f3dbb,_0x25eb07,'',_0xd688('0x86')));_0x25eb07+=0x1;_0x4957da[_0xd688('0x85')](new Extension(_0x3f3dbb,_0x25eb07,'CDR(type)=inbound-fax',_0xd688('0x87')));_0x25eb07+=0x1;for(var _0x18322f in _0x3f3dbb){if(_0x3f3dbb['hasOwnProperty'](_0x18322f)&&(_0x18322f==='ecm'||_0x18322f===_0xd688('0x83')||_0x18322f===_0xd688('0x88')||_0x18322f===_0xd688('0x89')||_0x18322f==='headerinfo'||_0x18322f==='maxrate'||_0x18322f===_0xd688('0x8a')||_0x18322f==='modem'||_0x18322f===_0xd688('0x8b'))){_0x4957da[_0xd688('0x85')](new Extension(_0x3f3dbb,_0x25eb07,_0xd688('0x8c')+_0x18322f+')='+_0x3f3dbb[_0x18322f],_0xd688('0x87')));_0x25eb07+=0x1;}}_0x4957da['push'](new Extension(_0x3f3dbb,_0x25eb07,'6',_0xd688('0x8d')));_0x25eb07+=0x1;_0x4957da['push'](new Extension(_0x3f3dbb,_0x25eb07,_0xd688('0x8e'),'ReceiveFax'));_0x25eb07=0x0;return _0x4957da;}exports[_0xd688('0x8f')]=function(_0x3ba9e8,_0x3778f8,_0xb618e2){var _0x529339;return db[_0xd688('0x7a')]['transaction'](function(_0x58f90f){return db[_0xd688('0x51')][_0xd688('0x5a')](_0x3ba9e8[_0xd688('0x5e')],{'transaction':_0x58f90f})[_0xd688('0x21')](function(_0x5715cb){_0x529339=_0x5715cb['get']({'plain':!![]});return db[_0xd688('0x90')][_0xd688('0x91')](createExtensionsReciveFax(_0x529339),{'transaction':_0x58f90f});});})[_0xd688('0x21')](function(){return _0x529339;})[_0xd688('0x21')](respondWithResult(_0x3778f8,null))[_0xd688('0x2c')](handleError(_0x3778f8,null));};exports[_0xd688('0x92')]=function(_0x2a4f87,_0x27a90f,_0x101336){var _0x30a768;return db[_0xd688('0x7a')][_0xd688('0x7b')](function(_0x44423d){return db[_0xd688('0x51')][_0xd688('0x34')](_0x2a4f87[_0xd688('0x5e')],{'where':{'id':_0x2a4f87[_0xd688('0x5e')]['id']},'transaction':_0x44423d})['then'](function(_0x2c5254){return db[_0xd688('0x90')]['destroy']({'where':{'FaxAccountId':_0x2a4f87[_0xd688('0x5e')]['id']},'transaction':_0x44423d})['then'](function(_0x13b11d){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xd688('0x6e')](_0x2a4f87['body'],['tech','key',_0xd688('0x93'),'updatedAt',_0xd688('0x94'),_0xd688('0x95')])),{'transaction':_0x44423d});});});})[_0xd688('0x21')](function(){return db[_0xd688('0x51')][_0xd688('0x96')](_0x2a4f87['body']['id']);})[_0xd688('0x21')](respondWithResult(_0x27a90f,null))[_0xd688('0x2c')](handleError(_0x27a90f,null));};exports[_0xd688('0x97')]=function(_0x2040cb,_0x2f954d,_0x47b08f){var _0x50284={'raw':!![],'where':{}};var _0x128741={};var _0x2e8480={'count':0x0,'rows':[]};return db[_0xd688('0x51')][_0xd688('0x6a')]({'where':{'id':_0x2040cb['params']['id']}})['then'](handleEntityNotFound(_0x2f954d,null))[_0xd688('0x21')](function(_0x565798){if(_0x565798){_0x128741[_0xd688('0x3e')]=_[_0xd688('0x40')](db['FaxMessage'][_0xd688('0x3d')]);_0x128741[_0xd688('0x3f')]=_[_0xd688('0x40')](_0x2040cb[_0xd688('0x3f')]);_0x128741['filters']=_['intersection'](_0x128741[_0xd688('0x3e')],_0x128741[_0xd688('0x3f')]);_0x50284[_0xd688('0x43')]=_['intersection'](_0x128741[_0xd688('0x3e')],qs[_0xd688('0x58')](_0x2040cb['query']['fields']));_0x50284['attributes']=_0x50284['attributes'][_0xd688('0x44')]?_0x50284[_0xd688('0x43')]:_0x128741[_0xd688('0x3e')];if(!_0x2040cb['query'][_0xd688('0x45')](_0xd688('0x46'))){_0x50284[_0xd688('0x31')]=qs[_0xd688('0x31')](_0x2040cb[_0xd688('0x3f')][_0xd688('0x31')]);_0x50284[_0xd688('0x30')]=qs[_0xd688('0x30')](_0x2040cb[_0xd688('0x3f')][_0xd688('0x30')]);}_0x50284[_0xd688('0x63')]=qs[_0xd688('0x47')](_0x2040cb['query'][_0xd688('0x47')]);_0x50284[_0xd688('0x4a')]=qs[_0xd688('0x41')](_[_0xd688('0x48')](_0x2040cb[_0xd688('0x3f')],_0x128741[_0xd688('0x41')]));_0x50284[_0xd688('0x4a')]['FaxAccountId']=_0x565798['id'];if(_0x2040cb['query'][_0xd688('0x49')]){_0x50284[_0xd688('0x4a')]=_[_0xd688('0x4f')](_0x50284['where'],{'$or':_[_0xd688('0x65')](_0x50284[_0xd688('0x43')],function(_0x50b48b){var _0x1d9b74={};_0x1d9b74[_0x50b48b]={'$like':'%'+_0x2040cb[_0xd688('0x3f')][_0xd688('0x49')]+'%'};return _0x1d9b74;})});}if(_0x2040cb[_0xd688('0x3f')][_0xd688('0x98')]){var _0x21360f=_0x2040cb[_0xd688('0x3f')]['$gte'][_0xd688('0x99')](',');var _0x29d792={};_0x29d792[_0x21360f[0x0]]={'$gte':moment(_0x21360f[0x1])[_0xd688('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50284['where']=_[_0xd688('0x4f')](_0x50284[_0xd688('0x4a')],_0x29d792);}_0x50284=_['merge']({},_0x50284,_0x2040cb[_0xd688('0x50')]);return db[_0xd688('0x9b')][_0xd688('0x52')]({'where':_0x50284[_0xd688('0x4a')]})[_0xd688('0x21')](function(_0x398457){_0x2e8480[_0xd688('0x52')]=_0x398457;if(_0x2040cb[_0xd688('0x3f')][_0xd688('0x53')]){_0x50284[_0xd688('0x54')]=[{'all':!![]}];}return db[_0xd688('0x9b')][_0xd688('0x55')](_0x50284);})[_0xd688('0x21')](function(_0x10150b){_0x2e8480[_0xd688('0x6b')]=_0x10150b;return _0x2e8480;});}})[_0xd688('0x21')](respondWithFilteredResult(_0x2f954d,_0x50284))[_0xd688('0x2c')](handleError(_0x2f954d,null));};exports[_0xd688('0x39')]=function(_0x256448,_0x55f369,_0x140724){var _0x1c012e,_0x443f20={},_0x135450;if(_0x256448['body']['to']){_0x135450=_0x256448['body']['to'][0x0];}return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x256448['params']['id']},'include':[{'model':db[_0xd688('0x9c')],'as':'List','include':[{'model':db[_0xd688('0x9d')],'as':_0xd688('0x9e'),'where':{'fax':_0x135450},'limit':0x1,'order':[['updatedAt',_0xd688('0x9f')]]}]}]})[_0xd688('0x21')](handleEntityNotFound(_0x55f369,null))[_0xd688('0x21')](function(_0x2f321b){_0x1c012e=_0x2f321b;if(_0x256448[_0xd688('0x5e')]['attachments']&&_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][_0xd688('0x44')]){for(var _0x3c7468=0x0;_0x3c7468<_0x256448[_0xd688('0x5e')]['attachments'][_0xd688('0x44')];_0x3c7468+=0x1){_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][_0x3c7468]={'filename':_0x256448['body']['attachments'][_0x3c7468][_0xd688('0x38')],'id':_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][_0x3c7468]['id'],'path':path[_0xd688('0xa1')](config[_0xd688('0xa2')],'server/files/attachments',_0x256448[_0xd688('0x5e')]['attachments'][_0x3c7468]['basename'])};}}return respondWithRpcPromise(_0xd688('0xa3'),_0xd688('0xa3'),{'FaxAccountId':_[_0xd688('0xa4')](_0x256448[_0xd688('0x57')]['id'])?undefined:_0x256448[_0xd688('0x57')]['id'],'path':_['isNil'](_0x256448['body']['attachments'][0x0][_0xd688('0xa5')])?undefined:_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][0x0][_0xd688('0xa5')],'fax':_[_0xd688('0xa4')](_0x256448[_0xd688('0x5e')]['to'][0x0])?undefined:_0x256448[_0xd688('0x5e')]['to'][0x0]},client9002);})[_0xd688('0x21')](function(){if(_0x1c012e){if(_[_0xd688('0xa4')](_0x256448[_0xd688('0x5e')]['from'])){_0x256448[_0xd688('0x5e')][_0xd688('0xa6')]=util[_0xd688('0x9a')](_0xd688('0xa7'),_0x1c012e[_0xd688('0x38')],_0x1c012e[_0xd688('0xa8')]);}if(_0x1c012e['List']){if(_0x1c012e[_0xd688('0xa9')]['Contacts']['length']){return _0x1c012e[_0xd688('0xa9')]['Contacts'][0x0];}else{return db['CmContact'][_0xd688('0x5a')](_['defaults'](_0x256448[_0xd688('0x5e')],{'firstName':_0x256448['body']['to'][0x0],'phone':_0x256448['body']['to'][0x0],'fax':_0x256448[_0xd688('0x5e')]['to'][0x0],'ListId':_0x1c012e[_0xd688('0x95')]}));}}else{throw new Error(_0xd688('0xaa'));}}else{throw new Error(_0xd688('0xab'));}})[_0xd688('0x21')](function(_0x523292){if(_0x523292){return db['FaxInteraction'][_0xd688('0x59')]({'where':{'ContactId':_0x523292['id'],'closed':![],'FaxAccountId':_0x1c012e['id']}})['then'](function(_0x23ae0e){if(_0x23ae0e){return[_0x23ae0e,![]];}return db[_0xd688('0x70')][_0xd688('0x5a')]({'UserId':_0x256448[_0xd688('0xac')]['id'],'ContactId':_0x523292['id'],'FaxAccountId':_0x1c012e['id'],'fax':_0x256448[_0xd688('0x5e')]['to'][0x0],'firstMsgDirection':_0xd688('0xad'),'Messages':[_[_0xd688('0x4f')](_0x256448[_0xd688('0x5e')],{'read':![],'body':_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][0x0][_0xd688('0xae')],'FaxAccountId':_0x1c012e['id'],'UserId':_0x256448[_0xd688('0xac')]['id'],'ContactId':_0x523292['id'],'AttachmentId':_0x256448['body'][_0xd688('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0xd688('0x9b')],'as':'Messages'}]})[_0xd688('0x21')](function(_0x128dce){return[_0x128dce,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd688('0xaf')](function(_0x40a911,_0x590df2){if(_0x590df2){return _0x40a911;}return db[_0xd688('0x9b')][_0xd688('0x5a')]({'direction':_0xd688('0xad'),'read':![],'body':_0x256448['body'][_0xd688('0xa0')][0x0][_0xd688('0xae')],'FaxAccountId':_0x1c012e['id'],'FaxInteractionId':_0x40a911['id'],'UserId':_0x256448[_0xd688('0xac')]['id'],'ContactId':_0x40a911[_0xd688('0xb0')],'AttachmentId':_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][0x0]['id']})['then'](function(_0x24bee6){_0x40a911[_0xd688('0xb1')][_0xd688('0xb2')]=[];_0x40a911['dataValues'][_0xd688('0xb2')][_0xd688('0x85')](_0x24bee6[_0xd688('0xb1')]);return _0x40a911;});})['then'](function(_0x1f2586){respondWithRpcPromise(_0xd688('0xb3'),_0xd688('0xb3'),{'FaxAccountId':_[_0xd688('0xa4')](_0x256448[_0xd688('0x57')]['id'])?undefined:_0x256448[_0xd688('0x57')]['id'],'path':_[_0xd688('0xa4')](_0x256448[_0xd688('0x5e')][_0xd688('0xa0')][0x0][_0xd688('0xa5')])?undefined:_0x256448[_0xd688('0x5e')]['attachments'][0x0][_0xd688('0xa5')],'fax':_[_0xd688('0xa4')](_0x256448[_0xd688('0x5e')]['to'][0x0])?undefined:_0x256448[_0xd688('0x5e')]['to'][0x0],'AttachmentId':_0x256448['body'][_0xd688('0xa0')][0x0]['id']},client9002)['then'](function(_0x416d77){logger[_0xd688('0x22')]('SendFaxRpc,\x20%s',_0x416d77);})[_0xd688('0x2c')](function(_0x4097a7){logger['info']('SendFaxRpc,\x20%s',_0x4097a7);});return _0x1f2586;})[_0xd688('0x21')](respondWithResult(_0x55f369,null))['catch'](handleError(_0x55f369,null));};exports[_0xd688('0xb4')]=function(_0x3e5724,_0x2eaa6b,_0x4854ab){return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x3e5724[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x2eaa6b,null))[_0xd688('0x21')](function(_0x52760b){if(_0x52760b){return _0x52760b[_0xd688('0xb4')](_0x3e5724[_0xd688('0x5e')][_0xd688('0x67')],_[_0xd688('0x6e')](_0x3e5724[_0xd688('0x5e')],['ids','id'])||{})['spread'](function(_0x2d6910){for(var _0x5dce9d=0x0;_0x5dce9d<_0x3e5724[_0xd688('0x5e')][_0xd688('0x67')][_0xd688('0x44')];_0x5dce9d+=0x1){socket[_0xd688('0xb5')]('userFaxAccount:save',{'UserId':_0x3e5724[_0xd688('0x5e')][_0xd688('0x67')][_0x5dce9d],'FaxAccountId':_0x3e5724[_0xd688('0x57')]['id']});}return _0x2d6910;});}})['then'](respondWithResult(_0x2eaa6b,null))['catch'](handleError(_0x2eaa6b,null));};exports['removeAgents']=function(_0x46459a,_0x586e1a,_0x3526af){return db[_0xd688('0x51')][_0xd688('0x59')]({'where':{'id':_0x46459a[_0xd688('0x57')]['id']}})[_0xd688('0x21')](handleEntityNotFound(_0x586e1a,null))[_0xd688('0x21')](function(_0x21e8fc){if(_0x21e8fc){return _0x21e8fc[_0xd688('0xb6')](_0x46459a[_0xd688('0x3f')][_0xd688('0x67')])[_0xd688('0x21')](function(){if(_[_0xd688('0xb7')](_0x46459a['query'][_0xd688('0x67')])){for(var _0x1dea43=0x0;_0x1dea43<_0x46459a['query'][_0xd688('0x67')][_0xd688('0x44')];_0x1dea43+=0x1){socket[_0xd688('0xb5')]('userFaxAccount:remove',{'UserId':Number(_0x46459a['query'][_0xd688('0x67')][_0x1dea43]),'FaxAccountId':Number(_0x46459a[_0xd688('0x57')]['id'])});}}else{socket[_0xd688('0xb5')](_0xd688('0xb8'),{'UserId':Number(_0x46459a[_0xd688('0x3f')][_0xd688('0x67')]),'FaxAccountId':Number(_0x46459a[_0xd688('0x57')]['id'])});}});}})[_0xd688('0x21')](respondWithStatusCode(_0x586e1a,null))[_0xd688('0x2c')](handleError(_0x586e1a,null));};exports['getAgents']=function(_0x1854a3,_0x466d1f,_0x141f08){var _0x1cd874={};var _0x34dc85={};var _0x222c74;var _0x1bc2f6;return db[_0xd688('0x51')][_0xd688('0x6a')]({'where':{'id':_0x1854a3['params']['id']}})['then'](handleEntityNotFound(_0x466d1f,null))[_0xd688('0x21')](function(_0xe400b9){if(_0xe400b9){_0x222c74=_0xe400b9;_0x34dc85['model']=_[_0xd688('0x40')](db[_0xd688('0x72')]['rawAttributes']);_0x34dc85[_0xd688('0x3f')]=_['keys'](_0x1854a3[_0xd688('0x3f')]);_0x34dc85[_0xd688('0x41')]=_[_0xd688('0x42')](_0x34dc85[_0xd688('0x3e')],_0x34dc85[_0xd688('0x3f')]);_0x1cd874[_0xd688('0x43')]=_[_0xd688('0x42')](_0x34dc85['model'],qs['fields'](_0x1854a3['query']['fields']));_0x1cd874[_0xd688('0x43')]=_0x1cd874[_0xd688('0x43')][_0xd688('0x44')]?_0x1cd874[_0xd688('0x43')]:_0x34dc85[_0xd688('0x3e')];_0x1cd874[_0xd688('0x63')]=qs[_0xd688('0x47')](_0x1854a3[_0xd688('0x3f')]['sort']);_0x1cd874[_0xd688('0x4a')]=qs['filters'](_[_0xd688('0x48')](_0x1854a3[_0xd688('0x3f')],_0x34dc85[_0xd688('0x41')]));if(_0x1854a3[_0xd688('0x3f')][_0xd688('0x49')]){_0x1cd874[_0xd688('0x4a')]=_['merge'](_0x1cd874[_0xd688('0x4a')],{'$or':_[_0xd688('0x65')](_0x1cd874[_0xd688('0x43')],function(_0x408580){var _0xf01d16={};_0xf01d16[_0x408580]={'$like':'%'+_0x1854a3[_0xd688('0x3f')][_0xd688('0x49')]+'%'};return _0xf01d16;})});}_0x1cd874=_[_0xd688('0x4f')]({},_0x1cd874,_0x1854a3[_0xd688('0x50')]);return _0x222c74[_0xd688('0xb9')](_0x1cd874);}})[_0xd688('0x21')](function(_0x10039d){if(_0x10039d){_0x1bc2f6=_0x10039d['length'];if(!_0x1854a3[_0xd688('0x3f')]['hasOwnProperty'](_0xd688('0x46'))){_0x1cd874['limit']=qs[_0xd688('0x31')](_0x1854a3[_0xd688('0x3f')][_0xd688('0x31')]);_0x1cd874[_0xd688('0x30')]=qs[_0xd688('0x30')](_0x1854a3['query'][_0xd688('0x30')]);}return _0x222c74[_0xd688('0xb9')](_0x1cd874);}})[_0xd688('0x21')](function(_0xd7856f){if(_0xd7856f){return _0xd7856f?{'count':_0x1bc2f6,'rows':_0xd7856f}:null;}})[_0xd688('0x21')](respondWithResult(_0x466d1f,null))['catch'](handleError(_0x466d1f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index f4af20d..a7f1b9b 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 _0xdabd=['hook','exports','events','../../mysqldb','FaxAccount','save','remove'];(function(_0x21229c,_0x131854){var _0xc68e2c=function(_0x5045b5){while(--_0x5045b5){_0x21229c['push'](_0x21229c['shift']());}};_0xc68e2c(++_0x131854);}(_0xdabd,0xa3));var _0xddab=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xdabd[_0xbb14db];return _0x36bed7;};'use strict';var EventEmitter=require(_0xddab('0x0'));var FaxAccount=require(_0xddab('0x1'))['db'][_0xddab('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xddab('0x3'),'afterUpdate':'update','afterDestroy':_0xddab('0x4')};function emitEvent(_0x5e122d){return function(_0x5ae773,_0x336c58,_0x5f5b4b){FaxAccountEvents['emit'](_0x5e122d+':'+_0x5ae773['id'],_0x5ae773);FaxAccountEvents['emit'](_0x5e122d,_0x5ae773);_0x5f5b4b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xddab('0x5')](e,emitEvent(event));}}module[_0xddab('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x0e69=['FaxAccount','update','emit','hasOwnProperty','exports','events'];(function(_0x58ab89,_0xf01b2d){var _0xb93c04=function(_0x29e1b2){while(--_0x29e1b2){_0x58ab89['push'](_0x58ab89['shift']());}};_0xb93c04(++_0xf01b2d);}(_0x0e69,0x173));var _0x90e6=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x0e69[_0x424a9a];return _0xa7831c;};'use strict';var EventEmitter=require(_0x90e6('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x90e6('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x90e6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5cc4ce){return function(_0x5716dc,_0x49cb8c,_0x56d5ea){FaxAccountEvents[_0x90e6('0x3')](_0x5cc4ce+':'+_0x5716dc['id'],_0x5716dc);FaxAccountEvents['emit'](_0x5cc4ce,_0x5716dc);_0x56d5ea(null);};}for(var e in events){if(events[_0x90e6('0x4')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x90e6('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 7cd30ae..b02188b 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 _0x9f91=['../../config/logger','api','moment','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','lodash','util'];(function(_0x1ca7b5,_0x18c9bc){var _0x45265f=function(_0x126aa0){while(--_0x126aa0){_0x1ca7b5['push'](_0x1ca7b5['shift']());}};_0x45265f(++_0x18c9bc);}(_0x9f91,0x11c));var _0x19f9=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0x9f91[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0x19f9('0x0'));var util=require(_0x19f9('0x1'));var logger=require(_0x19f9('0x2'))(_0x19f9('0x3'));var moment=require(_0x19f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x19f9('0x5'));var fs=require('fs');var path=require(_0x19f9('0x6'));var rimraf=require('rimraf');var config=require(_0x19f9('0x7'));var attributes=require(_0x19f9('0x8'));module[_0x19f9('0x9')]=function(_0x3e4dd4,_0x46b5c4){return _0x3e4dd4[_0x19f9('0xa')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2821=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x147e9f,_0x57b3cb){var _0x321585=function(_0x53093a){while(--_0x53093a){_0x147e9f['push'](_0x147e9f['shift']());}};_0x321585(++_0x57b3cb);}(_0x2821,0xc3));var _0x1282=function(_0x45996e,_0x27af5d){_0x45996e=_0x45996e-0x0;var _0x1b220e=_0x2821[_0x45996e];return _0x1b220e;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var logger=require(_0x1282('0x2'))(_0x1282('0x3'));var moment=require(_0x1282('0x4'));var BPromise=require(_0x1282('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1282('0x6'));var rimraf=require(_0x1282('0x7'));var config=require('../../config/environment');var attributes=require(_0x1282('0x8'));module[_0x1282('0x9')]=function(_0x384b8b,_0xe7525f){return _0x384b8b[_0x1282('0xa')](_0x1282('0xb'),attributes,{'tableName':_0x1282('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 6cb6679..7f8fac1 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 _0x1144=['findAll','options','raw','where','attributes','limit','map','model','include','then','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','Contacts','length','defaults','contact','fax','FaxInteraction','create','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxAccount'];(function(_0x176553,_0x4673d8){var _0x2fc836=function(_0x41ac80){while(--_0x41ac80){_0x176553['push'](_0x176553['shift']());}};_0x2fc836(++_0x4673d8);}(_0x1144,0x1a7));var _0x4114=function(_0x142bc7,_0x3a6722){_0x142bc7=_0x142bc7-0x0;var _0x312111=_0x1144[_0x142bc7];return _0x312111;};'use strict';var _=require(_0x4114('0x0'));var util=require(_0x4114('0x1'));var moment=require(_0x4114('0x2'));var BPromise=require('bluebird');var rs=require(_0x4114('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4114('0x4'))['db'];var utils=require(_0x4114('0x5'));var logger=require(_0x4114('0x6'))(_0x4114('0x7'));var config=require(_0x4114('0x8'));var jayson=require(_0x4114('0x9'));var client=jayson['client'][_0x4114('0xa')]({'port':0x232c});config[_0x4114('0xb')]=_['defaults'](config[_0x4114('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4114('0xc'))(new Redis(config[_0x4114('0xb')]));require(_0x4114('0xd'))[_0x4114('0xe')](socket);function respondWithRpcPromise(_0xb2d1fa,_0x32e1c0,_0x269531){return new BPromise(function(_0x5b8127,_0x18e282){return client[_0x4114('0xf')](_0xb2d1fa,_0x269531)['then'](function(_0x599b7f){logger['info'](_0x4114('0x10'),_0x32e1c0,'request\x20sent');logger[_0x4114('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x32e1c0,_0x4114('0x12'),JSON[_0x4114('0x13')](_0x599b7f));if(_0x599b7f[_0x4114('0x14')]){if(_0x599b7f['error'][_0x4114('0x15')]===0x1f4){logger['error'](_0x4114('0x10'),_0x32e1c0,_0x599b7f[_0x4114('0x14')][_0x4114('0x16')]);return _0x18e282(_0x599b7f[_0x4114('0x14')][_0x4114('0x16')]);}logger[_0x4114('0x14')](_0x4114('0x10'),_0x32e1c0,_0x599b7f['error'][_0x4114('0x16')]);return _0x5b8127(_0x599b7f['error'][_0x4114('0x16')]);}else{logger[_0x4114('0x17')]('FaxAccount,\x20%s,\x20%s',_0x32e1c0,_0x4114('0x12'));_0x5b8127(_0x599b7f[_0x4114('0x18')][_0x4114('0x16')]);}})[_0x4114('0x19')](function(_0x1e0b18){logger[_0x4114('0x14')](_0x4114('0x10'),_0x32e1c0,_0x1e0b18);_0x18e282(_0x1e0b18);});});}exports[_0x4114('0x1a')]=function(_0x4c448d){var _0x5d3353=this;return new Promise(function(_0x39b03f,_0x1e757f){return db['FaxAccount'][_0x4114('0x1b')]({'raw':_0x4c448d['options']?_0x4c448d[_0x4114('0x1c')][_0x4114('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c448d[_0x4114('0x1c')]?_0x4c448d[_0x4114('0x1c')][_0x4114('0x1e')]||null:null,'attributes':_0x4c448d[_0x4114('0x1c')]?_0x4c448d[_0x4114('0x1c')][_0x4114('0x1f')]||null:null,'limit':_0x4c448d[_0x4114('0x1c')]?_0x4c448d[_0x4114('0x1c')][_0x4114('0x20')]||null:null,'include':_0x4c448d[_0x4114('0x1c')]?_0x4c448d[_0x4114('0x1c')]['include']?_[_0x4114('0x21')](_0x4c448d[_0x4114('0x1c')]['include'],function(_0x147bbd){return{'model':db[_0x147bbd[_0x4114('0x22')]],'as':_0x147bbd['as'],'attributes':_0x147bbd[_0x4114('0x1f')],'include':_0x147bbd[_0x4114('0x23')]?_['map'](_0x147bbd['include'],function(_0x19d7d6){return{'model':db[_0x19d7d6[_0x4114('0x22')]],'as':_0x19d7d6['as'],'attributes':_0x19d7d6[_0x4114('0x1f')],'include':_0x19d7d6[_0x4114('0x23')]?_[_0x4114('0x21')](_0x19d7d6[_0x4114('0x23')],function(_0x3586a4){return{'model':db[_0x3586a4[_0x4114('0x22')]],'as':_0x3586a4['as'],'attributes':_0x3586a4[_0x4114('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4114('0x24')](function(_0x3f1bb7){logger[_0x4114('0x17')](_0x4114('0x1a'),_0x4c448d);logger[_0x4114('0x11')](_0x4114('0x1a'),_0x4c448d,JSON[_0x4114('0x13')](_0x3f1bb7));_0x39b03f(_0x3f1bb7);})[_0x4114('0x19')](function(_0x3f50b0){logger[_0x4114('0x14')]('GetFaxAccount',_0x3f50b0[_0x4114('0x16')],_0x4c448d);_0x1e757f(_0x5d3353[_0x4114('0x14')](0x1f4,_0x3f50b0[_0x4114('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x444235,_0x4ff6e6,_0x5897a9){var _0x44d4c0=this;return new Promise(function(_0x1c1f4b,_0x18bc06){var _0x3cc8ab={'body':_0x444235[_0x4114('0x25')],'channel':'fax'};var _0x228cb4=[];var _0x4a54a6=[];var _0xde8227={};return db[_0x4114('0x26')][_0x4114('0x27')]()[_0x4114('0x24')](function(_0x297f74){if(!_0x297f74){throw new db[(_0x4114('0x28'))]['ValidationError'](_0x4114('0x29'));}_0x228cb4=_[_0x4114('0x2a')](_[_0x4114('0x2b')](_0x297f74),['createdAt',_0x4114('0x2c')]);_0x4a54a6=_[_0x4114('0x2a')](_[_0x4114('0x2b')](_0x297f74),[_0x4114('0x2d'),_0x4114('0x2c'),_0x4114('0x2e'),_0x4114('0x2f')]);if(_0x444235[_0x4114('0x25')]['id']){delete _0x444235['body']['id'];}if(_[_0x4114('0x30')](_0x444235['body'][_0x4114('0x31')])){throw new db['Sequelize']['ValidationError'](_0x4114('0x32'));}if(_['isNil'](_0x444235[_0x4114('0x25')][_0x4114('0x25')])||_0x444235[_0x4114('0x25')]['body']===''){throw new db[(_0x4114('0x28'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x444235[_0x4114('0x25')][_0x4114('0x33')])){throw new db[(_0x4114('0x28'))][(_0x4114('0x34'))](_0x4114('0x35')+_0x4a54a6);}if(!_[_0x4114('0x36')](_0x4a54a6,_0x444235['body'][_0x4114('0x33')])){throw new db[(_0x4114('0x28'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a54a6);}_0xde8227[_0x444235[_0x4114('0x25')][_0x4114('0x33')]]=_0x444235[_0x4114('0x25')][_0x4114('0x31')];})[_0x4114('0x24')](function(){return db[_0x4114('0x37')][_0x4114('0x38')]({'where':{'id':_0x444235[_0x4114('0x39')]['id']},'include':[{'model':db[_0x4114('0x3a')],'as':_0x4114('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xde8227,'limit':0x1,'order':[[_0x4114('0x2c'),_0x4114('0x3c')]]}]},{'model':db[_0x4114('0x3d')],'as':_0x4114('0x3e')}]});})[_0x4114('0x24')](function(_0x318eb6){if(_0x318eb6&&_0x318eb6[_0x4114('0x3b')]){var _0x20e472=_0x318eb6[_0x4114('0x3f')]({'plain':!![]});_0x3cc8ab[_0x4114('0x39')]=_0x20e472;_0x3cc8ab[_0x4114('0x40')]=_0x20e472[_0x4114('0x3e')];_0x3cc8ab[_0x4114('0x41')]=_0x20e472['List'];_0x3cc8ab[_0x4114('0x40')]=_[_0x4114('0x42')](_0x3cc8ab[_0x4114('0x40')],[_0x4114('0x43')],['asc']);if(_0x3cc8ab['account'][_0x4114('0x3e')]){delete _0x3cc8ab[_0x4114('0x39')]['Applications'];}if(_0x3cc8ab[_0x4114('0x39')][_0x4114('0x3b')]&&_0x3cc8ab[_0x4114('0x39')][_0x4114('0x3b')][_0x4114('0x44')][_0x4114('0x45')]){return _0x3cc8ab[_0x4114('0x39')]['List'][_0x4114('0x44')][0x0];}var _0x57477c=_[_0x4114('0x46')](_0x444235[_0x4114('0x25')],{'firstName':_0x444235[_0x4114('0x25')][_0x4114('0x31')],'ListId':_0x20e472[_0x4114('0x2f')]});_0x57477c[_0x444235['body']['mapKey']]=_0x444235['body'][_0x4114('0x31')];return db[_0x4114('0x26')]['create'](_0x57477c,{'fields':_0x228cb4,'raw':!![]});}})[_0x4114('0x24')](function(_0x54c268){_0x3cc8ab[_0x4114('0x47')]=_0x54c268;if(_0x54c268){var _0x300dae={'ContactId':_0x54c268['id'],'FaxAccountId':_0x444235[_0x4114('0x39')]['id'],'fax':_0x54c268[_0x4114('0x48')]};return db[_0x4114('0x49')][_0x4114('0x38')]({'where':{'ContactId':_0x54c268['id'],'closed':![],'FaxAccountId':_0x444235['account']['id']}})['then'](function(_0x4d3a86){if(_0x4d3a86){return[_0x4d3a86,![]];}return db[_0x4114('0x49')][_0x4114('0x4a')](_0x300dae)[_0x4114('0x24')](function(_0x3b9d88){return[_0x3b9d88,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x3af4f9,_0x3a26fb){var _0x86c46=_0x3af4f9['get']({'plain':!![]});if(_0x3a26fb){if(_0x3cc8ab[_0x4114('0x39')][_0x4114('0x4b')]){_0x3cc8ab[_0x4114('0x40')][_0x4114('0x4c')]({'id':0x0,'priority':_0x3cc8ab[_0x4114('0x40')][_0x4114('0x45')]+0x1,'app':_0x4114('0x4d'),'appdata':_0x4114('0x4e'),'interval':_0x4114('0x4f')});}_0x86c46[_0x4114('0x50')]=!![];}else{_0x86c46['created']=![];}_0x3cc8ab['interaction']=_0x86c46;return db[_0x4114('0x51')]['create']({'body':_0x444235[_0x4114('0x25')][_0x4114('0x25')],'FaxAccountId':_0x444235[_0x4114('0x39')]['id'],'FaxInteractionId':_0x3af4f9['id'],'direction':'in','ContactId':_0x3af4f9[_0x4114('0x52')],'AttachmentId':_0x444235['body'][_0x4114('0x53')]});})[_0x4114('0x24')](function(_0x539009){_0x3cc8ab[_0x4114('0x16')]=_0x539009;if(_0x3cc8ab[_0x4114('0x54')][_0x4114('0x55')]){return db['User'][_0x4114('0x38')]({'attributes':['id','name'],'where':{'id':_0x3cc8ab[_0x4114('0x54')]['UserId']}})[_0x4114('0x24')](function(_0x4ddacd){if(_0x4ddacd){_0x3cc8ab['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x4114('0x56'),'appdata':_0x4ddacd['name']+','+(_0x3cc8ab[_0x4114('0x39')][_0x4114('0x57')]||0xa),'interval':_0x4114('0x4f')});}return respondWithRpcPromise('Start',_0x4114('0x58'),_0x3cc8ab);});}return respondWithRpcPromise(_0x4114('0x59'),_0x4114('0x58'),_0x3cc8ab);})[_0x4114('0x24')](function(_0x44ff79){_0x1c1f4b(_0x44ff79);})['catch'](function(_0x472941){_0x18bc06(_0x44d4c0[_0x4114('0x14')](0x1f4,_0x472941[_0x4114('0x16')]));});});}; \ No newline at end of file +var _0x204c=['mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','orderBy','applications','priority','length','contact','FaxInteraction','find','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','then','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','findAll','options','where','limit','include','attributes','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x5eeb5b,_0x55c909){var _0x31471c=function(_0x12789a){while(--_0x12789a){_0x5eeb5b['push'](_0x5eeb5b['shift']());}};_0x31471c(++_0x55c909);}(_0x204c,0xdc));var _0xc204=function(_0x3db58d,_0x3f0c01){_0x3db58d=_0x3db58d-0x0;var _0x17158d=_0x204c[_0x3db58d];return _0x17158d;};'use strict';var _=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var moment=require(_0xc204('0x2'));var BPromise=require(_0xc204('0x3'));var rs=require(_0xc204('0x4'));var fs=require('fs');var Redis=require(_0xc204('0x5'));var db=require(_0xc204('0x6'))['db'];var utils=require(_0xc204('0x7'));var logger=require(_0xc204('0x8'))(_0xc204('0x9'));var config=require(_0xc204('0xa'));var jayson=require(_0xc204('0xb'));var client=jayson['client'][_0xc204('0xc')]({'port':0x232c});config[_0xc204('0xd')]=_[_0xc204('0xe')](config['redis'],{'host':_0xc204('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc204('0xd')]));require(_0xc204('0x10'))['register'](socket);function respondWithRpcPromise(_0xff6cf,_0x43b686,_0x2ade60){return new BPromise(function(_0x25ac48,_0x43f0b0){return client['request'](_0xff6cf,_0x2ade60)[_0xc204('0x11')](function(_0x2dfc56){logger[_0xc204('0x12')]('FaxAccount,\x20%s,\x20%s',_0x43b686,_0xc204('0x13'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x43b686,_0xc204('0x13'),JSON[_0xc204('0x14')](_0x2dfc56));if(_0x2dfc56[_0xc204('0x15')]){if(_0x2dfc56['error'][_0xc204('0x16')]===0x1f4){logger[_0xc204('0x15')](_0xc204('0x17'),_0x43b686,_0x2dfc56[_0xc204('0x15')][_0xc204('0x18')]);return _0x43f0b0(_0x2dfc56['error'][_0xc204('0x18')]);}logger[_0xc204('0x15')]('FaxAccount,\x20%s,\x20%s',_0x43b686,_0x2dfc56['error'][_0xc204('0x18')]);return _0x25ac48(_0x2dfc56[_0xc204('0x15')][_0xc204('0x18')]);}else{logger[_0xc204('0x12')](_0xc204('0x17'),_0x43b686,_0xc204('0x13'));_0x25ac48(_0x2dfc56[_0xc204('0x19')][_0xc204('0x18')]);}})[_0xc204('0x1a')](function(_0x5affc8){logger[_0xc204('0x15')](_0xc204('0x17'),_0x43b686,_0x5affc8);_0x43f0b0(_0x5affc8);});});}exports['GetFaxAccount']=function(_0x1ce37d){var _0x3a698b=this;return new Promise(function(_0x43f99d,_0x4c851f){return db[_0xc204('0x1b')][_0xc204('0x1c')]({'raw':_0x1ce37d['options']?_0x1ce37d[_0xc204('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1ce37d[_0xc204('0x1d')]?_0x1ce37d[_0xc204('0x1d')][_0xc204('0x1e')]||null:null,'attributes':_0x1ce37d[_0xc204('0x1d')]?_0x1ce37d[_0xc204('0x1d')]['attributes']||null:null,'limit':_0x1ce37d[_0xc204('0x1d')]?_0x1ce37d['options'][_0xc204('0x1f')]||null:null,'include':_0x1ce37d[_0xc204('0x1d')]?_0x1ce37d[_0xc204('0x1d')]['include']?_['map'](_0x1ce37d[_0xc204('0x1d')][_0xc204('0x20')],function(_0x46e752){return{'model':db[_0x46e752['model']],'as':_0x46e752['as'],'attributes':_0x46e752[_0xc204('0x21')],'include':_0x46e752['include']?_[_0xc204('0x22')](_0x46e752[_0xc204('0x20')],function(_0x2ef43f){return{'model':db[_0x2ef43f[_0xc204('0x23')]],'as':_0x2ef43f['as'],'attributes':_0x2ef43f[_0xc204('0x21')],'include':_0x2ef43f[_0xc204('0x20')]?_[_0xc204('0x22')](_0x2ef43f['include'],function(_0x4e34ee){return{'model':db[_0x4e34ee[_0xc204('0x23')]],'as':_0x4e34ee['as'],'attributes':_0x4e34ee[_0xc204('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc204('0x11')](function(_0x44c10d){logger[_0xc204('0x12')](_0xc204('0x24'),_0x1ce37d);logger['debug'](_0xc204('0x24'),_0x1ce37d,JSON[_0xc204('0x14')](_0x44c10d));_0x43f99d(_0x44c10d);})[_0xc204('0x1a')](function(_0x4595df){logger[_0xc204('0x15')](_0xc204('0x24'),_0x4595df[_0xc204('0x18')],_0x1ce37d);_0x4c851f(_0x3a698b[_0xc204('0x15')](0x1f4,_0x4595df[_0xc204('0x18')]));});});};exports[_0xc204('0x25')]=function(_0x357131,_0x31e51b,_0x202a2b){var _0x212b45=this;return new Promise(function(_0x14d32a,_0x72e779){var _0xa3c665={'body':_0x357131[_0xc204('0x26')],'channel':_0xc204('0x27')};var _0x2105cc=[];var _0x7e8fee=[];var _0x3979a5={};return db[_0xc204('0x28')][_0xc204('0x29')]()['then'](function(_0x7ab2){if(!_0x7ab2){throw new db['Sequelize'][(_0xc204('0x2a'))](_0xc204('0x2b'));}_0x2105cc=_[_0xc204('0x2c')](_['keys'](_0x7ab2),['createdAt',_0xc204('0x2d')]);_0x7e8fee=_['difference'](_[_0xc204('0x2e')](_0x7ab2),[_0xc204('0x2f'),_0xc204('0x2d'),_0xc204('0x30'),_0xc204('0x31')]);if(_0x357131[_0xc204('0x26')]['id']){delete _0x357131[_0xc204('0x26')]['id'];}if(_[_0xc204('0x32')](_0x357131[_0xc204('0x26')][_0xc204('0x33')])){throw new db['Sequelize'][(_0xc204('0x2a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x357131['body'][_0xc204('0x26')])||_0x357131[_0xc204('0x26')][_0xc204('0x26')]===''){throw new db[(_0xc204('0x34'))][(_0xc204('0x2a'))](_0xc204('0x35'));}if(_[_0xc204('0x32')](_0x357131['body']['mapKey'])){throw new db[(_0xc204('0x34'))]['ValidationError'](_0xc204('0x36')+_0x7e8fee);}if(!_[_0xc204('0x37')](_0x7e8fee,_0x357131[_0xc204('0x26')][_0xc204('0x38')])){throw new db[(_0xc204('0x34'))][(_0xc204('0x2a'))](_0xc204('0x39')+_0x7e8fee);}_0x3979a5[_0x357131[_0xc204('0x26')][_0xc204('0x38')]]=_0x357131[_0xc204('0x26')][_0xc204('0x33')];})[_0xc204('0x11')](function(){return db['FaxAccount']['find']({'where':{'id':_0x357131[_0xc204('0x3a')]['id']},'include':[{'model':db[_0xc204('0x3b')],'as':_0xc204('0x3c'),'include':[{'model':db['CmContact'],'as':_0xc204('0x3d'),'where':_0x3979a5,'limit':0x1,'order':[[_0xc204('0x2d'),_0xc204('0x3e')]]}]},{'model':db[_0xc204('0x3f')],'as':_0xc204('0x40')}]});})[_0xc204('0x11')](function(_0x88fdc){if(_0x88fdc&&_0x88fdc['List']){var _0x2ee7b4=_0x88fdc[_0xc204('0x41')]({'plain':!![]});_0xa3c665[_0xc204('0x3a')]=_0x2ee7b4;_0xa3c665['applications']=_0x2ee7b4[_0xc204('0x40')];_0xa3c665['list']=_0x2ee7b4[_0xc204('0x3c')];_0xa3c665['applications']=_[_0xc204('0x42')](_0xa3c665[_0xc204('0x43')],[_0xc204('0x44')],['asc']);if(_0xa3c665[_0xc204('0x3a')][_0xc204('0x40')]){delete _0xa3c665[_0xc204('0x3a')][_0xc204('0x40')];}if(_0xa3c665['account'][_0xc204('0x3c')]&&_0xa3c665[_0xc204('0x3a')][_0xc204('0x3c')]['Contacts'][_0xc204('0x45')]){return _0xa3c665[_0xc204('0x3a')]['List']['Contacts'][0x0];}var _0x1ca978=_[_0xc204('0xe')](_0x357131[_0xc204('0x26')],{'firstName':_0x357131[_0xc204('0x26')][_0xc204('0x33')],'ListId':_0x2ee7b4[_0xc204('0x31')]});_0x1ca978[_0x357131[_0xc204('0x26')][_0xc204('0x38')]]=_0x357131[_0xc204('0x26')][_0xc204('0x33')];return db[_0xc204('0x28')]['create'](_0x1ca978,{'fields':_0x2105cc,'raw':!![]});}})[_0xc204('0x11')](function(_0x2299d8){_0xa3c665[_0xc204('0x46')]=_0x2299d8;if(_0x2299d8){var _0x23e106={'ContactId':_0x2299d8['id'],'FaxAccountId':_0x357131[_0xc204('0x3a')]['id'],'fax':_0x2299d8['fax']};return db[_0xc204('0x47')][_0xc204('0x48')]({'where':{'ContactId':_0x2299d8['id'],'closed':![],'FaxAccountId':_0x357131['account']['id']}})[_0xc204('0x11')](function(_0x47d8bc){if(_0x47d8bc){return[_0x47d8bc,![]];}return db['FaxInteraction'][_0xc204('0x49')](_0x23e106)['then'](function(_0x4dacf6){return[_0x4dacf6,!![]];});});}else{throw new Error(_0xc204('0x4a'));}})[_0xc204('0x4b')](function(_0x30b590,_0x590bd2){var _0x21a20e=_0x30b590[_0xc204('0x41')]({'plain':!![]});if(_0x590bd2){if(_0xa3c665[_0xc204('0x3a')][_0xc204('0x4c')]){_0xa3c665[_0xc204('0x43')][_0xc204('0x4d')]({'id':0x0,'priority':_0xa3c665[_0xc204('0x43')]['length']+0x1,'app':_0xc204('0x4e'),'appdata':_0xc204('0x4f'),'interval':_0xc204('0x50')});}_0x21a20e['created']=!![];}else{_0x21a20e[_0xc204('0x51')]=![];}_0xa3c665[_0xc204('0x52')]=_0x21a20e;return db[_0xc204('0x53')][_0xc204('0x49')]({'body':_0x357131['body']['body'],'FaxAccountId':_0x357131[_0xc204('0x3a')]['id'],'FaxInteractionId':_0x30b590['id'],'direction':'in','ContactId':_0x30b590[_0xc204('0x54')],'AttachmentId':_0x357131['body'][_0xc204('0x55')]});})[_0xc204('0x11')](function(_0x3fa76b){_0xa3c665['message']=_0x3fa76b;if(_0xa3c665[_0xc204('0x52')][_0xc204('0x56')]){return db[_0xc204('0x57')][_0xc204('0x48')]({'attributes':['id',_0xc204('0x58')],'where':{'id':_0xa3c665[_0xc204('0x52')][_0xc204('0x56')]}})[_0xc204('0x11')](function(_0x27ca08){if(_0x27ca08){_0xa3c665[_0xc204('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x27ca08[_0xc204('0x58')]+','+(_0xa3c665[_0xc204('0x3a')][_0xc204('0x59')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc204('0x5a'),_0xc204('0x5b'),_0xa3c665);});}return respondWithRpcPromise(_0xc204('0x5a'),_0xc204('0x5b'),_0xa3c665);})[_0xc204('0x11')](function(_0x29c95d){_0x14d32a(_0x29c95d);})[_0xc204('0x1a')](function(_0x3bd902){_0x72e779(_0x212b45[_0xc204('0x15')](0x1f4,_0x3bd902['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5ef93e2..6b88a71 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 _0x985e=['./faxAccount.events','save','update','removeListener','register','faxAccount:'];(function(_0x467bba,_0x3e1982){var _0x4597cc=function(_0x3dac91){while(--_0x3dac91){_0x467bba['push'](_0x467bba['shift']());}};_0x4597cc(++_0x3e1982);}(_0x985e,0xae));var _0xe985=function(_0x5451ff,_0x9134ee){_0x5451ff=_0x5451ff-0x0;var _0x44e5cf=_0x985e[_0x5451ff];return _0x44e5cf;};'use strict';var FaxAccountEvents=require(_0xe985('0x0'));var events=[_0xe985('0x1'),'remove',_0xe985('0x2')];function createListener(_0xc08aac,_0x62b772){return function(_0x3c0d55){_0x62b772['emit'](_0xc08aac,_0x3c0d55);};}function removeListener(_0x2e00e3,_0x4f89a4){return function(){FaxAccountEvents[_0xe985('0x3')](_0x2e00e3,_0x4f89a4);};}exports[_0xe985('0x4')]=function(_0x3c2176){for(var _0xcfa6d7=0x0,_0xc2ab1b=events['length'];_0xcfa6d7<_0xc2ab1b;_0xcfa6d7++){var _0x3a7e3b=events[_0xcfa6d7];var _0x596d5e=createListener(_0xe985('0x5')+_0x3a7e3b,_0x3c2176);FaxAccountEvents['on'](_0x3a7e3b,_0x596d5e);}}; \ No newline at end of file +var _0x1b62=['emit','removeListener','./faxAccount.events','save','remove','update'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1b62,0x1a6));var _0x21b6=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x1b62[_0x1cfe2e];return _0x39233f;};'use strict';var FaxAccountEvents=require(_0x21b6('0x0'));var events=[_0x21b6('0x1'),_0x21b6('0x2'),_0x21b6('0x3')];function createListener(_0x5866b8,_0x39327f){return function(_0x511403){_0x39327f[_0x21b6('0x4')](_0x5866b8,_0x511403);};}function removeListener(_0x236efe,_0xca1281){return function(){FaxAccountEvents[_0x21b6('0x5')](_0x236efe,_0xca1281);};}exports['register']=function(_0xd3414d){for(var _0x305eb1=0x0,_0x93b087=events['length'];_0x305eb1<_0x93b087;_0x305eb1++){var _0x470d43=events[_0x305eb1];var _0x2345d5=createListener('faxAccount:'+_0x470d43,_0xd3414d);FaxAccountEvents['on'](_0x470d43,_0x2345d5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d654f99..7c1e272 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 _0x693f=['./faxAccount.controller','get','isAuthenticated','index','describe','show','getDispositions','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','/:id','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x693f,0x1c5));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var path=require(_0xf693('0x2'));var timeout=require(_0xf693('0x3'));var express=require(_0xf693('0x4'));var router=express[_0xf693('0x5')]();var auth=require(_0xf693('0x6'));var interaction=require(_0xf693('0x7'));var config=require(_0xf693('0x8'));var controller=require(_0xf693('0x9'));router[_0xf693('0xa')]('/',auth[_0xf693('0xb')](),controller[_0xf693('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf693('0xd')]);router[_0xf693('0xa')]('/:id',auth[_0xf693('0xb')](),controller[_0xf693('0xe')]);router[_0xf693('0xa')]('/:id/dispositions',auth[_0xf693('0xb')](),controller[_0xf693('0xf')]);router[_0xf693('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xf693('0xa')](_0xf693('0x10'),auth['isAuthenticated'](),controller[_0xf693('0x11')]);router[_0xf693('0xa')](_0xf693('0x12'),auth[_0xf693('0xb')](),controller[_0xf693('0x13')]);router[_0xf693('0xa')](_0xf693('0x14'),auth[_0xf693('0xb')](),controller[_0xf693('0x15')]);router['get'](_0xf693('0x16'),auth[_0xf693('0xb')](),controller['getAgents']);router[_0xf693('0x17')]('/',auth[_0xf693('0xb')](),controller[_0xf693('0x18')]);router['post'](_0xf693('0x19'),auth[_0xf693('0xb')](),controller[_0xf693('0x1a')]);router[_0xf693('0x17')](_0xf693('0x1b'),auth[_0xf693('0xb')](),controller[_0xf693('0x1c')]);router[_0xf693('0x17')]('/:id/interactions',auth[_0xf693('0xb')](),controller['addInteraction']);router['post'](_0xf693('0x12'),auth[_0xf693('0xb')](),controller[_0xf693('0x1d')]);router[_0xf693('0x17')](_0xf693('0x1e'),auth[_0xf693('0xb')](),controller[_0xf693('0x1f')]);router[_0xf693('0x17')](_0xf693('0x20'),auth['isAuthenticated'](),controller[_0xf693('0x21')]);router[_0xf693('0x17')](_0xf693('0x22'),auth[_0xf693('0xb')](),controller[_0xf693('0x23')]);router[_0xf693('0x17')](_0xf693('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf693('0x24')](_0xf693('0x25'),auth[_0xf693('0xb')](),controller['update']);router[_0xf693('0x26')](_0xf693('0x25'),auth[_0xf693('0xb')](),controller['destroy']);router[_0xf693('0x26')](_0xf693('0x19'),auth[_0xf693('0xb')](),controller[_0xf693('0x27')]);router['delete']('/:id/canned_answers',auth[_0xf693('0xb')](),controller[_0xf693('0x28')]);router[_0xf693('0x26')]('/:id/users',auth[_0xf693('0xb')](),controller[_0xf693('0x29')]);module['exports']=router; \ No newline at end of file +var _0x370f=['/:id/applications','/:id/messages','getMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/interactions','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','/:id/send','send','/:id/users','put','/:id','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','Router','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getInteractions'];(function(_0x50ff02,_0x1fd117){var _0x54c542=function(_0x3d16dc){while(--_0x3d16dc){_0x50ff02['push'](_0x50ff02['shift']());}};_0x54c542(++_0x1fd117);}(_0x370f,0x64));var _0xf370=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x370f[_0x4314d7];return _0x5c599b;};'use strict';var multer=require('multer');var util=require(_0xf370('0x0'));var path=require(_0xf370('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf370('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xf370('0x3'));var config=require('../../config/environment');var controller=require(_0xf370('0x4'));router[_0xf370('0x5')]('/',auth[_0xf370('0x6')](),controller[_0xf370('0x7')]);router[_0xf370('0x5')](_0xf370('0x8'),auth[_0xf370('0x6')](),controller[_0xf370('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf370('0xa')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf370('0xb')]);router['get'](_0xf370('0xc'),auth[_0xf370('0x6')](),controller['getAnswers']);router[_0xf370('0x5')]('/:id/interactions',auth[_0xf370('0x6')](),controller[_0xf370('0xd')]);router[_0xf370('0x5')](_0xf370('0xe'),auth[_0xf370('0x6')](),controller['getApplications']);router[_0xf370('0x5')](_0xf370('0xf'),auth[_0xf370('0x6')](),controller[_0xf370('0x10')]);router['get']('/:id/users',auth[_0xf370('0x6')](),controller[_0xf370('0x11')]);router[_0xf370('0x12')]('/',auth['isAuthenticated'](),controller[_0xf370('0x13')]);router[_0xf370('0x12')](_0xf370('0x14'),auth[_0xf370('0x6')](),controller[_0xf370('0x15')]);router['post'](_0xf370('0xc'),auth[_0xf370('0x6')](),controller[_0xf370('0x16')]);router['post'](_0xf370('0x17'),auth['isAuthenticated'](),controller[_0xf370('0x18')]);router[_0xf370('0x12')](_0xf370('0xe'),auth[_0xf370('0x6')](),controller[_0xf370('0x19')]);router[_0xf370('0x12')](_0xf370('0x1a'),auth[_0xf370('0x6')](),controller['addAccountApplications']);router[_0xf370('0x12')](_0xf370('0x1b'),auth[_0xf370('0x6')](),controller['updateAccountApplications']);router['post'](_0xf370('0x1c'),auth[_0xf370('0x6')](),controller[_0xf370('0x1d')]);router[_0xf370('0x12')](_0xf370('0x1e'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf370('0x1f')](_0xf370('0x20'),auth[_0xf370('0x6')](),controller['update']);router[_0xf370('0x21')]('/:id',auth[_0xf370('0x6')](),controller['destroy']);router[_0xf370('0x21')]('/:id/dispositions',auth[_0xf370('0x6')](),controller[_0xf370('0x22')]);router['delete'](_0xf370('0xc'),auth[_0xf370('0x6')](),controller[_0xf370('0x23')]);router[_0xf370('0x21')](_0xf370('0x1e'),auth[_0xf370('0x6')](),controller[_0xf370('0x24')]);module[_0xf370('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a17380b..efc4f52 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 _0x3d30=['STRING','INTEGER','noop'];(function(_0x9c1f48,_0x25da55){var _0x52ecd4=function(_0x47aef6){while(--_0x47aef6){_0x9c1f48['push'](_0x9c1f48['shift']());}};_0x52ecd4(++_0x25da55);}(_0x3d30,0x6a));var _0x03d3=function(_0x4c8330,_0x3d3ad3){_0x4c8330=_0x4c8330-0x0;var _0x3416a1=_0x3d30[_0x4c8330];return _0x3416a1;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x03d3('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x03d3('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x03d3('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3419=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x74e8b5,_0x1f5668){var _0x2b90c6=function(_0x200987){while(--_0x200987){_0x74e8b5['push'](_0x74e8b5['shift']());}};_0x2b90c6(++_0x1f5668);}(_0x3419,0xb3));var _0x9341=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0x3419[_0xb7b878];return _0x3c84b9;};'use strict';var Sequelize=require(_0x9341('0x0'));module[_0x9341('0x1')]={'priority':{'type':Sequelize[_0x9341('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9341('0x3')],'allowNull':![],'defaultValue':_0x9341('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9341('0x3')]},'interval':{'type':Sequelize[_0x9341('0x3')],'defaultValue':_0x9341('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index ec6e0d0..9b9b263 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 _0x31f0=['end','json','offset','Content-Range','apply','reject','save','then','destroy','error','name','index','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','filter','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x39fa10,_0x377211){var _0x4867fc=function(_0x1de015){while(--_0x1de015){_0x39fa10['push'](_0x39fa10['shift']());}};_0x4867fc(++_0x377211);}(_0x31f0,0xb7));var _0x031f=function(_0x531851,_0x3ffb9c){_0x531851=_0x531851-0x0;var _0x10ccb0=_0x31f0[_0x531851];return _0x10ccb0;};'use strict';var pdf=require(_0x031f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x031f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x031f('0x2'));var rp=require(_0x031f('0x3'));var moment=require(_0x031f('0x4'));var BPromise=require(_0x031f('0x5'));var Mustache=require('mustache');var util=require(_0x031f('0x6'));var path=require(_0x031f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var hardwareService=require(_0x031f('0x11'));var logger=require(_0x031f('0x12'))(_0x031f('0x13'));var utils=require(_0x031f('0x14'));var config=require('../../config/environment');var db=require(_0x031f('0x15'))['db'];function respondWithStatusCode(_0x353744,_0x28da6e){_0x28da6e=_0x28da6e||0xcc;return function(_0x351052){if(_0x351052){return _0x353744[_0x031f('0x16')](_0x28da6e);}return _0x353744[_0x031f('0x17')](_0x28da6e)[_0x031f('0x18')]();};}function respondWithResult(_0x5d0457,_0x1614d6){_0x1614d6=_0x1614d6||0xc8;return function(_0x23b40c){if(_0x23b40c){return _0x5d0457[_0x031f('0x17')](_0x1614d6)[_0x031f('0x19')](_0x23b40c);}};}function respondWithFilteredResult(_0x2ea549,_0x57f9c0){return function(_0x4b7011){if(_0x4b7011){var _0x1f08db=_0x4b7011['count'],_0x3a10aa=_0x57f9c0[_0x031f('0x1a')],_0xe4fc1d=_0x57f9c0[_0x031f('0x1a')]+_0x57f9c0['limit'],_0x286177;if(_0xe4fc1d>=_0x1f08db){_0xe4fc1d=_0x1f08db;_0x286177=0xc8;}else{_0x286177=0xce;}_0x2ea549[_0x031f('0x17')](_0x286177);return _0x2ea549['set'](_0x031f('0x1b'),_0x3a10aa+'-'+_0xe4fc1d+'/'+_0x1f08db)[_0x031f('0x19')](_0x4b7011);}return null;};}function patchUpdates(_0x563bc8){return function(_0xaa155){try{jsonpatch[_0x031f('0x1c')](_0xaa155,_0x563bc8,!![]);}catch(_0x26cb5e){return BPromise[_0x031f('0x1d')](_0x26cb5e);}return _0xaa155[_0x031f('0x1e')]();};}function saveUpdates(_0xf76f1b,_0x345bde){return function(_0x29dd6e){if(_0x29dd6e){return _0x29dd6e['update'](_0xf76f1b)[_0x031f('0x1f')](function(_0x33926c){return _0x33926c;});}return null;};}function removeEntity(_0x451328,_0x4d6706){return function(_0x5c4184){if(_0x5c4184){return _0x5c4184[_0x031f('0x20')]()['then'](function(){_0x451328[_0x031f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d054,_0x47d639){return function(_0x971691){if(!_0x971691){_0x54d054[_0x031f('0x16')](0x194);}return _0x971691;};}function handleError(_0x2920cd,_0x4c8126){_0x4c8126=_0x4c8126||0x1f4;return function(_0x494568){logger[_0x031f('0x21')](_0x494568['stack']);if(_0x494568[_0x031f('0x22')]){delete _0x494568[_0x031f('0x22')];}_0x2920cd[_0x031f('0x17')](_0x4c8126)['send'](_0x494568);};}exports[_0x031f('0x23')]=function(_0x3b2a51,_0x54b44e){var _0x3847b2={},_0x28a617={},_0x2403e9={'count':0x0,'rows':[]};var _0x5395ea=db[_0x031f('0x24')][_0x031f('0x25')];_0x28a617[_0x031f('0x26')]=_[_0x031f('0x27')](_0x5395ea);_0x28a617[_0x031f('0x28')]=_[_0x031f('0x27')](_0x3b2a51['query']);_0x28a617[_0x031f('0x29')]=_[_0x031f('0x2a')](_0x28a617[_0x031f('0x26')],_0x28a617[_0x031f('0x28')]);_0x3847b2[_0x031f('0x2b')]=_[_0x031f('0x2a')](_0x28a617[_0x031f('0x26')],qs[_0x031f('0x2c')](_0x3b2a51[_0x031f('0x28')][_0x031f('0x2c')]));_0x3847b2[_0x031f('0x2b')]=_0x3847b2['attributes'][_0x031f('0x2d')]?_0x3847b2[_0x031f('0x2b')]:_0x28a617[_0x031f('0x26')];if(!_0x3b2a51[_0x031f('0x28')][_0x031f('0x2e')](_0x031f('0x2f'))){_0x3847b2[_0x031f('0x30')]=qs[_0x031f('0x30')](_0x3b2a51[_0x031f('0x28')][_0x031f('0x30')]);_0x3847b2[_0x031f('0x1a')]=qs[_0x031f('0x1a')](_0x3b2a51[_0x031f('0x28')]['offset']);}_0x3847b2[_0x031f('0x31')]=qs[_0x031f('0x32')](_0x3b2a51['query'][_0x031f('0x32')]);_0x3847b2[_0x031f('0x33')]=qs['filters'](_[_0x031f('0x34')](_0x3b2a51[_0x031f('0x28')],_0x28a617[_0x031f('0x29')]));if(_0x3b2a51[_0x031f('0x28')]['filter']){_0x3847b2['where']=_[_0x031f('0x35')](_0x3847b2['where'],{'$or':_[_0x031f('0x36')](_0x5395ea,function(_0x2aa0aa){if(_0x2aa0aa[_0x031f('0x37')]['key']!=='VIRTUAL'){var _0x3c1e48={};_0x3c1e48[_0x2aa0aa['field']]={'$like':'%'+_0x3b2a51['query'][_0x031f('0x38')]+'%'};return _0x3c1e48;}})});}_0x3847b2=_[_0x031f('0x35')]({},_0x3847b2,_0x3b2a51[_0x031f('0x39')]);var _0x1a44df={'where':_0x3847b2[_0x031f('0x33')]};return db[_0x031f('0x24')][_0x031f('0x3a')](_0x1a44df)['then'](function(_0x17a970){_0x2403e9[_0x031f('0x3a')]=_0x17a970;if(_0x3b2a51[_0x031f('0x28')][_0x031f('0x3b')]){_0x3847b2['include']=[{'all':!![]}];}return db[_0x031f('0x24')][_0x031f('0x3c')](_0x3847b2);})[_0x031f('0x1f')](function(_0x5895f6){_0x2403e9[_0x031f('0x3d')]=_0x5895f6;return _0x2403e9;})[_0x031f('0x1f')](respondWithFilteredResult(_0x54b44e,_0x3847b2))['catch'](handleError(_0x54b44e,null));};exports[_0x031f('0x3e')]=function(_0x268dc7,_0x56a8f3){var _0x4c50b2={'raw':!![],'where':{'id':_0x268dc7[_0x031f('0x3f')]['id']}},_0x178135={};_0x178135[_0x031f('0x26')]=_[_0x031f('0x27')](db[_0x031f('0x24')][_0x031f('0x25')]);_0x178135[_0x031f('0x28')]=_['keys'](_0x268dc7[_0x031f('0x28')]);_0x178135[_0x031f('0x29')]=_['intersection'](_0x178135[_0x031f('0x26')],_0x178135['query']);_0x4c50b2[_0x031f('0x2b')]=_[_0x031f('0x2a')](_0x178135['model'],qs[_0x031f('0x2c')](_0x268dc7[_0x031f('0x28')][_0x031f('0x2c')]));_0x4c50b2['attributes']=_0x4c50b2[_0x031f('0x2b')][_0x031f('0x2d')]?_0x4c50b2[_0x031f('0x2b')]:_0x178135[_0x031f('0x26')];if(_0x268dc7[_0x031f('0x28')][_0x031f('0x3b')]){_0x4c50b2[_0x031f('0x40')]=[{'all':!![]}];}_0x4c50b2=_[_0x031f('0x35')]({},_0x4c50b2,_0x268dc7[_0x031f('0x39')]);return db['FaxApplication'][_0x031f('0x41')](_0x4c50b2)[_0x031f('0x1f')](handleEntityNotFound(_0x56a8f3,null))[_0x031f('0x1f')](respondWithResult(_0x56a8f3,null))[_0x031f('0x42')](handleError(_0x56a8f3,null));};exports[_0x031f('0x43')]=function(_0x2c879c,_0x2111c5){return db[_0x031f('0x24')][_0x031f('0x43')](_0x2c879c['body'],{})[_0x031f('0x1f')](respondWithResult(_0x2111c5,0xc9))['catch'](handleError(_0x2111c5,null));};exports['update']=function(_0x434849,_0x2359d1){if(_0x434849[_0x031f('0x44')]['id']){delete _0x434849[_0x031f('0x44')]['id'];}return db[_0x031f('0x24')]['find']({'where':{'id':_0x434849[_0x031f('0x3f')]['id']}})[_0x031f('0x1f')](handleEntityNotFound(_0x2359d1,null))[_0x031f('0x1f')](saveUpdates(_0x434849['body'],null))[_0x031f('0x1f')](respondWithResult(_0x2359d1,null))[_0x031f('0x42')](handleError(_0x2359d1,null));};exports[_0x031f('0x20')]=function(_0x318829,_0x2c93ea){return db[_0x031f('0x24')]['find']({'where':{'id':_0x318829['params']['id']}})[_0x031f('0x1f')](handleEntityNotFound(_0x2c93ea,null))['then'](removeEntity(_0x2c93ea,null))[_0x031f('0x42')](handleError(_0x2c93ea,null));}; \ No newline at end of file +var _0x1261=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','limit','json','save','update','destroy','error','stack','name','send','FaxApplication','model','keys','filters','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','field','filter','then','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','options','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x5e5530,_0x8715b5){var _0x4d37a7=function(_0x17c023){while(--_0x17c023){_0x5e5530['push'](_0x5e5530['shift']());}};_0x4d37a7(++_0x8715b5);}(_0x1261,0x144));var _0x1126=function(_0x338338,_0x782573){_0x338338=_0x338338-0x0;var _0x3cf852=_0x1261[_0x338338];return _0x3cf852;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e89b,_0x1b364a){_0x1b364a=_0x1b364a||0xcc;return function(_0xd26a32){if(_0xd26a32){return _0x15e89b[_0x1126('0x16')](_0x1b364a);}return _0x15e89b[_0x1126('0x17')](_0x1b364a)[_0x1126('0x18')]();};}function respondWithResult(_0xd8ca42,_0x2048ad){_0x2048ad=_0x2048ad||0xc8;return function(_0x43850b){if(_0x43850b){return _0xd8ca42['status'](_0x2048ad)['json'](_0x43850b);}};}function respondWithFilteredResult(_0x1af673,_0x154e20){return function(_0x279455){if(_0x279455){var _0x4be0c6=_0x279455[_0x1126('0x19')],_0x45149c=_0x154e20[_0x1126('0x1a')],_0x4794a7=_0x154e20['offset']+_0x154e20[_0x1126('0x1b')],_0x35fe9f;if(_0x4794a7>=_0x4be0c6){_0x4794a7=_0x4be0c6;_0x35fe9f=0xc8;}else{_0x35fe9f=0xce;}_0x1af673[_0x1126('0x17')](_0x35fe9f);return _0x1af673['set']('Content-Range',_0x45149c+'-'+_0x4794a7+'/'+_0x4be0c6)[_0x1126('0x1c')](_0x279455);}return null;};}function patchUpdates(_0x2b2487){return function(_0x58d11a){try{jsonpatch['apply'](_0x58d11a,_0x2b2487,!![]);}catch(_0x4564c0){return BPromise['reject'](_0x4564c0);}return _0x58d11a[_0x1126('0x1d')]();};}function saveUpdates(_0x1d6d19,_0x2f70ac){return function(_0x54400a){if(_0x54400a){return _0x54400a[_0x1126('0x1e')](_0x1d6d19)['then'](function(_0x56efeb){return _0x56efeb;});}return null;};}function removeEntity(_0x30f6b3,_0x3a9bed){return function(_0x25b24b){if(_0x25b24b){return _0x25b24b[_0x1126('0x1f')]()['then'](function(){_0x30f6b3[_0x1126('0x17')](0xcc)[_0x1126('0x18')]();});}};}function handleEntityNotFound(_0x48a08d,_0x2175fa){return function(_0x59cd8e){if(!_0x59cd8e){_0x48a08d['sendStatus'](0x194);}return _0x59cd8e;};}function handleError(_0x4b57ab,_0x2199d9){_0x2199d9=_0x2199d9||0x1f4;return function(_0x15bcc3){logger[_0x1126('0x20')](_0x15bcc3[_0x1126('0x21')]);if(_0x15bcc3[_0x1126('0x22')]){delete _0x15bcc3[_0x1126('0x22')];}_0x4b57ab[_0x1126('0x17')](_0x2199d9)[_0x1126('0x23')](_0x15bcc3);};}exports['index']=function(_0x35eec3,_0x375e59){var _0xa293f4={},_0x5ddf63={},_0x541bc9={'count':0x0,'rows':[]};var _0xeb7d89=db[_0x1126('0x24')]['rawAttributes'];_0x5ddf63[_0x1126('0x25')]=_[_0x1126('0x26')](_0xeb7d89);_0x5ddf63['query']=_[_0x1126('0x26')](_0x35eec3['query']);_0x5ddf63[_0x1126('0x27')]=_['intersection'](_0x5ddf63[_0x1126('0x25')],_0x5ddf63['query']);_0xa293f4[_0x1126('0x28')]=_['intersection'](_0x5ddf63['model'],qs['fields'](_0x35eec3[_0x1126('0x29')][_0x1126('0x2a')]));_0xa293f4[_0x1126('0x28')]=_0xa293f4['attributes'][_0x1126('0x2b')]?_0xa293f4[_0x1126('0x28')]:_0x5ddf63['model'];if(!_0x35eec3[_0x1126('0x29')][_0x1126('0x2c')](_0x1126('0x2d'))){_0xa293f4[_0x1126('0x1b')]=qs['limit'](_0x35eec3['query'][_0x1126('0x1b')]);_0xa293f4[_0x1126('0x1a')]=qs[_0x1126('0x1a')](_0x35eec3[_0x1126('0x29')]['offset']);}_0xa293f4[_0x1126('0x2e')]=qs[_0x1126('0x2f')](_0x35eec3[_0x1126('0x29')][_0x1126('0x2f')]);_0xa293f4[_0x1126('0x30')]=qs['filters'](_[_0x1126('0x31')](_0x35eec3[_0x1126('0x29')],_0x5ddf63[_0x1126('0x27')]));if(_0x35eec3[_0x1126('0x29')]['filter']){_0xa293f4['where']=_[_0x1126('0x32')](_0xa293f4[_0x1126('0x30')],{'$or':_['map'](_0xeb7d89,function(_0xde37cf){if(_0xde37cf[_0x1126('0x33')][_0x1126('0x34')]!=='VIRTUAL'){var _0x4b3859={};_0x4b3859[_0xde37cf[_0x1126('0x35')]]={'$like':'%'+_0x35eec3[_0x1126('0x29')][_0x1126('0x36')]+'%'};return _0x4b3859;}})});}_0xa293f4=_[_0x1126('0x32')]({},_0xa293f4,_0x35eec3['options']);var _0x428d3d={'where':_0xa293f4['where']};return db[_0x1126('0x24')][_0x1126('0x19')](_0x428d3d)[_0x1126('0x37')](function(_0x1ea702){_0x541bc9[_0x1126('0x19')]=_0x1ea702;if(_0x35eec3['query'][_0x1126('0x38')]){_0xa293f4[_0x1126('0x39')]=[{'all':!![]}];}return db[_0x1126('0x24')][_0x1126('0x3a')](_0xa293f4);})[_0x1126('0x37')](function(_0x3442b8){_0x541bc9[_0x1126('0x3b')]=_0x3442b8;return _0x541bc9;})['then'](respondWithFilteredResult(_0x375e59,_0xa293f4))[_0x1126('0x3c')](handleError(_0x375e59,null));};exports[_0x1126('0x3d')]=function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'raw':!![],'where':{'id':_0x227a6b['params']['id']}},_0x518de1={};_0x518de1[_0x1126('0x25')]=_[_0x1126('0x26')](db[_0x1126('0x24')][_0x1126('0x3e')]);_0x518de1[_0x1126('0x29')]=_[_0x1126('0x26')](_0x227a6b['query']);_0x518de1['filters']=_['intersection'](_0x518de1[_0x1126('0x25')],_0x518de1['query']);_0xcf0483[_0x1126('0x28')]=_[_0x1126('0x3f')](_0x518de1[_0x1126('0x25')],qs[_0x1126('0x2a')](_0x227a6b['query']['fields']));_0xcf0483[_0x1126('0x28')]=_0xcf0483[_0x1126('0x28')][_0x1126('0x2b')]?_0xcf0483['attributes']:_0x518de1[_0x1126('0x25')];if(_0x227a6b['query'][_0x1126('0x38')]){_0xcf0483['include']=[{'all':!![]}];}_0xcf0483=_[_0x1126('0x32')]({},_0xcf0483,_0x227a6b[_0x1126('0x40')]);return db[_0x1126('0x24')]['find'](_0xcf0483)[_0x1126('0x37')](handleEntityNotFound(_0xf3a0bd,null))[_0x1126('0x37')](respondWithResult(_0xf3a0bd,null))[_0x1126('0x3c')](handleError(_0xf3a0bd,null));};exports['create']=function(_0x58ff3a,_0x4dd7f5){return db[_0x1126('0x24')]['create'](_0x58ff3a[_0x1126('0x41')],{})['then'](respondWithResult(_0x4dd7f5,0xc9))[_0x1126('0x3c')](handleError(_0x4dd7f5,null));};exports[_0x1126('0x1e')]=function(_0x146066,_0x120de1){if(_0x146066[_0x1126('0x41')]['id']){delete _0x146066['body']['id'];}return db[_0x1126('0x24')][_0x1126('0x42')]({'where':{'id':_0x146066['params']['id']}})[_0x1126('0x37')](handleEntityNotFound(_0x120de1,null))[_0x1126('0x37')](saveUpdates(_0x146066['body'],null))[_0x1126('0x37')](respondWithResult(_0x120de1,null))[_0x1126('0x3c')](handleError(_0x120de1,null));};exports['destroy']=function(_0x3e4eeb,_0xbdde58){return db[_0x1126('0x24')]['find']({'where':{'id':_0x3e4eeb[_0x1126('0x43')]['id']}})[_0x1126('0x37')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x37')](removeEntity(_0xbdde58,null))[_0x1126('0x3c')](handleError(_0xbdde58,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c6cf7fc..7a1e239 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 _0x4c4e=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3bebf7,_0x464386){var _0x2f29b1=function(_0x24476a){while(--_0x24476a){_0x3bebf7['push'](_0x3bebf7['shift']());}};_0x2f29b1(++_0x464386);}(_0x4c4e,0x152));var _0xe4c4=function(_0x41b259,_0x362236){_0x41b259=_0x41b259-0x0;var _0x34e617=_0x4c4e[_0x41b259];return _0x34e617;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4c4('0xb'),'collate':_0xe4c4('0xc')});}; \ No newline at end of file +var _0xed1f=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xed1f[_0x2112d4];return _0x434972;};'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':!![],'charset':_0xfed1('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 1962d3f..8474e25 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 _0x07e6=['debug','UpdateFaxApplication','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','message','result','catch','error','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x357812,_0x24b314){var _0x28604d=function(_0x3a9b5d){while(--_0x3a9b5d){_0x357812['push'](_0x357812['shift']());}};_0x28604d(++_0x24b314);}(_0x07e6,0x93));var _0x607e=function(_0x3dcc0d,_0x5b61e0){_0x3dcc0d=_0x3dcc0d-0x0;var _0x454cb0=_0x07e6[_0x3dcc0d];return _0x454cb0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x607e('0x0'));var BPromise=require(_0x607e('0x1'));var rs=require(_0x607e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x607e('0x3'))(_0x607e('0x4'));var config=require(_0x607e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x607e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c49e1,_0x116256,_0xba3fca){return new BPromise(function(_0x39f8e2,_0x215647){return client[_0x607e('0x7')](_0x1c49e1,_0xba3fca)[_0x607e('0x8')](function(_0xe4fca4){logger[_0x607e('0x9')](_0x607e('0xa'),_0x116256,_0x607e('0xb'));logger['debug'](_0x607e('0xc'),_0x116256,'request\x20sent',JSON[_0x607e('0xd')](_0xe4fca4));if(_0xe4fca4['error']){if(_0xe4fca4['error'][_0x607e('0xe')]===0x1f4){logger['error'](_0x607e('0xa'),_0x116256,_0xe4fca4['error'][_0x607e('0xf')]);return _0x215647(_0xe4fca4['error']['message']);}logger['error'](_0x607e('0xa'),_0x116256,_0xe4fca4['error']['message']);return _0x39f8e2(_0xe4fca4['error']['message']);}else{logger[_0x607e('0x9')](_0x607e('0xa'),_0x116256,'request\x20sent');_0x39f8e2(_0xe4fca4[_0x607e('0x10')][_0x607e('0xf')]);}})[_0x607e('0x11')](function(_0x49eeec){logger[_0x607e('0x12')](_0x607e('0xa'),_0x116256,_0x49eeec);_0x215647(_0x49eeec);});});}exports['UpdateFaxApplication']=function(_0x541c76){var _0x4001be=this;return new Promise(function(_0x326273,_0x3f272a){return db[_0x607e('0x13')][_0x607e('0x14')](_0x541c76[_0x607e('0x15')],{'raw':_0x541c76[_0x607e('0x16')]?_0x541c76[_0x607e('0x16')][_0x607e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x541c76[_0x607e('0x16')]?_0x541c76['options'][_0x607e('0x18')]||null:null,'attributes':_0x541c76[_0x607e('0x16')]?_0x541c76['options'][_0x607e('0x19')]||null:null,'limit':_0x541c76[_0x607e('0x16')]?_0x541c76[_0x607e('0x16')][_0x607e('0x1a')]||null:null})[_0x607e('0x8')](function(_0xd87ad0){logger[_0x607e('0x9')]('UpdateFaxApplication',_0x541c76);logger[_0x607e('0x1b')](_0x607e('0x1c'),_0x541c76,JSON[_0x607e('0xd')](_0xd87ad0));_0x326273(_0xd87ad0);})['catch'](function(_0x480edd){logger[_0x607e('0x12')]('UpdateFaxApplication',_0x480edd[_0x607e('0xf')],_0x541c76);_0x3f272a(_0x4001be[_0x607e('0x12')](0x1f4,_0x480edd['message']));});});}; \ No newline at end of file +var _0xda17=['update','body','raw','options','where','attributes','UpdateFaxApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','FaxApplication'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0xda17,0x129));var _0x7da1=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xda17[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x7da1('0x0'));var util=require('util');var moment=require(_0x7da1('0x1'));var BPromise=require(_0x7da1('0x2'));var rs=require(_0x7da1('0x3'));var fs=require('fs');var Redis=require(_0x7da1('0x4'));var db=require(_0x7da1('0x5'))['db'];var utils=require(_0x7da1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7da1('0x7'));var jayson=require(_0x7da1('0x8'));var client=jayson['client'][_0x7da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fe7f,_0x5c1e8a,_0x3c7ff5){return new BPromise(function(_0x5e3ea0,_0x2ad550){return client[_0x7da1('0xa')](_0x20fe7f,_0x3c7ff5)[_0x7da1('0xb')](function(_0x4f21ae){logger['info'](_0x7da1('0xc'),_0x5c1e8a,'request\x20sent');logger[_0x7da1('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5c1e8a,_0x7da1('0xe'),JSON[_0x7da1('0xf')](_0x4f21ae));if(_0x4f21ae[_0x7da1('0x10')]){if(_0x4f21ae['error'][_0x7da1('0x11')]===0x1f4){logger[_0x7da1('0x10')](_0x7da1('0xc'),_0x5c1e8a,_0x4f21ae['error'][_0x7da1('0x12')]);return _0x2ad550(_0x4f21ae[_0x7da1('0x10')][_0x7da1('0x12')]);}logger[_0x7da1('0x10')](_0x7da1('0xc'),_0x5c1e8a,_0x4f21ae[_0x7da1('0x10')][_0x7da1('0x12')]);return _0x5e3ea0(_0x4f21ae[_0x7da1('0x10')]['message']);}else{logger['info'](_0x7da1('0xc'),_0x5c1e8a,'request\x20sent');_0x5e3ea0(_0x4f21ae[_0x7da1('0x13')][_0x7da1('0x12')]);}})[_0x7da1('0x14')](function(_0x2dfd04){logger[_0x7da1('0x10')](_0x7da1('0xc'),_0x5c1e8a,_0x2dfd04);_0x2ad550(_0x2dfd04);});});}exports['UpdateFaxApplication']=function(_0x201c7d){var _0x3718a6=this;return new Promise(function(_0x381917,_0x50730c){return db[_0x7da1('0x15')][_0x7da1('0x16')](_0x201c7d[_0x7da1('0x17')],{'raw':_0x201c7d['options']?_0x201c7d['options'][_0x7da1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201c7d[_0x7da1('0x19')]?_0x201c7d['options'][_0x7da1('0x1a')]||null:null,'attributes':_0x201c7d[_0x7da1('0x19')]?_0x201c7d[_0x7da1('0x19')][_0x7da1('0x1b')]||null:null,'limit':_0x201c7d['options']?_0x201c7d[_0x7da1('0x19')]['limit']||null:null})[_0x7da1('0xb')](function(_0x154cb5){logger['info']('UpdateFaxApplication',_0x201c7d);logger[_0x7da1('0xd')](_0x7da1('0x1c'),_0x201c7d,JSON[_0x7da1('0xf')](_0x154cb5));_0x381917(_0x154cb5);})[_0x7da1('0x14')](function(_0x47b24e){logger[_0x7da1('0x10')](_0x7da1('0x1c'),_0x47b24e[_0x7da1('0x12')],_0x201c7d);_0x50730c(_0x3718a6[_0x7da1('0x10')](0x1f4,_0x47b24e[_0x7da1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index c6b28f8..c034d44 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 _0xeb74=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xeb74,0xe3));var _0x4eb7=function(_0x3b3b8c,_0x1e1db1){_0x3b3b8c=_0x3b3b8c-0x0;var _0x593bfb=_0xeb74[_0x3b3b8c];return _0x593bfb;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var auth=require(_0x4eb7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eb7('0x7'));var controller=require(_0x4eb7('0x8'));router[_0x4eb7('0x9')]('/',auth[_0x4eb7('0xa')](),controller[_0x4eb7('0xb')]);router['get'](_0x4eb7('0xc'),auth['isAuthenticated'](),controller[_0x4eb7('0xd')]);router[_0x4eb7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4eb7('0xf')](_0x4eb7('0xc'),auth['isAuthenticated'](),controller[_0x4eb7('0x10')]);router['delete'](_0x4eb7('0xc'),auth[_0x4eb7('0xa')](),controller[_0x4eb7('0x11')]);module['exports']=router; \ No newline at end of file +var _0xef0f=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x20d8b6,_0x3474b9){var _0x24a54a=function(_0x212714){while(--_0x212714){_0x20d8b6['push'](_0x20d8b6['shift']());}};_0x24a54a(++_0x3474b9);}(_0xef0f,0x168));var _0xfef0=function(_0x2fd8dc,_0x5bc26e){_0x2fd8dc=_0x2fd8dc-0x0;var _0x287a19=_0xef0f[_0x2fd8dc];return _0x287a19;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var auth=require(_0xfef0('0x4'));var interaction=require(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var controller=require('./faxApplication.controller');router[_0xfef0('0x7')]('/',auth[_0xfef0('0x8')](),controller[_0xfef0('0x9')]);router[_0xfef0('0x7')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller['show']);router[_0xfef0('0xb')]('/',auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router[_0xfef0('0xd')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller[_0xfef0('0x10')]);module[_0xfef0('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 cc57082..ea3baad 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 _0xe9cd=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0xe9cd,0x12b));var _0xde9c=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xe9cd[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0xde9c('0x0'));module['exports']={'closed':{'type':Sequelize[_0xde9c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xde9c('0x2')]},'disposition':{'type':Sequelize[_0xde9c('0x3')]},'note':{'type':Sequelize[_0xde9c('0x3')]},'read1stAt':{'type':Sequelize[_0xde9c('0x2')]},'fax':{'type':Sequelize[_0xde9c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xde9c('0x4')]('in',_0xde9c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xde9c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xde9c('0x4')]('in',_0xde9c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf397=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x6a6eb2,_0x40b672){var _0x4c4083=function(_0x145cb7){while(--_0x145cb7){_0x6a6eb2['push'](_0x6a6eb2['shift']());}};_0x4c4083(++_0x40b672);}(_0xf397,0x1ab));var _0x7f39=function(_0x369910,_0x1f2d62){_0x369910=_0x369910-0x0;var _0x56d7d0=_0xf397[_0x369910];return _0x56d7d0;};'use strict';var Sequelize=require(_0x7f39('0x0'));module[_0x7f39('0x1')]={'closed':{'type':Sequelize[_0x7f39('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7f39('0x3')]},'disposition':{'type':Sequelize[_0x7f39('0x4')]},'note':{'type':Sequelize[_0x7f39('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x7f39('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7f39('0x5')]('in',_0x7f39('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7f39('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7f39('0x5')]('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 a4a47c0..4ae3bb1 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 _0x76f4=['includeAll','include','create','body','destroy','find','describe','addMessage','ids','omit','getMessages','findOne','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','join','root','files','server','tmp','interaction-%s.zip','Attachment','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','field','from','tools_tags','me.FaxInteractionId\x20=\x20i.id','me.read\x20=\x20false','select','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','expr','advancedFilter','parse','forEach','createdAt','value','dateStart','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','Messages.count','c.email','isNil','isEmpty','i.FaxAccountId\x20IN\x20?','$gte','filter','replace','\x27\x27\x27\x27','isNumeric','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','read','having','`Messages.count`\x20=\x200','toString','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','%s\x20>\x200','count','sequelize','merge','a.key','Account.key','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.FaxInteractionId\x20IN\x20?','map','groupBy','FaxInteractionId','Users','split','Tags','push','rows','catch','show','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x76f4,0x1b2));var _0x476f=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x76f4[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0x476f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x476f('0x1'));var zipdir=require(_0x476f('0x2'));var jsonpatch=require(_0x476f('0x3'));var rp=require(_0x476f('0x4'));var moment=require(_0x476f('0x5'));var BPromise=require(_0x476f('0x6'));var Mustache=require(_0x476f('0x7'));var util=require(_0x476f('0x8'));var path=require('path');var sox=require(_0x476f('0x9'));var csv=require(_0x476f('0xa'));var ejs=require(_0x476f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x476f('0xc'));var crypto=require(_0x476f('0xd'));var jsforce=require(_0x476f('0xe'));var deskjs=require(_0x476f('0xf'));var toCsv=require(_0x476f('0xa'));var querystring=require(_0x476f('0x10'));var Papa=require(_0x476f('0x11'));var Redis=require('ioredis');var authService=require(_0x476f('0x12'));var qs=require(_0x476f('0x13'));var hardwareService=require(_0x476f('0x14'));var logger=require(_0x476f('0x15'))(_0x476f('0x16'));var utils=require(_0x476f('0x17'));var config=require('../../config/environment');var db=require(_0x476f('0x18'))['db'];config[_0x476f('0x19')]=_[_0x476f('0x1a')](config[_0x476f('0x19')],{'host':_0x476f('0x1b'),'port':0x18eb});var socket=require(_0x476f('0x1c'))(new Redis(config[_0x476f('0x19')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x40bc3b,_0x215e3c){_0x215e3c=_0x215e3c||0xcc;return function(_0x309df9){if(_0x309df9){return _0x40bc3b[_0x476f('0x1d')](_0x215e3c);}return _0x40bc3b['status'](_0x215e3c)[_0x476f('0x1e')]();};}function respondWithResult(_0x9d0bf3,_0x25d384){_0x25d384=_0x25d384||0xc8;return function(_0x513470){if(_0x513470){return _0x9d0bf3[_0x476f('0x1f')](_0x25d384)[_0x476f('0x20')](_0x513470);}};}function respondWithFilteredResult(_0x4e13d1,_0x51226c){return function(_0x4fff1b){if(_0x4fff1b){var _0x1f64ec=_0x4fff1b['count'],_0x36df14=_0x51226c[_0x476f('0x21')],_0x1cdcbc=_0x51226c[_0x476f('0x21')]+_0x51226c[_0x476f('0x22')],_0x2deca9;if(_0x1cdcbc>=_0x1f64ec){_0x1cdcbc=_0x1f64ec;_0x2deca9=0xc8;}else{_0x2deca9=0xce;}_0x4e13d1[_0x476f('0x1f')](_0x2deca9);return _0x4e13d1[_0x476f('0x23')](_0x476f('0x24'),_0x36df14+'-'+_0x1cdcbc+'/'+_0x1f64ec)[_0x476f('0x20')](_0x4fff1b);}return null;};}function patchUpdates(_0x2919e4){return function(_0x372dcc){try{jsonpatch[_0x476f('0x25')](_0x372dcc,_0x2919e4,!![]);}catch(_0x377181){return BPromise[_0x476f('0x26')](_0x377181);}return _0x372dcc[_0x476f('0x27')]();};}function saveUpdates(_0x3bc337,_0x5a95cd){return function(_0x2fc5fe){if(_0x2fc5fe){return _0x2fc5fe[_0x476f('0x28')](_0x3bc337)[_0x476f('0x29')](function(_0x397fb8){return _0x397fb8;});}return null;};}function removeEntity(_0x3049df,_0x1eb119){return function(_0x1f22c4){if(_0x1f22c4){return _0x1f22c4['destroy']()[_0x476f('0x29')](function(){_0x3049df[_0x476f('0x1f')](0xcc)[_0x476f('0x1e')]();});}};}function handleEntityNotFound(_0x4641e4,_0x464126){return function(_0x28d24c){if(!_0x28d24c){_0x4641e4[_0x476f('0x1d')](0x194);}return _0x28d24c;};}function handleError(_0x30c0db,_0x41ce9a){_0x41ce9a=_0x41ce9a||0x1f4;return function(_0x238c32){logger[_0x476f('0x2a')](_0x238c32[_0x476f('0x2b')]);if(_0x238c32[_0x476f('0x2c')]){delete _0x238c32[_0x476f('0x2c')];}_0x30c0db[_0x476f('0x1f')](_0x41ce9a)[_0x476f('0x2d')](_0x238c32);};}exports[_0x476f('0x2e')]=function(_0x18c1c0,_0xd1c4f2){var _0x51e155={},_0x42064b={},_0x4c2055={'count':0x0,'rows':[]};var _0x193810=db[_0x476f('0x2f')][_0x476f('0x30')];_0x42064b[_0x476f('0x31')]=_[_0x476f('0x32')](_0x193810);_0x42064b['query']=_['keys'](_0x18c1c0[_0x476f('0x33')]);_0x42064b[_0x476f('0x34')]=_[_0x476f('0x35')](_0x42064b[_0x476f('0x31')],_0x42064b[_0x476f('0x33')]);_0x51e155[_0x476f('0x36')]=_['intersection'](_0x42064b[_0x476f('0x31')],qs['fields'](_0x18c1c0['query'][_0x476f('0x37')]));_0x51e155[_0x476f('0x36')]=_0x51e155[_0x476f('0x36')][_0x476f('0x38')]?_0x51e155['attributes']:_0x42064b[_0x476f('0x31')];if(!_0x18c1c0[_0x476f('0x33')]['hasOwnProperty']('nolimit')){_0x51e155[_0x476f('0x22')]=qs['limit'](_0x18c1c0[_0x476f('0x33')]['limit']);_0x51e155[_0x476f('0x21')]=qs[_0x476f('0x21')](_0x18c1c0[_0x476f('0x33')][_0x476f('0x21')]);}_0x51e155[_0x476f('0x39')]=qs['sort'](_0x18c1c0[_0x476f('0x33')][_0x476f('0x3a')]);_0x51e155[_0x476f('0x3b')]=qs['filters'](_['pick'](_0x18c1c0[_0x476f('0x33')],_0x42064b['filters']));var _0x51c43d=[];var _0x4d6d49=squel['select']()['field']('id')[_0x476f('0x3c')]('name')[_0x476f('0x3c')]('color')[_0x476f('0x3d')](_0x476f('0x3e'));var _0x59e628=squel['select']()['field']('COUNT(*)')[_0x476f('0x3d')]('fax_messages','me')[_0x476f('0x3b')](_0x476f('0x3f'))['where']('me.direction\x20=\x20\x27in\x27')[_0x476f('0x3b')](_0x476f('0x40'));var _0x17b58e=squel[_0x476f('0x41')]()[_0x476f('0x3c')](_0x476f('0x42'))[_0x476f('0x3c')](_0x476f('0x43'))[_0x476f('0x3d')](_0x476f('0x44'),'ui')[_0x476f('0x45')](_0x476f('0x46'),'u',_0x476f('0x47'));var _0x211cac=squel[_0x476f('0x41')]()[_0x476f('0x3d')](_0x476f('0x48'),'i')[_0x476f('0x45')](_0x476f('0x44'),'ui',_0x476f('0x49'))[_0x476f('0x45')](_0x476f('0x46'),'u','u.id\x20=\x20ui.UserId')['left_join'](_0x476f('0x4a'),'c',_0x476f('0x4b'))[_0x476f('0x45')](_0x476f('0x46'),'o','o.id\x20=\x20i.UserId')[_0x476f('0x45')](_0x476f('0x4c'),'a',_0x476f('0x4d'))[_0x476f('0x45')](_0x476f('0x4e'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x25e80f=squel[_0x476f('0x4f')]();if(_0x18c1c0[_0x476f('0x33')][_0x476f('0x50')]){var _0x133d21=JSON[_0x476f('0x51')](_0x18c1c0['query']['advancedFilter']);_[_0x476f('0x32')](_0x133d21)[_0x476f('0x52')](function(_0x49db9e){var _0x3b5a59=_0x133d21[_0x49db9e];if(_0x49db9e===_0x476f('0x53')){var _0x2d5e5b=moment(_0x3b5a59[_0x476f('0x54')][_0x476f('0x55')])['startOf'](_0x476f('0x56'))[_0x476f('0x57')]()[_0x476f('0x58')]();var _0x31e42d=moment(_0x31e42d)['utc']()['endOf'](_0x476f('0x56'))[_0x476f('0x58')]();_0x25e80f[_0x476f('0x59')](_0x476f('0x5a'),_0x2d5e5b,_0x31e42d);}else{if(_[_0x476f('0x5b')](_0x3b5a59['condition'])){_0x3b5a59[_0x476f('0x5c')][_0x476f('0x52')](function(_0x344d80){switch(_0x3b5a59['condition']['value']){case'IS':if(_0x49db9e!==_0x476f('0x5d')&&_0x49db9e!=='Messages.count'){if(_['isArray'](_0x3b5a59['value'])&&_0x3b5a59[_0x476f('0x54')][_0x476f('0x38')]>0x1){_0x25e80f['and'](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x5f'),_0x3b5a59[_0x476f('0x54')]);}else{_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x60'),_0x3b5a59['value'][0x0]);}}break;case'=':_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x60'),_0x3b5a59[_0x476f('0x54')]);break;case'LIKE':if(_0x49db9e===_0x476f('0x61')){_0x25e80f[_0x476f('0x59')](_0x476f('0x62')+'\x20LIKE\x20?','%'+_0x3b5a59[_0x476f('0x54')]+'%');_0x25e80f['or'](_0x476f('0x63')+_0x476f('0x64'),'%'+_0x3b5a59['value']+'%');_0x25e80f['or']('c.email'+'\x20LIKE\x20?','%'+_0x3b5a59[_0x476f('0x54')]+'%');}else{_0x25e80f[_0x476f('0x59')](_0x3b5a59['tableAlias']+'.'+_0x49db9e+_0x476f('0x64'),'%'+_0x3b5a59[_0x476f('0x54')]+'%');}break;case'>':_0x25e80f['and'](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x65'),_0x3b5a59[_0x476f('0x54')]);break;case'<':_0x25e80f['and'](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x66'),_0x3b5a59[_0x476f('0x54')]);break;}});}else{switch(_0x3b5a59[_0x476f('0x5c')][_0x476f('0x54')]){case'IS':if(_0x49db9e!==_0x476f('0x5d')&&_0x49db9e!==_0x476f('0x67')){if(_['isArray'](_0x3b5a59[_0x476f('0x54')])&&_0x3b5a59[_0x476f('0x54')]['length']>0x1){_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x5f'),_0x3b5a59[_0x476f('0x54')]);}else{_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x60'),_0x3b5a59[_0x476f('0x54')][0x0]);}}break;case'=':_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x60'),_0x3b5a59['value']);break;case'LIKE':if(_0x49db9e===_0x476f('0x61')){_0x25e80f[_0x476f('0x59')](_0x476f('0x62')+_0x476f('0x64'),'%'+_0x3b5a59[_0x476f('0x54')]+'%');_0x25e80f['or'](_0x476f('0x63')+_0x476f('0x64'),'%'+_0x3b5a59[_0x476f('0x54')]+'%');_0x25e80f['or'](_0x476f('0x68')+_0x476f('0x64'),'%'+_0x3b5a59[_0x476f('0x54')]+'%');}else{_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x64'),'%'+_0x3b5a59[_0x476f('0x54')]+'%');}break;case'>':_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x65'),_0x3b5a59[_0x476f('0x54')]);break;case'<':_0x25e80f[_0x476f('0x59')](_0x3b5a59[_0x476f('0x5e')]+'.'+_0x49db9e+_0x476f('0x66'),_0x3b5a59[_0x476f('0x54')]);break;}}}});}else{var _0x5d1f45=_(Object[_0x476f('0x32')](_0x18c1c0[_0x476f('0x33')]))['map'](function(_0x38ec75){return _0x193810['hasOwnProperty'](_0x38ec75)?_0x38ec75:undefined;})['filter'](function(_0x512a64){return!_[_0x476f('0x69')](_0x512a64);})[_0x476f('0x54')]();if(!_[_0x476f('0x6a')](_0x5d1f45)){_0x5d1f45['forEach'](function(_0x41e413){if(_0x41e413==='FaxAccountId'){_0x211cac[_0x476f('0x3b')](_0x476f('0x6b'),[]['concat'](_0x18c1c0[_0x476f('0x33')][_0x41e413]));}else if(_0x41e413==='createdAt'){var _0x16b555=JSON[_0x476f('0x51')](_0x18c1c0['query'][_0x41e413])[_0x476f('0x6c')];var _0x15a3e4=JSON[_0x476f('0x51')](_0x18c1c0[_0x476f('0x33')][_0x41e413])['$lte'];_0x211cac[_0x476f('0x3b')](_0x476f('0x5a'),_0x16b555,_0x15a3e4);}else{_0x211cac['where']('i.'+_0x41e413+_0x476f('0x60'),_0x18c1c0[_0x476f('0x33')][_0x41e413]);}});}if(_0x18c1c0['query'][_0x476f('0x6d')]){var _0x1bc40e=_0x18c1c0[_0x476f('0x33')]['filter'][_0x476f('0x6e')]('\x5c','\x5c\x5c')[_0x476f('0x6e')]('\x27\x27',_0x476f('0x6f'));if(qs[_0x476f('0x70')](_0x1bc40e)){_0x25e80f['or']('i.id\x20LIKE\x20?',_0x1bc40e+'%')['or']('i.fax\x20LIKE\x20?',_0x1bc40e+'%');}_0x25e80f['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1bc40e+'%');}}_0x211cac[_0x476f('0x3b')](_0x25e80f);if(_0x51e155[_0x476f('0x39')]){_0x51e155[_0x476f('0x39')][_0x476f('0x52')](function(_0x54a512){_0x211cac[_0x476f('0x39')]('i.'+_0x54a512[0x0],_0x54a512[0x1]===_0x476f('0x71')?![]:!![]);});}_0x211cac[_0x476f('0x72')](_0x476f('0x73'));var _0x1d7bd2={'type':db[_0x476f('0x74')][_0x476f('0x75')][_0x476f('0x76')],'raw':!![]};var _0x435195=_0x211cac[_0x476f('0x77')]()[_0x476f('0x3c')](_0x476f('0x78'));if(!_0x18c1c0[_0x476f('0x33')][_0x476f('0x50')]){if(_0x18c1c0['query'][_0x476f('0x79')]){if(_0x18c1c0['query'][_0x476f('0x79')]==0x1){_0x435195[_0x476f('0x3b')](util[_0x476f('0x58')]('%s\x20=\x200',_0x59e628['toString']()));_0x211cac[_0x476f('0x7a')](_0x476f('0x7b'));}else{_0x435195[_0x476f('0x3b')](util[_0x476f('0x58')]('%s\x20>\x200',_0x59e628[_0x476f('0x7c')]()));_0x211cac[_0x476f('0x7a')]('`Messages.count`\x20>\x200');}}if(_0x18c1c0['query'][_0x476f('0x7d')]){var _0x127a19=_[_0x476f('0x5b')](_0x18c1c0[_0x476f('0x33')][_0x476f('0x7d')])?_0x18c1c0['query'][_0x476f('0x7d')]:new Array(_0x18c1c0[_0x476f('0x33')][_0x476f('0x7d')]);var _0x242f92=squel[_0x476f('0x4f')]();_0x127a19['forEach'](function(_0x3cce0e){_0x242f92['or'](_0x476f('0x7e'),'%,'+_0x3cce0e+',%');});_0x211cac[_0x476f('0x7a')](_0x242f92);_0x435195[_0x476f('0x45')](_0x476f('0x7f'),'it',_0x476f('0x80'));_0x435195[_0x476f('0x45')](_0x476f('0x3e'),'t',_0x476f('0x81'));_0x435195[_0x476f('0x3b')](_0x476f('0x82'),_0x127a19);}}else{var _0x133d21=JSON[_0x476f('0x51')](_0x18c1c0[_0x476f('0x33')][_0x476f('0x50')]);_[_0x476f('0x32')](_0x133d21)[_0x476f('0x52')](function(_0x21c4b1){var _0x451721=_0x133d21[_0x21c4b1];if(_0x21c4b1==='TagId'){var _0xc3e54b=_0x451721['value'];var _0x438646=squel[_0x476f('0x4f')]();_0xc3e54b['forEach'](function(_0x84e81){_0x438646['or'](_0x476f('0x7e'),'%,'+_0x84e81+',%');});_0x211cac[_0x476f('0x7a')](_0x438646);_0x435195['left_join']('mail_interaction_has_tags','it',_0x476f('0x83'));_0x435195[_0x476f('0x45')](_0x476f('0x3e'),'t',_0x476f('0x81'));_0x435195[_0x476f('0x3b')]('t.id\x20IN\x20?',_0xc3e54b);}else if(_0x21c4b1==='Messages.count'){if(_0x451721['value']['length']===0x1){if(_0x451721[_0x476f('0x54')][0x0]===0x1){_0x435195[_0x476f('0x3b')](util[_0x476f('0x58')]('%s\x20=\x200',_0x59e628[_0x476f('0x7c')]()));_0x211cac[_0x476f('0x7a')](_0x476f('0x7b'));}else{_0x435195[_0x476f('0x3b')](util[_0x476f('0x58')](_0x476f('0x84'),_0x59e628[_0x476f('0x7c')]()));_0x211cac[_0x476f('0x7a')]('`Messages.count`\x20>\x200');}}}});}db['sequelize'][_0x476f('0x33')](_0x435195[_0x476f('0x7c')](),_0x1d7bd2)[_0x476f('0x29')](function(_0x5d7c55){_0x4c2055[_0x476f('0x85')]=_0x5d7c55[_0x476f('0x38')];if(_0x4c2055[_0x476f('0x85')]===0x0)return[];return db[_0x476f('0x86')][_0x476f('0x33')](_0x4d6d49[_0x476f('0x7c')](),_0x1d7bd2)['then'](function(_0x442eaa){_0x51c43d=_['keyBy'](_0x442eaa,'id');_0x1d7bd2=_[_0x476f('0x87')](_0x1d7bd2,{'model':db[_0x476f('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x211cac[_0x476f('0x3c')](_0x59e628,'Messages.count');_0x211cac[_0x476f('0x3c')](_0x476f('0x88'),_0x476f('0x89'));_0x211cac[_0x476f('0x3c')]('i.*');_0x211cac[_0x476f('0x3c')]('c.firstName',_0x476f('0x8a'));_0x211cac['field'](_0x476f('0x63'),_0x476f('0x8b'));_0x211cac[_0x476f('0x3c')](_0x476f('0x68'),'Contact.email');_0x211cac[_0x476f('0x3c')](_0x476f('0x8c'),_0x476f('0x8d'));_0x211cac[_0x476f('0x3c')](_0x476f('0x8e'),'Contact.mobile');_0x211cac['field']('c.fax',_0x476f('0x8f'));_0x211cac[_0x476f('0x3c')](_0x476f('0x90'),_0x476f('0x91'));_0x211cac[_0x476f('0x3c')](_0x476f('0x92'),_0x476f('0x93'));_0x211cac[_0x476f('0x45')](_0x476f('0x7f'),'it',_0x476f('0x80'));_0x211cac[_0x476f('0x45')](_0x476f('0x3e'),'t','t.id\x20=\x20it.TagId');_0x211cac['limit'](_0x51e155[_0x476f('0x22')]);_0x211cac['offset'](_0x51e155['offset']);return db[_0x476f('0x86')]['query'](_0x211cac[_0x476f('0x7c')](),_0x1d7bd2);})['then'](function(_0x16238e){_0x17b58e[_0x476f('0x3b')](_0x476f('0x94'),_[_0x476f('0x95')](_0x16238e,'id'));return db[_0x476f('0x86')][_0x476f('0x33')](_0x17b58e[_0x476f('0x7c')](),_0x1d7bd2)[_0x476f('0x29')](function(_0x16cb75){var _0x239c63=_[_0x476f('0x96')](_0x16cb75,_0x476f('0x97'));_0x16238e[_0x476f('0x52')](function(_0x3176e9){if(_0x239c63[_0x3176e9['id']]){_0x3176e9[_0x476f('0x98')]=_[_0x476f('0x95')](_0x239c63[_0x3176e9['id']],function(_0x4a6e57){return{'id':_0x4a6e57['id']};});}if(_0x3176e9[_0x476f('0x93')]){_0x3176e9['Tags']=[];_0x3176e9[_0x476f('0x93')][_0x476f('0x99')](',')[_0x476f('0x52')](function(_0x25c39b){_0x3176e9[_0x476f('0x9a')][_0x476f('0x9b')](_0x51c43d[_0x25c39b]);});}delete _0x3176e9['TagIds'];});return _0x16238e;});});})[_0x476f('0x29')](function(_0xbe62b4){_0x4c2055[_0x476f('0x9c')]=_0xbe62b4;return _0x4c2055;})['then'](respondWithFilteredResult(_0xd1c4f2,_0x51e155))[_0x476f('0x9d')](handleError(_0xd1c4f2,null));};exports[_0x476f('0x9e')]=function(_0x56dd8e,_0x39ecf1){var _0x18cb05={'raw':![],'where':{'id':_0x56dd8e[_0x476f('0x9f')]['id']}},_0x542c31={};_0x542c31[_0x476f('0x31')]=_[_0x476f('0x32')](db['FaxInteraction'][_0x476f('0x30')]);_0x542c31[_0x476f('0x33')]=_['keys'](_0x56dd8e['query']);_0x542c31[_0x476f('0x34')]=_[_0x476f('0x35')](_0x542c31[_0x476f('0x31')],_0x542c31[_0x476f('0x33')]);_0x18cb05['attributes']=_[_0x476f('0x35')](_0x542c31['model'],qs[_0x476f('0x37')](_0x56dd8e[_0x476f('0x33')]['fields']));_0x18cb05[_0x476f('0x36')]=_0x18cb05['attributes'][_0x476f('0x38')]?_0x18cb05[_0x476f('0x36')]:_0x542c31[_0x476f('0x31')];if(_0x56dd8e['query'][_0x476f('0xa0')]){_0x18cb05[_0x476f('0xa1')]=[{'all':!![]}];}_0x18cb05=_[_0x476f('0x87')]({},_0x18cb05,_0x56dd8e['options']);return db[_0x476f('0x2f')]['find'](_0x18cb05)[_0x476f('0x29')](handleEntityNotFound(_0x39ecf1,null))[_0x476f('0x29')](respondWithResult(_0x39ecf1,null))[_0x476f('0x9d')](handleError(_0x39ecf1,null));};exports['create']=function(_0x1acc5a,_0x1679f3){return db[_0x476f('0x2f')][_0x476f('0xa2')](_0x1acc5a[_0x476f('0xa3')],{})[_0x476f('0x29')](respondWithResult(_0x1679f3,0xc9))[_0x476f('0x9d')](handleError(_0x1679f3,null));};exports['update']=function(_0x522ac9,_0x5fbf5e){if(_0x522ac9['body']['id']){delete _0x522ac9[_0x476f('0xa3')]['id'];}return db[_0x476f('0x2f')]['find']({'where':{'id':_0x522ac9[_0x476f('0x9f')]['id']}})[_0x476f('0x29')](handleEntityNotFound(_0x5fbf5e,null))['then'](saveUpdates(_0x522ac9[_0x476f('0xa3')],null))[_0x476f('0x29')](respondWithResult(_0x5fbf5e,null))[_0x476f('0x9d')](handleError(_0x5fbf5e,null));};exports[_0x476f('0xa4')]=function(_0x39d33e,_0x4c7856){return db[_0x476f('0x2f')][_0x476f('0xa5')]({'where':{'id':_0x39d33e[_0x476f('0x9f')]['id']}})['then'](handleEntityNotFound(_0x4c7856,null))[_0x476f('0x29')](removeEntity(_0x4c7856,null))['catch'](handleError(_0x4c7856,null));};exports[_0x476f('0xa6')]=function(_0x2ea8ae,_0x506013){return db['FaxInteraction']['describe']()[_0x476f('0x29')](respondWithResult(_0x506013,null))['catch'](handleError(_0x506013,null));};exports[_0x476f('0xa7')]=function(_0x46303d,_0xcf5834,_0x1b8fb1){return db['FaxMessage'][_0x476f('0xa5')]({'where':{'id':_0x46303d[_0x476f('0x9f')]['id']}})[_0x476f('0x29')](handleEntityNotFound(_0xcf5834,null))[_0x476f('0x29')](function(_0x3c4cc8){if(_0x3c4cc8){return _0x3c4cc8[_0x476f('0xa7')](_0x46303d[_0x476f('0xa3')][_0x476f('0xa8')],_[_0x476f('0xa9')](_0x46303d[_0x476f('0xa3')],[_0x476f('0xa8'),'id'])||{});}})[_0x476f('0x29')](respondWithResult(_0xcf5834,null))[_0x476f('0x9d')](handleError(_0xcf5834,null));};exports[_0x476f('0xaa')]=function(_0xc4b384,_0x58b51f,_0x4bff09){var _0x2c4c79={'raw':![],'where':{}};var _0x25ca4d={};var _0x54ef60={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x476f('0xab')]({'where':{'id':_0xc4b384['params']['id']}})['then'](handleEntityNotFound(_0x58b51f,null))[_0x476f('0x29')](function(_0x2c3e7b){if(_0x2c3e7b){_0x25ca4d[_0x476f('0x31')]=_[_0x476f('0x32')](db['FaxMessage']['rawAttributes']);_0x25ca4d['query']=_[_0x476f('0x32')](_0xc4b384[_0x476f('0x33')]);_0x25ca4d['filters']=_[_0x476f('0x35')](_0x25ca4d[_0x476f('0x31')],_0x25ca4d[_0x476f('0x33')]);_0x2c4c79[_0x476f('0x36')]=_['intersection'](_0x25ca4d[_0x476f('0x31')],qs[_0x476f('0x37')](_0xc4b384['query'][_0x476f('0x37')]));_0x2c4c79[_0x476f('0x36')]=_0x2c4c79[_0x476f('0x36')]['length']?_0x2c4c79[_0x476f('0x36')]:_0x25ca4d['model'];if(!_0xc4b384[_0x476f('0x33')]['hasOwnProperty'](_0x476f('0xac'))){_0x2c4c79['limit']=qs[_0x476f('0x22')](_0xc4b384['query'][_0x476f('0x22')]);_0x2c4c79[_0x476f('0x21')]=qs[_0x476f('0x21')](_0xc4b384[_0x476f('0x33')]['offset']);}_0x2c4c79[_0x476f('0x39')]=qs['sort'](_0xc4b384[_0x476f('0x33')][_0x476f('0x3a')]);_0x2c4c79[_0x476f('0x3b')]=qs[_0x476f('0x34')](_[_0x476f('0xad')](_0xc4b384[_0x476f('0x33')],_0x25ca4d[_0x476f('0x34')]));_0x2c4c79['where'][_0x476f('0x97')]=_0x2c3e7b['id'];if(_0xc4b384[_0x476f('0x33')][_0x476f('0x6d')]){_0x2c4c79[_0x476f('0x3b')]=_[_0x476f('0x87')](_0x2c4c79['where'],{'$or':_[_0x476f('0x95')](_0x2c4c79['attributes'],function(_0xe65744){var _0x3708bf={};_0x3708bf[_0xe65744]={'$like':'%'+_0xc4b384[_0x476f('0x33')][_0x476f('0x6d')]+'%'};return _0x3708bf;})});}if(_0xc4b384[_0x476f('0x33')][_0x476f('0x6c')]){var _0x2879b0=_0xc4b384[_0x476f('0x33')][_0x476f('0x6c')]['split'](',');var _0x56b11a={};_0x56b11a[_0x2879b0[0x0]]={'$gte':moment(_0x2879b0[0x1])[_0x476f('0x58')](_0x476f('0xae'))};_0x2c4c79[_0x476f('0x3b')]=_['merge'](_0x2c4c79[_0x476f('0x3b')],_0x56b11a);}_0x2c4c79=_[_0x476f('0x87')]({},_0x2c4c79,_0xc4b384['options']);return db['FaxMessage']['count']({'where':_0x2c4c79[_0x476f('0x3b')]})['then'](function(_0x53a41d){_0x54ef60[_0x476f('0x85')]=_0x53a41d;if(_0xc4b384['query'][_0x476f('0xa0')]){_0x2c4c79[_0x476f('0xa1')]=[{'all':!![]}];}return db[_0x476f('0xaf')][_0x476f('0xb0')](_0x2c4c79);})[_0x476f('0x29')](function(_0x13f041){_0x54ef60[_0x476f('0x9c')]=_0x13f041;return _0x54ef60;});}})['then'](respondWithFilteredResult(_0x58b51f,_0x2c4c79))[_0x476f('0x9d')](handleError(_0x58b51f,null));};exports[_0x476f('0xb1')]=function(_0x352f24,_0x12b757,_0x4cbe80){return db['FaxInteraction'][_0x476f('0xa5')]({'where':{'id':_0x352f24[_0x476f('0x9f')]['id']}})[_0x476f('0x29')](handleEntityNotFound(_0x12b757,null))[_0x476f('0x29')](function(_0x1d1510){if(_0x1d1510){return _0x1d1510['setTags'](_0x352f24[_0x476f('0xa3')][_0x476f('0xa8')],_[_0x476f('0xa9')](_0x352f24[_0x476f('0xa3')],[_0x476f('0xa8'),'id'])||{})[_0x476f('0xb2')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x352f24['body'][_0x476f('0xa8')]}});})['then'](function(_0x4b65c7){socket[_0x476f('0xb3')](_0x476f('0xb4'),{'id':Number(_0x352f24[_0x476f('0x9f')]['id']),'tags':_0x4b65c7||[]});return{'id':Number(_0x352f24[_0x476f('0x9f')]['id']),'tags':_0x4b65c7||[]};});}})[_0x476f('0x29')](respondWithResult(_0x12b757,null))[_0x476f('0x9d')](handleError(_0x12b757,null));};exports[_0x476f('0xb5')]=function(_0x4b884c,_0x350e59,_0xef000c){return db[_0x476f('0x2f')][_0x476f('0xa5')]({'where':{'id':_0x4b884c[_0x476f('0x9f')]['id']}})['then'](handleEntityNotFound(_0x350e59,null))[_0x476f('0x29')](function(_0x44568b){if(_0x44568b){return _0x44568b['removeTags'](_0x4b884c['query']['ids']);}})['then'](respondWithStatusCode(_0x350e59,null))[_0x476f('0x9d')](handleError(_0x350e59,null));};exports[_0x476f('0xb6')]=function(_0xb7ef72,_0x179d7f){var _0x58490f=moment()['unix']()['toString']();var _0x569975=path[_0x476f('0xb7')](config[_0x476f('0xb8')],'server',_0x476f('0xb9'),'attachments');var _0x1da834=path['join'](config[_0x476f('0xb8')],_0x476f('0xba'),_0x476f('0xb9'),_0x476f('0xbb'));var _0x36222d=path['join'](_0x1da834,_0x58490f);var _0x2b11f0=util['format'](_0x476f('0xbc'),_0x58490f);var _0x26febf=path[_0x476f('0xb7')](_0x1da834,_0x2b11f0);var _0x383eb3=![];return db[_0x476f('0x2f')][_0x476f('0xa5')]({'where':{'id':_0xb7ef72[_0x476f('0x9f')]['id']}})['then'](handleEntityNotFound(_0x179d7f,null))[_0x476f('0x29')](function(_0x4719d2){if(_0x4719d2){return _0x4719d2[_0x476f('0xaa')]({'attributes':['id',_0x476f('0xa3'),'createdAt'],'include':[{'model':db['Attachment'],'as':_0x476f('0xbd')}]});}return[];})['then'](function(_0x3e6370){_0x383eb3=_0x3e6370[_0x476f('0x38')];if(_0x3e6370[_0x476f('0x38')]){fs[_0x476f('0xbe')](_0x36222d);for(var _0x489b23=0x0;_0x489b23<_0x3e6370['length'];_0x489b23++){var _0x23173b=_0x3e6370[_0x489b23];var _0x3fe5a1=_0x23173b[_0x476f('0xbd')];if(_0x3fe5a1){var _0x14b10d=path[_0x476f('0xb7')](_0x569975,_0x3fe5a1['basename']);if(fs[_0x476f('0xbf')](_0x14b10d)){fs[_0x476f('0xc0')](_0x14b10d)[_0x476f('0xc1')](fs[_0x476f('0xc2')](path['join'](_0x36222d,_0x3fe5a1['basename'])));}}}}})[_0x476f('0x29')](function(){if(_0x383eb3){return new BPromise(function(_0xf6d9d2,_0x1465bc){zipdir(_0x36222d,{'saveTo':_0x26febf},function(_0x23768f,_0x5b943a){if(_0x23768f)return _0x1465bc(_0x23768f);return _0xf6d9d2(_0x5b943a);});});}})[_0x476f('0x29')](function(){if(_0x383eb3){return new BPromise(function(_0x380bb0,_0x4ec195){rimraf(_0x36222d,function(_0x54e37c){if(_0x54e37c)_0x4ec195(_0x54e37c);return _0x380bb0();});});}})[_0x476f('0x29')](function(){if(_0x383eb3){return _0x179d7f['download'](_0x26febf,_0x2b11f0,function(_0x1e286b){if(_0x1e286b){console[_0x476f('0xc3')](_0x476f('0xc4'),_0x1e286b);}else{fs[_0x476f('0xc5')](_0x26febf);}});}else{return _0x179d7f[_0x476f('0x1d')](0xc8);}})['catch'](handleError(_0x179d7f,null));}; \ No newline at end of file +var _0x8cbc=['t.id\x20IN\x20?','expr','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','Messages.count','toString','sequelize','merge','FaxInteraction','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','fax_interaction_has_tags','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','Users','split','Tags','push','rows','catch','show','params','includeAll','options','find','create','body','describe','addMessage','ids','getMessages','findOne','FaxMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','removeTags','download','join','root','server','attachments','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','json','count','limit','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','send','index','rawAttributes','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','offset','order','sort','pick','select','field','color','from','tools_tags','me.FaxInteractionId\x20=\x20i.id','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.FaxInteractionId','left_join','users','user_has_fax_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','advancedFilter','createdAt','dateStart','startOf','day','format','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','tableAlias','and','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','TagId','length','\x20IN\x20?','c.firstName','map','filter','isNil','isEmpty','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','SELECT','clone','COUNT(*)','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.FaxInteractionId\x20=\x20i.id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8cbc,0x1cf));var _0xc8cb=function(_0x3e8dda,_0x35270c){_0x3e8dda=_0x3e8dda-0x0;var _0x574f34=_0x8cbc[_0x3e8dda];return _0x574f34;};'use strict';var pdf=require(_0xc8cb('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8cb('0x1'));var jsonpatch=require(_0xc8cb('0x2'));var rp=require(_0xc8cb('0x3'));var moment=require(_0xc8cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8cb('0x5'));var util=require(_0xc8cb('0x6'));var path=require(_0xc8cb('0x7'));var sox=require(_0xc8cb('0x8'));var csv=require('to-csv');var ejs=require(_0xc8cb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc8cb('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8cb('0xb'));var deskjs=require(_0xc8cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc8cb('0xd'));var Papa=require(_0xc8cb('0xe'));var Redis=require(_0xc8cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc8cb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8cb('0x11'));var utils=require(_0xc8cb('0x12'));var config=require(_0xc8cb('0x13'));var db=require(_0xc8cb('0x14'))['db'];config[_0xc8cb('0x15')]=_[_0xc8cb('0x16')](config['redis'],{'host':_0xc8cb('0x17'),'port':0x18eb});var socket=require(_0xc8cb('0x18'))(new Redis(config[_0xc8cb('0x15')]));require(_0xc8cb('0x19'))['register'](socket);function respondWithStatusCode(_0x4eb08c,_0x529054){_0x529054=_0x529054||0xcc;return function(_0x4e3fee){if(_0x4e3fee){return _0x4eb08c[_0xc8cb('0x1a')](_0x529054);}return _0x4eb08c['status'](_0x529054)[_0xc8cb('0x1b')]();};}function respondWithResult(_0x2237dd,_0x4c2481){_0x4c2481=_0x4c2481||0xc8;return function(_0x372535){if(_0x372535){return _0x2237dd['status'](_0x4c2481)[_0xc8cb('0x1c')](_0x372535);}};}function respondWithFilteredResult(_0x89c0d8,_0x21790d){return function(_0x227c7d){if(_0x227c7d){var _0x1e7dff=_0x227c7d[_0xc8cb('0x1d')],_0x44f120=_0x21790d['offset'],_0x588bc9=_0x21790d['offset']+_0x21790d[_0xc8cb('0x1e')],_0x4c7e17;if(_0x588bc9>=_0x1e7dff){_0x588bc9=_0x1e7dff;_0x4c7e17=0xc8;}else{_0x4c7e17=0xce;}_0x89c0d8['status'](_0x4c7e17);return _0x89c0d8[_0xc8cb('0x1f')](_0xc8cb('0x20'),_0x44f120+'-'+_0x588bc9+'/'+_0x1e7dff)[_0xc8cb('0x1c')](_0x227c7d);}return null;};}function patchUpdates(_0x273fee){return function(_0x47821c){try{jsonpatch['apply'](_0x47821c,_0x273fee,!![]);}catch(_0x290d3a){return BPromise[_0xc8cb('0x21')](_0x290d3a);}return _0x47821c[_0xc8cb('0x22')]();};}function saveUpdates(_0x1aea2b,_0x501b83){return function(_0x24d661){if(_0x24d661){return _0x24d661[_0xc8cb('0x23')](_0x1aea2b)[_0xc8cb('0x24')](function(_0x451357){return _0x451357;});}return null;};}function removeEntity(_0xe497c0,_0x204ecf){return function(_0x3e9b77){if(_0x3e9b77){return _0x3e9b77[_0xc8cb('0x25')]()[_0xc8cb('0x24')](function(){_0xe497c0[_0xc8cb('0x26')](0xcc)[_0xc8cb('0x1b')]();});}};}function handleEntityNotFound(_0x46c2a2,_0x3af0c4){return function(_0x2af4ae){if(!_0x2af4ae){_0x46c2a2[_0xc8cb('0x1a')](0x194);}return _0x2af4ae;};}function handleError(_0x2f14f8,_0x48a7b8){_0x48a7b8=_0x48a7b8||0x1f4;return function(_0x40a28d){logger[_0xc8cb('0x27')](_0x40a28d[_0xc8cb('0x28')]);if(_0x40a28d['name']){delete _0x40a28d[_0xc8cb('0x29')];}_0x2f14f8['status'](_0x48a7b8)[_0xc8cb('0x2a')](_0x40a28d);};}exports[_0xc8cb('0x2b')]=function(_0x344a94,_0x29b099){var _0x2fcb57={},_0x4b492f={},_0x417427={'count':0x0,'rows':[]};var _0x2c332d=db['FaxInteraction'][_0xc8cb('0x2c')];_0x4b492f[_0xc8cb('0x2d')]=_[_0xc8cb('0x2e')](_0x2c332d);_0x4b492f['query']=_['keys'](_0x344a94['query']);_0x4b492f[_0xc8cb('0x2f')]=_['intersection'](_0x4b492f['model'],_0x4b492f['query']);_0x2fcb57[_0xc8cb('0x30')]=_[_0xc8cb('0x31')](_0x4b492f['model'],qs[_0xc8cb('0x32')](_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x32')]));_0x2fcb57[_0xc8cb('0x30')]=_0x2fcb57[_0xc8cb('0x30')]['length']?_0x2fcb57[_0xc8cb('0x30')]:_0x4b492f[_0xc8cb('0x2d')];if(!_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x34')]('nolimit')){_0x2fcb57[_0xc8cb('0x1e')]=qs[_0xc8cb('0x1e')](_0x344a94['query'][_0xc8cb('0x1e')]);_0x2fcb57['offset']=qs[_0xc8cb('0x35')](_0x344a94['query'][_0xc8cb('0x35')]);}_0x2fcb57[_0xc8cb('0x36')]=qs['sort'](_0x344a94['query'][_0xc8cb('0x37')]);_0x2fcb57['where']=qs[_0xc8cb('0x2f')](_[_0xc8cb('0x38')](_0x344a94[_0xc8cb('0x33')],_0x4b492f[_0xc8cb('0x2f')]));var _0x3d0c73=[];var _0x3ddb79=squel[_0xc8cb('0x39')]()['field']('id')[_0xc8cb('0x3a')](_0xc8cb('0x29'))[_0xc8cb('0x3a')](_0xc8cb('0x3b'))[_0xc8cb('0x3c')](_0xc8cb('0x3d'));var _0x485770=squel[_0xc8cb('0x39')]()[_0xc8cb('0x3a')]('COUNT(*)')[_0xc8cb('0x3c')]('fax_messages','me')['where'](_0xc8cb('0x3e'))[_0xc8cb('0x3f')](_0xc8cb('0x40'))['where'](_0xc8cb('0x41'));var _0x39d811=squel[_0xc8cb('0x39')]()[_0xc8cb('0x3a')]('u.id')['field'](_0xc8cb('0x42'))[_0xc8cb('0x3c')]('user_has_fax_interactions','ui')[_0xc8cb('0x43')](_0xc8cb('0x44'),'u','u.id\x20=\x20ui.UserId');var _0x11aafa=squel[_0xc8cb('0x39')]()['from']('fax_interactions','i')['left_join'](_0xc8cb('0x45'),'ui',_0xc8cb('0x46'))[_0xc8cb('0x43')]('users','u',_0xc8cb('0x47'))[_0xc8cb('0x43')]('cm_contacts','c',_0xc8cb('0x48'))[_0xc8cb('0x43')]('users','o',_0xc8cb('0x49'))[_0xc8cb('0x43')](_0xc8cb('0x4a'),'a',_0xc8cb('0x4b'))['left_join']('fax_messages','me',_0xc8cb('0x3e'));var _0x251319=squel['expr']();if(_0x344a94['query'][_0xc8cb('0x4c')]){var _0x7d3539=JSON['parse'](_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x4c')]);_[_0xc8cb('0x2e')](_0x7d3539)['forEach'](function(_0x29c570){var _0x3cbcda=_0x7d3539[_0x29c570];if(_0x29c570===_0xc8cb('0x4d')){var _0x4cbf93=moment(_0x3cbcda['value'][_0xc8cb('0x4e')])[_0xc8cb('0x4f')](_0xc8cb('0x50'))['utc']()[_0xc8cb('0x51')]();var _0x2761f6=moment(_0x2761f6)['utc']()[_0xc8cb('0x52')](_0xc8cb('0x50'))['format']();_0x251319['and'](_0xc8cb('0x53'),_0x4cbf93,_0x2761f6);}else{if(_[_0xc8cb('0x54')](_0x3cbcda['condition'])){_0x3cbcda[_0xc8cb('0x55')]['forEach'](function(_0x20fbf3){switch(_0x3cbcda[_0xc8cb('0x55')][_0xc8cb('0x56')]){case'IS':if(_0x29c570!=='TagId'&&_0x29c570!=='Messages.count'){if(_['isArray'](_0x3cbcda['value'])&&_0x3cbcda[_0xc8cb('0x56')]['length']>0x1){_0x251319['and'](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+'\x20IN\x20?',_0x3cbcda[_0xc8cb('0x56')]);}else{_0x251319[_0xc8cb('0x58')](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x59'),_0x3cbcda[_0xc8cb('0x56')][0x0]);}}break;case'=':_0x251319[_0xc8cb('0x58')](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x59'),_0x3cbcda[_0xc8cb('0x56')]);break;case _0xc8cb('0x5a'):if(_0x29c570===_0xc8cb('0x5b')){_0x251319['and']('c.firstName'+_0xc8cb('0x5c'),'%'+_0x3cbcda[_0xc8cb('0x56')]+'%');_0x251319['or'](_0xc8cb('0x5d')+'\x20LIKE\x20?','%'+_0x3cbcda[_0xc8cb('0x56')]+'%');_0x251319['or']('c.email'+_0xc8cb('0x5c'),'%'+_0x3cbcda[_0xc8cb('0x56')]+'%');}else{_0x251319['and'](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+'\x20LIKE\x20?','%'+_0x3cbcda[_0xc8cb('0x56')]+'%');}break;case'>':_0x251319[_0xc8cb('0x58')](_0x3cbcda['tableAlias']+'.'+_0x29c570+_0xc8cb('0x5e'),_0x3cbcda[_0xc8cb('0x56')]);break;case'<':_0x251319[_0xc8cb('0x58')](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x5f'),_0x3cbcda[_0xc8cb('0x56')]);break;}});}else{switch(_0x3cbcda[_0xc8cb('0x55')][_0xc8cb('0x56')]){case'IS':if(_0x29c570!==_0xc8cb('0x60')&&_0x29c570!=='Messages.count'){if(_[_0xc8cb('0x54')](_0x3cbcda[_0xc8cb('0x56')])&&_0x3cbcda[_0xc8cb('0x56')][_0xc8cb('0x61')]>0x1){_0x251319[_0xc8cb('0x58')](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x62'),_0x3cbcda[_0xc8cb('0x56')]);}else{_0x251319[_0xc8cb('0x58')](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x59'),_0x3cbcda[_0xc8cb('0x56')][0x0]);}}break;case'=':_0x251319[_0xc8cb('0x58')](_0x3cbcda['tableAlias']+'.'+_0x29c570+_0xc8cb('0x59'),_0x3cbcda[_0xc8cb('0x56')]);break;case _0xc8cb('0x5a'):if(_0x29c570==='ContactId'){_0x251319['and'](_0xc8cb('0x63')+_0xc8cb('0x5c'),'%'+_0x3cbcda['value']+'%');_0x251319['or'](_0xc8cb('0x5d')+_0xc8cb('0x5c'),'%'+_0x3cbcda[_0xc8cb('0x56')]+'%');_0x251319['or']('c.email'+_0xc8cb('0x5c'),'%'+_0x3cbcda[_0xc8cb('0x56')]+'%');}else{_0x251319['and'](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x5c'),'%'+_0x3cbcda[_0xc8cb('0x56')]+'%');}break;case'>':_0x251319['and'](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x5e'),_0x3cbcda[_0xc8cb('0x56')]);break;case'<':_0x251319['and'](_0x3cbcda[_0xc8cb('0x57')]+'.'+_0x29c570+_0xc8cb('0x5f'),_0x3cbcda[_0xc8cb('0x56')]);break;}}}});}else{var _0x1c2542=_(Object[_0xc8cb('0x2e')](_0x344a94['query']))[_0xc8cb('0x64')](function(_0x8dbf58){return _0x2c332d[_0xc8cb('0x34')](_0x8dbf58)?_0x8dbf58:undefined;})[_0xc8cb('0x65')](function(_0x9e479d){return!_[_0xc8cb('0x66')](_0x9e479d);})[_0xc8cb('0x56')]();if(!_[_0xc8cb('0x67')](_0x1c2542)){_0x1c2542[_0xc8cb('0x68')](function(_0xd1560f){if(_0xd1560f===_0xc8cb('0x69')){_0x11aafa[_0xc8cb('0x3f')](_0xc8cb('0x6a'),[]['concat'](_0x344a94[_0xc8cb('0x33')][_0xd1560f]));}else if(_0xd1560f===_0xc8cb('0x4d')){var _0x470b94=JSON[_0xc8cb('0x6b')](_0x344a94['query'][_0xd1560f])[_0xc8cb('0x6c')];var _0x25cca0=JSON['parse'](_0x344a94[_0xc8cb('0x33')][_0xd1560f])[_0xc8cb('0x6d')];_0x11aafa[_0xc8cb('0x3f')](_0xc8cb('0x53'),_0x470b94,_0x25cca0);}else{_0x11aafa[_0xc8cb('0x3f')]('i.'+_0xd1560f+'\x20=\x20?',_0x344a94['query'][_0xd1560f]);}});}if(_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x65')]){var _0x7e0412=_0x344a94['query'][_0xc8cb('0x65')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xc8cb('0x6e'));if(qs['isNumeric'](_0x7e0412)){_0x251319['or']('i.id\x20LIKE\x20?',_0x7e0412+'%')['or'](_0xc8cb('0x6f'),_0x7e0412+'%');}_0x251319['or'](_0xc8cb('0x70'),_0x7e0412+'%');}}_0x11aafa[_0xc8cb('0x3f')](_0x251319);if(_0x2fcb57[_0xc8cb('0x36')]){_0x2fcb57[_0xc8cb('0x36')][_0xc8cb('0x68')](function(_0x294dc7){_0x11aafa[_0xc8cb('0x36')]('i.'+_0x294dc7[0x0],_0x294dc7[0x1]===_0xc8cb('0x71')?![]:!![]);});}_0x11aafa['group'](_0xc8cb('0x72'));var _0x2e76e5={'type':db[_0xc8cb('0x73')]['QueryTypes'][_0xc8cb('0x74')],'raw':!![]};var _0x5eb8e0=_0x11aafa[_0xc8cb('0x75')]()[_0xc8cb('0x3a')](_0xc8cb('0x76'));if(!_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x4c')]){if(_0x344a94['query'][_0xc8cb('0x77')]){if(_0x344a94[_0xc8cb('0x33')]['read']==0x1){_0x5eb8e0[_0xc8cb('0x3f')](util[_0xc8cb('0x51')](_0xc8cb('0x78'),_0x485770['toString']()));_0x11aafa[_0xc8cb('0x79')](_0xc8cb('0x7a'));}else{_0x5eb8e0[_0xc8cb('0x3f')](util['format'](_0xc8cb('0x7b'),_0x485770['toString']()));_0x11aafa['having'](_0xc8cb('0x7c'));}}if(_0x344a94[_0xc8cb('0x33')]['tag']){var _0x10c512=_[_0xc8cb('0x54')](_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x7d')])?_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x7d')]:new Array(_0x344a94[_0xc8cb('0x33')]['tag']);var _0x1912dc=squel['expr']();_0x10c512[_0xc8cb('0x68')](function(_0x46a58c){_0x1912dc['or'](_0xc8cb('0x7e'),'%,'+_0x46a58c+',%');});_0x11aafa['having'](_0x1912dc);_0x5eb8e0[_0xc8cb('0x43')]('fax_interaction_has_tags','it',_0xc8cb('0x7f'));_0x5eb8e0['left_join'](_0xc8cb('0x3d'),'t','t.id\x20=\x20it.TagId');_0x5eb8e0['where'](_0xc8cb('0x80'),_0x10c512);}}else{var _0x7d3539=JSON[_0xc8cb('0x6b')](_0x344a94[_0xc8cb('0x33')][_0xc8cb('0x4c')]);_['keys'](_0x7d3539)[_0xc8cb('0x68')](function(_0x1988a9){var _0x53915d=_0x7d3539[_0x1988a9];if(_0x1988a9===_0xc8cb('0x60')){var _0x32a993=_0x53915d[_0xc8cb('0x56')];var _0x127637=squel[_0xc8cb('0x81')]();_0x32a993[_0xc8cb('0x68')](function(_0x15e714){_0x127637['or'](_0xc8cb('0x7e'),'%,'+_0x15e714+',%');});_0x11aafa[_0xc8cb('0x79')](_0x127637);_0x5eb8e0[_0xc8cb('0x43')]('mail_interaction_has_tags','it',_0xc8cb('0x82'));_0x5eb8e0[_0xc8cb('0x43')](_0xc8cb('0x3d'),'t',_0xc8cb('0x83'));_0x5eb8e0[_0xc8cb('0x3f')](_0xc8cb('0x80'),_0x32a993);}else if(_0x1988a9===_0xc8cb('0x84')){if(_0x53915d['value'][_0xc8cb('0x61')]===0x1){if(_0x53915d['value'][0x0]===0x1){_0x5eb8e0[_0xc8cb('0x3f')](util[_0xc8cb('0x51')](_0xc8cb('0x78'),_0x485770[_0xc8cb('0x85')]()));_0x11aafa[_0xc8cb('0x79')](_0xc8cb('0x7a'));}else{_0x5eb8e0['where'](util[_0xc8cb('0x51')](_0xc8cb('0x7b'),_0x485770[_0xc8cb('0x85')]()));_0x11aafa[_0xc8cb('0x79')](_0xc8cb('0x7c'));}}}});}db[_0xc8cb('0x86')][_0xc8cb('0x33')](_0x5eb8e0['toString'](),_0x2e76e5)['then'](function(_0x2b687e){_0x417427[_0xc8cb('0x1d')]=_0x2b687e['length'];if(_0x417427[_0xc8cb('0x1d')]===0x0)return[];return db[_0xc8cb('0x86')][_0xc8cb('0x33')](_0x3ddb79[_0xc8cb('0x85')](),_0x2e76e5)['then'](function(_0x599f3c){_0x3d0c73=_['keyBy'](_0x599f3c,'id');_0x2e76e5=_[_0xc8cb('0x87')](_0x2e76e5,{'model':db[_0xc8cb('0x88')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x11aafa[_0xc8cb('0x3a')](_0x485770,_0xc8cb('0x84'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x89'),_0xc8cb('0x8a'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x8b'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x63'),_0xc8cb('0x8c'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x5d'),_0xc8cb('0x8d'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x8e'),_0xc8cb('0x8f'));_0x11aafa['field']('c.phone','Contact.phone');_0x11aafa[_0xc8cb('0x3a')]('c.mobile','Contact.mobile');_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x90'),_0xc8cb('0x91'));_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x92'),'User.name');_0x11aafa[_0xc8cb('0x3a')](_0xc8cb('0x93'),_0xc8cb('0x94'));_0x11aafa[_0xc8cb('0x43')](_0xc8cb('0x95'),'it',_0xc8cb('0x7f'));_0x11aafa[_0xc8cb('0x43')](_0xc8cb('0x3d'),'t',_0xc8cb('0x83'));_0x11aafa[_0xc8cb('0x1e')](_0x2fcb57[_0xc8cb('0x1e')]);_0x11aafa[_0xc8cb('0x35')](_0x2fcb57[_0xc8cb('0x35')]);return db['sequelize']['query'](_0x11aafa[_0xc8cb('0x85')](),_0x2e76e5);})[_0xc8cb('0x24')](function(_0x4a73a8){_0x39d811[_0xc8cb('0x3f')](_0xc8cb('0x96'),_[_0xc8cb('0x64')](_0x4a73a8,'id'));return db[_0xc8cb('0x86')]['query'](_0x39d811[_0xc8cb('0x85')](),_0x2e76e5)['then'](function(_0x34593a){var _0x2e24dd=_[_0xc8cb('0x97')](_0x34593a,_0xc8cb('0x98'));_0x4a73a8[_0xc8cb('0x68')](function(_0x50d907){if(_0x2e24dd[_0x50d907['id']]){_0x50d907[_0xc8cb('0x99')]=_[_0xc8cb('0x64')](_0x2e24dd[_0x50d907['id']],function(_0x184048){return{'id':_0x184048['id']};});}if(_0x50d907[_0xc8cb('0x94')]){_0x50d907['Tags']=[];_0x50d907[_0xc8cb('0x94')][_0xc8cb('0x9a')](',')[_0xc8cb('0x68')](function(_0xe247b1){_0x50d907[_0xc8cb('0x9b')][_0xc8cb('0x9c')](_0x3d0c73[_0xe247b1]);});}delete _0x50d907[_0xc8cb('0x94')];});return _0x4a73a8;});});})['then'](function(_0x2e6091){_0x417427[_0xc8cb('0x9d')]=_0x2e6091;return _0x417427;})[_0xc8cb('0x24')](respondWithFilteredResult(_0x29b099,_0x2fcb57))[_0xc8cb('0x9e')](handleError(_0x29b099,null));};exports[_0xc8cb('0x9f')]=function(_0x2843b8,_0x100003){var _0x5f4cbd={'raw':![],'where':{'id':_0x2843b8[_0xc8cb('0xa0')]['id']}},_0x26e0da={};_0x26e0da['model']=_[_0xc8cb('0x2e')](db[_0xc8cb('0x88')][_0xc8cb('0x2c')]);_0x26e0da[_0xc8cb('0x33')]=_[_0xc8cb('0x2e')](_0x2843b8['query']);_0x26e0da['filters']=_[_0xc8cb('0x31')](_0x26e0da[_0xc8cb('0x2d')],_0x26e0da[_0xc8cb('0x33')]);_0x5f4cbd[_0xc8cb('0x30')]=_[_0xc8cb('0x31')](_0x26e0da[_0xc8cb('0x2d')],qs[_0xc8cb('0x32')](_0x2843b8[_0xc8cb('0x33')]['fields']));_0x5f4cbd[_0xc8cb('0x30')]=_0x5f4cbd[_0xc8cb('0x30')][_0xc8cb('0x61')]?_0x5f4cbd['attributes']:_0x26e0da[_0xc8cb('0x2d')];if(_0x2843b8[_0xc8cb('0x33')][_0xc8cb('0xa1')]){_0x5f4cbd['include']=[{'all':!![]}];}_0x5f4cbd=_['merge']({},_0x5f4cbd,_0x2843b8[_0xc8cb('0xa2')]);return db[_0xc8cb('0x88')][_0xc8cb('0xa3')](_0x5f4cbd)[_0xc8cb('0x24')](handleEntityNotFound(_0x100003,null))[_0xc8cb('0x24')](respondWithResult(_0x100003,null))[_0xc8cb('0x9e')](handleError(_0x100003,null));};exports[_0xc8cb('0xa4')]=function(_0x358768,_0x7bfe5e){return db['FaxInteraction'][_0xc8cb('0xa4')](_0x358768[_0xc8cb('0xa5')],{})[_0xc8cb('0x24')](respondWithResult(_0x7bfe5e,0xc9))[_0xc8cb('0x9e')](handleError(_0x7bfe5e,null));};exports[_0xc8cb('0x23')]=function(_0x5a9a8f,_0x34951f){if(_0x5a9a8f['body']['id']){delete _0x5a9a8f['body']['id'];}return db[_0xc8cb('0x88')][_0xc8cb('0xa3')]({'where':{'id':_0x5a9a8f[_0xc8cb('0xa0')]['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0x34951f,null))['then'](saveUpdates(_0x5a9a8f[_0xc8cb('0xa5')],null))[_0xc8cb('0x24')](respondWithResult(_0x34951f,null))['catch'](handleError(_0x34951f,null));};exports[_0xc8cb('0x25')]=function(_0x4f9fc5,_0xeee9fe){return db[_0xc8cb('0x88')][_0xc8cb('0xa3')]({'where':{'id':_0x4f9fc5[_0xc8cb('0xa0')]['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0xeee9fe,null))[_0xc8cb('0x24')](removeEntity(_0xeee9fe,null))[_0xc8cb('0x9e')](handleError(_0xeee9fe,null));};exports[_0xc8cb('0xa6')]=function(_0xf0d415,_0x3d752f){return db['FaxInteraction'][_0xc8cb('0xa6')]()['then'](respondWithResult(_0x3d752f,null))[_0xc8cb('0x9e')](handleError(_0x3d752f,null));};exports[_0xc8cb('0xa7')]=function(_0x931f6,_0x47485c,_0x22bd40){return db['FaxMessage'][_0xc8cb('0xa3')]({'where':{'id':_0x931f6['params']['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0x47485c,null))[_0xc8cb('0x24')](function(_0x1552ab){if(_0x1552ab){return _0x1552ab[_0xc8cb('0xa7')](_0x931f6[_0xc8cb('0xa5')][_0xc8cb('0xa8')],_['omit'](_0x931f6[_0xc8cb('0xa5')],['ids','id'])||{});}})['then'](respondWithResult(_0x47485c,null))[_0xc8cb('0x9e')](handleError(_0x47485c,null));};exports[_0xc8cb('0xa9')]=function(_0x1135a8,_0x87d99,_0x220641){var _0x143500={'raw':![],'where':{}};var _0x5ddcd3={};var _0x556a23={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xc8cb('0xaa')]({'where':{'id':_0x1135a8[_0xc8cb('0xa0')]['id']}})['then'](handleEntityNotFound(_0x87d99,null))[_0xc8cb('0x24')](function(_0x3c0bd9){if(_0x3c0bd9){_0x5ddcd3[_0xc8cb('0x2d')]=_[_0xc8cb('0x2e')](db[_0xc8cb('0xab')]['rawAttributes']);_0x5ddcd3[_0xc8cb('0x33')]=_['keys'](_0x1135a8[_0xc8cb('0x33')]);_0x5ddcd3[_0xc8cb('0x2f')]=_['intersection'](_0x5ddcd3[_0xc8cb('0x2d')],_0x5ddcd3['query']);_0x143500[_0xc8cb('0x30')]=_['intersection'](_0x5ddcd3[_0xc8cb('0x2d')],qs[_0xc8cb('0x32')](_0x1135a8['query'][_0xc8cb('0x32')]));_0x143500['attributes']=_0x143500[_0xc8cb('0x30')][_0xc8cb('0x61')]?_0x143500[_0xc8cb('0x30')]:_0x5ddcd3[_0xc8cb('0x2d')];if(!_0x1135a8[_0xc8cb('0x33')][_0xc8cb('0x34')](_0xc8cb('0xac'))){_0x143500[_0xc8cb('0x1e')]=qs[_0xc8cb('0x1e')](_0x1135a8[_0xc8cb('0x33')][_0xc8cb('0x1e')]);_0x143500[_0xc8cb('0x35')]=qs[_0xc8cb('0x35')](_0x1135a8[_0xc8cb('0x33')]['offset']);}_0x143500['order']=qs['sort'](_0x1135a8[_0xc8cb('0x33')]['sort']);_0x143500[_0xc8cb('0x3f')]=qs['filters'](_[_0xc8cb('0x38')](_0x1135a8['query'],_0x5ddcd3['filters']));_0x143500['where'][_0xc8cb('0x98')]=_0x3c0bd9['id'];if(_0x1135a8[_0xc8cb('0x33')]['filter']){_0x143500[_0xc8cb('0x3f')]=_[_0xc8cb('0x87')](_0x143500[_0xc8cb('0x3f')],{'$or':_['map'](_0x143500[_0xc8cb('0x30')],function(_0x3baf61){var _0x20a6a8={};_0x20a6a8[_0x3baf61]={'$like':'%'+_0x1135a8[_0xc8cb('0x33')][_0xc8cb('0x65')]+'%'};return _0x20a6a8;})});}if(_0x1135a8['query'][_0xc8cb('0x6c')]){var _0x2c84e1=_0x1135a8[_0xc8cb('0x33')][_0xc8cb('0x6c')][_0xc8cb('0x9a')](',');var _0x316c29={};_0x316c29[_0x2c84e1[0x0]]={'$gte':moment(_0x2c84e1[0x1])['format'](_0xc8cb('0xad'))};_0x143500[_0xc8cb('0x3f')]=_[_0xc8cb('0x87')](_0x143500['where'],_0x316c29);}_0x143500=_[_0xc8cb('0x87')]({},_0x143500,_0x1135a8[_0xc8cb('0xa2')]);return db[_0xc8cb('0xab')][_0xc8cb('0x1d')]({'where':_0x143500[_0xc8cb('0x3f')]})[_0xc8cb('0x24')](function(_0x33862c){_0x556a23['count']=_0x33862c;if(_0x1135a8[_0xc8cb('0x33')]['includeAll']){_0x143500['include']=[{'all':!![]}];}return db['FaxMessage'][_0xc8cb('0xae')](_0x143500);})[_0xc8cb('0x24')](function(_0xd696fb){_0x556a23[_0xc8cb('0x9d')]=_0xd696fb;return _0x556a23;});}})[_0xc8cb('0x24')](respondWithFilteredResult(_0x87d99,_0x143500))[_0xc8cb('0x9e')](handleError(_0x87d99,null));};exports[_0xc8cb('0xaf')]=function(_0x333fc1,_0x24c3d8,_0x450a47){return db[_0xc8cb('0x88')][_0xc8cb('0xa3')]({'where':{'id':_0x333fc1[_0xc8cb('0xa0')]['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0x24c3d8,null))[_0xc8cb('0x24')](function(_0x455a72){if(_0x455a72){return _0x455a72[_0xc8cb('0xb0')](_0x333fc1[_0xc8cb('0xa5')][_0xc8cb('0xa8')],_[_0xc8cb('0xb1')](_0x333fc1[_0xc8cb('0xa5')],['ids','id'])||{})[_0xc8cb('0xb2')](function(){return db['Tag'][_0xc8cb('0xae')]({'attributes':['id',_0xc8cb('0x29'),_0xc8cb('0x3b')],'where':{'id':_0x333fc1[_0xc8cb('0xa5')][_0xc8cb('0xa8')]}});})[_0xc8cb('0x24')](function(_0x5149cd){socket[_0xc8cb('0xb3')]('faxInteractionTags:save',{'id':Number(_0x333fc1['params']['id']),'tags':_0x5149cd||[]});return{'id':Number(_0x333fc1[_0xc8cb('0xa0')]['id']),'tags':_0x5149cd||[]};});}})['then'](respondWithResult(_0x24c3d8,null))[_0xc8cb('0x9e')](handleError(_0x24c3d8,null));};exports['removeTags']=function(_0x49d377,_0x4f7b5c,_0xcf6729){return db[_0xc8cb('0x88')][_0xc8cb('0xa3')]({'where':{'id':_0x49d377['params']['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0x4f7b5c,null))[_0xc8cb('0x24')](function(_0x52b0d4){if(_0x52b0d4){return _0x52b0d4[_0xc8cb('0xb4')](_0x49d377[_0xc8cb('0x33')][_0xc8cb('0xa8')]);}})[_0xc8cb('0x24')](respondWithStatusCode(_0x4f7b5c,null))[_0xc8cb('0x9e')](handleError(_0x4f7b5c,null));};exports[_0xc8cb('0xb5')]=function(_0x4c0985,_0x317669){var _0x5d1108=moment()['unix']()[_0xc8cb('0x85')]();var _0x3fe7f3=path[_0xc8cb('0xb6')](config[_0xc8cb('0xb7')],_0xc8cb('0xb8'),'files',_0xc8cb('0xb9'));var _0x244566=path[_0xc8cb('0xb6')](config['root'],_0xc8cb('0xb8'),'files',_0xc8cb('0xba'));var _0x3effb6=path['join'](_0x244566,_0x5d1108);var _0x768758=util[_0xc8cb('0x51')](_0xc8cb('0xbb'),_0x5d1108);var _0x17c681=path[_0xc8cb('0xb6')](_0x244566,_0x768758);var _0x4d1d55=![];return db[_0xc8cb('0x88')][_0xc8cb('0xa3')]({'where':{'id':_0x4c0985[_0xc8cb('0xa0')]['id']}})[_0xc8cb('0x24')](handleEntityNotFound(_0x317669,null))[_0xc8cb('0x24')](function(_0x7e880){if(_0x7e880){return _0x7e880[_0xc8cb('0xa9')]({'attributes':['id',_0xc8cb('0xa5'),'createdAt'],'include':[{'model':db[_0xc8cb('0xbc')],'as':_0xc8cb('0xbc')}]});}return[];})[_0xc8cb('0x24')](function(_0x4023a3){_0x4d1d55=_0x4023a3[_0xc8cb('0x61')];if(_0x4023a3[_0xc8cb('0x61')]){fs[_0xc8cb('0xbd')](_0x3effb6);for(var _0x329eae=0x0;_0x329eae<_0x4023a3[_0xc8cb('0x61')];_0x329eae++){var _0x45e4d6=_0x4023a3[_0x329eae];var _0x2afbea=_0x45e4d6[_0xc8cb('0xbc')];if(_0x2afbea){var _0x50086f=path[_0xc8cb('0xb6')](_0x3fe7f3,_0x2afbea[_0xc8cb('0xbe')]);if(fs['existsSync'](_0x50086f)){fs[_0xc8cb('0xbf')](_0x50086f)[_0xc8cb('0xc0')](fs[_0xc8cb('0xc1')](path[_0xc8cb('0xb6')](_0x3effb6,_0x2afbea['basename'])));}}}}})[_0xc8cb('0x24')](function(){if(_0x4d1d55){return new BPromise(function(_0x5b5166,_0x52cd98){zipdir(_0x3effb6,{'saveTo':_0x17c681},function(_0x1ec245,_0x46a665){if(_0x1ec245)return _0x52cd98(_0x1ec245);return _0x5b5166(_0x46a665);});});}})[_0xc8cb('0x24')](function(){if(_0x4d1d55){return new BPromise(function(_0x1b7b0b,_0x53150d){rimraf(_0x3effb6,function(_0x58db89){if(_0x58db89)_0x53150d(_0x58db89);return _0x1b7b0b();});});}})[_0xc8cb('0x24')](function(){if(_0x4d1d55){return _0x317669[_0xc8cb('0xb5')](_0x17c681,_0x768758,function(_0x317479){if(_0x317479){console[_0xc8cb('0xc2')](_0xc8cb('0xc3'),_0x317479);}else{fs[_0xc8cb('0xc4')](_0x17c681);}});}else{return _0x317669[_0xc8cb('0x1a')](0xc8);}})[_0xc8cb('0x9e')](handleError(_0x317669,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a43406f..3f76554 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 _0xaa5e=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5149b0,_0xb118d0){var _0x113b68=function(_0x1843a2){while(--_0x1843a2){_0x5149b0['push'](_0x5149b0['shift']());}};_0x113b68(++_0xb118d0);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x3e92ef,_0x185ef1){_0x3e92ef=_0x3e92ef-0x0;var _0x15f9be=_0xaa5e[_0x3e92ef];return _0x15f9be;};'use strict';var EventEmitter=require(_0xeaa5('0x0'));var FaxInteraction=require(_0xeaa5('0x1'))['db']['FaxInteraction'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xeaa5('0x2')](0x0);var events={'afterCreate':_0xeaa5('0x3'),'afterUpdate':_0xeaa5('0x4'),'afterDestroy':_0xeaa5('0x5')};function emitEvent(_0x131fc3){return function(_0x5a1aca,_0x2c111f,_0xd64e9f){FaxInteractionEvents[_0xeaa5('0x6')](_0x131fc3+':'+_0x5a1aca['id'],_0x5a1aca);FaxInteractionEvents[_0xeaa5('0x6')](_0x131fc3,_0x5a1aca);_0xd64e9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xeaa5('0x7')]=FaxInteractionEvents; \ No newline at end of file +var _0x2547=['hasOwnProperty','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','emit'];(function(_0x177dc7,_0x13501c){var _0x19b7dc=function(_0x1b1437){while(--_0x1b1437){_0x177dc7['push'](_0x177dc7['shift']());}};_0x19b7dc(++_0x13501c);}(_0x2547,0x1cd));var _0x7254=function(_0x123e82,_0x5f15fb){_0x123e82=_0x123e82-0x0;var _0x4a196b=_0x2547[_0x123e82];return _0x4a196b;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){FaxInteractionEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);FaxInteractionEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 172c13a..163896c 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 _0xa035=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed'];(function(_0x2af733,_0x34e073){var _0x1524f7=function(_0x4e7efb){while(--_0x4e7efb){_0x2af733['push'](_0x2af733['shift']());}};_0x1524f7(++_0x34e073);}(_0xa035,0x1c4));var _0x5a03=function(_0xed07ff,_0x5c4801){_0xed07ff=_0xed07ff-0x0;var _0x4c9110=_0xa035[_0xed07ff];return _0x4c9110;};'use strict';var _=require(_0x5a03('0x0'));var util=require(_0x5a03('0x1'));var logger=require(_0x5a03('0x2'))(_0x5a03('0x3'));var moment=require(_0x5a03('0x4'));var BPromise=require(_0x5a03('0x5'));var rp=require(_0x5a03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a03('0x7'));module[_0x5a03('0x8')]=function(_0x1aa0f2,_0x3db663){return _0x1aa0f2[_0x5a03('0x9')]('FaxInteraction',attributes,{'tableName':_0x5a03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b78e8,_0x31d548,_0x1905f7){if(_0x1b78e8[_0x5a03('0xb')](_0x5a03('0xc'))){_0x1b78e8[_0x5a03('0xd')]=moment()['format'](_0x5a03('0xe'));}_0x1905f7(null,_0x1b78e8);}}});}; \ No newline at end of file +var _0x8401=['bluebird','request-promise','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','closedAt','format','lodash','util','api'];(function(_0x2d661e,_0x4bfe70){var _0x4c1d7e=function(_0x550322){while(--_0x550322){_0x2d661e['push'](_0x2d661e['shift']());}};_0x4c1d7e(++_0x4bfe70);}(_0x8401,0x129));var _0x1840=function(_0x1f72c7,_0x4f1ee5){_0x1f72c7=_0x1f72c7-0x0;var _0x4dd2a7=_0x8401[_0x1f72c7];return _0x4dd2a7;};'use strict';var _=require(_0x1840('0x0'));var util=require(_0x1840('0x1'));var logger=require('../../config/logger')(_0x1840('0x2'));var moment=require('moment');var BPromise=require(_0x1840('0x3'));var rp=require(_0x1840('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1840('0x5'));var config=require(_0x1840('0x6'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x186e5e,_0x470ae9){return _0x186e5e[_0x1840('0x7')](_0x1840('0x8'),attributes,{'tableName':_0x1840('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd097f6,_0x5d717e,_0x90a433){if(_0xd097f6['changed']('closed')){_0xd097f6[_0x1840('0xa')]=moment()[_0x1840('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x90a433(null,_0xd097f6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index f2e3fc1..baf49a0 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 _0xe7ce=['AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','update','options','where','attributes','limit','FaxInteraction','find','addTags','body','ids','omit'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xe7ce,0x1ae));var _0xee7c=function(_0x16e2ad,_0x420ed1){_0x16e2ad=_0x16e2ad-0x0;var _0x5a7887=_0xe7ce[_0x16e2ad];return _0x5a7887;};'use strict';var _=require(_0xee7c('0x0'));var util=require(_0xee7c('0x1'));var moment=require(_0xee7c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7c('0x3'));var db=require(_0xee7c('0x4'))['db'];var utils=require(_0xee7c('0x5'));var logger=require(_0xee7c('0x6'))(_0xee7c('0x7'));var config=require('../../config/environment');var jayson=require(_0xee7c('0x8'));var client=jayson[_0xee7c('0x9')]['http']({'port':0x232a});config[_0xee7c('0xa')]=_[_0xee7c('0xb')](config[_0xee7c('0xa')],{'host':_0xee7c('0xc'),'port':0x18eb});var socket=require(_0xee7c('0xd'))(new Redis(config[_0xee7c('0xa')]));require(_0xee7c('0xe'))[_0xee7c('0xf')](socket);function respondWithRpcPromise(_0x586461,_0x3c5640,_0x548ebc){return new BPromise(function(_0x3bf9f4,_0x3563ec){return client[_0xee7c('0x10')](_0x586461,_0x548ebc)['then'](function(_0x3b9efb){logger[_0xee7c('0x11')](_0xee7c('0x12'),_0x3c5640,'request\x20sent');logger[_0xee7c('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3c5640,_0xee7c('0x14'),JSON[_0xee7c('0x15')](_0x3b9efb));if(_0x3b9efb[_0xee7c('0x16')]){if(_0x3b9efb['error'][_0xee7c('0x17')]===0x1f4){logger[_0xee7c('0x16')](_0xee7c('0x12'),_0x3c5640,_0x3b9efb[_0xee7c('0x16')]['message']);return _0x3563ec(_0x3b9efb[_0xee7c('0x16')][_0xee7c('0x18')]);}logger[_0xee7c('0x16')](_0xee7c('0x12'),_0x3c5640,_0x3b9efb[_0xee7c('0x16')]['message']);return _0x3bf9f4(_0x3b9efb[_0xee7c('0x16')][_0xee7c('0x18')]);}else{logger[_0xee7c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x3c5640,_0xee7c('0x14'));_0x3bf9f4(_0x3b9efb['result'][_0xee7c('0x18')]);}})[_0xee7c('0x19')](function(_0x6e5177){logger[_0xee7c('0x16')](_0xee7c('0x12'),_0x3c5640,_0x6e5177);_0x3563ec(_0x6e5177);});});}exports[_0xee7c('0x1a')]=function(_0x768697){var _0x3ec6d3=this;return new Promise(function(_0x2dea9a,_0x218081){return db['FaxInteraction'][_0xee7c('0x1b')](_0x768697['body'],{'raw':_0x768697[_0xee7c('0x1c')]?_0x768697[_0xee7c('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x768697['options']?_0x768697[_0xee7c('0x1c')][_0xee7c('0x1d')]||null:null,'attributes':_0x768697[_0xee7c('0x1c')]?_0x768697[_0xee7c('0x1c')][_0xee7c('0x1e')]||null:null,'limit':_0x768697['options']?_0x768697[_0xee7c('0x1c')][_0xee7c('0x1f')]||null:null})['then'](function(_0x18162a){logger[_0xee7c('0x11')](_0xee7c('0x1a'),_0x768697);logger[_0xee7c('0x13')](_0xee7c('0x1a'),_0x768697,JSON[_0xee7c('0x15')](_0x18162a));_0x2dea9a(_0x18162a);})[_0xee7c('0x19')](function(_0x4f3252){logger[_0xee7c('0x16')](_0xee7c('0x1a'),_0x4f3252['message'],_0x768697);_0x218081(_0x3ec6d3['error'](0x1f4,_0x4f3252[_0xee7c('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x3de6b3){return new Promise(function(_0x1b3843,_0x31b331){return db[_0xee7c('0x20')][_0xee7c('0x21')]({'where':_0x3de6b3[_0xee7c('0x1c')]?_0x3de6b3[_0xee7c('0x1c')][_0xee7c('0x1d')]||null:null})['then'](function(_0x1b82de){if(_0x1b82de){return _0x1b82de[_0xee7c('0x22')](_0x3de6b3[_0xee7c('0x23')][_0xee7c('0x24')],_[_0xee7c('0x25')](_0x3de6b3[_0xee7c('0x23')],[_0xee7c('0x24'),'id'])||{});}})['spread'](function(_0x39cb41){logger[_0xee7c('0x11')]('AddTags',_0x3de6b3);logger[_0xee7c('0x13')](_0xee7c('0x26'),_0x3de6b3,JSON[_0xee7c('0x15')](_0x39cb41));_0x1b3843(_0x39cb41);})['catch'](function(_0x28c312){logger['error'](_0xee7c('0x26'),_0x28c312[_0xee7c('0x18')],_0x3de6b3);_0x31b331(_this[_0xee7c('0x16')](0x1f4,_0x28c312['message']));});});}; \ No newline at end of file +var _0x646e=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x646e,0x75));var _0xe646=function(_0x207313,_0x30db8d){_0x207313=_0x207313-0x0;var _0x129a9e=_0x646e[_0x207313];return _0x129a9e;};'use strict';var _=require(_0xe646('0x0'));var util=require(_0xe646('0x1'));var moment=require(_0xe646('0x2'));var BPromise=require(_0xe646('0x3'));var rs=require(_0xe646('0x4'));var fs=require('fs');var Redis=require(_0xe646('0x5'));var db=require(_0xe646('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe646('0x7'))(_0xe646('0x8'));var config=require(_0xe646('0x9'));var jayson=require(_0xe646('0xa'));var client=jayson[_0xe646('0xb')][_0xe646('0xc')]({'port':0x232a});config[_0xe646('0xd')]=_[_0xe646('0xe')](config[_0xe646('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe646('0xd')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2b5d32,_0x188f67,_0x2c2e81){return new BPromise(function(_0x5cfe59,_0x59c889){return client[_0xe646('0xf')](_0x2b5d32,_0x2c2e81)['then'](function(_0x1e1dc4){logger[_0xe646('0x10')](_0xe646('0x11'),_0x188f67,_0xe646('0x12'));logger['debug'](_0xe646('0x13'),_0x188f67,_0xe646('0x12'),JSON[_0xe646('0x14')](_0x1e1dc4));if(_0x1e1dc4[_0xe646('0x15')]){if(_0x1e1dc4['error'][_0xe646('0x16')]===0x1f4){logger[_0xe646('0x15')](_0xe646('0x11'),_0x188f67,_0x1e1dc4[_0xe646('0x15')]['message']);return _0x59c889(_0x1e1dc4[_0xe646('0x15')][_0xe646('0x17')]);}logger[_0xe646('0x15')](_0xe646('0x11'),_0x188f67,_0x1e1dc4[_0xe646('0x15')][_0xe646('0x17')]);return _0x5cfe59(_0x1e1dc4['error'][_0xe646('0x17')]);}else{logger[_0xe646('0x10')](_0xe646('0x11'),_0x188f67,'request\x20sent');_0x5cfe59(_0x1e1dc4[_0xe646('0x18')][_0xe646('0x17')]);}})[_0xe646('0x19')](function(_0x446a1d){logger[_0xe646('0x15')](_0xe646('0x11'),_0x188f67,_0x446a1d);_0x59c889(_0x446a1d);});});}exports[_0xe646('0x1a')]=function(_0x37d2b7){var _0x58d2e1=this;return new Promise(function(_0x59d42d,_0x19173c){return db[_0xe646('0x1b')][_0xe646('0x1c')](_0x37d2b7[_0xe646('0x1d')],{'raw':_0x37d2b7[_0xe646('0x1e')]?_0x37d2b7[_0xe646('0x1e')][_0xe646('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37d2b7[_0xe646('0x1e')]?_0x37d2b7[_0xe646('0x1e')][_0xe646('0x20')]||null:null,'attributes':_0x37d2b7[_0xe646('0x1e')]?_0x37d2b7[_0xe646('0x1e')]['attributes']||null:null,'limit':_0x37d2b7[_0xe646('0x1e')]?_0x37d2b7[_0xe646('0x1e')][_0xe646('0x21')]||null:null})['then'](function(_0x1d6697){logger[_0xe646('0x10')](_0xe646('0x1a'),_0x37d2b7);logger['debug'](_0xe646('0x1a'),_0x37d2b7,JSON[_0xe646('0x14')](_0x1d6697));_0x59d42d(_0x1d6697);})[_0xe646('0x19')](function(_0x5474c9){logger[_0xe646('0x15')]('UpdateFaxInteraction',_0x5474c9[_0xe646('0x17')],_0x37d2b7);_0x19173c(_0x58d2e1[_0xe646('0x15')](0x1f4,_0x5474c9[_0xe646('0x17')]));});});};exports[_0xe646('0x22')]=function(_0x314f5b){return new Promise(function(_0x104523,_0x127f3c){return db[_0xe646('0x1b')]['find']({'where':_0x314f5b['options']?_0x314f5b[_0xe646('0x1e')][_0xe646('0x20')]||null:null})[_0xe646('0x23')](function(_0x4cd8d9){if(_0x4cd8d9){return _0x4cd8d9[_0xe646('0x24')](_0x314f5b[_0xe646('0x1d')][_0xe646('0x25')],_[_0xe646('0x26')](_0x314f5b[_0xe646('0x1d')],[_0xe646('0x25'),'id'])||{});}})[_0xe646('0x27')](function(_0x4536c9){logger[_0xe646('0x10')](_0xe646('0x28'),_0x314f5b);logger['debug'](_0xe646('0x28'),_0x314f5b,JSON[_0xe646('0x14')](_0x4536c9));_0x104523(_0x4536c9);})[_0xe646('0x19')](function(_0x7dc7a){logger[_0xe646('0x15')](_0xe646('0x28'),_0x7dc7a[_0xe646('0x17')],_0x314f5b);_0x127f3c(_this[_0xe646('0x15')](0x1f4,_0x7dc7a[_0xe646('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d702498..caa80e9 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 _0xc0d6=['remove','emit','removeListener','register','length','save'];(function(_0x184b6b,_0x4986a6){var _0x5c7f7a=function(_0x4350fa){while(--_0x4350fa){_0x184b6b['push'](_0x184b6b['shift']());}};_0x5c7f7a(++_0x4986a6);}(_0xc0d6,0x1d3));var _0x6c0d=function(_0x19dc89,_0x471a4b){_0x19dc89=_0x19dc89-0x0;var _0x35cb78=_0xc0d6[_0x19dc89];return _0x35cb78;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x6c0d('0x0'),_0x6c0d('0x1'),'update'];function createListener(_0x39a55b,_0x131c4f){return function(_0x1f5e1e){_0x131c4f[_0x6c0d('0x2')](_0x39a55b,_0x1f5e1e);};}function removeListener(_0x4e5897,_0x437ab8){return function(){FaxInteractionEvents[_0x6c0d('0x3')](_0x4e5897,_0x437ab8);};}exports[_0x6c0d('0x4')]=function(_0x8f93bc){for(var _0x2f730a=0x0,_0x6806d9=events[_0x6c0d('0x5')];_0x2f730a<_0x6806d9;_0x2f730a++){var _0x18d4bb=events[_0x2f730a];var _0x233344=createListener('faxInteraction:'+_0x18d4bb,_0x8f93bc);FaxInteractionEvents['on'](_0x18d4bb,_0x233344);}}; \ No newline at end of file +var _0xf71d=['update','emit','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x19ec97,_0x4b2bd9){var _0xbff8b7=function(_0x2a99a2){while(--_0x2a99a2){_0x19ec97['push'](_0x19ec97['shift']());}};_0xbff8b7(++_0x4b2bd9);}(_0xf71d,0x115));var _0xdf71=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xf71d[_0xbb14db];return _0x36bed7;};'use strict';var FaxInteractionEvents=require(_0xdf71('0x0'));var events=[_0xdf71('0x1'),_0xdf71('0x2'),_0xdf71('0x3')];function createListener(_0x590f78,_0x56f790){return function(_0x1adefe){_0x56f790[_0xdf71('0x4')](_0x590f78,_0x1adefe);};}function removeListener(_0x597809,_0x5f0056){return function(){FaxInteractionEvents['removeListener'](_0x597809,_0x5f0056);};}exports[_0xdf71('0x5')]=function(_0x41736a){for(var _0x1a0e33=0x0,_0x38b4c5=events[_0xdf71('0x6')];_0x1a0e33<_0x38b4c5;_0x1a0e33++){var _0x569fe3=events[_0x1a0e33];var _0x1bf640=createListener(_0xdf71('0x7')+_0x569fe3,_0x41736a);FaxInteractionEvents['on'](_0x569fe3,_0x1bf640);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index ff96eba..ded8c83 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 _0xd38d=['path','connect-timeout','express','../../components/auth/service','index','get','isAuthenticated','describe','/:id','show','getMessages','post','create','tracked','fax','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util'];(function(_0x1a8f5e,_0x25b72b){var _0x40ca1d=function(_0xf6e1aa){while(--_0xf6e1aa){_0x1a8f5e['push'](_0x1a8f5e['shift']());}};_0x40ca1d(++_0x25b72b);}(_0xd38d,0xbb));var _0xdd38=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0xd38d[_0xd206ce];return _0x5b3ec6;};'use strict';var multer=require(_0xdd38('0x0'));var util=require(_0xdd38('0x1'));var path=require(_0xdd38('0x2'));var timeout=require(_0xdd38('0x3'));var express=require(_0xdd38('0x4'));var router=express['Router']();var auth=require(_0xdd38('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdd38('0x6')]);router[_0xdd38('0x7')]('/describe',auth[_0xdd38('0x8')](),controller[_0xdd38('0x9')]);router[_0xdd38('0x7')](_0xdd38('0xa'),auth['isAuthenticated'](),controller[_0xdd38('0xb')]);router[_0xdd38('0x7')]('/:id/messages',auth[_0xdd38('0x8')](),controller[_0xdd38('0xc')]);router[_0xdd38('0x7')]('/:id/download',auth[_0xdd38('0x8')](),controller['download']);router[_0xdd38('0xd')]('/',auth['isAuthenticated'](),controller[_0xdd38('0xe')]);router[_0xdd38('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0xdd38('0xd')]('/:id/tags',auth[_0xdd38('0x8')](),interaction[_0xdd38('0xf')](_0xdd38('0x10'),'faxinteraction:addtags'),controller[_0xdd38('0x11')]);router[_0xdd38('0x12')](_0xdd38('0xa'),auth[_0xdd38('0x8')](),interaction[_0xdd38('0xf')]('fax',_0xdd38('0x13')),controller[_0xdd38('0x14')]);router['delete'](_0xdd38('0xa'),auth['isAuthenticated'](),interaction[_0xdd38('0xf')](_0xdd38('0x10'),_0xdd38('0x15')),controller[_0xdd38('0x16')]);router[_0xdd38('0x17')](_0xdd38('0x18'),auth['isAuthenticated'](),controller[_0xdd38('0x19')]);module[_0xdd38('0x1a')]=router; \ No newline at end of file +var _0xff99=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x196142,_0x585032){var _0x57d8cf=function(_0x1640a0){while(--_0x1640a0){_0x196142['push'](_0x196142['shift']());}};_0x57d8cf(++_0x585032);}(_0xff99,0x126));var _0x9ff9=function(_0x4f1aff,_0x13a78f){_0x4f1aff=_0x4f1aff-0x0;var _0x53170b=_0xff99[_0x4f1aff];return _0x53170b;};'use strict';var multer=require(_0x9ff9('0x0'));var util=require('util');var path=require(_0x9ff9('0x1'));var timeout=require(_0x9ff9('0x2'));var express=require(_0x9ff9('0x3'));var router=express[_0x9ff9('0x4')]();var auth=require(_0x9ff9('0x5'));var interaction=require(_0x9ff9('0x6'));var config=require(_0x9ff9('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0x9ff9('0x8')](),controller[_0x9ff9('0x9')]);router['get']('/describe',auth[_0x9ff9('0x8')](),controller['describe']);router[_0x9ff9('0xa')](_0x9ff9('0xb'),auth[_0x9ff9('0x8')](),controller[_0x9ff9('0xc')]);router[_0x9ff9('0xa')](_0x9ff9('0xd'),auth[_0x9ff9('0x8')](),controller[_0x9ff9('0xe')]);router['get']('/:id/download',auth[_0x9ff9('0x8')](),controller[_0x9ff9('0xf')]);router[_0x9ff9('0x10')]('/',auth[_0x9ff9('0x8')](),controller[_0x9ff9('0x11')]);router[_0x9ff9('0x10')](_0x9ff9('0xd'),auth[_0x9ff9('0x8')](),controller[_0x9ff9('0x12')]);router[_0x9ff9('0x10')]('/:id/tags',auth[_0x9ff9('0x8')](),interaction[_0x9ff9('0x13')]('fax','faxinteraction:addtags'),controller['addTags']);router[_0x9ff9('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0x9ff9('0x13')](_0x9ff9('0x15'),_0x9ff9('0x16')),controller[_0x9ff9('0x17')]);router[_0x9ff9('0x18')](_0x9ff9('0xb'),auth[_0x9ff9('0x8')](),interaction[_0x9ff9('0x13')]('fax',_0x9ff9('0x19')),controller[_0x9ff9('0x1a')]);router[_0x9ff9('0x18')](_0x9ff9('0x1b'),auth[_0x9ff9('0x8')](),controller[_0x9ff9('0x1c')]);module[_0x9ff9('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0c5c8d4..f268bad 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 _0x2f0d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x239073,_0x15e447){var _0x18f2dc=function(_0x56b878){while(--_0x56b878){_0x239073['push'](_0x239073['shift']());}};_0x18f2dc(++_0x15e447);}(_0x2f0d,0xa8));var _0xd2f0=function(_0xf6a1f6,_0x43305d){_0xf6a1f6=_0xf6a1f6-0x0;var _0x44bc4f=_0x2f0d[_0xf6a1f6];return _0x44bc4f;};'use strict';var Sequelize=require(_0xd2f0('0x0'));module[_0xd2f0('0x1')]={'body':{'type':Sequelize[_0xd2f0('0x2')](_0xd2f0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd2f0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd2f0('0x5')]('in',_0xd2f0('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xd2f0('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd2f0('0x7')]}}; \ No newline at end of file +var _0x8478=['exports','TEXT','ENUM','out','DATE'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8478,0x1a9));var _0x8847=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8478[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x8847('0x0')]={'body':{'type':Sequelize[_0x8847('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8847('0x2')]('in',_0x8847('0x3')),'defaultValue':_0x8847('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8847('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8847('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 960f6a4..67244dd 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 _0xacd3=['YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax','agent','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','create','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','root','server','files','attachments','download','join','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','status','end','json','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','FaxMessage','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','count','include','findAll','rows','params','rawAttributes','includeAll','find','body','describe','fax-interactions','accept','read','readAt','UserId','CmContact','Contact','get','read1stAt','format'];(function(_0x4e9713,_0x4bdbe9){var _0x4b9684=function(_0x397d4c){while(--_0x397d4c){_0x4e9713['push'](_0x4e9713['shift']());}};_0x4b9684(++_0x4bdbe9);}(_0xacd3,0x1ba));var _0x3acd=function(_0x15a4f2,_0x80b079){_0x15a4f2=_0x15a4f2-0x0;var _0x3a137e=_0xacd3[_0x15a4f2];return _0x3a137e;};'use strict';var pdf=require(_0x3acd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3acd('0x1'));var zipdir=require(_0x3acd('0x2'));var jsonpatch=require(_0x3acd('0x3'));var rp=require(_0x3acd('0x4'));var moment=require(_0x3acd('0x5'));var BPromise=require(_0x3acd('0x6'));var Mustache=require(_0x3acd('0x7'));var util=require('util');var path=require(_0x3acd('0x8'));var sox=require(_0x3acd('0x9'));var csv=require(_0x3acd('0xa'));var ejs=require(_0x3acd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3acd('0xc'));var crypto=require('crypto');var jsforce=require(_0x3acd('0xd'));var deskjs=require(_0x3acd('0xe'));var toCsv=require(_0x3acd('0xa'));var querystring=require(_0x3acd('0xf'));var Papa=require(_0x3acd('0x10'));var Redis=require(_0x3acd('0x11'));var authService=require(_0x3acd('0x12'));var qs=require(_0x3acd('0x13'));var hardwareService=require(_0x3acd('0x14'));var logger=require(_0x3acd('0x15'))(_0x3acd('0x16'));var utils=require(_0x3acd('0x17'));var config=require(_0x3acd('0x18'));var db=require(_0x3acd('0x19'))['db'];config[_0x3acd('0x1a')]=_[_0x3acd('0x1b')](config[_0x3acd('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3acd('0x1c'))(new Redis(config[_0x3acd('0x1a')]));require(_0x3acd('0x1d'))[_0x3acd('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3acd('0x1f')][_0x3acd('0x20')]({'port':0x232c});var client9002=jayson[_0x3acd('0x1f')][_0x3acd('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1bcea2,_0x478929,_0x255e26){if(_0x255e26){var _0x42ed38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42ed38['test'](_0x478929)){return _0x1bcea2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1bcea2;}}function respondWithRpcPromise(_0x116a70,_0x9cfa6f,_0x347a65,_0x17f52b){return new BPromise(function(_0x141199,_0x557b3e){var _0x45bbb0=_0x17f52b||client;return _0x45bbb0[_0x3acd('0x21')](_0x116a70,_0x347a65)[_0x3acd('0x22')](function(_0x9f31c7){logger[_0x3acd('0x23')]('FaxMessage,\x20%s,\x20%s',_0x9cfa6f,_0x3acd('0x24'));logger[_0x3acd('0x25')](_0x3acd('0x26'),_0x9cfa6f,_0x3acd('0x24'),JSON[_0x3acd('0x27')](_0x9f31c7));if(_0x9f31c7[_0x3acd('0x28')]){if(_0x9f31c7[_0x3acd('0x28')][_0x3acd('0x29')]===0x1f4){logger[_0x3acd('0x28')]('FaxMessage,\x20%s,\x20%s',_0x9cfa6f,_0x9f31c7[_0x3acd('0x28')][_0x3acd('0x2a')]);return _0x557b3e(_0x9f31c7[_0x3acd('0x28')][_0x3acd('0x2a')]);}logger[_0x3acd('0x28')]('FaxMessage,\x20%s,\x20%s',_0x9cfa6f,_0x9f31c7[_0x3acd('0x28')][_0x3acd('0x2a')]);return _0x141199(_0x9f31c7[_0x3acd('0x28')][_0x3acd('0x2a')]);}else{logger['info'](_0x3acd('0x2b'),_0x9cfa6f,_0x3acd('0x24'));_0x141199(_0x9f31c7[_0x3acd('0x2c')][_0x3acd('0x2a')]);}})[_0x3acd('0x2d')](function(_0xc0bc72){logger[_0x3acd('0x28')]('FaxMessage,\x20%s,\x20%s',_0x9cfa6f,_0xc0bc72);_0x557b3e(_0xc0bc72);});});}function respondWithStatusCode(_0xbeed77,_0x102cf1){_0x102cf1=_0x102cf1||0xcc;return function(_0x32f9da){if(_0x32f9da){return _0xbeed77['sendStatus'](_0x102cf1);}return _0xbeed77[_0x3acd('0x2e')](_0x102cf1)[_0x3acd('0x2f')]();};}function respondWithResult(_0x553a3b,_0x252313){_0x252313=_0x252313||0xc8;return function(_0x5ad843){if(_0x5ad843){return _0x553a3b[_0x3acd('0x2e')](_0x252313)[_0x3acd('0x30')](_0x5ad843);}};}function respondWithFilteredResult(_0x18ac29,_0x46c7d9){return function(_0x3e5ee4){if(_0x3e5ee4){var _0x2f0fbc=_0x3e5ee4['count'],_0x5b2a97=_0x46c7d9['offset'],_0x3e21ce=_0x46c7d9[_0x3acd('0x31')]+_0x46c7d9[_0x3acd('0x32')],_0x3884d0;if(_0x3e21ce>=_0x2f0fbc){_0x3e21ce=_0x2f0fbc;_0x3884d0=0xc8;}else{_0x3884d0=0xce;}_0x18ac29[_0x3acd('0x2e')](_0x3884d0);return _0x18ac29[_0x3acd('0x33')]('Content-Range',_0x5b2a97+'-'+_0x3e21ce+'/'+_0x2f0fbc)['json'](_0x3e5ee4);}return null;};}function patchUpdates(_0x177398){return function(_0x541a73){try{jsonpatch[_0x3acd('0x34')](_0x541a73,_0x177398,!![]);}catch(_0x3e9080){return BPromise[_0x3acd('0x35')](_0x3e9080);}return _0x541a73[_0x3acd('0x36')]();};}function saveUpdates(_0x3ae909,_0x8cebfb){return function(_0x33af94){if(_0x33af94){return _0x33af94[_0x3acd('0x37')](_0x3ae909)[_0x3acd('0x22')](function(_0x72c2cc){return _0x72c2cc;});}return null;};}function removeEntity(_0xd1240d,_0x312422){return function(_0x5e7866){if(_0x5e7866){return _0x5e7866[_0x3acd('0x38')]()['then'](function(){_0xd1240d[_0x3acd('0x2e')](0xcc)[_0x3acd('0x2f')]();});}};}function handleEntityNotFound(_0x14ed11,_0x5998cd){return function(_0x2a3181){if(!_0x2a3181){_0x14ed11[_0x3acd('0x39')](0x194);}return _0x2a3181;};}function handleError(_0x123b08,_0x4da754){_0x4da754=_0x4da754||0x1f4;return function(_0x53d344){logger[_0x3acd('0x28')](_0x53d344[_0x3acd('0x3a')]);if(_0x53d344[_0x3acd('0x3b')]){delete _0x53d344[_0x3acd('0x3b')];}_0x123b08[_0x3acd('0x2e')](_0x4da754)[_0x3acd('0x3c')](_0x53d344);};}exports['index']=function(_0xc5286,_0x5c94de){var _0x3db4e9={},_0x4d3b36={},_0x58ce12={'count':0x0,'rows':[]};var _0x28a50e=db[_0x3acd('0x3d')]['rawAttributes'];_0x4d3b36[_0x3acd('0x3e')]=_[_0x3acd('0x3f')](_0x28a50e);_0x4d3b36[_0x3acd('0x40')]=_[_0x3acd('0x3f')](_0xc5286[_0x3acd('0x40')]);_0x4d3b36[_0x3acd('0x41')]=_['intersection'](_0x4d3b36[_0x3acd('0x3e')],_0x4d3b36[_0x3acd('0x40')]);_0x3db4e9[_0x3acd('0x42')]=_[_0x3acd('0x43')](_0x4d3b36['model'],qs[_0x3acd('0x44')](_0xc5286['query'][_0x3acd('0x44')]));_0x3db4e9[_0x3acd('0x42')]=_0x3db4e9[_0x3acd('0x42')][_0x3acd('0x45')]?_0x3db4e9[_0x3acd('0x42')]:_0x4d3b36[_0x3acd('0x3e')];if(!_0xc5286[_0x3acd('0x40')][_0x3acd('0x46')](_0x3acd('0x47'))){_0x3db4e9[_0x3acd('0x32')]=qs[_0x3acd('0x32')](_0xc5286[_0x3acd('0x40')][_0x3acd('0x32')]);_0x3db4e9[_0x3acd('0x31')]=qs[_0x3acd('0x31')](_0xc5286[_0x3acd('0x40')][_0x3acd('0x31')]);}_0x3db4e9[_0x3acd('0x48')]=qs[_0x3acd('0x49')](_0xc5286['query']['sort']);_0x3db4e9[_0x3acd('0x4a')]=qs[_0x3acd('0x41')](_['pick'](_0xc5286[_0x3acd('0x40')],_0x4d3b36[_0x3acd('0x41')]));if(_0xc5286[_0x3acd('0x40')][_0x3acd('0x4b')]){_0x3db4e9['where']=_[_0x3acd('0x4c')](_0x3db4e9[_0x3acd('0x4a')],{'$or':_[_0x3acd('0x4d')](_0x28a50e,function(_0x43e579){if(_0x43e579[_0x3acd('0x4e')]['key']!==_0x3acd('0x4f')){var _0x30532d={};_0x30532d[_0x43e579[_0x3acd('0x50')]]={'$like':'%'+_0xc5286[_0x3acd('0x40')][_0x3acd('0x4b')]+'%'};return _0x30532d;}})});}_0x3db4e9=_[_0x3acd('0x4c')]({},_0x3db4e9,_0xc5286[_0x3acd('0x51')]);var _0x57553d={'where':_0x3db4e9[_0x3acd('0x4a')]};return db[_0x3acd('0x3d')][_0x3acd('0x52')](_0x57553d)['then'](function(_0x7ba06e){_0x58ce12['count']=_0x7ba06e;if(_0xc5286[_0x3acd('0x40')]['includeAll']){_0x3db4e9[_0x3acd('0x53')]=[{'all':!![]}];}return db[_0x3acd('0x3d')][_0x3acd('0x54')](_0x3db4e9);})[_0x3acd('0x22')](function(_0x4844c3){_0x58ce12[_0x3acd('0x55')]=_0x4844c3;return _0x58ce12;})[_0x3acd('0x22')](respondWithFilteredResult(_0x5c94de,_0x3db4e9))[_0x3acd('0x2d')](handleError(_0x5c94de,null));};exports['show']=function(_0x27ceab,_0x2274c4){var _0x3e93f2={'raw':!![],'where':{'id':_0x27ceab[_0x3acd('0x56')]['id']}},_0x4b28f0={};_0x4b28f0[_0x3acd('0x3e')]=_[_0x3acd('0x3f')](db['FaxMessage'][_0x3acd('0x57')]);_0x4b28f0['query']=_[_0x3acd('0x3f')](_0x27ceab['query']);_0x4b28f0[_0x3acd('0x41')]=_[_0x3acd('0x43')](_0x4b28f0[_0x3acd('0x3e')],_0x4b28f0[_0x3acd('0x40')]);_0x3e93f2[_0x3acd('0x42')]=_[_0x3acd('0x43')](_0x4b28f0['model'],qs['fields'](_0x27ceab[_0x3acd('0x40')][_0x3acd('0x44')]));_0x3e93f2[_0x3acd('0x42')]=_0x3e93f2[_0x3acd('0x42')][_0x3acd('0x45')]?_0x3e93f2['attributes']:_0x4b28f0[_0x3acd('0x3e')];if(_0x27ceab['query'][_0x3acd('0x58')]){_0x3e93f2[_0x3acd('0x53')]=[{'all':!![]}];}_0x3e93f2=_[_0x3acd('0x4c')]({},_0x3e93f2,_0x27ceab[_0x3acd('0x51')]);return db['FaxMessage']['find'](_0x3e93f2)['then'](handleEntityNotFound(_0x2274c4,null))['then'](respondWithResult(_0x2274c4,null))[_0x3acd('0x2d')](handleError(_0x2274c4,null));};exports[_0x3acd('0x37')]=function(_0x28fada,_0xa9e962){if(_0x28fada['body']['id']){delete _0x28fada['body']['id'];}return db[_0x3acd('0x3d')][_0x3acd('0x59')]({'where':{'id':_0x28fada[_0x3acd('0x56')]['id']}})[_0x3acd('0x22')](handleEntityNotFound(_0xa9e962,null))['then'](saveUpdates(_0x28fada[_0x3acd('0x5a')],null))[_0x3acd('0x22')](respondWithResult(_0xa9e962,null))[_0x3acd('0x2d')](handleError(_0xa9e962,null));};exports['destroy']=function(_0x1ce080,_0x5a2b12){return db[_0x3acd('0x3d')][_0x3acd('0x59')]({'where':{'id':_0x1ce080[_0x3acd('0x56')]['id']}})[_0x3acd('0x22')](handleEntityNotFound(_0x5a2b12,null))[_0x3acd('0x22')](removeEntity(_0x5a2b12,null))[_0x3acd('0x2d')](handleError(_0x5a2b12,null));};exports[_0x3acd('0x5b')]=function(_0x372c08,_0x5f2f25){return db[_0x3acd('0x3d')][_0x3acd('0x5b')]()['then'](respondWithResult(_0x5f2f25,null))[_0x3acd('0x2d')](handleError(_0x5f2f25,null));};var interaction_log=require('../../config/logger')(_0x3acd('0x5c'));exports[_0x3acd('0x5d')]=function(_0x3808a2,_0x3a1ab5,_0x4d8247){var _0x5c7e54={'channel':'fax'};if(_0x3808a2[_0x3acd('0x5a')]['id']){delete _0x3808a2[_0x3acd('0x5a')]['id'];}_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x5e')]=!![];_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x60')]=_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x60')]||_0x3808a2['user']['id'];return db[_0x3acd('0x3d')][_0x3acd('0x59')]({'where':{'id':_0x3808a2[_0x3acd('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x3acd('0x61')],'as':_0x3acd('0x62')}]})[_0x3acd('0x22')](handleEntityNotFound(_0x3a1ab5,null))[_0x3acd('0x22')](saveUpdates(_0x3808a2[_0x3acd('0x5a')],null))['then'](function(_0xc36a29){if(_0xc36a29){_0x5c7e54[_0x3acd('0x2a')]=_0xc36a29[_0x3acd('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0xc36a29['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3a1ab5,null))[_0x3acd('0x22')](function(_0x5db965){if(_0x5db965){return _0x5db965[_0x3acd('0x37')]({'UserId':_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x60')],'read1stAt':_['isNil'](_0x5db965[_0x3acd('0x64')])?moment()[_0x3acd('0x65')](_0x3acd('0x66')):undefined});}return null;})['then'](function(_0x9600d4){if(_0x9600d4){_0x5c7e54[_0x3acd('0x67')]=_0x9600d4[_0x3acd('0x63')]({'plain':!![]});interaction_log[_0x3acd('0x23')](_0x3acd('0x68'),_0x3808a2['user']['id'],_0x3808a2['user']['name'],_0x3808a2[_0x3acd('0x69')][_0x3acd('0x6a')],_0x5c7e54[_0x3acd('0x67')]['id'],_0x3808a2[_0x3acd('0x5a')]?JSON['stringify'](_0x3808a2[_0x3acd('0x5a')]):_0x3acd('0x6b'));return respondWithRpcPromise(_0x3acd('0x6c'),_0x3acd('0x6d'),_0x5c7e54);}return null;})['then'](function(_0x210e96){if(_0x210e96){if(_0x3808a2[_0x3acd('0x5a')][_0x3acd('0x6e')]){_0x5c7e54[_0x3acd('0x2a')][_0x3acd('0x6f')]=util[_0x3acd('0x65')](_0x3acd('0x70'),_0x3808a2[_0x3acd('0x69')][_0x3acd('0x3b')]);_0x5c7e54[_0x3acd('0x2a')]['channel']=_0x5c7e54[_0x3acd('0x71')];_0x5c7e54[_0x3acd('0x2a')][_0x3acd('0x72')]='accept';return respondWithRpcPromise(_0x3acd('0x73'),'EventManager',{'event':_0x3acd('0x74'),'message':_0x5c7e54['message']},client9002)['then'](function(){return _0x5c7e54;});}return _0x5c7e54;}return null;})[_0x3acd('0x22')](respondWithResult(_0x3a1ab5,null))[_0x3acd('0x2d')](handleError(_0x3a1ab5,null));};var interaction_log=require(_0x3acd('0x15'))(_0x3acd('0x5c'));exports['reject']=function(_0x4369f8,_0x54be99,_0x72d14d){var _0x3192a8={'agent':{},'channel':_0x3acd('0x75')};if(_0x4369f8[_0x3acd('0x5a')]['id']){delete _0x4369f8[_0x3acd('0x5a')]['id'];}_0x4369f8[_0x3acd('0x5a')][_0x3acd('0x60')]=_0x4369f8[_0x3acd('0x5a')][_0x3acd('0x60')]||_0x4369f8['user']['id'];_0x3192a8[_0x3acd('0x76')]['id']=_0x4369f8[_0x3acd('0x5a')][_0x3acd('0x60')];return db[_0x3acd('0x3d')][_0x3acd('0x59')]({'where':{'id':_0x4369f8[_0x3acd('0x56')]['id'],'UserId':null}})[_0x3acd('0x22')](handleEntityNotFound(_0x54be99,null))[_0x3acd('0x22')](function(_0x3c03ac){if(_0x3c03ac){_0x3192a8[_0x3acd('0x2a')]=_0x3c03ac[_0x3acd('0x63')]({'plain':!![]});return db[_0x3acd('0x77')][_0x3acd('0x59')]({'where':{'id':_0x3c03ac['FaxInteractionId']}});}return null;})[_0x3acd('0x22')](handleEntityNotFound(_0x54be99,null))[_0x3acd('0x22')](function(_0x1a59e4){if(_0x1a59e4){_0x3192a8[_0x3acd('0x67')]=_0x1a59e4[_0x3acd('0x63')]({'plain':!![]});interaction_log['info'](_0x3acd('0x78'),_0x4369f8['user']['id'],_0x4369f8[_0x3acd('0x69')][_0x3acd('0x3b')],_0x4369f8[_0x3acd('0x69')][_0x3acd('0x6a')],_0x3192a8[_0x3acd('0x67')]['id'],_0x4369f8[_0x3acd('0x5a')]?JSON[_0x3acd('0x27')](_0x4369f8[_0x3acd('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0x3acd('0x79'),_0x3192a8);}return null;})[_0x3acd('0x22')](function(_0x1355c8){if(_0x1355c8){_0x1355c8[_0x3acd('0x2a')][_0x3acd('0x6f')]=util[_0x3acd('0x65')]('SIP/%s',_0x4369f8['user'][_0x3acd('0x3b')]);_0x1355c8[_0x3acd('0x2a')][_0x3acd('0x71')]=_0x3192a8[_0x3acd('0x71')];_0x1355c8[_0x3acd('0x2a')][_0x3acd('0x72')]=_0x3acd('0x35');respondWithRpcPromise(_0x3acd('0x73'),'EventManager',{'event':_0x3acd('0x7a'),'message':_0x1355c8[_0x3acd('0x2a')]},client9002);return _0x3192a8;}return null;})[_0x3acd('0x22')](respondWithResult(_0x54be99,null))[_0x3acd('0x2d')](handleError(_0x54be99,null));};exports[_0x3acd('0x7b')]=function(_0x153f59,_0x3b88cf){var _0x29f3b0;return db[_0x3acd('0x3d')][_0x3acd('0x7b')](_0x153f59[_0x3acd('0x5a')],{})[_0x3acd('0x22')](function(_0x2a4871){_0x29f3b0=_0x2a4871;return db[_0x3acd('0x61')]['findOne']({'where':{'id':_0x29f3b0['ContactId']}});})['then'](function(_0x38cd44){if(_[_0x3acd('0x7c')](_0x38cd44)){return;}else{_0x29f3b0[_0x3acd('0x75')]=_0x38cd44[_0x3acd('0x75')];return db[_0x3acd('0x7d')]['findOne']({'where':{'id':_0x29f3b0['AttachmentId']}});}})[_0x3acd('0x22')](function(_0xd960aa){return respondWithRpcPromise(_0x3acd('0x7e'),'SendFax',{'FaxAccountId':_[_0x3acd('0x7c')](_0x153f59[_0x3acd('0x5a')])?undefined:_0x153f59[_0x3acd('0x5a')][_0x3acd('0x7f')],'path':_[_0x3acd('0x7c')](_0xd960aa)?undefined:util['format'](_0x3acd('0x80'),_0xd960aa[_0x3acd('0x81')]),'fax':_[_0x3acd('0x7c')](_0x29f3b0[_0x3acd('0x75')])?undefined:_0x29f3b0[_0x3acd('0x75')],'AttachmentId':_0x29f3b0['AttachmentId']},client9002);})['then'](respondWithResult(_0x3b88cf,0xc9))[_0x3acd('0x2d')](handleError(_0x3b88cf,null));};exports['download']=function(_0x54464d,_0x454c9f){var _0x3482cc=path['join'](config[_0x3acd('0x82')],_0x3acd('0x83'),_0x3acd('0x84'),_0x3acd('0x85'));return db[_0x3acd('0x3d')][_0x3acd('0x59')]({'where':{'id':_0x54464d[_0x3acd('0x56')]['id']},'include':[{'model':db[_0x3acd('0x7d')],'as':'Attachment'}]})[_0x3acd('0x22')](handleEntityNotFound(_0x454c9f,null))[_0x3acd('0x22')](function(_0x41cfb6){if(_0x41cfb6){return _0x454c9f[_0x3acd('0x86')](path[_0x3acd('0x87')](_0x3482cc,_0x41cfb6[_0x3acd('0x7d')]['basename']));}})[_0x3acd('0x2d')](handleError(_0x454c9f,null));}; \ No newline at end of file +var _0x4229=['then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','reject','destroy','stack','name','send','index','FaxMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','findAll','rows','include','options','find','update','body','params','describe','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','FaxInteraction','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','../../config/logger','agent','role','interaction','RejectMessage','rejectMessage','rejectmessage','create','CmContact','ContactId','fax','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','root','server','attachments','download','join','basename','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','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'];(function(_0x309385,_0x3ab38f){var _0x45b0f5=function(_0x4fa7e0){while(--_0x4fa7e0){_0x309385['push'](_0x309385['shift']());}};_0x45b0f5(++_0x3ab38f);}(_0x4229,0x169));var _0x9422=function(_0x2c3ce0,_0x426231){_0x2c3ce0=_0x2c3ce0-0x0;var _0x828e65=_0x4229[_0x2c3ce0];return _0x828e65;};'use strict';var pdf=require(_0x9422('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9422('0x1'));var jsonpatch=require(_0x9422('0x2'));var rp=require(_0x9422('0x3'));var moment=require(_0x9422('0x4'));var BPromise=require(_0x9422('0x5'));var Mustache=require(_0x9422('0x6'));var util=require(_0x9422('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9422('0x8'));var ejs=require(_0x9422('0x9'));var fs=require('fs');var _=require(_0x9422('0xa'));var squel=require(_0x9422('0xb'));var crypto=require(_0x9422('0xc'));var jsforce=require(_0x9422('0xd'));var deskjs=require(_0x9422('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9422('0xf'));var Papa=require('papaparse');var Redis=require(_0x9422('0x10'));var authService=require(_0x9422('0x11'));var qs=require(_0x9422('0x12'));var hardwareService=require(_0x9422('0x13'));var logger=require('../../config/logger')(_0x9422('0x14'));var utils=require(_0x9422('0x15'));var config=require('../../config/environment');var db=require(_0x9422('0x16'))['db'];config[_0x9422('0x17')]=_[_0x9422('0x18')](config[_0x9422('0x17')],{'host':_0x9422('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9422('0x17')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x9422('0x1a'));var client=jayson[_0x9422('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x9422('0x1b')][_0x9422('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3115f3,_0x138b04,_0x10fa00){if(_0x10fa00){var _0x34b8ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34b8ec[_0x9422('0x1d')](_0x138b04)){return _0x3115f3;}else{throw new Error(_0x9422('0x1e'));}}else{return _0x3115f3;}}function respondWithRpcPromise(_0x477829,_0x32adac,_0x5db493,_0x3f6fde){return new BPromise(function(_0x1df79e,_0x2b6d71){var _0x32e4a5=_0x3f6fde||client;return _0x32e4a5[_0x9422('0x1f')](_0x477829,_0x5db493)[_0x9422('0x20')](function(_0x42e7d7){logger[_0x9422('0x21')]('FaxMessage,\x20%s,\x20%s',_0x32adac,_0x9422('0x22'));logger['debug'](_0x9422('0x23'),_0x32adac,_0x9422('0x22'),JSON[_0x9422('0x24')](_0x42e7d7));if(_0x42e7d7[_0x9422('0x25')]){if(_0x42e7d7[_0x9422('0x25')]['code']===0x1f4){logger[_0x9422('0x25')](_0x9422('0x26'),_0x32adac,_0x42e7d7[_0x9422('0x25')][_0x9422('0x27')]);return _0x2b6d71(_0x42e7d7[_0x9422('0x25')][_0x9422('0x27')]);}logger[_0x9422('0x25')](_0x9422('0x26'),_0x32adac,_0x42e7d7[_0x9422('0x25')]['message']);return _0x1df79e(_0x42e7d7[_0x9422('0x25')][_0x9422('0x27')]);}else{logger[_0x9422('0x21')](_0x9422('0x26'),_0x32adac,_0x9422('0x22'));_0x1df79e(_0x42e7d7[_0x9422('0x28')][_0x9422('0x27')]);}})[_0x9422('0x29')](function(_0x410190){logger[_0x9422('0x25')](_0x9422('0x26'),_0x32adac,_0x410190);_0x2b6d71(_0x410190);});});}function respondWithStatusCode(_0x1b74eb,_0x121780){_0x121780=_0x121780||0xcc;return function(_0x160646){if(_0x160646){return _0x1b74eb[_0x9422('0x2a')](_0x121780);}return _0x1b74eb['status'](_0x121780)[_0x9422('0x2b')]();};}function respondWithResult(_0x4d38a9,_0x12e149){_0x12e149=_0x12e149||0xc8;return function(_0x3a5d9b){if(_0x3a5d9b){return _0x4d38a9[_0x9422('0x2c')](_0x12e149)[_0x9422('0x2d')](_0x3a5d9b);}};}function respondWithFilteredResult(_0x13d4dd,_0x3dae13){return function(_0x4f535f){if(_0x4f535f){var _0x4b5790=_0x4f535f[_0x9422('0x2e')],_0x24fe45=_0x3dae13[_0x9422('0x2f')],_0x2bdfd9=_0x3dae13[_0x9422('0x2f')]+_0x3dae13[_0x9422('0x30')],_0x4619fd;if(_0x2bdfd9>=_0x4b5790){_0x2bdfd9=_0x4b5790;_0x4619fd=0xc8;}else{_0x4619fd=0xce;}_0x13d4dd[_0x9422('0x2c')](_0x4619fd);return _0x13d4dd[_0x9422('0x31')]('Content-Range',_0x24fe45+'-'+_0x2bdfd9+'/'+_0x4b5790)[_0x9422('0x2d')](_0x4f535f);}return null;};}function patchUpdates(_0x1ac1ac){return function(_0x4ab677){try{jsonpatch['apply'](_0x4ab677,_0x1ac1ac,!![]);}catch(_0x59d9e8){return BPromise[_0x9422('0x32')](_0x59d9e8);}return _0x4ab677['save']();};}function saveUpdates(_0x368adb,_0x273846){return function(_0x2260b2){if(_0x2260b2){return _0x2260b2['update'](_0x368adb)[_0x9422('0x20')](function(_0x49e147){return _0x49e147;});}return null;};}function removeEntity(_0x10ce29,_0x235ebf){return function(_0x10b4c8){if(_0x10b4c8){return _0x10b4c8[_0x9422('0x33')]()[_0x9422('0x20')](function(){_0x10ce29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x268a7c,_0x5c5d6e){return function(_0x4a6ad0){if(!_0x4a6ad0){_0x268a7c[_0x9422('0x2a')](0x194);}return _0x4a6ad0;};}function handleError(_0x4ee531,_0x216424){_0x216424=_0x216424||0x1f4;return function(_0x40f923){logger['error'](_0x40f923[_0x9422('0x34')]);if(_0x40f923[_0x9422('0x35')]){delete _0x40f923[_0x9422('0x35')];}_0x4ee531[_0x9422('0x2c')](_0x216424)[_0x9422('0x36')](_0x40f923);};}exports[_0x9422('0x37')]=function(_0x19fde1,_0x5b4c88){var _0x5b1a23={},_0x164951={},_0xa1570d={'count':0x0,'rows':[]};var _0x558c09=db[_0x9422('0x38')][_0x9422('0x39')];_0x164951['model']=_[_0x9422('0x3a')](_0x558c09);_0x164951[_0x9422('0x3b')]=_[_0x9422('0x3a')](_0x19fde1[_0x9422('0x3b')]);_0x164951[_0x9422('0x3c')]=_[_0x9422('0x3d')](_0x164951[_0x9422('0x3e')],_0x164951['query']);_0x5b1a23[_0x9422('0x3f')]=_['intersection'](_0x164951[_0x9422('0x3e')],qs[_0x9422('0x40')](_0x19fde1[_0x9422('0x3b')][_0x9422('0x40')]));_0x5b1a23[_0x9422('0x3f')]=_0x5b1a23['attributes'][_0x9422('0x41')]?_0x5b1a23[_0x9422('0x3f')]:_0x164951['model'];if(!_0x19fde1[_0x9422('0x3b')]['hasOwnProperty'](_0x9422('0x42'))){_0x5b1a23[_0x9422('0x30')]=qs[_0x9422('0x30')](_0x19fde1['query'][_0x9422('0x30')]);_0x5b1a23[_0x9422('0x2f')]=qs[_0x9422('0x2f')](_0x19fde1[_0x9422('0x3b')][_0x9422('0x2f')]);}_0x5b1a23[_0x9422('0x43')]=qs[_0x9422('0x44')](_0x19fde1[_0x9422('0x3b')][_0x9422('0x44')]);_0x5b1a23['where']=qs[_0x9422('0x3c')](_[_0x9422('0x45')](_0x19fde1[_0x9422('0x3b')],_0x164951[_0x9422('0x3c')]));if(_0x19fde1[_0x9422('0x3b')][_0x9422('0x46')]){_0x5b1a23[_0x9422('0x47')]=_[_0x9422('0x48')](_0x5b1a23[_0x9422('0x47')],{'$or':_[_0x9422('0x49')](_0x558c09,function(_0x51b93b){if(_0x51b93b[_0x9422('0x4a')][_0x9422('0x4b')]!==_0x9422('0x4c')){var _0x29a5c0={};_0x29a5c0[_0x51b93b['field']]={'$like':'%'+_0x19fde1[_0x9422('0x3b')][_0x9422('0x46')]+'%'};return _0x29a5c0;}})});}_0x5b1a23=_[_0x9422('0x48')]({},_0x5b1a23,_0x19fde1['options']);var _0x1ce2b9={'where':_0x5b1a23[_0x9422('0x47')]};return db['FaxMessage']['count'](_0x1ce2b9)[_0x9422('0x20')](function(_0x550e97){_0xa1570d[_0x9422('0x2e')]=_0x550e97;if(_0x19fde1[_0x9422('0x3b')]['includeAll']){_0x5b1a23['include']=[{'all':!![]}];}return db[_0x9422('0x38')][_0x9422('0x4d')](_0x5b1a23);})[_0x9422('0x20')](function(_0x2ca2e6){_0xa1570d[_0x9422('0x4e')]=_0x2ca2e6;return _0xa1570d;})[_0x9422('0x20')](respondWithFilteredResult(_0x5b4c88,_0x5b1a23))[_0x9422('0x29')](handleError(_0x5b4c88,null));};exports['show']=function(_0x56ce21,_0x1b07d9){var _0x290cb9={'raw':!![],'where':{'id':_0x56ce21['params']['id']}},_0x2cfbdc={};_0x2cfbdc[_0x9422('0x3e')]=_[_0x9422('0x3a')](db['FaxMessage']['rawAttributes']);_0x2cfbdc[_0x9422('0x3b')]=_[_0x9422('0x3a')](_0x56ce21[_0x9422('0x3b')]);_0x2cfbdc[_0x9422('0x3c')]=_[_0x9422('0x3d')](_0x2cfbdc[_0x9422('0x3e')],_0x2cfbdc[_0x9422('0x3b')]);_0x290cb9[_0x9422('0x3f')]=_['intersection'](_0x2cfbdc[_0x9422('0x3e')],qs[_0x9422('0x40')](_0x56ce21[_0x9422('0x3b')]['fields']));_0x290cb9[_0x9422('0x3f')]=_0x290cb9['attributes'][_0x9422('0x41')]?_0x290cb9[_0x9422('0x3f')]:_0x2cfbdc[_0x9422('0x3e')];if(_0x56ce21['query']['includeAll']){_0x290cb9[_0x9422('0x4f')]=[{'all':!![]}];}_0x290cb9=_[_0x9422('0x48')]({},_0x290cb9,_0x56ce21[_0x9422('0x50')]);return db[_0x9422('0x38')][_0x9422('0x51')](_0x290cb9)['then'](handleEntityNotFound(_0x1b07d9,null))[_0x9422('0x20')](respondWithResult(_0x1b07d9,null))[_0x9422('0x29')](handleError(_0x1b07d9,null));};exports[_0x9422('0x52')]=function(_0x4d04c6,_0x222310){if(_0x4d04c6[_0x9422('0x53')]['id']){delete _0x4d04c6['body']['id'];}return db[_0x9422('0x38')][_0x9422('0x51')]({'where':{'id':_0x4d04c6[_0x9422('0x54')]['id']}})[_0x9422('0x20')](handleEntityNotFound(_0x222310,null))[_0x9422('0x20')](saveUpdates(_0x4d04c6[_0x9422('0x53')],null))[_0x9422('0x20')](respondWithResult(_0x222310,null))[_0x9422('0x29')](handleError(_0x222310,null));};exports['destroy']=function(_0x598c6d,_0x12b2c7){return db[_0x9422('0x38')][_0x9422('0x51')]({'where':{'id':_0x598c6d[_0x9422('0x54')]['id']}})[_0x9422('0x20')](handleEntityNotFound(_0x12b2c7,null))[_0x9422('0x20')](removeEntity(_0x12b2c7,null))[_0x9422('0x29')](handleError(_0x12b2c7,null));};exports[_0x9422('0x55')]=function(_0x57dce6,_0x121b32){return db[_0x9422('0x38')][_0x9422('0x55')]()[_0x9422('0x20')](respondWithResult(_0x121b32,null))[_0x9422('0x29')](handleError(_0x121b32,null));};var interaction_log=require('../../config/logger')(_0x9422('0x56'));exports['accept']=function(_0x3a85d5,_0x39cc8c,_0x27aad5){var _0x2a77c5={'channel':'fax'};if(_0x3a85d5['body']['id']){delete _0x3a85d5['body']['id'];}_0x3a85d5[_0x9422('0x53')][_0x9422('0x57')]=!![];_0x3a85d5[_0x9422('0x53')][_0x9422('0x58')]=moment()[_0x9422('0x59')](_0x9422('0x5a'));_0x3a85d5['body']['UserId']=_0x3a85d5[_0x9422('0x53')][_0x9422('0x5b')]||_0x3a85d5[_0x9422('0x5c')]['id'];return db['FaxMessage'][_0x9422('0x51')]({'where':{'id':_0x3a85d5[_0x9422('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x9422('0x5d')}]})[_0x9422('0x20')](handleEntityNotFound(_0x39cc8c,null))[_0x9422('0x20')](saveUpdates(_0x3a85d5[_0x9422('0x53')],null))[_0x9422('0x20')](function(_0x2064d3){if(_0x2064d3){_0x2a77c5[_0x9422('0x27')]=_0x2064d3['get']({'plain':!![]});return db[_0x9422('0x5e')][_0x9422('0x51')]({'where':{'id':_0x2064d3[_0x9422('0x5f')]}});}return null;})[_0x9422('0x20')](handleEntityNotFound(_0x39cc8c,null))[_0x9422('0x20')](function(_0x26bf7d){if(_0x26bf7d){return _0x26bf7d[_0x9422('0x52')]({'UserId':_0x3a85d5['body'][_0x9422('0x5b')],'read1stAt':_[_0x9422('0x60')](_0x26bf7d[_0x9422('0x61')])?moment()[_0x9422('0x59')](_0x9422('0x5a')):undefined});}return null;})[_0x9422('0x20')](function(_0x4d3b8a){if(_0x4d3b8a){_0x2a77c5['interaction']=_0x4d3b8a[_0x9422('0x62')]({'plain':!![]});interaction_log[_0x9422('0x21')](_0x9422('0x63'),_0x3a85d5[_0x9422('0x5c')]['id'],_0x3a85d5[_0x9422('0x5c')][_0x9422('0x35')],_0x3a85d5['user']['role'],_0x2a77c5['interaction']['id'],_0x3a85d5[_0x9422('0x53')]?JSON[_0x9422('0x24')](_0x3a85d5[_0x9422('0x53')]):_0x9422('0x64'));return respondWithRpcPromise(_0x9422('0x65'),_0x9422('0x66'),_0x2a77c5);}return null;})['then'](function(_0x3b84cb){if(_0x3b84cb){if(_0x3a85d5['body'][_0x9422('0x67')]){_0x2a77c5[_0x9422('0x27')][_0x9422('0x68')]=util[_0x9422('0x59')](_0x9422('0x69'),_0x3a85d5[_0x9422('0x5c')][_0x9422('0x35')]);_0x2a77c5[_0x9422('0x27')][_0x9422('0x6a')]=_0x2a77c5['channel'];_0x2a77c5[_0x9422('0x27')][_0x9422('0x6b')]=_0x9422('0x6c');return respondWithRpcPromise('EventManager',_0x9422('0x6d'),{'event':'acceptmessage','message':_0x2a77c5[_0x9422('0x27')]},client9002)[_0x9422('0x20')](function(){return _0x2a77c5;});}return _0x2a77c5;}return null;})['then'](respondWithResult(_0x39cc8c,null))[_0x9422('0x29')](handleError(_0x39cc8c,null));};var interaction_log=require(_0x9422('0x6e'))(_0x9422('0x56'));exports[_0x9422('0x32')]=function(_0x27e506,_0x5d43f0,_0x36f138){var _0x4d41e1={'agent':{},'channel':'fax'};if(_0x27e506[_0x9422('0x53')]['id']){delete _0x27e506[_0x9422('0x53')]['id'];}_0x27e506['body'][_0x9422('0x5b')]=_0x27e506[_0x9422('0x53')][_0x9422('0x5b')]||_0x27e506[_0x9422('0x5c')]['id'];_0x4d41e1[_0x9422('0x6f')]['id']=_0x27e506[_0x9422('0x53')]['UserId'];return db[_0x9422('0x38')][_0x9422('0x51')]({'where':{'id':_0x27e506[_0x9422('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d43f0,null))[_0x9422('0x20')](function(_0x40e305){if(_0x40e305){_0x4d41e1[_0x9422('0x27')]=_0x40e305['get']({'plain':!![]});return db['FaxInteraction'][_0x9422('0x51')]({'where':{'id':_0x40e305[_0x9422('0x5f')]}});}return null;})[_0x9422('0x20')](handleEntityNotFound(_0x5d43f0,null))[_0x9422('0x20')](function(_0x51ee7c){if(_0x51ee7c){_0x4d41e1['interaction']=_0x51ee7c[_0x9422('0x62')]({'plain':!![]});interaction_log[_0x9422('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x27e506[_0x9422('0x5c')]['id'],_0x27e506[_0x9422('0x5c')][_0x9422('0x35')],_0x27e506[_0x9422('0x5c')][_0x9422('0x70')],_0x4d41e1[_0x9422('0x71')]['id'],_0x27e506[_0x9422('0x53')]?JSON[_0x9422('0x24')](_0x27e506[_0x9422('0x53')]):_0x9422('0x64'));return respondWithRpcPromise(_0x9422('0x72'),_0x9422('0x73'),_0x4d41e1);}return null;})[_0x9422('0x20')](function(_0x22e9d0){if(_0x22e9d0){_0x22e9d0[_0x9422('0x27')][_0x9422('0x68')]=util[_0x9422('0x59')](_0x9422('0x69'),_0x27e506[_0x9422('0x5c')][_0x9422('0x35')]);_0x22e9d0[_0x9422('0x27')]['channel']=_0x4d41e1[_0x9422('0x6a')];_0x22e9d0[_0x9422('0x27')][_0x9422('0x6b')]=_0x9422('0x32');respondWithRpcPromise(_0x9422('0x6d'),_0x9422('0x6d'),{'event':_0x9422('0x74'),'message':_0x22e9d0[_0x9422('0x27')]},client9002);return _0x4d41e1;}return null;})['then'](respondWithResult(_0x5d43f0,null))[_0x9422('0x29')](handleError(_0x5d43f0,null));};exports[_0x9422('0x75')]=function(_0x51881e,_0x32edcc){var _0x5c71a5;return db['FaxMessage'][_0x9422('0x75')](_0x51881e[_0x9422('0x53')],{})['then'](function(_0xfef340){_0x5c71a5=_0xfef340;return db[_0x9422('0x76')]['findOne']({'where':{'id':_0x5c71a5[_0x9422('0x77')]}});})[_0x9422('0x20')](function(_0x48c8af){if(_['isNil'](_0x48c8af)){return;}else{_0x5c71a5[_0x9422('0x78')]=_0x48c8af[_0x9422('0x78')];return db[_0x9422('0x79')]['findOne']({'where':{'id':_0x5c71a5[_0x9422('0x7a')]}});}})['then'](function(_0x658ffa){return respondWithRpcPromise(_0x9422('0x7b'),_0x9422('0x7b'),{'FaxAccountId':_['isNil'](_0x51881e[_0x9422('0x53')])?undefined:_0x51881e[_0x9422('0x53')]['FaxAccountId'],'path':_[_0x9422('0x60')](_0x658ffa)?undefined:util[_0x9422('0x59')](_0x9422('0x7c'),_0x658ffa['basename']),'fax':_[_0x9422('0x60')](_0x5c71a5[_0x9422('0x78')])?undefined:_0x5c71a5[_0x9422('0x78')],'AttachmentId':_0x5c71a5['AttachmentId']},client9002);})[_0x9422('0x20')](respondWithResult(_0x32edcc,0xc9))[_0x9422('0x29')](handleError(_0x32edcc,null));};exports['download']=function(_0x2d4613,_0x3e8850){var _0xbd0595=path['join'](config[_0x9422('0x7d')],_0x9422('0x7e'),'files',_0x9422('0x7f'));return db[_0x9422('0x38')][_0x9422('0x51')]({'where':{'id':_0x2d4613[_0x9422('0x54')]['id']},'include':[{'model':db['Attachment'],'as':_0x9422('0x79')}]})[_0x9422('0x20')](handleEntityNotFound(_0x3e8850,null))[_0x9422('0x20')](function(_0x2c218a){if(_0x2c218a){return _0x3e8850[_0x9422('0x80')](path[_0x9422('0x81')](_0xbd0595,_0x2c218a[_0x9422('0x79')][_0x9422('0x82')]));}})[_0x9422('0x29')](handleError(_0x3e8850,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 20067fd..b1d8d2d 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 _0x2085=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3f7b40,_0x52d4ce){var _0x1b0d75=function(_0xc31ce8){while(--_0xc31ce8){_0x3f7b40['push'](_0x3f7b40['shift']());}};_0x1b0d75(++_0x52d4ce);}(_0x2085,0x13f));var _0x5208=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x2085[_0xe3e0af];return _0x4828e9;};'use strict';var EventEmitter=require(_0x5208('0x0'));var FaxMessage=require(_0x5208('0x1'))['db'][_0x5208('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5208('0x3')](0x0);var events={'afterCreate':_0x5208('0x4'),'afterUpdate':_0x5208('0x5'),'afterDestroy':_0x5208('0x6')};function emitEvent(_0x1d81ca){return function(_0x478d1f,_0x39ee28,_0x189245){FaxMessageEvents[_0x5208('0x7')](_0x1d81ca+':'+_0x478d1f['id'],_0x478d1f);FaxMessageEvents[_0x5208('0x7')](_0x1d81ca,_0x478d1f);_0x189245(null);};}for(var e in events){if(events[_0x5208('0x8')](e)){var event=events[e];FaxMessage[_0x5208('0x9')](e,emitEvent(event));}}module[_0x5208('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0xc654=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage'];(function(_0x3987d7,_0x3069cc){var _0x4aae42=function(_0x38483e){while(--_0x38483e){_0x3987d7['push'](_0x3987d7['shift']());}};_0x4aae42(++_0x3069cc);}(_0xc654,0x1a2));var _0x4c65=function(_0x53a1be,_0x42dff2){_0x53a1be=_0x53a1be-0x0;var _0x38ae84=_0xc654[_0x53a1be];return _0x38ae84;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x4c65('0x0'))['db'][_0x4c65('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4c65('0x2')](0x0);var events={'afterCreate':_0x4c65('0x3'),'afterUpdate':_0x4c65('0x4'),'afterDestroy':_0x4c65('0x5')};function emitEvent(_0x3b9a7f){return function(_0x1d80dd,_0x160b8a,_0x3ed9fc){FaxMessageEvents[_0x4c65('0x6')](_0x3b9a7f+':'+_0x1d80dd['id'],_0x1d80dd);FaxMessageEvents[_0x4c65('0x6')](_0x3b9a7f,_0x1d80dd);_0x3ed9fc(null);};}for(var e in events){if(events[_0x4c65('0x7')](e)){var event=events[e];FaxMessage[_0x4c65('0x8')](e,emitEvent(event));}}module[_0x4c65('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 121249c..befd7f6 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 _0x4f48=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','direction','toLowerCase','out','isNil','FaxInteraction','FaxInteractionId','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1e44e6,_0x4bde3a){var _0x3fd2f3=function(_0x9db03d){while(--_0x9db03d){_0x1e44e6['push'](_0x1e44e6['shift']());}};_0x3fd2f3(++_0x4bde3a);}(_0x4f48,0x1f1));var _0x84f4=function(_0x36d066,_0xb42fb3){_0x36d066=_0x36d066-0x0;var _0x131fc5=_0x4f48[_0x36d066];return _0x131fc5;};'use strict';var _=require(_0x84f4('0x0'));var util=require('util');var logger=require(_0x84f4('0x1'))('api');var moment=require(_0x84f4('0x2'));var BPromise=require(_0x84f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84f4('0x4'));var rimraf=require(_0x84f4('0x5'));var config=require(_0x84f4('0x6'));var attributes=require(_0x84f4('0x7'));module[_0x84f4('0x8')]=function(_0x3d6d98,_0x522d5d){return _0x3d6d98[_0x84f4('0x9')](_0x84f4('0xa'),attributes,{'tableName':_0x84f4('0xb'),'paranoid':![],'indexes':[{'name':_0x84f4('0xc'),'fields':[_0x84f4('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f4e1b,_0x41ae1b,_0x37decf){var _0x38a11b=_0x3d6d98['models'];var _0x5f3fa8=_0x4f4e1b['get']({'plain':!![]});if(_0x5f3fa8[_0x84f4('0xe')][_0x84f4('0xf')]()==='in'||_0x5f3fa8[_0x84f4('0xe')][_0x84f4('0xf')]()===_0x84f4('0x10')&&!_0x5f3fa8['secret']&&!_[_0x84f4('0x11')](_0x5f3fa8['UserId'])){_0x38a11b[_0x84f4('0x12')]['findOne']({'where':{'id':_0x5f3fa8[_0x84f4('0x13')]}})['then'](function(_0xd3239c){if(_0xd3239c){_0xd3239c[_0x84f4('0x14')]({'lastMsgAt':_0x5f3fa8[_0x84f4('0x15')],'lastMsgDirection':_0x5f3fa8[_0x84f4('0xe')]['toLowerCase']()});}})['catch'](function(_0x447ec0){console['error'](_0x447ec0);});}_0x37decf();}},'charset':_0x84f4('0x16'),'collate':_0x84f4('0x17')});}; \ No newline at end of file +var _0xc82e=['fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage'];(function(_0xe57a68,_0x21a065){var _0x202391=function(_0x34ae62){while(--_0x34ae62){_0xe57a68['push'](_0xe57a68['shift']());}};_0x202391(++_0x21a065);}(_0xc82e,0x1ed));var _0xec82=function(_0x5c93a8,_0x32f252){_0x5c93a8=_0x5c93a8-0x0;var _0x19799d=_0xc82e[_0x5c93a8];return _0x19799d;};'use strict';var _=require(_0xec82('0x0'));var util=require(_0xec82('0x1'));var logger=require(_0xec82('0x2'))(_0xec82('0x3'));var moment=require('moment');var BPromise=require(_0xec82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec82('0x5'));var rimraf=require('rimraf');var config=require(_0xec82('0x6'));var attributes=require(_0xec82('0x7'));module[_0xec82('0x8')]=function(_0x2218db,_0x59a7e6){return _0x2218db[_0xec82('0x9')](_0xec82('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xec82('0xb'),'fields':[_0xec82('0xc')],'type':_0xec82('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2abb60,_0x352bb5,_0x3870e4){var _0x571712=_0x2218db['models'];var _0x26b5f6=_0x2abb60[_0xec82('0xe')]({'plain':!![]});if(_0x26b5f6[_0xec82('0xf')][_0xec82('0x10')]()==='in'||_0x26b5f6[_0xec82('0xf')]['toLowerCase']()===_0xec82('0x11')&&!_0x26b5f6[_0xec82('0x12')]&&!_['isNil'](_0x26b5f6[_0xec82('0x13')])){_0x571712[_0xec82('0x14')][_0xec82('0x15')]({'where':{'id':_0x26b5f6[_0xec82('0x16')]}})['then'](function(_0x3ac91d){if(_0x3ac91d){_0x3ac91d['update']({'lastMsgAt':_0x26b5f6[_0xec82('0x17')],'lastMsgDirection':_0x26b5f6[_0xec82('0xf')]['toLowerCase']()});}})[_0xec82('0x18')](function(_0x468412){console[_0xec82('0x19')](_0x468412);});}_0x3870e4();}},'charset':_0xec82('0x1a'),'collate':_0xec82('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 970ce21..bcfc3c9 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 _0x3c17=['body','options','then','debug','catch','UpdateFaxMessage','update','raw','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create'];(function(_0xb553f6,_0x225567){var _0x5eebf9=function(_0x4b8c8d){while(--_0x4b8c8d){_0xb553f6['push'](_0xb553f6['shift']());}};_0x5eebf9(++_0x225567);}(_0x3c17,0x1a1));var _0x73c1=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3c17[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var moment=require(_0x73c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x73c1('0x2'));var fs=require('fs');var Redis=require(_0x73c1('0x3'));var db=require(_0x73c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73c1('0x5'))(_0x73c1('0x6'));var config=require(_0x73c1('0x7'));var jayson=require(_0x73c1('0x8'));var client=jayson['client'][_0x73c1('0x9')]({'port':0x232a});config['redis']=_[_0x73c1('0xa')](config[_0x73c1('0xb')],{'host':_0x73c1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x73c1('0xd'))[_0x73c1('0xe')](socket);function respondWithRpcPromise(_0x400875,_0x16c774,_0x2b2578){return new BPromise(function(_0x11518f,_0x45c37d){return client['request'](_0x400875,_0x2b2578)['then'](function(_0x1c712c){logger[_0x73c1('0xf')](_0x73c1('0x10'),_0x16c774,_0x73c1('0x11'));logger['debug'](_0x73c1('0x12'),_0x16c774,'request\x20sent',JSON[_0x73c1('0x13')](_0x1c712c));if(_0x1c712c['error']){if(_0x1c712c[_0x73c1('0x14')][_0x73c1('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x16c774,_0x1c712c[_0x73c1('0x14')]['message']);return _0x45c37d(_0x1c712c[_0x73c1('0x14')]['message']);}logger[_0x73c1('0x14')]('FaxMessage,\x20%s,\x20%s',_0x16c774,_0x1c712c[_0x73c1('0x14')][_0x73c1('0x16')]);return _0x11518f(_0x1c712c[_0x73c1('0x14')][_0x73c1('0x16')]);}else{logger[_0x73c1('0xf')](_0x73c1('0x10'),_0x16c774,_0x73c1('0x11'));_0x11518f(_0x1c712c[_0x73c1('0x17')][_0x73c1('0x16')]);}})['catch'](function(_0x16e509){logger[_0x73c1('0x14')](_0x73c1('0x10'),_0x16c774,_0x16e509);_0x45c37d(_0x16e509);});});}exports[_0x73c1('0x18')]=function(_0x4b1b94){var _0x3fbaea=this;return new Promise(function(_0x2c5eda,_0x344fb5){return db[_0x73c1('0x19')][_0x73c1('0x1a')](_0x4b1b94[_0x73c1('0x1b')],{'raw':_0x4b1b94[_0x73c1('0x1c')]?_0x4b1b94[_0x73c1('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x73c1('0x1d')](function(_0x32b379){logger[_0x73c1('0xf')]('CreateFaxMessage',_0x4b1b94);logger[_0x73c1('0x1e')](_0x73c1('0x18'),_0x4b1b94,JSON[_0x73c1('0x13')](_0x32b379));_0x2c5eda(_0x32b379);})[_0x73c1('0x1f')](function(_0x934640){logger['error'](_0x73c1('0x18'),_0x934640['message'],_0x4b1b94);_0x344fb5(_0x3fbaea['error'](0x1f4,_0x934640[_0x73c1('0x16')]));});});};exports[_0x73c1('0x20')]=function(_0x1e6e1d){var _0x1c54aa=this;return new Promise(function(_0x123cc0,_0x30ec73){return db[_0x73c1('0x19')][_0x73c1('0x21')](_0x1e6e1d[_0x73c1('0x1b')],{'raw':_0x1e6e1d[_0x73c1('0x1c')]?_0x1e6e1d[_0x73c1('0x1c')][_0x73c1('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e6e1d[_0x73c1('0x1c')]?_0x1e6e1d[_0x73c1('0x1c')]['where']||null:null,'attributes':_0x1e6e1d[_0x73c1('0x1c')]?_0x1e6e1d[_0x73c1('0x1c')][_0x73c1('0x23')]||null:null,'limit':_0x1e6e1d[_0x73c1('0x1c')]?_0x1e6e1d[_0x73c1('0x1c')][_0x73c1('0x24')]||null:null})[_0x73c1('0x1d')](function(_0x45c411){logger[_0x73c1('0xf')]('UpdateFaxMessage',_0x1e6e1d);logger['debug'](_0x73c1('0x20'),_0x1e6e1d,JSON[_0x73c1('0x13')](_0x45c411));_0x123cc0(_0x45c411);})[_0x73c1('0x1f')](function(_0x2a9ff8){logger['error'](_0x73c1('0x20'),_0x2a9ff8[_0x73c1('0x16')],_0x1e6e1d);_0x30ec73(_0x1c54aa[_0x73c1('0x14')](0x1f4,_0x2a9ff8['message']));});});}; \ No newline at end of file +var _0xc7a3=['../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','UpdateFaxMessage','update','body','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x3bc9d7,_0x4995a9){_0x3bc9d7=_0x3bc9d7-0x0;var _0x350e76=_0xc7a3[_0x3bc9d7];return _0x350e76;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var moment=require(_0x3c7a('0x1'));var BPromise=require(_0x3c7a('0x2'));var rs=require(_0x3c7a('0x3'));var fs=require('fs');var Redis=require(_0x3c7a('0x4'));var db=require(_0x3c7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c7a('0x6'))(_0x3c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c7a('0x8'));var client=jayson[_0x3c7a('0x9')][_0x3c7a('0xa')]({'port':0x232a});config['redis']=_[_0x3c7a('0xb')](config['redis'],{'host':_0x3c7a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c7a('0xd')]));require(_0x3c7a('0xe'))[_0x3c7a('0xf')](socket);function respondWithRpcPromise(_0x5902a0,_0x32633f,_0x314593){return new BPromise(function(_0x590cb9,_0x298840){return client['request'](_0x5902a0,_0x314593)[_0x3c7a('0x10')](function(_0x4e5413){logger[_0x3c7a('0x11')](_0x3c7a('0x12'),_0x32633f,_0x3c7a('0x13'));logger[_0x3c7a('0x14')](_0x3c7a('0x15'),_0x32633f,'request\x20sent',JSON[_0x3c7a('0x16')](_0x4e5413));if(_0x4e5413[_0x3c7a('0x17')]){if(_0x4e5413[_0x3c7a('0x17')][_0x3c7a('0x18')]===0x1f4){logger[_0x3c7a('0x17')]('FaxMessage,\x20%s,\x20%s',_0x32633f,_0x4e5413[_0x3c7a('0x17')][_0x3c7a('0x19')]);return _0x298840(_0x4e5413['error']['message']);}logger[_0x3c7a('0x17')](_0x3c7a('0x12'),_0x32633f,_0x4e5413[_0x3c7a('0x17')]['message']);return _0x590cb9(_0x4e5413[_0x3c7a('0x17')]['message']);}else{logger[_0x3c7a('0x11')](_0x3c7a('0x12'),_0x32633f,_0x3c7a('0x13'));_0x590cb9(_0x4e5413[_0x3c7a('0x1a')][_0x3c7a('0x19')]);}})[_0x3c7a('0x1b')](function(_0x5975de){logger[_0x3c7a('0x17')](_0x3c7a('0x12'),_0x32633f,_0x5975de);_0x298840(_0x5975de);});});}exports[_0x3c7a('0x1c')]=function(_0xbe7a8f){var _0x3a79e3=this;return new Promise(function(_0x320730,_0x11a06b){return db[_0x3c7a('0x1d')][_0x3c7a('0x1e')](_0xbe7a8f['body'],{'raw':_0xbe7a8f[_0x3c7a('0x1f')]?_0xbe7a8f['options'][_0x3c7a('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x40d24e){logger[_0x3c7a('0x11')](_0x3c7a('0x1c'),_0xbe7a8f);logger[_0x3c7a('0x14')](_0x3c7a('0x1c'),_0xbe7a8f,JSON[_0x3c7a('0x16')](_0x40d24e));_0x320730(_0x40d24e);})[_0x3c7a('0x1b')](function(_0x1e50d1){logger[_0x3c7a('0x17')](_0x3c7a('0x1c'),_0x1e50d1[_0x3c7a('0x19')],_0xbe7a8f);_0x11a06b(_0x3a79e3[_0x3c7a('0x17')](0x1f4,_0x1e50d1['message']));});});};exports[_0x3c7a('0x21')]=function(_0x154930){var _0x37cc40=this;return new Promise(function(_0x3829de,_0x9b910c){return db[_0x3c7a('0x1d')][_0x3c7a('0x22')](_0x154930[_0x3c7a('0x23')],{'raw':_0x154930['options']?_0x154930[_0x3c7a('0x1f')][_0x3c7a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x154930[_0x3c7a('0x1f')]?_0x154930[_0x3c7a('0x1f')][_0x3c7a('0x24')]||null:null,'attributes':_0x154930[_0x3c7a('0x1f')]?_0x154930[_0x3c7a('0x1f')][_0x3c7a('0x25')]||null:null,'limit':_0x154930[_0x3c7a('0x1f')]?_0x154930[_0x3c7a('0x1f')][_0x3c7a('0x26')]||null:null})[_0x3c7a('0x10')](function(_0x18a346){logger[_0x3c7a('0x11')](_0x3c7a('0x21'),_0x154930);logger[_0x3c7a('0x14')](_0x3c7a('0x21'),_0x154930,JSON[_0x3c7a('0x16')](_0x18a346));_0x3829de(_0x18a346);})[_0x3c7a('0x1b')](function(_0x34331a){logger[_0x3c7a('0x17')](_0x3c7a('0x21'),_0x34331a['message'],_0x154930);_0x9b910c(_0x37cc40['error'](0x1f4,_0x34331a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index da4dcf0..70b69f2 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 _0xc997=['faxMessage:','save','remove','update','emit','removeListener','register'];(function(_0x1531b7,_0x37a5dd){var _0x187e7f=function(_0x31e3a7){while(--_0x31e3a7){_0x1531b7['push'](_0x1531b7['shift']());}};_0x187e7f(++_0x37a5dd);}(_0xc997,0x1ac));var _0x7c99=function(_0x4965f6,_0x2d7fd1){_0x4965f6=_0x4965f6-0x0;var _0x426ac8=_0xc997[_0x4965f6];return _0x426ac8;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x7c99('0x0'),_0x7c99('0x1'),_0x7c99('0x2')];function createListener(_0x3997dc,_0x17f440){return function(_0x4e5e4d){_0x17f440[_0x7c99('0x3')](_0x3997dc,_0x4e5e4d);};}function removeListener(_0x114fe0,_0x705244){return function(){FaxMessageEvents[_0x7c99('0x4')](_0x114fe0,_0x705244);};}exports[_0x7c99('0x5')]=function(_0x404ffb){for(var _0x1a21e1=0x0,_0x36955c=events['length'];_0x1a21e1<_0x36955c;_0x1a21e1++){var _0x6d672=events[_0x1a21e1];var _0x33fd86=createListener(_0x7c99('0x6')+_0x6d672,_0x404ffb);FaxMessageEvents['on'](_0x6d672,_0x33fd86);}}; \ No newline at end of file +var _0xb2ef=['save','remove','removeListener','register','length','./faxMessage.events'];(function(_0x32babe,_0xcbeb4d){var _0x8114cb=function(_0x55cccd){while(--_0x55cccd){_0x32babe['push'](_0x32babe['shift']());}};_0x8114cb(++_0xcbeb4d);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x485e2a,_0x4ffcad){_0x485e2a=_0x485e2a-0x0;var _0x2579a9=_0xb2ef[_0x485e2a];return _0x2579a9;};'use strict';var FaxMessageEvents=require(_0xfb2e('0x0'));var events=[_0xfb2e('0x1'),_0xfb2e('0x2'),'update'];function createListener(_0x1e4d1c,_0x291359){return function(_0x282426){_0x291359['emit'](_0x1e4d1c,_0x282426);};}function removeListener(_0xb829cc,_0x1716cd){return function(){FaxMessageEvents[_0xfb2e('0x3')](_0xb829cc,_0x1716cd);};}exports[_0xfb2e('0x4')]=function(_0x3069a){for(var _0x2a1c23=0x0,_0x1fb22e=events[_0xfb2e('0x5')];_0x2a1c23<_0x1fb22e;_0x2a1c23++){var _0x1d0a05=events[_0x2a1c23];var _0x46c641=createListener('faxMessage:'+_0x1d0a05,_0x3069a);FaxMessageEvents['on'](_0x1d0a05,_0x46c641);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4a73d36..2f11324 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 _0x5fdc=['/describe','/:id','show','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5bfd1e,_0x29bbe0){_0x5bfd1e=_0x5bfd1e-0x0;var _0x23742f=_0x5fdc[_0x5bfd1e];return _0x23742f;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var auth=require(_0xc5fd('0x6'));var interaction=require(_0xc5fd('0x7'));var config=require(_0xc5fd('0x8'));var controller=require(_0xc5fd('0x9'));router[_0xc5fd('0xa')]('/',auth[_0xc5fd('0xb')](),controller[_0xc5fd('0xc')]);router[_0xc5fd('0xa')](_0xc5fd('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc5fd('0xe'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0xf')]);router[_0xc5fd('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0x11')]('/',auth[_0xc5fd('0xb')](),interaction[_0xc5fd('0x12')](_0xc5fd('0x13'),_0xc5fd('0x14')),controller['create']);router[_0xc5fd('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc5fd('0x16')]);router[_0xc5fd('0x15')](_0xc5fd('0x17'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0x18')]);router[_0xc5fd('0x15')](_0xc5fd('0x19'),auth[_0xc5fd('0xb')](),controller['reject']);router[_0xc5fd('0x1a')](_0xc5fd('0xe'),auth[_0xc5fd('0xb')](),controller[_0xc5fd('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x430c=['Router','get','isAuthenticated','describe','/:id','show','/:id/download','post','fax','create','update','put','/:id/accept','accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0xb28496,_0x4e1911){var _0x15bc80=function(_0x594316){while(--_0x594316){_0xb28496['push'](_0xb28496['shift']());}};_0x15bc80(++_0x4e1911);}(_0x430c,0x1a1));var _0xc430=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0x430c[_0x1709e7];return _0x402819;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/describe',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x4')](_0xc430('0x9'),auth[_0xc430('0x5')](),controller['download']);router[_0xc430('0xa')]('/',auth[_0xc430('0x5')](),interaction['tracked'](_0xc430('0xb'),'faxmessage:create'),controller[_0xc430('0xc')]);router['put'](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0xd')]);router[_0xc430('0xe')](_0xc430('0xf'),auth[_0xc430('0x5')](),controller[_0xc430('0x10')]);router['put']('/:id/reject',auth[_0xc430('0x5')](),controller[_0xc430('0x11')]);router[_0xc430('0x12')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller['destroy']);module[_0xc430('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 634ed44..a7d47b0 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 _0x284d=['name','rrmemory','roundrobin','INTEGER','sequelize','STRING'];(function(_0x1bb6e1,_0x3d8369){var _0x2a2b9d=function(_0x578563){while(--_0x578563){_0x1bb6e1['push'](_0x1bb6e1['shift']());}};_0x2a2b9d(++_0x3d8369);}(_0x284d,0x148));var _0xd284=function(_0xb33c66,_0x4d2507){_0xb33c66=_0xb33c66-0x0;var _0x5c9349=_0x284d[_0xb33c66];return _0x5c9349;};'use strict';var Sequelize=require(_0xd284('0x0'));module['exports']={'name':{'type':Sequelize[_0xd284('0x1')],'unique':_0xd284('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd284('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd284('0x3'),'beepall',_0xd284('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd284('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f1b=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x2e59c2,_0x43f77b){var _0x8d11ad=function(_0x34b874){while(--_0x34b874){_0x2e59c2['push'](_0x2e59c2['shift']());}};_0x8d11ad(++_0x43f77b);}(_0x3f1b,0xc0));var _0xb3f1=function(_0x926859,_0x1c3570){_0x926859=_0x926859-0x0;var _0x5bdec6=_0x3f1b[_0x926859];return _0x5bdec6;};'use strict';var Sequelize=require(_0xb3f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xb3f1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb3f1('0x1')]},'timeout':{'type':Sequelize[_0xb3f1('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3f1('0x3')](_0xb3f1('0x4'),_0xb3f1('0x5'),_0xb3f1('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb3f1('0x2')],'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 190b693..e03340d 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 _0xc15b=['FaxQueues','UserProfileResource','error','send','index','FaxQueue','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','field','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','name','params','destroy','describe','getMembers','findOne','intersection','length','FaxQueueId','merge','UserFaxQueue','User','findAndCountAll','updatedAt','createdAt','%s/%s','SIP','faxPause','Team','getTeams','addTeams','teams','Agents','voicePause','interface','flatMap','each','forEach','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rawAttributes','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','get'];(function(_0x4cffb4,_0x22b5dc){var _0x269dd0=function(_0x5714b){while(--_0x5714b){_0x4cffb4['push'](_0x4cffb4['shift']());}};_0x269dd0(++_0x22b5dc);}(_0xc15b,0xe4));var _0xbc15=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xc15b[_0x2f5a22];return _0x326b70;};'use strict';var pdf=require(_0xbc15('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc15('0x1'));var zipdir=require(_0xbc15('0x2'));var jsonpatch=require(_0xbc15('0x3'));var rp=require(_0xbc15('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbc15('0x5'));var util=require(_0xbc15('0x6'));var path=require(_0xbc15('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc15('0x8'));var squel=require(_0xbc15('0x9'));var crypto=require(_0xbc15('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc15('0xb'));var Papa=require('papaparse');var Redis=require(_0xbc15('0xc'));var authService=require(_0xbc15('0xd'));var qs=require(_0xbc15('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc15('0xf'))(_0xbc15('0x10'));var utils=require('../../config/utils');var config=require(_0xbc15('0x11'));var db=require(_0xbc15('0x12'))['db'];config[_0xbc15('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbc15('0x14'))(new Redis(config[_0xbc15('0x13')]));require(_0xbc15('0x15'))[_0xbc15('0x16')](socket);function respondWithStatusCode(_0x171c23,_0x105dd6){_0x105dd6=_0x105dd6||0xcc;return function(_0x309e59){if(_0x309e59){return _0x171c23[_0xbc15('0x17')](_0x105dd6);}return _0x171c23[_0xbc15('0x18')](_0x105dd6)[_0xbc15('0x19')]();};}function respondWithResult(_0xaebbd4,_0x3dbb38){_0x3dbb38=_0x3dbb38||0xc8;return function(_0x110934){if(_0x110934){return _0xaebbd4[_0xbc15('0x18')](_0x3dbb38)['json'](_0x110934);}};}function respondWithFilteredResult(_0x41a3e9,_0x5a015f){return function(_0x218054){if(_0x218054){var _0x204170=_0x218054[_0xbc15('0x1a')],_0xa29e5f=_0x5a015f[_0xbc15('0x1b')],_0xc37530=_0x5a015f[_0xbc15('0x1b')]+_0x5a015f[_0xbc15('0x1c')],_0x38a6b5;if(_0xc37530>=_0x204170){_0xc37530=_0x204170;_0x38a6b5=0xc8;}else{_0x38a6b5=0xce;}_0x41a3e9[_0xbc15('0x18')](_0x38a6b5);return _0x41a3e9[_0xbc15('0x1d')](_0xbc15('0x1e'),_0xa29e5f+'-'+_0xc37530+'/'+_0x204170)['json'](_0x218054);}return null;};}function patchUpdates(_0x247ce3){return function(_0xa0eaa3){try{jsonpatch['apply'](_0xa0eaa3,_0x247ce3,!![]);}catch(_0x3e7f97){return BPromise[_0xbc15('0x1f')](_0x3e7f97);}return _0xa0eaa3[_0xbc15('0x20')]();};}function saveUpdates(_0x278320,_0x2f8327){return function(_0x118266){if(_0x118266){return _0x118266[_0xbc15('0x21')](_0x278320)[_0xbc15('0x22')](function(_0x5ac08d){return _0x5ac08d;});}return null;};}function removeEntity(_0x28a37a,_0x128ce2){return function(_0x212d52){if(_0x212d52){return _0x212d52['destroy']()[_0xbc15('0x22')](function(){var _0x46171f=_0x212d52[_0xbc15('0x23')]({'plain':!![]});var _0x15f6a9=_0xbc15('0x24');return db[_0xbc15('0x25')]['destroy']({'where':{'type':_0x15f6a9,'resourceId':_0x46171f['id']}})[_0xbc15('0x22')](function(){return _0x212d52;});})[_0xbc15('0x22')](function(){_0x28a37a[_0xbc15('0x18')](0xcc)[_0xbc15('0x19')]();});}};}function handleEntityNotFound(_0x2f57d6,_0x1c6ad9){return function(_0x21284b){if(!_0x21284b){_0x2f57d6[_0xbc15('0x17')](0x194);}return _0x21284b;};}function handleError(_0x1c0c84,_0x3512f0){_0x3512f0=_0x3512f0||0x1f4;return function(_0x2497de){logger[_0xbc15('0x26')](_0x2497de['stack']);if(_0x2497de['name']){delete _0x2497de['name'];}_0x1c0c84[_0xbc15('0x18')](_0x3512f0)[_0xbc15('0x27')](_0x2497de);};}exports[_0xbc15('0x28')]=function(_0x95698c,_0x2aa248){var _0x11dbf7={},_0xa9cf30={},_0x574a36={'count':0x0,'rows':[]};var _0x3d54e8=db[_0xbc15('0x29')]['rawAttributes'];_0xa9cf30[_0xbc15('0x2a')]=_['keys'](_0x3d54e8);_0xa9cf30[_0xbc15('0x2b')]=_[_0xbc15('0x2c')](_0x95698c['query']);_0xa9cf30[_0xbc15('0x2d')]=_['intersection'](_0xa9cf30[_0xbc15('0x2a')],_0xa9cf30['query']);_0x11dbf7['attributes']=_['intersection'](_0xa9cf30[_0xbc15('0x2a')],qs['fields'](_0x95698c['query'][_0xbc15('0x2e')]));_0x11dbf7[_0xbc15('0x2f')]=_0x11dbf7['attributes']['length']?_0x11dbf7['attributes']:_0xa9cf30[_0xbc15('0x2a')];if(!_0x95698c['query'][_0xbc15('0x30')](_0xbc15('0x31'))){_0x11dbf7[_0xbc15('0x1c')]=qs[_0xbc15('0x1c')](_0x95698c[_0xbc15('0x2b')]['limit']);_0x11dbf7[_0xbc15('0x1b')]=qs[_0xbc15('0x1b')](_0x95698c[_0xbc15('0x2b')][_0xbc15('0x1b')]);}_0x11dbf7[_0xbc15('0x32')]=qs['sort'](_0x95698c[_0xbc15('0x2b')][_0xbc15('0x33')]);_0x11dbf7[_0xbc15('0x34')]=qs[_0xbc15('0x2d')](_[_0xbc15('0x35')](_0x95698c[_0xbc15('0x2b')],_0xa9cf30[_0xbc15('0x2d')]));if(_0x95698c['query']['filter']){_0x11dbf7['where']=_['merge'](_0x11dbf7[_0xbc15('0x34')],{'$or':_[_0xbc15('0x36')](_0x3d54e8,function(_0x125458){if(_0x125458[_0xbc15('0x37')][_0xbc15('0x38')]!=='VIRTUAL'){var _0x136737={};_0x136737[_0x125458[_0xbc15('0x39')]]={'$like':'%'+_0x95698c[_0xbc15('0x2b')][_0xbc15('0x3a')]+'%'};return _0x136737;}})});}_0x11dbf7=_['merge']({},_0x11dbf7,_0x95698c[_0xbc15('0x3b')]);var _0x38c628={'where':_0x11dbf7['where']};return db[_0xbc15('0x29')][_0xbc15('0x1a')](_0x38c628)['then'](function(_0x30cc75){_0x574a36[_0xbc15('0x1a')]=_0x30cc75;if(_0x95698c[_0xbc15('0x2b')][_0xbc15('0x3c')]){_0x11dbf7['include']=[{'all':!![]}];}return db[_0xbc15('0x29')][_0xbc15('0x3d')](_0x11dbf7);})[_0xbc15('0x22')](function(_0x317efa){_0x574a36[_0xbc15('0x3e')]=_0x317efa;return _0x574a36;})['then'](respondWithFilteredResult(_0x2aa248,_0x11dbf7))[_0xbc15('0x3f')](handleError(_0x2aa248,null));};exports[_0xbc15('0x40')]=function(_0x5d8365,_0x595edc){var _0x2b4d85={'raw':!![],'where':{'id':_0x5d8365['params']['id']}},_0x1d7934={};_0x1d7934[_0xbc15('0x2a')]=_[_0xbc15('0x2c')](db[_0xbc15('0x29')]['rawAttributes']);_0x1d7934['query']=_[_0xbc15('0x2c')](_0x5d8365[_0xbc15('0x2b')]);_0x1d7934[_0xbc15('0x2d')]=_['intersection'](_0x1d7934['model'],_0x1d7934[_0xbc15('0x2b')]);_0x2b4d85[_0xbc15('0x2f')]=_['intersection'](_0x1d7934[_0xbc15('0x2a')],qs[_0xbc15('0x2e')](_0x5d8365[_0xbc15('0x2b')][_0xbc15('0x2e')]));_0x2b4d85[_0xbc15('0x2f')]=_0x2b4d85[_0xbc15('0x2f')]['length']?_0x2b4d85[_0xbc15('0x2f')]:_0x1d7934[_0xbc15('0x2a')];if(_0x5d8365[_0xbc15('0x2b')][_0xbc15('0x3c')]){_0x2b4d85[_0xbc15('0x41')]=[{'all':!![]}];}_0x2b4d85=_['merge']({},_0x2b4d85,_0x5d8365[_0xbc15('0x3b')]);return db[_0xbc15('0x29')][_0xbc15('0x42')](_0x2b4d85)[_0xbc15('0x22')](handleEntityNotFound(_0x595edc,null))[_0xbc15('0x22')](respondWithResult(_0x595edc,null))[_0xbc15('0x3f')](handleError(_0x595edc,null));};exports[_0xbc15('0x43')]=function(_0x29877c,_0x21f195){return db['FaxQueue'][_0xbc15('0x43')](_0x29877c[_0xbc15('0x44')],{})[_0xbc15('0x22')](function(_0x399d9c){var _0xb119f0=_0x29877c[_0xbc15('0x45')][_0xbc15('0x23')]({'plain':!![]});if(!_0xb119f0)throw new Error(_0xbc15('0x46'));if(_0xb119f0['role']===_0xbc15('0x45')){var _0x1f6a0d=_0x399d9c['get']({'plain':!![]});var _0x48eb2f=_0xbc15('0x24');return db[_0xbc15('0x47')]['find']({'where':{'name':_0x48eb2f,'userProfileId':_0xb119f0['userProfileId']},'raw':!![]})['then'](function(_0x460a42){if(_0x460a42&&_0x460a42[_0xbc15('0x48')]===0x0){return db[_0xbc15('0x25')][_0xbc15('0x43')]({'name':_0x1f6a0d['name'],'resourceId':_0x1f6a0d['id'],'type':_0x460a42[_0xbc15('0x49')],'sectionId':_0x460a42['id']},{})['then'](function(){return _0x399d9c;});}else{return _0x399d9c;}})[_0xbc15('0x3f')](function(_0x47e0e5){logger[_0xbc15('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47e0e5);throw _0x47e0e5;});}return _0x399d9c;})[_0xbc15('0x22')](respondWithResult(_0x21f195,0xc9))[_0xbc15('0x3f')](handleError(_0x21f195,null));};exports[_0xbc15('0x21')]=function(_0x5bb80a,_0x57bcdc){if(_0x5bb80a[_0xbc15('0x44')]['id']){delete _0x5bb80a[_0xbc15('0x44')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x5bb80a[_0xbc15('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57bcdc,null))['then'](saveUpdates(_0x5bb80a[_0xbc15('0x44')],null))[_0xbc15('0x22')](respondWithResult(_0x57bcdc,null))[_0xbc15('0x3f')](handleError(_0x57bcdc,null));};exports[_0xbc15('0x4b')]=function(_0x457c01,_0x2f9614){return db[_0xbc15('0x29')]['find']({'where':{'id':_0x457c01[_0xbc15('0x4a')]['id']}})[_0xbc15('0x22')](handleEntityNotFound(_0x2f9614,null))[_0xbc15('0x22')](removeEntity(_0x2f9614,null))['catch'](handleError(_0x2f9614,null));};exports[_0xbc15('0x4c')]=function(_0x14b0d1,_0x3cc4dc){return db[_0xbc15('0x29')][_0xbc15('0x4c')]()[_0xbc15('0x22')](respondWithResult(_0x3cc4dc,null))[_0xbc15('0x3f')](handleError(_0x3cc4dc,null));};exports[_0xbc15('0x4d')]=function(_0xe4fc07,_0x4f689e,_0x311ca2){var _0x261558={'raw':!![],'where':{}},_0xaefc5b={},_0x3a750a;return db['FaxQueue'][_0xbc15('0x4e')]({'where':{'id':_0xe4fc07[_0xbc15('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f689e,null))[_0xbc15('0x22')](function(_0xd12533){if(_0xd12533){_0x3a750a=_0xd12533[_0xbc15('0x23')]({'plain':!![]});_0xaefc5b[_0xbc15('0x2a')]=_[_0xbc15('0x2c')](db['UserFaxQueue']['rawAttributes']);_0xaefc5b[_0xbc15('0x2b')]=_[_0xbc15('0x2c')](_0xe4fc07[_0xbc15('0x2b')]);_0xaefc5b[_0xbc15('0x2d')]=_['intersection'](_0xaefc5b['model'],_0xaefc5b[_0xbc15('0x2b')]);_0x261558[_0xbc15('0x2f')]=_[_0xbc15('0x4f')](_0xaefc5b[_0xbc15('0x2a')],qs[_0xbc15('0x2e')](_0xe4fc07[_0xbc15('0x2b')][_0xbc15('0x2e')]));_0x261558['attributes']=_0x261558['attributes'][_0xbc15('0x50')]?_0x261558[_0xbc15('0x2f')]:_0xaefc5b[_0xbc15('0x2a')];if(!_0xe4fc07['query']['hasOwnProperty'](_0xbc15('0x31'))){_0x261558[_0xbc15('0x1c')]=qs[_0xbc15('0x1c')](_0xe4fc07[_0xbc15('0x2b')]['limit']);_0x261558[_0xbc15('0x1b')]=qs[_0xbc15('0x1b')](_0xe4fc07[_0xbc15('0x2b')][_0xbc15('0x1b')]);}_0x261558[_0xbc15('0x32')]=qs[_0xbc15('0x33')](_0xe4fc07[_0xbc15('0x2b')][_0xbc15('0x33')]);_0x261558[_0xbc15('0x34')]=qs[_0xbc15('0x2d')](_[_0xbc15('0x35')](_0xe4fc07[_0xbc15('0x2b')],_0xaefc5b['filters']));_0x261558[_0xbc15('0x34')][_0xbc15('0x51')]=_0xd12533['id'];if(_0xe4fc07[_0xbc15('0x2b')][_0xbc15('0x3a')]){_0x261558['where']=_[_0xbc15('0x52')](_0x261558['where'],{'$or':_[_0xbc15('0x36')](_0x261558[_0xbc15('0x2f')],function(_0x3cb642){var _0x284845={};_0x284845[_0x3cb642]={'$like':'%'+_0xe4fc07['query'][_0xbc15('0x3a')]+'%'};return _0x284845;})});}_0x261558=_[_0xbc15('0x52')]({},_0x261558,_0xe4fc07[_0xbc15('0x3b')]);return db[_0xbc15('0x53')][_0xbc15('0x3d')](_0x261558);}})[_0xbc15('0x22')](function(_0xf19645){if(_0xf19645){return db[_0xbc15('0x54')][_0xbc15('0x55')]({'where':{'id':_['map'](_0xf19645,'UserId'),'role':'agent'},'attributes':['id',_0xbc15('0x49'),'faxPause',_0xbc15('0x56'),_0xbc15('0x57')]});}})['then'](function(_0x227324){if(_0x227324){return{'count':_0x227324[_0xbc15('0x1a')],'rows':_['map'](_0x227324['rows'],function(_0x27a246){return{'membername':_0x27a246[_0xbc15('0x49')],'UserId':_0x27a246['id'],'queue_name':_0x3a750a[_0xbc15('0x49')],'FaxQueueId':_0x3a750a['id'],'interface':util['format'](_0xbc15('0x58'),_0xbc15('0x59'),_0x27a246[_0xbc15('0x49')]),'penalty':0x0,'paused':_0x27a246[_0xbc15('0x5a')],'createdAt':_0x27a246[_0xbc15('0x57')],'updatedAt':_0x27a246['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc15('0x22')](respondWithFilteredResult(_0x4f689e,_0x261558))[_0xbc15('0x3f')](handleError(_0x4f689e,null));};exports['getTeams']=function(_0x4a82c8,_0x324c56,_0x16d0f3){var _0x55d05d={};var _0x4f970a={};var _0x393e0b;var _0x2083cb;return db[_0xbc15('0x29')]['findOne']({'where':{'id':_0x4a82c8[_0xbc15('0x4a')]['id']}})[_0xbc15('0x22')](handleEntityNotFound(_0x324c56,null))['then'](function(_0x56a6c6){if(_0x56a6c6){_0x393e0b=_0x56a6c6;_0x4f970a['model']=_['keys'](db[_0xbc15('0x5b')]['rawAttributes']);_0x4f970a[_0xbc15('0x2b')]=_[_0xbc15('0x2c')](_0x4a82c8['query']);_0x4f970a[_0xbc15('0x2d')]=_[_0xbc15('0x4f')](_0x4f970a[_0xbc15('0x2a')],_0x4f970a[_0xbc15('0x2b')]);_0x55d05d[_0xbc15('0x2f')]=_[_0xbc15('0x4f')](_0x4f970a[_0xbc15('0x2a')],qs[_0xbc15('0x2e')](_0x4a82c8['query'][_0xbc15('0x2e')]));_0x55d05d['attributes']=_0x55d05d[_0xbc15('0x2f')][_0xbc15('0x50')]?_0x55d05d['attributes']:_0x4f970a[_0xbc15('0x2a')];_0x55d05d[_0xbc15('0x32')]=qs['sort'](_0x4a82c8[_0xbc15('0x2b')][_0xbc15('0x33')]);_0x55d05d[_0xbc15('0x34')]=qs['filters'](_[_0xbc15('0x35')](_0x4a82c8[_0xbc15('0x2b')],_0x4f970a[_0xbc15('0x2d')]));if(_0x4a82c8['query'][_0xbc15('0x3a')]){_0x55d05d['where']=_['merge'](_0x55d05d[_0xbc15('0x34')],{'$or':_[_0xbc15('0x36')](_0x55d05d[_0xbc15('0x2f')],function(_0x41bd6f){var _0x12cfd8={};_0x12cfd8[_0x41bd6f]={'$like':'%'+_0x4a82c8[_0xbc15('0x2b')][_0xbc15('0x3a')]+'%'};return _0x12cfd8;})});}_0x55d05d=_['merge']({},_0x55d05d,_0x4a82c8['options']);return _0x393e0b[_0xbc15('0x5c')](_0x55d05d);}})[_0xbc15('0x22')](function(_0x3862c9){if(_0x3862c9){_0x2083cb=_0x3862c9[_0xbc15('0x50')];if(!_0x4a82c8[_0xbc15('0x2b')][_0xbc15('0x30')](_0xbc15('0x31'))){_0x55d05d[_0xbc15('0x1c')]=qs[_0xbc15('0x1c')](_0x4a82c8[_0xbc15('0x2b')][_0xbc15('0x1c')]);_0x55d05d[_0xbc15('0x1b')]=qs[_0xbc15('0x1b')](_0x4a82c8[_0xbc15('0x2b')][_0xbc15('0x1b')]);}return _0x393e0b[_0xbc15('0x5c')](_0x55d05d);}})[_0xbc15('0x22')](function(_0x599bc8){if(_0x599bc8){return _0x599bc8?{'count':_0x2083cb,'rows':_0x599bc8}:null;}})[_0xbc15('0x22')](respondWithResult(_0x324c56,null))['catch'](handleError(_0x324c56,null));};exports[_0xbc15('0x5d')]=function(_0x5dab40,_0x56301f,_0x33ce75){var _0x380496=_0x5dab40[_0xbc15('0x44')][_0xbc15('0x5e')];return db[_0xbc15('0x5b')][_0xbc15('0x3d')]({'where':{'id':_[_0xbc15('0x36')](_0x380496,'id')},'attributes':['id'],'include':[{'model':db[_0xbc15('0x54')],'as':_0xbc15('0x5f'),'attributes':['id','name','online',_0xbc15('0x60'),_0xbc15('0x61')],'raw':!![]}]})[_0xbc15('0x22')](function(_0x3644ad){if(_0x3644ad){var _0x3d2b53=_[_0xbc15('0x62')](_0x3644ad,function(_0x1b358d){var _0x31dade=_0x1b358d[_0xbc15('0x23')]({'plain':!![]});return _0x31dade[_0xbc15('0x5f')];});return db[_0xbc15('0x29')][_0xbc15('0x42')]({'where':{'id':_0x5dab40[_0xbc15('0x4a')]['id']}})['then'](function(_0x24e593){return db['sequelize']['transaction'](function(_0x187ba3){return _0x24e593['addTeams'](_['map'](_0x380496,'id'),{'transaction':_0x187ba3})['then'](function(){return BPromise[_0xbc15('0x63')](_0x3d2b53,function(_0x3dd644){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3dd644['id'],'FaxQueueId':_0x5dab40[_0xbc15('0x4a')]['id']},'transaction':_0x187ba3});});})[_0xbc15('0x22')](function(){_0x3d2b53[_0xbc15('0x64')](function(_0x3ada1c){socket['emit'](_0xbc15('0x65'),{'UserId':_0x3ada1c['id'],'FaxQueueId':_0x24e593['id']});});});});});}})['then'](respondWithStatusCode(_0x56301f,null))[_0xbc15('0x3f')](handleError(_0x56301f,null));};exports[_0xbc15('0x66')]=function(_0x208092,_0x30b709,_0x40c570){return db['Team'][_0xbc15('0x3d')]({'where':{'id':_0x208092['query'][_0xbc15('0x67')]},'attributes':['id'],'include':[{'model':db[_0xbc15('0x54')],'as':_0xbc15('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xbc15('0x22')](handleEntityNotFound(_0x30b709,null))['then'](function(_0x1a9ab5){var _0x22a744=_[_0xbc15('0x36')](_0x1a9ab5,'id');var _0x5c5ef9=[];var _0x1225c5=[];var _0x1403a8=squel[_0xbc15('0x68')]();_0x1403a8[_0xbc15('0x39')](_0xbc15('0x69'))[_0xbc15('0x6a')](_0xbc15('0x6b'),'tq')[_0xbc15('0x6c')](_0xbc15('0x6d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbc15('0x34')]('FaxQueueId\x20=\x20?',_0x208092[_0xbc15('0x4a')]['id']);for(var _0x509fae=0x0;_0x509fae<_0x1a9ab5[_0xbc15('0x50')];_0x509fae+=0x1){let _0x736d7e=_0x1a9ab5[_0x509fae];for(var _0x18f253=0x0;_0x18f253<_0x736d7e[_0xbc15('0x5f')][_0xbc15('0x50')];_0x18f253+=0x1){let _0x45c410=_0x736d7e[_0xbc15('0x5f')][_0x18f253];var _0x1fa8eb=_0x1403a8[_0xbc15('0x6e')]();_0x1fa8eb[_0xbc15('0x34')](_0xbc15('0x6f'),_0x45c410['id']);_0x1225c5['push'](db[_0xbc15('0x70')][_0xbc15('0x2b')](_0x1fa8eb[_0xbc15('0x71')](),{'type':db['sequelize'][_0xbc15('0x72')][_0xbc15('0x73')]})[_0xbc15('0x22')](function(_0x323b98){if(_0x323b98[_0xbc15('0x50')]===0x1){return _0x45c410['id'];}else{var _0x13ead1=_[_0xbc15('0x74')](_['map'](_0x323b98,_0xbc15('0x75')),function(_0x2176a4){return _[_0xbc15('0x76')](_0x22a744,_0x2176a4);});if(_0x13ead1){return _0x45c410['id'];}}}));}}return BPromise[_0xbc15('0x77')](_0x1225c5)[_0xbc15('0x22')](function(_0x5ec3dd){_0x5c5ef9=_(_0x5c5ef9)['union'](_0x5ec3dd)[_0xbc15('0x78')]()['value']();return db[_0xbc15('0x29')][_0xbc15('0x42')]({'where':{'id':_0x208092['params']['id']}})['then'](function(_0x4c00bd){return db['sequelize'][_0xbc15('0x79')](function(_0x42f4c7){return _0x4c00bd[_0xbc15('0x66')](_0x208092[_0xbc15('0x2b')][_0xbc15('0x67')],{'transaction':_0x42f4c7})['then'](function(){if(!_[_0xbc15('0x7a')](_0x5c5ef9)){return _0x4c00bd[_0xbc15('0x7b')](_0x5c5ef9,{'transaction':_0x42f4c7});}})['then'](function(){_0x5c5ef9[_0xbc15('0x64')](function(_0x558fcf){socket[_0xbc15('0x7c')](_0xbc15('0x7d'),{'UserId':_0x558fcf,'FaxQueueId':_0x4c00bd['id']});});});});});});})['then'](respondWithStatusCode(_0x30b709,null))[_0xbc15('0x3f')](handleError(_0x30b709,null));};exports[_0xbc15('0x7e')]=function(_0x171420,_0x12bebe,_0x5615e1){return db[_0xbc15('0x29')]['find']({'where':{'id':_0x171420[_0xbc15('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12bebe,null))['then'](function(_0x2cef6f){if(_0x2cef6f){return _0x2cef6f[_0xbc15('0x7e')](_0x171420[_0xbc15('0x44')][_0xbc15('0x67')],_[_0xbc15('0x7f')](_0x171420[_0xbc15('0x44')],[_0xbc15('0x67'),'id'])||{})[_0xbc15('0x80')](function(_0x18f6af){for(var _0x897c88=0x0;_0x897c88<_0x171420[_0xbc15('0x44')][_0xbc15('0x67')][_0xbc15('0x50')];_0x897c88+=0x1){socket[_0xbc15('0x7c')](_0xbc15('0x65'),{'UserId':_0x171420[_0xbc15('0x44')]['ids'][_0x897c88],'FaxQueueId':_0x171420['params']['id']});}return _0x18f6af;});}})['then'](respondWithResult(_0x12bebe,null))[_0xbc15('0x3f')](handleError(_0x12bebe,null));};exports[_0xbc15('0x7b')]=function(_0x146931,_0x1b30fc,_0x51418d){return db[_0xbc15('0x29')][_0xbc15('0x42')]({'where':{'id':_0x146931['params']['id']}})[_0xbc15('0x22')](handleEntityNotFound(_0x1b30fc,null))['then'](function(_0x2a3a3d){if(_0x2a3a3d){return _0x2a3a3d[_0xbc15('0x7b')](_0x146931[_0xbc15('0x2b')][_0xbc15('0x67')])[_0xbc15('0x22')](function(){if(_[_0xbc15('0x81')](_0x146931[_0xbc15('0x2b')][_0xbc15('0x67')])){for(var _0x103f5b=0x0;_0x103f5b<_0x146931[_0xbc15('0x2b')][_0xbc15('0x67')][_0xbc15('0x50')];_0x103f5b+=0x1){socket[_0xbc15('0x7c')](_0xbc15('0x7d'),{'UserId':Number(_0x146931[_0xbc15('0x2b')][_0xbc15('0x67')][_0x103f5b]),'FaxQueueId':Number(_0x146931[_0xbc15('0x4a')]['id'])});}}else{socket[_0xbc15('0x7c')](_0xbc15('0x7d'),{'UserId':Number(_0x146931[_0xbc15('0x2b')][_0xbc15('0x67')]),'FaxQueueId':Number(_0x146931[_0xbc15('0x4a')]['id'])});}});}})[_0xbc15('0x22')](respondWithStatusCode(_0x1b30fc,null))[_0xbc15('0x3f')](handleError(_0x1b30fc,null));};exports[_0xbc15('0x82')]=function(_0x1bf71e,_0x2d09fd,_0xc1ea1d){var _0x741e04={};var _0x4d9884={};var _0x39e2f6;var _0x415003;return db[_0xbc15('0x29')]['findOne']({'where':{'id':_0x1bf71e[_0xbc15('0x4a')]['id']}})[_0xbc15('0x22')](handleEntityNotFound(_0x2d09fd,null))[_0xbc15('0x22')](function(_0x5d1dd7){if(_0x5d1dd7){_0x39e2f6=_0x5d1dd7;_0x4d9884[_0xbc15('0x2a')]=_[_0xbc15('0x2c')](db[_0xbc15('0x54')][_0xbc15('0x83')]);_0x4d9884['query']=_[_0xbc15('0x2c')](_0x1bf71e['query']);_0x4d9884[_0xbc15('0x2d')]=_[_0xbc15('0x4f')](_0x4d9884[_0xbc15('0x2a')],_0x4d9884[_0xbc15('0x2b')]);_0x741e04[_0xbc15('0x2f')]=_['intersection'](_0x4d9884[_0xbc15('0x2a')],qs[_0xbc15('0x2e')](_0x1bf71e[_0xbc15('0x2b')][_0xbc15('0x2e')]));_0x741e04[_0xbc15('0x2f')]=_0x741e04[_0xbc15('0x2f')][_0xbc15('0x50')]?_0x741e04[_0xbc15('0x2f')]:_0x4d9884[_0xbc15('0x2a')];_0x741e04[_0xbc15('0x32')]=qs['sort'](_0x1bf71e['query']['sort']);_0x741e04[_0xbc15('0x34')]=qs[_0xbc15('0x2d')](_[_0xbc15('0x35')](_0x1bf71e[_0xbc15('0x2b')],_0x4d9884['filters']));if(_0x1bf71e[_0xbc15('0x2b')][_0xbc15('0x3a')]){_0x741e04[_0xbc15('0x34')]=_['merge'](_0x741e04[_0xbc15('0x34')],{'$or':_[_0xbc15('0x36')](_0x741e04[_0xbc15('0x2f')],function(_0x57e026){var _0x1e4c14={};_0x1e4c14[_0x57e026]={'$like':'%'+_0x1bf71e['query'][_0xbc15('0x3a')]+'%'};return _0x1e4c14;})});}_0x741e04=_[_0xbc15('0x52')]({},_0x741e04,_0x1bf71e[_0xbc15('0x3b')]);return _0x39e2f6[_0xbc15('0x82')](_0x741e04);}})[_0xbc15('0x22')](function(_0x5c3051){if(_0x5c3051){_0x415003=_0x5c3051[_0xbc15('0x50')];if(!_0x1bf71e[_0xbc15('0x2b')][_0xbc15('0x30')](_0xbc15('0x31'))){_0x741e04[_0xbc15('0x1c')]=qs[_0xbc15('0x1c')](_0x1bf71e[_0xbc15('0x2b')][_0xbc15('0x1c')]);_0x741e04[_0xbc15('0x1b')]=qs[_0xbc15('0x1b')](_0x1bf71e[_0xbc15('0x2b')][_0xbc15('0x1b')]);}return _0x39e2f6[_0xbc15('0x82')](_0x741e04);}})['then'](function(_0x2f95f2){if(_0x2f95f2){return _0x2f95f2?{'count':_0x415003,'rows':_0x2f95f2}:null;}})[_0xbc15('0x22')](respondWithResult(_0x2d09fd,null))[_0xbc15('0x3f')](handleError(_0x2d09fd,null));}; \ No newline at end of file +var _0xe14f=['then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','FaxQueue','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','catch','show','params','rawAttributes','intersection','find','create','body','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','faxPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','userFaxQueue:save','removeTeams','ids','User','select','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','TeamId','includes','all','union','compact','value','emit','addAgents','omit','spread','removeAgents','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x24e19c,_0x1eec14){var _0x188fac=function(_0xeac31d){while(--_0xeac31d){_0x24e19c['push'](_0x24e19c['shift']());}};_0x188fac(++_0x1eec14);}(_0xe14f,0xea));var _0xfe14=function(_0x2b76bb,_0x5d005d){_0x2b76bb=_0x2b76bb-0x0;var _0x583237=_0xe14f[_0x2b76bb];return _0x583237;};'use strict';var pdf=require(_0xfe14('0x0'));var emlformat=require(_0xfe14('0x1'));var rimraf=require(_0xfe14('0x2'));var zipdir=require(_0xfe14('0x3'));var jsonpatch=require(_0xfe14('0x4'));var rp=require(_0xfe14('0x5'));var moment=require(_0xfe14('0x6'));var BPromise=require(_0xfe14('0x7'));var Mustache=require(_0xfe14('0x8'));var util=require('util');var path=require('path');var sox=require(_0xfe14('0x9'));var csv=require('to-csv');var ejs=require(_0xfe14('0xa'));var fs=require('fs');var _=require(_0xfe14('0xb'));var squel=require(_0xfe14('0xc'));var crypto=require(_0xfe14('0xd'));var jsforce=require(_0xfe14('0xe'));var deskjs=require(_0xfe14('0xf'));var toCsv=require(_0xfe14('0x10'));var querystring=require(_0xfe14('0x11'));var Papa=require(_0xfe14('0x12'));var Redis=require('ioredis');var authService=require(_0xfe14('0x13'));var qs=require(_0xfe14('0x14'));var hardwareService=require(_0xfe14('0x15'));var logger=require(_0xfe14('0x16'))(_0xfe14('0x17'));var utils=require(_0xfe14('0x18'));var config=require('../../config/environment');var db=require(_0xfe14('0x19'))['db'];config['redis']=_[_0xfe14('0x1a')](config[_0xfe14('0x1b')],{'host':_0xfe14('0x1c'),'port':0x18eb});var socket=require(_0xfe14('0x1d'))(new Redis(config[_0xfe14('0x1b')]));require(_0xfe14('0x1e'))['register'](socket);function respondWithStatusCode(_0x4aabda,_0x39799a){_0x39799a=_0x39799a||0xcc;return function(_0x43db84){if(_0x43db84){return _0x4aabda[_0xfe14('0x1f')](_0x39799a);}return _0x4aabda['status'](_0x39799a)[_0xfe14('0x20')]();};}function respondWithResult(_0x546d82,_0x3f3114){_0x3f3114=_0x3f3114||0xc8;return function(_0x1cdd4b){if(_0x1cdd4b){return _0x546d82[_0xfe14('0x21')](_0x3f3114)[_0xfe14('0x22')](_0x1cdd4b);}};}function respondWithFilteredResult(_0xd65aed,_0x1dbd36){return function(_0x2ac71b){if(_0x2ac71b){var _0x292cb9=_0x2ac71b[_0xfe14('0x23')],_0x131408=_0x1dbd36[_0xfe14('0x24')],_0x492f88=_0x1dbd36[_0xfe14('0x24')]+_0x1dbd36[_0xfe14('0x25')],_0x56522f;if(_0x492f88>=_0x292cb9){_0x492f88=_0x292cb9;_0x56522f=0xc8;}else{_0x56522f=0xce;}_0xd65aed[_0xfe14('0x21')](_0x56522f);return _0xd65aed[_0xfe14('0x26')](_0xfe14('0x27'),_0x131408+'-'+_0x492f88+'/'+_0x292cb9)[_0xfe14('0x22')](_0x2ac71b);}return null;};}function patchUpdates(_0x5d3332){return function(_0x451a15){try{jsonpatch[_0xfe14('0x28')](_0x451a15,_0x5d3332,!![]);}catch(_0x285c68){return BPromise[_0xfe14('0x29')](_0x285c68);}return _0x451a15[_0xfe14('0x2a')]();};}function saveUpdates(_0x5a268c,_0x2fa357){return function(_0x16e935){if(_0x16e935){return _0x16e935[_0xfe14('0x2b')](_0x5a268c)[_0xfe14('0x2c')](function(_0x326a92){return _0x326a92;});}return null;};}function removeEntity(_0x48299e,_0x1a8620){return function(_0x400f5d){if(_0x400f5d){return _0x400f5d[_0xfe14('0x2d')]()[_0xfe14('0x2c')](function(){var _0x565de9=_0x400f5d['get']({'plain':!![]});var _0x12ab29=_0xfe14('0x2e');return db[_0xfe14('0x2f')][_0xfe14('0x2d')]({'where':{'type':_0x12ab29,'resourceId':_0x565de9['id']}})[_0xfe14('0x2c')](function(){return _0x400f5d;});})[_0xfe14('0x2c')](function(){_0x48299e[_0xfe14('0x21')](0xcc)[_0xfe14('0x20')]();});}};}function handleEntityNotFound(_0x59f2ad,_0x3760f2){return function(_0x733bb9){if(!_0x733bb9){_0x59f2ad[_0xfe14('0x1f')](0x194);}return _0x733bb9;};}function handleError(_0x247a71,_0xf6b5fe){_0xf6b5fe=_0xf6b5fe||0x1f4;return function(_0xce2ec6){logger[_0xfe14('0x30')](_0xce2ec6[_0xfe14('0x31')]);if(_0xce2ec6[_0xfe14('0x32')]){delete _0xce2ec6['name'];}_0x247a71[_0xfe14('0x21')](_0xf6b5fe)[_0xfe14('0x33')](_0xce2ec6);};}exports['index']=function(_0x24cd85,_0x32053c){var _0x368cd6={},_0x278805={},_0x353f9d={'count':0x0,'rows':[]};var _0x18d469=db[_0xfe14('0x34')]['rawAttributes'];_0x278805[_0xfe14('0x35')]=_[_0xfe14('0x36')](_0x18d469);_0x278805[_0xfe14('0x37')]=_[_0xfe14('0x36')](_0x24cd85[_0xfe14('0x37')]);_0x278805[_0xfe14('0x38')]=_['intersection'](_0x278805['model'],_0x278805[_0xfe14('0x37')]);_0x368cd6['attributes']=_['intersection'](_0x278805[_0xfe14('0x35')],qs[_0xfe14('0x39')](_0x24cd85[_0xfe14('0x37')][_0xfe14('0x39')]));_0x368cd6[_0xfe14('0x3a')]=_0x368cd6[_0xfe14('0x3a')][_0xfe14('0x3b')]?_0x368cd6['attributes']:_0x278805['model'];if(!_0x24cd85[_0xfe14('0x37')][_0xfe14('0x3c')](_0xfe14('0x3d'))){_0x368cd6[_0xfe14('0x25')]=qs[_0xfe14('0x25')](_0x24cd85[_0xfe14('0x37')]['limit']);_0x368cd6['offset']=qs[_0xfe14('0x24')](_0x24cd85['query']['offset']);}_0x368cd6[_0xfe14('0x3e')]=qs[_0xfe14('0x3f')](_0x24cd85[_0xfe14('0x37')][_0xfe14('0x3f')]);_0x368cd6[_0xfe14('0x40')]=qs['filters'](_[_0xfe14('0x41')](_0x24cd85[_0xfe14('0x37')],_0x278805['filters']));if(_0x24cd85[_0xfe14('0x37')][_0xfe14('0x42')]){_0x368cd6[_0xfe14('0x40')]=_['merge'](_0x368cd6['where'],{'$or':_[_0xfe14('0x43')](_0x18d469,function(_0xf8150e){if(_0xf8150e[_0xfe14('0x44')][_0xfe14('0x45')]!==_0xfe14('0x46')){var _0x28e8a7={};_0x28e8a7[_0xf8150e[_0xfe14('0x47')]]={'$like':'%'+_0x24cd85[_0xfe14('0x37')][_0xfe14('0x42')]+'%'};return _0x28e8a7;}})});}_0x368cd6=_[_0xfe14('0x48')]({},_0x368cd6,_0x24cd85[_0xfe14('0x49')]);var _0x521441={'where':_0x368cd6['where']};return db['FaxQueue'][_0xfe14('0x23')](_0x521441)['then'](function(_0x39bb9a){_0x353f9d[_0xfe14('0x23')]=_0x39bb9a;if(_0x24cd85[_0xfe14('0x37')]['includeAll']){_0x368cd6[_0xfe14('0x4a')]=[{'all':!![]}];}return db[_0xfe14('0x34')][_0xfe14('0x4b')](_0x368cd6);})[_0xfe14('0x2c')](function(_0xe48a94){_0x353f9d['rows']=_0xe48a94;return _0x353f9d;})[_0xfe14('0x2c')](respondWithFilteredResult(_0x32053c,_0x368cd6))[_0xfe14('0x4c')](handleError(_0x32053c,null));};exports[_0xfe14('0x4d')]=function(_0x4b7eb1,_0x5d9fa4){var _0x519763={'raw':!![],'where':{'id':_0x4b7eb1[_0xfe14('0x4e')]['id']}},_0x47333c={};_0x47333c['model']=_[_0xfe14('0x36')](db['FaxQueue'][_0xfe14('0x4f')]);_0x47333c['query']=_[_0xfe14('0x36')](_0x4b7eb1['query']);_0x47333c[_0xfe14('0x38')]=_[_0xfe14('0x50')](_0x47333c[_0xfe14('0x35')],_0x47333c[_0xfe14('0x37')]);_0x519763[_0xfe14('0x3a')]=_[_0xfe14('0x50')](_0x47333c[_0xfe14('0x35')],qs['fields'](_0x4b7eb1[_0xfe14('0x37')][_0xfe14('0x39')]));_0x519763['attributes']=_0x519763[_0xfe14('0x3a')][_0xfe14('0x3b')]?_0x519763[_0xfe14('0x3a')]:_0x47333c[_0xfe14('0x35')];if(_0x4b7eb1['query']['includeAll']){_0x519763[_0xfe14('0x4a')]=[{'all':!![]}];}_0x519763=_[_0xfe14('0x48')]({},_0x519763,_0x4b7eb1[_0xfe14('0x49')]);return db['FaxQueue'][_0xfe14('0x51')](_0x519763)['then'](handleEntityNotFound(_0x5d9fa4,null))[_0xfe14('0x2c')](respondWithResult(_0x5d9fa4,null))[_0xfe14('0x4c')](handleError(_0x5d9fa4,null));};exports[_0xfe14('0x52')]=function(_0xd068bd,_0x151b29){return db['FaxQueue'][_0xfe14('0x52')](_0xd068bd[_0xfe14('0x53')],{})['then'](function(_0x427453){var _0x444644=_0xd068bd['user'][_0xfe14('0x54')]({'plain':!![]});if(!_0x444644)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x444644[_0xfe14('0x55')]==='user'){var _0x2a2b97=_0x427453['get']({'plain':!![]});var _0x40f711='FaxQueues';return db['UserProfileSection'][_0xfe14('0x51')]({'where':{'name':_0x40f711,'userProfileId':_0x444644['userProfileId']},'raw':!![]})[_0xfe14('0x2c')](function(_0x9ac8d9){if(_0x9ac8d9&&_0x9ac8d9[_0xfe14('0x56')]===0x0){return db['UserProfileResource'][_0xfe14('0x52')]({'name':_0x2a2b97['name'],'resourceId':_0x2a2b97['id'],'type':_0x9ac8d9[_0xfe14('0x32')],'sectionId':_0x9ac8d9['id']},{})['then'](function(){return _0x427453;});}else{return _0x427453;}})[_0xfe14('0x4c')](function(_0x23c68d){logger['error'](_0xfe14('0x57'),_0x23c68d);throw _0x23c68d;});}return _0x427453;})['then'](respondWithResult(_0x151b29,0xc9))[_0xfe14('0x4c')](handleError(_0x151b29,null));};exports[_0xfe14('0x2b')]=function(_0x4a5ee3,_0x27cb8a){if(_0x4a5ee3[_0xfe14('0x53')]['id']){delete _0x4a5ee3[_0xfe14('0x53')]['id'];}return db[_0xfe14('0x34')][_0xfe14('0x51')]({'where':{'id':_0x4a5ee3['params']['id']}})[_0xfe14('0x2c')](handleEntityNotFound(_0x27cb8a,null))[_0xfe14('0x2c')](saveUpdates(_0x4a5ee3[_0xfe14('0x53')],null))[_0xfe14('0x2c')](respondWithResult(_0x27cb8a,null))['catch'](handleError(_0x27cb8a,null));};exports[_0xfe14('0x2d')]=function(_0x305734,_0x55d93e){return db[_0xfe14('0x34')][_0xfe14('0x51')]({'where':{'id':_0x305734[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](handleEntityNotFound(_0x55d93e,null))[_0xfe14('0x2c')](removeEntity(_0x55d93e,null))[_0xfe14('0x4c')](handleError(_0x55d93e,null));};exports['describe']=function(_0x23df92,_0x47f763){return db[_0xfe14('0x34')][_0xfe14('0x58')]()[_0xfe14('0x2c')](respondWithResult(_0x47f763,null))[_0xfe14('0x4c')](handleError(_0x47f763,null));};exports[_0xfe14('0x59')]=function(_0x5f3a0e,_0x5e3ff7,_0x4a7a6b){var _0xd2dc2e={'raw':!![],'where':{}},_0x34c667={},_0x60ae04;return db['FaxQueue']['findOne']({'where':{'id':_0x5f3a0e[_0xfe14('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e3ff7,null))[_0xfe14('0x2c')](function(_0xafe60e){if(_0xafe60e){_0x60ae04=_0xafe60e[_0xfe14('0x54')]({'plain':!![]});_0x34c667['model']=_[_0xfe14('0x36')](db[_0xfe14('0x5a')][_0xfe14('0x4f')]);_0x34c667[_0xfe14('0x37')]=_[_0xfe14('0x36')](_0x5f3a0e[_0xfe14('0x37')]);_0x34c667[_0xfe14('0x38')]=_['intersection'](_0x34c667[_0xfe14('0x35')],_0x34c667[_0xfe14('0x37')]);_0xd2dc2e['attributes']=_[_0xfe14('0x50')](_0x34c667[_0xfe14('0x35')],qs['fields'](_0x5f3a0e['query'][_0xfe14('0x39')]));_0xd2dc2e[_0xfe14('0x3a')]=_0xd2dc2e['attributes'][_0xfe14('0x3b')]?_0xd2dc2e['attributes']:_0x34c667[_0xfe14('0x35')];if(!_0x5f3a0e[_0xfe14('0x37')][_0xfe14('0x3c')]('nolimit')){_0xd2dc2e['limit']=qs['limit'](_0x5f3a0e[_0xfe14('0x37')][_0xfe14('0x25')]);_0xd2dc2e['offset']=qs[_0xfe14('0x24')](_0x5f3a0e['query'][_0xfe14('0x24')]);}_0xd2dc2e[_0xfe14('0x3e')]=qs[_0xfe14('0x3f')](_0x5f3a0e[_0xfe14('0x37')][_0xfe14('0x3f')]);_0xd2dc2e[_0xfe14('0x40')]=qs['filters'](_[_0xfe14('0x41')](_0x5f3a0e[_0xfe14('0x37')],_0x34c667[_0xfe14('0x38')]));_0xd2dc2e['where'][_0xfe14('0x5b')]=_0xafe60e['id'];if(_0x5f3a0e[_0xfe14('0x37')]['filter']){_0xd2dc2e[_0xfe14('0x40')]=_[_0xfe14('0x48')](_0xd2dc2e[_0xfe14('0x40')],{'$or':_['map'](_0xd2dc2e[_0xfe14('0x3a')],function(_0x399ec2){var _0x1c7132={};_0x1c7132[_0x399ec2]={'$like':'%'+_0x5f3a0e['query']['filter']+'%'};return _0x1c7132;})});}_0xd2dc2e=_[_0xfe14('0x48')]({},_0xd2dc2e,_0x5f3a0e[_0xfe14('0x49')]);return db['UserFaxQueue'][_0xfe14('0x4b')](_0xd2dc2e);}})[_0xfe14('0x2c')](function(_0x124fc8){if(_0x124fc8){return db['User'][_0xfe14('0x5c')]({'where':{'id':_[_0xfe14('0x43')](_0x124fc8,_0xfe14('0x5d')),'role':_0xfe14('0x5e')},'attributes':['id',_0xfe14('0x32'),_0xfe14('0x5f'),'updatedAt',_0xfe14('0x60')]});}})[_0xfe14('0x2c')](function(_0x2bd21b){if(_0x2bd21b){return{'count':_0x2bd21b[_0xfe14('0x23')],'rows':_[_0xfe14('0x43')](_0x2bd21b[_0xfe14('0x61')],function(_0x449b25){return{'membername':_0x449b25['name'],'UserId':_0x449b25['id'],'queue_name':_0x60ae04['name'],'FaxQueueId':_0x60ae04['id'],'interface':util['format'](_0xfe14('0x62'),_0xfe14('0x63'),_0x449b25['name']),'penalty':0x0,'paused':_0x449b25[_0xfe14('0x5f')],'createdAt':_0x449b25[_0xfe14('0x60')],'updatedAt':_0x449b25[_0xfe14('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5e3ff7,_0xd2dc2e))[_0xfe14('0x4c')](handleError(_0x5e3ff7,null));};exports[_0xfe14('0x65')]=function(_0x1099b8,_0x19769d,_0x19f3fa){var _0x1ec80a={};var _0x283681={};var _0x4d1f61;var _0x2a0779;return db['FaxQueue'][_0xfe14('0x66')]({'where':{'id':_0x1099b8[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](handleEntityNotFound(_0x19769d,null))[_0xfe14('0x2c')](function(_0x4f486f){if(_0x4f486f){_0x4d1f61=_0x4f486f;_0x283681[_0xfe14('0x35')]=_['keys'](db[_0xfe14('0x67')]['rawAttributes']);_0x283681[_0xfe14('0x37')]=_[_0xfe14('0x36')](_0x1099b8[_0xfe14('0x37')]);_0x283681[_0xfe14('0x38')]=_['intersection'](_0x283681[_0xfe14('0x35')],_0x283681[_0xfe14('0x37')]);_0x1ec80a['attributes']=_[_0xfe14('0x50')](_0x283681[_0xfe14('0x35')],qs[_0xfe14('0x39')](_0x1099b8['query'][_0xfe14('0x39')]));_0x1ec80a[_0xfe14('0x3a')]=_0x1ec80a[_0xfe14('0x3a')][_0xfe14('0x3b')]?_0x1ec80a[_0xfe14('0x3a')]:_0x283681[_0xfe14('0x35')];_0x1ec80a[_0xfe14('0x3e')]=qs['sort'](_0x1099b8[_0xfe14('0x37')]['sort']);_0x1ec80a[_0xfe14('0x40')]=qs[_0xfe14('0x38')](_[_0xfe14('0x41')](_0x1099b8['query'],_0x283681[_0xfe14('0x38')]));if(_0x1099b8[_0xfe14('0x37')][_0xfe14('0x42')]){_0x1ec80a['where']=_[_0xfe14('0x48')](_0x1ec80a['where'],{'$or':_[_0xfe14('0x43')](_0x1ec80a[_0xfe14('0x3a')],function(_0x3f2e84){var _0x3d14f8={};_0x3d14f8[_0x3f2e84]={'$like':'%'+_0x1099b8[_0xfe14('0x37')][_0xfe14('0x42')]+'%'};return _0x3d14f8;})});}_0x1ec80a=_[_0xfe14('0x48')]({},_0x1ec80a,_0x1099b8['options']);return _0x4d1f61['getTeams'](_0x1ec80a);}})[_0xfe14('0x2c')](function(_0x51155f){if(_0x51155f){_0x2a0779=_0x51155f[_0xfe14('0x3b')];if(!_0x1099b8['query'][_0xfe14('0x3c')]('nolimit')){_0x1ec80a[_0xfe14('0x25')]=qs['limit'](_0x1099b8[_0xfe14('0x37')][_0xfe14('0x25')]);_0x1ec80a[_0xfe14('0x24')]=qs[_0xfe14('0x24')](_0x1099b8['query'][_0xfe14('0x24')]);}return _0x4d1f61[_0xfe14('0x65')](_0x1ec80a);}})[_0xfe14('0x2c')](function(_0xa45abe){if(_0xa45abe){return _0xa45abe?{'count':_0x2a0779,'rows':_0xa45abe}:null;}})[_0xfe14('0x2c')](respondWithResult(_0x19769d,null))[_0xfe14('0x4c')](handleError(_0x19769d,null));};exports[_0xfe14('0x68')]=function(_0xbc10e6,_0x5978b8,_0x4482ab){var _0x4f62d3=_0xbc10e6[_0xfe14('0x53')]['teams'];return db[_0xfe14('0x67')][_0xfe14('0x4b')]({'where':{'id':_[_0xfe14('0x43')](_0x4f62d3,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe14('0x69'),'attributes':['id',_0xfe14('0x32'),_0xfe14('0x6a'),_0xfe14('0x6b'),_0xfe14('0x6c')],'raw':!![]}]})['then'](function(_0x43049d){if(_0x43049d){var _0x59c2c1=_[_0xfe14('0x6d')](_0x43049d,function(_0x2d35c7){var _0x2d934c=_0x2d35c7['get']({'plain':!![]});return _0x2d934c[_0xfe14('0x69')];});return db[_0xfe14('0x34')]['find']({'where':{'id':_0xbc10e6[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](function(_0x6b1a8a){return db[_0xfe14('0x6e')][_0xfe14('0x6f')](function(_0x873a8a){return _0x6b1a8a[_0xfe14('0x68')](_[_0xfe14('0x43')](_0x4f62d3,'id'),{'transaction':_0x873a8a})[_0xfe14('0x2c')](function(){return BPromise['each'](_0x59c2c1,function(_0x30361c){return db[_0xfe14('0x5a')]['findOrCreate']({'where':{'UserId':_0x30361c['id'],'FaxQueueId':_0xbc10e6[_0xfe14('0x4e')]['id']},'transaction':_0x873a8a});});})['then'](function(){_0x59c2c1[_0xfe14('0x70')](function(_0x53dedc){socket['emit'](_0xfe14('0x71'),{'UserId':_0x53dedc['id'],'FaxQueueId':_0x6b1a8a['id']});});});});});}})[_0xfe14('0x2c')](respondWithStatusCode(_0x5978b8,null))['catch'](handleError(_0x5978b8,null));};exports[_0xfe14('0x72')]=function(_0x522d54,_0x564016,_0x1c5e33){return db['Team'][_0xfe14('0x4b')]({'where':{'id':_0x522d54[_0xfe14('0x37')][_0xfe14('0x73')]},'attributes':['id'],'include':[{'model':db[_0xfe14('0x74')],'as':_0xfe14('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfe14('0x2c')](handleEntityNotFound(_0x564016,null))['then'](function(_0x1c3e2b){var _0x2200ca=_[_0xfe14('0x43')](_0x1c3e2b,'id');var _0x17856e=[];var _0x15eb94=[];var _0x213b11=squel[_0xfe14('0x75')]();_0x213b11['field'](_0xfe14('0x76'))['from']('team_has_fax_queues','tq')[_0xfe14('0x77')](_0xfe14('0x78'),'ut',_0xfe14('0x79'))['where'](_0xfe14('0x7a'),_0x522d54[_0xfe14('0x4e')]['id']);for(var _0x1ef417=0x0;_0x1ef417<_0x1c3e2b['length'];_0x1ef417+=0x1){let _0x27e305=_0x1c3e2b[_0x1ef417];for(var _0xafd680=0x0;_0xafd680<_0x27e305[_0xfe14('0x69')][_0xfe14('0x3b')];_0xafd680+=0x1){let _0x275de8=_0x27e305[_0xfe14('0x69')][_0xafd680];var _0x1bbcb5=_0x213b11['clone']();_0x1bbcb5[_0xfe14('0x40')](_0xfe14('0x7b'),_0x275de8['id']);_0x15eb94[_0xfe14('0x7c')](db[_0xfe14('0x6e')]['query'](_0x1bbcb5[_0xfe14('0x7d')](),{'type':db[_0xfe14('0x6e')]['QueryTypes']['SELECT']})[_0xfe14('0x2c')](function(_0x24c616){if(_0x24c616[_0xfe14('0x3b')]===0x1){return _0x275de8['id'];}else{var _0x539723=_['every'](_[_0xfe14('0x43')](_0x24c616,_0xfe14('0x7e')),function(_0x2ee287){return _[_0xfe14('0x7f')](_0x2200ca,_0x2ee287);});if(_0x539723){return _0x275de8['id'];}}}));}}return BPromise[_0xfe14('0x80')](_0x15eb94)[_0xfe14('0x2c')](function(_0x304af6){_0x17856e=_(_0x17856e)[_0xfe14('0x81')](_0x304af6)[_0xfe14('0x82')]()[_0xfe14('0x83')]();return db[_0xfe14('0x34')]['find']({'where':{'id':_0x522d54[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](function(_0x4d0eeb){return db[_0xfe14('0x6e')][_0xfe14('0x6f')](function(_0x46b81f){return _0x4d0eeb[_0xfe14('0x72')](_0x522d54[_0xfe14('0x37')][_0xfe14('0x73')],{'transaction':_0x46b81f})[_0xfe14('0x2c')](function(){if(!_['isEmpty'](_0x17856e)){return _0x4d0eeb['removeAgents'](_0x17856e,{'transaction':_0x46b81f});}})[_0xfe14('0x2c')](function(){_0x17856e[_0xfe14('0x70')](function(_0x25b494){socket[_0xfe14('0x84')]('userFaxQueue:remove',{'UserId':_0x25b494,'FaxQueueId':_0x4d0eeb['id']});});});});});});})['then'](respondWithStatusCode(_0x564016,null))[_0xfe14('0x4c')](handleError(_0x564016,null));};exports[_0xfe14('0x85')]=function(_0x2716e0,_0x4d7511,_0x266237){return db[_0xfe14('0x34')][_0xfe14('0x51')]({'where':{'id':_0x2716e0[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](handleEntityNotFound(_0x4d7511,null))['then'](function(_0x385b72){if(_0x385b72){return _0x385b72['addAgents'](_0x2716e0['body']['ids'],_[_0xfe14('0x86')](_0x2716e0['body'],['ids','id'])||{})[_0xfe14('0x87')](function(_0x3c3649){for(var _0x363758=0x0;_0x363758<_0x2716e0['body'][_0xfe14('0x73')][_0xfe14('0x3b')];_0x363758+=0x1){socket['emit'](_0xfe14('0x71'),{'UserId':_0x2716e0[_0xfe14('0x53')]['ids'][_0x363758],'FaxQueueId':_0x2716e0[_0xfe14('0x4e')]['id']});}return _0x3c3649;});}})['then'](respondWithResult(_0x4d7511,null))['catch'](handleError(_0x4d7511,null));};exports['removeAgents']=function(_0x2edbf9,_0x451b93,_0x547e19){return db[_0xfe14('0x34')]['find']({'where':{'id':_0x2edbf9[_0xfe14('0x4e')]['id']}})[_0xfe14('0x2c')](handleEntityNotFound(_0x451b93,null))[_0xfe14('0x2c')](function(_0x40c86d){if(_0x40c86d){return _0x40c86d[_0xfe14('0x88')](_0x2edbf9[_0xfe14('0x37')]['ids'])[_0xfe14('0x2c')](function(){if(_['isArray'](_0x2edbf9[_0xfe14('0x37')][_0xfe14('0x73')])){for(var _0x50be3c=0x0;_0x50be3c<_0x2edbf9['query']['ids']['length'];_0x50be3c+=0x1){socket['emit'](_0xfe14('0x89'),{'UserId':Number(_0x2edbf9[_0xfe14('0x37')][_0xfe14('0x73')][_0x50be3c]),'FaxQueueId':Number(_0x2edbf9[_0xfe14('0x4e')]['id'])});}}else{socket[_0xfe14('0x84')]('userFaxQueue:remove',{'UserId':Number(_0x2edbf9['query'][_0xfe14('0x73')]),'FaxQueueId':Number(_0x2edbf9[_0xfe14('0x4e')]['id'])});}});}})[_0xfe14('0x2c')](respondWithStatusCode(_0x451b93,null))[_0xfe14('0x4c')](handleError(_0x451b93,null));};exports[_0xfe14('0x8a')]=function(_0xef8681,_0x4278b3,_0x3f8ca6){var _0x268fa7={};var _0x1ea154={};var _0x3a1381;var _0x120cd4;return db[_0xfe14('0x34')]['findOne']({'where':{'id':_0xef8681[_0xfe14('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4278b3,null))[_0xfe14('0x2c')](function(_0x50fc4b){if(_0x50fc4b){_0x3a1381=_0x50fc4b;_0x1ea154[_0xfe14('0x35')]=_[_0xfe14('0x36')](db['User'][_0xfe14('0x4f')]);_0x1ea154[_0xfe14('0x37')]=_[_0xfe14('0x36')](_0xef8681[_0xfe14('0x37')]);_0x1ea154[_0xfe14('0x38')]=_['intersection'](_0x1ea154[_0xfe14('0x35')],_0x1ea154[_0xfe14('0x37')]);_0x268fa7['attributes']=_['intersection'](_0x1ea154['model'],qs[_0xfe14('0x39')](_0xef8681[_0xfe14('0x37')][_0xfe14('0x39')]));_0x268fa7[_0xfe14('0x3a')]=_0x268fa7[_0xfe14('0x3a')]['length']?_0x268fa7[_0xfe14('0x3a')]:_0x1ea154['model'];_0x268fa7[_0xfe14('0x3e')]=qs[_0xfe14('0x3f')](_0xef8681[_0xfe14('0x37')][_0xfe14('0x3f')]);_0x268fa7[_0xfe14('0x40')]=qs['filters'](_[_0xfe14('0x41')](_0xef8681[_0xfe14('0x37')],_0x1ea154['filters']));if(_0xef8681[_0xfe14('0x37')]['filter']){_0x268fa7['where']=_[_0xfe14('0x48')](_0x268fa7[_0xfe14('0x40')],{'$or':_['map'](_0x268fa7[_0xfe14('0x3a')],function(_0x24041b){var _0x3a9d5f={};_0x3a9d5f[_0x24041b]={'$like':'%'+_0xef8681[_0xfe14('0x37')]['filter']+'%'};return _0x3a9d5f;})});}_0x268fa7=_['merge']({},_0x268fa7,_0xef8681[_0xfe14('0x49')]);return _0x3a1381[_0xfe14('0x8a')](_0x268fa7);}})['then'](function(_0x1b2b34){if(_0x1b2b34){_0x120cd4=_0x1b2b34[_0xfe14('0x3b')];if(!_0xef8681[_0xfe14('0x37')][_0xfe14('0x3c')](_0xfe14('0x3d'))){_0x268fa7[_0xfe14('0x25')]=qs[_0xfe14('0x25')](_0xef8681['query']['limit']);_0x268fa7[_0xfe14('0x24')]=qs['offset'](_0xef8681[_0xfe14('0x37')]['offset']);}return _0x3a1381['getAgents'](_0x268fa7);}})[_0xfe14('0x2c')](function(_0x390ce3){if(_0x390ce3){return _0x390ce3?{'count':_0x120cd4,'rows':_0x390ce3}:null;}})[_0xfe14('0x2c')](respondWithResult(_0x4278b3,null))[_0xfe14('0x4c')](handleError(_0x4278b3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 6d8e6c5..20fc523 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 _0x56e7=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','save'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0x56e7,0x7b));var _0x756e=function(_0x403987,_0x38e1f8){_0x403987=_0x403987-0x0;var _0x4b900f=_0x56e7[_0x403987];return _0x4b900f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x756e('0x0'))['db'][_0x756e('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x756e('0x2'),'afterUpdate':_0x756e('0x3'),'afterDestroy':_0x756e('0x4')};function emitEvent(_0xb850c9){return function(_0x11ce5f,_0x38546a,_0x446fff){FaxQueueEvents['emit'](_0xb850c9+':'+_0x11ce5f['id'],_0x11ce5f);FaxQueueEvents[_0x756e('0x5')](_0xb850c9,_0x11ce5f);_0x446fff(null);};}for(var e in events){if(events[_0x756e('0x6')](e)){var event=events[e];FaxQueue[_0x756e('0x7')](e,emitEvent(event));}}module[_0x756e('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x0fda=['hook','exports','events','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x3aefa8,_0x27635b){_0x3aefa8=_0x3aefa8-0x0;var _0x23f297=_0x0fda[_0x3aefa8];return _0x23f297;};'use strict';var EventEmitter=require(_0xa0fd('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xa0fd('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa0fd('0x2')](0x0);var events={'afterCreate':_0xa0fd('0x3'),'afterUpdate':_0xa0fd('0x4'),'afterDestroy':_0xa0fd('0x5')};function emitEvent(_0xd8e73a){return function(_0x13c734,_0x574fca,_0x4978fa){FaxQueueEvents[_0xa0fd('0x6')](_0xd8e73a+':'+_0x13c734['id'],_0x13c734);FaxQueueEvents['emit'](_0xd8e73a,_0x13c734);_0x4978fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xa0fd('0x7')](e,emitEvent(event));}}module[_0xa0fd('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 4aa3520..ba60fc0 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 _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x5e5d08,_0x3e310c){var _0x30d23d=function(_0x58cde6){while(--_0x58cde6){_0x5e5d08['push'](_0x5e5d08['shift']());}};_0x30d23d(++_0x3e310c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d57dd,_0x561346){_0x1d57dd=_0x1d57dd-0x0;var _0x27e4af=_0x5f2f[_0x1d57dd];return _0x27e4af;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d8d0a,_0x11bb87){_0x3d8d0a=_0x3d8d0a-0x0;var _0x5b9df5=_0xb10b[_0x3d8d0a];return _0x5b9df5;};'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')]('FaxQueue',attributes,{'tableName':_0xbb10('0xb'),'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 b965dc8..d389b2e 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 _0x47bb=['stringify','error','code','message','result','catch','FaxQueue','findAll','options','where','attributes','limit','include','map','model','GetFaxQueue','find','raw','ShowFaxQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x471268,_0x5ce885){var _0x1298f3=function(_0x3f5110){while(--_0x3f5110){_0x471268['push'](_0x471268['shift']());}};_0x1298f3(++_0x5ce885);}(_0x47bb,0xbb));var _0xb47b=function(_0xd07e81,_0x1ccacd){_0xd07e81=_0xd07e81-0x0;var _0x379364=_0x47bb[_0xd07e81];return _0x379364;};'use strict';var _=require(_0xb47b('0x0'));var util=require(_0xb47b('0x1'));var moment=require('moment');var BPromise=require(_0xb47b('0x2'));var rs=require(_0xb47b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb47b('0x4'))['db'];var utils=require(_0xb47b('0x5'));var logger=require(_0xb47b('0x6'))('rpc');var config=require(_0xb47b('0x7'));var jayson=require(_0xb47b('0x8'));var client=jayson[_0xb47b('0x9')][_0xb47b('0xa')]({'port':0x232a});config['redis']=_[_0xb47b('0xb')](config[_0xb47b('0xc')],{'host':_0xb47b('0xd'),'port':0x18eb});var socket=require(_0xb47b('0xe'))(new Redis(config[_0xb47b('0xc')]));require(_0xb47b('0xf'))[_0xb47b('0x10')](socket);function respondWithRpcPromise(_0x4d7b3f,_0x1fe005,_0x593c46){return new BPromise(function(_0x48873a,_0xbd63f9){return client['request'](_0x4d7b3f,_0x593c46)[_0xb47b('0x11')](function(_0x2cb424){logger[_0xb47b('0x12')](_0xb47b('0x13'),_0x1fe005,_0xb47b('0x14'));logger[_0xb47b('0x15')](_0xb47b('0x16'),_0x1fe005,_0xb47b('0x14'),JSON[_0xb47b('0x17')](_0x2cb424));if(_0x2cb424[_0xb47b('0x18')]){if(_0x2cb424[_0xb47b('0x18')][_0xb47b('0x19')]===0x1f4){logger[_0xb47b('0x18')](_0xb47b('0x13'),_0x1fe005,_0x2cb424[_0xb47b('0x18')][_0xb47b('0x1a')]);return _0xbd63f9(_0x2cb424[_0xb47b('0x18')][_0xb47b('0x1a')]);}logger[_0xb47b('0x18')](_0xb47b('0x13'),_0x1fe005,_0x2cb424[_0xb47b('0x18')]['message']);return _0x48873a(_0x2cb424[_0xb47b('0x18')][_0xb47b('0x1a')]);}else{logger[_0xb47b('0x12')]('FaxQueue,\x20%s,\x20%s',_0x1fe005,'request\x20sent');_0x48873a(_0x2cb424[_0xb47b('0x1b')][_0xb47b('0x1a')]);}})[_0xb47b('0x1c')](function(_0x1a9d99){logger[_0xb47b('0x18')](_0xb47b('0x13'),_0x1fe005,_0x1a9d99);_0xbd63f9(_0x1a9d99);});});}exports['GetFaxQueue']=function(_0x58f7f4){var _0x1141a6=this;return new Promise(function(_0x2c06c9,_0xfe0932){return db[_0xb47b('0x1d')][_0xb47b('0x1e')]({'raw':_0x58f7f4[_0xb47b('0x1f')]?_0x58f7f4[_0xb47b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x58f7f4[_0xb47b('0x1f')]?_0x58f7f4[_0xb47b('0x1f')][_0xb47b('0x20')]||null:null,'attributes':_0x58f7f4[_0xb47b('0x1f')]?_0x58f7f4[_0xb47b('0x1f')][_0xb47b('0x21')]||null:null,'limit':_0x58f7f4[_0xb47b('0x1f')]?_0x58f7f4[_0xb47b('0x1f')][_0xb47b('0x22')]||null:null,'include':_0x58f7f4['options']?_0x58f7f4[_0xb47b('0x1f')][_0xb47b('0x23')]?_[_0xb47b('0x24')](_0x58f7f4['options'][_0xb47b('0x23')],function(_0x28c688){return{'model':db[_0x28c688[_0xb47b('0x25')]],'as':_0x28c688['as'],'attributes':_0x28c688[_0xb47b('0x21')],'include':_0x28c688['include']?_[_0xb47b('0x24')](_0x28c688[_0xb47b('0x23')],function(_0x3e6c0e){return{'model':db[_0x3e6c0e['model']],'as':_0x3e6c0e['as'],'attributes':_0x3e6c0e[_0xb47b('0x21')],'include':_0x3e6c0e[_0xb47b('0x23')]?_[_0xb47b('0x24')](_0x3e6c0e[_0xb47b('0x23')],function(_0xe5c691){return{'model':db[_0xe5c691[_0xb47b('0x25')]],'as':_0xe5c691['as'],'attributes':_0xe5c691[_0xb47b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb47b('0x11')](function(_0x3d9616){logger[_0xb47b('0x12')]('GetFaxQueue',_0x58f7f4);logger[_0xb47b('0x15')](_0xb47b('0x26'),_0x58f7f4,JSON['stringify'](_0x3d9616));_0x2c06c9(_0x3d9616);})[_0xb47b('0x1c')](function(_0x41f0f0){logger[_0xb47b('0x18')](_0xb47b('0x26'),_0x41f0f0[_0xb47b('0x1a')],_0x58f7f4);_0xfe0932(_0x1141a6[_0xb47b('0x18')](0x1f4,_0x41f0f0[_0xb47b('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x1a1bd2){var _0x5a0283=this;return new Promise(function(_0x343194,_0x3290a6){return db[_0xb47b('0x1d')][_0xb47b('0x27')]({'raw':_0x1a1bd2[_0xb47b('0x1f')]?_0x1a1bd2['options'][_0xb47b('0x28')]===undefined?!![]:![]:!![],'where':_0x1a1bd2[_0xb47b('0x1f')]?_0x1a1bd2[_0xb47b('0x1f')][_0xb47b('0x20')]||null:null,'attributes':_0x1a1bd2['options']?_0x1a1bd2[_0xb47b('0x1f')][_0xb47b('0x21')]||null:null,'include':_0x1a1bd2['options']?_0x1a1bd2[_0xb47b('0x1f')]['include']?_[_0xb47b('0x24')](_0x1a1bd2[_0xb47b('0x1f')][_0xb47b('0x23')],function(_0x171da0){return{'model':db[_0x171da0['model']],'as':_0x171da0['as'],'attributes':_0x171da0[_0xb47b('0x21')],'include':_0x171da0[_0xb47b('0x23')]?_[_0xb47b('0x24')](_0x171da0[_0xb47b('0x23')],function(_0x730aa){return{'model':db[_0x730aa[_0xb47b('0x25')]],'as':_0x730aa['as'],'attributes':_0x730aa[_0xb47b('0x21')],'include':_0x730aa['include']?_['map'](_0x730aa[_0xb47b('0x23')],function(_0x2ea02e){return{'model':db[_0x2ea02e[_0xb47b('0x25')]],'as':_0x2ea02e['as'],'attributes':_0x2ea02e[_0xb47b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb47b('0x11')](function(_0x2e138e){logger[_0xb47b('0x12')](_0xb47b('0x29'),_0x1a1bd2);logger[_0xb47b('0x15')](_0xb47b('0x29'),_0x1a1bd2,JSON[_0xb47b('0x17')](_0x2e138e));_0x343194(_0x2e138e);})[_0xb47b('0x1c')](function(_0xd5cc68){logger[_0xb47b('0x18')](_0xb47b('0x29'),_0xd5cc68['message'],_0x1a1bd2);_0x3290a6(_0x5a0283[_0xb47b('0x18')](0x1f4,_0xd5cc68['message']));});});}; \ No newline at end of file +var _0x4445=['model','GetFaxQueue','debug','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x1ba140,_0x4b8f8a){var _0x48c77e=function(_0x5223d0){while(--_0x5223d0){_0x1ba140['push'](_0x1ba140['shift']());}};_0x48c77e(++_0x4b8f8a);}(_0x4445,0x102));var _0x5444=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x4445[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0x5444('0x0'));var util=require(_0x5444('0x1'));var moment=require(_0x5444('0x2'));var BPromise=require(_0x5444('0x3'));var rs=require(_0x5444('0x4'));var fs=require('fs');var Redis=require(_0x5444('0x5'));var db=require(_0x5444('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5444('0x7'));var jayson=require(_0x5444('0x8'));var client=jayson[_0x5444('0x9')][_0x5444('0xa')]({'port':0x232a});config[_0x5444('0xb')]=_[_0x5444('0xc')](config[_0x5444('0xb')],{'host':_0x5444('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5444('0xe'))[_0x5444('0xf')](socket);function respondWithRpcPromise(_0x19e902,_0xc972ba,_0x12fd49){return new BPromise(function(_0x4d66f1,_0x2a225b){return client[_0x5444('0x10')](_0x19e902,_0x12fd49)[_0x5444('0x11')](function(_0x2a092d){logger[_0x5444('0x12')](_0x5444('0x13'),_0xc972ba,_0x5444('0x14'));logger['debug'](_0x5444('0x15'),_0xc972ba,_0x5444('0x14'),JSON[_0x5444('0x16')](_0x2a092d));if(_0x2a092d['error']){if(_0x2a092d[_0x5444('0x17')][_0x5444('0x18')]===0x1f4){logger[_0x5444('0x17')](_0x5444('0x13'),_0xc972ba,_0x2a092d[_0x5444('0x17')][_0x5444('0x19')]);return _0x2a225b(_0x2a092d[_0x5444('0x17')]['message']);}logger['error']('FaxQueue,\x20%s,\x20%s',_0xc972ba,_0x2a092d[_0x5444('0x17')]['message']);return _0x4d66f1(_0x2a092d[_0x5444('0x17')]['message']);}else{logger['info'](_0x5444('0x13'),_0xc972ba,'request\x20sent');_0x4d66f1(_0x2a092d[_0x5444('0x1a')]['message']);}})[_0x5444('0x1b')](function(_0x16b9e5){logger[_0x5444('0x17')](_0x5444('0x13'),_0xc972ba,_0x16b9e5);_0x2a225b(_0x16b9e5);});});}exports['GetFaxQueue']=function(_0x143967){var _0x162bb6=this;return new Promise(function(_0x18630c,_0xeed966){return db['FaxQueue'][_0x5444('0x1c')]({'raw':_0x143967[_0x5444('0x1d')]?_0x143967[_0x5444('0x1d')][_0x5444('0x1e')]===undefined?!![]:![]:!![],'where':_0x143967[_0x5444('0x1d')]?_0x143967[_0x5444('0x1d')][_0x5444('0x1f')]||null:null,'attributes':_0x143967[_0x5444('0x1d')]?_0x143967['options'][_0x5444('0x20')]||null:null,'limit':_0x143967[_0x5444('0x1d')]?_0x143967[_0x5444('0x1d')][_0x5444('0x21')]||null:null,'include':_0x143967[_0x5444('0x1d')]?_0x143967[_0x5444('0x1d')][_0x5444('0x22')]?_[_0x5444('0x23')](_0x143967['options'][_0x5444('0x22')],function(_0x7c31cc){return{'model':db[_0x7c31cc[_0x5444('0x24')]],'as':_0x7c31cc['as'],'attributes':_0x7c31cc[_0x5444('0x20')],'include':_0x7c31cc['include']?_[_0x5444('0x23')](_0x7c31cc[_0x5444('0x22')],function(_0x2a4875){return{'model':db[_0x2a4875[_0x5444('0x24')]],'as':_0x2a4875['as'],'attributes':_0x2a4875[_0x5444('0x20')],'include':_0x2a4875[_0x5444('0x22')]?_[_0x5444('0x23')](_0x2a4875[_0x5444('0x22')],function(_0x4de744){return{'model':db[_0x4de744[_0x5444('0x24')]],'as':_0x4de744['as'],'attributes':_0x4de744[_0x5444('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5444('0x11')](function(_0x327097){logger[_0x5444('0x12')](_0x5444('0x25'),_0x143967);logger[_0x5444('0x26')](_0x5444('0x25'),_0x143967,JSON[_0x5444('0x16')](_0x327097));_0x18630c(_0x327097);})[_0x5444('0x1b')](function(_0x384fe6){logger['error']('GetFaxQueue',_0x384fe6[_0x5444('0x19')],_0x143967);_0xeed966(_0x162bb6[_0x5444('0x17')](0x1f4,_0x384fe6['message']));});});};exports[_0x5444('0x27')]=function(_0x2f351b){var _0x4c1d05=this;return new Promise(function(_0x2c58d5,_0x1240eb){return db[_0x5444('0x28')][_0x5444('0x29')]({'raw':_0x2f351b[_0x5444('0x1d')]?_0x2f351b[_0x5444('0x1d')][_0x5444('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f351b['options']?_0x2f351b[_0x5444('0x1d')][_0x5444('0x1f')]||null:null,'attributes':_0x2f351b[_0x5444('0x1d')]?_0x2f351b['options'][_0x5444('0x20')]||null:null,'include':_0x2f351b['options']?_0x2f351b[_0x5444('0x1d')][_0x5444('0x22')]?_['map'](_0x2f351b[_0x5444('0x1d')]['include'],function(_0xb603f4){return{'model':db[_0xb603f4[_0x5444('0x24')]],'as':_0xb603f4['as'],'attributes':_0xb603f4[_0x5444('0x20')],'include':_0xb603f4[_0x5444('0x22')]?_[_0x5444('0x23')](_0xb603f4[_0x5444('0x22')],function(_0x50fe10){return{'model':db[_0x50fe10['model']],'as':_0x50fe10['as'],'attributes':_0x50fe10[_0x5444('0x20')],'include':_0x50fe10[_0x5444('0x22')]?_[_0x5444('0x23')](_0x50fe10[_0x5444('0x22')],function(_0x1958d1){return{'model':db[_0x1958d1[_0x5444('0x24')]],'as':_0x1958d1['as'],'attributes':_0x1958d1[_0x5444('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5444('0x11')](function(_0x383949){logger[_0x5444('0x12')](_0x5444('0x27'),_0x2f351b);logger[_0x5444('0x26')]('ShowFaxQueue',_0x2f351b,JSON[_0x5444('0x16')](_0x383949));_0x2c58d5(_0x383949);})[_0x5444('0x1b')](function(_0x28e37d){logger[_0x5444('0x17')](_0x5444('0x27'),_0x28e37d[_0x5444('0x19')],_0x2f351b);_0x1240eb(_0x4c1d05[_0x5444('0x17')](0x1f4,_0x28e37d[_0x5444('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c4b3aa2..74d2781 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 _0x83ff=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2f28fe,_0x5e4686){var _0x5eb31d=function(_0x23c95c){while(--_0x23c95c){_0x2f28fe['push'](_0x2f28fe['shift']());}};_0x5eb31d(++_0x5e4686);}(_0x83ff,0x133));var _0xf83f=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x83ff[_0x62c958];return _0x57ec61;};'use strict';var FaxQueueEvents=require(_0xf83f('0x0'));var events=[_0xf83f('0x1'),_0xf83f('0x2'),_0xf83f('0x3')];function createListener(_0x50033a,_0x5fb335){return function(_0x3fc121){_0x5fb335[_0xf83f('0x4')](_0x50033a,_0x3fc121);};}function removeListener(_0x53d2f3,_0x51397f){return function(){FaxQueueEvents[_0xf83f('0x5')](_0x53d2f3,_0x51397f);};}exports[_0xf83f('0x6')]=function(_0x98063d){for(var _0x440c23=0x0,_0x21fd7a=events[_0xf83f('0x7')];_0x440c23<_0x21fd7a;_0x440c23++){var _0x29618f=events[_0x440c23];var _0x19b410=createListener(_0xf83f('0x8')+_0x29618f,_0x98063d);FaxQueueEvents['on'](_0x29618f,_0x19b410);}}; \ No newline at end of file +var _0xc3ef=['./faxQueue.events','remove','update','emit','removeListener','register','faxQueue:'];(function(_0x40d438,_0x42c92e){var _0xa681f0=function(_0x5354f2){while(--_0x5354f2){_0x40d438['push'](_0x40d438['shift']());}};_0xa681f0(++_0x42c92e);}(_0xc3ef,0xe7));var _0xfc3e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc3ef[_0x46698a];return _0x356db0;};'use strict';var FaxQueueEvents=require(_0xfc3e('0x0'));var events=['save',_0xfc3e('0x1'),_0xfc3e('0x2')];function createListener(_0x1e5673,_0x633858){return function(_0x212797){_0x633858[_0xfc3e('0x3')](_0x1e5673,_0x212797);};}function removeListener(_0x3b1089,_0x33f5d7){return function(){FaxQueueEvents[_0xfc3e('0x4')](_0x3b1089,_0x33f5d7);};}exports[_0xfc3e('0x5')]=function(_0xb5d7d0){for(var _0x2eaf3a=0x0,_0x176407=events['length'];_0x2eaf3a<_0x176407;_0x2eaf3a++){var _0x5d7642=events[_0x2eaf3a];var _0x4d7054=createListener(_0xfc3e('0x6')+_0x5d7642,_0xb5d7d0);FaxQueueEvents['on'](_0x5d7642,_0x4d7054);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 50d44b2..21fd583 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 _0xf1ea=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/teams','/:id/users','post','create','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','Router','../../config/environment','./faxQueue.controller'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xf1ea,0xf7));var _0xaf1e=function(_0x3b348e,_0x2b6f46){_0x3b348e=_0x3b348e-0x0;var _0x3636d5=_0xf1ea[_0x3b348e];return _0x3636d5;};'use strict';var multer=require(_0xaf1e('0x0'));var util=require(_0xaf1e('0x1'));var path=require('path');var timeout=require(_0xaf1e('0x2'));var express=require('express');var router=express[_0xaf1e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf1e('0x4'));var controller=require(_0xaf1e('0x5'));router[_0xaf1e('0x6')]('/',auth['isAuthenticated'](),controller[_0xaf1e('0x7')]);router['get'](_0xaf1e('0x8'),auth[_0xaf1e('0x9')](),controller[_0xaf1e('0xa')]);router[_0xaf1e('0x6')](_0xaf1e('0xb'),auth['isAuthenticated'](),controller[_0xaf1e('0xc')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xaf1e('0x6')](_0xaf1e('0xd'),auth[_0xaf1e('0x9')](),controller['getTeams']);router['get'](_0xaf1e('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0xaf1e('0xf')]('/',auth['isAuthenticated'](),controller[_0xaf1e('0x10')]);router['post'](_0xaf1e('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0xaf1e('0xf')](_0xaf1e('0xe'),auth[_0xaf1e('0x9')](),controller[_0xaf1e('0x11')]);router[_0xaf1e('0x12')](_0xaf1e('0xb'),auth[_0xaf1e('0x9')](),controller['update']);router[_0xaf1e('0x13')]('/:id',auth[_0xaf1e('0x9')](),controller[_0xaf1e('0x14')]);router[_0xaf1e('0x13')](_0xaf1e('0xd'),auth[_0xaf1e('0x9')](),controller[_0xaf1e('0x15')]);router['delete'](_0xaf1e('0xe'),auth[_0xaf1e('0x9')](),controller[_0xaf1e('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6df6=['removeTeams','/:id/users','removeAgents','exports','multer','util','path','Router','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getTeams','getAgents','post','create','/:id/teams','addTeams','addAgents','put','delete','/:id','destroy'];(function(_0x58d1cc,_0x1b4062){var _0x3e6f3c=function(_0x334804){while(--_0x334804){_0x58d1cc['push'](_0x58d1cc['shift']());}};_0x3e6f3c(++_0x1b4062);}(_0x6df6,0x154));var _0x66df=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x6df6[_0x2ca9d4];return _0x258956;};'use strict';var multer=require(_0x66df('0x0'));var util=require(_0x66df('0x1'));var path=require(_0x66df('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x66df('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x66df('0x4'));var config=require('../../config/environment');var controller=require(_0x66df('0x5'));router[_0x66df('0x6')]('/',auth[_0x66df('0x7')](),controller[_0x66df('0x8')]);router[_0x66df('0x6')](_0x66df('0x9'),auth[_0x66df('0x7')](),controller[_0x66df('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x66df('0xb')]);router[_0x66df('0x6')](_0x66df('0xc'),auth[_0x66df('0x7')](),controller['getMembers']);router[_0x66df('0x6')]('/:id/teams',auth[_0x66df('0x7')](),controller[_0x66df('0xd')]);router['get']('/:id/users',auth[_0x66df('0x7')](),controller[_0x66df('0xe')]);router[_0x66df('0xf')]('/',auth['isAuthenticated'](),controller[_0x66df('0x10')]);router['post'](_0x66df('0x11'),auth['isAuthenticated'](),controller[_0x66df('0x12')]);router[_0x66df('0xf')]('/:id/users',auth[_0x66df('0x7')](),controller[_0x66df('0x13')]);router[_0x66df('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x66df('0x15')](_0x66df('0x16'),auth['isAuthenticated'](),controller[_0x66df('0x17')]);router[_0x66df('0x15')](_0x66df('0x11'),auth['isAuthenticated'](),controller[_0x66df('0x18')]);router['delete'](_0x66df('0x19'),auth['isAuthenticated'](),controller[_0x66df('0x1a')]);module[_0x66df('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f3fbcd9..9464c4c 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 _0xab56=['DATE','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab56,0xea));var _0x6ab5=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xab56[_0x3899d1];return _0xeb4a7d;};'use strict';var moment=require('moment');var Sequelize=require(_0x6ab5('0x0'));module[_0x6ab5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6ab5('0x2')]},'leaveAt':{'type':Sequelize[_0x6ab5('0x2')]},'acceptAt':{'type':Sequelize[_0x6ab5('0x2')]},'exitAt':{'type':Sequelize[_0x6ab5('0x2')]},'reason':{'type':Sequelize[_0x6ab5('0x3')]}}; \ No newline at end of file +var _0x1e64=['exports','STRING','DATE','sequelize'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x1e64,0x113));var _0x41e6=function(_0x3d6254,_0x4ea414){_0x3d6254=_0x3d6254-0x0;var _0x55d8df=_0x1e64[_0x3d6254];return _0x55d8df;};'use strict';var moment=require('moment');var Sequelize=require(_0x41e6('0x0'));module[_0x41e6('0x1')]={'uniqueid':{'type':Sequelize[_0x41e6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x41e6('0x2')]},'joinAt':{'type':Sequelize[_0x41e6('0x3')]},'leaveAt':{'type':Sequelize[_0x41e6('0x3')]},'acceptAt':{'type':Sequelize[_0x41e6('0x3')]},'exitAt':{'type':Sequelize[_0x41e6('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b630fb2..3476ba1 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 _0xbc5e=['fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','FaxQueueReport','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','merge','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x114bde,_0x109282){var _0x4fe113=function(_0x149e32){while(--_0x149e32){_0x114bde['push'](_0x114bde['shift']());}};_0x4fe113(++_0x109282);}(_0xbc5e,0xda));var _0xebc5=function(_0x5717d8,_0x52e576){_0x5717d8=_0x5717d8-0x0;var _0x51eacb=_0xbc5e[_0x5717d8];return _0x51eacb;};'use strict';var pdf=require(_0xebc5('0x0'));var emlformat=require(_0xebc5('0x1'));var rimraf=require(_0xebc5('0x2'));var zipdir=require(_0xebc5('0x3'));var jsonpatch=require(_0xebc5('0x4'));var rp=require(_0xebc5('0x5'));var moment=require(_0xebc5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require(_0xebc5('0x9'));var sox=require('sox');var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xebc5('0xc'));var crypto=require('crypto');var jsforce=require(_0xebc5('0xd'));var deskjs=require(_0xebc5('0xe'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0xf'));var Papa=require(_0xebc5('0x10'));var Redis=require(_0xebc5('0x11'));var authService=require(_0xebc5('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebc5('0x13'));var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require(_0xebc5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39f5d8,_0x31a833){_0x31a833=_0x31a833||0xcc;return function(_0x513c85){if(_0x513c85){return _0x39f5d8[_0xebc5('0x18')](_0x31a833);}return _0x39f5d8['status'](_0x31a833)[_0xebc5('0x19')]();};}function respondWithResult(_0x4fdb5a,_0x52038f){_0x52038f=_0x52038f||0xc8;return function(_0x1209df){if(_0x1209df){return _0x4fdb5a['status'](_0x52038f)[_0xebc5('0x1a')](_0x1209df);}};}function respondWithFilteredResult(_0x27c407,_0x5b2397){return function(_0x10f61b){if(_0x10f61b){var _0x1783fe=_0x10f61b['count'],_0x142207=_0x5b2397[_0xebc5('0x1b')],_0x5abc00=_0x5b2397[_0xebc5('0x1b')]+_0x5b2397[_0xebc5('0x1c')],_0x24851a;if(_0x5abc00>=_0x1783fe){_0x5abc00=_0x1783fe;_0x24851a=0xc8;}else{_0x24851a=0xce;}_0x27c407[_0xebc5('0x1d')](_0x24851a);return _0x27c407[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x142207+'-'+_0x5abc00+'/'+_0x1783fe)[_0xebc5('0x1a')](_0x10f61b);}return null;};}function patchUpdates(_0x464fd3){return function(_0x102d53){try{jsonpatch[_0xebc5('0x20')](_0x102d53,_0x464fd3,!![]);}catch(_0x473fea){return BPromise[_0xebc5('0x21')](_0x473fea);}return _0x102d53[_0xebc5('0x22')]();};}function saveUpdates(_0x2c4a41,_0xdf50fd){return function(_0x567f16){if(_0x567f16){return _0x567f16[_0xebc5('0x23')](_0x2c4a41)[_0xebc5('0x24')](function(_0x41c921){return _0x41c921;});}return null;};}function removeEntity(_0xf8e0ea,_0x2dabad){return function(_0x86ff0c){if(_0x86ff0c){return _0x86ff0c[_0xebc5('0x25')]()[_0xebc5('0x24')](function(){_0xf8e0ea[_0xebc5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd32aa3,_0x12e3c2){return function(_0x1039c8){if(!_0x1039c8){_0xd32aa3[_0xebc5('0x18')](0x194);}return _0x1039c8;};}function handleError(_0x424b3b,_0x2680ca){_0x2680ca=_0x2680ca||0x1f4;return function(_0x2ecf0f){logger[_0xebc5('0x26')](_0x2ecf0f[_0xebc5('0x27')]);if(_0x2ecf0f[_0xebc5('0x28')]){delete _0x2ecf0f['name'];}_0x424b3b[_0xebc5('0x1d')](_0x2680ca)[_0xebc5('0x29')](_0x2ecf0f);};}exports['index']=function(_0x521153,_0x1f1037){var _0x4ab453={},_0x5bceb2={},_0x4a8e77={'count':0x0,'rows':[]};var _0x337aba=db[_0xebc5('0x2a')][_0xebc5('0x2b')];_0x5bceb2['model']=_['keys'](_0x337aba);_0x5bceb2['query']=_[_0xebc5('0x2c')](_0x521153[_0xebc5('0x2d')]);_0x5bceb2['filters']=_['intersection'](_0x5bceb2[_0xebc5('0x2e')],_0x5bceb2[_0xebc5('0x2d')]);_0x4ab453[_0xebc5('0x2f')]=_[_0xebc5('0x30')](_0x5bceb2['model'],qs[_0xebc5('0x31')](_0x521153[_0xebc5('0x2d')][_0xebc5('0x31')]));_0x4ab453['attributes']=_0x4ab453['attributes'][_0xebc5('0x32')]?_0x4ab453[_0xebc5('0x2f')]:_0x5bceb2['model'];if(!_0x521153[_0xebc5('0x2d')][_0xebc5('0x33')](_0xebc5('0x34'))){_0x4ab453[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x521153['query'][_0xebc5('0x1c')]);_0x4ab453[_0xebc5('0x1b')]=qs[_0xebc5('0x1b')](_0x521153[_0xebc5('0x2d')]['offset']);}_0x4ab453[_0xebc5('0x35')]=qs[_0xebc5('0x36')](_0x521153[_0xebc5('0x2d')][_0xebc5('0x36')]);_0x4ab453[_0xebc5('0x37')]=qs[_0xebc5('0x38')](_[_0xebc5('0x39')](_0x521153['query'],_0x5bceb2[_0xebc5('0x38')]));if(_0x521153[_0xebc5('0x2d')]['filter']){_0x4ab453[_0xebc5('0x37')]=_['merge'](_0x4ab453[_0xebc5('0x37')],{'$or':_['map'](_0x337aba,function(_0x10ee62){if(_0x10ee62[_0xebc5('0x3a')][_0xebc5('0x3b')]!==_0xebc5('0x3c')){var _0x29472b={};_0x29472b[_0x10ee62[_0xebc5('0x3d')]]={'$like':'%'+_0x521153[_0xebc5('0x2d')]['filter']+'%'};return _0x29472b;}})});}_0x4ab453=_['merge']({},_0x4ab453,_0x521153[_0xebc5('0x3e')]);var _0x25effd={'where':_0x4ab453[_0xebc5('0x37')]};return db[_0xebc5('0x2a')][_0xebc5('0x3f')](_0x25effd)[_0xebc5('0x24')](function(_0x4f9cbc){_0x4a8e77[_0xebc5('0x3f')]=_0x4f9cbc;if(_0x521153[_0xebc5('0x2d')][_0xebc5('0x40')]){_0x4ab453[_0xebc5('0x41')]=[{'all':!![]}];}return db[_0xebc5('0x2a')][_0xebc5('0x42')](_0x4ab453);})[_0xebc5('0x24')](function(_0x39f2d8){_0x4a8e77['rows']=_0x39f2d8;return _0x4a8e77;})[_0xebc5('0x24')](respondWithFilteredResult(_0x1f1037,_0x4ab453))[_0xebc5('0x43')](handleError(_0x1f1037,null));};exports['show']=function(_0x1933ff,_0x3d27a2){var _0x27c10e={'raw':!![],'where':{'id':_0x1933ff['params']['id']}},_0x57348b={};_0x57348b[_0xebc5('0x2e')]=_[_0xebc5('0x2c')](db[_0xebc5('0x2a')][_0xebc5('0x2b')]);_0x57348b['query']=_[_0xebc5('0x2c')](_0x1933ff[_0xebc5('0x2d')]);_0x57348b[_0xebc5('0x38')]=_[_0xebc5('0x30')](_0x57348b[_0xebc5('0x2e')],_0x57348b[_0xebc5('0x2d')]);_0x27c10e[_0xebc5('0x2f')]=_[_0xebc5('0x30')](_0x57348b['model'],qs[_0xebc5('0x31')](_0x1933ff[_0xebc5('0x2d')][_0xebc5('0x31')]));_0x27c10e['attributes']=_0x27c10e['attributes']['length']?_0x27c10e[_0xebc5('0x2f')]:_0x57348b[_0xebc5('0x2e')];if(_0x1933ff[_0xebc5('0x2d')][_0xebc5('0x40')]){_0x27c10e['include']=[{'all':!![]}];}_0x27c10e=_[_0xebc5('0x44')]({},_0x27c10e,_0x1933ff[_0xebc5('0x3e')]);return db[_0xebc5('0x2a')][_0xebc5('0x45')](_0x27c10e)[_0xebc5('0x24')](handleEntityNotFound(_0x3d27a2,null))[_0xebc5('0x24')](respondWithResult(_0x3d27a2,null))[_0xebc5('0x43')](handleError(_0x3d27a2,null));};exports[_0xebc5('0x46')]=function(_0x4f2e5f,_0x3a2c52){return db['FaxQueueReport'][_0xebc5('0x46')](_0x4f2e5f['body'],{})['then'](respondWithResult(_0x3a2c52,0xc9))[_0xebc5('0x43')](handleError(_0x3a2c52,null));};exports[_0xebc5('0x23')]=function(_0x1aa4ca,_0x4eabe1){if(_0x1aa4ca['body']['id']){delete _0x1aa4ca[_0xebc5('0x47')]['id'];}return db[_0xebc5('0x2a')][_0xebc5('0x45')]({'where':{'id':_0x1aa4ca[_0xebc5('0x48')]['id']}})[_0xebc5('0x24')](handleEntityNotFound(_0x4eabe1,null))['then'](saveUpdates(_0x1aa4ca[_0xebc5('0x47')],null))[_0xebc5('0x24')](respondWithResult(_0x4eabe1,null))[_0xebc5('0x43')](handleError(_0x4eabe1,null));};exports['destroy']=function(_0xdd56fa,_0x1c378e){return db[_0xebc5('0x2a')][_0xebc5('0x45')]({'where':{'id':_0xdd56fa[_0xebc5('0x48')]['id']}})[_0xebc5('0x24')](handleEntityNotFound(_0x1c378e,null))[_0xebc5('0x24')](removeEntity(_0x1c378e,null))[_0xebc5('0x43')](handleError(_0x1c378e,null));};exports[_0xebc5('0x49')]=function(_0x4e1239,_0x128d32){return db['FaxQueueReport'][_0xebc5('0x49')]()[_0xebc5('0x24')](respondWithResult(_0x128d32,null))[_0xebc5('0x43')](handleError(_0x128d32,null));}; \ No newline at end of file +var _0x3caa=['FaxQueueReport','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0x3caa,0xb0));var _0xa3ca=function(_0x469b5,_0x3292e0){_0x469b5=_0x469b5-0x0;var _0x5ca135=_0x3caa[_0x469b5];return _0x5ca135;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa3ca('0x0'));var rimraf=require(_0xa3ca('0x1'));var zipdir=require(_0xa3ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3ca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa3ca('0x4'));var path=require(_0xa3ca('0x5'));var sox=require(_0xa3ca('0x6'));var csv=require('to-csv');var ejs=require(_0xa3ca('0x7'));var fs=require('fs');var _=require(_0xa3ca('0x8'));var squel=require(_0xa3ca('0x9'));var crypto=require(_0xa3ca('0xa'));var jsforce=require(_0xa3ca('0xb'));var deskjs=require(_0xa3ca('0xc'));var toCsv=require(_0xa3ca('0xd'));var querystring=require(_0xa3ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa3ca('0xf'));var qs=require(_0xa3ca('0x10'));var hardwareService=require(_0xa3ca('0x11'));var logger=require(_0xa3ca('0x12'))(_0xa3ca('0x13'));var utils=require(_0xa3ca('0x14'));var config=require(_0xa3ca('0x15'));var db=require(_0xa3ca('0x16'))['db'];function respondWithStatusCode(_0x43569e,_0x5ef51a){_0x5ef51a=_0x5ef51a||0xcc;return function(_0x3620cc){if(_0x3620cc){return _0x43569e[_0xa3ca('0x17')](_0x5ef51a);}return _0x43569e[_0xa3ca('0x18')](_0x5ef51a)[_0xa3ca('0x19')]();};}function respondWithResult(_0x18edd6,_0x23698c){_0x23698c=_0x23698c||0xc8;return function(_0x55fc41){if(_0x55fc41){return _0x18edd6['status'](_0x23698c)[_0xa3ca('0x1a')](_0x55fc41);}};}function respondWithFilteredResult(_0x2c9022,_0x318fc5){return function(_0x1eec1a){if(_0x1eec1a){var _0x48aca4=_0x1eec1a[_0xa3ca('0x1b')],_0x1a570b=_0x318fc5[_0xa3ca('0x1c')],_0xd81861=_0x318fc5['offset']+_0x318fc5[_0xa3ca('0x1d')],_0x110a55;if(_0xd81861>=_0x48aca4){_0xd81861=_0x48aca4;_0x110a55=0xc8;}else{_0x110a55=0xce;}_0x2c9022[_0xa3ca('0x18')](_0x110a55);return _0x2c9022[_0xa3ca('0x1e')](_0xa3ca('0x1f'),_0x1a570b+'-'+_0xd81861+'/'+_0x48aca4)[_0xa3ca('0x1a')](_0x1eec1a);}return null;};}function patchUpdates(_0x574b09){return function(_0x3b1174){try{jsonpatch[_0xa3ca('0x20')](_0x3b1174,_0x574b09,!![]);}catch(_0x295011){return BPromise['reject'](_0x295011);}return _0x3b1174['save']();};}function saveUpdates(_0x574301,_0x198fa0){return function(_0x208ade){if(_0x208ade){return _0x208ade['update'](_0x574301)[_0xa3ca('0x21')](function(_0x52b217){return _0x52b217;});}return null;};}function removeEntity(_0x1f7e28,_0x184851){return function(_0x51c8ff){if(_0x51c8ff){return _0x51c8ff[_0xa3ca('0x22')]()['then'](function(){_0x1f7e28[_0xa3ca('0x18')](0xcc)[_0xa3ca('0x19')]();});}};}function handleEntityNotFound(_0x5b5a82,_0xff4071){return function(_0xccdac3){if(!_0xccdac3){_0x5b5a82[_0xa3ca('0x17')](0x194);}return _0xccdac3;};}function handleError(_0x47d57b,_0x2e35c1){_0x2e35c1=_0x2e35c1||0x1f4;return function(_0x238f23){logger[_0xa3ca('0x23')](_0x238f23[_0xa3ca('0x24')]);if(_0x238f23[_0xa3ca('0x25')]){delete _0x238f23[_0xa3ca('0x25')];}_0x47d57b['status'](_0x2e35c1)[_0xa3ca('0x26')](_0x238f23);};}exports[_0xa3ca('0x27')]=function(_0x8f633e,_0x40d7ae){var _0x1d3e48={},_0xd930a4={},_0x2c4a48={'count':0x0,'rows':[]};var _0x583d22=db[_0xa3ca('0x28')][_0xa3ca('0x29')];_0xd930a4['model']=_[_0xa3ca('0x2a')](_0x583d22);_0xd930a4['query']=_[_0xa3ca('0x2a')](_0x8f633e[_0xa3ca('0x2b')]);_0xd930a4[_0xa3ca('0x2c')]=_[_0xa3ca('0x2d')](_0xd930a4['model'],_0xd930a4[_0xa3ca('0x2b')]);_0x1d3e48[_0xa3ca('0x2e')]=_[_0xa3ca('0x2d')](_0xd930a4['model'],qs[_0xa3ca('0x2f')](_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x2f')]));_0x1d3e48[_0xa3ca('0x2e')]=_0x1d3e48['attributes'][_0xa3ca('0x30')]?_0x1d3e48[_0xa3ca('0x2e')]:_0xd930a4[_0xa3ca('0x31')];if(!_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x32')](_0xa3ca('0x33'))){_0x1d3e48[_0xa3ca('0x1d')]=qs[_0xa3ca('0x1d')](_0x8f633e['query'][_0xa3ca('0x1d')]);_0x1d3e48[_0xa3ca('0x1c')]=qs[_0xa3ca('0x1c')](_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x1c')]);}_0x1d3e48['order']=qs[_0xa3ca('0x34')](_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x34')]);_0x1d3e48['where']=qs[_0xa3ca('0x2c')](_[_0xa3ca('0x35')](_0x8f633e[_0xa3ca('0x2b')],_0xd930a4[_0xa3ca('0x2c')]));if(_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x36')]){_0x1d3e48[_0xa3ca('0x37')]=_[_0xa3ca('0x38')](_0x1d3e48[_0xa3ca('0x37')],{'$or':_['map'](_0x583d22,function(_0x706ef9){if(_0x706ef9['type'][_0xa3ca('0x39')]!==_0xa3ca('0x3a')){var _0xf7a07={};_0xf7a07[_0x706ef9[_0xa3ca('0x3b')]]={'$like':'%'+_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x36')]+'%'};return _0xf7a07;}})});}_0x1d3e48=_['merge']({},_0x1d3e48,_0x8f633e[_0xa3ca('0x3c')]);var _0x26c797={'where':_0x1d3e48['where']};return db['FaxQueueReport'][_0xa3ca('0x1b')](_0x26c797)[_0xa3ca('0x21')](function(_0x23f987){_0x2c4a48[_0xa3ca('0x1b')]=_0x23f987;if(_0x8f633e[_0xa3ca('0x2b')][_0xa3ca('0x3d')]){_0x1d3e48['include']=[{'all':!![]}];}return db[_0xa3ca('0x28')]['findAll'](_0x1d3e48);})['then'](function(_0x1bc225){_0x2c4a48[_0xa3ca('0x3e')]=_0x1bc225;return _0x2c4a48;})[_0xa3ca('0x21')](respondWithFilteredResult(_0x40d7ae,_0x1d3e48))[_0xa3ca('0x3f')](handleError(_0x40d7ae,null));};exports[_0xa3ca('0x40')]=function(_0x11ab20,_0x42a4cd){var _0x3340be={'raw':!![],'where':{'id':_0x11ab20[_0xa3ca('0x41')]['id']}},_0x242c9e={};_0x242c9e[_0xa3ca('0x31')]=_['keys'](db['FaxQueueReport'][_0xa3ca('0x29')]);_0x242c9e['query']=_[_0xa3ca('0x2a')](_0x11ab20[_0xa3ca('0x2b')]);_0x242c9e[_0xa3ca('0x2c')]=_[_0xa3ca('0x2d')](_0x242c9e[_0xa3ca('0x31')],_0x242c9e[_0xa3ca('0x2b')]);_0x3340be['attributes']=_[_0xa3ca('0x2d')](_0x242c9e[_0xa3ca('0x31')],qs['fields'](_0x11ab20[_0xa3ca('0x2b')][_0xa3ca('0x2f')]));_0x3340be[_0xa3ca('0x2e')]=_0x3340be[_0xa3ca('0x2e')][_0xa3ca('0x30')]?_0x3340be[_0xa3ca('0x2e')]:_0x242c9e[_0xa3ca('0x31')];if(_0x11ab20[_0xa3ca('0x2b')][_0xa3ca('0x3d')]){_0x3340be[_0xa3ca('0x42')]=[{'all':!![]}];}_0x3340be=_[_0xa3ca('0x38')]({},_0x3340be,_0x11ab20[_0xa3ca('0x3c')]);return db[_0xa3ca('0x28')][_0xa3ca('0x43')](_0x3340be)[_0xa3ca('0x21')](handleEntityNotFound(_0x42a4cd,null))[_0xa3ca('0x21')](respondWithResult(_0x42a4cd,null))[_0xa3ca('0x3f')](handleError(_0x42a4cd,null));};exports[_0xa3ca('0x44')]=function(_0x3223f8,_0xeaaa47){return db[_0xa3ca('0x28')][_0xa3ca('0x44')](_0x3223f8[_0xa3ca('0x45')],{})[_0xa3ca('0x21')](respondWithResult(_0xeaaa47,0xc9))[_0xa3ca('0x3f')](handleError(_0xeaaa47,null));};exports[_0xa3ca('0x46')]=function(_0x11078c,_0x33cc38){if(_0x11078c[_0xa3ca('0x45')]['id']){delete _0x11078c[_0xa3ca('0x45')]['id'];}return db[_0xa3ca('0x28')][_0xa3ca('0x43')]({'where':{'id':_0x11078c[_0xa3ca('0x41')]['id']}})[_0xa3ca('0x21')](handleEntityNotFound(_0x33cc38,null))['then'](saveUpdates(_0x11078c[_0xa3ca('0x45')],null))['then'](respondWithResult(_0x33cc38,null))[_0xa3ca('0x3f')](handleError(_0x33cc38,null));};exports['destroy']=function(_0x24528a,_0x2444ed){return db['FaxQueueReport'][_0xa3ca('0x43')]({'where':{'id':_0x24528a[_0xa3ca('0x41')]['id']}})[_0xa3ca('0x21')](handleEntityNotFound(_0x2444ed,null))[_0xa3ca('0x21')](removeEntity(_0x2444ed,null))[_0xa3ca('0x3f')](handleError(_0x2444ed,null));};exports[_0xa3ca('0x47')]=function(_0x8d92a9,_0x132370){return db['FaxQueueReport'][_0xa3ca('0x47')]()[_0xa3ca('0x21')](respondWithResult(_0x132370,null))[_0xa3ca('0x3f')](handleError(_0x132370,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 05f4a80..4ca1691 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 _0x66e3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueueReport.attributes','FaxQueueReport','uniqueid','lodash'];(function(_0x5404e9,_0x132866){var _0x2d7c75=function(_0x3a3db9){while(--_0x3a3db9){_0x5404e9['push'](_0x5404e9['shift']());}};_0x2d7c75(++_0x132866);}(_0x66e3,0x1c7));var _0x366e=function(_0x462c16,_0xd4cadb){_0x462c16=_0x462c16-0x0;var _0x3cb556=_0x66e3[_0x462c16];return _0x3cb556;};'use strict';var _=require(_0x366e('0x0'));var util=require(_0x366e('0x1'));var logger=require(_0x366e('0x2'))(_0x366e('0x3'));var moment=require(_0x366e('0x4'));var BPromise=require(_0x366e('0x5'));var rp=require(_0x366e('0x6'));var fs=require('fs');var path=require(_0x366e('0x7'));var rimraf=require(_0x366e('0x8'));var config=require('../../config/environment');var attributes=require(_0x366e('0x9'));module['exports']=function(_0x15c28d,_0x545c12){return _0x15c28d['define'](_0x366e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x366e('0xb'),'fields':[_0x366e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x521d=['bluebird','path','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1aba57,_0x563b55){var _0x4d442d=function(_0x1e00c5){while(--_0x1e00c5){_0x1aba57['push'](_0x1aba57['shift']());}};_0x4d442d(++_0x563b55);}(_0x521d,0x167));var _0xd521=function(_0x138469,_0x50b2dc){_0x138469=_0x138469-0x0;var _0x1c7e95=_0x521d[_0x138469];return _0x1c7e95;};'use strict';var _=require(_0xd521('0x0'));var util=require(_0xd521('0x1'));var logger=require(_0xd521('0x2'))(_0xd521('0x3'));var moment=require(_0xd521('0x4'));var BPromise=require(_0xd521('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd521('0x6'));var rimraf=require('rimraf');var config=require(_0xd521('0x7'));var attributes=require(_0xd521('0x8'));module[_0xd521('0x9')]=function(_0x2a0014,_0x2f3fc8){return _0x2a0014[_0xd521('0xa')](_0xd521('0xb'),attributes,{'tableName':_0xd521('0xc'),'paranoid':![],'indexes':[{'name':_0xd521('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 9c1974a..7be77f0 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 _0xc900=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','UpdateFaxQueueReport','update','body','where','attributes','limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x59e27e,_0x18ac05){var _0x544ac0=function(_0x2b39c4){while(--_0x2b39c4){_0x59e27e['push'](_0x59e27e['shift']());}};_0x544ac0(++_0x18ac05);}(_0xc900,0xb3));var _0x0c90=function(_0x32a13f,_0x4528d6){_0x32a13f=_0x32a13f-0x0;var _0x489622=_0xc900[_0x32a13f];return _0x489622;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x302ab1,_0x5b1a5c,_0x24e5be){return new BPromise(function(_0x1c1996,_0x23daed){return client[_0x0c90('0xa')](_0x302ab1,_0x24e5be)[_0x0c90('0xb')](function(_0x3d0f49){logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,_0x0c90('0xe'));logger[_0x0c90('0xf')](_0x0c90('0x10'),_0x5b1a5c,_0x0c90('0xe'),JSON[_0x0c90('0x11')](_0x3d0f49));if(_0x3d0f49['error']){if(_0x3d0f49[_0x0c90('0x12')]['code']===0x1f4){logger[_0x0c90('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x23daed(_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);}logger[_0x0c90('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x1c1996(_0x3d0f49['error'][_0x0c90('0x13')]);}else{logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,'request\x20sent');_0x1c1996(_0x3d0f49['result'][_0x0c90('0x13')]);}})[_0x0c90('0x14')](function(_0x2b8135){logger[_0x0c90('0x12')](_0x0c90('0xd'),_0x5b1a5c,_0x2b8135);_0x23daed(_0x2b8135);});});}exports[_0x0c90('0x15')]=function(_0x42321a){var _0x57b9a6=this;return new Promise(function(_0xc3bb47,_0x38becc){return db[_0x0c90('0x16')][_0x0c90('0x17')](_0x42321a['body'],{'raw':_0x42321a[_0x0c90('0x18')]?_0x42321a[_0x0c90('0x18')][_0x0c90('0x19')]===undefined?!![]:![]:!![]})[_0x0c90('0xb')](function(_0x315932){logger[_0x0c90('0xc')]('CreateFaxQueueReport',_0x42321a);logger[_0x0c90('0xf')]('CreateFaxQueueReport',_0x42321a,JSON[_0x0c90('0x11')](_0x315932));_0xc3bb47(_0x315932);})[_0x0c90('0x14')](function(_0x47b13c){logger[_0x0c90('0x12')](_0x0c90('0x15'),_0x47b13c[_0x0c90('0x13')],_0x42321a);_0x38becc(_0x57b9a6[_0x0c90('0x12')](0x1f4,_0x47b13c[_0x0c90('0x13')]));});});};exports[_0x0c90('0x1a')]=function(_0x4dfbc3){var _0x26f0a3=this;return new Promise(function(_0x12f22c,_0x5695a2){return db['FaxQueueReport'][_0x0c90('0x1b')](_0x4dfbc3[_0x0c90('0x1c')],{'raw':_0x4dfbc3[_0x0c90('0x18')]?_0x4dfbc3[_0x0c90('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dfbc3[_0x0c90('0x18')]?_0x4dfbc3[_0x0c90('0x18')][_0x0c90('0x1d')]||null:null,'attributes':_0x4dfbc3[_0x0c90('0x18')]?_0x4dfbc3[_0x0c90('0x18')][_0x0c90('0x1e')]||null:null,'limit':_0x4dfbc3['options']?_0x4dfbc3[_0x0c90('0x18')][_0x0c90('0x1f')]||null:null})[_0x0c90('0xb')](function(_0x13b377){logger['info']('UpdateFaxQueueReport',_0x4dfbc3);logger[_0x0c90('0xf')](_0x0c90('0x1a'),_0x4dfbc3,JSON[_0x0c90('0x11')](_0x13b377));_0x12f22c(_0x13b377);})[_0x0c90('0x14')](function(_0x119e09){logger['error'](_0x0c90('0x1a'),_0x119e09[_0x0c90('0x13')],_0x4dfbc3);_0x5695a2(_0x26f0a3[_0x0c90('0x12')](0x1f4,_0x119e09['message']));});});}; \ No newline at end of file +var _0xc343=['info','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','update','raw','where','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc343,0x173));var _0x3c34=function(_0x58b6bb,_0x4aafe0){_0x58b6bb=_0x58b6bb-0x0;var _0x4e28fa=_0xc343[_0x58b6bb];return _0x4e28fa;};'use strict';var _=require(_0x3c34('0x0'));var util=require('util');var moment=require(_0x3c34('0x1'));var BPromise=require(_0x3c34('0x2'));var rs=require(_0x3c34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3c34('0x4'));var logger=require(_0x3c34('0x5'))(_0x3c34('0x6'));var config=require(_0x3c34('0x7'));var jayson=require(_0x3c34('0x8'));var client=jayson[_0x3c34('0x9')][_0x3c34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b12df,_0x9b457,_0x3d7335){return new BPromise(function(_0x351315,_0x1e98c3){return client[_0x3c34('0xb')](_0x2b12df,_0x3d7335)[_0x3c34('0xc')](function(_0x182f43){logger['info'](_0x3c34('0xd'),_0x9b457,'request\x20sent');logger[_0x3c34('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x9b457,_0x3c34('0xf'),JSON[_0x3c34('0x10')](_0x182f43));if(_0x182f43[_0x3c34('0x11')]){if(_0x182f43[_0x3c34('0x11')]['code']===0x1f4){logger['error'](_0x3c34('0xd'),_0x9b457,_0x182f43[_0x3c34('0x11')]['message']);return _0x1e98c3(_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);}logger['error'](_0x3c34('0xd'),_0x9b457,_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);return _0x351315(_0x182f43[_0x3c34('0x11')][_0x3c34('0x12')]);}else{logger[_0x3c34('0x13')](_0x3c34('0xd'),_0x9b457,'request\x20sent');_0x351315(_0x182f43[_0x3c34('0x14')][_0x3c34('0x12')]);}})[_0x3c34('0x15')](function(_0x2b01ad){logger['error'](_0x3c34('0xd'),_0x9b457,_0x2b01ad);_0x1e98c3(_0x2b01ad);});});}exports[_0x3c34('0x16')]=function(_0x1f3014){var _0x1139c1=this;return new Promise(function(_0x28849e,_0x2169b5){return db[_0x3c34('0x17')]['create'](_0x1f3014[_0x3c34('0x18')],{'raw':_0x1f3014[_0x3c34('0x19')]?_0x1f3014[_0x3c34('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3c34('0xc')](function(_0xcdffe7){logger[_0x3c34('0x13')](_0x3c34('0x16'),_0x1f3014);logger[_0x3c34('0xe')](_0x3c34('0x16'),_0x1f3014,JSON[_0x3c34('0x10')](_0xcdffe7));_0x28849e(_0xcdffe7);})[_0x3c34('0x15')](function(_0x8ea2aa){logger[_0x3c34('0x11')](_0x3c34('0x16'),_0x8ea2aa[_0x3c34('0x12')],_0x1f3014);_0x2169b5(_0x1139c1['error'](0x1f4,_0x8ea2aa[_0x3c34('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x45d8f5){var _0xd36ab8=this;return new Promise(function(_0x1fd657,_0x463cac){return db[_0x3c34('0x17')][_0x3c34('0x1a')](_0x45d8f5[_0x3c34('0x18')],{'raw':_0x45d8f5[_0x3c34('0x19')]?_0x45d8f5['options'][_0x3c34('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45d8f5[_0x3c34('0x19')]?_0x45d8f5[_0x3c34('0x19')][_0x3c34('0x1c')]||null:null,'attributes':_0x45d8f5['options']?_0x45d8f5[_0x3c34('0x19')]['attributes']||null:null,'limit':_0x45d8f5['options']?_0x45d8f5['options'][_0x3c34('0x1d')]||null:null})['then'](function(_0x5c3ca0){logger[_0x3c34('0x13')]('UpdateFaxQueueReport',_0x45d8f5);logger['debug']('UpdateFaxQueueReport',_0x45d8f5,JSON['stringify'](_0x5c3ca0));_0x1fd657(_0x5c3ca0);})[_0x3c34('0x15')](function(_0x431b7c){logger[_0x3c34('0x11')]('UpdateFaxQueueReport',_0x431b7c[_0x3c34('0x12')],_0x45d8f5);_0x463cac(_0xd36ab8[_0x3c34('0x11')](0x1f4,_0x431b7c[_0x3c34('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b4bca5f..e076eb3 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 _0xf37d=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x1b5b09,_0x3caf1c){var _0x34b8e2=function(_0x2f0f7d){while(--_0x2f0f7d){_0x1b5b09['push'](_0x1b5b09['shift']());}};_0x34b8e2(++_0x3caf1c);}(_0xf37d,0x140));var _0xdf37=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf37d[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xdf37('0x0'));var util=require(_0xdf37('0x1'));var path=require(_0xdf37('0x2'));var timeout=require(_0xdf37('0x3'));var express=require(_0xdf37('0x4'));var router=express[_0xdf37('0x5')]();var auth=require(_0xdf37('0x6'));var interaction=require(_0xdf37('0x7'));var config=require(_0xdf37('0x8'));var controller=require(_0xdf37('0x9'));router[_0xdf37('0xa')]('/',auth[_0xdf37('0xb')](),controller[_0xdf37('0xc')]);router[_0xdf37('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xdf37('0xd')]);router[_0xdf37('0xa')]('/:id',auth[_0xdf37('0xb')](),controller[_0xdf37('0xe')]);router[_0xdf37('0xf')]('/',auth[_0xdf37('0xb')](),controller['create']);router['put'](_0xdf37('0x10'),auth[_0xdf37('0xb')](),controller[_0xdf37('0x11')]);router[_0xdf37('0x12')](_0xdf37('0x10'),auth[_0xdf37('0xb')](),controller[_0xdf37('0x13')]);module[_0xdf37('0x14')]=router; \ No newline at end of file +var _0xcb15=['./faxQueueReport.controller','get','isAuthenticated','index','show','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xcb15,0x72));var _0x5cb1=function(_0x38ebc9,_0x10e207){_0x38ebc9=_0x38ebc9-0x0;var _0x3fcea4=_0xcb15[_0x38ebc9];return _0x3fcea4;};'use strict';var multer=require(_0x5cb1('0x0'));var util=require(_0x5cb1('0x1'));var path=require(_0x5cb1('0x2'));var timeout=require(_0x5cb1('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5cb1('0x4'));var config=require(_0x5cb1('0x5'));var controller=require(_0x5cb1('0x6'));router[_0x5cb1('0x7')]('/',auth[_0x5cb1('0x8')](),controller[_0x5cb1('0x9')]);router['get']('/describe',auth[_0x5cb1('0x8')](),controller['describe']);router[_0x5cb1('0x7')]('/:id',auth[_0x5cb1('0x8')](),controller[_0x5cb1('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5cb1('0xb')]('/:id',auth[_0x5cb1('0x8')](),controller['update']);router[_0x5cb1('0xc')]('/:id',auth[_0x5cb1('0x8')](),controller[_0x5cb1('0xd')]);module[_0x5cb1('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 691c77b..9581553 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 _0x0fa1=['DATE','NOW','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x372c92,_0x1cae70){var _0x2baee6=function(_0x898a6e){while(--_0x898a6e){_0x372c92['push'](_0x372c92['shift']());}};_0x2baee6(++_0x1cae70);}(_0x0fa1,0x1df));var _0x10fa=function(_0xc87452,_0x3551e5){_0xc87452=_0xc87452-0x0;var _0x4eee65=_0x0fa1[_0xc87452];return _0x4eee65;};'use strict';var moment=require('moment');var Sequelize=require(_0x10fa('0x0'));module[_0x10fa('0x1')]={'uniqueid':{'type':Sequelize[_0x10fa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x10fa('0x3')](_0x10fa('0x4'),_0x10fa('0x5'),'queue'),'allowNull':![],'defaultValue':_0x10fa('0x6')},'transferredAt':{'type':Sequelize[_0x10fa('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x10fa('0x8')]}}; \ No newline at end of file +var _0x01ef=['exports','STRING','ENUM','account','agent','queue','NOW','moment'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x01ef,0xd7));var _0xf01e=function(_0x5e7c64,_0x31a899){_0x5e7c64=_0x5e7c64-0x0;var _0x36f339=_0x01ef[_0x5e7c64];return _0x36f339;};'use strict';var moment=require(_0xf01e('0x0'));var Sequelize=require('sequelize');module[_0xf01e('0x1')]={'uniqueid':{'type':Sequelize[_0xf01e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf01e('0x3')](_0xf01e('0x4'),_0xf01e('0x5'),_0xf01e('0x6')),'allowNull':![],'defaultValue':_0xf01e('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf01e('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 2b4a1af..d57b099 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 _0x02d0=['send','index','FaxTransferReport','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','show','params','length','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','offset','set','apply','reject','save','update','then','destroy','sendStatus','name'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x02d0,0xb3));var _0x002d=function(_0x53111d,_0x35f88b){_0x53111d=_0x53111d-0x0;var _0x1998d8=_0x02d0[_0x53111d];return _0x1998d8;};'use strict';var pdf=require(_0x002d('0x0'));var emlformat=require(_0x002d('0x1'));var rimraf=require(_0x002d('0x2'));var zipdir=require(_0x002d('0x3'));var jsonpatch=require(_0x002d('0x4'));var rp=require(_0x002d('0x5'));var moment=require(_0x002d('0x6'));var BPromise=require(_0x002d('0x7'));var Mustache=require(_0x002d('0x8'));var util=require(_0x002d('0x9'));var path=require(_0x002d('0xa'));var sox=require(_0x002d('0xb'));var csv=require(_0x002d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x002d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x002d('0xe'));var Papa=require('papaparse');var Redis=require(_0x002d('0xf'));var authService=require(_0x002d('0x10'));var qs=require(_0x002d('0x11'));var hardwareService=require(_0x002d('0x12'));var logger=require('../../config/logger')(_0x002d('0x13'));var utils=require('../../config/utils');var config=require(_0x002d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ddad2,_0x428bf1){_0x428bf1=_0x428bf1||0xcc;return function(_0x83925c){if(_0x83925c){return _0x1ddad2['sendStatus'](_0x428bf1);}return _0x1ddad2[_0x002d('0x15')](_0x428bf1)[_0x002d('0x16')]();};}function respondWithResult(_0x18b574,_0x44568b){_0x44568b=_0x44568b||0xc8;return function(_0x221c9a){if(_0x221c9a){return _0x18b574[_0x002d('0x15')](_0x44568b)[_0x002d('0x17')](_0x221c9a);}};}function respondWithFilteredResult(_0x2b2a43,_0x44e6d8){return function(_0x1f3bd2){if(_0x1f3bd2){var _0x492930=_0x1f3bd2['count'],_0x43d9a0=_0x44e6d8[_0x002d('0x18')],_0x2d766c=_0x44e6d8[_0x002d('0x18')]+_0x44e6d8['limit'],_0x2b7d4c;if(_0x2d766c>=_0x492930){_0x2d766c=_0x492930;_0x2b7d4c=0xc8;}else{_0x2b7d4c=0xce;}_0x2b2a43['status'](_0x2b7d4c);return _0x2b2a43[_0x002d('0x19')]('Content-Range',_0x43d9a0+'-'+_0x2d766c+'/'+_0x492930)[_0x002d('0x17')](_0x1f3bd2);}return null;};}function patchUpdates(_0x2fae69){return function(_0x3811dc){try{jsonpatch[_0x002d('0x1a')](_0x3811dc,_0x2fae69,!![]);}catch(_0xacd985){return BPromise[_0x002d('0x1b')](_0xacd985);}return _0x3811dc[_0x002d('0x1c')]();};}function saveUpdates(_0x720edc,_0x92cae8){return function(_0xfbe9e8){if(_0xfbe9e8){return _0xfbe9e8[_0x002d('0x1d')](_0x720edc)[_0x002d('0x1e')](function(_0x8bfd1d){return _0x8bfd1d;});}return null;};}function removeEntity(_0x47c897,_0x270a5e){return function(_0x1a5612){if(_0x1a5612){return _0x1a5612[_0x002d('0x1f')]()[_0x002d('0x1e')](function(){_0x47c897[_0x002d('0x15')](0xcc)[_0x002d('0x16')]();});}};}function handleEntityNotFound(_0x49b93e,_0x27e60c){return function(_0x286e1e){if(!_0x286e1e){_0x49b93e[_0x002d('0x20')](0x194);}return _0x286e1e;};}function handleError(_0x4f76a6,_0xf576b0){_0xf576b0=_0xf576b0||0x1f4;return function(_0x307db5){logger['error'](_0x307db5['stack']);if(_0x307db5[_0x002d('0x21')]){delete _0x307db5[_0x002d('0x21')];}_0x4f76a6['status'](_0xf576b0)[_0x002d('0x22')](_0x307db5);};}exports[_0x002d('0x23')]=function(_0x47c0fb,_0x192f3e){var _0x115b6f={},_0x45d481={},_0xbf3e4f={'count':0x0,'rows':[]};var _0x8b0e07=db[_0x002d('0x24')][_0x002d('0x25')];_0x45d481[_0x002d('0x26')]=_[_0x002d('0x27')](_0x8b0e07);_0x45d481[_0x002d('0x28')]=_[_0x002d('0x27')](_0x47c0fb[_0x002d('0x28')]);_0x45d481['filters']=_[_0x002d('0x29')](_0x45d481['model'],_0x45d481[_0x002d('0x28')]);_0x115b6f[_0x002d('0x2a')]=_[_0x002d('0x29')](_0x45d481[_0x002d('0x26')],qs['fields'](_0x47c0fb[_0x002d('0x28')][_0x002d('0x2b')]));_0x115b6f[_0x002d('0x2a')]=_0x115b6f['attributes']['length']?_0x115b6f[_0x002d('0x2a')]:_0x45d481[_0x002d('0x26')];if(!_0x47c0fb[_0x002d('0x28')]['hasOwnProperty'](_0x002d('0x2c'))){_0x115b6f[_0x002d('0x2d')]=qs[_0x002d('0x2d')](_0x47c0fb[_0x002d('0x28')][_0x002d('0x2d')]);_0x115b6f[_0x002d('0x18')]=qs[_0x002d('0x18')](_0x47c0fb[_0x002d('0x28')]['offset']);}_0x115b6f[_0x002d('0x2e')]=qs[_0x002d('0x2f')](_0x47c0fb[_0x002d('0x28')][_0x002d('0x2f')]);_0x115b6f[_0x002d('0x30')]=qs[_0x002d('0x31')](_[_0x002d('0x32')](_0x47c0fb[_0x002d('0x28')],_0x45d481['filters']));if(_0x47c0fb[_0x002d('0x28')][_0x002d('0x33')]){_0x115b6f[_0x002d('0x30')]=_[_0x002d('0x34')](_0x115b6f['where'],{'$or':_[_0x002d('0x35')](_0x8b0e07,function(_0x81c256){if(_0x81c256[_0x002d('0x36')][_0x002d('0x37')]!==_0x002d('0x38')){var _0x1bdc67={};_0x1bdc67[_0x81c256[_0x002d('0x39')]]={'$like':'%'+_0x47c0fb['query']['filter']+'%'};return _0x1bdc67;}})});}_0x115b6f=_[_0x002d('0x34')]({},_0x115b6f,_0x47c0fb[_0x002d('0x3a')]);var _0x1a1061={'where':_0x115b6f[_0x002d('0x30')]};return db[_0x002d('0x24')][_0x002d('0x3b')](_0x1a1061)[_0x002d('0x1e')](function(_0x11f6d2){_0xbf3e4f[_0x002d('0x3b')]=_0x11f6d2;if(_0x47c0fb[_0x002d('0x28')][_0x002d('0x3c')]){_0x115b6f[_0x002d('0x3d')]=[{'all':!![]}];}return db[_0x002d('0x24')][_0x002d('0x3e')](_0x115b6f);})[_0x002d('0x1e')](function(_0x3bcb71){_0xbf3e4f['rows']=_0x3bcb71;return _0xbf3e4f;})[_0x002d('0x1e')](respondWithFilteredResult(_0x192f3e,_0x115b6f))['catch'](handleError(_0x192f3e,null));};exports[_0x002d('0x3f')]=function(_0x118940,_0x30851a){var _0x193792={'raw':!![],'where':{'id':_0x118940[_0x002d('0x40')]['id']}},_0x41f8ab={};_0x41f8ab[_0x002d('0x26')]=_[_0x002d('0x27')](db[_0x002d('0x24')][_0x002d('0x25')]);_0x41f8ab[_0x002d('0x28')]=_[_0x002d('0x27')](_0x118940[_0x002d('0x28')]);_0x41f8ab[_0x002d('0x31')]=_[_0x002d('0x29')](_0x41f8ab[_0x002d('0x26')],_0x41f8ab[_0x002d('0x28')]);_0x193792['attributes']=_['intersection'](_0x41f8ab['model'],qs['fields'](_0x118940[_0x002d('0x28')]['fields']));_0x193792['attributes']=_0x193792['attributes'][_0x002d('0x41')]?_0x193792[_0x002d('0x2a')]:_0x41f8ab['model'];if(_0x118940[_0x002d('0x28')][_0x002d('0x3c')]){_0x193792[_0x002d('0x3d')]=[{'all':!![]}];}_0x193792=_[_0x002d('0x34')]({},_0x193792,_0x118940[_0x002d('0x3a')]);return db[_0x002d('0x24')][_0x002d('0x42')](_0x193792)['then'](handleEntityNotFound(_0x30851a,null))[_0x002d('0x1e')](respondWithResult(_0x30851a,null))[_0x002d('0x43')](handleError(_0x30851a,null));};exports[_0x002d('0x44')]=function(_0x498b82,_0x214077){return db['FaxTransferReport'][_0x002d('0x44')](_0x498b82[_0x002d('0x45')],{})[_0x002d('0x1e')](respondWithResult(_0x214077,0xc9))[_0x002d('0x43')](handleError(_0x214077,null));};exports['update']=function(_0x10dc98,_0x1254f2){if(_0x10dc98[_0x002d('0x45')]['id']){delete _0x10dc98[_0x002d('0x45')]['id'];}return db[_0x002d('0x24')][_0x002d('0x42')]({'where':{'id':_0x10dc98[_0x002d('0x40')]['id']}})['then'](handleEntityNotFound(_0x1254f2,null))[_0x002d('0x1e')](saveUpdates(_0x10dc98['body'],null))[_0x002d('0x1e')](respondWithResult(_0x1254f2,null))[_0x002d('0x43')](handleError(_0x1254f2,null));};exports[_0x002d('0x1f')]=function(_0x5f1226,_0x52428f){return db[_0x002d('0x24')][_0x002d('0x42')]({'where':{'id':_0x5f1226['params']['id']}})[_0x002d('0x1e')](handleEntityNotFound(_0x52428f,null))[_0x002d('0x1e')](removeEntity(_0x52428f,null))[_0x002d('0x43')](handleError(_0x52428f,null));};exports[_0x002d('0x46')]=function(_0x4e5bfe,_0x54a3ac){return db[_0x002d('0x24')][_0x002d('0x46')]()[_0x002d('0x1e')](respondWithResult(_0x54a3ac,null))[_0x002d('0x43')](handleError(_0x54a3ac,null));}; \ No newline at end of file +var _0x972a=['error','name','send','FaxTransferReport','rawAttributes','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','params','find','create','body','catch','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','update','then','destroy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x972a,0x1da));var _0xa972=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0x972a[_0x680b65];return _0x1c2053;};'use strict';var pdf=require(_0xa972('0x0'));var emlformat=require(_0xa972('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa972('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa972('0x3'));var moment=require(_0xa972('0x4'));var BPromise=require(_0xa972('0x5'));var Mustache=require(_0xa972('0x6'));var util=require(_0xa972('0x7'));var path=require(_0xa972('0x8'));var sox=require(_0xa972('0x9'));var csv=require(_0xa972('0xa'));var ejs=require(_0xa972('0xb'));var fs=require('fs');var _=require(_0xa972('0xc'));var squel=require(_0xa972('0xd'));var crypto=require('crypto');var jsforce=require(_0xa972('0xe'));var deskjs=require(_0xa972('0xf'));var toCsv=require(_0xa972('0xa'));var querystring=require(_0xa972('0x10'));var Papa=require('papaparse');var Redis=require(_0xa972('0x11'));var authService=require(_0xa972('0x12'));var qs=require(_0xa972('0x13'));var hardwareService=require(_0xa972('0x14'));var logger=require(_0xa972('0x15'))(_0xa972('0x16'));var utils=require(_0xa972('0x17'));var config=require('../../config/environment');var db=require(_0xa972('0x18'))['db'];function respondWithStatusCode(_0xdfc315,_0x133727){_0x133727=_0x133727||0xcc;return function(_0x378fb4){if(_0x378fb4){return _0xdfc315[_0xa972('0x19')](_0x133727);}return _0xdfc315['status'](_0x133727)[_0xa972('0x1a')]();};}function respondWithResult(_0x16c999,_0x396003){_0x396003=_0x396003||0xc8;return function(_0x4b8eb3){if(_0x4b8eb3){return _0x16c999['status'](_0x396003)[_0xa972('0x1b')](_0x4b8eb3);}};}function respondWithFilteredResult(_0x493f3f,_0x24c8f5){return function(_0x4b2b98){if(_0x4b2b98){var _0x1f2cbc=_0x4b2b98['count'],_0x4a231e=_0x24c8f5[_0xa972('0x1c')],_0x2c0976=_0x24c8f5[_0xa972('0x1c')]+_0x24c8f5[_0xa972('0x1d')],_0x214844;if(_0x2c0976>=_0x1f2cbc){_0x2c0976=_0x1f2cbc;_0x214844=0xc8;}else{_0x214844=0xce;}_0x493f3f[_0xa972('0x1e')](_0x214844);return _0x493f3f[_0xa972('0x1f')](_0xa972('0x20'),_0x4a231e+'-'+_0x2c0976+'/'+_0x1f2cbc)[_0xa972('0x1b')](_0x4b2b98);}return null;};}function patchUpdates(_0x2ae4a0){return function(_0x10194c){try{jsonpatch[_0xa972('0x21')](_0x10194c,_0x2ae4a0,!![]);}catch(_0x24093b){return BPromise['reject'](_0x24093b);}return _0x10194c['save']();};}function saveUpdates(_0x30c1db,_0x1dc811){return function(_0x518d6f){if(_0x518d6f){return _0x518d6f[_0xa972('0x22')](_0x30c1db)[_0xa972('0x23')](function(_0x204b94){return _0x204b94;});}return null;};}function removeEntity(_0xfc8e64,_0x106925){return function(_0x2ba8d8){if(_0x2ba8d8){return _0x2ba8d8[_0xa972('0x24')]()[_0xa972('0x23')](function(){_0xfc8e64[_0xa972('0x1e')](0xcc)[_0xa972('0x1a')]();});}};}function handleEntityNotFound(_0x380fed,_0x21aaa1){return function(_0x5a878f){if(!_0x5a878f){_0x380fed[_0xa972('0x19')](0x194);}return _0x5a878f;};}function handleError(_0x3adfab,_0x210f60){_0x210f60=_0x210f60||0x1f4;return function(_0xe53827){logger[_0xa972('0x25')](_0xe53827['stack']);if(_0xe53827[_0xa972('0x26')]){delete _0xe53827['name'];}_0x3adfab[_0xa972('0x1e')](_0x210f60)[_0xa972('0x27')](_0xe53827);};}exports['index']=function(_0x204679,_0x9ff075){var _0x542f8b={},_0x38123f={},_0x5b78e2={'count':0x0,'rows':[]};var _0x4da047=db[_0xa972('0x28')][_0xa972('0x29')];_0x38123f['model']=_[_0xa972('0x2a')](_0x4da047);_0x38123f['query']=_[_0xa972('0x2a')](_0x204679['query']);_0x38123f[_0xa972('0x2b')]=_[_0xa972('0x2c')](_0x38123f[_0xa972('0x2d')],_0x38123f[_0xa972('0x2e')]);_0x542f8b[_0xa972('0x2f')]=_[_0xa972('0x2c')](_0x38123f[_0xa972('0x2d')],qs['fields'](_0x204679['query'][_0xa972('0x30')]));_0x542f8b[_0xa972('0x2f')]=_0x542f8b[_0xa972('0x2f')][_0xa972('0x31')]?_0x542f8b['attributes']:_0x38123f['model'];if(!_0x204679['query'][_0xa972('0x32')](_0xa972('0x33'))){_0x542f8b['limit']=qs['limit'](_0x204679[_0xa972('0x2e')][_0xa972('0x1d')]);_0x542f8b[_0xa972('0x1c')]=qs[_0xa972('0x1c')](_0x204679['query'][_0xa972('0x1c')]);}_0x542f8b[_0xa972('0x34')]=qs[_0xa972('0x35')](_0x204679[_0xa972('0x2e')][_0xa972('0x35')]);_0x542f8b['where']=qs[_0xa972('0x2b')](_['pick'](_0x204679[_0xa972('0x2e')],_0x38123f['filters']));if(_0x204679[_0xa972('0x2e')]['filter']){_0x542f8b[_0xa972('0x36')]=_[_0xa972('0x37')](_0x542f8b[_0xa972('0x36')],{'$or':_[_0xa972('0x38')](_0x4da047,function(_0x4f22fa){if(_0x4f22fa[_0xa972('0x39')]['key']!==_0xa972('0x3a')){var _0x4efb89={};_0x4efb89[_0x4f22fa[_0xa972('0x3b')]]={'$like':'%'+_0x204679[_0xa972('0x2e')][_0xa972('0x3c')]+'%'};return _0x4efb89;}})});}_0x542f8b=_['merge']({},_0x542f8b,_0x204679[_0xa972('0x3d')]);var _0x2c2ba9={'where':_0x542f8b['where']};return db['FaxTransferReport'][_0xa972('0x3e')](_0x2c2ba9)[_0xa972('0x23')](function(_0x37a2ae){_0x5b78e2[_0xa972('0x3e')]=_0x37a2ae;if(_0x204679[_0xa972('0x2e')][_0xa972('0x3f')]){_0x542f8b[_0xa972('0x40')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xa972('0x41')](_0x542f8b);})[_0xa972('0x23')](function(_0x680deb){_0x5b78e2[_0xa972('0x42')]=_0x680deb;return _0x5b78e2;})[_0xa972('0x23')](respondWithFilteredResult(_0x9ff075,_0x542f8b))['catch'](handleError(_0x9ff075,null));};exports['show']=function(_0x5036a4,_0x397a63){var _0x171538={'raw':!![],'where':{'id':_0x5036a4[_0xa972('0x43')]['id']}},_0x9f9d86={};_0x9f9d86[_0xa972('0x2d')]=_['keys'](db['FaxTransferReport'][_0xa972('0x29')]);_0x9f9d86['query']=_[_0xa972('0x2a')](_0x5036a4[_0xa972('0x2e')]);_0x9f9d86[_0xa972('0x2b')]=_[_0xa972('0x2c')](_0x9f9d86[_0xa972('0x2d')],_0x9f9d86[_0xa972('0x2e')]);_0x171538[_0xa972('0x2f')]=_[_0xa972('0x2c')](_0x9f9d86['model'],qs['fields'](_0x5036a4[_0xa972('0x2e')][_0xa972('0x30')]));_0x171538[_0xa972('0x2f')]=_0x171538['attributes'][_0xa972('0x31')]?_0x171538[_0xa972('0x2f')]:_0x9f9d86[_0xa972('0x2d')];if(_0x5036a4[_0xa972('0x2e')][_0xa972('0x3f')]){_0x171538[_0xa972('0x40')]=[{'all':!![]}];}_0x171538=_[_0xa972('0x37')]({},_0x171538,_0x5036a4['options']);return db[_0xa972('0x28')][_0xa972('0x44')](_0x171538)[_0xa972('0x23')](handleEntityNotFound(_0x397a63,null))[_0xa972('0x23')](respondWithResult(_0x397a63,null))['catch'](handleError(_0x397a63,null));};exports[_0xa972('0x45')]=function(_0x58961d,_0x15da31){return db[_0xa972('0x28')][_0xa972('0x45')](_0x58961d[_0xa972('0x46')],{})[_0xa972('0x23')](respondWithResult(_0x15da31,0xc9))[_0xa972('0x47')](handleError(_0x15da31,null));};exports[_0xa972('0x22')]=function(_0x362ed9,_0xc52a0){if(_0x362ed9['body']['id']){delete _0x362ed9[_0xa972('0x46')]['id'];}return db[_0xa972('0x28')][_0xa972('0x44')]({'where':{'id':_0x362ed9['params']['id']}})[_0xa972('0x23')](handleEntityNotFound(_0xc52a0,null))[_0xa972('0x23')](saveUpdates(_0x362ed9[_0xa972('0x46')],null))['then'](respondWithResult(_0xc52a0,null))[_0xa972('0x47')](handleError(_0xc52a0,null));};exports['destroy']=function(_0x2b41cc,_0x4b5786){return db[_0xa972('0x28')][_0xa972('0x44')]({'where':{'id':_0x2b41cc['params']['id']}})[_0xa972('0x23')](handleEntityNotFound(_0x4b5786,null))[_0xa972('0x23')](removeEntity(_0x4b5786,null))[_0xa972('0x47')](handleError(_0x4b5786,null));};exports[_0xa972('0x48')]=function(_0x2b2bbb,_0x5ce1c0){return db['FaxTransferReport']['describe']()[_0xa972('0x23')](respondWithResult(_0x5ce1c0,null))['catch'](handleError(_0x5ce1c0,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6680b3d..1717b53 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 _0x914c=['moment','bluebird','path','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','api'];(function(_0x414507,_0x33faec){var _0x29856c=function(_0xd703ed){while(--_0xd703ed){_0x414507['push'](_0x414507['shift']());}};_0x29856c(++_0x33faec);}(_0x914c,0xcf));var _0xc914=function(_0x536068,_0x3de52c){_0x536068=_0x536068-0x0;var _0x4a5db2=_0x914c[_0x536068];return _0x4a5db2;};'use strict';var _=require('lodash');var util=require(_0xc914('0x0'));var logger=require('../../config/logger')(_0xc914('0x1'));var moment=require(_0xc914('0x2'));var BPromise=require(_0xc914('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc914('0x4'));var rimraf=require('rimraf');var config=require(_0xc914('0x5'));var attributes=require('./faxTransferReport.attributes');module[_0xc914('0x6')]=function(_0x305643,_0xfcda48){return _0x305643[_0xc914('0x7')](_0xc914('0x8'),attributes,{'tableName':_0xc914('0x9'),'paranoid':![],'indexes':[{'name':_0xc914('0xa'),'fields':[_0xc914('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x319b=['./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','moment','rimraf'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x319b,0x89));var _0xb319=function(_0x483597,_0x4de249){_0x483597=_0x483597-0x0;var _0x13e9dd=_0x319b[_0x483597];return _0x13e9dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb319('0x0'))('api');var moment=require(_0xb319('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb319('0x2'));var config=require('../../config/environment');var attributes=require(_0xb319('0x3'));module['exports']=function(_0x56bf07,_0x2fbbc1){return _0x56bf07['define'](_0xb319('0x4'),attributes,{'tableName':_0xb319('0x5'),'paranoid':![],'indexes':[{'name':_0xb319('0x6'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index eeea655..1d59c0a 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 _0x1020=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1a317a,_0x48be34){var _0xb67d5f=function(_0x541023){while(--_0x541023){_0x1a317a['push'](_0x1a317a['shift']());}};_0xb67d5f(++_0x48be34);}(_0x1020,0x191));var _0x0102=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x1020[_0x2265da];return _0x430c2b;};'use strict';var _=require(_0x0102('0x0'));var util=require(_0x0102('0x1'));var moment=require(_0x0102('0x2'));var BPromise=require(_0x0102('0x3'));var rs=require(_0x0102('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0102('0x5'))['db'];var utils=require(_0x0102('0x6'));var logger=require(_0x0102('0x7'))(_0x0102('0x8'));var config=require(_0x0102('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0102('0xa')][_0x0102('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13458a,_0x5f59e2,_0x38cebe){return new BPromise(function(_0x368ac3,_0x3cabef){return client[_0x0102('0xc')](_0x13458a,_0x38cebe)['then'](function(_0x5dc5af){logger[_0x0102('0xd')](_0x0102('0xe'),_0x5f59e2,_0x0102('0xf'));logger[_0x0102('0x10')](_0x0102('0x11'),_0x5f59e2,'request\x20sent',JSON['stringify'](_0x5dc5af));if(_0x5dc5af['error']){if(_0x5dc5af[_0x0102('0x12')][_0x0102('0x13')]===0x1f4){logger['error'](_0x0102('0xe'),_0x5f59e2,_0x5dc5af[_0x0102('0x12')][_0x0102('0x14')]);return _0x3cabef(_0x5dc5af[_0x0102('0x12')]['message']);}logger['error'](_0x0102('0xe'),_0x5f59e2,_0x5dc5af[_0x0102('0x12')]['message']);return _0x368ac3(_0x5dc5af[_0x0102('0x12')][_0x0102('0x14')]);}else{logger[_0x0102('0xd')](_0x0102('0xe'),_0x5f59e2,_0x0102('0xf'));_0x368ac3(_0x5dc5af[_0x0102('0x15')][_0x0102('0x14')]);}})[_0x0102('0x16')](function(_0x3080fe){logger[_0x0102('0x12')](_0x0102('0xe'),_0x5f59e2,_0x3080fe);_0x3cabef(_0x3080fe);});});} \ No newline at end of file +var _0xa4d4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3a951e,_0x35eade){var _0x142e63=function(_0x377c54){while(--_0x377c54){_0x3a951e['push'](_0x3a951e['shift']());}};_0x142e63(++_0x35eade);}(_0xa4d4,0x18b));var _0x4a4d=function(_0x3a54ff,_0x3095c5){_0x3a54ff=_0x3a54ff-0x0;var _0x54a369=_0xa4d4[_0x3a54ff];return _0x54a369;};'use strict';var _=require(_0x4a4d('0x0'));var util=require(_0x4a4d('0x1'));var moment=require(_0x4a4d('0x2'));var BPromise=require(_0x4a4d('0x3'));var rs=require(_0x4a4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a4d('0x5'))['db'];var utils=require(_0x4a4d('0x6'));var logger=require(_0x4a4d('0x7'))(_0x4a4d('0x8'));var config=require(_0x4a4d('0x9'));var jayson=require(_0x4a4d('0xa'));var client=jayson[_0x4a4d('0xb')][_0x4a4d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c1ea4,_0x5c182b,_0x5c8bee){return new BPromise(function(_0x391a21,_0x7de1a9){return client['request'](_0x5c1ea4,_0x5c8bee)[_0x4a4d('0xd')](function(_0x4d8e03){logger[_0x4a4d('0xe')](_0x4a4d('0xf'),_0x5c182b,_0x4a4d('0x10'));logger[_0x4a4d('0x11')](_0x4a4d('0x12'),_0x5c182b,'request\x20sent',JSON[_0x4a4d('0x13')](_0x4d8e03));if(_0x4d8e03['error']){if(_0x4d8e03['error'][_0x4a4d('0x14')]===0x1f4){logger['error'](_0x4a4d('0xf'),_0x5c182b,_0x4d8e03['error'][_0x4a4d('0x15')]);return _0x7de1a9(_0x4d8e03[_0x4a4d('0x16')][_0x4a4d('0x15')]);}logger['error'](_0x4a4d('0xf'),_0x5c182b,_0x4d8e03[_0x4a4d('0x16')][_0x4a4d('0x15')]);return _0x391a21(_0x4d8e03[_0x4a4d('0x16')]['message']);}else{logger[_0x4a4d('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x5c182b,_0x4a4d('0x10'));_0x391a21(_0x4d8e03[_0x4a4d('0x17')][_0x4a4d('0x15')]);}})[_0x4a4d('0x18')](function(_0x255d69){logger[_0x4a4d('0x16')](_0x4a4d('0xf'),_0x5c182b,_0x255d69);_0x7de1a9(_0x255d69);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 816ec2a..bc56c76 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 _0x4b84=['./faxTransferReport.controller','get','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','express','../../components/interaction/service','../../config/environment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x4b84[_0x4605dc];return _0x5d3e81;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x9')]('/',auth[_0x44b8('0x7')](),controller['create']);router[_0x44b8('0xa')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller['destroy']);module[_0x44b8('0xe')]=router; \ No newline at end of file +var _0x5fd1=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','delete','destroy','exports','multer'];(function(_0x484a56,_0x18b9d4){var _0x34c796=function(_0x3a2e52){while(--_0x3a2e52){_0x484a56['push'](_0x484a56['shift']());}};_0x34c796(++_0x18b9d4);}(_0x5fd1,0x155));var _0x15fd=function(_0x219bb8,_0x32f510){_0x219bb8=_0x219bb8-0x0;var _0x8f8340=_0x5fd1[_0x219bb8];return _0x8f8340;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['describe']);router[_0x15fd('0x9')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0xc')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router[_0x15fd('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x15fd('0xf')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x10')]);module[_0x15fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ef4fc04..121fea1 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 _0xd719=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xd719,0x73));var _0x9d71=function(_0x7507ae,_0x243ddb){_0x7507ae=_0x7507ae-0x0;var _0x35a655=_0xd719[_0x7507ae];return _0x35a655;};'use strict';var multer=require('multer');var util=require(_0x9d71('0x0'));var path=require(_0x9d71('0x1'));var timeout=require(_0x9d71('0x2'));var express=require('express');var router=express[_0x9d71('0x3')]();var auth=require(_0x9d71('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d71('0x5'));var controller=require(_0x9d71('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d71('0x7')]);router[_0x9d71('0x8')](_0x9d71('0x9'),auth[_0x9d71('0xa')](),controller['show']);router['get'](_0x9d71('0xb'),auth[_0x9d71('0xa')](),controller[_0x9d71('0xc')]);router['get'](_0x9d71('0xd'),auth['isAuthenticated'](),controller[_0x9d71('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9d71('0xf')](_0x9d71('0xb'),auth[_0x9d71('0xa')](),controller[_0x9d71('0x10')]);router[_0x9d71('0x11')](_0x9d71('0x9'),auth[_0x9d71('0xa')](),controller[_0x9d71('0x12')]);router[_0x9d71('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9d71('0x14')]);module['exports']=router; \ No newline at end of file +var _0x64fc=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x5d4b1a,_0x30243f){var _0x3444c1=function(_0x24dbcd){while(--_0x24dbcd){_0x5d4b1a['push'](_0x5d4b1a['shift']());}};_0x3444c1(++_0x30243f);}(_0x64fc,0x105));var _0xc64f=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x64fc[_0x1f9f37];return _0x21c080;};'use strict';var multer=require(_0xc64f('0x0'));var util=require(_0xc64f('0x1'));var path=require(_0xc64f('0x2'));var timeout=require(_0xc64f('0x3'));var express=require(_0xc64f('0x4'));var router=express[_0xc64f('0x5')]();var auth=require(_0xc64f('0x6'));var interaction=require(_0xc64f('0x7'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xc64f('0x8')]('/',auth['isAuthenticated'](),controller[_0xc64f('0x9')]);router[_0xc64f('0x8')](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller['show']);router[_0xc64f('0x8')](_0xc64f('0xc'),auth['isAuthenticated'](),controller[_0xc64f('0xd')]);router[_0xc64f('0x8')](_0xc64f('0xe'),auth[_0xc64f('0xb')](),controller[_0xc64f('0xf')]);router[_0xc64f('0x10')]('/',auth['isAuthenticated'](),controller[_0xc64f('0x11')]);router['post'](_0xc64f('0xc'),auth[_0xc64f('0xb')](),controller[_0xc64f('0x12')]);router['put'](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller['update']);router[_0xc64f('0x13')](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d1f5f06..3d98395 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 _0xc22a=['integrationTab','newTab','sequelize','STRING','ENUM','basic'];(function(_0x1cd1a1,_0x35f8d7){var _0x2d7ee0=function(_0x43d309){while(--_0x43d309){_0x1cd1a1['push'](_0x1cd1a1['shift']());}};_0x2d7ee0(++_0x35f8d7);}(_0xc22a,0xec));var _0xac22=function(_0x245a46,_0x1ef956){_0x245a46=_0x245a46-0x0;var _0x45c69b=_0xc22a[_0x245a46];return _0x45c69b;};'use strict';var Sequelize=require(_0xac22('0x0'));module['exports']={'name':{'type':Sequelize[_0xac22('0x1')]},'description':{'type':Sequelize[_0xac22('0x1')]},'username':{'type':Sequelize[_0xac22('0x1')]},'remoteUri':{'type':Sequelize[_0xac22('0x1')]},'authType':{'type':Sequelize[_0xac22('0x2')]('basic'),'defaultValue':_0xac22('0x3')},'password':{'type':Sequelize[_0xac22('0x1')]},'consumerKey':{'type':Sequelize[_0xac22('0x1')]},'consumerSecret':{'type':Sequelize[_0xac22('0x1')]},'token':{'type':Sequelize[_0xac22('0x1')]},'tokenSecret':{'type':Sequelize[_0xac22('0x1')]},'serverUrl':{'type':Sequelize[_0xac22('0x1')]},'type':{'type':Sequelize['ENUM'](_0xac22('0x4'),_0xac22('0x5')),'defaultValue':_0xac22('0x4')}}; \ No newline at end of file +var _0x6f3e=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x1b5417,_0xdf2be4){var _0x515433=function(_0x246a65){while(--_0x246a65){_0x1b5417['push'](_0x1b5417['shift']());}};_0x515433(++_0xdf2be4);}(_0x6f3e,0x8a));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe6f3('0x0'));module[_0xe6f3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe6f3('0x2')]},'remoteUri':{'type':Sequelize[_0xe6f3('0x2')]},'authType':{'type':Sequelize[_0xe6f3('0x3')]('basic'),'defaultValue':_0xe6f3('0x4')},'password':{'type':Sequelize[_0xe6f3('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe6f3('0x2')]},'tokenSecret':{'type':Sequelize[_0xe6f3('0x2')]},'serverUrl':{'type':Sequelize[_0xe6f3('0x2')]},'type':{'type':Sequelize[_0xe6f3('0x3')]('integrationTab',_0xe6f3('0x5')),'defaultValue':_0xe6f3('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b2409d8..c1a7eba 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 _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../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~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../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~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 99e4e11..c51da5d 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 _0xedd9=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a7410,_0x57e566){var _0x27be08=function(_0x5275bc){while(--_0x5275bc){_0x5a7410['push'](_0x5a7410['shift']());}};_0x27be08(++_0x57e566);}(_0xedd9,0xfc));var _0x9edd=function(_0x587654,_0x217c1b){_0x587654=_0x587654-0x0;var _0x2041ad=_0xedd9[_0x587654];return _0x2041ad;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));var integrations=require(_0x9edd('0x9'));module[_0x9edd('0xa')]=function(_0x34c1a7,_0x5319f7){return _0x34c1a7[_0x9edd('0xb')]('DeskAccount',attributes,{'tableName':_0x9edd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash','../../config/logger','api','moment'];(function(_0x546327,_0x371cd7){var _0xda1d44=function(_0x33e894){while(--_0x33e894){_0x546327['push'](_0x546327['shift']());}};_0xda1d44(++_0x371cd7);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xb4e6[_0x5d9867];return _0x7d2118;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));var integrations=require(_0x6b4e('0x9'));module[_0x6b4e('0xa')]=function(_0x49de51,_0xd3138f){return _0x49de51['define']('DeskAccount',attributes,{'tableName':_0x6b4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 717fddc..0b50809 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 _0x0733=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','findAll','options','attributes','limit','include','map','model','debug','ShowDeskAccount','DeskAccount','find','where','then','moment','bluebird'];(function(_0x2f8bc5,_0x12e3d1){var _0x2e4207=function(_0x217405){while(--_0x217405){_0x2f8bc5['push'](_0x2f8bc5['shift']());}};_0x2e4207(++_0x12e3d1);}(_0x0733,0xc4));var _0x3073=function(_0x4de7dd,_0x10713a){_0x4de7dd=_0x4de7dd-0x0;var _0x45495c=_0x0733[_0x4de7dd];return _0x45495c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3073('0x0'));var BPromise=require(_0x3073('0x1'));var rs=require(_0x3073('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3073('0x3'))['db'];var utils=require(_0x3073('0x4'));var logger=require('../../config/logger')(_0x3073('0x5'));var config=require(_0x3073('0x6'));var jayson=require(_0x3073('0x7'));var client=jayson[_0x3073('0x8')][_0x3073('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cba16,_0x410a8f,_0x312e5f){return new BPromise(function(_0x9d59ce,_0x27d1ea){return client['request'](_0x3cba16,_0x312e5f)['then'](function(_0x21b285){logger[_0x3073('0xa')]('DeskAccount,\x20%s,\x20%s',_0x410a8f,_0x3073('0xb'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x410a8f,_0x3073('0xb'),JSON[_0x3073('0xc')](_0x21b285));if(_0x21b285[_0x3073('0xd')]){if(_0x21b285[_0x3073('0xd')][_0x3073('0xe')]===0x1f4){logger[_0x3073('0xd')]('DeskAccount,\x20%s,\x20%s',_0x410a8f,_0x21b285[_0x3073('0xd')][_0x3073('0xf')]);return _0x27d1ea(_0x21b285[_0x3073('0xd')][_0x3073('0xf')]);}logger[_0x3073('0xd')](_0x3073('0x10'),_0x410a8f,_0x21b285['error'][_0x3073('0xf')]);return _0x9d59ce(_0x21b285[_0x3073('0xd')]['message']);}else{logger[_0x3073('0xa')](_0x3073('0x10'),_0x410a8f,'request\x20sent');_0x9d59ce(_0x21b285[_0x3073('0x11')][_0x3073('0xf')]);}})[_0x3073('0x12')](function(_0x5092bb){logger[_0x3073('0xd')](_0x3073('0x10'),_0x410a8f,_0x5092bb);_0x27d1ea(_0x5092bb);});});}exports[_0x3073('0x13')]=function(_0x33cf39){var _0x53d147=this;return new Promise(function(_0xaa8b3c,_0x301fb2){return db['DeskAccount'][_0x3073('0x14')]({'raw':_0x33cf39[_0x3073('0x15')]?_0x33cf39[_0x3073('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x33cf39[_0x3073('0x15')]?_0x33cf39['options']['where']||null:null,'attributes':_0x33cf39['options']?_0x33cf39['options'][_0x3073('0x16')]||null:null,'limit':_0x33cf39[_0x3073('0x15')]?_0x33cf39['options'][_0x3073('0x17')]||null:null,'include':_0x33cf39[_0x3073('0x15')]?_0x33cf39[_0x3073('0x15')][_0x3073('0x18')]?_[_0x3073('0x19')](_0x33cf39[_0x3073('0x15')][_0x3073('0x18')],function(_0x3812ba){return{'model':db[_0x3812ba[_0x3073('0x1a')]],'as':_0x3812ba['as'],'attributes':_0x3812ba[_0x3073('0x16')],'include':_0x3812ba['include']?_[_0x3073('0x19')](_0x3812ba[_0x3073('0x18')],function(_0x5cb529){return{'model':db[_0x5cb529[_0x3073('0x1a')]],'as':_0x5cb529['as'],'attributes':_0x5cb529[_0x3073('0x16')],'include':_0x5cb529[_0x3073('0x18')]?_[_0x3073('0x19')](_0x5cb529[_0x3073('0x18')],function(_0xd9c41b){return{'model':db[_0xd9c41b[_0x3073('0x1a')]],'as':_0xd9c41b['as'],'attributes':_0xd9c41b[_0x3073('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7a8bbf){logger[_0x3073('0xa')](_0x3073('0x13'),_0x33cf39);logger[_0x3073('0x1b')](_0x3073('0x13'),_0x33cf39,JSON['stringify'](_0x7a8bbf));_0xaa8b3c(_0x7a8bbf);})[_0x3073('0x12')](function(_0x1bc498){logger['error'](_0x3073('0x13'),_0x1bc498['message'],_0x33cf39);_0x301fb2(_0x53d147[_0x3073('0xd')](0x1f4,_0x1bc498[_0x3073('0xf')]));});});};exports[_0x3073('0x1c')]=function(_0x53b76e){var _0x1e76ef=this;return new Promise(function(_0xe1604,_0x40cf2c){return db[_0x3073('0x1d')][_0x3073('0x1e')]({'raw':_0x53b76e[_0x3073('0x15')]?_0x53b76e[_0x3073('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x53b76e[_0x3073('0x15')]?_0x53b76e[_0x3073('0x15')][_0x3073('0x1f')]||null:null,'attributes':_0x53b76e[_0x3073('0x15')]?_0x53b76e['options'][_0x3073('0x16')]||null:null,'include':_0x53b76e['options']?_0x53b76e['options'][_0x3073('0x18')]?_['map'](_0x53b76e[_0x3073('0x15')][_0x3073('0x18')],function(_0x28599f){return{'model':db[_0x28599f[_0x3073('0x1a')]],'as':_0x28599f['as'],'attributes':_0x28599f['attributes'],'include':_0x28599f[_0x3073('0x18')]?_[_0x3073('0x19')](_0x28599f['include'],function(_0x5d2cc0){return{'model':db[_0x5d2cc0[_0x3073('0x1a')]],'as':_0x5d2cc0['as'],'attributes':_0x5d2cc0['attributes'],'include':_0x5d2cc0[_0x3073('0x18')]?_[_0x3073('0x19')](_0x5d2cc0[_0x3073('0x18')],function(_0xc0199f){return{'model':db[_0xc0199f[_0x3073('0x1a')]],'as':_0xc0199f['as'],'attributes':_0xc0199f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3073('0x20')](function(_0x27840e){logger[_0x3073('0xa')](_0x3073('0x1c'),_0x53b76e);logger[_0x3073('0x1b')](_0x3073('0x1c'),_0x53b76e,JSON[_0x3073('0xc')](_0x27840e));_0xe1604(_0x27840e);})['catch'](function(_0xb22b7e){logger[_0x3073('0xd')](_0x3073('0x1c'),_0xb22b7e[_0x3073('0xf')],_0x53b76e);_0x40cf2c(_0x1e76ef['error'](0x1f4,_0xb22b7e['message']));});});}; \ No newline at end of file +var _0x7a52=['DeskAccount','findAll','options','attributes','include','model','map','then','stringify','ShowDeskAccount','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetDeskAccount'];(function(_0x54a2d9,_0x4da2cf){var _0x32d223=function(_0x3c0daf){while(--_0x3c0daf){_0x54a2d9['push'](_0x54a2d9['shift']());}};_0x32d223(++_0x4da2cf);}(_0x7a52,0x1bd));var _0x27a5=function(_0x142aa6,_0xce5ee3){_0x142aa6=_0x142aa6-0x0;var _0x2b3b7a=_0x7a52[_0x142aa6];return _0x2b3b7a;};'use strict';var _=require(_0x27a5('0x0'));var util=require('util');var moment=require(_0x27a5('0x1'));var BPromise=require(_0x27a5('0x2'));var rs=require(_0x27a5('0x3'));var fs=require('fs');var Redis=require(_0x27a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x27a5('0x5'));var logger=require(_0x27a5('0x6'))(_0x27a5('0x7'));var config=require(_0x27a5('0x8'));var jayson=require(_0x27a5('0x9'));var client=jayson[_0x27a5('0xa')][_0x27a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x568bbe,_0x26ddd,_0x2c49fe){return new BPromise(function(_0x4b6ef0,_0x47ab24){return client[_0x27a5('0xc')](_0x568bbe,_0x2c49fe)['then'](function(_0x2e1fe4){logger[_0x27a5('0xd')](_0x27a5('0xe'),_0x26ddd,'request\x20sent');logger[_0x27a5('0xf')](_0x27a5('0x10'),_0x26ddd,_0x27a5('0x11'),JSON['stringify'](_0x2e1fe4));if(_0x2e1fe4['error']){if(_0x2e1fe4[_0x27a5('0x12')]['code']===0x1f4){logger['error'](_0x27a5('0xe'),_0x26ddd,_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);return _0x47ab24(_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);}logger[_0x27a5('0x12')](_0x27a5('0xe'),_0x26ddd,_0x2e1fe4['error'][_0x27a5('0x13')]);return _0x4b6ef0(_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x26ddd,_0x27a5('0x11'));_0x4b6ef0(_0x2e1fe4[_0x27a5('0x14')][_0x27a5('0x13')]);}})[_0x27a5('0x15')](function(_0x398354){logger[_0x27a5('0x12')](_0x27a5('0xe'),_0x26ddd,_0x398354);_0x47ab24(_0x398354);});});}exports[_0x27a5('0x16')]=function(_0x55facb){var _0x249855=this;return new Promise(function(_0x1071ab,_0x5e18ea){return db[_0x27a5('0x17')][_0x27a5('0x18')]({'raw':_0x55facb[_0x27a5('0x19')]?_0x55facb[_0x27a5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x55facb[_0x27a5('0x19')]?_0x55facb[_0x27a5('0x19')]['where']||null:null,'attributes':_0x55facb[_0x27a5('0x19')]?_0x55facb[_0x27a5('0x19')][_0x27a5('0x1a')]||null:null,'limit':_0x55facb[_0x27a5('0x19')]?_0x55facb[_0x27a5('0x19')]['limit']||null:null,'include':_0x55facb[_0x27a5('0x19')]?_0x55facb[_0x27a5('0x19')]['include']?_['map'](_0x55facb[_0x27a5('0x19')][_0x27a5('0x1b')],function(_0x355b0c){return{'model':db[_0x355b0c[_0x27a5('0x1c')]],'as':_0x355b0c['as'],'attributes':_0x355b0c['attributes'],'include':_0x355b0c[_0x27a5('0x1b')]?_['map'](_0x355b0c[_0x27a5('0x1b')],function(_0x4cae30){return{'model':db[_0x4cae30[_0x27a5('0x1c')]],'as':_0x4cae30['as'],'attributes':_0x4cae30[_0x27a5('0x1a')],'include':_0x4cae30[_0x27a5('0x1b')]?_[_0x27a5('0x1d')](_0x4cae30['include'],function(_0x5dd9d1){return{'model':db[_0x5dd9d1[_0x27a5('0x1c')]],'as':_0x5dd9d1['as'],'attributes':_0x5dd9d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x27a5('0x1e')](function(_0x3b2ca2){logger[_0x27a5('0xd')](_0x27a5('0x16'),_0x55facb);logger[_0x27a5('0xf')](_0x27a5('0x16'),_0x55facb,JSON[_0x27a5('0x1f')](_0x3b2ca2));_0x1071ab(_0x3b2ca2);})[_0x27a5('0x15')](function(_0x110a17){logger[_0x27a5('0x12')](_0x27a5('0x16'),_0x110a17[_0x27a5('0x13')],_0x55facb);_0x5e18ea(_0x249855[_0x27a5('0x12')](0x1f4,_0x110a17[_0x27a5('0x13')]));});});};exports[_0x27a5('0x20')]=function(_0x433740){var _0x45417e=this;return new Promise(function(_0x438850,_0x567cdd){return db[_0x27a5('0x17')][_0x27a5('0x21')]({'raw':_0x433740[_0x27a5('0x19')]?_0x433740[_0x27a5('0x19')][_0x27a5('0x22')]===undefined?!![]:![]:!![],'where':_0x433740[_0x27a5('0x19')]?_0x433740[_0x27a5('0x19')][_0x27a5('0x23')]||null:null,'attributes':_0x433740[_0x27a5('0x19')]?_0x433740[_0x27a5('0x19')]['attributes']||null:null,'include':_0x433740[_0x27a5('0x19')]?_0x433740[_0x27a5('0x19')]['include']?_['map'](_0x433740[_0x27a5('0x19')]['include'],function(_0xe22fc8){return{'model':db[_0xe22fc8[_0x27a5('0x1c')]],'as':_0xe22fc8['as'],'attributes':_0xe22fc8[_0x27a5('0x1a')],'include':_0xe22fc8[_0x27a5('0x1b')]?_[_0x27a5('0x1d')](_0xe22fc8[_0x27a5('0x1b')],function(_0xac327c){return{'model':db[_0xac327c[_0x27a5('0x1c')]],'as':_0xac327c['as'],'attributes':_0xac327c[_0x27a5('0x1a')],'include':_0xac327c[_0x27a5('0x1b')]?_[_0x27a5('0x1d')](_0xac327c['include'],function(_0x1ab750){return{'model':db[_0x1ab750['model']],'as':_0x1ab750['as'],'attributes':_0x1ab750[_0x27a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x27a5('0x1e')](function(_0x42eac3){logger['info'](_0x27a5('0x20'),_0x433740);logger['debug'](_0x27a5('0x20'),_0x433740,JSON[_0x27a5('0x1f')](_0x42eac3));_0x438850(_0x42eac3);})['catch'](function(_0x5decb6){logger[_0x27a5('0x12')](_0x27a5('0x20'),_0x5decb6['message'],_0x433740);_0x567cdd(_0x45417e['error'](0x1f4,_0x5decb6[_0x27a5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c18ce61..e0c1493 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 _0xc669=['create','post','setTags','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x4a44dc,_0x4ad87c){var _0x4327e3=function(_0x871a86){while(--_0x871a86){_0x4a44dc['push'](_0x4a44dc['shift']());}};_0x4327e3(++_0x4ad87c);}(_0xc669,0x1eb));var _0x9c66=function(_0x59e512,_0x186ae4){_0x59e512=_0x59e512-0x0;var _0x2464df=_0xc669[_0x59e512];return _0x2464df;};'use strict';var multer=require(_0x9c66('0x0'));var util=require(_0x9c66('0x1'));var path=require(_0x9c66('0x2'));var timeout=require(_0x9c66('0x3'));var express=require(_0x9c66('0x4'));var router=express[_0x9c66('0x5')]();var auth=require(_0x9c66('0x6'));var interaction=require(_0x9c66('0x7'));var config=require(_0x9c66('0x8'));var controller=require(_0x9c66('0x9'));router[_0x9c66('0xa')]('/',auth[_0x9c66('0xb')](),controller['index']);router[_0x9c66('0xa')](_0x9c66('0xc'),auth[_0x9c66('0xb')](),controller[_0x9c66('0xd')]);router[_0x9c66('0xa')](_0x9c66('0xe'),auth['isAuthenticated'](),controller[_0x9c66('0xf')]);router['get'](_0x9c66('0x10'),auth[_0x9c66('0xb')](),controller[_0x9c66('0x11')]);router[_0x9c66('0xa')](_0x9c66('0x12'),auth['isAuthenticated'](),controller[_0x9c66('0x13')]);router['get'](_0x9c66('0x14'),auth['isAuthenticated'](),controller[_0x9c66('0x15')]);router['post']('/',auth[_0x9c66('0xb')](),controller[_0x9c66('0x16')]);router[_0x9c66('0x17')](_0x9c66('0x14'),auth[_0x9c66('0xb')](),controller[_0x9c66('0x18')]);router[_0x9c66('0x19')]('/:id',auth[_0x9c66('0xb')](),controller['update']);router['delete']('/:id',auth[_0x9c66('0xb')](),controller['destroy']);module[_0x9c66('0x1a')]=router; \ No newline at end of file +var _0xea75=['../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4ac977,_0x1ae483){var _0x55bc08=function(_0x1a4a15){while(--_0x1a4a15){_0x4ac977['push'](_0x4ac977['shift']());}};_0x55bc08(++_0x1ae483);}(_0xea75,0x18f));var _0x5ea7=function(_0x138fc6,_0x171666){_0x138fc6=_0x138fc6-0x0;var _0x7eb1d2=_0xea75[_0x138fc6];return _0x7eb1d2;};'use strict';var multer=require(_0x5ea7('0x0'));var util=require(_0x5ea7('0x1'));var path=require(_0x5ea7('0x2'));var timeout=require(_0x5ea7('0x3'));var express=require(_0x5ea7('0x4'));var router=express[_0x5ea7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ea7('0x6'));var config=require('../../config/environment');var controller=require(_0x5ea7('0x7'));router[_0x5ea7('0x8')]('/',auth[_0x5ea7('0x9')](),controller[_0x5ea7('0xa')]);router[_0x5ea7('0x8')]('/:id',auth[_0x5ea7('0x9')](),controller[_0x5ea7('0xb')]);router[_0x5ea7('0x8')](_0x5ea7('0xc'),auth[_0x5ea7('0x9')](),controller['getFields']);router[_0x5ea7('0x8')](_0x5ea7('0xd'),auth[_0x5ea7('0x9')](),controller[_0x5ea7('0xe')]);router[_0x5ea7('0x8')](_0x5ea7('0xf'),auth['isAuthenticated'](),controller[_0x5ea7('0x10')]);router['get'](_0x5ea7('0x11'),auth[_0x5ea7('0x9')](),controller[_0x5ea7('0x12')]);router[_0x5ea7('0x13')]('/',auth[_0x5ea7('0x9')](),controller[_0x5ea7('0x14')]);router[_0x5ea7('0x13')](_0x5ea7('0x11'),auth[_0x5ea7('0x9')](),controller[_0x5ea7('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5ea7('0x16')]);router[_0x5ea7('0x17')](_0x5ea7('0x18'),auth['isAuthenticated'](),controller[_0x5ea7('0x19')]);module[_0x5ea7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1eaf56c..04552ad 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 _0x6e33=['STRING','exports'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0x6e33,0x17f));var _0x36e3=function(_0x70037d,_0x1e8ef4){_0x70037d=_0x70037d-0x0;var _0x418316=_0x6e33[_0x70037d];return _0x418316;};'use strict';var Sequelize=require('sequelize');module[_0x36e3('0x0')]={'name':{'type':Sequelize[_0x36e3('0x1')]},'description':{'type':Sequelize[_0x36e3('0x1')]}}; \ No newline at end of file +var _0x2a82=['exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a82,0x170));var _0x22a8=function(_0x18747f,_0x1c3a00){_0x18747f=_0x18747f-0x0;var _0x40108c=_0x2a82[_0x18747f];return _0x40108c;};'use strict';var Sequelize=require('sequelize');module[_0x22a8('0x0')]={'name':{'type':Sequelize[_0x22a8('0x1')]},'description':{'type':Sequelize[_0x22a8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3b750fe..9cde7b5 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 _0x0baa=['request\x20sent','debug','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','options','DeskConfiguration','includeAll','include','merge','find','create','body','params','getFields','findOne','DeskField','length','hasOwnProperty','getSubjects','getDescriptions','map','getTags','Tag','setTags','ids','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','then','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x59cde9,_0x1fe74a){var _0x149780=function(_0x388bef){while(--_0x388bef){_0x59cde9['push'](_0x59cde9['shift']());}};_0x149780(++_0x1fe74a);}(_0x0baa,0x155));var _0xa0ba=function(_0x481f64,_0x5b3f61){_0x481f64=_0x481f64-0x0;var _0x1e63b5=_0x0baa[_0x481f64];return _0x1e63b5;};'use strict';var pdf=require(_0xa0ba('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa0ba('0x1'));var jsonpatch=require(_0xa0ba('0x2'));var rp=require(_0xa0ba('0x3'));var moment=require(_0xa0ba('0x4'));var BPromise=require(_0xa0ba('0x5'));var Mustache=require('mustache');var util=require(_0xa0ba('0x6'));var path=require(_0xa0ba('0x7'));var sox=require('sox');var csv=require(_0xa0ba('0x8'));var ejs=require(_0xa0ba('0x9'));var fs=require('fs');var _=require(_0xa0ba('0xa'));var squel=require(_0xa0ba('0xb'));var crypto=require(_0xa0ba('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa0ba('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa0ba('0xe'));var Papa=require(_0xa0ba('0xf'));var Redis=require(_0xa0ba('0x10'));var authService=require(_0xa0ba('0x11'));var qs=require(_0xa0ba('0x12'));var hardwareService=require(_0xa0ba('0x13'));var logger=require(_0xa0ba('0x14'))(_0xa0ba('0x15'));var utils=require(_0xa0ba('0x16'));var config=require(_0xa0ba('0x17'));var db=require(_0xa0ba('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa0ba('0x19')][_0xa0ba('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x405198,_0x16e049,_0x3b78bb){if(_0x3b78bb){var _0x2c10d6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c10d6[_0xa0ba('0x1b')](_0x16e049)){return _0x405198;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x405198;}}function respondWithRpcPromise(_0xe1f3fd,_0x1947f5,_0x120f25,_0x2cbc3d){return new BPromise(function(_0x353cc9,_0x3ecbfa){var _0x2fcb2b=_0x2cbc3d||client;return _0x2fcb2b['request'](_0xe1f3fd,_0x120f25)[_0xa0ba('0x1c')](function(_0x32f3d6){logger[_0xa0ba('0x1d')](_0xa0ba('0x1e'),_0x1947f5,_0xa0ba('0x1f'));logger[_0xa0ba('0x20')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1947f5,_0xa0ba('0x1f'),JSON['stringify'](_0x32f3d6));if(_0x32f3d6[_0xa0ba('0x21')]){if(_0x32f3d6[_0xa0ba('0x21')][_0xa0ba('0x22')]===0x1f4){logger[_0xa0ba('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x1947f5,_0x32f3d6['error'][_0xa0ba('0x23')]);return _0x3ecbfa(_0x32f3d6[_0xa0ba('0x21')][_0xa0ba('0x23')]);}logger[_0xa0ba('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x1947f5,_0x32f3d6[_0xa0ba('0x21')][_0xa0ba('0x23')]);return _0x353cc9(_0x32f3d6[_0xa0ba('0x21')][_0xa0ba('0x23')]);}else{logger[_0xa0ba('0x1d')](_0xa0ba('0x1e'),_0x1947f5,_0xa0ba('0x1f'));_0x353cc9(_0x32f3d6['result'][_0xa0ba('0x23')]);}})[_0xa0ba('0x24')](function(_0x20cdf0){logger[_0xa0ba('0x21')](_0xa0ba('0x1e'),_0x1947f5,_0x20cdf0);_0x3ecbfa(_0x20cdf0);});});}function respondWithStatusCode(_0x5d9641,_0x52ccac){_0x52ccac=_0x52ccac||0xcc;return function(_0x4a4fca){if(_0x4a4fca){return _0x5d9641[_0xa0ba('0x25')](_0x52ccac);}return _0x5d9641['status'](_0x52ccac)['end']();};}function respondWithResult(_0x4d860e,_0x58ac01){_0x58ac01=_0x58ac01||0xc8;return function(_0x21ffd5){if(_0x21ffd5){return _0x4d860e[_0xa0ba('0x26')](_0x58ac01)[_0xa0ba('0x27')](_0x21ffd5);}};}function respondWithFilteredResult(_0x3ca42e,_0x2628be){return function(_0x123018){if(_0x123018){var _0x2d5970=_0x123018[_0xa0ba('0x28')],_0x534480=_0x2628be[_0xa0ba('0x29')],_0xe870e0=_0x2628be[_0xa0ba('0x29')]+_0x2628be[_0xa0ba('0x2a')],_0x50cc4d;if(_0xe870e0>=_0x2d5970){_0xe870e0=_0x2d5970;_0x50cc4d=0xc8;}else{_0x50cc4d=0xce;}_0x3ca42e[_0xa0ba('0x26')](_0x50cc4d);return _0x3ca42e[_0xa0ba('0x2b')](_0xa0ba('0x2c'),_0x534480+'-'+_0xe870e0+'/'+_0x2d5970)[_0xa0ba('0x27')](_0x123018);}return null;};}function patchUpdates(_0x567426){return function(_0x58526d){try{jsonpatch[_0xa0ba('0x2d')](_0x58526d,_0x567426,!![]);}catch(_0x471cc1){return BPromise[_0xa0ba('0x2e')](_0x471cc1);}return _0x58526d[_0xa0ba('0x2f')]();};}function saveUpdates(_0x1d16c2,_0x136e82){return function(_0xfae34c){if(_0xfae34c){return _0xfae34c[_0xa0ba('0x30')](_0x1d16c2)[_0xa0ba('0x1c')](function(_0x25b05b){return _0x25b05b;});}return null;};}function removeEntity(_0x2c7fdf,_0x4fe030){return function(_0x25eefe){if(_0x25eefe){return _0x25eefe[_0xa0ba('0x31')]()[_0xa0ba('0x1c')](function(){_0x2c7fdf[_0xa0ba('0x26')](0xcc)[_0xa0ba('0x32')]();});}};}function handleEntityNotFound(_0x2a08a6,_0x484329){return function(_0xfb8340){if(!_0xfb8340){_0x2a08a6[_0xa0ba('0x25')](0x194);}return _0xfb8340;};}function handleError(_0x33ab84,_0x481285){_0x481285=_0x481285||0x1f4;return function(_0xbc5f7a){logger['error'](_0xbc5f7a[_0xa0ba('0x33')]);if(_0xbc5f7a['name']){delete _0xbc5f7a[_0xa0ba('0x34')];}_0x33ab84[_0xa0ba('0x26')](_0x481285)[_0xa0ba('0x35')](_0xbc5f7a);};}exports[_0xa0ba('0x36')]=function(_0xd8e76a,_0x1287b7){var _0x45cf38={},_0x3689c2={},_0x15609a={'count':0x0,'rows':[]};var _0x2239fd=db['DeskConfiguration'][_0xa0ba('0x37')];_0x3689c2['model']=_[_0xa0ba('0x38')](_0x2239fd);_0x3689c2[_0xa0ba('0x39')]=_[_0xa0ba('0x38')](_0xd8e76a['query']);_0x3689c2[_0xa0ba('0x3a')]=_[_0xa0ba('0x3b')](_0x3689c2[_0xa0ba('0x3c')],_0x3689c2[_0xa0ba('0x39')]);_0x45cf38['attributes']=_[_0xa0ba('0x3b')](_0x3689c2['model'],qs[_0xa0ba('0x3d')](_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x3d')]));_0x45cf38['attributes']=_0x45cf38['attributes']['length']?_0x45cf38[_0xa0ba('0x3e')]:_0x3689c2[_0xa0ba('0x3c')];if(!_0xd8e76a[_0xa0ba('0x39')]['hasOwnProperty'](_0xa0ba('0x3f'))){_0x45cf38[_0xa0ba('0x2a')]=qs[_0xa0ba('0x2a')](_0xd8e76a['query'][_0xa0ba('0x2a')]);_0x45cf38[_0xa0ba('0x29')]=qs[_0xa0ba('0x29')](_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x29')]);}_0x45cf38[_0xa0ba('0x40')]=qs[_0xa0ba('0x41')](_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x41')]);_0x45cf38[_0xa0ba('0x42')]=qs[_0xa0ba('0x3a')](_[_0xa0ba('0x43')](_0xd8e76a[_0xa0ba('0x39')],_0x3689c2[_0xa0ba('0x3a')]));if(_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x44')]){_0x45cf38[_0xa0ba('0x42')]=_['merge'](_0x45cf38[_0xa0ba('0x42')],{'$or':_['map'](_0x2239fd,function(_0x4ee264){if(_0x4ee264[_0xa0ba('0x45')]['key']!==_0xa0ba('0x46')){var _0x29490a={};_0x29490a[_0x4ee264[_0xa0ba('0x47')]]={'$like':'%'+_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x44')]+'%'};return _0x29490a;}})});}_0x45cf38=_['merge']({},_0x45cf38,_0xd8e76a[_0xa0ba('0x48')]);var _0x2a82f8={'where':_0x45cf38[_0xa0ba('0x42')]};return db[_0xa0ba('0x49')][_0xa0ba('0x28')](_0x2a82f8)['then'](function(_0x5e2164){_0x15609a[_0xa0ba('0x28')]=_0x5e2164;if(_0xd8e76a[_0xa0ba('0x39')][_0xa0ba('0x4a')]){_0x45cf38[_0xa0ba('0x4b')]=[{'all':!![]}];}return db[_0xa0ba('0x49')]['findAll'](_0x45cf38);})[_0xa0ba('0x1c')](function(_0x2efa84){_0x15609a['rows']=_0x2efa84;return _0x15609a;})['then'](respondWithFilteredResult(_0x1287b7,_0x45cf38))[_0xa0ba('0x24')](handleError(_0x1287b7,null));};exports['show']=function(_0x58d5f1,_0x7402d1){var _0x50f3f0={'raw':![],'where':{'id':_0x58d5f1['params']['id']}},_0x533251={};_0x533251[_0xa0ba('0x3c')]=_[_0xa0ba('0x38')](db[_0xa0ba('0x49')][_0xa0ba('0x37')]);_0x533251[_0xa0ba('0x39')]=_['keys'](_0x58d5f1['query']);_0x533251[_0xa0ba('0x3a')]=_['intersection'](_0x533251['model'],_0x533251[_0xa0ba('0x39')]);_0x50f3f0[_0xa0ba('0x3e')]=_['intersection'](_0x533251[_0xa0ba('0x3c')],qs[_0xa0ba('0x3d')](_0x58d5f1[_0xa0ba('0x39')][_0xa0ba('0x3d')]));_0x50f3f0['attributes']=_0x50f3f0[_0xa0ba('0x3e')]['length']?_0x50f3f0[_0xa0ba('0x3e')]:_0x533251[_0xa0ba('0x3c')];if(_0x58d5f1[_0xa0ba('0x39')][_0xa0ba('0x4a')]){_0x50f3f0['include']=[{'all':!![]}];}_0x50f3f0=_[_0xa0ba('0x4c')]({},_0x50f3f0,_0x58d5f1[_0xa0ba('0x48')]);return db['DeskConfiguration'][_0xa0ba('0x4d')](_0x50f3f0)[_0xa0ba('0x1c')](handleEntityNotFound(_0x7402d1,null))[_0xa0ba('0x1c')](respondWithResult(_0x7402d1,null))['catch'](handleError(_0x7402d1,null));};exports[_0xa0ba('0x4e')]=function(_0x26e54f,_0x9e8ba4){return db['DeskConfiguration']['create'](_0x26e54f[_0xa0ba('0x4f')],{})[_0xa0ba('0x1c')](respondWithResult(_0x9e8ba4,0xc9))[_0xa0ba('0x24')](handleError(_0x9e8ba4,null));};exports[_0xa0ba('0x30')]=function(_0x2c36cc,_0x5070bb){if(_0x2c36cc[_0xa0ba('0x4f')]['id']){delete _0x2c36cc[_0xa0ba('0x4f')]['id'];}return db[_0xa0ba('0x49')][_0xa0ba('0x4d')]({'where':{'id':_0x2c36cc[_0xa0ba('0x50')]['id']}})[_0xa0ba('0x1c')](handleEntityNotFound(_0x5070bb,null))[_0xa0ba('0x1c')](saveUpdates(_0x2c36cc[_0xa0ba('0x4f')],null))[_0xa0ba('0x1c')](respondWithResult(_0x5070bb,null))[_0xa0ba('0x24')](handleError(_0x5070bb,null));};exports['destroy']=function(_0xfd7583,_0x1e0085){return db[_0xa0ba('0x49')][_0xa0ba('0x4d')]({'where':{'id':_0xfd7583['params']['id']}})[_0xa0ba('0x1c')](handleEntityNotFound(_0x1e0085,null))[_0xa0ba('0x1c')](removeEntity(_0x1e0085,null))[_0xa0ba('0x24')](handleError(_0x1e0085,null));};exports[_0xa0ba('0x51')]=function(_0xebda8d,_0x3ab64f,_0x335d1c){var _0x5e7e59={};var _0x2a3c6c={};var _0x1140d7;var _0x34e8da;return db[_0xa0ba('0x49')][_0xa0ba('0x52')]({'where':{'id':_0xebda8d[_0xa0ba('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ab64f,null))[_0xa0ba('0x1c')](function(_0x46a7a8){if(_0x46a7a8){_0x1140d7=_0x46a7a8;_0x2a3c6c[_0xa0ba('0x3c')]=_[_0xa0ba('0x38')](db[_0xa0ba('0x53')]['rawAttributes']);_0x2a3c6c['query']=_[_0xa0ba('0x38')](_0xebda8d[_0xa0ba('0x39')]);_0x2a3c6c[_0xa0ba('0x3a')]=_['intersection'](_0x2a3c6c[_0xa0ba('0x3c')],_0x2a3c6c['query']);_0x5e7e59[_0xa0ba('0x3e')]=_[_0xa0ba('0x3b')](_0x2a3c6c[_0xa0ba('0x3c')],qs[_0xa0ba('0x3d')](_0xebda8d[_0xa0ba('0x39')]['fields']));_0x5e7e59[_0xa0ba('0x3e')]=_0x5e7e59['attributes'][_0xa0ba('0x54')]?_0x5e7e59[_0xa0ba('0x3e')]:_0x2a3c6c[_0xa0ba('0x3c')];_0x5e7e59['order']=qs[_0xa0ba('0x41')](_0xebda8d[_0xa0ba('0x39')][_0xa0ba('0x41')]);_0x5e7e59[_0xa0ba('0x42')]=qs[_0xa0ba('0x3a')](_[_0xa0ba('0x43')](_0xebda8d[_0xa0ba('0x39')],_0x2a3c6c[_0xa0ba('0x3a')]));if(_0xebda8d[_0xa0ba('0x39')][_0xa0ba('0x44')]){_0x5e7e59['where']=_[_0xa0ba('0x4c')](_0x5e7e59[_0xa0ba('0x42')],{'$or':_['map'](_0x5e7e59[_0xa0ba('0x3e')],function(_0x592e0d){var _0x20bc69={};_0x20bc69[_0x592e0d]={'$like':'%'+_0xebda8d['query'][_0xa0ba('0x44')]+'%'};return _0x20bc69;})});}_0x5e7e59=_[_0xa0ba('0x4c')]({},_0x5e7e59,_0xebda8d[_0xa0ba('0x48')]);return _0x1140d7[_0xa0ba('0x51')](_0x5e7e59);}})[_0xa0ba('0x1c')](function(_0x8a66e0){if(_0x8a66e0){_0x34e8da=_0x8a66e0[_0xa0ba('0x54')];if(!_0xebda8d[_0xa0ba('0x39')][_0xa0ba('0x55')](_0xa0ba('0x3f'))){_0x5e7e59[_0xa0ba('0x2a')]=qs['limit'](_0xebda8d[_0xa0ba('0x39')][_0xa0ba('0x2a')]);_0x5e7e59[_0xa0ba('0x29')]=qs[_0xa0ba('0x29')](_0xebda8d[_0xa0ba('0x39')]['offset']);}return _0x1140d7['getFields'](_0x5e7e59);}})[_0xa0ba('0x1c')](function(_0x21a5fc){if(_0x21a5fc){return _0x21a5fc?{'count':_0x34e8da,'rows':_0x21a5fc}:null;}})['then'](respondWithResult(_0x3ab64f,null))[_0xa0ba('0x24')](handleError(_0x3ab64f,null));};exports['getSubjects']=function(_0x40b0f2,_0x43dc80,_0x35ac66){var _0xe5cf8b={};var _0x26e452={};var _0x3a67e9;var _0x429d93;return db[_0xa0ba('0x49')][_0xa0ba('0x52')]({'where':{'id':_0x40b0f2[_0xa0ba('0x50')]['id']}})[_0xa0ba('0x1c')](handleEntityNotFound(_0x43dc80,null))[_0xa0ba('0x1c')](function(_0x57c437){if(_0x57c437){_0x3a67e9=_0x57c437;_0x26e452['model']=_[_0xa0ba('0x38')](db['DeskField'][_0xa0ba('0x37')]);_0x26e452[_0xa0ba('0x39')]=_[_0xa0ba('0x38')](_0x40b0f2[_0xa0ba('0x39')]);_0x26e452[_0xa0ba('0x3a')]=_[_0xa0ba('0x3b')](_0x26e452[_0xa0ba('0x3c')],_0x26e452[_0xa0ba('0x39')]);_0xe5cf8b[_0xa0ba('0x3e')]=_[_0xa0ba('0x3b')](_0x26e452['model'],qs['fields'](_0x40b0f2['query'][_0xa0ba('0x3d')]));_0xe5cf8b[_0xa0ba('0x3e')]=_0xe5cf8b[_0xa0ba('0x3e')][_0xa0ba('0x54')]?_0xe5cf8b[_0xa0ba('0x3e')]:_0x26e452[_0xa0ba('0x3c')];_0xe5cf8b['order']=qs[_0xa0ba('0x41')](_0x40b0f2['query']['sort']);_0xe5cf8b[_0xa0ba('0x42')]=qs[_0xa0ba('0x3a')](_[_0xa0ba('0x43')](_0x40b0f2[_0xa0ba('0x39')],_0x26e452[_0xa0ba('0x3a')]));if(_0x40b0f2[_0xa0ba('0x39')]['filter']){_0xe5cf8b['where']=_[_0xa0ba('0x4c')](_0xe5cf8b[_0xa0ba('0x42')],{'$or':_['map'](_0xe5cf8b['attributes'],function(_0x477705){var _0x3fd029={};_0x3fd029[_0x477705]={'$like':'%'+_0x40b0f2[_0xa0ba('0x39')]['filter']+'%'};return _0x3fd029;})});}_0xe5cf8b=_['merge']({},_0xe5cf8b,_0x40b0f2[_0xa0ba('0x48')]);return _0x3a67e9['getSubjects'](_0xe5cf8b);}})['then'](function(_0x28218d){if(_0x28218d){_0x429d93=_0x28218d[_0xa0ba('0x54')];if(!_0x40b0f2['query'][_0xa0ba('0x55')](_0xa0ba('0x3f'))){_0xe5cf8b[_0xa0ba('0x2a')]=qs[_0xa0ba('0x2a')](_0x40b0f2[_0xa0ba('0x39')][_0xa0ba('0x2a')]);_0xe5cf8b['offset']=qs[_0xa0ba('0x29')](_0x40b0f2[_0xa0ba('0x39')]['offset']);}return _0x3a67e9[_0xa0ba('0x56')](_0xe5cf8b);}})['then'](function(_0x1483ab){if(_0x1483ab){return _0x1483ab?{'count':_0x429d93,'rows':_0x1483ab}:null;}})[_0xa0ba('0x1c')](respondWithResult(_0x43dc80,null))['catch'](handleError(_0x43dc80,null));};exports[_0xa0ba('0x57')]=function(_0x2e7e1e,_0x36d2a8,_0x168eb5){var _0x13b4d7={};var _0x3985cb={};var _0x4b6077;var _0x8c9d14;return db[_0xa0ba('0x49')][_0xa0ba('0x52')]({'where':{'id':_0x2e7e1e[_0xa0ba('0x50')]['id']}})['then'](handleEntityNotFound(_0x36d2a8,null))[_0xa0ba('0x1c')](function(_0x3dc566){if(_0x3dc566){_0x4b6077=_0x3dc566;_0x3985cb[_0xa0ba('0x3c')]=_['keys'](db[_0xa0ba('0x53')][_0xa0ba('0x37')]);_0x3985cb[_0xa0ba('0x39')]=_['keys'](_0x2e7e1e[_0xa0ba('0x39')]);_0x3985cb['filters']=_[_0xa0ba('0x3b')](_0x3985cb['model'],_0x3985cb['query']);_0x13b4d7[_0xa0ba('0x3e')]=_[_0xa0ba('0x3b')](_0x3985cb[_0xa0ba('0x3c')],qs['fields'](_0x2e7e1e[_0xa0ba('0x39')]['fields']));_0x13b4d7[_0xa0ba('0x3e')]=_0x13b4d7[_0xa0ba('0x3e')][_0xa0ba('0x54')]?_0x13b4d7[_0xa0ba('0x3e')]:_0x3985cb[_0xa0ba('0x3c')];_0x13b4d7[_0xa0ba('0x40')]=qs[_0xa0ba('0x41')](_0x2e7e1e[_0xa0ba('0x39')][_0xa0ba('0x41')]);_0x13b4d7[_0xa0ba('0x42')]=qs[_0xa0ba('0x3a')](_[_0xa0ba('0x43')](_0x2e7e1e['query'],_0x3985cb[_0xa0ba('0x3a')]));if(_0x2e7e1e['query']['filter']){_0x13b4d7[_0xa0ba('0x42')]=_[_0xa0ba('0x4c')](_0x13b4d7['where'],{'$or':_[_0xa0ba('0x58')](_0x13b4d7[_0xa0ba('0x3e')],function(_0x50746f){var _0x312c83={};_0x312c83[_0x50746f]={'$like':'%'+_0x2e7e1e['query']['filter']+'%'};return _0x312c83;})});}_0x13b4d7=_['merge']({},_0x13b4d7,_0x2e7e1e[_0xa0ba('0x48')]);return _0x4b6077[_0xa0ba('0x57')](_0x13b4d7);}})[_0xa0ba('0x1c')](function(_0xb20770){if(_0xb20770){_0x8c9d14=_0xb20770[_0xa0ba('0x54')];if(!_0x2e7e1e[_0xa0ba('0x39')][_0xa0ba('0x55')]('nolimit')){_0x13b4d7['limit']=qs[_0xa0ba('0x2a')](_0x2e7e1e[_0xa0ba('0x39')][_0xa0ba('0x2a')]);_0x13b4d7['offset']=qs[_0xa0ba('0x29')](_0x2e7e1e[_0xa0ba('0x39')]['offset']);}return _0x4b6077[_0xa0ba('0x57')](_0x13b4d7);}})[_0xa0ba('0x1c')](function(_0x46fb01){if(_0x46fb01){return _0x46fb01?{'count':_0x8c9d14,'rows':_0x46fb01}:null;}})[_0xa0ba('0x1c')](respondWithResult(_0x36d2a8,null))[_0xa0ba('0x24')](handleError(_0x36d2a8,null));};exports[_0xa0ba('0x59')]=function(_0x593044,_0x5c4e48,_0x58e249){var _0x31613f={};var _0x10be31={};var _0xfacc2;var _0x4ed95b;return db['DeskConfiguration']['findOne']({'where':{'id':_0x593044[_0xa0ba('0x50')]['id']}})[_0xa0ba('0x1c')](handleEntityNotFound(_0x5c4e48,null))[_0xa0ba('0x1c')](function(_0x2cc830){if(_0x2cc830){_0xfacc2=_0x2cc830;_0x10be31[_0xa0ba('0x3c')]=_[_0xa0ba('0x38')](db[_0xa0ba('0x5a')][_0xa0ba('0x37')]);_0x10be31[_0xa0ba('0x39')]=_[_0xa0ba('0x38')](_0x593044[_0xa0ba('0x39')]);_0x10be31[_0xa0ba('0x3a')]=_[_0xa0ba('0x3b')](_0x10be31[_0xa0ba('0x3c')],_0x10be31[_0xa0ba('0x39')]);_0x31613f['attributes']=_[_0xa0ba('0x3b')](_0x10be31[_0xa0ba('0x3c')],qs[_0xa0ba('0x3d')](_0x593044[_0xa0ba('0x39')]['fields']));_0x31613f['attributes']=_0x31613f[_0xa0ba('0x3e')][_0xa0ba('0x54')]?_0x31613f[_0xa0ba('0x3e')]:_0x10be31[_0xa0ba('0x3c')];_0x31613f[_0xa0ba('0x40')]=qs[_0xa0ba('0x41')](_0x593044[_0xa0ba('0x39')][_0xa0ba('0x41')]);_0x31613f[_0xa0ba('0x42')]=qs[_0xa0ba('0x3a')](_[_0xa0ba('0x43')](_0x593044['query'],_0x10be31[_0xa0ba('0x3a')]));if(_0x593044['query'][_0xa0ba('0x44')]){_0x31613f['where']=_['merge'](_0x31613f[_0xa0ba('0x42')],{'$or':_['map'](_0x31613f[_0xa0ba('0x3e')],function(_0x2fd87d){var _0x3e1789={};_0x3e1789[_0x2fd87d]={'$like':'%'+_0x593044[_0xa0ba('0x39')]['filter']+'%'};return _0x3e1789;})});}_0x31613f=_[_0xa0ba('0x4c')]({},_0x31613f,_0x593044[_0xa0ba('0x48')]);return _0xfacc2[_0xa0ba('0x59')](_0x31613f);}})[_0xa0ba('0x1c')](function(_0x459c6f){if(_0x459c6f){_0x4ed95b=_0x459c6f[_0xa0ba('0x54')];if(!_0x593044[_0xa0ba('0x39')][_0xa0ba('0x55')](_0xa0ba('0x3f'))){_0x31613f[_0xa0ba('0x2a')]=qs[_0xa0ba('0x2a')](_0x593044['query'][_0xa0ba('0x2a')]);_0x31613f['offset']=qs[_0xa0ba('0x29')](_0x593044['query']['offset']);}return _0xfacc2['getTags'](_0x31613f);}})[_0xa0ba('0x1c')](function(_0x40f40b){if(_0x40f40b){return _0x40f40b?{'count':_0x4ed95b,'rows':_0x40f40b}:null;}})['then'](respondWithResult(_0x5c4e48,null))[_0xa0ba('0x24')](handleError(_0x5c4e48,null));};exports[_0xa0ba('0x5b')]=function(_0x1f1dd9,_0x3d9f5d,_0x12ecee){if(_0x1f1dd9[_0xa0ba('0x4f')]['id']){delete _0x1f1dd9[_0xa0ba('0x4f')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x1f1dd9['params']['id']}})['then'](handleEntityNotFound(_0x3d9f5d,null))[_0xa0ba('0x1c')](function(_0x491833){if(_0x491833){return _0x491833[_0xa0ba('0x5b')](_0x1f1dd9[_0xa0ba('0x4f')][_0xa0ba('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x3d9f5d,null))[_0xa0ba('0x24')](handleError(_0x3d9f5d,null));}; \ No newline at end of file +var _0xb6ed=['path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','DeskConfiguration','includeAll','include','findAll','rows','show','params','options','find','create','body','getFields','findOne','DeskField','rawAttributes','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0xb6ed,0x167));var _0xdb6e=function(_0x511ccd,_0x16d66c){_0x511ccd=_0x511ccd-0x0;var _0x3bb72b=_0xb6ed[_0x511ccd];return _0x3bb72b;};'use strict';var pdf=require(_0xdb6e('0x0'));var emlformat=require(_0xdb6e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdb6e('0x2'));var jsonpatch=require(_0xdb6e('0x3'));var rp=require(_0xdb6e('0x4'));var moment=require(_0xdb6e('0x5'));var BPromise=require(_0xdb6e('0x6'));var Mustache=require(_0xdb6e('0x7'));var util=require(_0xdb6e('0x8'));var path=require(_0xdb6e('0x9'));var sox=require(_0xdb6e('0xa'));var csv=require(_0xdb6e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdb6e('0xc'));var crypto=require(_0xdb6e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb6e('0xe'));var toCsv=require(_0xdb6e('0xb'));var querystring=require(_0xdb6e('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb6e('0x10'));var authService=require(_0xdb6e('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb6e('0x12'))('api');var utils=require(_0xdb6e('0x13'));var config=require('../../config/environment');var db=require(_0xdb6e('0x14'))['db'];var jayson=require(_0xdb6e('0x15'));var client=jayson[_0xdb6e('0x16')][_0xdb6e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x491b17,_0x14c243,_0xab1119){if(_0xab1119){var _0x54ab50=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54ab50['test'](_0x14c243)){return _0x491b17;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x491b17;}}function respondWithRpcPromise(_0x4b1f27,_0x2cebce,_0xbbec40,_0x2556aa){return new BPromise(function(_0x46a2bf,_0x35d844){var _0x3bdfc1=_0x2556aa||client;return _0x3bdfc1[_0xdb6e('0x18')](_0x4b1f27,_0xbbec40)[_0xdb6e('0x19')](function(_0x43698c){logger[_0xdb6e('0x1a')](_0xdb6e('0x1b'),_0x2cebce,_0xdb6e('0x1c'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2cebce,'request\x20sent',JSON[_0xdb6e('0x1d')](_0x43698c));if(_0x43698c['error']){if(_0x43698c[_0xdb6e('0x1e')][_0xdb6e('0x1f')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2cebce,_0x43698c[_0xdb6e('0x1e')]['message']);return _0x35d844(_0x43698c['error']['message']);}logger[_0xdb6e('0x1e')]('DeskConfiguration,\x20%s,\x20%s',_0x2cebce,_0x43698c[_0xdb6e('0x1e')][_0xdb6e('0x20')]);return _0x46a2bf(_0x43698c[_0xdb6e('0x1e')]['message']);}else{logger[_0xdb6e('0x1a')](_0xdb6e('0x1b'),_0x2cebce,_0xdb6e('0x1c'));_0x46a2bf(_0x43698c[_0xdb6e('0x21')][_0xdb6e('0x20')]);}})[_0xdb6e('0x22')](function(_0x5caab5){logger[_0xdb6e('0x1e')](_0xdb6e('0x1b'),_0x2cebce,_0x5caab5);_0x35d844(_0x5caab5);});});}function respondWithStatusCode(_0x4a5b8e,_0x1a18d0){_0x1a18d0=_0x1a18d0||0xcc;return function(_0x23e5ae){if(_0x23e5ae){return _0x4a5b8e['sendStatus'](_0x1a18d0);}return _0x4a5b8e[_0xdb6e('0x23')](_0x1a18d0)[_0xdb6e('0x24')]();};}function respondWithResult(_0x522076,_0x3b825a){_0x3b825a=_0x3b825a||0xc8;return function(_0x2a470b){if(_0x2a470b){return _0x522076[_0xdb6e('0x23')](_0x3b825a)[_0xdb6e('0x25')](_0x2a470b);}};}function respondWithFilteredResult(_0x4084be,_0x47ac6e){return function(_0x402a86){if(_0x402a86){var _0x4864c6=_0x402a86[_0xdb6e('0x26')],_0x766256=_0x47ac6e[_0xdb6e('0x27')],_0x4905b9=_0x47ac6e['offset']+_0x47ac6e[_0xdb6e('0x28')],_0x4ef171;if(_0x4905b9>=_0x4864c6){_0x4905b9=_0x4864c6;_0x4ef171=0xc8;}else{_0x4ef171=0xce;}_0x4084be['status'](_0x4ef171);return _0x4084be[_0xdb6e('0x29')](_0xdb6e('0x2a'),_0x766256+'-'+_0x4905b9+'/'+_0x4864c6)[_0xdb6e('0x25')](_0x402a86);}return null;};}function patchUpdates(_0x4535fa){return function(_0x58e83c){try{jsonpatch[_0xdb6e('0x2b')](_0x58e83c,_0x4535fa,!![]);}catch(_0x4310ab){return BPromise[_0xdb6e('0x2c')](_0x4310ab);}return _0x58e83c[_0xdb6e('0x2d')]();};}function saveUpdates(_0x44d33a,_0x533103){return function(_0x52cca5){if(_0x52cca5){return _0x52cca5[_0xdb6e('0x2e')](_0x44d33a)[_0xdb6e('0x19')](function(_0x33391c){return _0x33391c;});}return null;};}function removeEntity(_0xa2cdd,_0x1cabac){return function(_0x2c13cd){if(_0x2c13cd){return _0x2c13cd[_0xdb6e('0x2f')]()[_0xdb6e('0x19')](function(){_0xa2cdd[_0xdb6e('0x23')](0xcc)[_0xdb6e('0x24')]();});}};}function handleEntityNotFound(_0x15de33,_0x122309){return function(_0x2a10b5){if(!_0x2a10b5){_0x15de33[_0xdb6e('0x30')](0x194);}return _0x2a10b5;};}function handleError(_0x569978,_0x1ea77e){_0x1ea77e=_0x1ea77e||0x1f4;return function(_0x2aca9e){logger[_0xdb6e('0x1e')](_0x2aca9e[_0xdb6e('0x31')]);if(_0x2aca9e[_0xdb6e('0x32')]){delete _0x2aca9e[_0xdb6e('0x32')];}_0x569978[_0xdb6e('0x23')](_0x1ea77e)['send'](_0x2aca9e);};}exports[_0xdb6e('0x33')]=function(_0x5c3b87,_0x1ef6c2){var _0x518c1a={},_0x24fa48={},_0x2eeed0={'count':0x0,'rows':[]};var _0x482394=db['DeskConfiguration']['rawAttributes'];_0x24fa48['model']=_[_0xdb6e('0x34')](_0x482394);_0x24fa48[_0xdb6e('0x35')]=_[_0xdb6e('0x34')](_0x5c3b87[_0xdb6e('0x35')]);_0x24fa48['filters']=_['intersection'](_0x24fa48[_0xdb6e('0x36')],_0x24fa48[_0xdb6e('0x35')]);_0x518c1a[_0xdb6e('0x37')]=_[_0xdb6e('0x38')](_0x24fa48['model'],qs['fields'](_0x5c3b87[_0xdb6e('0x35')][_0xdb6e('0x39')]));_0x518c1a[_0xdb6e('0x37')]=_0x518c1a[_0xdb6e('0x37')][_0xdb6e('0x3a')]?_0x518c1a[_0xdb6e('0x37')]:_0x24fa48[_0xdb6e('0x36')];if(!_0x5c3b87[_0xdb6e('0x35')][_0xdb6e('0x3b')](_0xdb6e('0x3c'))){_0x518c1a[_0xdb6e('0x28')]=qs['limit'](_0x5c3b87[_0xdb6e('0x35')][_0xdb6e('0x28')]);_0x518c1a[_0xdb6e('0x27')]=qs['offset'](_0x5c3b87['query'][_0xdb6e('0x27')]);}_0x518c1a[_0xdb6e('0x3d')]=qs[_0xdb6e('0x3e')](_0x5c3b87[_0xdb6e('0x35')]['sort']);_0x518c1a[_0xdb6e('0x3f')]=qs[_0xdb6e('0x40')](_[_0xdb6e('0x41')](_0x5c3b87['query'],_0x24fa48[_0xdb6e('0x40')]));if(_0x5c3b87[_0xdb6e('0x35')][_0xdb6e('0x42')]){_0x518c1a['where']=_[_0xdb6e('0x43')](_0x518c1a[_0xdb6e('0x3f')],{'$or':_[_0xdb6e('0x44')](_0x482394,function(_0x5086e7){if(_0x5086e7[_0xdb6e('0x45')][_0xdb6e('0x46')]!==_0xdb6e('0x47')){var _0x2d7b8e={};_0x2d7b8e[_0x5086e7['field']]={'$like':'%'+_0x5c3b87['query']['filter']+'%'};return _0x2d7b8e;}})});}_0x518c1a=_['merge']({},_0x518c1a,_0x5c3b87['options']);var _0x50979a={'where':_0x518c1a[_0xdb6e('0x3f')]};return db[_0xdb6e('0x48')][_0xdb6e('0x26')](_0x50979a)[_0xdb6e('0x19')](function(_0x41847c){_0x2eeed0['count']=_0x41847c;if(_0x5c3b87[_0xdb6e('0x35')][_0xdb6e('0x49')]){_0x518c1a[_0xdb6e('0x4a')]=[{'all':!![]}];}return db[_0xdb6e('0x48')][_0xdb6e('0x4b')](_0x518c1a);})['then'](function(_0x21d95a){_0x2eeed0[_0xdb6e('0x4c')]=_0x21d95a;return _0x2eeed0;})[_0xdb6e('0x19')](respondWithFilteredResult(_0x1ef6c2,_0x518c1a))[_0xdb6e('0x22')](handleError(_0x1ef6c2,null));};exports[_0xdb6e('0x4d')]=function(_0x20fd3d,_0x330447){var _0x5390c2={'raw':![],'where':{'id':_0x20fd3d[_0xdb6e('0x4e')]['id']}},_0x5c66be={};_0x5c66be[_0xdb6e('0x36')]=_[_0xdb6e('0x34')](db['DeskConfiguration']['rawAttributes']);_0x5c66be[_0xdb6e('0x35')]=_[_0xdb6e('0x34')](_0x20fd3d[_0xdb6e('0x35')]);_0x5c66be['filters']=_['intersection'](_0x5c66be['model'],_0x5c66be[_0xdb6e('0x35')]);_0x5390c2[_0xdb6e('0x37')]=_['intersection'](_0x5c66be[_0xdb6e('0x36')],qs['fields'](_0x20fd3d[_0xdb6e('0x35')][_0xdb6e('0x39')]));_0x5390c2['attributes']=_0x5390c2[_0xdb6e('0x37')][_0xdb6e('0x3a')]?_0x5390c2[_0xdb6e('0x37')]:_0x5c66be['model'];if(_0x20fd3d[_0xdb6e('0x35')]['includeAll']){_0x5390c2[_0xdb6e('0x4a')]=[{'all':!![]}];}_0x5390c2=_[_0xdb6e('0x43')]({},_0x5390c2,_0x20fd3d[_0xdb6e('0x4f')]);return db[_0xdb6e('0x48')][_0xdb6e('0x50')](_0x5390c2)[_0xdb6e('0x19')](handleEntityNotFound(_0x330447,null))['then'](respondWithResult(_0x330447,null))[_0xdb6e('0x22')](handleError(_0x330447,null));};exports[_0xdb6e('0x51')]=function(_0x3ee942,_0x310d3d){return db[_0xdb6e('0x48')][_0xdb6e('0x51')](_0x3ee942[_0xdb6e('0x52')],{})['then'](respondWithResult(_0x310d3d,0xc9))['catch'](handleError(_0x310d3d,null));};exports[_0xdb6e('0x2e')]=function(_0x49752c,_0x16f9a3){if(_0x49752c[_0xdb6e('0x52')]['id']){delete _0x49752c[_0xdb6e('0x52')]['id'];}return db[_0xdb6e('0x48')]['find']({'where':{'id':_0x49752c['params']['id']}})[_0xdb6e('0x19')](handleEntityNotFound(_0x16f9a3,null))[_0xdb6e('0x19')](saveUpdates(_0x49752c['body'],null))[_0xdb6e('0x19')](respondWithResult(_0x16f9a3,null))[_0xdb6e('0x22')](handleError(_0x16f9a3,null));};exports['destroy']=function(_0x540150,_0x1d9816){return db[_0xdb6e('0x48')][_0xdb6e('0x50')]({'where':{'id':_0x540150[_0xdb6e('0x4e')]['id']}})[_0xdb6e('0x19')](handleEntityNotFound(_0x1d9816,null))[_0xdb6e('0x19')](removeEntity(_0x1d9816,null))[_0xdb6e('0x22')](handleError(_0x1d9816,null));};exports[_0xdb6e('0x53')]=function(_0xca5da,_0x3a9c60,_0x173f4e){var _0x42b997={};var _0x1f12db={};var _0x28ac93;var _0x39f265;return db[_0xdb6e('0x48')][_0xdb6e('0x54')]({'where':{'id':_0xca5da[_0xdb6e('0x4e')]['id']}})[_0xdb6e('0x19')](handleEntityNotFound(_0x3a9c60,null))['then'](function(_0x4329ef){if(_0x4329ef){_0x28ac93=_0x4329ef;_0x1f12db[_0xdb6e('0x36')]=_[_0xdb6e('0x34')](db[_0xdb6e('0x55')][_0xdb6e('0x56')]);_0x1f12db[_0xdb6e('0x35')]=_[_0xdb6e('0x34')](_0xca5da[_0xdb6e('0x35')]);_0x1f12db['filters']=_[_0xdb6e('0x38')](_0x1f12db[_0xdb6e('0x36')],_0x1f12db[_0xdb6e('0x35')]);_0x42b997[_0xdb6e('0x37')]=_[_0xdb6e('0x38')](_0x1f12db[_0xdb6e('0x36')],qs['fields'](_0xca5da[_0xdb6e('0x35')][_0xdb6e('0x39')]));_0x42b997[_0xdb6e('0x37')]=_0x42b997[_0xdb6e('0x37')][_0xdb6e('0x3a')]?_0x42b997[_0xdb6e('0x37')]:_0x1f12db[_0xdb6e('0x36')];_0x42b997[_0xdb6e('0x3d')]=qs['sort'](_0xca5da[_0xdb6e('0x35')]['sort']);_0x42b997[_0xdb6e('0x3f')]=qs[_0xdb6e('0x40')](_[_0xdb6e('0x41')](_0xca5da[_0xdb6e('0x35')],_0x1f12db['filters']));if(_0xca5da['query'][_0xdb6e('0x42')]){_0x42b997['where']=_[_0xdb6e('0x43')](_0x42b997[_0xdb6e('0x3f')],{'$or':_[_0xdb6e('0x44')](_0x42b997[_0xdb6e('0x37')],function(_0x58efb8){var _0x2d4625={};_0x2d4625[_0x58efb8]={'$like':'%'+_0xca5da[_0xdb6e('0x35')][_0xdb6e('0x42')]+'%'};return _0x2d4625;})});}_0x42b997=_['merge']({},_0x42b997,_0xca5da[_0xdb6e('0x4f')]);return _0x28ac93[_0xdb6e('0x53')](_0x42b997);}})[_0xdb6e('0x19')](function(_0x1f82e5){if(_0x1f82e5){_0x39f265=_0x1f82e5[_0xdb6e('0x3a')];if(!_0xca5da[_0xdb6e('0x35')][_0xdb6e('0x3b')](_0xdb6e('0x3c'))){_0x42b997[_0xdb6e('0x28')]=qs['limit'](_0xca5da['query']['limit']);_0x42b997[_0xdb6e('0x27')]=qs[_0xdb6e('0x27')](_0xca5da[_0xdb6e('0x35')]['offset']);}return _0x28ac93[_0xdb6e('0x53')](_0x42b997);}})[_0xdb6e('0x19')](function(_0x26b039){if(_0x26b039){return _0x26b039?{'count':_0x39f265,'rows':_0x26b039}:null;}})[_0xdb6e('0x19')](respondWithResult(_0x3a9c60,null))[_0xdb6e('0x22')](handleError(_0x3a9c60,null));};exports[_0xdb6e('0x57')]=function(_0x4aa038,_0x23a76b,_0x3cefc1){var _0x28999a={};var _0x38d538={};var _0x4001e9;var _0x54caf4;return db[_0xdb6e('0x48')]['findOne']({'where':{'id':_0x4aa038[_0xdb6e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x23a76b,null))[_0xdb6e('0x19')](function(_0x1d0150){if(_0x1d0150){_0x4001e9=_0x1d0150;_0x38d538['model']=_[_0xdb6e('0x34')](db[_0xdb6e('0x55')][_0xdb6e('0x56')]);_0x38d538[_0xdb6e('0x35')]=_['keys'](_0x4aa038[_0xdb6e('0x35')]);_0x38d538[_0xdb6e('0x40')]=_[_0xdb6e('0x38')](_0x38d538[_0xdb6e('0x36')],_0x38d538[_0xdb6e('0x35')]);_0x28999a['attributes']=_[_0xdb6e('0x38')](_0x38d538[_0xdb6e('0x36')],qs['fields'](_0x4aa038[_0xdb6e('0x35')][_0xdb6e('0x39')]));_0x28999a['attributes']=_0x28999a['attributes'][_0xdb6e('0x3a')]?_0x28999a[_0xdb6e('0x37')]:_0x38d538[_0xdb6e('0x36')];_0x28999a[_0xdb6e('0x3d')]=qs['sort'](_0x4aa038[_0xdb6e('0x35')][_0xdb6e('0x3e')]);_0x28999a[_0xdb6e('0x3f')]=qs[_0xdb6e('0x40')](_[_0xdb6e('0x41')](_0x4aa038[_0xdb6e('0x35')],_0x38d538[_0xdb6e('0x40')]));if(_0x4aa038[_0xdb6e('0x35')][_0xdb6e('0x42')]){_0x28999a['where']=_[_0xdb6e('0x43')](_0x28999a[_0xdb6e('0x3f')],{'$or':_[_0xdb6e('0x44')](_0x28999a[_0xdb6e('0x37')],function(_0x2489c2){var _0x124dd6={};_0x124dd6[_0x2489c2]={'$like':'%'+_0x4aa038[_0xdb6e('0x35')][_0xdb6e('0x42')]+'%'};return _0x124dd6;})});}_0x28999a=_[_0xdb6e('0x43')]({},_0x28999a,_0x4aa038[_0xdb6e('0x4f')]);return _0x4001e9[_0xdb6e('0x57')](_0x28999a);}})[_0xdb6e('0x19')](function(_0x5ecc05){if(_0x5ecc05){_0x54caf4=_0x5ecc05['length'];if(!_0x4aa038['query'][_0xdb6e('0x3b')]('nolimit')){_0x28999a[_0xdb6e('0x28')]=qs[_0xdb6e('0x28')](_0x4aa038[_0xdb6e('0x35')][_0xdb6e('0x28')]);_0x28999a[_0xdb6e('0x27')]=qs[_0xdb6e('0x27')](_0x4aa038['query'][_0xdb6e('0x27')]);}return _0x4001e9[_0xdb6e('0x57')](_0x28999a);}})[_0xdb6e('0x19')](function(_0x39b4d3){if(_0x39b4d3){return _0x39b4d3?{'count':_0x54caf4,'rows':_0x39b4d3}:null;}})['then'](respondWithResult(_0x23a76b,null))[_0xdb6e('0x22')](handleError(_0x23a76b,null));};exports[_0xdb6e('0x58')]=function(_0x30a6b0,_0x32a34e,_0x4717b9){var _0x360cc3={};var _0x36e5fa={};var _0x5a2e0d;var _0x5446dd;return db[_0xdb6e('0x48')][_0xdb6e('0x54')]({'where':{'id':_0x30a6b0[_0xdb6e('0x4e')]['id']}})[_0xdb6e('0x19')](handleEntityNotFound(_0x32a34e,null))[_0xdb6e('0x19')](function(_0x4e3ac5){if(_0x4e3ac5){_0x5a2e0d=_0x4e3ac5;_0x36e5fa[_0xdb6e('0x36')]=_[_0xdb6e('0x34')](db[_0xdb6e('0x55')][_0xdb6e('0x56')]);_0x36e5fa[_0xdb6e('0x35')]=_[_0xdb6e('0x34')](_0x30a6b0[_0xdb6e('0x35')]);_0x36e5fa[_0xdb6e('0x40')]=_[_0xdb6e('0x38')](_0x36e5fa[_0xdb6e('0x36')],_0x36e5fa[_0xdb6e('0x35')]);_0x360cc3['attributes']=_[_0xdb6e('0x38')](_0x36e5fa[_0xdb6e('0x36')],qs[_0xdb6e('0x39')](_0x30a6b0[_0xdb6e('0x35')]['fields']));_0x360cc3[_0xdb6e('0x37')]=_0x360cc3[_0xdb6e('0x37')][_0xdb6e('0x3a')]?_0x360cc3[_0xdb6e('0x37')]:_0x36e5fa[_0xdb6e('0x36')];_0x360cc3[_0xdb6e('0x3d')]=qs['sort'](_0x30a6b0['query']['sort']);_0x360cc3[_0xdb6e('0x3f')]=qs[_0xdb6e('0x40')](_['pick'](_0x30a6b0[_0xdb6e('0x35')],_0x36e5fa['filters']));if(_0x30a6b0['query'][_0xdb6e('0x42')]){_0x360cc3['where']=_['merge'](_0x360cc3['where'],{'$or':_['map'](_0x360cc3[_0xdb6e('0x37')],function(_0x301930){var _0x43ea79={};_0x43ea79[_0x301930]={'$like':'%'+_0x30a6b0[_0xdb6e('0x35')][_0xdb6e('0x42')]+'%'};return _0x43ea79;})});}_0x360cc3=_[_0xdb6e('0x43')]({},_0x360cc3,_0x30a6b0[_0xdb6e('0x4f')]);return _0x5a2e0d[_0xdb6e('0x58')](_0x360cc3);}})[_0xdb6e('0x19')](function(_0x1d98ea){if(_0x1d98ea){_0x5446dd=_0x1d98ea[_0xdb6e('0x3a')];if(!_0x30a6b0['query'][_0xdb6e('0x3b')](_0xdb6e('0x3c'))){_0x360cc3[_0xdb6e('0x28')]=qs[_0xdb6e('0x28')](_0x30a6b0[_0xdb6e('0x35')][_0xdb6e('0x28')]);_0x360cc3[_0xdb6e('0x27')]=qs[_0xdb6e('0x27')](_0x30a6b0['query'][_0xdb6e('0x27')]);}return _0x5a2e0d['getDescriptions'](_0x360cc3);}})[_0xdb6e('0x19')](function(_0x115d5b){if(_0x115d5b){return _0x115d5b?{'count':_0x5446dd,'rows':_0x115d5b}:null;}})[_0xdb6e('0x19')](respondWithResult(_0x32a34e,null))[_0xdb6e('0x22')](handleError(_0x32a34e,null));};exports['getTags']=function(_0x40251a,_0x3915b8,_0x4f53b4){var _0x5b1883={};var _0x55c4ac={};var _0x4a4c86;var _0x1c3c45;return db[_0xdb6e('0x48')][_0xdb6e('0x54')]({'where':{'id':_0x40251a[_0xdb6e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3915b8,null))[_0xdb6e('0x19')](function(_0x594377){if(_0x594377){_0x4a4c86=_0x594377;_0x55c4ac['model']=_[_0xdb6e('0x34')](db['Tag'][_0xdb6e('0x56')]);_0x55c4ac[_0xdb6e('0x35')]=_[_0xdb6e('0x34')](_0x40251a[_0xdb6e('0x35')]);_0x55c4ac[_0xdb6e('0x40')]=_[_0xdb6e('0x38')](_0x55c4ac[_0xdb6e('0x36')],_0x55c4ac[_0xdb6e('0x35')]);_0x5b1883['attributes']=_[_0xdb6e('0x38')](_0x55c4ac[_0xdb6e('0x36')],qs[_0xdb6e('0x39')](_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x39')]));_0x5b1883[_0xdb6e('0x37')]=_0x5b1883[_0xdb6e('0x37')]['length']?_0x5b1883[_0xdb6e('0x37')]:_0x55c4ac[_0xdb6e('0x36')];_0x5b1883[_0xdb6e('0x3d')]=qs[_0xdb6e('0x3e')](_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x3e')]);_0x5b1883['where']=qs[_0xdb6e('0x40')](_[_0xdb6e('0x41')](_0x40251a['query'],_0x55c4ac[_0xdb6e('0x40')]));if(_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x42')]){_0x5b1883[_0xdb6e('0x3f')]=_[_0xdb6e('0x43')](_0x5b1883[_0xdb6e('0x3f')],{'$or':_['map'](_0x5b1883[_0xdb6e('0x37')],function(_0x4bc175){var _0x4787e1={};_0x4787e1[_0x4bc175]={'$like':'%'+_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x42')]+'%'};return _0x4787e1;})});}_0x5b1883=_['merge']({},_0x5b1883,_0x40251a[_0xdb6e('0x4f')]);return _0x4a4c86[_0xdb6e('0x59')](_0x5b1883);}})[_0xdb6e('0x19')](function(_0x19cd0c){if(_0x19cd0c){_0x1c3c45=_0x19cd0c[_0xdb6e('0x3a')];if(!_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x3b')](_0xdb6e('0x3c'))){_0x5b1883['limit']=qs['limit'](_0x40251a['query'][_0xdb6e('0x28')]);_0x5b1883['offset']=qs[_0xdb6e('0x27')](_0x40251a[_0xdb6e('0x35')][_0xdb6e('0x27')]);}return _0x4a4c86[_0xdb6e('0x59')](_0x5b1883);}})[_0xdb6e('0x19')](function(_0x11b532){if(_0x11b532){return _0x11b532?{'count':_0x1c3c45,'rows':_0x11b532}:null;}})[_0xdb6e('0x19')](respondWithResult(_0x3915b8,null))[_0xdb6e('0x22')](handleError(_0x3915b8,null));};exports[_0xdb6e('0x5a')]=function(_0x213abe,_0x2257d2,_0x16b698){if(_0x213abe[_0xdb6e('0x52')]['id']){delete _0x213abe[_0xdb6e('0x52')]['id'];}return db['DeskConfiguration'][_0xdb6e('0x54')]({'where':{'id':_0x213abe['params']['id']}})[_0xdb6e('0x19')](handleEntityNotFound(_0x2257d2,null))[_0xdb6e('0x19')](function(_0x25afa1){if(_0x25afa1){return _0x25afa1[_0xdb6e('0x5a')](_0x213abe['body'][_0xdb6e('0x5b')]||[]);}return null;})[_0xdb6e('0x19')](respondWithResult(_0x2257d2,null))[_0xdb6e('0x22')](handleError(_0x2257d2,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index d935fc0..5e59a35 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 _0x00a2=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','util','api','moment','bluebird'];(function(_0x3dd991,_0x4bef12){var _0x251609=function(_0x371481){while(--_0x371481){_0x3dd991['push'](_0x3dd991['shift']());}};_0x251609(++_0x4bef12);}(_0x00a2,0xeb));var _0x200a=function(_0x5372d0,_0x4595ed){_0x5372d0=_0x5372d0-0x0;var _0x35081e=_0x00a2[_0x5372d0];return _0x35081e;};'use strict';var _=require(_0x200a('0x0'));var util=require(_0x200a('0x1'));var logger=require('../../config/logger')(_0x200a('0x2'));var moment=require(_0x200a('0x3'));var BPromise=require(_0x200a('0x4'));var rp=require(_0x200a('0x5'));var fs=require('fs');var path=require(_0x200a('0x6'));var rimraf=require(_0x200a('0x7'));var config=require(_0x200a('0x8'));var attributes=require(_0x200a('0x9'));module[_0x200a('0xa')]=function(_0x21222c,_0x842a8c){return _0x21222c['define']('DeskConfiguration',attributes,{'tableName':_0x200a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb828=['DeskConfiguration','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x298011,_0x2851f9){var _0x397501=function(_0x4c1c73){while(--_0x4c1c73){_0x298011['push'](_0x298011['shift']());}};_0x397501(++_0x2851f9);}(_0xb828,0x140));var _0x8b82=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0xb828[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require(_0x8b82('0x0'));var util=require('util');var logger=require(_0x8b82('0x1'))(_0x8b82('0x2'));var moment=require(_0x8b82('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b82('0x5'));var config=require(_0x8b82('0x6'));var attributes=require(_0x8b82('0x7'));module[_0x8b82('0x8')]=function(_0x5a1d36,_0x504bf7){return _0x5a1d36[_0x8b82('0x9')](_0x8b82('0xa'),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 3431365..2677a49 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 _0x814b=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x814b,0x1a2));var _0xb814=function(_0x6620b8,_0x8b3d5e){_0x6620b8=_0x6620b8-0x0;var _0x33de50=_0x814b[_0x6620b8];return _0x33de50;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x53ec,0x192));var _0xc53e=function(_0x1ed99c,_0x52bb43){_0x1ed99c=_0x1ed99c-0x0;var _0x19c308=_0x53ec[_0x1ed99c];return _0x19c308;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d7f1e24..41aee09 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 _0xa6d8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','util','path'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xa6d8,0xfc));var _0x8a6d=function(_0x1d5fb9,_0x43aa73){_0x1d5fb9=_0x1d5fb9-0x0;var _0xd72009=_0xa6d8[_0x1d5fb9];return _0xd72009;};'use strict';var multer=require(_0x8a6d('0x0'));var util=require(_0x8a6d('0x1'));var path=require(_0x8a6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a6d('0x3'));var router=express['Router']();var auth=require(_0x8a6d('0x4'));var interaction=require(_0x8a6d('0x5'));var config=require(_0x8a6d('0x6'));var controller=require(_0x8a6d('0x7'));router[_0x8a6d('0x8')]('/',auth[_0x8a6d('0x9')](),controller[_0x8a6d('0xa')]);router[_0x8a6d('0x8')](_0x8a6d('0xb'),auth[_0x8a6d('0x9')](),controller['show']);router[_0x8a6d('0xc')]('/',auth[_0x8a6d('0x9')](),controller[_0x8a6d('0xd')]);router['put'](_0x8a6d('0xb'),auth[_0x8a6d('0x9')](),controller['update']);router[_0x8a6d('0xe')](_0x8a6d('0xb'),auth[_0x8a6d('0x9')](),controller[_0x8a6d('0xf')]);module[_0x8a6d('0x10')]=router; \ No newline at end of file +var _0xf08a=['../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f3f92,_0x407613){var _0x325064=function(_0x2720ad){while(--_0x2720ad){_0x1f3f92['push'](_0x1f3f92['shift']());}};_0x325064(++_0x407613);}(_0xf08a,0x174));var _0xaf08=function(_0x57991d,_0x2845dc){_0x57991d=_0x57991d-0x0;var _0x491a5b=_0xf08a[_0x57991d];return _0x491a5b;};'use strict';var multer=require(_0xaf08('0x0'));var util=require(_0xaf08('0x1'));var path=require(_0xaf08('0x2'));var timeout=require(_0xaf08('0x3'));var express=require(_0xaf08('0x4'));var router=express[_0xaf08('0x5')]();var auth=require(_0xaf08('0x6'));var interaction=require(_0xaf08('0x7'));var config=require(_0xaf08('0x8'));var controller=require('./intDeskField.controller');router[_0xaf08('0x9')]('/',auth[_0xaf08('0xa')](),controller[_0xaf08('0xb')]);router[_0xaf08('0x9')](_0xaf08('0xc'),auth[_0xaf08('0xa')](),controller['show']);router[_0xaf08('0xd')]('/',auth[_0xaf08('0xa')](),controller[_0xaf08('0xe')]);router[_0xaf08('0xf')](_0xaf08('0xc'),auth[_0xaf08('0xa')](),controller[_0xaf08('0x10')]);router['delete']('/:id',auth[_0xaf08('0xa')](),controller[_0xaf08('0x11')]);module[_0xaf08('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index f519145..8f0956e 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 _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3c81,0x102));var _0x13c8=function(_0x254ee0,_0x152bde){_0x254ee0=_0x254ee0-0x0;var _0x4f0981=_0x3c81[_0x254ee0];return _0x4f0981;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x1022f3,_0x120205){var _0xfc9c24=function(_0x4d51c3){while(--_0x4d51c3){_0x1022f3['push'](_0x1022f3['shift']());}};_0xfc9c24(++_0x120205);}(_0xe605,0x92));var _0x5e60=function(_0x45632b,_0x359639){_0x45632b=_0x45632b-0x0;var _0x16e20f=_0xe605[_0x45632b];return _0x16e20f;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'),_0x5e60('0x5')),'defaultValue':_0x5e60('0x2')},'content':{'type':Sequelize[_0x5e60('0x6')]},'key':{'type':Sequelize[_0x5e60('0x6')]},'keyType':{'type':Sequelize[_0x5e60('0x7')](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'))},'keyContent':{'type':Sequelize[_0x5e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e60('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e778ba2..f3615e5 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 _0xc6d8=['rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','DeskField','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','html-pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2f7bd9,_0xe151e6){_0x2f7bd9=_0x2f7bd9-0x0;var _0x59da8b=_0xc6d8[_0x2f7bd9];return _0x59da8b;};'use strict';var pdf=require(_0x8c6d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c6d('0x2'));var rp=require('request-promise');var moment=require(_0x8c6d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8c6d('0x4'));var path=require(_0x8c6d('0x5'));var sox=require(_0x8c6d('0x6'));var csv=require(_0x8c6d('0x7'));var ejs=require(_0x8c6d('0x8'));var fs=require('fs');var _=require(_0x8c6d('0x9'));var squel=require(_0x8c6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8c6d('0xb'));var deskjs=require(_0x8c6d('0xc'));var toCsv=require(_0x8c6d('0x7'));var querystring=require('querystring');var Papa=require(_0x8c6d('0xd'));var Redis=require(_0x8c6d('0xe'));var authService=require(_0x8c6d('0xf'));var qs=require(_0x8c6d('0x10'));var hardwareService=require(_0x8c6d('0x11'));var logger=require(_0x8c6d('0x12'))(_0x8c6d('0x13'));var utils=require(_0x8c6d('0x14'));var config=require('../../config/environment');var db=require(_0x8c6d('0x15'))['db'];function respondWithStatusCode(_0x559d17,_0x4c0878){_0x4c0878=_0x4c0878||0xcc;return function(_0x22d0fb){if(_0x22d0fb){return _0x559d17[_0x8c6d('0x16')](_0x4c0878);}return _0x559d17[_0x8c6d('0x17')](_0x4c0878)[_0x8c6d('0x18')]();};}function respondWithResult(_0x30ecfa,_0xe294e7){_0xe294e7=_0xe294e7||0xc8;return function(_0x42d746){if(_0x42d746){return _0x30ecfa[_0x8c6d('0x17')](_0xe294e7)[_0x8c6d('0x19')](_0x42d746);}};}function respondWithFilteredResult(_0x31d943,_0x4fb956){return function(_0x16c6b5){if(_0x16c6b5){var _0x4b2bb1=_0x16c6b5[_0x8c6d('0x1a')],_0x16af06=_0x4fb956['offset'],_0x4dd4b6=_0x4fb956[_0x8c6d('0x1b')]+_0x4fb956[_0x8c6d('0x1c')],_0x150a16;if(_0x4dd4b6>=_0x4b2bb1){_0x4dd4b6=_0x4b2bb1;_0x150a16=0xc8;}else{_0x150a16=0xce;}_0x31d943['status'](_0x150a16);return _0x31d943[_0x8c6d('0x1d')]('Content-Range',_0x16af06+'-'+_0x4dd4b6+'/'+_0x4b2bb1)['json'](_0x16c6b5);}return null;};}function patchUpdates(_0x21b8ee){return function(_0x5c962e){try{jsonpatch[_0x8c6d('0x1e')](_0x5c962e,_0x21b8ee,!![]);}catch(_0x174a4f){return BPromise[_0x8c6d('0x1f')](_0x174a4f);}return _0x5c962e[_0x8c6d('0x20')]();};}function saveUpdates(_0x5ac817,_0x56854a){return function(_0x5512be){if(_0x5512be){return _0x5512be['update'](_0x5ac817)[_0x8c6d('0x21')](function(_0x507e0c){return _0x507e0c;});}return null;};}function removeEntity(_0xc3288,_0x4b6835){return function(_0x4c378b){if(_0x4c378b){return _0x4c378b[_0x8c6d('0x22')]()[_0x8c6d('0x21')](function(){_0xc3288['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51bb08,_0x47d3a0){return function(_0x2a85b5){if(!_0x2a85b5){_0x51bb08[_0x8c6d('0x16')](0x194);}return _0x2a85b5;};}function handleError(_0x292ae4,_0x48f64a){_0x48f64a=_0x48f64a||0x1f4;return function(_0x41c904){logger['error'](_0x41c904[_0x8c6d('0x23')]);if(_0x41c904['name']){delete _0x41c904[_0x8c6d('0x24')];}_0x292ae4[_0x8c6d('0x17')](_0x48f64a)[_0x8c6d('0x25')](_0x41c904);};}exports[_0x8c6d('0x26')]=function(_0x1e6755,_0x3e3cd3){var _0x9c269d={},_0x41957d={},_0x3eab38={'count':0x0,'rows':[]};var _0x4c307c=db['DeskField'][_0x8c6d('0x27')];_0x41957d[_0x8c6d('0x28')]=_[_0x8c6d('0x29')](_0x4c307c);_0x41957d[_0x8c6d('0x2a')]=_[_0x8c6d('0x29')](_0x1e6755[_0x8c6d('0x2a')]);_0x41957d[_0x8c6d('0x2b')]=_[_0x8c6d('0x2c')](_0x41957d[_0x8c6d('0x28')],_0x41957d[_0x8c6d('0x2a')]);_0x9c269d[_0x8c6d('0x2d')]=_[_0x8c6d('0x2c')](_0x41957d['model'],qs[_0x8c6d('0x2e')](_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x2e')]));_0x9c269d[_0x8c6d('0x2d')]=_0x9c269d[_0x8c6d('0x2d')][_0x8c6d('0x2f')]?_0x9c269d[_0x8c6d('0x2d')]:_0x41957d[_0x8c6d('0x28')];if(!_0x1e6755[_0x8c6d('0x2a')]['hasOwnProperty'](_0x8c6d('0x30'))){_0x9c269d['limit']=qs[_0x8c6d('0x1c')](_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x1c')]);_0x9c269d[_0x8c6d('0x1b')]=qs[_0x8c6d('0x1b')](_0x1e6755[_0x8c6d('0x2a')]['offset']);}_0x9c269d['order']=qs[_0x8c6d('0x31')](_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x31')]);_0x9c269d[_0x8c6d('0x32')]=qs['filters'](_[_0x8c6d('0x33')](_0x1e6755[_0x8c6d('0x2a')],_0x41957d[_0x8c6d('0x2b')]));if(_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x34')]){_0x9c269d[_0x8c6d('0x32')]=_['merge'](_0x9c269d[_0x8c6d('0x32')],{'$or':_[_0x8c6d('0x35')](_0x4c307c,function(_0x1349be){if(_0x1349be[_0x8c6d('0x36')][_0x8c6d('0x37')]!==_0x8c6d('0x38')){var _0x40f3a5={};_0x40f3a5[_0x1349be[_0x8c6d('0x39')]]={'$like':'%'+_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x34')]+'%'};return _0x40f3a5;}})});}_0x9c269d=_[_0x8c6d('0x3a')]({},_0x9c269d,_0x1e6755[_0x8c6d('0x3b')]);var _0x4b0ca5={'where':_0x9c269d[_0x8c6d('0x32')]};return db[_0x8c6d('0x3c')][_0x8c6d('0x1a')](_0x4b0ca5)[_0x8c6d('0x21')](function(_0xa8ea55){_0x3eab38['count']=_0xa8ea55;if(_0x1e6755[_0x8c6d('0x2a')][_0x8c6d('0x3d')]){_0x9c269d['include']=[{'all':!![]}];}return db[_0x8c6d('0x3c')][_0x8c6d('0x3e')](_0x9c269d);})[_0x8c6d('0x21')](function(_0x4869dc){_0x3eab38[_0x8c6d('0x3f')]=_0x4869dc;return _0x3eab38;})[_0x8c6d('0x21')](respondWithFilteredResult(_0x3e3cd3,_0x9c269d))[_0x8c6d('0x40')](handleError(_0x3e3cd3,null));};exports[_0x8c6d('0x41')]=function(_0x2f54a2,_0x32072d){var _0x305910={'raw':!![],'where':{'id':_0x2f54a2[_0x8c6d('0x42')]['id']}},_0x2bbf60={};_0x2bbf60[_0x8c6d('0x28')]=_[_0x8c6d('0x29')](db['DeskField']['rawAttributes']);_0x2bbf60['query']=_[_0x8c6d('0x29')](_0x2f54a2[_0x8c6d('0x2a')]);_0x2bbf60[_0x8c6d('0x2b')]=_[_0x8c6d('0x2c')](_0x2bbf60[_0x8c6d('0x28')],_0x2bbf60['query']);_0x305910[_0x8c6d('0x2d')]=_[_0x8c6d('0x2c')](_0x2bbf60[_0x8c6d('0x28')],qs['fields'](_0x2f54a2[_0x8c6d('0x2a')][_0x8c6d('0x2e')]));_0x305910['attributes']=_0x305910['attributes']['length']?_0x305910['attributes']:_0x2bbf60['model'];if(_0x2f54a2[_0x8c6d('0x2a')][_0x8c6d('0x3d')]){_0x305910[_0x8c6d('0x43')]=[{'all':!![]}];}_0x305910=_[_0x8c6d('0x3a')]({},_0x305910,_0x2f54a2[_0x8c6d('0x3b')]);return db['DeskField']['find'](_0x305910)['then'](handleEntityNotFound(_0x32072d,null))['then'](respondWithResult(_0x32072d,null))[_0x8c6d('0x40')](handleError(_0x32072d,null));};exports['create']=function(_0xddf009,_0x6d8dfe){return db[_0x8c6d('0x3c')][_0x8c6d('0x44')](_0xddf009[_0x8c6d('0x45')],{})[_0x8c6d('0x21')](respondWithResult(_0x6d8dfe,0xc9))['catch'](handleError(_0x6d8dfe,null));};exports[_0x8c6d('0x46')]=function(_0x458a66,_0x581932){if(_0x458a66[_0x8c6d('0x45')]['id']){delete _0x458a66[_0x8c6d('0x45')]['id'];}return db['DeskField'][_0x8c6d('0x47')]({'where':{'id':_0x458a66[_0x8c6d('0x42')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0x581932,null))[_0x8c6d('0x21')](saveUpdates(_0x458a66[_0x8c6d('0x45')],null))[_0x8c6d('0x21')](respondWithResult(_0x581932,null))[_0x8c6d('0x40')](handleError(_0x581932,null));};exports[_0x8c6d('0x22')]=function(_0x1f1609,_0x1d6c29){return db[_0x8c6d('0x3c')][_0x8c6d('0x47')]({'where':{'id':_0x1f1609[_0x8c6d('0x42')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0x1d6c29,null))[_0x8c6d('0x21')](removeEntity(_0x1d6c29,null))[_0x8c6d('0x40')](handleError(_0x1d6c29,null));}; \ No newline at end of file +var _0xadb8=['limit','apply','reject','save','update','then','end','stack','name','send','index','DeskField','rawAttributes','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','type','key','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x90cc4,_0x51729d){var _0x44f3b7=function(_0x1c1c86){while(--_0x1c1c86){_0x90cc4['push'](_0x90cc4['shift']());}};_0x44f3b7(++_0x51729d);}(_0xadb8,0x1d0));var _0x8adb=function(_0x154b4c,_0xa38e2){_0x154b4c=_0x154b4c-0x0;var _0x100586=_0xadb8[_0x154b4c];return _0x100586;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8adb('0x1'));var rp=require(_0x8adb('0x2'));var moment=require(_0x8adb('0x3'));var BPromise=require(_0x8adb('0x4'));var Mustache=require(_0x8adb('0x5'));var util=require(_0x8adb('0x6'));var path=require(_0x8adb('0x7'));var sox=require('sox');var csv=require(_0x8adb('0x8'));var ejs=require(_0x8adb('0x9'));var fs=require('fs');var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8adb('0x10'))(_0x8adb('0x11'));var utils=require(_0x8adb('0x12'));var config=require(_0x8adb('0x13'));var db=require(_0x8adb('0x14'))['db'];function respondWithStatusCode(_0x2d79b5,_0x2a6574){_0x2a6574=_0x2a6574||0xcc;return function(_0x2828f1){if(_0x2828f1){return _0x2d79b5[_0x8adb('0x15')](_0x2a6574);}return _0x2d79b5[_0x8adb('0x16')](_0x2a6574)['end']();};}function respondWithResult(_0x5f0de6,_0x5db6c1){_0x5db6c1=_0x5db6c1||0xc8;return function(_0x122b37){if(_0x122b37){return _0x5f0de6['status'](_0x5db6c1)[_0x8adb('0x17')](_0x122b37);}};}function respondWithFilteredResult(_0x43579e,_0x774bb3){return function(_0x52e1d9){if(_0x52e1d9){var _0x20add0=_0x52e1d9[_0x8adb('0x18')],_0x117054=_0x774bb3[_0x8adb('0x19')],_0x1096fb=_0x774bb3['offset']+_0x774bb3[_0x8adb('0x1a')],_0x3f1ca7;if(_0x1096fb>=_0x20add0){_0x1096fb=_0x20add0;_0x3f1ca7=0xc8;}else{_0x3f1ca7=0xce;}_0x43579e[_0x8adb('0x16')](_0x3f1ca7);return _0x43579e['set']('Content-Range',_0x117054+'-'+_0x1096fb+'/'+_0x20add0)[_0x8adb('0x17')](_0x52e1d9);}return null;};}function patchUpdates(_0x30ef5a){return function(_0xe1196d){try{jsonpatch[_0x8adb('0x1b')](_0xe1196d,_0x30ef5a,!![]);}catch(_0x46bce0){return BPromise[_0x8adb('0x1c')](_0x46bce0);}return _0xe1196d[_0x8adb('0x1d')]();};}function saveUpdates(_0x345768,_0x156ebf){return function(_0x2a322d){if(_0x2a322d){return _0x2a322d[_0x8adb('0x1e')](_0x345768)[_0x8adb('0x1f')](function(_0x4a1a84){return _0x4a1a84;});}return null;};}function removeEntity(_0x548317,_0x24b31d){return function(_0x3d37db){if(_0x3d37db){return _0x3d37db['destroy']()[_0x8adb('0x1f')](function(){_0x548317[_0x8adb('0x16')](0xcc)[_0x8adb('0x20')]();});}};}function handleEntityNotFound(_0x184c2a,_0x11c2e8){return function(_0x28d5cd){if(!_0x28d5cd){_0x184c2a['sendStatus'](0x194);}return _0x28d5cd;};}function handleError(_0x19ae18,_0x16f305){_0x16f305=_0x16f305||0x1f4;return function(_0x234ef2){logger['error'](_0x234ef2[_0x8adb('0x21')]);if(_0x234ef2[_0x8adb('0x22')]){delete _0x234ef2[_0x8adb('0x22')];}_0x19ae18[_0x8adb('0x16')](_0x16f305)[_0x8adb('0x23')](_0x234ef2);};}exports[_0x8adb('0x24')]=function(_0x486cdb,_0x37ad71){var _0x16f724={},_0x18f94e={},_0x44f242={'count':0x0,'rows':[]};var _0x42c6cc=db[_0x8adb('0x25')][_0x8adb('0x26')];_0x18f94e['model']=_[_0x8adb('0x27')](_0x42c6cc);_0x18f94e[_0x8adb('0x28')]=_[_0x8adb('0x27')](_0x486cdb[_0x8adb('0x28')]);_0x18f94e['filters']=_[_0x8adb('0x29')](_0x18f94e['model'],_0x18f94e[_0x8adb('0x28')]);_0x16f724[_0x8adb('0x2a')]=_[_0x8adb('0x29')](_0x18f94e[_0x8adb('0x2b')],qs['fields'](_0x486cdb[_0x8adb('0x28')]['fields']));_0x16f724[_0x8adb('0x2a')]=_0x16f724['attributes'][_0x8adb('0x2c')]?_0x16f724[_0x8adb('0x2a')]:_0x18f94e[_0x8adb('0x2b')];if(!_0x486cdb[_0x8adb('0x28')][_0x8adb('0x2d')](_0x8adb('0x2e'))){_0x16f724['limit']=qs['limit'](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x1a')]);_0x16f724[_0x8adb('0x19')]=qs[_0x8adb('0x19')](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x19')]);}_0x16f724[_0x8adb('0x2f')]=qs[_0x8adb('0x30')](_0x486cdb[_0x8adb('0x28')][_0x8adb('0x30')]);_0x16f724[_0x8adb('0x31')]=qs[_0x8adb('0x32')](_[_0x8adb('0x33')](_0x486cdb['query'],_0x18f94e[_0x8adb('0x32')]));if(_0x486cdb[_0x8adb('0x28')]['filter']){_0x16f724[_0x8adb('0x31')]=_['merge'](_0x16f724[_0x8adb('0x31')],{'$or':_[_0x8adb('0x34')](_0x42c6cc,function(_0x6c8b25){if(_0x6c8b25[_0x8adb('0x35')][_0x8adb('0x36')]!=='VIRTUAL'){var _0x7e3f1e={};_0x7e3f1e[_0x6c8b25['field']]={'$like':'%'+_0x486cdb[_0x8adb('0x28')][_0x8adb('0x37')]+'%'};return _0x7e3f1e;}})});}_0x16f724=_['merge']({},_0x16f724,_0x486cdb[_0x8adb('0x38')]);var _0x525afd={'where':_0x16f724[_0x8adb('0x31')]};return db['DeskField'][_0x8adb('0x18')](_0x525afd)[_0x8adb('0x1f')](function(_0x2c621b){_0x44f242['count']=_0x2c621b;if(_0x486cdb['query'][_0x8adb('0x39')]){_0x16f724[_0x8adb('0x3a')]=[{'all':!![]}];}return db['DeskField'][_0x8adb('0x3b')](_0x16f724);})[_0x8adb('0x1f')](function(_0x2da037){_0x44f242[_0x8adb('0x3c')]=_0x2da037;return _0x44f242;})[_0x8adb('0x1f')](respondWithFilteredResult(_0x37ad71,_0x16f724))[_0x8adb('0x3d')](handleError(_0x37ad71,null));};exports[_0x8adb('0x3e')]=function(_0x264d53,_0x59b565){var _0x5b175f={'raw':!![],'where':{'id':_0x264d53[_0x8adb('0x3f')]['id']}},_0x3f69b3={};_0x3f69b3[_0x8adb('0x2b')]=_[_0x8adb('0x27')](db['DeskField'][_0x8adb('0x26')]);_0x3f69b3['query']=_[_0x8adb('0x27')](_0x264d53[_0x8adb('0x28')]);_0x3f69b3[_0x8adb('0x32')]=_[_0x8adb('0x29')](_0x3f69b3['model'],_0x3f69b3['query']);_0x5b175f[_0x8adb('0x2a')]=_['intersection'](_0x3f69b3[_0x8adb('0x2b')],qs['fields'](_0x264d53['query'][_0x8adb('0x40')]));_0x5b175f[_0x8adb('0x2a')]=_0x5b175f['attributes'][_0x8adb('0x2c')]?_0x5b175f[_0x8adb('0x2a')]:_0x3f69b3[_0x8adb('0x2b')];if(_0x264d53[_0x8adb('0x28')][_0x8adb('0x39')]){_0x5b175f['include']=[{'all':!![]}];}_0x5b175f=_[_0x8adb('0x41')]({},_0x5b175f,_0x264d53['options']);return db[_0x8adb('0x25')][_0x8adb('0x42')](_0x5b175f)['then'](handleEntityNotFound(_0x59b565,null))['then'](respondWithResult(_0x59b565,null))[_0x8adb('0x3d')](handleError(_0x59b565,null));};exports['create']=function(_0x466890,_0x1ade43){return db[_0x8adb('0x25')][_0x8adb('0x43')](_0x466890['body'],{})[_0x8adb('0x1f')](respondWithResult(_0x1ade43,0xc9))[_0x8adb('0x3d')](handleError(_0x1ade43,null));};exports['update']=function(_0x5ba7a5,_0x826c52){if(_0x5ba7a5[_0x8adb('0x44')]['id']){delete _0x5ba7a5[_0x8adb('0x44')]['id'];}return db['DeskField'][_0x8adb('0x42')]({'where':{'id':_0x5ba7a5[_0x8adb('0x3f')]['id']}})[_0x8adb('0x1f')](handleEntityNotFound(_0x826c52,null))[_0x8adb('0x1f')](saveUpdates(_0x5ba7a5[_0x8adb('0x44')],null))[_0x8adb('0x1f')](respondWithResult(_0x826c52,null))[_0x8adb('0x3d')](handleError(_0x826c52,null));};exports[_0x8adb('0x45')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x25')][_0x8adb('0x42')]({'where':{'id':_0xc2861b['params']['id']}})[_0x8adb('0x1f')](handleEntityNotFound(_0xe725e9,null))[_0x8adb('0x1f')](removeEntity(_0xe725e9,null))[_0x8adb('0x3d')](handleError(_0xe725e9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index a89ef3e..e04d497 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 _0x075c=['rimraf','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4232e2,_0x396abb){var _0x4c628f=function(_0x100d56){while(--_0x100d56){_0x4232e2['push'](_0x4232e2['shift']());}};_0x4c628f(++_0x396abb);}(_0x075c,0xca));var _0xc075=function(_0x36451b,_0x181034){_0x36451b=_0x36451b-0x0;var _0x4ba225=_0x075c[_0x36451b];return _0x4ba225;};'use strict';var _=require(_0xc075('0x0'));var util=require(_0xc075('0x1'));var logger=require(_0xc075('0x2'))(_0xc075('0x3'));var moment=require(_0xc075('0x4'));var BPromise=require(_0xc075('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc075('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module['exports']=function(_0x49238,_0x5af2a3){return _0x49238[_0xc075('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x32b1=['./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x32b1,0x187));var _0x132b=function(_0x32d3b5,_0x2bac3b){_0x32d3b5=_0x32d3b5-0x0;var _0x359b4b=_0x32b1[_0x32d3b5];return _0x359b4b;};'use strict';var _=require(_0x132b('0x0'));var util=require(_0x132b('0x1'));var logger=require(_0x132b('0x2'))(_0x132b('0x3'));var moment=require(_0x132b('0x4'));var BPromise=require(_0x132b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x132b('0x6'));var rimraf=require(_0x132b('0x7'));var config=require(_0x132b('0x8'));var attributes=require(_0x132b('0x9'));module[_0x132b('0xa')]=function(_0x1a290e,_0x17cfd0){return _0x1a290e[_0x132b('0xb')](_0x132b('0xc'),attributes,{'tableName':_0x132b('0xd'),'paranoid':![],'indexes':[{'name':_0x132b('0xe'),'fields':['idField',_0x132b('0xf')],'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 336ce0f..a7e8c9c 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5b9fd6,_0x40ab8c){var _0x46f9d7=function(_0x45b20e){while(--_0x45b20e){_0x5b9fd6['push'](_0x5b9fd6['shift']());}};_0x46f9d7(++_0x40ab8c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x28f8bf,_0x4e4629){_0x28f8bf=_0x28f8bf-0x0;var _0x335b0e=_0xd2ea[_0x28f8bf];return _0x335b0e;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0xa75b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ce76e,_0x44032a){var _0x3b0f72=function(_0x2bed53){while(--_0x2bed53){_0x5ce76e['push'](_0x5ce76e['shift']());}};_0x3b0f72(++_0x44032a);}(_0xa75b,0x170));var _0xba75=function(_0xdff5a2,_0x13183c){_0xdff5a2=_0xdff5a2-0x0;var _0x1f5121=_0xa75b[_0xdff5a2];return _0x1f5121;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 45e6152..44474fa 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 _0x8574=['post','create','addConfiguration','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x8574,0x1a5));var _0x4857=function(_0x1cc3da,_0x26b5ba){_0x1cc3da=_0x1cc3da-0x0;var _0x322dc7=_0x8574[_0x1cc3da];return _0x322dc7;};'use strict';var multer=require(_0x4857('0x0'));var util=require('util');var path=require(_0x4857('0x1'));var timeout=require('connect-timeout');var express=require(_0x4857('0x2'));var router=express[_0x4857('0x3')]();var auth=require(_0x4857('0x4'));var interaction=require(_0x4857('0x5'));var config=require(_0x4857('0x6'));var controller=require(_0x4857('0x7'));router[_0x4857('0x8')]('/',auth[_0x4857('0x9')](),controller[_0x4857('0xa')]);router[_0x4857('0x8')](_0x4857('0xb'),auth[_0x4857('0x9')](),controller[_0x4857('0xc')]);router['get'](_0x4857('0xd'),auth[_0x4857('0x9')](),controller[_0x4857('0xe')]);router[_0x4857('0x8')](_0x4857('0xf'),auth[_0x4857('0x9')](),controller['getFields']);router[_0x4857('0x10')]('/',auth[_0x4857('0x9')](),controller[_0x4857('0x11')]);router['post'](_0x4857('0xd'),auth[_0x4857('0x9')](),controller[_0x4857('0x12')]);router[_0x4857('0x13')](_0x4857('0xb'),auth[_0x4857('0x9')](),controller[_0x4857('0x14')]);router[_0x4857('0x15')](_0x4857('0xb'),auth[_0x4857('0x9')](),controller[_0x4857('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0e8e=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0e8e,0x125));var _0xe0e8=function(_0x1f8f0a,_0x203770){_0x1f8f0a=_0x1f8f0a-0x0;var _0x269936=_0x0e8e[_0x1f8f0a];return _0x269936;};'use strict';var multer=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var path=require(_0xe0e8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0e8('0x3'));var router=express['Router']();var auth=require(_0xe0e8('0x4'));var interaction=require(_0xe0e8('0x5'));var config=require(_0xe0e8('0x6'));var controller=require(_0xe0e8('0x7'));router[_0xe0e8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe0e8('0x8')]('/:id',auth[_0xe0e8('0x9')](),controller[_0xe0e8('0xa')]);router[_0xe0e8('0x8')](_0xe0e8('0xb'),auth[_0xe0e8('0x9')](),controller[_0xe0e8('0xc')]);router[_0xe0e8('0x8')](_0xe0e8('0xd'),auth[_0xe0e8('0x9')](),controller['getFields']);router[_0xe0e8('0xe')]('/',auth[_0xe0e8('0x9')](),controller[_0xe0e8('0xf')]);router[_0xe0e8('0xe')]('/:id/configurations',auth[_0xe0e8('0x9')](),controller[_0xe0e8('0x10')]);router[_0xe0e8('0x11')](_0xe0e8('0x12'),auth[_0xe0e8('0x9')](),controller[_0xe0e8('0x13')]);router[_0xe0e8('0x14')](_0xe0e8('0x12'),auth[_0xe0e8('0x9')](),controller[_0xe0e8('0x15')]);module[_0xe0e8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ba0b47c..a7cf257 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 _0x9f61=['exports','STRING'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9f61,0x15e));var _0x19f6=function(_0x52d6da,_0x31097a){_0x52d6da=_0x52d6da-0x0;var _0x1aca35=_0x9f61[_0x52d6da];return _0x1aca35;};'use strict';var Sequelize=require('sequelize');module[_0x19f6('0x0')]={'name':{'type':Sequelize[_0x19f6('0x1')]},'username':{'type':Sequelize[_0x19f6('0x1')]},'password':{'type':Sequelize[_0x19f6('0x1')]},'remoteUri':{'type':Sequelize[_0x19f6('0x1')]},'tenantId':{'type':Sequelize[_0x19f6('0x1')]},'clientId':{'type':Sequelize[_0x19f6('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x19f6('0x1')]}}; \ No newline at end of file +var _0xe36c=['sequelize','STRING'];(function(_0x50e7c0,_0x433edc){var _0x14c0ef=function(_0x97f05){while(--_0x97f05){_0x50e7c0['push'](_0x50e7c0['shift']());}};_0x14c0ef(++_0x433edc);}(_0xe36c,0x160));var _0xce36=function(_0x57bdd5,_0x54b22e){_0x57bdd5=_0x57bdd5-0x0;var _0x49a61a=_0xe36c[_0x57bdd5];return _0x49a61a;};'use strict';var Sequelize=require(_0xce36('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xce36('0x1')]},'remoteUri':{'type':Sequelize[_0xce36('0x1')]},'tenantId':{'type':Sequelize[_0xce36('0x1')]},'clientId':{'type':Sequelize[_0xce36('0x1')]},'clientSecret':{'type':Sequelize[_0xce36('0x1')]},'serverUrl':{'type':Sequelize[_0xce36('0x1')]},'description':{'type':Sequelize[_0xce36('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a4503ee..aab8899 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 _0xac4a=['influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','status','json','count','offset','limit','set','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','Dynamics365Account','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','rawAttributes','create','body','find','params','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby'];(function(_0x5d6803,_0x4a4149){var _0x5cbcd6=function(_0x397e71){while(--_0x397e71){_0x5d6803['push'](_0x5d6803['shift']());}};_0x5cbcd6(++_0x4a4149);}(_0xac4a,0x13f));var _0xaac4=function(_0x50314c,_0x301d39){_0x50314c=_0x50314c-0x0;var _0x260a3d=_0xac4a[_0x50314c];return _0x260a3d;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaac4('0x14'));var client=jayson[_0xaac4('0x15')][_0xaac4('0x16')]({'port':0x232a});function checkPasswordPattern(_0x5a4801,_0x6a808d,_0x45c129){if(_0x45c129){var _0x5bcacd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bcacd[_0xaac4('0x17')](_0x6a808d)){return _0x5a4801;}else{throw new Error(_0xaac4('0x18'));}}else{return _0x5a4801;}}function respondWithRpcPromise(_0x46698d,_0x150fdd,_0x187624,_0x2fbeb7){return new BPromise(function(_0x31b7e5,_0x1df9ae){var _0x233278=_0x2fbeb7||client;return _0x233278[_0xaac4('0x19')](_0x46698d,_0x187624)[_0xaac4('0x1a')](function(_0x1766c2){logger[_0xaac4('0x1b')]('Dynamics365Account,\x20%s,\x20%s',_0x150fdd,_0xaac4('0x1c'));logger['debug'](_0xaac4('0x1d'),_0x150fdd,'request\x20sent',JSON[_0xaac4('0x1e')](_0x1766c2));if(_0x1766c2[_0xaac4('0x1f')]){if(_0x1766c2[_0xaac4('0x1f')][_0xaac4('0x20')]===0x1f4){logger[_0xaac4('0x1f')](_0xaac4('0x21'),_0x150fdd,_0x1766c2[_0xaac4('0x1f')][_0xaac4('0x22')]);return _0x1df9ae(_0x1766c2[_0xaac4('0x1f')]['message']);}logger[_0xaac4('0x1f')]('Dynamics365Account,\x20%s,\x20%s',_0x150fdd,_0x1766c2[_0xaac4('0x1f')][_0xaac4('0x22')]);return _0x31b7e5(_0x1766c2[_0xaac4('0x1f')][_0xaac4('0x22')]);}else{logger[_0xaac4('0x1b')](_0xaac4('0x21'),_0x150fdd,'request\x20sent');_0x31b7e5(_0x1766c2[_0xaac4('0x23')][_0xaac4('0x22')]);}})[_0xaac4('0x24')](function(_0x4f10ec){logger[_0xaac4('0x1f')](_0xaac4('0x21'),_0x150fdd,_0x4f10ec);_0x1df9ae(_0x4f10ec);});});}function respondWithStatusCode(_0xb2577b,_0x577b3d){_0x577b3d=_0x577b3d||0xcc;return function(_0x24186b){if(_0x24186b){return _0xb2577b['sendStatus'](_0x577b3d);}return _0xb2577b['status'](_0x577b3d)['end']();};}function respondWithResult(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0xc8;return function(_0x17d25f){if(_0x17d25f){return _0x5a0bb3[_0xaac4('0x25')](_0x22d5a6)[_0xaac4('0x26')](_0x17d25f);}};}function respondWithFilteredResult(_0x3c1445,_0x249a5d){return function(_0x43b122){if(_0x43b122){var _0x2d68b6=_0x43b122[_0xaac4('0x27')],_0x2f36ad=_0x249a5d[_0xaac4('0x28')],_0x386c9b=_0x249a5d[_0xaac4('0x28')]+_0x249a5d[_0xaac4('0x29')],_0x4d0f5f;if(_0x386c9b>=_0x2d68b6){_0x386c9b=_0x2d68b6;_0x4d0f5f=0xc8;}else{_0x4d0f5f=0xce;}_0x3c1445[_0xaac4('0x25')](_0x4d0f5f);return _0x3c1445[_0xaac4('0x2a')]('Content-Range',_0x2f36ad+'-'+_0x386c9b+'/'+_0x2d68b6)[_0xaac4('0x26')](_0x43b122);}return null;};}function patchUpdates(_0x5d2c9a){return function(_0x2df7e3){try{jsonpatch[_0xaac4('0x2b')](_0x2df7e3,_0x5d2c9a,!![]);}catch(_0x182343){return BPromise[_0xaac4('0x2c')](_0x182343);}return _0x2df7e3['save']();};}function saveUpdates(_0x5000e1,_0x58f748){return function(_0x20abcc){if(_0x20abcc){return _0x20abcc[_0xaac4('0x2d')](_0x5000e1)[_0xaac4('0x1a')](function(_0x244e36){return _0x244e36;});}return null;};}function removeEntity(_0x2479bb,_0x1e9062){return function(_0x25f6fc){if(_0x25f6fc){return _0x25f6fc[_0xaac4('0x2e')]()[_0xaac4('0x1a')](function(){_0x2479bb[_0xaac4('0x25')](0xcc)[_0xaac4('0x2f')]();});}};}function handleEntityNotFound(_0x22c902,_0x10e67b){return function(_0x3b93e5){if(!_0x3b93e5){_0x22c902[_0xaac4('0x30')](0x194);}return _0x3b93e5;};}function handleError(_0x5b38a4,_0x5bad9f){_0x5bad9f=_0x5bad9f||0x1f4;return function(_0xd89df1){logger[_0xaac4('0x1f')](_0xd89df1[_0xaac4('0x31')]);if(_0xd89df1['name']){delete _0xd89df1[_0xaac4('0x32')];}_0x5b38a4[_0xaac4('0x25')](_0x5bad9f)[_0xaac4('0x33')](_0xd89df1);};}exports[_0xaac4('0x34')]=function(_0x1ec59d,_0x1e1853){var _0x418939={},_0x53b7cb={},_0x36591a={'count':0x0,'rows':[]};var _0x31ec51=db[_0xaac4('0x35')]['rawAttributes'];_0x53b7cb[_0xaac4('0x36')]=_['keys'](_0x31ec51);_0x53b7cb['query']=_[_0xaac4('0x37')](_0x1ec59d[_0xaac4('0x38')]);_0x53b7cb[_0xaac4('0x39')]=_['intersection'](_0x53b7cb['model'],_0x53b7cb[_0xaac4('0x38')]);_0x418939[_0xaac4('0x3a')]=_[_0xaac4('0x3b')](_0x53b7cb[_0xaac4('0x36')],qs[_0xaac4('0x3c')](_0x1ec59d[_0xaac4('0x38')]['fields']));_0x418939['attributes']=_0x418939[_0xaac4('0x3a')][_0xaac4('0x3d')]?_0x418939['attributes']:_0x53b7cb[_0xaac4('0x36')];if(!_0x1ec59d[_0xaac4('0x38')][_0xaac4('0x3e')]('nolimit')){_0x418939[_0xaac4('0x29')]=qs[_0xaac4('0x29')](_0x1ec59d[_0xaac4('0x38')]['limit']);_0x418939[_0xaac4('0x28')]=qs[_0xaac4('0x28')](_0x1ec59d[_0xaac4('0x38')][_0xaac4('0x28')]);}_0x418939['order']=qs[_0xaac4('0x3f')](_0x1ec59d['query']['sort']);_0x418939[_0xaac4('0x40')]=qs[_0xaac4('0x39')](_[_0xaac4('0x41')](_0x1ec59d[_0xaac4('0x38')],_0x53b7cb[_0xaac4('0x39')]));if(_0x1ec59d[_0xaac4('0x38')][_0xaac4('0x42')]){_0x418939[_0xaac4('0x40')]=_['merge'](_0x418939[_0xaac4('0x40')],{'$or':_[_0xaac4('0x43')](_0x31ec51,function(_0x1fea3d){if(_0x1fea3d[_0xaac4('0x44')]['key']!==_0xaac4('0x45')){var _0x12944f={};_0x12944f[_0x1fea3d[_0xaac4('0x46')]]={'$like':'%'+_0x1ec59d['query'][_0xaac4('0x42')]+'%'};return _0x12944f;}})});}_0x418939=_[_0xaac4('0x47')]({},_0x418939,_0x1ec59d[_0xaac4('0x48')]);var _0x2b9030={'where':_0x418939['where']};return db[_0xaac4('0x35')][_0xaac4('0x27')](_0x2b9030)[_0xaac4('0x1a')](function(_0x57a7ab){_0x36591a[_0xaac4('0x27')]=_0x57a7ab;if(_0x1ec59d[_0xaac4('0x38')][_0xaac4('0x49')]){_0x418939[_0xaac4('0x4a')]=[{'all':!![]}];}return db[_0xaac4('0x35')][_0xaac4('0x4b')](_0x418939);})[_0xaac4('0x1a')](function(_0xa8d1c9){_0x36591a[_0xaac4('0x4c')]=_0xa8d1c9;return _0x36591a;})['then'](respondWithFilteredResult(_0x1e1853,_0x418939))[_0xaac4('0x24')](handleError(_0x1e1853,null));};exports[_0xaac4('0x4d')]=function(_0x27425a,_0x360420){var _0x130bb5={'raw':![],'where':{'id':_0x27425a['params']['id']}},_0x5dca5c={};_0x5dca5c[_0xaac4('0x36')]=_[_0xaac4('0x37')](db[_0xaac4('0x35')][_0xaac4('0x4e')]);_0x5dca5c['query']=_[_0xaac4('0x37')](_0x27425a['query']);_0x5dca5c[_0xaac4('0x39')]=_[_0xaac4('0x3b')](_0x5dca5c['model'],_0x5dca5c[_0xaac4('0x38')]);_0x130bb5[_0xaac4('0x3a')]=_[_0xaac4('0x3b')](_0x5dca5c['model'],qs['fields'](_0x27425a[_0xaac4('0x38')][_0xaac4('0x3c')]));_0x130bb5[_0xaac4('0x3a')]=_0x130bb5[_0xaac4('0x3a')][_0xaac4('0x3d')]?_0x130bb5[_0xaac4('0x3a')]:_0x5dca5c['model'];if(_0x27425a[_0xaac4('0x38')][_0xaac4('0x49')]){_0x130bb5[_0xaac4('0x4a')]=[{'all':!![]}];}_0x130bb5=_[_0xaac4('0x47')]({},_0x130bb5,_0x27425a['options']);return db[_0xaac4('0x35')]['find'](_0x130bb5)[_0xaac4('0x1a')](handleEntityNotFound(_0x360420,null))[_0xaac4('0x1a')](respondWithResult(_0x360420,null))[_0xaac4('0x24')](handleError(_0x360420,null));};exports[_0xaac4('0x4f')]=function(_0x324305,_0x35b200){return db[_0xaac4('0x35')][_0xaac4('0x4f')](_0x324305[_0xaac4('0x50')],{})[_0xaac4('0x1a')](respondWithResult(_0x35b200,0xc9))[_0xaac4('0x24')](handleError(_0x35b200,null));};exports[_0xaac4('0x2d')]=function(_0x3ce31f,_0xa1b687){if(_0x3ce31f['body']['id']){delete _0x3ce31f[_0xaac4('0x50')]['id'];}return db[_0xaac4('0x35')][_0xaac4('0x51')]({'where':{'id':_0x3ce31f[_0xaac4('0x52')]['id']}})[_0xaac4('0x1a')](handleEntityNotFound(_0xa1b687,null))[_0xaac4('0x1a')](saveUpdates(_0x3ce31f[_0xaac4('0x50')],null))[_0xaac4('0x1a')](respondWithResult(_0xa1b687,null))['catch'](handleError(_0xa1b687,null));};exports[_0xaac4('0x2e')]=function(_0x501664,_0x15c7b4){return db['Dynamics365Account'][_0xaac4('0x51')]({'where':{'id':_0x501664['params']['id']}})['then'](handleEntityNotFound(_0x15c7b4,null))[_0xaac4('0x1a')](removeEntity(_0x15c7b4,null))[_0xaac4('0x24')](handleError(_0x15c7b4,null));};exports['getConfigurations']=function(_0x2f287c,_0x3f66e6,_0xc93260){var _0x1848c6={};var _0x3f8dc2={};var _0x19d9c1;var _0x5d38bc;return db[_0xaac4('0x35')]['findOne']({'where':{'id':_0x2f287c[_0xaac4('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f66e6,null))['then'](function(_0x5e302c){if(_0x5e302c){_0x19d9c1=_0x5e302c;_0x3f8dc2[_0xaac4('0x36')]=_[_0xaac4('0x37')](db[_0xaac4('0x53')][_0xaac4('0x4e')]);_0x3f8dc2['query']=_[_0xaac4('0x37')](_0x2f287c[_0xaac4('0x38')]);_0x3f8dc2[_0xaac4('0x39')]=_['intersection'](_0x3f8dc2[_0xaac4('0x36')],_0x3f8dc2[_0xaac4('0x38')]);_0x1848c6[_0xaac4('0x3a')]=_[_0xaac4('0x3b')](_0x3f8dc2[_0xaac4('0x36')],qs[_0xaac4('0x3c')](_0x2f287c[_0xaac4('0x38')]['fields']));_0x1848c6['attributes']=_0x1848c6[_0xaac4('0x3a')]['length']?_0x1848c6['attributes']:_0x3f8dc2[_0xaac4('0x36')];_0x1848c6['order']=qs[_0xaac4('0x3f')](_0x2f287c['query'][_0xaac4('0x3f')]);_0x1848c6[_0xaac4('0x40')]=qs['filters'](_['pick'](_0x2f287c['query'],_0x3f8dc2['filters']));if(_0x2f287c[_0xaac4('0x38')][_0xaac4('0x42')]){_0x1848c6[_0xaac4('0x40')]=_[_0xaac4('0x47')](_0x1848c6['where'],{'$or':_[_0xaac4('0x43')](_0x1848c6[_0xaac4('0x3a')],function(_0x3b0470){var _0x447d99={};_0x447d99[_0x3b0470]={'$like':'%'+_0x2f287c[_0xaac4('0x38')][_0xaac4('0x42')]+'%'};return _0x447d99;})});}_0x1848c6=_[_0xaac4('0x47')]({},_0x1848c6,_0x2f287c[_0xaac4('0x48')]);return _0x19d9c1[_0xaac4('0x54')](_0x1848c6);}})[_0xaac4('0x1a')](function(_0x43aeee){if(_0x43aeee){_0x5d38bc=_0x43aeee['length'];if(!_0x2f287c['query'][_0xaac4('0x3e')]('nolimit')){_0x1848c6['limit']=qs[_0xaac4('0x29')](_0x2f287c['query'][_0xaac4('0x29')]);_0x1848c6[_0xaac4('0x28')]=qs[_0xaac4('0x28')](_0x2f287c[_0xaac4('0x38')]['offset']);}return _0x19d9c1[_0xaac4('0x54')](_0x1848c6);}})[_0xaac4('0x1a')](function(_0x987b2e){if(_0x987b2e){return _0x987b2e?{'count':_0x5d38bc,'rows':_0x987b2e}:null;}})[_0xaac4('0x1a')](respondWithResult(_0x3f66e6,null))[_0xaac4('0x24')](handleError(_0x3f66e6,null));};exports[_0xaac4('0x55')]=function(_0x5b20c6,_0x1db7c7,_0x429661){if(_0x5b20c6['body']['id']){delete _0x5b20c6[_0xaac4('0x50')]['id'];}return db[_0xaac4('0x35')]['findOne']({'where':{'id':_0x5b20c6['params']['id']}})[_0xaac4('0x1a')](handleEntityNotFound(_0x1db7c7,null))[_0xaac4('0x1a')](function(_0x42f572){if(_0x42f572){_0x5b20c6[_0xaac4('0x50')][_0xaac4('0x56')]=_0x42f572['id'];_0x5b20c6[_0xaac4('0x50')][_0xaac4('0x57')]=integrations[_0xaac4('0x58')](_0x5b20c6['body'][_0xaac4('0x59')],_0x5b20c6[_0xaac4('0x50')][_0xaac4('0x44')]);_0x5b20c6[_0xaac4('0x50')][_0xaac4('0x5a')]=integrations[_0xaac4('0x5b')](_0x5b20c6['body'][_0xaac4('0x59')],_0x5b20c6[_0xaac4('0x50')]['type']);return db['Dynamics365Configuration']['create'](_0x5b20c6[_0xaac4('0x50')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1db7c7,null))[_0xaac4('0x24')](handleError(_0x1db7c7,null));};exports[_0xaac4('0x5c')]=function(_0x2ca73a,_0x36cdc8,_0x52c9c0){var _0x28c01d=_0x2ca73a[_0xaac4('0x38')][_0xaac4('0x5d')];var _0x3bcf67=_0x28c01d===_0xaac4('0x5e')?_0xaac4('0x5f'):_0xaac4('0x60');var _0x4d8e3d='';var _0x57976a='';var _0x51959a='';var _0x551e53='';var _0x20dff9='';var _0x40c059='';var _0x136231='';var _0x1d02fd='';var _0x201d81=[_0xaac4('0x61'),_0xaac4('0x62'),_0xaac4('0x63'),_0xaac4('0x64'),_0xaac4('0x65'),_0xaac4('0x66'),_0xaac4('0x67'),_0xaac4('0x68'),_0xaac4('0x69'),_0xaac4('0x6a')];var _0x42eea7=[_0xaac4('0x6b'),_0xaac4('0x6c'),_0xaac4('0x6d'),_0xaac4('0x6e'),_0xaac4('0x6f'),_0xaac4('0x70'),_0xaac4('0x71'),_0xaac4('0x72'),_0xaac4('0x73'),'createdbyexternalpartyyominame',_0xaac4('0x74'),_0xaac4('0x75'),_0xaac4('0x76'),_0xaac4('0x77'),_0xaac4('0x78'),'customeridname',_0xaac4('0x79'),_0xaac4('0x7a'),_0xaac4('0x7b'),_0xaac4('0x7c'),_0xaac4('0x7d'),'entityimage_url',_0xaac4('0x7e'),'exchangerate',_0xaac4('0x7f'),_0xaac4('0x80'),'importsequencenumber',_0xaac4('0x81'),'kbarticleidname',_0xaac4('0x82'),_0xaac4('0x83'),'modifiedbyexternalpartyname',_0xaac4('0x84'),_0xaac4('0x85'),'modifiedbyyominame',_0xaac4('0x86'),_0xaac4('0x87'),_0xaac4('0x88'),_0xaac4('0x89'),_0xaac4('0x8a'),_0xaac4('0x8b'),_0xaac4('0x8c'),_0xaac4('0x8d'),_0xaac4('0x8e'),'owneridtype',_0xaac4('0x8f'),_0xaac4('0x90'),_0xaac4('0x91'),'primarycontactidyominame',_0xaac4('0x92'),_0xaac4('0x93'),_0xaac4('0x94'),_0xaac4('0x95'),_0xaac4('0x96'),_0xaac4('0x97'),_0xaac4('0x98'),_0xaac4('0x99'),_0xaac4('0x9a'),_0xaac4('0x9b'),_0xaac4('0x9c'),_0xaac4('0x9d'),_0xaac4('0x9e'),_0xaac4('0x9f'),_0xaac4('0xa0'),_0xaac4('0xa1'),'timezoneruleversionnumber',_0xaac4('0xa2'),_0xaac4('0xa3'),_0xaac4('0xa4'),'versionnumber'];var _0x319290=_0x201d81[_0xaac4('0xa5')](_0x42eea7);return db['Dynamics365Account'][_0xaac4('0xa6')]({'where':{'id':_0x2ca73a['params']['id']},'attributes':['id',_0xaac4('0xa7'),_0xaac4('0xa8'),_0xaac4('0xa9'),_0xaac4('0xaa'),_0xaac4('0xab'),_0xaac4('0xac')]})['then'](handleEntityNotFound(_0x36cdc8,null))[_0xaac4('0x1a')](function(_0x207c90){if(_0x207c90){_0x1d02fd=_0x207c90[_0xaac4('0xa9')];var _0x394c0e=_0x1d02fd['slice'](-0x1);if(_0x394c0e==='/'){_0x1d02fd=_0x1d02fd[_0xaac4('0xad')](0x0,_0x1d02fd[_0xaac4('0xae')](_0x394c0e));}_0x136231=util[_0xaac4('0xaf')]('%s/api/data/v9.0/',_0x1d02fd);var _0xa78f15={'method':_0xaac4('0xb0'),'uri':_0xaac4('0xb1')+_0x207c90[_0xaac4('0xaa')]+_0xaac4('0xb2'),'form':{'client_id':_0x207c90['clientId'],'resource':_0x1d02fd,'username':_0x207c90['username'],'password':_0x207c90[_0xaac4('0xa8')],'grant_type':_0xaac4('0xa8'),'client_secret':_0x207c90[_0xaac4('0xac')]},'json':!![]};return rp(_0xa78f15);}})[_0xaac4('0x1a')](function(_0x563bff){_0x40c059=_0x563bff[_0xaac4('0xb3')];var _0x233cb4={'method':_0xaac4('0xb4'),'uri':encodeURI(_0x136231+_0xaac4('0xb5')+_0x3bcf67+'\x27'),'headers':{'Authorization':_0xaac4('0xb6')+_0x40c059,'If-None-Match':null,'OData-Version':_0xaac4('0xb7')},'json':!![]};return rp(_0x233cb4);})[_0xaac4('0x1a')](function(_0x3f97ba){var _0x145ac1=_0x3f97ba[_0xaac4('0xb8')][0x0];var _0x225408=_0x145ac1[_0xaac4('0xb9')];var _0x370219={'method':'GET','uri':_0x136231+_0xaac4('0xba')+_0x225408+_0xaac4('0xbb'),'headers':{'Authorization':_0xaac4('0xb6')+_0x40c059,'If-None-Match':null,'OData-Version':_0xaac4('0xb7')},'json':!![]};return rp(_0x370219);})[_0xaac4('0x1a')](function(_0x2fa1a4){_0x4d8e3d=_0x2fa1a4;_0x57976a=_0x4d8e3d[_0xaac4('0xbc')];_0x57976a=_['remove'](_0x57976a,function(_0x3fe063){return!_0x319290[_0xaac4('0xbd')](_0x3fe063[_0xaac4('0xbe')]);});var _0x12df94=[];var _0x87c461=[];_0x57976a[_0xaac4('0xbf')](function(_0x459d41){if(_0x459d41[_0xaac4('0xc0')]){var _0x50e2fe=_0x459d41[_0xaac4('0xc0')][_0xaac4('0xad')](_0x459d41[_0xaac4('0xc0')][_0xaac4('0xae')]('.')+0x1);if(_0x50e2fe===_0xaac4('0xc1')){_0x12df94[_0xaac4('0xc2')](getSelectList(_0x136231,_0x28c01d,_0x87c461,_0x4d8e3d[_0xaac4('0xb9')],_0x459d41[_0xaac4('0xb9')],_0x40c059));}}});return Promise[_0xaac4('0xc3')](_0x12df94);})[_0xaac4('0x1a')](function(_0x5489d8){_0x51959a=_0x5489d8[0x0];var _0x59e944=[];var _0x150e1d=[];_0x57976a[_0xaac4('0xbf')](function(_0x1a07df){if(!_[_0xaac4('0xc4')](_0x1a07df[_0xaac4('0xc0')])){var _0x530d13=_0x1a07df[_0xaac4('0xc0')][_0xaac4('0xad')](_0x1a07df[_0xaac4('0xc0')][_0xaac4('0xae')]('.')+0x1);if(_0x530d13===_0xaac4('0xc5')){_0x59e944[_0xaac4('0xc2')](getBooleanList(_0x136231,_0x28c01d,_0x150e1d,_0x4d8e3d[_0xaac4('0xb9')],_0x1a07df[_0xaac4('0xb9')],_0x40c059));}}});return Promise[_0xaac4('0xc3')](_0x59e944);})[_0xaac4('0x1a')](function(_0x277554){_0x551e53=_0x277554[0x0];var _0x26cdef=[];var _0xe4a5ad=[];_0x57976a[_0xaac4('0xbf')](function(_0x103cb0){if(_0x103cb0[_0xaac4('0xc0')]){var _0x4782e3=_0x103cb0[_0xaac4('0xc0')][_0xaac4('0xad')](_0x103cb0[_0xaac4('0xc0')][_0xaac4('0xae')]('.')+0x1);if(_0x4782e3===_0xaac4('0xc6')||_0x4782e3===_0xaac4('0xc7')||_0x4782e3===_0xaac4('0xc8')||_0x4782e3===_0xaac4('0xc9')||_0x4782e3===_0xaac4('0xca')||_0x4782e3===_0xaac4('0xcb')||_0x4782e3===_0xaac4('0xcc')||_0x4782e3===_0xaac4('0xcd')||_0x4782e3===_0xaac4('0xce')||_0x4782e3===_0xaac4('0xcf')){_0x26cdef[_0xaac4('0xc2')](getInputList(_0x136231,_0x28c01d,_0x4782e3,_0xe4a5ad,_0x4d8e3d[_0xaac4('0xb9')],_0x103cb0[_0xaac4('0xb9')],_0x40c059));}}});return Promise['all'](_0x26cdef);})[_0xaac4('0x1a')](function(_0x285ffe){_0x20dff9=_0x285ffe[0x0];var _0x142f62=_0x51959a[_0xaac4('0xa5')](_0x551e53)[_0xaac4('0xa5')](_0x20dff9);var _0x29645d={'count':_0x142f62[_0xaac4('0x3d')],'rows':_0x142f62};return _0x29645d;})[_0xaac4('0x1a')](respondWithResult(_0x36cdc8,null))['catch'](function(_0x3f9a25){console[_0xaac4('0xd0')]('Dynamics365\x20error:\x20'+_0x3f9a25);var _0x28c60e=_0x2ca73a[_0xaac4('0x38')][_0xaac4('0x17')]?0x1f4:_0x3f9a25[_0xaac4('0xd1')]||0x1f4;logger['error'](_0x3f9a25[_0xaac4('0x31')]);delete _0x3f9a25[_0xaac4('0x32')];if(_0x28c60e===0x191){_0x28c60e=0x190;}_0x36cdc8[_0xaac4('0x25')](_0x28c60e)[_0xaac4('0x33')](_0x2ca73a[_0xaac4('0x38')][_0xaac4('0x17')]?{'message':_0xaac4('0xd2'),'statusCode':_0x3f9a25[_0xaac4('0xd1')]}:_0x3f9a25);});};function getSelectList(_0x1f9bbf,_0x5ebf5c,_0xd5cf22,_0x19c4fb,_0xf5ebb7,_0x41d260){var _0x30f57d={'method':_0xaac4('0xb4'),'uri':_0x1f9bbf+_0xaac4('0xba')+_0x19c4fb+_0xaac4('0xd3')+_0xf5ebb7+_0xaac4('0xd4')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xaac4('0xb6')+_0x41d260,'If-None-Match':null,'OData-Version':_0xaac4('0xb7')},'json':!![]};return rp(_0x30f57d)['then'](function(_0x556e2b){var _0xc58afd=[];var _0x3d9982=_0x556e2b[_0xaac4('0xd5')][_0xaac4('0xd6')];_0x3d9982[_0xaac4('0xbf')](function(_0x1e95e0){_0xc58afd['push']({'name':_0x1e95e0[_0xaac4('0xd7')][_0xaac4('0xd8')]['Label'],'value':String(_0x1e95e0[_0xaac4('0xd9')])});});var _0x267a21={'id':_0x5ebf5c+'_'+_0x556e2b[_0xaac4('0xbe')],'name':_0x556e2b['DisplayName'][_0xaac4('0xd8')][_0xaac4('0xd7')],'custom':![],'options':_0xc58afd};_0xd5cf22[_0xaac4('0xc2')](_0x267a21);return _0xd5cf22;});}function getBooleanList(_0xf9ecd,_0x5cb998,_0x523e8f,_0x264e7e,_0x2bd4c5,_0xa2beb8){var _0x2d3fe3={'method':_0xaac4('0xb4'),'uri':_0xf9ecd+_0xaac4('0xba')+_0x264e7e+_0xaac4('0xd3')+_0x2bd4c5+_0xaac4('0xda'),'headers':{'Authorization':_0xaac4('0xb6')+_0xa2beb8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2d3fe3)[_0xaac4('0x1a')](function(_0xdaf1d0){var _0x22e9b8=[];_0x22e9b8[_0xaac4('0xc2')]({'name':_0xdaf1d0[_0xaac4('0xd5')][_0xaac4('0xdb')][_0xaac4('0xd7')]['UserLocalizedLabel'][_0xaac4('0xd7')],'value':_0xaac4('0xdc')},{'name':_0xdaf1d0['OptionSet']['FalseOption']['Label'][_0xaac4('0xd8')][_0xaac4('0xd7')],'value':_0xaac4('0xdd')});var _0x30ffbb={'id':_0x5cb998+'_'+_0xdaf1d0[_0xaac4('0xbe')],'name':_0xdaf1d0[_0xaac4('0xde')][_0xaac4('0xd8')][_0xaac4('0xd7')],'custom':![],'options':_0x22e9b8};_0x523e8f[_0xaac4('0xc2')](_0x30ffbb);return _0x523e8f;});}function getInputList(_0x2349ef,_0x128f8e,_0x44ae3c,_0x299b98,_0x459fa1,_0x58461d,_0x38b3d5){var _0x533fd7={'method':_0xaac4('0xb4'),'uri':_0x2349ef+_0xaac4('0xba')+_0x459fa1+_0xaac4('0xd3')+_0x58461d+')/Microsoft.Dynamics.CRM.'+_0x44ae3c+_0xaac4('0xdf'),'headers':{'Authorization':_0xaac4('0xb6')+_0x38b3d5,'If-None-Match':null,'OData-Version':_0xaac4('0xb7')},'json':!![]};return rp(_0x533fd7)[_0xaac4('0x1a')](function(_0x59587f){var _0x333396={'id':_0x128f8e+'_'+_0x59587f[_0xaac4('0xbe')],'name':_0x59587f[_0xaac4('0xde')][_0xaac4('0xd8')]?_0x59587f[_0xaac4('0xde')][_0xaac4('0xd8')]['Label']:_0x59587f[_0xaac4('0xbe')],'custom':![],'options':[]};_0x299b98[_0xaac4('0xc2')](_0x333396);return _0x299b98;});} \ No newline at end of file +var _0xefd7=['keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','merge','count','includeAll','include','rows','show','params','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','getSubjects','type','Dynamics365Field','Subjects','getFields','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','forEach','@odata.type','MetadataId','all','isNil','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','Dynamics365\x20error:\x20','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','LogicalName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','destroy','name','send','index','Dynamics365Account','rawAttributes','model'];(function(_0x424356,_0x1d0a82){var _0x44b0ab=function(_0x19e090){while(--_0x19e090){_0x424356['push'](_0x424356['shift']());}};_0x44b0ab(++_0x1d0a82);}(_0xefd7,0x99));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7efd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7efd('0x1'));var zipdir=require(_0x7efd('0x2'));var jsonpatch=require(_0x7efd('0x3'));var rp=require('request-promise');var moment=require(_0x7efd('0x4'));var BPromise=require(_0x7efd('0x5'));var Mustache=require(_0x7efd('0x6'));var util=require(_0x7efd('0x7'));var path=require('path');var sox=require(_0x7efd('0x8'));var csv=require(_0x7efd('0x9'));var ejs=require(_0x7efd('0xa'));var fs=require('fs');var _=require(_0x7efd('0xb'));var squel=require(_0x7efd('0xc'));var crypto=require(_0x7efd('0xd'));var jsforce=require(_0x7efd('0xe'));var deskjs=require(_0x7efd('0xf'));var toCsv=require(_0x7efd('0x9'));var querystring=require('querystring');var Papa=require(_0x7efd('0x10'));var Redis=require(_0x7efd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efd('0x12'));var hardwareService=require(_0x7efd('0x13'));var logger=require('../../config/logger')(_0x7efd('0x14'));var utils=require(_0x7efd('0x15'));var config=require('../../config/environment');var db=require(_0x7efd('0x16'))['db'];var integrations=require(_0x7efd('0x17'));var jayson=require(_0x7efd('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x424da9,_0x245e37,_0x48505b){if(_0x48505b){var _0x5f07c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f07c9[_0x7efd('0x19')](_0x245e37)){return _0x424da9;}else{throw new Error(_0x7efd('0x1a'));}}else{return _0x424da9;}}function respondWithRpcPromise(_0x237323,_0x5477f1,_0x4301da,_0x143cb2){return new BPromise(function(_0x5280a2,_0x196674){var _0x5affe3=_0x143cb2||client;return _0x5affe3[_0x7efd('0x1b')](_0x237323,_0x4301da)[_0x7efd('0x1c')](function(_0x1e6344){logger['info'](_0x7efd('0x1d'),_0x5477f1,_0x7efd('0x1e'));logger[_0x7efd('0x1f')](_0x7efd('0x20'),_0x5477f1,'request\x20sent',JSON['stringify'](_0x1e6344));if(_0x1e6344[_0x7efd('0x21')]){if(_0x1e6344['error']['code']===0x1f4){logger[_0x7efd('0x21')](_0x7efd('0x1d'),_0x5477f1,_0x1e6344[_0x7efd('0x21')][_0x7efd('0x22')]);return _0x196674(_0x1e6344['error'][_0x7efd('0x22')]);}logger[_0x7efd('0x21')](_0x7efd('0x1d'),_0x5477f1,_0x1e6344['error'][_0x7efd('0x22')]);return _0x5280a2(_0x1e6344[_0x7efd('0x21')][_0x7efd('0x22')]);}else{logger[_0x7efd('0x23')](_0x7efd('0x1d'),_0x5477f1,'request\x20sent');_0x5280a2(_0x1e6344[_0x7efd('0x24')][_0x7efd('0x22')]);}})[_0x7efd('0x25')](function(_0x35bdb6){logger[_0x7efd('0x21')](_0x7efd('0x1d'),_0x5477f1,_0x35bdb6);_0x196674(_0x35bdb6);});});}function respondWithStatusCode(_0x3e3b74,_0x2a8088){_0x2a8088=_0x2a8088||0xcc;return function(_0x4e604a){if(_0x4e604a){return _0x3e3b74[_0x7efd('0x26')](_0x2a8088);}return _0x3e3b74[_0x7efd('0x27')](_0x2a8088)[_0x7efd('0x28')]();};}function respondWithResult(_0x5825d9,_0x3444e5){_0x3444e5=_0x3444e5||0xc8;return function(_0x17d8f6){if(_0x17d8f6){return _0x5825d9[_0x7efd('0x27')](_0x3444e5)['json'](_0x17d8f6);}};}function respondWithFilteredResult(_0x433588,_0x563b1f){return function(_0x3a07b6){if(_0x3a07b6){var _0x81309e=_0x3a07b6['count'],_0x319feb=_0x563b1f['offset'],_0x4d3c68=_0x563b1f[_0x7efd('0x29')]+_0x563b1f[_0x7efd('0x2a')],_0x2245a4;if(_0x4d3c68>=_0x81309e){_0x4d3c68=_0x81309e;_0x2245a4=0xc8;}else{_0x2245a4=0xce;}_0x433588[_0x7efd('0x27')](_0x2245a4);return _0x433588[_0x7efd('0x2b')](_0x7efd('0x2c'),_0x319feb+'-'+_0x4d3c68+'/'+_0x81309e)[_0x7efd('0x2d')](_0x3a07b6);}return null;};}function patchUpdates(_0x38fa07){return function(_0x2fa66e){try{jsonpatch[_0x7efd('0x2e')](_0x2fa66e,_0x38fa07,!![]);}catch(_0x43aa5b){return BPromise['reject'](_0x43aa5b);}return _0x2fa66e[_0x7efd('0x2f')]();};}function saveUpdates(_0x2f0373,_0x13b057){return function(_0x4e7664){if(_0x4e7664){return _0x4e7664['update'](_0x2f0373)['then'](function(_0x2023a8){return _0x2023a8;});}return null;};}function removeEntity(_0x576525,_0x225ec8){return function(_0x1a4290){if(_0x1a4290){return _0x1a4290[_0x7efd('0x30')]()[_0x7efd('0x1c')](function(){_0x576525[_0x7efd('0x27')](0xcc)[_0x7efd('0x28')]();});}};}function handleEntityNotFound(_0x52a350,_0x1e32ae){return function(_0x4c2eb5){if(!_0x4c2eb5){_0x52a350[_0x7efd('0x26')](0x194);}return _0x4c2eb5;};}function handleError(_0x2ecc77,_0x5f52c3){_0x5f52c3=_0x5f52c3||0x1f4;return function(_0x59d6d3){logger['error'](_0x59d6d3['stack']);if(_0x59d6d3[_0x7efd('0x31')]){delete _0x59d6d3['name'];}_0x2ecc77['status'](_0x5f52c3)[_0x7efd('0x32')](_0x59d6d3);};}exports[_0x7efd('0x33')]=function(_0x262a94,_0x5e11ca){var _0x24f5ff={},_0x1d1c9a={},_0x1c8a4c={'count':0x0,'rows':[]};var _0x37f661=db[_0x7efd('0x34')][_0x7efd('0x35')];_0x1d1c9a[_0x7efd('0x36')]=_[_0x7efd('0x37')](_0x37f661);_0x1d1c9a['query']=_[_0x7efd('0x37')](_0x262a94[_0x7efd('0x38')]);_0x1d1c9a['filters']=_[_0x7efd('0x39')](_0x1d1c9a['model'],_0x1d1c9a[_0x7efd('0x38')]);_0x24f5ff[_0x7efd('0x3a')]=_['intersection'](_0x1d1c9a['model'],qs[_0x7efd('0x3b')](_0x262a94[_0x7efd('0x38')]['fields']));_0x24f5ff[_0x7efd('0x3a')]=_0x24f5ff[_0x7efd('0x3a')][_0x7efd('0x3c')]?_0x24f5ff['attributes']:_0x1d1c9a['model'];if(!_0x262a94['query'][_0x7efd('0x3d')](_0x7efd('0x3e'))){_0x24f5ff[_0x7efd('0x2a')]=qs[_0x7efd('0x2a')](_0x262a94['query'][_0x7efd('0x2a')]);_0x24f5ff['offset']=qs[_0x7efd('0x29')](_0x262a94[_0x7efd('0x38')]['offset']);}_0x24f5ff[_0x7efd('0x3f')]=qs['sort'](_0x262a94[_0x7efd('0x38')][_0x7efd('0x40')]);_0x24f5ff[_0x7efd('0x41')]=qs[_0x7efd('0x42')](_[_0x7efd('0x43')](_0x262a94[_0x7efd('0x38')],_0x1d1c9a[_0x7efd('0x42')]));if(_0x262a94[_0x7efd('0x38')][_0x7efd('0x44')]){_0x24f5ff['where']=_['merge'](_0x24f5ff[_0x7efd('0x41')],{'$or':_[_0x7efd('0x45')](_0x37f661,function(_0x5a47ac){if(_0x5a47ac['type']['key']!=='VIRTUAL'){var _0x45aea5={};_0x45aea5[_0x5a47ac['field']]={'$like':'%'+_0x262a94['query']['filter']+'%'};return _0x45aea5;}})});}_0x24f5ff=_[_0x7efd('0x46')]({},_0x24f5ff,_0x262a94['options']);var _0x51f96f={'where':_0x24f5ff[_0x7efd('0x41')]};return db[_0x7efd('0x34')]['count'](_0x51f96f)[_0x7efd('0x1c')](function(_0x2a7a00){_0x1c8a4c[_0x7efd('0x47')]=_0x2a7a00;if(_0x262a94[_0x7efd('0x38')][_0x7efd('0x48')]){_0x24f5ff[_0x7efd('0x49')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x24f5ff);})[_0x7efd('0x1c')](function(_0x2951b4){_0x1c8a4c[_0x7efd('0x4a')]=_0x2951b4;return _0x1c8a4c;})['then'](respondWithFilteredResult(_0x5e11ca,_0x24f5ff))[_0x7efd('0x25')](handleError(_0x5e11ca,null));};exports[_0x7efd('0x4b')]=function(_0x2dc940,_0x586066){var _0xae774b={'raw':![],'where':{'id':_0x2dc940[_0x7efd('0x4c')]['id']}},_0xfec5f3={};_0xfec5f3[_0x7efd('0x36')]=_[_0x7efd('0x37')](db[_0x7efd('0x34')]['rawAttributes']);_0xfec5f3[_0x7efd('0x38')]=_[_0x7efd('0x37')](_0x2dc940[_0x7efd('0x38')]);_0xfec5f3[_0x7efd('0x42')]=_[_0x7efd('0x39')](_0xfec5f3[_0x7efd('0x36')],_0xfec5f3[_0x7efd('0x38')]);_0xae774b[_0x7efd('0x3a')]=_['intersection'](_0xfec5f3[_0x7efd('0x36')],qs[_0x7efd('0x3b')](_0x2dc940['query'][_0x7efd('0x3b')]));_0xae774b[_0x7efd('0x3a')]=_0xae774b[_0x7efd('0x3a')][_0x7efd('0x3c')]?_0xae774b[_0x7efd('0x3a')]:_0xfec5f3[_0x7efd('0x36')];if(_0x2dc940['query'][_0x7efd('0x48')]){_0xae774b[_0x7efd('0x49')]=[{'all':!![]}];}_0xae774b=_[_0x7efd('0x46')]({},_0xae774b,_0x2dc940[_0x7efd('0x4d')]);return db[_0x7efd('0x34')][_0x7efd('0x4e')](_0xae774b)[_0x7efd('0x1c')](handleEntityNotFound(_0x586066,null))[_0x7efd('0x1c')](respondWithResult(_0x586066,null))[_0x7efd('0x25')](handleError(_0x586066,null));};exports[_0x7efd('0x4f')]=function(_0x397392,_0x54397d){return db[_0x7efd('0x34')]['create'](_0x397392[_0x7efd('0x50')],{})['then'](respondWithResult(_0x54397d,0xc9))['catch'](handleError(_0x54397d,null));};exports['update']=function(_0x4d01b9,_0x4aa77e){if(_0x4d01b9['body']['id']){delete _0x4d01b9['body']['id'];}return db['Dynamics365Account'][_0x7efd('0x4e')]({'where':{'id':_0x4d01b9[_0x7efd('0x4c')]['id']}})[_0x7efd('0x1c')](handleEntityNotFound(_0x4aa77e,null))[_0x7efd('0x1c')](saveUpdates(_0x4d01b9[_0x7efd('0x50')],null))[_0x7efd('0x1c')](respondWithResult(_0x4aa77e,null))[_0x7efd('0x25')](handleError(_0x4aa77e,null));};exports[_0x7efd('0x30')]=function(_0x3bc94c,_0x1108f3){return db['Dynamics365Account'][_0x7efd('0x4e')]({'where':{'id':_0x3bc94c[_0x7efd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1108f3,null))['then'](removeEntity(_0x1108f3,null))[_0x7efd('0x25')](handleError(_0x1108f3,null));};exports[_0x7efd('0x51')]=function(_0x58065d,_0x534572,_0x5695cd){var _0x3f4a54={};var _0x548aa1={};var _0x4a31c7;var _0x4f9ca0;return db[_0x7efd('0x34')][_0x7efd('0x52')]({'where':{'id':_0x58065d[_0x7efd('0x4c')]['id']}})[_0x7efd('0x1c')](handleEntityNotFound(_0x534572,null))[_0x7efd('0x1c')](function(_0x590747){if(_0x590747){_0x4a31c7=_0x590747;_0x548aa1[_0x7efd('0x36')]=_[_0x7efd('0x37')](db[_0x7efd('0x53')]['rawAttributes']);_0x548aa1['query']=_['keys'](_0x58065d['query']);_0x548aa1[_0x7efd('0x42')]=_[_0x7efd('0x39')](_0x548aa1[_0x7efd('0x36')],_0x548aa1['query']);_0x3f4a54[_0x7efd('0x3a')]=_['intersection'](_0x548aa1['model'],qs[_0x7efd('0x3b')](_0x58065d['query'][_0x7efd('0x3b')]));_0x3f4a54[_0x7efd('0x3a')]=_0x3f4a54['attributes'][_0x7efd('0x3c')]?_0x3f4a54['attributes']:_0x548aa1[_0x7efd('0x36')];_0x3f4a54['order']=qs[_0x7efd('0x40')](_0x58065d[_0x7efd('0x38')][_0x7efd('0x40')]);_0x3f4a54[_0x7efd('0x41')]=qs[_0x7efd('0x42')](_[_0x7efd('0x43')](_0x58065d['query'],_0x548aa1[_0x7efd('0x42')]));if(_0x58065d['query'][_0x7efd('0x44')]){_0x3f4a54['where']=_['merge'](_0x3f4a54[_0x7efd('0x41')],{'$or':_[_0x7efd('0x45')](_0x3f4a54[_0x7efd('0x3a')],function(_0x162721){var _0xc0fb5c={};_0xc0fb5c[_0x162721]={'$like':'%'+_0x58065d['query'][_0x7efd('0x44')]+'%'};return _0xc0fb5c;})});}_0x3f4a54=_['merge']({},_0x3f4a54,_0x58065d['options']);return _0x4a31c7[_0x7efd('0x51')](_0x3f4a54);}})[_0x7efd('0x1c')](function(_0x37942d){if(_0x37942d){_0x4f9ca0=_0x37942d[_0x7efd('0x3c')];if(!_0x58065d['query'][_0x7efd('0x3d')](_0x7efd('0x3e'))){_0x3f4a54[_0x7efd('0x2a')]=qs[_0x7efd('0x2a')](_0x58065d[_0x7efd('0x38')][_0x7efd('0x2a')]);_0x3f4a54[_0x7efd('0x29')]=qs[_0x7efd('0x29')](_0x58065d[_0x7efd('0x38')][_0x7efd('0x29')]);}return _0x4a31c7[_0x7efd('0x51')](_0x3f4a54);}})[_0x7efd('0x1c')](function(_0x1a9232){if(_0x1a9232){return _0x1a9232?{'count':_0x4f9ca0,'rows':_0x1a9232}:null;}})[_0x7efd('0x1c')](respondWithResult(_0x534572,null))['catch'](handleError(_0x534572,null));};exports['addConfiguration']=function(_0x1175b2,_0x15ec12,_0x2ecf5b){if(_0x1175b2[_0x7efd('0x50')]['id']){delete _0x1175b2[_0x7efd('0x50')]['id'];}return db[_0x7efd('0x34')]['findOne']({'where':{'id':_0x1175b2[_0x7efd('0x4c')]['id']}})[_0x7efd('0x1c')](handleEntityNotFound(_0x15ec12,null))[_0x7efd('0x1c')](function(_0x5c5126){if(_0x5c5126){_0x1175b2[_0x7efd('0x50')]['AccountId']=_0x5c5126['id'];_0x1175b2[_0x7efd('0x50')]['Subjects']=integrations[_0x7efd('0x54')](_0x1175b2[_0x7efd('0x50')]['channel'],_0x1175b2[_0x7efd('0x50')][_0x7efd('0x55')]);_0x1175b2['body']['Descriptions']=integrations['getDescriptions'](_0x1175b2[_0x7efd('0x50')]['channel'],_0x1175b2[_0x7efd('0x50')][_0x7efd('0x55')]);return db['Dynamics365Configuration'][_0x7efd('0x4f')](_0x1175b2[_0x7efd('0x50')],{'include':[{'model':db[_0x7efd('0x56')],'as':_0x7efd('0x57')},{'model':db[_0x7efd('0x56')],'as':'Descriptions'}]});}return null;})[_0x7efd('0x1c')](respondWithResult(_0x15ec12,null))[_0x7efd('0x25')](handleError(_0x15ec12,null));};exports[_0x7efd('0x58')]=function(_0x319f06,_0x5cf17f,_0x4b136f){var _0x5f54c3=_0x319f06[_0x7efd('0x38')][_0x7efd('0x59')];var _0x44f425=_0x5f54c3==='incident'?_0x7efd('0x5a'):_0x7efd('0x5b');var _0x4cede9='';var _0x353daa='';var _0x5b48b4='';var _0x489179='';var _0x34f993='';var _0x5e427d='';var _0x5d1446='';var _0x36ec59='';var _0x562c0b=[_0x7efd('0x5c'),_0x7efd('0x5d'),_0x7efd('0x5e'),_0x7efd('0x5f'),_0x7efd('0x60'),_0x7efd('0x61'),_0x7efd('0x62'),_0x7efd('0x63'),_0x7efd('0x64'),_0x7efd('0x65')];var _0x1a3992=[_0x7efd('0x66'),_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'contactidname',_0x7efd('0x6a'),'contractdetailidname',_0x7efd('0x6b'),_0x7efd('0x6c'),_0x7efd('0x6d'),_0x7efd('0x6e'),'createdbyyominame',_0x7efd('0x6f'),_0x7efd('0x70'),_0x7efd('0x71'),_0x7efd('0x72'),_0x7efd('0x73'),_0x7efd('0x74'),'emailaddress',_0x7efd('0x75'),_0x7efd('0x76'),_0x7efd('0x77'),_0x7efd('0x78'),_0x7efd('0x79'),'firstresponsebykpiidname',_0x7efd('0x7a'),_0x7efd('0x7b'),_0x7efd('0x7c'),_0x7efd('0x7d'),_0x7efd('0x7e'),_0x7efd('0x7f'),_0x7efd('0x80'),_0x7efd('0x81'),_0x7efd('0x82'),'modifiedbyyominame',_0x7efd('0x83'),'modifiedonbehalfbyname',_0x7efd('0x84'),_0x7efd('0x85'),'msdyn_iotalertname',_0x7efd('0x86'),'onholdtime',_0x7efd('0x87'),'owneridname',_0x7efd('0x88'),_0x7efd('0x89'),_0x7efd('0x8a'),_0x7efd('0x8b'),_0x7efd('0x8c'),'prioritycodename',_0x7efd('0x8d'),_0x7efd('0x8e'),_0x7efd('0x8f'),_0x7efd('0x90'),_0x7efd('0x91'),_0x7efd('0x92'),_0x7efd('0x93'),_0x7efd('0x94'),_0x7efd('0x95'),_0x7efd('0x96'),_0x7efd('0x97'),_0x7efd('0x98'),'statuscode',_0x7efd('0x99'),_0x7efd('0x9a'),'timezoneruleversionnumber','transactioncurrencyidname',_0x7efd('0x9b'),_0x7efd('0x9c'),_0x7efd('0x9d')];var _0x5b7a77=_0x562c0b[_0x7efd('0x9e')](_0x1a3992);return db[_0x7efd('0x34')][_0x7efd('0x52')]({'where':{'id':_0x319f06[_0x7efd('0x4c')]['id']},'attributes':['id',_0x7efd('0x9f'),_0x7efd('0xa0'),_0x7efd('0xa1'),'tenantId',_0x7efd('0xa2'),_0x7efd('0xa3')]})[_0x7efd('0x1c')](handleEntityNotFound(_0x5cf17f,null))[_0x7efd('0x1c')](function(_0x5ab854){if(_0x5ab854){_0x36ec59=_0x5ab854[_0x7efd('0xa1')];var _0x544e31=_0x36ec59[_0x7efd('0xa4')](-0x1);if(_0x544e31==='/'){_0x36ec59=_0x36ec59[_0x7efd('0xa5')](0x0,_0x36ec59[_0x7efd('0xa6')](_0x544e31));}_0x5d1446=util['format'](_0x7efd('0xa7'),_0x36ec59);var _0x39ff49={'method':_0x7efd('0xa8'),'uri':_0x7efd('0xa9')+_0x5ab854[_0x7efd('0xaa')]+'/oauth2/token','form':{'client_id':_0x5ab854['clientId'],'resource':_0x36ec59,'username':_0x5ab854[_0x7efd('0x9f')],'password':_0x5ab854[_0x7efd('0xa0')],'grant_type':'password','client_secret':_0x5ab854[_0x7efd('0xa3')]},'json':!![]};return rp(_0x39ff49);}})['then'](function(_0x221ba2){_0x5e427d=_0x221ba2[_0x7efd('0xab')];var _0x1a4444={'method':_0x7efd('0xac'),'uri':encodeURI(_0x5d1446+_0x7efd('0xad')+_0x44f425+'\x27'),'headers':{'Authorization':_0x7efd('0xae')+_0x5e427d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a4444);})[_0x7efd('0x1c')](function(_0x27620f){var _0x4dd443=_0x27620f['value'][0x0];var _0x23f820=_0x4dd443['MetadataId'];var _0x10667e={'method':_0x7efd('0xac'),'uri':_0x5d1446+_0x7efd('0xaf')+_0x23f820+_0x7efd('0xb0'),'headers':{'Authorization':_0x7efd('0xae')+_0x5e427d,'If-None-Match':null,'OData-Version':_0x7efd('0xb1')},'json':!![]};return rp(_0x10667e);})['then'](function(_0x50d98b){_0x4cede9=_0x50d98b;_0x353daa=_0x4cede9[_0x7efd('0xb2')];_0x353daa=_[_0x7efd('0xb3')](_0x353daa,function(_0x2838b5){return!_0x5b7a77[_0x7efd('0xb4')](_0x2838b5['LogicalName']);});var _0x905c26=[];var _0x11369a=[];_0x353daa[_0x7efd('0xb5')](function(_0x130333){if(_0x130333['@odata.type']){var _0x461cff=_0x130333[_0x7efd('0xb6')][_0x7efd('0xa5')](_0x130333[_0x7efd('0xb6')][_0x7efd('0xa6')]('.')+0x1);if(_0x461cff==='PicklistAttributeMetadata'){_0x905c26['push'](getSelectList(_0x5d1446,_0x5f54c3,_0x11369a,_0x4cede9[_0x7efd('0xb7')],_0x130333[_0x7efd('0xb7')],_0x5e427d));}}});return Promise[_0x7efd('0xb8')](_0x905c26);})[_0x7efd('0x1c')](function(_0x3f0601){_0x5b48b4=_0x3f0601[0x0];var _0x9cd2a=[];var _0x361016=[];_0x353daa[_0x7efd('0xb5')](function(_0x5c384e){if(!_[_0x7efd('0xb9')](_0x5c384e[_0x7efd('0xb6')])){var _0x15a841=_0x5c384e[_0x7efd('0xb6')][_0x7efd('0xa5')](_0x5c384e[_0x7efd('0xb6')]['lastIndexOf']('.')+0x1);if(_0x15a841==='BooleanAttributeMetadata'){_0x9cd2a[_0x7efd('0xba')](getBooleanList(_0x5d1446,_0x5f54c3,_0x361016,_0x4cede9[_0x7efd('0xb7')],_0x5c384e[_0x7efd('0xb7')],_0x5e427d));}}});return Promise[_0x7efd('0xb8')](_0x9cd2a);})[_0x7efd('0x1c')](function(_0x18565a){_0x489179=_0x18565a[0x0];var _0x576fcc=[];var _0x38e9a9=[];_0x353daa[_0x7efd('0xb5')](function(_0x4308d5){if(_0x4308d5['@odata.type']){var _0x447e2c=_0x4308d5[_0x7efd('0xb6')][_0x7efd('0xa5')](_0x4308d5[_0x7efd('0xb6')]['lastIndexOf']('.')+0x1);if(_0x447e2c==='StringAttributeMetadata'||_0x447e2c===_0x7efd('0xbb')||_0x447e2c===_0x7efd('0xbc')||_0x447e2c===_0x7efd('0xbd')||_0x447e2c===_0x7efd('0xbe')||_0x447e2c===_0x7efd('0xbf')||_0x447e2c==='StatusAttributeMetadata'||_0x447e2c===_0x7efd('0xc0')||_0x447e2c==='StateAttributeMetadata'||_0x447e2c==='DecimalAttributeMetadata'){_0x576fcc[_0x7efd('0xba')](getInputList(_0x5d1446,_0x5f54c3,_0x447e2c,_0x38e9a9,_0x4cede9[_0x7efd('0xb7')],_0x4308d5[_0x7efd('0xb7')],_0x5e427d));}}});return Promise[_0x7efd('0xb8')](_0x576fcc);})[_0x7efd('0x1c')](function(_0x27e0cc){_0x34f993=_0x27e0cc[0x0];var _0x2177e3=_0x5b48b4['concat'](_0x489179)[_0x7efd('0x9e')](_0x34f993);var _0x1b0e82={'count':_0x2177e3['length'],'rows':_0x2177e3};return _0x1b0e82;})['then'](respondWithResult(_0x5cf17f,null))[_0x7efd('0x25')](function(_0x50be85){console['log'](_0x7efd('0xc1')+_0x50be85);var _0x2fd1e3=_0x319f06[_0x7efd('0x38')][_0x7efd('0x19')]?0x1f4:_0x50be85[_0x7efd('0xc2')]||0x1f4;logger[_0x7efd('0x21')](_0x50be85['stack']);delete _0x50be85[_0x7efd('0x31')];if(_0x2fd1e3===0x191){_0x2fd1e3=0x190;}_0x5cf17f['status'](_0x2fd1e3)[_0x7efd('0x32')](_0x319f06[_0x7efd('0x38')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x50be85['statusCode']}:_0x50be85);});};function getSelectList(_0x51b6ea,_0x39d455,_0x7b82c4,_0x5bcd6b,_0x258002,_0x338a41){var _0x3b5259={'method':'GET','uri':_0x51b6ea+_0x7efd('0xaf')+_0x5bcd6b+_0x7efd('0xc3')+_0x258002+_0x7efd('0xc4')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x7efd('0xae')+_0x338a41,'If-None-Match':null,'OData-Version':_0x7efd('0xb1')},'json':!![]};return rp(_0x3b5259)[_0x7efd('0x1c')](function(_0xc6ddf2){var _0x13abe7=[];var _0x4d10ff=_0xc6ddf2[_0x7efd('0xc5')][_0x7efd('0xc6')];_0x4d10ff['forEach'](function(_0xf6ae19){_0x13abe7[_0x7efd('0xba')]({'name':_0xf6ae19[_0x7efd('0xc7')]['UserLocalizedLabel'][_0x7efd('0xc7')],'value':String(_0xf6ae19['Value'])});});var _0x3c8daa={'id':_0x39d455+'_'+_0xc6ddf2[_0x7efd('0xc8')],'name':_0xc6ddf2['DisplayName'][_0x7efd('0xc9')][_0x7efd('0xc7')],'custom':![],'options':_0x13abe7};_0x7b82c4[_0x7efd('0xba')](_0x3c8daa);return _0x7b82c4;});}function getBooleanList(_0x1620be,_0x3b6297,_0x29a6d4,_0x5c95ce,_0x291a87,_0x107e20){var _0x45b7e0={'method':_0x7efd('0xac'),'uri':_0x1620be+_0x7efd('0xaf')+_0x5c95ce+_0x7efd('0xc3')+_0x291a87+_0x7efd('0xca'),'headers':{'Authorization':_0x7efd('0xae')+_0x107e20,'If-None-Match':null,'OData-Version':_0x7efd('0xb1')},'json':!![]};return rp(_0x45b7e0)[_0x7efd('0x1c')](function(_0x9c4e51){var _0x4a47ca=[];_0x4a47ca[_0x7efd('0xba')]({'name':_0x9c4e51['OptionSet'][_0x7efd('0xcb')][_0x7efd('0xc7')][_0x7efd('0xc9')]['Label'],'value':_0x7efd('0xcc')},{'name':_0x9c4e51[_0x7efd('0xc5')]['FalseOption']['Label'][_0x7efd('0xc9')][_0x7efd('0xc7')],'value':_0x7efd('0xcd')});var _0x162380={'id':_0x3b6297+'_'+_0x9c4e51[_0x7efd('0xc8')],'name':_0x9c4e51[_0x7efd('0xce')][_0x7efd('0xc9')][_0x7efd('0xc7')],'custom':![],'options':_0x4a47ca};_0x29a6d4['push'](_0x162380);return _0x29a6d4;});}function getInputList(_0x55773a,_0x4c3fc8,_0x41bd12,_0x47cb05,_0x21575c,_0xf94fa6,_0x37d134){var _0x4f6f1a={'method':'GET','uri':_0x55773a+_0x7efd('0xaf')+_0x21575c+_0x7efd('0xc3')+_0xf94fa6+')/Microsoft.Dynamics.CRM.'+_0x41bd12+_0x7efd('0xcf'),'headers':{'Authorization':_0x7efd('0xae')+_0x37d134,'If-None-Match':null,'OData-Version':_0x7efd('0xb1')},'json':!![]};return rp(_0x4f6f1a)[_0x7efd('0x1c')](function(_0xd54f22){var _0x3e539a={'id':_0x4c3fc8+'_'+_0xd54f22[_0x7efd('0xc8')],'name':_0xd54f22['DisplayName'][_0x7efd('0xc9')]?_0xd54f22[_0x7efd('0xce')]['UserLocalizedLabel'][_0x7efd('0xc7')]:_0xd54f22[_0x7efd('0xc8')],'custom':![],'options':[]};_0x47cb05['push'](_0x3e539a);return _0x47cb05;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 273c5eb..bb9a85d 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 _0x98fb=['bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','Dynamics365Account','lodash','util','api','moment'];(function(_0x3f82e2,_0x28fcf9){var _0x8e52b8=function(_0x34d26e){while(--_0x34d26e){_0x3f82e2['push'](_0x3f82e2['shift']());}};_0x8e52b8(++_0x28fcf9);}(_0x98fb,0x167));var _0xb98f=function(_0x29c869,_0x514c62){_0x29c869=_0x29c869-0x0;var _0x266ba3=_0x98fb[_0x29c869];return _0x266ba3;};'use strict';var _=require(_0xb98f('0x0'));var util=require(_0xb98f('0x1'));var logger=require('../../config/logger')(_0xb98f('0x2'));var moment=require(_0xb98f('0x3'));var BPromise=require(_0xb98f('0x4'));var rp=require(_0xb98f('0x5'));var fs=require('fs');var path=require(_0xb98f('0x6'));var rimraf=require('rimraf');var config=require(_0xb98f('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0xb98f('0x8'));module[_0xb98f('0x9')]=function(_0x6f565d,_0x5ef7fa){return _0x6f565d['define'](_0xb98f('0xa'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0de1=['./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','util','path','rimraf','../../config/environment'];(function(_0xfbe197,_0x28c466){var _0x519927=function(_0x4974ec){while(--_0x4974ec){_0xfbe197['push'](_0xfbe197['shift']());}};_0x519927(++_0x28c466);}(_0x0de1,0x1a9));var _0x10de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0de1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x10de('0x0'));var util=require(_0x10de('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(_0x10de('0x2'));var rimraf=require(_0x10de('0x3'));var config=require(_0x10de('0x4'));var attributes=require(_0x10de('0x5'));var integrations=require(_0x10de('0x6'));module[_0x10de('0x7')]=function(_0x331ea7,_0x44f47a){return _0x331ea7[_0x10de('0x8')]('Dynamics365Account',attributes,{'tableName':_0x10de('0x9'),'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 fc8557d..dafa759 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 _0x304f=['Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','findAll','options','where','attributes','include','map','model','info','ShowDynamics365Account','Dynamics365Account','raw','lodash','util','moment','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x304f,0x1c1));var _0xf304=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x304f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf304('0x0'));var util=require(_0xf304('0x1'));var moment=require(_0xf304('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf304('0x3'));var jayson=require(_0xf304('0x4'));var client=jayson[_0xf304('0x5')][_0xf304('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x657592,_0x3674d,_0x52f239){return new BPromise(function(_0x1f608b,_0x3cd661){return client[_0xf304('0x7')](_0x657592,_0x52f239)[_0xf304('0x8')](function(_0xdf0fee){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3674d,_0xf304('0x9'));logger[_0xf304('0xa')](_0xf304('0xb'),_0x3674d,_0xf304('0x9'),JSON[_0xf304('0xc')](_0xdf0fee));if(_0xdf0fee[_0xf304('0xd')]){if(_0xdf0fee[_0xf304('0xd')][_0xf304('0xe')]===0x1f4){logger[_0xf304('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x3674d,_0xdf0fee['error'][_0xf304('0xf')]);return _0x3cd661(_0xdf0fee[_0xf304('0xd')][_0xf304('0xf')]);}logger[_0xf304('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x3674d,_0xdf0fee[_0xf304('0xd')]['message']);return _0x1f608b(_0xdf0fee[_0xf304('0xd')][_0xf304('0xf')]);}else{logger['info'](_0xf304('0x10'),_0x3674d,_0xf304('0x9'));_0x1f608b(_0xdf0fee[_0xf304('0x11')]['message']);}})[_0xf304('0x12')](function(_0x4bbe44){logger[_0xf304('0xd')](_0xf304('0x10'),_0x3674d,_0x4bbe44);_0x3cd661(_0x4bbe44);});});}exports[_0xf304('0x13')]=function(_0x36a353){var _0x3e13b3=this;return new Promise(function(_0x5d1022,_0x531e69){return db['Dynamics365Account'][_0xf304('0x14')]({'raw':_0x36a353[_0xf304('0x15')]?_0x36a353[_0xf304('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x36a353[_0xf304('0x15')]?_0x36a353[_0xf304('0x15')][_0xf304('0x16')]||null:null,'attributes':_0x36a353['options']?_0x36a353[_0xf304('0x15')][_0xf304('0x17')]||null:null,'limit':_0x36a353[_0xf304('0x15')]?_0x36a353[_0xf304('0x15')]['limit']||null:null,'include':_0x36a353[_0xf304('0x15')]?_0x36a353[_0xf304('0x15')][_0xf304('0x18')]?_['map'](_0x36a353[_0xf304('0x15')][_0xf304('0x18')],function(_0x4edc1a){return{'model':db[_0x4edc1a['model']],'as':_0x4edc1a['as'],'attributes':_0x4edc1a[_0xf304('0x17')],'include':_0x4edc1a[_0xf304('0x18')]?_[_0xf304('0x19')](_0x4edc1a[_0xf304('0x18')],function(_0x30e72b){return{'model':db[_0x30e72b['model']],'as':_0x30e72b['as'],'attributes':_0x30e72b[_0xf304('0x17')],'include':_0x30e72b[_0xf304('0x18')]?_[_0xf304('0x19')](_0x30e72b[_0xf304('0x18')],function(_0x592714){return{'model':db[_0x592714[_0xf304('0x1a')]],'as':_0x592714['as'],'attributes':_0x592714[_0xf304('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4563a7){logger[_0xf304('0x1b')]('GetDynamics365Account',_0x36a353);logger[_0xf304('0xa')](_0xf304('0x13'),_0x36a353,JSON['stringify'](_0x4563a7));_0x5d1022(_0x4563a7);})[_0xf304('0x12')](function(_0x4d2350){logger['error'](_0xf304('0x13'),_0x4d2350['message'],_0x36a353);_0x531e69(_0x3e13b3[_0xf304('0xd')](0x1f4,_0x4d2350[_0xf304('0xf')]));});});};exports[_0xf304('0x1c')]=function(_0x5d6e1b){var _0x1c742e=this;return new Promise(function(_0x256d94,_0x14714e){return db[_0xf304('0x1d')]['find']({'raw':_0x5d6e1b[_0xf304('0x15')]?_0x5d6e1b['options'][_0xf304('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d6e1b[_0xf304('0x15')]?_0x5d6e1b['options'][_0xf304('0x16')]||null:null,'attributes':_0x5d6e1b[_0xf304('0x15')]?_0x5d6e1b[_0xf304('0x15')][_0xf304('0x17')]||null:null,'include':_0x5d6e1b[_0xf304('0x15')]?_0x5d6e1b[_0xf304('0x15')][_0xf304('0x18')]?_[_0xf304('0x19')](_0x5d6e1b[_0xf304('0x15')]['include'],function(_0x32867e){return{'model':db[_0x32867e[_0xf304('0x1a')]],'as':_0x32867e['as'],'attributes':_0x32867e[_0xf304('0x17')],'include':_0x32867e[_0xf304('0x18')]?_[_0xf304('0x19')](_0x32867e[_0xf304('0x18')],function(_0x41898e){return{'model':db[_0x41898e[_0xf304('0x1a')]],'as':_0x41898e['as'],'attributes':_0x41898e[_0xf304('0x17')],'include':_0x41898e[_0xf304('0x18')]?_[_0xf304('0x19')](_0x41898e['include'],function(_0x11c7e5){return{'model':db[_0x11c7e5[_0xf304('0x1a')]],'as':_0x11c7e5['as'],'attributes':_0x11c7e5[_0xf304('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf304('0x8')](function(_0x578677){logger[_0xf304('0x1b')]('ShowDynamics365Account',_0x5d6e1b);logger[_0xf304('0xa')](_0xf304('0x1c'),_0x5d6e1b,JSON[_0xf304('0xc')](_0x578677));_0x256d94(_0x578677);})['catch'](function(_0x311f30){logger[_0xf304('0xd')](_0xf304('0x1c'),_0x311f30[_0xf304('0xf')],_0x5d6e1b);_0x14714e(_0x1c742e[_0xf304('0xd')](0x1f4,_0x311f30[_0xf304('0xf')]));});});}; \ No newline at end of file +var _0x731e=['Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','limit','map','model','attributes','include','find','ShowDynamics365Account','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3426c2,_0x5cba06){var _0x4fc616=function(_0x5f3377){while(--_0x5f3377){_0x3426c2['push'](_0x3426c2['shift']());}};_0x4fc616(++_0x5cba06);}(_0x731e,0x1a1));var _0xe731=function(_0x263ef8,_0x445b19){_0x263ef8=_0x263ef8-0x0;var _0x2c3c9b=_0x731e[_0x263ef8];return _0x2c3c9b;};'use strict';var _=require(_0xe731('0x0'));var util=require(_0xe731('0x1'));var moment=require(_0xe731('0x2'));var BPromise=require('bluebird');var rs=require(_0xe731('0x3'));var fs=require('fs');var Redis=require(_0xe731('0x4'));var db=require(_0xe731('0x5'))['db'];var utils=require(_0xe731('0x6'));var logger=require(_0xe731('0x7'))('rpc');var config=require(_0xe731('0x8'));var jayson=require(_0xe731('0x9'));var client=jayson[_0xe731('0xa')][_0xe731('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34d458,_0x35eccb,_0x24f318){return new BPromise(function(_0x5ba2d4,_0x566aaa){return client[_0xe731('0xc')](_0x34d458,_0x24f318)[_0xe731('0xd')](function(_0x209c84){logger[_0xe731('0xe')](_0xe731('0xf'),_0x35eccb,_0xe731('0x10'));logger[_0xe731('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x35eccb,_0xe731('0x10'),JSON[_0xe731('0x12')](_0x209c84));if(_0x209c84[_0xe731('0x13')]){if(_0x209c84[_0xe731('0x13')][_0xe731('0x14')]===0x1f4){logger['error'](_0xe731('0xf'),_0x35eccb,_0x209c84[_0xe731('0x13')][_0xe731('0x15')]);return _0x566aaa(_0x209c84[_0xe731('0x13')][_0xe731('0x15')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x35eccb,_0x209c84[_0xe731('0x13')]['message']);return _0x5ba2d4(_0x209c84[_0xe731('0x13')]['message']);}else{logger[_0xe731('0xe')](_0xe731('0xf'),_0x35eccb,'request\x20sent');_0x5ba2d4(_0x209c84[_0xe731('0x16')][_0xe731('0x15')]);}})[_0xe731('0x17')](function(_0x5c9393){logger[_0xe731('0x13')](_0xe731('0xf'),_0x35eccb,_0x5c9393);_0x566aaa(_0x5c9393);});});}exports[_0xe731('0x18')]=function(_0x1ee22f){var _0x3c4ec7=this;return new Promise(function(_0x2f3a05,_0x2f1499){return db[_0xe731('0x19')]['findAll']({'raw':_0x1ee22f['options']?_0x1ee22f[_0xe731('0x1a')][_0xe731('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ee22f[_0xe731('0x1a')]?_0x1ee22f['options'][_0xe731('0x1c')]||null:null,'attributes':_0x1ee22f[_0xe731('0x1a')]?_0x1ee22f[_0xe731('0x1a')]['attributes']||null:null,'limit':_0x1ee22f[_0xe731('0x1a')]?_0x1ee22f[_0xe731('0x1a')][_0xe731('0x1d')]||null:null,'include':_0x1ee22f[_0xe731('0x1a')]?_0x1ee22f['options']['include']?_[_0xe731('0x1e')](_0x1ee22f['options']['include'],function(_0x442e7a){return{'model':db[_0x442e7a[_0xe731('0x1f')]],'as':_0x442e7a['as'],'attributes':_0x442e7a[_0xe731('0x20')],'include':_0x442e7a[_0xe731('0x21')]?_[_0xe731('0x1e')](_0x442e7a[_0xe731('0x21')],function(_0x3e0741){return{'model':db[_0x3e0741['model']],'as':_0x3e0741['as'],'attributes':_0x3e0741[_0xe731('0x20')],'include':_0x3e0741[_0xe731('0x21')]?_['map'](_0x3e0741[_0xe731('0x21')],function(_0x5436dd){return{'model':db[_0x5436dd['model']],'as':_0x5436dd['as'],'attributes':_0x5436dd[_0xe731('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe731('0xd')](function(_0x4f663d){logger[_0xe731('0xe')](_0xe731('0x18'),_0x1ee22f);logger[_0xe731('0x11')](_0xe731('0x18'),_0x1ee22f,JSON[_0xe731('0x12')](_0x4f663d));_0x2f3a05(_0x4f663d);})[_0xe731('0x17')](function(_0x57b0eb){logger[_0xe731('0x13')](_0xe731('0x18'),_0x57b0eb['message'],_0x1ee22f);_0x2f1499(_0x3c4ec7[_0xe731('0x13')](0x1f4,_0x57b0eb[_0xe731('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x141086){var _0x71c0ea=this;return new Promise(function(_0x2e1f50,_0x1800bc){return db[_0xe731('0x19')][_0xe731('0x22')]({'raw':_0x141086[_0xe731('0x1a')]?_0x141086[_0xe731('0x1a')][_0xe731('0x1b')]===undefined?!![]:![]:!![],'where':_0x141086[_0xe731('0x1a')]?_0x141086[_0xe731('0x1a')][_0xe731('0x1c')]||null:null,'attributes':_0x141086[_0xe731('0x1a')]?_0x141086[_0xe731('0x1a')]['attributes']||null:null,'include':_0x141086['options']?_0x141086['options'][_0xe731('0x21')]?_[_0xe731('0x1e')](_0x141086[_0xe731('0x1a')][_0xe731('0x21')],function(_0x2d37f7){return{'model':db[_0x2d37f7[_0xe731('0x1f')]],'as':_0x2d37f7['as'],'attributes':_0x2d37f7['attributes'],'include':_0x2d37f7[_0xe731('0x21')]?_[_0xe731('0x1e')](_0x2d37f7[_0xe731('0x21')],function(_0x277c53){return{'model':db[_0x277c53[_0xe731('0x1f')]],'as':_0x277c53['as'],'attributes':_0x277c53[_0xe731('0x20')],'include':_0x277c53[_0xe731('0x21')]?_['map'](_0x277c53[_0xe731('0x21')],function(_0x10a061){return{'model':db[_0x10a061[_0xe731('0x1f')]],'as':_0x10a061['as'],'attributes':_0x10a061[_0xe731('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d145e){logger['info']('ShowDynamics365Account',_0x141086);logger[_0xe731('0x11')](_0xe731('0x23'),_0x141086,JSON[_0xe731('0x12')](_0x7d145e));_0x2e1f50(_0x7d145e);})[_0xe731('0x17')](function(_0x124ad9){logger[_0xe731('0x13')](_0xe731('0x23'),_0x124ad9['message'],_0x141086);_0x1800bc(_0x71c0ea[_0xe731('0x13')](0x1f4,_0x124ad9[_0xe731('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 2fb2241..439c879 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 _0xb673=['isAuthenticated','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/fields'];(function(_0x557a5c,_0x5d6c65){var _0x21ed4b=function(_0x2f99ed){while(--_0x2f99ed){_0x557a5c['push'](_0x557a5c['shift']());}};_0x21ed4b(++_0x5d6c65);}(_0xb673,0x73));var _0x3b67=function(_0x1c08c8,_0x491b5d){_0x1c08c8=_0x1c08c8-0x0;var _0x28ede5=_0xb673[_0x1c08c8];return _0x28ede5;};'use strict';var multer=require(_0x3b67('0x0'));var util=require('util');var path=require(_0x3b67('0x1'));var timeout=require('connect-timeout');var express=require(_0x3b67('0x2'));var router=express[_0x3b67('0x3')]();var auth=require(_0x3b67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3b67('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0x3b67('0x6')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x7')]);router['get'](_0x3b67('0x8'),auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x6')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['getFields']);router[_0x3b67('0x6')](_0x3b67('0xc'),auth[_0x3b67('0xb')](),controller[_0x3b67('0xd')]);router['get']('/:id/descriptions',auth[_0x3b67('0xb')](),controller[_0x3b67('0xe')]);router[_0x3b67('0xf')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x10')]);router[_0x3b67('0x11')](_0x3b67('0x8'),auth[_0x3b67('0xb')](),controller['update']);router[_0x3b67('0x12')](_0x3b67('0x8'),auth['isAuthenticated'](),controller[_0x3b67('0x13')]);module[_0x3b67('0x14')]=router; \ No newline at end of file +var _0xb7b2=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','update','delete','multer','path','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0xdb1fc3,_0x258402){var _0x206e45=function(_0x43c234){while(--_0x43c234){_0xdb1fc3['push'](_0xdb1fc3['shift']());}};_0x206e45(++_0x258402);}(_0xb7b2,0x160));var _0x2b7b=function(_0x47b5ef,_0x286b16){_0x47b5ef=_0x47b5ef-0x0;var _0x3bee17=_0xb7b2[_0x47b5ef];return _0x3bee17;};'use strict';var multer=require(_0x2b7b('0x0'));var util=require('util');var path=require(_0x2b7b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2b7b('0x2')]();var auth=require(_0x2b7b('0x3'));var interaction=require(_0x2b7b('0x4'));var config=require('../../config/environment');var controller=require(_0x2b7b('0x5'));router[_0x2b7b('0x6')]('/',auth[_0x2b7b('0x7')](),controller[_0x2b7b('0x8')]);router['get'](_0x2b7b('0x9'),auth[_0x2b7b('0x7')](),controller[_0x2b7b('0xa')]);router[_0x2b7b('0x6')](_0x2b7b('0xb'),auth[_0x2b7b('0x7')](),controller[_0x2b7b('0xc')]);router[_0x2b7b('0x6')](_0x2b7b('0xd'),auth[_0x2b7b('0x7')](),controller['getSubjects']);router['get'](_0x2b7b('0xe'),auth[_0x2b7b('0x7')](),controller[_0x2b7b('0xf')]);router['post']('/',auth[_0x2b7b('0x7')](),controller[_0x2b7b('0x10')]);router['put'](_0x2b7b('0x9'),auth[_0x2b7b('0x7')](),controller[_0x2b7b('0x11')]);router[_0x2b7b('0x12')]('/:id',auth[_0x2b7b('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 1548e20..6d442ed 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 _0x194b=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x194b,0xd9));var _0xb194=function(_0xed0e7d,_0x339dd8){_0xed0e7d=_0xed0e7d-0x0;var _0x7b4289=_0x194b[_0xed0e7d];return _0x7b4289;};'use strict';var Sequelize=require(_0xb194('0x0'));module[_0xb194('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb194('0x2')]},'ticketType':{'type':Sequelize[_0xb194('0x3')](_0xb194('0x4'),_0xb194('0x5')),'defaultValue':_0xb194('0x4')}}; \ No newline at end of file +var _0x0863=['sequelize','exports','STRING','ENUM','phonecall','incident'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0x0863,0x78));var _0x3086=function(_0x37521a,_0x172bd2){_0x37521a=_0x37521a-0x0;var _0x327d14=_0x0863[_0x37521a];return _0x327d14;};'use strict';var Sequelize=require(_0x3086('0x0'));module[_0x3086('0x1')]={'name':{'type':Sequelize[_0x3086('0x2')]},'description':{'type':Sequelize[_0x3086('0x2')]},'ticketType':{'type':Sequelize[_0x3086('0x3')]('incident',_0x3086('0x4')),'defaultValue':_0x3086('0x5')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3ba21c6..80dba27 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 _0xd89b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','options','Dynamics365Configuration','include','findAll','rows','show','includeAll','create','body','update','find','params','getFields','findOne','Dynamics365Field','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xd89b,0x75));var _0xbd89=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd89b[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd89('0x0'));var rimraf=require(_0xbd89('0x1'));var zipdir=require(_0xbd89('0x2'));var jsonpatch=require(_0xbd89('0x3'));var rp=require(_0xbd89('0x4'));var moment=require('moment');var BPromise=require(_0xbd89('0x5'));var Mustache=require(_0xbd89('0x6'));var util=require('util');var path=require(_0xbd89('0x7'));var sox=require(_0xbd89('0x8'));var csv=require(_0xbd89('0x9'));var ejs=require(_0xbd89('0xa'));var fs=require('fs');var _=require(_0xbd89('0xb'));var squel=require(_0xbd89('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbd89('0xd'));var toCsv=require(_0xbd89('0x9'));var querystring=require(_0xbd89('0xe'));var Papa=require(_0xbd89('0xf'));var Redis=require('ioredis');var authService=require(_0xbd89('0x10'));var qs=require(_0xbd89('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbd89('0x12'));var config=require(_0xbd89('0x13'));var db=require(_0xbd89('0x14'))['db'];var jayson=require(_0xbd89('0x15'));var client=jayson[_0xbd89('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d8277,_0x242179,_0x379bde){if(_0x379bde){var _0x14fae6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14fae6[_0xbd89('0x17')](_0x242179)){return _0x2d8277;}else{throw new Error(_0xbd89('0x18'));}}else{return _0x2d8277;}}function respondWithRpcPromise(_0x2ca0bf,_0x4df829,_0x313c91,_0x448d50){return new BPromise(function(_0x35534c,_0x446576){var _0x4bf14a=_0x448d50||client;return _0x4bf14a[_0xbd89('0x19')](_0x2ca0bf,_0x313c91)[_0xbd89('0x1a')](function(_0x1cb1b6){logger[_0xbd89('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4df829,_0xbd89('0x1c'));logger['debug'](_0xbd89('0x1d'),_0x4df829,_0xbd89('0x1c'),JSON[_0xbd89('0x1e')](_0x1cb1b6));if(_0x1cb1b6['error']){if(_0x1cb1b6['error'][_0xbd89('0x1f')]===0x1f4){logger[_0xbd89('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4df829,_0x1cb1b6['error'][_0xbd89('0x21')]);return _0x446576(_0x1cb1b6[_0xbd89('0x20')]['message']);}logger[_0xbd89('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4df829,_0x1cb1b6['error']['message']);return _0x35534c(_0x1cb1b6[_0xbd89('0x20')][_0xbd89('0x21')]);}else{logger[_0xbd89('0x1b')](_0xbd89('0x22'),_0x4df829,_0xbd89('0x1c'));_0x35534c(_0x1cb1b6[_0xbd89('0x23')][_0xbd89('0x21')]);}})[_0xbd89('0x24')](function(_0x5a1dcc){logger[_0xbd89('0x20')](_0xbd89('0x22'),_0x4df829,_0x5a1dcc);_0x446576(_0x5a1dcc);});});}function respondWithStatusCode(_0x46012f,_0x5e4421){_0x5e4421=_0x5e4421||0xcc;return function(_0x52efb9){if(_0x52efb9){return _0x46012f[_0xbd89('0x25')](_0x5e4421);}return _0x46012f['status'](_0x5e4421)[_0xbd89('0x26')]();};}function respondWithResult(_0x364501,_0x504cbb){_0x504cbb=_0x504cbb||0xc8;return function(_0x5d4ac7){if(_0x5d4ac7){return _0x364501[_0xbd89('0x27')](_0x504cbb)[_0xbd89('0x28')](_0x5d4ac7);}};}function respondWithFilteredResult(_0x3d0a5d,_0x1d58c0){return function(_0x5aac01){if(_0x5aac01){var _0x6236cf=_0x5aac01[_0xbd89('0x29')],_0x463597=_0x1d58c0[_0xbd89('0x2a')],_0x4f21c6=_0x1d58c0[_0xbd89('0x2a')]+_0x1d58c0[_0xbd89('0x2b')],_0x137720;if(_0x4f21c6>=_0x6236cf){_0x4f21c6=_0x6236cf;_0x137720=0xc8;}else{_0x137720=0xce;}_0x3d0a5d[_0xbd89('0x27')](_0x137720);return _0x3d0a5d[_0xbd89('0x2c')](_0xbd89('0x2d'),_0x463597+'-'+_0x4f21c6+'/'+_0x6236cf)['json'](_0x5aac01);}return null;};}function patchUpdates(_0x4acdc6){return function(_0x587eba){try{jsonpatch[_0xbd89('0x2e')](_0x587eba,_0x4acdc6,!![]);}catch(_0xd2f8d3){return BPromise[_0xbd89('0x2f')](_0xd2f8d3);}return _0x587eba[_0xbd89('0x30')]();};}function saveUpdates(_0x1d969d,_0x2e653c){return function(_0x4bb188){if(_0x4bb188){return _0x4bb188['update'](_0x1d969d)['then'](function(_0x3cdc70){return _0x3cdc70;});}return null;};}function removeEntity(_0x5496da,_0xe1ea46){return function(_0x458f74){if(_0x458f74){return _0x458f74[_0xbd89('0x31')]()[_0xbd89('0x1a')](function(){_0x5496da[_0xbd89('0x27')](0xcc)[_0xbd89('0x26')]();});}};}function handleEntityNotFound(_0x4af454,_0x5011f0){return function(_0x31c910){if(!_0x31c910){_0x4af454[_0xbd89('0x25')](0x194);}return _0x31c910;};}function handleError(_0x4c8284,_0x3a4067){_0x3a4067=_0x3a4067||0x1f4;return function(_0xdb9cf6){logger[_0xbd89('0x20')](_0xdb9cf6[_0xbd89('0x32')]);if(_0xdb9cf6['name']){delete _0xdb9cf6['name'];}_0x4c8284['status'](_0x3a4067)[_0xbd89('0x33')](_0xdb9cf6);};}exports[_0xbd89('0x34')]=function(_0xca75be,_0x6a1f39){var _0x50037d={},_0x4e8eeb={},_0x42546f={'count':0x0,'rows':[]};var _0x4a64d1=db['Dynamics365Configuration'][_0xbd89('0x35')];_0x4e8eeb[_0xbd89('0x36')]=_[_0xbd89('0x37')](_0x4a64d1);_0x4e8eeb[_0xbd89('0x38')]=_[_0xbd89('0x37')](_0xca75be[_0xbd89('0x38')]);_0x4e8eeb[_0xbd89('0x39')]=_[_0xbd89('0x3a')](_0x4e8eeb[_0xbd89('0x36')],_0x4e8eeb[_0xbd89('0x38')]);_0x50037d[_0xbd89('0x3b')]=_[_0xbd89('0x3a')](_0x4e8eeb[_0xbd89('0x36')],qs['fields'](_0xca75be[_0xbd89('0x38')][_0xbd89('0x3c')]));_0x50037d[_0xbd89('0x3b')]=_0x50037d[_0xbd89('0x3b')][_0xbd89('0x3d')]?_0x50037d['attributes']:_0x4e8eeb[_0xbd89('0x36')];if(!_0xca75be[_0xbd89('0x38')][_0xbd89('0x3e')](_0xbd89('0x3f'))){_0x50037d[_0xbd89('0x2b')]=qs[_0xbd89('0x2b')](_0xca75be[_0xbd89('0x38')][_0xbd89('0x2b')]);_0x50037d[_0xbd89('0x2a')]=qs['offset'](_0xca75be['query'][_0xbd89('0x2a')]);}_0x50037d[_0xbd89('0x40')]=qs[_0xbd89('0x41')](_0xca75be[_0xbd89('0x38')]['sort']);_0x50037d[_0xbd89('0x42')]=qs['filters'](_[_0xbd89('0x43')](_0xca75be[_0xbd89('0x38')],_0x4e8eeb[_0xbd89('0x39')]));if(_0xca75be['query'][_0xbd89('0x44')]){_0x50037d[_0xbd89('0x42')]=_[_0xbd89('0x45')](_0x50037d['where'],{'$or':_['map'](_0x4a64d1,function(_0x125ed9){if(_0x125ed9['type'][_0xbd89('0x46')]!=='VIRTUAL'){var _0x494549={};_0x494549[_0x125ed9['field']]={'$like':'%'+_0xca75be[_0xbd89('0x38')][_0xbd89('0x44')]+'%'};return _0x494549;}})});}_0x50037d=_['merge']({},_0x50037d,_0xca75be[_0xbd89('0x47')]);var _0x298c92={'where':_0x50037d[_0xbd89('0x42')]};return db[_0xbd89('0x48')][_0xbd89('0x29')](_0x298c92)[_0xbd89('0x1a')](function(_0x458fc5){_0x42546f[_0xbd89('0x29')]=_0x458fc5;if(_0xca75be[_0xbd89('0x38')]['includeAll']){_0x50037d[_0xbd89('0x49')]=[{'all':!![]}];}return db[_0xbd89('0x48')][_0xbd89('0x4a')](_0x50037d);})[_0xbd89('0x1a')](function(_0x356262){_0x42546f[_0xbd89('0x4b')]=_0x356262;return _0x42546f;})[_0xbd89('0x1a')](respondWithFilteredResult(_0x6a1f39,_0x50037d))[_0xbd89('0x24')](handleError(_0x6a1f39,null));};exports[_0xbd89('0x4c')]=function(_0xe86535,_0x4fe99e){var _0x422151={'raw':![],'where':{'id':_0xe86535['params']['id']}},_0x4018ed={};_0x4018ed['model']=_[_0xbd89('0x37')](db[_0xbd89('0x48')]['rawAttributes']);_0x4018ed['query']=_[_0xbd89('0x37')](_0xe86535[_0xbd89('0x38')]);_0x4018ed['filters']=_[_0xbd89('0x3a')](_0x4018ed[_0xbd89('0x36')],_0x4018ed[_0xbd89('0x38')]);_0x422151[_0xbd89('0x3b')]=_[_0xbd89('0x3a')](_0x4018ed[_0xbd89('0x36')],qs[_0xbd89('0x3c')](_0xe86535[_0xbd89('0x38')][_0xbd89('0x3c')]));_0x422151[_0xbd89('0x3b')]=_0x422151[_0xbd89('0x3b')]['length']?_0x422151[_0xbd89('0x3b')]:_0x4018ed['model'];if(_0xe86535[_0xbd89('0x38')][_0xbd89('0x4d')]){_0x422151['include']=[{'all':!![]}];}_0x422151=_[_0xbd89('0x45')]({},_0x422151,_0xe86535[_0xbd89('0x47')]);return db['Dynamics365Configuration']['find'](_0x422151)['then'](handleEntityNotFound(_0x4fe99e,null))[_0xbd89('0x1a')](respondWithResult(_0x4fe99e,null))[_0xbd89('0x24')](handleError(_0x4fe99e,null));};exports[_0xbd89('0x4e')]=function(_0x47453b,_0x1052da){return db['Dynamics365Configuration'][_0xbd89('0x4e')](_0x47453b[_0xbd89('0x4f')],{})[_0xbd89('0x1a')](respondWithResult(_0x1052da,0xc9))[_0xbd89('0x24')](handleError(_0x1052da,null));};exports[_0xbd89('0x50')]=function(_0x37282e,_0x12285f){if(_0x37282e[_0xbd89('0x4f')]['id']){delete _0x37282e[_0xbd89('0x4f')]['id'];}return db[_0xbd89('0x48')][_0xbd89('0x51')]({'where':{'id':_0x37282e[_0xbd89('0x52')]['id']}})[_0xbd89('0x1a')](handleEntityNotFound(_0x12285f,null))[_0xbd89('0x1a')](saveUpdates(_0x37282e[_0xbd89('0x4f')],null))[_0xbd89('0x1a')](respondWithResult(_0x12285f,null))['catch'](handleError(_0x12285f,null));};exports[_0xbd89('0x31')]=function(_0x2f69a5,_0x49e0b7){return db['Dynamics365Configuration'][_0xbd89('0x51')]({'where':{'id':_0x2f69a5['params']['id']}})[_0xbd89('0x1a')](handleEntityNotFound(_0x49e0b7,null))[_0xbd89('0x1a')](removeEntity(_0x49e0b7,null))['catch'](handleError(_0x49e0b7,null));};exports[_0xbd89('0x53')]=function(_0x1e3d95,_0x3653cb,_0x5a4e9a){var _0x358014={};var _0xaa3335={};var _0x43a32f;var _0x26e611;return db[_0xbd89('0x48')][_0xbd89('0x54')]({'where':{'id':_0x1e3d95[_0xbd89('0x52')]['id']}})[_0xbd89('0x1a')](handleEntityNotFound(_0x3653cb,null))[_0xbd89('0x1a')](function(_0x6b0282){if(_0x6b0282){_0x43a32f=_0x6b0282;_0xaa3335[_0xbd89('0x36')]=_['keys'](db[_0xbd89('0x55')][_0xbd89('0x35')]);_0xaa3335['query']=_['keys'](_0x1e3d95['query']);_0xaa3335[_0xbd89('0x39')]=_[_0xbd89('0x3a')](_0xaa3335[_0xbd89('0x36')],_0xaa3335['query']);_0x358014[_0xbd89('0x3b')]=_['intersection'](_0xaa3335['model'],qs[_0xbd89('0x3c')](_0x1e3d95[_0xbd89('0x38')][_0xbd89('0x3c')]));_0x358014[_0xbd89('0x3b')]=_0x358014[_0xbd89('0x3b')]['length']?_0x358014[_0xbd89('0x3b')]:_0xaa3335[_0xbd89('0x36')];_0x358014['order']=qs[_0xbd89('0x41')](_0x1e3d95[_0xbd89('0x38')]['sort']);_0x358014[_0xbd89('0x42')]=qs[_0xbd89('0x39')](_[_0xbd89('0x43')](_0x1e3d95[_0xbd89('0x38')],_0xaa3335[_0xbd89('0x39')]));if(_0x1e3d95['query'][_0xbd89('0x44')]){_0x358014[_0xbd89('0x42')]=_[_0xbd89('0x45')](_0x358014[_0xbd89('0x42')],{'$or':_[_0xbd89('0x56')](_0x358014['attributes'],function(_0x53cf3c){var _0x4b3c75={};_0x4b3c75[_0x53cf3c]={'$like':'%'+_0x1e3d95[_0xbd89('0x38')][_0xbd89('0x44')]+'%'};return _0x4b3c75;})});}_0x358014=_['merge']({},_0x358014,_0x1e3d95[_0xbd89('0x47')]);return _0x43a32f['getFields'](_0x358014);}})[_0xbd89('0x1a')](function(_0x1e9c6c){if(_0x1e9c6c){_0x26e611=_0x1e9c6c[_0xbd89('0x3d')];if(!_0x1e3d95[_0xbd89('0x38')][_0xbd89('0x3e')](_0xbd89('0x3f'))){_0x358014[_0xbd89('0x2b')]=qs[_0xbd89('0x2b')](_0x1e3d95[_0xbd89('0x38')][_0xbd89('0x2b')]);_0x358014['offset']=qs[_0xbd89('0x2a')](_0x1e3d95[_0xbd89('0x38')]['offset']);}return _0x43a32f[_0xbd89('0x53')](_0x358014);}})['then'](function(_0x5b9490){if(_0x5b9490){return _0x5b9490?{'count':_0x26e611,'rows':_0x5b9490}:null;}})['then'](respondWithResult(_0x3653cb,null))[_0xbd89('0x24')](handleError(_0x3653cb,null));};exports['getSubjects']=function(_0x2e5f29,_0x5133e8,_0x1a534f){var _0x4b934b={};var _0x2c7a7e={};var _0x5f25dd;var _0x608355;return db['Dynamics365Configuration'][_0xbd89('0x54')]({'where':{'id':_0x2e5f29[_0xbd89('0x52')]['id']}})[_0xbd89('0x1a')](handleEntityNotFound(_0x5133e8,null))[_0xbd89('0x1a')](function(_0x26e400){if(_0x26e400){_0x5f25dd=_0x26e400;_0x2c7a7e[_0xbd89('0x36')]=_['keys'](db[_0xbd89('0x55')]['rawAttributes']);_0x2c7a7e[_0xbd89('0x38')]=_[_0xbd89('0x37')](_0x2e5f29[_0xbd89('0x38')]);_0x2c7a7e['filters']=_['intersection'](_0x2c7a7e[_0xbd89('0x36')],_0x2c7a7e[_0xbd89('0x38')]);_0x4b934b[_0xbd89('0x3b')]=_[_0xbd89('0x3a')](_0x2c7a7e[_0xbd89('0x36')],qs[_0xbd89('0x3c')](_0x2e5f29[_0xbd89('0x38')]['fields']));_0x4b934b[_0xbd89('0x3b')]=_0x4b934b['attributes']['length']?_0x4b934b['attributes']:_0x2c7a7e[_0xbd89('0x36')];_0x4b934b[_0xbd89('0x40')]=qs[_0xbd89('0x41')](_0x2e5f29[_0xbd89('0x38')][_0xbd89('0x41')]);_0x4b934b[_0xbd89('0x42')]=qs[_0xbd89('0x39')](_[_0xbd89('0x43')](_0x2e5f29[_0xbd89('0x38')],_0x2c7a7e[_0xbd89('0x39')]));if(_0x2e5f29[_0xbd89('0x38')][_0xbd89('0x44')]){_0x4b934b[_0xbd89('0x42')]=_[_0xbd89('0x45')](_0x4b934b[_0xbd89('0x42')],{'$or':_[_0xbd89('0x56')](_0x4b934b[_0xbd89('0x3b')],function(_0x468ebe){var _0x550900={};_0x550900[_0x468ebe]={'$like':'%'+_0x2e5f29['query'][_0xbd89('0x44')]+'%'};return _0x550900;})});}_0x4b934b=_['merge']({},_0x4b934b,_0x2e5f29[_0xbd89('0x47')]);return _0x5f25dd[_0xbd89('0x57')](_0x4b934b);}})[_0xbd89('0x1a')](function(_0x33f17a){if(_0x33f17a){_0x608355=_0x33f17a[_0xbd89('0x3d')];if(!_0x2e5f29[_0xbd89('0x38')][_0xbd89('0x3e')](_0xbd89('0x3f'))){_0x4b934b[_0xbd89('0x2b')]=qs[_0xbd89('0x2b')](_0x2e5f29['query']['limit']);_0x4b934b[_0xbd89('0x2a')]=qs[_0xbd89('0x2a')](_0x2e5f29[_0xbd89('0x38')][_0xbd89('0x2a')]);}return _0x5f25dd[_0xbd89('0x57')](_0x4b934b);}})[_0xbd89('0x1a')](function(_0x37a90e){if(_0x37a90e){return _0x37a90e?{'count':_0x608355,'rows':_0x37a90e}:null;}})['then'](respondWithResult(_0x5133e8,null))[_0xbd89('0x24')](handleError(_0x5133e8,null));};exports[_0xbd89('0x58')]=function(_0x2abc02,_0x5a0132,_0xd96661){var _0x443f26={};var _0x11fbe0={};var _0x3195d4;var _0x59e733;return db['Dynamics365Configuration'][_0xbd89('0x54')]({'where':{'id':_0x2abc02[_0xbd89('0x52')]['id']}})[_0xbd89('0x1a')](handleEntityNotFound(_0x5a0132,null))['then'](function(_0x15b4e9){if(_0x15b4e9){_0x3195d4=_0x15b4e9;_0x11fbe0['model']=_[_0xbd89('0x37')](db[_0xbd89('0x55')][_0xbd89('0x35')]);_0x11fbe0[_0xbd89('0x38')]=_[_0xbd89('0x37')](_0x2abc02[_0xbd89('0x38')]);_0x11fbe0[_0xbd89('0x39')]=_[_0xbd89('0x3a')](_0x11fbe0[_0xbd89('0x36')],_0x11fbe0[_0xbd89('0x38')]);_0x443f26['attributes']=_['intersection'](_0x11fbe0[_0xbd89('0x36')],qs[_0xbd89('0x3c')](_0x2abc02[_0xbd89('0x38')][_0xbd89('0x3c')]));_0x443f26[_0xbd89('0x3b')]=_0x443f26['attributes'][_0xbd89('0x3d')]?_0x443f26[_0xbd89('0x3b')]:_0x11fbe0[_0xbd89('0x36')];_0x443f26[_0xbd89('0x40')]=qs[_0xbd89('0x41')](_0x2abc02[_0xbd89('0x38')]['sort']);_0x443f26[_0xbd89('0x42')]=qs[_0xbd89('0x39')](_['pick'](_0x2abc02[_0xbd89('0x38')],_0x11fbe0[_0xbd89('0x39')]));if(_0x2abc02['query'][_0xbd89('0x44')]){_0x443f26['where']=_[_0xbd89('0x45')](_0x443f26['where'],{'$or':_['map'](_0x443f26[_0xbd89('0x3b')],function(_0x50f04c){var _0x2532f5={};_0x2532f5[_0x50f04c]={'$like':'%'+_0x2abc02['query']['filter']+'%'};return _0x2532f5;})});}_0x443f26=_[_0xbd89('0x45')]({},_0x443f26,_0x2abc02['options']);return _0x3195d4[_0xbd89('0x58')](_0x443f26);}})['then'](function(_0x3cb1fb){if(_0x3cb1fb){_0x59e733=_0x3cb1fb['length'];if(!_0x2abc02[_0xbd89('0x38')][_0xbd89('0x3e')](_0xbd89('0x3f'))){_0x443f26[_0xbd89('0x2b')]=qs[_0xbd89('0x2b')](_0x2abc02['query']['limit']);_0x443f26[_0xbd89('0x2a')]=qs['offset'](_0x2abc02[_0xbd89('0x38')][_0xbd89('0x2a')]);}return _0x3195d4[_0xbd89('0x58')](_0x443f26);}})[_0xbd89('0x1a')](function(_0xc85eac){if(_0xc85eac){return _0xc85eac?{'count':_0x59e733,'rows':_0xc85eac}:null;}})[_0xbd89('0x1a')](respondWithResult(_0x5a0132,null))['catch'](handleError(_0x5a0132,null));}; \ No newline at end of file +var _0x14b7=['code','message','info','sendStatus','status','json','count','offset','Content-Range','apply','destroy','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch','intersection','length','create','update','body','find','params','getFields','Dynamics365Field','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x19d8d9,_0x2100bd){var _0x228c52=function(_0x5ebdff){while(--_0x5ebdff){_0x19d8d9['push'](_0x19d8d9['shift']());}};_0x228c52(++_0x2100bd);}(_0x14b7,0x16f));var _0x714b=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x14b7[_0x4c7d8b];return _0x187158;};'use strict';var pdf=require(_0x714b('0x0'));var emlformat=require(_0x714b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x714b('0x2'));var jsonpatch=require(_0x714b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x714b('0x4'));var Mustache=require(_0x714b('0x5'));var util=require(_0x714b('0x6'));var path=require(_0x714b('0x7'));var sox=require('sox');var csv=require(_0x714b('0x8'));var ejs=require(_0x714b('0x9'));var fs=require('fs');var _=require(_0x714b('0xa'));var squel=require('squel');var crypto=require(_0x714b('0xb'));var jsforce=require(_0x714b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x714b('0x8'));var querystring=require('querystring');var Papa=require(_0x714b('0xd'));var Redis=require(_0x714b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x714b('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x714b('0x10'));var config=require('../../config/environment');var db=require(_0x714b('0x11'))['db'];var jayson=require(_0x714b('0x12'));var client=jayson[_0x714b('0x13')]['http']({'port':0x232a});function checkPasswordPattern(_0x53a1be,_0x4dab90,_0x5e4e1b){if(_0x5e4e1b){var _0x138eba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x138eba[_0x714b('0x14')](_0x4dab90)){return _0x53a1be;}else{throw new Error(_0x714b('0x15'));}}else{return _0x53a1be;}}function respondWithRpcPromise(_0x39dbf5,_0x5a0168,_0x57232c,_0x206f92){return new BPromise(function(_0x2d6a63,_0x5439f5){var _0x4b7de0=_0x206f92||client;return _0x4b7de0['request'](_0x39dbf5,_0x57232c)[_0x714b('0x16')](function(_0x5ee9a0){logger['info'](_0x714b('0x17'),_0x5a0168,'request\x20sent');logger['debug'](_0x714b('0x18'),_0x5a0168,_0x714b('0x19'),JSON[_0x714b('0x1a')](_0x5ee9a0));if(_0x5ee9a0['error']){if(_0x5ee9a0[_0x714b('0x1b')][_0x714b('0x1c')]===0x1f4){logger['error'](_0x714b('0x17'),_0x5a0168,_0x5ee9a0['error'][_0x714b('0x1d')]);return _0x5439f5(_0x5ee9a0[_0x714b('0x1b')][_0x714b('0x1d')]);}logger[_0x714b('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0168,_0x5ee9a0[_0x714b('0x1b')][_0x714b('0x1d')]);return _0x2d6a63(_0x5ee9a0['error'][_0x714b('0x1d')]);}else{logger[_0x714b('0x1e')](_0x714b('0x17'),_0x5a0168,'request\x20sent');_0x2d6a63(_0x5ee9a0['result'][_0x714b('0x1d')]);}})['catch'](function(_0x5d7713){logger['error'](_0x714b('0x17'),_0x5a0168,_0x5d7713);_0x5439f5(_0x5d7713);});});}function respondWithStatusCode(_0x1e6216,_0x3f5c5d){_0x3f5c5d=_0x3f5c5d||0xcc;return function(_0x3b49ce){if(_0x3b49ce){return _0x1e6216[_0x714b('0x1f')](_0x3f5c5d);}return _0x1e6216[_0x714b('0x20')](_0x3f5c5d)['end']();};}function respondWithResult(_0x38961f,_0x382441){_0x382441=_0x382441||0xc8;return function(_0x4af81a){if(_0x4af81a){return _0x38961f[_0x714b('0x20')](_0x382441)[_0x714b('0x21')](_0x4af81a);}};}function respondWithFilteredResult(_0x3aa75e,_0x41376c){return function(_0x4dca3b){if(_0x4dca3b){var _0x2f9b9d=_0x4dca3b[_0x714b('0x22')],_0x5aa3a6=_0x41376c[_0x714b('0x23')],_0x2c7161=_0x41376c['offset']+_0x41376c['limit'],_0x1e43d5;if(_0x2c7161>=_0x2f9b9d){_0x2c7161=_0x2f9b9d;_0x1e43d5=0xc8;}else{_0x1e43d5=0xce;}_0x3aa75e[_0x714b('0x20')](_0x1e43d5);return _0x3aa75e['set'](_0x714b('0x24'),_0x5aa3a6+'-'+_0x2c7161+'/'+_0x2f9b9d)[_0x714b('0x21')](_0x4dca3b);}return null;};}function patchUpdates(_0x4421d5){return function(_0x6e6a40){try{jsonpatch[_0x714b('0x25')](_0x6e6a40,_0x4421d5,!![]);}catch(_0x1f4678){return BPromise['reject'](_0x1f4678);}return _0x6e6a40['save']();};}function saveUpdates(_0x6fbf8f,_0x4286bf){return function(_0x1215a3){if(_0x1215a3){return _0x1215a3['update'](_0x6fbf8f)[_0x714b('0x16')](function(_0x42362d){return _0x42362d;});}return null;};}function removeEntity(_0x4e2cb5,_0x3e49ee){return function(_0x456ca3){if(_0x456ca3){return _0x456ca3[_0x714b('0x26')]()[_0x714b('0x16')](function(){_0x4e2cb5[_0x714b('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50e8ed,_0x3a23d5){return function(_0x1eb1d0){if(!_0x1eb1d0){_0x50e8ed[_0x714b('0x1f')](0x194);}return _0x1eb1d0;};}function handleError(_0x1e5805,_0x3c6585){_0x3c6585=_0x3c6585||0x1f4;return function(_0x2b8f9f){logger['error'](_0x2b8f9f[_0x714b('0x27')]);if(_0x2b8f9f['name']){delete _0x2b8f9f[_0x714b('0x28')];}_0x1e5805[_0x714b('0x20')](_0x3c6585)[_0x714b('0x29')](_0x2b8f9f);};}exports[_0x714b('0x2a')]=function(_0x1b1ad1,_0x5d2437){var _0x2cec3e={},_0x2fc876={},_0x3b28af={'count':0x0,'rows':[]};var _0x236eb6=db[_0x714b('0x2b')][_0x714b('0x2c')];_0x2fc876[_0x714b('0x2d')]=_[_0x714b('0x2e')](_0x236eb6);_0x2fc876[_0x714b('0x2f')]=_[_0x714b('0x2e')](_0x1b1ad1[_0x714b('0x2f')]);_0x2fc876[_0x714b('0x30')]=_['intersection'](_0x2fc876[_0x714b('0x2d')],_0x2fc876['query']);_0x2cec3e[_0x714b('0x31')]=_['intersection'](_0x2fc876[_0x714b('0x2d')],qs[_0x714b('0x32')](_0x1b1ad1[_0x714b('0x2f')][_0x714b('0x32')]));_0x2cec3e[_0x714b('0x31')]=_0x2cec3e[_0x714b('0x31')]['length']?_0x2cec3e[_0x714b('0x31')]:_0x2fc876[_0x714b('0x2d')];if(!_0x1b1ad1[_0x714b('0x2f')][_0x714b('0x33')](_0x714b('0x34'))){_0x2cec3e[_0x714b('0x35')]=qs[_0x714b('0x35')](_0x1b1ad1[_0x714b('0x2f')][_0x714b('0x35')]);_0x2cec3e[_0x714b('0x23')]=qs['offset'](_0x1b1ad1[_0x714b('0x2f')][_0x714b('0x23')]);}_0x2cec3e[_0x714b('0x36')]=qs['sort'](_0x1b1ad1[_0x714b('0x2f')][_0x714b('0x37')]);_0x2cec3e[_0x714b('0x38')]=qs[_0x714b('0x30')](_[_0x714b('0x39')](_0x1b1ad1['query'],_0x2fc876['filters']));if(_0x1b1ad1['query'][_0x714b('0x3a')]){_0x2cec3e[_0x714b('0x38')]=_[_0x714b('0x3b')](_0x2cec3e[_0x714b('0x38')],{'$or':_[_0x714b('0x3c')](_0x236eb6,function(_0x5669d2){if(_0x5669d2[_0x714b('0x3d')]['key']!==_0x714b('0x3e')){var _0x49c600={};_0x49c600[_0x5669d2['field']]={'$like':'%'+_0x1b1ad1[_0x714b('0x2f')]['filter']+'%'};return _0x49c600;}})});}_0x2cec3e=_['merge']({},_0x2cec3e,_0x1b1ad1[_0x714b('0x3f')]);var _0x3093d7={'where':_0x2cec3e[_0x714b('0x38')]};return db[_0x714b('0x2b')]['count'](_0x3093d7)['then'](function(_0x584d63){_0x3b28af['count']=_0x584d63;if(_0x1b1ad1['query'][_0x714b('0x40')]){_0x2cec3e[_0x714b('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x714b('0x42')](_0x2cec3e);})[_0x714b('0x16')](function(_0x5ab954){_0x3b28af['rows']=_0x5ab954;return _0x3b28af;})[_0x714b('0x16')](respondWithFilteredResult(_0x5d2437,_0x2cec3e))[_0x714b('0x43')](handleError(_0x5d2437,null));};exports['show']=function(_0xade8ec,_0x3d3390){var _0x564bc1={'raw':![],'where':{'id':_0xade8ec['params']['id']}},_0x5119b3={};_0x5119b3['model']=_[_0x714b('0x2e')](db[_0x714b('0x2b')][_0x714b('0x2c')]);_0x5119b3[_0x714b('0x2f')]=_['keys'](_0xade8ec[_0x714b('0x2f')]);_0x5119b3[_0x714b('0x30')]=_[_0x714b('0x44')](_0x5119b3[_0x714b('0x2d')],_0x5119b3[_0x714b('0x2f')]);_0x564bc1[_0x714b('0x31')]=_[_0x714b('0x44')](_0x5119b3[_0x714b('0x2d')],qs['fields'](_0xade8ec[_0x714b('0x2f')]['fields']));_0x564bc1[_0x714b('0x31')]=_0x564bc1[_0x714b('0x31')][_0x714b('0x45')]?_0x564bc1[_0x714b('0x31')]:_0x5119b3['model'];if(_0xade8ec[_0x714b('0x2f')][_0x714b('0x40')]){_0x564bc1[_0x714b('0x41')]=[{'all':!![]}];}_0x564bc1=_[_0x714b('0x3b')]({},_0x564bc1,_0xade8ec[_0x714b('0x3f')]);return db['Dynamics365Configuration']['find'](_0x564bc1)[_0x714b('0x16')](handleEntityNotFound(_0x3d3390,null))['then'](respondWithResult(_0x3d3390,null))['catch'](handleError(_0x3d3390,null));};exports[_0x714b('0x46')]=function(_0x461c2b,_0x8ce7f1){return db[_0x714b('0x2b')][_0x714b('0x46')](_0x461c2b['body'],{})[_0x714b('0x16')](respondWithResult(_0x8ce7f1,0xc9))['catch'](handleError(_0x8ce7f1,null));};exports[_0x714b('0x47')]=function(_0x47ea24,_0x16b04a){if(_0x47ea24[_0x714b('0x48')]['id']){delete _0x47ea24['body']['id'];}return db['Dynamics365Configuration'][_0x714b('0x49')]({'where':{'id':_0x47ea24[_0x714b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16b04a,null))[_0x714b('0x16')](saveUpdates(_0x47ea24['body'],null))['then'](respondWithResult(_0x16b04a,null))[_0x714b('0x43')](handleError(_0x16b04a,null));};exports[_0x714b('0x26')]=function(_0x19dd55,_0x14f035){return db[_0x714b('0x2b')][_0x714b('0x49')]({'where':{'id':_0x19dd55['params']['id']}})[_0x714b('0x16')](handleEntityNotFound(_0x14f035,null))[_0x714b('0x16')](removeEntity(_0x14f035,null))[_0x714b('0x43')](handleError(_0x14f035,null));};exports[_0x714b('0x4b')]=function(_0x28b2b4,_0x2b5d49,_0x4273ab){var _0x8718c={};var _0x47baf1={};var _0x56e3c6;var _0x595c1f;return db[_0x714b('0x2b')]['findOne']({'where':{'id':_0x28b2b4['params']['id']}})[_0x714b('0x16')](handleEntityNotFound(_0x2b5d49,null))[_0x714b('0x16')](function(_0x3f4670){if(_0x3f4670){_0x56e3c6=_0x3f4670;_0x47baf1[_0x714b('0x2d')]=_[_0x714b('0x2e')](db[_0x714b('0x4c')][_0x714b('0x2c')]);_0x47baf1[_0x714b('0x2f')]=_[_0x714b('0x2e')](_0x28b2b4[_0x714b('0x2f')]);_0x47baf1['filters']=_['intersection'](_0x47baf1['model'],_0x47baf1[_0x714b('0x2f')]);_0x8718c[_0x714b('0x31')]=_[_0x714b('0x44')](_0x47baf1[_0x714b('0x2d')],qs[_0x714b('0x32')](_0x28b2b4[_0x714b('0x2f')][_0x714b('0x32')]));_0x8718c['attributes']=_0x8718c[_0x714b('0x31')]['length']?_0x8718c[_0x714b('0x31')]:_0x47baf1[_0x714b('0x2d')];_0x8718c[_0x714b('0x36')]=qs[_0x714b('0x37')](_0x28b2b4[_0x714b('0x2f')][_0x714b('0x37')]);_0x8718c[_0x714b('0x38')]=qs[_0x714b('0x30')](_['pick'](_0x28b2b4[_0x714b('0x2f')],_0x47baf1[_0x714b('0x30')]));if(_0x28b2b4[_0x714b('0x2f')]['filter']){_0x8718c['where']=_[_0x714b('0x3b')](_0x8718c[_0x714b('0x38')],{'$or':_['map'](_0x8718c[_0x714b('0x31')],function(_0x54737e){var _0x14e55b={};_0x14e55b[_0x54737e]={'$like':'%'+_0x28b2b4[_0x714b('0x2f')]['filter']+'%'};return _0x14e55b;})});}_0x8718c=_['merge']({},_0x8718c,_0x28b2b4['options']);return _0x56e3c6[_0x714b('0x4b')](_0x8718c);}})[_0x714b('0x16')](function(_0x2c2182){if(_0x2c2182){_0x595c1f=_0x2c2182['length'];if(!_0x28b2b4['query'][_0x714b('0x33')](_0x714b('0x34'))){_0x8718c[_0x714b('0x35')]=qs[_0x714b('0x35')](_0x28b2b4[_0x714b('0x2f')][_0x714b('0x35')]);_0x8718c[_0x714b('0x23')]=qs['offset'](_0x28b2b4['query']['offset']);}return _0x56e3c6[_0x714b('0x4b')](_0x8718c);}})['then'](function(_0x553401){if(_0x553401){return _0x553401?{'count':_0x595c1f,'rows':_0x553401}:null;}})[_0x714b('0x16')](respondWithResult(_0x2b5d49,null))[_0x714b('0x43')](handleError(_0x2b5d49,null));};exports[_0x714b('0x4d')]=function(_0x5a31cb,_0x464ad5,_0x570d0f){var _0x22b6ae={};var _0x20ba7e={};var _0x214d16;var _0x57a664;return db[_0x714b('0x2b')]['findOne']({'where':{'id':_0x5a31cb['params']['id']}})['then'](handleEntityNotFound(_0x464ad5,null))[_0x714b('0x16')](function(_0x229a35){if(_0x229a35){_0x214d16=_0x229a35;_0x20ba7e['model']=_[_0x714b('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x20ba7e[_0x714b('0x2f')]=_[_0x714b('0x2e')](_0x5a31cb[_0x714b('0x2f')]);_0x20ba7e['filters']=_[_0x714b('0x44')](_0x20ba7e[_0x714b('0x2d')],_0x20ba7e[_0x714b('0x2f')]);_0x22b6ae[_0x714b('0x31')]=_[_0x714b('0x44')](_0x20ba7e[_0x714b('0x2d')],qs[_0x714b('0x32')](_0x5a31cb['query'][_0x714b('0x32')]));_0x22b6ae['attributes']=_0x22b6ae['attributes'][_0x714b('0x45')]?_0x22b6ae[_0x714b('0x31')]:_0x20ba7e[_0x714b('0x2d')];_0x22b6ae[_0x714b('0x36')]=qs[_0x714b('0x37')](_0x5a31cb[_0x714b('0x2f')][_0x714b('0x37')]);_0x22b6ae[_0x714b('0x38')]=qs['filters'](_[_0x714b('0x39')](_0x5a31cb[_0x714b('0x2f')],_0x20ba7e[_0x714b('0x30')]));if(_0x5a31cb[_0x714b('0x2f')][_0x714b('0x3a')]){_0x22b6ae[_0x714b('0x38')]=_[_0x714b('0x3b')](_0x22b6ae[_0x714b('0x38')],{'$or':_[_0x714b('0x3c')](_0x22b6ae[_0x714b('0x31')],function(_0x588b23){var _0x41bd4c={};_0x41bd4c[_0x588b23]={'$like':'%'+_0x5a31cb[_0x714b('0x2f')][_0x714b('0x3a')]+'%'};return _0x41bd4c;})});}_0x22b6ae=_['merge']({},_0x22b6ae,_0x5a31cb['options']);return _0x214d16['getSubjects'](_0x22b6ae);}})[_0x714b('0x16')](function(_0x55d414){if(_0x55d414){_0x57a664=_0x55d414[_0x714b('0x45')];if(!_0x5a31cb[_0x714b('0x2f')][_0x714b('0x33')]('nolimit')){_0x22b6ae[_0x714b('0x35')]=qs['limit'](_0x5a31cb[_0x714b('0x2f')]['limit']);_0x22b6ae[_0x714b('0x23')]=qs[_0x714b('0x23')](_0x5a31cb[_0x714b('0x2f')][_0x714b('0x23')]);}return _0x214d16['getSubjects'](_0x22b6ae);}})[_0x714b('0x16')](function(_0x3642cf){if(_0x3642cf){return _0x3642cf?{'count':_0x57a664,'rows':_0x3642cf}:null;}})[_0x714b('0x16')](respondWithResult(_0x464ad5,null))[_0x714b('0x43')](handleError(_0x464ad5,null));};exports[_0x714b('0x4e')]=function(_0x2ea35a,_0x1767ef,_0xaf4051){var _0x269f57={};var _0x45c6e9={};var _0x4b5cab;var _0x128d71;return db[_0x714b('0x2b')]['findOne']({'where':{'id':_0x2ea35a[_0x714b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1767ef,null))[_0x714b('0x16')](function(_0x2f5301){if(_0x2f5301){_0x4b5cab=_0x2f5301;_0x45c6e9[_0x714b('0x2d')]=_[_0x714b('0x2e')](db[_0x714b('0x4c')][_0x714b('0x2c')]);_0x45c6e9[_0x714b('0x2f')]=_[_0x714b('0x2e')](_0x2ea35a[_0x714b('0x2f')]);_0x45c6e9[_0x714b('0x30')]=_[_0x714b('0x44')](_0x45c6e9[_0x714b('0x2d')],_0x45c6e9['query']);_0x269f57['attributes']=_[_0x714b('0x44')](_0x45c6e9['model'],qs[_0x714b('0x32')](_0x2ea35a[_0x714b('0x2f')][_0x714b('0x32')]));_0x269f57['attributes']=_0x269f57[_0x714b('0x31')]['length']?_0x269f57[_0x714b('0x31')]:_0x45c6e9[_0x714b('0x2d')];_0x269f57[_0x714b('0x36')]=qs['sort'](_0x2ea35a[_0x714b('0x2f')][_0x714b('0x37')]);_0x269f57[_0x714b('0x38')]=qs[_0x714b('0x30')](_[_0x714b('0x39')](_0x2ea35a[_0x714b('0x2f')],_0x45c6e9[_0x714b('0x30')]));if(_0x2ea35a[_0x714b('0x2f')][_0x714b('0x3a')]){_0x269f57[_0x714b('0x38')]=_['merge'](_0x269f57['where'],{'$or':_[_0x714b('0x3c')](_0x269f57[_0x714b('0x31')],function(_0x2004b1){var _0x5d7cc2={};_0x5d7cc2[_0x2004b1]={'$like':'%'+_0x2ea35a['query'][_0x714b('0x3a')]+'%'};return _0x5d7cc2;})});}_0x269f57=_[_0x714b('0x3b')]({},_0x269f57,_0x2ea35a['options']);return _0x4b5cab['getDescriptions'](_0x269f57);}})[_0x714b('0x16')](function(_0x5aa21e){if(_0x5aa21e){_0x128d71=_0x5aa21e['length'];if(!_0x2ea35a[_0x714b('0x2f')]['hasOwnProperty'](_0x714b('0x34'))){_0x269f57[_0x714b('0x35')]=qs[_0x714b('0x35')](_0x2ea35a[_0x714b('0x2f')]['limit']);_0x269f57[_0x714b('0x23')]=qs[_0x714b('0x23')](_0x2ea35a[_0x714b('0x2f')]['offset']);}return _0x4b5cab[_0x714b('0x4e')](_0x269f57);}})[_0x714b('0x16')](function(_0x2d3147){if(_0x2d3147){return _0x2d3147?{'count':_0x128d71,'rows':_0x2d3147}:null;}})[_0x714b('0x16')](respondWithResult(_0x1767ef,null))['catch'](handleError(_0x1767ef,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 180aec0..83b1902 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 _0xbd51=['bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd51,0xab));var _0x1bd5=function(_0x44d354,_0x1eba00){_0x44d354=_0x44d354-0x0;var _0x288f3f=_0xbd51[_0x44d354];return _0x288f3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1bd5('0x0'));var rp=require(_0x1bd5('0x1'));var fs=require('fs');var path=require(_0x1bd5('0x2'));var rimraf=require(_0x1bd5('0x3'));var config=require('../../config/environment');var attributes=require(_0x1bd5('0x4'));module[_0x1bd5('0x5')]=function(_0xaa663d,_0x3e1f7a){return _0xaa663d[_0x1bd5('0x6')](_0x1bd5('0x7'),attributes,{'tableName':_0x1bd5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fa8=['exports','define','int_dynamics365_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3f1f6e,_0x5c294a){var _0x5a80e8=function(_0x62dda7){while(--_0x62dda7){_0x3f1f6e['push'](_0x3f1f6e['shift']());}};_0x5a80e8(++_0x5c294a);}(_0x4fa8,0x12e));var _0x84fa=function(_0x23f294,_0x5a6d6d){_0x23f294=_0x23f294-0x0;var _0x3a7d05=_0x4fa8[_0x23f294];return _0x3a7d05;};'use strict';var _=require(_0x84fa('0x0'));var util=require('util');var logger=require(_0x84fa('0x1'))(_0x84fa('0x2'));var moment=require(_0x84fa('0x3'));var BPromise=require(_0x84fa('0x4'));var rp=require(_0x84fa('0x5'));var fs=require('fs');var path=require(_0x84fa('0x6'));var rimraf=require(_0x84fa('0x7'));var config=require(_0x84fa('0x8'));var attributes=require(_0x84fa('0x9'));module[_0x84fa('0xa')]=function(_0x594b2e,_0x3c928b){return _0x594b2e[_0x84fa('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x84fa('0xc'),'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 047051d..af9959f 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 _0x12ff=['rpc','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x24e3f0,_0x291458){var _0x36b770=function(_0xc2ccf7){while(--_0xc2ccf7){_0x24e3f0['push'](_0x24e3f0['shift']());}};_0x36b770(++_0x291458);}(_0x12ff,0xf7));var _0xf12f=function(_0x1b8deb,_0x5e1419){_0x1b8deb=_0x1b8deb-0x0;var _0x539899=_0x12ff[_0x1b8deb];return _0x539899;};'use strict';var _=require(_0xf12f('0x0'));var util=require(_0xf12f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf12f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf12f('0x3'))['db'];var utils=require(_0xf12f('0x4'));var logger=require('../../config/logger')(_0xf12f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf12f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a9773,_0x33b127,_0x5a4777){return new BPromise(function(_0x23c8d7,_0x5e1cf5){return client[_0xf12f('0x7')](_0x1a9773,_0x5a4777)[_0xf12f('0x8')](function(_0x139cf3){logger[_0xf12f('0x9')](_0xf12f('0xa'),_0x33b127,_0xf12f('0xb'));logger[_0xf12f('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x33b127,_0xf12f('0xb'),JSON[_0xf12f('0xd')](_0x139cf3));if(_0x139cf3['error']){if(_0x139cf3['error'][_0xf12f('0xe')]===0x1f4){logger[_0xf12f('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x33b127,_0x139cf3[_0xf12f('0xf')][_0xf12f('0x10')]);return _0x5e1cf5(_0x139cf3[_0xf12f('0xf')]['message']);}logger[_0xf12f('0xf')](_0xf12f('0xa'),_0x33b127,_0x139cf3['error'][_0xf12f('0x10')]);return _0x23c8d7(_0x139cf3[_0xf12f('0xf')][_0xf12f('0x10')]);}else{logger[_0xf12f('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x33b127,'request\x20sent');_0x23c8d7(_0x139cf3[_0xf12f('0x11')][_0xf12f('0x10')]);}})['catch'](function(_0x1ebbdd){logger['error'](_0xf12f('0xa'),_0x33b127,_0x1ebbdd);_0x5e1cf5(_0x1ebbdd);});});} \ No newline at end of file +var _0xd7f8=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd7f8,0xb2));var _0x8d7f=function(_0x113328,_0x2b62a3){_0x113328=_0x113328-0x0;var _0x20043d=_0xd7f8[_0x113328];return _0x20043d;};'use strict';var _=require(_0x8d7f('0x0'));var util=require(_0x8d7f('0x1'));var moment=require(_0x8d7f('0x2'));var BPromise=require(_0x8d7f('0x3'));var rs=require(_0x8d7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d7f('0x5'))['db'];var utils=require(_0x8d7f('0x6'));var logger=require('../../config/logger')(_0x8d7f('0x7'));var config=require(_0x8d7f('0x8'));var jayson=require(_0x8d7f('0x9'));var client=jayson[_0x8d7f('0xa')][_0x8d7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1834aa,_0xecd6fe,_0x2c01af){return new BPromise(function(_0x536b0c,_0x584b96){return client['request'](_0x1834aa,_0x2c01af)['then'](function(_0x4486d1){logger[_0x8d7f('0xc')](_0x8d7f('0xd'),_0xecd6fe,_0x8d7f('0xe'));logger[_0x8d7f('0xf')](_0x8d7f('0x10'),_0xecd6fe,_0x8d7f('0xe'),JSON[_0x8d7f('0x11')](_0x4486d1));if(_0x4486d1[_0x8d7f('0x12')]){if(_0x4486d1[_0x8d7f('0x12')]['code']===0x1f4){logger['error'](_0x8d7f('0xd'),_0xecd6fe,_0x4486d1[_0x8d7f('0x12')][_0x8d7f('0x13')]);return _0x584b96(_0x4486d1[_0x8d7f('0x12')][_0x8d7f('0x13')]);}logger[_0x8d7f('0x12')](_0x8d7f('0xd'),_0xecd6fe,_0x4486d1['error']['message']);return _0x536b0c(_0x4486d1[_0x8d7f('0x12')]['message']);}else{logger[_0x8d7f('0xc')](_0x8d7f('0xd'),_0xecd6fe,_0x8d7f('0xe'));_0x536b0c(_0x4486d1[_0x8d7f('0x14')][_0x8d7f('0x13')]);}})[_0x8d7f('0x15')](function(_0x59ea2b){logger[_0x8d7f('0x12')](_0x8d7f('0xd'),_0xecd6fe,_0x59ea2b);_0x584b96(_0x59ea2b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2044def..72ebeeb 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 _0xaf3f=['multer','path','Router','../../components/auth/service','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x5755f2,_0x9750a1){var _0x8e205c=function(_0x28cb62){while(--_0x28cb62){_0x5755f2['push'](_0x5755f2['shift']());}};_0x8e205c(++_0x9750a1);}(_0xaf3f,0x1ed));var _0xfaf3=function(_0x4adf17,_0x54bbac){_0x4adf17=_0x4adf17-0x0;var _0xacc67a=_0xaf3f[_0x4adf17];return _0xacc67a;};'use strict';var multer=require(_0xfaf3('0x0'));var util=require('util');var path=require(_0xfaf3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfaf3('0x2')]();var auth=require(_0xfaf3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfaf3('0x4'));router[_0xfaf3('0x5')]('/',auth['isAuthenticated'](),controller[_0xfaf3('0x6')]);router[_0xfaf3('0x5')](_0xfaf3('0x7'),auth[_0xfaf3('0x8')](),controller[_0xfaf3('0x9')]);router[_0xfaf3('0xa')]('/',auth['isAuthenticated'](),controller[_0xfaf3('0xb')]);router[_0xfaf3('0xc')](_0xfaf3('0x7'),auth[_0xfaf3('0x8')](),controller[_0xfaf3('0xd')]);router[_0xfaf3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfaf3('0xf')]);module[_0xfaf3('0x10')]=router; \ No newline at end of file +var _0xf91b=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5be2ba,_0x1621ba){var _0x162f9f=function(_0x1bd8f3){while(--_0x1bd8f3){_0x5be2ba['push'](_0x5be2ba['shift']());}};_0x162f9f(++_0x1621ba);}(_0xf91b,0xf9));var _0xbf91=function(_0x14ae3f,_0x33a8ad){_0x14ae3f=_0x14ae3f-0x0;var _0x3018b8=_0xf91b[_0x14ae3f];return _0x3018b8;};'use strict';var multer=require(_0xbf91('0x0'));var util=require(_0xbf91('0x1'));var path=require(_0xbf91('0x2'));var timeout=require(_0xbf91('0x3'));var express=require(_0xbf91('0x4'));var router=express[_0xbf91('0x5')]();var auth=require(_0xbf91('0x6'));var interaction=require(_0xbf91('0x7'));var config=require(_0xbf91('0x8'));var controller=require('./intDynamics365Field.controller');router[_0xbf91('0x9')]('/',auth[_0xbf91('0xa')](),controller[_0xbf91('0xb')]);router[_0xbf91('0x9')](_0xbf91('0xc'),auth[_0xbf91('0xa')](),controller[_0xbf91('0xd')]);router[_0xbf91('0xe')]('/',auth['isAuthenticated'](),controller[_0xbf91('0xf')]);router[_0xbf91('0x10')](_0xbf91('0xc'),auth[_0xbf91('0xa')](),controller[_0xbf91('0x11')]);router[_0xbf91('0x12')](_0xbf91('0xc'),auth[_0xbf91('0xa')](),controller[_0xbf91('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0c60107..56d45e5 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 _0xf4eb=['string','variable','sequelize','customVariable','STRING','ENUM'];(function(_0x432075,_0x308bed){var _0x575582=function(_0x1337e7){while(--_0x1337e7){_0x432075['push'](_0x432075['shift']());}};_0x575582(++_0x308bed);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e9776,_0x1e68af){_0x5e9776=_0x5e9776-0x0;var _0x1cbd87=_0xf4eb[_0x5e9776];return _0x1cbd87;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xbf4e('0x1'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf4e('0x2')]},'key':{'type':Sequelize[_0xbf4e('0x2')]},'keyType':{'type':Sequelize[_0xbf4e('0x3')](_0xbf4e('0x4'),_0xbf4e('0x5'),_0xbf4e('0x1'))},'keyContent':{'type':Sequelize[_0xbf4e('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf4e('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb4e6=['customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xb4e6[_0x318410];return _0x2898a3;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),_0x6b4e('0x4'),_0x6b4e('0x5')),'defaultValue':_0x6b4e('0x2')},'content':{'type':Sequelize[_0x6b4e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6b4e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ba79d7f..e799c42 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 _0x5dc5=['keys','query','attributes','intersection','fields','length','order','sort','filters','filter','merge','where','map','type','key','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','Dynamics365Field','rawAttributes','model'];(function(_0x56419d,_0x59ae72){var _0x521190=function(_0x3e31a9){while(--_0x3e31a9){_0x56419d['push'](_0x56419d['shift']());}};_0x521190(++_0x59ae72);}(_0x5dc5,0x15f));var _0x55dc=function(_0x50c42a,_0xf70cc9){_0x50c42a=_0x50c42a-0x0;var _0x1f9d0a=_0x5dc5[_0x50c42a];return _0x1f9d0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x55dc('0x0'));var rimraf=require(_0x55dc('0x1'));var zipdir=require(_0x55dc('0x2'));var jsonpatch=require(_0x55dc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x55dc('0x4'));var Mustache=require(_0x55dc('0x5'));var util=require(_0x55dc('0x6'));var path=require(_0x55dc('0x7'));var sox=require('sox');var csv=require(_0x55dc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x55dc('0x9'));var squel=require(_0x55dc('0xa'));var crypto=require('crypto');var jsforce=require(_0x55dc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x55dc('0x8'));var querystring=require(_0x55dc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x55dc('0xd'));var logger=require(_0x55dc('0xe'))(_0x55dc('0xf'));var utils=require(_0x55dc('0x10'));var config=require(_0x55dc('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3747c7,_0x1895cb){_0x1895cb=_0x1895cb||0xcc;return function(_0x4fae16){if(_0x4fae16){return _0x3747c7[_0x55dc('0x12')](_0x1895cb);}return _0x3747c7['status'](_0x1895cb)[_0x55dc('0x13')]();};}function respondWithResult(_0x1ecdef,_0xf4ab39){_0xf4ab39=_0xf4ab39||0xc8;return function(_0x2a2a44){if(_0x2a2a44){return _0x1ecdef[_0x55dc('0x14')](_0xf4ab39)[_0x55dc('0x15')](_0x2a2a44);}};}function respondWithFilteredResult(_0x24b8ed,_0x7ed92){return function(_0x1dfa13){if(_0x1dfa13){var _0x28224d=_0x1dfa13[_0x55dc('0x16')],_0x1fafba=_0x7ed92[_0x55dc('0x17')],_0x177635=_0x7ed92[_0x55dc('0x17')]+_0x7ed92[_0x55dc('0x18')],_0x48f173;if(_0x177635>=_0x28224d){_0x177635=_0x28224d;_0x48f173=0xc8;}else{_0x48f173=0xce;}_0x24b8ed[_0x55dc('0x14')](_0x48f173);return _0x24b8ed[_0x55dc('0x19')](_0x55dc('0x1a'),_0x1fafba+'-'+_0x177635+'/'+_0x28224d)[_0x55dc('0x15')](_0x1dfa13);}return null;};}function patchUpdates(_0x3e7efd){return function(_0x380573){try{jsonpatch[_0x55dc('0x1b')](_0x380573,_0x3e7efd,!![]);}catch(_0x1df955){return BPromise[_0x55dc('0x1c')](_0x1df955);}return _0x380573['save']();};}function saveUpdates(_0x21b5c2,_0xb39b04){return function(_0x2e7351){if(_0x2e7351){return _0x2e7351[_0x55dc('0x1d')](_0x21b5c2)[_0x55dc('0x1e')](function(_0x3651a3){return _0x3651a3;});}return null;};}function removeEntity(_0x5750a6,_0x1d6f1c){return function(_0x2796ed){if(_0x2796ed){return _0x2796ed['destroy']()['then'](function(){_0x5750a6[_0x55dc('0x14')](0xcc)[_0x55dc('0x13')]();});}};}function handleEntityNotFound(_0x119484,_0xbfd1b1){return function(_0x29f3c6){if(!_0x29f3c6){_0x119484[_0x55dc('0x12')](0x194);}return _0x29f3c6;};}function handleError(_0x45e0ea,_0x1d1628){_0x1d1628=_0x1d1628||0x1f4;return function(_0x456a0d){logger[_0x55dc('0x1f')](_0x456a0d[_0x55dc('0x20')]);if(_0x456a0d['name']){delete _0x456a0d[_0x55dc('0x21')];}_0x45e0ea[_0x55dc('0x14')](_0x1d1628)[_0x55dc('0x22')](_0x456a0d);};}exports[_0x55dc('0x23')]=function(_0x4d528d,_0x6f68be){var _0x13c49c={},_0x5ca0bd={},_0x4741e9={'count':0x0,'rows':[]};var _0xa7c13f=db[_0x55dc('0x24')][_0x55dc('0x25')];_0x5ca0bd[_0x55dc('0x26')]=_[_0x55dc('0x27')](_0xa7c13f);_0x5ca0bd[_0x55dc('0x28')]=_[_0x55dc('0x27')](_0x4d528d[_0x55dc('0x28')]);_0x5ca0bd['filters']=_['intersection'](_0x5ca0bd[_0x55dc('0x26')],_0x5ca0bd[_0x55dc('0x28')]);_0x13c49c[_0x55dc('0x29')]=_[_0x55dc('0x2a')](_0x5ca0bd[_0x55dc('0x26')],qs[_0x55dc('0x2b')](_0x4d528d['query'][_0x55dc('0x2b')]));_0x13c49c['attributes']=_0x13c49c[_0x55dc('0x29')][_0x55dc('0x2c')]?_0x13c49c['attributes']:_0x5ca0bd[_0x55dc('0x26')];if(!_0x4d528d['query']['hasOwnProperty']('nolimit')){_0x13c49c[_0x55dc('0x18')]=qs[_0x55dc('0x18')](_0x4d528d[_0x55dc('0x28')]['limit']);_0x13c49c[_0x55dc('0x17')]=qs[_0x55dc('0x17')](_0x4d528d['query'][_0x55dc('0x17')]);}_0x13c49c[_0x55dc('0x2d')]=qs[_0x55dc('0x2e')](_0x4d528d['query'][_0x55dc('0x2e')]);_0x13c49c['where']=qs[_0x55dc('0x2f')](_['pick'](_0x4d528d[_0x55dc('0x28')],_0x5ca0bd[_0x55dc('0x2f')]));if(_0x4d528d[_0x55dc('0x28')][_0x55dc('0x30')]){_0x13c49c['where']=_[_0x55dc('0x31')](_0x13c49c[_0x55dc('0x32')],{'$or':_[_0x55dc('0x33')](_0xa7c13f,function(_0xf92a5){if(_0xf92a5[_0x55dc('0x34')][_0x55dc('0x35')]!=='VIRTUAL'){var _0x31d6bb={};_0x31d6bb[_0xf92a5['field']]={'$like':'%'+_0x4d528d[_0x55dc('0x28')][_0x55dc('0x30')]+'%'};return _0x31d6bb;}})});}_0x13c49c=_[_0x55dc('0x31')]({},_0x13c49c,_0x4d528d[_0x55dc('0x36')]);var _0x165c26={'where':_0x13c49c[_0x55dc('0x32')]};return db[_0x55dc('0x24')][_0x55dc('0x16')](_0x165c26)[_0x55dc('0x1e')](function(_0x5d4c5b){_0x4741e9[_0x55dc('0x16')]=_0x5d4c5b;if(_0x4d528d[_0x55dc('0x28')][_0x55dc('0x37')]){_0x13c49c[_0x55dc('0x38')]=[{'all':!![]}];}return db[_0x55dc('0x24')][_0x55dc('0x39')](_0x13c49c);})[_0x55dc('0x1e')](function(_0x547b06){_0x4741e9[_0x55dc('0x3a')]=_0x547b06;return _0x4741e9;})[_0x55dc('0x1e')](respondWithFilteredResult(_0x6f68be,_0x13c49c))[_0x55dc('0x3b')](handleError(_0x6f68be,null));};exports[_0x55dc('0x3c')]=function(_0xe5bc5,_0x2292f6){var _0x4240da={'raw':!![],'where':{'id':_0xe5bc5[_0x55dc('0x3d')]['id']}},_0x3f2d74={};_0x3f2d74['model']=_[_0x55dc('0x27')](db[_0x55dc('0x24')][_0x55dc('0x25')]);_0x3f2d74['query']=_[_0x55dc('0x27')](_0xe5bc5[_0x55dc('0x28')]);_0x3f2d74[_0x55dc('0x2f')]=_['intersection'](_0x3f2d74[_0x55dc('0x26')],_0x3f2d74[_0x55dc('0x28')]);_0x4240da[_0x55dc('0x29')]=_[_0x55dc('0x2a')](_0x3f2d74['model'],qs[_0x55dc('0x2b')](_0xe5bc5[_0x55dc('0x28')]['fields']));_0x4240da['attributes']=_0x4240da[_0x55dc('0x29')][_0x55dc('0x2c')]?_0x4240da['attributes']:_0x3f2d74[_0x55dc('0x26')];if(_0xe5bc5['query'][_0x55dc('0x37')]){_0x4240da[_0x55dc('0x38')]=[{'all':!![]}];}_0x4240da=_[_0x55dc('0x31')]({},_0x4240da,_0xe5bc5[_0x55dc('0x36')]);return db['Dynamics365Field'][_0x55dc('0x3e')](_0x4240da)[_0x55dc('0x1e')](handleEntityNotFound(_0x2292f6,null))[_0x55dc('0x1e')](respondWithResult(_0x2292f6,null))[_0x55dc('0x3b')](handleError(_0x2292f6,null));};exports['create']=function(_0x497ef8,_0x13ad6d){return db[_0x55dc('0x24')]['create'](_0x497ef8[_0x55dc('0x3f')],{})['then'](respondWithResult(_0x13ad6d,0xc9))[_0x55dc('0x3b')](handleError(_0x13ad6d,null));};exports['update']=function(_0x3d4419,_0x4be801){if(_0x3d4419[_0x55dc('0x3f')]['id']){delete _0x3d4419[_0x55dc('0x3f')]['id'];}return db[_0x55dc('0x24')][_0x55dc('0x3e')]({'where':{'id':_0x3d4419[_0x55dc('0x3d')]['id']}})[_0x55dc('0x1e')](handleEntityNotFound(_0x4be801,null))[_0x55dc('0x1e')](saveUpdates(_0x3d4419['body'],null))[_0x55dc('0x1e')](respondWithResult(_0x4be801,null))['catch'](handleError(_0x4be801,null));};exports[_0x55dc('0x40')]=function(_0x56e178,_0x51d5bc){return db['Dynamics365Field'][_0x55dc('0x3e')]({'where':{'id':_0x56e178[_0x55dc('0x3d')]['id']}})['then'](handleEntityNotFound(_0x51d5bc,null))[_0x55dc('0x1e')](removeEntity(_0x51d5bc,null))[_0x55dc('0x3b')](handleError(_0x51d5bc,null));}; \ No newline at end of file +var _0xe7d0=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','error','name','send','index','Dynamics365Field','rawAttributes','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x1e39d3,_0x24e06a){var _0x35d053=function(_0x3731ee){while(--_0x3731ee){_0x1e39d3['push'](_0x1e39d3['shift']());}};_0x35d053(++_0x24e06a);}(_0xe7d0,0x14a));var _0x0e7d=function(_0x217f07,_0x578ea7){_0x217f07=_0x217f07-0x0;var _0x48102e=_0xe7d0[_0x217f07];return _0x48102e;};'use strict';var pdf=require(_0x0e7d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0e7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e7d('0x2'));var rp=require(_0x0e7d('0x3'));var moment=require(_0x0e7d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e7d('0x5'));var path=require('path');var sox=require(_0x0e7d('0x6'));var csv=require(_0x0e7d('0x7'));var ejs=require(_0x0e7d('0x8'));var fs=require('fs');var _=require(_0x0e7d('0x9'));var squel=require(_0x0e7d('0xa'));var crypto=require(_0x0e7d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0e7d('0xc'));var toCsv=require(_0x0e7d('0x7'));var querystring=require(_0x0e7d('0xd'));var Papa=require(_0x0e7d('0xe'));var Redis=require(_0x0e7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e7d('0x10'));var hardwareService=require(_0x0e7d('0x11'));var logger=require(_0x0e7d('0x12'))(_0x0e7d('0x13'));var utils=require(_0x0e7d('0x14'));var config=require(_0x0e7d('0x15'));var db=require(_0x0e7d('0x16'))['db'];function respondWithStatusCode(_0x223400,_0x38d94b){_0x38d94b=_0x38d94b||0xcc;return function(_0x5742a7){if(_0x5742a7){return _0x223400[_0x0e7d('0x17')](_0x38d94b);}return _0x223400['status'](_0x38d94b)[_0x0e7d('0x18')]();};}function respondWithResult(_0x45465e,_0x34ae2c){_0x34ae2c=_0x34ae2c||0xc8;return function(_0x4cfe7f){if(_0x4cfe7f){return _0x45465e[_0x0e7d('0x19')](_0x34ae2c)[_0x0e7d('0x1a')](_0x4cfe7f);}};}function respondWithFilteredResult(_0xbbd6b,_0x2f06cf){return function(_0x420027){if(_0x420027){var _0x6cbe4b=_0x420027[_0x0e7d('0x1b')],_0x4dee61=_0x2f06cf['offset'],_0x8f1f95=_0x2f06cf[_0x0e7d('0x1c')]+_0x2f06cf[_0x0e7d('0x1d')],_0x83cc92;if(_0x8f1f95>=_0x6cbe4b){_0x8f1f95=_0x6cbe4b;_0x83cc92=0xc8;}else{_0x83cc92=0xce;}_0xbbd6b[_0x0e7d('0x19')](_0x83cc92);return _0xbbd6b[_0x0e7d('0x1e')](_0x0e7d('0x1f'),_0x4dee61+'-'+_0x8f1f95+'/'+_0x6cbe4b)[_0x0e7d('0x1a')](_0x420027);}return null;};}function patchUpdates(_0x34a7ec){return function(_0x4e11b8){try{jsonpatch['apply'](_0x4e11b8,_0x34a7ec,!![]);}catch(_0x235a91){return BPromise['reject'](_0x235a91);}return _0x4e11b8[_0x0e7d('0x20')]();};}function saveUpdates(_0x2e5834,_0x3b8874){return function(_0x33dac6){if(_0x33dac6){return _0x33dac6[_0x0e7d('0x21')](_0x2e5834)[_0x0e7d('0x22')](function(_0x1edb14){return _0x1edb14;});}return null;};}function removeEntity(_0x14b338,_0x16210d){return function(_0x420a11){if(_0x420a11){return _0x420a11['destroy']()['then'](function(){_0x14b338[_0x0e7d('0x19')](0xcc)[_0x0e7d('0x18')]();});}};}function handleEntityNotFound(_0x599537,_0x398af5){return function(_0x22f740){if(!_0x22f740){_0x599537[_0x0e7d('0x17')](0x194);}return _0x22f740;};}function handleError(_0x23d16a,_0x29469f){_0x29469f=_0x29469f||0x1f4;return function(_0x25ec51){logger[_0x0e7d('0x23')](_0x25ec51['stack']);if(_0x25ec51[_0x0e7d('0x24')]){delete _0x25ec51[_0x0e7d('0x24')];}_0x23d16a['status'](_0x29469f)[_0x0e7d('0x25')](_0x25ec51);};}exports[_0x0e7d('0x26')]=function(_0x2c36e0,_0x2248e4){var _0x3d7ead={},_0x45d6ba={},_0x3a1223={'count':0x0,'rows':[]};var _0x3306a0=db[_0x0e7d('0x27')][_0x0e7d('0x28')];_0x45d6ba['model']=_['keys'](_0x3306a0);_0x45d6ba[_0x0e7d('0x29')]=_[_0x0e7d('0x2a')](_0x2c36e0[_0x0e7d('0x29')]);_0x45d6ba[_0x0e7d('0x2b')]=_[_0x0e7d('0x2c')](_0x45d6ba[_0x0e7d('0x2d')],_0x45d6ba[_0x0e7d('0x29')]);_0x3d7ead[_0x0e7d('0x2e')]=_[_0x0e7d('0x2c')](_0x45d6ba[_0x0e7d('0x2d')],qs[_0x0e7d('0x2f')](_0x2c36e0[_0x0e7d('0x29')][_0x0e7d('0x2f')]));_0x3d7ead[_0x0e7d('0x2e')]=_0x3d7ead[_0x0e7d('0x2e')]['length']?_0x3d7ead[_0x0e7d('0x2e')]:_0x45d6ba['model'];if(!_0x2c36e0['query']['hasOwnProperty']('nolimit')){_0x3d7ead[_0x0e7d('0x1d')]=qs[_0x0e7d('0x1d')](_0x2c36e0[_0x0e7d('0x29')][_0x0e7d('0x1d')]);_0x3d7ead[_0x0e7d('0x1c')]=qs['offset'](_0x2c36e0['query'][_0x0e7d('0x1c')]);}_0x3d7ead[_0x0e7d('0x30')]=qs[_0x0e7d('0x31')](_0x2c36e0[_0x0e7d('0x29')]['sort']);_0x3d7ead[_0x0e7d('0x32')]=qs['filters'](_[_0x0e7d('0x33')](_0x2c36e0['query'],_0x45d6ba['filters']));if(_0x2c36e0[_0x0e7d('0x29')]['filter']){_0x3d7ead[_0x0e7d('0x32')]=_[_0x0e7d('0x34')](_0x3d7ead[_0x0e7d('0x32')],{'$or':_['map'](_0x3306a0,function(_0x541479){if(_0x541479[_0x0e7d('0x35')]['key']!==_0x0e7d('0x36')){var _0xf05c40={};_0xf05c40[_0x541479[_0x0e7d('0x37')]]={'$like':'%'+_0x2c36e0['query'][_0x0e7d('0x38')]+'%'};return _0xf05c40;}})});}_0x3d7ead=_[_0x0e7d('0x34')]({},_0x3d7ead,_0x2c36e0[_0x0e7d('0x39')]);var _0x46bd10={'where':_0x3d7ead[_0x0e7d('0x32')]};return db[_0x0e7d('0x27')][_0x0e7d('0x1b')](_0x46bd10)[_0x0e7d('0x22')](function(_0x52ff8a){_0x3a1223[_0x0e7d('0x1b')]=_0x52ff8a;if(_0x2c36e0['query']['includeAll']){_0x3d7ead[_0x0e7d('0x3a')]=[{'all':!![]}];}return db[_0x0e7d('0x27')][_0x0e7d('0x3b')](_0x3d7ead);})['then'](function(_0x571e3e){_0x3a1223[_0x0e7d('0x3c')]=_0x571e3e;return _0x3a1223;})[_0x0e7d('0x22')](respondWithFilteredResult(_0x2248e4,_0x3d7ead))[_0x0e7d('0x3d')](handleError(_0x2248e4,null));};exports[_0x0e7d('0x3e')]=function(_0x55efe9,_0x5ea4df){var _0x58c679={'raw':!![],'where':{'id':_0x55efe9[_0x0e7d('0x3f')]['id']}},_0x42986e={};_0x42986e['model']=_['keys'](db[_0x0e7d('0x27')][_0x0e7d('0x28')]);_0x42986e[_0x0e7d('0x29')]=_['keys'](_0x55efe9[_0x0e7d('0x29')]);_0x42986e[_0x0e7d('0x2b')]=_[_0x0e7d('0x2c')](_0x42986e['model'],_0x42986e['query']);_0x58c679[_0x0e7d('0x2e')]=_[_0x0e7d('0x2c')](_0x42986e[_0x0e7d('0x2d')],qs[_0x0e7d('0x2f')](_0x55efe9['query']['fields']));_0x58c679[_0x0e7d('0x2e')]=_0x58c679[_0x0e7d('0x2e')][_0x0e7d('0x40')]?_0x58c679['attributes']:_0x42986e['model'];if(_0x55efe9[_0x0e7d('0x29')][_0x0e7d('0x41')]){_0x58c679[_0x0e7d('0x3a')]=[{'all':!![]}];}_0x58c679=_[_0x0e7d('0x34')]({},_0x58c679,_0x55efe9[_0x0e7d('0x39')]);return db['Dynamics365Field'][_0x0e7d('0x42')](_0x58c679)['then'](handleEntityNotFound(_0x5ea4df,null))[_0x0e7d('0x22')](respondWithResult(_0x5ea4df,null))['catch'](handleError(_0x5ea4df,null));};exports[_0x0e7d('0x43')]=function(_0x4a267d,_0x28a982){return db[_0x0e7d('0x27')][_0x0e7d('0x43')](_0x4a267d[_0x0e7d('0x44')],{})[_0x0e7d('0x22')](respondWithResult(_0x28a982,0xc9))[_0x0e7d('0x3d')](handleError(_0x28a982,null));};exports[_0x0e7d('0x21')]=function(_0x2f195c,_0x3b3cf3){if(_0x2f195c[_0x0e7d('0x44')]['id']){delete _0x2f195c[_0x0e7d('0x44')]['id'];}return db[_0x0e7d('0x27')][_0x0e7d('0x42')]({'where':{'id':_0x2f195c[_0x0e7d('0x3f')]['id']}})[_0x0e7d('0x22')](handleEntityNotFound(_0x3b3cf3,null))['then'](saveUpdates(_0x2f195c[_0x0e7d('0x44')],null))[_0x0e7d('0x22')](respondWithResult(_0x3b3cf3,null))[_0x0e7d('0x3d')](handleError(_0x3b3cf3,null));};exports[_0x0e7d('0x45')]=function(_0x434381,_0x1170b8){return db['Dynamics365Field'][_0x0e7d('0x42')]({'where':{'id':_0x434381[_0x0e7d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1170b8,null))[_0x0e7d('0x22')](removeEntity(_0x1170b8,null))[_0x0e7d('0x3d')](handleError(_0x1170b8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 7fb67cd..d7aea1d 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x5b1e9b,_0x1bce88){var _0x4c55ed=function(_0x34cf6b){while(--_0x34cf6b){_0x5b1e9b['push'](_0x5b1e9b['shift']());}};_0x4c55ed(++_0x1bce88);}(_0xb10b,0x12a));var _0xbb10=function(_0x345865,_0x1d878d){_0x345865=_0x345865-0x0;var _0x2e14f4=_0xb10b[_0x345865];return _0x2e14f4;};'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')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x492157,_0x5d340b){var _0x30f379=function(_0x1924cf){while(--_0x1924cf){_0x492157['push'](_0x492157['shift']());}};_0x30f379(++_0x5d340b);}(_0x7a54,0x106));var _0x47a5=function(_0x4d56ec,_0x586b5c){_0x4d56ec=_0x4d56ec-0x0;var _0x21ff5a=_0x7a54[_0x4d56ec];return _0x21ff5a;};'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':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 6fc777c..6afd585 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 _0x09e4=['code','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x588cee,_0x220295){var _0x434fc0=function(_0x2c8293){while(--_0x2c8293){_0x588cee['push'](_0x588cee['shift']());}};_0x434fc0(++_0x220295);}(_0x09e4,0x1ce));var _0x409e=function(_0x4da1d1,_0x7e80bf){_0x4da1d1=_0x4da1d1-0x0;var _0x42b10c=_0x09e4[_0x4da1d1];return _0x42b10c;};'use strict';var _=require(_0x409e('0x0'));var util=require(_0x409e('0x1'));var moment=require(_0x409e('0x2'));var BPromise=require(_0x409e('0x3'));var rs=require(_0x409e('0x4'));var fs=require('fs');var Redis=require(_0x409e('0x5'));var db=require(_0x409e('0x6'))['db'];var utils=require(_0x409e('0x7'));var logger=require('../../config/logger')(_0x409e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x409e('0x9')][_0x409e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb9d17,_0x3f124e,_0x5d718e){return new BPromise(function(_0x21255d,_0x420144){return client[_0x409e('0xb')](_0xcb9d17,_0x5d718e)[_0x409e('0xc')](function(_0x5305d4){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3f124e,_0x409e('0xd'));logger[_0x409e('0xe')](_0x409e('0xf'),_0x3f124e,'request\x20sent',JSON[_0x409e('0x10')](_0x5305d4));if(_0x5305d4[_0x409e('0x11')]){if(_0x5305d4[_0x409e('0x11')][_0x409e('0x12')]===0x1f4){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);return _0x420144(_0x5305d4['error']['message']);}logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4['error'][_0x409e('0x14')]);return _0x21255d(_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);}else{logger[_0x409e('0x15')](_0x409e('0x13'),_0x3f124e,_0x409e('0xd'));_0x21255d(_0x5305d4[_0x409e('0x16')][_0x409e('0x14')]);}})[_0x409e('0x17')](function(_0x59fd27){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x59fd27);_0x420144(_0x59fd27);});});} \ No newline at end of file +var _0x86c0=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x86c0,0x133));var _0x086c=function(_0x5e4219,_0x2342a0){_0x5e4219=_0x5e4219-0x0;var _0x395815=_0x86c0[_0x5e4219];return _0x395815;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3b01c8f..90d3e24 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 _0x2f99=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','getFields','post','update','destroy'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x2f99,0xfd));var _0x92f9=function(_0x39f861,_0x1d4050){_0x39f861=_0x39f861-0x0;var _0x4582bf=_0x2f99[_0x39f861];return _0x4582bf;};'use strict';var multer=require('multer');var util=require(_0x92f9('0x0'));var path=require(_0x92f9('0x1'));var timeout=require(_0x92f9('0x2'));var express=require(_0x92f9('0x3'));var router=express[_0x92f9('0x4')]();var auth=require(_0x92f9('0x5'));var interaction=require(_0x92f9('0x6'));var config=require('../../config/environment');var controller=require(_0x92f9('0x7'));router[_0x92f9('0x8')]('/',auth[_0x92f9('0x9')](),controller['index']);router[_0x92f9('0x8')](_0x92f9('0xa'),auth[_0x92f9('0x9')](),controller[_0x92f9('0xb')]);router['get']('/:id/configurations',auth[_0x92f9('0x9')](),controller[_0x92f9('0xc')]);router['get']('/:id/fields',auth[_0x92f9('0x9')](),controller[_0x92f9('0xd')]);router['post']('/',auth[_0x92f9('0x9')](),controller['create']);router[_0x92f9('0xe')]('/:id/configurations',auth[_0x92f9('0x9')](),controller['addConfiguration']);router['put'](_0x92f9('0xa'),auth['isAuthenticated'](),controller[_0x92f9('0xf')]);router['delete'](_0x92f9('0xa'),auth['isAuthenticated'](),controller[_0x92f9('0x10')]);module[_0x92f9('0x11')]=router; \ No newline at end of file +var _0x3ef9=['express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4648b5,_0x439b4b){var _0x1c2e5d=function(_0x3fe8b8){while(--_0x3fe8b8){_0x4648b5['push'](_0x4648b5['shift']());}};_0x1c2e5d(++_0x439b4b);}(_0x3ef9,0x135));var _0x93ef=function(_0x1ccad2,_0x18301b){_0x1ccad2=_0x1ccad2-0x0;var _0x11b223=_0x3ef9[_0x1ccad2];return _0x11b223;};'use strict';var multer=require(_0x93ef('0x0'));var util=require('util');var path=require(_0x93ef('0x1'));var timeout=require(_0x93ef('0x2'));var express=require(_0x93ef('0x3'));var router=express[_0x93ef('0x4')]();var auth=require(_0x93ef('0x5'));var interaction=require(_0x93ef('0x6'));var config=require('../../config/environment');var controller=require(_0x93ef('0x7'));router[_0x93ef('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x93ef('0x8')](_0x93ef('0x9'),auth[_0x93ef('0xa')](),controller[_0x93ef('0xb')]);router[_0x93ef('0x8')]('/:id/configurations',auth[_0x93ef('0xa')](),controller[_0x93ef('0xc')]);router[_0x93ef('0x8')](_0x93ef('0xd'),auth['isAuthenticated'](),controller[_0x93ef('0xe')]);router[_0x93ef('0xf')]('/',auth['isAuthenticated'](),controller[_0x93ef('0x10')]);router[_0x93ef('0xf')](_0x93ef('0x11'),auth[_0x93ef('0xa')](),controller[_0x93ef('0x12')]);router[_0x93ef('0x13')](_0x93ef('0x9'),auth['isAuthenticated'](),controller[_0x93ef('0x14')]);router[_0x93ef('0x15')](_0x93ef('0x9'),auth['isAuthenticated'](),controller[_0x93ef('0x16')]);module[_0x93ef('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d010c41..418f465 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 _0x7b73=['STRING','username','sequelize'];(function(_0xc4c80a,_0x2a4c8c){var _0x303d16=function(_0x1d3db3){while(--_0x1d3db3){_0xc4c80a['push'](_0xc4c80a['shift']());}};_0x303d16(++_0x2a4c8c);}(_0x7b73,0x1e8));var _0x37b7=function(_0x582ae6,_0x57aa08){_0x582ae6=_0x582ae6-0x0;var _0x303447=_0x7b73[_0x582ae6];return _0x303447;};'use strict';var Sequelize=require(_0x37b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x37b7('0x1')]},'description':{'type':Sequelize[_0x37b7('0x1')]},'username':{'type':Sequelize[_0x37b7('0x1')],'unique':_0x37b7('0x2')},'apiKey':{'type':Sequelize[_0x37b7('0x1')]},'remoteUri':{'type':Sequelize[_0x37b7('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x37b7('0x1')]}}; \ No newline at end of file +var _0xfcd2=['exports','STRING','username','remoteUri','sequelize'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xfcd2,0x13f));var _0x2fcd=function(_0x1d7276,_0x1a60ec){_0x1d7276=_0x1d7276-0x0;var _0x345051=_0xfcd2[_0x1d7276];return _0x345051;};'use strict';var Sequelize=require(_0x2fcd('0x0'));module[_0x2fcd('0x1')]={'name':{'type':Sequelize[_0x2fcd('0x2')]},'description':{'type':Sequelize[_0x2fcd('0x2')]},'username':{'type':Sequelize[_0x2fcd('0x2')],'unique':_0x2fcd('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2fcd('0x2')],'unique':_0x2fcd('0x4')},'serverUrl':{'type':Sequelize[_0x2fcd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 174719f..ab117f1 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 _0x6d5e=['priority','group','company','remove','default','custom_text','choices','capitalize','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../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','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','key','VIRTUAL','field','count','includeAll','findAll','rows','show','include','options','find','create','body','params','findOne','pick','map','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','subject','agent'];(function(_0x41a809,_0x1422fb){var _0x5874cb=function(_0x252d3f){while(--_0x252d3f){_0x41a809['push'](_0x41a809['shift']());}};_0x5874cb(++_0x1422fb);}(_0x6d5e,0x103));var _0xe6d5=function(_0x65319a,_0x5d538a){_0x65319a=_0x65319a-0x0;var _0x469239=_0x6d5e[_0x65319a];return _0x469239;};'use strict';var pdf=require(_0xe6d5('0x0'));var emlformat=require(_0xe6d5('0x1'));var rimraf=require(_0xe6d5('0x2'));var zipdir=require(_0xe6d5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6d5('0x4'));var moment=require(_0xe6d5('0x5'));var BPromise=require(_0xe6d5('0x6'));var Mustache=require(_0xe6d5('0x7'));var util=require(_0xe6d5('0x8'));var path=require(_0xe6d5('0x9'));var sox=require(_0xe6d5('0xa'));var csv=require('to-csv');var ejs=require(_0xe6d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6d5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6d5('0xd'));var Papa=require(_0xe6d5('0xe'));var Redis=require(_0xe6d5('0xf'));var authService=require(_0xe6d5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe6d5('0x11'));var logger=require(_0xe6d5('0x12'))(_0xe6d5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe6d5('0x14'))['db'];var integrations=require(_0xe6d5('0x15'));var jayson=require(_0xe6d5('0x16'));var client=jayson[_0xe6d5('0x17')][_0xe6d5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x24c8f9,_0x1b6b5b,_0x4bc955){if(_0x4bc955){var _0x2f4123=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f4123[_0xe6d5('0x19')](_0x1b6b5b)){return _0x24c8f9;}else{throw new Error(_0xe6d5('0x1a'));}}else{return _0x24c8f9;}}function respondWithRpcPromise(_0x32dbdb,_0x88b75e,_0x42f2ba,_0x35599f){return new BPromise(function(_0x37ff40,_0x3c7b7a){var _0x49adf8=_0x35599f||client;return _0x49adf8[_0xe6d5('0x1b')](_0x32dbdb,_0x42f2ba)[_0xe6d5('0x1c')](function(_0x268ced){logger['info'](_0xe6d5('0x1d'),_0x88b75e,_0xe6d5('0x1e'));logger['debug'](_0xe6d5('0x1f'),_0x88b75e,'request\x20sent',JSON[_0xe6d5('0x20')](_0x268ced));if(_0x268ced['error']){if(_0x268ced['error'][_0xe6d5('0x21')]===0x1f4){logger['error'](_0xe6d5('0x1d'),_0x88b75e,_0x268ced[_0xe6d5('0x22')][_0xe6d5('0x23')]);return _0x3c7b7a(_0x268ced['error']['message']);}logger[_0xe6d5('0x22')](_0xe6d5('0x1d'),_0x88b75e,_0x268ced[_0xe6d5('0x22')][_0xe6d5('0x23')]);return _0x37ff40(_0x268ced[_0xe6d5('0x22')]['message']);}else{logger[_0xe6d5('0x24')](_0xe6d5('0x1d'),_0x88b75e,'request\x20sent');_0x37ff40(_0x268ced[_0xe6d5('0x25')][_0xe6d5('0x23')]);}})[_0xe6d5('0x26')](function(_0x49bd97){logger[_0xe6d5('0x22')](_0xe6d5('0x1d'),_0x88b75e,_0x49bd97);_0x3c7b7a(_0x49bd97);});});}function respondWithStatusCode(_0x11af80,_0x32bd59){_0x32bd59=_0x32bd59||0xcc;return function(_0x1be7b0){if(_0x1be7b0){return _0x11af80[_0xe6d5('0x27')](_0x32bd59);}return _0x11af80[_0xe6d5('0x28')](_0x32bd59)[_0xe6d5('0x29')]();};}function respondWithResult(_0x5546e6,_0x347343){_0x347343=_0x347343||0xc8;return function(_0x210b00){if(_0x210b00){return _0x5546e6[_0xe6d5('0x28')](_0x347343)[_0xe6d5('0x2a')](_0x210b00);}};}function respondWithFilteredResult(_0x543934,_0x3c90dc){return function(_0x4a4b27){if(_0x4a4b27){var _0x21ba91=_0x4a4b27['count'],_0x20e1b4=_0x3c90dc[_0xe6d5('0x2b')],_0x4d8a35=_0x3c90dc[_0xe6d5('0x2b')]+_0x3c90dc[_0xe6d5('0x2c')],_0x2bab45;if(_0x4d8a35>=_0x21ba91){_0x4d8a35=_0x21ba91;_0x2bab45=0xc8;}else{_0x2bab45=0xce;}_0x543934[_0xe6d5('0x28')](_0x2bab45);return _0x543934[_0xe6d5('0x2d')](_0xe6d5('0x2e'),_0x20e1b4+'-'+_0x4d8a35+'/'+_0x21ba91)[_0xe6d5('0x2a')](_0x4a4b27);}return null;};}function patchUpdates(_0x53da30){return function(_0x392551){try{jsonpatch[_0xe6d5('0x2f')](_0x392551,_0x53da30,!![]);}catch(_0x2f780d){return BPromise[_0xe6d5('0x30')](_0x2f780d);}return _0x392551['save']();};}function saveUpdates(_0x30e550,_0x2dbf1b){return function(_0x4f5c6a){if(_0x4f5c6a){return _0x4f5c6a[_0xe6d5('0x31')](_0x30e550)['then'](function(_0x1fe99a){return _0x1fe99a;});}return null;};}function removeEntity(_0x513cbd,_0x1f2fbf){return function(_0x5354b0){if(_0x5354b0){return _0x5354b0[_0xe6d5('0x32')]()[_0xe6d5('0x1c')](function(){_0x513cbd[_0xe6d5('0x28')](0xcc)[_0xe6d5('0x29')]();});}};}function handleEntityNotFound(_0x556198,_0x276e32){return function(_0x350441){if(!_0x350441){_0x556198['sendStatus'](0x194);}return _0x350441;};}function handleError(_0x4280b6,_0x38c757){_0x38c757=_0x38c757||0x1f4;return function(_0x5cf193){logger[_0xe6d5('0x22')](_0x5cf193[_0xe6d5('0x33')]);if(_0x5cf193['name']){delete _0x5cf193[_0xe6d5('0x34')];}_0x4280b6[_0xe6d5('0x28')](_0x38c757)[_0xe6d5('0x35')](_0x5cf193);};}exports[_0xe6d5('0x36')]=function(_0x28cedb,_0x15e4ce){var _0x22a229={},_0x2fb0c6={},_0x56f90d={'count':0x0,'rows':[]};var _0x4b4136=db[_0xe6d5('0x37')][_0xe6d5('0x38')];_0x2fb0c6[_0xe6d5('0x39')]=_[_0xe6d5('0x3a')](_0x4b4136);_0x2fb0c6[_0xe6d5('0x3b')]=_[_0xe6d5('0x3a')](_0x28cedb[_0xe6d5('0x3b')]);_0x2fb0c6[_0xe6d5('0x3c')]=_[_0xe6d5('0x3d')](_0x2fb0c6[_0xe6d5('0x39')],_0x2fb0c6[_0xe6d5('0x3b')]);_0x22a229[_0xe6d5('0x3e')]=_[_0xe6d5('0x3d')](_0x2fb0c6[_0xe6d5('0x39')],qs[_0xe6d5('0x3f')](_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x3f')]));_0x22a229[_0xe6d5('0x3e')]=_0x22a229[_0xe6d5('0x3e')][_0xe6d5('0x40')]?_0x22a229[_0xe6d5('0x3e')]:_0x2fb0c6[_0xe6d5('0x39')];if(!_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x41')](_0xe6d5('0x42'))){_0x22a229['limit']=qs[_0xe6d5('0x2c')](_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x2c')]);_0x22a229[_0xe6d5('0x2b')]=qs[_0xe6d5('0x2b')](_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x2b')]);}_0x22a229[_0xe6d5('0x43')]=qs[_0xe6d5('0x44')](_0x28cedb[_0xe6d5('0x3b')]['sort']);_0x22a229['where']=qs[_0xe6d5('0x3c')](_['pick'](_0x28cedb['query'],_0x2fb0c6[_0xe6d5('0x3c')]));if(_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x45')]){_0x22a229[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x22a229[_0xe6d5('0x46')],{'$or':_['map'](_0x4b4136,function(_0x6e19d6){if(_0x6e19d6['type'][_0xe6d5('0x48')]!==_0xe6d5('0x49')){var _0x5ddf31={};_0x5ddf31[_0x6e19d6[_0xe6d5('0x4a')]]={'$like':'%'+_0x28cedb['query']['filter']+'%'};return _0x5ddf31;}})});}_0x22a229=_[_0xe6d5('0x47')]({},_0x22a229,_0x28cedb['options']);var _0x237e10={'where':_0x22a229[_0xe6d5('0x46')]};return db[_0xe6d5('0x37')]['count'](_0x237e10)[_0xe6d5('0x1c')](function(_0x2d894b){_0x56f90d[_0xe6d5('0x4b')]=_0x2d894b;if(_0x28cedb[_0xe6d5('0x3b')][_0xe6d5('0x4c')]){_0x22a229['include']=[{'all':!![]}];}return db[_0xe6d5('0x37')][_0xe6d5('0x4d')](_0x22a229);})[_0xe6d5('0x1c')](function(_0x5effad){_0x56f90d[_0xe6d5('0x4e')]=_0x5effad;return _0x56f90d;})[_0xe6d5('0x1c')](respondWithFilteredResult(_0x15e4ce,_0x22a229))['catch'](handleError(_0x15e4ce,null));};exports[_0xe6d5('0x4f')]=function(_0x2be4fb,_0x6cf48e){var _0x3a805b={'raw':![],'where':{'id':_0x2be4fb['params']['id']}},_0x5a9fd7={};_0x5a9fd7['model']=_[_0xe6d5('0x3a')](db[_0xe6d5('0x37')][_0xe6d5('0x38')]);_0x5a9fd7[_0xe6d5('0x3b')]=_[_0xe6d5('0x3a')](_0x2be4fb['query']);_0x5a9fd7[_0xe6d5('0x3c')]=_[_0xe6d5('0x3d')](_0x5a9fd7[_0xe6d5('0x39')],_0x5a9fd7['query']);_0x3a805b[_0xe6d5('0x3e')]=_[_0xe6d5('0x3d')](_0x5a9fd7[_0xe6d5('0x39')],qs[_0xe6d5('0x3f')](_0x2be4fb[_0xe6d5('0x3b')]['fields']));_0x3a805b[_0xe6d5('0x3e')]=_0x3a805b[_0xe6d5('0x3e')]['length']?_0x3a805b[_0xe6d5('0x3e')]:_0x5a9fd7[_0xe6d5('0x39')];if(_0x2be4fb[_0xe6d5('0x3b')][_0xe6d5('0x4c')]){_0x3a805b[_0xe6d5('0x50')]=[{'all':!![]}];}_0x3a805b=_[_0xe6d5('0x47')]({},_0x3a805b,_0x2be4fb[_0xe6d5('0x51')]);return db['FreshdeskAccount'][_0xe6d5('0x52')](_0x3a805b)['then'](handleEntityNotFound(_0x6cf48e,null))[_0xe6d5('0x1c')](respondWithResult(_0x6cf48e,null))[_0xe6d5('0x26')](handleError(_0x6cf48e,null));};exports['create']=function(_0x304021,_0x53926f){return db[_0xe6d5('0x37')][_0xe6d5('0x53')](_0x304021[_0xe6d5('0x54')],{})['then'](respondWithResult(_0x53926f,0xc9))[_0xe6d5('0x26')](handleError(_0x53926f,null));};exports['update']=function(_0x163c7c,_0x199b8a){if(_0x163c7c[_0xe6d5('0x54')]['id']){delete _0x163c7c['body']['id'];}return db[_0xe6d5('0x37')][_0xe6d5('0x52')]({'where':{'id':_0x163c7c[_0xe6d5('0x55')]['id']}})[_0xe6d5('0x1c')](handleEntityNotFound(_0x199b8a,null))[_0xe6d5('0x1c')](saveUpdates(_0x163c7c[_0xe6d5('0x54')],null))[_0xe6d5('0x1c')](respondWithResult(_0x199b8a,null))[_0xe6d5('0x26')](handleError(_0x199b8a,null));};exports[_0xe6d5('0x32')]=function(_0x5718f2,_0x3cc28f){return db['FreshdeskAccount'][_0xe6d5('0x52')]({'where':{'id':_0x5718f2[_0xe6d5('0x55')]['id']}})[_0xe6d5('0x1c')](handleEntityNotFound(_0x3cc28f,null))['then'](removeEntity(_0x3cc28f,null))[_0xe6d5('0x26')](handleError(_0x3cc28f,null));};exports['getConfigurations']=function(_0x105f4,_0x39dd3f,_0x27bea4){var _0x501d04={};var _0x4eece5={};var _0x3ca1b6;var _0x226dfa;return db[_0xe6d5('0x37')][_0xe6d5('0x56')]({'where':{'id':_0x105f4[_0xe6d5('0x55')]['id']}})[_0xe6d5('0x1c')](handleEntityNotFound(_0x39dd3f,null))[_0xe6d5('0x1c')](function(_0x56a70d){if(_0x56a70d){_0x3ca1b6=_0x56a70d;_0x4eece5[_0xe6d5('0x39')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x4eece5['query']=_[_0xe6d5('0x3a')](_0x105f4[_0xe6d5('0x3b')]);_0x4eece5['filters']=_[_0xe6d5('0x3d')](_0x4eece5[_0xe6d5('0x39')],_0x4eece5[_0xe6d5('0x3b')]);_0x501d04['attributes']=_[_0xe6d5('0x3d')](_0x4eece5[_0xe6d5('0x39')],qs['fields'](_0x105f4[_0xe6d5('0x3b')][_0xe6d5('0x3f')]));_0x501d04[_0xe6d5('0x3e')]=_0x501d04['attributes'][_0xe6d5('0x40')]?_0x501d04['attributes']:_0x4eece5[_0xe6d5('0x39')];_0x501d04[_0xe6d5('0x43')]=qs[_0xe6d5('0x44')](_0x105f4[_0xe6d5('0x3b')][_0xe6d5('0x44')]);_0x501d04[_0xe6d5('0x46')]=qs[_0xe6d5('0x3c')](_[_0xe6d5('0x57')](_0x105f4[_0xe6d5('0x3b')],_0x4eece5[_0xe6d5('0x3c')]));if(_0x105f4[_0xe6d5('0x3b')][_0xe6d5('0x45')]){_0x501d04['where']=_[_0xe6d5('0x47')](_0x501d04['where'],{'$or':_[_0xe6d5('0x58')](_0x501d04[_0xe6d5('0x3e')],function(_0x4521b7){var _0x534211={};_0x534211[_0x4521b7]={'$like':'%'+_0x105f4['query']['filter']+'%'};return _0x534211;})});}_0x501d04=_['merge']({},_0x501d04,_0x105f4['options']);return _0x3ca1b6[_0xe6d5('0x59')](_0x501d04);}})[_0xe6d5('0x1c')](function(_0x183ad4){if(_0x183ad4){_0x226dfa=_0x183ad4[_0xe6d5('0x40')];if(!_0x105f4[_0xe6d5('0x3b')][_0xe6d5('0x41')](_0xe6d5('0x42'))){_0x501d04[_0xe6d5('0x2c')]=qs['limit'](_0x105f4[_0xe6d5('0x3b')][_0xe6d5('0x2c')]);_0x501d04[_0xe6d5('0x2b')]=qs[_0xe6d5('0x2b')](_0x105f4['query'][_0xe6d5('0x2b')]);}return _0x3ca1b6['getConfigurations'](_0x501d04);}})[_0xe6d5('0x1c')](function(_0x2cd56c){if(_0x2cd56c){return _0x2cd56c?{'count':_0x226dfa,'rows':_0x2cd56c}:null;}})['then'](respondWithResult(_0x39dd3f,null))[_0xe6d5('0x26')](handleError(_0x39dd3f,null));};exports['addConfiguration']=function(_0x2ec566,_0x9f39bb,_0x46dfd9){if(_0x2ec566[_0xe6d5('0x54')]['id']){delete _0x2ec566['body']['id'];}return db[_0xe6d5('0x37')][_0xe6d5('0x56')]({'where':{'id':_0x2ec566['params']['id']}})[_0xe6d5('0x1c')](handleEntityNotFound(_0x9f39bb,null))[_0xe6d5('0x1c')](function(_0x15645c){if(_0x15645c){_0x2ec566[_0xe6d5('0x54')][_0xe6d5('0x5a')]=_0x15645c['id'];_0x2ec566['body'][_0xe6d5('0x5b')]=integrations[_0xe6d5('0x5c')](_0x2ec566[_0xe6d5('0x54')][_0xe6d5('0x5d')],_0x2ec566[_0xe6d5('0x54')][_0xe6d5('0x5e')]);_0x2ec566[_0xe6d5('0x54')][_0xe6d5('0x5f')]=integrations[_0xe6d5('0x60')](_0x2ec566[_0xe6d5('0x54')]['channel'],_0x2ec566['body'][_0xe6d5('0x5e')]);return db['FreshdeskConfiguration'][_0xe6d5('0x53')](_0x2ec566[_0xe6d5('0x54')],{'include':[{'model':db[_0xe6d5('0x61')],'as':_0xe6d5('0x5b')},{'model':db[_0xe6d5('0x61')],'as':_0xe6d5('0x5f')}]});}return null;})[_0xe6d5('0x1c')](respondWithResult(_0x9f39bb,null))[_0xe6d5('0x26')](handleError(_0x9f39bb,null));};exports['getFields']=function(_0x4760a1,_0x547cf8,_0xcf6dd){var _0x3b20dd='';return db[_0xe6d5('0x37')]['findOne']({'where':{'id':_0x4760a1['params']['id']},'attributes':['id',_0xe6d5('0x62'),_0xe6d5('0x63')]})[_0xe6d5('0x1c')](handleEntityNotFound(_0x547cf8,null))['then'](function(_0x3ec0b8){if(_0x3ec0b8){_0x3b20dd=_0x3ec0b8[_0xe6d5('0x62')];var _0x5ba366=_0x3b20dd[_0xe6d5('0x64')](-0x1);if(_0x5ba366==='/'){_0x3b20dd=_0x3b20dd[_0xe6d5('0x65')](0x0,_0x3b20dd[_0xe6d5('0x66')](_0x5ba366));}return rp({'method':_0xe6d5('0x67'),'uri':util['format'](_0xe6d5('0x68'),_0x3b20dd,_0xe6d5('0x69')),'headers':{'Authorization':util[_0xe6d5('0x6a')](_0xe6d5('0x6b'),new Buffer(util['format'](_0xe6d5('0x6c'),_0x3ec0b8[_0xe6d5('0x63')]))[_0xe6d5('0x6d')](_0xe6d5('0x6e')))},'json':!![]});}})[_0xe6d5('0x1c')](function(_0x528e2b){if(_0x528e2b){var _0x370a5d=['requester',_0xe6d5('0x6f'),_0xe6d5('0x70'),'description',_0xe6d5('0x28'),_0xe6d5('0x71'),_0xe6d5('0x72'),'source','ticket_type',_0xe6d5('0x72'),_0xe6d5('0x73')];_[_0xe6d5('0x74')](_0x528e2b,function(_0x48b90e){return _0x370a5d['includes'](_0x48b90e[_0xe6d5('0x34')])||!_0x48b90e[_0xe6d5('0x75')]&&_0x48b90e[_0xe6d5('0x5e')]!==_0xe6d5('0x76')&&_0x48b90e['type']!=='custom_dropdown';});return{'count':_0x528e2b['length'],'rows':_[_0xe6d5('0x58')](_0x528e2b,function(_0x19d61f){return{'id':_0x19d61f[_0xe6d5('0x34')],'name':_0x19d61f['label'],'custom':!_0x19d61f[_0xe6d5('0x75')],'options':_0x19d61f[_0xe6d5('0x77')]?_[_0xe6d5('0x58')](_0x19d61f[_0xe6d5('0x77')],function(_0x4033e9){return{'name':_[_0xe6d5('0x78')](_0x4033e9),'value':_0x4033e9};}):[]};})};}})['then'](respondWithResult(_0x547cf8,null))[_0xe6d5('0x26')](function(_0x364c4c){var _0x291332=_0x4760a1[_0xe6d5('0x3b')]['test']?0x1f4:_0x364c4c[_0xe6d5('0x79')]||0x1f4;logger[_0xe6d5('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xe6d5('0x7a'),_0x291332,JSON[_0xe6d5('0x20')](_0x364c4c));delete _0x364c4c[_0xe6d5('0x34')];if(_0x291332===0x191){_0x291332=0x190;}_0x547cf8[_0xe6d5('0x28')](_0x291332)['send'](_0x4760a1['query'][_0xe6d5('0x19')]?{'message':_0xe6d5('0x7b'),'statusCode':_0x364c4c[_0xe6d5('0x79')]}:_0x364c4c);});}; \ No newline at end of file +var _0x4f9b=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','FreshdeskAccount','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','field','options','count','includeAll','include','then','rows','show','params','rawAttributes','body','find','getConfigurations','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','findOne','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','choices','capitalize','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','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x4f9c08,_0x4d83df){_0x4f9c08=_0x4f9c08-0x0;var _0x4da7e5=_0x4f9b[_0x4f9c08];return _0x4da7e5;};'use strict';var pdf=require(_0xb4f9('0x0'));var emlformat=require(_0xb4f9('0x1'));var rimraf=require(_0xb4f9('0x2'));var zipdir=require(_0xb4f9('0x3'));var jsonpatch=require(_0xb4f9('0x4'));var rp=require(_0xb4f9('0x5'));var moment=require(_0xb4f9('0x6'));var BPromise=require(_0xb4f9('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb4f9('0x8'));var csv=require(_0xb4f9('0x9'));var ejs=require(_0xb4f9('0xa'));var fs=require('fs');var _=require(_0xb4f9('0xb'));var squel=require(_0xb4f9('0xc'));var crypto=require(_0xb4f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb4f9('0xe'));var toCsv=require(_0xb4f9('0x9'));var querystring=require(_0xb4f9('0xf'));var Papa=require('papaparse');var Redis=require(_0xb4f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4f9('0x11'));var hardwareService=require(_0xb4f9('0x12'));var logger=require(_0xb4f9('0x13'))(_0xb4f9('0x14'));var utils=require(_0xb4f9('0x15'));var config=require(_0xb4f9('0x16'));var db=require(_0xb4f9('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb4f9('0x18'));var client=jayson[_0xb4f9('0x19')][_0xb4f9('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4927d9,_0x5819d5,_0x1aaff5){if(_0x1aaff5){var _0x3d8bac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d8bac[_0xb4f9('0x1b')](_0x5819d5)){return _0x4927d9;}else{throw new Error(_0xb4f9('0x1c'));}}else{return _0x4927d9;}}function respondWithRpcPromise(_0x25b8d9,_0x2214e1,_0x3569c5,_0x43a6b5){return new BPromise(function(_0x466848,_0x170792){var _0xc6e4da=_0x43a6b5||client;return _0xc6e4da[_0xb4f9('0x1d')](_0x25b8d9,_0x3569c5)['then'](function(_0x1ad88c){logger[_0xb4f9('0x1e')](_0xb4f9('0x1f'),_0x2214e1,_0xb4f9('0x20'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2214e1,'request\x20sent',JSON['stringify'](_0x1ad88c));if(_0x1ad88c[_0xb4f9('0x21')]){if(_0x1ad88c['error'][_0xb4f9('0x22')]===0x1f4){logger[_0xb4f9('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0x2214e1,_0x1ad88c[_0xb4f9('0x21')]['message']);return _0x170792(_0x1ad88c[_0xb4f9('0x21')][_0xb4f9('0x23')]);}logger[_0xb4f9('0x21')](_0xb4f9('0x1f'),_0x2214e1,_0x1ad88c[_0xb4f9('0x21')][_0xb4f9('0x23')]);return _0x466848(_0x1ad88c['error']['message']);}else{logger['info'](_0xb4f9('0x1f'),_0x2214e1,'request\x20sent');_0x466848(_0x1ad88c[_0xb4f9('0x24')][_0xb4f9('0x23')]);}})[_0xb4f9('0x25')](function(_0x475050){logger[_0xb4f9('0x21')](_0xb4f9('0x1f'),_0x2214e1,_0x475050);_0x170792(_0x475050);});});}function respondWithStatusCode(_0x4d3b93,_0x1e61aa){_0x1e61aa=_0x1e61aa||0xcc;return function(_0x4e428d){if(_0x4e428d){return _0x4d3b93[_0xb4f9('0x26')](_0x1e61aa);}return _0x4d3b93[_0xb4f9('0x27')](_0x1e61aa)['end']();};}function respondWithResult(_0x55f9c9,_0x431f1a){_0x431f1a=_0x431f1a||0xc8;return function(_0x5f4674){if(_0x5f4674){return _0x55f9c9[_0xb4f9('0x27')](_0x431f1a)[_0xb4f9('0x28')](_0x5f4674);}};}function respondWithFilteredResult(_0x1c8a38,_0xe5175a){return function(_0x307d55){if(_0x307d55){var _0x3dd3aa=_0x307d55['count'],_0x3bac61=_0xe5175a['offset'],_0x18d528=_0xe5175a[_0xb4f9('0x29')]+_0xe5175a[_0xb4f9('0x2a')],_0x491fb7;if(_0x18d528>=_0x3dd3aa){_0x18d528=_0x3dd3aa;_0x491fb7=0xc8;}else{_0x491fb7=0xce;}_0x1c8a38[_0xb4f9('0x27')](_0x491fb7);return _0x1c8a38['set'](_0xb4f9('0x2b'),_0x3bac61+'-'+_0x18d528+'/'+_0x3dd3aa)[_0xb4f9('0x28')](_0x307d55);}return null;};}function patchUpdates(_0x6e9371){return function(_0x264a55){try{jsonpatch[_0xb4f9('0x2c')](_0x264a55,_0x6e9371,!![]);}catch(_0x2d2f9d){return BPromise[_0xb4f9('0x2d')](_0x2d2f9d);}return _0x264a55[_0xb4f9('0x2e')]();};}function saveUpdates(_0x4b2a58,_0x1f2a40){return function(_0x56e5e1){if(_0x56e5e1){return _0x56e5e1[_0xb4f9('0x2f')](_0x4b2a58)['then'](function(_0x4c6ad3){return _0x4c6ad3;});}return null;};}function removeEntity(_0x291443,_0x46a1b3){return function(_0x322660){if(_0x322660){return _0x322660[_0xb4f9('0x30')]()['then'](function(){_0x291443[_0xb4f9('0x27')](0xcc)[_0xb4f9('0x31')]();});}};}function handleEntityNotFound(_0x30fabe,_0xb84849){return function(_0x4681b4){if(!_0x4681b4){_0x30fabe[_0xb4f9('0x26')](0x194);}return _0x4681b4;};}function handleError(_0x32ac14,_0x453a7e){_0x453a7e=_0x453a7e||0x1f4;return function(_0x1e909f){logger[_0xb4f9('0x21')](_0x1e909f[_0xb4f9('0x32')]);if(_0x1e909f[_0xb4f9('0x33')]){delete _0x1e909f[_0xb4f9('0x33')];}_0x32ac14['status'](_0x453a7e)[_0xb4f9('0x34')](_0x1e909f);};}exports[_0xb4f9('0x35')]=function(_0x58635c,_0x2a27cb){var _0x330557={},_0x1caed3={},_0x176ff6={'count':0x0,'rows':[]};var _0x4f7149=db[_0xb4f9('0x36')]['rawAttributes'];_0x1caed3[_0xb4f9('0x37')]=_['keys'](_0x4f7149);_0x1caed3[_0xb4f9('0x38')]=_['keys'](_0x58635c[_0xb4f9('0x38')]);_0x1caed3['filters']=_[_0xb4f9('0x39')](_0x1caed3[_0xb4f9('0x37')],_0x1caed3[_0xb4f9('0x38')]);_0x330557[_0xb4f9('0x3a')]=_[_0xb4f9('0x39')](_0x1caed3[_0xb4f9('0x37')],qs['fields'](_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x3b')]));_0x330557['attributes']=_0x330557[_0xb4f9('0x3a')][_0xb4f9('0x3c')]?_0x330557[_0xb4f9('0x3a')]:_0x1caed3[_0xb4f9('0x37')];if(!_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x3d')](_0xb4f9('0x3e'))){_0x330557[_0xb4f9('0x2a')]=qs[_0xb4f9('0x2a')](_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x2a')]);_0x330557[_0xb4f9('0x29')]=qs[_0xb4f9('0x29')](_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x29')]);}_0x330557[_0xb4f9('0x3f')]=qs[_0xb4f9('0x40')](_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x40')]);_0x330557['where']=qs[_0xb4f9('0x41')](_[_0xb4f9('0x42')](_0x58635c[_0xb4f9('0x38')],_0x1caed3['filters']));if(_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x43')]){_0x330557[_0xb4f9('0x44')]=_[_0xb4f9('0x45')](_0x330557[_0xb4f9('0x44')],{'$or':_[_0xb4f9('0x46')](_0x4f7149,function(_0x513903){if(_0x513903[_0xb4f9('0x47')]['key']!=='VIRTUAL'){var _0xac9d67={};_0xac9d67[_0x513903[_0xb4f9('0x48')]]={'$like':'%'+_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x43')]+'%'};return _0xac9d67;}})});}_0x330557=_[_0xb4f9('0x45')]({},_0x330557,_0x58635c[_0xb4f9('0x49')]);var _0x27d007={'where':_0x330557['where']};return db[_0xb4f9('0x36')][_0xb4f9('0x4a')](_0x27d007)['then'](function(_0x309fe4){_0x176ff6[_0xb4f9('0x4a')]=_0x309fe4;if(_0x58635c[_0xb4f9('0x38')][_0xb4f9('0x4b')]){_0x330557[_0xb4f9('0x4c')]=[{'all':!![]}];}return db[_0xb4f9('0x36')]['findAll'](_0x330557);})[_0xb4f9('0x4d')](function(_0x2d517a){_0x176ff6[_0xb4f9('0x4e')]=_0x2d517a;return _0x176ff6;})['then'](respondWithFilteredResult(_0x2a27cb,_0x330557))[_0xb4f9('0x25')](handleError(_0x2a27cb,null));};exports[_0xb4f9('0x4f')]=function(_0x5a6e12,_0xca8a7f){var _0x1e553f={'raw':![],'where':{'id':_0x5a6e12[_0xb4f9('0x50')]['id']}},_0x8aab64={};_0x8aab64[_0xb4f9('0x37')]=_['keys'](db[_0xb4f9('0x36')][_0xb4f9('0x51')]);_0x8aab64['query']=_['keys'](_0x5a6e12[_0xb4f9('0x38')]);_0x8aab64[_0xb4f9('0x41')]=_[_0xb4f9('0x39')](_0x8aab64['model'],_0x8aab64[_0xb4f9('0x38')]);_0x1e553f[_0xb4f9('0x3a')]=_[_0xb4f9('0x39')](_0x8aab64['model'],qs[_0xb4f9('0x3b')](_0x5a6e12[_0xb4f9('0x38')][_0xb4f9('0x3b')]));_0x1e553f[_0xb4f9('0x3a')]=_0x1e553f['attributes'][_0xb4f9('0x3c')]?_0x1e553f[_0xb4f9('0x3a')]:_0x8aab64[_0xb4f9('0x37')];if(_0x5a6e12['query'][_0xb4f9('0x4b')]){_0x1e553f[_0xb4f9('0x4c')]=[{'all':!![]}];}_0x1e553f=_['merge']({},_0x1e553f,_0x5a6e12[_0xb4f9('0x49')]);return db['FreshdeskAccount']['find'](_0x1e553f)[_0xb4f9('0x4d')](handleEntityNotFound(_0xca8a7f,null))['then'](respondWithResult(_0xca8a7f,null))[_0xb4f9('0x25')](handleError(_0xca8a7f,null));};exports['create']=function(_0x10887a,_0x3c67){return db[_0xb4f9('0x36')]['create'](_0x10887a[_0xb4f9('0x52')],{})['then'](respondWithResult(_0x3c67,0xc9))[_0xb4f9('0x25')](handleError(_0x3c67,null));};exports[_0xb4f9('0x2f')]=function(_0x9a402f,_0x53b21b){if(_0x9a402f[_0xb4f9('0x52')]['id']){delete _0x9a402f[_0xb4f9('0x52')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x9a402f['params']['id']}})['then'](handleEntityNotFound(_0x53b21b,null))[_0xb4f9('0x4d')](saveUpdates(_0x9a402f['body'],null))[_0xb4f9('0x4d')](respondWithResult(_0x53b21b,null))[_0xb4f9('0x25')](handleError(_0x53b21b,null));};exports[_0xb4f9('0x30')]=function(_0x404f52,_0x556a2a){return db['FreshdeskAccount'][_0xb4f9('0x53')]({'where':{'id':_0x404f52[_0xb4f9('0x50')]['id']}})[_0xb4f9('0x4d')](handleEntityNotFound(_0x556a2a,null))['then'](removeEntity(_0x556a2a,null))[_0xb4f9('0x25')](handleError(_0x556a2a,null));};exports[_0xb4f9('0x54')]=function(_0xd8913c,_0x222ff1,_0x220beb){var _0x2c3fe4={};var _0x4d0e80={};var _0x55098e;var _0x4f1129;return db[_0xb4f9('0x36')]['findOne']({'where':{'id':_0xd8913c[_0xb4f9('0x50')]['id']}})[_0xb4f9('0x4d')](handleEntityNotFound(_0x222ff1,null))['then'](function(_0x365a8d){if(_0x365a8d){_0x55098e=_0x365a8d;_0x4d0e80[_0xb4f9('0x37')]=_['keys'](db[_0xb4f9('0x55')][_0xb4f9('0x51')]);_0x4d0e80['query']=_['keys'](_0xd8913c[_0xb4f9('0x38')]);_0x4d0e80[_0xb4f9('0x41')]=_['intersection'](_0x4d0e80['model'],_0x4d0e80[_0xb4f9('0x38')]);_0x2c3fe4[_0xb4f9('0x3a')]=_[_0xb4f9('0x39')](_0x4d0e80[_0xb4f9('0x37')],qs[_0xb4f9('0x3b')](_0xd8913c[_0xb4f9('0x38')]['fields']));_0x2c3fe4[_0xb4f9('0x3a')]=_0x2c3fe4[_0xb4f9('0x3a')][_0xb4f9('0x3c')]?_0x2c3fe4[_0xb4f9('0x3a')]:_0x4d0e80[_0xb4f9('0x37')];_0x2c3fe4[_0xb4f9('0x3f')]=qs[_0xb4f9('0x40')](_0xd8913c['query']['sort']);_0x2c3fe4[_0xb4f9('0x44')]=qs[_0xb4f9('0x41')](_[_0xb4f9('0x42')](_0xd8913c[_0xb4f9('0x38')],_0x4d0e80[_0xb4f9('0x41')]));if(_0xd8913c[_0xb4f9('0x38')]['filter']){_0x2c3fe4[_0xb4f9('0x44')]=_[_0xb4f9('0x45')](_0x2c3fe4[_0xb4f9('0x44')],{'$or':_['map'](_0x2c3fe4[_0xb4f9('0x3a')],function(_0x134f2a){var _0x289916={};_0x289916[_0x134f2a]={'$like':'%'+_0xd8913c['query'][_0xb4f9('0x43')]+'%'};return _0x289916;})});}_0x2c3fe4=_[_0xb4f9('0x45')]({},_0x2c3fe4,_0xd8913c[_0xb4f9('0x49')]);return _0x55098e['getConfigurations'](_0x2c3fe4);}})[_0xb4f9('0x4d')](function(_0x95b4b6){if(_0x95b4b6){_0x4f1129=_0x95b4b6[_0xb4f9('0x3c')];if(!_0xd8913c[_0xb4f9('0x38')][_0xb4f9('0x3d')](_0xb4f9('0x3e'))){_0x2c3fe4[_0xb4f9('0x2a')]=qs[_0xb4f9('0x2a')](_0xd8913c[_0xb4f9('0x38')][_0xb4f9('0x2a')]);_0x2c3fe4[_0xb4f9('0x29')]=qs['offset'](_0xd8913c[_0xb4f9('0x38')][_0xb4f9('0x29')]);}return _0x55098e[_0xb4f9('0x54')](_0x2c3fe4);}})['then'](function(_0x15bbb6){if(_0x15bbb6){return _0x15bbb6?{'count':_0x4f1129,'rows':_0x15bbb6}:null;}})[_0xb4f9('0x4d')](respondWithResult(_0x222ff1,null))[_0xb4f9('0x25')](handleError(_0x222ff1,null));};exports[_0xb4f9('0x56')]=function(_0x1f8f1a,_0x11f623,_0x15faf2){if(_0x1f8f1a[_0xb4f9('0x52')]['id']){delete _0x1f8f1a['body']['id'];}return db[_0xb4f9('0x36')]['findOne']({'where':{'id':_0x1f8f1a['params']['id']}})[_0xb4f9('0x4d')](handleEntityNotFound(_0x11f623,null))[_0xb4f9('0x4d')](function(_0x90c7b1){if(_0x90c7b1){_0x1f8f1a['body'][_0xb4f9('0x57')]=_0x90c7b1['id'];_0x1f8f1a[_0xb4f9('0x52')][_0xb4f9('0x58')]=integrations['getSubjects'](_0x1f8f1a[_0xb4f9('0x52')][_0xb4f9('0x59')],_0x1f8f1a[_0xb4f9('0x52')][_0xb4f9('0x47')]);_0x1f8f1a[_0xb4f9('0x52')]['Descriptions']=integrations[_0xb4f9('0x5a')](_0x1f8f1a['body'][_0xb4f9('0x59')],_0x1f8f1a[_0xb4f9('0x52')]['type']);return db[_0xb4f9('0x55')]['create'](_0x1f8f1a[_0xb4f9('0x52')],{'include':[{'model':db[_0xb4f9('0x5b')],'as':'Subjects'},{'model':db[_0xb4f9('0x5b')],'as':_0xb4f9('0x5c')}]});}return null;})[_0xb4f9('0x4d')](respondWithResult(_0x11f623,null))[_0xb4f9('0x25')](handleError(_0x11f623,null));};exports[_0xb4f9('0x5d')]=function(_0x559000,_0x27ce9d,_0x2ba87a){var _0x265009='';return db[_0xb4f9('0x36')][_0xb4f9('0x5e')]({'where':{'id':_0x559000['params']['id']},'attributes':['id',_0xb4f9('0x5f'),_0xb4f9('0x60')]})[_0xb4f9('0x4d')](handleEntityNotFound(_0x27ce9d,null))[_0xb4f9('0x4d')](function(_0x4c01f1){if(_0x4c01f1){_0x265009=_0x4c01f1[_0xb4f9('0x5f')];var _0x32fad8=_0x265009['slice'](-0x1);if(_0x32fad8==='/'){_0x265009=_0x265009[_0xb4f9('0x61')](0x0,_0x265009[_0xb4f9('0x62')](_0x32fad8));}return rp({'method':_0xb4f9('0x63'),'uri':util['format'](_0xb4f9('0x64'),_0x265009,_0xb4f9('0x65')),'headers':{'Authorization':util[_0xb4f9('0x66')](_0xb4f9('0x67'),new Buffer(util[_0xb4f9('0x66')](_0xb4f9('0x68'),_0x4c01f1[_0xb4f9('0x60')]))[_0xb4f9('0x69')]('base64'))},'json':!![]});}})[_0xb4f9('0x4d')](function(_0x25cafc){if(_0x25cafc){var _0x38280f=[_0xb4f9('0x6a'),_0xb4f9('0x6b'),_0xb4f9('0x6c'),_0xb4f9('0x6d'),_0xb4f9('0x27'),_0xb4f9('0x6e'),_0xb4f9('0x6f'),_0xb4f9('0x70'),_0xb4f9('0x71'),_0xb4f9('0x6f'),_0xb4f9('0x72')];_['remove'](_0x25cafc,function(_0x2da9a9){return _0x38280f[_0xb4f9('0x73')](_0x2da9a9[_0xb4f9('0x33')])||!_0x2da9a9[_0xb4f9('0x74')]&&_0x2da9a9['type']!==_0xb4f9('0x75')&&_0x2da9a9[_0xb4f9('0x47')]!==_0xb4f9('0x76');});return{'count':_0x25cafc['length'],'rows':_['map'](_0x25cafc,function(_0x10dd41){return{'id':_0x10dd41[_0xb4f9('0x33')],'name':_0x10dd41['label'],'custom':!_0x10dd41['default'],'options':_0x10dd41[_0xb4f9('0x77')]?_[_0xb4f9('0x46')](_0x10dd41[_0xb4f9('0x77')],function(_0x823e77){return{'name':_[_0xb4f9('0x78')](_0x823e77),'value':_0x823e77};}):[]};})};}})[_0xb4f9('0x4d')](respondWithResult(_0x27ce9d,null))[_0xb4f9('0x25')](function(_0x4843db){var _0x110a3a=_0x559000[_0xb4f9('0x38')]['test']?0x1f4:_0x4843db[_0xb4f9('0x79')]||0x1f4;logger[_0xb4f9('0x21')](_0xb4f9('0x7a'),_0xb4f9('0x5d'),_0x110a3a,JSON[_0xb4f9('0x7b')](_0x4843db));delete _0x4843db[_0xb4f9('0x33')];if(_0x110a3a===0x191){_0x110a3a=0x190;}_0x27ce9d[_0xb4f9('0x27')](_0x110a3a)[_0xb4f9('0x34')](_0x559000[_0xb4f9('0x38')]['test']?{'message':_0xb4f9('0x7c'),'statusCode':_0x4843db['statusCode']}:_0x4843db);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1d0e669..830cb1b 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 _0x8178=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x8178,0x1ce));var _0x8817=function(_0x3e0e6a,_0x2d178c){_0x3e0e6a=_0x3e0e6a-0x0;var _0x34deeb=_0x8178[_0x3e0e6a];return _0x34deeb;};'use strict';var _=require(_0x8817('0x0'));var util=require(_0x8817('0x1'));var logger=require(_0x8817('0x2'))('api');var moment=require(_0x8817('0x3'));var BPromise=require('bluebird');var rp=require(_0x8817('0x4'));var fs=require('fs');var path=require(_0x8817('0x5'));var rimraf=require(_0x8817('0x6'));var config=require(_0x8817('0x7'));var attributes=require(_0x8817('0x8'));var integrations=require(_0x8817('0x9'));module[_0x8817('0xa')]=function(_0x13f57b,_0x17ea5d){return _0x13f57b[_0x8817('0xb')](_0x8817('0xc'),attributes,{'tableName':_0x8817('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9ac=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x40869e,_0x5d33c1){var _0x5edc75=function(_0xfe7825){while(--_0xfe7825){_0x40869e['push'](_0x40869e['shift']());}};_0x5edc75(++_0x5d33c1);}(_0xc9ac,0x161));var _0xcc9a=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xc9ac[_0x13342f];return _0x2fc1fc;};'use strict';var _=require(_0xcc9a('0x0'));var util=require(_0xcc9a('0x1'));var logger=require(_0xcc9a('0x2'))(_0xcc9a('0x3'));var moment=require('moment');var BPromise=require(_0xcc9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc9a('0x5'));var rimraf=require('rimraf');var config=require(_0xcc9a('0x6'));var attributes=require(_0xcc9a('0x7'));var integrations=require(_0xcc9a('0x8'));module[_0xcc9a('0x9')]=function(_0x235782,_0x5a4a65){return _0x235782[_0xcc9a('0xa')](_0xcc9a('0xb'),attributes,{'tableName':_0xcc9a('0xc'),'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 613e74b..d69d18e 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 _0xf677=['bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowFreshdeskAccount','find','lodash'];(function(_0x40c43b,_0x137e03){var _0x456b31=function(_0x3d0d1e){while(--_0x3d0d1e){_0x40c43b['push'](_0x40c43b['shift']());}};_0x456b31(++_0x137e03);}(_0xf677,0x149));var _0x7f67=function(_0x368670,_0x57abc5){_0x368670=_0x368670-0x0;var _0x8f1189=_0xf677[_0x368670];return _0x8f1189;};'use strict';var _=require(_0x7f67('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f67('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f67('0x2'));var logger=require('../../config/logger')(_0x7f67('0x3'));var config=require(_0x7f67('0x4'));var jayson=require(_0x7f67('0x5'));var client=jayson[_0x7f67('0x6')][_0x7f67('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe9,_0x41c1b3,_0x300835){return new BPromise(function(_0x3f5050,_0xdd76b4){return client[_0x7f67('0x8')](_0x15ffe9,_0x300835)[_0x7f67('0x9')](function(_0x12d250){logger[_0x7f67('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x41c1b3,_0x7f67('0xb'));logger[_0x7f67('0xc')](_0x7f67('0xd'),_0x41c1b3,'request\x20sent',JSON[_0x7f67('0xe')](_0x12d250));if(_0x12d250[_0x7f67('0xf')]){if(_0x12d250[_0x7f67('0xf')][_0x7f67('0x10')]===0x1f4){logger[_0x7f67('0xf')](_0x7f67('0x11'),_0x41c1b3,_0x12d250[_0x7f67('0xf')][_0x7f67('0x12')]);return _0xdd76b4(_0x12d250[_0x7f67('0xf')]['message']);}logger[_0x7f67('0xf')](_0x7f67('0x11'),_0x41c1b3,_0x12d250['error'][_0x7f67('0x12')]);return _0x3f5050(_0x12d250[_0x7f67('0xf')]['message']);}else{logger[_0x7f67('0xa')](_0x7f67('0x11'),_0x41c1b3,_0x7f67('0xb'));_0x3f5050(_0x12d250[_0x7f67('0x13')][_0x7f67('0x12')]);}})['catch'](function(_0x4b6b53){logger[_0x7f67('0xf')](_0x7f67('0x11'),_0x41c1b3,_0x4b6b53);_0xdd76b4(_0x4b6b53);});});}exports[_0x7f67('0x14')]=function(_0x2fda0c){var _0x1cb38e=this;return new Promise(function(_0x28b9f9,_0x2ecd17){return db[_0x7f67('0x15')][_0x7f67('0x16')]({'raw':_0x2fda0c[_0x7f67('0x17')]?_0x2fda0c['options'][_0x7f67('0x18')]===undefined?!![]:![]:!![],'where':_0x2fda0c[_0x7f67('0x17')]?_0x2fda0c[_0x7f67('0x17')][_0x7f67('0x19')]||null:null,'attributes':_0x2fda0c[_0x7f67('0x17')]?_0x2fda0c[_0x7f67('0x17')][_0x7f67('0x1a')]||null:null,'limit':_0x2fda0c[_0x7f67('0x17')]?_0x2fda0c[_0x7f67('0x17')]['limit']||null:null,'include':_0x2fda0c[_0x7f67('0x17')]?_0x2fda0c['options'][_0x7f67('0x1b')]?_['map'](_0x2fda0c['options'][_0x7f67('0x1b')],function(_0x23916c){return{'model':db[_0x23916c[_0x7f67('0x1c')]],'as':_0x23916c['as'],'attributes':_0x23916c[_0x7f67('0x1a')],'include':_0x23916c[_0x7f67('0x1b')]?_['map'](_0x23916c[_0x7f67('0x1b')],function(_0x2fa334){return{'model':db[_0x2fa334['model']],'as':_0x2fa334['as'],'attributes':_0x2fa334[_0x7f67('0x1a')],'include':_0x2fa334[_0x7f67('0x1b')]?_[_0x7f67('0x1d')](_0x2fa334[_0x7f67('0x1b')],function(_0x6b3757){return{'model':db[_0x6b3757[_0x7f67('0x1c')]],'as':_0x6b3757['as'],'attributes':_0x6b3757[_0x7f67('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7f67('0x9')](function(_0x95a20){logger[_0x7f67('0xa')](_0x7f67('0x14'),_0x2fda0c);logger['debug'](_0x7f67('0x14'),_0x2fda0c,JSON[_0x7f67('0xe')](_0x95a20));_0x28b9f9(_0x95a20);})[_0x7f67('0x1e')](function(_0x26b00c){logger[_0x7f67('0xf')](_0x7f67('0x14'),_0x26b00c['message'],_0x2fda0c);_0x2ecd17(_0x1cb38e['error'](0x1f4,_0x26b00c['message']));});});};exports[_0x7f67('0x1f')]=function(_0x3b18d8){var _0x56c38d=this;return new Promise(function(_0x1f81e5,_0x5c1d01){return db[_0x7f67('0x15')][_0x7f67('0x20')]({'raw':_0x3b18d8[_0x7f67('0x17')]?_0x3b18d8[_0x7f67('0x17')][_0x7f67('0x18')]===undefined?!![]:![]:!![],'where':_0x3b18d8[_0x7f67('0x17')]?_0x3b18d8[_0x7f67('0x17')][_0x7f67('0x19')]||null:null,'attributes':_0x3b18d8[_0x7f67('0x17')]?_0x3b18d8[_0x7f67('0x17')][_0x7f67('0x1a')]||null:null,'include':_0x3b18d8['options']?_0x3b18d8[_0x7f67('0x17')][_0x7f67('0x1b')]?_[_0x7f67('0x1d')](_0x3b18d8['options']['include'],function(_0x26f2c8){return{'model':db[_0x26f2c8['model']],'as':_0x26f2c8['as'],'attributes':_0x26f2c8[_0x7f67('0x1a')],'include':_0x26f2c8[_0x7f67('0x1b')]?_[_0x7f67('0x1d')](_0x26f2c8['include'],function(_0x45261d){return{'model':db[_0x45261d[_0x7f67('0x1c')]],'as':_0x45261d['as'],'attributes':_0x45261d[_0x7f67('0x1a')],'include':_0x45261d[_0x7f67('0x1b')]?_[_0x7f67('0x1d')](_0x45261d[_0x7f67('0x1b')],function(_0x4d5241){return{'model':db[_0x4d5241[_0x7f67('0x1c')]],'as':_0x4d5241['as'],'attributes':_0x4d5241['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f67('0x9')](function(_0x1c497f){logger[_0x7f67('0xa')](_0x7f67('0x1f'),_0x3b18d8);logger[_0x7f67('0xc')](_0x7f67('0x1f'),_0x3b18d8,JSON[_0x7f67('0xe')](_0x1c497f));_0x1f81e5(_0x1c497f);})[_0x7f67('0x1e')](function(_0x395e8e){logger[_0x7f67('0xf')](_0x7f67('0x1f'),_0x395e8e['message'],_0x3b18d8);_0x5c1d01(_0x56c38d[_0x7f67('0xf')](0x1f4,_0x395e8e['message']));});});}; \ No newline at end of file +var _0xba3f=['limit','include','map','model','attributes','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0xba3f,0x174));var _0xfba3=function(_0x224fd5,_0x435450){_0x224fd5=_0x224fd5-0x0;var _0x297a3b=_0xba3f[_0x224fd5];return _0x297a3b;};'use strict';var _=require(_0xfba3('0x0'));var util=require(_0xfba3('0x1'));var moment=require('moment');var BPromise=require(_0xfba3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfba3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfba3('0x4'))(_0xfba3('0x5'));var config=require(_0xfba3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfba3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1de848,_0x1fa6ea,_0x5574fb){return new BPromise(function(_0x2aa418,_0x2f16de){return client[_0xfba3('0x8')](_0x1de848,_0x5574fb)[_0xfba3('0x9')](function(_0x23c9de){logger[_0xfba3('0xa')](_0xfba3('0xb'),_0x1fa6ea,_0xfba3('0xc'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1fa6ea,'request\x20sent',JSON[_0xfba3('0xd')](_0x23c9de));if(_0x23c9de[_0xfba3('0xe')]){if(_0x23c9de[_0xfba3('0xe')][_0xfba3('0xf')]===0x1f4){logger[_0xfba3('0xe')](_0xfba3('0xb'),_0x1fa6ea,_0x23c9de[_0xfba3('0xe')][_0xfba3('0x10')]);return _0x2f16de(_0x23c9de[_0xfba3('0xe')]['message']);}logger[_0xfba3('0xe')](_0xfba3('0xb'),_0x1fa6ea,_0x23c9de[_0xfba3('0xe')][_0xfba3('0x10')]);return _0x2aa418(_0x23c9de[_0xfba3('0xe')][_0xfba3('0x10')]);}else{logger[_0xfba3('0xa')](_0xfba3('0xb'),_0x1fa6ea,'request\x20sent');_0x2aa418(_0x23c9de[_0xfba3('0x11')][_0xfba3('0x10')]);}})[_0xfba3('0x12')](function(_0x4e143d){logger[_0xfba3('0xe')](_0xfba3('0xb'),_0x1fa6ea,_0x4e143d);_0x2f16de(_0x4e143d);});});}exports['GetFreshdeskAccount']=function(_0x2ebc42){var _0x3f4252=this;return new Promise(function(_0x1bc3ad,_0x95d419){return db[_0xfba3('0x13')][_0xfba3('0x14')]({'raw':_0x2ebc42[_0xfba3('0x15')]?_0x2ebc42['options'][_0xfba3('0x16')]===undefined?!![]:![]:!![],'where':_0x2ebc42[_0xfba3('0x15')]?_0x2ebc42[_0xfba3('0x15')][_0xfba3('0x17')]||null:null,'attributes':_0x2ebc42[_0xfba3('0x15')]?_0x2ebc42[_0xfba3('0x15')]['attributes']||null:null,'limit':_0x2ebc42[_0xfba3('0x15')]?_0x2ebc42['options'][_0xfba3('0x18')]||null:null,'include':_0x2ebc42[_0xfba3('0x15')]?_0x2ebc42['options'][_0xfba3('0x19')]?_[_0xfba3('0x1a')](_0x2ebc42[_0xfba3('0x15')][_0xfba3('0x19')],function(_0x3e717e){return{'model':db[_0x3e717e[_0xfba3('0x1b')]],'as':_0x3e717e['as'],'attributes':_0x3e717e[_0xfba3('0x1c')],'include':_0x3e717e['include']?_['map'](_0x3e717e[_0xfba3('0x19')],function(_0x35b604){return{'model':db[_0x35b604[_0xfba3('0x1b')]],'as':_0x35b604['as'],'attributes':_0x35b604[_0xfba3('0x1c')],'include':_0x35b604[_0xfba3('0x19')]?_[_0xfba3('0x1a')](_0x35b604[_0xfba3('0x19')],function(_0x2041c9){return{'model':db[_0x2041c9[_0xfba3('0x1b')]],'as':_0x2041c9['as'],'attributes':_0x2041c9['attributes']};}):[]};}):[]};}):[]:[]})[_0xfba3('0x9')](function(_0x5eeb74){logger['info'](_0xfba3('0x1d'),_0x2ebc42);logger[_0xfba3('0x1e')](_0xfba3('0x1d'),_0x2ebc42,JSON[_0xfba3('0xd')](_0x5eeb74));_0x1bc3ad(_0x5eeb74);})[_0xfba3('0x12')](function(_0x5c352){logger[_0xfba3('0xe')](_0xfba3('0x1d'),_0x5c352[_0xfba3('0x10')],_0x2ebc42);_0x95d419(_0x3f4252[_0xfba3('0xe')](0x1f4,_0x5c352[_0xfba3('0x10')]));});});};exports[_0xfba3('0x1f')]=function(_0x1b2a28){var _0x48dcac=this;return new Promise(function(_0x24ca78,_0x2c85a4){return db['FreshdeskAccount'][_0xfba3('0x20')]({'raw':_0x1b2a28[_0xfba3('0x15')]?_0x1b2a28['options'][_0xfba3('0x16')]===undefined?!![]:![]:!![],'where':_0x1b2a28['options']?_0x1b2a28[_0xfba3('0x15')][_0xfba3('0x17')]||null:null,'attributes':_0x1b2a28[_0xfba3('0x15')]?_0x1b2a28['options']['attributes']||null:null,'include':_0x1b2a28[_0xfba3('0x15')]?_0x1b2a28['options']['include']?_[_0xfba3('0x1a')](_0x1b2a28[_0xfba3('0x15')][_0xfba3('0x19')],function(_0x15cc91){return{'model':db[_0x15cc91['model']],'as':_0x15cc91['as'],'attributes':_0x15cc91[_0xfba3('0x1c')],'include':_0x15cc91[_0xfba3('0x19')]?_[_0xfba3('0x1a')](_0x15cc91[_0xfba3('0x19')],function(_0x4e5382){return{'model':db[_0x4e5382['model']],'as':_0x4e5382['as'],'attributes':_0x4e5382['attributes'],'include':_0x4e5382[_0xfba3('0x19')]?_[_0xfba3('0x1a')](_0x4e5382['include'],function(_0x273718){return{'model':db[_0x273718[_0xfba3('0x1b')]],'as':_0x273718['as'],'attributes':_0x273718[_0xfba3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfba3('0x9')](function(_0xbf5f28){logger[_0xfba3('0xa')]('ShowFreshdeskAccount',_0x1b2a28);logger[_0xfba3('0x1e')](_0xfba3('0x1f'),_0x1b2a28,JSON[_0xfba3('0xd')](_0xbf5f28));_0x24ca78(_0xbf5f28);})[_0xfba3('0x12')](function(_0x49c19e){logger[_0xfba3('0xe')](_0xfba3('0x1f'),_0x49c19e[_0xfba3('0x10')],_0x1b2a28);_0x2c85a4(_0x48dcac['error'](0x1f4,_0x49c19e[_0xfba3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0292be2..84861bf 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 _0xf006=['update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf006,0x146));var _0x6f00=function(_0x1152a3,_0x5a9357){_0x1152a3=_0x1152a3-0x0;var _0x11b761=_0xf006[_0x1152a3];return _0x11b761;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6f00('0x3'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x6f00('0x4')]('/',auth[_0x6f00('0x5')](),controller[_0x6f00('0x6')]);router['get'](_0x6f00('0x7'),auth['isAuthenticated'](),controller[_0x6f00('0x8')]);router[_0x6f00('0x4')](_0x6f00('0x9'),auth[_0x6f00('0x5')](),controller[_0x6f00('0xa')]);router[_0x6f00('0x4')](_0x6f00('0xb'),auth[_0x6f00('0x5')](),controller[_0x6f00('0xc')]);router[_0x6f00('0x4')](_0x6f00('0xd'),auth[_0x6f00('0x5')](),controller[_0x6f00('0xe')]);router['get'](_0x6f00('0xf'),auth[_0x6f00('0x5')](),controller[_0x6f00('0x10')]);router[_0x6f00('0x11')]('/',auth[_0x6f00('0x5')](),controller['create']);router[_0x6f00('0x11')]('/:id/tags',auth[_0x6f00('0x5')](),controller['setTags']);router[_0x6f00('0x12')](_0x6f00('0x7'),auth[_0x6f00('0x5')](),controller[_0x6f00('0x13')]);router[_0x6f00('0x14')](_0x6f00('0x7'),auth[_0x6f00('0x5')](),controller[_0x6f00('0x15')]);module[_0x6f00('0x16')]=router; \ No newline at end of file +var _0xb66c=['post','/:id/tags','setTags','update','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags'];(function(_0x33814f,_0xc51c20){var _0x1e6d7e=function(_0xcbe8a1){while(--_0xcbe8a1){_0x33814f['push'](_0x33814f['shift']());}};_0x1e6d7e(++_0xc51c20);}(_0xb66c,0x175));var _0xcb66=function(_0x40622a,_0x3abcf7){_0x40622a=_0x40622a-0x0;var _0x1db7f0=_0xb66c[_0x40622a];return _0x1db7f0;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var auth=require(_0xcb66('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcb66('0x5'));var controller=require(_0xcb66('0x6'));router[_0xcb66('0x7')]('/',auth[_0xcb66('0x8')](),controller['index']);router['get'](_0xcb66('0x9'),auth[_0xcb66('0x8')](),controller[_0xcb66('0xa')]);router[_0xcb66('0x7')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0xc')]);router[_0xcb66('0x7')](_0xcb66('0xd'),auth[_0xcb66('0x8')](),controller[_0xcb66('0xe')]);router['get'](_0xcb66('0xf'),auth[_0xcb66('0x8')](),controller[_0xcb66('0x10')]);router[_0xcb66('0x7')]('/:id/tags',auth[_0xcb66('0x8')](),controller[_0xcb66('0x11')]);router[_0xcb66('0x12')]('/',auth[_0xcb66('0x8')](),controller['create']);router[_0xcb66('0x12')](_0xcb66('0x13'),auth[_0xcb66('0x8')](),controller[_0xcb66('0x14')]);router['put'](_0xcb66('0x9'),auth['isAuthenticated'](),controller[_0xcb66('0x15')]);router['delete'](_0xcb66('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xcb66('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 20260ae..2d04ab0 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 _0xa8f6=['STRING','exports'];(function(_0x2fe6fa,_0x4b26d3){var _0xfc3a84=function(_0x4bff0c){while(--_0x4bff0c){_0x2fe6fa['push'](_0x2fe6fa['shift']());}};_0xfc3a84(++_0x4b26d3);}(_0xa8f6,0xbd));var _0x6a8f=function(_0x1fe954,_0x3a4bb5){_0x1fe954=_0x1fe954-0x0;var _0x43251c=_0xa8f6[_0x1fe954];return _0x43251c;};'use strict';var Sequelize=require('sequelize');module[_0x6a8f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6a8f('0x1')]}}; \ No newline at end of file +var _0xd958=['STRING','exports'];(function(_0x381e34,_0x3431cf){var _0x34cf84=function(_0x2b8bb6){while(--_0x2b8bb6){_0x381e34['push'](_0x381e34['shift']());}};_0x34cf84(++_0x3431cf);}(_0xd958,0x175));var _0x8d95=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xd958[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require('sequelize');module[_0x8d95('0x0')]={'name':{'type':Sequelize[_0x8d95('0x1')]},'description':{'type':Sequelize[_0x8d95('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 348759d..fe39607 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 _0x4cc6=['http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','keys','create','body','update','find','findOne','FreshdeskField','order','pick','hasOwnProperty','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client'];(function(_0x795e01,_0x1d1f3a){var _0x2ae2cb=function(_0x1049ab){while(--_0x1049ab){_0x795e01['push'](_0x795e01['shift']());}};_0x2ae2cb(++_0x1d1f3a);}(_0x4cc6,0x101));var _0x64cc=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x4cc6[_0x4c7935];return _0x30651d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x64cc('0x0'));var zipdir=require(_0x64cc('0x1'));var jsonpatch=require(_0x64cc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x64cc('0x3'));var Mustache=require('mustache');var util=require(_0x64cc('0x4'));var path=require(_0x64cc('0x5'));var sox=require('sox');var csv=require(_0x64cc('0x6'));var ejs=require(_0x64cc('0x7'));var fs=require('fs');var _=require(_0x64cc('0x8'));var squel=require(_0x64cc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x64cc('0xa'));var toCsv=require(_0x64cc('0x6'));var querystring=require(_0x64cc('0xb'));var Papa=require(_0x64cc('0xc'));var Redis=require(_0x64cc('0xd'));var authService=require(_0x64cc('0xe'));var qs=require(_0x64cc('0xf'));var hardwareService=require(_0x64cc('0x10'));var logger=require('../../config/logger')(_0x64cc('0x11'));var utils=require(_0x64cc('0x12'));var config=require(_0x64cc('0x13'));var db=require(_0x64cc('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x64cc('0x15')][_0x64cc('0x16')]({'port':0x232a});function checkPasswordPattern(_0x21f4d2,_0x41a9d6,_0x480ee1){if(_0x480ee1){var _0x492771=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x492771['test'](_0x41a9d6)){return _0x21f4d2;}else{throw new Error(_0x64cc('0x17'));}}else{return _0x21f4d2;}}function respondWithRpcPromise(_0x38bbd1,_0x2ace6a,_0x40f4ef,_0x455485){return new BPromise(function(_0x3480a5,_0x1a4daa){var _0x37bdda=_0x455485||client;return _0x37bdda[_0x64cc('0x18')](_0x38bbd1,_0x40f4ef)[_0x64cc('0x19')](function(_0x3b82fd){logger[_0x64cc('0x1a')](_0x64cc('0x1b'),_0x2ace6a,_0x64cc('0x1c'));logger[_0x64cc('0x1d')](_0x64cc('0x1e'),_0x2ace6a,_0x64cc('0x1c'),JSON['stringify'](_0x3b82fd));if(_0x3b82fd[_0x64cc('0x1f')]){if(_0x3b82fd[_0x64cc('0x1f')]['code']===0x1f4){logger['error'](_0x64cc('0x1b'),_0x2ace6a,_0x3b82fd['error'][_0x64cc('0x20')]);return _0x1a4daa(_0x3b82fd['error'][_0x64cc('0x20')]);}logger[_0x64cc('0x1f')](_0x64cc('0x1b'),_0x2ace6a,_0x3b82fd[_0x64cc('0x1f')][_0x64cc('0x20')]);return _0x3480a5(_0x3b82fd['error'][_0x64cc('0x20')]);}else{logger[_0x64cc('0x1a')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2ace6a,_0x64cc('0x1c'));_0x3480a5(_0x3b82fd[_0x64cc('0x21')]['message']);}})[_0x64cc('0x22')](function(_0x3a312f){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2ace6a,_0x3a312f);_0x1a4daa(_0x3a312f);});});}function respondWithStatusCode(_0x55af4c,_0x5e8f6f){_0x5e8f6f=_0x5e8f6f||0xcc;return function(_0x5e5b6b){if(_0x5e5b6b){return _0x55af4c[_0x64cc('0x23')](_0x5e8f6f);}return _0x55af4c[_0x64cc('0x24')](_0x5e8f6f)[_0x64cc('0x25')]();};}function respondWithResult(_0x29d8ec,_0x322819){_0x322819=_0x322819||0xc8;return function(_0x295142){if(_0x295142){return _0x29d8ec[_0x64cc('0x24')](_0x322819)[_0x64cc('0x26')](_0x295142);}};}function respondWithFilteredResult(_0x3809d3,_0x417297){return function(_0x192d02){if(_0x192d02){var _0x3977bb=_0x192d02[_0x64cc('0x27')],_0x5cc518=_0x417297[_0x64cc('0x28')],_0x5b0953=_0x417297[_0x64cc('0x28')]+_0x417297['limit'],_0x5643be;if(_0x5b0953>=_0x3977bb){_0x5b0953=_0x3977bb;_0x5643be=0xc8;}else{_0x5643be=0xce;}_0x3809d3[_0x64cc('0x24')](_0x5643be);return _0x3809d3['set'](_0x64cc('0x29'),_0x5cc518+'-'+_0x5b0953+'/'+_0x3977bb)['json'](_0x192d02);}return null;};}function patchUpdates(_0x72a91c){return function(_0x43ae47){try{jsonpatch[_0x64cc('0x2a')](_0x43ae47,_0x72a91c,!![]);}catch(_0x3c42c5){return BPromise[_0x64cc('0x2b')](_0x3c42c5);}return _0x43ae47[_0x64cc('0x2c')]();};}function saveUpdates(_0x216efa,_0x37e36c){return function(_0x24f1b5){if(_0x24f1b5){return _0x24f1b5['update'](_0x216efa)[_0x64cc('0x19')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x37ab9a,_0x445928){return function(_0x4d0889){if(_0x4d0889){return _0x4d0889[_0x64cc('0x2d')]()['then'](function(){_0x37ab9a[_0x64cc('0x24')](0xcc)[_0x64cc('0x25')]();});}};}function handleEntityNotFound(_0x26592b,_0x5a8889){return function(_0x491184){if(!_0x491184){_0x26592b[_0x64cc('0x23')](0x194);}return _0x491184;};}function handleError(_0x141e8d,_0x59b935){_0x59b935=_0x59b935||0x1f4;return function(_0x5e92de){logger['error'](_0x5e92de[_0x64cc('0x2e')]);if(_0x5e92de[_0x64cc('0x2f')]){delete _0x5e92de[_0x64cc('0x2f')];}_0x141e8d[_0x64cc('0x24')](_0x59b935)[_0x64cc('0x30')](_0x5e92de);};}exports[_0x64cc('0x31')]=function(_0x576fa3,_0x219a3a){var _0x25a975={},_0x5bc518={},_0x5934db={'count':0x0,'rows':[]};var _0x53ebe8=db[_0x64cc('0x32')][_0x64cc('0x33')];_0x5bc518[_0x64cc('0x34')]=_['keys'](_0x53ebe8);_0x5bc518[_0x64cc('0x35')]=_['keys'](_0x576fa3[_0x64cc('0x35')]);_0x5bc518[_0x64cc('0x36')]=_[_0x64cc('0x37')](_0x5bc518[_0x64cc('0x34')],_0x5bc518[_0x64cc('0x35')]);_0x25a975[_0x64cc('0x38')]=_[_0x64cc('0x37')](_0x5bc518[_0x64cc('0x34')],qs['fields'](_0x576fa3['query'][_0x64cc('0x39')]));_0x25a975[_0x64cc('0x38')]=_0x25a975[_0x64cc('0x38')][_0x64cc('0x3a')]?_0x25a975[_0x64cc('0x38')]:_0x5bc518[_0x64cc('0x34')];if(!_0x576fa3[_0x64cc('0x35')]['hasOwnProperty'](_0x64cc('0x3b'))){_0x25a975['limit']=qs[_0x64cc('0x3c')](_0x576fa3['query'][_0x64cc('0x3c')]);_0x25a975[_0x64cc('0x28')]=qs[_0x64cc('0x28')](_0x576fa3[_0x64cc('0x35')][_0x64cc('0x28')]);}_0x25a975['order']=qs[_0x64cc('0x3d')](_0x576fa3['query'][_0x64cc('0x3d')]);_0x25a975[_0x64cc('0x3e')]=qs[_0x64cc('0x36')](_['pick'](_0x576fa3[_0x64cc('0x35')],_0x5bc518['filters']));if(_0x576fa3[_0x64cc('0x35')][_0x64cc('0x3f')]){_0x25a975[_0x64cc('0x3e')]=_[_0x64cc('0x40')](_0x25a975[_0x64cc('0x3e')],{'$or':_[_0x64cc('0x41')](_0x53ebe8,function(_0x5b37c2){if(_0x5b37c2[_0x64cc('0x42')][_0x64cc('0x43')]!==_0x64cc('0x44')){var _0x8d93b8={};_0x8d93b8[_0x5b37c2[_0x64cc('0x45')]]={'$like':'%'+_0x576fa3[_0x64cc('0x35')]['filter']+'%'};return _0x8d93b8;}})});}_0x25a975=_['merge']({},_0x25a975,_0x576fa3[_0x64cc('0x46')]);var _0x55ccd0={'where':_0x25a975[_0x64cc('0x3e')]};return db['FreshdeskConfiguration'][_0x64cc('0x27')](_0x55ccd0)[_0x64cc('0x19')](function(_0x18c0bf){_0x5934db['count']=_0x18c0bf;if(_0x576fa3['query'][_0x64cc('0x47')]){_0x25a975[_0x64cc('0x48')]=[{'all':!![]}];}return db[_0x64cc('0x32')]['findAll'](_0x25a975);})['then'](function(_0x304fd8){_0x5934db[_0x64cc('0x49')]=_0x304fd8;return _0x5934db;})[_0x64cc('0x19')](respondWithFilteredResult(_0x219a3a,_0x25a975))[_0x64cc('0x22')](handleError(_0x219a3a,null));};exports[_0x64cc('0x4a')]=function(_0x7f4580,_0x16ad80){var _0x3b7ff7={'raw':![],'where':{'id':_0x7f4580[_0x64cc('0x4b')]['id']}},_0x4503cb={};_0x4503cb['model']=_[_0x64cc('0x4c')](db[_0x64cc('0x32')]['rawAttributes']);_0x4503cb[_0x64cc('0x35')]=_['keys'](_0x7f4580[_0x64cc('0x35')]);_0x4503cb['filters']=_[_0x64cc('0x37')](_0x4503cb[_0x64cc('0x34')],_0x4503cb[_0x64cc('0x35')]);_0x3b7ff7[_0x64cc('0x38')]=_[_0x64cc('0x37')](_0x4503cb[_0x64cc('0x34')],qs['fields'](_0x7f4580[_0x64cc('0x35')]['fields']));_0x3b7ff7['attributes']=_0x3b7ff7['attributes']['length']?_0x3b7ff7[_0x64cc('0x38')]:_0x4503cb['model'];if(_0x7f4580[_0x64cc('0x35')][_0x64cc('0x47')]){_0x3b7ff7[_0x64cc('0x48')]=[{'all':!![]}];}_0x3b7ff7=_['merge']({},_0x3b7ff7,_0x7f4580[_0x64cc('0x46')]);return db['FreshdeskConfiguration']['find'](_0x3b7ff7)['then'](handleEntityNotFound(_0x16ad80,null))['then'](respondWithResult(_0x16ad80,null))[_0x64cc('0x22')](handleError(_0x16ad80,null));};exports[_0x64cc('0x4d')]=function(_0x4b1ace,_0x25526e){return db[_0x64cc('0x32')]['create'](_0x4b1ace[_0x64cc('0x4e')],{})[_0x64cc('0x19')](respondWithResult(_0x25526e,0xc9))[_0x64cc('0x22')](handleError(_0x25526e,null));};exports[_0x64cc('0x4f')]=function(_0x2426c6,_0x4f8073){if(_0x2426c6[_0x64cc('0x4e')]['id']){delete _0x2426c6['body']['id'];}return db[_0x64cc('0x32')][_0x64cc('0x50')]({'where':{'id':_0x2426c6[_0x64cc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f8073,null))[_0x64cc('0x19')](saveUpdates(_0x2426c6[_0x64cc('0x4e')],null))['then'](respondWithResult(_0x4f8073,null))[_0x64cc('0x22')](handleError(_0x4f8073,null));};exports['destroy']=function(_0x5dde72,_0x502fc4){return db[_0x64cc('0x32')]['find']({'where':{'id':_0x5dde72['params']['id']}})['then'](handleEntityNotFound(_0x502fc4,null))[_0x64cc('0x19')](removeEntity(_0x502fc4,null))[_0x64cc('0x22')](handleError(_0x502fc4,null));};exports['getFields']=function(_0x8b9374,_0x406c94,_0x50a313){var _0x3ab7c8={};var _0x346397={};var _0x3ccbf5;var _0x107de1;return db[_0x64cc('0x32')][_0x64cc('0x51')]({'where':{'id':_0x8b9374[_0x64cc('0x4b')]['id']}})[_0x64cc('0x19')](handleEntityNotFound(_0x406c94,null))['then'](function(_0x46c356){if(_0x46c356){_0x3ccbf5=_0x46c356;_0x346397[_0x64cc('0x34')]=_[_0x64cc('0x4c')](db[_0x64cc('0x52')][_0x64cc('0x33')]);_0x346397[_0x64cc('0x35')]=_[_0x64cc('0x4c')](_0x8b9374['query']);_0x346397[_0x64cc('0x36')]=_[_0x64cc('0x37')](_0x346397[_0x64cc('0x34')],_0x346397['query']);_0x3ab7c8[_0x64cc('0x38')]=_[_0x64cc('0x37')](_0x346397[_0x64cc('0x34')],qs[_0x64cc('0x39')](_0x8b9374['query']['fields']));_0x3ab7c8[_0x64cc('0x38')]=_0x3ab7c8[_0x64cc('0x38')][_0x64cc('0x3a')]?_0x3ab7c8[_0x64cc('0x38')]:_0x346397['model'];_0x3ab7c8[_0x64cc('0x53')]=qs[_0x64cc('0x3d')](_0x8b9374[_0x64cc('0x35')][_0x64cc('0x3d')]);_0x3ab7c8[_0x64cc('0x3e')]=qs[_0x64cc('0x36')](_[_0x64cc('0x54')](_0x8b9374[_0x64cc('0x35')],_0x346397[_0x64cc('0x36')]));if(_0x8b9374[_0x64cc('0x35')][_0x64cc('0x3f')]){_0x3ab7c8[_0x64cc('0x3e')]=_[_0x64cc('0x40')](_0x3ab7c8[_0x64cc('0x3e')],{'$or':_['map'](_0x3ab7c8[_0x64cc('0x38')],function(_0x5d81ba){var _0x3ecfb0={};_0x3ecfb0[_0x5d81ba]={'$like':'%'+_0x8b9374[_0x64cc('0x35')][_0x64cc('0x3f')]+'%'};return _0x3ecfb0;})});}_0x3ab7c8=_[_0x64cc('0x40')]({},_0x3ab7c8,_0x8b9374[_0x64cc('0x46')]);return _0x3ccbf5['getFields'](_0x3ab7c8);}})[_0x64cc('0x19')](function(_0x2b2165){if(_0x2b2165){_0x107de1=_0x2b2165['length'];if(!_0x8b9374['query'][_0x64cc('0x55')]('nolimit')){_0x3ab7c8['limit']=qs[_0x64cc('0x3c')](_0x8b9374[_0x64cc('0x35')][_0x64cc('0x3c')]);_0x3ab7c8['offset']=qs['offset'](_0x8b9374[_0x64cc('0x35')]['offset']);}return _0x3ccbf5[_0x64cc('0x56')](_0x3ab7c8);}})[_0x64cc('0x19')](function(_0xb3295d){if(_0xb3295d){return _0xb3295d?{'count':_0x107de1,'rows':_0xb3295d}:null;}})[_0x64cc('0x19')](respondWithResult(_0x406c94,null))[_0x64cc('0x22')](handleError(_0x406c94,null));};exports[_0x64cc('0x57')]=function(_0x5e3095,_0x588229,_0x30ffea){var _0x525154={};var _0x3b4f13={};var _0x2a139e;var _0x4bcc1a;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5e3095[_0x64cc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x588229,null))[_0x64cc('0x19')](function(_0x28904b){if(_0x28904b){_0x2a139e=_0x28904b;_0x3b4f13[_0x64cc('0x34')]=_['keys'](db['FreshdeskField'][_0x64cc('0x33')]);_0x3b4f13['query']=_[_0x64cc('0x4c')](_0x5e3095['query']);_0x3b4f13[_0x64cc('0x36')]=_['intersection'](_0x3b4f13[_0x64cc('0x34')],_0x3b4f13[_0x64cc('0x35')]);_0x525154['attributes']=_[_0x64cc('0x37')](_0x3b4f13[_0x64cc('0x34')],qs[_0x64cc('0x39')](_0x5e3095[_0x64cc('0x35')][_0x64cc('0x39')]));_0x525154[_0x64cc('0x38')]=_0x525154[_0x64cc('0x38')][_0x64cc('0x3a')]?_0x525154[_0x64cc('0x38')]:_0x3b4f13[_0x64cc('0x34')];_0x525154[_0x64cc('0x53')]=qs[_0x64cc('0x3d')](_0x5e3095[_0x64cc('0x35')][_0x64cc('0x3d')]);_0x525154['where']=qs[_0x64cc('0x36')](_['pick'](_0x5e3095[_0x64cc('0x35')],_0x3b4f13[_0x64cc('0x36')]));if(_0x5e3095[_0x64cc('0x35')][_0x64cc('0x3f')]){_0x525154['where']=_['merge'](_0x525154[_0x64cc('0x3e')],{'$or':_[_0x64cc('0x41')](_0x525154[_0x64cc('0x38')],function(_0xa10185){var _0x4268b2={};_0x4268b2[_0xa10185]={'$like':'%'+_0x5e3095[_0x64cc('0x35')][_0x64cc('0x3f')]+'%'};return _0x4268b2;})});}_0x525154=_[_0x64cc('0x40')]({},_0x525154,_0x5e3095[_0x64cc('0x46')]);return _0x2a139e[_0x64cc('0x57')](_0x525154);}})[_0x64cc('0x19')](function(_0xe91189){if(_0xe91189){_0x4bcc1a=_0xe91189[_0x64cc('0x3a')];if(!_0x5e3095['query'][_0x64cc('0x55')](_0x64cc('0x3b'))){_0x525154[_0x64cc('0x3c')]=qs['limit'](_0x5e3095[_0x64cc('0x35')]['limit']);_0x525154[_0x64cc('0x28')]=qs['offset'](_0x5e3095[_0x64cc('0x35')][_0x64cc('0x28')]);}return _0x2a139e['getSubjects'](_0x525154);}})['then'](function(_0xcb5c22){if(_0xcb5c22){return _0xcb5c22?{'count':_0x4bcc1a,'rows':_0xcb5c22}:null;}})['then'](respondWithResult(_0x588229,null))[_0x64cc('0x22')](handleError(_0x588229,null));};exports[_0x64cc('0x58')]=function(_0x1e0903,_0x59eef9,_0x343755){var _0x5bd2bc={};var _0x19e7f7={};var _0x285c55;var _0x2f55c0;return db['FreshdeskConfiguration'][_0x64cc('0x51')]({'where':{'id':_0x1e0903[_0x64cc('0x4b')]['id']}})[_0x64cc('0x19')](handleEntityNotFound(_0x59eef9,null))[_0x64cc('0x19')](function(_0x26fed5){if(_0x26fed5){_0x285c55=_0x26fed5;_0x19e7f7['model']=_[_0x64cc('0x4c')](db['FreshdeskField'][_0x64cc('0x33')]);_0x19e7f7['query']=_['keys'](_0x1e0903['query']);_0x19e7f7[_0x64cc('0x36')]=_[_0x64cc('0x37')](_0x19e7f7[_0x64cc('0x34')],_0x19e7f7[_0x64cc('0x35')]);_0x5bd2bc[_0x64cc('0x38')]=_[_0x64cc('0x37')](_0x19e7f7['model'],qs['fields'](_0x1e0903[_0x64cc('0x35')][_0x64cc('0x39')]));_0x5bd2bc['attributes']=_0x5bd2bc[_0x64cc('0x38')][_0x64cc('0x3a')]?_0x5bd2bc[_0x64cc('0x38')]:_0x19e7f7[_0x64cc('0x34')];_0x5bd2bc['order']=qs[_0x64cc('0x3d')](_0x1e0903['query'][_0x64cc('0x3d')]);_0x5bd2bc[_0x64cc('0x3e')]=qs[_0x64cc('0x36')](_[_0x64cc('0x54')](_0x1e0903[_0x64cc('0x35')],_0x19e7f7[_0x64cc('0x36')]));if(_0x1e0903[_0x64cc('0x35')][_0x64cc('0x3f')]){_0x5bd2bc[_0x64cc('0x3e')]=_[_0x64cc('0x40')](_0x5bd2bc[_0x64cc('0x3e')],{'$or':_[_0x64cc('0x41')](_0x5bd2bc['attributes'],function(_0x5c2d53){var _0x44d2e7={};_0x44d2e7[_0x5c2d53]={'$like':'%'+_0x1e0903[_0x64cc('0x35')][_0x64cc('0x3f')]+'%'};return _0x44d2e7;})});}_0x5bd2bc=_[_0x64cc('0x40')]({},_0x5bd2bc,_0x1e0903[_0x64cc('0x46')]);return _0x285c55[_0x64cc('0x58')](_0x5bd2bc);}})[_0x64cc('0x19')](function(_0x10566b){if(_0x10566b){_0x2f55c0=_0x10566b['length'];if(!_0x1e0903[_0x64cc('0x35')][_0x64cc('0x55')](_0x64cc('0x3b'))){_0x5bd2bc['limit']=qs[_0x64cc('0x3c')](_0x1e0903[_0x64cc('0x35')][_0x64cc('0x3c')]);_0x5bd2bc[_0x64cc('0x28')]=qs[_0x64cc('0x28')](_0x1e0903[_0x64cc('0x35')][_0x64cc('0x28')]);}return _0x285c55['getDescriptions'](_0x5bd2bc);}})[_0x64cc('0x19')](function(_0x25fa59){if(_0x25fa59){return _0x25fa59?{'count':_0x2f55c0,'rows':_0x25fa59}:null;}})[_0x64cc('0x19')](respondWithResult(_0x59eef9,null))['catch'](handleError(_0x59eef9,null));};exports[_0x64cc('0x59')]=function(_0x11ae3f,_0x1b70aa,_0x3c24bb){var _0x4ff29a={};var _0x59f6f8={};var _0x405d96;var _0x53f35b;return db[_0x64cc('0x32')][_0x64cc('0x51')]({'where':{'id':_0x11ae3f[_0x64cc('0x4b')]['id']}})[_0x64cc('0x19')](handleEntityNotFound(_0x1b70aa,null))[_0x64cc('0x19')](function(_0x2a3cc5){if(_0x2a3cc5){_0x405d96=_0x2a3cc5;_0x59f6f8[_0x64cc('0x34')]=_[_0x64cc('0x4c')](db[_0x64cc('0x5a')][_0x64cc('0x33')]);_0x59f6f8[_0x64cc('0x35')]=_[_0x64cc('0x4c')](_0x11ae3f['query']);_0x59f6f8[_0x64cc('0x36')]=_[_0x64cc('0x37')](_0x59f6f8[_0x64cc('0x34')],_0x59f6f8[_0x64cc('0x35')]);_0x4ff29a[_0x64cc('0x38')]=_['intersection'](_0x59f6f8['model'],qs['fields'](_0x11ae3f[_0x64cc('0x35')][_0x64cc('0x39')]));_0x4ff29a[_0x64cc('0x38')]=_0x4ff29a[_0x64cc('0x38')][_0x64cc('0x3a')]?_0x4ff29a[_0x64cc('0x38')]:_0x59f6f8[_0x64cc('0x34')];_0x4ff29a['order']=qs[_0x64cc('0x3d')](_0x11ae3f[_0x64cc('0x35')]['sort']);_0x4ff29a['where']=qs[_0x64cc('0x36')](_[_0x64cc('0x54')](_0x11ae3f['query'],_0x59f6f8[_0x64cc('0x36')]));if(_0x11ae3f[_0x64cc('0x35')]['filter']){_0x4ff29a[_0x64cc('0x3e')]=_[_0x64cc('0x40')](_0x4ff29a['where'],{'$or':_['map'](_0x4ff29a[_0x64cc('0x38')],function(_0x52737c){var _0x4f36bd={};_0x4f36bd[_0x52737c]={'$like':'%'+_0x11ae3f['query'][_0x64cc('0x3f')]+'%'};return _0x4f36bd;})});}_0x4ff29a=_[_0x64cc('0x40')]({},_0x4ff29a,_0x11ae3f['options']);return _0x405d96[_0x64cc('0x59')](_0x4ff29a);}})[_0x64cc('0x19')](function(_0x47959f){if(_0x47959f){_0x53f35b=_0x47959f[_0x64cc('0x3a')];if(!_0x11ae3f[_0x64cc('0x35')]['hasOwnProperty'](_0x64cc('0x3b'))){_0x4ff29a[_0x64cc('0x3c')]=qs[_0x64cc('0x3c')](_0x11ae3f[_0x64cc('0x35')]['limit']);_0x4ff29a[_0x64cc('0x28')]=qs[_0x64cc('0x28')](_0x11ae3f[_0x64cc('0x35')]['offset']);}return _0x405d96[_0x64cc('0x59')](_0x4ff29a);}})['then'](function(_0x313407){if(_0x313407){return _0x313407?{'count':_0x53f35b,'rows':_0x313407}:null;}})[_0x64cc('0x19')](respondWithResult(_0x1b70aa,null))['catch'](handleError(_0x1b70aa,null));};exports['setTags']=function(_0x4480da,_0x572007,_0x50fbe4){if(_0x4480da[_0x64cc('0x4e')]['id']){delete _0x4480da[_0x64cc('0x4e')]['id'];}return db[_0x64cc('0x32')]['findOne']({'where':{'id':_0x4480da[_0x64cc('0x4b')]['id']}})[_0x64cc('0x19')](handleEntityNotFound(_0x572007,null))['then'](function(_0x5bfea2){if(_0x5bfea2){return _0x5bfea2[_0x64cc('0x5b')](_0x4480da[_0x64cc('0x4e')][_0x64cc('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x572007,null))[_0x64cc('0x22')](handleError(_0x572007,null));}; \ No newline at end of file +var _0xb499=['reject','save','update','destroy','sendStatus','stack','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','FreshdeskConfiguration','findAll','catch','show','params','includeAll','options','find','create','body','getFields','findOne','getSubjects','getDescriptions','FreshdeskField','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x764919,_0x588753){var _0x103b07=function(_0x41130f){while(--_0x41130f){_0x764919['push'](_0x764919['shift']());}};_0x103b07(++_0x588753);}(_0xb499,0xf1));var _0x9b49=function(_0x27683b,_0x4665e5){_0x27683b=_0x27683b-0x0;var _0x1f944a=_0xb499[_0x27683b];return _0x1f944a;};'use strict';var pdf=require(_0x9b49('0x0'));var emlformat=require(_0x9b49('0x1'));var rimraf=require(_0x9b49('0x2'));var zipdir=require(_0x9b49('0x3'));var jsonpatch=require(_0x9b49('0x4'));var rp=require(_0x9b49('0x5'));var moment=require(_0x9b49('0x6'));var BPromise=require(_0x9b49('0x7'));var Mustache=require(_0x9b49('0x8'));var util=require(_0x9b49('0x9'));var path=require(_0x9b49('0xa'));var sox=require('sox');var csv=require(_0x9b49('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b49('0xc'));var squel=require(_0x9b49('0xd'));var crypto=require(_0x9b49('0xe'));var jsforce=require(_0x9b49('0xf'));var deskjs=require(_0x9b49('0x10'));var toCsv=require(_0x9b49('0xb'));var querystring=require(_0x9b49('0x11'));var Papa=require(_0x9b49('0x12'));var Redis=require(_0x9b49('0x13'));var authService=require(_0x9b49('0x14'));var qs=require(_0x9b49('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b49('0x16'))(_0x9b49('0x17'));var utils=require(_0x9b49('0x18'));var config=require(_0x9b49('0x19'));var db=require(_0x9b49('0x1a'))['db'];var jayson=require(_0x9b49('0x1b'));var client=jayson['client'][_0x9b49('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x44fec7,_0x2dc290,_0x395a40){if(_0x395a40){var _0x320495=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x320495[_0x9b49('0x1d')](_0x2dc290)){return _0x44fec7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x44fec7;}}function respondWithRpcPromise(_0x2f74eb,_0x2736f0,_0x187623,_0x4da148){return new BPromise(function(_0x7193eb,_0x5e7051){var _0x15620f=_0x4da148||client;return _0x15620f[_0x9b49('0x1e')](_0x2f74eb,_0x187623)[_0x9b49('0x1f')](function(_0x42978f){logger[_0x9b49('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2736f0,_0x9b49('0x21'));logger[_0x9b49('0x22')](_0x9b49('0x23'),_0x2736f0,_0x9b49('0x21'),JSON[_0x9b49('0x24')](_0x42978f));if(_0x42978f['error']){if(_0x42978f[_0x9b49('0x25')][_0x9b49('0x26')]===0x1f4){logger[_0x9b49('0x25')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2736f0,_0x42978f['error'][_0x9b49('0x27')]);return _0x5e7051(_0x42978f['error'][_0x9b49('0x27')]);}logger[_0x9b49('0x25')](_0x9b49('0x28'),_0x2736f0,_0x42978f[_0x9b49('0x25')][_0x9b49('0x27')]);return _0x7193eb(_0x42978f['error'][_0x9b49('0x27')]);}else{logger[_0x9b49('0x20')](_0x9b49('0x28'),_0x2736f0,_0x9b49('0x21'));_0x7193eb(_0x42978f[_0x9b49('0x29')]['message']);}})['catch'](function(_0x4fda29){logger[_0x9b49('0x25')](_0x9b49('0x28'),_0x2736f0,_0x4fda29);_0x5e7051(_0x4fda29);});});}function respondWithStatusCode(_0x3df0d4,_0x45c4df){_0x45c4df=_0x45c4df||0xcc;return function(_0x23eadd){if(_0x23eadd){return _0x3df0d4['sendStatus'](_0x45c4df);}return _0x3df0d4[_0x9b49('0x2a')](_0x45c4df)[_0x9b49('0x2b')]();};}function respondWithResult(_0x28932c,_0x5571e6){_0x5571e6=_0x5571e6||0xc8;return function(_0x6ac87d){if(_0x6ac87d){return _0x28932c['status'](_0x5571e6)[_0x9b49('0x2c')](_0x6ac87d);}};}function respondWithFilteredResult(_0x5ec421,_0x2de9cc){return function(_0x293738){if(_0x293738){var _0x38b4d7=_0x293738[_0x9b49('0x2d')],_0x1a0563=_0x2de9cc[_0x9b49('0x2e')],_0x44239d=_0x2de9cc['offset']+_0x2de9cc[_0x9b49('0x2f')],_0x5463ef;if(_0x44239d>=_0x38b4d7){_0x44239d=_0x38b4d7;_0x5463ef=0xc8;}else{_0x5463ef=0xce;}_0x5ec421[_0x9b49('0x2a')](_0x5463ef);return _0x5ec421['set'](_0x9b49('0x30'),_0x1a0563+'-'+_0x44239d+'/'+_0x38b4d7)[_0x9b49('0x2c')](_0x293738);}return null;};}function patchUpdates(_0x54b3e9){return function(_0x5f4100){try{jsonpatch[_0x9b49('0x31')](_0x5f4100,_0x54b3e9,!![]);}catch(_0x5a032f){return BPromise[_0x9b49('0x32')](_0x5a032f);}return _0x5f4100[_0x9b49('0x33')]();};}function saveUpdates(_0x364b95,_0x43bcb8){return function(_0x24d6e1){if(_0x24d6e1){return _0x24d6e1[_0x9b49('0x34')](_0x364b95)[_0x9b49('0x1f')](function(_0xb2bb5c){return _0xb2bb5c;});}return null;};}function removeEntity(_0xfa5119,_0x1352ed){return function(_0x45ade0){if(_0x45ade0){return _0x45ade0[_0x9b49('0x35')]()[_0x9b49('0x1f')](function(){_0xfa5119[_0x9b49('0x2a')](0xcc)[_0x9b49('0x2b')]();});}};}function handleEntityNotFound(_0x4e8de0,_0x37b8f6){return function(_0x3b1df1){if(!_0x3b1df1){_0x4e8de0[_0x9b49('0x36')](0x194);}return _0x3b1df1;};}function handleError(_0xc3bf50,_0xde03ef){_0xde03ef=_0xde03ef||0x1f4;return function(_0x566fdd){logger['error'](_0x566fdd[_0x9b49('0x37')]);if(_0x566fdd[_0x9b49('0x38')]){delete _0x566fdd[_0x9b49('0x38')];}_0xc3bf50[_0x9b49('0x2a')](_0xde03ef)['send'](_0x566fdd);};}exports[_0x9b49('0x39')]=function(_0x36c57d,_0x4288eb){var _0x2dd6ec={},_0x1fad1b={},_0xd717b0={'count':0x0,'rows':[]};var _0x427f3d=db['FreshdeskConfiguration'][_0x9b49('0x3a')];_0x1fad1b['model']=_[_0x9b49('0x3b')](_0x427f3d);_0x1fad1b[_0x9b49('0x3c')]=_[_0x9b49('0x3b')](_0x36c57d['query']);_0x1fad1b[_0x9b49('0x3d')]=_[_0x9b49('0x3e')](_0x1fad1b[_0x9b49('0x3f')],_0x1fad1b['query']);_0x2dd6ec[_0x9b49('0x40')]=_[_0x9b49('0x3e')](_0x1fad1b[_0x9b49('0x3f')],qs[_0x9b49('0x41')](_0x36c57d['query']['fields']));_0x2dd6ec['attributes']=_0x2dd6ec[_0x9b49('0x40')][_0x9b49('0x42')]?_0x2dd6ec[_0x9b49('0x40')]:_0x1fad1b[_0x9b49('0x3f')];if(!_0x36c57d[_0x9b49('0x3c')][_0x9b49('0x43')](_0x9b49('0x44'))){_0x2dd6ec[_0x9b49('0x2f')]=qs[_0x9b49('0x2f')](_0x36c57d[_0x9b49('0x3c')][_0x9b49('0x2f')]);_0x2dd6ec['offset']=qs[_0x9b49('0x2e')](_0x36c57d[_0x9b49('0x3c')]['offset']);}_0x2dd6ec[_0x9b49('0x45')]=qs[_0x9b49('0x46')](_0x36c57d[_0x9b49('0x3c')][_0x9b49('0x46')]);_0x2dd6ec[_0x9b49('0x47')]=qs['filters'](_[_0x9b49('0x48')](_0x36c57d[_0x9b49('0x3c')],_0x1fad1b['filters']));if(_0x36c57d['query'][_0x9b49('0x49')]){_0x2dd6ec[_0x9b49('0x47')]=_[_0x9b49('0x4a')](_0x2dd6ec[_0x9b49('0x47')],{'$or':_[_0x9b49('0x4b')](_0x427f3d,function(_0x594d3a){if(_0x594d3a[_0x9b49('0x4c')][_0x9b49('0x4d')]!=='VIRTUAL'){var _0x2c64e4={};_0x2c64e4[_0x594d3a[_0x9b49('0x4e')]]={'$like':'%'+_0x36c57d['query'][_0x9b49('0x49')]+'%'};return _0x2c64e4;}})});}_0x2dd6ec=_['merge']({},_0x2dd6ec,_0x36c57d['options']);var _0x3d9023={'where':_0x2dd6ec[_0x9b49('0x47')]};return db['FreshdeskConfiguration'][_0x9b49('0x2d')](_0x3d9023)[_0x9b49('0x1f')](function(_0x4c82b9){_0xd717b0[_0x9b49('0x2d')]=_0x4c82b9;if(_0x36c57d[_0x9b49('0x3c')]['includeAll']){_0x2dd6ec['include']=[{'all':!![]}];}return db[_0x9b49('0x4f')][_0x9b49('0x50')](_0x2dd6ec);})['then'](function(_0x59773e){_0xd717b0['rows']=_0x59773e;return _0xd717b0;})[_0x9b49('0x1f')](respondWithFilteredResult(_0x4288eb,_0x2dd6ec))[_0x9b49('0x51')](handleError(_0x4288eb,null));};exports[_0x9b49('0x52')]=function(_0x48c9d9,_0x2e7574){var _0x4616cf={'raw':![],'where':{'id':_0x48c9d9[_0x9b49('0x53')]['id']}},_0x5b31bb={};_0x5b31bb['model']=_[_0x9b49('0x3b')](db[_0x9b49('0x4f')][_0x9b49('0x3a')]);_0x5b31bb[_0x9b49('0x3c')]=_[_0x9b49('0x3b')](_0x48c9d9[_0x9b49('0x3c')]);_0x5b31bb[_0x9b49('0x3d')]=_[_0x9b49('0x3e')](_0x5b31bb[_0x9b49('0x3f')],_0x5b31bb['query']);_0x4616cf[_0x9b49('0x40')]=_['intersection'](_0x5b31bb['model'],qs[_0x9b49('0x41')](_0x48c9d9[_0x9b49('0x3c')][_0x9b49('0x41')]));_0x4616cf[_0x9b49('0x40')]=_0x4616cf['attributes']['length']?_0x4616cf['attributes']:_0x5b31bb['model'];if(_0x48c9d9['query'][_0x9b49('0x54')]){_0x4616cf['include']=[{'all':!![]}];}_0x4616cf=_['merge']({},_0x4616cf,_0x48c9d9[_0x9b49('0x55')]);return db[_0x9b49('0x4f')][_0x9b49('0x56')](_0x4616cf)[_0x9b49('0x1f')](handleEntityNotFound(_0x2e7574,null))[_0x9b49('0x1f')](respondWithResult(_0x2e7574,null))[_0x9b49('0x51')](handleError(_0x2e7574,null));};exports[_0x9b49('0x57')]=function(_0x2fdb02,_0x55c87f){return db[_0x9b49('0x4f')][_0x9b49('0x57')](_0x2fdb02[_0x9b49('0x58')],{})[_0x9b49('0x1f')](respondWithResult(_0x55c87f,0xc9))[_0x9b49('0x51')](handleError(_0x55c87f,null));};exports[_0x9b49('0x34')]=function(_0x33b4f6,_0x12cb05){if(_0x33b4f6[_0x9b49('0x58')]['id']){delete _0x33b4f6[_0x9b49('0x58')]['id'];}return db[_0x9b49('0x4f')][_0x9b49('0x56')]({'where':{'id':_0x33b4f6[_0x9b49('0x53')]['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x12cb05,null))['then'](saveUpdates(_0x33b4f6['body'],null))[_0x9b49('0x1f')](respondWithResult(_0x12cb05,null))['catch'](handleError(_0x12cb05,null));};exports['destroy']=function(_0x5ef3c7,_0x364c58){return db[_0x9b49('0x4f')][_0x9b49('0x56')]({'where':{'id':_0x5ef3c7[_0x9b49('0x53')]['id']}})['then'](handleEntityNotFound(_0x364c58,null))[_0x9b49('0x1f')](removeEntity(_0x364c58,null))[_0x9b49('0x51')](handleError(_0x364c58,null));};exports['getFields']=function(_0x835498,_0x279aa1,_0x273d01){var _0x239109={};var _0x5b689f={};var _0x5b29e1;var _0x1caea0;return db[_0x9b49('0x4f')]['findOne']({'where':{'id':_0x835498[_0x9b49('0x53')]['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x279aa1,null))['then'](function(_0x220347){if(_0x220347){_0x5b29e1=_0x220347;_0x5b689f[_0x9b49('0x3f')]=_[_0x9b49('0x3b')](db['FreshdeskField']['rawAttributes']);_0x5b689f[_0x9b49('0x3c')]=_[_0x9b49('0x3b')](_0x835498['query']);_0x5b689f[_0x9b49('0x3d')]=_[_0x9b49('0x3e')](_0x5b689f[_0x9b49('0x3f')],_0x5b689f[_0x9b49('0x3c')]);_0x239109[_0x9b49('0x40')]=_['intersection'](_0x5b689f[_0x9b49('0x3f')],qs['fields'](_0x835498[_0x9b49('0x3c')]['fields']));_0x239109[_0x9b49('0x40')]=_0x239109[_0x9b49('0x40')][_0x9b49('0x42')]?_0x239109[_0x9b49('0x40')]:_0x5b689f[_0x9b49('0x3f')];_0x239109[_0x9b49('0x45')]=qs[_0x9b49('0x46')](_0x835498['query'][_0x9b49('0x46')]);_0x239109['where']=qs[_0x9b49('0x3d')](_[_0x9b49('0x48')](_0x835498[_0x9b49('0x3c')],_0x5b689f[_0x9b49('0x3d')]));if(_0x835498[_0x9b49('0x3c')]['filter']){_0x239109[_0x9b49('0x47')]=_[_0x9b49('0x4a')](_0x239109[_0x9b49('0x47')],{'$or':_['map'](_0x239109['attributes'],function(_0x407d59){var _0x474791={};_0x474791[_0x407d59]={'$like':'%'+_0x835498[_0x9b49('0x3c')][_0x9b49('0x49')]+'%'};return _0x474791;})});}_0x239109=_[_0x9b49('0x4a')]({},_0x239109,_0x835498['options']);return _0x5b29e1[_0x9b49('0x59')](_0x239109);}})[_0x9b49('0x1f')](function(_0x3b601c){if(_0x3b601c){_0x1caea0=_0x3b601c[_0x9b49('0x42')];if(!_0x835498['query'][_0x9b49('0x43')](_0x9b49('0x44'))){_0x239109['limit']=qs[_0x9b49('0x2f')](_0x835498[_0x9b49('0x3c')]['limit']);_0x239109['offset']=qs['offset'](_0x835498[_0x9b49('0x3c')][_0x9b49('0x2e')]);}return _0x5b29e1['getFields'](_0x239109);}})[_0x9b49('0x1f')](function(_0x1bcfc0){if(_0x1bcfc0){return _0x1bcfc0?{'count':_0x1caea0,'rows':_0x1bcfc0}:null;}})[_0x9b49('0x1f')](respondWithResult(_0x279aa1,null))[_0x9b49('0x51')](handleError(_0x279aa1,null));};exports['getSubjects']=function(_0x42430c,_0x331e22,_0x3430cc){var _0x1e9480={};var _0x91b542={};var _0xef07c9;var _0x252016;return db[_0x9b49('0x4f')][_0x9b49('0x5a')]({'where':{'id':_0x42430c['params']['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x331e22,null))[_0x9b49('0x1f')](function(_0x469f3e){if(_0x469f3e){_0xef07c9=_0x469f3e;_0x91b542[_0x9b49('0x3f')]=_[_0x9b49('0x3b')](db['FreshdeskField']['rawAttributes']);_0x91b542[_0x9b49('0x3c')]=_[_0x9b49('0x3b')](_0x42430c[_0x9b49('0x3c')]);_0x91b542[_0x9b49('0x3d')]=_[_0x9b49('0x3e')](_0x91b542[_0x9b49('0x3f')],_0x91b542[_0x9b49('0x3c')]);_0x1e9480['attributes']=_[_0x9b49('0x3e')](_0x91b542[_0x9b49('0x3f')],qs[_0x9b49('0x41')](_0x42430c[_0x9b49('0x3c')][_0x9b49('0x41')]));_0x1e9480[_0x9b49('0x40')]=_0x1e9480[_0x9b49('0x40')][_0x9b49('0x42')]?_0x1e9480['attributes']:_0x91b542['model'];_0x1e9480['order']=qs['sort'](_0x42430c['query']['sort']);_0x1e9480['where']=qs['filters'](_['pick'](_0x42430c['query'],_0x91b542['filters']));if(_0x42430c[_0x9b49('0x3c')][_0x9b49('0x49')]){_0x1e9480[_0x9b49('0x47')]=_[_0x9b49('0x4a')](_0x1e9480[_0x9b49('0x47')],{'$or':_[_0x9b49('0x4b')](_0x1e9480[_0x9b49('0x40')],function(_0x4add81){var _0x494c10={};_0x494c10[_0x4add81]={'$like':'%'+_0x42430c[_0x9b49('0x3c')]['filter']+'%'};return _0x494c10;})});}_0x1e9480=_['merge']({},_0x1e9480,_0x42430c[_0x9b49('0x55')]);return _0xef07c9[_0x9b49('0x5b')](_0x1e9480);}})[_0x9b49('0x1f')](function(_0xf4d90f){if(_0xf4d90f){_0x252016=_0xf4d90f[_0x9b49('0x42')];if(!_0x42430c[_0x9b49('0x3c')][_0x9b49('0x43')]('nolimit')){_0x1e9480[_0x9b49('0x2f')]=qs[_0x9b49('0x2f')](_0x42430c[_0x9b49('0x3c')]['limit']);_0x1e9480['offset']=qs[_0x9b49('0x2e')](_0x42430c['query'][_0x9b49('0x2e')]);}return _0xef07c9[_0x9b49('0x5b')](_0x1e9480);}})[_0x9b49('0x1f')](function(_0x361d3a){if(_0x361d3a){return _0x361d3a?{'count':_0x252016,'rows':_0x361d3a}:null;}})['then'](respondWithResult(_0x331e22,null))[_0x9b49('0x51')](handleError(_0x331e22,null));};exports[_0x9b49('0x5c')]=function(_0x241e69,_0x21c83d,_0x4b55a0){var _0x5426eb={};var _0x36c91f={};var _0x1f9990;var _0x22a7ca;return db[_0x9b49('0x4f')][_0x9b49('0x5a')]({'where':{'id':_0x241e69['params']['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x21c83d,null))[_0x9b49('0x1f')](function(_0x42e678){if(_0x42e678){_0x1f9990=_0x42e678;_0x36c91f[_0x9b49('0x3f')]=_[_0x9b49('0x3b')](db[_0x9b49('0x5d')][_0x9b49('0x3a')]);_0x36c91f['query']=_[_0x9b49('0x3b')](_0x241e69[_0x9b49('0x3c')]);_0x36c91f['filters']=_[_0x9b49('0x3e')](_0x36c91f[_0x9b49('0x3f')],_0x36c91f[_0x9b49('0x3c')]);_0x5426eb[_0x9b49('0x40')]=_['intersection'](_0x36c91f[_0x9b49('0x3f')],qs[_0x9b49('0x41')](_0x241e69[_0x9b49('0x3c')][_0x9b49('0x41')]));_0x5426eb[_0x9b49('0x40')]=_0x5426eb[_0x9b49('0x40')][_0x9b49('0x42')]?_0x5426eb[_0x9b49('0x40')]:_0x36c91f[_0x9b49('0x3f')];_0x5426eb[_0x9b49('0x45')]=qs['sort'](_0x241e69[_0x9b49('0x3c')][_0x9b49('0x46')]);_0x5426eb[_0x9b49('0x47')]=qs['filters'](_[_0x9b49('0x48')](_0x241e69[_0x9b49('0x3c')],_0x36c91f[_0x9b49('0x3d')]));if(_0x241e69[_0x9b49('0x3c')][_0x9b49('0x49')]){_0x5426eb[_0x9b49('0x47')]=_[_0x9b49('0x4a')](_0x5426eb[_0x9b49('0x47')],{'$or':_[_0x9b49('0x4b')](_0x5426eb['attributes'],function(_0x3009f0){var _0x48f593={};_0x48f593[_0x3009f0]={'$like':'%'+_0x241e69[_0x9b49('0x3c')]['filter']+'%'};return _0x48f593;})});}_0x5426eb=_[_0x9b49('0x4a')]({},_0x5426eb,_0x241e69['options']);return _0x1f9990[_0x9b49('0x5c')](_0x5426eb);}})[_0x9b49('0x1f')](function(_0x5a1b53){if(_0x5a1b53){_0x22a7ca=_0x5a1b53[_0x9b49('0x42')];if(!_0x241e69['query'][_0x9b49('0x43')](_0x9b49('0x44'))){_0x5426eb['limit']=qs[_0x9b49('0x2f')](_0x241e69['query'][_0x9b49('0x2f')]);_0x5426eb['offset']=qs[_0x9b49('0x2e')](_0x241e69['query'][_0x9b49('0x2e')]);}return _0x1f9990[_0x9b49('0x5c')](_0x5426eb);}})[_0x9b49('0x1f')](function(_0x294661){if(_0x294661){return _0x294661?{'count':_0x22a7ca,'rows':_0x294661}:null;}})[_0x9b49('0x1f')](respondWithResult(_0x21c83d,null))['catch'](handleError(_0x21c83d,null));};exports[_0x9b49('0x5e')]=function(_0x3a8908,_0x85d145,_0x22af47){var _0x3b93f8={};var _0xa6a434={};var _0x55386d;var _0x8f36e5;return db['FreshdeskConfiguration'][_0x9b49('0x5a')]({'where':{'id':_0x3a8908[_0x9b49('0x53')]['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x85d145,null))[_0x9b49('0x1f')](function(_0x479bbc){if(_0x479bbc){_0x55386d=_0x479bbc;_0xa6a434[_0x9b49('0x3f')]=_['keys'](db[_0x9b49('0x5f')][_0x9b49('0x3a')]);_0xa6a434[_0x9b49('0x3c')]=_[_0x9b49('0x3b')](_0x3a8908[_0x9b49('0x3c')]);_0xa6a434[_0x9b49('0x3d')]=_[_0x9b49('0x3e')](_0xa6a434['model'],_0xa6a434['query']);_0x3b93f8[_0x9b49('0x40')]=_[_0x9b49('0x3e')](_0xa6a434['model'],qs['fields'](_0x3a8908['query'][_0x9b49('0x41')]));_0x3b93f8[_0x9b49('0x40')]=_0x3b93f8[_0x9b49('0x40')][_0x9b49('0x42')]?_0x3b93f8[_0x9b49('0x40')]:_0xa6a434['model'];_0x3b93f8[_0x9b49('0x45')]=qs[_0x9b49('0x46')](_0x3a8908[_0x9b49('0x3c')][_0x9b49('0x46')]);_0x3b93f8[_0x9b49('0x47')]=qs[_0x9b49('0x3d')](_[_0x9b49('0x48')](_0x3a8908[_0x9b49('0x3c')],_0xa6a434[_0x9b49('0x3d')]));if(_0x3a8908[_0x9b49('0x3c')]['filter']){_0x3b93f8['where']=_[_0x9b49('0x4a')](_0x3b93f8[_0x9b49('0x47')],{'$or':_[_0x9b49('0x4b')](_0x3b93f8[_0x9b49('0x40')],function(_0x37276b){var _0x3ec949={};_0x3ec949[_0x37276b]={'$like':'%'+_0x3a8908[_0x9b49('0x3c')][_0x9b49('0x49')]+'%'};return _0x3ec949;})});}_0x3b93f8=_[_0x9b49('0x4a')]({},_0x3b93f8,_0x3a8908[_0x9b49('0x55')]);return _0x55386d[_0x9b49('0x5e')](_0x3b93f8);}})[_0x9b49('0x1f')](function(_0x3c28f8){if(_0x3c28f8){_0x8f36e5=_0x3c28f8[_0x9b49('0x42')];if(!_0x3a8908[_0x9b49('0x3c')][_0x9b49('0x43')](_0x9b49('0x44'))){_0x3b93f8[_0x9b49('0x2f')]=qs['limit'](_0x3a8908[_0x9b49('0x3c')][_0x9b49('0x2f')]);_0x3b93f8[_0x9b49('0x2e')]=qs['offset'](_0x3a8908[_0x9b49('0x3c')][_0x9b49('0x2e')]);}return _0x55386d[_0x9b49('0x5e')](_0x3b93f8);}})['then'](function(_0x1541d1){if(_0x1541d1){return _0x1541d1?{'count':_0x8f36e5,'rows':_0x1541d1}:null;}})['then'](respondWithResult(_0x85d145,null))[_0x9b49('0x51')](handleError(_0x85d145,null));};exports[_0x9b49('0x60')]=function(_0x50144b,_0x2ef09d,_0x34ac4a){if(_0x50144b[_0x9b49('0x58')]['id']){delete _0x50144b['body']['id'];}return db[_0x9b49('0x4f')][_0x9b49('0x5a')]({'where':{'id':_0x50144b[_0x9b49('0x53')]['id']}})[_0x9b49('0x1f')](handleEntityNotFound(_0x2ef09d,null))[_0x9b49('0x1f')](function(_0xabd1cc){if(_0xabd1cc){return _0xabd1cc[_0x9b49('0x60')](_0x50144b['body']['ids']||[]);}return null;})[_0x9b49('0x1f')](respondWithResult(_0x2ef09d,null))[_0x9b49('0x51')](handleError(_0x2ef09d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1ab4888..3e51e42 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 _0x0a14=['request-promise','path','rimraf','../../config/environment','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0a14,0x103));var _0x40a1=function(_0x14b064,_0x3f1a9c){_0x14b064=_0x14b064-0x0;var _0x1823fe=_0x0a14[_0x14b064];return _0x1823fe;};'use strict';var _=require(_0x40a1('0x0'));var util=require(_0x40a1('0x1'));var logger=require('../../config/logger')(_0x40a1('0x2'));var moment=require(_0x40a1('0x3'));var BPromise=require(_0x40a1('0x4'));var rp=require(_0x40a1('0x5'));var fs=require('fs');var path=require(_0x40a1('0x6'));var rimraf=require(_0x40a1('0x7'));var config=require(_0x40a1('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x40a1('0x9')]=function(_0x144cde,_0x459a18){return _0x144cde['define'](_0x40a1('0xa'),attributes,{'tableName':_0x40a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7647=['request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x18e0d1,_0xbca4cb){var _0x58db41=function(_0x5ccffd){while(--_0x5ccffd){_0x18e0d1['push'](_0x18e0d1['shift']());}};_0x58db41(++_0xbca4cb);}(_0x7647,0x95));var _0x7764=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7647[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7764('0x0'));var util=require(_0x7764('0x1'));var logger=require(_0x7764('0x2'))(_0x7764('0x3'));var moment=require(_0x7764('0x4'));var BPromise=require('bluebird');var rp=require(_0x7764('0x5'));var fs=require('fs');var path=require(_0x7764('0x6'));var rimraf=require(_0x7764('0x7'));var config=require(_0x7764('0x8'));var attributes=require(_0x7764('0x9'));module[_0x7764('0xa')]=function(_0x41ac82,_0x367992){return _0x41ac82[_0x7764('0xb')](_0x7764('0xc'),attributes,{'tableName':_0x7764('0xd'),'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 4623e0e..959c908 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 _0xbea4=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xbea4,0x1e8));var _0x4bea=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbea4[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x4bea('0x0'));var moment=require('moment');var BPromise=require(_0x4bea('0x1'));var rs=require(_0x4bea('0x2'));var fs=require('fs');var Redis=require(_0x4bea('0x3'));var db=require(_0x4bea('0x4'))['db'];var utils=require(_0x4bea('0x5'));var logger=require(_0x4bea('0x6'))(_0x4bea('0x7'));var config=require('../../config/environment');var jayson=require(_0x4bea('0x8'));var client=jayson['client'][_0x4bea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d1c5,_0x399046,_0x1d3c1f){return new BPromise(function(_0x335854,_0x3520b4){return client[_0x4bea('0xa')](_0x20d1c5,_0x1d3c1f)[_0x4bea('0xb')](function(_0x8a3d64){logger[_0x4bea('0xc')](_0x4bea('0xd'),_0x399046,_0x4bea('0xe'));logger[_0x4bea('0xf')](_0x4bea('0x10'),_0x399046,_0x4bea('0xe'),JSON[_0x4bea('0x11')](_0x8a3d64));if(_0x8a3d64[_0x4bea('0x12')]){if(_0x8a3d64[_0x4bea('0x12')]['code']===0x1f4){logger[_0x4bea('0x12')](_0x4bea('0xd'),_0x399046,_0x8a3d64[_0x4bea('0x12')]['message']);return _0x3520b4(_0x8a3d64[_0x4bea('0x12')][_0x4bea('0x13')]);}logger[_0x4bea('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x399046,_0x8a3d64[_0x4bea('0x12')][_0x4bea('0x13')]);return _0x335854(_0x8a3d64[_0x4bea('0x12')][_0x4bea('0x13')]);}else{logger['info'](_0x4bea('0xd'),_0x399046,'request\x20sent');_0x335854(_0x8a3d64['result']['message']);}})[_0x4bea('0x14')](function(_0x3cb5b6){logger[_0x4bea('0x12')](_0x4bea('0xd'),_0x399046,_0x3cb5b6);_0x3520b4(_0x3cb5b6);});});} \ No newline at end of file +var _0x0100=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0100,0x64));var _0x0010=function(_0x4e52ee,_0xced5f5){_0x4e52ee=_0x4e52ee-0x0;var _0x12c428=_0x0100[_0x4e52ee];return _0x12c428;};'use strict';var _=require(_0x0010('0x0'));var util=require(_0x0010('0x1'));var moment=require(_0x0010('0x2'));var BPromise=require(_0x0010('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0010('0x4'));var db=require(_0x0010('0x5'))['db'];var utils=require(_0x0010('0x6'));var logger=require(_0x0010('0x7'))(_0x0010('0x8'));var config=require(_0x0010('0x9'));var jayson=require(_0x0010('0xa'));var client=jayson[_0x0010('0xb')][_0x0010('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d46e,_0x5062b9,_0x5426c0){return new BPromise(function(_0x59fdd8,_0x36af28){return client[_0x0010('0xd')](_0x41d46e,_0x5426c0)[_0x0010('0xe')](function(_0xafa5a0){logger['info'](_0x0010('0xf'),_0x5062b9,'request\x20sent');logger['debug'](_0x0010('0x10'),_0x5062b9,_0x0010('0x11'),JSON[_0x0010('0x12')](_0xafa5a0));if(_0xafa5a0[_0x0010('0x13')]){if(_0xafa5a0['error'][_0x0010('0x14')]===0x1f4){logger[_0x0010('0x13')](_0x0010('0xf'),_0x5062b9,_0xafa5a0[_0x0010('0x13')][_0x0010('0x15')]);return _0x36af28(_0xafa5a0[_0x0010('0x13')][_0x0010('0x15')]);}logger[_0x0010('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5062b9,_0xafa5a0[_0x0010('0x13')][_0x0010('0x15')]);return _0x59fdd8(_0xafa5a0[_0x0010('0x13')]['message']);}else{logger[_0x0010('0x16')](_0x0010('0xf'),_0x5062b9,_0x0010('0x11'));_0x59fdd8(_0xafa5a0[_0x0010('0x17')][_0x0010('0x15')]);}})[_0x0010('0x18')](function(_0x615fb6){logger[_0x0010('0x13')](_0x0010('0xf'),_0x5062b9,_0x615fb6);_0x36af28(_0x615fb6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index fb94c9f..3d90c99 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 _0x6623=['express','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x12bee2,_0x57dbe0){var _0x28e28a=function(_0x9acc6e){while(--_0x9acc6e){_0x12bee2['push'](_0x12bee2['shift']());}};_0x28e28a(++_0x57dbe0);}(_0x6623,0x189));var _0x3662=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x6623[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0x3662('0x0'));var path=require(_0x3662('0x1'));var timeout=require(_0x3662('0x2'));var express=require(_0x3662('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3662('0x4'));var config=require(_0x3662('0x5'));var controller=require(_0x3662('0x6'));router[_0x3662('0x7')]('/',auth[_0x3662('0x8')](),controller[_0x3662('0x9')]);router[_0x3662('0x7')](_0x3662('0xa'),auth[_0x3662('0x8')](),controller['show']);router[_0x3662('0xb')]('/',auth[_0x3662('0x8')](),controller[_0x3662('0xc')]);router[_0x3662('0xd')]('/:id',auth[_0x3662('0x8')](),controller[_0x3662('0xe')]);router[_0x3662('0xf')](_0x3662('0xa'),auth['isAuthenticated'](),controller[_0x3662('0x10')]);module[_0x3662('0x11')]=router; \ No newline at end of file +var _0x9977=['/:id','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x5c7b99,_0x450a6a){var _0x270550=function(_0x3da8fd){while(--_0x3da8fd){_0x5c7b99['push'](_0x5c7b99['shift']());}};_0x270550(++_0x450a6a);}(_0x9977,0x93));var _0x7997=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x9977[_0xc5a279];return _0xc755d3;};'use strict';var multer=require(_0x7997('0x0'));var util=require('util');var path=require(_0x7997('0x1'));var timeout=require(_0x7997('0x2'));var express=require(_0x7997('0x3'));var router=express[_0x7997('0x4')]();var auth=require(_0x7997('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7997('0x6'));var controller=require(_0x7997('0x7'));router[_0x7997('0x8')]('/',auth[_0x7997('0x9')](),controller[_0x7997('0xa')]);router['get']('/:id',auth[_0x7997('0x9')](),controller[_0x7997('0xb')]);router[_0x7997('0xc')]('/',auth[_0x7997('0x9')](),controller['create']);router['put'](_0x7997('0xd'),auth['isAuthenticated'](),controller[_0x7997('0xe')]);router['delete'](_0x7997('0xd'),auth[_0x7997('0x9')](),controller['destroy']);module[_0x7997('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 d66fee5..e103711 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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x54ede6,_0x5d8d2f){var _0x34b581=function(_0x2bcd38){while(--_0x2bcd38){_0x54ede6['push'](_0x54ede6['shift']());}};_0x34b581(++_0x5d8d2f);}(_0x22fb,0x192));var _0xb22f=function(_0x1a21cd,_0x10f68b){_0x1a21cd=_0x1a21cd-0x0;var _0x2f3b17=_0x22fb[_0x1a21cd];return _0x2f3b17;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file +var _0xa74f=['keyValue','string','STRING','BOOLEAN','ENUM','customVariable'];(function(_0x188cca,_0x1192f4){var _0x45eb0d=function(_0x11e57){while(--_0x11e57){_0x188cca['push'](_0x188cca['shift']());}};_0x45eb0d(++_0x1192f4);}(_0xa74f,0x9a));var _0xfa74=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xa74f[_0x19d350];return _0x3bfc8d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'),_0xfa74('0x2')),'defaultValue':_0xfa74('0x3')},'content':{'type':Sequelize[_0xfa74('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'))},'keyContent':{'type':Sequelize[_0xfa74('0x4')]},'idField':{'type':Sequelize[_0xfa74('0x4')]},'nameField':{'type':Sequelize[_0xfa74('0x4')]},'customField':{'type':Sequelize[_0xfa74('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa74('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 3ffee82..d96a8f6 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 _0x2645=['query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','params','catch','create','body','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys'];(function(_0x4218ab,_0xe064f2){var _0xa6a95f=function(_0x5db425){while(--_0x5db425){_0x4218ab['push'](_0x4218ab['shift']());}};_0xa6a95f(++_0xe064f2);}(_0x2645,0xb0));var _0x5264=function(_0x6dcc79,_0x900959){_0x6dcc79=_0x6dcc79-0x0;var _0x31274a=_0x2645[_0x6dcc79];return _0x31274a;};'use strict';var pdf=require(_0x5264('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5264('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5264('0x2'));var rp=require(_0x5264('0x3'));var moment=require(_0x5264('0x4'));var BPromise=require(_0x5264('0x5'));var Mustache=require(_0x5264('0x6'));var util=require(_0x5264('0x7'));var path=require(_0x5264('0x8'));var sox=require(_0x5264('0x9'));var csv=require(_0x5264('0xa'));var ejs=require(_0x5264('0xb'));var fs=require('fs');var _=require(_0x5264('0xc'));var squel=require(_0x5264('0xd'));var crypto=require(_0x5264('0xe'));var jsforce=require(_0x5264('0xf'));var deskjs=require(_0x5264('0x10'));var toCsv=require(_0x5264('0xa'));var querystring=require(_0x5264('0x11'));var Papa=require('papaparse');var Redis=require(_0x5264('0x12'));var authService=require(_0x5264('0x13'));var qs=require(_0x5264('0x14'));var hardwareService=require(_0x5264('0x15'));var logger=require(_0x5264('0x16'))('api');var utils=require(_0x5264('0x17'));var config=require('../../config/environment');var db=require(_0x5264('0x18'))['db'];function respondWithStatusCode(_0x4f47fc,_0x3716bb){_0x3716bb=_0x3716bb||0xcc;return function(_0x1a8172){if(_0x1a8172){return _0x4f47fc[_0x5264('0x19')](_0x3716bb);}return _0x4f47fc['status'](_0x3716bb)[_0x5264('0x1a')]();};}function respondWithResult(_0xd99857,_0x56f92c){_0x56f92c=_0x56f92c||0xc8;return function(_0x483dce){if(_0x483dce){return _0xd99857[_0x5264('0x1b')](_0x56f92c)[_0x5264('0x1c')](_0x483dce);}};}function respondWithFilteredResult(_0x320ff2,_0x29726d){return function(_0x5e4285){if(_0x5e4285){var _0x6356d6=_0x5e4285[_0x5264('0x1d')],_0x5313fc=_0x29726d[_0x5264('0x1e')],_0x52fee1=_0x29726d['offset']+_0x29726d[_0x5264('0x1f')],_0x55b086;if(_0x52fee1>=_0x6356d6){_0x52fee1=_0x6356d6;_0x55b086=0xc8;}else{_0x55b086=0xce;}_0x320ff2[_0x5264('0x1b')](_0x55b086);return _0x320ff2[_0x5264('0x20')](_0x5264('0x21'),_0x5313fc+'-'+_0x52fee1+'/'+_0x6356d6)[_0x5264('0x1c')](_0x5e4285);}return null;};}function patchUpdates(_0x27ff5b){return function(_0x101499){try{jsonpatch[_0x5264('0x22')](_0x101499,_0x27ff5b,!![]);}catch(_0x150efb){return BPromise[_0x5264('0x23')](_0x150efb);}return _0x101499[_0x5264('0x24')]();};}function saveUpdates(_0x222e1f,_0x561979){return function(_0x22226d){if(_0x22226d){return _0x22226d[_0x5264('0x25')](_0x222e1f)['then'](function(_0x2cec5d){return _0x2cec5d;});}return null;};}function removeEntity(_0x4eb9e2,_0x2b5a95){return function(_0x3edd29){if(_0x3edd29){return _0x3edd29[_0x5264('0x26')]()[_0x5264('0x27')](function(){_0x4eb9e2[_0x5264('0x1b')](0xcc)[_0x5264('0x1a')]();});}};}function handleEntityNotFound(_0x3585ff,_0x54b4ae){return function(_0x1fbd9a){if(!_0x1fbd9a){_0x3585ff[_0x5264('0x19')](0x194);}return _0x1fbd9a;};}function handleError(_0x2780c4,_0xdda4b){_0xdda4b=_0xdda4b||0x1f4;return function(_0x3f07d0){logger[_0x5264('0x28')](_0x3f07d0[_0x5264('0x29')]);if(_0x3f07d0[_0x5264('0x2a')]){delete _0x3f07d0['name'];}_0x2780c4[_0x5264('0x1b')](_0xdda4b)[_0x5264('0x2b')](_0x3f07d0);};}exports[_0x5264('0x2c')]=function(_0x1d3874,_0x458457){var _0x2074c8={},_0x1cef70={},_0x3b3517={'count':0x0,'rows':[]};var _0x1ad579=db[_0x5264('0x2d')][_0x5264('0x2e')];_0x1cef70[_0x5264('0x2f')]=_[_0x5264('0x30')](_0x1ad579);_0x1cef70['query']=_[_0x5264('0x30')](_0x1d3874[_0x5264('0x31')]);_0x1cef70[_0x5264('0x32')]=_[_0x5264('0x33')](_0x1cef70['model'],_0x1cef70[_0x5264('0x31')]);_0x2074c8[_0x5264('0x34')]=_[_0x5264('0x33')](_0x1cef70['model'],qs['fields'](_0x1d3874['query'][_0x5264('0x35')]));_0x2074c8[_0x5264('0x34')]=_0x2074c8['attributes'][_0x5264('0x36')]?_0x2074c8[_0x5264('0x34')]:_0x1cef70['model'];if(!_0x1d3874[_0x5264('0x31')][_0x5264('0x37')]('nolimit')){_0x2074c8[_0x5264('0x1f')]=qs['limit'](_0x1d3874['query'][_0x5264('0x1f')]);_0x2074c8[_0x5264('0x1e')]=qs[_0x5264('0x1e')](_0x1d3874['query'][_0x5264('0x1e')]);}_0x2074c8['order']=qs[_0x5264('0x38')](_0x1d3874[_0x5264('0x31')][_0x5264('0x38')]);_0x2074c8[_0x5264('0x39')]=qs['filters'](_[_0x5264('0x3a')](_0x1d3874[_0x5264('0x31')],_0x1cef70[_0x5264('0x32')]));if(_0x1d3874['query']['filter']){_0x2074c8['where']=_[_0x5264('0x3b')](_0x2074c8[_0x5264('0x39')],{'$or':_['map'](_0x1ad579,function(_0x54986a){if(_0x54986a[_0x5264('0x3c')][_0x5264('0x3d')]!==_0x5264('0x3e')){var _0x525804={};_0x525804[_0x54986a[_0x5264('0x3f')]]={'$like':'%'+_0x1d3874['query'][_0x5264('0x40')]+'%'};return _0x525804;}})});}_0x2074c8=_[_0x5264('0x3b')]({},_0x2074c8,_0x1d3874[_0x5264('0x41')]);var _0xf516da={'where':_0x2074c8['where']};return db[_0x5264('0x2d')][_0x5264('0x1d')](_0xf516da)['then'](function(_0x800842){_0x3b3517['count']=_0x800842;if(_0x1d3874[_0x5264('0x31')][_0x5264('0x42')]){_0x2074c8[_0x5264('0x43')]=[{'all':!![]}];}return db[_0x5264('0x2d')][_0x5264('0x44')](_0x2074c8);})['then'](function(_0x48ba62){_0x3b3517[_0x5264('0x45')]=_0x48ba62;return _0x3b3517;})[_0x5264('0x27')](respondWithFilteredResult(_0x458457,_0x2074c8))['catch'](handleError(_0x458457,null));};exports['show']=function(_0x2ad5cd,_0x28f90d){var _0x2eec39={'raw':!![],'where':{'id':_0x2ad5cd[_0x5264('0x46')]['id']}},_0x19e789={};_0x19e789[_0x5264('0x2f')]=_[_0x5264('0x30')](db[_0x5264('0x2d')]['rawAttributes']);_0x19e789[_0x5264('0x31')]=_['keys'](_0x2ad5cd[_0x5264('0x31')]);_0x19e789[_0x5264('0x32')]=_[_0x5264('0x33')](_0x19e789['model'],_0x19e789['query']);_0x2eec39['attributes']=_[_0x5264('0x33')](_0x19e789[_0x5264('0x2f')],qs['fields'](_0x2ad5cd[_0x5264('0x31')][_0x5264('0x35')]));_0x2eec39[_0x5264('0x34')]=_0x2eec39[_0x5264('0x34')][_0x5264('0x36')]?_0x2eec39[_0x5264('0x34')]:_0x19e789[_0x5264('0x2f')];if(_0x2ad5cd['query'][_0x5264('0x42')]){_0x2eec39['include']=[{'all':!![]}];}_0x2eec39=_[_0x5264('0x3b')]({},_0x2eec39,_0x2ad5cd['options']);return db['FreshdeskField']['find'](_0x2eec39)[_0x5264('0x27')](handleEntityNotFound(_0x28f90d,null))[_0x5264('0x27')](respondWithResult(_0x28f90d,null))[_0x5264('0x47')](handleError(_0x28f90d,null));};exports['create']=function(_0x22820e,_0xff4063){return db[_0x5264('0x2d')][_0x5264('0x48')](_0x22820e['body'],{})[_0x5264('0x27')](respondWithResult(_0xff4063,0xc9))[_0x5264('0x47')](handleError(_0xff4063,null));};exports[_0x5264('0x25')]=function(_0x5bafbf,_0x106ab2){if(_0x5bafbf[_0x5264('0x49')]['id']){delete _0x5bafbf['body']['id'];}return db[_0x5264('0x2d')][_0x5264('0x4a')]({'where':{'id':_0x5bafbf[_0x5264('0x46')]['id']}})['then'](handleEntityNotFound(_0x106ab2,null))['then'](saveUpdates(_0x5bafbf['body'],null))[_0x5264('0x27')](respondWithResult(_0x106ab2,null))[_0x5264('0x47')](handleError(_0x106ab2,null));};exports[_0x5264('0x26')]=function(_0x5259a5,_0x1f9602){return db['FreshdeskField'][_0x5264('0x4a')]({'where':{'id':_0x5259a5[_0x5264('0x46')]['id']}})[_0x5264('0x27')](handleEntityNotFound(_0x1f9602,null))[_0x5264('0x27')](removeEntity(_0x1f9602,null))[_0x5264('0x47')](handleError(_0x1f9602,null));}; \ No newline at end of file +var _0x568f=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','then','stack','name','send','index','rawAttributes','model','keys'];(function(_0x2c2ebc,_0x3e2242){var _0x1ef817=function(_0x2f5b72){while(--_0x2f5b72){_0x2c2ebc['push'](_0x2c2ebc['shift']());}};_0x1ef817(++_0x3e2242);}(_0x568f,0xf7));var _0xf568=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x568f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf568('0x0'));var emlformat=require(_0xf568('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf568('0x2'));var rp=require(_0xf568('0x3'));var moment=require(_0xf568('0x4'));var BPromise=require(_0xf568('0x5'));var Mustache=require('mustache');var util=require(_0xf568('0x6'));var path=require(_0xf568('0x7'));var sox=require('sox');var csv=require(_0xf568('0x8'));var ejs=require(_0xf568('0x9'));var fs=require('fs');var _=require(_0xf568('0xa'));var squel=require(_0xf568('0xb'));var crypto=require(_0xf568('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf568('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf568('0xe'));var Papa=require(_0xf568('0xf'));var Redis=require(_0xf568('0x10'));var authService=require(_0xf568('0x11'));var qs=require(_0xf568('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf568('0x13'))(_0xf568('0x14'));var utils=require('../../config/utils');var config=require(_0xf568('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33665c,_0x30f703){_0x30f703=_0x30f703||0xcc;return function(_0x48deaa){if(_0x48deaa){return _0x33665c[_0xf568('0x16')](_0x30f703);}return _0x33665c[_0xf568('0x17')](_0x30f703)[_0xf568('0x18')]();};}function respondWithResult(_0x311c82,_0x438b21){_0x438b21=_0x438b21||0xc8;return function(_0x341c9b){if(_0x341c9b){return _0x311c82['status'](_0x438b21)[_0xf568('0x19')](_0x341c9b);}};}function respondWithFilteredResult(_0x54222b,_0x99ee00){return function(_0x1fba8c){if(_0x1fba8c){var _0x5a2a67=_0x1fba8c[_0xf568('0x1a')],_0x363582=_0x99ee00[_0xf568('0x1b')],_0x13bfe4=_0x99ee00[_0xf568('0x1b')]+_0x99ee00[_0xf568('0x1c')],_0xcadfe;if(_0x13bfe4>=_0x5a2a67){_0x13bfe4=_0x5a2a67;_0xcadfe=0xc8;}else{_0xcadfe=0xce;}_0x54222b['status'](_0xcadfe);return _0x54222b['set'](_0xf568('0x1d'),_0x363582+'-'+_0x13bfe4+'/'+_0x5a2a67)[_0xf568('0x19')](_0x1fba8c);}return null;};}function patchUpdates(_0x2f3c24){return function(_0x35b09d){try{jsonpatch[_0xf568('0x1e')](_0x35b09d,_0x2f3c24,!![]);}catch(_0x4e0d0f){return BPromise['reject'](_0x4e0d0f);}return _0x35b09d[_0xf568('0x1f')]();};}function saveUpdates(_0x2da0e1,_0x3249ed){return function(_0x246c74){if(_0x246c74){return _0x246c74['update'](_0x2da0e1)['then'](function(_0x572dba){return _0x572dba;});}return null;};}function removeEntity(_0x253fe9,_0x30374c){return function(_0x5cdd79){if(_0x5cdd79){return _0x5cdd79[_0xf568('0x20')]()[_0xf568('0x21')](function(){_0x253fe9[_0xf568('0x17')](0xcc)[_0xf568('0x18')]();});}};}function handleEntityNotFound(_0x249143,_0x43a38f){return function(_0x4633ad){if(!_0x4633ad){_0x249143['sendStatus'](0x194);}return _0x4633ad;};}function handleError(_0x5b3924,_0x59801d){_0x59801d=_0x59801d||0x1f4;return function(_0x4f70ad){logger['error'](_0x4f70ad[_0xf568('0x22')]);if(_0x4f70ad[_0xf568('0x23')]){delete _0x4f70ad[_0xf568('0x23')];}_0x5b3924['status'](_0x59801d)[_0xf568('0x24')](_0x4f70ad);};}exports[_0xf568('0x25')]=function(_0x2c1232,_0x4e43bd){var _0x1e81a8={},_0x52869b={},_0x46f1a0={'count':0x0,'rows':[]};var _0x259675=db['FreshdeskField'][_0xf568('0x26')];_0x52869b[_0xf568('0x27')]=_[_0xf568('0x28')](_0x259675);_0x52869b[_0xf568('0x29')]=_[_0xf568('0x28')](_0x2c1232[_0xf568('0x29')]);_0x52869b[_0xf568('0x2a')]=_[_0xf568('0x2b')](_0x52869b[_0xf568('0x27')],_0x52869b[_0xf568('0x29')]);_0x1e81a8['attributes']=_[_0xf568('0x2b')](_0x52869b['model'],qs[_0xf568('0x2c')](_0x2c1232[_0xf568('0x29')][_0xf568('0x2c')]));_0x1e81a8['attributes']=_0x1e81a8[_0xf568('0x2d')][_0xf568('0x2e')]?_0x1e81a8['attributes']:_0x52869b[_0xf568('0x27')];if(!_0x2c1232['query'][_0xf568('0x2f')](_0xf568('0x30'))){_0x1e81a8['limit']=qs[_0xf568('0x1c')](_0x2c1232[_0xf568('0x29')][_0xf568('0x1c')]);_0x1e81a8[_0xf568('0x1b')]=qs[_0xf568('0x1b')](_0x2c1232[_0xf568('0x29')]['offset']);}_0x1e81a8[_0xf568('0x31')]=qs[_0xf568('0x32')](_0x2c1232['query'][_0xf568('0x32')]);_0x1e81a8[_0xf568('0x33')]=qs['filters'](_[_0xf568('0x34')](_0x2c1232['query'],_0x52869b['filters']));if(_0x2c1232[_0xf568('0x29')][_0xf568('0x35')]){_0x1e81a8[_0xf568('0x33')]=_[_0xf568('0x36')](_0x1e81a8['where'],{'$or':_[_0xf568('0x37')](_0x259675,function(_0x48b738){if(_0x48b738[_0xf568('0x38')][_0xf568('0x39')]!==_0xf568('0x3a')){var _0x2bfb2b={};_0x2bfb2b[_0x48b738['field']]={'$like':'%'+_0x2c1232[_0xf568('0x29')]['filter']+'%'};return _0x2bfb2b;}})});}_0x1e81a8=_[_0xf568('0x36')]({},_0x1e81a8,_0x2c1232[_0xf568('0x3b')]);var _0xbdcff5={'where':_0x1e81a8[_0xf568('0x33')]};return db[_0xf568('0x3c')][_0xf568('0x1a')](_0xbdcff5)['then'](function(_0x5aad20){_0x46f1a0[_0xf568('0x1a')]=_0x5aad20;if(_0x2c1232[_0xf568('0x29')][_0xf568('0x3d')]){_0x1e81a8[_0xf568('0x3e')]=[{'all':!![]}];}return db[_0xf568('0x3c')][_0xf568('0x3f')](_0x1e81a8);})['then'](function(_0x31fb5f){_0x46f1a0[_0xf568('0x40')]=_0x31fb5f;return _0x46f1a0;})[_0xf568('0x21')](respondWithFilteredResult(_0x4e43bd,_0x1e81a8))[_0xf568('0x41')](handleError(_0x4e43bd,null));};exports[_0xf568('0x42')]=function(_0x135162,_0x388dc7){var _0x4d0891={'raw':!![],'where':{'id':_0x135162[_0xf568('0x43')]['id']}},_0x151505={};_0x151505[_0xf568('0x27')]=_[_0xf568('0x28')](db[_0xf568('0x3c')][_0xf568('0x26')]);_0x151505[_0xf568('0x29')]=_[_0xf568('0x28')](_0x135162[_0xf568('0x29')]);_0x151505[_0xf568('0x2a')]=_[_0xf568('0x2b')](_0x151505['model'],_0x151505['query']);_0x4d0891['attributes']=_[_0xf568('0x2b')](_0x151505[_0xf568('0x27')],qs[_0xf568('0x2c')](_0x135162[_0xf568('0x29')][_0xf568('0x2c')]));_0x4d0891[_0xf568('0x2d')]=_0x4d0891[_0xf568('0x2d')][_0xf568('0x2e')]?_0x4d0891[_0xf568('0x2d')]:_0x151505[_0xf568('0x27')];if(_0x135162[_0xf568('0x29')][_0xf568('0x3d')]){_0x4d0891[_0xf568('0x3e')]=[{'all':!![]}];}_0x4d0891=_['merge']({},_0x4d0891,_0x135162[_0xf568('0x3b')]);return db[_0xf568('0x3c')][_0xf568('0x44')](_0x4d0891)[_0xf568('0x21')](handleEntityNotFound(_0x388dc7,null))['then'](respondWithResult(_0x388dc7,null))['catch'](handleError(_0x388dc7,null));};exports[_0xf568('0x45')]=function(_0xf50dd1,_0x1656a8){return db[_0xf568('0x3c')][_0xf568('0x45')](_0xf50dd1[_0xf568('0x46')],{})[_0xf568('0x21')](respondWithResult(_0x1656a8,0xc9))[_0xf568('0x41')](handleError(_0x1656a8,null));};exports[_0xf568('0x47')]=function(_0x2ba3f8,_0x41e2f0){if(_0x2ba3f8[_0xf568('0x46')]['id']){delete _0x2ba3f8[_0xf568('0x46')]['id'];}return db['FreshdeskField'][_0xf568('0x44')]({'where':{'id':_0x2ba3f8[_0xf568('0x43')]['id']}})[_0xf568('0x21')](handleEntityNotFound(_0x41e2f0,null))[_0xf568('0x21')](saveUpdates(_0x2ba3f8[_0xf568('0x46')],null))[_0xf568('0x21')](respondWithResult(_0x41e2f0,null))[_0xf568('0x41')](handleError(_0x41e2f0,null));};exports[_0xf568('0x20')]=function(_0x2965ee,_0x4ab6cd){return db['FreshdeskField'][_0xf568('0x44')]({'where':{'id':_0x2965ee['params']['id']}})[_0xf568('0x21')](handleEntityNotFound(_0x4ab6cd,null))[_0xf568('0x21')](removeEntity(_0x4ab6cd,null))[_0xf568('0x41')](handleError(_0x4ab6cd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 74333ef..9ea98c1 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 _0xd2c2=['int_freshdesk_fields','freshdesk_unique_index','idField','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField'];(function(_0xfd7f57,_0x22bde5){var _0x46639b=function(_0x1ea48a){while(--_0x1ea48a){_0xfd7f57['push'](_0xfd7f57['shift']());}};_0x46639b(++_0x22bde5);}(_0xd2c2,0x1a3));var _0x2d2c=function(_0x13873f,_0x2f94e8){_0x13873f=_0x13873f-0x0;var _0x391441=_0xd2c2[_0x13873f];return _0x391441;};'use strict';var _=require('lodash');var util=require(_0x2d2c('0x0'));var logger=require(_0x2d2c('0x1'))(_0x2d2c('0x2'));var moment=require(_0x2d2c('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d2c('0x4'));var fs=require('fs');var path=require(_0x2d2c('0x5'));var rimraf=require(_0x2d2c('0x6'));var config=require(_0x2d2c('0x7'));var attributes=require(_0x2d2c('0x8'));module['exports']=function(_0x317d8b,_0x546761){return _0x317d8b['define'](_0x2d2c('0x9'),attributes,{'tableName':_0x2d2c('0xa'),'paranoid':![],'indexes':[{'name':_0x2d2c('0xb'),'fields':[_0x2d2c('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x145c=['freshdesk_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields'];(function(_0x11432d,_0x1ec326){var _0x5ade0f=function(_0x48cc88){while(--_0x48cc88){_0x11432d['push'](_0x11432d['shift']());}};_0x5ade0f(++_0x1ec326);}(_0x145c,0x148));var _0xc145=function(_0x38eca4,_0x2913b9){_0x38eca4=_0x38eca4-0x0;var _0x381376=_0x145c[_0x38eca4];return _0x381376;};'use strict';var _=require(_0xc145('0x0'));var util=require(_0xc145('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc145('0x2'));var rp=require(_0xc145('0x3'));var fs=require('fs');var path=require(_0xc145('0x4'));var rimraf=require(_0xc145('0x5'));var config=require('../../config/environment');var attributes=require(_0xc145('0x6'));module['exports']=function(_0x1c3811,_0x2fce02){return _0x1c3811[_0xc145('0x7')](_0xc145('0x8'),attributes,{'tableName':_0xc145('0x9'),'paranoid':![],'indexes':[{'name':_0xc145('0xa'),'fields':[_0xc145('0xb'),_0xc145('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 b1d3f38..4006659 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 _0xe0c3=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x150598,_0x127623){var _0x439f43=function(_0x4fc459){while(--_0x4fc459){_0x150598['push'](_0x150598['shift']());}};_0x439f43(++_0x127623);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var moment=require(_0x3e0c('0x1'));var BPromise=require(_0x3e0c('0x2'));var rs=require(_0x3e0c('0x3'));var fs=require('fs');var Redis=require(_0x3e0c('0x4'));var db=require(_0x3e0c('0x5'))['db'];var utils=require(_0x3e0c('0x6'));var logger=require(_0x3e0c('0x7'))(_0x3e0c('0x8'));var config=require(_0x3e0c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e339a,_0x3f6607,_0x243b5b){return new BPromise(function(_0x29673d,_0x2d2c39){return client[_0x3e0c('0xb')](_0x1e339a,_0x243b5b)[_0x3e0c('0xc')](function(_0x13ac88){logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,'request\x20sent');logger['debug'](_0x3e0c('0xf'),_0x3f6607,_0x3e0c('0x10'),JSON[_0x3e0c('0x11')](_0x13ac88));if(_0x13ac88[_0x3e0c('0x12')]){if(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x13')]===0x1f4){logger[_0x3e0c('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x3f6607,_0x13ac88[_0x3e0c('0x12')]['message']);return _0x2d2c39(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}logger['error'](_0x3e0c('0xe'),_0x3f6607,_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);return _0x29673d(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}else{logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,_0x3e0c('0x10'));_0x29673d(_0x13ac88[_0x3e0c('0x15')][_0x3e0c('0x14')]);}})[_0x3e0c('0x16')](function(_0x1f8e71){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3f6607,_0x1f8e71);_0x2d2c39(_0x1f8e71);});});} \ No newline at end of file +var _0xaba6=['../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaba6,0xe2));var _0x6aba=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0xaba6[_0x491faa];return _0x414440;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('FreshdeskField,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e1d04c8..1195b23 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 _0x85f5=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x85f5,0xfe));var _0x585f=function(_0x3d1807,_0x4fabc2){_0x3d1807=_0x3d1807-0x0;var _0x2b15c0=_0x85f5[_0x3d1807];return _0x2b15c0;};'use strict';var multer=require(_0x585f('0x0'));var util=require('util');var path=require(_0x585f('0x1'));var timeout=require(_0x585f('0x2'));var express=require(_0x585f('0x3'));var router=express[_0x585f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x585f('0x5'));var config=require(_0x585f('0x6'));var controller=require(_0x585f('0x7'));router[_0x585f('0x8')]('/',auth[_0x585f('0x9')](),controller['index']);router[_0x585f('0x8')](_0x585f('0xa'),auth['isAuthenticated'](),controller[_0x585f('0xb')]);router[_0x585f('0x8')](_0x585f('0xc'),auth['isAuthenticated'](),controller[_0x585f('0xd')]);router[_0x585f('0x8')](_0x585f('0xe'),auth[_0x585f('0x9')](),controller[_0x585f('0xf')]);router[_0x585f('0x10')]('/',auth[_0x585f('0x9')](),controller[_0x585f('0x11')]);router['post']('/:id/configurations',auth[_0x585f('0x9')](),controller[_0x585f('0x12')]);router[_0x585f('0x13')](_0x585f('0xa'),auth[_0x585f('0x9')](),controller[_0x585f('0x14')]);router[_0x585f('0x15')]('/:id',auth[_0x585f('0x9')](),controller[_0x585f('0x16')]);module[_0x585f('0x17')]=router; \ No newline at end of file +var _0x9849=['addConfiguration','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x9849,0x140));var _0x9984=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x9849[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var path=require(_0x9984('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9984('0x3')]();var auth=require(_0x9984('0x4'));var interaction=require(_0x9984('0x5'));var config=require(_0x9984('0x6'));var controller=require(_0x9984('0x7'));router[_0x9984('0x8')]('/',auth[_0x9984('0x9')](),controller['index']);router['get'](_0x9984('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0x9984('0x9')](),controller[_0x9984('0xb')]);router[_0x9984('0x8')](_0x9984('0xc'),auth[_0x9984('0x9')](),controller[_0x9984('0xd')]);router[_0x9984('0xe')]('/',auth[_0x9984('0x9')](),controller[_0x9984('0xf')]);router['post']('/:id/configurations',auth[_0x9984('0x9')](),controller[_0x9984('0x10')]);router[_0x9984('0x11')]('/:id',auth[_0x9984('0x9')](),controller[_0x9984('0x12')]);router['delete'](_0x9984('0xa'),auth['isAuthenticated'](),controller[_0x9984('0x13')]);module[_0x9984('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e94a0d0..4ba1cf2 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 _0xeca4=['newTab','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xeca4,0xe6));var _0x4eca=function(_0x1ef687,_0xbe5151){_0x1ef687=_0x1ef687-0x0;var _0x6c9200=_0xeca4[_0x1ef687];return _0x6c9200;};'use strict';var Sequelize=require(_0x4eca('0x0'));module[_0x4eca('0x1')]={'name':{'type':Sequelize[_0x4eca('0x2')]},'description':{'type':Sequelize[_0x4eca('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4eca('0x2')]},'password':{'type':Sequelize[_0x4eca('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x4eca('0x2')]},'serverUrl':{'type':Sequelize[_0x4eca('0x2')]},'type':{'type':Sequelize[_0x4eca('0x3')]('integrationTab',_0x4eca('0x4')),'defaultValue':_0x4eca('0x5')}}; \ No newline at end of file +var _0x7dcc=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5885a4,_0x464904){var _0x4c9200=function(_0x487c7d){while(--_0x487c7d){_0x5885a4['push'](_0x5885a4['shift']());}};_0x4c9200(++_0x464904);}(_0x7dcc,0x8a));var _0xc7dc=function(_0x3f52a1,_0x1aaa20){_0x3f52a1=_0x3f52a1-0x0;var _0xf98fb7=_0x7dcc[_0x3f52a1];return _0xf98fb7;};'use strict';var Sequelize=require(_0xc7dc('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7dc('0x1')]},'description':{'type':Sequelize[_0xc7dc('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xc7dc('0x2')},'remoteUri':{'type':Sequelize[_0xc7dc('0x1')]},'password':{'type':Sequelize[_0xc7dc('0x1')]},'clientId':{'type':Sequelize[_0xc7dc('0x1')]},'clientSecret':{'type':Sequelize[_0xc7dc('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc7dc('0x3')](_0xc7dc('0x4'),_0xc7dc('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 73d701d..3fb5d92 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 _0x2fde=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','name','send','SalesforceAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','order','where','pick','filter','map','type','key','VIRTUAL','field','options','count','findAll','rows','catch','show','params','fields','includeAll','include','merge','create','body','find','findOne','sort','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','concat','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallObject','Priority','Case','Type','Origin','Reason','Status','IsEscalated','SuppliedName','custom','includes','picklistValues','label','value','boolean','True','true','false','test','statusCode'];(function(_0x1ce9aa,_0x5ef2e2){var _0x32147a=function(_0x57b568){while(--_0x57b568){_0x1ce9aa['push'](_0x1ce9aa['shift']());}};_0x32147a(++_0x5ef2e2);}(_0x2fde,0x18e));var _0xe2fd=function(_0x4177fd,_0x57a907){_0x4177fd=_0x4177fd-0x0;var _0x56749a=_0x2fde[_0x4177fd];return _0x56749a;};'use strict';var pdf=require(_0xe2fd('0x0'));var emlformat=require(_0xe2fd('0x1'));var rimraf=require(_0xe2fd('0x2'));var zipdir=require(_0xe2fd('0x3'));var jsonpatch=require(_0xe2fd('0x4'));var rp=require(_0xe2fd('0x5'));var moment=require(_0xe2fd('0x6'));var BPromise=require(_0xe2fd('0x7'));var Mustache=require(_0xe2fd('0x8'));var util=require(_0xe2fd('0x9'));var path=require(_0xe2fd('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe2fd('0xb'));var squel=require(_0xe2fd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe2fd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe2fd('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2fd('0xf'));var qs=require(_0xe2fd('0x10'));var hardwareService=require(_0xe2fd('0x11'));var logger=require('../../config/logger')(_0xe2fd('0x12'));var utils=require(_0xe2fd('0x13'));var config=require(_0xe2fd('0x14'));var db=require(_0xe2fd('0x15'))['db'];var integrations=require(_0xe2fd('0x16'));var jayson=require(_0xe2fd('0x17'));var client=jayson[_0xe2fd('0x18')][_0xe2fd('0x19')]({'port':0x232a});function checkPasswordPattern(_0xa0e616,_0x9d62c0,_0x151918){if(_0x151918){var _0x4d7350=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d7350['test'](_0x9d62c0)){return _0xa0e616;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xa0e616;}}function respondWithRpcPromise(_0x3e0376,_0x461ae2,_0x359f1e,_0x185eff){return new BPromise(function(_0x23ee9a,_0x103b90){var _0x48dc4b=_0x185eff||client;return _0x48dc4b[_0xe2fd('0x1a')](_0x3e0376,_0x359f1e)[_0xe2fd('0x1b')](function(_0x2211ce){logger['info'](_0xe2fd('0x1c'),_0x461ae2,_0xe2fd('0x1d'));logger[_0xe2fd('0x1e')](_0xe2fd('0x1f'),_0x461ae2,'request\x20sent',JSON[_0xe2fd('0x20')](_0x2211ce));if(_0x2211ce[_0xe2fd('0x21')]){if(_0x2211ce[_0xe2fd('0x21')][_0xe2fd('0x22')]===0x1f4){logger[_0xe2fd('0x21')](_0xe2fd('0x1c'),_0x461ae2,_0x2211ce['error'][_0xe2fd('0x23')]);return _0x103b90(_0x2211ce[_0xe2fd('0x21')][_0xe2fd('0x23')]);}logger[_0xe2fd('0x21')](_0xe2fd('0x1c'),_0x461ae2,_0x2211ce[_0xe2fd('0x21')][_0xe2fd('0x23')]);return _0x23ee9a(_0x2211ce[_0xe2fd('0x21')][_0xe2fd('0x23')]);}else{logger[_0xe2fd('0x24')](_0xe2fd('0x1c'),_0x461ae2,_0xe2fd('0x1d'));_0x23ee9a(_0x2211ce[_0xe2fd('0x25')][_0xe2fd('0x23')]);}})['catch'](function(_0x31b548){logger[_0xe2fd('0x21')](_0xe2fd('0x1c'),_0x461ae2,_0x31b548);_0x103b90(_0x31b548);});});}function respondWithStatusCode(_0x3d54e2,_0x494656){_0x494656=_0x494656||0xcc;return function(_0x4f6287){if(_0x4f6287){return _0x3d54e2[_0xe2fd('0x26')](_0x494656);}return _0x3d54e2[_0xe2fd('0x27')](_0x494656)[_0xe2fd('0x28')]();};}function respondWithResult(_0xfcf4d6,_0x34fa0d){_0x34fa0d=_0x34fa0d||0xc8;return function(_0x4e2227){if(_0x4e2227){return _0xfcf4d6['status'](_0x34fa0d)[_0xe2fd('0x29')](_0x4e2227);}};}function respondWithFilteredResult(_0x4532e5,_0x5cc851){return function(_0xd5c0f3){if(_0xd5c0f3){var _0x1771b7=_0xd5c0f3['count'],_0x199cc5=_0x5cc851[_0xe2fd('0x2a')],_0x3c9710=_0x5cc851[_0xe2fd('0x2a')]+_0x5cc851[_0xe2fd('0x2b')],_0x1f9bbe;if(_0x3c9710>=_0x1771b7){_0x3c9710=_0x1771b7;_0x1f9bbe=0xc8;}else{_0x1f9bbe=0xce;}_0x4532e5[_0xe2fd('0x27')](_0x1f9bbe);return _0x4532e5['set'](_0xe2fd('0x2c'),_0x199cc5+'-'+_0x3c9710+'/'+_0x1771b7)[_0xe2fd('0x29')](_0xd5c0f3);}return null;};}function patchUpdates(_0x96b714){return function(_0x114b39){try{jsonpatch[_0xe2fd('0x2d')](_0x114b39,_0x96b714,!![]);}catch(_0x2ac679){return BPromise['reject'](_0x2ac679);}return _0x114b39[_0xe2fd('0x2e')]();};}function saveUpdates(_0x93ae48,_0x39d24c){return function(_0x31141a){if(_0x31141a){return _0x31141a[_0xe2fd('0x2f')](_0x93ae48)[_0xe2fd('0x1b')](function(_0x337414){return _0x337414;});}return null;};}function removeEntity(_0x37e762,_0x51efdd){return function(_0x42e8ea){if(_0x42e8ea){return _0x42e8ea[_0xe2fd('0x30')]()[_0xe2fd('0x1b')](function(){_0x37e762[_0xe2fd('0x27')](0xcc)[_0xe2fd('0x28')]();});}};}function handleEntityNotFound(_0x5e26cb,_0x40fa24){return function(_0x59d30d){if(!_0x59d30d){_0x5e26cb[_0xe2fd('0x26')](0x194);}return _0x59d30d;};}function handleError(_0x4bb921,_0x12f626){_0x12f626=_0x12f626||0x1f4;return function(_0x366787){logger[_0xe2fd('0x21')](_0x366787['stack']);if(_0x366787[_0xe2fd('0x31')]){delete _0x366787['name'];}_0x4bb921[_0xe2fd('0x27')](_0x12f626)[_0xe2fd('0x32')](_0x366787);};}exports['index']=function(_0x50a74e,_0x4f1790){var _0x4cd3df={},_0x406941={},_0x1d5ecd={'count':0x0,'rows':[]};var _0x3fa945=db[_0xe2fd('0x33')][_0xe2fd('0x34')];_0x406941[_0xe2fd('0x35')]=_[_0xe2fd('0x36')](_0x3fa945);_0x406941['query']=_['keys'](_0x50a74e[_0xe2fd('0x37')]);_0x406941[_0xe2fd('0x38')]=_[_0xe2fd('0x39')](_0x406941[_0xe2fd('0x35')],_0x406941['query']);_0x4cd3df[_0xe2fd('0x3a')]=_[_0xe2fd('0x39')](_0x406941['model'],qs['fields'](_0x50a74e['query']['fields']));_0x4cd3df[_0xe2fd('0x3a')]=_0x4cd3df[_0xe2fd('0x3a')][_0xe2fd('0x3b')]?_0x4cd3df[_0xe2fd('0x3a')]:_0x406941[_0xe2fd('0x35')];if(!_0x50a74e[_0xe2fd('0x37')]['hasOwnProperty'](_0xe2fd('0x3c'))){_0x4cd3df[_0xe2fd('0x2b')]=qs[_0xe2fd('0x2b')](_0x50a74e[_0xe2fd('0x37')][_0xe2fd('0x2b')]);_0x4cd3df[_0xe2fd('0x2a')]=qs[_0xe2fd('0x2a')](_0x50a74e[_0xe2fd('0x37')][_0xe2fd('0x2a')]);}_0x4cd3df[_0xe2fd('0x3d')]=qs['sort'](_0x50a74e[_0xe2fd('0x37')]['sort']);_0x4cd3df[_0xe2fd('0x3e')]=qs[_0xe2fd('0x38')](_[_0xe2fd('0x3f')](_0x50a74e[_0xe2fd('0x37')],_0x406941[_0xe2fd('0x38')]));if(_0x50a74e['query'][_0xe2fd('0x40')]){_0x4cd3df['where']=_['merge'](_0x4cd3df[_0xe2fd('0x3e')],{'$or':_[_0xe2fd('0x41')](_0x3fa945,function(_0x48f3f6){if(_0x48f3f6[_0xe2fd('0x42')][_0xe2fd('0x43')]!==_0xe2fd('0x44')){var _0x29c021={};_0x29c021[_0x48f3f6[_0xe2fd('0x45')]]={'$like':'%'+_0x50a74e[_0xe2fd('0x37')][_0xe2fd('0x40')]+'%'};return _0x29c021;}})});}_0x4cd3df=_['merge']({},_0x4cd3df,_0x50a74e[_0xe2fd('0x46')]);var _0x939323={'where':_0x4cd3df[_0xe2fd('0x3e')]};return db['SalesforceAccount'][_0xe2fd('0x47')](_0x939323)[_0xe2fd('0x1b')](function(_0x305aac){_0x1d5ecd['count']=_0x305aac;if(_0x50a74e['query']['includeAll']){_0x4cd3df['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0xe2fd('0x48')](_0x4cd3df);})[_0xe2fd('0x1b')](function(_0x452abe){_0x1d5ecd[_0xe2fd('0x49')]=_0x452abe;return _0x1d5ecd;})['then'](respondWithFilteredResult(_0x4f1790,_0x4cd3df))[_0xe2fd('0x4a')](handleError(_0x4f1790,null));};exports[_0xe2fd('0x4b')]=function(_0x2b0ea4,_0x5a44df){var _0x532b11={'raw':![],'where':{'id':_0x2b0ea4[_0xe2fd('0x4c')]['id']}},_0x1ee1cb={};_0x1ee1cb[_0xe2fd('0x35')]=_[_0xe2fd('0x36')](db['SalesforceAccount'][_0xe2fd('0x34')]);_0x1ee1cb[_0xe2fd('0x37')]=_['keys'](_0x2b0ea4[_0xe2fd('0x37')]);_0x1ee1cb['filters']=_['intersection'](_0x1ee1cb[_0xe2fd('0x35')],_0x1ee1cb[_0xe2fd('0x37')]);_0x532b11['attributes']=_['intersection'](_0x1ee1cb[_0xe2fd('0x35')],qs['fields'](_0x2b0ea4[_0xe2fd('0x37')][_0xe2fd('0x4d')]));_0x532b11['attributes']=_0x532b11['attributes'][_0xe2fd('0x3b')]?_0x532b11['attributes']:_0x1ee1cb[_0xe2fd('0x35')];if(_0x2b0ea4['query'][_0xe2fd('0x4e')]){_0x532b11[_0xe2fd('0x4f')]=[{'all':!![]}];}_0x532b11=_[_0xe2fd('0x50')]({},_0x532b11,_0x2b0ea4[_0xe2fd('0x46')]);return db[_0xe2fd('0x33')]['find'](_0x532b11)['then'](handleEntityNotFound(_0x5a44df,null))[_0xe2fd('0x1b')](respondWithResult(_0x5a44df,null))[_0xe2fd('0x4a')](handleError(_0x5a44df,null));};exports[_0xe2fd('0x51')]=function(_0x12c503,_0x1fe6bf){return db[_0xe2fd('0x33')][_0xe2fd('0x51')](_0x12c503[_0xe2fd('0x52')],{})[_0xe2fd('0x1b')](respondWithResult(_0x1fe6bf,0xc9))['catch'](handleError(_0x1fe6bf,null));};exports[_0xe2fd('0x2f')]=function(_0x44c4e1,_0x2f20f5){if(_0x44c4e1[_0xe2fd('0x52')]['id']){delete _0x44c4e1[_0xe2fd('0x52')]['id'];}return db[_0xe2fd('0x33')][_0xe2fd('0x53')]({'where':{'id':_0x44c4e1['params']['id']}})[_0xe2fd('0x1b')](handleEntityNotFound(_0x2f20f5,null))[_0xe2fd('0x1b')](saveUpdates(_0x44c4e1[_0xe2fd('0x52')],null))[_0xe2fd('0x1b')](respondWithResult(_0x2f20f5,null))[_0xe2fd('0x4a')](handleError(_0x2f20f5,null));};exports['destroy']=function(_0x29677b,_0x5b6d17){return db[_0xe2fd('0x33')][_0xe2fd('0x53')]({'where':{'id':_0x29677b['params']['id']}})[_0xe2fd('0x1b')](handleEntityNotFound(_0x5b6d17,null))[_0xe2fd('0x1b')](removeEntity(_0x5b6d17,null))[_0xe2fd('0x4a')](handleError(_0x5b6d17,null));};exports['getConfigurations']=function(_0x374b68,_0x5e7b28,_0x167cc9){var _0x90122b={};var _0x535e3c={};var _0x4a90b3;var _0x4a4986;return db[_0xe2fd('0x33')][_0xe2fd('0x54')]({'where':{'id':_0x374b68[_0xe2fd('0x4c')]['id']}})[_0xe2fd('0x1b')](handleEntityNotFound(_0x5e7b28,null))[_0xe2fd('0x1b')](function(_0x17f63a){if(_0x17f63a){_0x4a90b3=_0x17f63a;_0x535e3c[_0xe2fd('0x35')]=_[_0xe2fd('0x36')](db['SalesforceConfiguration'][_0xe2fd('0x34')]);_0x535e3c[_0xe2fd('0x37')]=_[_0xe2fd('0x36')](_0x374b68['query']);_0x535e3c[_0xe2fd('0x38')]=_[_0xe2fd('0x39')](_0x535e3c[_0xe2fd('0x35')],_0x535e3c['query']);_0x90122b[_0xe2fd('0x3a')]=_[_0xe2fd('0x39')](_0x535e3c[_0xe2fd('0x35')],qs[_0xe2fd('0x4d')](_0x374b68['query'][_0xe2fd('0x4d')]));_0x90122b[_0xe2fd('0x3a')]=_0x90122b[_0xe2fd('0x3a')][_0xe2fd('0x3b')]?_0x90122b[_0xe2fd('0x3a')]:_0x535e3c[_0xe2fd('0x35')];_0x90122b['order']=qs[_0xe2fd('0x55')](_0x374b68[_0xe2fd('0x37')][_0xe2fd('0x55')]);_0x90122b[_0xe2fd('0x3e')]=qs[_0xe2fd('0x38')](_[_0xe2fd('0x3f')](_0x374b68[_0xe2fd('0x37')],_0x535e3c[_0xe2fd('0x38')]));if(_0x374b68[_0xe2fd('0x37')][_0xe2fd('0x40')]){_0x90122b[_0xe2fd('0x3e')]=_['merge'](_0x90122b[_0xe2fd('0x3e')],{'$or':_[_0xe2fd('0x41')](_0x90122b[_0xe2fd('0x3a')],function(_0x174d10){var _0x330eec={};_0x330eec[_0x174d10]={'$like':'%'+_0x374b68[_0xe2fd('0x37')][_0xe2fd('0x40')]+'%'};return _0x330eec;})});}_0x90122b=_[_0xe2fd('0x50')]({},_0x90122b,_0x374b68[_0xe2fd('0x46')]);return _0x4a90b3['getConfigurations'](_0x90122b);}})['then'](function(_0x275096){if(_0x275096){_0x4a4986=_0x275096[_0xe2fd('0x3b')];if(!_0x374b68[_0xe2fd('0x37')]['hasOwnProperty'](_0xe2fd('0x3c'))){_0x90122b[_0xe2fd('0x2b')]=qs['limit'](_0x374b68['query'][_0xe2fd('0x2b')]);_0x90122b[_0xe2fd('0x2a')]=qs['offset'](_0x374b68[_0xe2fd('0x37')][_0xe2fd('0x2a')]);}return _0x4a90b3['getConfigurations'](_0x90122b);}})[_0xe2fd('0x1b')](function(_0x15a39f){if(_0x15a39f){return _0x15a39f?{'count':_0x4a4986,'rows':_0x15a39f}:null;}})[_0xe2fd('0x1b')](respondWithResult(_0x5e7b28,null))['catch'](handleError(_0x5e7b28,null));};exports[_0xe2fd('0x56')]=function(_0x50bbee,_0x538472,_0x176121){if(_0x50bbee['body']['id']){delete _0x50bbee[_0xe2fd('0x52')]['id'];}return db[_0xe2fd('0x33')][_0xe2fd('0x54')]({'where':{'id':_0x50bbee[_0xe2fd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x538472,null))[_0xe2fd('0x1b')](function(_0x5b5d13){if(_0x5b5d13){_0x50bbee[_0xe2fd('0x52')][_0xe2fd('0x57')]=_0x5b5d13['id'];_0x50bbee[_0xe2fd('0x52')][_0xe2fd('0x58')]=integrations[_0xe2fd('0x59')](_0x50bbee[_0xe2fd('0x52')]['channel'],_0x50bbee[_0xe2fd('0x52')][_0xe2fd('0x42')]);_0x50bbee[_0xe2fd('0x52')]['Descriptions']=integrations[_0xe2fd('0x5a')](_0x50bbee[_0xe2fd('0x52')]['channel'],_0x50bbee[_0xe2fd('0x52')][_0xe2fd('0x42')]);return db[_0xe2fd('0x5b')]['create'](_0x50bbee[_0xe2fd('0x52')],{'include':[{'model':db[_0xe2fd('0x5c')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xe2fd('0x5d')}]});}return null;})[_0xe2fd('0x1b')](respondWithResult(_0x538472,null))[_0xe2fd('0x4a')](handleError(_0x538472,null));};exports[_0xe2fd('0x5e')]=function(_0x3e3739,_0x576abb,_0x4d3437){var _0x56e9ed;var _0x3dbfb9='';var _0x4657eb=_0xe2fd('0x5f');return db[_0xe2fd('0x33')][_0xe2fd('0x54')]({'where':{'id':_0x3e3739[_0xe2fd('0x4c')]['id']},'attributes':['id','remoteUri',_0xe2fd('0x60'),_0xe2fd('0x61'),_0xe2fd('0x62'),_0xe2fd('0x63'),_0xe2fd('0x64')]})[_0xe2fd('0x1b')](handleEntityNotFound(_0x576abb,null))[_0xe2fd('0x1b')](function(_0x48cbff){if(_0x48cbff){_0x3dbfb9=_0x48cbff[_0xe2fd('0x65')];var _0x8645b3=_0x3dbfb9[_0xe2fd('0x66')](-0x1);if(_0x8645b3==='/'){_0x3dbfb9=_0x3dbfb9['substring'](0x0,_0x3dbfb9[_0xe2fd('0x67')](_0x8645b3));}_0x56e9ed=new jsforce[(_0xe2fd('0x68'))]({'oauth2':{'loginUrl':_0x3dbfb9,'clientId':_0x48cbff[_0xe2fd('0x60')],'clientSecret':_0x48cbff[_0xe2fd('0x61')]}});return _0x56e9ed['login'](_0x48cbff[_0xe2fd('0x62')],_0x48cbff[_0xe2fd('0x63')][_0xe2fd('0x69')](_0x48cbff['securityToken']));}})['then'](function(_0x265de1){if(_0x265de1){if(!_[_0xe2fd('0x6a')](_0x3e3739['query'][_0xe2fd('0x6b')])){_0x4657eb=_0x3e3739['query'][_0xe2fd('0x6b')];}return _0x56e9ed['sobject'](_0x4657eb)['describe']();}})['then'](function(_0x238393){var _0x44cf1b=[_0xe2fd('0x6c'),_0xe2fd('0x6d'),_0xe2fd('0x6e'),'CallType','IsArchived',_0xe2fd('0x6f'),'Status','Type'];if(!_[_0xe2fd('0x6a')](_0x3e3739[_0xe2fd('0x37')][_0xe2fd('0x6b')])&&_0x3e3739['query'][_0xe2fd('0x6b')]===_0xe2fd('0x70')){_0x44cf1b=[_0xe2fd('0x71'),_0xe2fd('0x72'),_0xe2fd('0x73'),_0xe2fd('0x74'),_0xe2fd('0x6f'),_0xe2fd('0x75'),_0xe2fd('0x76'),'SuppliedCompany'];}if(_0x238393){_['remove'](_0x238393[_0xe2fd('0x4d')],function(_0x30ca5e){return _0x30ca5e[_0xe2fd('0x77')]===![]&&!_0x44cf1b[_0xe2fd('0x78')](_0x30ca5e[_0xe2fd('0x31')]);});return{'count':_0x238393['fields']['length'],'rows':_[_0xe2fd('0x41')](_0x238393[_0xe2fd('0x4d')],function(_0x515a08){return{'id':_0x515a08[_0xe2fd('0x31')],'name':_0x515a08['label'],'custom':_0x515a08['custom'],'options':_0x515a08[_0xe2fd('0x79')][_0xe2fd('0x3b')]>0x0?_[_0xe2fd('0x41')](_0x515a08[_0xe2fd('0x79')],function(_0xc91fdd){return{'name':_0xc91fdd[_0xe2fd('0x7a')],'value':_0xc91fdd[_0xe2fd('0x7b')]};}):_0x515a08[_0xe2fd('0x42')]==_0xe2fd('0x7c')?[{'name':_0xe2fd('0x7d'),'value':_0xe2fd('0x7e')},{'name':'False','value':_0xe2fd('0x7f')}]:[]};})};}})['then'](respondWithResult(_0x576abb,null))[_0xe2fd('0x4a')](function(_0x56ef40){var _0x46b701=_0x3e3739[_0xe2fd('0x37')][_0xe2fd('0x80')]?0x1f4:_0x56ef40[_0xe2fd('0x81')]||0x1f4;logger['error'](_0xe2fd('0x82'),_0xe2fd('0x5e'),_0x46b701,JSON['stringify'](_0x56ef40));delete _0x56ef40[_0xe2fd('0x31')];if(_0x46b701===0x191){_0x46b701=0x190;}_0x576abb[_0xe2fd('0x27')](_0x46b701)['send'](_0x3e3739[_0xe2fd('0x37')][_0xe2fd('0x80')]?{'message':_0xe2fd('0x83'),'statusCode':_0x56ef40[_0xe2fd('0x81')]}:_0x56ef40);});}; \ No newline at end of file +var _0xd9fc=['filter','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','securityToken','substring','lastIndexOf','login','password','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallObject','Priority','Case','Origin','Reason','Status','IsEscalated','SuppliedName','SuppliedCompany','custom','includes','label','picklistValues','boolean','True','False','false','statusCode','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','set','reject','save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key'];(function(_0x28006e,_0xe7108f){var _0x34dc6e=function(_0x4bccb3){while(--_0x4bccb3){_0x28006e['push'](_0x28006e['shift']());}};_0x34dc6e(++_0xe7108f);}(_0xd9fc,0x1a5));var _0xcd9f=function(_0x2566f7,_0x3435bf){_0x2566f7=_0x2566f7-0x0;var _0x4b26b3=_0xd9fc[_0x2566f7];return _0x4b26b3;};'use strict';var pdf=require(_0xcd9f('0x0'));var emlformat=require(_0xcd9f('0x1'));var rimraf=require(_0xcd9f('0x2'));var zipdir=require(_0xcd9f('0x3'));var jsonpatch=require(_0xcd9f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcd9f('0x5'));var Mustache=require('mustache');var util=require(_0xcd9f('0x6'));var path=require(_0xcd9f('0x7'));var sox=require(_0xcd9f('0x8'));var csv=require(_0xcd9f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcd9f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcd9f('0xb'));var toCsv=require(_0xcd9f('0x9'));var querystring=require(_0xcd9f('0xc'));var Papa=require(_0xcd9f('0xd'));var Redis=require(_0xcd9f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcd9f('0xf'));var logger=require(_0xcd9f('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xcd9f('0x11'));var client=jayson[_0xcd9f('0x12')][_0xcd9f('0x13')]({'port':0x232a});function checkPasswordPattern(_0xc59887,_0x63869c,_0x2c8939){if(_0x2c8939){var _0x1192a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1192a[_0xcd9f('0x14')](_0x63869c)){return _0xc59887;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xc59887;}}function respondWithRpcPromise(_0x29d877,_0xa1da61,_0x57c773,_0x54328d){return new BPromise(function(_0xf0a6a9,_0x39b45d){var _0x2b271c=_0x54328d||client;return _0x2b271c[_0xcd9f('0x15')](_0x29d877,_0x57c773)[_0xcd9f('0x16')](function(_0x4f30d){logger[_0xcd9f('0x17')](_0xcd9f('0x18'),_0xa1da61,_0xcd9f('0x19'));logger[_0xcd9f('0x1a')](_0xcd9f('0x1b'),_0xa1da61,'request\x20sent',JSON['stringify'](_0x4f30d));if(_0x4f30d[_0xcd9f('0x1c')]){if(_0x4f30d[_0xcd9f('0x1c')][_0xcd9f('0x1d')]===0x1f4){logger[_0xcd9f('0x1c')](_0xcd9f('0x18'),_0xa1da61,_0x4f30d['error']['message']);return _0x39b45d(_0x4f30d[_0xcd9f('0x1c')]['message']);}logger['error'](_0xcd9f('0x18'),_0xa1da61,_0x4f30d[_0xcd9f('0x1c')]['message']);return _0xf0a6a9(_0x4f30d[_0xcd9f('0x1c')][_0xcd9f('0x1e')]);}else{logger[_0xcd9f('0x17')](_0xcd9f('0x18'),_0xa1da61,_0xcd9f('0x19'));_0xf0a6a9(_0x4f30d[_0xcd9f('0x1f')]['message']);}})['catch'](function(_0x22c729){logger[_0xcd9f('0x1c')](_0xcd9f('0x18'),_0xa1da61,_0x22c729);_0x39b45d(_0x22c729);});});}function respondWithStatusCode(_0x39e7b9,_0x1870d2){_0x1870d2=_0x1870d2||0xcc;return function(_0x5a5118){if(_0x5a5118){return _0x39e7b9[_0xcd9f('0x20')](_0x1870d2);}return _0x39e7b9[_0xcd9f('0x21')](_0x1870d2)[_0xcd9f('0x22')]();};}function respondWithResult(_0x2cd95c,_0x4f36db){_0x4f36db=_0x4f36db||0xc8;return function(_0x5bd975){if(_0x5bd975){return _0x2cd95c[_0xcd9f('0x21')](_0x4f36db)[_0xcd9f('0x23')](_0x5bd975);}};}function respondWithFilteredResult(_0x34f0cb,_0x260c49){return function(_0x2c45e9){if(_0x2c45e9){var _0x5dc8a7=_0x2c45e9[_0xcd9f('0x24')],_0x2d7f05=_0x260c49[_0xcd9f('0x25')],_0x57b3b2=_0x260c49['offset']+_0x260c49['limit'],_0x24eca7;if(_0x57b3b2>=_0x5dc8a7){_0x57b3b2=_0x5dc8a7;_0x24eca7=0xc8;}else{_0x24eca7=0xce;}_0x34f0cb[_0xcd9f('0x21')](_0x24eca7);return _0x34f0cb[_0xcd9f('0x26')]('Content-Range',_0x2d7f05+'-'+_0x57b3b2+'/'+_0x5dc8a7)[_0xcd9f('0x23')](_0x2c45e9);}return null;};}function patchUpdates(_0x5f585a){return function(_0x8bca12){try{jsonpatch['apply'](_0x8bca12,_0x5f585a,!![]);}catch(_0xbe670c){return BPromise[_0xcd9f('0x27')](_0xbe670c);}return _0x8bca12[_0xcd9f('0x28')]();};}function saveUpdates(_0xf9b696,_0x346b31){return function(_0x346739){if(_0x346739){return _0x346739[_0xcd9f('0x29')](_0xf9b696)[_0xcd9f('0x16')](function(_0x15cfe6){return _0x15cfe6;});}return null;};}function removeEntity(_0x4ae278,_0x404247){return function(_0x5e7da2){if(_0x5e7da2){return _0x5e7da2[_0xcd9f('0x2a')]()['then'](function(){_0x4ae278['status'](0xcc)[_0xcd9f('0x22')]();});}};}function handleEntityNotFound(_0x3cd67d,_0x28d0a1){return function(_0x2acb3b){if(!_0x2acb3b){_0x3cd67d[_0xcd9f('0x20')](0x194);}return _0x2acb3b;};}function handleError(_0x5253b3,_0x357c1d){_0x357c1d=_0x357c1d||0x1f4;return function(_0x548c34){logger[_0xcd9f('0x1c')](_0x548c34[_0xcd9f('0x2b')]);if(_0x548c34[_0xcd9f('0x2c')]){delete _0x548c34[_0xcd9f('0x2c')];}_0x5253b3[_0xcd9f('0x21')](_0x357c1d)[_0xcd9f('0x2d')](_0x548c34);};}exports[_0xcd9f('0x2e')]=function(_0x2dc44f,_0x49f6bc){var _0x5df974={},_0x404aa8={},_0x567fa4={'count':0x0,'rows':[]};var _0xc6c976=db[_0xcd9f('0x2f')][_0xcd9f('0x30')];_0x404aa8['model']=_[_0xcd9f('0x31')](_0xc6c976);_0x404aa8[_0xcd9f('0x32')]=_['keys'](_0x2dc44f[_0xcd9f('0x32')]);_0x404aa8[_0xcd9f('0x33')]=_[_0xcd9f('0x34')](_0x404aa8[_0xcd9f('0x35')],_0x404aa8['query']);_0x5df974[_0xcd9f('0x36')]=_[_0xcd9f('0x34')](_0x404aa8[_0xcd9f('0x35')],qs[_0xcd9f('0x37')](_0x2dc44f[_0xcd9f('0x32')][_0xcd9f('0x37')]));_0x5df974[_0xcd9f('0x36')]=_0x5df974['attributes']['length']?_0x5df974[_0xcd9f('0x36')]:_0x404aa8[_0xcd9f('0x35')];if(!_0x2dc44f[_0xcd9f('0x32')][_0xcd9f('0x38')](_0xcd9f('0x39'))){_0x5df974[_0xcd9f('0x3a')]=qs[_0xcd9f('0x3a')](_0x2dc44f['query'][_0xcd9f('0x3a')]);_0x5df974[_0xcd9f('0x25')]=qs['offset'](_0x2dc44f[_0xcd9f('0x32')]['offset']);}_0x5df974[_0xcd9f('0x3b')]=qs[_0xcd9f('0x3c')](_0x2dc44f['query'][_0xcd9f('0x3c')]);_0x5df974[_0xcd9f('0x3d')]=qs['filters'](_[_0xcd9f('0x3e')](_0x2dc44f[_0xcd9f('0x32')],_0x404aa8['filters']));if(_0x2dc44f[_0xcd9f('0x32')]['filter']){_0x5df974[_0xcd9f('0x3d')]=_[_0xcd9f('0x3f')](_0x5df974[_0xcd9f('0x3d')],{'$or':_[_0xcd9f('0x40')](_0xc6c976,function(_0x4570e3){if(_0x4570e3[_0xcd9f('0x41')][_0xcd9f('0x42')]!=='VIRTUAL'){var _0x1cec94={};_0x1cec94[_0x4570e3['field']]={'$like':'%'+_0x2dc44f[_0xcd9f('0x32')][_0xcd9f('0x43')]+'%'};return _0x1cec94;}})});}_0x5df974=_[_0xcd9f('0x3f')]({},_0x5df974,_0x2dc44f['options']);var _0x198721={'where':_0x5df974['where']};return db[_0xcd9f('0x2f')][_0xcd9f('0x24')](_0x198721)[_0xcd9f('0x16')](function(_0x3fed23){_0x567fa4[_0xcd9f('0x24')]=_0x3fed23;if(_0x2dc44f[_0xcd9f('0x32')][_0xcd9f('0x44')]){_0x5df974[_0xcd9f('0x45')]=[{'all':!![]}];}return db[_0xcd9f('0x2f')][_0xcd9f('0x46')](_0x5df974);})['then'](function(_0x249b0c){_0x567fa4[_0xcd9f('0x47')]=_0x249b0c;return _0x567fa4;})[_0xcd9f('0x16')](respondWithFilteredResult(_0x49f6bc,_0x5df974))[_0xcd9f('0x48')](handleError(_0x49f6bc,null));};exports[_0xcd9f('0x49')]=function(_0x5e4f73,_0x31416f){var _0x5d49ef={'raw':![],'where':{'id':_0x5e4f73['params']['id']}},_0x432a3d={};_0x432a3d[_0xcd9f('0x35')]=_[_0xcd9f('0x31')](db[_0xcd9f('0x2f')][_0xcd9f('0x30')]);_0x432a3d[_0xcd9f('0x32')]=_[_0xcd9f('0x31')](_0x5e4f73['query']);_0x432a3d['filters']=_[_0xcd9f('0x34')](_0x432a3d[_0xcd9f('0x35')],_0x432a3d['query']);_0x5d49ef[_0xcd9f('0x36')]=_[_0xcd9f('0x34')](_0x432a3d[_0xcd9f('0x35')],qs[_0xcd9f('0x37')](_0x5e4f73[_0xcd9f('0x32')][_0xcd9f('0x37')]));_0x5d49ef[_0xcd9f('0x36')]=_0x5d49ef['attributes'][_0xcd9f('0x4a')]?_0x5d49ef['attributes']:_0x432a3d[_0xcd9f('0x35')];if(_0x5e4f73[_0xcd9f('0x32')][_0xcd9f('0x44')]){_0x5d49ef['include']=[{'all':!![]}];}_0x5d49ef=_['merge']({},_0x5d49ef,_0x5e4f73['options']);return db[_0xcd9f('0x2f')][_0xcd9f('0x4b')](_0x5d49ef)[_0xcd9f('0x16')](handleEntityNotFound(_0x31416f,null))['then'](respondWithResult(_0x31416f,null))[_0xcd9f('0x48')](handleError(_0x31416f,null));};exports[_0xcd9f('0x4c')]=function(_0x2835b0,_0x20951d){return db[_0xcd9f('0x2f')][_0xcd9f('0x4c')](_0x2835b0[_0xcd9f('0x4d')],{})[_0xcd9f('0x16')](respondWithResult(_0x20951d,0xc9))['catch'](handleError(_0x20951d,null));};exports[_0xcd9f('0x29')]=function(_0x5a126d,_0x453f06){if(_0x5a126d[_0xcd9f('0x4d')]['id']){delete _0x5a126d[_0xcd9f('0x4d')]['id'];}return db[_0xcd9f('0x2f')][_0xcd9f('0x4b')]({'where':{'id':_0x5a126d['params']['id']}})['then'](handleEntityNotFound(_0x453f06,null))[_0xcd9f('0x16')](saveUpdates(_0x5a126d[_0xcd9f('0x4d')],null))[_0xcd9f('0x16')](respondWithResult(_0x453f06,null))[_0xcd9f('0x48')](handleError(_0x453f06,null));};exports[_0xcd9f('0x2a')]=function(_0x241587,_0x574ddd){return db[_0xcd9f('0x2f')][_0xcd9f('0x4b')]({'where':{'id':_0x241587[_0xcd9f('0x4e')]['id']}})[_0xcd9f('0x16')](handleEntityNotFound(_0x574ddd,null))[_0xcd9f('0x16')](removeEntity(_0x574ddd,null))[_0xcd9f('0x48')](handleError(_0x574ddd,null));};exports[_0xcd9f('0x4f')]=function(_0x9f885e,_0x535600,_0x133cab){var _0x591691={};var _0x20af74={};var _0x3f300f;var _0x2e82d6;return db[_0xcd9f('0x2f')][_0xcd9f('0x50')]({'where':{'id':_0x9f885e['params']['id']}})['then'](handleEntityNotFound(_0x535600,null))['then'](function(_0x1fec17){if(_0x1fec17){_0x3f300f=_0x1fec17;_0x20af74[_0xcd9f('0x35')]=_[_0xcd9f('0x31')](db['SalesforceConfiguration']['rawAttributes']);_0x20af74[_0xcd9f('0x32')]=_[_0xcd9f('0x31')](_0x9f885e[_0xcd9f('0x32')]);_0x20af74[_0xcd9f('0x33')]=_['intersection'](_0x20af74[_0xcd9f('0x35')],_0x20af74[_0xcd9f('0x32')]);_0x591691['attributes']=_[_0xcd9f('0x34')](_0x20af74[_0xcd9f('0x35')],qs[_0xcd9f('0x37')](_0x9f885e[_0xcd9f('0x32')][_0xcd9f('0x37')]));_0x591691['attributes']=_0x591691[_0xcd9f('0x36')][_0xcd9f('0x4a')]?_0x591691[_0xcd9f('0x36')]:_0x20af74['model'];_0x591691['order']=qs['sort'](_0x9f885e[_0xcd9f('0x32')][_0xcd9f('0x3c')]);_0x591691[_0xcd9f('0x3d')]=qs[_0xcd9f('0x33')](_['pick'](_0x9f885e[_0xcd9f('0x32')],_0x20af74['filters']));if(_0x9f885e[_0xcd9f('0x32')][_0xcd9f('0x43')]){_0x591691[_0xcd9f('0x3d')]=_['merge'](_0x591691[_0xcd9f('0x3d')],{'$or':_[_0xcd9f('0x40')](_0x591691[_0xcd9f('0x36')],function(_0x45ba12){var _0x4f57a5={};_0x4f57a5[_0x45ba12]={'$like':'%'+_0x9f885e['query'][_0xcd9f('0x43')]+'%'};return _0x4f57a5;})});}_0x591691=_[_0xcd9f('0x3f')]({},_0x591691,_0x9f885e['options']);return _0x3f300f['getConfigurations'](_0x591691);}})[_0xcd9f('0x16')](function(_0xbeac40){if(_0xbeac40){_0x2e82d6=_0xbeac40['length'];if(!_0x9f885e['query'][_0xcd9f('0x38')](_0xcd9f('0x39'))){_0x591691[_0xcd9f('0x3a')]=qs[_0xcd9f('0x3a')](_0x9f885e['query'][_0xcd9f('0x3a')]);_0x591691[_0xcd9f('0x25')]=qs[_0xcd9f('0x25')](_0x9f885e[_0xcd9f('0x32')][_0xcd9f('0x25')]);}return _0x3f300f[_0xcd9f('0x4f')](_0x591691);}})[_0xcd9f('0x16')](function(_0x2e2c9e){if(_0x2e2c9e){return _0x2e2c9e?{'count':_0x2e82d6,'rows':_0x2e2c9e}:null;}})[_0xcd9f('0x16')](respondWithResult(_0x535600,null))[_0xcd9f('0x48')](handleError(_0x535600,null));};exports[_0xcd9f('0x51')]=function(_0x308e39,_0x1c6a16,_0x30d3d3){if(_0x308e39[_0xcd9f('0x4d')]['id']){delete _0x308e39[_0xcd9f('0x4d')]['id'];}return db[_0xcd9f('0x2f')]['findOne']({'where':{'id':_0x308e39['params']['id']}})[_0xcd9f('0x16')](handleEntityNotFound(_0x1c6a16,null))[_0xcd9f('0x16')](function(_0x5d3c7f){if(_0x5d3c7f){_0x308e39[_0xcd9f('0x4d')][_0xcd9f('0x52')]=_0x5d3c7f['id'];_0x308e39['body'][_0xcd9f('0x53')]=integrations['getSubjects'](_0x308e39[_0xcd9f('0x4d')][_0xcd9f('0x54')],_0x308e39[_0xcd9f('0x4d')][_0xcd9f('0x41')]);_0x308e39[_0xcd9f('0x4d')][_0xcd9f('0x55')]=integrations[_0xcd9f('0x56')](_0x308e39['body']['channel'],_0x308e39[_0xcd9f('0x4d')][_0xcd9f('0x41')]);return db[_0xcd9f('0x57')]['create'](_0x308e39[_0xcd9f('0x4d')],{'include':[{'model':db[_0xcd9f('0x58')],'as':_0xcd9f('0x53')},{'model':db[_0xcd9f('0x58')],'as':_0xcd9f('0x55')}]});}return null;})[_0xcd9f('0x16')](respondWithResult(_0x1c6a16,null))[_0xcd9f('0x48')](handleError(_0x1c6a16,null));};exports[_0xcd9f('0x59')]=function(_0xd11a64,_0x4baf43,_0x358573){var _0x16ecdd;var _0xc4af93='';var _0x319c68='Task';return db[_0xcd9f('0x2f')][_0xcd9f('0x50')]({'where':{'id':_0xd11a64['params']['id']},'attributes':['id',_0xcd9f('0x5a'),_0xcd9f('0x5b'),_0xcd9f('0x5c'),_0xcd9f('0x5d'),'password',_0xcd9f('0x5e')]})[_0xcd9f('0x16')](handleEntityNotFound(_0x4baf43,null))['then'](function(_0x16c0b5){if(_0x16c0b5){_0xc4af93=_0x16c0b5[_0xcd9f('0x5a')];var _0x1209d8=_0xc4af93['slice'](-0x1);if(_0x1209d8==='/'){_0xc4af93=_0xc4af93[_0xcd9f('0x5f')](0x0,_0xc4af93[_0xcd9f('0x60')](_0x1209d8));}_0x16ecdd=new jsforce['Connection']({'oauth2':{'loginUrl':_0xc4af93,'clientId':_0x16c0b5['clientId'],'clientSecret':_0x16c0b5[_0xcd9f('0x5c')]}});return _0x16ecdd[_0xcd9f('0x61')](_0x16c0b5[_0xcd9f('0x5d')],_0x16c0b5[_0xcd9f('0x62')]['concat'](_0x16c0b5[_0xcd9f('0x5e')]));}})[_0xcd9f('0x16')](function(_0x3478f2){if(_0x3478f2){if(!_[_0xcd9f('0x63')](_0xd11a64[_0xcd9f('0x32')][_0xcd9f('0x64')])){_0x319c68=_0xd11a64['query'][_0xcd9f('0x64')];}return _0x16ecdd['sobject'](_0x319c68)['describe']();}})['then'](function(_0x150a01){var _0x52b700=[_0xcd9f('0x65'),_0xcd9f('0x66'),_0xcd9f('0x67'),'CallType','IsArchived',_0xcd9f('0x68'),'Status','Type'];if(!_['isNil'](_0xd11a64[_0xcd9f('0x32')]['ticketType'])&&_0xd11a64[_0xcd9f('0x32')]['ticketType']===_0xcd9f('0x69')){_0x52b700=['Type',_0xcd9f('0x6a'),_0xcd9f('0x6b'),_0xcd9f('0x6c'),_0xcd9f('0x68'),_0xcd9f('0x6d'),_0xcd9f('0x6e'),_0xcd9f('0x6f')];}if(_0x150a01){_['remove'](_0x150a01['fields'],function(_0x45dc7b){return _0x45dc7b[_0xcd9f('0x70')]===![]&&!_0x52b700[_0xcd9f('0x71')](_0x45dc7b[_0xcd9f('0x2c')]);});return{'count':_0x150a01[_0xcd9f('0x37')][_0xcd9f('0x4a')],'rows':_[_0xcd9f('0x40')](_0x150a01[_0xcd9f('0x37')],function(_0x32d854){return{'id':_0x32d854['name'],'name':_0x32d854[_0xcd9f('0x72')],'custom':_0x32d854['custom'],'options':_0x32d854['picklistValues']['length']>0x0?_[_0xcd9f('0x40')](_0x32d854[_0xcd9f('0x73')],function(_0x408c25){return{'name':_0x408c25['label'],'value':_0x408c25['value']};}):_0x32d854[_0xcd9f('0x41')]==_0xcd9f('0x74')?[{'name':_0xcd9f('0x75'),'value':'true'},{'name':_0xcd9f('0x76'),'value':_0xcd9f('0x77')}]:[]};})};}})['then'](respondWithResult(_0x4baf43,null))[_0xcd9f('0x48')](function(_0x114a6d){var _0x36cb2e=_0xd11a64[_0xcd9f('0x32')][_0xcd9f('0x14')]?0x1f4:_0x114a6d[_0xcd9f('0x78')]||0x1f4;logger[_0xcd9f('0x1c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x36cb2e,JSON[_0xcd9f('0x79')](_0x114a6d));delete _0x114a6d['name'];if(_0x36cb2e===0x191){_0x36cb2e=0x190;}_0x4baf43[_0xcd9f('0x21')](_0x36cb2e)['send'](_0xd11a64['query'][_0xcd9f('0x14')]?{'message':'Wrong\x20credentials','statusCode':_0x114a6d['statusCode']}:_0x114a6d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6975f54..535b6f4 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 _0x49f8=['./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','api','moment','request-promise','rimraf'];(function(_0x2730b4,_0x5ec873){var _0x5dc4e6=function(_0x1b0c44){while(--_0x1b0c44){_0x2730b4['push'](_0x2730b4['shift']());}};_0x5dc4e6(++_0x5ec873);}(_0x49f8,0xff));var _0x849f=function(_0x2eebbc,_0x54d860){_0x2eebbc=_0x2eebbc-0x0;var _0x213fef=_0x49f8[_0x2eebbc];return _0x213fef;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x849f('0x1'));var moment=require(_0x849f('0x2'));var BPromise=require('bluebird');var rp=require(_0x849f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x849f('0x4'));var config=require('../../config/environment');var attributes=require(_0x849f('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x849f('0x6')]=function(_0x30ebab,_0x21f577){return _0x30ebab[_0x849f('0x7')](_0x849f('0x8'),attributes,{'tableName':_0x849f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ffd=['int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4ab81e,_0x541d7b){_0x4ab81e=_0x4ab81e-0x0;var _0x4e3da6=_0x9ffd[_0x4ab81e];return _0x4e3da6;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd9ff('0x9')]=function(_0x2982c3,_0x13ea8c){return _0x2982c3[_0xd9ff('0xa')](_0xd9ff('0xb'),attributes,{'tableName':_0xd9ff('0xc'),'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 8144091..759dc26 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 _0xc93d=['request\x20sent','debug','error','code','message','info','catch','GetSalesforceAccount','findAll','options','raw','where','limit','model','attributes','map','include','ShowSalesforceAccount','SalesforceAccount','find','then','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','SalesforceAccount,\x20%s,\x20%s'];(function(_0x216e50,_0x4003fa){var _0xeb730e=function(_0x343a78){while(--_0x343a78){_0x216e50['push'](_0x216e50['shift']());}};_0xeb730e(++_0x4003fa);}(_0xc93d,0x115));var _0xdc93=function(_0xeb0035,_0x2c3d9a){_0xeb0035=_0xeb0035-0x0;var _0x190e57=_0xc93d[_0xeb0035];return _0x190e57;};'use strict';var _=require(_0xdc93('0x0'));var util=require(_0xdc93('0x1'));var moment=require(_0xdc93('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc93('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc93('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc93('0x5'))(_0xdc93('0x6'));var config=require(_0xdc93('0x7'));var jayson=require(_0xdc93('0x8'));var client=jayson[_0xdc93('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29afd6,_0x4032ad,_0x2beedb){return new BPromise(function(_0x48d08b,_0x4c1f2e){return client['request'](_0x29afd6,_0x2beedb)['then'](function(_0x1f1eb2){logger['info'](_0xdc93('0xa'),_0x4032ad,_0xdc93('0xb'));logger[_0xdc93('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4032ad,_0xdc93('0xb'),JSON['stringify'](_0x1f1eb2));if(_0x1f1eb2[_0xdc93('0xd')]){if(_0x1f1eb2[_0xdc93('0xd')][_0xdc93('0xe')]===0x1f4){logger[_0xdc93('0xd')](_0xdc93('0xa'),_0x4032ad,_0x1f1eb2[_0xdc93('0xd')][_0xdc93('0xf')]);return _0x4c1f2e(_0x1f1eb2[_0xdc93('0xd')][_0xdc93('0xf')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4032ad,_0x1f1eb2[_0xdc93('0xd')]['message']);return _0x48d08b(_0x1f1eb2[_0xdc93('0xd')]['message']);}else{logger[_0xdc93('0x10')](_0xdc93('0xa'),_0x4032ad,_0xdc93('0xb'));_0x48d08b(_0x1f1eb2['result'][_0xdc93('0xf')]);}})[_0xdc93('0x11')](function(_0x3ecf04){logger[_0xdc93('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4032ad,_0x3ecf04);_0x4c1f2e(_0x3ecf04);});});}exports[_0xdc93('0x12')]=function(_0x5d8365){var _0x28e4f2=this;return new Promise(function(_0x45e4cb,_0x40a152){return db['SalesforceAccount'][_0xdc93('0x13')]({'raw':_0x5d8365[_0xdc93('0x14')]?_0x5d8365['options'][_0xdc93('0x15')]===undefined?!![]:![]:!![],'where':_0x5d8365[_0xdc93('0x14')]?_0x5d8365[_0xdc93('0x14')][_0xdc93('0x16')]||null:null,'attributes':_0x5d8365[_0xdc93('0x14')]?_0x5d8365[_0xdc93('0x14')]['attributes']||null:null,'limit':_0x5d8365[_0xdc93('0x14')]?_0x5d8365[_0xdc93('0x14')][_0xdc93('0x17')]||null:null,'include':_0x5d8365[_0xdc93('0x14')]?_0x5d8365['options']['include']?_['map'](_0x5d8365[_0xdc93('0x14')]['include'],function(_0x1dc6ac){return{'model':db[_0x1dc6ac['model']],'as':_0x1dc6ac['as'],'attributes':_0x1dc6ac['attributes'],'include':_0x1dc6ac['include']?_['map'](_0x1dc6ac['include'],function(_0x40b623){return{'model':db[_0x40b623[_0xdc93('0x18')]],'as':_0x40b623['as'],'attributes':_0x40b623[_0xdc93('0x19')],'include':_0x40b623['include']?_[_0xdc93('0x1a')](_0x40b623[_0xdc93('0x1b')],function(_0x40422d){return{'model':db[_0x40422d[_0xdc93('0x18')]],'as':_0x40422d['as'],'attributes':_0x40422d[_0xdc93('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x331e2c){logger['info']('GetSalesforceAccount',_0x5d8365);logger[_0xdc93('0xc')](_0xdc93('0x12'),_0x5d8365,JSON['stringify'](_0x331e2c));_0x45e4cb(_0x331e2c);})[_0xdc93('0x11')](function(_0x375378){logger['error'](_0xdc93('0x12'),_0x375378['message'],_0x5d8365);_0x40a152(_0x28e4f2[_0xdc93('0xd')](0x1f4,_0x375378[_0xdc93('0xf')]));});});};exports[_0xdc93('0x1c')]=function(_0x2952e1){var _0x4f084a=this;return new Promise(function(_0xf0ff97,_0x178a50){return db[_0xdc93('0x1d')][_0xdc93('0x1e')]({'raw':_0x2952e1[_0xdc93('0x14')]?_0x2952e1[_0xdc93('0x14')][_0xdc93('0x15')]===undefined?!![]:![]:!![],'where':_0x2952e1[_0xdc93('0x14')]?_0x2952e1['options'][_0xdc93('0x16')]||null:null,'attributes':_0x2952e1[_0xdc93('0x14')]?_0x2952e1['options'][_0xdc93('0x19')]||null:null,'include':_0x2952e1[_0xdc93('0x14')]?_0x2952e1[_0xdc93('0x14')]['include']?_['map'](_0x2952e1['options']['include'],function(_0x4c4ee0){return{'model':db[_0x4c4ee0[_0xdc93('0x18')]],'as':_0x4c4ee0['as'],'attributes':_0x4c4ee0[_0xdc93('0x19')],'include':_0x4c4ee0['include']?_['map'](_0x4c4ee0[_0xdc93('0x1b')],function(_0x5375c5){return{'model':db[_0x5375c5[_0xdc93('0x18')]],'as':_0x5375c5['as'],'attributes':_0x5375c5[_0xdc93('0x19')],'include':_0x5375c5[_0xdc93('0x1b')]?_[_0xdc93('0x1a')](_0x5375c5[_0xdc93('0x1b')],function(_0x82cec6){return{'model':db[_0x82cec6[_0xdc93('0x18')]],'as':_0x82cec6['as'],'attributes':_0x82cec6[_0xdc93('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdc93('0x1f')](function(_0x300644){logger[_0xdc93('0x10')]('ShowSalesforceAccount',_0x2952e1);logger['debug'](_0xdc93('0x1c'),_0x2952e1,JSON['stringify'](_0x300644));_0xf0ff97(_0x300644);})[_0xdc93('0x11')](function(_0x4e7768){logger[_0xdc93('0xd')](_0xdc93('0x1c'),_0x4e7768[_0xdc93('0xf')],_0x2952e1);_0x178a50(_0x4f084a[_0xdc93('0xd')](0x1f4,_0x4e7768['message']));});});}; \ No newline at end of file +var _0x9ff0=['SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetSalesforceAccount','options','raw','where','attributes','include','model','map','stringify','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff0,0xfc));var _0x09ff=function(_0x3de53,_0x2bc86a){_0x3de53=_0x3de53-0x0;var _0x239539=_0x9ff0[_0x3de53];return _0x239539;};'use strict';var _=require(_0x09ff('0x0'));var util=require(_0x09ff('0x1'));var moment=require(_0x09ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x09ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09ff('0x4'))['db'];var utils=require(_0x09ff('0x5'));var logger=require(_0x09ff('0x6'))('rpc');var config=require(_0x09ff('0x7'));var jayson=require(_0x09ff('0x8'));var client=jayson['client'][_0x09ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f96ee,_0x438f21,_0x4cc674){return new BPromise(function(_0x570536,_0x4db198){return client[_0x09ff('0xa')](_0x3f96ee,_0x4cc674)[_0x09ff('0xb')](function(_0x5eddd7){logger['info'](_0x09ff('0xc'),_0x438f21,_0x09ff('0xd'));logger[_0x09ff('0xe')](_0x09ff('0xf'),_0x438f21,_0x09ff('0xd'),JSON['stringify'](_0x5eddd7));if(_0x5eddd7[_0x09ff('0x10')]){if(_0x5eddd7['error'][_0x09ff('0x11')]===0x1f4){logger[_0x09ff('0x10')](_0x09ff('0xc'),_0x438f21,_0x5eddd7['error']['message']);return _0x4db198(_0x5eddd7[_0x09ff('0x10')][_0x09ff('0x12')]);}logger[_0x09ff('0x10')](_0x09ff('0xc'),_0x438f21,_0x5eddd7[_0x09ff('0x10')]['message']);return _0x570536(_0x5eddd7[_0x09ff('0x10')][_0x09ff('0x12')]);}else{logger[_0x09ff('0x13')](_0x09ff('0xc'),_0x438f21,_0x09ff('0xd'));_0x570536(_0x5eddd7['result']['message']);}})[_0x09ff('0x14')](function(_0x43b491){logger[_0x09ff('0x10')](_0x09ff('0xc'),_0x438f21,_0x43b491);_0x4db198(_0x43b491);});});}exports[_0x09ff('0x15')]=function(_0x384c52){var _0x1845d5=this;return new Promise(function(_0x1a9ae2,_0x36efcb){return db['SalesforceAccount']['findAll']({'raw':_0x384c52[_0x09ff('0x16')]?_0x384c52[_0x09ff('0x16')][_0x09ff('0x17')]===undefined?!![]:![]:!![],'where':_0x384c52[_0x09ff('0x16')]?_0x384c52[_0x09ff('0x16')][_0x09ff('0x18')]||null:null,'attributes':_0x384c52[_0x09ff('0x16')]?_0x384c52[_0x09ff('0x16')][_0x09ff('0x19')]||null:null,'limit':_0x384c52[_0x09ff('0x16')]?_0x384c52[_0x09ff('0x16')]['limit']||null:null,'include':_0x384c52[_0x09ff('0x16')]?_0x384c52[_0x09ff('0x16')][_0x09ff('0x1a')]?_['map'](_0x384c52[_0x09ff('0x16')][_0x09ff('0x1a')],function(_0x2e58b2){return{'model':db[_0x2e58b2[_0x09ff('0x1b')]],'as':_0x2e58b2['as'],'attributes':_0x2e58b2[_0x09ff('0x19')],'include':_0x2e58b2[_0x09ff('0x1a')]?_[_0x09ff('0x1c')](_0x2e58b2[_0x09ff('0x1a')],function(_0x27022c){return{'model':db[_0x27022c[_0x09ff('0x1b')]],'as':_0x27022c['as'],'attributes':_0x27022c[_0x09ff('0x19')],'include':_0x27022c['include']?_['map'](_0x27022c[_0x09ff('0x1a')],function(_0x341bb8){return{'model':db[_0x341bb8[_0x09ff('0x1b')]],'as':_0x341bb8['as'],'attributes':_0x341bb8[_0x09ff('0x19')]};}):[]};}):[]};}):[]:[]})[_0x09ff('0xb')](function(_0x1ae44d){logger[_0x09ff('0x13')](_0x09ff('0x15'),_0x384c52);logger[_0x09ff('0xe')](_0x09ff('0x15'),_0x384c52,JSON[_0x09ff('0x1d')](_0x1ae44d));_0x1a9ae2(_0x1ae44d);})[_0x09ff('0x14')](function(_0x4db543){logger[_0x09ff('0x10')]('GetSalesforceAccount',_0x4db543['message'],_0x384c52);_0x36efcb(_0x1845d5[_0x09ff('0x10')](0x1f4,_0x4db543[_0x09ff('0x12')]));});});};exports[_0x09ff('0x1e')]=function(_0xb66eee){var _0x7034b9=this;return new Promise(function(_0x6cffaa,_0x3ad4c7){return db[_0x09ff('0x1f')][_0x09ff('0x20')]({'raw':_0xb66eee[_0x09ff('0x16')]?_0xb66eee[_0x09ff('0x16')][_0x09ff('0x17')]===undefined?!![]:![]:!![],'where':_0xb66eee['options']?_0xb66eee[_0x09ff('0x16')][_0x09ff('0x18')]||null:null,'attributes':_0xb66eee['options']?_0xb66eee['options']['attributes']||null:null,'include':_0xb66eee['options']?_0xb66eee[_0x09ff('0x16')]['include']?_[_0x09ff('0x1c')](_0xb66eee[_0x09ff('0x16')][_0x09ff('0x1a')],function(_0x597a94){return{'model':db[_0x597a94[_0x09ff('0x1b')]],'as':_0x597a94['as'],'attributes':_0x597a94[_0x09ff('0x19')],'include':_0x597a94[_0x09ff('0x1a')]?_[_0x09ff('0x1c')](_0x597a94[_0x09ff('0x1a')],function(_0x3fd992){return{'model':db[_0x3fd992[_0x09ff('0x1b')]],'as':_0x3fd992['as'],'attributes':_0x3fd992[_0x09ff('0x19')],'include':_0x3fd992['include']?_['map'](_0x3fd992[_0x09ff('0x1a')],function(_0x1ec65a){return{'model':db[_0x1ec65a['model']],'as':_0x1ec65a['as'],'attributes':_0x1ec65a[_0x09ff('0x19')]};}):[]};}):[]};}):[]:[]})[_0x09ff('0xb')](function(_0x469e35){logger[_0x09ff('0x13')](_0x09ff('0x1e'),_0xb66eee);logger['debug'](_0x09ff('0x1e'),_0xb66eee,JSON[_0x09ff('0x1d')](_0x469e35));_0x6cffaa(_0x469e35);})['catch'](function(_0x145284){logger[_0x09ff('0x10')]('ShowSalesforceAccount',_0x145284['message'],_0xb66eee);_0x3ad4c7(_0x7034b9['error'](0x1f4,_0x145284[_0x09ff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f13d4bb..4a5217f 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 _0x83f9=['../../config/environment','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1e9464,_0x3b2a40){var _0x47b1cb=function(_0x537772){while(--_0x537772){_0x1e9464['push'](_0x1e9464['shift']());}};_0x47b1cb(++_0x3b2a40);}(_0x83f9,0x175));var _0x983f=function(_0x1d39f7,_0x2159f4){_0x1d39f7=_0x1d39f7-0x0;var _0x4f771c=_0x83f9[_0x1d39f7];return _0x4f771c;};'use strict';var multer=require('multer');var util=require(_0x983f('0x0'));var path=require(_0x983f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x983f('0x2')]();var auth=require(_0x983f('0x3'));var interaction=require(_0x983f('0x4'));var config=require(_0x983f('0x5'));var controller=require(_0x983f('0x6'));router[_0x983f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x983f('0x7')](_0x983f('0x8'),auth[_0x983f('0x9')](),controller[_0x983f('0xa')]);router[_0x983f('0x7')]('/:id/fields',auth[_0x983f('0x9')](),controller[_0x983f('0xb')]);router['get'](_0x983f('0xc'),auth[_0x983f('0x9')](),controller[_0x983f('0xd')]);router[_0x983f('0x7')](_0x983f('0xe'),auth[_0x983f('0x9')](),controller[_0x983f('0xf')]);router[_0x983f('0x10')]('/',auth[_0x983f('0x9')](),controller['create']);router[_0x983f('0x11')](_0x983f('0x8'),auth[_0x983f('0x9')](),controller[_0x983f('0x12')]);router[_0x983f('0x13')](_0x983f('0x8'),auth[_0x983f('0x9')](),controller['destroy']);module[_0x983f('0x14')]=router; \ No newline at end of file +var _0xbebc=['getDescriptions','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xcee2b7,_0x2a9d8b){var _0x2b2c3d=function(_0x1c94cb){while(--_0x1c94cb){_0xcee2b7['push'](_0xcee2b7['shift']());}};_0x2b2c3d(++_0x2a9d8b);}(_0xbebc,0xf7));var _0xcbeb=function(_0x3343b4,_0x2a0c93){_0x3343b4=_0x3343b4-0x0;var _0x503390=_0xbebc[_0x3343b4];return _0x503390;};'use strict';var multer=require(_0xcbeb('0x0'));var util=require('util');var path=require(_0xcbeb('0x1'));var timeout=require(_0xcbeb('0x2'));var express=require(_0xcbeb('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcbeb('0x4'));var config=require(_0xcbeb('0x5'));var controller=require(_0xcbeb('0x6'));router[_0xcbeb('0x7')]('/',auth[_0xcbeb('0x8')](),controller['index']);router[_0xcbeb('0x7')](_0xcbeb('0x9'),auth[_0xcbeb('0x8')](),controller['show']);router[_0xcbeb('0x7')]('/:id/fields',auth[_0xcbeb('0x8')](),controller['getFields']);router['get'](_0xcbeb('0xa'),auth[_0xcbeb('0x8')](),controller[_0xcbeb('0xb')]);router[_0xcbeb('0x7')](_0xcbeb('0xc'),auth['isAuthenticated'](),controller[_0xcbeb('0xd')]);router[_0xcbeb('0xe')]('/',auth['isAuthenticated'](),controller[_0xcbeb('0xf')]);router['put']('/:id',auth[_0xcbeb('0x8')](),controller[_0xcbeb('0x10')]);router[_0xcbeb('0x11')]('/:id',auth[_0xcbeb('0x8')](),controller[_0xcbeb('0x12')]);module[_0xcbeb('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 996cba4..1c2f672 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 _0x27fb=['nothing','sequelize','exports','ENUM','Task','Case','contact_lead','contact','lead'];(function(_0x27ab8c,_0x42376a){var _0x1e65dc=function(_0x1604ba){while(--_0x1604ba){_0x27ab8c['push'](_0x27ab8c['shift']());}};_0x1e65dc(++_0x42376a);}(_0x27fb,0x1b1));var _0xb27f=function(_0x1afb12,_0x2a6071){_0x1afb12=_0x1afb12-0x0;var _0x59eb9c=_0x27fb[_0x1afb12];return _0x59eb9c;};'use strict';var Sequelize=require(_0xb27f('0x0'));module[_0xb27f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb27f('0x2')](_0xb27f('0x3'),_0xb27f('0x4')),'defaultValue':_0xb27f('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xb27f('0x5'),_0xb27f('0x6'),_0xb27f('0x7')),'defaultValue':_0xb27f('0x5')},'moduleCreate':{'type':Sequelize[_0xb27f('0x2')](_0xb27f('0x8'),'contact',_0xb27f('0x7')),'defaultValue':_0xb27f('0x7')}}; \ No newline at end of file +var _0x68e7=['sequelize','exports','STRING','ENUM','Case','contact_lead','contact','nothing','lead'];(function(_0x31b350,_0x5be290){var _0x1870dc=function(_0xbae48d){while(--_0xbae48d){_0x31b350['push'](_0x31b350['shift']());}};_0x1870dc(++_0x5be290);}(_0x68e7,0x1a7));var _0x768e=function(_0x582391,_0xabdfa){_0x582391=_0x582391-0x0;var _0x22b2aa=_0x68e7[_0x582391];return _0x22b2aa;};'use strict';var Sequelize=require(_0x768e('0x0'));module[_0x768e('0x1')]={'name':{'type':Sequelize[_0x768e('0x2')]},'description':{'type':Sequelize[_0x768e('0x2')]},'ticketType':{'type':Sequelize[_0x768e('0x3')]('Task',_0x768e('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x768e('0x5'),_0x768e('0x6'),'lead'),'defaultValue':_0x768e('0x5')},'moduleCreate':{'type':Sequelize[_0x768e('0x3')](_0x768e('0x7'),_0x768e('0x6'),_0x768e('0x8')),'defaultValue':_0x768e('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 0a2c86d..b06c952 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 _0x388b=['code','message','info','result','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','index','SalesforceConfiguration','rawAttributes','keys','intersection','query','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','field','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','http','test','request','then','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x30b598,_0x364c0e){var _0x34aea3=function(_0x12e559){while(--_0x12e559){_0x30b598['push'](_0x30b598['shift']());}};_0x34aea3(++_0x364c0e);}(_0x388b,0x14c));var _0xb388=function(_0x3c3bd3,_0x31773e){_0x3c3bd3=_0x3c3bd3-0x0;var _0x5b3140=_0x388b[_0x3c3bd3];return _0x5b3140;};'use strict';var pdf=require(_0xb388('0x0'));var emlformat=require(_0xb388('0x1'));var rimraf=require(_0xb388('0x2'));var zipdir=require(_0xb388('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb388('0x4'));var moment=require(_0xb388('0x5'));var BPromise=require(_0xb388('0x6'));var Mustache=require(_0xb388('0x7'));var util=require(_0xb388('0x8'));var path=require(_0xb388('0x9'));var sox=require(_0xb388('0xa'));var csv=require(_0xb388('0xb'));var ejs=require(_0xb388('0xc'));var fs=require('fs');var _=require(_0xb388('0xd'));var squel=require(_0xb388('0xe'));var crypto=require(_0xb388('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb388('0x10'));var toCsv=require(_0xb388('0xb'));var querystring=require(_0xb388('0x11'));var Papa=require(_0xb388('0x12'));var Redis=require(_0xb388('0x13'));var authService=require(_0xb388('0x14'));var qs=require(_0xb388('0x15'));var hardwareService=require(_0xb388('0x16'));var logger=require('../../config/logger')(_0xb388('0x17'));var utils=require(_0xb388('0x18'));var config=require('../../config/environment');var db=require(_0xb388('0x19'))['db'];var jayson=require(_0xb388('0x1a'));var client=jayson['client'][_0xb388('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x325ea7,_0x32f109,_0xbfb4a5){if(_0xbfb4a5){var _0xc2e772=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc2e772[_0xb388('0x1c')](_0x32f109)){return _0x325ea7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x325ea7;}}function respondWithRpcPromise(_0x58776e,_0x44ea67,_0x2345fd,_0x40a779){return new BPromise(function(_0x780514,_0xb0c69b){var _0x16e770=_0x40a779||client;return _0x16e770[_0xb388('0x1d')](_0x58776e,_0x2345fd)[_0xb388('0x1e')](function(_0x1b9f3c){logger['info'](_0xb388('0x1f'),_0x44ea67,'request\x20sent');logger['debug'](_0xb388('0x20'),_0x44ea67,_0xb388('0x21'),JSON[_0xb388('0x22')](_0x1b9f3c));if(_0x1b9f3c[_0xb388('0x23')]){if(_0x1b9f3c[_0xb388('0x23')][_0xb388('0x24')]===0x1f4){logger[_0xb388('0x23')](_0xb388('0x1f'),_0x44ea67,_0x1b9f3c[_0xb388('0x23')][_0xb388('0x25')]);return _0xb0c69b(_0x1b9f3c[_0xb388('0x23')]['message']);}logger['error'](_0xb388('0x1f'),_0x44ea67,_0x1b9f3c['error'][_0xb388('0x25')]);return _0x780514(_0x1b9f3c['error'][_0xb388('0x25')]);}else{logger[_0xb388('0x26')](_0xb388('0x1f'),_0x44ea67,_0xb388('0x21'));_0x780514(_0x1b9f3c[_0xb388('0x27')]['message']);}})['catch'](function(_0x282568){logger[_0xb388('0x23')](_0xb388('0x1f'),_0x44ea67,_0x282568);_0xb0c69b(_0x282568);});});}function respondWithStatusCode(_0x1c8459,_0x192f72){_0x192f72=_0x192f72||0xcc;return function(_0x2bd857){if(_0x2bd857){return _0x1c8459['sendStatus'](_0x192f72);}return _0x1c8459[_0xb388('0x28')](_0x192f72)['end']();};}function respondWithResult(_0x73d670,_0x394c93){_0x394c93=_0x394c93||0xc8;return function(_0x621fe9){if(_0x621fe9){return _0x73d670[_0xb388('0x28')](_0x394c93)[_0xb388('0x29')](_0x621fe9);}};}function respondWithFilteredResult(_0x1c463f,_0x26587e){return function(_0x330a87){if(_0x330a87){var _0xd1a30b=_0x330a87[_0xb388('0x2a')],_0x41a666=_0x26587e[_0xb388('0x2b')],_0x52b733=_0x26587e['offset']+_0x26587e[_0xb388('0x2c')],_0x26a0bf;if(_0x52b733>=_0xd1a30b){_0x52b733=_0xd1a30b;_0x26a0bf=0xc8;}else{_0x26a0bf=0xce;}_0x1c463f['status'](_0x26a0bf);return _0x1c463f[_0xb388('0x2d')](_0xb388('0x2e'),_0x41a666+'-'+_0x52b733+'/'+_0xd1a30b)['json'](_0x330a87);}return null;};}function patchUpdates(_0x532bfc){return function(_0x4f8178){try{jsonpatch['apply'](_0x4f8178,_0x532bfc,!![]);}catch(_0x5ee518){return BPromise[_0xb388('0x2f')](_0x5ee518);}return _0x4f8178[_0xb388('0x30')]();};}function saveUpdates(_0x59775c,_0xa17cab){return function(_0x5bfcca){if(_0x5bfcca){return _0x5bfcca[_0xb388('0x31')](_0x59775c)[_0xb388('0x1e')](function(_0x5ec601){return _0x5ec601;});}return null;};}function removeEntity(_0x43a435,_0x5b818f){return function(_0x44cc4a){if(_0x44cc4a){return _0x44cc4a[_0xb388('0x32')]()[_0xb388('0x1e')](function(){_0x43a435[_0xb388('0x28')](0xcc)[_0xb388('0x33')]();});}};}function handleEntityNotFound(_0x20f445,_0x16e0d1){return function(_0x50df35){if(!_0x50df35){_0x20f445['sendStatus'](0x194);}return _0x50df35;};}function handleError(_0x4717e9,_0x454513){_0x454513=_0x454513||0x1f4;return function(_0x5b58e9){logger['error'](_0x5b58e9[_0xb388('0x34')]);if(_0x5b58e9['name']){delete _0x5b58e9[_0xb388('0x35')];}_0x4717e9[_0xb388('0x28')](_0x454513)[_0xb388('0x36')](_0x5b58e9);};}exports[_0xb388('0x37')]=function(_0x444ed9,_0x4d2cbc){var _0x486a74={},_0x186514={},_0x2bfe6b={'count':0x0,'rows':[]};var _0x447671=db[_0xb388('0x38')][_0xb388('0x39')];_0x186514['model']=_[_0xb388('0x3a')](_0x447671);_0x186514['query']=_[_0xb388('0x3a')](_0x444ed9['query']);_0x186514['filters']=_[_0xb388('0x3b')](_0x186514['model'],_0x186514[_0xb388('0x3c')]);_0x486a74['attributes']=_[_0xb388('0x3b')](_0x186514[_0xb388('0x3d')],qs[_0xb388('0x3e')](_0x444ed9[_0xb388('0x3c')][_0xb388('0x3e')]));_0x486a74[_0xb388('0x3f')]=_0x486a74[_0xb388('0x3f')][_0xb388('0x40')]?_0x486a74[_0xb388('0x3f')]:_0x186514[_0xb388('0x3d')];if(!_0x444ed9[_0xb388('0x3c')][_0xb388('0x41')]('nolimit')){_0x486a74[_0xb388('0x2c')]=qs['limit'](_0x444ed9[_0xb388('0x3c')][_0xb388('0x2c')]);_0x486a74[_0xb388('0x2b')]=qs[_0xb388('0x2b')](_0x444ed9[_0xb388('0x3c')][_0xb388('0x2b')]);}_0x486a74[_0xb388('0x42')]=qs[_0xb388('0x43')](_0x444ed9['query']['sort']);_0x486a74[_0xb388('0x44')]=qs[_0xb388('0x45')](_[_0xb388('0x46')](_0x444ed9[_0xb388('0x3c')],_0x186514[_0xb388('0x45')]));if(_0x444ed9[_0xb388('0x3c')][_0xb388('0x47')]){_0x486a74['where']=_['merge'](_0x486a74['where'],{'$or':_[_0xb388('0x48')](_0x447671,function(_0x12a3a8){if(_0x12a3a8['type']['key']!=='VIRTUAL'){var _0x37bfdb={};_0x37bfdb[_0x12a3a8[_0xb388('0x49')]]={'$like':'%'+_0x444ed9[_0xb388('0x3c')][_0xb388('0x47')]+'%'};return _0x37bfdb;}})});}_0x486a74=_[_0xb388('0x4a')]({},_0x486a74,_0x444ed9[_0xb388('0x4b')]);var _0x5d669e={'where':_0x486a74[_0xb388('0x44')]};return db['SalesforceConfiguration'][_0xb388('0x2a')](_0x5d669e)[_0xb388('0x1e')](function(_0x1a4f83){_0x2bfe6b[_0xb388('0x2a')]=_0x1a4f83;if(_0x444ed9['query'][_0xb388('0x4c')]){_0x486a74['include']=[{'all':!![]}];}return db[_0xb388('0x38')][_0xb388('0x4d')](_0x486a74);})[_0xb388('0x1e')](function(_0x219c5d){_0x2bfe6b[_0xb388('0x4e')]=_0x219c5d;return _0x2bfe6b;})[_0xb388('0x1e')](respondWithFilteredResult(_0x4d2cbc,_0x486a74))[_0xb388('0x4f')](handleError(_0x4d2cbc,null));};exports[_0xb388('0x50')]=function(_0x477f9c,_0x25df8e){var _0x1b2648={'raw':![],'where':{'id':_0x477f9c[_0xb388('0x51')]['id']}},_0x269e0f={};_0x269e0f[_0xb388('0x3d')]=_[_0xb388('0x3a')](db[_0xb388('0x38')][_0xb388('0x39')]);_0x269e0f[_0xb388('0x3c')]=_[_0xb388('0x3a')](_0x477f9c[_0xb388('0x3c')]);_0x269e0f['filters']=_[_0xb388('0x3b')](_0x269e0f['model'],_0x269e0f[_0xb388('0x3c')]);_0x1b2648['attributes']=_['intersection'](_0x269e0f[_0xb388('0x3d')],qs[_0xb388('0x3e')](_0x477f9c[_0xb388('0x3c')][_0xb388('0x3e')]));_0x1b2648[_0xb388('0x3f')]=_0x1b2648[_0xb388('0x3f')][_0xb388('0x40')]?_0x1b2648['attributes']:_0x269e0f['model'];if(_0x477f9c[_0xb388('0x3c')][_0xb388('0x4c')]){_0x1b2648[_0xb388('0x52')]=[{'all':!![]}];}_0x1b2648=_[_0xb388('0x4a')]({},_0x1b2648,_0x477f9c[_0xb388('0x4b')]);return db[_0xb388('0x38')][_0xb388('0x53')](_0x1b2648)[_0xb388('0x1e')](handleEntityNotFound(_0x25df8e,null))[_0xb388('0x1e')](respondWithResult(_0x25df8e,null))['catch'](handleError(_0x25df8e,null));};exports[_0xb388('0x54')]=function(_0x3d2439,_0x13fc49){return db[_0xb388('0x38')][_0xb388('0x54')](_0x3d2439[_0xb388('0x55')],{})[_0xb388('0x1e')](respondWithResult(_0x13fc49,0xc9))[_0xb388('0x4f')](handleError(_0x13fc49,null));};exports[_0xb388('0x31')]=function(_0x23a089,_0x3f77b7){if(_0x23a089[_0xb388('0x55')]['id']){delete _0x23a089['body']['id'];}return db[_0xb388('0x38')][_0xb388('0x53')]({'where':{'id':_0x23a089[_0xb388('0x51')]['id']}})[_0xb388('0x1e')](handleEntityNotFound(_0x3f77b7,null))[_0xb388('0x1e')](saveUpdates(_0x23a089[_0xb388('0x55')],null))[_0xb388('0x1e')](respondWithResult(_0x3f77b7,null))[_0xb388('0x4f')](handleError(_0x3f77b7,null));};exports[_0xb388('0x32')]=function(_0x6adf79,_0x4323a6){return db[_0xb388('0x38')][_0xb388('0x53')]({'where':{'id':_0x6adf79[_0xb388('0x51')]['id']}})[_0xb388('0x1e')](handleEntityNotFound(_0x4323a6,null))[_0xb388('0x1e')](removeEntity(_0x4323a6,null))[_0xb388('0x4f')](handleError(_0x4323a6,null));};exports[_0xb388('0x56')]=function(_0x54ce3f,_0x1b5bf9,_0x1b30d2){var _0x50de13={};var _0x592446={};var _0x5a37d4;var _0x2ff765;return db[_0xb388('0x38')][_0xb388('0x57')]({'where':{'id':_0x54ce3f[_0xb388('0x51')]['id']}})[_0xb388('0x1e')](handleEntityNotFound(_0x1b5bf9,null))[_0xb388('0x1e')](function(_0x1e52a3){if(_0x1e52a3){_0x5a37d4=_0x1e52a3;_0x592446[_0xb388('0x3d')]=_[_0xb388('0x3a')](db[_0xb388('0x58')]['rawAttributes']);_0x592446[_0xb388('0x3c')]=_['keys'](_0x54ce3f[_0xb388('0x3c')]);_0x592446[_0xb388('0x45')]=_[_0xb388('0x3b')](_0x592446[_0xb388('0x3d')],_0x592446['query']);_0x50de13[_0xb388('0x3f')]=_[_0xb388('0x3b')](_0x592446[_0xb388('0x3d')],qs[_0xb388('0x3e')](_0x54ce3f[_0xb388('0x3c')]['fields']));_0x50de13[_0xb388('0x3f')]=_0x50de13[_0xb388('0x3f')]['length']?_0x50de13[_0xb388('0x3f')]:_0x592446[_0xb388('0x3d')];_0x50de13[_0xb388('0x42')]=qs[_0xb388('0x43')](_0x54ce3f[_0xb388('0x3c')]['sort']);_0x50de13[_0xb388('0x44')]=qs[_0xb388('0x45')](_[_0xb388('0x46')](_0x54ce3f[_0xb388('0x3c')],_0x592446[_0xb388('0x45')]));if(_0x54ce3f['query'][_0xb388('0x47')]){_0x50de13[_0xb388('0x44')]=_[_0xb388('0x4a')](_0x50de13[_0xb388('0x44')],{'$or':_['map'](_0x50de13[_0xb388('0x3f')],function(_0x5ae987){var _0x20e73d={};_0x20e73d[_0x5ae987]={'$like':'%'+_0x54ce3f[_0xb388('0x3c')]['filter']+'%'};return _0x20e73d;})});}_0x50de13=_[_0xb388('0x4a')]({},_0x50de13,_0x54ce3f[_0xb388('0x4b')]);return _0x5a37d4[_0xb388('0x56')](_0x50de13);}})[_0xb388('0x1e')](function(_0x290d59){if(_0x290d59){_0x2ff765=_0x290d59[_0xb388('0x40')];if(!_0x54ce3f[_0xb388('0x3c')][_0xb388('0x41')](_0xb388('0x59'))){_0x50de13[_0xb388('0x2c')]=qs[_0xb388('0x2c')](_0x54ce3f['query'][_0xb388('0x2c')]);_0x50de13[_0xb388('0x2b')]=qs['offset'](_0x54ce3f[_0xb388('0x3c')]['offset']);}return _0x5a37d4[_0xb388('0x56')](_0x50de13);}})[_0xb388('0x1e')](function(_0x268519){if(_0x268519){return _0x268519?{'count':_0x2ff765,'rows':_0x268519}:null;}})['then'](respondWithResult(_0x1b5bf9,null))[_0xb388('0x4f')](handleError(_0x1b5bf9,null));};exports[_0xb388('0x5a')]=function(_0x5df143,_0x1a63f9,_0x4b4377){var _0x2916ae={};var _0x2c0295={};var _0x8d5a0d;var _0x3d8ffe;return db['SalesforceConfiguration'][_0xb388('0x57')]({'where':{'id':_0x5df143[_0xb388('0x51')]['id']}})[_0xb388('0x1e')](handleEntityNotFound(_0x1a63f9,null))['then'](function(_0x24ca59){if(_0x24ca59){_0x8d5a0d=_0x24ca59;_0x2c0295[_0xb388('0x3d')]=_[_0xb388('0x3a')](db['SalesforceField'][_0xb388('0x39')]);_0x2c0295[_0xb388('0x3c')]=_[_0xb388('0x3a')](_0x5df143[_0xb388('0x3c')]);_0x2c0295[_0xb388('0x45')]=_['intersection'](_0x2c0295[_0xb388('0x3d')],_0x2c0295[_0xb388('0x3c')]);_0x2916ae[_0xb388('0x3f')]=_[_0xb388('0x3b')](_0x2c0295[_0xb388('0x3d')],qs[_0xb388('0x3e')](_0x5df143[_0xb388('0x3c')][_0xb388('0x3e')]));_0x2916ae[_0xb388('0x3f')]=_0x2916ae['attributes'][_0xb388('0x40')]?_0x2916ae[_0xb388('0x3f')]:_0x2c0295[_0xb388('0x3d')];_0x2916ae[_0xb388('0x42')]=qs['sort'](_0x5df143[_0xb388('0x3c')][_0xb388('0x43')]);_0x2916ae[_0xb388('0x44')]=qs['filters'](_['pick'](_0x5df143[_0xb388('0x3c')],_0x2c0295['filters']));if(_0x5df143[_0xb388('0x3c')][_0xb388('0x47')]){_0x2916ae[_0xb388('0x44')]=_[_0xb388('0x4a')](_0x2916ae[_0xb388('0x44')],{'$or':_[_0xb388('0x48')](_0x2916ae[_0xb388('0x3f')],function(_0x489ed3){var _0x327fc8={};_0x327fc8[_0x489ed3]={'$like':'%'+_0x5df143['query'][_0xb388('0x47')]+'%'};return _0x327fc8;})});}_0x2916ae=_['merge']({},_0x2916ae,_0x5df143['options']);return _0x8d5a0d[_0xb388('0x5a')](_0x2916ae);}})[_0xb388('0x1e')](function(_0x414d44){if(_0x414d44){_0x3d8ffe=_0x414d44['length'];if(!_0x5df143[_0xb388('0x3c')]['hasOwnProperty'](_0xb388('0x59'))){_0x2916ae[_0xb388('0x2c')]=qs[_0xb388('0x2c')](_0x5df143['query']['limit']);_0x2916ae[_0xb388('0x2b')]=qs[_0xb388('0x2b')](_0x5df143[_0xb388('0x3c')][_0xb388('0x2b')]);}return _0x8d5a0d[_0xb388('0x5a')](_0x2916ae);}})[_0xb388('0x1e')](function(_0x3c0bb4){if(_0x3c0bb4){return _0x3c0bb4?{'count':_0x3d8ffe,'rows':_0x3c0bb4}:null;}})[_0xb388('0x1e')](respondWithResult(_0x1a63f9,null))[_0xb388('0x4f')](handleError(_0x1a63f9,null));};exports[_0xb388('0x5b')]=function(_0x531b76,_0x50bea9,_0x18b8af){var _0x2c350f={};var _0x456370={};var _0x3ec9b4;var _0x2649c3;return db[_0xb388('0x38')][_0xb388('0x57')]({'where':{'id':_0x531b76[_0xb388('0x51')]['id']}})[_0xb388('0x1e')](handleEntityNotFound(_0x50bea9,null))[_0xb388('0x1e')](function(_0x2af7d5){if(_0x2af7d5){_0x3ec9b4=_0x2af7d5;_0x456370[_0xb388('0x3d')]=_[_0xb388('0x3a')](db['SalesforceField'][_0xb388('0x39')]);_0x456370[_0xb388('0x3c')]=_['keys'](_0x531b76['query']);_0x456370[_0xb388('0x45')]=_[_0xb388('0x3b')](_0x456370[_0xb388('0x3d')],_0x456370[_0xb388('0x3c')]);_0x2c350f[_0xb388('0x3f')]=_[_0xb388('0x3b')](_0x456370[_0xb388('0x3d')],qs[_0xb388('0x3e')](_0x531b76[_0xb388('0x3c')][_0xb388('0x3e')]));_0x2c350f['attributes']=_0x2c350f[_0xb388('0x3f')]['length']?_0x2c350f['attributes']:_0x456370[_0xb388('0x3d')];_0x2c350f[_0xb388('0x42')]=qs['sort'](_0x531b76[_0xb388('0x3c')]['sort']);_0x2c350f['where']=qs[_0xb388('0x45')](_[_0xb388('0x46')](_0x531b76[_0xb388('0x3c')],_0x456370[_0xb388('0x45')]));if(_0x531b76['query'][_0xb388('0x47')]){_0x2c350f[_0xb388('0x44')]=_['merge'](_0x2c350f[_0xb388('0x44')],{'$or':_[_0xb388('0x48')](_0x2c350f[_0xb388('0x3f')],function(_0x15deab){var _0x41e34b={};_0x41e34b[_0x15deab]={'$like':'%'+_0x531b76[_0xb388('0x3c')][_0xb388('0x47')]+'%'};return _0x41e34b;})});}_0x2c350f=_['merge']({},_0x2c350f,_0x531b76['options']);return _0x3ec9b4[_0xb388('0x5b')](_0x2c350f);}})[_0xb388('0x1e')](function(_0x3bc5c5){if(_0x3bc5c5){_0x2649c3=_0x3bc5c5[_0xb388('0x40')];if(!_0x531b76['query']['hasOwnProperty']('nolimit')){_0x2c350f['limit']=qs[_0xb388('0x2c')](_0x531b76[_0xb388('0x3c')]['limit']);_0x2c350f[_0xb388('0x2b')]=qs[_0xb388('0x2b')](_0x531b76[_0xb388('0x3c')][_0xb388('0x2b')]);}return _0x3ec9b4['getDescriptions'](_0x2c350f);}})[_0xb388('0x1e')](function(_0x57d3a5){if(_0x57d3a5){return _0x57d3a5?{'count':_0x2649c3,'rows':_0x57d3a5}:null;}})[_0xb388('0x1e')](respondWithResult(_0x50bea9,null))[_0xb388('0x4f')](handleError(_0x50bea9,null));}; \ No newline at end of file +var _0x3fdf=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','status','json','count','offset','limit','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','map','key','VIRTUAL','field','filter','options','SalesforceConfiguration','includeAll','include','findAll','show','params','find','create','body','catch','getFields','findOne','SalesforceField','sort','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x584d37,_0x13fb20){var _0x1a1dbf=function(_0x23cd11){while(--_0x23cd11){_0x584d37['push'](_0x584d37['shift']());}};_0x1a1dbf(++_0x13fb20);}(_0x3fdf,0x1d5));var _0xf3fd=function(_0x17548c,_0x1e5d0f){_0x17548c=_0x17548c-0x0;var _0xafa8e0=_0x3fdf[_0x17548c];return _0xafa8e0;};'use strict';var pdf=require(_0xf3fd('0x0'));var emlformat=require(_0xf3fd('0x1'));var rimraf=require(_0xf3fd('0x2'));var zipdir=require(_0xf3fd('0x3'));var jsonpatch=require(_0xf3fd('0x4'));var rp=require(_0xf3fd('0x5'));var moment=require('moment');var BPromise=require(_0xf3fd('0x6'));var Mustache=require(_0xf3fd('0x7'));var util=require(_0xf3fd('0x8'));var path=require(_0xf3fd('0x9'));var sox=require(_0xf3fd('0xa'));var csv=require(_0xf3fd('0xb'));var ejs=require(_0xf3fd('0xc'));var fs=require('fs');var _=require(_0xf3fd('0xd'));var squel=require('squel');var crypto=require(_0xf3fd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf3fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3fd('0x10'));var Papa=require(_0xf3fd('0x11'));var Redis=require(_0xf3fd('0x12'));var authService=require(_0xf3fd('0x13'));var qs=require(_0xf3fd('0x14'));var hardwareService=require(_0xf3fd('0x15'));var logger=require('../../config/logger')(_0xf3fd('0x16'));var utils=require(_0xf3fd('0x17'));var config=require(_0xf3fd('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf3fd('0x19'));var client=jayson[_0xf3fd('0x1a')][_0xf3fd('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x412150,_0xe5fae7,_0x1470ae){if(_0x1470ae){var _0x34168d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34168d[_0xf3fd('0x1c')](_0xe5fae7)){return _0x412150;}else{throw new Error(_0xf3fd('0x1d'));}}else{return _0x412150;}}function respondWithRpcPromise(_0x10cc57,_0x1b3bb6,_0x745e3,_0x4c2e53){return new BPromise(function(_0x31e7f0,_0x326c2c){var _0x2fe43d=_0x4c2e53||client;return _0x2fe43d[_0xf3fd('0x1e')](_0x10cc57,_0x745e3)[_0xf3fd('0x1f')](function(_0x3cca16){logger[_0xf3fd('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b3bb6,_0xf3fd('0x21'));logger['debug'](_0xf3fd('0x22'),_0x1b3bb6,_0xf3fd('0x21'),JSON[_0xf3fd('0x23')](_0x3cca16));if(_0x3cca16[_0xf3fd('0x24')]){if(_0x3cca16[_0xf3fd('0x24')][_0xf3fd('0x25')]===0x1f4){logger[_0xf3fd('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b3bb6,_0x3cca16[_0xf3fd('0x24')][_0xf3fd('0x26')]);return _0x326c2c(_0x3cca16['error'][_0xf3fd('0x26')]);}logger['error'](_0xf3fd('0x27'),_0x1b3bb6,_0x3cca16[_0xf3fd('0x24')][_0xf3fd('0x26')]);return _0x31e7f0(_0x3cca16[_0xf3fd('0x24')]['message']);}else{logger[_0xf3fd('0x20')](_0xf3fd('0x27'),_0x1b3bb6,_0xf3fd('0x21'));_0x31e7f0(_0x3cca16[_0xf3fd('0x28')][_0xf3fd('0x26')]);}})['catch'](function(_0x5cda25){logger[_0xf3fd('0x24')](_0xf3fd('0x27'),_0x1b3bb6,_0x5cda25);_0x326c2c(_0x5cda25);});});}function respondWithStatusCode(_0xf029ce,_0x3bd1d5){_0x3bd1d5=_0x3bd1d5||0xcc;return function(_0x3e2ded){if(_0x3e2ded){return _0xf029ce['sendStatus'](_0x3bd1d5);}return _0xf029ce[_0xf3fd('0x29')](_0x3bd1d5)['end']();};}function respondWithResult(_0x4d3a1c,_0x3a12de){_0x3a12de=_0x3a12de||0xc8;return function(_0x46c6ef){if(_0x46c6ef){return _0x4d3a1c[_0xf3fd('0x29')](_0x3a12de)[_0xf3fd('0x2a')](_0x46c6ef);}};}function respondWithFilteredResult(_0x44f251,_0x595a37){return function(_0xca0b92){if(_0xca0b92){var _0x4d14cd=_0xca0b92[_0xf3fd('0x2b')],_0x1cff57=_0x595a37['offset'],_0x5b889c=_0x595a37[_0xf3fd('0x2c')]+_0x595a37[_0xf3fd('0x2d')],_0x59b68d;if(_0x5b889c>=_0x4d14cd){_0x5b889c=_0x4d14cd;_0x59b68d=0xc8;}else{_0x59b68d=0xce;}_0x44f251[_0xf3fd('0x29')](_0x59b68d);return _0x44f251[_0xf3fd('0x2e')]('Content-Range',_0x1cff57+'-'+_0x5b889c+'/'+_0x4d14cd)[_0xf3fd('0x2a')](_0xca0b92);}return null;};}function patchUpdates(_0x31efbd){return function(_0x1ce9d2){try{jsonpatch[_0xf3fd('0x2f')](_0x1ce9d2,_0x31efbd,!![]);}catch(_0x3e4e96){return BPromise[_0xf3fd('0x30')](_0x3e4e96);}return _0x1ce9d2[_0xf3fd('0x31')]();};}function saveUpdates(_0x4c3dcf,_0x2edccf){return function(_0x38b0a0){if(_0x38b0a0){return _0x38b0a0[_0xf3fd('0x32')](_0x4c3dcf)[_0xf3fd('0x1f')](function(_0x2f7c13){return _0x2f7c13;});}return null;};}function removeEntity(_0x2a0ef1,_0x2feb03){return function(_0x293b96){if(_0x293b96){return _0x293b96[_0xf3fd('0x33')]()[_0xf3fd('0x1f')](function(){_0x2a0ef1[_0xf3fd('0x29')](0xcc)[_0xf3fd('0x34')]();});}};}function handleEntityNotFound(_0x54850f,_0x5ee5d5){return function(_0x1fe032){if(!_0x1fe032){_0x54850f[_0xf3fd('0x35')](0x194);}return _0x1fe032;};}function handleError(_0x5bae2a,_0xe38249){_0xe38249=_0xe38249||0x1f4;return function(_0x1fb249){logger[_0xf3fd('0x24')](_0x1fb249[_0xf3fd('0x36')]);if(_0x1fb249[_0xf3fd('0x37')]){delete _0x1fb249[_0xf3fd('0x37')];}_0x5bae2a['status'](_0xe38249)[_0xf3fd('0x38')](_0x1fb249);};}exports[_0xf3fd('0x39')]=function(_0x19afae,_0x15a10a){var _0x4679f6={},_0x4b4b4b={},_0x14aef2={'count':0x0,'rows':[]};var _0x118203=db['SalesforceConfiguration'][_0xf3fd('0x3a')];_0x4b4b4b['model']=_[_0xf3fd('0x3b')](_0x118203);_0x4b4b4b[_0xf3fd('0x3c')]=_[_0xf3fd('0x3b')](_0x19afae[_0xf3fd('0x3c')]);_0x4b4b4b[_0xf3fd('0x3d')]=_['intersection'](_0x4b4b4b[_0xf3fd('0x3e')],_0x4b4b4b[_0xf3fd('0x3c')]);_0x4679f6[_0xf3fd('0x3f')]=_[_0xf3fd('0x40')](_0x4b4b4b[_0xf3fd('0x3e')],qs['fields'](_0x19afae[_0xf3fd('0x3c')][_0xf3fd('0x41')]));_0x4679f6[_0xf3fd('0x3f')]=_0x4679f6[_0xf3fd('0x3f')][_0xf3fd('0x42')]?_0x4679f6['attributes']:_0x4b4b4b['model'];if(!_0x19afae[_0xf3fd('0x3c')][_0xf3fd('0x43')](_0xf3fd('0x44'))){_0x4679f6[_0xf3fd('0x2d')]=qs[_0xf3fd('0x2d')](_0x19afae['query'][_0xf3fd('0x2d')]);_0x4679f6[_0xf3fd('0x2c')]=qs['offset'](_0x19afae[_0xf3fd('0x3c')][_0xf3fd('0x2c')]);}_0x4679f6[_0xf3fd('0x45')]=qs['sort'](_0x19afae[_0xf3fd('0x3c')]['sort']);_0x4679f6[_0xf3fd('0x46')]=qs[_0xf3fd('0x3d')](_[_0xf3fd('0x47')](_0x19afae[_0xf3fd('0x3c')],_0x4b4b4b[_0xf3fd('0x3d')]));if(_0x19afae['query']['filter']){_0x4679f6[_0xf3fd('0x46')]=_[_0xf3fd('0x48')](_0x4679f6[_0xf3fd('0x46')],{'$or':_[_0xf3fd('0x49')](_0x118203,function(_0x24cec4){if(_0x24cec4['type'][_0xf3fd('0x4a')]!==_0xf3fd('0x4b')){var _0x95988e={};_0x95988e[_0x24cec4[_0xf3fd('0x4c')]]={'$like':'%'+_0x19afae[_0xf3fd('0x3c')][_0xf3fd('0x4d')]+'%'};return _0x95988e;}})});}_0x4679f6=_[_0xf3fd('0x48')]({},_0x4679f6,_0x19afae[_0xf3fd('0x4e')]);var _0x163591={'where':_0x4679f6[_0xf3fd('0x46')]};return db[_0xf3fd('0x4f')]['count'](_0x163591)['then'](function(_0x3c1c47){_0x14aef2[_0xf3fd('0x2b')]=_0x3c1c47;if(_0x19afae[_0xf3fd('0x3c')][_0xf3fd('0x50')]){_0x4679f6[_0xf3fd('0x51')]=[{'all':!![]}];}return db[_0xf3fd('0x4f')][_0xf3fd('0x52')](_0x4679f6);})['then'](function(_0x14b3dd){_0x14aef2['rows']=_0x14b3dd;return _0x14aef2;})['then'](respondWithFilteredResult(_0x15a10a,_0x4679f6))['catch'](handleError(_0x15a10a,null));};exports[_0xf3fd('0x53')]=function(_0x46d333,_0x4eb911){var _0x767ab2={'raw':![],'where':{'id':_0x46d333[_0xf3fd('0x54')]['id']}},_0xd3e7e4={};_0xd3e7e4['model']=_[_0xf3fd('0x3b')](db[_0xf3fd('0x4f')][_0xf3fd('0x3a')]);_0xd3e7e4[_0xf3fd('0x3c')]=_[_0xf3fd('0x3b')](_0x46d333[_0xf3fd('0x3c')]);_0xd3e7e4['filters']=_['intersection'](_0xd3e7e4[_0xf3fd('0x3e')],_0xd3e7e4['query']);_0x767ab2[_0xf3fd('0x3f')]=_[_0xf3fd('0x40')](_0xd3e7e4[_0xf3fd('0x3e')],qs[_0xf3fd('0x41')](_0x46d333['query'][_0xf3fd('0x41')]));_0x767ab2[_0xf3fd('0x3f')]=_0x767ab2[_0xf3fd('0x3f')][_0xf3fd('0x42')]?_0x767ab2[_0xf3fd('0x3f')]:_0xd3e7e4[_0xf3fd('0x3e')];if(_0x46d333[_0xf3fd('0x3c')][_0xf3fd('0x50')]){_0x767ab2['include']=[{'all':!![]}];}_0x767ab2=_[_0xf3fd('0x48')]({},_0x767ab2,_0x46d333[_0xf3fd('0x4e')]);return db['SalesforceConfiguration'][_0xf3fd('0x55')](_0x767ab2)[_0xf3fd('0x1f')](handleEntityNotFound(_0x4eb911,null))[_0xf3fd('0x1f')](respondWithResult(_0x4eb911,null))['catch'](handleError(_0x4eb911,null));};exports['create']=function(_0x5d658c,_0x26d6c5){return db[_0xf3fd('0x4f')][_0xf3fd('0x56')](_0x5d658c[_0xf3fd('0x57')],{})[_0xf3fd('0x1f')](respondWithResult(_0x26d6c5,0xc9))['catch'](handleError(_0x26d6c5,null));};exports[_0xf3fd('0x32')]=function(_0x13e47b,_0x1ef62a){if(_0x13e47b[_0xf3fd('0x57')]['id']){delete _0x13e47b[_0xf3fd('0x57')]['id'];}return db[_0xf3fd('0x4f')][_0xf3fd('0x55')]({'where':{'id':_0x13e47b[_0xf3fd('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ef62a,null))[_0xf3fd('0x1f')](saveUpdates(_0x13e47b[_0xf3fd('0x57')],null))[_0xf3fd('0x1f')](respondWithResult(_0x1ef62a,null))[_0xf3fd('0x58')](handleError(_0x1ef62a,null));};exports['destroy']=function(_0x4ad762,_0x3c33b9){return db[_0xf3fd('0x4f')][_0xf3fd('0x55')]({'where':{'id':_0x4ad762[_0xf3fd('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c33b9,null))[_0xf3fd('0x1f')](removeEntity(_0x3c33b9,null))[_0xf3fd('0x58')](handleError(_0x3c33b9,null));};exports[_0xf3fd('0x59')]=function(_0x5a6df0,_0x450ec6,_0x11a661){var _0x21ccd0={};var _0x16b2a7={};var _0x4ca86f;var _0x132102;return db[_0xf3fd('0x4f')][_0xf3fd('0x5a')]({'where':{'id':_0x5a6df0[_0xf3fd('0x54')]['id']}})['then'](handleEntityNotFound(_0x450ec6,null))[_0xf3fd('0x1f')](function(_0xcce7ce){if(_0xcce7ce){_0x4ca86f=_0xcce7ce;_0x16b2a7[_0xf3fd('0x3e')]=_[_0xf3fd('0x3b')](db[_0xf3fd('0x5b')][_0xf3fd('0x3a')]);_0x16b2a7[_0xf3fd('0x3c')]=_['keys'](_0x5a6df0[_0xf3fd('0x3c')]);_0x16b2a7[_0xf3fd('0x3d')]=_[_0xf3fd('0x40')](_0x16b2a7[_0xf3fd('0x3e')],_0x16b2a7[_0xf3fd('0x3c')]);_0x21ccd0[_0xf3fd('0x3f')]=_[_0xf3fd('0x40')](_0x16b2a7['model'],qs['fields'](_0x5a6df0[_0xf3fd('0x3c')]['fields']));_0x21ccd0['attributes']=_0x21ccd0['attributes'][_0xf3fd('0x42')]?_0x21ccd0[_0xf3fd('0x3f')]:_0x16b2a7[_0xf3fd('0x3e')];_0x21ccd0[_0xf3fd('0x45')]=qs[_0xf3fd('0x5c')](_0x5a6df0[_0xf3fd('0x3c')][_0xf3fd('0x5c')]);_0x21ccd0['where']=qs['filters'](_[_0xf3fd('0x47')](_0x5a6df0[_0xf3fd('0x3c')],_0x16b2a7['filters']));if(_0x5a6df0[_0xf3fd('0x3c')]['filter']){_0x21ccd0[_0xf3fd('0x46')]=_[_0xf3fd('0x48')](_0x21ccd0[_0xf3fd('0x46')],{'$or':_[_0xf3fd('0x49')](_0x21ccd0[_0xf3fd('0x3f')],function(_0x2abb6d){var _0x5ce027={};_0x5ce027[_0x2abb6d]={'$like':'%'+_0x5a6df0['query'][_0xf3fd('0x4d')]+'%'};return _0x5ce027;})});}_0x21ccd0=_['merge']({},_0x21ccd0,_0x5a6df0[_0xf3fd('0x4e')]);return _0x4ca86f['getFields'](_0x21ccd0);}})[_0xf3fd('0x1f')](function(_0x1635f5){if(_0x1635f5){_0x132102=_0x1635f5[_0xf3fd('0x42')];if(!_0x5a6df0[_0xf3fd('0x3c')]['hasOwnProperty']('nolimit')){_0x21ccd0[_0xf3fd('0x2d')]=qs[_0xf3fd('0x2d')](_0x5a6df0[_0xf3fd('0x3c')][_0xf3fd('0x2d')]);_0x21ccd0['offset']=qs[_0xf3fd('0x2c')](_0x5a6df0['query'][_0xf3fd('0x2c')]);}return _0x4ca86f[_0xf3fd('0x59')](_0x21ccd0);}})[_0xf3fd('0x1f')](function(_0x1e9673){if(_0x1e9673){return _0x1e9673?{'count':_0x132102,'rows':_0x1e9673}:null;}})[_0xf3fd('0x1f')](respondWithResult(_0x450ec6,null))[_0xf3fd('0x58')](handleError(_0x450ec6,null));};exports[_0xf3fd('0x5d')]=function(_0x4c1e3f,_0x232c81,_0x30532d){var _0x195b91={};var _0x59b3f2={};var _0x43c149;var _0x48792f;return db[_0xf3fd('0x4f')][_0xf3fd('0x5a')]({'where':{'id':_0x4c1e3f['params']['id']}})[_0xf3fd('0x1f')](handleEntityNotFound(_0x232c81,null))[_0xf3fd('0x1f')](function(_0x3a66b3){if(_0x3a66b3){_0x43c149=_0x3a66b3;_0x59b3f2['model']=_['keys'](db[_0xf3fd('0x5b')][_0xf3fd('0x3a')]);_0x59b3f2[_0xf3fd('0x3c')]=_['keys'](_0x4c1e3f[_0xf3fd('0x3c')]);_0x59b3f2[_0xf3fd('0x3d')]=_[_0xf3fd('0x40')](_0x59b3f2['model'],_0x59b3f2['query']);_0x195b91['attributes']=_[_0xf3fd('0x40')](_0x59b3f2[_0xf3fd('0x3e')],qs[_0xf3fd('0x41')](_0x4c1e3f[_0xf3fd('0x3c')]['fields']));_0x195b91[_0xf3fd('0x3f')]=_0x195b91[_0xf3fd('0x3f')][_0xf3fd('0x42')]?_0x195b91[_0xf3fd('0x3f')]:_0x59b3f2[_0xf3fd('0x3e')];_0x195b91['order']=qs[_0xf3fd('0x5c')](_0x4c1e3f[_0xf3fd('0x3c')]['sort']);_0x195b91[_0xf3fd('0x46')]=qs[_0xf3fd('0x3d')](_[_0xf3fd('0x47')](_0x4c1e3f['query'],_0x59b3f2[_0xf3fd('0x3d')]));if(_0x4c1e3f[_0xf3fd('0x3c')][_0xf3fd('0x4d')]){_0x195b91[_0xf3fd('0x46')]=_[_0xf3fd('0x48')](_0x195b91[_0xf3fd('0x46')],{'$or':_[_0xf3fd('0x49')](_0x195b91[_0xf3fd('0x3f')],function(_0x25d85c){var _0x94b9a7={};_0x94b9a7[_0x25d85c]={'$like':'%'+_0x4c1e3f[_0xf3fd('0x3c')][_0xf3fd('0x4d')]+'%'};return _0x94b9a7;})});}_0x195b91=_[_0xf3fd('0x48')]({},_0x195b91,_0x4c1e3f[_0xf3fd('0x4e')]);return _0x43c149['getSubjects'](_0x195b91);}})['then'](function(_0x29ff7f){if(_0x29ff7f){_0x48792f=_0x29ff7f[_0xf3fd('0x42')];if(!_0x4c1e3f['query']['hasOwnProperty'](_0xf3fd('0x44'))){_0x195b91['limit']=qs[_0xf3fd('0x2d')](_0x4c1e3f[_0xf3fd('0x3c')][_0xf3fd('0x2d')]);_0x195b91[_0xf3fd('0x2c')]=qs[_0xf3fd('0x2c')](_0x4c1e3f[_0xf3fd('0x3c')][_0xf3fd('0x2c')]);}return _0x43c149[_0xf3fd('0x5d')](_0x195b91);}})[_0xf3fd('0x1f')](function(_0x2a8f14){if(_0x2a8f14){return _0x2a8f14?{'count':_0x48792f,'rows':_0x2a8f14}:null;}})[_0xf3fd('0x1f')](respondWithResult(_0x232c81,null))[_0xf3fd('0x58')](handleError(_0x232c81,null));};exports[_0xf3fd('0x5e')]=function(_0x17ef9f,_0x2a4ecd,_0x3d07e2){var _0x493871={};var _0x1e43d2={};var _0x4dbf22;var _0x4ed0f4;return db[_0xf3fd('0x4f')][_0xf3fd('0x5a')]({'where':{'id':_0x17ef9f[_0xf3fd('0x54')]['id']}})[_0xf3fd('0x1f')](handleEntityNotFound(_0x2a4ecd,null))['then'](function(_0x1b1a65){if(_0x1b1a65){_0x4dbf22=_0x1b1a65;_0x1e43d2[_0xf3fd('0x3e')]=_[_0xf3fd('0x3b')](db[_0xf3fd('0x5b')][_0xf3fd('0x3a')]);_0x1e43d2['query']=_[_0xf3fd('0x3b')](_0x17ef9f[_0xf3fd('0x3c')]);_0x1e43d2['filters']=_['intersection'](_0x1e43d2[_0xf3fd('0x3e')],_0x1e43d2[_0xf3fd('0x3c')]);_0x493871['attributes']=_[_0xf3fd('0x40')](_0x1e43d2[_0xf3fd('0x3e')],qs[_0xf3fd('0x41')](_0x17ef9f[_0xf3fd('0x3c')][_0xf3fd('0x41')]));_0x493871[_0xf3fd('0x3f')]=_0x493871[_0xf3fd('0x3f')]['length']?_0x493871[_0xf3fd('0x3f')]:_0x1e43d2[_0xf3fd('0x3e')];_0x493871[_0xf3fd('0x45')]=qs['sort'](_0x17ef9f['query'][_0xf3fd('0x5c')]);_0x493871[_0xf3fd('0x46')]=qs[_0xf3fd('0x3d')](_[_0xf3fd('0x47')](_0x17ef9f[_0xf3fd('0x3c')],_0x1e43d2[_0xf3fd('0x3d')]));if(_0x17ef9f[_0xf3fd('0x3c')]['filter']){_0x493871[_0xf3fd('0x46')]=_['merge'](_0x493871[_0xf3fd('0x46')],{'$or':_[_0xf3fd('0x49')](_0x493871[_0xf3fd('0x3f')],function(_0x11a513){var _0x552eca={};_0x552eca[_0x11a513]={'$like':'%'+_0x17ef9f[_0xf3fd('0x3c')][_0xf3fd('0x4d')]+'%'};return _0x552eca;})});}_0x493871=_[_0xf3fd('0x48')]({},_0x493871,_0x17ef9f[_0xf3fd('0x4e')]);return _0x4dbf22[_0xf3fd('0x5e')](_0x493871);}})[_0xf3fd('0x1f')](function(_0x374348){if(_0x374348){_0x4ed0f4=_0x374348[_0xf3fd('0x42')];if(!_0x17ef9f[_0xf3fd('0x3c')][_0xf3fd('0x43')](_0xf3fd('0x44'))){_0x493871[_0xf3fd('0x2d')]=qs[_0xf3fd('0x2d')](_0x17ef9f[_0xf3fd('0x3c')]['limit']);_0x493871[_0xf3fd('0x2c')]=qs[_0xf3fd('0x2c')](_0x17ef9f[_0xf3fd('0x3c')][_0xf3fd('0x2c')]);}return _0x4dbf22[_0xf3fd('0x5e')](_0x493871);}})['then'](function(_0x22c92f){if(_0x22c92f){return _0x22c92f?{'count':_0x4ed0f4,'rows':_0x22c92f}:null;}})[_0xf3fd('0x1f')](respondWithResult(_0x2a4ecd,null))[_0xf3fd('0x58')](handleError(_0x2a4ecd,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index b78231a..dd65a1b 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 _0xb77b=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1fba7e,_0x274218){var _0x107358=function(_0x43d3db){while(--_0x43d3db){_0x1fba7e['push'](_0x1fba7e['shift']());}};_0x107358(++_0x274218);}(_0xb77b,0x159));var _0xbb77=function(_0x4523ee,_0x28fee9){_0x4523ee=_0x4523ee-0x0;var _0x1adc71=_0xb77b[_0x4523ee];return _0x1adc71;};'use strict';var _=require(_0xbb77('0x0'));var util=require(_0xbb77('0x1'));var logger=require(_0xbb77('0x2'))(_0xbb77('0x3'));var moment=require(_0xbb77('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb77('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb77('0x6'));var config=require(_0xbb77('0x7'));var attributes=require(_0xbb77('0x8'));module[_0xbb77('0x9')]=function(_0x3ae87a,_0xe949ef){return _0x3ae87a[_0xbb77('0xa')](_0xbb77('0xb'),attributes,{'tableName':_0xbb77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b9=['../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe5b9,0x1cd));var _0x9e5b=function(_0x48aba3,_0x2663d7){_0x48aba3=_0x48aba3-0x0;var _0x54ecce=_0xe5b9[_0x48aba3];return _0x54ecce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9e5b('0x0'))(_0x9e5b('0x1'));var moment=require(_0x9e5b('0x2'));var BPromise=require(_0x9e5b('0x3'));var rp=require(_0x9e5b('0x4'));var fs=require('fs');var path=require(_0x9e5b('0x5'));var rimraf=require(_0x9e5b('0x6'));var config=require(_0x9e5b('0x7'));var attributes=require(_0x9e5b('0x8'));module['exports']=function(_0x5a0637,_0x35186c){return _0x5a0637[_0x9e5b('0x9')](_0x9e5b('0xa'),attributes,{'tableName':_0x9e5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 6fb5f2c..9a5c8f4 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x814b=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x814b,0x1a2));var _0xb814=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x814b[_0x42bfb7];return _0x5c497d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4e00568..269da70 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 _0xa2c2=['../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','util','connect-timeout','Router'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xa2c2,0xdd));var _0x2a2c=function(_0x40c6c4,_0xe56185){_0x40c6c4=_0x40c6c4-0x0;var _0x19f141=_0xa2c2[_0x40c6c4];return _0x19f141;};'use strict';var multer=require('multer');var util=require(_0x2a2c('0x0'));var path=require('path');var timeout=require(_0x2a2c('0x1'));var express=require('express');var router=express[_0x2a2c('0x2')]();var auth=require(_0x2a2c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2a2c('0x4'));var controller=require(_0x2a2c('0x5'));router[_0x2a2c('0x6')]('/',auth[_0x2a2c('0x7')](),controller[_0x2a2c('0x8')]);router[_0x2a2c('0x6')]('/:id',auth[_0x2a2c('0x7')](),controller[_0x2a2c('0x9')]);router[_0x2a2c('0xa')]('/',auth['isAuthenticated'](),controller[_0x2a2c('0xb')]);router[_0x2a2c('0xc')](_0x2a2c('0xd'),auth[_0x2a2c('0x7')](),controller['update']);router['delete'](_0x2a2c('0xd'),auth[_0x2a2c('0x7')](),controller[_0x2a2c('0xe')]);module[_0x2a2c('0xf')]=router; \ No newline at end of file +var _0xe89f=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe89f,0x7b));var _0xfe89=function(_0x5eec9d,_0x1544e8){_0x5eec9d=_0x5eec9d-0x0;var _0x56cbdf=_0xe89f[_0x5eec9d];return _0x56cbdf;};'use strict';var multer=require(_0xfe89('0x0'));var util=require(_0xfe89('0x1'));var path=require(_0xfe89('0x2'));var timeout=require(_0xfe89('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xfe89('0x4'));var interaction=require(_0xfe89('0x5'));var config=require(_0xfe89('0x6'));var controller=require(_0xfe89('0x7'));router['get']('/',auth[_0xfe89('0x8')](),controller['index']);router['get'](_0xfe89('0x9'),auth[_0xfe89('0x8')](),controller[_0xfe89('0xa')]);router[_0xfe89('0xb')]('/',auth[_0xfe89('0x8')](),controller[_0xfe89('0xc')]);router[_0xfe89('0xd')]('/:id',auth[_0xfe89('0x8')](),controller[_0xfe89('0xe')]);router['delete'](_0xfe89('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe89('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b89c533..0219a2c 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 _0x151c=['variable','sequelize','exports','string','customVariable','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x151c,0x12d));var _0xc151=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x151c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc151('0x0'));module[_0xc151('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc151('0x2'),'variable',_0xc151('0x3'),'keyValue'),'defaultValue':_0xc151('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc151('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xc151('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0xc151('0x4')]},'idField':{'type':Sequelize[_0xc151('0x4')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d43=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x4bcf14,_0x1e1a26){var _0x9acc80=function(_0x20b611){while(--_0x20b611){_0x4bcf14['push'](_0x4bcf14['shift']());}};_0x9acc80(++_0x1e1a26);}(_0x3d43,0xc6));var _0x33d4=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x3d43[_0x152121];return _0x592a85;};'use strict';var Sequelize=require(_0x33d4('0x0'));module[_0x33d4('0x1')]={'type':{'type':Sequelize[_0x33d4('0x2')](_0x33d4('0x3'),_0x33d4('0x4'),_0x33d4('0x5'),_0x33d4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x33d4('0x7')]},'key':{'type':Sequelize[_0x33d4('0x7')]},'keyType':{'type':Sequelize[_0x33d4('0x2')](_0x33d4('0x3'),_0x33d4('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x33d4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f67ffb3..e65c4e1 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 _0x0b37=['merge','map','VIRTUAL','options','findAll','catch','show','params','rawAttributes','includeAll','include','find','body','destroy','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','SalesforceField','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x0b37,0x15d));var _0x70b3=function(_0x1f3f61,_0x5031a9){_0x1f3f61=_0x1f3f61-0x0;var _0x1069ce=_0x0b37[_0x1f3f61];return _0x1069ce;};'use strict';var pdf=require(_0x70b3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x70b3('0x1'));var moment=require(_0x70b3('0x2'));var BPromise=require(_0x70b3('0x3'));var Mustache=require(_0x70b3('0x4'));var util=require(_0x70b3('0x5'));var path=require(_0x70b3('0x6'));var sox=require(_0x70b3('0x7'));var csv=require(_0x70b3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x70b3('0x9'));var squel=require(_0x70b3('0xa'));var crypto=require(_0x70b3('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x70b3('0xc'));var Redis=require(_0x70b3('0xd'));var authService=require(_0x70b3('0xe'));var qs=require(_0x70b3('0xf'));var hardwareService=require(_0x70b3('0x10'));var logger=require(_0x70b3('0x11'))('api');var utils=require(_0x70b3('0x12'));var config=require(_0x70b3('0x13'));var db=require(_0x70b3('0x14'))['db'];function respondWithStatusCode(_0x115908,_0x5a692a){_0x5a692a=_0x5a692a||0xcc;return function(_0x22b8ab){if(_0x22b8ab){return _0x115908[_0x70b3('0x15')](_0x5a692a);}return _0x115908[_0x70b3('0x16')](_0x5a692a)[_0x70b3('0x17')]();};}function respondWithResult(_0x4b567e,_0x370f48){_0x370f48=_0x370f48||0xc8;return function(_0x3d6e9b){if(_0x3d6e9b){return _0x4b567e['status'](_0x370f48)[_0x70b3('0x18')](_0x3d6e9b);}};}function respondWithFilteredResult(_0x4f013b,_0xeffefd){return function(_0x28e349){if(_0x28e349){var _0x2ee2ed=_0x28e349[_0x70b3('0x19')],_0x2895a5=_0xeffefd[_0x70b3('0x1a')],_0x1e5bfc=_0xeffefd[_0x70b3('0x1a')]+_0xeffefd[_0x70b3('0x1b')],_0x4488a1;if(_0x1e5bfc>=_0x2ee2ed){_0x1e5bfc=_0x2ee2ed;_0x4488a1=0xc8;}else{_0x4488a1=0xce;}_0x4f013b[_0x70b3('0x16')](_0x4488a1);return _0x4f013b[_0x70b3('0x1c')](_0x70b3('0x1d'),_0x2895a5+'-'+_0x1e5bfc+'/'+_0x2ee2ed)['json'](_0x28e349);}return null;};}function patchUpdates(_0x59e2a4){return function(_0x5c43a1){try{jsonpatch[_0x70b3('0x1e')](_0x5c43a1,_0x59e2a4,!![]);}catch(_0x4a894d){return BPromise[_0x70b3('0x1f')](_0x4a894d);}return _0x5c43a1[_0x70b3('0x20')]();};}function saveUpdates(_0x4bc8bb,_0x51c4c1){return function(_0x545ec9){if(_0x545ec9){return _0x545ec9[_0x70b3('0x21')](_0x4bc8bb)[_0x70b3('0x22')](function(_0x36c246){return _0x36c246;});}return null;};}function removeEntity(_0x1f0b9e,_0x3d9dc2){return function(_0x416349){if(_0x416349){return _0x416349['destroy']()[_0x70b3('0x22')](function(){_0x1f0b9e[_0x70b3('0x16')](0xcc)[_0x70b3('0x17')]();});}};}function handleEntityNotFound(_0x4c7c30,_0x741490){return function(_0x3341d9){if(!_0x3341d9){_0x4c7c30[_0x70b3('0x15')](0x194);}return _0x3341d9;};}function handleError(_0x5060ae,_0x118c9b){_0x118c9b=_0x118c9b||0x1f4;return function(_0x97e81b){logger[_0x70b3('0x23')](_0x97e81b[_0x70b3('0x24')]);if(_0x97e81b[_0x70b3('0x25')]){delete _0x97e81b[_0x70b3('0x25')];}_0x5060ae[_0x70b3('0x16')](_0x118c9b)['send'](_0x97e81b);};}exports[_0x70b3('0x26')]=function(_0x10e415,_0x4a844c){var _0x1cdacd={},_0x4026ec={},_0x564cbc={'count':0x0,'rows':[]};var _0x3b560f=db[_0x70b3('0x27')]['rawAttributes'];_0x4026ec[_0x70b3('0x28')]=_[_0x70b3('0x29')](_0x3b560f);_0x4026ec['query']=_[_0x70b3('0x29')](_0x10e415[_0x70b3('0x2a')]);_0x4026ec[_0x70b3('0x2b')]=_[_0x70b3('0x2c')](_0x4026ec[_0x70b3('0x28')],_0x4026ec[_0x70b3('0x2a')]);_0x1cdacd[_0x70b3('0x2d')]=_[_0x70b3('0x2c')](_0x4026ec[_0x70b3('0x28')],qs['fields'](_0x10e415[_0x70b3('0x2a')][_0x70b3('0x2e')]));_0x1cdacd[_0x70b3('0x2d')]=_0x1cdacd['attributes'][_0x70b3('0x2f')]?_0x1cdacd['attributes']:_0x4026ec[_0x70b3('0x28')];if(!_0x10e415[_0x70b3('0x2a')]['hasOwnProperty']('nolimit')){_0x1cdacd[_0x70b3('0x1b')]=qs[_0x70b3('0x1b')](_0x10e415[_0x70b3('0x2a')]['limit']);_0x1cdacd[_0x70b3('0x1a')]=qs[_0x70b3('0x1a')](_0x10e415[_0x70b3('0x2a')][_0x70b3('0x1a')]);}_0x1cdacd[_0x70b3('0x30')]=qs[_0x70b3('0x31')](_0x10e415[_0x70b3('0x2a')][_0x70b3('0x31')]);_0x1cdacd[_0x70b3('0x32')]=qs['filters'](_[_0x70b3('0x33')](_0x10e415['query'],_0x4026ec[_0x70b3('0x2b')]));if(_0x10e415[_0x70b3('0x2a')][_0x70b3('0x34')]){_0x1cdacd[_0x70b3('0x32')]=_[_0x70b3('0x35')](_0x1cdacd[_0x70b3('0x32')],{'$or':_[_0x70b3('0x36')](_0x3b560f,function(_0x2c445d){if(_0x2c445d['type']['key']!==_0x70b3('0x37')){var _0x57b52c={};_0x57b52c[_0x2c445d['field']]={'$like':'%'+_0x10e415[_0x70b3('0x2a')][_0x70b3('0x34')]+'%'};return _0x57b52c;}})});}_0x1cdacd=_[_0x70b3('0x35')]({},_0x1cdacd,_0x10e415[_0x70b3('0x38')]);var _0x5a4c22={'where':_0x1cdacd[_0x70b3('0x32')]};return db[_0x70b3('0x27')]['count'](_0x5a4c22)['then'](function(_0x40ad94){_0x564cbc[_0x70b3('0x19')]=_0x40ad94;if(_0x10e415['query']['includeAll']){_0x1cdacd['include']=[{'all':!![]}];}return db[_0x70b3('0x27')][_0x70b3('0x39')](_0x1cdacd);})[_0x70b3('0x22')](function(_0x1355fd){_0x564cbc['rows']=_0x1355fd;return _0x564cbc;})[_0x70b3('0x22')](respondWithFilteredResult(_0x4a844c,_0x1cdacd))[_0x70b3('0x3a')](handleError(_0x4a844c,null));};exports[_0x70b3('0x3b')]=function(_0x4298db,_0x2b7c07){var _0x14b4f0={'raw':!![],'where':{'id':_0x4298db[_0x70b3('0x3c')]['id']}},_0x234298={};_0x234298[_0x70b3('0x28')]=_[_0x70b3('0x29')](db[_0x70b3('0x27')][_0x70b3('0x3d')]);_0x234298['query']=_[_0x70b3('0x29')](_0x4298db[_0x70b3('0x2a')]);_0x234298[_0x70b3('0x2b')]=_[_0x70b3('0x2c')](_0x234298[_0x70b3('0x28')],_0x234298[_0x70b3('0x2a')]);_0x14b4f0[_0x70b3('0x2d')]=_[_0x70b3('0x2c')](_0x234298['model'],qs[_0x70b3('0x2e')](_0x4298db['query'][_0x70b3('0x2e')]));_0x14b4f0['attributes']=_0x14b4f0[_0x70b3('0x2d')][_0x70b3('0x2f')]?_0x14b4f0[_0x70b3('0x2d')]:_0x234298[_0x70b3('0x28')];if(_0x4298db['query'][_0x70b3('0x3e')]){_0x14b4f0[_0x70b3('0x3f')]=[{'all':!![]}];}_0x14b4f0=_[_0x70b3('0x35')]({},_0x14b4f0,_0x4298db[_0x70b3('0x38')]);return db[_0x70b3('0x27')][_0x70b3('0x40')](_0x14b4f0)[_0x70b3('0x22')](handleEntityNotFound(_0x2b7c07,null))['then'](respondWithResult(_0x2b7c07,null))[_0x70b3('0x3a')](handleError(_0x2b7c07,null));};exports['create']=function(_0x49217,_0x2ae610){return db[_0x70b3('0x27')]['create'](_0x49217['body'],{})[_0x70b3('0x22')](respondWithResult(_0x2ae610,0xc9))['catch'](handleError(_0x2ae610,null));};exports[_0x70b3('0x21')]=function(_0x133bda,_0x166ca5){if(_0x133bda[_0x70b3('0x41')]['id']){delete _0x133bda['body']['id'];}return db[_0x70b3('0x27')][_0x70b3('0x40')]({'where':{'id':_0x133bda[_0x70b3('0x3c')]['id']}})[_0x70b3('0x22')](handleEntityNotFound(_0x166ca5,null))[_0x70b3('0x22')](saveUpdates(_0x133bda[_0x70b3('0x41')],null))[_0x70b3('0x22')](respondWithResult(_0x166ca5,null))[_0x70b3('0x3a')](handleError(_0x166ca5,null));};exports[_0x70b3('0x42')]=function(_0x307d1d,_0x4eb9d9){return db[_0x70b3('0x27')][_0x70b3('0x40')]({'where':{'id':_0x307d1d['params']['id']}})[_0x70b3('0x22')](handleEntityNotFound(_0x4eb9d9,null))[_0x70b3('0x22')](removeEntity(_0x4eb9d9,null))['catch'](handleError(_0x4eb9d9,null));}; \ No newline at end of file +var _0x975b=['squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','SalesforceField','includeAll','include','rows','catch','show','params','body','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash'];(function(_0x2636ba,_0x307354){var _0x5c4156=function(_0x2d1d0f){while(--_0x2d1d0f){_0x2636ba['push'](_0x2636ba['shift']());}};_0x5c4156(++_0x307354);}(_0x975b,0xc0));var _0xb975=function(_0x581fd3,_0x1f5486){_0x581fd3=_0x581fd3-0x0;var _0x583893=_0x975b[_0x581fd3];return _0x583893;};'use strict';var pdf=require(_0xb975('0x0'));var emlformat=require(_0xb975('0x1'));var rimraf=require(_0xb975('0x2'));var zipdir=require(_0xb975('0x3'));var jsonpatch=require(_0xb975('0x4'));var rp=require(_0xb975('0x5'));var moment=require('moment');var BPromise=require(_0xb975('0x6'));var Mustache=require('mustache');var util=require(_0xb975('0x7'));var path=require(_0xb975('0x8'));var sox=require('sox');var csv=require(_0xb975('0x9'));var ejs=require(_0xb975('0xa'));var fs=require('fs');var _=require(_0xb975('0xb'));var squel=require(_0xb975('0xc'));var crypto=require(_0xb975('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb975('0x9'));var querystring=require('querystring');var Papa=require(_0xb975('0xe'));var Redis=require('ioredis');var authService=require(_0xb975('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb975('0x10'));var logger=require(_0xb975('0x11'))(_0xb975('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb975('0x13'))['db'];function respondWithStatusCode(_0x349981,_0x30e497){_0x30e497=_0x30e497||0xcc;return function(_0x18889f){if(_0x18889f){return _0x349981['sendStatus'](_0x30e497);}return _0x349981[_0xb975('0x14')](_0x30e497)['end']();};}function respondWithResult(_0x5bf016,_0x161681){_0x161681=_0x161681||0xc8;return function(_0x51c375){if(_0x51c375){return _0x5bf016[_0xb975('0x14')](_0x161681)[_0xb975('0x15')](_0x51c375);}};}function respondWithFilteredResult(_0x39546e,_0x2caed5){return function(_0x57f048){if(_0x57f048){var _0x38c674=_0x57f048[_0xb975('0x16')],_0x7102cf=_0x2caed5[_0xb975('0x17')],_0x210c0c=_0x2caed5[_0xb975('0x17')]+_0x2caed5[_0xb975('0x18')],_0x1cda70;if(_0x210c0c>=_0x38c674){_0x210c0c=_0x38c674;_0x1cda70=0xc8;}else{_0x1cda70=0xce;}_0x39546e['status'](_0x1cda70);return _0x39546e[_0xb975('0x19')](_0xb975('0x1a'),_0x7102cf+'-'+_0x210c0c+'/'+_0x38c674)[_0xb975('0x15')](_0x57f048);}return null;};}function patchUpdates(_0xe06b21){return function(_0x58c743){try{jsonpatch[_0xb975('0x1b')](_0x58c743,_0xe06b21,!![]);}catch(_0x32e88e){return BPromise[_0xb975('0x1c')](_0x32e88e);}return _0x58c743[_0xb975('0x1d')]();};}function saveUpdates(_0x39e013,_0x3e0e37){return function(_0x53bf51){if(_0x53bf51){return _0x53bf51['update'](_0x39e013)['then'](function(_0x201bc5){return _0x201bc5;});}return null;};}function removeEntity(_0xe4ce0a,_0x49841a){return function(_0x59d47f){if(_0x59d47f){return _0x59d47f[_0xb975('0x1e')]()[_0xb975('0x1f')](function(){_0xe4ce0a[_0xb975('0x14')](0xcc)[_0xb975('0x20')]();});}};}function handleEntityNotFound(_0x2bb3c5,_0x13fc97){return function(_0x2a19b4){if(!_0x2a19b4){_0x2bb3c5[_0xb975('0x21')](0x194);}return _0x2a19b4;};}function handleError(_0x45b2a7,_0x29eafe){_0x29eafe=_0x29eafe||0x1f4;return function(_0x4e7b89){logger['error'](_0x4e7b89['stack']);if(_0x4e7b89[_0xb975('0x22')]){delete _0x4e7b89[_0xb975('0x22')];}_0x45b2a7[_0xb975('0x14')](_0x29eafe)[_0xb975('0x23')](_0x4e7b89);};}exports[_0xb975('0x24')]=function(_0x45c03e,_0x11595e){var _0x59fc99={},_0x3aa562={},_0x4d3b85={'count':0x0,'rows':[]};var _0xcff2c5=db['SalesforceField'][_0xb975('0x25')];_0x3aa562[_0xb975('0x26')]=_[_0xb975('0x27')](_0xcff2c5);_0x3aa562[_0xb975('0x28')]=_[_0xb975('0x27')](_0x45c03e[_0xb975('0x28')]);_0x3aa562[_0xb975('0x29')]=_[_0xb975('0x2a')](_0x3aa562['model'],_0x3aa562[_0xb975('0x28')]);_0x59fc99['attributes']=_[_0xb975('0x2a')](_0x3aa562[_0xb975('0x26')],qs[_0xb975('0x2b')](_0x45c03e[_0xb975('0x28')][_0xb975('0x2b')]));_0x59fc99[_0xb975('0x2c')]=_0x59fc99[_0xb975('0x2c')][_0xb975('0x2d')]?_0x59fc99[_0xb975('0x2c')]:_0x3aa562[_0xb975('0x26')];if(!_0x45c03e[_0xb975('0x28')][_0xb975('0x2e')](_0xb975('0x2f'))){_0x59fc99['limit']=qs[_0xb975('0x18')](_0x45c03e[_0xb975('0x28')]['limit']);_0x59fc99['offset']=qs[_0xb975('0x17')](_0x45c03e[_0xb975('0x28')]['offset']);}_0x59fc99[_0xb975('0x30')]=qs[_0xb975('0x31')](_0x45c03e['query'][_0xb975('0x31')]);_0x59fc99[_0xb975('0x32')]=qs['filters'](_[_0xb975('0x33')](_0x45c03e[_0xb975('0x28')],_0x3aa562[_0xb975('0x29')]));if(_0x45c03e[_0xb975('0x28')]['filter']){_0x59fc99[_0xb975('0x32')]=_[_0xb975('0x34')](_0x59fc99['where'],{'$or':_['map'](_0xcff2c5,function(_0x12f937){if(_0x12f937[_0xb975('0x35')][_0xb975('0x36')]!==_0xb975('0x37')){var _0x5f3b70={};_0x5f3b70[_0x12f937[_0xb975('0x38')]]={'$like':'%'+_0x45c03e[_0xb975('0x28')]['filter']+'%'};return _0x5f3b70;}})});}_0x59fc99=_[_0xb975('0x34')]({},_0x59fc99,_0x45c03e[_0xb975('0x39')]);var _0x57e845={'where':_0x59fc99[_0xb975('0x32')]};return db[_0xb975('0x3a')][_0xb975('0x16')](_0x57e845)[_0xb975('0x1f')](function(_0x4fc201){_0x4d3b85[_0xb975('0x16')]=_0x4fc201;if(_0x45c03e[_0xb975('0x28')][_0xb975('0x3b')]){_0x59fc99[_0xb975('0x3c')]=[{'all':!![]}];}return db[_0xb975('0x3a')]['findAll'](_0x59fc99);})[_0xb975('0x1f')](function(_0x5bda69){_0x4d3b85[_0xb975('0x3d')]=_0x5bda69;return _0x4d3b85;})[_0xb975('0x1f')](respondWithFilteredResult(_0x11595e,_0x59fc99))[_0xb975('0x3e')](handleError(_0x11595e,null));};exports[_0xb975('0x3f')]=function(_0x28ac04,_0x3006bc){var _0x23069d={'raw':!![],'where':{'id':_0x28ac04[_0xb975('0x40')]['id']}},_0x1f398f={};_0x1f398f[_0xb975('0x26')]=_[_0xb975('0x27')](db[_0xb975('0x3a')]['rawAttributes']);_0x1f398f[_0xb975('0x28')]=_[_0xb975('0x27')](_0x28ac04['query']);_0x1f398f[_0xb975('0x29')]=_[_0xb975('0x2a')](_0x1f398f[_0xb975('0x26')],_0x1f398f[_0xb975('0x28')]);_0x23069d[_0xb975('0x2c')]=_[_0xb975('0x2a')](_0x1f398f[_0xb975('0x26')],qs[_0xb975('0x2b')](_0x28ac04[_0xb975('0x28')][_0xb975('0x2b')]));_0x23069d[_0xb975('0x2c')]=_0x23069d[_0xb975('0x2c')][_0xb975('0x2d')]?_0x23069d['attributes']:_0x1f398f[_0xb975('0x26')];if(_0x28ac04[_0xb975('0x28')][_0xb975('0x3b')]){_0x23069d[_0xb975('0x3c')]=[{'all':!![]}];}_0x23069d=_[_0xb975('0x34')]({},_0x23069d,_0x28ac04['options']);return db[_0xb975('0x3a')]['find'](_0x23069d)['then'](handleEntityNotFound(_0x3006bc,null))[_0xb975('0x1f')](respondWithResult(_0x3006bc,null))[_0xb975('0x3e')](handleError(_0x3006bc,null));};exports['create']=function(_0x1e821a,_0x32070d){return db[_0xb975('0x3a')]['create'](_0x1e821a[_0xb975('0x41')],{})[_0xb975('0x1f')](respondWithResult(_0x32070d,0xc9))[_0xb975('0x3e')](handleError(_0x32070d,null));};exports[_0xb975('0x42')]=function(_0x41a255,_0x35d5e4){if(_0x41a255[_0xb975('0x41')]['id']){delete _0x41a255[_0xb975('0x41')]['id'];}return db[_0xb975('0x3a')][_0xb975('0x43')]({'where':{'id':_0x41a255[_0xb975('0x40')]['id']}})[_0xb975('0x1f')](handleEntityNotFound(_0x35d5e4,null))[_0xb975('0x1f')](saveUpdates(_0x41a255[_0xb975('0x41')],null))[_0xb975('0x1f')](respondWithResult(_0x35d5e4,null))[_0xb975('0x3e')](handleError(_0x35d5e4,null));};exports[_0xb975('0x1e')]=function(_0x5ee27b,_0x534f0e){return db[_0xb975('0x3a')][_0xb975('0x43')]({'where':{'id':_0x5ee27b['params']['id']}})['then'](handleEntityNotFound(_0x534f0e,null))[_0xb975('0x1f')](removeEntity(_0x534f0e,null))[_0xb975('0x3e')](handleError(_0x534f0e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 53b9838..1d257a5 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 _0x6ad8=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6ad8,0x168));var _0x86ad=function(_0x509dec,_0x4af3b6){_0x509dec=_0x509dec-0x0;var _0x489790=_0x6ad8[_0x509dec];return _0x489790;};'use strict';var _=require(_0x86ad('0x0'));var util=require(_0x86ad('0x1'));var logger=require('../../config/logger')(_0x86ad('0x2'));var moment=require(_0x86ad('0x3'));var BPromise=require(_0x86ad('0x4'));var rp=require(_0x86ad('0x5'));var fs=require('fs');var path=require(_0x86ad('0x6'));var rimraf=require(_0x86ad('0x7'));var config=require(_0x86ad('0x8'));var attributes=require(_0x86ad('0x9'));module[_0x86ad('0xa')]=function(_0xc7d778,_0x57bb86){return _0xc7d778[_0x86ad('0xb')](_0x86ad('0xc'),attributes,{'tableName':_0x86ad('0xd'),'paranoid':![],'indexes':[{'name':_0x86ad('0xe'),'fields':['idField',_0x86ad('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf623=['api','moment','request-promise','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x97be3d,_0x3f3bd2){var _0x47ddc4=function(_0x3036ee){while(--_0x3036ee){_0x97be3d['push'](_0x97be3d['shift']());}};_0x47ddc4(++_0x3f3bd2);}(_0xf623,0x14e));var _0x3f62=function(_0x27ea64,_0x4a42a6){_0x27ea64=_0x27ea64-0x0;var _0x51c81d=_0xf623[_0x27ea64];return _0x51c81d;};'use strict';var _=require('lodash');var util=require(_0x3f62('0x0'));var logger=require(_0x3f62('0x1'))(_0x3f62('0x2'));var moment=require(_0x3f62('0x3'));var BPromise=require('bluebird');var rp=require(_0x3f62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f62('0x5'));var config=require(_0x3f62('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x3f62('0x7')]=function(_0x307c00,_0x566837){return _0x307c00[_0x3f62('0x8')](_0x3f62('0x9'),attributes,{'tableName':_0x3f62('0xa'),'paranoid':![],'indexes':[{'name':_0x3f62('0xb'),'fields':[_0x3f62('0xc'),_0x3f62('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 7c0337a..e372eb5 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 _0xc21c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x24caa3,_0x5c0bb1){var _0x29cd10=function(_0x5823b0){while(--_0x5823b0){_0x24caa3['push'](_0x24caa3['shift']());}};_0x29cd10(++_0x5c0bb1);}(_0xc21c,0x98));var _0xcc21=function(_0x3849de,_0x3d5258){_0x3849de=_0x3849de-0x0;var _0x5dbfa7=_0xc21c[_0x3849de];return _0x5dbfa7;};'use strict';var _=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc21('0x2'));var fs=require('fs');var Redis=require(_0xcc21('0x3'));var db=require(_0xcc21('0x4'))['db'];var utils=require(_0xcc21('0x5'));var logger=require(_0xcc21('0x6'))(_0xcc21('0x7'));var config=require('../../config/environment');var jayson=require(_0xcc21('0x8'));var client=jayson[_0xcc21('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418561,_0x271b5d,_0x36ad1f){return new BPromise(function(_0x4651f2,_0x59843f){return client['request'](_0x418561,_0x36ad1f)[_0xcc21('0xa')](function(_0x521c4d){logger['info']('SalesforceField,\x20%s,\x20%s',_0x271b5d,_0xcc21('0xb'));logger[_0xcc21('0xc')](_0xcc21('0xd'),_0x271b5d,_0xcc21('0xb'),JSON[_0xcc21('0xe')](_0x521c4d));if(_0x521c4d['error']){if(_0x521c4d[_0xcc21('0xf')][_0xcc21('0x10')]===0x1f4){logger[_0xcc21('0xf')](_0xcc21('0x11'),_0x271b5d,_0x521c4d[_0xcc21('0xf')]['message']);return _0x59843f(_0x521c4d[_0xcc21('0xf')]['message']);}logger[_0xcc21('0xf')]('SalesforceField,\x20%s,\x20%s',_0x271b5d,_0x521c4d['error'][_0xcc21('0x12')]);return _0x4651f2(_0x521c4d[_0xcc21('0xf')][_0xcc21('0x12')]);}else{logger[_0xcc21('0x13')](_0xcc21('0x11'),_0x271b5d,_0xcc21('0xb'));_0x4651f2(_0x521c4d[_0xcc21('0x14')][_0xcc21('0x12')]);}})[_0xcc21('0x15')](function(_0x11056f){logger['error']('SalesforceField,\x20%s,\x20%s',_0x271b5d,_0x11056f);_0x59843f(_0x11056f);});});} \ No newline at end of file +var _0xd550=['stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent'];(function(_0x7fc55e,_0x8779a1){var _0x515476=function(_0x5d9949){while(--_0x5d9949){_0x7fc55e['push'](_0x7fc55e['shift']());}};_0x515476(++_0x8779a1);}(_0xd550,0xcf));var _0x0d55=function(_0x53bad4,_0x4ce188){_0x53bad4=_0x53bad4-0x0;var _0x3c57bd=_0xd550[_0x53bad4];return _0x3c57bd;};'use strict';var _=require(_0x0d55('0x0'));var util=require(_0x0d55('0x1'));var moment=require(_0x0d55('0x2'));var BPromise=require(_0x0d55('0x3'));var rs=require(_0x0d55('0x4'));var fs=require('fs');var Redis=require(_0x0d55('0x5'));var db=require(_0x0d55('0x6'))['db'];var utils=require(_0x0d55('0x7'));var logger=require(_0x0d55('0x8'))(_0x0d55('0x9'));var config=require(_0x0d55('0xa'));var jayson=require(_0x0d55('0xb'));var client=jayson[_0x0d55('0xc')][_0x0d55('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35d270,_0x34ef17,_0x85e96a){return new BPromise(function(_0x55232a,_0x130295){return client['request'](_0x35d270,_0x85e96a)[_0x0d55('0xe')](function(_0x22e423){logger[_0x0d55('0xf')]('SalesforceField,\x20%s,\x20%s',_0x34ef17,'request\x20sent');logger[_0x0d55('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x34ef17,_0x0d55('0x11'),JSON[_0x0d55('0x12')](_0x22e423));if(_0x22e423[_0x0d55('0x13')]){if(_0x22e423[_0x0d55('0x13')][_0x0d55('0x14')]===0x1f4){logger['error'](_0x0d55('0x15'),_0x34ef17,_0x22e423[_0x0d55('0x13')][_0x0d55('0x16')]);return _0x130295(_0x22e423[_0x0d55('0x13')][_0x0d55('0x16')]);}logger[_0x0d55('0x13')]('SalesforceField,\x20%s,\x20%s',_0x34ef17,_0x22e423['error'][_0x0d55('0x16')]);return _0x55232a(_0x22e423[_0x0d55('0x13')][_0x0d55('0x16')]);}else{logger[_0x0d55('0xf')]('SalesforceField,\x20%s,\x20%s',_0x34ef17,_0x0d55('0x11'));_0x55232a(_0x22e423[_0x0d55('0x17')][_0x0d55('0x16')]);}})[_0x0d55('0x18')](function(_0x491658){logger[_0x0d55('0x13')](_0x0d55('0x15'),_0x34ef17,_0x491658);_0x130295(_0x491658);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 90ba0e8..d2ca324 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 _0x33b5=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0xc4f226,_0x3bc98c){var _0x14d70a=function(_0x18d2ee){while(--_0x18d2ee){_0xc4f226['push'](_0xc4f226['shift']());}};_0x14d70a(++_0x3bc98c);}(_0x33b5,0xb4));var _0x533b=function(_0x575b91,_0x262ca7){_0x575b91=_0x575b91-0x0;var _0x8f9567=_0x33b5[_0x575b91];return _0x8f9567;};'use strict';var multer=require('multer');var util=require(_0x533b('0x0'));var path=require(_0x533b('0x1'));var timeout=require(_0x533b('0x2'));var express=require(_0x533b('0x3'));var router=express[_0x533b('0x4')]();var auth=require(_0x533b('0x5'));var interaction=require(_0x533b('0x6'));var config=require(_0x533b('0x7'));var controller=require(_0x533b('0x8'));router[_0x533b('0x9')]('/',auth[_0x533b('0xa')](),controller[_0x533b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x533b('0x9')](_0x533b('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x533b('0x9')](_0x533b('0xd'),auth[_0x533b('0xa')](),controller[_0x533b('0xe')]);router[_0x533b('0xf')]('/',auth['isAuthenticated'](),controller[_0x533b('0x10')]);router[_0x533b('0xf')](_0x533b('0xc'),auth['isAuthenticated'](),controller[_0x533b('0x11')]);router[_0x533b('0x12')](_0x533b('0x13'),auth[_0x533b('0xa')](),controller['update']);router['delete'](_0x533b('0x13'),auth[_0x533b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x29e9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x29e9,0x144));var _0x929e=function(_0x5867e3,_0x57b0dd){_0x5867e3=_0x5867e3-0x0;var _0x4056da=_0x29e9[_0x5867e3];return _0x4056da;};'use strict';var multer=require(_0x929e('0x0'));var util=require(_0x929e('0x1'));var path=require(_0x929e('0x2'));var timeout=require(_0x929e('0x3'));var express=require(_0x929e('0x4'));var router=express[_0x929e('0x5')]();var auth=require(_0x929e('0x6'));var interaction=require(_0x929e('0x7'));var config=require(_0x929e('0x8'));var controller=require(_0x929e('0x9'));router[_0x929e('0xa')]('/',auth['isAuthenticated'](),controller[_0x929e('0xb')]);router[_0x929e('0xa')](_0x929e('0xc'),auth[_0x929e('0xd')](),controller[_0x929e('0xe')]);router[_0x929e('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x929e('0xf')]);router[_0x929e('0xa')](_0x929e('0x10'),auth[_0x929e('0xd')](),controller['getFields']);router[_0x929e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x929e('0x11')](_0x929e('0x12'),auth[_0x929e('0xd')](),controller[_0x929e('0x13')]);router[_0x929e('0x14')](_0x929e('0xc'),auth['isAuthenticated'](),controller[_0x929e('0x15')]);router[_0x929e('0x16')](_0x929e('0xc'),auth[_0x929e('0xd')](),controller[_0x929e('0x17')]);module[_0x929e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9720747..e5c6e7d 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 _0xa902=['remoteUri','sequelize','exports','STRING'];(function(_0x58c1cb,_0x14654a){var _0x12234c=function(_0x52cc86){while(--_0x52cc86){_0x58c1cb['push'](_0x58c1cb['shift']());}};_0x12234c(++_0x14654a);}(_0xa902,0x8d));var _0x2a90=function(_0x1b4170,_0x3ca8b1){_0x1b4170=_0x1b4170-0x0;var _0x39cb98=_0xa902[_0x1b4170];return _0x39cb98;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'name':{'type':Sequelize[_0x2a90('0x2')]},'description':{'type':Sequelize[_0x2a90('0x2')]},'username':{'type':Sequelize[_0x2a90('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2a90('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2a90('0x3')},'serverUrl':{'type':Sequelize[_0x2a90('0x2')]}}; \ No newline at end of file +var _0x6f7a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x163b85,_0x462402){_0x163b85=_0x163b85-0x0;var _0x19b97b=_0x6f7a[_0x163b85];return _0x19b97b;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'name':{'type':Sequelize[_0xa6f7('0x2')]},'description':{'type':Sequelize[_0xa6f7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xa6f7('0x3')},'password':{'type':Sequelize[_0xa6f7('0x2')]},'email':{'type':Sequelize[_0xa6f7('0x2')]},'remoteUri':{'type':Sequelize[_0xa6f7('0x2')],'unique':_0xa6f7('0x4')},'serverUrl':{'type':Sequelize[_0xa6f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 306faca..60dfa38 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 _0x1c4c=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','apply','save','sendStatus','stack','name','send','ServicenowAccount','rawAttributes','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','model','find','create','body','destroy','getConfigurations','pick','map','Subjects','getSubjects','channel','Descriptions','ServicenowConfiguration','getFields','knowledge','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','child_incidents','hold_reason','approval_history','number','resolved_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','caller_id','subcategory','work_notes','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','comments','approval','sys_mod_count','sys_tags','escalation','upon_approval','location','findOne','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto'];(function(_0x265c1b,_0x3d682e){var _0x520ad8=function(_0x564966){while(--_0x564966){_0x265c1b['push'](_0x265c1b['shift']());}};_0x520ad8(++_0x3d682e);}(_0x1c4c,0x168));var _0xc1c4=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x1c4c[_0x35fb56];return _0x2fd52c;};'use strict';var pdf=require(_0xc1c4('0x0'));var emlformat=require(_0xc1c4('0x1'));var rimraf=require(_0xc1c4('0x2'));var zipdir=require(_0xc1c4('0x3'));var jsonpatch=require(_0xc1c4('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1c4('0x5'));var util=require(_0xc1c4('0x6'));var path=require(_0xc1c4('0x7'));var sox=require('sox');var csv=require(_0xc1c4('0x8'));var ejs=require(_0xc1c4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1c4('0xa'));var crypto=require(_0xc1c4('0xb'));var jsforce=require(_0xc1c4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1c4('0xd'));var Redis=require(_0xc1c4('0xe'));var authService=require(_0xc1c4('0xf'));var qs=require(_0xc1c4('0x10'));var hardwareService=require(_0xc1c4('0x11'));var logger=require(_0xc1c4('0x12'))(_0xc1c4('0x13'));var utils=require(_0xc1c4('0x14'));var config=require('../../config/environment');var db=require(_0xc1c4('0x15'))['db'];var integrations=require(_0xc1c4('0x16'));var jayson=require('jayson/promise');var client=jayson[_0xc1c4('0x17')][_0xc1c4('0x18')]({'port':0x232a});function checkPasswordPattern(_0x27d7e3,_0x5242d1,_0x4a4a56){if(_0x4a4a56){var _0x2bdd56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bdd56[_0xc1c4('0x19')](_0x5242d1)){return _0x27d7e3;}else{throw new Error(_0xc1c4('0x1a'));}}else{return _0x27d7e3;}}function respondWithRpcPromise(_0x219eb8,_0x1e65a8,_0x26b566,_0xda2571){return new BPromise(function(_0x1bfa93,_0x29da8e){var _0x58cfb8=_0xda2571||client;return _0x58cfb8['request'](_0x219eb8,_0x26b566)[_0xc1c4('0x1b')](function(_0x586414){logger[_0xc1c4('0x1c')](_0xc1c4('0x1d'),_0x1e65a8,_0xc1c4('0x1e'));logger[_0xc1c4('0x1f')](_0xc1c4('0x20'),_0x1e65a8,'request\x20sent',JSON[_0xc1c4('0x21')](_0x586414));if(_0x586414[_0xc1c4('0x22')]){if(_0x586414[_0xc1c4('0x22')]['code']===0x1f4){logger[_0xc1c4('0x22')](_0xc1c4('0x1d'),_0x1e65a8,_0x586414['error'][_0xc1c4('0x23')]);return _0x29da8e(_0x586414[_0xc1c4('0x22')]['message']);}logger[_0xc1c4('0x22')](_0xc1c4('0x1d'),_0x1e65a8,_0x586414[_0xc1c4('0x22')][_0xc1c4('0x23')]);return _0x1bfa93(_0x586414[_0xc1c4('0x22')]['message']);}else{logger[_0xc1c4('0x1c')](_0xc1c4('0x1d'),_0x1e65a8,_0xc1c4('0x1e'));_0x1bfa93(_0x586414[_0xc1c4('0x24')]['message']);}})[_0xc1c4('0x25')](function(_0x3d0f18){logger['error'](_0xc1c4('0x1d'),_0x1e65a8,_0x3d0f18);_0x29da8e(_0x3d0f18);});});}function respondWithStatusCode(_0x2ec453,_0x3f4d9d){_0x3f4d9d=_0x3f4d9d||0xcc;return function(_0x8e615b){if(_0x8e615b){return _0x2ec453['sendStatus'](_0x3f4d9d);}return _0x2ec453[_0xc1c4('0x26')](_0x3f4d9d)[_0xc1c4('0x27')]();};}function respondWithResult(_0x8edaac,_0xfb83a4){_0xfb83a4=_0xfb83a4||0xc8;return function(_0x2f14b2){if(_0x2f14b2){return _0x8edaac[_0xc1c4('0x26')](_0xfb83a4)[_0xc1c4('0x28')](_0x2f14b2);}};}function respondWithFilteredResult(_0x2704d0,_0x4bc69e){return function(_0x12578e){if(_0x12578e){var _0x2bddbc=_0x12578e[_0xc1c4('0x29')],_0x369123=_0x4bc69e['offset'],_0x5d1764=_0x4bc69e[_0xc1c4('0x2a')]+_0x4bc69e[_0xc1c4('0x2b')],_0x34a05b;if(_0x5d1764>=_0x2bddbc){_0x5d1764=_0x2bddbc;_0x34a05b=0xc8;}else{_0x34a05b=0xce;}_0x2704d0[_0xc1c4('0x26')](_0x34a05b);return _0x2704d0[_0xc1c4('0x2c')]('Content-Range',_0x369123+'-'+_0x5d1764+'/'+_0x2bddbc)[_0xc1c4('0x28')](_0x12578e);}return null;};}function patchUpdates(_0x1be948){return function(_0xbc2609){try{jsonpatch[_0xc1c4('0x2d')](_0xbc2609,_0x1be948,!![]);}catch(_0x10d537){return BPromise['reject'](_0x10d537);}return _0xbc2609[_0xc1c4('0x2e')]();};}function saveUpdates(_0x49c637,_0x131a79){return function(_0x36dc9b){if(_0x36dc9b){return _0x36dc9b['update'](_0x49c637)[_0xc1c4('0x1b')](function(_0x324767){return _0x324767;});}return null;};}function removeEntity(_0x362a54,_0x8eda82){return function(_0x5eba71){if(_0x5eba71){return _0x5eba71['destroy']()[_0xc1c4('0x1b')](function(){_0x362a54[_0xc1c4('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdeaea7,_0x10170b){return function(_0x1d5e72){if(!_0x1d5e72){_0xdeaea7[_0xc1c4('0x2f')](0x194);}return _0x1d5e72;};}function handleError(_0x1cc02e,_0x8de962){_0x8de962=_0x8de962||0x1f4;return function(_0x43ea1f){logger[_0xc1c4('0x22')](_0x43ea1f[_0xc1c4('0x30')]);if(_0x43ea1f['name']){delete _0x43ea1f[_0xc1c4('0x31')];}_0x1cc02e[_0xc1c4('0x26')](_0x8de962)[_0xc1c4('0x32')](_0x43ea1f);};}exports['index']=function(_0x19e2dc,_0x3a7bd1){var _0x4b909e={},_0x492237={},_0x577e63={'count':0x0,'rows':[]};var _0x3fe26b=db[_0xc1c4('0x33')][_0xc1c4('0x34')];_0x492237['model']=_[_0xc1c4('0x35')](_0x3fe26b);_0x492237[_0xc1c4('0x36')]=_[_0xc1c4('0x35')](_0x19e2dc[_0xc1c4('0x36')]);_0x492237[_0xc1c4('0x37')]=_[_0xc1c4('0x38')](_0x492237['model'],_0x492237[_0xc1c4('0x36')]);_0x4b909e[_0xc1c4('0x39')]=_[_0xc1c4('0x38')](_0x492237['model'],qs[_0xc1c4('0x3a')](_0x19e2dc[_0xc1c4('0x36')]['fields']));_0x4b909e[_0xc1c4('0x39')]=_0x4b909e['attributes'][_0xc1c4('0x3b')]?_0x4b909e[_0xc1c4('0x39')]:_0x492237['model'];if(!_0x19e2dc['query'][_0xc1c4('0x3c')](_0xc1c4('0x3d'))){_0x4b909e['limit']=qs[_0xc1c4('0x2b')](_0x19e2dc['query']['limit']);_0x4b909e[_0xc1c4('0x2a')]=qs['offset'](_0x19e2dc[_0xc1c4('0x36')][_0xc1c4('0x2a')]);}_0x4b909e[_0xc1c4('0x3e')]=qs[_0xc1c4('0x3f')](_0x19e2dc[_0xc1c4('0x36')][_0xc1c4('0x3f')]);_0x4b909e[_0xc1c4('0x40')]=qs[_0xc1c4('0x37')](_['pick'](_0x19e2dc[_0xc1c4('0x36')],_0x492237[_0xc1c4('0x37')]));if(_0x19e2dc[_0xc1c4('0x36')][_0xc1c4('0x41')]){_0x4b909e[_0xc1c4('0x40')]=_[_0xc1c4('0x42')](_0x4b909e[_0xc1c4('0x40')],{'$or':_['map'](_0x3fe26b,function(_0x522b96){if(_0x522b96[_0xc1c4('0x43')]['key']!==_0xc1c4('0x44')){var _0x3a8aa8={};_0x3a8aa8[_0x522b96[_0xc1c4('0x45')]]={'$like':'%'+_0x19e2dc['query'][_0xc1c4('0x41')]+'%'};return _0x3a8aa8;}})});}_0x4b909e=_[_0xc1c4('0x42')]({},_0x4b909e,_0x19e2dc[_0xc1c4('0x46')]);var _0x46f0ad={'where':_0x4b909e[_0xc1c4('0x40')]};return db[_0xc1c4('0x33')][_0xc1c4('0x29')](_0x46f0ad)['then'](function(_0x209ac7){_0x577e63[_0xc1c4('0x29')]=_0x209ac7;if(_0x19e2dc[_0xc1c4('0x36')][_0xc1c4('0x47')]){_0x4b909e[_0xc1c4('0x48')]=[{'all':!![]}];}return db[_0xc1c4('0x33')][_0xc1c4('0x49')](_0x4b909e);})[_0xc1c4('0x1b')](function(_0x577547){_0x577e63[_0xc1c4('0x4a')]=_0x577547;return _0x577e63;})[_0xc1c4('0x1b')](respondWithFilteredResult(_0x3a7bd1,_0x4b909e))[_0xc1c4('0x25')](handleError(_0x3a7bd1,null));};exports[_0xc1c4('0x4b')]=function(_0x3896a2,_0xb7abd8){var _0x4d4ed1={'raw':![],'where':{'id':_0x3896a2[_0xc1c4('0x4c')]['id']}},_0x28e5c7={};_0x28e5c7['model']=_[_0xc1c4('0x35')](db['ServicenowAccount']['rawAttributes']);_0x28e5c7['query']=_[_0xc1c4('0x35')](_0x3896a2[_0xc1c4('0x36')]);_0x28e5c7['filters']=_['intersection'](_0x28e5c7[_0xc1c4('0x4d')],_0x28e5c7[_0xc1c4('0x36')]);_0x4d4ed1[_0xc1c4('0x39')]=_[_0xc1c4('0x38')](_0x28e5c7[_0xc1c4('0x4d')],qs['fields'](_0x3896a2['query'][_0xc1c4('0x3a')]));_0x4d4ed1[_0xc1c4('0x39')]=_0x4d4ed1['attributes'][_0xc1c4('0x3b')]?_0x4d4ed1[_0xc1c4('0x39')]:_0x28e5c7['model'];if(_0x3896a2[_0xc1c4('0x36')][_0xc1c4('0x47')]){_0x4d4ed1[_0xc1c4('0x48')]=[{'all':!![]}];}_0x4d4ed1=_['merge']({},_0x4d4ed1,_0x3896a2[_0xc1c4('0x46')]);return db[_0xc1c4('0x33')][_0xc1c4('0x4e')](_0x4d4ed1)[_0xc1c4('0x1b')](handleEntityNotFound(_0xb7abd8,null))['then'](respondWithResult(_0xb7abd8,null))[_0xc1c4('0x25')](handleError(_0xb7abd8,null));};exports[_0xc1c4('0x4f')]=function(_0x4be312,_0xe3532c){return db[_0xc1c4('0x33')][_0xc1c4('0x4f')](_0x4be312[_0xc1c4('0x50')],{})[_0xc1c4('0x1b')](respondWithResult(_0xe3532c,0xc9))[_0xc1c4('0x25')](handleError(_0xe3532c,null));};exports['update']=function(_0x1ef896,_0x33d9c3){if(_0x1ef896[_0xc1c4('0x50')]['id']){delete _0x1ef896[_0xc1c4('0x50')]['id'];}return db[_0xc1c4('0x33')][_0xc1c4('0x4e')]({'where':{'id':_0x1ef896[_0xc1c4('0x4c')]['id']}})[_0xc1c4('0x1b')](handleEntityNotFound(_0x33d9c3,null))[_0xc1c4('0x1b')](saveUpdates(_0x1ef896[_0xc1c4('0x50')],null))[_0xc1c4('0x1b')](respondWithResult(_0x33d9c3,null))[_0xc1c4('0x25')](handleError(_0x33d9c3,null));};exports[_0xc1c4('0x51')]=function(_0x58fe1e,_0x39de58){return db[_0xc1c4('0x33')][_0xc1c4('0x4e')]({'where':{'id':_0x58fe1e[_0xc1c4('0x4c')]['id']}})[_0xc1c4('0x1b')](handleEntityNotFound(_0x39de58,null))[_0xc1c4('0x1b')](removeEntity(_0x39de58,null))[_0xc1c4('0x25')](handleError(_0x39de58,null));};exports[_0xc1c4('0x52')]=function(_0x5069d9,_0x35c426,_0x59304d){var _0x586f76={};var _0x448810={};var _0x592a3e;var _0x1805dc;return db[_0xc1c4('0x33')]['findOne']({'where':{'id':_0x5069d9['params']['id']}})[_0xc1c4('0x1b')](handleEntityNotFound(_0x35c426,null))['then'](function(_0x588492){if(_0x588492){_0x592a3e=_0x588492;_0x448810[_0xc1c4('0x4d')]=_['keys'](db['ServicenowConfiguration'][_0xc1c4('0x34')]);_0x448810[_0xc1c4('0x36')]=_[_0xc1c4('0x35')](_0x5069d9[_0xc1c4('0x36')]);_0x448810[_0xc1c4('0x37')]=_[_0xc1c4('0x38')](_0x448810[_0xc1c4('0x4d')],_0x448810[_0xc1c4('0x36')]);_0x586f76[_0xc1c4('0x39')]=_[_0xc1c4('0x38')](_0x448810['model'],qs[_0xc1c4('0x3a')](_0x5069d9[_0xc1c4('0x36')]['fields']));_0x586f76[_0xc1c4('0x39')]=_0x586f76['attributes'][_0xc1c4('0x3b')]?_0x586f76['attributes']:_0x448810['model'];_0x586f76[_0xc1c4('0x3e')]=qs[_0xc1c4('0x3f')](_0x5069d9[_0xc1c4('0x36')]['sort']);_0x586f76['where']=qs[_0xc1c4('0x37')](_[_0xc1c4('0x53')](_0x5069d9[_0xc1c4('0x36')],_0x448810['filters']));if(_0x5069d9[_0xc1c4('0x36')][_0xc1c4('0x41')]){_0x586f76[_0xc1c4('0x40')]=_['merge'](_0x586f76[_0xc1c4('0x40')],{'$or':_[_0xc1c4('0x54')](_0x586f76['attributes'],function(_0x109ff4){var _0x9d38cc={};_0x9d38cc[_0x109ff4]={'$like':'%'+_0x5069d9[_0xc1c4('0x36')][_0xc1c4('0x41')]+'%'};return _0x9d38cc;})});}_0x586f76=_['merge']({},_0x586f76,_0x5069d9[_0xc1c4('0x46')]);return _0x592a3e[_0xc1c4('0x52')](_0x586f76);}})[_0xc1c4('0x1b')](function(_0x308454){if(_0x308454){_0x1805dc=_0x308454[_0xc1c4('0x3b')];if(!_0x5069d9[_0xc1c4('0x36')][_0xc1c4('0x3c')]('nolimit')){_0x586f76[_0xc1c4('0x2b')]=qs['limit'](_0x5069d9[_0xc1c4('0x36')][_0xc1c4('0x2b')]);_0x586f76['offset']=qs[_0xc1c4('0x2a')](_0x5069d9[_0xc1c4('0x36')][_0xc1c4('0x2a')]);}return _0x592a3e[_0xc1c4('0x52')](_0x586f76);}})[_0xc1c4('0x1b')](function(_0x1e6869){if(_0x1e6869){return _0x1e6869?{'count':_0x1805dc,'rows':_0x1e6869}:null;}})[_0xc1c4('0x1b')](respondWithResult(_0x35c426,null))[_0xc1c4('0x25')](handleError(_0x35c426,null));};exports['addConfiguration']=function(_0x34b175,_0x38024d,_0x2b4ecb){if(_0x34b175[_0xc1c4('0x50')]['id']){delete _0x34b175[_0xc1c4('0x50')]['id'];}return db[_0xc1c4('0x33')]['findOne']({'where':{'id':_0x34b175[_0xc1c4('0x4c')]['id']}})[_0xc1c4('0x1b')](handleEntityNotFound(_0x38024d,null))[_0xc1c4('0x1b')](function(_0x350014){if(_0x350014){_0x34b175[_0xc1c4('0x50')]['AccountId']=_0x350014['id'];_0x34b175[_0xc1c4('0x50')][_0xc1c4('0x55')]=integrations[_0xc1c4('0x56')](_0x34b175['body'][_0xc1c4('0x57')],_0x34b175[_0xc1c4('0x50')][_0xc1c4('0x43')]);_0x34b175[_0xc1c4('0x50')][_0xc1c4('0x58')]=integrations['getDescriptions'](_0x34b175[_0xc1c4('0x50')][_0xc1c4('0x57')],_0x34b175['body']['type']);return db[_0xc1c4('0x59')]['create'](_0x34b175[_0xc1c4('0x50')],{'include':[{'model':db['ServicenowField'],'as':_0xc1c4('0x55')},{'model':db['ServicenowField'],'as':_0xc1c4('0x58')}]});}return null;})[_0xc1c4('0x1b')](respondWithResult(_0x38024d,null))[_0xc1c4('0x25')](handleError(_0x38024d,null));};exports[_0xc1c4('0x5a')]=function(_0x4a55a8,_0x5e1de7,_0x1cac19){var _0x826b82=['made_sla','hold_reason',_0xc1c4('0x5b'),'subcategory',_0xc1c4('0x5c'),_0xc1c4('0x5d'),_0xc1c4('0x5e'),_0xc1c4('0x5f'),_0xc1c4('0x60')];var _0x48ffb6=[_0xc1c4('0x61'),_0xc1c4('0x62'),_0xc1c4('0x63'),_0xc1c4('0x64'),_0xc1c4('0x65'),'sys_updated_on',_0xc1c4('0x66'),_0xc1c4('0x67'),_0xc1c4('0x68'),_0xc1c4('0x69'),_0xc1c4('0x6a'),'sys_updated_by','opened_by',_0xc1c4('0x6b'),'sys_created_on',_0xc1c4('0x6c'),_0xc1c4('0x6d'),_0xc1c4('0x6e'),'knowledge','order',_0xc1c4('0x6f'),_0xc1c4('0x70'),_0xc1c4('0x71'),_0xc1c4('0x72'),_0xc1c4('0x73'),_0xc1c4('0x74'),_0xc1c4('0x75'),_0xc1c4('0x76'),_0xc1c4('0x77'),_0xc1c4('0x78'),_0xc1c4('0x79'),_0xc1c4('0x7a'),'expected_start',_0xc1c4('0x7b'),_0xc1c4('0x7c'),_0xc1c4('0x7d'),_0xc1c4('0x7e'),'reopened_time','resolved_at',_0xc1c4('0x7f'),'approval_set',_0xc1c4('0x80'),_0xc1c4('0x81'),'short_description',_0xc1c4('0x5c'),'correlation_display','delivery_task','work_start',_0xc1c4('0x82'),_0xc1c4('0x83'),_0xc1c4('0x84'),_0xc1c4('0x85'),_0xc1c4('0x86'),_0xc1c4('0x5d'),_0xc1c4('0x87'),_0xc1c4('0x88'),_0xc1c4('0x89'),_0xc1c4('0x8a'),_0xc1c4('0x8b'),_0xc1c4('0x8c'),_0xc1c4('0x8d'),_0xc1c4('0x8e'),'incident_state',_0xc1c4('0x8f'),_0xc1c4('0x90'),_0xc1c4('0x91'),'reassignment_count','activity_due','assigned_to',_0xc1c4('0x5f'),_0xc1c4('0x92'),'sla_due',_0xc1c4('0x93'),'comments_and_work_notes','due_date',_0xc1c4('0x94'),'reopen_count',_0xc1c4('0x95'),_0xc1c4('0x96'),_0xc1c4('0x97'),'correlation_id',_0xc1c4('0x98'),'category'];var _0x20b4ed='';var _0x980711='';var _0x1cd32e=[];var _0x183e86='';var _0x3ce278='';var _0x325024=[];var _0x3e145f='';var _0x2a8b46='';var _0x384d17={};var _0x59b6d6='';return db[_0xc1c4('0x33')][_0xc1c4('0x99')]({'where':{'id':_0x4a55a8[_0xc1c4('0x4c')]['id']},'attributes':['id',_0xc1c4('0x9a'),_0xc1c4('0x9b'),_0xc1c4('0x9c'),_0xc1c4('0x9d'),_0xc1c4('0x9e')]})[_0xc1c4('0x1b')](handleEntityNotFound(_0x5e1de7,null))[_0xc1c4('0x1b')](function(_0x893fd1){if(_0x893fd1){_0x59b6d6=_0x893fd1['remoteUri'];var _0x533fc2=_0x59b6d6[_0xc1c4('0x9f')](-0x1);if(_0x533fc2==='/'){_0x59b6d6=_0x59b6d6[_0xc1c4('0xa0')](0x0,_0x59b6d6[_0xc1c4('0xa1')](_0x533fc2));}_0x2a8b46=util[_0xc1c4('0xa2')](_0xc1c4('0xa3'),_0x59b6d6);_0x3e145f=util[_0xc1c4('0xa2')](_0xc1c4('0xa4'),_0x59b6d6);_0x384d17={'user':_0x893fd1[_0xc1c4('0x9a')],'pass':_0x893fd1[_0xc1c4('0x9b')]};var _0x37aab3={'method':_0xc1c4('0xa5'),'uri':_0x2a8b46+_0xc1c4('0xa6'),'auth':_0x384d17,'json':!![]};return rp(_0x37aab3);}})[_0xc1c4('0x1b')](function(_0x404cf8){if(_0x404cf8[_0xc1c4('0x24')][_0xc1c4('0x3b')]>0x0){_0x20b4ed=_0x404cf8['result'];}console[_0xc1c4('0xa7')](_0xc1c4('0xa8'),_0x20b4ed);_0x325024=[];_0x980711=Object[_0xc1c4('0xa9')]([],_0x20b4ed);_['remove'](_0x980711,function(_0x26a569){return!_0x826b82[_0xc1c4('0xaa')](_0x26a569[_0xc1c4('0x31')]);});_0x980711[_0xc1c4('0xab')](function(_0x8225e8){var _0x17c4d2=createFieldObject(_0x3e145f,_0x384d17,_0x8225e8[_0xc1c4('0xac')],_0x8225e8[_0xc1c4('0x31')],_0x8225e8[_0xc1c4('0xad')],![]);_0x325024[_0xc1c4('0xae')](_0x17c4d2);});return Promise['all'](_0x325024);})[_0xc1c4('0x1b')](function(_0x222f9e){_0x1cd32e=_0x222f9e;_0x183e86=Object[_0xc1c4('0xa9')]([],_0x20b4ed);console[_0xc1c4('0xa7')](_0xc1c4('0xaf'),_0x20b4ed);_['remove'](_0x183e86,function(_0xbe984b){return _0x48ffb6['includes'](_0xbe984b[_0xc1c4('0x31')]);});console[_0xc1c4('0xa7')](_0xc1c4('0xb0'),_0x183e86);_0x325024=[];_0x183e86[_0xc1c4('0xab')](function(_0x31447b){var _0x39eb07=createFieldObject(_0x3e145f,_0x384d17,_0x31447b[_0xc1c4('0xac')],_0x31447b[_0xc1c4('0x31')],_0x31447b[_0xc1c4('0xad')],!![]);_0x325024[_0xc1c4('0xae')](_0x39eb07);});return Promise['all'](_0x325024);})['then'](function(_0x42b9ff){_0x3ce278=_0x42b9ff;var _0x4cf7c5=_0x1cd32e[_0xc1c4('0xb1')](_0x3ce278);return{'count':_0x4cf7c5[_0xc1c4('0x3b')],'rows':_0x4cf7c5};})[_0xc1c4('0x1b')](respondWithResult(_0x5e1de7,null))[_0xc1c4('0x25')](function(_0x2bc5ff){console[_0xc1c4('0xa7')]('ServiceNow\x20error:\x20'+_0x2bc5ff);var _0x6c6522=_0x4a55a8[_0xc1c4('0x36')][_0xc1c4('0x19')]?0x1f4:_0x2bc5ff[_0xc1c4('0xb2')]||0x1f4;logger['error'](_0x2bc5ff[_0xc1c4('0x30')]);delete _0x2bc5ff[_0xc1c4('0x31')];if(_0x6c6522===0x191){_0x6c6522=0x190;}_0x5e1de7[_0xc1c4('0x26')](_0x6c6522)[_0xc1c4('0x32')](_0x4a55a8[_0xc1c4('0x36')][_0xc1c4('0x19')]?{'message':_0xc1c4('0xb3'),'statusCode':_0x2bc5ff[_0xc1c4('0xb2')]}:_0x2bc5ff);});};function createFieldObject(_0x34ddaf,_0x2c858e,_0x55c129,_0x50a292,_0x7a4e3c,_0x2986c7){return new Promise(function(_0x5349f5,_0x42e255){var _0x294776={'id':_0x50a292,'name':_0x7a4e3c,'custom':_0x2986c7};if(_0x55c129===_0xc1c4('0xb4')){_0x294776['options']=[{'name':'True','value':_0xc1c4('0xb5')},{'name':_0xc1c4('0xb6'),'value':_0xc1c4('0xb7')}];_0x5349f5(_0x294776);}else{var _0x360cea={'method':_0xc1c4('0xa5'),'uri':_0x34ddaf+_0xc1c4('0xb8')+_0x50a292,'auth':_0x2c858e,'json':!![]};return rp(_0x360cea)[_0xc1c4('0x1b')](function(_0x4e2f18){var _0x5c136a=[];if(_0x4e2f18[_0xc1c4('0x24')]['length']>0x0){_0x4e2f18[_0xc1c4('0x24')][_0xc1c4('0xab')](function(_0x188ade){if(_0x188ade['inactive']===_0xc1c4('0xb7')){var _0x54a276={'name':_0x188ade[_0xc1c4('0xad')],'value':_0x188ade[_0xc1c4('0xb9')]};_0x5c136a[_0xc1c4('0xae')](_0x54a276);}});}_0x294776[_0xc1c4('0x46')]=_0x5c136a;if(_0x294776[_0xc1c4('0x46')][_0xc1c4('0x3b')]>0x0){_0x5349f5(_0x294776);}else{if(_0x2986c7==![]){_0x5349f5();}else{_0x5349f5(_0x294776);}}});}});} \ No newline at end of file +var _0x54f9=['password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','username','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','sendStatus','end','status','offset','Content-Range','json','apply','reject','save','update','destroy','stack','name','ServicenowAccount','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','map','field','filter','options','count','include','findAll','catch','show','params','find','create','body','getConfigurations','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','type','ServicenowConfiguration','ServicenowField','Descriptions','getFields','knowledge','subcategory','close_code','notify','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','number','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','findOne'];(function(_0x164b53,_0x3b2678){var _0x107dc0=function(_0x15eda9){while(--_0x15eda9){_0x164b53['push'](_0x164b53['shift']());}};_0x107dc0(++_0x3b2678);}(_0x54f9,0xee));var _0x954f=function(_0x3fbafe,_0x4cc031){_0x3fbafe=_0x3fbafe-0x0;var _0x122c8f=_0x54f9[_0x3fbafe];return _0x122c8f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x954f('0x0'));var rimraf=require(_0x954f('0x1'));var zipdir=require(_0x954f('0x2'));var jsonpatch=require(_0x954f('0x3'));var rp=require(_0x954f('0x4'));var moment=require(_0x954f('0x5'));var BPromise=require(_0x954f('0x6'));var Mustache=require('mustache');var util=require(_0x954f('0x7'));var path=require(_0x954f('0x8'));var sox=require(_0x954f('0x9'));var csv=require('to-csv');var ejs=require(_0x954f('0xa'));var fs=require('fs');var _=require(_0x954f('0xb'));var squel=require(_0x954f('0xc'));var crypto=require(_0x954f('0xd'));var jsforce=require(_0x954f('0xe'));var deskjs=require(_0x954f('0xf'));var toCsv=require(_0x954f('0x10'));var querystring=require('querystring');var Papa=require(_0x954f('0x11'));var Redis=require(_0x954f('0x12'));var authService=require(_0x954f('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x954f('0x14'));var logger=require(_0x954f('0x15'))(_0x954f('0x16'));var utils=require(_0x954f('0x17'));var config=require(_0x954f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x954f('0x19'));var client=jayson[_0x954f('0x1a')][_0x954f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x26d8b0,_0x49580d,_0x52f676){if(_0x52f676){var _0x1a4bbc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a4bbc[_0x954f('0x1c')](_0x49580d)){return _0x26d8b0;}else{throw new Error(_0x954f('0x1d'));}}else{return _0x26d8b0;}}function respondWithRpcPromise(_0x5732ae,_0xbc1ab9,_0x26bf60,_0x348917){return new BPromise(function(_0x1d8226,_0x1b1f63){var _0x4f1ec3=_0x348917||client;return _0x4f1ec3[_0x954f('0x1e')](_0x5732ae,_0x26bf60)[_0x954f('0x1f')](function(_0x587aaa){logger[_0x954f('0x20')](_0x954f('0x21'),_0xbc1ab9,_0x954f('0x22'));logger[_0x954f('0x23')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xbc1ab9,_0x954f('0x22'),JSON[_0x954f('0x24')](_0x587aaa));if(_0x587aaa['error']){if(_0x587aaa['error'][_0x954f('0x25')]===0x1f4){logger[_0x954f('0x26')](_0x954f('0x21'),_0xbc1ab9,_0x587aaa[_0x954f('0x26')][_0x954f('0x27')]);return _0x1b1f63(_0x587aaa[_0x954f('0x26')][_0x954f('0x27')]);}logger[_0x954f('0x26')](_0x954f('0x21'),_0xbc1ab9,_0x587aaa[_0x954f('0x26')][_0x954f('0x27')]);return _0x1d8226(_0x587aaa[_0x954f('0x26')]['message']);}else{logger[_0x954f('0x20')](_0x954f('0x21'),_0xbc1ab9,'request\x20sent');_0x1d8226(_0x587aaa['result'][_0x954f('0x27')]);}})['catch'](function(_0x11dcd2){logger[_0x954f('0x26')](_0x954f('0x21'),_0xbc1ab9,_0x11dcd2);_0x1b1f63(_0x11dcd2);});});}function respondWithStatusCode(_0x1c5917,_0x35138c){_0x35138c=_0x35138c||0xcc;return function(_0x500c87){if(_0x500c87){return _0x1c5917[_0x954f('0x28')](_0x35138c);}return _0x1c5917['status'](_0x35138c)[_0x954f('0x29')]();};}function respondWithResult(_0x27328d,_0x49c521){_0x49c521=_0x49c521||0xc8;return function(_0xa67005){if(_0xa67005){return _0x27328d[_0x954f('0x2a')](_0x49c521)['json'](_0xa67005);}};}function respondWithFilteredResult(_0x3f9725,_0xedf5a8){return function(_0x40970f){if(_0x40970f){var _0x9add1=_0x40970f['count'],_0x249f5d=_0xedf5a8[_0x954f('0x2b')],_0x37cc20=_0xedf5a8['offset']+_0xedf5a8['limit'],_0x10380d;if(_0x37cc20>=_0x9add1){_0x37cc20=_0x9add1;_0x10380d=0xc8;}else{_0x10380d=0xce;}_0x3f9725['status'](_0x10380d);return _0x3f9725['set'](_0x954f('0x2c'),_0x249f5d+'-'+_0x37cc20+'/'+_0x9add1)[_0x954f('0x2d')](_0x40970f);}return null;};}function patchUpdates(_0x1d2e6d){return function(_0x7f4176){try{jsonpatch[_0x954f('0x2e')](_0x7f4176,_0x1d2e6d,!![]);}catch(_0x136b22){return BPromise[_0x954f('0x2f')](_0x136b22);}return _0x7f4176[_0x954f('0x30')]();};}function saveUpdates(_0x59939d,_0x40f404){return function(_0x3b662a){if(_0x3b662a){return _0x3b662a[_0x954f('0x31')](_0x59939d)[_0x954f('0x1f')](function(_0x375457){return _0x375457;});}return null;};}function removeEntity(_0x23455c,_0x28fff0){return function(_0x1f8fec){if(_0x1f8fec){return _0x1f8fec[_0x954f('0x32')]()[_0x954f('0x1f')](function(){_0x23455c[_0x954f('0x2a')](0xcc)[_0x954f('0x29')]();});}};}function handleEntityNotFound(_0x4daf8e,_0x488d9a){return function(_0x1e1c6f){if(!_0x1e1c6f){_0x4daf8e[_0x954f('0x28')](0x194);}return _0x1e1c6f;};}function handleError(_0x389c06,_0x41a97c){_0x41a97c=_0x41a97c||0x1f4;return function(_0x33fd42){logger[_0x954f('0x26')](_0x33fd42[_0x954f('0x33')]);if(_0x33fd42[_0x954f('0x34')]){delete _0x33fd42[_0x954f('0x34')];}_0x389c06[_0x954f('0x2a')](_0x41a97c)['send'](_0x33fd42);};}exports['index']=function(_0x461a38,_0x631452){var _0x19bd9a={},_0x2cf963={},_0x2e9c06={'count':0x0,'rows':[]};var _0x3f2e3b=db[_0x954f('0x35')][_0x954f('0x36')];_0x2cf963[_0x954f('0x37')]=_['keys'](_0x3f2e3b);_0x2cf963['query']=_[_0x954f('0x38')](_0x461a38[_0x954f('0x39')]);_0x2cf963['filters']=_[_0x954f('0x3a')](_0x2cf963[_0x954f('0x37')],_0x2cf963[_0x954f('0x39')]);_0x19bd9a['attributes']=_['intersection'](_0x2cf963[_0x954f('0x37')],qs['fields'](_0x461a38[_0x954f('0x39')][_0x954f('0x3b')]));_0x19bd9a[_0x954f('0x3c')]=_0x19bd9a['attributes'][_0x954f('0x3d')]?_0x19bd9a[_0x954f('0x3c')]:_0x2cf963['model'];if(!_0x461a38[_0x954f('0x39')][_0x954f('0x3e')](_0x954f('0x3f'))){_0x19bd9a[_0x954f('0x40')]=qs[_0x954f('0x40')](_0x461a38[_0x954f('0x39')][_0x954f('0x40')]);_0x19bd9a[_0x954f('0x2b')]=qs[_0x954f('0x2b')](_0x461a38[_0x954f('0x39')][_0x954f('0x2b')]);}_0x19bd9a[_0x954f('0x41')]=qs[_0x954f('0x42')](_0x461a38['query']['sort']);_0x19bd9a[_0x954f('0x43')]=qs[_0x954f('0x44')](_['pick'](_0x461a38['query'],_0x2cf963[_0x954f('0x44')]));if(_0x461a38['query']['filter']){_0x19bd9a[_0x954f('0x43')]=_[_0x954f('0x45')](_0x19bd9a[_0x954f('0x43')],{'$or':_[_0x954f('0x46')](_0x3f2e3b,function(_0x5591d6){if(_0x5591d6['type']['key']!=='VIRTUAL'){var _0x5abd77={};_0x5abd77[_0x5591d6[_0x954f('0x47')]]={'$like':'%'+_0x461a38['query'][_0x954f('0x48')]+'%'};return _0x5abd77;}})});}_0x19bd9a=_[_0x954f('0x45')]({},_0x19bd9a,_0x461a38[_0x954f('0x49')]);var _0x27fb6d={'where':_0x19bd9a[_0x954f('0x43')]};return db[_0x954f('0x35')][_0x954f('0x4a')](_0x27fb6d)[_0x954f('0x1f')](function(_0x1be965){_0x2e9c06[_0x954f('0x4a')]=_0x1be965;if(_0x461a38['query']['includeAll']){_0x19bd9a[_0x954f('0x4b')]=[{'all':!![]}];}return db[_0x954f('0x35')][_0x954f('0x4c')](_0x19bd9a);})[_0x954f('0x1f')](function(_0x2ff670){_0x2e9c06['rows']=_0x2ff670;return _0x2e9c06;})[_0x954f('0x1f')](respondWithFilteredResult(_0x631452,_0x19bd9a))[_0x954f('0x4d')](handleError(_0x631452,null));};exports[_0x954f('0x4e')]=function(_0xeece0f,_0x1f6e98){var _0x55abf1={'raw':![],'where':{'id':_0xeece0f[_0x954f('0x4f')]['id']}},_0x296c46={};_0x296c46['model']=_[_0x954f('0x38')](db[_0x954f('0x35')][_0x954f('0x36')]);_0x296c46[_0x954f('0x39')]=_[_0x954f('0x38')](_0xeece0f[_0x954f('0x39')]);_0x296c46[_0x954f('0x44')]=_[_0x954f('0x3a')](_0x296c46[_0x954f('0x37')],_0x296c46[_0x954f('0x39')]);_0x55abf1[_0x954f('0x3c')]=_[_0x954f('0x3a')](_0x296c46['model'],qs[_0x954f('0x3b')](_0xeece0f[_0x954f('0x39')]['fields']));_0x55abf1[_0x954f('0x3c')]=_0x55abf1['attributes'][_0x954f('0x3d')]?_0x55abf1[_0x954f('0x3c')]:_0x296c46[_0x954f('0x37')];if(_0xeece0f[_0x954f('0x39')]['includeAll']){_0x55abf1[_0x954f('0x4b')]=[{'all':!![]}];}_0x55abf1=_['merge']({},_0x55abf1,_0xeece0f[_0x954f('0x49')]);return db[_0x954f('0x35')][_0x954f('0x50')](_0x55abf1)[_0x954f('0x1f')](handleEntityNotFound(_0x1f6e98,null))[_0x954f('0x1f')](respondWithResult(_0x1f6e98,null))['catch'](handleError(_0x1f6e98,null));};exports[_0x954f('0x51')]=function(_0x2904b1,_0x1d0c62){return db[_0x954f('0x35')][_0x954f('0x51')](_0x2904b1['body'],{})[_0x954f('0x1f')](respondWithResult(_0x1d0c62,0xc9))[_0x954f('0x4d')](handleError(_0x1d0c62,null));};exports[_0x954f('0x31')]=function(_0x29190a,_0x3466ff){if(_0x29190a[_0x954f('0x52')]['id']){delete _0x29190a[_0x954f('0x52')]['id'];}return db['ServicenowAccount'][_0x954f('0x50')]({'where':{'id':_0x29190a[_0x954f('0x4f')]['id']}})[_0x954f('0x1f')](handleEntityNotFound(_0x3466ff,null))['then'](saveUpdates(_0x29190a[_0x954f('0x52')],null))['then'](respondWithResult(_0x3466ff,null))[_0x954f('0x4d')](handleError(_0x3466ff,null));};exports[_0x954f('0x32')]=function(_0x448d82,_0x493178){return db[_0x954f('0x35')][_0x954f('0x50')]({'where':{'id':_0x448d82[_0x954f('0x4f')]['id']}})[_0x954f('0x1f')](handleEntityNotFound(_0x493178,null))[_0x954f('0x1f')](removeEntity(_0x493178,null))[_0x954f('0x4d')](handleError(_0x493178,null));};exports[_0x954f('0x53')]=function(_0x54a140,_0x5a1ac9,_0x2297e7){var _0x5907f3={};var _0xd05d83={};var _0x8900fc;var _0xd44de6;return db[_0x954f('0x35')]['findOne']({'where':{'id':_0x54a140[_0x954f('0x4f')]['id']}})[_0x954f('0x1f')](handleEntityNotFound(_0x5a1ac9,null))['then'](function(_0x45396f){if(_0x45396f){_0x8900fc=_0x45396f;_0xd05d83['model']=_[_0x954f('0x38')](db['ServicenowConfiguration'][_0x954f('0x36')]);_0xd05d83[_0x954f('0x39')]=_[_0x954f('0x38')](_0x54a140[_0x954f('0x39')]);_0xd05d83['filters']=_[_0x954f('0x3a')](_0xd05d83[_0x954f('0x37')],_0xd05d83[_0x954f('0x39')]);_0x5907f3[_0x954f('0x3c')]=_[_0x954f('0x3a')](_0xd05d83[_0x954f('0x37')],qs[_0x954f('0x3b')](_0x54a140[_0x954f('0x39')][_0x954f('0x3b')]));_0x5907f3[_0x954f('0x3c')]=_0x5907f3[_0x954f('0x3c')][_0x954f('0x3d')]?_0x5907f3[_0x954f('0x3c')]:_0xd05d83['model'];_0x5907f3['order']=qs['sort'](_0x54a140[_0x954f('0x39')]['sort']);_0x5907f3[_0x954f('0x43')]=qs[_0x954f('0x44')](_[_0x954f('0x54')](_0x54a140[_0x954f('0x39')],_0xd05d83[_0x954f('0x44')]));if(_0x54a140['query'][_0x954f('0x48')]){_0x5907f3['where']=_[_0x954f('0x45')](_0x5907f3[_0x954f('0x43')],{'$or':_[_0x954f('0x46')](_0x5907f3[_0x954f('0x3c')],function(_0x17f1e9){var _0x5cd3fa={};_0x5cd3fa[_0x17f1e9]={'$like':'%'+_0x54a140[_0x954f('0x39')]['filter']+'%'};return _0x5cd3fa;})});}_0x5907f3=_['merge']({},_0x5907f3,_0x54a140[_0x954f('0x49')]);return _0x8900fc[_0x954f('0x53')](_0x5907f3);}})[_0x954f('0x1f')](function(_0x1511c1){if(_0x1511c1){_0xd44de6=_0x1511c1[_0x954f('0x3d')];if(!_0x54a140['query'][_0x954f('0x3e')](_0x954f('0x3f'))){_0x5907f3[_0x954f('0x40')]=qs[_0x954f('0x40')](_0x54a140[_0x954f('0x39')]['limit']);_0x5907f3[_0x954f('0x2b')]=qs['offset'](_0x54a140[_0x954f('0x39')][_0x954f('0x2b')]);}return _0x8900fc['getConfigurations'](_0x5907f3);}})[_0x954f('0x1f')](function(_0x37a378){if(_0x37a378){return _0x37a378?{'count':_0xd44de6,'rows':_0x37a378}:null;}})[_0x954f('0x1f')](respondWithResult(_0x5a1ac9,null))['catch'](handleError(_0x5a1ac9,null));};exports[_0x954f('0x55')]=function(_0x1450ae,_0x575c6d,_0x51d5f9){if(_0x1450ae['body']['id']){delete _0x1450ae[_0x954f('0x52')]['id'];}return db[_0x954f('0x35')]['findOne']({'where':{'id':_0x1450ae[_0x954f('0x4f')]['id']}})[_0x954f('0x1f')](handleEntityNotFound(_0x575c6d,null))[_0x954f('0x1f')](function(_0xd39dc3){if(_0xd39dc3){_0x1450ae[_0x954f('0x52')][_0x954f('0x56')]=_0xd39dc3['id'];_0x1450ae[_0x954f('0x52')][_0x954f('0x57')]=integrations[_0x954f('0x58')](_0x1450ae[_0x954f('0x52')][_0x954f('0x59')],_0x1450ae[_0x954f('0x52')]['type']);_0x1450ae[_0x954f('0x52')]['Descriptions']=integrations[_0x954f('0x5a')](_0x1450ae[_0x954f('0x52')]['channel'],_0x1450ae[_0x954f('0x52')][_0x954f('0x5b')]);return db[_0x954f('0x5c')][_0x954f('0x51')](_0x1450ae[_0x954f('0x52')],{'include':[{'model':db[_0x954f('0x5d')],'as':'Subjects'},{'model':db[_0x954f('0x5d')],'as':_0x954f('0x5e')}]});}return null;})[_0x954f('0x1f')](respondWithResult(_0x575c6d,null))[_0x954f('0x4d')](handleError(_0x575c6d,null));};exports[_0x954f('0x5f')]=function(_0x4541b4,_0x567110,_0x5ad02a){var _0x4fb7e8=['made_sla','hold_reason',_0x954f('0x60'),_0x954f('0x61'),_0x954f('0x62'),_0x954f('0x63'),'incident_state','severity','category'];var _0x2014e2=['parent',_0x954f('0x64'),_0x954f('0x65'),'watch_list',_0x954f('0x66'),_0x954f('0x67'),_0x954f('0x68'),_0x954f('0x69'),'approval_history',_0x954f('0x6a'),_0x954f('0x6b'),'sys_updated_by',_0x954f('0x6c'),_0x954f('0x6d'),_0x954f('0x6e'),'sys_domain',_0x954f('0x6f'),_0x954f('0x70'),_0x954f('0x60'),_0x954f('0x41'),_0x954f('0x71'),'closed_at',_0x954f('0x72'),_0x954f('0x73'),_0x954f('0x74'),'active',_0x954f('0x75'),_0x954f('0x76'),_0x954f('0x77'),'sys_domain_path','rfc',_0x954f('0x78'),_0x954f('0x79'),'opened_at',_0x954f('0x7a'),_0x954f('0x7b'),_0x954f('0x7c'),_0x954f('0x7d'),_0x954f('0x7e'),_0x954f('0x7f'),_0x954f('0x80'),_0x954f('0x61'),_0x954f('0x81'),_0x954f('0x82'),_0x954f('0x62'),'correlation_display',_0x954f('0x83'),_0x954f('0x84'),_0x954f('0x85'),'business_stc',_0x954f('0x86'),_0x954f('0x87'),_0x954f('0x88'),_0x954f('0x63'),_0x954f('0x89'),'close_notes',_0x954f('0x8a'),_0x954f('0x8b'),_0x954f('0x8c'),_0x954f('0x8d'),_0x954f('0x8e'),_0x954f('0x8f'),_0x954f('0x90'),_0x954f('0x91'),_0x954f('0x92'),_0x954f('0x93'),_0x954f('0x94'),_0x954f('0x95'),_0x954f('0x96'),'severity',_0x954f('0x97'),_0x954f('0x98'),_0x954f('0x99'),_0x954f('0x9a'),_0x954f('0x9b'),_0x954f('0x9c'),_0x954f('0x9d'),_0x954f('0x9e'),_0x954f('0x9f'),_0x954f('0xa0'),_0x954f('0xa1'),'location',_0x954f('0xa2')];var _0x36af17='';var _0x264efd='';var _0x4ae6ef=[];var _0x35390f='';var _0xb73689='';var _0x4083fb=[];var _0x513511='';var _0x3704a8='';var _0x21a83b={};var _0x21543a='';return db[_0x954f('0x35')][_0x954f('0xa3')]({'where':{'id':_0x4541b4['params']['id']},'attributes':['id','username',_0x954f('0xa4'),_0x954f('0xa5'),_0x954f('0xa6'),_0x954f('0xa7')]})[_0x954f('0x1f')](handleEntityNotFound(_0x567110,null))['then'](function(_0x18ac74){if(_0x18ac74){_0x21543a=_0x18ac74[_0x954f('0xa6')];var _0x3bd137=_0x21543a[_0x954f('0xa8')](-0x1);if(_0x3bd137==='/'){_0x21543a=_0x21543a[_0x954f('0xa9')](0x0,_0x21543a[_0x954f('0xaa')](_0x3bd137));}_0x3704a8=util['format'](_0x954f('0xab'),_0x21543a);_0x513511=util[_0x954f('0xac')]('%s/api/now/table/',_0x21543a);_0x21a83b={'user':_0x18ac74[_0x954f('0xad')],'pass':_0x18ac74[_0x954f('0xa4')]};var _0x268290={'method':_0x954f('0xae'),'uri':_0x3704a8+'incident?sysparm_display_value=all','auth':_0x21a83b,'json':!![]};return rp(_0x268290);}})[_0x954f('0x1f')](function(_0xe7206){if(_0xe7206[_0x954f('0xaf')][_0x954f('0x3d')]>0x0){_0x36af17=_0xe7206['result'];}console[_0x954f('0xb0')](_0x954f('0xb1'),_0x36af17);_0x4083fb=[];_0x264efd=Object[_0x954f('0xb2')]([],_0x36af17);_[_0x954f('0xb3')](_0x264efd,function(_0x999bdf){return!_0x4fb7e8[_0x954f('0xb4')](_0x999bdf[_0x954f('0x34')]);});_0x264efd[_0x954f('0xb5')](function(_0x2faec3){var _0x18bd39=createFieldObject(_0x513511,_0x21a83b,_0x2faec3[_0x954f('0xb6')],_0x2faec3[_0x954f('0x34')],_0x2faec3[_0x954f('0xb7')],![]);_0x4083fb['push'](_0x18bd39);});return Promise[_0x954f('0xb8')](_0x4083fb);})[_0x954f('0x1f')](function(_0x45b6c7){_0x4ae6ef=_0x45b6c7;_0x35390f=Object[_0x954f('0xb2')]([],_0x36af17);console[_0x954f('0xb0')](_0x954f('0xb9'),_0x36af17);_['remove'](_0x35390f,function(_0x3160fc){return _0x2014e2[_0x954f('0xb4')](_0x3160fc[_0x954f('0x34')]);});console[_0x954f('0xb0')](_0x954f('0xba'),_0x35390f);_0x4083fb=[];_0x35390f[_0x954f('0xb5')](function(_0x2413b7){var _0x46828b=createFieldObject(_0x513511,_0x21a83b,_0x2413b7[_0x954f('0xb6')],_0x2413b7[_0x954f('0x34')],_0x2413b7[_0x954f('0xb7')],!![]);_0x4083fb[_0x954f('0xbb')](_0x46828b);});return Promise[_0x954f('0xb8')](_0x4083fb);})[_0x954f('0x1f')](function(_0x940c6b){_0xb73689=_0x940c6b;var _0xf9dad0=_0x4ae6ef[_0x954f('0xbc')](_0xb73689);return{'count':_0xf9dad0['length'],'rows':_0xf9dad0};})[_0x954f('0x1f')](respondWithResult(_0x567110,null))['catch'](function(_0x3a9500){console[_0x954f('0xb0')](_0x954f('0xbd')+_0x3a9500);var _0x26b79a=_0x4541b4['query'][_0x954f('0x1c')]?0x1f4:_0x3a9500[_0x954f('0xbe')]||0x1f4;logger['error'](_0x3a9500[_0x954f('0x33')]);delete _0x3a9500[_0x954f('0x34')];if(_0x26b79a===0x191){_0x26b79a=0x190;}_0x567110[_0x954f('0x2a')](_0x26b79a)[_0x954f('0xbf')](_0x4541b4[_0x954f('0x39')]['test']?{'message':_0x954f('0xc0'),'statusCode':_0x3a9500[_0x954f('0xbe')]}:_0x3a9500);});};function createFieldObject(_0x3b7e22,_0x3d50a4,_0x2a3caf,_0xf4aae5,_0x5e4add,_0xaac64d){return new Promise(function(_0x39a4bf,_0x502f4c){var _0x4ee65f={'id':_0xf4aae5,'name':_0x5e4add,'custom':_0xaac64d};if(_0x2a3caf===_0x954f('0xc1')){_0x4ee65f['options']=[{'name':_0x954f('0xc2'),'value':_0x954f('0xc3')},{'name':_0x954f('0xc4'),'value':_0x954f('0xc5')}];_0x39a4bf(_0x4ee65f);}else{var _0x1f2e0e={'method':_0x954f('0xae'),'uri':_0x3b7e22+_0x954f('0xc6')+_0xf4aae5,'auth':_0x3d50a4,'json':!![]};return rp(_0x1f2e0e)[_0x954f('0x1f')](function(_0x5aa440){var _0x2fdc1d=[];if(_0x5aa440[_0x954f('0xaf')][_0x954f('0x3d')]>0x0){_0x5aa440[_0x954f('0xaf')]['forEach'](function(_0x190315){if(_0x190315[_0x954f('0xc7')]===_0x954f('0xc5')){var _0x1c9bd9={'name':_0x190315[_0x954f('0xb7')],'value':_0x190315[_0x954f('0xc8')]};_0x2fdc1d[_0x954f('0xbb')](_0x1c9bd9);}});}_0x4ee65f[_0x954f('0x49')]=_0x2fdc1d;if(_0x4ee65f[_0x954f('0x49')][_0x954f('0x3d')]>0x0){_0x39a4bf(_0x4ee65f);}else{if(_0xaac64d==![]){_0x39a4bf();}else{_0x39a4bf(_0x4ee65f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 09be2fb..c6708e2 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x27e845,_0x34730b){var _0x38f62e=function(_0x208cc0){while(--_0x208cc0){_0x27e845['push'](_0x27e845['shift']());}};_0x38f62e(++_0x34730b);}(_0x814b,0x1a2));var _0xb814=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x814b[_0x55754e];return _0x2e9948;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7a54,0x106));var _0x47a5=function(_0x2c2079,_0x3914cc){_0x2c2079=_0x2c2079-0x0;var _0x23c900=_0x7a54[_0x2c2079];return _0x23c900;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 8aaaae0..24ee606 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 _0x0a14=['stringify','error','result','message','catch','GetServicenowAccount','ServicenowAccount','options','raw','include','map','model','attributes','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32a923,_0x524c14){var _0x11677d=function(_0x3cc314){while(--_0x3cc314){_0x32a923['push'](_0x32a923['shift']());}};_0x11677d(++_0x524c14);}(_0x0a14,0x1a2));var _0x40a1=function(_0x44bd8d,_0xe2e9a5){_0x44bd8d=_0x44bd8d-0x0;var _0x275644=_0x0a14[_0x44bd8d];return _0x275644;};'use strict';var _=require('lodash');var util=require(_0x40a1('0x0'));var moment=require(_0x40a1('0x1'));var BPromise=require(_0x40a1('0x2'));var rs=require(_0x40a1('0x3'));var fs=require('fs');var Redis=require(_0x40a1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40a1('0x5'));var logger=require(_0x40a1('0x6'))(_0x40a1('0x7'));var config=require(_0x40a1('0x8'));var jayson=require(_0x40a1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x519c0c,_0x1e1cea,_0x1c8d1c){return new BPromise(function(_0x2d16fa,_0x2b3d72){return client[_0x40a1('0xa')](_0x519c0c,_0x1c8d1c)[_0x40a1('0xb')](function(_0x94fc75){logger[_0x40a1('0xc')](_0x40a1('0xd'),_0x1e1cea,_0x40a1('0xe'));logger[_0x40a1('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1e1cea,_0x40a1('0xe'),JSON[_0x40a1('0x10')](_0x94fc75));if(_0x94fc75[_0x40a1('0x11')]){if(_0x94fc75[_0x40a1('0x11')]['code']===0x1f4){logger[_0x40a1('0x11')](_0x40a1('0xd'),_0x1e1cea,_0x94fc75[_0x40a1('0x11')]['message']);return _0x2b3d72(_0x94fc75[_0x40a1('0x11')]['message']);}logger[_0x40a1('0x11')](_0x40a1('0xd'),_0x1e1cea,_0x94fc75['error']['message']);return _0x2d16fa(_0x94fc75[_0x40a1('0x11')]['message']);}else{logger['info'](_0x40a1('0xd'),_0x1e1cea,_0x40a1('0xe'));_0x2d16fa(_0x94fc75[_0x40a1('0x12')][_0x40a1('0x13')]);}})[_0x40a1('0x14')](function(_0x37de5a){logger[_0x40a1('0x11')](_0x40a1('0xd'),_0x1e1cea,_0x37de5a);_0x2b3d72(_0x37de5a);});});}exports[_0x40a1('0x15')]=function(_0xff83af){var _0x44fe58=this;return new Promise(function(_0x307c6b,_0x5d182f){return db[_0x40a1('0x16')]['findAll']({'raw':_0xff83af[_0x40a1('0x17')]?_0xff83af['options'][_0x40a1('0x18')]===undefined?!![]:![]:!![],'where':_0xff83af[_0x40a1('0x17')]?_0xff83af[_0x40a1('0x17')]['where']||null:null,'attributes':_0xff83af[_0x40a1('0x17')]?_0xff83af[_0x40a1('0x17')]['attributes']||null:null,'limit':_0xff83af[_0x40a1('0x17')]?_0xff83af[_0x40a1('0x17')]['limit']||null:null,'include':_0xff83af['options']?_0xff83af[_0x40a1('0x17')][_0x40a1('0x19')]?_[_0x40a1('0x1a')](_0xff83af[_0x40a1('0x17')][_0x40a1('0x19')],function(_0x32c17e){return{'model':db[_0x32c17e[_0x40a1('0x1b')]],'as':_0x32c17e['as'],'attributes':_0x32c17e['attributes'],'include':_0x32c17e[_0x40a1('0x19')]?_[_0x40a1('0x1a')](_0x32c17e[_0x40a1('0x19')],function(_0x344476){return{'model':db[_0x344476[_0x40a1('0x1b')]],'as':_0x344476['as'],'attributes':_0x344476['attributes'],'include':_0x344476[_0x40a1('0x19')]?_[_0x40a1('0x1a')](_0x344476[_0x40a1('0x19')],function(_0x447f1c){return{'model':db[_0x447f1c[_0x40a1('0x1b')]],'as':_0x447f1c['as'],'attributes':_0x447f1c[_0x40a1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x40a1('0xb')](function(_0x5908a5){logger[_0x40a1('0xc')](_0x40a1('0x15'),_0xff83af);logger[_0x40a1('0xf')]('GetServicenowAccount',_0xff83af,JSON[_0x40a1('0x10')](_0x5908a5));_0x307c6b(_0x5908a5);})[_0x40a1('0x14')](function(_0x2cd1a5){logger[_0x40a1('0x11')](_0x40a1('0x15'),_0x2cd1a5['message'],_0xff83af);_0x5d182f(_0x44fe58[_0x40a1('0x11')](0x1f4,_0x2cd1a5['message']));});});};exports[_0x40a1('0x1d')]=function(_0x46fb43){var _0x175858=this;return new Promise(function(_0x330bc5,_0x22dd40){return db[_0x40a1('0x16')][_0x40a1('0x1e')]({'raw':_0x46fb43[_0x40a1('0x17')]?_0x46fb43['options'][_0x40a1('0x18')]===undefined?!![]:![]:!![],'where':_0x46fb43[_0x40a1('0x17')]?_0x46fb43[_0x40a1('0x17')]['where']||null:null,'attributes':_0x46fb43['options']?_0x46fb43[_0x40a1('0x17')][_0x40a1('0x1c')]||null:null,'include':_0x46fb43[_0x40a1('0x17')]?_0x46fb43[_0x40a1('0x17')]['include']?_[_0x40a1('0x1a')](_0x46fb43[_0x40a1('0x17')]['include'],function(_0xb3f288){return{'model':db[_0xb3f288[_0x40a1('0x1b')]],'as':_0xb3f288['as'],'attributes':_0xb3f288[_0x40a1('0x1c')],'include':_0xb3f288[_0x40a1('0x19')]?_[_0x40a1('0x1a')](_0xb3f288['include'],function(_0x18a62a){return{'model':db[_0x18a62a[_0x40a1('0x1b')]],'as':_0x18a62a['as'],'attributes':_0x18a62a[_0x40a1('0x1c')],'include':_0x18a62a['include']?_[_0x40a1('0x1a')](_0x18a62a[_0x40a1('0x19')],function(_0x1332bf){return{'model':db[_0x1332bf[_0x40a1('0x1b')]],'as':_0x1332bf['as'],'attributes':_0x1332bf[_0x40a1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ef2c3){logger[_0x40a1('0xc')]('ShowServicenowAccount',_0x46fb43);logger['debug']('ShowServicenowAccount',_0x46fb43,JSON[_0x40a1('0x10')](_0x2ef2c3));_0x330bc5(_0x2ef2c3);})[_0x40a1('0x14')](function(_0x3c1a1b){logger['error'](_0x40a1('0x1d'),_0x3c1a1b[_0x40a1('0x13')],_0x46fb43);_0x22dd40(_0x175858[_0x40a1('0x11')](0x1f4,_0x3c1a1b[_0x40a1('0x13')]));});});}; \ No newline at end of file +var _0x4d99=['result','ServicenowAccount','findAll','options','raw','attributes','limit','include','model','map','catch','GetServicenowAccount','ShowServicenowAccount','find','where','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2b7b08,_0xac7c57){var _0x1d035e=function(_0xf327a3){while(--_0xf327a3){_0x2b7b08['push'](_0x2b7b08['shift']());}};_0x1d035e(++_0xac7c57);}(_0x4d99,0x112));var _0x94d9=function(_0x27f973,_0x283709){_0x27f973=_0x27f973-0x0;var _0x64b321=_0x4d99[_0x27f973];return _0x64b321;};'use strict';var _=require(_0x94d9('0x0'));var util=require(_0x94d9('0x1'));var moment=require(_0x94d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x94d9('0x3'));var fs=require('fs');var Redis=require(_0x94d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94d9('0x5'));var logger=require(_0x94d9('0x6'))('rpc');var config=require(_0x94d9('0x7'));var jayson=require(_0x94d9('0x8'));var client=jayson[_0x94d9('0x9')][_0x94d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x558e77,_0xd3b78b,_0x5d469c){return new BPromise(function(_0x16e28d,_0x398fea){return client[_0x94d9('0xb')](_0x558e77,_0x5d469c)[_0x94d9('0xc')](function(_0x5e831f){logger[_0x94d9('0xd')](_0x94d9('0xe'),_0xd3b78b,_0x94d9('0xf'));logger[_0x94d9('0x10')](_0x94d9('0x11'),_0xd3b78b,_0x94d9('0xf'),JSON[_0x94d9('0x12')](_0x5e831f));if(_0x5e831f['error']){if(_0x5e831f[_0x94d9('0x13')][_0x94d9('0x14')]===0x1f4){logger[_0x94d9('0x13')](_0x94d9('0xe'),_0xd3b78b,_0x5e831f[_0x94d9('0x13')]['message']);return _0x398fea(_0x5e831f[_0x94d9('0x13')]['message']);}logger[_0x94d9('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0xd3b78b,_0x5e831f[_0x94d9('0x13')][_0x94d9('0x15')]);return _0x16e28d(_0x5e831f[_0x94d9('0x13')][_0x94d9('0x15')]);}else{logger['info'](_0x94d9('0xe'),_0xd3b78b,_0x94d9('0xf'));_0x16e28d(_0x5e831f[_0x94d9('0x16')][_0x94d9('0x15')]);}})['catch'](function(_0x56cc04){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xd3b78b,_0x56cc04);_0x398fea(_0x56cc04);});});}exports['GetServicenowAccount']=function(_0x41b015){var _0x20e7ae=this;return new Promise(function(_0xacef60,_0x308c28){return db[_0x94d9('0x17')][_0x94d9('0x18')]({'raw':_0x41b015[_0x94d9('0x19')]?_0x41b015[_0x94d9('0x19')][_0x94d9('0x1a')]===undefined?!![]:![]:!![],'where':_0x41b015[_0x94d9('0x19')]?_0x41b015[_0x94d9('0x19')]['where']||null:null,'attributes':_0x41b015[_0x94d9('0x19')]?_0x41b015[_0x94d9('0x19')][_0x94d9('0x1b')]||null:null,'limit':_0x41b015[_0x94d9('0x19')]?_0x41b015[_0x94d9('0x19')][_0x94d9('0x1c')]||null:null,'include':_0x41b015[_0x94d9('0x19')]?_0x41b015[_0x94d9('0x19')][_0x94d9('0x1d')]?_['map'](_0x41b015[_0x94d9('0x19')][_0x94d9('0x1d')],function(_0x316c9d){return{'model':db[_0x316c9d[_0x94d9('0x1e')]],'as':_0x316c9d['as'],'attributes':_0x316c9d[_0x94d9('0x1b')],'include':_0x316c9d[_0x94d9('0x1d')]?_[_0x94d9('0x1f')](_0x316c9d[_0x94d9('0x1d')],function(_0x5e8238){return{'model':db[_0x5e8238['model']],'as':_0x5e8238['as'],'attributes':_0x5e8238[_0x94d9('0x1b')],'include':_0x5e8238[_0x94d9('0x1d')]?_[_0x94d9('0x1f')](_0x5e8238[_0x94d9('0x1d')],function(_0x21e5d9){return{'model':db[_0x21e5d9[_0x94d9('0x1e')]],'as':_0x21e5d9['as'],'attributes':_0x21e5d9[_0x94d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x94d9('0xc')](function(_0x1ef548){logger[_0x94d9('0xd')]('GetServicenowAccount',_0x41b015);logger[_0x94d9('0x10')]('GetServicenowAccount',_0x41b015,JSON[_0x94d9('0x12')](_0x1ef548));_0xacef60(_0x1ef548);})[_0x94d9('0x20')](function(_0x1d00a2){logger['error'](_0x94d9('0x21'),_0x1d00a2[_0x94d9('0x15')],_0x41b015);_0x308c28(_0x20e7ae[_0x94d9('0x13')](0x1f4,_0x1d00a2['message']));});});};exports[_0x94d9('0x22')]=function(_0x3b15bc){var _0x51c28f=this;return new Promise(function(_0xe022f6,_0x28881f){return db[_0x94d9('0x17')][_0x94d9('0x23')]({'raw':_0x3b15bc[_0x94d9('0x19')]?_0x3b15bc[_0x94d9('0x19')][_0x94d9('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b15bc[_0x94d9('0x19')]?_0x3b15bc['options'][_0x94d9('0x24')]||null:null,'attributes':_0x3b15bc['options']?_0x3b15bc['options'][_0x94d9('0x1b')]||null:null,'include':_0x3b15bc[_0x94d9('0x19')]?_0x3b15bc[_0x94d9('0x19')]['include']?_[_0x94d9('0x1f')](_0x3b15bc[_0x94d9('0x19')]['include'],function(_0xa668e6){return{'model':db[_0xa668e6[_0x94d9('0x1e')]],'as':_0xa668e6['as'],'attributes':_0xa668e6[_0x94d9('0x1b')],'include':_0xa668e6[_0x94d9('0x1d')]?_[_0x94d9('0x1f')](_0xa668e6[_0x94d9('0x1d')],function(_0x3876af){return{'model':db[_0x3876af[_0x94d9('0x1e')]],'as':_0x3876af['as'],'attributes':_0x3876af[_0x94d9('0x1b')],'include':_0x3876af[_0x94d9('0x1d')]?_[_0x94d9('0x1f')](_0x3876af[_0x94d9('0x1d')],function(_0x2cf8e5){return{'model':db[_0x2cf8e5['model']],'as':_0x2cf8e5['as'],'attributes':_0x2cf8e5[_0x94d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x94d9('0xc')](function(_0x493e68){logger[_0x94d9('0xd')]('ShowServicenowAccount',_0x3b15bc);logger[_0x94d9('0x10')](_0x94d9('0x22'),_0x3b15bc,JSON['stringify'](_0x493e68));_0xe022f6(_0x493e68);})[_0x94d9('0x20')](function(_0x1d5d63){logger[_0x94d9('0x13')]('ShowServicenowAccount',_0x1d5d63[_0x94d9('0x15')],_0x3b15bc);_0x28881f(_0x51c28f[_0x94d9('0x13')](0x1f4,_0x1d5d63[_0x94d9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1b01910..85a45a9 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 _0xbf66=['getFields','getSubjects','/:id/descriptions','post','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x347d0a,_0x46fc8c){var _0x5cbe67=function(_0xec5856){while(--_0xec5856){_0x347d0a['push'](_0x347d0a['shift']());}};_0x5cbe67(++_0x46fc8c);}(_0xbf66,0x167));var _0x6bf6=function(_0x3ee1c5,_0x1260ed){_0x3ee1c5=_0x3ee1c5-0x0;var _0x5e4a1f=_0xbf66[_0x3ee1c5];return _0x5e4a1f;};'use strict';var multer=require(_0x6bf6('0x0'));var util=require(_0x6bf6('0x1'));var path=require(_0x6bf6('0x2'));var timeout=require(_0x6bf6('0x3'));var express=require('express');var router=express[_0x6bf6('0x4')]();var auth=require(_0x6bf6('0x5'));var interaction=require(_0x6bf6('0x6'));var config=require(_0x6bf6('0x7'));var controller=require(_0x6bf6('0x8'));router[_0x6bf6('0x9')]('/',auth['isAuthenticated'](),controller[_0x6bf6('0xa')]);router[_0x6bf6('0x9')](_0x6bf6('0xb'),auth[_0x6bf6('0xc')](),controller[_0x6bf6('0xd')]);router[_0x6bf6('0x9')](_0x6bf6('0xe'),auth['isAuthenticated'](),controller[_0x6bf6('0xf')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x6bf6('0x10')]);router[_0x6bf6('0x9')](_0x6bf6('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6bf6('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x6bf6('0xc')](),controller[_0x6bf6('0x13')]);router[_0x6bf6('0x14')](_0x6bf6('0xb'),auth[_0x6bf6('0xc')](),controller[_0x6bf6('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6799=['/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects'];(function(_0x3f74e1,_0x2d9a18){var _0x2df189=function(_0x1fefc9){while(--_0x1fefc9){_0x3f74e1['push'](_0x3f74e1['shift']());}};_0x2df189(++_0x2d9a18);}(_0x6799,0x11a));var _0x9679=function(_0x143e50,_0x1948fc){_0x143e50=_0x143e50-0x0;var _0xf19d57=_0x6799[_0x143e50];return _0xf19d57;};'use strict';var multer=require(_0x9679('0x0'));var util=require(_0x9679('0x1'));var path=require(_0x9679('0x2'));var timeout=require(_0x9679('0x3'));var express=require(_0x9679('0x4'));var router=express[_0x9679('0x5')]();var auth=require(_0x9679('0x6'));var interaction=require(_0x9679('0x7'));var config=require(_0x9679('0x8'));var controller=require(_0x9679('0x9'));router[_0x9679('0xa')]('/',auth[_0x9679('0xb')](),controller[_0x9679('0xc')]);router[_0x9679('0xa')](_0x9679('0xd'),auth[_0x9679('0xb')](),controller[_0x9679('0xe')]);router[_0x9679('0xa')](_0x9679('0xf'),auth[_0x9679('0xb')](),controller[_0x9679('0x10')]);router[_0x9679('0xa')]('/:id/subjects',auth[_0x9679('0xb')](),controller[_0x9679('0x11')]);router[_0x9679('0xa')](_0x9679('0x12'),auth['isAuthenticated'](),controller[_0x9679('0x13')]);router[_0x9679('0x14')]('/',auth[_0x9679('0xb')](),controller['create']);router[_0x9679('0x15')]('/:id',auth[_0x9679('0xb')](),controller[_0x9679('0x16')]);router['delete'](_0x9679('0xd'),auth[_0x9679('0xb')](),controller[_0x9679('0x17')]);module[_0x9679('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 178bd94..ed08e06 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 _0x0236=['STRING','sequelize','exports'];(function(_0x244b30,_0x1aa71e){var _0x4bb583=function(_0x414735){while(--_0x414735){_0x244b30['push'](_0x244b30['shift']());}};_0x4bb583(++_0x1aa71e);}(_0x0236,0x16c));var _0x6023=function(_0x52b91f,_0x499757){_0x52b91f=_0x52b91f-0x0;var _0x15f8f5=_0x0236[_0x52b91f];return _0x15f8f5;};'use strict';var Sequelize=require(_0x6023('0x0'));module[_0x6023('0x1')]={'name':{'type':Sequelize[_0x6023('0x2')]},'description':{'type':Sequelize[_0x6023('0x2')]}}; \ No newline at end of file +var _0xdff5=['sequelize','exports','STRING'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xdff5,0x16e));var _0x5dff=function(_0x883f09,_0xf8baa2){_0x883f09=_0x883f09-0x0;var _0xfc7695=_0xdff5[_0x883f09];return _0xfc7695;};'use strict';var Sequelize=require(_0x5dff('0x0'));module[_0x5dff('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5dff('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 471f024..53d6200 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 _0xdb28=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','stack','name','send','ServicenowConfiguration','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','destroy','getFields','findOne','ServicenowField','order','sort','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce'];(function(_0x3cbfd6,_0x7fa4ac){var _0x3b3ae3=function(_0x171d2d){while(--_0x171d2d){_0x3cbfd6['push'](_0x3cbfd6['shift']());}};_0x3b3ae3(++_0x7fa4ac);}(_0xdb28,0x106));var _0x8db2=function(_0x33eeff,_0x5b82ee){_0x33eeff=_0x33eeff-0x0;var _0x4c7ab1=_0xdb28[_0x33eeff];return _0x4c7ab1;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var hardwareService=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];var jayson=require(_0x8db2('0x17'));var client=jayson[_0x8db2('0x18')][_0x8db2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x37d017,_0x559fb1,_0x49fadc){if(_0x49fadc){var _0x15070d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15070d[_0x8db2('0x1a')](_0x559fb1)){return _0x37d017;}else{throw new Error(_0x8db2('0x1b'));}}else{return _0x37d017;}}function respondWithRpcPromise(_0x1d6a15,_0x227355,_0xfa285b,_0x2f177a){return new BPromise(function(_0x3c96a7,_0x131252){var _0x16c8c2=_0x2f177a||client;return _0x16c8c2['request'](_0x1d6a15,_0xfa285b)[_0x8db2('0x1c')](function(_0x24da1b){logger['info'](_0x8db2('0x1d'),_0x227355,_0x8db2('0x1e'));logger[_0x8db2('0x1f')](_0x8db2('0x20'),_0x227355,_0x8db2('0x1e'),JSON[_0x8db2('0x21')](_0x24da1b));if(_0x24da1b['error']){if(_0x24da1b['error'][_0x8db2('0x22')]===0x1f4){logger[_0x8db2('0x23')](_0x8db2('0x1d'),_0x227355,_0x24da1b[_0x8db2('0x23')]['message']);return _0x131252(_0x24da1b[_0x8db2('0x23')][_0x8db2('0x24')]);}logger[_0x8db2('0x23')](_0x8db2('0x1d'),_0x227355,_0x24da1b[_0x8db2('0x23')]['message']);return _0x3c96a7(_0x24da1b[_0x8db2('0x23')][_0x8db2('0x24')]);}else{logger[_0x8db2('0x25')](_0x8db2('0x1d'),_0x227355,_0x8db2('0x1e'));_0x3c96a7(_0x24da1b[_0x8db2('0x26')][_0x8db2('0x24')]);}})['catch'](function(_0x256202){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x227355,_0x256202);_0x131252(_0x256202);});});}function respondWithStatusCode(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0xcc;return function(_0xec8cd2){if(_0xec8cd2){return _0x52a9ca[_0x8db2('0x27')](_0x4d923c);}return _0x52a9ca[_0x8db2('0x28')](_0x4d923c)[_0x8db2('0x29')]();};}function respondWithResult(_0x145328,_0x8d4f54){_0x8d4f54=_0x8d4f54||0xc8;return function(_0x58cd9d){if(_0x58cd9d){return _0x145328[_0x8db2('0x28')](_0x8d4f54)[_0x8db2('0x2a')](_0x58cd9d);}};}function respondWithFilteredResult(_0x430dd5,_0x8b7cec){return function(_0x483aee){if(_0x483aee){var _0x2e0691=_0x483aee[_0x8db2('0x2b')],_0x11f398=_0x8b7cec[_0x8db2('0x2c')],_0x241baf=_0x8b7cec[_0x8db2('0x2c')]+_0x8b7cec[_0x8db2('0x2d')],_0x1687ed;if(_0x241baf>=_0x2e0691){_0x241baf=_0x2e0691;_0x1687ed=0xc8;}else{_0x1687ed=0xce;}_0x430dd5[_0x8db2('0x28')](_0x1687ed);return _0x430dd5['set'](_0x8db2('0x2e'),_0x11f398+'-'+_0x241baf+'/'+_0x2e0691)['json'](_0x483aee);}return null;};}function patchUpdates(_0x59cb77){return function(_0x302188){try{jsonpatch[_0x8db2('0x2f')](_0x302188,_0x59cb77,!![]);}catch(_0xcc8a66){return BPromise['reject'](_0xcc8a66);}return _0x302188[_0x8db2('0x30')]();};}function saveUpdates(_0x56b71a,_0x3f7aac){return function(_0x2b653b){if(_0x2b653b){return _0x2b653b[_0x8db2('0x31')](_0x56b71a)['then'](function(_0x56e9c1){return _0x56e9c1;});}return null;};}function removeEntity(_0x35d337,_0x1a460b){return function(_0x4df530){if(_0x4df530){return _0x4df530['destroy']()[_0x8db2('0x1c')](function(){_0x35d337[_0x8db2('0x28')](0xcc)[_0x8db2('0x29')]();});}};}function handleEntityNotFound(_0x2a2d65,_0x17ad44){return function(_0xd39848){if(!_0xd39848){_0x2a2d65[_0x8db2('0x27')](0x194);}return _0xd39848;};}function handleError(_0xae31b7,_0x46e0c8){_0x46e0c8=_0x46e0c8||0x1f4;return function(_0x451c29){logger['error'](_0x451c29[_0x8db2('0x32')]);if(_0x451c29[_0x8db2('0x33')]){delete _0x451c29['name'];}_0xae31b7[_0x8db2('0x28')](_0x46e0c8)[_0x8db2('0x34')](_0x451c29);};}exports['index']=function(_0x4bf222,_0x3c1983){var _0x4a45dd={},_0x3dfbaa={},_0x264696={'count':0x0,'rows':[]};var _0x26717d=db[_0x8db2('0x35')]['rawAttributes'];_0x3dfbaa[_0x8db2('0x36')]=_['keys'](_0x26717d);_0x3dfbaa[_0x8db2('0x37')]=_[_0x8db2('0x38')](_0x4bf222[_0x8db2('0x37')]);_0x3dfbaa[_0x8db2('0x39')]=_['intersection'](_0x3dfbaa['model'],_0x3dfbaa[_0x8db2('0x37')]);_0x4a45dd[_0x8db2('0x3a')]=_['intersection'](_0x3dfbaa[_0x8db2('0x36')],qs[_0x8db2('0x3b')](_0x4bf222[_0x8db2('0x37')]['fields']));_0x4a45dd[_0x8db2('0x3a')]=_0x4a45dd[_0x8db2('0x3a')][_0x8db2('0x3c')]?_0x4a45dd[_0x8db2('0x3a')]:_0x3dfbaa[_0x8db2('0x36')];if(!_0x4bf222[_0x8db2('0x37')][_0x8db2('0x3d')](_0x8db2('0x3e'))){_0x4a45dd[_0x8db2('0x2d')]=qs[_0x8db2('0x2d')](_0x4bf222[_0x8db2('0x37')][_0x8db2('0x2d')]);_0x4a45dd[_0x8db2('0x2c')]=qs['offset'](_0x4bf222[_0x8db2('0x37')][_0x8db2('0x2c')]);}_0x4a45dd['order']=qs['sort'](_0x4bf222[_0x8db2('0x37')]['sort']);_0x4a45dd[_0x8db2('0x3f')]=qs[_0x8db2('0x39')](_[_0x8db2('0x40')](_0x4bf222[_0x8db2('0x37')],_0x3dfbaa[_0x8db2('0x39')]));if(_0x4bf222[_0x8db2('0x37')][_0x8db2('0x41')]){_0x4a45dd['where']=_[_0x8db2('0x42')](_0x4a45dd[_0x8db2('0x3f')],{'$or':_[_0x8db2('0x43')](_0x26717d,function(_0x4a0b56){if(_0x4a0b56['type'][_0x8db2('0x44')]!==_0x8db2('0x45')){var _0x22025b={};_0x22025b[_0x4a0b56[_0x8db2('0x46')]]={'$like':'%'+_0x4bf222['query'][_0x8db2('0x41')]+'%'};return _0x22025b;}})});}_0x4a45dd=_['merge']({},_0x4a45dd,_0x4bf222[_0x8db2('0x47')]);var _0x116b69={'where':_0x4a45dd[_0x8db2('0x3f')]};return db['ServicenowConfiguration']['count'](_0x116b69)[_0x8db2('0x1c')](function(_0x47c556){_0x264696[_0x8db2('0x2b')]=_0x47c556;if(_0x4bf222[_0x8db2('0x37')][_0x8db2('0x48')]){_0x4a45dd[_0x8db2('0x49')]=[{'all':!![]}];}return db[_0x8db2('0x35')][_0x8db2('0x4a')](_0x4a45dd);})[_0x8db2('0x1c')](function(_0xab6bdd){_0x264696[_0x8db2('0x4b')]=_0xab6bdd;return _0x264696;})[_0x8db2('0x1c')](respondWithFilteredResult(_0x3c1983,_0x4a45dd))[_0x8db2('0x4c')](handleError(_0x3c1983,null));};exports[_0x8db2('0x4d')]=function(_0x532180,_0x449109){var _0x2ada52={'raw':![],'where':{'id':_0x532180[_0x8db2('0x4e')]['id']}},_0xdbba64={};_0xdbba64['model']=_['keys'](db[_0x8db2('0x35')][_0x8db2('0x4f')]);_0xdbba64[_0x8db2('0x37')]=_['keys'](_0x532180['query']);_0xdbba64['filters']=_[_0x8db2('0x50')](_0xdbba64[_0x8db2('0x36')],_0xdbba64[_0x8db2('0x37')]);_0x2ada52[_0x8db2('0x3a')]=_[_0x8db2('0x50')](_0xdbba64[_0x8db2('0x36')],qs[_0x8db2('0x3b')](_0x532180['query']['fields']));_0x2ada52[_0x8db2('0x3a')]=_0x2ada52[_0x8db2('0x3a')][_0x8db2('0x3c')]?_0x2ada52[_0x8db2('0x3a')]:_0xdbba64[_0x8db2('0x36')];if(_0x532180[_0x8db2('0x37')][_0x8db2('0x48')]){_0x2ada52[_0x8db2('0x49')]=[{'all':!![]}];}_0x2ada52=_[_0x8db2('0x42')]({},_0x2ada52,_0x532180[_0x8db2('0x47')]);return db[_0x8db2('0x35')][_0x8db2('0x51')](_0x2ada52)[_0x8db2('0x1c')](handleEntityNotFound(_0x449109,null))[_0x8db2('0x1c')](respondWithResult(_0x449109,null))[_0x8db2('0x4c')](handleError(_0x449109,null));};exports['create']=function(_0x2ded23,_0xb4b0a){return db['ServicenowConfiguration'][_0x8db2('0x52')](_0x2ded23[_0x8db2('0x53')],{})[_0x8db2('0x1c')](respondWithResult(_0xb4b0a,0xc9))['catch'](handleError(_0xb4b0a,null));};exports[_0x8db2('0x31')]=function(_0x27acd2,_0x1872fa){if(_0x27acd2[_0x8db2('0x53')]['id']){delete _0x27acd2[_0x8db2('0x53')]['id'];}return db['ServicenowConfiguration'][_0x8db2('0x51')]({'where':{'id':_0x27acd2[_0x8db2('0x4e')]['id']}})[_0x8db2('0x1c')](handleEntityNotFound(_0x1872fa,null))['then'](saveUpdates(_0x27acd2[_0x8db2('0x53')],null))[_0x8db2('0x1c')](respondWithResult(_0x1872fa,null))[_0x8db2('0x4c')](handleError(_0x1872fa,null));};exports[_0x8db2('0x54')]=function(_0x2ac590,_0x16d897){return db[_0x8db2('0x35')]['find']({'where':{'id':_0x2ac590[_0x8db2('0x4e')]['id']}})[_0x8db2('0x1c')](handleEntityNotFound(_0x16d897,null))['then'](removeEntity(_0x16d897,null))[_0x8db2('0x4c')](handleError(_0x16d897,null));};exports[_0x8db2('0x55')]=function(_0x533e41,_0x107bbe,_0x927c01){var _0x63e8f7={};var _0x30f4f3={};var _0x42b941;var _0x3c7d8c;return db[_0x8db2('0x35')][_0x8db2('0x56')]({'where':{'id':_0x533e41[_0x8db2('0x4e')]['id']}})[_0x8db2('0x1c')](handleEntityNotFound(_0x107bbe,null))[_0x8db2('0x1c')](function(_0x447a47){if(_0x447a47){_0x42b941=_0x447a47;_0x30f4f3[_0x8db2('0x36')]=_[_0x8db2('0x38')](db[_0x8db2('0x57')][_0x8db2('0x4f')]);_0x30f4f3['query']=_[_0x8db2('0x38')](_0x533e41[_0x8db2('0x37')]);_0x30f4f3[_0x8db2('0x39')]=_[_0x8db2('0x50')](_0x30f4f3[_0x8db2('0x36')],_0x30f4f3['query']);_0x63e8f7[_0x8db2('0x3a')]=_[_0x8db2('0x50')](_0x30f4f3[_0x8db2('0x36')],qs[_0x8db2('0x3b')](_0x533e41[_0x8db2('0x37')][_0x8db2('0x3b')]));_0x63e8f7[_0x8db2('0x3a')]=_0x63e8f7[_0x8db2('0x3a')][_0x8db2('0x3c')]?_0x63e8f7[_0x8db2('0x3a')]:_0x30f4f3[_0x8db2('0x36')];_0x63e8f7[_0x8db2('0x58')]=qs[_0x8db2('0x59')](_0x533e41[_0x8db2('0x37')][_0x8db2('0x59')]);_0x63e8f7[_0x8db2('0x3f')]=qs[_0x8db2('0x39')](_[_0x8db2('0x40')](_0x533e41['query'],_0x30f4f3[_0x8db2('0x39')]));if(_0x533e41['query'][_0x8db2('0x41')]){_0x63e8f7['where']=_[_0x8db2('0x42')](_0x63e8f7[_0x8db2('0x3f')],{'$or':_[_0x8db2('0x43')](_0x63e8f7[_0x8db2('0x3a')],function(_0x1e812e){var _0x59a32e={};_0x59a32e[_0x1e812e]={'$like':'%'+_0x533e41['query'][_0x8db2('0x41')]+'%'};return _0x59a32e;})});}_0x63e8f7=_[_0x8db2('0x42')]({},_0x63e8f7,_0x533e41[_0x8db2('0x47')]);return _0x42b941[_0x8db2('0x55')](_0x63e8f7);}})[_0x8db2('0x1c')](function(_0x1f28d2){if(_0x1f28d2){_0x3c7d8c=_0x1f28d2[_0x8db2('0x3c')];if(!_0x533e41[_0x8db2('0x37')]['hasOwnProperty'](_0x8db2('0x3e'))){_0x63e8f7[_0x8db2('0x2d')]=qs[_0x8db2('0x2d')](_0x533e41[_0x8db2('0x37')][_0x8db2('0x2d')]);_0x63e8f7[_0x8db2('0x2c')]=qs[_0x8db2('0x2c')](_0x533e41[_0x8db2('0x37')]['offset']);}return _0x42b941['getFields'](_0x63e8f7);}})[_0x8db2('0x1c')](function(_0x2f8beb){if(_0x2f8beb){return _0x2f8beb?{'count':_0x3c7d8c,'rows':_0x2f8beb}:null;}})[_0x8db2('0x1c')](respondWithResult(_0x107bbe,null))[_0x8db2('0x4c')](handleError(_0x107bbe,null));};exports[_0x8db2('0x5a')]=function(_0x5a074e,_0x5e8146,_0x3611da){var _0x364807={};var _0x54f0d4={};var _0xa698bd;var _0x2be647;return db[_0x8db2('0x35')]['findOne']({'where':{'id':_0x5a074e[_0x8db2('0x4e')]['id']}})[_0x8db2('0x1c')](handleEntityNotFound(_0x5e8146,null))[_0x8db2('0x1c')](function(_0x4f5458){if(_0x4f5458){_0xa698bd=_0x4f5458;_0x54f0d4[_0x8db2('0x36')]=_[_0x8db2('0x38')](db[_0x8db2('0x57')][_0x8db2('0x4f')]);_0x54f0d4[_0x8db2('0x37')]=_['keys'](_0x5a074e[_0x8db2('0x37')]);_0x54f0d4[_0x8db2('0x39')]=_[_0x8db2('0x50')](_0x54f0d4['model'],_0x54f0d4['query']);_0x364807[_0x8db2('0x3a')]=_[_0x8db2('0x50')](_0x54f0d4['model'],qs[_0x8db2('0x3b')](_0x5a074e[_0x8db2('0x37')][_0x8db2('0x3b')]));_0x364807[_0x8db2('0x3a')]=_0x364807[_0x8db2('0x3a')][_0x8db2('0x3c')]?_0x364807[_0x8db2('0x3a')]:_0x54f0d4[_0x8db2('0x36')];_0x364807[_0x8db2('0x58')]=qs[_0x8db2('0x59')](_0x5a074e[_0x8db2('0x37')][_0x8db2('0x59')]);_0x364807[_0x8db2('0x3f')]=qs['filters'](_[_0x8db2('0x40')](_0x5a074e['query'],_0x54f0d4[_0x8db2('0x39')]));if(_0x5a074e[_0x8db2('0x37')]['filter']){_0x364807[_0x8db2('0x3f')]=_[_0x8db2('0x42')](_0x364807['where'],{'$or':_[_0x8db2('0x43')](_0x364807[_0x8db2('0x3a')],function(_0x27d50a){var _0x25a3ab={};_0x25a3ab[_0x27d50a]={'$like':'%'+_0x5a074e[_0x8db2('0x37')][_0x8db2('0x41')]+'%'};return _0x25a3ab;})});}_0x364807=_[_0x8db2('0x42')]({},_0x364807,_0x5a074e[_0x8db2('0x47')]);return _0xa698bd[_0x8db2('0x5a')](_0x364807);}})['then'](function(_0x4f9fbd){if(_0x4f9fbd){_0x2be647=_0x4f9fbd[_0x8db2('0x3c')];if(!_0x5a074e['query'][_0x8db2('0x3d')](_0x8db2('0x3e'))){_0x364807[_0x8db2('0x2d')]=qs['limit'](_0x5a074e[_0x8db2('0x37')][_0x8db2('0x2d')]);_0x364807[_0x8db2('0x2c')]=qs['offset'](_0x5a074e[_0x8db2('0x37')][_0x8db2('0x2c')]);}return _0xa698bd[_0x8db2('0x5a')](_0x364807);}})[_0x8db2('0x1c')](function(_0x48a618){if(_0x48a618){return _0x48a618?{'count':_0x2be647,'rows':_0x48a618}:null;}})[_0x8db2('0x1c')](respondWithResult(_0x5e8146,null))[_0x8db2('0x4c')](handleError(_0x5e8146,null));};exports[_0x8db2('0x5b')]=function(_0x1edb1a,_0xcf1c42,_0x15fd4){var _0x1aadfb={};var _0x3682bf={};var _0x358f48;var _0x3cec24;return db[_0x8db2('0x35')]['findOne']({'where':{'id':_0x1edb1a[_0x8db2('0x4e')]['id']}})[_0x8db2('0x1c')](handleEntityNotFound(_0xcf1c42,null))[_0x8db2('0x1c')](function(_0x4b297f){if(_0x4b297f){_0x358f48=_0x4b297f;_0x3682bf['model']=_['keys'](db[_0x8db2('0x57')][_0x8db2('0x4f')]);_0x3682bf[_0x8db2('0x37')]=_[_0x8db2('0x38')](_0x1edb1a[_0x8db2('0x37')]);_0x3682bf[_0x8db2('0x39')]=_[_0x8db2('0x50')](_0x3682bf[_0x8db2('0x36')],_0x3682bf[_0x8db2('0x37')]);_0x1aadfb[_0x8db2('0x3a')]=_[_0x8db2('0x50')](_0x3682bf['model'],qs[_0x8db2('0x3b')](_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x3b')]));_0x1aadfb[_0x8db2('0x3a')]=_0x1aadfb['attributes']['length']?_0x1aadfb[_0x8db2('0x3a')]:_0x3682bf[_0x8db2('0x36')];_0x1aadfb['order']=qs[_0x8db2('0x59')](_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x59')]);_0x1aadfb['where']=qs['filters'](_['pick'](_0x1edb1a[_0x8db2('0x37')],_0x3682bf[_0x8db2('0x39')]));if(_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x41')]){_0x1aadfb[_0x8db2('0x3f')]=_['merge'](_0x1aadfb[_0x8db2('0x3f')],{'$or':_['map'](_0x1aadfb[_0x8db2('0x3a')],function(_0x353101){var _0xa083b1={};_0xa083b1[_0x353101]={'$like':'%'+_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x41')]+'%'};return _0xa083b1;})});}_0x1aadfb=_['merge']({},_0x1aadfb,_0x1edb1a['options']);return _0x358f48[_0x8db2('0x5b')](_0x1aadfb);}})['then'](function(_0x6c74f2){if(_0x6c74f2){_0x3cec24=_0x6c74f2[_0x8db2('0x3c')];if(!_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x3d')](_0x8db2('0x3e'))){_0x1aadfb[_0x8db2('0x2d')]=qs['limit'](_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x2d')]);_0x1aadfb[_0x8db2('0x2c')]=qs['offset'](_0x1edb1a[_0x8db2('0x37')][_0x8db2('0x2c')]);}return _0x358f48['getDescriptions'](_0x1aadfb);}})[_0x8db2('0x1c')](function(_0x7cb97d){if(_0x7cb97d){return _0x7cb97d?{'count':_0x3cec24,'rows':_0x7cb97d}:null;}})[_0x8db2('0x1c')](respondWithResult(_0xcf1c42,null))[_0x8db2('0x4c')](handleError(_0xcf1c42,null));}; \ No newline at end of file +var _0x1261=['util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','name','send','ServicenowConfiguration','keys','query','intersection','attributes','model','fields','length','nolimit','limit','order','sort','filter','where','merge','type','key','options','includeAll','rows','params','include','find','create','body','destroy','getFields','findOne','ServicenowField','rawAttributes','filters','pick','map','hasOwnProperty','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1e51cf,_0x2afaa1){var _0x5925c9=function(_0x5c6207){while(--_0x5c6207){_0x1e51cf['push'](_0x1e51cf['shift']());}};_0x5925c9(++_0x2afaa1);}(_0x1261,0x144));var _0x1126=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x1261[_0x9a7ea6];return _0x1c2040;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1126('0x16'));var client=jayson[_0x1126('0x17')][_0x1126('0x18')]({'port':0x232a});function checkPasswordPattern(_0x273896,_0xca0355,_0x3f10e9){if(_0x3f10e9){var _0xd8ca42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd8ca42[_0x1126('0x19')](_0xca0355)){return _0x273896;}else{throw new Error(_0x1126('0x1a'));}}else{return _0x273896;}}function respondWithRpcPromise(_0x53a8f0,_0x5de9a7,_0x1af673,_0x154e20){return new BPromise(function(_0x279455,_0x4be0c6){var _0x45149c=_0x154e20||client;return _0x45149c['request'](_0x53a8f0,_0x1af673)[_0x1126('0x1b')](function(_0x42f379){logger[_0x1126('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x1126('0x1d'));logger[_0x1126('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5de9a7,'request\x20sent',JSON[_0x1126('0x1f')](_0x42f379));if(_0x42f379[_0x1126('0x20')]){if(_0x42f379['error']['code']===0x1f4){logger[_0x1126('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x42f379[_0x1126('0x20')][_0x1126('0x21')]);return _0x4be0c6(_0x42f379[_0x1126('0x20')]['message']);}logger[_0x1126('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x42f379['error'][_0x1126('0x21')]);return _0x279455(_0x42f379[_0x1126('0x20')][_0x1126('0x21')]);}else{logger[_0x1126('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x1126('0x1d'));_0x279455(_0x42f379[_0x1126('0x22')]['message']);}})[_0x1126('0x23')](function(_0x59cd8e){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5de9a7,_0x59cd8e);_0x4be0c6(_0x59cd8e);});});}function respondWithStatusCode(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0xcc;return function(_0x329914){if(_0x329914){return _0x2199d9[_0x1126('0x24')](_0x15bcc3);}return _0x2199d9[_0x1126('0x25')](_0x15bcc3)[_0x1126('0x26')]();};}function respondWithResult(_0xea0971,_0x38119d){_0x38119d=_0x38119d||0xc8;return function(_0x589725){if(_0x589725){return _0xea0971[_0x1126('0x25')](_0x38119d)[_0x1126('0x27')](_0x589725);}};}function respondWithFilteredResult(_0xa293f4,_0x5ddf63){return function(_0x541bc9){if(_0x541bc9){var _0xeb7d89=_0x541bc9[_0x1126('0x28')],_0x39bf0e=_0x5ddf63['offset'],_0x55e195=_0x5ddf63[_0x1126('0x29')]+_0x5ddf63['limit'],_0x2fb797;if(_0x55e195>=_0xeb7d89){_0x55e195=_0xeb7d89;_0x2fb797=0xc8;}else{_0x2fb797=0xce;}_0xa293f4[_0x1126('0x25')](_0x2fb797);return _0xa293f4['set'](_0x1126('0x2a'),_0x39bf0e+'-'+_0x55e195+'/'+_0xeb7d89)['json'](_0x541bc9);}return null;};}function patchUpdates(_0x378f4d){return function(_0x5f2611){try{jsonpatch['apply'](_0x5f2611,_0x378f4d,!![]);}catch(_0x4a53ab){return BPromise[_0x1126('0x2b')](_0x4a53ab);}return _0x5f2611[_0x1126('0x2c')]();};}function saveUpdates(_0x1cef48,_0x5b8bea){return function(_0x2a3055){if(_0x2a3055){return _0x2a3055[_0x1126('0x2d')](_0x1cef48)['then'](function(_0x3dd50e){return _0x3dd50e;});}return null;};}function removeEntity(_0x1e80aa,_0x2d8127){return function(_0x29fbfa){if(_0x29fbfa){return _0x29fbfa['destroy']()['then'](function(){_0x1e80aa[_0x1126('0x25')](0xcc)[_0x1126('0x26')]();});}};}function handleEntityNotFound(_0x2d9bd2,_0x2c67eb){return function(_0x55244a){if(!_0x55244a){_0x2d9bd2[_0x1126('0x24')](0x194);}return _0x55244a;};}function handleError(_0x6f4312,_0x313ebe){_0x313ebe=_0x313ebe||0x1f4;return function(_0x22436c){logger[_0x1126('0x20')](_0x22436c['stack']);if(_0x22436c[_0x1126('0x2e')]){delete _0x22436c[_0x1126('0x2e')];}_0x6f4312[_0x1126('0x25')](_0x313ebe)[_0x1126('0x2f')](_0x22436c);};}exports['index']=function(_0x4ca51c,_0x22827a){var _0x31d07c={},_0x511e6b={},_0xde37cf={'count':0x0,'rows':[]};var _0xf3c21b=db[_0x1126('0x30')]['rawAttributes'];_0x511e6b['model']=_[_0x1126('0x31')](_0xf3c21b);_0x511e6b[_0x1126('0x32')]=_[_0x1126('0x31')](_0x4ca51c[_0x1126('0x32')]);_0x511e6b['filters']=_[_0x1126('0x33')](_0x511e6b['model'],_0x511e6b[_0x1126('0x32')]);_0x31d07c[_0x1126('0x34')]=_[_0x1126('0x33')](_0x511e6b[_0x1126('0x35')],qs[_0x1126('0x36')](_0x4ca51c['query'][_0x1126('0x36')]));_0x31d07c[_0x1126('0x34')]=_0x31d07c[_0x1126('0x34')][_0x1126('0x37')]?_0x31d07c[_0x1126('0x34')]:_0x511e6b[_0x1126('0x35')];if(!_0x4ca51c[_0x1126('0x32')]['hasOwnProperty'](_0x1126('0x38'))){_0x31d07c[_0x1126('0x39')]=qs[_0x1126('0x39')](_0x4ca51c[_0x1126('0x32')][_0x1126('0x39')]);_0x31d07c['offset']=qs['offset'](_0x4ca51c[_0x1126('0x32')][_0x1126('0x29')]);}_0x31d07c[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0x4ca51c[_0x1126('0x32')][_0x1126('0x3b')]);_0x31d07c['where']=qs['filters'](_['pick'](_0x4ca51c[_0x1126('0x32')],_0x511e6b['filters']));if(_0x4ca51c[_0x1126('0x32')][_0x1126('0x3c')]){_0x31d07c[_0x1126('0x3d')]=_[_0x1126('0x3e')](_0x31d07c['where'],{'$or':_['map'](_0xf3c21b,function(_0x353042){if(_0x353042[_0x1126('0x3f')][_0x1126('0x40')]!=='VIRTUAL'){var _0x2f8551={};_0x2f8551[_0x353042['field']]={'$like':'%'+_0x4ca51c[_0x1126('0x32')]['filter']+'%'};return _0x2f8551;}})});}_0x31d07c=_[_0x1126('0x3e')]({},_0x31d07c,_0x4ca51c[_0x1126('0x41')]);var _0x1006fb={'where':_0x31d07c['where']};return db[_0x1126('0x30')][_0x1126('0x28')](_0x1006fb)[_0x1126('0x1b')](function(_0x48c694){_0xde37cf['count']=_0x48c694;if(_0x4ca51c['query'][_0x1126('0x42')]){_0x31d07c['include']=[{'all':!![]}];}return db[_0x1126('0x30')]['findAll'](_0x31d07c);})[_0x1126('0x1b')](function(_0x323499){_0xde37cf[_0x1126('0x43')]=_0x323499;return _0xde37cf;})[_0x1126('0x1b')](respondWithFilteredResult(_0x22827a,_0x31d07c))[_0x1126('0x23')](handleError(_0x22827a,null));};exports['show']=function(_0x198173,_0x512f60){var _0x5111d3={'raw':![],'where':{'id':_0x198173[_0x1126('0x44')]['id']}},_0x1a15f8={};_0x1a15f8['model']=_[_0x1126('0x31')](db[_0x1126('0x30')]['rawAttributes']);_0x1a15f8[_0x1126('0x32')]=_[_0x1126('0x31')](_0x198173[_0x1126('0x32')]);_0x1a15f8['filters']=_[_0x1126('0x33')](_0x1a15f8[_0x1126('0x35')],_0x1a15f8[_0x1126('0x32')]);_0x5111d3[_0x1126('0x34')]=_[_0x1126('0x33')](_0x1a15f8[_0x1126('0x35')],qs[_0x1126('0x36')](_0x198173[_0x1126('0x32')]['fields']));_0x5111d3[_0x1126('0x34')]=_0x5111d3['attributes'][_0x1126('0x37')]?_0x5111d3[_0x1126('0x34')]:_0x1a15f8['model'];if(_0x198173['query'][_0x1126('0x42')]){_0x5111d3[_0x1126('0x45')]=[{'all':!![]}];}_0x5111d3=_[_0x1126('0x3e')]({},_0x5111d3,_0x198173['options']);return db[_0x1126('0x30')][_0x1126('0x46')](_0x5111d3)[_0x1126('0x1b')](handleEntityNotFound(_0x512f60,null))[_0x1126('0x1b')](respondWithResult(_0x512f60,null))['catch'](handleError(_0x512f60,null));};exports[_0x1126('0x47')]=function(_0x46551f,_0x5c36b9){return db['ServicenowConfiguration']['create'](_0x46551f['body'],{})[_0x1126('0x1b')](respondWithResult(_0x5c36b9,0xc9))[_0x1126('0x23')](handleError(_0x5c36b9,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x48')]['id']){delete _0x16552b[_0x1126('0x48')]['id'];}return db[_0x1126('0x30')]['find']({'where':{'id':_0x16552b[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x48')],null))[_0x1126('0x1b')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x23')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x49')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x30')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x1b')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x4a')]=function(_0x2340f8,_0x5763b4,_0x30812d){var _0x25038f={};var _0x9bad53={};var _0x5a5340;var _0x2fe6dc;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0x2340f8[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x5763b4,null))[_0x1126('0x1b')](function(_0x30c848){if(_0x30c848){_0x5a5340=_0x30c848;_0x9bad53[_0x1126('0x35')]=_['keys'](db[_0x1126('0x4c')][_0x1126('0x4d')]);_0x9bad53[_0x1126('0x32')]=_[_0x1126('0x31')](_0x2340f8[_0x1126('0x32')]);_0x9bad53['filters']=_[_0x1126('0x33')](_0x9bad53[_0x1126('0x35')],_0x9bad53['query']);_0x25038f[_0x1126('0x34')]=_['intersection'](_0x9bad53[_0x1126('0x35')],qs[_0x1126('0x36')](_0x2340f8['query'][_0x1126('0x36')]));_0x25038f[_0x1126('0x34')]=_0x25038f[_0x1126('0x34')]['length']?_0x25038f[_0x1126('0x34')]:_0x9bad53['model'];_0x25038f['order']=qs[_0x1126('0x3b')](_0x2340f8[_0x1126('0x32')][_0x1126('0x3b')]);_0x25038f[_0x1126('0x3d')]=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0x2340f8[_0x1126('0x32')],_0x9bad53['filters']));if(_0x2340f8[_0x1126('0x32')][_0x1126('0x3c')]){_0x25038f[_0x1126('0x3d')]=_[_0x1126('0x3e')](_0x25038f[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x25038f['attributes'],function(_0x5b17d6){var _0x16a343={};_0x16a343[_0x5b17d6]={'$like':'%'+_0x2340f8[_0x1126('0x32')]['filter']+'%'};return _0x16a343;})});}_0x25038f=_['merge']({},_0x25038f,_0x2340f8['options']);return _0x5a5340['getFields'](_0x25038f);}})[_0x1126('0x1b')](function(_0x37b1ab){if(_0x37b1ab){_0x2fe6dc=_0x37b1ab[_0x1126('0x37')];if(!_0x2340f8['query'][_0x1126('0x51')](_0x1126('0x38'))){_0x25038f[_0x1126('0x39')]=qs[_0x1126('0x39')](_0x2340f8[_0x1126('0x32')][_0x1126('0x39')]);_0x25038f[_0x1126('0x29')]=qs['offset'](_0x2340f8[_0x1126('0x32')][_0x1126('0x29')]);}return _0x5a5340[_0x1126('0x4a')](_0x25038f);}})[_0x1126('0x1b')](function(_0x288b9b){if(_0x288b9b){return _0x288b9b?{'count':_0x2fe6dc,'rows':_0x288b9b}:null;}})['then'](respondWithResult(_0x5763b4,null))['catch'](handleError(_0x5763b4,null));};exports[_0x1126('0x52')]=function(_0x2643d7,_0x4f1b61,_0x3bf25d){var _0x1fb2f0={};var _0x366675={};var _0x6a41c0;var _0x2828d4;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0x2643d7[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x4f1b61,null))[_0x1126('0x1b')](function(_0x16e48a){if(_0x16e48a){_0x6a41c0=_0x16e48a;_0x366675[_0x1126('0x35')]=_[_0x1126('0x31')](db['ServicenowField'][_0x1126('0x4d')]);_0x366675[_0x1126('0x32')]=_[_0x1126('0x31')](_0x2643d7['query']);_0x366675['filters']=_[_0x1126('0x33')](_0x366675[_0x1126('0x35')],_0x366675[_0x1126('0x32')]);_0x1fb2f0[_0x1126('0x34')]=_['intersection'](_0x366675['model'],qs['fields'](_0x2643d7[_0x1126('0x32')][_0x1126('0x36')]));_0x1fb2f0[_0x1126('0x34')]=_0x1fb2f0[_0x1126('0x34')]['length']?_0x1fb2f0[_0x1126('0x34')]:_0x366675['model'];_0x1fb2f0[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0x2643d7[_0x1126('0x32')][_0x1126('0x3b')]);_0x1fb2f0[_0x1126('0x3d')]=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0x2643d7['query'],_0x366675[_0x1126('0x4e')]));if(_0x2643d7['query'][_0x1126('0x3c')]){_0x1fb2f0[_0x1126('0x3d')]=_['merge'](_0x1fb2f0[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x1fb2f0['attributes'],function(_0x29daa6){var _0x1442ab={};_0x1442ab[_0x29daa6]={'$like':'%'+_0x2643d7['query']['filter']+'%'};return _0x1442ab;})});}_0x1fb2f0=_[_0x1126('0x3e')]({},_0x1fb2f0,_0x2643d7[_0x1126('0x41')]);return _0x6a41c0[_0x1126('0x52')](_0x1fb2f0);}})['then'](function(_0x4d007b){if(_0x4d007b){_0x2828d4=_0x4d007b['length'];if(!_0x2643d7[_0x1126('0x32')]['hasOwnProperty']('nolimit')){_0x1fb2f0[_0x1126('0x39')]=qs['limit'](_0x2643d7[_0x1126('0x32')][_0x1126('0x39')]);_0x1fb2f0['offset']=qs[_0x1126('0x29')](_0x2643d7[_0x1126('0x32')][_0x1126('0x29')]);}return _0x6a41c0[_0x1126('0x52')](_0x1fb2f0);}})[_0x1126('0x1b')](function(_0x5e9872){if(_0x5e9872){return _0x5e9872?{'count':_0x2828d4,'rows':_0x5e9872}:null;}})[_0x1126('0x1b')](respondWithResult(_0x4f1b61,null))[_0x1126('0x23')](handleError(_0x4f1b61,null));};exports['getDescriptions']=function(_0xd182b1,_0x2d6fcf,_0x2c0908){var _0x2af2d0={};var _0x2598a7={};var _0x2cf3b9;var _0x59512b;return db[_0x1126('0x30')][_0x1126('0x4b')]({'where':{'id':_0xd182b1[_0x1126('0x44')]['id']}})[_0x1126('0x1b')](handleEntityNotFound(_0x2d6fcf,null))[_0x1126('0x1b')](function(_0x2010a9){if(_0x2010a9){_0x2cf3b9=_0x2010a9;_0x2598a7[_0x1126('0x35')]=_[_0x1126('0x31')](db[_0x1126('0x4c')]['rawAttributes']);_0x2598a7[_0x1126('0x32')]=_[_0x1126('0x31')](_0xd182b1[_0x1126('0x32')]);_0x2598a7[_0x1126('0x4e')]=_[_0x1126('0x33')](_0x2598a7['model'],_0x2598a7[_0x1126('0x32')]);_0x2af2d0['attributes']=_['intersection'](_0x2598a7[_0x1126('0x35')],qs[_0x1126('0x36')](_0xd182b1['query']['fields']));_0x2af2d0[_0x1126('0x34')]=_0x2af2d0[_0x1126('0x34')][_0x1126('0x37')]?_0x2af2d0[_0x1126('0x34')]:_0x2598a7[_0x1126('0x35')];_0x2af2d0[_0x1126('0x3a')]=qs[_0x1126('0x3b')](_0xd182b1[_0x1126('0x32')][_0x1126('0x3b')]);_0x2af2d0['where']=qs[_0x1126('0x4e')](_[_0x1126('0x4f')](_0xd182b1[_0x1126('0x32')],_0x2598a7[_0x1126('0x4e')]));if(_0xd182b1[_0x1126('0x32')][_0x1126('0x3c')]){_0x2af2d0['where']=_[_0x1126('0x3e')](_0x2af2d0[_0x1126('0x3d')],{'$or':_[_0x1126('0x50')](_0x2af2d0[_0x1126('0x34')],function(_0x12cdc6){var _0x1796eb={};_0x1796eb[_0x12cdc6]={'$like':'%'+_0xd182b1[_0x1126('0x32')][_0x1126('0x3c')]+'%'};return _0x1796eb;})});}_0x2af2d0=_[_0x1126('0x3e')]({},_0x2af2d0,_0xd182b1[_0x1126('0x41')]);return _0x2cf3b9['getDescriptions'](_0x2af2d0);}})['then'](function(_0x271d7c){if(_0x271d7c){_0x59512b=_0x271d7c['length'];if(!_0xd182b1[_0x1126('0x32')]['hasOwnProperty'](_0x1126('0x38'))){_0x2af2d0['limit']=qs[_0x1126('0x39')](_0xd182b1['query']['limit']);_0x2af2d0['offset']=qs[_0x1126('0x29')](_0xd182b1[_0x1126('0x32')]['offset']);}return _0x2cf3b9['getDescriptions'](_0x2af2d0);}})[_0x1126('0x1b')](function(_0xe2f82d){if(_0xe2f82d){return _0xe2f82d?{'count':_0x59512b,'rows':_0xe2f82d}:null;}})[_0x1126('0x1b')](respondWithResult(_0x2d6fcf,null))['catch'](handleError(_0x2d6fcf,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ea64492..e9a1e60 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 _0x92bc=['path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x92bc,0x182));var _0xc92b=function(_0x449add,_0x1bbcbc){_0x449add=_0x449add-0x0;var _0x25de4e=_0x92bc[_0x449add];return _0x25de4e;};'use strict';var _=require(_0xc92b('0x0'));var util=require('util');var logger=require(_0xc92b('0x1'))('api');var moment=require(_0xc92b('0x2'));var BPromise=require(_0xc92b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc92b('0x4'));var rimraf=require('rimraf');var config=require(_0xc92b('0x5'));var attributes=require(_0xc92b('0x6'));module[_0xc92b('0x7')]=function(_0x251e02,_0x172413){return _0x251e02['define'](_0xc92b('0x8'),attributes,{'tableName':_0xc92b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaa5=['util','api','bluebird','request-promise','path','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x5eb447,_0x3645fc){var _0x1ab8d6=function(_0x554dab){while(--_0x554dab){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1ab8d6(++_0x3645fc);}(_0xcaa5,0x1e8));var _0x5caa=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0xcaa5[_0x1f7839];return _0x36b42e;};'use strict';var _=require('lodash');var util=require(_0x5caa('0x0'));var logger=require('../../config/logger')(_0x5caa('0x1'));var moment=require('moment');var BPromise=require(_0x5caa('0x2'));var rp=require(_0x5caa('0x3'));var fs=require('fs');var path=require(_0x5caa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x43514f,_0x40d7e1){return _0x43514f[_0x5caa('0x5')](_0x5caa('0x6'),attributes,{'tableName':_0x5caa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index ef47652..bc63833 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 _0x7fcf=['../../config/environment','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2046dd,_0x40a9ab){var _0x2eb055=function(_0x1c65e8){while(--_0x1c65e8){_0x2046dd['push'](_0x2046dd['shift']());}};_0x2eb055(++_0x40a9ab);}(_0x7fcf,0x103));var _0xf7fc=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x7fcf[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xf7fc('0x0'));var util=require(_0xf7fc('0x1'));var moment=require(_0xf7fc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7fc('0x3'));var db=require(_0xf7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7fc('0x5'))(_0xf7fc('0x6'));var config=require(_0xf7fc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58b6e3,_0x164796,_0x36523b){return new BPromise(function(_0x223c19,_0x5d41ac){return client['request'](_0x58b6e3,_0x36523b)['then'](function(_0x125335){logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x164796,_0xf7fc('0xb'));logger[_0xf7fc('0xc')](_0xf7fc('0xd'),_0x164796,'request\x20sent',JSON['stringify'](_0x125335));if(_0x125335['error']){if(_0x125335[_0xf7fc('0xe')][_0xf7fc('0xf')]===0x1f4){logger[_0xf7fc('0xe')](_0xf7fc('0xa'),_0x164796,_0x125335[_0xf7fc('0xe')]['message']);return _0x5d41ac(_0x125335[_0xf7fc('0xe')][_0xf7fc('0x10')]);}logger[_0xf7fc('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x164796,_0x125335[_0xf7fc('0xe')][_0xf7fc('0x10')]);return _0x223c19(_0x125335['error'][_0xf7fc('0x10')]);}else{logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x164796,_0xf7fc('0xb'));_0x223c19(_0x125335[_0xf7fc('0x11')][_0xf7fc('0x10')]);}})[_0xf7fc('0x12')](function(_0x5cc56a){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x164796,_0x5cc56a);_0x5d41ac(_0x5cc56a);});});} \ No newline at end of file +var _0x4bab=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x21ca2a,_0x469aee){var _0x1ba7fd=function(_0x4b1d7d){while(--_0x4b1d7d){_0x21ca2a['push'](_0x21ca2a['shift']());}};_0x1ba7fd(++_0x469aee);}(_0x4bab,0x1ca));var _0xb4ba=function(_0x5ab773,_0xbeec7b){_0x5ab773=_0x5ab773-0x0;var _0x3c210e=_0x4bab[_0x5ab773];return _0x3c210e;};'use strict';var _=require(_0xb4ba('0x0'));var util=require(_0xb4ba('0x1'));var moment=require(_0xb4ba('0x2'));var BPromise=require(_0xb4ba('0x3'));var rs=require(_0xb4ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4ba('0x5'))['db'];var utils=require(_0xb4ba('0x6'));var logger=require(_0xb4ba('0x7'))(_0xb4ba('0x8'));var config=require(_0xb4ba('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19d4cb,_0x3adc42,_0x352a09){return new BPromise(function(_0x5a265b,_0x11096c){return client[_0xb4ba('0xa')](_0x19d4cb,_0x352a09)[_0xb4ba('0xb')](function(_0x54c816){logger[_0xb4ba('0xc')](_0xb4ba('0xd'),_0x3adc42,_0xb4ba('0xe'));logger[_0xb4ba('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3adc42,_0xb4ba('0xe'),JSON[_0xb4ba('0x10')](_0x54c816));if(_0x54c816['error']){if(_0x54c816[_0xb4ba('0x11')][_0xb4ba('0x12')]===0x1f4){logger[_0xb4ba('0x11')](_0xb4ba('0xd'),_0x3adc42,_0x54c816[_0xb4ba('0x11')]['message']);return _0x11096c(_0x54c816[_0xb4ba('0x11')]['message']);}logger[_0xb4ba('0x11')](_0xb4ba('0xd'),_0x3adc42,_0x54c816[_0xb4ba('0x11')]['message']);return _0x5a265b(_0x54c816[_0xb4ba('0x11')][_0xb4ba('0x13')]);}else{logger[_0xb4ba('0xc')](_0xb4ba('0xd'),_0x3adc42,_0xb4ba('0xe'));_0x5a265b(_0x54c816[_0xb4ba('0x14')][_0xb4ba('0x13')]);}})[_0xb4ba('0x15')](function(_0x55a8fb){logger[_0xb4ba('0x11')](_0xb4ba('0xd'),_0x3adc42,_0x55a8fb);_0x11096c(_0x55a8fb);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6ec0da2..c0d2155 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 _0x024f=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','show','create','/:id','update','destroy'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x024f,0x141));var _0xf024=function(_0x103cb9,_0x1e7c01){_0x103cb9=_0x103cb9-0x0;var _0x33fb26=_0x024f[_0x103cb9];return _0x33fb26;};'use strict';var multer=require(_0xf024('0x0'));var util=require(_0xf024('0x1'));var path=require('path');var timeout=require(_0xf024('0x2'));var express=require(_0xf024('0x3'));var router=express[_0xf024('0x4')]();var auth=require(_0xf024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf024('0x6'));var controller=require(_0xf024('0x7'));router[_0xf024('0x8')]('/',auth[_0xf024('0x9')](),controller['index']);router[_0xf024('0x8')]('/:id',auth[_0xf024('0x9')](),controller[_0xf024('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf024('0xb')]);router['put'](_0xf024('0xc'),auth[_0xf024('0x9')](),controller[_0xf024('0xd')]);router['delete']('/:id',auth[_0xf024('0x9')](),controller[_0xf024('0xe')]);module[_0xf024('0xf')]=router; \ No newline at end of file +var _0xabdf=['exports','util','connect-timeout','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x238860,_0x1852d5){var _0x557cfe=function(_0x38f84d){while(--_0x38f84d){_0x238860['push'](_0x238860['shift']());}};_0x557cfe(++_0x1852d5);}(_0xabdf,0x121));var _0xfabd=function(_0x764251,_0xf88528){_0x764251=_0x764251-0x0;var _0x4c8e5a=_0xabdf[_0x764251];return _0x4c8e5a;};'use strict';var multer=require('multer');var util=require(_0xfabd('0x0'));var path=require('path');var timeout=require(_0xfabd('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xfabd('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfabd('0x3'));var controller=require(_0xfabd('0x4'));router[_0xfabd('0x5')]('/',auth[_0xfabd('0x6')](),controller[_0xfabd('0x7')]);router['get'](_0xfabd('0x8'),auth[_0xfabd('0x6')](),controller[_0xfabd('0x9')]);router[_0xfabd('0xa')]('/',auth[_0xfabd('0x6')](),controller[_0xfabd('0xb')]);router[_0xfabd('0xc')](_0xfabd('0x8'),auth[_0xfabd('0x6')](),controller[_0xfabd('0xd')]);router[_0xfabd('0xe')](_0xfabd('0x8'),auth[_0xfabd('0x6')](),controller['destroy']);module[_0xfabd('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d897d11..12a3988 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 _0xb4e6=['customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xb4e6[_0x4b6830];return _0x239e4a;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),_0x6b4e('0x4'),_0x6b4e('0x5')),'defaultValue':_0x6b4e('0x2')},'content':{'type':Sequelize[_0x6b4e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6b4e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbdb7=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x546ca4,_0x2f0016){_0x546ca4=_0x546ca4-0x0;var _0x47e1bd=_0xbdb7[_0x546ca4];return _0x47e1bd;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'type':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3'),_0x7bdb('0x4'),_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x3')},'content':{'type':Sequelize[_0x7bdb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7bdb('0x2')]('string','variable',_0x7bdb('0x5'))},'keyContent':{'type':Sequelize[_0x7bdb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7bdb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7bdb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 842b9ef..072c612 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 _0xdb28=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','ServicenowField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','map','type','key','filter','options','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0xfdd53e,_0x3b5c33){var _0x52aa14=function(_0x3dcb68){while(--_0x3dcb68){_0xfdd53e['push'](_0xfdd53e['shift']());}};_0x52aa14(++_0x3b5c33);}(_0xdb28,0x106));var _0x8db2=function(_0x126c83,_0x7b9c05){_0x126c83=_0x126c83-0x0;var _0x2bff2b=_0xdb28[_0x126c83];return _0x2bff2b;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var hardwareService=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];function respondWithStatusCode(_0x3b2faa,_0x1349f6){_0x1349f6=_0x1349f6||0xcc;return function(_0x204f49){if(_0x204f49){return _0x3b2faa[_0x8db2('0x17')](_0x1349f6);}return _0x3b2faa['status'](_0x1349f6)['end']();};}function respondWithResult(_0x15070d,_0x15e87c){_0x15e87c=_0x15e87c||0xc8;return function(_0x350d61){if(_0x350d61){return _0x15070d[_0x8db2('0x18')](_0x15e87c)[_0x8db2('0x19')](_0x350d61);}};}function respondWithFilteredResult(_0xfa285b,_0x2f177a){return function(_0x3c96a7){if(_0x3c96a7){var _0x131252=_0x3c96a7[_0x8db2('0x1a')],_0x16c8c2=_0x2f177a['offset'],_0x5489a9=_0x2f177a[_0x8db2('0x1b')]+_0x2f177a[_0x8db2('0x1c')],_0x13b0f5;if(_0x5489a9>=_0x131252){_0x5489a9=_0x131252;_0x13b0f5=0xc8;}else{_0x13b0f5=0xce;}_0xfa285b[_0x8db2('0x18')](_0x13b0f5);return _0xfa285b[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x16c8c2+'-'+_0x5489a9+'/'+_0x131252)[_0x8db2('0x19')](_0x3c96a7);}return null;};}function patchUpdates(_0x51d60d){return function(_0x5df464){try{jsonpatch[_0x8db2('0x1f')](_0x5df464,_0x51d60d,!![]);}catch(_0x104e33){return BPromise[_0x8db2('0x20')](_0x104e33);}return _0x5df464[_0x8db2('0x21')]();};}function saveUpdates(_0x58562e,_0x431d60){return function(_0x36a9ff){if(_0x36a9ff){return _0x36a9ff[_0x8db2('0x22')](_0x58562e)[_0x8db2('0x23')](function(_0x3dbe8e){return _0x3dbe8e;});}return null;};}function removeEntity(_0x597260,_0x124467){return function(_0x3e30e6){if(_0x3e30e6){return _0x3e30e6[_0x8db2('0x24')]()[_0x8db2('0x23')](function(){_0x597260[_0x8db2('0x18')](0xcc)[_0x8db2('0x25')]();});}};}function handleEntityNotFound(_0x796ec1,_0x5c6614){return function(_0x256202){if(!_0x256202){_0x796ec1['sendStatus'](0x194);}return _0x256202;};}function handleError(_0x5725f0,_0x52a9ca){_0x52a9ca=_0x52a9ca||0x1f4;return function(_0x4d923c){logger[_0x8db2('0x26')](_0x4d923c[_0x8db2('0x27')]);if(_0x4d923c[_0x8db2('0x28')]){delete _0x4d923c[_0x8db2('0x28')];}_0x5725f0[_0x8db2('0x18')](_0x52a9ca)[_0x8db2('0x29')](_0x4d923c);};}exports['index']=function(_0x3544ba,_0x372311){var _0x430dd5={},_0x8b7cec={},_0x483aee={'count':0x0,'rows':[]};var _0x2e0691=db[_0x8db2('0x2a')][_0x8db2('0x2b')];_0x8b7cec[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0x2e0691);_0x8b7cec[_0x8db2('0x2e')]=_[_0x8db2('0x2d')](_0x3544ba[_0x8db2('0x2e')]);_0x8b7cec[_0x8db2('0x2f')]=_['intersection'](_0x8b7cec[_0x8db2('0x2c')],_0x8b7cec['query']);_0x430dd5['attributes']=_[_0x8db2('0x30')](_0x8b7cec[_0x8db2('0x2c')],qs[_0x8db2('0x31')](_0x3544ba['query'][_0x8db2('0x31')]));_0x430dd5['attributes']=_0x430dd5[_0x8db2('0x32')][_0x8db2('0x33')]?_0x430dd5[_0x8db2('0x32')]:_0x8b7cec['model'];if(!_0x3544ba['query'][_0x8db2('0x34')](_0x8db2('0x35'))){_0x430dd5['limit']=qs['limit'](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1c')]);_0x430dd5[_0x8db2('0x1b')]=qs[_0x8db2('0x1b')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1b')]);}_0x430dd5[_0x8db2('0x36')]=qs[_0x8db2('0x37')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x37')]);_0x430dd5['where']=qs[_0x8db2('0x2f')](_[_0x8db2('0x38')](_0x3544ba['query'],_0x8b7cec[_0x8db2('0x2f')]));if(_0x3544ba[_0x8db2('0x2e')]['filter']){_0x430dd5['where']=_[_0x8db2('0x39')](_0x430dd5['where'],{'$or':_[_0x8db2('0x3a')](_0x2e0691,function(_0x264696){if(_0x264696[_0x8db2('0x3b')][_0x8db2('0x3c')]!=='VIRTUAL'){var _0x2d3e98={};_0x2d3e98[_0x264696['field']]={'$like':'%'+_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x3d')]+'%'};return _0x2d3e98;}})});}_0x430dd5=_[_0x8db2('0x39')]({},_0x430dd5,_0x3544ba[_0x8db2('0x3e')]);var _0x50e88a={'where':_0x430dd5['where']};return db[_0x8db2('0x2a')][_0x8db2('0x1a')](_0x50e88a)['then'](function(_0x2bac57){_0x483aee[_0x8db2('0x1a')]=_0x2bac57;if(_0x3544ba[_0x8db2('0x2e')]['includeAll']){_0x430dd5[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x2a')][_0x8db2('0x40')](_0x430dd5);})[_0x8db2('0x23')](function(_0x2e6f0c){_0x483aee[_0x8db2('0x41')]=_0x2e6f0c;return _0x483aee;})[_0x8db2('0x23')](respondWithFilteredResult(_0x372311,_0x430dd5))[_0x8db2('0x42')](handleError(_0x372311,null));};exports[_0x8db2('0x43')]=function(_0x63c561,_0x21cf7c){var _0x20bf0b={'raw':!![],'where':{'id':_0x63c561['params']['id']}},_0x1d9025={};_0x1d9025[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](db['ServicenowField']['rawAttributes']);_0x1d9025[_0x8db2('0x2e')]=_['keys'](_0x63c561[_0x8db2('0x2e')]);_0x1d9025[_0x8db2('0x2f')]=_[_0x8db2('0x30')](_0x1d9025[_0x8db2('0x2c')],_0x1d9025[_0x8db2('0x2e')]);_0x20bf0b[_0x8db2('0x32')]=_[_0x8db2('0x30')](_0x1d9025['model'],qs[_0x8db2('0x31')](_0x63c561[_0x8db2('0x2e')][_0x8db2('0x31')]));_0x20bf0b[_0x8db2('0x32')]=_0x20bf0b['attributes'][_0x8db2('0x33')]?_0x20bf0b[_0x8db2('0x32')]:_0x1d9025[_0x8db2('0x2c')];if(_0x63c561[_0x8db2('0x2e')]['includeAll']){_0x20bf0b[_0x8db2('0x3f')]=[{'all':!![]}];}_0x20bf0b=_['merge']({},_0x20bf0b,_0x63c561[_0x8db2('0x3e')]);return db[_0x8db2('0x2a')][_0x8db2('0x44')](_0x20bf0b)['then'](handleEntityNotFound(_0x21cf7c,null))['then'](respondWithResult(_0x21cf7c,null))[_0x8db2('0x42')](handleError(_0x21cf7c,null));};exports['create']=function(_0x173cc7,_0x467866){return db[_0x8db2('0x2a')][_0x8db2('0x45')](_0x173cc7[_0x8db2('0x46')],{})[_0x8db2('0x23')](respondWithResult(_0x467866,0xc9))[_0x8db2('0x42')](handleError(_0x467866,null));};exports[_0x8db2('0x22')]=function(_0x4291e3,_0x12a1ef){if(_0x4291e3[_0x8db2('0x46')]['id']){delete _0x4291e3[_0x8db2('0x46')]['id'];}return db['ServicenowField'][_0x8db2('0x44')]({'where':{'id':_0x4291e3[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x12a1ef,null))[_0x8db2('0x23')](saveUpdates(_0x4291e3['body'],null))['then'](respondWithResult(_0x12a1ef,null))[_0x8db2('0x42')](handleError(_0x12a1ef,null));};exports[_0x8db2('0x24')]=function(_0x164020,_0x4c66e5){return db['ServicenowField']['find']({'where':{'id':_0x164020[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x23')](removeEntity(_0x4c66e5,null))[_0x8db2('0x42')](handleError(_0x4c66e5,null));}; \ No newline at end of file +var _0x0b0e=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','filter','options','ServicenowField','includeAll','include','findAll','rows','catch','find','create','body','params','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x233eab,_0x5c910f){var _0x288cc3=function(_0x399690){while(--_0x399690){_0x233eab['push'](_0x233eab['shift']());}};_0x288cc3(++_0x5c910f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0x0b0e[_0x2dee2f];return _0x327c18;};'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 hardwareService=require(_0xe0b0('0x12'));var logger=require(_0xe0b0('0x13'))('api');var utils=require(_0xe0b0('0x14'));var config=require(_0xe0b0('0x15'));var db=require(_0xe0b0('0x16'))['db'];function respondWithStatusCode(_0x585615,_0x3068c0){_0x3068c0=_0x3068c0||0xcc;return function(_0x1c358a){if(_0x1c358a){return _0x585615[_0xe0b0('0x17')](_0x3068c0);}return _0x585615[_0xe0b0('0x18')](_0x3068c0)[_0xe0b0('0x19')]();};}function respondWithResult(_0x4d2bf7,_0x3782be){_0x3782be=_0x3782be||0xc8;return function(_0x154de6){if(_0x154de6){return _0x4d2bf7[_0xe0b0('0x18')](_0x3782be)[_0xe0b0('0x1a')](_0x154de6);}};}function respondWithFilteredResult(_0x177c24,_0x55d884){return function(_0x41a7e2){if(_0x41a7e2){var _0x5adb01=_0x41a7e2[_0xe0b0('0x1b')],_0x35cb40=_0x55d884['offset'],_0xadee6e=_0x55d884[_0xe0b0('0x1c')]+_0x55d884[_0xe0b0('0x1d')],_0x519ae8;if(_0xadee6e>=_0x5adb01){_0xadee6e=_0x5adb01;_0x519ae8=0xc8;}else{_0x519ae8=0xce;}_0x177c24['status'](_0x519ae8);return _0x177c24['set'](_0xe0b0('0x1e'),_0x35cb40+'-'+_0xadee6e+'/'+_0x5adb01)['json'](_0x41a7e2);}return null;};}function patchUpdates(_0x4df8da){return function(_0x4bce65){try{jsonpatch[_0xe0b0('0x1f')](_0x4bce65,_0x4df8da,!![]);}catch(_0x50fa4a){return BPromise['reject'](_0x50fa4a);}return _0x4bce65[_0xe0b0('0x20')]();};}function saveUpdates(_0x59dff5,_0x472286){return function(_0x5dba2f){if(_0x5dba2f){return _0x5dba2f[_0xe0b0('0x21')](_0x59dff5)[_0xe0b0('0x22')](function(_0x3e10b3){return _0x3e10b3;});}return null;};}function removeEntity(_0x310a6d,_0x2cf6a1){return function(_0x58b804){if(_0x58b804){return _0x58b804['destroy']()[_0xe0b0('0x22')](function(){_0x310a6d['status'](0xcc)[_0xe0b0('0x19')]();});}};}function handleEntityNotFound(_0x31b5f8,_0x513e63){return function(_0x170ad8){if(!_0x170ad8){_0x31b5f8['sendStatus'](0x194);}return _0x170ad8;};}function handleError(_0x2208d0,_0x49a727){_0x49a727=_0x49a727||0x1f4;return function(_0x28586d){logger['error'](_0x28586d[_0xe0b0('0x23')]);if(_0x28586d['name']){delete _0x28586d[_0xe0b0('0x24')];}_0x2208d0['status'](_0x49a727)[_0xe0b0('0x25')](_0x28586d);};}exports['index']=function(_0x362aba,_0x3c3bc2){var _0x1f1ebd={},_0x1d91ad={},_0x3ec2={'count':0x0,'rows':[]};var _0x10745d=db['ServicenowField'][_0xe0b0('0x26')];_0x1d91ad[_0xe0b0('0x27')]=_['keys'](_0x10745d);_0x1d91ad[_0xe0b0('0x28')]=_[_0xe0b0('0x29')](_0x362aba[_0xe0b0('0x28')]);_0x1d91ad[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x1d91ad[_0xe0b0('0x27')],_0x1d91ad[_0xe0b0('0x28')]);_0x1f1ebd['attributes']=_[_0xe0b0('0x2b')](_0x1d91ad[_0xe0b0('0x27')],qs['fields'](_0x362aba['query'][_0xe0b0('0x2c')]));_0x1f1ebd[_0xe0b0('0x2d')]=_0x1f1ebd[_0xe0b0('0x2d')][_0xe0b0('0x2e')]?_0x1f1ebd[_0xe0b0('0x2d')]:_0x1d91ad['model'];if(!_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x2f')](_0xe0b0('0x30'))){_0x1f1ebd[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x362aba['query'][_0xe0b0('0x1d')]);_0x1f1ebd[_0xe0b0('0x1c')]=qs[_0xe0b0('0x1c')](_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x1c')]);}_0x1f1ebd[_0xe0b0('0x31')]=qs[_0xe0b0('0x32')](_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x32')]);_0x1f1ebd[_0xe0b0('0x33')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x34')](_0x362aba[_0xe0b0('0x28')],_0x1d91ad[_0xe0b0('0x2a')]));if(_0x362aba[_0xe0b0('0x28')]['filter']){_0x1f1ebd[_0xe0b0('0x33')]=_[_0xe0b0('0x35')](_0x1f1ebd[_0xe0b0('0x33')],{'$or':_[_0xe0b0('0x36')](_0x10745d,function(_0x1a2d24){if(_0x1a2d24[_0xe0b0('0x37')][_0xe0b0('0x38')]!=='VIRTUAL'){var _0x521243={};_0x521243[_0x1a2d24['field']]={'$like':'%'+_0x362aba['query'][_0xe0b0('0x39')]+'%'};return _0x521243;}})});}_0x1f1ebd=_[_0xe0b0('0x35')]({},_0x1f1ebd,_0x362aba[_0xe0b0('0x3a')]);var _0x4e4b20={'where':_0x1f1ebd[_0xe0b0('0x33')]};return db[_0xe0b0('0x3b')][_0xe0b0('0x1b')](_0x4e4b20)[_0xe0b0('0x22')](function(_0x563e28){_0x3ec2[_0xe0b0('0x1b')]=_0x563e28;if(_0x362aba[_0xe0b0('0x28')][_0xe0b0('0x3c')]){_0x1f1ebd[_0xe0b0('0x3d')]=[{'all':!![]}];}return db[_0xe0b0('0x3b')][_0xe0b0('0x3e')](_0x1f1ebd);})[_0xe0b0('0x22')](function(_0x115a69){_0x3ec2[_0xe0b0('0x3f')]=_0x115a69;return _0x3ec2;})['then'](respondWithFilteredResult(_0x3c3bc2,_0x1f1ebd))[_0xe0b0('0x40')](handleError(_0x3c3bc2,null));};exports['show']=function(_0x34178d,_0x2d5f47){var _0x46c4ea={'raw':!![],'where':{'id':_0x34178d['params']['id']}},_0x74f3fa={};_0x74f3fa[_0xe0b0('0x27')]=_[_0xe0b0('0x29')](db[_0xe0b0('0x3b')][_0xe0b0('0x26')]);_0x74f3fa[_0xe0b0('0x28')]=_[_0xe0b0('0x29')](_0x34178d[_0xe0b0('0x28')]);_0x74f3fa[_0xe0b0('0x2a')]=_['intersection'](_0x74f3fa[_0xe0b0('0x27')],_0x74f3fa[_0xe0b0('0x28')]);_0x46c4ea['attributes']=_['intersection'](_0x74f3fa[_0xe0b0('0x27')],qs[_0xe0b0('0x2c')](_0x34178d['query'][_0xe0b0('0x2c')]));_0x46c4ea[_0xe0b0('0x2d')]=_0x46c4ea[_0xe0b0('0x2d')][_0xe0b0('0x2e')]?_0x46c4ea[_0xe0b0('0x2d')]:_0x74f3fa['model'];if(_0x34178d['query']['includeAll']){_0x46c4ea[_0xe0b0('0x3d')]=[{'all':!![]}];}_0x46c4ea=_[_0xe0b0('0x35')]({},_0x46c4ea,_0x34178d['options']);return db[_0xe0b0('0x3b')][_0xe0b0('0x41')](_0x46c4ea)[_0xe0b0('0x22')](handleEntityNotFound(_0x2d5f47,null))[_0xe0b0('0x22')](respondWithResult(_0x2d5f47,null))[_0xe0b0('0x40')](handleError(_0x2d5f47,null));};exports['create']=function(_0x57d4b0,_0x2405ae){return db[_0xe0b0('0x3b')][_0xe0b0('0x42')](_0x57d4b0[_0xe0b0('0x43')],{})[_0xe0b0('0x22')](respondWithResult(_0x2405ae,0xc9))['catch'](handleError(_0x2405ae,null));};exports[_0xe0b0('0x21')]=function(_0x11d4fd,_0x534340){if(_0x11d4fd['body']['id']){delete _0x11d4fd['body']['id'];}return db[_0xe0b0('0x3b')][_0xe0b0('0x41')]({'where':{'id':_0x11d4fd[_0xe0b0('0x44')]['id']}})[_0xe0b0('0x22')](handleEntityNotFound(_0x534340,null))['then'](saveUpdates(_0x11d4fd[_0xe0b0('0x43')],null))[_0xe0b0('0x22')](respondWithResult(_0x534340,null))['catch'](handleError(_0x534340,null));};exports['destroy']=function(_0x2365be,_0x1bc6e0){return db['ServicenowField'][_0xe0b0('0x41')]({'where':{'id':_0x2365be[_0xe0b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1bc6e0,null))['then'](removeEntity(_0x1bc6e0,null))[_0xe0b0('0x40')](handleError(_0x1bc6e0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ce18eb2..5422847 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 _0xf5af=['api','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x1b401d,_0x5101c0){var _0x1185c2=function(_0x2f3a9e){while(--_0x2f3a9e){_0x1b401d['push'](_0x1b401d['shift']());}};_0x1185c2(++_0x5101c0);}(_0xf5af,0x85));var _0xff5a=function(_0x3dd61d,_0x20a875){_0x3dd61d=_0x3dd61d-0x0;var _0xb4bbdf=_0xf5af[_0x3dd61d];return _0xb4bbdf;};'use strict';var _=require(_0xff5a('0x0'));var util=require(_0xff5a('0x1'));var logger=require('../../config/logger')(_0xff5a('0x2'));var moment=require('moment');var BPromise=require(_0xff5a('0x3'));var rp=require(_0xff5a('0x4'));var fs=require('fs');var path=require(_0xff5a('0x5'));var rimraf=require(_0xff5a('0x6'));var config=require('../../config/environment');var attributes=require(_0xff5a('0x7'));module[_0xff5a('0x8')]=function(_0x41a49b,_0x4562c4){return _0x41a49b[_0xff5a('0x9')](_0xff5a('0xa'),attributes,{'tableName':_0xff5a('0xb'),'paranoid':![],'indexes':[{'name':_0xff5a('0xc'),'fields':[_0xff5a('0xd'),_0xff5a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5adf=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','FieldId','lodash','util'];(function(_0x13ace7,_0x1e144c){var _0x10d77e=function(_0x2c4f68){while(--_0x2c4f68){_0x13ace7['push'](_0x13ace7['shift']());}};_0x10d77e(++_0x1e144c);}(_0x5adf,0xa7));var _0xf5ad=function(_0x31b606,_0x147364){_0x31b606=_0x31b606-0x0;var _0x1998a6=_0x5adf[_0x31b606];return _0x1998a6;};'use strict';var _=require(_0xf5ad('0x0'));var util=require(_0xf5ad('0x1'));var logger=require(_0xf5ad('0x2'))(_0xf5ad('0x3'));var moment=require(_0xf5ad('0x4'));var BPromise=require('bluebird');var rp=require(_0xf5ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5ad('0x6'));var config=require(_0xf5ad('0x7'));var attributes=require(_0xf5ad('0x8'));module['exports']=function(_0x186f65,_0x51a96b){return _0x186f65[_0xf5ad('0x9')](_0xf5ad('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xf5ad('0xb'),'fields':['idField',_0xf5ad('0xc')],'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 82d8491..f103302 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4c6c46,_0x4d5b50){var _0x4eca5e=function(_0x2478b3){while(--_0x2478b3){_0x4c6c46['push'](_0x4c6c46['shift']());}};_0x4eca5e(++_0x4d5b50);}(_0x524e,0x15e));var _0xe524=function(_0x3faa56,_0x4398d7){_0x3faa56=_0x3faa56-0x0;var _0x5d1e8b=_0x524e[_0x3faa56];return _0x5d1e8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('ServicenowField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('ServicenowField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('ServicenowField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x5430=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5430,0x10c));var _0x0543=function(_0x2e0841,_0x3f0f09){_0x2e0841=_0x2e0841-0x0;var _0x5772e3=_0x5430[_0x2e0841];return _0x5772e3;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('ServicenowField,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('ServicenowField,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 182b13f..97b591d 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 _0x7366=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','put','delete','destroy','multer','util','path'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x7366,0x6b));var _0x6736=function(_0x26a74d,_0x37ecfc){_0x26a74d=_0x26a74d-0x0;var _0xcbb1a3=_0x7366[_0x26a74d];return _0xcbb1a3;};'use strict';var multer=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var path=require(_0x6736('0x2'));var timeout=require(_0x6736('0x3'));var express=require(_0x6736('0x4'));var router=express[_0x6736('0x5')]();var auth=require(_0x6736('0x6'));var interaction=require(_0x6736('0x7'));var config=require('../../config/environment');var controller=require(_0x6736('0x8'));router[_0x6736('0x9')]('/',auth[_0x6736('0xa')](),controller[_0x6736('0xb')]);router[_0x6736('0x9')](_0x6736('0xc'),auth[_0x6736('0xa')](),controller[_0x6736('0xd')]);router[_0x6736('0x9')]('/:id/configurations',auth[_0x6736('0xa')](),controller[_0x6736('0xe')]);router[_0x6736('0x9')](_0x6736('0xf'),auth[_0x6736('0xa')](),controller['getFields']);router[_0x6736('0x10')]('/',auth['isAuthenticated'](),controller[_0x6736('0x11')]);router[_0x6736('0x10')](_0x6736('0x12'),auth[_0x6736('0xa')](),controller['addConfiguration']);router[_0x6736('0x13')](_0x6736('0xc'),auth[_0x6736('0xa')](),controller['update']);router[_0x6736('0x14')](_0x6736('0xc'),auth[_0x6736('0xa')](),controller[_0x6736('0x15')]);module['exports']=router; \ No newline at end of file +var _0x51e1=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x51e1,0xb3));var _0x151e=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x51e1[_0x53f897];return _0x6879f8;};'use strict';var multer=require(_0x151e('0x0'));var util=require(_0x151e('0x1'));var path=require(_0x151e('0x2'));var timeout=require(_0x151e('0x3'));var express=require(_0x151e('0x4'));var router=express[_0x151e('0x5')]();var auth=require(_0x151e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x151e('0x7'));var controller=require(_0x151e('0x8'));router[_0x151e('0x9')]('/',auth['isAuthenticated'](),controller[_0x151e('0xa')]);router[_0x151e('0x9')](_0x151e('0xb'),auth[_0x151e('0xc')](),controller[_0x151e('0xd')]);router[_0x151e('0x9')]('/:id/configurations',auth[_0x151e('0xc')](),controller[_0x151e('0xe')]);router[_0x151e('0x9')](_0x151e('0xf'),auth[_0x151e('0xc')](),controller[_0x151e('0x10')]);router[_0x151e('0x11')]('/',auth[_0x151e('0xc')](),controller['create']);router['post'](_0x151e('0x12'),auth[_0x151e('0xc')](),controller[_0x151e('0x13')]);router[_0x151e('0x14')](_0x151e('0xb'),auth[_0x151e('0xc')](),controller[_0x151e('0x15')]);router[_0x151e('0x16')](_0x151e('0xb'),auth['isAuthenticated'](),controller[_0x151e('0x17')]);module[_0x151e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 952b981..b7fc89c 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 _0xc756=['username','sequelize','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc756,0x105));var _0x6c75=function(_0x4bef17,_0x5691d3){_0x4bef17=_0x4bef17-0x0;var _0x297a7f=_0xc756[_0x4bef17];return _0x297a7f;};'use strict';var Sequelize=require(_0x6c75('0x0'));module[_0x6c75('0x1')]={'name':{'type':Sequelize[_0x6c75('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6c75('0x2')],'unique':_0x6c75('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6c75('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaecb=['remoteUri','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaecb,0x89));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xbaec('0x0')]={'name':{'type':Sequelize[_0xbaec('0x1')]},'description':{'type':Sequelize[_0xbaec('0x1')]},'username':{'type':Sequelize[_0xbaec('0x1')],'unique':_0xbaec('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xbaec('0x3')},'serverUrl':{'type':Sequelize[_0xbaec('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 73e84e5..18deefd 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 _0x7153=['keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','rawAttributes','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','length','filter','hasOwnProperty','AccountId','Subjects','channel','getDescriptions','SugarcrmField','Descriptions','assigned_user_id','date_start','duration_hours','duration_minutes','parent_type','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','remove','includes','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','api','../../config/utils','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','SugarcrmAccount','model'];(function(_0x317d2f,_0x23283e){var _0x218bfa=function(_0x4e4b3f){while(--_0x4e4b3f){_0x317d2f['push'](_0x317d2f['shift']());}};_0x218bfa(++_0x23283e);}(_0x7153,0x136));var _0x3715=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0x7153[_0x4ab99];return _0x29e39c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3715('0x0'));var rimraf=require(_0x3715('0x1'));var zipdir=require(_0x3715('0x2'));var jsonpatch=require(_0x3715('0x3'));var rp=require(_0x3715('0x4'));var moment=require('moment');var BPromise=require(_0x3715('0x5'));var Mustache=require(_0x3715('0x6'));var util=require(_0x3715('0x7'));var path=require('path');var sox=require(_0x3715('0x8'));var csv=require(_0x3715('0x9'));var ejs=require(_0x3715('0xa'));var fs=require('fs');var _=require(_0x3715('0xb'));var squel=require('squel');var crypto=require(_0x3715('0xc'));var jsforce=require(_0x3715('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3715('0x9'));var querystring=require(_0x3715('0xe'));var Papa=require('papaparse');var Redis=require(_0x3715('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3715('0x10'));var utils=require(_0x3715('0x11'));var config=require('../../config/environment');var db=require(_0x3715('0x12'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x3715('0x13'));var client=jayson[_0x3715('0x14')][_0x3715('0x15')]({'port':0x232a});function checkPasswordPattern(_0x218250,_0x2dcf69,_0x509c80){if(_0x509c80){var _0x444788=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x444788['test'](_0x2dcf69)){return _0x218250;}else{throw new Error(_0x3715('0x16'));}}else{return _0x218250;}}function respondWithRpcPromise(_0x18a3aa,_0x487872,_0x21895f,_0x3f7163){return new BPromise(function(_0x166ff4,_0x1dcde1){var _0x41d917=_0x3f7163||client;return _0x41d917[_0x3715('0x17')](_0x18a3aa,_0x21895f)['then'](function(_0x4f19b1){logger[_0x3715('0x18')](_0x3715('0x19'),_0x487872,_0x3715('0x1a'));logger[_0x3715('0x1b')](_0x3715('0x1c'),_0x487872,'request\x20sent',JSON[_0x3715('0x1d')](_0x4f19b1));if(_0x4f19b1[_0x3715('0x1e')]){if(_0x4f19b1[_0x3715('0x1e')][_0x3715('0x1f')]===0x1f4){logger['error'](_0x3715('0x19'),_0x487872,_0x4f19b1['error']['message']);return _0x1dcde1(_0x4f19b1[_0x3715('0x1e')]['message']);}logger[_0x3715('0x1e')](_0x3715('0x19'),_0x487872,_0x4f19b1[_0x3715('0x1e')]['message']);return _0x166ff4(_0x4f19b1[_0x3715('0x1e')][_0x3715('0x20')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x487872,_0x3715('0x1a'));_0x166ff4(_0x4f19b1[_0x3715('0x21')][_0x3715('0x20')]);}})[_0x3715('0x22')](function(_0x1132bd){logger[_0x3715('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x487872,_0x1132bd);_0x1dcde1(_0x1132bd);});});}function respondWithStatusCode(_0x42c70a,_0x345be4){_0x345be4=_0x345be4||0xcc;return function(_0x49b0a3){if(_0x49b0a3){return _0x42c70a[_0x3715('0x23')](_0x345be4);}return _0x42c70a[_0x3715('0x24')](_0x345be4)[_0x3715('0x25')]();};}function respondWithResult(_0x3673ed,_0x37d5fa){_0x37d5fa=_0x37d5fa||0xc8;return function(_0x512dc6){if(_0x512dc6){return _0x3673ed['status'](_0x37d5fa)[_0x3715('0x26')](_0x512dc6);}};}function respondWithFilteredResult(_0x2f60f9,_0x17722e){return function(_0x4fdc19){if(_0x4fdc19){var _0x159171=_0x4fdc19[_0x3715('0x27')],_0xe64a77=_0x17722e[_0x3715('0x28')],_0x3f48ac=_0x17722e[_0x3715('0x28')]+_0x17722e[_0x3715('0x29')],_0x282037;if(_0x3f48ac>=_0x159171){_0x3f48ac=_0x159171;_0x282037=0xc8;}else{_0x282037=0xce;}_0x2f60f9[_0x3715('0x24')](_0x282037);return _0x2f60f9[_0x3715('0x2a')](_0x3715('0x2b'),_0xe64a77+'-'+_0x3f48ac+'/'+_0x159171)[_0x3715('0x26')](_0x4fdc19);}return null;};}function patchUpdates(_0x105d57){return function(_0x17bac9){try{jsonpatch[_0x3715('0x2c')](_0x17bac9,_0x105d57,!![]);}catch(_0xb50e65){return BPromise['reject'](_0xb50e65);}return _0x17bac9['save']();};}function saveUpdates(_0x135ac9,_0x68cfc3){return function(_0x402553){if(_0x402553){return _0x402553[_0x3715('0x2d')](_0x135ac9)[_0x3715('0x2e')](function(_0x3340dc){return _0x3340dc;});}return null;};}function removeEntity(_0x3f7d32,_0x16b0df){return function(_0x501921){if(_0x501921){return _0x501921[_0x3715('0x2f')]()[_0x3715('0x2e')](function(){_0x3f7d32[_0x3715('0x24')](0xcc)[_0x3715('0x25')]();});}};}function handleEntityNotFound(_0x48f353,_0x42b8b1){return function(_0x226f95){if(!_0x226f95){_0x48f353[_0x3715('0x23')](0x194);}return _0x226f95;};}function handleError(_0x53a8c1,_0x5efa86){_0x5efa86=_0x5efa86||0x1f4;return function(_0x5c6075){logger[_0x3715('0x1e')](_0x5c6075[_0x3715('0x30')]);if(_0x5c6075['name']){delete _0x5c6075[_0x3715('0x31')];}_0x53a8c1[_0x3715('0x24')](_0x5efa86)[_0x3715('0x32')](_0x5c6075);};}exports['index']=function(_0x318765,_0x58ef58){var _0x37246b={},_0xb90a3b={},_0x3c6fe4={'count':0x0,'rows':[]};var _0x3b178b=db[_0x3715('0x33')]['rawAttributes'];_0xb90a3b[_0x3715('0x34')]=_[_0x3715('0x35')](_0x3b178b);_0xb90a3b[_0x3715('0x36')]=_[_0x3715('0x35')](_0x318765[_0x3715('0x36')]);_0xb90a3b[_0x3715('0x37')]=_['intersection'](_0xb90a3b[_0x3715('0x34')],_0xb90a3b['query']);_0x37246b[_0x3715('0x38')]=_[_0x3715('0x39')](_0xb90a3b[_0x3715('0x34')],qs[_0x3715('0x3a')](_0x318765[_0x3715('0x36')]['fields']));_0x37246b['attributes']=_0x37246b['attributes']['length']?_0x37246b[_0x3715('0x38')]:_0xb90a3b[_0x3715('0x34')];if(!_0x318765['query']['hasOwnProperty'](_0x3715('0x3b'))){_0x37246b[_0x3715('0x29')]=qs[_0x3715('0x29')](_0x318765[_0x3715('0x36')]['limit']);_0x37246b[_0x3715('0x28')]=qs[_0x3715('0x28')](_0x318765[_0x3715('0x36')][_0x3715('0x28')]);}_0x37246b[_0x3715('0x3c')]=qs[_0x3715('0x3d')](_0x318765[_0x3715('0x36')][_0x3715('0x3d')]);_0x37246b[_0x3715('0x3e')]=qs[_0x3715('0x37')](_[_0x3715('0x3f')](_0x318765['query'],_0xb90a3b[_0x3715('0x37')]));if(_0x318765['query']['filter']){_0x37246b[_0x3715('0x3e')]=_[_0x3715('0x40')](_0x37246b[_0x3715('0x3e')],{'$or':_[_0x3715('0x41')](_0x3b178b,function(_0x46f444){if(_0x46f444[_0x3715('0x42')][_0x3715('0x43')]!==_0x3715('0x44')){var _0x4d6bec={};_0x4d6bec[_0x46f444[_0x3715('0x45')]]={'$like':'%'+_0x318765[_0x3715('0x36')]['filter']+'%'};return _0x4d6bec;}})});}_0x37246b=_[_0x3715('0x40')]({},_0x37246b,_0x318765[_0x3715('0x46')]);var _0x47f2d0={'where':_0x37246b[_0x3715('0x3e')]};return db[_0x3715('0x33')][_0x3715('0x27')](_0x47f2d0)[_0x3715('0x2e')](function(_0x2f66f6){_0x3c6fe4[_0x3715('0x27')]=_0x2f66f6;if(_0x318765['query'][_0x3715('0x47')]){_0x37246b[_0x3715('0x48')]=[{'all':!![]}];}return db[_0x3715('0x33')][_0x3715('0x49')](_0x37246b);})[_0x3715('0x2e')](function(_0x3c1ead){_0x3c6fe4[_0x3715('0x4a')]=_0x3c1ead;return _0x3c6fe4;})[_0x3715('0x2e')](respondWithFilteredResult(_0x58ef58,_0x37246b))['catch'](handleError(_0x58ef58,null));};exports['show']=function(_0x274776,_0x2d1fa6){var _0xb323fe={'raw':![],'where':{'id':_0x274776[_0x3715('0x4b')]['id']}},_0x33debc={};_0x33debc[_0x3715('0x34')]=_['keys'](db[_0x3715('0x33')][_0x3715('0x4c')]);_0x33debc[_0x3715('0x36')]=_[_0x3715('0x35')](_0x274776[_0x3715('0x36')]);_0x33debc['filters']=_[_0x3715('0x39')](_0x33debc[_0x3715('0x34')],_0x33debc[_0x3715('0x36')]);_0xb323fe[_0x3715('0x38')]=_[_0x3715('0x39')](_0x33debc[_0x3715('0x34')],qs[_0x3715('0x3a')](_0x274776[_0x3715('0x36')][_0x3715('0x3a')]));_0xb323fe[_0x3715('0x38')]=_0xb323fe[_0x3715('0x38')]['length']?_0xb323fe[_0x3715('0x38')]:_0x33debc[_0x3715('0x34')];if(_0x274776[_0x3715('0x36')]['includeAll']){_0xb323fe[_0x3715('0x48')]=[{'all':!![]}];}_0xb323fe=_[_0x3715('0x40')]({},_0xb323fe,_0x274776[_0x3715('0x46')]);return db['SugarcrmAccount']['find'](_0xb323fe)[_0x3715('0x2e')](handleEntityNotFound(_0x2d1fa6,null))[_0x3715('0x2e')](respondWithResult(_0x2d1fa6,null))['catch'](handleError(_0x2d1fa6,null));};exports[_0x3715('0x4d')]=function(_0x80de26,_0x4babf9){return db[_0x3715('0x33')][_0x3715('0x4d')](_0x80de26[_0x3715('0x4e')],{})[_0x3715('0x2e')](respondWithResult(_0x4babf9,0xc9))[_0x3715('0x22')](handleError(_0x4babf9,null));};exports['update']=function(_0x4a2235,_0x14e663){if(_0x4a2235['body']['id']){delete _0x4a2235[_0x3715('0x4e')]['id'];}return db[_0x3715('0x33')]['find']({'where':{'id':_0x4a2235[_0x3715('0x4b')]['id']}})[_0x3715('0x2e')](handleEntityNotFound(_0x14e663,null))[_0x3715('0x2e')](saveUpdates(_0x4a2235[_0x3715('0x4e')],null))[_0x3715('0x2e')](respondWithResult(_0x14e663,null))[_0x3715('0x22')](handleError(_0x14e663,null));};exports[_0x3715('0x2f')]=function(_0x57a39d,_0x213e27){return db[_0x3715('0x33')][_0x3715('0x4f')]({'where':{'id':_0x57a39d[_0x3715('0x4b')]['id']}})[_0x3715('0x2e')](handleEntityNotFound(_0x213e27,null))[_0x3715('0x2e')](removeEntity(_0x213e27,null))['catch'](handleError(_0x213e27,null));};exports[_0x3715('0x50')]=function(_0x3782bf,_0xe08689,_0x1b7bb5){var _0x2c63ab={};var _0x3d60ca={};var _0x2e3ded;var _0x202718;return db[_0x3715('0x33')][_0x3715('0x51')]({'where':{'id':_0x3782bf[_0x3715('0x4b')]['id']}})[_0x3715('0x2e')](handleEntityNotFound(_0xe08689,null))['then'](function(_0x5c67f7){if(_0x5c67f7){_0x2e3ded=_0x5c67f7;_0x3d60ca['model']=_[_0x3715('0x35')](db[_0x3715('0x52')]['rawAttributes']);_0x3d60ca[_0x3715('0x36')]=_[_0x3715('0x35')](_0x3782bf[_0x3715('0x36')]);_0x3d60ca['filters']=_[_0x3715('0x39')](_0x3d60ca[_0x3715('0x34')],_0x3d60ca[_0x3715('0x36')]);_0x2c63ab[_0x3715('0x38')]=_[_0x3715('0x39')](_0x3d60ca[_0x3715('0x34')],qs[_0x3715('0x3a')](_0x3782bf[_0x3715('0x36')][_0x3715('0x3a')]));_0x2c63ab['attributes']=_0x2c63ab[_0x3715('0x38')][_0x3715('0x53')]?_0x2c63ab[_0x3715('0x38')]:_0x3d60ca[_0x3715('0x34')];_0x2c63ab[_0x3715('0x3c')]=qs[_0x3715('0x3d')](_0x3782bf[_0x3715('0x36')]['sort']);_0x2c63ab[_0x3715('0x3e')]=qs[_0x3715('0x37')](_[_0x3715('0x3f')](_0x3782bf[_0x3715('0x36')],_0x3d60ca[_0x3715('0x37')]));if(_0x3782bf[_0x3715('0x36')][_0x3715('0x54')]){_0x2c63ab[_0x3715('0x3e')]=_[_0x3715('0x40')](_0x2c63ab[_0x3715('0x3e')],{'$or':_['map'](_0x2c63ab[_0x3715('0x38')],function(_0x5723fb){var _0x1a8311={};_0x1a8311[_0x5723fb]={'$like':'%'+_0x3782bf[_0x3715('0x36')][_0x3715('0x54')]+'%'};return _0x1a8311;})});}_0x2c63ab=_[_0x3715('0x40')]({},_0x2c63ab,_0x3782bf['options']);return _0x2e3ded['getConfigurations'](_0x2c63ab);}})['then'](function(_0xb7cc08){if(_0xb7cc08){_0x202718=_0xb7cc08['length'];if(!_0x3782bf['query'][_0x3715('0x55')](_0x3715('0x3b'))){_0x2c63ab['limit']=qs['limit'](_0x3782bf[_0x3715('0x36')]['limit']);_0x2c63ab[_0x3715('0x28')]=qs[_0x3715('0x28')](_0x3782bf[_0x3715('0x36')][_0x3715('0x28')]);}return _0x2e3ded['getConfigurations'](_0x2c63ab);}})[_0x3715('0x2e')](function(_0x1d17fc){if(_0x1d17fc){return _0x1d17fc?{'count':_0x202718,'rows':_0x1d17fc}:null;}})[_0x3715('0x2e')](respondWithResult(_0xe08689,null))['catch'](handleError(_0xe08689,null));};exports['addConfiguration']=function(_0x117073,_0x1205bf,_0x4b1e3a){if(_0x117073[_0x3715('0x4e')]['id']){delete _0x117073[_0x3715('0x4e')]['id'];}return db[_0x3715('0x33')][_0x3715('0x51')]({'where':{'id':_0x117073[_0x3715('0x4b')]['id']}})[_0x3715('0x2e')](handleEntityNotFound(_0x1205bf,null))['then'](function(_0xd326){if(_0xd326){_0x117073['body'][_0x3715('0x56')]=_0xd326['id'];_0x117073[_0x3715('0x4e')][_0x3715('0x57')]=integrations['getSubjects'](_0x117073[_0x3715('0x4e')][_0x3715('0x58')],_0x117073[_0x3715('0x4e')]['type']);_0x117073[_0x3715('0x4e')]['Descriptions']=integrations[_0x3715('0x59')](_0x117073[_0x3715('0x4e')][_0x3715('0x58')],_0x117073[_0x3715('0x4e')][_0x3715('0x42')]);return db['SugarcrmConfiguration'][_0x3715('0x4d')](_0x117073[_0x3715('0x4e')],{'include':[{'model':db[_0x3715('0x5a')],'as':_0x3715('0x57')},{'model':db[_0x3715('0x5a')],'as':_0x3715('0x5b')}]});}return null;})[_0x3715('0x2e')](respondWithResult(_0x1205bf,null))[_0x3715('0x22')](handleError(_0x1205bf,null));};exports['getFields']=function(_0xd76250,_0x29ba0a,_0xde1f2e){var _0x15c56f='';var _0x3f0a57=['id',_0x3715('0x31'),_0x3715('0x5c'),'created_by','description',_0x3715('0x5d'),_0x3715('0x5e'),_0x3715('0x5f'),'parent_id',_0x3715('0x60'),'parent_name','direction'];return db[_0x3715('0x33')][_0x3715('0x51')]({'where':{'id':_0xd76250['params']['id']},'attributes':['id',_0x3715('0x61'),_0x3715('0x62'),_0x3715('0x63')]})[_0x3715('0x2e')](handleEntityNotFound(_0x29ba0a,null))[_0x3715('0x2e')](function(_0x4ed0cf){if(_0x4ed0cf){_0x15c56f=_0x4ed0cf[_0x3715('0x63')];var _0x2c72b4=_0x15c56f[_0x3715('0x64')](-0x1);if(_0x2c72b4==='/'){_0x15c56f=_0x15c56f[_0x3715('0x65')](0x0,_0x15c56f[_0x3715('0x66')](_0x2c72b4));}return rp({'method':_0x3715('0x67'),'uri':util[_0x3715('0x68')](_0x3715('0x69'),_0x15c56f,_0x3715('0x6a')),'json':!![],'form':{'method':_0x3715('0x6b'),'input_type':_0x3715('0x6c'),'response_type':_0x3715('0x6c'),'rest_data':JSON[_0x3715('0x1d')]({'user_auth':{'user_name':_0x4ed0cf['username'],'password':_0x4ed0cf[_0x3715('0x62')],'encryption':'PLAIN'},'application':_0x3715('0x6d')})}});}})[_0x3715('0x2e')](function(_0x199011){if(_0x199011&&_0x199011['name']!==_0x3715('0x6e')&&_0x199011['name']!=='Password\x20Expired'){return rp({'method':_0x3715('0x67'),'uri':util['format'](_0x3715('0x69'),_0x15c56f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3715('0x6f'),'input_type':_0x3715('0x6c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x199011['id'],'module_name':_0x3715('0x70')})}})[_0x3715('0x2e')](function(_0x1300b0){if(_0x1300b0){var _0x467fbf=_[_0x3715('0x71')](_0x1300b0['module_fields']);_[_0x3715('0x72')](_0x467fbf,function(_0x2f3e27){return _0x3f0a57[_0x3715('0x73')](_0x2f3e27[_0x3715('0x31')]);});return{'count':_0x467fbf['length'],'rows':_[_0x3715('0x41')](_0x467fbf,function(_0x4cbd39){return{'id':_0x4cbd39[_0x3715('0x31')],'name':_0x4cbd39['label'],'custom':_['endsWith'](_0x4cbd39['name'],'_c')?!![]:![],'options':_0x4cbd39[_0x3715('0x46')]?_[_0x3715('0x41')](_[_0x3715('0x71')](_0x4cbd39[_0x3715('0x46')]),function(_0x444fdc){return{'name':_0x444fdc[_0x3715('0x74')],'value':_0x444fdc[_0x3715('0x31')]};}):[]};})};}})[_0x3715('0x2e')](respondWithResult(_0x29ba0a,null))['catch'](function(_0x4a5fd1){var _0x25883c=_0xd76250[_0x3715('0x36')][_0x3715('0x75')]?0x1f4:_0x4a5fd1['statusCode']||0x1f4;logger[_0x3715('0x1e')](_0x3715('0x76'),_0x3715('0x77'),_0x25883c,JSON['stringify'](_0x4a5fd1));delete _0x4a5fd1[_0x3715('0x31')];if(_0x25883c===0x191){_0x25883c=0x190;}_0x29ba0a[_0x3715('0x24')](_0x25883c)[_0x3715('0x32')](_0xd76250[_0x3715('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4a5fd1[_0x3715('0x78')]}:_0x4a5fd1);});}else{var _0x16ff92=0x1f4;_0x29ba0a[_0x3715('0x24')](_0x16ff92)[_0x3715('0x32')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x3357=['duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','options','find','update','body','params','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','create','Descriptions','getFields','created_by','description','date_start'];(function(_0xee5446,_0x1c2cc8){var _0x392f5d=function(_0x4d05b0){while(--_0x4d05b0){_0xee5446['push'](_0xee5446['shift']());}};_0x392f5d(++_0x1c2cc8);}(_0x3357,0xa4));var _0x7335=function(_0xf6530d,_0x383671){_0xf6530d=_0xf6530d-0x0;var _0x1d29c8=_0x3357[_0xf6530d];return _0x1d29c8;};'use strict';var pdf=require(_0x7335('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7335('0x1'));var zipdir=require(_0x7335('0x2'));var jsonpatch=require(_0x7335('0x3'));var rp=require(_0x7335('0x4'));var moment=require(_0x7335('0x5'));var BPromise=require(_0x7335('0x6'));var Mustache=require('mustache');var util=require(_0x7335('0x7'));var path=require(_0x7335('0x8'));var sox=require(_0x7335('0x9'));var csv=require(_0x7335('0xa'));var ejs=require(_0x7335('0xb'));var fs=require('fs');var _=require(_0x7335('0xc'));var squel=require(_0x7335('0xd'));var crypto=require(_0x7335('0xe'));var jsforce=require(_0x7335('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7335('0x10'));var Redis=require(_0x7335('0x11'));var authService=require(_0x7335('0x12'));var qs=require(_0x7335('0x13'));var hardwareService=require(_0x7335('0x14'));var logger=require(_0x7335('0x15'))(_0x7335('0x16'));var utils=require('../../config/utils');var config=require(_0x7335('0x17'));var db=require(_0x7335('0x18'))['db'];var integrations=require(_0x7335('0x19'));var jayson=require(_0x7335('0x1a'));var client=jayson[_0x7335('0x1b')][_0x7335('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4dd09c,_0x593945,_0x2dd3db){if(_0x2dd3db){var _0x2ef73b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef73b[_0x7335('0x1d')](_0x593945)){return _0x4dd09c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4dd09c;}}function respondWithRpcPromise(_0x303b21,_0x1b2745,_0x18fa26,_0x5c7df4){return new BPromise(function(_0x34b317,_0x2eec7b){var _0x19affb=_0x5c7df4||client;return _0x19affb[_0x7335('0x1e')](_0x303b21,_0x18fa26)['then'](function(_0x800e7b){logger[_0x7335('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x1b2745,'request\x20sent');logger['debug'](_0x7335('0x20'),_0x1b2745,_0x7335('0x21'),JSON['stringify'](_0x800e7b));if(_0x800e7b['error']){if(_0x800e7b['error'][_0x7335('0x22')]===0x1f4){logger[_0x7335('0x23')](_0x7335('0x24'),_0x1b2745,_0x800e7b[_0x7335('0x23')][_0x7335('0x25')]);return _0x2eec7b(_0x800e7b[_0x7335('0x23')]['message']);}logger['error'](_0x7335('0x24'),_0x1b2745,_0x800e7b[_0x7335('0x23')][_0x7335('0x25')]);return _0x34b317(_0x800e7b[_0x7335('0x23')]['message']);}else{logger[_0x7335('0x1f')](_0x7335('0x24'),_0x1b2745,_0x7335('0x21'));_0x34b317(_0x800e7b[_0x7335('0x26')]['message']);}})[_0x7335('0x27')](function(_0x3de063){logger[_0x7335('0x23')](_0x7335('0x24'),_0x1b2745,_0x3de063);_0x2eec7b(_0x3de063);});});}function respondWithStatusCode(_0x1d127d,_0x384149){_0x384149=_0x384149||0xcc;return function(_0x2e00bd){if(_0x2e00bd){return _0x1d127d['sendStatus'](_0x384149);}return _0x1d127d[_0x7335('0x28')](_0x384149)[_0x7335('0x29')]();};}function respondWithResult(_0x15eeda,_0x64ec07){_0x64ec07=_0x64ec07||0xc8;return function(_0x4b5d0a){if(_0x4b5d0a){return _0x15eeda[_0x7335('0x28')](_0x64ec07)['json'](_0x4b5d0a);}};}function respondWithFilteredResult(_0x5f47ff,_0x11a061){return function(_0x1389bf){if(_0x1389bf){var _0x5507d0=_0x1389bf[_0x7335('0x2a')],_0x4d03a5=_0x11a061[_0x7335('0x2b')],_0x55fa05=_0x11a061[_0x7335('0x2b')]+_0x11a061[_0x7335('0x2c')],_0xc83bc5;if(_0x55fa05>=_0x5507d0){_0x55fa05=_0x5507d0;_0xc83bc5=0xc8;}else{_0xc83bc5=0xce;}_0x5f47ff[_0x7335('0x28')](_0xc83bc5);return _0x5f47ff[_0x7335('0x2d')](_0x7335('0x2e'),_0x4d03a5+'-'+_0x55fa05+'/'+_0x5507d0)['json'](_0x1389bf);}return null;};}function patchUpdates(_0x4a8305){return function(_0x384b76){try{jsonpatch[_0x7335('0x2f')](_0x384b76,_0x4a8305,!![]);}catch(_0x574cd8){return BPromise[_0x7335('0x30')](_0x574cd8);}return _0x384b76[_0x7335('0x31')]();};}function saveUpdates(_0x2ad736,_0x403c0d){return function(_0x2d0582){if(_0x2d0582){return _0x2d0582['update'](_0x2ad736)[_0x7335('0x32')](function(_0xcfe97b){return _0xcfe97b;});}return null;};}function removeEntity(_0x20d1a8,_0x2f826d){return function(_0xb7fdf3){if(_0xb7fdf3){return _0xb7fdf3[_0x7335('0x33')]()['then'](function(){_0x20d1a8[_0x7335('0x28')](0xcc)[_0x7335('0x29')]();});}};}function handleEntityNotFound(_0x492c78,_0x33dc33){return function(_0x3c3eba){if(!_0x3c3eba){_0x492c78[_0x7335('0x34')](0x194);}return _0x3c3eba;};}function handleError(_0xfa3d59,_0x41be92){_0x41be92=_0x41be92||0x1f4;return function(_0x1800e6){logger[_0x7335('0x23')](_0x1800e6[_0x7335('0x35')]);if(_0x1800e6[_0x7335('0x36')]){delete _0x1800e6[_0x7335('0x36')];}_0xfa3d59[_0x7335('0x28')](_0x41be92)[_0x7335('0x37')](_0x1800e6);};}exports[_0x7335('0x38')]=function(_0x864f69,_0x1d5802){var _0x4706d6={},_0x3c811c={},_0x146b9f={'count':0x0,'rows':[]};var _0x2b98b0=db[_0x7335('0x39')][_0x7335('0x3a')];_0x3c811c[_0x7335('0x3b')]=_[_0x7335('0x3c')](_0x2b98b0);_0x3c811c[_0x7335('0x3d')]=_[_0x7335('0x3c')](_0x864f69[_0x7335('0x3d')]);_0x3c811c[_0x7335('0x3e')]=_[_0x7335('0x3f')](_0x3c811c[_0x7335('0x3b')],_0x3c811c[_0x7335('0x3d')]);_0x4706d6[_0x7335('0x40')]=_[_0x7335('0x3f')](_0x3c811c[_0x7335('0x3b')],qs[_0x7335('0x41')](_0x864f69[_0x7335('0x3d')]['fields']));_0x4706d6[_0x7335('0x40')]=_0x4706d6[_0x7335('0x40')][_0x7335('0x42')]?_0x4706d6[_0x7335('0x40')]:_0x3c811c[_0x7335('0x3b')];if(!_0x864f69[_0x7335('0x3d')][_0x7335('0x43')]('nolimit')){_0x4706d6['limit']=qs[_0x7335('0x2c')](_0x864f69[_0x7335('0x3d')][_0x7335('0x2c')]);_0x4706d6[_0x7335('0x2b')]=qs[_0x7335('0x2b')](_0x864f69['query'][_0x7335('0x2b')]);}_0x4706d6[_0x7335('0x44')]=qs[_0x7335('0x45')](_0x864f69['query']['sort']);_0x4706d6[_0x7335('0x46')]=qs[_0x7335('0x3e')](_['pick'](_0x864f69[_0x7335('0x3d')],_0x3c811c[_0x7335('0x3e')]));if(_0x864f69[_0x7335('0x3d')][_0x7335('0x47')]){_0x4706d6['where']=_[_0x7335('0x48')](_0x4706d6[_0x7335('0x46')],{'$or':_[_0x7335('0x49')](_0x2b98b0,function(_0x231a04){if(_0x231a04[_0x7335('0x4a')][_0x7335('0x4b')]!==_0x7335('0x4c')){var _0x5f2e4a={};_0x5f2e4a[_0x231a04[_0x7335('0x4d')]]={'$like':'%'+_0x864f69[_0x7335('0x3d')][_0x7335('0x47')]+'%'};return _0x5f2e4a;}})});}_0x4706d6=_[_0x7335('0x48')]({},_0x4706d6,_0x864f69['options']);var _0x4d4ecc={'where':_0x4706d6['where']};return db[_0x7335('0x39')][_0x7335('0x2a')](_0x4d4ecc)[_0x7335('0x32')](function(_0x122ec1){_0x146b9f[_0x7335('0x2a')]=_0x122ec1;if(_0x864f69['query'][_0x7335('0x4e')]){_0x4706d6[_0x7335('0x4f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x7335('0x50')](_0x4706d6);})[_0x7335('0x32')](function(_0x412643){_0x146b9f[_0x7335('0x51')]=_0x412643;return _0x146b9f;})[_0x7335('0x32')](respondWithFilteredResult(_0x1d5802,_0x4706d6))[_0x7335('0x27')](handleError(_0x1d5802,null));};exports[_0x7335('0x52')]=function(_0x3fdeed,_0x17e880){var _0x31a8df={'raw':![],'where':{'id':_0x3fdeed['params']['id']}},_0x1ce406={};_0x1ce406['model']=_[_0x7335('0x3c')](db[_0x7335('0x39')][_0x7335('0x3a')]);_0x1ce406['query']=_['keys'](_0x3fdeed[_0x7335('0x3d')]);_0x1ce406['filters']=_[_0x7335('0x3f')](_0x1ce406[_0x7335('0x3b')],_0x1ce406[_0x7335('0x3d')]);_0x31a8df[_0x7335('0x40')]=_['intersection'](_0x1ce406[_0x7335('0x3b')],qs[_0x7335('0x41')](_0x3fdeed[_0x7335('0x3d')][_0x7335('0x41')]));_0x31a8df['attributes']=_0x31a8df[_0x7335('0x40')][_0x7335('0x42')]?_0x31a8df[_0x7335('0x40')]:_0x1ce406['model'];if(_0x3fdeed[_0x7335('0x3d')]['includeAll']){_0x31a8df[_0x7335('0x4f')]=[{'all':!![]}];}_0x31a8df=_[_0x7335('0x48')]({},_0x31a8df,_0x3fdeed[_0x7335('0x53')]);return db[_0x7335('0x39')][_0x7335('0x54')](_0x31a8df)[_0x7335('0x32')](handleEntityNotFound(_0x17e880,null))[_0x7335('0x32')](respondWithResult(_0x17e880,null))['catch'](handleError(_0x17e880,null));};exports['create']=function(_0x1b874d,_0x3f05ea){return db[_0x7335('0x39')]['create'](_0x1b874d['body'],{})['then'](respondWithResult(_0x3f05ea,0xc9))['catch'](handleError(_0x3f05ea,null));};exports[_0x7335('0x55')]=function(_0x2edd37,_0x13dc24){if(_0x2edd37[_0x7335('0x56')]['id']){delete _0x2edd37[_0x7335('0x56')]['id'];}return db[_0x7335('0x39')][_0x7335('0x54')]({'where':{'id':_0x2edd37[_0x7335('0x57')]['id']}})[_0x7335('0x32')](handleEntityNotFound(_0x13dc24,null))[_0x7335('0x32')](saveUpdates(_0x2edd37[_0x7335('0x56')],null))[_0x7335('0x32')](respondWithResult(_0x13dc24,null))[_0x7335('0x27')](handleError(_0x13dc24,null));};exports[_0x7335('0x33')]=function(_0x4e19c1,_0x25a808){return db['SugarcrmAccount'][_0x7335('0x54')]({'where':{'id':_0x4e19c1['params']['id']}})['then'](handleEntityNotFound(_0x25a808,null))[_0x7335('0x32')](removeEntity(_0x25a808,null))[_0x7335('0x27')](handleError(_0x25a808,null));};exports[_0x7335('0x58')]=function(_0x277e62,_0x33bd7d,_0x1e3040){var _0x337acd={};var _0x5493a7={};var _0xee3b3f;var _0xc55c77;return db[_0x7335('0x39')][_0x7335('0x59')]({'where':{'id':_0x277e62[_0x7335('0x57')]['id']}})[_0x7335('0x32')](handleEntityNotFound(_0x33bd7d,null))[_0x7335('0x32')](function(_0x5d0917){if(_0x5d0917){_0xee3b3f=_0x5d0917;_0x5493a7[_0x7335('0x3b')]=_[_0x7335('0x3c')](db[_0x7335('0x5a')][_0x7335('0x3a')]);_0x5493a7[_0x7335('0x3d')]=_[_0x7335('0x3c')](_0x277e62[_0x7335('0x3d')]);_0x5493a7['filters']=_[_0x7335('0x3f')](_0x5493a7[_0x7335('0x3b')],_0x5493a7[_0x7335('0x3d')]);_0x337acd[_0x7335('0x40')]=_[_0x7335('0x3f')](_0x5493a7[_0x7335('0x3b')],qs['fields'](_0x277e62['query'][_0x7335('0x41')]));_0x337acd['attributes']=_0x337acd[_0x7335('0x40')][_0x7335('0x42')]?_0x337acd[_0x7335('0x40')]:_0x5493a7[_0x7335('0x3b')];_0x337acd['order']=qs[_0x7335('0x45')](_0x277e62[_0x7335('0x3d')][_0x7335('0x45')]);_0x337acd[_0x7335('0x46')]=qs[_0x7335('0x3e')](_['pick'](_0x277e62[_0x7335('0x3d')],_0x5493a7[_0x7335('0x3e')]));if(_0x277e62['query'][_0x7335('0x47')]){_0x337acd[_0x7335('0x46')]=_[_0x7335('0x48')](_0x337acd[_0x7335('0x46')],{'$or':_[_0x7335('0x49')](_0x337acd[_0x7335('0x40')],function(_0x27a67c){var _0x20b7d8={};_0x20b7d8[_0x27a67c]={'$like':'%'+_0x277e62[_0x7335('0x3d')][_0x7335('0x47')]+'%'};return _0x20b7d8;})});}_0x337acd=_[_0x7335('0x48')]({},_0x337acd,_0x277e62[_0x7335('0x53')]);return _0xee3b3f[_0x7335('0x58')](_0x337acd);}})[_0x7335('0x32')](function(_0x18cc5c){if(_0x18cc5c){_0xc55c77=_0x18cc5c[_0x7335('0x42')];if(!_0x277e62[_0x7335('0x3d')][_0x7335('0x43')](_0x7335('0x5b'))){_0x337acd[_0x7335('0x2c')]=qs[_0x7335('0x2c')](_0x277e62[_0x7335('0x3d')]['limit']);_0x337acd['offset']=qs['offset'](_0x277e62[_0x7335('0x3d')][_0x7335('0x2b')]);}return _0xee3b3f['getConfigurations'](_0x337acd);}})[_0x7335('0x32')](function(_0x2b29bf){if(_0x2b29bf){return _0x2b29bf?{'count':_0xc55c77,'rows':_0x2b29bf}:null;}})[_0x7335('0x32')](respondWithResult(_0x33bd7d,null))['catch'](handleError(_0x33bd7d,null));};exports[_0x7335('0x5c')]=function(_0x33922c,_0x5c8a94,_0x1778a4){if(_0x33922c[_0x7335('0x56')]['id']){delete _0x33922c[_0x7335('0x56')]['id'];}return db['SugarcrmAccount'][_0x7335('0x59')]({'where':{'id':_0x33922c[_0x7335('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c8a94,null))['then'](function(_0x729f6d){if(_0x729f6d){_0x33922c[_0x7335('0x56')][_0x7335('0x5d')]=_0x729f6d['id'];_0x33922c[_0x7335('0x56')][_0x7335('0x5e')]=integrations[_0x7335('0x5f')](_0x33922c[_0x7335('0x56')][_0x7335('0x60')],_0x33922c[_0x7335('0x56')][_0x7335('0x4a')]);_0x33922c[_0x7335('0x56')]['Descriptions']=integrations[_0x7335('0x61')](_0x33922c['body']['channel'],_0x33922c['body'][_0x7335('0x4a')]);return db[_0x7335('0x5a')][_0x7335('0x62')](_0x33922c['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x7335('0x5e')},{'model':db['SugarcrmField'],'as':_0x7335('0x63')}]});}return null;})[_0x7335('0x32')](respondWithResult(_0x5c8a94,null))[_0x7335('0x27')](handleError(_0x5c8a94,null));};exports[_0x7335('0x64')]=function(_0x4616b3,_0xf7c774,_0x7773db){var _0x199f8a='';var _0x34a839=['id',_0x7335('0x36'),'assigned_user_id',_0x7335('0x65'),_0x7335('0x66'),_0x7335('0x67'),_0x7335('0x68'),'duration_minutes',_0x7335('0x69'),_0x7335('0x6a'),_0x7335('0x6b'),_0x7335('0x6c')];return db[_0x7335('0x39')][_0x7335('0x59')]({'where':{'id':_0x4616b3[_0x7335('0x57')]['id']},'attributes':['id',_0x7335('0x6d'),'password','remoteUri']})[_0x7335('0x32')](handleEntityNotFound(_0xf7c774,null))['then'](function(_0x638bc6){if(_0x638bc6){_0x199f8a=_0x638bc6[_0x7335('0x6e')];var _0x37fe0c=_0x199f8a[_0x7335('0x6f')](-0x1);if(_0x37fe0c==='/'){_0x199f8a=_0x199f8a[_0x7335('0x70')](0x0,_0x199f8a[_0x7335('0x71')](_0x37fe0c));}return rp({'method':_0x7335('0x72'),'uri':util[_0x7335('0x73')](_0x7335('0x74'),_0x199f8a,_0x7335('0x75')),'json':!![],'form':{'method':_0x7335('0x76'),'input_type':'JSON','response_type':_0x7335('0x77'),'rest_data':JSON[_0x7335('0x78')]({'user_auth':{'user_name':_0x638bc6[_0x7335('0x6d')],'password':_0x638bc6['password'],'encryption':'PLAIN'},'application':_0x7335('0x79')})}});}})[_0x7335('0x32')](function(_0x3fc74d){if(_0x3fc74d&&_0x3fc74d['name']!==_0x7335('0x7a')&&_0x3fc74d[_0x7335('0x36')]!==_0x7335('0x7b')){return rp({'method':_0x7335('0x72'),'uri':util[_0x7335('0x73')](_0x7335('0x74'),_0x199f8a,_0x7335('0x75')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x7335('0x77'),'response_type':_0x7335('0x77'),'rest_data':JSON[_0x7335('0x78')]({'session':_0x3fc74d['id'],'module_name':_0x7335('0x7c')})}})[_0x7335('0x32')](function(_0x318926){if(_0x318926){var _0x125cb6=_[_0x7335('0x7d')](_0x318926[_0x7335('0x7e')]);_[_0x7335('0x7f')](_0x125cb6,function(_0xbe4d82){return _0x34a839[_0x7335('0x80')](_0xbe4d82['name']);});return{'count':_0x125cb6['length'],'rows':_[_0x7335('0x49')](_0x125cb6,function(_0x1fa6d2){return{'id':_0x1fa6d2[_0x7335('0x36')],'name':_0x1fa6d2[_0x7335('0x81')],'custom':_[_0x7335('0x82')](_0x1fa6d2['name'],'_c')?!![]:![],'options':_0x1fa6d2[_0x7335('0x53')]?_[_0x7335('0x49')](_[_0x7335('0x7d')](_0x1fa6d2[_0x7335('0x53')]),function(_0x322d35){return{'name':_0x322d35[_0x7335('0x83')],'value':_0x322d35[_0x7335('0x36')]};}):[]};})};}})[_0x7335('0x32')](respondWithResult(_0xf7c774,null))['catch'](function(_0x3aad9f){var _0x4b919d=_0x4616b3['query'][_0x7335('0x1d')]?0x1f4:_0x3aad9f[_0x7335('0x84')]||0x1f4;logger[_0x7335('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4b919d,JSON['stringify'](_0x3aad9f));delete _0x3aad9f[_0x7335('0x36')];if(_0x4b919d===0x191){_0x4b919d=0x190;}_0xf7c774[_0x7335('0x28')](_0x4b919d)[_0x7335('0x37')](_0x4616b3[_0x7335('0x3d')][_0x7335('0x1d')]?{'message':_0x7335('0x85'),'statusCode':_0x3aad9f[_0x7335('0x84')]}:_0x3aad9f);});}else{var _0x1920f7=0x1f4;_0xf7c774[_0x7335('0x28')](_0x1920f7)[_0x7335('0x37')]({'message':_0x7335('0x85'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index e89fe2e..f259f43 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 _0xfe4b=['moment','bluebird','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api'];(function(_0xd64aac,_0x112739){var _0x8a9711=function(_0x15b9a8){while(--_0x15b9a8){_0xd64aac['push'](_0xd64aac['shift']());}};_0x8a9711(++_0x112739);}(_0xfe4b,0x101));var _0xbfe4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfe4b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbfe4('0x0'));var util=require('util');var logger=require(_0xbfe4('0x1'))(_0xbfe4('0x2'));var moment=require(_0xbfe4('0x3'));var BPromise=require(_0xbfe4('0x4'));var rp=require(_0xbfe4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfe4('0x6'));var attributes=require(_0xbfe4('0x7'));var integrations=require(_0xbfe4('0x8'));module[_0xbfe4('0x9')]=function(_0x1d926f,_0x4b7e18){return _0x1d926f[_0xbfe4('0xa')](_0xbfe4('0xb'),attributes,{'tableName':_0xbfe4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb03=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x223c81,_0x575c4d){var _0x5903a4=function(_0x4d8f0b){while(--_0x4d8f0b){_0x223c81['push'](_0x223c81['shift']());}};_0x5903a4(++_0x575c4d);}(_0xeb03,0x148));var _0x3eb0=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xeb03[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x3eb0('0x0'));var util=require(_0x3eb0('0x1'));var logger=require(_0x3eb0('0x2'))(_0x3eb0('0x3'));var moment=require(_0x3eb0('0x4'));var BPromise=require(_0x3eb0('0x5'));var rp=require(_0x3eb0('0x6'));var fs=require('fs');var path=require(_0x3eb0('0x7'));var rimraf=require(_0x3eb0('0x8'));var config=require(_0x3eb0('0x9'));var attributes=require(_0x3eb0('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x3eb0('0xb')]=function(_0x8a1500,_0x4b539e){return _0x8a1500[_0x3eb0('0xc')](_0x3eb0('0xd'),attributes,{'tableName':_0x3eb0('0xe'),'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 31d0115..34f7aa7 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 _0x1b3c=['options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x1b3c,0x9b));var _0xc1b3=function(_0x152222,_0x25bde1){_0x152222=_0x152222-0x0;var _0x5320c2=_0x1b3c[_0x152222];return _0x5320c2;};'use strict';var _=require(_0xc1b3('0x0'));var util=require('util');var moment=require(_0xc1b3('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b3('0x2'));var fs=require('fs');var Redis=require(_0xc1b3('0x3'));var db=require(_0xc1b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1b3('0x5'))(_0xc1b3('0x6'));var config=require(_0xc1b3('0x7'));var jayson=require(_0xc1b3('0x8'));var client=jayson[_0xc1b3('0x9')][_0xc1b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7354,_0x5011e6,_0x2edf26){return new BPromise(function(_0xe302c2,_0x2d8d22){return client[_0xc1b3('0xb')](_0x3c7354,_0x2edf26)['then'](function(_0x28c4b0){logger[_0xc1b3('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x5011e6,_0xc1b3('0xd'));logger[_0xc1b3('0xe')](_0xc1b3('0xf'),_0x5011e6,_0xc1b3('0xd'),JSON[_0xc1b3('0x10')](_0x28c4b0));if(_0x28c4b0[_0xc1b3('0x11')]){if(_0x28c4b0[_0xc1b3('0x11')][_0xc1b3('0x12')]===0x1f4){logger[_0xc1b3('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x5011e6,_0x28c4b0[_0xc1b3('0x11')][_0xc1b3('0x13')]);return _0x2d8d22(_0x28c4b0[_0xc1b3('0x11')][_0xc1b3('0x13')]);}logger[_0xc1b3('0x11')](_0xc1b3('0x14'),_0x5011e6,_0x28c4b0[_0xc1b3('0x11')][_0xc1b3('0x13')]);return _0xe302c2(_0x28c4b0[_0xc1b3('0x11')][_0xc1b3('0x13')]);}else{logger[_0xc1b3('0xc')](_0xc1b3('0x14'),_0x5011e6,'request\x20sent');_0xe302c2(_0x28c4b0[_0xc1b3('0x15')]['message']);}})['catch'](function(_0x5d53d5){logger['error'](_0xc1b3('0x14'),_0x5011e6,_0x5d53d5);_0x2d8d22(_0x5d53d5);});});}exports[_0xc1b3('0x16')]=function(_0x493a4c){var _0x5d4c3e=this;return new Promise(function(_0x5ae79f,_0x3e381b){return db[_0xc1b3('0x17')][_0xc1b3('0x18')]({'raw':_0x493a4c[_0xc1b3('0x19')]?_0x493a4c['options'][_0xc1b3('0x1a')]===undefined?!![]:![]:!![],'where':_0x493a4c[_0xc1b3('0x19')]?_0x493a4c[_0xc1b3('0x19')][_0xc1b3('0x1b')]||null:null,'attributes':_0x493a4c[_0xc1b3('0x19')]?_0x493a4c['options'][_0xc1b3('0x1c')]||null:null,'limit':_0x493a4c[_0xc1b3('0x19')]?_0x493a4c[_0xc1b3('0x19')][_0xc1b3('0x1d')]||null:null,'include':_0x493a4c[_0xc1b3('0x19')]?_0x493a4c[_0xc1b3('0x19')][_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x493a4c[_0xc1b3('0x19')][_0xc1b3('0x1e')],function(_0x5ca047){return{'model':db[_0x5ca047['model']],'as':_0x5ca047['as'],'attributes':_0x5ca047['attributes'],'include':_0x5ca047[_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x5ca047[_0xc1b3('0x1e')],function(_0x1c34ca){return{'model':db[_0x1c34ca[_0xc1b3('0x20')]],'as':_0x1c34ca['as'],'attributes':_0x1c34ca[_0xc1b3('0x1c')],'include':_0x1c34ca[_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x1c34ca[_0xc1b3('0x1e')],function(_0x5ecebd){return{'model':db[_0x5ecebd[_0xc1b3('0x20')]],'as':_0x5ecebd['as'],'attributes':_0x5ecebd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b0b11){logger['info']('GetSugarcrmAccount',_0x493a4c);logger[_0xc1b3('0xe')](_0xc1b3('0x16'),_0x493a4c,JSON[_0xc1b3('0x10')](_0x4b0b11));_0x5ae79f(_0x4b0b11);})[_0xc1b3('0x21')](function(_0x31fb2a){logger[_0xc1b3('0x11')](_0xc1b3('0x16'),_0x31fb2a[_0xc1b3('0x13')],_0x493a4c);_0x3e381b(_0x5d4c3e[_0xc1b3('0x11')](0x1f4,_0x31fb2a['message']));});});};exports[_0xc1b3('0x22')]=function(_0x33b921){var _0x174538=this;return new Promise(function(_0x27bd9e,_0x4a7680){return db[_0xc1b3('0x17')][_0xc1b3('0x23')]({'raw':_0x33b921[_0xc1b3('0x19')]?_0x33b921['options'][_0xc1b3('0x1a')]===undefined?!![]:![]:!![],'where':_0x33b921[_0xc1b3('0x19')]?_0x33b921[_0xc1b3('0x19')][_0xc1b3('0x1b')]||null:null,'attributes':_0x33b921[_0xc1b3('0x19')]?_0x33b921[_0xc1b3('0x19')][_0xc1b3('0x1c')]||null:null,'include':_0x33b921['options']?_0x33b921[_0xc1b3('0x19')][_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x33b921[_0xc1b3('0x19')][_0xc1b3('0x1e')],function(_0x5f3eb9){return{'model':db[_0x5f3eb9[_0xc1b3('0x20')]],'as':_0x5f3eb9['as'],'attributes':_0x5f3eb9[_0xc1b3('0x1c')],'include':_0x5f3eb9[_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x5f3eb9['include'],function(_0x5e5ae5){return{'model':db[_0x5e5ae5[_0xc1b3('0x20')]],'as':_0x5e5ae5['as'],'attributes':_0x5e5ae5[_0xc1b3('0x1c')],'include':_0x5e5ae5[_0xc1b3('0x1e')]?_[_0xc1b3('0x1f')](_0x5e5ae5[_0xc1b3('0x1e')],function(_0x1ece6e){return{'model':db[_0x1ece6e['model']],'as':_0x1ece6e['as'],'attributes':_0x1ece6e[_0xc1b3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f589c){logger[_0xc1b3('0xc')](_0xc1b3('0x22'),_0x33b921);logger[_0xc1b3('0xe')](_0xc1b3('0x22'),_0x33b921,JSON[_0xc1b3('0x10')](_0x3f589c));_0x27bd9e(_0x3f589c);})[_0xc1b3('0x21')](function(_0xb1d504){logger[_0xc1b3('0x11')](_0xc1b3('0x22'),_0xb1d504[_0xc1b3('0x13')],_0x33b921);_0x4a7680(_0x174538[_0xc1b3('0x11')](0x1f4,_0xb1d504['message']));});});}; \ No newline at end of file +var _0xaa1a=['request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','GetSugarcrmAccount','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','find','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4bbd23,_0x2b66fc){var _0x53bb03=function(_0x215beb){while(--_0x215beb){_0x4bbd23['push'](_0x4bbd23['shift']());}};_0x53bb03(++_0x2b66fc);}(_0xaa1a,0x172));var _0xaaa1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xaa1a[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xaaa1('0x0'));var util=require('util');var moment=require(_0xaaa1('0x1'));var BPromise=require(_0xaaa1('0x2'));var rs=require(_0xaaa1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaa1('0x4'))['db'];var utils=require(_0xaaa1('0x5'));var logger=require(_0xaaa1('0x6'))(_0xaaa1('0x7'));var config=require(_0xaaa1('0x8'));var jayson=require(_0xaaa1('0x9'));var client=jayson[_0xaaa1('0xa')][_0xaaa1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54f5b8,_0x4d5e6e,_0x41db74){return new BPromise(function(_0xeefef4,_0x5027bb){return client[_0xaaa1('0xc')](_0x54f5b8,_0x41db74)['then'](function(_0x385c48){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4d5e6e,'request\x20sent');logger[_0xaaa1('0xd')](_0xaaa1('0xe'),_0x4d5e6e,_0xaaa1('0xf'),JSON[_0xaaa1('0x10')](_0x385c48));if(_0x385c48[_0xaaa1('0x11')]){if(_0x385c48[_0xaaa1('0x11')][_0xaaa1('0x12')]===0x1f4){logger[_0xaaa1('0x11')](_0xaaa1('0x13'),_0x4d5e6e,_0x385c48[_0xaaa1('0x11')][_0xaaa1('0x14')]);return _0x5027bb(_0x385c48[_0xaaa1('0x11')][_0xaaa1('0x14')]);}logger[_0xaaa1('0x11')](_0xaaa1('0x13'),_0x4d5e6e,_0x385c48[_0xaaa1('0x11')][_0xaaa1('0x14')]);return _0xeefef4(_0x385c48[_0xaaa1('0x11')][_0xaaa1('0x14')]);}else{logger[_0xaaa1('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x4d5e6e,'request\x20sent');_0xeefef4(_0x385c48[_0xaaa1('0x16')][_0xaaa1('0x14')]);}})[_0xaaa1('0x17')](function(_0x9d32bf){logger[_0xaaa1('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x4d5e6e,_0x9d32bf);_0x5027bb(_0x9d32bf);});});}exports[_0xaaa1('0x18')]=function(_0x1494d4){var _0x19e317=this;return new Promise(function(_0x242be5,_0x188839){return db['SugarcrmAccount']['findAll']({'raw':_0x1494d4[_0xaaa1('0x19')]?_0x1494d4[_0xaaa1('0x19')][_0xaaa1('0x1a')]===undefined?!![]:![]:!![],'where':_0x1494d4['options']?_0x1494d4[_0xaaa1('0x19')][_0xaaa1('0x1b')]||null:null,'attributes':_0x1494d4['options']?_0x1494d4[_0xaaa1('0x19')][_0xaaa1('0x1c')]||null:null,'limit':_0x1494d4['options']?_0x1494d4[_0xaaa1('0x19')]['limit']||null:null,'include':_0x1494d4[_0xaaa1('0x19')]?_0x1494d4[_0xaaa1('0x19')][_0xaaa1('0x1d')]?_[_0xaaa1('0x1e')](_0x1494d4[_0xaaa1('0x19')][_0xaaa1('0x1d')],function(_0x5612cb){return{'model':db[_0x5612cb[_0xaaa1('0x1f')]],'as':_0x5612cb['as'],'attributes':_0x5612cb['attributes'],'include':_0x5612cb['include']?_[_0xaaa1('0x1e')](_0x5612cb[_0xaaa1('0x1d')],function(_0x14f387){return{'model':db[_0x14f387['model']],'as':_0x14f387['as'],'attributes':_0x14f387[_0xaaa1('0x1c')],'include':_0x14f387['include']?_['map'](_0x14f387[_0xaaa1('0x1d')],function(_0x3704dd){return{'model':db[_0x3704dd['model']],'as':_0x3704dd['as'],'attributes':_0x3704dd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c3ac0){logger[_0xaaa1('0x15')](_0xaaa1('0x18'),_0x1494d4);logger[_0xaaa1('0xd')](_0xaaa1('0x18'),_0x1494d4,JSON[_0xaaa1('0x10')](_0x5c3ac0));_0x242be5(_0x5c3ac0);})[_0xaaa1('0x17')](function(_0x20fb80){logger[_0xaaa1('0x11')](_0xaaa1('0x18'),_0x20fb80[_0xaaa1('0x14')],_0x1494d4);_0x188839(_0x19e317[_0xaaa1('0x11')](0x1f4,_0x20fb80[_0xaaa1('0x14')]));});});};exports[_0xaaa1('0x20')]=function(_0x15499c){var _0x858119=this;return new Promise(function(_0x490e7a,_0x4789f1){return db['SugarcrmAccount'][_0xaaa1('0x21')]({'raw':_0x15499c[_0xaaa1('0x19')]?_0x15499c[_0xaaa1('0x19')][_0xaaa1('0x1a')]===undefined?!![]:![]:!![],'where':_0x15499c[_0xaaa1('0x19')]?_0x15499c['options'][_0xaaa1('0x1b')]||null:null,'attributes':_0x15499c[_0xaaa1('0x19')]?_0x15499c[_0xaaa1('0x19')]['attributes']||null:null,'include':_0x15499c[_0xaaa1('0x19')]?_0x15499c[_0xaaa1('0x19')][_0xaaa1('0x1d')]?_['map'](_0x15499c[_0xaaa1('0x19')][_0xaaa1('0x1d')],function(_0x1081cc){return{'model':db[_0x1081cc[_0xaaa1('0x1f')]],'as':_0x1081cc['as'],'attributes':_0x1081cc[_0xaaa1('0x1c')],'include':_0x1081cc[_0xaaa1('0x1d')]?_[_0xaaa1('0x1e')](_0x1081cc['include'],function(_0x54570b){return{'model':db[_0x54570b['model']],'as':_0x54570b['as'],'attributes':_0x54570b[_0xaaa1('0x1c')],'include':_0x54570b[_0xaaa1('0x1d')]?_[_0xaaa1('0x1e')](_0x54570b[_0xaaa1('0x1d')],function(_0x50d61f){return{'model':db[_0x50d61f[_0xaaa1('0x1f')]],'as':_0x50d61f['as'],'attributes':_0x50d61f[_0xaaa1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaaa1('0x22')](function(_0x17ee1d){logger[_0xaaa1('0x15')](_0xaaa1('0x20'),_0x15499c);logger['debug']('ShowSugarcrmAccount',_0x15499c,JSON[_0xaaa1('0x10')](_0x17ee1d));_0x490e7a(_0x17ee1d);})[_0xaaa1('0x17')](function(_0x105c00){logger[_0xaaa1('0x11')]('ShowSugarcrmAccount',_0x105c00[_0xaaa1('0x14')],_0x15499c);_0x4789f1(_0x858119[_0xaaa1('0x11')](0x1f4,_0x105c00[_0xaaa1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4764328..79e5b11 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 _0x5cd2=['/:id/subjects','getSubjects','getDescriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x25c8fd,_0x38ac5c){var _0x360c09=function(_0x549f94){while(--_0x549f94){_0x25c8fd['push'](_0x25c8fd['shift']());}};_0x360c09(++_0x38ac5c);}(_0x5cd2,0xee));var _0x25cd=function(_0x5253f3,_0x1f7db9){_0x5253f3=_0x5253f3-0x0;var _0x541740=_0x5cd2[_0x5253f3];return _0x541740;};'use strict';var multer=require(_0x25cd('0x0'));var util=require(_0x25cd('0x1'));var path=require(_0x25cd('0x2'));var timeout=require(_0x25cd('0x3'));var express=require('express');var router=express[_0x25cd('0x4')]();var auth=require(_0x25cd('0x5'));var interaction=require(_0x25cd('0x6'));var config=require(_0x25cd('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x25cd('0x8')]('/',auth[_0x25cd('0x9')](),controller[_0x25cd('0xa')]);router[_0x25cd('0x8')](_0x25cd('0xb'),auth[_0x25cd('0x9')](),controller[_0x25cd('0xc')]);router['get'](_0x25cd('0xd'),auth['isAuthenticated'](),controller[_0x25cd('0xe')]);router['get'](_0x25cd('0xf'),auth[_0x25cd('0x9')](),controller[_0x25cd('0x10')]);router[_0x25cd('0x8')]('/:id/descriptions',auth[_0x25cd('0x9')](),controller[_0x25cd('0x11')]);router['post']('/',auth[_0x25cd('0x9')](),controller[_0x25cd('0x12')]);router[_0x25cd('0x13')]('/:id',auth[_0x25cd('0x9')](),controller['update']);router[_0x25cd('0x14')]('/:id',auth[_0x25cd('0x9')](),controller[_0x25cd('0x15')]);module[_0x25cd('0x16')]=router; \ No newline at end of file +var _0xb353=['create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2ecaa0,_0x1f676e){var _0x5c2b9b=function(_0x5debe7){while(--_0x5debe7){_0x2ecaa0['push'](_0x2ecaa0['shift']());}};_0x5c2b9b(++_0x1f676e);}(_0xb353,0x1e5));var _0x3b35=function(_0x4b39a4,_0x491203){_0x4b39a4=_0x4b39a4-0x0;var _0x3b549b=_0xb353[_0x4b39a4];return _0x3b549b;};'use strict';var multer=require(_0x3b35('0x0'));var util=require(_0x3b35('0x1'));var path=require(_0x3b35('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b35('0x3'));var router=express[_0x3b35('0x4')]();var auth=require(_0x3b35('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b35('0x6'));var controller=require(_0x3b35('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b35('0x8')]);router[_0x3b35('0x9')](_0x3b35('0xa'),auth['isAuthenticated'](),controller[_0x3b35('0xb')]);router['get'](_0x3b35('0xc'),auth[_0x3b35('0xd')](),controller[_0x3b35('0xe')]);router[_0x3b35('0x9')](_0x3b35('0xf'),auth[_0x3b35('0xd')](),controller[_0x3b35('0x10')]);router[_0x3b35('0x9')](_0x3b35('0x11'),auth[_0x3b35('0xd')](),controller[_0x3b35('0x12')]);router['post']('/',auth[_0x3b35('0xd')](),controller[_0x3b35('0x13')]);router[_0x3b35('0x14')](_0x3b35('0xa'),auth['isAuthenticated'](),controller[_0x3b35('0x15')]);router[_0x3b35('0x16')]('/:id',auth[_0x3b35('0xd')](),controller['destroy']);module[_0x3b35('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index e59e0db..f7030c1 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 _0xb532=['sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb532,0x178));var _0x2b53=function(_0x53f384,_0x21bc47){_0x53f384=_0x53f384-0x0;var _0x4ef7bc=_0xb532[_0x53f384];return _0x4ef7bc;};'use strict';var Sequelize=require(_0x2b53('0x0'));module[_0x2b53('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc075=['exports','STRING','sequelize'];(function(_0x1f7a4a,_0x5a347d){var _0x33f01f=function(_0x4b8ead){while(--_0x4b8ead){_0x1f7a4a['push'](_0x1f7a4a['shift']());}};_0x33f01f(++_0x5a347d);}(_0xc075,0x164));var _0x5c07=function(_0x11447a,_0x1eac37){_0x11447a=_0x11447a-0x0;var _0x4aa382=_0xc075[_0x11447a];return _0x4aa382;};'use strict';var Sequelize=require(_0x5c07('0x0'));module[_0x5c07('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c07('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ca9c2dd..7c55349 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 _0xda3f=['client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','count','offset','limit','set','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','SugarcrmField','order','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xda3f,0xec));var _0xfda3=function(_0x306b35,_0x3291f7){_0x306b35=_0x306b35-0x0;var _0xc6183e=_0xda3f[_0x306b35];return _0xc6183e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var hardwareService=require(_0xfda3('0x10'));var logger=require(_0xfda3('0x11'))('api');var utils=require(_0xfda3('0x12'));var config=require(_0xfda3('0x13'));var db=require(_0xfda3('0x14'))['db'];var jayson=require(_0xfda3('0x15'));var client=jayson[_0xfda3('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x583125,_0x5d7d5b,_0x3fd031){if(_0x3fd031){var _0x1e7a55=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e7a55['test'](_0x5d7d5b)){return _0x583125;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x583125;}}function respondWithRpcPromise(_0x587e9b,_0x227d72,_0x477fc0,_0x5ea793){return new BPromise(function(_0x57a229,_0x533365){var _0x80ea80=_0x5ea793||client;return _0x80ea80[_0xfda3('0x17')](_0x587e9b,_0x477fc0)[_0xfda3('0x18')](function(_0x3d8bcd){logger[_0xfda3('0x19')](_0xfda3('0x1a'),_0x227d72,_0xfda3('0x1b'));logger[_0xfda3('0x1c')](_0xfda3('0x1d'),_0x227d72,_0xfda3('0x1b'),JSON['stringify'](_0x3d8bcd));if(_0x3d8bcd[_0xfda3('0x1e')]){if(_0x3d8bcd[_0xfda3('0x1e')][_0xfda3('0x1f')]===0x1f4){logger[_0xfda3('0x1e')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x227d72,_0x3d8bcd[_0xfda3('0x1e')][_0xfda3('0x20')]);return _0x533365(_0x3d8bcd[_0xfda3('0x1e')]['message']);}logger['error'](_0xfda3('0x1a'),_0x227d72,_0x3d8bcd[_0xfda3('0x1e')][_0xfda3('0x20')]);return _0x57a229(_0x3d8bcd['error'][_0xfda3('0x20')]);}else{logger[_0xfda3('0x19')](_0xfda3('0x1a'),_0x227d72,_0xfda3('0x1b'));_0x57a229(_0x3d8bcd[_0xfda3('0x21')][_0xfda3('0x20')]);}})[_0xfda3('0x22')](function(_0xc6fb9a){logger[_0xfda3('0x1e')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x227d72,_0xc6fb9a);_0x533365(_0xc6fb9a);});});}function respondWithStatusCode(_0x82341b,_0x2d5b44){_0x2d5b44=_0x2d5b44||0xcc;return function(_0x2e8bf8){if(_0x2e8bf8){return _0x82341b['sendStatus'](_0x2d5b44);}return _0x82341b[_0xfda3('0x23')](_0x2d5b44)[_0xfda3('0x24')]();};}function respondWithResult(_0x172cfb,_0x38946d){_0x38946d=_0x38946d||0xc8;return function(_0x1cb831){if(_0x1cb831){return _0x172cfb[_0xfda3('0x23')](_0x38946d)['json'](_0x1cb831);}};}function respondWithFilteredResult(_0x3c6d7d,_0x1e87fe){return function(_0x2bef2b){if(_0x2bef2b){var _0x1f2884=_0x2bef2b[_0xfda3('0x25')],_0x33ffd4=_0x1e87fe[_0xfda3('0x26')],_0x5704c7=_0x1e87fe[_0xfda3('0x26')]+_0x1e87fe[_0xfda3('0x27')],_0x3c1549;if(_0x5704c7>=_0x1f2884){_0x5704c7=_0x1f2884;_0x3c1549=0xc8;}else{_0x3c1549=0xce;}_0x3c6d7d[_0xfda3('0x23')](_0x3c1549);return _0x3c6d7d[_0xfda3('0x28')]('Content-Range',_0x33ffd4+'-'+_0x5704c7+'/'+_0x1f2884)['json'](_0x2bef2b);}return null;};}function patchUpdates(_0x3aef3c){return function(_0x4fd277){try{jsonpatch['apply'](_0x4fd277,_0x3aef3c,!![]);}catch(_0x16b4a2){return BPromise[_0xfda3('0x29')](_0x16b4a2);}return _0x4fd277[_0xfda3('0x2a')]();};}function saveUpdates(_0xd7e1d6,_0x179c90){return function(_0x35ec7a){if(_0x35ec7a){return _0x35ec7a[_0xfda3('0x2b')](_0xd7e1d6)[_0xfda3('0x18')](function(_0x261a81){return _0x261a81;});}return null;};}function removeEntity(_0x5825bd,_0x49f84c){return function(_0x43b063){if(_0x43b063){return _0x43b063[_0xfda3('0x2c')]()[_0xfda3('0x18')](function(){_0x5825bd[_0xfda3('0x23')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x2b3afb,_0x210763){return function(_0x2bb705){if(!_0x2bb705){_0x2b3afb['sendStatus'](0x194);}return _0x2bb705;};}function handleError(_0x51ecde,_0x30e63e){_0x30e63e=_0x30e63e||0x1f4;return function(_0x17cccb){logger['error'](_0x17cccb[_0xfda3('0x2d')]);if(_0x17cccb[_0xfda3('0x2e')]){delete _0x17cccb[_0xfda3('0x2e')];}_0x51ecde['status'](_0x30e63e)[_0xfda3('0x2f')](_0x17cccb);};}exports[_0xfda3('0x30')]=function(_0xb4eeb7,_0x3151e6){var _0x1ab9b1={},_0x5ae650={},_0xc6dd4e={'count':0x0,'rows':[]};var _0x2d2043=db[_0xfda3('0x31')]['rawAttributes'];_0x5ae650[_0xfda3('0x32')]=_['keys'](_0x2d2043);_0x5ae650[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0xb4eeb7[_0xfda3('0x33')]);_0x5ae650[_0xfda3('0x35')]=_[_0xfda3('0x36')](_0x5ae650[_0xfda3('0x32')],_0x5ae650[_0xfda3('0x33')]);_0x1ab9b1[_0xfda3('0x37')]=_['intersection'](_0x5ae650[_0xfda3('0x32')],qs[_0xfda3('0x38')](_0xb4eeb7[_0xfda3('0x33')][_0xfda3('0x38')]));_0x1ab9b1['attributes']=_0x1ab9b1[_0xfda3('0x37')][_0xfda3('0x39')]?_0x1ab9b1[_0xfda3('0x37')]:_0x5ae650['model'];if(!_0xb4eeb7['query'][_0xfda3('0x3a')](_0xfda3('0x3b'))){_0x1ab9b1[_0xfda3('0x27')]=qs[_0xfda3('0x27')](_0xb4eeb7[_0xfda3('0x33')][_0xfda3('0x27')]);_0x1ab9b1[_0xfda3('0x26')]=qs[_0xfda3('0x26')](_0xb4eeb7[_0xfda3('0x33')][_0xfda3('0x26')]);}_0x1ab9b1['order']=qs[_0xfda3('0x3c')](_0xb4eeb7[_0xfda3('0x33')]['sort']);_0x1ab9b1[_0xfda3('0x3d')]=qs['filters'](_['pick'](_0xb4eeb7['query'],_0x5ae650[_0xfda3('0x35')]));if(_0xb4eeb7[_0xfda3('0x33')][_0xfda3('0x3e')]){_0x1ab9b1[_0xfda3('0x3d')]=_['merge'](_0x1ab9b1[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x3f')](_0x2d2043,function(_0x154ae7){if(_0x154ae7[_0xfda3('0x40')]['key']!==_0xfda3('0x41')){var _0x240c16={};_0x240c16[_0x154ae7[_0xfda3('0x42')]]={'$like':'%'+_0xb4eeb7['query']['filter']+'%'};return _0x240c16;}})});}_0x1ab9b1=_[_0xfda3('0x43')]({},_0x1ab9b1,_0xb4eeb7[_0xfda3('0x44')]);var _0x1eea02={'where':_0x1ab9b1[_0xfda3('0x3d')]};return db[_0xfda3('0x31')][_0xfda3('0x25')](_0x1eea02)[_0xfda3('0x18')](function(_0x1bd0d8){_0xc6dd4e[_0xfda3('0x25')]=_0x1bd0d8;if(_0xb4eeb7[_0xfda3('0x33')][_0xfda3('0x45')]){_0x1ab9b1[_0xfda3('0x46')]=[{'all':!![]}];}return db[_0xfda3('0x31')][_0xfda3('0x47')](_0x1ab9b1);})['then'](function(_0x4a0cbd){_0xc6dd4e[_0xfda3('0x48')]=_0x4a0cbd;return _0xc6dd4e;})[_0xfda3('0x18')](respondWithFilteredResult(_0x3151e6,_0x1ab9b1))[_0xfda3('0x22')](handleError(_0x3151e6,null));};exports[_0xfda3('0x49')]=function(_0x597e5a,_0x60a89d){var _0x192133={'raw':![],'where':{'id':_0x597e5a[_0xfda3('0x4a')]['id']}},_0x125f5a={};_0x125f5a[_0xfda3('0x32')]=_['keys'](db[_0xfda3('0x31')][_0xfda3('0x4b')]);_0x125f5a[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x597e5a[_0xfda3('0x33')]);_0x125f5a['filters']=_[_0xfda3('0x36')](_0x125f5a[_0xfda3('0x32')],_0x125f5a[_0xfda3('0x33')]);_0x192133['attributes']=_[_0xfda3('0x36')](_0x125f5a[_0xfda3('0x32')],qs[_0xfda3('0x38')](_0x597e5a['query'][_0xfda3('0x38')]));_0x192133[_0xfda3('0x37')]=_0x192133[_0xfda3('0x37')][_0xfda3('0x39')]?_0x192133[_0xfda3('0x37')]:_0x125f5a['model'];if(_0x597e5a[_0xfda3('0x33')]['includeAll']){_0x192133[_0xfda3('0x46')]=[{'all':!![]}];}_0x192133=_['merge']({},_0x192133,_0x597e5a[_0xfda3('0x44')]);return db[_0xfda3('0x31')][_0xfda3('0x4c')](_0x192133)[_0xfda3('0x18')](handleEntityNotFound(_0x60a89d,null))['then'](respondWithResult(_0x60a89d,null))[_0xfda3('0x22')](handleError(_0x60a89d,null));};exports[_0xfda3('0x4d')]=function(_0x2f2c32,_0x372f15){return db[_0xfda3('0x31')][_0xfda3('0x4d')](_0x2f2c32[_0xfda3('0x4e')],{})['then'](respondWithResult(_0x372f15,0xc9))['catch'](handleError(_0x372f15,null));};exports[_0xfda3('0x2b')]=function(_0x27d7f9,_0x218ee5){if(_0x27d7f9['body']['id']){delete _0x27d7f9['body']['id'];}return db[_0xfda3('0x31')][_0xfda3('0x4c')]({'where':{'id':_0x27d7f9[_0xfda3('0x4a')]['id']}})[_0xfda3('0x18')](handleEntityNotFound(_0x218ee5,null))[_0xfda3('0x18')](saveUpdates(_0x27d7f9['body'],null))[_0xfda3('0x18')](respondWithResult(_0x218ee5,null))[_0xfda3('0x22')](handleError(_0x218ee5,null));};exports[_0xfda3('0x2c')]=function(_0x375d8c,_0x27c3cb){return db[_0xfda3('0x31')][_0xfda3('0x4c')]({'where':{'id':_0x375d8c[_0xfda3('0x4a')]['id']}})[_0xfda3('0x18')](handleEntityNotFound(_0x27c3cb,null))[_0xfda3('0x18')](removeEntity(_0x27c3cb,null))[_0xfda3('0x22')](handleError(_0x27c3cb,null));};exports[_0xfda3('0x4f')]=function(_0x5b426b,_0x28c8a9,_0x2ce682){var _0x33bc84={};var _0x32c835={};var _0x3e674e;var _0x405d7e;return db[_0xfda3('0x31')]['findOne']({'where':{'id':_0x5b426b['params']['id']}})[_0xfda3('0x18')](handleEntityNotFound(_0x28c8a9,null))[_0xfda3('0x18')](function(_0x486e55){if(_0x486e55){_0x3e674e=_0x486e55;_0x32c835[_0xfda3('0x32')]=_[_0xfda3('0x34')](db[_0xfda3('0x50')][_0xfda3('0x4b')]);_0x32c835['query']=_['keys'](_0x5b426b[_0xfda3('0x33')]);_0x32c835[_0xfda3('0x35')]=_[_0xfda3('0x36')](_0x32c835['model'],_0x32c835[_0xfda3('0x33')]);_0x33bc84['attributes']=_[_0xfda3('0x36')](_0x32c835[_0xfda3('0x32')],qs[_0xfda3('0x38')](_0x5b426b[_0xfda3('0x33')][_0xfda3('0x38')]));_0x33bc84[_0xfda3('0x37')]=_0x33bc84['attributes'][_0xfda3('0x39')]?_0x33bc84[_0xfda3('0x37')]:_0x32c835[_0xfda3('0x32')];_0x33bc84[_0xfda3('0x51')]=qs[_0xfda3('0x3c')](_0x5b426b['query']['sort']);_0x33bc84[_0xfda3('0x3d')]=qs[_0xfda3('0x35')](_['pick'](_0x5b426b['query'],_0x32c835['filters']));if(_0x5b426b[_0xfda3('0x33')][_0xfda3('0x3e')]){_0x33bc84['where']=_[_0xfda3('0x43')](_0x33bc84[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x3f')](_0x33bc84[_0xfda3('0x37')],function(_0x51e463){var _0x1cd818={};_0x1cd818[_0x51e463]={'$like':'%'+_0x5b426b[_0xfda3('0x33')][_0xfda3('0x3e')]+'%'};return _0x1cd818;})});}_0x33bc84=_[_0xfda3('0x43')]({},_0x33bc84,_0x5b426b[_0xfda3('0x44')]);return _0x3e674e[_0xfda3('0x4f')](_0x33bc84);}})['then'](function(_0x4e312d){if(_0x4e312d){_0x405d7e=_0x4e312d[_0xfda3('0x39')];if(!_0x5b426b['query'][_0xfda3('0x3a')](_0xfda3('0x3b'))){_0x33bc84[_0xfda3('0x27')]=qs[_0xfda3('0x27')](_0x5b426b[_0xfda3('0x33')][_0xfda3('0x27')]);_0x33bc84[_0xfda3('0x26')]=qs[_0xfda3('0x26')](_0x5b426b[_0xfda3('0x33')][_0xfda3('0x26')]);}return _0x3e674e['getFields'](_0x33bc84);}})[_0xfda3('0x18')](function(_0x49f04a){if(_0x49f04a){return _0x49f04a?{'count':_0x405d7e,'rows':_0x49f04a}:null;}})['then'](respondWithResult(_0x28c8a9,null))[_0xfda3('0x22')](handleError(_0x28c8a9,null));};exports[_0xfda3('0x52')]=function(_0x531874,_0xa3b2e0,_0x26e1f5){var _0x42e387={};var _0x589c7a={};var _0x1a825c;var _0x3fe104;return db[_0xfda3('0x31')][_0xfda3('0x53')]({'where':{'id':_0x531874[_0xfda3('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa3b2e0,null))['then'](function(_0x53c2e9){if(_0x53c2e9){_0x1a825c=_0x53c2e9;_0x589c7a[_0xfda3('0x32')]=_[_0xfda3('0x34')](db[_0xfda3('0x50')][_0xfda3('0x4b')]);_0x589c7a[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x531874['query']);_0x589c7a[_0xfda3('0x35')]=_[_0xfda3('0x36')](_0x589c7a[_0xfda3('0x32')],_0x589c7a[_0xfda3('0x33')]);_0x42e387['attributes']=_[_0xfda3('0x36')](_0x589c7a['model'],qs[_0xfda3('0x38')](_0x531874[_0xfda3('0x33')][_0xfda3('0x38')]));_0x42e387[_0xfda3('0x37')]=_0x42e387[_0xfda3('0x37')][_0xfda3('0x39')]?_0x42e387[_0xfda3('0x37')]:_0x589c7a['model'];_0x42e387[_0xfda3('0x51')]=qs[_0xfda3('0x3c')](_0x531874[_0xfda3('0x33')][_0xfda3('0x3c')]);_0x42e387[_0xfda3('0x3d')]=qs[_0xfda3('0x35')](_['pick'](_0x531874[_0xfda3('0x33')],_0x589c7a[_0xfda3('0x35')]));if(_0x531874[_0xfda3('0x33')][_0xfda3('0x3e')]){_0x42e387[_0xfda3('0x3d')]=_['merge'](_0x42e387[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x3f')](_0x42e387[_0xfda3('0x37')],function(_0x42a092){var _0xcb7ff4={};_0xcb7ff4[_0x42a092]={'$like':'%'+_0x531874[_0xfda3('0x33')][_0xfda3('0x3e')]+'%'};return _0xcb7ff4;})});}_0x42e387=_[_0xfda3('0x43')]({},_0x42e387,_0x531874[_0xfda3('0x44')]);return _0x1a825c[_0xfda3('0x52')](_0x42e387);}})['then'](function(_0x1c0e07){if(_0x1c0e07){_0x3fe104=_0x1c0e07[_0xfda3('0x39')];if(!_0x531874[_0xfda3('0x33')][_0xfda3('0x3a')](_0xfda3('0x3b'))){_0x42e387['limit']=qs['limit'](_0x531874[_0xfda3('0x33')][_0xfda3('0x27')]);_0x42e387[_0xfda3('0x26')]=qs[_0xfda3('0x26')](_0x531874[_0xfda3('0x33')][_0xfda3('0x26')]);}return _0x1a825c[_0xfda3('0x52')](_0x42e387);}})[_0xfda3('0x18')](function(_0xbf5a90){if(_0xbf5a90){return _0xbf5a90?{'count':_0x3fe104,'rows':_0xbf5a90}:null;}})[_0xfda3('0x18')](respondWithResult(_0xa3b2e0,null))[_0xfda3('0x22')](handleError(_0xa3b2e0,null));};exports['getDescriptions']=function(_0x1ee8f4,_0x49f89a,_0x483060){var _0x59e6ae={};var _0x26dca4={};var _0x4a2c6a;var _0x334d87;return db[_0xfda3('0x31')]['findOne']({'where':{'id':_0x1ee8f4[_0xfda3('0x4a')]['id']}})[_0xfda3('0x18')](handleEntityNotFound(_0x49f89a,null))['then'](function(_0x12b727){if(_0x12b727){_0x4a2c6a=_0x12b727;_0x26dca4['model']=_[_0xfda3('0x34')](db[_0xfda3('0x50')]['rawAttributes']);_0x26dca4[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x1ee8f4[_0xfda3('0x33')]);_0x26dca4[_0xfda3('0x35')]=_[_0xfda3('0x36')](_0x26dca4['model'],_0x26dca4[_0xfda3('0x33')]);_0x59e6ae[_0xfda3('0x37')]=_[_0xfda3('0x36')](_0x26dca4[_0xfda3('0x32')],qs[_0xfda3('0x38')](_0x1ee8f4['query']['fields']));_0x59e6ae['attributes']=_0x59e6ae[_0xfda3('0x37')][_0xfda3('0x39')]?_0x59e6ae[_0xfda3('0x37')]:_0x26dca4[_0xfda3('0x32')];_0x59e6ae[_0xfda3('0x51')]=qs[_0xfda3('0x3c')](_0x1ee8f4[_0xfda3('0x33')][_0xfda3('0x3c')]);_0x59e6ae['where']=qs[_0xfda3('0x35')](_[_0xfda3('0x54')](_0x1ee8f4['query'],_0x26dca4[_0xfda3('0x35')]));if(_0x1ee8f4[_0xfda3('0x33')]['filter']){_0x59e6ae[_0xfda3('0x3d')]=_[_0xfda3('0x43')](_0x59e6ae[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x3f')](_0x59e6ae[_0xfda3('0x37')],function(_0x547d43){var _0x2fa142={};_0x2fa142[_0x547d43]={'$like':'%'+_0x1ee8f4[_0xfda3('0x33')][_0xfda3('0x3e')]+'%'};return _0x2fa142;})});}_0x59e6ae=_[_0xfda3('0x43')]({},_0x59e6ae,_0x1ee8f4['options']);return _0x4a2c6a[_0xfda3('0x55')](_0x59e6ae);}})[_0xfda3('0x18')](function(_0xef43d9){if(_0xef43d9){_0x334d87=_0xef43d9[_0xfda3('0x39')];if(!_0x1ee8f4[_0xfda3('0x33')][_0xfda3('0x3a')](_0xfda3('0x3b'))){_0x59e6ae[_0xfda3('0x27')]=qs[_0xfda3('0x27')](_0x1ee8f4[_0xfda3('0x33')][_0xfda3('0x27')]);_0x59e6ae['offset']=qs['offset'](_0x1ee8f4[_0xfda3('0x33')]['offset']);}return _0x4a2c6a[_0xfda3('0x55')](_0x59e6ae);}})['then'](function(_0x5a8483){if(_0x5a8483){return _0x5a8483?{'count':_0x334d87,'rows':_0x5a8483}:null;}})['then'](respondWithResult(_0x49f89a,null))[_0xfda3('0x22')](handleError(_0x49f89a,null));}; \ No newline at end of file +var _0xe706=['../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','code','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','status','end','count','offset','limit','set','Content-Range','json','save','update','destroy','sendStatus','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','filter','options','then','include','findAll','rows','show','includeAll','find','catch','create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x266f7d,_0x1b4e7f){var _0x44c322=function(_0x1d6158){while(--_0x1d6158){_0x266f7d['push'](_0x266f7d['shift']());}};_0x44c322(++_0x1b4e7f);}(_0xe706,0xa3));var _0x6e70=function(_0x152ef7,_0x221f4c){_0x152ef7=_0x152ef7-0x0;var _0x33b535=_0xe706[_0x152ef7];return _0x33b535;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var hardwareService=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];var jayson=require(_0x6e70('0x1b'));var client=jayson[_0x6e70('0x1c')][_0x6e70('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3b38f3,_0x310eb7,_0xa1eb74){if(_0xa1eb74){var _0x181005=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x181005['test'](_0x310eb7)){return _0x3b38f3;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3b38f3;}}function respondWithRpcPromise(_0x48bc72,_0x257e81,_0x5a37a6,_0x53aed0){return new BPromise(function(_0x304716,_0x22c50c){var _0x5d9263=_0x53aed0||client;return _0x5d9263[_0x6e70('0x1e')](_0x48bc72,_0x5a37a6)['then'](function(_0x2efc0f){logger[_0x6e70('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x257e81,'request\x20sent');logger[_0x6e70('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x257e81,_0x6e70('0x21'),JSON[_0x6e70('0x22')](_0x2efc0f));if(_0x2efc0f['error']){if(_0x2efc0f['error'][_0x6e70('0x23')]===0x1f4){logger[_0x6e70('0x24')](_0x6e70('0x25'),_0x257e81,_0x2efc0f[_0x6e70('0x24')][_0x6e70('0x26')]);return _0x22c50c(_0x2efc0f[_0x6e70('0x24')][_0x6e70('0x26')]);}logger[_0x6e70('0x24')](_0x6e70('0x25'),_0x257e81,_0x2efc0f[_0x6e70('0x24')]['message']);return _0x304716(_0x2efc0f[_0x6e70('0x24')][_0x6e70('0x26')]);}else{logger[_0x6e70('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x257e81,_0x6e70('0x21'));_0x304716(_0x2efc0f[_0x6e70('0x27')][_0x6e70('0x26')]);}})['catch'](function(_0x10fc91){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x257e81,_0x10fc91);_0x22c50c(_0x10fc91);});});}function respondWithStatusCode(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0xcc;return function(_0x19c5ae){if(_0x19c5ae){return _0x4e97c7['sendStatus'](_0x41e352);}return _0x4e97c7[_0x6e70('0x28')](_0x41e352)[_0x6e70('0x29')]();};}function respondWithResult(_0x5f268f,_0x338ad6){_0x338ad6=_0x338ad6||0xc8;return function(_0x67fb43){if(_0x67fb43){return _0x5f268f[_0x6e70('0x28')](_0x338ad6)['json'](_0x67fb43);}};}function respondWithFilteredResult(_0x54a5fe,_0x2c4d37){return function(_0x3af17f){if(_0x3af17f){var _0x83c836=_0x3af17f[_0x6e70('0x2a')],_0x114344=_0x2c4d37[_0x6e70('0x2b')],_0x43fee0=_0x2c4d37[_0x6e70('0x2b')]+_0x2c4d37[_0x6e70('0x2c')],_0x5d772a;if(_0x43fee0>=_0x83c836){_0x43fee0=_0x83c836;_0x5d772a=0xc8;}else{_0x5d772a=0xce;}_0x54a5fe[_0x6e70('0x28')](_0x5d772a);return _0x54a5fe[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x114344+'-'+_0x43fee0+'/'+_0x83c836)[_0x6e70('0x2f')](_0x3af17f);}return null;};}function patchUpdates(_0x3a0821){return function(_0x3a5d30){try{jsonpatch['apply'](_0x3a5d30,_0x3a0821,!![]);}catch(_0x1b27d8){return BPromise['reject'](_0x1b27d8);}return _0x3a5d30[_0x6e70('0x30')]();};}function saveUpdates(_0x5a7a2a,_0xdd7cc1){return function(_0x2722e8){if(_0x2722e8){return _0x2722e8[_0x6e70('0x31')](_0x5a7a2a)['then'](function(_0x38c40d){return _0x38c40d;});}return null;};}function removeEntity(_0x42b094,_0x5780a1){return function(_0x13d673){if(_0x13d673){return _0x13d673[_0x6e70('0x32')]()['then'](function(){_0x42b094[_0x6e70('0x28')](0xcc)[_0x6e70('0x29')]();});}};}function handleEntityNotFound(_0x2d52bd,_0x2723d7){return function(_0x3b4a13){if(!_0x3b4a13){_0x2d52bd[_0x6e70('0x33')](0x194);}return _0x3b4a13;};}function handleError(_0x44b19d,_0x3f42bd){_0x3f42bd=_0x3f42bd||0x1f4;return function(_0xf146fd){logger[_0x6e70('0x24')](_0xf146fd['stack']);if(_0xf146fd[_0x6e70('0x34')]){delete _0xf146fd['name'];}_0x44b19d[_0x6e70('0x28')](_0x3f42bd)[_0x6e70('0x35')](_0xf146fd);};}exports[_0x6e70('0x36')]=function(_0x32d12d,_0x233a83){var _0x989b80={},_0x2440be={},_0xdd0bee={'count':0x0,'rows':[]};var _0x80bebb=db[_0x6e70('0x37')][_0x6e70('0x38')];_0x2440be[_0x6e70('0x39')]=_[_0x6e70('0x3a')](_0x80bebb);_0x2440be['query']=_['keys'](_0x32d12d['query']);_0x2440be[_0x6e70('0x3b')]=_[_0x6e70('0x3c')](_0x2440be[_0x6e70('0x39')],_0x2440be[_0x6e70('0x3d')]);_0x989b80[_0x6e70('0x3e')]=_[_0x6e70('0x3c')](_0x2440be['model'],qs[_0x6e70('0x3f')](_0x32d12d[_0x6e70('0x3d')][_0x6e70('0x3f')]));_0x989b80[_0x6e70('0x3e')]=_0x989b80[_0x6e70('0x3e')][_0x6e70('0x40')]?_0x989b80[_0x6e70('0x3e')]:_0x2440be[_0x6e70('0x39')];if(!_0x32d12d['query'][_0x6e70('0x41')](_0x6e70('0x42'))){_0x989b80[_0x6e70('0x2c')]=qs[_0x6e70('0x2c')](_0x32d12d[_0x6e70('0x3d')][_0x6e70('0x2c')]);_0x989b80[_0x6e70('0x2b')]=qs['offset'](_0x32d12d['query']['offset']);}_0x989b80[_0x6e70('0x43')]=qs[_0x6e70('0x44')](_0x32d12d[_0x6e70('0x3d')][_0x6e70('0x44')]);_0x989b80[_0x6e70('0x45')]=qs['filters'](_[_0x6e70('0x46')](_0x32d12d[_0x6e70('0x3d')],_0x2440be[_0x6e70('0x3b')]));if(_0x32d12d['query']['filter']){_0x989b80['where']=_[_0x6e70('0x47')](_0x989b80['where'],{'$or':_[_0x6e70('0x48')](_0x80bebb,function(_0x39913a){if(_0x39913a[_0x6e70('0x49')][_0x6e70('0x4a')]!=='VIRTUAL'){var _0x62b925={};_0x62b925[_0x39913a['field']]={'$like':'%'+_0x32d12d[_0x6e70('0x3d')][_0x6e70('0x4b')]+'%'};return _0x62b925;}})});}_0x989b80=_[_0x6e70('0x47')]({},_0x989b80,_0x32d12d[_0x6e70('0x4c')]);var _0x5bbc3a={'where':_0x989b80[_0x6e70('0x45')]};return db[_0x6e70('0x37')][_0x6e70('0x2a')](_0x5bbc3a)[_0x6e70('0x4d')](function(_0x8f243d){_0xdd0bee[_0x6e70('0x2a')]=_0x8f243d;if(_0x32d12d[_0x6e70('0x3d')]['includeAll']){_0x989b80[_0x6e70('0x4e')]=[{'all':!![]}];}return db[_0x6e70('0x37')][_0x6e70('0x4f')](_0x989b80);})[_0x6e70('0x4d')](function(_0x3f86cf){_0xdd0bee[_0x6e70('0x50')]=_0x3f86cf;return _0xdd0bee;})[_0x6e70('0x4d')](respondWithFilteredResult(_0x233a83,_0x989b80))['catch'](handleError(_0x233a83,null));};exports[_0x6e70('0x51')]=function(_0x50cdf1,_0x11794e){var _0x3836e4={'raw':![],'where':{'id':_0x50cdf1['params']['id']}},_0x4b351e={};_0x4b351e[_0x6e70('0x39')]=_[_0x6e70('0x3a')](db[_0x6e70('0x37')]['rawAttributes']);_0x4b351e['query']=_[_0x6e70('0x3a')](_0x50cdf1[_0x6e70('0x3d')]);_0x4b351e[_0x6e70('0x3b')]=_[_0x6e70('0x3c')](_0x4b351e[_0x6e70('0x39')],_0x4b351e[_0x6e70('0x3d')]);_0x3836e4['attributes']=_[_0x6e70('0x3c')](_0x4b351e[_0x6e70('0x39')],qs[_0x6e70('0x3f')](_0x50cdf1[_0x6e70('0x3d')][_0x6e70('0x3f')]));_0x3836e4['attributes']=_0x3836e4['attributes'][_0x6e70('0x40')]?_0x3836e4[_0x6e70('0x3e')]:_0x4b351e[_0x6e70('0x39')];if(_0x50cdf1[_0x6e70('0x3d')][_0x6e70('0x52')]){_0x3836e4['include']=[{'all':!![]}];}_0x3836e4=_[_0x6e70('0x47')]({},_0x3836e4,_0x50cdf1[_0x6e70('0x4c')]);return db[_0x6e70('0x37')][_0x6e70('0x53')](_0x3836e4)[_0x6e70('0x4d')](handleEntityNotFound(_0x11794e,null))['then'](respondWithResult(_0x11794e,null))[_0x6e70('0x54')](handleError(_0x11794e,null));};exports[_0x6e70('0x55')]=function(_0x2c20d3,_0x3fb0d3){return db[_0x6e70('0x37')][_0x6e70('0x55')](_0x2c20d3['body'],{})[_0x6e70('0x4d')](respondWithResult(_0x3fb0d3,0xc9))[_0x6e70('0x54')](handleError(_0x3fb0d3,null));};exports['update']=function(_0x382fde,_0xebe5f7){if(_0x382fde['body']['id']){delete _0x382fde[_0x6e70('0x56')]['id'];}return db[_0x6e70('0x37')][_0x6e70('0x53')]({'where':{'id':_0x382fde[_0x6e70('0x57')]['id']}})[_0x6e70('0x4d')](handleEntityNotFound(_0xebe5f7,null))['then'](saveUpdates(_0x382fde[_0x6e70('0x56')],null))[_0x6e70('0x4d')](respondWithResult(_0xebe5f7,null))[_0x6e70('0x54')](handleError(_0xebe5f7,null));};exports[_0x6e70('0x32')]=function(_0x1c02d7,_0x1fe13a){return db[_0x6e70('0x37')][_0x6e70('0x53')]({'where':{'id':_0x1c02d7[_0x6e70('0x57')]['id']}})[_0x6e70('0x4d')](handleEntityNotFound(_0x1fe13a,null))[_0x6e70('0x4d')](removeEntity(_0x1fe13a,null))[_0x6e70('0x54')](handleError(_0x1fe13a,null));};exports[_0x6e70('0x58')]=function(_0x1fd9a6,_0x2a9173,_0x2240a1){var _0x324fa6={};var _0x4329a6={};var _0x2a8627;var _0x1c7dca;return db['SugarcrmConfiguration'][_0x6e70('0x59')]({'where':{'id':_0x1fd9a6[_0x6e70('0x57')]['id']}})[_0x6e70('0x4d')](handleEntityNotFound(_0x2a9173,null))[_0x6e70('0x4d')](function(_0x36757e){if(_0x36757e){_0x2a8627=_0x36757e;_0x4329a6[_0x6e70('0x39')]=_['keys'](db[_0x6e70('0x5a')][_0x6e70('0x38')]);_0x4329a6['query']=_[_0x6e70('0x3a')](_0x1fd9a6[_0x6e70('0x3d')]);_0x4329a6[_0x6e70('0x3b')]=_['intersection'](_0x4329a6['model'],_0x4329a6[_0x6e70('0x3d')]);_0x324fa6[_0x6e70('0x3e')]=_[_0x6e70('0x3c')](_0x4329a6[_0x6e70('0x39')],qs[_0x6e70('0x3f')](_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x3f')]));_0x324fa6['attributes']=_0x324fa6['attributes'][_0x6e70('0x40')]?_0x324fa6[_0x6e70('0x3e')]:_0x4329a6[_0x6e70('0x39')];_0x324fa6[_0x6e70('0x43')]=qs['sort'](_0x1fd9a6['query'][_0x6e70('0x44')]);_0x324fa6[_0x6e70('0x45')]=qs['filters'](_['pick'](_0x1fd9a6[_0x6e70('0x3d')],_0x4329a6['filters']));if(_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x4b')]){_0x324fa6[_0x6e70('0x45')]=_[_0x6e70('0x47')](_0x324fa6[_0x6e70('0x45')],{'$or':_[_0x6e70('0x48')](_0x324fa6[_0x6e70('0x3e')],function(_0x6ab1d6){var _0x570115={};_0x570115[_0x6ab1d6]={'$like':'%'+_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x4b')]+'%'};return _0x570115;})});}_0x324fa6=_[_0x6e70('0x47')]({},_0x324fa6,_0x1fd9a6[_0x6e70('0x4c')]);return _0x2a8627[_0x6e70('0x58')](_0x324fa6);}})['then'](function(_0x5f5b02){if(_0x5f5b02){_0x1c7dca=_0x5f5b02['length'];if(!_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x41')](_0x6e70('0x42'))){_0x324fa6['limit']=qs['limit'](_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x2c')]);_0x324fa6[_0x6e70('0x2b')]=qs[_0x6e70('0x2b')](_0x1fd9a6[_0x6e70('0x3d')][_0x6e70('0x2b')]);}return _0x2a8627['getFields'](_0x324fa6);}})[_0x6e70('0x4d')](function(_0x3f5896){if(_0x3f5896){return _0x3f5896?{'count':_0x1c7dca,'rows':_0x3f5896}:null;}})[_0x6e70('0x4d')](respondWithResult(_0x2a9173,null))[_0x6e70('0x54')](handleError(_0x2a9173,null));};exports['getSubjects']=function(_0xce964b,_0x531097,_0x5b4046){var _0x30487b={};var _0x3249a5={};var _0x3f37c1;var _0xe24ad5;return db[_0x6e70('0x37')][_0x6e70('0x59')]({'where':{'id':_0xce964b['params']['id']}})[_0x6e70('0x4d')](handleEntityNotFound(_0x531097,null))[_0x6e70('0x4d')](function(_0x186550){if(_0x186550){_0x3f37c1=_0x186550;_0x3249a5[_0x6e70('0x39')]=_[_0x6e70('0x3a')](db[_0x6e70('0x5a')][_0x6e70('0x38')]);_0x3249a5[_0x6e70('0x3d')]=_[_0x6e70('0x3a')](_0xce964b[_0x6e70('0x3d')]);_0x3249a5['filters']=_[_0x6e70('0x3c')](_0x3249a5[_0x6e70('0x39')],_0x3249a5[_0x6e70('0x3d')]);_0x30487b['attributes']=_['intersection'](_0x3249a5[_0x6e70('0x39')],qs[_0x6e70('0x3f')](_0xce964b[_0x6e70('0x3d')][_0x6e70('0x3f')]));_0x30487b[_0x6e70('0x3e')]=_0x30487b['attributes']['length']?_0x30487b[_0x6e70('0x3e')]:_0x3249a5[_0x6e70('0x39')];_0x30487b['order']=qs[_0x6e70('0x44')](_0xce964b[_0x6e70('0x3d')][_0x6e70('0x44')]);_0x30487b[_0x6e70('0x45')]=qs[_0x6e70('0x3b')](_[_0x6e70('0x46')](_0xce964b[_0x6e70('0x3d')],_0x3249a5[_0x6e70('0x3b')]));if(_0xce964b[_0x6e70('0x3d')][_0x6e70('0x4b')]){_0x30487b[_0x6e70('0x45')]=_[_0x6e70('0x47')](_0x30487b[_0x6e70('0x45')],{'$or':_[_0x6e70('0x48')](_0x30487b['attributes'],function(_0x5b3cb0){var _0x39ed95={};_0x39ed95[_0x5b3cb0]={'$like':'%'+_0xce964b['query'][_0x6e70('0x4b')]+'%'};return _0x39ed95;})});}_0x30487b=_['merge']({},_0x30487b,_0xce964b['options']);return _0x3f37c1[_0x6e70('0x5b')](_0x30487b);}})['then'](function(_0x576069){if(_0x576069){_0xe24ad5=_0x576069[_0x6e70('0x40')];if(!_0xce964b[_0x6e70('0x3d')][_0x6e70('0x41')]('nolimit')){_0x30487b['limit']=qs['limit'](_0xce964b[_0x6e70('0x3d')]['limit']);_0x30487b[_0x6e70('0x2b')]=qs[_0x6e70('0x2b')](_0xce964b[_0x6e70('0x3d')][_0x6e70('0x2b')]);}return _0x3f37c1[_0x6e70('0x5b')](_0x30487b);}})[_0x6e70('0x4d')](function(_0x214a8f){if(_0x214a8f){return _0x214a8f?{'count':_0xe24ad5,'rows':_0x214a8f}:null;}})['then'](respondWithResult(_0x531097,null))[_0x6e70('0x54')](handleError(_0x531097,null));};exports[_0x6e70('0x5c')]=function(_0xb649a6,_0x551904,_0x2c84ed){var _0x227d94={};var _0x11a615={};var _0x267576;var _0x451960;return db[_0x6e70('0x37')][_0x6e70('0x59')]({'where':{'id':_0xb649a6[_0x6e70('0x57')]['id']}})[_0x6e70('0x4d')](handleEntityNotFound(_0x551904,null))['then'](function(_0x463eed){if(_0x463eed){_0x267576=_0x463eed;_0x11a615[_0x6e70('0x39')]=_['keys'](db[_0x6e70('0x5a')][_0x6e70('0x38')]);_0x11a615['query']=_['keys'](_0xb649a6[_0x6e70('0x3d')]);_0x11a615['filters']=_[_0x6e70('0x3c')](_0x11a615['model'],_0x11a615[_0x6e70('0x3d')]);_0x227d94[_0x6e70('0x3e')]=_[_0x6e70('0x3c')](_0x11a615[_0x6e70('0x39')],qs[_0x6e70('0x3f')](_0xb649a6[_0x6e70('0x3d')][_0x6e70('0x3f')]));_0x227d94['attributes']=_0x227d94['attributes'][_0x6e70('0x40')]?_0x227d94['attributes']:_0x11a615[_0x6e70('0x39')];_0x227d94[_0x6e70('0x43')]=qs[_0x6e70('0x44')](_0xb649a6[_0x6e70('0x3d')]['sort']);_0x227d94[_0x6e70('0x45')]=qs['filters'](_[_0x6e70('0x46')](_0xb649a6[_0x6e70('0x3d')],_0x11a615[_0x6e70('0x3b')]));if(_0xb649a6[_0x6e70('0x3d')][_0x6e70('0x4b')]){_0x227d94[_0x6e70('0x45')]=_[_0x6e70('0x47')](_0x227d94['where'],{'$or':_[_0x6e70('0x48')](_0x227d94['attributes'],function(_0x185599){var _0x5f1e62={};_0x5f1e62[_0x185599]={'$like':'%'+_0xb649a6['query']['filter']+'%'};return _0x5f1e62;})});}_0x227d94=_[_0x6e70('0x47')]({},_0x227d94,_0xb649a6[_0x6e70('0x4c')]);return _0x267576[_0x6e70('0x5c')](_0x227d94);}})[_0x6e70('0x4d')](function(_0x2a3a71){if(_0x2a3a71){_0x451960=_0x2a3a71['length'];if(!_0xb649a6[_0x6e70('0x3d')][_0x6e70('0x41')]('nolimit')){_0x227d94[_0x6e70('0x2c')]=qs['limit'](_0xb649a6[_0x6e70('0x3d')]['limit']);_0x227d94['offset']=qs[_0x6e70('0x2b')](_0xb649a6[_0x6e70('0x3d')][_0x6e70('0x2b')]);}return _0x267576[_0x6e70('0x5c')](_0x227d94);}})[_0x6e70('0x4d')](function(_0x14d941){if(_0x14d941){return _0x14d941?{'count':_0x451960,'rows':_0x14d941}:null;}})[_0x6e70('0x4d')](respondWithResult(_0x551904,null))['catch'](handleError(_0x551904,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index faad696..5e5af60 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 _0x5a2f=['moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5a2f,0x6c));var _0xf5a2=function(_0x820d7b,_0xa5564c){_0x820d7b=_0x820d7b-0x0;var _0x249af0=_0x5a2f[_0x820d7b];return _0x249af0;};'use strict';var _=require(_0xf5a2('0x0'));var util=require(_0xf5a2('0x1'));var logger=require(_0xf5a2('0x2'))(_0xf5a2('0x3'));var moment=require(_0xf5a2('0x4'));var BPromise=require(_0xf5a2('0x5'));var rp=require(_0xf5a2('0x6'));var fs=require('fs');var path=require(_0xf5a2('0x7'));var rimraf=require(_0xf5a2('0x8'));var config=require('../../config/environment');var attributes=require(_0xf5a2('0x9'));module[_0xf5a2('0xa')]=function(_0x1bf371,_0x3c674e){return _0x1bf371[_0xf5a2('0xb')](_0xf5a2('0xc'),attributes,{'tableName':_0xf5a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59d1=['bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x3e2789,_0x6d23c6){var _0x4371ba=function(_0x4d5af7){while(--_0x4d5af7){_0x3e2789['push'](_0x3e2789['shift']());}};_0x4371ba(++_0x6d23c6);}(_0x59d1,0x10f));var _0x159d=function(_0x20cdd2,_0x24da9b){_0x20cdd2=_0x20cdd2-0x0;var _0x8bd09e=_0x59d1[_0x20cdd2];return _0x8bd09e;};'use strict';var _=require(_0x159d('0x0'));var util=require('util');var logger=require(_0x159d('0x1'))(_0x159d('0x2'));var moment=require(_0x159d('0x3'));var BPromise=require(_0x159d('0x4'));var rp=require(_0x159d('0x5'));var fs=require('fs');var path=require(_0x159d('0x6'));var rimraf=require('rimraf');var config=require(_0x159d('0x7'));var attributes=require(_0x159d('0x8'));module['exports']=function(_0x536838,_0x559147){return _0x536838[_0x159d('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x159d('0xa'),'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 9079cab..4ace138 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 _0xcd3a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xcd3a,0x177));var _0xacd3=function(_0x3bfbd8,_0x859fc3){_0x3bfbd8=_0x3bfbd8-0x0;var _0x356119=_0xcd3a[_0x3bfbd8];return _0x356119;};'use strict';var _=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var moment=require(_0xacd3('0x2'));var BPromise=require(_0xacd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacd3('0x4'));var db=require(_0xacd3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacd3('0x6'))(_0xacd3('0x7'));var config=require(_0xacd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xacd3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41aa94,_0x26d37d,_0x328e44){return new BPromise(function(_0x38acb7,_0x338e22){return client[_0xacd3('0xa')](_0x41aa94,_0x328e44)[_0xacd3('0xb')](function(_0x5988cf){logger[_0xacd3('0xc')](_0xacd3('0xd'),_0x26d37d,'request\x20sent');logger['debug'](_0xacd3('0xe'),_0x26d37d,'request\x20sent',JSON[_0xacd3('0xf')](_0x5988cf));if(_0x5988cf['error']){if(_0x5988cf[_0xacd3('0x10')][_0xacd3('0x11')]===0x1f4){logger[_0xacd3('0x10')](_0xacd3('0xd'),_0x26d37d,_0x5988cf[_0xacd3('0x10')][_0xacd3('0x12')]);return _0x338e22(_0x5988cf['error'][_0xacd3('0x12')]);}logger[_0xacd3('0x10')](_0xacd3('0xd'),_0x26d37d,_0x5988cf[_0xacd3('0x10')]['message']);return _0x38acb7(_0x5988cf[_0xacd3('0x10')][_0xacd3('0x12')]);}else{logger[_0xacd3('0xc')](_0xacd3('0xd'),_0x26d37d,_0xacd3('0x13'));_0x38acb7(_0x5988cf[_0xacd3('0x14')][_0xacd3('0x12')]);}})[_0xacd3('0x15')](function(_0x1c1f36){logger[_0xacd3('0x10')](_0xacd3('0xd'),_0x26d37d,_0x1c1f36);_0x338e22(_0x1c1f36);});});} \ No newline at end of file +var _0x06a7=['code','message','catch','bluebird','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x297269,_0x568256){var _0x4ba584=function(_0x5869df){while(--_0x5869df){_0x297269['push'](_0x297269['shift']());}};_0x4ba584(++_0x568256);}(_0x06a7,0x193));var _0x706a=function(_0x35508c,_0x57f0bd){_0x35508c=_0x35508c-0x0;var _0x3a2bc0=_0x06a7[_0x35508c];return _0x3a2bc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x706a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x706a('0x1'));var jayson=require(_0x706a('0x2'));var client=jayson[_0x706a('0x3')]['http']({'port':0x232a});function respondWithRpcPromise(_0x278dd5,_0x1a2cd7,_0x36a3d1){return new BPromise(function(_0x1df5d8,_0x178d60){return client[_0x706a('0x4')](_0x278dd5,_0x36a3d1)[_0x706a('0x5')](function(_0x84cdf2){logger[_0x706a('0x6')](_0x706a('0x7'),_0x1a2cd7,_0x706a('0x8'));logger[_0x706a('0x9')](_0x706a('0xa'),_0x1a2cd7,'request\x20sent',JSON[_0x706a('0xb')](_0x84cdf2));if(_0x84cdf2[_0x706a('0xc')]){if(_0x84cdf2['error'][_0x706a('0xd')]===0x1f4){logger[_0x706a('0xc')](_0x706a('0x7'),_0x1a2cd7,_0x84cdf2['error'][_0x706a('0xe')]);return _0x178d60(_0x84cdf2[_0x706a('0xc')][_0x706a('0xe')]);}logger[_0x706a('0xc')](_0x706a('0x7'),_0x1a2cd7,_0x84cdf2[_0x706a('0xc')][_0x706a('0xe')]);return _0x1df5d8(_0x84cdf2[_0x706a('0xc')][_0x706a('0xe')]);}else{logger[_0x706a('0x6')](_0x706a('0x7'),_0x1a2cd7,_0x706a('0x8'));_0x1df5d8(_0x84cdf2['result']['message']);}})[_0x706a('0xf')](function(_0x299751){logger[_0x706a('0xc')](_0x706a('0x7'),_0x1a2cd7,_0x299751);_0x178d60(_0x299751);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 04fe9fa..4d920c9 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 _0x85ab=['path','express','Router','../../components/auth/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','multer','util'];(function(_0x51a5a2,_0xb55667){var _0x14978a=function(_0xbc11e0){while(--_0xbc11e0){_0x51a5a2['push'](_0x51a5a2['shift']());}};_0x14978a(++_0xb55667);}(_0x85ab,0x94));var _0xb85a=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x85ab[_0xc14df7];return _0x34a445;};'use strict';var multer=require(_0xb85a('0x0'));var util=require(_0xb85a('0x1'));var path=require(_0xb85a('0x2'));var timeout=require('connect-timeout');var express=require(_0xb85a('0x3'));var router=express[_0xb85a('0x4')]();var auth=require(_0xb85a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb85a('0x6'));router[_0xb85a('0x7')]('/',auth[_0xb85a('0x8')](),controller[_0xb85a('0x9')]);router[_0xb85a('0x7')](_0xb85a('0xa'),auth[_0xb85a('0x8')](),controller['show']);router['post']('/',auth[_0xb85a('0x8')](),controller[_0xb85a('0xb')]);router['put'](_0xb85a('0xa'),auth[_0xb85a('0x8')](),controller[_0xb85a('0xc')]);router[_0xb85a('0xd')](_0xb85a('0xa'),auth[_0xb85a('0x8')](),controller[_0xb85a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x8d50=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x4e75c7,_0x1bc6f5){var _0x486403=function(_0xdc8cf7){while(--_0xdc8cf7){_0x4e75c7['push'](_0x4e75c7['shift']());}};_0x486403(++_0x1bc6f5);}(_0x8d50,0x117));var _0x08d5=function(_0x5726d9,_0x28fa59){_0x5726d9=_0x5726d9-0x0;var _0x2b327c=_0x8d50[_0x5726d9];return _0x2b327c;};'use strict';var multer=require(_0x08d5('0x0'));var util=require(_0x08d5('0x1'));var path=require(_0x08d5('0x2'));var timeout=require('connect-timeout');var express=require(_0x08d5('0x3'));var router=express[_0x08d5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x08d5('0x5'));var config=require(_0x08d5('0x6'));var controller=require(_0x08d5('0x7'));router[_0x08d5('0x8')]('/',auth[_0x08d5('0x9')](),controller[_0x08d5('0xa')]);router[_0x08d5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x08d5('0xb')]);router[_0x08d5('0xc')]('/',auth['isAuthenticated'](),controller[_0x08d5('0xd')]);router['put'](_0x08d5('0xe'),auth[_0x08d5('0x9')](),controller[_0x08d5('0xf')]);router[_0x08d5('0x10')](_0x08d5('0xe'),auth['isAuthenticated'](),controller[_0x08d5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index aaaf3b0..7e20e4f 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 _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x54da40,_0x4c4d2e){var _0x28a255=function(_0x4cc6d9){while(--_0x4cc6d9){_0x54da40['push'](_0x54da40['shift']());}};_0x28a255(++_0x4c4d2e);}(_0xe605,0x92));var _0x5e60=function(_0xe0e5c4,_0xbe22a5){_0xe0e5c4=_0xe0e5c4-0x0;var _0xd9191a=_0xe605[_0xe0e5c4];return _0xd9191a;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'),_0x5e60('0x5')),'defaultValue':_0x5e60('0x2')},'content':{'type':Sequelize[_0x5e60('0x6')]},'key':{'type':Sequelize[_0x5e60('0x6')]},'keyType':{'type':Sequelize[_0x5e60('0x7')](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'))},'keyContent':{'type':Sequelize[_0x5e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e60('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5b02=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','STRING','variable'];(function(_0x205388,_0x845d39){var _0x3a899c=function(_0x99be53){while(--_0x99be53){_0x205388['push'](_0x205388['shift']());}};_0x3a899c(++_0x845d39);}(_0x5b02,0xe9));var _0x25b0=function(_0x2998a4,_0xf39301){_0x2998a4=_0x2998a4-0x0;var _0x3d56dc=_0x5b02[_0x2998a4];return _0x3d56dc;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'type':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),'variable','customVariable',_0x25b0('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x25b0('0x5')]},'key':{'type':Sequelize[_0x25b0('0x5')]},'keyType':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3'),_0x25b0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x25b0('0x5')]},'idField':{'type':Sequelize[_0x25b0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 02e0248..39340ec 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 _0x5ed9=['create','body','params','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','map','VIRTUAL','field','merge','options','includeAll','include','findAll','catch','show','find'];(function(_0x1c5012,_0x3a5b84){var _0xe3c5b0=function(_0x14b378){while(--_0x14b378){_0x1c5012['push'](_0x1c5012['shift']());}};_0xe3c5b0(++_0x3a5b84);}(_0x5ed9,0x8b));var _0x95ed=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5ed9[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require(_0x95ed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x95ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ed('0x2'));var rp=require(_0x95ed('0x3'));var moment=require('moment');var BPromise=require(_0x95ed('0x4'));var Mustache=require(_0x95ed('0x5'));var util=require(_0x95ed('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x95ed('0x7'));var ejs=require(_0x95ed('0x8'));var fs=require('fs');var _=require(_0x95ed('0x9'));var squel=require(_0x95ed('0xa'));var crypto=require(_0x95ed('0xb'));var jsforce=require(_0x95ed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x95ed('0x7'));var querystring=require(_0x95ed('0xd'));var Papa=require(_0x95ed('0xe'));var Redis=require(_0x95ed('0xf'));var authService=require(_0x95ed('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x95ed('0x11'));var logger=require(_0x95ed('0x12'))(_0x95ed('0x13'));var utils=require(_0x95ed('0x14'));var config=require('../../config/environment');var db=require(_0x95ed('0x15'))['db'];function respondWithStatusCode(_0x430ad9,_0x134945){_0x134945=_0x134945||0xcc;return function(_0x1b18a4){if(_0x1b18a4){return _0x430ad9[_0x95ed('0x16')](_0x134945);}return _0x430ad9[_0x95ed('0x17')](_0x134945)['end']();};}function respondWithResult(_0x19476f,_0x82b14c){_0x82b14c=_0x82b14c||0xc8;return function(_0x20c459){if(_0x20c459){return _0x19476f[_0x95ed('0x17')](_0x82b14c)[_0x95ed('0x18')](_0x20c459);}};}function respondWithFilteredResult(_0x47bc8b,_0x54da6f){return function(_0x3603b5){if(_0x3603b5){var _0x3f4f30=_0x3603b5[_0x95ed('0x19')],_0xe83be5=_0x54da6f['offset'],_0x454922=_0x54da6f[_0x95ed('0x1a')]+_0x54da6f['limit'],_0x2cc725;if(_0x454922>=_0x3f4f30){_0x454922=_0x3f4f30;_0x2cc725=0xc8;}else{_0x2cc725=0xce;}_0x47bc8b['status'](_0x2cc725);return _0x47bc8b['set'](_0x95ed('0x1b'),_0xe83be5+'-'+_0x454922+'/'+_0x3f4f30)['json'](_0x3603b5);}return null;};}function patchUpdates(_0x49cb65){return function(_0x5cb6f5){try{jsonpatch[_0x95ed('0x1c')](_0x5cb6f5,_0x49cb65,!![]);}catch(_0x389973){return BPromise[_0x95ed('0x1d')](_0x389973);}return _0x5cb6f5['save']();};}function saveUpdates(_0x7c7086,_0x57d5de){return function(_0x13a1bc){if(_0x13a1bc){return _0x13a1bc[_0x95ed('0x1e')](_0x7c7086)[_0x95ed('0x1f')](function(_0x34e244){return _0x34e244;});}return null;};}function removeEntity(_0x461a6f,_0x3a0cd8){return function(_0x328baf){if(_0x328baf){return _0x328baf[_0x95ed('0x20')]()['then'](function(){_0x461a6f[_0x95ed('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43fb1e,_0x5c3adf){return function(_0x7da401){if(!_0x7da401){_0x43fb1e['sendStatus'](0x194);}return _0x7da401;};}function handleError(_0x3886ee,_0x16b130){_0x16b130=_0x16b130||0x1f4;return function(_0x440d45){logger[_0x95ed('0x21')](_0x440d45[_0x95ed('0x22')]);if(_0x440d45[_0x95ed('0x23')]){delete _0x440d45[_0x95ed('0x23')];}_0x3886ee[_0x95ed('0x17')](_0x16b130)[_0x95ed('0x24')](_0x440d45);};}exports[_0x95ed('0x25')]=function(_0x34be45,_0x2cb4f3){var _0x3927ec={},_0x3de0e8={},_0x49c35b={'count':0x0,'rows':[]};var _0x367169=db[_0x95ed('0x26')][_0x95ed('0x27')];_0x3de0e8[_0x95ed('0x28')]=_[_0x95ed('0x29')](_0x367169);_0x3de0e8[_0x95ed('0x2a')]=_[_0x95ed('0x29')](_0x34be45['query']);_0x3de0e8[_0x95ed('0x2b')]=_[_0x95ed('0x2c')](_0x3de0e8[_0x95ed('0x28')],_0x3de0e8['query']);_0x3927ec['attributes']=_[_0x95ed('0x2c')](_0x3de0e8[_0x95ed('0x28')],qs['fields'](_0x34be45[_0x95ed('0x2a')]['fields']));_0x3927ec[_0x95ed('0x2d')]=_0x3927ec[_0x95ed('0x2d')][_0x95ed('0x2e')]?_0x3927ec[_0x95ed('0x2d')]:_0x3de0e8[_0x95ed('0x28')];if(!_0x34be45[_0x95ed('0x2a')][_0x95ed('0x2f')]('nolimit')){_0x3927ec[_0x95ed('0x30')]=qs['limit'](_0x34be45[_0x95ed('0x2a')][_0x95ed('0x30')]);_0x3927ec['offset']=qs[_0x95ed('0x1a')](_0x34be45[_0x95ed('0x2a')][_0x95ed('0x1a')]);}_0x3927ec[_0x95ed('0x31')]=qs[_0x95ed('0x32')](_0x34be45['query'][_0x95ed('0x32')]);_0x3927ec[_0x95ed('0x33')]=qs[_0x95ed('0x2b')](_[_0x95ed('0x34')](_0x34be45[_0x95ed('0x2a')],_0x3de0e8['filters']));if(_0x34be45[_0x95ed('0x2a')][_0x95ed('0x35')]){_0x3927ec['where']=_['merge'](_0x3927ec[_0x95ed('0x33')],{'$or':_[_0x95ed('0x36')](_0x367169,function(_0x308275){if(_0x308275['type']['key']!==_0x95ed('0x37')){var _0x569866={};_0x569866[_0x308275[_0x95ed('0x38')]]={'$like':'%'+_0x34be45['query'][_0x95ed('0x35')]+'%'};return _0x569866;}})});}_0x3927ec=_[_0x95ed('0x39')]({},_0x3927ec,_0x34be45[_0x95ed('0x3a')]);var _0x3274e2={'where':_0x3927ec[_0x95ed('0x33')]};return db['SugarcrmField'][_0x95ed('0x19')](_0x3274e2)[_0x95ed('0x1f')](function(_0x5a5d18){_0x49c35b[_0x95ed('0x19')]=_0x5a5d18;if(_0x34be45[_0x95ed('0x2a')][_0x95ed('0x3b')]){_0x3927ec[_0x95ed('0x3c')]=[{'all':!![]}];}return db['SugarcrmField'][_0x95ed('0x3d')](_0x3927ec);})['then'](function(_0x3850cc){_0x49c35b['rows']=_0x3850cc;return _0x49c35b;})[_0x95ed('0x1f')](respondWithFilteredResult(_0x2cb4f3,_0x3927ec))[_0x95ed('0x3e')](handleError(_0x2cb4f3,null));};exports[_0x95ed('0x3f')]=function(_0x4505c3,_0x35f0b5){var _0x4a375a={'raw':!![],'where':{'id':_0x4505c3['params']['id']}},_0x2fb7cc={};_0x2fb7cc[_0x95ed('0x28')]=_[_0x95ed('0x29')](db[_0x95ed('0x26')][_0x95ed('0x27')]);_0x2fb7cc['query']=_[_0x95ed('0x29')](_0x4505c3[_0x95ed('0x2a')]);_0x2fb7cc[_0x95ed('0x2b')]=_[_0x95ed('0x2c')](_0x2fb7cc[_0x95ed('0x28')],_0x2fb7cc[_0x95ed('0x2a')]);_0x4a375a[_0x95ed('0x2d')]=_['intersection'](_0x2fb7cc['model'],qs['fields'](_0x4505c3[_0x95ed('0x2a')]['fields']));_0x4a375a['attributes']=_0x4a375a[_0x95ed('0x2d')]['length']?_0x4a375a[_0x95ed('0x2d')]:_0x2fb7cc[_0x95ed('0x28')];if(_0x4505c3[_0x95ed('0x2a')][_0x95ed('0x3b')]){_0x4a375a[_0x95ed('0x3c')]=[{'all':!![]}];}_0x4a375a=_['merge']({},_0x4a375a,_0x4505c3[_0x95ed('0x3a')]);return db['SugarcrmField'][_0x95ed('0x40')](_0x4a375a)[_0x95ed('0x1f')](handleEntityNotFound(_0x35f0b5,null))[_0x95ed('0x1f')](respondWithResult(_0x35f0b5,null))['catch'](handleError(_0x35f0b5,null));};exports[_0x95ed('0x41')]=function(_0x1326c2,_0x531704){return db[_0x95ed('0x26')]['create'](_0x1326c2[_0x95ed('0x42')],{})['then'](respondWithResult(_0x531704,0xc9))[_0x95ed('0x3e')](handleError(_0x531704,null));};exports[_0x95ed('0x1e')]=function(_0x43ba73,_0x66aab7){if(_0x43ba73[_0x95ed('0x42')]['id']){delete _0x43ba73[_0x95ed('0x42')]['id'];}return db[_0x95ed('0x26')][_0x95ed('0x40')]({'where':{'id':_0x43ba73['params']['id']}})['then'](handleEntityNotFound(_0x66aab7,null))['then'](saveUpdates(_0x43ba73[_0x95ed('0x42')],null))[_0x95ed('0x1f')](respondWithResult(_0x66aab7,null))['catch'](handleError(_0x66aab7,null));};exports['destroy']=function(_0x44f0ed,_0x51f9bb){return db[_0x95ed('0x26')][_0x95ed('0x40')]({'where':{'id':_0x44f0ed[_0x95ed('0x43')]['id']}})[_0x95ed('0x1f')](handleEntityNotFound(_0x51f9bb,null))['then'](removeEntity(_0x51f9bb,null))['catch'](handleError(_0x51f9bb,null));}; \ No newline at end of file +var _0x3421=['create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','SugarcrmField','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','filters','length','find'];(function(_0x13478c,_0x3133f0){var _0x23be57=function(_0x4e081b){while(--_0x4e081b){_0x13478c['push'](_0x13478c['shift']());}};_0x23be57(++_0x3133f0);}(_0x3421,0x116));var _0x1342=function(_0x1ae1df,_0x13086e){_0x1ae1df=_0x1ae1df-0x0;var _0x38562b=_0x3421[_0x1ae1df];return _0x38562b;};'use strict';var pdf=require(_0x1342('0x0'));var emlformat=require(_0x1342('0x1'));var rimraf=require(_0x1342('0x2'));var zipdir=require(_0x1342('0x3'));var jsonpatch=require(_0x1342('0x4'));var rp=require(_0x1342('0x5'));var moment=require(_0x1342('0x6'));var BPromise=require(_0x1342('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1342('0x8'));var sox=require('sox');var csv=require(_0x1342('0x9'));var ejs=require(_0x1342('0xa'));var fs=require('fs');var _=require(_0x1342('0xb'));var squel=require(_0x1342('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1342('0xd'));var toCsv=require(_0x1342('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1342('0xe'));var qs=require(_0x1342('0xf'));var hardwareService=require(_0x1342('0x10'));var logger=require('../../config/logger')(_0x1342('0x11'));var utils=require(_0x1342('0x12'));var config=require(_0x1342('0x13'));var db=require(_0x1342('0x14'))['db'];function respondWithStatusCode(_0x374193,_0x5f21ac){_0x5f21ac=_0x5f21ac||0xcc;return function(_0x340dfb){if(_0x340dfb){return _0x374193[_0x1342('0x15')](_0x5f21ac);}return _0x374193[_0x1342('0x16')](_0x5f21ac)[_0x1342('0x17')]();};}function respondWithResult(_0x2a465a,_0x1a81c3){_0x1a81c3=_0x1a81c3||0xc8;return function(_0x2ae245){if(_0x2ae245){return _0x2a465a[_0x1342('0x16')](_0x1a81c3)[_0x1342('0x18')](_0x2ae245);}};}function respondWithFilteredResult(_0x2261b7,_0x4eca27){return function(_0x45b322){if(_0x45b322){var _0x565ad1=_0x45b322['count'],_0x327b9b=_0x4eca27[_0x1342('0x19')],_0x26a2b9=_0x4eca27[_0x1342('0x19')]+_0x4eca27[_0x1342('0x1a')],_0x1c0460;if(_0x26a2b9>=_0x565ad1){_0x26a2b9=_0x565ad1;_0x1c0460=0xc8;}else{_0x1c0460=0xce;}_0x2261b7[_0x1342('0x16')](_0x1c0460);return _0x2261b7['set'](_0x1342('0x1b'),_0x327b9b+'-'+_0x26a2b9+'/'+_0x565ad1)[_0x1342('0x18')](_0x45b322);}return null;};}function patchUpdates(_0x219363){return function(_0x1fdecb){try{jsonpatch[_0x1342('0x1c')](_0x1fdecb,_0x219363,!![]);}catch(_0x1bfda5){return BPromise[_0x1342('0x1d')](_0x1bfda5);}return _0x1fdecb[_0x1342('0x1e')]();};}function saveUpdates(_0x2795eb,_0x17ae21){return function(_0x2ee664){if(_0x2ee664){return _0x2ee664[_0x1342('0x1f')](_0x2795eb)[_0x1342('0x20')](function(_0x4e620b){return _0x4e620b;});}return null;};}function removeEntity(_0x6c5793,_0x585565){return function(_0x57964b){if(_0x57964b){return _0x57964b[_0x1342('0x21')]()[_0x1342('0x20')](function(){_0x6c5793[_0x1342('0x16')](0xcc)[_0x1342('0x17')]();});}};}function handleEntityNotFound(_0x4be971,_0x1436e1){return function(_0x2f86ad){if(!_0x2f86ad){_0x4be971['sendStatus'](0x194);}return _0x2f86ad;};}function handleError(_0x5d559b,_0x39a1ed){_0x39a1ed=_0x39a1ed||0x1f4;return function(_0x3189a8){logger[_0x1342('0x22')](_0x3189a8['stack']);if(_0x3189a8[_0x1342('0x23')]){delete _0x3189a8['name'];}_0x5d559b['status'](_0x39a1ed)['send'](_0x3189a8);};}exports[_0x1342('0x24')]=function(_0x55b939,_0x3b2509){var _0x4b82d={},_0x2dc1df={},_0x4aaca0={'count':0x0,'rows':[]};var _0x38c6a7=db[_0x1342('0x25')][_0x1342('0x26')];_0x2dc1df[_0x1342('0x27')]=_[_0x1342('0x28')](_0x38c6a7);_0x2dc1df[_0x1342('0x29')]=_[_0x1342('0x28')](_0x55b939[_0x1342('0x29')]);_0x2dc1df['filters']=_[_0x1342('0x2a')](_0x2dc1df[_0x1342('0x27')],_0x2dc1df[_0x1342('0x29')]);_0x4b82d[_0x1342('0x2b')]=_[_0x1342('0x2a')](_0x2dc1df[_0x1342('0x27')],qs[_0x1342('0x2c')](_0x55b939[_0x1342('0x29')]['fields']));_0x4b82d[_0x1342('0x2b')]=_0x4b82d['attributes']['length']?_0x4b82d['attributes']:_0x2dc1df[_0x1342('0x27')];if(!_0x55b939[_0x1342('0x29')][_0x1342('0x2d')](_0x1342('0x2e'))){_0x4b82d[_0x1342('0x1a')]=qs[_0x1342('0x1a')](_0x55b939['query'][_0x1342('0x1a')]);_0x4b82d['offset']=qs[_0x1342('0x19')](_0x55b939['query'][_0x1342('0x19')]);}_0x4b82d[_0x1342('0x2f')]=qs[_0x1342('0x30')](_0x55b939[_0x1342('0x29')][_0x1342('0x30')]);_0x4b82d[_0x1342('0x31')]=qs['filters'](_[_0x1342('0x32')](_0x55b939[_0x1342('0x29')],_0x2dc1df['filters']));if(_0x55b939[_0x1342('0x29')][_0x1342('0x33')]){_0x4b82d[_0x1342('0x31')]=_[_0x1342('0x34')](_0x4b82d[_0x1342('0x31')],{'$or':_[_0x1342('0x35')](_0x38c6a7,function(_0x3357d1){if(_0x3357d1['type'][_0x1342('0x36')]!==_0x1342('0x37')){var _0x1ab3b0={};_0x1ab3b0[_0x3357d1[_0x1342('0x38')]]={'$like':'%'+_0x55b939[_0x1342('0x29')][_0x1342('0x33')]+'%'};return _0x1ab3b0;}})});}_0x4b82d=_['merge']({},_0x4b82d,_0x55b939[_0x1342('0x39')]);var _0x451434={'where':_0x4b82d[_0x1342('0x31')]};return db[_0x1342('0x25')][_0x1342('0x3a')](_0x451434)[_0x1342('0x20')](function(_0x28497a){_0x4aaca0[_0x1342('0x3a')]=_0x28497a;if(_0x55b939['query'][_0x1342('0x3b')]){_0x4b82d[_0x1342('0x3c')]=[{'all':!![]}];}return db[_0x1342('0x25')]['findAll'](_0x4b82d);})[_0x1342('0x20')](function(_0x188dab){_0x4aaca0[_0x1342('0x3d')]=_0x188dab;return _0x4aaca0;})[_0x1342('0x20')](respondWithFilteredResult(_0x3b2509,_0x4b82d))[_0x1342('0x3e')](handleError(_0x3b2509,null));};exports[_0x1342('0x3f')]=function(_0x580600,_0x321cc0){var _0x12260a={'raw':!![],'where':{'id':_0x580600['params']['id']}},_0x5f5541={};_0x5f5541['model']=_[_0x1342('0x28')](db[_0x1342('0x25')][_0x1342('0x26')]);_0x5f5541[_0x1342('0x29')]=_[_0x1342('0x28')](_0x580600[_0x1342('0x29')]);_0x5f5541[_0x1342('0x40')]=_[_0x1342('0x2a')](_0x5f5541[_0x1342('0x27')],_0x5f5541[_0x1342('0x29')]);_0x12260a[_0x1342('0x2b')]=_['intersection'](_0x5f5541[_0x1342('0x27')],qs[_0x1342('0x2c')](_0x580600[_0x1342('0x29')]['fields']));_0x12260a['attributes']=_0x12260a[_0x1342('0x2b')][_0x1342('0x41')]?_0x12260a[_0x1342('0x2b')]:_0x5f5541['model'];if(_0x580600[_0x1342('0x29')][_0x1342('0x3b')]){_0x12260a[_0x1342('0x3c')]=[{'all':!![]}];}_0x12260a=_[_0x1342('0x34')]({},_0x12260a,_0x580600[_0x1342('0x39')]);return db['SugarcrmField'][_0x1342('0x42')](_0x12260a)['then'](handleEntityNotFound(_0x321cc0,null))[_0x1342('0x20')](respondWithResult(_0x321cc0,null))[_0x1342('0x3e')](handleError(_0x321cc0,null));};exports[_0x1342('0x43')]=function(_0x20e39,_0x530869){return db[_0x1342('0x25')][_0x1342('0x43')](_0x20e39['body'],{})[_0x1342('0x20')](respondWithResult(_0x530869,0xc9))[_0x1342('0x3e')](handleError(_0x530869,null));};exports[_0x1342('0x1f')]=function(_0x1d1d25,_0x54079f){if(_0x1d1d25[_0x1342('0x44')]['id']){delete _0x1d1d25[_0x1342('0x44')]['id'];}return db[_0x1342('0x25')][_0x1342('0x42')]({'where':{'id':_0x1d1d25['params']['id']}})[_0x1342('0x20')](handleEntityNotFound(_0x54079f,null))[_0x1342('0x20')](saveUpdates(_0x1d1d25[_0x1342('0x44')],null))[_0x1342('0x20')](respondWithResult(_0x54079f,null))['catch'](handleError(_0x54079f,null));};exports[_0x1342('0x21')]=function(_0x59ffc8,_0x12a451){return db['SugarcrmField'][_0x1342('0x42')]({'where':{'id':_0x59ffc8['params']['id']}})[_0x1342('0x20')](handleEntityNotFound(_0x12a451,null))[_0x1342('0x20')](removeEntity(_0x12a451,null))[_0x1342('0x3e')](handleError(_0x12a451,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 01d2297..0046b1c 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 _0xf2fb=['../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xf2fb,0x107));var _0xbf2f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2fb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xbf2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbf2f('0x1'));var moment=require(_0xbf2f('0x2'));var BPromise=require(_0xbf2f('0x3'));var rp=require(_0xbf2f('0x4'));var fs=require('fs');var path=require(_0xbf2f('0x5'));var rimraf=require(_0xbf2f('0x6'));var config=require(_0xbf2f('0x7'));var attributes=require(_0xbf2f('0x8'));module[_0xbf2f('0x9')]=function(_0x58d228,_0x156a9d){return _0x58d228[_0xbf2f('0xa')]('SugarcrmField',attributes,{'tableName':_0xbf2f('0xb'),'paranoid':![],'indexes':[{'name':_0xbf2f('0xc'),'fields':[_0xbf2f('0xd'),_0xbf2f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5aaa=['exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x54d8d7,_0x446e6f){var _0x150af6=function(_0x1a151e){while(--_0x1a151e){_0x54d8d7['push'](_0x54d8d7['shift']());}};_0x150af6(++_0x446e6f);}(_0x5aaa,0x1af));var _0xa5aa=function(_0x5c9870,_0x10017d){_0x5c9870=_0x5c9870-0x0;var _0x3bb767=_0x5aaa[_0x5c9870];return _0x3bb767;};'use strict';var _=require(_0xa5aa('0x0'));var util=require(_0xa5aa('0x1'));var logger=require(_0xa5aa('0x2'))(_0xa5aa('0x3'));var moment=require(_0xa5aa('0x4'));var BPromise=require(_0xa5aa('0x5'));var rp=require(_0xa5aa('0x6'));var fs=require('fs');var path=require(_0xa5aa('0x7'));var rimraf=require(_0xa5aa('0x8'));var config=require(_0xa5aa('0x9'));var attributes=require(_0xa5aa('0xa'));module[_0xa5aa('0xb')]=function(_0x230c5d,_0x4d0b0c){return _0x230c5d[_0xa5aa('0xc')]('SugarcrmField',attributes,{'tableName':_0xa5aa('0xd'),'paranoid':![],'indexes':[{'name':_0xa5aa('0xe'),'fields':[_0xa5aa('0xf'),_0xa5aa('0x10')],'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 81d4620..8c49b67 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 _0x60f7=['client','http','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ce683,_0x5c728b){var _0x13f17f=function(_0x59104b){while(--_0x59104b){_0x3ce683['push'](_0x3ce683['shift']());}};_0x13f17f(++_0x5c728b);}(_0x60f7,0xf2));var _0x760f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x60f7[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x760f('0x0'));var util=require(_0x760f('0x1'));var moment=require(_0x760f('0x2'));var BPromise=require(_0x760f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x760f('0x4'));var db=require(_0x760f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x760f('0x6'))(_0x760f('0x7'));var config=require(_0x760f('0x8'));var jayson=require(_0x760f('0x9'));var client=jayson[_0x760f('0xa')][_0x760f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40654a,_0x5b8cf0,_0x4d36aa){return new BPromise(function(_0x3d02c8,_0x46b468){return client['request'](_0x40654a,_0x4d36aa)[_0x760f('0xc')](function(_0x2eb5ed){logger[_0x760f('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x5b8cf0,_0x760f('0xe'));logger[_0x760f('0xf')](_0x760f('0x10'),_0x5b8cf0,_0x760f('0xe'),JSON['stringify'](_0x2eb5ed));if(_0x2eb5ed['error']){if(_0x2eb5ed[_0x760f('0x11')]['code']===0x1f4){logger[_0x760f('0x11')](_0x760f('0x12'),_0x5b8cf0,_0x2eb5ed[_0x760f('0x11')][_0x760f('0x13')]);return _0x46b468(_0x2eb5ed[_0x760f('0x11')][_0x760f('0x13')]);}logger[_0x760f('0x11')](_0x760f('0x12'),_0x5b8cf0,_0x2eb5ed[_0x760f('0x11')][_0x760f('0x13')]);return _0x3d02c8(_0x2eb5ed[_0x760f('0x11')][_0x760f('0x13')]);}else{logger['info'](_0x760f('0x12'),_0x5b8cf0,_0x760f('0xe'));_0x3d02c8(_0x2eb5ed[_0x760f('0x14')][_0x760f('0x13')]);}})['catch'](function(_0x32a834){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5b8cf0,_0x32a834);_0x46b468(_0x32a834);});});} \ No newline at end of file +var _0x0efe=['then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0efe,0xfc));var _0xe0ef=function(_0x51917c,_0x33669c){_0x51917c=_0x51917c-0x0;var _0x2d48ad=_0x0efe[_0x51917c];return _0x2d48ad;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require(_0xe0ef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0ef('0x4'));var logger=require(_0xe0ef('0x5'))(_0xe0ef('0x6'));var config=require(_0xe0ef('0x7'));var jayson=require(_0xe0ef('0x8'));var client=jayson[_0xe0ef('0x9')][_0xe0ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a38e,_0xdf67ff,_0x420034){return new BPromise(function(_0x4578c3,_0x4669f2){return client[_0xe0ef('0xb')](_0x50a38e,_0x420034)[_0xe0ef('0xc')](function(_0x145b9f){logger[_0xe0ef('0xd')](_0xe0ef('0xe'),_0xdf67ff,_0xe0ef('0xf'));logger[_0xe0ef('0x10')](_0xe0ef('0x11'),_0xdf67ff,_0xe0ef('0xf'),JSON['stringify'](_0x145b9f));if(_0x145b9f[_0xe0ef('0x12')]){if(_0x145b9f[_0xe0ef('0x12')][_0xe0ef('0x13')]===0x1f4){logger[_0xe0ef('0x12')]('SugarcrmField,\x20%s,\x20%s',_0xdf67ff,_0x145b9f[_0xe0ef('0x12')]['message']);return _0x4669f2(_0x145b9f['error'][_0xe0ef('0x14')]);}logger[_0xe0ef('0x12')]('SugarcrmField,\x20%s,\x20%s',_0xdf67ff,_0x145b9f[_0xe0ef('0x12')]['message']);return _0x4578c3(_0x145b9f['error'][_0xe0ef('0x14')]);}else{logger[_0xe0ef('0xd')](_0xe0ef('0xe'),_0xdf67ff,_0xe0ef('0xf'));_0x4578c3(_0x145b9f[_0xe0ef('0x15')][_0xe0ef('0x14')]);}})['catch'](function(_0x3a213f){logger['error'](_0xe0ef('0xe'),_0xdf67ff,_0x3a213f);_0x4669f2(_0x3a213f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 64bb546..dc4dae9 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 _0x4c6e=['multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','/:id','show','get','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports'];(function(_0x39ebb0,_0x6c1e){var _0x55dca2=function(_0x355e40){while(--_0x355e40){_0x39ebb0['push'](_0x39ebb0['shift']());}};_0x55dca2(++_0x6c1e);}(_0x4c6e,0x1c8));var _0xe4c6=function(_0x3d7bfc,_0x45b4c2){_0x3d7bfc=_0x3d7bfc-0x0;var _0x509237=_0x4c6e[_0x3d7bfc];return _0x509237;};'use strict';var multer=require(_0xe4c6('0x0'));var util=require('util');var path=require(_0xe4c6('0x1'));var timeout=require(_0xe4c6('0x2'));var express=require('express');var router=express[_0xe4c6('0x3')]();var auth=require(_0xe4c6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe4c6('0x5'));var controller=require(_0xe4c6('0x6'));router['get']('/',auth[_0xe4c6('0x7')](),controller[_0xe4c6('0x8')]);router['get'](_0xe4c6('0x9'),auth[_0xe4c6('0x7')](),controller[_0xe4c6('0xa')]);router[_0xe4c6('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe4c6('0xc')]);router[_0xe4c6('0xb')](_0xe4c6('0xd'),auth[_0xe4c6('0x7')](),controller[_0xe4c6('0xe')]);router[_0xe4c6('0xf')]('/',auth['isAuthenticated'](),controller[_0xe4c6('0x10')]);router[_0xe4c6('0xf')](_0xe4c6('0x11'),auth['isAuthenticated'](),controller[_0xe4c6('0x12')]);router[_0xe4c6('0x13')](_0xe4c6('0x9'),auth[_0xe4c6('0x7')](),controller[_0xe4c6('0x14')]);router[_0xe4c6('0x15')](_0xe4c6('0x9'),auth['isAuthenticated'](),controller[_0xe4c6('0x16')]);module[_0xe4c6('0x17')]=router; \ No newline at end of file +var _0x6e42=['getFields','post','create','addConfiguration','put','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x5e7183,_0x231381){var _0x4d654e=function(_0x45be27){while(--_0x45be27){_0x5e7183['push'](_0x5e7183['shift']());}};_0x4d654e(++_0x231381);}(_0x6e42,0x11e));var _0x26e4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e42[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x26e4('0x0'));var util=require('util');var path=require(_0x26e4('0x1'));var timeout=require(_0x26e4('0x2'));var express=require(_0x26e4('0x3'));var router=express['Router']();var auth=require(_0x26e4('0x4'));var interaction=require(_0x26e4('0x5'));var config=require(_0x26e4('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x26e4('0x7')]('/',auth[_0x26e4('0x8')](),controller[_0x26e4('0x9')]);router[_0x26e4('0x7')](_0x26e4('0xa'),auth[_0x26e4('0x8')](),controller[_0x26e4('0xb')]);router[_0x26e4('0x7')](_0x26e4('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x26e4('0xd'),auth[_0x26e4('0x8')](),controller[_0x26e4('0xe')]);router[_0x26e4('0xf')]('/',auth[_0x26e4('0x8')](),controller[_0x26e4('0x10')]);router[_0x26e4('0xf')](_0x26e4('0xc'),auth[_0x26e4('0x8')](),controller[_0x26e4('0x11')]);router[_0x26e4('0x12')](_0x26e4('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x26e4('0xa'),auth[_0x26e4('0x8')](),controller['destroy']);module[_0x26e4('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e8e15f4..9fc0ac0 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 _0x1821=['STRING','exports'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x1821,0x69));var _0x1182=function(_0x58dc50,_0x3366e5){_0x58dc50=_0x58dc50-0x0;var _0x2d1a5a=_0x1821[_0x58dc50];return _0x2d1a5a;};'use strict';var Sequelize=require('sequelize');module[_0x1182('0x0')]={'name':{'type':Sequelize[_0x1182('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1182('0x1')]},'username':{'type':Sequelize[_0x1182('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1182('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x1182('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1182('0x1')]},'accessKey':{'type':Sequelize[_0x1182('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4835=['exports','STRING','HelpDesk','sequelize'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x4835,0x10f));var _0x5483=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x4835[_0x4cbf20];return _0x582ae4;};'use strict';var Sequelize=require(_0x5483('0x0'));module[_0x5483('0x1')]={'name':{'type':Sequelize[_0x5483('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5483('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5483('0x3')},'remoteUri':{'type':Sequelize[_0x5483('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5483('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 63abc65..404e0d8 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 _0x9f9e=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','client','http','test','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','index','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','VtigerAccount','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','send','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9f9e,0x183));var _0xe9f9=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x9f9e[_0x4ca333];return _0x13b2e1;};'use strict';var pdf=require(_0xe9f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe9f9('0x1'));var zipdir=require(_0xe9f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe9f9('0x3'));var BPromise=require(_0xe9f9('0x4'));var Mustache=require(_0xe9f9('0x5'));var util=require(_0xe9f9('0x6'));var path=require(_0xe9f9('0x7'));var sox=require(_0xe9f9('0x8'));var csv=require(_0xe9f9('0x9'));var ejs=require(_0xe9f9('0xa'));var fs=require('fs');var _=require(_0xe9f9('0xb'));var squel=require(_0xe9f9('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9f9('0xd'));var deskjs=require(_0xe9f9('0xe'));var toCsv=require(_0xe9f9('0x9'));var querystring=require(_0xe9f9('0xf'));var Papa=require(_0xe9f9('0x10'));var Redis=require(_0xe9f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9f9('0x13'));var utils=require(_0xe9f9('0x14'));var config=require(_0xe9f9('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xe9f9('0x16')][_0xe9f9('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5c25e9,_0x92800b,_0x7f9f0a){if(_0x7f9f0a){var _0x331685=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x331685[_0xe9f9('0x18')](_0x92800b)){return _0x5c25e9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5c25e9;}}function respondWithRpcPromise(_0x22b75e,_0x1a8fb3,_0x23d668,_0x8571bb){return new BPromise(function(_0x4989d6,_0x472308){var _0x33cf46=_0x8571bb||client;return _0x33cf46[_0xe9f9('0x19')](_0x22b75e,_0x23d668)[_0xe9f9('0x1a')](function(_0x21676a){logger[_0xe9f9('0x1b')](_0xe9f9('0x1c'),_0x1a8fb3,_0xe9f9('0x1d'));logger[_0xe9f9('0x1e')](_0xe9f9('0x1f'),_0x1a8fb3,_0xe9f9('0x1d'),JSON[_0xe9f9('0x20')](_0x21676a));if(_0x21676a['error']){if(_0x21676a[_0xe9f9('0x21')][_0xe9f9('0x22')]===0x1f4){logger[_0xe9f9('0x21')](_0xe9f9('0x1c'),_0x1a8fb3,_0x21676a[_0xe9f9('0x21')][_0xe9f9('0x23')]);return _0x472308(_0x21676a[_0xe9f9('0x21')][_0xe9f9('0x23')]);}logger['error'](_0xe9f9('0x1c'),_0x1a8fb3,_0x21676a[_0xe9f9('0x21')]['message']);return _0x4989d6(_0x21676a[_0xe9f9('0x21')]['message']);}else{logger['info'](_0xe9f9('0x1c'),_0x1a8fb3,'request\x20sent');_0x4989d6(_0x21676a['result'][_0xe9f9('0x23')]);}})[_0xe9f9('0x24')](function(_0x103d3a){logger['error'](_0xe9f9('0x1c'),_0x1a8fb3,_0x103d3a);_0x472308(_0x103d3a);});});}function respondWithStatusCode(_0x5ecddf,_0x10efb5){_0x10efb5=_0x10efb5||0xcc;return function(_0x2bb8df){if(_0x2bb8df){return _0x5ecddf[_0xe9f9('0x25')](_0x10efb5);}return _0x5ecddf[_0xe9f9('0x26')](_0x10efb5)[_0xe9f9('0x27')]();};}function respondWithResult(_0x2e1cac,_0xe5e471){_0xe5e471=_0xe5e471||0xc8;return function(_0x4726fe){if(_0x4726fe){return _0x2e1cac[_0xe9f9('0x26')](_0xe5e471)['json'](_0x4726fe);}};}function respondWithFilteredResult(_0x584a7c,_0x5bd4e4){return function(_0x226683){if(_0x226683){var _0x4de2a0=_0x226683[_0xe9f9('0x28')],_0x2b7619=_0x5bd4e4[_0xe9f9('0x29')],_0x284579=_0x5bd4e4[_0xe9f9('0x29')]+_0x5bd4e4['limit'],_0x3776ad;if(_0x284579>=_0x4de2a0){_0x284579=_0x4de2a0;_0x3776ad=0xc8;}else{_0x3776ad=0xce;}_0x584a7c[_0xe9f9('0x26')](_0x3776ad);return _0x584a7c[_0xe9f9('0x2a')](_0xe9f9('0x2b'),_0x2b7619+'-'+_0x284579+'/'+_0x4de2a0)[_0xe9f9('0x2c')](_0x226683);}return null;};}function patchUpdates(_0x31ac55){return function(_0x2bc298){try{jsonpatch[_0xe9f9('0x2d')](_0x2bc298,_0x31ac55,!![]);}catch(_0x292091){return BPromise[_0xe9f9('0x2e')](_0x292091);}return _0x2bc298[_0xe9f9('0x2f')]();};}function saveUpdates(_0x2811a4,_0x15212e){return function(_0x3f1aa1){if(_0x3f1aa1){return _0x3f1aa1[_0xe9f9('0x30')](_0x2811a4)[_0xe9f9('0x1a')](function(_0x28321d){return _0x28321d;});}return null;};}function removeEntity(_0x55b53e,_0x3d06ba){return function(_0x4c0e56){if(_0x4c0e56){return _0x4c0e56[_0xe9f9('0x31')]()[_0xe9f9('0x1a')](function(){_0x55b53e['status'](0xcc)[_0xe9f9('0x27')]();});}};}function handleEntityNotFound(_0x23b458,_0x10102a){return function(_0x39a5ee){if(!_0x39a5ee){_0x23b458[_0xe9f9('0x25')](0x194);}return _0x39a5ee;};}function handleError(_0x25db9e,_0x338a00){_0x338a00=_0x338a00||0x1f4;return function(_0x5660a8){logger[_0xe9f9('0x21')](_0x5660a8[_0xe9f9('0x32')]);if(_0x5660a8[_0xe9f9('0x33')]){delete _0x5660a8[_0xe9f9('0x33')];}_0x25db9e[_0xe9f9('0x26')](_0x338a00)['send'](_0x5660a8);};}exports[_0xe9f9('0x34')]=function(_0x314450,_0x4caaf3){var _0x1a5603={},_0x29ab80={},_0x5ac779={'count':0x0,'rows':[]};var _0x4063db=db['VtigerAccount'][_0xe9f9('0x35')];_0x29ab80['model']=_[_0xe9f9('0x36')](_0x4063db);_0x29ab80[_0xe9f9('0x37')]=_[_0xe9f9('0x36')](_0x314450[_0xe9f9('0x37')]);_0x29ab80[_0xe9f9('0x38')]=_['intersection'](_0x29ab80[_0xe9f9('0x39')],_0x29ab80['query']);_0x1a5603[_0xe9f9('0x3a')]=_[_0xe9f9('0x3b')](_0x29ab80[_0xe9f9('0x39')],qs[_0xe9f9('0x3c')](_0x314450['query']['fields']));_0x1a5603['attributes']=_0x1a5603[_0xe9f9('0x3a')][_0xe9f9('0x3d')]?_0x1a5603['attributes']:_0x29ab80[_0xe9f9('0x39')];if(!_0x314450['query'][_0xe9f9('0x3e')](_0xe9f9('0x3f'))){_0x1a5603[_0xe9f9('0x40')]=qs[_0xe9f9('0x40')](_0x314450['query'][_0xe9f9('0x40')]);_0x1a5603['offset']=qs[_0xe9f9('0x29')](_0x314450[_0xe9f9('0x37')]['offset']);}_0x1a5603['order']=qs[_0xe9f9('0x41')](_0x314450[_0xe9f9('0x37')]['sort']);_0x1a5603[_0xe9f9('0x42')]=qs[_0xe9f9('0x38')](_['pick'](_0x314450[_0xe9f9('0x37')],_0x29ab80['filters']));if(_0x314450['query'][_0xe9f9('0x43')]){_0x1a5603[_0xe9f9('0x42')]=_['merge'](_0x1a5603[_0xe9f9('0x42')],{'$or':_[_0xe9f9('0x44')](_0x4063db,function(_0x22cf2e){if(_0x22cf2e[_0xe9f9('0x45')][_0xe9f9('0x46')]!==_0xe9f9('0x47')){var _0xc6f881={};_0xc6f881[_0x22cf2e[_0xe9f9('0x48')]]={'$like':'%'+_0x314450[_0xe9f9('0x37')][_0xe9f9('0x43')]+'%'};return _0xc6f881;}})});}_0x1a5603=_[_0xe9f9('0x49')]({},_0x1a5603,_0x314450[_0xe9f9('0x4a')]);var _0x387513={'where':_0x1a5603[_0xe9f9('0x42')]};return db[_0xe9f9('0x4b')]['count'](_0x387513)[_0xe9f9('0x1a')](function(_0x4f74fc){_0x5ac779['count']=_0x4f74fc;if(_0x314450[_0xe9f9('0x37')][_0xe9f9('0x4c')]){_0x1a5603[_0xe9f9('0x4d')]=[{'all':!![]}];}return db[_0xe9f9('0x4b')][_0xe9f9('0x4e')](_0x1a5603);})['then'](function(_0xb829dc){_0x5ac779[_0xe9f9('0x4f')]=_0xb829dc;return _0x5ac779;})[_0xe9f9('0x1a')](respondWithFilteredResult(_0x4caaf3,_0x1a5603))[_0xe9f9('0x24')](handleError(_0x4caaf3,null));};exports[_0xe9f9('0x50')]=function(_0x574711,_0x1242d1){var _0x4596cb={'raw':![],'where':{'id':_0x574711[_0xe9f9('0x51')]['id']}},_0x366068={};_0x366068['model']=_[_0xe9f9('0x36')](db['VtigerAccount']['rawAttributes']);_0x366068[_0xe9f9('0x37')]=_[_0xe9f9('0x36')](_0x574711[_0xe9f9('0x37')]);_0x366068[_0xe9f9('0x38')]=_[_0xe9f9('0x3b')](_0x366068[_0xe9f9('0x39')],_0x366068[_0xe9f9('0x37')]);_0x4596cb[_0xe9f9('0x3a')]=_[_0xe9f9('0x3b')](_0x366068[_0xe9f9('0x39')],qs[_0xe9f9('0x3c')](_0x574711['query'][_0xe9f9('0x3c')]));_0x4596cb[_0xe9f9('0x3a')]=_0x4596cb[_0xe9f9('0x3a')][_0xe9f9('0x3d')]?_0x4596cb[_0xe9f9('0x3a')]:_0x366068[_0xe9f9('0x39')];if(_0x574711[_0xe9f9('0x37')][_0xe9f9('0x4c')]){_0x4596cb['include']=[{'all':!![]}];}_0x4596cb=_[_0xe9f9('0x49')]({},_0x4596cb,_0x574711[_0xe9f9('0x4a')]);return db[_0xe9f9('0x4b')][_0xe9f9('0x52')](_0x4596cb)[_0xe9f9('0x1a')](handleEntityNotFound(_0x1242d1,null))[_0xe9f9('0x1a')](respondWithResult(_0x1242d1,null))['catch'](handleError(_0x1242d1,null));};exports['create']=function(_0x4ad0ff,_0x3a746f){return db[_0xe9f9('0x4b')][_0xe9f9('0x53')](_0x4ad0ff[_0xe9f9('0x54')],{})[_0xe9f9('0x1a')](respondWithResult(_0x3a746f,0xc9))[_0xe9f9('0x24')](handleError(_0x3a746f,null));};exports['update']=function(_0x4da62e,_0x2d8a09){if(_0x4da62e[_0xe9f9('0x54')]['id']){delete _0x4da62e[_0xe9f9('0x54')]['id'];}return db[_0xe9f9('0x4b')]['find']({'where':{'id':_0x4da62e[_0xe9f9('0x51')]['id']}})[_0xe9f9('0x1a')](handleEntityNotFound(_0x2d8a09,null))['then'](saveUpdates(_0x4da62e[_0xe9f9('0x54')],null))['then'](respondWithResult(_0x2d8a09,null))[_0xe9f9('0x24')](handleError(_0x2d8a09,null));};exports[_0xe9f9('0x31')]=function(_0x4ca56f,_0x5b6341){return db[_0xe9f9('0x4b')]['find']({'where':{'id':_0x4ca56f['params']['id']}})[_0xe9f9('0x1a')](handleEntityNotFound(_0x5b6341,null))[_0xe9f9('0x1a')](removeEntity(_0x5b6341,null))[_0xe9f9('0x24')](handleError(_0x5b6341,null));};exports[_0xe9f9('0x55')]=function(_0x40e47f,_0x537376,_0x20c7fb){var _0x20291e={};var _0x218ea1={};var _0x2fbc19;var _0x5a2c81;return db[_0xe9f9('0x4b')]['findOne']({'where':{'id':_0x40e47f[_0xe9f9('0x51')]['id']}})[_0xe9f9('0x1a')](handleEntityNotFound(_0x537376,null))['then'](function(_0x2ff0f1){if(_0x2ff0f1){_0x2fbc19=_0x2ff0f1;_0x218ea1[_0xe9f9('0x39')]=_[_0xe9f9('0x36')](db['VtigerConfiguration'][_0xe9f9('0x35')]);_0x218ea1[_0xe9f9('0x37')]=_[_0xe9f9('0x36')](_0x40e47f[_0xe9f9('0x37')]);_0x218ea1[_0xe9f9('0x38')]=_['intersection'](_0x218ea1[_0xe9f9('0x39')],_0x218ea1[_0xe9f9('0x37')]);_0x20291e[_0xe9f9('0x3a')]=_[_0xe9f9('0x3b')](_0x218ea1['model'],qs[_0xe9f9('0x3c')](_0x40e47f['query'][_0xe9f9('0x3c')]));_0x20291e[_0xe9f9('0x3a')]=_0x20291e['attributes'][_0xe9f9('0x3d')]?_0x20291e[_0xe9f9('0x3a')]:_0x218ea1[_0xe9f9('0x39')];_0x20291e[_0xe9f9('0x56')]=qs[_0xe9f9('0x41')](_0x40e47f['query'][_0xe9f9('0x41')]);_0x20291e[_0xe9f9('0x42')]=qs['filters'](_['pick'](_0x40e47f[_0xe9f9('0x37')],_0x218ea1[_0xe9f9('0x38')]));if(_0x40e47f[_0xe9f9('0x37')][_0xe9f9('0x43')]){_0x20291e['where']=_[_0xe9f9('0x49')](_0x20291e[_0xe9f9('0x42')],{'$or':_['map'](_0x20291e[_0xe9f9('0x3a')],function(_0x34afae){var _0x4ec500={};_0x4ec500[_0x34afae]={'$like':'%'+_0x40e47f[_0xe9f9('0x37')][_0xe9f9('0x43')]+'%'};return _0x4ec500;})});}_0x20291e=_['merge']({},_0x20291e,_0x40e47f[_0xe9f9('0x4a')]);return _0x2fbc19[_0xe9f9('0x55')](_0x20291e);}})[_0xe9f9('0x1a')](function(_0x480d34){if(_0x480d34){_0x5a2c81=_0x480d34[_0xe9f9('0x3d')];if(!_0x40e47f['query']['hasOwnProperty'](_0xe9f9('0x3f'))){_0x20291e[_0xe9f9('0x40')]=qs[_0xe9f9('0x40')](_0x40e47f['query']['limit']);_0x20291e['offset']=qs[_0xe9f9('0x29')](_0x40e47f[_0xe9f9('0x37')][_0xe9f9('0x29')]);}return _0x2fbc19[_0xe9f9('0x55')](_0x20291e);}})[_0xe9f9('0x1a')](function(_0x355109){if(_0x355109){return _0x355109?{'count':_0x5a2c81,'rows':_0x355109}:null;}})[_0xe9f9('0x1a')](respondWithResult(_0x537376,null))[_0xe9f9('0x24')](handleError(_0x537376,null));};exports[_0xe9f9('0x57')]=function(_0x39fec3,_0x221dd1,_0x1c1abc){if(_0x39fec3[_0xe9f9('0x54')]['id']){delete _0x39fec3['body']['id'];}return db[_0xe9f9('0x4b')][_0xe9f9('0x58')]({'where':{'id':_0x39fec3[_0xe9f9('0x51')]['id']}})[_0xe9f9('0x1a')](handleEntityNotFound(_0x221dd1,null))['then'](function(_0x261fdf){if(_0x261fdf){_0x39fec3[_0xe9f9('0x54')][_0xe9f9('0x59')]=_0x261fdf['id'];_0x39fec3[_0xe9f9('0x54')][_0xe9f9('0x5a')]=integrations[_0xe9f9('0x5b')](_0x39fec3['body'][_0xe9f9('0x5c')],_0x39fec3[_0xe9f9('0x54')][_0xe9f9('0x45')]);_0x39fec3['body'][_0xe9f9('0x5d')]=integrations[_0xe9f9('0x5e')](_0x39fec3[_0xe9f9('0x54')]['channel'],_0x39fec3['body']['type']);return db[_0xe9f9('0x5f')][_0xe9f9('0x53')](_0x39fec3[_0xe9f9('0x54')],{'include':[{'model':db['VtigerField'],'as':_0xe9f9('0x5a')},{'model':db[_0xe9f9('0x60')],'as':_0xe9f9('0x5d')}]});}return null;})[_0xe9f9('0x1a')](respondWithResult(_0x221dd1,null))[_0xe9f9('0x24')](handleError(_0x221dd1,null));};var md5=require(_0xe9f9('0x61'));exports[_0xe9f9('0x62')]=function(_0x441c9b,_0x4206c1,_0x98c59){var _0x167b11=null;var _0x28b563=null;var _0x34ffe9=null;var _0x3e2a54=null;var _0x31d9c0='';return db[_0xe9f9('0x4b')][_0xe9f9('0x58')]({'where':{'id':_0x441c9b[_0xe9f9('0x51')]['id']},'attributes':['id',_0xe9f9('0x33'),_0xe9f9('0x63'),_0xe9f9('0x64'),_0xe9f9('0x65'),_0xe9f9('0x66'),_0xe9f9('0x67'),_0xe9f9('0x68')]})[_0xe9f9('0x1a')](handleEntityNotFound(_0x4206c1,null))['then'](function(_0x587350){if(_0x587350){_0x167b11=_0x587350[_0xe9f9('0x63')];_0x28b563=_0x587350[_0xe9f9('0x68')];_0x34ffe9=_0x587350[_0xe9f9('0x65')];_0x31d9c0=_0x587350[_0xe9f9('0x66')];var _0x194047=_0x31d9c0[_0xe9f9('0x69')](-0x1);if(_0x194047==='/'){_0x31d9c0=_0x31d9c0[_0xe9f9('0x6a')](0x0,_0x31d9c0[_0xe9f9('0x6b')](_0x194047));}_0x3e2a54=util[_0xe9f9('0x6c')](_0xe9f9('0x6d'),_0x31d9c0);var _0x1487a8={'method':_0xe9f9('0x6e'),'uri':_0x3e2a54,'qs':{'operation':_0xe9f9('0x6f'),'username':_0x587350[_0xe9f9('0x63')]},'json':!![]};return rp(_0x1487a8);}})[_0xe9f9('0x1a')](function(_0x59e8a4){if(_0x59e8a4[_0xe9f9('0x70')]){var _0x1c8f13={'method':_0xe9f9('0x71'),'uri':_0x3e2a54,'form':{'operation':_0xe9f9('0x72'),'username':_0x167b11,'accessKey':md5(_0x59e8a4[_0xe9f9('0x73')][_0xe9f9('0x74')]+_0x28b563)},'json':!![]};return rp(_0x1c8f13);}})[_0xe9f9('0x1a')](function(_0x196a70){if(_0x196a70['success']){var _0x4294f4={'method':'GET','uri':_0x3e2a54,'qs':{'operation':_0xe9f9('0x75'),'username':_0x167b11,'sessionName':_0x196a70[_0xe9f9('0x73')]['sessionName'],'elementType':_0x34ffe9},'json':!![]};return rp(_0x4294f4);}})[_0xe9f9('0x1a')](function(_0x103687){if(_0x103687['success']){var _0x3bb641=['autogenerated',_0xe9f9('0x76'),_0xe9f9('0x77')];_[_0xe9f9('0x78')](_0x103687[_0xe9f9('0x73')][_0xe9f9('0x3c')],function(_0x413f31){return _0x3bb641[_0xe9f9('0x79')](_0x413f31[_0xe9f9('0x45')]['name']);});_['remove'](_0x103687[_0xe9f9('0x73')][_0xe9f9('0x3c')],function(_0x265439){return _0x265439['editable']===_0xe9f9('0x7a');});return{'count':_0x103687['result']['fields']['length'],'rows':_[_0xe9f9('0x44')](_0x103687[_0xe9f9('0x73')][_0xe9f9('0x3c')],function(_0x38a6e3){return{'id':_0x38a6e3[_0xe9f9('0x33')],'name':_0x38a6e3[_0xe9f9('0x7b')],'custom':_[_0xe9f9('0x7c')](_0x38a6e3[_0xe9f9('0x33')],_0xe9f9('0x7d'))?!![]:![],'options':_0x38a6e3[_0xe9f9('0x45')][_0xe9f9('0x33')]===_0xe9f9('0x7e')&&_0x38a6e3[_0xe9f9('0x45')]['picklistValues'][_0xe9f9('0x3d')]>0x0?_[_0xe9f9('0x44')](_0x38a6e3[_0xe9f9('0x45')][_0xe9f9('0x7f')],function(_0x2486c5){return{'name':_0x2486c5['label'],'value':_0x2486c5['value']};}):[]};})};}})[_0xe9f9('0x1a')](respondWithResult(_0x4206c1,null))[_0xe9f9('0x24')](function(_0x5559cd){console['log'](_0xe9f9('0x80')+_0x5559cd);var _0x3bb9c2=_0x441c9b[_0xe9f9('0x37')]['test']?0x1f4:_0x5559cd['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3bb9c2,JSON[_0xe9f9('0x20')](_0x5559cd));delete _0x5559cd[_0xe9f9('0x33')];if(_0x3bb9c2===0x191){_0x3bb9c2=0x190;}_0x4206c1[_0xe9f9('0x26')](_0x3bb9c2)[_0xe9f9('0x81')](_0x441c9b[_0xe9f9('0x37')]['test']?{'message':_0xe9f9('0x82'),'statusCode':_0x5559cd[_0xe9f9('0x83')]}:_0x5559cd);});}; \ No newline at end of file +var _0x7623=['VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','success','POST','login','result','token','GET','sessionName','autogenerated','owner','remove','includes','editable','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','VtigerAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','field','filter','options','VtigerAccount','include','show','includeAll','find','create','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','type'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x7623,0x11e));var _0x3762=function(_0x4811a5,_0x48fadc){_0x4811a5=_0x4811a5-0x0;var _0x1c6a8a=_0x7623[_0x4811a5];return _0x1c6a8a;};'use strict';var pdf=require(_0x3762('0x0'));var emlformat=require(_0x3762('0x1'));var rimraf=require(_0x3762('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3762('0x3'));var rp=require('request-promise');var moment=require(_0x3762('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3762('0x5'));var path=require(_0x3762('0x6'));var sox=require(_0x3762('0x7'));var csv=require(_0x3762('0x8'));var ejs=require(_0x3762('0x9'));var fs=require('fs');var _=require(_0x3762('0xa'));var squel=require(_0x3762('0xb'));var crypto=require(_0x3762('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3762('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3762('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3762('0xe'));var hardwareService=require(_0x3762('0xf'));var logger=require('../../config/logger')(_0x3762('0x10'));var utils=require(_0x3762('0x11'));var config=require(_0x3762('0x12'));var db=require(_0x3762('0x13'))['db'];var integrations=require(_0x3762('0x14'));var jayson=require('jayson/promise');var client=jayson[_0x3762('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x2cf8f8,_0x1d928c,_0x3eb22f){if(_0x3eb22f){var _0x2494f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2494f6[_0x3762('0x16')](_0x1d928c)){return _0x2cf8f8;}else{throw new Error(_0x3762('0x17'));}}else{return _0x2cf8f8;}}function respondWithRpcPromise(_0x49d946,_0x222c2c,_0x1f632b,_0x45e839){return new BPromise(function(_0x4fe43d,_0x1aebd7){var _0x3ef2c6=_0x45e839||client;return _0x3ef2c6['request'](_0x49d946,_0x1f632b)['then'](function(_0x236f72){logger[_0x3762('0x18')](_0x3762('0x19'),_0x222c2c,'request\x20sent');logger[_0x3762('0x1a')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x222c2c,_0x3762('0x1b'),JSON['stringify'](_0x236f72));if(_0x236f72['error']){if(_0x236f72[_0x3762('0x1c')]['code']===0x1f4){logger[_0x3762('0x1c')]('VtigerAccount,\x20%s,\x20%s',_0x222c2c,_0x236f72[_0x3762('0x1c')][_0x3762('0x1d')]);return _0x1aebd7(_0x236f72['error'][_0x3762('0x1d')]);}logger[_0x3762('0x1c')]('VtigerAccount,\x20%s,\x20%s',_0x222c2c,_0x236f72[_0x3762('0x1c')][_0x3762('0x1d')]);return _0x4fe43d(_0x236f72[_0x3762('0x1c')]['message']);}else{logger[_0x3762('0x18')](_0x3762('0x19'),_0x222c2c,_0x3762('0x1b'));_0x4fe43d(_0x236f72['result'][_0x3762('0x1d')]);}})[_0x3762('0x1e')](function(_0x3311a4){logger[_0x3762('0x1c')](_0x3762('0x19'),_0x222c2c,_0x3311a4);_0x1aebd7(_0x3311a4);});});}function respondWithStatusCode(_0x4fded3,_0x1b20f3){_0x1b20f3=_0x1b20f3||0xcc;return function(_0x91fcd8){if(_0x91fcd8){return _0x4fded3['sendStatus'](_0x1b20f3);}return _0x4fded3[_0x3762('0x1f')](_0x1b20f3)[_0x3762('0x20')]();};}function respondWithResult(_0x538a46,_0x2124ba){_0x2124ba=_0x2124ba||0xc8;return function(_0x4760f5){if(_0x4760f5){return _0x538a46[_0x3762('0x1f')](_0x2124ba)[_0x3762('0x21')](_0x4760f5);}};}function respondWithFilteredResult(_0x2f984c,_0x1277bc){return function(_0x389a72){if(_0x389a72){var _0x4513c1=_0x389a72[_0x3762('0x22')],_0x5bfdea=_0x1277bc[_0x3762('0x23')],_0x1838f6=_0x1277bc[_0x3762('0x23')]+_0x1277bc[_0x3762('0x24')],_0x4b64ae;if(_0x1838f6>=_0x4513c1){_0x1838f6=_0x4513c1;_0x4b64ae=0xc8;}else{_0x4b64ae=0xce;}_0x2f984c['status'](_0x4b64ae);return _0x2f984c['set'](_0x3762('0x25'),_0x5bfdea+'-'+_0x1838f6+'/'+_0x4513c1)[_0x3762('0x21')](_0x389a72);}return null;};}function patchUpdates(_0x4f2fee){return function(_0x56f030){try{jsonpatch[_0x3762('0x26')](_0x56f030,_0x4f2fee,!![]);}catch(_0x56873b){return BPromise[_0x3762('0x27')](_0x56873b);}return _0x56f030[_0x3762('0x28')]();};}function saveUpdates(_0x5442ab,_0x1d086d){return function(_0x4d305c){if(_0x4d305c){return _0x4d305c[_0x3762('0x29')](_0x5442ab)[_0x3762('0x2a')](function(_0x3c134f){return _0x3c134f;});}return null;};}function removeEntity(_0x4d9f55,_0x1db8f3){return function(_0x1ad5bc){if(_0x1ad5bc){return _0x1ad5bc['destroy']()['then'](function(){_0x4d9f55[_0x3762('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340b10,_0x2f8d57){return function(_0x4886f5){if(!_0x4886f5){_0x340b10[_0x3762('0x2b')](0x194);}return _0x4886f5;};}function handleError(_0x3e5dab,_0x1cd8cd){_0x1cd8cd=_0x1cd8cd||0x1f4;return function(_0x19a850){logger['error'](_0x19a850[_0x3762('0x2c')]);if(_0x19a850[_0x3762('0x2d')]){delete _0x19a850['name'];}_0x3e5dab['status'](_0x1cd8cd)[_0x3762('0x2e')](_0x19a850);};}exports[_0x3762('0x2f')]=function(_0x1cfe0b,_0x5b083c){var _0x410d12={},_0x2dcffd={},_0x23cccb={'count':0x0,'rows':[]};var _0x584fd9=db['VtigerAccount'][_0x3762('0x30')];_0x2dcffd[_0x3762('0x31')]=_['keys'](_0x584fd9);_0x2dcffd['query']=_[_0x3762('0x32')](_0x1cfe0b[_0x3762('0x33')]);_0x2dcffd[_0x3762('0x34')]=_[_0x3762('0x35')](_0x2dcffd[_0x3762('0x31')],_0x2dcffd['query']);_0x410d12['attributes']=_[_0x3762('0x35')](_0x2dcffd[_0x3762('0x31')],qs['fields'](_0x1cfe0b[_0x3762('0x33')][_0x3762('0x36')]));_0x410d12[_0x3762('0x37')]=_0x410d12[_0x3762('0x37')][_0x3762('0x38')]?_0x410d12[_0x3762('0x37')]:_0x2dcffd['model'];if(!_0x1cfe0b['query'][_0x3762('0x39')](_0x3762('0x3a'))){_0x410d12[_0x3762('0x24')]=qs[_0x3762('0x24')](_0x1cfe0b[_0x3762('0x33')][_0x3762('0x24')]);_0x410d12[_0x3762('0x23')]=qs[_0x3762('0x23')](_0x1cfe0b['query']['offset']);}_0x410d12[_0x3762('0x3b')]=qs[_0x3762('0x3c')](_0x1cfe0b[_0x3762('0x33')][_0x3762('0x3c')]);_0x410d12['where']=qs[_0x3762('0x34')](_['pick'](_0x1cfe0b[_0x3762('0x33')],_0x2dcffd['filters']));if(_0x1cfe0b[_0x3762('0x33')]['filter']){_0x410d12[_0x3762('0x3d')]=_[_0x3762('0x3e')](_0x410d12[_0x3762('0x3d')],{'$or':_[_0x3762('0x3f')](_0x584fd9,function(_0x409ead){if(_0x409ead['type']['key']!==_0x3762('0x40')){var _0x1c5cd5={};_0x1c5cd5[_0x409ead[_0x3762('0x41')]]={'$like':'%'+_0x1cfe0b[_0x3762('0x33')][_0x3762('0x42')]+'%'};return _0x1c5cd5;}})});}_0x410d12=_[_0x3762('0x3e')]({},_0x410d12,_0x1cfe0b[_0x3762('0x43')]);var _0x4e7626={'where':_0x410d12[_0x3762('0x3d')]};return db[_0x3762('0x44')][_0x3762('0x22')](_0x4e7626)[_0x3762('0x2a')](function(_0x21f8fb){_0x23cccb['count']=_0x21f8fb;if(_0x1cfe0b['query']['includeAll']){_0x410d12[_0x3762('0x45')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x410d12);})['then'](function(_0x5380a0){_0x23cccb['rows']=_0x5380a0;return _0x23cccb;})[_0x3762('0x2a')](respondWithFilteredResult(_0x5b083c,_0x410d12))[_0x3762('0x1e')](handleError(_0x5b083c,null));};exports[_0x3762('0x46')]=function(_0x6273e0,_0x30bc8d){var _0x42b0a6={'raw':![],'where':{'id':_0x6273e0['params']['id']}},_0xcf4b60={};_0xcf4b60[_0x3762('0x31')]=_[_0x3762('0x32')](db[_0x3762('0x44')][_0x3762('0x30')]);_0xcf4b60['query']=_[_0x3762('0x32')](_0x6273e0[_0x3762('0x33')]);_0xcf4b60[_0x3762('0x34')]=_[_0x3762('0x35')](_0xcf4b60['model'],_0xcf4b60[_0x3762('0x33')]);_0x42b0a6[_0x3762('0x37')]=_['intersection'](_0xcf4b60[_0x3762('0x31')],qs['fields'](_0x6273e0['query']['fields']));_0x42b0a6[_0x3762('0x37')]=_0x42b0a6[_0x3762('0x37')]['length']?_0x42b0a6[_0x3762('0x37')]:_0xcf4b60[_0x3762('0x31')];if(_0x6273e0[_0x3762('0x33')][_0x3762('0x47')]){_0x42b0a6[_0x3762('0x45')]=[{'all':!![]}];}_0x42b0a6=_[_0x3762('0x3e')]({},_0x42b0a6,_0x6273e0[_0x3762('0x43')]);return db[_0x3762('0x44')][_0x3762('0x48')](_0x42b0a6)[_0x3762('0x2a')](handleEntityNotFound(_0x30bc8d,null))[_0x3762('0x2a')](respondWithResult(_0x30bc8d,null))['catch'](handleError(_0x30bc8d,null));};exports[_0x3762('0x49')]=function(_0x47f28d,_0x2a4267){return db['VtigerAccount'][_0x3762('0x49')](_0x47f28d[_0x3762('0x4a')],{})[_0x3762('0x2a')](respondWithResult(_0x2a4267,0xc9))['catch'](handleError(_0x2a4267,null));};exports[_0x3762('0x29')]=function(_0x164f84,_0x5f42ca){if(_0x164f84[_0x3762('0x4a')]['id']){delete _0x164f84['body']['id'];}return db[_0x3762('0x44')][_0x3762('0x48')]({'where':{'id':_0x164f84[_0x3762('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5f42ca,null))[_0x3762('0x2a')](saveUpdates(_0x164f84[_0x3762('0x4a')],null))[_0x3762('0x2a')](respondWithResult(_0x5f42ca,null))[_0x3762('0x1e')](handleError(_0x5f42ca,null));};exports[_0x3762('0x4c')]=function(_0x58f389,_0x46708c){return db['VtigerAccount'][_0x3762('0x48')]({'where':{'id':_0x58f389[_0x3762('0x4b')]['id']}})[_0x3762('0x2a')](handleEntityNotFound(_0x46708c,null))[_0x3762('0x2a')](removeEntity(_0x46708c,null))['catch'](handleError(_0x46708c,null));};exports[_0x3762('0x4d')]=function(_0x2185a0,_0x3c88a3,_0x3467f7){var _0x4dbdd6={};var _0x3358a3={};var _0x7f8676;var _0x32a9b8;return db[_0x3762('0x44')][_0x3762('0x4e')]({'where':{'id':_0x2185a0['params']['id']}})[_0x3762('0x2a')](handleEntityNotFound(_0x3c88a3,null))[_0x3762('0x2a')](function(_0x18c0bc){if(_0x18c0bc){_0x7f8676=_0x18c0bc;_0x3358a3['model']=_[_0x3762('0x32')](db[_0x3762('0x4f')][_0x3762('0x30')]);_0x3358a3[_0x3762('0x33')]=_[_0x3762('0x32')](_0x2185a0[_0x3762('0x33')]);_0x3358a3[_0x3762('0x34')]=_[_0x3762('0x35')](_0x3358a3[_0x3762('0x31')],_0x3358a3[_0x3762('0x33')]);_0x4dbdd6[_0x3762('0x37')]=_['intersection'](_0x3358a3[_0x3762('0x31')],qs[_0x3762('0x36')](_0x2185a0[_0x3762('0x33')][_0x3762('0x36')]));_0x4dbdd6['attributes']=_0x4dbdd6[_0x3762('0x37')][_0x3762('0x38')]?_0x4dbdd6[_0x3762('0x37')]:_0x3358a3['model'];_0x4dbdd6['order']=qs[_0x3762('0x3c')](_0x2185a0['query'][_0x3762('0x3c')]);_0x4dbdd6['where']=qs[_0x3762('0x34')](_[_0x3762('0x50')](_0x2185a0['query'],_0x3358a3[_0x3762('0x34')]));if(_0x2185a0[_0x3762('0x33')][_0x3762('0x42')]){_0x4dbdd6['where']=_[_0x3762('0x3e')](_0x4dbdd6[_0x3762('0x3d')],{'$or':_['map'](_0x4dbdd6[_0x3762('0x37')],function(_0x25936d){var _0x2ee675={};_0x2ee675[_0x25936d]={'$like':'%'+_0x2185a0['query'][_0x3762('0x42')]+'%'};return _0x2ee675;})});}_0x4dbdd6=_[_0x3762('0x3e')]({},_0x4dbdd6,_0x2185a0[_0x3762('0x43')]);return _0x7f8676['getConfigurations'](_0x4dbdd6);}})[_0x3762('0x2a')](function(_0xd3642f){if(_0xd3642f){_0x32a9b8=_0xd3642f[_0x3762('0x38')];if(!_0x2185a0[_0x3762('0x33')][_0x3762('0x39')]('nolimit')){_0x4dbdd6[_0x3762('0x24')]=qs['limit'](_0x2185a0[_0x3762('0x33')]['limit']);_0x4dbdd6['offset']=qs[_0x3762('0x23')](_0x2185a0[_0x3762('0x33')][_0x3762('0x23')]);}return _0x7f8676[_0x3762('0x4d')](_0x4dbdd6);}})['then'](function(_0x32fcb3){if(_0x32fcb3){return _0x32fcb3?{'count':_0x32a9b8,'rows':_0x32fcb3}:null;}})['then'](respondWithResult(_0x3c88a3,null))['catch'](handleError(_0x3c88a3,null));};exports[_0x3762('0x51')]=function(_0x427954,_0x50b8fe,_0x46721e){if(_0x427954['body']['id']){delete _0x427954[_0x3762('0x4a')]['id'];}return db[_0x3762('0x44')][_0x3762('0x4e')]({'where':{'id':_0x427954[_0x3762('0x4b')]['id']}})[_0x3762('0x2a')](handleEntityNotFound(_0x50b8fe,null))[_0x3762('0x2a')](function(_0x2530a0){if(_0x2530a0){_0x427954['body'][_0x3762('0x52')]=_0x2530a0['id'];_0x427954['body'][_0x3762('0x53')]=integrations[_0x3762('0x54')](_0x427954['body'][_0x3762('0x55')],_0x427954[_0x3762('0x4a')]['type']);_0x427954[_0x3762('0x4a')][_0x3762('0x56')]=integrations[_0x3762('0x57')](_0x427954[_0x3762('0x4a')][_0x3762('0x55')],_0x427954['body'][_0x3762('0x58')]);return db[_0x3762('0x4f')][_0x3762('0x49')](_0x427954[_0x3762('0x4a')],{'include':[{'model':db[_0x3762('0x59')],'as':_0x3762('0x53')},{'model':db[_0x3762('0x59')],'as':_0x3762('0x56')}]});}return null;})[_0x3762('0x2a')](respondWithResult(_0x50b8fe,null))['catch'](handleError(_0x50b8fe,null));};var md5=require(_0x3762('0x5a'));exports[_0x3762('0x5b')]=function(_0x21ccbb,_0x2646e4,_0x5acb55){var _0xec267a=null;var _0x1e3d22=null;var _0x3383eb=null;var _0x37a474=null;var _0x1b19ae='';return db[_0x3762('0x44')][_0x3762('0x4e')]({'where':{'id':_0x21ccbb['params']['id']},'attributes':['id','name',_0x3762('0x5c'),_0x3762('0x5d'),_0x3762('0x5e'),'remoteUri',_0x3762('0x5f'),_0x3762('0x60')]})[_0x3762('0x2a')](handleEntityNotFound(_0x2646e4,null))[_0x3762('0x2a')](function(_0x399d5b){if(_0x399d5b){_0xec267a=_0x399d5b['username'];_0x1e3d22=_0x399d5b['accessKey'];_0x3383eb=_0x399d5b[_0x3762('0x5e')];_0x1b19ae=_0x399d5b[_0x3762('0x61')];var _0x59043c=_0x1b19ae[_0x3762('0x62')](-0x1);if(_0x59043c==='/'){_0x1b19ae=_0x1b19ae['substring'](0x0,_0x1b19ae[_0x3762('0x63')](_0x59043c));}_0x37a474=util[_0x3762('0x64')](_0x3762('0x65'),_0x1b19ae);var _0x2cccbc={'method':'GET','uri':_0x37a474,'qs':{'operation':'getchallenge','username':_0x399d5b['username']},'json':!![]};return rp(_0x2cccbc);}})['then'](function(_0x58d8c8){if(_0x58d8c8[_0x3762('0x66')]){var _0x19d62e={'method':_0x3762('0x67'),'uri':_0x37a474,'form':{'operation':_0x3762('0x68'),'username':_0xec267a,'accessKey':md5(_0x58d8c8[_0x3762('0x69')][_0x3762('0x6a')]+_0x1e3d22)},'json':!![]};return rp(_0x19d62e);}})[_0x3762('0x2a')](function(_0x5ea877){if(_0x5ea877['success']){var _0x23a3ad={'method':_0x3762('0x6b'),'uri':_0x37a474,'qs':{'operation':'describe','username':_0xec267a,'sessionName':_0x5ea877[_0x3762('0x69')][_0x3762('0x6c')],'elementType':_0x3383eb},'json':!![]};return rp(_0x23a3ad);}})[_0x3762('0x2a')](function(_0x22aa45){if(_0x22aa45[_0x3762('0x66')]){var _0x20880c=[_0x3762('0x6d'),'reference',_0x3762('0x6e')];_[_0x3762('0x6f')](_0x22aa45[_0x3762('0x69')][_0x3762('0x36')],function(_0x36f276){return _0x20880c[_0x3762('0x70')](_0x36f276['type'][_0x3762('0x2d')]);});_[_0x3762('0x6f')](_0x22aa45[_0x3762('0x69')]['fields'],function(_0x2954ce){return _0x2954ce[_0x3762('0x71')]==='false';});return{'count':_0x22aa45[_0x3762('0x69')]['fields']['length'],'rows':_[_0x3762('0x3f')](_0x22aa45[_0x3762('0x69')]['fields'],function(_0x1e1311){return{'id':_0x1e1311['name'],'name':_0x1e1311[_0x3762('0x72')],'custom':_[_0x3762('0x73')](_0x1e1311['name'],_0x3762('0x74'))?!![]:![],'options':_0x1e1311['type'][_0x3762('0x2d')]==='picklist'&&_0x1e1311[_0x3762('0x58')][_0x3762('0x75')][_0x3762('0x38')]>0x0?_[_0x3762('0x3f')](_0x1e1311[_0x3762('0x58')][_0x3762('0x75')],function(_0x5cb436){return{'name':_0x5cb436[_0x3762('0x72')],'value':_0x5cb436[_0x3762('0x76')]};}):[]};})};}})['then'](respondWithResult(_0x2646e4,null))[_0x3762('0x1e')](function(_0x34c67d){console[_0x3762('0x77')](_0x3762('0x78')+_0x34c67d);var _0xa3c66b=_0x21ccbb['query'][_0x3762('0x16')]?0x1f4:_0x34c67d[_0x3762('0x79')]||0x1f4;logger[_0x3762('0x1c')](_0x3762('0x7a'),_0x3762('0x5b'),_0xa3c66b,JSON[_0x3762('0x7b')](_0x34c67d));delete _0x34c67d[_0x3762('0x2d')];if(_0xa3c66b===0x191){_0xa3c66b=0x190;}_0x2646e4[_0x3762('0x1f')](_0xa3c66b)[_0x3762('0x2e')](_0x21ccbb[_0x3762('0x33')][_0x3762('0x16')]?{'message':_0x3762('0x7c'),'statusCode':_0x34c67d[_0x3762('0x79')]}:_0x34c67d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a68cc25..50c4010 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 _0xd4ad=['../../config/logger','api','moment','path','rimraf','define','int_vtiger_accounts','lodash','util'];(function(_0x3d3e8b,_0x24e455){var _0x10271e=function(_0x35187f){while(--_0x35187f){_0x3d3e8b['push'](_0x3d3e8b['shift']());}};_0x10271e(++_0x24e455);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x33f5b0,_0x4c2645){_0x33f5b0=_0x33f5b0-0x0;var _0x146010=_0xd4ad[_0x33f5b0];return _0x146010;};'use strict';var _=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var logger=require(_0xdd4a('0x2'))(_0xdd4a('0x3'));var moment=require(_0xdd4a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd4a('0x5'));var rimraf=require(_0xdd4a('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x381f07,_0x4fdfa2){return _0x381f07[_0xdd4a('0x7')]('VtigerAccount',attributes,{'tableName':_0xdd4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6302=['int_vtiger_accounts','util','../../config/logger','api','moment','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x6d6a95,_0x1621bc){var _0x51e566=function(_0x24a818){while(--_0x24a818){_0x6d6a95['push'](_0x6d6a95['shift']());}};_0x51e566(++_0x1621bc);}(_0x6302,0x109));var _0x2630=function(_0x3b0a48,_0x2291a7){_0x3b0a48=_0x3b0a48-0x0;var _0x76484f=_0x6302[_0x3b0a48];return _0x76484f;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var logger=require(_0x2630('0x1'))(_0x2630('0x2'));var moment=require(_0x2630('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2630('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2630('0x5'));var integrations=require(_0x2630('0x6'));module[_0x2630('0x7')]=function(_0x1a9f2b,_0x2867f8){return _0x1a9f2b[_0x2630('0x8')](_0x2630('0x9'),attributes,{'tableName':_0x2630('0xa'),'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 6ced620..0b5e900 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 _0xdfa1=['attributes','include','map','model','debug','ShowVtigerAccount','find','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where'];(function(_0x347f6c,_0x1faabd){var _0x43b94a=function(_0x24f206){while(--_0x24f206){_0x347f6c['push'](_0x347f6c['shift']());}};_0x43b94a(++_0x1faabd);}(_0xdfa1,0x127));var _0x1dfa=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xdfa1[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1dfa('0x0'));var BPromise=require('bluebird');var rs=require(_0x1dfa('0x1'));var fs=require('fs');var Redis=require(_0x1dfa('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1dfa('0x3'));var logger=require(_0x1dfa('0x4'))(_0x1dfa('0x5'));var config=require(_0x1dfa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1dfa('0x7')][_0x1dfa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xadfc84,_0x4fdfca,_0x798846){return new BPromise(function(_0x52642e,_0x39d561){return client[_0x1dfa('0x9')](_0xadfc84,_0x798846)[_0x1dfa('0xa')](function(_0x4b0f0c){logger[_0x1dfa('0xb')](_0x1dfa('0xc'),_0x4fdfca,_0x1dfa('0xd'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4fdfca,_0x1dfa('0xd'),JSON[_0x1dfa('0xe')](_0x4b0f0c));if(_0x4b0f0c['error']){if(_0x4b0f0c[_0x1dfa('0xf')][_0x1dfa('0x10')]===0x1f4){logger['error'](_0x1dfa('0xc'),_0x4fdfca,_0x4b0f0c['error'][_0x1dfa('0x11')]);return _0x39d561(_0x4b0f0c[_0x1dfa('0xf')][_0x1dfa('0x11')]);}logger['error'](_0x1dfa('0xc'),_0x4fdfca,_0x4b0f0c[_0x1dfa('0xf')][_0x1dfa('0x11')]);return _0x52642e(_0x4b0f0c[_0x1dfa('0xf')][_0x1dfa('0x11')]);}else{logger[_0x1dfa('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x4fdfca,_0x1dfa('0xd'));_0x52642e(_0x4b0f0c['result'][_0x1dfa('0x11')]);}})[_0x1dfa('0x12')](function(_0x556c00){logger[_0x1dfa('0xf')](_0x1dfa('0xc'),_0x4fdfca,_0x556c00);_0x39d561(_0x556c00);});});}exports[_0x1dfa('0x13')]=function(_0x176818){var _0x185735=this;return new Promise(function(_0x553912,_0x422bf8){return db[_0x1dfa('0x14')][_0x1dfa('0x15')]({'raw':_0x176818[_0x1dfa('0x16')]?_0x176818[_0x1dfa('0x16')][_0x1dfa('0x17')]===undefined?!![]:![]:!![],'where':_0x176818[_0x1dfa('0x16')]?_0x176818['options'][_0x1dfa('0x18')]||null:null,'attributes':_0x176818[_0x1dfa('0x16')]?_0x176818[_0x1dfa('0x16')][_0x1dfa('0x19')]||null:null,'limit':_0x176818[_0x1dfa('0x16')]?_0x176818[_0x1dfa('0x16')]['limit']||null:null,'include':_0x176818[_0x1dfa('0x16')]?_0x176818['options'][_0x1dfa('0x1a')]?_[_0x1dfa('0x1b')](_0x176818[_0x1dfa('0x16')]['include'],function(_0x2a81f5){return{'model':db[_0x2a81f5['model']],'as':_0x2a81f5['as'],'attributes':_0x2a81f5['attributes'],'include':_0x2a81f5[_0x1dfa('0x1a')]?_[_0x1dfa('0x1b')](_0x2a81f5['include'],function(_0x45436d){return{'model':db[_0x45436d['model']],'as':_0x45436d['as'],'attributes':_0x45436d[_0x1dfa('0x19')],'include':_0x45436d[_0x1dfa('0x1a')]?_[_0x1dfa('0x1b')](_0x45436d[_0x1dfa('0x1a')],function(_0x41e072){return{'model':db[_0x41e072[_0x1dfa('0x1c')]],'as':_0x41e072['as'],'attributes':_0x41e072[_0x1dfa('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1dfa('0xa')](function(_0x6b860c){logger['info']('GetVtigerAccount',_0x176818);logger[_0x1dfa('0x1d')](_0x1dfa('0x13'),_0x176818,JSON[_0x1dfa('0xe')](_0x6b860c));_0x553912(_0x6b860c);})['catch'](function(_0x437125){logger[_0x1dfa('0xf')](_0x1dfa('0x13'),_0x437125['message'],_0x176818);_0x422bf8(_0x185735[_0x1dfa('0xf')](0x1f4,_0x437125[_0x1dfa('0x11')]));});});};exports[_0x1dfa('0x1e')]=function(_0x322e99){var _0xba6144=this;return new Promise(function(_0x466e96,_0x218171){return db[_0x1dfa('0x14')][_0x1dfa('0x1f')]({'raw':_0x322e99['options']?_0x322e99[_0x1dfa('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x322e99['options']?_0x322e99[_0x1dfa('0x16')][_0x1dfa('0x18')]||null:null,'attributes':_0x322e99[_0x1dfa('0x16')]?_0x322e99[_0x1dfa('0x16')][_0x1dfa('0x19')]||null:null,'include':_0x322e99[_0x1dfa('0x16')]?_0x322e99[_0x1dfa('0x16')][_0x1dfa('0x1a')]?_[_0x1dfa('0x1b')](_0x322e99[_0x1dfa('0x16')][_0x1dfa('0x1a')],function(_0x4b4ab2){return{'model':db[_0x4b4ab2[_0x1dfa('0x1c')]],'as':_0x4b4ab2['as'],'attributes':_0x4b4ab2[_0x1dfa('0x19')],'include':_0x4b4ab2[_0x1dfa('0x1a')]?_[_0x1dfa('0x1b')](_0x4b4ab2[_0x1dfa('0x1a')],function(_0x68d55a){return{'model':db[_0x68d55a[_0x1dfa('0x1c')]],'as':_0x68d55a['as'],'attributes':_0x68d55a[_0x1dfa('0x19')],'include':_0x68d55a['include']?_['map'](_0x68d55a[_0x1dfa('0x1a')],function(_0x57844f){return{'model':db[_0x57844f[_0x1dfa('0x1c')]],'as':_0x57844f['as'],'attributes':_0x57844f[_0x1dfa('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1dfa('0xa')](function(_0x33a4d9){logger['info'](_0x1dfa('0x1e'),_0x322e99);logger['debug'](_0x1dfa('0x1e'),_0x322e99,JSON[_0x1dfa('0xe')](_0x33a4d9));_0x466e96(_0x33a4d9);})[_0x1dfa('0x12')](function(_0x18c5c6){logger[_0x1dfa('0xf')](_0x1dfa('0x1e'),_0x18c5c6[_0x1dfa('0x11')],_0x322e99);_0x218171(_0xba6144[_0x1dfa('0xf')](0x1f4,_0x18c5c6['message']));});});}; \ No newline at end of file +var _0x1629=['http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVtigerAccount','findAll','options','attributes','limit','include','map','model','then','raw','where','debug','ShowVtigerAccount','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1629,0x1d8));var _0x9162=function(_0x3dfe3b,_0x59c9f6){_0x3dfe3b=_0x3dfe3b-0x0;var _0x54e8fd=_0x1629[_0x3dfe3b];return _0x54e8fd;};'use strict';var _=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var moment=require(_0x9162('0x2'));var BPromise=require(_0x9162('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9162('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9162('0x5'))(_0x9162('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9162('0x7')][_0x9162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b432e,_0xc579ed,_0x11d90b){return new BPromise(function(_0x168267,_0x4caf9b){return client['request'](_0x4b432e,_0x11d90b)['then'](function(_0xbeefd3){logger[_0x9162('0x9')](_0x9162('0xa'),_0xc579ed,_0x9162('0xb'));logger['debug'](_0x9162('0xc'),_0xc579ed,_0x9162('0xb'),JSON['stringify'](_0xbeefd3));if(_0xbeefd3[_0x9162('0xd')]){if(_0xbeefd3[_0x9162('0xd')]['code']===0x1f4){logger[_0x9162('0xd')](_0x9162('0xa'),_0xc579ed,_0xbeefd3[_0x9162('0xd')][_0x9162('0xe')]);return _0x4caf9b(_0xbeefd3[_0x9162('0xd')][_0x9162('0xe')]);}logger[_0x9162('0xd')](_0x9162('0xa'),_0xc579ed,_0xbeefd3[_0x9162('0xd')][_0x9162('0xe')]);return _0x168267(_0xbeefd3[_0x9162('0xd')]['message']);}else{logger[_0x9162('0x9')](_0x9162('0xa'),_0xc579ed,'request\x20sent');_0x168267(_0xbeefd3[_0x9162('0xf')][_0x9162('0xe')]);}})[_0x9162('0x10')](function(_0x3c7761){logger[_0x9162('0xd')](_0x9162('0xa'),_0xc579ed,_0x3c7761);_0x4caf9b(_0x3c7761);});});}exports[_0x9162('0x11')]=function(_0x36e65b){var _0x375372=this;return new Promise(function(_0x26afe3,_0x4c07b7){return db['VtigerAccount'][_0x9162('0x12')]({'raw':_0x36e65b[_0x9162('0x13')]?_0x36e65b[_0x9162('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x36e65b[_0x9162('0x13')]?_0x36e65b['options']['where']||null:null,'attributes':_0x36e65b[_0x9162('0x13')]?_0x36e65b[_0x9162('0x13')][_0x9162('0x14')]||null:null,'limit':_0x36e65b[_0x9162('0x13')]?_0x36e65b[_0x9162('0x13')][_0x9162('0x15')]||null:null,'include':_0x36e65b[_0x9162('0x13')]?_0x36e65b[_0x9162('0x13')][_0x9162('0x16')]?_[_0x9162('0x17')](_0x36e65b[_0x9162('0x13')][_0x9162('0x16')],function(_0x4730eb){return{'model':db[_0x4730eb[_0x9162('0x18')]],'as':_0x4730eb['as'],'attributes':_0x4730eb[_0x9162('0x14')],'include':_0x4730eb[_0x9162('0x16')]?_[_0x9162('0x17')](_0x4730eb[_0x9162('0x16')],function(_0x15f00c){return{'model':db[_0x15f00c[_0x9162('0x18')]],'as':_0x15f00c['as'],'attributes':_0x15f00c[_0x9162('0x14')],'include':_0x15f00c[_0x9162('0x16')]?_[_0x9162('0x17')](_0x15f00c[_0x9162('0x16')],function(_0x1fcb3c){return{'model':db[_0x1fcb3c['model']],'as':_0x1fcb3c['as'],'attributes':_0x1fcb3c[_0x9162('0x14')]};}):[]};}):[]};}):[]:[]})[_0x9162('0x19')](function(_0x1d52d1){logger[_0x9162('0x9')]('GetVtigerAccount',_0x36e65b);logger['debug'](_0x9162('0x11'),_0x36e65b,JSON['stringify'](_0x1d52d1));_0x26afe3(_0x1d52d1);})[_0x9162('0x10')](function(_0x3de393){logger[_0x9162('0xd')](_0x9162('0x11'),_0x3de393[_0x9162('0xe')],_0x36e65b);_0x4c07b7(_0x375372['error'](0x1f4,_0x3de393[_0x9162('0xe')]));});});};exports['ShowVtigerAccount']=function(_0x2a3132){var _0xb32e04=this;return new Promise(function(_0x1a2d17,_0x54abdc){return db['VtigerAccount']['find']({'raw':_0x2a3132[_0x9162('0x13')]?_0x2a3132[_0x9162('0x13')][_0x9162('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a3132[_0x9162('0x13')]?_0x2a3132['options'][_0x9162('0x1b')]||null:null,'attributes':_0x2a3132[_0x9162('0x13')]?_0x2a3132[_0x9162('0x13')][_0x9162('0x14')]||null:null,'include':_0x2a3132[_0x9162('0x13')]?_0x2a3132[_0x9162('0x13')]['include']?_[_0x9162('0x17')](_0x2a3132[_0x9162('0x13')][_0x9162('0x16')],function(_0x55b924){return{'model':db[_0x55b924[_0x9162('0x18')]],'as':_0x55b924['as'],'attributes':_0x55b924[_0x9162('0x14')],'include':_0x55b924[_0x9162('0x16')]?_[_0x9162('0x17')](_0x55b924['include'],function(_0x28ed41){return{'model':db[_0x28ed41[_0x9162('0x18')]],'as':_0x28ed41['as'],'attributes':_0x28ed41[_0x9162('0x14')],'include':_0x28ed41[_0x9162('0x16')]?_[_0x9162('0x17')](_0x28ed41['include'],function(_0x4a806f){return{'model':db[_0x4a806f[_0x9162('0x18')]],'as':_0x4a806f['as'],'attributes':_0x4a806f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x117620){logger[_0x9162('0x9')]('ShowVtigerAccount',_0x2a3132);logger[_0x9162('0x1c')](_0x9162('0x1d'),_0x2a3132,JSON['stringify'](_0x117620));_0x1a2d17(_0x117620);})['catch'](function(_0x27d124){logger['error']('ShowVtigerAccount',_0x27d124[_0x9162('0xe')],_0x2a3132);_0x54abdc(_0xb32e04[_0x9162('0xd')](0x1f4,_0x27d124[_0x9162('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 82bc1d8..634746e 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 _0xbaf0=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','exports','util'];(function(_0x4da690,_0x12d136){var _0x263c53=function(_0x1832fa){while(--_0x1832fa){_0x4da690['push'](_0x4da690['shift']());}};_0x263c53(++_0x12d136);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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('0x13')]('/',auth[_0x0baf('0x9')](),controller['create']);router['put'](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x14')]);router[_0x0baf('0x15')]('/:id',auth[_0x0baf('0x9')](),controller['destroy']);module[_0x0baf('0x16')]=router; \ No newline at end of file +var _0xbaf0=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','exports','util'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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('0x13')]('/',auth[_0x0baf('0x9')](),controller['create']);router['put'](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x14')]);router[_0x0baf('0x15')]('/:id',auth[_0x0baf('0x9')](),controller['destroy']);module[_0x0baf('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 60aeeea..3d8f2a8 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 _0x9a20=['STRING','exports'];(function(_0x48ca15,_0x3947f4){var _0x4ace27=function(_0x4a40aa){while(--_0x4a40aa){_0x48ca15['push'](_0x48ca15['shift']());}};_0x4ace27(++_0x3947f4);}(_0x9a20,0x1df));var _0x09a2=function(_0xf2c034,_0x50a612){_0xf2c034=_0xf2c034-0x0;var _0x48396a=_0x9a20[_0xf2c034];return _0x48396a;};'use strict';var Sequelize=require('sequelize');module[_0x09a2('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x09a2('0x1')]}}; \ No newline at end of file +var _0xc876=['exports','STRING','sequelize'];(function(_0xb7368b,_0xf11033){var _0x37d43b=function(_0x4562ed){while(--_0x4562ed){_0xb7368b['push'](_0xb7368b['shift']());}};_0x37d43b(++_0xf11033);}(_0xc876,0x197));var _0x6c87=function(_0xe18ff7,_0x2f520f){_0xe18ff7=_0xe18ff7-0x0;var _0x5abfe2=_0xc876[_0xe18ff7];return _0x5abfe2;};'use strict';var Sequelize=require(_0x6c87('0x0'));module[_0x6c87('0x1')]={'name':{'type':Sequelize[_0x6c87('0x2')]},'description':{'type':Sequelize[_0x6c87('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index bdbf933..0dd3105 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 _0x6658=['model','hasOwnProperty','nolimit','order','sort','merge','where','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','body','getFields','findOne','VtigerField','pick','getSubjects','filter','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','VtigerConfiguration','rawAttributes','keys','query','filters','intersection','attributes','fields','length'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0x6658,0x198));var _0x8665=function(_0x43162b,_0x32385c){_0x43162b=_0x43162b-0x0;var _0x2a6307=_0x6658[_0x43162b];return _0x2a6307;};'use strict';var pdf=require(_0x8665('0x0'));var emlformat=require(_0x8665('0x1'));var rimraf=require(_0x8665('0x2'));var zipdir=require(_0x8665('0x3'));var jsonpatch=require(_0x8665('0x4'));var rp=require(_0x8665('0x5'));var moment=require(_0x8665('0x6'));var BPromise=require(_0x8665('0x7'));var Mustache=require('mustache');var util=require(_0x8665('0x8'));var path=require(_0x8665('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8665('0xa'));var fs=require('fs');var _=require(_0x8665('0xb'));var squel=require(_0x8665('0xc'));var crypto=require(_0x8665('0xd'));var jsforce=require(_0x8665('0xe'));var deskjs=require(_0x8665('0xf'));var toCsv=require(_0x8665('0x10'));var querystring=require(_0x8665('0x11'));var Papa=require('papaparse');var Redis=require(_0x8665('0x12'));var authService=require(_0x8665('0x13'));var qs=require(_0x8665('0x14'));var hardwareService=require(_0x8665('0x15'));var logger=require(_0x8665('0x16'))(_0x8665('0x17'));var utils=require(_0x8665('0x18'));var config=require(_0x8665('0x19'));var db=require(_0x8665('0x1a'))['db'];var jayson=require(_0x8665('0x1b'));var client=jayson[_0x8665('0x1c')][_0x8665('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x26ffc9,_0x689905,_0x569c8a){if(_0x569c8a){var _0x29732e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29732e['test'](_0x689905)){return _0x26ffc9;}else{throw new Error(_0x8665('0x1e'));}}else{return _0x26ffc9;}}function respondWithRpcPromise(_0x16452c,_0xfef706,_0x16e920,_0x1829a9){return new BPromise(function(_0x2a0507,_0x5186e4){var _0x222e87=_0x1829a9||client;return _0x222e87[_0x8665('0x1f')](_0x16452c,_0x16e920)['then'](function(_0x3515dc){logger['info'](_0x8665('0x20'),_0xfef706,_0x8665('0x21'));logger[_0x8665('0x22')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xfef706,_0x8665('0x21'),JSON[_0x8665('0x23')](_0x3515dc));if(_0x3515dc['error']){if(_0x3515dc[_0x8665('0x24')][_0x8665('0x25')]===0x1f4){logger[_0x8665('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0xfef706,_0x3515dc[_0x8665('0x24')][_0x8665('0x26')]);return _0x5186e4(_0x3515dc[_0x8665('0x24')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xfef706,_0x3515dc[_0x8665('0x24')]['message']);return _0x2a0507(_0x3515dc[_0x8665('0x24')]['message']);}else{logger[_0x8665('0x27')]('VtigerConfiguration,\x20%s,\x20%s',_0xfef706,'request\x20sent');_0x2a0507(_0x3515dc[_0x8665('0x28')][_0x8665('0x26')]);}})['catch'](function(_0x38e3f5){logger[_0x8665('0x24')](_0x8665('0x20'),_0xfef706,_0x38e3f5);_0x5186e4(_0x38e3f5);});});}function respondWithStatusCode(_0x38a01a,_0x4aa420){_0x4aa420=_0x4aa420||0xcc;return function(_0x30cb34){if(_0x30cb34){return _0x38a01a[_0x8665('0x29')](_0x4aa420);}return _0x38a01a[_0x8665('0x2a')](_0x4aa420)[_0x8665('0x2b')]();};}function respondWithResult(_0x1d3180,_0x3c9fe3){_0x3c9fe3=_0x3c9fe3||0xc8;return function(_0x2f143f){if(_0x2f143f){return _0x1d3180[_0x8665('0x2a')](_0x3c9fe3)['json'](_0x2f143f);}};}function respondWithFilteredResult(_0x21a623,_0xa9e3){return function(_0x44e880){if(_0x44e880){var _0x5c2c1b=_0x44e880[_0x8665('0x2c')],_0x207cd7=_0xa9e3[_0x8665('0x2d')],_0x13d57a=_0xa9e3[_0x8665('0x2d')]+_0xa9e3[_0x8665('0x2e')],_0x149c8f;if(_0x13d57a>=_0x5c2c1b){_0x13d57a=_0x5c2c1b;_0x149c8f=0xc8;}else{_0x149c8f=0xce;}_0x21a623[_0x8665('0x2a')](_0x149c8f);return _0x21a623['set'](_0x8665('0x2f'),_0x207cd7+'-'+_0x13d57a+'/'+_0x5c2c1b)[_0x8665('0x30')](_0x44e880);}return null;};}function patchUpdates(_0x4ff80a){return function(_0x1e9ef1){try{jsonpatch[_0x8665('0x31')](_0x1e9ef1,_0x4ff80a,!![]);}catch(_0x303376){return BPromise['reject'](_0x303376);}return _0x1e9ef1[_0x8665('0x32')]();};}function saveUpdates(_0x51f7e0,_0x50cebb){return function(_0x1d341a){if(_0x1d341a){return _0x1d341a[_0x8665('0x33')](_0x51f7e0)[_0x8665('0x34')](function(_0x36a8b1){return _0x36a8b1;});}return null;};}function removeEntity(_0x450c01,_0x1e2525){return function(_0x1ef141){if(_0x1ef141){return _0x1ef141[_0x8665('0x35')]()['then'](function(){_0x450c01[_0x8665('0x2a')](0xcc)[_0x8665('0x2b')]();});}};}function handleEntityNotFound(_0x1496c8,_0x171405){return function(_0x40d480){if(!_0x40d480){_0x1496c8[_0x8665('0x29')](0x194);}return _0x40d480;};}function handleError(_0x2a59bf,_0x60fbc6){_0x60fbc6=_0x60fbc6||0x1f4;return function(_0xa8ad10){logger[_0x8665('0x24')](_0xa8ad10[_0x8665('0x36')]);if(_0xa8ad10[_0x8665('0x37')]){delete _0xa8ad10[_0x8665('0x37')];}_0x2a59bf[_0x8665('0x2a')](_0x60fbc6)[_0x8665('0x38')](_0xa8ad10);};}exports[_0x8665('0x39')]=function(_0x144fc9,_0x84b4c7){var _0xdb4c89={},_0x13fefb={},_0x4ab2ed={'count':0x0,'rows':[]};var _0x1e3c6e=db[_0x8665('0x3a')][_0x8665('0x3b')];_0x13fefb['model']=_[_0x8665('0x3c')](_0x1e3c6e);_0x13fefb[_0x8665('0x3d')]=_['keys'](_0x144fc9[_0x8665('0x3d')]);_0x13fefb[_0x8665('0x3e')]=_[_0x8665('0x3f')](_0x13fefb['model'],_0x13fefb['query']);_0xdb4c89[_0x8665('0x40')]=_[_0x8665('0x3f')](_0x13fefb['model'],qs['fields'](_0x144fc9[_0x8665('0x3d')][_0x8665('0x41')]));_0xdb4c89[_0x8665('0x40')]=_0xdb4c89[_0x8665('0x40')][_0x8665('0x42')]?_0xdb4c89[_0x8665('0x40')]:_0x13fefb[_0x8665('0x43')];if(!_0x144fc9[_0x8665('0x3d')][_0x8665('0x44')](_0x8665('0x45'))){_0xdb4c89['limit']=qs['limit'](_0x144fc9[_0x8665('0x3d')][_0x8665('0x2e')]);_0xdb4c89['offset']=qs[_0x8665('0x2d')](_0x144fc9[_0x8665('0x3d')][_0x8665('0x2d')]);}_0xdb4c89[_0x8665('0x46')]=qs[_0x8665('0x47')](_0x144fc9['query'][_0x8665('0x47')]);_0xdb4c89['where']=qs[_0x8665('0x3e')](_['pick'](_0x144fc9['query'],_0x13fefb[_0x8665('0x3e')]));if(_0x144fc9[_0x8665('0x3d')]['filter']){_0xdb4c89['where']=_[_0x8665('0x48')](_0xdb4c89[_0x8665('0x49')],{'$or':_[_0x8665('0x4a')](_0x1e3c6e,function(_0x52d212){if(_0x52d212['type'][_0x8665('0x4b')]!==_0x8665('0x4c')){var _0x1df130={};_0x1df130[_0x52d212[_0x8665('0x4d')]]={'$like':'%'+_0x144fc9[_0x8665('0x3d')]['filter']+'%'};return _0x1df130;}})});}_0xdb4c89=_[_0x8665('0x48')]({},_0xdb4c89,_0x144fc9[_0x8665('0x4e')]);var _0x59a5e6={'where':_0xdb4c89['where']};return db[_0x8665('0x3a')][_0x8665('0x2c')](_0x59a5e6)['then'](function(_0xa1aca9){_0x4ab2ed[_0x8665('0x2c')]=_0xa1aca9;if(_0x144fc9[_0x8665('0x3d')][_0x8665('0x4f')]){_0xdb4c89[_0x8665('0x50')]=[{'all':!![]}];}return db[_0x8665('0x3a')][_0x8665('0x51')](_0xdb4c89);})[_0x8665('0x34')](function(_0x28ea98){_0x4ab2ed[_0x8665('0x52')]=_0x28ea98;return _0x4ab2ed;})[_0x8665('0x34')](respondWithFilteredResult(_0x84b4c7,_0xdb4c89))[_0x8665('0x53')](handleError(_0x84b4c7,null));};exports[_0x8665('0x54')]=function(_0x54d892,_0x501de6){var _0x3fa95f={'raw':![],'where':{'id':_0x54d892[_0x8665('0x55')]['id']}},_0x4dba13={};_0x4dba13[_0x8665('0x43')]=_['keys'](db[_0x8665('0x3a')][_0x8665('0x3b')]);_0x4dba13[_0x8665('0x3d')]=_[_0x8665('0x3c')](_0x54d892[_0x8665('0x3d')]);_0x4dba13[_0x8665('0x3e')]=_['intersection'](_0x4dba13[_0x8665('0x43')],_0x4dba13[_0x8665('0x3d')]);_0x3fa95f['attributes']=_['intersection'](_0x4dba13[_0x8665('0x43')],qs[_0x8665('0x41')](_0x54d892[_0x8665('0x3d')][_0x8665('0x41')]));_0x3fa95f[_0x8665('0x40')]=_0x3fa95f['attributes']['length']?_0x3fa95f[_0x8665('0x40')]:_0x4dba13[_0x8665('0x43')];if(_0x54d892[_0x8665('0x3d')][_0x8665('0x4f')]){_0x3fa95f['include']=[{'all':!![]}];}_0x3fa95f=_[_0x8665('0x48')]({},_0x3fa95f,_0x54d892[_0x8665('0x4e')]);return db['VtigerConfiguration'][_0x8665('0x56')](_0x3fa95f)[_0x8665('0x34')](handleEntityNotFound(_0x501de6,null))[_0x8665('0x34')](respondWithResult(_0x501de6,null))[_0x8665('0x53')](handleError(_0x501de6,null));};exports['create']=function(_0x4ac19c,_0x414d67){return db[_0x8665('0x3a')]['create'](_0x4ac19c[_0x8665('0x57')],{})[_0x8665('0x34')](respondWithResult(_0x414d67,0xc9))[_0x8665('0x53')](handleError(_0x414d67,null));};exports[_0x8665('0x33')]=function(_0xc36520,_0x2523c1){if(_0xc36520[_0x8665('0x57')]['id']){delete _0xc36520['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xc36520['params']['id']}})['then'](handleEntityNotFound(_0x2523c1,null))[_0x8665('0x34')](saveUpdates(_0xc36520[_0x8665('0x57')],null))[_0x8665('0x34')](respondWithResult(_0x2523c1,null))[_0x8665('0x53')](handleError(_0x2523c1,null));};exports[_0x8665('0x35')]=function(_0x541ed3,_0x20a5ff){return db[_0x8665('0x3a')][_0x8665('0x56')]({'where':{'id':_0x541ed3['params']['id']}})['then'](handleEntityNotFound(_0x20a5ff,null))[_0x8665('0x34')](removeEntity(_0x20a5ff,null))[_0x8665('0x53')](handleError(_0x20a5ff,null));};exports[_0x8665('0x58')]=function(_0x4bb14a,_0x148f8e,_0x3dba1b){var _0x3f95cd={};var _0x5d1877={};var _0x5b00cb;var _0x4450be;return db[_0x8665('0x3a')][_0x8665('0x59')]({'where':{'id':_0x4bb14a[_0x8665('0x55')]['id']}})[_0x8665('0x34')](handleEntityNotFound(_0x148f8e,null))['then'](function(_0xfb604b){if(_0xfb604b){_0x5b00cb=_0xfb604b;_0x5d1877['model']=_[_0x8665('0x3c')](db[_0x8665('0x5a')][_0x8665('0x3b')]);_0x5d1877[_0x8665('0x3d')]=_[_0x8665('0x3c')](_0x4bb14a[_0x8665('0x3d')]);_0x5d1877[_0x8665('0x3e')]=_['intersection'](_0x5d1877[_0x8665('0x43')],_0x5d1877[_0x8665('0x3d')]);_0x3f95cd[_0x8665('0x40')]=_[_0x8665('0x3f')](_0x5d1877[_0x8665('0x43')],qs['fields'](_0x4bb14a[_0x8665('0x3d')][_0x8665('0x41')]));_0x3f95cd[_0x8665('0x40')]=_0x3f95cd[_0x8665('0x40')][_0x8665('0x42')]?_0x3f95cd[_0x8665('0x40')]:_0x5d1877[_0x8665('0x43')];_0x3f95cd[_0x8665('0x46')]=qs[_0x8665('0x47')](_0x4bb14a[_0x8665('0x3d')][_0x8665('0x47')]);_0x3f95cd['where']=qs[_0x8665('0x3e')](_[_0x8665('0x5b')](_0x4bb14a[_0x8665('0x3d')],_0x5d1877[_0x8665('0x3e')]));if(_0x4bb14a['query']['filter']){_0x3f95cd[_0x8665('0x49')]=_['merge'](_0x3f95cd[_0x8665('0x49')],{'$or':_[_0x8665('0x4a')](_0x3f95cd['attributes'],function(_0x425f2d){var _0x6e2a7d={};_0x6e2a7d[_0x425f2d]={'$like':'%'+_0x4bb14a['query']['filter']+'%'};return _0x6e2a7d;})});}_0x3f95cd=_[_0x8665('0x48')]({},_0x3f95cd,_0x4bb14a[_0x8665('0x4e')]);return _0x5b00cb[_0x8665('0x58')](_0x3f95cd);}})[_0x8665('0x34')](function(_0x311e59){if(_0x311e59){_0x4450be=_0x311e59[_0x8665('0x42')];if(!_0x4bb14a['query'][_0x8665('0x44')]('nolimit')){_0x3f95cd['limit']=qs[_0x8665('0x2e')](_0x4bb14a[_0x8665('0x3d')][_0x8665('0x2e')]);_0x3f95cd[_0x8665('0x2d')]=qs[_0x8665('0x2d')](_0x4bb14a[_0x8665('0x3d')][_0x8665('0x2d')]);}return _0x5b00cb[_0x8665('0x58')](_0x3f95cd);}})[_0x8665('0x34')](function(_0x3bdfee){if(_0x3bdfee){return _0x3bdfee?{'count':_0x4450be,'rows':_0x3bdfee}:null;}})['then'](respondWithResult(_0x148f8e,null))['catch'](handleError(_0x148f8e,null));};exports[_0x8665('0x5c')]=function(_0x19d895,_0x3b2d7e,_0xfaedbb){var _0x508ab3={};var _0x2236b7={};var _0x14d81a;var _0xd6b70a;return db['VtigerConfiguration'][_0x8665('0x59')]({'where':{'id':_0x19d895[_0x8665('0x55')]['id']}})['then'](handleEntityNotFound(_0x3b2d7e,null))[_0x8665('0x34')](function(_0x3f0af6){if(_0x3f0af6){_0x14d81a=_0x3f0af6;_0x2236b7[_0x8665('0x43')]=_[_0x8665('0x3c')](db['VtigerField'][_0x8665('0x3b')]);_0x2236b7['query']=_[_0x8665('0x3c')](_0x19d895[_0x8665('0x3d')]);_0x2236b7['filters']=_[_0x8665('0x3f')](_0x2236b7['model'],_0x2236b7[_0x8665('0x3d')]);_0x508ab3[_0x8665('0x40')]=_[_0x8665('0x3f')](_0x2236b7[_0x8665('0x43')],qs[_0x8665('0x41')](_0x19d895[_0x8665('0x3d')][_0x8665('0x41')]));_0x508ab3[_0x8665('0x40')]=_0x508ab3['attributes'][_0x8665('0x42')]?_0x508ab3[_0x8665('0x40')]:_0x2236b7[_0x8665('0x43')];_0x508ab3[_0x8665('0x46')]=qs[_0x8665('0x47')](_0x19d895[_0x8665('0x3d')]['sort']);_0x508ab3['where']=qs['filters'](_['pick'](_0x19d895['query'],_0x2236b7[_0x8665('0x3e')]));if(_0x19d895[_0x8665('0x3d')][_0x8665('0x5d')]){_0x508ab3['where']=_[_0x8665('0x48')](_0x508ab3[_0x8665('0x49')],{'$or':_[_0x8665('0x4a')](_0x508ab3[_0x8665('0x40')],function(_0x24cab9){var _0x98e150={};_0x98e150[_0x24cab9]={'$like':'%'+_0x19d895['query'][_0x8665('0x5d')]+'%'};return _0x98e150;})});}_0x508ab3=_['merge']({},_0x508ab3,_0x19d895[_0x8665('0x4e')]);return _0x14d81a[_0x8665('0x5c')](_0x508ab3);}})['then'](function(_0x23d03f){if(_0x23d03f){_0xd6b70a=_0x23d03f['length'];if(!_0x19d895[_0x8665('0x3d')]['hasOwnProperty'](_0x8665('0x45'))){_0x508ab3[_0x8665('0x2e')]=qs[_0x8665('0x2e')](_0x19d895[_0x8665('0x3d')][_0x8665('0x2e')]);_0x508ab3[_0x8665('0x2d')]=qs['offset'](_0x19d895['query']['offset']);}return _0x14d81a['getSubjects'](_0x508ab3);}})[_0x8665('0x34')](function(_0xa07763){if(_0xa07763){return _0xa07763?{'count':_0xd6b70a,'rows':_0xa07763}:null;}})['then'](respondWithResult(_0x3b2d7e,null))[_0x8665('0x53')](handleError(_0x3b2d7e,null));};exports[_0x8665('0x5e')]=function(_0x58f428,_0x1aa328,_0x470308){var _0x16bd7f={};var _0x1e4347={};var _0x2e90dd;var _0x267dfc;return db[_0x8665('0x3a')][_0x8665('0x59')]({'where':{'id':_0x58f428[_0x8665('0x55')]['id']}})[_0x8665('0x34')](handleEntityNotFound(_0x1aa328,null))[_0x8665('0x34')](function(_0x48b0d0){if(_0x48b0d0){_0x2e90dd=_0x48b0d0;_0x1e4347['model']=_[_0x8665('0x3c')](db[_0x8665('0x5a')][_0x8665('0x3b')]);_0x1e4347[_0x8665('0x3d')]=_[_0x8665('0x3c')](_0x58f428[_0x8665('0x3d')]);_0x1e4347[_0x8665('0x3e')]=_[_0x8665('0x3f')](_0x1e4347[_0x8665('0x43')],_0x1e4347[_0x8665('0x3d')]);_0x16bd7f['attributes']=_[_0x8665('0x3f')](_0x1e4347[_0x8665('0x43')],qs['fields'](_0x58f428['query']['fields']));_0x16bd7f[_0x8665('0x40')]=_0x16bd7f[_0x8665('0x40')]['length']?_0x16bd7f[_0x8665('0x40')]:_0x1e4347[_0x8665('0x43')];_0x16bd7f['order']=qs['sort'](_0x58f428[_0x8665('0x3d')][_0x8665('0x47')]);_0x16bd7f[_0x8665('0x49')]=qs[_0x8665('0x3e')](_[_0x8665('0x5b')](_0x58f428[_0x8665('0x3d')],_0x1e4347['filters']));if(_0x58f428[_0x8665('0x3d')][_0x8665('0x5d')]){_0x16bd7f[_0x8665('0x49')]=_[_0x8665('0x48')](_0x16bd7f[_0x8665('0x49')],{'$or':_['map'](_0x16bd7f[_0x8665('0x40')],function(_0xe2117f){var _0x5a16ea={};_0x5a16ea[_0xe2117f]={'$like':'%'+_0x58f428[_0x8665('0x3d')][_0x8665('0x5d')]+'%'};return _0x5a16ea;})});}_0x16bd7f=_[_0x8665('0x48')]({},_0x16bd7f,_0x58f428[_0x8665('0x4e')]);return _0x2e90dd[_0x8665('0x5e')](_0x16bd7f);}})['then'](function(_0x1cce44){if(_0x1cce44){_0x267dfc=_0x1cce44[_0x8665('0x42')];if(!_0x58f428[_0x8665('0x3d')][_0x8665('0x44')]('nolimit')){_0x16bd7f[_0x8665('0x2e')]=qs[_0x8665('0x2e')](_0x58f428[_0x8665('0x3d')]['limit']);_0x16bd7f[_0x8665('0x2d')]=qs['offset'](_0x58f428['query'][_0x8665('0x2d')]);}return _0x2e90dd[_0x8665('0x5e')](_0x16bd7f);}})['then'](function(_0x39f1b6){if(_0x39f1b6){return _0x39f1b6?{'count':_0x267dfc,'rows':_0x39f1b6}:null;}})['then'](respondWithResult(_0x1aa328,null))[_0x8665('0x53')](handleError(_0x1aa328,null));}; \ No newline at end of file +var _0xc560=['stack','name','send','index','VtigerConfiguration','rawAttributes','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','where','count','findAll','show','keys','intersection','include','find','update','body','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','html-pdf','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','status','json','offset','limit','set','Content-Range','apply','save','then','destroy','end','sendStatus'];(function(_0x2fb264,_0x2e3ebb){var _0x433fe1=function(_0x1dea17){while(--_0x1dea17){_0x2fb264['push'](_0x2fb264['shift']());}};_0x433fe1(++_0x2e3ebb);}(_0xc560,0x82));var _0x0c56=function(_0x2c3a5e,_0x582a94){_0x2c3a5e=_0x2c3a5e-0x0;var _0x3c0e5d=_0xc560[_0x2c3a5e];return _0x3c0e5d;};'use strict';var pdf=require(_0x0c56('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0c56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c56('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c56('0x3'));var Mustache=require(_0x0c56('0x4'));var util=require(_0x0c56('0x5'));var path=require(_0x0c56('0x6'));var sox=require('sox');var csv=require(_0x0c56('0x7'));var ejs=require(_0x0c56('0x8'));var fs=require('fs');var _=require(_0x0c56('0x9'));var squel=require(_0x0c56('0xa'));var crypto=require('crypto');var jsforce=require(_0x0c56('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0c56('0x7'));var querystring=require(_0x0c56('0xc'));var Papa=require(_0x0c56('0xd'));var Redis=require('ioredis');var authService=require(_0x0c56('0xe'));var qs=require(_0x0c56('0xf'));var hardwareService=require(_0x0c56('0x10'));var logger=require('../../config/logger')(_0x0c56('0x11'));var utils=require(_0x0c56('0x12'));var config=require(_0x0c56('0x13'));var db=require(_0x0c56('0x14'))['db'];var jayson=require(_0x0c56('0x15'));var client=jayson[_0x0c56('0x16')][_0x0c56('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5217f9,_0x49f070,_0x2eab48){if(_0x2eab48){var _0x3220b1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3220b1[_0x0c56('0x18')](_0x49f070)){return _0x5217f9;}else{throw new Error(_0x0c56('0x19'));}}else{return _0x5217f9;}}function respondWithRpcPromise(_0x2b220b,_0xdc4827,_0x57e26b,_0x459895){return new BPromise(function(_0x243fc1,_0x218fd7){var _0x8ce88b=_0x459895||client;return _0x8ce88b[_0x0c56('0x1a')](_0x2b220b,_0x57e26b)['then'](function(_0x2a28ea){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0xdc4827,_0x0c56('0x1b'));logger['debug'](_0x0c56('0x1c'),_0xdc4827,'request\x20sent',JSON['stringify'](_0x2a28ea));if(_0x2a28ea[_0x0c56('0x1d')]){if(_0x2a28ea[_0x0c56('0x1d')][_0x0c56('0x1e')]===0x1f4){logger[_0x0c56('0x1d')](_0x0c56('0x1f'),_0xdc4827,_0x2a28ea[_0x0c56('0x1d')][_0x0c56('0x20')]);return _0x218fd7(_0x2a28ea[_0x0c56('0x1d')][_0x0c56('0x20')]);}logger[_0x0c56('0x1d')](_0x0c56('0x1f'),_0xdc4827,_0x2a28ea[_0x0c56('0x1d')]['message']);return _0x243fc1(_0x2a28ea['error'][_0x0c56('0x20')]);}else{logger[_0x0c56('0x21')](_0x0c56('0x1f'),_0xdc4827,_0x0c56('0x1b'));_0x243fc1(_0x2a28ea[_0x0c56('0x22')]['message']);}})[_0x0c56('0x23')](function(_0x1b6812){logger[_0x0c56('0x1d')](_0x0c56('0x1f'),_0xdc4827,_0x1b6812);_0x218fd7(_0x1b6812);});});}function respondWithStatusCode(_0x3bd6d4,_0x48ced5){_0x48ced5=_0x48ced5||0xcc;return function(_0x2b0c65){if(_0x2b0c65){return _0x3bd6d4['sendStatus'](_0x48ced5);}return _0x3bd6d4[_0x0c56('0x24')](_0x48ced5)['end']();};}function respondWithResult(_0x13b00b,_0x1f2b4a){_0x1f2b4a=_0x1f2b4a||0xc8;return function(_0x885e5c){if(_0x885e5c){return _0x13b00b[_0x0c56('0x24')](_0x1f2b4a)[_0x0c56('0x25')](_0x885e5c);}};}function respondWithFilteredResult(_0x5189e4,_0x2cbe87){return function(_0x5c1495){if(_0x5c1495){var _0x156fa0=_0x5c1495['count'],_0x3a8f23=_0x2cbe87[_0x0c56('0x26')],_0x5f2077=_0x2cbe87[_0x0c56('0x26')]+_0x2cbe87[_0x0c56('0x27')],_0x23fd09;if(_0x5f2077>=_0x156fa0){_0x5f2077=_0x156fa0;_0x23fd09=0xc8;}else{_0x23fd09=0xce;}_0x5189e4[_0x0c56('0x24')](_0x23fd09);return _0x5189e4[_0x0c56('0x28')](_0x0c56('0x29'),_0x3a8f23+'-'+_0x5f2077+'/'+_0x156fa0)[_0x0c56('0x25')](_0x5c1495);}return null;};}function patchUpdates(_0xb5a21a){return function(_0x5cb12a){try{jsonpatch[_0x0c56('0x2a')](_0x5cb12a,_0xb5a21a,!![]);}catch(_0x10930f){return BPromise['reject'](_0x10930f);}return _0x5cb12a[_0x0c56('0x2b')]();};}function saveUpdates(_0x3a70a2,_0x43c029){return function(_0xa4a241){if(_0xa4a241){return _0xa4a241['update'](_0x3a70a2)[_0x0c56('0x2c')](function(_0x10442e){return _0x10442e;});}return null;};}function removeEntity(_0x5ef030,_0x33b1ca){return function(_0x58ea9e){if(_0x58ea9e){return _0x58ea9e[_0x0c56('0x2d')]()[_0x0c56('0x2c')](function(){_0x5ef030[_0x0c56('0x24')](0xcc)[_0x0c56('0x2e')]();});}};}function handleEntityNotFound(_0x42fd9b,_0x25ca79){return function(_0x5a445e){if(!_0x5a445e){_0x42fd9b[_0x0c56('0x2f')](0x194);}return _0x5a445e;};}function handleError(_0x24472a,_0x588706){_0x588706=_0x588706||0x1f4;return function(_0x30dd0d){logger[_0x0c56('0x1d')](_0x30dd0d[_0x0c56('0x30')]);if(_0x30dd0d[_0x0c56('0x31')]){delete _0x30dd0d[_0x0c56('0x31')];}_0x24472a[_0x0c56('0x24')](_0x588706)[_0x0c56('0x32')](_0x30dd0d);};}exports[_0x0c56('0x33')]=function(_0x1b516d,_0xd66c84){var _0x12aca5={},_0x54e7dc={},_0x4a11b6={'count':0x0,'rows':[]};var _0xf573fe=db[_0x0c56('0x34')][_0x0c56('0x35')];_0x54e7dc[_0x0c56('0x36')]=_['keys'](_0xf573fe);_0x54e7dc[_0x0c56('0x37')]=_['keys'](_0x1b516d[_0x0c56('0x37')]);_0x54e7dc['filters']=_['intersection'](_0x54e7dc[_0x0c56('0x36')],_0x54e7dc[_0x0c56('0x37')]);_0x12aca5['attributes']=_['intersection'](_0x54e7dc[_0x0c56('0x36')],qs['fields'](_0x1b516d[_0x0c56('0x37')][_0x0c56('0x38')]));_0x12aca5[_0x0c56('0x39')]=_0x12aca5[_0x0c56('0x39')][_0x0c56('0x3a')]?_0x12aca5[_0x0c56('0x39')]:_0x54e7dc[_0x0c56('0x36')];if(!_0x1b516d['query'][_0x0c56('0x3b')](_0x0c56('0x3c'))){_0x12aca5[_0x0c56('0x27')]=qs['limit'](_0x1b516d['query'][_0x0c56('0x27')]);_0x12aca5[_0x0c56('0x26')]=qs[_0x0c56('0x26')](_0x1b516d[_0x0c56('0x37')][_0x0c56('0x26')]);}_0x12aca5['order']=qs[_0x0c56('0x3d')](_0x1b516d[_0x0c56('0x37')]['sort']);_0x12aca5['where']=qs[_0x0c56('0x3e')](_[_0x0c56('0x3f')](_0x1b516d['query'],_0x54e7dc[_0x0c56('0x3e')]));if(_0x1b516d[_0x0c56('0x37')][_0x0c56('0x40')]){_0x12aca5['where']=_[_0x0c56('0x41')](_0x12aca5['where'],{'$or':_[_0x0c56('0x42')](_0xf573fe,function(_0x48bbab){if(_0x48bbab[_0x0c56('0x43')][_0x0c56('0x44')]!==_0x0c56('0x45')){var _0x73ba9={};_0x73ba9[_0x48bbab[_0x0c56('0x46')]]={'$like':'%'+_0x1b516d[_0x0c56('0x37')][_0x0c56('0x40')]+'%'};return _0x73ba9;}})});}_0x12aca5=_[_0x0c56('0x41')]({},_0x12aca5,_0x1b516d[_0x0c56('0x47')]);var _0xe7ac6b={'where':_0x12aca5[_0x0c56('0x48')]};return db[_0x0c56('0x34')][_0x0c56('0x49')](_0xe7ac6b)[_0x0c56('0x2c')](function(_0x98f0fb){_0x4a11b6[_0x0c56('0x49')]=_0x98f0fb;if(_0x1b516d['query']['includeAll']){_0x12aca5['include']=[{'all':!![]}];}return db[_0x0c56('0x34')][_0x0c56('0x4a')](_0x12aca5);})['then'](function(_0x1ee2fa){_0x4a11b6['rows']=_0x1ee2fa;return _0x4a11b6;})[_0x0c56('0x2c')](respondWithFilteredResult(_0xd66c84,_0x12aca5))['catch'](handleError(_0xd66c84,null));};exports[_0x0c56('0x4b')]=function(_0x169f8b,_0x120bb6){var _0x447723={'raw':![],'where':{'id':_0x169f8b['params']['id']}},_0x15ec0d={};_0x15ec0d[_0x0c56('0x36')]=_[_0x0c56('0x4c')](db['VtigerConfiguration']['rawAttributes']);_0x15ec0d[_0x0c56('0x37')]=_[_0x0c56('0x4c')](_0x169f8b[_0x0c56('0x37')]);_0x15ec0d[_0x0c56('0x3e')]=_[_0x0c56('0x4d')](_0x15ec0d[_0x0c56('0x36')],_0x15ec0d[_0x0c56('0x37')]);_0x447723[_0x0c56('0x39')]=_['intersection'](_0x15ec0d[_0x0c56('0x36')],qs['fields'](_0x169f8b[_0x0c56('0x37')][_0x0c56('0x38')]));_0x447723[_0x0c56('0x39')]=_0x447723[_0x0c56('0x39')][_0x0c56('0x3a')]?_0x447723['attributes']:_0x15ec0d[_0x0c56('0x36')];if(_0x169f8b[_0x0c56('0x37')]['includeAll']){_0x447723[_0x0c56('0x4e')]=[{'all':!![]}];}_0x447723=_['merge']({},_0x447723,_0x169f8b[_0x0c56('0x47')]);return db['VtigerConfiguration'][_0x0c56('0x4f')](_0x447723)[_0x0c56('0x2c')](handleEntityNotFound(_0x120bb6,null))[_0x0c56('0x2c')](respondWithResult(_0x120bb6,null))['catch'](handleError(_0x120bb6,null));};exports['create']=function(_0x5a964c,_0x819d94){return db['VtigerConfiguration']['create'](_0x5a964c['body'],{})[_0x0c56('0x2c')](respondWithResult(_0x819d94,0xc9))['catch'](handleError(_0x819d94,null));};exports[_0x0c56('0x50')]=function(_0x1f7711,_0x503e15){if(_0x1f7711[_0x0c56('0x51')]['id']){delete _0x1f7711[_0x0c56('0x51')]['id'];}return db[_0x0c56('0x34')][_0x0c56('0x4f')]({'where':{'id':_0x1f7711[_0x0c56('0x52')]['id']}})[_0x0c56('0x2c')](handleEntityNotFound(_0x503e15,null))[_0x0c56('0x2c')](saveUpdates(_0x1f7711[_0x0c56('0x51')],null))[_0x0c56('0x2c')](respondWithResult(_0x503e15,null))[_0x0c56('0x23')](handleError(_0x503e15,null));};exports[_0x0c56('0x2d')]=function(_0x1ba609,_0x39f4d8){return db[_0x0c56('0x34')][_0x0c56('0x4f')]({'where':{'id':_0x1ba609[_0x0c56('0x52')]['id']}})[_0x0c56('0x2c')](handleEntityNotFound(_0x39f4d8,null))[_0x0c56('0x2c')](removeEntity(_0x39f4d8,null))['catch'](handleError(_0x39f4d8,null));};exports[_0x0c56('0x53')]=function(_0x8eb537,_0x27b7d9,_0x20b396){var _0x4ae41e={};var _0x2bff07={};var _0x1048af;var _0x2bcd0f;return db[_0x0c56('0x34')][_0x0c56('0x54')]({'where':{'id':_0x8eb537['params']['id']}})[_0x0c56('0x2c')](handleEntityNotFound(_0x27b7d9,null))[_0x0c56('0x2c')](function(_0x111cc3){if(_0x111cc3){_0x1048af=_0x111cc3;_0x2bff07[_0x0c56('0x36')]=_[_0x0c56('0x4c')](db[_0x0c56('0x55')][_0x0c56('0x35')]);_0x2bff07[_0x0c56('0x37')]=_[_0x0c56('0x4c')](_0x8eb537['query']);_0x2bff07[_0x0c56('0x3e')]=_[_0x0c56('0x4d')](_0x2bff07[_0x0c56('0x36')],_0x2bff07[_0x0c56('0x37')]);_0x4ae41e[_0x0c56('0x39')]=_[_0x0c56('0x4d')](_0x2bff07[_0x0c56('0x36')],qs[_0x0c56('0x38')](_0x8eb537[_0x0c56('0x37')][_0x0c56('0x38')]));_0x4ae41e['attributes']=_0x4ae41e[_0x0c56('0x39')][_0x0c56('0x3a')]?_0x4ae41e['attributes']:_0x2bff07[_0x0c56('0x36')];_0x4ae41e[_0x0c56('0x56')]=qs[_0x0c56('0x3d')](_0x8eb537[_0x0c56('0x37')][_0x0c56('0x3d')]);_0x4ae41e[_0x0c56('0x48')]=qs[_0x0c56('0x3e')](_['pick'](_0x8eb537[_0x0c56('0x37')],_0x2bff07[_0x0c56('0x3e')]));if(_0x8eb537['query'][_0x0c56('0x40')]){_0x4ae41e[_0x0c56('0x48')]=_[_0x0c56('0x41')](_0x4ae41e[_0x0c56('0x48')],{'$or':_[_0x0c56('0x42')](_0x4ae41e['attributes'],function(_0x2f2e43){var _0x460d21={};_0x460d21[_0x2f2e43]={'$like':'%'+_0x8eb537[_0x0c56('0x37')][_0x0c56('0x40')]+'%'};return _0x460d21;})});}_0x4ae41e=_['merge']({},_0x4ae41e,_0x8eb537['options']);return _0x1048af[_0x0c56('0x53')](_0x4ae41e);}})[_0x0c56('0x2c')](function(_0x300d77){if(_0x300d77){_0x2bcd0f=_0x300d77['length'];if(!_0x8eb537[_0x0c56('0x37')][_0x0c56('0x3b')](_0x0c56('0x3c'))){_0x4ae41e[_0x0c56('0x27')]=qs[_0x0c56('0x27')](_0x8eb537['query'][_0x0c56('0x27')]);_0x4ae41e['offset']=qs[_0x0c56('0x26')](_0x8eb537['query'][_0x0c56('0x26')]);}return _0x1048af[_0x0c56('0x53')](_0x4ae41e);}})[_0x0c56('0x2c')](function(_0x51e8e8){if(_0x51e8e8){return _0x51e8e8?{'count':_0x2bcd0f,'rows':_0x51e8e8}:null;}})['then'](respondWithResult(_0x27b7d9,null))[_0x0c56('0x23')](handleError(_0x27b7d9,null));};exports[_0x0c56('0x57')]=function(_0x293648,_0x345351,_0x22401e){var _0x2edb20={};var _0x3d1169={};var _0x5a9e5f;var _0x420cc5;return db[_0x0c56('0x34')][_0x0c56('0x54')]({'where':{'id':_0x293648[_0x0c56('0x52')]['id']}})['then'](handleEntityNotFound(_0x345351,null))['then'](function(_0x265441){if(_0x265441){_0x5a9e5f=_0x265441;_0x3d1169[_0x0c56('0x36')]=_[_0x0c56('0x4c')](db[_0x0c56('0x55')][_0x0c56('0x35')]);_0x3d1169[_0x0c56('0x37')]=_[_0x0c56('0x4c')](_0x293648[_0x0c56('0x37')]);_0x3d1169[_0x0c56('0x3e')]=_[_0x0c56('0x4d')](_0x3d1169[_0x0c56('0x36')],_0x3d1169['query']);_0x2edb20[_0x0c56('0x39')]=_[_0x0c56('0x4d')](_0x3d1169[_0x0c56('0x36')],qs[_0x0c56('0x38')](_0x293648[_0x0c56('0x37')][_0x0c56('0x38')]));_0x2edb20[_0x0c56('0x39')]=_0x2edb20[_0x0c56('0x39')]['length']?_0x2edb20[_0x0c56('0x39')]:_0x3d1169['model'];_0x2edb20[_0x0c56('0x56')]=qs[_0x0c56('0x3d')](_0x293648['query'][_0x0c56('0x3d')]);_0x2edb20[_0x0c56('0x48')]=qs[_0x0c56('0x3e')](_[_0x0c56('0x3f')](_0x293648[_0x0c56('0x37')],_0x3d1169['filters']));if(_0x293648['query']['filter']){_0x2edb20['where']=_[_0x0c56('0x41')](_0x2edb20[_0x0c56('0x48')],{'$or':_[_0x0c56('0x42')](_0x2edb20[_0x0c56('0x39')],function(_0x1d3737){var _0x3649c={};_0x3649c[_0x1d3737]={'$like':'%'+_0x293648[_0x0c56('0x37')]['filter']+'%'};return _0x3649c;})});}_0x2edb20=_[_0x0c56('0x41')]({},_0x2edb20,_0x293648[_0x0c56('0x47')]);return _0x5a9e5f['getSubjects'](_0x2edb20);}})[_0x0c56('0x2c')](function(_0x4c388d){if(_0x4c388d){_0x420cc5=_0x4c388d['length'];if(!_0x293648[_0x0c56('0x37')]['hasOwnProperty']('nolimit')){_0x2edb20[_0x0c56('0x27')]=qs[_0x0c56('0x27')](_0x293648['query']['limit']);_0x2edb20[_0x0c56('0x26')]=qs[_0x0c56('0x26')](_0x293648[_0x0c56('0x37')][_0x0c56('0x26')]);}return _0x5a9e5f['getSubjects'](_0x2edb20);}})[_0x0c56('0x2c')](function(_0x594fc9){if(_0x594fc9){return _0x594fc9?{'count':_0x420cc5,'rows':_0x594fc9}:null;}})[_0x0c56('0x2c')](respondWithResult(_0x345351,null))['catch'](handleError(_0x345351,null));};exports[_0x0c56('0x58')]=function(_0x464dd4,_0x4e5e85,_0x12be5c){var _0x61d082={};var _0x3853f8={};var _0x4e0836;var _0x3454c7;return db['VtigerConfiguration'][_0x0c56('0x54')]({'where':{'id':_0x464dd4['params']['id']}})[_0x0c56('0x2c')](handleEntityNotFound(_0x4e5e85,null))[_0x0c56('0x2c')](function(_0x1ac4e3){if(_0x1ac4e3){_0x4e0836=_0x1ac4e3;_0x3853f8[_0x0c56('0x36')]=_['keys'](db['VtigerField'][_0x0c56('0x35')]);_0x3853f8[_0x0c56('0x37')]=_[_0x0c56('0x4c')](_0x464dd4['query']);_0x3853f8[_0x0c56('0x3e')]=_[_0x0c56('0x4d')](_0x3853f8[_0x0c56('0x36')],_0x3853f8[_0x0c56('0x37')]);_0x61d082[_0x0c56('0x39')]=_[_0x0c56('0x4d')](_0x3853f8[_0x0c56('0x36')],qs[_0x0c56('0x38')](_0x464dd4['query'][_0x0c56('0x38')]));_0x61d082[_0x0c56('0x39')]=_0x61d082['attributes']['length']?_0x61d082['attributes']:_0x3853f8['model'];_0x61d082['order']=qs[_0x0c56('0x3d')](_0x464dd4[_0x0c56('0x37')][_0x0c56('0x3d')]);_0x61d082[_0x0c56('0x48')]=qs[_0x0c56('0x3e')](_[_0x0c56('0x3f')](_0x464dd4['query'],_0x3853f8['filters']));if(_0x464dd4[_0x0c56('0x37')][_0x0c56('0x40')]){_0x61d082['where']=_[_0x0c56('0x41')](_0x61d082[_0x0c56('0x48')],{'$or':_[_0x0c56('0x42')](_0x61d082['attributes'],function(_0x37ee61){var _0xa266f0={};_0xa266f0[_0x37ee61]={'$like':'%'+_0x464dd4['query'][_0x0c56('0x40')]+'%'};return _0xa266f0;})});}_0x61d082=_[_0x0c56('0x41')]({},_0x61d082,_0x464dd4['options']);return _0x4e0836['getDescriptions'](_0x61d082);}})[_0x0c56('0x2c')](function(_0x183f61){if(_0x183f61){_0x3454c7=_0x183f61[_0x0c56('0x3a')];if(!_0x464dd4[_0x0c56('0x37')][_0x0c56('0x3b')](_0x0c56('0x3c'))){_0x61d082['limit']=qs[_0x0c56('0x27')](_0x464dd4[_0x0c56('0x37')][_0x0c56('0x27')]);_0x61d082['offset']=qs[_0x0c56('0x26')](_0x464dd4['query'][_0x0c56('0x26')]);}return _0x4e0836[_0x0c56('0x58')](_0x61d082);}})['then'](function(_0x22cb46){if(_0x22cb46){return _0x22cb46?{'count':_0x3454c7,'rows':_0x22cb46}:null;}})[_0x0c56('0x2c')](respondWithResult(_0x4e5e85,null))['catch'](handleError(_0x4e5e85,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1aeb1e5..35537c2 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x524be8,_0x5a9e32){var _0x88c39b=function(_0x1163a1){while(--_0x1163a1){_0x524be8['push'](_0x524be8['shift']());}};_0x88c39b(++_0x5a9e32);}(_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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5bd891,_0x15cc38){var _0x420c11=function(_0x3888de){while(--_0x3888de){_0x5bd891['push'](_0x5bd891['shift']());}};_0x420c11(++_0x15cc38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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':'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 46a8eba..691cfcc 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 _0x5a51=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x16e5bc,_0x4209bf){var _0x267b1b=function(_0x170b0f){while(--_0x170b0f){_0x16e5bc['push'](_0x16e5bc['shift']());}};_0x267b1b(++_0x4209bf);}(_0x5a51,0x175));var _0x15a5=function(_0x301aee,_0x3b4189){_0x301aee=_0x301aee-0x0;var _0x1dc9b4=_0x5a51[_0x301aee];return _0x1dc9b4;};'use strict';var _=require(_0x15a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x15a5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15a5('0x2'));var db=require(_0x15a5('0x3'))['db'];var utils=require(_0x15a5('0x4'));var logger=require(_0x15a5('0x5'))(_0x15a5('0x6'));var config=require(_0x15a5('0x7'));var jayson=require(_0x15a5('0x8'));var client=jayson[_0x15a5('0x9')][_0x15a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15ee59,_0x45d311,_0x287387){return new BPromise(function(_0x1a85c3,_0x145102){return client[_0x15a5('0xb')](_0x15ee59,_0x287387)[_0x15a5('0xc')](function(_0x85fbe3){logger[_0x15a5('0xd')](_0x15a5('0xe'),_0x45d311,'request\x20sent');logger[_0x15a5('0xf')](_0x15a5('0x10'),_0x45d311,_0x15a5('0x11'),JSON[_0x15a5('0x12')](_0x85fbe3));if(_0x85fbe3[_0x15a5('0x13')]){if(_0x85fbe3['error']['code']===0x1f4){logger[_0x15a5('0x13')](_0x15a5('0xe'),_0x45d311,_0x85fbe3[_0x15a5('0x13')][_0x15a5('0x14')]);return _0x145102(_0x85fbe3[_0x15a5('0x13')][_0x15a5('0x14')]);}logger[_0x15a5('0x13')](_0x15a5('0xe'),_0x45d311,_0x85fbe3[_0x15a5('0x13')][_0x15a5('0x14')]);return _0x1a85c3(_0x85fbe3['error'][_0x15a5('0x14')]);}else{logger[_0x15a5('0xd')](_0x15a5('0xe'),_0x45d311,'request\x20sent');_0x1a85c3(_0x85fbe3['result'][_0x15a5('0x14')]);}})[_0x15a5('0x15')](function(_0x500b87){logger[_0x15a5('0x13')](_0x15a5('0xe'),_0x45d311,_0x500b87);_0x145102(_0x500b87);});});} \ No newline at end of file +var _0x8a17=['jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49ba75,_0x414a0f){var _0x4656e4=function(_0x112c0d){while(--_0x112c0d){_0x49ba75['push'](_0x49ba75['shift']());}};_0x4656e4(++_0x414a0f);}(_0x8a17,0x1ee));var _0x78a1=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x8a17[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0x78a1('0x0'));var util=require(_0x78a1('0x1'));var moment=require(_0x78a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x78a1('0x3'));var fs=require('fs');var Redis=require(_0x78a1('0x4'));var db=require(_0x78a1('0x5'))['db'];var utils=require(_0x78a1('0x6'));var logger=require(_0x78a1('0x7'))(_0x78a1('0x8'));var config=require(_0x78a1('0x9'));var jayson=require(_0x78a1('0xa'));var client=jayson[_0x78a1('0xb')][_0x78a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cc2bc,_0x3580fd,_0x2094a0){return new BPromise(function(_0x3aa00c,_0x388132){return client[_0x78a1('0xd')](_0x1cc2bc,_0x2094a0)[_0x78a1('0xe')](function(_0x5827f7){logger[_0x78a1('0xf')](_0x78a1('0x10'),_0x3580fd,_0x78a1('0x11'));logger[_0x78a1('0x12')](_0x78a1('0x13'),_0x3580fd,_0x78a1('0x11'),JSON[_0x78a1('0x14')](_0x5827f7));if(_0x5827f7['error']){if(_0x5827f7[_0x78a1('0x15')]['code']===0x1f4){logger[_0x78a1('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x3580fd,_0x5827f7['error'][_0x78a1('0x16')]);return _0x388132(_0x5827f7[_0x78a1('0x15')][_0x78a1('0x16')]);}logger[_0x78a1('0x15')](_0x78a1('0x10'),_0x3580fd,_0x5827f7[_0x78a1('0x15')][_0x78a1('0x16')]);return _0x3aa00c(_0x5827f7[_0x78a1('0x15')]['message']);}else{logger[_0x78a1('0xf')](_0x78a1('0x10'),_0x3580fd,_0x78a1('0x11'));_0x3aa00c(_0x5827f7['result'][_0x78a1('0x16')]);}})[_0x78a1('0x17')](function(_0x7cd93b){logger[_0x78a1('0x15')](_0x78a1('0x10'),_0x3580fd,_0x7cd93b);_0x388132(_0x7cd93b);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 48ea312..4a61149 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 _0x911e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','multer'];(function(_0x25ec59,_0x51d50c){var _0x594d90=function(_0x3f03b7){while(--_0x3f03b7){_0x25ec59['push'](_0x25ec59['shift']());}};_0x594d90(++_0x51d50c);}(_0x911e,0x1c7));var _0xe911=function(_0x8f5a02,_0x353208){_0x8f5a02=_0x8f5a02-0x0;var _0x5396a0=_0x911e[_0x8f5a02];return _0x5396a0;};'use strict';var multer=require(_0xe911('0x0'));var util=require('util');var path=require(_0xe911('0x1'));var timeout=require(_0xe911('0x2'));var express=require(_0xe911('0x3'));var router=express[_0xe911('0x4')]();var auth=require(_0xe911('0x5'));var interaction=require(_0xe911('0x6'));var config=require(_0xe911('0x7'));var controller=require(_0xe911('0x8'));router[_0xe911('0x9')]('/',auth['isAuthenticated'](),controller[_0xe911('0xa')]);router[_0xe911('0x9')](_0xe911('0xb'),auth[_0xe911('0xc')](),controller[_0xe911('0xd')]);router['post']('/',auth[_0xe911('0xc')](),controller[_0xe911('0xe')]);router[_0xe911('0xf')](_0xe911('0xb'),auth[_0xe911('0xc')](),controller[_0xe911('0x10')]);router[_0xe911('0x11')](_0xe911('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe911('0x12')]=router; \ No newline at end of file +var _0xa08a=['index','/:id','isAuthenticated','show','post','create','put','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x220e59,_0x239bdd){var _0x1baece=function(_0x4a6f28){while(--_0x4a6f28){_0x220e59['push'](_0x220e59['shift']());}};_0x1baece(++_0x239bdd);}(_0xa08a,0x6f));var _0xaa08=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xa08a[_0x3b19ea];return _0x40ece9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa08('0x0'));var timeout=require(_0xaa08('0x1'));var express=require('express');var router=express[_0xaa08('0x2')]();var auth=require(_0xaa08('0x3'));var interaction=require(_0xaa08('0x4'));var config=require(_0xaa08('0x5'));var controller=require(_0xaa08('0x6'));router[_0xaa08('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa08('0x8')]);router[_0xaa08('0x7')](_0xaa08('0x9'),auth[_0xaa08('0xa')](),controller[_0xaa08('0xb')]);router[_0xaa08('0xc')]('/',auth['isAuthenticated'](),controller[_0xaa08('0xd')]);router[_0xaa08('0xe')](_0xaa08('0x9'),auth[_0xaa08('0xa')](),controller['update']);router['delete'](_0xaa08('0x9'),auth[_0xaa08('0xa')](),controller[_0xaa08('0xf')]);module[_0xaa08('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index d5b6eae..335e7ec 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 _0x55e0=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4fadb8,_0x11b539){var _0x3c9e20=function(_0x134c11){while(--_0x134c11){_0x4fadb8['push'](_0x4fadb8['shift']());}};_0x3c9e20(++_0x11b539);}(_0x55e0,0xdc));var _0x055e=function(_0x134790,_0x3c17d6){_0x134790=_0x134790-0x0;var _0x3aeeee=_0x55e0[_0x134790];return _0x3aeeee;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable',_0x055e('0x4')),'defaultValue':_0x055e('0x3')},'content':{'type':Sequelize[_0x055e('0x5')]},'key':{'type':Sequelize[_0x055e('0x5')]},'keyType':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x055e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x055e('0x5')]},'customField':{'type':Sequelize[_0x055e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055e('0x5')]}}; \ No newline at end of file +var _0x702d=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x1f4748,_0x40ed23){var _0x4745e5=function(_0x1b63c6){while(--_0x1b63c6){_0x1f4748['push'](_0x1f4748['shift']());}};_0x4745e5(++_0x40ed23);}(_0x702d,0x147));var _0xd702=function(_0x135532,_0x5c48c5){_0x135532=_0x135532-0x0;var _0x5bcb91=_0x702d[_0x135532];return _0x5bcb91;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'type':{'type':Sequelize[_0xd702('0x2')](_0xd702('0x3'),_0xd702('0x4'),'customVariable',_0xd702('0x5')),'defaultValue':_0xd702('0x3')},'content':{'type':Sequelize[_0xd702('0x6')]},'key':{'type':Sequelize[_0xd702('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd702('0x3'),'variable',_0xd702('0x7'))},'keyContent':{'type':Sequelize[_0xd702('0x6')]},'idField':{'type':Sequelize[_0xd702('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 2347781..fbf4daf 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 _0x7fbe=['apply','reject','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json'];(function(_0x2b4f3b,_0x45e740){var _0x34a8bc=function(_0x4bfbbc){while(--_0x4bfbbc){_0x2b4f3b['push'](_0x2b4f3b['shift']());}};_0x34a8bc(++_0x45e740);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x34fab4,_0x194738){_0x34fab4=_0x34fab4-0x0;var _0x42fa5c=_0x7fbe[_0x34fab4];return _0x42fa5c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var hardwareService=require(_0xe7fb('0x13'));var logger=require(_0xe7fb('0x14'))(_0xe7fb('0x15'));var utils=require(_0xe7fb('0x16'));var config=require(_0xe7fb('0x17'));var db=require(_0xe7fb('0x18'))['db'];function respondWithStatusCode(_0x325035,_0x2fe8ab){_0x2fe8ab=_0x2fe8ab||0xcc;return function(_0x2437d4){if(_0x2437d4){return _0x325035[_0xe7fb('0x19')](_0x2fe8ab);}return _0x325035[_0xe7fb('0x1a')](_0x2fe8ab)[_0xe7fb('0x1b')]();};}function respondWithResult(_0x7fe4d3,_0x598729){_0x598729=_0x598729||0xc8;return function(_0x278b75){if(_0x278b75){return _0x7fe4d3[_0xe7fb('0x1a')](_0x598729)['json'](_0x278b75);}};}function respondWithFilteredResult(_0x30015a,_0x37eb9f){return function(_0x482f7d){if(_0x482f7d){var _0xa76acf=_0x482f7d[_0xe7fb('0x1c')],_0x559129=_0x37eb9f[_0xe7fb('0x1d')],_0x12fff6=_0x37eb9f['offset']+_0x37eb9f[_0xe7fb('0x1e')],_0x18d23c;if(_0x12fff6>=_0xa76acf){_0x12fff6=_0xa76acf;_0x18d23c=0xc8;}else{_0x18d23c=0xce;}_0x30015a['status'](_0x18d23c);return _0x30015a[_0xe7fb('0x1f')]('Content-Range',_0x559129+'-'+_0x12fff6+'/'+_0xa76acf)[_0xe7fb('0x20')](_0x482f7d);}return null;};}function patchUpdates(_0x4708f7){return function(_0x3f96a7){try{jsonpatch[_0xe7fb('0x21')](_0x3f96a7,_0x4708f7,!![]);}catch(_0x5df1a1){return BPromise[_0xe7fb('0x22')](_0x5df1a1);}return _0x3f96a7['save']();};}function saveUpdates(_0x11cae0,_0x51f01f){return function(_0x15f7a4){if(_0x15f7a4){return _0x15f7a4['update'](_0x11cae0)[_0xe7fb('0x23')](function(_0x135624){return _0x135624;});}return null;};}function removeEntity(_0x4a9994,_0x143eb6){return function(_0x4742bd){if(_0x4742bd){return _0x4742bd[_0xe7fb('0x24')]()['then'](function(){_0x4a9994[_0xe7fb('0x1a')](0xcc)[_0xe7fb('0x1b')]();});}};}function handleEntityNotFound(_0x5da3d9,_0x5bea27){return function(_0x52f08b){if(!_0x52f08b){_0x5da3d9[_0xe7fb('0x19')](0x194);}return _0x52f08b;};}function handleError(_0x53c43a,_0x49b219){_0x49b219=_0x49b219||0x1f4;return function(_0x4026b1){logger[_0xe7fb('0x25')](_0x4026b1[_0xe7fb('0x26')]);if(_0x4026b1['name']){delete _0x4026b1[_0xe7fb('0x27')];}_0x53c43a[_0xe7fb('0x1a')](_0x49b219)[_0xe7fb('0x28')](_0x4026b1);};}exports[_0xe7fb('0x29')]=function(_0x392d75,_0x16237a){var _0x380130={},_0x59e015={},_0x5df9f2={'count':0x0,'rows':[]};var _0x1086e6=db[_0xe7fb('0x2a')][_0xe7fb('0x2b')];_0x59e015['model']=_[_0xe7fb('0x2c')](_0x1086e6);_0x59e015[_0xe7fb('0x2d')]=_[_0xe7fb('0x2c')](_0x392d75[_0xe7fb('0x2d')]);_0x59e015[_0xe7fb('0x2e')]=_[_0xe7fb('0x2f')](_0x59e015[_0xe7fb('0x30')],_0x59e015[_0xe7fb('0x2d')]);_0x380130['attributes']=_[_0xe7fb('0x2f')](_0x59e015[_0xe7fb('0x30')],qs[_0xe7fb('0x31')](_0x392d75['query']['fields']));_0x380130[_0xe7fb('0x32')]=_0x380130['attributes'][_0xe7fb('0x33')]?_0x380130[_0xe7fb('0x32')]:_0x59e015[_0xe7fb('0x30')];if(!_0x392d75[_0xe7fb('0x2d')]['hasOwnProperty'](_0xe7fb('0x34'))){_0x380130[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x392d75[_0xe7fb('0x2d')][_0xe7fb('0x1e')]);_0x380130['offset']=qs[_0xe7fb('0x1d')](_0x392d75[_0xe7fb('0x2d')][_0xe7fb('0x1d')]);}_0x380130[_0xe7fb('0x35')]=qs[_0xe7fb('0x36')](_0x392d75[_0xe7fb('0x2d')][_0xe7fb('0x36')]);_0x380130[_0xe7fb('0x37')]=qs[_0xe7fb('0x2e')](_['pick'](_0x392d75[_0xe7fb('0x2d')],_0x59e015[_0xe7fb('0x2e')]));if(_0x392d75[_0xe7fb('0x2d')]['filter']){_0x380130[_0xe7fb('0x37')]=_[_0xe7fb('0x38')](_0x380130[_0xe7fb('0x37')],{'$or':_[_0xe7fb('0x39')](_0x1086e6,function(_0x402ca3){if(_0x402ca3[_0xe7fb('0x3a')][_0xe7fb('0x3b')]!==_0xe7fb('0x3c')){var _0x195c35={};_0x195c35[_0x402ca3[_0xe7fb('0x3d')]]={'$like':'%'+_0x392d75[_0xe7fb('0x2d')][_0xe7fb('0x3e')]+'%'};return _0x195c35;}})});}_0x380130=_[_0xe7fb('0x38')]({},_0x380130,_0x392d75[_0xe7fb('0x3f')]);var _0xeb7c29={'where':_0x380130[_0xe7fb('0x37')]};return db[_0xe7fb('0x2a')][_0xe7fb('0x1c')](_0xeb7c29)[_0xe7fb('0x23')](function(_0x4d6fe6){_0x5df9f2[_0xe7fb('0x1c')]=_0x4d6fe6;if(_0x392d75[_0xe7fb('0x2d')][_0xe7fb('0x40')]){_0x380130[_0xe7fb('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0xe7fb('0x42')](_0x380130);})[_0xe7fb('0x23')](function(_0xd472d){_0x5df9f2[_0xe7fb('0x43')]=_0xd472d;return _0x5df9f2;})['then'](respondWithFilteredResult(_0x16237a,_0x380130))[_0xe7fb('0x44')](handleError(_0x16237a,null));};exports[_0xe7fb('0x45')]=function(_0x34265f,_0x62a8a1){var _0x468d16={'raw':!![],'where':{'id':_0x34265f['params']['id']}},_0xb729fc={};_0xb729fc[_0xe7fb('0x30')]=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2a')]['rawAttributes']);_0xb729fc[_0xe7fb('0x2d')]=_[_0xe7fb('0x2c')](_0x34265f['query']);_0xb729fc['filters']=_['intersection'](_0xb729fc['model'],_0xb729fc['query']);_0x468d16[_0xe7fb('0x32')]=_[_0xe7fb('0x2f')](_0xb729fc[_0xe7fb('0x30')],qs['fields'](_0x34265f[_0xe7fb('0x2d')]['fields']));_0x468d16[_0xe7fb('0x32')]=_0x468d16[_0xe7fb('0x32')]['length']?_0x468d16[_0xe7fb('0x32')]:_0xb729fc[_0xe7fb('0x30')];if(_0x34265f[_0xe7fb('0x2d')][_0xe7fb('0x40')]){_0x468d16['include']=[{'all':!![]}];}_0x468d16=_[_0xe7fb('0x38')]({},_0x468d16,_0x34265f[_0xe7fb('0x3f')]);return db[_0xe7fb('0x2a')]['find'](_0x468d16)[_0xe7fb('0x23')](handleEntityNotFound(_0x62a8a1,null))[_0xe7fb('0x23')](respondWithResult(_0x62a8a1,null))[_0xe7fb('0x44')](handleError(_0x62a8a1,null));};exports[_0xe7fb('0x46')]=function(_0xc07c40,_0x5a1ce1){return db[_0xe7fb('0x2a')]['create'](_0xc07c40[_0xe7fb('0x47')],{})[_0xe7fb('0x23')](respondWithResult(_0x5a1ce1,0xc9))[_0xe7fb('0x44')](handleError(_0x5a1ce1,null));};exports[_0xe7fb('0x48')]=function(_0x15cec3,_0x5b9b2e){if(_0x15cec3[_0xe7fb('0x47')]['id']){delete _0x15cec3['body']['id'];}return db['VtigerField'][_0xe7fb('0x49')]({'where':{'id':_0x15cec3[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x5b9b2e,null))['then'](saveUpdates(_0x15cec3[_0xe7fb('0x47')],null))[_0xe7fb('0x23')](respondWithResult(_0x5b9b2e,null))['catch'](handleError(_0x5b9b2e,null));};exports['destroy']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x2a')][_0xe7fb('0x49')]({'where':{'id':_0x284bcb[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x42270b,null))[_0xe7fb('0x23')](removeEntity(_0x42270b,null))[_0xe7fb('0x44')](handleError(_0x42270b,null));}; \ No newline at end of file +var _0x0faf=['rows','catch','show','params','intersection','length','options','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','VtigerField','rawAttributes','keys','query','filters','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include'];(function(_0x37faaf,_0xd0ca64){var _0x23a96b=function(_0x60a54e){while(--_0x60a54e){_0x37faaf['push'](_0x37faaf['shift']());}};_0x23a96b(++_0xd0ca64);}(_0x0faf,0x132));var _0xf0fa=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0x0faf[_0x3c40f4];return _0x1209d;};'use strict';var pdf=require(_0xf0fa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0fa('0x1'));var zipdir=require(_0xf0fa('0x2'));var jsonpatch=require(_0xf0fa('0x3'));var rp=require(_0xf0fa('0x4'));var moment=require(_0xf0fa('0x5'));var BPromise=require(_0xf0fa('0x6'));var Mustache=require(_0xf0fa('0x7'));var util=require(_0xf0fa('0x8'));var path=require(_0xf0fa('0x9'));var sox=require('sox');var csv=require(_0xf0fa('0xa'));var ejs=require(_0xf0fa('0xb'));var fs=require('fs');var _=require(_0xf0fa('0xc'));var squel=require(_0xf0fa('0xd'));var crypto=require(_0xf0fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf0fa('0xf'));var toCsv=require(_0xf0fa('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fa('0x10'));var authService=require(_0xf0fa('0x11'));var qs=require(_0xf0fa('0x12'));var hardwareService=require(_0xf0fa('0x13'));var logger=require(_0xf0fa('0x14'))(_0xf0fa('0x15'));var utils=require(_0xf0fa('0x16'));var config=require(_0xf0fa('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b88c1,_0x5b38fa){_0x5b38fa=_0x5b38fa||0xcc;return function(_0x2f46ff){if(_0x2f46ff){return _0x2b88c1['sendStatus'](_0x5b38fa);}return _0x2b88c1[_0xf0fa('0x18')](_0x5b38fa)[_0xf0fa('0x19')]();};}function respondWithResult(_0x39a086,_0x547952){_0x547952=_0x547952||0xc8;return function(_0x5821ae){if(_0x5821ae){return _0x39a086[_0xf0fa('0x18')](_0x547952)['json'](_0x5821ae);}};}function respondWithFilteredResult(_0x1f7159,_0x81fc49){return function(_0x10ce43){if(_0x10ce43){var _0x3203ce=_0x10ce43[_0xf0fa('0x1a')],_0x467d5f=_0x81fc49['offset'],_0x33df80=_0x81fc49[_0xf0fa('0x1b')]+_0x81fc49[_0xf0fa('0x1c')],_0x28bab8;if(_0x33df80>=_0x3203ce){_0x33df80=_0x3203ce;_0x28bab8=0xc8;}else{_0x28bab8=0xce;}_0x1f7159[_0xf0fa('0x18')](_0x28bab8);return _0x1f7159[_0xf0fa('0x1d')](_0xf0fa('0x1e'),_0x467d5f+'-'+_0x33df80+'/'+_0x3203ce)[_0xf0fa('0x1f')](_0x10ce43);}return null;};}function patchUpdates(_0x5ba2eb){return function(_0x56ef81){try{jsonpatch[_0xf0fa('0x20')](_0x56ef81,_0x5ba2eb,!![]);}catch(_0x2751cc){return BPromise[_0xf0fa('0x21')](_0x2751cc);}return _0x56ef81[_0xf0fa('0x22')]();};}function saveUpdates(_0x1a3620,_0x403e7d){return function(_0x32c9bc){if(_0x32c9bc){return _0x32c9bc[_0xf0fa('0x23')](_0x1a3620)[_0xf0fa('0x24')](function(_0x15942b){return _0x15942b;});}return null;};}function removeEntity(_0x1878c4,_0x5bead8){return function(_0x10c93e){if(_0x10c93e){return _0x10c93e[_0xf0fa('0x25')]()[_0xf0fa('0x24')](function(){_0x1878c4[_0xf0fa('0x18')](0xcc)[_0xf0fa('0x19')]();});}};}function handleEntityNotFound(_0x2b22c5,_0x3901aa){return function(_0x1f0eaf){if(!_0x1f0eaf){_0x2b22c5[_0xf0fa('0x26')](0x194);}return _0x1f0eaf;};}function handleError(_0x4a897f,_0xeb86a9){_0xeb86a9=_0xeb86a9||0x1f4;return function(_0x19e392){logger['error'](_0x19e392[_0xf0fa('0x27')]);if(_0x19e392[_0xf0fa('0x28')]){delete _0x19e392[_0xf0fa('0x28')];}_0x4a897f['status'](_0xeb86a9)[_0xf0fa('0x29')](_0x19e392);};}exports[_0xf0fa('0x2a')]=function(_0x3d10fb,_0xf631f6){var _0x4e6eef={},_0x4be235={},_0x287810={'count':0x0,'rows':[]};var _0x1c5eaf=db[_0xf0fa('0x2b')][_0xf0fa('0x2c')];_0x4be235['model']=_[_0xf0fa('0x2d')](_0x1c5eaf);_0x4be235[_0xf0fa('0x2e')]=_[_0xf0fa('0x2d')](_0x3d10fb['query']);_0x4be235[_0xf0fa('0x2f')]=_['intersection'](_0x4be235[_0xf0fa('0x30')],_0x4be235[_0xf0fa('0x2e')]);_0x4e6eef[_0xf0fa('0x31')]=_['intersection'](_0x4be235[_0xf0fa('0x30')],qs[_0xf0fa('0x32')](_0x3d10fb[_0xf0fa('0x2e')][_0xf0fa('0x32')]));_0x4e6eef[_0xf0fa('0x31')]=_0x4e6eef[_0xf0fa('0x31')]['length']?_0x4e6eef['attributes']:_0x4be235[_0xf0fa('0x30')];if(!_0x3d10fb[_0xf0fa('0x2e')]['hasOwnProperty'](_0xf0fa('0x33'))){_0x4e6eef['limit']=qs['limit'](_0x3d10fb['query'][_0xf0fa('0x1c')]);_0x4e6eef['offset']=qs[_0xf0fa('0x1b')](_0x3d10fb[_0xf0fa('0x2e')][_0xf0fa('0x1b')]);}_0x4e6eef[_0xf0fa('0x34')]=qs[_0xf0fa('0x35')](_0x3d10fb[_0xf0fa('0x2e')][_0xf0fa('0x35')]);_0x4e6eef[_0xf0fa('0x36')]=qs['filters'](_[_0xf0fa('0x37')](_0x3d10fb[_0xf0fa('0x2e')],_0x4be235[_0xf0fa('0x2f')]));if(_0x3d10fb['query'][_0xf0fa('0x38')]){_0x4e6eef[_0xf0fa('0x36')]=_[_0xf0fa('0x39')](_0x4e6eef[_0xf0fa('0x36')],{'$or':_['map'](_0x1c5eaf,function(_0x5c474e){if(_0x5c474e[_0xf0fa('0x3a')][_0xf0fa('0x3b')]!==_0xf0fa('0x3c')){var _0x47486f={};_0x47486f[_0x5c474e[_0xf0fa('0x3d')]]={'$like':'%'+_0x3d10fb['query']['filter']+'%'};return _0x47486f;}})});}_0x4e6eef=_['merge']({},_0x4e6eef,_0x3d10fb['options']);var _0x3cdc0e={'where':_0x4e6eef[_0xf0fa('0x36')]};return db['VtigerField']['count'](_0x3cdc0e)[_0xf0fa('0x24')](function(_0x1b8fb8){_0x287810[_0xf0fa('0x1a')]=_0x1b8fb8;if(_0x3d10fb[_0xf0fa('0x2e')][_0xf0fa('0x3e')]){_0x4e6eef[_0xf0fa('0x3f')]=[{'all':!![]}];}return db[_0xf0fa('0x2b')]['findAll'](_0x4e6eef);})['then'](function(_0x344bb0){_0x287810[_0xf0fa('0x40')]=_0x344bb0;return _0x287810;})[_0xf0fa('0x24')](respondWithFilteredResult(_0xf631f6,_0x4e6eef))[_0xf0fa('0x41')](handleError(_0xf631f6,null));};exports[_0xf0fa('0x42')]=function(_0x1d0129,_0x5acfa4){var _0x17d3a5={'raw':!![],'where':{'id':_0x1d0129[_0xf0fa('0x43')]['id']}},_0x5b0bed={};_0x5b0bed[_0xf0fa('0x30')]=_[_0xf0fa('0x2d')](db[_0xf0fa('0x2b')][_0xf0fa('0x2c')]);_0x5b0bed[_0xf0fa('0x2e')]=_[_0xf0fa('0x2d')](_0x1d0129[_0xf0fa('0x2e')]);_0x5b0bed[_0xf0fa('0x2f')]=_['intersection'](_0x5b0bed['model'],_0x5b0bed['query']);_0x17d3a5[_0xf0fa('0x31')]=_[_0xf0fa('0x44')](_0x5b0bed['model'],qs[_0xf0fa('0x32')](_0x1d0129[_0xf0fa('0x2e')][_0xf0fa('0x32')]));_0x17d3a5[_0xf0fa('0x31')]=_0x17d3a5['attributes'][_0xf0fa('0x45')]?_0x17d3a5[_0xf0fa('0x31')]:_0x5b0bed[_0xf0fa('0x30')];if(_0x1d0129[_0xf0fa('0x2e')][_0xf0fa('0x3e')]){_0x17d3a5[_0xf0fa('0x3f')]=[{'all':!![]}];}_0x17d3a5=_[_0xf0fa('0x39')]({},_0x17d3a5,_0x1d0129[_0xf0fa('0x46')]);return db[_0xf0fa('0x2b')]['find'](_0x17d3a5)[_0xf0fa('0x24')](handleEntityNotFound(_0x5acfa4,null))[_0xf0fa('0x24')](respondWithResult(_0x5acfa4,null))[_0xf0fa('0x41')](handleError(_0x5acfa4,null));};exports[_0xf0fa('0x47')]=function(_0x856c2e,_0x2f8c74){return db['VtigerField'][_0xf0fa('0x47')](_0x856c2e[_0xf0fa('0x48')],{})['then'](respondWithResult(_0x2f8c74,0xc9))[_0xf0fa('0x41')](handleError(_0x2f8c74,null));};exports[_0xf0fa('0x23')]=function(_0x166b17,_0x14cbe4){if(_0x166b17[_0xf0fa('0x48')]['id']){delete _0x166b17[_0xf0fa('0x48')]['id'];}return db[_0xf0fa('0x2b')][_0xf0fa('0x49')]({'where':{'id':_0x166b17[_0xf0fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x14cbe4,null))[_0xf0fa('0x24')](saveUpdates(_0x166b17['body'],null))[_0xf0fa('0x24')](respondWithResult(_0x14cbe4,null))[_0xf0fa('0x41')](handleError(_0x14cbe4,null));};exports[_0xf0fa('0x25')]=function(_0x569ba9,_0x324765){return db[_0xf0fa('0x2b')][_0xf0fa('0x49')]({'where':{'id':_0x569ba9[_0xf0fa('0x43')]['id']}})[_0xf0fa('0x24')](handleEntityNotFound(_0x324765,null))['then'](removeEntity(_0x324765,null))[_0xf0fa('0x41')](handleError(_0x324765,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 86f20d9..ff93bfd 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 _0xb2fe=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0xb2fe,0x86));var _0xeb2f=function(_0x5ba74f,_0x200bf4){_0x5ba74f=_0x5ba74f-0x0;var _0x534d79=_0xb2fe[_0x5ba74f];return _0x534d79;};'use strict';var _=require(_0xeb2f('0x0'));var util=require('util');var logger=require(_0xeb2f('0x1'))(_0xeb2f('0x2'));var moment=require(_0xeb2f('0x3'));var BPromise=require(_0xeb2f('0x4'));var rp=require(_0xeb2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb2f('0x6'));var config=require(_0xeb2f('0x7'));var attributes=require(_0xeb2f('0x8'));module[_0xeb2f('0x9')]=function(_0x1d9feb,_0x3a2108){return _0x1d9feb[_0xeb2f('0xa')](_0xeb2f('0xb'),attributes,{'tableName':_0xeb2f('0xc'),'paranoid':![],'indexes':[{'name':_0xeb2f('0xd'),'fields':[_0xeb2f('0xe'),_0xeb2f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcda8=['idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xcda8,0x15b));var _0x8cda=function(_0x454e78,_0x531712){_0x454e78=_0x454e78-0x0;var _0x3db400=_0xcda8[_0x454e78];return _0x3db400;};'use strict';var _=require('lodash');var util=require(_0x8cda('0x0'));var logger=require(_0x8cda('0x1'))('api');var moment=require(_0x8cda('0x2'));var BPromise=require(_0x8cda('0x3'));var rp=require(_0x8cda('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cda('0x5'));var config=require(_0x8cda('0x6'));var attributes=require(_0x8cda('0x7'));module[_0x8cda('0x8')]=function(_0x48b068,_0x271816){return _0x48b068[_0x8cda('0x9')](_0x8cda('0xa'),attributes,{'tableName':_0x8cda('0xb'),'paranoid':![],'indexes':[{'name':_0x8cda('0xc'),'fields':[_0x8cda('0xd'),_0x8cda('0xe')],'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 31b9fdb..4166519 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 _0x70d0=['../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40ddd5,_0x200ebe){var _0x333054=function(_0xfbab61){while(--_0xfbab61){_0x40ddd5['push'](_0x40ddd5['shift']());}};_0x333054(++_0x200ebe);}(_0x70d0,0xd1));var _0x070d=function(_0x464251,_0x41951f){_0x464251=_0x464251-0x0;var _0x47b041=_0x70d0[_0x464251];return _0x47b041;};'use strict';var _=require(_0x070d('0x0'));var util=require(_0x070d('0x1'));var moment=require(_0x070d('0x2'));var BPromise=require(_0x070d('0x3'));var rs=require(_0x070d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x070d('0x5'))['db'];var utils=require(_0x070d('0x6'));var logger=require(_0x070d('0x7'))(_0x070d('0x8'));var config=require('../../config/environment');var jayson=require(_0x070d('0x9'));var client=jayson[_0x070d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538846,_0x507107,_0x107edf){return new BPromise(function(_0x143c59,_0x46dc42){return client[_0x070d('0xb')](_0x538846,_0x107edf)[_0x070d('0xc')](function(_0x4dcb83){logger[_0x070d('0xd')]('VtigerField,\x20%s,\x20%s',_0x507107,_0x070d('0xe'));logger[_0x070d('0xf')](_0x070d('0x10'),_0x507107,_0x070d('0xe'),JSON[_0x070d('0x11')](_0x4dcb83));if(_0x4dcb83[_0x070d('0x12')]){if(_0x4dcb83[_0x070d('0x12')][_0x070d('0x13')]===0x1f4){logger[_0x070d('0x12')](_0x070d('0x14'),_0x507107,_0x4dcb83[_0x070d('0x12')]['message']);return _0x46dc42(_0x4dcb83['error'][_0x070d('0x15')]);}logger[_0x070d('0x12')](_0x070d('0x14'),_0x507107,_0x4dcb83['error'][_0x070d('0x15')]);return _0x143c59(_0x4dcb83['error'][_0x070d('0x15')]);}else{logger[_0x070d('0xd')]('VtigerField,\x20%s,\x20%s',_0x507107,_0x070d('0xe'));_0x143c59(_0x4dcb83[_0x070d('0x16')]['message']);}})[_0x070d('0x17')](function(_0x33357b){logger['error']('VtigerField,\x20%s,\x20%s',_0x507107,_0x33357b);_0x46dc42(_0x33357b);});});} \ No newline at end of file +var _0xb5b6=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3b15ee,_0xde717e){var _0x36eecf=function(_0x152e95){while(--_0x152e95){_0x3b15ee['push'](_0x3b15ee['shift']());}};_0x36eecf(++_0xde717e);}(_0xb5b6,0x10f));var _0x6b5b=function(_0x5ac37a,_0x2c9860){_0x5ac37a=_0x5ac37a-0x0;var _0x4f0cd0=_0xb5b6[_0x5ac37a];return _0x4f0cd0;};'use strict';var _=require(_0x6b5b('0x0'));var util=require(_0x6b5b('0x1'));var moment=require(_0x6b5b('0x2'));var BPromise=require(_0x6b5b('0x3'));var rs=require(_0x6b5b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b5b('0x5'))['db'];var utils=require(_0x6b5b('0x6'));var logger=require(_0x6b5b('0x7'))(_0x6b5b('0x8'));var config=require('../../config/environment');var jayson=require(_0x6b5b('0x9'));var client=jayson[_0x6b5b('0xa')][_0x6b5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x124818,_0x52cb9b,_0x15bc57){return new BPromise(function(_0x50cb58,_0x215b9b){return client[_0x6b5b('0xc')](_0x124818,_0x15bc57)[_0x6b5b('0xd')](function(_0x14167){logger[_0x6b5b('0xe')]('VtigerField,\x20%s,\x20%s',_0x52cb9b,_0x6b5b('0xf'));logger[_0x6b5b('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x52cb9b,_0x6b5b('0xf'),JSON[_0x6b5b('0x11')](_0x14167));if(_0x14167[_0x6b5b('0x12')]){if(_0x14167['error'][_0x6b5b('0x13')]===0x1f4){logger['error'](_0x6b5b('0x14'),_0x52cb9b,_0x14167[_0x6b5b('0x12')][_0x6b5b('0x15')]);return _0x215b9b(_0x14167['error']['message']);}logger[_0x6b5b('0x12')](_0x6b5b('0x14'),_0x52cb9b,_0x14167[_0x6b5b('0x12')][_0x6b5b('0x15')]);return _0x50cb58(_0x14167['error']['message']);}else{logger[_0x6b5b('0xe')](_0x6b5b('0x14'),_0x52cb9b,_0x6b5b('0xf'));_0x50cb58(_0x14167[_0x6b5b('0x16')][_0x6b5b('0x15')]);}})[_0x6b5b('0x17')](function(_0x68dd27){logger['error'](_0x6b5b('0x14'),_0x52cb9b,_0x68dd27);_0x215b9b(_0x68dd27);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ebba477..8c095bf 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 _0x0763=['getConfigurations','/:id/fields','getFields','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x343537,_0x49b15e){var _0x249dab=function(_0x490143){while(--_0x490143){_0x343537['push'](_0x343537['shift']());}};_0x249dab(++_0x49b15e);}(_0x0763,0xef));var _0x3076=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x0763[_0x50a448];return _0x5da8c6;};'use strict';var multer=require(_0x3076('0x0'));var util=require(_0x3076('0x1'));var path=require(_0x3076('0x2'));var timeout=require('connect-timeout');var express=require(_0x3076('0x3'));var router=express[_0x3076('0x4')]();var auth=require(_0x3076('0x5'));var interaction=require(_0x3076('0x6'));var config=require(_0x3076('0x7'));var controller=require(_0x3076('0x8'));router[_0x3076('0x9')]('/',auth[_0x3076('0xa')](),controller[_0x3076('0xb')]);router[_0x3076('0x9')](_0x3076('0xc'),auth[_0x3076('0xa')](),controller['show']);router[_0x3076('0x9')](_0x3076('0xd'),auth[_0x3076('0xa')](),controller[_0x3076('0xe')]);router[_0x3076('0x9')](_0x3076('0xf'),auth[_0x3076('0xa')](),controller[_0x3076('0x10')]);router['post']('/',auth[_0x3076('0xa')](),controller[_0x3076('0x11')]);router['post'](_0x3076('0xd'),auth[_0x3076('0xa')](),controller[_0x3076('0x12')]);router['put']('/:id',auth[_0x3076('0xa')](),controller[_0x3076('0x13')]);router[_0x3076('0x14')](_0x3076('0xc'),auth[_0x3076('0xa')](),controller[_0x3076('0x15')]);module[_0x3076('0x16')]=router; \ No newline at end of file +var _0x2df8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1aa429,_0x204413){var _0x28124a=function(_0x334884){while(--_0x334884){_0x1aa429['push'](_0x1aa429['shift']());}};_0x28124a(++_0x204413);}(_0x2df8,0x1c9));var _0x82df=function(_0x4ad411,_0xb3de60){_0x4ad411=_0x4ad411-0x0;var _0x34d3e5=_0x2df8[_0x4ad411];return _0x34d3e5;};'use strict';var multer=require(_0x82df('0x0'));var util=require(_0x82df('0x1'));var path=require(_0x82df('0x2'));var timeout=require(_0x82df('0x3'));var express=require(_0x82df('0x4'));var router=express['Router']();var auth=require(_0x82df('0x5'));var interaction=require(_0x82df('0x6'));var config=require(_0x82df('0x7'));var controller=require(_0x82df('0x8'));router[_0x82df('0x9')]('/',auth[_0x82df('0xa')](),controller['index']);router[_0x82df('0x9')]('/:id',auth[_0x82df('0xa')](),controller[_0x82df('0xb')]);router[_0x82df('0x9')](_0x82df('0xc'),auth[_0x82df('0xa')](),controller[_0x82df('0xd')]);router['get'](_0x82df('0xe'),auth[_0x82df('0xa')](),controller['getFields']);router[_0x82df('0xf')]('/',auth[_0x82df('0xa')](),controller[_0x82df('0x10')]);router[_0x82df('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x82df('0x11')]);router[_0x82df('0x12')]('/:id',auth[_0x82df('0xa')](),controller[_0x82df('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x82df('0x14')]);module[_0x82df('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7e47d33..1702e78 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 _0x888e=['exports','STRING','username','ENUM','password','token','integrationTab','newTab'];(function(_0x24057c,_0x36ee82){var _0x48d370=function(_0x13ceda){while(--_0x13ceda){_0x24057c['push'](_0x24057c['shift']());}};_0x48d370(++_0x36ee82);}(_0x888e,0xc0));var _0xe888=function(_0x28e5f8,_0x27d70e){_0x28e5f8=_0x28e5f8-0x0;var _0x4e12ae=_0x888e[_0x28e5f8];return _0x4e12ae;};'use strict';var Sequelize=require('sequelize');module[_0xe888('0x0')]={'name':{'type':Sequelize[_0xe888('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe888('0x1')],'unique':_0xe888('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe888('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xe888('0x3')](_0xe888('0x4'),_0xe888('0x5')),'defaultValue':_0xe888('0x4')},'serverUrl':{'type':Sequelize[_0xe888('0x1')]},'type':{'type':Sequelize[_0xe888('0x3')](_0xe888('0x6'),_0xe888('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xc7e9=['STRING','username','password','ENUM','integrationTab','sequelize','exports'];(function(_0x3c06da,_0x229b85){var _0x3b5071=function(_0x335867){while(--_0x335867){_0x3c06da['push'](_0x3c06da['shift']());}};_0x3b5071(++_0x229b85);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc7e9[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x9c7e('0x0'));module[_0x9c7e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c7e('0x2')]},'username':{'type':Sequelize[_0x9c7e('0x2')],'unique':_0x9c7e('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9c7e('0x2')]},'remoteUri':{'type':Sequelize[_0x9c7e('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x9c7e('0x4'),'token'),'defaultValue':_0x9c7e('0x4')},'serverUrl':{'type':Sequelize[_0x9c7e('0x2')]},'type':{'type':Sequelize[_0x9c7e('0x5')](_0x9c7e('0x6'),'newTab'),'defaultValue':_0x9c7e('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 4bbf1fe..dd09f8c 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 _0x0d5a=['subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../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','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','stack','name','send','index','ZendeskAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','findAll','rows','show','params','include','find','create','body','destroy','getConfigurations','findOne','map','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','username','toString','ValidationError','Unknown\x20authentication\x20type'];(function(_0x59b592,_0x40fa8d){var _0x2daec7=function(_0x269e6a){while(--_0x269e6a){_0x59b592['push'](_0x59b592['shift']());}};_0x2daec7(++_0x40fa8d);}(_0x0d5a,0x18e));var _0xa0d5=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0d5a[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0xa0d5('0x0'));var emlformat=require(_0xa0d5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa0d5('0x2'));var jsonpatch=require(_0xa0d5('0x3'));var rp=require(_0xa0d5('0x4'));var moment=require(_0xa0d5('0x5'));var BPromise=require(_0xa0d5('0x6'));var Mustache=require(_0xa0d5('0x7'));var util=require(_0xa0d5('0x8'));var path=require(_0xa0d5('0x9'));var sox=require(_0xa0d5('0xa'));var csv=require(_0xa0d5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0d5('0xc'));var squel=require('squel');var crypto=require(_0xa0d5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0d5('0xb'));var querystring=require(_0xa0d5('0xe'));var Papa=require(_0xa0d5('0xf'));var Redis=require('ioredis');var authService=require(_0xa0d5('0x10'));var qs=require(_0xa0d5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0d5('0x12'))(_0xa0d5('0x13'));var utils=require(_0xa0d5('0x14'));var config=require(_0xa0d5('0x15'));var db=require(_0xa0d5('0x16'))['db'];var integrations=require(_0xa0d5('0x17'));var jayson=require(_0xa0d5('0x18'));var client=jayson[_0xa0d5('0x19')][_0xa0d5('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f43a4,_0x5a12e1,_0x108da5){if(_0x108da5){var _0x33739b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33739b[_0xa0d5('0x1b')](_0x5a12e1)){return _0x1f43a4;}else{throw new Error(_0xa0d5('0x1c'));}}else{return _0x1f43a4;}}function respondWithRpcPromise(_0xbaf5be,_0x50c937,_0x612165,_0x1f3ea3){return new BPromise(function(_0x3751a3,_0x4832b8){var _0x1ca22f=_0x1f3ea3||client;return _0x1ca22f[_0xa0d5('0x1d')](_0xbaf5be,_0x612165)[_0xa0d5('0x1e')](function(_0x22bff2){logger['info'](_0xa0d5('0x1f'),_0x50c937,_0xa0d5('0x20'));logger[_0xa0d5('0x21')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x50c937,_0xa0d5('0x20'),JSON[_0xa0d5('0x22')](_0x22bff2));if(_0x22bff2[_0xa0d5('0x23')]){if(_0x22bff2['error'][_0xa0d5('0x24')]===0x1f4){logger[_0xa0d5('0x23')](_0xa0d5('0x1f'),_0x50c937,_0x22bff2[_0xa0d5('0x23')]['message']);return _0x4832b8(_0x22bff2['error'][_0xa0d5('0x25')]);}logger[_0xa0d5('0x23')](_0xa0d5('0x1f'),_0x50c937,_0x22bff2[_0xa0d5('0x23')]['message']);return _0x3751a3(_0x22bff2[_0xa0d5('0x23')][_0xa0d5('0x25')]);}else{logger[_0xa0d5('0x26')](_0xa0d5('0x1f'),_0x50c937,_0xa0d5('0x20'));_0x3751a3(_0x22bff2[_0xa0d5('0x27')][_0xa0d5('0x25')]);}})[_0xa0d5('0x28')](function(_0x378527){logger[_0xa0d5('0x23')](_0xa0d5('0x1f'),_0x50c937,_0x378527);_0x4832b8(_0x378527);});});}function respondWithStatusCode(_0x80c3d1,_0x380070){_0x380070=_0x380070||0xcc;return function(_0x13e9ff){if(_0x13e9ff){return _0x80c3d1[_0xa0d5('0x29')](_0x380070);}return _0x80c3d1[_0xa0d5('0x2a')](_0x380070)[_0xa0d5('0x2b')]();};}function respondWithResult(_0x4d0aff,_0x16362e){_0x16362e=_0x16362e||0xc8;return function(_0x5f2209){if(_0x5f2209){return _0x4d0aff['status'](_0x16362e)['json'](_0x5f2209);}};}function respondWithFilteredResult(_0x4d188c,_0x2f8c42){return function(_0x92f629){if(_0x92f629){var _0xe3c4c1=_0x92f629[_0xa0d5('0x2c')],_0x313bf8=_0x2f8c42['offset'],_0x1b2074=_0x2f8c42[_0xa0d5('0x2d')]+_0x2f8c42['limit'],_0x209945;if(_0x1b2074>=_0xe3c4c1){_0x1b2074=_0xe3c4c1;_0x209945=0xc8;}else{_0x209945=0xce;}_0x4d188c['status'](_0x209945);return _0x4d188c[_0xa0d5('0x2e')]('Content-Range',_0x313bf8+'-'+_0x1b2074+'/'+_0xe3c4c1)[_0xa0d5('0x2f')](_0x92f629);}return null;};}function patchUpdates(_0x461661){return function(_0x2799d2){try{jsonpatch[_0xa0d5('0x30')](_0x2799d2,_0x461661,!![]);}catch(_0x16d0b0){return BPromise[_0xa0d5('0x31')](_0x16d0b0);}return _0x2799d2[_0xa0d5('0x32')]();};}function saveUpdates(_0x3ce9cc,_0x4e371c){return function(_0x5347c5){if(_0x5347c5){return _0x5347c5[_0xa0d5('0x33')](_0x3ce9cc)['then'](function(_0x39d20c){return _0x39d20c;});}return null;};}function removeEntity(_0x43fec3,_0x1cc2a6){return function(_0x4f9540){if(_0x4f9540){return _0x4f9540['destroy']()[_0xa0d5('0x1e')](function(){_0x43fec3[_0xa0d5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8712,_0x1c873a){return function(_0x52d842){if(!_0x52d842){_0x3a8712[_0xa0d5('0x29')](0x194);}return _0x52d842;};}function handleError(_0x5a3dd5,_0x2c35d0){_0x2c35d0=_0x2c35d0||0x1f4;return function(_0x5c958e){logger[_0xa0d5('0x23')](_0x5c958e[_0xa0d5('0x34')]);if(_0x5c958e[_0xa0d5('0x35')]){delete _0x5c958e[_0xa0d5('0x35')];}_0x5a3dd5[_0xa0d5('0x2a')](_0x2c35d0)[_0xa0d5('0x36')](_0x5c958e);};}exports[_0xa0d5('0x37')]=function(_0x310a63,_0x1174e5){var _0x5a6e7f={},_0x148e74={},_0x158b86={'count':0x0,'rows':[]};var _0x324ca5=db[_0xa0d5('0x38')][_0xa0d5('0x39')];_0x148e74[_0xa0d5('0x3a')]=_['keys'](_0x324ca5);_0x148e74[_0xa0d5('0x3b')]=_[_0xa0d5('0x3c')](_0x310a63[_0xa0d5('0x3b')]);_0x148e74[_0xa0d5('0x3d')]=_[_0xa0d5('0x3e')](_0x148e74[_0xa0d5('0x3a')],_0x148e74[_0xa0d5('0x3b')]);_0x5a6e7f[_0xa0d5('0x3f')]=_[_0xa0d5('0x3e')](_0x148e74[_0xa0d5('0x3a')],qs[_0xa0d5('0x40')](_0x310a63['query'][_0xa0d5('0x40')]));_0x5a6e7f['attributes']=_0x5a6e7f['attributes'][_0xa0d5('0x41')]?_0x5a6e7f[_0xa0d5('0x3f')]:_0x148e74[_0xa0d5('0x3a')];if(!_0x310a63['query'][_0xa0d5('0x42')](_0xa0d5('0x43'))){_0x5a6e7f[_0xa0d5('0x44')]=qs['limit'](_0x310a63['query'][_0xa0d5('0x44')]);_0x5a6e7f[_0xa0d5('0x2d')]=qs[_0xa0d5('0x2d')](_0x310a63[_0xa0d5('0x3b')][_0xa0d5('0x2d')]);}_0x5a6e7f[_0xa0d5('0x45')]=qs['sort'](_0x310a63[_0xa0d5('0x3b')][_0xa0d5('0x46')]);_0x5a6e7f['where']=qs[_0xa0d5('0x3d')](_[_0xa0d5('0x47')](_0x310a63[_0xa0d5('0x3b')],_0x148e74['filters']));if(_0x310a63[_0xa0d5('0x3b')][_0xa0d5('0x48')]){_0x5a6e7f[_0xa0d5('0x49')]=_[_0xa0d5('0x4a')](_0x5a6e7f['where'],{'$or':_['map'](_0x324ca5,function(_0x1246aa){if(_0x1246aa[_0xa0d5('0x4b')][_0xa0d5('0x4c')]!==_0xa0d5('0x4d')){var _0x10169a={};_0x10169a[_0x1246aa[_0xa0d5('0x4e')]]={'$like':'%'+_0x310a63['query'][_0xa0d5('0x48')]+'%'};return _0x10169a;}})});}_0x5a6e7f=_[_0xa0d5('0x4a')]({},_0x5a6e7f,_0x310a63[_0xa0d5('0x4f')]);var _0x58f1c1={'where':_0x5a6e7f[_0xa0d5('0x49')]};return db[_0xa0d5('0x38')]['count'](_0x58f1c1)[_0xa0d5('0x1e')](function(_0x244b72){_0x158b86[_0xa0d5('0x2c')]=_0x244b72;if(_0x310a63[_0xa0d5('0x3b')]['includeAll']){_0x5a6e7f['include']=[{'all':!![]}];}return db[_0xa0d5('0x38')][_0xa0d5('0x50')](_0x5a6e7f);})[_0xa0d5('0x1e')](function(_0xf65fb6){_0x158b86[_0xa0d5('0x51')]=_0xf65fb6;return _0x158b86;})[_0xa0d5('0x1e')](respondWithFilteredResult(_0x1174e5,_0x5a6e7f))[_0xa0d5('0x28')](handleError(_0x1174e5,null));};exports[_0xa0d5('0x52')]=function(_0x52b145,_0xeb9016){var _0x4d7bda={'raw':![],'where':{'id':_0x52b145[_0xa0d5('0x53')]['id']}},_0x3bb924={};_0x3bb924[_0xa0d5('0x3a')]=_[_0xa0d5('0x3c')](db['ZendeskAccount'][_0xa0d5('0x39')]);_0x3bb924[_0xa0d5('0x3b')]=_[_0xa0d5('0x3c')](_0x52b145[_0xa0d5('0x3b')]);_0x3bb924['filters']=_[_0xa0d5('0x3e')](_0x3bb924['model'],_0x3bb924['query']);_0x4d7bda['attributes']=_[_0xa0d5('0x3e')](_0x3bb924[_0xa0d5('0x3a')],qs['fields'](_0x52b145[_0xa0d5('0x3b')][_0xa0d5('0x40')]));_0x4d7bda[_0xa0d5('0x3f')]=_0x4d7bda[_0xa0d5('0x3f')]['length']?_0x4d7bda['attributes']:_0x3bb924['model'];if(_0x52b145[_0xa0d5('0x3b')]['includeAll']){_0x4d7bda[_0xa0d5('0x54')]=[{'all':!![]}];}_0x4d7bda=_[_0xa0d5('0x4a')]({},_0x4d7bda,_0x52b145['options']);return db[_0xa0d5('0x38')][_0xa0d5('0x55')](_0x4d7bda)[_0xa0d5('0x1e')](handleEntityNotFound(_0xeb9016,null))['then'](respondWithResult(_0xeb9016,null))['catch'](handleError(_0xeb9016,null));};exports[_0xa0d5('0x56')]=function(_0x334e7a,_0x49fefc){return db[_0xa0d5('0x38')]['create'](_0x334e7a[_0xa0d5('0x57')],{})[_0xa0d5('0x1e')](respondWithResult(_0x49fefc,0xc9))[_0xa0d5('0x28')](handleError(_0x49fefc,null));};exports[_0xa0d5('0x33')]=function(_0x59e0f4,_0x3ef622){if(_0x59e0f4['body']['id']){delete _0x59e0f4[_0xa0d5('0x57')]['id'];}return db[_0xa0d5('0x38')][_0xa0d5('0x55')]({'where':{'id':_0x59e0f4[_0xa0d5('0x53')]['id']}})[_0xa0d5('0x1e')](handleEntityNotFound(_0x3ef622,null))[_0xa0d5('0x1e')](saveUpdates(_0x59e0f4[_0xa0d5('0x57')],null))['then'](respondWithResult(_0x3ef622,null))['catch'](handleError(_0x3ef622,null));};exports[_0xa0d5('0x58')]=function(_0x579d5a,_0x58f941){return db[_0xa0d5('0x38')][_0xa0d5('0x55')]({'where':{'id':_0x579d5a[_0xa0d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x58f941,null))[_0xa0d5('0x1e')](removeEntity(_0x58f941,null))[_0xa0d5('0x28')](handleError(_0x58f941,null));};exports[_0xa0d5('0x59')]=function(_0x5c0408,_0x52a7be,_0x253f69){var _0x22f5ab={};var _0x10b587={};var _0x500f66;var _0x44f475;return db[_0xa0d5('0x38')][_0xa0d5('0x5a')]({'where':{'id':_0x5c0408['params']['id']}})[_0xa0d5('0x1e')](handleEntityNotFound(_0x52a7be,null))[_0xa0d5('0x1e')](function(_0x4d667f){if(_0x4d667f){_0x500f66=_0x4d667f;_0x10b587[_0xa0d5('0x3a')]=_[_0xa0d5('0x3c')](db['ZendeskConfiguration'][_0xa0d5('0x39')]);_0x10b587[_0xa0d5('0x3b')]=_[_0xa0d5('0x3c')](_0x5c0408[_0xa0d5('0x3b')]);_0x10b587[_0xa0d5('0x3d')]=_[_0xa0d5('0x3e')](_0x10b587[_0xa0d5('0x3a')],_0x10b587[_0xa0d5('0x3b')]);_0x22f5ab[_0xa0d5('0x3f')]=_[_0xa0d5('0x3e')](_0x10b587[_0xa0d5('0x3a')],qs[_0xa0d5('0x40')](_0x5c0408[_0xa0d5('0x3b')][_0xa0d5('0x40')]));_0x22f5ab[_0xa0d5('0x3f')]=_0x22f5ab['attributes'][_0xa0d5('0x41')]?_0x22f5ab[_0xa0d5('0x3f')]:_0x10b587[_0xa0d5('0x3a')];_0x22f5ab[_0xa0d5('0x45')]=qs[_0xa0d5('0x46')](_0x5c0408[_0xa0d5('0x3b')][_0xa0d5('0x46')]);_0x22f5ab[_0xa0d5('0x49')]=qs['filters'](_[_0xa0d5('0x47')](_0x5c0408[_0xa0d5('0x3b')],_0x10b587[_0xa0d5('0x3d')]));if(_0x5c0408[_0xa0d5('0x3b')][_0xa0d5('0x48')]){_0x22f5ab[_0xa0d5('0x49')]=_[_0xa0d5('0x4a')](_0x22f5ab[_0xa0d5('0x49')],{'$or':_[_0xa0d5('0x5b')](_0x22f5ab[_0xa0d5('0x3f')],function(_0x166b90){var _0x530998={};_0x530998[_0x166b90]={'$like':'%'+_0x5c0408[_0xa0d5('0x3b')]['filter']+'%'};return _0x530998;})});}_0x22f5ab=_[_0xa0d5('0x4a')]({},_0x22f5ab,_0x5c0408['options']);return _0x500f66[_0xa0d5('0x59')](_0x22f5ab);}})[_0xa0d5('0x1e')](function(_0x39efb7){if(_0x39efb7){_0x44f475=_0x39efb7[_0xa0d5('0x41')];if(!_0x5c0408[_0xa0d5('0x3b')]['hasOwnProperty'](_0xa0d5('0x43'))){_0x22f5ab[_0xa0d5('0x44')]=qs[_0xa0d5('0x44')](_0x5c0408[_0xa0d5('0x3b')][_0xa0d5('0x44')]);_0x22f5ab['offset']=qs[_0xa0d5('0x2d')](_0x5c0408[_0xa0d5('0x3b')]['offset']);}return _0x500f66[_0xa0d5('0x59')](_0x22f5ab);}})[_0xa0d5('0x1e')](function(_0xae5f26){if(_0xae5f26){return _0xae5f26?{'count':_0x44f475,'rows':_0xae5f26}:null;}})[_0xa0d5('0x1e')](respondWithResult(_0x52a7be,null))['catch'](handleError(_0x52a7be,null));};exports['addConfiguration']=function(_0x1418ea,_0x38b709,_0x38b262){if(_0x1418ea[_0xa0d5('0x57')]['id']){delete _0x1418ea[_0xa0d5('0x57')]['id'];}return db[_0xa0d5('0x38')][_0xa0d5('0x5a')]({'where':{'id':_0x1418ea[_0xa0d5('0x53')]['id']}})[_0xa0d5('0x1e')](handleEntityNotFound(_0x38b709,null))['then'](function(_0x46a0a1){if(_0x46a0a1){_0x1418ea[_0xa0d5('0x57')][_0xa0d5('0x5c')]=_0x46a0a1['id'];_0x1418ea['body'][_0xa0d5('0x5d')]=integrations[_0xa0d5('0x5e')](_0x1418ea[_0xa0d5('0x57')][_0xa0d5('0x5f')],_0x1418ea[_0xa0d5('0x57')]['type']);_0x1418ea[_0xa0d5('0x57')][_0xa0d5('0x60')]=integrations[_0xa0d5('0x61')](_0x1418ea[_0xa0d5('0x57')][_0xa0d5('0x5f')],_0x1418ea[_0xa0d5('0x57')][_0xa0d5('0x4b')]);return db[_0xa0d5('0x62')][_0xa0d5('0x56')](_0x1418ea[_0xa0d5('0x57')],{'include':[{'model':db[_0xa0d5('0x63')],'as':_0xa0d5('0x5d')},{'model':db[_0xa0d5('0x63')],'as':_0xa0d5('0x60')}]});}return null;})[_0xa0d5('0x1e')](respondWithResult(_0x38b709,null))[_0xa0d5('0x28')](handleError(_0x38b709,null));};exports[_0xa0d5('0x64')]=function(_0x56474d,_0x544863,_0x3c10cc){var _0x9a1b62='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x56474d[_0xa0d5('0x53')]['id']},'attributes':['id','username',_0xa0d5('0x65'),_0xa0d5('0x66'),_0xa0d5('0x67'),'remoteUri']})[_0xa0d5('0x1e')](handleEntityNotFound(_0x544863,null))[_0xa0d5('0x1e')](function(_0x287ff9){if(_0x287ff9){_0x9a1b62=_0x287ff9[_0xa0d5('0x68')];var _0x5ae4bf=_0x9a1b62[_0xa0d5('0x69')](-0x1);if(_0x5ae4bf==='/'){_0x9a1b62=_0x9a1b62[_0xa0d5('0x6a')](0x0,_0x9a1b62[_0xa0d5('0x6b')](_0x5ae4bf));}var _0x464ce7={'method':'GET','uri':util[_0xa0d5('0x6c')]('%s/%s',_0x9a1b62,_0xa0d5('0x6d')),'json':!![]};switch(_0x287ff9[_0xa0d5('0x67')]){case _0xa0d5('0x65'):_0x464ce7[_0xa0d5('0x6e')]={'Authorization':util[_0xa0d5('0x6c')](_0xa0d5('0x6f'),new Buffer(util[_0xa0d5('0x6c')](_0xa0d5('0x70'),_0x287ff9['username'],_0x287ff9[_0xa0d5('0x65')]))['toString'](_0xa0d5('0x71')))};break;case _0xa0d5('0x66'):_0x464ce7[_0xa0d5('0x6e')]={'Authorization':util[_0xa0d5('0x6c')](_0xa0d5('0x6f'),new Buffer(util['format']('%s/token:%s',_0x287ff9[_0xa0d5('0x72')],_0x287ff9[_0xa0d5('0x66')]))[_0xa0d5('0x73')]('base64'))};break;default:throw new db['Sequelize'][(_0xa0d5('0x74'))](_0xa0d5('0x75'));}return rp(_0x464ce7);}})['then'](function(_0x5b9f05){if(_0x5b9f05){var _0x5993e8=[_0xa0d5('0x76'),_0xa0d5('0x77'),'group',_0xa0d5('0x78')];_[_0xa0d5('0x79')](_0x5b9f05[_0xa0d5('0x6d')],function(_0x4be487){return _0x5993e8[_0xa0d5('0x7a')](_0x4be487['type']);});return{'count':_0x5b9f05[_0xa0d5('0x6d')][_0xa0d5('0x41')],'rows':_[_0xa0d5('0x5b')](_0x5b9f05['ticket_fields'],function(_0x59df36){return{'id':_0x59df36['id'],'name':_0x59df36[_0xa0d5('0x7b')]>0x7?_0x59df36[_0xa0d5('0x7c')]:_0x59df36[_0xa0d5('0x4b')],'custom':_0x59df36[_0xa0d5('0x7b')]>0x7?!![]:![],'options':_0x59df36[_0xa0d5('0x7d')]?_0x59df36[_0xa0d5('0x7d')]:_0x59df36[_0xa0d5('0x7e')]?_0x59df36['custom_field_options']:[]};})};}})[_0xa0d5('0x1e')](respondWithResult(_0x544863,null))[_0xa0d5('0x28')](function(_0x45792f){var _0x18efae=_0x56474d[_0xa0d5('0x3b')][_0xa0d5('0x1b')]?0x1f4:_0x45792f['statusCode']||0x1f4;logger[_0xa0d5('0x23')](_0xa0d5('0x7f'),_0xa0d5('0x64'),_0x18efae,JSON['stringify'](_0x45792f));delete _0x45792f['name'];if(_0x18efae===0x191){_0x18efae=0x190;}_0x544863[_0xa0d5('0x2a')](_0x18efae)[_0xa0d5('0x36')](_0x56474d[_0xa0d5('0x3b')]['test']?{'message':_0xa0d5('0x80'),'statusCode':_0x45792f['statusCode']}:_0x45792f);});}; \ No newline at end of file +var _0xf8ec=['headers','format','%s:%s','base64','Basic\x20%s','%s/token:%s','toString','Sequelize','ValidationError','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','set','json','reject','then','destroy','name','index','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','length','includeAll','body','update','params','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8ec,0x18f));var _0xcf8e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xf8ec[_0x2c1dcd];return _0x158ce5;};'use strict';var pdf=require(_0xcf8e('0x0'));var emlformat=require(_0xcf8e('0x1'));var rimraf=require(_0xcf8e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf8e('0x3'));var rp=require(_0xcf8e('0x4'));var moment=require('moment');var BPromise=require(_0xcf8e('0x5'));var Mustache=require('mustache');var util=require(_0xcf8e('0x6'));var path=require(_0xcf8e('0x7'));var sox=require('sox');var csv=require(_0xcf8e('0x8'));var ejs=require(_0xcf8e('0x9'));var fs=require('fs');var _=require(_0xcf8e('0xa'));var squel=require(_0xcf8e('0xb'));var crypto=require(_0xcf8e('0xc'));var jsforce=require(_0xcf8e('0xd'));var deskjs=require(_0xcf8e('0xe'));var toCsv=require(_0xcf8e('0x8'));var querystring=require(_0xcf8e('0xf'));var Papa=require('papaparse');var Redis=require(_0xcf8e('0x10'));var authService=require(_0xcf8e('0x11'));var qs=require(_0xcf8e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf8e('0x13'))(_0xcf8e('0x14'));var utils=require(_0xcf8e('0x15'));var config=require('../../config/environment');var db=require(_0xcf8e('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0xcf8e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x27ec7d,_0x45e8f1,_0xe68942){if(_0xe68942){var _0x2a243b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a243b[_0xcf8e('0x18')](_0x45e8f1)){return _0x27ec7d;}else{throw new Error(_0xcf8e('0x19'));}}else{return _0x27ec7d;}}function respondWithRpcPromise(_0x7563b8,_0x56e8fa,_0x365424,_0x2031ce){return new BPromise(function(_0x481be0,_0x3f9091){var _0x45d8ca=_0x2031ce||client;return _0x45d8ca[_0xcf8e('0x1a')](_0x7563b8,_0x365424)['then'](function(_0x1f492c){logger[_0xcf8e('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x56e8fa,'request\x20sent');logger['debug'](_0xcf8e('0x1c'),_0x56e8fa,_0xcf8e('0x1d'),JSON[_0xcf8e('0x1e')](_0x1f492c));if(_0x1f492c[_0xcf8e('0x1f')]){if(_0x1f492c['error'][_0xcf8e('0x20')]===0x1f4){logger[_0xcf8e('0x1f')](_0xcf8e('0x21'),_0x56e8fa,_0x1f492c[_0xcf8e('0x1f')]['message']);return _0x3f9091(_0x1f492c[_0xcf8e('0x1f')][_0xcf8e('0x22')]);}logger[_0xcf8e('0x1f')](_0xcf8e('0x21'),_0x56e8fa,_0x1f492c['error'][_0xcf8e('0x22')]);return _0x481be0(_0x1f492c['error'][_0xcf8e('0x22')]);}else{logger[_0xcf8e('0x1b')](_0xcf8e('0x21'),_0x56e8fa,_0xcf8e('0x1d'));_0x481be0(_0x1f492c[_0xcf8e('0x23')][_0xcf8e('0x22')]);}})[_0xcf8e('0x24')](function(_0x13820b){logger[_0xcf8e('0x1f')](_0xcf8e('0x21'),_0x56e8fa,_0x13820b);_0x3f9091(_0x13820b);});});}function respondWithStatusCode(_0x3ae3df,_0x4bd0fd){_0x4bd0fd=_0x4bd0fd||0xcc;return function(_0x564df1){if(_0x564df1){return _0x3ae3df[_0xcf8e('0x25')](_0x4bd0fd);}return _0x3ae3df[_0xcf8e('0x26')](_0x4bd0fd)[_0xcf8e('0x27')]();};}function respondWithResult(_0x5c2b34,_0x8268a1){_0x8268a1=_0x8268a1||0xc8;return function(_0x37237e){if(_0x37237e){return _0x5c2b34[_0xcf8e('0x26')](_0x8268a1)['json'](_0x37237e);}};}function respondWithFilteredResult(_0x52a68c,_0x895543){return function(_0x2a6e3f){if(_0x2a6e3f){var _0x138fd3=_0x2a6e3f[_0xcf8e('0x28')],_0x35af8d=_0x895543['offset'],_0x1ec8c0=_0x895543['offset']+_0x895543['limit'],_0x33fcd7;if(_0x1ec8c0>=_0x138fd3){_0x1ec8c0=_0x138fd3;_0x33fcd7=0xc8;}else{_0x33fcd7=0xce;}_0x52a68c[_0xcf8e('0x26')](_0x33fcd7);return _0x52a68c[_0xcf8e('0x29')]('Content-Range',_0x35af8d+'-'+_0x1ec8c0+'/'+_0x138fd3)[_0xcf8e('0x2a')](_0x2a6e3f);}return null;};}function patchUpdates(_0x259e97){return function(_0x2dbb72){try{jsonpatch['apply'](_0x2dbb72,_0x259e97,!![]);}catch(_0x15d7f7){return BPromise[_0xcf8e('0x2b')](_0x15d7f7);}return _0x2dbb72['save']();};}function saveUpdates(_0x57ffa6,_0x34bddb){return function(_0x4aeaa0){if(_0x4aeaa0){return _0x4aeaa0['update'](_0x57ffa6)[_0xcf8e('0x2c')](function(_0x38e9d1){return _0x38e9d1;});}return null;};}function removeEntity(_0x3be20d,_0x4cb8b4){return function(_0x2dcf5e){if(_0x2dcf5e){return _0x2dcf5e[_0xcf8e('0x2d')]()[_0xcf8e('0x2c')](function(){_0x3be20d[_0xcf8e('0x26')](0xcc)[_0xcf8e('0x27')]();});}};}function handleEntityNotFound(_0x9feb2c,_0x33da53){return function(_0x310a7f){if(!_0x310a7f){_0x9feb2c[_0xcf8e('0x25')](0x194);}return _0x310a7f;};}function handleError(_0x2e4bed,_0x4c8a31){_0x4c8a31=_0x4c8a31||0x1f4;return function(_0x403ecb){logger[_0xcf8e('0x1f')](_0x403ecb['stack']);if(_0x403ecb[_0xcf8e('0x2e')]){delete _0x403ecb[_0xcf8e('0x2e')];}_0x2e4bed[_0xcf8e('0x26')](_0x4c8a31)['send'](_0x403ecb);};}exports[_0xcf8e('0x2f')]=function(_0xd8c8b1,_0x593063){var _0x8d73f1={},_0x135d00={},_0x19bda5={'count':0x0,'rows':[]};var _0x3a4963=db[_0xcf8e('0x30')][_0xcf8e('0x31')];_0x135d00[_0xcf8e('0x32')]=_[_0xcf8e('0x33')](_0x3a4963);_0x135d00[_0xcf8e('0x34')]=_[_0xcf8e('0x33')](_0xd8c8b1['query']);_0x135d00[_0xcf8e('0x35')]=_[_0xcf8e('0x36')](_0x135d00[_0xcf8e('0x32')],_0x135d00['query']);_0x8d73f1[_0xcf8e('0x37')]=_[_0xcf8e('0x36')](_0x135d00['model'],qs['fields'](_0xd8c8b1[_0xcf8e('0x34')][_0xcf8e('0x38')]));_0x8d73f1[_0xcf8e('0x37')]=_0x8d73f1['attributes']['length']?_0x8d73f1[_0xcf8e('0x37')]:_0x135d00[_0xcf8e('0x32')];if(!_0xd8c8b1[_0xcf8e('0x34')]['hasOwnProperty'](_0xcf8e('0x39'))){_0x8d73f1[_0xcf8e('0x3a')]=qs[_0xcf8e('0x3a')](_0xd8c8b1[_0xcf8e('0x34')][_0xcf8e('0x3a')]);_0x8d73f1[_0xcf8e('0x3b')]=qs[_0xcf8e('0x3b')](_0xd8c8b1['query'][_0xcf8e('0x3b')]);}_0x8d73f1[_0xcf8e('0x3c')]=qs[_0xcf8e('0x3d')](_0xd8c8b1['query']['sort']);_0x8d73f1[_0xcf8e('0x3e')]=qs[_0xcf8e('0x35')](_[_0xcf8e('0x3f')](_0xd8c8b1[_0xcf8e('0x34')],_0x135d00['filters']));if(_0xd8c8b1[_0xcf8e('0x34')][_0xcf8e('0x40')]){_0x8d73f1[_0xcf8e('0x3e')]=_[_0xcf8e('0x41')](_0x8d73f1['where'],{'$or':_[_0xcf8e('0x42')](_0x3a4963,function(_0x4d680f){if(_0x4d680f[_0xcf8e('0x43')][_0xcf8e('0x44')]!==_0xcf8e('0x45')){var _0x4f060d={};_0x4f060d[_0x4d680f[_0xcf8e('0x46')]]={'$like':'%'+_0xd8c8b1[_0xcf8e('0x34')][_0xcf8e('0x40')]+'%'};return _0x4f060d;}})});}_0x8d73f1=_[_0xcf8e('0x41')]({},_0x8d73f1,_0xd8c8b1[_0xcf8e('0x47')]);var _0x591357={'where':_0x8d73f1[_0xcf8e('0x3e')]};return db[_0xcf8e('0x30')]['count'](_0x591357)[_0xcf8e('0x2c')](function(_0x5f37fe){_0x19bda5[_0xcf8e('0x28')]=_0x5f37fe;if(_0xd8c8b1[_0xcf8e('0x34')]['includeAll']){_0x8d73f1[_0xcf8e('0x48')]=[{'all':!![]}];}return db[_0xcf8e('0x30')][_0xcf8e('0x49')](_0x8d73f1);})[_0xcf8e('0x2c')](function(_0x2510c5){_0x19bda5[_0xcf8e('0x4a')]=_0x2510c5;return _0x19bda5;})['then'](respondWithFilteredResult(_0x593063,_0x8d73f1))[_0xcf8e('0x24')](handleError(_0x593063,null));};exports['show']=function(_0x15bd25,_0x58275b){var _0xbb1d27={'raw':![],'where':{'id':_0x15bd25['params']['id']}},_0x29a16e={};_0x29a16e[_0xcf8e('0x32')]=_[_0xcf8e('0x33')](db['ZendeskAccount'][_0xcf8e('0x31')]);_0x29a16e[_0xcf8e('0x34')]=_[_0xcf8e('0x33')](_0x15bd25[_0xcf8e('0x34')]);_0x29a16e[_0xcf8e('0x35')]=_[_0xcf8e('0x36')](_0x29a16e['model'],_0x29a16e[_0xcf8e('0x34')]);_0xbb1d27[_0xcf8e('0x37')]=_['intersection'](_0x29a16e[_0xcf8e('0x32')],qs['fields'](_0x15bd25['query'][_0xcf8e('0x38')]));_0xbb1d27[_0xcf8e('0x37')]=_0xbb1d27[_0xcf8e('0x37')][_0xcf8e('0x4b')]?_0xbb1d27[_0xcf8e('0x37')]:_0x29a16e['model'];if(_0x15bd25[_0xcf8e('0x34')][_0xcf8e('0x4c')]){_0xbb1d27[_0xcf8e('0x48')]=[{'all':!![]}];}_0xbb1d27=_[_0xcf8e('0x41')]({},_0xbb1d27,_0x15bd25['options']);return db[_0xcf8e('0x30')]['find'](_0xbb1d27)[_0xcf8e('0x2c')](handleEntityNotFound(_0x58275b,null))[_0xcf8e('0x2c')](respondWithResult(_0x58275b,null))[_0xcf8e('0x24')](handleError(_0x58275b,null));};exports['create']=function(_0x175068,_0x55e820){return db[_0xcf8e('0x30')]['create'](_0x175068[_0xcf8e('0x4d')],{})[_0xcf8e('0x2c')](respondWithResult(_0x55e820,0xc9))[_0xcf8e('0x24')](handleError(_0x55e820,null));};exports[_0xcf8e('0x4e')]=function(_0x451c6c,_0x30a07c){if(_0x451c6c[_0xcf8e('0x4d')]['id']){delete _0x451c6c[_0xcf8e('0x4d')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x451c6c[_0xcf8e('0x4f')]['id']}})[_0xcf8e('0x2c')](handleEntityNotFound(_0x30a07c,null))[_0xcf8e('0x2c')](saveUpdates(_0x451c6c[_0xcf8e('0x4d')],null))[_0xcf8e('0x2c')](respondWithResult(_0x30a07c,null))[_0xcf8e('0x24')](handleError(_0x30a07c,null));};exports[_0xcf8e('0x2d')]=function(_0x340c9c,_0x394beb){return db[_0xcf8e('0x30')][_0xcf8e('0x50')]({'where':{'id':_0x340c9c['params']['id']}})[_0xcf8e('0x2c')](handleEntityNotFound(_0x394beb,null))['then'](removeEntity(_0x394beb,null))['catch'](handleError(_0x394beb,null));};exports['getConfigurations']=function(_0x14044d,_0x48ecff,_0x589e5a){var _0x4b0cf8={};var _0x2d4f0f={};var _0x50820a;var _0x3af5aa;return db[_0xcf8e('0x30')][_0xcf8e('0x51')]({'where':{'id':_0x14044d[_0xcf8e('0x4f')]['id']}})[_0xcf8e('0x2c')](handleEntityNotFound(_0x48ecff,null))['then'](function(_0x51ee10){if(_0x51ee10){_0x50820a=_0x51ee10;_0x2d4f0f[_0xcf8e('0x32')]=_[_0xcf8e('0x33')](db[_0xcf8e('0x52')][_0xcf8e('0x31')]);_0x2d4f0f[_0xcf8e('0x34')]=_[_0xcf8e('0x33')](_0x14044d['query']);_0x2d4f0f['filters']=_[_0xcf8e('0x36')](_0x2d4f0f['model'],_0x2d4f0f[_0xcf8e('0x34')]);_0x4b0cf8[_0xcf8e('0x37')]=_[_0xcf8e('0x36')](_0x2d4f0f[_0xcf8e('0x32')],qs[_0xcf8e('0x38')](_0x14044d[_0xcf8e('0x34')][_0xcf8e('0x38')]));_0x4b0cf8[_0xcf8e('0x37')]=_0x4b0cf8[_0xcf8e('0x37')]['length']?_0x4b0cf8[_0xcf8e('0x37')]:_0x2d4f0f[_0xcf8e('0x32')];_0x4b0cf8[_0xcf8e('0x3c')]=qs[_0xcf8e('0x3d')](_0x14044d['query']['sort']);_0x4b0cf8[_0xcf8e('0x3e')]=qs['filters'](_[_0xcf8e('0x3f')](_0x14044d[_0xcf8e('0x34')],_0x2d4f0f[_0xcf8e('0x35')]));if(_0x14044d[_0xcf8e('0x34')][_0xcf8e('0x40')]){_0x4b0cf8[_0xcf8e('0x3e')]=_[_0xcf8e('0x41')](_0x4b0cf8['where'],{'$or':_[_0xcf8e('0x42')](_0x4b0cf8[_0xcf8e('0x37')],function(_0x50fb96){var _0x1ed67c={};_0x1ed67c[_0x50fb96]={'$like':'%'+_0x14044d['query'][_0xcf8e('0x40')]+'%'};return _0x1ed67c;})});}_0x4b0cf8=_[_0xcf8e('0x41')]({},_0x4b0cf8,_0x14044d['options']);return _0x50820a[_0xcf8e('0x53')](_0x4b0cf8);}})[_0xcf8e('0x2c')](function(_0x5c7c8f){if(_0x5c7c8f){_0x3af5aa=_0x5c7c8f[_0xcf8e('0x4b')];if(!_0x14044d['query']['hasOwnProperty'](_0xcf8e('0x39'))){_0x4b0cf8[_0xcf8e('0x3a')]=qs[_0xcf8e('0x3a')](_0x14044d[_0xcf8e('0x34')]['limit']);_0x4b0cf8[_0xcf8e('0x3b')]=qs[_0xcf8e('0x3b')](_0x14044d[_0xcf8e('0x34')][_0xcf8e('0x3b')]);}return _0x50820a[_0xcf8e('0x53')](_0x4b0cf8);}})['then'](function(_0x441158){if(_0x441158){return _0x441158?{'count':_0x3af5aa,'rows':_0x441158}:null;}})[_0xcf8e('0x2c')](respondWithResult(_0x48ecff,null))['catch'](handleError(_0x48ecff,null));};exports[_0xcf8e('0x54')]=function(_0x29bf5f,_0x40fa79,_0x312e4f){if(_0x29bf5f[_0xcf8e('0x4d')]['id']){delete _0x29bf5f[_0xcf8e('0x4d')]['id'];}return db[_0xcf8e('0x30')]['findOne']({'where':{'id':_0x29bf5f[_0xcf8e('0x4f')]['id']}})[_0xcf8e('0x2c')](handleEntityNotFound(_0x40fa79,null))[_0xcf8e('0x2c')](function(_0x471188){if(_0x471188){_0x29bf5f[_0xcf8e('0x4d')][_0xcf8e('0x55')]=_0x471188['id'];_0x29bf5f[_0xcf8e('0x4d')][_0xcf8e('0x56')]=integrations[_0xcf8e('0x57')](_0x29bf5f[_0xcf8e('0x4d')][_0xcf8e('0x58')],_0x29bf5f[_0xcf8e('0x4d')][_0xcf8e('0x43')]);_0x29bf5f['body'][_0xcf8e('0x59')]=integrations[_0xcf8e('0x5a')](_0x29bf5f[_0xcf8e('0x4d')][_0xcf8e('0x58')],_0x29bf5f['body'][_0xcf8e('0x43')]);return db[_0xcf8e('0x52')][_0xcf8e('0x5b')](_0x29bf5f[_0xcf8e('0x4d')],{'include':[{'model':db[_0xcf8e('0x5c')],'as':'Subjects'},{'model':db[_0xcf8e('0x5c')],'as':_0xcf8e('0x59')}]});}return null;})['then'](respondWithResult(_0x40fa79,null))['catch'](handleError(_0x40fa79,null));};exports[_0xcf8e('0x5d')]=function(_0x349359,_0xa1adf9,_0x8aa16c){var _0x22056e='';return db[_0xcf8e('0x30')]['findOne']({'where':{'id':_0x349359['params']['id']},'attributes':['id',_0xcf8e('0x5e'),_0xcf8e('0x5f'),_0xcf8e('0x60'),'authType',_0xcf8e('0x61')]})['then'](handleEntityNotFound(_0xa1adf9,null))[_0xcf8e('0x2c')](function(_0x34f6ca){if(_0x34f6ca){_0x22056e=_0x34f6ca[_0xcf8e('0x61')];var _0x371d6e=_0x22056e[_0xcf8e('0x62')](-0x1);if(_0x371d6e==='/'){_0x22056e=_0x22056e[_0xcf8e('0x63')](0x0,_0x22056e[_0xcf8e('0x64')](_0x371d6e));}var _0x463b76={'method':_0xcf8e('0x65'),'uri':util['format'](_0xcf8e('0x66'),_0x22056e,_0xcf8e('0x67')),'json':!![]};switch(_0x34f6ca[_0xcf8e('0x68')]){case _0xcf8e('0x5f'):_0x463b76[_0xcf8e('0x69')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xcf8e('0x6a')](_0xcf8e('0x6b'),_0x34f6ca['username'],_0x34f6ca['password']))['toString'](_0xcf8e('0x6c')))};break;case _0xcf8e('0x60'):_0x463b76[_0xcf8e('0x69')]={'Authorization':util[_0xcf8e('0x6a')](_0xcf8e('0x6d'),new Buffer(util['format'](_0xcf8e('0x6e'),_0x34f6ca[_0xcf8e('0x5e')],_0x34f6ca[_0xcf8e('0x60')]))[_0xcf8e('0x6f')]('base64'))};break;default:throw new db[(_0xcf8e('0x70'))][(_0xcf8e('0x71'))]('Unknown\x20authentication\x20type');}return rp(_0x463b76);}})[_0xcf8e('0x2c')](function(_0xc30349){if(_0xc30349){var _0x56c871=['subject',_0xcf8e('0x72'),_0xcf8e('0x73'),_0xcf8e('0x74')];_[_0xcf8e('0x75')](_0xc30349['ticket_fields'],function(_0x1c228c){return _0x56c871[_0xcf8e('0x76')](_0x1c228c[_0xcf8e('0x43')]);});return{'count':_0xc30349[_0xcf8e('0x67')][_0xcf8e('0x4b')],'rows':_[_0xcf8e('0x42')](_0xc30349[_0xcf8e('0x67')],function(_0x443c39){return{'id':_0x443c39['id'],'name':_0x443c39[_0xcf8e('0x77')]>0x7?_0x443c39[_0xcf8e('0x78')]:_0x443c39['type'],'custom':_0x443c39[_0xcf8e('0x77')]>0x7?!![]:![],'options':_0x443c39[_0xcf8e('0x79')]?_0x443c39[_0xcf8e('0x79')]:_0x443c39[_0xcf8e('0x7a')]?_0x443c39['custom_field_options']:[]};})};}})[_0xcf8e('0x2c')](respondWithResult(_0xa1adf9,null))[_0xcf8e('0x24')](function(_0x384b43){var _0x2a0903=_0x349359['query'][_0xcf8e('0x18')]?0x1f4:_0x384b43[_0xcf8e('0x7b')]||0x1f4;logger[_0xcf8e('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xcf8e('0x5d'),_0x2a0903,JSON[_0xcf8e('0x1e')](_0x384b43));delete _0x384b43[_0xcf8e('0x2e')];if(_0x2a0903===0x191){_0x2a0903=0x190;}_0xa1adf9['status'](_0x2a0903)[_0xcf8e('0x7c')](_0x349359[_0xcf8e('0x34')]['test']?{'message':_0xcf8e('0x7d'),'statusCode':_0x384b43[_0xcf8e('0x7b')]}:_0x384b43);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index fae426a..07a5dd6 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 _0x0af5=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5225a9,_0x52f8a8){var _0x158a3=function(_0x3ee236){while(--_0x3ee236){_0x5225a9['push'](_0x5225a9['shift']());}};_0x158a3(++_0x52f8a8);}(_0x0af5,0x158));var _0x50af=function(_0x1808a2,_0x4095b1){_0x1808a2=_0x1808a2-0x0;var _0x321a07=_0x0af5[_0x1808a2];return _0x321a07;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));var integrations=require(_0x50af('0xa'));module[_0x50af('0xb')]=function(_0x5e94f8,_0x5a5c0a){return _0x5e94f8[_0x50af('0xc')](_0x50af('0xd'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0650=['rimraf','../../config/environment','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','path'];(function(_0x33dc04,_0x5f4e89){var _0x35431d=function(_0x45f5cf){while(--_0x45f5cf){_0x33dc04['push'](_0x33dc04['shift']());}};_0x35431d(++_0x5f4e89);}(_0x0650,0xed));var _0x0065=function(_0x101076,_0x5c8f3f){_0x101076=_0x101076-0x0;var _0x2d873d=_0x0650[_0x101076];return _0x2d873d;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var logger=require(_0x0065('0x1'))(_0x0065('0x2'));var moment=require('moment');var BPromise=require(_0x0065('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0065('0x4'));var rimraf=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x0065('0x7'));module['exports']=function(_0x5cf16e,_0x59f241){return _0x5cf16e[_0x0065('0x8')](_0x0065('0x9'),attributes,{'tableName':_0x0065('0xa'),'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 7831b7c..27bee73 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 _0x6e88=['then','debug','ShowZendeskAccount','find','raw','where','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','result','catch','GetZendeskAccount','ZendeskAccount','options','limit','map','include','model','attributes'];(function(_0x4b31b5,_0x59d162){var _0x327978=function(_0x5e021c){while(--_0x5e021c){_0x4b31b5['push'](_0x4b31b5['shift']());}};_0x327978(++_0x59d162);}(_0x6e88,0x1c0));var _0x86e8=function(_0x4a7a37,_0x48ad56){_0x4a7a37=_0x4a7a37-0x0;var _0x2e27cf=_0x6e88[_0x4a7a37];return _0x2e27cf;};'use strict';var _=require(_0x86e8('0x0'));var util=require(_0x86e8('0x1'));var moment=require('moment');var BPromise=require(_0x86e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x86e8('0x4'))(_0x86e8('0x5'));var config=require(_0x86e8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86e8('0x7')][_0x86e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bd6ac,_0x4e7ebe,_0x4afa5f){return new BPromise(function(_0x2574ad,_0x42e10b){return client[_0x86e8('0x9')](_0x3bd6ac,_0x4afa5f)['then'](function(_0xc92659){logger[_0x86e8('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x4e7ebe,_0x86e8('0xb'));logger['debug'](_0x86e8('0xc'),_0x4e7ebe,_0x86e8('0xb'),JSON[_0x86e8('0xd')](_0xc92659));if(_0xc92659['error']){if(_0xc92659[_0x86e8('0xe')][_0x86e8('0xf')]===0x1f4){logger[_0x86e8('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x4e7ebe,_0xc92659['error']['message']);return _0x42e10b(_0xc92659[_0x86e8('0xe')][_0x86e8('0x10')]);}logger[_0x86e8('0xe')](_0x86e8('0x11'),_0x4e7ebe,_0xc92659['error'][_0x86e8('0x10')]);return _0x2574ad(_0xc92659[_0x86e8('0xe')][_0x86e8('0x10')]);}else{logger[_0x86e8('0xa')](_0x86e8('0x11'),_0x4e7ebe,_0x86e8('0xb'));_0x2574ad(_0xc92659[_0x86e8('0x12')][_0x86e8('0x10')]);}})[_0x86e8('0x13')](function(_0x4d129b){logger[_0x86e8('0xe')](_0x86e8('0x11'),_0x4e7ebe,_0x4d129b);_0x42e10b(_0x4d129b);});});}exports[_0x86e8('0x14')]=function(_0x25117d){var _0x3913de=this;return new Promise(function(_0x20d2ce,_0x57be8){return db[_0x86e8('0x15')]['findAll']({'raw':_0x25117d[_0x86e8('0x16')]?_0x25117d['options']['raw']===undefined?!![]:![]:!![],'where':_0x25117d[_0x86e8('0x16')]?_0x25117d[_0x86e8('0x16')]['where']||null:null,'attributes':_0x25117d[_0x86e8('0x16')]?_0x25117d[_0x86e8('0x16')]['attributes']||null:null,'limit':_0x25117d[_0x86e8('0x16')]?_0x25117d['options'][_0x86e8('0x17')]||null:null,'include':_0x25117d['options']?_0x25117d[_0x86e8('0x16')]['include']?_[_0x86e8('0x18')](_0x25117d[_0x86e8('0x16')][_0x86e8('0x19')],function(_0x3f8e1d){return{'model':db[_0x3f8e1d[_0x86e8('0x1a')]],'as':_0x3f8e1d['as'],'attributes':_0x3f8e1d['attributes'],'include':_0x3f8e1d[_0x86e8('0x19')]?_[_0x86e8('0x18')](_0x3f8e1d[_0x86e8('0x19')],function(_0x5dbe6c){return{'model':db[_0x5dbe6c[_0x86e8('0x1a')]],'as':_0x5dbe6c['as'],'attributes':_0x5dbe6c[_0x86e8('0x1b')],'include':_0x5dbe6c[_0x86e8('0x19')]?_['map'](_0x5dbe6c[_0x86e8('0x19')],function(_0x290312){return{'model':db[_0x290312[_0x86e8('0x1a')]],'as':_0x290312['as'],'attributes':_0x290312[_0x86e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x86e8('0x1c')](function(_0x1d7db2){logger[_0x86e8('0xa')](_0x86e8('0x14'),_0x25117d);logger[_0x86e8('0x1d')](_0x86e8('0x14'),_0x25117d,JSON[_0x86e8('0xd')](_0x1d7db2));_0x20d2ce(_0x1d7db2);})['catch'](function(_0x17b122){logger[_0x86e8('0xe')](_0x86e8('0x14'),_0x17b122[_0x86e8('0x10')],_0x25117d);_0x57be8(_0x3913de[_0x86e8('0xe')](0x1f4,_0x17b122[_0x86e8('0x10')]));});});};exports[_0x86e8('0x1e')]=function(_0x2379ac){var _0x5e8ca0=this;return new Promise(function(_0x5f08c2,_0x4c82b9){return db[_0x86e8('0x15')][_0x86e8('0x1f')]({'raw':_0x2379ac[_0x86e8('0x16')]?_0x2379ac['options'][_0x86e8('0x20')]===undefined?!![]:![]:!![],'where':_0x2379ac[_0x86e8('0x16')]?_0x2379ac['options'][_0x86e8('0x21')]||null:null,'attributes':_0x2379ac['options']?_0x2379ac[_0x86e8('0x16')][_0x86e8('0x1b')]||null:null,'include':_0x2379ac['options']?_0x2379ac[_0x86e8('0x16')][_0x86e8('0x19')]?_[_0x86e8('0x18')](_0x2379ac[_0x86e8('0x16')][_0x86e8('0x19')],function(_0x259ff6){return{'model':db[_0x259ff6['model']],'as':_0x259ff6['as'],'attributes':_0x259ff6['attributes'],'include':_0x259ff6[_0x86e8('0x19')]?_[_0x86e8('0x18')](_0x259ff6[_0x86e8('0x19')],function(_0x5ca35a){return{'model':db[_0x5ca35a[_0x86e8('0x1a')]],'as':_0x5ca35a['as'],'attributes':_0x5ca35a[_0x86e8('0x1b')],'include':_0x5ca35a[_0x86e8('0x19')]?_['map'](_0x5ca35a[_0x86e8('0x19')],function(_0x2503a4){return{'model':db[_0x2503a4['model']],'as':_0x2503a4['as'],'attributes':_0x2503a4[_0x86e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x86e8('0x1c')](function(_0x1fcc66){logger['info'](_0x86e8('0x1e'),_0x2379ac);logger[_0x86e8('0x1d')](_0x86e8('0x1e'),_0x2379ac,JSON[_0x86e8('0xd')](_0x1fcc66));_0x5f08c2(_0x1fcc66);})['catch'](function(_0x3e56b2){logger[_0x86e8('0xe')](_0x86e8('0x1e'),_0x3e56b2[_0x86e8('0x10')],_0x2379ac);_0x4c82b9(_0x5e8ca0[_0x86e8('0xe')](0x1f4,_0x3e56b2[_0x86e8('0x10')]));});});}; \ No newline at end of file +var _0x1766=['map','model','GetZendeskAccount','ShowZendeskAccount','raw','where','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','ZendeskAccount','findAll','options','attributes','include'];(function(_0x254697,_0x568bbc){var _0x5b030d=function(_0x563185){while(--_0x563185){_0x254697['push'](_0x254697['shift']());}};_0x5b030d(++_0x568bbc);}(_0x1766,0x17d));var _0x6176=function(_0x213c54,_0x334f8e){_0x213c54=_0x213c54-0x0;var _0x3968f1=_0x1766[_0x213c54];return _0x3968f1;};'use strict';var _=require(_0x6176('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6176('0x1'));var rs=require(_0x6176('0x2'));var fs=require('fs');var Redis=require(_0x6176('0x3'));var db=require(_0x6176('0x4'))['db'];var utils=require(_0x6176('0x5'));var logger=require(_0x6176('0x6'))('rpc');var config=require(_0x6176('0x7'));var jayson=require(_0x6176('0x8'));var client=jayson['client'][_0x6176('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x222f99,_0x32f0ea,_0x3878a4){return new BPromise(function(_0x481693,_0xf6ed98){return client[_0x6176('0xa')](_0x222f99,_0x3878a4)[_0x6176('0xb')](function(_0x1b5a24){logger[_0x6176('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x32f0ea,_0x6176('0xd'));logger[_0x6176('0xe')](_0x6176('0xf'),_0x32f0ea,'request\x20sent',JSON[_0x6176('0x10')](_0x1b5a24));if(_0x1b5a24['error']){if(_0x1b5a24[_0x6176('0x11')][_0x6176('0x12')]===0x1f4){logger[_0x6176('0x11')](_0x6176('0x13'),_0x32f0ea,_0x1b5a24[_0x6176('0x11')]['message']);return _0xf6ed98(_0x1b5a24[_0x6176('0x11')][_0x6176('0x14')]);}logger[_0x6176('0x11')](_0x6176('0x13'),_0x32f0ea,_0x1b5a24[_0x6176('0x11')][_0x6176('0x14')]);return _0x481693(_0x1b5a24[_0x6176('0x11')]['message']);}else{logger[_0x6176('0xc')](_0x6176('0x13'),_0x32f0ea,_0x6176('0xd'));_0x481693(_0x1b5a24[_0x6176('0x15')]['message']);}})['catch'](function(_0x546913){logger[_0x6176('0x11')](_0x6176('0x13'),_0x32f0ea,_0x546913);_0xf6ed98(_0x546913);});});}exports['GetZendeskAccount']=function(_0x548fd1){var _0x367b2c=this;return new Promise(function(_0x5bc005,_0x581368){return db[_0x6176('0x16')][_0x6176('0x17')]({'raw':_0x548fd1['options']?_0x548fd1[_0x6176('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x548fd1[_0x6176('0x18')]?_0x548fd1[_0x6176('0x18')]['where']||null:null,'attributes':_0x548fd1['options']?_0x548fd1[_0x6176('0x18')][_0x6176('0x19')]||null:null,'limit':_0x548fd1[_0x6176('0x18')]?_0x548fd1[_0x6176('0x18')]['limit']||null:null,'include':_0x548fd1[_0x6176('0x18')]?_0x548fd1['options'][_0x6176('0x1a')]?_[_0x6176('0x1b')](_0x548fd1[_0x6176('0x18')][_0x6176('0x1a')],function(_0x3bc605){return{'model':db[_0x3bc605[_0x6176('0x1c')]],'as':_0x3bc605['as'],'attributes':_0x3bc605[_0x6176('0x19')],'include':_0x3bc605[_0x6176('0x1a')]?_[_0x6176('0x1b')](_0x3bc605[_0x6176('0x1a')],function(_0xb0d33){return{'model':db[_0xb0d33[_0x6176('0x1c')]],'as':_0xb0d33['as'],'attributes':_0xb0d33['attributes'],'include':_0xb0d33[_0x6176('0x1a')]?_[_0x6176('0x1b')](_0xb0d33[_0x6176('0x1a')],function(_0x1daacb){return{'model':db[_0x1daacb[_0x6176('0x1c')]],'as':_0x1daacb['as'],'attributes':_0x1daacb[_0x6176('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6176('0xb')](function(_0x20dd73){logger[_0x6176('0xc')](_0x6176('0x1d'),_0x548fd1);logger[_0x6176('0xe')](_0x6176('0x1d'),_0x548fd1,JSON[_0x6176('0x10')](_0x20dd73));_0x5bc005(_0x20dd73);})['catch'](function(_0x2d86da){logger[_0x6176('0x11')](_0x6176('0x1d'),_0x2d86da[_0x6176('0x14')],_0x548fd1);_0x581368(_0x367b2c['error'](0x1f4,_0x2d86da[_0x6176('0x14')]));});});};exports[_0x6176('0x1e')]=function(_0x3f5a90){var _0x53618c=this;return new Promise(function(_0x44bf89,_0x5ec8f9){return db[_0x6176('0x16')]['find']({'raw':_0x3f5a90[_0x6176('0x18')]?_0x3f5a90['options'][_0x6176('0x1f')]===undefined?!![]:![]:!![],'where':_0x3f5a90['options']?_0x3f5a90[_0x6176('0x18')][_0x6176('0x20')]||null:null,'attributes':_0x3f5a90['options']?_0x3f5a90['options'][_0x6176('0x19')]||null:null,'include':_0x3f5a90[_0x6176('0x18')]?_0x3f5a90[_0x6176('0x18')][_0x6176('0x1a')]?_['map'](_0x3f5a90[_0x6176('0x18')][_0x6176('0x1a')],function(_0x56c1ed){return{'model':db[_0x56c1ed[_0x6176('0x1c')]],'as':_0x56c1ed['as'],'attributes':_0x56c1ed[_0x6176('0x19')],'include':_0x56c1ed['include']?_[_0x6176('0x1b')](_0x56c1ed[_0x6176('0x1a')],function(_0x108272){return{'model':db[_0x108272[_0x6176('0x1c')]],'as':_0x108272['as'],'attributes':_0x108272['attributes'],'include':_0x108272[_0x6176('0x1a')]?_['map'](_0x108272[_0x6176('0x1a')],function(_0x254554){return{'model':db[_0x254554[_0x6176('0x1c')]],'as':_0x254554['as'],'attributes':_0x254554['attributes']};}):[]};}):[]};}):[]:[]})[_0x6176('0xb')](function(_0x16e8af){logger[_0x6176('0xc')]('ShowZendeskAccount',_0x3f5a90);logger[_0x6176('0xe')](_0x6176('0x1e'),_0x3f5a90,JSON['stringify'](_0x16e8af));_0x44bf89(_0x16e8af);})[_0x6176('0x21')](function(_0x785f6a){logger[_0x6176('0x11')](_0x6176('0x1e'),_0x785f6a[_0x6176('0x14')],_0x3f5a90);_0x5ec8f9(_0x53618c[_0x6176('0x11')](0x1f4,_0x785f6a['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 0d35d2f..ef3e3c2 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 _0x57a7=['getTags','post','/:id/tags','put','/:id','update','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x57a7,0x1a6));var _0x757a=function(_0xfd1590,_0x2623ea){_0xfd1590=_0xfd1590-0x0;var _0x279814=_0x57a7[_0xfd1590];return _0x279814;};'use strict';var multer=require(_0x757a('0x0'));var util=require('util');var path=require(_0x757a('0x1'));var timeout=require('connect-timeout');var express=require(_0x757a('0x2'));var router=express['Router']();var auth=require(_0x757a('0x3'));var interaction=require(_0x757a('0x4'));var config=require(_0x757a('0x5'));var controller=require(_0x757a('0x6'));router[_0x757a('0x7')]('/',auth[_0x757a('0x8')](),controller[_0x757a('0x9')]);router[_0x757a('0x7')]('/:id',auth[_0x757a('0x8')](),controller[_0x757a('0xa')]);router['get'](_0x757a('0xb'),auth[_0x757a('0x8')](),controller[_0x757a('0xc')]);router[_0x757a('0x7')](_0x757a('0xd'),auth[_0x757a('0x8')](),controller['getSubjects']);router[_0x757a('0x7')]('/:id/descriptions',auth[_0x757a('0x8')](),controller[_0x757a('0xe')]);router[_0x757a('0x7')]('/:id/tags',auth[_0x757a('0x8')](),controller[_0x757a('0xf')]);router[_0x757a('0x10')]('/',auth[_0x757a('0x8')](),controller['create']);router[_0x757a('0x10')](_0x757a('0x11'),auth[_0x757a('0x8')](),controller['setTags']);router[_0x757a('0x12')](_0x757a('0x13'),auth['isAuthenticated'](),controller[_0x757a('0x14')]);router['delete'](_0x757a('0x13'),auth[_0x757a('0x8')](),controller[_0x757a('0x15')]);module[_0x757a('0x16')]=router; \ No newline at end of file +var _0xfa36=['show','getSubjects','getDescriptions','/:id/tags','post','create','setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','/:id'];(function(_0x94030f,_0x476ed2){var _0x9f7747=function(_0x2b977a){while(--_0x2b977a){_0x94030f['push'](_0x94030f['shift']());}};_0x9f7747(++_0x476ed2);}(_0xfa36,0x136));var _0x6fa3=function(_0x5a2d6e,_0x3d3a47){_0x5a2d6e=_0x5a2d6e-0x0;var _0x30ff59=_0xfa36[_0x5a2d6e];return _0x30ff59;};'use strict';var multer=require(_0x6fa3('0x0'));var util=require(_0x6fa3('0x1'));var path=require(_0x6fa3('0x2'));var timeout=require(_0x6fa3('0x3'));var express=require(_0x6fa3('0x4'));var router=express['Router']();var auth=require(_0x6fa3('0x5'));var interaction=require(_0x6fa3('0x6'));var config=require(_0x6fa3('0x7'));var controller=require(_0x6fa3('0x8'));router['get']('/',auth[_0x6fa3('0x9')](),controller['index']);router[_0x6fa3('0xa')](_0x6fa3('0xb'),auth[_0x6fa3('0x9')](),controller[_0x6fa3('0xc')]);router[_0x6fa3('0xa')]('/:id/fields',auth[_0x6fa3('0x9')](),controller['getFields']);router[_0x6fa3('0xa')]('/:id/subjects',auth[_0x6fa3('0x9')](),controller[_0x6fa3('0xd')]);router[_0x6fa3('0xa')]('/:id/descriptions',auth[_0x6fa3('0x9')](),controller[_0x6fa3('0xe')]);router[_0x6fa3('0xa')](_0x6fa3('0xf'),auth[_0x6fa3('0x9')](),controller['getTags']);router[_0x6fa3('0x10')]('/',auth[_0x6fa3('0x9')](),controller[_0x6fa3('0x11')]);router['post'](_0x6fa3('0xf'),auth[_0x6fa3('0x9')](),controller[_0x6fa3('0x12')]);router['put'](_0x6fa3('0xb'),auth[_0x6fa3('0x9')](),controller[_0x6fa3('0x13')]);router[_0x6fa3('0x14')](_0x6fa3('0xb'),auth[_0x6fa3('0x9')](),controller[_0x6fa3('0x15')]);module[_0x6fa3('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 91b0b8d..8b5de39 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 _0xbbe4=['sequelize','exports','STRING'];(function(_0x327008,_0x470061){var _0x1fd27d=function(_0x132647){while(--_0x132647){_0x327008['push'](_0x327008['shift']());}};_0x1fd27d(++_0x470061);}(_0xbbe4,0x1c8));var _0x4bbe=function(_0x58fa29,_0x1135f2){_0x58fa29=_0x58fa29-0x0;var _0x59044e=_0xbbe4[_0x58fa29];return _0x59044e;};'use strict';var Sequelize=require(_0x4bbe('0x0'));module[_0x4bbe('0x1')]={'name':{'type':Sequelize[_0x4bbe('0x2')]},'description':{'type':Sequelize[_0x4bbe('0x2')]}}; \ No newline at end of file +var _0x6fff=['STRING','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6fff,0x1c5));var _0xf6ff=function(_0x2f6471,_0x4c485a){_0x2f6471=_0x2f6471-0x0;var _0x296fbf=_0x6fff[_0x2f6471];return _0x296fbf;};'use strict';var Sequelize=require('sequelize');module[_0xf6ff('0x0')]={'name':{'type':Sequelize[_0xf6ff('0x1')]},'description':{'type':Sequelize[_0xf6ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index bcda90b..24c2938 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 _0xd5a5=['querystring','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','index','ZendeskConfiguration','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','type','key','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5a5,0x167));var _0x5d5a=function(_0x5d45a5,_0x39e0c6){_0x5d45a5=_0x5d45a5-0x0;var _0x4f59d1=_0xd5a5[_0x5d45a5];return _0x4f59d1;};'use strict';var pdf=require(_0x5d5a('0x0'));var emlformat=require(_0x5d5a('0x1'));var rimraf=require(_0x5d5a('0x2'));var zipdir=require(_0x5d5a('0x3'));var jsonpatch=require(_0x5d5a('0x4'));var rp=require(_0x5d5a('0x5'));var moment=require(_0x5d5a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5d5a('0x7'));var util=require(_0x5d5a('0x8'));var path=require(_0x5d5a('0x9'));var sox=require(_0x5d5a('0xa'));var csv=require(_0x5d5a('0xb'));var ejs=require(_0x5d5a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5d5a('0xd'));var crypto=require(_0x5d5a('0xe'));var jsforce=require(_0x5d5a('0xf'));var deskjs=require(_0x5d5a('0x10'));var toCsv=require(_0x5d5a('0xb'));var querystring=require(_0x5d5a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d5a('0x12'));var hardwareService=require(_0x5d5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5d5a('0x14'));var config=require(_0x5d5a('0x15'));var db=require(_0x5d5a('0x16'))['db'];var jayson=require(_0x5d5a('0x17'));var client=jayson[_0x5d5a('0x18')][_0x5d5a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x564ed7,_0x59d291,_0x4959f3){if(_0x4959f3){var _0x2c5c27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5c27['test'](_0x59d291)){return _0x564ed7;}else{throw new Error(_0x5d5a('0x1a'));}}else{return _0x564ed7;}}function respondWithRpcPromise(_0x5605ee,_0x28287c,_0x442bb2,_0x40e3ab){return new BPromise(function(_0xcebcca,_0x242080){var _0x25649e=_0x40e3ab||client;return _0x25649e[_0x5d5a('0x1b')](_0x5605ee,_0x442bb2)[_0x5d5a('0x1c')](function(_0x1e3d3c){logger[_0x5d5a('0x1d')](_0x5d5a('0x1e'),_0x28287c,_0x5d5a('0x1f'));logger[_0x5d5a('0x20')](_0x5d5a('0x21'),_0x28287c,'request\x20sent',JSON[_0x5d5a('0x22')](_0x1e3d3c));if(_0x1e3d3c[_0x5d5a('0x23')]){if(_0x1e3d3c['error'][_0x5d5a('0x24')]===0x1f4){logger['error'](_0x5d5a('0x1e'),_0x28287c,_0x1e3d3c[_0x5d5a('0x23')]['message']);return _0x242080(_0x1e3d3c[_0x5d5a('0x23')][_0x5d5a('0x25')]);}logger[_0x5d5a('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x28287c,_0x1e3d3c[_0x5d5a('0x23')]['message']);return _0xcebcca(_0x1e3d3c[_0x5d5a('0x23')]['message']);}else{logger[_0x5d5a('0x1d')](_0x5d5a('0x1e'),_0x28287c,_0x5d5a('0x1f'));_0xcebcca(_0x1e3d3c['result'][_0x5d5a('0x25')]);}})['catch'](function(_0xc9d603){logger[_0x5d5a('0x23')](_0x5d5a('0x1e'),_0x28287c,_0xc9d603);_0x242080(_0xc9d603);});});}function respondWithStatusCode(_0x32a6de,_0x435a01){_0x435a01=_0x435a01||0xcc;return function(_0x4c5a4d){if(_0x4c5a4d){return _0x32a6de['sendStatus'](_0x435a01);}return _0x32a6de[_0x5d5a('0x26')](_0x435a01)[_0x5d5a('0x27')]();};}function respondWithResult(_0x3d3ec9,_0x54c118){_0x54c118=_0x54c118||0xc8;return function(_0x4f9663){if(_0x4f9663){return _0x3d3ec9[_0x5d5a('0x26')](_0x54c118)['json'](_0x4f9663);}};}function respondWithFilteredResult(_0x132306,_0x20014c){return function(_0x24e7f2){if(_0x24e7f2){var _0x2a6616=_0x24e7f2[_0x5d5a('0x28')],_0xd477ea=_0x20014c[_0x5d5a('0x29')],_0x2ea2ad=_0x20014c['offset']+_0x20014c[_0x5d5a('0x2a')],_0x176ea3;if(_0x2ea2ad>=_0x2a6616){_0x2ea2ad=_0x2a6616;_0x176ea3=0xc8;}else{_0x176ea3=0xce;}_0x132306[_0x5d5a('0x26')](_0x176ea3);return _0x132306['set'](_0x5d5a('0x2b'),_0xd477ea+'-'+_0x2ea2ad+'/'+_0x2a6616)[_0x5d5a('0x2c')](_0x24e7f2);}return null;};}function patchUpdates(_0x53b1dd){return function(_0x1e4bf8){try{jsonpatch[_0x5d5a('0x2d')](_0x1e4bf8,_0x53b1dd,!![]);}catch(_0x1c04a0){return BPromise['reject'](_0x1c04a0);}return _0x1e4bf8[_0x5d5a('0x2e')]();};}function saveUpdates(_0x255442,_0x4638e3){return function(_0x34c3e9){if(_0x34c3e9){return _0x34c3e9[_0x5d5a('0x2f')](_0x255442)[_0x5d5a('0x1c')](function(_0x1e8066){return _0x1e8066;});}return null;};}function removeEntity(_0x28ca90,_0x4e9490){return function(_0x4e42d5){if(_0x4e42d5){return _0x4e42d5[_0x5d5a('0x30')]()['then'](function(){_0x28ca90['status'](0xcc)[_0x5d5a('0x27')]();});}};}function handleEntityNotFound(_0x5286de,_0x174fcd){return function(_0x56566d){if(!_0x56566d){_0x5286de[_0x5d5a('0x31')](0x194);}return _0x56566d;};}function handleError(_0x23fad3,_0x637eb2){_0x637eb2=_0x637eb2||0x1f4;return function(_0x318ec0){logger[_0x5d5a('0x23')](_0x318ec0[_0x5d5a('0x32')]);if(_0x318ec0[_0x5d5a('0x33')]){delete _0x318ec0[_0x5d5a('0x33')];}_0x23fad3[_0x5d5a('0x26')](_0x637eb2)['send'](_0x318ec0);};}exports[_0x5d5a('0x34')]=function(_0x54e9a6,_0x54026c){var _0x1c6774={},_0x4630cc={},_0x3bb0af={'count':0x0,'rows':[]};var _0x3a3642=db[_0x5d5a('0x35')][_0x5d5a('0x36')];_0x4630cc[_0x5d5a('0x37')]=_['keys'](_0x3a3642);_0x4630cc[_0x5d5a('0x38')]=_[_0x5d5a('0x39')](_0x54e9a6['query']);_0x4630cc[_0x5d5a('0x3a')]=_['intersection'](_0x4630cc[_0x5d5a('0x37')],_0x4630cc[_0x5d5a('0x38')]);_0x1c6774[_0x5d5a('0x3b')]=_[_0x5d5a('0x3c')](_0x4630cc[_0x5d5a('0x37')],qs[_0x5d5a('0x3d')](_0x54e9a6[_0x5d5a('0x38')][_0x5d5a('0x3d')]));_0x1c6774[_0x5d5a('0x3b')]=_0x1c6774[_0x5d5a('0x3b')][_0x5d5a('0x3e')]?_0x1c6774['attributes']:_0x4630cc[_0x5d5a('0x37')];if(!_0x54e9a6['query'][_0x5d5a('0x3f')](_0x5d5a('0x40'))){_0x1c6774[_0x5d5a('0x2a')]=qs[_0x5d5a('0x2a')](_0x54e9a6[_0x5d5a('0x38')]['limit']);_0x1c6774[_0x5d5a('0x29')]=qs[_0x5d5a('0x29')](_0x54e9a6[_0x5d5a('0x38')][_0x5d5a('0x29')]);}_0x1c6774[_0x5d5a('0x41')]=qs[_0x5d5a('0x42')](_0x54e9a6['query']['sort']);_0x1c6774['where']=qs[_0x5d5a('0x3a')](_['pick'](_0x54e9a6[_0x5d5a('0x38')],_0x4630cc[_0x5d5a('0x3a')]));if(_0x54e9a6[_0x5d5a('0x38')][_0x5d5a('0x43')]){_0x1c6774[_0x5d5a('0x44')]=_['merge'](_0x1c6774[_0x5d5a('0x44')],{'$or':_[_0x5d5a('0x45')](_0x3a3642,function(_0x50fb8b){if(_0x50fb8b[_0x5d5a('0x46')][_0x5d5a('0x47')]!==_0x5d5a('0x48')){var _0x546654={};_0x546654[_0x50fb8b['field']]={'$like':'%'+_0x54e9a6[_0x5d5a('0x38')][_0x5d5a('0x43')]+'%'};return _0x546654;}})});}_0x1c6774=_[_0x5d5a('0x49')]({},_0x1c6774,_0x54e9a6['options']);var _0xb2d633={'where':_0x1c6774['where']};return db[_0x5d5a('0x35')][_0x5d5a('0x28')](_0xb2d633)[_0x5d5a('0x1c')](function(_0x9fdfe1){_0x3bb0af[_0x5d5a('0x28')]=_0x9fdfe1;if(_0x54e9a6[_0x5d5a('0x38')][_0x5d5a('0x4a')]){_0x1c6774[_0x5d5a('0x4b')]=[{'all':!![]}];}return db[_0x5d5a('0x35')][_0x5d5a('0x4c')](_0x1c6774);})['then'](function(_0x39c37a){_0x3bb0af[_0x5d5a('0x4d')]=_0x39c37a;return _0x3bb0af;})['then'](respondWithFilteredResult(_0x54026c,_0x1c6774))[_0x5d5a('0x4e')](handleError(_0x54026c,null));};exports[_0x5d5a('0x4f')]=function(_0x58e075,_0x3d8759){var _0x1442e3={'raw':![],'where':{'id':_0x58e075[_0x5d5a('0x50')]['id']}},_0x208303={};_0x208303[_0x5d5a('0x37')]=_[_0x5d5a('0x39')](db[_0x5d5a('0x35')][_0x5d5a('0x36')]);_0x208303[_0x5d5a('0x38')]=_[_0x5d5a('0x39')](_0x58e075[_0x5d5a('0x38')]);_0x208303[_0x5d5a('0x3a')]=_[_0x5d5a('0x3c')](_0x208303[_0x5d5a('0x37')],_0x208303[_0x5d5a('0x38')]);_0x1442e3['attributes']=_[_0x5d5a('0x3c')](_0x208303['model'],qs[_0x5d5a('0x3d')](_0x58e075[_0x5d5a('0x38')][_0x5d5a('0x3d')]));_0x1442e3[_0x5d5a('0x3b')]=_0x1442e3[_0x5d5a('0x3b')][_0x5d5a('0x3e')]?_0x1442e3['attributes']:_0x208303[_0x5d5a('0x37')];if(_0x58e075[_0x5d5a('0x38')][_0x5d5a('0x4a')]){_0x1442e3['include']=[{'all':!![]}];}_0x1442e3=_['merge']({},_0x1442e3,_0x58e075[_0x5d5a('0x51')]);return db[_0x5d5a('0x35')][_0x5d5a('0x52')](_0x1442e3)[_0x5d5a('0x1c')](handleEntityNotFound(_0x3d8759,null))[_0x5d5a('0x1c')](respondWithResult(_0x3d8759,null))['catch'](handleError(_0x3d8759,null));};exports[_0x5d5a('0x53')]=function(_0x1c6cd8,_0x1ac4b0){return db[_0x5d5a('0x35')][_0x5d5a('0x53')](_0x1c6cd8[_0x5d5a('0x54')],{})[_0x5d5a('0x1c')](respondWithResult(_0x1ac4b0,0xc9))[_0x5d5a('0x4e')](handleError(_0x1ac4b0,null));};exports[_0x5d5a('0x2f')]=function(_0xa07e9c,_0x4fc3d9){if(_0xa07e9c[_0x5d5a('0x54')]['id']){delete _0xa07e9c['body']['id'];}return db[_0x5d5a('0x35')]['find']({'where':{'id':_0xa07e9c[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x4fc3d9,null))['then'](saveUpdates(_0xa07e9c[_0x5d5a('0x54')],null))[_0x5d5a('0x1c')](respondWithResult(_0x4fc3d9,null))[_0x5d5a('0x4e')](handleError(_0x4fc3d9,null));};exports[_0x5d5a('0x30')]=function(_0x271e02,_0xdbbc95){return db[_0x5d5a('0x35')][_0x5d5a('0x52')]({'where':{'id':_0x271e02[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0xdbbc95,null))[_0x5d5a('0x1c')](removeEntity(_0xdbbc95,null))[_0x5d5a('0x4e')](handleError(_0xdbbc95,null));};exports[_0x5d5a('0x55')]=function(_0x594b61,_0x909dd1,_0x4917ac){var _0xb9a51d={};var _0x4693ab={};var _0x467acc;var _0x5291f4;return db['ZendeskConfiguration'][_0x5d5a('0x56')]({'where':{'id':_0x594b61[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x909dd1,null))[_0x5d5a('0x1c')](function(_0xe51636){if(_0xe51636){_0x467acc=_0xe51636;_0x4693ab[_0x5d5a('0x37')]=_[_0x5d5a('0x39')](db[_0x5d5a('0x57')][_0x5d5a('0x36')]);_0x4693ab['query']=_['keys'](_0x594b61[_0x5d5a('0x38')]);_0x4693ab['filters']=_['intersection'](_0x4693ab[_0x5d5a('0x37')],_0x4693ab[_0x5d5a('0x38')]);_0xb9a51d[_0x5d5a('0x3b')]=_[_0x5d5a('0x3c')](_0x4693ab[_0x5d5a('0x37')],qs[_0x5d5a('0x3d')](_0x594b61[_0x5d5a('0x38')][_0x5d5a('0x3d')]));_0xb9a51d[_0x5d5a('0x3b')]=_0xb9a51d[_0x5d5a('0x3b')]['length']?_0xb9a51d[_0x5d5a('0x3b')]:_0x4693ab['model'];_0xb9a51d[_0x5d5a('0x41')]=qs['sort'](_0x594b61['query']['sort']);_0xb9a51d[_0x5d5a('0x44')]=qs['filters'](_[_0x5d5a('0x58')](_0x594b61['query'],_0x4693ab[_0x5d5a('0x3a')]));if(_0x594b61[_0x5d5a('0x38')][_0x5d5a('0x43')]){_0xb9a51d[_0x5d5a('0x44')]=_[_0x5d5a('0x49')](_0xb9a51d[_0x5d5a('0x44')],{'$or':_[_0x5d5a('0x45')](_0xb9a51d[_0x5d5a('0x3b')],function(_0x4ddb2f){var _0x503085={};_0x503085[_0x4ddb2f]={'$like':'%'+_0x594b61['query'][_0x5d5a('0x43')]+'%'};return _0x503085;})});}_0xb9a51d=_[_0x5d5a('0x49')]({},_0xb9a51d,_0x594b61[_0x5d5a('0x51')]);return _0x467acc[_0x5d5a('0x55')](_0xb9a51d);}})['then'](function(_0x3b6b87){if(_0x3b6b87){_0x5291f4=_0x3b6b87[_0x5d5a('0x3e')];if(!_0x594b61[_0x5d5a('0x38')][_0x5d5a('0x3f')](_0x5d5a('0x40'))){_0xb9a51d['limit']=qs[_0x5d5a('0x2a')](_0x594b61[_0x5d5a('0x38')][_0x5d5a('0x2a')]);_0xb9a51d[_0x5d5a('0x29')]=qs[_0x5d5a('0x29')](_0x594b61['query']['offset']);}return _0x467acc['getFields'](_0xb9a51d);}})[_0x5d5a('0x1c')](function(_0x1244be){if(_0x1244be){return _0x1244be?{'count':_0x5291f4,'rows':_0x1244be}:null;}})['then'](respondWithResult(_0x909dd1,null))['catch'](handleError(_0x909dd1,null));};exports['getSubjects']=function(_0x399c03,_0x50d6a0,_0x3440d3){var _0x1db3be={};var _0x2ee886={};var _0x528894;var _0x5718d8;return db[_0x5d5a('0x35')][_0x5d5a('0x56')]({'where':{'id':_0x399c03[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x50d6a0,null))['then'](function(_0x371929){if(_0x371929){_0x528894=_0x371929;_0x2ee886[_0x5d5a('0x37')]=_[_0x5d5a('0x39')](db[_0x5d5a('0x57')][_0x5d5a('0x36')]);_0x2ee886[_0x5d5a('0x38')]=_[_0x5d5a('0x39')](_0x399c03[_0x5d5a('0x38')]);_0x2ee886[_0x5d5a('0x3a')]=_[_0x5d5a('0x3c')](_0x2ee886[_0x5d5a('0x37')],_0x2ee886[_0x5d5a('0x38')]);_0x1db3be['attributes']=_[_0x5d5a('0x3c')](_0x2ee886[_0x5d5a('0x37')],qs['fields'](_0x399c03[_0x5d5a('0x38')][_0x5d5a('0x3d')]));_0x1db3be[_0x5d5a('0x3b')]=_0x1db3be[_0x5d5a('0x3b')][_0x5d5a('0x3e')]?_0x1db3be[_0x5d5a('0x3b')]:_0x2ee886[_0x5d5a('0x37')];_0x1db3be[_0x5d5a('0x41')]=qs[_0x5d5a('0x42')](_0x399c03[_0x5d5a('0x38')][_0x5d5a('0x42')]);_0x1db3be[_0x5d5a('0x44')]=qs[_0x5d5a('0x3a')](_[_0x5d5a('0x58')](_0x399c03['query'],_0x2ee886['filters']));if(_0x399c03[_0x5d5a('0x38')]['filter']){_0x1db3be[_0x5d5a('0x44')]=_[_0x5d5a('0x49')](_0x1db3be[_0x5d5a('0x44')],{'$or':_[_0x5d5a('0x45')](_0x1db3be['attributes'],function(_0x2a6ddb){var _0xa75539={};_0xa75539[_0x2a6ddb]={'$like':'%'+_0x399c03[_0x5d5a('0x38')][_0x5d5a('0x43')]+'%'};return _0xa75539;})});}_0x1db3be=_[_0x5d5a('0x49')]({},_0x1db3be,_0x399c03[_0x5d5a('0x51')]);return _0x528894[_0x5d5a('0x59')](_0x1db3be);}})[_0x5d5a('0x1c')](function(_0xe34bb2){if(_0xe34bb2){_0x5718d8=_0xe34bb2['length'];if(!_0x399c03['query']['hasOwnProperty'](_0x5d5a('0x40'))){_0x1db3be['limit']=qs[_0x5d5a('0x2a')](_0x399c03['query']['limit']);_0x1db3be['offset']=qs['offset'](_0x399c03[_0x5d5a('0x38')][_0x5d5a('0x29')]);}return _0x528894[_0x5d5a('0x59')](_0x1db3be);}})[_0x5d5a('0x1c')](function(_0x2853f){if(_0x2853f){return _0x2853f?{'count':_0x5718d8,'rows':_0x2853f}:null;}})[_0x5d5a('0x1c')](respondWithResult(_0x50d6a0,null))['catch'](handleError(_0x50d6a0,null));};exports[_0x5d5a('0x5a')]=function(_0x295095,_0x1c0707,_0x3f89ce){var _0x3af704={};var _0x1c1d85={};var _0x930a3c;var _0x3da074;return db[_0x5d5a('0x35')][_0x5d5a('0x56')]({'where':{'id':_0x295095[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x1c0707,null))[_0x5d5a('0x1c')](function(_0x337ccb){if(_0x337ccb){_0x930a3c=_0x337ccb;_0x1c1d85[_0x5d5a('0x37')]=_[_0x5d5a('0x39')](db[_0x5d5a('0x57')][_0x5d5a('0x36')]);_0x1c1d85[_0x5d5a('0x38')]=_[_0x5d5a('0x39')](_0x295095[_0x5d5a('0x38')]);_0x1c1d85[_0x5d5a('0x3a')]=_['intersection'](_0x1c1d85[_0x5d5a('0x37')],_0x1c1d85[_0x5d5a('0x38')]);_0x3af704[_0x5d5a('0x3b')]=_[_0x5d5a('0x3c')](_0x1c1d85[_0x5d5a('0x37')],qs[_0x5d5a('0x3d')](_0x295095[_0x5d5a('0x38')][_0x5d5a('0x3d')]));_0x3af704['attributes']=_0x3af704[_0x5d5a('0x3b')]['length']?_0x3af704[_0x5d5a('0x3b')]:_0x1c1d85[_0x5d5a('0x37')];_0x3af704[_0x5d5a('0x41')]=qs[_0x5d5a('0x42')](_0x295095[_0x5d5a('0x38')][_0x5d5a('0x42')]);_0x3af704[_0x5d5a('0x44')]=qs[_0x5d5a('0x3a')](_[_0x5d5a('0x58')](_0x295095[_0x5d5a('0x38')],_0x1c1d85[_0x5d5a('0x3a')]));if(_0x295095[_0x5d5a('0x38')][_0x5d5a('0x43')]){_0x3af704['where']=_[_0x5d5a('0x49')](_0x3af704['where'],{'$or':_['map'](_0x3af704[_0x5d5a('0x3b')],function(_0x2a8793){var _0x3a8d69={};_0x3a8d69[_0x2a8793]={'$like':'%'+_0x295095[_0x5d5a('0x38')]['filter']+'%'};return _0x3a8d69;})});}_0x3af704=_[_0x5d5a('0x49')]({},_0x3af704,_0x295095[_0x5d5a('0x51')]);return _0x930a3c[_0x5d5a('0x5a')](_0x3af704);}})[_0x5d5a('0x1c')](function(_0x4cec07){if(_0x4cec07){_0x3da074=_0x4cec07['length'];if(!_0x295095[_0x5d5a('0x38')]['hasOwnProperty'](_0x5d5a('0x40'))){_0x3af704[_0x5d5a('0x2a')]=qs['limit'](_0x295095[_0x5d5a('0x38')][_0x5d5a('0x2a')]);_0x3af704[_0x5d5a('0x29')]=qs[_0x5d5a('0x29')](_0x295095[_0x5d5a('0x38')][_0x5d5a('0x29')]);}return _0x930a3c[_0x5d5a('0x5a')](_0x3af704);}})[_0x5d5a('0x1c')](function(_0xb84eb6){if(_0xb84eb6){return _0xb84eb6?{'count':_0x3da074,'rows':_0xb84eb6}:null;}})['then'](respondWithResult(_0x1c0707,null))[_0x5d5a('0x4e')](handleError(_0x1c0707,null));};exports[_0x5d5a('0x5b')]=function(_0x311589,_0x8f6730,_0xa40ba8){var _0x374607={};var _0x59c075={};var _0xf6bb90;var _0x4c9179;return db['ZendeskConfiguration'][_0x5d5a('0x56')]({'where':{'id':_0x311589[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x8f6730,null))[_0x5d5a('0x1c')](function(_0x489b51){if(_0x489b51){_0xf6bb90=_0x489b51;_0x59c075[_0x5d5a('0x37')]=_[_0x5d5a('0x39')](db[_0x5d5a('0x5c')]['rawAttributes']);_0x59c075['query']=_['keys'](_0x311589[_0x5d5a('0x38')]);_0x59c075[_0x5d5a('0x3a')]=_['intersection'](_0x59c075[_0x5d5a('0x37')],_0x59c075[_0x5d5a('0x38')]);_0x374607[_0x5d5a('0x3b')]=_['intersection'](_0x59c075[_0x5d5a('0x37')],qs[_0x5d5a('0x3d')](_0x311589[_0x5d5a('0x38')]['fields']));_0x374607['attributes']=_0x374607['attributes'][_0x5d5a('0x3e')]?_0x374607[_0x5d5a('0x3b')]:_0x59c075[_0x5d5a('0x37')];_0x374607['order']=qs[_0x5d5a('0x42')](_0x311589[_0x5d5a('0x38')][_0x5d5a('0x42')]);_0x374607['where']=qs[_0x5d5a('0x3a')](_[_0x5d5a('0x58')](_0x311589[_0x5d5a('0x38')],_0x59c075['filters']));if(_0x311589[_0x5d5a('0x38')][_0x5d5a('0x43')]){_0x374607[_0x5d5a('0x44')]=_[_0x5d5a('0x49')](_0x374607['where'],{'$or':_[_0x5d5a('0x45')](_0x374607[_0x5d5a('0x3b')],function(_0x3fe80a){var _0xa51975={};_0xa51975[_0x3fe80a]={'$like':'%'+_0x311589['query'][_0x5d5a('0x43')]+'%'};return _0xa51975;})});}_0x374607=_['merge']({},_0x374607,_0x311589[_0x5d5a('0x51')]);return _0xf6bb90[_0x5d5a('0x5b')](_0x374607);}})[_0x5d5a('0x1c')](function(_0x5d92f3){if(_0x5d92f3){_0x4c9179=_0x5d92f3[_0x5d5a('0x3e')];if(!_0x311589['query'][_0x5d5a('0x3f')](_0x5d5a('0x40'))){_0x374607['limit']=qs[_0x5d5a('0x2a')](_0x311589[_0x5d5a('0x38')][_0x5d5a('0x2a')]);_0x374607[_0x5d5a('0x29')]=qs[_0x5d5a('0x29')](_0x311589[_0x5d5a('0x38')][_0x5d5a('0x29')]);}return _0xf6bb90[_0x5d5a('0x5b')](_0x374607);}})['then'](function(_0x4f0403){if(_0x4f0403){return _0x4f0403?{'count':_0x4c9179,'rows':_0x4f0403}:null;}})[_0x5d5a('0x1c')](respondWithResult(_0x8f6730,null))[_0x5d5a('0x4e')](handleError(_0x8f6730,null));};exports[_0x5d5a('0x5d')]=function(_0x394438,_0x2cd079,_0x333cd6){if(_0x394438[_0x5d5a('0x54')]['id']){delete _0x394438['body']['id'];}return db['ZendeskConfiguration'][_0x5d5a('0x56')]({'where':{'id':_0x394438[_0x5d5a('0x50')]['id']}})[_0x5d5a('0x1c')](handleEntityNotFound(_0x2cd079,null))[_0x5d5a('0x1c')](function(_0x381069){if(_0x381069){return _0x381069['setTags'](_0x394438[_0x5d5a('0x54')]['ids']||[]);}return null;})[_0x5d5a('0x1c')](respondWithResult(_0x2cd079,null))['catch'](handleError(_0x2cd079,null));}; \ No newline at end of file +var _0x31c4=['findAll','rows','catch','params','includeAll','find','create','body','update','getFields','findOne','sort','hasOwnProperty','ZendeskField','map','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','filters','pick','filter','where','key','VIRTUAL','merge','options','include'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x31c4,0x1d1));var _0x431c=function(_0xf392b4,_0x4bf808){_0xf392b4=_0xf392b4-0x0;var _0x37179e=_0x31c4[_0xf392b4];return _0x37179e;};'use strict';var pdf=require(_0x431c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x431c('0x1'));var zipdir=require(_0x431c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x431c('0x3'));var BPromise=require(_0x431c('0x4'));var Mustache=require(_0x431c('0x5'));var util=require(_0x431c('0x6'));var path=require(_0x431c('0x7'));var sox=require(_0x431c('0x8'));var csv=require(_0x431c('0x9'));var ejs=require(_0x431c('0xa'));var fs=require('fs');var _=require(_0x431c('0xb'));var squel=require(_0x431c('0xc'));var crypto=require(_0x431c('0xd'));var jsforce=require(_0x431c('0xe'));var deskjs=require(_0x431c('0xf'));var toCsv=require(_0x431c('0x9'));var querystring=require('querystring');var Papa=require(_0x431c('0x10'));var Redis=require(_0x431c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x431c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x431c('0x13'));var utils=require(_0x431c('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x431c('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x14d40d,_0x5c063f,_0x512357){if(_0x512357){var _0x2bfd19=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bfd19[_0x431c('0x16')](_0x5c063f)){return _0x14d40d;}else{throw new Error(_0x431c('0x17'));}}else{return _0x14d40d;}}function respondWithRpcPromise(_0x329704,_0x5758be,_0x2c9ff9,_0x3a5c6f){return new BPromise(function(_0x3bb004,_0x329cd1){var _0x3b7fd3=_0x3a5c6f||client;return _0x3b7fd3[_0x431c('0x18')](_0x329704,_0x2c9ff9)['then'](function(_0x3350f9){logger[_0x431c('0x19')](_0x431c('0x1a'),_0x5758be,'request\x20sent');logger['debug'](_0x431c('0x1b'),_0x5758be,_0x431c('0x1c'),JSON[_0x431c('0x1d')](_0x3350f9));if(_0x3350f9['error']){if(_0x3350f9[_0x431c('0x1e')][_0x431c('0x1f')]===0x1f4){logger[_0x431c('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5758be,_0x3350f9[_0x431c('0x1e')][_0x431c('0x20')]);return _0x329cd1(_0x3350f9[_0x431c('0x1e')][_0x431c('0x20')]);}logger[_0x431c('0x1e')](_0x431c('0x1a'),_0x5758be,_0x3350f9[_0x431c('0x1e')][_0x431c('0x20')]);return _0x3bb004(_0x3350f9[_0x431c('0x1e')]['message']);}else{logger[_0x431c('0x19')](_0x431c('0x1a'),_0x5758be,_0x431c('0x1c'));_0x3bb004(_0x3350f9[_0x431c('0x21')][_0x431c('0x20')]);}})['catch'](function(_0x51125a){logger['error'](_0x431c('0x1a'),_0x5758be,_0x51125a);_0x329cd1(_0x51125a);});});}function respondWithStatusCode(_0x1922da,_0x5ddddf){_0x5ddddf=_0x5ddddf||0xcc;return function(_0x3cd8b4){if(_0x3cd8b4){return _0x1922da[_0x431c('0x22')](_0x5ddddf);}return _0x1922da[_0x431c('0x23')](_0x5ddddf)['end']();};}function respondWithResult(_0x298cba,_0x19359b){_0x19359b=_0x19359b||0xc8;return function(_0x39594e){if(_0x39594e){return _0x298cba[_0x431c('0x23')](_0x19359b)[_0x431c('0x24')](_0x39594e);}};}function respondWithFilteredResult(_0x4fa1ab,_0x43bbd3){return function(_0x4f5569){if(_0x4f5569){var _0x51a578=_0x4f5569[_0x431c('0x25')],_0x8a667b=_0x43bbd3[_0x431c('0x26')],_0xdcbea1=_0x43bbd3[_0x431c('0x26')]+_0x43bbd3[_0x431c('0x27')],_0x34fd97;if(_0xdcbea1>=_0x51a578){_0xdcbea1=_0x51a578;_0x34fd97=0xc8;}else{_0x34fd97=0xce;}_0x4fa1ab[_0x431c('0x23')](_0x34fd97);return _0x4fa1ab[_0x431c('0x28')](_0x431c('0x29'),_0x8a667b+'-'+_0xdcbea1+'/'+_0x51a578)[_0x431c('0x24')](_0x4f5569);}return null;};}function patchUpdates(_0x118a49){return function(_0x347ad0){try{jsonpatch[_0x431c('0x2a')](_0x347ad0,_0x118a49,!![]);}catch(_0x27837f){return BPromise['reject'](_0x27837f);}return _0x347ad0[_0x431c('0x2b')]();};}function saveUpdates(_0x112b21,_0x2e3362){return function(_0x877656){if(_0x877656){return _0x877656['update'](_0x112b21)['then'](function(_0x13ea94){return _0x13ea94;});}return null;};}function removeEntity(_0x7e0d15,_0x50f124){return function(_0x5e2b9f){if(_0x5e2b9f){return _0x5e2b9f['destroy']()[_0x431c('0x2c')](function(){_0x7e0d15[_0x431c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa802d2,_0xec80f1){return function(_0x492b10){if(!_0x492b10){_0xa802d2[_0x431c('0x22')](0x194);}return _0x492b10;};}function handleError(_0xea7daf,_0x3c27dd){_0x3c27dd=_0x3c27dd||0x1f4;return function(_0x2e5295){logger[_0x431c('0x1e')](_0x2e5295[_0x431c('0x2d')]);if(_0x2e5295[_0x431c('0x2e')]){delete _0x2e5295[_0x431c('0x2e')];}_0xea7daf[_0x431c('0x23')](_0x3c27dd)[_0x431c('0x2f')](_0x2e5295);};}exports[_0x431c('0x30')]=function(_0x4c7aa9,_0x51498e){var _0x418c6c={},_0x3f8c3b={},_0xadd7ff={'count':0x0,'rows':[]};var _0xe19dbb=db[_0x431c('0x31')][_0x431c('0x32')];_0x3f8c3b[_0x431c('0x33')]=_[_0x431c('0x34')](_0xe19dbb);_0x3f8c3b[_0x431c('0x35')]=_[_0x431c('0x34')](_0x4c7aa9[_0x431c('0x35')]);_0x3f8c3b['filters']=_[_0x431c('0x36')](_0x3f8c3b[_0x431c('0x33')],_0x3f8c3b[_0x431c('0x35')]);_0x418c6c[_0x431c('0x37')]=_[_0x431c('0x36')](_0x3f8c3b[_0x431c('0x33')],qs['fields'](_0x4c7aa9['query'][_0x431c('0x38')]));_0x418c6c['attributes']=_0x418c6c[_0x431c('0x37')][_0x431c('0x39')]?_0x418c6c[_0x431c('0x37')]:_0x3f8c3b[_0x431c('0x33')];if(!_0x4c7aa9['query']['hasOwnProperty'](_0x431c('0x3a'))){_0x418c6c[_0x431c('0x27')]=qs[_0x431c('0x27')](_0x4c7aa9[_0x431c('0x35')][_0x431c('0x27')]);_0x418c6c[_0x431c('0x26')]=qs[_0x431c('0x26')](_0x4c7aa9[_0x431c('0x35')]['offset']);}_0x418c6c[_0x431c('0x3b')]=qs['sort'](_0x4c7aa9[_0x431c('0x35')]['sort']);_0x418c6c['where']=qs[_0x431c('0x3c')](_[_0x431c('0x3d')](_0x4c7aa9[_0x431c('0x35')],_0x3f8c3b[_0x431c('0x3c')]));if(_0x4c7aa9[_0x431c('0x35')][_0x431c('0x3e')]){_0x418c6c['where']=_['merge'](_0x418c6c[_0x431c('0x3f')],{'$or':_['map'](_0xe19dbb,function(_0x5bd627){if(_0x5bd627['type'][_0x431c('0x40')]!==_0x431c('0x41')){var _0x5f00a8={};_0x5f00a8[_0x5bd627['field']]={'$like':'%'+_0x4c7aa9['query']['filter']+'%'};return _0x5f00a8;}})});}_0x418c6c=_[_0x431c('0x42')]({},_0x418c6c,_0x4c7aa9[_0x431c('0x43')]);var _0x3ea213={'where':_0x418c6c['where']};return db[_0x431c('0x31')][_0x431c('0x25')](_0x3ea213)[_0x431c('0x2c')](function(_0x595ea9){_0xadd7ff[_0x431c('0x25')]=_0x595ea9;if(_0x4c7aa9[_0x431c('0x35')]['includeAll']){_0x418c6c[_0x431c('0x44')]=[{'all':!![]}];}return db[_0x431c('0x31')][_0x431c('0x45')](_0x418c6c);})[_0x431c('0x2c')](function(_0x5b38e2){_0xadd7ff[_0x431c('0x46')]=_0x5b38e2;return _0xadd7ff;})['then'](respondWithFilteredResult(_0x51498e,_0x418c6c))[_0x431c('0x47')](handleError(_0x51498e,null));};exports['show']=function(_0x406aa5,_0x2b50f8){var _0x11f015={'raw':![],'where':{'id':_0x406aa5[_0x431c('0x48')]['id']}},_0xe1d100={};_0xe1d100[_0x431c('0x33')]=_[_0x431c('0x34')](db[_0x431c('0x31')][_0x431c('0x32')]);_0xe1d100['query']=_[_0x431c('0x34')](_0x406aa5['query']);_0xe1d100['filters']=_['intersection'](_0xe1d100[_0x431c('0x33')],_0xe1d100[_0x431c('0x35')]);_0x11f015[_0x431c('0x37')]=_[_0x431c('0x36')](_0xe1d100[_0x431c('0x33')],qs[_0x431c('0x38')](_0x406aa5['query'][_0x431c('0x38')]));_0x11f015[_0x431c('0x37')]=_0x11f015['attributes']['length']?_0x11f015[_0x431c('0x37')]:_0xe1d100[_0x431c('0x33')];if(_0x406aa5[_0x431c('0x35')][_0x431c('0x49')]){_0x11f015['include']=[{'all':!![]}];}_0x11f015=_[_0x431c('0x42')]({},_0x11f015,_0x406aa5['options']);return db[_0x431c('0x31')][_0x431c('0x4a')](_0x11f015)['then'](handleEntityNotFound(_0x2b50f8,null))['then'](respondWithResult(_0x2b50f8,null))[_0x431c('0x47')](handleError(_0x2b50f8,null));};exports['create']=function(_0x3909d5,_0x4977d5){return db['ZendeskConfiguration'][_0x431c('0x4b')](_0x3909d5[_0x431c('0x4c')],{})['then'](respondWithResult(_0x4977d5,0xc9))[_0x431c('0x47')](handleError(_0x4977d5,null));};exports[_0x431c('0x4d')]=function(_0x2d9dc2,_0x22ab8e){if(_0x2d9dc2[_0x431c('0x4c')]['id']){delete _0x2d9dc2[_0x431c('0x4c')]['id'];}return db[_0x431c('0x31')][_0x431c('0x4a')]({'where':{'id':_0x2d9dc2[_0x431c('0x48')]['id']}})[_0x431c('0x2c')](handleEntityNotFound(_0x22ab8e,null))['then'](saveUpdates(_0x2d9dc2['body'],null))[_0x431c('0x2c')](respondWithResult(_0x22ab8e,null))[_0x431c('0x47')](handleError(_0x22ab8e,null));};exports['destroy']=function(_0x1cac82,_0xfdec9a){return db[_0x431c('0x31')]['find']({'where':{'id':_0x1cac82[_0x431c('0x48')]['id']}})[_0x431c('0x2c')](handleEntityNotFound(_0xfdec9a,null))['then'](removeEntity(_0xfdec9a,null))[_0x431c('0x47')](handleError(_0xfdec9a,null));};exports[_0x431c('0x4e')]=function(_0x1a9e98,_0x34e495,_0x33fbf4){var _0x436e67={};var _0x5a4084={};var _0x51e4dc;var _0x7e1659;return db[_0x431c('0x31')][_0x431c('0x4f')]({'where':{'id':_0x1a9e98['params']['id']}})['then'](handleEntityNotFound(_0x34e495,null))[_0x431c('0x2c')](function(_0x1a6a83){if(_0x1a6a83){_0x51e4dc=_0x1a6a83;_0x5a4084['model']=_[_0x431c('0x34')](db['ZendeskField'][_0x431c('0x32')]);_0x5a4084['query']=_[_0x431c('0x34')](_0x1a9e98[_0x431c('0x35')]);_0x5a4084['filters']=_['intersection'](_0x5a4084['model'],_0x5a4084['query']);_0x436e67[_0x431c('0x37')]=_[_0x431c('0x36')](_0x5a4084['model'],qs[_0x431c('0x38')](_0x1a9e98['query'][_0x431c('0x38')]));_0x436e67['attributes']=_0x436e67[_0x431c('0x37')][_0x431c('0x39')]?_0x436e67[_0x431c('0x37')]:_0x5a4084['model'];_0x436e67[_0x431c('0x3b')]=qs['sort'](_0x1a9e98[_0x431c('0x35')][_0x431c('0x50')]);_0x436e67[_0x431c('0x3f')]=qs['filters'](_[_0x431c('0x3d')](_0x1a9e98['query'],_0x5a4084[_0x431c('0x3c')]));if(_0x1a9e98[_0x431c('0x35')]['filter']){_0x436e67['where']=_[_0x431c('0x42')](_0x436e67[_0x431c('0x3f')],{'$or':_['map'](_0x436e67[_0x431c('0x37')],function(_0x356697){var _0x17e17c={};_0x17e17c[_0x356697]={'$like':'%'+_0x1a9e98[_0x431c('0x35')][_0x431c('0x3e')]+'%'};return _0x17e17c;})});}_0x436e67=_[_0x431c('0x42')]({},_0x436e67,_0x1a9e98[_0x431c('0x43')]);return _0x51e4dc[_0x431c('0x4e')](_0x436e67);}})[_0x431c('0x2c')](function(_0x25485d){if(_0x25485d){_0x7e1659=_0x25485d['length'];if(!_0x1a9e98['query'][_0x431c('0x51')](_0x431c('0x3a'))){_0x436e67[_0x431c('0x27')]=qs[_0x431c('0x27')](_0x1a9e98['query'][_0x431c('0x27')]);_0x436e67['offset']=qs[_0x431c('0x26')](_0x1a9e98[_0x431c('0x35')][_0x431c('0x26')]);}return _0x51e4dc[_0x431c('0x4e')](_0x436e67);}})[_0x431c('0x2c')](function(_0x3aabca){if(_0x3aabca){return _0x3aabca?{'count':_0x7e1659,'rows':_0x3aabca}:null;}})[_0x431c('0x2c')](respondWithResult(_0x34e495,null))['catch'](handleError(_0x34e495,null));};exports['getSubjects']=function(_0x1c1ddb,_0x40d049,_0x55da0b){var _0xe834ee={};var _0x511951={};var _0x360cd8;var _0x4cfc16;return db[_0x431c('0x31')][_0x431c('0x4f')]({'where':{'id':_0x1c1ddb[_0x431c('0x48')]['id']}})['then'](handleEntityNotFound(_0x40d049,null))[_0x431c('0x2c')](function(_0x4f2079){if(_0x4f2079){_0x360cd8=_0x4f2079;_0x511951[_0x431c('0x33')]=_['keys'](db[_0x431c('0x52')][_0x431c('0x32')]);_0x511951['query']=_[_0x431c('0x34')](_0x1c1ddb[_0x431c('0x35')]);_0x511951[_0x431c('0x3c')]=_['intersection'](_0x511951[_0x431c('0x33')],_0x511951[_0x431c('0x35')]);_0xe834ee[_0x431c('0x37')]=_[_0x431c('0x36')](_0x511951[_0x431c('0x33')],qs['fields'](_0x1c1ddb[_0x431c('0x35')][_0x431c('0x38')]));_0xe834ee[_0x431c('0x37')]=_0xe834ee[_0x431c('0x37')][_0x431c('0x39')]?_0xe834ee['attributes']:_0x511951['model'];_0xe834ee[_0x431c('0x3b')]=qs[_0x431c('0x50')](_0x1c1ddb[_0x431c('0x35')]['sort']);_0xe834ee['where']=qs[_0x431c('0x3c')](_['pick'](_0x1c1ddb['query'],_0x511951['filters']));if(_0x1c1ddb['query'][_0x431c('0x3e')]){_0xe834ee[_0x431c('0x3f')]=_[_0x431c('0x42')](_0xe834ee[_0x431c('0x3f')],{'$or':_[_0x431c('0x53')](_0xe834ee['attributes'],function(_0x5970b1){var _0x1fb687={};_0x1fb687[_0x5970b1]={'$like':'%'+_0x1c1ddb[_0x431c('0x35')][_0x431c('0x3e')]+'%'};return _0x1fb687;})});}_0xe834ee=_[_0x431c('0x42')]({},_0xe834ee,_0x1c1ddb[_0x431c('0x43')]);return _0x360cd8['getSubjects'](_0xe834ee);}})[_0x431c('0x2c')](function(_0x33a1f5){if(_0x33a1f5){_0x4cfc16=_0x33a1f5['length'];if(!_0x1c1ddb[_0x431c('0x35')][_0x431c('0x51')](_0x431c('0x3a'))){_0xe834ee[_0x431c('0x27')]=qs[_0x431c('0x27')](_0x1c1ddb[_0x431c('0x35')][_0x431c('0x27')]);_0xe834ee[_0x431c('0x26')]=qs[_0x431c('0x26')](_0x1c1ddb[_0x431c('0x35')][_0x431c('0x26')]);}return _0x360cd8['getSubjects'](_0xe834ee);}})['then'](function(_0x47b5c3){if(_0x47b5c3){return _0x47b5c3?{'count':_0x4cfc16,'rows':_0x47b5c3}:null;}})[_0x431c('0x2c')](respondWithResult(_0x40d049,null))[_0x431c('0x47')](handleError(_0x40d049,null));};exports[_0x431c('0x54')]=function(_0x53f95b,_0x1c891b,_0x362753){var _0x4ba872={};var _0x311fc8={};var _0x2db287;var _0x50e920;return db[_0x431c('0x31')][_0x431c('0x4f')]({'where':{'id':_0x53f95b[_0x431c('0x48')]['id']}})[_0x431c('0x2c')](handleEntityNotFound(_0x1c891b,null))[_0x431c('0x2c')](function(_0x1cf608){if(_0x1cf608){_0x2db287=_0x1cf608;_0x311fc8[_0x431c('0x33')]=_['keys'](db['ZendeskField'][_0x431c('0x32')]);_0x311fc8[_0x431c('0x35')]=_[_0x431c('0x34')](_0x53f95b[_0x431c('0x35')]);_0x311fc8[_0x431c('0x3c')]=_['intersection'](_0x311fc8[_0x431c('0x33')],_0x311fc8['query']);_0x4ba872[_0x431c('0x37')]=_[_0x431c('0x36')](_0x311fc8[_0x431c('0x33')],qs['fields'](_0x53f95b['query'][_0x431c('0x38')]));_0x4ba872[_0x431c('0x37')]=_0x4ba872[_0x431c('0x37')][_0x431c('0x39')]?_0x4ba872[_0x431c('0x37')]:_0x311fc8[_0x431c('0x33')];_0x4ba872[_0x431c('0x3b')]=qs['sort'](_0x53f95b['query'][_0x431c('0x50')]);_0x4ba872[_0x431c('0x3f')]=qs['filters'](_[_0x431c('0x3d')](_0x53f95b[_0x431c('0x35')],_0x311fc8[_0x431c('0x3c')]));if(_0x53f95b[_0x431c('0x35')][_0x431c('0x3e')]){_0x4ba872[_0x431c('0x3f')]=_['merge'](_0x4ba872[_0x431c('0x3f')],{'$or':_[_0x431c('0x53')](_0x4ba872[_0x431c('0x37')],function(_0x23bc25){var _0x466abd={};_0x466abd[_0x23bc25]={'$like':'%'+_0x53f95b[_0x431c('0x35')][_0x431c('0x3e')]+'%'};return _0x466abd;})});}_0x4ba872=_[_0x431c('0x42')]({},_0x4ba872,_0x53f95b[_0x431c('0x43')]);return _0x2db287['getDescriptions'](_0x4ba872);}})['then'](function(_0x526910){if(_0x526910){_0x50e920=_0x526910['length'];if(!_0x53f95b[_0x431c('0x35')]['hasOwnProperty'](_0x431c('0x3a'))){_0x4ba872[_0x431c('0x27')]=qs[_0x431c('0x27')](_0x53f95b['query']['limit']);_0x4ba872[_0x431c('0x26')]=qs[_0x431c('0x26')](_0x53f95b['query']['offset']);}return _0x2db287['getDescriptions'](_0x4ba872);}})[_0x431c('0x2c')](function(_0x4193e3){if(_0x4193e3){return _0x4193e3?{'count':_0x50e920,'rows':_0x4193e3}:null;}})[_0x431c('0x2c')](respondWithResult(_0x1c891b,null))['catch'](handleError(_0x1c891b,null));};exports[_0x431c('0x55')]=function(_0x536402,_0xbd56df,_0x55eb24){var _0x22c0ee={};var _0xe8d6ea={};var _0x428169;var _0x189543;return db[_0x431c('0x31')][_0x431c('0x4f')]({'where':{'id':_0x536402[_0x431c('0x48')]['id']}})['then'](handleEntityNotFound(_0xbd56df,null))[_0x431c('0x2c')](function(_0x24ab36){if(_0x24ab36){_0x428169=_0x24ab36;_0xe8d6ea['model']=_[_0x431c('0x34')](db[_0x431c('0x56')]['rawAttributes']);_0xe8d6ea[_0x431c('0x35')]=_[_0x431c('0x34')](_0x536402['query']);_0xe8d6ea[_0x431c('0x3c')]=_[_0x431c('0x36')](_0xe8d6ea['model'],_0xe8d6ea[_0x431c('0x35')]);_0x22c0ee[_0x431c('0x37')]=_[_0x431c('0x36')](_0xe8d6ea[_0x431c('0x33')],qs[_0x431c('0x38')](_0x536402[_0x431c('0x35')][_0x431c('0x38')]));_0x22c0ee[_0x431c('0x37')]=_0x22c0ee[_0x431c('0x37')]['length']?_0x22c0ee[_0x431c('0x37')]:_0xe8d6ea['model'];_0x22c0ee['order']=qs[_0x431c('0x50')](_0x536402[_0x431c('0x35')][_0x431c('0x50')]);_0x22c0ee[_0x431c('0x3f')]=qs[_0x431c('0x3c')](_['pick'](_0x536402['query'],_0xe8d6ea[_0x431c('0x3c')]));if(_0x536402[_0x431c('0x35')][_0x431c('0x3e')]){_0x22c0ee[_0x431c('0x3f')]=_[_0x431c('0x42')](_0x22c0ee[_0x431c('0x3f')],{'$or':_[_0x431c('0x53')](_0x22c0ee[_0x431c('0x37')],function(_0x236dd7){var _0x322de2={};_0x322de2[_0x236dd7]={'$like':'%'+_0x536402[_0x431c('0x35')]['filter']+'%'};return _0x322de2;})});}_0x22c0ee=_[_0x431c('0x42')]({},_0x22c0ee,_0x536402[_0x431c('0x43')]);return _0x428169[_0x431c('0x55')](_0x22c0ee);}})['then'](function(_0x3f8241){if(_0x3f8241){_0x189543=_0x3f8241['length'];if(!_0x536402[_0x431c('0x35')][_0x431c('0x51')](_0x431c('0x3a'))){_0x22c0ee[_0x431c('0x27')]=qs['limit'](_0x536402[_0x431c('0x35')]['limit']);_0x22c0ee[_0x431c('0x26')]=qs['offset'](_0x536402[_0x431c('0x35')][_0x431c('0x26')]);}return _0x428169[_0x431c('0x55')](_0x22c0ee);}})[_0x431c('0x2c')](function(_0x3a1c85){if(_0x3a1c85){return _0x3a1c85?{'count':_0x189543,'rows':_0x3a1c85}:null;}})[_0x431c('0x2c')](respondWithResult(_0xbd56df,null))['catch'](handleError(_0xbd56df,null));};exports[_0x431c('0x57')]=function(_0x416f5c,_0x1eadb1,_0x148d2a){if(_0x416f5c[_0x431c('0x4c')]['id']){delete _0x416f5c[_0x431c('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x431c('0x4f')]({'where':{'id':_0x416f5c[_0x431c('0x48')]['id']}})[_0x431c('0x2c')](handleEntityNotFound(_0x1eadb1,null))['then'](function(_0x22c353){if(_0x22c353){return _0x22c353['setTags'](_0x416f5c[_0x431c('0x4c')][_0x431c('0x58')]||[]);}return null;})[_0x431c('0x2c')](respondWithResult(_0x1eadb1,null))[_0x431c('0x47')](handleError(_0x1eadb1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6774247..0648034 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 _0x4165=['request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x4165,0x13b));var _0x5416=function(_0x22dd1f,_0x24f856){_0x22dd1f=_0x22dd1f-0x0;var _0x3df220=_0x4165[_0x22dd1f];return _0x3df220;};'use strict';var _=require('lodash');var util=require(_0x5416('0x0'));var logger=require(_0x5416('0x1'))(_0x5416('0x2'));var moment=require(_0x5416('0x3'));var BPromise=require('bluebird');var rp=require(_0x5416('0x4'));var fs=require('fs');var path=require(_0x5416('0x5'));var rimraf=require(_0x5416('0x6'));var config=require('../../config/environment');var attributes=require(_0x5416('0x7'));module['exports']=function(_0xef8afd,_0x62b384){return _0xef8afd[_0x5416('0x8')](_0x5416('0x9'),attributes,{'tableName':_0x5416('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x951f=['moment','bluebird','request-promise','path','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x951f,0x104));var _0xf951=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x951f[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xf951('0x0'));var util=require(_0xf951('0x1'));var logger=require(_0xf951('0x2'))(_0xf951('0x3'));var moment=require(_0xf951('0x4'));var BPromise=require(_0xf951('0x5'));var rp=require(_0xf951('0x6'));var fs=require('fs');var path=require(_0xf951('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xf951('0x8')]=function(_0x15c582,_0x13cae4){return _0x15c582[_0xf951('0x9')](_0xf951('0xa'),attributes,{'tableName':_0xf951('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index e60b672..98b6503 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 _0x11f0=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x11f0,0xd1));var _0x011f=function(_0x5e557e,_0xd270e9){_0x5e557e=_0x5e557e-0x0;var _0x1e3f73=_0x11f0[_0x5e557e];return _0x1e3f73;};'use strict';var _=require(_0x011f('0x0'));var util=require(_0x011f('0x1'));var moment=require('moment');var BPromise=require(_0x011f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x011f('0x3'));var db=require(_0x011f('0x4'))['db'];var utils=require(_0x011f('0x5'));var logger=require(_0x011f('0x6'))(_0x011f('0x7'));var config=require('../../config/environment');var jayson=require(_0x011f('0x8'));var client=jayson[_0x011f('0x9')][_0x011f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a0d9,_0x5056ec,_0x4af78e){return new BPromise(function(_0x1aa699,_0x8ea618){return client[_0x011f('0xb')](_0x13a0d9,_0x4af78e)[_0x011f('0xc')](function(_0xe76d86){logger['info'](_0x011f('0xd'),_0x5056ec,_0x011f('0xe'));logger[_0x011f('0xf')](_0x011f('0x10'),_0x5056ec,_0x011f('0xe'),JSON[_0x011f('0x11')](_0xe76d86));if(_0xe76d86[_0x011f('0x12')]){if(_0xe76d86[_0x011f('0x12')][_0x011f('0x13')]===0x1f4){logger[_0x011f('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5056ec,_0xe76d86[_0x011f('0x12')]['message']);return _0x8ea618(_0xe76d86['error'][_0x011f('0x14')]);}logger[_0x011f('0x12')](_0x011f('0xd'),_0x5056ec,_0xe76d86[_0x011f('0x12')][_0x011f('0x14')]);return _0x1aa699(_0xe76d86[_0x011f('0x12')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5056ec,_0x011f('0xe'));_0x1aa699(_0xe76d86['result']['message']);}})['catch'](function(_0x2a8e1e){logger[_0x011f('0x12')](_0x011f('0xd'),_0x5056ec,_0x2a8e1e);_0x8ea618(_0x2a8e1e);});});} \ No newline at end of file +var _0x8833=['error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dc884,_0x5e3a78){var _0x5b122f=function(_0x6a6fd8){while(--_0x6a6fd8){_0x2dc884['push'](_0x2dc884['shift']());}};_0x5b122f(++_0x5e3a78);}(_0x8833,0x102));var _0x3883=function(_0x5172a3,_0x2eca6d){_0x5172a3=_0x5172a3-0x0;var _0x3ef2f8=_0x8833[_0x5172a3];return _0x3ef2f8;};'use strict';var _=require(_0x3883('0x0'));var util=require(_0x3883('0x1'));var moment=require('moment');var BPromise=require(_0x3883('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3883('0x3'));var db=require(_0x3883('0x4'))['db'];var utils=require(_0x3883('0x5'));var logger=require('../../config/logger')(_0x3883('0x6'));var config=require(_0x3883('0x7'));var jayson=require(_0x3883('0x8'));var client=jayson['client'][_0x3883('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9ff3,_0x11e60c,_0x312cce){return new BPromise(function(_0x2d9a10,_0x1c66d6){return client[_0x3883('0xa')](_0x3b9ff3,_0x312cce)[_0x3883('0xb')](function(_0x4f6da8){logger['info'](_0x3883('0xc'),_0x11e60c,_0x3883('0xd'));logger[_0x3883('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x11e60c,_0x3883('0xd'),JSON['stringify'](_0x4f6da8));if(_0x4f6da8['error']){if(_0x4f6da8[_0x3883('0xf')][_0x3883('0x10')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x11e60c,_0x4f6da8[_0x3883('0xf')][_0x3883('0x11')]);return _0x1c66d6(_0x4f6da8[_0x3883('0xf')][_0x3883('0x11')]);}logger['error'](_0x3883('0xc'),_0x11e60c,_0x4f6da8['error'][_0x3883('0x11')]);return _0x2d9a10(_0x4f6da8[_0x3883('0xf')]['message']);}else{logger[_0x3883('0x12')](_0x3883('0xc'),_0x11e60c,_0x3883('0xd'));_0x2d9a10(_0x4f6da8[_0x3883('0x13')][_0x3883('0x11')]);}})[_0x3883('0x14')](function(_0x4ec769){logger[_0x3883('0xf')](_0x3883('0xc'),_0x11e60c,_0x4ec769);_0x1c66d6(_0x4ec769);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 0a5c419..5af129e 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x4ef6e4,_0xf1df84){var _0x2d3ae6=function(_0x5c9a0c){while(--_0x5c9a0c){_0x4ef6e4['push'](_0x4ef6e4['shift']());}};_0x2d3ae6(++_0xf1df84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x3967fd,_0x4d46a0){var _0x1cad5d=function(_0x30e92a){while(--_0x30e92a){_0x3967fd['push'](_0x3967fd['shift']());}};_0x1cad5d(++_0x4d46a0);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 47e7f6f..103cad5 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 _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x344633,_0x5a12a1){var _0x335e22=function(_0x1dac67){while(--_0x1dac67){_0x344633['push'](_0x344633['shift']());}};_0x335e22(++_0x5a12a1);}(_0xdace,0xc5));var _0xedac=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xdace[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda3f=['keyValue','STRING','string','variable','BOOLEAN','exports','ENUM'];(function(_0x1dc997,_0x114201){var _0x129049=function(_0x10db73){while(--_0x10db73){_0x1dc997['push'](_0x1dc997['shift']());}};_0x129049(++_0x114201);}(_0xda3f,0xec));var _0xfda3=function(_0x2bafa7,_0xecf10e){_0x2bafa7=_0x2bafa7-0x0;var _0x2a9b5d=_0xda3f[_0x2bafa7];return _0x2a9b5d;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'type':{'type':Sequelize[_0xfda3('0x1')]('string','variable','customVariable',_0xfda3('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfda3('0x3')]},'key':{'type':Sequelize[_0xfda3('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xfda3('0x4'),_0xfda3('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfda3('0x3')]},'nameField':{'type':Sequelize[_0xfda3('0x3')]},'customField':{'type':Sequelize[_0xfda3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfda3('0x3')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index f7e965c..8af6be7 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 _0x32f5=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskField','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','rows','catch','show','include','find','create','body','html-pdf','zip-dir','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js'];(function(_0x531932,_0x1598b1){var _0x443917=function(_0x4c3403){while(--_0x4c3403){_0x531932['push'](_0x531932['shift']());}};_0x443917(++_0x1598b1);}(_0x32f5,0x1d7));var _0x532f=function(_0x639960,_0x5ac9e1){_0x639960=_0x639960-0x0;var _0x17f9c9=_0x32f5[_0x639960];return _0x17f9c9;};'use strict';var pdf=require(_0x532f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x532f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x532f('0x2'));var moment=require(_0x532f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x532f('0x4'));var util=require(_0x532f('0x5'));var path=require(_0x532f('0x6'));var sox=require(_0x532f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x532f('0x8'));var crypto=require(_0x532f('0x9'));var jsforce=require(_0x532f('0xa'));var deskjs=require(_0x532f('0xb'));var toCsv=require(_0x532f('0xc'));var querystring=require(_0x532f('0xd'));var Papa=require(_0x532f('0xe'));var Redis=require(_0x532f('0xf'));var authService=require(_0x532f('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x532f('0x11'))(_0x532f('0x12'));var utils=require(_0x532f('0x13'));var config=require(_0x532f('0x14'));var db=require(_0x532f('0x15'))['db'];function respondWithStatusCode(_0x5e3b10,_0x5d8bd0){_0x5d8bd0=_0x5d8bd0||0xcc;return function(_0x514700){if(_0x514700){return _0x5e3b10[_0x532f('0x16')](_0x5d8bd0);}return _0x5e3b10[_0x532f('0x17')](_0x5d8bd0)[_0x532f('0x18')]();};}function respondWithResult(_0x3b76dc,_0x3896a7){_0x3896a7=_0x3896a7||0xc8;return function(_0x3b3f77){if(_0x3b3f77){return _0x3b76dc[_0x532f('0x17')](_0x3896a7)[_0x532f('0x19')](_0x3b3f77);}};}function respondWithFilteredResult(_0x2a7028,_0x4023e1){return function(_0x14138d){if(_0x14138d){var _0x5d91d5=_0x14138d[_0x532f('0x1a')],_0x4014b6=_0x4023e1['offset'],_0x3165ac=_0x4023e1['offset']+_0x4023e1['limit'],_0x52a229;if(_0x3165ac>=_0x5d91d5){_0x3165ac=_0x5d91d5;_0x52a229=0xc8;}else{_0x52a229=0xce;}_0x2a7028['status'](_0x52a229);return _0x2a7028['set'](_0x532f('0x1b'),_0x4014b6+'-'+_0x3165ac+'/'+_0x5d91d5)[_0x532f('0x19')](_0x14138d);}return null;};}function patchUpdates(_0x3da481){return function(_0x376b82){try{jsonpatch[_0x532f('0x1c')](_0x376b82,_0x3da481,!![]);}catch(_0x473437){return BPromise['reject'](_0x473437);}return _0x376b82[_0x532f('0x1d')]();};}function saveUpdates(_0x3bc5b5,_0x2bb5e3){return function(_0x1dc4aa){if(_0x1dc4aa){return _0x1dc4aa[_0x532f('0x1e')](_0x3bc5b5)[_0x532f('0x1f')](function(_0x24da5b){return _0x24da5b;});}return null;};}function removeEntity(_0x1fbaf7,_0x175ab1){return function(_0x55c70d){if(_0x55c70d){return _0x55c70d[_0x532f('0x20')]()[_0x532f('0x1f')](function(){_0x1fbaf7[_0x532f('0x17')](0xcc)[_0x532f('0x18')]();});}};}function handleEntityNotFound(_0x5abf24,_0x19045b){return function(_0xd70c22){if(!_0xd70c22){_0x5abf24['sendStatus'](0x194);}return _0xd70c22;};}function handleError(_0x569288,_0x56a2c5){_0x56a2c5=_0x56a2c5||0x1f4;return function(_0x56b79b){logger[_0x532f('0x21')](_0x56b79b[_0x532f('0x22')]);if(_0x56b79b[_0x532f('0x23')]){delete _0x56b79b[_0x532f('0x23')];}_0x569288[_0x532f('0x17')](_0x56a2c5)[_0x532f('0x24')](_0x56b79b);};}exports[_0x532f('0x25')]=function(_0x14d99f,_0x3ea035){var _0x3d663e={},_0x369e79={},_0x9cbdb4={'count':0x0,'rows':[]};var _0x58aa3e=db[_0x532f('0x26')]['rawAttributes'];_0x369e79['model']=_['keys'](_0x58aa3e);_0x369e79['query']=_[_0x532f('0x27')](_0x14d99f[_0x532f('0x28')]);_0x369e79[_0x532f('0x29')]=_[_0x532f('0x2a')](_0x369e79[_0x532f('0x2b')],_0x369e79['query']);_0x3d663e[_0x532f('0x2c')]=_[_0x532f('0x2a')](_0x369e79[_0x532f('0x2b')],qs['fields'](_0x14d99f[_0x532f('0x28')][_0x532f('0x2d')]));_0x3d663e[_0x532f('0x2c')]=_0x3d663e[_0x532f('0x2c')][_0x532f('0x2e')]?_0x3d663e[_0x532f('0x2c')]:_0x369e79[_0x532f('0x2b')];if(!_0x14d99f[_0x532f('0x28')][_0x532f('0x2f')](_0x532f('0x30'))){_0x3d663e['limit']=qs[_0x532f('0x31')](_0x14d99f[_0x532f('0x28')][_0x532f('0x31')]);_0x3d663e['offset']=qs[_0x532f('0x32')](_0x14d99f[_0x532f('0x28')]['offset']);}_0x3d663e[_0x532f('0x33')]=qs['sort'](_0x14d99f[_0x532f('0x28')][_0x532f('0x34')]);_0x3d663e[_0x532f('0x35')]=qs[_0x532f('0x29')](_[_0x532f('0x36')](_0x14d99f[_0x532f('0x28')],_0x369e79[_0x532f('0x29')]));if(_0x14d99f[_0x532f('0x28')][_0x532f('0x37')]){_0x3d663e[_0x532f('0x35')]=_[_0x532f('0x38')](_0x3d663e[_0x532f('0x35')],{'$or':_['map'](_0x58aa3e,function(_0x3606be){if(_0x3606be['type'][_0x532f('0x39')]!==_0x532f('0x3a')){var _0x259d91={};_0x259d91[_0x3606be[_0x532f('0x3b')]]={'$like':'%'+_0x14d99f[_0x532f('0x28')][_0x532f('0x37')]+'%'};return _0x259d91;}})});}_0x3d663e=_[_0x532f('0x38')]({},_0x3d663e,_0x14d99f[_0x532f('0x3c')]);var _0x3f3380={'where':_0x3d663e[_0x532f('0x35')]};return db[_0x532f('0x26')]['count'](_0x3f3380)['then'](function(_0x2e85f7){_0x9cbdb4[_0x532f('0x1a')]=_0x2e85f7;if(_0x14d99f[_0x532f('0x28')][_0x532f('0x3d')]){_0x3d663e['include']=[{'all':!![]}];}return db[_0x532f('0x26')]['findAll'](_0x3d663e);})[_0x532f('0x1f')](function(_0x5daa6a){_0x9cbdb4[_0x532f('0x3e')]=_0x5daa6a;return _0x9cbdb4;})[_0x532f('0x1f')](respondWithFilteredResult(_0x3ea035,_0x3d663e))[_0x532f('0x3f')](handleError(_0x3ea035,null));};exports[_0x532f('0x40')]=function(_0x3ecf50,_0x1a9a1e){var _0x267b03={'raw':!![],'where':{'id':_0x3ecf50['params']['id']}},_0x2a4bfe={};_0x2a4bfe[_0x532f('0x2b')]=_[_0x532f('0x27')](db[_0x532f('0x26')]['rawAttributes']);_0x2a4bfe[_0x532f('0x28')]=_[_0x532f('0x27')](_0x3ecf50[_0x532f('0x28')]);_0x2a4bfe[_0x532f('0x29')]=_['intersection'](_0x2a4bfe[_0x532f('0x2b')],_0x2a4bfe['query']);_0x267b03[_0x532f('0x2c')]=_[_0x532f('0x2a')](_0x2a4bfe[_0x532f('0x2b')],qs[_0x532f('0x2d')](_0x3ecf50[_0x532f('0x28')][_0x532f('0x2d')]));_0x267b03[_0x532f('0x2c')]=_0x267b03[_0x532f('0x2c')][_0x532f('0x2e')]?_0x267b03['attributes']:_0x2a4bfe[_0x532f('0x2b')];if(_0x3ecf50[_0x532f('0x28')]['includeAll']){_0x267b03[_0x532f('0x41')]=[{'all':!![]}];}_0x267b03=_['merge']({},_0x267b03,_0x3ecf50['options']);return db[_0x532f('0x26')][_0x532f('0x42')](_0x267b03)['then'](handleEntityNotFound(_0x1a9a1e,null))[_0x532f('0x1f')](respondWithResult(_0x1a9a1e,null))[_0x532f('0x3f')](handleError(_0x1a9a1e,null));};exports[_0x532f('0x43')]=function(_0x4990f9,_0x19c785){return db['ZendeskField'][_0x532f('0x43')](_0x4990f9[_0x532f('0x44')],{})[_0x532f('0x1f')](respondWithResult(_0x19c785,0xc9))[_0x532f('0x3f')](handleError(_0x19c785,null));};exports[_0x532f('0x1e')]=function(_0x11bb87,_0x260705){if(_0x11bb87[_0x532f('0x44')]['id']){delete _0x11bb87[_0x532f('0x44')]['id'];}return db[_0x532f('0x26')][_0x532f('0x42')]({'where':{'id':_0x11bb87['params']['id']}})['then'](handleEntityNotFound(_0x260705,null))[_0x532f('0x1f')](saveUpdates(_0x11bb87['body'],null))[_0x532f('0x1f')](respondWithResult(_0x260705,null))[_0x532f('0x3f')](handleError(_0x260705,null));};exports[_0x532f('0x20')]=function(_0x295af5,_0x5e3bd5){return db[_0x532f('0x26')][_0x532f('0x42')]({'where':{'id':_0x295af5['params']['id']}})['then'](handleEntityNotFound(_0x5e3bd5,null))[_0x532f('0x1f')](removeEntity(_0x5e3bd5,null))[_0x532f('0x3f')](handleError(_0x5e3bd5,null));}; \ No newline at end of file +var _0x204d=['findAll','rows','catch','show','keys','length','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','ZendeskField','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','merge','map','type','key','VIRTUAL','filter','options','includeAll','include'];(function(_0x19cf1f,_0x4105e3){var _0x234028=function(_0x24748c){while(--_0x24748c){_0x19cf1f['push'](_0x19cf1f['shift']());}};_0x234028(++_0x4105e3);}(_0x204d,0x1f4));var _0xd204=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x204d[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0xd204('0x0'));var emlformat=require(_0xd204('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd204('0x2'));var jsonpatch=require(_0xd204('0x3'));var rp=require(_0xd204('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd204('0x5'));var util=require(_0xd204('0x6'));var path=require(_0xd204('0x7'));var sox=require(_0xd204('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd204('0x9'));var squel=require('squel');var crypto=require(_0xd204('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd204('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd204('0xc'));var Papa=require(_0xd204('0xd'));var Redis=require(_0xd204('0xe'));var authService=require(_0xd204('0xf'));var qs=require(_0xd204('0x10'));var hardwareService=require(_0xd204('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd204('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521986,_0xab2683){_0xab2683=_0xab2683||0xcc;return function(_0x4c7571){if(_0x4c7571){return _0x521986[_0xd204('0x13')](_0xab2683);}return _0x521986[_0xd204('0x14')](_0xab2683)['end']();};}function respondWithResult(_0x38673e,_0x193b02){_0x193b02=_0x193b02||0xc8;return function(_0x3e9f3b){if(_0x3e9f3b){return _0x38673e[_0xd204('0x14')](_0x193b02)['json'](_0x3e9f3b);}};}function respondWithFilteredResult(_0x58b75c,_0x1cc541){return function(_0xa35d48){if(_0xa35d48){var _0x2663df=_0xa35d48[_0xd204('0x15')],_0x329e2c=_0x1cc541[_0xd204('0x16')],_0x9eabd2=_0x1cc541[_0xd204('0x16')]+_0x1cc541[_0xd204('0x17')],_0x39f1d6;if(_0x9eabd2>=_0x2663df){_0x9eabd2=_0x2663df;_0x39f1d6=0xc8;}else{_0x39f1d6=0xce;}_0x58b75c[_0xd204('0x14')](_0x39f1d6);return _0x58b75c[_0xd204('0x18')](_0xd204('0x19'),_0x329e2c+'-'+_0x9eabd2+'/'+_0x2663df)[_0xd204('0x1a')](_0xa35d48);}return null;};}function patchUpdates(_0x31c840){return function(_0x3958e8){try{jsonpatch[_0xd204('0x1b')](_0x3958e8,_0x31c840,!![]);}catch(_0x59d41f){return BPromise[_0xd204('0x1c')](_0x59d41f);}return _0x3958e8[_0xd204('0x1d')]();};}function saveUpdates(_0x5cbdc3,_0x405e8b){return function(_0x59f2e8){if(_0x59f2e8){return _0x59f2e8[_0xd204('0x1e')](_0x5cbdc3)[_0xd204('0x1f')](function(_0xb6d538){return _0xb6d538;});}return null;};}function removeEntity(_0xd7579,_0x5248c5){return function(_0x2ec2e6){if(_0x2ec2e6){return _0x2ec2e6[_0xd204('0x20')]()[_0xd204('0x1f')](function(){_0xd7579[_0xd204('0x14')](0xcc)[_0xd204('0x21')]();});}};}function handleEntityNotFound(_0xbc26b9,_0x3f4075){return function(_0x3e7433){if(!_0x3e7433){_0xbc26b9['sendStatus'](0x194);}return _0x3e7433;};}function handleError(_0x3ed2b5,_0xc9bf6){_0xc9bf6=_0xc9bf6||0x1f4;return function(_0x3e7d17){logger[_0xd204('0x22')](_0x3e7d17[_0xd204('0x23')]);if(_0x3e7d17[_0xd204('0x24')]){delete _0x3e7d17[_0xd204('0x24')];}_0x3ed2b5['status'](_0xc9bf6)['send'](_0x3e7d17);};}exports[_0xd204('0x25')]=function(_0x12e500,_0x452c0d){var _0x5dc63a={},_0x272a78={},_0x44f13f={'count':0x0,'rows':[]};var _0x23250e=db[_0xd204('0x26')][_0xd204('0x27')];_0x272a78[_0xd204('0x28')]=_['keys'](_0x23250e);_0x272a78[_0xd204('0x29')]=_['keys'](_0x12e500[_0xd204('0x29')]);_0x272a78[_0xd204('0x2a')]=_['intersection'](_0x272a78[_0xd204('0x28')],_0x272a78['query']);_0x5dc63a[_0xd204('0x2b')]=_[_0xd204('0x2c')](_0x272a78['model'],qs[_0xd204('0x2d')](_0x12e500[_0xd204('0x29')][_0xd204('0x2d')]));_0x5dc63a[_0xd204('0x2b')]=_0x5dc63a[_0xd204('0x2b')]['length']?_0x5dc63a['attributes']:_0x272a78[_0xd204('0x28')];if(!_0x12e500[_0xd204('0x29')][_0xd204('0x2e')]('nolimit')){_0x5dc63a[_0xd204('0x17')]=qs[_0xd204('0x17')](_0x12e500[_0xd204('0x29')][_0xd204('0x17')]);_0x5dc63a[_0xd204('0x16')]=qs['offset'](_0x12e500[_0xd204('0x29')][_0xd204('0x16')]);}_0x5dc63a[_0xd204('0x2f')]=qs[_0xd204('0x30')](_0x12e500[_0xd204('0x29')][_0xd204('0x30')]);_0x5dc63a['where']=qs[_0xd204('0x2a')](_[_0xd204('0x31')](_0x12e500[_0xd204('0x29')],_0x272a78[_0xd204('0x2a')]));if(_0x12e500['query']['filter']){_0x5dc63a[_0xd204('0x32')]=_[_0xd204('0x33')](_0x5dc63a['where'],{'$or':_[_0xd204('0x34')](_0x23250e,function(_0x34ea10){if(_0x34ea10[_0xd204('0x35')][_0xd204('0x36')]!==_0xd204('0x37')){var _0x3ec2cf={};_0x3ec2cf[_0x34ea10['field']]={'$like':'%'+_0x12e500[_0xd204('0x29')][_0xd204('0x38')]+'%'};return _0x3ec2cf;}})});}_0x5dc63a=_[_0xd204('0x33')]({},_0x5dc63a,_0x12e500[_0xd204('0x39')]);var _0x4bb61c={'where':_0x5dc63a[_0xd204('0x32')]};return db[_0xd204('0x26')][_0xd204('0x15')](_0x4bb61c)[_0xd204('0x1f')](function(_0x2d493a){_0x44f13f[_0xd204('0x15')]=_0x2d493a;if(_0x12e500['query'][_0xd204('0x3a')]){_0x5dc63a[_0xd204('0x3b')]=[{'all':!![]}];}return db[_0xd204('0x26')][_0xd204('0x3c')](_0x5dc63a);})[_0xd204('0x1f')](function(_0x2b3855){_0x44f13f[_0xd204('0x3d')]=_0x2b3855;return _0x44f13f;})[_0xd204('0x1f')](respondWithFilteredResult(_0x452c0d,_0x5dc63a))[_0xd204('0x3e')](handleError(_0x452c0d,null));};exports[_0xd204('0x3f')]=function(_0x67efbe,_0x1ee9ae){var _0x54585e={'raw':!![],'where':{'id':_0x67efbe['params']['id']}},_0x310ce6={};_0x310ce6['model']=_[_0xd204('0x40')](db['ZendeskField']['rawAttributes']);_0x310ce6[_0xd204('0x29')]=_['keys'](_0x67efbe['query']);_0x310ce6[_0xd204('0x2a')]=_[_0xd204('0x2c')](_0x310ce6[_0xd204('0x28')],_0x310ce6[_0xd204('0x29')]);_0x54585e[_0xd204('0x2b')]=_[_0xd204('0x2c')](_0x310ce6[_0xd204('0x28')],qs[_0xd204('0x2d')](_0x67efbe[_0xd204('0x29')][_0xd204('0x2d')]));_0x54585e['attributes']=_0x54585e[_0xd204('0x2b')][_0xd204('0x41')]?_0x54585e[_0xd204('0x2b')]:_0x310ce6['model'];if(_0x67efbe[_0xd204('0x29')][_0xd204('0x3a')]){_0x54585e['include']=[{'all':!![]}];}_0x54585e=_[_0xd204('0x33')]({},_0x54585e,_0x67efbe[_0xd204('0x39')]);return db[_0xd204('0x26')][_0xd204('0x42')](_0x54585e)[_0xd204('0x1f')](handleEntityNotFound(_0x1ee9ae,null))[_0xd204('0x1f')](respondWithResult(_0x1ee9ae,null))[_0xd204('0x3e')](handleError(_0x1ee9ae,null));};exports['create']=function(_0x2910f3,_0x799c4c){return db[_0xd204('0x26')][_0xd204('0x43')](_0x2910f3[_0xd204('0x44')],{})[_0xd204('0x1f')](respondWithResult(_0x799c4c,0xc9))['catch'](handleError(_0x799c4c,null));};exports[_0xd204('0x1e')]=function(_0x399207,_0x571e8a){if(_0x399207[_0xd204('0x44')]['id']){delete _0x399207[_0xd204('0x44')]['id'];}return db[_0xd204('0x26')][_0xd204('0x42')]({'where':{'id':_0x399207['params']['id']}})['then'](handleEntityNotFound(_0x571e8a,null))[_0xd204('0x1f')](saveUpdates(_0x399207[_0xd204('0x44')],null))[_0xd204('0x1f')](respondWithResult(_0x571e8a,null))['catch'](handleError(_0x571e8a,null));};exports[_0xd204('0x20')]=function(_0x563ebb,_0x345a1c){return db[_0xd204('0x26')][_0xd204('0x42')]({'where':{'id':_0x563ebb[_0xd204('0x45')]['id']}})['then'](handleEntityNotFound(_0x345a1c,null))[_0xd204('0x1f')](removeEntity(_0x345a1c,null))[_0xd204('0x3e')](handleError(_0x345a1c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 13688dc..80433f5 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 _0xc2f9=['./intZendeskField.attributes','exports','define','zendesk_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f0225,_0x52631a){var _0x2cef4b=function(_0x5a29c6){while(--_0x5a29c6){_0x5f0225['push'](_0x5f0225['shift']());}};_0x2cef4b(++_0x52631a);}(_0xc2f9,0xfd));var _0x9c2f=function(_0x30d50e,_0x11246f){_0x30d50e=_0x30d50e-0x0;var _0x361dcf=_0xc2f9[_0x30d50e];return _0x361dcf;};'use strict';var _=require(_0x9c2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c2f('0x1'));var moment=require(_0x9c2f('0x2'));var BPromise=require(_0x9c2f('0x3'));var rp=require(_0x9c2f('0x4'));var fs=require('fs');var path=require(_0x9c2f('0x5'));var rimraf=require(_0x9c2f('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c2f('0x7'));module[_0x9c2f('0x8')]=function(_0x5a66d2,_0x4d28a4){return _0x5a66d2[_0x9c2f('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x9c2f('0xa'),'fields':[_0x9c2f('0xb'),_0x9c2f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x604b=['api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','idField','FieldId','util','../../config/logger'];(function(_0x28b0f7,_0x4bff5c){var _0x5a4430=function(_0x129cec){while(--_0x129cec){_0x28b0f7['push'](_0x28b0f7['shift']());}};_0x5a4430(++_0x4bff5c);}(_0x604b,0x19e));var _0xb604=function(_0x141d41,_0x39d728){_0x141d41=_0x141d41-0x0;var _0x199cd7=_0x604b[_0x141d41];return _0x199cd7;};'use strict';var _=require('lodash');var util=require(_0xb604('0x0'));var logger=require(_0xb604('0x1'))(_0xb604('0x2'));var moment=require(_0xb604('0x3'));var BPromise=require(_0xb604('0x4'));var rp=require(_0xb604('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb604('0x6'));var attributes=require(_0xb604('0x7'));module['exports']=function(_0x22b9a9,_0x3705b6){return _0x22b9a9[_0xb604('0x8')](_0xb604('0x9'),attributes,{'tableName':_0xb604('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xb604('0xb'),_0xb604('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 06493f2..24e8a04 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 _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x306f2e,_0x39d8eb){var _0x47b6a4=function(_0xc89418){while(--_0xc89418){_0x306f2e['push'](_0x306f2e['shift']());}};_0x47b6a4(++_0x39d8eb);}(_0x57f8,0x198));var _0x857f=function(_0x3aaef5,_0x16cdc8){_0x3aaef5=_0x3aaef5-0x0;var _0x4c0ed5=_0x57f8[_0x3aaef5];return _0x4c0ed5;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('ZendeskField,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('ZendeskField,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file +var _0x5c00=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x5c00,0x17e));var _0x05c0=function(_0x443e72,_0x50737f){_0x443e72=_0x443e72-0x0;var _0x87c5e2=_0x5c00[_0x443e72];return _0x87c5e2;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('ZendeskField,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 99f38df..a75efdd 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 _0xb10b=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x5f72ad,_0x146d15){var _0x3227e7=function(_0x46f64c){while(--_0x46f64c){_0x5f72ad['push'](_0x5f72ad['shift']());}};_0x3227e7(++_0x146d15);}(_0xb10b,0x12a));var _0xbb10=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0xb10b[_0x15942a];return _0x36a9fb;};'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['getFields']);router['post']('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router[_0xbb10('0x10')]('/:id/configurations',auth[_0xbb10('0x9')](),controller['addConfiguration']);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 _0x4024=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoAccount.controller','index','get','/:id','show','isAuthenticated','/:id/fields','getFields','post','/:id/configurations','addConfiguration'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x4024,0x89));var _0x4402=function(_0x11306f,_0x267da7){_0x11306f=_0x11306f-0x0;var _0x3788c9=_0x4024[_0x11306f];return _0x3788c9;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var auth=require(_0x4402('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4402('0x5'));var controller=require(_0x4402('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4402('0x7')]);router[_0x4402('0x8')](_0x4402('0x9'),auth['isAuthenticated'](),controller[_0x4402('0xa')]);router['get']('/:id/configurations',auth[_0x4402('0xb')](),controller['getConfigurations']);router['get'](_0x4402('0xc'),auth['isAuthenticated'](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0xb')](),controller['create']);router[_0x4402('0xe')](_0x4402('0xf'),auth['isAuthenticated'](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x9'),auth['isAuthenticated'](),controller[_0x4402('0x12')]);router[_0x4402('0x13')](_0x4402('0x9'),auth[_0x4402('0xb')](),controller[_0x4402('0x14')]);module[_0x4402('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a24e829..dd6e04f 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 _0x9263=['STRING','sequelize'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x9263,0x1bf));var _0x3926=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x9263[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0x3926('0x0'));module['exports']={'name':{'type':Sequelize[_0x3926('0x1')]},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3926('0x1')]},'host':{'type':Sequelize[_0x3926('0x1')]},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd430=['sequelize','exports','STRING'];(function(_0x143310,_0xab5657){var _0x1f7136=function(_0x289bef){while(--_0x289bef){_0x143310['push'](_0x143310['shift']());}};_0x1f7136(++_0xab5657);}(_0xd430,0xd8));var _0x0d43=function(_0x2c8de4,_0x48ecd7){_0x2c8de4=_0x2c8de4-0x0;var _0xa5f1d5=_0xd430[_0x2c8de4];return _0xa5f1d5;};'use strict';var Sequelize=require(_0x0d43('0x0'));module[_0x0d43('0x1')]={'name':{'type':Sequelize[_0x0d43('0x2')]},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0d43('0x2')]},'host':{'type':Sequelize[_0x0d43('0x2')]},'serverUrl':{'type':Sequelize[_0x0d43('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index efb0f8e..9a7c379 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 _0xca27=['nolimit','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','find','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','ZohoConfiguration','ZohoField','Descriptions','getFields','host','authToken','slice','substring','GET','format','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','customfield','true','statusCode','stringify','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','info','ZohoAccount,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','ZohoAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xca27,0xaa));var _0x7ca2=function(_0x2ec1ae,_0x470d51){_0x2ec1ae=_0x2ec1ae-0x0;var _0x1681ae=_0xca27[_0x2ec1ae];return _0x1681ae;};'use strict';var pdf=require(_0x7ca2('0x0'));var emlformat=require(_0x7ca2('0x1'));var rimraf=require(_0x7ca2('0x2'));var zipdir=require(_0x7ca2('0x3'));var jsonpatch=require(_0x7ca2('0x4'));var rp=require(_0x7ca2('0x5'));var moment=require(_0x7ca2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7ca2('0x7'));var util=require(_0x7ca2('0x8'));var path=require('path');var sox=require(_0x7ca2('0x9'));var csv=require('to-csv');var ejs=require(_0x7ca2('0xa'));var fs=require('fs');var _=require(_0x7ca2('0xb'));var squel=require(_0x7ca2('0xc'));var crypto=require(_0x7ca2('0xd'));var jsforce=require(_0x7ca2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7ca2('0xf'));var querystring=require(_0x7ca2('0x10'));var Papa=require(_0x7ca2('0x11'));var Redis=require(_0x7ca2('0x12'));var authService=require(_0x7ca2('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7ca2('0x14'));var logger=require(_0x7ca2('0x15'))(_0x7ca2('0x16'));var utils=require(_0x7ca2('0x17'));var config=require(_0x7ca2('0x18'));var db=require(_0x7ca2('0x19'))['db'];var integrations=require(_0x7ca2('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0x7ca2('0x1b')][_0x7ca2('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x54f26e,_0x435092,_0x47d1f4){if(_0x47d1f4){var _0x4b344c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b344c['test'](_0x435092)){return _0x54f26e;}else{throw new Error(_0x7ca2('0x1d'));}}else{return _0x54f26e;}}function respondWithRpcPromise(_0x1d86f7,_0x1b73de,_0x59ff05,_0x4dd15b){return new BPromise(function(_0x123ef8,_0x56d476){var _0x3a02c0=_0x4dd15b||client;return _0x3a02c0[_0x7ca2('0x1e')](_0x1d86f7,_0x59ff05)['then'](function(_0x33b6ef){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x1b73de,_0x7ca2('0x1f'));logger[_0x7ca2('0x20')](_0x7ca2('0x21'),_0x1b73de,_0x7ca2('0x1f'),JSON['stringify'](_0x33b6ef));if(_0x33b6ef['error']){if(_0x33b6ef[_0x7ca2('0x22')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1b73de,_0x33b6ef[_0x7ca2('0x22')][_0x7ca2('0x23')]);return _0x56d476(_0x33b6ef['error'][_0x7ca2('0x23')]);}logger[_0x7ca2('0x22')]('ZohoAccount,\x20%s,\x20%s',_0x1b73de,_0x33b6ef[_0x7ca2('0x22')][_0x7ca2('0x23')]);return _0x123ef8(_0x33b6ef[_0x7ca2('0x22')][_0x7ca2('0x23')]);}else{logger[_0x7ca2('0x24')](_0x7ca2('0x25'),_0x1b73de,'request\x20sent');_0x123ef8(_0x33b6ef[_0x7ca2('0x26')][_0x7ca2('0x23')]);}})[_0x7ca2('0x27')](function(_0x1cbb9c){logger[_0x7ca2('0x22')](_0x7ca2('0x25'),_0x1b73de,_0x1cbb9c);_0x56d476(_0x1cbb9c);});});}function respondWithStatusCode(_0x2ca333,_0x2f7a0d){_0x2f7a0d=_0x2f7a0d||0xcc;return function(_0xafd7d8){if(_0xafd7d8){return _0x2ca333[_0x7ca2('0x28')](_0x2f7a0d);}return _0x2ca333['status'](_0x2f7a0d)[_0x7ca2('0x29')]();};}function respondWithResult(_0x307ace,_0x3ccf1f){_0x3ccf1f=_0x3ccf1f||0xc8;return function(_0x18ef1c){if(_0x18ef1c){return _0x307ace[_0x7ca2('0x2a')](_0x3ccf1f)[_0x7ca2('0x2b')](_0x18ef1c);}};}function respondWithFilteredResult(_0x5edead,_0x5d822d){return function(_0x544226){if(_0x544226){var _0x2111e2=_0x544226[_0x7ca2('0x2c')],_0x1edf48=_0x5d822d[_0x7ca2('0x2d')],_0x26cd03=_0x5d822d['offset']+_0x5d822d[_0x7ca2('0x2e')],_0x396f90;if(_0x26cd03>=_0x2111e2){_0x26cd03=_0x2111e2;_0x396f90=0xc8;}else{_0x396f90=0xce;}_0x5edead[_0x7ca2('0x2a')](_0x396f90);return _0x5edead[_0x7ca2('0x2f')](_0x7ca2('0x30'),_0x1edf48+'-'+_0x26cd03+'/'+_0x2111e2)[_0x7ca2('0x2b')](_0x544226);}return null;};}function patchUpdates(_0x38fc7){return function(_0x207593){try{jsonpatch[_0x7ca2('0x31')](_0x207593,_0x38fc7,!![]);}catch(_0x720220){return BPromise['reject'](_0x720220);}return _0x207593['save']();};}function saveUpdates(_0x2fea5b,_0x56c131){return function(_0x41e016){if(_0x41e016){return _0x41e016[_0x7ca2('0x32')](_0x2fea5b)[_0x7ca2('0x33')](function(_0x325c28){return _0x325c28;});}return null;};}function removeEntity(_0x5e2a3c,_0x45f22f){return function(_0x5477e6){if(_0x5477e6){return _0x5477e6[_0x7ca2('0x34')]()[_0x7ca2('0x33')](function(){_0x5e2a3c[_0x7ca2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a14d,_0x4437eb){return function(_0x1383a2){if(!_0x1383a2){_0x16a14d[_0x7ca2('0x28')](0x194);}return _0x1383a2;};}function handleError(_0xe1d3e8,_0x35667e){_0x35667e=_0x35667e||0x1f4;return function(_0x295b54){logger[_0x7ca2('0x22')](_0x295b54[_0x7ca2('0x35')]);if(_0x295b54['name']){delete _0x295b54[_0x7ca2('0x36')];}_0xe1d3e8[_0x7ca2('0x2a')](_0x35667e)[_0x7ca2('0x37')](_0x295b54);};}exports[_0x7ca2('0x38')]=function(_0x402f3f,_0x37ccdb){var _0x4168fb={},_0x4aa17a={},_0x36eb7a={'count':0x0,'rows':[]};var _0x5045b1=db[_0x7ca2('0x39')][_0x7ca2('0x3a')];_0x4aa17a[_0x7ca2('0x3b')]=_['keys'](_0x5045b1);_0x4aa17a[_0x7ca2('0x3c')]=_[_0x7ca2('0x3d')](_0x402f3f[_0x7ca2('0x3c')]);_0x4aa17a[_0x7ca2('0x3e')]=_[_0x7ca2('0x3f')](_0x4aa17a['model'],_0x4aa17a[_0x7ca2('0x3c')]);_0x4168fb[_0x7ca2('0x40')]=_[_0x7ca2('0x3f')](_0x4aa17a[_0x7ca2('0x3b')],qs['fields'](_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x41')]));_0x4168fb[_0x7ca2('0x40')]=_0x4168fb['attributes'][_0x7ca2('0x42')]?_0x4168fb[_0x7ca2('0x40')]:_0x4aa17a['model'];if(!_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x43')](_0x7ca2('0x44'))){_0x4168fb[_0x7ca2('0x2e')]=qs[_0x7ca2('0x2e')](_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x2e')]);_0x4168fb[_0x7ca2('0x2d')]=qs[_0x7ca2('0x2d')](_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x2d')]);}_0x4168fb['order']=qs[_0x7ca2('0x45')](_0x402f3f[_0x7ca2('0x3c')]['sort']);_0x4168fb[_0x7ca2('0x46')]=qs['filters'](_['pick'](_0x402f3f[_0x7ca2('0x3c')],_0x4aa17a['filters']));if(_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x47')]){_0x4168fb[_0x7ca2('0x46')]=_[_0x7ca2('0x48')](_0x4168fb[_0x7ca2('0x46')],{'$or':_[_0x7ca2('0x49')](_0x5045b1,function(_0x1c4d54){if(_0x1c4d54['type'][_0x7ca2('0x4a')]!==_0x7ca2('0x4b')){var _0x1d911b={};_0x1d911b[_0x1c4d54[_0x7ca2('0x4c')]]={'$like':'%'+_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x47')]+'%'};return _0x1d911b;}})});}_0x4168fb=_[_0x7ca2('0x48')]({},_0x4168fb,_0x402f3f[_0x7ca2('0x4d')]);var _0x135c3d={'where':_0x4168fb[_0x7ca2('0x46')]};return db['ZohoAccount'][_0x7ca2('0x2c')](_0x135c3d)[_0x7ca2('0x33')](function(_0x305f15){_0x36eb7a['count']=_0x305f15;if(_0x402f3f[_0x7ca2('0x3c')][_0x7ca2('0x4e')]){_0x4168fb['include']=[{'all':!![]}];}return db[_0x7ca2('0x39')][_0x7ca2('0x4f')](_0x4168fb);})[_0x7ca2('0x33')](function(_0x3cab77){_0x36eb7a[_0x7ca2('0x50')]=_0x3cab77;return _0x36eb7a;})[_0x7ca2('0x33')](respondWithFilteredResult(_0x37ccdb,_0x4168fb))[_0x7ca2('0x27')](handleError(_0x37ccdb,null));};exports[_0x7ca2('0x51')]=function(_0x32fd75,_0x13c9ab){var _0x43d81e={'raw':![],'where':{'id':_0x32fd75[_0x7ca2('0x52')]['id']}},_0x1ba5f6={};_0x1ba5f6[_0x7ca2('0x3b')]=_[_0x7ca2('0x3d')](db[_0x7ca2('0x39')][_0x7ca2('0x3a')]);_0x1ba5f6[_0x7ca2('0x3c')]=_[_0x7ca2('0x3d')](_0x32fd75[_0x7ca2('0x3c')]);_0x1ba5f6[_0x7ca2('0x3e')]=_[_0x7ca2('0x3f')](_0x1ba5f6[_0x7ca2('0x3b')],_0x1ba5f6[_0x7ca2('0x3c')]);_0x43d81e[_0x7ca2('0x40')]=_[_0x7ca2('0x3f')](_0x1ba5f6[_0x7ca2('0x3b')],qs[_0x7ca2('0x41')](_0x32fd75[_0x7ca2('0x3c')]['fields']));_0x43d81e['attributes']=_0x43d81e['attributes'][_0x7ca2('0x42')]?_0x43d81e[_0x7ca2('0x40')]:_0x1ba5f6[_0x7ca2('0x3b')];if(_0x32fd75[_0x7ca2('0x3c')][_0x7ca2('0x4e')]){_0x43d81e[_0x7ca2('0x53')]=[{'all':!![]}];}_0x43d81e=_['merge']({},_0x43d81e,_0x32fd75['options']);return db[_0x7ca2('0x39')][_0x7ca2('0x54')](_0x43d81e)[_0x7ca2('0x33')](handleEntityNotFound(_0x13c9ab,null))[_0x7ca2('0x33')](respondWithResult(_0x13c9ab,null))['catch'](handleError(_0x13c9ab,null));};exports['create']=function(_0x2ebdeb,_0x59c2cf){return db[_0x7ca2('0x39')]['create'](_0x2ebdeb[_0x7ca2('0x55')],{})[_0x7ca2('0x33')](respondWithResult(_0x59c2cf,0xc9))[_0x7ca2('0x27')](handleError(_0x59c2cf,null));};exports['update']=function(_0x2181ff,_0x4d5136){if(_0x2181ff['body']['id']){delete _0x2181ff[_0x7ca2('0x55')]['id'];}return db[_0x7ca2('0x39')][_0x7ca2('0x54')]({'where':{'id':_0x2181ff['params']['id']}})[_0x7ca2('0x33')](handleEntityNotFound(_0x4d5136,null))['then'](saveUpdates(_0x2181ff['body'],null))['then'](respondWithResult(_0x4d5136,null))[_0x7ca2('0x27')](handleError(_0x4d5136,null));};exports[_0x7ca2('0x34')]=function(_0x4ee639,_0x75f6f6){return db['ZohoAccount']['find']({'where':{'id':_0x4ee639['params']['id']}})[_0x7ca2('0x33')](handleEntityNotFound(_0x75f6f6,null))['then'](removeEntity(_0x75f6f6,null))[_0x7ca2('0x27')](handleError(_0x75f6f6,null));};exports[_0x7ca2('0x56')]=function(_0x40363f,_0x5ace9c,_0x491d4e){var _0x41a036={};var _0x141cd4={};var _0x596b90;var _0x3e0150;return db[_0x7ca2('0x39')][_0x7ca2('0x57')]({'where':{'id':_0x40363f[_0x7ca2('0x52')]['id']}})['then'](handleEntityNotFound(_0x5ace9c,null))[_0x7ca2('0x33')](function(_0xf7e4f0){if(_0xf7e4f0){_0x596b90=_0xf7e4f0;_0x141cd4[_0x7ca2('0x3b')]=_[_0x7ca2('0x3d')](db['ZohoConfiguration'][_0x7ca2('0x3a')]);_0x141cd4['query']=_[_0x7ca2('0x3d')](_0x40363f[_0x7ca2('0x3c')]);_0x141cd4['filters']=_['intersection'](_0x141cd4[_0x7ca2('0x3b')],_0x141cd4[_0x7ca2('0x3c')]);_0x41a036['attributes']=_['intersection'](_0x141cd4[_0x7ca2('0x3b')],qs[_0x7ca2('0x41')](_0x40363f[_0x7ca2('0x3c')]['fields']));_0x41a036[_0x7ca2('0x40')]=_0x41a036[_0x7ca2('0x40')][_0x7ca2('0x42')]?_0x41a036[_0x7ca2('0x40')]:_0x141cd4[_0x7ca2('0x3b')];_0x41a036['order']=qs[_0x7ca2('0x45')](_0x40363f['query'][_0x7ca2('0x45')]);_0x41a036[_0x7ca2('0x46')]=qs[_0x7ca2('0x3e')](_['pick'](_0x40363f[_0x7ca2('0x3c')],_0x141cd4[_0x7ca2('0x3e')]));if(_0x40363f[_0x7ca2('0x3c')]['filter']){_0x41a036[_0x7ca2('0x46')]=_['merge'](_0x41a036['where'],{'$or':_[_0x7ca2('0x49')](_0x41a036['attributes'],function(_0x34d944){var _0x7e0eb9={};_0x7e0eb9[_0x34d944]={'$like':'%'+_0x40363f[_0x7ca2('0x3c')][_0x7ca2('0x47')]+'%'};return _0x7e0eb9;})});}_0x41a036=_[_0x7ca2('0x48')]({},_0x41a036,_0x40363f[_0x7ca2('0x4d')]);return _0x596b90['getConfigurations'](_0x41a036);}})[_0x7ca2('0x33')](function(_0x437432){if(_0x437432){_0x3e0150=_0x437432[_0x7ca2('0x42')];if(!_0x40363f['query'][_0x7ca2('0x43')](_0x7ca2('0x44'))){_0x41a036['limit']=qs[_0x7ca2('0x2e')](_0x40363f['query'][_0x7ca2('0x2e')]);_0x41a036['offset']=qs[_0x7ca2('0x2d')](_0x40363f[_0x7ca2('0x3c')]['offset']);}return _0x596b90[_0x7ca2('0x56')](_0x41a036);}})[_0x7ca2('0x33')](function(_0xbf3b9b){if(_0xbf3b9b){return _0xbf3b9b?{'count':_0x3e0150,'rows':_0xbf3b9b}:null;}})['then'](respondWithResult(_0x5ace9c,null))[_0x7ca2('0x27')](handleError(_0x5ace9c,null));};exports[_0x7ca2('0x58')]=function(_0x1d949e,_0x1de89a,_0x51b2f7){if(_0x1d949e[_0x7ca2('0x55')]['id']){delete _0x1d949e['body']['id'];}return db[_0x7ca2('0x39')]['findOne']({'where':{'id':_0x1d949e[_0x7ca2('0x52')]['id']}})[_0x7ca2('0x33')](handleEntityNotFound(_0x1de89a,null))[_0x7ca2('0x33')](function(_0x318a97){if(_0x318a97){_0x1d949e[_0x7ca2('0x55')][_0x7ca2('0x59')]=_0x318a97['id'];_0x1d949e['body'][_0x7ca2('0x5a')]=integrations[_0x7ca2('0x5b')](_0x1d949e[_0x7ca2('0x55')]['channel'],_0x1d949e[_0x7ca2('0x55')][_0x7ca2('0x5c')]);_0x1d949e[_0x7ca2('0x55')]['Descriptions']=integrations[_0x7ca2('0x5d')](_0x1d949e[_0x7ca2('0x55')][_0x7ca2('0x5e')],_0x1d949e[_0x7ca2('0x55')]['type']);return db[_0x7ca2('0x5f')]['create'](_0x1d949e['body'],{'include':[{'model':db[_0x7ca2('0x60')],'as':_0x7ca2('0x5a')},{'model':db[_0x7ca2('0x60')],'as':_0x7ca2('0x61')}]});}return null;})['then'](respondWithResult(_0x1de89a,null))[_0x7ca2('0x27')](handleError(_0x1de89a,null));};exports[_0x7ca2('0x62')]=function(_0x969b22,_0x544951,_0xe5fb7a){var _0x327b62='';return db[_0x7ca2('0x39')][_0x7ca2('0x57')]({'where':{'id':_0x969b22['params']['id']},'attributes':['id',_0x7ca2('0x63'),_0x7ca2('0x64')]})[_0x7ca2('0x33')](handleEntityNotFound(_0x544951,null))['then'](function(_0xbe513c){if(_0xbe513c){_0x327b62=_0xbe513c[_0x7ca2('0x63')];var _0x45955c=_0x327b62[_0x7ca2('0x65')](-0x1);if(_0x45955c==='/'){_0x327b62=_0x327b62[_0x7ca2('0x66')](0x0,_0x327b62['lastIndexOf'](_0x45955c));}return rp({'method':_0x7ca2('0x67'),'uri':util[_0x7ca2('0x68')]('https://crm.%s/crm/private/json/Calls/getFields',_0x327b62),'qs':{'authtoken':_0xbe513c[_0x7ca2('0x64')],'scope':_0x7ca2('0x69')},'json':!![]});}})[_0x7ca2('0x33')](function(_0x29b799){if(_0x29b799){if(_0x29b799[_0x7ca2('0x6a')]&&_0x29b799['response'][_0x7ca2('0x22')]){throw new Error(_0x29b799[_0x7ca2('0x6a')][_0x7ca2('0x22')]['message']);}var _0x5bd2f6=[];if(_0x29b799[_0x7ca2('0x6b')]&&_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]){if(_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]['FL']){var _0x31114=[_0x7ca2('0x6d')];for(var _0x1d7d26=0x0,_0x186705=_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]['FL']['length'];_0x1d7d26<_0x186705;_0x1d7d26++){if(_[_0x7ca2('0x6e')](_0x31114,_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]['FL'][_0x1d7d26]['dv'])){_0x5bd2f6[_0x7ca2('0x6f')]({'id':_0x29b799[_0x7ca2('0x6b')]['section']['FL'][_0x1d7d26]['dv'],'name':_0x29b799['Calls'][_0x7ca2('0x6c')]['FL'][_0x1d7d26][_0x7ca2('0x70')],'custom':_0x29b799[_0x7ca2('0x6b')]['section']['FL'][_0x1d7d26][_0x7ca2('0x71')]===_0x7ca2('0x72')?!![]:![],'options':_0x29b799[_0x7ca2('0x6b')]['section']['FL'][_0x1d7d26]['type']==='Pick\x20List'&&_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]['FL'][_0x1d7d26]['val']?_[_0x7ca2('0x49')](_0x29b799[_0x7ca2('0x6b')][_0x7ca2('0x6c')]['FL'][_0x1d7d26]['val'],function(_0x81e7c7){return{'name':_0x81e7c7,'value':_0x81e7c7};}):[]});}}}}return{'count':_0x5bd2f6[_0x7ca2('0x42')],'rows':_0x5bd2f6};}})[_0x7ca2('0x33')](respondWithResult(_0x544951,null))[_0x7ca2('0x27')](function(_0x58b48b){var _0x278b5f=_0x969b22[_0x7ca2('0x3c')]['test']?0x1f4:_0x58b48b[_0x7ca2('0x73')]||0x1f4;logger[_0x7ca2('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x7ca2('0x62'),_0x278b5f,JSON[_0x7ca2('0x74')](_0x58b48b));delete _0x58b48b['name'];if(_0x278b5f===0x191){_0x278b5f=0x190;}_0x544951[_0x7ca2('0x2a')](_0x278b5f)[_0x7ca2('0x37')](_0x969b22[_0x7ca2('0x3c')][_0x7ca2('0x75')]?{'message':_0x7ca2('0x76'),'statusCode':_0x58b48b[_0x7ca2('0x73')]}:_0x58b48b);});}; \ No newline at end of file +var _0xeb1c=['show','params','options','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','getFields','authToken','slice','substring','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','includes','push','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','stack','name','send','ZohoAccount','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows'];(function(_0x3a362,_0x2883e1){var _0x5628df=function(_0x397ec5){while(--_0x397ec5){_0x3a362['push'](_0x3a362['shift']());}};_0x5628df(++_0x2883e1);}(_0xeb1c,0xa0));var _0xceb1=function(_0x30e137,_0x3f8408){_0x30e137=_0x30e137-0x0;var _0x19d31c=_0xeb1c[_0x30e137];return _0x19d31c;};'use strict';var pdf=require(_0xceb1('0x0'));var emlformat=require(_0xceb1('0x1'));var rimraf=require(_0xceb1('0x2'));var zipdir=require(_0xceb1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceb1('0x4'));var moment=require(_0xceb1('0x5'));var BPromise=require(_0xceb1('0x6'));var Mustache=require(_0xceb1('0x7'));var util=require(_0xceb1('0x8'));var path=require('path');var sox=require(_0xceb1('0x9'));var csv=require(_0xceb1('0xa'));var ejs=require(_0xceb1('0xb'));var fs=require('fs');var _=require(_0xceb1('0xc'));var squel=require(_0xceb1('0xd'));var crypto=require(_0xceb1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xceb1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xceb1('0x10'));var Papa=require('papaparse');var Redis=require(_0xceb1('0x11'));var authService=require(_0xceb1('0x12'));var qs=require(_0xceb1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xceb1('0x14'))(_0xceb1('0x15'));var utils=require('../../config/utils');var config=require(_0xceb1('0x16'));var db=require(_0xceb1('0x17'))['db'];var integrations=require(_0xceb1('0x18'));var jayson=require(_0xceb1('0x19'));var client=jayson[_0xceb1('0x1a')][_0xceb1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x489337,_0x231bb0,_0x2a049a){if(_0x2a049a){var _0x95a2fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x95a2fe['test'](_0x231bb0)){return _0x489337;}else{throw new Error(_0xceb1('0x1c'));}}else{return _0x489337;}}function respondWithRpcPromise(_0x3e8ac6,_0x48a200,_0x35a9e7,_0x584507){return new BPromise(function(_0x2bcb8c,_0x282931){var _0x41e920=_0x584507||client;return _0x41e920[_0xceb1('0x1d')](_0x3e8ac6,_0x35a9e7)['then'](function(_0x1c3bb2){logger['info'](_0xceb1('0x1e'),_0x48a200,_0xceb1('0x1f'));logger[_0xceb1('0x20')](_0xceb1('0x21'),_0x48a200,_0xceb1('0x1f'),JSON[_0xceb1('0x22')](_0x1c3bb2));if(_0x1c3bb2[_0xceb1('0x23')]){if(_0x1c3bb2[_0xceb1('0x23')][_0xceb1('0x24')]===0x1f4){logger[_0xceb1('0x23')]('ZohoAccount,\x20%s,\x20%s',_0x48a200,_0x1c3bb2[_0xceb1('0x23')][_0xceb1('0x25')]);return _0x282931(_0x1c3bb2[_0xceb1('0x23')][_0xceb1('0x25')]);}logger[_0xceb1('0x23')](_0xceb1('0x1e'),_0x48a200,_0x1c3bb2['error'][_0xceb1('0x25')]);return _0x2bcb8c(_0x1c3bb2[_0xceb1('0x23')][_0xceb1('0x25')]);}else{logger[_0xceb1('0x26')]('ZohoAccount,\x20%s,\x20%s',_0x48a200,_0xceb1('0x1f'));_0x2bcb8c(_0x1c3bb2[_0xceb1('0x27')]['message']);}})[_0xceb1('0x28')](function(_0x169174){logger[_0xceb1('0x23')]('ZohoAccount,\x20%s,\x20%s',_0x48a200,_0x169174);_0x282931(_0x169174);});});}function respondWithStatusCode(_0x35313f,_0x4028d0){_0x4028d0=_0x4028d0||0xcc;return function(_0x1061f9){if(_0x1061f9){return _0x35313f[_0xceb1('0x29')](_0x4028d0);}return _0x35313f['status'](_0x4028d0)[_0xceb1('0x2a')]();};}function respondWithResult(_0x49eb9e,_0x114b44){_0x114b44=_0x114b44||0xc8;return function(_0x358d00){if(_0x358d00){return _0x49eb9e[_0xceb1('0x2b')](_0x114b44)[_0xceb1('0x2c')](_0x358d00);}};}function respondWithFilteredResult(_0x2942da,_0x26ab9a){return function(_0x5c82d8){if(_0x5c82d8){var _0x3cbb77=_0x5c82d8[_0xceb1('0x2d')],_0x55a202=_0x26ab9a['offset'],_0x5bf03d=_0x26ab9a[_0xceb1('0x2e')]+_0x26ab9a[_0xceb1('0x2f')],_0x510c25;if(_0x5bf03d>=_0x3cbb77){_0x5bf03d=_0x3cbb77;_0x510c25=0xc8;}else{_0x510c25=0xce;}_0x2942da['status'](_0x510c25);return _0x2942da[_0xceb1('0x30')](_0xceb1('0x31'),_0x55a202+'-'+_0x5bf03d+'/'+_0x3cbb77)[_0xceb1('0x2c')](_0x5c82d8);}return null;};}function patchUpdates(_0x428ac4){return function(_0xac2eeb){try{jsonpatch['apply'](_0xac2eeb,_0x428ac4,!![]);}catch(_0x294ad0){return BPromise[_0xceb1('0x32')](_0x294ad0);}return _0xac2eeb[_0xceb1('0x33')]();};}function saveUpdates(_0x321f3a,_0x26fea2){return function(_0x13cd66){if(_0x13cd66){return _0x13cd66['update'](_0x321f3a)[_0xceb1('0x34')](function(_0x3bc1fc){return _0x3bc1fc;});}return null;};}function removeEntity(_0x59797a,_0x223d4e){return function(_0x3d9957){if(_0x3d9957){return _0x3d9957[_0xceb1('0x35')]()['then'](function(){_0x59797a[_0xceb1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28575a,_0x367e32){return function(_0x69cad1){if(!_0x69cad1){_0x28575a[_0xceb1('0x29')](0x194);}return _0x69cad1;};}function handleError(_0x1f8570,_0x34abc6){_0x34abc6=_0x34abc6||0x1f4;return function(_0x4f858e){logger[_0xceb1('0x23')](_0x4f858e[_0xceb1('0x36')]);if(_0x4f858e[_0xceb1('0x37')]){delete _0x4f858e[_0xceb1('0x37')];}_0x1f8570[_0xceb1('0x2b')](_0x34abc6)[_0xceb1('0x38')](_0x4f858e);};}exports['index']=function(_0x229780,_0x28821c){var _0x413bde={},_0x7e40b2={},_0x55a9f1={'count':0x0,'rows':[]};var _0x56cdd4=db[_0xceb1('0x39')][_0xceb1('0x3a')];_0x7e40b2['model']=_['keys'](_0x56cdd4);_0x7e40b2[_0xceb1('0x3b')]=_[_0xceb1('0x3c')](_0x229780[_0xceb1('0x3b')]);_0x7e40b2[_0xceb1('0x3d')]=_[_0xceb1('0x3e')](_0x7e40b2[_0xceb1('0x3f')],_0x7e40b2[_0xceb1('0x3b')]);_0x413bde[_0xceb1('0x40')]=_[_0xceb1('0x3e')](_0x7e40b2[_0xceb1('0x3f')],qs[_0xceb1('0x41')](_0x229780[_0xceb1('0x3b')][_0xceb1('0x41')]));_0x413bde[_0xceb1('0x40')]=_0x413bde[_0xceb1('0x40')][_0xceb1('0x42')]?_0x413bde[_0xceb1('0x40')]:_0x7e40b2[_0xceb1('0x3f')];if(!_0x229780[_0xceb1('0x3b')][_0xceb1('0x43')](_0xceb1('0x44'))){_0x413bde[_0xceb1('0x2f')]=qs[_0xceb1('0x2f')](_0x229780[_0xceb1('0x3b')][_0xceb1('0x2f')]);_0x413bde['offset']=qs[_0xceb1('0x2e')](_0x229780[_0xceb1('0x3b')][_0xceb1('0x2e')]);}_0x413bde[_0xceb1('0x45')]=qs['sort'](_0x229780['query'][_0xceb1('0x46')]);_0x413bde['where']=qs['filters'](_[_0xceb1('0x47')](_0x229780[_0xceb1('0x3b')],_0x7e40b2[_0xceb1('0x3d')]));if(_0x229780[_0xceb1('0x3b')][_0xceb1('0x48')]){_0x413bde[_0xceb1('0x49')]=_[_0xceb1('0x4a')](_0x413bde[_0xceb1('0x49')],{'$or':_[_0xceb1('0x4b')](_0x56cdd4,function(_0x3528f9){if(_0x3528f9[_0xceb1('0x4c')][_0xceb1('0x4d')]!==_0xceb1('0x4e')){var _0x480dd5={};_0x480dd5[_0x3528f9[_0xceb1('0x4f')]]={'$like':'%'+_0x229780['query'][_0xceb1('0x48')]+'%'};return _0x480dd5;}})});}_0x413bde=_[_0xceb1('0x4a')]({},_0x413bde,_0x229780['options']);var _0x28c6ce={'where':_0x413bde['where']};return db['ZohoAccount'][_0xceb1('0x2d')](_0x28c6ce)['then'](function(_0x8dee92){_0x55a9f1[_0xceb1('0x2d')]=_0x8dee92;if(_0x229780['query'][_0xceb1('0x50')]){_0x413bde[_0xceb1('0x51')]=[{'all':!![]}];}return db[_0xceb1('0x39')][_0xceb1('0x52')](_0x413bde);})[_0xceb1('0x34')](function(_0x4f2587){_0x55a9f1[_0xceb1('0x53')]=_0x4f2587;return _0x55a9f1;})[_0xceb1('0x34')](respondWithFilteredResult(_0x28821c,_0x413bde))['catch'](handleError(_0x28821c,null));};exports[_0xceb1('0x54')]=function(_0x519e2f,_0x5b3542){var _0x77e1ce={'raw':![],'where':{'id':_0x519e2f[_0xceb1('0x55')]['id']}},_0x56268e={};_0x56268e[_0xceb1('0x3f')]=_[_0xceb1('0x3c')](db[_0xceb1('0x39')][_0xceb1('0x3a')]);_0x56268e[_0xceb1('0x3b')]=_[_0xceb1('0x3c')](_0x519e2f[_0xceb1('0x3b')]);_0x56268e[_0xceb1('0x3d')]=_[_0xceb1('0x3e')](_0x56268e['model'],_0x56268e[_0xceb1('0x3b')]);_0x77e1ce[_0xceb1('0x40')]=_['intersection'](_0x56268e[_0xceb1('0x3f')],qs[_0xceb1('0x41')](_0x519e2f['query'][_0xceb1('0x41')]));_0x77e1ce[_0xceb1('0x40')]=_0x77e1ce[_0xceb1('0x40')][_0xceb1('0x42')]?_0x77e1ce[_0xceb1('0x40')]:_0x56268e[_0xceb1('0x3f')];if(_0x519e2f[_0xceb1('0x3b')][_0xceb1('0x50')]){_0x77e1ce[_0xceb1('0x51')]=[{'all':!![]}];}_0x77e1ce=_[_0xceb1('0x4a')]({},_0x77e1ce,_0x519e2f[_0xceb1('0x56')]);return db[_0xceb1('0x39')][_0xceb1('0x57')](_0x77e1ce)[_0xceb1('0x34')](handleEntityNotFound(_0x5b3542,null))[_0xceb1('0x34')](respondWithResult(_0x5b3542,null))['catch'](handleError(_0x5b3542,null));};exports[_0xceb1('0x58')]=function(_0x4afa82,_0xe6d389){return db[_0xceb1('0x39')][_0xceb1('0x58')](_0x4afa82[_0xceb1('0x59')],{})[_0xceb1('0x34')](respondWithResult(_0xe6d389,0xc9))[_0xceb1('0x28')](handleError(_0xe6d389,null));};exports[_0xceb1('0x5a')]=function(_0x561f00,_0xe87c5b){if(_0x561f00[_0xceb1('0x59')]['id']){delete _0x561f00[_0xceb1('0x59')]['id'];}return db[_0xceb1('0x39')][_0xceb1('0x57')]({'where':{'id':_0x561f00[_0xceb1('0x55')]['id']}})['then'](handleEntityNotFound(_0xe87c5b,null))[_0xceb1('0x34')](saveUpdates(_0x561f00[_0xceb1('0x59')],null))[_0xceb1('0x34')](respondWithResult(_0xe87c5b,null))[_0xceb1('0x28')](handleError(_0xe87c5b,null));};exports[_0xceb1('0x35')]=function(_0x3e211e,_0x27d458){return db[_0xceb1('0x39')][_0xceb1('0x57')]({'where':{'id':_0x3e211e[_0xceb1('0x55')]['id']}})[_0xceb1('0x34')](handleEntityNotFound(_0x27d458,null))['then'](removeEntity(_0x27d458,null))[_0xceb1('0x28')](handleError(_0x27d458,null));};exports[_0xceb1('0x5b')]=function(_0xb87e02,_0x5588ab,_0x575957){var _0x8cdcbb={};var _0x2ed512={};var _0x35023d;var _0x4563ec;return db[_0xceb1('0x39')][_0xceb1('0x5c')]({'where':{'id':_0xb87e02[_0xceb1('0x55')]['id']}})[_0xceb1('0x34')](handleEntityNotFound(_0x5588ab,null))[_0xceb1('0x34')](function(_0x3b2d92){if(_0x3b2d92){_0x35023d=_0x3b2d92;_0x2ed512['model']=_['keys'](db[_0xceb1('0x5d')][_0xceb1('0x3a')]);_0x2ed512[_0xceb1('0x3b')]=_[_0xceb1('0x3c')](_0xb87e02[_0xceb1('0x3b')]);_0x2ed512[_0xceb1('0x3d')]=_[_0xceb1('0x3e')](_0x2ed512[_0xceb1('0x3f')],_0x2ed512['query']);_0x8cdcbb[_0xceb1('0x40')]=_[_0xceb1('0x3e')](_0x2ed512[_0xceb1('0x3f')],qs['fields'](_0xb87e02[_0xceb1('0x3b')][_0xceb1('0x41')]));_0x8cdcbb[_0xceb1('0x40')]=_0x8cdcbb['attributes'][_0xceb1('0x42')]?_0x8cdcbb['attributes']:_0x2ed512[_0xceb1('0x3f')];_0x8cdcbb[_0xceb1('0x45')]=qs[_0xceb1('0x46')](_0xb87e02['query'][_0xceb1('0x46')]);_0x8cdcbb[_0xceb1('0x49')]=qs['filters'](_[_0xceb1('0x47')](_0xb87e02[_0xceb1('0x3b')],_0x2ed512[_0xceb1('0x3d')]));if(_0xb87e02['query'][_0xceb1('0x48')]){_0x8cdcbb[_0xceb1('0x49')]=_['merge'](_0x8cdcbb[_0xceb1('0x49')],{'$or':_[_0xceb1('0x4b')](_0x8cdcbb[_0xceb1('0x40')],function(_0x2ed748){var _0xa84c4a={};_0xa84c4a[_0x2ed748]={'$like':'%'+_0xb87e02[_0xceb1('0x3b')][_0xceb1('0x48')]+'%'};return _0xa84c4a;})});}_0x8cdcbb=_['merge']({},_0x8cdcbb,_0xb87e02['options']);return _0x35023d[_0xceb1('0x5b')](_0x8cdcbb);}})['then'](function(_0x46ef16){if(_0x46ef16){_0x4563ec=_0x46ef16[_0xceb1('0x42')];if(!_0xb87e02[_0xceb1('0x3b')]['hasOwnProperty'](_0xceb1('0x44'))){_0x8cdcbb[_0xceb1('0x2f')]=qs[_0xceb1('0x2f')](_0xb87e02[_0xceb1('0x3b')][_0xceb1('0x2f')]);_0x8cdcbb[_0xceb1('0x2e')]=qs[_0xceb1('0x2e')](_0xb87e02['query'][_0xceb1('0x2e')]);}return _0x35023d[_0xceb1('0x5b')](_0x8cdcbb);}})['then'](function(_0x34112f){if(_0x34112f){return _0x34112f?{'count':_0x4563ec,'rows':_0x34112f}:null;}})['then'](respondWithResult(_0x5588ab,null))[_0xceb1('0x28')](handleError(_0x5588ab,null));};exports['addConfiguration']=function(_0x2e642f,_0x53bd16,_0x4dc74f){if(_0x2e642f['body']['id']){delete _0x2e642f[_0xceb1('0x59')]['id'];}return db[_0xceb1('0x39')]['findOne']({'where':{'id':_0x2e642f[_0xceb1('0x55')]['id']}})[_0xceb1('0x34')](handleEntityNotFound(_0x53bd16,null))['then'](function(_0x3c5189){if(_0x3c5189){_0x2e642f[_0xceb1('0x59')][_0xceb1('0x5e')]=_0x3c5189['id'];_0x2e642f[_0xceb1('0x59')]['Subjects']=integrations[_0xceb1('0x5f')](_0x2e642f[_0xceb1('0x59')][_0xceb1('0x60')],_0x2e642f[_0xceb1('0x59')][_0xceb1('0x4c')]);_0x2e642f[_0xceb1('0x59')][_0xceb1('0x61')]=integrations[_0xceb1('0x62')](_0x2e642f[_0xceb1('0x59')][_0xceb1('0x60')],_0x2e642f[_0xceb1('0x59')]['type']);return db[_0xceb1('0x5d')][_0xceb1('0x58')](_0x2e642f[_0xceb1('0x59')],{'include':[{'model':db[_0xceb1('0x63')],'as':_0xceb1('0x64')},{'model':db[_0xceb1('0x63')],'as':_0xceb1('0x61')}]});}return null;})['then'](respondWithResult(_0x53bd16,null))[_0xceb1('0x28')](handleError(_0x53bd16,null));};exports[_0xceb1('0x65')]=function(_0x492049,_0x3ea417,_0x4f2370){var _0x5d3032='';return db['ZohoAccount'][_0xceb1('0x5c')]({'where':{'id':_0x492049['params']['id']},'attributes':['id','host',_0xceb1('0x66')]})[_0xceb1('0x34')](handleEntityNotFound(_0x3ea417,null))['then'](function(_0x2297b4){if(_0x2297b4){_0x5d3032=_0x2297b4['host'];var _0x5b25e9=_0x5d3032[_0xceb1('0x67')](-0x1);if(_0x5b25e9==='/'){_0x5d3032=_0x5d3032[_0xceb1('0x68')](0x0,_0x5d3032[_0xceb1('0x69')](_0x5b25e9));}return rp({'method':_0xceb1('0x6a'),'uri':util[_0xceb1('0x6b')](_0xceb1('0x6c'),_0x5d3032),'qs':{'authtoken':_0x2297b4[_0xceb1('0x66')],'scope':_0xceb1('0x6d')},'json':!![]});}})['then'](function(_0x19403c){if(_0x19403c){if(_0x19403c[_0xceb1('0x6e')]&&_0x19403c[_0xceb1('0x6e')][_0xceb1('0x23')]){throw new Error(_0x19403c[_0xceb1('0x6e')]['error'][_0xceb1('0x25')]);}var _0x2bc911=[];if(_0x19403c[_0xceb1('0x6f')]&&_0x19403c[_0xceb1('0x6f')]['section']){if(_0x19403c[_0xceb1('0x6f')][_0xceb1('0x70')]['FL']){var _0x143f23=[_0xceb1('0x71')];for(var _0xf42e0=0x0,_0x26fda7=_0x19403c[_0xceb1('0x6f')]['section']['FL']['length'];_0xf42e0<_0x26fda7;_0xf42e0++){if(_[_0xceb1('0x72')](_0x143f23,_0x19403c[_0xceb1('0x6f')][_0xceb1('0x70')]['FL'][_0xf42e0]['dv'])){_0x2bc911[_0xceb1('0x73')]({'id':_0x19403c['Calls'][_0xceb1('0x70')]['FL'][_0xf42e0]['dv'],'name':_0x19403c['Calls'][_0xceb1('0x70')]['FL'][_0xf42e0]['label'],'custom':_0x19403c['Calls'][_0xceb1('0x70')]['FL'][_0xf42e0]['customfield']==='true'?!![]:![],'options':_0x19403c[_0xceb1('0x6f')][_0xceb1('0x70')]['FL'][_0xf42e0][_0xceb1('0x4c')]===_0xceb1('0x74')&&_0x19403c[_0xceb1('0x6f')]['section']['FL'][_0xf42e0][_0xceb1('0x75')]?_['map'](_0x19403c[_0xceb1('0x6f')][_0xceb1('0x70')]['FL'][_0xf42e0][_0xceb1('0x75')],function(_0x44eea1){return{'name':_0x44eea1,'value':_0x44eea1};}):[]});}}}}return{'count':_0x2bc911['length'],'rows':_0x2bc911};}})[_0xceb1('0x34')](respondWithResult(_0x3ea417,null))[_0xceb1('0x28')](function(_0x52d7c8){var _0x53dd9a=_0x492049['query'][_0xceb1('0x76')]?0x1f4:_0x52d7c8[_0xceb1('0x77')]||0x1f4;logger[_0xceb1('0x23')](_0xceb1('0x78'),_0xceb1('0x65'),_0x53dd9a,JSON[_0xceb1('0x22')](_0x52d7c8));delete _0x52d7c8[_0xceb1('0x37')];if(_0x53dd9a===0x191){_0x53dd9a=0x190;}_0x3ea417[_0xceb1('0x2b')](_0x53dd9a)[_0xceb1('0x38')](_0x492049[_0xceb1('0x3b')]['test']?{'message':_0xceb1('0x79'),'statusCode':_0x52d7c8[_0xceb1('0x77')]}:_0x52d7c8);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 950912c..011b773 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 _0xe978=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','lodash','util'];(function(_0x561516,_0xb74f21){var _0x1e5384=function(_0x14e50f){while(--_0x14e50f){_0x561516['push'](_0x561516['shift']());}};_0x1e5384(++_0xb74f21);}(_0xe978,0x191));var _0x8e97=function(_0x5de1fe,_0x40f3e2){_0x5de1fe=_0x5de1fe-0x0;var _0x5eff35=_0xe978[_0x5de1fe];return _0x5eff35;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var logger=require(_0x8e97('0x2'))('api');var moment=require(_0x8e97('0x3'));var BPromise=require(_0x8e97('0x4'));var rp=require(_0x8e97('0x5'));var fs=require('fs');var path=require(_0x8e97('0x6'));var rimraf=require(_0x8e97('0x7'));var config=require(_0x8e97('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8e97('0x9'));module[_0x8e97('0xa')]=function(_0x2f5df1,_0x250e6f){return _0x2f5df1[_0x8e97('0xb')](_0x8e97('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5542=['int_zoho_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x1eb790,_0xa02b64){var _0x362362=function(_0x4c0cf3){while(--_0x4c0cf3){_0x1eb790['push'](_0x1eb790['shift']());}};_0x362362(++_0xa02b64);}(_0x5542,0xaa));var _0x2554=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0x5542[_0x159f8e];return _0x458e17;};'use strict';var _=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var logger=require(_0x2554('0x2'))(_0x2554('0x3'));var moment=require('moment');var BPromise=require(_0x2554('0x4'));var rp=require(_0x2554('0x5'));var fs=require('fs');var path=require(_0x2554('0x6'));var rimraf=require(_0x2554('0x7'));var config=require('../../config/environment');var attributes=require(_0x2554('0x8'));var integrations=require(_0x2554('0x9'));module[_0x2554('0xa')]=function(_0x2b8c97,_0x5ed58f){return _0x2b8c97[_0x2554('0xb')]('ZohoAccount',attributes,{'tableName':_0x2554('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8acf03b..5bc6421 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 _0x052c=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','lodash'];(function(_0x59f1aa,_0x4429b0){var _0x4a959d=function(_0x4b2116){while(--_0x4b2116){_0x59f1aa['push'](_0x59f1aa['shift']());}};_0x4a959d(++_0x4429b0);}(_0x052c,0xe6));var _0xc052=function(_0xca0c19,_0xbf9213){_0xca0c19=_0xca0c19-0x0;var _0x29b797=_0x052c[_0xca0c19];return _0x29b797;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));var moment=require(_0xc052('0x2'));var BPromise=require(_0xc052('0x3'));var rs=require(_0xc052('0x4'));var fs=require('fs');var Redis=require(_0xc052('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc052('0x6'))(_0xc052('0x7'));var config=require('../../config/environment');var jayson=require(_0xc052('0x8'));var client=jayson[_0xc052('0x9')][_0xc052('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58e8a4,_0xb0d25b,_0x8fd3c3){return new BPromise(function(_0x7211ff,_0x350ec9){return client[_0xc052('0xb')](_0x58e8a4,_0x8fd3c3)[_0xc052('0xc')](function(_0x11c76f){logger[_0xc052('0xd')](_0xc052('0xe'),_0xb0d25b,_0xc052('0xf'));logger[_0xc052('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xb0d25b,_0xc052('0xf'),JSON[_0xc052('0x11')](_0x11c76f));if(_0x11c76f[_0xc052('0x12')]){if(_0x11c76f[_0xc052('0x12')]['code']===0x1f4){logger['error'](_0xc052('0xe'),_0xb0d25b,_0x11c76f[_0xc052('0x12')][_0xc052('0x13')]);return _0x350ec9(_0x11c76f['error'][_0xc052('0x13')]);}logger['error'](_0xc052('0xe'),_0xb0d25b,_0x11c76f[_0xc052('0x12')]['message']);return _0x7211ff(_0x11c76f['error'][_0xc052('0x13')]);}else{logger[_0xc052('0xd')](_0xc052('0xe'),_0xb0d25b,'request\x20sent');_0x7211ff(_0x11c76f[_0xc052('0x14')]['message']);}})[_0xc052('0x15')](function(_0x13c401){logger[_0xc052('0x12')]('ZohoAccount,\x20%s,\x20%s',_0xb0d25b,_0x13c401);_0x350ec9(_0x13c401);});});}exports[_0xc052('0x16')]=function(_0x2dc290){var _0x2e9e87=this;return new Promise(function(_0x32b0ed,_0x5e843e){return db[_0xc052('0x17')]['findAll']({'raw':_0x2dc290[_0xc052('0x18')]?_0x2dc290[_0xc052('0x18')][_0xc052('0x19')]===undefined?!![]:![]:!![],'where':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1a')]||null:null,'attributes':_0x2dc290[_0xc052('0x18')]?_0x2dc290[_0xc052('0x18')][_0xc052('0x1b')]||null:null,'limit':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1c')]||null:null,'include':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1d')]?_['map'](_0x2dc290[_0xc052('0x18')][_0xc052('0x1d')],function(_0x2f17b6){return{'model':db[_0x2f17b6[_0xc052('0x1e')]],'as':_0x2f17b6['as'],'attributes':_0x2f17b6['attributes'],'include':_0x2f17b6[_0xc052('0x1d')]?_['map'](_0x2f17b6['include'],function(_0x34d52f){return{'model':db[_0x34d52f[_0xc052('0x1e')]],'as':_0x34d52f['as'],'attributes':_0x34d52f['attributes'],'include':_0x34d52f[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x34d52f['include'],function(_0x1af454){return{'model':db[_0x1af454[_0xc052('0x1e')]],'as':_0x1af454['as'],'attributes':_0x1af454[_0xc052('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc052('0xc')](function(_0x5d3764){logger[_0xc052('0xd')](_0xc052('0x16'),_0x2dc290);logger[_0xc052('0x10')](_0xc052('0x16'),_0x2dc290,JSON[_0xc052('0x11')](_0x5d3764));_0x32b0ed(_0x5d3764);})[_0xc052('0x15')](function(_0x2a1752){logger[_0xc052('0x12')](_0xc052('0x16'),_0x2a1752[_0xc052('0x13')],_0x2dc290);_0x5e843e(_0x2e9e87[_0xc052('0x12')](0x1f4,_0x2a1752[_0xc052('0x13')]));});});};exports[_0xc052('0x20')]=function(_0x3f4729){var _0x33d560=this;return new Promise(function(_0x283f23,_0x371cdb){return db['ZohoAccount']['find']({'raw':_0x3f4729[_0xc052('0x18')]?_0x3f4729[_0xc052('0x18')][_0xc052('0x19')]===undefined?!![]:![]:!![],'where':_0x3f4729[_0xc052('0x18')]?_0x3f4729['options'][_0xc052('0x1a')]||null:null,'attributes':_0x3f4729[_0xc052('0x18')]?_0x3f4729[_0xc052('0x18')][_0xc052('0x1b')]||null:null,'include':_0x3f4729['options']?_0x3f4729['options']['include']?_['map'](_0x3f4729[_0xc052('0x18')]['include'],function(_0x5d8176){return{'model':db[_0x5d8176['model']],'as':_0x5d8176['as'],'attributes':_0x5d8176['attributes'],'include':_0x5d8176[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x5d8176[_0xc052('0x1d')],function(_0x57755c){return{'model':db[_0x57755c[_0xc052('0x1e')]],'as':_0x57755c['as'],'attributes':_0x57755c[_0xc052('0x1b')],'include':_0x57755c[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x57755c[_0xc052('0x1d')],function(_0x38cd6e){return{'model':db[_0x38cd6e['model']],'as':_0x38cd6e['as'],'attributes':_0x38cd6e[_0xc052('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc052('0xc')](function(_0x5f594d){logger[_0xc052('0xd')]('ShowZohoAccount',_0x3f4729);logger[_0xc052('0x10')](_0xc052('0x20'),_0x3f4729,JSON['stringify'](_0x5f594d));_0x283f23(_0x5f594d);})[_0xc052('0x15')](function(_0x10cef0){logger[_0xc052('0x12')](_0xc052('0x20'),_0x10cef0[_0xc052('0x13')],_0x3f4729);_0x371cdb(_0x33d560[_0xc052('0x12')](0x1f4,_0x10cef0['message']));});});}; \ No newline at end of file +var _0x97bb=['debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','map','include','model','ShowZohoAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s'];(function(_0x3e5cd3,_0x17c4b2){var _0x1e8bd0=function(_0x3e2290){while(--_0x3e2290){_0x3e5cd3['push'](_0x3e5cd3['shift']());}};_0x1e8bd0(++_0x17c4b2);}(_0x97bb,0x1c2));var _0xb97b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x97bb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb97b('0x0'));var util=require(_0xb97b('0x1'));var moment=require(_0xb97b('0x2'));var BPromise=require(_0xb97b('0x3'));var rs=require(_0xb97b('0x4'));var fs=require('fs');var Redis=require(_0xb97b('0x5'));var db=require(_0xb97b('0x6'))['db'];var utils=require(_0xb97b('0x7'));var logger=require(_0xb97b('0x8'))(_0xb97b('0x9'));var config=require(_0xb97b('0xa'));var jayson=require(_0xb97b('0xb'));var client=jayson[_0xb97b('0xc')][_0xb97b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cad17,_0x652877,_0x119bea){return new BPromise(function(_0x5b0ada,_0x52b79e){return client[_0xb97b('0xe')](_0x5cad17,_0x119bea)[_0xb97b('0xf')](function(_0x5e4073){logger[_0xb97b('0x10')](_0xb97b('0x11'),_0x652877,'request\x20sent');logger[_0xb97b('0x12')](_0xb97b('0x13'),_0x652877,_0xb97b('0x14'),JSON['stringify'](_0x5e4073));if(_0x5e4073[_0xb97b('0x15')]){if(_0x5e4073['error'][_0xb97b('0x16')]===0x1f4){logger['error'](_0xb97b('0x11'),_0x652877,_0x5e4073[_0xb97b('0x15')][_0xb97b('0x17')]);return _0x52b79e(_0x5e4073[_0xb97b('0x15')]['message']);}logger[_0xb97b('0x15')](_0xb97b('0x11'),_0x652877,_0x5e4073[_0xb97b('0x15')][_0xb97b('0x17')]);return _0x5b0ada(_0x5e4073['error'][_0xb97b('0x17')]);}else{logger['info'](_0xb97b('0x11'),_0x652877,_0xb97b('0x14'));_0x5b0ada(_0x5e4073[_0xb97b('0x18')][_0xb97b('0x17')]);}})[_0xb97b('0x19')](function(_0x5e82fb){logger[_0xb97b('0x15')](_0xb97b('0x11'),_0x652877,_0x5e82fb);_0x52b79e(_0x5e82fb);});});}exports[_0xb97b('0x1a')]=function(_0x5f57ef){var _0x2320d1=this;return new Promise(function(_0x1423ac,_0x1b10a5){return db[_0xb97b('0x1b')][_0xb97b('0x1c')]({'raw':_0x5f57ef[_0xb97b('0x1d')]?_0x5f57ef['options'][_0xb97b('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f57ef[_0xb97b('0x1d')]?_0x5f57ef[_0xb97b('0x1d')][_0xb97b('0x1f')]||null:null,'attributes':_0x5f57ef['options']?_0x5f57ef[_0xb97b('0x1d')][_0xb97b('0x20')]||null:null,'limit':_0x5f57ef['options']?_0x5f57ef[_0xb97b('0x1d')]['limit']||null:null,'include':_0x5f57ef['options']?_0x5f57ef['options']['include']?_[_0xb97b('0x21')](_0x5f57ef[_0xb97b('0x1d')][_0xb97b('0x22')],function(_0x216709){return{'model':db[_0x216709[_0xb97b('0x23')]],'as':_0x216709['as'],'attributes':_0x216709['attributes'],'include':_0x216709[_0xb97b('0x22')]?_['map'](_0x216709[_0xb97b('0x22')],function(_0xc2c09c){return{'model':db[_0xc2c09c[_0xb97b('0x23')]],'as':_0xc2c09c['as'],'attributes':_0xc2c09c[_0xb97b('0x20')],'include':_0xc2c09c['include']?_[_0xb97b('0x21')](_0xc2c09c['include'],function(_0x3e0edf){return{'model':db[_0x3e0edf[_0xb97b('0x23')]],'as':_0x3e0edf['as'],'attributes':_0x3e0edf[_0xb97b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb97b('0xf')](function(_0x50b7ef){logger[_0xb97b('0x10')](_0xb97b('0x1a'),_0x5f57ef);logger[_0xb97b('0x12')](_0xb97b('0x1a'),_0x5f57ef,JSON['stringify'](_0x50b7ef));_0x1423ac(_0x50b7ef);})[_0xb97b('0x19')](function(_0x29df6a){logger[_0xb97b('0x15')](_0xb97b('0x1a'),_0x29df6a[_0xb97b('0x17')],_0x5f57ef);_0x1b10a5(_0x2320d1[_0xb97b('0x15')](0x1f4,_0x29df6a[_0xb97b('0x17')]));});});};exports[_0xb97b('0x24')]=function(_0x1b7801){var _0x5a4ad9=this;return new Promise(function(_0x2d3259,_0x52515d){return db[_0xb97b('0x1b')][_0xb97b('0x25')]({'raw':_0x1b7801[_0xb97b('0x1d')]?_0x1b7801[_0xb97b('0x1d')][_0xb97b('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b7801[_0xb97b('0x1d')]?_0x1b7801[_0xb97b('0x1d')][_0xb97b('0x1f')]||null:null,'attributes':_0x1b7801[_0xb97b('0x1d')]?_0x1b7801[_0xb97b('0x1d')]['attributes']||null:null,'include':_0x1b7801['options']?_0x1b7801[_0xb97b('0x1d')][_0xb97b('0x22')]?_[_0xb97b('0x21')](_0x1b7801['options'][_0xb97b('0x22')],function(_0x3b1024){return{'model':db[_0x3b1024[_0xb97b('0x23')]],'as':_0x3b1024['as'],'attributes':_0x3b1024[_0xb97b('0x20')],'include':_0x3b1024[_0xb97b('0x22')]?_[_0xb97b('0x21')](_0x3b1024[_0xb97b('0x22')],function(_0xd145a1){return{'model':db[_0xd145a1[_0xb97b('0x23')]],'as':_0xd145a1['as'],'attributes':_0xd145a1[_0xb97b('0x20')],'include':_0xd145a1[_0xb97b('0x22')]?_[_0xb97b('0x21')](_0xd145a1['include'],function(_0x2deed7){return{'model':db[_0x2deed7[_0xb97b('0x23')]],'as':_0x2deed7['as'],'attributes':_0x2deed7[_0xb97b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb97b('0xf')](function(_0x53fe15){logger[_0xb97b('0x10')](_0xb97b('0x24'),_0x1b7801);logger[_0xb97b('0x12')](_0xb97b('0x24'),_0x1b7801,JSON[_0xb97b('0x26')](_0x53fe15));_0x2d3259(_0x53fe15);})['catch'](function(_0x1a6f3e){logger['error'](_0xb97b('0x24'),_0x1a6f3e[_0xb97b('0x17')],_0x1b7801);_0x52515d(_0x5a4ad9[_0xb97b('0x15')](0x1f4,_0x1a6f3e[_0xb97b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 5ceb9bb..52cee3f 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 _0x6523=['/:id/subjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0x47b37e,_0x5afb98){var _0x1c1eb9=function(_0x59c1a3){while(--_0x59c1a3){_0x47b37e['push'](_0x47b37e['shift']());}};_0x1c1eb9(++_0x5afb98);}(_0x6523,0x1a6));var _0x3652=function(_0x4d90a6,_0x2ecd04){_0x4d90a6=_0x4d90a6-0x0;var _0x49051f=_0x6523[_0x4d90a6];return _0x49051f;};'use strict';var multer=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var path=require('path');var timeout=require(_0x3652('0x2'));var express=require(_0x3652('0x3'));var router=express[_0x3652('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3652('0x5'));var config=require(_0x3652('0x6'));var controller=require(_0x3652('0x7'));router[_0x3652('0x8')]('/',auth['isAuthenticated'](),controller[_0x3652('0x9')]);router[_0x3652('0x8')](_0x3652('0xa'),auth[_0x3652('0xb')](),controller[_0x3652('0xc')]);router[_0x3652('0x8')](_0x3652('0xd'),auth[_0x3652('0xb')](),controller[_0x3652('0xe')]);router[_0x3652('0x8')](_0x3652('0xf'),auth[_0x3652('0xb')](),controller['getSubjects']);router[_0x3652('0x8')](_0x3652('0x10'),auth[_0x3652('0xb')](),controller[_0x3652('0x11')]);router[_0x3652('0x12')]('/',auth[_0x3652('0xb')](),controller['create']);router['put'](_0x3652('0xa'),auth['isAuthenticated'](),controller[_0x3652('0x13')]);router[_0x3652('0x14')](_0x3652('0xa'),auth[_0x3652('0xb')](),controller[_0x3652('0x15')]);module[_0x3652('0x16')]=router; \ No newline at end of file +var _0xaeab=['isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x5c3e12,_0xf69f80){var _0x311d22=function(_0x3799d8){while(--_0x3799d8){_0x5c3e12['push'](_0x5c3e12['shift']());}};_0x311d22(++_0xf69f80);}(_0xaeab,0x91));var _0xbaea=function(_0x394f16,_0x24e807){_0x394f16=_0x394f16-0x0;var _0x348dad=_0xaeab[_0x394f16];return _0x348dad;};'use strict';var multer=require(_0xbaea('0x0'));var util=require('util');var path=require(_0xbaea('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaea('0x2'));var router=express[_0xbaea('0x3')]();var auth=require(_0xbaea('0x4'));var interaction=require(_0xbaea('0x5'));var config=require(_0xbaea('0x6'));var controller=require(_0xbaea('0x7'));router[_0xbaea('0x8')]('/',auth[_0xbaea('0x9')](),controller[_0xbaea('0xa')]);router[_0xbaea('0x8')]('/:id',auth[_0xbaea('0x9')](),controller[_0xbaea('0xb')]);router[_0xbaea('0x8')](_0xbaea('0xc'),auth[_0xbaea('0x9')](),controller[_0xbaea('0xd')]);router[_0xbaea('0x8')](_0xbaea('0xe'),auth['isAuthenticated'](),controller[_0xbaea('0xf')]);router[_0xbaea('0x8')](_0xbaea('0x10'),auth[_0xbaea('0x9')](),controller[_0xbaea('0x11')]);router['post']('/',auth[_0xbaea('0x9')](),controller[_0xbaea('0x12')]);router['put'](_0xbaea('0x13'),auth[_0xbaea('0x9')](),controller[_0xbaea('0x14')]);router[_0xbaea('0x15')](_0xbaea('0x13'),auth[_0xbaea('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f29285e..68671be 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 _0x456d=['STRING','sequelize','exports'];(function(_0x1e208d,_0x40f3a9){var _0x46a947=function(_0x599721){while(--_0x599721){_0x1e208d['push'](_0x1e208d['shift']());}};_0x46a947(++_0x40f3a9);}(_0x456d,0x10f));var _0xd456=function(_0x591748,_0x332744){_0x591748=_0x591748-0x0;var _0x21e529=_0x456d[_0x591748];return _0x21e529;};'use strict';var Sequelize=require(_0xd456('0x0'));module[_0xd456('0x1')]={'name':{'type':Sequelize[_0xd456('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4d15=['STRING','sequelize','exports'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x4d15,0xe5));var _0x54d1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d15[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x54d1('0x0'));module[_0x54d1('0x1')]={'name':{'type':Sequelize[_0x54d1('0x2')]},'description':{'type':Sequelize[_0x54d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b25c59f..e2ca4ee 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 _0x2125=['path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','ZohoConfiguration','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','type','key','field','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','findOne','map','getSubjects','ZohoField','getDescriptions','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x2125,0xf7));var _0x5212=function(_0x2922b0,_0x1c588a){_0x2922b0=_0x2922b0-0x0;var _0x31ac3c=_0x2125[_0x2922b0];return _0x31ac3c;};'use strict';var pdf=require(_0x5212('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5212('0x1'));var zipdir=require(_0x5212('0x2'));var jsonpatch=require(_0x5212('0x3'));var rp=require(_0x5212('0x4'));var moment=require(_0x5212('0x5'));var BPromise=require(_0x5212('0x6'));var Mustache=require(_0x5212('0x7'));var util=require('util');var path=require(_0x5212('0x8'));var sox=require(_0x5212('0x9'));var csv=require('to-csv');var ejs=require(_0x5212('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5212('0xb'));var crypto=require('crypto');var jsforce=require(_0x5212('0xc'));var deskjs=require(_0x5212('0xd'));var toCsv=require(_0x5212('0xe'));var querystring=require(_0x5212('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5212('0x10'));var logger=require(_0x5212('0x11'))(_0x5212('0x12'));var utils=require(_0x5212('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x5212('0x14'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1abd96,_0x19d703,_0x34a112){if(_0x34a112){var _0x452c22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x452c22['test'](_0x19d703)){return _0x1abd96;}else{throw new Error(_0x5212('0x15'));}}else{return _0x1abd96;}}function respondWithRpcPromise(_0x1d17ce,_0x448559,_0x15d625,_0xf1683e){return new BPromise(function(_0x26feee,_0x4fedc5){var _0x3ebaac=_0xf1683e||client;return _0x3ebaac[_0x5212('0x16')](_0x1d17ce,_0x15d625)[_0x5212('0x17')](function(_0x143d3f){logger[_0x5212('0x18')]('ZohoConfiguration,\x20%s,\x20%s',_0x448559,_0x5212('0x19'));logger[_0x5212('0x1a')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x448559,_0x5212('0x19'),JSON['stringify'](_0x143d3f));if(_0x143d3f['error']){if(_0x143d3f[_0x5212('0x1b')][_0x5212('0x1c')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x448559,_0x143d3f[_0x5212('0x1b')][_0x5212('0x1d')]);return _0x4fedc5(_0x143d3f['error']['message']);}logger['error'](_0x5212('0x1e'),_0x448559,_0x143d3f[_0x5212('0x1b')][_0x5212('0x1d')]);return _0x26feee(_0x143d3f[_0x5212('0x1b')][_0x5212('0x1d')]);}else{logger[_0x5212('0x18')](_0x5212('0x1e'),_0x448559,_0x5212('0x19'));_0x26feee(_0x143d3f[_0x5212('0x1f')][_0x5212('0x1d')]);}})['catch'](function(_0x44347e){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x448559,_0x44347e);_0x4fedc5(_0x44347e);});});}function respondWithStatusCode(_0x35e5db,_0x3b7b17){_0x3b7b17=_0x3b7b17||0xcc;return function(_0x4bca87){if(_0x4bca87){return _0x35e5db[_0x5212('0x20')](_0x3b7b17);}return _0x35e5db[_0x5212('0x21')](_0x3b7b17)['end']();};}function respondWithResult(_0x1012b4,_0x127b79){_0x127b79=_0x127b79||0xc8;return function(_0x3c10a2){if(_0x3c10a2){return _0x1012b4[_0x5212('0x21')](_0x127b79)['json'](_0x3c10a2);}};}function respondWithFilteredResult(_0x22d05c,_0xaf6ec4){return function(_0x3ebd71){if(_0x3ebd71){var _0xa97e4d=_0x3ebd71[_0x5212('0x22')],_0x263840=_0xaf6ec4[_0x5212('0x23')],_0xf16483=_0xaf6ec4[_0x5212('0x23')]+_0xaf6ec4['limit'],_0x23c01a;if(_0xf16483>=_0xa97e4d){_0xf16483=_0xa97e4d;_0x23c01a=0xc8;}else{_0x23c01a=0xce;}_0x22d05c[_0x5212('0x21')](_0x23c01a);return _0x22d05c[_0x5212('0x24')](_0x5212('0x25'),_0x263840+'-'+_0xf16483+'/'+_0xa97e4d)[_0x5212('0x26')](_0x3ebd71);}return null;};}function patchUpdates(_0x5e6359){return function(_0x2a63a4){try{jsonpatch[_0x5212('0x27')](_0x2a63a4,_0x5e6359,!![]);}catch(_0x5f2c7e){return BPromise['reject'](_0x5f2c7e);}return _0x2a63a4[_0x5212('0x28')]();};}function saveUpdates(_0x14d9d5,_0x5cee05){return function(_0x4cdb2b){if(_0x4cdb2b){return _0x4cdb2b[_0x5212('0x29')](_0x14d9d5)[_0x5212('0x17')](function(_0x5633c7){return _0x5633c7;});}return null;};}function removeEntity(_0x33b174,_0x536aca){return function(_0x53877a){if(_0x53877a){return _0x53877a[_0x5212('0x2a')]()['then'](function(){_0x33b174['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b39c,_0x49d7ee){return function(_0x1b618a){if(!_0x1b618a){_0x42b39c[_0x5212('0x20')](0x194);}return _0x1b618a;};}function handleError(_0x49f285,_0xc1605f){_0xc1605f=_0xc1605f||0x1f4;return function(_0x16e809){logger['error'](_0x16e809[_0x5212('0x2b')]);if(_0x16e809[_0x5212('0x2c')]){delete _0x16e809['name'];}_0x49f285[_0x5212('0x21')](_0xc1605f)[_0x5212('0x2d')](_0x16e809);};}exports[_0x5212('0x2e')]=function(_0x45adba,_0x3a7aaa){var _0x36d3dc={},_0x27c231={},_0x5d1f78={'count':0x0,'rows':[]};var _0x219b9c=db[_0x5212('0x2f')][_0x5212('0x30')];_0x27c231['model']=_[_0x5212('0x31')](_0x219b9c);_0x27c231[_0x5212('0x32')]=_[_0x5212('0x31')](_0x45adba[_0x5212('0x32')]);_0x27c231['filters']=_[_0x5212('0x33')](_0x27c231['model'],_0x27c231[_0x5212('0x32')]);_0x36d3dc['attributes']=_[_0x5212('0x33')](_0x27c231[_0x5212('0x34')],qs[_0x5212('0x35')](_0x45adba[_0x5212('0x32')]['fields']));_0x36d3dc[_0x5212('0x36')]=_0x36d3dc[_0x5212('0x36')][_0x5212('0x37')]?_0x36d3dc['attributes']:_0x27c231[_0x5212('0x34')];if(!_0x45adba[_0x5212('0x32')][_0x5212('0x38')]('nolimit')){_0x36d3dc[_0x5212('0x39')]=qs['limit'](_0x45adba[_0x5212('0x32')][_0x5212('0x39')]);_0x36d3dc['offset']=qs[_0x5212('0x23')](_0x45adba[_0x5212('0x32')][_0x5212('0x23')]);}_0x36d3dc[_0x5212('0x3a')]=qs[_0x5212('0x3b')](_0x45adba[_0x5212('0x32')]['sort']);_0x36d3dc[_0x5212('0x3c')]=qs[_0x5212('0x3d')](_[_0x5212('0x3e')](_0x45adba[_0x5212('0x32')],_0x27c231[_0x5212('0x3d')]));if(_0x45adba[_0x5212('0x32')][_0x5212('0x3f')]){_0x36d3dc[_0x5212('0x3c')]=_['merge'](_0x36d3dc[_0x5212('0x3c')],{'$or':_['map'](_0x219b9c,function(_0x25adfe){if(_0x25adfe[_0x5212('0x40')][_0x5212('0x41')]!=='VIRTUAL'){var _0x5c9787={};_0x5c9787[_0x25adfe[_0x5212('0x42')]]={'$like':'%'+_0x45adba['query'][_0x5212('0x3f')]+'%'};return _0x5c9787;}})});}_0x36d3dc=_['merge']({},_0x36d3dc,_0x45adba[_0x5212('0x43')]);var _0xe03143={'where':_0x36d3dc[_0x5212('0x3c')]};return db[_0x5212('0x2f')][_0x5212('0x22')](_0xe03143)[_0x5212('0x17')](function(_0x2349c2){_0x5d1f78['count']=_0x2349c2;if(_0x45adba[_0x5212('0x32')][_0x5212('0x44')]){_0x36d3dc[_0x5212('0x45')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x5212('0x46')](_0x36d3dc);})[_0x5212('0x17')](function(_0x46e508){_0x5d1f78[_0x5212('0x47')]=_0x46e508;return _0x5d1f78;})[_0x5212('0x17')](respondWithFilteredResult(_0x3a7aaa,_0x36d3dc))['catch'](handleError(_0x3a7aaa,null));};exports[_0x5212('0x48')]=function(_0x57568a,_0x4e36a3){var _0x25d519={'raw':![],'where':{'id':_0x57568a[_0x5212('0x49')]['id']}},_0x1a8b31={};_0x1a8b31[_0x5212('0x34')]=_[_0x5212('0x31')](db[_0x5212('0x2f')][_0x5212('0x30')]);_0x1a8b31[_0x5212('0x32')]=_[_0x5212('0x31')](_0x57568a[_0x5212('0x32')]);_0x1a8b31[_0x5212('0x3d')]=_['intersection'](_0x1a8b31[_0x5212('0x34')],_0x1a8b31[_0x5212('0x32')]);_0x25d519['attributes']=_[_0x5212('0x33')](_0x1a8b31['model'],qs[_0x5212('0x35')](_0x57568a[_0x5212('0x32')]['fields']));_0x25d519[_0x5212('0x36')]=_0x25d519[_0x5212('0x36')][_0x5212('0x37')]?_0x25d519['attributes']:_0x1a8b31[_0x5212('0x34')];if(_0x57568a[_0x5212('0x32')][_0x5212('0x44')]){_0x25d519[_0x5212('0x45')]=[{'all':!![]}];}_0x25d519=_[_0x5212('0x4a')]({},_0x25d519,_0x57568a[_0x5212('0x43')]);return db['ZohoConfiguration'][_0x5212('0x4b')](_0x25d519)[_0x5212('0x17')](handleEntityNotFound(_0x4e36a3,null))['then'](respondWithResult(_0x4e36a3,null))[_0x5212('0x4c')](handleError(_0x4e36a3,null));};exports[_0x5212('0x4d')]=function(_0x45fade,_0x231f2c){return db[_0x5212('0x2f')]['create'](_0x45fade['body'],{})[_0x5212('0x17')](respondWithResult(_0x231f2c,0xc9))['catch'](handleError(_0x231f2c,null));};exports[_0x5212('0x29')]=function(_0x2d2829,_0x4439c7){if(_0x2d2829[_0x5212('0x4e')]['id']){delete _0x2d2829['body']['id'];}return db[_0x5212('0x2f')]['find']({'where':{'id':_0x2d2829['params']['id']}})[_0x5212('0x17')](handleEntityNotFound(_0x4439c7,null))[_0x5212('0x17')](saveUpdates(_0x2d2829[_0x5212('0x4e')],null))[_0x5212('0x17')](respondWithResult(_0x4439c7,null))[_0x5212('0x4c')](handleError(_0x4439c7,null));};exports[_0x5212('0x2a')]=function(_0x49a966,_0x385051){return db['ZohoConfiguration']['find']({'where':{'id':_0x49a966[_0x5212('0x49')]['id']}})[_0x5212('0x17')](handleEntityNotFound(_0x385051,null))[_0x5212('0x17')](removeEntity(_0x385051,null))['catch'](handleError(_0x385051,null));};exports['getFields']=function(_0x3b3526,_0x393816,_0xd0726){var _0x58d45b={};var _0x4d1462={};var _0x1066d4;var _0x40147d;return db[_0x5212('0x2f')][_0x5212('0x4f')]({'where':{'id':_0x3b3526[_0x5212('0x49')]['id']}})[_0x5212('0x17')](handleEntityNotFound(_0x393816,null))['then'](function(_0x11baa8){if(_0x11baa8){_0x1066d4=_0x11baa8;_0x4d1462[_0x5212('0x34')]=_[_0x5212('0x31')](db['ZohoField'][_0x5212('0x30')]);_0x4d1462[_0x5212('0x32')]=_[_0x5212('0x31')](_0x3b3526[_0x5212('0x32')]);_0x4d1462[_0x5212('0x3d')]=_[_0x5212('0x33')](_0x4d1462[_0x5212('0x34')],_0x4d1462[_0x5212('0x32')]);_0x58d45b[_0x5212('0x36')]=_[_0x5212('0x33')](_0x4d1462[_0x5212('0x34')],qs[_0x5212('0x35')](_0x3b3526[_0x5212('0x32')][_0x5212('0x35')]));_0x58d45b['attributes']=_0x58d45b[_0x5212('0x36')][_0x5212('0x37')]?_0x58d45b['attributes']:_0x4d1462[_0x5212('0x34')];_0x58d45b['order']=qs[_0x5212('0x3b')](_0x3b3526[_0x5212('0x32')][_0x5212('0x3b')]);_0x58d45b[_0x5212('0x3c')]=qs[_0x5212('0x3d')](_[_0x5212('0x3e')](_0x3b3526['query'],_0x4d1462[_0x5212('0x3d')]));if(_0x3b3526['query'][_0x5212('0x3f')]){_0x58d45b[_0x5212('0x3c')]=_[_0x5212('0x4a')](_0x58d45b[_0x5212('0x3c')],{'$or':_[_0x5212('0x50')](_0x58d45b['attributes'],function(_0x2a6d05){var _0x1ea137={};_0x1ea137[_0x2a6d05]={'$like':'%'+_0x3b3526[_0x5212('0x32')][_0x5212('0x3f')]+'%'};return _0x1ea137;})});}_0x58d45b=_[_0x5212('0x4a')]({},_0x58d45b,_0x3b3526[_0x5212('0x43')]);return _0x1066d4['getFields'](_0x58d45b);}})['then'](function(_0x54e814){if(_0x54e814){_0x40147d=_0x54e814[_0x5212('0x37')];if(!_0x3b3526['query'][_0x5212('0x38')]('nolimit')){_0x58d45b['limit']=qs[_0x5212('0x39')](_0x3b3526[_0x5212('0x32')]['limit']);_0x58d45b['offset']=qs['offset'](_0x3b3526[_0x5212('0x32')][_0x5212('0x23')]);}return _0x1066d4['getFields'](_0x58d45b);}})[_0x5212('0x17')](function(_0x454bb3){if(_0x454bb3){return _0x454bb3?{'count':_0x40147d,'rows':_0x454bb3}:null;}})[_0x5212('0x17')](respondWithResult(_0x393816,null))[_0x5212('0x4c')](handleError(_0x393816,null));};exports[_0x5212('0x51')]=function(_0x58c105,_0x39ef29,_0x1a727a){var _0x57e21f={};var _0x4e3e01={};var _0x25e1d5;var _0x13ed48;return db['ZohoConfiguration'][_0x5212('0x4f')]({'where':{'id':_0x58c105[_0x5212('0x49')]['id']}})['then'](handleEntityNotFound(_0x39ef29,null))[_0x5212('0x17')](function(_0x396ecb){if(_0x396ecb){_0x25e1d5=_0x396ecb;_0x4e3e01[_0x5212('0x34')]=_[_0x5212('0x31')](db[_0x5212('0x52')][_0x5212('0x30')]);_0x4e3e01[_0x5212('0x32')]=_[_0x5212('0x31')](_0x58c105[_0x5212('0x32')]);_0x4e3e01[_0x5212('0x3d')]=_['intersection'](_0x4e3e01[_0x5212('0x34')],_0x4e3e01[_0x5212('0x32')]);_0x57e21f['attributes']=_[_0x5212('0x33')](_0x4e3e01['model'],qs[_0x5212('0x35')](_0x58c105['query']['fields']));_0x57e21f[_0x5212('0x36')]=_0x57e21f[_0x5212('0x36')][_0x5212('0x37')]?_0x57e21f[_0x5212('0x36')]:_0x4e3e01[_0x5212('0x34')];_0x57e21f[_0x5212('0x3a')]=qs[_0x5212('0x3b')](_0x58c105[_0x5212('0x32')]['sort']);_0x57e21f[_0x5212('0x3c')]=qs[_0x5212('0x3d')](_[_0x5212('0x3e')](_0x58c105[_0x5212('0x32')],_0x4e3e01[_0x5212('0x3d')]));if(_0x58c105[_0x5212('0x32')][_0x5212('0x3f')]){_0x57e21f[_0x5212('0x3c')]=_['merge'](_0x57e21f['where'],{'$or':_[_0x5212('0x50')](_0x57e21f[_0x5212('0x36')],function(_0xa3886){var _0x26d031={};_0x26d031[_0xa3886]={'$like':'%'+_0x58c105[_0x5212('0x32')]['filter']+'%'};return _0x26d031;})});}_0x57e21f=_[_0x5212('0x4a')]({},_0x57e21f,_0x58c105[_0x5212('0x43')]);return _0x25e1d5[_0x5212('0x51')](_0x57e21f);}})[_0x5212('0x17')](function(_0x436052){if(_0x436052){_0x13ed48=_0x436052['length'];if(!_0x58c105[_0x5212('0x32')][_0x5212('0x38')]('nolimit')){_0x57e21f['limit']=qs[_0x5212('0x39')](_0x58c105[_0x5212('0x32')][_0x5212('0x39')]);_0x57e21f[_0x5212('0x23')]=qs['offset'](_0x58c105[_0x5212('0x32')][_0x5212('0x23')]);}return _0x25e1d5[_0x5212('0x51')](_0x57e21f);}})[_0x5212('0x17')](function(_0x489361){if(_0x489361){return _0x489361?{'count':_0x13ed48,'rows':_0x489361}:null;}})[_0x5212('0x17')](respondWithResult(_0x39ef29,null))[_0x5212('0x4c')](handleError(_0x39ef29,null));};exports[_0x5212('0x53')]=function(_0x441363,_0x54a8e4,_0x3fe391){var _0x159cf8={};var _0x1d01fd={};var _0x5ec418;var _0x4638c2;return db[_0x5212('0x2f')][_0x5212('0x4f')]({'where':{'id':_0x441363[_0x5212('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a8e4,null))[_0x5212('0x17')](function(_0x1ef5c4){if(_0x1ef5c4){_0x5ec418=_0x1ef5c4;_0x1d01fd[_0x5212('0x34')]=_['keys'](db['ZohoField'][_0x5212('0x30')]);_0x1d01fd[_0x5212('0x32')]=_[_0x5212('0x31')](_0x441363[_0x5212('0x32')]);_0x1d01fd[_0x5212('0x3d')]=_[_0x5212('0x33')](_0x1d01fd[_0x5212('0x34')],_0x1d01fd[_0x5212('0x32')]);_0x159cf8[_0x5212('0x36')]=_[_0x5212('0x33')](_0x1d01fd['model'],qs['fields'](_0x441363['query'][_0x5212('0x35')]));_0x159cf8[_0x5212('0x36')]=_0x159cf8[_0x5212('0x36')][_0x5212('0x37')]?_0x159cf8[_0x5212('0x36')]:_0x1d01fd[_0x5212('0x34')];_0x159cf8[_0x5212('0x3a')]=qs['sort'](_0x441363['query']['sort']);_0x159cf8[_0x5212('0x3c')]=qs['filters'](_[_0x5212('0x3e')](_0x441363[_0x5212('0x32')],_0x1d01fd[_0x5212('0x3d')]));if(_0x441363[_0x5212('0x32')][_0x5212('0x3f')]){_0x159cf8['where']=_[_0x5212('0x4a')](_0x159cf8[_0x5212('0x3c')],{'$or':_[_0x5212('0x50')](_0x159cf8[_0x5212('0x36')],function(_0x3629d1){var _0x4d2ed7={};_0x4d2ed7[_0x3629d1]={'$like':'%'+_0x441363[_0x5212('0x32')][_0x5212('0x3f')]+'%'};return _0x4d2ed7;})});}_0x159cf8=_['merge']({},_0x159cf8,_0x441363[_0x5212('0x43')]);return _0x5ec418[_0x5212('0x53')](_0x159cf8);}})[_0x5212('0x17')](function(_0xb2c160){if(_0xb2c160){_0x4638c2=_0xb2c160['length'];if(!_0x441363[_0x5212('0x32')][_0x5212('0x38')](_0x5212('0x54'))){_0x159cf8[_0x5212('0x39')]=qs['limit'](_0x441363['query']['limit']);_0x159cf8[_0x5212('0x23')]=qs[_0x5212('0x23')](_0x441363['query'][_0x5212('0x23')]);}return _0x5ec418[_0x5212('0x53')](_0x159cf8);}})[_0x5212('0x17')](function(_0x1238d9){if(_0x1238d9){return _0x1238d9?{'count':_0x4638c2,'rows':_0x1238d9}:null;}})['then'](respondWithResult(_0x54a8e4,null))[_0x5212('0x4c')](handleError(_0x54a8e4,null));}; \ No newline at end of file +var _0x83fb=['getFields','findOne','order','getSubjects','nolimit','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','count','offset','limit','json','apply','save','update','destroy','stack','name','send','ZohoConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','key','VIRTUAL','field','filter','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','create','body'];(function(_0x48f6f1,_0x466ffb){var _0x406c15=function(_0x20d562){while(--_0x20d562){_0x48f6f1['push'](_0x48f6f1['shift']());}};_0x406c15(++_0x466ffb);}(_0x83fb,0x16a));var _0xb83f=function(_0x7e175c,_0x43ac75){_0x7e175c=_0x7e175c-0x0;var _0x1e1210=_0x83fb[_0x7e175c];return _0x1e1210;};'use strict';var pdf=require(_0xb83f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb83f('0x1'));var zipdir=require(_0xb83f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb83f('0x3'));var moment=require(_0xb83f('0x4'));var BPromise=require(_0xb83f('0x5'));var Mustache=require(_0xb83f('0x6'));var util=require(_0xb83f('0x7'));var path=require(_0xb83f('0x8'));var sox=require(_0xb83f('0x9'));var csv=require(_0xb83f('0xa'));var ejs=require(_0xb83f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb83f('0xc'));var crypto=require(_0xb83f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb83f('0xe'));var Papa=require(_0xb83f('0xf'));var Redis=require(_0xb83f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb83f('0x11'));var hardwareService=require(_0xb83f('0x12'));var logger=require(_0xb83f('0x13'))(_0xb83f('0x14'));var utils=require(_0xb83f('0x15'));var config=require(_0xb83f('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb83f('0x17'));var client=jayson[_0xb83f('0x18')][_0xb83f('0x19')]({'port':0x232a});function checkPasswordPattern(_0x105ba1,_0x3ea120,_0x527968){if(_0x527968){var _0x233785=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x233785[_0xb83f('0x1a')](_0x3ea120)){return _0x105ba1;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x105ba1;}}function respondWithRpcPromise(_0xf472fa,_0x449ad9,_0x1f004e,_0x4885a9){return new BPromise(function(_0x20bb51,_0x47b6a8){var _0x222b49=_0x4885a9||client;return _0x222b49[_0xb83f('0x1b')](_0xf472fa,_0x1f004e)[_0xb83f('0x1c')](function(_0x5881d5){logger['info'](_0xb83f('0x1d'),_0x449ad9,_0xb83f('0x1e'));logger[_0xb83f('0x1f')](_0xb83f('0x20'),_0x449ad9,'request\x20sent',JSON[_0xb83f('0x21')](_0x5881d5));if(_0x5881d5[_0xb83f('0x22')]){if(_0x5881d5[_0xb83f('0x22')]['code']===0x1f4){logger[_0xb83f('0x22')](_0xb83f('0x1d'),_0x449ad9,_0x5881d5['error'][_0xb83f('0x23')]);return _0x47b6a8(_0x5881d5[_0xb83f('0x22')][_0xb83f('0x23')]);}logger[_0xb83f('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x449ad9,_0x5881d5[_0xb83f('0x22')][_0xb83f('0x23')]);return _0x20bb51(_0x5881d5[_0xb83f('0x22')][_0xb83f('0x23')]);}else{logger[_0xb83f('0x24')](_0xb83f('0x1d'),_0x449ad9,'request\x20sent');_0x20bb51(_0x5881d5[_0xb83f('0x25')][_0xb83f('0x23')]);}})[_0xb83f('0x26')](function(_0x4aae6c){logger[_0xb83f('0x22')](_0xb83f('0x1d'),_0x449ad9,_0x4aae6c);_0x47b6a8(_0x4aae6c);});});}function respondWithStatusCode(_0x23d4a6,_0x4ac8d0){_0x4ac8d0=_0x4ac8d0||0xcc;return function(_0x2f8247){if(_0x2f8247){return _0x23d4a6[_0xb83f('0x27')](_0x4ac8d0);}return _0x23d4a6[_0xb83f('0x28')](_0x4ac8d0)[_0xb83f('0x29')]();};}function respondWithResult(_0x2d33be,_0x1c614d){_0x1c614d=_0x1c614d||0xc8;return function(_0x3b8cc3){if(_0x3b8cc3){return _0x2d33be[_0xb83f('0x28')](_0x1c614d)['json'](_0x3b8cc3);}};}function respondWithFilteredResult(_0x23b154,_0x469cb3){return function(_0x4c2491){if(_0x4c2491){var _0xd91b73=_0x4c2491[_0xb83f('0x2a')],_0x44817d=_0x469cb3[_0xb83f('0x2b')],_0x42fa0d=_0x469cb3[_0xb83f('0x2b')]+_0x469cb3[_0xb83f('0x2c')],_0x2a8f02;if(_0x42fa0d>=_0xd91b73){_0x42fa0d=_0xd91b73;_0x2a8f02=0xc8;}else{_0x2a8f02=0xce;}_0x23b154[_0xb83f('0x28')](_0x2a8f02);return _0x23b154['set']('Content-Range',_0x44817d+'-'+_0x42fa0d+'/'+_0xd91b73)[_0xb83f('0x2d')](_0x4c2491);}return null;};}function patchUpdates(_0x3ddebc){return function(_0x1f0991){try{jsonpatch[_0xb83f('0x2e')](_0x1f0991,_0x3ddebc,!![]);}catch(_0x2871b5){return BPromise['reject'](_0x2871b5);}return _0x1f0991[_0xb83f('0x2f')]();};}function saveUpdates(_0x10d96f,_0x278372){return function(_0x1518c0){if(_0x1518c0){return _0x1518c0[_0xb83f('0x30')](_0x10d96f)[_0xb83f('0x1c')](function(_0x2215b6){return _0x2215b6;});}return null;};}function removeEntity(_0x503eec,_0x2b7588){return function(_0x226635){if(_0x226635){return _0x226635[_0xb83f('0x31')]()[_0xb83f('0x1c')](function(){_0x503eec[_0xb83f('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee4f6,_0x370c14){return function(_0x1bf881){if(!_0x1bf881){_0x1ee4f6[_0xb83f('0x27')](0x194);}return _0x1bf881;};}function handleError(_0x5011ef,_0x10bc8f){_0x10bc8f=_0x10bc8f||0x1f4;return function(_0x547761){logger[_0xb83f('0x22')](_0x547761[_0xb83f('0x32')]);if(_0x547761[_0xb83f('0x33')]){delete _0x547761[_0xb83f('0x33')];}_0x5011ef[_0xb83f('0x28')](_0x10bc8f)[_0xb83f('0x34')](_0x547761);};}exports['index']=function(_0x5d1027,_0x2bc56f){var _0x8d66e1={},_0x3526ab={},_0x4365c5={'count':0x0,'rows':[]};var _0x57c834=db[_0xb83f('0x35')]['rawAttributes'];_0x3526ab[_0xb83f('0x36')]=_[_0xb83f('0x37')](_0x57c834);_0x3526ab[_0xb83f('0x38')]=_['keys'](_0x5d1027['query']);_0x3526ab[_0xb83f('0x39')]=_[_0xb83f('0x3a')](_0x3526ab[_0xb83f('0x36')],_0x3526ab['query']);_0x8d66e1[_0xb83f('0x3b')]=_['intersection'](_0x3526ab[_0xb83f('0x36')],qs['fields'](_0x5d1027[_0xb83f('0x38')][_0xb83f('0x3c')]));_0x8d66e1[_0xb83f('0x3b')]=_0x8d66e1[_0xb83f('0x3b')][_0xb83f('0x3d')]?_0x8d66e1[_0xb83f('0x3b')]:_0x3526ab[_0xb83f('0x36')];if(!_0x5d1027[_0xb83f('0x38')][_0xb83f('0x3e')]('nolimit')){_0x8d66e1[_0xb83f('0x2c')]=qs[_0xb83f('0x2c')](_0x5d1027[_0xb83f('0x38')][_0xb83f('0x2c')]);_0x8d66e1[_0xb83f('0x2b')]=qs[_0xb83f('0x2b')](_0x5d1027[_0xb83f('0x38')][_0xb83f('0x2b')]);}_0x8d66e1['order']=qs[_0xb83f('0x3f')](_0x5d1027['query']['sort']);_0x8d66e1[_0xb83f('0x40')]=qs['filters'](_[_0xb83f('0x41')](_0x5d1027[_0xb83f('0x38')],_0x3526ab[_0xb83f('0x39')]));if(_0x5d1027[_0xb83f('0x38')]['filter']){_0x8d66e1['where']=_[_0xb83f('0x42')](_0x8d66e1[_0xb83f('0x40')],{'$or':_[_0xb83f('0x43')](_0x57c834,function(_0x1349ff){if(_0x1349ff['type'][_0xb83f('0x44')]!==_0xb83f('0x45')){var _0x1639d3={};_0x1639d3[_0x1349ff[_0xb83f('0x46')]]={'$like':'%'+_0x5d1027[_0xb83f('0x38')][_0xb83f('0x47')]+'%'};return _0x1639d3;}})});}_0x8d66e1=_[_0xb83f('0x42')]({},_0x8d66e1,_0x5d1027['options']);var _0xf450e6={'where':_0x8d66e1['where']};return db[_0xb83f('0x35')]['count'](_0xf450e6)[_0xb83f('0x1c')](function(_0x587889){_0x4365c5[_0xb83f('0x2a')]=_0x587889;if(_0x5d1027[_0xb83f('0x38')][_0xb83f('0x48')]){_0x8d66e1['include']=[{'all':!![]}];}return db[_0xb83f('0x35')][_0xb83f('0x49')](_0x8d66e1);})[_0xb83f('0x1c')](function(_0x18099b){_0x4365c5[_0xb83f('0x4a')]=_0x18099b;return _0x4365c5;})[_0xb83f('0x1c')](respondWithFilteredResult(_0x2bc56f,_0x8d66e1))[_0xb83f('0x26')](handleError(_0x2bc56f,null));};exports[_0xb83f('0x4b')]=function(_0x4fd883,_0x56ff6e){var _0xfd23d4={'raw':![],'where':{'id':_0x4fd883[_0xb83f('0x4c')]['id']}},_0x199cd3={};_0x199cd3[_0xb83f('0x36')]=_[_0xb83f('0x37')](db[_0xb83f('0x35')][_0xb83f('0x4d')]);_0x199cd3['query']=_[_0xb83f('0x37')](_0x4fd883[_0xb83f('0x38')]);_0x199cd3[_0xb83f('0x39')]=_[_0xb83f('0x3a')](_0x199cd3[_0xb83f('0x36')],_0x199cd3[_0xb83f('0x38')]);_0xfd23d4[_0xb83f('0x3b')]=_['intersection'](_0x199cd3[_0xb83f('0x36')],qs[_0xb83f('0x3c')](_0x4fd883['query'][_0xb83f('0x3c')]));_0xfd23d4[_0xb83f('0x3b')]=_0xfd23d4['attributes'][_0xb83f('0x3d')]?_0xfd23d4[_0xb83f('0x3b')]:_0x199cd3['model'];if(_0x4fd883[_0xb83f('0x38')]['includeAll']){_0xfd23d4[_0xb83f('0x4e')]=[{'all':!![]}];}_0xfd23d4=_[_0xb83f('0x42')]({},_0xfd23d4,_0x4fd883[_0xb83f('0x4f')]);return db[_0xb83f('0x35')][_0xb83f('0x50')](_0xfd23d4)[_0xb83f('0x1c')](handleEntityNotFound(_0x56ff6e,null))[_0xb83f('0x1c')](respondWithResult(_0x56ff6e,null))['catch'](handleError(_0x56ff6e,null));};exports[_0xb83f('0x51')]=function(_0x7e5934,_0x1125c0){return db[_0xb83f('0x35')]['create'](_0x7e5934[_0xb83f('0x52')],{})[_0xb83f('0x1c')](respondWithResult(_0x1125c0,0xc9))['catch'](handleError(_0x1125c0,null));};exports[_0xb83f('0x30')]=function(_0x3db9a5,_0x18ed8f){if(_0x3db9a5[_0xb83f('0x52')]['id']){delete _0x3db9a5[_0xb83f('0x52')]['id'];}return db[_0xb83f('0x35')][_0xb83f('0x50')]({'where':{'id':_0x3db9a5[_0xb83f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18ed8f,null))[_0xb83f('0x1c')](saveUpdates(_0x3db9a5['body'],null))[_0xb83f('0x1c')](respondWithResult(_0x18ed8f,null))[_0xb83f('0x26')](handleError(_0x18ed8f,null));};exports[_0xb83f('0x31')]=function(_0x40779a,_0x1d2bac){return db['ZohoConfiguration']['find']({'where':{'id':_0x40779a['params']['id']}})[_0xb83f('0x1c')](handleEntityNotFound(_0x1d2bac,null))['then'](removeEntity(_0x1d2bac,null))['catch'](handleError(_0x1d2bac,null));};exports[_0xb83f('0x53')]=function(_0x330710,_0x510c2f,_0x4258ef){var _0x4854dd={};var _0x37868d={};var _0x37655f;var _0x38dd61;return db[_0xb83f('0x35')][_0xb83f('0x54')]({'where':{'id':_0x330710[_0xb83f('0x4c')]['id']}})[_0xb83f('0x1c')](handleEntityNotFound(_0x510c2f,null))[_0xb83f('0x1c')](function(_0xbceebd){if(_0xbceebd){_0x37655f=_0xbceebd;_0x37868d[_0xb83f('0x36')]=_[_0xb83f('0x37')](db['ZohoField'][_0xb83f('0x4d')]);_0x37868d[_0xb83f('0x38')]=_[_0xb83f('0x37')](_0x330710[_0xb83f('0x38')]);_0x37868d[_0xb83f('0x39')]=_['intersection'](_0x37868d[_0xb83f('0x36')],_0x37868d['query']);_0x4854dd[_0xb83f('0x3b')]=_[_0xb83f('0x3a')](_0x37868d[_0xb83f('0x36')],qs[_0xb83f('0x3c')](_0x330710[_0xb83f('0x38')][_0xb83f('0x3c')]));_0x4854dd['attributes']=_0x4854dd[_0xb83f('0x3b')][_0xb83f('0x3d')]?_0x4854dd[_0xb83f('0x3b')]:_0x37868d[_0xb83f('0x36')];_0x4854dd[_0xb83f('0x55')]=qs[_0xb83f('0x3f')](_0x330710[_0xb83f('0x38')][_0xb83f('0x3f')]);_0x4854dd[_0xb83f('0x40')]=qs[_0xb83f('0x39')](_[_0xb83f('0x41')](_0x330710['query'],_0x37868d[_0xb83f('0x39')]));if(_0x330710[_0xb83f('0x38')][_0xb83f('0x47')]){_0x4854dd[_0xb83f('0x40')]=_[_0xb83f('0x42')](_0x4854dd[_0xb83f('0x40')],{'$or':_[_0xb83f('0x43')](_0x4854dd[_0xb83f('0x3b')],function(_0x18f744){var _0x364ba9={};_0x364ba9[_0x18f744]={'$like':'%'+_0x330710['query']['filter']+'%'};return _0x364ba9;})});}_0x4854dd=_[_0xb83f('0x42')]({},_0x4854dd,_0x330710[_0xb83f('0x4f')]);return _0x37655f[_0xb83f('0x53')](_0x4854dd);}})[_0xb83f('0x1c')](function(_0x542014){if(_0x542014){_0x38dd61=_0x542014[_0xb83f('0x3d')];if(!_0x330710[_0xb83f('0x38')]['hasOwnProperty']('nolimit')){_0x4854dd['limit']=qs[_0xb83f('0x2c')](_0x330710[_0xb83f('0x38')][_0xb83f('0x2c')]);_0x4854dd['offset']=qs[_0xb83f('0x2b')](_0x330710[_0xb83f('0x38')][_0xb83f('0x2b')]);}return _0x37655f[_0xb83f('0x53')](_0x4854dd);}})[_0xb83f('0x1c')](function(_0xf1d1e9){if(_0xf1d1e9){return _0xf1d1e9?{'count':_0x38dd61,'rows':_0xf1d1e9}:null;}})['then'](respondWithResult(_0x510c2f,null))['catch'](handleError(_0x510c2f,null));};exports[_0xb83f('0x56')]=function(_0x3fc48d,_0x24d4bc,_0x583dd7){var _0xec8e45={};var _0x252509={};var _0x3400aa;var _0x4c3007;return db[_0xb83f('0x35')][_0xb83f('0x54')]({'where':{'id':_0x3fc48d[_0xb83f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24d4bc,null))['then'](function(_0x308bdc){if(_0x308bdc){_0x3400aa=_0x308bdc;_0x252509[_0xb83f('0x36')]=_['keys'](db['ZohoField']['rawAttributes']);_0x252509['query']=_[_0xb83f('0x37')](_0x3fc48d[_0xb83f('0x38')]);_0x252509['filters']=_[_0xb83f('0x3a')](_0x252509[_0xb83f('0x36')],_0x252509[_0xb83f('0x38')]);_0xec8e45[_0xb83f('0x3b')]=_['intersection'](_0x252509[_0xb83f('0x36')],qs[_0xb83f('0x3c')](_0x3fc48d[_0xb83f('0x38')][_0xb83f('0x3c')]));_0xec8e45[_0xb83f('0x3b')]=_0xec8e45[_0xb83f('0x3b')][_0xb83f('0x3d')]?_0xec8e45[_0xb83f('0x3b')]:_0x252509['model'];_0xec8e45[_0xb83f('0x55')]=qs['sort'](_0x3fc48d['query'][_0xb83f('0x3f')]);_0xec8e45['where']=qs[_0xb83f('0x39')](_['pick'](_0x3fc48d[_0xb83f('0x38')],_0x252509['filters']));if(_0x3fc48d[_0xb83f('0x38')]['filter']){_0xec8e45[_0xb83f('0x40')]=_['merge'](_0xec8e45[_0xb83f('0x40')],{'$or':_[_0xb83f('0x43')](_0xec8e45[_0xb83f('0x3b')],function(_0xb33beb){var _0xed7879={};_0xed7879[_0xb33beb]={'$like':'%'+_0x3fc48d[_0xb83f('0x38')][_0xb83f('0x47')]+'%'};return _0xed7879;})});}_0xec8e45=_['merge']({},_0xec8e45,_0x3fc48d[_0xb83f('0x4f')]);return _0x3400aa['getSubjects'](_0xec8e45);}})[_0xb83f('0x1c')](function(_0x301553){if(_0x301553){_0x4c3007=_0x301553[_0xb83f('0x3d')];if(!_0x3fc48d[_0xb83f('0x38')][_0xb83f('0x3e')](_0xb83f('0x57'))){_0xec8e45[_0xb83f('0x2c')]=qs[_0xb83f('0x2c')](_0x3fc48d[_0xb83f('0x38')][_0xb83f('0x2c')]);_0xec8e45[_0xb83f('0x2b')]=qs['offset'](_0x3fc48d[_0xb83f('0x38')][_0xb83f('0x2b')]);}return _0x3400aa[_0xb83f('0x56')](_0xec8e45);}})[_0xb83f('0x1c')](function(_0x148d93){if(_0x148d93){return _0x148d93?{'count':_0x4c3007,'rows':_0x148d93}:null;}})[_0xb83f('0x1c')](respondWithResult(_0x24d4bc,null))['catch'](handleError(_0x24d4bc,null));};exports[_0xb83f('0x58')]=function(_0x16a2f8,_0x5e6fa3,_0x59011d){var _0x13a3b6={};var _0x1eb7af={};var _0x5ec8e6;var _0x243a08;return db[_0xb83f('0x35')][_0xb83f('0x54')]({'where':{'id':_0x16a2f8[_0xb83f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e6fa3,null))['then'](function(_0x413afb){if(_0x413afb){_0x5ec8e6=_0x413afb;_0x1eb7af[_0xb83f('0x36')]=_[_0xb83f('0x37')](db['ZohoField'][_0xb83f('0x4d')]);_0x1eb7af[_0xb83f('0x38')]=_[_0xb83f('0x37')](_0x16a2f8['query']);_0x1eb7af[_0xb83f('0x39')]=_[_0xb83f('0x3a')](_0x1eb7af[_0xb83f('0x36')],_0x1eb7af[_0xb83f('0x38')]);_0x13a3b6[_0xb83f('0x3b')]=_['intersection'](_0x1eb7af[_0xb83f('0x36')],qs[_0xb83f('0x3c')](_0x16a2f8[_0xb83f('0x38')][_0xb83f('0x3c')]));_0x13a3b6['attributes']=_0x13a3b6[_0xb83f('0x3b')]['length']?_0x13a3b6[_0xb83f('0x3b')]:_0x1eb7af[_0xb83f('0x36')];_0x13a3b6[_0xb83f('0x55')]=qs[_0xb83f('0x3f')](_0x16a2f8[_0xb83f('0x38')]['sort']);_0x13a3b6['where']=qs[_0xb83f('0x39')](_[_0xb83f('0x41')](_0x16a2f8[_0xb83f('0x38')],_0x1eb7af[_0xb83f('0x39')]));if(_0x16a2f8['query'][_0xb83f('0x47')]){_0x13a3b6[_0xb83f('0x40')]=_[_0xb83f('0x42')](_0x13a3b6[_0xb83f('0x40')],{'$or':_[_0xb83f('0x43')](_0x13a3b6['attributes'],function(_0x1cb193){var _0x2c0f46={};_0x2c0f46[_0x1cb193]={'$like':'%'+_0x16a2f8[_0xb83f('0x38')][_0xb83f('0x47')]+'%'};return _0x2c0f46;})});}_0x13a3b6=_[_0xb83f('0x42')]({},_0x13a3b6,_0x16a2f8[_0xb83f('0x4f')]);return _0x5ec8e6[_0xb83f('0x58')](_0x13a3b6);}})['then'](function(_0x364509){if(_0x364509){_0x243a08=_0x364509[_0xb83f('0x3d')];if(!_0x16a2f8[_0xb83f('0x38')][_0xb83f('0x3e')](_0xb83f('0x57'))){_0x13a3b6['limit']=qs[_0xb83f('0x2c')](_0x16a2f8[_0xb83f('0x38')][_0xb83f('0x2c')]);_0x13a3b6[_0xb83f('0x2b')]=qs[_0xb83f('0x2b')](_0x16a2f8[_0xb83f('0x38')][_0xb83f('0x2b')]);}return _0x5ec8e6[_0xb83f('0x58')](_0x13a3b6);}})[_0xb83f('0x1c')](function(_0x22c1cf){if(_0x22c1cf){return _0x22c1cf?{'count':_0x243a08,'rows':_0x22c1cf}:null;}})[_0xb83f('0x1c')](respondWithResult(_0x5e6fa3,null))['catch'](handleError(_0x5e6fa3,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 4b109f9..ee9bd44 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 _0x4ded=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x395d1e,_0x423956){var _0x14f4f6=function(_0x375fb8){while(--_0x375fb8){_0x395d1e['push'](_0x395d1e['shift']());}};_0x14f4f6(++_0x423956);}(_0x4ded,0x116));var _0xd4de=function(_0x487fc7,_0x2be894){_0x487fc7=_0x487fc7-0x0;var _0x3eecf3=_0x4ded[_0x487fc7];return _0x3eecf3;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var moment=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var rp=require(_0xd4de('0x6'));var fs=require('fs');var path=require(_0xd4de('0x7'));var rimraf=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var attributes=require(_0xd4de('0xa'));module[_0xd4de('0xb')]=function(_0x554a51,_0x23e5b9){return _0x554a51[_0xd4de('0xc')](_0xd4de('0xd'),attributes,{'tableName':_0xd4de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b8=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','util','api','moment','request-promise','path'];(function(_0x46ad29,_0x1e6581){var _0xd2aebe=function(_0x50fe9d){while(--_0x50fe9d){_0x46ad29['push'](_0x46ad29['shift']());}};_0xd2aebe(++_0x1e6581);}(_0x04b8,0x159));var _0x804b=function(_0x46fd34,_0x4b2195){_0x46fd34=_0x46fd34-0x0;var _0x3d477a=_0x04b8[_0x46fd34];return _0x3d477a;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var logger=require('../../config/logger')(_0x804b('0x1'));var moment=require(_0x804b('0x2'));var BPromise=require('bluebird');var rp=require(_0x804b('0x3'));var fs=require('fs');var path=require(_0x804b('0x4'));var rimraf=require('rimraf');var config=require(_0x804b('0x5'));var attributes=require(_0x804b('0x6'));module[_0x804b('0x7')]=function(_0x5a8a5b,_0x2c22e3){return _0x5a8a5b[_0x804b('0x8')](_0x804b('0x9'),attributes,{'tableName':'int_zoho_configurations','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 4d4d78b..6cb512d 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 _0xeb5e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2765a7,_0x5ab1d5){var _0x49e529=function(_0x28d1a9){while(--_0x28d1a9){_0x2765a7['push'](_0x2765a7['shift']());}};_0x49e529(++_0x5ab1d5);}(_0xeb5e,0x1a2));var _0xeeb5=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xeb5e[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xeeb5('0x0'));var util=require(_0xeeb5('0x1'));var moment=require(_0xeeb5('0x2'));var BPromise=require(_0xeeb5('0x3'));var rs=require(_0xeeb5('0x4'));var fs=require('fs');var Redis=require(_0xeeb5('0x5'));var db=require(_0xeeb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeeb5('0x7'))(_0xeeb5('0x8'));var config=require(_0xeeb5('0x9'));var jayson=require(_0xeeb5('0xa'));var client=jayson['client'][_0xeeb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x378521,_0x346561,_0xbafa2a){return new BPromise(function(_0xb2d6d4,_0x9fc59a){return client[_0xeeb5('0xc')](_0x378521,_0xbafa2a)['then'](function(_0xbd5892){logger[_0xeeb5('0xd')](_0xeeb5('0xe'),_0x346561,'request\x20sent');logger[_0xeeb5('0xf')](_0xeeb5('0x10'),_0x346561,_0xeeb5('0x11'),JSON[_0xeeb5('0x12')](_0xbd5892));if(_0xbd5892[_0xeeb5('0x13')]){if(_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x14')]===0x1f4){logger[_0xeeb5('0x13')](_0xeeb5('0xe'),_0x346561,_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x15')]);return _0x9fc59a(_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x15')]);}logger[_0xeeb5('0x13')](_0xeeb5('0xe'),_0x346561,_0xbd5892['error']['message']);return _0xb2d6d4(_0xbd5892[_0xeeb5('0x13')]['message']);}else{logger[_0xeeb5('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x346561,'request\x20sent');_0xb2d6d4(_0xbd5892['result'][_0xeeb5('0x15')]);}})['catch'](function(_0x4dc019){logger['error'](_0xeeb5('0xe'),_0x346561,_0x4dc019);_0x9fc59a(_0x4dc019);});});} \ No newline at end of file +var _0xc84a=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c04b0,_0x54700f){var _0x16d7ca=function(_0x1907a5){while(--_0x1907a5){_0x4c04b0['push'](_0x4c04b0['shift']());}};_0x16d7ca(++_0x54700f);}(_0xc84a,0x101));var _0xac84=function(_0x3d6012,_0x49230a){_0x3d6012=_0x3d6012-0x0;var _0x49278b=_0xc84a[_0x3d6012];return _0x49278b;};'use strict';var _=require(_0xac84('0x0'));var util=require('util');var moment=require(_0xac84('0x1'));var BPromise=require(_0xac84('0x2'));var rs=require(_0xac84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac84('0x4'))['db'];var utils=require(_0xac84('0x5'));var logger=require(_0xac84('0x6'))(_0xac84('0x7'));var config=require(_0xac84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac84('0x9')][_0xac84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532346,_0x2828ec,_0x1b42cf){return new BPromise(function(_0xe17b25,_0x5adb01){return client[_0xac84('0xb')](_0x532346,_0x1b42cf)[_0xac84('0xc')](function(_0x1b2df0){logger[_0xac84('0xd')](_0xac84('0xe'),_0x2828ec,_0xac84('0xf'));logger[_0xac84('0x10')](_0xac84('0x11'),_0x2828ec,'request\x20sent',JSON[_0xac84('0x12')](_0x1b2df0));if(_0x1b2df0[_0xac84('0x13')]){if(_0x1b2df0[_0xac84('0x13')][_0xac84('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2828ec,_0x1b2df0['error'][_0xac84('0x15')]);return _0x5adb01(_0x1b2df0[_0xac84('0x13')][_0xac84('0x15')]);}logger['error'](_0xac84('0xe'),_0x2828ec,_0x1b2df0[_0xac84('0x13')][_0xac84('0x15')]);return _0xe17b25(_0x1b2df0['error'][_0xac84('0x15')]);}else{logger[_0xac84('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x2828ec,_0xac84('0xf'));_0xe17b25(_0x1b2df0['result'][_0xac84('0x15')]);}})[_0xac84('0x16')](function(_0x2ca19f){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2828ec,_0x2ca19f);_0x5adb01(_0x2ca19f);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d8d5cb4..db5a8a6 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 _0x2837=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoField.controller','index','get','/:id','isAuthenticated','put','update','delete','destroy'];(function(_0x1a8e21,_0x3cd7f2){var _0x4811f5=function(_0x1b02e4){while(--_0x1b02e4){_0x1a8e21['push'](_0x1a8e21['shift']());}};_0x4811f5(++_0x3cd7f2);}(_0x2837,0x145));var _0x7283=function(_0x467270,_0x53b948){_0x467270=_0x467270-0x0;var _0x598f71=_0x2837[_0x467270];return _0x598f71;};'use strict';var multer=require(_0x7283('0x0'));var util=require(_0x7283('0x1'));var path=require(_0x7283('0x2'));var timeout=require(_0x7283('0x3'));var express=require(_0x7283('0x4'));var router=express[_0x7283('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7283('0x6'));var config=require(_0x7283('0x7'));var controller=require(_0x7283('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7283('0x9')]);router[_0x7283('0xa')](_0x7283('0xb'),auth[_0x7283('0xc')](),controller['show']);router['post']('/',auth[_0x7283('0xc')](),controller['create']);router[_0x7283('0xd')](_0x7283('0xb'),auth[_0x7283('0xc')](),controller[_0x7283('0xe')]);router[_0x7283('0xf')](_0x7283('0xb'),auth[_0x7283('0xc')](),controller[_0x7283('0x10')]);module[_0x7283('0x11')]=router; \ No newline at end of file +var _0xf605=['./intZohoField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xf605,0x1b0));var _0x5f60=function(_0x5ad262,_0x2c6555){_0x5ad262=_0x5ad262-0x0;var _0x5d72cf=_0xf605[_0x5ad262];return _0x5d72cf;};'use strict';var multer=require(_0x5f60('0x0'));var util=require(_0x5f60('0x1'));var path=require(_0x5f60('0x2'));var timeout=require(_0x5f60('0x3'));var express=require('express');var router=express[_0x5f60('0x4')]();var auth=require(_0x5f60('0x5'));var interaction=require(_0x5f60('0x6'));var config=require(_0x5f60('0x7'));var controller=require(_0x5f60('0x8'));router[_0x5f60('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f60('0xa')]);router['get'](_0x5f60('0xb'),auth[_0x5f60('0xc')](),controller['show']);router[_0x5f60('0xd')]('/',auth[_0x5f60('0xc')](),controller[_0x5f60('0xe')]);router[_0x5f60('0xf')](_0x5f60('0xb'),auth['isAuthenticated'](),controller[_0x5f60('0x10')]);router[_0x5f60('0x11')](_0x5f60('0xb'),auth[_0x5f60('0xc')](),controller[_0x5f60('0x12')]);module[_0x5f60('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index cedf355..8a2a86f 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 _0x4483=['customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x58f012,_0x2dce4e){var _0x3d7842=function(_0x3dc3ea){while(--_0x3dc3ea){_0x58f012['push'](_0x58f012['shift']());}};_0x3d7842(++_0x2dce4e);}(_0x4483,0x1a3));var _0x3448=function(_0x9ef821,_0x479835){_0x9ef821=_0x9ef821-0x0;var _0x1f5e27=_0x4483[_0x9ef821];return _0x1f5e27;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'type':{'type':Sequelize[_0x3448('0x2')]('string',_0x3448('0x3'),_0x3448('0x4'),_0x3448('0x5')),'defaultValue':_0x3448('0x6')},'content':{'type':Sequelize[_0x3448('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3448('0x2')](_0x3448('0x6'),_0x3448('0x3'),_0x3448('0x4'))},'keyContent':{'type':Sequelize[_0x3448('0x7')]},'idField':{'type':Sequelize[_0x3448('0x7')]},'nameField':{'type':Sequelize[_0x3448('0x7')]},'customField':{'type':Sequelize[_0x3448('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1339=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x4d3b92,_0xec7957){var _0x363ff8=function(_0x9b89b8){while(--_0x9b89b8){_0x4d3b92['push'](_0x4d3b92['shift']());}};_0x363ff8(++_0xec7957);}(_0x1339,0x1ed));var _0x9133=function(_0x8b7eb9,_0x3d48ae){_0x8b7eb9=_0x8b7eb9-0x0;var _0x135d7a=_0x1339[_0x8b7eb9];return _0x135d7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9133('0x0')](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'),_0x9133('0x4')),'defaultValue':_0x9133('0x1')},'content':{'type':Sequelize[_0x9133('0x5')]},'key':{'type':Sequelize[_0x9133('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9133('0x5')]},'nameField':{'type':Sequelize[_0x9133('0x5')]},'customField':{'type':Sequelize[_0x9133('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9133('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 86a5213..117b12b 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 _0x0f46=['model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','options','count','include','findAll','rows','catch','rawAttributes','length','includeAll','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','stack','name','send','ZohoField'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x0f46,0xed));var _0x60f4=function(_0x17a429,_0x1155b4){_0x17a429=_0x17a429-0x0;var _0x1b2f6e=_0x0f46[_0x17a429];return _0x1b2f6e;};'use strict';var pdf=require(_0x60f4('0x0'));var emlformat=require(_0x60f4('0x1'));var rimraf=require(_0x60f4('0x2'));var zipdir=require(_0x60f4('0x3'));var jsonpatch=require(_0x60f4('0x4'));var rp=require(_0x60f4('0x5'));var moment=require(_0x60f4('0x6'));var BPromise=require(_0x60f4('0x7'));var Mustache=require('mustache');var util=require(_0x60f4('0x8'));var path=require('path');var sox=require(_0x60f4('0x9'));var csv=require(_0x60f4('0xa'));var ejs=require(_0x60f4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x60f4('0xc'));var crypto=require(_0x60f4('0xd'));var jsforce=require(_0x60f4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x60f4('0xa'));var querystring=require('querystring');var Papa=require(_0x60f4('0xf'));var Redis=require(_0x60f4('0x10'));var authService=require(_0x60f4('0x11'));var qs=require(_0x60f4('0x12'));var hardwareService=require(_0x60f4('0x13'));var logger=require('../../config/logger')(_0x60f4('0x14'));var utils=require('../../config/utils');var config=require(_0x60f4('0x15'));var db=require(_0x60f4('0x16'))['db'];function respondWithStatusCode(_0x441946,_0x174fc1){_0x174fc1=_0x174fc1||0xcc;return function(_0x5ebb5f){if(_0x5ebb5f){return _0x441946[_0x60f4('0x17')](_0x174fc1);}return _0x441946[_0x60f4('0x18')](_0x174fc1)[_0x60f4('0x19')]();};}function respondWithResult(_0x4312e8,_0x365920){_0x365920=_0x365920||0xc8;return function(_0x42a973){if(_0x42a973){return _0x4312e8[_0x60f4('0x18')](_0x365920)[_0x60f4('0x1a')](_0x42a973);}};}function respondWithFilteredResult(_0x32ecb2,_0xc95927){return function(_0xd27d55){if(_0xd27d55){var _0x4d2e3a=_0xd27d55['count'],_0x26affe=_0xc95927[_0x60f4('0x1b')],_0x2044fb=_0xc95927[_0x60f4('0x1b')]+_0xc95927[_0x60f4('0x1c')],_0xc444de;if(_0x2044fb>=_0x4d2e3a){_0x2044fb=_0x4d2e3a;_0xc444de=0xc8;}else{_0xc444de=0xce;}_0x32ecb2[_0x60f4('0x18')](_0xc444de);return _0x32ecb2[_0x60f4('0x1d')]('Content-Range',_0x26affe+'-'+_0x2044fb+'/'+_0x4d2e3a)[_0x60f4('0x1a')](_0xd27d55);}return null;};}function patchUpdates(_0x469c05){return function(_0x445af3){try{jsonpatch[_0x60f4('0x1e')](_0x445af3,_0x469c05,!![]);}catch(_0x4c5921){return BPromise[_0x60f4('0x1f')](_0x4c5921);}return _0x445af3[_0x60f4('0x20')]();};}function saveUpdates(_0x46a2f7,_0x581da3){return function(_0x1cfe51){if(_0x1cfe51){return _0x1cfe51[_0x60f4('0x21')](_0x46a2f7)[_0x60f4('0x22')](function(_0x1c245c){return _0x1c245c;});}return null;};}function removeEntity(_0x9bcb6d,_0x111ef2){return function(_0x14c5ce){if(_0x14c5ce){return _0x14c5ce['destroy']()[_0x60f4('0x22')](function(){_0x9bcb6d[_0x60f4('0x18')](0xcc)[_0x60f4('0x19')]();});}};}function handleEntityNotFound(_0x2b6413,_0x3a84ae){return function(_0x5c5332){if(!_0x5c5332){_0x2b6413[_0x60f4('0x17')](0x194);}return _0x5c5332;};}function handleError(_0x235884,_0x3ebca5){_0x3ebca5=_0x3ebca5||0x1f4;return function(_0x330866){logger['error'](_0x330866[_0x60f4('0x23')]);if(_0x330866[_0x60f4('0x24')]){delete _0x330866[_0x60f4('0x24')];}_0x235884['status'](_0x3ebca5)[_0x60f4('0x25')](_0x330866);};}exports['index']=function(_0xe71762,_0x473463){var _0x1965d6={},_0x20c8c9={},_0x2c69af={'count':0x0,'rows':[]};var _0x36ade2=db[_0x60f4('0x26')]['rawAttributes'];_0x20c8c9[_0x60f4('0x27')]=_[_0x60f4('0x28')](_0x36ade2);_0x20c8c9[_0x60f4('0x29')]=_[_0x60f4('0x28')](_0xe71762[_0x60f4('0x29')]);_0x20c8c9[_0x60f4('0x2a')]=_['intersection'](_0x20c8c9[_0x60f4('0x27')],_0x20c8c9[_0x60f4('0x29')]);_0x1965d6[_0x60f4('0x2b')]=_[_0x60f4('0x2c')](_0x20c8c9[_0x60f4('0x27')],qs[_0x60f4('0x2d')](_0xe71762[_0x60f4('0x29')][_0x60f4('0x2d')]));_0x1965d6[_0x60f4('0x2b')]=_0x1965d6[_0x60f4('0x2b')]['length']?_0x1965d6[_0x60f4('0x2b')]:_0x20c8c9['model'];if(!_0xe71762[_0x60f4('0x29')][_0x60f4('0x2e')](_0x60f4('0x2f'))){_0x1965d6['limit']=qs[_0x60f4('0x1c')](_0xe71762['query']['limit']);_0x1965d6[_0x60f4('0x1b')]=qs[_0x60f4('0x1b')](_0xe71762[_0x60f4('0x29')][_0x60f4('0x1b')]);}_0x1965d6[_0x60f4('0x30')]=qs[_0x60f4('0x31')](_0xe71762[_0x60f4('0x29')][_0x60f4('0x31')]);_0x1965d6['where']=qs[_0x60f4('0x2a')](_[_0x60f4('0x32')](_0xe71762[_0x60f4('0x29')],_0x20c8c9[_0x60f4('0x2a')]));if(_0xe71762[_0x60f4('0x29')][_0x60f4('0x33')]){_0x1965d6[_0x60f4('0x34')]=_[_0x60f4('0x35')](_0x1965d6['where'],{'$or':_['map'](_0x36ade2,function(_0x1c2c52){if(_0x1c2c52[_0x60f4('0x36')][_0x60f4('0x37')]!=='VIRTUAL'){var _0x38f29c={};_0x38f29c[_0x1c2c52['field']]={'$like':'%'+_0xe71762[_0x60f4('0x29')][_0x60f4('0x33')]+'%'};return _0x38f29c;}})});}_0x1965d6=_[_0x60f4('0x35')]({},_0x1965d6,_0xe71762[_0x60f4('0x38')]);var _0x58251b={'where':_0x1965d6['where']};return db[_0x60f4('0x26')]['count'](_0x58251b)['then'](function(_0x4a8af1){_0x2c69af[_0x60f4('0x39')]=_0x4a8af1;if(_0xe71762[_0x60f4('0x29')]['includeAll']){_0x1965d6[_0x60f4('0x3a')]=[{'all':!![]}];}return db['ZohoField'][_0x60f4('0x3b')](_0x1965d6);})[_0x60f4('0x22')](function(_0x965709){_0x2c69af[_0x60f4('0x3c')]=_0x965709;return _0x2c69af;})[_0x60f4('0x22')](respondWithFilteredResult(_0x473463,_0x1965d6))[_0x60f4('0x3d')](handleError(_0x473463,null));};exports['show']=function(_0x1f2859,_0x595f12){var _0xf1caa1={'raw':!![],'where':{'id':_0x1f2859['params']['id']}},_0xb9541b={};_0xb9541b[_0x60f4('0x27')]=_[_0x60f4('0x28')](db[_0x60f4('0x26')][_0x60f4('0x3e')]);_0xb9541b[_0x60f4('0x29')]=_[_0x60f4('0x28')](_0x1f2859['query']);_0xb9541b[_0x60f4('0x2a')]=_['intersection'](_0xb9541b[_0x60f4('0x27')],_0xb9541b[_0x60f4('0x29')]);_0xf1caa1[_0x60f4('0x2b')]=_['intersection'](_0xb9541b[_0x60f4('0x27')],qs[_0x60f4('0x2d')](_0x1f2859['query'][_0x60f4('0x2d')]));_0xf1caa1[_0x60f4('0x2b')]=_0xf1caa1[_0x60f4('0x2b')][_0x60f4('0x3f')]?_0xf1caa1['attributes']:_0xb9541b[_0x60f4('0x27')];if(_0x1f2859[_0x60f4('0x29')][_0x60f4('0x40')]){_0xf1caa1[_0x60f4('0x3a')]=[{'all':!![]}];}_0xf1caa1=_['merge']({},_0xf1caa1,_0x1f2859[_0x60f4('0x38')]);return db['ZohoField'][_0x60f4('0x41')](_0xf1caa1)[_0x60f4('0x22')](handleEntityNotFound(_0x595f12,null))[_0x60f4('0x22')](respondWithResult(_0x595f12,null))['catch'](handleError(_0x595f12,null));};exports[_0x60f4('0x42')]=function(_0x4b2476,_0x2540e5){return db[_0x60f4('0x26')][_0x60f4('0x42')](_0x4b2476[_0x60f4('0x43')],{})[_0x60f4('0x22')](respondWithResult(_0x2540e5,0xc9))[_0x60f4('0x3d')](handleError(_0x2540e5,null));};exports['update']=function(_0x2ad767,_0x51ddc8){if(_0x2ad767[_0x60f4('0x43')]['id']){delete _0x2ad767['body']['id'];}return db[_0x60f4('0x26')][_0x60f4('0x41')]({'where':{'id':_0x2ad767[_0x60f4('0x44')]['id']}})[_0x60f4('0x22')](handleEntityNotFound(_0x51ddc8,null))['then'](saveUpdates(_0x2ad767[_0x60f4('0x43')],null))[_0x60f4('0x22')](respondWithResult(_0x51ddc8,null))['catch'](handleError(_0x51ddc8,null));};exports['destroy']=function(_0x950027,_0x174905){return db[_0x60f4('0x26')][_0x60f4('0x41')]({'where':{'id':_0x950027['params']['id']}})[_0x60f4('0x22')](handleEntityNotFound(_0x174905,null))['then'](removeEntity(_0x174905,null))[_0x60f4('0x3d')](handleError(_0x174905,null));}; \ No newline at end of file +var _0x9c3d=['reject','save','update','then','sendStatus','error','stack','name','send','ZohoField','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','filter','merge','map','type','key','field','options','includeAll','rows','catch','show','rawAttributes','include','create','body','find','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','limit','set','apply'];(function(_0x4ee6cd,_0x55e06d){var _0x2ce4ed=function(_0x29376b){while(--_0x29376b){_0x4ee6cd['push'](_0x4ee6cd['shift']());}};_0x2ce4ed(++_0x55e06d);}(_0x9c3d,0x13d));var _0xd9c3=function(_0x4c6c46,_0x4d5b50){_0x4c6c46=_0x4c6c46-0x0;var _0x4eca5e=_0x9c3d[_0x4c6c46];return _0x4eca5e;};'use strict';var pdf=require(_0xd9c3('0x0'));var emlformat=require(_0xd9c3('0x1'));var rimraf=require(_0xd9c3('0x2'));var zipdir=require(_0xd9c3('0x3'));var jsonpatch=require(_0xd9c3('0x4'));var rp=require('request-promise');var moment=require(_0xd9c3('0x5'));var BPromise=require(_0xd9c3('0x6'));var Mustache=require(_0xd9c3('0x7'));var util=require('util');var path=require(_0xd9c3('0x8'));var sox=require(_0xd9c3('0x9'));var csv=require(_0xd9c3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd9c3('0xb'));var jsforce=require(_0xd9c3('0xc'));var deskjs=require(_0xd9c3('0xd'));var toCsv=require(_0xd9c3('0xa'));var querystring=require(_0xd9c3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9c3('0xf'));var qs=require(_0xd9c3('0x10'));var hardwareService=require(_0xd9c3('0x11'));var logger=require('../../config/logger')(_0xd9c3('0x12'));var utils=require('../../config/utils');var config=require(_0xd9c3('0x13'));var db=require(_0xd9c3('0x14'))['db'];function respondWithStatusCode(_0x2db0c8,_0x445482){_0x445482=_0x445482||0xcc;return function(_0x5ca206){if(_0x5ca206){return _0x2db0c8['sendStatus'](_0x445482);}return _0x2db0c8[_0xd9c3('0x15')](_0x445482)[_0xd9c3('0x16')]();};}function respondWithResult(_0xa0bf3c,_0x38368e){_0x38368e=_0x38368e||0xc8;return function(_0x57dea6){if(_0x57dea6){return _0xa0bf3c[_0xd9c3('0x15')](_0x38368e)[_0xd9c3('0x17')](_0x57dea6);}};}function respondWithFilteredResult(_0xcee81c,_0x19fb5c){return function(_0x27b7d5){if(_0x27b7d5){var _0x20a47a=_0x27b7d5[_0xd9c3('0x18')],_0x6790b3=_0x19fb5c['offset'],_0x19da46=_0x19fb5c['offset']+_0x19fb5c[_0xd9c3('0x19')],_0x4e2116;if(_0x19da46>=_0x20a47a){_0x19da46=_0x20a47a;_0x4e2116=0xc8;}else{_0x4e2116=0xce;}_0xcee81c[_0xd9c3('0x15')](_0x4e2116);return _0xcee81c[_0xd9c3('0x1a')]('Content-Range',_0x6790b3+'-'+_0x19da46+'/'+_0x20a47a)[_0xd9c3('0x17')](_0x27b7d5);}return null;};}function patchUpdates(_0x471b94){return function(_0x562cd8){try{jsonpatch[_0xd9c3('0x1b')](_0x562cd8,_0x471b94,!![]);}catch(_0x16090f){return BPromise[_0xd9c3('0x1c')](_0x16090f);}return _0x562cd8[_0xd9c3('0x1d')]();};}function saveUpdates(_0x31823e,_0x37821c){return function(_0x76891e){if(_0x76891e){return _0x76891e[_0xd9c3('0x1e')](_0x31823e)[_0xd9c3('0x1f')](function(_0x48740a){return _0x48740a;});}return null;};}function removeEntity(_0x33e39f,_0x554a21){return function(_0x20d5d5){if(_0x20d5d5){return _0x20d5d5['destroy']()[_0xd9c3('0x1f')](function(){_0x33e39f[_0xd9c3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c854,_0x3f7733){return function(_0x14c6c9){if(!_0x14c6c9){_0x12c854[_0xd9c3('0x20')](0x194);}return _0x14c6c9;};}function handleError(_0x5e5f06,_0x5a2d7a){_0x5a2d7a=_0x5a2d7a||0x1f4;return function(_0x51b379){logger[_0xd9c3('0x21')](_0x51b379[_0xd9c3('0x22')]);if(_0x51b379['name']){delete _0x51b379[_0xd9c3('0x23')];}_0x5e5f06[_0xd9c3('0x15')](_0x5a2d7a)[_0xd9c3('0x24')](_0x51b379);};}exports['index']=function(_0x428c00,_0x2de955){var _0x15932d={},_0x40132f={},_0x52df4c={'count':0x0,'rows':[]};var _0x91a84a=db[_0xd9c3('0x25')]['rawAttributes'];_0x40132f[_0xd9c3('0x26')]=_[_0xd9c3('0x27')](_0x91a84a);_0x40132f['query']=_[_0xd9c3('0x27')](_0x428c00['query']);_0x40132f[_0xd9c3('0x28')]=_[_0xd9c3('0x29')](_0x40132f['model'],_0x40132f[_0xd9c3('0x2a')]);_0x15932d[_0xd9c3('0x2b')]=_['intersection'](_0x40132f['model'],qs[_0xd9c3('0x2c')](_0x428c00[_0xd9c3('0x2a')][_0xd9c3('0x2c')]));_0x15932d[_0xd9c3('0x2b')]=_0x15932d[_0xd9c3('0x2b')][_0xd9c3('0x2d')]?_0x15932d[_0xd9c3('0x2b')]:_0x40132f[_0xd9c3('0x26')];if(!_0x428c00[_0xd9c3('0x2a')][_0xd9c3('0x2e')](_0xd9c3('0x2f'))){_0x15932d[_0xd9c3('0x19')]=qs[_0xd9c3('0x19')](_0x428c00['query'][_0xd9c3('0x19')]);_0x15932d[_0xd9c3('0x30')]=qs[_0xd9c3('0x30')](_0x428c00[_0xd9c3('0x2a')]['offset']);}_0x15932d[_0xd9c3('0x31')]=qs['sort'](_0x428c00[_0xd9c3('0x2a')]['sort']);_0x15932d[_0xd9c3('0x32')]=qs[_0xd9c3('0x28')](_['pick'](_0x428c00['query'],_0x40132f[_0xd9c3('0x28')]));if(_0x428c00[_0xd9c3('0x2a')][_0xd9c3('0x33')]){_0x15932d[_0xd9c3('0x32')]=_[_0xd9c3('0x34')](_0x15932d[_0xd9c3('0x32')],{'$or':_[_0xd9c3('0x35')](_0x91a84a,function(_0x326070){if(_0x326070[_0xd9c3('0x36')][_0xd9c3('0x37')]!=='VIRTUAL'){var _0x408cb9={};_0x408cb9[_0x326070[_0xd9c3('0x38')]]={'$like':'%'+_0x428c00[_0xd9c3('0x2a')]['filter']+'%'};return _0x408cb9;}})});}_0x15932d=_[_0xd9c3('0x34')]({},_0x15932d,_0x428c00[_0xd9c3('0x39')]);var _0x3e9b03={'where':_0x15932d[_0xd9c3('0x32')]};return db[_0xd9c3('0x25')][_0xd9c3('0x18')](_0x3e9b03)['then'](function(_0x4bef2f){_0x52df4c[_0xd9c3('0x18')]=_0x4bef2f;if(_0x428c00[_0xd9c3('0x2a')][_0xd9c3('0x3a')]){_0x15932d['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x15932d);})[_0xd9c3('0x1f')](function(_0x225b0d){_0x52df4c[_0xd9c3('0x3b')]=_0x225b0d;return _0x52df4c;})[_0xd9c3('0x1f')](respondWithFilteredResult(_0x2de955,_0x15932d))[_0xd9c3('0x3c')](handleError(_0x2de955,null));};exports[_0xd9c3('0x3d')]=function(_0x5c834e,_0x279c92){var _0x31391e={'raw':!![],'where':{'id':_0x5c834e['params']['id']}},_0x18b049={};_0x18b049['model']=_[_0xd9c3('0x27')](db[_0xd9c3('0x25')][_0xd9c3('0x3e')]);_0x18b049[_0xd9c3('0x2a')]=_[_0xd9c3('0x27')](_0x5c834e[_0xd9c3('0x2a')]);_0x18b049[_0xd9c3('0x28')]=_[_0xd9c3('0x29')](_0x18b049['model'],_0x18b049[_0xd9c3('0x2a')]);_0x31391e[_0xd9c3('0x2b')]=_['intersection'](_0x18b049[_0xd9c3('0x26')],qs[_0xd9c3('0x2c')](_0x5c834e[_0xd9c3('0x2a')][_0xd9c3('0x2c')]));_0x31391e[_0xd9c3('0x2b')]=_0x31391e[_0xd9c3('0x2b')][_0xd9c3('0x2d')]?_0x31391e[_0xd9c3('0x2b')]:_0x18b049[_0xd9c3('0x26')];if(_0x5c834e['query'][_0xd9c3('0x3a')]){_0x31391e[_0xd9c3('0x3f')]=[{'all':!![]}];}_0x31391e=_[_0xd9c3('0x34')]({},_0x31391e,_0x5c834e['options']);return db['ZohoField']['find'](_0x31391e)['then'](handleEntityNotFound(_0x279c92,null))['then'](respondWithResult(_0x279c92,null))[_0xd9c3('0x3c')](handleError(_0x279c92,null));};exports[_0xd9c3('0x40')]=function(_0x5d405f,_0x1523fa){return db[_0xd9c3('0x25')][_0xd9c3('0x40')](_0x5d405f['body'],{})[_0xd9c3('0x1f')](respondWithResult(_0x1523fa,0xc9))[_0xd9c3('0x3c')](handleError(_0x1523fa,null));};exports[_0xd9c3('0x1e')]=function(_0x22bac1,_0x291e88){if(_0x22bac1[_0xd9c3('0x41')]['id']){delete _0x22bac1[_0xd9c3('0x41')]['id'];}return db[_0xd9c3('0x25')][_0xd9c3('0x42')]({'where':{'id':_0x22bac1[_0xd9c3('0x43')]['id']}})[_0xd9c3('0x1f')](handleEntityNotFound(_0x291e88,null))[_0xd9c3('0x1f')](saveUpdates(_0x22bac1['body'],null))[_0xd9c3('0x1f')](respondWithResult(_0x291e88,null))[_0xd9c3('0x3c')](handleError(_0x291e88,null));};exports[_0xd9c3('0x44')]=function(_0x549220,_0x1c7cda){return db['ZohoField'][_0xd9c3('0x42')]({'where':{'id':_0x549220[_0xd9c3('0x43')]['id']}})[_0xd9c3('0x1f')](handleEntityNotFound(_0x1c7cda,null))[_0xd9c3('0x1f')](removeEntity(_0x1c7cda,null))[_0xd9c3('0x3c')](handleError(_0x1c7cda,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index e0445d7..09a8cb6 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 _0x9ea5=['bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','lodash','util','../../config/logger','moment'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x9ea5,0x114));var _0x59ea=function(_0x35e114,_0x5c0cd2){_0x35e114=_0x35e114-0x0;var _0x2577a2=_0x9ea5[_0x35e114];return _0x2577a2;};'use strict';var _=require(_0x59ea('0x0'));var util=require(_0x59ea('0x1'));var logger=require(_0x59ea('0x2'))('api');var moment=require(_0x59ea('0x3'));var BPromise=require(_0x59ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59ea('0x5'));var rimraf=require(_0x59ea('0x6'));var config=require(_0x59ea('0x7'));var attributes=require(_0x59ea('0x8'));module[_0x59ea('0x9')]=function(_0x494ea9,_0x20ca9d){return _0x494ea9[_0x59ea('0xa')](_0x59ea('0xb'),attributes,{'tableName':_0x59ea('0xc'),'paranoid':![],'indexes':[{'name':_0x59ea('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa00d=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','zoho_unique_index'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xa00d,0x199));var _0xda00=function(_0x599f98,_0x20e50a){_0x599f98=_0x599f98-0x0;var _0x30e701=_0xa00d[_0x599f98];return _0x30e701;};'use strict';var _=require(_0xda00('0x0'));var util=require(_0xda00('0x1'));var logger=require(_0xda00('0x2'))('api');var moment=require(_0xda00('0x3'));var BPromise=require(_0xda00('0x4'));var rp=require(_0xda00('0x5'));var fs=require('fs');var path=require(_0xda00('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0xda00('0x7')]=function(_0x793de9,_0x3f494f){return _0x793de9['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xda00('0x8'),'fields':[_0xda00('0x9'),_0xda00('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 6f5276c..f91d147 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 _0x41c3=['request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x76b1c2,_0x2126a6){var _0x37c831=function(_0x37d88d){while(--_0x37d88d){_0x76b1c2['push'](_0x76b1c2['shift']());}};_0x37c831(++_0x2126a6);}(_0x41c3,0x123));var _0x341c=function(_0x2ad4f5,_0x50a217){_0x2ad4f5=_0x2ad4f5-0x0;var _0x45b77f=_0x41c3[_0x2ad4f5];return _0x45b77f;};'use strict';var _=require(_0x341c('0x0'));var util=require('util');var moment=require(_0x341c('0x1'));var BPromise=require(_0x341c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x341c('0x3'));var db=require(_0x341c('0x4'))['db'];var utils=require(_0x341c('0x5'));var logger=require('../../config/logger')(_0x341c('0x6'));var config=require(_0x341c('0x7'));var jayson=require(_0x341c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b73d7,_0x2f1da1,_0x4ad5c3){return new BPromise(function(_0x4b9b73,_0x2b2785){return client[_0x341c('0x9')](_0x5b73d7,_0x4ad5c3)[_0x341c('0xa')](function(_0x63059c){logger['info'](_0x341c('0xb'),_0x2f1da1,_0x341c('0xc'));logger[_0x341c('0xd')](_0x341c('0xe'),_0x2f1da1,_0x341c('0xc'),JSON['stringify'](_0x63059c));if(_0x63059c[_0x341c('0xf')]){if(_0x63059c['error'][_0x341c('0x10')]===0x1f4){logger['error'](_0x341c('0xb'),_0x2f1da1,_0x63059c['error']['message']);return _0x2b2785(_0x63059c[_0x341c('0xf')][_0x341c('0x11')]);}logger[_0x341c('0xf')](_0x341c('0xb'),_0x2f1da1,_0x63059c[_0x341c('0xf')]['message']);return _0x4b9b73(_0x63059c[_0x341c('0xf')]['message']);}else{logger['info'](_0x341c('0xb'),_0x2f1da1,_0x341c('0xc'));_0x4b9b73(_0x63059c[_0x341c('0x12')][_0x341c('0x11')]);}})[_0x341c('0x13')](function(_0x5e968b){logger['error'](_0x341c('0xb'),_0x2f1da1,_0x5e968b);_0x2b2785(_0x5e968b);});});} \ No newline at end of file +var _0xd930=['stringify','code','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xd930,0x10d));var _0x0d93=function(_0x302cc8,_0x23442a){_0x302cc8=_0x302cc8-0x0;var _0x59f8e0=_0xd930[_0x302cc8];return _0x59f8e0;};'use strict';var _=require(_0x0d93('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d93('0x1'));var rs=require(_0x0d93('0x2'));var fs=require('fs');var Redis=require(_0x0d93('0x3'));var db=require(_0x0d93('0x4'))['db'];var utils=require(_0x0d93('0x5'));var logger=require(_0x0d93('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d93('0x7'));var client=jayson[_0x0d93('0x8')][_0x0d93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf2fe60,_0x488487,_0x14cd20){return new BPromise(function(_0x276225,_0x101a87){return client[_0x0d93('0xa')](_0xf2fe60,_0x14cd20)[_0x0d93('0xb')](function(_0x3c5d1b){logger[_0x0d93('0xc')](_0x0d93('0xd'),_0x488487,_0x0d93('0xe'));logger[_0x0d93('0xf')](_0x0d93('0x10'),_0x488487,_0x0d93('0xe'),JSON[_0x0d93('0x11')](_0x3c5d1b));if(_0x3c5d1b['error']){if(_0x3c5d1b['error'][_0x0d93('0x12')]===0x1f4){logger[_0x0d93('0x13')](_0x0d93('0xd'),_0x488487,_0x3c5d1b[_0x0d93('0x13')][_0x0d93('0x14')]);return _0x101a87(_0x3c5d1b['error']['message']);}logger[_0x0d93('0x13')]('ZohoField,\x20%s,\x20%s',_0x488487,_0x3c5d1b[_0x0d93('0x13')][_0x0d93('0x14')]);return _0x276225(_0x3c5d1b['error'][_0x0d93('0x14')]);}else{logger[_0x0d93('0xc')](_0x0d93('0xd'),_0x488487,_0x0d93('0xe'));_0x276225(_0x3c5d1b['result']['message']);}})[_0x0d93('0x15')](function(_0x1a2272){logger[_0x0d93('0x13')](_0x0d93('0xd'),_0x488487,_0x1a2272);_0x101a87(_0x1a2272);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3995e41..0d3f733 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 _0x15b2=['../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x30b547,_0x5b89e9){var _0xab9618=function(_0x2259f2){while(--_0x2259f2){_0x30b547['push'](_0x30b547['shift']());}};_0xab9618(++_0x5b89e9);}(_0x15b2,0x145));var _0x215b=function(_0xdeb0b8,_0x4b9186){_0xdeb0b8=_0xdeb0b8-0x0;var _0x335714=_0x15b2[_0xdeb0b8];return _0x335714;};'use strict';var multer=require('multer');var util=require(_0x215b('0x0'));var path=require('path');var timeout=require(_0x215b('0x1'));var express=require(_0x215b('0x2'));var router=express['Router']();var auth=require(_0x215b('0x3'));var interaction=require(_0x215b('0x4'));var config=require(_0x215b('0x5'));module[_0x215b('0x6')]=router; \ No newline at end of file +var _0x49c1=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x404c1e,_0x53aff1){var _0x32f93c=function(_0x3e97a3){while(--_0x3e97a3){_0x404c1e['push'](_0x404c1e['shift']());}};_0x32f93c(++_0x53aff1);}(_0x49c1,0xef));var _0x149c=function(_0x515e03,_0x1df75e){_0x515e03=_0x515e03-0x0;var _0x21c24f=_0x49c1[_0x515e03];return _0x21c24f;};'use strict';var multer=require(_0x149c('0x0'));var util=require('util');var path=require(_0x149c('0x1'));var timeout=require(_0x149c('0x2'));var express=require(_0x149c('0x3'));var router=express['Router']();var auth=require(_0x149c('0x4'));var interaction=require(_0x149c('0x5'));var config=require('../../config/environment');module[_0x149c('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 49f631e..7e605a1 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 _0xad87=['INTEGER','BOOLEAN','exports','STRING','unique_name_and_version'];(function(_0x66f487,_0x11815f){var _0x39229b=function(_0x10e210){while(--_0x10e210){_0x66f487['push'](_0x66f487['shift']());}};_0x39229b(++_0x11815f);}(_0xad87,0xc5));var _0x7ad8=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0xad87[_0x1e1965];return _0x1a2e96;};'use strict';var Sequelize=require('sequelize');module[_0x7ad8('0x0')]={'name':{'type':Sequelize[_0x7ad8('0x1')],'allowNull':![],'unique':_0x7ad8('0x2')},'version':{'type':Sequelize[_0x7ad8('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x7ad8('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x7ad8('0x1')]},'path':{'type':Sequelize[_0x7ad8('0x1')]},'type':{'type':Sequelize[_0x7ad8('0x1')]},'size':{'type':Sequelize[_0x7ad8('0x3')]},'active':{'type':Sequelize[_0x7ad8('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x7ad8('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x7ad8('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x7ad8('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7ad8('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x5989=['exports','STRING','unique_name_and_version','app.js','state','sequelize'];(function(_0x521c79,_0x301016){var _0xfbee65=function(_0x116d0d){while(--_0x116d0d){_0x521c79['push'](_0x521c79['shift']());}};_0xfbee65(++_0x301016);}(_0x5989,0x1e5));var _0x9598=function(_0x500f0b,_0x21a6a8){_0x500f0b=_0x500f0b-0x0;var _0x204137=_0x5989[_0x500f0b];return _0x204137;};'use strict';var Sequelize=require(_0x9598('0x0'));module[_0x9598('0x1')]={'name':{'type':Sequelize[_0x9598('0x2')],'allowNull':![],'unique':_0x9598('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x9598('0x2')],'defaultValue':_0x9598('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9598('0x2')]},'type':{'type':Sequelize[_0x9598('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x9598('0x5')},'description':{'type':Sequelize[_0x9598('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9598('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 4fad034..04c9aa4 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 _0x8695=['apply','reject','save','destroy','then','error','name','send','index','Integration','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','intersection','find','create','update','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x8695,0x107));var _0x5869=function(_0x4ebdf4,_0x57d47f){_0x4ebdf4=_0x4ebdf4-0x0;var _0x18d1c1=_0x8695[_0x4ebdf4];return _0x18d1c1;};'use strict';var pdf=require(_0x5869('0x0'));var emlformat=require(_0x5869('0x1'));var rimraf=require(_0x5869('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5869('0x3'));var rp=require(_0x5869('0x4'));var moment=require(_0x5869('0x5'));var BPromise=require(_0x5869('0x6'));var Mustache=require(_0x5869('0x7'));var util=require('util');var path=require(_0x5869('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5869('0x9'));var squel=require('squel');var crypto=require(_0x5869('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5869('0xb'));var querystring=require('querystring');var Papa=require(_0x5869('0xc'));var Redis=require(_0x5869('0xd'));var authService=require(_0x5869('0xe'));var qs=require(_0x5869('0xf'));var hardwareService=require(_0x5869('0x10'));var logger=require(_0x5869('0x11'))(_0x5869('0x12'));var utils=require(_0x5869('0x13'));var config=require(_0x5869('0x14'));var db=require(_0x5869('0x15'))['db'];function respondWithStatusCode(_0x4669cc,_0x4629a9){_0x4629a9=_0x4629a9||0xcc;return function(_0x27a0ac){if(_0x27a0ac){return _0x4669cc[_0x5869('0x16')](_0x4629a9);}return _0x4669cc['status'](_0x4629a9)[_0x5869('0x17')]();};}function respondWithResult(_0x3532a2,_0x1f15ca){_0x1f15ca=_0x1f15ca||0xc8;return function(_0x140c77){if(_0x140c77){return _0x3532a2['status'](_0x1f15ca)[_0x5869('0x18')](_0x140c77);}};}function respondWithFilteredResult(_0x2f2e9b,_0x448759){return function(_0x47237a){if(_0x47237a){var _0x36cb1a=_0x47237a['count'],_0x2b5f77=_0x448759[_0x5869('0x19')],_0x56a48e=_0x448759[_0x5869('0x19')]+_0x448759[_0x5869('0x1a')],_0x4f72fb;if(_0x56a48e>=_0x36cb1a){_0x56a48e=_0x36cb1a;_0x4f72fb=0xc8;}else{_0x4f72fb=0xce;}_0x2f2e9b[_0x5869('0x1b')](_0x4f72fb);return _0x2f2e9b[_0x5869('0x1c')]('Content-Range',_0x2b5f77+'-'+_0x56a48e+'/'+_0x36cb1a)[_0x5869('0x18')](_0x47237a);}return null;};}function patchUpdates(_0x3ab9de){return function(_0x31e1d2){try{jsonpatch[_0x5869('0x1d')](_0x31e1d2,_0x3ab9de,!![]);}catch(_0x370af2){return BPromise[_0x5869('0x1e')](_0x370af2);}return _0x31e1d2[_0x5869('0x1f')]();};}function saveUpdates(_0x6fb73f,_0xdf9640){return function(_0x45374a){if(_0x45374a){return _0x45374a['update'](_0x6fb73f)['then'](function(_0x59cd98){return _0x59cd98;});}return null;};}function removeEntity(_0x5a253d,_0x21cdee){return function(_0x12ff15){if(_0x12ff15){return _0x12ff15[_0x5869('0x20')]()[_0x5869('0x21')](function(){_0x5a253d['status'](0xcc)[_0x5869('0x17')]();});}};}function handleEntityNotFound(_0x13a9b7,_0x1995ae){return function(_0x4296f6){if(!_0x4296f6){_0x13a9b7[_0x5869('0x16')](0x194);}return _0x4296f6;};}function handleError(_0x4cc1c0,_0xc90af1){_0xc90af1=_0xc90af1||0x1f4;return function(_0x429bf8){logger[_0x5869('0x22')](_0x429bf8['stack']);if(_0x429bf8[_0x5869('0x23')]){delete _0x429bf8[_0x5869('0x23')];}_0x4cc1c0[_0x5869('0x1b')](_0xc90af1)[_0x5869('0x24')](_0x429bf8);};}exports[_0x5869('0x25')]=function(_0x3e792a,_0x247b2b){var _0x4f15ed={},_0x48539c={},_0x2c6822={'count':0x0,'rows':[]};var _0x155bbb=db[_0x5869('0x26')][_0x5869('0x27')];_0x48539c[_0x5869('0x28')]=_[_0x5869('0x29')](_0x155bbb);_0x48539c[_0x5869('0x2a')]=_[_0x5869('0x29')](_0x3e792a[_0x5869('0x2a')]);_0x48539c[_0x5869('0x2b')]=_['intersection'](_0x48539c['model'],_0x48539c[_0x5869('0x2a')]);_0x4f15ed[_0x5869('0x2c')]=_['intersection'](_0x48539c[_0x5869('0x28')],qs[_0x5869('0x2d')](_0x3e792a[_0x5869('0x2a')][_0x5869('0x2d')]));_0x4f15ed[_0x5869('0x2c')]=_0x4f15ed['attributes'][_0x5869('0x2e')]?_0x4f15ed[_0x5869('0x2c')]:_0x48539c[_0x5869('0x28')];if(!_0x3e792a['query'][_0x5869('0x2f')](_0x5869('0x30'))){_0x4f15ed[_0x5869('0x1a')]=qs[_0x5869('0x1a')](_0x3e792a[_0x5869('0x2a')][_0x5869('0x1a')]);_0x4f15ed[_0x5869('0x19')]=qs[_0x5869('0x19')](_0x3e792a['query'][_0x5869('0x19')]);}_0x4f15ed[_0x5869('0x31')]=qs[_0x5869('0x32')](_0x3e792a['query'][_0x5869('0x32')]);_0x4f15ed[_0x5869('0x33')]=qs[_0x5869('0x2b')](_[_0x5869('0x34')](_0x3e792a['query'],_0x48539c['filters']));if(_0x3e792a[_0x5869('0x2a')][_0x5869('0x35')]){_0x4f15ed['where']=_[_0x5869('0x36')](_0x4f15ed[_0x5869('0x33')],{'$or':_[_0x5869('0x37')](_0x155bbb,function(_0x3cecbd){if(_0x3cecbd[_0x5869('0x38')][_0x5869('0x39')]!==_0x5869('0x3a')){var _0x58d44e={};_0x58d44e[_0x3cecbd[_0x5869('0x3b')]]={'$like':'%'+_0x3e792a['query'][_0x5869('0x35')]+'%'};return _0x58d44e;}})});}_0x4f15ed=_['merge']({},_0x4f15ed,_0x3e792a[_0x5869('0x3c')]);var _0x2cf649={'where':_0x4f15ed['where']};return db[_0x5869('0x26')][_0x5869('0x3d')](_0x2cf649)['then'](function(_0x3d2d95){_0x2c6822[_0x5869('0x3d')]=_0x3d2d95;if(_0x3e792a[_0x5869('0x2a')][_0x5869('0x3e')]){_0x4f15ed[_0x5869('0x3f')]=[{'all':!![]}];}return db[_0x5869('0x26')][_0x5869('0x40')](_0x4f15ed);})['then'](function(_0x5e36b2){_0x2c6822['rows']=_0x5e36b2;return _0x2c6822;})['then'](respondWithFilteredResult(_0x247b2b,_0x4f15ed))[_0x5869('0x41')](handleError(_0x247b2b,null));};exports[_0x5869('0x42')]=function(_0x1b7bd8,_0x15da14){var _0x8f9b4={'raw':![],'where':{'id':_0x1b7bd8[_0x5869('0x43')]['id']}},_0x269420={};_0x269420[_0x5869('0x28')]=_[_0x5869('0x29')](db[_0x5869('0x26')][_0x5869('0x27')]);_0x269420[_0x5869('0x2a')]=_[_0x5869('0x29')](_0x1b7bd8[_0x5869('0x2a')]);_0x269420[_0x5869('0x2b')]=_['intersection'](_0x269420[_0x5869('0x28')],_0x269420[_0x5869('0x2a')]);_0x8f9b4[_0x5869('0x2c')]=_[_0x5869('0x44')](_0x269420[_0x5869('0x28')],qs[_0x5869('0x2d')](_0x1b7bd8[_0x5869('0x2a')][_0x5869('0x2d')]));_0x8f9b4[_0x5869('0x2c')]=_0x8f9b4[_0x5869('0x2c')][_0x5869('0x2e')]?_0x8f9b4[_0x5869('0x2c')]:_0x269420[_0x5869('0x28')];if(_0x1b7bd8[_0x5869('0x2a')][_0x5869('0x3e')]){_0x8f9b4[_0x5869('0x3f')]=[{'all':!![]}];}_0x8f9b4=_[_0x5869('0x36')]({},_0x8f9b4,_0x1b7bd8['options']);return db['Integration'][_0x5869('0x45')](_0x8f9b4)[_0x5869('0x21')](handleEntityNotFound(_0x15da14,null))[_0x5869('0x21')](respondWithResult(_0x15da14,null))[_0x5869('0x41')](handleError(_0x15da14,null));};exports[_0x5869('0x46')]=function(_0x1682e6,_0x2f739f){return db['Integration'][_0x5869('0x46')](_0x1682e6['body'],{})[_0x5869('0x21')](respondWithResult(_0x2f739f,0xc9))[_0x5869('0x41')](handleError(_0x2f739f,null));};exports[_0x5869('0x47')]=function(_0x3d9d3f,_0x24d5f0){if(_0x3d9d3f[_0x5869('0x48')]['id']){delete _0x3d9d3f[_0x5869('0x48')]['id'];}return db[_0x5869('0x26')][_0x5869('0x45')]({'where':{'id':_0x3d9d3f[_0x5869('0x43')]['id']}})['then'](handleEntityNotFound(_0x24d5f0,null))[_0x5869('0x21')](saveUpdates(_0x3d9d3f[_0x5869('0x48')],null))[_0x5869('0x21')](respondWithResult(_0x24d5f0,null))[_0x5869('0x41')](handleError(_0x24d5f0,null));};exports['destroy']=function(_0x15d2c4,_0x28d5c4){return db['Integration'][_0x5869('0x45')]({'where':{'id':_0x15d2c4[_0x5869('0x43')]['id']}})[_0x5869('0x21')](handleEntityNotFound(_0x28d5c4,null))[_0x5869('0x21')](removeEntity(_0x28d5c4,null))[_0x5869('0x41')](handleError(_0x28d5c4,null));}; \ No newline at end of file +var _0x089f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','key','field','merge','options','Integration','count','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf'];(function(_0x161430,_0x1070e4){var _0x3dc170=function(_0x1a6463){while(--_0x1a6463){_0x161430['push'](_0x161430['shift']());}};_0x3dc170(++_0x1070e4);}(_0x089f,0x153));var _0xf089=function(_0x44a456,_0xd682aa){_0x44a456=_0x44a456-0x0;var _0x552d92=_0x089f[_0x44a456];return _0x552d92;};'use strict';var pdf=require(_0xf089('0x0'));var emlformat=require(_0xf089('0x1'));var rimraf=require(_0xf089('0x2'));var zipdir=require(_0xf089('0x3'));var jsonpatch=require(_0xf089('0x4'));var rp=require(_0xf089('0x5'));var moment=require('moment');var BPromise=require(_0xf089('0x6'));var Mustache=require('mustache');var util=require(_0xf089('0x7'));var path=require(_0xf089('0x8'));var sox=require(_0xf089('0x9'));var csv=require('to-csv');var ejs=require(_0xf089('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf089('0xb'));var jsforce=require(_0xf089('0xc'));var deskjs=require(_0xf089('0xd'));var toCsv=require(_0xf089('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf089('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf089('0x10'));var logger=require(_0xf089('0x11'))('api');var utils=require(_0xf089('0x12'));var config=require(_0xf089('0x13'));var db=require(_0xf089('0x14'))['db'];function respondWithStatusCode(_0x3658ac,_0x4c8c9b){_0x4c8c9b=_0x4c8c9b||0xcc;return function(_0x560d00){if(_0x560d00){return _0x3658ac[_0xf089('0x15')](_0x4c8c9b);}return _0x3658ac[_0xf089('0x16')](_0x4c8c9b)[_0xf089('0x17')]();};}function respondWithResult(_0x36a1f0,_0x53c67a){_0x53c67a=_0x53c67a||0xc8;return function(_0x56629c){if(_0x56629c){return _0x36a1f0['status'](_0x53c67a)['json'](_0x56629c);}};}function respondWithFilteredResult(_0x3bef91,_0x355477){return function(_0xe30189){if(_0xe30189){var _0x5165cb=_0xe30189['count'],_0x3f6f1b=_0x355477[_0xf089('0x18')],_0x4865ac=_0x355477[_0xf089('0x18')]+_0x355477['limit'],_0x51a4dd;if(_0x4865ac>=_0x5165cb){_0x4865ac=_0x5165cb;_0x51a4dd=0xc8;}else{_0x51a4dd=0xce;}_0x3bef91[_0xf089('0x16')](_0x51a4dd);return _0x3bef91['set'](_0xf089('0x19'),_0x3f6f1b+'-'+_0x4865ac+'/'+_0x5165cb)[_0xf089('0x1a')](_0xe30189);}return null;};}function patchUpdates(_0x2d23b0){return function(_0x5f4dfe){try{jsonpatch[_0xf089('0x1b')](_0x5f4dfe,_0x2d23b0,!![]);}catch(_0x4d6007){return BPromise[_0xf089('0x1c')](_0x4d6007);}return _0x5f4dfe[_0xf089('0x1d')]();};}function saveUpdates(_0x30c5af,_0x292802){return function(_0x36d9b1){if(_0x36d9b1){return _0x36d9b1[_0xf089('0x1e')](_0x30c5af)[_0xf089('0x1f')](function(_0xd46f08){return _0xd46f08;});}return null;};}function removeEntity(_0x5228b0,_0x5d27e4){return function(_0x14f7a2){if(_0x14f7a2){return _0x14f7a2['destroy']()[_0xf089('0x1f')](function(){_0x5228b0[_0xf089('0x16')](0xcc)[_0xf089('0x17')]();});}};}function handleEntityNotFound(_0x41e6d6,_0x524638){return function(_0x145439){if(!_0x145439){_0x41e6d6[_0xf089('0x15')](0x194);}return _0x145439;};}function handleError(_0x127e5f,_0x29a1e9){_0x29a1e9=_0x29a1e9||0x1f4;return function(_0xf014a0){logger[_0xf089('0x20')](_0xf014a0[_0xf089('0x21')]);if(_0xf014a0[_0xf089('0x22')]){delete _0xf014a0['name'];}_0x127e5f['status'](_0x29a1e9)[_0xf089('0x23')](_0xf014a0);};}exports[_0xf089('0x24')]=function(_0xade75e,_0x109c31){var _0x2f97ce={},_0x442282={},_0x4c7ef3={'count':0x0,'rows':[]};var _0x213612=db['Integration'][_0xf089('0x25')];_0x442282[_0xf089('0x26')]=_[_0xf089('0x27')](_0x213612);_0x442282['query']=_['keys'](_0xade75e[_0xf089('0x28')]);_0x442282[_0xf089('0x29')]=_['intersection'](_0x442282[_0xf089('0x26')],_0x442282[_0xf089('0x28')]);_0x2f97ce[_0xf089('0x2a')]=_[_0xf089('0x2b')](_0x442282[_0xf089('0x26')],qs['fields'](_0xade75e[_0xf089('0x28')][_0xf089('0x2c')]));_0x2f97ce[_0xf089('0x2a')]=_0x2f97ce[_0xf089('0x2a')][_0xf089('0x2d')]?_0x2f97ce[_0xf089('0x2a')]:_0x442282[_0xf089('0x26')];if(!_0xade75e[_0xf089('0x28')][_0xf089('0x2e')](_0xf089('0x2f'))){_0x2f97ce['limit']=qs[_0xf089('0x30')](_0xade75e[_0xf089('0x28')]['limit']);_0x2f97ce['offset']=qs[_0xf089('0x18')](_0xade75e[_0xf089('0x28')][_0xf089('0x18')]);}_0x2f97ce['order']=qs[_0xf089('0x31')](_0xade75e[_0xf089('0x28')][_0xf089('0x31')]);_0x2f97ce['where']=qs['filters'](_[_0xf089('0x32')](_0xade75e['query'],_0x442282['filters']));if(_0xade75e[_0xf089('0x28')][_0xf089('0x33')]){_0x2f97ce[_0xf089('0x34')]=_['merge'](_0x2f97ce[_0xf089('0x34')],{'$or':_['map'](_0x213612,function(_0x42cc42){if(_0x42cc42['type'][_0xf089('0x35')]!=='VIRTUAL'){var _0x1cb513={};_0x1cb513[_0x42cc42[_0xf089('0x36')]]={'$like':'%'+_0xade75e[_0xf089('0x28')][_0xf089('0x33')]+'%'};return _0x1cb513;}})});}_0x2f97ce=_[_0xf089('0x37')]({},_0x2f97ce,_0xade75e[_0xf089('0x38')]);var _0x1880de={'where':_0x2f97ce['where']};return db[_0xf089('0x39')][_0xf089('0x3a')](_0x1880de)[_0xf089('0x1f')](function(_0x5df809){_0x4c7ef3[_0xf089('0x3a')]=_0x5df809;if(_0xade75e[_0xf089('0x28')][_0xf089('0x3b')]){_0x2f97ce[_0xf089('0x3c')]=[{'all':!![]}];}return db['Integration'][_0xf089('0x3d')](_0x2f97ce);})['then'](function(_0x9a36e8){_0x4c7ef3['rows']=_0x9a36e8;return _0x4c7ef3;})['then'](respondWithFilteredResult(_0x109c31,_0x2f97ce))[_0xf089('0x3e')](handleError(_0x109c31,null));};exports[_0xf089('0x3f')]=function(_0x54de36,_0x32893b){var _0x3afef0={'raw':![],'where':{'id':_0x54de36[_0xf089('0x40')]['id']}},_0x4e58aa={};_0x4e58aa[_0xf089('0x26')]=_[_0xf089('0x27')](db['Integration'][_0xf089('0x25')]);_0x4e58aa[_0xf089('0x28')]=_['keys'](_0x54de36[_0xf089('0x28')]);_0x4e58aa[_0xf089('0x29')]=_[_0xf089('0x2b')](_0x4e58aa[_0xf089('0x26')],_0x4e58aa[_0xf089('0x28')]);_0x3afef0[_0xf089('0x2a')]=_[_0xf089('0x2b')](_0x4e58aa[_0xf089('0x26')],qs[_0xf089('0x2c')](_0x54de36[_0xf089('0x28')][_0xf089('0x2c')]));_0x3afef0[_0xf089('0x2a')]=_0x3afef0['attributes'][_0xf089('0x2d')]?_0x3afef0[_0xf089('0x2a')]:_0x4e58aa[_0xf089('0x26')];if(_0x54de36[_0xf089('0x28')][_0xf089('0x3b')]){_0x3afef0[_0xf089('0x3c')]=[{'all':!![]}];}_0x3afef0=_[_0xf089('0x37')]({},_0x3afef0,_0x54de36[_0xf089('0x38')]);return db[_0xf089('0x39')][_0xf089('0x41')](_0x3afef0)[_0xf089('0x1f')](handleEntityNotFound(_0x32893b,null))['then'](respondWithResult(_0x32893b,null))[_0xf089('0x3e')](handleError(_0x32893b,null));};exports[_0xf089('0x42')]=function(_0x24ee87,_0x13598a){return db[_0xf089('0x39')][_0xf089('0x42')](_0x24ee87[_0xf089('0x43')],{})['then'](respondWithResult(_0x13598a,0xc9))[_0xf089('0x3e')](handleError(_0x13598a,null));};exports[_0xf089('0x1e')]=function(_0x3b5d3c,_0x220bf3){if(_0x3b5d3c['body']['id']){delete _0x3b5d3c[_0xf089('0x43')]['id'];}return db['Integration'][_0xf089('0x41')]({'where':{'id':_0x3b5d3c[_0xf089('0x40')]['id']}})[_0xf089('0x1f')](handleEntityNotFound(_0x220bf3,null))[_0xf089('0x1f')](saveUpdates(_0x3b5d3c['body'],null))[_0xf089('0x1f')](respondWithResult(_0x220bf3,null))[_0xf089('0x3e')](handleError(_0x220bf3,null));};exports['destroy']=function(_0x426a0a,_0x18a199){return db['Integration']['find']({'where':{'id':_0x426a0a['params']['id']}})[_0xf089('0x1f')](handleEntityNotFound(_0x18a199,null))[_0xf089('0x1f')](removeEntity(_0x18a199,null))[_0xf089('0x3e')](handleError(_0x18a199,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index e37d730..580eaa2 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 _0x4f30=['integrations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration'];(function(_0x28837b,_0x4c8475){var _0x2dce86=function(_0x57d46a){while(--_0x57d46a){_0x28837b['push'](_0x28837b['shift']());}};_0x2dce86(++_0x4c8475);}(_0x4f30,0x16d));var _0x04f3=function(_0x3469a3,_0x3df011){_0x3469a3=_0x3469a3-0x0;var _0x17b3f5=_0x4f30[_0x3469a3];return _0x17b3f5;};'use strict';var _=require(_0x04f3('0x0'));var util=require(_0x04f3('0x1'));var logger=require('../../config/logger')(_0x04f3('0x2'));var moment=require(_0x04f3('0x3'));var BPromise=require(_0x04f3('0x4'));var rp=require(_0x04f3('0x5'));var fs=require('fs');var path=require(_0x04f3('0x6'));var rimraf=require(_0x04f3('0x7'));var config=require(_0x04f3('0x8'));var attributes=require(_0x04f3('0x9'));module[_0x04f3('0xa')]=function(_0x362a29,_0xc8caae){return _0x362a29['define'](_0x04f3('0xb'),attributes,{'tableName':_0x04f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeebb=['define','Integration','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x52a858,_0x1df8ea){var _0x247399=function(_0x398b94){while(--_0x398b94){_0x52a858['push'](_0x52a858['shift']());}};_0x247399(++_0x1df8ea);}(_0xeebb,0xca));var _0xbeeb=function(_0x1c93c0,_0x348942){_0x1c93c0=_0x1c93c0-0x0;var _0x2614ee=_0xeebb[_0x1c93c0];return _0x2614ee;};'use strict';var _=require(_0xbeeb('0x0'));var util=require('util');var logger=require(_0xbeeb('0x1'))('api');var moment=require(_0xbeeb('0x2'));var BPromise=require(_0xbeeb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeeb('0x4'));var rimraf=require(_0xbeeb('0x5'));var config=require(_0xbeeb('0x6'));var attributes=require(_0xbeeb('0x7'));module['exports']=function(_0x2ba5f8,_0x25d64c){return _0x2ba5f8[_0xbeeb('0x8')](_0xbeeb('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 41eaee1..8971b85 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 _0x021a=['rpc','../../config/environment','client','http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x699072,_0x3aca68){var _0x44edc2=function(_0x3c1e8b){while(--_0x3c1e8b){_0x699072['push'](_0x699072['shift']());}};_0x44edc2(++_0x3aca68);}(_0x021a,0x118));var _0xa021=function(_0x52c7f4,_0x2b3ad5){_0x52c7f4=_0x52c7f4-0x0;var _0x513d5b=_0x021a[_0x52c7f4];return _0x513d5b;};'use strict';var _=require(_0xa021('0x0'));var util=require(_0xa021('0x1'));var moment=require(_0xa021('0x2'));var BPromise=require(_0xa021('0x3'));var rs=require(_0xa021('0x4'));var fs=require('fs');var Redis=require(_0xa021('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa021('0x6'));var logger=require(_0xa021('0x7'))(_0xa021('0x8'));var config=require(_0xa021('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa021('0xa')][_0xa021('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523e8e,_0xe6b6b2,_0x3fbe73){return new BPromise(function(_0x36638e,_0x2924b4){return client[_0xa021('0xc')](_0x523e8e,_0x3fbe73)[_0xa021('0xd')](function(_0x4280ee){logger[_0xa021('0xe')](_0xa021('0xf'),_0xe6b6b2,'request\x20sent');logger[_0xa021('0x10')](_0xa021('0x11'),_0xe6b6b2,'request\x20sent',JSON[_0xa021('0x12')](_0x4280ee));if(_0x4280ee['error']){if(_0x4280ee[_0xa021('0x13')]['code']===0x1f4){logger[_0xa021('0x13')]('Integration,\x20%s,\x20%s',_0xe6b6b2,_0x4280ee[_0xa021('0x13')][_0xa021('0x14')]);return _0x2924b4(_0x4280ee[_0xa021('0x13')][_0xa021('0x14')]);}logger[_0xa021('0x13')](_0xa021('0xf'),_0xe6b6b2,_0x4280ee[_0xa021('0x13')][_0xa021('0x14')]);return _0x36638e(_0x4280ee[_0xa021('0x13')]['message']);}else{logger['info'](_0xa021('0xf'),_0xe6b6b2,_0xa021('0x15'));_0x36638e(_0x4280ee[_0xa021('0x16')]['message']);}})[_0xa021('0x17')](function(_0x5d9261){logger['error'](_0xa021('0xf'),_0xe6b6b2,_0x5d9261);_0x2924b4(_0x5d9261);});});} \ No newline at end of file +var _0xe814=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x452e8b,_0x36572e){var _0x22cb8d=function(_0x37e18e){while(--_0x37e18e){_0x452e8b['push'](_0x452e8b['shift']());}};_0x22cb8d(++_0x36572e);}(_0xe814,0x1f1));var _0x4e81=function(_0x39ded9,_0x53b4ef){_0x39ded9=_0x39ded9-0x0;var _0x21b451=_0xe814[_0x39ded9];return _0x21b451;};'use strict';var _=require(_0x4e81('0x0'));var util=require(_0x4e81('0x1'));var moment=require(_0x4e81('0x2'));var BPromise=require(_0x4e81('0x3'));var rs=require(_0x4e81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e81('0x5'))['db'];var utils=require(_0x4e81('0x6'));var logger=require(_0x4e81('0x7'))(_0x4e81('0x8'));var config=require(_0x4e81('0x9'));var jayson=require(_0x4e81('0xa'));var client=jayson['client'][_0x4e81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36add1,_0x6d2161,_0x5b039f){return new BPromise(function(_0x33b597,_0xaff57b){return client[_0x4e81('0xc')](_0x36add1,_0x5b039f)[_0x4e81('0xd')](function(_0x22afa0){logger['info'](_0x4e81('0xe'),_0x6d2161,_0x4e81('0xf'));logger[_0x4e81('0x10')](_0x4e81('0x11'),_0x6d2161,_0x4e81('0xf'),JSON[_0x4e81('0x12')](_0x22afa0));if(_0x22afa0[_0x4e81('0x13')]){if(_0x22afa0[_0x4e81('0x13')][_0x4e81('0x14')]===0x1f4){logger['error'](_0x4e81('0xe'),_0x6d2161,_0x22afa0[_0x4e81('0x13')][_0x4e81('0x15')]);return _0xaff57b(_0x22afa0[_0x4e81('0x13')][_0x4e81('0x15')]);}logger['error'](_0x4e81('0xe'),_0x6d2161,_0x22afa0[_0x4e81('0x13')][_0x4e81('0x15')]);return _0x33b597(_0x22afa0[_0x4e81('0x13')]['message']);}else{logger[_0x4e81('0x16')](_0x4e81('0xe'),_0x6d2161,_0x4e81('0xf'));_0x33b597(_0x22afa0['result']['message']);}})[_0x4e81('0x17')](function(_0x1d8989){logger['error']('Integration,\x20%s,\x20%s',_0x6d2161,_0x1d8989);_0xaff57b(_0x1d8989);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9ad2cec..0eeb035 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 _0x9034=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9034,0x178));var _0x4903=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9034[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x4903('0x0'));var util=require('util');var path=require(_0x4903('0x1'));var timeout=require(_0x4903('0x2'));var express=require(_0x4903('0x3'));var router=express[_0x4903('0x4')]();var auth=require(_0x4903('0x5'));var interaction=require(_0x4903('0x6'));var config=require(_0x4903('0x7'));var controller=require('./integrationReport.controller');router[_0x4903('0x8')]('/',auth[_0x4903('0x9')](),controller[_0x4903('0xa')]);router[_0x4903('0x8')](_0x4903('0xb'),auth[_0x4903('0x9')](),controller['describe']);router[_0x4903('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4903('0xc')]);router['post']('/',auth[_0x4903('0x9')](),controller[_0x4903('0xd')]);router[_0x4903('0xe')]('/:id',auth[_0x4903('0x9')](),controller[_0x4903('0xf')]);router[_0x4903('0x10')](_0x4903('0x11'),auth[_0x4903('0x9')](),controller[_0x4903('0x12')]);module[_0x4903('0x13')]=router; \ No newline at end of file +var _0x6944=['express','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x13dca4,_0x67b5a6){var _0x519e1b=function(_0x5dbdc1){while(--_0x5dbdc1){_0x13dca4['push'](_0x13dca4['shift']());}};_0x519e1b(++_0x67b5a6);}(_0x6944,0xe6));var _0x4694=function(_0x1d2c24,_0x5774ae){_0x1d2c24=_0x1d2c24-0x0;var _0x2a8f32=_0x6944[_0x1d2c24];return _0x2a8f32;};'use strict';var multer=require(_0x4694('0x0'));var util=require(_0x4694('0x1'));var path=require(_0x4694('0x2'));var timeout=require(_0x4694('0x3'));var express=require(_0x4694('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4694('0x5'));var config=require('../../config/environment');var controller=require(_0x4694('0x6'));router[_0x4694('0x7')]('/',auth[_0x4694('0x8')](),controller[_0x4694('0x9')]);router[_0x4694('0x7')](_0x4694('0xa'),auth[_0x4694('0x8')](),controller['describe']);router['get'](_0x4694('0xb'),auth[_0x4694('0x8')](),controller[_0x4694('0xc')]);router['post']('/',auth[_0x4694('0x8')](),controller[_0x4694('0xd')]);router[_0x4694('0xe')](_0x4694('0xb'),auth['isAuthenticated'](),controller[_0x4694('0xf')]);router[_0x4694('0x10')](_0x4694('0xb'),auth[_0x4694('0x8')](),controller['destroy']);module[_0x4694('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index cf1d9f8..0dfe3ad 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 _0x873c=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','sequelize','STRING'];(function(_0x1716c5,_0x53ea99){var _0x128ded=function(_0x3b1a5b){while(--_0x3b1a5b){_0x1716c5['push'](_0x1716c5['shift']());}};_0x128ded(++_0x53ea99);}(_0x873c,0x126));var _0xc873=function(_0x35350a,_0x486255){_0x35350a=_0x35350a-0x0;var _0x43601a=_0x873c[_0x35350a];return _0x43601a;};'use strict';var Sequelize=require(_0xc873('0x0'));module['exports']={'integration':{'type':Sequelize[_0xc873('0x1')]},'eventChannel':{'type':Sequelize[_0xc873('0x1')]},'exitStatus':{'type':Sequelize[_0xc873('0x1')]},'ticketId':{'type':Sequelize[_0xc873('0x1')]},'integrationId':{'type':Sequelize[_0xc873('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc873('0x1')]},'calleridnum':{'type':Sequelize[_0xc873('0x1')]},'calleridname':{'type':Sequelize[_0xc873('0x1')]},'queue':{'type':Sequelize[_0xc873('0x1')]},'interface':{'type':Sequelize[_0xc873('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc873('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc873('0x2')]},'agentcomplete':{'type':Sequelize[_0xc873('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc873('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc873('0x2')]},'reason':{'type':Sequelize[_0xc873('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xc873('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc873('0x3')]},'agentdump':{'type':Sequelize[_0xc873('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xc873('0x1')]},'channel':{'type':Sequelize[_0xc873('0x1')]},'channelstate':{'type':Sequelize[_0xc873('0x2')]},'channelstatedesc':{'type':Sequelize[_0xc873('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc873('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc873('0x1')]},'accountcode':{'type':Sequelize[_0xc873('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xc873('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc873('0x1')]},'destchannelstate':{'type':Sequelize[_0xc873('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xc873('0x1')]},'destcalleridnum':{'type':Sequelize[_0xc873('0x1')]},'destcalleridname':{'type':Sequelize[_0xc873('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xc873('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc873('0x1')]},'destlanguage':{'type':Sequelize[_0xc873('0x1')]},'destaccountcode':{'type':Sequelize[_0xc873('0x1')]},'destcontext':{'type':Sequelize[_0xc873('0x1')]},'destexten':{'type':Sequelize[_0xc873('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xc873('0x1')]},'inReplyTo':{'type':Sequelize[_0xc873('0x1')]},'subject':{'type':Sequelize[_0xc873('0x1')]},'from':{'type':Sequelize[_0xc873('0x1')]},'to':{'type':Sequelize[_0xc873('0x1')]},'cc':{'type':Sequelize[_0xc873('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xc873('0x5')]},'text':{'type':Sequelize[_0xc873('0x5')]},'status':{'type':Sequelize[_0xc873('0x6')](_0xc873('0x7'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xc873('0x1')]},'appdata':{'type':Sequelize[_0xc873('0x1')]},'projectId':{'type':Sequelize[_0xc873('0x2')]}}; \ No newline at end of file +var _0x4d76=['DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER'];(function(_0x3649e9,_0xc7494b){var _0x5f15ec=function(_0x1f296d){while(--_0x1f296d){_0x3649e9['push'](_0x3649e9['shift']());}};_0x5f15ec(++_0xc7494b);}(_0x4d76,0x1d2));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x64d7('0x0'));module[_0x64d7('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x64d7('0x2')]},'exitStatus':{'type':Sequelize[_0x64d7('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x64d7('0x3')]},'contacts':{'type':Sequelize[_0x64d7('0x2')]},'uniqueid':{'type':Sequelize[_0x64d7('0x2')]},'calleridnum':{'type':Sequelize[_0x64d7('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x64d7('0x2')]},'membername':{'type':Sequelize[_0x64d7('0x2')]},'agentcalledAt':{'type':Sequelize[_0x64d7('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x64d7('0x3')]},'agentcomplete':{'type':Sequelize[_0x64d7('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x64d7('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x64d7('0x3')]},'reason':{'type':Sequelize[_0x64d7('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x64d7('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x64d7('0x4')]},'lastevent':{'type':Sequelize[_0x64d7('0x2')]},'channel':{'type':Sequelize[_0x64d7('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x64d7('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x64d7('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x64d7('0x2')]},'context':{'type':Sequelize[_0x64d7('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x64d7('0x2')]},'destchannel':{'type':Sequelize[_0x64d7('0x2')]},'destchannelstate':{'type':Sequelize[_0x64d7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x64d7('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x64d7('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x64d7('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x64d7('0x2')]},'destcontext':{'type':Sequelize[_0x64d7('0x2')]},'destexten':{'type':Sequelize[_0x64d7('0x2')]},'destpriority':{'type':Sequelize[_0x64d7('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x64d7('0x2')]},'inReplyTo':{'type':Sequelize[_0x64d7('0x2')]},'subject':{'type':Sequelize[_0x64d7('0x2')]},'from':{'type':Sequelize[_0x64d7('0x2')]},'to':{'type':Sequelize[_0x64d7('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x64d7('0x6')]},'html':{'type':Sequelize[_0x64d7('0x6')]},'text':{'type':Sequelize[_0x64d7('0x6')]},'status':{'type':Sequelize[_0x64d7('0x7')]('SENT',_0x64d7('0x8'),_0x64d7('0x9'),'FAILED')},'url':{'type':Sequelize[_0x64d7('0x2')]},'app':{'type':Sequelize[_0x64d7('0x2')]},'appdata':{'type':Sequelize[_0x64d7('0x2')]},'projectId':{'type':Sequelize[_0x64d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 20c85f2..21518ad 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 _0x0269=['sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','findAll','catch','show','params','length','include','options','create','body','describe','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0xb866f7,_0x8cd47b){var _0x4e1950=function(_0x3c3a1c){while(--_0x3c3a1c){_0xb866f7['push'](_0xb866f7['shift']());}};_0x4e1950(++_0x8cd47b);}(_0x0269,0x135));var _0x9026=function(_0x2970b3,_0x478545){_0x2970b3=_0x2970b3-0x0;var _0x272ce1=_0x0269[_0x2970b3];return _0x272ce1;};'use strict';var pdf=require(_0x9026('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9026('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9026('0x2'));var rp=require('request-promise');var moment=require(_0x9026('0x3'));var BPromise=require(_0x9026('0x4'));var Mustache=require(_0x9026('0x5'));var util=require(_0x9026('0x6'));var path=require('path');var sox=require(_0x9026('0x7'));var csv=require(_0x9026('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9026('0x9'));var crypto=require(_0x9026('0xa'));var jsforce=require(_0x9026('0xb'));var deskjs=require(_0x9026('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9026('0xd'));var Papa=require(_0x9026('0xe'));var Redis=require(_0x9026('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9026('0x10'));var hardwareService=require(_0x9026('0x11'));var logger=require(_0x9026('0x12'))('api');var utils=require(_0x9026('0x13'));var config=require('../../config/environment');var db=require(_0x9026('0x14'))['db'];function respondWithStatusCode(_0x389f69,_0x4f4ddd){_0x4f4ddd=_0x4f4ddd||0xcc;return function(_0x2148f0){if(_0x2148f0){return _0x389f69[_0x9026('0x15')](_0x4f4ddd);}return _0x389f69[_0x9026('0x16')](_0x4f4ddd)[_0x9026('0x17')]();};}function respondWithResult(_0x51aba6,_0x1f794b){_0x1f794b=_0x1f794b||0xc8;return function(_0x4ee699){if(_0x4ee699){return _0x51aba6[_0x9026('0x16')](_0x1f794b)[_0x9026('0x18')](_0x4ee699);}};}function respondWithFilteredResult(_0xd2473f,_0xe7b66a){return function(_0x11c0d1){if(_0x11c0d1){var _0x421ee2=_0x11c0d1[_0x9026('0x19')],_0x142465=_0xe7b66a[_0x9026('0x1a')],_0x1eb679=_0xe7b66a['offset']+_0xe7b66a[_0x9026('0x1b')],_0x5d5053;if(_0x1eb679>=_0x421ee2){_0x1eb679=_0x421ee2;_0x5d5053=0xc8;}else{_0x5d5053=0xce;}_0xd2473f[_0x9026('0x16')](_0x5d5053);return _0xd2473f[_0x9026('0x1c')](_0x9026('0x1d'),_0x142465+'-'+_0x1eb679+'/'+_0x421ee2)[_0x9026('0x18')](_0x11c0d1);}return null;};}function patchUpdates(_0x3e57f7){return function(_0x42c928){try{jsonpatch[_0x9026('0x1e')](_0x42c928,_0x3e57f7,!![]);}catch(_0x52edf1){return BPromise[_0x9026('0x1f')](_0x52edf1);}return _0x42c928['save']();};}function saveUpdates(_0x2203f0,_0x5e6c46){return function(_0x2a9bf0){if(_0x2a9bf0){return _0x2a9bf0[_0x9026('0x20')](_0x2203f0)[_0x9026('0x21')](function(_0x22a77c){return _0x22a77c;});}return null;};}function removeEntity(_0xdce1d6,_0x25b9f2){return function(_0x71a263){if(_0x71a263){return _0x71a263[_0x9026('0x22')]()[_0x9026('0x21')](function(){_0xdce1d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b962,_0x134221){return function(_0x2968fb){if(!_0x2968fb){_0x7b962[_0x9026('0x15')](0x194);}return _0x2968fb;};}function handleError(_0x18279b,_0x416ed6){_0x416ed6=_0x416ed6||0x1f4;return function(_0x1c8c62){logger[_0x9026('0x23')](_0x1c8c62[_0x9026('0x24')]);if(_0x1c8c62[_0x9026('0x25')]){delete _0x1c8c62[_0x9026('0x25')];}_0x18279b[_0x9026('0x16')](_0x416ed6)[_0x9026('0x26')](_0x1c8c62);};}exports[_0x9026('0x27')]=function(_0x28dba4,_0x56c5ca){var _0x1f431b={},_0x9c5f39={},_0x2fae98={'count':0x0,'rows':[]};var _0x5d2b12=db[_0x9026('0x28')][_0x9026('0x29')];_0x9c5f39[_0x9026('0x2a')]=_[_0x9026('0x2b')](_0x5d2b12);_0x9c5f39[_0x9026('0x2c')]=_[_0x9026('0x2b')](_0x28dba4[_0x9026('0x2c')]);_0x9c5f39[_0x9026('0x2d')]=_[_0x9026('0x2e')](_0x9c5f39[_0x9026('0x2a')],_0x9c5f39[_0x9026('0x2c')]);_0x1f431b['attributes']=_[_0x9026('0x2e')](_0x9c5f39[_0x9026('0x2a')],qs[_0x9026('0x2f')](_0x28dba4[_0x9026('0x2c')][_0x9026('0x2f')]));_0x1f431b[_0x9026('0x30')]=_0x1f431b[_0x9026('0x30')]['length']?_0x1f431b[_0x9026('0x30')]:_0x9c5f39['model'];if(!_0x28dba4[_0x9026('0x2c')][_0x9026('0x31')](_0x9026('0x32'))){_0x1f431b[_0x9026('0x1b')]=qs[_0x9026('0x1b')](_0x28dba4[_0x9026('0x2c')]['limit']);_0x1f431b[_0x9026('0x1a')]=qs[_0x9026('0x1a')](_0x28dba4[_0x9026('0x2c')][_0x9026('0x1a')]);}_0x1f431b['order']=qs[_0x9026('0x33')](_0x28dba4[_0x9026('0x2c')]['sort']);_0x1f431b[_0x9026('0x34')]=qs[_0x9026('0x2d')](_[_0x9026('0x35')](_0x28dba4[_0x9026('0x2c')],_0x9c5f39[_0x9026('0x2d')]));if(_0x28dba4[_0x9026('0x2c')][_0x9026('0x36')]){_0x1f431b[_0x9026('0x34')]=_['merge'](_0x1f431b[_0x9026('0x34')],{'$or':_[_0x9026('0x37')](_0x5d2b12,function(_0x4a2654){if(_0x4a2654[_0x9026('0x38')][_0x9026('0x39')]!==_0x9026('0x3a')){var _0xf44a47={};_0xf44a47[_0x4a2654[_0x9026('0x3b')]]={'$like':'%'+_0x28dba4[_0x9026('0x2c')][_0x9026('0x36')]+'%'};return _0xf44a47;}})});}_0x1f431b=_[_0x9026('0x3c')]({},_0x1f431b,_0x28dba4['options']);var _0x9c46ba={'where':_0x1f431b[_0x9026('0x34')]};return db[_0x9026('0x28')][_0x9026('0x19')](_0x9c46ba)[_0x9026('0x21')](function(_0x1c2e08){_0x2fae98[_0x9026('0x19')]=_0x1c2e08;if(_0x28dba4['query'][_0x9026('0x3d')]){_0x1f431b['include']=[{'all':!![]}];}return db[_0x9026('0x28')][_0x9026('0x3e')](_0x1f431b);})[_0x9026('0x21')](function(_0x3e106a){_0x2fae98['rows']=_0x3e106a;return _0x2fae98;})['then'](respondWithFilteredResult(_0x56c5ca,_0x1f431b))[_0x9026('0x3f')](handleError(_0x56c5ca,null));};exports[_0x9026('0x40')]=function(_0x51e719,_0x5a66c5){var _0x4a4d25={'raw':![],'where':{'id':_0x51e719[_0x9026('0x41')]['id']}},_0x18272e={};_0x18272e['model']=_[_0x9026('0x2b')](db[_0x9026('0x28')][_0x9026('0x29')]);_0x18272e[_0x9026('0x2c')]=_[_0x9026('0x2b')](_0x51e719[_0x9026('0x2c')]);_0x18272e[_0x9026('0x2d')]=_[_0x9026('0x2e')](_0x18272e['model'],_0x18272e[_0x9026('0x2c')]);_0x4a4d25[_0x9026('0x30')]=_['intersection'](_0x18272e['model'],qs['fields'](_0x51e719[_0x9026('0x2c')][_0x9026('0x2f')]));_0x4a4d25[_0x9026('0x30')]=_0x4a4d25[_0x9026('0x30')][_0x9026('0x42')]?_0x4a4d25['attributes']:_0x18272e[_0x9026('0x2a')];if(_0x51e719['query'][_0x9026('0x3d')]){_0x4a4d25[_0x9026('0x43')]=[{'all':!![]}];}_0x4a4d25=_[_0x9026('0x3c')]({},_0x4a4d25,_0x51e719[_0x9026('0x44')]);return db['IntegrationReport']['find'](_0x4a4d25)[_0x9026('0x21')](handleEntityNotFound(_0x5a66c5,null))[_0x9026('0x21')](respondWithResult(_0x5a66c5,null))[_0x9026('0x3f')](handleError(_0x5a66c5,null));};exports[_0x9026('0x45')]=function(_0xfba7f4,_0x352b2c){return db['IntegrationReport'][_0x9026('0x45')](_0xfba7f4['body'],{})[_0x9026('0x21')](respondWithResult(_0x352b2c,0xc9))[_0x9026('0x3f')](handleError(_0x352b2c,null));};exports['update']=function(_0x29e091,_0x4dfc21){if(_0x29e091[_0x9026('0x46')]['id']){delete _0x29e091['body']['id'];}return db[_0x9026('0x28')]['find']({'where':{'id':_0x29e091['params']['id']}})[_0x9026('0x21')](handleEntityNotFound(_0x4dfc21,null))[_0x9026('0x21')](saveUpdates(_0x29e091[_0x9026('0x46')],null))['then'](respondWithResult(_0x4dfc21,null))[_0x9026('0x3f')](handleError(_0x4dfc21,null));};exports[_0x9026('0x22')]=function(_0x446cd0,_0x442e5a){return db[_0x9026('0x28')]['find']({'where':{'id':_0x446cd0[_0x9026('0x41')]['id']}})[_0x9026('0x21')](handleEntityNotFound(_0x442e5a,null))[_0x9026('0x21')](removeEntity(_0x442e5a,null))[_0x9026('0x3f')](handleError(_0x442e5a,null));};exports[_0x9026('0x47')]=function(_0x16e09d,_0x49a390){return db[_0x9026('0x28')]['describe']()[_0x9026('0x21')](respondWithResult(_0x49a390,null))[_0x9026('0x3f')](handleError(_0x49a390,null));}; \ No newline at end of file +var _0xbc6f=['merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','keys','length','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','apply','reject','save','update','then','error','name','IntegrationReport','rawAttributes','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter'];(function(_0x50edc5,_0x398cab){var _0x514768=function(_0x1ec14d){while(--_0x1ec14d){_0x50edc5['push'](_0x50edc5['shift']());}};_0x514768(++_0x398cab);}(_0xbc6f,0x127));var _0xfbc6=function(_0x3a10b6,_0x3181f0){_0x3a10b6=_0x3a10b6-0x0;var _0x463dc3=_0xbc6f[_0x3a10b6];return _0x463dc3;};'use strict';var pdf=require(_0xfbc6('0x0'));var emlformat=require(_0xfbc6('0x1'));var rimraf=require(_0xfbc6('0x2'));var zipdir=require(_0xfbc6('0x3'));var jsonpatch=require(_0xfbc6('0x4'));var rp=require(_0xfbc6('0x5'));var moment=require(_0xfbc6('0x6'));var BPromise=require(_0xfbc6('0x7'));var Mustache=require('mustache');var util=require(_0xfbc6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfbc6('0x9'));var ejs=require(_0xfbc6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfbc6('0xb'));var crypto=require(_0xfbc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfbc6('0xd'));var toCsv=require(_0xfbc6('0x9'));var querystring=require(_0xfbc6('0xe'));var Papa=require('papaparse');var Redis=require(_0xfbc6('0xf'));var authService=require(_0xfbc6('0x10'));var qs=require(_0xfbc6('0x11'));var hardwareService=require(_0xfbc6('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfbc6('0x13'));var config=require(_0xfbc6('0x14'));var db=require(_0xfbc6('0x15'))['db'];function respondWithStatusCode(_0x16ebfa,_0x580d8e){_0x580d8e=_0x580d8e||0xcc;return function(_0x266b26){if(_0x266b26){return _0x16ebfa[_0xfbc6('0x16')](_0x580d8e);}return _0x16ebfa[_0xfbc6('0x17')](_0x580d8e)[_0xfbc6('0x18')]();};}function respondWithResult(_0x2183f9,_0x667f51){_0x667f51=_0x667f51||0xc8;return function(_0x39efba){if(_0x39efba){return _0x2183f9[_0xfbc6('0x17')](_0x667f51)['json'](_0x39efba);}};}function respondWithFilteredResult(_0x11bbae,_0x36a555){return function(_0x3721c7){if(_0x3721c7){var _0x5212da=_0x3721c7[_0xfbc6('0x19')],_0x152d3d=_0x36a555[_0xfbc6('0x1a')],_0x3e6cd5=_0x36a555['offset']+_0x36a555['limit'],_0x4011a3;if(_0x3e6cd5>=_0x5212da){_0x3e6cd5=_0x5212da;_0x4011a3=0xc8;}else{_0x4011a3=0xce;}_0x11bbae[_0xfbc6('0x17')](_0x4011a3);return _0x11bbae[_0xfbc6('0x1b')]('Content-Range',_0x152d3d+'-'+_0x3e6cd5+'/'+_0x5212da)['json'](_0x3721c7);}return null;};}function patchUpdates(_0x25cf81){return function(_0x25ede5){try{jsonpatch[_0xfbc6('0x1c')](_0x25ede5,_0x25cf81,!![]);}catch(_0x514b12){return BPromise[_0xfbc6('0x1d')](_0x514b12);}return _0x25ede5[_0xfbc6('0x1e')]();};}function saveUpdates(_0x32f82e,_0x52396e){return function(_0x52c6fe){if(_0x52c6fe){return _0x52c6fe[_0xfbc6('0x1f')](_0x32f82e)[_0xfbc6('0x20')](function(_0x4a1927){return _0x4a1927;});}return null;};}function removeEntity(_0x245073,_0x1c7720){return function(_0x4ba737){if(_0x4ba737){return _0x4ba737['destroy']()['then'](function(){_0x245073[_0xfbc6('0x17')](0xcc)[_0xfbc6('0x18')]();});}};}function handleEntityNotFound(_0x59d74a,_0x94aa88){return function(_0x3bca40){if(!_0x3bca40){_0x59d74a[_0xfbc6('0x16')](0x194);}return _0x3bca40;};}function handleError(_0x3d05e8,_0x2d48b5){_0x2d48b5=_0x2d48b5||0x1f4;return function(_0x575d1a){logger[_0xfbc6('0x21')](_0x575d1a['stack']);if(_0x575d1a[_0xfbc6('0x22')]){delete _0x575d1a['name'];}_0x3d05e8[_0xfbc6('0x17')](_0x2d48b5)['send'](_0x575d1a);};}exports['index']=function(_0x475b2e,_0x47fa75){var _0x2753f0={},_0x4c0b60={},_0x37c3d3={'count':0x0,'rows':[]};var _0x482bec=db[_0xfbc6('0x23')][_0xfbc6('0x24')];_0x4c0b60['model']=_['keys'](_0x482bec);_0x4c0b60['query']=_['keys'](_0x475b2e[_0xfbc6('0x25')]);_0x4c0b60[_0xfbc6('0x26')]=_[_0xfbc6('0x27')](_0x4c0b60['model'],_0x4c0b60[_0xfbc6('0x25')]);_0x2753f0[_0xfbc6('0x28')]=_['intersection'](_0x4c0b60[_0xfbc6('0x29')],qs[_0xfbc6('0x2a')](_0x475b2e[_0xfbc6('0x25')][_0xfbc6('0x2a')]));_0x2753f0['attributes']=_0x2753f0[_0xfbc6('0x28')]['length']?_0x2753f0[_0xfbc6('0x28')]:_0x4c0b60[_0xfbc6('0x29')];if(!_0x475b2e['query'][_0xfbc6('0x2b')](_0xfbc6('0x2c'))){_0x2753f0[_0xfbc6('0x2d')]=qs[_0xfbc6('0x2d')](_0x475b2e[_0xfbc6('0x25')][_0xfbc6('0x2d')]);_0x2753f0[_0xfbc6('0x1a')]=qs['offset'](_0x475b2e[_0xfbc6('0x25')][_0xfbc6('0x1a')]);}_0x2753f0['order']=qs[_0xfbc6('0x2e')](_0x475b2e[_0xfbc6('0x25')]['sort']);_0x2753f0[_0xfbc6('0x2f')]=qs[_0xfbc6('0x26')](_[_0xfbc6('0x30')](_0x475b2e[_0xfbc6('0x25')],_0x4c0b60['filters']));if(_0x475b2e[_0xfbc6('0x25')][_0xfbc6('0x31')]){_0x2753f0['where']=_[_0xfbc6('0x32')](_0x2753f0[_0xfbc6('0x2f')],{'$or':_[_0xfbc6('0x33')](_0x482bec,function(_0x25b302){if(_0x25b302[_0xfbc6('0x34')]['key']!==_0xfbc6('0x35')){var _0x264541={};_0x264541[_0x25b302[_0xfbc6('0x36')]]={'$like':'%'+_0x475b2e['query'][_0xfbc6('0x31')]+'%'};return _0x264541;}})});}_0x2753f0=_[_0xfbc6('0x32')]({},_0x2753f0,_0x475b2e[_0xfbc6('0x37')]);var _0x2dbb48={'where':_0x2753f0['where']};return db[_0xfbc6('0x23')][_0xfbc6('0x19')](_0x2dbb48)[_0xfbc6('0x20')](function(_0xd18ec3){_0x37c3d3[_0xfbc6('0x19')]=_0xd18ec3;if(_0x475b2e[_0xfbc6('0x25')][_0xfbc6('0x38')]){_0x2753f0['include']=[{'all':!![]}];}return db[_0xfbc6('0x23')][_0xfbc6('0x39')](_0x2753f0);})[_0xfbc6('0x20')](function(_0xe540df){_0x37c3d3[_0xfbc6('0x3a')]=_0xe540df;return _0x37c3d3;})[_0xfbc6('0x20')](respondWithFilteredResult(_0x47fa75,_0x2753f0))[_0xfbc6('0x3b')](handleError(_0x47fa75,null));};exports[_0xfbc6('0x3c')]=function(_0x3d5c0a,_0x5c2e97){var _0x24b296={'raw':![],'where':{'id':_0x3d5c0a['params']['id']}},_0x4ae754={};_0x4ae754[_0xfbc6('0x29')]=_[_0xfbc6('0x3d')](db['IntegrationReport']['rawAttributes']);_0x4ae754[_0xfbc6('0x25')]=_[_0xfbc6('0x3d')](_0x3d5c0a[_0xfbc6('0x25')]);_0x4ae754[_0xfbc6('0x26')]=_[_0xfbc6('0x27')](_0x4ae754[_0xfbc6('0x29')],_0x4ae754[_0xfbc6('0x25')]);_0x24b296[_0xfbc6('0x28')]=_[_0xfbc6('0x27')](_0x4ae754['model'],qs[_0xfbc6('0x2a')](_0x3d5c0a[_0xfbc6('0x25')][_0xfbc6('0x2a')]));_0x24b296[_0xfbc6('0x28')]=_0x24b296[_0xfbc6('0x28')][_0xfbc6('0x3e')]?_0x24b296['attributes']:_0x4ae754[_0xfbc6('0x29')];if(_0x3d5c0a['query'][_0xfbc6('0x38')]){_0x24b296['include']=[{'all':!![]}];}_0x24b296=_[_0xfbc6('0x32')]({},_0x24b296,_0x3d5c0a[_0xfbc6('0x37')]);return db[_0xfbc6('0x23')][_0xfbc6('0x3f')](_0x24b296)[_0xfbc6('0x20')](handleEntityNotFound(_0x5c2e97,null))[_0xfbc6('0x20')](respondWithResult(_0x5c2e97,null))[_0xfbc6('0x3b')](handleError(_0x5c2e97,null));};exports[_0xfbc6('0x40')]=function(_0x4e234b,_0x32b755){return db[_0xfbc6('0x23')][_0xfbc6('0x40')](_0x4e234b[_0xfbc6('0x41')],{})[_0xfbc6('0x20')](respondWithResult(_0x32b755,0xc9))['catch'](handleError(_0x32b755,null));};exports['update']=function(_0x22dd74,_0xc4af57){if(_0x22dd74[_0xfbc6('0x41')]['id']){delete _0x22dd74['body']['id'];}return db['IntegrationReport'][_0xfbc6('0x3f')]({'where':{'id':_0x22dd74[_0xfbc6('0x42')]['id']}})[_0xfbc6('0x20')](handleEntityNotFound(_0xc4af57,null))[_0xfbc6('0x20')](saveUpdates(_0x22dd74[_0xfbc6('0x41')],null))[_0xfbc6('0x20')](respondWithResult(_0xc4af57,null))[_0xfbc6('0x3b')](handleError(_0xc4af57,null));};exports[_0xfbc6('0x43')]=function(_0x1bfc78,_0x324c44){return db[_0xfbc6('0x23')][_0xfbc6('0x3f')]({'where':{'id':_0x1bfc78[_0xfbc6('0x42')]['id']}})['then'](handleEntityNotFound(_0x324c44,null))[_0xfbc6('0x20')](removeEntity(_0x324c44,null))[_0xfbc6('0x3b')](handleError(_0x324c44,null));};exports[_0xfbc6('0x44')]=function(_0x75c02c,_0x55749b){return db['IntegrationReport'][_0xfbc6('0x44')]()[_0xfbc6('0x20')](respondWithResult(_0x55749b,null))[_0xfbc6('0x3b')](handleError(_0x55749b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d62163a..c3f1656 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 _0x7c09=['rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x25a59e,_0xd717c4){var _0x1f6c50=function(_0xfe0a85){while(--_0xfe0a85){_0x25a59e['push'](_0x25a59e['shift']());}};_0x1f6c50(++_0xd717c4);}(_0x7c09,0x102));var _0x97c0=function(_0x27a6bd,_0x20ce9f){_0x27a6bd=_0x27a6bd-0x0;var _0x279144=_0x7c09[_0x27a6bd];return _0x279144;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1f6=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x407780,_0x2a762c){var _0x349ec3=function(_0x411833){while(--_0x411833){_0x407780['push'](_0x407780['shift']());}};_0x349ec3(++_0x2a762c);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0xa1f6[_0x20cc29];return _0x28d513;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var logger=require(_0x6a1f('0x2'))(_0x6a1f('0x3'));var moment=require(_0x6a1f('0x4'));var BPromise=require(_0x6a1f('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('./integrationReport.attributes');module[_0x6a1f('0x6')]=function(_0x426ae1,_0xa1c928){return _0x426ae1[_0x6a1f('0x7')](_0x6a1f('0x8'),attributes,{'tableName':_0x6a1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 491b997..6b03bb2 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 _0x5d28=['../../config/utils','rpc','../../config/environment','http','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x5d28,0x104));var _0x85d2=function(_0x4c51a5,_0x3e3773){_0x4c51a5=_0x4c51a5-0x0;var _0x62a3f9=_0x5d28[_0x4c51a5];return _0x62a3f9;};'use strict';var _=require(_0x85d2('0x0'));var util=require(_0x85d2('0x1'));var moment=require('moment');var BPromise=require(_0x85d2('0x2'));var rs=require(_0x85d2('0x3'));var fs=require('fs');var Redis=require(_0x85d2('0x4'));var db=require(_0x85d2('0x5'))['db'];var utils=require(_0x85d2('0x6'));var logger=require('../../config/logger')(_0x85d2('0x7'));var config=require(_0x85d2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x85d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1414e,_0x135f08,_0x209133){return new BPromise(function(_0x4a864d,_0x32c811){return client['request'](_0xc1414e,_0x209133)['then'](function(_0x2aea07){logger[_0x85d2('0xa')](_0x85d2('0xb'),_0x135f08,_0x85d2('0xc'));logger[_0x85d2('0xd')](_0x85d2('0xe'),_0x135f08,_0x85d2('0xc'),JSON['stringify'](_0x2aea07));if(_0x2aea07[_0x85d2('0xf')]){if(_0x2aea07[_0x85d2('0xf')][_0x85d2('0x10')]===0x1f4){logger['error'](_0x85d2('0xb'),_0x135f08,_0x2aea07[_0x85d2('0xf')][_0x85d2('0x11')]);return _0x32c811(_0x2aea07[_0x85d2('0xf')]['message']);}logger[_0x85d2('0xf')](_0x85d2('0xb'),_0x135f08,_0x2aea07['error'][_0x85d2('0x11')]);return _0x4a864d(_0x2aea07['error']['message']);}else{logger[_0x85d2('0xa')](_0x85d2('0xb'),_0x135f08,_0x85d2('0xc'));_0x4a864d(_0x2aea07[_0x85d2('0x12')][_0x85d2('0x11')]);}})['catch'](function(_0x3b788e){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x135f08,_0x3b788e);_0x32c811(_0x3b788e);});});} \ No newline at end of file +var _0x5934=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x234b4b,_0x3f6b2f){var _0x5423eb=function(_0x1d83da){while(--_0x1d83da){_0x234b4b['push'](_0x234b4b['shift']());}};_0x5423eb(++_0x3f6b2f);}(_0x5934,0x18b));var _0x4593=function(_0xa01f8d,_0x1bd677){_0xa01f8d=_0xa01f8d-0x0;var _0x3cd1b7=_0x5934[_0xa01f8d];return _0x3cd1b7;};'use strict';var _=require(_0x4593('0x0'));var util=require('util');var moment=require(_0x4593('0x1'));var BPromise=require(_0x4593('0x2'));var rs=require(_0x4593('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4593('0x4'))(_0x4593('0x5'));var config=require(_0x4593('0x6'));var jayson=require(_0x4593('0x7'));var client=jayson[_0x4593('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50ec26,_0x13abf9,_0x222f20){return new BPromise(function(_0x23b38c,_0x1e6b8b){return client[_0x4593('0x9')](_0x50ec26,_0x222f20)[_0x4593('0xa')](function(_0x717cdd){logger[_0x4593('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x13abf9,_0x4593('0xc'));logger[_0x4593('0xd')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x13abf9,'request\x20sent',JSON[_0x4593('0xe')](_0x717cdd));if(_0x717cdd[_0x4593('0xf')]){if(_0x717cdd['error']['code']===0x1f4){logger[_0x4593('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x13abf9,_0x717cdd['error'][_0x4593('0x10')]);return _0x1e6b8b(_0x717cdd['error'][_0x4593('0x10')]);}logger[_0x4593('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x13abf9,_0x717cdd['error']['message']);return _0x23b38c(_0x717cdd['error'][_0x4593('0x10')]);}else{logger['info'](_0x4593('0x11'),_0x13abf9,_0x4593('0xc'));_0x23b38c(_0x717cdd[_0x4593('0x12')][_0x4593('0x10')]);}})[_0x4593('0x13')](function(_0x45536d){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x13abf9,_0x45536d);_0x1e6b8b(_0x45536d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d810a01..cac1b8b 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 _0x3bf0=['/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id'];(function(_0x393032,_0x44ac4b){var _0x23559e=function(_0x46a89c){while(--_0x46a89c){_0x393032['push'](_0x393032['shift']());}};_0x23559e(++_0x44ac4b);}(_0x3bf0,0x83));var _0x03bf=function(_0x4ff346,_0x39fe56){_0x4ff346=_0x4ff346-0x0;var _0x3f2328=_0x3bf0[_0x4ff346];return _0x3f2328;};'use strict';var multer=require(_0x03bf('0x0'));var util=require(_0x03bf('0x1'));var path=require(_0x03bf('0x2'));var timeout=require(_0x03bf('0x3'));var express=require(_0x03bf('0x4'));var router=express[_0x03bf('0x5')]();var auth=require(_0x03bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x03bf('0x7'));var controller=require(_0x03bf('0x8'));router[_0x03bf('0x9')]('/',auth[_0x03bf('0xa')](),controller[_0x03bf('0xb')]);router['get'](_0x03bf('0xc'),auth[_0x03bf('0xa')](),controller['show']);router[_0x03bf('0x9')](_0x03bf('0xd'),auth[_0x03bf('0xa')](),controller['getIntervals']);router[_0x03bf('0xe')]('/',auth[_0x03bf('0xa')](),controller[_0x03bf('0xf')]);router[_0x03bf('0xe')](_0x03bf('0xd'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x10')]);router[_0x03bf('0xe')](_0x03bf('0x11'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x12')]);router[_0x03bf('0x13')](_0x03bf('0xc'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x14')]);router[_0x03bf('0x15')](_0x03bf('0xc'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x16')]);module[_0x03bf('0x17')]=router; \ No newline at end of file +var _0x0e21=['/:id/sub_intervals/create_many','addIntervals','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval'];(function(_0x46cfcf,_0x23dfed){var _0x31cabd=function(_0x5b034f){while(--_0x5b034f){_0x46cfcf['push'](_0x46cfcf['shift']());}};_0x31cabd(++_0x23dfed);}(_0x0e21,0xe8));var _0x10e2=function(_0x3133cd,_0x959131){_0x3133cd=_0x3133cd-0x0;var _0x1a1211=_0x0e21[_0x3133cd];return _0x1a1211;};'use strict';var multer=require('multer');var util=require(_0x10e2('0x0'));var path=require(_0x10e2('0x1'));var timeout=require(_0x10e2('0x2'));var express=require('express');var router=express[_0x10e2('0x3')]();var auth=require(_0x10e2('0x4'));var interaction=require(_0x10e2('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x10e2('0x6')]('/',auth[_0x10e2('0x7')](),controller[_0x10e2('0x8')]);router[_0x10e2('0x6')](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0xa')]);router[_0x10e2('0x6')](_0x10e2('0xb'),auth['isAuthenticated'](),controller[_0x10e2('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x10e2('0xd')](_0x10e2('0xb'),auth['isAuthenticated'](),controller[_0x10e2('0xe')]);router['post'](_0x10e2('0xf'),auth[_0x10e2('0x7')](),controller[_0x10e2('0x10')]);router['put'](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x10e2('0x12')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 98059c7..4c3c6ee 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 _0x29ed=['STRING','sequelize','exports'];(function(_0x53d0f2,_0x461fff){var _0x4039fe=function(_0x1da59f){while(--_0x1da59f){_0x53d0f2['push'](_0x53d0f2['shift']());}};_0x4039fe(++_0x461fff);}(_0x29ed,0x181));var _0xd29e=function(_0x153c6a,_0x2a217a){_0x153c6a=_0x153c6a-0x0;var _0xce898f=_0x29ed[_0x153c6a];return _0xce898f;};'use strict';var Sequelize=require(_0xd29e('0x0'));module[_0xd29e('0x1')]={'name':{'type':Sequelize[_0xd29e('0x2')]},'description':{'type':Sequelize[_0xd29e('0x2')]},'interval':{'type':Sequelize[_0xd29e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf351=['STRING','sequelize'];(function(_0x5298e5,_0x1c1211){var _0x550bc7=function(_0x264f29){while(--_0x264f29){_0x5298e5['push'](_0x5298e5['shift']());}};_0x550bc7(++_0x1c1211);}(_0xf351,0x10f));var _0x1f35=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0xf351[_0x147497];return _0x35f45;};'use strict';var Sequelize=require(_0x1f35('0x0'));module['exports']={'name':{'type':Sequelize[_0x1f35('0x1')]},'description':{'type':Sequelize[_0x1f35('0x1')]},'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 4c42d22..783e51c 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 _0x5c31=['end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','params','addInterval','IntervalId','getIntervals','findOne','length','map','addIntervals','sequelize','transaction','bulkCreate','html-pdf','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x439682,_0x3733a0){var _0x5f04ba=function(_0x5c3573){while(--_0x5c3573){_0x439682['push'](_0x439682['shift']());}};_0x5f04ba(++_0x3733a0);}(_0x5c31,0x9e));var _0x15c3=function(_0x11e4c8,_0x4b38d2){_0x11e4c8=_0x11e4c8-0x0;var _0x244909=_0x5c31[_0x11e4c8];return _0x244909;};'use strict';var pdf=require(_0x15c3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x15c3('0x1'));var zipdir=require(_0x15c3('0x2'));var jsonpatch=require(_0x15c3('0x3'));var rp=require(_0x15c3('0x4'));var moment=require(_0x15c3('0x5'));var BPromise=require(_0x15c3('0x6'));var Mustache=require(_0x15c3('0x7'));var util=require(_0x15c3('0x8'));var path=require(_0x15c3('0x9'));var sox=require(_0x15c3('0xa'));var csv=require(_0x15c3('0xb'));var ejs=require(_0x15c3('0xc'));var fs=require('fs');var _=require(_0x15c3('0xd'));var squel=require('squel');var crypto=require(_0x15c3('0xe'));var jsforce=require(_0x15c3('0xf'));var deskjs=require(_0x15c3('0x10'));var toCsv=require(_0x15c3('0xb'));var querystring=require(_0x15c3('0x11'));var Papa=require(_0x15c3('0x12'));var Redis=require(_0x15c3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x15c3('0x14'));var hardwareService=require(_0x15c3('0x15'));var logger=require(_0x15c3('0x16'))(_0x15c3('0x17'));var utils=require('../../config/utils');var config=require(_0x15c3('0x18'));var db=require(_0x15c3('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x43ad70,_0x132b6a){_0x132b6a=_0x132b6a||0xcc;return function(_0x445a61){if(_0x445a61){return _0x43ad70[_0x15c3('0x1a')](_0x132b6a);}return _0x43ad70[_0x15c3('0x1b')](_0x132b6a)[_0x15c3('0x1c')]();};}function respondWithResult(_0x42da2f,_0x3ffd33){_0x3ffd33=_0x3ffd33||0xc8;return function(_0x191b74){if(_0x191b74){return _0x42da2f[_0x15c3('0x1b')](_0x3ffd33)['json'](_0x191b74);}};}function respondWithFilteredResult(_0x3f314e,_0x3b4a2f){return function(_0x3638d6){if(_0x3638d6){var _0x212678=_0x3638d6[_0x15c3('0x1d')],_0x4e3086=_0x3b4a2f[_0x15c3('0x1e')],_0x4ffd2f=_0x3b4a2f[_0x15c3('0x1e')]+_0x3b4a2f[_0x15c3('0x1f')],_0x53bcc1;if(_0x4ffd2f>=_0x212678){_0x4ffd2f=_0x212678;_0x53bcc1=0xc8;}else{_0x53bcc1=0xce;}_0x3f314e[_0x15c3('0x1b')](_0x53bcc1);return _0x3f314e['set'](_0x15c3('0x20'),_0x4e3086+'-'+_0x4ffd2f+'/'+_0x212678)[_0x15c3('0x21')](_0x3638d6);}return null;};}function patchUpdates(_0x2dc54e){return function(_0x2eaa70){try{jsonpatch[_0x15c3('0x22')](_0x2eaa70,_0x2dc54e,!![]);}catch(_0x3a5674){return BPromise[_0x15c3('0x23')](_0x3a5674);}return _0x2eaa70[_0x15c3('0x24')]();};}function saveUpdates(_0x585051,_0x3c4807){return function(_0x49f0f4){if(_0x49f0f4){return _0x49f0f4[_0x15c3('0x25')](_0x585051)[_0x15c3('0x26')](function(_0x10cfd2){return _0x10cfd2;});}return null;};}function removeEntity(_0x4eb605,_0x534331){return function(_0x3b03f0){if(_0x3b03f0){return _0x3b03f0[_0x15c3('0x27')]()[_0x15c3('0x26')](function(){var _0x3c4768=_0x3b03f0['get']({'plain':!![]});var _0x19fd6c='Intervals';return db[_0x15c3('0x28')][_0x15c3('0x27')]({'where':{'type':_0x19fd6c,'resourceId':_0x3c4768['id']}})['then'](function(){return _0x3b03f0;});})[_0x15c3('0x26')](function(){_0x4eb605['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x546f7d,_0x5486ac){return function(_0x1f27d9){if(!_0x1f27d9){_0x546f7d[_0x15c3('0x1a')](0x194);}return _0x1f27d9;};}function handleError(_0x219c80,_0x1e9f37){_0x1e9f37=_0x1e9f37||0x1f4;return function(_0x546901){logger[_0x15c3('0x29')](_0x546901[_0x15c3('0x2a')]);if(_0x546901[_0x15c3('0x2b')]){delete _0x546901['name'];}_0x219c80[_0x15c3('0x1b')](_0x1e9f37)[_0x15c3('0x2c')](_0x546901);};}exports[_0x15c3('0x2d')]=function(_0x118aa2,_0x6c6c42){var _0x2ebaef={},_0xbd689a={},_0xa18d88={'count':0x0,'rows':[]};var _0x5497a8=db[_0x15c3('0x2e')][_0x15c3('0x2f')];_0xbd689a[_0x15c3('0x30')]=_[_0x15c3('0x31')](_0x5497a8);_0xbd689a[_0x15c3('0x32')]=_[_0x15c3('0x31')](_0x118aa2[_0x15c3('0x32')]);_0xbd689a['filters']=_[_0x15c3('0x33')](_0xbd689a[_0x15c3('0x30')],_0xbd689a[_0x15c3('0x32')]);_0x2ebaef[_0x15c3('0x34')]=_[_0x15c3('0x33')](_0xbd689a['model'],qs['fields'](_0x118aa2[_0x15c3('0x32')][_0x15c3('0x35')]));_0x2ebaef[_0x15c3('0x34')]=_0x2ebaef['attributes']['length']?_0x2ebaef[_0x15c3('0x34')]:_0xbd689a[_0x15c3('0x30')];if(!_0x118aa2[_0x15c3('0x32')][_0x15c3('0x36')](_0x15c3('0x37'))){_0x2ebaef['limit']=qs[_0x15c3('0x1f')](_0x118aa2[_0x15c3('0x32')]['limit']);_0x2ebaef[_0x15c3('0x1e')]=qs[_0x15c3('0x1e')](_0x118aa2[_0x15c3('0x32')][_0x15c3('0x1e')]);}_0x2ebaef['order']=qs[_0x15c3('0x38')](_0x118aa2[_0x15c3('0x32')]['sort']);_0x2ebaef[_0x15c3('0x39')]=qs[_0x15c3('0x3a')](_[_0x15c3('0x3b')](_0x118aa2[_0x15c3('0x32')],_0xbd689a[_0x15c3('0x3a')]));if(_0x118aa2['query'][_0x15c3('0x3c')]){_0x2ebaef[_0x15c3('0x39')]=_[_0x15c3('0x3d')](_0x2ebaef[_0x15c3('0x39')],{'$or':_['map'](_0x5497a8,function(_0x3e8596){if(_0x3e8596[_0x15c3('0x3e')][_0x15c3('0x3f')]!==_0x15c3('0x40')){var _0x31fe7f={};_0x31fe7f[_0x3e8596['field']]={'$like':'%'+_0x118aa2['query']['filter']+'%'};return _0x31fe7f;}})});}_0x2ebaef=_['merge']({},_0x2ebaef,_0x118aa2[_0x15c3('0x41')]);var _0x2bb3fc={'where':_0x2ebaef[_0x15c3('0x39')]};return db[_0x15c3('0x2e')][_0x15c3('0x1d')](_0x2bb3fc)[_0x15c3('0x26')](function(_0x5dea33){_0xa18d88[_0x15c3('0x1d')]=_0x5dea33;if(_0x118aa2['query'][_0x15c3('0x42')]){_0x2ebaef[_0x15c3('0x43')]=[{'all':!![]}];}return db[_0x15c3('0x2e')][_0x15c3('0x44')](_0x2ebaef);})[_0x15c3('0x26')](function(_0x45c1c3){_0xa18d88[_0x15c3('0x45')]=_0x45c1c3;return _0xa18d88;})['then'](respondWithFilteredResult(_0x6c6c42,_0x2ebaef))[_0x15c3('0x46')](handleError(_0x6c6c42,null));};exports[_0x15c3('0x47')]=function(_0x33d94b,_0x2ee586){var _0x34a9cc={'raw':!![],'where':{'id':_0x33d94b['params']['id']}},_0x497550={};_0x497550[_0x15c3('0x30')]=_[_0x15c3('0x31')](db['Interval']['rawAttributes']);_0x497550[_0x15c3('0x32')]=_[_0x15c3('0x31')](_0x33d94b['query']);_0x497550['filters']=_[_0x15c3('0x33')](_0x497550[_0x15c3('0x30')],_0x497550[_0x15c3('0x32')]);_0x34a9cc[_0x15c3('0x34')]=_[_0x15c3('0x33')](_0x497550['model'],qs[_0x15c3('0x35')](_0x33d94b[_0x15c3('0x32')][_0x15c3('0x35')]));_0x34a9cc[_0x15c3('0x34')]=_0x34a9cc[_0x15c3('0x34')]['length']?_0x34a9cc[_0x15c3('0x34')]:_0x497550[_0x15c3('0x30')];if(_0x33d94b['query'][_0x15c3('0x42')]){_0x34a9cc['include']=[{'all':!![]}];}_0x34a9cc=_[_0x15c3('0x3d')]({},_0x34a9cc,_0x33d94b[_0x15c3('0x41')]);return db[_0x15c3('0x2e')][_0x15c3('0x48')](_0x34a9cc)[_0x15c3('0x26')](handleEntityNotFound(_0x2ee586,null))[_0x15c3('0x26')](respondWithResult(_0x2ee586,null))[_0x15c3('0x46')](handleError(_0x2ee586,null));};exports['create']=function(_0x29f320,_0x39d8ed){return db[_0x15c3('0x2e')][_0x15c3('0x49')](_0x29f320[_0x15c3('0x4a')],{})['then'](function(_0xa29285){var _0x1d7f2d=_0x29f320[_0x15c3('0x4b')][_0x15c3('0x4c')]({'plain':!![]});if(!_0x1d7f2d)throw new Error(_0x15c3('0x4d'));if(_0x1d7f2d['role']==='user'){var _0x533f16=_0xa29285[_0x15c3('0x4c')]({'plain':!![]});var _0x21fddc=_0x15c3('0x4e');return db[_0x15c3('0x4f')]['find']({'where':{'name':_0x21fddc,'userProfileId':_0x1d7f2d[_0x15c3('0x50')]},'raw':!![]})[_0x15c3('0x26')](function(_0x3d7217){if(_0x3d7217&&_0x3d7217[_0x15c3('0x51')]===0x0){return db[_0x15c3('0x28')]['create']({'name':_0x533f16['name'],'resourceId':_0x533f16['id'],'type':_0x3d7217[_0x15c3('0x2b')],'sectionId':_0x3d7217['id']},{})[_0x15c3('0x26')](function(){return _0xa29285;});}else{return _0xa29285;}})[_0x15c3('0x46')](function(_0xfdcafd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfdcafd);throw _0xfdcafd;});}return _0xa29285;})[_0x15c3('0x26')](respondWithResult(_0x39d8ed,0xc9))['catch'](handleError(_0x39d8ed,null));};exports[_0x15c3('0x25')]=function(_0x3ca582,_0x302ae0){if(_0x3ca582[_0x15c3('0x4a')]['id']){delete _0x3ca582[_0x15c3('0x4a')]['id'];}return db[_0x15c3('0x2e')][_0x15c3('0x48')]({'where':{'id':_0x3ca582[_0x15c3('0x52')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x302ae0,null))[_0x15c3('0x26')](saveUpdates(_0x3ca582['body'],null))[_0x15c3('0x26')](respondWithResult(_0x302ae0,null))[_0x15c3('0x46')](handleError(_0x302ae0,null));};exports['destroy']=function(_0x17be71,_0x53d0de){return db['Interval']['find']({'where':{'id':_0x17be71[_0x15c3('0x52')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x53d0de,null))[_0x15c3('0x26')](removeEntity(_0x53d0de,null))[_0x15c3('0x46')](handleError(_0x53d0de,null));};exports[_0x15c3('0x53')]=function(_0x29064a,_0x584c98,_0x1585c0){if(_0x29064a[_0x15c3('0x4a')]['id']){delete _0x29064a['body']['id'];}return db[_0x15c3('0x2e')]['find']({'where':{'id':_0x29064a[_0x15c3('0x52')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x584c98,null))[_0x15c3('0x26')](function(_0x232858){if(_0x232858){_0x29064a['body'][_0x15c3('0x54')]=_0x232858['id'];return db[_0x15c3('0x2e')][_0x15c3('0x49')](_0x29064a[_0x15c3('0x4a')]);}})['then'](respondWithResult(_0x584c98,null))[_0x15c3('0x46')](handleError(_0x584c98,null));};exports[_0x15c3('0x55')]=function(_0x425b9d,_0x5a1a14,_0x3f8582){var _0xcf9541={};var _0x44cbcf={};var _0x4eff1e;var _0x8f6233;return db[_0x15c3('0x2e')][_0x15c3('0x56')]({'where':{'id':_0x425b9d[_0x15c3('0x52')]['id']}})[_0x15c3('0x26')](handleEntityNotFound(_0x5a1a14,null))[_0x15c3('0x26')](function(_0x2f1853){if(_0x2f1853){_0x4eff1e=_0x2f1853;_0x44cbcf['model']=_[_0x15c3('0x31')](db[_0x15c3('0x2e')][_0x15c3('0x2f')]);_0x44cbcf[_0x15c3('0x32')]=_[_0x15c3('0x31')](_0x425b9d['query']);_0x44cbcf['filters']=_[_0x15c3('0x33')](_0x44cbcf[_0x15c3('0x30')],_0x44cbcf[_0x15c3('0x32')]);_0xcf9541['attributes']=_[_0x15c3('0x33')](_0x44cbcf[_0x15c3('0x30')],qs[_0x15c3('0x35')](_0x425b9d['query'][_0x15c3('0x35')]));_0xcf9541['attributes']=_0xcf9541[_0x15c3('0x34')][_0x15c3('0x57')]?_0xcf9541['attributes']:_0x44cbcf[_0x15c3('0x30')];_0xcf9541['order']=qs[_0x15c3('0x38')](_0x425b9d[_0x15c3('0x32')][_0x15c3('0x38')]);_0xcf9541[_0x15c3('0x39')]=qs[_0x15c3('0x3a')](_[_0x15c3('0x3b')](_0x425b9d[_0x15c3('0x32')],_0x44cbcf[_0x15c3('0x3a')]));if(_0x425b9d['query'][_0x15c3('0x3c')]){_0xcf9541[_0x15c3('0x39')]=_[_0x15c3('0x3d')](_0xcf9541[_0x15c3('0x39')],{'$or':_[_0x15c3('0x58')](_0xcf9541[_0x15c3('0x34')],function(_0x1bf646){var _0x1f869b={};_0x1f869b[_0x1bf646]={'$like':'%'+_0x425b9d[_0x15c3('0x32')][_0x15c3('0x3c')]+'%'};return _0x1f869b;})});}_0xcf9541=_['merge']({},_0xcf9541,_0x425b9d[_0x15c3('0x41')]);return _0x4eff1e[_0x15c3('0x55')](_0xcf9541);}})['then'](function(_0x4bcce2){if(_0x4bcce2){_0x8f6233=_0x4bcce2[_0x15c3('0x57')];if(!_0x425b9d[_0x15c3('0x32')][_0x15c3('0x36')](_0x15c3('0x37'))){_0xcf9541[_0x15c3('0x1f')]=qs[_0x15c3('0x1f')](_0x425b9d[_0x15c3('0x32')][_0x15c3('0x1f')]);_0xcf9541[_0x15c3('0x1e')]=qs[_0x15c3('0x1e')](_0x425b9d[_0x15c3('0x32')][_0x15c3('0x1e')]);}return _0x4eff1e['getIntervals'](_0xcf9541);}})[_0x15c3('0x26')](function(_0x573fa2){if(_0x573fa2){return _0x573fa2?{'count':_0x8f6233,'rows':_0x573fa2}:null;}})[_0x15c3('0x26')](respondWithResult(_0x5a1a14,null))[_0x15c3('0x46')](handleError(_0x5a1a14,null));};exports[_0x15c3('0x59')]=function(_0x2c98cd,_0x49a874,_0x3b9568){return db[_0x15c3('0x2e')][_0x15c3('0x56')]({'where':{'id':_0x2c98cd[_0x15c3('0x52')]['id']}})['then'](handleEntityNotFound(_0x49a874,null))[_0x15c3('0x26')](function(_0x5ae4e){if(_0x5ae4e){return db[_0x15c3('0x5a')][_0x15c3('0x5b')](function(_0x126089){return db['Interval'][_0x15c3('0x27')]({'where':{'IntervalId':_0x2c98cd[_0x15c3('0x52')]['id']},'transaction':_0x126089})[_0x15c3('0x26')](function(_0x1cfb3f){var _0x35ee67=_[_0x15c3('0x58')](_0x2c98cd[_0x15c3('0x4a')],function(_0x473623){delete _0x473623['id'];_0x473623[_0x15c3('0x54')]=_0x2c98cd['params']['id'];return _0x473623;});return db['Interval'][_0x15c3('0x5c')](_0x35ee67,{'transaction':_0x126089});});})['then'](function(){return db[_0x15c3('0x2e')][_0x15c3('0x44')]({'where':{'IntervalId':_0x2c98cd[_0x15c3('0x52')]['id']}});});}})[_0x15c3('0x26')](respondWithResult(_0x49a874,null))['catch'](handleError(_0x49a874,null));}; \ No newline at end of file +var _0x8d0a=['limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','IntervalId','findOne','getIntervals','addIntervals','sequelize','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','name','send','index','Interval','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x34dcd9,_0x67303){var _0x1ab047=function(_0x2c7f3b){while(--_0x2c7f3b){_0x34dcd9['push'](_0x34dcd9['shift']());}};_0x1ab047(++_0x67303);}(_0x8d0a,0x121));var _0xa8d0=function(_0x72625b,_0x2e0611){_0x72625b=_0x72625b-0x0;var _0x4b28de=_0x8d0a[_0x72625b];return _0x4b28de;};'use strict';var pdf=require(_0xa8d0('0x0'));var emlformat=require(_0xa8d0('0x1'));var rimraf=require(_0xa8d0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8d0('0x3'));var rp=require(_0xa8d0('0x4'));var moment=require(_0xa8d0('0x5'));var BPromise=require(_0xa8d0('0x6'));var Mustache=require(_0xa8d0('0x7'));var util=require('util');var path=require(_0xa8d0('0x8'));var sox=require(_0xa8d0('0x9'));var csv=require(_0xa8d0('0xa'));var ejs=require(_0xa8d0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa8d0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa8d0('0xa'));var querystring=require(_0xa8d0('0xd'));var Papa=require(_0xa8d0('0xe'));var Redis=require(_0xa8d0('0xf'));var authService=require(_0xa8d0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa8d0('0x11'));var logger=require('../../config/logger')(_0xa8d0('0x12'));var utils=require(_0xa8d0('0x13'));var config=require(_0xa8d0('0x14'));var db=require(_0xa8d0('0x15'))['db'];var extensions=require(_0xa8d0('0x16'));function respondWithStatusCode(_0x582ea2,_0x11d79d){_0x11d79d=_0x11d79d||0xcc;return function(_0x3d63e0){if(_0x3d63e0){return _0x582ea2[_0xa8d0('0x17')](_0x11d79d);}return _0x582ea2['status'](_0x11d79d)[_0xa8d0('0x18')]();};}function respondWithResult(_0xc4bcf6,_0x354dc6){_0x354dc6=_0x354dc6||0xc8;return function(_0xdc8240){if(_0xdc8240){return _0xc4bcf6[_0xa8d0('0x19')](_0x354dc6)[_0xa8d0('0x1a')](_0xdc8240);}};}function respondWithFilteredResult(_0x463ea8,_0x1f56bc){return function(_0x33ef0b){if(_0x33ef0b){var _0x958a94=_0x33ef0b['count'],_0x4a2895=_0x1f56bc['offset'],_0x4bc88c=_0x1f56bc[_0xa8d0('0x1b')]+_0x1f56bc['limit'],_0x202576;if(_0x4bc88c>=_0x958a94){_0x4bc88c=_0x958a94;_0x202576=0xc8;}else{_0x202576=0xce;}_0x463ea8[_0xa8d0('0x19')](_0x202576);return _0x463ea8['set'](_0xa8d0('0x1c'),_0x4a2895+'-'+_0x4bc88c+'/'+_0x958a94)[_0xa8d0('0x1a')](_0x33ef0b);}return null;};}function patchUpdates(_0x5eeb44){return function(_0x4f1a69){try{jsonpatch[_0xa8d0('0x1d')](_0x4f1a69,_0x5eeb44,!![]);}catch(_0x4ec547){return BPromise['reject'](_0x4ec547);}return _0x4f1a69['save']();};}function saveUpdates(_0x4e3de3,_0x305e91){return function(_0x27849d){if(_0x27849d){return _0x27849d[_0xa8d0('0x1e')](_0x4e3de3)[_0xa8d0('0x1f')](function(_0x517144){return _0x517144;});}return null;};}function removeEntity(_0x5daf52,_0x125063){return function(_0x5b8ac9){if(_0x5b8ac9){return _0x5b8ac9[_0xa8d0('0x20')]()[_0xa8d0('0x1f')](function(){var _0x3bcf4d=_0x5b8ac9[_0xa8d0('0x21')]({'plain':!![]});var _0x503a79='Intervals';return db[_0xa8d0('0x22')][_0xa8d0('0x20')]({'where':{'type':_0x503a79,'resourceId':_0x3bcf4d['id']}})[_0xa8d0('0x1f')](function(){return _0x5b8ac9;});})[_0xa8d0('0x1f')](function(){_0x5daf52[_0xa8d0('0x19')](0xcc)[_0xa8d0('0x18')]();});}};}function handleEntityNotFound(_0x116e21,_0x47a665){return function(_0x3cf180){if(!_0x3cf180){_0x116e21[_0xa8d0('0x17')](0x194);}return _0x3cf180;};}function handleError(_0x192cb,_0xe7f38c){_0xe7f38c=_0xe7f38c||0x1f4;return function(_0x30dd46){logger[_0xa8d0('0x23')](_0x30dd46['stack']);if(_0x30dd46[_0xa8d0('0x24')]){delete _0x30dd46['name'];}_0x192cb[_0xa8d0('0x19')](_0xe7f38c)[_0xa8d0('0x25')](_0x30dd46);};}exports[_0xa8d0('0x26')]=function(_0x328d21,_0xd896db){var _0x1d4bb5={},_0x449a67={},_0x264473={'count':0x0,'rows':[]};var _0x38fd76=db[_0xa8d0('0x27')][_0xa8d0('0x28')];_0x449a67[_0xa8d0('0x29')]=_[_0xa8d0('0x2a')](_0x38fd76);_0x449a67['query']=_[_0xa8d0('0x2a')](_0x328d21[_0xa8d0('0x2b')]);_0x449a67[_0xa8d0('0x2c')]=_['intersection'](_0x449a67[_0xa8d0('0x29')],_0x449a67['query']);_0x1d4bb5[_0xa8d0('0x2d')]=_[_0xa8d0('0x2e')](_0x449a67['model'],qs[_0xa8d0('0x2f')](_0x328d21[_0xa8d0('0x2b')][_0xa8d0('0x2f')]));_0x1d4bb5['attributes']=_0x1d4bb5['attributes'][_0xa8d0('0x30')]?_0x1d4bb5[_0xa8d0('0x2d')]:_0x449a67['model'];if(!_0x328d21[_0xa8d0('0x2b')][_0xa8d0('0x31')](_0xa8d0('0x32'))){_0x1d4bb5[_0xa8d0('0x33')]=qs[_0xa8d0('0x33')](_0x328d21[_0xa8d0('0x2b')]['limit']);_0x1d4bb5[_0xa8d0('0x1b')]=qs[_0xa8d0('0x1b')](_0x328d21['query']['offset']);}_0x1d4bb5[_0xa8d0('0x34')]=qs[_0xa8d0('0x35')](_0x328d21[_0xa8d0('0x2b')][_0xa8d0('0x35')]);_0x1d4bb5[_0xa8d0('0x36')]=qs[_0xa8d0('0x2c')](_[_0xa8d0('0x37')](_0x328d21[_0xa8d0('0x2b')],_0x449a67[_0xa8d0('0x2c')]));if(_0x328d21[_0xa8d0('0x2b')]['filter']){_0x1d4bb5['where']=_[_0xa8d0('0x38')](_0x1d4bb5[_0xa8d0('0x36')],{'$or':_[_0xa8d0('0x39')](_0x38fd76,function(_0x40f03c){if(_0x40f03c[_0xa8d0('0x3a')][_0xa8d0('0x3b')]!==_0xa8d0('0x3c')){var _0x50a35d={};_0x50a35d[_0x40f03c[_0xa8d0('0x3d')]]={'$like':'%'+_0x328d21[_0xa8d0('0x2b')][_0xa8d0('0x3e')]+'%'};return _0x50a35d;}})});}_0x1d4bb5=_[_0xa8d0('0x38')]({},_0x1d4bb5,_0x328d21['options']);var _0x5206dd={'where':_0x1d4bb5[_0xa8d0('0x36')]};return db[_0xa8d0('0x27')][_0xa8d0('0x3f')](_0x5206dd)[_0xa8d0('0x1f')](function(_0x572de7){_0x264473[_0xa8d0('0x3f')]=_0x572de7;if(_0x328d21[_0xa8d0('0x2b')][_0xa8d0('0x40')]){_0x1d4bb5[_0xa8d0('0x41')]=[{'all':!![]}];}return db[_0xa8d0('0x27')][_0xa8d0('0x42')](_0x1d4bb5);})[_0xa8d0('0x1f')](function(_0x33e57a){_0x264473[_0xa8d0('0x43')]=_0x33e57a;return _0x264473;})['then'](respondWithFilteredResult(_0xd896db,_0x1d4bb5))[_0xa8d0('0x44')](handleError(_0xd896db,null));};exports[_0xa8d0('0x45')]=function(_0x73c0,_0x395dd5){var _0x2f98c3={'raw':!![],'where':{'id':_0x73c0[_0xa8d0('0x46')]['id']}},_0x53ac17={};_0x53ac17['model']=_[_0xa8d0('0x2a')](db['Interval'][_0xa8d0('0x28')]);_0x53ac17[_0xa8d0('0x2b')]=_[_0xa8d0('0x2a')](_0x73c0[_0xa8d0('0x2b')]);_0x53ac17[_0xa8d0('0x2c')]=_[_0xa8d0('0x2e')](_0x53ac17[_0xa8d0('0x29')],_0x53ac17[_0xa8d0('0x2b')]);_0x2f98c3[_0xa8d0('0x2d')]=_[_0xa8d0('0x2e')](_0x53ac17[_0xa8d0('0x29')],qs[_0xa8d0('0x2f')](_0x73c0[_0xa8d0('0x2b')][_0xa8d0('0x2f')]));_0x2f98c3['attributes']=_0x2f98c3[_0xa8d0('0x2d')][_0xa8d0('0x30')]?_0x2f98c3[_0xa8d0('0x2d')]:_0x53ac17[_0xa8d0('0x29')];if(_0x73c0[_0xa8d0('0x2b')][_0xa8d0('0x40')]){_0x2f98c3[_0xa8d0('0x41')]=[{'all':!![]}];}_0x2f98c3=_[_0xa8d0('0x38')]({},_0x2f98c3,_0x73c0[_0xa8d0('0x47')]);return db[_0xa8d0('0x27')]['find'](_0x2f98c3)[_0xa8d0('0x1f')](handleEntityNotFound(_0x395dd5,null))[_0xa8d0('0x1f')](respondWithResult(_0x395dd5,null))[_0xa8d0('0x44')](handleError(_0x395dd5,null));};exports[_0xa8d0('0x48')]=function(_0xb9f3eb,_0x4a2271){return db['Interval'][_0xa8d0('0x48')](_0xb9f3eb[_0xa8d0('0x49')],{})[_0xa8d0('0x1f')](function(_0x48666a){var _0x395e5d=_0xb9f3eb[_0xa8d0('0x4a')][_0xa8d0('0x21')]({'plain':!![]});if(!_0x395e5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x395e5d['role']==='user'){var _0x529f84=_0x48666a[_0xa8d0('0x21')]({'plain':!![]});var _0x3f6dd3='Intervals';return db[_0xa8d0('0x4b')][_0xa8d0('0x4c')]({'where':{'name':_0x3f6dd3,'userProfileId':_0x395e5d[_0xa8d0('0x4d')]},'raw':!![]})[_0xa8d0('0x1f')](function(_0x59a5fc){if(_0x59a5fc&&_0x59a5fc[_0xa8d0('0x4e')]===0x0){return db[_0xa8d0('0x22')][_0xa8d0('0x48')]({'name':_0x529f84['name'],'resourceId':_0x529f84['id'],'type':_0x59a5fc[_0xa8d0('0x24')],'sectionId':_0x59a5fc['id']},{})[_0xa8d0('0x1f')](function(){return _0x48666a;});}else{return _0x48666a;}})[_0xa8d0('0x44')](function(_0x2bf735){logger[_0xa8d0('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bf735);throw _0x2bf735;});}return _0x48666a;})['then'](respondWithResult(_0x4a2271,0xc9))[_0xa8d0('0x44')](handleError(_0x4a2271,null));};exports['update']=function(_0x56cfe6,_0xc36ce7){if(_0x56cfe6['body']['id']){delete _0x56cfe6[_0xa8d0('0x49')]['id'];}return db[_0xa8d0('0x27')][_0xa8d0('0x4c')]({'where':{'id':_0x56cfe6['params']['id']}})[_0xa8d0('0x1f')](handleEntityNotFound(_0xc36ce7,null))[_0xa8d0('0x1f')](saveUpdates(_0x56cfe6[_0xa8d0('0x49')],null))[_0xa8d0('0x1f')](respondWithResult(_0xc36ce7,null))[_0xa8d0('0x44')](handleError(_0xc36ce7,null));};exports[_0xa8d0('0x20')]=function(_0x4174a4,_0x4e2b1d){return db[_0xa8d0('0x27')][_0xa8d0('0x4c')]({'where':{'id':_0x4174a4[_0xa8d0('0x46')]['id']}})[_0xa8d0('0x1f')](handleEntityNotFound(_0x4e2b1d,null))[_0xa8d0('0x1f')](removeEntity(_0x4e2b1d,null))[_0xa8d0('0x44')](handleError(_0x4e2b1d,null));};exports['addInterval']=function(_0x3a73ec,_0x306092,_0x44fb1b){if(_0x3a73ec[_0xa8d0('0x49')]['id']){delete _0x3a73ec[_0xa8d0('0x49')]['id'];}return db[_0xa8d0('0x27')][_0xa8d0('0x4c')]({'where':{'id':_0x3a73ec[_0xa8d0('0x46')]['id']}})[_0xa8d0('0x1f')](handleEntityNotFound(_0x306092,null))[_0xa8d0('0x1f')](function(_0x5192ab){if(_0x5192ab){_0x3a73ec[_0xa8d0('0x49')][_0xa8d0('0x4f')]=_0x5192ab['id'];return db[_0xa8d0('0x27')]['create'](_0x3a73ec[_0xa8d0('0x49')]);}})[_0xa8d0('0x1f')](respondWithResult(_0x306092,null))[_0xa8d0('0x44')](handleError(_0x306092,null));};exports['getIntervals']=function(_0x414abf,_0x254181,_0x293f92){var _0x4b4341={};var _0x345d4f={};var _0x26bc5d;var _0x10974d;return db[_0xa8d0('0x27')][_0xa8d0('0x50')]({'where':{'id':_0x414abf[_0xa8d0('0x46')]['id']}})['then'](handleEntityNotFound(_0x254181,null))[_0xa8d0('0x1f')](function(_0x5ba788){if(_0x5ba788){_0x26bc5d=_0x5ba788;_0x345d4f['model']=_[_0xa8d0('0x2a')](db[_0xa8d0('0x27')][_0xa8d0('0x28')]);_0x345d4f[_0xa8d0('0x2b')]=_[_0xa8d0('0x2a')](_0x414abf[_0xa8d0('0x2b')]);_0x345d4f[_0xa8d0('0x2c')]=_['intersection'](_0x345d4f[_0xa8d0('0x29')],_0x345d4f[_0xa8d0('0x2b')]);_0x4b4341['attributes']=_[_0xa8d0('0x2e')](_0x345d4f[_0xa8d0('0x29')],qs[_0xa8d0('0x2f')](_0x414abf[_0xa8d0('0x2b')]['fields']));_0x4b4341[_0xa8d0('0x2d')]=_0x4b4341[_0xa8d0('0x2d')][_0xa8d0('0x30')]?_0x4b4341['attributes']:_0x345d4f[_0xa8d0('0x29')];_0x4b4341[_0xa8d0('0x34')]=qs[_0xa8d0('0x35')](_0x414abf[_0xa8d0('0x2b')]['sort']);_0x4b4341[_0xa8d0('0x36')]=qs[_0xa8d0('0x2c')](_[_0xa8d0('0x37')](_0x414abf[_0xa8d0('0x2b')],_0x345d4f[_0xa8d0('0x2c')]));if(_0x414abf['query'][_0xa8d0('0x3e')]){_0x4b4341['where']=_[_0xa8d0('0x38')](_0x4b4341[_0xa8d0('0x36')],{'$or':_[_0xa8d0('0x39')](_0x4b4341['attributes'],function(_0x522f1f){var _0xc11560={};_0xc11560[_0x522f1f]={'$like':'%'+_0x414abf['query']['filter']+'%'};return _0xc11560;})});}_0x4b4341=_[_0xa8d0('0x38')]({},_0x4b4341,_0x414abf[_0xa8d0('0x47')]);return _0x26bc5d[_0xa8d0('0x51')](_0x4b4341);}})[_0xa8d0('0x1f')](function(_0x485654){if(_0x485654){_0x10974d=_0x485654[_0xa8d0('0x30')];if(!_0x414abf['query'][_0xa8d0('0x31')](_0xa8d0('0x32'))){_0x4b4341['limit']=qs[_0xa8d0('0x33')](_0x414abf[_0xa8d0('0x2b')][_0xa8d0('0x33')]);_0x4b4341[_0xa8d0('0x1b')]=qs[_0xa8d0('0x1b')](_0x414abf[_0xa8d0('0x2b')][_0xa8d0('0x1b')]);}return _0x26bc5d[_0xa8d0('0x51')](_0x4b4341);}})['then'](function(_0x4bf931){if(_0x4bf931){return _0x4bf931?{'count':_0x10974d,'rows':_0x4bf931}:null;}})[_0xa8d0('0x1f')](respondWithResult(_0x254181,null))['catch'](handleError(_0x254181,null));};exports[_0xa8d0('0x52')]=function(_0x3e694c,_0x1fb032,_0x2b833f){return db['Interval'][_0xa8d0('0x50')]({'where':{'id':_0x3e694c[_0xa8d0('0x46')]['id']}})[_0xa8d0('0x1f')](handleEntityNotFound(_0x1fb032,null))[_0xa8d0('0x1f')](function(_0x429172){if(_0x429172){return db[_0xa8d0('0x53')]['transaction'](function(_0x190d53){return db[_0xa8d0('0x27')][_0xa8d0('0x20')]({'where':{'IntervalId':_0x3e694c['params']['id']},'transaction':_0x190d53})[_0xa8d0('0x1f')](function(_0x3c6bc9){var _0x262bf4=_[_0xa8d0('0x39')](_0x3e694c[_0xa8d0('0x49')],function(_0x3918d7){delete _0x3918d7['id'];_0x3918d7[_0xa8d0('0x4f')]=_0x3e694c[_0xa8d0('0x46')]['id'];return _0x3918d7;});return db[_0xa8d0('0x27')][_0xa8d0('0x54')](_0x262bf4,{'transaction':_0x190d53});});})[_0xa8d0('0x1f')](function(){return db[_0xa8d0('0x27')][_0xa8d0('0x42')]({'where':{'IntervalId':_0x3e694c[_0xa8d0('0x46')]['id']}});});}})['then'](respondWithResult(_0x1fb032,null))[_0xa8d0('0x44')](handleError(_0x1fb032,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 101da0b..3646601 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 _0x0b96=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28b440,_0x1b2b23){var _0x271fdd=function(_0x1cdbaf){while(--_0x1cdbaf){_0x28b440['push'](_0x28b440['shift']());}};_0x271fdd(++_0x1b2b23);}(_0x0b96,0x67));var _0x60b9=function(_0x1612e9,_0x272ff8){_0x1612e9=_0x1612e9-0x0;var _0x5a39fd=_0x0b96[_0x1612e9];return _0x5a39fd;};'use strict';var _=require(_0x60b9('0x0'));var util=require(_0x60b9('0x1'));var logger=require(_0x60b9('0x2'))(_0x60b9('0x3'));var moment=require(_0x60b9('0x4'));var BPromise=require(_0x60b9('0x5'));var rp=require(_0x60b9('0x6'));var fs=require('fs');var path=require(_0x60b9('0x7'));var rimraf=require(_0x60b9('0x8'));var config=require(_0x60b9('0x9'));var attributes=require(_0x60b9('0xa'));var extensions=require(_0x60b9('0xb'));module['exports']=function(_0x1a7c33,_0x57f8d9){return _0x1a7c33[_0x60b9('0xc')](_0x60b9('0xd'),attributes,{'tableName':_0x60b9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x13035c,_0x223ffe){extensions[_0x60b9('0xf')](_0x1a7c33,_0x13035c);},'afterBulkCreate':function(_0x2a8cae,_0x7ae42c,_0x41776f){_0x41776f();extensions['rewrite'](_0x1a7c33,_0x2a8cae[0x0]);},'afterUpdate':function(_0x4ab570,_0xc9bd1b){extensions['rewrite'](_0x1a7c33,_0x4ab570);},'afterDestroy':function(_0x19ee21,_0x32fd51){extensions[_0x60b9('0xf')](_0x1a7c33,_0x19ee21);}}});}; \ No newline at end of file +var _0x693f=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','exports','tools_intervals','rewrite','lodash'];(function(_0x3412e0,_0x5c4e4f){var _0x479b68=function(_0x23028d){while(--_0x23028d){_0x3412e0['push'](_0x3412e0['shift']());}};_0x479b68(++_0x5c4e4f);}(_0x693f,0x180));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf693('0x0'));var util=require('util');var logger=require(_0xf693('0x1'))(_0xf693('0x2'));var moment=require('moment');var BPromise=require(_0xf693('0x3'));var rp=require(_0xf693('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf693('0x5'));var config=require(_0xf693('0x6'));var attributes=require(_0xf693('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xf693('0x8')]=function(_0x464981,_0xd269c8){return _0x464981['define']('Interval',attributes,{'tableName':_0xf693('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x50244b,_0x4d40ea){extensions[_0xf693('0xa')](_0x464981,_0x50244b);},'afterBulkCreate':function(_0x1889c7,_0x2e89f3,_0x4d3759){_0x4d3759();extensions['rewrite'](_0x464981,_0x1889c7[0x0]);},'afterUpdate':function(_0xfcee13,_0x45ce8a){extensions[_0xf693('0xa')](_0x464981,_0xfcee13);},'afterDestroy':function(_0x50465e,_0x4afecf){extensions[_0xf693('0xa')](_0x464981,_0x50465e);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index d37a2d3..d155daf 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 _0xc978=['info','result','catch','GetInterval','Interval','findAll','options','raw','where','attributes','limit','map','include','model','ShowInterval','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35967a,_0x1716e5){var _0x17b21d=function(_0x4517cc){while(--_0x4517cc){_0x35967a['push'](_0x35967a['shift']());}};_0x17b21d(++_0x1716e5);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x524196,_0x41a511,_0x1b5864){return new BPromise(function(_0x332cd1,_0x26ff40){return client[_0x8c97('0xd')](_0x524196,_0x1b5864)[_0x8c97('0xe')](function(_0x17aef0){logger['info'](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));logger[_0x8c97('0x11')](_0x8c97('0x12'),_0x41a511,_0x8c97('0x10'),JSON[_0x8c97('0x13')](_0x17aef0));if(_0x17aef0[_0x8c97('0x14')]){if(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x15')]===0x1f4){logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0[_0x8c97('0x14')]['message']);return _0x26ff40(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x16')]);}logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0['error']['message']);return _0x332cd1(_0x17aef0['error'][_0x8c97('0x16')]);}else{logger[_0x8c97('0x17')](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));_0x332cd1(_0x17aef0[_0x8c97('0x18')][_0x8c97('0x16')]);}})[_0x8c97('0x19')](function(_0xe3be1){logger[_0x8c97('0x14')]('Interval,\x20%s,\x20%s',_0x41a511,_0xe3be1);_0x26ff40(_0xe3be1);});});}exports[_0x8c97('0x1a')]=function(_0x3f7ac7){var _0x18cffa=this;return new Promise(function(_0x3b57ed,_0x272010){return db[_0x8c97('0x1b')][_0x8c97('0x1c')]({'raw':_0x3f7ac7[_0x8c97('0x1d')]?_0x3f7ac7[_0x8c97('0x1d')][_0x8c97('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f7ac7[_0x8c97('0x1d')]?_0x3f7ac7[_0x8c97('0x1d')][_0x8c97('0x1f')]||null:null,'attributes':_0x3f7ac7[_0x8c97('0x1d')]?_0x3f7ac7[_0x8c97('0x1d')][_0x8c97('0x20')]||null:null,'limit':_0x3f7ac7['options']?_0x3f7ac7[_0x8c97('0x1d')][_0x8c97('0x21')]||null:null,'include':_0x3f7ac7[_0x8c97('0x1d')]?_0x3f7ac7['options']['include']?_[_0x8c97('0x22')](_0x3f7ac7['options'][_0x8c97('0x23')],function(_0x1f2dd5){return{'model':db[_0x1f2dd5[_0x8c97('0x24')]],'as':_0x1f2dd5['as'],'attributes':_0x1f2dd5[_0x8c97('0x20')],'include':_0x1f2dd5[_0x8c97('0x23')]?_[_0x8c97('0x22')](_0x1f2dd5[_0x8c97('0x23')],function(_0x5132c5){return{'model':db[_0x5132c5['model']],'as':_0x5132c5['as'],'attributes':_0x5132c5[_0x8c97('0x20')],'include':_0x5132c5[_0x8c97('0x23')]?_[_0x8c97('0x22')](_0x5132c5['include'],function(_0x49b7fa){return{'model':db[_0x49b7fa[_0x8c97('0x24')]],'as':_0x49b7fa['as'],'attributes':_0x49b7fa[_0x8c97('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c97('0xe')](function(_0x1609de){logger[_0x8c97('0x17')](_0x8c97('0x1a'),_0x3f7ac7);logger['debug'](_0x8c97('0x1a'),_0x3f7ac7,JSON['stringify'](_0x1609de));_0x3b57ed(_0x1609de);})[_0x8c97('0x19')](function(_0x521969){logger[_0x8c97('0x14')](_0x8c97('0x1a'),_0x521969['message'],_0x3f7ac7);_0x272010(_0x18cffa[_0x8c97('0x14')](0x1f4,_0x521969['message']));});});};exports[_0x8c97('0x25')]=function(_0x63b903){var _0x4e26a4=this;return new Promise(function(_0x2ebba4,_0x4451d6){return db[_0x8c97('0x1b')]['find']({'raw':_0x63b903['options']?_0x63b903[_0x8c97('0x1d')][_0x8c97('0x1e')]===undefined?!![]:![]:!![],'where':_0x63b903[_0x8c97('0x1d')]?_0x63b903['options'][_0x8c97('0x1f')]||null:null,'attributes':_0x63b903['options']?_0x63b903['options'][_0x8c97('0x20')]||null:null,'include':_0x63b903[_0x8c97('0x1d')]?_0x63b903[_0x8c97('0x1d')][_0x8c97('0x23')]?_[_0x8c97('0x22')](_0x63b903[_0x8c97('0x1d')]['include'],function(_0x35ca85){return{'model':db[_0x35ca85[_0x8c97('0x24')]],'as':_0x35ca85['as'],'attributes':_0x35ca85[_0x8c97('0x20')],'include':_0x35ca85[_0x8c97('0x23')]?_[_0x8c97('0x22')](_0x35ca85[_0x8c97('0x23')],function(_0x157c7b){return{'model':db[_0x157c7b[_0x8c97('0x24')]],'as':_0x157c7b['as'],'attributes':_0x157c7b['attributes'],'include':_0x157c7b[_0x8c97('0x23')]?_[_0x8c97('0x22')](_0x157c7b[_0x8c97('0x23')],function(_0x33aa85){return{'model':db[_0x33aa85[_0x8c97('0x24')]],'as':_0x33aa85['as'],'attributes':_0x33aa85[_0x8c97('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x473d52){logger[_0x8c97('0x17')](_0x8c97('0x25'),_0x63b903);logger[_0x8c97('0x11')](_0x8c97('0x25'),_0x63b903,JSON[_0x8c97('0x13')](_0x473d52));_0x2ebba4(_0x473d52);})[_0x8c97('0x19')](function(_0x4639e2){logger[_0x8c97('0x14')]('ShowInterval',_0x4639e2[_0x8c97('0x16')],_0x63b903);_0x4451d6(_0x4e26a4[_0x8c97('0x14')](0x1f4,_0x4639e2[_0x8c97('0x16')]));});});}; \ No newline at end of file +var _0xf2ca=['rpc','jayson/promise','client','http','request','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Interval','findAll','options','raw','where','attributes','limit','include','model','map','GetInterval','ShowInterval','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2e0363,_0xdb17d5){var _0x28df4a=function(_0x3fe27a){while(--_0x3fe27a){_0x2e0363['push'](_0x2e0363['shift']());}};_0x28df4a(++_0xdb17d5);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0xf2ca[_0xd8aad0];return _0x570860;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){return client[_0xaf2c('0xc')](_0x1f9531,_0x37fedd)['then'](function(_0x439ca3){logger['info'](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x58351f,'request\x20sent',JSON['stringify'](_0x439ca3));if(_0x439ca3[_0xaf2c('0x11')]){if(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x12')]===0x1f4){logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3['error']['message']);return _0x4a7397(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);return _0x3c0421(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}else{logger[_0xaf2c('0x14')](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));_0x3c0421(_0x439ca3[_0xaf2c('0x15')][_0xaf2c('0x13')]);}})[_0xaf2c('0x16')](function(_0x705d09){logger['error'](_0xaf2c('0xd'),_0x58351f,_0x705d09);_0x4a7397(_0x705d09);});});}exports['GetInterval']=function(_0x278a28){var _0x474c80=this;return new Promise(function(_0x1d544a,_0x578492){return db[_0xaf2c('0x17')][_0xaf2c('0x18')]({'raw':_0x278a28[_0xaf2c('0x19')]?_0x278a28[_0xaf2c('0x19')][_0xaf2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x278a28[_0xaf2c('0x19')]?_0x278a28['options'][_0xaf2c('0x1b')]||null:null,'attributes':_0x278a28[_0xaf2c('0x19')]?_0x278a28[_0xaf2c('0x19')][_0xaf2c('0x1c')]||null:null,'limit':_0x278a28[_0xaf2c('0x19')]?_0x278a28['options'][_0xaf2c('0x1d')]||null:null,'include':_0x278a28[_0xaf2c('0x19')]?_0x278a28[_0xaf2c('0x19')]['include']?_['map'](_0x278a28[_0xaf2c('0x19')][_0xaf2c('0x1e')],function(_0x1cafad){return{'model':db[_0x1cafad[_0xaf2c('0x1f')]],'as':_0x1cafad['as'],'attributes':_0x1cafad['attributes'],'include':_0x1cafad[_0xaf2c('0x1e')]?_[_0xaf2c('0x20')](_0x1cafad[_0xaf2c('0x1e')],function(_0x3c1ae6){return{'model':db[_0x3c1ae6[_0xaf2c('0x1f')]],'as':_0x3c1ae6['as'],'attributes':_0x3c1ae6[_0xaf2c('0x1c')],'include':_0x3c1ae6[_0xaf2c('0x1e')]?_['map'](_0x3c1ae6[_0xaf2c('0x1e')],function(_0x2051be){return{'model':db[_0x2051be[_0xaf2c('0x1f')]],'as':_0x2051be['as'],'attributes':_0x2051be[_0xaf2c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fb190){logger['info'](_0xaf2c('0x21'),_0x278a28);logger[_0xaf2c('0xf')](_0xaf2c('0x21'),_0x278a28,JSON['stringify'](_0x3fb190));_0x1d544a(_0x3fb190);})[_0xaf2c('0x16')](function(_0x2ea490){logger[_0xaf2c('0x11')]('GetInterval',_0x2ea490[_0xaf2c('0x13')],_0x278a28);_0x578492(_0x474c80[_0xaf2c('0x11')](0x1f4,_0x2ea490[_0xaf2c('0x13')]));});});};exports[_0xaf2c('0x22')]=function(_0x59d858){var _0x3da072=this;return new Promise(function(_0x4072ff,_0x1be1ef){return db['Interval']['find']({'raw':_0x59d858[_0xaf2c('0x19')]?_0x59d858['options'][_0xaf2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x59d858['options']?_0x59d858[_0xaf2c('0x19')][_0xaf2c('0x1b')]||null:null,'attributes':_0x59d858['options']?_0x59d858[_0xaf2c('0x19')][_0xaf2c('0x1c')]||null:null,'include':_0x59d858['options']?_0x59d858[_0xaf2c('0x19')][_0xaf2c('0x1e')]?_[_0xaf2c('0x20')](_0x59d858[_0xaf2c('0x19')][_0xaf2c('0x1e')],function(_0x30ae30){return{'model':db[_0x30ae30['model']],'as':_0x30ae30['as'],'attributes':_0x30ae30[_0xaf2c('0x1c')],'include':_0x30ae30['include']?_[_0xaf2c('0x20')](_0x30ae30['include'],function(_0x3781f3){return{'model':db[_0x3781f3['model']],'as':_0x3781f3['as'],'attributes':_0x3781f3[_0xaf2c('0x1c')],'include':_0x3781f3['include']?_[_0xaf2c('0x20')](_0x3781f3['include'],function(_0x30fd87){return{'model':db[_0x30fd87[_0xaf2c('0x1f')]],'as':_0x30fd87['as'],'attributes':_0x30fd87[_0xaf2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaf2c('0x23')](function(_0x470aff){logger['info']('ShowInterval',_0x59d858);logger[_0xaf2c('0xf')](_0xaf2c('0x22'),_0x59d858,JSON[_0xaf2c('0x24')](_0x470aff));_0x4072ff(_0x470aff);})[_0xaf2c('0x16')](function(_0x4eeecf){logger[_0xaf2c('0x11')]('ShowInterval',_0x4eeecf[_0xaf2c('0x13')],_0x59d858);_0x1be1ef(_0x3da072[_0xaf2c('0x11')](0x1f4,_0x4eeecf['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index c5a9405..360709d 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e8b77,_0x5d473c){_0x2e8b77=_0x2e8b77-0x0;var _0xe01d2b=_0xb10b[_0x2e8b77];return _0xe01d2b;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x57e35f,_0x5d3646){var _0x5c0388=function(_0x1698ee){while(--_0x1698ee){_0x57e35f['push'](_0x57e35f['shift']());}};_0x5c0388(++_0x5d3646);}(_0x2032,0xd9));var _0x2203=function(_0xb58c71,_0x10b36a){_0xb58c71=_0xb58c71-0x0;var _0x58d0b2=_0x2032[_0xb58c71];return _0x58d0b2;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index fbc090c..5735b21 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 _0x0713=['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','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error'];(function(_0x2c26ca,_0x25473f){var _0x83b1b9=function(_0x3e3164){while(--_0x3e3164){_0x2c26ca['push'](_0x2c26ca['shift']());}};_0x83b1b9(++_0x25473f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var USERNAME=_0x3071('0x2');var PASSWORD=_0x3071('0x3');function openIssue(_0x864539,_0x52b5fb){var _0x2c547f={'fields':{'project':{'key':_0x864539[_0x3071('0x4')]||_0x3071('0x5')},'summary':(_0x864539[_0x3071('0x6')]||_0x3071('0x7'))+_0x3071('0x8')+_0x864539['ip'],'description':_0x864539[_0x3071('0x9')]||JSON[_0x3071('0xa')](_0x864539),'issuetype':{'name':_0x864539[_0x3071('0xb')]||_0x3071('0xc')}}};_0x2c547f[_0x3071('0xd')][_0x3071('0xe')]=_0x864539[_0x3071('0xf')];_0x2c547f['fields'][_0x3071('0x10')]=_0x864539[_0x3071('0x11')];_0x2c547f[_0x3071('0xd')][_0x3071('0x12')]=_0x864539[_0x3071('0x13')];_0x2c547f['fields'][_0x3071('0x14')]=_0x864539[_0x3071('0x15')];_0x2c547f[_0x3071('0xd')][_0x3071('0x16')]=_0x864539[_0x3071('0x17')];_0x2c547f['fields']['customfield_10102']=_0x864539['ip'];var _0x1826ca={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3071('0x18'),'method':_0x3071('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3071('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3071('0x1b'))}};var _0x45c93b=JSON[_0x3071('0xa')](_0x2c547f);var _0x1f14e1=https[_0x3071('0x1c')](_0x1826ca,function(_0x2a6a4b){_0x2a6a4b[_0x3071('0x1d')](_0x3071('0x1e'));var _0x21aad3='';_0x2a6a4b['on'](_0x3071('0x1f'),function(_0x5f3c22){_0x21aad3+=_0x5f3c22;});_0x2a6a4b['on'](_0x3071('0x20'),function(){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](_0x2a6a4b[_0x3071('0x22')])[_0x3071('0x23')](JSON[_0x3071('0x24')](_0x21aad3));}});});_0x1f14e1['on'](_0x3071('0x25'),function(_0x105bbb){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](0x1f4)['json']({'errors':[{'message':_0x3071('0x26'),'type':_0x3071('0x27')}]});}});_0x1f14e1[_0x3071('0x28')](_0x45c93b);_0x1f14e1['end']();}exports[_0x3071('0x29')]=openIssue;exports['send']=function(_0x833074,_0x43128c){_0x833074[_0x3071('0x2a')]['ip']=_0x833074[_0x3071('0x2b')][_0x3071('0x2c')]||_0x833074[_0x3071('0x2d')][_0x3071('0x2e')]||_0x833074[_0x3071('0x2f')]['remoteAddress']||_0x833074['connection'][_0x3071('0x2f')][_0x3071('0x2e')];return openIssue(_0x833074[_0x3071('0x2a')],_0x43128c);}; \ No newline at end of file +var _0xbaf0=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x59fccf,_0x16a857){var _0x2ad8c5=function(_0xc30ca7){while(--_0xc30ca7){_0x59fccf['push'](_0x59fccf['shift']());}};_0x2ad8c5(++_0x16a857);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require('bluebird');var https=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var USERNAME=_0x0baf('0x3');var PASSWORD=_0x0baf('0x4');function openIssue(_0x4d2e72,_0x5a3e42){var _0x232cc7={'fields':{'project':{'key':_0x4d2e72[_0x0baf('0x5')]||_0x0baf('0x6')},'summary':(_0x4d2e72[_0x0baf('0x7')]||_0x0baf('0x8'))+_0x0baf('0x9')+_0x4d2e72['ip'],'description':_0x4d2e72[_0x0baf('0xa')]||JSON[_0x0baf('0xb')](_0x4d2e72),'issuetype':{'name':_0x4d2e72[_0x0baf('0xc')]||'Bug'}}};_0x232cc7[_0x0baf('0xd')]['customfield_11500']=_0x4d2e72[_0x0baf('0xe')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0xf')]=_0x4d2e72[_0x0baf('0x10')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x11')]=_0x4d2e72[_0x0baf('0x12')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x13')]=_0x4d2e72[_0x0baf('0x14')];_0x232cc7[_0x0baf('0xd')]['customfield_11504']=_0x4d2e72['reason'];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x15')]=_0x4d2e72['ip'];var _0x5db689={'host':_0x0baf('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0baf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0baf('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0baf('0x19')](_0x0baf('0x1a'))}};var _0x2bc381=JSON[_0x0baf('0xb')](_0x232cc7);var _0x469599=https['request'](_0x5db689,function(_0x4cd79d){_0x4cd79d[_0x0baf('0x1b')](_0x0baf('0x1c'));var _0x283408='';_0x4cd79d['on'](_0x0baf('0x1d'),function(_0x2cf7da){_0x283408+=_0x2cf7da;});_0x4cd79d['on'](_0x0baf('0x1e'),function(){if(_0x5a3e42){return _0x5a3e42['status'](_0x4cd79d[_0x0baf('0x1f')])[_0x0baf('0x20')](JSON[_0x0baf('0x21')](_0x283408));}});});_0x469599['on'](_0x0baf('0x22'),function(_0x47070d){if(_0x5a3e42){return _0x5a3e42[_0x0baf('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0baf('0x24')}]});}});_0x469599[_0x0baf('0x25')](_0x2bc381);_0x469599[_0x0baf('0x1e')]();}exports[_0x0baf('0x26')]=openIssue;exports[_0x0baf('0x27')]=function(_0x3e3e20,_0x210cd8){_0x3e3e20[_0x0baf('0x28')]['ip']=_0x3e3e20[_0x0baf('0x29')][_0x0baf('0x2a')]||_0x3e3e20['connection'][_0x0baf('0x2b')]||_0x3e3e20['socket'][_0x0baf('0x2b')]||_0x3e3e20['connection']['socket'][_0x0baf('0x2b')];return openIssue(_0x3e3e20['body'],_0x210cd8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 76548d1..592275f 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 _0x9f42=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','show','/:id','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b32fd,_0x577e6b){var _0x8249f4=function(_0x3dfc5d){while(--_0x3dfc5d){_0x4b32fd['push'](_0x4b32fd['shift']());}};_0x8249f4(++_0x577e6b);}(_0x9f42,0x81));var _0x29f4=function(_0x2a5b82,_0xc61f63){_0x2a5b82=_0x2a5b82-0x0;var _0x322e1a=_0x9f42[_0x2a5b82];return _0x322e1a;};'use strict';var multer=require(_0x29f4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29f4('0x1'));var express=require(_0x29f4('0x2'));var router=express[_0x29f4('0x3')]();var auth=require(_0x29f4('0x4'));var interaction=require(_0x29f4('0x5'));var config=require(_0x29f4('0x6'));var controller=require(_0x29f4('0x7'));router[_0x29f4('0x8')]('/',auth[_0x29f4('0x9')](),controller[_0x29f4('0xa')]);router['get'](_0x29f4('0xb'),auth[_0x29f4('0x9')](),controller['describe']);router[_0x29f4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x29f4('0xc')]);router['post']('/',auth[_0x29f4('0x9')](),controller['create']);router['put'](_0x29f4('0xd'),auth[_0x29f4('0x9')](),controller[_0x29f4('0xe')]);router[_0x29f4('0xf')](_0x29f4('0xd'),auth[_0x29f4('0x9')](),controller[_0x29f4('0x10')]);module['exports']=router; \ No newline at end of file +var _0xacba=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','destroy','multer'];(function(_0xb86aad,_0xc54a45){var _0x570bca=function(_0x4a57f5){while(--_0x4a57f5){_0xb86aad['push'](_0xb86aad['shift']());}};_0x570bca(++_0xc54a45);}(_0xacba,0x84));var _0xaacb=function(_0x4c6680,_0x48d7ce){_0x4c6680=_0x4c6680-0x0;var _0x92acb4=_0xacba[_0x4c6680];return _0x92acb4;};'use strict';var multer=require(_0xaacb('0x0'));var util=require(_0xaacb('0x1'));var path=require(_0xaacb('0x2'));var timeout=require(_0xaacb('0x3'));var express=require(_0xaacb('0x4'));var router=express[_0xaacb('0x5')]();var auth=require(_0xaacb('0x6'));var interaction=require(_0xaacb('0x7'));var config=require(_0xaacb('0x8'));var controller=require('./jscriptyAnswerReport.controller');router[_0xaacb('0x9')]('/',auth[_0xaacb('0xa')](),controller[_0xaacb('0xb')]);router[_0xaacb('0x9')](_0xaacb('0xc'),auth[_0xaacb('0xa')](),controller[_0xaacb('0xd')]);router[_0xaacb('0x9')](_0xaacb('0xe'),auth[_0xaacb('0xa')](),controller[_0xaacb('0xf')]);router[_0xaacb('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xaacb('0xe'),auth[_0xaacb('0xa')](),controller[_0xaacb('0x11')]);router['delete'](_0xaacb('0xe'),auth[_0xaacb('0xa')](),controller[_0xaacb('0x12')]);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 ebda0de..a4b1650 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 _0xe3ee=['STRING','TEXT'];(function(_0x25d4ab,_0x307164){var _0x3b31f3=function(_0x12f56c){while(--_0x12f56c){_0x25d4ab['push'](_0x25d4ab['shift']());}};_0x3b31f3(++_0x307164);}(_0xe3ee,0x116));var _0xee3e=function(_0x118b07,_0x17daab){_0x118b07=_0x118b07-0x0;var _0x44505c=_0xe3ee[_0x118b07];return _0x44505c;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0xee3e('0x0')]},'answer':{'type':Sequelize[_0xee3e('0x1')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xee3e('0x0')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xee3e('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xee3e('0x0')]}}; \ No newline at end of file +var _0xf46a=['STRING','TEXT','sequelize'];(function(_0x36178e,_0x52a481){var _0x18ce36=function(_0x34a422){while(--_0x34a422){_0x36178e['push'](_0x36178e['shift']());}};_0x18ce36(++_0x52a481);}(_0xf46a,0xa4));var _0xaf46=function(_0x3e21c2,_0x11275a){_0x3e21c2=_0x3e21c2-0x0;var _0x1191e0=_0xf46a[_0x3e21c2];return _0x1191e0;};'use strict';var Sequelize=require(_0xaf46('0x0'));module['exports']={'question':{'type':Sequelize[_0xaf46('0x1')]},'answer':{'type':Sequelize[_0xaf46('0x2')]('long')},'membername':{'type':Sequelize[_0xaf46('0x1')]},'projectname':{'type':Sequelize[_0xaf46('0x1')]},'queue':{'type':Sequelize[_0xaf46('0x1')]},'uniqueid':{'type':Sequelize[_0xaf46('0x1')]},'calleridname':{'type':Sequelize[_0xaf46('0x1')]},'calleridnum':{'type':Sequelize[_0xaf46('0x1')]},'questionId':{'type':Sequelize[_0xaf46('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index fedd101..71b290d 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 _0x6921=['json','count','offset','limit','apply','reject','update','then','destroy','stack','name','send','index','JscriptyAnswerReport','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','field','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x518f92,_0x38d6c6){var _0x22fc15=function(_0x5b0653){while(--_0x5b0653){_0x518f92['push'](_0x518f92['shift']());}};_0x22fc15(++_0x38d6c6);}(_0x6921,0x1d1));var _0x1692=function(_0x4c17ea,_0x24d801){_0x4c17ea=_0x4c17ea-0x0;var _0x44c861=_0x6921[_0x4c17ea];return _0x44c861;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1692('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1692('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1692('0x2'));var moment=require(_0x1692('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1692('0x4'));var util=require('util');var path=require(_0x1692('0x5'));var sox=require(_0x1692('0x6'));var csv=require(_0x1692('0x7'));var ejs=require(_0x1692('0x8'));var fs=require('fs');var _=require(_0x1692('0x9'));var squel=require(_0x1692('0xa'));var crypto=require(_0x1692('0xb'));var jsforce=require(_0x1692('0xc'));var deskjs=require(_0x1692('0xd'));var toCsv=require(_0x1692('0x7'));var querystring=require(_0x1692('0xe'));var Papa=require('papaparse');var Redis=require(_0x1692('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1692('0x10'));var hardwareService=require(_0x1692('0x11'));var logger=require(_0x1692('0x12'))(_0x1692('0x13'));var utils=require(_0x1692('0x14'));var config=require(_0x1692('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44469e,_0x3b6fba){_0x3b6fba=_0x3b6fba||0xcc;return function(_0x1d8ae3){if(_0x1d8ae3){return _0x44469e[_0x1692('0x16')](_0x3b6fba);}return _0x44469e[_0x1692('0x17')](_0x3b6fba)[_0x1692('0x18')]();};}function respondWithResult(_0x5f5879,_0x2880b7){_0x2880b7=_0x2880b7||0xc8;return function(_0xa6e81){if(_0xa6e81){return _0x5f5879[_0x1692('0x17')](_0x2880b7)[_0x1692('0x19')](_0xa6e81);}};}function respondWithFilteredResult(_0x3f72e7,_0x306251){return function(_0x5e33d8){if(_0x5e33d8){var _0x1377e3=_0x5e33d8[_0x1692('0x1a')],_0x57401c=_0x306251['offset'],_0x12989e=_0x306251[_0x1692('0x1b')]+_0x306251[_0x1692('0x1c')],_0x4990b1;if(_0x12989e>=_0x1377e3){_0x12989e=_0x1377e3;_0x4990b1=0xc8;}else{_0x4990b1=0xce;}_0x3f72e7[_0x1692('0x17')](_0x4990b1);return _0x3f72e7['set']('Content-Range',_0x57401c+'-'+_0x12989e+'/'+_0x1377e3)[_0x1692('0x19')](_0x5e33d8);}return null;};}function patchUpdates(_0xed3d28){return function(_0x5bd72b){try{jsonpatch[_0x1692('0x1d')](_0x5bd72b,_0xed3d28,!![]);}catch(_0x4e6bfc){return BPromise[_0x1692('0x1e')](_0x4e6bfc);}return _0x5bd72b['save']();};}function saveUpdates(_0x4ddc0d,_0xd4e716){return function(_0x4e544b){if(_0x4e544b){return _0x4e544b[_0x1692('0x1f')](_0x4ddc0d)[_0x1692('0x20')](function(_0x26571d){return _0x26571d;});}return null;};}function removeEntity(_0x4c24c1,_0x234073){return function(_0x1d156a){if(_0x1d156a){return _0x1d156a[_0x1692('0x21')]()[_0x1692('0x20')](function(){_0x4c24c1[_0x1692('0x17')](0xcc)[_0x1692('0x18')]();});}};}function handleEntityNotFound(_0x4146af,_0x4e76ff){return function(_0x35ecc8){if(!_0x35ecc8){_0x4146af[_0x1692('0x16')](0x194);}return _0x35ecc8;};}function handleError(_0x50a11f,_0x5da39f){_0x5da39f=_0x5da39f||0x1f4;return function(_0x53d4a1){logger['error'](_0x53d4a1[_0x1692('0x22')]);if(_0x53d4a1['name']){delete _0x53d4a1[_0x1692('0x23')];}_0x50a11f[_0x1692('0x17')](_0x5da39f)[_0x1692('0x24')](_0x53d4a1);};}exports[_0x1692('0x25')]=function(_0xcf9e1f,_0x3f5c24){var _0x5a355b={},_0x1a6708={},_0x1a4e1c={'count':0x0,'rows':[]};var _0x429687=db[_0x1692('0x26')]['rawAttributes'];_0x1a6708['model']=_[_0x1692('0x27')](_0x429687);_0x1a6708[_0x1692('0x28')]=_[_0x1692('0x27')](_0xcf9e1f[_0x1692('0x28')]);_0x1a6708['filters']=_['intersection'](_0x1a6708['model'],_0x1a6708[_0x1692('0x28')]);_0x5a355b[_0x1692('0x29')]=_[_0x1692('0x2a')](_0x1a6708[_0x1692('0x2b')],qs[_0x1692('0x2c')](_0xcf9e1f[_0x1692('0x28')][_0x1692('0x2c')]));_0x5a355b[_0x1692('0x29')]=_0x5a355b['attributes'][_0x1692('0x2d')]?_0x5a355b['attributes']:_0x1a6708[_0x1692('0x2b')];if(!_0xcf9e1f[_0x1692('0x28')][_0x1692('0x2e')](_0x1692('0x2f'))){_0x5a355b['limit']=qs[_0x1692('0x1c')](_0xcf9e1f[_0x1692('0x28')][_0x1692('0x1c')]);_0x5a355b[_0x1692('0x1b')]=qs[_0x1692('0x1b')](_0xcf9e1f[_0x1692('0x28')]['offset']);}_0x5a355b[_0x1692('0x30')]=qs[_0x1692('0x31')](_0xcf9e1f[_0x1692('0x28')][_0x1692('0x31')]);_0x5a355b[_0x1692('0x32')]=qs[_0x1692('0x33')](_[_0x1692('0x34')](_0xcf9e1f[_0x1692('0x28')],_0x1a6708[_0x1692('0x33')]));if(_0xcf9e1f[_0x1692('0x28')][_0x1692('0x35')]){_0x5a355b[_0x1692('0x32')]=_[_0x1692('0x36')](_0x5a355b[_0x1692('0x32')],{'$or':_['map'](_0x429687,function(_0x216df2){if(_0x216df2[_0x1692('0x37')][_0x1692('0x38')]!=='VIRTUAL'){var _0x49cfda={};_0x49cfda[_0x216df2[_0x1692('0x39')]]={'$like':'%'+_0xcf9e1f[_0x1692('0x28')]['filter']+'%'};return _0x49cfda;}})});}_0x5a355b=_['merge']({},_0x5a355b,_0xcf9e1f['options']);var _0x45789e={'where':_0x5a355b[_0x1692('0x32')]};return db[_0x1692('0x26')][_0x1692('0x1a')](_0x45789e)[_0x1692('0x20')](function(_0x10a041){_0x1a4e1c[_0x1692('0x1a')]=_0x10a041;if(_0xcf9e1f[_0x1692('0x28')][_0x1692('0x3a')]){_0x5a355b[_0x1692('0x3b')]=[{'all':!![]}];}return db[_0x1692('0x26')][_0x1692('0x3c')](_0x5a355b);})['then'](function(_0xb03fbf){_0x1a4e1c[_0x1692('0x3d')]=_0xb03fbf;return _0x1a4e1c;})[_0x1692('0x20')](respondWithFilteredResult(_0x3f5c24,_0x5a355b))['catch'](handleError(_0x3f5c24,null));};exports[_0x1692('0x3e')]=function(_0x2e0771,_0x5b5a52){var _0x28b9e1={'raw':!![],'where':{'id':_0x2e0771[_0x1692('0x3f')]['id']}},_0x6c25a7={};_0x6c25a7['model']=_[_0x1692('0x27')](db[_0x1692('0x26')][_0x1692('0x40')]);_0x6c25a7[_0x1692('0x28')]=_[_0x1692('0x27')](_0x2e0771[_0x1692('0x28')]);_0x6c25a7[_0x1692('0x33')]=_[_0x1692('0x2a')](_0x6c25a7[_0x1692('0x2b')],_0x6c25a7[_0x1692('0x28')]);_0x28b9e1[_0x1692('0x29')]=_[_0x1692('0x2a')](_0x6c25a7[_0x1692('0x2b')],qs[_0x1692('0x2c')](_0x2e0771[_0x1692('0x28')][_0x1692('0x2c')]));_0x28b9e1[_0x1692('0x29')]=_0x28b9e1[_0x1692('0x29')][_0x1692('0x2d')]?_0x28b9e1[_0x1692('0x29')]:_0x6c25a7[_0x1692('0x2b')];if(_0x2e0771[_0x1692('0x28')][_0x1692('0x3a')]){_0x28b9e1['include']=[{'all':!![]}];}_0x28b9e1=_[_0x1692('0x36')]({},_0x28b9e1,_0x2e0771['options']);return db[_0x1692('0x26')][_0x1692('0x41')](_0x28b9e1)[_0x1692('0x20')](handleEntityNotFound(_0x5b5a52,null))[_0x1692('0x20')](respondWithResult(_0x5b5a52,null))['catch'](handleError(_0x5b5a52,null));};exports[_0x1692('0x42')]=function(_0x3165c4,_0x387177){return db[_0x1692('0x26')][_0x1692('0x42')](_0x3165c4[_0x1692('0x43')],{})[_0x1692('0x20')](respondWithResult(_0x387177,0xc9))[_0x1692('0x44')](handleError(_0x387177,null));};exports[_0x1692('0x1f')]=function(_0x6224a7,_0x55d8d1){if(_0x6224a7['body']['id']){delete _0x6224a7[_0x1692('0x43')]['id'];}return db[_0x1692('0x26')][_0x1692('0x41')]({'where':{'id':_0x6224a7[_0x1692('0x3f')]['id']}})[_0x1692('0x20')](handleEntityNotFound(_0x55d8d1,null))[_0x1692('0x20')](saveUpdates(_0x6224a7['body'],null))['then'](respondWithResult(_0x55d8d1,null))['catch'](handleError(_0x55d8d1,null));};exports[_0x1692('0x21')]=function(_0xffbb6,_0x38d869){return db[_0x1692('0x26')][_0x1692('0x41')]({'where':{'id':_0xffbb6['params']['id']}})['then'](handleEntityNotFound(_0x38d869,null))[_0x1692('0x20')](removeEntity(_0x38d869,null))['catch'](handleError(_0x38d869,null));};exports[_0x1692('0x45')]=function(_0x412beb,_0x511f21){return db[_0x1692('0x26')][_0x1692('0x45')]()[_0x1692('0x20')](respondWithResult(_0x511f21,null))[_0x1692('0x44')](handleError(_0x511f21,null));}; \ No newline at end of file +var _0x826a=['hasOwnProperty','nolimit','sort','where','pick','filter','key','VIRTUAL','field','merge','options','include','catch','show','params','includeAll','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','name','send','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length'];(function(_0x5eeb8f,_0x20e0d2){var _0x465583=function(_0x3f79cf){while(--_0x3f79cf){_0x5eeb8f['push'](_0x5eeb8f['shift']());}};_0x465583(++_0x20e0d2);}(_0x826a,0x1aa));var _0xa826=function(_0xed7039,_0x4fc624){_0xed7039=_0xed7039-0x0;var _0x39e9fe=_0x826a[_0xed7039];return _0x39e9fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa826('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa826('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa826('0x2'));var moment=require(_0xa826('0x3'));var BPromise=require(_0xa826('0x4'));var Mustache=require(_0xa826('0x5'));var util=require('util');var path=require(_0xa826('0x6'));var sox=require(_0xa826('0x7'));var csv=require(_0xa826('0x8'));var ejs=require(_0xa826('0x9'));var fs=require('fs');var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x8'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var hardwareService=require(_0xa826('0x14'));var logger=require('../../config/logger')(_0xa826('0x15'));var utils=require('../../config/utils');var config=require(_0xa826('0x16'));var db=require(_0xa826('0x17'))['db'];function respondWithStatusCode(_0x286500,_0xa55bd7){_0xa55bd7=_0xa55bd7||0xcc;return function(_0x212fac){if(_0x212fac){return _0x286500[_0xa826('0x18')](_0xa55bd7);}return _0x286500[_0xa826('0x19')](_0xa55bd7)['end']();};}function respondWithResult(_0x74f6ec,_0x5c6cee){_0x5c6cee=_0x5c6cee||0xc8;return function(_0x3e99b0){if(_0x3e99b0){return _0x74f6ec[_0xa826('0x19')](_0x5c6cee)['json'](_0x3e99b0);}};}function respondWithFilteredResult(_0x512ba9,_0x49c91e){return function(_0x1b6d16){if(_0x1b6d16){var _0x4f25bd=_0x1b6d16[_0xa826('0x1a')],_0x4c546b=_0x49c91e['offset'],_0x9a3788=_0x49c91e[_0xa826('0x1b')]+_0x49c91e[_0xa826('0x1c')],_0x142474;if(_0x9a3788>=_0x4f25bd){_0x9a3788=_0x4f25bd;_0x142474=0xc8;}else{_0x142474=0xce;}_0x512ba9[_0xa826('0x19')](_0x142474);return _0x512ba9[_0xa826('0x1d')](_0xa826('0x1e'),_0x4c546b+'-'+_0x9a3788+'/'+_0x4f25bd)['json'](_0x1b6d16);}return null;};}function patchUpdates(_0x3c9aa7){return function(_0x2938ba){try{jsonpatch[_0xa826('0x1f')](_0x2938ba,_0x3c9aa7,!![]);}catch(_0x57e96e){return BPromise['reject'](_0x57e96e);}return _0x2938ba[_0xa826('0x20')]();};}function saveUpdates(_0x1542fd,_0xd8ca56){return function(_0x8d1650){if(_0x8d1650){return _0x8d1650[_0xa826('0x21')](_0x1542fd)['then'](function(_0x3171ff){return _0x3171ff;});}return null;};}function removeEntity(_0x2e7e90,_0x3272fb){return function(_0x5d410f){if(_0x5d410f){return _0x5d410f['destroy']()[_0xa826('0x22')](function(){_0x2e7e90[_0xa826('0x19')](0xcc)[_0xa826('0x23')]();});}};}function handleEntityNotFound(_0x4eb4f3,_0x1d7adf){return function(_0x26ef25){if(!_0x26ef25){_0x4eb4f3[_0xa826('0x18')](0x194);}return _0x26ef25;};}function handleError(_0x448b4d,_0x1ec8a8){_0x1ec8a8=_0x1ec8a8||0x1f4;return function(_0x4d6909){logger[_0xa826('0x24')](_0x4d6909['stack']);if(_0x4d6909[_0xa826('0x25')]){delete _0x4d6909[_0xa826('0x25')];}_0x448b4d['status'](_0x1ec8a8)[_0xa826('0x26')](_0x4d6909);};}exports[_0xa826('0x27')]=function(_0x38c919,_0xf132e0){var _0x1107a4={},_0x3c6307={},_0x14e836={'count':0x0,'rows':[]};var _0x3b9c6d=db[_0xa826('0x28')][_0xa826('0x29')];_0x3c6307[_0xa826('0x2a')]=_[_0xa826('0x2b')](_0x3b9c6d);_0x3c6307[_0xa826('0x2c')]=_[_0xa826('0x2b')](_0x38c919[_0xa826('0x2c')]);_0x3c6307[_0xa826('0x2d')]=_['intersection'](_0x3c6307[_0xa826('0x2a')],_0x3c6307['query']);_0x1107a4[_0xa826('0x2e')]=_[_0xa826('0x2f')](_0x3c6307[_0xa826('0x2a')],qs[_0xa826('0x30')](_0x38c919[_0xa826('0x2c')]['fields']));_0x1107a4['attributes']=_0x1107a4[_0xa826('0x2e')][_0xa826('0x31')]?_0x1107a4[_0xa826('0x2e')]:_0x3c6307[_0xa826('0x2a')];if(!_0x38c919['query'][_0xa826('0x32')](_0xa826('0x33'))){_0x1107a4['limit']=qs[_0xa826('0x1c')](_0x38c919['query'][_0xa826('0x1c')]);_0x1107a4[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x38c919[_0xa826('0x2c')][_0xa826('0x1b')]);}_0x1107a4['order']=qs[_0xa826('0x34')](_0x38c919[_0xa826('0x2c')][_0xa826('0x34')]);_0x1107a4[_0xa826('0x35')]=qs[_0xa826('0x2d')](_[_0xa826('0x36')](_0x38c919[_0xa826('0x2c')],_0x3c6307[_0xa826('0x2d')]));if(_0x38c919[_0xa826('0x2c')][_0xa826('0x37')]){_0x1107a4[_0xa826('0x35')]=_['merge'](_0x1107a4[_0xa826('0x35')],{'$or':_['map'](_0x3b9c6d,function(_0x3828a6){if(_0x3828a6['type'][_0xa826('0x38')]!==_0xa826('0x39')){var _0x31889f={};_0x31889f[_0x3828a6[_0xa826('0x3a')]]={'$like':'%'+_0x38c919[_0xa826('0x2c')][_0xa826('0x37')]+'%'};return _0x31889f;}})});}_0x1107a4=_[_0xa826('0x3b')]({},_0x1107a4,_0x38c919[_0xa826('0x3c')]);var _0x22a45e={'where':_0x1107a4[_0xa826('0x35')]};return db[_0xa826('0x28')][_0xa826('0x1a')](_0x22a45e)['then'](function(_0x3abd07){_0x14e836[_0xa826('0x1a')]=_0x3abd07;if(_0x38c919[_0xa826('0x2c')]['includeAll']){_0x1107a4[_0xa826('0x3d')]=[{'all':!![]}];}return db[_0xa826('0x28')]['findAll'](_0x1107a4);})[_0xa826('0x22')](function(_0x47d9f1){_0x14e836['rows']=_0x47d9f1;return _0x14e836;})[_0xa826('0x22')](respondWithFilteredResult(_0xf132e0,_0x1107a4))[_0xa826('0x3e')](handleError(_0xf132e0,null));};exports[_0xa826('0x3f')]=function(_0x308d4,_0x451814){var _0x322187={'raw':!![],'where':{'id':_0x308d4[_0xa826('0x40')]['id']}},_0x4de11c={};_0x4de11c[_0xa826('0x2a')]=_[_0xa826('0x2b')](db[_0xa826('0x28')][_0xa826('0x29')]);_0x4de11c[_0xa826('0x2c')]=_['keys'](_0x308d4[_0xa826('0x2c')]);_0x4de11c[_0xa826('0x2d')]=_[_0xa826('0x2f')](_0x4de11c[_0xa826('0x2a')],_0x4de11c[_0xa826('0x2c')]);_0x322187['attributes']=_[_0xa826('0x2f')](_0x4de11c[_0xa826('0x2a')],qs[_0xa826('0x30')](_0x308d4[_0xa826('0x2c')][_0xa826('0x30')]));_0x322187[_0xa826('0x2e')]=_0x322187[_0xa826('0x2e')][_0xa826('0x31')]?_0x322187[_0xa826('0x2e')]:_0x4de11c[_0xa826('0x2a')];if(_0x308d4[_0xa826('0x2c')][_0xa826('0x41')]){_0x322187['include']=[{'all':!![]}];}_0x322187=_[_0xa826('0x3b')]({},_0x322187,_0x308d4[_0xa826('0x3c')]);return db[_0xa826('0x28')]['find'](_0x322187)[_0xa826('0x22')](handleEntityNotFound(_0x451814,null))[_0xa826('0x22')](respondWithResult(_0x451814,null))[_0xa826('0x3e')](handleError(_0x451814,null));};exports[_0xa826('0x42')]=function(_0xf35854,_0x58ac74){return db[_0xa826('0x28')][_0xa826('0x42')](_0xf35854[_0xa826('0x43')],{})[_0xa826('0x22')](respondWithResult(_0x58ac74,0xc9))[_0xa826('0x3e')](handleError(_0x58ac74,null));};exports[_0xa826('0x21')]=function(_0xe5b5e5,_0x5def02){if(_0xe5b5e5[_0xa826('0x43')]['id']){delete _0xe5b5e5['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0xe5b5e5[_0xa826('0x40')]['id']}})[_0xa826('0x22')](handleEntityNotFound(_0x5def02,null))[_0xa826('0x22')](saveUpdates(_0xe5b5e5[_0xa826('0x43')],null))['then'](respondWithResult(_0x5def02,null))[_0xa826('0x3e')](handleError(_0x5def02,null));};exports['destroy']=function(_0x5e0947,_0xedcbc2){return db[_0xa826('0x28')]['find']({'where':{'id':_0x5e0947[_0xa826('0x40')]['id']}})[_0xa826('0x22')](handleEntityNotFound(_0xedcbc2,null))['then'](removeEntity(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['describe']=function(_0x4c469a,_0x5782a0){return db['JscriptyAnswerReport']['describe']()[_0xa826('0x22')](respondWithResult(_0x5782a0,null))['catch'](handleError(_0x5782a0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 62db69d..74e28b6 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 _0x61ee=['JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x469218,_0x440d05){var _0x187b4a=function(_0x72ec86){while(--_0x72ec86){_0x469218['push'](_0x469218['shift']());}};_0x187b4a(++_0x440d05);}(_0x61ee,0x182));var _0xe61e=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x61ee[_0x44a3b0];return _0x39e6f6;};'use strict';var _=require(_0xe61e('0x0'));var util=require('util');var logger=require(_0xe61e('0x1'))(_0xe61e('0x2'));var moment=require('moment');var BPromise=require(_0xe61e('0x3'));var rp=require(_0xe61e('0x4'));var fs=require('fs');var path=require(_0xe61e('0x5'));var rimraf=require(_0xe61e('0x6'));var config=require(_0xe61e('0x7'));var attributes=require(_0xe61e('0x8'));module[_0xe61e('0x9')]=function(_0x1b9747,_0x599046){return _0x1b9747['define'](_0xe61e('0xa'),attributes,{'tableName':_0xe61e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b34=['bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1b34,0x174));var _0x41b3=function(_0x5df7c9,_0x46f17f){_0x5df7c9=_0x5df7c9-0x0;var _0x18825c=_0x1b34[_0x5df7c9];return _0x18825c;};'use strict';var _=require('lodash');var util=require(_0x41b3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x41b3('0x1'));var BPromise=require(_0x41b3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41b3('0x3'));var rimraf=require(_0x41b3('0x4'));var config=require(_0x41b3('0x5'));var attributes=require(_0x41b3('0x6'));module[_0x41b3('0x7')]=function(_0x1fc654,_0x4131a9){return _0x1fc654[_0x41b3('0x8')](_0x41b3('0x9'),attributes,{'tableName':_0x41b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 5b95506..cf2cef7 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 _0xdb3a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb3a,0x163));var _0xadb3=function(_0x5850e0,_0x2c3e9a){_0x5850e0=_0x5850e0-0x0;var _0x3d0697=_0xdb3a[_0x5850e0];return _0x3d0697;};'use strict';var _=require(_0xadb3('0x0'));var util=require('util');var moment=require(_0xadb3('0x1'));var BPromise=require(_0xadb3('0x2'));var rs=require(_0xadb3('0x3'));var fs=require('fs');var Redis=require(_0xadb3('0x4'));var db=require(_0xadb3('0x5'))['db'];var utils=require(_0xadb3('0x6'));var logger=require(_0xadb3('0x7'))('rpc');var config=require(_0xadb3('0x8'));var jayson=require(_0xadb3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5cca,_0x18b908,_0x4d45c6){return new BPromise(function(_0x5794a2,_0x2ea6f4){return client[_0xadb3('0xa')](_0x3d5cca,_0x4d45c6)[_0xadb3('0xb')](function(_0x3fce02){logger[_0xadb3('0xc')](_0xadb3('0xd'),_0x18b908,_0xadb3('0xe'));logger[_0xadb3('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x18b908,'request\x20sent',JSON[_0xadb3('0x10')](_0x3fce02));if(_0x3fce02[_0xadb3('0x11')]){if(_0x3fce02[_0xadb3('0x11')]['code']===0x1f4){logger['error'](_0xadb3('0xd'),_0x18b908,_0x3fce02[_0xadb3('0x11')][_0xadb3('0x12')]);return _0x2ea6f4(_0x3fce02['error'][_0xadb3('0x12')]);}logger['error'](_0xadb3('0xd'),_0x18b908,_0x3fce02['error'][_0xadb3('0x12')]);return _0x5794a2(_0x3fce02['error'][_0xadb3('0x12')]);}else{logger[_0xadb3('0xc')](_0xadb3('0xd'),_0x18b908,'request\x20sent');_0x5794a2(_0x3fce02[_0xadb3('0x13')][_0xadb3('0x12')]);}})[_0xadb3('0x14')](function(_0x23bcf3){logger['error'](_0xadb3('0xd'),_0x18b908,_0x23bcf3);_0x2ea6f4(_0x23bcf3);});});} \ No newline at end of file +var _0xeb6c=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x1917c0,_0x14cfb2){_0x1917c0=_0x1917c0-0x0;var _0x4c9e04=_0xeb6c[_0x1917c0];return _0x4c9e04;};'use strict';var _=require(_0xceb6('0x0'));var util=require(_0xceb6('0x1'));var moment=require(_0xceb6('0x2'));var BPromise=require(_0xceb6('0x3'));var rs=require(_0xceb6('0x4'));var fs=require('fs');var Redis=require(_0xceb6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xceb6('0x6'));var logger=require(_0xceb6('0x7'))('rpc');var config=require(_0xceb6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xceb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ea10,_0xe8a99,_0x358563){return new BPromise(function(_0x46fa5e,_0x3acaf0){return client['request'](_0x17ea10,_0x358563)[_0xceb6('0xa')](function(_0x2b1b6e){logger[_0xceb6('0xb')](_0xceb6('0xc'),_0xe8a99,_0xceb6('0xd'));logger[_0xceb6('0xe')](_0xceb6('0xf'),_0xe8a99,_0xceb6('0xd'),JSON[_0xceb6('0x10')](_0x2b1b6e));if(_0x2b1b6e[_0xceb6('0x11')]){if(_0x2b1b6e['error'][_0xceb6('0x12')]===0x1f4){logger['error'](_0xceb6('0xc'),_0xe8a99,_0x2b1b6e[_0xceb6('0x11')][_0xceb6('0x13')]);return _0x3acaf0(_0x2b1b6e['error'][_0xceb6('0x13')]);}logger['error'](_0xceb6('0xc'),_0xe8a99,_0x2b1b6e[_0xceb6('0x11')][_0xceb6('0x13')]);return _0x46fa5e(_0x2b1b6e['error']['message']);}else{logger['info'](_0xceb6('0xc'),_0xe8a99,'request\x20sent');_0x46fa5e(_0x2b1b6e[_0xceb6('0x14')][_0xceb6('0x13')]);}})[_0xceb6('0x15')](function(_0x356654){logger['error'](_0xceb6('0xc'),_0xe8a99,_0x356654);_0x3acaf0(_0x356654);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 7dc64d3..0401808 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 _0x1918=['get','index','isAuthenticated','show','/:id/sessions','getAnswers','/:id/summary','post','create','clone','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1918,0x1dd));var _0x8191=function(_0x5bdb23,_0x446a6d){_0x5bdb23=_0x5bdb23-0x0;var _0x1c1372=_0x1918[_0x5bdb23];return _0x1c1372;};'use strict';var multer=require('multer');var util=require(_0x8191('0x0'));var path=require(_0x8191('0x1'));var timeout=require('connect-timeout');var express=require(_0x8191('0x2'));var router=express[_0x8191('0x3')]();var auth=require(_0x8191('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8191('0x5'));var controller=require(_0x8191('0x6'));router[_0x8191('0x7')]('/',auth['isAuthenticated'](),controller[_0x8191('0x8')]);router[_0x8191('0x7')]('/:id',auth[_0x8191('0x9')](),controller[_0x8191('0xa')]);router[_0x8191('0x7')](_0x8191('0xb'),auth['isAuthenticated'](),controller['getSessions']);router[_0x8191('0x7')]('/:id/answers',auth['isAuthenticated'](),controller[_0x8191('0xc')]);router['get'](_0x8191('0xd'),auth['isAuthenticated'](),timeout('30s'),controller['getSummary']);router[_0x8191('0xe')]('/',auth[_0x8191('0x9')](),controller[_0x8191('0xf')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x8191('0x10')]);router['put'](_0x8191('0x11'),auth[_0x8191('0x9')](),controller[_0x8191('0x12')]);router[_0x8191('0x13')]('/:id',auth[_0x8191('0x9')](),controller[_0x8191('0x14')]);module[_0x8191('0x15')]=router; \ No newline at end of file +var _0x7d34=['/:id','/:id/sessions','isAuthenticated','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','clone','put','delete','destroy','exports','multer','path','express','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get'];(function(_0x3ddd29,_0x26f096){var _0x34cb20=function(_0x6bbb15){while(--_0x6bbb15){_0x3ddd29['push'](_0x3ddd29['shift']());}};_0x34cb20(++_0x26f096);}(_0x7d34,0x7c));var _0x47d3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7d34[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x47d3('0x0'));var util=require('util');var path=require(_0x47d3('0x1'));var timeout=require('connect-timeout');var express=require(_0x47d3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x47d3('0x3'));var config=require(_0x47d3('0x4'));var controller=require(_0x47d3('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x47d3('0x6')]);router[_0x47d3('0x7')](_0x47d3('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0x47d3('0x9'),auth[_0x47d3('0xa')](),controller['getSessions']);router[_0x47d3('0x7')](_0x47d3('0xb'),auth[_0x47d3('0xa')](),controller[_0x47d3('0xc')]);router[_0x47d3('0x7')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x47d3('0xd')),controller[_0x47d3('0xe')]);router[_0x47d3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47d3('0xf')](_0x47d3('0x10'),auth[_0x47d3('0xa')](),controller[_0x47d3('0x11')]);router[_0x47d3('0x12')]('/:id',auth[_0x47d3('0xa')](),controller['update']);router[_0x47d3('0x13')](_0x47d3('0x8'),auth[_0x47d3('0xa')](),controller[_0x47d3('0x14')]);module[_0x47d3('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2cf088b..51a5c3d 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 _0x8f67=['getDataValue','name','BOOLEAN','lodash','util','exports','STRING','TEXT','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x55b78c,_0x415442){var _0x59e374=function(_0x47ab36){while(--_0x47ab36){_0x55b78c['push'](_0x55b78c['shift']());}};_0x59e374(++_0x415442);}(_0x8f67,0x99));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x78f6('0x0'));var util=require(_0x78f6('0x1'));module[_0x78f6('0x2')]={'name':{'type':Sequelize[_0x78f6('0x3')],'unique':'name'},'description':{'type':Sequelize[_0x78f6('0x3')]},'formData':{'type':Sequelize[_0x78f6('0x4')]('long'),'set':function(_0x6c45aa){if(_[_0x78f6('0x5')](_0x6c45aa)){this['setDataValue'](_0x78f6('0x6'),JSON[_0x78f6('0x7')](_0x6c45aa));}else if(_[_0x78f6('0x8')](_0x6c45aa)){this[_0x78f6('0x9')](_0x78f6('0x6'),_0x6c45aa);}else{this['setDataValue'](_0x78f6('0x6'),util[_0x78f6('0xa')](_0x78f6('0xb'),this[_0x78f6('0xc')](_0x78f6('0xd'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x78f6('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6228=['formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','STRING','TEXT','long','isObjectLike','setDataValue'];(function(_0x5d5b64,_0x5d8990){var _0x51158f=function(_0x260763){while(--_0x260763){_0x5d5b64['push'](_0x5d5b64['shift']());}};_0x51158f(++_0x5d8990);}(_0x6228,0x1c9));var _0x8622=function(_0xccdaec,_0x5a1e55){_0xccdaec=_0xccdaec-0x0;var _0x48156a=_0x6228[_0xccdaec];return _0x48156a;};'use strict';var Sequelize=require(_0x8622('0x0'));var _=require(_0x8622('0x1'));var util=require(_0x8622('0x2'));module['exports']={'name':{'type':Sequelize[_0x8622('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8622('0x4')](_0x8622('0x5')),'set':function(_0x4ceb50){if(_[_0x8622('0x6')](_0x4ceb50)){this[_0x8622('0x7')](_0x8622('0x8'),JSON['stringify'](_0x4ceb50));}else if(_[_0x8622('0x9')](_0x4ceb50)){this[_0x8622('0x7')](_0x8622('0x8'),_0x4ceb50);}else{this[_0x8622('0x7')](_0x8622('0x8'),util['format'](_0x8622('0xa'),this[_0x8622('0xb')](_0x8622('0xc'))||'',this[_0x8622('0xb')](_0x8622('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8622('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index eb61805..44b9752 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 _0x4bad=['user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','include','omit','createdAt','UserProfileSection','autoAssociation','getSessions','JscriptySessionReport','order','findAll','findOne','JscriptyAnswerReport','ProjectId','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','now','/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','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','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','limit','set','Content-Range','apply','save','update','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','send','index','JscriptyProject','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','count','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0x4bad,0x116));var _0xd4ba=function(_0x17fa7b,_0x3778d9){_0x17fa7b=_0x17fa7b-0x0;var _0x10ee4e=_0x4bad[_0x17fa7b];return _0x10ee4e;};'use strict';var pdf=require(_0xd4ba('0x0'));var emlformat=require(_0xd4ba('0x1'));var rimraf=require(_0xd4ba('0x2'));var zipdir=require(_0xd4ba('0x3'));var jsonpatch=require(_0xd4ba('0x4'));var rp=require(_0xd4ba('0x5'));var moment=require(_0xd4ba('0x6'));var BPromise=require(_0xd4ba('0x7'));var Mustache=require(_0xd4ba('0x8'));var util=require('util');var path=require(_0xd4ba('0x9'));var sox=require(_0xd4ba('0xa'));var csv=require(_0xd4ba('0xb'));var ejs=require(_0xd4ba('0xc'));var fs=require('fs');var _=require(_0xd4ba('0xd'));var squel=require(_0xd4ba('0xe'));var crypto=require(_0xd4ba('0xf'));var jsforce=require(_0xd4ba('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd4ba('0xb'));var querystring=require(_0xd4ba('0x11'));var Papa=require(_0xd4ba('0x12'));var Redis=require(_0xd4ba('0x13'));var authService=require(_0xd4ba('0x14'));var qs=require(_0xd4ba('0x15'));var hardwareService=require(_0xd4ba('0x16'));var logger=require(_0xd4ba('0x17'))(_0xd4ba('0x18'));var utils=require(_0xd4ba('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x372cd5,_0x4a45ff){_0x4a45ff=_0x4a45ff||0xcc;return function(_0x3ecb3c){if(_0x3ecb3c){return _0x372cd5[_0xd4ba('0x1a')](_0x4a45ff);}return _0x372cd5[_0xd4ba('0x1b')](_0x4a45ff)['end']();};}function respondWithResult(_0x433ad5,_0x9303f6){_0x9303f6=_0x9303f6||0xc8;return function(_0x145a19){if(_0x145a19){return _0x433ad5[_0xd4ba('0x1b')](_0x9303f6)[_0xd4ba('0x1c')](_0x145a19);}};}function respondWithFilteredResult(_0x1629b9,_0x1f5e9e){return function(_0x1413cf){if(_0x1413cf){var _0x52672f=_0x1413cf['count'],_0x3fec01=_0x1f5e9e['offset'],_0x54bb03=_0x1f5e9e['offset']+_0x1f5e9e[_0xd4ba('0x1d')],_0x4533ee;if(_0x54bb03>=_0x52672f){_0x54bb03=_0x52672f;_0x4533ee=0xc8;}else{_0x4533ee=0xce;}_0x1629b9[_0xd4ba('0x1b')](_0x4533ee);return _0x1629b9[_0xd4ba('0x1e')](_0xd4ba('0x1f'),_0x3fec01+'-'+_0x54bb03+'/'+_0x52672f)['json'](_0x1413cf);}return null;};}function patchUpdates(_0x36ce61){return function(_0x30798d){try{jsonpatch[_0xd4ba('0x20')](_0x30798d,_0x36ce61,!![]);}catch(_0x586f02){return BPromise['reject'](_0x586f02);}return _0x30798d[_0xd4ba('0x21')]();};}function saveUpdates(_0x5066ed,_0x261307){return function(_0x416659){if(_0x416659){return _0x416659[_0xd4ba('0x22')](_0x5066ed)[_0xd4ba('0x23')](function(_0x3c3487){return _0x3c3487;});}return null;};}function removeEntity(_0x1f10e4,_0x30e2a2){return function(_0x4e4418){if(_0x4e4418){return _0x4e4418[_0xd4ba('0x24')]()[_0xd4ba('0x23')](function(){var _0x21ce06=_0x4e4418[_0xd4ba('0x25')]({'plain':!![]});var _0x40f066=_0xd4ba('0x26');return db[_0xd4ba('0x27')][_0xd4ba('0x24')]({'where':{'type':_0x40f066,'resourceId':_0x21ce06['id']}})['then'](function(){return _0x4e4418;});})[_0xd4ba('0x23')](function(){_0x1f10e4[_0xd4ba('0x1b')](0xcc)[_0xd4ba('0x28')]();});}};}function handleEntityNotFound(_0x1d10ce,_0x1f6cdf){return function(_0x1e8552){if(!_0x1e8552){_0x1d10ce[_0xd4ba('0x1a')](0x194);}return _0x1e8552;};}function handleError(_0x4efe46,_0x3b2545){_0x3b2545=_0x3b2545||0x1f4;return function(_0x2414d2){logger[_0xd4ba('0x29')](_0x2414d2[_0xd4ba('0x2a')]);if(_0x2414d2[_0xd4ba('0x2b')]){delete _0x2414d2[_0xd4ba('0x2b')];}_0x4efe46[_0xd4ba('0x1b')](_0x3b2545)[_0xd4ba('0x2c')](_0x2414d2);};}exports[_0xd4ba('0x2d')]=function(_0x43554a,_0x558d66){var _0x28612c={},_0x252d05={},_0x3a098e={'count':0x0,'rows':[]};var _0xc7c45=db[_0xd4ba('0x2e')]['rawAttributes'];_0x252d05[_0xd4ba('0x2f')]=_[_0xd4ba('0x30')](_0xc7c45);_0x252d05['query']=_['keys'](_0x43554a['query']);_0x252d05[_0xd4ba('0x31')]=_[_0xd4ba('0x32')](_0x252d05[_0xd4ba('0x2f')],_0x252d05[_0xd4ba('0x33')]);_0x28612c[_0xd4ba('0x34')]=_[_0xd4ba('0x32')](_0x252d05[_0xd4ba('0x2f')],qs[_0xd4ba('0x35')](_0x43554a[_0xd4ba('0x33')][_0xd4ba('0x35')]));_0x28612c[_0xd4ba('0x34')]=_0x28612c[_0xd4ba('0x34')][_0xd4ba('0x36')]?_0x28612c[_0xd4ba('0x34')]:_0x252d05['model'];if(!_0x43554a[_0xd4ba('0x33')][_0xd4ba('0x37')](_0xd4ba('0x38'))){_0x28612c['limit']=qs[_0xd4ba('0x1d')](_0x43554a[_0xd4ba('0x33')]['limit']);_0x28612c['offset']=qs[_0xd4ba('0x39')](_0x43554a['query']['offset']);}_0x28612c['order']=qs[_0xd4ba('0x3a')](_0x43554a['query'][_0xd4ba('0x3a')]);_0x28612c[_0xd4ba('0x3b')]=qs[_0xd4ba('0x31')](_[_0xd4ba('0x3c')](_0x43554a[_0xd4ba('0x33')],_0x252d05[_0xd4ba('0x31')]));if(_0x43554a[_0xd4ba('0x33')]['filter']){_0x28612c['where']=_[_0xd4ba('0x3d')](_0x28612c['where'],{'$or':_[_0xd4ba('0x3e')](_0xc7c45,function(_0x2e99c4){if(_0x2e99c4[_0xd4ba('0x3f')]['key']!==_0xd4ba('0x40')){var _0x50c98a={};_0x50c98a[_0x2e99c4[_0xd4ba('0x41')]]={'$like':'%'+_0x43554a[_0xd4ba('0x33')][_0xd4ba('0x42')]+'%'};return _0x50c98a;}})});}_0x28612c=_[_0xd4ba('0x3d')]({},_0x28612c,_0x43554a[_0xd4ba('0x43')]);var _0x5dadbc={'where':_0x28612c['where']};return db[_0xd4ba('0x2e')][_0xd4ba('0x44')](_0x5dadbc)[_0xd4ba('0x23')](function(_0x2c601e){_0x3a098e[_0xd4ba('0x44')]=_0x2c601e;if(_0x43554a[_0xd4ba('0x33')]['includeAll']){_0x28612c['include']=[{'all':!![]}];}return db[_0xd4ba('0x2e')]['findAll'](_0x28612c);})['then'](function(_0x3d26e2){_0x3a098e[_0xd4ba('0x45')]=_0x3d26e2;return _0x3a098e;})['then'](respondWithFilteredResult(_0x558d66,_0x28612c))[_0xd4ba('0x46')](handleError(_0x558d66,null));};exports[_0xd4ba('0x47')]=function(_0x310083,_0x1fffd9){var _0x5794c0={'raw':![],'where':{'id':_0x310083[_0xd4ba('0x48')]['id']}},_0xb442e5={};_0xb442e5[_0xd4ba('0x2f')]=_[_0xd4ba('0x30')](db['JscriptyProject'][_0xd4ba('0x49')]);_0xb442e5[_0xd4ba('0x33')]=_[_0xd4ba('0x30')](_0x310083[_0xd4ba('0x33')]);_0xb442e5[_0xd4ba('0x31')]=_[_0xd4ba('0x32')](_0xb442e5[_0xd4ba('0x2f')],_0xb442e5[_0xd4ba('0x33')]);_0x5794c0[_0xd4ba('0x34')]=_[_0xd4ba('0x32')](_0xb442e5['model'],qs[_0xd4ba('0x35')](_0x310083[_0xd4ba('0x33')][_0xd4ba('0x35')]));_0x5794c0[_0xd4ba('0x34')]=_0x5794c0[_0xd4ba('0x34')][_0xd4ba('0x36')]?_0x5794c0[_0xd4ba('0x34')]:_0xb442e5['model'];if(_0x310083[_0xd4ba('0x33')]['includeAll']){_0x5794c0['include']=[{'all':!![]}];}_0x5794c0=_[_0xd4ba('0x3d')]({},_0x5794c0,_0x310083[_0xd4ba('0x43')]);return db[_0xd4ba('0x2e')][_0xd4ba('0x4a')](_0x5794c0)['then'](handleEntityNotFound(_0x1fffd9,null))['then'](respondWithResult(_0x1fffd9,null))['catch'](handleError(_0x1fffd9,null));};exports[_0xd4ba('0x4b')]=function(_0x44dc82,_0x40c090){return db[_0xd4ba('0x2e')]['create'](_0x44dc82[_0xd4ba('0x4c')],{})[_0xd4ba('0x23')](function(_0x324cea){var _0xd86432=_0x44dc82['user'][_0xd4ba('0x25')]({'plain':!![]});if(!_0xd86432)throw new Error(_0xd4ba('0x4d'));if(_0xd86432[_0xd4ba('0x4e')]===_0xd4ba('0x4f')){var _0x4ddef2=_0x324cea['get']({'plain':!![]});var _0x2f274d='Projects';return db['UserProfileSection'][_0xd4ba('0x4a')]({'where':{'name':_0x2f274d,'userProfileId':_0xd86432[_0xd4ba('0x50')]},'raw':!![]})['then'](function(_0x4fe91e){if(_0x4fe91e&&_0x4fe91e['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4ba('0x4b')]({'name':_0x4ddef2['name'],'resourceId':_0x4ddef2['id'],'type':_0x4fe91e[_0xd4ba('0x2b')],'sectionId':_0x4fe91e['id']},{})[_0xd4ba('0x23')](function(){return _0x324cea;});}else{return _0x324cea;}})[_0xd4ba('0x46')](function(_0x355b2f){logger[_0xd4ba('0x29')](_0xd4ba('0x51'),_0x355b2f);throw _0x355b2f;});}return _0x324cea;})[_0xd4ba('0x23')](respondWithResult(_0x40c090,0xc9))[_0xd4ba('0x46')](handleError(_0x40c090,null));};exports[_0xd4ba('0x52')]=function(_0x561503,_0x6946e7){var _0x58bcae={'raw':![],'where':{'id':_0x561503[_0xd4ba('0x48')]['id']}},_0x3dd95b={};_0x3dd95b['model']=_[_0xd4ba('0x30')](db[_0xd4ba('0x2e')][_0xd4ba('0x49')]);_0x58bcae[_0xd4ba('0x34')]=_[_0xd4ba('0x32')](_0x3dd95b['model'],qs[_0xd4ba('0x35')](_0x561503[_0xd4ba('0x33')]['fields']));_0x58bcae[_0xd4ba('0x34')]=_0x58bcae[_0xd4ba('0x34')]['length']?_0x58bcae[_0xd4ba('0x34')]:_0x3dd95b[_0xd4ba('0x2f')];if(_0x561503[_0xd4ba('0x33')][_0xd4ba('0x53')]){_0x58bcae[_0xd4ba('0x54')]=[{'all':!![]}];}_0x58bcae=_[_0xd4ba('0x3d')]({},_0x58bcae,_0x561503[_0xd4ba('0x43')]);return db[_0xd4ba('0x2e')][_0xd4ba('0x4a')](_0x58bcae)[_0xd4ba('0x23')](handleEntityNotFound(_0x6946e7,null))[_0xd4ba('0x23')](function(_0x476104){if(_0x476104){var _0x2a5eac=_0x476104[_0xd4ba('0x25')]({'plain':!![]});_0x2a5eac=qs[_0xd4ba('0x55')](_0x2a5eac,['id',_0xd4ba('0x56'),'updatedAt']);_0x561503[_0xd4ba('0x4c')]=_[_0xd4ba('0x55')](_0x561503['body'],['id',_0xd4ba('0x56'),'updatedAt']);return db[_0xd4ba('0x2e')][_0xd4ba('0x4b')](_[_0xd4ba('0x3d')](_0x2a5eac,_0x561503[_0xd4ba('0x4c')]),{'include':_0x561503[_0xd4ba('0x33')][_0xd4ba('0x53')]?[{'all':!![]}]:undefined})['then'](function(_0x23b60a){var _0x27a1be=_0x561503['user'][_0xd4ba('0x25')]({'plain':!![]});if(!_0x27a1be)throw new Error(_0xd4ba('0x4d'));if(_0x27a1be[_0xd4ba('0x4e')]==='user'){var _0x2ec9e6=_0x23b60a['get']({'plain':!![]});var _0x17d5fb='Projects';return db[_0xd4ba('0x57')][_0xd4ba('0x4a')]({'where':{'name':_0x17d5fb,'userProfileId':_0x27a1be['userProfileId']},'raw':!![]})[_0xd4ba('0x23')](function(_0x516dd7){if(_0x516dd7&&_0x516dd7[_0xd4ba('0x58')]===0x0){return db[_0xd4ba('0x27')][_0xd4ba('0x4b')]({'name':_0x2ec9e6[_0xd4ba('0x2b')],'resourceId':_0x2ec9e6['id'],'type':_0x516dd7[_0xd4ba('0x2b')],'sectionId':_0x516dd7['id']},{})[_0xd4ba('0x23')](function(){return _0x23b60a;});}else{return _0x23b60a;}})[_0xd4ba('0x46')](function(_0x481762){logger[_0xd4ba('0x29')](_0xd4ba('0x51'),_0x481762);throw _0x481762;});}return _0x23b60a;});}})[_0xd4ba('0x23')](respondWithResult(_0x6946e7,0xc9))[_0xd4ba('0x46')](handleError(_0x6946e7,null));};exports[_0xd4ba('0x22')]=function(_0x4e356c,_0x41983b){if(_0x4e356c[_0xd4ba('0x4c')]['id']){delete _0x4e356c[_0xd4ba('0x4c')]['id'];}return db[_0xd4ba('0x2e')][_0xd4ba('0x4a')]({'where':{'id':_0x4e356c[_0xd4ba('0x48')]['id']}})[_0xd4ba('0x23')](handleEntityNotFound(_0x41983b,null))[_0xd4ba('0x23')](saveUpdates(_0x4e356c[_0xd4ba('0x4c')],null))[_0xd4ba('0x23')](respondWithResult(_0x41983b,null))['catch'](handleError(_0x41983b,null));};exports[_0xd4ba('0x24')]=function(_0x36e5af,_0x4f8ce0){return db[_0xd4ba('0x2e')][_0xd4ba('0x4a')]({'where':{'id':_0x36e5af[_0xd4ba('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f8ce0,null))[_0xd4ba('0x23')](removeEntity(_0x4f8ce0,null))['catch'](handleError(_0x4f8ce0,null));};exports[_0xd4ba('0x59')]=function(_0xdbeae2,_0x2ed2d6,_0x48356b){var _0x4bdd98={'raw':!![],'where':{}};var _0x253d41={};var _0x2a1fcc={'count':0x0,'rows':[]};return db[_0xd4ba('0x2e')]['findOne']({'where':{'id':_0xdbeae2[_0xd4ba('0x48')]['id']}})[_0xd4ba('0x23')](handleEntityNotFound(_0x2ed2d6,null))[_0xd4ba('0x23')](function(_0x5c45b6){if(_0x5c45b6){_0x253d41[_0xd4ba('0x2f')]=_[_0xd4ba('0x30')](db[_0xd4ba('0x5a')][_0xd4ba('0x49')]);_0x253d41[_0xd4ba('0x33')]=_[_0xd4ba('0x30')](_0xdbeae2[_0xd4ba('0x33')]);_0x253d41[_0xd4ba('0x31')]=_[_0xd4ba('0x32')](_0x253d41[_0xd4ba('0x2f')],_0x253d41['query']);_0x4bdd98['attributes']=_['intersection'](_0x253d41['model'],qs[_0xd4ba('0x35')](_0xdbeae2[_0xd4ba('0x33')][_0xd4ba('0x35')]));_0x4bdd98[_0xd4ba('0x34')]=_0x4bdd98['attributes'][_0xd4ba('0x36')]?_0x4bdd98['attributes']:_0x253d41[_0xd4ba('0x2f')];if(!_0xdbeae2[_0xd4ba('0x33')][_0xd4ba('0x37')](_0xd4ba('0x38'))){_0x4bdd98[_0xd4ba('0x1d')]=qs[_0xd4ba('0x1d')](_0xdbeae2['query']['limit']);_0x4bdd98[_0xd4ba('0x39')]=qs[_0xd4ba('0x39')](_0xdbeae2['query'][_0xd4ba('0x39')]);}_0x4bdd98[_0xd4ba('0x5b')]=qs[_0xd4ba('0x3a')](_0xdbeae2[_0xd4ba('0x33')][_0xd4ba('0x3a')]);_0x4bdd98[_0xd4ba('0x3b')]=qs['filters'](_[_0xd4ba('0x3c')](_0xdbeae2[_0xd4ba('0x33')],_0x253d41[_0xd4ba('0x31')]));_0x4bdd98[_0xd4ba('0x3b')]['ProjectId']=_0x5c45b6['id'];if(_0xdbeae2[_0xd4ba('0x33')][_0xd4ba('0x42')]){_0x4bdd98[_0xd4ba('0x3b')]=_[_0xd4ba('0x3d')](_0x4bdd98[_0xd4ba('0x3b')],{'$or':_[_0xd4ba('0x3e')](_0x4bdd98[_0xd4ba('0x34')],function(_0x1aeda7){var _0x26538c={};_0x26538c[_0x1aeda7]={'$like':'%'+_0xdbeae2[_0xd4ba('0x33')]['filter']+'%'};return _0x26538c;})});}_0x4bdd98=_[_0xd4ba('0x3d')]({},_0x4bdd98,_0xdbeae2['options']);return db[_0xd4ba('0x5a')][_0xd4ba('0x44')]({'where':_0x4bdd98[_0xd4ba('0x3b')]})[_0xd4ba('0x23')](function(_0x5ecd75){_0x2a1fcc['count']=_0x5ecd75;if(_0xdbeae2[_0xd4ba('0x33')]['includeAll']){_0x4bdd98[_0xd4ba('0x54')]=[{'all':!![]}];}return db[_0xd4ba('0x5a')][_0xd4ba('0x5c')](_0x4bdd98);})['then'](function(_0x2cf56d){_0x2a1fcc['rows']=_0x2cf56d;return _0x2a1fcc;});}})[_0xd4ba('0x23')](respondWithFilteredResult(_0x2ed2d6,_0x4bdd98))['catch'](handleError(_0x2ed2d6,null));};exports['getAnswers']=function(_0x5dbb6e,_0x14897d,_0xeb8656){var _0x552282={'raw':!![],'where':{}};var _0xe4e91a={};var _0x29b561={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd4ba('0x5d')]({'where':{'id':_0x5dbb6e[_0xd4ba('0x48')]['id']}})[_0xd4ba('0x23')](handleEntityNotFound(_0x14897d,null))['then'](function(_0x4e4a49){if(_0x4e4a49){_0xe4e91a[_0xd4ba('0x2f')]=_[_0xd4ba('0x30')](db[_0xd4ba('0x5e')]['rawAttributes']);_0xe4e91a[_0xd4ba('0x33')]=_[_0xd4ba('0x30')](_0x5dbb6e[_0xd4ba('0x33')]);_0xe4e91a[_0xd4ba('0x31')]=_[_0xd4ba('0x32')](_0xe4e91a[_0xd4ba('0x2f')],_0xe4e91a[_0xd4ba('0x33')]);_0x552282[_0xd4ba('0x34')]=_[_0xd4ba('0x32')](_0xe4e91a[_0xd4ba('0x2f')],qs[_0xd4ba('0x35')](_0x5dbb6e['query'][_0xd4ba('0x35')]));_0x552282[_0xd4ba('0x34')]=_0x552282[_0xd4ba('0x34')][_0xd4ba('0x36')]?_0x552282['attributes']:_0xe4e91a[_0xd4ba('0x2f')];if(!_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x37')](_0xd4ba('0x38'))){_0x552282['limit']=qs[_0xd4ba('0x1d')](_0x5dbb6e['query'][_0xd4ba('0x1d')]);_0x552282['offset']=qs['offset'](_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x39')]);}_0x552282['order']=qs[_0xd4ba('0x3a')](_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x3a')]);_0x552282[_0xd4ba('0x3b')]=qs['filters'](_[_0xd4ba('0x3c')](_0x5dbb6e[_0xd4ba('0x33')],_0xe4e91a[_0xd4ba('0x31')]));_0x552282[_0xd4ba('0x3b')][_0xd4ba('0x5f')]=_0x4e4a49['id'];if(_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x42')]){_0x552282[_0xd4ba('0x3b')]=_[_0xd4ba('0x3d')](_0x552282['where'],{'$or':_['map'](_0x552282[_0xd4ba('0x34')],function(_0x466830){var _0x5477f0={};_0x5477f0[_0x466830]={'$like':'%'+_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x42')]+'%'};return _0x5477f0;})});}_0x552282=_['merge']({},_0x552282,_0x5dbb6e[_0xd4ba('0x43')]);return db[_0xd4ba('0x5e')][_0xd4ba('0x44')]({'where':_0x552282[_0xd4ba('0x3b')]})['then'](function(_0x2cc17f){_0x29b561[_0xd4ba('0x44')]=_0x2cc17f;if(_0x5dbb6e[_0xd4ba('0x33')][_0xd4ba('0x53')]){_0x552282[_0xd4ba('0x54')]=[{'all':!![]}];}return db[_0xd4ba('0x5e')][_0xd4ba('0x5c')](_0x552282);})[_0xd4ba('0x23')](function(_0x306e46){_0x29b561['rows']=_0x306e46;return _0x29b561;});}})[_0xd4ba('0x23')](respondWithFilteredResult(_0x14897d,_0x552282))[_0xd4ba('0x46')](handleError(_0x14897d,null));};function char(_0x5179d3){return _0xd4ba('0x60')===typeof _0x5179d3?String['fromCharCode']['apply'](null,arguments):_0x5179d3;}function needsEncapsulation(_0x440ba4){return!!_0x440ba4&&(_0x440ba4[_0xd4ba('0x61')]()[_0xd4ba('0x62')](char(0xd))>=0x0||_0x440ba4[_0xd4ba('0x61')]()[_0xd4ba('0x62')](char(0xa))>=0x0||_0x440ba4[_0xd4ba('0x61')]()[_0xd4ba('0x62')](char(0x2c))>=0x0||_0x440ba4[_0xd4ba('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xfbfde5){var _0x4621e3=char(0x22),_0x55550f='\x5c'+char(0x22),_0x49939f=_0xfbfde5[_0xd4ba('0x61')]()[_0xd4ba('0x63')](new RegExp(_0x4621e3,'g'),_0x55550f);return _0x4621e3+_0x49939f+_0x4621e3;}exports[_0xd4ba('0x64')]=function(_0x3109f3,_0x2f7778,_0x2a1668){var _0x3e6354,_0x4700ef;var _0x42ad96={'where':{'ProjectId':_0x3109f3[_0xd4ba('0x48')]['id']}};if(_0x3109f3['query'][_0xd4ba('0x65')]){_0x42ad96[_0xd4ba('0x3b')][_0xd4ba('0x66')]=JSON[_0xd4ba('0x67')](_0x3109f3['query'][_0xd4ba('0x65')]);}return db[_0xd4ba('0x5a')][_0xd4ba('0x5c')](_0x42ad96)[_0xd4ba('0x23')](handleEntityNotFound(_0x2f7778,null))['then'](function(_0x13eb44){if(_0x13eb44){_0x3e6354=_0x13eb44;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xd4ba('0x3e')](_0x3e6354,'id')},'ProjectId':_0x3109f3[_0xd4ba('0x48')]['id']},'order':_0xd4ba('0x68')});}})[_0xd4ba('0x23')](handleEntityNotFound(_0x2f7778,null))[_0xd4ba('0x23')](function(_0x39dd98){if(_0x39dd98){_0x4700ef=_0x39dd98;var _0x1c6a29={};for(var _0x5be95a=0x0,_0x3489e1=_0x4700ef[_0xd4ba('0x36')];_0x5be95a<_0x3489e1;_0x5be95a++){if(!_0x1c6a29['hasOwnProperty'](_0x4700ef[_0x5be95a][_0xd4ba('0x69')])){_0x1c6a29[_0x4700ef[_0x5be95a][_0xd4ba('0x69')]]=needsEncapsulation(_0x4700ef[_0x5be95a][_0xd4ba('0x6a')])?encapsulate(_0x4700ef[_0x5be95a][_0xd4ba('0x6a')]):_0x4700ef[_0x5be95a][_0xd4ba('0x6a')];}}var _0x1420af=[],_0x5965a7={};for(var _0x4fea21=0x0,_0x98c9d9=_0x3e6354[_0xd4ba('0x36')];_0x4fea21<_0x98c9d9;_0x4fea21++){_0x5965a7={'ProjectId':_0x3109f3[_0xd4ba('0x48')]['id'],'SessionId':_0x3e6354[_0x4fea21]['id'],'StartTime':moment(_0x3e6354[_0x4fea21]['starttime'])[_0xd4ba('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xdd6775=0x0,_0x491d24=_0x4700ef[_0xd4ba('0x36')];_0xdd6775<_0x491d24;_0xdd6775++){if(_0x4700ef[_0xdd6775][_0xd4ba('0x6c')]==_0x3e6354[_0x4fea21]['id']&&_0x1c6a29[_0xd4ba('0x37')](_0x4700ef[_0xdd6775][_0xd4ba('0x69')])){_0x5965a7[_0x1c6a29[_0x4700ef[_0xdd6775]['questionId']]]=_0x4700ef[_0xdd6775][_0xd4ba('0x6d')];}}for(var _0x1a13cb in _0x1c6a29){if(!_0x5965a7['hasOwnProperty'](_0x1c6a29[_0x1a13cb])){_0x5965a7[_0x1c6a29[_0x1a13cb]]=null;}}_0x1420af[_0xd4ba('0x6e')](_0x5965a7);}return _0x1420af;}})['then'](function(_0x44d7ff){if(!_[_0xd4ba('0x6f')](_0x44d7ff)){var _0xedee47=toCsv(_0x44d7ff);var _0x50fd75=Date[_0xd4ba('0x70')]();fs['writeFileSync'](util['format'](_0xd4ba('0x71'),_0x3109f3[_0xd4ba('0x48')]['id'],_0x50fd75),_0xedee47);_0x2f7778[_0xd4ba('0x72')]('Content-disposition','attachment;\x20filename='+util[_0xd4ba('0x6b')](_0xd4ba('0x73'),_0x3109f3[_0xd4ba('0x48')]['id'],_0x50fd75));_0x2f7778['setHeader'](_0xd4ba('0x74'),_0xd4ba('0x75'));return _0x2f7778[_0xd4ba('0x76')](util['format'](_0xd4ba('0x71'),_0x3109f3[_0xd4ba('0x48')]['id'],_0x50fd75));}else{return _0x2f7778[_0xd4ba('0x1a')](0xcc);}})[_0xd4ba('0x46')](handleError(_0x2f7778,null));}; \ No newline at end of file +var _0x70af=['attachment;\x20filename=','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','Projects','UserProfileResource','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','JscriptyProject','includeAll','include','findAll','rows','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','omit','destroy','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition'];(function(_0x136f3a,_0x275d5e){var _0xda96c9=function(_0x4f18d4){while(--_0x4f18d4){_0x136f3a['push'](_0x136f3a['shift']());}};_0xda96c9(++_0x275d5e);}(_0x70af,0x78));var _0xf70a=function(_0x581c15,_0x5dada9){_0x581c15=_0x581c15-0x0;var _0x341539=_0x70af[_0x581c15];return _0x341539;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf70a('0x0'));var rimraf=require(_0xf70a('0x1'));var zipdir=require(_0xf70a('0x2'));var jsonpatch=require(_0xf70a('0x3'));var rp=require(_0xf70a('0x4'));var moment=require(_0xf70a('0x5'));var BPromise=require(_0xf70a('0x6'));var Mustache=require(_0xf70a('0x7'));var util=require(_0xf70a('0x8'));var path=require(_0xf70a('0x9'));var sox=require(_0xf70a('0xa'));var csv=require(_0xf70a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf70a('0xc'));var crypto=require(_0xf70a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf70a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf70a('0xf'));var Papa=require(_0xf70a('0x10'));var Redis=require(_0xf70a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf70a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf70a('0x13'));var utils=require(_0xf70a('0x14'));var config=require('../../config/environment');var db=require(_0xf70a('0x15'))['db'];function respondWithStatusCode(_0x300712,_0x486c1b){_0x486c1b=_0x486c1b||0xcc;return function(_0x2124b7){if(_0x2124b7){return _0x300712[_0xf70a('0x16')](_0x486c1b);}return _0x300712[_0xf70a('0x17')](_0x486c1b)[_0xf70a('0x18')]();};}function respondWithResult(_0x4a6e2b,_0x1d019e){_0x1d019e=_0x1d019e||0xc8;return function(_0x11dbb9){if(_0x11dbb9){return _0x4a6e2b['status'](_0x1d019e)['json'](_0x11dbb9);}};}function respondWithFilteredResult(_0x1b31a3,_0x18b4ae){return function(_0x1ecf3c){if(_0x1ecf3c){var _0x3e21d9=_0x1ecf3c[_0xf70a('0x19')],_0x3817db=_0x18b4ae[_0xf70a('0x1a')],_0x341f8c=_0x18b4ae['offset']+_0x18b4ae[_0xf70a('0x1b')],_0x12a46d;if(_0x341f8c>=_0x3e21d9){_0x341f8c=_0x3e21d9;_0x12a46d=0xc8;}else{_0x12a46d=0xce;}_0x1b31a3[_0xf70a('0x17')](_0x12a46d);return _0x1b31a3[_0xf70a('0x1c')](_0xf70a('0x1d'),_0x3817db+'-'+_0x341f8c+'/'+_0x3e21d9)[_0xf70a('0x1e')](_0x1ecf3c);}return null;};}function patchUpdates(_0x2f6c27){return function(_0x142ff6){try{jsonpatch[_0xf70a('0x1f')](_0x142ff6,_0x2f6c27,!![]);}catch(_0x1a68d3){return BPromise['reject'](_0x1a68d3);}return _0x142ff6[_0xf70a('0x20')]();};}function saveUpdates(_0x3208a7,_0x2e1ebd){return function(_0x5b4182){if(_0x5b4182){return _0x5b4182[_0xf70a('0x21')](_0x3208a7)['then'](function(_0x375935){return _0x375935;});}return null;};}function removeEntity(_0x2c1127,_0x121301){return function(_0x57cf9b){if(_0x57cf9b){return _0x57cf9b['destroy']()[_0xf70a('0x22')](function(){var _0x5b5358=_0x57cf9b['get']({'plain':!![]});var _0x57a71c=_0xf70a('0x23');return db[_0xf70a('0x24')]['destroy']({'where':{'type':_0x57a71c,'resourceId':_0x5b5358['id']}})[_0xf70a('0x22')](function(){return _0x57cf9b;});})[_0xf70a('0x22')](function(){_0x2c1127[_0xf70a('0x17')](0xcc)[_0xf70a('0x18')]();});}};}function handleEntityNotFound(_0x53055c,_0x7fdb40){return function(_0xd1835a){if(!_0xd1835a){_0x53055c['sendStatus'](0x194);}return _0xd1835a;};}function handleError(_0x41330f,_0x469a84){_0x469a84=_0x469a84||0x1f4;return function(_0x234379){logger['error'](_0x234379[_0xf70a('0x25')]);if(_0x234379[_0xf70a('0x26')]){delete _0x234379[_0xf70a('0x26')];}_0x41330f[_0xf70a('0x17')](_0x469a84)[_0xf70a('0x27')](_0x234379);};}exports[_0xf70a('0x28')]=function(_0x235296,_0x15247e){var _0x71e41a={},_0x33c711={},_0x155e42={'count':0x0,'rows':[]};var _0x287098=db['JscriptyProject']['rawAttributes'];_0x33c711[_0xf70a('0x29')]=_[_0xf70a('0x2a')](_0x287098);_0x33c711['query']=_[_0xf70a('0x2a')](_0x235296[_0xf70a('0x2b')]);_0x33c711[_0xf70a('0x2c')]=_['intersection'](_0x33c711[_0xf70a('0x29')],_0x33c711[_0xf70a('0x2b')]);_0x71e41a['attributes']=_[_0xf70a('0x2d')](_0x33c711['model'],qs[_0xf70a('0x2e')](_0x235296[_0xf70a('0x2b')][_0xf70a('0x2e')]));_0x71e41a['attributes']=_0x71e41a[_0xf70a('0x2f')][_0xf70a('0x30')]?_0x71e41a['attributes']:_0x33c711['model'];if(!_0x235296[_0xf70a('0x2b')]['hasOwnProperty'](_0xf70a('0x31'))){_0x71e41a[_0xf70a('0x1b')]=qs[_0xf70a('0x1b')](_0x235296[_0xf70a('0x2b')]['limit']);_0x71e41a[_0xf70a('0x1a')]=qs[_0xf70a('0x1a')](_0x235296['query'][_0xf70a('0x1a')]);}_0x71e41a[_0xf70a('0x32')]=qs[_0xf70a('0x33')](_0x235296[_0xf70a('0x2b')]['sort']);_0x71e41a['where']=qs[_0xf70a('0x2c')](_[_0xf70a('0x34')](_0x235296[_0xf70a('0x2b')],_0x33c711[_0xf70a('0x2c')]));if(_0x235296[_0xf70a('0x2b')][_0xf70a('0x35')]){_0x71e41a[_0xf70a('0x36')]=_[_0xf70a('0x37')](_0x71e41a['where'],{'$or':_[_0xf70a('0x38')](_0x287098,function(_0x5b3d2f){if(_0x5b3d2f['type']['key']!==_0xf70a('0x39')){var _0x2336e2={};_0x2336e2[_0x5b3d2f['field']]={'$like':'%'+_0x235296[_0xf70a('0x2b')][_0xf70a('0x35')]+'%'};return _0x2336e2;}})});}_0x71e41a=_[_0xf70a('0x37')]({},_0x71e41a,_0x235296[_0xf70a('0x3a')]);var _0x4162a3={'where':_0x71e41a[_0xf70a('0x36')]};return db[_0xf70a('0x3b')][_0xf70a('0x19')](_0x4162a3)[_0xf70a('0x22')](function(_0x41fc0c){_0x155e42[_0xf70a('0x19')]=_0x41fc0c;if(_0x235296['query'][_0xf70a('0x3c')]){_0x71e41a[_0xf70a('0x3d')]=[{'all':!![]}];}return db[_0xf70a('0x3b')][_0xf70a('0x3e')](_0x71e41a);})[_0xf70a('0x22')](function(_0x2f4aa){_0x155e42[_0xf70a('0x3f')]=_0x2f4aa;return _0x155e42;})[_0xf70a('0x22')](respondWithFilteredResult(_0x15247e,_0x71e41a))[_0xf70a('0x40')](handleError(_0x15247e,null));};exports['show']=function(_0x113f72,_0x3a877b){var _0x273eeb={'raw':![],'where':{'id':_0x113f72['params']['id']}},_0x336005={};_0x336005[_0xf70a('0x29')]=_['keys'](db[_0xf70a('0x3b')][_0xf70a('0x41')]);_0x336005['query']=_[_0xf70a('0x2a')](_0x113f72['query']);_0x336005[_0xf70a('0x2c')]=_[_0xf70a('0x2d')](_0x336005[_0xf70a('0x29')],_0x336005[_0xf70a('0x2b')]);_0x273eeb[_0xf70a('0x2f')]=_[_0xf70a('0x2d')](_0x336005[_0xf70a('0x29')],qs[_0xf70a('0x2e')](_0x113f72[_0xf70a('0x2b')]['fields']));_0x273eeb[_0xf70a('0x2f')]=_0x273eeb[_0xf70a('0x2f')][_0xf70a('0x30')]?_0x273eeb[_0xf70a('0x2f')]:_0x336005[_0xf70a('0x29')];if(_0x113f72['query'][_0xf70a('0x3c')]){_0x273eeb[_0xf70a('0x3d')]=[{'all':!![]}];}_0x273eeb=_['merge']({},_0x273eeb,_0x113f72[_0xf70a('0x3a')]);return db[_0xf70a('0x3b')]['find'](_0x273eeb)[_0xf70a('0x22')](handleEntityNotFound(_0x3a877b,null))[_0xf70a('0x22')](respondWithResult(_0x3a877b,null))[_0xf70a('0x40')](handleError(_0x3a877b,null));};exports[_0xf70a('0x42')]=function(_0x23c9a5,_0x8156ac){return db[_0xf70a('0x3b')][_0xf70a('0x42')](_0x23c9a5[_0xf70a('0x43')],{})[_0xf70a('0x22')](function(_0xad3a3f){var _0x4f4845=_0x23c9a5[_0xf70a('0x44')]['get']({'plain':!![]});if(!_0x4f4845)throw new Error(_0xf70a('0x45'));if(_0x4f4845[_0xf70a('0x46')]===_0xf70a('0x44')){var _0x9e9c15=_0xad3a3f[_0xf70a('0x47')]({'plain':!![]});var _0x4c7d08=_0xf70a('0x23');return db[_0xf70a('0x48')][_0xf70a('0x49')]({'where':{'name':_0x4c7d08,'userProfileId':_0x4f4845[_0xf70a('0x4a')]},'raw':!![]})['then'](function(_0x301eb8){if(_0x301eb8&&_0x301eb8['autoAssociation']===0x0){return db['UserProfileResource'][_0xf70a('0x42')]({'name':_0x9e9c15[_0xf70a('0x26')],'resourceId':_0x9e9c15['id'],'type':_0x301eb8[_0xf70a('0x26')],'sectionId':_0x301eb8['id']},{})['then'](function(){return _0xad3a3f;});}else{return _0xad3a3f;}})[_0xf70a('0x40')](function(_0x203df4){logger[_0xf70a('0x4b')](_0xf70a('0x4c'),_0x203df4);throw _0x203df4;});}return _0xad3a3f;})[_0xf70a('0x22')](respondWithResult(_0x8156ac,0xc9))['catch'](handleError(_0x8156ac,null));};exports[_0xf70a('0x4d')]=function(_0x192672,_0x474ee7){var _0xa0ce88={'raw':![],'where':{'id':_0x192672[_0xf70a('0x4e')]['id']}},_0x5b4b79={};_0x5b4b79['model']=_[_0xf70a('0x2a')](db[_0xf70a('0x3b')]['rawAttributes']);_0xa0ce88['attributes']=_['intersection'](_0x5b4b79[_0xf70a('0x29')],qs[_0xf70a('0x2e')](_0x192672['query'][_0xf70a('0x2e')]));_0xa0ce88[_0xf70a('0x2f')]=_0xa0ce88[_0xf70a('0x2f')][_0xf70a('0x30')]?_0xa0ce88[_0xf70a('0x2f')]:_0x5b4b79[_0xf70a('0x29')];if(_0x192672[_0xf70a('0x2b')][_0xf70a('0x3c')]){_0xa0ce88[_0xf70a('0x3d')]=[{'all':!![]}];}_0xa0ce88=_[_0xf70a('0x37')]({},_0xa0ce88,_0x192672[_0xf70a('0x3a')]);return db['JscriptyProject'][_0xf70a('0x49')](_0xa0ce88)[_0xf70a('0x22')](handleEntityNotFound(_0x474ee7,null))['then'](function(_0x4d4005){if(_0x4d4005){var _0x53f0e1=_0x4d4005[_0xf70a('0x47')]({'plain':!![]});_0x53f0e1=qs['omit'](_0x53f0e1,['id','createdAt',_0xf70a('0x4f')]);_0x192672[_0xf70a('0x43')]=_[_0xf70a('0x50')](_0x192672[_0xf70a('0x43')],['id','createdAt',_0xf70a('0x4f')]);return db[_0xf70a('0x3b')][_0xf70a('0x42')](_[_0xf70a('0x37')](_0x53f0e1,_0x192672[_0xf70a('0x43')]),{'include':_0x192672[_0xf70a('0x2b')][_0xf70a('0x3c')]?[{'all':!![]}]:undefined})[_0xf70a('0x22')](function(_0x48ae8d){var _0x240a30=_0x192672[_0xf70a('0x44')][_0xf70a('0x47')]({'plain':!![]});if(!_0x240a30)throw new Error(_0xf70a('0x45'));if(_0x240a30[_0xf70a('0x46')]===_0xf70a('0x44')){var _0x24ab07=_0x48ae8d[_0xf70a('0x47')]({'plain':!![]});var _0x3cf4c9=_0xf70a('0x23');return db[_0xf70a('0x48')]['find']({'where':{'name':_0x3cf4c9,'userProfileId':_0x240a30[_0xf70a('0x4a')]},'raw':!![]})[_0xf70a('0x22')](function(_0x491557){if(_0x491557&&_0x491557['autoAssociation']===0x0){return db[_0xf70a('0x24')][_0xf70a('0x42')]({'name':_0x24ab07[_0xf70a('0x26')],'resourceId':_0x24ab07['id'],'type':_0x491557[_0xf70a('0x26')],'sectionId':_0x491557['id']},{})[_0xf70a('0x22')](function(){return _0x48ae8d;});}else{return _0x48ae8d;}})[_0xf70a('0x40')](function(_0x2b8a89){logger[_0xf70a('0x4b')](_0xf70a('0x4c'),_0x2b8a89);throw _0x2b8a89;});}return _0x48ae8d;});}})['then'](respondWithResult(_0x474ee7,0xc9))[_0xf70a('0x40')](handleError(_0x474ee7,null));};exports[_0xf70a('0x21')]=function(_0xbe92a3,_0x43d9b1){if(_0xbe92a3[_0xf70a('0x43')]['id']){delete _0xbe92a3[_0xf70a('0x43')]['id'];}return db['JscriptyProject'][_0xf70a('0x49')]({'where':{'id':_0xbe92a3['params']['id']}})['then'](handleEntityNotFound(_0x43d9b1,null))[_0xf70a('0x22')](saveUpdates(_0xbe92a3[_0xf70a('0x43')],null))[_0xf70a('0x22')](respondWithResult(_0x43d9b1,null))[_0xf70a('0x40')](handleError(_0x43d9b1,null));};exports[_0xf70a('0x51')]=function(_0x4730b9,_0x137204){return db[_0xf70a('0x3b')][_0xf70a('0x49')]({'where':{'id':_0x4730b9[_0xf70a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x137204,null))[_0xf70a('0x22')](removeEntity(_0x137204,null))[_0xf70a('0x40')](handleError(_0x137204,null));};exports[_0xf70a('0x52')]=function(_0x232987,_0x54d7b0,_0x4f0fe1){var _0x971433={'raw':!![],'where':{}};var _0x473cc4={};var _0x4db845={'count':0x0,'rows':[]};return db[_0xf70a('0x3b')][_0xf70a('0x53')]({'where':{'id':_0x232987['params']['id']}})[_0xf70a('0x22')](handleEntityNotFound(_0x54d7b0,null))['then'](function(_0x2060c7){if(_0x2060c7){_0x473cc4['model']=_[_0xf70a('0x2a')](db[_0xf70a('0x54')][_0xf70a('0x41')]);_0x473cc4['query']=_[_0xf70a('0x2a')](_0x232987[_0xf70a('0x2b')]);_0x473cc4[_0xf70a('0x2c')]=_[_0xf70a('0x2d')](_0x473cc4['model'],_0x473cc4[_0xf70a('0x2b')]);_0x971433[_0xf70a('0x2f')]=_[_0xf70a('0x2d')](_0x473cc4[_0xf70a('0x29')],qs[_0xf70a('0x2e')](_0x232987['query'][_0xf70a('0x2e')]));_0x971433['attributes']=_0x971433[_0xf70a('0x2f')][_0xf70a('0x30')]?_0x971433[_0xf70a('0x2f')]:_0x473cc4[_0xf70a('0x29')];if(!_0x232987[_0xf70a('0x2b')][_0xf70a('0x55')](_0xf70a('0x31'))){_0x971433[_0xf70a('0x1b')]=qs[_0xf70a('0x1b')](_0x232987['query'][_0xf70a('0x1b')]);_0x971433[_0xf70a('0x1a')]=qs[_0xf70a('0x1a')](_0x232987[_0xf70a('0x2b')]['offset']);}_0x971433['order']=qs[_0xf70a('0x33')](_0x232987[_0xf70a('0x2b')][_0xf70a('0x33')]);_0x971433['where']=qs[_0xf70a('0x2c')](_['pick'](_0x232987['query'],_0x473cc4[_0xf70a('0x2c')]));_0x971433[_0xf70a('0x36')][_0xf70a('0x56')]=_0x2060c7['id'];if(_0x232987[_0xf70a('0x2b')][_0xf70a('0x35')]){_0x971433[_0xf70a('0x36')]=_[_0xf70a('0x37')](_0x971433[_0xf70a('0x36')],{'$or':_[_0xf70a('0x38')](_0x971433['attributes'],function(_0x22d399){var _0x3b986f={};_0x3b986f[_0x22d399]={'$like':'%'+_0x232987[_0xf70a('0x2b')][_0xf70a('0x35')]+'%'};return _0x3b986f;})});}_0x971433=_[_0xf70a('0x37')]({},_0x971433,_0x232987[_0xf70a('0x3a')]);return db[_0xf70a('0x54')][_0xf70a('0x19')]({'where':_0x971433[_0xf70a('0x36')]})[_0xf70a('0x22')](function(_0xa61aba){_0x4db845[_0xf70a('0x19')]=_0xa61aba;if(_0x232987[_0xf70a('0x2b')][_0xf70a('0x3c')]){_0x971433[_0xf70a('0x3d')]=[{'all':!![]}];}return db[_0xf70a('0x54')][_0xf70a('0x3e')](_0x971433);})['then'](function(_0x282c8b){_0x4db845[_0xf70a('0x3f')]=_0x282c8b;return _0x4db845;});}})[_0xf70a('0x22')](respondWithFilteredResult(_0x54d7b0,_0x971433))[_0xf70a('0x40')](handleError(_0x54d7b0,null));};exports[_0xf70a('0x57')]=function(_0xd7d9ac,_0x48dbc9,_0x583e60){var _0x19325c={'raw':!![],'where':{}};var _0x411fac={};var _0x2cd48c={'count':0x0,'rows':[]};return db[_0xf70a('0x3b')]['findOne']({'where':{'id':_0xd7d9ac[_0xf70a('0x4e')]['id']}})[_0xf70a('0x22')](handleEntityNotFound(_0x48dbc9,null))['then'](function(_0x507d6a){if(_0x507d6a){_0x411fac['model']=_[_0xf70a('0x2a')](db[_0xf70a('0x58')][_0xf70a('0x41')]);_0x411fac[_0xf70a('0x2b')]=_[_0xf70a('0x2a')](_0xd7d9ac['query']);_0x411fac['filters']=_[_0xf70a('0x2d')](_0x411fac[_0xf70a('0x29')],_0x411fac[_0xf70a('0x2b')]);_0x19325c[_0xf70a('0x2f')]=_[_0xf70a('0x2d')](_0x411fac['model'],qs[_0xf70a('0x2e')](_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x2e')]));_0x19325c['attributes']=_0x19325c[_0xf70a('0x2f')]['length']?_0x19325c[_0xf70a('0x2f')]:_0x411fac[_0xf70a('0x29')];if(!_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x55')](_0xf70a('0x31'))){_0x19325c[_0xf70a('0x1b')]=qs[_0xf70a('0x1b')](_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x1b')]);_0x19325c['offset']=qs['offset'](_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x1a')]);}_0x19325c[_0xf70a('0x32')]=qs[_0xf70a('0x33')](_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x33')]);_0x19325c['where']=qs['filters'](_[_0xf70a('0x34')](_0xd7d9ac[_0xf70a('0x2b')],_0x411fac[_0xf70a('0x2c')]));_0x19325c[_0xf70a('0x36')][_0xf70a('0x56')]=_0x507d6a['id'];if(_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x35')]){_0x19325c['where']=_[_0xf70a('0x37')](_0x19325c[_0xf70a('0x36')],{'$or':_[_0xf70a('0x38')](_0x19325c['attributes'],function(_0x179094){var _0x9b2259={};_0x9b2259[_0x179094]={'$like':'%'+_0xd7d9ac[_0xf70a('0x2b')][_0xf70a('0x35')]+'%'};return _0x9b2259;})});}_0x19325c=_['merge']({},_0x19325c,_0xd7d9ac[_0xf70a('0x3a')]);return db[_0xf70a('0x58')][_0xf70a('0x19')]({'where':_0x19325c[_0xf70a('0x36')]})[_0xf70a('0x22')](function(_0x51b3e8){_0x2cd48c['count']=_0x51b3e8;if(_0xd7d9ac[_0xf70a('0x2b')]['includeAll']){_0x19325c['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf70a('0x3e')](_0x19325c);})[_0xf70a('0x22')](function(_0x3b910b){_0x2cd48c[_0xf70a('0x3f')]=_0x3b910b;return _0x2cd48c;});}})[_0xf70a('0x22')](respondWithFilteredResult(_0x48dbc9,_0x19325c))[_0xf70a('0x40')](handleError(_0x48dbc9,null));};function char(_0x5710c3){return'number'===typeof _0x5710c3?String[_0xf70a('0x59')][_0xf70a('0x1f')](null,arguments):_0x5710c3;}function needsEncapsulation(_0x484105){return!!_0x484105&&(_0x484105[_0xf70a('0x5a')]()['indexOf'](char(0xd))>=0x0||_0x484105[_0xf70a('0x5a')]()[_0xf70a('0x5b')](char(0xa))>=0x0||_0x484105[_0xf70a('0x5a')]()[_0xf70a('0x5b')](char(0x2c))>=0x0||_0x484105[_0xf70a('0x5a')]()[_0xf70a('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x240e38){var _0x52cb4a=char(0x22),_0x5441c9='\x5c'+char(0x22),_0x18f286=_0x240e38[_0xf70a('0x5a')]()[_0xf70a('0x5c')](new RegExp(_0x52cb4a,'g'),_0x5441c9);return _0x52cb4a+_0x18f286+_0x52cb4a;}exports[_0xf70a('0x5d')]=function(_0x4b4cd5,_0x46a34e,_0x55ee56){var _0x2ec345,_0x55be64;var _0x4d6242={'where':{'ProjectId':_0x4b4cd5[_0xf70a('0x4e')]['id']}};if(_0x4b4cd5['query'][_0xf70a('0x5e')]){_0x4d6242[_0xf70a('0x36')][_0xf70a('0x5f')]=JSON[_0xf70a('0x60')](_0x4b4cd5[_0xf70a('0x2b')][_0xf70a('0x5e')]);}return db['JscriptySessionReport'][_0xf70a('0x3e')](_0x4d6242)[_0xf70a('0x22')](handleEntityNotFound(_0x46a34e,null))[_0xf70a('0x22')](function(_0x3af88d){if(_0x3af88d){_0x2ec345=_0x3af88d;return db[_0xf70a('0x61')][_0xf70a('0x3e')]({'where':{'SessionId':{'$in':_['map'](_0x2ec345,'id')},'ProjectId':_0x4b4cd5['params']['id']},'order':_0xf70a('0x62')});}})[_0xf70a('0x22')](handleEntityNotFound(_0x46a34e,null))['then'](function(_0x298d68){if(_0x298d68){_0x55be64=_0x298d68;var _0x4d4071={};for(var _0x3b16d9=0x0,_0x19e2f2=_0x55be64[_0xf70a('0x30')];_0x3b16d9<_0x19e2f2;_0x3b16d9++){if(!_0x4d4071[_0xf70a('0x55')](_0x55be64[_0x3b16d9]['questionId'])){_0x4d4071[_0x55be64[_0x3b16d9][_0xf70a('0x63')]]=needsEncapsulation(_0x55be64[_0x3b16d9][_0xf70a('0x64')])?encapsulate(_0x55be64[_0x3b16d9][_0xf70a('0x64')]):_0x55be64[_0x3b16d9][_0xf70a('0x64')];}}var _0x1055ff=[],_0x2d1e99={};for(var _0x3ad65a=0x0,_0x2687d2=_0x2ec345[_0xf70a('0x30')];_0x3ad65a<_0x2687d2;_0x3ad65a++){_0x2d1e99={'ProjectId':_0x4b4cd5[_0xf70a('0x4e')]['id'],'SessionId':_0x2ec345[_0x3ad65a]['id'],'StartTime':moment(_0x2ec345[_0x3ad65a]['starttime'])[_0xf70a('0x65')](_0xf70a('0x66'))};for(var _0x4ec5a4=0x0,_0x22e273=_0x55be64['length'];_0x4ec5a4<_0x22e273;_0x4ec5a4++){if(_0x55be64[_0x4ec5a4][_0xf70a('0x67')]==_0x2ec345[_0x3ad65a]['id']&&_0x4d4071[_0xf70a('0x55')](_0x55be64[_0x4ec5a4][_0xf70a('0x63')])){_0x2d1e99[_0x4d4071[_0x55be64[_0x4ec5a4][_0xf70a('0x63')]]]=_0x55be64[_0x4ec5a4][_0xf70a('0x68')];}}for(var _0x814c8e in _0x4d4071){if(!_0x2d1e99[_0xf70a('0x55')](_0x4d4071[_0x814c8e])){_0x2d1e99[_0x4d4071[_0x814c8e]]=null;}}_0x1055ff[_0xf70a('0x69')](_0x2d1e99);}return _0x1055ff;}})[_0xf70a('0x22')](function(_0x5b721a){if(!_[_0xf70a('0x6a')](_0x5b721a)){var _0x5910e4=toCsv(_0x5b721a);var _0x3fbc8e=Date['now']();fs[_0xf70a('0x6b')](util['format'](_0xf70a('0x6c'),_0x4b4cd5['params']['id'],_0x3fbc8e),_0x5910e4);_0x46a34e['setHeader'](_0xf70a('0x6d'),_0xf70a('0x6e')+util[_0xf70a('0x65')]('Jscripty_Project_%d_Summary_%s.csv',_0x4b4cd5['params']['id'],_0x3fbc8e));_0x46a34e[_0xf70a('0x6f')](_0xf70a('0x70'),_0xf70a('0x71'));return _0x46a34e[_0xf70a('0x72')](util['format'](_0xf70a('0x6c'),_0x4b4cd5['params']['id'],_0x3fbc8e));}else{return _0x46a34e[_0xf70a('0x16')](0xcc);}})['catch'](handleError(_0x46a34e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9cf2930..9291352 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 _0x661e=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18b70d,_0x4e995e){var _0x2422be=function(_0x3c5bad){while(--_0x3c5bad){_0x18b70d['push'](_0x18b70d['shift']());}};_0x2422be(++_0x4e995e);}(_0x661e,0x7d));var _0xe661=function(_0x39881f,_0x215455){_0x39881f=_0x39881f-0x0;var _0x2e2e1a=_0x661e[_0x39881f];return _0x2e2e1a;};'use strict';var _=require('lodash');var util=require(_0xe661('0x0'));var logger=require(_0xe661('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe661('0x2'));var rp=require(_0xe661('0x3'));var fs=require('fs');var path=require(_0xe661('0x4'));var rimraf=require(_0xe661('0x5'));var config=require(_0xe661('0x6'));var attributes=require(_0xe661('0x7'));module[_0xe661('0x8')]=function(_0x53c413,_0x51a018){return _0x53c413[_0xe661('0x9')](_0xe661('0xa'),attributes,{'tableName':_0xe661('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04cc=['bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x3a1c0c,_0x70094a){var _0xe77996=function(_0xb63fad){while(--_0xb63fad){_0x3a1c0c['push'](_0x3a1c0c['shift']());}};_0xe77996(++_0x70094a);}(_0x04cc,0x11a));var _0xc04c=function(_0x6afa2d,_0x8c0e0f){_0x6afa2d=_0x6afa2d-0x0;var _0x1698ee=_0x04cc[_0x6afa2d];return _0x1698ee;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var logger=require(_0xc04c('0x2'))(_0xc04c('0x3'));var moment=require('moment');var BPromise=require(_0xc04c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc04c('0x5'));var config=require(_0xc04c('0x6'));var attributes=require(_0xc04c('0x7'));module[_0xc04c('0x8')]=function(_0x28d35d,_0x1db8ca){return _0x28d35d[_0xc04c('0x9')]('JscriptyProject',attributes,{'tableName':_0xc04c('0xa'),'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 d6841ff..a2d9f4d 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 _0xac6e=['JscriptyProject,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52c79f,_0x3b5157){var _0x4f7ee7=function(_0x24153b){while(--_0x24153b){_0x52c79f['push'](_0x52c79f['shift']());}};_0x4f7ee7(++_0x3b5157);}(_0xac6e,0xca));var _0xeac6=function(_0x1c6d4f,_0x37e880){_0x1c6d4f=_0x1c6d4f-0x0;var _0x2598af=_0xac6e[_0x1c6d4f];return _0x2598af;};'use strict';var _=require('lodash');var util=require(_0xeac6('0x0'));var moment=require(_0xeac6('0x1'));var BPromise=require('bluebird');var rs=require(_0xeac6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeac6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeac6('0x4'))('rpc');var config=require(_0xeac6('0x5'));var jayson=require(_0xeac6('0x6'));var client=jayson[_0xeac6('0x7')][_0xeac6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5320cd,_0x50e752,_0xa32dac){return new BPromise(function(_0x4bba32,_0x497a0d){return client[_0xeac6('0x9')](_0x5320cd,_0xa32dac)[_0xeac6('0xa')](function(_0x3150b4){logger[_0xeac6('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x50e752,_0xeac6('0xc'));logger[_0xeac6('0xd')](_0xeac6('0xe'),_0x50e752,'request\x20sent',JSON[_0xeac6('0xf')](_0x3150b4));if(_0x3150b4[_0xeac6('0x10')]){if(_0x3150b4[_0xeac6('0x10')][_0xeac6('0x11')]===0x1f4){logger[_0xeac6('0x10')](_0xeac6('0x12'),_0x50e752,_0x3150b4['error'][_0xeac6('0x13')]);return _0x497a0d(_0x3150b4['error'][_0xeac6('0x13')]);}logger[_0xeac6('0x10')](_0xeac6('0x12'),_0x50e752,_0x3150b4[_0xeac6('0x10')][_0xeac6('0x13')]);return _0x4bba32(_0x3150b4[_0xeac6('0x10')][_0xeac6('0x13')]);}else{logger[_0xeac6('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x50e752,_0xeac6('0xc'));_0x4bba32(_0x3150b4[_0xeac6('0x14')][_0xeac6('0x13')]);}})[_0xeac6('0x15')](function(_0x52c211){logger[_0xeac6('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x50e752,_0x52c211);_0x497a0d(_0x52c211);});});} \ No newline at end of file +var _0xaa79=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','message','JscriptyProject,\x20%s,\x20%s'];(function(_0x233811,_0x1283e9){var _0x292f41=function(_0xe78d9d){while(--_0xe78d9d){_0x233811['push'](_0x233811['shift']());}};_0x292f41(++_0x1283e9);}(_0xaa79,0x12d));var _0x9aa7=function(_0x4bde2e,_0x98cbde){_0x4bde2e=_0x4bde2e-0x0;var _0x4043cd=_0xaa79[_0x4bde2e];return _0x4043cd;};'use strict';var _=require(_0x9aa7('0x0'));var util=require(_0x9aa7('0x1'));var moment=require(_0x9aa7('0x2'));var BPromise=require(_0x9aa7('0x3'));var rs=require(_0x9aa7('0x4'));var fs=require('fs');var Redis=require(_0x9aa7('0x5'));var db=require(_0x9aa7('0x6'))['db'];var utils=require(_0x9aa7('0x7'));var logger=require(_0x9aa7('0x8'))(_0x9aa7('0x9'));var config=require(_0x9aa7('0xa'));var jayson=require(_0x9aa7('0xb'));var client=jayson['client'][_0x9aa7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d4aee,_0x5d92bc,_0x1a0920){return new BPromise(function(_0x35d851,_0x493279){return client[_0x9aa7('0xd')](_0x5d4aee,_0x1a0920)[_0x9aa7('0xe')](function(_0x2f5ce7){logger[_0x9aa7('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x5d92bc,_0x9aa7('0x10'));logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x5d92bc,_0x9aa7('0x10'),JSON['stringify'](_0x2f5ce7));if(_0x2f5ce7[_0x9aa7('0x11')]){if(_0x2f5ce7[_0x9aa7('0x11')][_0x9aa7('0x12')]===0x1f4){logger[_0x9aa7('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x5d92bc,_0x2f5ce7[_0x9aa7('0x11')]['message']);return _0x493279(_0x2f5ce7[_0x9aa7('0x11')][_0x9aa7('0x13')]);}logger[_0x9aa7('0x11')](_0x9aa7('0x14'),_0x5d92bc,_0x2f5ce7[_0x9aa7('0x11')][_0x9aa7('0x13')]);return _0x35d851(_0x2f5ce7['error'][_0x9aa7('0x13')]);}else{logger['info'](_0x9aa7('0x14'),_0x5d92bc,'request\x20sent');_0x35d851(_0x2f5ce7[_0x9aa7('0x15')]['message']);}})[_0x9aa7('0x16')](function(_0x469ca2){logger[_0x9aa7('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x5d92bc,_0x469ca2);_0x493279(_0x469ca2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c1a1083..e110e87 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 _0xcc92=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','path','express','../../components/auth/service'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xcc92,0x11c));var _0x2cc9=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xcc92[_0x2bf466];return _0x856885;};'use strict';var multer=require(_0x2cc9('0x0'));var util=require('util');var path=require(_0x2cc9('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cc9('0x2'));var router=express['Router']();var auth=require(_0x2cc9('0x3'));var interaction=require(_0x2cc9('0x4'));var config=require(_0x2cc9('0x5'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2cc9('0x6')](_0x2cc9('0x7'),auth[_0x2cc9('0x8')](),controller[_0x2cc9('0x9')]);router['get']('/:id',auth[_0x2cc9('0x8')](),controller[_0x2cc9('0xa')]);router[_0x2cc9('0xb')]('/',auth[_0x2cc9('0x8')](),controller[_0x2cc9('0xc')]);router[_0x2cc9('0xd')](_0x2cc9('0xe'),auth['isAuthenticated'](),controller[_0x2cc9('0xf')]);router['delete'](_0x2cc9('0xe'),auth[_0x2cc9('0x8')](),controller[_0x2cc9('0x10')]);module[_0x2cc9('0x11')]=router; \ No newline at end of file +var _0x302c=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28ebbc,_0x2aab95){var _0x43462a=function(_0x80809f){while(--_0x80809f){_0x28ebbc['push'](_0x28ebbc['shift']());}};_0x43462a(++_0x2aab95);}(_0x302c,0x1dc));var _0xc302=function(_0x9401fb,_0x468d30){_0x9401fb=_0x9401fb-0x0;var _0x30ed31=_0x302c[_0x9401fb];return _0x30ed31;};'use strict';var multer=require(_0xc302('0x0'));var util=require(_0xc302('0x1'));var path=require(_0xc302('0x2'));var timeout=require(_0xc302('0x3'));var express=require('express');var router=express[_0xc302('0x4')]();var auth=require(_0xc302('0x5'));var interaction=require(_0xc302('0x6'));var config=require('../../config/environment');var controller=require(_0xc302('0x7'));router[_0xc302('0x8')]('/',auth[_0xc302('0x9')](),controller[_0xc302('0xa')]);router[_0xc302('0x8')](_0xc302('0xb'),auth[_0xc302('0x9')](),controller[_0xc302('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc302('0xd')]);router[_0xc302('0xe')]('/',auth['isAuthenticated'](),controller[_0xc302('0xf')]);router['put'](_0xc302('0x10'),auth[_0xc302('0x9')](),controller[_0xc302('0x11')]);router[_0xc302('0x12')](_0xc302('0x10'),auth[_0xc302('0x9')](),controller[_0xc302('0x13')]);module[_0xc302('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 18477b4..638a7a6 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 _0xb248=['TEXT','long','sequelize','STRING'];(function(_0x1b8944,_0x38fd1e){var _0x1fbfac=function(_0xde7447){while(--_0xde7447){_0x1b8944['push'](_0x1b8944['shift']());}};_0x1fbfac(++_0x38fd1e);}(_0xb248,0xc6));var _0x8b24=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xb248[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'question':{'type':Sequelize[_0x8b24('0x1')]},'answer':{'type':Sequelize[_0x8b24('0x2')](_0x8b24('0x3'))},'membername':{'type':Sequelize[_0x8b24('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8b24('0x1')]},'uniqueid':{'type':Sequelize[_0x8b24('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8b24('0x1')]},'questionId':{'type':Sequelize[_0x8b24('0x1')]}}; \ No newline at end of file +var _0x40ca=['STRING','sequelize','TEXT','long'];(function(_0x4ae2fb,_0x1c1c67){var _0x4f5268=function(_0x11236b){while(--_0x11236b){_0x4ae2fb['push'](_0x4ae2fb['shift']());}};_0x4f5268(++_0x1c1c67);}(_0x40ca,0x1a1));var _0xa40c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x40ca[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xa40c('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xa40c('0x1')](_0xa40c('0x2'))},'membername':{'type':Sequelize[_0xa40c('0x3')]},'projectname':{'type':Sequelize[_0xa40c('0x3')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa40c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa40c('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 2b9868c..08cc2c0 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 _0x5e6f=['query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','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','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes'];(function(_0x3ffc57,_0x46748b){var _0x1ce5a5=function(_0x242e48){while(--_0x242e48){_0x3ffc57['push'](_0x3ffc57['shift']());}};_0x1ce5a5(++_0x46748b);}(_0x5e6f,0xb2));var _0xf5e6=function(_0xa7dd32,_0x35561f){_0xa7dd32=_0xa7dd32-0x0;var _0x20f2f8=_0x5e6f[_0xa7dd32];return _0x20f2f8;};'use strict';var pdf=require(_0xf5e6('0x0'));var emlformat=require(_0xf5e6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf5e6('0x2'));var jsonpatch=require(_0xf5e6('0x3'));var rp=require(_0xf5e6('0x4'));var moment=require(_0xf5e6('0x5'));var BPromise=require(_0xf5e6('0x6'));var Mustache=require(_0xf5e6('0x7'));var util=require(_0xf5e6('0x8'));var path=require(_0xf5e6('0x9'));var sox=require(_0xf5e6('0xa'));var csv=require(_0xf5e6('0xb'));var ejs=require(_0xf5e6('0xc'));var fs=require('fs');var _=require(_0xf5e6('0xd'));var squel=require(_0xf5e6('0xe'));var crypto=require(_0xf5e6('0xf'));var jsforce=require(_0xf5e6('0x10'));var deskjs=require(_0xf5e6('0x11'));var toCsv=require(_0xf5e6('0xb'));var querystring=require(_0xf5e6('0x12'));var Papa=require('papaparse');var Redis=require(_0xf5e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf5e6('0x14'));var hardwareService=require(_0xf5e6('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf5e6('0x16'));var config=require(_0xf5e6('0x17'));var db=require(_0xf5e6('0x18'))['db'];function respondWithStatusCode(_0x198ce1,_0x57f3b8){_0x57f3b8=_0x57f3b8||0xcc;return function(_0xfdd030){if(_0xfdd030){return _0x198ce1['sendStatus'](_0x57f3b8);}return _0x198ce1[_0xf5e6('0x19')](_0x57f3b8)[_0xf5e6('0x1a')]();};}function respondWithResult(_0x1c8912,_0x20705a){_0x20705a=_0x20705a||0xc8;return function(_0x4b7d3d){if(_0x4b7d3d){return _0x1c8912['status'](_0x20705a)[_0xf5e6('0x1b')](_0x4b7d3d);}};}function respondWithFilteredResult(_0x1f84a2,_0x29e5e5){return function(_0xe7dd54){if(_0xe7dd54){var _0x31ade5=_0xe7dd54[_0xf5e6('0x1c')],_0x5c6415=_0x29e5e5[_0xf5e6('0x1d')],_0xbaa69c=_0x29e5e5[_0xf5e6('0x1d')]+_0x29e5e5[_0xf5e6('0x1e')],_0x8eb71d;if(_0xbaa69c>=_0x31ade5){_0xbaa69c=_0x31ade5;_0x8eb71d=0xc8;}else{_0x8eb71d=0xce;}_0x1f84a2[_0xf5e6('0x19')](_0x8eb71d);return _0x1f84a2[_0xf5e6('0x1f')](_0xf5e6('0x20'),_0x5c6415+'-'+_0xbaa69c+'/'+_0x31ade5)[_0xf5e6('0x1b')](_0xe7dd54);}return null;};}function patchUpdates(_0x401b19){return function(_0x76983a){try{jsonpatch[_0xf5e6('0x21')](_0x76983a,_0x401b19,!![]);}catch(_0x513fa1){return BPromise[_0xf5e6('0x22')](_0x513fa1);}return _0x76983a[_0xf5e6('0x23')]();};}function saveUpdates(_0x4d5e47,_0x113d6c){return function(_0xff0763){if(_0xff0763){return _0xff0763[_0xf5e6('0x24')](_0x4d5e47)[_0xf5e6('0x25')](function(_0x47b25b){return _0x47b25b;});}return null;};}function removeEntity(_0x3e4567,_0xbdab8b){return function(_0x4cf837){if(_0x4cf837){return _0x4cf837[_0xf5e6('0x26')]()[_0xf5e6('0x25')](function(){_0x3e4567[_0xf5e6('0x19')](0xcc)[_0xf5e6('0x1a')]();});}};}function handleEntityNotFound(_0xc4ae,_0x5c51cb){return function(_0x223d2d){if(!_0x223d2d){_0xc4ae[_0xf5e6('0x27')](0x194);}return _0x223d2d;};}function handleError(_0x249bfc,_0x5291e2){_0x5291e2=_0x5291e2||0x1f4;return function(_0x5298db){logger[_0xf5e6('0x28')](_0x5298db[_0xf5e6('0x29')]);if(_0x5298db[_0xf5e6('0x2a')]){delete _0x5298db[_0xf5e6('0x2a')];}_0x249bfc[_0xf5e6('0x19')](_0x5291e2)[_0xf5e6('0x2b')](_0x5298db);};}exports[_0xf5e6('0x2c')]=function(_0x413ef0,_0x36a474){var _0x18a54d={},_0x4d604a={},_0x237f55={'count':0x0,'rows':[]};var _0x3b1362=db[_0xf5e6('0x2d')][_0xf5e6('0x2e')];_0x4d604a['model']=_['keys'](_0x3b1362);_0x4d604a[_0xf5e6('0x2f')]=_[_0xf5e6('0x30')](_0x413ef0[_0xf5e6('0x2f')]);_0x4d604a[_0xf5e6('0x31')]=_['intersection'](_0x4d604a[_0xf5e6('0x32')],_0x4d604a[_0xf5e6('0x2f')]);_0x18a54d[_0xf5e6('0x33')]=_[_0xf5e6('0x34')](_0x4d604a[_0xf5e6('0x32')],qs[_0xf5e6('0x35')](_0x413ef0[_0xf5e6('0x2f')][_0xf5e6('0x35')]));_0x18a54d[_0xf5e6('0x33')]=_0x18a54d[_0xf5e6('0x33')]['length']?_0x18a54d[_0xf5e6('0x33')]:_0x4d604a[_0xf5e6('0x32')];if(!_0x413ef0[_0xf5e6('0x2f')]['hasOwnProperty'](_0xf5e6('0x36'))){_0x18a54d['limit']=qs[_0xf5e6('0x1e')](_0x413ef0[_0xf5e6('0x2f')]['limit']);_0x18a54d[_0xf5e6('0x1d')]=qs[_0xf5e6('0x1d')](_0x413ef0[_0xf5e6('0x2f')][_0xf5e6('0x1d')]);}_0x18a54d[_0xf5e6('0x37')]=qs[_0xf5e6('0x38')](_0x413ef0[_0xf5e6('0x2f')][_0xf5e6('0x38')]);_0x18a54d[_0xf5e6('0x39')]=qs[_0xf5e6('0x31')](_[_0xf5e6('0x3a')](_0x413ef0[_0xf5e6('0x2f')],_0x4d604a[_0xf5e6('0x31')]));if(_0x413ef0['query'][_0xf5e6('0x3b')]){_0x18a54d[_0xf5e6('0x39')]=_[_0xf5e6('0x3c')](_0x18a54d[_0xf5e6('0x39')],{'$or':_[_0xf5e6('0x3d')](_0x3b1362,function(_0x127cf8){if(_0x127cf8[_0xf5e6('0x3e')]['key']!=='VIRTUAL'){var _0x4e3652={};_0x4e3652[_0x127cf8[_0xf5e6('0x3f')]]={'$like':'%'+_0x413ef0['query'][_0xf5e6('0x3b')]+'%'};return _0x4e3652;}})});}_0x18a54d=_[_0xf5e6('0x3c')]({},_0x18a54d,_0x413ef0[_0xf5e6('0x40')]);var _0x158f60={'where':_0x18a54d[_0xf5e6('0x39')]};return db[_0xf5e6('0x2d')][_0xf5e6('0x1c')](_0x158f60)[_0xf5e6('0x25')](function(_0x29c550){_0x237f55[_0xf5e6('0x1c')]=_0x29c550;if(_0x413ef0['query'][_0xf5e6('0x41')]){_0x18a54d[_0xf5e6('0x42')]=[{'all':!![]}];}return db[_0xf5e6('0x2d')][_0xf5e6('0x43')](_0x18a54d);})[_0xf5e6('0x25')](function(_0x59b202){_0x237f55[_0xf5e6('0x44')]=_0x59b202;return _0x237f55;})[_0xf5e6('0x25')](respondWithFilteredResult(_0x36a474,_0x18a54d))[_0xf5e6('0x45')](handleError(_0x36a474,null));};exports[_0xf5e6('0x46')]=function(_0xc5db46,_0x4dfb55){var _0x325a95={'raw':!![],'where':{'id':_0xc5db46[_0xf5e6('0x47')]['id']}},_0x44ac78={};_0x44ac78['model']=_['keys'](db['JscriptyQuestionReport'][_0xf5e6('0x2e')]);_0x44ac78[_0xf5e6('0x2f')]=_[_0xf5e6('0x30')](_0xc5db46[_0xf5e6('0x2f')]);_0x44ac78[_0xf5e6('0x31')]=_['intersection'](_0x44ac78['model'],_0x44ac78[_0xf5e6('0x2f')]);_0x325a95[_0xf5e6('0x33')]=_[_0xf5e6('0x34')](_0x44ac78[_0xf5e6('0x32')],qs['fields'](_0xc5db46[_0xf5e6('0x2f')][_0xf5e6('0x35')]));_0x325a95[_0xf5e6('0x33')]=_0x325a95[_0xf5e6('0x33')][_0xf5e6('0x48')]?_0x325a95[_0xf5e6('0x33')]:_0x44ac78[_0xf5e6('0x32')];if(_0xc5db46[_0xf5e6('0x2f')][_0xf5e6('0x41')]){_0x325a95[_0xf5e6('0x42')]=[{'all':!![]}];}_0x325a95=_['merge']({},_0x325a95,_0xc5db46['options']);return db[_0xf5e6('0x2d')]['find'](_0x325a95)['then'](handleEntityNotFound(_0x4dfb55,null))[_0xf5e6('0x25')](respondWithResult(_0x4dfb55,null))[_0xf5e6('0x45')](handleError(_0x4dfb55,null));};exports[_0xf5e6('0x49')]=function(_0x1a7c29,_0x10f1fc){return db[_0xf5e6('0x2d')][_0xf5e6('0x49')](_0x1a7c29['body'],{})['then'](respondWithResult(_0x10f1fc,0xc9))[_0xf5e6('0x45')](handleError(_0x10f1fc,null));};exports[_0xf5e6('0x24')]=function(_0x10869f,_0x54c8bf){if(_0x10869f[_0xf5e6('0x4a')]['id']){delete _0x10869f[_0xf5e6('0x4a')]['id'];}return db[_0xf5e6('0x2d')]['find']({'where':{'id':_0x10869f['params']['id']}})[_0xf5e6('0x25')](handleEntityNotFound(_0x54c8bf,null))[_0xf5e6('0x25')](saveUpdates(_0x10869f[_0xf5e6('0x4a')],null))[_0xf5e6('0x25')](respondWithResult(_0x54c8bf,null))[_0xf5e6('0x45')](handleError(_0x54c8bf,null));};exports[_0xf5e6('0x26')]=function(_0x1da38b,_0x4443a8){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1da38b[_0xf5e6('0x47')]['id']}})[_0xf5e6('0x25')](handleEntityNotFound(_0x4443a8,null))[_0xf5e6('0x25')](removeEntity(_0x4443a8,null))[_0xf5e6('0x45')](handleError(_0x4443a8,null));};exports['describe']=function(_0x1b599d,_0x19e684){return db[_0xf5e6('0x2d')]['describe']()[_0xf5e6('0x25')](respondWithResult(_0x19e684,null))['catch'](handleError(_0x19e684,null));}; \ No newline at end of file +var _0x7a55=['querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','keys','query','intersection','model','attributes','fields','sort','where','filters','pick','merge','map','type','key','field','filter','options','count','includeAll','include','findAll','catch','show','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','desk.js'];(function(_0x4fc8db,_0x840f74){var _0x12952e=function(_0xef9004){while(--_0xef9004){_0x4fc8db['push'](_0x4fc8db['shift']());}};_0x12952e(++_0x840f74);}(_0x7a55,0x10a));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x57a5('0x0'));var emlformat=require(_0x57a5('0x1'));var rimraf=require(_0x57a5('0x2'));var zipdir=require(_0x57a5('0x3'));var jsonpatch=require(_0x57a5('0x4'));var rp=require(_0x57a5('0x5'));var moment=require('moment');var BPromise=require(_0x57a5('0x6'));var Mustache=require(_0x57a5('0x7'));var util=require(_0x57a5('0x8'));var path=require(_0x57a5('0x9'));var sox=require('sox');var csv=require(_0x57a5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57a5('0xb'));var squel=require('squel');var crypto=require(_0x57a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x57a5('0xd'));var toCsv=require(_0x57a5('0xa'));var querystring=require(_0x57a5('0xe'));var Papa=require('papaparse');var Redis=require(_0x57a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x57a5('0x10'));var hardwareService=require(_0x57a5('0x11'));var logger=require(_0x57a5('0x12'))(_0x57a5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x57a5('0x14'))['db'];function respondWithStatusCode(_0x43f6a0,_0x4081a6){_0x4081a6=_0x4081a6||0xcc;return function(_0x5f7740){if(_0x5f7740){return _0x43f6a0[_0x57a5('0x15')](_0x4081a6);}return _0x43f6a0['status'](_0x4081a6)[_0x57a5('0x16')]();};}function respondWithResult(_0x24abb6,_0x358431){_0x358431=_0x358431||0xc8;return function(_0xb8bfa5){if(_0xb8bfa5){return _0x24abb6[_0x57a5('0x17')](_0x358431)[_0x57a5('0x18')](_0xb8bfa5);}};}function respondWithFilteredResult(_0x304770,_0x2f94ea){return function(_0x2393a2){if(_0x2393a2){var _0x247ed=_0x2393a2['count'],_0x4dd286=_0x2f94ea['offset'],_0x53e763=_0x2f94ea[_0x57a5('0x19')]+_0x2f94ea[_0x57a5('0x1a')],_0x413ee2;if(_0x53e763>=_0x247ed){_0x53e763=_0x247ed;_0x413ee2=0xc8;}else{_0x413ee2=0xce;}_0x304770['status'](_0x413ee2);return _0x304770[_0x57a5('0x1b')](_0x57a5('0x1c'),_0x4dd286+'-'+_0x53e763+'/'+_0x247ed)[_0x57a5('0x18')](_0x2393a2);}return null;};}function patchUpdates(_0x54203d){return function(_0x29079c){try{jsonpatch[_0x57a5('0x1d')](_0x29079c,_0x54203d,!![]);}catch(_0x582158){return BPromise[_0x57a5('0x1e')](_0x582158);}return _0x29079c['save']();};}function saveUpdates(_0xf38b4d,_0x14d8bd){return function(_0x5caa21){if(_0x5caa21){return _0x5caa21[_0x57a5('0x1f')](_0xf38b4d)[_0x57a5('0x20')](function(_0x5b5504){return _0x5b5504;});}return null;};}function removeEntity(_0x2bf4ec,_0x4a39b0){return function(_0x269aa2){if(_0x269aa2){return _0x269aa2[_0x57a5('0x21')]()[_0x57a5('0x20')](function(){_0x2bf4ec[_0x57a5('0x17')](0xcc)[_0x57a5('0x16')]();});}};}function handleEntityNotFound(_0x3926d8,_0x360cb8){return function(_0x3d04e1){if(!_0x3d04e1){_0x3926d8['sendStatus'](0x194);}return _0x3d04e1;};}function handleError(_0x3535d2,_0x378581){_0x378581=_0x378581||0x1f4;return function(_0x18b56d){logger[_0x57a5('0x22')](_0x18b56d[_0x57a5('0x23')]);if(_0x18b56d[_0x57a5('0x24')]){delete _0x18b56d['name'];}_0x3535d2[_0x57a5('0x17')](_0x378581)[_0x57a5('0x25')](_0x18b56d);};}exports[_0x57a5('0x26')]=function(_0x47f366,_0x32acea){var _0x1f179b={},_0x5b7fda={},_0x228d75={'count':0x0,'rows':[]};var _0x6e993d=db[_0x57a5('0x27')][_0x57a5('0x28')];_0x5b7fda['model']=_[_0x57a5('0x29')](_0x6e993d);_0x5b7fda[_0x57a5('0x2a')]=_[_0x57a5('0x29')](_0x47f366[_0x57a5('0x2a')]);_0x5b7fda['filters']=_[_0x57a5('0x2b')](_0x5b7fda[_0x57a5('0x2c')],_0x5b7fda[_0x57a5('0x2a')]);_0x1f179b[_0x57a5('0x2d')]=_[_0x57a5('0x2b')](_0x5b7fda[_0x57a5('0x2c')],qs['fields'](_0x47f366[_0x57a5('0x2a')][_0x57a5('0x2e')]));_0x1f179b['attributes']=_0x1f179b[_0x57a5('0x2d')]['length']?_0x1f179b[_0x57a5('0x2d')]:_0x5b7fda[_0x57a5('0x2c')];if(!_0x47f366[_0x57a5('0x2a')]['hasOwnProperty']('nolimit')){_0x1f179b[_0x57a5('0x1a')]=qs['limit'](_0x47f366[_0x57a5('0x2a')][_0x57a5('0x1a')]);_0x1f179b[_0x57a5('0x19')]=qs[_0x57a5('0x19')](_0x47f366[_0x57a5('0x2a')][_0x57a5('0x19')]);}_0x1f179b['order']=qs[_0x57a5('0x2f')](_0x47f366[_0x57a5('0x2a')][_0x57a5('0x2f')]);_0x1f179b[_0x57a5('0x30')]=qs[_0x57a5('0x31')](_[_0x57a5('0x32')](_0x47f366[_0x57a5('0x2a')],_0x5b7fda[_0x57a5('0x31')]));if(_0x47f366['query']['filter']){_0x1f179b[_0x57a5('0x30')]=_[_0x57a5('0x33')](_0x1f179b[_0x57a5('0x30')],{'$or':_[_0x57a5('0x34')](_0x6e993d,function(_0x359000){if(_0x359000[_0x57a5('0x35')][_0x57a5('0x36')]!=='VIRTUAL'){var _0x3a6e3d={};_0x3a6e3d[_0x359000[_0x57a5('0x37')]]={'$like':'%'+_0x47f366[_0x57a5('0x2a')][_0x57a5('0x38')]+'%'};return _0x3a6e3d;}})});}_0x1f179b=_[_0x57a5('0x33')]({},_0x1f179b,_0x47f366[_0x57a5('0x39')]);var _0xdf4e5e={'where':_0x1f179b['where']};return db[_0x57a5('0x27')]['count'](_0xdf4e5e)['then'](function(_0x1d6dc6){_0x228d75[_0x57a5('0x3a')]=_0x1d6dc6;if(_0x47f366[_0x57a5('0x2a')][_0x57a5('0x3b')]){_0x1f179b[_0x57a5('0x3c')]=[{'all':!![]}];}return db[_0x57a5('0x27')][_0x57a5('0x3d')](_0x1f179b);})[_0x57a5('0x20')](function(_0x2f20ae){_0x228d75['rows']=_0x2f20ae;return _0x228d75;})[_0x57a5('0x20')](respondWithFilteredResult(_0x32acea,_0x1f179b))[_0x57a5('0x3e')](handleError(_0x32acea,null));};exports[_0x57a5('0x3f')]=function(_0x5014fb,_0x15fddb){var _0x11aedf={'raw':!![],'where':{'id':_0x5014fb['params']['id']}},_0x118bcd={};_0x118bcd[_0x57a5('0x2c')]=_[_0x57a5('0x29')](db['JscriptyQuestionReport']['rawAttributes']);_0x118bcd[_0x57a5('0x2a')]=_[_0x57a5('0x29')](_0x5014fb[_0x57a5('0x2a')]);_0x118bcd[_0x57a5('0x31')]=_[_0x57a5('0x2b')](_0x118bcd[_0x57a5('0x2c')],_0x118bcd['query']);_0x11aedf['attributes']=_['intersection'](_0x118bcd[_0x57a5('0x2c')],qs['fields'](_0x5014fb[_0x57a5('0x2a')][_0x57a5('0x2e')]));_0x11aedf[_0x57a5('0x2d')]=_0x11aedf[_0x57a5('0x2d')][_0x57a5('0x40')]?_0x11aedf[_0x57a5('0x2d')]:_0x118bcd[_0x57a5('0x2c')];if(_0x5014fb['query']['includeAll']){_0x11aedf[_0x57a5('0x3c')]=[{'all':!![]}];}_0x11aedf=_['merge']({},_0x11aedf,_0x5014fb[_0x57a5('0x39')]);return db['JscriptyQuestionReport'][_0x57a5('0x41')](_0x11aedf)[_0x57a5('0x20')](handleEntityNotFound(_0x15fddb,null))[_0x57a5('0x20')](respondWithResult(_0x15fddb,null))[_0x57a5('0x3e')](handleError(_0x15fddb,null));};exports[_0x57a5('0x42')]=function(_0x1c1595,_0x34a44b){return db[_0x57a5('0x27')][_0x57a5('0x42')](_0x1c1595['body'],{})[_0x57a5('0x20')](respondWithResult(_0x34a44b,0xc9))[_0x57a5('0x3e')](handleError(_0x34a44b,null));};exports['update']=function(_0x450aa2,_0x3f9970){if(_0x450aa2[_0x57a5('0x43')]['id']){delete _0x450aa2['body']['id'];}return db['JscriptyQuestionReport'][_0x57a5('0x41')]({'where':{'id':_0x450aa2[_0x57a5('0x44')]['id']}})[_0x57a5('0x20')](handleEntityNotFound(_0x3f9970,null))[_0x57a5('0x20')](saveUpdates(_0x450aa2[_0x57a5('0x43')],null))['then'](respondWithResult(_0x3f9970,null))[_0x57a5('0x3e')](handleError(_0x3f9970,null));};exports[_0x57a5('0x21')]=function(_0x47b87f,_0x1c7c0b){return db['JscriptyQuestionReport'][_0x57a5('0x41')]({'where':{'id':_0x47b87f[_0x57a5('0x44')]['id']}})[_0x57a5('0x20')](handleEntityNotFound(_0x1c7c0b,null))[_0x57a5('0x20')](removeEntity(_0x1c7c0b,null))[_0x57a5('0x3e')](handleError(_0x1c7c0b,null));};exports[_0x57a5('0x45')]=function(_0x44b29e,_0xb60ea6){return db[_0x57a5('0x27')][_0x57a5('0x45')]()[_0x57a5('0x20')](respondWithResult(_0xb60ea6,null))[_0x57a5('0x3e')](handleError(_0xb60ea6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e29d941..f8082f1 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 _0x7dc8=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dc8,0x7b));var _0x87dc=function(_0x41cb39,_0x37322d){_0x41cb39=_0x41cb39-0x0;var _0x21bca1=_0x7dc8[_0x41cb39];return _0x21bca1;};'use strict';var _=require(_0x87dc('0x0'));var util=require('util');var logger=require(_0x87dc('0x1'))(_0x87dc('0x2'));var moment=require(_0x87dc('0x3'));var BPromise=require('bluebird');var rp=require(_0x87dc('0x4'));var fs=require('fs');var path=require(_0x87dc('0x5'));var rimraf=require(_0x87dc('0x6'));var config=require(_0x87dc('0x7'));var attributes=require(_0x87dc('0x8'));module['exports']=function(_0x12f2c2,_0x37b28b){return _0x12f2c2['define'](_0x87dc('0x9'),attributes,{'tableName':_0x87dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0913=['path','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','request-promise'];(function(_0x11340f,_0x231bc9){var _0x262130=function(_0x44962f){while(--_0x44962f){_0x11340f['push'](_0x11340f['shift']());}};_0x262130(++_0x231bc9);}(_0x0913,0x73));var _0x3091=function(_0x23cc08,_0x32d5cb){_0x23cc08=_0x23cc08-0x0;var _0x168fb6=_0x0913[_0x23cc08];return _0x168fb6;};'use strict';var _=require('lodash');var util=require(_0x3091('0x0'));var logger=require(_0x3091('0x1'))(_0x3091('0x2'));var moment=require(_0x3091('0x3'));var BPromise=require('bluebird');var rp=require(_0x3091('0x4'));var fs=require('fs');var path=require(_0x3091('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3091('0x6'));module[_0x3091('0x7')]=function(_0x21ee54,_0x497a67){return _0x21ee54['define'](_0x3091('0x8'),attributes,{'tableName':_0x3091('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index c60bd08..8c4edf7 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 _0x28c7=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x400423,_0x2483f8){var _0x3bfdfd=function(_0x3e87c4){while(--_0x3e87c4){_0x400423['push'](_0x400423['shift']());}};_0x3bfdfd(++_0x2483f8);}(_0x28c7,0x95));var _0x728c=function(_0xcf5a5b,_0x24a19a){_0xcf5a5b=_0xcf5a5b-0x0;var _0x586aa2=_0x28c7[_0xcf5a5b];return _0x586aa2;};'use strict';var _=require(_0x728c('0x0'));var util=require('util');var moment=require(_0x728c('0x1'));var BPromise=require(_0x728c('0x2'));var rs=require(_0x728c('0x3'));var fs=require('fs');var Redis=require(_0x728c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x728c('0x5'));var jayson=require(_0x728c('0x6'));var client=jayson[_0x728c('0x7')][_0x728c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5728,_0x1570c4,_0x4749d4){return new BPromise(function(_0x3c93cb,_0x5e7fca){return client[_0x728c('0x9')](_0x3c5728,_0x4749d4)[_0x728c('0xa')](function(_0x390442){logger['info'](_0x728c('0xb'),_0x1570c4,_0x728c('0xc'));logger['debug'](_0x728c('0xd'),_0x1570c4,_0x728c('0xc'),JSON[_0x728c('0xe')](_0x390442));if(_0x390442[_0x728c('0xf')]){if(_0x390442[_0x728c('0xf')][_0x728c('0x10')]===0x1f4){logger[_0x728c('0xf')](_0x728c('0xb'),_0x1570c4,_0x390442[_0x728c('0xf')][_0x728c('0x11')]);return _0x5e7fca(_0x390442[_0x728c('0xf')]['message']);}logger[_0x728c('0xf')](_0x728c('0xb'),_0x1570c4,_0x390442[_0x728c('0xf')][_0x728c('0x11')]);return _0x3c93cb(_0x390442['error'][_0x728c('0x11')]);}else{logger[_0x728c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1570c4,_0x728c('0xc'));_0x3c93cb(_0x390442[_0x728c('0x13')]['message']);}})['catch'](function(_0x50c6e8){logger[_0x728c('0xf')](_0x728c('0xb'),_0x1570c4,_0x50c6e8);_0x5e7fca(_0x50c6e8);});});} \ No newline at end of file +var _0x5369=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x28846c,_0x35a027){var _0x1cc18b=function(_0x573ecd){while(--_0x573ecd){_0x28846c['push'](_0x28846c['shift']());}};_0x1cc18b(++_0x35a027);}(_0x5369,0xff));var _0x9536=function(_0x1b9715,_0x391748){_0x1b9715=_0x1b9715-0x0;var _0x3851e6=_0x5369[_0x1b9715];return _0x3851e6;};'use strict';var _=require(_0x9536('0x0'));var util=require(_0x9536('0x1'));var moment=require(_0x9536('0x2'));var BPromise=require(_0x9536('0x3'));var rs=require(_0x9536('0x4'));var fs=require('fs');var Redis=require(_0x9536('0x5'));var db=require(_0x9536('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9536('0x7'));var config=require(_0x9536('0x8'));var jayson=require(_0x9536('0x9'));var client=jayson[_0x9536('0xa')][_0x9536('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e5e03,_0x300b95,_0x375eaf){return new BPromise(function(_0x365e98,_0xd95669){return client[_0x9536('0xc')](_0x1e5e03,_0x375eaf)['then'](function(_0x4a26f9){logger[_0x9536('0xd')](_0x9536('0xe'),_0x300b95,_0x9536('0xf'));logger['debug'](_0x9536('0x10'),_0x300b95,_0x9536('0xf'),JSON['stringify'](_0x4a26f9));if(_0x4a26f9[_0x9536('0x11')]){if(_0x4a26f9['error'][_0x9536('0x12')]===0x1f4){logger[_0x9536('0x11')](_0x9536('0xe'),_0x300b95,_0x4a26f9[_0x9536('0x11')][_0x9536('0x13')]);return _0xd95669(_0x4a26f9['error']['message']);}logger[_0x9536('0x11')](_0x9536('0xe'),_0x300b95,_0x4a26f9['error']['message']);return _0x365e98(_0x4a26f9[_0x9536('0x11')][_0x9536('0x13')]);}else{logger[_0x9536('0xd')](_0x9536('0xe'),_0x300b95,_0x9536('0xf'));_0x365e98(_0x4a26f9['result']['message']);}})[_0x9536('0x14')](function(_0x2d0185){logger[_0x9536('0x11')](_0x9536('0xe'),_0x300b95,_0x2d0185);_0xd95669(_0x2d0185);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9eb20d6..7526f22 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 _0x824d=['./jscriptySessionReport.controller','isAuthenticated','index','/describe','describe','/:id','show','get','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x422d86,_0x4294c3){var _0x4ebf49=function(_0x15bf9b){while(--_0x15bf9b){_0x422d86['push'](_0x422d86['shift']());}};_0x4ebf49(++_0x4294c3);}(_0x824d,0x1ee));var _0xd824=function(_0x141116,_0x19ee51){_0x141116=_0x141116-0x0;var _0x190a95=_0x824d[_0x141116];return _0x190a95;};'use strict';var multer=require('multer');var util=require(_0xd824('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd824('0x1'));var router=express[_0xd824('0x2')]();var auth=require(_0xd824('0x3'));var interaction=require(_0xd824('0x4'));var config=require(_0xd824('0x5'));var controller=require(_0xd824('0x6'));router['get']('/',auth[_0xd824('0x7')](),controller[_0xd824('0x8')]);router['get'](_0xd824('0x9'),auth['isAuthenticated'](),controller[_0xd824('0xa')]);router['get'](_0xd824('0xb'),auth[_0xd824('0x7')](),controller[_0xd824('0xc')]);router[_0xd824('0xd')]('/:id/questions',auth[_0xd824('0x7')](),controller['getQuestions']);router['post']('/',auth[_0xd824('0x7')](),controller[_0xd824('0xe')]);router[_0xd824('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd824('0x10')]);router[_0xd824('0x11')](_0xd824('0xb'),auth['isAuthenticated'](),controller[_0xd824('0x12')]);module[_0xd824('0x13')]=router; \ No newline at end of file +var _0x7dba=['isAuthenticated','/:id','show','/:id/questions','getQuestions','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x48c9cc,_0x40d829){var _0x53c347=function(_0x598663){while(--_0x598663){_0x48c9cc['push'](_0x48c9cc['shift']());}};_0x53c347(++_0x40d829);}(_0x7dba,0xe6));var _0xa7db=function(_0x16195c,_0x2d1d08){_0x16195c=_0x16195c-0x0;var _0x3fb973=_0x7dba[_0x16195c];return _0x3fb973;};'use strict';var multer=require(_0xa7db('0x0'));var util=require(_0xa7db('0x1'));var path=require('path');var timeout=require(_0xa7db('0x2'));var express=require(_0xa7db('0x3'));var router=express[_0xa7db('0x4')]();var auth=require(_0xa7db('0x5'));var interaction=require(_0xa7db('0x6'));var config=require(_0xa7db('0x7'));var controller=require(_0xa7db('0x8'));router[_0xa7db('0x9')]('/',auth[_0xa7db('0xa')](),controller['index']);router[_0xa7db('0x9')]('/describe',auth[_0xa7db('0xa')](),controller['describe']);router[_0xa7db('0x9')](_0xa7db('0xb'),auth['isAuthenticated'](),controller[_0xa7db('0xc')]);router[_0xa7db('0x9')](_0xa7db('0xd'),auth[_0xa7db('0xa')](),controller[_0xa7db('0xe')]);router[_0xa7db('0xf')]('/',auth['isAuthenticated'](),controller[_0xa7db('0x10')]);router['put']('/:id',auth[_0xa7db('0xa')](),controller[_0xa7db('0x11')]);router['delete'](_0xa7db('0xb'),auth[_0xa7db('0xa')](),controller[_0xa7db('0x12')]);module[_0xa7db('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 364ce9f..b9a04b7 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 _0xd22b=['setDataValue','starttime','endtime','format','STRING','BOOLEAN','moment','sequelize','DATE'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xd22b,0x102));var _0xbd22=function(_0x5affa7,_0x1a79a6){_0x5affa7=_0x5affa7-0x0;var _0x1b480b=_0xd22b[_0x5affa7];return _0x1b480b;};'use strict';var moment=require(_0xbd22('0x0'));var Sequelize=require(_0xbd22('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xbd22('0x2')],'set':function(_0x5cf11b){this[_0xbd22('0x3')](_0xbd22('0x4'),_0x5cf11b);this[_0xbd22('0x3')](_0xbd22('0x5'),moment()[_0xbd22('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xbd22('0x2')]},'membername':{'type':Sequelize[_0xbd22('0x7')]},'projectname':{'type':Sequelize[_0xbd22('0x7')]},'queue':{'type':Sequelize[_0xbd22('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbd22('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xbd22('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x8757=['BOOLEAN','moment','exports','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x5351b5,_0x1fd6c4){var _0x23295d=function(_0x5bb769){while(--_0x5bb769){_0x5351b5['push'](_0x5351b5['shift']());}};_0x23295d(++_0x1fd6c4);}(_0x8757,0x157));var _0x7875=function(_0x3b5a52,_0x25371a){_0x3b5a52=_0x3b5a52-0x0;var _0x31406e=_0x8757[_0x3b5a52];return _0x31406e;};'use strict';var moment=require(_0x7875('0x0'));var Sequelize=require('sequelize');module[_0x7875('0x1')]={'starttime':{'type':Sequelize[_0x7875('0x2')],'set':function(_0x1b8d7c){this[_0x7875('0x3')](_0x7875('0x4'),_0x1b8d7c);this[_0x7875('0x3')](_0x7875('0x5'),moment()['format'](_0x7875('0x6')));}},'endtime':{'type':Sequelize[_0x7875('0x2')]},'membername':{'type':Sequelize[_0x7875('0x7')]},'projectname':{'type':Sequelize[_0x7875('0x7')]},'queue':{'type':Sequelize[_0x7875('0x7')]},'uniqueid':{'type':Sequelize[_0x7875('0x7')]},'calleridname':{'type':Sequelize[_0x7875('0x7')]},'calleridnum':{'type':Sequelize[_0x7875('0x7')]},'completed':{'type':Sequelize[_0x7875('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 3fd63f9..3b1f615 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 _0x0020=['apply','save','update','then','end','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','type','key','VIRTUAL','includeAll','include','findAll','catch','show','params','merge','options','create','body','destroy','find','describe','getQuestions','nolimit','SessionId','JscriptyQuestionReport','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range'];(function(_0x1bffec,_0x3aeee7){var _0x38b322=function(_0x4fd8af){while(--_0x4fd8af){_0x1bffec['push'](_0x1bffec['shift']());}};_0x38b322(++_0x3aeee7);}(_0x0020,0x19c));var _0x0002=function(_0x544463,_0x214963){_0x544463=_0x544463-0x0;var _0x1add2a=_0x0020[_0x544463];return _0x1add2a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0002('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0002('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0002('0x2'));var moment=require(_0x0002('0x3'));var BPromise=require(_0x0002('0x4'));var Mustache=require(_0x0002('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0002('0x6'));var ejs=require(_0x0002('0x7'));var fs=require('fs');var _=require(_0x0002('0x8'));var squel=require(_0x0002('0x9'));var crypto=require(_0x0002('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0002('0xb'));var toCsv=require(_0x0002('0x6'));var querystring=require('querystring');var Papa=require(_0x0002('0xc'));var Redis=require(_0x0002('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0002('0xe'));var logger=require(_0x0002('0xf'))(_0x0002('0x10'));var utils=require('../../config/utils');var config=require(_0x0002('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131426,_0x5b4be4){_0x5b4be4=_0x5b4be4||0xcc;return function(_0x53d7fe){if(_0x53d7fe){return _0x131426[_0x0002('0x12')](_0x5b4be4);}return _0x131426[_0x0002('0x13')](_0x5b4be4)['end']();};}function respondWithResult(_0x28e321,_0x48a98f){_0x48a98f=_0x48a98f||0xc8;return function(_0x1fbbc0){if(_0x1fbbc0){return _0x28e321['status'](_0x48a98f)[_0x0002('0x14')](_0x1fbbc0);}};}function respondWithFilteredResult(_0x2f8f44,_0x157644){return function(_0x6b7997){if(_0x6b7997){var _0x373435=_0x6b7997[_0x0002('0x15')],_0x49eb63=_0x157644[_0x0002('0x16')],_0x32f6ea=_0x157644[_0x0002('0x16')]+_0x157644[_0x0002('0x17')],_0x4b4d97;if(_0x32f6ea>=_0x373435){_0x32f6ea=_0x373435;_0x4b4d97=0xc8;}else{_0x4b4d97=0xce;}_0x2f8f44[_0x0002('0x13')](_0x4b4d97);return _0x2f8f44[_0x0002('0x18')](_0x0002('0x19'),_0x49eb63+'-'+_0x32f6ea+'/'+_0x373435)[_0x0002('0x14')](_0x6b7997);}return null;};}function patchUpdates(_0x15844e){return function(_0x58b15c){try{jsonpatch[_0x0002('0x1a')](_0x58b15c,_0x15844e,!![]);}catch(_0x3aedc6){return BPromise['reject'](_0x3aedc6);}return _0x58b15c[_0x0002('0x1b')]();};}function saveUpdates(_0x26f8a8,_0x188fec){return function(_0x26a349){if(_0x26a349){return _0x26a349[_0x0002('0x1c')](_0x26f8a8)[_0x0002('0x1d')](function(_0xb18d1c){return _0xb18d1c;});}return null;};}function removeEntity(_0x18433e,_0x37ae17){return function(_0x6f08e3){if(_0x6f08e3){return _0x6f08e3['destroy']()[_0x0002('0x1d')](function(){_0x18433e[_0x0002('0x13')](0xcc)[_0x0002('0x1e')]();});}};}function handleEntityNotFound(_0xd74e14,_0x2fd671){return function(_0x2b17f0){if(!_0x2b17f0){_0xd74e14[_0x0002('0x12')](0x194);}return _0x2b17f0;};}function handleError(_0x5f3f42,_0x4bc766){_0x4bc766=_0x4bc766||0x1f4;return function(_0xe527ef){logger[_0x0002('0x1f')](_0xe527ef[_0x0002('0x20')]);if(_0xe527ef[_0x0002('0x21')]){delete _0xe527ef['name'];}_0x5f3f42[_0x0002('0x13')](_0x4bc766)[_0x0002('0x22')](_0xe527ef);};}exports[_0x0002('0x23')]=function(_0x4aeb04,_0x10212a){var _0x21da21={},_0x5827dd={},_0x18c8f8={'count':0x0,'rows':[]};var _0x267501=db[_0x0002('0x24')][_0x0002('0x25')];_0x5827dd[_0x0002('0x26')]=_[_0x0002('0x27')](_0x267501);_0x5827dd[_0x0002('0x28')]=_[_0x0002('0x27')](_0x4aeb04[_0x0002('0x28')]);_0x5827dd[_0x0002('0x29')]=_[_0x0002('0x2a')](_0x5827dd[_0x0002('0x26')],_0x5827dd['query']);_0x21da21[_0x0002('0x2b')]=_[_0x0002('0x2a')](_0x5827dd[_0x0002('0x26')],qs['fields'](_0x4aeb04[_0x0002('0x28')][_0x0002('0x2c')]));_0x21da21['attributes']=_0x21da21[_0x0002('0x2b')][_0x0002('0x2d')]?_0x21da21['attributes']:_0x5827dd[_0x0002('0x26')];if(!_0x4aeb04['query'][_0x0002('0x2e')]('nolimit')){_0x21da21['limit']=qs[_0x0002('0x17')](_0x4aeb04[_0x0002('0x28')][_0x0002('0x17')]);_0x21da21['offset']=qs['offset'](_0x4aeb04['query'][_0x0002('0x16')]);}_0x21da21[_0x0002('0x2f')]=qs[_0x0002('0x30')](_0x4aeb04[_0x0002('0x28')]['sort']);_0x21da21[_0x0002('0x31')]=qs[_0x0002('0x29')](_['pick'](_0x4aeb04['query'],_0x5827dd['filters']));if(_0x4aeb04[_0x0002('0x28')][_0x0002('0x32')]){_0x21da21[_0x0002('0x31')]=_['merge'](_0x21da21['where'],{'$or':_[_0x0002('0x33')](_0x267501,function(_0xec196f){if(_0xec196f[_0x0002('0x34')][_0x0002('0x35')]!==_0x0002('0x36')){var _0x1e6580={};_0x1e6580[_0xec196f['field']]={'$like':'%'+_0x4aeb04[_0x0002('0x28')][_0x0002('0x32')]+'%'};return _0x1e6580;}})});}_0x21da21=_['merge']({},_0x21da21,_0x4aeb04['options']);var _0x43f378={'where':_0x21da21[_0x0002('0x31')]};return db[_0x0002('0x24')][_0x0002('0x15')](_0x43f378)[_0x0002('0x1d')](function(_0x333b52){_0x18c8f8[_0x0002('0x15')]=_0x333b52;if(_0x4aeb04[_0x0002('0x28')][_0x0002('0x37')]){_0x21da21[_0x0002('0x38')]=[{'all':!![]}];}return db[_0x0002('0x24')][_0x0002('0x39')](_0x21da21);})[_0x0002('0x1d')](function(_0x31952b){_0x18c8f8['rows']=_0x31952b;return _0x18c8f8;})[_0x0002('0x1d')](respondWithFilteredResult(_0x10212a,_0x21da21))[_0x0002('0x3a')](handleError(_0x10212a,null));};exports[_0x0002('0x3b')]=function(_0xcfbbca,_0x760a31){var _0x46a722={'raw':!![],'where':{'id':_0xcfbbca[_0x0002('0x3c')]['id']}},_0x12064f={};_0x12064f[_0x0002('0x26')]=_[_0x0002('0x27')](db[_0x0002('0x24')][_0x0002('0x25')]);_0x12064f[_0x0002('0x28')]=_[_0x0002('0x27')](_0xcfbbca[_0x0002('0x28')]);_0x12064f[_0x0002('0x29')]=_[_0x0002('0x2a')](_0x12064f['model'],_0x12064f[_0x0002('0x28')]);_0x46a722['attributes']=_['intersection'](_0x12064f[_0x0002('0x26')],qs[_0x0002('0x2c')](_0xcfbbca['query'][_0x0002('0x2c')]));_0x46a722['attributes']=_0x46a722[_0x0002('0x2b')][_0x0002('0x2d')]?_0x46a722[_0x0002('0x2b')]:_0x12064f[_0x0002('0x26')];if(_0xcfbbca[_0x0002('0x28')]['includeAll']){_0x46a722[_0x0002('0x38')]=[{'all':!![]}];}_0x46a722=_[_0x0002('0x3d')]({},_0x46a722,_0xcfbbca[_0x0002('0x3e')]);return db[_0x0002('0x24')]['find'](_0x46a722)[_0x0002('0x1d')](handleEntityNotFound(_0x760a31,null))[_0x0002('0x1d')](respondWithResult(_0x760a31,null))[_0x0002('0x3a')](handleError(_0x760a31,null));};exports[_0x0002('0x3f')]=function(_0x36ecc0,_0x506e96){return db[_0x0002('0x24')][_0x0002('0x3f')](_0x36ecc0[_0x0002('0x40')],{})[_0x0002('0x1d')](respondWithResult(_0x506e96,0xc9))['catch'](handleError(_0x506e96,null));};exports[_0x0002('0x1c')]=function(_0x1c3b4c,_0x4cee4e){if(_0x1c3b4c[_0x0002('0x40')]['id']){delete _0x1c3b4c['body']['id'];}return db[_0x0002('0x24')]['find']({'where':{'id':_0x1c3b4c[_0x0002('0x3c')]['id']}})[_0x0002('0x1d')](handleEntityNotFound(_0x4cee4e,null))[_0x0002('0x1d')](saveUpdates(_0x1c3b4c[_0x0002('0x40')],null))[_0x0002('0x1d')](respondWithResult(_0x4cee4e,null))[_0x0002('0x3a')](handleError(_0x4cee4e,null));};exports[_0x0002('0x41')]=function(_0x55e335,_0x1fa92f){return db[_0x0002('0x24')][_0x0002('0x42')]({'where':{'id':_0x55e335[_0x0002('0x3c')]['id']}})[_0x0002('0x1d')](handleEntityNotFound(_0x1fa92f,null))[_0x0002('0x1d')](removeEntity(_0x1fa92f,null))[_0x0002('0x3a')](handleError(_0x1fa92f,null));};exports[_0x0002('0x43')]=function(_0x104bda,_0x235463){return db[_0x0002('0x24')]['describe']()[_0x0002('0x1d')](respondWithResult(_0x235463,null))['catch'](handleError(_0x235463,null));};exports[_0x0002('0x44')]=function(_0x353104,_0x4116f0,_0x138b18){var _0x2dc2a3={'raw':!![],'where':{}};var _0x234bb0={};var _0x37ecbb={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x353104[_0x0002('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4116f0,null))[_0x0002('0x1d')](function(_0xcea987){if(_0xcea987){_0x234bb0['model']=_[_0x0002('0x27')](db['JscriptyQuestionReport'][_0x0002('0x25')]);_0x234bb0['query']=_[_0x0002('0x27')](_0x353104[_0x0002('0x28')]);_0x234bb0[_0x0002('0x29')]=_[_0x0002('0x2a')](_0x234bb0[_0x0002('0x26')],_0x234bb0[_0x0002('0x28')]);_0x2dc2a3['attributes']=_[_0x0002('0x2a')](_0x234bb0[_0x0002('0x26')],qs[_0x0002('0x2c')](_0x353104[_0x0002('0x28')][_0x0002('0x2c')]));_0x2dc2a3[_0x0002('0x2b')]=_0x2dc2a3[_0x0002('0x2b')]['length']?_0x2dc2a3[_0x0002('0x2b')]:_0x234bb0['model'];if(!_0x353104[_0x0002('0x28')][_0x0002('0x2e')](_0x0002('0x45'))){_0x2dc2a3[_0x0002('0x17')]=qs['limit'](_0x353104[_0x0002('0x28')][_0x0002('0x17')]);_0x2dc2a3['offset']=qs['offset'](_0x353104[_0x0002('0x28')]['offset']);}_0x2dc2a3[_0x0002('0x2f')]=qs[_0x0002('0x30')](_0x353104[_0x0002('0x28')][_0x0002('0x30')]);_0x2dc2a3[_0x0002('0x31')]=qs[_0x0002('0x29')](_['pick'](_0x353104[_0x0002('0x28')],_0x234bb0['filters']));_0x2dc2a3[_0x0002('0x31')][_0x0002('0x46')]=_0xcea987['id'];if(_0x353104[_0x0002('0x28')][_0x0002('0x32')]){_0x2dc2a3['where']=_[_0x0002('0x3d')](_0x2dc2a3['where'],{'$or':_[_0x0002('0x33')](_0x2dc2a3['attributes'],function(_0x20a22c){var _0x2cb5e6={};_0x2cb5e6[_0x20a22c]={'$like':'%'+_0x353104[_0x0002('0x28')]['filter']+'%'};return _0x2cb5e6;})});}_0x2dc2a3=_[_0x0002('0x3d')]({},_0x2dc2a3,_0x353104[_0x0002('0x3e')]);return db[_0x0002('0x47')][_0x0002('0x15')]({'where':_0x2dc2a3[_0x0002('0x31')]})[_0x0002('0x1d')](function(_0x12298c){_0x37ecbb[_0x0002('0x15')]=_0x12298c;if(_0x353104[_0x0002('0x28')][_0x0002('0x37')]){_0x2dc2a3[_0x0002('0x38')]=[{'all':!![]}];}return db[_0x0002('0x47')]['findAll'](_0x2dc2a3);})[_0x0002('0x1d')](function(_0x28d3e1){_0x37ecbb[_0x0002('0x48')]=_0x28d3e1;return _0x37ecbb;});}})[_0x0002('0x1d')](respondWithFilteredResult(_0x4116f0,_0x2dc2a3))['catch'](handleError(_0x4116f0,null));}; \ No newline at end of file +var _0xde13=['bluebird','util','sox','ejs','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','set','Content-Range','json','save','update','then','destroy','end','sendStatus','stack','name','send','index','JscriptySessionReport','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','key','field','options','count','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','map','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1715a5,_0x3e025b){var _0x3560f9=function(_0x4a6905){while(--_0x4a6905){_0x1715a5['push'](_0x1715a5['shift']());}};_0x3560f9(++_0x3e025b);}(_0xde13,0x90));var _0x3de1=function(_0x4f36c4,_0x3c5d7f){_0x4f36c4=_0x4f36c4-0x0;var _0x12ee6f=_0xde13[_0x4f36c4];return _0x12ee6f;};'use strict';var pdf=require(_0x3de1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3de1('0x1'));var zipdir=require(_0x3de1('0x2'));var jsonpatch=require(_0x3de1('0x3'));var rp=require(_0x3de1('0x4'));var moment=require(_0x3de1('0x5'));var BPromise=require(_0x3de1('0x6'));var Mustache=require('mustache');var util=require(_0x3de1('0x7'));var path=require('path');var sox=require(_0x3de1('0x8'));var csv=require('to-csv');var ejs=require(_0x3de1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3de1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3de1('0xb'));var querystring=require(_0x3de1('0xc'));var Papa=require('papaparse');var Redis=require(_0x3de1('0xd'));var authService=require(_0x3de1('0xe'));var qs=require(_0x3de1('0xf'));var hardwareService=require(_0x3de1('0x10'));var logger=require(_0x3de1('0x11'))(_0x3de1('0x12'));var utils=require(_0x3de1('0x13'));var config=require(_0x3de1('0x14'));var db=require(_0x3de1('0x15'))['db'];function respondWithStatusCode(_0x563d7d,_0x1fd2e0){_0x1fd2e0=_0x1fd2e0||0xcc;return function(_0xf703c){if(_0xf703c){return _0x563d7d['sendStatus'](_0x1fd2e0);}return _0x563d7d[_0x3de1('0x16')](_0x1fd2e0)['end']();};}function respondWithResult(_0x16b181,_0x44ae8a){_0x44ae8a=_0x44ae8a||0xc8;return function(_0x1b17c1){if(_0x1b17c1){return _0x16b181[_0x3de1('0x16')](_0x44ae8a)['json'](_0x1b17c1);}};}function respondWithFilteredResult(_0x184b26,_0xa8c181){return function(_0x372073){if(_0x372073){var _0x36f959=_0x372073['count'],_0x588f89=_0xa8c181[_0x3de1('0x17')],_0x536c47=_0xa8c181[_0x3de1('0x17')]+_0xa8c181[_0x3de1('0x18')],_0x472cbc;if(_0x536c47>=_0x36f959){_0x536c47=_0x36f959;_0x472cbc=0xc8;}else{_0x472cbc=0xce;}_0x184b26['status'](_0x472cbc);return _0x184b26[_0x3de1('0x19')](_0x3de1('0x1a'),_0x588f89+'-'+_0x536c47+'/'+_0x36f959)[_0x3de1('0x1b')](_0x372073);}return null;};}function patchUpdates(_0x1db3ff){return function(_0x3f7ade){try{jsonpatch['apply'](_0x3f7ade,_0x1db3ff,!![]);}catch(_0x556923){return BPromise['reject'](_0x556923);}return _0x3f7ade[_0x3de1('0x1c')]();};}function saveUpdates(_0x1bf369,_0x10856f){return function(_0x5300b0){if(_0x5300b0){return _0x5300b0[_0x3de1('0x1d')](_0x1bf369)[_0x3de1('0x1e')](function(_0x1cbe3c){return _0x1cbe3c;});}return null;};}function removeEntity(_0x1b020e,_0x2cf4c5){return function(_0x56d233){if(_0x56d233){return _0x56d233[_0x3de1('0x1f')]()[_0x3de1('0x1e')](function(){_0x1b020e['status'](0xcc)[_0x3de1('0x20')]();});}};}function handleEntityNotFound(_0x3c563f,_0x132df8){return function(_0x3b7657){if(!_0x3b7657){_0x3c563f[_0x3de1('0x21')](0x194);}return _0x3b7657;};}function handleError(_0x194ef9,_0x248835){_0x248835=_0x248835||0x1f4;return function(_0x10cc31){logger['error'](_0x10cc31[_0x3de1('0x22')]);if(_0x10cc31[_0x3de1('0x23')]){delete _0x10cc31[_0x3de1('0x23')];}_0x194ef9['status'](_0x248835)[_0x3de1('0x24')](_0x10cc31);};}exports[_0x3de1('0x25')]=function(_0x2caeba,_0x5b5e18){var _0x4e9fcb={},_0x5cdb2d={},_0x3b37aa={'count':0x0,'rows':[]};var _0x22f0fe=db[_0x3de1('0x26')]['rawAttributes'];_0x5cdb2d[_0x3de1('0x27')]=_[_0x3de1('0x28')](_0x22f0fe);_0x5cdb2d[_0x3de1('0x29')]=_['keys'](_0x2caeba['query']);_0x5cdb2d['filters']=_[_0x3de1('0x2a')](_0x5cdb2d[_0x3de1('0x27')],_0x5cdb2d[_0x3de1('0x29')]);_0x4e9fcb[_0x3de1('0x2b')]=_['intersection'](_0x5cdb2d[_0x3de1('0x27')],qs[_0x3de1('0x2c')](_0x2caeba[_0x3de1('0x29')][_0x3de1('0x2c')]));_0x4e9fcb[_0x3de1('0x2b')]=_0x4e9fcb['attributes']['length']?_0x4e9fcb[_0x3de1('0x2b')]:_0x5cdb2d['model'];if(!_0x2caeba[_0x3de1('0x29')]['hasOwnProperty'](_0x3de1('0x2d'))){_0x4e9fcb[_0x3de1('0x18')]=qs[_0x3de1('0x18')](_0x2caeba[_0x3de1('0x29')][_0x3de1('0x18')]);_0x4e9fcb[_0x3de1('0x17')]=qs[_0x3de1('0x17')](_0x2caeba['query']['offset']);}_0x4e9fcb[_0x3de1('0x2e')]=qs[_0x3de1('0x2f')](_0x2caeba[_0x3de1('0x29')][_0x3de1('0x2f')]);_0x4e9fcb[_0x3de1('0x30')]=qs[_0x3de1('0x31')](_[_0x3de1('0x32')](_0x2caeba[_0x3de1('0x29')],_0x5cdb2d[_0x3de1('0x31')]));if(_0x2caeba[_0x3de1('0x29')][_0x3de1('0x33')]){_0x4e9fcb[_0x3de1('0x30')]=_[_0x3de1('0x34')](_0x4e9fcb[_0x3de1('0x30')],{'$or':_['map'](_0x22f0fe,function(_0x3225e4){if(_0x3225e4['type'][_0x3de1('0x35')]!=='VIRTUAL'){var _0x33107b={};_0x33107b[_0x3225e4[_0x3de1('0x36')]]={'$like':'%'+_0x2caeba[_0x3de1('0x29')][_0x3de1('0x33')]+'%'};return _0x33107b;}})});}_0x4e9fcb=_[_0x3de1('0x34')]({},_0x4e9fcb,_0x2caeba[_0x3de1('0x37')]);var _0x4ad65a={'where':_0x4e9fcb[_0x3de1('0x30')]};return db['JscriptySessionReport']['count'](_0x4ad65a)[_0x3de1('0x1e')](function(_0x219b56){_0x3b37aa[_0x3de1('0x38')]=_0x219b56;if(_0x2caeba[_0x3de1('0x29')]['includeAll']){_0x4e9fcb['include']=[{'all':!![]}];}return db[_0x3de1('0x26')][_0x3de1('0x39')](_0x4e9fcb);})[_0x3de1('0x1e')](function(_0x2f5978){_0x3b37aa[_0x3de1('0x3a')]=_0x2f5978;return _0x3b37aa;})[_0x3de1('0x1e')](respondWithFilteredResult(_0x5b5e18,_0x4e9fcb))[_0x3de1('0x3b')](handleError(_0x5b5e18,null));};exports[_0x3de1('0x3c')]=function(_0x333abc,_0x86b875){var _0x3c846e={'raw':!![],'where':{'id':_0x333abc[_0x3de1('0x3d')]['id']}},_0x11fbab={};_0x11fbab[_0x3de1('0x27')]=_[_0x3de1('0x28')](db[_0x3de1('0x26')][_0x3de1('0x3e')]);_0x11fbab[_0x3de1('0x29')]=_[_0x3de1('0x28')](_0x333abc[_0x3de1('0x29')]);_0x11fbab[_0x3de1('0x31')]=_[_0x3de1('0x2a')](_0x11fbab[_0x3de1('0x27')],_0x11fbab['query']);_0x3c846e[_0x3de1('0x2b')]=_[_0x3de1('0x2a')](_0x11fbab[_0x3de1('0x27')],qs['fields'](_0x333abc[_0x3de1('0x29')][_0x3de1('0x2c')]));_0x3c846e['attributes']=_0x3c846e[_0x3de1('0x2b')][_0x3de1('0x3f')]?_0x3c846e[_0x3de1('0x2b')]:_0x11fbab['model'];if(_0x333abc[_0x3de1('0x29')][_0x3de1('0x40')]){_0x3c846e[_0x3de1('0x41')]=[{'all':!![]}];}_0x3c846e=_[_0x3de1('0x34')]({},_0x3c846e,_0x333abc['options']);return db['JscriptySessionReport'][_0x3de1('0x42')](_0x3c846e)['then'](handleEntityNotFound(_0x86b875,null))[_0x3de1('0x1e')](respondWithResult(_0x86b875,null))[_0x3de1('0x3b')](handleError(_0x86b875,null));};exports[_0x3de1('0x43')]=function(_0x4e6de5,_0x5b83b5){return db[_0x3de1('0x26')]['create'](_0x4e6de5[_0x3de1('0x44')],{})[_0x3de1('0x1e')](respondWithResult(_0x5b83b5,0xc9))[_0x3de1('0x3b')](handleError(_0x5b83b5,null));};exports['update']=function(_0x296c33,_0x23534c){if(_0x296c33[_0x3de1('0x44')]['id']){delete _0x296c33[_0x3de1('0x44')]['id'];}return db[_0x3de1('0x26')][_0x3de1('0x42')]({'where':{'id':_0x296c33['params']['id']}})[_0x3de1('0x1e')](handleEntityNotFound(_0x23534c,null))[_0x3de1('0x1e')](saveUpdates(_0x296c33[_0x3de1('0x44')],null))[_0x3de1('0x1e')](respondWithResult(_0x23534c,null))['catch'](handleError(_0x23534c,null));};exports[_0x3de1('0x1f')]=function(_0x3c59d1,_0x3232b4){return db[_0x3de1('0x26')][_0x3de1('0x42')]({'where':{'id':_0x3c59d1['params']['id']}})[_0x3de1('0x1e')](handleEntityNotFound(_0x3232b4,null))['then'](removeEntity(_0x3232b4,null))['catch'](handleError(_0x3232b4,null));};exports[_0x3de1('0x45')]=function(_0x1d321b,_0x1ef6d9){return db[_0x3de1('0x26')][_0x3de1('0x45')]()[_0x3de1('0x1e')](respondWithResult(_0x1ef6d9,null))[_0x3de1('0x3b')](handleError(_0x1ef6d9,null));};exports[_0x3de1('0x46')]=function(_0x4de06e,_0x4daaba,_0x586343){var _0x84503f={'raw':!![],'where':{}};var _0x427994={};var _0x30fe53={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3de1('0x47')]({'where':{'id':_0x4de06e['params']['id']}})['then'](handleEntityNotFound(_0x4daaba,null))[_0x3de1('0x1e')](function(_0x32e9d4){if(_0x32e9d4){_0x427994[_0x3de1('0x27')]=_[_0x3de1('0x28')](db[_0x3de1('0x48')][_0x3de1('0x3e')]);_0x427994[_0x3de1('0x29')]=_[_0x3de1('0x28')](_0x4de06e[_0x3de1('0x29')]);_0x427994['filters']=_[_0x3de1('0x2a')](_0x427994['model'],_0x427994['query']);_0x84503f[_0x3de1('0x2b')]=_['intersection'](_0x427994[_0x3de1('0x27')],qs['fields'](_0x4de06e[_0x3de1('0x29')][_0x3de1('0x2c')]));_0x84503f[_0x3de1('0x2b')]=_0x84503f[_0x3de1('0x2b')][_0x3de1('0x3f')]?_0x84503f[_0x3de1('0x2b')]:_0x427994[_0x3de1('0x27')];if(!_0x4de06e[_0x3de1('0x29')][_0x3de1('0x49')](_0x3de1('0x2d'))){_0x84503f[_0x3de1('0x18')]=qs['limit'](_0x4de06e['query']['limit']);_0x84503f[_0x3de1('0x17')]=qs[_0x3de1('0x17')](_0x4de06e[_0x3de1('0x29')][_0x3de1('0x17')]);}_0x84503f['order']=qs[_0x3de1('0x2f')](_0x4de06e[_0x3de1('0x29')][_0x3de1('0x2f')]);_0x84503f[_0x3de1('0x30')]=qs['filters'](_[_0x3de1('0x32')](_0x4de06e[_0x3de1('0x29')],_0x427994['filters']));_0x84503f[_0x3de1('0x30')]['SessionId']=_0x32e9d4['id'];if(_0x4de06e['query']['filter']){_0x84503f[_0x3de1('0x30')]=_['merge'](_0x84503f[_0x3de1('0x30')],{'$or':_[_0x3de1('0x4a')](_0x84503f[_0x3de1('0x2b')],function(_0x4543d7){var _0x31c88c={};_0x31c88c[_0x4543d7]={'$like':'%'+_0x4de06e['query'][_0x3de1('0x33')]+'%'};return _0x31c88c;})});}_0x84503f=_['merge']({},_0x84503f,_0x4de06e[_0x3de1('0x37')]);return db[_0x3de1('0x48')][_0x3de1('0x38')]({'where':_0x84503f[_0x3de1('0x30')]})[_0x3de1('0x1e')](function(_0x495547){_0x30fe53[_0x3de1('0x38')]=_0x495547;if(_0x4de06e[_0x3de1('0x29')][_0x3de1('0x40')]){_0x84503f[_0x3de1('0x41')]=[{'all':!![]}];}return db[_0x3de1('0x48')]['findAll'](_0x84503f);})[_0x3de1('0x1e')](function(_0x1d32dc){_0x30fe53[_0x3de1('0x3a')]=_0x1d32dc;return _0x30fe53;});}})[_0x3de1('0x1e')](respondWithFilteredResult(_0x4daaba,_0x84503f))[_0x3de1('0x3b')](handleError(_0x4daaba,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 23f5a98..ce1c606 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 _0x5ba9=['../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','api','moment','path','rimraf'];(function(_0x26142e,_0x230324){var _0xd3d7bf=function(_0x5df265){while(--_0x5df265){_0x26142e['push'](_0x26142e['shift']());}};_0xd3d7bf(++_0x230324);}(_0x5ba9,0x1a7));var _0x95ba=function(_0x3f3516,_0xd77468){_0x3f3516=_0x3f3516-0x0;var _0x5a24b0=_0x5ba9[_0x3f3516];return _0x5a24b0;};'use strict';var _=require(_0x95ba('0x0'));var util=require(_0x95ba('0x1'));var logger=require('../../config/logger')(_0x95ba('0x2'));var moment=require(_0x95ba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ba('0x4'));var rimraf=require(_0x95ba('0x5'));var config=require(_0x95ba('0x6'));var attributes=require(_0x95ba('0x7'));module['exports']=function(_0x232ba5,_0x128221){return _0x232ba5[_0x95ba('0x8')](_0x95ba('0x9'),attributes,{'tableName':_0x95ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x821f=['exports','JscriptySessionReport','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x16c30,_0x177d55){var _0x374738=function(_0x238685){while(--_0x238685){_0x16c30['push'](_0x16c30['shift']());}};_0x374738(++_0x177d55);}(_0x821f,0x1a4));var _0xf821=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x821f[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xf821('0x0'));var util=require(_0xf821('0x1'));var logger=require(_0xf821('0x2'))(_0xf821('0x3'));var moment=require(_0xf821('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf821('0x5'));var rimraf=require(_0xf821('0x6'));var config=require(_0xf821('0x7'));var attributes=require(_0xf821('0x8'));module[_0xf821('0x9')]=function(_0x4c72dc,_0x47abcd){return _0x4c72dc['define'](_0xf821('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 13941d0..4f29d03 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 _0x8921=['error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1bbdcf,_0x45fb38){var _0x5a7d23=function(_0x4f3815){while(--_0x4f3815){_0x1bbdcf['push'](_0x1bbdcf['shift']());}};_0x5a7d23(++_0x45fb38);}(_0x8921,0x9a));var _0x1892=function(_0x50ec6b,_0xbc20d3){_0x50ec6b=_0x50ec6b-0x0;var _0x40b2d0=_0x8921[_0x50ec6b];return _0x40b2d0;};'use strict';var _=require(_0x1892('0x0'));var util=require('util');var moment=require(_0x1892('0x1'));var BPromise=require(_0x1892('0x2'));var rs=require(_0x1892('0x3'));var fs=require('fs');var Redis=require(_0x1892('0x4'));var db=require(_0x1892('0x5'))['db'];var utils=require(_0x1892('0x6'));var logger=require(_0x1892('0x7'))(_0x1892('0x8'));var config=require(_0x1892('0x9'));var jayson=require(_0x1892('0xa'));var client=jayson[_0x1892('0xb')][_0x1892('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504741,_0xfe2155,_0x6a2604){return new BPromise(function(_0x2db820,_0x18d62f){return client[_0x1892('0xd')](_0x504741,_0x6a2604)[_0x1892('0xe')](function(_0x4d15a4){logger[_0x1892('0xf')](_0x1892('0x10'),_0xfe2155,_0x1892('0x11'));logger[_0x1892('0x12')](_0x1892('0x13'),_0xfe2155,_0x1892('0x11'),JSON[_0x1892('0x14')](_0x4d15a4));if(_0x4d15a4[_0x1892('0x15')]){if(_0x4d15a4[_0x1892('0x15')][_0x1892('0x16')]===0x1f4){logger[_0x1892('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0xfe2155,_0x4d15a4[_0x1892('0x15')][_0x1892('0x17')]);return _0x18d62f(_0x4d15a4[_0x1892('0x15')]['message']);}logger[_0x1892('0x15')](_0x1892('0x10'),_0xfe2155,_0x4d15a4[_0x1892('0x15')][_0x1892('0x17')]);return _0x2db820(_0x4d15a4['error']['message']);}else{logger[_0x1892('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xfe2155,_0x1892('0x11'));_0x2db820(_0x4d15a4['result'][_0x1892('0x17')]);}})[_0x1892('0x18')](function(_0x237451){logger[_0x1892('0x15')](_0x1892('0x10'),_0xfe2155,_0x237451);_0x18d62f(_0x237451);});});} \ No newline at end of file +var _0xcefd=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xcefd,0x126));var _0xdcef=function(_0x3d2f63,_0x590356){_0x3d2f63=_0x3d2f63-0x0;var _0x35979c=_0xcefd[_0x3d2f63];return _0x35979c;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var moment=require(_0xdcef('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcef('0x6'))(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcef('0x9')][_0xdcef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb1b7,_0x3260fe,_0x53e707){return new BPromise(function(_0x56ee48,_0x8b30d4){return client[_0xdcef('0xb')](_0x3fb1b7,_0x53e707)[_0xdcef('0xc')](function(_0x5d601b){logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));logger[_0xdcef('0x10')](_0xdcef('0x11'),_0x3260fe,_0xdcef('0xf'),JSON['stringify'](_0x5d601b));if(_0x5d601b['error']){if(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x13')]===0x1f4){logger['error'](_0xdcef('0xe'),_0x3260fe,_0x5d601b['error']['message']);return _0x8b30d4(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);return _0x56ee48(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}else{logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));_0x56ee48(_0x5d601b[_0xdcef('0x15')]['message']);}})[_0xdcef('0x16')](function(_0x4dd058){logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x4dd058);_0x8b30d4(_0x4dd058);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index a8380c3..2103124 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 _0x84f2=['/:id','isAuthenticated','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x220248,_0x5e9b83){var _0x37bf5d=function(_0x4c9c50){while(--_0x4c9c50){_0x220248['push'](_0x220248['shift']());}};_0x37bf5d(++_0x5e9b83);}(_0x84f2,0xad));var _0x284f=function(_0x545e86,_0x46a2ed){_0x545e86=_0x545e86-0x0;var _0xa98055=_0x84f2[_0x545e86];return _0xa98055;};'use strict';var multer=require(_0x284f('0x0'));var util=require('util');var path=require(_0x284f('0x1'));var timeout=require(_0x284f('0x2'));var express=require(_0x284f('0x3'));var router=express[_0x284f('0x4')]();var auth=require(_0x284f('0x5'));var interaction=require(_0x284f('0x6'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller['index']);router['put'](_0x284f('0x7'),auth[_0x284f('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x6c59=['util','path','connect-timeout','express','../../config/environment','get','index','/:id','update','exports','multer'];(function(_0x2e200c,_0x48ecf0){var _0x5a1e2e=function(_0x1e39a9){while(--_0x1e39a9){_0x2e200c['push'](_0x2e200c['shift']());}};_0x5a1e2e(++_0x48ecf0);}(_0x6c59,0x112));var _0x96c5=function(_0x560f00,_0x21509c){_0x560f00=_0x560f00-0x0;var _0x1f3c10=_0x6c59[_0x560f00];return _0x1f3c10;};'use strict';var multer=require(_0x96c5('0x0'));var util=require(_0x96c5('0x1'));var path=require(_0x96c5('0x2'));var timeout=require(_0x96c5('0x3'));var express=require(_0x96c5('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x96c5('0x5'));var controller=require('./license.controller');router[_0x96c5('0x6')]('/',controller[_0x96c5('0x7')]);router['put'](_0x96c5('0x8'),auth['isAuthenticated'](),controller[_0x96c5('0x9')]);module[_0x96c5('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 6c8fed8..1c0033b 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 _0xbdb1=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x38e920,_0x43724a){var _0xbcd1d7=function(_0x51b210){while(--_0x51b210){_0x38e920['push'](_0x38e920['shift']());}};_0xbcd1d7(++_0x43724a);}(_0xbdb1,0xc3));var _0x1bdb=function(_0x588dd2,_0x5c8152){_0x588dd2=_0x588dd2-0x0;var _0x4f208e=_0xbdb1[_0x588dd2];return _0x4f208e;};'use strict';var Sequelize=require(_0x1bdb('0x0'));module[_0x1bdb('0x1')]={'license':{'type':Sequelize[_0x1bdb('0x2')]},'data1':{'type':Sequelize[_0x1bdb('0x3')]},'data2':{'type':Sequelize[_0x1bdb('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x1bdb('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x587e=['exports','TEXT','STRING','sequelize'];(function(_0x3ecac8,_0x3261e0){var _0x4f82e0=function(_0x172851){while(--_0x172851){_0x3ecac8['push'](_0x3ecac8['shift']());}};_0x4f82e0(++_0x3261e0);}(_0x587e,0x8b));var _0xe587=function(_0x43fb30,_0x22985b){_0x43fb30=_0x43fb30-0x0;var _0x33eb19=_0x587e[_0x43fb30];return _0x33eb19;};'use strict';var Sequelize=require(_0xe587('0x0'));module[_0xe587('0x1')]={'license':{'type':Sequelize[_0xe587('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xe587('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 300e701..c051bb1 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 _0xc46b=['ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','name','send','../../config/license/util','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','options','catch','update','body','License','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x54987c,_0x118c39){var _0x1e4100=function(_0xe2569c){while(--_0xe2569c){_0x54987c['push'](_0x54987c['shift']());}};_0x1e4100(++_0x118c39);}(_0xc46b,0x1a1));var _0xbc46=function(_0x1866ec,_0x435d73){_0x1866ec=_0x1866ec-0x0;var _0xcf8f60=_0xc46b[_0x1866ec];return _0xcf8f60;};'use strict';var pdf=require(_0xbc46('0x0'));var emlformat=require(_0xbc46('0x1'));var rimraf=require(_0xbc46('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc46('0x3'));var rp=require(_0xbc46('0x4'));var moment=require(_0xbc46('0x5'));var BPromise=require(_0xbc46('0x6'));var Mustache=require(_0xbc46('0x7'));var util=require('util');var path=require(_0xbc46('0x8'));var sox=require(_0xbc46('0x9'));var csv=require('to-csv');var ejs=require(_0xbc46('0xa'));var fs=require('fs');var _=require(_0xbc46('0xb'));var squel=require('squel');var crypto=require(_0xbc46('0xc'));var jsforce=require(_0xbc46('0xd'));var deskjs=require(_0xbc46('0xe'));var toCsv=require(_0xbc46('0xf'));var querystring=require(_0xbc46('0x10'));var Papa=require(_0xbc46('0x11'));var Redis=require(_0xbc46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbc46('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc46('0x14'))(_0xbc46('0x15'));var utils=require(_0xbc46('0x16'));var config=require(_0xbc46('0x17'));var db=require(_0xbc46('0x18'))['db'];function respondWithStatusCode(_0x42fb19,_0x45ebef){_0x45ebef=_0x45ebef||0xcc;return function(_0x23a51b){if(_0x23a51b){return _0x42fb19['sendStatus'](_0x45ebef);}return _0x42fb19[_0xbc46('0x19')](_0x45ebef)[_0xbc46('0x1a')]();};}function respondWithResult(_0x2d7ddd,_0x9f11be){_0x9f11be=_0x9f11be||0xc8;return function(_0x141d74){if(_0x141d74){return _0x2d7ddd['status'](_0x9f11be)[_0xbc46('0x1b')](_0x141d74);}};}function respondWithFilteredResult(_0x1c2a27,_0x2ca009){return function(_0x430d36){if(_0x430d36){var _0xd8a2f4=_0x430d36[_0xbc46('0x1c')],_0x19344f=_0x2ca009[_0xbc46('0x1d')],_0x54700a=_0x2ca009[_0xbc46('0x1d')]+_0x2ca009[_0xbc46('0x1e')],_0x5b4e2b;if(_0x54700a>=_0xd8a2f4){_0x54700a=_0xd8a2f4;_0x5b4e2b=0xc8;}else{_0x5b4e2b=0xce;}_0x1c2a27['status'](_0x5b4e2b);return _0x1c2a27[_0xbc46('0x1f')](_0xbc46('0x20'),_0x19344f+'-'+_0x54700a+'/'+_0xd8a2f4)[_0xbc46('0x1b')](_0x430d36);}return null;};}function patchUpdates(_0x715dc2){return function(_0x32a259){try{jsonpatch[_0xbc46('0x21')](_0x32a259,_0x715dc2,!![]);}catch(_0x5bfd07){return BPromise[_0xbc46('0x22')](_0x5bfd07);}return _0x32a259[_0xbc46('0x23')]();};}function saveUpdates(_0x27ab8e,_0x49ddb0){return function(_0x1e997b){if(_0x1e997b){return _0x1e997b['update'](_0x27ab8e)[_0xbc46('0x24')](function(_0x331b74){return _0x331b74;});}return null;};}function removeEntity(_0x3b888f,_0x26b3ee){return function(_0x49dca3){if(_0x49dca3){return _0x49dca3['destroy']()[_0xbc46('0x24')](function(){_0x3b888f[_0xbc46('0x19')](0xcc)[_0xbc46('0x1a')]();});}};}function handleEntityNotFound(_0x2d7174,_0x18a06a){return function(_0x2bdba4){if(!_0x2bdba4){_0x2d7174['sendStatus'](0x194);}return _0x2bdba4;};}function handleError(_0x7cb554,_0x37e46c){_0x37e46c=_0x37e46c||0x1f4;return function(_0x36960e){logger[_0xbc46('0x25')](_0x36960e['stack']);if(_0x36960e[_0xbc46('0x26')]){delete _0x36960e['name'];}_0x7cb554[_0xbc46('0x19')](_0x37e46c)[_0xbc46('0x27')](_0x36960e);};}var utilLicense=require(_0xbc46('0x28'));exports[_0xbc46('0x29')]=function(_0x5286ea,_0x388fd4){var _0x47bdf0={'raw':!![],'where':{'id':0x1}},_0x494d26={};_0x494d26[_0xbc46('0x2a')]=_[_0xbc46('0x2b')](db['License'][_0xbc46('0x2c')]);_0x494d26[_0xbc46('0x2d')]=_['keys'](_0x5286ea[_0xbc46('0x2d')]);_0x494d26['filters']=_[_0xbc46('0x2e')](_0x494d26['model'],_0x494d26[_0xbc46('0x2d')]);_0x47bdf0[_0xbc46('0x2f')]=_[_0xbc46('0x2e')](_0x494d26[_0xbc46('0x2a')],qs[_0xbc46('0x30')](_0x5286ea['query'][_0xbc46('0x30')]));_0x47bdf0['attributes']=_0x47bdf0[_0xbc46('0x2f')]['length']?_0x47bdf0[_0xbc46('0x2f')]:_0x494d26[_0xbc46('0x2a')];_0x47bdf0=_[_0xbc46('0x31')]({},_0x47bdf0,_0x5286ea[_0xbc46('0x32')]);return utilLicense['getLicense'](_0x47bdf0)[_0xbc46('0x24')](respondWithResult(_0x388fd4,null))[_0xbc46('0x33')](handleError(_0x388fd4,null));};exports[_0xbc46('0x34')]=function(_0x3301b6,_0x5409c3){if(_0x3301b6[_0xbc46('0x35')]['id']){delete _0x3301b6['body']['id'];}return db[_0xbc46('0x36')][_0xbc46('0x37')]({'where':{'id':_0x3301b6[_0xbc46('0x38')]['id']}})[_0xbc46('0x24')](handleEntityNotFound(_0x5409c3,null))[_0xbc46('0x24')](function(_0x5f4529){var _0x5d0f73=_0x5f4529[_0xbc46('0x39')]({'plain':!![]});return utilLicense[_0xbc46('0x3a')](_0x5d0f73,_0x3301b6[_0xbc46('0x35')][_0xbc46('0x3b')]);})[_0xbc46('0x24')](function(_0x391754){if(!_0x391754[_0xbc46('0x3c')]){return saveUpdates(_0x3301b6['body'],null);}return _0x391754;})['then'](respondWithResult(_0x5409c3,null))['catch'](handleError(_0x5409c3,null));}; \ No newline at end of file +var _0xd4d8=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','../../config/license/util','model','keys','query','filters','intersection','fields','attributes','length','merge','getLicense','body','find','params','checkLicense','key','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x2c8878,_0x527f75){var _0x43b221=function(_0x7e658){while(--_0x7e658){_0x2c8878['push'](_0x2c8878['shift']());}};_0x43b221(++_0x527f75);}(_0xd4d8,0x17a));var _0x8d4d=function(_0x21c23e,_0x1d33e3){_0x21c23e=_0x21c23e-0x0;var _0xa7b7e2=_0xd4d8[_0x21c23e];return _0xa7b7e2;};'use strict';var pdf=require(_0x8d4d('0x0'));var emlformat=require(_0x8d4d('0x1'));var rimraf=require(_0x8d4d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d4d('0x3'));var rp=require(_0x8d4d('0x4'));var moment=require('moment');var BPromise=require(_0x8d4d('0x5'));var Mustache=require(_0x8d4d('0x6'));var util=require('util');var path=require(_0x8d4d('0x7'));var sox=require(_0x8d4d('0x8'));var csv=require(_0x8d4d('0x9'));var ejs=require(_0x8d4d('0xa'));var fs=require('fs');var _=require(_0x8d4d('0xb'));var squel=require(_0x8d4d('0xc'));var crypto=require(_0x8d4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8d4d('0xe'));var toCsv=require(_0x8d4d('0x9'));var querystring=require(_0x8d4d('0xf'));var Papa=require(_0x8d4d('0x10'));var Redis=require(_0x8d4d('0x11'));var authService=require(_0x8d4d('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8d4d('0x13'));var logger=require('../../config/logger')(_0x8d4d('0x14'));var utils=require('../../config/utils');var config=require(_0x8d4d('0x15'));var db=require(_0x8d4d('0x16'))['db'];function respondWithStatusCode(_0x3e4a45,_0x120d71){_0x120d71=_0x120d71||0xcc;return function(_0x526ec9){if(_0x526ec9){return _0x3e4a45['sendStatus'](_0x120d71);}return _0x3e4a45[_0x8d4d('0x17')](_0x120d71)[_0x8d4d('0x18')]();};}function respondWithResult(_0x38f849,_0x3a26dd){_0x3a26dd=_0x3a26dd||0xc8;return function(_0x1e88d8){if(_0x1e88d8){return _0x38f849[_0x8d4d('0x17')](_0x3a26dd)['json'](_0x1e88d8);}};}function respondWithFilteredResult(_0x4549ef,_0x48d4ad){return function(_0x5ea5e1){if(_0x5ea5e1){var _0x54a901=_0x5ea5e1[_0x8d4d('0x19')],_0x443606=_0x48d4ad[_0x8d4d('0x1a')],_0x241c98=_0x48d4ad[_0x8d4d('0x1a')]+_0x48d4ad['limit'],_0x177485;if(_0x241c98>=_0x54a901){_0x241c98=_0x54a901;_0x177485=0xc8;}else{_0x177485=0xce;}_0x4549ef[_0x8d4d('0x17')](_0x177485);return _0x4549ef[_0x8d4d('0x1b')]('Content-Range',_0x443606+'-'+_0x241c98+'/'+_0x54a901)['json'](_0x5ea5e1);}return null;};}function patchUpdates(_0x2504db){return function(_0x4075d9){try{jsonpatch['apply'](_0x4075d9,_0x2504db,!![]);}catch(_0x2604a1){return BPromise[_0x8d4d('0x1c')](_0x2604a1);}return _0x4075d9[_0x8d4d('0x1d')]();};}function saveUpdates(_0x4de3b9,_0x1de464){return function(_0x4af558){if(_0x4af558){return _0x4af558[_0x8d4d('0x1e')](_0x4de3b9)[_0x8d4d('0x1f')](function(_0x465d61){return _0x465d61;});}return null;};}function removeEntity(_0x2cc4f7,_0x116fa0){return function(_0x538d20){if(_0x538d20){return _0x538d20[_0x8d4d('0x20')]()['then'](function(){_0x2cc4f7[_0x8d4d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b2e8,_0x403b83){return function(_0x232708){if(!_0x232708){_0x17b2e8[_0x8d4d('0x21')](0x194);}return _0x232708;};}function handleError(_0x3c1158,_0x4a3388){_0x4a3388=_0x4a3388||0x1f4;return function(_0x2eca08){logger[_0x8d4d('0x22')](_0x2eca08[_0x8d4d('0x23')]);if(_0x2eca08[_0x8d4d('0x24')]){delete _0x2eca08[_0x8d4d('0x24')];}_0x3c1158[_0x8d4d('0x17')](_0x4a3388)[_0x8d4d('0x25')](_0x2eca08);};}var utilLicense=require(_0x8d4d('0x26'));exports['index']=function(_0x1f1c77,_0x2fd073){var _0x341bb7={'raw':!![],'where':{'id':0x1}},_0x445ac4={};_0x445ac4[_0x8d4d('0x27')]=_[_0x8d4d('0x28')](db['License']['rawAttributes']);_0x445ac4['query']=_[_0x8d4d('0x28')](_0x1f1c77[_0x8d4d('0x29')]);_0x445ac4[_0x8d4d('0x2a')]=_[_0x8d4d('0x2b')](_0x445ac4[_0x8d4d('0x27')],_0x445ac4[_0x8d4d('0x29')]);_0x341bb7['attributes']=_[_0x8d4d('0x2b')](_0x445ac4['model'],qs['fields'](_0x1f1c77[_0x8d4d('0x29')][_0x8d4d('0x2c')]));_0x341bb7[_0x8d4d('0x2d')]=_0x341bb7[_0x8d4d('0x2d')][_0x8d4d('0x2e')]?_0x341bb7['attributes']:_0x445ac4[_0x8d4d('0x27')];_0x341bb7=_[_0x8d4d('0x2f')]({},_0x341bb7,_0x1f1c77['options']);return utilLicense[_0x8d4d('0x30')](_0x341bb7)[_0x8d4d('0x1f')](respondWithResult(_0x2fd073,null))['catch'](handleError(_0x2fd073,null));};exports[_0x8d4d('0x1e')]=function(_0x17713d,_0x50a1e9){if(_0x17713d[_0x8d4d('0x31')]['id']){delete _0x17713d[_0x8d4d('0x31')]['id'];}return db['License'][_0x8d4d('0x32')]({'where':{'id':_0x17713d[_0x8d4d('0x33')]['id']}})[_0x8d4d('0x1f')](handleEntityNotFound(_0x50a1e9,null))[_0x8d4d('0x1f')](function(_0x5f27e6){var _0x32c9f1=_0x5f27e6['get']({'plain':!![]});return utilLicense[_0x8d4d('0x34')](_0x32c9f1,_0x17713d['body'][_0x8d4d('0x35')]);})[_0x8d4d('0x1f')](function(_0x5e195b){if(!_0x5e195b['demo']){return saveUpdates(_0x17713d[_0x8d4d('0x31')],null);}return _0x5e195b;})['then'](respondWithResult(_0x50a1e9,null))[_0x8d4d('0x36')](handleError(_0x50a1e9,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0a9be01..2519f16 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 _0xa0bc=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','moment','bluebird'];(function(_0x16eff3,_0x2f5a22){var _0x35904e=function(_0x5bbd21){while(--_0x5bbd21){_0x16eff3['push'](_0x16eff3['shift']());}};_0x35904e(++_0x2f5a22);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7633=['moment','request-promise','path','../../config/environment','./license.attributes','define','License','license','lodash','util','../../config/logger','api'];(function(_0x55cb15,_0x38fc83){var _0x17642c=function(_0x49d240){while(--_0x49d240){_0x55cb15['push'](_0x55cb15['shift']());}};_0x17642c(++_0x38fc83);}(_0x7633,0x1c4));var _0x3763=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7633[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var logger=require(_0x3763('0x2'))(_0x3763('0x3'));var moment=require(_0x3763('0x4'));var BPromise=require('bluebird');var rp=require(_0x3763('0x5'));var fs=require('fs');var path=require(_0x3763('0x6'));var rimraf=require('rimraf');var config=require(_0x3763('0x7'));var attributes=require(_0x3763('0x8'));module['exports']=function(_0x50585d,_0x396634){return _0x50585d[_0x3763('0x9')](_0x3763('0xa'),attributes,{'tableName':_0x3763('0xb'),'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 59d3e43..e28aae5 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 _0x189a=['message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0x189a,0x106));var _0xa189=function(_0x25b8b9,_0x3618dc){_0x25b8b9=_0x25b8b9-0x0;var _0x244385=_0x189a[_0x25b8b9];return _0x244385;};'use strict';var _=require(_0xa189('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa189('0x1'));var rs=require(_0xa189('0x2'));var fs=require('fs');var Redis=require(_0xa189('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa189('0x4'));var logger=require(_0xa189('0x5'))(_0xa189('0x6'));var config=require(_0xa189('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa189('0x8')][_0xa189('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58a404,_0x277268,_0x39f59a){return new BPromise(function(_0x558ba0,_0x3f0b0f){return client[_0xa189('0xa')](_0x58a404,_0x39f59a)[_0xa189('0xb')](function(_0x33a83a){logger['info'](_0xa189('0xc'),_0x277268,'request\x20sent');logger[_0xa189('0xd')](_0xa189('0xe'),_0x277268,_0xa189('0xf'),JSON[_0xa189('0x10')](_0x33a83a));if(_0x33a83a[_0xa189('0x11')]){if(_0x33a83a[_0xa189('0x11')]['code']===0x1f4){logger[_0xa189('0x11')](_0xa189('0xc'),_0x277268,_0x33a83a[_0xa189('0x11')][_0xa189('0x12')]);return _0x3f0b0f(_0x33a83a[_0xa189('0x11')][_0xa189('0x12')]);}logger[_0xa189('0x11')]('License,\x20%s,\x20%s',_0x277268,_0x33a83a[_0xa189('0x11')][_0xa189('0x12')]);return _0x558ba0(_0x33a83a[_0xa189('0x11')][_0xa189('0x12')]);}else{logger['info'](_0xa189('0xc'),_0x277268,_0xa189('0xf'));_0x558ba0(_0x33a83a[_0xa189('0x13')]['message']);}})['catch'](function(_0x5f36c8){logger[_0xa189('0x11')]('License,\x20%s,\x20%s',_0x277268,_0x5f36c8);_0x3f0b0f(_0x5f36c8);});});} \ No newline at end of file +var _0x3605=['request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x3605,0xad));var _0x5360=function(_0x520acc,_0x10f5db){_0x520acc=_0x520acc-0x0;var _0x4bd0c7=_0x3605[_0x520acc];return _0x4bd0c7;};'use strict';var _=require(_0x5360('0x0'));var util=require(_0x5360('0x1'));var moment=require(_0x5360('0x2'));var BPromise=require(_0x5360('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5360('0x4'));var db=require(_0x5360('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5360('0x6'))(_0x5360('0x7'));var config=require(_0x5360('0x8'));var jayson=require(_0x5360('0x9'));var client=jayson['client'][_0x5360('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30a08,_0x522cd7,_0x308106){return new BPromise(function(_0x354e4c,_0x45a809){return client[_0x5360('0xb')](_0x30a08,_0x308106)[_0x5360('0xc')](function(_0x260bcc){logger[_0x5360('0xd')](_0x5360('0xe'),_0x522cd7,_0x5360('0xf'));logger['debug'](_0x5360('0x10'),_0x522cd7,_0x5360('0xf'),JSON[_0x5360('0x11')](_0x260bcc));if(_0x260bcc[_0x5360('0x12')]){if(_0x260bcc[_0x5360('0x12')][_0x5360('0x13')]===0x1f4){logger[_0x5360('0x12')](_0x5360('0xe'),_0x522cd7,_0x260bcc[_0x5360('0x12')][_0x5360('0x14')]);return _0x45a809(_0x260bcc[_0x5360('0x12')]['message']);}logger[_0x5360('0x12')](_0x5360('0xe'),_0x522cd7,_0x260bcc['error'][_0x5360('0x14')]);return _0x354e4c(_0x260bcc['error'][_0x5360('0x14')]);}else{logger[_0x5360('0xd')](_0x5360('0xe'),_0x522cd7,_0x5360('0xf'));_0x354e4c(_0x260bcc[_0x5360('0x15')][_0x5360('0x14')]);}})[_0x5360('0x16')](function(_0x1a1cdb){logger[_0x5360('0x12')](_0x5360('0xe'),_0x522cd7,_0x1a1cdb);_0x45a809(_0x1a1cdb);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6d79da7..89eac7e 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 _0x57f5=['/describe','describe','show','/:id/dispositions','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','getAgents','post','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','/:id/users','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id','destroy','removeAgents','path','connect-timeout','express','../../components/auth/service','./mailAccount.controller','isAuthenticated','index','get'];(function(_0x44d24b,_0x7ada71){var _0xf4d988=function(_0x420ee0){while(--_0x420ee0){_0x44d24b['push'](_0x44d24b['shift']());}};_0xf4d988(++_0x7ada71);}(_0x57f5,0xf4));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x557f('0x0'));var timeout=require(_0x557f('0x1'));var express=require(_0x557f('0x2'));var router=express['Router']();var auth=require(_0x557f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x557f('0x4'));router['get']('/',auth[_0x557f('0x5')](),controller[_0x557f('0x6')]);router[_0x557f('0x7')](_0x557f('0x8'),auth[_0x557f('0x5')](),controller[_0x557f('0x9')]);router[_0x557f('0x7')]('/:id',auth[_0x557f('0x5')](),controller[_0x557f('0xa')]);router[_0x557f('0x7')](_0x557f('0xb'),auth[_0x557f('0x5')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x557f('0x7')](_0x557f('0xc'),auth['isAuthenticated'](),controller['getImap']);router[_0x557f('0x7')](_0x557f('0xd'),auth[_0x557f('0x5')](),controller[_0x557f('0xe')]);router['get'](_0x557f('0xf'),auth[_0x557f('0x5')](),controller[_0x557f('0x10')]);router['get'](_0x557f('0x11'),auth[_0x557f('0x5')](),controller[_0x557f('0x12')]);router[_0x557f('0x7')](_0x557f('0x13'),auth[_0x557f('0x5')](),controller[_0x557f('0x14')]);router['get']('/:id/verify',auth[_0x557f('0x5')](),controller[_0x557f('0x15')]);router[_0x557f('0x7')]('/:id/users',auth[_0x557f('0x5')](),controller[_0x557f('0x16')]);router[_0x557f('0x17')]('/:id/dispositions',auth[_0x557f('0x5')](),controller['addDisposition']);router[_0x557f('0x17')](_0x557f('0x18'),auth[_0x557f('0x5')](),controller[_0x557f('0x19')]);router['post']('/',auth[_0x557f('0x5')](),controller[_0x557f('0x1a')]);router[_0x557f('0x17')](_0x557f('0xc'),auth['isAuthenticated'](),controller[_0x557f('0x1b')]);router[_0x557f('0x17')]('/:id/out_servers',auth[_0x557f('0x5')](),controller[_0x557f('0x1c')]);router['post'](_0x557f('0xf'),auth[_0x557f('0x5')](),controller[_0x557f('0x1d')]);router[_0x557f('0x17')](_0x557f('0x11'),auth[_0x557f('0x5')](),controller[_0x557f('0x1e')]);router[_0x557f('0x17')]('/:id/send',auth[_0x557f('0x5')](),controller[_0x557f('0x1f')]);router[_0x557f('0x17')](_0x557f('0x20'),auth[_0x557f('0x5')](),controller['addAgents']);router[_0x557f('0x21')]('/:id',auth[_0x557f('0x5')](),controller['update']);router[_0x557f('0x22')](_0x557f('0xb'),auth[_0x557f('0x5')](),controller[_0x557f('0x23')]);router[_0x557f('0x22')](_0x557f('0x18'),auth[_0x557f('0x5')](),controller[_0x557f('0x24')]);router['delete'](_0x557f('0xc'),auth[_0x557f('0x5')](),controller[_0x557f('0x25')]);router[_0x557f('0x22')](_0x557f('0xd'),auth[_0x557f('0x5')](),controller[_0x557f('0x26')]);router[_0x557f('0x22')](_0x557f('0x27'),auth[_0x557f('0x5')](),controller[_0x557f('0x28')]);router[_0x557f('0x22')](_0x557f('0x20'),auth[_0x557f('0x5')](),controller[_0x557f('0x29')]);module['exports']=router; \ No newline at end of file +var _0xd35d=['/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xd35d,0x105));var _0xdd35=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xd35d[_0x25d386];return _0x857f4a;};'use strict';var multer=require(_0xdd35('0x0'));var util=require(_0xdd35('0x1'));var path=require(_0xdd35('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd35('0x3'));var router=express['Router']();var auth=require(_0xdd35('0x4'));var interaction=require(_0xdd35('0x5'));var config=require(_0xdd35('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xdd35('0x7')](),controller['index']);router[_0xdd35('0x8')]('/describe',auth[_0xdd35('0x7')](),controller['describe']);router[_0xdd35('0x8')](_0xdd35('0x9'),auth[_0xdd35('0x7')](),controller[_0xdd35('0xa')]);router[_0xdd35('0x8')](_0xdd35('0xb'),auth[_0xdd35('0x7')](),controller['getDispositions']);router[_0xdd35('0x8')](_0xdd35('0xc'),auth[_0xdd35('0x7')](),controller[_0xdd35('0xd')]);router[_0xdd35('0x8')]('/:id/in_servers',auth[_0xdd35('0x7')](),controller[_0xdd35('0xe')]);router['get'](_0xdd35('0xf'),auth[_0xdd35('0x7')](),controller['getSmtp']);router[_0xdd35('0x8')](_0xdd35('0x10'),auth['isAuthenticated'](),controller[_0xdd35('0x11')]);router['get'](_0xdd35('0x12'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x13')]);router[_0xdd35('0x8')](_0xdd35('0x14'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x15')]);router[_0xdd35('0x8')](_0xdd35('0x16'),auth[_0xdd35('0x7')](),controller['verifySmtp']);router[_0xdd35('0x8')](_0xdd35('0x17'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x18')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdd35('0x19')]);router[_0xdd35('0x1a')](_0xdd35('0xc'),auth[_0xdd35('0x7')](),controller['addAnswer']);router[_0xdd35('0x1a')]('/',auth[_0xdd35('0x7')](),controller[_0xdd35('0x1b')]);router[_0xdd35('0x1a')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xdd35('0x1c')]);router[_0xdd35('0x1a')](_0xdd35('0xf'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x1d')]);router[_0xdd35('0x1a')]('/:id/interactions',auth[_0xdd35('0x7')](),controller[_0xdd35('0x1e')]);router[_0xdd35('0x1a')](_0xdd35('0x12'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x1f')]);router['post'](_0xdd35('0x20'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x21')]);router[_0xdd35('0x1a')](_0xdd35('0x17'),auth['isAuthenticated'](),controller[_0xdd35('0x22')]);router['put']('/:id',auth[_0xdd35('0x7')](),controller[_0xdd35('0x23')]);router[_0xdd35('0x24')](_0xdd35('0xb'),auth['isAuthenticated'](),controller[_0xdd35('0x25')]);router[_0xdd35('0x24')](_0xdd35('0xc'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x26')]);router[_0xdd35('0x24')](_0xdd35('0x27'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x28')]);router[_0xdd35('0x24')](_0xdd35('0xf'),auth[_0xdd35('0x7')](),controller[_0xdd35('0x29')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdd35('0x2a')]);router['delete']('/:id/users',auth[_0xdd35('0x7')](),controller[_0xdd35('0x2b')]);module[_0xdd35('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 0e407eb..2bac3f0 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 _0x1b81=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2a92fc,_0x317d97){var _0x3511e6=function(_0x490d0d){while(--_0x490d0d){_0x2a92fc['push'](_0x2a92fc['shift']());}};_0x3511e6(++_0x317d97);}(_0x1b81,0xd5));var _0x11b8=function(_0x141ba1,_0x5112be){_0x141ba1=_0x141ba1-0x0;var _0x246c36=_0x1b81[_0x141ba1];return _0x246c36;};'use strict';var Sequelize=require('sequelize');module[_0x11b8('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x11b8('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x11b8('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x11b8('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x11b8('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x11b8('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x11b8('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x11b8('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x11b8('0x3')],'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[_0x11b8('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x11b8('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x11b8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x11b8('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11b8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11b8('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x11b8('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x11b8('0x2')],'defaultValue':![],'comment':_0x11b8('0x7'),'set':function(_0x14edb0){if(!_0x14edb0)this[_0x11b8('0x8')]('mandatoryDispositionPauseId',null);this[_0x11b8('0x8')](_0x11b8('0x9'),_0x14edb0);}}}; \ No newline at end of file +var _0xd546=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','TEXT','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd546,0x17e));var _0x6d54=function(_0x2372d9,_0x3d7a3f){_0x2372d9=_0x2372d9-0x0;var _0x283a86=_0xd546[_0x2372d9];return _0x283a86;};'use strict';var Sequelize=require(_0x6d54('0x0'));module[_0x6d54('0x1')]={'description':{'type':Sequelize[_0x6d54('0x2')]},'name':{'type':Sequelize[_0x6d54('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x6d54('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x6d54('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x6d54('0x3')]},'markAsUnread':{'type':Sequelize[_0x6d54('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d54('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x6d54('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6d54('0x3')],'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[_0x6d54('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6d54('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6d54('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6d54('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6d54('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6d54('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6d54('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6d54('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6d54('0x4')],'defaultValue':![],'comment':_0x6d54('0x9'),'set':function(_0x4ffc7a){if(!_0x4ffc7a)this[_0x6d54('0xa')](_0x6d54('0xb'),null);this[_0x6d54('0xa')](_0x6d54('0xc'),_0x4ffc7a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9b99805..152057e 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 _0xbd9e=['isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','Contacts','updatedAt','DESC','from','format','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','attach','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','end','status','count','offset','limit','set','Content-Range','apply','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','options','includeAll','include','findAll','rows','catch','show','Smtp','find','body','params','Imap','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId'];(function(_0x4d272d,_0x554110){var _0x877a93=function(_0x17d35c){while(--_0x17d35c){_0x4d272d['push'](_0x4d272d['shift']());}};_0x877a93(++_0x554110);}(_0xbd9e,0x108));var _0xebd9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xbd9e[_0x5f1391];return _0x50ebe3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xebd9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd9('0x1'));var rp=require(_0xebd9('0x2'));var moment=require(_0xebd9('0x3'));var BPromise=require(_0xebd9('0x4'));var Mustache=require(_0xebd9('0x5'));var util=require('util');var path=require(_0xebd9('0x6'));var sox=require('sox');var csv=require(_0xebd9('0x7'));var ejs=require(_0xebd9('0x8'));var fs=require('fs');var _=require(_0xebd9('0x9'));var squel=require(_0xebd9('0xa'));var crypto=require(_0xebd9('0xb'));var jsforce=require(_0xebd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xebd9('0x7'));var querystring=require(_0xebd9('0xd'));var Papa=require(_0xebd9('0xe'));var Redis=require(_0xebd9('0xf'));var authService=require(_0xebd9('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebd9('0x11'));var logger=require('../../config/logger')(_0xebd9('0x12'));var utils=require('../../config/utils');var config=require(_0xebd9('0x13'));var db=require(_0xebd9('0x14'))['db'];config['redis']=_[_0xebd9('0x15')](config[_0xebd9('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xebd9('0x17'))(new Redis(config[_0xebd9('0x16')]));require(_0xebd9('0x18'))[_0xebd9('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x1a')][_0xebd9('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x2133f8,_0x1b57e3,_0x1f5dd1){if(_0x1f5dd1){var _0x237d00=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x237d00[_0xebd9('0x1c')](_0x1b57e3)){return _0x2133f8;}else{throw new Error(_0xebd9('0x1d'));}}else{return _0x2133f8;}}function respondWithRpcPromise(_0x1ecb8f,_0x2767fb,_0x37cdf3,_0x2e9284){return new BPromise(function(_0x296341,_0x296ff1){var _0x4d04cb=_0x2e9284||client;return _0x4d04cb[_0xebd9('0x1e')](_0x1ecb8f,_0x37cdf3)[_0xebd9('0x1f')](function(_0x32dec8){logger['info'](_0xebd9('0x20'),_0x2767fb,'request\x20sent');logger[_0xebd9('0x21')](_0xebd9('0x22'),_0x2767fb,'request\x20sent',JSON['stringify'](_0x32dec8));if(_0x32dec8['error']){if(_0x32dec8[_0xebd9('0x23')][_0xebd9('0x24')]===0x1f4){logger[_0xebd9('0x23')]('MailAccount,\x20%s,\x20%s',_0x2767fb,_0x32dec8[_0xebd9('0x23')][_0xebd9('0x25')]);return _0x296ff1(_0x32dec8[_0xebd9('0x23')][_0xebd9('0x25')]);}logger[_0xebd9('0x23')](_0xebd9('0x20'),_0x2767fb,_0x32dec8['error'][_0xebd9('0x25')]);return _0x296341(_0x32dec8[_0xebd9('0x23')]['message']);}else{logger['info'](_0xebd9('0x20'),_0x2767fb,_0xebd9('0x26'));_0x296341(_0x32dec8[_0xebd9('0x27')][_0xebd9('0x25')]);}})['catch'](function(_0x1ac789){logger[_0xebd9('0x23')](_0xebd9('0x20'),_0x2767fb,_0x1ac789);_0x296ff1(_0x1ac789);});});}function respondWithStatusCode(_0x1d2330,_0x5548ae){_0x5548ae=_0x5548ae||0xcc;return function(_0x32dec5){if(_0x32dec5){return _0x1d2330['sendStatus'](_0x5548ae);}return _0x1d2330['status'](_0x5548ae)[_0xebd9('0x28')]();};}function respondWithResult(_0x3c6764,_0x4349bc){_0x4349bc=_0x4349bc||0xc8;return function(_0x439d53){if(_0x439d53){return _0x3c6764[_0xebd9('0x29')](_0x4349bc)['json'](_0x439d53);}};}function respondWithFilteredResult(_0x5310a8,_0x4e12bf){return function(_0x222d94){if(_0x222d94){var _0x278edb=_0x222d94[_0xebd9('0x2a')],_0x3f22de=_0x4e12bf[_0xebd9('0x2b')],_0x3ee0fd=_0x4e12bf[_0xebd9('0x2b')]+_0x4e12bf[_0xebd9('0x2c')],_0x19ea23;if(_0x3ee0fd>=_0x278edb){_0x3ee0fd=_0x278edb;_0x19ea23=0xc8;}else{_0x19ea23=0xce;}_0x5310a8[_0xebd9('0x29')](_0x19ea23);return _0x5310a8[_0xebd9('0x2d')](_0xebd9('0x2e'),_0x3f22de+'-'+_0x3ee0fd+'/'+_0x278edb)['json'](_0x222d94);}return null;};}function patchUpdates(_0x125e3b){return function(_0x5e04a5){try{jsonpatch[_0xebd9('0x2f')](_0x5e04a5,_0x125e3b,!![]);}catch(_0x3d3451){return BPromise['reject'](_0x3d3451);}return _0x5e04a5['save']();};}function saveUpdates(_0x234928,_0x1d90bb){return function(_0x3e0aac){if(_0x3e0aac){return _0x3e0aac[_0xebd9('0x30')](_0x234928)[_0xebd9('0x1f')](function(_0x9b4b5a){return _0x9b4b5a;});}return null;};}function removeEntity(_0x4c4dda,_0x2d7db8){return function(_0x4d21b3){if(_0x4d21b3){return _0x4d21b3[_0xebd9('0x31')]()[_0xebd9('0x1f')](function(){var _0x2dec09=_0x4d21b3[_0xebd9('0x32')]({'plain':!![]});var _0xa016c4=_0xebd9('0x33');return db[_0xebd9('0x34')][_0xebd9('0x31')]({'where':{'type':_0xa016c4,'resourceId':_0x2dec09['id']}})[_0xebd9('0x1f')](function(){return _0x4d21b3;});})['then'](function(){_0x4c4dda[_0xebd9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43266c,_0x50e214){return function(_0x3e0f54){if(!_0x3e0f54){_0x43266c[_0xebd9('0x35')](0x194);}return _0x3e0f54;};}function handleError(_0x581634,_0x1abe62){_0x1abe62=_0x1abe62||0x1f4;return function(_0x42eab1){logger['error'](_0x42eab1[_0xebd9('0x36')]);if(_0x42eab1[_0xebd9('0x37')]){delete _0x42eab1[_0xebd9('0x37')];}_0x581634['status'](_0x1abe62)[_0xebd9('0x38')](_0x42eab1);};}exports['index']=function(_0x391b3c,_0x281077){var _0x4f0eb0={'include':[{'model':db[_0xebd9('0x39')],'as':'Imap'},{'model':db[_0xebd9('0x3a')],'as':'Smtp'},{'model':db[_0xebd9('0x3b')],'as':_0xebd9('0x3c')}]},_0x3a7078={},_0x280976={'count':0x0,'rows':[]};var _0x2c4f60=db[_0xebd9('0x3d')][_0xebd9('0x3e')];_0x3a7078[_0xebd9('0x3f')]=_[_0xebd9('0x40')](_0x2c4f60);_0x3a7078['query']=_[_0xebd9('0x40')](_0x391b3c[_0xebd9('0x41')]);_0x3a7078['filters']=_['intersection'](_0x3a7078['model'],_0x3a7078[_0xebd9('0x41')]);_0x4f0eb0[_0xebd9('0x42')]=_[_0xebd9('0x43')](_0x3a7078[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0x391b3c[_0xebd9('0x41')]['fields']));_0x4f0eb0[_0xebd9('0x42')]=_0x4f0eb0['attributes'][_0xebd9('0x45')]?_0x4f0eb0[_0xebd9('0x42')]:_0x3a7078['model'];if(!_0x391b3c['query']['hasOwnProperty'](_0xebd9('0x46'))){_0x4f0eb0[_0xebd9('0x2c')]=qs[_0xebd9('0x2c')](_0x391b3c[_0xebd9('0x41')][_0xebd9('0x2c')]);_0x4f0eb0[_0xebd9('0x2b')]=qs[_0xebd9('0x2b')](_0x391b3c[_0xebd9('0x41')]['offset']);}_0x4f0eb0[_0xebd9('0x47')]=qs['sort'](_0x391b3c[_0xebd9('0x41')][_0xebd9('0x48')]);_0x4f0eb0[_0xebd9('0x49')]=qs['filters'](_[_0xebd9('0x4a')](_0x391b3c[_0xebd9('0x41')],_0x3a7078[_0xebd9('0x4b')]));if(_0x391b3c['query'][_0xebd9('0x4c')]){_0x4f0eb0[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x4f0eb0[_0xebd9('0x49')],{'$or':_[_0xebd9('0x4e')](_0x2c4f60,function(_0x43e491){if(_0x43e491[_0xebd9('0x4f')][_0xebd9('0x50')]!=='VIRTUAL'){var _0x3dad29={};_0x3dad29[_0x43e491['field']]={'$like':'%'+_0x391b3c[_0xebd9('0x41')]['filter']+'%'};return _0x3dad29;}})});}_0x4f0eb0=_[_0xebd9('0x4d')]({},_0x4f0eb0,_0x391b3c[_0xebd9('0x51')]);var _0x210a5e={'where':_0x4f0eb0[_0xebd9('0x49')]};return db[_0xebd9('0x3d')][_0xebd9('0x2a')](_0x210a5e)['then'](function(_0x1d2fed){_0x280976['count']=_0x1d2fed;if(_0x391b3c[_0xebd9('0x41')][_0xebd9('0x52')]){_0x4f0eb0[_0xebd9('0x53')]=[{'all':!![]}];}return db[_0xebd9('0x3d')][_0xebd9('0x54')](_0x4f0eb0);})[_0xebd9('0x1f')](function(_0x435d8d){_0x280976[_0xebd9('0x55')]=_0x435d8d;return _0x280976;})[_0xebd9('0x1f')](respondWithFilteredResult(_0x281077,_0x4f0eb0))[_0xebd9('0x56')](handleError(_0x281077,null));};exports[_0xebd9('0x57')]=function(_0x13ade2,_0xe6821f){var _0x273df3={'raw':![],'where':{'id':_0x13ade2['params']['id']},'include':[{'model':db[_0xebd9('0x39')],'as':'Imap'},{'model':db[_0xebd9('0x3a')],'as':_0xebd9('0x58')},{'model':db[_0xebd9('0x3b')],'as':_0xebd9('0x3c')}]},_0x4843df={};_0x4843df[_0xebd9('0x3f')]=_[_0xebd9('0x40')](db[_0xebd9('0x3d')]['rawAttributes']);_0x4843df[_0xebd9('0x41')]=_['keys'](_0x13ade2[_0xebd9('0x41')]);_0x4843df[_0xebd9('0x4b')]=_[_0xebd9('0x43')](_0x4843df['model'],_0x4843df[_0xebd9('0x41')]);_0x273df3[_0xebd9('0x42')]=_['intersection'](_0x4843df[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0x13ade2[_0xebd9('0x41')][_0xebd9('0x44')]));_0x273df3[_0xebd9('0x42')]=_0x273df3['attributes'][_0xebd9('0x45')]?_0x273df3['attributes']:_0x4843df[_0xebd9('0x3f')];if(_0x13ade2['query'][_0xebd9('0x52')]){_0x273df3[_0xebd9('0x53')]=[{'all':!![]}];}_0x273df3=_[_0xebd9('0x4d')]({},_0x273df3,_0x13ade2[_0xebd9('0x51')]);return db['MailAccount'][_0xebd9('0x59')](_0x273df3)[_0xebd9('0x1f')](handleEntityNotFound(_0xe6821f,null))['then'](respondWithResult(_0xe6821f,null))[_0xebd9('0x56')](handleError(_0xe6821f,null));};exports[_0xebd9('0x30')]=function(_0x13c057,_0x353e9f){if(_0x13c057['body']['id']){delete _0x13c057[_0xebd9('0x5a')]['id'];}return db[_0xebd9('0x3d')]['find']({'where':{'id':_0x13c057[_0xebd9('0x5b')]['id']},'include':[{'model':db[_0xebd9('0x39')],'as':_0xebd9('0x5c')},{'model':db[_0xebd9('0x3a')],'as':'Smtp'},{'model':db[_0xebd9('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xebd9('0x1f')](handleEntityNotFound(_0x353e9f,null))[_0xebd9('0x1f')](saveUpdates(_0x13c057[_0xebd9('0x5a')],null))[_0xebd9('0x1f')](function(_0x77120){if(_0x77120&&_0x13c057[_0xebd9('0x5a')]['Imap']){return db[_0xebd9('0x39')]['update'](_0x13c057['body'][_0xebd9('0x5c')],{'where':{'MailAccountId':_0x77120['id']}})['then'](function(){return _0x77120;});}return _0x77120;})[_0xebd9('0x1f')](function(_0x5676fa){if(_0x5676fa&&_0x13c057[_0xebd9('0x5a')][_0xebd9('0x58')]){return db[_0xebd9('0x3a')]['update'](_0x13c057[_0xebd9('0x5a')][_0xebd9('0x58')],{'where':{'MailAccountId':_0x5676fa['id']}})[_0xebd9('0x1f')](function(){return _0x5676fa;});}return _0x5676fa;})[_0xebd9('0x1f')](respondWithResult(_0x353e9f,null))[_0xebd9('0x56')](handleError(_0x353e9f,null));};exports[_0xebd9('0x5d')]=function(_0x307e35,_0x4b04b1){return db['MailAccount'][_0xebd9('0x5d')]()[_0xebd9('0x1f')](respondWithResult(_0x4b04b1,null))[_0xebd9('0x56')](handleError(_0x4b04b1,null));};exports[_0xebd9('0x5e')]=function(_0x4de277,_0x5db85d,_0x5cdfb0){if(_0x4de277[_0xebd9('0x5a')]['id']){delete _0x4de277[_0xebd9('0x5a')]['id'];}return db[_0xebd9('0x3d')][_0xebd9('0x59')]({'where':{'id':_0x4de277[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x5db85d,null))['then'](function(_0x5d69dc){if(_0x5d69dc){_0x4de277[_0xebd9('0x5a')][_0xebd9('0x5f')]=_0x5d69dc['id'];return db[_0xebd9('0x60')][_0xebd9('0x61')](_0x4de277[_0xebd9('0x5a')]);}})[_0xebd9('0x1f')](respondWithResult(_0x5db85d,null))[_0xebd9('0x56')](handleError(_0x5db85d,null));};exports[_0xebd9('0x62')]=function(_0x2e63ba,_0x305388,_0x1c8f1a){var _0x2aad0c={'raw':![],'where':{}};var _0x23f665={};var _0x1235c1={'count':0x0,'rows':[]};return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x2e63ba['params']['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x305388,null))[_0xebd9('0x1f')](function(_0x21b7d5){if(_0x21b7d5){_0x23f665[_0xebd9('0x3f')]=_[_0xebd9('0x40')](db[_0xebd9('0x60')]['rawAttributes']);_0x23f665[_0xebd9('0x41')]=_[_0xebd9('0x40')](_0x2e63ba[_0xebd9('0x41')]);_0x23f665['filters']=_['intersection'](_0x23f665[_0xebd9('0x3f')],_0x23f665['query']);_0x2aad0c[_0xebd9('0x42')]=_['intersection'](_0x23f665[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0x2e63ba[_0xebd9('0x41')]['fields']));_0x2aad0c[_0xebd9('0x42')]=_0x2aad0c[_0xebd9('0x42')][_0xebd9('0x45')]?_0x2aad0c[_0xebd9('0x42')]:_0x23f665[_0xebd9('0x3f')];if(!_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x64')]('nolimit')){_0x2aad0c[_0xebd9('0x2c')]=qs[_0xebd9('0x2c')](_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x2c')]);_0x2aad0c['offset']=qs['offset'](_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x2b')]);}_0x2aad0c[_0xebd9('0x47')]=qs[_0xebd9('0x48')](_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x48')]);_0x2aad0c[_0xebd9('0x49')]=qs['filters'](_[_0xebd9('0x4a')](_0x2e63ba[_0xebd9('0x41')],_0x23f665[_0xebd9('0x4b')]));_0x2aad0c[_0xebd9('0x49')][_0xebd9('0x5f')]=_0x21b7d5['id'];if(_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x4c')]){_0x2aad0c[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x2aad0c[_0xebd9('0x49')],{'$or':_['map'](_0x2aad0c[_0xebd9('0x42')],function(_0xe660a3){var _0x572469={};_0x572469[_0xe660a3]={'$like':'%'+_0x2e63ba[_0xebd9('0x41')]['filter']+'%'};return _0x572469;})});}_0x2aad0c=_[_0xebd9('0x4d')]({},_0x2aad0c,_0x2e63ba[_0xebd9('0x51')]);return db[_0xebd9('0x60')][_0xebd9('0x2a')]({'where':_0x2aad0c[_0xebd9('0x49')]})[_0xebd9('0x1f')](function(_0x32f7b6){_0x1235c1[_0xebd9('0x2a')]=_0x32f7b6;if(_0x2e63ba[_0xebd9('0x41')][_0xebd9('0x52')]){_0x2aad0c[_0xebd9('0x53')]=[{'all':!![]}];}return db[_0xebd9('0x60')]['findAll'](_0x2aad0c);})['then'](function(_0xdf08ae){_0x1235c1[_0xebd9('0x55')]=_0xdf08ae;return _0x1235c1;});}})[_0xebd9('0x1f')](respondWithFilteredResult(_0x305388,_0x2aad0c))[_0xebd9('0x56')](handleError(_0x305388,null));};exports[_0xebd9('0x65')]=function(_0x503e1c,_0x57284f,_0x4fd0ea){return db[_0xebd9('0x3d')][_0xebd9('0x59')]({'where':{'id':_0x503e1c['params']['id']}})['then'](handleEntityNotFound(_0x57284f,null))[_0xebd9('0x1f')](function(_0x3d9e3a){if(_0x3d9e3a){return _0x3d9e3a[_0xebd9('0x65')](_0x503e1c[_0xebd9('0x41')][_0xebd9('0x66')]);}})['then'](respondWithStatusCode(_0x57284f,null))[_0xebd9('0x56')](handleError(_0x57284f,null));};exports[_0xebd9('0x67')]=function(_0x2c4bc6,_0x2968d4,_0x389f71){if(_0x2c4bc6[_0xebd9('0x5a')]['id']){delete _0x2c4bc6[_0xebd9('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2c4bc6[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x2968d4,null))[_0xebd9('0x1f')](function(_0x4f0fdd){if(_0x4f0fdd){_0x2c4bc6[_0xebd9('0x5a')]['MailAccountId']=_0x4f0fdd['id'];return db[_0xebd9('0x68')]['create'](_0x2c4bc6[_0xebd9('0x5a')]);}})[_0xebd9('0x1f')](respondWithResult(_0x2968d4,null))[_0xebd9('0x56')](handleError(_0x2968d4,null));};exports['getAnswers']=function(_0x305c2e,_0x389037,_0xe54bc5){var _0x1936c8={'raw':![],'where':{}};var _0x486085={};var _0x3e9d7d={'count':0x0,'rows':[]};return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x305c2e[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x389037,null))[_0xebd9('0x1f')](function(_0x449858){if(_0x449858){_0x486085[_0xebd9('0x3f')]=_['keys'](db[_0xebd9('0x68')]['rawAttributes']);_0x486085[_0xebd9('0x41')]=_['keys'](_0x305c2e[_0xebd9('0x41')]);_0x486085[_0xebd9('0x4b')]=_[_0xebd9('0x43')](_0x486085[_0xebd9('0x3f')],_0x486085[_0xebd9('0x41')]);_0x1936c8[_0xebd9('0x42')]=_[_0xebd9('0x43')](_0x486085['model'],qs[_0xebd9('0x44')](_0x305c2e[_0xebd9('0x41')][_0xebd9('0x44')]));_0x1936c8[_0xebd9('0x42')]=_0x1936c8[_0xebd9('0x42')]['length']?_0x1936c8[_0xebd9('0x42')]:_0x486085[_0xebd9('0x3f')];if(!_0x305c2e[_0xebd9('0x41')][_0xebd9('0x64')]('nolimit')){_0x1936c8['limit']=qs[_0xebd9('0x2c')](_0x305c2e['query'][_0xebd9('0x2c')]);_0x1936c8['offset']=qs[_0xebd9('0x2b')](_0x305c2e[_0xebd9('0x41')]['offset']);}_0x1936c8[_0xebd9('0x47')]=qs[_0xebd9('0x48')](_0x305c2e[_0xebd9('0x41')][_0xebd9('0x48')]);_0x1936c8[_0xebd9('0x49')]=qs[_0xebd9('0x4b')](_[_0xebd9('0x4a')](_0x305c2e[_0xebd9('0x41')],_0x486085[_0xebd9('0x4b')]));_0x1936c8[_0xebd9('0x49')][_0xebd9('0x5f')]=_0x449858['id'];if(_0x305c2e[_0xebd9('0x41')]['filter']){_0x1936c8[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x1936c8[_0xebd9('0x49')],{'$or':_[_0xebd9('0x4e')](_0x1936c8[_0xebd9('0x42')],function(_0x50c573){var _0x2b1814={};_0x2b1814[_0x50c573]={'$like':'%'+_0x305c2e[_0xebd9('0x41')][_0xebd9('0x4c')]+'%'};return _0x2b1814;})});}_0x1936c8=_[_0xebd9('0x4d')]({},_0x1936c8,_0x305c2e[_0xebd9('0x51')]);return db['CannedAnswer']['count']({'where':_0x1936c8['where']})[_0xebd9('0x1f')](function(_0x4fb1e4){_0x3e9d7d[_0xebd9('0x2a')]=_0x4fb1e4;if(_0x305c2e['query'][_0xebd9('0x52')]){_0x1936c8[_0xebd9('0x53')]=[{'all':!![]}];}return db[_0xebd9('0x68')][_0xebd9('0x54')](_0x1936c8);})[_0xebd9('0x1f')](function(_0x31fcda){_0x3e9d7d[_0xebd9('0x55')]=_0x31fcda;return _0x3e9d7d;});}})['then'](respondWithFilteredResult(_0x389037,_0x1936c8))['catch'](handleError(_0x389037,null));};exports[_0xebd9('0x69')]=function(_0x951420,_0x1e091c,_0x2f9fe9){return db[_0xebd9('0x3d')][_0xebd9('0x59')]({'where':{'id':_0x951420['params']['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x1e091c,null))[_0xebd9('0x1f')](function(_0x2a419d){if(_0x2a419d){return _0x2a419d[_0xebd9('0x69')](_0x951420[_0xebd9('0x41')][_0xebd9('0x66')]);}})[_0xebd9('0x1f')](respondWithStatusCode(_0x1e091c,null))['catch'](handleError(_0x1e091c,null));};exports['create']=function(_0x204910,_0x3f8a87){var _0x197682={'name':_0x204910[_0xebd9('0x5a')][_0xebd9('0x37')],'key':_0x204910['body'][_0xebd9('0x50')],'email':_0x204910['body'][_0xebd9('0x6a')],'ListId':_0x204910[_0xebd9('0x5a')][_0xebd9('0x6b')],'active':!_[_0xebd9('0x6c')](_0x204910[_0xebd9('0x5a')][_0xebd9('0x6d')])?_0x204910[_0xebd9('0x5a')][_0xebd9('0x6d')]:!![],'description':_0x204910['body'][_0xebd9('0x6e')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x204910['body'][_0xebd9('0x6f')])){if(_0x204910[_0xebd9('0x5a')][_0xebd9('0x70')]){_0x197682[_0xebd9('0x5c')][_0xebd9('0x71')]=_0x197682[_0xebd9('0x58')][_0xebd9('0x71')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x72')];_0x197682['Imap'][_0xebd9('0x73')]=_0x197682[_0xebd9('0x58')][_0xebd9('0x74')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x75')];}else{_0x197682[_0xebd9('0x5c')][_0xebd9('0x76')]=_0x197682[_0xebd9('0x58')][_0xebd9('0x76')]=![];}_0x197682[_0xebd9('0x5c')][_0xebd9('0x77')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x5c')][_0xebd9('0x77')];_0x197682[_0xebd9('0x5c')][_0xebd9('0x78')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x5c')][_0xebd9('0x78')];_0x197682[_0xebd9('0x58')][_0xebd9('0x77')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x58')][_0xebd9('0x77')];_0x197682[_0xebd9('0x58')][_0xebd9('0x78')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x58')][_0xebd9('0x78')];}else{_0x197682[_0xebd9('0x5c')][_0xebd9('0x79')]=_0x197682[_0xebd9('0x58')][_0xebd9('0x79')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x6f')];_0x197682[_0xebd9('0x5c')]['user']=_0x197682[_0xebd9('0x58')][_0xebd9('0x71')]=_0x204910['body'][_0xebd9('0x72')];_0x197682[_0xebd9('0x5c')][_0xebd9('0x73')]=_0x197682['Smtp'][_0xebd9('0x74')]=_0x204910[_0xebd9('0x5a')][_0xebd9('0x75')];}return db['MailAccount'][_0xebd9('0x61')](_0x197682,{'include':[{'model':db[_0xebd9('0x3a')],'as':_0xebd9('0x58')},{'model':db[_0xebd9('0x39')],'as':_0xebd9('0x5c')}]})['then'](function(_0x465822){var _0x23c916=_0x204910[_0xebd9('0x71')][_0xebd9('0x32')]({'plain':!![]});if(!_0x23c916)throw new Error(_0xebd9('0x7a'));if(_0x23c916[_0xebd9('0x7b')]==='user'){var _0x155e34=_0x465822[_0xebd9('0x32')]({'plain':!![]});return db[_0xebd9('0x7c')]['find']({'where':{'name':_0xebd9('0x33'),'userProfileId':_0x23c916[_0xebd9('0x7d')]},'raw':!![]})[_0xebd9('0x1f')](function(_0x232681){if(_0x232681&&_0x232681[_0xebd9('0x7e')]===0x0){return db[_0xebd9('0x34')]['create']({'name':_0x155e34[_0xebd9('0x37')],'resourceId':_0x155e34['id'],'type':_0x232681[_0xebd9('0x37')],'sectionId':_0x232681['id']},{})[_0xebd9('0x1f')](function(){return _0x465822;});}else{return _0x465822;}})['catch'](function(_0x283459){logger[_0xebd9('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x283459);throw _0x283459;});}return _0x465822;})[_0xebd9('0x1f')](respondWithResult(_0x3f8a87,0xc9))[_0xebd9('0x56')](handleError(_0x3f8a87,null));};exports[_0xebd9('0x7f')]=function(_0x4b70e7,_0x295289,_0x28c960){return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x4b70e7[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x295289,null))[_0xebd9('0x1f')](function(_0x108aec){if(_0x108aec){return _0x108aec['getImap']();}return null;})[_0xebd9('0x1f')](respondWithResult(_0x295289,null))[_0xebd9('0x56')](handleError(_0x295289,null));};exports['addImap']=function(_0x283cac,_0x10b3ff,_0x390824){if(_0x283cac[_0xebd9('0x5a')]['id']){delete _0x283cac[_0xebd9('0x5a')]['id'];}return db[_0xebd9('0x3d')]['find']({'where':{'id':_0x283cac[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x10b3ff,null))[_0xebd9('0x1f')](function(_0x12dfb4){if(_0x12dfb4){_0x283cac[_0xebd9('0x5a')][_0xebd9('0x5f')]=_0x12dfb4['id'];return db['MailServerIn'][_0xebd9('0x61')](_0x283cac[_0xebd9('0x5a')]);}})[_0xebd9('0x1f')](respondWithResult(_0x10b3ff,null))[_0xebd9('0x56')](handleError(_0x10b3ff,null));};exports['removeImap']=function(_0x48dbe8,_0x4fa229,_0x75d77b){return db[_0xebd9('0x3d')]['findOne']({'where':{'id':_0x48dbe8[_0xebd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4fa229,null))['then'](function(_0xe292be){if(_0xe292be){return _0xe292be[_0xebd9('0x80')](null);}return null;})['then'](respondWithStatusCode(_0x4fa229,null))['catch'](handleError(_0x4fa229,null));};exports[_0xebd9('0x81')]=function(_0x2c413b,_0x51de5b,_0x3c2b54){return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x2c413b[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x51de5b,null))[_0xebd9('0x1f')](function(_0x234ccb){if(_0x234ccb){return _0x234ccb[_0xebd9('0x81')]();}return null;})[_0xebd9('0x1f')](respondWithResult(_0x51de5b,null))[_0xebd9('0x56')](handleError(_0x51de5b,null));};exports['addSmtp']=function(_0x5dcfbb,_0x4796a6,_0x220400){if(_0x5dcfbb[_0xebd9('0x5a')]['id']){delete _0x5dcfbb['body']['id'];}return db['MailAccount'][_0xebd9('0x59')]({'where':{'id':_0x5dcfbb[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x4796a6,null))[_0xebd9('0x1f')](function(_0x2b2b2f){if(_0x2b2b2f){_0x5dcfbb['body'][_0xebd9('0x5f')]=_0x2b2b2f['id'];return db[_0xebd9('0x3a')][_0xebd9('0x61')](_0x5dcfbb['body']);}})['then'](respondWithResult(_0x4796a6,null))[_0xebd9('0x56')](handleError(_0x4796a6,null));};exports[_0xebd9('0x82')]=function(_0x4a0208,_0x3efa58,_0x85cede){return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x4a0208[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x3efa58,null))[_0xebd9('0x1f')](function(_0x7a91cf){if(_0x7a91cf){return _0x7a91cf[_0xebd9('0x83')](null);}return null;})[_0xebd9('0x1f')](respondWithStatusCode(_0x3efa58,null))[_0xebd9('0x56')](handleError(_0x3efa58,null));};exports[_0xebd9('0x84')]=function(_0x4ce9ca,_0x53818d,_0x3e4b7c){return db['MailInteraction'][_0xebd9('0x59')]({'where':{'id':_0x4ce9ca[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x53818d,null))['then'](function(_0x245ddf){if(_0x245ddf){return _0x245ddf['addInteraction'](_0x4ce9ca[_0xebd9('0x5a')][_0xebd9('0x66')],_[_0xebd9('0x85')](_0x4ce9ca['body'],['ids','id'])||{});}})[_0xebd9('0x1f')](respondWithResult(_0x53818d,null))[_0xebd9('0x56')](handleError(_0x53818d,null));};exports[_0xebd9('0x86')]=function(_0xfdad13,_0x2a90dd,_0x5717f4){var _0x3b2f72={'raw':![],'where':{}};var _0x3e540b={};var _0x589e68={'count':0x0,'rows':[]};return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0xfdad13['params']['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x2a90dd,null))[_0xebd9('0x1f')](function(_0x1b412d){if(_0x1b412d){_0x3e540b[_0xebd9('0x3f')]=_[_0xebd9('0x40')](db[_0xebd9('0x87')][_0xebd9('0x3e')]);_0x3e540b[_0xebd9('0x41')]=_[_0xebd9('0x40')](_0xfdad13[_0xebd9('0x41')]);_0x3e540b[_0xebd9('0x4b')]=_[_0xebd9('0x43')](_0x3e540b['model'],_0x3e540b['query']);_0x3b2f72[_0xebd9('0x42')]=_[_0xebd9('0x43')](_0x3e540b[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0xfdad13['query']['fields']));_0x3b2f72['attributes']=_0x3b2f72[_0xebd9('0x42')][_0xebd9('0x45')]?_0x3b2f72[_0xebd9('0x42')]:_0x3e540b[_0xebd9('0x3f')];if(!_0xfdad13[_0xebd9('0x41')][_0xebd9('0x64')]('nolimit')){_0x3b2f72[_0xebd9('0x2c')]=qs[_0xebd9('0x2c')](_0xfdad13[_0xebd9('0x41')][_0xebd9('0x2c')]);_0x3b2f72['offset']=qs[_0xebd9('0x2b')](_0xfdad13[_0xebd9('0x41')]['offset']);}_0x3b2f72['order']=qs[_0xebd9('0x48')](_0xfdad13[_0xebd9('0x41')][_0xebd9('0x48')]);_0x3b2f72[_0xebd9('0x49')]=qs[_0xebd9('0x4b')](_[_0xebd9('0x4a')](_0xfdad13[_0xebd9('0x41')],_0x3e540b[_0xebd9('0x4b')]));_0x3b2f72[_0xebd9('0x49')][_0xebd9('0x5f')]=_0x1b412d['id'];if(_0xfdad13[_0xebd9('0x41')][_0xebd9('0x4c')]){_0x3b2f72[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x3b2f72[_0xebd9('0x49')],{'$or':_['map'](_0x3b2f72['attributes'],function(_0x238507){var _0x1710cb={};_0x1710cb[_0x238507]={'$like':'%'+_0xfdad13['query'][_0xebd9('0x4c')]+'%'};return _0x1710cb;})});}_0x3b2f72=_[_0xebd9('0x4d')]({},_0x3b2f72,_0xfdad13[_0xebd9('0x51')]);return db[_0xebd9('0x87')][_0xebd9('0x2a')]({'where':_0x3b2f72[_0xebd9('0x49')]})[_0xebd9('0x1f')](function(_0x87dae0){_0x589e68['count']=_0x87dae0;if(_0xfdad13[_0xebd9('0x41')][_0xebd9('0x52')]){_0x3b2f72[_0xebd9('0x53')]=[{'model':db[_0xebd9('0x88')],'as':'Contact','required':![]},{'model':db[_0xebd9('0x89')],'as':_0xebd9('0x8a'),'attributes':['name',_0xebd9('0x8b'),_0xebd9('0x8c')],'required':![]},{'model':db[_0xebd9('0x8d')],'as':'Tags','attributes':['id','name','color'],'where':_0xfdad13['query'][_0xebd9('0x8e')]?{'id':_0xfdad13[_0xebd9('0x41')][_0xebd9('0x8e')]}:undefined,'required':_0xfdad13[_0xebd9('0x41')][_0xebd9('0x8e')]?!![]:![]}];}return db[_0xebd9('0x87')][_0xebd9('0x54')](_0x3b2f72);})[_0xebd9('0x1f')](function(_0x63786a){_0x589e68[_0xebd9('0x55')]=_0x63786a;return _0x589e68;});}})[_0xebd9('0x1f')](respondWithFilteredResult(_0x2a90dd,_0x3b2f72))[_0xebd9('0x56')](handleError(_0x2a90dd,null));};exports[_0xebd9('0x8f')]=function(_0x116f27,_0x8ca9d4,_0x2aaf42){return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x116f27[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x8ca9d4,null))[_0xebd9('0x1f')](function(_0x29efa0){if(_0x29efa0){return db[_0xebd9('0x90')][_0xebd9('0x91')](function(_0x1b2f61){return db[_0xebd9('0x92')][_0xebd9('0x31')]({'where':{'MailAccountId':_0x116f27[_0xebd9('0x5b')]['id']},'transaction':_0x1b2f61})['then'](function(_0x26e894){var _0xbee295=_[_0xebd9('0x4e')](_0x116f27['body'],function(_0x16a6c9){_0x16a6c9[_0xebd9('0x5f')]=_0x116f27[_0xebd9('0x5b')]['id'];return _0x16a6c9;});return db['MailApplication']['bulkCreate'](_0xbee295,{'transaction':_0x1b2f61});});})[_0xebd9('0x1f')](function(){return db[_0xebd9('0x92')][_0xebd9('0x93')]({'where':{'MailAccountId':_0x116f27[_0xebd9('0x5b')]['id']},'order':_0xebd9('0x94')});});}})[_0xebd9('0x1f')](respondWithResult(_0x8ca9d4,null))[_0xebd9('0x56')](handleError(_0x8ca9d4,null));};exports[_0xebd9('0x95')]=function(_0x123d89,_0x2fb8c6,_0xc0e1f9){var _0x3e3270={};var _0x385c43={};var _0xad3220;var _0x15e515;return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x123d89['params']['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x2fb8c6,null))[_0xebd9('0x1f')](function(_0x42f8ba){if(_0x42f8ba){_0xad3220=_0x42f8ba;_0x385c43[_0xebd9('0x3f')]=_[_0xebd9('0x40')](db[_0xebd9('0x92')][_0xebd9('0x3e')]);_0x385c43[_0xebd9('0x41')]=_['keys'](_0x123d89[_0xebd9('0x41')]);_0x385c43['filters']=_[_0xebd9('0x43')](_0x385c43[_0xebd9('0x3f')],_0x385c43[_0xebd9('0x41')]);_0x3e3270[_0xebd9('0x42')]=_['intersection'](_0x385c43['model'],qs['fields'](_0x123d89[_0xebd9('0x41')]['fields']));_0x3e3270[_0xebd9('0x42')]=_0x3e3270['attributes'][_0xebd9('0x45')]?_0x3e3270[_0xebd9('0x42')]:_0x385c43[_0xebd9('0x3f')];_0x3e3270[_0xebd9('0x47')]=qs['sort'](_0x123d89[_0xebd9('0x41')][_0xebd9('0x48')]);_0x3e3270[_0xebd9('0x49')]=qs['filters'](_[_0xebd9('0x4a')](_0x123d89[_0xebd9('0x41')],_0x385c43[_0xebd9('0x4b')]));if(_0x123d89[_0xebd9('0x41')]['filter']){_0x3e3270[_0xebd9('0x49')]=_['merge'](_0x3e3270[_0xebd9('0x49')],{'$or':_[_0xebd9('0x4e')](_0x3e3270[_0xebd9('0x42')],function(_0x2e0c71){var _0x5de8a6={};_0x5de8a6[_0x2e0c71]={'$like':'%'+_0x123d89[_0xebd9('0x41')][_0xebd9('0x4c')]+'%'};return _0x5de8a6;})});}_0x3e3270=_[_0xebd9('0x4d')]({},_0x3e3270,_0x123d89[_0xebd9('0x51')]);return _0xad3220[_0xebd9('0x95')](_0x3e3270);}})[_0xebd9('0x1f')](function(_0x165e08){if(_0x165e08){_0x15e515=_0x165e08['length'];if(!_0x123d89[_0xebd9('0x41')]['hasOwnProperty'](_0xebd9('0x46'))){_0x3e3270[_0xebd9('0x2c')]=qs[_0xebd9('0x2c')](_0x123d89['query'][_0xebd9('0x2c')]);_0x3e3270[_0xebd9('0x2b')]=qs[_0xebd9('0x2b')](_0x123d89['query'][_0xebd9('0x2b')]);}return _0xad3220[_0xebd9('0x95')](_0x3e3270);}})[_0xebd9('0x1f')](function(_0x20ecfe){if(_0x20ecfe){return _0x20ecfe?{'count':_0x15e515,'rows':_0x20ecfe}:null;}})[_0xebd9('0x1f')](respondWithResult(_0x2fb8c6,null))[_0xebd9('0x56')](handleError(_0x2fb8c6,null));};exports[_0xebd9('0x96')]=function(_0x343c1f,_0x50310c,_0x555eca){var _0x14ec23={'raw':!![],'where':{}};var _0x46d4bb={};var _0x46a11d={'count':0x0,'rows':[]};return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x343c1f[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x50310c,null))[_0xebd9('0x1f')](function(_0x31e9ef){if(_0x31e9ef){_0x46d4bb['model']=_[_0xebd9('0x40')](db['MailMessage'][_0xebd9('0x3e')]);_0x46d4bb['query']=_['keys'](_0x343c1f['query']);_0x46d4bb[_0xebd9('0x4b')]=_['intersection'](_0x46d4bb[_0xebd9('0x3f')],_0x46d4bb[_0xebd9('0x41')]);_0x14ec23[_0xebd9('0x42')]=_[_0xebd9('0x43')](_0x46d4bb[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0x343c1f[_0xebd9('0x41')][_0xebd9('0x44')]));_0x14ec23['attributes']=_0x14ec23[_0xebd9('0x42')][_0xebd9('0x45')]?_0x14ec23[_0xebd9('0x42')]:_0x46d4bb[_0xebd9('0x3f')];if(!_0x343c1f[_0xebd9('0x41')][_0xebd9('0x64')]('nolimit')){_0x14ec23[_0xebd9('0x2c')]=qs['limit'](_0x343c1f['query'][_0xebd9('0x2c')]);_0x14ec23[_0xebd9('0x2b')]=qs['offset'](_0x343c1f[_0xebd9('0x41')][_0xebd9('0x2b')]);}_0x14ec23[_0xebd9('0x47')]=qs['sort'](_0x343c1f[_0xebd9('0x41')][_0xebd9('0x48')]);_0x14ec23[_0xebd9('0x49')]=qs[_0xebd9('0x4b')](_[_0xebd9('0x4a')](_0x343c1f[_0xebd9('0x41')],_0x46d4bb[_0xebd9('0x4b')]));_0x14ec23[_0xebd9('0x49')][_0xebd9('0x5f')]=_0x31e9ef['id'];if(_0x343c1f[_0xebd9('0x41')][_0xebd9('0x4c')]){_0x14ec23[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x14ec23['where'],{'$or':_[_0xebd9('0x4e')](_0x14ec23['attributes'],function(_0x16d38c){var _0x20489c={};_0x20489c[_0x16d38c]={'$like':'%'+_0x343c1f['query'][_0xebd9('0x4c')]+'%'};return _0x20489c;})});}if(_0x343c1f['query']['$gte']){var _0x2856bb=_0x343c1f[_0xebd9('0x41')][_0xebd9('0x97')][_0xebd9('0x98')](',');var _0x2b76ad={};_0x2b76ad[_0x2856bb[0x0]]={'$gte':moment(_0x2856bb[0x1])['format'](_0xebd9('0x99'))};_0x14ec23[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x14ec23[_0xebd9('0x49')],_0x2b76ad);}_0x14ec23=_[_0xebd9('0x4d')]({},_0x14ec23,_0x343c1f[_0xebd9('0x51')]);return db[_0xebd9('0x9a')]['count']({'where':_0x14ec23['where']})[_0xebd9('0x1f')](function(_0x2b5ae7){_0x46a11d[_0xebd9('0x2a')]=_0x2b5ae7;if(_0x343c1f[_0xebd9('0x41')]['includeAll']){_0x14ec23['include']=[{'all':!![]}];}return db[_0xebd9('0x9a')][_0xebd9('0x54')](_0x14ec23);})[_0xebd9('0x1f')](function(_0x164832){_0x46a11d[_0xebd9('0x55')]=_0x164832;return _0x46a11d;});}})[_0xebd9('0x1f')](respondWithFilteredResult(_0x50310c,_0x14ec23))[_0xebd9('0x56')](handleError(_0x50310c,null));};exports[_0xebd9('0x38')]=function(_0x16c76f,_0x53791b,_0x1d9446){var _0x5a83d9,_0x6981ce={},_0x5c8581;if(_0x16c76f[_0xebd9('0x5a')]['to']){_0x5c8581=_0x16c76f[_0xebd9('0x5a')]['to'][_0xebd9('0x98')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x16c76f['params']['id']},'include':[{'model':db[_0xebd9('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0xebd9('0x9c'),'where':{'email':_0x5c8581},'limit':0x1,'order':[[_0xebd9('0x9d'),_0xebd9('0x9e')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xebd9('0x1f')](handleEntityNotFound(_0x53791b,null))['then'](function(_0x29a276){if(_0x29a276){_0x5a83d9=_0x29a276;if(_0x29a276[_0xebd9('0x58')]){if(_[_0xebd9('0x6c')](_0x16c76f[_0xebd9('0x5a')]['from'])){_0x16c76f[_0xebd9('0x5a')][_0xebd9('0x9f')]=util[_0xebd9('0xa0')]('%s\x20<%s>',_0x29a276['name'],_0x29a276['email']||_0x29a276['Smtp']['user']);}if(_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xa1')]&&_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xa1')]['length']){for(var _0x22139d=0x0;_0x22139d<_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xa1')][_0xebd9('0x45')];_0x22139d+=0x1){_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xa1')][_0x22139d]={'filename':_0x16c76f['body'][_0xebd9('0xa1')][_0x22139d]['name'],'path':path['join'](config[_0xebd9('0xa2')],_0xebd9('0xa3'),_0x16c76f[_0xebd9('0x5a')]['attachments'][_0x22139d][_0xebd9('0xa4')])};}}var _0x5ee76e={'tls':{'rejectUnauthorized':![]}};if(_[_0xebd9('0x6c')](_0x29a276[_0xebd9('0x58')][_0xebd9('0x79')])){if(_0x29a276[_0xebd9('0x58')][_0xebd9('0x76')]){_0x5ee76e[_0xebd9('0xa5')]={'user':_0x29a276['Smtp'][_0xebd9('0x71')],'pass':_0x29a276[_0xebd9('0x58')][_0xebd9('0x74')]};}_0x5ee76e['host']=_0x29a276['Smtp'][_0xebd9('0x77')];_0x5ee76e[_0xebd9('0x78')]=_0x29a276[_0xebd9('0x58')][_0xebd9('0x78')];_0x5ee76e[_0xebd9('0xa6')]=_0x29a276[_0xebd9('0x58')]['secure'];}else{_0x5ee76e[_0xebd9('0x79')]=_0x29a276[_0xebd9('0x58')][_0xebd9('0x79')];_0x5ee76e[_0xebd9('0xa5')]={'user':_0x29a276[_0xebd9('0x58')][_0xebd9('0x71')],'pass':_0x29a276['Smtp'][_0xebd9('0x74')]};}return respondWithRpcPromise(_0xebd9('0xa7'),_0xebd9('0xa8'),{'account':_0x5ee76e,'message':_0x16c76f['body']});}else{throw new Error(_0xebd9('0xa9'));}}})['then'](function(_0x160cae){if(_0x160cae){_0x6981ce=_0x160cae;if(_0x5a83d9[_0xebd9('0xaa')]){if(_0x5a83d9['List'][_0xebd9('0x9c')][_0xebd9('0x45')]){return _0x5a83d9['List'][_0xebd9('0x9c')][0x0];}else{return db[_0xebd9('0x88')][_0xebd9('0x61')](_[_0xebd9('0x15')](_0x16c76f['body'],{'firstName':_0x16c76f[_0xebd9('0x5a')]['to'],'email':_0x16c76f[_0xebd9('0x5a')]['to'],'phone':_0x16c76f[_0xebd9('0x5a')]['to'],'ListId':_0x5a83d9[_0xebd9('0x6b')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xebd9('0x1f')](function(_0x4bd7b0){if(_0x4bd7b0){var _0x2b1b05={'UserId':_0x16c76f[_0xebd9('0x71')]['id'],'ContactId':_0x4bd7b0['id'],'MailAccountId':_0x5a83d9['id'],'inReplyTo':_0x6981ce['messageId'],'to':_0x16c76f[_0xebd9('0x5a')][_0xebd9('0x9f')],'cc':_0x16c76f[_0xebd9('0x5a')]['cc'],'subject':_0x16c76f['body']['subject'],'attach':_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xab')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xebd9('0x99')),'lastMsgDirection':'out','lastMsgBody':_0x16c76f[_0xebd9('0x5a')][_0xebd9('0x5a')],'Messages':[_['merge'](_0x16c76f[_0xebd9('0x5a')],{'messageId':_0x6981ce['messageId'],'sentAt':moment()[_0xebd9('0xa0')](_0xebd9('0x99')),'read':!![],'MailAccountId':_0x5a83d9['id'],'UserId':_0x16c76f[_0xebd9('0x71')]['id'],'ContactId':_0x4bd7b0['id']})]};if(_0x16c76f['body'][_0xebd9('0xac')]){_0x2b1b05=_[_0xebd9('0x4d')](_0x2b1b05,_0x16c76f[_0xebd9('0x5a')][_0xebd9('0xac')]);}return db[_0xebd9('0x87')][_0xebd9('0x61')](_0x2b1b05,{'include':[{'model':db[_0xebd9('0x9a')],'as':_0xebd9('0xad')}]});}})[_0xebd9('0x1f')](respondWithResult(_0x53791b,null))[_0xebd9('0x56')](handleError(_0x53791b,null));};exports['verifySmtp']=function(_0x182d11,_0x1c2b23,_0x2d612e){return db['MailAccount'][_0xebd9('0x59')]({'where':{'id':_0x182d11[_0xebd9('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xebd9('0x58'),'raw':!![]}]})[_0xebd9('0x1f')](handleEntityNotFound(_0x1c2b23,null))['then'](function(_0x50108c){if(_0x50108c&&_0x50108c['Smtp']){var _0x5b16f1={'id':_0x50108c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x50108c[_0xebd9('0x58')][_0xebd9('0x79')]){_0x5b16f1[_0xebd9('0x79')]=_0x50108c[_0xebd9('0x58')][_0xebd9('0x79')];}else{_0x5b16f1['host']=_0x50108c[_0xebd9('0x58')]['host'];_0x5b16f1[_0xebd9('0x78')]=_0x50108c['Smtp'][_0xebd9('0x78')];_0x5b16f1['secure']=_0x50108c['Smtp'][_0xebd9('0xa6')];}if(_0x50108c[_0xebd9('0x58')]['authentication']){_0x5b16f1['auth']={'user':_0x50108c[_0xebd9('0x58')]['user'],'pass':_0x50108c[_0xebd9('0x58')][_0xebd9('0x74')]};}return respondWithRpcPromise(_0xebd9('0xae'),_0xebd9('0xaf'),{'account':_0x5b16f1});}})[_0xebd9('0x1f')](respondWithResult(_0x1c2b23,null))[_0xebd9('0x56')](handleError(_0x1c2b23,null));};exports[_0xebd9('0x31')]=function(_0xc04f0f,_0x4f692e){return db['MailAccount']['find']({'where':{'id':_0xc04f0f[_0xebd9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4f692e,null))['then'](function(_0x4a91f3){if(_0x4a91f3&&_0x4a91f3[_0xebd9('0x79')]){throw new db[(_0xebd9('0xb0'))][(_0xebd9('0xb1'))](_0xebd9('0xb2'));}return _0x4a91f3;})[_0xebd9('0x1f')](removeEntity(_0x4f692e,null))[_0xebd9('0x56')](handleError(_0x4f692e,null));};exports[_0xebd9('0xb3')]=function(_0x3efc53,_0x4adf6c,_0xec6f12){return db[_0xebd9('0x3d')][_0xebd9('0x59')]({'where':{'id':_0x3efc53[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x4adf6c,null))['then'](function(_0x59904b){if(_0x59904b){return _0x59904b[_0xebd9('0xb3')](_0x3efc53['body'][_0xebd9('0x66')],_[_0xebd9('0x85')](_0x3efc53[_0xebd9('0x5a')],[_0xebd9('0x66'),'id'])||{})[_0xebd9('0xb4')](function(_0x35a33a){for(var _0x4c21b0=0x0;_0x4c21b0<_0x3efc53[_0xebd9('0x5a')][_0xebd9('0x66')][_0xebd9('0x45')];_0x4c21b0+=0x1){socket[_0xebd9('0xb5')](_0xebd9('0xb6'),{'UserId':_0x3efc53[_0xebd9('0x5a')][_0xebd9('0x66')][_0x4c21b0],'MailAccountId':_0x3efc53['params']['id']});}return _0x35a33a;});}})[_0xebd9('0x1f')](respondWithResult(_0x4adf6c,null))['catch'](handleError(_0x4adf6c,null));};exports['removeAgents']=function(_0x204cdd,_0x544823,_0x296743){return db['MailAccount'][_0xebd9('0x59')]({'where':{'id':_0x204cdd[_0xebd9('0x5b')]['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x544823,null))['then'](function(_0x387962){if(_0x387962){return _0x387962[_0xebd9('0xb7')](_0x204cdd['query'][_0xebd9('0x66')])['then'](function(){if(_[_0xebd9('0xb8')](_0x204cdd[_0xebd9('0x41')][_0xebd9('0x66')])){for(var _0x813e88=0x0;_0x813e88<_0x204cdd[_0xebd9('0x41')][_0xebd9('0x66')]['length'];_0x813e88+=0x1){socket[_0xebd9('0xb5')]('userMailAccount:remove',{'UserId':Number(_0x204cdd[_0xebd9('0x41')][_0xebd9('0x66')][_0x813e88]),'MailAccountId':Number(_0x204cdd[_0xebd9('0x5b')]['id'])});}}else{socket[_0xebd9('0xb5')]('userMailAccount:remove',{'UserId':Number(_0x204cdd['query'][_0xebd9('0x66')]),'MailAccountId':Number(_0x204cdd[_0xebd9('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x544823,null))[_0xebd9('0x56')](handleError(_0x544823,null));};exports[_0xebd9('0xb9')]=function(_0x270f15,_0x221827,_0x1c3796){var _0x227b2d={};var _0x1528dd={};var _0x2286d4;var _0x1cfe5a;return db[_0xebd9('0x3d')][_0xebd9('0x63')]({'where':{'id':_0x270f15['params']['id']}})[_0xebd9('0x1f')](handleEntityNotFound(_0x221827,null))[_0xebd9('0x1f')](function(_0xd10d98){if(_0xd10d98){_0x2286d4=_0xd10d98;_0x1528dd['model']=_[_0xebd9('0x40')](db[_0xebd9('0x89')][_0xebd9('0x3e')]);_0x1528dd[_0xebd9('0x41')]=_[_0xebd9('0x40')](_0x270f15[_0xebd9('0x41')]);_0x1528dd[_0xebd9('0x4b')]=_[_0xebd9('0x43')](_0x1528dd[_0xebd9('0x3f')],_0x1528dd[_0xebd9('0x41')]);_0x227b2d[_0xebd9('0x42')]=_[_0xebd9('0x43')](_0x1528dd[_0xebd9('0x3f')],qs[_0xebd9('0x44')](_0x270f15[_0xebd9('0x41')][_0xebd9('0x44')]));_0x227b2d[_0xebd9('0x42')]=_0x227b2d[_0xebd9('0x42')][_0xebd9('0x45')]?_0x227b2d[_0xebd9('0x42')]:_0x1528dd[_0xebd9('0x3f')];_0x227b2d[_0xebd9('0x47')]=qs[_0xebd9('0x48')](_0x270f15[_0xebd9('0x41')][_0xebd9('0x48')]);_0x227b2d[_0xebd9('0x49')]=qs[_0xebd9('0x4b')](_[_0xebd9('0x4a')](_0x270f15[_0xebd9('0x41')],_0x1528dd['filters']));if(_0x270f15[_0xebd9('0x41')][_0xebd9('0x4c')]){_0x227b2d[_0xebd9('0x49')]=_[_0xebd9('0x4d')](_0x227b2d['where'],{'$or':_[_0xebd9('0x4e')](_0x227b2d[_0xebd9('0x42')],function(_0x35a316){var _0x4bf1d0={};_0x4bf1d0[_0x35a316]={'$like':'%'+_0x270f15[_0xebd9('0x41')][_0xebd9('0x4c')]+'%'};return _0x4bf1d0;})});}_0x227b2d=_[_0xebd9('0x4d')]({},_0x227b2d,_0x270f15['options']);return _0x2286d4[_0xebd9('0xb9')](_0x227b2d);}})[_0xebd9('0x1f')](function(_0x1697d0){if(_0x1697d0){_0x1cfe5a=_0x1697d0['length'];if(!_0x270f15['query'][_0xebd9('0x64')](_0xebd9('0x46'))){_0x227b2d[_0xebd9('0x2c')]=qs[_0xebd9('0x2c')](_0x270f15['query'][_0xebd9('0x2c')]);_0x227b2d[_0xebd9('0x2b')]=qs['offset'](_0x270f15[_0xebd9('0x41')][_0xebd9('0x2b')]);}return _0x2286d4['getAgents'](_0x227b2d);}})[_0xebd9('0x1f')](function(_0x3a9bd5){if(_0x3a9bd5){return _0x3a9bd5?{'count':_0x1cfe5a,'rows':_0x3a9bd5}:null;}})[_0xebd9('0x1f')](respondWithResult(_0x221827,null))[_0xebd9('0x56')](handleError(_0x221827,null));}; \ No newline at end of file +var _0xeaab=['secure','pass','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./mailAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','UserProfileResource','end','stack','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','Imap','Smtp','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','name','key','email','ListId','active','isNil','cservice','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth'];(function(_0x17a71f,_0x58826a){var _0xb61bca=function(_0x2970e4){while(--_0x2970e4){_0x17a71f['push'](_0x17a71f['shift']());}};_0xb61bca(++_0x58826a);}(_0xeaab,0xd9));var _0xbeaa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeaab[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0xbeaa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbeaa('0x1'));var zipdir=require(_0xbeaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbeaa('0x3'));var BPromise=require(_0xbeaa('0x4'));var Mustache=require(_0xbeaa('0x5'));var util=require(_0xbeaa('0x6'));var path=require(_0xbeaa('0x7'));var sox=require(_0xbeaa('0x8'));var csv=require(_0xbeaa('0x9'));var ejs=require(_0xbeaa('0xa'));var fs=require('fs');var _=require(_0xbeaa('0xb'));var squel=require(_0xbeaa('0xc'));var crypto=require(_0xbeaa('0xd'));var jsforce=require(_0xbeaa('0xe'));var deskjs=require(_0xbeaa('0xf'));var toCsv=require(_0xbeaa('0x9'));var querystring=require('querystring');var Papa=require(_0xbeaa('0x10'));var Redis=require(_0xbeaa('0x11'));var authService=require(_0xbeaa('0x12'));var qs=require(_0xbeaa('0x13'));var hardwareService=require(_0xbeaa('0x14'));var logger=require(_0xbeaa('0x15'))(_0xbeaa('0x16'));var utils=require('../../config/utils');var config=require(_0xbeaa('0x17'));var db=require('../../mysqldb')['db'];config[_0xbeaa('0x18')]=_[_0xbeaa('0x19')](config['redis'],{'host':_0xbeaa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbeaa('0x18')]));require(_0xbeaa('0x1b'))['register'](socket);var jayson=require(_0xbeaa('0x1c'));var client=jayson[_0xbeaa('0x1d')][_0xbeaa('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x6fee13,_0x2a3136,_0x41cbd0){if(_0x41cbd0){var _0x9009d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9009d7[_0xbeaa('0x1f')](_0x2a3136)){return _0x6fee13;}else{throw new Error(_0xbeaa('0x20'));}}else{return _0x6fee13;}}function respondWithRpcPromise(_0x34271a,_0x1b28a5,_0x1cc387,_0x24c1ce){return new BPromise(function(_0x2ae656,_0x5db8f1){var _0x3a16a6=_0x24c1ce||client;return _0x3a16a6[_0xbeaa('0x21')](_0x34271a,_0x1cc387)[_0xbeaa('0x22')](function(_0x246207){logger[_0xbeaa('0x23')](_0xbeaa('0x24'),_0x1b28a5,'request\x20sent');logger[_0xbeaa('0x25')](_0xbeaa('0x26'),_0x1b28a5,_0xbeaa('0x27'),JSON['stringify'](_0x246207));if(_0x246207[_0xbeaa('0x28')]){if(_0x246207[_0xbeaa('0x28')][_0xbeaa('0x29')]===0x1f4){logger[_0xbeaa('0x28')](_0xbeaa('0x24'),_0x1b28a5,_0x246207[_0xbeaa('0x28')][_0xbeaa('0x2a')]);return _0x5db8f1(_0x246207['error'][_0xbeaa('0x2a')]);}logger[_0xbeaa('0x28')]('MailAccount,\x20%s,\x20%s',_0x1b28a5,_0x246207['error']['message']);return _0x2ae656(_0x246207[_0xbeaa('0x28')][_0xbeaa('0x2a')]);}else{logger[_0xbeaa('0x23')](_0xbeaa('0x24'),_0x1b28a5,'request\x20sent');_0x2ae656(_0x246207['result']['message']);}})[_0xbeaa('0x2b')](function(_0x441653){logger[_0xbeaa('0x28')](_0xbeaa('0x24'),_0x1b28a5,_0x441653);_0x5db8f1(_0x441653);});});}function respondWithStatusCode(_0x41661b,_0x4d0df4){_0x4d0df4=_0x4d0df4||0xcc;return function(_0x119e0d){if(_0x119e0d){return _0x41661b[_0xbeaa('0x2c')](_0x4d0df4);}return _0x41661b[_0xbeaa('0x2d')](_0x4d0df4)['end']();};}function respondWithResult(_0x2f509e,_0x3b0774){_0x3b0774=_0x3b0774||0xc8;return function(_0x233094){if(_0x233094){return _0x2f509e['status'](_0x3b0774)[_0xbeaa('0x2e')](_0x233094);}};}function respondWithFilteredResult(_0x578e92,_0x13d8b7){return function(_0x28221c){if(_0x28221c){var _0x13ed94=_0x28221c[_0xbeaa('0x2f')],_0x3f379a=_0x13d8b7[_0xbeaa('0x30')],_0xc85fd0=_0x13d8b7['offset']+_0x13d8b7[_0xbeaa('0x31')],_0x52e876;if(_0xc85fd0>=_0x13ed94){_0xc85fd0=_0x13ed94;_0x52e876=0xc8;}else{_0x52e876=0xce;}_0x578e92[_0xbeaa('0x2d')](_0x52e876);return _0x578e92['set'](_0xbeaa('0x32'),_0x3f379a+'-'+_0xc85fd0+'/'+_0x13ed94)['json'](_0x28221c);}return null;};}function patchUpdates(_0x521a23){return function(_0x5ee452){try{jsonpatch[_0xbeaa('0x33')](_0x5ee452,_0x521a23,!![]);}catch(_0x265316){return BPromise[_0xbeaa('0x34')](_0x265316);}return _0x5ee452['save']();};}function saveUpdates(_0x1fad7f,_0xc76552){return function(_0x453632){if(_0x453632){return _0x453632[_0xbeaa('0x35')](_0x1fad7f)['then'](function(_0x208a38){return _0x208a38;});}return null;};}function removeEntity(_0x40b2eb,_0x6a9ac9){return function(_0x28b704){if(_0x28b704){return _0x28b704[_0xbeaa('0x36')]()[_0xbeaa('0x22')](function(){var _0x462cb0=_0x28b704[_0xbeaa('0x37')]({'plain':!![]});var _0x244801='MailAccounts';return db[_0xbeaa('0x38')][_0xbeaa('0x36')]({'where':{'type':_0x244801,'resourceId':_0x462cb0['id']}})['then'](function(){return _0x28b704;});})['then'](function(){_0x40b2eb[_0xbeaa('0x2d')](0xcc)[_0xbeaa('0x39')]();});}};}function handleEntityNotFound(_0x4f3548,_0x345a48){return function(_0x7f4c43){if(!_0x7f4c43){_0x4f3548[_0xbeaa('0x2c')](0x194);}return _0x7f4c43;};}function handleError(_0x581bcf,_0x18bd6a){_0x18bd6a=_0x18bd6a||0x1f4;return function(_0x44a694){logger[_0xbeaa('0x28')](_0x44a694[_0xbeaa('0x3a')]);if(_0x44a694['name']){delete _0x44a694['name'];}_0x581bcf['status'](_0x18bd6a)['send'](_0x44a694);};}exports[_0xbeaa('0x3b')]=function(_0x4d3b5b,_0xc00b9f){var _0x291200={'include':[{'model':db[_0xbeaa('0x3c')],'as':'Imap'},{'model':db[_0xbeaa('0x3d')],'as':'Smtp'},{'model':db[_0xbeaa('0x3e')],'as':_0xbeaa('0x3f')}]},_0x5312fa={},_0x33576b={'count':0x0,'rows':[]};var _0x31a2df=db[_0xbeaa('0x40')][_0xbeaa('0x41')];_0x5312fa[_0xbeaa('0x42')]=_['keys'](_0x31a2df);_0x5312fa[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0x4d3b5b[_0xbeaa('0x43')]);_0x5312fa[_0xbeaa('0x45')]=_[_0xbeaa('0x46')](_0x5312fa['model'],_0x5312fa[_0xbeaa('0x43')]);_0x291200[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x5312fa['model'],qs['fields'](_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x291200[_0xbeaa('0x47')]=_0x291200[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0x291200[_0xbeaa('0x47')]:_0x5312fa[_0xbeaa('0x42')];if(!_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x4a')](_0xbeaa('0x4b'))){_0x291200['limit']=qs[_0xbeaa('0x31')](_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x31')]);_0x291200['offset']=qs[_0xbeaa('0x30')](_0x4d3b5b['query'][_0xbeaa('0x30')]);}_0x291200[_0xbeaa('0x4c')]=qs[_0xbeaa('0x4d')](_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x291200[_0xbeaa('0x4e')]=qs['filters'](_[_0xbeaa('0x4f')](_0x4d3b5b['query'],_0x5312fa[_0xbeaa('0x45')]));if(_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x50')]){_0x291200['where']=_[_0xbeaa('0x51')](_0x291200[_0xbeaa('0x4e')],{'$or':_['map'](_0x31a2df,function(_0x4e17ad){if(_0x4e17ad[_0xbeaa('0x52')]['key']!==_0xbeaa('0x53')){var _0x36bfc3={};_0x36bfc3[_0x4e17ad['field']]={'$like':'%'+_0x4d3b5b['query']['filter']+'%'};return _0x36bfc3;}})});}_0x291200=_[_0xbeaa('0x51')]({},_0x291200,_0x4d3b5b[_0xbeaa('0x54')]);var _0x1e9296={'where':_0x291200[_0xbeaa('0x4e')]};return db[_0xbeaa('0x40')][_0xbeaa('0x2f')](_0x1e9296)[_0xbeaa('0x22')](function(_0x1f6728){_0x33576b[_0xbeaa('0x2f')]=_0x1f6728;if(_0x4d3b5b[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x291200[_0xbeaa('0x56')]=[{'all':!![]}];}return db[_0xbeaa('0x40')][_0xbeaa('0x57')](_0x291200);})[_0xbeaa('0x22')](function(_0x59be64){_0x33576b[_0xbeaa('0x58')]=_0x59be64;return _0x33576b;})['then'](respondWithFilteredResult(_0xc00b9f,_0x291200))[_0xbeaa('0x2b')](handleError(_0xc00b9f,null));};exports['show']=function(_0x5f1798,_0x2257d2){var _0x2ec662={'raw':![],'where':{'id':_0x5f1798[_0xbeaa('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xbeaa('0x5a')},{'model':db[_0xbeaa('0x3d')],'as':_0xbeaa('0x5b')},{'model':db[_0xbeaa('0x3e')],'as':'mandatoryDispositionPause'}]},_0x23e22e={};_0x23e22e[_0xbeaa('0x42')]=_['keys'](db[_0xbeaa('0x40')][_0xbeaa('0x41')]);_0x23e22e[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0x5f1798['query']);_0x23e22e['filters']=_['intersection'](_0x23e22e['model'],_0x23e22e[_0xbeaa('0x43')]);_0x2ec662[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x23e22e[_0xbeaa('0x42')],qs[_0xbeaa('0x48')](_0x5f1798[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x2ec662[_0xbeaa('0x47')]=_0x2ec662[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0x2ec662[_0xbeaa('0x47')]:_0x23e22e[_0xbeaa('0x42')];if(_0x5f1798[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x2ec662[_0xbeaa('0x56')]=[{'all':!![]}];}_0x2ec662=_['merge']({},_0x2ec662,_0x5f1798['options']);return db['MailAccount'][_0xbeaa('0x5c')](_0x2ec662)[_0xbeaa('0x22')](handleEntityNotFound(_0x2257d2,null))['then'](respondWithResult(_0x2257d2,null))[_0xbeaa('0x2b')](handleError(_0x2257d2,null));};exports['update']=function(_0x37b4b7,_0x3fe4ba){if(_0x37b4b7[_0xbeaa('0x5d')]['id']){delete _0x37b4b7['body']['id'];}return db['MailAccount'][_0xbeaa('0x5c')]({'where':{'id':_0x37b4b7[_0xbeaa('0x59')]['id']},'include':[{'model':db[_0xbeaa('0x3c')],'as':_0xbeaa('0x5a')},{'model':db['MailServerOut'],'as':_0xbeaa('0x5b')},{'model':db[_0xbeaa('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xbeaa('0x22')](handleEntityNotFound(_0x3fe4ba,null))[_0xbeaa('0x22')](saveUpdates(_0x37b4b7[_0xbeaa('0x5d')],null))['then'](function(_0x47b0bd){if(_0x47b0bd&&_0x37b4b7[_0xbeaa('0x5d')]['Imap']){return db[_0xbeaa('0x3c')][_0xbeaa('0x35')](_0x37b4b7['body'][_0xbeaa('0x5a')],{'where':{'MailAccountId':_0x47b0bd['id']}})[_0xbeaa('0x22')](function(){return _0x47b0bd;});}return _0x47b0bd;})[_0xbeaa('0x22')](function(_0x2eebf6){if(_0x2eebf6&&_0x37b4b7[_0xbeaa('0x5d')][_0xbeaa('0x5b')]){return db['MailServerOut']['update'](_0x37b4b7[_0xbeaa('0x5d')][_0xbeaa('0x5b')],{'where':{'MailAccountId':_0x2eebf6['id']}})[_0xbeaa('0x22')](function(){return _0x2eebf6;});}return _0x2eebf6;})[_0xbeaa('0x22')](respondWithResult(_0x3fe4ba,null))[_0xbeaa('0x2b')](handleError(_0x3fe4ba,null));};exports[_0xbeaa('0x5e')]=function(_0xc3436e,_0x1c940f){return db[_0xbeaa('0x40')]['describe']()[_0xbeaa('0x22')](respondWithResult(_0x1c940f,null))[_0xbeaa('0x2b')](handleError(_0x1c940f,null));};exports[_0xbeaa('0x5f')]=function(_0x21ba9c,_0x8b942f,_0x20dc79){if(_0x21ba9c[_0xbeaa('0x5d')]['id']){delete _0x21ba9c[_0xbeaa('0x5d')]['id'];}return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x21ba9c[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x8b942f,null))[_0xbeaa('0x22')](function(_0x185f13){if(_0x185f13){_0x21ba9c[_0xbeaa('0x5d')]['MailAccountId']=_0x185f13['id'];return db[_0xbeaa('0x60')][_0xbeaa('0x61')](_0x21ba9c[_0xbeaa('0x5d')]);}})[_0xbeaa('0x22')](respondWithResult(_0x8b942f,null))['catch'](handleError(_0x8b942f,null));};exports[_0xbeaa('0x62')]=function(_0x3be0f0,_0xfdb0f,_0x4cb8a6){var _0x4c1f25={'raw':![],'where':{}};var _0x1f9424={};var _0x4e5e37={'count':0x0,'rows':[]};return db[_0xbeaa('0x40')][_0xbeaa('0x63')]({'where':{'id':_0x3be0f0['params']['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0xfdb0f,null))[_0xbeaa('0x22')](function(_0x3a20fb){if(_0x3a20fb){_0x1f9424[_0xbeaa('0x42')]=_[_0xbeaa('0x44')](db[_0xbeaa('0x60')]['rawAttributes']);_0x1f9424[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0x3be0f0[_0xbeaa('0x43')]);_0x1f9424['filters']=_[_0xbeaa('0x46')](_0x1f9424[_0xbeaa('0x42')],_0x1f9424[_0xbeaa('0x43')]);_0x4c1f25[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x1f9424['model'],qs[_0xbeaa('0x48')](_0x3be0f0[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x4c1f25[_0xbeaa('0x47')]=_0x4c1f25[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0x4c1f25[_0xbeaa('0x47')]:_0x1f9424[_0xbeaa('0x42')];if(!_0x3be0f0[_0xbeaa('0x43')][_0xbeaa('0x4a')](_0xbeaa('0x4b'))){_0x4c1f25[_0xbeaa('0x31')]=qs['limit'](_0x3be0f0['query'][_0xbeaa('0x31')]);_0x4c1f25[_0xbeaa('0x30')]=qs['offset'](_0x3be0f0[_0xbeaa('0x43')][_0xbeaa('0x30')]);}_0x4c1f25[_0xbeaa('0x4c')]=qs['sort'](_0x3be0f0[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x4c1f25[_0xbeaa('0x4e')]=qs[_0xbeaa('0x45')](_[_0xbeaa('0x4f')](_0x3be0f0[_0xbeaa('0x43')],_0x1f9424[_0xbeaa('0x45')]));_0x4c1f25['where'][_0xbeaa('0x64')]=_0x3a20fb['id'];if(_0x3be0f0['query'][_0xbeaa('0x50')]){_0x4c1f25[_0xbeaa('0x4e')]=_[_0xbeaa('0x51')](_0x4c1f25['where'],{'$or':_[_0xbeaa('0x65')](_0x4c1f25[_0xbeaa('0x47')],function(_0x5d84db){var _0x536559={};_0x536559[_0x5d84db]={'$like':'%'+_0x3be0f0['query'][_0xbeaa('0x50')]+'%'};return _0x536559;})});}_0x4c1f25=_[_0xbeaa('0x51')]({},_0x4c1f25,_0x3be0f0[_0xbeaa('0x54')]);return db[_0xbeaa('0x60')][_0xbeaa('0x2f')]({'where':_0x4c1f25[_0xbeaa('0x4e')]})[_0xbeaa('0x22')](function(_0x4598f8){_0x4e5e37['count']=_0x4598f8;if(_0x3be0f0[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x4c1f25[_0xbeaa('0x56')]=[{'all':!![]}];}return db[_0xbeaa('0x60')][_0xbeaa('0x57')](_0x4c1f25);})[_0xbeaa('0x22')](function(_0x5b1f03){_0x4e5e37[_0xbeaa('0x58')]=_0x5b1f03;return _0x4e5e37;});}})['then'](respondWithFilteredResult(_0xfdb0f,_0x4c1f25))['catch'](handleError(_0xfdb0f,null));};exports[_0xbeaa('0x66')]=function(_0x2e2a71,_0x51d5cb,_0x57636c){return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x2e2a71[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x51d5cb,null))[_0xbeaa('0x22')](function(_0xe68c0d){if(_0xe68c0d){return _0xe68c0d['removeDispositions'](_0x2e2a71['query'][_0xbeaa('0x67')]);}})[_0xbeaa('0x22')](respondWithStatusCode(_0x51d5cb,null))[_0xbeaa('0x2b')](handleError(_0x51d5cb,null));};exports[_0xbeaa('0x68')]=function(_0xb0061,_0x3ebf5d,_0x276a1c){if(_0xb0061[_0xbeaa('0x5d')]['id']){delete _0xb0061[_0xbeaa('0x5d')]['id'];}return db['MailAccount'][_0xbeaa('0x5c')]({'where':{'id':_0xb0061[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x3ebf5d,null))[_0xbeaa('0x22')](function(_0x27280c){if(_0x27280c){_0xb0061[_0xbeaa('0x5d')]['MailAccountId']=_0x27280c['id'];return db[_0xbeaa('0x69')]['create'](_0xb0061[_0xbeaa('0x5d')]);}})[_0xbeaa('0x22')](respondWithResult(_0x3ebf5d,null))[_0xbeaa('0x2b')](handleError(_0x3ebf5d,null));};exports[_0xbeaa('0x6a')]=function(_0x4b7eaf,_0x221033,_0x8b04a7){var _0x2a2cb0={'raw':![],'where':{}};var _0x35e21d={};var _0x5e2f75={'count':0x0,'rows':[]};return db['MailAccount'][_0xbeaa('0x63')]({'where':{'id':_0x4b7eaf[_0xbeaa('0x59')]['id']}})['then'](handleEntityNotFound(_0x221033,null))[_0xbeaa('0x22')](function(_0x206387){if(_0x206387){_0x35e21d['model']=_[_0xbeaa('0x44')](db['CannedAnswer'][_0xbeaa('0x41')]);_0x35e21d[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0x4b7eaf[_0xbeaa('0x43')]);_0x35e21d['filters']=_[_0xbeaa('0x46')](_0x35e21d[_0xbeaa('0x42')],_0x35e21d[_0xbeaa('0x43')]);_0x2a2cb0[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x35e21d[_0xbeaa('0x42')],qs[_0xbeaa('0x48')](_0x4b7eaf[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x2a2cb0['attributes']=_0x2a2cb0[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0x2a2cb0[_0xbeaa('0x47')]:_0x35e21d[_0xbeaa('0x42')];if(!_0x4b7eaf[_0xbeaa('0x43')]['hasOwnProperty']('nolimit')){_0x2a2cb0[_0xbeaa('0x31')]=qs[_0xbeaa('0x31')](_0x4b7eaf[_0xbeaa('0x43')][_0xbeaa('0x31')]);_0x2a2cb0['offset']=qs[_0xbeaa('0x30')](_0x4b7eaf['query'][_0xbeaa('0x30')]);}_0x2a2cb0[_0xbeaa('0x4c')]=qs[_0xbeaa('0x4d')](_0x4b7eaf[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x2a2cb0[_0xbeaa('0x4e')]=qs[_0xbeaa('0x45')](_[_0xbeaa('0x4f')](_0x4b7eaf[_0xbeaa('0x43')],_0x35e21d[_0xbeaa('0x45')]));_0x2a2cb0[_0xbeaa('0x4e')][_0xbeaa('0x64')]=_0x206387['id'];if(_0x4b7eaf['query']['filter']){_0x2a2cb0[_0xbeaa('0x4e')]=_[_0xbeaa('0x51')](_0x2a2cb0[_0xbeaa('0x4e')],{'$or':_['map'](_0x2a2cb0[_0xbeaa('0x47')],function(_0x3e4255){var _0x2ec3f1={};_0x2ec3f1[_0x3e4255]={'$like':'%'+_0x4b7eaf[_0xbeaa('0x43')][_0xbeaa('0x50')]+'%'};return _0x2ec3f1;})});}_0x2a2cb0=_[_0xbeaa('0x51')]({},_0x2a2cb0,_0x4b7eaf[_0xbeaa('0x54')]);return db[_0xbeaa('0x69')][_0xbeaa('0x2f')]({'where':_0x2a2cb0[_0xbeaa('0x4e')]})[_0xbeaa('0x22')](function(_0xb7f1e7){_0x5e2f75[_0xbeaa('0x2f')]=_0xb7f1e7;if(_0x4b7eaf[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x2a2cb0[_0xbeaa('0x56')]=[{'all':!![]}];}return db[_0xbeaa('0x69')][_0xbeaa('0x57')](_0x2a2cb0);})[_0xbeaa('0x22')](function(_0x4a0508){_0x5e2f75[_0xbeaa('0x58')]=_0x4a0508;return _0x5e2f75;});}})[_0xbeaa('0x22')](respondWithFilteredResult(_0x221033,_0x2a2cb0))[_0xbeaa('0x2b')](handleError(_0x221033,null));};exports[_0xbeaa('0x6b')]=function(_0x36e169,_0x2ec1bf,_0x22626c){return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x36e169[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x2ec1bf,null))['then'](function(_0x275ed1){if(_0x275ed1){return _0x275ed1[_0xbeaa('0x6b')](_0x36e169[_0xbeaa('0x43')]['ids']);}})[_0xbeaa('0x22')](respondWithStatusCode(_0x2ec1bf,null))[_0xbeaa('0x2b')](handleError(_0x2ec1bf,null));};exports[_0xbeaa('0x61')]=function(_0x16d0a0,_0x62d278){var _0x459b86={'name':_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x6c')],'key':_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x6d')],'email':_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x6e')],'ListId':_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x6f')],'active':!_['isNil'](_0x16d0a0['body']['active'])?_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x70')]:!![],'description':_0x16d0a0[_0xbeaa('0x5d')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xbeaa('0x71')](_0x16d0a0['body'][_0xbeaa('0x72')])){if(_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x73')]){_0x459b86['Imap'][_0xbeaa('0x74')]=_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x74')]=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x75')];_0x459b86[_0xbeaa('0x5a')][_0xbeaa('0x76')]=_0x459b86['Smtp']['pass']=_0x16d0a0['body'][_0xbeaa('0x77')];}else{_0x459b86[_0xbeaa('0x5a')]['authentication']=_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x78')]=![];}_0x459b86['Imap'][_0xbeaa('0x79')]=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x5a')]['host'];_0x459b86[_0xbeaa('0x5a')][_0xbeaa('0x7a')]=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x5a')][_0xbeaa('0x7a')];_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x79')]=_0x16d0a0['body'][_0xbeaa('0x5b')][_0xbeaa('0x79')];_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x7a')]=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x5b')][_0xbeaa('0x7a')];}else{_0x459b86['Imap'][_0xbeaa('0x7b')]=_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x7b')]=_0x16d0a0['body'][_0xbeaa('0x72')];_0x459b86[_0xbeaa('0x5a')][_0xbeaa('0x74')]=_0x459b86[_0xbeaa('0x5b')][_0xbeaa('0x74')]=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x75')];_0x459b86[_0xbeaa('0x5a')][_0xbeaa('0x76')]=_0x459b86['Smtp']['pass']=_0x16d0a0[_0xbeaa('0x5d')][_0xbeaa('0x77')];}return db[_0xbeaa('0x40')]['create'](_0x459b86,{'include':[{'model':db[_0xbeaa('0x3d')],'as':_0xbeaa('0x5b')},{'model':db[_0xbeaa('0x3c')],'as':_0xbeaa('0x5a')}]})[_0xbeaa('0x22')](function(_0x564c44){var _0x19897b=_0x16d0a0[_0xbeaa('0x74')][_0xbeaa('0x37')]({'plain':!![]});if(!_0x19897b)throw new Error(_0xbeaa('0x7c'));if(_0x19897b[_0xbeaa('0x7d')]===_0xbeaa('0x74')){var _0x50a404=_0x564c44[_0xbeaa('0x37')]({'plain':!![]});return db['UserProfileSection'][_0xbeaa('0x5c')]({'where':{'name':_0xbeaa('0x7e'),'userProfileId':_0x19897b[_0xbeaa('0x7f')]},'raw':!![]})['then'](function(_0x1f2106){if(_0x1f2106&&_0x1f2106['autoAssociation']===0x0){return db[_0xbeaa('0x38')][_0xbeaa('0x61')]({'name':_0x50a404['name'],'resourceId':_0x50a404['id'],'type':_0x1f2106['name'],'sectionId':_0x1f2106['id']},{})[_0xbeaa('0x22')](function(){return _0x564c44;});}else{return _0x564c44;}})[_0xbeaa('0x2b')](function(_0x1f9b1e){logger[_0xbeaa('0x28')](_0xbeaa('0x80'),_0x1f9b1e);throw _0x1f9b1e;});}return _0x564c44;})[_0xbeaa('0x22')](respondWithResult(_0x62d278,0xc9))[_0xbeaa('0x2b')](handleError(_0x62d278,null));};exports[_0xbeaa('0x81')]=function(_0x79b2d,_0x22c292,_0x240b4a){return db[_0xbeaa('0x40')]['findOne']({'where':{'id':_0x79b2d[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x22c292,null))[_0xbeaa('0x22')](function(_0x39e996){if(_0x39e996){return _0x39e996['getImap']();}return null;})[_0xbeaa('0x22')](respondWithResult(_0x22c292,null))[_0xbeaa('0x2b')](handleError(_0x22c292,null));};exports[_0xbeaa('0x82')]=function(_0x4c184b,_0x262b15,_0x4d2d8f){if(_0x4c184b[_0xbeaa('0x5d')]['id']){delete _0x4c184b[_0xbeaa('0x5d')]['id'];}return db[_0xbeaa('0x40')]['find']({'where':{'id':_0x4c184b[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x262b15,null))[_0xbeaa('0x22')](function(_0x2d14ae){if(_0x2d14ae){_0x4c184b[_0xbeaa('0x5d')]['MailAccountId']=_0x2d14ae['id'];return db['MailServerIn'][_0xbeaa('0x61')](_0x4c184b['body']);}})[_0xbeaa('0x22')](respondWithResult(_0x262b15,null))['catch'](handleError(_0x262b15,null));};exports[_0xbeaa('0x83')]=function(_0x2417a9,_0x9cd003,_0x37133c){return db['MailAccount'][_0xbeaa('0x63')]({'where':{'id':_0x2417a9[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x9cd003,null))[_0xbeaa('0x22')](function(_0x6a31e1){if(_0x6a31e1){return _0x6a31e1[_0xbeaa('0x84')](null);}return null;})[_0xbeaa('0x22')](respondWithStatusCode(_0x9cd003,null))[_0xbeaa('0x2b')](handleError(_0x9cd003,null));};exports['getSmtp']=function(_0x2cfe16,_0x87e04a,_0x25c445){return db['MailAccount'][_0xbeaa('0x63')]({'where':{'id':_0x2cfe16[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x87e04a,null))[_0xbeaa('0x22')](function(_0x2d06d4){if(_0x2d06d4){return _0x2d06d4[_0xbeaa('0x85')]();}return null;})[_0xbeaa('0x22')](respondWithResult(_0x87e04a,null))[_0xbeaa('0x2b')](handleError(_0x87e04a,null));};exports['addSmtp']=function(_0x14daff,_0x366cb5,_0x5d51a3){if(_0x14daff[_0xbeaa('0x5d')]['id']){delete _0x14daff[_0xbeaa('0x5d')]['id'];}return db[_0xbeaa('0x40')]['find']({'where':{'id':_0x14daff[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x366cb5,null))['then'](function(_0x4e719c){if(_0x4e719c){_0x14daff[_0xbeaa('0x5d')][_0xbeaa('0x64')]=_0x4e719c['id'];return db['MailServerOut']['create'](_0x14daff[_0xbeaa('0x5d')]);}})['then'](respondWithResult(_0x366cb5,null))['catch'](handleError(_0x366cb5,null));};exports[_0xbeaa('0x86')]=function(_0xdc5d02,_0x80093d,_0x135f34){return db[_0xbeaa('0x40')]['findOne']({'where':{'id':_0xdc5d02['params']['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x80093d,null))['then'](function(_0x12eb80){if(_0x12eb80){return _0x12eb80[_0xbeaa('0x87')](null);}return null;})['then'](respondWithStatusCode(_0x80093d,null))[_0xbeaa('0x2b')](handleError(_0x80093d,null));};exports[_0xbeaa('0x88')]=function(_0x376254,_0xf2a94a,_0x520e06){return db[_0xbeaa('0x89')][_0xbeaa('0x5c')]({'where':{'id':_0x376254[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0xf2a94a,null))[_0xbeaa('0x22')](function(_0x5a1568){if(_0x5a1568){return _0x5a1568[_0xbeaa('0x88')](_0x376254[_0xbeaa('0x5d')][_0xbeaa('0x67')],_['omit'](_0x376254[_0xbeaa('0x5d')],[_0xbeaa('0x67'),'id'])||{});}})[_0xbeaa('0x22')](respondWithResult(_0xf2a94a,null))[_0xbeaa('0x2b')](handleError(_0xf2a94a,null));};exports[_0xbeaa('0x8a')]=function(_0xc7b1d5,_0x5bee69,_0x2c4122){var _0x3a2ab6={'raw':![],'where':{}};var _0x456426={};var _0x961fc2={'count':0x0,'rows':[]};return db[_0xbeaa('0x40')]['findOne']({'where':{'id':_0xc7b1d5['params']['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x5bee69,null))[_0xbeaa('0x22')](function(_0x140579){if(_0x140579){_0x456426[_0xbeaa('0x42')]=_[_0xbeaa('0x44')](db['MailInteraction'][_0xbeaa('0x41')]);_0x456426[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0xc7b1d5[_0xbeaa('0x43')]);_0x456426[_0xbeaa('0x45')]=_['intersection'](_0x456426[_0xbeaa('0x42')],_0x456426[_0xbeaa('0x43')]);_0x3a2ab6[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x456426[_0xbeaa('0x42')],qs[_0xbeaa('0x48')](_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x3a2ab6[_0xbeaa('0x47')]=_0x3a2ab6['attributes'][_0xbeaa('0x49')]?_0x3a2ab6[_0xbeaa('0x47')]:_0x456426['model'];if(!_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x4a')](_0xbeaa('0x4b'))){_0x3a2ab6[_0xbeaa('0x31')]=qs[_0xbeaa('0x31')](_0xc7b1d5[_0xbeaa('0x43')]['limit']);_0x3a2ab6[_0xbeaa('0x30')]=qs['offset'](_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x30')]);}_0x3a2ab6[_0xbeaa('0x4c')]=qs['sort'](_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x3a2ab6['where']=qs['filters'](_[_0xbeaa('0x4f')](_0xc7b1d5[_0xbeaa('0x43')],_0x456426['filters']));_0x3a2ab6['where']['MailAccountId']=_0x140579['id'];if(_0xc7b1d5[_0xbeaa('0x43')]['filter']){_0x3a2ab6[_0xbeaa('0x4e')]=_[_0xbeaa('0x51')](_0x3a2ab6['where'],{'$or':_['map'](_0x3a2ab6[_0xbeaa('0x47')],function(_0x1fc750){var _0x511e05={};_0x511e05[_0x1fc750]={'$like':'%'+_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x50')]+'%'};return _0x511e05;})});}_0x3a2ab6=_[_0xbeaa('0x51')]({},_0x3a2ab6,_0xc7b1d5[_0xbeaa('0x54')]);return db['MailInteraction'][_0xbeaa('0x2f')]({'where':_0x3a2ab6['where']})[_0xbeaa('0x22')](function(_0x496e0f){_0x961fc2[_0xbeaa('0x2f')]=_0x496e0f;if(_0xc7b1d5[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x3a2ab6['include']=[{'model':db[_0xbeaa('0x8b')],'as':'Contact','required':![]},{'model':db[_0xbeaa('0x8c')],'as':_0xbeaa('0x8d'),'attributes':[_0xbeaa('0x6c'),_0xbeaa('0x8e'),'internal'],'required':![]},{'model':db[_0xbeaa('0x8f')],'as':_0xbeaa('0x90'),'attributes':['id',_0xbeaa('0x6c'),_0xbeaa('0x91')],'where':_0xc7b1d5['query'][_0xbeaa('0x92')]?{'id':_0xc7b1d5['query'][_0xbeaa('0x92')]}:undefined,'required':_0xc7b1d5['query'][_0xbeaa('0x92')]?!![]:![]}];}return db[_0xbeaa('0x89')][_0xbeaa('0x57')](_0x3a2ab6);})[_0xbeaa('0x22')](function(_0x2c87c9){_0x961fc2[_0xbeaa('0x58')]=_0x2c87c9;return _0x961fc2;});}})[_0xbeaa('0x22')](respondWithFilteredResult(_0x5bee69,_0x3a2ab6))['catch'](handleError(_0x5bee69,null));};exports['addApplications']=function(_0x29c1d9,_0x2b12a2,_0x2e7525){return db['MailAccount'][_0xbeaa('0x63')]({'where':{'id':_0x29c1d9[_0xbeaa('0x59')]['id']}})['then'](handleEntityNotFound(_0x2b12a2,null))[_0xbeaa('0x22')](function(_0x296551){if(_0x296551){return db[_0xbeaa('0x93')][_0xbeaa('0x94')](function(_0x31b789){return db[_0xbeaa('0x95')][_0xbeaa('0x36')]({'where':{'MailAccountId':_0x29c1d9[_0xbeaa('0x59')]['id']},'transaction':_0x31b789})[_0xbeaa('0x22')](function(_0x56ec48){var _0xc21b07=_['map'](_0x29c1d9['body'],function(_0x23912c){_0x23912c[_0xbeaa('0x64')]=_0x29c1d9['params']['id'];return _0x23912c;});return db[_0xbeaa('0x95')][_0xbeaa('0x96')](_0xc21b07,{'transaction':_0x31b789});});})['then'](function(){return db['MailApplication'][_0xbeaa('0x97')]({'where':{'MailAccountId':_0x29c1d9[_0xbeaa('0x59')]['id']},'order':_0xbeaa('0x98')});});}})['then'](respondWithResult(_0x2b12a2,null))['catch'](handleError(_0x2b12a2,null));};exports[_0xbeaa('0x99')]=function(_0x4c7f57,_0x3fa6f4,_0x2d559f){var _0xf93d95={};var _0x35d1bf={};var _0x253420;var _0x3acced;return db['MailAccount']['findOne']({'where':{'id':_0x4c7f57[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x3fa6f4,null))[_0xbeaa('0x22')](function(_0x2a6092){if(_0x2a6092){_0x253420=_0x2a6092;_0x35d1bf['model']=_[_0xbeaa('0x44')](db[_0xbeaa('0x95')][_0xbeaa('0x41')]);_0x35d1bf[_0xbeaa('0x43')]=_[_0xbeaa('0x44')](_0x4c7f57['query']);_0x35d1bf[_0xbeaa('0x45')]=_['intersection'](_0x35d1bf[_0xbeaa('0x42')],_0x35d1bf[_0xbeaa('0x43')]);_0xf93d95[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x35d1bf[_0xbeaa('0x42')],qs['fields'](_0x4c7f57[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0xf93d95['attributes']=_0xf93d95[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0xf93d95[_0xbeaa('0x47')]:_0x35d1bf[_0xbeaa('0x42')];_0xf93d95[_0xbeaa('0x4c')]=qs[_0xbeaa('0x4d')](_0x4c7f57[_0xbeaa('0x43')]['sort']);_0xf93d95[_0xbeaa('0x4e')]=qs[_0xbeaa('0x45')](_[_0xbeaa('0x4f')](_0x4c7f57[_0xbeaa('0x43')],_0x35d1bf['filters']));if(_0x4c7f57['query'][_0xbeaa('0x50')]){_0xf93d95['where']=_['merge'](_0xf93d95[_0xbeaa('0x4e')],{'$or':_[_0xbeaa('0x65')](_0xf93d95[_0xbeaa('0x47')],function(_0x4358d3){var _0x30744a={};_0x30744a[_0x4358d3]={'$like':'%'+_0x4c7f57[_0xbeaa('0x43')][_0xbeaa('0x50')]+'%'};return _0x30744a;})});}_0xf93d95=_[_0xbeaa('0x51')]({},_0xf93d95,_0x4c7f57[_0xbeaa('0x54')]);return _0x253420['getApplications'](_0xf93d95);}})[_0xbeaa('0x22')](function(_0x584b8f){if(_0x584b8f){_0x3acced=_0x584b8f[_0xbeaa('0x49')];if(!_0x4c7f57[_0xbeaa('0x43')]['hasOwnProperty'](_0xbeaa('0x4b'))){_0xf93d95[_0xbeaa('0x31')]=qs[_0xbeaa('0x31')](_0x4c7f57[_0xbeaa('0x43')][_0xbeaa('0x31')]);_0xf93d95[_0xbeaa('0x30')]=qs['offset'](_0x4c7f57['query'][_0xbeaa('0x30')]);}return _0x253420[_0xbeaa('0x99')](_0xf93d95);}})['then'](function(_0x557ddd){if(_0x557ddd){return _0x557ddd?{'count':_0x3acced,'rows':_0x557ddd}:null;}})[_0xbeaa('0x22')](respondWithResult(_0x3fa6f4,null))[_0xbeaa('0x2b')](handleError(_0x3fa6f4,null));};exports[_0xbeaa('0x9a')]=function(_0x427426,_0x25d252,_0x3f2ad4){var _0x24e4a={'raw':!![],'where':{}};var _0x521eee={};var _0x4c9628={'count':0x0,'rows':[]};return db[_0xbeaa('0x40')][_0xbeaa('0x63')]({'where':{'id':_0x427426[_0xbeaa('0x59')]['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x25d252,null))[_0xbeaa('0x22')](function(_0x4108ee){if(_0x4108ee){_0x521eee['model']=_[_0xbeaa('0x44')](db[_0xbeaa('0x9b')][_0xbeaa('0x41')]);_0x521eee[_0xbeaa('0x43')]=_['keys'](_0x427426[_0xbeaa('0x43')]);_0x521eee[_0xbeaa('0x45')]=_['intersection'](_0x521eee[_0xbeaa('0x42')],_0x521eee[_0xbeaa('0x43')]);_0x24e4a[_0xbeaa('0x47')]=_[_0xbeaa('0x46')](_0x521eee[_0xbeaa('0x42')],qs[_0xbeaa('0x48')](_0x427426[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x24e4a['attributes']=_0x24e4a[_0xbeaa('0x47')][_0xbeaa('0x49')]?_0x24e4a[_0xbeaa('0x47')]:_0x521eee[_0xbeaa('0x42')];if(!_0x427426[_0xbeaa('0x43')][_0xbeaa('0x4a')]('nolimit')){_0x24e4a[_0xbeaa('0x31')]=qs['limit'](_0x427426['query']['limit']);_0x24e4a[_0xbeaa('0x30')]=qs[_0xbeaa('0x30')](_0x427426['query']['offset']);}_0x24e4a[_0xbeaa('0x4c')]=qs[_0xbeaa('0x4d')](_0x427426[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x24e4a[_0xbeaa('0x4e')]=qs[_0xbeaa('0x45')](_[_0xbeaa('0x4f')](_0x427426[_0xbeaa('0x43')],_0x521eee[_0xbeaa('0x45')]));_0x24e4a[_0xbeaa('0x4e')]['MailAccountId']=_0x4108ee['id'];if(_0x427426[_0xbeaa('0x43')][_0xbeaa('0x50')]){_0x24e4a['where']=_[_0xbeaa('0x51')](_0x24e4a[_0xbeaa('0x4e')],{'$or':_['map'](_0x24e4a[_0xbeaa('0x47')],function(_0x412536){var _0x3ef4ef={};_0x3ef4ef[_0x412536]={'$like':'%'+_0x427426[_0xbeaa('0x43')][_0xbeaa('0x50')]+'%'};return _0x3ef4ef;})});}if(_0x427426[_0xbeaa('0x43')][_0xbeaa('0x9c')]){var _0x3da61=_0x427426[_0xbeaa('0x43')][_0xbeaa('0x9c')][_0xbeaa('0x9d')](',');var _0x4e4b06={};_0x4e4b06[_0x3da61[0x0]]={'$gte':moment(_0x3da61[0x1])[_0xbeaa('0x9e')](_0xbeaa('0x9f'))};_0x24e4a['where']=_['merge'](_0x24e4a[_0xbeaa('0x4e')],_0x4e4b06);}_0x24e4a=_['merge']({},_0x24e4a,_0x427426[_0xbeaa('0x54')]);return db[_0xbeaa('0x9b')][_0xbeaa('0x2f')]({'where':_0x24e4a[_0xbeaa('0x4e')]})[_0xbeaa('0x22')](function(_0x17f370){_0x4c9628[_0xbeaa('0x2f')]=_0x17f370;if(_0x427426[_0xbeaa('0x43')][_0xbeaa('0x55')]){_0x24e4a['include']=[{'all':!![]}];}return db[_0xbeaa('0x9b')][_0xbeaa('0x57')](_0x24e4a);})['then'](function(_0x11cac5){_0x4c9628['rows']=_0x11cac5;return _0x4c9628;});}})[_0xbeaa('0x22')](respondWithFilteredResult(_0x25d252,_0x24e4a))[_0xbeaa('0x2b')](handleError(_0x25d252,null));};exports[_0xbeaa('0xa0')]=function(_0x2af568,_0x1ea4ad,_0x16d4e9){var _0x12b5ae,_0x95a192={},_0x3ce68a;if(_0x2af568['body']['to']){_0x3ce68a=_0x2af568[_0xbeaa('0x5d')]['to'][_0xbeaa('0x9d')](',')[0x0];}return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x2af568['params']['id']},'include':[{'model':db['CmList'],'as':_0xbeaa('0xa1'),'include':[{'model':db['CmContact'],'as':_0xbeaa('0xa2'),'where':{'email':_0x3ce68a},'limit':0x1,'order':[[_0xbeaa('0xa3'),_0xbeaa('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0xbeaa('0x5b'),'raw':!![]}]})[_0xbeaa('0x22')](handleEntityNotFound(_0x1ea4ad,null))[_0xbeaa('0x22')](function(_0x265cc2){if(_0x265cc2){_0x12b5ae=_0x265cc2;if(_0x265cc2[_0xbeaa('0x5b')]){if(_[_0xbeaa('0x71')](_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa5')])){_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa5')]=util[_0xbeaa('0x9e')](_0xbeaa('0xa6'),_0x265cc2[_0xbeaa('0x6c')],_0x265cc2[_0xbeaa('0x6e')]||_0x265cc2['Smtp'][_0xbeaa('0x74')]);}if(_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa7')]&&_0x2af568['body']['attachments']['length']){for(var _0x4b4a18=0x0;_0x4b4a18<_0x2af568['body'][_0xbeaa('0xa7')]['length'];_0x4b4a18+=0x1){_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa7')][_0x4b4a18]={'filename':_0x2af568['body'][_0xbeaa('0xa7')][_0x4b4a18][_0xbeaa('0x6c')],'path':path[_0xbeaa('0xa8')](config[_0xbeaa('0xa9')],_0xbeaa('0xaa'),_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa7')][_0x4b4a18][_0xbeaa('0xab')])};}}var _0x4c9289={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x265cc2[_0xbeaa('0x5b')]['service'])){if(_0x265cc2['Smtp'][_0xbeaa('0x78')]){_0x4c9289[_0xbeaa('0xac')]={'user':_0x265cc2[_0xbeaa('0x5b')][_0xbeaa('0x74')],'pass':_0x265cc2[_0xbeaa('0x5b')]['pass']};}_0x4c9289['host']=_0x265cc2[_0xbeaa('0x5b')][_0xbeaa('0x79')];_0x4c9289['port']=_0x265cc2[_0xbeaa('0x5b')][_0xbeaa('0x7a')];_0x4c9289[_0xbeaa('0xad')]=_0x265cc2[_0xbeaa('0x5b')]['secure'];}else{_0x4c9289[_0xbeaa('0x7b')]=_0x265cc2[_0xbeaa('0x5b')][_0xbeaa('0x7b')];_0x4c9289[_0xbeaa('0xac')]={'user':_0x265cc2[_0xbeaa('0x5b')][_0xbeaa('0x74')],'pass':_0x265cc2['Smtp'][_0xbeaa('0xae')]};}return respondWithRpcPromise(_0xbeaa('0xaf'),'sendMail',{'account':_0x4c9289,'message':_0x2af568[_0xbeaa('0x5d')]});}else{throw new Error('List\x20not\x20found');}}})[_0xbeaa('0x22')](function(_0x4bc5bc){if(_0x4bc5bc){_0x95a192=_0x4bc5bc;if(_0x12b5ae[_0xbeaa('0xa1')]){if(_0x12b5ae[_0xbeaa('0xa1')][_0xbeaa('0xa2')]['length']){return _0x12b5ae['List'][_0xbeaa('0xa2')][0x0];}else{return db[_0xbeaa('0x8b')]['create'](_[_0xbeaa('0x19')](_0x2af568[_0xbeaa('0x5d')],{'firstName':_0x2af568[_0xbeaa('0x5d')]['to'],'email':_0x2af568[_0xbeaa('0x5d')]['to'],'phone':_0x2af568['body']['to'],'ListId':_0x12b5ae['ListId']}));}}else{throw new Error(_0xbeaa('0xb0'));}}})[_0xbeaa('0x22')](function(_0x3167b0){if(_0x3167b0){var _0x1c30c3={'UserId':_0x2af568[_0xbeaa('0x74')]['id'],'ContactId':_0x3167b0['id'],'MailAccountId':_0x12b5ae['id'],'inReplyTo':_0x95a192[_0xbeaa('0xb1')],'to':_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xa5')],'cc':_0x2af568[_0xbeaa('0x5d')]['cc'],'subject':_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xb2')],'attach':_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xb3')],'firstMsgDirection':_0xbeaa('0xb4'),'lastMsgAt':moment()[_0xbeaa('0x9e')](_0xbeaa('0x9f')),'lastMsgDirection':_0xbeaa('0xb4'),'lastMsgBody':_0x2af568['body'][_0xbeaa('0x5d')],'Messages':[_['merge'](_0x2af568['body'],{'messageId':_0x95a192[_0xbeaa('0xb1')],'sentAt':moment()[_0xbeaa('0x9e')](_0xbeaa('0x9f')),'read':!![],'MailAccountId':_0x12b5ae['id'],'UserId':_0x2af568[_0xbeaa('0x74')]['id'],'ContactId':_0x3167b0['id']})]};if(_0x2af568[_0xbeaa('0x5d')][_0xbeaa('0xb5')]){_0x1c30c3=_['merge'](_0x1c30c3,_0x2af568['body'][_0xbeaa('0xb5')]);}return db[_0xbeaa('0x89')][_0xbeaa('0x61')](_0x1c30c3,{'include':[{'model':db[_0xbeaa('0x9b')],'as':_0xbeaa('0xb6')}]});}})[_0xbeaa('0x22')](respondWithResult(_0x1ea4ad,null))['catch'](handleError(_0x1ea4ad,null));};exports[_0xbeaa('0xb7')]=function(_0x3c0b78,_0x695e61,_0xdf89ac){return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x3c0b78[_0xbeaa('0x59')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x695e61,null))[_0xbeaa('0x22')](function(_0x39ecc5){if(_0x39ecc5&&_0x39ecc5[_0xbeaa('0x5b')]){var _0x4e163f={'id':_0x39ecc5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0x7b')]){_0x4e163f[_0xbeaa('0x7b')]=_0x39ecc5['Smtp'][_0xbeaa('0x7b')];}else{_0x4e163f['host']=_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0x79')];_0x4e163f[_0xbeaa('0x7a')]=_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0x7a')];_0x4e163f['secure']=_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0xad')];}if(_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0x78')]){_0x4e163f['auth']={'user':_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0x74')],'pass':_0x39ecc5[_0xbeaa('0x5b')][_0xbeaa('0xae')]};}return respondWithRpcPromise(_0xbeaa('0xb8'),'verifySmtp',{'account':_0x4e163f});}})['then'](respondWithResult(_0x695e61,null))[_0xbeaa('0x2b')](handleError(_0x695e61,null));};exports[_0xbeaa('0x36')]=function(_0x6f84ef,_0xfb08c1){return db[_0xbeaa('0x40')]['find']({'where':{'id':_0x6f84ef[_0xbeaa('0x59')]['id']}})['then'](handleEntityNotFound(_0xfb08c1,null))['then'](function(_0x3ec1dc){if(_0x3ec1dc&&_0x3ec1dc[_0xbeaa('0x7b')]){throw new db[(_0xbeaa('0xb9'))][(_0xbeaa('0xba'))](_0xbeaa('0xbb'));}return _0x3ec1dc;})[_0xbeaa('0x22')](removeEntity(_0xfb08c1,null))[_0xbeaa('0x2b')](handleError(_0xfb08c1,null));};exports[_0xbeaa('0xbc')]=function(_0x50c664,_0xcfacdb,_0x3bd9fe){return db['MailAccount'][_0xbeaa('0x5c')]({'where':{'id':_0x50c664[_0xbeaa('0x59')]['id']}})['then'](handleEntityNotFound(_0xcfacdb,null))[_0xbeaa('0x22')](function(_0x8b3afa){if(_0x8b3afa){return _0x8b3afa[_0xbeaa('0xbc')](_0x50c664['body']['ids'],_[_0xbeaa('0xbd')](_0x50c664[_0xbeaa('0x5d')],[_0xbeaa('0x67'),'id'])||{})[_0xbeaa('0xbe')](function(_0x13bf25){for(var _0xdd64ed=0x0;_0xdd64ed<_0x50c664['body']['ids'][_0xbeaa('0x49')];_0xdd64ed+=0x1){socket[_0xbeaa('0xbf')]('userMailAccount:save',{'UserId':_0x50c664[_0xbeaa('0x5d')][_0xbeaa('0x67')][_0xdd64ed],'MailAccountId':_0x50c664[_0xbeaa('0x59')]['id']});}return _0x13bf25;});}})[_0xbeaa('0x22')](respondWithResult(_0xcfacdb,null))['catch'](handleError(_0xcfacdb,null));};exports[_0xbeaa('0xc0')]=function(_0x24299d,_0x4161fc,_0x41cbf1){return db[_0xbeaa('0x40')][_0xbeaa('0x5c')]({'where':{'id':_0x24299d['params']['id']}})[_0xbeaa('0x22')](handleEntityNotFound(_0x4161fc,null))['then'](function(_0x57ad8a){if(_0x57ad8a){return _0x57ad8a['removeAgents'](_0x24299d[_0xbeaa('0x43')][_0xbeaa('0x67')])['then'](function(){if(_[_0xbeaa('0xc1')](_0x24299d[_0xbeaa('0x43')][_0xbeaa('0x67')])){for(var _0x44d55d=0x0;_0x44d55d<_0x24299d[_0xbeaa('0x43')][_0xbeaa('0x67')][_0xbeaa('0x49')];_0x44d55d+=0x1){socket[_0xbeaa('0xbf')](_0xbeaa('0xc2'),{'UserId':Number(_0x24299d[_0xbeaa('0x43')][_0xbeaa('0x67')][_0x44d55d]),'MailAccountId':Number(_0x24299d[_0xbeaa('0x59')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x24299d[_0xbeaa('0x43')][_0xbeaa('0x67')]),'MailAccountId':Number(_0x24299d[_0xbeaa('0x59')]['id'])});}});}})[_0xbeaa('0x22')](respondWithStatusCode(_0x4161fc,null))[_0xbeaa('0x2b')](handleError(_0x4161fc,null));};exports['getAgents']=function(_0x1b0ce4,_0x13c2b8,_0x286c51){var _0x413297={};var _0x49e93d={};var _0x49bdb1;var _0xed3afa;return db['MailAccount'][_0xbeaa('0x63')]({'where':{'id':_0x1b0ce4['params']['id']}})['then'](handleEntityNotFound(_0x13c2b8,null))['then'](function(_0x30cb89){if(_0x30cb89){_0x49bdb1=_0x30cb89;_0x49e93d['model']=_[_0xbeaa('0x44')](db[_0xbeaa('0x8c')]['rawAttributes']);_0x49e93d['query']=_['keys'](_0x1b0ce4[_0xbeaa('0x43')]);_0x49e93d['filters']=_[_0xbeaa('0x46')](_0x49e93d[_0xbeaa('0x42')],_0x49e93d[_0xbeaa('0x43')]);_0x413297['attributes']=_['intersection'](_0x49e93d[_0xbeaa('0x42')],qs['fields'](_0x1b0ce4[_0xbeaa('0x43')][_0xbeaa('0x48')]));_0x413297[_0xbeaa('0x47')]=_0x413297['attributes'][_0xbeaa('0x49')]?_0x413297[_0xbeaa('0x47')]:_0x49e93d[_0xbeaa('0x42')];_0x413297[_0xbeaa('0x4c')]=qs[_0xbeaa('0x4d')](_0x1b0ce4[_0xbeaa('0x43')][_0xbeaa('0x4d')]);_0x413297[_0xbeaa('0x4e')]=qs[_0xbeaa('0x45')](_[_0xbeaa('0x4f')](_0x1b0ce4[_0xbeaa('0x43')],_0x49e93d[_0xbeaa('0x45')]));if(_0x1b0ce4['query']['filter']){_0x413297['where']=_[_0xbeaa('0x51')](_0x413297[_0xbeaa('0x4e')],{'$or':_[_0xbeaa('0x65')](_0x413297[_0xbeaa('0x47')],function(_0x1d1e1b){var _0x14aa77={};_0x14aa77[_0x1d1e1b]={'$like':'%'+_0x1b0ce4['query'][_0xbeaa('0x50')]+'%'};return _0x14aa77;})});}_0x413297=_['merge']({},_0x413297,_0x1b0ce4[_0xbeaa('0x54')]);return _0x49bdb1['getAgents'](_0x413297);}})[_0xbeaa('0x22')](function(_0x4f6ada){if(_0x4f6ada){_0xed3afa=_0x4f6ada[_0xbeaa('0x49')];if(!_0x1b0ce4[_0xbeaa('0x43')][_0xbeaa('0x4a')](_0xbeaa('0x4b'))){_0x413297[_0xbeaa('0x31')]=qs[_0xbeaa('0x31')](_0x1b0ce4[_0xbeaa('0x43')][_0xbeaa('0x31')]);_0x413297[_0xbeaa('0x30')]=qs[_0xbeaa('0x30')](_0x1b0ce4[_0xbeaa('0x43')]['offset']);}return _0x49bdb1['getAgents'](_0x413297);}})['then'](function(_0x4f8950){if(_0x4f8950){return _0x4f8950?{'count':_0xed3afa,'rows':_0x4f8950}:null;}})[_0xbeaa('0x22')](respondWithResult(_0x13c2b8,null))[_0xbeaa('0x2b')](handleError(_0x13c2b8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 20f4f23..989eddc 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 _0xeaf8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xc8dea4,_0x2878ed){var _0x525e5d=function(_0x43912f){while(--_0x43912f){_0xc8dea4['push'](_0xc8dea4['shift']());}};_0x525e5d(++_0x2878ed);}(_0xeaf8,0xd2));var _0x8eaf=function(_0x3baf3d,_0x25324b){_0x3baf3d=_0x3baf3d-0x0;var _0x436e3b=_0xeaf8[_0x3baf3d];return _0x436e3b;};'use strict';var EventEmitter=require(_0x8eaf('0x0'));var MailAccount=require(_0x8eaf('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8eaf('0x2')](0x0);var events={'afterCreate':_0x8eaf('0x3'),'afterUpdate':_0x8eaf('0x4'),'afterDestroy':_0x8eaf('0x5')};function emitEvent(_0x2238f4){return function(_0x258591,_0x27c405,_0x2d1853){MailAccountEvents['emit'](_0x2238f4+':'+_0x258591['id'],_0x258591);MailAccountEvents['emit'](_0x2238f4,_0x258591);_0x2d1853(null);};}for(var e in events){if(events[_0x8eaf('0x6')](e)){var event=events[e];MailAccount[_0x8eaf('0x7')](e,emitEvent(event));}}module[_0x8eaf('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x8df9=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update'];(function(_0x1513f8,_0x5c646f){var _0x588c30=function(_0x13217c){while(--_0x13217c){_0x1513f8['push'](_0x1513f8['shift']());}};_0x588c30(++_0x5c646f);}(_0x8df9,0x195));var _0x98df=function(_0xa6fe12,_0x34000c){_0xa6fe12=_0xa6fe12-0x0;var _0x3ae117=_0x8df9[_0xa6fe12];return _0x3ae117;};'use strict';var EventEmitter=require(_0x98df('0x0'));var MailAccount=require(_0x98df('0x1'))['db'][_0x98df('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98df('0x3'),'afterUpdate':_0x98df('0x4'),'afterDestroy':_0x98df('0x5')};function emitEvent(_0x56efa8){return function(_0x589ca2,_0x1dbb1b,_0x52aa31){MailAccountEvents[_0x98df('0x6')](_0x56efa8+':'+_0x589ca2['id'],_0x589ca2);MailAccountEvents[_0x98df('0x6')](_0x56efa8,_0x589ca2);_0x52aa31(null);};}for(var e in events){if(events[_0x98df('0x7')](e)){var event=events[e];MailAccount[_0x98df('0x8')](e,emitEvent(event));}}module[_0x98df('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 770f783..1c56d19 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 _0x1cbc=['../../config/environment','./mailAccount.attributes','exports','MailAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a3a23,_0x526932){var _0x28e553=function(_0xafecef){while(--_0xafecef){_0x4a3a23['push'](_0x4a3a23['shift']());}};_0x28e553(++_0x526932);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x42701f,_0x3d2f90){_0x42701f=_0x42701f-0x0;var _0x36aafb=_0x1cbc[_0x42701f];return _0x36aafb;};'use strict';var _=require(_0xc1cb('0x0'));var util=require('util');var logger=require(_0xc1cb('0x1'))(_0xc1cb('0x2'));var moment=require(_0xc1cb('0x3'));var BPromise=require(_0xc1cb('0x4'));var rp=require(_0xc1cb('0x5'));var fs=require('fs');var path=require(_0xc1cb('0x6'));var rimraf=require(_0xc1cb('0x7'));var config=require(_0xc1cb('0x8'));var attributes=require(_0xc1cb('0x9'));module[_0xc1cb('0xa')]=function(_0x1dacec,_0x27423b){return _0x1dacec['define'](_0xc1cb('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80e0=['rimraf','./mailAccount.attributes','exports','mail_accounts','../../config/logger','api','moment','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80e0,0x9d));var _0x080e=function(_0x1c54f5,_0x402e40){_0x1c54f5=_0x1c54f5-0x0;var _0x32ea68=_0x80e0[_0x1c54f5];return _0x32ea68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x080e('0x0'))(_0x080e('0x1'));var moment=require(_0x080e('0x2'));var BPromise=require('bluebird');var rp=require(_0x080e('0x3'));var fs=require('fs');var path=require(_0x080e('0x4'));var rimraf=require(_0x080e('0x5'));var config=require('../../config/environment');var attributes=require(_0x080e('0x6'));module[_0x080e('0x7')]=function(_0x307481,_0x52548f){return _0x307481['define']('MailAccount',attributes,{'tableName':_0x080e('0x8'),'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 d58f424..4f2dc63 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 _0x7664=['client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','options','raw','where','limit','include','model','map','attributes','info','debug','GetMailAccount','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','List','applications','orderBy','priority','autoclose','push','length','*,*,*,*','from','create','List\x20not\x20found','contact','messageId','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','originCc','bcc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5488ce,_0x3999ff){var _0x37f4af=function(_0x3f4dce){while(--_0x3f4dce){_0x5488ce['push'](_0x5488ce['shift']());}};_0x37f4af(++_0x3999ff);}(_0x7664,0x1f2));var _0x4766=function(_0x3af72e,_0x48db7b){_0x3af72e=_0x3af72e-0x0;var _0x581723=_0x7664[_0x3af72e];return _0x581723;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4766('0x0'));var BPromise=require(_0x4766('0x1'));var rs=require(_0x4766('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4766('0x3'))['db'];var utils=require(_0x4766('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4766('0x5'));var jayson=require(_0x4766('0x6'));var client=jayson[_0x4766('0x7')][_0x4766('0x8')]({'port':0x232c});config['redis']=_[_0x4766('0x9')](config[_0x4766('0xa')],{'host':_0x4766('0xb'),'port':0x18eb});var socket=require(_0x4766('0xc'))(new Redis(config[_0x4766('0xa')]));require(_0x4766('0xd'))[_0x4766('0xe')](socket);function respondWithRpcPromise(_0x48fb7d,_0x23d3a2,_0x43e05c){return new BPromise(function(_0x2fd85e,_0x3513cd){return client[_0x4766('0xf')](_0x48fb7d,_0x43e05c)[_0x4766('0x10')](function(_0x57418c){logger['info'](_0x4766('0x11'),_0x23d3a2,'request\x20sent');logger['debug'](_0x4766('0x12'),_0x23d3a2,_0x4766('0x13'),JSON[_0x4766('0x14')](_0x57418c));if(_0x57418c[_0x4766('0x15')]){if(_0x57418c[_0x4766('0x15')][_0x4766('0x16')]===0x1f4){logger['error'](_0x4766('0x11'),_0x23d3a2,_0x57418c['error'][_0x4766('0x17')]);return _0x3513cd(_0x57418c[_0x4766('0x15')][_0x4766('0x17')]);}logger[_0x4766('0x15')](_0x4766('0x11'),_0x23d3a2,_0x57418c[_0x4766('0x15')][_0x4766('0x17')]);return _0x2fd85e(_0x57418c[_0x4766('0x15')]['message']);}else{logger['info'](_0x4766('0x11'),_0x23d3a2,_0x4766('0x13'));_0x2fd85e(_0x57418c[_0x4766('0x18')][_0x4766('0x17')]);}})[_0x4766('0x19')](function(_0x2c74a4){logger[_0x4766('0x15')](_0x4766('0x11'),_0x23d3a2,_0x2c74a4);_0x3513cd(_0x2c74a4);});});}exports['GetMailAccount']=function(_0x52cad5){var _0x15e422=this;return new Promise(function(_0x5afc31,_0x1d862a){return db[_0x4766('0x1a')]['findAll']({'raw':_0x52cad5[_0x4766('0x1b')]?_0x52cad5[_0x4766('0x1b')][_0x4766('0x1c')]===undefined?!![]:![]:!![],'where':_0x52cad5[_0x4766('0x1b')]?_0x52cad5['options'][_0x4766('0x1d')]||null:null,'attributes':_0x52cad5[_0x4766('0x1b')]?_0x52cad5[_0x4766('0x1b')]['attributes']||null:null,'limit':_0x52cad5[_0x4766('0x1b')]?_0x52cad5['options'][_0x4766('0x1e')]||null:null,'include':_0x52cad5[_0x4766('0x1b')]?_0x52cad5[_0x4766('0x1b')][_0x4766('0x1f')]?_['map'](_0x52cad5[_0x4766('0x1b')][_0x4766('0x1f')],function(_0x6f432d){return{'model':db[_0x6f432d[_0x4766('0x20')]],'as':_0x6f432d['as'],'attributes':_0x6f432d['attributes'],'include':_0x6f432d[_0x4766('0x1f')]?_[_0x4766('0x21')](_0x6f432d[_0x4766('0x1f')],function(_0x10ee8e){return{'model':db[_0x10ee8e[_0x4766('0x20')]],'as':_0x10ee8e['as'],'attributes':_0x10ee8e[_0x4766('0x22')],'include':_0x10ee8e[_0x4766('0x1f')]?_[_0x4766('0x21')](_0x10ee8e['include'],function(_0x236e5f){return{'model':db[_0x236e5f[_0x4766('0x20')]],'as':_0x236e5f['as'],'attributes':_0x236e5f[_0x4766('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b42f1){logger[_0x4766('0x23')]('GetMailAccount',_0x52cad5);logger[_0x4766('0x24')]('GetMailAccount',_0x52cad5,JSON['stringify'](_0x2b42f1));_0x5afc31(_0x2b42f1);})[_0x4766('0x19')](function(_0x461889){logger[_0x4766('0x15')](_0x4766('0x25'),_0x461889['message'],_0x52cad5);_0x1d862a(_0x15e422[_0x4766('0x15')](0x1f4,_0x461889['message']));});});};exports[_0x4766('0x26')]=function(_0x718e88){var _0x57e827=this;return new Promise(function(_0x383709,_0x33c14a){return db[_0x4766('0x1a')][_0x4766('0x27')]({'raw':_0x718e88[_0x4766('0x1b')]?_0x718e88[_0x4766('0x1b')][_0x4766('0x1c')]===undefined?!![]:![]:!![],'where':_0x718e88['options']?_0x718e88[_0x4766('0x1b')][_0x4766('0x1d')]||null:null,'attributes':_0x718e88[_0x4766('0x1b')]?_0x718e88[_0x4766('0x1b')][_0x4766('0x22')]||null:null,'include':_0x718e88[_0x4766('0x1b')]?_0x718e88[_0x4766('0x1b')][_0x4766('0x1f')]?_[_0x4766('0x21')](_0x718e88[_0x4766('0x1b')][_0x4766('0x1f')],function(_0x480dc7){return{'model':db[_0x480dc7[_0x4766('0x20')]],'as':_0x480dc7['as'],'attributes':_0x480dc7[_0x4766('0x22')],'include':_0x480dc7['include']?_['map'](_0x480dc7[_0x4766('0x1f')],function(_0x55bc45){return{'model':db[_0x55bc45[_0x4766('0x20')]],'as':_0x55bc45['as'],'attributes':_0x55bc45['attributes'],'include':_0x55bc45['include']?_[_0x4766('0x21')](_0x55bc45[_0x4766('0x1f')],function(_0x5b203f){return{'model':db[_0x5b203f[_0x4766('0x20')]],'as':_0x5b203f['as'],'attributes':_0x5b203f[_0x4766('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4766('0x10')](function(_0x2535c8){logger['info'](_0x4766('0x26'),_0x718e88);logger[_0x4766('0x24')](_0x4766('0x26'),_0x718e88,JSON[_0x4766('0x14')](_0x2535c8));_0x383709(_0x2535c8);})[_0x4766('0x19')](function(_0x3d756a){logger[_0x4766('0x15')](_0x4766('0x26'),_0x3d756a[_0x4766('0x17')],_0x718e88);_0x33c14a(_0x57e827[_0x4766('0x15')](0x1f4,_0x3d756a[_0x4766('0x17')]));});});};exports[_0x4766('0x28')]=function(_0x2670b3){var _0x23c6ae=this;return new Promise(function(_0x44d4c0,_0x38a9e8){var _0x586ed5={'body':_0x2670b3[_0x4766('0x29')],'channel':_0x4766('0x2a')};var _0x22c06f=_[_0x4766('0x2b')](_[_0x4766('0x2c')](db[_0x4766('0x2d')][_0x4766('0x2e')]),[_0x4766('0x2f'),_0x4766('0x30'),_0x4766('0x31'),_0x4766('0x32')]);var _0x293a10=![];if(_0x2670b3[_0x4766('0x29')]['id']){delete _0x2670b3[_0x4766('0x29')]['id'];}if(_['isNil'](_0x2670b3[_0x4766('0x29')]['from'])){return _0x38a9e8(_0x23c6ae[_0x4766('0x15')](0x1f4,_0x4766('0x33')));}if(_[_0x4766('0x34')](_0x2670b3['body'][_0x4766('0x29')])||_0x2670b3[_0x4766('0x29')][_0x4766('0x29')]===''){return _0x38a9e8(_0x23c6ae['error'](0x1f4,_0x4766('0x35')));}if(_[_0x4766('0x34')](_0x2670b3['body']['mapKey'])){return _0x38a9e8(_0x23c6ae[_0x4766('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22c06f));}if(!_[_0x4766('0x36')](_0x22c06f,_0x2670b3[_0x4766('0x29')][_0x4766('0x37')])){return _0x38a9e8(_0x23c6ae[_0x4766('0x15')](0x1f4,_0x4766('0x38')+_0x22c06f));}var _0x1241d0={};_0x1241d0[_0x2670b3[_0x4766('0x29')][_0x4766('0x37')]]=_0x2670b3[_0x4766('0x29')]['from'];return db[_0x4766('0x1a')][_0x4766('0x27')]({'where':{'id':_0x2670b3[_0x4766('0x39')]['id']},'include':[{'model':db[_0x4766('0x3a')],'as':'List','include':[{'model':db[_0x4766('0x2d')],'as':_0x4766('0x3b'),'where':_0x1241d0,'limit':0x1,'order':[[_0x4766('0x30'),_0x4766('0x3c')]]}]},{'model':db[_0x4766('0x3d')],'as':_0x4766('0x3e')},{'model':db[_0x4766('0x3f')],'as':'Smtp'}]})[_0x4766('0x10')](function(_0xdaf0bb){if(_0xdaf0bb&&_0xdaf0bb[_0x4766('0x40')]){var _0x413e31=_0xdaf0bb['get']({'plain':!![]});_0x586ed5['account']=_['omit'](_0x413e31,[_0x4766('0x3e'),_0x4766('0x40')]);_0x586ed5[_0x4766('0x41')]=_0x413e31[_0x4766('0x3e')];_0x586ed5['list']=_0x413e31['List'];_0x586ed5[_0x4766('0x41')]=_[_0x4766('0x42')](_0x586ed5[_0x4766('0x41')],[_0x4766('0x43')],['asc']);if(_0x586ed5[_0x4766('0x39')]&&_0x586ed5[_0x4766('0x39')][_0x4766('0x44')]){_0x586ed5[_0x4766('0x41')][_0x4766('0x45')]({'id':0x0,'priority':_0x586ed5[_0x4766('0x41')][_0x4766('0x46')]+0x1,'app':'close','appdata':_0x4766('0x44'),'interval':_0x4766('0x47')});}if(_0x586ed5['account'][_0x4766('0x3e')]){delete _0x586ed5[_0x4766('0x39')][_0x4766('0x3e')];}if(_0x586ed5[_0x4766('0x39')]['List']){delete _0x586ed5['account']['List'];}if(_0x413e31[_0x4766('0x40')][_0x4766('0x3b')][_0x4766('0x46')]){return _0x413e31[_0x4766('0x40')][_0x4766('0x3b')][0x0];}var _0x2515be=_['defaults'](_0x2670b3[_0x4766('0x29')],{'firstName':_0x2670b3[_0x4766('0x29')][_0x4766('0x48')],'ListId':_0x413e31[_0x4766('0x32')]});_0x2515be[_0x2670b3[_0x4766('0x29')][_0x4766('0x37')]]=_0x2670b3[_0x4766('0x29')]['from'];return db[_0x4766('0x2d')][_0x4766('0x49')](_0x2515be);}else{throw new Error(_0x4766('0x4a'));}})[_0x4766('0x10')](function(_0x72a108){_0x586ed5[_0x4766('0x4b')]=_0x72a108;if(_0x72a108){if(!_0x2670b3['body'][_0x4766('0x17')][_0x4766('0x4c')]){_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x4c')]=rs['generate']()+'\x20'+_0x2670b3[_0x4766('0x29')]['message'][_0x4766('0x48')];}var _0x3cc46b={'ContactId':_0x72a108['id'],'MailAccountId':_0x2670b3[_0x4766('0x39')]['id'],'inReplyTo':_0x2670b3[_0x4766('0x29')]['message']['messageId'],'to':_0x2670b3[_0x4766('0x29')]['message'][_0x4766('0x48')],'cc':_0x2670b3['body'][_0x4766('0x17')]['cc'],'subject':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')]['subject'],'attach':_0x2670b3['body']['message'][_0x4766('0x4d')],'lastMsgAt':moment()[_0x4766('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2670b3['body'][_0x4766('0x29')]};return db[_0x4766('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0x2670b3[_0x4766('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':_0x4766('0x50'),'attributes':[_0x4766('0x4c')],'where':{'messageId':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x51')]}}]})['then'](function(_0x29eb7a){if(_0x29eb7a){return[_0x29eb7a,![]];}return db[_0x4766('0x4f')]['create'](_0x3cc46b)[_0x4766('0x10')](function(_0x2884cf){return[_0x2884cf,!![]];});});}else{throw new Error(_0x4766('0x52'));}})[_0x4766('0x53')](function(_0x5622df,_0x1ca510){if(_0x5622df){_0x293a10=_0x1ca510;if(!_0x1ca510){return _0x5622df[_0x4766('0x54')]({'inReplyTo':_0x2670b3['body'][_0x4766('0x17')][_0x4766('0x4c')],'to':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x48')],'cc':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')]['cc'],'subject':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x55')],'attach':_0x5622df[_0x4766('0x4d')]?_0x5622df[_0x4766('0x4d')]:_0x2670b3[_0x4766('0x29')]['message'][_0x4766('0x4d')],'substatus':null,'substatusAt':moment()[_0x4766('0x4e')](_0x4766('0x56')),'lastMsgAt':moment()['format'](_0x4766('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x2670b3[_0x4766('0x29')]['body']});}else{return _0x5622df;}}})[_0x4766('0x10')](function(_0x2aec3c){_0x586ed5[_0x4766('0x57')]=_0x2aec3c['get']({'plain':!![]});_0x586ed5[_0x4766('0x57')][_0x4766('0x58')]=_0x293a10;return db[_0x4766('0x59')][_0x4766('0x49')]({'body':_0x2670b3[_0x4766('0x29')][_0x4766('0x29')],'MailAccountId':_0x2670b3['account']['id'],'MailInteractionId':_0x2aec3c['id'],'direction':'in','ContactId':_0x586ed5[_0x4766('0x4b')]['id'],'messageId':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x4c')],'from':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x48')],'to':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')]['to'],'cc':_0x2670b3['body']['message']['cc'],'subject':_0x2670b3['body'][_0x4766('0x17')][_0x4766('0x55')],'attach':_0x2670b3['body'][_0x4766('0x17')][_0x4766('0x4d')],'Attachments':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')]['attachments'],'originTo':_0x2670b3[_0x4766('0x29')]['message']['originTo'],'originCc':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x5a')],'bcc':_0x2670b3[_0x4766('0x29')][_0x4766('0x17')][_0x4766('0x5b')]},{'include':[{'model':db[_0x4766('0x5c')],'as':'Attachments'}]});})[_0x4766('0x10')](function(_0x1c73ce){_0x586ed5[_0x4766('0x17')]=_0x1c73ce;if(_0x586ed5[_0x4766('0x57')][_0x4766('0x5d')]){return db[_0x4766('0x5e')][_0x4766('0x27')]({'attributes':['id',_0x4766('0x5f')],'where':{'id':_0x586ed5[_0x4766('0x57')]['UserId']}})['then'](function(_0xdd9f09){if(_0xdd9f09){_0x586ed5[_0x4766('0x41')][_0x4766('0x60')]({'id':0x0,'priority':0x0,'app':_0x4766('0x61'),'appdata':_0xdd9f09[_0x4766('0x5f')]+','+(_0x586ed5[_0x4766('0x39')][_0x4766('0x62')]||0xa),'interval':_0x4766('0x47')});}return respondWithRpcPromise(_0x4766('0x63'),'startRouting',_0x586ed5);});}return respondWithRpcPromise(_0x4766('0x63'),_0x4766('0x64'),_0x586ed5);})[_0x4766('0x10')](function(_0x454d8e){_0x44d4c0(_0x454d8e);})[_0x4766('0x19')](function(_0x13fb60){_0x38a9e8(_0x23c6ae[_0x4766('0x15')](0x1f4,_0x13fb60['message']));});});}; \ No newline at end of file +var _0x2699=['List\x20not\x20found','contact','messageId','generate','subject','attach','format','find','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','model','include','ShowMailAccount','MailAccount','map','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','List','get','account','omit','applications','list','priority','asc','length','close','autoclose','*,*,*,*','create'];(function(_0x20bf9c,_0x2feee7){var _0x45dd7c=function(_0x241d75){while(--_0x241d75){_0x20bf9c['push'](_0x20bf9c['shift']());}};_0x45dd7c(++_0x2feee7);}(_0x2699,0x151));var _0x9269=function(_0x35d1f5,_0x3a0809){_0x35d1f5=_0x35d1f5-0x0;var _0x2f2634=_0x2699[_0x35d1f5];return _0x2f2634;};'use strict';var _=require(_0x9269('0x0'));var util=require(_0x9269('0x1'));var moment=require(_0x9269('0x2'));var BPromise=require(_0x9269('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9269('0x4'));var db=require(_0x9269('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9269('0x6'))(_0x9269('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9269('0x8')]({'port':0x232c});config['redis']=_[_0x9269('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9269('0xa'))(new Redis(config['redis']));require(_0x9269('0xb'))[_0x9269('0xc')](socket);function respondWithRpcPromise(_0x31fd4f,_0x5d379f,_0x1dd697){return new BPromise(function(_0x154c84,_0x558291){return client[_0x9269('0xd')](_0x31fd4f,_0x1dd697)[_0x9269('0xe')](function(_0x998c9d){logger['info'](_0x9269('0xf'),_0x5d379f,'request\x20sent');logger[_0x9269('0x10')](_0x9269('0x11'),_0x5d379f,_0x9269('0x12'),JSON[_0x9269('0x13')](_0x998c9d));if(_0x998c9d[_0x9269('0x14')]){if(_0x998c9d['error'][_0x9269('0x15')]===0x1f4){logger[_0x9269('0x14')](_0x9269('0xf'),_0x5d379f,_0x998c9d[_0x9269('0x14')][_0x9269('0x16')]);return _0x558291(_0x998c9d[_0x9269('0x14')][_0x9269('0x16')]);}logger[_0x9269('0x14')](_0x9269('0xf'),_0x5d379f,_0x998c9d[_0x9269('0x14')][_0x9269('0x16')]);return _0x154c84(_0x998c9d[_0x9269('0x14')][_0x9269('0x16')]);}else{logger[_0x9269('0x17')](_0x9269('0xf'),_0x5d379f,_0x9269('0x12'));_0x154c84(_0x998c9d['result'][_0x9269('0x16')]);}})[_0x9269('0x18')](function(_0x11e585){logger[_0x9269('0x14')](_0x9269('0xf'),_0x5d379f,_0x11e585);_0x558291(_0x11e585);});});}exports[_0x9269('0x19')]=function(_0x4a9b0c){var _0x4ea2aa=this;return new Promise(function(_0x20ca81,_0x1a9a26){return db['MailAccount'][_0x9269('0x1a')]({'raw':_0x4a9b0c[_0x9269('0x1b')]?_0x4a9b0c['options'][_0x9269('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a9b0c['options']?_0x4a9b0c[_0x9269('0x1b')][_0x9269('0x1d')]||null:null,'attributes':_0x4a9b0c[_0x9269('0x1b')]?_0x4a9b0c[_0x9269('0x1b')][_0x9269('0x1e')]||null:null,'limit':_0x4a9b0c['options']?_0x4a9b0c['options'][_0x9269('0x1f')]||null:null,'include':_0x4a9b0c[_0x9269('0x1b')]?_0x4a9b0c[_0x9269('0x1b')]['include']?_['map'](_0x4a9b0c[_0x9269('0x1b')]['include'],function(_0x37ce03){return{'model':db[_0x37ce03[_0x9269('0x20')]],'as':_0x37ce03['as'],'attributes':_0x37ce03[_0x9269('0x1e')],'include':_0x37ce03['include']?_['map'](_0x37ce03[_0x9269('0x21')],function(_0x1e051e){return{'model':db[_0x1e051e[_0x9269('0x20')]],'as':_0x1e051e['as'],'attributes':_0x1e051e[_0x9269('0x1e')],'include':_0x1e051e[_0x9269('0x21')]?_['map'](_0x1e051e[_0x9269('0x21')],function(_0x30da5e){return{'model':db[_0x30da5e[_0x9269('0x20')]],'as':_0x30da5e['as'],'attributes':_0x30da5e[_0x9269('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9269('0xe')](function(_0x127b92){logger[_0x9269('0x17')]('GetMailAccount',_0x4a9b0c);logger['debug'](_0x9269('0x19'),_0x4a9b0c,JSON[_0x9269('0x13')](_0x127b92));_0x20ca81(_0x127b92);})['catch'](function(_0x21a701){logger[_0x9269('0x14')](_0x9269('0x19'),_0x21a701[_0x9269('0x16')],_0x4a9b0c);_0x1a9a26(_0x4ea2aa[_0x9269('0x14')](0x1f4,_0x21a701[_0x9269('0x16')]));});});};exports[_0x9269('0x22')]=function(_0x498e5a){var _0x8682a=this;return new Promise(function(_0x5a6291,_0x4edea1){return db[_0x9269('0x23')]['find']({'raw':_0x498e5a[_0x9269('0x1b')]?_0x498e5a[_0x9269('0x1b')][_0x9269('0x1c')]===undefined?!![]:![]:!![],'where':_0x498e5a[_0x9269('0x1b')]?_0x498e5a[_0x9269('0x1b')][_0x9269('0x1d')]||null:null,'attributes':_0x498e5a[_0x9269('0x1b')]?_0x498e5a['options'][_0x9269('0x1e')]||null:null,'include':_0x498e5a['options']?_0x498e5a[_0x9269('0x1b')][_0x9269('0x21')]?_[_0x9269('0x24')](_0x498e5a[_0x9269('0x1b')][_0x9269('0x21')],function(_0x7f5ef9){return{'model':db[_0x7f5ef9[_0x9269('0x20')]],'as':_0x7f5ef9['as'],'attributes':_0x7f5ef9[_0x9269('0x1e')],'include':_0x7f5ef9['include']?_[_0x9269('0x24')](_0x7f5ef9['include'],function(_0x12bcd5){return{'model':db[_0x12bcd5[_0x9269('0x20')]],'as':_0x12bcd5['as'],'attributes':_0x12bcd5[_0x9269('0x1e')],'include':_0x12bcd5[_0x9269('0x21')]?_[_0x9269('0x24')](_0x12bcd5[_0x9269('0x21')],function(_0x6ce570){return{'model':db[_0x6ce570[_0x9269('0x20')]],'as':_0x6ce570['as'],'attributes':_0x6ce570[_0x9269('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9269('0xe')](function(_0x4d9ec8){logger[_0x9269('0x17')](_0x9269('0x22'),_0x498e5a);logger[_0x9269('0x10')](_0x9269('0x22'),_0x498e5a,JSON[_0x9269('0x13')](_0x4d9ec8));_0x5a6291(_0x4d9ec8);})['catch'](function(_0x1c19e6){logger['error'](_0x9269('0x22'),_0x1c19e6[_0x9269('0x16')],_0x498e5a);_0x4edea1(_0x8682a[_0x9269('0x14')](0x1f4,_0x1c19e6[_0x9269('0x16')]));});});};exports[_0x9269('0x25')]=function(_0x3d0181){var _0x505daa=this;return new Promise(function(_0xc07dbb,_0x43de1b){var _0x3b7bdf={'body':_0x3d0181[_0x9269('0x26')],'channel':_0x9269('0x27')};var _0x24acc5=_[_0x9269('0x28')](_[_0x9269('0x29')](db[_0x9269('0x2a')][_0x9269('0x2b')]),[_0x9269('0x2c'),'updatedAt','CompanyId',_0x9269('0x2d')]);var _0x422ca5=![];if(_0x3d0181['body']['id']){delete _0x3d0181[_0x9269('0x26')]['id'];}if(_[_0x9269('0x2e')](_0x3d0181[_0x9269('0x26')][_0x9269('0x2f')])){return _0x43de1b(_0x505daa[_0x9269('0x14')](0x1f4,_0x9269('0x30')));}if(_['isNil'](_0x3d0181['body'][_0x9269('0x26')])||_0x3d0181[_0x9269('0x26')]['body']===''){return _0x43de1b(_0x505daa['error'](0x1f4,_0x9269('0x31')));}if(_['isNil'](_0x3d0181[_0x9269('0x26')]['mapKey'])){return _0x43de1b(_0x505daa[_0x9269('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x24acc5));}if(!_['includes'](_0x24acc5,_0x3d0181[_0x9269('0x26')][_0x9269('0x32')])){return _0x43de1b(_0x505daa[_0x9269('0x14')](0x1f4,_0x9269('0x33')+_0x24acc5));}var _0xb8097={};_0xb8097[_0x3d0181['body']['mapKey']]=_0x3d0181[_0x9269('0x26')][_0x9269('0x2f')];return db['MailAccount']['find']({'where':{'id':_0x3d0181['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9269('0x2a')],'as':_0x9269('0x34'),'where':_0xb8097,'limit':0x1,'order':[[_0x9269('0x35'),_0x9269('0x36')]]}]},{'model':db[_0x9269('0x37')],'as':_0x9269('0x38')},{'model':db['MailServerOut'],'as':_0x9269('0x39')}]})[_0x9269('0xe')](function(_0x1b80a5){if(_0x1b80a5&&_0x1b80a5[_0x9269('0x3a')]){var _0x23af4a=_0x1b80a5[_0x9269('0x3b')]({'plain':!![]});_0x3b7bdf[_0x9269('0x3c')]=_[_0x9269('0x3d')](_0x23af4a,['Applications',_0x9269('0x3a')]);_0x3b7bdf[_0x9269('0x3e')]=_0x23af4a[_0x9269('0x38')];_0x3b7bdf[_0x9269('0x3f')]=_0x23af4a[_0x9269('0x3a')];_0x3b7bdf[_0x9269('0x3e')]=_['orderBy'](_0x3b7bdf[_0x9269('0x3e')],[_0x9269('0x40')],[_0x9269('0x41')]);if(_0x3b7bdf['account']&&_0x3b7bdf[_0x9269('0x3c')]['autoclose']){_0x3b7bdf[_0x9269('0x3e')]['push']({'id':0x0,'priority':_0x3b7bdf[_0x9269('0x3e')][_0x9269('0x42')]+0x1,'app':_0x9269('0x43'),'appdata':_0x9269('0x44'),'interval':_0x9269('0x45')});}if(_0x3b7bdf[_0x9269('0x3c')][_0x9269('0x38')]){delete _0x3b7bdf[_0x9269('0x3c')][_0x9269('0x38')];}if(_0x3b7bdf['account'][_0x9269('0x3a')]){delete _0x3b7bdf[_0x9269('0x3c')][_0x9269('0x3a')];}if(_0x23af4a[_0x9269('0x3a')]['Contacts'][_0x9269('0x42')]){return _0x23af4a[_0x9269('0x3a')][_0x9269('0x34')][0x0];}var _0x46a09c=_['defaults'](_0x3d0181['body'],{'firstName':_0x3d0181[_0x9269('0x26')]['from'],'ListId':_0x23af4a[_0x9269('0x2d')]});_0x46a09c[_0x3d0181[_0x9269('0x26')][_0x9269('0x32')]]=_0x3d0181[_0x9269('0x26')][_0x9269('0x2f')];return db[_0x9269('0x2a')][_0x9269('0x46')](_0x46a09c);}else{throw new Error(_0x9269('0x47'));}})[_0x9269('0xe')](function(_0x3851cf){_0x3b7bdf[_0x9269('0x48')]=_0x3851cf;if(_0x3851cf){if(!_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x49')]){_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x49')]=rs[_0x9269('0x4a')]()+'\x20'+_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['from'];}var _0x1d0a38={'ContactId':_0x3851cf['id'],'MailAccountId':_0x3d0181[_0x9269('0x3c')]['id'],'inReplyTo':_0x3d0181[_0x9269('0x26')]['message'][_0x9269('0x49')],'to':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['from'],'cc':_0x3d0181['body'][_0x9269('0x16')]['cc'],'subject':_0x3d0181['body'][_0x9269('0x16')][_0x9269('0x4b')],'attach':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x4c')],'lastMsgAt':moment()[_0x9269('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x3d0181['body'][_0x9269('0x26')]};return db['MailInteraction'][_0x9269('0x4e')]({'where':{'closed':![],'MailAccountId':_0x3d0181[_0x9269('0x3c')]['id']},'include':[{'model':db[_0x9269('0x4f')],'as':_0x9269('0x50'),'attributes':[_0x9269('0x49')],'where':{'messageId':_0x3d0181[_0x9269('0x26')]['message'][_0x9269('0x51')]}}]})['then'](function(_0x115119){if(_0x115119){return[_0x115119,![]];}return db[_0x9269('0x52')]['create'](_0x1d0a38)[_0x9269('0xe')](function(_0x4ad61c){return[_0x4ad61c,!![]];});});}else{throw new Error(_0x9269('0x53'));}})[_0x9269('0x54')](function(_0x5ecb33,_0x2cf366){if(_0x5ecb33){_0x422ca5=_0x2cf366;if(!_0x2cf366){return _0x5ecb33[_0x9269('0x55')]({'inReplyTo':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x49')],'to':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x2f')],'cc':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['cc'],'subject':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x4b')],'attach':_0x5ecb33[_0x9269('0x4c')]?_0x5ecb33[_0x9269('0x4c')]:_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0x9269('0x56')),'lastMsgAt':moment()[_0x9269('0x4d')](_0x9269('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x3d0181['body'][_0x9269('0x26')]});}else{return _0x5ecb33;}}})[_0x9269('0xe')](function(_0x4bd126){_0x3b7bdf[_0x9269('0x57')]=_0x4bd126[_0x9269('0x3b')]({'plain':!![]});_0x3b7bdf[_0x9269('0x57')][_0x9269('0x58')]=_0x422ca5;return db[_0x9269('0x4f')][_0x9269('0x46')]({'body':_0x3d0181[_0x9269('0x26')][_0x9269('0x26')],'MailAccountId':_0x3d0181['account']['id'],'MailInteractionId':_0x4bd126['id'],'direction':'in','ContactId':_0x3b7bdf[_0x9269('0x48')]['id'],'messageId':_0x3d0181[_0x9269('0x26')]['message']['messageId'],'from':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x2f')],'to':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['to'],'cc':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')]['cc'],'subject':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x4b')],'attach':_0x3d0181[_0x9269('0x26')]['message'][_0x9269('0x4c')],'Attachments':_0x3d0181['body'][_0x9269('0x16')]['attachments'],'originTo':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x59')],'originCc':_0x3d0181[_0x9269('0x26')][_0x9269('0x16')][_0x9269('0x5a')],'bcc':_0x3d0181[_0x9269('0x26')]['message'][_0x9269('0x5b')]},{'include':[{'model':db[_0x9269('0x5c')],'as':_0x9269('0x5d')}]});})['then'](function(_0x4943f0){_0x3b7bdf['message']=_0x4943f0;if(_0x3b7bdf['interaction'][_0x9269('0x5e')]){return db[_0x9269('0x5f')][_0x9269('0x4e')]({'attributes':['id',_0x9269('0x60')],'where':{'id':_0x3b7bdf['interaction'][_0x9269('0x5e')]}})[_0x9269('0xe')](function(_0x2b871a){if(_0x2b871a){_0x3b7bdf['applications'][_0x9269('0x61')]({'id':0x0,'priority':0x0,'app':_0x9269('0x62'),'appdata':_0x2b871a[_0x9269('0x60')]+','+(_0x3b7bdf[_0x9269('0x3c')][_0x9269('0x63')]||0xa),'interval':_0x9269('0x45')});}return respondWithRpcPromise(_0x9269('0x64'),'startRouting',_0x3b7bdf);});}return respondWithRpcPromise(_0x9269('0x64'),_0x9269('0x65'),_0x3b7bdf);})['then'](function(_0x5008ff){_0xc07dbb(_0x5008ff);})['catch'](function(_0x5e0b29){_0x43de1b(_0x505daa[_0x9269('0x14')](0x1f4,_0x5e0b29[_0x9269('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 8f37483..d01fa35 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 _0xc144=['save','remove','update','emit','removeListener','register','mailAccount:','./mailAccount.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc144,0x17f));var _0x4c14=function(_0x352992,_0x15168f){_0x352992=_0x352992-0x0;var _0x4ae3cd=_0xc144[_0x352992];return _0x4ae3cd;};'use strict';var MailAccountEvents=require(_0x4c14('0x0'));var events=[_0x4c14('0x1'),_0x4c14('0x2'),_0x4c14('0x3')];function createListener(_0x589e1f,_0x4c9bbd){return function(_0x5157b7){_0x4c9bbd[_0x4c14('0x4')](_0x589e1f,_0x5157b7);};}function removeListener(_0x2658c1,_0x5251d9){return function(){MailAccountEvents[_0x4c14('0x5')](_0x2658c1,_0x5251d9);};}exports[_0x4c14('0x6')]=function(_0x1e9640){for(var _0x4dd064=0x0,_0x5d5f98=events['length'];_0x4dd064<_0x5d5f98;_0x4dd064++){var _0x3d441b=events[_0x4dd064];var _0x2ae77e=createListener(_0x4c14('0x7')+_0x3d441b,_0x1e9640);MailAccountEvents['on'](_0x3d441b,_0x2ae77e);}}; \ No newline at end of file +var _0x9092=['update','emit','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0x496bdc,_0x547762){var _0x3efe07=function(_0x518afd){while(--_0x518afd){_0x496bdc['push'](_0x496bdc['shift']());}};_0x3efe07(++_0x547762);}(_0x9092,0xfb));var _0x2909=function(_0x531105,_0x3e6e37){_0x531105=_0x531105-0x0;var _0x29a3d2=_0x9092[_0x531105];return _0x29a3d2;};'use strict';var MailAccountEvents=require(_0x2909('0x0'));var events=['save','remove',_0x2909('0x1')];function createListener(_0x543bba,_0x112dba){return function(_0x385d49){_0x112dba[_0x2909('0x2')](_0x543bba,_0x385d49);};}function removeListener(_0x1bfc6f,_0x24b366){return function(){MailAccountEvents[_0x2909('0x3')](_0x1bfc6f,_0x24b366);};}exports['register']=function(_0x5d75ad){for(var _0x14337e=0x0,_0x3bc84b=events[_0x2909('0x4')];_0x14337e<_0x3bc84b;_0x14337e++){var _0x2c7207=events[_0x14337e];var _0x2894fd=createListener(_0x2909('0x5')+_0x2c7207,_0x5d75ad);MailAccountEvents['on'](_0x2c7207,_0x2894fd);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 30369b8..a452c70 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 _0x5636=['isAuthenticated','show','put','update','delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5636,0x102));var _0x6563=function(_0x2a02cf,_0x28ca73){_0x2a02cf=_0x2a02cf-0x0;var _0x2e1c8e=_0x5636[_0x2a02cf];return _0x2e1c8e;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var auth=require(_0x6563('0x3'));var interaction=require(_0x6563('0x4'));var config=require('../../config/environment');var controller=require(_0x6563('0x5'));router[_0x6563('0x6')](_0x6563('0x7'),auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0xa')](_0x6563('0x7'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0xc')](_0x6563('0x7'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd52d=['put','update','delete','destroy','exports','util','path','express','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd52d,0x1c7));var _0xdd52=function(_0x35ec6f,_0x343529){_0x35ec6f=_0x35ec6f-0x0;var _0x13db67=_0xd52d[_0x35ec6f];return _0x13db67;};'use strict';var multer=require('multer');var util=require(_0xdd52('0x0'));var path=require(_0xdd52('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd52('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdd52('0x3'));var config=require(_0xdd52('0x4'));var controller=require(_0xdd52('0x5'));router[_0xdd52('0x6')](_0xdd52('0x7'),auth[_0xdd52('0x8')](),controller[_0xdd52('0x9')]);router[_0xdd52('0xa')]('/:id',auth[_0xdd52('0x8')](),controller[_0xdd52('0xb')]);router[_0xdd52('0xc')](_0xdd52('0x7'),auth[_0xdd52('0x8')](),controller[_0xdd52('0xd')]);module[_0xdd52('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ce10834..234d53f 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 _0x4f3d=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0xa8ee35,_0x560499){var _0x1b17fa=function(_0x50ef21){while(--_0x50ef21){_0xa8ee35['push'](_0xa8ee35['shift']());}};_0x1b17fa(++_0x560499);}(_0x4f3d,0x171));var _0xd4f3=function(_0x30fb77,_0xb92d12){_0x30fb77=_0x30fb77-0x0;var _0x3a9d19=_0x4f3d[_0x30fb77];return _0x3a9d19;};'use strict';var Sequelize=require(_0xd4f3('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd4f3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd4f3('0x2')],'allowNull':![],'defaultValue':_0xd4f3('0x3')},'appdata':{'type':Sequelize[_0xd4f3('0x4')]()},'description':{'type':Sequelize[_0xd4f3('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd4f3('0x5')}}; \ No newline at end of file +var _0x8c28=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x12f5ab,_0x1b428c){var _0x2cd1ce=function(_0x26cd6c){while(--_0x26cd6c){_0x12f5ab['push'](_0x12f5ab['shift']());}};_0x2cd1ce(++_0x1b428c);}(_0x8c28,0x1c8));var _0x88c2=function(_0x2b9c5a,_0x5097d3){_0x2b9c5a=_0x2b9c5a-0x0;var _0x33cd56=_0x8c28[_0x2b9c5a];return _0x33cd56;};'use strict';var Sequelize=require(_0x88c2('0x0'));module[_0x88c2('0x1')]={'priority':{'type':Sequelize[_0x88c2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88c2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x88c2('0x4')]()},'description':{'type':Sequelize[_0x88c2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x88c2('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index dc5a4ae..54417ed 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 _0xffe1=['send','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','catch','body','MailApplication','find','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x5b78b2,_0x5ea40c){var _0x968e57=function(_0x257ca3){while(--_0x257ca3){_0x5b78b2['push'](_0x5b78b2['shift']());}};_0x968e57(++_0x5ea40c);}(_0xffe1,0x175));var _0x1ffe=function(_0x4d5e52,_0x12aed9){_0x4d5e52=_0x4d5e52-0x0;var _0x3c6be5=_0xffe1[_0x4d5e52];return _0x3c6be5;};'use strict';var pdf=require(_0x1ffe('0x0'));var emlformat=require(_0x1ffe('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ffe('0x2'));var rp=require(_0x1ffe('0x3'));var moment=require(_0x1ffe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ffe('0x5'));var util=require(_0x1ffe('0x6'));var path=require(_0x1ffe('0x7'));var sox=require('sox');var csv=require(_0x1ffe('0x8'));var ejs=require(_0x1ffe('0x9'));var fs=require('fs');var _=require(_0x1ffe('0xa'));var squel=require(_0x1ffe('0xb'));var crypto=require(_0x1ffe('0xc'));var jsforce=require(_0x1ffe('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ffe('0xe'));var Papa=require(_0x1ffe('0xf'));var Redis=require(_0x1ffe('0x10'));var authService=require(_0x1ffe('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1ffe('0x12'));var logger=require(_0x1ffe('0x13'))(_0x1ffe('0x14'));var utils=require(_0x1ffe('0x15'));var config=require(_0x1ffe('0x16'));var db=require(_0x1ffe('0x17'))['db'];function respondWithStatusCode(_0x13757a,_0xc151ee){_0xc151ee=_0xc151ee||0xcc;return function(_0x522efc){if(_0x522efc){return _0x13757a[_0x1ffe('0x18')](_0xc151ee);}return _0x13757a[_0x1ffe('0x19')](_0xc151ee)['end']();};}function respondWithResult(_0x37efcf,_0x3a95e4){_0x3a95e4=_0x3a95e4||0xc8;return function(_0x20b4a8){if(_0x20b4a8){return _0x37efcf[_0x1ffe('0x19')](_0x3a95e4)[_0x1ffe('0x1a')](_0x20b4a8);}};}function respondWithFilteredResult(_0x5ab4b4,_0x972599){return function(_0x23071f){if(_0x23071f){var _0x128ce8=_0x23071f[_0x1ffe('0x1b')],_0x4e344d=_0x972599['offset'],_0x20293f=_0x972599[_0x1ffe('0x1c')]+_0x972599[_0x1ffe('0x1d')],_0x562d65;if(_0x20293f>=_0x128ce8){_0x20293f=_0x128ce8;_0x562d65=0xc8;}else{_0x562d65=0xce;}_0x5ab4b4['status'](_0x562d65);return _0x5ab4b4['set']('Content-Range',_0x4e344d+'-'+_0x20293f+'/'+_0x128ce8)[_0x1ffe('0x1a')](_0x23071f);}return null;};}function patchUpdates(_0x21950f){return function(_0x129865){try{jsonpatch[_0x1ffe('0x1e')](_0x129865,_0x21950f,!![]);}catch(_0x3ebdf0){return BPromise[_0x1ffe('0x1f')](_0x3ebdf0);}return _0x129865[_0x1ffe('0x20')]();};}function saveUpdates(_0x1c87f7,_0x399106){return function(_0x38f189){if(_0x38f189){return _0x38f189[_0x1ffe('0x21')](_0x1c87f7)[_0x1ffe('0x22')](function(_0x54e1d8){return _0x54e1d8;});}return null;};}function removeEntity(_0x50f234,_0xb03d45){return function(_0x3fe038){if(_0x3fe038){return _0x3fe038[_0x1ffe('0x23')]()['then'](function(){_0x50f234['status'](0xcc)[_0x1ffe('0x24')]();});}};}function handleEntityNotFound(_0x200863,_0xa4f69b){return function(_0x4bc6fe){if(!_0x4bc6fe){_0x200863[_0x1ffe('0x18')](0x194);}return _0x4bc6fe;};}function handleError(_0x2d7192,_0x1b4d56){_0x1b4d56=_0x1b4d56||0x1f4;return function(_0x3df636){logger[_0x1ffe('0x25')](_0x3df636[_0x1ffe('0x26')]);if(_0x3df636['name']){delete _0x3df636[_0x1ffe('0x27')];}_0x2d7192[_0x1ffe('0x19')](_0x1b4d56)[_0x1ffe('0x28')](_0x3df636);};}exports[_0x1ffe('0x29')]=function(_0x30291c,_0x114fbe){var _0x29c4d4={'raw':!![],'where':{'id':_0x30291c['params']['id']}},_0x4b2196={};_0x4b2196['model']=_[_0x1ffe('0x2a')](db['MailApplication'][_0x1ffe('0x2b')]);_0x4b2196[_0x1ffe('0x2c')]=_[_0x1ffe('0x2a')](_0x30291c['query']);_0x4b2196[_0x1ffe('0x2d')]=_[_0x1ffe('0x2e')](_0x4b2196[_0x1ffe('0x2f')],_0x4b2196[_0x1ffe('0x2c')]);_0x29c4d4[_0x1ffe('0x30')]=_['intersection'](_0x4b2196[_0x1ffe('0x2f')],qs[_0x1ffe('0x31')](_0x30291c[_0x1ffe('0x2c')][_0x1ffe('0x31')]));_0x29c4d4[_0x1ffe('0x30')]=_0x29c4d4[_0x1ffe('0x30')]['length']?_0x29c4d4[_0x1ffe('0x30')]:_0x4b2196['model'];if(_0x30291c[_0x1ffe('0x2c')][_0x1ffe('0x32')]){_0x29c4d4[_0x1ffe('0x33')]=[{'all':!![]}];}_0x29c4d4=_[_0x1ffe('0x34')]({},_0x29c4d4,_0x30291c[_0x1ffe('0x35')]);return db['MailApplication']['find'](_0x29c4d4)[_0x1ffe('0x22')](handleEntityNotFound(_0x114fbe,null))['then'](respondWithResult(_0x114fbe,null))[_0x1ffe('0x36')](handleError(_0x114fbe,null));};exports['update']=function(_0x1b2af8,_0x3f7570){if(_0x1b2af8[_0x1ffe('0x37')]['id']){delete _0x1b2af8[_0x1ffe('0x37')]['id'];}return db[_0x1ffe('0x38')][_0x1ffe('0x39')]({'where':{'id':_0x1b2af8['params']['id']}})[_0x1ffe('0x22')](handleEntityNotFound(_0x3f7570,null))[_0x1ffe('0x22')](saveUpdates(_0x1b2af8[_0x1ffe('0x37')],null))['then'](respondWithResult(_0x3f7570,null))['catch'](handleError(_0x3f7570,null));};exports[_0x1ffe('0x23')]=function(_0x324735,_0x5b9199){return db[_0x1ffe('0x38')][_0x1ffe('0x39')]({'where':{'id':_0x324735[_0x1ffe('0x3a')]['id']}})[_0x1ffe('0x22')](handleEntityNotFound(_0x5b9199,null))[_0x1ffe('0x22')](removeEntity(_0x5b9199,null))[_0x1ffe('0x36')](handleError(_0x5b9199,null));}; \ No newline at end of file +var _0x1cc3=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','save','update','then','destroy','end','error','stack','name','send','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','find','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util'];(function(_0x4eb37e,_0x3986be){var _0x28a051=function(_0x5c3912){while(--_0x5c3912){_0x4eb37e['push'](_0x4eb37e['shift']());}};_0x28a051(++_0x3986be);}(_0x1cc3,0x11b));var _0x31cc=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1cc3[_0x1cc8fe];return _0x230054;};'use strict';var pdf=require(_0x31cc('0x0'));var emlformat=require(_0x31cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x31cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31cc('0x3'));var moment=require(_0x31cc('0x4'));var BPromise=require(_0x31cc('0x5'));var Mustache=require('mustache');var util=require(_0x31cc('0x6'));var path=require(_0x31cc('0x7'));var sox=require(_0x31cc('0x8'));var csv=require('to-csv');var ejs=require(_0x31cc('0x9'));var fs=require('fs');var _=require(_0x31cc('0xa'));var squel=require(_0x31cc('0xb'));var crypto=require(_0x31cc('0xc'));var jsforce=require(_0x31cc('0xd'));var deskjs=require(_0x31cc('0xe'));var toCsv=require(_0x31cc('0xf'));var querystring=require(_0x31cc('0x10'));var Papa=require(_0x31cc('0x11'));var Redis=require('ioredis');var authService=require(_0x31cc('0x12'));var qs=require(_0x31cc('0x13'));var hardwareService=require(_0x31cc('0x14'));var logger=require(_0x31cc('0x15'))(_0x31cc('0x16'));var utils=require(_0x31cc('0x17'));var config=require(_0x31cc('0x18'));var db=require(_0x31cc('0x19'))['db'];function respondWithStatusCode(_0x291c14,_0x342f6d){_0x342f6d=_0x342f6d||0xcc;return function(_0x5ec90b){if(_0x5ec90b){return _0x291c14[_0x31cc('0x1a')](_0x342f6d);}return _0x291c14[_0x31cc('0x1b')](_0x342f6d)['end']();};}function respondWithResult(_0x179528,_0x6b2a5b){_0x6b2a5b=_0x6b2a5b||0xc8;return function(_0x88e76e){if(_0x88e76e){return _0x179528[_0x31cc('0x1b')](_0x6b2a5b)[_0x31cc('0x1c')](_0x88e76e);}};}function respondWithFilteredResult(_0x118bb0,_0x39983b){return function(_0x2345d7){if(_0x2345d7){var _0x1227ad=_0x2345d7[_0x31cc('0x1d')],_0xc22d83=_0x39983b[_0x31cc('0x1e')],_0x171917=_0x39983b[_0x31cc('0x1e')]+_0x39983b['limit'],_0x5b970e;if(_0x171917>=_0x1227ad){_0x171917=_0x1227ad;_0x5b970e=0xc8;}else{_0x5b970e=0xce;}_0x118bb0[_0x31cc('0x1b')](_0x5b970e);return _0x118bb0[_0x31cc('0x1f')]('Content-Range',_0xc22d83+'-'+_0x171917+'/'+_0x1227ad)[_0x31cc('0x1c')](_0x2345d7);}return null;};}function patchUpdates(_0x3a9a53){return function(_0xaef2e1){try{jsonpatch[_0x31cc('0x20')](_0xaef2e1,_0x3a9a53,!![]);}catch(_0x33182d){return BPromise['reject'](_0x33182d);}return _0xaef2e1[_0x31cc('0x21')]();};}function saveUpdates(_0x2a2fad,_0x33319c){return function(_0x32ea0f){if(_0x32ea0f){return _0x32ea0f[_0x31cc('0x22')](_0x2a2fad)[_0x31cc('0x23')](function(_0x24dc0a){return _0x24dc0a;});}return null;};}function removeEntity(_0x43c769,_0x5bb5cb){return function(_0x2e5769){if(_0x2e5769){return _0x2e5769[_0x31cc('0x24')]()[_0x31cc('0x23')](function(){_0x43c769['status'](0xcc)[_0x31cc('0x25')]();});}};}function handleEntityNotFound(_0x4e180e,_0x408c4d){return function(_0x5c86da){if(!_0x5c86da){_0x4e180e[_0x31cc('0x1a')](0x194);}return _0x5c86da;};}function handleError(_0x4ebeb7,_0x41327d){_0x41327d=_0x41327d||0x1f4;return function(_0x5b7443){logger[_0x31cc('0x26')](_0x5b7443[_0x31cc('0x27')]);if(_0x5b7443['name']){delete _0x5b7443[_0x31cc('0x28')];}_0x4ebeb7['status'](_0x41327d)[_0x31cc('0x29')](_0x5b7443);};}exports['show']=function(_0x2edaff,_0x5a51ff){var _0x2b9e3f={'raw':!![],'where':{'id':_0x2edaff[_0x31cc('0x2a')]['id']}},_0x10ea07={};_0x10ea07[_0x31cc('0x2b')]=_[_0x31cc('0x2c')](db[_0x31cc('0x2d')][_0x31cc('0x2e')]);_0x10ea07['query']=_['keys'](_0x2edaff[_0x31cc('0x2f')]);_0x10ea07[_0x31cc('0x30')]=_[_0x31cc('0x31')](_0x10ea07[_0x31cc('0x2b')],_0x10ea07['query']);_0x2b9e3f[_0x31cc('0x32')]=_[_0x31cc('0x31')](_0x10ea07[_0x31cc('0x2b')],qs[_0x31cc('0x33')](_0x2edaff[_0x31cc('0x2f')][_0x31cc('0x33')]));_0x2b9e3f[_0x31cc('0x32')]=_0x2b9e3f[_0x31cc('0x32')][_0x31cc('0x34')]?_0x2b9e3f[_0x31cc('0x32')]:_0x10ea07[_0x31cc('0x2b')];if(_0x2edaff[_0x31cc('0x2f')]['includeAll']){_0x2b9e3f[_0x31cc('0x35')]=[{'all':!![]}];}_0x2b9e3f=_[_0x31cc('0x36')]({},_0x2b9e3f,_0x2edaff['options']);return db[_0x31cc('0x2d')][_0x31cc('0x37')](_0x2b9e3f)[_0x31cc('0x23')](handleEntityNotFound(_0x5a51ff,null))['then'](respondWithResult(_0x5a51ff,null))[_0x31cc('0x38')](handleError(_0x5a51ff,null));};exports[_0x31cc('0x22')]=function(_0x19de50,_0x3523eb){if(_0x19de50['body']['id']){delete _0x19de50[_0x31cc('0x39')]['id'];}return db[_0x31cc('0x2d')]['find']({'where':{'id':_0x19de50['params']['id']}})[_0x31cc('0x23')](handleEntityNotFound(_0x3523eb,null))[_0x31cc('0x23')](saveUpdates(_0x19de50[_0x31cc('0x39')],null))['then'](respondWithResult(_0x3523eb,null))['catch'](handleError(_0x3523eb,null));};exports[_0x31cc('0x24')]=function(_0x1f549b,_0x3f6cad){return db['MailApplication'][_0x31cc('0x37')]({'where':{'id':_0x1f549b[_0x31cc('0x2a')]['id']}})[_0x31cc('0x23')](handleEntityNotFound(_0x3f6cad,null))[_0x31cc('0x23')](removeEntity(_0x3f6cad,null))[_0x31cc('0x38')](handleError(_0x3f6cad,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 150c75f..9b70d35 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 _0x0fe8=['mail_applications','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','exports'];(function(_0x5159d8,_0x43a5ae){var _0x4de49c=function(_0x220f04){while(--_0x220f04){_0x5159d8['push'](_0x5159d8['shift']());}};_0x4de49c(++_0x43a5ae);}(_0x0fe8,0x89));var _0x80fe=function(_0x2bc763,_0x1e4b01){_0x2bc763=_0x2bc763-0x0;var _0x3e07de=_0x0fe8[_0x2bc763];return _0x3e07de;};'use strict';var _=require(_0x80fe('0x0'));var util=require(_0x80fe('0x1'));var logger=require(_0x80fe('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80fe('0x3'));var rp=require(_0x80fe('0x4'));var fs=require('fs');var path=require(_0x80fe('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x80fe('0x6')]=function(_0x57833b,_0x18de86){return _0x57833b['define']('MailApplication',attributes,{'tableName':_0x80fe('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80fe('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd8c1=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4'];(function(_0x14279a,_0x15d3ec){var _0x7687b3=function(_0x58a812){while(--_0x58a812){_0x14279a['push'](_0x14279a['shift']());}};_0x7687b3(++_0x15d3ec);}(_0xd8c1,0xc5));var _0x1d8c=function(_0xb9c52e,_0x1dfe16){_0xb9c52e=_0xb9c52e-0x0;var _0x1e2443=_0xd8c1[_0xb9c52e];return _0x1e2443;};'use strict';var _=require(_0x1d8c('0x0'));var util=require('util');var logger=require(_0x1d8c('0x1'))(_0x1d8c('0x2'));var moment=require(_0x1d8c('0x3'));var BPromise=require(_0x1d8c('0x4'));var rp=require(_0x1d8c('0x5'));var fs=require('fs');var path=require(_0x1d8c('0x6'));var rimraf=require(_0x1d8c('0x7'));var config=require('../../config/environment');var attributes=require(_0x1d8c('0x8'));module[_0x1d8c('0x9')]=function(_0x5c49ae,_0x205519){return _0x5c49ae['define'](_0x1d8c('0xa'),attributes,{'tableName':_0x1d8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d8c('0xc'),'collate':_0x1d8c('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index a05549d..5471b5f 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 _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3844f7,_0x5084ca){var _0x142b9b=function(_0x42a885){while(--_0x42a885){_0x3844f7['push'](_0x3844f7['shift']());}};_0x142b9b(++_0x5084ca);}(_0x7a54,0x106));var _0x47a5=function(_0x417d29,_0x4fbe64){_0x417d29=_0x417d29-0x0;var _0x5554da=_0x7a54[_0x417d29];return _0x5554da;};'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')]('MailApplication,\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['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x1cd442,_0x3b69ee){var _0x12da97=function(_0xd5c5ed){while(--_0xd5c5ed){_0x1cd442['push'](_0x1cd442['shift']());}};_0x12da97(++_0x3b69ee);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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']('MailApplication,\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['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8e4c172..7716c02 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 _0x70e0=['isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','addTags','put','tracked','mail','mailinteraction:update','update','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id'];(function(_0x35f885,_0x5a82d8){var _0x2d7cc9=function(_0x273a2b){while(--_0x273a2b){_0x35f885['push'](_0x35f885['shift']());}};_0x2d7cc9(++_0x5a82d8);}(_0x70e0,0x17b));var _0x070e=function(_0x15a9e8,_0x9d758){_0x15a9e8=_0x15a9e8-0x0;var _0x382f0b=_0x70e0[_0x15a9e8];return _0x382f0b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./mailInteraction.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0x7')](_0x070e('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x070e('0x7')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0x11')]);router[_0x070e('0x10')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x12')]);router['post']('/:id/tags',auth[_0x070e('0xb')](),interaction['tracked']('mail','mailinteraction:addtags'),controller[_0x070e('0x13')]);router[_0x070e('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0x070e('0x15')](_0x070e('0x16'),_0x070e('0x17')),controller[_0x070e('0x18')]);router['delete']('/:id',auth[_0x070e('0xb')](),interaction[_0x070e('0x15')](_0x070e('0x16'),_0x070e('0x19')),controller[_0x070e('0x1a')]);router['delete'](_0x070e('0x1b'),auth[_0x070e('0xb')](),controller[_0x070e('0x1c')]);module[_0x070e('0x1d')]=router; \ No newline at end of file +var _0x3e74=['connect-timeout','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','getMessages','post','/:id/messages','addMessage','tracked','mail','put','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x1e76db,_0x5b8fad){_0x1e76db=_0x1e76db-0x0;var _0x128c27=_0x3e74[_0x1e76db];return _0x128c27;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/:id/download',auth[_0x43e7('0x7')](),controller['download']);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x7')](),controller['create']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller[_0x43e7('0xe')]);router['post']('/:id/tags',auth[_0x43e7('0x7')](),interaction[_0x43e7('0xf')](_0x43e7('0x10'),'mailinteraction:addtags'),controller['addTags']);router[_0x43e7('0x11')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),interaction[_0x43e7('0xf')]('mail','mailinteraction:update'),controller[_0x43e7('0x12')]);router[_0x43e7('0x13')](_0x43e7('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x43e7('0x10'),_0x43e7('0x14')),controller[_0x43e7('0x15')]);router[_0x43e7('0x13')](_0x43e7('0x16'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x17')]);module[_0x43e7('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3470f42..02a5afd 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 _0x0cc2=['TEXT','ENUM','out','long','iconv','BOOLEAN','DATE','STRING'];(function(_0x37ffd8,_0x53c369){var _0x42046b=function(_0x14a06b){while(--_0x14a06b){_0x37ffd8['push'](_0x37ffd8['shift']());}};_0x42046b(++_0x53c369);}(_0x0cc2,0x9c));var _0x20cc=function(_0x1c08e0,_0x6ab658){_0x1c08e0=_0x1c08e0-0x0;var _0x574a34=_0x0cc2[_0x1c08e0];return _0x574a34;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x20cc('0x0'));module['exports']={'closed':{'type':Sequelize[_0x20cc('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20cc('0x2')]},'disposition':{'type':Sequelize[_0x20cc('0x3')]},'note':{'type':Sequelize[_0x20cc('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x20cc('0x3')]},'cc':{'type':Sequelize[_0x20cc('0x4')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x20cc('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x20cc('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20cc('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x20cc('0x5')]('in',_0x20cc('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x20cc('0x4')](_0x20cc('0x7'))},'lastMsgText':{'type':Sequelize[_0x20cc('0x4')](_0x20cc('0x7'))}}; \ No newline at end of file +var _0x4f89=['STRING','long','ENUM','out','TEXT','sequelize','BOOLEAN','DATE'];(function(_0x6cf9c3,_0x3b32a5){var _0x438b45=function(_0x4f6863){while(--_0x4f6863){_0x6cf9c3['push'](_0x6cf9c3['shift']());}};_0x438b45(++_0x3b32a5);}(_0x4f89,0xd5));var _0x94f8=function(_0x3f0af2,_0x5cc426){_0x3f0af2=_0x3f0af2-0x0;var _0x110c4e=_0x4f89[_0x3f0af2];return _0x110c4e;};'use strict';var Sequelize=require(_0x94f8('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x94f8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x94f8('0x2')]},'disposition':{'type':Sequelize[_0x94f8('0x3')]},'note':{'type':Sequelize[_0x94f8('0x3')]},'inReplyTo':{'type':Sequelize[_0x94f8('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x94f8('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x94f8('0x2')]},'substatus':{'type':Sequelize[_0x94f8('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x94f8('0x5')]('in',_0x94f8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x94f8('0x5')]('in',_0x94f8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x94f8('0x7')]('long')},'lastMsgText':{'type':Sequelize[_0x94f8('0x7')](_0x94f8('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ef30bf1..f245626 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 _0xec75=['$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','server','files','attachments','root','tmp','interaction-%s.zip','getMessages','bcc','Attachment','Attachments','mkdirSync','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','readFileSync','build','message%d.eml','log','err','unlinkSync','html-pdf','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/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','count','offset','limit','set','json','reject','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','expr','advancedFilter','forEach','value','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','\x20IN\x20?','tableAlias','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','Messages.count','\x20=\x20?','LIKE','\x20<\x20?','map','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','push','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','SELECT','clone','read','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','%s\x20=\x200','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','Tags','lastMsgText','lastMsgBody','catch','show','params','includeAll','include','options','find','create','MailInteraction','body','addMessage','omit','ids','findOne','MailMessage','MailInteractionId'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xec75,0x1e4));var _0x5ec7=function(_0xb256d6,_0x2a4175){_0xb256d6=_0xb256d6-0x0;var _0x6ab834=_0xec75[_0xb256d6];return _0x6ab834;};'use strict';var pdf=require(_0x5ec7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ec7('0x1'));var zipdir=require(_0x5ec7('0x2'));var jsonpatch=require(_0x5ec7('0x3'));var rp=require(_0x5ec7('0x4'));var moment=require(_0x5ec7('0x5'));var BPromise=require(_0x5ec7('0x6'));var Mustache=require(_0x5ec7('0x7'));var util=require(_0x5ec7('0x8'));var path=require(_0x5ec7('0x9'));var sox=require(_0x5ec7('0xa'));var csv=require(_0x5ec7('0xb'));var ejs=require(_0x5ec7('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ec7('0xd'));var crypto=require(_0x5ec7('0xe'));var jsforce=require(_0x5ec7('0xf'));var deskjs=require(_0x5ec7('0x10'));var toCsv=require(_0x5ec7('0xb'));var querystring=require(_0x5ec7('0x11'));var Papa=require(_0x5ec7('0x12'));var htmlToText=require('html-to-text');var Redis=require(_0x5ec7('0x13'));var authService=require(_0x5ec7('0x14'));var qs=require(_0x5ec7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ec7('0x16'))(_0x5ec7('0x17'));var utils=require(_0x5ec7('0x18'));var config=require(_0x5ec7('0x19'));var db=require('../../mysqldb')['db'];config[_0x5ec7('0x1a')]=_[_0x5ec7('0x1b')](config[_0x5ec7('0x1a')],{'host':_0x5ec7('0x1c'),'port':0x18eb});var socket=require(_0x5ec7('0x1d'))(new Redis(config['redis']));require(_0x5ec7('0x1e'))[_0x5ec7('0x1f')](socket);function respondWithStatusCode(_0xf2483,_0x4b07de){_0x4b07de=_0x4b07de||0xcc;return function(_0x5a2b9c){if(_0x5a2b9c){return _0xf2483[_0x5ec7('0x20')](_0x4b07de);}return _0xf2483[_0x5ec7('0x21')](_0x4b07de)['end']();};}function respondWithResult(_0x171e03,_0x5af589){_0x5af589=_0x5af589||0xc8;return function(_0x3c5239){if(_0x3c5239){return _0x171e03['status'](_0x5af589)['json'](_0x3c5239);}};}function respondWithFilteredResult(_0x5e40b1,_0x1e6335){return function(_0x2ada41){if(_0x2ada41){var _0xa93dfe=_0x2ada41[_0x5ec7('0x22')],_0xde59d7=_0x1e6335[_0x5ec7('0x23')],_0xc05cfb=_0x1e6335[_0x5ec7('0x23')]+_0x1e6335[_0x5ec7('0x24')],_0x2eeace;if(_0xc05cfb>=_0xa93dfe){_0xc05cfb=_0xa93dfe;_0x2eeace=0xc8;}else{_0x2eeace=0xce;}_0x5e40b1[_0x5ec7('0x21')](_0x2eeace);return _0x5e40b1[_0x5ec7('0x25')]('Content-Range',_0xde59d7+'-'+_0xc05cfb+'/'+_0xa93dfe)[_0x5ec7('0x26')](_0x2ada41);}return null;};}function patchUpdates(_0x14a279){return function(_0x3143e2){try{jsonpatch['apply'](_0x3143e2,_0x14a279,!![]);}catch(_0x53682c){return BPromise[_0x5ec7('0x27')](_0x53682c);}return _0x3143e2[_0x5ec7('0x28')]();};}function saveUpdates(_0x490af2,_0x7ff2e5){return function(_0x59192b){if(_0x59192b){return _0x59192b[_0x5ec7('0x29')](_0x490af2)[_0x5ec7('0x2a')](function(_0x7697e7){return _0x7697e7;});}return null;};}function removeEntity(_0x132be0,_0x2de688){return function(_0x39903a){if(_0x39903a){return _0x39903a[_0x5ec7('0x2b')]()[_0x5ec7('0x2a')](function(){_0x132be0[_0x5ec7('0x21')](0xcc)[_0x5ec7('0x2c')]();});}};}function handleEntityNotFound(_0x199d62,_0x504017){return function(_0x2c3fa8){if(!_0x2c3fa8){_0x199d62[_0x5ec7('0x20')](0x194);}return _0x2c3fa8;};}function handleError(_0x1fac14,_0x5050a6){_0x5050a6=_0x5050a6||0x1f4;return function(_0x275faf){logger['error'](_0x275faf[_0x5ec7('0x2d')]);if(_0x275faf[_0x5ec7('0x2e')]){delete _0x275faf[_0x5ec7('0x2e')];}_0x1fac14['status'](_0x5050a6)[_0x5ec7('0x2f')](_0x275faf);};}exports[_0x5ec7('0x30')]=function(_0xa4933e,_0x12a5d6){var _0x4ae841={},_0x23ee97={},_0x172bb7={'count':0x0,'rows':[]};var _0x495afe=db['MailInteraction'][_0x5ec7('0x31')];_0x23ee97[_0x5ec7('0x32')]=_[_0x5ec7('0x33')](_0x495afe);_0x23ee97[_0x5ec7('0x34')]=_['keys'](_0xa4933e[_0x5ec7('0x34')]);_0x23ee97[_0x5ec7('0x35')]=_[_0x5ec7('0x36')](_0x23ee97[_0x5ec7('0x32')],_0x23ee97[_0x5ec7('0x34')]);_0x4ae841[_0x5ec7('0x37')]=_['intersection'](_0x23ee97['model'],qs[_0x5ec7('0x38')](_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x38')]));_0x4ae841[_0x5ec7('0x37')]=_0x4ae841[_0x5ec7('0x37')][_0x5ec7('0x39')]?_0x4ae841[_0x5ec7('0x37')]:_0x23ee97[_0x5ec7('0x32')];if(!_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x3a')](_0x5ec7('0x3b'))){_0x4ae841[_0x5ec7('0x24')]=qs[_0x5ec7('0x24')](_0xa4933e['query']['limit']);_0x4ae841[_0x5ec7('0x23')]=qs[_0x5ec7('0x23')](_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x23')]);}_0x4ae841[_0x5ec7('0x3c')]=qs[_0x5ec7('0x3d')](_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x3d')]);_0x4ae841[_0x5ec7('0x3e')]=qs[_0x5ec7('0x35')](_[_0x5ec7('0x3f')](_0xa4933e[_0x5ec7('0x34')],_0x23ee97[_0x5ec7('0x35')]));var _0x677974=[];var _0x266293=squel['select']()[_0x5ec7('0x40')]('id')[_0x5ec7('0x40')]('name')[_0x5ec7('0x40')](_0x5ec7('0x41'))[_0x5ec7('0x42')](_0x5ec7('0x43'));var _0x2f8544=squel[_0x5ec7('0x44')]()[_0x5ec7('0x40')](_0x5ec7('0x45'))[_0x5ec7('0x42')](_0x5ec7('0x46'),'me')['where'](_0x5ec7('0x47'))[_0x5ec7('0x3e')](_0x5ec7('0x48'))[_0x5ec7('0x3e')](_0x5ec7('0x49'));var _0x1a0545=squel[_0x5ec7('0x44')]()[_0x5ec7('0x40')](_0x5ec7('0x4a'))[_0x5ec7('0x40')](_0x5ec7('0x4b'))['from'](_0x5ec7('0x4c'),'ui')[_0x5ec7('0x4d')](_0x5ec7('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0xa1a402=squel[_0x5ec7('0x44')]()['from']('mail_interactions','i')['left_join']('user_has_mail_interactions','ui',_0x5ec7('0x4f'))[_0x5ec7('0x4d')](_0x5ec7('0x4e'),'u',_0x5ec7('0x50'))[_0x5ec7('0x4d')](_0x5ec7('0x51'),'c',_0x5ec7('0x52'))[_0x5ec7('0x4d')](_0x5ec7('0x4e'),'o',_0x5ec7('0x53'))[_0x5ec7('0x4d')](_0x5ec7('0x54'),'a','a.id\x20=\x20i.MailAccountId')[_0x5ec7('0x4d')](_0x5ec7('0x46'),'me','me.MailInteractionId\x20=\x20i.id');var _0x3f532d=squel[_0x5ec7('0x55')]();if(_0xa4933e['query'][_0x5ec7('0x56')]){var _0x376410=JSON['parse'](_0xa4933e[_0x5ec7('0x34')]['advancedFilter']);_[_0x5ec7('0x33')](_0x376410)[_0x5ec7('0x57')](function(_0x22e224){var _0x2a7e69=_0x376410[_0x22e224];if(_0x22e224==='createdAt'){var _0x597fc0=moment(_0x2a7e69[_0x5ec7('0x58')]['dateStart'])[_0x5ec7('0x59')](_0x5ec7('0x5a'))[_0x5ec7('0x5b')]()[_0x5ec7('0x5c')]();var _0x5c281c=moment(_0x5c281c)[_0x5ec7('0x5b')]()[_0x5ec7('0x5d')](_0x5ec7('0x5a'))[_0x5ec7('0x5c')]();_0x3f532d[_0x5ec7('0x5e')](_0x5ec7('0x5f'),_0x597fc0,_0x5c281c);}else{if(_[_0x5ec7('0x60')](_0x2a7e69[_0x5ec7('0x61')])){_0x2a7e69['condition'][_0x5ec7('0x57')](function(_0x29d575){switch(_0x2a7e69[_0x5ec7('0x61')][_0x5ec7('0x58')]){case'IS':if(_0x22e224!==_0x5ec7('0x62')&&_0x22e224!=='Messages.count'){if(_['isArray'](_0x2a7e69[_0x5ec7('0x58')])&&_0x2a7e69[_0x5ec7('0x58')]['length']>0x1){_0x3f532d['and'](_0x2a7e69['tableAlias']+'.'+_0x22e224+_0x5ec7('0x63'),_0x2a7e69[_0x5ec7('0x58')]);}else{_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69['tableAlias']+'.'+_0x22e224+'\x20=\x20?',_0x2a7e69[_0x5ec7('0x58')][0x0]);}}break;case'=':_0x3f532d['and'](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+'\x20=\x20?',_0x2a7e69[_0x5ec7('0x58')]);break;case'LIKE':if(_0x22e224===_0x5ec7('0x65')){_0x3f532d[_0x5ec7('0x5e')](_0x5ec7('0x66')+_0x5ec7('0x67'),'%'+_0x2a7e69[_0x5ec7('0x58')]+'%');_0x3f532d['or'](_0x5ec7('0x68')+_0x5ec7('0x67'),'%'+_0x2a7e69['value']+'%');_0x3f532d['or'](_0x5ec7('0x69')+'\x20LIKE\x20?','%'+_0x2a7e69[_0x5ec7('0x58')]+'%');}else{_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69['tableAlias']+'.'+_0x22e224+'\x20LIKE\x20?','%'+_0x2a7e69[_0x5ec7('0x58')]+'%');}break;case'>':_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+_0x5ec7('0x6a'),_0x2a7e69[_0x5ec7('0x58')]);break;case'<':_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+'\x20<\x20?',_0x2a7e69[_0x5ec7('0x58')]);break;}});}else{switch(_0x2a7e69[_0x5ec7('0x61')][_0x5ec7('0x58')]){case'IS':if(_0x22e224!==_0x5ec7('0x62')&&_0x22e224!==_0x5ec7('0x6b')){if(_[_0x5ec7('0x60')](_0x2a7e69[_0x5ec7('0x58')])&&_0x2a7e69[_0x5ec7('0x58')]['length']>0x1){_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+'\x20IN\x20?',_0x2a7e69[_0x5ec7('0x58')]);}else{_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+'\x20=\x20?',_0x2a7e69['value'][0x0]);}}break;case'=':_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+_0x5ec7('0x6c'),_0x2a7e69[_0x5ec7('0x58')]);break;case _0x5ec7('0x6d'):if(_0x22e224===_0x5ec7('0x65')){_0x3f532d['and'](_0x5ec7('0x66')+_0x5ec7('0x67'),'%'+_0x2a7e69['value']+'%');_0x3f532d['or'](_0x5ec7('0x68')+'\x20LIKE\x20?','%'+_0x2a7e69[_0x5ec7('0x58')]+'%');_0x3f532d['or'](_0x5ec7('0x69')+_0x5ec7('0x67'),'%'+_0x2a7e69[_0x5ec7('0x58')]+'%');}else{_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+_0x5ec7('0x67'),'%'+_0x2a7e69[_0x5ec7('0x58')]+'%');}break;case'>':_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+'\x20>\x20?',_0x2a7e69[_0x5ec7('0x58')]);break;case'<':_0x3f532d[_0x5ec7('0x5e')](_0x2a7e69[_0x5ec7('0x64')]+'.'+_0x22e224+_0x5ec7('0x6e'),_0x2a7e69['value']);break;}}}});}else{var _0xcc11fb=_(Object[_0x5ec7('0x33')](_0xa4933e[_0x5ec7('0x34')]))[_0x5ec7('0x6f')](function(_0x4cf09e){return _0x495afe[_0x5ec7('0x3a')](_0x4cf09e)?_0x4cf09e:undefined;})[_0x5ec7('0x70')](function(_0x451d9a){return!_[_0x5ec7('0x71')](_0x451d9a);})[_0x5ec7('0x58')]();if(!_[_0x5ec7('0x72')](_0xcc11fb)){_0xcc11fb[_0x5ec7('0x57')](function(_0xa79f67){if(_0xa79f67===_0x5ec7('0x73')){_0xa1a402[_0x5ec7('0x3e')](_0x5ec7('0x74'),[][_0x5ec7('0x75')](_0xa4933e[_0x5ec7('0x34')][_0xa79f67]));}else if(_0xa79f67===_0x5ec7('0x76')){var _0x4c26c5=JSON['parse'](_0xa4933e[_0x5ec7('0x34')][_0xa79f67])['$gte'];var _0x5365ce=JSON[_0x5ec7('0x77')](_0xa4933e[_0x5ec7('0x34')][_0xa79f67])[_0x5ec7('0x78')];_0xa1a402[_0x5ec7('0x3e')](_0x5ec7('0x5f'),_0x4c26c5,_0x5365ce);}else{_0xa1a402[_0x5ec7('0x3e')]('i.'+_0xa79f67+_0x5ec7('0x6c'),_0xa4933e[_0x5ec7('0x34')][_0xa79f67]);}});}if(_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x70')]){var _0x2d20c5=_0xa4933e['query']['filter'][_0x5ec7('0x79')]('\x5c','\x5c\x5c')[_0x5ec7('0x79')]('\x27\x27',_0x5ec7('0x7a'));if(qs[_0x5ec7('0x7b')](_0x2d20c5)){_0x3f532d['or'](_0x5ec7('0x7c'),_0x2d20c5+'%');}else if(qs[_0x5ec7('0x7d')](_0x2d20c5)){_0x3f532d['or'](_0x5ec7('0x7e'),_0x2d20c5+'%');}else{var _0x52d82d=[];_0x2d20c5['split']('\x20')[_0x5ec7('0x57')](function(_0x31675c){_0x52d82d[_0x5ec7('0x7f')]('+'+_0x31675c[_0x5ec7('0x80')]());});var _0x3b833e=_0x52d82d[_0x5ec7('0x81')]('\x20');_0x3f532d['or'](_0x5ec7('0x82'),_0x3b833e)['or'](_0x5ec7('0x83'),_0x3b833e);}}}_0xa1a402[_0x5ec7('0x3e')](_0x3f532d);if(_0x4ae841['order']){_0x4ae841[_0x5ec7('0x3c')][_0x5ec7('0x57')](function(_0xa1e36c){_0xa1a402[_0x5ec7('0x3c')]('i.'+_0xa1e36c[0x0],_0xa1e36c[0x1]===_0x5ec7('0x84')?![]:!![]);});}_0xa1a402[_0x5ec7('0x85')](_0x5ec7('0x86'));var _0x415266={'type':db[_0x5ec7('0x87')]['QueryTypes'][_0x5ec7('0x88')],'raw':!![]};var _0x1f51c0=_0xa1a402[_0x5ec7('0x89')]()[_0x5ec7('0x40')](_0x5ec7('0x45'));if(!_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x56')]){if(_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x8a')]){if(_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x8a')]==0x1){_0x1f51c0[_0x5ec7('0x3e')](util['format']('%s\x20=\x200',_0x2f8544[_0x5ec7('0x80')]()));_0xa1a402[_0x5ec7('0x8b')](_0x5ec7('0x8c'));}else{_0x1f51c0['where'](util[_0x5ec7('0x5c')](_0x5ec7('0x8d'),_0x2f8544[_0x5ec7('0x80')]()));_0xa1a402[_0x5ec7('0x8b')](_0x5ec7('0x8e'));}}if(_0xa4933e['query'][_0x5ec7('0x8f')]){var _0xd7eef7=_[_0x5ec7('0x60')](_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x8f')])?_0xa4933e[_0x5ec7('0x34')]['tag']:new Array(_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x8f')]);var _0x2b9125=squel[_0x5ec7('0x55')]();_0xd7eef7[_0x5ec7('0x57')](function(_0x19b042){_0x2b9125['or'](_0x5ec7('0x90'),'%,'+_0x19b042+',%');});_0xa1a402['having'](_0x2b9125);_0x1f51c0[_0x5ec7('0x4d')](_0x5ec7('0x91'),'it',_0x5ec7('0x92'));_0x1f51c0['left_join']('tools_tags','t',_0x5ec7('0x93'));_0x1f51c0[_0x5ec7('0x3e')](_0x5ec7('0x94'),_0xd7eef7);}}else{var _0x376410=JSON[_0x5ec7('0x77')](_0xa4933e[_0x5ec7('0x34')][_0x5ec7('0x56')]);_[_0x5ec7('0x33')](_0x376410)[_0x5ec7('0x57')](function(_0x2cac53){var _0x2ec277=_0x376410[_0x2cac53];if(_0x2cac53===_0x5ec7('0x62')){var _0x7ad42d=_0x2ec277[_0x5ec7('0x58')];var _0xbb31c7=squel['expr']();_0x7ad42d[_0x5ec7('0x57')](function(_0x2f5ec6){_0xbb31c7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f5ec6+',%');});_0xa1a402[_0x5ec7('0x8b')](_0xbb31c7);_0x1f51c0[_0x5ec7('0x4d')]('mail_interaction_has_tags','it',_0x5ec7('0x92'));_0x1f51c0[_0x5ec7('0x4d')]('tools_tags','t',_0x5ec7('0x93'));_0x1f51c0['where'](_0x5ec7('0x94'),_0x7ad42d);}else if(_0x2cac53===_0x5ec7('0x6b')){if(_0x2ec277[_0x5ec7('0x58')][_0x5ec7('0x39')]===0x1){if(_0x2ec277[_0x5ec7('0x58')][0x0]===0x1){_0x1f51c0['where'](util[_0x5ec7('0x5c')](_0x5ec7('0x95'),_0x2f8544[_0x5ec7('0x80')]()));_0xa1a402['having'](_0x5ec7('0x8c'));}else{_0x1f51c0[_0x5ec7('0x3e')](util[_0x5ec7('0x5c')](_0x5ec7('0x8d'),_0x2f8544[_0x5ec7('0x80')]()));_0xa1a402[_0x5ec7('0x8b')](_0x5ec7('0x8e'));}}}});}db[_0x5ec7('0x96')][_0x5ec7('0x34')](_0x1f51c0[_0x5ec7('0x80')](),_0x415266)['then'](function(_0x51c46c){_0x172bb7[_0x5ec7('0x22')]=_0x51c46c[_0x5ec7('0x39')];if(_0x172bb7[_0x5ec7('0x22')]===0x0)return[];return db['sequelize'][_0x5ec7('0x34')](_0x266293[_0x5ec7('0x80')](),_0x415266)[_0x5ec7('0x2a')](function(_0x301d3a){_0x677974=_[_0x5ec7('0x97')](_0x301d3a,'id');_0x415266=_[_0x5ec7('0x98')](_0x415266,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0xa1a402['field'](_0x2f8544,_0x5ec7('0x6b'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0x99'),_0x5ec7('0x9a'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0x9b'));_0xa1a402['field']('c.firstName','Contact.firstName');_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0x68'),_0x5ec7('0x9c'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0x69'),_0x5ec7('0x9d'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0x9e'),_0x5ec7('0x9f'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0xa0'),_0x5ec7('0xa1'));_0xa1a402['field'](_0x5ec7('0xa2'),_0x5ec7('0xa3'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0xa4'),_0x5ec7('0xa5'));_0xa1a402[_0x5ec7('0x40')](_0x5ec7('0xa6'),_0x5ec7('0xa7'));_0xa1a402[_0x5ec7('0x4d')](_0x5ec7('0x91'),'it','it.MailInteractionId\x20=\x20i.id');_0xa1a402['left_join'](_0x5ec7('0x43'),'t',_0x5ec7('0x93'));_0xa1a402[_0x5ec7('0x24')](_0x4ae841['limit']);_0xa1a402[_0x5ec7('0x23')](_0x4ae841[_0x5ec7('0x23')]);return db[_0x5ec7('0x96')][_0x5ec7('0x34')](_0xa1a402[_0x5ec7('0x80')](),_0x415266);})[_0x5ec7('0x2a')](function(_0x3c7724){_0x1a0545[_0x5ec7('0x3e')]('ui.MailInteractionId\x20IN\x20?',_[_0x5ec7('0x6f')](_0x3c7724,'id'));return db['sequelize'][_0x5ec7('0x34')](_0x1a0545[_0x5ec7('0x80')](),_0x415266)[_0x5ec7('0x2a')](function(_0x66479a){var _0xc91d6c=_[_0x5ec7('0xa8')](_0x66479a,'MailInteractionId');_0x3c7724[_0x5ec7('0x57')](function(_0x474eb5){if(_0xc91d6c[_0x474eb5['id']]){_0x474eb5['Users']=_[_0x5ec7('0x6f')](_0xc91d6c[_0x474eb5['id']],function(_0x7284ac){return{'id':_0x7284ac['id']};});}if(_0x474eb5[_0x5ec7('0xa7')]){_0x474eb5[_0x5ec7('0xa9')]=[];_0x474eb5[_0x5ec7('0xa7')]['split'](',')[_0x5ec7('0x57')](function(_0x29c192){_0x474eb5[_0x5ec7('0xa9')]['push'](_0x677974[_0x29c192]);});}delete _0x474eb5[_0x5ec7('0xa7')];if(!_0x474eb5['lastMsgText']){_0x474eb5[_0x5ec7('0xaa')]=_['trimStart'](htmlToText['fromString'](_0x474eb5[_0x5ec7('0xab')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x3c7724;});});})[_0x5ec7('0x2a')](function(_0x165567){_0x172bb7['rows']=_0x165567;return _0x172bb7;})['then'](respondWithFilteredResult(_0x12a5d6,_0x4ae841))[_0x5ec7('0xac')](handleError(_0x12a5d6,null));};exports[_0x5ec7('0xad')]=function(_0x3be41c,_0x460bd2){var _0x3672be={'raw':![],'where':{'id':_0x3be41c[_0x5ec7('0xae')]['id']}},_0x4eb8fa={};_0x4eb8fa[_0x5ec7('0x32')]=_[_0x5ec7('0x33')](db['MailInteraction'][_0x5ec7('0x31')]);_0x4eb8fa[_0x5ec7('0x34')]=_[_0x5ec7('0x33')](_0x3be41c[_0x5ec7('0x34')]);_0x4eb8fa[_0x5ec7('0x35')]=_['intersection'](_0x4eb8fa[_0x5ec7('0x32')],_0x4eb8fa['query']);_0x3672be[_0x5ec7('0x37')]=_[_0x5ec7('0x36')](_0x4eb8fa[_0x5ec7('0x32')],qs['fields'](_0x3be41c[_0x5ec7('0x34')][_0x5ec7('0x38')]));_0x3672be[_0x5ec7('0x37')]=_0x3672be[_0x5ec7('0x37')][_0x5ec7('0x39')]?_0x3672be[_0x5ec7('0x37')]:_0x4eb8fa[_0x5ec7('0x32')];if(_0x3be41c[_0x5ec7('0x34')][_0x5ec7('0xaf')]){_0x3672be[_0x5ec7('0xb0')]=[{'all':!![]}];}_0x3672be=_['merge']({},_0x3672be,_0x3be41c[_0x5ec7('0xb1')]);return db['MailInteraction'][_0x5ec7('0xb2')](_0x3672be)[_0x5ec7('0x2a')](handleEntityNotFound(_0x460bd2,null))[_0x5ec7('0x2a')](respondWithResult(_0x460bd2,null))[_0x5ec7('0xac')](handleError(_0x460bd2,null));};exports[_0x5ec7('0xb3')]=function(_0x4cbf51,_0x4927af){return db[_0x5ec7('0xb4')][_0x5ec7('0xb3')](_0x4cbf51[_0x5ec7('0xb5')],{})[_0x5ec7('0x2a')](respondWithResult(_0x4927af,0xc9))[_0x5ec7('0xac')](handleError(_0x4927af,null));};exports[_0x5ec7('0x29')]=function(_0x5537b8,_0x2410d6){if(_0x5537b8[_0x5ec7('0xb5')]['id']){delete _0x5537b8[_0x5ec7('0xb5')]['id'];}return db[_0x5ec7('0xb4')][_0x5ec7('0xb2')]({'where':{'id':_0x5537b8[_0x5ec7('0xae')]['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x2410d6,null))[_0x5ec7('0x2a')](saveUpdates(_0x5537b8[_0x5ec7('0xb5')],null))[_0x5ec7('0x2a')](respondWithResult(_0x2410d6,null))[_0x5ec7('0xac')](handleError(_0x2410d6,null));};exports[_0x5ec7('0x2b')]=function(_0x20b714,_0x5cf329){return db[_0x5ec7('0xb4')]['find']({'where':{'id':_0x20b714[_0x5ec7('0xae')]['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x5cf329,null))[_0x5ec7('0x2a')](removeEntity(_0x5cf329,null))[_0x5ec7('0xac')](handleError(_0x5cf329,null));};exports['describe']=function(_0x439bf2,_0x50baf0){return db[_0x5ec7('0xb4')]['describe']()[_0x5ec7('0x2a')](respondWithResult(_0x50baf0,null))[_0x5ec7('0xac')](handleError(_0x50baf0,null));};exports[_0x5ec7('0xb6')]=function(_0x2ff259,_0x15d963,_0x222cd9){return db['MailMessage'][_0x5ec7('0xb2')]({'where':{'id':_0x2ff259[_0x5ec7('0xae')]['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x15d963,null))[_0x5ec7('0x2a')](function(_0x44c473){if(_0x44c473){return _0x44c473['addMessage'](_0x2ff259[_0x5ec7('0xb5')]['ids'],_[_0x5ec7('0xb7')](_0x2ff259['body'],[_0x5ec7('0xb8'),'id'])||{});}})[_0x5ec7('0x2a')](respondWithResult(_0x15d963,null))['catch'](handleError(_0x15d963,null));};exports['getMessages']=function(_0x3fb7cd,_0x32af9d,_0x5273ee){var _0x244a50={'raw':![],'where':{}};var _0x48fb5a={};var _0x5a9c73={'count':0x0,'rows':[]};return db[_0x5ec7('0xb4')][_0x5ec7('0xb9')]({'where':{'id':_0x3fb7cd[_0x5ec7('0xae')]['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x32af9d,null))[_0x5ec7('0x2a')](function(_0x32c28f){if(_0x32c28f){_0x48fb5a[_0x5ec7('0x32')]=_[_0x5ec7('0x33')](db[_0x5ec7('0xba')]['rawAttributes']);_0x48fb5a[_0x5ec7('0x34')]=_[_0x5ec7('0x33')](_0x3fb7cd[_0x5ec7('0x34')]);_0x48fb5a[_0x5ec7('0x35')]=_[_0x5ec7('0x36')](_0x48fb5a[_0x5ec7('0x32')],_0x48fb5a[_0x5ec7('0x34')]);_0x244a50[_0x5ec7('0x37')]=_[_0x5ec7('0x36')](_0x48fb5a[_0x5ec7('0x32')],qs[_0x5ec7('0x38')](_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0x38')]));_0x244a50[_0x5ec7('0x37')]=_0x244a50[_0x5ec7('0x37')][_0x5ec7('0x39')]?_0x244a50['attributes']:_0x48fb5a[_0x5ec7('0x32')];if(!_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0x3a')](_0x5ec7('0x3b'))){_0x244a50[_0x5ec7('0x24')]=qs['limit'](_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0x24')]);_0x244a50['offset']=qs[_0x5ec7('0x23')](_0x3fb7cd[_0x5ec7('0x34')]['offset']);}_0x244a50[_0x5ec7('0x3c')]=qs[_0x5ec7('0x3d')](_0x3fb7cd['query'][_0x5ec7('0x3d')]);_0x244a50[_0x5ec7('0x3e')]=qs['filters'](_[_0x5ec7('0x3f')](_0x3fb7cd[_0x5ec7('0x34')],_0x48fb5a[_0x5ec7('0x35')]));_0x244a50[_0x5ec7('0x3e')][_0x5ec7('0xbb')]=_0x32c28f['id'];if(_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0x70')]){_0x244a50[_0x5ec7('0x3e')]=_[_0x5ec7('0x98')](_0x244a50['where'],{'$or':_[_0x5ec7('0x6f')](_0x244a50['attributes'],function(_0x4b9d22){var _0x3d0be1={};_0x3d0be1[_0x4b9d22]={'$like':'%'+_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0x70')]+'%'};return _0x3d0be1;})});}if(_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0xbc')]){var _0x3c677f=_0x3fb7cd[_0x5ec7('0x34')]['$gte'][_0x5ec7('0xbd')](',');var _0x34f4b7={};_0x34f4b7[_0x3c677f[0x0]]={'$gte':moment(_0x3c677f[0x1])['format'](_0x5ec7('0xbe'))};_0x244a50['where']=_[_0x5ec7('0x98')](_0x244a50[_0x5ec7('0x3e')],_0x34f4b7);}_0x244a50=_[_0x5ec7('0x98')]({},_0x244a50,_0x3fb7cd[_0x5ec7('0xb1')]);return db[_0x5ec7('0xba')][_0x5ec7('0x22')]({'where':_0x244a50[_0x5ec7('0x3e')]})[_0x5ec7('0x2a')](function(_0x400c30){_0x5a9c73[_0x5ec7('0x22')]=_0x400c30;if(_0x3fb7cd[_0x5ec7('0x34')][_0x5ec7('0xaf')]){_0x244a50['include']=[{'all':!![]}];}return db[_0x5ec7('0xba')]['findAll'](_0x244a50);})[_0x5ec7('0x2a')](function(_0x4b24b8){_0x5a9c73[_0x5ec7('0xbf')]=_0x4b24b8;return _0x5a9c73;});}})[_0x5ec7('0x2a')](respondWithFilteredResult(_0x32af9d,_0x244a50))[_0x5ec7('0xac')](handleError(_0x32af9d,null));};exports[_0x5ec7('0xc0')]=function(_0x5943ec,_0x48b030,_0x2e7468){return db[_0x5ec7('0xb4')][_0x5ec7('0xb2')]({'where':{'id':_0x5943ec['params']['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x48b030,null))[_0x5ec7('0x2a')](function(_0x547e4b){if(_0x547e4b){return _0x547e4b[_0x5ec7('0xc1')](_0x5943ec[_0x5ec7('0xb5')][_0x5ec7('0xb8')],_[_0x5ec7('0xb7')](_0x5943ec[_0x5ec7('0xb5')],[_0x5ec7('0xb8'),'id'])||{})[_0x5ec7('0xc2')](function(){return db['Tag']['findAll']({'attributes':['id',_0x5ec7('0x2e'),'color'],'where':{'id':_0x5943ec['body'][_0x5ec7('0xb8')]}});})[_0x5ec7('0x2a')](function(_0x3c8c1e){socket[_0x5ec7('0xc3')](_0x5ec7('0xc4'),{'id':Number(_0x5943ec[_0x5ec7('0xae')]['id']),'tags':_0x3c8c1e||[]});return{'id':Number(_0x5943ec['params']['id']),'tags':_0x3c8c1e||[]};});}})[_0x5ec7('0x2a')](respondWithResult(_0x48b030,null))[_0x5ec7('0xac')](handleError(_0x48b030,null));};exports[_0x5ec7('0xc5')]=function(_0x1b3f57,_0x515355,_0x35e9dc){return db[_0x5ec7('0xb4')][_0x5ec7('0xb2')]({'where':{'id':_0x1b3f57[_0x5ec7('0xae')]['id']}})[_0x5ec7('0x2a')](handleEntityNotFound(_0x515355,null))['then'](function(_0x568a58){if(_0x568a58){return _0x568a58[_0x5ec7('0xc5')](_0x1b3f57[_0x5ec7('0x34')][_0x5ec7('0xb8')]);}})[_0x5ec7('0x2a')](respondWithStatusCode(_0x515355,null))[_0x5ec7('0xac')](handleError(_0x515355,null));};exports[_0x5ec7('0xc6')]=function(_0x56ce4d,_0x30dd19){var _0x58c039=moment()[_0x5ec7('0xc7')]()[_0x5ec7('0x80')]();var _0x18ea82=path[_0x5ec7('0x81')](config['root'],_0x5ec7('0xc8'),_0x5ec7('0xc9'),_0x5ec7('0xca'));var _0x344183=path[_0x5ec7('0x81')](config[_0x5ec7('0xcb')],'server',_0x5ec7('0xc9'),_0x5ec7('0xcc'));var _0x4c66e8=path[_0x5ec7('0x81')](_0x344183,_0x58c039);var _0x2ad8a9=util['format'](_0x5ec7('0xcd'),_0x58c039);var _0x1dc04f=path[_0x5ec7('0x81')](_0x344183,_0x2ad8a9);var _0x1144a5=![];return db['MailInteraction'][_0x5ec7('0xb2')]({'where':{'id':_0x56ce4d[_0x5ec7('0xae')]['id']}})['then'](handleEntityNotFound(_0x30dd19,null))['then'](function(_0x2cf028){if(_0x2cf028){return _0x2cf028[_0x5ec7('0xce')]({'attributes':['id','body',_0x5ec7('0x42'),'to','cc',_0x5ec7('0xcf'),'subject',_0x5ec7('0x76')],'where':{'secret':![]},'include':_0x56ce4d[_0x5ec7('0x34')]['attachments']?[{'model':db[_0x5ec7('0xd0')],'as':_0x5ec7('0xd1')}]:undefined,'order':qs[_0x5ec7('0x3d')]('id')});}return[];})['then'](function(_0x2fe2e2){_0x1144a5=_0x2fe2e2[_0x5ec7('0x39')];if(_0x2fe2e2[_0x5ec7('0x39')]){fs[_0x5ec7('0xd2')](_0x4c66e8);return BPromise['each'](_0x2fe2e2,function(_0x292c4f,_0x5112f8){var _0x48fc5b=_0x292c4f;var _0x338c6f={'from':_0x48fc5b[_0x5ec7('0x42')],'to':_0x48fc5b['to'],'subject':_0x48fc5b[_0x5ec7('0xd3')],'html':_0x48fc5b[_0x5ec7('0xb5')],'headers':{'Date':moment(_0x48fc5b['createdAt'])['format'](_0x5ec7('0xd4'))},'attachments':[]};if(_0x292c4f['cc']){_0x338c6f[_0x5ec7('0xd5')]['Cc']=_0x292c4f['cc'];}if(_0x292c4f['bcc']){_0x338c6f[_0x5ec7('0xd5')][_0x5ec7('0xd6')]=_0x292c4f[_0x5ec7('0xcf')];}return new BPromise(function(_0x1a2a04,_0x20c769){if(_0x292c4f['Attachments']){for(var _0x13f08e=0x0;_0x13f08e<_0x292c4f['Attachments']['length'];_0x13f08e++){var _0x5dce4a=_0x292c4f[_0x5ec7('0xd1')][_0x13f08e];var _0x5909c4=path[_0x5ec7('0x81')](_0x18ea82,_0x5dce4a[_0x5ec7('0xd7')]);if(fs[_0x5ec7('0xd8')](_0x5909c4)){_0x338c6f['attachments']['push']({'name':_0x5dce4a['name'],'contentType':_0x5dce4a[_0x5ec7('0xd9')],'data':fs[_0x5ec7('0xda')](_0x5909c4)});}}}emlformat[_0x5ec7('0xdb')](_0x338c6f,function(_0x761477,_0x2daf51){if(_0x761477)return _0x20c769(_0x761477);fs['writeFileSync'](path[_0x5ec7('0x81')](_0x4c66e8,util['format'](_0x5ec7('0xdc'),_0x5112f8)),_0x2daf51);return _0x1a2a04(_0x2daf51);});});});}})['then'](function(){if(_0x1144a5){return new BPromise(function(_0x270159,_0x4099aa){zipdir(_0x4c66e8,{'saveTo':_0x1dc04f},function(_0x234471,_0x1c7a64){if(_0x234471)return _0x4099aa(_0x234471);return _0x270159(_0x1c7a64);});});}})[_0x5ec7('0x2a')](function(){if(_0x1144a5){return new BPromise(function(_0x30f27e,_0x32f7ae){rimraf(_0x4c66e8,function(_0x5978d9){if(_0x5978d9)_0x32f7ae(_0x5978d9);return _0x30f27e();});});}})[_0x5ec7('0x2a')](function(){if(_0x1144a5){return _0x30dd19[_0x5ec7('0xc6')](_0x1dc04f,_0x2ad8a9,function(_0x4c5214){if(_0x4c5214){console[_0x5ec7('0xdd')](_0x5ec7('0xde'),_0x4c5214);}else{fs[_0x5ec7('0xdf')](_0x1dc04f);}});}else{return _0x30dd19[_0x5ec7('0x20')](0xc8);}})[_0x5ec7('0xac')](handleError(_0x30dd19,null));}; \ No newline at end of file +var _0xd6c7=['users','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','expr','advancedFilter','parse','forEach','createdAt','value','startOf','day','format','utc','isArray','condition','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','Messages.count','ContactId','map','filter','isEmpty','i.MailAccountId\x20IN\x20?','$gte','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','split','push','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','%s\x20=\x200','toString','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Users','Tags','lastMsgText','trimStart','fromString','rows','catch','show','params','includeAll','include','options','create','body','find','describe','addMessage','MailMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','Tag','findAll','color','emit','mailInteractionTags:save','removeTags','unix','root','server','attachments','files','tmp','interaction-%s.zip','bcc','Attachment','each','subject','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','MailInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','mail_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','select','ui.MailInteractionId','user_has_mail_interactions','left_join'];(function(_0xbad06a,_0x36cbe1){var _0x558e2a=function(_0x4158e9){while(--_0x4158e9){_0xbad06a['push'](_0xbad06a['shift']());}};_0x558e2a(++_0x36cbe1);}(_0xd6c7,0x8d));var _0x7d6c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xd6c7[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x7d6c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7d6c('0x1'));var rp=require(_0x7d6c('0x2'));var moment=require(_0x7d6c('0x3'));var BPromise=require(_0x7d6c('0x4'));var Mustache=require(_0x7d6c('0x5'));var util=require(_0x7d6c('0x6'));var path=require(_0x7d6c('0x7'));var sox=require('sox');var csv=require(_0x7d6c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d6c('0x9'));var squel=require(_0x7d6c('0xa'));var crypto=require(_0x7d6c('0xb'));var jsforce=require(_0x7d6c('0xc'));var deskjs=require(_0x7d6c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d6c('0xe'));var htmlToText=require(_0x7d6c('0xf'));var Redis=require(_0x7d6c('0x10'));var authService=require(_0x7d6c('0x11'));var qs=require(_0x7d6c('0x12'));var hardwareService=require(_0x7d6c('0x13'));var logger=require('../../config/logger')(_0x7d6c('0x14'));var utils=require('../../config/utils');var config=require(_0x7d6c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7d6c('0x16')],{'host':_0x7d6c('0x17'),'port':0x18eb});var socket=require(_0x7d6c('0x18'))(new Redis(config[_0x7d6c('0x16')]));require(_0x7d6c('0x19'))[_0x7d6c('0x1a')](socket);function respondWithStatusCode(_0x53a84b,_0x545f64){_0x545f64=_0x545f64||0xcc;return function(_0x1d3ee1){if(_0x1d3ee1){return _0x53a84b[_0x7d6c('0x1b')](_0x545f64);}return _0x53a84b[_0x7d6c('0x1c')](_0x545f64)[_0x7d6c('0x1d')]();};}function respondWithResult(_0x487e2f,_0x1fb08c){_0x1fb08c=_0x1fb08c||0xc8;return function(_0x10b81e){if(_0x10b81e){return _0x487e2f['status'](_0x1fb08c)[_0x7d6c('0x1e')](_0x10b81e);}};}function respondWithFilteredResult(_0x5acd48,_0x43d034){return function(_0x3d0a4a){if(_0x3d0a4a){var _0x27ae74=_0x3d0a4a[_0x7d6c('0x1f')],_0x125aca=_0x43d034[_0x7d6c('0x20')],_0x6d1e54=_0x43d034['offset']+_0x43d034[_0x7d6c('0x21')],_0x4cede4;if(_0x6d1e54>=_0x27ae74){_0x6d1e54=_0x27ae74;_0x4cede4=0xc8;}else{_0x4cede4=0xce;}_0x5acd48[_0x7d6c('0x1c')](_0x4cede4);return _0x5acd48[_0x7d6c('0x22')]('Content-Range',_0x125aca+'-'+_0x6d1e54+'/'+_0x27ae74)['json'](_0x3d0a4a);}return null;};}function patchUpdates(_0xb77fd0){return function(_0x304dde){try{jsonpatch['apply'](_0x304dde,_0xb77fd0,!![]);}catch(_0x1b794b){return BPromise[_0x7d6c('0x23')](_0x1b794b);}return _0x304dde[_0x7d6c('0x24')]();};}function saveUpdates(_0x470e7b,_0x56f34b){return function(_0x5d098b){if(_0x5d098b){return _0x5d098b[_0x7d6c('0x25')](_0x470e7b)['then'](function(_0x291cb2){return _0x291cb2;});}return null;};}function removeEntity(_0x27559d,_0x4d18a1){return function(_0x1d0a39){if(_0x1d0a39){return _0x1d0a39[_0x7d6c('0x26')]()[_0x7d6c('0x27')](function(){_0x27559d[_0x7d6c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447fae,_0xa21912){return function(_0x336733){if(!_0x336733){_0x447fae[_0x7d6c('0x1b')](0x194);}return _0x336733;};}function handleError(_0x410f6b,_0x126d9c){_0x126d9c=_0x126d9c||0x1f4;return function(_0x3c0a71){logger[_0x7d6c('0x28')](_0x3c0a71[_0x7d6c('0x29')]);if(_0x3c0a71[_0x7d6c('0x2a')]){delete _0x3c0a71[_0x7d6c('0x2a')];}_0x410f6b[_0x7d6c('0x1c')](_0x126d9c)[_0x7d6c('0x2b')](_0x3c0a71);};}exports[_0x7d6c('0x2c')]=function(_0x1b42f0,_0x54956e){var _0x2ba8be={},_0x181b93={},_0x206a6d={'count':0x0,'rows':[]};var _0x541191=db[_0x7d6c('0x2d')][_0x7d6c('0x2e')];_0x181b93[_0x7d6c('0x2f')]=_[_0x7d6c('0x30')](_0x541191);_0x181b93['query']=_['keys'](_0x1b42f0[_0x7d6c('0x31')]);_0x181b93[_0x7d6c('0x32')]=_[_0x7d6c('0x33')](_0x181b93[_0x7d6c('0x2f')],_0x181b93['query']);_0x2ba8be[_0x7d6c('0x34')]=_[_0x7d6c('0x33')](_0x181b93[_0x7d6c('0x2f')],qs[_0x7d6c('0x35')](_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x35')]));_0x2ba8be[_0x7d6c('0x34')]=_0x2ba8be[_0x7d6c('0x34')][_0x7d6c('0x36')]?_0x2ba8be[_0x7d6c('0x34')]:_0x181b93[_0x7d6c('0x2f')];if(!_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x37')](_0x7d6c('0x38'))){_0x2ba8be[_0x7d6c('0x21')]=qs[_0x7d6c('0x21')](_0x1b42f0['query'][_0x7d6c('0x21')]);_0x2ba8be['offset']=qs[_0x7d6c('0x20')](_0x1b42f0[_0x7d6c('0x31')]['offset']);}_0x2ba8be[_0x7d6c('0x39')]=qs[_0x7d6c('0x3a')](_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x3a')]);_0x2ba8be[_0x7d6c('0x3b')]=qs[_0x7d6c('0x32')](_[_0x7d6c('0x3c')](_0x1b42f0[_0x7d6c('0x31')],_0x181b93[_0x7d6c('0x32')]));var _0x5d64fb=[];var _0x184861=squel['select']()[_0x7d6c('0x3d')]('id')['field'](_0x7d6c('0x2a'))[_0x7d6c('0x3d')]('color')[_0x7d6c('0x3e')](_0x7d6c('0x3f'));var _0x41799e=squel['select']()[_0x7d6c('0x3d')]('COUNT(*)')['from'](_0x7d6c('0x40'),'me')[_0x7d6c('0x3b')]('me.MailInteractionId\x20=\x20i.id')['where'](_0x7d6c('0x41'))[_0x7d6c('0x3b')](_0x7d6c('0x42'));var _0x599576=squel[_0x7d6c('0x43')]()[_0x7d6c('0x3d')]('u.id')[_0x7d6c('0x3d')](_0x7d6c('0x44'))[_0x7d6c('0x3e')](_0x7d6c('0x45'),'ui')[_0x7d6c('0x46')](_0x7d6c('0x47'),'u',_0x7d6c('0x48'));var _0x4f9838=squel[_0x7d6c('0x43')]()[_0x7d6c('0x3e')](_0x7d6c('0x49'),'i')[_0x7d6c('0x46')](_0x7d6c('0x45'),'ui',_0x7d6c('0x4a'))[_0x7d6c('0x46')](_0x7d6c('0x47'),'u',_0x7d6c('0x48'))['left_join'](_0x7d6c('0x4b'),'c',_0x7d6c('0x4c'))[_0x7d6c('0x46')]('users','o','o.id\x20=\x20i.UserId')[_0x7d6c('0x46')](_0x7d6c('0x4d'),'a',_0x7d6c('0x4e'))[_0x7d6c('0x46')](_0x7d6c('0x40'),'me','me.MailInteractionId\x20=\x20i.id');var _0x1ca44c=squel[_0x7d6c('0x4f')]();if(_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x50')]){var _0x5a5af7=JSON[_0x7d6c('0x51')](_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x50')]);_['keys'](_0x5a5af7)[_0x7d6c('0x52')](function(_0x935eac){var _0x5db6d5=_0x5a5af7[_0x935eac];if(_0x935eac===_0x7d6c('0x53')){var _0x3a9790=moment(_0x5db6d5[_0x7d6c('0x54')]['dateStart'])[_0x7d6c('0x55')](_0x7d6c('0x56'))['utc']()[_0x7d6c('0x57')]();var _0x58d2a5=moment(_0x58d2a5)[_0x7d6c('0x58')]()['endOf']('day')[_0x7d6c('0x57')]();_0x1ca44c['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a9790,_0x58d2a5);}else{if(_[_0x7d6c('0x59')](_0x5db6d5[_0x7d6c('0x5a')])){_0x5db6d5[_0x7d6c('0x5a')]['forEach'](function(_0x329bdf){switch(_0x5db6d5['condition'][_0x7d6c('0x54')]){case'IS':if(_0x935eac!=='TagId'&&_0x935eac!=='Messages.count'){if(_['isArray'](_0x5db6d5['value'])&&_0x5db6d5['value']['length']>0x1){_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x5d'),_0x5db6d5[_0x7d6c('0x54')]);}else{_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5['tableAlias']+'.'+_0x935eac+'\x20=\x20?',_0x5db6d5[_0x7d6c('0x54')][0x0]);}}break;case'=':_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x5e'),_0x5db6d5[_0x7d6c('0x54')]);break;case _0x7d6c('0x5f'):if(_0x935eac==='ContactId'){_0x1ca44c['and'](_0x7d6c('0x60')+'\x20LIKE\x20?','%'+_0x5db6d5[_0x7d6c('0x54')]+'%');_0x1ca44c['or'](_0x7d6c('0x61')+_0x7d6c('0x62'),'%'+_0x5db6d5[_0x7d6c('0x54')]+'%');_0x1ca44c['or'](_0x7d6c('0x63')+'\x20LIKE\x20?','%'+_0x5db6d5['value']+'%');}else{_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x62'),'%'+_0x5db6d5['value']+'%');}break;case'>':_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x64'),_0x5db6d5['value']);break;case'<':_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x65'),_0x5db6d5['value']);break;}});}else{switch(_0x5db6d5[_0x7d6c('0x5a')]['value']){case'IS':if(_0x935eac!==_0x7d6c('0x66')&&_0x935eac!==_0x7d6c('0x67')){if(_[_0x7d6c('0x59')](_0x5db6d5['value'])&&_0x5db6d5[_0x7d6c('0x54')][_0x7d6c('0x36')]>0x1){_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5['tableAlias']+'.'+_0x935eac+_0x7d6c('0x5d'),_0x5db6d5[_0x7d6c('0x54')]);}else{_0x1ca44c['and'](_0x5db6d5['tableAlias']+'.'+_0x935eac+'\x20=\x20?',_0x5db6d5['value'][0x0]);}}break;case'=':_0x1ca44c['and'](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x5e'),_0x5db6d5[_0x7d6c('0x54')]);break;case'LIKE':if(_0x935eac===_0x7d6c('0x68')){_0x1ca44c['and']('c.firstName'+_0x7d6c('0x62'),'%'+_0x5db6d5[_0x7d6c('0x54')]+'%');_0x1ca44c['or'](_0x7d6c('0x61')+'\x20LIKE\x20?','%'+_0x5db6d5[_0x7d6c('0x54')]+'%');_0x1ca44c['or']('c.email'+'\x20LIKE\x20?','%'+_0x5db6d5[_0x7d6c('0x54')]+'%');}else{_0x1ca44c['and'](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x62'),'%'+_0x5db6d5['value']+'%');}break;case'>':_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x64'),_0x5db6d5[_0x7d6c('0x54')]);break;case'<':_0x1ca44c[_0x7d6c('0x5b')](_0x5db6d5[_0x7d6c('0x5c')]+'.'+_0x935eac+_0x7d6c('0x65'),_0x5db6d5['value']);break;}}}});}else{var _0xd8439=_(Object[_0x7d6c('0x30')](_0x1b42f0[_0x7d6c('0x31')]))[_0x7d6c('0x69')](function(_0x7b5ea8){return _0x541191[_0x7d6c('0x37')](_0x7b5ea8)?_0x7b5ea8:undefined;})[_0x7d6c('0x6a')](function(_0x267945){return!_['isNil'](_0x267945);})['value']();if(!_[_0x7d6c('0x6b')](_0xd8439)){_0xd8439['forEach'](function(_0x151511){if(_0x151511==='MailAccountId'){_0x4f9838[_0x7d6c('0x3b')](_0x7d6c('0x6c'),[]['concat'](_0x1b42f0[_0x7d6c('0x31')][_0x151511]));}else if(_0x151511===_0x7d6c('0x53')){var _0x3f5960=JSON[_0x7d6c('0x51')](_0x1b42f0[_0x7d6c('0x31')][_0x151511])[_0x7d6c('0x6d')];var _0x138211=JSON[_0x7d6c('0x51')](_0x1b42f0[_0x7d6c('0x31')][_0x151511])[_0x7d6c('0x6e')];_0x4f9838[_0x7d6c('0x3b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3f5960,_0x138211);}else{_0x4f9838[_0x7d6c('0x3b')]('i.'+_0x151511+_0x7d6c('0x5e'),_0x1b42f0[_0x7d6c('0x31')][_0x151511]);}});}if(_0x1b42f0[_0x7d6c('0x31')]['filter']){var _0x430679=_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x6a')][_0x7d6c('0x6f')]('\x5c','\x5c\x5c')[_0x7d6c('0x6f')]('\x27\x27',_0x7d6c('0x70'));if(qs[_0x7d6c('0x71')](_0x430679)){_0x1ca44c['or'](_0x7d6c('0x72'),_0x430679+'%');}else if(qs['isEmail'](_0x430679)){_0x1ca44c['or'](_0x7d6c('0x73'),_0x430679+'%');}else{var _0x507791=[];_0x430679[_0x7d6c('0x74')]('\x20')[_0x7d6c('0x52')](function(_0x2d9fb8){_0x507791[_0x7d6c('0x75')]('+'+_0x2d9fb8['toString']());});var _0x1d9f6d=_0x507791[_0x7d6c('0x76')]('\x20');_0x1ca44c['or'](_0x7d6c('0x77'),_0x1d9f6d)['or'](_0x7d6c('0x78'),_0x1d9f6d);}}}_0x4f9838[_0x7d6c('0x3b')](_0x1ca44c);if(_0x2ba8be[_0x7d6c('0x39')]){_0x2ba8be[_0x7d6c('0x39')][_0x7d6c('0x52')](function(_0xcc6c9a){_0x4f9838[_0x7d6c('0x39')]('i.'+_0xcc6c9a[0x0],_0xcc6c9a[0x1]==='DESC'?![]:!![]);});}_0x4f9838[_0x7d6c('0x79')](_0x7d6c('0x7a'));var _0x34945a={'type':db[_0x7d6c('0x7b')][_0x7d6c('0x7c')][_0x7d6c('0x7d')],'raw':!![]};var _0x1c393d=_0x4f9838[_0x7d6c('0x7e')]()[_0x7d6c('0x3d')](_0x7d6c('0x7f'));if(!_0x1b42f0[_0x7d6c('0x31')]['advancedFilter']){if(_0x1b42f0[_0x7d6c('0x31')]['read']){if(_0x1b42f0['query']['read']==0x1){_0x1c393d[_0x7d6c('0x3b')](util[_0x7d6c('0x57')](_0x7d6c('0x80'),_0x41799e[_0x7d6c('0x81')]()));_0x4f9838[_0x7d6c('0x82')](_0x7d6c('0x83'));}else{_0x1c393d[_0x7d6c('0x3b')](util['format'](_0x7d6c('0x84'),_0x41799e[_0x7d6c('0x81')]()));_0x4f9838[_0x7d6c('0x82')](_0x7d6c('0x85'));}}if(_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x86')]){var _0xf7ae9d=_[_0x7d6c('0x59')](_0x1b42f0[_0x7d6c('0x31')]['tag'])?_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x86')]:new Array(_0x1b42f0['query'][_0x7d6c('0x86')]);var _0x89bf70=squel[_0x7d6c('0x4f')]();_0xf7ae9d[_0x7d6c('0x52')](function(_0x3fdc3c){_0x89bf70['or'](_0x7d6c('0x87'),'%,'+_0x3fdc3c+',%');});_0x4f9838['having'](_0x89bf70);_0x1c393d[_0x7d6c('0x46')](_0x7d6c('0x88'),'it','it.MailInteractionId\x20=\x20i.id');_0x1c393d[_0x7d6c('0x46')](_0x7d6c('0x3f'),'t','t.id\x20=\x20it.TagId');_0x1c393d[_0x7d6c('0x3b')](_0x7d6c('0x89'),_0xf7ae9d);}}else{var _0x5a5af7=JSON['parse'](_0x1b42f0[_0x7d6c('0x31')][_0x7d6c('0x50')]);_['keys'](_0x5a5af7)[_0x7d6c('0x52')](function(_0x47fed9){var _0x20b5a7=_0x5a5af7[_0x47fed9];if(_0x47fed9===_0x7d6c('0x66')){var _0x13d2b6=_0x20b5a7['value'];var _0x377274=squel[_0x7d6c('0x4f')]();_0x13d2b6[_0x7d6c('0x52')](function(_0x3c5b3b){_0x377274['or'](_0x7d6c('0x87'),'%,'+_0x3c5b3b+',%');});_0x4f9838[_0x7d6c('0x82')](_0x377274);_0x1c393d[_0x7d6c('0x46')](_0x7d6c('0x88'),'it',_0x7d6c('0x8a'));_0x1c393d['left_join'](_0x7d6c('0x3f'),'t','t.id\x20=\x20it.TagId');_0x1c393d[_0x7d6c('0x3b')](_0x7d6c('0x89'),_0x13d2b6);}else if(_0x47fed9==='Messages.count'){if(_0x20b5a7[_0x7d6c('0x54')][_0x7d6c('0x36')]===0x1){if(_0x20b5a7['value'][0x0]===0x1){_0x1c393d[_0x7d6c('0x3b')](util['format'](_0x7d6c('0x80'),_0x41799e[_0x7d6c('0x81')]()));_0x4f9838[_0x7d6c('0x82')](_0x7d6c('0x83'));}else{_0x1c393d[_0x7d6c('0x3b')](util['format']('%s\x20>\x200',_0x41799e[_0x7d6c('0x81')]()));_0x4f9838[_0x7d6c('0x82')](_0x7d6c('0x85'));}}}});}db[_0x7d6c('0x8b')][_0x7d6c('0x31')](_0x1c393d[_0x7d6c('0x81')](),_0x34945a)[_0x7d6c('0x27')](function(_0x4a02b9){_0x206a6d['count']=_0x4a02b9['length'];if(_0x206a6d[_0x7d6c('0x1f')]===0x0)return[];return db[_0x7d6c('0x8b')]['query'](_0x184861[_0x7d6c('0x81')](),_0x34945a)['then'](function(_0x3aadba){_0x5d64fb=_[_0x7d6c('0x8c')](_0x3aadba,'id');_0x34945a=_[_0x7d6c('0x8d')](_0x34945a,{'model':db[_0x7d6c('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4f9838[_0x7d6c('0x3d')](_0x41799e,_0x7d6c('0x67'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x8e'),_0x7d6c('0x8f'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x90'));_0x4f9838['field'](_0x7d6c('0x60'),_0x7d6c('0x91'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x61'),_0x7d6c('0x92'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x63'),'Contact.email');_0x4f9838[_0x7d6c('0x3d')]('c.phone',_0x7d6c('0x93'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x94'),_0x7d6c('0x95'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x96'),_0x7d6c('0x97'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x98'),_0x7d6c('0x99'));_0x4f9838[_0x7d6c('0x3d')](_0x7d6c('0x9a'),_0x7d6c('0x9b'));_0x4f9838[_0x7d6c('0x46')](_0x7d6c('0x88'),'it',_0x7d6c('0x8a'));_0x4f9838[_0x7d6c('0x46')](_0x7d6c('0x3f'),'t','t.id\x20=\x20it.TagId');_0x4f9838[_0x7d6c('0x21')](_0x2ba8be[_0x7d6c('0x21')]);_0x4f9838[_0x7d6c('0x20')](_0x2ba8be[_0x7d6c('0x20')]);return db['sequelize']['query'](_0x4f9838[_0x7d6c('0x81')](),_0x34945a);})[_0x7d6c('0x27')](function(_0x352203){_0x599576[_0x7d6c('0x3b')](_0x7d6c('0x9c'),_[_0x7d6c('0x69')](_0x352203,'id'));return db['sequelize'][_0x7d6c('0x31')](_0x599576[_0x7d6c('0x81')](),_0x34945a)['then'](function(_0x44e92c){var _0x239001=_[_0x7d6c('0x9d')](_0x44e92c,_0x7d6c('0x9e'));_0x352203[_0x7d6c('0x52')](function(_0x282951){if(_0x239001[_0x282951['id']]){_0x282951[_0x7d6c('0x9f')]=_[_0x7d6c('0x69')](_0x239001[_0x282951['id']],function(_0x15ce53){return{'id':_0x15ce53['id']};});}if(_0x282951[_0x7d6c('0x9b')]){_0x282951['Tags']=[];_0x282951[_0x7d6c('0x9b')][_0x7d6c('0x74')](',')['forEach'](function(_0x19da65){_0x282951[_0x7d6c('0xa0')][_0x7d6c('0x75')](_0x5d64fb[_0x19da65]);});}delete _0x282951[_0x7d6c('0x9b')];if(!_0x282951[_0x7d6c('0xa1')]){_0x282951['lastMsgText']=_[_0x7d6c('0xa2')](htmlToText[_0x7d6c('0xa3')](_0x282951['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x352203;});});})[_0x7d6c('0x27')](function(_0x1b591f){_0x206a6d[_0x7d6c('0xa4')]=_0x1b591f;return _0x206a6d;})[_0x7d6c('0x27')](respondWithFilteredResult(_0x54956e,_0x2ba8be))[_0x7d6c('0xa5')](handleError(_0x54956e,null));};exports[_0x7d6c('0xa6')]=function(_0xe6856b,_0x28bd2d){var _0x38edb7={'raw':![],'where':{'id':_0xe6856b[_0x7d6c('0xa7')]['id']}},_0x13c244={};_0x13c244['model']=_['keys'](db[_0x7d6c('0x2d')][_0x7d6c('0x2e')]);_0x13c244['query']=_[_0x7d6c('0x30')](_0xe6856b[_0x7d6c('0x31')]);_0x13c244[_0x7d6c('0x32')]=_['intersection'](_0x13c244[_0x7d6c('0x2f')],_0x13c244['query']);_0x38edb7[_0x7d6c('0x34')]=_[_0x7d6c('0x33')](_0x13c244[_0x7d6c('0x2f')],qs['fields'](_0xe6856b[_0x7d6c('0x31')]['fields']));_0x38edb7[_0x7d6c('0x34')]=_0x38edb7[_0x7d6c('0x34')][_0x7d6c('0x36')]?_0x38edb7[_0x7d6c('0x34')]:_0x13c244[_0x7d6c('0x2f')];if(_0xe6856b['query'][_0x7d6c('0xa8')]){_0x38edb7[_0x7d6c('0xa9')]=[{'all':!![]}];}_0x38edb7=_[_0x7d6c('0x8d')]({},_0x38edb7,_0xe6856b[_0x7d6c('0xaa')]);return db[_0x7d6c('0x2d')]['find'](_0x38edb7)[_0x7d6c('0x27')](handleEntityNotFound(_0x28bd2d,null))[_0x7d6c('0x27')](respondWithResult(_0x28bd2d,null))[_0x7d6c('0xa5')](handleError(_0x28bd2d,null));};exports[_0x7d6c('0xab')]=function(_0x384d81,_0x9208a8){return db['MailInteraction'][_0x7d6c('0xab')](_0x384d81[_0x7d6c('0xac')],{})[_0x7d6c('0x27')](respondWithResult(_0x9208a8,0xc9))[_0x7d6c('0xa5')](handleError(_0x9208a8,null));};exports[_0x7d6c('0x25')]=function(_0x44c0a1,_0x34ee6d){if(_0x44c0a1[_0x7d6c('0xac')]['id']){delete _0x44c0a1[_0x7d6c('0xac')]['id'];}return db[_0x7d6c('0x2d')]['find']({'where':{'id':_0x44c0a1[_0x7d6c('0xa7')]['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0x34ee6d,null))[_0x7d6c('0x27')](saveUpdates(_0x44c0a1[_0x7d6c('0xac')],null))['then'](respondWithResult(_0x34ee6d,null))['catch'](handleError(_0x34ee6d,null));};exports[_0x7d6c('0x26')]=function(_0x513d80,_0x4d0fc6){return db[_0x7d6c('0x2d')][_0x7d6c('0xad')]({'where':{'id':_0x513d80['params']['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0x4d0fc6,null))[_0x7d6c('0x27')](removeEntity(_0x4d0fc6,null))['catch'](handleError(_0x4d0fc6,null));};exports[_0x7d6c('0xae')]=function(_0x2bc38c,_0x1faeb8){return db[_0x7d6c('0x2d')][_0x7d6c('0xae')]()[_0x7d6c('0x27')](respondWithResult(_0x1faeb8,null))[_0x7d6c('0xa5')](handleError(_0x1faeb8,null));};exports[_0x7d6c('0xaf')]=function(_0x4cf68f,_0x1e94da,_0x58f01a){return db[_0x7d6c('0xb0')][_0x7d6c('0xad')]({'where':{'id':_0x4cf68f[_0x7d6c('0xa7')]['id']}})['then'](handleEntityNotFound(_0x1e94da,null))[_0x7d6c('0x27')](function(_0x1c41ef){if(_0x1c41ef){return _0x1c41ef['addMessage'](_0x4cf68f[_0x7d6c('0xac')][_0x7d6c('0xb1')],_[_0x7d6c('0xb2')](_0x4cf68f['body'],[_0x7d6c('0xb1'),'id'])||{});}})[_0x7d6c('0x27')](respondWithResult(_0x1e94da,null))[_0x7d6c('0xa5')](handleError(_0x1e94da,null));};exports[_0x7d6c('0xb3')]=function(_0x278be3,_0xf35446,_0x3dfc8){var _0x1c37e1={'raw':![],'where':{}};var _0x264273={};var _0x1c9aba={'count':0x0,'rows':[]};return db[_0x7d6c('0x2d')]['findOne']({'where':{'id':_0x278be3[_0x7d6c('0xa7')]['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0xf35446,null))['then'](function(_0x449bd4){if(_0x449bd4){_0x264273[_0x7d6c('0x2f')]=_[_0x7d6c('0x30')](db[_0x7d6c('0xb0')][_0x7d6c('0x2e')]);_0x264273[_0x7d6c('0x31')]=_['keys'](_0x278be3[_0x7d6c('0x31')]);_0x264273[_0x7d6c('0x32')]=_[_0x7d6c('0x33')](_0x264273[_0x7d6c('0x2f')],_0x264273['query']);_0x1c37e1[_0x7d6c('0x34')]=_[_0x7d6c('0x33')](_0x264273[_0x7d6c('0x2f')],qs[_0x7d6c('0x35')](_0x278be3['query'][_0x7d6c('0x35')]));_0x1c37e1[_0x7d6c('0x34')]=_0x1c37e1['attributes'][_0x7d6c('0x36')]?_0x1c37e1[_0x7d6c('0x34')]:_0x264273[_0x7d6c('0x2f')];if(!_0x278be3[_0x7d6c('0x31')][_0x7d6c('0x37')](_0x7d6c('0x38'))){_0x1c37e1[_0x7d6c('0x21')]=qs['limit'](_0x278be3['query']['limit']);_0x1c37e1[_0x7d6c('0x20')]=qs['offset'](_0x278be3[_0x7d6c('0x31')][_0x7d6c('0x20')]);}_0x1c37e1[_0x7d6c('0x39')]=qs[_0x7d6c('0x3a')](_0x278be3[_0x7d6c('0x31')][_0x7d6c('0x3a')]);_0x1c37e1[_0x7d6c('0x3b')]=qs[_0x7d6c('0x32')](_['pick'](_0x278be3[_0x7d6c('0x31')],_0x264273['filters']));_0x1c37e1[_0x7d6c('0x3b')][_0x7d6c('0x9e')]=_0x449bd4['id'];if(_0x278be3[_0x7d6c('0x31')]['filter']){_0x1c37e1['where']=_[_0x7d6c('0x8d')](_0x1c37e1['where'],{'$or':_[_0x7d6c('0x69')](_0x1c37e1[_0x7d6c('0x34')],function(_0x3f7ce1){var _0x329a7b={};_0x329a7b[_0x3f7ce1]={'$like':'%'+_0x278be3[_0x7d6c('0x31')][_0x7d6c('0x6a')]+'%'};return _0x329a7b;})});}if(_0x278be3[_0x7d6c('0x31')]['$gte']){var _0x145a68=_0x278be3[_0x7d6c('0x31')][_0x7d6c('0x6d')][_0x7d6c('0x74')](',');var _0x4471dc={};_0x4471dc[_0x145a68[0x0]]={'$gte':moment(_0x145a68[0x1])[_0x7d6c('0x57')](_0x7d6c('0xb4'))};_0x1c37e1[_0x7d6c('0x3b')]=_[_0x7d6c('0x8d')](_0x1c37e1[_0x7d6c('0x3b')],_0x4471dc);}_0x1c37e1=_[_0x7d6c('0x8d')]({},_0x1c37e1,_0x278be3[_0x7d6c('0xaa')]);return db[_0x7d6c('0xb0')][_0x7d6c('0x1f')]({'where':_0x1c37e1[_0x7d6c('0x3b')]})['then'](function(_0x43e442){_0x1c9aba['count']=_0x43e442;if(_0x278be3[_0x7d6c('0x31')][_0x7d6c('0xa8')]){_0x1c37e1[_0x7d6c('0xa9')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x1c37e1);})[_0x7d6c('0x27')](function(_0x3718bd){_0x1c9aba['rows']=_0x3718bd;return _0x1c9aba;});}})[_0x7d6c('0x27')](respondWithFilteredResult(_0xf35446,_0x1c37e1))[_0x7d6c('0xa5')](handleError(_0xf35446,null));};exports[_0x7d6c('0xb5')]=function(_0x12325d,_0x3dc67f,_0x4c63ae){return db[_0x7d6c('0x2d')][_0x7d6c('0xad')]({'where':{'id':_0x12325d['params']['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0x3dc67f,null))['then'](function(_0x518ac1){if(_0x518ac1){return _0x518ac1['setTags'](_0x12325d[_0x7d6c('0xac')][_0x7d6c('0xb1')],_['omit'](_0x12325d[_0x7d6c('0xac')],[_0x7d6c('0xb1'),'id'])||{})[_0x7d6c('0xb6')](function(){return db[_0x7d6c('0xb7')][_0x7d6c('0xb8')]({'attributes':['id','name',_0x7d6c('0xb9')],'where':{'id':_0x12325d[_0x7d6c('0xac')][_0x7d6c('0xb1')]}});})['then'](function(_0x2b78ab){socket[_0x7d6c('0xba')](_0x7d6c('0xbb'),{'id':Number(_0x12325d[_0x7d6c('0xa7')]['id']),'tags':_0x2b78ab||[]});return{'id':Number(_0x12325d[_0x7d6c('0xa7')]['id']),'tags':_0x2b78ab||[]};});}})['then'](respondWithResult(_0x3dc67f,null))['catch'](handleError(_0x3dc67f,null));};exports['removeTags']=function(_0x31498b,_0x1bc2ba,_0x15cc52){return db['MailInteraction']['find']({'where':{'id':_0x31498b[_0x7d6c('0xa7')]['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0x1bc2ba,null))[_0x7d6c('0x27')](function(_0x828355){if(_0x828355){return _0x828355[_0x7d6c('0xbc')](_0x31498b[_0x7d6c('0x31')][_0x7d6c('0xb1')]);}})[_0x7d6c('0x27')](respondWithStatusCode(_0x1bc2ba,null))[_0x7d6c('0xa5')](handleError(_0x1bc2ba,null));};exports['download']=function(_0x1d3e32,_0x38ca22){var _0x112b76=moment()[_0x7d6c('0xbd')]()[_0x7d6c('0x81')]();var _0x2ff0e3=path[_0x7d6c('0x76')](config[_0x7d6c('0xbe')],_0x7d6c('0xbf'),'files',_0x7d6c('0xc0'));var _0x607ab2=path[_0x7d6c('0x76')](config[_0x7d6c('0xbe')],_0x7d6c('0xbf'),_0x7d6c('0xc1'),_0x7d6c('0xc2'));var _0x56e60b=path[_0x7d6c('0x76')](_0x607ab2,_0x112b76);var _0x3343e4=util['format'](_0x7d6c('0xc3'),_0x112b76);var _0x4ab4a7=path[_0x7d6c('0x76')](_0x607ab2,_0x3343e4);var _0x2060ae=![];return db[_0x7d6c('0x2d')]['find']({'where':{'id':_0x1d3e32[_0x7d6c('0xa7')]['id']}})[_0x7d6c('0x27')](handleEntityNotFound(_0x38ca22,null))[_0x7d6c('0x27')](function(_0x11ccbe){if(_0x11ccbe){return _0x11ccbe[_0x7d6c('0xb3')]({'attributes':['id',_0x7d6c('0xac'),_0x7d6c('0x3e'),'to','cc',_0x7d6c('0xc4'),'subject',_0x7d6c('0x53')],'where':{'secret':![]},'include':_0x1d3e32[_0x7d6c('0x31')][_0x7d6c('0xc0')]?[{'model':db[_0x7d6c('0xc5')],'as':'Attachments'}]:undefined,'order':qs[_0x7d6c('0x3a')]('id')});}return[];})['then'](function(_0x447988){_0x2060ae=_0x447988[_0x7d6c('0x36')];if(_0x447988[_0x7d6c('0x36')]){fs['mkdirSync'](_0x56e60b);return BPromise[_0x7d6c('0xc6')](_0x447988,function(_0x2bbc8c,_0x5b6da8){var _0x2aca1f=_0x2bbc8c;var _0x2eec0d={'from':_0x2aca1f[_0x7d6c('0x3e')],'to':_0x2aca1f['to'],'subject':_0x2aca1f[_0x7d6c('0xc7')],'html':_0x2aca1f[_0x7d6c('0xac')],'headers':{'Date':moment(_0x2aca1f['createdAt'])[_0x7d6c('0x57')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2bbc8c['cc']){_0x2eec0d['headers']['Cc']=_0x2bbc8c['cc'];}if(_0x2bbc8c[_0x7d6c('0xc4')]){_0x2eec0d['headers'][_0x7d6c('0xc8')]=_0x2bbc8c[_0x7d6c('0xc4')];}return new BPromise(function(_0xeb6d4e,_0x19dd72){if(_0x2bbc8c[_0x7d6c('0xc9')]){for(var _0x488720=0x0;_0x488720<_0x2bbc8c[_0x7d6c('0xc9')][_0x7d6c('0x36')];_0x488720++){var _0x394725=_0x2bbc8c[_0x7d6c('0xc9')][_0x488720];var _0x4339e4=path[_0x7d6c('0x76')](_0x2ff0e3,_0x394725[_0x7d6c('0xca')]);if(fs[_0x7d6c('0xcb')](_0x4339e4)){_0x2eec0d[_0x7d6c('0xc0')][_0x7d6c('0x75')]({'name':_0x394725['name'],'contentType':_0x394725['type'],'data':fs[_0x7d6c('0xcc')](_0x4339e4)});}}}emlformat[_0x7d6c('0xcd')](_0x2eec0d,function(_0x15caa1,_0x571f5b){if(_0x15caa1)return _0x19dd72(_0x15caa1);fs[_0x7d6c('0xce')](path[_0x7d6c('0x76')](_0x56e60b,util[_0x7d6c('0x57')](_0x7d6c('0xcf'),_0x5b6da8)),_0x571f5b);return _0xeb6d4e(_0x571f5b);});});});}})[_0x7d6c('0x27')](function(){if(_0x2060ae){return new BPromise(function(_0x148776,_0x2dd916){zipdir(_0x56e60b,{'saveTo':_0x4ab4a7},function(_0x52910f,_0x2aa228){if(_0x52910f)return _0x2dd916(_0x52910f);return _0x148776(_0x2aa228);});});}})['then'](function(){if(_0x2060ae){return new BPromise(function(_0x503953,_0x15122f){rimraf(_0x56e60b,function(_0x3078a2){if(_0x3078a2)_0x15122f(_0x3078a2);return _0x503953();});});}})[_0x7d6c('0x27')](function(){if(_0x2060ae){return _0x38ca22[_0x7d6c('0xd0')](_0x4ab4a7,_0x3343e4,function(_0x576ac3){if(_0x576ac3){console[_0x7d6c('0xd1')](_0x7d6c('0xd2'),_0x576ac3);}else{fs[_0x7d6c('0xd3')](_0x4ab4a7);}});}else{return _0x38ca22[_0x7d6c('0x1b')](0xc8);}})[_0x7d6c('0xa5')](handleError(_0x38ca22,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 48e27dd..4e311db 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 _0x829b=['remove','emit','hasOwnProperty','hook','exports','events','MailInteraction','update'];(function(_0x21ce09,_0x80e5e6){var _0x4dfa41=function(_0x26a432){while(--_0x26a432){_0x21ce09['push'](_0x21ce09['shift']());}};_0x4dfa41(++_0x80e5e6);}(_0x829b,0xdd));var _0xb829=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x829b[_0x381589];return _0x2a075d;};'use strict';var EventEmitter=require(_0xb829('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xb829('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb829('0x2'),'afterDestroy':_0xb829('0x3')};function emitEvent(_0x3e5412){return function(_0x412e2b,_0x5523d1,_0x26dc6a){MailInteractionEvents[_0xb829('0x4')](_0x3e5412+':'+_0x412e2b['id'],_0x412e2b);MailInteractionEvents[_0xb829('0x4')](_0x3e5412,_0x412e2b);_0x26dc6a(null);};}for(var e in events){if(events[_0xb829('0x5')](e)){var event=events[e];MailInteraction[_0xb829('0x6')](e,emitEvent(event));}}module[_0xb829('0x7')]=MailInteractionEvents; \ No newline at end of file +var _0x9adc=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x2405c9,_0x1d4dbf){var _0x56c8a3=function(_0x247114){while(--_0x247114){_0x2405c9['push'](_0x2405c9['shift']());}};_0x56c8a3(++_0x1d4dbf);}(_0x9adc,0x8d));var _0xc9ad=function(_0x151c5b,_0x58a7e5){_0x151c5b=_0x151c5b-0x0;var _0x3fd4fa=_0x9adc[_0x151c5b];return _0x3fd4fa;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xc9ad('0x0'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc9ad('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9ad('0x2'),'afterDestroy':_0xc9ad('0x3')};function emitEvent(_0x22a565){return function(_0x3edf4b,_0x47c1cf,_0x1e2b16){MailInteractionEvents['emit'](_0x22a565+':'+_0x3edf4b['id'],_0x3edf4b);MailInteractionEvents[_0xc9ad('0x4')](_0x22a565,_0x3edf4b);_0x1e2b16(null);};}for(var e in events){if(events[_0xc9ad('0x5')](e)){var event=events[e];MailInteraction[_0xc9ad('0x6')](e,emitEvent(event));}}module[_0xc9ad('0x7')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 50306af..f4ff272 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 _0x9181=['substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','FULLTEXT'];(function(_0x2524df,_0x2db2b8){var _0x546816=function(_0x357e92){while(--_0x357e92){_0x2524df['push'](_0x2524df['shift']());}};_0x546816(++_0x2db2b8);}(_0x9181,0x182));var _0x1918=function(_0x112b06,_0x4d3f42){_0x112b06=_0x112b06-0x0;var _0x2f27f7=_0x9181[_0x112b06];return _0x2f27f7;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var logger=require(_0x1918('0x2'))(_0x1918('0x3'));var moment=require(_0x1918('0x4'));var BPromise=require('bluebird');var rp=require(_0x1918('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var attributes=require(_0x1918('0x8'));module[_0x1918('0x9')]=function(_0x424951,_0x4106d7){return _0x424951['define'](_0x1918('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x1918('0xb'),'fields':['subject','to'],'type':_0x1918('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16e505,_0x24c807,_0x3cc248){if(_0x16e505[_0x1918('0xd')]){_0x16e505[_0x1918('0xe')]=moment()[_0x1918('0xf')](_0x1918('0x10'));}if(_0x16e505[_0x1918('0x11')]){_0x16e505[_0x1918('0x12')]=moment()[_0x1918('0xf')](_0x1918('0x10'));}_0x3cc248(null,_0x24c807);},'beforeUpdate':function(_0x280ab3,_0x52e662,_0x410f89){if(_0x280ab3[_0x1918('0x13')](_0x1918('0xd'))){_0x280ab3[_0x1918('0xe')]=moment()[_0x1918('0xf')](_0x1918('0x10'));}if(_0x280ab3[_0x1918('0x13')]('closed')){_0x280ab3[_0x1918('0x12')]=moment()[_0x1918('0xf')](_0x1918('0x10'));}_0x410f89(null,_0x280ab3);}},'charset':_0x1918('0x14'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x867f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailInteraction','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x867f,0xe6));var _0xf867=function(_0x170f4c,_0x4a4c80){_0x170f4c=_0x170f4c-0x0;var _0x52eedd=_0x867f[_0x170f4c];return _0x52eedd;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xf867('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2494f1,_0x2b1c12,_0x1cf341){if(_0x2494f1[_0xf867('0xd')]){_0x2494f1[_0xf867('0xe')]=moment()[_0xf867('0xf')](_0xf867('0x10'));}if(_0x2494f1[_0xf867('0x11')]){_0x2494f1['closedAt']=moment()[_0xf867('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1cf341(null,_0x2b1c12);},'beforeUpdate':function(_0x4a1252,_0x1711b0,_0x1792ae){if(_0x4a1252[_0xf867('0x12')]('substatus')){_0x4a1252['substatusAt']=moment()[_0xf867('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4a1252[_0xf867('0x12')]('closed')){_0x4a1252['closedAt']=moment()[_0xf867('0xf')](_0xf867('0x10'));}_0x1792ae(null,_0x4a1252);}},'charset':_0xf867('0x13'),'collate':_0xf867('0x14')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e62c3a7..fd6f31c 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 _0xa5aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailInteraction.socket','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','then','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util'];(function(_0x1052e4,_0xd5a005){var _0x3b8c75=function(_0x1637f0){while(--_0x1637f0){_0x1052e4['push'](_0x1052e4['shift']());}};_0x3b8c75(++_0xd5a005);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x13b1af,_0x4336d3){_0x13b1af=_0x13b1af-0x0;var _0x2a0746=_0xa5aa[_0x13b1af];return _0x2a0746;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var moment=require('moment');var BPromise=require(_0xaa5a('0x2'));var rs=require(_0xaa5a('0x3'));var fs=require('fs');var Redis=require(_0xaa5a('0x4'));var db=require(_0xaa5a('0x5'))['db'];var utils=require(_0xaa5a('0x6'));var logger=require(_0xaa5a('0x7'))('rpc');var config=require(_0xaa5a('0x8'));var jayson=require(_0xaa5a('0x9'));var client=jayson[_0xaa5a('0xa')]['http']({'port':0x232a});config['redis']=_[_0xaa5a('0xb')](config[_0xaa5a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa5a('0xd'))(new Redis(config[_0xaa5a('0xc')]));require(_0xaa5a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1711cc,_0x1f57cd,_0x771d06){return new BPromise(function(_0x338653,_0x2db481){return client[_0xaa5a('0xf')](_0x1711cc,_0x771d06)['then'](function(_0x7dc4c2){logger[_0xaa5a('0x10')](_0xaa5a('0x11'),_0x1f57cd,_0xaa5a('0x12'));logger[_0xaa5a('0x13')](_0xaa5a('0x14'),_0x1f57cd,_0xaa5a('0x12'),JSON[_0xaa5a('0x15')](_0x7dc4c2));if(_0x7dc4c2[_0xaa5a('0x16')]){if(_0x7dc4c2[_0xaa5a('0x16')][_0xaa5a('0x17')]===0x1f4){logger[_0xaa5a('0x16')]('MailInteraction,\x20%s,\x20%s',_0x1f57cd,_0x7dc4c2[_0xaa5a('0x16')][_0xaa5a('0x18')]);return _0x2db481(_0x7dc4c2[_0xaa5a('0x16')]['message']);}logger[_0xaa5a('0x16')](_0xaa5a('0x11'),_0x1f57cd,_0x7dc4c2[_0xaa5a('0x16')][_0xaa5a('0x18')]);return _0x338653(_0x7dc4c2[_0xaa5a('0x16')][_0xaa5a('0x18')]);}else{logger[_0xaa5a('0x10')](_0xaa5a('0x11'),_0x1f57cd,_0xaa5a('0x12'));_0x338653(_0x7dc4c2[_0xaa5a('0x19')][_0xaa5a('0x18')]);}})[_0xaa5a('0x1a')](function(_0x127d71){logger[_0xaa5a('0x16')](_0xaa5a('0x11'),_0x1f57cd,_0x127d71);_0x2db481(_0x127d71);});});}exports[_0xaa5a('0x1b')]=function(_0x222e5e){var _0x57cc60=this;return new Promise(function(_0x20ec46,_0xb9156c){return db[_0xaa5a('0x1c')][_0xaa5a('0x1d')](_0x222e5e['body'],{'raw':_0x222e5e[_0xaa5a('0x1e')]?_0x222e5e[_0xaa5a('0x1e')][_0xaa5a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222e5e[_0xaa5a('0x1e')]?_0x222e5e[_0xaa5a('0x1e')][_0xaa5a('0x20')]||null:null,'attributes':_0x222e5e[_0xaa5a('0x1e')]?_0x222e5e[_0xaa5a('0x1e')][_0xaa5a('0x21')]||null:null,'limit':_0x222e5e['options']?_0x222e5e[_0xaa5a('0x1e')]['limit']||null:null})[_0xaa5a('0x22')](function(_0xbe9ce1){logger[_0xaa5a('0x10')](_0xaa5a('0x1b'),_0x222e5e);logger[_0xaa5a('0x13')]('UpdateMailInteraction',_0x222e5e,JSON[_0xaa5a('0x15')](_0xbe9ce1));_0x20ec46(_0xbe9ce1);})[_0xaa5a('0x1a')](function(_0x4e2311){logger[_0xaa5a('0x16')]('UpdateMailInteraction',_0x4e2311[_0xaa5a('0x18')],_0x222e5e);_0xb9156c(_0x57cc60[_0xaa5a('0x16')](0x1f4,_0x4e2311[_0xaa5a('0x18')]));});});};exports[_0xaa5a('0x23')]=function(_0x4117a6){return new Promise(function(_0x10208d,_0x57cd56){return db[_0xaa5a('0x1c')][_0xaa5a('0x24')]({'where':_0x4117a6['options']?_0x4117a6[_0xaa5a('0x1e')][_0xaa5a('0x20')]||null:null})['then'](function(_0x287cc6){if(_0x287cc6){return _0x287cc6[_0xaa5a('0x25')](_0x4117a6[_0xaa5a('0x26')][_0xaa5a('0x27')],_[_0xaa5a('0x28')](_0x4117a6[_0xaa5a('0x26')],['ids','id'])||{});}})[_0xaa5a('0x29')](function(_0x1c877b){logger[_0xaa5a('0x10')](_0xaa5a('0x2a'),_0x4117a6);logger['debug']('AddTags',_0x4117a6,JSON[_0xaa5a('0x15')](_0x1c877b));_0x10208d(_0x1c877b);})[_0xaa5a('0x1a')](function(_0x4e1665){logger[_0xaa5a('0x16')]('AddTags',_0x4e1665['message'],_0x4117a6);_0x57cd56(_this[_0xaa5a('0x16')](0x1f4,_0x4e1665[_0xaa5a('0x18')]));});});}; \ No newline at end of file +var _0xcd05=['MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','find','where','ids','omit','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info'];(function(_0x291fd0,_0x537d86){var _0x2d93ea=function(_0x134761){while(--_0x134761){_0x291fd0['push'](_0x291fd0['shift']());}};_0x2d93ea(++_0x537d86);}(_0xcd05,0x163));var _0x5cd0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xcd05[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5cd0('0x1'));var fs=require('fs');var Redis=require(_0x5cd0('0x2'));var db=require(_0x5cd0('0x3'))['db'];var utils=require(_0x5cd0('0x4'));var logger=require('../../config/logger')(_0x5cd0('0x5'));var config=require(_0x5cd0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5cd0('0x7')]=_[_0x5cd0('0x8')](config[_0x5cd0('0x7')],{'host':_0x5cd0('0x9'),'port':0x18eb});var socket=require(_0x5cd0('0xa'))(new Redis(config[_0x5cd0('0x7')]));require(_0x5cd0('0xb'))['register'](socket);function respondWithRpcPromise(_0xaea974,_0xf5eda1,_0x22f769){return new BPromise(function(_0x368f0c,_0x512903){return client[_0x5cd0('0xc')](_0xaea974,_0x22f769)[_0x5cd0('0xd')](function(_0x447b29){logger[_0x5cd0('0xe')](_0x5cd0('0xf'),_0xf5eda1,_0x5cd0('0x10'));logger[_0x5cd0('0x11')](_0x5cd0('0x12'),_0xf5eda1,_0x5cd0('0x10'),JSON[_0x5cd0('0x13')](_0x447b29));if(_0x447b29['error']){if(_0x447b29['error']['code']===0x1f4){logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x447b29['error'][_0x5cd0('0x15')]);return _0x512903(_0x447b29['error'][_0x5cd0('0x15')]);}logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x447b29['error']['message']);return _0x368f0c(_0x447b29[_0x5cd0('0x14')][_0x5cd0('0x15')]);}else{logger[_0x5cd0('0xe')]('MailInteraction,\x20%s,\x20%s',_0xf5eda1,'request\x20sent');_0x368f0c(_0x447b29['result'][_0x5cd0('0x15')]);}})[_0x5cd0('0x16')](function(_0x48ede8){logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x48ede8);_0x512903(_0x48ede8);});});}exports[_0x5cd0('0x17')]=function(_0x24268d){var _0x2230c1=this;return new Promise(function(_0x2db93c,_0x18b907){return db[_0x5cd0('0x18')][_0x5cd0('0x19')](_0x24268d[_0x5cd0('0x1a')],{'raw':_0x24268d[_0x5cd0('0x1b')]?_0x24268d[_0x5cd0('0x1b')][_0x5cd0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24268d[_0x5cd0('0x1b')]?_0x24268d['options']['where']||null:null,'attributes':_0x24268d[_0x5cd0('0x1b')]?_0x24268d['options'][_0x5cd0('0x1d')]||null:null,'limit':_0x24268d[_0x5cd0('0x1b')]?_0x24268d[_0x5cd0('0x1b')][_0x5cd0('0x1e')]||null:null})[_0x5cd0('0xd')](function(_0x2b8516){logger[_0x5cd0('0xe')]('UpdateMailInteraction',_0x24268d);logger['debug'](_0x5cd0('0x17'),_0x24268d,JSON[_0x5cd0('0x13')](_0x2b8516));_0x2db93c(_0x2b8516);})[_0x5cd0('0x16')](function(_0x189fa8){logger['error'](_0x5cd0('0x17'),_0x189fa8[_0x5cd0('0x15')],_0x24268d);_0x18b907(_0x2230c1[_0x5cd0('0x14')](0x1f4,_0x189fa8['message']));});});};exports['AddTagsToMailInteraction']=function(_0x403ff3){return new Promise(function(_0x24cb51,_0x5a2123){return db[_0x5cd0('0x18')][_0x5cd0('0x1f')]({'where':_0x403ff3[_0x5cd0('0x1b')]?_0x403ff3[_0x5cd0('0x1b')][_0x5cd0('0x20')]||null:null})[_0x5cd0('0xd')](function(_0x31b9d1){if(_0x31b9d1){return _0x31b9d1['addTags'](_0x403ff3[_0x5cd0('0x1a')][_0x5cd0('0x21')],_[_0x5cd0('0x22')](_0x403ff3[_0x5cd0('0x1a')],[_0x5cd0('0x21'),'id'])||{});}})[_0x5cd0('0x23')](function(_0x190901){logger[_0x5cd0('0xe')](_0x5cd0('0x24'),_0x403ff3);logger[_0x5cd0('0x11')]('AddTags',_0x403ff3,JSON[_0x5cd0('0x13')](_0x190901));_0x24cb51(_0x190901);})[_0x5cd0('0x16')](function(_0x5e8c1c){logger[_0x5cd0('0x14')]('AddTags',_0x5e8c1c[_0x5cd0('0x15')],_0x403ff3);_0x5a2123(_this[_0x5cd0('0x14')](0x1f4,_0x5e8c1c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index ab3cedc..5926fc2 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 _0xca35=['register','length','mailInteraction:','./mailInteraction.events','emit'];(function(_0xb7416f,_0x13c7da){var _0x1c0c48=function(_0x10f2e2){while(--_0x10f2e2){_0xb7416f['push'](_0xb7416f['shift']());}};_0x1c0c48(++_0x13c7da);}(_0xca35,0x1cf));var _0x5ca3=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xca35[_0xbec8e6];return _0x4aa6f2;};'use strict';var MailInteractionEvents=require(_0x5ca3('0x0'));var events=['save','remove','update'];function createListener(_0x2d30e7,_0x5d2994){return function(_0x494cf6){_0x5d2994[_0x5ca3('0x1')](_0x2d30e7,_0x494cf6);};}function removeListener(_0x1661d2,_0x49fb6b){return function(){MailInteractionEvents['removeListener'](_0x1661d2,_0x49fb6b);};}exports[_0x5ca3('0x2')]=function(_0x2c5117){for(var _0x2db70f=0x0,_0x2ee7fd=events[_0x5ca3('0x3')];_0x2db70f<_0x2ee7fd;_0x2db70f++){var _0x28a5fd=events[_0x2db70f];var _0x28d322=createListener(_0x5ca3('0x4')+_0x28a5fd,_0x2c5117);MailInteractionEvents['on'](_0x28a5fd,_0x28d322);}}; \ No newline at end of file +var _0x5023=['removeListener','length','./mailInteraction.events','save','remove','emit'];(function(_0x3c1080,_0x376fad){var _0x2f9f3c=function(_0x57ea56){while(--_0x57ea56){_0x3c1080['push'](_0x3c1080['shift']());}};_0x2f9f3c(++_0x376fad);}(_0x5023,0xc8));var _0x3502=function(_0x52a349,_0x95c0d3){_0x52a349=_0x52a349-0x0;var _0x29c7cc=_0x5023[_0x52a349];return _0x29c7cc;};'use strict';var MailInteractionEvents=require(_0x3502('0x0'));var events=[_0x3502('0x1'),_0x3502('0x2'),'update'];function createListener(_0x5896a2,_0x222904){return function(_0x3f14d7){_0x222904[_0x3502('0x3')](_0x5896a2,_0x3f14d7);};}function removeListener(_0x484c78,_0x37eeba){return function(){MailInteractionEvents[_0x3502('0x4')](_0x484c78,_0x37eeba);};}exports['register']=function(_0x422619){for(var _0x2a5d3e=0x0,_0x511ea6=events[_0x3502('0x5')];_0x2a5d3e<_0x511ea6;_0x2a5d3e++){var _0x271240=events[_0x2a5d3e];var _0x5ad40d=createListener('mailInteraction:'+_0x271240,_0x422619);MailInteractionEvents['on'](_0x271240,_0x5ad40d);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 9172c00..6d44c97 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 _0x3f8a=['accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','post','mail','mailmessage:create','create','put','update','/:id/accept'];(function(_0x1d88db,_0x26213f){var _0x1df256=function(_0x1bb1e7){while(--_0x1bb1e7){_0x1d88db['push'](_0x1d88db['shift']());}};_0x1df256(++_0x26213f);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x462753,_0x18db45){_0x462753=_0x462753-0x0;var _0x241048=_0x3f8a[_0x462753];return _0x241048;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x9')]('/:id/download',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x10')]);router[_0xa3f8('0x11')]('/',auth[_0xa3f8('0xa')](),interaction['tracked'](_0xa3f8('0x12'),_0xa3f8('0x13')),controller[_0xa3f8('0x14')]);router[_0xa3f8('0x15')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x16')]);router[_0xa3f8('0x15')](_0xa3f8('0x17'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x18')]);router[_0xa3f8('0x15')]('/:id/reject',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x19')]);router[_0xa3f8('0x1a')](_0xa3f8('0xe'),auth['isAuthenticated'](),controller[_0xa3f8('0x1b')]);module[_0xa3f8('0x1c')]=router; \ No newline at end of file +var _0x038b=['exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','download','tracked','mail','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x14b2b2,_0x52b14f){var _0x36ecb7=function(_0x2a05fc){while(--_0x2a05fc){_0x14b2b2['push'](_0x14b2b2['shift']());}};_0x36ecb7(++_0x52b14f);}(_0x038b,0x114));var _0xb038=function(_0x2ee92c,_0x25278c){_0x2ee92c=_0x2ee92c-0x0;var _0x436d7b=_0x038b[_0x2ee92c];return _0x436d7b;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./mailMessage.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['get']('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xa')]);router['get']('/:id/download',auth[_0xb038('0x7')](),controller[_0xb038('0xb')]);router['post']('/',auth[_0xb038('0x7')](),interaction[_0xb038('0xc')](_0xb038('0xd'),_0xb038('0xe')),controller[_0xb038('0xf')]);router[_0xb038('0x10')](_0xb038('0x11'),auth[_0xb038('0x7')](),controller[_0xb038('0x12')]);router[_0xb038('0x10')](_0xb038('0x13'),auth[_0xb038('0x7')](),controller[_0xb038('0x14')]);router[_0xb038('0x10')](_0xb038('0x15'),auth[_0xb038('0x7')](),controller[_0xb038('0x16')]);router['delete'](_0xb038('0x11'),auth[_0xb038('0x7')](),controller[_0xb038('0x17')]);module[_0xb038('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7e62630..84ef14e 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 _0x28a1=['BOOLEAN','ENUM','out','STRING','INTEGER','DATE','sequelize','lodash','TEXT','long','medium'];(function(_0x9c4a77,_0x4dbdb4){var _0x1048b0=function(_0x2c8dc4){while(--_0x2c8dc4){_0x9c4a77['push'](_0x9c4a77['shift']());}};_0x1048b0(++_0x4dbdb4);}(_0x28a1,0x145));var _0x128a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x28a1[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x128a('0x0'));var _=require(_0x128a('0x1'));module['exports']={'body':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x4'))},'read':{'type':Sequelize[_0x128a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x128a('0x6')]('in',_0x128a('0x7')),'defaultValue':_0x128a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x128a('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x3'))},'cc':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x3'))},'bcc':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x3'))},'subject':{'type':Sequelize[_0x128a('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x128a('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x128a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x128a('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x128a('0x2')](_0x128a('0x3'))}}; \ No newline at end of file +var _0xca1d=['ENUM','out','STRING','INTEGER','BOOLEAN','DATE','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xca1d,0x1e6));var _0xdca1=function(_0x21e1ec,_0x40c43b){_0x21e1ec=_0x21e1ec-0x0;var _0x14a575=_0xca1d[_0x21e1ec];return _0x14a575;};'use strict';var Sequelize=require(_0xdca1('0x0'));var _=require(_0xdca1('0x1'));module[_0xdca1('0x2')]={'body':{'type':Sequelize[_0xdca1('0x3')](_0xdca1('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdca1('0x3')](_0xdca1('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdca1('0x6')]('in',_0xdca1('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdca1('0x8')](0x1fe)},'from':{'type':Sequelize[_0xdca1('0x8')]},'to':{'type':Sequelize[_0xdca1('0x3')]('long')},'cc':{'type':Sequelize[_0xdca1('0x3')](_0xdca1('0x4'))},'bcc':{'type':Sequelize[_0xdca1('0x3')](_0xdca1('0x4'))},'subject':{'type':Sequelize[_0xdca1('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xdca1('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdca1('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdca1('0xb')]},'originTo':{'type':Sequelize[_0xdca1('0x3')](_0xdca1('0x4'))},'originCc':{'type':Sequelize[_0xdca1('0x3')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8515645..7f68292 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 _0xe47b=['writeFileSync','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','test','then','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','MailMessage','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','show','params','rawAttributes','find','body','describe','create','out','secret','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','mail-interactions','mail','read','readAt','format','UserId','CmContact','get','MailInteraction','MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','agent','rejectMessage','SIP/%s','rejectmessage','download','unix','files','tmp','server','message-%s.eml','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build'];(function(_0x426c66,_0x4f19ae){var _0x5b2ca4=function(_0x517d83){while(--_0x517d83){_0x426c66['push'](_0x426c66['shift']());}};_0x5b2ca4(++_0x4f19ae);}(_0xe47b,0xa5));var _0xbe47=function(_0x505629,_0x5965d4){_0x505629=_0x505629-0x0;var _0x3d30cd=_0xe47b[_0x505629];return _0x3d30cd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbe47('0x0'));var rimraf=require(_0xbe47('0x1'));var zipdir=require(_0xbe47('0x2'));var jsonpatch=require(_0xbe47('0x3'));var rp=require(_0xbe47('0x4'));var moment=require(_0xbe47('0x5'));var BPromise=require(_0xbe47('0x6'));var Mustache=require(_0xbe47('0x7'));var util=require(_0xbe47('0x8'));var path=require(_0xbe47('0x9'));var sox=require('sox');var csv=require(_0xbe47('0xa'));var ejs=require(_0xbe47('0xb'));var fs=require('fs');var _=require(_0xbe47('0xc'));var squel=require(_0xbe47('0xd'));var crypto=require(_0xbe47('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbe47('0xf'));var toCsv=require(_0xbe47('0xa'));var querystring=require(_0xbe47('0x10'));var Papa=require(_0xbe47('0x11'));var Redis=require(_0xbe47('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbe47('0x13'));var hardwareService=require(_0xbe47('0x14'));var logger=require(_0xbe47('0x15'))(_0xbe47('0x16'));var utils=require(_0xbe47('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xbe47('0x18')],{'host':_0xbe47('0x19'),'port':0x18eb});var socket=require(_0xbe47('0x1a'))(new Redis(config[_0xbe47('0x18')]));require(_0xbe47('0x1b'))['register'](socket);var jayson=require(_0xbe47('0x1c'));var client=jayson[_0xbe47('0x1d')][_0xbe47('0x1e')]({'port':0x232c});var client9003=jayson['client'][_0xbe47('0x1e')]({'port':0x232b});var client9002=jayson[_0xbe47('0x1d')][_0xbe47('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x135a27,_0x4d8ee3,_0x175bac){if(_0x175bac){var _0x22db19=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22db19[_0xbe47('0x1f')](_0x4d8ee3)){return _0x135a27;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x135a27;}}function respondWithRpcPromise(_0x21b178,_0x174f0d,_0x35beb1,_0x236b46){return new BPromise(function(_0x268e51,_0x22a1bb){var _0x5bf682=_0x236b46||client;return _0x5bf682['request'](_0x21b178,_0x35beb1)[_0xbe47('0x20')](function(_0x45ee06){logger['info'](_0xbe47('0x21'),_0x174f0d,'request\x20sent');logger['debug'](_0xbe47('0x22'),_0x174f0d,_0xbe47('0x23'),JSON[_0xbe47('0x24')](_0x45ee06));if(_0x45ee06[_0xbe47('0x25')]){if(_0x45ee06[_0xbe47('0x25')][_0xbe47('0x26')]===0x1f4){logger[_0xbe47('0x25')]('MailMessage,\x20%s,\x20%s',_0x174f0d,_0x45ee06[_0xbe47('0x25')][_0xbe47('0x27')]);return _0x22a1bb(_0x45ee06[_0xbe47('0x25')][_0xbe47('0x27')]);}logger['error'](_0xbe47('0x21'),_0x174f0d,_0x45ee06[_0xbe47('0x25')][_0xbe47('0x27')]);return _0x268e51(_0x45ee06[_0xbe47('0x25')]['message']);}else{logger[_0xbe47('0x28')](_0xbe47('0x21'),_0x174f0d,_0xbe47('0x23'));_0x268e51(_0x45ee06[_0xbe47('0x29')]['message']);}})[_0xbe47('0x2a')](function(_0x1fcbaa){logger[_0xbe47('0x25')](_0xbe47('0x21'),_0x174f0d,_0x1fcbaa);_0x22a1bb(_0x1fcbaa);});});}function respondWithStatusCode(_0x36b266,_0x7db42a){_0x7db42a=_0x7db42a||0xcc;return function(_0x50a7f3){if(_0x50a7f3){return _0x36b266[_0xbe47('0x2b')](_0x7db42a);}return _0x36b266[_0xbe47('0x2c')](_0x7db42a)[_0xbe47('0x2d')]();};}function respondWithResult(_0x213748,_0x156e38){_0x156e38=_0x156e38||0xc8;return function(_0x93b975){if(_0x93b975){return _0x213748[_0xbe47('0x2c')](_0x156e38)[_0xbe47('0x2e')](_0x93b975);}};}function respondWithFilteredResult(_0x4807a,_0x132399){return function(_0x1314ed){if(_0x1314ed){var _0x4c29cf=_0x1314ed[_0xbe47('0x2f')],_0x378d0b=_0x132399[_0xbe47('0x30')],_0x421dd9=_0x132399[_0xbe47('0x30')]+_0x132399[_0xbe47('0x31')],_0x4df05e;if(_0x421dd9>=_0x4c29cf){_0x421dd9=_0x4c29cf;_0x4df05e=0xc8;}else{_0x4df05e=0xce;}_0x4807a[_0xbe47('0x2c')](_0x4df05e);return _0x4807a[_0xbe47('0x32')](_0xbe47('0x33'),_0x378d0b+'-'+_0x421dd9+'/'+_0x4c29cf)['json'](_0x1314ed);}return null;};}function patchUpdates(_0x4c14c7){return function(_0x2b6704){try{jsonpatch[_0xbe47('0x34')](_0x2b6704,_0x4c14c7,!![]);}catch(_0x4635aa){return BPromise[_0xbe47('0x35')](_0x4635aa);}return _0x2b6704[_0xbe47('0x36')]();};}function saveUpdates(_0x1e7f0b,_0x3ae3ed){return function(_0x536516){if(_0x536516){return _0x536516[_0xbe47('0x37')](_0x1e7f0b)[_0xbe47('0x20')](function(_0x4d7300){return _0x4d7300;});}return null;};}function removeEntity(_0x545bbf,_0x543de6){return function(_0x29fb36){if(_0x29fb36){return _0x29fb36[_0xbe47('0x38')]()[_0xbe47('0x20')](function(){_0x545bbf[_0xbe47('0x2c')](0xcc)[_0xbe47('0x2d')]();});}};}function handleEntityNotFound(_0x4b0c19,_0x2d9efd){return function(_0x1135c5){if(!_0x1135c5){_0x4b0c19['sendStatus'](0x194);}return _0x1135c5;};}function handleError(_0x53e97a,_0x303149){_0x303149=_0x303149||0x1f4;return function(_0x360e42){logger[_0xbe47('0x25')](_0x360e42[_0xbe47('0x39')]);if(_0x360e42[_0xbe47('0x3a')]){delete _0x360e42[_0xbe47('0x3a')];}_0x53e97a[_0xbe47('0x2c')](_0x303149)[_0xbe47('0x3b')](_0x360e42);};}exports['index']=function(_0x3679f2,_0x478513){var _0x1a465c={},_0x14da10={},_0xfafbf7={'count':0x0,'rows':[]};var _0x228ecb=db[_0xbe47('0x3c')]['rawAttributes'];_0x14da10[_0xbe47('0x3d')]=_[_0xbe47('0x3e')](_0x228ecb);_0x14da10['query']=_['keys'](_0x3679f2[_0xbe47('0x3f')]);_0x14da10['filters']=_[_0xbe47('0x40')](_0x14da10['model'],_0x14da10[_0xbe47('0x3f')]);_0x1a465c[_0xbe47('0x41')]=_[_0xbe47('0x40')](_0x14da10[_0xbe47('0x3d')],qs[_0xbe47('0x42')](_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x42')]));_0x1a465c[_0xbe47('0x41')]=_0x1a465c[_0xbe47('0x41')][_0xbe47('0x43')]?_0x1a465c['attributes']:_0x14da10[_0xbe47('0x3d')];if(!_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x44')](_0xbe47('0x45'))){_0x1a465c[_0xbe47('0x31')]=qs[_0xbe47('0x31')](_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x31')]);_0x1a465c[_0xbe47('0x30')]=qs[_0xbe47('0x30')](_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x30')]);}_0x1a465c[_0xbe47('0x46')]=qs[_0xbe47('0x47')](_0x3679f2[_0xbe47('0x3f')]['sort']);_0x1a465c[_0xbe47('0x48')]=qs[_0xbe47('0x49')](_[_0xbe47('0x4a')](_0x3679f2['query'],_0x14da10[_0xbe47('0x49')]));if(_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x4b')]){_0x1a465c[_0xbe47('0x48')]=_[_0xbe47('0x4c')](_0x1a465c[_0xbe47('0x48')],{'$or':_[_0xbe47('0x4d')](_0x228ecb,function(_0x874e69){if(_0x874e69[_0xbe47('0x4e')][_0xbe47('0x4f')]!=='VIRTUAL'){var _0x368062={};_0x368062[_0x874e69[_0xbe47('0x50')]]={'$like':'%'+_0x3679f2[_0xbe47('0x3f')]['filter']+'%'};return _0x368062;}})});}_0x1a465c=_[_0xbe47('0x4c')]({},_0x1a465c,_0x3679f2[_0xbe47('0x51')]);var _0x236379={'where':_0x1a465c[_0xbe47('0x48')]};return db['MailMessage']['count'](_0x236379)[_0xbe47('0x20')](function(_0x44d217){_0xfafbf7['count']=_0x44d217;if(_0x3679f2[_0xbe47('0x3f')][_0xbe47('0x52')]){_0x1a465c[_0xbe47('0x53')]=[{'all':!![]}];}return db[_0xbe47('0x3c')]['findAll'](_0x1a465c);})[_0xbe47('0x20')](function(_0xe46fba){_0xfafbf7['rows']=_0xe46fba;return _0xfafbf7;})[_0xbe47('0x20')](respondWithFilteredResult(_0x478513,_0x1a465c))[_0xbe47('0x2a')](handleError(_0x478513,null));};exports[_0xbe47('0x54')]=function(_0x295f35,_0xc4500b){var _0x18e2cd={'raw':!![],'where':{'id':_0x295f35[_0xbe47('0x55')]['id']}},_0xb836bf={};_0xb836bf[_0xbe47('0x3d')]=_[_0xbe47('0x3e')](db[_0xbe47('0x3c')][_0xbe47('0x56')]);_0xb836bf[_0xbe47('0x3f')]=_[_0xbe47('0x3e')](_0x295f35[_0xbe47('0x3f')]);_0xb836bf[_0xbe47('0x49')]=_[_0xbe47('0x40')](_0xb836bf['model'],_0xb836bf[_0xbe47('0x3f')]);_0x18e2cd[_0xbe47('0x41')]=_['intersection'](_0xb836bf[_0xbe47('0x3d')],qs[_0xbe47('0x42')](_0x295f35[_0xbe47('0x3f')][_0xbe47('0x42')]));_0x18e2cd[_0xbe47('0x41')]=_0x18e2cd['attributes'][_0xbe47('0x43')]?_0x18e2cd['attributes']:_0xb836bf[_0xbe47('0x3d')];if(_0x295f35[_0xbe47('0x3f')][_0xbe47('0x52')]){_0x18e2cd[_0xbe47('0x53')]=[{'all':!![]}];}_0x18e2cd=_[_0xbe47('0x4c')]({},_0x18e2cd,_0x295f35[_0xbe47('0x51')]);return db[_0xbe47('0x3c')][_0xbe47('0x57')](_0x18e2cd)[_0xbe47('0x20')](handleEntityNotFound(_0xc4500b,null))['then'](respondWithResult(_0xc4500b,null))[_0xbe47('0x2a')](handleError(_0xc4500b,null));};exports[_0xbe47('0x37')]=function(_0x2ed649,_0x29dc03){if(_0x2ed649[_0xbe47('0x58')]['id']){delete _0x2ed649[_0xbe47('0x58')]['id'];}return db[_0xbe47('0x3c')][_0xbe47('0x57')]({'where':{'id':_0x2ed649[_0xbe47('0x55')]['id']}})[_0xbe47('0x20')](handleEntityNotFound(_0x29dc03,null))[_0xbe47('0x20')](saveUpdates(_0x2ed649[_0xbe47('0x58')],null))[_0xbe47('0x20')](respondWithResult(_0x29dc03,null))[_0xbe47('0x2a')](handleError(_0x29dc03,null));};exports[_0xbe47('0x38')]=function(_0x30bb87,_0x3f9e68){return db[_0xbe47('0x3c')]['find']({'where':{'id':_0x30bb87['params']['id']}})[_0xbe47('0x20')](handleEntityNotFound(_0x3f9e68,null))[_0xbe47('0x20')](removeEntity(_0x3f9e68,null))['catch'](handleError(_0x3f9e68,null));};exports[_0xbe47('0x59')]=function(_0x30ae13,_0x50f29a){return db[_0xbe47('0x3c')]['describe']()[_0xbe47('0x20')](respondWithResult(_0x50f29a,null))[_0xbe47('0x2a')](handleError(_0x50f29a,null));};exports[_0xbe47('0x5a')]=function(_0x37fb65,_0x2412fd){return db[_0xbe47('0x3c')][_0xbe47('0x5a')](_0x37fb65['body'])['then'](function(_0x4e4675){if(_0x4e4675){if(_0x4e4675['direction']===_0xbe47('0x5b')&&!_0x4e4675[_0xbe47('0x5c')]){return db['MailAccount'][_0xbe47('0x5d')]({'where':{'id':_0x4e4675[_0xbe47('0x5e')]},'include':[{'model':db[_0xbe47('0x5f')],'as':'Smtp','raw':!![]}]})[_0xbe47('0x20')](function(_0x3040b4){if(_0x3040b4&&_0x3040b4[_0xbe47('0x60')]){var _0x4c8afb={'tls':{'rejectUnauthorized':![]}};if(_[_0xbe47('0x61')](_0x3040b4['Smtp'][_0xbe47('0x62')])){_0x4c8afb[_0xbe47('0x63')]=_0x3040b4[_0xbe47('0x60')][_0xbe47('0x63')];_0x4c8afb['port']=_0x3040b4['Smtp'][_0xbe47('0x64')];_0x4c8afb['secure']=_0x3040b4[_0xbe47('0x60')]['secure'];if(_0x3040b4[_0xbe47('0x60')][_0xbe47('0x65')]){_0x4c8afb[_0xbe47('0x66')]={'user':_0x3040b4[_0xbe47('0x60')][_0xbe47('0x67')],'pass':_0x3040b4['Smtp'][_0xbe47('0x68')]};}}else{_0x4c8afb[_0xbe47('0x62')]=_0x3040b4['Smtp']['service'];_0x4c8afb[_0xbe47('0x66')]={'user':_0x3040b4[_0xbe47('0x60')][_0xbe47('0x67')],'pass':_0x3040b4['Smtp']['pass']};_0x4c8afb['secure']=_0x3040b4['Smtp']['secure'];}if(_0x37fb65[_0xbe47('0x58')]['attachments']&&_0x37fb65[_0xbe47('0x58')][_0xbe47('0x69')][_0xbe47('0x43')]){for(var _0x3e47bc=0x0;_0x3e47bc<_0x37fb65[_0xbe47('0x58')][_0xbe47('0x69')][_0xbe47('0x43')];_0x3e47bc+=0x1){_0x37fb65[_0xbe47('0x58')][_0xbe47('0x69')][_0x3e47bc]={'filename':_0x37fb65[_0xbe47('0x58')][_0xbe47('0x69')][_0x3e47bc]['name'],'path':path[_0xbe47('0x6a')](config[_0xbe47('0x6b')],_0xbe47('0x6c'),_0x37fb65[_0xbe47('0x58')]['attachments'][_0x3e47bc][_0xbe47('0x6d')])};}}return{'account':_0x4c8afb,'message':_0x37fb65[_0xbe47('0x58')]};}})['then'](function(_0x22a86b){if(_0x22a86b){return respondWithRpcPromise(_0xbe47('0x6e'),_0xbe47('0x6f'),_0x22a86b,client9003)[_0xbe47('0x20')](function(_0x17dbec){return _0x4e4675[_0xbe47('0x37')]({'read':!![],'messageId':_0x17dbec['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xbe47('0x2a')](function(_0x4a1e9d){logger[_0xbe47('0x25')]('%s',JSON[_0xbe47('0x24')](_0x4a1e9d));return _0x4e4675;});}return _0x4e4675;});}return _0x4e4675;}})['then'](respondWithResult(_0x2412fd,0xc9))[_0xbe47('0x2a')](handleError(_0x2412fd,null));};var interaction_log=require(_0xbe47('0x15'))(_0xbe47('0x70'));exports['accept']=function(_0x2741fb,_0x4807ca,_0xebda1f){var _0x22862a={'channel':_0xbe47('0x71')};if(_0x2741fb[_0xbe47('0x58')]['id']){delete _0x2741fb[_0xbe47('0x58')]['id'];}_0x2741fb[_0xbe47('0x58')][_0xbe47('0x72')]=!![];_0x2741fb[_0xbe47('0x58')][_0xbe47('0x73')]=moment()[_0xbe47('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x2741fb[_0xbe47('0x58')][_0xbe47('0x75')]=_0x2741fb[_0xbe47('0x58')][_0xbe47('0x75')]||_0x2741fb[_0xbe47('0x67')]['id'];return db[_0xbe47('0x3c')][_0xbe47('0x57')]({'where':{'id':_0x2741fb[_0xbe47('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xbe47('0x76')],'as':'Contact'}]})[_0xbe47('0x20')](handleEntityNotFound(_0x4807ca,null))['then'](saveUpdates(_0x2741fb[_0xbe47('0x58')],null))['then'](function(_0x650570){if(_0x650570){_0x22862a[_0xbe47('0x27')]=_0x650570[_0xbe47('0x77')]({'plain':!![]});return db[_0xbe47('0x78')][_0xbe47('0x57')]({'where':{'id':_0x650570[_0xbe47('0x79')]}});}return null;})[_0xbe47('0x20')](handleEntityNotFound(_0x4807ca,null))[_0xbe47('0x20')](function(_0x14d870){if(_0x14d870){return _0x14d870['update']({'UserId':_0x2741fb[_0xbe47('0x58')][_0xbe47('0x75')],'read1stAt':_['isNil'](_0x14d870[_0xbe47('0x7a')])?moment()[_0xbe47('0x74')](_0xbe47('0x7b')):undefined});}return null;})[_0xbe47('0x20')](function(_0x12acc8){if(_0x12acc8){_0x22862a[_0xbe47('0x7c')]=_0x12acc8[_0xbe47('0x77')]({'plain':!![]});interaction_log[_0xbe47('0x28')](_0xbe47('0x7d'),_0x2741fb[_0xbe47('0x67')]['id'],_0x2741fb[_0xbe47('0x67')][_0xbe47('0x3a')],_0x2741fb['user'][_0xbe47('0x7e')],_0x22862a['interaction']['id'],_0x2741fb[_0xbe47('0x58')]?JSON['stringify'](_0x2741fb[_0xbe47('0x58')]):_0xbe47('0x7f'));return respondWithRpcPromise(_0xbe47('0x80'),_0xbe47('0x81'),_0x22862a);}return null;})[_0xbe47('0x20')](function(_0x576cb4){if(_0x576cb4){if(_0x2741fb['body'][_0xbe47('0x82')]){_0x22862a[_0xbe47('0x27')][_0xbe47('0x83')]=util[_0xbe47('0x74')]('SIP/%s',_0x2741fb['user']['name']);_0x22862a[_0xbe47('0x27')][_0xbe47('0x84')]=_0x22862a[_0xbe47('0x84')];_0x22862a[_0xbe47('0x27')][_0xbe47('0x85')]=_0xbe47('0x86');return respondWithRpcPromise(_0xbe47('0x87'),_0xbe47('0x87'),{'event':_0xbe47('0x88'),'message':_0x22862a[_0xbe47('0x27')]},client9002)[_0xbe47('0x20')](function(){return _0x22862a;});}return _0x22862a;}return null;})['then'](respondWithResult(_0x4807ca,null))['catch'](handleError(_0x4807ca,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0xbe47('0x35')]=function(_0x5589f6,_0x1c8616,_0x285e89){var _0x751a93={'agent':{},'channel':'mail'};if(_0x5589f6[_0xbe47('0x58')]['id']){delete _0x5589f6[_0xbe47('0x58')]['id'];}_0x5589f6[_0xbe47('0x58')][_0xbe47('0x75')]=_0x5589f6[_0xbe47('0x58')][_0xbe47('0x75')]||_0x5589f6['user']['id'];_0x751a93[_0xbe47('0x89')]['id']=_0x5589f6['body']['UserId'];return db[_0xbe47('0x3c')]['find']({'where':{'id':_0x5589f6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c8616,null))[_0xbe47('0x20')](function(_0x459007){if(_0x459007){_0x751a93[_0xbe47('0x27')]=_0x459007[_0xbe47('0x77')]({'plain':!![]});return db['MailInteraction'][_0xbe47('0x57')]({'where':{'id':_0x459007[_0xbe47('0x79')]}});}return null;})[_0xbe47('0x20')](handleEntityNotFound(_0x1c8616,null))[_0xbe47('0x20')](function(_0x1292ab){if(_0x1292ab){_0x751a93[_0xbe47('0x7c')]=_0x1292ab[_0xbe47('0x77')]({'plain':!![]});interaction_log[_0xbe47('0x28')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5589f6['user']['id'],_0x5589f6['user'][_0xbe47('0x3a')],_0x5589f6[_0xbe47('0x67')][_0xbe47('0x7e')],_0x751a93['interaction']['id'],_0x5589f6['body']?JSON['stringify'](_0x5589f6[_0xbe47('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0xbe47('0x8a'),_0x751a93);}return null;})[_0xbe47('0x20')](function(_0x13bd2a){if(_0x13bd2a){_0x13bd2a[_0xbe47('0x27')][_0xbe47('0x83')]=util[_0xbe47('0x74')](_0xbe47('0x8b'),_0x5589f6[_0xbe47('0x67')][_0xbe47('0x3a')]);_0x13bd2a[_0xbe47('0x27')]['channel']=_0x751a93[_0xbe47('0x84')];_0x13bd2a[_0xbe47('0x27')]['event']=_0xbe47('0x35');respondWithRpcPromise(_0xbe47('0x87'),_0xbe47('0x87'),{'event':_0xbe47('0x8c'),'message':_0x13bd2a[_0xbe47('0x27')]},client9002);return _0x751a93;}return null;})[_0xbe47('0x20')](respondWithResult(_0x1c8616,null))[_0xbe47('0x2a')](handleError(_0x1c8616,null));};exports[_0xbe47('0x8d')]=function(_0x20b00e,_0x55527a){var _0x1f7528=moment()[_0xbe47('0x8e')]()['toString']();var _0x19a35d=path[_0xbe47('0x6a')](config[_0xbe47('0x6b')],'server',_0xbe47('0x8f'),_0xbe47('0x90'));var _0x5bdc75=path[_0xbe47('0x6a')](config[_0xbe47('0x6b')],_0xbe47('0x91'),_0xbe47('0x8f'),_0xbe47('0x69'));var _0x396536=util[_0xbe47('0x74')](_0xbe47('0x92'),_0x1f7528);return db[_0xbe47('0x3c')][_0xbe47('0x57')]({'where':{'id':_0x20b00e[_0xbe47('0x55')]['id']},'attributes':['id',_0xbe47('0x58'),'from','to','cc','bcc',_0xbe47('0x93'),_0xbe47('0x94')],'include':_0x20b00e[_0xbe47('0x3f')][_0xbe47('0x69')]?[{'model':db[_0xbe47('0x95')],'as':_0xbe47('0x96')}]:undefined})[_0xbe47('0x20')](handleEntityNotFound(_0x55527a,null))[_0xbe47('0x20')](function(_0x1a800a){if(_0x1a800a){var _0x41ed7b=_0x1a800a;var _0x21c6b4={'from':_0x41ed7b['from'],'to':_0x41ed7b['to'],'subject':_0x41ed7b[_0xbe47('0x93')],'html':_0x41ed7b['body'],'headers':{'Date':moment(_0x41ed7b['createdAt'])[_0xbe47('0x74')](_0xbe47('0x97'))},'attachments':[]};if(_0x1a800a['cc']){_0x21c6b4[_0xbe47('0x98')]['Cc']=_0x1a800a['cc'];}if(_0x1a800a['bcc']){_0x21c6b4[_0xbe47('0x98')][_0xbe47('0x99')]=_0x1a800a['bcc'];}return new BPromise(function(_0x5c2846,_0x387575){if(_0x1a800a[_0xbe47('0x96')]){for(var _0x36e3c3=0x0;_0x36e3c3<_0x1a800a[_0xbe47('0x96')]['length'];_0x36e3c3++){var _0x526784=_0x1a800a[_0xbe47('0x96')][_0x36e3c3];var _0x5ab0dc=path[_0xbe47('0x6a')](_0x5bdc75,_0x526784[_0xbe47('0x6d')]);if(fs['existsSync'](_0x5ab0dc)){_0x21c6b4[_0xbe47('0x69')][_0xbe47('0x9a')]({'name':_0x526784[_0xbe47('0x3a')],'contentType':_0x526784[_0xbe47('0x4e')],'data':fs[_0xbe47('0x9b')](_0x5ab0dc)});}}}emlformat[_0xbe47('0x9c')](_0x21c6b4,function(_0x184f75,_0x3134f2){if(_0x184f75)return _0x387575(_0x184f75);fs[_0xbe47('0x9d')](path[_0xbe47('0x6a')](_0x19a35d,_0x396536),_0x3134f2);return _0x5c2846(_0x3134f2);});});}})[_0xbe47('0x20')](function(_0x2bb06e){if(_0x2bb06e){return _0x55527a['download'](path[_0xbe47('0x6a')](_0x19a35d,_0x396536),_0x396536,function(_0x14a237){if(_0x14a237){console[_0xbe47('0x9e')](_0xbe47('0x9f'),_0x14a237);}else{fs[_0xbe47('0xa0')](path[_0xbe47('0x6a')](_0x19a35d,_0x396536));}});}})[_0xbe47('0x2a')](handleError(_0x55527a,null));}; \ No newline at end of file +var _0x35c9=['from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','options','body','find','describe','create','direction','secret','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','sendMail','messageId','format','stringify','../../config/logger','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','mail-interactions','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','unix','toString','join','server','tmp','files','message-%s.eml'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x35c9,0x15b));var _0x935c=function(_0x4a163e,_0x4e8199){_0x4a163e=_0x4a163e-0x0;var _0x271b52=_0x35c9[_0x4a163e];return _0x271b52;};'use strict';var pdf=require(_0x935c('0x0'));var emlformat=require(_0x935c('0x1'));var rimraf=require(_0x935c('0x2'));var zipdir=require(_0x935c('0x3'));var jsonpatch=require(_0x935c('0x4'));var rp=require('request-promise');var moment=require(_0x935c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x935c('0x6'));var path=require(_0x935c('0x7'));var sox=require(_0x935c('0x8'));var csv=require(_0x935c('0x9'));var ejs=require(_0x935c('0xa'));var fs=require('fs');var _=require(_0x935c('0xb'));var squel=require(_0x935c('0xc'));var crypto=require(_0x935c('0xd'));var jsforce=require(_0x935c('0xe'));var deskjs=require(_0x935c('0xf'));var toCsv=require(_0x935c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x935c('0x10'));var qs=require(_0x935c('0x11'));var hardwareService=require(_0x935c('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x935c('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x935c('0x14')](config[_0x935c('0x15')],{'host':_0x935c('0x16'),'port':0x18eb});var socket=require(_0x935c('0x17'))(new Redis(config[_0x935c('0x15')]));require(_0x935c('0x18'))[_0x935c('0x19')](socket);var jayson=require(_0x935c('0x1a'));var client=jayson[_0x935c('0x1b')][_0x935c('0x1c')]({'port':0x232c});var client9003=jayson[_0x935c('0x1b')][_0x935c('0x1c')]({'port':0x232b});var client9002=jayson['client'][_0x935c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x48d44d,_0x2f678a,_0x57fb72){if(_0x57fb72){var _0x12f9f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12f9f4[_0x935c('0x1d')](_0x2f678a)){return _0x48d44d;}else{throw new Error(_0x935c('0x1e'));}}else{return _0x48d44d;}}function respondWithRpcPromise(_0x2deb42,_0x143a9c,_0x284629,_0xd00aaf){return new BPromise(function(_0x24a7a7,_0x3ea095){var _0x1a9b15=_0xd00aaf||client;return _0x1a9b15[_0x935c('0x1f')](_0x2deb42,_0x284629)[_0x935c('0x20')](function(_0x1d806d){logger[_0x935c('0x21')](_0x935c('0x22'),_0x143a9c,'request\x20sent');logger[_0x935c('0x23')](_0x935c('0x24'),_0x143a9c,_0x935c('0x25'),JSON['stringify'](_0x1d806d));if(_0x1d806d[_0x935c('0x26')]){if(_0x1d806d['error'][_0x935c('0x27')]===0x1f4){logger[_0x935c('0x26')](_0x935c('0x22'),_0x143a9c,_0x1d806d[_0x935c('0x26')]['message']);return _0x3ea095(_0x1d806d[_0x935c('0x26')]['message']);}logger[_0x935c('0x26')](_0x935c('0x22'),_0x143a9c,_0x1d806d[_0x935c('0x26')][_0x935c('0x28')]);return _0x24a7a7(_0x1d806d[_0x935c('0x26')][_0x935c('0x28')]);}else{logger[_0x935c('0x21')](_0x935c('0x22'),_0x143a9c,_0x935c('0x25'));_0x24a7a7(_0x1d806d[_0x935c('0x29')]['message']);}})[_0x935c('0x2a')](function(_0x266a37){logger[_0x935c('0x26')]('MailMessage,\x20%s,\x20%s',_0x143a9c,_0x266a37);_0x3ea095(_0x266a37);});});}function respondWithStatusCode(_0x2fd589,_0xfb7826){_0xfb7826=_0xfb7826||0xcc;return function(_0x5e5ac3){if(_0x5e5ac3){return _0x2fd589[_0x935c('0x2b')](_0xfb7826);}return _0x2fd589[_0x935c('0x2c')](_0xfb7826)[_0x935c('0x2d')]();};}function respondWithResult(_0x44d138,_0x18a3b4){_0x18a3b4=_0x18a3b4||0xc8;return function(_0x249d67){if(_0x249d67){return _0x44d138['status'](_0x18a3b4)[_0x935c('0x2e')](_0x249d67);}};}function respondWithFilteredResult(_0x1443ab,_0x38f577){return function(_0x1e1ace){if(_0x1e1ace){var _0x255b9e=_0x1e1ace['count'],_0x34d4c2=_0x38f577['offset'],_0x13c8cd=_0x38f577[_0x935c('0x2f')]+_0x38f577[_0x935c('0x30')],_0x2bb765;if(_0x13c8cd>=_0x255b9e){_0x13c8cd=_0x255b9e;_0x2bb765=0xc8;}else{_0x2bb765=0xce;}_0x1443ab[_0x935c('0x2c')](_0x2bb765);return _0x1443ab[_0x935c('0x31')]('Content-Range',_0x34d4c2+'-'+_0x13c8cd+'/'+_0x255b9e)[_0x935c('0x2e')](_0x1e1ace);}return null;};}function patchUpdates(_0x32b8f1){return function(_0x58ae3d){try{jsonpatch['apply'](_0x58ae3d,_0x32b8f1,!![]);}catch(_0x2e38c2){return BPromise[_0x935c('0x32')](_0x2e38c2);}return _0x58ae3d[_0x935c('0x33')]();};}function saveUpdates(_0x37766c,_0x340e88){return function(_0x509660){if(_0x509660){return _0x509660[_0x935c('0x34')](_0x37766c)[_0x935c('0x20')](function(_0x35c404){return _0x35c404;});}return null;};}function removeEntity(_0x208a27,_0x434914){return function(_0x54975f){if(_0x54975f){return _0x54975f[_0x935c('0x35')]()[_0x935c('0x20')](function(){_0x208a27['status'](0xcc)[_0x935c('0x2d')]();});}};}function handleEntityNotFound(_0x2ddbdd,_0x55e993){return function(_0x4d6428){if(!_0x4d6428){_0x2ddbdd['sendStatus'](0x194);}return _0x4d6428;};}function handleError(_0x1794ca,_0x574b93){_0x574b93=_0x574b93||0x1f4;return function(_0x23fa0c){logger['error'](_0x23fa0c[_0x935c('0x36')]);if(_0x23fa0c['name']){delete _0x23fa0c[_0x935c('0x37')];}_0x1794ca['status'](_0x574b93)[_0x935c('0x38')](_0x23fa0c);};}exports[_0x935c('0x39')]=function(_0x45a695,_0x788046){var _0x4ff7f0={},_0x9e70e8={},_0x125c9e={'count':0x0,'rows':[]};var _0x2f480f=db[_0x935c('0x3a')][_0x935c('0x3b')];_0x9e70e8[_0x935c('0x3c')]=_[_0x935c('0x3d')](_0x2f480f);_0x9e70e8[_0x935c('0x3e')]=_['keys'](_0x45a695[_0x935c('0x3e')]);_0x9e70e8[_0x935c('0x3f')]=_[_0x935c('0x40')](_0x9e70e8[_0x935c('0x3c')],_0x9e70e8[_0x935c('0x3e')]);_0x4ff7f0[_0x935c('0x41')]=_[_0x935c('0x40')](_0x9e70e8[_0x935c('0x3c')],qs[_0x935c('0x42')](_0x45a695[_0x935c('0x3e')][_0x935c('0x42')]));_0x4ff7f0['attributes']=_0x4ff7f0[_0x935c('0x41')][_0x935c('0x43')]?_0x4ff7f0[_0x935c('0x41')]:_0x9e70e8[_0x935c('0x3c')];if(!_0x45a695[_0x935c('0x3e')][_0x935c('0x44')]('nolimit')){_0x4ff7f0[_0x935c('0x30')]=qs[_0x935c('0x30')](_0x45a695[_0x935c('0x3e')][_0x935c('0x30')]);_0x4ff7f0[_0x935c('0x2f')]=qs['offset'](_0x45a695[_0x935c('0x3e')]['offset']);}_0x4ff7f0[_0x935c('0x45')]=qs[_0x935c('0x46')](_0x45a695[_0x935c('0x3e')][_0x935c('0x46')]);_0x4ff7f0[_0x935c('0x47')]=qs['filters'](_['pick'](_0x45a695[_0x935c('0x3e')],_0x9e70e8[_0x935c('0x3f')]));if(_0x45a695['query'][_0x935c('0x48')]){_0x4ff7f0['where']=_[_0x935c('0x49')](_0x4ff7f0[_0x935c('0x47')],{'$or':_[_0x935c('0x4a')](_0x2f480f,function(_0x1a61f8){if(_0x1a61f8[_0x935c('0x4b')][_0x935c('0x4c')]!==_0x935c('0x4d')){var _0x52507c={};_0x52507c[_0x1a61f8[_0x935c('0x4e')]]={'$like':'%'+_0x45a695[_0x935c('0x3e')][_0x935c('0x48')]+'%'};return _0x52507c;}})});}_0x4ff7f0=_[_0x935c('0x49')]({},_0x4ff7f0,_0x45a695['options']);var _0x3d1148={'where':_0x4ff7f0['where']};return db[_0x935c('0x3a')][_0x935c('0x4f')](_0x3d1148)['then'](function(_0x9ee762){_0x125c9e[_0x935c('0x4f')]=_0x9ee762;if(_0x45a695[_0x935c('0x3e')][_0x935c('0x50')]){_0x4ff7f0[_0x935c('0x51')]=[{'all':!![]}];}return db[_0x935c('0x3a')][_0x935c('0x52')](_0x4ff7f0);})['then'](function(_0x4dc8b1){_0x125c9e[_0x935c('0x53')]=_0x4dc8b1;return _0x125c9e;})[_0x935c('0x20')](respondWithFilteredResult(_0x788046,_0x4ff7f0))['catch'](handleError(_0x788046,null));};exports[_0x935c('0x54')]=function(_0x1ef770,_0x3b3f6c){var _0x484634={'raw':!![],'where':{'id':_0x1ef770[_0x935c('0x55')]['id']}},_0x3da292={};_0x3da292[_0x935c('0x3c')]=_['keys'](db['MailMessage']['rawAttributes']);_0x3da292[_0x935c('0x3e')]=_[_0x935c('0x3d')](_0x1ef770['query']);_0x3da292['filters']=_[_0x935c('0x40')](_0x3da292[_0x935c('0x3c')],_0x3da292[_0x935c('0x3e')]);_0x484634[_0x935c('0x41')]=_[_0x935c('0x40')](_0x3da292[_0x935c('0x3c')],qs[_0x935c('0x42')](_0x1ef770[_0x935c('0x3e')]['fields']));_0x484634['attributes']=_0x484634[_0x935c('0x41')]['length']?_0x484634[_0x935c('0x41')]:_0x3da292[_0x935c('0x3c')];if(_0x1ef770[_0x935c('0x3e')]['includeAll']){_0x484634[_0x935c('0x51')]=[{'all':!![]}];}_0x484634=_[_0x935c('0x49')]({},_0x484634,_0x1ef770[_0x935c('0x56')]);return db[_0x935c('0x3a')]['find'](_0x484634)[_0x935c('0x20')](handleEntityNotFound(_0x3b3f6c,null))[_0x935c('0x20')](respondWithResult(_0x3b3f6c,null))['catch'](handleError(_0x3b3f6c,null));};exports[_0x935c('0x34')]=function(_0x1ae2a8,_0x46b380){if(_0x1ae2a8[_0x935c('0x57')]['id']){delete _0x1ae2a8[_0x935c('0x57')]['id'];}return db[_0x935c('0x3a')][_0x935c('0x58')]({'where':{'id':_0x1ae2a8[_0x935c('0x55')]['id']}})[_0x935c('0x20')](handleEntityNotFound(_0x46b380,null))[_0x935c('0x20')](saveUpdates(_0x1ae2a8['body'],null))[_0x935c('0x20')](respondWithResult(_0x46b380,null))[_0x935c('0x2a')](handleError(_0x46b380,null));};exports['destroy']=function(_0x578a12,_0x40deef){return db[_0x935c('0x3a')][_0x935c('0x58')]({'where':{'id':_0x578a12[_0x935c('0x55')]['id']}})['then'](handleEntityNotFound(_0x40deef,null))['then'](removeEntity(_0x40deef,null))[_0x935c('0x2a')](handleError(_0x40deef,null));};exports[_0x935c('0x59')]=function(_0x395877,_0x20bed4){return db[_0x935c('0x3a')][_0x935c('0x59')]()[_0x935c('0x20')](respondWithResult(_0x20bed4,null))[_0x935c('0x2a')](handleError(_0x20bed4,null));};exports[_0x935c('0x5a')]=function(_0x86bf09,_0xf1afe1){return db['MailMessage']['create'](_0x86bf09[_0x935c('0x57')])[_0x935c('0x20')](function(_0x2cca29){if(_0x2cca29){if(_0x2cca29[_0x935c('0x5b')]==='out'&&!_0x2cca29[_0x935c('0x5c')]){return db['MailAccount'][_0x935c('0x5d')]({'where':{'id':_0x2cca29[_0x935c('0x5e')]},'include':[{'model':db[_0x935c('0x5f')],'as':'Smtp','raw':!![]}]})[_0x935c('0x20')](function(_0x255ebc){if(_0x255ebc&&_0x255ebc[_0x935c('0x60')]){var _0x1fe48b={'tls':{'rejectUnauthorized':![]}};if(_[_0x935c('0x61')](_0x255ebc[_0x935c('0x60')][_0x935c('0x62')])){_0x1fe48b['host']=_0x255ebc['Smtp'][_0x935c('0x63')];_0x1fe48b[_0x935c('0x64')]=_0x255ebc['Smtp']['port'];_0x1fe48b[_0x935c('0x65')]=_0x255ebc[_0x935c('0x60')]['secure'];if(_0x255ebc[_0x935c('0x60')][_0x935c('0x66')]){_0x1fe48b[_0x935c('0x67')]={'user':_0x255ebc['Smtp'][_0x935c('0x68')],'pass':_0x255ebc[_0x935c('0x60')]['pass']};}}else{_0x1fe48b[_0x935c('0x62')]=_0x255ebc['Smtp'][_0x935c('0x62')];_0x1fe48b[_0x935c('0x67')]={'user':_0x255ebc[_0x935c('0x60')][_0x935c('0x68')],'pass':_0x255ebc[_0x935c('0x60')][_0x935c('0x69')]};_0x1fe48b['secure']=_0x255ebc[_0x935c('0x60')][_0x935c('0x65')];}if(_0x86bf09[_0x935c('0x57')][_0x935c('0x6a')]&&_0x86bf09[_0x935c('0x57')][_0x935c('0x6a')][_0x935c('0x43')]){for(var _0x1b684b=0x0;_0x1b684b<_0x86bf09['body'][_0x935c('0x6a')]['length'];_0x1b684b+=0x1){_0x86bf09[_0x935c('0x57')][_0x935c('0x6a')][_0x1b684b]={'filename':_0x86bf09['body'][_0x935c('0x6a')][_0x1b684b]['name'],'path':path['join'](config[_0x935c('0x6b')],_0x935c('0x6c'),_0x86bf09[_0x935c('0x57')]['attachments'][_0x1b684b][_0x935c('0x6d')])};}}return{'account':_0x1fe48b,'message':_0x86bf09[_0x935c('0x57')]};}})[_0x935c('0x20')](function(_0x541fa6){if(_0x541fa6){return respondWithRpcPromise('SendMail',_0x935c('0x6e'),_0x541fa6,client9003)[_0x935c('0x20')](function(_0x24b019){return _0x2cca29[_0x935c('0x34')]({'read':!![],'messageId':_0x24b019[_0x935c('0x6f')],'sentAt':moment()[_0x935c('0x70')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x935c('0x2a')](function(_0x425485){logger[_0x935c('0x26')]('%s',JSON[_0x935c('0x71')](_0x425485));return _0x2cca29;});}return _0x2cca29;});}return _0x2cca29;}})['then'](respondWithResult(_0xf1afe1,0xc9))['catch'](handleError(_0xf1afe1,null));};var interaction_log=require(_0x935c('0x72'))('mail-interactions');exports[_0x935c('0x73')]=function(_0x193540,_0x57f95e,_0x1b6da0){var _0x468a6f={'channel':_0x935c('0x74')};if(_0x193540[_0x935c('0x57')]['id']){delete _0x193540[_0x935c('0x57')]['id'];}_0x193540[_0x935c('0x57')][_0x935c('0x75')]=!![];_0x193540[_0x935c('0x57')][_0x935c('0x76')]=moment()[_0x935c('0x70')](_0x935c('0x77'));_0x193540[_0x935c('0x57')][_0x935c('0x78')]=_0x193540[_0x935c('0x57')][_0x935c('0x78')]||_0x193540['user']['id'];return db[_0x935c('0x3a')]['find']({'where':{'id':_0x193540['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x57f95e,null))[_0x935c('0x20')](saveUpdates(_0x193540[_0x935c('0x57')],null))[_0x935c('0x20')](function(_0x20d801){if(_0x20d801){_0x468a6f['message']=_0x20d801[_0x935c('0x79')]({'plain':!![]});return db['MailInteraction'][_0x935c('0x58')]({'where':{'id':_0x20d801[_0x935c('0x7a')]}});}return null;})[_0x935c('0x20')](handleEntityNotFound(_0x57f95e,null))[_0x935c('0x20')](function(_0x2315c7){if(_0x2315c7){return _0x2315c7['update']({'UserId':_0x193540[_0x935c('0x57')]['UserId'],'read1stAt':_[_0x935c('0x61')](_0x2315c7[_0x935c('0x7b')])?moment()[_0x935c('0x70')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x935c('0x20')](function(_0x496564){if(_0x496564){_0x468a6f[_0x935c('0x7c')]=_0x496564['get']({'plain':!![]});interaction_log[_0x935c('0x21')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x193540[_0x935c('0x68')]['id'],_0x193540[_0x935c('0x68')][_0x935c('0x37')],_0x193540['user'][_0x935c('0x7d')],_0x468a6f[_0x935c('0x7c')]['id'],_0x193540[_0x935c('0x57')]?JSON[_0x935c('0x71')](_0x193540['body']):_0x935c('0x7e'));return respondWithRpcPromise(_0x935c('0x7f'),_0x935c('0x80'),_0x468a6f);}return null;})[_0x935c('0x20')](function(_0x28eca5){if(_0x28eca5){if(_0x193540[_0x935c('0x57')][_0x935c('0x81')]){_0x468a6f[_0x935c('0x28')][_0x935c('0x82')]=util['format']('SIP/%s',_0x193540['user'][_0x935c('0x37')]);_0x468a6f[_0x935c('0x28')][_0x935c('0x83')]=_0x468a6f['channel'];_0x468a6f[_0x935c('0x28')][_0x935c('0x84')]='accept';return respondWithRpcPromise(_0x935c('0x85'),_0x935c('0x85'),{'event':_0x935c('0x86'),'message':_0x468a6f[_0x935c('0x28')]},client9002)[_0x935c('0x20')](function(){return _0x468a6f;});}return _0x468a6f;}return null;})[_0x935c('0x20')](respondWithResult(_0x57f95e,null))[_0x935c('0x2a')](handleError(_0x57f95e,null));};var interaction_log=require('../../config/logger')(_0x935c('0x87'));exports[_0x935c('0x32')]=function(_0x4a88be,_0x435839,_0xce6fd7){var _0x8dd352={'agent':{},'channel':_0x935c('0x74')};if(_0x4a88be[_0x935c('0x57')]['id']){delete _0x4a88be[_0x935c('0x57')]['id'];}_0x4a88be[_0x935c('0x57')][_0x935c('0x78')]=_0x4a88be[_0x935c('0x57')]['UserId']||_0x4a88be[_0x935c('0x68')]['id'];_0x8dd352['agent']['id']=_0x4a88be['body'][_0x935c('0x78')];return db['MailMessage'][_0x935c('0x58')]({'where':{'id':_0x4a88be[_0x935c('0x55')]['id'],'UserId':null}})[_0x935c('0x20')](handleEntityNotFound(_0x435839,null))['then'](function(_0x2ff12f){if(_0x2ff12f){_0x8dd352[_0x935c('0x28')]=_0x2ff12f[_0x935c('0x79')]({'plain':!![]});return db[_0x935c('0x88')][_0x935c('0x58')]({'where':{'id':_0x2ff12f[_0x935c('0x7a')]}});}return null;})[_0x935c('0x20')](handleEntityNotFound(_0x435839,null))[_0x935c('0x20')](function(_0x511810){if(_0x511810){_0x8dd352['interaction']=_0x511810[_0x935c('0x79')]({'plain':!![]});interaction_log[_0x935c('0x21')](_0x935c('0x89'),_0x4a88be[_0x935c('0x68')]['id'],_0x4a88be[_0x935c('0x68')][_0x935c('0x37')],_0x4a88be[_0x935c('0x68')][_0x935c('0x7d')],_0x8dd352['interaction']['id'],_0x4a88be[_0x935c('0x57')]?JSON['stringify'](_0x4a88be[_0x935c('0x57')]):_0x935c('0x7e'));return respondWithRpcPromise(_0x935c('0x8a'),_0x935c('0x8b'),_0x8dd352);}return null;})[_0x935c('0x20')](function(_0x3d863e){if(_0x3d863e){_0x3d863e[_0x935c('0x28')][_0x935c('0x82')]=util['format'](_0x935c('0x8c'),_0x4a88be[_0x935c('0x68')][_0x935c('0x37')]);_0x3d863e[_0x935c('0x28')][_0x935c('0x83')]=_0x8dd352['channel'];_0x3d863e[_0x935c('0x28')]['event']='reject';respondWithRpcPromise(_0x935c('0x85'),'EventManager',{'event':'rejectmessage','message':_0x3d863e[_0x935c('0x28')]},client9002);return _0x8dd352;}return null;})[_0x935c('0x20')](respondWithResult(_0x435839,null))['catch'](handleError(_0x435839,null));};exports['download']=function(_0x3d4cdd,_0x4749f5){var _0x47de0d=moment()[_0x935c('0x8d')]()[_0x935c('0x8e')]();var _0x1f90e1=path[_0x935c('0x8f')](config[_0x935c('0x6b')],_0x935c('0x90'),'files',_0x935c('0x91'));var _0x49c252=path['join'](config['root'],_0x935c('0x90'),_0x935c('0x92'),'attachments');var _0x42963e=util[_0x935c('0x70')](_0x935c('0x93'),_0x47de0d);return db[_0x935c('0x3a')][_0x935c('0x58')]({'where':{'id':_0x3d4cdd['params']['id']},'attributes':['id',_0x935c('0x57'),_0x935c('0x94'),'to','cc',_0x935c('0x95'),_0x935c('0x96'),_0x935c('0x97')],'include':_0x3d4cdd[_0x935c('0x3e')]['attachments']?[{'model':db[_0x935c('0x98')],'as':_0x935c('0x99')}]:undefined})[_0x935c('0x20')](handleEntityNotFound(_0x4749f5,null))[_0x935c('0x20')](function(_0x59d4aa){if(_0x59d4aa){var _0x351245=_0x59d4aa;var _0xdd037f={'from':_0x351245['from'],'to':_0x351245['to'],'subject':_0x351245[_0x935c('0x96')],'html':_0x351245['body'],'headers':{'Date':moment(_0x351245[_0x935c('0x97')])[_0x935c('0x70')](_0x935c('0x9a'))},'attachments':[]};if(_0x59d4aa['cc']){_0xdd037f[_0x935c('0x9b')]['Cc']=_0x59d4aa['cc'];}if(_0x59d4aa[_0x935c('0x95')]){_0xdd037f[_0x935c('0x9b')][_0x935c('0x9c')]=_0x59d4aa[_0x935c('0x95')];}return new BPromise(function(_0x2f8747,_0x5a4f37){if(_0x59d4aa[_0x935c('0x99')]){for(var _0x2a407f=0x0;_0x2a407f<_0x59d4aa[_0x935c('0x99')][_0x935c('0x43')];_0x2a407f++){var _0x82817b=_0x59d4aa[_0x935c('0x99')][_0x2a407f];var _0x47fe01=path[_0x935c('0x8f')](_0x49c252,_0x82817b[_0x935c('0x6d')]);if(fs[_0x935c('0x9d')](_0x47fe01)){_0xdd037f[_0x935c('0x6a')]['push']({'name':_0x82817b['name'],'contentType':_0x82817b['type'],'data':fs[_0x935c('0x9e')](_0x47fe01)});}}}emlformat[_0x935c('0x9f')](_0xdd037f,function(_0x2bbbe1,_0x2ab1d0){if(_0x2bbbe1)return _0x5a4f37(_0x2bbbe1);fs[_0x935c('0xa0')](path['join'](_0x1f90e1,_0x42963e),_0x2ab1d0);return _0x2f8747(_0x2ab1d0);});});}})['then'](function(_0x47dc01){if(_0x47dc01){return _0x4749f5[_0x935c('0xa1')](path[_0x935c('0x8f')](_0x1f90e1,_0x42963e),_0x42963e,function(_0x18f8d0){if(_0x18f8d0){console[_0x935c('0xa2')](_0x935c('0xa3'),_0x18f8d0);}else{fs[_0x935c('0xa4')](path[_0x935c('0x8f')](_0x1f90e1,_0x42963e));}});}})['catch'](handleError(_0x4749f5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f0c8f08..ea7c399 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 _0x5419=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4c6539,_0x4221e3){var _0x1cf7e1=function(_0x2fa241){while(--_0x2fa241){_0x4c6539['push'](_0x4c6539['shift']());}};_0x1cf7e1(++_0x4221e3);}(_0x5419,0x175));var _0x9541=function(_0x263a16,_0x489c01){_0x263a16=_0x263a16-0x0;var _0x251824=_0x5419[_0x263a16];return _0x251824;};'use strict';var EventEmitter=require(_0x9541('0x0'));var MailMessage=require(_0x9541('0x1'))['db'][_0x9541('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9541('0x3')](0x0);var events={'afterCreate':_0x9541('0x4'),'afterUpdate':_0x9541('0x5'),'afterDestroy':_0x9541('0x6')};function emitEvent(_0x317e1e){return function(_0x307a35,_0xacdcfa,_0x4d8224){MailMessageEvents[_0x9541('0x7')](_0x317e1e+':'+_0x307a35['id'],_0x307a35);MailMessageEvents[_0x9541('0x7')](_0x317e1e,_0x307a35);_0x4d8224(null);};}for(var e in events){if(events[_0x9541('0x8')](e)){var event=events[e];MailMessage[_0x9541('0x9')](e,emitEvent(event));}}module[_0x9541('0xa')]=MailMessageEvents; \ No newline at end of file +var _0x7fbe=['update','remove','emit','hasOwnProperty','hook','exports','MailMessage','setMaxListeners','save'];(function(_0x22de63,_0x1c83ae){var _0x466811=function(_0x331508){while(--_0x331508){_0x22de63['push'](_0x22de63['shift']());}};_0x466811(++_0x1c83ae);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x288267,_0x12e1e3){_0x288267=_0x288267-0x0;var _0x5b245c=_0x7fbe[_0x288267];return _0x5b245c;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xe7fb('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe7fb('0x1')](0x0);var events={'afterCreate':_0xe7fb('0x2'),'afterUpdate':_0xe7fb('0x3'),'afterDestroy':_0xe7fb('0x4')};function emitEvent(_0x47625b){return function(_0x11d2c4,_0x4524ff,_0x36ab90){MailMessageEvents[_0xe7fb('0x5')](_0x47625b+':'+_0x11d2c4['id'],_0x11d2c4);MailMessageEvents[_0xe7fb('0x5')](_0x47625b,_0x11d2c4);_0x36ab90(null);};}for(var e in events){if(events[_0xe7fb('0x6')](e)){var event=events[e];MailMessage[_0xe7fb('0x7')](e,emitEvent(event));}}module[_0xe7fb('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 83963db..3405978 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 _0xad23=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','secret','MailInteraction','findOne','MailInteractionId','then','update','catch'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xad23,0x189));var _0x3ad2=function(_0x43d276,_0x2b48a4){_0x43d276=_0x43d276-0x0;var _0x58b068=_0xad23[_0x43d276];return _0x58b068;};'use strict';var _=require(_0x3ad2('0x0'));var util=require(_0x3ad2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ad2('0x2'));var BPromise=require('bluebird');var rp=require(_0x3ad2('0x3'));var htmlToText=require(_0x3ad2('0x4'));var fs=require('fs');var path=require(_0x3ad2('0x5'));var rimraf=require('rimraf');var config=require(_0x3ad2('0x6'));var attributes=require(_0x3ad2('0x7'));module[_0x3ad2('0x8')]=function(_0x5b37d5,_0x19da78){return _0x5b37d5[_0x3ad2('0x9')]('MailMessage',attributes,{'tableName':_0x3ad2('0xa'),'paranoid':![],'indexes':[{'name':_0x3ad2('0xb'),'fields':[_0x3ad2('0xb')]},{'name':'fti_mail_messages','fields':[_0x3ad2('0xc'),_0x3ad2('0xd')],'type':_0x3ad2('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x124970,_0x1e3f02,_0x49919e){if(_0x124970[_0x3ad2('0xf')]){_0x124970[_0x3ad2('0xc')]=htmlToText[_0x3ad2('0x10')](_0x124970[_0x3ad2('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x49919e(null,_0x1e3f02);},'afterCreate':function(_0xe95f1f,_0x52fd0b,_0x4bf804){var _0xaebbf4=_0x5b37d5['models'];var _0x36c0b6=_0xe95f1f[_0x3ad2('0x11')]({'plain':!![]});if(_0x36c0b6[_0x3ad2('0x12')][_0x3ad2('0x13')]()==='in'||_0x36c0b6[_0x3ad2('0x12')][_0x3ad2('0x13')]()==='out'&&!_0x36c0b6[_0x3ad2('0x14')]&&!_['isNil'](_0x36c0b6['UserId'])){_0xaebbf4[_0x3ad2('0x15')][_0x3ad2('0x16')]({'where':{'id':_0x36c0b6[_0x3ad2('0x17')]}})[_0x3ad2('0x18')](function(_0x34eab3){if(_0x34eab3){_0x34eab3[_0x3ad2('0x19')]({'lastMsgAt':_0x36c0b6['createdAt'],'lastMsgDirection':_0x36c0b6['direction']['toLowerCase'](),'lastMsgBody':_0x36c0b6[_0x3ad2('0xf')]});}})[_0x3ad2('0x1a')](function(_0x14677b){console[_0x3ad2('0x1b')](_0x14677b);});}_0x4bf804();}},'charset':_0x3ad2('0x1c'),'collate':_0x3ad2('0x1d')});}; \ No newline at end of file +var _0x18ed=['secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out'];(function(_0x3a04a6,_0x174ca4){var _0x3ab967=function(_0x418079){while(--_0x418079){_0x3a04a6['push'](_0x3a04a6['shift']());}};_0x3ab967(++_0x174ca4);}(_0x18ed,0xff));var _0xd18e=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x18ed[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd18e('0x0'));var util=require(_0xd18e('0x1'));var logger=require('../../config/logger')(_0xd18e('0x2'));var moment=require(_0xd18e('0x3'));var BPromise=require(_0xd18e('0x4'));var rp=require(_0xd18e('0x5'));var htmlToText=require(_0xd18e('0x6'));var fs=require('fs');var path=require(_0xd18e('0x7'));var rimraf=require(_0xd18e('0x8'));var config=require(_0xd18e('0x9'));var attributes=require(_0xd18e('0xa'));module[_0xd18e('0xb')]=function(_0x451704,_0x4ca185){return _0x451704[_0xd18e('0xc')](_0xd18e('0xd'),attributes,{'tableName':_0xd18e('0xe'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd18e('0xf')]},{'name':'fti_mail_messages','fields':['plainBody',_0xd18e('0x10')],'type':_0xd18e('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a566d,_0x202f3f,_0x4b9b60){if(_0x4a566d[_0xd18e('0x12')]){_0x4a566d['plainBody']=htmlToText[_0xd18e('0x13')](_0x4a566d[_0xd18e('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4b9b60(null,_0x202f3f);},'afterCreate':function(_0x11533b,_0x4c34a6,_0x5383f8){var _0x12e860=_0x451704[_0xd18e('0x14')];var _0x3a1189=_0x11533b[_0xd18e('0x15')]({'plain':!![]});if(_0x3a1189[_0xd18e('0x16')][_0xd18e('0x17')]()==='in'||_0x3a1189[_0xd18e('0x16')][_0xd18e('0x17')]()===_0xd18e('0x18')&&!_0x3a1189[_0xd18e('0x19')]&&!_[_0xd18e('0x1a')](_0x3a1189[_0xd18e('0x1b')])){_0x12e860[_0xd18e('0x1c')][_0xd18e('0x1d')]({'where':{'id':_0x3a1189[_0xd18e('0x1e')]}})[_0xd18e('0x1f')](function(_0x496853){if(_0x496853){_0x496853[_0xd18e('0x20')]({'lastMsgAt':_0x3a1189['createdAt'],'lastMsgDirection':_0x3a1189['direction'][_0xd18e('0x17')](),'lastMsgBody':_0x3a1189[_0xd18e('0x12')]});}})['catch'](function(_0x482b09){console['error'](_0x482b09);});}_0x5383f8();}},'charset':_0xd18e('0x21'),'collate':_0xd18e('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index cf53c58..4b030cc 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 _0x8ece=['./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x8ece,0x195));var _0xe8ec=function(_0x4c026f,_0x1004bb){_0x4c026f=_0x4c026f-0x0;var _0x2fb4c8=_0x8ece[_0x4c026f];return _0x2fb4c8;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});config[_0xe8ec('0xb')]=_[_0xe8ec('0xc')](config[_0xe8ec('0xb')],{'host':_0xe8ec('0xd'),'port':0x18eb});var socket=require(_0xe8ec('0xe'))(new Redis(config['redis']));require(_0xe8ec('0xf'))['register'](socket);function respondWithRpcPromise(_0x1345e0,_0x5b1569,_0x1b0a84){return new BPromise(function(_0x278f86,_0x4ff773){return client[_0xe8ec('0x10')](_0x1345e0,_0x1b0a84)[_0xe8ec('0x11')](function(_0x959f4){logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));logger[_0xe8ec('0x15')](_0xe8ec('0x16'),_0x5b1569,_0xe8ec('0x14'),JSON[_0xe8ec('0x17')](_0x959f4));if(_0x959f4['error']){if(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x19')]===0x1f4){logger[_0xe8ec('0x18')](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x4ff773(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);}logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x278f86(_0x959f4['error'][_0xe8ec('0x1a')]);}else{logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));_0x278f86(_0x959f4[_0xe8ec('0x1b')][_0xe8ec('0x1a')]);}})[_0xe8ec('0x1c')](function(_0x2e54f0){logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x2e54f0);_0x4ff773(_0x2e54f0);});});}exports[_0xe8ec('0x1d')]=function(_0x13c5c8){var _0x16c4fb=this;return new Promise(function(_0x30a35b,_0x3d6fbc){return db[_0xe8ec('0x1e')][_0xe8ec('0x1f')](_0x13c5c8[_0xe8ec('0x20')],{'raw':_0x13c5c8['options']?_0x13c5c8[_0xe8ec('0x21')][_0xe8ec('0x22')]===undefined?!![]:![]:!![]})[_0xe8ec('0x11')](function(_0x31a97d){logger[_0xe8ec('0x12')]('CreateMailMessage',_0x13c5c8);logger[_0xe8ec('0x15')](_0xe8ec('0x1d'),_0x13c5c8,JSON[_0xe8ec('0x17')](_0x31a97d));_0x30a35b(_0x31a97d);})[_0xe8ec('0x1c')](function(_0x1da05a){logger[_0xe8ec('0x18')]('CreateMailMessage',_0x1da05a['message'],_0x13c5c8);_0x3d6fbc(_0x16c4fb[_0xe8ec('0x18')](0x1f4,_0x1da05a[_0xe8ec('0x1a')]));});});}; \ No newline at end of file +var _0xf2ca=['message','result','CreateMailMessage','MailMessage','create','body','options','raw','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2b08e0,_0x5dc686){var _0x46bbce=function(_0x224798){while(--_0x224798){_0x2b08e0['push'](_0x2b08e0['shift']());}};_0x46bbce(++_0x5dc686);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x205b46,_0x3ca65b){_0x205b46=_0x205b46-0x0;var _0x2b6ae8=_0xf2ca[_0x205b46];return _0x2b6ae8;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./mailMessage.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('MailMessage,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});}exports[_0xaf2c('0x18')]=function(_0x3f977c){var _0x1b7f07=this;return new Promise(function(_0x531609,_0x35e712){return db[_0xaf2c('0x19')][_0xaf2c('0x1a')](_0x3f977c[_0xaf2c('0x1b')],{'raw':_0x3f977c[_0xaf2c('0x1c')]?_0x3f977c['options'][_0xaf2c('0x1d')]===undefined?!![]:![]:!![]})[_0xaf2c('0x1e')](function(_0x18153c){logger['info']('CreateMailMessage',_0x3f977c);logger[_0xaf2c('0x12')](_0xaf2c('0x18'),_0x3f977c,JSON[_0xaf2c('0x13')](_0x18153c));_0x531609(_0x18153c);})[_0xaf2c('0x1f')](function(_0x591aff){logger[_0xaf2c('0x14')](_0xaf2c('0x18'),_0x591aff[_0xaf2c('0x16')],_0x3f977c);_0x35e712(_0x1b7f07[_0xaf2c('0x14')](0x1f4,_0x591aff[_0xaf2c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6a780ad..9f58925 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 _0x737f=['removeListener','register','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x737f,0x8b));var _0xf737=function(_0x41b397,_0x348f9a){_0x41b397=_0x41b397-0x0;var _0x30bd53=_0x737f[_0x41b397];return _0x30bd53;};'use strict';var MailMessageEvents=require(_0xf737('0x0'));var events=[_0xf737('0x1'),_0xf737('0x2'),_0xf737('0x3')];function createListener(_0x1eaf55,_0x4d8cad){return function(_0x46c8da){_0x4d8cad[_0xf737('0x4')](_0x1eaf55,_0x46c8da);};}function removeListener(_0x31b618,_0x2991c7){return function(){MailMessageEvents[_0xf737('0x5')](_0x31b618,_0x2991c7);};}exports[_0xf737('0x6')]=function(_0x1d7ff3){for(var _0x57c7dc=0x0,_0x4e5b27=events['length'];_0x57c7dc<_0x4e5b27;_0x57c7dc++){var _0x37c26b=events[_0x57c7dc];var _0x2a790d=createListener(_0xf737('0x7')+_0x37c26b,_0x1d7ff3);MailMessageEvents['on'](_0x37c26b,_0x2a790d);}}; \ No newline at end of file +var _0xfd66=['length','./mailMessage.events','save','update','emit','removeListener','register'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0xfd66,0x71));var _0x6fd6=function(_0x230bcc,_0x334ea1){_0x230bcc=_0x230bcc-0x0;var _0x376a2c=_0xfd66[_0x230bcc];return _0x376a2c;};'use strict';var MailMessageEvents=require(_0x6fd6('0x0'));var events=[_0x6fd6('0x1'),'remove',_0x6fd6('0x2')];function createListener(_0x54e1a1,_0x4312b3){return function(_0x525723){_0x4312b3[_0x6fd6('0x3')](_0x54e1a1,_0x525723);};}function removeListener(_0x56c177,_0x5e35de){return function(){MailMessageEvents[_0x6fd6('0x4')](_0x56c177,_0x5e35de);};}exports[_0x6fd6('0x5')]=function(_0x723dae){for(var _0x275aae=0x0,_0x472173=events[_0x6fd6('0x6')];_0x275aae<_0x472173;_0x275aae++){var _0x474cb6=events[_0x275aae];var _0x471d83=createListener('mailMessage:'+_0x474cb6,_0x723dae);MailMessageEvents['on'](_0x474cb6,_0x471d83);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b4e66eb..ae63d11 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 _0xa145=['multer','util','path','express','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x3876b3,_0x308056){var _0x1fcfc3=function(_0x4c90ac){while(--_0x4c90ac){_0x3876b3['push'](_0x3876b3['shift']());}};_0x1fcfc3(++_0x308056);}(_0xa145,0x105));var _0x5a14=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa145[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x5a14('0x0'));var util=require(_0x5a14('0x1'));var path=require(_0x5a14('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a14('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5a14('0x4'));var config=require(_0x5a14('0x5'));var controller=require(_0x5a14('0x6'));router[_0x5a14('0x7')]('/',auth[_0x5a14('0x8')](),controller[_0x5a14('0x9')]);router['get'](_0x5a14('0xa'),auth[_0x5a14('0x8')](),controller['describe']);router[_0x5a14('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5a14('0xb')]);router['get'](_0x5a14('0xc'),auth[_0x5a14('0x8')](),controller['getMembers']);router[_0x5a14('0x7')](_0x5a14('0xd'),auth[_0x5a14('0x8')](),controller[_0x5a14('0xe')]);router[_0x5a14('0x7')](_0x5a14('0xf'),auth[_0x5a14('0x8')](),controller[_0x5a14('0x10')]);router[_0x5a14('0x11')]('/',auth[_0x5a14('0x8')](),controller[_0x5a14('0x12')]);router[_0x5a14('0x11')](_0x5a14('0xd'),auth[_0x5a14('0x8')](),controller[_0x5a14('0x13')]);router[_0x5a14('0x11')](_0x5a14('0xf'),auth[_0x5a14('0x8')](),controller[_0x5a14('0x14')]);router[_0x5a14('0x15')](_0x5a14('0x16'),auth[_0x5a14('0x8')](),controller[_0x5a14('0x17')]);router[_0x5a14('0x18')]('/:id',auth[_0x5a14('0x8')](),controller[_0x5a14('0x19')]);router[_0x5a14('0x18')](_0x5a14('0xd'),auth[_0x5a14('0x8')](),controller[_0x5a14('0x1a')]);router[_0x5a14('0x18')]('/:id/users',auth[_0x5a14('0x8')](),controller[_0x5a14('0x1b')]);module[_0x5a14('0x1c')]=router; \ No newline at end of file +var _0x798e=['getMembers','/:id/users','getAgents','post','create','/:id/teams','put','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members'];(function(_0x4401a2,_0x4d9397){var _0x57402a=function(_0x5ce295){while(--_0x5ce295){_0x4401a2['push'](_0x4401a2['shift']());}};_0x57402a(++_0x4d9397);}(_0x798e,0xa1));var _0xe798=function(_0x4fb446,_0x987da8){_0x4fb446=_0x4fb446-0x0;var _0x5e63d3=_0x798e[_0x4fb446];return _0x5e63d3;};'use strict';var multer=require(_0xe798('0x0'));var util=require(_0xe798('0x1'));var path=require(_0xe798('0x2'));var timeout=require('connect-timeout');var express=require(_0xe798('0x3'));var router=express[_0xe798('0x4')]();var auth=require(_0xe798('0x5'));var interaction=require(_0xe798('0x6'));var config=require('../../config/environment');var controller=require(_0xe798('0x7'));router[_0xe798('0x8')]('/',auth[_0xe798('0x9')](),controller[_0xe798('0xa')]);router[_0xe798('0x8')]('/describe',auth[_0xe798('0x9')](),controller['describe']);router[_0xe798('0x8')](_0xe798('0xb'),auth['isAuthenticated'](),controller[_0xe798('0xc')]);router[_0xe798('0x8')](_0xe798('0xd'),auth[_0xe798('0x9')](),controller[_0xe798('0xe')]);router[_0xe798('0x8')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xe798('0x8')](_0xe798('0xf'),auth[_0xe798('0x9')](),controller[_0xe798('0x10')]);router[_0xe798('0x11')]('/',auth[_0xe798('0x9')](),controller[_0xe798('0x12')]);router['post'](_0xe798('0x13'),auth[_0xe798('0x9')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xe798('0x14')]('/:id',auth[_0xe798('0x9')](),controller['update']);router[_0xe798('0x15')](_0xe798('0xb'),auth[_0xe798('0x9')](),controller[_0xe798('0x16')]);router[_0xe798('0x15')](_0xe798('0x13'),auth['isAuthenticated'](),controller[_0xe798('0x17')]);router[_0xe798('0x15')](_0xe798('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xe798('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 2b78c26..fb868ed 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 _0x4bfa=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x12c2cf,_0x123b35){var _0x1c8593=function(_0xb3940a){while(--_0xb3940a){_0x12c2cf['push'](_0x12c2cf['shift']());}};_0x1c8593(++_0x123b35);}(_0x4bfa,0x12d));var _0xa4bf=function(_0x220540,_0x534c70){_0x220540=_0x220540-0x0;var _0x2b8b99=_0x4bfa[_0x220540];return _0x2b8b99;};'use strict';var Sequelize=require(_0xa4bf('0x0'));module[_0xa4bf('0x1')]={'name':{'type':Sequelize[_0xa4bf('0x2')],'unique':_0xa4bf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa4bf('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa4bf('0x4')](_0xa4bf('0x5'),_0xa4bf('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x4440=['exports','STRING','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x4184bd,_0x20d993){var _0x213fe8=function(_0x510a8c){while(--_0x510a8c){_0x4184bd['push'](_0x4184bd['shift']());}};_0x213fe8(++_0x20d993);}(_0x4440,0x18e));var _0x0444=function(_0x37a156,_0x3d1954){_0x37a156=_0x37a156-0x0;var _0x3e52f7=_0x4440[_0x37a156];return _0x3e52f7;};'use strict';var Sequelize=require(_0x0444('0x0'));module[_0x0444('0x1')]={'name':{'type':Sequelize[_0x0444('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0444('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0444('0x3')](_0x0444('0x4'),_0x0444('0x5'),_0x0444('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 41049b0..9fdc4ca 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 _0x2f72=['order','sort','pick','filters','where','merge','map','filter','count','include','findAll','rows','catch','show','params','intersection','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue','MailQueueId','options','User','UserId','agent','updatedAt','format','%s/%s','SIP','mailPause','Team','getTeams','teams','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','forEach','userMailQueue:save','ids','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','emit','addAgents','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','MailQueue','rawAttributes','keys','query','model','fields','attributes','hasOwnProperty','nolimit','limit'];(function(_0x3d6224,_0x387caf){var _0x1b87ef=function(_0x3d1f13){while(--_0x3d1f13){_0x3d6224['push'](_0x3d6224['shift']());}};_0x1b87ef(++_0x387caf);}(_0x2f72,0x1e7));var _0x22f7=function(_0x98548,_0x209d4a){_0x98548=_0x98548-0x0;var _0x106cdd=_0x2f72[_0x98548];return _0x106cdd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x22f7('0x0'));var rimraf=require(_0x22f7('0x1'));var zipdir=require(_0x22f7('0x2'));var jsonpatch=require(_0x22f7('0x3'));var rp=require(_0x22f7('0x4'));var moment=require(_0x22f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22f7('0x6'));var util=require(_0x22f7('0x7'));var path=require(_0x22f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x22f7('0x9'));var squel=require(_0x22f7('0xa'));var crypto=require(_0x22f7('0xb'));var jsforce=require(_0x22f7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x22f7('0xd'));var querystring=require(_0x22f7('0xe'));var Papa=require(_0x22f7('0xf'));var Redis=require(_0x22f7('0x10'));var authService=require(_0x22f7('0x11'));var qs=require(_0x22f7('0x12'));var hardwareService=require(_0x22f7('0x13'));var logger=require(_0x22f7('0x14'))(_0x22f7('0x15'));var utils=require(_0x22f7('0x16'));var config=require(_0x22f7('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x22f7('0x18')](config[_0x22f7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x22f7('0x1a'))(new Redis(config[_0x22f7('0x19')]));require(_0x22f7('0x1b'))[_0x22f7('0x1c')](socket);function respondWithStatusCode(_0x5d82eb,_0x3c754a){_0x3c754a=_0x3c754a||0xcc;return function(_0x309205){if(_0x309205){return _0x5d82eb[_0x22f7('0x1d')](_0x3c754a);}return _0x5d82eb[_0x22f7('0x1e')](_0x3c754a)[_0x22f7('0x1f')]();};}function respondWithResult(_0x56c39e,_0x1fcb27){_0x1fcb27=_0x1fcb27||0xc8;return function(_0x30f951){if(_0x30f951){return _0x56c39e['status'](_0x1fcb27)[_0x22f7('0x20')](_0x30f951);}};}function respondWithFilteredResult(_0x41216a,_0x28ccc8){return function(_0x48dac9){if(_0x48dac9){var _0x42121b=_0x48dac9['count'],_0x58432f=_0x28ccc8[_0x22f7('0x21')],_0xbc0fa6=_0x28ccc8[_0x22f7('0x21')]+_0x28ccc8['limit'],_0x37d9b2;if(_0xbc0fa6>=_0x42121b){_0xbc0fa6=_0x42121b;_0x37d9b2=0xc8;}else{_0x37d9b2=0xce;}_0x41216a['status'](_0x37d9b2);return _0x41216a[_0x22f7('0x22')](_0x22f7('0x23'),_0x58432f+'-'+_0xbc0fa6+'/'+_0x42121b)[_0x22f7('0x20')](_0x48dac9);}return null;};}function patchUpdates(_0x4bb4ff){return function(_0x250b11){try{jsonpatch[_0x22f7('0x24')](_0x250b11,_0x4bb4ff,!![]);}catch(_0x53a67d){return BPromise[_0x22f7('0x25')](_0x53a67d);}return _0x250b11['save']();};}function saveUpdates(_0x16ae9d,_0x7647df){return function(_0x1dc216){if(_0x1dc216){return _0x1dc216[_0x22f7('0x26')](_0x16ae9d)[_0x22f7('0x27')](function(_0x2b53db){return _0x2b53db;});}return null;};}function removeEntity(_0x2e5c31,_0x36dbd9){return function(_0x5abab0){if(_0x5abab0){return _0x5abab0[_0x22f7('0x28')]()[_0x22f7('0x27')](function(){var _0x3eacbe=_0x5abab0[_0x22f7('0x29')]({'plain':!![]});var _0x1a3311='MailQueues';return db[_0x22f7('0x2a')][_0x22f7('0x28')]({'where':{'type':_0x1a3311,'resourceId':_0x3eacbe['id']}})[_0x22f7('0x27')](function(){return _0x5abab0;});})[_0x22f7('0x27')](function(){_0x2e5c31[_0x22f7('0x1e')](0xcc)[_0x22f7('0x1f')]();});}};}function handleEntityNotFound(_0xd51699,_0x25afea){return function(_0x30e071){if(!_0x30e071){_0xd51699[_0x22f7('0x1d')](0x194);}return _0x30e071;};}function handleError(_0x1ac246,_0x4fb731){_0x4fb731=_0x4fb731||0x1f4;return function(_0x1c0806){logger['error'](_0x1c0806[_0x22f7('0x2b')]);if(_0x1c0806[_0x22f7('0x2c')]){delete _0x1c0806[_0x22f7('0x2c')];}_0x1ac246[_0x22f7('0x1e')](_0x4fb731)[_0x22f7('0x2d')](_0x1c0806);};}exports[_0x22f7('0x2e')]=function(_0x364aef,_0x1a0135){var _0x22e914={},_0x2b6d2b={},_0x5c0227={'count':0x0,'rows':[]};var _0x309596=db[_0x22f7('0x2f')][_0x22f7('0x30')];_0x2b6d2b['model']=_[_0x22f7('0x31')](_0x309596);_0x2b6d2b[_0x22f7('0x32')]=_[_0x22f7('0x31')](_0x364aef[_0x22f7('0x32')]);_0x2b6d2b['filters']=_['intersection'](_0x2b6d2b[_0x22f7('0x33')],_0x2b6d2b[_0x22f7('0x32')]);_0x22e914['attributes']=_['intersection'](_0x2b6d2b['model'],qs[_0x22f7('0x34')](_0x364aef[_0x22f7('0x32')][_0x22f7('0x34')]));_0x22e914[_0x22f7('0x35')]=_0x22e914[_0x22f7('0x35')]['length']?_0x22e914[_0x22f7('0x35')]:_0x2b6d2b[_0x22f7('0x33')];if(!_0x364aef[_0x22f7('0x32')][_0x22f7('0x36')](_0x22f7('0x37'))){_0x22e914[_0x22f7('0x38')]=qs[_0x22f7('0x38')](_0x364aef[_0x22f7('0x32')]['limit']);_0x22e914['offset']=qs[_0x22f7('0x21')](_0x364aef['query'][_0x22f7('0x21')]);}_0x22e914[_0x22f7('0x39')]=qs[_0x22f7('0x3a')](_0x364aef['query'][_0x22f7('0x3a')]);_0x22e914['where']=qs['filters'](_[_0x22f7('0x3b')](_0x364aef[_0x22f7('0x32')],_0x2b6d2b[_0x22f7('0x3c')]));if(_0x364aef[_0x22f7('0x32')]['filter']){_0x22e914[_0x22f7('0x3d')]=_[_0x22f7('0x3e')](_0x22e914['where'],{'$or':_[_0x22f7('0x3f')](_0x309596,function(_0x4a3e3f){if(_0x4a3e3f['type']['key']!=='VIRTUAL'){var _0xe85f28={};_0xe85f28[_0x4a3e3f['field']]={'$like':'%'+_0x364aef[_0x22f7('0x32')][_0x22f7('0x40')]+'%'};return _0xe85f28;}})});}_0x22e914=_['merge']({},_0x22e914,_0x364aef['options']);var _0x3978d3={'where':_0x22e914[_0x22f7('0x3d')]};return db[_0x22f7('0x2f')]['count'](_0x3978d3)[_0x22f7('0x27')](function(_0x455a6b){_0x5c0227[_0x22f7('0x41')]=_0x455a6b;if(_0x364aef[_0x22f7('0x32')]['includeAll']){_0x22e914[_0x22f7('0x42')]=[{'all':!![]}];}return db['MailQueue'][_0x22f7('0x43')](_0x22e914);})['then'](function(_0x3640fc){_0x5c0227[_0x22f7('0x44')]=_0x3640fc;return _0x5c0227;})[_0x22f7('0x27')](respondWithFilteredResult(_0x1a0135,_0x22e914))[_0x22f7('0x45')](handleError(_0x1a0135,null));};exports[_0x22f7('0x46')]=function(_0x2cd984,_0x48990f){var _0x265224={'raw':!![],'where':{'id':_0x2cd984[_0x22f7('0x47')]['id']}},_0x3e5132={};_0x3e5132[_0x22f7('0x33')]=_[_0x22f7('0x31')](db['MailQueue']['rawAttributes']);_0x3e5132[_0x22f7('0x32')]=_['keys'](_0x2cd984['query']);_0x3e5132[_0x22f7('0x3c')]=_[_0x22f7('0x48')](_0x3e5132['model'],_0x3e5132['query']);_0x265224['attributes']=_[_0x22f7('0x48')](_0x3e5132[_0x22f7('0x33')],qs[_0x22f7('0x34')](_0x2cd984[_0x22f7('0x32')][_0x22f7('0x34')]));_0x265224[_0x22f7('0x35')]=_0x265224['attributes'][_0x22f7('0x49')]?_0x265224['attributes']:_0x3e5132['model'];if(_0x2cd984[_0x22f7('0x32')]['includeAll']){_0x265224[_0x22f7('0x42')]=[{'all':!![]}];}_0x265224=_[_0x22f7('0x3e')]({},_0x265224,_0x2cd984['options']);return db[_0x22f7('0x2f')][_0x22f7('0x4a')](_0x265224)[_0x22f7('0x27')](handleEntityNotFound(_0x48990f,null))[_0x22f7('0x27')](respondWithResult(_0x48990f,null))['catch'](handleError(_0x48990f,null));};exports[_0x22f7('0x4b')]=function(_0x3ffa65,_0x5b22b5){return db[_0x22f7('0x2f')][_0x22f7('0x4b')](_0x3ffa65['body'],{})[_0x22f7('0x27')](function(_0x4bdd28){var _0xb53917=_0x3ffa65[_0x22f7('0x4c')][_0x22f7('0x29')]({'plain':!![]});if(!_0xb53917)throw new Error(_0x22f7('0x4d'));if(_0xb53917[_0x22f7('0x4e')]===_0x22f7('0x4c')){var _0x4a73c9=_0x4bdd28[_0x22f7('0x29')]({'plain':!![]});var _0x5c4408='MailQueues';return db[_0x22f7('0x4f')][_0x22f7('0x4a')]({'where':{'name':_0x5c4408,'userProfileId':_0xb53917[_0x22f7('0x50')]},'raw':!![]})[_0x22f7('0x27')](function(_0x44efae){if(_0x44efae&&_0x44efae[_0x22f7('0x51')]===0x0){return db[_0x22f7('0x2a')][_0x22f7('0x4b')]({'name':_0x4a73c9[_0x22f7('0x2c')],'resourceId':_0x4a73c9['id'],'type':_0x44efae['name'],'sectionId':_0x44efae['id']},{})[_0x22f7('0x27')](function(){return _0x4bdd28;});}else{return _0x4bdd28;}})['catch'](function(_0x3e3889){logger[_0x22f7('0x52')](_0x22f7('0x53'),_0x3e3889);throw _0x3e3889;});}return _0x4bdd28;})[_0x22f7('0x27')](respondWithResult(_0x5b22b5,0xc9))[_0x22f7('0x45')](handleError(_0x5b22b5,null));};exports[_0x22f7('0x26')]=function(_0x13669d,_0x10a0c2){if(_0x13669d[_0x22f7('0x54')]['id']){delete _0x13669d[_0x22f7('0x54')]['id'];}return db['MailQueue'][_0x22f7('0x4a')]({'where':{'id':_0x13669d[_0x22f7('0x47')]['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x10a0c2,null))[_0x22f7('0x27')](saveUpdates(_0x13669d[_0x22f7('0x54')],null))[_0x22f7('0x27')](respondWithResult(_0x10a0c2,null))[_0x22f7('0x45')](handleError(_0x10a0c2,null));};exports['destroy']=function(_0x56273e,_0x2f9bca){return db['MailQueue'][_0x22f7('0x4a')]({'where':{'id':_0x56273e[_0x22f7('0x47')]['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x2f9bca,null))['then'](removeEntity(_0x2f9bca,null))['catch'](handleError(_0x2f9bca,null));};exports[_0x22f7('0x55')]=function(_0x4a5ea4,_0xc42c47){return db['MailQueue'][_0x22f7('0x55')]()['then'](respondWithResult(_0xc42c47,null))[_0x22f7('0x45')](handleError(_0xc42c47,null));};exports['getMembers']=function(_0x3f86a7,_0x10d51c,_0x56ac72){var _0x2a1b8f={'raw':!![],'where':{}},_0x11d1d2={},_0x5460d7;return db[_0x22f7('0x2f')][_0x22f7('0x56')]({'where':{'id':_0x3f86a7[_0x22f7('0x47')]['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x10d51c,null))['then'](function(_0x30e87c){if(_0x30e87c){_0x5460d7=_0x30e87c[_0x22f7('0x29')]({'plain':!![]});_0x11d1d2[_0x22f7('0x33')]=_[_0x22f7('0x31')](db[_0x22f7('0x57')][_0x22f7('0x30')]);_0x11d1d2[_0x22f7('0x32')]=_[_0x22f7('0x31')](_0x3f86a7[_0x22f7('0x32')]);_0x11d1d2[_0x22f7('0x3c')]=_[_0x22f7('0x48')](_0x11d1d2[_0x22f7('0x33')],_0x11d1d2[_0x22f7('0x32')]);_0x2a1b8f[_0x22f7('0x35')]=_[_0x22f7('0x48')](_0x11d1d2[_0x22f7('0x33')],qs[_0x22f7('0x34')](_0x3f86a7['query'][_0x22f7('0x34')]));_0x2a1b8f[_0x22f7('0x35')]=_0x2a1b8f[_0x22f7('0x35')]['length']?_0x2a1b8f[_0x22f7('0x35')]:_0x11d1d2['model'];if(!_0x3f86a7[_0x22f7('0x32')][_0x22f7('0x36')](_0x22f7('0x37'))){_0x2a1b8f['limit']=qs[_0x22f7('0x38')](_0x3f86a7[_0x22f7('0x32')][_0x22f7('0x38')]);_0x2a1b8f[_0x22f7('0x21')]=qs['offset'](_0x3f86a7['query'][_0x22f7('0x21')]);}_0x2a1b8f[_0x22f7('0x39')]=qs[_0x22f7('0x3a')](_0x3f86a7[_0x22f7('0x32')]['sort']);_0x2a1b8f[_0x22f7('0x3d')]=qs[_0x22f7('0x3c')](_['pick'](_0x3f86a7[_0x22f7('0x32')],_0x11d1d2[_0x22f7('0x3c')]));_0x2a1b8f[_0x22f7('0x3d')][_0x22f7('0x58')]=_0x30e87c['id'];if(_0x3f86a7['query']['filter']){_0x2a1b8f[_0x22f7('0x3d')]=_[_0x22f7('0x3e')](_0x2a1b8f[_0x22f7('0x3d')],{'$or':_[_0x22f7('0x3f')](_0x2a1b8f['attributes'],function(_0x47f5b6){var _0x979a76={};_0x979a76[_0x47f5b6]={'$like':'%'+_0x3f86a7[_0x22f7('0x32')][_0x22f7('0x40')]+'%'};return _0x979a76;})});}_0x2a1b8f=_[_0x22f7('0x3e')]({},_0x2a1b8f,_0x3f86a7[_0x22f7('0x59')]);return db['UserMailQueue']['findAll'](_0x2a1b8f);}})[_0x22f7('0x27')](function(_0x17bc2f){if(_0x17bc2f){return db[_0x22f7('0x5a')]['findAndCountAll']({'where':{'id':_[_0x22f7('0x3f')](_0x17bc2f,_0x22f7('0x5b')),'role':_0x22f7('0x5c')},'attributes':['id','name','mailPause',_0x22f7('0x5d'),'createdAt']});}})['then'](function(_0x1dddee){if(_0x1dddee){return{'count':_0x1dddee['count'],'rows':_[_0x22f7('0x3f')](_0x1dddee[_0x22f7('0x44')],function(_0x5aab13){return{'membername':_0x5aab13['name'],'UserId':_0x5aab13['id'],'queue_name':_0x5460d7['name'],'MailQueueId':_0x5460d7['id'],'interface':util[_0x22f7('0x5e')](_0x22f7('0x5f'),_0x22f7('0x60'),_0x5aab13[_0x22f7('0x2c')]),'penalty':0x0,'paused':_0x5aab13[_0x22f7('0x61')],'createdAt':_0x5aab13['createdAt'],'updatedAt':_0x5aab13[_0x22f7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x22f7('0x27')](respondWithFilteredResult(_0x10d51c,_0x2a1b8f))['catch'](handleError(_0x10d51c,null));};exports['getTeams']=function(_0x3da38d,_0x4cb4de,_0x2b16c4){var _0x41ea21={};var _0x142e4e={};var _0x4caf61;var _0x256c0b;return db[_0x22f7('0x2f')]['findOne']({'where':{'id':_0x3da38d['params']['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x4cb4de,null))[_0x22f7('0x27')](function(_0x998207){if(_0x998207){_0x4caf61=_0x998207;_0x142e4e[_0x22f7('0x33')]=_[_0x22f7('0x31')](db[_0x22f7('0x62')][_0x22f7('0x30')]);_0x142e4e['query']=_[_0x22f7('0x31')](_0x3da38d['query']);_0x142e4e[_0x22f7('0x3c')]=_[_0x22f7('0x48')](_0x142e4e[_0x22f7('0x33')],_0x142e4e[_0x22f7('0x32')]);_0x41ea21['attributes']=_['intersection'](_0x142e4e['model'],qs[_0x22f7('0x34')](_0x3da38d['query'][_0x22f7('0x34')]));_0x41ea21[_0x22f7('0x35')]=_0x41ea21[_0x22f7('0x35')][_0x22f7('0x49')]?_0x41ea21[_0x22f7('0x35')]:_0x142e4e[_0x22f7('0x33')];_0x41ea21[_0x22f7('0x39')]=qs['sort'](_0x3da38d['query'][_0x22f7('0x3a')]);_0x41ea21['where']=qs[_0x22f7('0x3c')](_[_0x22f7('0x3b')](_0x3da38d[_0x22f7('0x32')],_0x142e4e[_0x22f7('0x3c')]));if(_0x3da38d[_0x22f7('0x32')][_0x22f7('0x40')]){_0x41ea21[_0x22f7('0x3d')]=_['merge'](_0x41ea21['where'],{'$or':_[_0x22f7('0x3f')](_0x41ea21[_0x22f7('0x35')],function(_0xac6b6e){var _0x5b8463={};_0x5b8463[_0xac6b6e]={'$like':'%'+_0x3da38d[_0x22f7('0x32')]['filter']+'%'};return _0x5b8463;})});}_0x41ea21=_[_0x22f7('0x3e')]({},_0x41ea21,_0x3da38d['options']);return _0x4caf61[_0x22f7('0x63')](_0x41ea21);}})[_0x22f7('0x27')](function(_0x438ea6){if(_0x438ea6){_0x256c0b=_0x438ea6[_0x22f7('0x49')];if(!_0x3da38d['query'][_0x22f7('0x36')](_0x22f7('0x37'))){_0x41ea21[_0x22f7('0x38')]=qs[_0x22f7('0x38')](_0x3da38d[_0x22f7('0x32')]['limit']);_0x41ea21['offset']=qs[_0x22f7('0x21')](_0x3da38d[_0x22f7('0x32')][_0x22f7('0x21')]);}return _0x4caf61[_0x22f7('0x63')](_0x41ea21);}})[_0x22f7('0x27')](function(_0x48e58a){if(_0x48e58a){return _0x48e58a?{'count':_0x256c0b,'rows':_0x48e58a}:null;}})[_0x22f7('0x27')](respondWithResult(_0x4cb4de,null))[_0x22f7('0x45')](handleError(_0x4cb4de,null));};exports['addTeams']=function(_0x46cd59,_0x5f175c,_0xc74daf){var _0x965025=_0x46cd59[_0x22f7('0x54')][_0x22f7('0x64')];return db[_0x22f7('0x62')][_0x22f7('0x43')]({'where':{'id':_[_0x22f7('0x3f')](_0x965025,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x22f7('0x65'),'attributes':['id',_0x22f7('0x2c'),_0x22f7('0x66'),_0x22f7('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x8248b5){if(_0x8248b5){var _0x3b32af=_[_0x22f7('0x68')](_0x8248b5,function(_0x2836df){var _0x481f24=_0x2836df[_0x22f7('0x29')]({'plain':!![]});return _0x481f24[_0x22f7('0x65')];});return db['MailQueue'][_0x22f7('0x4a')]({'where':{'id':_0x46cd59[_0x22f7('0x47')]['id']}})['then'](function(_0x58b61b){return db[_0x22f7('0x69')][_0x22f7('0x6a')](function(_0x51da74){return _0x58b61b[_0x22f7('0x6b')](_[_0x22f7('0x3f')](_0x965025,'id'),{'transaction':_0x51da74})[_0x22f7('0x27')](function(){return BPromise['each'](_0x3b32af,function(_0x1704ea){return db[_0x22f7('0x57')]['findOrCreate']({'where':{'UserId':_0x1704ea['id'],'MailQueueId':_0x46cd59[_0x22f7('0x47')]['id']},'transaction':_0x51da74});});})[_0x22f7('0x27')](function(){_0x3b32af[_0x22f7('0x6c')](function(_0x50d238){socket['emit'](_0x22f7('0x6d'),{'UserId':_0x50d238['id'],'MailQueueId':_0x58b61b['id']});});});});});}})['then'](respondWithStatusCode(_0x5f175c,null))[_0x22f7('0x45')](handleError(_0x5f175c,null));};exports['removeTeams']=function(_0x33c397,_0x5334e9,_0x21d08f){return db['Team'][_0x22f7('0x43')]({'where':{'id':_0x33c397['query'][_0x22f7('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x22f7('0x65'),'attributes':['id'],'raw':!![]}]})[_0x22f7('0x27')](handleEntityNotFound(_0x5334e9,null))[_0x22f7('0x27')](function(_0x51c49f){var _0x3d2369=_['map'](_0x51c49f,'id');var _0x399a6d=[];var _0x32e5f6=[];var _0x2d8e44=squel[_0x22f7('0x6f')]();_0x2d8e44[_0x22f7('0x70')]('tq.TeamId')['from'](_0x22f7('0x71'),'tq')[_0x22f7('0x72')](_0x22f7('0x73'),'ut',_0x22f7('0x74'))[_0x22f7('0x3d')](_0x22f7('0x75'),_0x33c397[_0x22f7('0x47')]['id']);for(var _0x1219ee=0x0;_0x1219ee<_0x51c49f[_0x22f7('0x49')];_0x1219ee+=0x1){let _0xb55a97=_0x51c49f[_0x1219ee];for(var _0x4f65bd=0x0;_0x4f65bd<_0xb55a97['Agents'][_0x22f7('0x49')];_0x4f65bd+=0x1){let _0x427af3=_0xb55a97[_0x22f7('0x65')][_0x4f65bd];var _0x33a9a7=_0x2d8e44['clone']();_0x33a9a7[_0x22f7('0x3d')]('ut.UserId\x20=\x20?',_0x427af3['id']);_0x32e5f6[_0x22f7('0x76')](db[_0x22f7('0x69')]['query'](_0x33a9a7[_0x22f7('0x77')](),{'type':db['sequelize']['QueryTypes'][_0x22f7('0x78')]})[_0x22f7('0x27')](function(_0x52787d){if(_0x52787d[_0x22f7('0x49')]===0x1){return _0x427af3['id'];}else{var _0x2298cd=_[_0x22f7('0x79')](_[_0x22f7('0x3f')](_0x52787d,_0x22f7('0x7a')),function(_0x3fcc72){return _[_0x22f7('0x7b')](_0x3d2369,_0x3fcc72);});if(_0x2298cd){return _0x427af3['id'];}}}));}}return BPromise[_0x22f7('0x7c')](_0x32e5f6)[_0x22f7('0x27')](function(_0x160326){_0x399a6d=_(_0x399a6d)[_0x22f7('0x7d')](_0x160326)[_0x22f7('0x7e')]()['value']();return db[_0x22f7('0x2f')]['find']({'where':{'id':_0x33c397[_0x22f7('0x47')]['id']}})[_0x22f7('0x27')](function(_0x3f3de3){return db[_0x22f7('0x69')][_0x22f7('0x6a')](function(_0x123185){return _0x3f3de3[_0x22f7('0x7f')](_0x33c397[_0x22f7('0x32')][_0x22f7('0x6e')],{'transaction':_0x123185})[_0x22f7('0x27')](function(){if(!_[_0x22f7('0x80')](_0x399a6d)){return _0x3f3de3[_0x22f7('0x81')](_0x399a6d,{'transaction':_0x123185});}})[_0x22f7('0x27')](function(){_0x399a6d[_0x22f7('0x6c')](function(_0x5bc8f7){socket[_0x22f7('0x82')]('userMailQueue:remove',{'UserId':_0x5bc8f7,'MailQueueId':_0x3f3de3['id']});});});});});});})['then'](respondWithStatusCode(_0x5334e9,null))[_0x22f7('0x45')](handleError(_0x5334e9,null));};exports[_0x22f7('0x83')]=function(_0xc96eaa,_0x22fb14,_0x2da28b){return db[_0x22f7('0x2f')][_0x22f7('0x4a')]({'where':{'id':_0xc96eaa['params']['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x22fb14,null))[_0x22f7('0x27')](function(_0x37f85a){if(_0x37f85a){return _0x37f85a[_0x22f7('0x83')](_0xc96eaa['body'][_0x22f7('0x6e')],_['omit'](_0xc96eaa[_0x22f7('0x54')],['ids','id'])||{})[_0x22f7('0x84')](function(_0x2bbbbc){for(var _0x9c788b=0x0;_0x9c788b<_0xc96eaa[_0x22f7('0x54')][_0x22f7('0x6e')][_0x22f7('0x49')];_0x9c788b+=0x1){socket[_0x22f7('0x82')]('userMailQueue:save',{'UserId':_0xc96eaa[_0x22f7('0x54')]['ids'][_0x9c788b],'MailQueueId':_0xc96eaa[_0x22f7('0x47')]['id']});}return _0x2bbbbc;});}})[_0x22f7('0x27')](respondWithResult(_0x22fb14,null))['catch'](handleError(_0x22fb14,null));};exports[_0x22f7('0x81')]=function(_0x4ef595,_0xda2095,_0x1b89ca){return db[_0x22f7('0x2f')][_0x22f7('0x4a')]({'where':{'id':_0x4ef595[_0x22f7('0x47')]['id']}})['then'](handleEntityNotFound(_0xda2095,null))[_0x22f7('0x27')](function(_0x5f2b8f){if(_0x5f2b8f){return _0x5f2b8f[_0x22f7('0x81')](_0x4ef595[_0x22f7('0x32')][_0x22f7('0x6e')])[_0x22f7('0x27')](function(){if(_[_0x22f7('0x85')](_0x4ef595[_0x22f7('0x32')][_0x22f7('0x6e')])){for(var _0x38719c=0x0;_0x38719c<_0x4ef595[_0x22f7('0x32')]['ids'][_0x22f7('0x49')];_0x38719c+=0x1){socket[_0x22f7('0x82')](_0x22f7('0x86'),{'UserId':Number(_0x4ef595[_0x22f7('0x32')][_0x22f7('0x6e')][_0x38719c]),'MailQueueId':Number(_0x4ef595[_0x22f7('0x47')]['id'])});}}else{socket[_0x22f7('0x82')](_0x22f7('0x86'),{'UserId':Number(_0x4ef595[_0x22f7('0x32')]['ids']),'MailQueueId':Number(_0x4ef595['params']['id'])});}});}})['then'](respondWithStatusCode(_0xda2095,null))[_0x22f7('0x45')](handleError(_0xda2095,null));};exports['getAgents']=function(_0x3417e4,_0x2691cf,_0x2d62db){var _0x514152={};var _0x156904={};var _0x58fd76;var _0x1cf172;return db[_0x22f7('0x2f')][_0x22f7('0x56')]({'where':{'id':_0x3417e4[_0x22f7('0x47')]['id']}})[_0x22f7('0x27')](handleEntityNotFound(_0x2691cf,null))[_0x22f7('0x27')](function(_0x4bd8c7){if(_0x4bd8c7){_0x58fd76=_0x4bd8c7;_0x156904['model']=_[_0x22f7('0x31')](db['User'][_0x22f7('0x30')]);_0x156904[_0x22f7('0x32')]=_[_0x22f7('0x31')](_0x3417e4[_0x22f7('0x32')]);_0x156904[_0x22f7('0x3c')]=_[_0x22f7('0x48')](_0x156904['model'],_0x156904[_0x22f7('0x32')]);_0x514152[_0x22f7('0x35')]=_[_0x22f7('0x48')](_0x156904[_0x22f7('0x33')],qs['fields'](_0x3417e4['query'][_0x22f7('0x34')]));_0x514152[_0x22f7('0x35')]=_0x514152[_0x22f7('0x35')][_0x22f7('0x49')]?_0x514152['attributes']:_0x156904[_0x22f7('0x33')];_0x514152[_0x22f7('0x39')]=qs[_0x22f7('0x3a')](_0x3417e4[_0x22f7('0x32')][_0x22f7('0x3a')]);_0x514152[_0x22f7('0x3d')]=qs[_0x22f7('0x3c')](_[_0x22f7('0x3b')](_0x3417e4[_0x22f7('0x32')],_0x156904[_0x22f7('0x3c')]));if(_0x3417e4['query']['filter']){_0x514152['where']=_[_0x22f7('0x3e')](_0x514152[_0x22f7('0x3d')],{'$or':_[_0x22f7('0x3f')](_0x514152[_0x22f7('0x35')],function(_0x490bdb){var _0x347228={};_0x347228[_0x490bdb]={'$like':'%'+_0x3417e4[_0x22f7('0x32')][_0x22f7('0x40')]+'%'};return _0x347228;})});}_0x514152=_[_0x22f7('0x3e')]({},_0x514152,_0x3417e4['options']);return _0x58fd76[_0x22f7('0x87')](_0x514152);}})[_0x22f7('0x27')](function(_0x78ff95){if(_0x78ff95){_0x1cf172=_0x78ff95[_0x22f7('0x49')];if(!_0x3417e4[_0x22f7('0x32')]['hasOwnProperty'](_0x22f7('0x37'))){_0x514152[_0x22f7('0x38')]=qs[_0x22f7('0x38')](_0x3417e4[_0x22f7('0x32')]['limit']);_0x514152[_0x22f7('0x21')]=qs[_0x22f7('0x21')](_0x3417e4['query'][_0x22f7('0x21')]);}return _0x58fd76[_0x22f7('0x87')](_0x514152);}})[_0x22f7('0x27')](function(_0x140666){if(_0x140666){return _0x140666?{'count':_0x1cf172,'rows':_0x140666}:null;}})[_0x22f7('0x27')](respondWithResult(_0x2691cf,null))['catch'](handleError(_0x2691cf,null));}; \ No newline at end of file +var _0xf23f=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','rawAttributes','model','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','map','key','VIRTUAL','field','filter','merge','options','MailQueue','count','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserMailQueue','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','nolimit','teams','Team','Agents','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','tq.TeamId','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf23f,0x127));var _0xff23=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0xf23f[_0x1475a6];return _0x3c0d07;};'use strict';var pdf=require(_0xff23('0x0'));var emlformat=require(_0xff23('0x1'));var rimraf=require(_0xff23('0x2'));var zipdir=require(_0xff23('0x3'));var jsonpatch=require(_0xff23('0x4'));var rp=require('request-promise');var moment=require(_0xff23('0x5'));var BPromise=require(_0xff23('0x6'));var Mustache=require(_0xff23('0x7'));var util=require(_0xff23('0x8'));var path=require(_0xff23('0x9'));var sox=require(_0xff23('0xa'));var csv=require(_0xff23('0xb'));var ejs=require(_0xff23('0xc'));var fs=require('fs');var _=require(_0xff23('0xd'));var squel=require(_0xff23('0xe'));var crypto=require(_0xff23('0xf'));var jsforce=require(_0xff23('0x10'));var deskjs=require(_0xff23('0x11'));var toCsv=require(_0xff23('0xb'));var querystring=require(_0xff23('0x12'));var Papa=require('papaparse');var Redis=require(_0xff23('0x13'));var authService=require(_0xff23('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xff23('0x15'));var logger=require('../../config/logger')(_0xff23('0x16'));var utils=require(_0xff23('0x17'));var config=require(_0xff23('0x18'));var db=require(_0xff23('0x19'))['db'];config[_0xff23('0x1a')]=_[_0xff23('0x1b')](config[_0xff23('0x1a')],{'host':_0xff23('0x1c'),'port':0x18eb});var socket=require(_0xff23('0x1d'))(new Redis(config[_0xff23('0x1a')]));require(_0xff23('0x1e'))[_0xff23('0x1f')](socket);function respondWithStatusCode(_0x5842fc,_0x5db799){_0x5db799=_0x5db799||0xcc;return function(_0x5bc398){if(_0x5bc398){return _0x5842fc[_0xff23('0x20')](_0x5db799);}return _0x5842fc[_0xff23('0x21')](_0x5db799)[_0xff23('0x22')]();};}function respondWithResult(_0x5d71e3,_0x543465){_0x543465=_0x543465||0xc8;return function(_0x4473fb){if(_0x4473fb){return _0x5d71e3[_0xff23('0x21')](_0x543465)[_0xff23('0x23')](_0x4473fb);}};}function respondWithFilteredResult(_0x170cc5,_0x3ac61a){return function(_0x88953c){if(_0x88953c){var _0x2139f3=_0x88953c['count'],_0x3e4039=_0x3ac61a[_0xff23('0x24')],_0x5dee67=_0x3ac61a['offset']+_0x3ac61a[_0xff23('0x25')],_0xd425a4;if(_0x5dee67>=_0x2139f3){_0x5dee67=_0x2139f3;_0xd425a4=0xc8;}else{_0xd425a4=0xce;}_0x170cc5['status'](_0xd425a4);return _0x170cc5[_0xff23('0x26')]('Content-Range',_0x3e4039+'-'+_0x5dee67+'/'+_0x2139f3)[_0xff23('0x23')](_0x88953c);}return null;};}function patchUpdates(_0x322473){return function(_0x3b838e){try{jsonpatch[_0xff23('0x27')](_0x3b838e,_0x322473,!![]);}catch(_0x27816b){return BPromise[_0xff23('0x28')](_0x27816b);}return _0x3b838e[_0xff23('0x29')]();};}function saveUpdates(_0x204a16,_0x16ddd9){return function(_0x234f5d){if(_0x234f5d){return _0x234f5d['update'](_0x204a16)[_0xff23('0x2a')](function(_0x35a77c){return _0x35a77c;});}return null;};}function removeEntity(_0x2d1bf9,_0x5c6523){return function(_0x2fcfa8){if(_0x2fcfa8){return _0x2fcfa8[_0xff23('0x2b')]()[_0xff23('0x2a')](function(){var _0xa9230d=_0x2fcfa8[_0xff23('0x2c')]({'plain':!![]});var _0xbc5ea1='MailQueues';return db[_0xff23('0x2d')][_0xff23('0x2b')]({'where':{'type':_0xbc5ea1,'resourceId':_0xa9230d['id']}})[_0xff23('0x2a')](function(){return _0x2fcfa8;});})[_0xff23('0x2a')](function(){_0x2d1bf9[_0xff23('0x21')](0xcc)[_0xff23('0x22')]();});}};}function handleEntityNotFound(_0x153189,_0x81ed91){return function(_0x2b6a7e){if(!_0x2b6a7e){_0x153189[_0xff23('0x20')](0x194);}return _0x2b6a7e;};}function handleError(_0x71cfce,_0x392599){_0x392599=_0x392599||0x1f4;return function(_0x542249){logger['error'](_0x542249[_0xff23('0x2e')]);if(_0x542249[_0xff23('0x2f')]){delete _0x542249[_0xff23('0x2f')];}_0x71cfce[_0xff23('0x21')](_0x392599)[_0xff23('0x30')](_0x542249);};}exports[_0xff23('0x31')]=function(_0x10d4b9,_0x46e437){var _0x55dd36={},_0x29fe6c={},_0x3f62b8={'count':0x0,'rows':[]};var _0x342743=db['MailQueue'][_0xff23('0x32')];_0x29fe6c[_0xff23('0x33')]=_[_0xff23('0x34')](_0x342743);_0x29fe6c['query']=_[_0xff23('0x34')](_0x10d4b9['query']);_0x29fe6c[_0xff23('0x35')]=_['intersection'](_0x29fe6c[_0xff23('0x33')],_0x29fe6c[_0xff23('0x36')]);_0x55dd36[_0xff23('0x37')]=_['intersection'](_0x29fe6c[_0xff23('0x33')],qs['fields'](_0x10d4b9[_0xff23('0x36')][_0xff23('0x38')]));_0x55dd36[_0xff23('0x37')]=_0x55dd36[_0xff23('0x37')][_0xff23('0x39')]?_0x55dd36[_0xff23('0x37')]:_0x29fe6c[_0xff23('0x33')];if(!_0x10d4b9['query'][_0xff23('0x3a')]('nolimit')){_0x55dd36[_0xff23('0x25')]=qs[_0xff23('0x25')](_0x10d4b9[_0xff23('0x36')][_0xff23('0x25')]);_0x55dd36['offset']=qs[_0xff23('0x24')](_0x10d4b9[_0xff23('0x36')]['offset']);}_0x55dd36[_0xff23('0x3b')]=qs[_0xff23('0x3c')](_0x10d4b9[_0xff23('0x36')][_0xff23('0x3c')]);_0x55dd36[_0xff23('0x3d')]=qs['filters'](_['pick'](_0x10d4b9[_0xff23('0x36')],_0x29fe6c['filters']));if(_0x10d4b9[_0xff23('0x36')]['filter']){_0x55dd36['where']=_['merge'](_0x55dd36[_0xff23('0x3d')],{'$or':_[_0xff23('0x3e')](_0x342743,function(_0x3d836c){if(_0x3d836c['type'][_0xff23('0x3f')]!==_0xff23('0x40')){var _0x301529={};_0x301529[_0x3d836c[_0xff23('0x41')]]={'$like':'%'+_0x10d4b9[_0xff23('0x36')][_0xff23('0x42')]+'%'};return _0x301529;}})});}_0x55dd36=_[_0xff23('0x43')]({},_0x55dd36,_0x10d4b9[_0xff23('0x44')]);var _0x88497e={'where':_0x55dd36[_0xff23('0x3d')]};return db[_0xff23('0x45')][_0xff23('0x46')](_0x88497e)[_0xff23('0x2a')](function(_0x3b2c7d){_0x3f62b8[_0xff23('0x46')]=_0x3b2c7d;if(_0x10d4b9[_0xff23('0x36')]['includeAll']){_0x55dd36[_0xff23('0x47')]=[{'all':!![]}];}return db[_0xff23('0x45')][_0xff23('0x48')](_0x55dd36);})[_0xff23('0x2a')](function(_0x356c0a){_0x3f62b8[_0xff23('0x49')]=_0x356c0a;return _0x3f62b8;})[_0xff23('0x2a')](respondWithFilteredResult(_0x46e437,_0x55dd36))[_0xff23('0x4a')](handleError(_0x46e437,null));};exports[_0xff23('0x4b')]=function(_0x117bcb,_0x483b4b){var _0x3a7973={'raw':!![],'where':{'id':_0x117bcb[_0xff23('0x4c')]['id']}},_0x256a2b={};_0x256a2b[_0xff23('0x33')]=_['keys'](db[_0xff23('0x45')][_0xff23('0x32')]);_0x256a2b[_0xff23('0x36')]=_['keys'](_0x117bcb[_0xff23('0x36')]);_0x256a2b[_0xff23('0x35')]=_[_0xff23('0x4d')](_0x256a2b[_0xff23('0x33')],_0x256a2b[_0xff23('0x36')]);_0x3a7973[_0xff23('0x37')]=_[_0xff23('0x4d')](_0x256a2b[_0xff23('0x33')],qs[_0xff23('0x38')](_0x117bcb[_0xff23('0x36')][_0xff23('0x38')]));_0x3a7973[_0xff23('0x37')]=_0x3a7973[_0xff23('0x37')]['length']?_0x3a7973[_0xff23('0x37')]:_0x256a2b[_0xff23('0x33')];if(_0x117bcb['query'][_0xff23('0x4e')]){_0x3a7973[_0xff23('0x47')]=[{'all':!![]}];}_0x3a7973=_[_0xff23('0x43')]({},_0x3a7973,_0x117bcb[_0xff23('0x44')]);return db['MailQueue'][_0xff23('0x4f')](_0x3a7973)[_0xff23('0x2a')](handleEntityNotFound(_0x483b4b,null))[_0xff23('0x2a')](respondWithResult(_0x483b4b,null))[_0xff23('0x4a')](handleError(_0x483b4b,null));};exports[_0xff23('0x50')]=function(_0x31c830,_0x3084b3){return db[_0xff23('0x45')][_0xff23('0x50')](_0x31c830[_0xff23('0x51')],{})['then'](function(_0x4faebc){var _0x36cc58=_0x31c830[_0xff23('0x52')]['get']({'plain':!![]});if(!_0x36cc58)throw new Error(_0xff23('0x53'));if(_0x36cc58[_0xff23('0x54')]==='user'){var _0x4060ff=_0x4faebc[_0xff23('0x2c')]({'plain':!![]});var _0x57e228=_0xff23('0x55');return db[_0xff23('0x56')]['find']({'where':{'name':_0x57e228,'userProfileId':_0x36cc58[_0xff23('0x57')]},'raw':!![]})[_0xff23('0x2a')](function(_0x3359e8){if(_0x3359e8&&_0x3359e8['autoAssociation']===0x0){return db[_0xff23('0x2d')][_0xff23('0x50')]({'name':_0x4060ff[_0xff23('0x2f')],'resourceId':_0x4060ff['id'],'type':_0x3359e8[_0xff23('0x2f')],'sectionId':_0x3359e8['id']},{})[_0xff23('0x2a')](function(){return _0x4faebc;});}else{return _0x4faebc;}})[_0xff23('0x4a')](function(_0x12ffd7){logger[_0xff23('0x58')](_0xff23('0x59'),_0x12ffd7);throw _0x12ffd7;});}return _0x4faebc;})[_0xff23('0x2a')](respondWithResult(_0x3084b3,0xc9))[_0xff23('0x4a')](handleError(_0x3084b3,null));};exports[_0xff23('0x5a')]=function(_0x59a756,_0x10e161){if(_0x59a756[_0xff23('0x51')]['id']){delete _0x59a756['body']['id'];}return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0x59a756[_0xff23('0x4c')]['id']}})['then'](handleEntityNotFound(_0x10e161,null))[_0xff23('0x2a')](saveUpdates(_0x59a756[_0xff23('0x51')],null))[_0xff23('0x2a')](respondWithResult(_0x10e161,null))[_0xff23('0x4a')](handleError(_0x10e161,null));};exports['destroy']=function(_0x3d3287,_0x3ee859){return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0x3d3287[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x3ee859,null))['then'](removeEntity(_0x3ee859,null))['catch'](handleError(_0x3ee859,null));};exports[_0xff23('0x5b')]=function(_0x5540ab,_0xb98ef){return db[_0xff23('0x45')][_0xff23('0x5b')]()['then'](respondWithResult(_0xb98ef,null))['catch'](handleError(_0xb98ef,null));};exports[_0xff23('0x5c')]=function(_0x12a5f6,_0x23c54f,_0x3e7764){var _0x1592c7={'raw':!![],'where':{}},_0xb34f74={},_0x318860;return db['MailQueue']['findOne']({'where':{'id':_0x12a5f6[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x23c54f,null))[_0xff23('0x2a')](function(_0xb77f00){if(_0xb77f00){_0x318860=_0xb77f00['get']({'plain':!![]});_0xb34f74[_0xff23('0x33')]=_[_0xff23('0x34')](db[_0xff23('0x5d')][_0xff23('0x32')]);_0xb34f74[_0xff23('0x36')]=_[_0xff23('0x34')](_0x12a5f6[_0xff23('0x36')]);_0xb34f74['filters']=_[_0xff23('0x4d')](_0xb34f74[_0xff23('0x33')],_0xb34f74[_0xff23('0x36')]);_0x1592c7['attributes']=_[_0xff23('0x4d')](_0xb34f74[_0xff23('0x33')],qs[_0xff23('0x38')](_0x12a5f6['query'][_0xff23('0x38')]));_0x1592c7[_0xff23('0x37')]=_0x1592c7[_0xff23('0x37')][_0xff23('0x39')]?_0x1592c7[_0xff23('0x37')]:_0xb34f74[_0xff23('0x33')];if(!_0x12a5f6[_0xff23('0x36')][_0xff23('0x3a')]('nolimit')){_0x1592c7['limit']=qs['limit'](_0x12a5f6[_0xff23('0x36')]['limit']);_0x1592c7[_0xff23('0x24')]=qs[_0xff23('0x24')](_0x12a5f6['query'][_0xff23('0x24')]);}_0x1592c7[_0xff23('0x3b')]=qs[_0xff23('0x3c')](_0x12a5f6[_0xff23('0x36')][_0xff23('0x3c')]);_0x1592c7[_0xff23('0x3d')]=qs[_0xff23('0x35')](_[_0xff23('0x5e')](_0x12a5f6['query'],_0xb34f74['filters']));_0x1592c7[_0xff23('0x3d')][_0xff23('0x5f')]=_0xb77f00['id'];if(_0x12a5f6[_0xff23('0x36')][_0xff23('0x42')]){_0x1592c7['where']=_['merge'](_0x1592c7[_0xff23('0x3d')],{'$or':_['map'](_0x1592c7['attributes'],function(_0x39b640){var _0x4b05e5={};_0x4b05e5[_0x39b640]={'$like':'%'+_0x12a5f6[_0xff23('0x36')][_0xff23('0x42')]+'%'};return _0x4b05e5;})});}_0x1592c7=_[_0xff23('0x43')]({},_0x1592c7,_0x12a5f6['options']);return db[_0xff23('0x5d')][_0xff23('0x48')](_0x1592c7);}})[_0xff23('0x2a')](function(_0x36a085){if(_0x36a085){return db[_0xff23('0x60')][_0xff23('0x61')]({'where':{'id':_['map'](_0x36a085,_0xff23('0x62')),'role':_0xff23('0x63')},'attributes':['id',_0xff23('0x2f'),_0xff23('0x64'),_0xff23('0x65'),_0xff23('0x66')]});}})[_0xff23('0x2a')](function(_0x128f73){if(_0x128f73){return{'count':_0x128f73[_0xff23('0x46')],'rows':_[_0xff23('0x3e')](_0x128f73[_0xff23('0x49')],function(_0x51f9a1){return{'membername':_0x51f9a1[_0xff23('0x2f')],'UserId':_0x51f9a1['id'],'queue_name':_0x318860[_0xff23('0x2f')],'MailQueueId':_0x318860['id'],'interface':util[_0xff23('0x67')](_0xff23('0x68'),_0xff23('0x69'),_0x51f9a1['name']),'penalty':0x0,'paused':_0x51f9a1[_0xff23('0x64')],'createdAt':_0x51f9a1['createdAt'],'updatedAt':_0x51f9a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xff23('0x2a')](respondWithFilteredResult(_0x23c54f,_0x1592c7))[_0xff23('0x4a')](handleError(_0x23c54f,null));};exports[_0xff23('0x6a')]=function(_0x35aa18,_0x39f2df,_0x334b0f){var _0x541336={};var _0x2015c6={};var _0x1bc86f;var _0x3e8e48;return db['MailQueue'][_0xff23('0x6b')]({'where':{'id':_0x35aa18[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x39f2df,null))[_0xff23('0x2a')](function(_0x367cfa){if(_0x367cfa){_0x1bc86f=_0x367cfa;_0x2015c6[_0xff23('0x33')]=_[_0xff23('0x34')](db['Team'][_0xff23('0x32')]);_0x2015c6[_0xff23('0x36')]=_['keys'](_0x35aa18[_0xff23('0x36')]);_0x2015c6[_0xff23('0x35')]=_[_0xff23('0x4d')](_0x2015c6[_0xff23('0x33')],_0x2015c6[_0xff23('0x36')]);_0x541336['attributes']=_[_0xff23('0x4d')](_0x2015c6[_0xff23('0x33')],qs[_0xff23('0x38')](_0x35aa18[_0xff23('0x36')][_0xff23('0x38')]));_0x541336['attributes']=_0x541336[_0xff23('0x37')][_0xff23('0x39')]?_0x541336[_0xff23('0x37')]:_0x2015c6[_0xff23('0x33')];_0x541336[_0xff23('0x3b')]=qs[_0xff23('0x3c')](_0x35aa18[_0xff23('0x36')][_0xff23('0x3c')]);_0x541336[_0xff23('0x3d')]=qs[_0xff23('0x35')](_[_0xff23('0x5e')](_0x35aa18['query'],_0x2015c6[_0xff23('0x35')]));if(_0x35aa18[_0xff23('0x36')][_0xff23('0x42')]){_0x541336[_0xff23('0x3d')]=_[_0xff23('0x43')](_0x541336[_0xff23('0x3d')],{'$or':_[_0xff23('0x3e')](_0x541336['attributes'],function(_0x13e869){var _0x2096cc={};_0x2096cc[_0x13e869]={'$like':'%'+_0x35aa18[_0xff23('0x36')][_0xff23('0x42')]+'%'};return _0x2096cc;})});}_0x541336=_[_0xff23('0x43')]({},_0x541336,_0x35aa18[_0xff23('0x44')]);return _0x1bc86f[_0xff23('0x6a')](_0x541336);}})[_0xff23('0x2a')](function(_0x157eac){if(_0x157eac){_0x3e8e48=_0x157eac[_0xff23('0x39')];if(!_0x35aa18[_0xff23('0x36')][_0xff23('0x3a')](_0xff23('0x6c'))){_0x541336[_0xff23('0x25')]=qs['limit'](_0x35aa18[_0xff23('0x36')][_0xff23('0x25')]);_0x541336[_0xff23('0x24')]=qs[_0xff23('0x24')](_0x35aa18[_0xff23('0x36')]['offset']);}return _0x1bc86f[_0xff23('0x6a')](_0x541336);}})['then'](function(_0x44b38f){if(_0x44b38f){return _0x44b38f?{'count':_0x3e8e48,'rows':_0x44b38f}:null;}})[_0xff23('0x2a')](respondWithResult(_0x39f2df,null))[_0xff23('0x4a')](handleError(_0x39f2df,null));};exports['addTeams']=function(_0x5964fa,_0x3cc691,_0x1a06bd){var _0x4173bc=_0x5964fa[_0xff23('0x51')][_0xff23('0x6d')];return db[_0xff23('0x6e')]['findAll']({'where':{'id':_[_0xff23('0x3e')](_0x4173bc,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xff23('0x6f'),'attributes':['id',_0xff23('0x2f'),'online',_0xff23('0x70'),_0xff23('0x71')],'raw':!![]}]})[_0xff23('0x2a')](function(_0x66e571){if(_0x66e571){var _0x3f1700=_[_0xff23('0x72')](_0x66e571,function(_0x5c6ad9){var _0x46884d=_0x5c6ad9[_0xff23('0x2c')]({'plain':!![]});return _0x46884d[_0xff23('0x6f')];});return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0x5964fa[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](function(_0x3ddf33){return db['sequelize'][_0xff23('0x73')](function(_0x3388f9){return _0x3ddf33[_0xff23('0x74')](_[_0xff23('0x3e')](_0x4173bc,'id'),{'transaction':_0x3388f9})['then'](function(){return BPromise['each'](_0x3f1700,function(_0x9d068c){return db[_0xff23('0x5d')][_0xff23('0x75')]({'where':{'UserId':_0x9d068c['id'],'MailQueueId':_0x5964fa['params']['id']},'transaction':_0x3388f9});});})[_0xff23('0x2a')](function(){_0x3f1700[_0xff23('0x76')](function(_0x5801f4){socket['emit'](_0xff23('0x77'),{'UserId':_0x5801f4['id'],'MailQueueId':_0x3ddf33['id']});});});});});}})['then'](respondWithStatusCode(_0x3cc691,null))['catch'](handleError(_0x3cc691,null));};exports[_0xff23('0x78')]=function(_0x31338d,_0x562daa,_0x59194b){return db[_0xff23('0x6e')][_0xff23('0x48')]({'where':{'id':_0x31338d[_0xff23('0x36')][_0xff23('0x79')]},'attributes':['id'],'include':[{'model':db[_0xff23('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xff23('0x2a')](handleEntityNotFound(_0x562daa,null))['then'](function(_0x9864ea){var _0x275b20=_[_0xff23('0x3e')](_0x9864ea,'id');var _0x1dc605=[];var _0x1d5244=[];var _0x1f7581=squel['select']();_0x1f7581[_0xff23('0x41')](_0xff23('0x7a'))[_0xff23('0x7b')](_0xff23('0x7c'),'tq')[_0xff23('0x7d')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xff23('0x7e'),_0x31338d['params']['id']);for(var _0x414488=0x0;_0x414488<_0x9864ea[_0xff23('0x39')];_0x414488+=0x1){let _0x5e5983=_0x9864ea[_0x414488];for(var _0x4c1bf9=0x0;_0x4c1bf9<_0x5e5983[_0xff23('0x6f')][_0xff23('0x39')];_0x4c1bf9+=0x1){let _0x14313f=_0x5e5983[_0xff23('0x6f')][_0x4c1bf9];var _0x284e5a=_0x1f7581[_0xff23('0x7f')]();_0x284e5a[_0xff23('0x3d')](_0xff23('0x80'),_0x14313f['id']);_0x1d5244[_0xff23('0x81')](db[_0xff23('0x82')][_0xff23('0x36')](_0x284e5a[_0xff23('0x83')](),{'type':db[_0xff23('0x82')][_0xff23('0x84')][_0xff23('0x85')]})[_0xff23('0x2a')](function(_0x263469){if(_0x263469['length']===0x1){return _0x14313f['id'];}else{var _0x5ef088=_[_0xff23('0x86')](_[_0xff23('0x3e')](_0x263469,_0xff23('0x87')),function(_0x5df942){return _[_0xff23('0x88')](_0x275b20,_0x5df942);});if(_0x5ef088){return _0x14313f['id'];}}}));}}return BPromise[_0xff23('0x89')](_0x1d5244)['then'](function(_0x503f45){_0x1dc605=_(_0x1dc605)[_0xff23('0x8a')](_0x503f45)[_0xff23('0x8b')]()[_0xff23('0x8c')]();return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0x31338d[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](function(_0x4bd62a){return db['sequelize'][_0xff23('0x73')](function(_0x53bc5f){return _0x4bd62a[_0xff23('0x78')](_0x31338d[_0xff23('0x36')][_0xff23('0x79')],{'transaction':_0x53bc5f})['then'](function(){if(!_[_0xff23('0x8d')](_0x1dc605)){return _0x4bd62a[_0xff23('0x8e')](_0x1dc605,{'transaction':_0x53bc5f});}})['then'](function(){_0x1dc605['forEach'](function(_0x4b9e57){socket[_0xff23('0x8f')]('userMailQueue:remove',{'UserId':_0x4b9e57,'MailQueueId':_0x4bd62a['id']});});});});});});})['then'](respondWithStatusCode(_0x562daa,null))['catch'](handleError(_0x562daa,null));};exports[_0xff23('0x90')]=function(_0xce8aa2,_0x388ec7,_0x4af31a){return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0xce8aa2['params']['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x388ec7,null))['then'](function(_0x1bcc9d){if(_0x1bcc9d){return _0x1bcc9d[_0xff23('0x90')](_0xce8aa2[_0xff23('0x51')][_0xff23('0x79')],_[_0xff23('0x91')](_0xce8aa2[_0xff23('0x51')],['ids','id'])||{})[_0xff23('0x92')](function(_0xfd8e36){for(var _0x4f7593=0x0;_0x4f7593<_0xce8aa2[_0xff23('0x51')][_0xff23('0x79')][_0xff23('0x39')];_0x4f7593+=0x1){socket['emit'](_0xff23('0x77'),{'UserId':_0xce8aa2[_0xff23('0x51')][_0xff23('0x79')][_0x4f7593],'MailQueueId':_0xce8aa2['params']['id']});}return _0xfd8e36;});}})[_0xff23('0x2a')](respondWithResult(_0x388ec7,null))['catch'](handleError(_0x388ec7,null));};exports[_0xff23('0x8e')]=function(_0x3be451,_0x937612,_0xcb0635){return db[_0xff23('0x45')][_0xff23('0x4f')]({'where':{'id':_0x3be451[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x937612,null))[_0xff23('0x2a')](function(_0x38134f){if(_0x38134f){return _0x38134f['removeAgents'](_0x3be451[_0xff23('0x36')]['ids'])['then'](function(){if(_[_0xff23('0x93')](_0x3be451[_0xff23('0x36')][_0xff23('0x79')])){for(var _0x2455b0=0x0;_0x2455b0<_0x3be451[_0xff23('0x36')][_0xff23('0x79')][_0xff23('0x39')];_0x2455b0+=0x1){socket['emit'](_0xff23('0x94'),{'UserId':Number(_0x3be451['query'][_0xff23('0x79')][_0x2455b0]),'MailQueueId':Number(_0x3be451['params']['id'])});}}else{socket[_0xff23('0x8f')](_0xff23('0x94'),{'UserId':Number(_0x3be451['query'][_0xff23('0x79')]),'MailQueueId':Number(_0x3be451[_0xff23('0x4c')]['id'])});}});}})[_0xff23('0x2a')](respondWithStatusCode(_0x937612,null))['catch'](handleError(_0x937612,null));};exports['getAgents']=function(_0x3b1e12,_0x4a0c1c,_0x49cf55){var _0x345b65={};var _0x79018c={};var _0x2dc507;var _0x761958;return db[_0xff23('0x45')]['findOne']({'where':{'id':_0x3b1e12[_0xff23('0x4c')]['id']}})[_0xff23('0x2a')](handleEntityNotFound(_0x4a0c1c,null))[_0xff23('0x2a')](function(_0x528bd1){if(_0x528bd1){_0x2dc507=_0x528bd1;_0x79018c[_0xff23('0x33')]=_[_0xff23('0x34')](db[_0xff23('0x60')][_0xff23('0x32')]);_0x79018c[_0xff23('0x36')]=_[_0xff23('0x34')](_0x3b1e12[_0xff23('0x36')]);_0x79018c['filters']=_['intersection'](_0x79018c[_0xff23('0x33')],_0x79018c[_0xff23('0x36')]);_0x345b65[_0xff23('0x37')]=_[_0xff23('0x4d')](_0x79018c[_0xff23('0x33')],qs[_0xff23('0x38')](_0x3b1e12[_0xff23('0x36')][_0xff23('0x38')]));_0x345b65[_0xff23('0x37')]=_0x345b65['attributes']['length']?_0x345b65[_0xff23('0x37')]:_0x79018c[_0xff23('0x33')];_0x345b65[_0xff23('0x3b')]=qs[_0xff23('0x3c')](_0x3b1e12[_0xff23('0x36')][_0xff23('0x3c')]);_0x345b65[_0xff23('0x3d')]=qs[_0xff23('0x35')](_['pick'](_0x3b1e12[_0xff23('0x36')],_0x79018c[_0xff23('0x35')]));if(_0x3b1e12[_0xff23('0x36')][_0xff23('0x42')]){_0x345b65[_0xff23('0x3d')]=_['merge'](_0x345b65[_0xff23('0x3d')],{'$or':_[_0xff23('0x3e')](_0x345b65[_0xff23('0x37')],function(_0x30ab5e){var _0x533584={};_0x533584[_0x30ab5e]={'$like':'%'+_0x3b1e12[_0xff23('0x36')]['filter']+'%'};return _0x533584;})});}_0x345b65=_[_0xff23('0x43')]({},_0x345b65,_0x3b1e12[_0xff23('0x44')]);return _0x2dc507[_0xff23('0x95')](_0x345b65);}})['then'](function(_0x2c14eb){if(_0x2c14eb){_0x761958=_0x2c14eb[_0xff23('0x39')];if(!_0x3b1e12[_0xff23('0x36')][_0xff23('0x3a')](_0xff23('0x6c'))){_0x345b65[_0xff23('0x25')]=qs[_0xff23('0x25')](_0x3b1e12[_0xff23('0x36')][_0xff23('0x25')]);_0x345b65['offset']=qs[_0xff23('0x24')](_0x3b1e12[_0xff23('0x36')][_0xff23('0x24')]);}return _0x2dc507[_0xff23('0x95')](_0x345b65);}})[_0xff23('0x2a')](function(_0x37225a){if(_0x37225a){return _0x37225a?{'count':_0x761958,'rows':_0x37225a}:null;}})[_0xff23('0x2a')](respondWithResult(_0x4a0c1c,null))['catch'](handleError(_0x4a0c1c,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 43a3a37..ef3d375 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 _0x5b35=['exports','events','../../mysqldb','MailQueue','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x1551e8,_0x4f8ac5){var _0x31ddef=function(_0x31a147){while(--_0x31a147){_0x1551e8['push'](_0x1551e8['shift']());}};_0x31ddef(++_0x4f8ac5);}(_0x5b35,0x1c3));var _0x55b3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5b35[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x55b3('0x0'));var MailQueue=require(_0x55b3('0x1'))['db'][_0x55b3('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x55b3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x55b3('0x4'),'afterDestroy':_0x55b3('0x5')};function emitEvent(_0x20b30d){return function(_0x1e750c,_0x45d936,_0x1c65e7){MailQueueEvents['emit'](_0x20b30d+':'+_0x1e750c['id'],_0x1e750c);MailQueueEvents['emit'](_0x20b30d,_0x1e750c);_0x1c65e7(null);};}for(var e in events){if(events[_0x55b3('0x6')](e)){var event=events[e];MailQueue[_0x55b3('0x7')](e,emitEvent(event));}}module[_0x55b3('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x3e9d=['MailQueue','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3e9d,0x1b7));var _0xd3e9=function(_0x14ba6d,_0x274a32){_0x14ba6d=_0x14ba6d-0x0;var _0x52ba45=_0x3e9d[_0x14ba6d];return _0x52ba45;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd3e9('0x0'))['db'][_0xd3e9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3e9('0x2'),'afterUpdate':_0xd3e9('0x3'),'afterDestroy':_0xd3e9('0x4')};function emitEvent(_0xee19c2){return function(_0x19fc85,_0x593d11,_0x3f965d){MailQueueEvents[_0xd3e9('0x5')](_0xee19c2+':'+_0x19fc85['id'],_0x19fc85);MailQueueEvents['emit'](_0xee19c2,_0x19fc85);_0x3f965d(null);};}for(var e in events){if(events[_0xd3e9('0x6')](e)){var event=events[e];MailQueue[_0xd3e9('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 47026fb..e785086 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 _0xa9e0=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x22cc3b,_0x48742b){var _0x313469=function(_0x398579){while(--_0x398579){_0x22cc3b['push'](_0x22cc3b['shift']());}};_0x313469(++_0x48742b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x4b7124,_0x206b7b){var _0x23e16d=function(_0x2cd68e){while(--_0x2cd68e){_0x4b7124['push'](_0x4b7124['shift']());}};_0x23e16d(++_0x206b7b);}(_0x70e0,0x17b));var _0x070e=function(_0x27d597,_0x2d3576){_0x27d597=_0x27d597-0x0;var _0x5c2d23=_0x70e0[_0x27d597];return _0x5c2d23;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('MailQueue',attributes,{'tableName':_0x070e('0x8'),'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 aee1c1a..c47e52a 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 _0x0fab=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','./mailQueue.socket','register','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','lodash','util','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0fab,0x1ea));var _0xb0fa=function(_0x2c7893,_0x2ab158){_0x2c7893=_0x2c7893-0x0;var _0x436d78=_0x0fab[_0x2c7893];return _0x436d78;};'use strict';var _=require(_0xb0fa('0x0'));var util=require(_0xb0fa('0x1'));var moment=require(_0xb0fa('0x2'));var BPromise=require(_0xb0fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0fa('0x4'));var db=require(_0xb0fa('0x5'))['db'];var utils=require(_0xb0fa('0x6'));var logger=require(_0xb0fa('0x7'))(_0xb0fa('0x8'));var config=require('../../config/environment');var jayson=require(_0xb0fa('0x9'));var client=jayson[_0xb0fa('0xa')]['http']({'port':0x232a});config[_0xb0fa('0xb')]=_[_0xb0fa('0xc')](config[_0xb0fa('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb0fa('0xd'))[_0xb0fa('0xe')](socket);function respondWithRpcPromise(_0x4f0bcc,_0x4c435a,_0x450f91){return new BPromise(function(_0x495f74,_0x4b078a){return client['request'](_0x4f0bcc,_0x450f91)[_0xb0fa('0xf')](function(_0x5cf3b0){logger[_0xb0fa('0x10')]('MailQueue,\x20%s,\x20%s',_0x4c435a,_0xb0fa('0x11'));logger[_0xb0fa('0x12')](_0xb0fa('0x13'),_0x4c435a,_0xb0fa('0x11'),JSON[_0xb0fa('0x14')](_0x5cf3b0));if(_0x5cf3b0[_0xb0fa('0x15')]){if(_0x5cf3b0[_0xb0fa('0x15')][_0xb0fa('0x16')]===0x1f4){logger['error'](_0xb0fa('0x17'),_0x4c435a,_0x5cf3b0[_0xb0fa('0x15')][_0xb0fa('0x18')]);return _0x4b078a(_0x5cf3b0[_0xb0fa('0x15')][_0xb0fa('0x18')]);}logger[_0xb0fa('0x15')](_0xb0fa('0x17'),_0x4c435a,_0x5cf3b0['error']['message']);return _0x495f74(_0x5cf3b0[_0xb0fa('0x15')][_0xb0fa('0x18')]);}else{logger['info'](_0xb0fa('0x17'),_0x4c435a,_0xb0fa('0x11'));_0x495f74(_0x5cf3b0['result']['message']);}})[_0xb0fa('0x19')](function(_0x567062){logger[_0xb0fa('0x15')](_0xb0fa('0x17'),_0x4c435a,_0x567062);_0x4b078a(_0x567062);});});}exports[_0xb0fa('0x1a')]=function(_0x4670e8){var _0x47f290=this;return new Promise(function(_0x4b5263,_0x5de9c1){return db[_0xb0fa('0x1b')][_0xb0fa('0x1c')]({'raw':_0x4670e8[_0xb0fa('0x1d')]?_0x4670e8['options'][_0xb0fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4670e8['options']?_0x4670e8[_0xb0fa('0x1d')][_0xb0fa('0x1f')]||null:null,'attributes':_0x4670e8[_0xb0fa('0x1d')]?_0x4670e8[_0xb0fa('0x1d')][_0xb0fa('0x20')]||null:null,'limit':_0x4670e8[_0xb0fa('0x1d')]?_0x4670e8[_0xb0fa('0x1d')][_0xb0fa('0x21')]||null:null,'include':_0x4670e8['options']?_0x4670e8[_0xb0fa('0x1d')][_0xb0fa('0x22')]?_['map'](_0x4670e8[_0xb0fa('0x1d')][_0xb0fa('0x22')],function(_0x33de60){return{'model':db[_0x33de60[_0xb0fa('0x23')]],'as':_0x33de60['as'],'attributes':_0x33de60['attributes'],'include':_0x33de60['include']?_['map'](_0x33de60[_0xb0fa('0x22')],function(_0x4f3b5f){return{'model':db[_0x4f3b5f[_0xb0fa('0x23')]],'as':_0x4f3b5f['as'],'attributes':_0x4f3b5f['attributes'],'include':_0x4f3b5f[_0xb0fa('0x22')]?_[_0xb0fa('0x24')](_0x4f3b5f[_0xb0fa('0x22')],function(_0x5938b8){return{'model':db[_0x5938b8['model']],'as':_0x5938b8['as'],'attributes':_0x5938b8[_0xb0fa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb0fa('0xf')](function(_0x324cd8){logger[_0xb0fa('0x10')](_0xb0fa('0x1a'),_0x4670e8);logger[_0xb0fa('0x12')](_0xb0fa('0x1a'),_0x4670e8,JSON['stringify'](_0x324cd8));_0x4b5263(_0x324cd8);})[_0xb0fa('0x19')](function(_0x935a8d){logger[_0xb0fa('0x15')](_0xb0fa('0x1a'),_0x935a8d['message'],_0x4670e8);_0x5de9c1(_0x47f290['error'](0x1f4,_0x935a8d[_0xb0fa('0x18')]));});});};exports[_0xb0fa('0x25')]=function(_0x503076){var _0x24488d=this;return new Promise(function(_0x5936e5,_0x162321){return db['MailQueue']['find']({'raw':_0x503076[_0xb0fa('0x1d')]?_0x503076[_0xb0fa('0x1d')][_0xb0fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x503076[_0xb0fa('0x1d')]?_0x503076['options'][_0xb0fa('0x1f')]||null:null,'attributes':_0x503076[_0xb0fa('0x1d')]?_0x503076[_0xb0fa('0x1d')][_0xb0fa('0x20')]||null:null,'include':_0x503076['options']?_0x503076[_0xb0fa('0x1d')][_0xb0fa('0x22')]?_[_0xb0fa('0x24')](_0x503076[_0xb0fa('0x1d')][_0xb0fa('0x22')],function(_0x79ae53){return{'model':db[_0x79ae53[_0xb0fa('0x23')]],'as':_0x79ae53['as'],'attributes':_0x79ae53[_0xb0fa('0x20')],'include':_0x79ae53[_0xb0fa('0x22')]?_[_0xb0fa('0x24')](_0x79ae53[_0xb0fa('0x22')],function(_0x583525){return{'model':db[_0x583525['model']],'as':_0x583525['as'],'attributes':_0x583525[_0xb0fa('0x20')],'include':_0x583525['include']?_[_0xb0fa('0x24')](_0x583525[_0xb0fa('0x22')],function(_0x12d985){return{'model':db[_0x12d985[_0xb0fa('0x23')]],'as':_0x12d985['as'],'attributes':_0x12d985[_0xb0fa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb0fa('0xf')](function(_0x24b2c9){logger[_0xb0fa('0x10')]('ShowMailQueue',_0x503076);logger['debug'](_0xb0fa('0x25'),_0x503076,JSON[_0xb0fa('0x14')](_0x24b2c9));_0x5936e5(_0x24b2c9);})['catch'](function(_0x483583){logger[_0xb0fa('0x15')](_0xb0fa('0x25'),_0x483583['message'],_0x503076);_0x162321(_0x24488d[_0xb0fa('0x15')](0x1f4,_0x483583[_0xb0fa('0x18')]));});});}; \ No newline at end of file +var _0xe982=['debug','stringify','error','code','message','result','catch','GetMailQueue','options','raw','where','attributes','include','map','model','info','ShowMailQueue','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4e4a66,_0x4e58f6){var _0x5ec24e=function(_0x4485f4){while(--_0x4485f4){_0x4e4a66['push'](_0x4e4a66['shift']());}};_0x5ec24e(++_0x4e58f6);}(_0xe982,0x1b4));var _0x2e98=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe982[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2e98('0x0'));var util=require(_0x2e98('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e98('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e98('0x3'))['db'];var utils=require(_0x2e98('0x4'));var logger=require(_0x2e98('0x5'))(_0x2e98('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e98('0x7'));var client=jayson[_0x2e98('0x8')][_0x2e98('0x9')]({'port':0x232a});config[_0x2e98('0xa')]=_[_0x2e98('0xb')](config['redis'],{'host':_0x2e98('0xc'),'port':0x18eb});var socket=require(_0x2e98('0xd'))(new Redis(config['redis']));require(_0x2e98('0xe'))[_0x2e98('0xf')](socket);function respondWithRpcPromise(_0x14c222,_0x232705,_0x528289){return new BPromise(function(_0x4e4796,_0x4008c4){return client[_0x2e98('0x10')](_0x14c222,_0x528289)[_0x2e98('0x11')](function(_0x538b8a){logger['info'](_0x2e98('0x12'),_0x232705,_0x2e98('0x13'));logger[_0x2e98('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x232705,_0x2e98('0x13'),JSON[_0x2e98('0x15')](_0x538b8a));if(_0x538b8a[_0x2e98('0x16')]){if(_0x538b8a[_0x2e98('0x16')][_0x2e98('0x17')]===0x1f4){logger[_0x2e98('0x16')]('MailQueue,\x20%s,\x20%s',_0x232705,_0x538b8a[_0x2e98('0x16')][_0x2e98('0x18')]);return _0x4008c4(_0x538b8a[_0x2e98('0x16')][_0x2e98('0x18')]);}logger[_0x2e98('0x16')](_0x2e98('0x12'),_0x232705,_0x538b8a[_0x2e98('0x16')]['message']);return _0x4e4796(_0x538b8a[_0x2e98('0x16')][_0x2e98('0x18')]);}else{logger['info'](_0x2e98('0x12'),_0x232705,'request\x20sent');_0x4e4796(_0x538b8a[_0x2e98('0x19')][_0x2e98('0x18')]);}})[_0x2e98('0x1a')](function(_0x49eb5b){logger['error'](_0x2e98('0x12'),_0x232705,_0x49eb5b);_0x4008c4(_0x49eb5b);});});}exports[_0x2e98('0x1b')]=function(_0x208368){var _0x4adb61=this;return new Promise(function(_0x243bb3,_0x3b6012){return db['MailQueue']['findAll']({'raw':_0x208368[_0x2e98('0x1c')]?_0x208368[_0x2e98('0x1c')][_0x2e98('0x1d')]===undefined?!![]:![]:!![],'where':_0x208368[_0x2e98('0x1c')]?_0x208368[_0x2e98('0x1c')][_0x2e98('0x1e')]||null:null,'attributes':_0x208368[_0x2e98('0x1c')]?_0x208368[_0x2e98('0x1c')][_0x2e98('0x1f')]||null:null,'limit':_0x208368[_0x2e98('0x1c')]?_0x208368[_0x2e98('0x1c')]['limit']||null:null,'include':_0x208368['options']?_0x208368[_0x2e98('0x1c')][_0x2e98('0x20')]?_[_0x2e98('0x21')](_0x208368[_0x2e98('0x1c')][_0x2e98('0x20')],function(_0x391f9c){return{'model':db[_0x391f9c[_0x2e98('0x22')]],'as':_0x391f9c['as'],'attributes':_0x391f9c[_0x2e98('0x1f')],'include':_0x391f9c[_0x2e98('0x20')]?_[_0x2e98('0x21')](_0x391f9c[_0x2e98('0x20')],function(_0x3edc67){return{'model':db[_0x3edc67[_0x2e98('0x22')]],'as':_0x3edc67['as'],'attributes':_0x3edc67[_0x2e98('0x1f')],'include':_0x3edc67[_0x2e98('0x20')]?_[_0x2e98('0x21')](_0x3edc67['include'],function(_0x39f563){return{'model':db[_0x39f563[_0x2e98('0x22')]],'as':_0x39f563['as'],'attributes':_0x39f563[_0x2e98('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b57bc){logger[_0x2e98('0x23')](_0x2e98('0x1b'),_0x208368);logger['debug']('GetMailQueue',_0x208368,JSON[_0x2e98('0x15')](_0x2b57bc));_0x243bb3(_0x2b57bc);})[_0x2e98('0x1a')](function(_0x546765){logger['error'](_0x2e98('0x1b'),_0x546765[_0x2e98('0x18')],_0x208368);_0x3b6012(_0x4adb61[_0x2e98('0x16')](0x1f4,_0x546765['message']));});});};exports[_0x2e98('0x24')]=function(_0x3b6fe7){var _0x42c748=this;return new Promise(function(_0x2b38ab,_0x2f6170){return db['MailQueue'][_0x2e98('0x25')]({'raw':_0x3b6fe7['options']?_0x3b6fe7[_0x2e98('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b6fe7[_0x2e98('0x1c')]?_0x3b6fe7['options'][_0x2e98('0x1e')]||null:null,'attributes':_0x3b6fe7['options']?_0x3b6fe7['options'][_0x2e98('0x1f')]||null:null,'include':_0x3b6fe7[_0x2e98('0x1c')]?_0x3b6fe7[_0x2e98('0x1c')]['include']?_[_0x2e98('0x21')](_0x3b6fe7[_0x2e98('0x1c')][_0x2e98('0x20')],function(_0x1809cd){return{'model':db[_0x1809cd[_0x2e98('0x22')]],'as':_0x1809cd['as'],'attributes':_0x1809cd[_0x2e98('0x1f')],'include':_0x1809cd[_0x2e98('0x20')]?_['map'](_0x1809cd[_0x2e98('0x20')],function(_0x446dbd){return{'model':db[_0x446dbd[_0x2e98('0x22')]],'as':_0x446dbd['as'],'attributes':_0x446dbd[_0x2e98('0x1f')],'include':_0x446dbd[_0x2e98('0x20')]?_[_0x2e98('0x21')](_0x446dbd[_0x2e98('0x20')],function(_0x59e9a2){return{'model':db[_0x59e9a2[_0x2e98('0x22')]],'as':_0x59e9a2['as'],'attributes':_0x59e9a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x2e98('0x11')](function(_0x840b96){logger['info']('ShowMailQueue',_0x3b6fe7);logger[_0x2e98('0x14')](_0x2e98('0x24'),_0x3b6fe7,JSON[_0x2e98('0x15')](_0x840b96));_0x2b38ab(_0x840b96);})['catch'](function(_0x306055){logger[_0x2e98('0x16')](_0x2e98('0x24'),_0x306055[_0x2e98('0x18')],_0x3b6fe7);_0x2f6170(_0x42c748[_0x2e98('0x16')](0x1f4,_0x306055['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 6c30090..a334ccf 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 _0x7ef2=['./mailQueue.events','save','update','emit','removeListener','register','length','mailQueue:'];(function(_0x221af7,_0x2b4656){var _0x1b38b1=function(_0xa05079){while(--_0xa05079){_0x221af7['push'](_0x221af7['shift']());}};_0x1b38b1(++_0x2b4656);}(_0x7ef2,0x198));var _0x27ef=function(_0x960449,_0x2965d7){_0x960449=_0x960449-0x0;var _0x50631b=_0x7ef2[_0x960449];return _0x50631b;};'use strict';var MailQueueEvents=require(_0x27ef('0x0'));var events=[_0x27ef('0x1'),'remove',_0x27ef('0x2')];function createListener(_0x1e1a98,_0x40fa35){return function(_0x2482aa){_0x40fa35[_0x27ef('0x3')](_0x1e1a98,_0x2482aa);};}function removeListener(_0x1a3f01,_0x35d498){return function(){MailQueueEvents[_0x27ef('0x4')](_0x1a3f01,_0x35d498);};}exports[_0x27ef('0x5')]=function(_0x3dda19){for(var _0x91abc3=0x0,_0x3f4e76=events[_0x27ef('0x6')];_0x91abc3<_0x3f4e76;_0x91abc3++){var _0x3609a9=events[_0x91abc3];var _0x78e47b=createListener(_0x27ef('0x7')+_0x3609a9,_0x3dda19);MailQueueEvents['on'](_0x3609a9,_0x78e47b);}}; \ No newline at end of file +var _0xdbeb=['remove','emit','removeListener','register','mailQueue:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbeb,0x6b));var _0xbdbe=function(_0x139e28,_0x1ce9a4){_0x139e28=_0x139e28-0x0;var _0x5436a6=_0xdbeb[_0x139e28];return _0x5436a6;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xbdbe('0x0'),_0xbdbe('0x1'),'update'];function createListener(_0x403c3d,_0x4c08c6){return function(_0x29632a){_0x4c08c6[_0xbdbe('0x2')](_0x403c3d,_0x29632a);};}function removeListener(_0xc8eb82,_0x6cb9b0){return function(){MailQueueEvents[_0xbdbe('0x3')](_0xc8eb82,_0x6cb9b0);};}exports[_0xbdbe('0x4')]=function(_0x5595c9){for(var _0x5145c2=0x0,_0x4a5dba=events['length'];_0x5145c2<_0x4a5dba;_0x5145c2++){var _0x3e314d=events[_0x5145c2];var _0x39f2a6=createListener(_0xbdbe('0x5')+_0x3e314d,_0x5595c9);MailQueueEvents['on'](_0x3e314d,_0x39f2a6);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 1a19cc0..67e01a9 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 _0xa22e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x3e141f,_0x396a47){var _0x3426d5=function(_0x5551bf){while(--_0x5551bf){_0x3e141f['push'](_0x3e141f['shift']());}};_0x3426d5(++_0x396a47);}(_0xa22e,0x1f0));var _0xea22=function(_0x925bad,_0x4f899b){_0x925bad=_0x925bad-0x0;var _0x47535c=_0xa22e[_0x925bad];return _0x47535c;};'use strict';var multer=require(_0xea22('0x0'));var util=require('util');var path=require(_0xea22('0x1'));var timeout=require(_0xea22('0x2'));var express=require('express');var router=express[_0xea22('0x3')]();var auth=require(_0xea22('0x4'));var interaction=require(_0xea22('0x5'));var config=require(_0xea22('0x6'));var controller=require(_0xea22('0x7'));router[_0xea22('0x8')]('/',auth[_0xea22('0x9')](),controller[_0xea22('0xa')]);router[_0xea22('0x8')](_0xea22('0xb'),auth[_0xea22('0x9')](),controller[_0xea22('0xc')]);router['get'](_0xea22('0xd'),auth[_0xea22('0x9')](),controller['show']);router[_0xea22('0xe')]('/',auth['isAuthenticated'](),controller[_0xea22('0xf')]);router[_0xea22('0x10')]('/:id',auth[_0xea22('0x9')](),controller[_0xea22('0x11')]);router[_0xea22('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xea22('0x13')]=router; \ No newline at end of file +var _0x3ce7=['put','update','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','describe','/:id','isAuthenticated','post','create'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x3ce7,0x81));var _0x73ce=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0x3ce7[_0x50fda9];return _0x36b92b;};'use strict';var multer=require(_0x73ce('0x0'));var util=require('util');var path=require(_0x73ce('0x1'));var timeout=require('connect-timeout');var express=require(_0x73ce('0x2'));var router=express[_0x73ce('0x3')]();var auth=require(_0x73ce('0x4'));var interaction=require(_0x73ce('0x5'));var config=require(_0x73ce('0x6'));var controller=require(_0x73ce('0x7'));router[_0x73ce('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x73ce('0x8')](_0x73ce('0x9'),auth['isAuthenticated'](),controller[_0x73ce('0xa')]);router[_0x73ce('0x8')](_0x73ce('0xb'),auth[_0x73ce('0xc')](),controller['show']);router[_0x73ce('0xd')]('/',auth[_0x73ce('0xc')](),controller[_0x73ce('0xe')]);router[_0x73ce('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x73ce('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x73ce('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 466e058..669077f 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 _0xa88d=['DATE','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa88d,0x133));var _0xda88=function(_0x360158,_0x18f1a0){_0x360158=_0x360158-0x0;var _0x2cda1d=_0xa88d[_0x360158];return _0x2cda1d;};'use strict';var moment=require(_0xda88('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xda88('0x1')]},'leaveAt':{'type':Sequelize[_0xda88('0x1')]},'acceptAt':{'type':Sequelize[_0xda88('0x1')]},'exitAt':{'type':Sequelize[_0xda88('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2ee0=['STRING','DATE','moment','sequelize','exports'];(function(_0x338019,_0x527b6a){var _0x9372d5=function(_0x276f88){while(--_0x276f88){_0x338019['push'](_0x338019['shift']());}};_0x9372d5(++_0x527b6a);}(_0x2ee0,0x147));var _0x02ee=function(_0x394571,_0x48d0d0){_0x394571=_0x394571-0x0;var _0x3b0f9b=_0x2ee0[_0x394571];return _0x3b0f9b;};'use strict';var moment=require(_0x02ee('0x0'));var Sequelize=require(_0x02ee('0x1'));module[_0x02ee('0x2')]={'uniqueid':{'type':Sequelize[_0x02ee('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x02ee('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x02ee('0x4')]},'exitAt':{'type':Sequelize[_0x02ee('0x4')]},'reason':{'type':Sequelize[_0x02ee('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3bb48a3..ddc8de1 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 _0x322d=['show','params','includeAll','find','catch','create','update','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','Content-Range','apply','save','then','destroy','stack','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map','key','filter','options','MailQueueReport','count','findAll','rows'];(function(_0x175e61,_0x3f505b){var _0x54c24c=function(_0x39c027){while(--_0x39c027){_0x175e61['push'](_0x175e61['shift']());}};_0x54c24c(++_0x3f505b);}(_0x322d,0x121));var _0xd322=function(_0xaadc70,_0x2c050d){_0xaadc70=_0xaadc70-0x0;var _0x3ac647=_0x322d[_0xaadc70];return _0x3ac647;};'use strict';var pdf=require(_0xd322('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd322('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd322('0x2'));var rp=require(_0xd322('0x3'));var moment=require(_0xd322('0x4'));var BPromise=require(_0xd322('0x5'));var Mustache=require(_0xd322('0x6'));var util=require(_0xd322('0x7'));var path=require(_0xd322('0x8'));var sox=require(_0xd322('0x9'));var csv=require('to-csv');var ejs=require(_0xd322('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd322('0xb'));var crypto=require(_0xd322('0xc'));var jsforce=require(_0xd322('0xd'));var deskjs=require(_0xd322('0xe'));var toCsv=require(_0xd322('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd322('0x10'));var authService=require(_0xd322('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd322('0x12'))('api');var utils=require(_0xd322('0x13'));var config=require(_0xd322('0x14'));var db=require(_0xd322('0x15'))['db'];function respondWithStatusCode(_0x49ea4f,_0x59138b){_0x59138b=_0x59138b||0xcc;return function(_0x17a507){if(_0x17a507){return _0x49ea4f[_0xd322('0x16')](_0x59138b);}return _0x49ea4f['status'](_0x59138b)[_0xd322('0x17')]();};}function respondWithResult(_0x5d10c0,_0x3883b3){_0x3883b3=_0x3883b3||0xc8;return function(_0x111066){if(_0x111066){return _0x5d10c0['status'](_0x3883b3)[_0xd322('0x18')](_0x111066);}};}function respondWithFilteredResult(_0x318331,_0x429309){return function(_0x125976){if(_0x125976){var _0x2c2887=_0x125976['count'],_0x1ac2fd=_0x429309[_0xd322('0x19')],_0x31d801=_0x429309[_0xd322('0x19')]+_0x429309['limit'],_0x8f698f;if(_0x31d801>=_0x2c2887){_0x31d801=_0x2c2887;_0x8f698f=0xc8;}else{_0x8f698f=0xce;}_0x318331[_0xd322('0x1a')](_0x8f698f);return _0x318331[_0xd322('0x1b')](_0xd322('0x1c'),_0x1ac2fd+'-'+_0x31d801+'/'+_0x2c2887)[_0xd322('0x18')](_0x125976);}return null;};}function patchUpdates(_0x8caffe){return function(_0x27e83e){try{jsonpatch[_0xd322('0x1d')](_0x27e83e,_0x8caffe,!![]);}catch(_0x4583eb){return BPromise['reject'](_0x4583eb);}return _0x27e83e[_0xd322('0x1e')]();};}function saveUpdates(_0x4bb44c,_0x409970){return function(_0x188d42){if(_0x188d42){return _0x188d42['update'](_0x4bb44c)[_0xd322('0x1f')](function(_0x4d6e97){return _0x4d6e97;});}return null;};}function removeEntity(_0x233df4,_0x2fd85f){return function(_0x1360d0){if(_0x1360d0){return _0x1360d0[_0xd322('0x20')]()[_0xd322('0x1f')](function(){_0x233df4[_0xd322('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x109b3c,_0x552df0){return function(_0x57b153){if(!_0x57b153){_0x109b3c[_0xd322('0x16')](0x194);}return _0x57b153;};}function handleError(_0x4e0eea,_0x5f0ca1){_0x5f0ca1=_0x5f0ca1||0x1f4;return function(_0x175ee6){logger['error'](_0x175ee6[_0xd322('0x21')]);if(_0x175ee6[_0xd322('0x22')]){delete _0x175ee6[_0xd322('0x22')];}_0x4e0eea['status'](_0x5f0ca1)[_0xd322('0x23')](_0x175ee6);};}exports[_0xd322('0x24')]=function(_0x43418e,_0x31c3a3){var _0x3fe468={},_0x46f43d={},_0x38462f={'count':0x0,'rows':[]};var _0x10da35=db['MailQueueReport']['rawAttributes'];_0x46f43d[_0xd322('0x25')]=_[_0xd322('0x26')](_0x10da35);_0x46f43d['query']=_['keys'](_0x43418e[_0xd322('0x27')]);_0x46f43d['filters']=_[_0xd322('0x28')](_0x46f43d['model'],_0x46f43d[_0xd322('0x27')]);_0x3fe468[_0xd322('0x29')]=_[_0xd322('0x28')](_0x46f43d[_0xd322('0x25')],qs[_0xd322('0x2a')](_0x43418e[_0xd322('0x27')][_0xd322('0x2a')]));_0x3fe468[_0xd322('0x29')]=_0x3fe468[_0xd322('0x29')][_0xd322('0x2b')]?_0x3fe468[_0xd322('0x29')]:_0x46f43d['model'];if(!_0x43418e['query'][_0xd322('0x2c')](_0xd322('0x2d'))){_0x3fe468['limit']=qs[_0xd322('0x2e')](_0x43418e[_0xd322('0x27')][_0xd322('0x2e')]);_0x3fe468['offset']=qs[_0xd322('0x19')](_0x43418e['query'][_0xd322('0x19')]);}_0x3fe468[_0xd322('0x2f')]=qs[_0xd322('0x30')](_0x43418e[_0xd322('0x27')][_0xd322('0x30')]);_0x3fe468[_0xd322('0x31')]=qs[_0xd322('0x32')](_[_0xd322('0x33')](_0x43418e[_0xd322('0x27')],_0x46f43d[_0xd322('0x32')]));if(_0x43418e['query']['filter']){_0x3fe468[_0xd322('0x31')]=_[_0xd322('0x34')](_0x3fe468[_0xd322('0x31')],{'$or':_[_0xd322('0x35')](_0x10da35,function(_0x25099d){if(_0x25099d['type'][_0xd322('0x36')]!=='VIRTUAL'){var _0x35192c={};_0x35192c[_0x25099d['field']]={'$like':'%'+_0x43418e[_0xd322('0x27')][_0xd322('0x37')]+'%'};return _0x35192c;}})});}_0x3fe468=_[_0xd322('0x34')]({},_0x3fe468,_0x43418e[_0xd322('0x38')]);var _0xdf7e3={'where':_0x3fe468[_0xd322('0x31')]};return db[_0xd322('0x39')][_0xd322('0x3a')](_0xdf7e3)['then'](function(_0x831ea5){_0x38462f[_0xd322('0x3a')]=_0x831ea5;if(_0x43418e[_0xd322('0x27')]['includeAll']){_0x3fe468['include']=[{'all':!![]}];}return db[_0xd322('0x39')][_0xd322('0x3b')](_0x3fe468);})[_0xd322('0x1f')](function(_0x443534){_0x38462f[_0xd322('0x3c')]=_0x443534;return _0x38462f;})['then'](respondWithFilteredResult(_0x31c3a3,_0x3fe468))['catch'](handleError(_0x31c3a3,null));};exports[_0xd322('0x3d')]=function(_0x283938,_0x10b03b){var _0x10c7c={'raw':!![],'where':{'id':_0x283938[_0xd322('0x3e')]['id']}},_0x2077a7={};_0x2077a7['model']=_[_0xd322('0x26')](db[_0xd322('0x39')]['rawAttributes']);_0x2077a7[_0xd322('0x27')]=_[_0xd322('0x26')](_0x283938[_0xd322('0x27')]);_0x2077a7[_0xd322('0x32')]=_[_0xd322('0x28')](_0x2077a7['model'],_0x2077a7[_0xd322('0x27')]);_0x10c7c[_0xd322('0x29')]=_[_0xd322('0x28')](_0x2077a7[_0xd322('0x25')],qs[_0xd322('0x2a')](_0x283938['query'][_0xd322('0x2a')]));_0x10c7c[_0xd322('0x29')]=_0x10c7c[_0xd322('0x29')]['length']?_0x10c7c[_0xd322('0x29')]:_0x2077a7['model'];if(_0x283938[_0xd322('0x27')][_0xd322('0x3f')]){_0x10c7c['include']=[{'all':!![]}];}_0x10c7c=_[_0xd322('0x34')]({},_0x10c7c,_0x283938[_0xd322('0x38')]);return db[_0xd322('0x39')][_0xd322('0x40')](_0x10c7c)[_0xd322('0x1f')](handleEntityNotFound(_0x10b03b,null))[_0xd322('0x1f')](respondWithResult(_0x10b03b,null))[_0xd322('0x41')](handleError(_0x10b03b,null));};exports['create']=function(_0x17bc1e,_0xbe58db){return db['MailQueueReport'][_0xd322('0x42')](_0x17bc1e['body'],{})[_0xd322('0x1f')](respondWithResult(_0xbe58db,0xc9))[_0xd322('0x41')](handleError(_0xbe58db,null));};exports[_0xd322('0x43')]=function(_0x500253,_0x2a0cc1){if(_0x500253['body']['id']){delete _0x500253[_0xd322('0x44')]['id'];}return db[_0xd322('0x39')][_0xd322('0x40')]({'where':{'id':_0x500253[_0xd322('0x3e')]['id']}})[_0xd322('0x1f')](handleEntityNotFound(_0x2a0cc1,null))[_0xd322('0x1f')](saveUpdates(_0x500253[_0xd322('0x44')],null))[_0xd322('0x1f')](respondWithResult(_0x2a0cc1,null))['catch'](handleError(_0x2a0cc1,null));};exports['destroy']=function(_0x3393d2,_0x3b8e8e){return db[_0xd322('0x39')]['find']({'where':{'id':_0x3393d2[_0xd322('0x3e')]['id']}})[_0xd322('0x1f')](handleEntityNotFound(_0x3b8e8e,null))[_0xd322('0x1f')](removeEntity(_0x3b8e8e,null))[_0xd322('0x41')](handleError(_0x3b8e8e,null));};exports[_0xd322('0x45')]=function(_0x282523,_0x37c9ad){return db[_0xd322('0x39')][_0xd322('0x45')]()[_0xd322('0x1f')](respondWithResult(_0x37c9ad,null))[_0xd322('0x41')](handleError(_0x37c9ad,null));}; \ No newline at end of file +var _0x57f0=['ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','then','sendStatus','error','name','MailQueueReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv'];(function(_0x478ee3,_0x4d13c5){var _0x582fcc=function(_0x587d25){while(--_0x587d25){_0x478ee3['push'](_0x478ee3['shift']());}};_0x582fcc(++_0x4d13c5);}(_0x57f0,0x1e8));var _0x057f=function(_0x5bd20c,_0xcb49f4){_0x5bd20c=_0x5bd20c-0x0;var _0x1d5aaa=_0x57f0[_0x5bd20c];return _0x1d5aaa;};'use strict';var pdf=require(_0x057f('0x0'));var emlformat=require(_0x057f('0x1'));var rimraf=require(_0x057f('0x2'));var zipdir=require(_0x057f('0x3'));var jsonpatch=require(_0x057f('0x4'));var rp=require(_0x057f('0x5'));var moment=require(_0x057f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x057f('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x057f('0x8'));var ejs=require(_0x057f('0x9'));var fs=require('fs');var _=require(_0x057f('0xa'));var squel=require(_0x057f('0xb'));var crypto=require(_0x057f('0xc'));var jsforce=require(_0x057f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x057f('0x8'));var querystring=require(_0x057f('0xe'));var Papa=require(_0x057f('0xf'));var Redis=require(_0x057f('0x10'));var authService=require(_0x057f('0x11'));var qs=require(_0x057f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x057f('0x13'));var utils=require(_0x057f('0x14'));var config=require(_0x057f('0x15'));var db=require(_0x057f('0x16'))['db'];function respondWithStatusCode(_0x39c817,_0x4ea750){_0x4ea750=_0x4ea750||0xcc;return function(_0x7726fd){if(_0x7726fd){return _0x39c817['sendStatus'](_0x4ea750);}return _0x39c817[_0x057f('0x17')](_0x4ea750)[_0x057f('0x18')]();};}function respondWithResult(_0x450ecb,_0x1d6fc4){_0x1d6fc4=_0x1d6fc4||0xc8;return function(_0x5bd4c2){if(_0x5bd4c2){return _0x450ecb[_0x057f('0x17')](_0x1d6fc4)[_0x057f('0x19')](_0x5bd4c2);}};}function respondWithFilteredResult(_0x4769c3,_0x5bb89){return function(_0x163490){if(_0x163490){var _0x14b3dc=_0x163490[_0x057f('0x1a')],_0x4a5147=_0x5bb89[_0x057f('0x1b')],_0x107a71=_0x5bb89[_0x057f('0x1b')]+_0x5bb89['limit'],_0x440f1c;if(_0x107a71>=_0x14b3dc){_0x107a71=_0x14b3dc;_0x440f1c=0xc8;}else{_0x440f1c=0xce;}_0x4769c3[_0x057f('0x17')](_0x440f1c);return _0x4769c3[_0x057f('0x1c')](_0x057f('0x1d'),_0x4a5147+'-'+_0x107a71+'/'+_0x14b3dc)[_0x057f('0x19')](_0x163490);}return null;};}function patchUpdates(_0x522756){return function(_0x2d1375){try{jsonpatch['apply'](_0x2d1375,_0x522756,!![]);}catch(_0xdb8369){return BPromise[_0x057f('0x1e')](_0xdb8369);}return _0x2d1375[_0x057f('0x1f')]();};}function saveUpdates(_0x434aeb,_0x5e7c70){return function(_0x524f2a){if(_0x524f2a){return _0x524f2a[_0x057f('0x20')](_0x434aeb)[_0x057f('0x21')](function(_0x6a321e){return _0x6a321e;});}return null;};}function removeEntity(_0xf29d5d,_0x3ba0eb){return function(_0x4840b4){if(_0x4840b4){return _0x4840b4['destroy']()[_0x057f('0x21')](function(){_0xf29d5d[_0x057f('0x17')](0xcc)[_0x057f('0x18')]();});}};}function handleEntityNotFound(_0x9c3a03,_0x1d617d){return function(_0x4663b7){if(!_0x4663b7){_0x9c3a03[_0x057f('0x22')](0x194);}return _0x4663b7;};}function handleError(_0x30d75e,_0x34569f){_0x34569f=_0x34569f||0x1f4;return function(_0x186ea9){logger[_0x057f('0x23')](_0x186ea9['stack']);if(_0x186ea9[_0x057f('0x24')]){delete _0x186ea9[_0x057f('0x24')];}_0x30d75e[_0x057f('0x17')](_0x34569f)['send'](_0x186ea9);};}exports['index']=function(_0x263d8b,_0x1a82a7){var _0x5bfd5d={},_0x285668={},_0x427e13={'count':0x0,'rows':[]};var _0x302fa9=db[_0x057f('0x25')][_0x057f('0x26')];_0x285668[_0x057f('0x27')]=_['keys'](_0x302fa9);_0x285668[_0x057f('0x28')]=_[_0x057f('0x29')](_0x263d8b[_0x057f('0x28')]);_0x285668[_0x057f('0x2a')]=_['intersection'](_0x285668[_0x057f('0x27')],_0x285668['query']);_0x5bfd5d[_0x057f('0x2b')]=_[_0x057f('0x2c')](_0x285668[_0x057f('0x27')],qs[_0x057f('0x2d')](_0x263d8b[_0x057f('0x28')][_0x057f('0x2d')]));_0x5bfd5d[_0x057f('0x2b')]=_0x5bfd5d[_0x057f('0x2b')]['length']?_0x5bfd5d[_0x057f('0x2b')]:_0x285668[_0x057f('0x27')];if(!_0x263d8b[_0x057f('0x28')][_0x057f('0x2e')]('nolimit')){_0x5bfd5d['limit']=qs[_0x057f('0x2f')](_0x263d8b[_0x057f('0x28')]['limit']);_0x5bfd5d[_0x057f('0x1b')]=qs[_0x057f('0x1b')](_0x263d8b[_0x057f('0x28')]['offset']);}_0x5bfd5d[_0x057f('0x30')]=qs[_0x057f('0x31')](_0x263d8b['query']['sort']);_0x5bfd5d[_0x057f('0x32')]=qs[_0x057f('0x2a')](_[_0x057f('0x33')](_0x263d8b[_0x057f('0x28')],_0x285668[_0x057f('0x2a')]));if(_0x263d8b['query'][_0x057f('0x34')]){_0x5bfd5d['where']=_['merge'](_0x5bfd5d[_0x057f('0x32')],{'$or':_['map'](_0x302fa9,function(_0x16b75e){if(_0x16b75e[_0x057f('0x35')]['key']!==_0x057f('0x36')){var _0xb60535={};_0xb60535[_0x16b75e[_0x057f('0x37')]]={'$like':'%'+_0x263d8b[_0x057f('0x28')][_0x057f('0x34')]+'%'};return _0xb60535;}})});}_0x5bfd5d=_[_0x057f('0x38')]({},_0x5bfd5d,_0x263d8b[_0x057f('0x39')]);var _0x567d8b={'where':_0x5bfd5d['where']};return db[_0x057f('0x25')]['count'](_0x567d8b)[_0x057f('0x21')](function(_0x57cc05){_0x427e13[_0x057f('0x1a')]=_0x57cc05;if(_0x263d8b[_0x057f('0x28')][_0x057f('0x3a')]){_0x5bfd5d[_0x057f('0x3b')]=[{'all':!![]}];}return db[_0x057f('0x25')][_0x057f('0x3c')](_0x5bfd5d);})[_0x057f('0x21')](function(_0x303bc8){_0x427e13[_0x057f('0x3d')]=_0x303bc8;return _0x427e13;})[_0x057f('0x21')](respondWithFilteredResult(_0x1a82a7,_0x5bfd5d))[_0x057f('0x3e')](handleError(_0x1a82a7,null));};exports[_0x057f('0x3f')]=function(_0x15ccbe,_0x8ef225){var _0xae926a={'raw':!![],'where':{'id':_0x15ccbe['params']['id']}},_0x26108c={};_0x26108c[_0x057f('0x27')]=_[_0x057f('0x29')](db[_0x057f('0x25')]['rawAttributes']);_0x26108c[_0x057f('0x28')]=_[_0x057f('0x29')](_0x15ccbe[_0x057f('0x28')]);_0x26108c[_0x057f('0x2a')]=_[_0x057f('0x2c')](_0x26108c[_0x057f('0x27')],_0x26108c[_0x057f('0x28')]);_0xae926a[_0x057f('0x2b')]=_['intersection'](_0x26108c[_0x057f('0x27')],qs['fields'](_0x15ccbe[_0x057f('0x28')]['fields']));_0xae926a['attributes']=_0xae926a[_0x057f('0x2b')][_0x057f('0x40')]?_0xae926a[_0x057f('0x2b')]:_0x26108c['model'];if(_0x15ccbe[_0x057f('0x28')][_0x057f('0x3a')]){_0xae926a['include']=[{'all':!![]}];}_0xae926a=_['merge']({},_0xae926a,_0x15ccbe[_0x057f('0x39')]);return db[_0x057f('0x25')][_0x057f('0x41')](_0xae926a)['then'](handleEntityNotFound(_0x8ef225,null))['then'](respondWithResult(_0x8ef225,null))[_0x057f('0x3e')](handleError(_0x8ef225,null));};exports['create']=function(_0x47409f,_0x12d4fd){return db['MailQueueReport'][_0x057f('0x42')](_0x47409f[_0x057f('0x43')],{})[_0x057f('0x21')](respondWithResult(_0x12d4fd,0xc9))[_0x057f('0x3e')](handleError(_0x12d4fd,null));};exports[_0x057f('0x20')]=function(_0x3b00c8,_0x4cb7c8){if(_0x3b00c8[_0x057f('0x43')]['id']){delete _0x3b00c8[_0x057f('0x43')]['id'];}return db[_0x057f('0x25')][_0x057f('0x41')]({'where':{'id':_0x3b00c8[_0x057f('0x44')]['id']}})[_0x057f('0x21')](handleEntityNotFound(_0x4cb7c8,null))[_0x057f('0x21')](saveUpdates(_0x3b00c8['body'],null))['then'](respondWithResult(_0x4cb7c8,null))['catch'](handleError(_0x4cb7c8,null));};exports[_0x057f('0x45')]=function(_0x234248,_0x5e29f8){return db['MailQueueReport']['find']({'where':{'id':_0x234248['params']['id']}})[_0x057f('0x21')](handleEntityNotFound(_0x5e29f8,null))[_0x057f('0x21')](removeEntity(_0x5e29f8,null))[_0x057f('0x3e')](handleError(_0x5e29f8,null));};exports[_0x057f('0x46')]=function(_0x128d15,_0xbca980){return db['MailQueueReport'][_0x057f('0x46')]()[_0x057f('0x21')](respondWithResult(_0xbca980,null))['catch'](handleError(_0xbca980,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 27d5e2f..43a9156 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 _0x657b=['../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2564bc,_0x1a46d3){var _0x3a421d=function(_0x5cbea8){while(--_0x5cbea8){_0x2564bc['push'](_0x2564bc['shift']());}};_0x3a421d(++_0x1a46d3);}(_0x657b,0x131));var _0xb657=function(_0x17c0cd,_0x162d35){_0x17c0cd=_0x17c0cd-0x0;var _0x29e983=_0x657b[_0x17c0cd];return _0x29e983;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require('bluebird');var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module[_0xb657('0x9')]=function(_0x25738d,_0x446b17){return _0x25738d['define'](_0xb657('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xb657('0xb'),'fields':[_0xb657('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb248=['rimraf','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0xb248,0xc6));var _0x8b24=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb248[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var logger=require(_0x8b24('0x1'))(_0x8b24('0x2'));var moment=require(_0x8b24('0x3'));var BPromise=require(_0x8b24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b24('0x5'));var rimraf=require(_0x8b24('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b24('0x7'));module[_0x8b24('0x8')]=function(_0x4cc3c4,_0x6da5b7){return _0x4cc3c4[_0x8b24('0x9')]('MailQueueReport',attributes,{'tableName':_0x8b24('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8b24('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 48447f8..b26f6a7 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 _0x5540=['rpc','../../config/environment','http','request','then','request\x20sent','debug','stringify','error','MailQueueReport,\x20%s,\x20%s','message','catch','MailQueueReport','create','options','info','CreateMailQueueReport','update','UpdateMailQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x28edd1,_0x3660e0){var _0x4c0f8e=function(_0x45ce5f){while(--_0x45ce5f){_0x28edd1['push'](_0x28edd1['shift']());}};_0x4c0f8e(++_0x3660e0);}(_0x5540,0x10d));var _0x0554=function(_0x3430f2,_0x2bf10e){_0x3430f2=_0x3430f2-0x0;var _0xf3c036=_0x5540[_0x3430f2];return _0xf3c036;};'use strict';var _=require(_0x0554('0x0'));var util=require(_0x0554('0x1'));var moment=require('moment');var BPromise=require(_0x0554('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0554('0x3'));var db=require(_0x0554('0x4'))['db'];var utils=require(_0x0554('0x5'));var logger=require('../../config/logger')(_0x0554('0x6'));var config=require(_0x0554('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0554('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d4340,_0x319141,_0x1d950f){return new BPromise(function(_0x2c1af2,_0x2442fa){return client[_0x0554('0x9')](_0x3d4340,_0x1d950f)[_0x0554('0xa')](function(_0x2e7831){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x319141,_0x0554('0xb'));logger[_0x0554('0xc')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x319141,'request\x20sent',JSON[_0x0554('0xd')](_0x2e7831));if(_0x2e7831['error']){if(_0x2e7831[_0x0554('0xe')]['code']===0x1f4){logger[_0x0554('0xe')](_0x0554('0xf'),_0x319141,_0x2e7831['error']['message']);return _0x2442fa(_0x2e7831[_0x0554('0xe')][_0x0554('0x10')]);}logger[_0x0554('0xe')]('MailQueueReport,\x20%s,\x20%s',_0x319141,_0x2e7831[_0x0554('0xe')][_0x0554('0x10')]);return _0x2c1af2(_0x2e7831[_0x0554('0xe')][_0x0554('0x10')]);}else{logger['info'](_0x0554('0xf'),_0x319141,_0x0554('0xb'));_0x2c1af2(_0x2e7831['result'][_0x0554('0x10')]);}})[_0x0554('0x11')](function(_0x306697){logger['error'](_0x0554('0xf'),_0x319141,_0x306697);_0x2442fa(_0x306697);});});}exports['CreateMailQueueReport']=function(_0x5d32b6){var _0x264d92=this;return new Promise(function(_0x15237c,_0x2203a4){return db[_0x0554('0x12')][_0x0554('0x13')](_0x5d32b6['body'],{'raw':_0x5d32b6['options']?_0x5d32b6[_0x0554('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0554('0xa')](function(_0x5a9914){logger[_0x0554('0x15')](_0x0554('0x16'),_0x5d32b6);logger[_0x0554('0xc')](_0x0554('0x16'),_0x5d32b6,JSON[_0x0554('0xd')](_0x5a9914));_0x15237c(_0x5a9914);})[_0x0554('0x11')](function(_0x19e4f0){logger[_0x0554('0xe')]('CreateMailQueueReport',_0x19e4f0[_0x0554('0x10')],_0x5d32b6);_0x2203a4(_0x264d92[_0x0554('0xe')](0x1f4,_0x19e4f0['message']));});});};exports['UpdateMailQueueReport']=function(_0x59c11e){var _0x16d6c7=this;return new Promise(function(_0x5bdff2,_0x102999){return db[_0x0554('0x12')][_0x0554('0x17')](_0x59c11e['body'],{'raw':_0x59c11e[_0x0554('0x14')]?_0x59c11e[_0x0554('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c11e[_0x0554('0x14')]?_0x59c11e['options']['where']||null:null,'attributes':_0x59c11e[_0x0554('0x14')]?_0x59c11e[_0x0554('0x14')]['attributes']||null:null,'limit':_0x59c11e[_0x0554('0x14')]?_0x59c11e[_0x0554('0x14')]['limit']||null:null})['then'](function(_0x11e1b4){logger['info'](_0x0554('0x18'),_0x59c11e);logger['debug'](_0x0554('0x18'),_0x59c11e,JSON[_0x0554('0xd')](_0x11e1b4));_0x5bdff2(_0x11e1b4);})[_0x0554('0x11')](function(_0x223631){logger[_0x0554('0xe')]('UpdateMailQueueReport',_0x223631[_0x0554('0x10')],_0x59c11e);_0x102999(_0x16d6c7['error'](0x1f4,_0x223631[_0x0554('0x10')]));});});}; \ No newline at end of file +var _0xb18d=['attributes','moment','randomstring','../../mysqldb','jayson/promise','client','http','info','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','result','CreateMailQueueReport','MailQueueReport','create','options','raw','then','catch','UpdateMailQueueReport','update','body','where'];(function(_0x428149,_0x48796e){var _0x38e145=function(_0x23e53d){while(--_0x23e53d){_0x428149['push'](_0x428149['shift']());}};_0x38e145(++_0x48796e);}(_0xb18d,0x135));var _0xdb18=function(_0x388ee9,_0x5f4f67){_0x388ee9=_0x388ee9-0x0;var _0x219140=_0xb18d[_0x388ee9];return _0x219140;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb18('0x0'));var BPromise=require('bluebird');var rs=require(_0xdb18('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb18('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdb18('0x3'));var client=jayson[_0xdb18('0x4')][_0xdb18('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x25d3b2,_0xa54622,_0x28b210){return new BPromise(function(_0x22546a,_0x179fa6){return client['request'](_0x25d3b2,_0x28b210)['then'](function(_0x142ff3){logger[_0xdb18('0x6')]('MailQueueReport,\x20%s,\x20%s',_0xa54622,_0xdb18('0x7'));logger[_0xdb18('0x8')](_0xdb18('0x9'),_0xa54622,'request\x20sent',JSON[_0xdb18('0xa')](_0x142ff3));if(_0x142ff3[_0xdb18('0xb')]){if(_0x142ff3[_0xdb18('0xb')][_0xdb18('0xc')]===0x1f4){logger[_0xdb18('0xb')](_0xdb18('0xd'),_0xa54622,_0x142ff3[_0xdb18('0xb')][_0xdb18('0xe')]);return _0x179fa6(_0x142ff3['error'][_0xdb18('0xe')]);}logger[_0xdb18('0xb')](_0xdb18('0xd'),_0xa54622,_0x142ff3[_0xdb18('0xb')][_0xdb18('0xe')]);return _0x22546a(_0x142ff3[_0xdb18('0xb')][_0xdb18('0xe')]);}else{logger[_0xdb18('0x6')]('MailQueueReport,\x20%s,\x20%s',_0xa54622,_0xdb18('0x7'));_0x22546a(_0x142ff3[_0xdb18('0xf')][_0xdb18('0xe')]);}})['catch'](function(_0x5d0da1){logger[_0xdb18('0xb')](_0xdb18('0xd'),_0xa54622,_0x5d0da1);_0x179fa6(_0x5d0da1);});});}exports[_0xdb18('0x10')]=function(_0x29fc0d){var _0x4cf5cf=this;return new Promise(function(_0x1122d3,_0x40e284){return db[_0xdb18('0x11')][_0xdb18('0x12')](_0x29fc0d['body'],{'raw':_0x29fc0d[_0xdb18('0x13')]?_0x29fc0d['options'][_0xdb18('0x14')]===undefined?!![]:![]:!![]})[_0xdb18('0x15')](function(_0x5446d8){logger[_0xdb18('0x6')](_0xdb18('0x10'),_0x29fc0d);logger['debug']('CreateMailQueueReport',_0x29fc0d,JSON['stringify'](_0x5446d8));_0x1122d3(_0x5446d8);})[_0xdb18('0x16')](function(_0x34d30a){logger[_0xdb18('0xb')](_0xdb18('0x10'),_0x34d30a[_0xdb18('0xe')],_0x29fc0d);_0x40e284(_0x4cf5cf[_0xdb18('0xb')](0x1f4,_0x34d30a[_0xdb18('0xe')]));});});};exports[_0xdb18('0x17')]=function(_0x1d795c){var _0x19bdfc=this;return new Promise(function(_0x5d109e,_0x390d13){return db[_0xdb18('0x11')][_0xdb18('0x18')](_0x1d795c[_0xdb18('0x19')],{'raw':_0x1d795c[_0xdb18('0x13')]?_0x1d795c[_0xdb18('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d795c[_0xdb18('0x13')]?_0x1d795c['options'][_0xdb18('0x1a')]||null:null,'attributes':_0x1d795c[_0xdb18('0x13')]?_0x1d795c[_0xdb18('0x13')][_0xdb18('0x1b')]||null:null,'limit':_0x1d795c[_0xdb18('0x13')]?_0x1d795c[_0xdb18('0x13')]['limit']||null:null})[_0xdb18('0x15')](function(_0x446127){logger[_0xdb18('0x6')](_0xdb18('0x17'),_0x1d795c);logger[_0xdb18('0x8')](_0xdb18('0x17'),_0x1d795c,JSON[_0xdb18('0xa')](_0x446127));_0x5d109e(_0x446127);})[_0xdb18('0x16')](function(_0x5bdf7d){logger[_0xdb18('0xb')]('UpdateMailQueueReport',_0x5bdf7d[_0xdb18('0xe')],_0x1d795c);_0x390d13(_0x19bdfc[_0xdb18('0xb')](0x1f4,_0x5bdf7d[_0xdb18('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 2e7d687..93ea504 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 _0xb2ad=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x3e3b06,_0x5d36df){_0x3e3b06=_0x3e3b06-0x0;var _0xfee61a=_0xb2ad[_0x3e3b06];return _0xfee61a;};'use strict';var multer=require('multer');var util=require(_0xdb2a('0x0'));var path=require('path');var timeout=require(_0xdb2a('0x1'));var express=require(_0xdb2a('0x2'));var router=express[_0xdb2a('0x3')]();var auth=require(_0xdb2a('0x4'));var interaction=require(_0xdb2a('0x5'));var config=require('../../config/environment');module[_0xdb2a('0x6')]=router; \ No newline at end of file +var _0x2eb2=['../../components/auth/service','../../config/environment','util','path','connect-timeout','express','Router'];(function(_0x12838f,_0x9f3d96){var _0x2653b3=function(_0x26358a){while(--_0x26358a){_0x12838f['push'](_0x12838f['shift']());}};_0x2653b3(++_0x9f3d96);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x2eb2[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 67f617c..71af70e 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 _0xae60=['sequelize','exports','STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x50ff96,_0x36a4ee){var _0x49ba39=function(_0x2486ba){while(--_0x2486ba){_0x50ff96['push'](_0x50ff96['shift']());}};_0x49ba39(++_0x36a4ee);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xae60[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x0ae6('0x0'));module[_0x0ae6('0x1')]={'description':{'type':Sequelize[_0x0ae6('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0ae6('0x2')],'unique':_0x0ae6('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0ae6('0x5')]},'tls':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x0ae6('0x6')},'connTimeout':{'type':Sequelize[_0x0ae6('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0ae6('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0ae6('0x2')]}}; \ No newline at end of file +var _0xa478=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN','username'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa478,0x136));var _0x8a47=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xa478[_0x5c7e53];return _0x1c9af9;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'description':{'type':Sequelize[_0x8a47('0x2')]},'host':{'type':Sequelize[_0x8a47('0x2')]},'authentication':{'type':Sequelize[_0x8a47('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8a47('0x2')],'unique':_0x8a47('0x4')},'password':{'type':Sequelize[_0x8a47('0x2')]},'port':{'type':Sequelize[_0x8a47('0x5')]},'tls':{'type':Sequelize[_0x8a47('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8a47('0x2')],'defaultValue':_0x8a47('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8a47('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ee3ac73..54d2cb2 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 _0x9977=['../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','util','../../config/logger','api','bluebird'];(function(_0x8f6a2c,_0x435996){var _0x42a718=function(_0x572dd2){while(--_0x572dd2){_0x8f6a2c['push'](_0x8f6a2c['shift']());}};_0x42a718(++_0x435996);}(_0x9977,0x9e));var _0x7997=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x9977[_0x1477ef];return _0x164acd;};'use strict';var _=require('lodash');var util=require(_0x7997('0x0'));var logger=require(_0x7997('0x1'))(_0x7997('0x2'));var moment=require('moment');var BPromise=require(_0x7997('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7997('0x4'));var attributes=require(_0x7997('0x5'));module[_0x7997('0x6')]=function(_0x3665ed,_0x545f89){return _0x3665ed[_0x7997('0x7')]('MailServerIn',attributes,{'tableName':_0x7997('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x481a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger','api'];(function(_0x53b8ac,_0x44508f){var _0xe4e87e=function(_0x3dd183){while(--_0x3dd183){_0x53b8ac['push'](_0x53b8ac['shift']());}};_0xe4e87e(++_0x44508f);}(_0x481a,0x1a0));var _0xa481=function(_0x1731bc,_0x3ff87a){_0x1731bc=_0x1731bc-0x0;var _0x4bb15=_0x481a[_0x1731bc];return _0x4bb15;};'use strict';var _=require(_0xa481('0x0'));var util=require(_0xa481('0x1'));var logger=require(_0xa481('0x2'))(_0xa481('0x3'));var moment=require(_0xa481('0x4'));var BPromise=require(_0xa481('0x5'));var rp=require(_0xa481('0x6'));var fs=require('fs');var path=require(_0xa481('0x7'));var rimraf=require(_0xa481('0x8'));var config=require(_0xa481('0x9'));var attributes=require(_0xa481('0xa'));module[_0xa481('0xb')]=function(_0x8a54cb,_0x142e80){return _0x8a54cb[_0xa481('0xc')](_0xa481('0xd'),attributes,{'tableName':'mail_servers_in','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 7622ab9..1ee3443 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 _0x2825=['findAll','options','raw','attributes','include','model','map','GetMailServerIn','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','MailServerIn'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2825,0x68));var _0x5282=function(_0x19e55b,_0x7d85bd){_0x19e55b=_0x19e55b-0x0;var _0x170903=_0x2825[_0x19e55b];return _0x170903;};'use strict';var _=require(_0x5282('0x0'));var util=require(_0x5282('0x1'));var moment=require(_0x5282('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5282('0x3'));var db=require(_0x5282('0x4'))['db'];var utils=require(_0x5282('0x5'));var logger=require(_0x5282('0x6'))(_0x5282('0x7'));var config=require(_0x5282('0x8'));var jayson=require(_0x5282('0x9'));var client=jayson[_0x5282('0xa')][_0x5282('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfc3c58,_0xc14140,_0x2e1855){return new BPromise(function(_0x42c051,_0x598b6a){return client[_0x5282('0xc')](_0xfc3c58,_0x2e1855)[_0x5282('0xd')](function(_0x2ea07c){logger[_0x5282('0xe')](_0x5282('0xf'),_0xc14140,_0x5282('0x10'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0xc14140,_0x5282('0x10'),JSON[_0x5282('0x11')](_0x2ea07c));if(_0x2ea07c['error']){if(_0x2ea07c['error'][_0x5282('0x12')]===0x1f4){logger[_0x5282('0x13')](_0x5282('0xf'),_0xc14140,_0x2ea07c['error'][_0x5282('0x14')]);return _0x598b6a(_0x2ea07c[_0x5282('0x13')][_0x5282('0x14')]);}logger[_0x5282('0x13')](_0x5282('0xf'),_0xc14140,_0x2ea07c['error'][_0x5282('0x14')]);return _0x42c051(_0x2ea07c[_0x5282('0x13')]['message']);}else{logger[_0x5282('0xe')]('MailServerIn,\x20%s,\x20%s',_0xc14140,'request\x20sent');_0x42c051(_0x2ea07c[_0x5282('0x15')]['message']);}})[_0x5282('0x16')](function(_0x5d5233){logger[_0x5282('0x13')]('MailServerIn,\x20%s,\x20%s',_0xc14140,_0x5d5233);_0x598b6a(_0x5d5233);});});}exports['GetMailServerIn']=function(_0x1bf297){var _0x250f56=this;return new Promise(function(_0x5cbb8f,_0x49a12c){return db[_0x5282('0x17')][_0x5282('0x18')]({'raw':_0x1bf297[_0x5282('0x19')]?_0x1bf297[_0x5282('0x19')][_0x5282('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bf297['options']?_0x1bf297[_0x5282('0x19')]['where']||null:null,'attributes':_0x1bf297[_0x5282('0x19')]?_0x1bf297[_0x5282('0x19')][_0x5282('0x1b')]||null:null,'limit':_0x1bf297[_0x5282('0x19')]?_0x1bf297[_0x5282('0x19')]['limit']||null:null,'include':_0x1bf297[_0x5282('0x19')]?_0x1bf297[_0x5282('0x19')][_0x5282('0x1c')]?_['map'](_0x1bf297[_0x5282('0x19')]['include'],function(_0x1b11cf){return{'model':db[_0x1b11cf[_0x5282('0x1d')]],'as':_0x1b11cf['as'],'attributes':_0x1b11cf[_0x5282('0x1b')],'include':_0x1b11cf['include']?_[_0x5282('0x1e')](_0x1b11cf[_0x5282('0x1c')],function(_0x220d70){return{'model':db[_0x220d70[_0x5282('0x1d')]],'as':_0x220d70['as'],'attributes':_0x220d70['attributes'],'include':_0x220d70[_0x5282('0x1c')]?_['map'](_0x220d70[_0x5282('0x1c')],function(_0x5dd3ad){return{'model':db[_0x5dd3ad[_0x5282('0x1d')]],'as':_0x5dd3ad['as'],'attributes':_0x5dd3ad[_0x5282('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5282('0xd')](function(_0x52db7e){logger[_0x5282('0xe')]('GetMailServerIn',_0x1bf297);logger['debug'](_0x5282('0x1f'),_0x1bf297,JSON[_0x5282('0x11')](_0x52db7e));_0x5cbb8f(_0x52db7e);})[_0x5282('0x16')](function(_0x3d9bf7){logger[_0x5282('0x13')]('GetMailServerIn',_0x3d9bf7['message'],_0x1bf297);_0x49a12c(_0x250f56[_0x5282('0x13')](0x1f4,_0x3d9bf7[_0x5282('0x14')]));});});}; \ No newline at end of file +var _0x5447=['MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug'];(function(_0x47c462,_0xde7262){var _0x31e96e=function(_0x4bc5d1){while(--_0x4bc5d1){_0x47c462['push'](_0x47c462['shift']());}};_0x31e96e(++_0xde7262);}(_0x5447,0xdc));var _0x7544=function(_0x41e9b7,_0x3bbaf7){_0x41e9b7=_0x41e9b7-0x0;var _0x5769b1=_0x5447[_0x41e9b7];return _0x5769b1;};'use strict';var _=require(_0x7544('0x0'));var util=require(_0x7544('0x1'));var moment=require(_0x7544('0x2'));var BPromise=require(_0x7544('0x3'));var rs=require(_0x7544('0x4'));var fs=require('fs');var Redis=require(_0x7544('0x5'));var db=require(_0x7544('0x6'))['db'];var utils=require(_0x7544('0x7'));var logger=require(_0x7544('0x8'))('rpc');var config=require(_0x7544('0x9'));var jayson=require(_0x7544('0xa'));var client=jayson[_0x7544('0xb')][_0x7544('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d3770,_0x22adcd,_0x2e4b74){return new BPromise(function(_0x11c54a,_0x3de915){return client[_0x7544('0xd')](_0x5d3770,_0x2e4b74)[_0x7544('0xe')](function(_0xf015c6){logger[_0x7544('0xf')](_0x7544('0x10'),_0x22adcd,'request\x20sent');logger[_0x7544('0x11')](_0x7544('0x12'),_0x22adcd,_0x7544('0x13'),JSON[_0x7544('0x14')](_0xf015c6));if(_0xf015c6['error']){if(_0xf015c6[_0x7544('0x15')][_0x7544('0x16')]===0x1f4){logger[_0x7544('0x15')](_0x7544('0x10'),_0x22adcd,_0xf015c6[_0x7544('0x15')][_0x7544('0x17')]);return _0x3de915(_0xf015c6[_0x7544('0x15')][_0x7544('0x17')]);}logger['error'](_0x7544('0x10'),_0x22adcd,_0xf015c6[_0x7544('0x15')]['message']);return _0x11c54a(_0xf015c6['error']['message']);}else{logger[_0x7544('0xf')](_0x7544('0x10'),_0x22adcd,_0x7544('0x13'));_0x11c54a(_0xf015c6['result'][_0x7544('0x17')]);}})['catch'](function(_0x594465){logger[_0x7544('0x15')](_0x7544('0x10'),_0x22adcd,_0x594465);_0x3de915(_0x594465);});});}exports[_0x7544('0x18')]=function(_0x505e9e){var _0xad59e7=this;return new Promise(function(_0x20da66,_0x58cefd){return db[_0x7544('0x19')][_0x7544('0x1a')]({'raw':_0x505e9e[_0x7544('0x1b')]?_0x505e9e[_0x7544('0x1b')][_0x7544('0x1c')]===undefined?!![]:![]:!![],'where':_0x505e9e[_0x7544('0x1b')]?_0x505e9e['options'][_0x7544('0x1d')]||null:null,'attributes':_0x505e9e[_0x7544('0x1b')]?_0x505e9e[_0x7544('0x1b')][_0x7544('0x1e')]||null:null,'limit':_0x505e9e[_0x7544('0x1b')]?_0x505e9e[_0x7544('0x1b')]['limit']||null:null,'include':_0x505e9e[_0x7544('0x1b')]?_0x505e9e[_0x7544('0x1b')]['include']?_[_0x7544('0x1f')](_0x505e9e[_0x7544('0x1b')][_0x7544('0x20')],function(_0xf82d0b){return{'model':db[_0xf82d0b[_0x7544('0x21')]],'as':_0xf82d0b['as'],'attributes':_0xf82d0b[_0x7544('0x1e')],'include':_0xf82d0b['include']?_['map'](_0xf82d0b[_0x7544('0x20')],function(_0x2600e5){return{'model':db[_0x2600e5[_0x7544('0x21')]],'as':_0x2600e5['as'],'attributes':_0x2600e5[_0x7544('0x1e')],'include':_0x2600e5[_0x7544('0x20')]?_[_0x7544('0x1f')](_0x2600e5[_0x7544('0x20')],function(_0x409b94){return{'model':db[_0x409b94['model']],'as':_0x409b94['as'],'attributes':_0x409b94[_0x7544('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7544('0xe')](function(_0x41b3a0){logger[_0x7544('0xf')]('GetMailServerIn',_0x505e9e);logger[_0x7544('0x11')](_0x7544('0x18'),_0x505e9e,JSON[_0x7544('0x14')](_0x41b3a0));_0x20da66(_0x41b3a0);})['catch'](function(_0x1c143d){logger[_0x7544('0x15')]('GetMailServerIn',_0x1c143d[_0x7544('0x17')],_0x505e9e);_0x58cefd(_0xad59e7[_0x7544('0x15')](0x1f4,_0x1c143d[_0x7544('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3807d6f..2342f85 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 _0xfd33=['delete','/:id','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','create','update'];(function(_0x5166fd,_0x12a75b){var _0x3ad19f=function(_0xc5b35c){while(--_0xc5b35c){_0x5166fd['push'](_0x5166fd['shift']());}};_0x3ad19f(++_0x12a75b);}(_0xfd33,0x8b));var _0x3fd3=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xfd33[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require('multer');var util=require(_0x3fd3('0x0'));var path=require(_0x3fd3('0x1'));var timeout=require(_0x3fd3('0x2'));var express=require(_0x3fd3('0x3'));var router=express['Router']();var auth=require(_0x3fd3('0x4'));var interaction=require(_0x3fd3('0x5'));var config=require(_0x3fd3('0x6'));var controller=require(_0x3fd3('0x7'));router[_0x3fd3('0x8')]('/',auth[_0x3fd3('0x9')](),controller[_0x3fd3('0xa')]);router[_0x3fd3('0x8')]('/:id',auth[_0x3fd3('0x9')](),controller[_0x3fd3('0xb')]);router['post']('/',auth[_0x3fd3('0x9')](),controller[_0x3fd3('0xc')]);router['put']('/:id',auth[_0x3fd3('0x9')](),controller[_0x3fd3('0xd')]);router[_0x3fd3('0xe')](_0x3fd3('0xf'),auth['isAuthenticated'](),controller[_0x3fd3('0x10')]);module['exports']=router; \ No newline at end of file +var _0xda25=['isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller'];(function(_0x3376dd,_0x5d5b83){var _0x501032=function(_0xc4a1d7){while(--_0xc4a1d7){_0x3376dd['push'](_0x3376dd['shift']());}};_0x501032(++_0x5d5b83);}(_0xda25,0x106));var _0x5da2=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xda25[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x5da2('0x0'));var util=require(_0x5da2('0x1'));var path=require('path');var timeout=require(_0x5da2('0x2'));var express=require(_0x5da2('0x3'));var router=express[_0x5da2('0x4')]();var auth=require(_0x5da2('0x5'));var interaction=require(_0x5da2('0x6'));var config=require('../../config/environment');var controller=require(_0x5da2('0x7'));router['get']('/',auth[_0x5da2('0x8')](),controller[_0x5da2('0x9')]);router[_0x5da2('0xa')](_0x5da2('0xb'),auth[_0x5da2('0x8')](),controller[_0x5da2('0xc')]);router[_0x5da2('0xd')]('/',auth[_0x5da2('0x8')](),controller['create']);router[_0x5da2('0xe')](_0x5da2('0xb'),auth[_0x5da2('0x8')](),controller[_0x5da2('0xf')]);router[_0x5da2('0x10')]('/:id',auth[_0x5da2('0x8')](),controller[_0x5da2('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 91fc623..b76fac3 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 _0x164c=['BOOLEAN','sequelize','STRING'];(function(_0x406e19,_0x2f834f){var _0x4effc6=function(_0x26a282){while(--_0x26a282){_0x406e19['push'](_0x406e19['shift']());}};_0x4effc6(++_0x2f834f);}(_0x164c,0x166));var _0xc164=function(_0x1dd11e,_0x2491fa){_0x1dd11e=_0x1dd11e-0x0;var _0x31e613=_0x164c[_0x1dd11e];return _0x31e613;};'use strict';var Sequelize=require(_0xc164('0x0'));module['exports']={'description':{'type':Sequelize[_0xc164('0x1')]},'host':{'type':Sequelize[_0xc164('0x1')]},'user':{'type':Sequelize[_0xc164('0x1')]},'pass':{'type':Sequelize[_0xc164('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xc164('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xc164('0x1')]},'authentication':{'type':Sequelize[_0xc164('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3397=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1fece6,_0x11093d){var _0x474b0c=function(_0xa1d0c2){while(--_0xa1d0c2){_0x1fece6['push'](_0x1fece6['shift']());}};_0x474b0c(++_0x11093d);}(_0x3397,0x112));var _0x7339=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x3397[_0x2bf1d6];return _0x1be08a;};'use strict';var Sequelize=require(_0x7339('0x0'));module[_0x7339('0x1')]={'description':{'type':Sequelize[_0x7339('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7339('0x2')]},'pass':{'type':Sequelize[_0x7339('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x7339('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7339('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 27cbe15..d5a01e5 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 _0xeda5=['find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','keys','query','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','key','VIRTUAL','field','filter','merge','options','MailServerOut','includeAll','findAll','rows','catch','show','params','rawAttributes'];(function(_0x443f1d,_0x341890){var _0x5df0c8=function(_0x45f10f){while(--_0x45f10f){_0x443f1d['push'](_0x443f1d['shift']());}};_0x5df0c8(++_0x341890);}(_0xeda5,0x96));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5eda('0x0'));var emlformat=require(_0x5eda('0x1'));var rimraf=require(_0x5eda('0x2'));var zipdir=require(_0x5eda('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5eda('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5eda('0x5'));var path=require(_0x5eda('0x6'));var sox=require(_0x5eda('0x7'));var csv=require(_0x5eda('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5eda('0x9'));var squel=require(_0x5eda('0xa'));var crypto=require(_0x5eda('0xb'));var jsforce=require(_0x5eda('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5eda('0x8'));var querystring=require(_0x5eda('0xd'));var Papa=require(_0x5eda('0xe'));var Redis=require(_0x5eda('0xf'));var authService=require(_0x5eda('0x10'));var qs=require(_0x5eda('0x11'));var hardwareService=require(_0x5eda('0x12'));var logger=require(_0x5eda('0x13'))(_0x5eda('0x14'));var utils=require(_0x5eda('0x15'));var config=require(_0x5eda('0x16'));var db=require(_0x5eda('0x17'))['db'];function respondWithStatusCode(_0x57ddc6,_0x1cae47){_0x1cae47=_0x1cae47||0xcc;return function(_0x5c6b50){if(_0x5c6b50){return _0x57ddc6['sendStatus'](_0x1cae47);}return _0x57ddc6[_0x5eda('0x18')](_0x1cae47)[_0x5eda('0x19')]();};}function respondWithResult(_0x9224c1,_0x2eac9e){_0x2eac9e=_0x2eac9e||0xc8;return function(_0x11032e){if(_0x11032e){return _0x9224c1['status'](_0x2eac9e)[_0x5eda('0x1a')](_0x11032e);}};}function respondWithFilteredResult(_0x2fcabe,_0x1a4dd4){return function(_0x14cb7c){if(_0x14cb7c){var _0x1bcc3a=_0x14cb7c[_0x5eda('0x1b')],_0x56ec46=_0x1a4dd4[_0x5eda('0x1c')],_0x73f2b9=_0x1a4dd4[_0x5eda('0x1c')]+_0x1a4dd4['limit'],_0x72147b;if(_0x73f2b9>=_0x1bcc3a){_0x73f2b9=_0x1bcc3a;_0x72147b=0xc8;}else{_0x72147b=0xce;}_0x2fcabe[_0x5eda('0x18')](_0x72147b);return _0x2fcabe[_0x5eda('0x1d')](_0x5eda('0x1e'),_0x56ec46+'-'+_0x73f2b9+'/'+_0x1bcc3a)[_0x5eda('0x1a')](_0x14cb7c);}return null;};}function patchUpdates(_0x1696f6){return function(_0x4574ba){try{jsonpatch[_0x5eda('0x1f')](_0x4574ba,_0x1696f6,!![]);}catch(_0x3dbad5){return BPromise['reject'](_0x3dbad5);}return _0x4574ba[_0x5eda('0x20')]();};}function saveUpdates(_0x303889,_0x9379a){return function(_0x1d8e04){if(_0x1d8e04){return _0x1d8e04[_0x5eda('0x21')](_0x303889)[_0x5eda('0x22')](function(_0x3b05b3){return _0x3b05b3;});}return null;};}function removeEntity(_0x45522e,_0x5ccee7){return function(_0x263ec6){if(_0x263ec6){return _0x263ec6['destroy']()['then'](function(){_0x45522e[_0x5eda('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cbe21,_0x2fd849){return function(_0xfcacfb){if(!_0xfcacfb){_0x3cbe21[_0x5eda('0x23')](0x194);}return _0xfcacfb;};}function handleError(_0x38a8b1,_0x25d033){_0x25d033=_0x25d033||0x1f4;return function(_0x2cccd7){logger[_0x5eda('0x24')](_0x2cccd7[_0x5eda('0x25')]);if(_0x2cccd7[_0x5eda('0x26')]){delete _0x2cccd7['name'];}_0x38a8b1[_0x5eda('0x18')](_0x25d033)[_0x5eda('0x27')](_0x2cccd7);};}exports[_0x5eda('0x28')]=function(_0x54a057,_0x1d0892){var _0x2401dc={},_0x6003c6={},_0x756af1={'count':0x0,'rows':[]};var _0x3055a0=db['MailServerOut']['rawAttributes'];_0x6003c6['model']=_[_0x5eda('0x29')](_0x3055a0);_0x6003c6[_0x5eda('0x2a')]=_[_0x5eda('0x29')](_0x54a057[_0x5eda('0x2a')]);_0x6003c6[_0x5eda('0x2b')]=_['intersection'](_0x6003c6[_0x5eda('0x2c')],_0x6003c6[_0x5eda('0x2a')]);_0x2401dc[_0x5eda('0x2d')]=_[_0x5eda('0x2e')](_0x6003c6[_0x5eda('0x2c')],qs[_0x5eda('0x2f')](_0x54a057[_0x5eda('0x2a')][_0x5eda('0x2f')]));_0x2401dc['attributes']=_0x2401dc[_0x5eda('0x2d')][_0x5eda('0x30')]?_0x2401dc['attributes']:_0x6003c6[_0x5eda('0x2c')];if(!_0x54a057['query']['hasOwnProperty'](_0x5eda('0x31'))){_0x2401dc[_0x5eda('0x32')]=qs[_0x5eda('0x32')](_0x54a057[_0x5eda('0x2a')][_0x5eda('0x32')]);_0x2401dc[_0x5eda('0x1c')]=qs['offset'](_0x54a057[_0x5eda('0x2a')][_0x5eda('0x1c')]);}_0x2401dc[_0x5eda('0x33')]=qs['sort'](_0x54a057[_0x5eda('0x2a')][_0x5eda('0x34')]);_0x2401dc[_0x5eda('0x35')]=qs[_0x5eda('0x2b')](_[_0x5eda('0x36')](_0x54a057[_0x5eda('0x2a')],_0x6003c6[_0x5eda('0x2b')]));if(_0x54a057['query']['filter']){_0x2401dc[_0x5eda('0x35')]=_['merge'](_0x2401dc['where'],{'$or':_['map'](_0x3055a0,function(_0x5c609a){if(_0x5c609a['type'][_0x5eda('0x37')]!==_0x5eda('0x38')){var _0x4bcbc2={};_0x4bcbc2[_0x5c609a[_0x5eda('0x39')]]={'$like':'%'+_0x54a057[_0x5eda('0x2a')][_0x5eda('0x3a')]+'%'};return _0x4bcbc2;}})});}_0x2401dc=_[_0x5eda('0x3b')]({},_0x2401dc,_0x54a057[_0x5eda('0x3c')]);var _0x1ee183={'where':_0x2401dc[_0x5eda('0x35')]};return db[_0x5eda('0x3d')]['count'](_0x1ee183)[_0x5eda('0x22')](function(_0x479568){_0x756af1[_0x5eda('0x1b')]=_0x479568;if(_0x54a057[_0x5eda('0x2a')][_0x5eda('0x3e')]){_0x2401dc['include']=[{'all':!![]}];}return db[_0x5eda('0x3d')][_0x5eda('0x3f')](_0x2401dc);})[_0x5eda('0x22')](function(_0x2c86f6){_0x756af1[_0x5eda('0x40')]=_0x2c86f6;return _0x756af1;})[_0x5eda('0x22')](respondWithFilteredResult(_0x1d0892,_0x2401dc))[_0x5eda('0x41')](handleError(_0x1d0892,null));};exports[_0x5eda('0x42')]=function(_0x5c70d6,_0x13544e){var _0x1359db={'raw':!![],'where':{'id':_0x5c70d6[_0x5eda('0x43')]['id']}},_0x132493={};_0x132493[_0x5eda('0x2c')]=_[_0x5eda('0x29')](db[_0x5eda('0x3d')][_0x5eda('0x44')]);_0x132493[_0x5eda('0x2a')]=_[_0x5eda('0x29')](_0x5c70d6[_0x5eda('0x2a')]);_0x132493[_0x5eda('0x2b')]=_[_0x5eda('0x2e')](_0x132493[_0x5eda('0x2c')],_0x132493['query']);_0x1359db[_0x5eda('0x2d')]=_[_0x5eda('0x2e')](_0x132493[_0x5eda('0x2c')],qs['fields'](_0x5c70d6[_0x5eda('0x2a')][_0x5eda('0x2f')]));_0x1359db[_0x5eda('0x2d')]=_0x1359db[_0x5eda('0x2d')][_0x5eda('0x30')]?_0x1359db[_0x5eda('0x2d')]:_0x132493['model'];if(_0x5c70d6[_0x5eda('0x2a')][_0x5eda('0x3e')]){_0x1359db['include']=[{'all':!![]}];}_0x1359db=_[_0x5eda('0x3b')]({},_0x1359db,_0x5c70d6['options']);return db[_0x5eda('0x3d')][_0x5eda('0x45')](_0x1359db)['then'](handleEntityNotFound(_0x13544e,null))[_0x5eda('0x22')](respondWithResult(_0x13544e,null))[_0x5eda('0x41')](handleError(_0x13544e,null));};exports[_0x5eda('0x46')]=function(_0x10f0e5,_0x50ed9a){return db[_0x5eda('0x3d')][_0x5eda('0x46')](_0x10f0e5[_0x5eda('0x47')],{})[_0x5eda('0x22')](respondWithResult(_0x50ed9a,0xc9))['catch'](handleError(_0x50ed9a,null));};exports['update']=function(_0x2804ff,_0x5980fe){if(_0x2804ff[_0x5eda('0x47')]['id']){delete _0x2804ff[_0x5eda('0x47')]['id'];}return db[_0x5eda('0x3d')][_0x5eda('0x45')]({'where':{'id':_0x2804ff[_0x5eda('0x43')]['id']}})[_0x5eda('0x22')](handleEntityNotFound(_0x5980fe,null))['then'](saveUpdates(_0x2804ff[_0x5eda('0x47')],null))['then'](respondWithResult(_0x5980fe,null))[_0x5eda('0x41')](handleError(_0x5980fe,null));};exports[_0x5eda('0x48')]=function(_0x1d76f6,_0x4be1ac){return db[_0x5eda('0x3d')]['find']({'where':{'id':_0x1d76f6['params']['id']}})[_0x5eda('0x22')](handleEntityNotFound(_0x4be1ac,null))[_0x5eda('0x22')](removeEntity(_0x4be1ac,null))[_0x5eda('0x41')](handleError(_0x4be1ac,null));}; \ No newline at end of file +var _0x4284=['../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','reject','save','update','then','destroy','error','stack','name','MailServerOut','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','count','include','findAll','catch','show','params','fields','length','includeAll','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xe90614,_0x19ea29){var _0x3f3f85=function(_0x330852){while(--_0x330852){_0xe90614['push'](_0xe90614['shift']());}};_0x3f3f85(++_0x19ea29);}(_0x4284,0x10b));var _0x4428=function(_0x75a965,_0x5f44ec){_0x75a965=_0x75a965-0x0;var _0x5d2524=_0x4284[_0x75a965];return _0x5d2524;};'use strict';var pdf=require(_0x4428('0x0'));var emlformat=require(_0x4428('0x1'));var rimraf=require(_0x4428('0x2'));var zipdir=require(_0x4428('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4428('0x4'));var moment=require(_0x4428('0x5'));var BPromise=require(_0x4428('0x6'));var Mustache=require(_0x4428('0x7'));var util=require(_0x4428('0x8'));var path=require(_0x4428('0x9'));var sox=require(_0x4428('0xa'));var csv=require('to-csv');var ejs=require(_0x4428('0xb'));var fs=require('fs');var _=require(_0x4428('0xc'));var squel=require(_0x4428('0xd'));var crypto=require(_0x4428('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4428('0xf'));var toCsv=require(_0x4428('0x10'));var querystring=require(_0x4428('0x11'));var Papa=require('papaparse');var Redis=require(_0x4428('0x12'));var authService=require(_0x4428('0x13'));var qs=require(_0x4428('0x14'));var hardwareService=require(_0x4428('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4428('0x16'));var db=require(_0x4428('0x17'))['db'];function respondWithStatusCode(_0x15d745,_0x2d1f57){_0x2d1f57=_0x2d1f57||0xcc;return function(_0x2110f5){if(_0x2110f5){return _0x15d745[_0x4428('0x18')](_0x2d1f57);}return _0x15d745[_0x4428('0x19')](_0x2d1f57)[_0x4428('0x1a')]();};}function respondWithResult(_0x521f50,_0x53d014){_0x53d014=_0x53d014||0xc8;return function(_0x56c5df){if(_0x56c5df){return _0x521f50[_0x4428('0x19')](_0x53d014)['json'](_0x56c5df);}};}function respondWithFilteredResult(_0x254e8f,_0x29dee7){return function(_0x259efd){if(_0x259efd){var _0x169880=_0x259efd['count'],_0x5b16fe=_0x29dee7[_0x4428('0x1b')],_0x3d02ff=_0x29dee7[_0x4428('0x1b')]+_0x29dee7[_0x4428('0x1c')],_0x477b91;if(_0x3d02ff>=_0x169880){_0x3d02ff=_0x169880;_0x477b91=0xc8;}else{_0x477b91=0xce;}_0x254e8f['status'](_0x477b91);return _0x254e8f[_0x4428('0x1d')]('Content-Range',_0x5b16fe+'-'+_0x3d02ff+'/'+_0x169880)[_0x4428('0x1e')](_0x259efd);}return null;};}function patchUpdates(_0x51aad6){return function(_0x3a158a){try{jsonpatch['apply'](_0x3a158a,_0x51aad6,!![]);}catch(_0x261152){return BPromise[_0x4428('0x1f')](_0x261152);}return _0x3a158a[_0x4428('0x20')]();};}function saveUpdates(_0x3ee518,_0x3b38ab){return function(_0x753264){if(_0x753264){return _0x753264[_0x4428('0x21')](_0x3ee518)[_0x4428('0x22')](function(_0x196d90){return _0x196d90;});}return null;};}function removeEntity(_0x5cc541,_0x7dc1ba){return function(_0x53f236){if(_0x53f236){return _0x53f236[_0x4428('0x23')]()[_0x4428('0x22')](function(){_0x5cc541[_0x4428('0x19')](0xcc)[_0x4428('0x1a')]();});}};}function handleEntityNotFound(_0x2c645b,_0xa505e0){return function(_0x550347){if(!_0x550347){_0x2c645b[_0x4428('0x18')](0x194);}return _0x550347;};}function handleError(_0x2dc05b,_0x1ac55d){_0x1ac55d=_0x1ac55d||0x1f4;return function(_0x25e89e){logger[_0x4428('0x24')](_0x25e89e[_0x4428('0x25')]);if(_0x25e89e[_0x4428('0x26')]){delete _0x25e89e[_0x4428('0x26')];}_0x2dc05b['status'](_0x1ac55d)['send'](_0x25e89e);};}exports['index']=function(_0x13faf1,_0x186593){var _0x129b50={},_0x50b92e={},_0x137d11={'count':0x0,'rows':[]};var _0x4167f2=db[_0x4428('0x27')][_0x4428('0x28')];_0x50b92e[_0x4428('0x29')]=_[_0x4428('0x2a')](_0x4167f2);_0x50b92e[_0x4428('0x2b')]=_[_0x4428('0x2a')](_0x13faf1[_0x4428('0x2b')]);_0x50b92e['filters']=_[_0x4428('0x2c')](_0x50b92e[_0x4428('0x29')],_0x50b92e[_0x4428('0x2b')]);_0x129b50['attributes']=_['intersection'](_0x50b92e[_0x4428('0x29')],qs['fields'](_0x13faf1['query']['fields']));_0x129b50[_0x4428('0x2d')]=_0x129b50['attributes']['length']?_0x129b50[_0x4428('0x2d')]:_0x50b92e['model'];if(!_0x13faf1[_0x4428('0x2b')][_0x4428('0x2e')](_0x4428('0x2f'))){_0x129b50[_0x4428('0x1c')]=qs['limit'](_0x13faf1[_0x4428('0x2b')][_0x4428('0x1c')]);_0x129b50[_0x4428('0x1b')]=qs[_0x4428('0x1b')](_0x13faf1[_0x4428('0x2b')][_0x4428('0x1b')]);}_0x129b50[_0x4428('0x30')]=qs[_0x4428('0x31')](_0x13faf1[_0x4428('0x2b')]['sort']);_0x129b50[_0x4428('0x32')]=qs[_0x4428('0x33')](_[_0x4428('0x34')](_0x13faf1['query'],_0x50b92e[_0x4428('0x33')]));if(_0x13faf1[_0x4428('0x2b')][_0x4428('0x35')]){_0x129b50[_0x4428('0x32')]=_[_0x4428('0x36')](_0x129b50[_0x4428('0x32')],{'$or':_[_0x4428('0x37')](_0x4167f2,function(_0x1f17a7){if(_0x1f17a7[_0x4428('0x38')][_0x4428('0x39')]!==_0x4428('0x3a')){var _0x391c42={};_0x391c42[_0x1f17a7['field']]={'$like':'%'+_0x13faf1[_0x4428('0x2b')][_0x4428('0x35')]+'%'};return _0x391c42;}})});}_0x129b50=_[_0x4428('0x36')]({},_0x129b50,_0x13faf1['options']);var _0x1790cb={'where':_0x129b50[_0x4428('0x32')]};return db['MailServerOut'][_0x4428('0x3b')](_0x1790cb)[_0x4428('0x22')](function(_0x201845){_0x137d11[_0x4428('0x3b')]=_0x201845;if(_0x13faf1[_0x4428('0x2b')]['includeAll']){_0x129b50[_0x4428('0x3c')]=[{'all':!![]}];}return db[_0x4428('0x27')][_0x4428('0x3d')](_0x129b50);})[_0x4428('0x22')](function(_0x3d331b){_0x137d11['rows']=_0x3d331b;return _0x137d11;})[_0x4428('0x22')](respondWithFilteredResult(_0x186593,_0x129b50))[_0x4428('0x3e')](handleError(_0x186593,null));};exports[_0x4428('0x3f')]=function(_0x5d692c,_0x4e0b79){var _0x2502f4={'raw':!![],'where':{'id':_0x5d692c[_0x4428('0x40')]['id']}},_0xcaac0a={};_0xcaac0a[_0x4428('0x29')]=_[_0x4428('0x2a')](db[_0x4428('0x27')][_0x4428('0x28')]);_0xcaac0a[_0x4428('0x2b')]=_[_0x4428('0x2a')](_0x5d692c[_0x4428('0x2b')]);_0xcaac0a[_0x4428('0x33')]=_[_0x4428('0x2c')](_0xcaac0a[_0x4428('0x29')],_0xcaac0a[_0x4428('0x2b')]);_0x2502f4['attributes']=_[_0x4428('0x2c')](_0xcaac0a[_0x4428('0x29')],qs[_0x4428('0x41')](_0x5d692c[_0x4428('0x2b')][_0x4428('0x41')]));_0x2502f4[_0x4428('0x2d')]=_0x2502f4[_0x4428('0x2d')][_0x4428('0x42')]?_0x2502f4[_0x4428('0x2d')]:_0xcaac0a['model'];if(_0x5d692c[_0x4428('0x2b')][_0x4428('0x43')]){_0x2502f4[_0x4428('0x3c')]=[{'all':!![]}];}_0x2502f4=_[_0x4428('0x36')]({},_0x2502f4,_0x5d692c[_0x4428('0x44')]);return db[_0x4428('0x27')]['find'](_0x2502f4)['then'](handleEntityNotFound(_0x4e0b79,null))['then'](respondWithResult(_0x4e0b79,null))[_0x4428('0x3e')](handleError(_0x4e0b79,null));};exports['create']=function(_0x590bf9,_0x1ec968){return db[_0x4428('0x27')][_0x4428('0x45')](_0x590bf9[_0x4428('0x46')],{})['then'](respondWithResult(_0x1ec968,0xc9))[_0x4428('0x3e')](handleError(_0x1ec968,null));};exports['update']=function(_0x6c598b,_0x540756){if(_0x6c598b[_0x4428('0x46')]['id']){delete _0x6c598b[_0x4428('0x46')]['id'];}return db[_0x4428('0x27')][_0x4428('0x47')]({'where':{'id':_0x6c598b[_0x4428('0x40')]['id']}})[_0x4428('0x22')](handleEntityNotFound(_0x540756,null))[_0x4428('0x22')](saveUpdates(_0x6c598b[_0x4428('0x46')],null))[_0x4428('0x22')](respondWithResult(_0x540756,null))['catch'](handleError(_0x540756,null));};exports[_0x4428('0x23')]=function(_0x24164a,_0x7216d5){return db[_0x4428('0x27')][_0x4428('0x47')]({'where':{'id':_0x24164a[_0x4428('0x40')]['id']}})[_0x4428('0x22')](handleEntityNotFound(_0x7216d5,null))['then'](removeEntity(_0x7216d5,null))[_0x4428('0x3e')](handleError(_0x7216d5,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d15aec0..c5b5383 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 _0x3423=['MailServerOut','mail_servers_out','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x3e0dec,_0xd5c828){var _0x23b75c=function(_0x4521a4){while(--_0x4521a4){_0x3e0dec['push'](_0x3e0dec['shift']());}};_0x23b75c(++_0xd5c828);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb688=['exports','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x2b03eb,_0x2f730){var _0x469123=function(_0x450f8c){while(--_0x450f8c){_0x2b03eb['push'](_0x2b03eb['shift']());}};_0x469123(++_0x2f730);}(_0xb688,0xcf));var _0x8b68=function(_0x5a45d2,_0x2311da){_0x5a45d2=_0x5a45d2-0x0;var _0x346e58=_0xb688[_0x5a45d2];return _0x346e58;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index ad77ac7..a4b9a63 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 _0xf9ef=['../../config/logger','../../config/environment','jayson/promise','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4bdcdf,_0x89bb87){var _0x5f42ee=function(_0x52f546){while(--_0x52f546){_0x4bdcdf['push'](_0x4bdcdf['shift']());}};_0x5f42ee(++_0x89bb87);}(_0xf9ef,0x12f));var _0xff9e=function(_0x5aa933,_0x356602){_0x5aa933=_0x5aa933-0x0;var _0x5ea0ec=_0xf9ef[_0x5aa933];return _0x5ea0ec;};'use strict';var _=require(_0xff9e('0x0'));var util=require('util');var moment=require(_0xff9e('0x1'));var BPromise=require('bluebird');var rs=require(_0xff9e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff9e('0x3'))['db'];var utils=require(_0xff9e('0x4'));var logger=require(_0xff9e('0x5'))('rpc');var config=require(_0xff9e('0x6'));var jayson=require(_0xff9e('0x7'));var client=jayson['client'][_0xff9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17ca6e,_0x5750e7,_0x43ef33){return new BPromise(function(_0x34b6e8,_0x37b8fe){return client[_0xff9e('0x9')](_0x17ca6e,_0x43ef33)[_0xff9e('0xa')](function(_0x19101e){logger['info'](_0xff9e('0xb'),_0x5750e7,_0xff9e('0xc'));logger[_0xff9e('0xd')](_0xff9e('0xe'),_0x5750e7,_0xff9e('0xc'),JSON[_0xff9e('0xf')](_0x19101e));if(_0x19101e['error']){if(_0x19101e[_0xff9e('0x10')][_0xff9e('0x11')]===0x1f4){logger[_0xff9e('0x10')](_0xff9e('0xb'),_0x5750e7,_0x19101e[_0xff9e('0x10')][_0xff9e('0x12')]);return _0x37b8fe(_0x19101e[_0xff9e('0x10')][_0xff9e('0x12')]);}logger['error'](_0xff9e('0xb'),_0x5750e7,_0x19101e[_0xff9e('0x10')][_0xff9e('0x12')]);return _0x34b6e8(_0x19101e[_0xff9e('0x10')][_0xff9e('0x12')]);}else{logger[_0xff9e('0x13')](_0xff9e('0xb'),_0x5750e7,_0xff9e('0xc'));_0x34b6e8(_0x19101e[_0xff9e('0x14')][_0xff9e('0x12')]);}})[_0xff9e('0x15')](function(_0x4e3e86){logger['error'](_0xff9e('0xb'),_0x5750e7,_0x4e3e86);_0x37b8fe(_0x4e3e86);});});} \ No newline at end of file +var _0xdb84=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','MailServerOut,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2eee25,_0x53460d){var _0x1cb8c4=function(_0x4dad56){while(--_0x4dad56){_0x2eee25['push'](_0x2eee25['shift']());}};_0x1cb8c4(++_0x53460d);}(_0xdb84,0x194));var _0x4db8=function(_0x2de5fa,_0x2404a8){_0x2de5fa=_0x2de5fa-0x0;var _0x5262cf=_0xdb84[_0x2de5fa];return _0x5262cf;};'use strict';var _=require(_0x4db8('0x0'));var util=require(_0x4db8('0x1'));var moment=require(_0x4db8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4db8('0x3'));var fs=require('fs');var Redis=require(_0x4db8('0x4'));var db=require(_0x4db8('0x5'))['db'];var utils=require(_0x4db8('0x6'));var logger=require('../../config/logger')(_0x4db8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4db8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x359d3f,_0x4e634b,_0x5642f7){return new BPromise(function(_0x417d4f,_0x15f927){return client['request'](_0x359d3f,_0x5642f7)[_0x4db8('0x9')](function(_0x371be8){logger[_0x4db8('0xa')](_0x4db8('0xb'),_0x4e634b,'request\x20sent');logger[_0x4db8('0xc')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4e634b,_0x4db8('0xd'),JSON[_0x4db8('0xe')](_0x371be8));if(_0x371be8['error']){if(_0x371be8[_0x4db8('0xf')][_0x4db8('0x10')]===0x1f4){logger[_0x4db8('0xf')](_0x4db8('0xb'),_0x4e634b,_0x371be8['error'][_0x4db8('0x11')]);return _0x15f927(_0x371be8[_0x4db8('0xf')]['message']);}logger[_0x4db8('0xf')](_0x4db8('0xb'),_0x4e634b,_0x371be8[_0x4db8('0xf')][_0x4db8('0x11')]);return _0x417d4f(_0x371be8[_0x4db8('0xf')][_0x4db8('0x11')]);}else{logger[_0x4db8('0xa')](_0x4db8('0xb'),_0x4e634b,'request\x20sent');_0x417d4f(_0x371be8[_0x4db8('0x12')][_0x4db8('0x11')]);}})[_0x4db8('0x13')](function(_0x5dd607){logger[_0x4db8('0xf')](_0x4db8('0xb'),_0x4e634b,_0x5dd607);_0x15f927(_0x5dd607);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index bcfa756..de27ad2 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 _0x861d=['exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','isAuthenticated','/:id','post','put','update','delete'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x861d,0x1b1));var _0xd861=function(_0x4e30bf,_0x5473ce){_0x4e30bf=_0x4e30bf-0x0;var _0x913fd4=_0x861d[_0x4e30bf];return _0x913fd4;};'use strict';var multer=require('multer');var util=require(_0xd861('0x0'));var path=require(_0xd861('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd861('0x2')]();var auth=require(_0xd861('0x3'));var interaction=require(_0xd861('0x4'));var config=require(_0xd861('0x5'));var controller=require(_0xd861('0x6'));router[_0xd861('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd861('0x7')](_0xd861('0x8'),auth[_0xd861('0x9')](),controller['describe']);router[_0xd861('0x7')](_0xd861('0xa'),auth[_0xd861('0x9')](),controller['show']);router[_0xd861('0xb')]('/',auth[_0xd861('0x9')](),controller['create']);router[_0xd861('0xc')](_0xd861('0xa'),auth[_0xd861('0x9')](),controller[_0xd861('0xd')]);router[_0xd861('0xe')]('/:id',auth[_0xd861('0x9')](),controller['destroy']);module[_0xd861('0xf')]=router; \ No newline at end of file +var _0xf26e=['show','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5121f8,_0x4c4dda){var _0x32be3f=function(_0x34b167){while(--_0x34b167){_0x5121f8['push'](_0x5121f8['shift']());}};_0x32be3f(++_0x4c4dda);}(_0xf26e,0x132));var _0xef26=function(_0x437b64,_0x4f34b9){_0x437b64=_0x437b64-0x0;var _0x479d45=_0xf26e[_0x437b64];return _0x479d45;};'use strict';var multer=require(_0xef26('0x0'));var util=require(_0xef26('0x1'));var path=require('path');var timeout=require(_0xef26('0x2'));var express=require(_0xef26('0x3'));var router=express[_0xef26('0x4')]();var auth=require(_0xef26('0x5'));var interaction=require(_0xef26('0x6'));var config=require('../../config/environment');var controller=require(_0xef26('0x7'));router[_0xef26('0x8')]('/',auth[_0xef26('0x9')](),controller[_0xef26('0xa')]);router[_0xef26('0x8')](_0xef26('0xb'),auth[_0xef26('0x9')](),controller[_0xef26('0xc')]);router[_0xef26('0x8')](_0xef26('0xd'),auth[_0xef26('0x9')](),controller[_0xef26('0xe')]);router[_0xef26('0xf')]('/',auth[_0xef26('0x9')](),controller['create']);router['put'](_0xef26('0xd'),auth[_0xef26('0x9')](),controller[_0xef26('0x10')]);router[_0xef26('0x11')](_0xef26('0xd'),auth['isAuthenticated'](),controller[_0xef26('0x12')]);module[_0xef26('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 82d805e..763e057 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 _0xc901=['sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc901,0x142));var _0x1c90=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc901[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbfcc=['sequelize','name','STRING'];(function(_0x163461,_0x67256){var _0x17583f=function(_0x2ecad4){while(--_0x2ecad4){_0x163461['push'](_0x163461['shift']());}};_0x17583f(++_0x67256);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0xbfcc[_0xad57ee];return _0x3eaea9;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcbfc('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcbfc('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2cc17c7..b65a82a 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 _0xd0dc=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','html-pdf','eml-format','rimraf','request-promise'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd0dc,0x1b8));var _0xcd0d=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0xd0dc[_0x4a1353];return _0x3805cc;};'use strict';var pdf=require(_0xcd0d('0x0'));var emlformat=require(_0xcd0d('0x1'));var rimraf=require(_0xcd0d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd0d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd0d('0x4'));var util=require(_0xcd0d('0x5'));var path=require(_0xcd0d('0x6'));var sox=require(_0xcd0d('0x7'));var csv=require(_0xcd0d('0x8'));var ejs=require(_0xcd0d('0x9'));var fs=require('fs');var _=require(_0xcd0d('0xa'));var squel=require(_0xcd0d('0xb'));var crypto=require(_0xcd0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcd0d('0xd'));var toCsv=require(_0xcd0d('0x8'));var querystring=require(_0xcd0d('0xe'));var Papa=require(_0xcd0d('0xf'));var Redis=require(_0xcd0d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcd0d('0x11'));var hardwareService=require(_0xcd0d('0x12'));var logger=require(_0xcd0d('0x13'))(_0xcd0d('0x14'));var utils=require(_0xcd0d('0x15'));var config=require(_0xcd0d('0x16'));var db=require(_0xcd0d('0x17'))['db'];function respondWithStatusCode(_0x259752,_0x18a89e){_0x18a89e=_0x18a89e||0xcc;return function(_0x2fae6e){if(_0x2fae6e){return _0x259752[_0xcd0d('0x18')](_0x18a89e);}return _0x259752[_0xcd0d('0x19')](_0x18a89e)[_0xcd0d('0x1a')]();};}function respondWithResult(_0x8281c6,_0x597828){_0x597828=_0x597828||0xc8;return function(_0x416410){if(_0x416410){return _0x8281c6['status'](_0x597828)[_0xcd0d('0x1b')](_0x416410);}};}function respondWithFilteredResult(_0xedcf1,_0x5c8839){return function(_0x5d6b73){if(_0x5d6b73){var _0x50b55d=_0x5d6b73['count'],_0x9c8f4d=_0x5c8839['offset'],_0x510765=_0x5c8839[_0xcd0d('0x1c')]+_0x5c8839[_0xcd0d('0x1d')],_0x138983;if(_0x510765>=_0x50b55d){_0x510765=_0x50b55d;_0x138983=0xc8;}else{_0x138983=0xce;}_0xedcf1[_0xcd0d('0x19')](_0x138983);return _0xedcf1[_0xcd0d('0x1e')](_0xcd0d('0x1f'),_0x9c8f4d+'-'+_0x510765+'/'+_0x50b55d)[_0xcd0d('0x1b')](_0x5d6b73);}return null;};}function patchUpdates(_0x48f769){return function(_0x5c3e83){try{jsonpatch[_0xcd0d('0x20')](_0x5c3e83,_0x48f769,!![]);}catch(_0x52c319){return BPromise['reject'](_0x52c319);}return _0x5c3e83[_0xcd0d('0x21')]();};}function saveUpdates(_0xafb76c,_0x1dc33a){return function(_0x1bd269){if(_0x1bd269){return _0x1bd269[_0xcd0d('0x22')](_0xafb76c)[_0xcd0d('0x23')](function(_0x409d13){return _0x409d13;});}return null;};}function removeEntity(_0x422f02,_0x156592){return function(_0x443479){if(_0x443479){return _0x443479[_0xcd0d('0x24')]()['then'](function(){_0x422f02[_0xcd0d('0x19')](0xcc)[_0xcd0d('0x1a')]();});}};}function handleEntityNotFound(_0x15f9d6,_0x544fc3){return function(_0x440a37){if(!_0x440a37){_0x15f9d6['sendStatus'](0x194);}return _0x440a37;};}function handleError(_0x14e834,_0x4aba08){_0x4aba08=_0x4aba08||0x1f4;return function(_0x1dc377){logger[_0xcd0d('0x25')](_0x1dc377[_0xcd0d('0x26')]);if(_0x1dc377[_0xcd0d('0x27')]){delete _0x1dc377['name'];}_0x14e834['status'](_0x4aba08)[_0xcd0d('0x28')](_0x1dc377);};}exports[_0xcd0d('0x29')]=function(_0x262de6,_0x428162){var _0x3144e9={},_0x320927={},_0x2b2d00={'count':0x0,'rows':[]};var _0x5acb33=db[_0xcd0d('0x2a')][_0xcd0d('0x2b')];_0x320927[_0xcd0d('0x2c')]=_[_0xcd0d('0x2d')](_0x5acb33);_0x320927[_0xcd0d('0x2e')]=_[_0xcd0d('0x2d')](_0x262de6['query']);_0x320927[_0xcd0d('0x2f')]=_[_0xcd0d('0x30')](_0x320927[_0xcd0d('0x2c')],_0x320927[_0xcd0d('0x2e')]);_0x3144e9[_0xcd0d('0x31')]=_[_0xcd0d('0x30')](_0x320927['model'],qs[_0xcd0d('0x32')](_0x262de6[_0xcd0d('0x2e')][_0xcd0d('0x32')]));_0x3144e9[_0xcd0d('0x31')]=_0x3144e9[_0xcd0d('0x31')][_0xcd0d('0x33')]?_0x3144e9[_0xcd0d('0x31')]:_0x320927['model'];if(!_0x262de6['query']['hasOwnProperty']('nolimit')){_0x3144e9[_0xcd0d('0x1d')]=qs[_0xcd0d('0x1d')](_0x262de6['query'][_0xcd0d('0x1d')]);_0x3144e9[_0xcd0d('0x1c')]=qs[_0xcd0d('0x1c')](_0x262de6['query']['offset']);}_0x3144e9[_0xcd0d('0x34')]=qs[_0xcd0d('0x35')](_0x262de6[_0xcd0d('0x2e')][_0xcd0d('0x35')]);_0x3144e9[_0xcd0d('0x36')]=qs[_0xcd0d('0x2f')](_['pick'](_0x262de6['query'],_0x320927[_0xcd0d('0x2f')]));if(_0x262de6['query']['filter']){_0x3144e9['where']=_['merge'](_0x3144e9['where'],{'$or':_['map'](_0x5acb33,function(_0x23b4a7){if(_0x23b4a7[_0xcd0d('0x37')][_0xcd0d('0x38')]!==_0xcd0d('0x39')){var _0x5b9e18={};_0x5b9e18[_0x23b4a7[_0xcd0d('0x3a')]]={'$like':'%'+_0x262de6[_0xcd0d('0x2e')][_0xcd0d('0x3b')]+'%'};return _0x5b9e18;}})});}_0x3144e9=_[_0xcd0d('0x3c')]({},_0x3144e9,_0x262de6[_0xcd0d('0x3d')]);var _0x27e2ce={'where':_0x3144e9[_0xcd0d('0x36')]};return db[_0xcd0d('0x2a')][_0xcd0d('0x3e')](_0x27e2ce)[_0xcd0d('0x23')](function(_0x4e653a){_0x2b2d00[_0xcd0d('0x3e')]=_0x4e653a;if(_0x262de6['query'][_0xcd0d('0x3f')]){_0x3144e9['include']=[{'all':!![]}];}return db[_0xcd0d('0x2a')][_0xcd0d('0x40')](_0x3144e9);})[_0xcd0d('0x23')](function(_0x1e1040){_0x2b2d00[_0xcd0d('0x41')]=_0x1e1040;return _0x2b2d00;})['then'](respondWithFilteredResult(_0x428162,_0x3144e9))[_0xcd0d('0x42')](handleError(_0x428162,null));};exports[_0xcd0d('0x43')]=function(_0x5d60f3,_0x3ae50a){var _0x413885={'raw':!![],'where':{'id':_0x5d60f3[_0xcd0d('0x44')]['id']}},_0x7375cd={};_0x7375cd[_0xcd0d('0x2c')]=_[_0xcd0d('0x2d')](db[_0xcd0d('0x2a')][_0xcd0d('0x2b')]);_0x7375cd[_0xcd0d('0x2e')]=_['keys'](_0x5d60f3[_0xcd0d('0x2e')]);_0x7375cd[_0xcd0d('0x2f')]=_[_0xcd0d('0x30')](_0x7375cd['model'],_0x7375cd['query']);_0x413885[_0xcd0d('0x31')]=_[_0xcd0d('0x30')](_0x7375cd[_0xcd0d('0x2c')],qs[_0xcd0d('0x32')](_0x5d60f3[_0xcd0d('0x2e')][_0xcd0d('0x32')]));_0x413885[_0xcd0d('0x31')]=_0x413885['attributes'][_0xcd0d('0x33')]?_0x413885[_0xcd0d('0x31')]:_0x7375cd[_0xcd0d('0x2c')];if(_0x5d60f3[_0xcd0d('0x2e')][_0xcd0d('0x3f')]){_0x413885[_0xcd0d('0x45')]=[{'all':!![]}];}_0x413885=_[_0xcd0d('0x3c')]({},_0x413885,_0x5d60f3[_0xcd0d('0x3d')]);return db[_0xcd0d('0x2a')]['find'](_0x413885)[_0xcd0d('0x23')](handleEntityNotFound(_0x3ae50a,null))[_0xcd0d('0x23')](respondWithResult(_0x3ae50a,null))[_0xcd0d('0x42')](handleError(_0x3ae50a,null));};exports[_0xcd0d('0x46')]=function(_0x1ed068,_0x34eac9){return db[_0xcd0d('0x2a')][_0xcd0d('0x46')](_0x1ed068['body'],{})[_0xcd0d('0x23')](respondWithResult(_0x34eac9,0xc9))[_0xcd0d('0x42')](handleError(_0x34eac9,null));};exports[_0xcd0d('0x22')]=function(_0x5dfc36,_0x1f4b6d){if(_0x5dfc36['body']['id']){delete _0x5dfc36[_0xcd0d('0x47')]['id'];}return db[_0xcd0d('0x2a')][_0xcd0d('0x48')]({'where':{'id':_0x5dfc36[_0xcd0d('0x44')]['id']}})[_0xcd0d('0x23')](handleEntityNotFound(_0x1f4b6d,null))[_0xcd0d('0x23')](saveUpdates(_0x5dfc36[_0xcd0d('0x47')],null))[_0xcd0d('0x23')](respondWithResult(_0x1f4b6d,null))[_0xcd0d('0x42')](handleError(_0x1f4b6d,null));};exports['destroy']=function(_0x52d30b,_0x31c096){return db[_0xcd0d('0x2a')][_0xcd0d('0x48')]({'where':{'id':_0x52d30b[_0xcd0d('0x44')]['id']}})[_0xcd0d('0x23')](handleEntityNotFound(_0x31c096,null))[_0xcd0d('0x23')](removeEntity(_0x31c096,null))[_0xcd0d('0x42')](handleError(_0x31c096,null));};exports[_0xcd0d('0x49')]=function(_0xd34458,_0xb381d2){return db[_0xcd0d('0x2a')][_0xcd0d('0x49')]()[_0xcd0d('0x23')](respondWithResult(_0xb381d2,null))[_0xcd0d('0x42')](handleError(_0xb381d2,null));}; \ No newline at end of file +var _0xec84=['sendStatus','status','json','count','offset','limit','Content-Range','save','then','destroy','end','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','include','rows','catch','show','filters','includeAll','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0xec84,0x1cd));var _0x4ec8=function(_0x5baee9,_0x29df17){_0x5baee9=_0x5baee9-0x0;var _0x27c2ba=_0xec84[_0x5baee9];return _0x27c2ba;};'use strict';var pdf=require(_0x4ec8('0x0'));var emlformat=require(_0x4ec8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4ec8('0x2'));var jsonpatch=require(_0x4ec8('0x3'));var rp=require(_0x4ec8('0x4'));var moment=require('moment');var BPromise=require(_0x4ec8('0x5'));var Mustache=require(_0x4ec8('0x6'));var util=require('util');var path=require(_0x4ec8('0x7'));var sox=require(_0x4ec8('0x8'));var csv=require(_0x4ec8('0x9'));var ejs=require(_0x4ec8('0xa'));var fs=require('fs');var _=require(_0x4ec8('0xb'));var squel=require(_0x4ec8('0xc'));var crypto=require(_0x4ec8('0xd'));var jsforce=require(_0x4ec8('0xe'));var deskjs=require(_0x4ec8('0xf'));var toCsv=require(_0x4ec8('0x9'));var querystring=require(_0x4ec8('0x10'));var Papa=require(_0x4ec8('0x11'));var Redis=require(_0x4ec8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4ec8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ec8('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4ec8('0x15'))['db'];function respondWithStatusCode(_0x9bad05,_0x1cb429){_0x1cb429=_0x1cb429||0xcc;return function(_0x8fb37b){if(_0x8fb37b){return _0x9bad05[_0x4ec8('0x16')](_0x1cb429);}return _0x9bad05[_0x4ec8('0x17')](_0x1cb429)['end']();};}function respondWithResult(_0x24fbdc,_0x527fcd){_0x527fcd=_0x527fcd||0xc8;return function(_0x437016){if(_0x437016){return _0x24fbdc[_0x4ec8('0x17')](_0x527fcd)[_0x4ec8('0x18')](_0x437016);}};}function respondWithFilteredResult(_0x9a8fb6,_0x10713b){return function(_0x418830){if(_0x418830){var _0x390d89=_0x418830[_0x4ec8('0x19')],_0x50be80=_0x10713b[_0x4ec8('0x1a')],_0x32fc98=_0x10713b[_0x4ec8('0x1a')]+_0x10713b[_0x4ec8('0x1b')],_0x21b3d7;if(_0x32fc98>=_0x390d89){_0x32fc98=_0x390d89;_0x21b3d7=0xc8;}else{_0x21b3d7=0xce;}_0x9a8fb6[_0x4ec8('0x17')](_0x21b3d7);return _0x9a8fb6['set'](_0x4ec8('0x1c'),_0x50be80+'-'+_0x32fc98+'/'+_0x390d89)[_0x4ec8('0x18')](_0x418830);}return null;};}function patchUpdates(_0x4d7075){return function(_0x1b0820){try{jsonpatch['apply'](_0x1b0820,_0x4d7075,!![]);}catch(_0x137ef7){return BPromise['reject'](_0x137ef7);}return _0x1b0820[_0x4ec8('0x1d')]();};}function saveUpdates(_0x525823,_0x9eda0a){return function(_0x303d20){if(_0x303d20){return _0x303d20['update'](_0x525823)[_0x4ec8('0x1e')](function(_0x5a324b){return _0x5a324b;});}return null;};}function removeEntity(_0x48b555,_0x22b2d1){return function(_0x6ef173){if(_0x6ef173){return _0x6ef173[_0x4ec8('0x1f')]()[_0x4ec8('0x1e')](function(){_0x48b555[_0x4ec8('0x17')](0xcc)[_0x4ec8('0x20')]();});}};}function handleEntityNotFound(_0x2e92e4,_0x320add){return function(_0x307a2e){if(!_0x307a2e){_0x2e92e4[_0x4ec8('0x16')](0x194);}return _0x307a2e;};}function handleError(_0x251ca5,_0x4a480c){_0x4a480c=_0x4a480c||0x1f4;return function(_0x2ba3d5){logger['error'](_0x2ba3d5[_0x4ec8('0x21')]);if(_0x2ba3d5['name']){delete _0x2ba3d5[_0x4ec8('0x22')];}_0x251ca5[_0x4ec8('0x17')](_0x4a480c)[_0x4ec8('0x23')](_0x2ba3d5);};}exports[_0x4ec8('0x24')]=function(_0x2fb3b4,_0x16bf54){var _0x3ac46e={},_0xe33d65={},_0x598fb9={'count':0x0,'rows':[]};var _0x229c02=db[_0x4ec8('0x25')][_0x4ec8('0x26')];_0xe33d65[_0x4ec8('0x27')]=_[_0x4ec8('0x28')](_0x229c02);_0xe33d65[_0x4ec8('0x29')]=_[_0x4ec8('0x28')](_0x2fb3b4[_0x4ec8('0x29')]);_0xe33d65['filters']=_[_0x4ec8('0x2a')](_0xe33d65['model'],_0xe33d65[_0x4ec8('0x29')]);_0x3ac46e['attributes']=_[_0x4ec8('0x2a')](_0xe33d65[_0x4ec8('0x27')],qs[_0x4ec8('0x2b')](_0x2fb3b4['query'][_0x4ec8('0x2b')]));_0x3ac46e[_0x4ec8('0x2c')]=_0x3ac46e[_0x4ec8('0x2c')][_0x4ec8('0x2d')]?_0x3ac46e['attributes']:_0xe33d65[_0x4ec8('0x27')];if(!_0x2fb3b4[_0x4ec8('0x29')][_0x4ec8('0x2e')](_0x4ec8('0x2f'))){_0x3ac46e[_0x4ec8('0x1b')]=qs['limit'](_0x2fb3b4[_0x4ec8('0x29')][_0x4ec8('0x1b')]);_0x3ac46e['offset']=qs['offset'](_0x2fb3b4[_0x4ec8('0x29')][_0x4ec8('0x1a')]);}_0x3ac46e[_0x4ec8('0x30')]=qs[_0x4ec8('0x31')](_0x2fb3b4['query'][_0x4ec8('0x31')]);_0x3ac46e[_0x4ec8('0x32')]=qs['filters'](_['pick'](_0x2fb3b4[_0x4ec8('0x29')],_0xe33d65['filters']));if(_0x2fb3b4[_0x4ec8('0x29')]['filter']){_0x3ac46e[_0x4ec8('0x32')]=_[_0x4ec8('0x33')](_0x3ac46e['where'],{'$or':_['map'](_0x229c02,function(_0x2b26eb){if(_0x2b26eb[_0x4ec8('0x34')][_0x4ec8('0x35')]!==_0x4ec8('0x36')){var _0x220292={};_0x220292[_0x2b26eb[_0x4ec8('0x37')]]={'$like':'%'+_0x2fb3b4[_0x4ec8('0x29')][_0x4ec8('0x38')]+'%'};return _0x220292;}})});}_0x3ac46e=_[_0x4ec8('0x33')]({},_0x3ac46e,_0x2fb3b4[_0x4ec8('0x39')]);var _0x241c93={'where':_0x3ac46e[_0x4ec8('0x32')]};return db[_0x4ec8('0x25')][_0x4ec8('0x19')](_0x241c93)[_0x4ec8('0x1e')](function(_0x45deae){_0x598fb9[_0x4ec8('0x19')]=_0x45deae;if(_0x2fb3b4[_0x4ec8('0x29')]['includeAll']){_0x3ac46e[_0x4ec8('0x3a')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x3ac46e);})[_0x4ec8('0x1e')](function(_0x3336f6){_0x598fb9[_0x4ec8('0x3b')]=_0x3336f6;return _0x598fb9;})[_0x4ec8('0x1e')](respondWithFilteredResult(_0x16bf54,_0x3ac46e))[_0x4ec8('0x3c')](handleError(_0x16bf54,null));};exports[_0x4ec8('0x3d')]=function(_0x520bb2,_0x435172){var _0xf6859d={'raw':!![],'where':{'id':_0x520bb2['params']['id']}},_0x12aaa6={};_0x12aaa6['model']=_[_0x4ec8('0x28')](db[_0x4ec8('0x25')][_0x4ec8('0x26')]);_0x12aaa6['query']=_[_0x4ec8('0x28')](_0x520bb2[_0x4ec8('0x29')]);_0x12aaa6[_0x4ec8('0x3e')]=_[_0x4ec8('0x2a')](_0x12aaa6[_0x4ec8('0x27')],_0x12aaa6[_0x4ec8('0x29')]);_0xf6859d[_0x4ec8('0x2c')]=_[_0x4ec8('0x2a')](_0x12aaa6[_0x4ec8('0x27')],qs[_0x4ec8('0x2b')](_0x520bb2[_0x4ec8('0x29')][_0x4ec8('0x2b')]));_0xf6859d[_0x4ec8('0x2c')]=_0xf6859d[_0x4ec8('0x2c')][_0x4ec8('0x2d')]?_0xf6859d[_0x4ec8('0x2c')]:_0x12aaa6[_0x4ec8('0x27')];if(_0x520bb2[_0x4ec8('0x29')][_0x4ec8('0x3f')]){_0xf6859d['include']=[{'all':!![]}];}_0xf6859d=_[_0x4ec8('0x33')]({},_0xf6859d,_0x520bb2[_0x4ec8('0x39')]);return db[_0x4ec8('0x25')][_0x4ec8('0x40')](_0xf6859d)['then'](handleEntityNotFound(_0x435172,null))[_0x4ec8('0x1e')](respondWithResult(_0x435172,null))[_0x4ec8('0x3c')](handleError(_0x435172,null));};exports[_0x4ec8('0x41')]=function(_0x44b382,_0xcd9c04){return db[_0x4ec8('0x25')]['create'](_0x44b382[_0x4ec8('0x42')],{})[_0x4ec8('0x1e')](respondWithResult(_0xcd9c04,0xc9))['catch'](handleError(_0xcd9c04,null));};exports['update']=function(_0x35c6b2,_0x1531b5){if(_0x35c6b2[_0x4ec8('0x42')]['id']){delete _0x35c6b2[_0x4ec8('0x42')]['id'];}return db[_0x4ec8('0x25')][_0x4ec8('0x40')]({'where':{'id':_0x35c6b2['params']['id']}})[_0x4ec8('0x1e')](handleEntityNotFound(_0x1531b5,null))[_0x4ec8('0x1e')](saveUpdates(_0x35c6b2[_0x4ec8('0x42')],null))[_0x4ec8('0x1e')](respondWithResult(_0x1531b5,null))[_0x4ec8('0x3c')](handleError(_0x1531b5,null));};exports['destroy']=function(_0x432268,_0x4617a1){return db[_0x4ec8('0x25')]['find']({'where':{'id':_0x432268[_0x4ec8('0x43')]['id']}})[_0x4ec8('0x1e')](handleEntityNotFound(_0x4617a1,null))[_0x4ec8('0x1e')](removeEntity(_0x4617a1,null))['catch'](handleError(_0x4617a1,null));};exports[_0x4ec8('0x44')]=function(_0x1f3c83,_0x23941b){return db['MailSubstatus'][_0x4ec8('0x44')]()[_0x4ec8('0x1e')](respondWithResult(_0x23941b,null))[_0x4ec8('0x3c')](handleError(_0x23941b,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 0cad5a8..87a8b6c 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 _0x8940=['path','../../config/environment','exports','define','mail_substatuses','lodash','util','api','request-promise'];(function(_0x25a92f,_0x352bf0){var _0x1e43fe=function(_0x467615){while(--_0x467615){_0x25a92f['push'](_0x25a92f['shift']());}};_0x1e43fe(++_0x352bf0);}(_0x8940,0x7a));var _0x0894=function(_0x209bb7,_0x1bbb5a){_0x209bb7=_0x209bb7-0x0;var _0x49075e=_0x8940[_0x209bb7];return _0x49075e;};'use strict';var _=require(_0x0894('0x0'));var util=require(_0x0894('0x1'));var logger=require('../../config/logger')(_0x0894('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0894('0x3'));var fs=require('fs');var path=require(_0x0894('0x4'));var rimraf=require('rimraf');var config=require(_0x0894('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0x0894('0x6')]=function(_0x47b818,_0x42591a){return _0x47b818[_0x0894('0x7')]('MailSubstatus',attributes,{'tableName':_0x0894('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6006=['define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./mailSubstatus.attributes','exports'];(function(_0x382339,_0x3a149b){var _0x3c0000=function(_0x53fdd1){while(--_0x53fdd1){_0x382339['push'](_0x382339['shift']());}};_0x3c0000(++_0x3a149b);}(_0x6006,0x189));var _0x6600=function(_0x31b723,_0x367cd0){_0x31b723=_0x31b723-0x0;var _0x445234=_0x6006[_0x31b723];return _0x445234;};'use strict';var _=require(_0x6600('0x0'));var util=require(_0x6600('0x1'));var logger=require(_0x6600('0x2'))(_0x6600('0x3'));var moment=require(_0x6600('0x4'));var BPromise=require(_0x6600('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6600('0x6'));var rimraf=require(_0x6600('0x7'));var config=require('../../config/environment');var attributes=require(_0x6600('0x8'));module[_0x6600('0x9')]=function(_0x103c89,_0x13d061){return _0x103c89[_0x6600('0xa')](_0x6600('0xb'),attributes,{'tableName':_0x6600('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1a29ee5..466de14 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 _0x5f70=['../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','MailSubstatus,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x4637f0,_0x30443d){var _0x2ef2ae=function(_0x43f829){while(--_0x43f829){_0x4637f0['push'](_0x4637f0['shift']());}};_0x2ef2ae(++_0x30443d);}(_0x5f70,0xf2));var _0x05f7=function(_0x50567b,_0xe52247){_0x50567b=_0x50567b-0x0;var _0x123b8b=_0x5f70[_0x50567b];return _0x123b8b;};'use strict';var _=require(_0x05f7('0x0'));var util=require(_0x05f7('0x1'));var moment=require(_0x05f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05f7('0x3'));var db=require(_0x05f7('0x4'))['db'];var utils=require(_0x05f7('0x5'));var logger=require('../../config/logger')(_0x05f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x05f7('0x7'));var client=jayson[_0x05f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1169,_0x178d7e,_0x57e2c7){return new BPromise(function(_0x4828e4,_0x4484ca){return client['request'](_0x3a1169,_0x57e2c7)[_0x05f7('0x9')](function(_0x344ce5){logger[_0x05f7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x178d7e,_0x05f7('0xb'));logger[_0x05f7('0xc')](_0x05f7('0xd'),_0x178d7e,_0x05f7('0xb'),JSON['stringify'](_0x344ce5));if(_0x344ce5[_0x05f7('0xe')]){if(_0x344ce5[_0x05f7('0xe')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x178d7e,_0x344ce5[_0x05f7('0xe')]['message']);return _0x4484ca(_0x344ce5['error'][_0x05f7('0xf')]);}logger['error'](_0x05f7('0x10'),_0x178d7e,_0x344ce5[_0x05f7('0xe')][_0x05f7('0xf')]);return _0x4828e4(_0x344ce5['error'][_0x05f7('0xf')]);}else{logger[_0x05f7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x178d7e,'request\x20sent');_0x4828e4(_0x344ce5[_0x05f7('0x11')][_0x05f7('0xf')]);}})[_0x05f7('0x12')](function(_0x1c056f){logger[_0x05f7('0xe')](_0x05f7('0x10'),_0x178d7e,_0x1c056f);_0x4484ca(_0x1c056f);});});} \ No newline at end of file +var _0xc79e=['../../config/environment','client','http','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3b8c97,_0x55e350){var _0x2d94e1=function(_0x3bcbd3){while(--_0x3bcbd3){_0x3b8c97['push'](_0x3b8c97['shift']());}};_0x2d94e1(++_0x55e350);}(_0xc79e,0x1ac));var _0xec79=function(_0xbf400c,_0x37e1e7){_0xbf400c=_0xbf400c-0x0;var _0x2ee697=_0xc79e[_0xbf400c];return _0x2ee697;};'use strict';var _=require(_0xec79('0x0'));var util=require(_0xec79('0x1'));var moment=require(_0xec79('0x2'));var BPromise=require(_0xec79('0x3'));var rs=require(_0xec79('0x4'));var fs=require('fs');var Redis=require(_0xec79('0x5'));var db=require(_0xec79('0x6'))['db'];var utils=require(_0xec79('0x7'));var logger=require('../../config/logger')(_0xec79('0x8'));var config=require(_0xec79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xec79('0xa')][_0xec79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5294fd,_0x2d5e0f,_0x4a05f2){return new BPromise(function(_0x522049,_0x5c2e25){return client['request'](_0x5294fd,_0x4a05f2)['then'](function(_0x3ee1c6){logger['info'](_0xec79('0xc'),_0x2d5e0f,'request\x20sent');logger[_0xec79('0xd')](_0xec79('0xe'),_0x2d5e0f,_0xec79('0xf'),JSON[_0xec79('0x10')](_0x3ee1c6));if(_0x3ee1c6[_0xec79('0x11')]){if(_0x3ee1c6[_0xec79('0x11')][_0xec79('0x12')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2d5e0f,_0x3ee1c6[_0xec79('0x11')][_0xec79('0x13')]);return _0x5c2e25(_0x3ee1c6[_0xec79('0x11')][_0xec79('0x13')]);}logger['error'](_0xec79('0xc'),_0x2d5e0f,_0x3ee1c6[_0xec79('0x11')][_0xec79('0x13')]);return _0x522049(_0x3ee1c6['error'][_0xec79('0x13')]);}else{logger[_0xec79('0x14')](_0xec79('0xc'),_0x2d5e0f,_0xec79('0xf'));_0x522049(_0x3ee1c6[_0xec79('0x15')][_0xec79('0x13')]);}})[_0xec79('0x16')](function(_0x347f2b){logger[_0xec79('0x11')](_0xec79('0xc'),_0x2d5e0f,_0x347f2b);_0x5c2e25(_0x347f2b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8ea62ef..5b34a44 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 _0x6657=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x3db022,_0x1371f2){var _0x2eacdc=function(_0x1024f4){while(--_0x1024f4){_0x3db022['push'](_0x3db022['shift']());}};_0x2eacdc(++_0x1371f2);}(_0x6657,0x17f));var _0x7665=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0x6657[_0x2fbb45];return _0x526325;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7665('0x5'));var config=require(_0x7665('0x6'));var controller=require(_0x7665('0x7'));router[_0x7665('0x8')]('/',auth[_0x7665('0x9')](),controller[_0x7665('0xa')]);router[_0x7665('0x8')](_0x7665('0xb'),auth['isAuthenticated'](),controller[_0x7665('0xc')]);router[_0x7665('0x8')](_0x7665('0xd'),auth[_0x7665('0x9')](),controller[_0x7665('0xe')]);router[_0x7665('0xf')]('/',auth[_0x7665('0x9')](),controller[_0x7665('0x10')]);router['put'](_0x7665('0xd'),auth[_0x7665('0x9')](),controller[_0x7665('0x11')]);router['delete'](_0x7665('0xd'),auth['isAuthenticated'](),controller[_0x7665('0x12')]);module[_0x7665('0x13')]=router; \ No newline at end of file +var _0xda19=['../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','exports','util','path','express'];(function(_0x427c8b,_0x1334a7){var _0x37dab8=function(_0x4f2c20){while(--_0x4f2c20){_0x427c8b['push'](_0x427c8b['shift']());}};_0x37dab8(++_0x1334a7);}(_0xda19,0xd5));var _0x9da1=function(_0x5ddee0,_0x508c60){_0x5ddee0=_0x5ddee0-0x0;var _0x57bf99=_0xda19[_0x5ddee0];return _0x57bf99;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9da1('0xb')]('/',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router[_0x9da1('0xd')](_0x9da1('0xe'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xf')]);router[_0x9da1('0x10')](_0x9da1('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9da1('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 751c701..a9ad31c 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 _0xc3fd=['moment','sequelize','exports','STRING','account','agent','queue','NOW'];(function(_0x5a4b11,_0x16f3ca){var _0x490a16=function(_0x198d62){while(--_0x198d62){_0x5a4b11['push'](_0x5a4b11['shift']());}};_0x490a16(++_0x16f3ca);}(_0xc3fd,0xd0));var _0xdc3f=function(_0x1aa2ad,_0x482bf6){_0x1aa2ad=_0x1aa2ad-0x0;var _0x5b3943=_0xc3fd[_0x1aa2ad];return _0x5b3943;};'use strict';var moment=require(_0xdc3f('0x0'));var Sequelize=require(_0xdc3f('0x1'));module[_0xdc3f('0x2')]={'uniqueid':{'type':Sequelize[_0xdc3f('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdc3f('0x4'),_0xdc3f('0x5'),_0xdc3f('0x6')),'allowNull':![],'defaultValue':_0xdc3f('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xdc3f('0x7')]}}; \ No newline at end of file +var _0x7adb=['queue','DATE','NOW','moment','sequelize','exports','account','agent'];(function(_0x48f583,_0xfd71d9){var _0x2306c3=function(_0x167c05){while(--_0x167c05){_0x48f583['push'](_0x48f583['shift']());}};_0x2306c3(++_0xfd71d9);}(_0x7adb,0x10b));var _0xb7ad=function(_0x122ecc,_0x590c13){_0x122ecc=_0x122ecc-0x0;var _0x29bbf9=_0x7adb[_0x122ecc];return _0x29bbf9;};'use strict';var moment=require(_0xb7ad('0x0'));var Sequelize=require(_0xb7ad('0x1'));module[_0xb7ad('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb7ad('0x3'),_0xb7ad('0x4'),_0xb7ad('0x5')),'allowNull':![],'defaultValue':_0xb7ad('0x5')},'transferredAt':{'type':Sequelize[_0xb7ad('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb7ad('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6510b40..66233d9 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 _0xa3b7=['params','includeAll','body','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','MailTransferReport','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x5730b1,_0x5de568){var _0x123f5d=function(_0x349041){while(--_0x349041){_0x5730b1['push'](_0x5730b1['shift']());}};_0x123f5d(++_0x5de568);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0xa3b7[_0x2002b3];return _0x2756f0;};'use strict';var pdf=require(_0x7a3b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7a3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a3b('0x2'));var rp=require(_0x7a3b('0x3'));var moment=require(_0x7a3b('0x4'));var BPromise=require(_0x7a3b('0x5'));var Mustache=require(_0x7a3b('0x6'));var util=require(_0x7a3b('0x7'));var path=require(_0x7a3b('0x8'));var sox=require('sox');var csv=require(_0x7a3b('0x9'));var ejs=require(_0x7a3b('0xa'));var fs=require('fs');var _=require(_0x7a3b('0xb'));var squel=require(_0x7a3b('0xc'));var crypto=require(_0x7a3b('0xd'));var jsforce=require(_0x7a3b('0xe'));var deskjs=require(_0x7a3b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7a3b('0x10'));var Papa=require(_0x7a3b('0x11'));var Redis=require(_0x7a3b('0x12'));var authService=require(_0x7a3b('0x13'));var qs=require(_0x7a3b('0x14'));var hardwareService=require(_0x7a3b('0x15'));var logger=require('../../config/logger')(_0x7a3b('0x16'));var utils=require(_0x7a3b('0x17'));var config=require(_0x7a3b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d97b,_0x329a10){_0x329a10=_0x329a10||0xcc;return function(_0x5a5897){if(_0x5a5897){return _0x10d97b[_0x7a3b('0x19')](_0x329a10);}return _0x10d97b[_0x7a3b('0x1a')](_0x329a10)[_0x7a3b('0x1b')]();};}function respondWithResult(_0x5aca6b,_0x193a98){_0x193a98=_0x193a98||0xc8;return function(_0x4167d0){if(_0x4167d0){return _0x5aca6b[_0x7a3b('0x1a')](_0x193a98)['json'](_0x4167d0);}};}function respondWithFilteredResult(_0x567416,_0x3df3ca){return function(_0x530172){if(_0x530172){var _0x335a43=_0x530172[_0x7a3b('0x1c')],_0x312be6=_0x3df3ca[_0x7a3b('0x1d')],_0x3267c5=_0x3df3ca['offset']+_0x3df3ca[_0x7a3b('0x1e')],_0x59a69f;if(_0x3267c5>=_0x335a43){_0x3267c5=_0x335a43;_0x59a69f=0xc8;}else{_0x59a69f=0xce;}_0x567416['status'](_0x59a69f);return _0x567416[_0x7a3b('0x1f')]('Content-Range',_0x312be6+'-'+_0x3267c5+'/'+_0x335a43)[_0x7a3b('0x20')](_0x530172);}return null;};}function patchUpdates(_0x39492b){return function(_0x204fac){try{jsonpatch[_0x7a3b('0x21')](_0x204fac,_0x39492b,!![]);}catch(_0x58bb3a){return BPromise[_0x7a3b('0x22')](_0x58bb3a);}return _0x204fac[_0x7a3b('0x23')]();};}function saveUpdates(_0x177560,_0x4b85d4){return function(_0x329123){if(_0x329123){return _0x329123[_0x7a3b('0x24')](_0x177560)[_0x7a3b('0x25')](function(_0x3259f2){return _0x3259f2;});}return null;};}function removeEntity(_0x2ac428,_0x2efeb2){return function(_0x4622d5){if(_0x4622d5){return _0x4622d5[_0x7a3b('0x26')]()['then'](function(){_0x2ac428[_0x7a3b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16410e,_0xaff1c2){return function(_0x53b165){if(!_0x53b165){_0x16410e[_0x7a3b('0x19')](0x194);}return _0x53b165;};}function handleError(_0x3400fa,_0x242239){_0x242239=_0x242239||0x1f4;return function(_0x5e0f6f){logger[_0x7a3b('0x27')](_0x5e0f6f[_0x7a3b('0x28')]);if(_0x5e0f6f[_0x7a3b('0x29')]){delete _0x5e0f6f[_0x7a3b('0x29')];}_0x3400fa['status'](_0x242239)[_0x7a3b('0x2a')](_0x5e0f6f);};}exports['index']=function(_0x599389,_0x35c05c){var _0x3eb556={},_0x3c58f3={},_0x505c80={'count':0x0,'rows':[]};var _0x16ffb6=db[_0x7a3b('0x2b')][_0x7a3b('0x2c')];_0x3c58f3[_0x7a3b('0x2d')]=_[_0x7a3b('0x2e')](_0x16ffb6);_0x3c58f3[_0x7a3b('0x2f')]=_[_0x7a3b('0x2e')](_0x599389[_0x7a3b('0x2f')]);_0x3c58f3['filters']=_['intersection'](_0x3c58f3['model'],_0x3c58f3[_0x7a3b('0x2f')]);_0x3eb556[_0x7a3b('0x30')]=_[_0x7a3b('0x31')](_0x3c58f3[_0x7a3b('0x2d')],qs[_0x7a3b('0x32')](_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x32')]));_0x3eb556[_0x7a3b('0x30')]=_0x3eb556[_0x7a3b('0x30')][_0x7a3b('0x33')]?_0x3eb556['attributes']:_0x3c58f3[_0x7a3b('0x2d')];if(!_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x34')]('nolimit')){_0x3eb556[_0x7a3b('0x1e')]=qs[_0x7a3b('0x1e')](_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x1e')]);_0x3eb556[_0x7a3b('0x1d')]=qs['offset'](_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x1d')]);}_0x3eb556[_0x7a3b('0x35')]=qs['sort'](_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x36')]);_0x3eb556[_0x7a3b('0x37')]=qs[_0x7a3b('0x38')](_[_0x7a3b('0x39')](_0x599389[_0x7a3b('0x2f')],_0x3c58f3['filters']));if(_0x599389[_0x7a3b('0x2f')][_0x7a3b('0x3a')]){_0x3eb556[_0x7a3b('0x37')]=_[_0x7a3b('0x3b')](_0x3eb556['where'],{'$or':_[_0x7a3b('0x3c')](_0x16ffb6,function(_0xd6e8c4){if(_0xd6e8c4[_0x7a3b('0x3d')][_0x7a3b('0x3e')]!==_0x7a3b('0x3f')){var _0x5e0eb4={};_0x5e0eb4[_0xd6e8c4['field']]={'$like':'%'+_0x599389[_0x7a3b('0x2f')]['filter']+'%'};return _0x5e0eb4;}})});}_0x3eb556=_[_0x7a3b('0x3b')]({},_0x3eb556,_0x599389[_0x7a3b('0x40')]);var _0x3e8d3d={'where':_0x3eb556['where']};return db['MailTransferReport'][_0x7a3b('0x1c')](_0x3e8d3d)['then'](function(_0x186009){_0x505c80['count']=_0x186009;if(_0x599389[_0x7a3b('0x2f')]['includeAll']){_0x3eb556[_0x7a3b('0x41')]=[{'all':!![]}];}return db[_0x7a3b('0x2b')][_0x7a3b('0x42')](_0x3eb556);})['then'](function(_0x1c43b4){_0x505c80[_0x7a3b('0x43')]=_0x1c43b4;return _0x505c80;})['then'](respondWithFilteredResult(_0x35c05c,_0x3eb556))[_0x7a3b('0x44')](handleError(_0x35c05c,null));};exports[_0x7a3b('0x45')]=function(_0x358ca8,_0x34f72c){var _0x31d23a={'raw':!![],'where':{'id':_0x358ca8[_0x7a3b('0x46')]['id']}},_0xb7e2e5={};_0xb7e2e5[_0x7a3b('0x2d')]=_['keys'](db[_0x7a3b('0x2b')]['rawAttributes']);_0xb7e2e5[_0x7a3b('0x2f')]=_[_0x7a3b('0x2e')](_0x358ca8['query']);_0xb7e2e5[_0x7a3b('0x38')]=_[_0x7a3b('0x31')](_0xb7e2e5[_0x7a3b('0x2d')],_0xb7e2e5[_0x7a3b('0x2f')]);_0x31d23a[_0x7a3b('0x30')]=_[_0x7a3b('0x31')](_0xb7e2e5[_0x7a3b('0x2d')],qs[_0x7a3b('0x32')](_0x358ca8[_0x7a3b('0x2f')]['fields']));_0x31d23a[_0x7a3b('0x30')]=_0x31d23a[_0x7a3b('0x30')][_0x7a3b('0x33')]?_0x31d23a[_0x7a3b('0x30')]:_0xb7e2e5[_0x7a3b('0x2d')];if(_0x358ca8[_0x7a3b('0x2f')][_0x7a3b('0x47')]){_0x31d23a[_0x7a3b('0x41')]=[{'all':!![]}];}_0x31d23a=_[_0x7a3b('0x3b')]({},_0x31d23a,_0x358ca8['options']);return db[_0x7a3b('0x2b')]['find'](_0x31d23a)[_0x7a3b('0x25')](handleEntityNotFound(_0x34f72c,null))[_0x7a3b('0x25')](respondWithResult(_0x34f72c,null))[_0x7a3b('0x44')](handleError(_0x34f72c,null));};exports['create']=function(_0x4eed6f,_0x2028d2){return db[_0x7a3b('0x2b')]['create'](_0x4eed6f[_0x7a3b('0x48')],{})[_0x7a3b('0x25')](respondWithResult(_0x2028d2,0xc9))['catch'](handleError(_0x2028d2,null));};exports[_0x7a3b('0x24')]=function(_0x429dc5,_0x58c3b0){if(_0x429dc5[_0x7a3b('0x48')]['id']){delete _0x429dc5[_0x7a3b('0x48')]['id'];}return db[_0x7a3b('0x2b')]['find']({'where':{'id':_0x429dc5[_0x7a3b('0x46')]['id']}})[_0x7a3b('0x25')](handleEntityNotFound(_0x58c3b0,null))[_0x7a3b('0x25')](saveUpdates(_0x429dc5['body'],null))['then'](respondWithResult(_0x58c3b0,null))[_0x7a3b('0x44')](handleError(_0x58c3b0,null));};exports['destroy']=function(_0x2b9183,_0x17259c){return db[_0x7a3b('0x2b')][_0x7a3b('0x49')]({'where':{'id':_0x2b9183['params']['id']}})[_0x7a3b('0x25')](handleEntityNotFound(_0x17259c,null))[_0x7a3b('0x25')](removeEntity(_0x17259c,null))['catch'](handleError(_0x17259c,null));};exports['describe']=function(_0x5c4ba2,_0x544489){return db[_0x7a3b('0x2b')][_0x7a3b('0x4a')]()['then'](respondWithResult(_0x544489,null))['catch'](handleError(_0x544489,null));}; \ No newline at end of file +var _0xe37b=['options','count','includeAll','MailTransferReport','catch','params','fields','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','type','key','VIRTUAL','field','merge'];(function(_0xe56673,_0x38197c){var _0x1b4af9=function(_0x454529){while(--_0x454529){_0xe56673['push'](_0xe56673['shift']());}};_0x1b4af9(++_0x38197c);}(_0xe37b,0x1e8));var _0xbe37=function(_0x167ddd,_0x23848e){_0x167ddd=_0x167ddd-0x0;var _0x3c6706=_0xe37b[_0x167ddd];return _0x3c6706;};'use strict';var pdf=require(_0xbe37('0x0'));var emlformat=require(_0xbe37('0x1'));var rimraf=require(_0xbe37('0x2'));var zipdir=require(_0xbe37('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe37('0x4'));var moment=require('moment');var BPromise=require(_0xbe37('0x5'));var Mustache=require(_0xbe37('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbe37('0x7'));var csv=require(_0xbe37('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbe37('0x9'));var crypto=require(_0xbe37('0xa'));var jsforce=require(_0xbe37('0xb'));var deskjs=require(_0xbe37('0xc'));var toCsv=require(_0xbe37('0x8'));var querystring=require(_0xbe37('0xd'));var Papa=require(_0xbe37('0xe'));var Redis=require('ioredis');var authService=require(_0xbe37('0xf'));var qs=require(_0xbe37('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe37('0x11'))(_0xbe37('0x12'));var utils=require('../../config/utils');var config=require(_0xbe37('0x13'));var db=require(_0xbe37('0x14'))['db'];function respondWithStatusCode(_0x51b8eb,_0x2a17e1){_0x2a17e1=_0x2a17e1||0xcc;return function(_0x32ea96){if(_0x32ea96){return _0x51b8eb[_0xbe37('0x15')](_0x2a17e1);}return _0x51b8eb[_0xbe37('0x16')](_0x2a17e1)[_0xbe37('0x17')]();};}function respondWithResult(_0x30e7d0,_0x1458f3){_0x1458f3=_0x1458f3||0xc8;return function(_0x5c2764){if(_0x5c2764){return _0x30e7d0['status'](_0x1458f3)['json'](_0x5c2764);}};}function respondWithFilteredResult(_0x365b4e,_0x37ecf0){return function(_0xf6f0ad){if(_0xf6f0ad){var _0x5124d8=_0xf6f0ad['count'],_0x3c5358=_0x37ecf0[_0xbe37('0x18')],_0x5d428f=_0x37ecf0[_0xbe37('0x18')]+_0x37ecf0[_0xbe37('0x19')],_0x396617;if(_0x5d428f>=_0x5124d8){_0x5d428f=_0x5124d8;_0x396617=0xc8;}else{_0x396617=0xce;}_0x365b4e[_0xbe37('0x16')](_0x396617);return _0x365b4e['set'](_0xbe37('0x1a'),_0x3c5358+'-'+_0x5d428f+'/'+_0x5124d8)[_0xbe37('0x1b')](_0xf6f0ad);}return null;};}function patchUpdates(_0x51d4e3){return function(_0xb2b8fe){try{jsonpatch[_0xbe37('0x1c')](_0xb2b8fe,_0x51d4e3,!![]);}catch(_0x26fc7f){return BPromise[_0xbe37('0x1d')](_0x26fc7f);}return _0xb2b8fe[_0xbe37('0x1e')]();};}function saveUpdates(_0x2deb06,_0x23234c){return function(_0x4941dc){if(_0x4941dc){return _0x4941dc[_0xbe37('0x1f')](_0x2deb06)[_0xbe37('0x20')](function(_0x55e7df){return _0x55e7df;});}return null;};}function removeEntity(_0x720e2b,_0x315ff2){return function(_0x1c99f3){if(_0x1c99f3){return _0x1c99f3[_0xbe37('0x21')]()['then'](function(){_0x720e2b[_0xbe37('0x16')](0xcc)[_0xbe37('0x17')]();});}};}function handleEntityNotFound(_0x277b4b,_0x2d310b){return function(_0x1dd84b){if(!_0x1dd84b){_0x277b4b[_0xbe37('0x15')](0x194);}return _0x1dd84b;};}function handleError(_0x55b5d8,_0x5ded63){_0x5ded63=_0x5ded63||0x1f4;return function(_0x471e22){logger[_0xbe37('0x22')](_0x471e22[_0xbe37('0x23')]);if(_0x471e22[_0xbe37('0x24')]){delete _0x471e22['name'];}_0x55b5d8[_0xbe37('0x16')](_0x5ded63)[_0xbe37('0x25')](_0x471e22);};}exports[_0xbe37('0x26')]=function(_0x55d65a,_0x15c657){var _0x73e7b8={},_0x15988b={},_0x222c15={'count':0x0,'rows':[]};var _0xde9180=db['MailTransferReport'][_0xbe37('0x27')];_0x15988b['model']=_[_0xbe37('0x28')](_0xde9180);_0x15988b[_0xbe37('0x29')]=_[_0xbe37('0x28')](_0x55d65a[_0xbe37('0x29')]);_0x15988b[_0xbe37('0x2a')]=_[_0xbe37('0x2b')](_0x15988b[_0xbe37('0x2c')],_0x15988b[_0xbe37('0x29')]);_0x73e7b8[_0xbe37('0x2d')]=_[_0xbe37('0x2b')](_0x15988b['model'],qs['fields'](_0x55d65a[_0xbe37('0x29')]['fields']));_0x73e7b8[_0xbe37('0x2d')]=_0x73e7b8[_0xbe37('0x2d')]['length']?_0x73e7b8[_0xbe37('0x2d')]:_0x15988b['model'];if(!_0x55d65a['query'][_0xbe37('0x2e')](_0xbe37('0x2f'))){_0x73e7b8[_0xbe37('0x19')]=qs[_0xbe37('0x19')](_0x55d65a[_0xbe37('0x29')][_0xbe37('0x19')]);_0x73e7b8[_0xbe37('0x18')]=qs[_0xbe37('0x18')](_0x55d65a['query'][_0xbe37('0x18')]);}_0x73e7b8['order']=qs[_0xbe37('0x30')](_0x55d65a[_0xbe37('0x29')][_0xbe37('0x30')]);_0x73e7b8[_0xbe37('0x31')]=qs[_0xbe37('0x2a')](_[_0xbe37('0x32')](_0x55d65a[_0xbe37('0x29')],_0x15988b[_0xbe37('0x2a')]));if(_0x55d65a[_0xbe37('0x29')]['filter']){_0x73e7b8['where']=_['merge'](_0x73e7b8[_0xbe37('0x31')],{'$or':_['map'](_0xde9180,function(_0x31e60e){if(_0x31e60e[_0xbe37('0x33')][_0xbe37('0x34')]!==_0xbe37('0x35')){var _0x3bd3ba={};_0x3bd3ba[_0x31e60e[_0xbe37('0x36')]]={'$like':'%'+_0x55d65a['query']['filter']+'%'};return _0x3bd3ba;}})});}_0x73e7b8=_[_0xbe37('0x37')]({},_0x73e7b8,_0x55d65a[_0xbe37('0x38')]);var _0x58bafc={'where':_0x73e7b8[_0xbe37('0x31')]};return db['MailTransferReport'][_0xbe37('0x39')](_0x58bafc)['then'](function(_0x1ea74b){_0x222c15[_0xbe37('0x39')]=_0x1ea74b;if(_0x55d65a[_0xbe37('0x29')][_0xbe37('0x3a')]){_0x73e7b8['include']=[{'all':!![]}];}return db[_0xbe37('0x3b')]['findAll'](_0x73e7b8);})[_0xbe37('0x20')](function(_0x674b0e){_0x222c15['rows']=_0x674b0e;return _0x222c15;})[_0xbe37('0x20')](respondWithFilteredResult(_0x15c657,_0x73e7b8))[_0xbe37('0x3c')](handleError(_0x15c657,null));};exports['show']=function(_0x247467,_0x5e950a){var _0x2179d0={'raw':!![],'where':{'id':_0x247467[_0xbe37('0x3d')]['id']}},_0x34768b={};_0x34768b[_0xbe37('0x2c')]=_[_0xbe37('0x28')](db[_0xbe37('0x3b')][_0xbe37('0x27')]);_0x34768b[_0xbe37('0x29')]=_[_0xbe37('0x28')](_0x247467[_0xbe37('0x29')]);_0x34768b[_0xbe37('0x2a')]=_['intersection'](_0x34768b['model'],_0x34768b['query']);_0x2179d0[_0xbe37('0x2d')]=_[_0xbe37('0x2b')](_0x34768b['model'],qs[_0xbe37('0x3e')](_0x247467['query'][_0xbe37('0x3e')]));_0x2179d0[_0xbe37('0x2d')]=_0x2179d0[_0xbe37('0x2d')]['length']?_0x2179d0[_0xbe37('0x2d')]:_0x34768b[_0xbe37('0x2c')];if(_0x247467[_0xbe37('0x29')]['includeAll']){_0x2179d0[_0xbe37('0x3f')]=[{'all':!![]}];}_0x2179d0=_['merge']({},_0x2179d0,_0x247467['options']);return db['MailTransferReport'][_0xbe37('0x40')](_0x2179d0)[_0xbe37('0x20')](handleEntityNotFound(_0x5e950a,null))[_0xbe37('0x20')](respondWithResult(_0x5e950a,null))['catch'](handleError(_0x5e950a,null));};exports[_0xbe37('0x41')]=function(_0x49252d,_0x41a234){return db[_0xbe37('0x3b')][_0xbe37('0x41')](_0x49252d[_0xbe37('0x42')],{})['then'](respondWithResult(_0x41a234,0xc9))[_0xbe37('0x3c')](handleError(_0x41a234,null));};exports[_0xbe37('0x1f')]=function(_0x3c4500,_0x325edb){if(_0x3c4500[_0xbe37('0x42')]['id']){delete _0x3c4500[_0xbe37('0x42')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x3c4500[_0xbe37('0x3d')]['id']}})['then'](handleEntityNotFound(_0x325edb,null))[_0xbe37('0x20')](saveUpdates(_0x3c4500[_0xbe37('0x42')],null))['then'](respondWithResult(_0x325edb,null))[_0xbe37('0x3c')](handleError(_0x325edb,null));};exports[_0xbe37('0x21')]=function(_0x28a128,_0x4dc8ed){return db[_0xbe37('0x3b')][_0xbe37('0x40')]({'where':{'id':_0x28a128['params']['id']}})[_0xbe37('0x20')](handleEntityNotFound(_0x4dc8ed,null))['then'](removeEntity(_0x4dc8ed,null))[_0xbe37('0x3c')](handleError(_0x4dc8ed,null));};exports['describe']=function(_0x152a88,_0x22da5a){return db[_0xbe37('0x3b')][_0xbe37('0x43')]()[_0xbe37('0x20')](respondWithResult(_0x22da5a,null))[_0xbe37('0x3c')](handleError(_0x22da5a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f688080..6cf5d43 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 _0x53ec=['path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x44cd34,_0x21117d){var _0x58c9ea=function(_0x52b0d2){while(--_0x52b0d2){_0x44cd34['push'](_0x44cd34['shift']());}};_0x58c9ea(++_0x21117d);}(_0x53ec,0x192));var _0xc53e=function(_0x3d3d96,_0x28998e){_0x3d3d96=_0x3d3d96-0x0;var _0x2e479a=_0x53ec[_0x3d3d96];return _0x2e479a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfd=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x5d9b6d,_0x3380c5){var _0x3176fb=function(_0x4aa671){while(--_0x4aa671){_0x5d9b6d['push'](_0x5d9b6d['shift']());}};_0x3176fb(++_0x3380c5);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd7df('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 5146cea..4f3cd4f 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 _0x4790=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x53d729,_0x1a2198){var _0x568f90=function(_0x48bd5b){while(--_0x48bd5b){_0x53d729['push'](_0x53d729['shift']());}};_0x568f90(++_0x1a2198);}(_0x4790,0x91));var _0x0479=function(_0x47ad1a,_0x467d68){_0x47ad1a=_0x47ad1a-0x0;var _0x586211=_0x4790[_0x47ad1a];return _0x586211;};'use strict';var _=require(_0x0479('0x0'));var util=require('util');var moment=require(_0x0479('0x1'));var BPromise=require('bluebird');var rs=require(_0x0479('0x2'));var fs=require('fs');var Redis=require(_0x0479('0x3'));var db=require(_0x0479('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0479('0x5'))(_0x0479('0x6'));var config=require(_0x0479('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0479('0x8')][_0x0479('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x158646,_0x1392af,_0x5a79e8){return new BPromise(function(_0xcaecdb,_0x57123a){return client[_0x0479('0xa')](_0x158646,_0x5a79e8)[_0x0479('0xb')](function(_0x5a6d13){logger[_0x0479('0xc')](_0x0479('0xd'),_0x1392af,_0x0479('0xe'));logger[_0x0479('0xf')](_0x0479('0x10'),_0x1392af,_0x0479('0xe'),JSON[_0x0479('0x11')](_0x5a6d13));if(_0x5a6d13[_0x0479('0x12')]){if(_0x5a6d13[_0x0479('0x12')]['code']===0x1f4){logger[_0x0479('0x12')](_0x0479('0xd'),_0x1392af,_0x5a6d13['error'][_0x0479('0x13')]);return _0x57123a(_0x5a6d13['error'][_0x0479('0x13')]);}logger[_0x0479('0x12')](_0x0479('0xd'),_0x1392af,_0x5a6d13[_0x0479('0x12')][_0x0479('0x13')]);return _0xcaecdb(_0x5a6d13['error'][_0x0479('0x13')]);}else{logger[_0x0479('0xc')](_0x0479('0xd'),_0x1392af,_0x0479('0xe'));_0xcaecdb(_0x5a6d13[_0x0479('0x14')][_0x0479('0x13')]);}})[_0x0479('0x15')](function(_0x2b4976){logger[_0x0479('0x12')](_0x0479('0xd'),_0x1392af,_0x2b4976);_0x57123a(_0x2b4976);});});} \ No newline at end of file +var _0xbf5a=['message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s'];(function(_0x4900a0,_0x11e97a){var _0x18b221=function(_0x317ba6){while(--_0x317ba6){_0x4900a0['push'](_0x4900a0['shift']());}};_0x18b221(++_0x11e97a);}(_0xbf5a,0xb5));var _0xabf5=function(_0x2e2ea7,_0x537a54){_0x2e2ea7=_0x2e2ea7-0x0;var _0xa7b8d8=_0xbf5a[_0x2e2ea7];return _0xa7b8d8;};'use strict';var _=require(_0xabf5('0x0'));var util=require(_0xabf5('0x1'));var moment=require(_0xabf5('0x2'));var BPromise=require('bluebird');var rs=require(_0xabf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabf5('0x4'))['db'];var utils=require(_0xabf5('0x5'));var logger=require(_0xabf5('0x6'))('rpc');var config=require(_0xabf5('0x7'));var jayson=require(_0xabf5('0x8'));var client=jayson['client'][_0xabf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32c7fb,_0x202cb4,_0xf66a19){return new BPromise(function(_0xae4a63,_0x14abb2){return client[_0xabf5('0xa')](_0x32c7fb,_0xf66a19)['then'](function(_0x1d30f9){logger[_0xabf5('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x202cb4,_0xabf5('0xc'));logger[_0xabf5('0xd')](_0xabf5('0xe'),_0x202cb4,_0xabf5('0xc'),JSON[_0xabf5('0xf')](_0x1d30f9));if(_0x1d30f9['error']){if(_0x1d30f9[_0xabf5('0x10')][_0xabf5('0x11')]===0x1f4){logger[_0xabf5('0x10')](_0xabf5('0x12'),_0x202cb4,_0x1d30f9[_0xabf5('0x10')][_0xabf5('0x13')]);return _0x14abb2(_0x1d30f9['error'][_0xabf5('0x13')]);}logger[_0xabf5('0x10')](_0xabf5('0x12'),_0x202cb4,_0x1d30f9[_0xabf5('0x10')][_0xabf5('0x13')]);return _0xae4a63(_0x1d30f9[_0xabf5('0x10')]['message']);}else{logger['info'](_0xabf5('0x12'),_0x202cb4,_0xabf5('0xc'));_0xae4a63(_0x1d30f9['result'][_0xabf5('0x13')]);}})['catch'](function(_0xf6d464){logger[_0xabf5('0x10')](_0xabf5('0x12'),_0x202cb4,_0xf6d464);_0x14abb2(_0xf6d464);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 908eea9..c0356dc 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 _0xc02e=['isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','./memberReport.controller','index','get'];(function(_0x143f6c,_0x4c7766){var _0x159ff2=function(_0x223546){while(--_0x223546){_0x143f6c['push'](_0x143f6c['shift']());}};_0x159ff2(++_0x4c7766);}(_0xc02e,0xf4));var _0xec02=function(_0x3eae20,_0x3078d9){_0x3eae20=_0x3eae20-0x0;var _0x58921b=_0xc02e[_0x3eae20];return _0x58921b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xec02('0x0'));var timeout=require(_0xec02('0x1'));var express=require(_0xec02('0x2'));var router=express[_0xec02('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xec02('0x4'));var config=require('../../config/environment');var controller=require(_0xec02('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xec02('0x6')]);router[_0xec02('0x7')]('/describe',auth[_0xec02('0x8')](),controller[_0xec02('0x9')]);router[_0xec02('0x7')](_0xec02('0xa'),auth[_0xec02('0x8')](),controller[_0xec02('0xb')]);router[_0xec02('0xc')]('/',auth[_0xec02('0x8')](),controller['create']);router[_0xec02('0xd')](_0xec02('0xa'),auth['isAuthenticated'](),controller[_0xec02('0xe')]);router[_0xec02('0xf')](_0xec02('0xa'),auth[_0xec02('0x8')](),controller[_0xec02('0x10')]);module[_0xec02('0x11')]=router; \ No newline at end of file +var _0x7477=['../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7477,0x19c));var _0x7747=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x7477[_0x581249];return _0x284bae;};'use strict';var multer=require(_0x7747('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7747('0x1'));var express=require('express');var router=express[_0x7747('0x2')]();var auth=require(_0x7747('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7747('0x4'));var controller=require(_0x7747('0x5'));router[_0x7747('0x6')]('/',auth['isAuthenticated'](),controller[_0x7747('0x7')]);router[_0x7747('0x6')]('/describe',auth[_0x7747('0x8')](),controller[_0x7747('0x9')]);router['get'](_0x7747('0xa'),auth[_0x7747('0x8')](),controller[_0x7747('0xb')]);router[_0x7747('0xc')]('/',auth[_0x7747('0x8')](),controller['create']);router[_0x7747('0xd')](_0x7747('0xa'),auth[_0x7747('0x8')](),controller[_0x7747('0xe')]);router[_0x7747('0xf')](_0x7747('0xa'),auth[_0x7747('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 05b39c8..da7d749 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 _0xe3b6=['talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x2995e7,_0x1a087b){var _0x40db38=function(_0x3c9645){while(--_0x3c9645){_0x2995e7['push'](_0x2995e7['shift']());}};_0x40db38(++_0x1a087b);}(_0xe3b6,0x1b3));var _0x6e3b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe3b6[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x6e3b('0x0'));var moment=require(_0x6e3b('0x1'));module[_0x6e3b('0x2')]={'channel':{'type':Sequelize[_0x6e3b('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6e3b('0x3')]},'type':{'type':Sequelize[_0x6e3b('0x3')],'defaultValue':_0x6e3b('0x4'),'comment':_0x6e3b('0x5')},'duration':{'type':Sequelize[_0x6e3b('0x6')]},'enterAt':{'type':Sequelize[_0x6e3b('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3693c5){var _0x4bc92b=moment(_0x3693c5);var _0x24bcc2=moment(this['getDataValue'](_0x6e3b('0x8')));var _0xa035d6=_0x4bc92b[_0x6e3b('0x9')](_0x24bcc2,_0x6e3b('0xa'));this[_0x6e3b('0xb')](_0x6e3b('0xc'),_0x3693c5);this['setDataValue'](_0x6e3b('0xd'),_0xa035d6||null);}},'data1':{'type':Sequelize[_0x6e3b('0x3')],'comment':_0x6e3b('0xe')},'data2':{'type':Sequelize[_0x6e3b('0x3')],'comment':_0x6e3b('0xf')},'data3':{'type':Sequelize[_0x6e3b('0x3')],'comment':_0x6e3b('0x10')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x6e3b('0x3')],'comment':_0x6e3b('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x6e3b('0x6')]},'uniqueid':{'type':Sequelize[_0x6e3b('0x3')]}}; \ No newline at end of file +var _0xfda1=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','diff','setDataValue','duration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfda1,0x16d));var _0x1fda=function(_0xd8323,_0x28a00e){_0xd8323=_0xd8323-0x0;var _0x583d69=_0xfda1[_0xd8323];return _0x583d69;};'use strict';var Sequelize=require(_0x1fda('0x0'));var moment=require(_0x1fda('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1fda('0x2')]},'interface':{'type':Sequelize[_0x1fda('0x2')]},'type':{'type':Sequelize[_0x1fda('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x1fda('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x458434){var _0x1906e2=moment(_0x458434);var _0x47b083=moment(this['getDataValue']('enterAt'));var _0x28df14=_0x1906e2[_0x1fda('0x4')](_0x47b083,'seconds');this[_0x1fda('0x5')]('exitAt',_0x458434);this[_0x1fda('0x5')](_0x1fda('0x6'),_0x28df14||null);}},'data1':{'type':Sequelize[_0x1fda('0x2')],'comment':_0x1fda('0x7')},'data2':{'type':Sequelize[_0x1fda('0x2')],'comment':_0x1fda('0x8')},'data3':{'type':Sequelize[_0x1fda('0x2')],'comment':_0x1fda('0x9')},'data4':{'type':Sequelize[_0x1fda('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x1fda('0x2')],'comment':_0x1fda('0xa')},'role':{'type':Sequelize[_0x1fda('0x2')]},'internal':{'type':Sequelize[_0x1fda('0xb')]},'uniqueid':{'type':Sequelize[_0x1fda('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4d64d1d..8035f85 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 _0x9ba0=['offset','limit','set','Content-Range','json','apply','save','then','name','index','MemberReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','field','options','include','findAll','catch','show','params','find','create','update','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count'];(function(_0x74bbc,_0x3a4dee){var _0x5336c4=function(_0xf3c3eb){while(--_0xf3c3eb){_0x74bbc['push'](_0x74bbc['shift']());}};_0x5336c4(++_0x3a4dee);}(_0x9ba0,0xff));var _0x09ba=function(_0x5819e1,_0x2c4aec){_0x5819e1=_0x5819e1-0x0;var _0x5effdd=_0x9ba0[_0x5819e1];return _0x5effdd;};'use strict';var pdf=require(_0x09ba('0x0'));var emlformat=require(_0x09ba('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x09ba('0x2'));var jsonpatch=require(_0x09ba('0x3'));var rp=require(_0x09ba('0x4'));var moment=require(_0x09ba('0x5'));var BPromise=require(_0x09ba('0x6'));var Mustache=require(_0x09ba('0x7'));var util=require(_0x09ba('0x8'));var path=require(_0x09ba('0x9'));var sox=require(_0x09ba('0xa'));var csv=require(_0x09ba('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x09ba('0xc'));var squel=require(_0x09ba('0xd'));var crypto=require(_0x09ba('0xe'));var jsforce=require(_0x09ba('0xf'));var deskjs=require(_0x09ba('0x10'));var toCsv=require(_0x09ba('0xb'));var querystring=require(_0x09ba('0x11'));var Papa=require(_0x09ba('0x12'));var Redis=require(_0x09ba('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x09ba('0x14'));var hardwareService=require(_0x09ba('0x15'));var logger=require(_0x09ba('0x16'))('api');var utils=require(_0x09ba('0x17'));var config=require(_0x09ba('0x18'));var db=require(_0x09ba('0x19'))['db'];function respondWithStatusCode(_0x4504f8,_0x3418b7){_0x3418b7=_0x3418b7||0xcc;return function(_0x175f26){if(_0x175f26){return _0x4504f8['sendStatus'](_0x3418b7);}return _0x4504f8[_0x09ba('0x1a')](_0x3418b7)[_0x09ba('0x1b')]();};}function respondWithResult(_0x12ffda,_0x3a4280){_0x3a4280=_0x3a4280||0xc8;return function(_0x23d13e){if(_0x23d13e){return _0x12ffda[_0x09ba('0x1a')](_0x3a4280)['json'](_0x23d13e);}};}function respondWithFilteredResult(_0x2c9c4f,_0xa8a20){return function(_0x9e45d8){if(_0x9e45d8){var _0x116d03=_0x9e45d8[_0x09ba('0x1c')],_0x264926=_0xa8a20[_0x09ba('0x1d')],_0x47f705=_0xa8a20[_0x09ba('0x1d')]+_0xa8a20[_0x09ba('0x1e')],_0x30d33e;if(_0x47f705>=_0x116d03){_0x47f705=_0x116d03;_0x30d33e=0xc8;}else{_0x30d33e=0xce;}_0x2c9c4f[_0x09ba('0x1a')](_0x30d33e);return _0x2c9c4f[_0x09ba('0x1f')](_0x09ba('0x20'),_0x264926+'-'+_0x47f705+'/'+_0x116d03)[_0x09ba('0x21')](_0x9e45d8);}return null;};}function patchUpdates(_0x2d0340){return function(_0x244412){try{jsonpatch[_0x09ba('0x22')](_0x244412,_0x2d0340,!![]);}catch(_0x2a5a36){return BPromise['reject'](_0x2a5a36);}return _0x244412[_0x09ba('0x23')]();};}function saveUpdates(_0x27a872,_0xbfd25){return function(_0x7496f8){if(_0x7496f8){return _0x7496f8['update'](_0x27a872)[_0x09ba('0x24')](function(_0x4d0555){return _0x4d0555;});}return null;};}function removeEntity(_0xcfebe0,_0x1e278f){return function(_0x88c96f){if(_0x88c96f){return _0x88c96f['destroy']()['then'](function(){_0xcfebe0[_0x09ba('0x1a')](0xcc)[_0x09ba('0x1b')]();});}};}function handleEntityNotFound(_0x249088,_0x431407){return function(_0x5a7344){if(!_0x5a7344){_0x249088['sendStatus'](0x194);}return _0x5a7344;};}function handleError(_0x3e934b,_0x505a46){_0x505a46=_0x505a46||0x1f4;return function(_0x3497ca){logger['error'](_0x3497ca['stack']);if(_0x3497ca[_0x09ba('0x25')]){delete _0x3497ca[_0x09ba('0x25')];}_0x3e934b[_0x09ba('0x1a')](_0x505a46)['send'](_0x3497ca);};}exports[_0x09ba('0x26')]=function(_0x112c3d,_0xe56a40){var _0x5b9278={},_0xe535e2={},_0x458581={'count':0x0,'rows':[]};var _0x35e834=db[_0x09ba('0x27')][_0x09ba('0x28')];_0xe535e2[_0x09ba('0x29')]=_[_0x09ba('0x2a')](_0x35e834);_0xe535e2[_0x09ba('0x2b')]=_['keys'](_0x112c3d['query']);_0xe535e2[_0x09ba('0x2c')]=_['intersection'](_0xe535e2[_0x09ba('0x29')],_0xe535e2[_0x09ba('0x2b')]);_0x5b9278[_0x09ba('0x2d')]=_[_0x09ba('0x2e')](_0xe535e2[_0x09ba('0x29')],qs[_0x09ba('0x2f')](_0x112c3d[_0x09ba('0x2b')]['fields']));_0x5b9278[_0x09ba('0x2d')]=_0x5b9278[_0x09ba('0x2d')][_0x09ba('0x30')]?_0x5b9278['attributes']:_0xe535e2[_0x09ba('0x29')];if(!_0x112c3d[_0x09ba('0x2b')][_0x09ba('0x31')](_0x09ba('0x32'))){_0x5b9278[_0x09ba('0x1e')]=qs['limit'](_0x112c3d[_0x09ba('0x2b')][_0x09ba('0x1e')]);_0x5b9278[_0x09ba('0x1d')]=qs['offset'](_0x112c3d[_0x09ba('0x2b')][_0x09ba('0x1d')]);}_0x5b9278[_0x09ba('0x33')]=qs[_0x09ba('0x34')](_0x112c3d[_0x09ba('0x2b')]['sort']);_0x5b9278['where']=qs[_0x09ba('0x2c')](_[_0x09ba('0x35')](_0x112c3d[_0x09ba('0x2b')],_0xe535e2[_0x09ba('0x2c')]));if(_0x112c3d[_0x09ba('0x2b')][_0x09ba('0x36')]){_0x5b9278[_0x09ba('0x37')]=_[_0x09ba('0x38')](_0x5b9278[_0x09ba('0x37')],{'$or':_['map'](_0x35e834,function(_0x5f47a5){if(_0x5f47a5[_0x09ba('0x39')][_0x09ba('0x3a')]!=='VIRTUAL'){var _0x393af9={};_0x393af9[_0x5f47a5[_0x09ba('0x3b')]]={'$like':'%'+_0x112c3d[_0x09ba('0x2b')]['filter']+'%'};return _0x393af9;}})});}_0x5b9278=_[_0x09ba('0x38')]({},_0x5b9278,_0x112c3d[_0x09ba('0x3c')]);var _0x35797d={'where':_0x5b9278[_0x09ba('0x37')]};return db[_0x09ba('0x27')][_0x09ba('0x1c')](_0x35797d)['then'](function(_0x1bcd92){_0x458581[_0x09ba('0x1c')]=_0x1bcd92;if(_0x112c3d[_0x09ba('0x2b')]['includeAll']){_0x5b9278[_0x09ba('0x3d')]=[{'all':!![]}];}return db[_0x09ba('0x27')][_0x09ba('0x3e')](_0x5b9278);})[_0x09ba('0x24')](function(_0x19d8cc){_0x458581['rows']=_0x19d8cc;return _0x458581;})['then'](respondWithFilteredResult(_0xe56a40,_0x5b9278))[_0x09ba('0x3f')](handleError(_0xe56a40,null));};exports[_0x09ba('0x40')]=function(_0x1f1db5,_0x3b6254){var _0x5eb2d0={'raw':!![],'where':{'id':_0x1f1db5[_0x09ba('0x41')]['id']}},_0x28f381={};_0x28f381[_0x09ba('0x29')]=_[_0x09ba('0x2a')](db['MemberReport']['rawAttributes']);_0x28f381[_0x09ba('0x2b')]=_[_0x09ba('0x2a')](_0x1f1db5[_0x09ba('0x2b')]);_0x28f381[_0x09ba('0x2c')]=_[_0x09ba('0x2e')](_0x28f381[_0x09ba('0x29')],_0x28f381[_0x09ba('0x2b')]);_0x5eb2d0[_0x09ba('0x2d')]=_[_0x09ba('0x2e')](_0x28f381[_0x09ba('0x29')],qs[_0x09ba('0x2f')](_0x1f1db5['query'][_0x09ba('0x2f')]));_0x5eb2d0[_0x09ba('0x2d')]=_0x5eb2d0[_0x09ba('0x2d')][_0x09ba('0x30')]?_0x5eb2d0['attributes']:_0x28f381['model'];if(_0x1f1db5['query']['includeAll']){_0x5eb2d0[_0x09ba('0x3d')]=[{'all':!![]}];}_0x5eb2d0=_[_0x09ba('0x38')]({},_0x5eb2d0,_0x1f1db5[_0x09ba('0x3c')]);return db[_0x09ba('0x27')][_0x09ba('0x42')](_0x5eb2d0)[_0x09ba('0x24')](handleEntityNotFound(_0x3b6254,null))[_0x09ba('0x24')](respondWithResult(_0x3b6254,null))['catch'](handleError(_0x3b6254,null));};exports[_0x09ba('0x43')]=function(_0x5e1e73,_0x557d44){return db[_0x09ba('0x27')][_0x09ba('0x43')](_0x5e1e73['body'],{})[_0x09ba('0x24')](respondWithResult(_0x557d44,0xc9))['catch'](handleError(_0x557d44,null));};exports[_0x09ba('0x44')]=function(_0x5d1448,_0x414e6e){if(_0x5d1448[_0x09ba('0x45')]['id']){delete _0x5d1448[_0x09ba('0x45')]['id'];}return db[_0x09ba('0x27')][_0x09ba('0x42')]({'where':{'id':_0x5d1448[_0x09ba('0x41')]['id']}})['then'](handleEntityNotFound(_0x414e6e,null))[_0x09ba('0x24')](saveUpdates(_0x5d1448['body'],null))[_0x09ba('0x24')](respondWithResult(_0x414e6e,null))[_0x09ba('0x3f')](handleError(_0x414e6e,null));};exports['destroy']=function(_0x5a6541,_0x36510e){return db[_0x09ba('0x27')][_0x09ba('0x42')]({'where':{'id':_0x5a6541['params']['id']}})[_0x09ba('0x24')](handleEntityNotFound(_0x36510e,null))['then'](removeEntity(_0x36510e,null))['catch'](handleError(_0x36510e,null));};exports[_0x09ba('0x46')]=function(_0x15cfb3,_0xa02a71){return db['MemberReport']['describe']()[_0x09ba('0x24')](respondWithResult(_0xa02a71,null))[_0x09ba('0x3f')](handleError(_0xa02a71,null));}; \ No newline at end of file +var _0xa6d2=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','MemberReport','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x448c88,_0x1608ae){var _0x47bac9=function(_0x5e68be){while(--_0x5e68be){_0x448c88['push'](_0x448c88['shift']());}};_0x47bac9(++_0x1608ae);}(_0xa6d2,0x1af));var _0x2a6d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6d2[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x2a6d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a6d('0x1'));var jsonpatch=require(_0x2a6d('0x2'));var rp=require('request-promise');var moment=require(_0x2a6d('0x3'));var BPromise=require(_0x2a6d('0x4'));var Mustache=require(_0x2a6d('0x5'));var util=require(_0x2a6d('0x6'));var path=require('path');var sox=require(_0x2a6d('0x7'));var csv=require(_0x2a6d('0x8'));var ejs=require(_0x2a6d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a6d('0xa'));var crypto=require(_0x2a6d('0xb'));var jsforce=require(_0x2a6d('0xc'));var deskjs=require(_0x2a6d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a6d('0xe'));var Redis=require('ioredis');var authService=require(_0x2a6d('0xf'));var qs=require(_0x2a6d('0x10'));var hardwareService=require(_0x2a6d('0x11'));var logger=require(_0x2a6d('0x12'))('api');var utils=require(_0x2a6d('0x13'));var config=require(_0x2a6d('0x14'));var db=require(_0x2a6d('0x15'))['db'];function respondWithStatusCode(_0x1b4d61,_0x25d205){_0x25d205=_0x25d205||0xcc;return function(_0x34a526){if(_0x34a526){return _0x1b4d61[_0x2a6d('0x16')](_0x25d205);}return _0x1b4d61[_0x2a6d('0x17')](_0x25d205)[_0x2a6d('0x18')]();};}function respondWithResult(_0x3ee16f,_0x4a496b){_0x4a496b=_0x4a496b||0xc8;return function(_0x30ab79){if(_0x30ab79){return _0x3ee16f[_0x2a6d('0x17')](_0x4a496b)['json'](_0x30ab79);}};}function respondWithFilteredResult(_0x1b1d1b,_0x3ca755){return function(_0x2965cc){if(_0x2965cc){var _0x295058=_0x2965cc[_0x2a6d('0x19')],_0x5877fa=_0x3ca755[_0x2a6d('0x1a')],_0x13dfc7=_0x3ca755[_0x2a6d('0x1a')]+_0x3ca755[_0x2a6d('0x1b')],_0x23c2a0;if(_0x13dfc7>=_0x295058){_0x13dfc7=_0x295058;_0x23c2a0=0xc8;}else{_0x23c2a0=0xce;}_0x1b1d1b[_0x2a6d('0x17')](_0x23c2a0);return _0x1b1d1b[_0x2a6d('0x1c')](_0x2a6d('0x1d'),_0x5877fa+'-'+_0x13dfc7+'/'+_0x295058)[_0x2a6d('0x1e')](_0x2965cc);}return null;};}function patchUpdates(_0x787ce1){return function(_0x3d7a05){try{jsonpatch['apply'](_0x3d7a05,_0x787ce1,!![]);}catch(_0x556acc){return BPromise[_0x2a6d('0x1f')](_0x556acc);}return _0x3d7a05[_0x2a6d('0x20')]();};}function saveUpdates(_0x5b6ce6,_0x1ebeed){return function(_0x50fbf6){if(_0x50fbf6){return _0x50fbf6[_0x2a6d('0x21')](_0x5b6ce6)[_0x2a6d('0x22')](function(_0x2a6f34){return _0x2a6f34;});}return null;};}function removeEntity(_0x69f256,_0x1845f4){return function(_0x2a89f6){if(_0x2a89f6){return _0x2a89f6[_0x2a6d('0x23')]()[_0x2a6d('0x22')](function(){_0x69f256[_0x2a6d('0x17')](0xcc)[_0x2a6d('0x18')]();});}};}function handleEntityNotFound(_0x3fbc7e,_0x28fdbf){return function(_0x225227){if(!_0x225227){_0x3fbc7e[_0x2a6d('0x16')](0x194);}return _0x225227;};}function handleError(_0x33931c,_0x5a3e1f){_0x5a3e1f=_0x5a3e1f||0x1f4;return function(_0x329271){logger[_0x2a6d('0x24')](_0x329271[_0x2a6d('0x25')]);if(_0x329271['name']){delete _0x329271[_0x2a6d('0x26')];}_0x33931c[_0x2a6d('0x17')](_0x5a3e1f)[_0x2a6d('0x27')](_0x329271);};}exports[_0x2a6d('0x28')]=function(_0x590ad0,_0x2de86c){var _0x155648={},_0xd818de={},_0x220f11={'count':0x0,'rows':[]};var _0x4fe546=db['MemberReport']['rawAttributes'];_0xd818de['model']=_[_0x2a6d('0x29')](_0x4fe546);_0xd818de[_0x2a6d('0x2a')]=_['keys'](_0x590ad0[_0x2a6d('0x2a')]);_0xd818de['filters']=_['intersection'](_0xd818de[_0x2a6d('0x2b')],_0xd818de[_0x2a6d('0x2a')]);_0x155648['attributes']=_[_0x2a6d('0x2c')](_0xd818de[_0x2a6d('0x2b')],qs[_0x2a6d('0x2d')](_0x590ad0['query'][_0x2a6d('0x2d')]));_0x155648[_0x2a6d('0x2e')]=_0x155648[_0x2a6d('0x2e')][_0x2a6d('0x2f')]?_0x155648['attributes']:_0xd818de['model'];if(!_0x590ad0['query'][_0x2a6d('0x30')](_0x2a6d('0x31'))){_0x155648[_0x2a6d('0x1b')]=qs[_0x2a6d('0x1b')](_0x590ad0[_0x2a6d('0x2a')]['limit']);_0x155648[_0x2a6d('0x1a')]=qs[_0x2a6d('0x1a')](_0x590ad0[_0x2a6d('0x2a')][_0x2a6d('0x1a')]);}_0x155648[_0x2a6d('0x32')]=qs[_0x2a6d('0x33')](_0x590ad0[_0x2a6d('0x2a')]['sort']);_0x155648[_0x2a6d('0x34')]=qs[_0x2a6d('0x35')](_[_0x2a6d('0x36')](_0x590ad0['query'],_0xd818de['filters']));if(_0x590ad0[_0x2a6d('0x2a')][_0x2a6d('0x37')]){_0x155648['where']=_[_0x2a6d('0x38')](_0x155648[_0x2a6d('0x34')],{'$or':_[_0x2a6d('0x39')](_0x4fe546,function(_0x3e593c){if(_0x3e593c[_0x2a6d('0x3a')]['key']!==_0x2a6d('0x3b')){var _0x552fd1={};_0x552fd1[_0x3e593c[_0x2a6d('0x3c')]]={'$like':'%'+_0x590ad0[_0x2a6d('0x2a')]['filter']+'%'};return _0x552fd1;}})});}_0x155648=_[_0x2a6d('0x38')]({},_0x155648,_0x590ad0[_0x2a6d('0x3d')]);var _0x9f98a7={'where':_0x155648[_0x2a6d('0x34')]};return db[_0x2a6d('0x3e')][_0x2a6d('0x19')](_0x9f98a7)[_0x2a6d('0x22')](function(_0x265103){_0x220f11[_0x2a6d('0x19')]=_0x265103;if(_0x590ad0['query']['includeAll']){_0x155648['include']=[{'all':!![]}];}return db[_0x2a6d('0x3e')]['findAll'](_0x155648);})['then'](function(_0xd59de3){_0x220f11['rows']=_0xd59de3;return _0x220f11;})[_0x2a6d('0x22')](respondWithFilteredResult(_0x2de86c,_0x155648))[_0x2a6d('0x3f')](handleError(_0x2de86c,null));};exports[_0x2a6d('0x40')]=function(_0x32c5f8,_0x2c1e95){var _0xa2ca16={'raw':!![],'where':{'id':_0x32c5f8[_0x2a6d('0x41')]['id']}},_0x55df37={};_0x55df37['model']=_[_0x2a6d('0x29')](db[_0x2a6d('0x3e')][_0x2a6d('0x42')]);_0x55df37['query']=_[_0x2a6d('0x29')](_0x32c5f8[_0x2a6d('0x2a')]);_0x55df37[_0x2a6d('0x35')]=_[_0x2a6d('0x2c')](_0x55df37['model'],_0x55df37[_0x2a6d('0x2a')]);_0xa2ca16[_0x2a6d('0x2e')]=_[_0x2a6d('0x2c')](_0x55df37['model'],qs['fields'](_0x32c5f8['query'][_0x2a6d('0x2d')]));_0xa2ca16[_0x2a6d('0x2e')]=_0xa2ca16[_0x2a6d('0x2e')][_0x2a6d('0x2f')]?_0xa2ca16['attributes']:_0x55df37[_0x2a6d('0x2b')];if(_0x32c5f8[_0x2a6d('0x2a')][_0x2a6d('0x43')]){_0xa2ca16[_0x2a6d('0x44')]=[{'all':!![]}];}_0xa2ca16=_[_0x2a6d('0x38')]({},_0xa2ca16,_0x32c5f8[_0x2a6d('0x3d')]);return db[_0x2a6d('0x3e')][_0x2a6d('0x45')](_0xa2ca16)[_0x2a6d('0x22')](handleEntityNotFound(_0x2c1e95,null))['then'](respondWithResult(_0x2c1e95,null))[_0x2a6d('0x3f')](handleError(_0x2c1e95,null));};exports[_0x2a6d('0x46')]=function(_0x4efbd4,_0x34a913){return db[_0x2a6d('0x3e')][_0x2a6d('0x46')](_0x4efbd4[_0x2a6d('0x47')],{})[_0x2a6d('0x22')](respondWithResult(_0x34a913,0xc9))[_0x2a6d('0x3f')](handleError(_0x34a913,null));};exports[_0x2a6d('0x21')]=function(_0x56708b,_0x3626fc){if(_0x56708b['body']['id']){delete _0x56708b[_0x2a6d('0x47')]['id'];}return db[_0x2a6d('0x3e')][_0x2a6d('0x45')]({'where':{'id':_0x56708b[_0x2a6d('0x41')]['id']}})[_0x2a6d('0x22')](handleEntityNotFound(_0x3626fc,null))[_0x2a6d('0x22')](saveUpdates(_0x56708b[_0x2a6d('0x47')],null))[_0x2a6d('0x22')](respondWithResult(_0x3626fc,null))[_0x2a6d('0x3f')](handleError(_0x3626fc,null));};exports[_0x2a6d('0x23')]=function(_0x1d4f27,_0x21a73e){return db[_0x2a6d('0x3e')][_0x2a6d('0x45')]({'where':{'id':_0x1d4f27['params']['id']}})[_0x2a6d('0x22')](handleEntityNotFound(_0x21a73e,null))[_0x2a6d('0x22')](removeEntity(_0x21a73e,null))[_0x2a6d('0x3f')](handleError(_0x21a73e,null));};exports[_0x2a6d('0x48')]=function(_0x117513,_0x12a727){return db[_0x2a6d('0x3e')][_0x2a6d('0x48')]()[_0x2a6d('0x22')](respondWithResult(_0x12a727,null))[_0x2a6d('0x3f')](handleError(_0x12a727,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c890217..f34fbba 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 _0x5dcd=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','moment','bluebird','path','rimraf'];(function(_0x16de29,_0x5e7186){var _0x249bc3=function(_0x40832c){while(--_0x40832c){_0x16de29['push'](_0x16de29['shift']());}};_0x249bc3(++_0x5e7186);}(_0x5dcd,0x14a));var _0xd5dc=function(_0x46ca28,_0x5a9910){_0x46ca28=_0x46ca28-0x0;var _0x3acc14=_0x5dcd[_0x46ca28];return _0x3acc14;};'use strict';var _=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd5dc('0x2'));var BPromise=require(_0xd5dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5dc('0x4'));var rimraf=require(_0xd5dc('0x5'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x2ec808,_0x42f757){return _0x2ec808[_0xd5dc('0x6')](_0xd5dc('0x7'),attributes,{'tableName':_0xd5dc('0x8'),'paranoid':![],'indexes':[{'name':_0xd5dc('0x9'),'fields':[_0xd5dc('0xa'),_0xd5dc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb89=['api','moment','bluebird','request-promise','../../config/environment','exports','MemberReport','report_member','membername_interface','membername','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xdb89,0x107));var _0x9db8=function(_0x51ed9a,_0x285188){_0x51ed9a=_0x51ed9a-0x0;var _0x4767c7=_0xdb89[_0x51ed9a];return _0x4767c7;};'use strict';var _=require('lodash');var util=require(_0x9db8('0x0'));var logger=require('../../config/logger')(_0x9db8('0x1'));var moment=require(_0x9db8('0x2'));var BPromise=require(_0x9db8('0x3'));var rp=require(_0x9db8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9db8('0x5'));var attributes=require('./memberReport.attributes');module[_0x9db8('0x6')]=function(_0xa1022a,_0x2c4a57){return _0xa1022a['define'](_0x9db8('0x7'),attributes,{'tableName':_0x9db8('0x8'),'paranoid':![],'indexes':[{'name':_0x9db8('0x9'),'fields':[_0x9db8('0xa'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 50f06fc..f7d8d7f 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 _0xbce7=['then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','catch','CreateMemberReport','create','update','body','UpdateMemberReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0xf3e31a,_0x3b9ea3){var _0x18333a=function(_0x33d86f){while(--_0x33d86f){_0xf3e31a['push'](_0xf3e31a['shift']());}};_0x18333a(++_0x3b9ea3);}(_0xbce7,0x196));var _0x7bce=function(_0xc538e,_0x3eb245){_0xc538e=_0xc538e-0x0;var _0x439257=_0xbce7[_0xc538e];return _0x439257;};'use strict';var _=require(_0x7bce('0x0'));var util=require('util');var moment=require(_0x7bce('0x1'));var BPromise=require(_0x7bce('0x2'));var rs=require(_0x7bce('0x3'));var fs=require('fs');var Redis=require(_0x7bce('0x4'));var db=require(_0x7bce('0x5'))['db'];var utils=require(_0x7bce('0x6'));var logger=require(_0x7bce('0x7'))('rpc');var config=require(_0x7bce('0x8'));var jayson=require(_0x7bce('0x9'));var client=jayson[_0x7bce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33a795,_0x2a9e2d,_0x11a585){return new BPromise(function(_0x4290e7,_0x15406c){return client[_0x7bce('0xb')](_0x33a795,_0x11a585)[_0x7bce('0xc')](function(_0x44a05c){logger[_0x7bce('0xd')](_0x7bce('0xe'),_0x2a9e2d,_0x7bce('0xf'));logger[_0x7bce('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2a9e2d,'request\x20sent',JSON[_0x7bce('0x11')](_0x44a05c));if(_0x44a05c[_0x7bce('0x12')]){if(_0x44a05c['error'][_0x7bce('0x13')]===0x1f4){logger[_0x7bce('0x12')](_0x7bce('0xe'),_0x2a9e2d,_0x44a05c[_0x7bce('0x12')]['message']);return _0x15406c(_0x44a05c[_0x7bce('0x12')][_0x7bce('0x14')]);}logger[_0x7bce('0x12')](_0x7bce('0xe'),_0x2a9e2d,_0x44a05c['error']['message']);return _0x4290e7(_0x44a05c['error'][_0x7bce('0x14')]);}else{logger[_0x7bce('0xd')](_0x7bce('0xe'),_0x2a9e2d,_0x7bce('0xf'));_0x4290e7(_0x44a05c['result']['message']);}})['catch'](function(_0xa78af0){logger[_0x7bce('0x12')](_0x7bce('0xe'),_0x2a9e2d,_0xa78af0);_0x15406c(_0xa78af0);});});}exports[_0x7bce('0x15')]=function(_0x321d97){var _0x119e80=this;return new Promise(function(_0x197b39,_0x103df3){return db[_0x7bce('0x16')][_0x7bce('0x17')]({'raw':_0x321d97[_0x7bce('0x18')]?_0x321d97['options'][_0x7bce('0x19')]===undefined?!![]:![]:!![],'where':_0x321d97[_0x7bce('0x18')]?_0x321d97['options'][_0x7bce('0x1a')]||null:null,'attributes':_0x321d97[_0x7bce('0x18')]?_0x321d97[_0x7bce('0x18')][_0x7bce('0x1b')]||null:null,'limit':_0x321d97[_0x7bce('0x18')]?_0x321d97['options'][_0x7bce('0x1c')]||null:null,'include':_0x321d97[_0x7bce('0x18')]?_0x321d97[_0x7bce('0x18')]['include']?_[_0x7bce('0x1d')](_0x321d97[_0x7bce('0x18')][_0x7bce('0x1e')],function(_0x2e98a3){return{'model':db[_0x2e98a3[_0x7bce('0x1f')]],'as':_0x2e98a3['as'],'attributes':_0x2e98a3[_0x7bce('0x1b')],'include':_0x2e98a3['include']?_[_0x7bce('0x1d')](_0x2e98a3[_0x7bce('0x1e')],function(_0x512452){return{'model':db[_0x512452[_0x7bce('0x1f')]],'as':_0x512452['as'],'attributes':_0x512452['attributes'],'include':_0x512452[_0x7bce('0x1e')]?_[_0x7bce('0x1d')](_0x512452['include'],function(_0x2b4519){return{'model':db[_0x2b4519[_0x7bce('0x1f')]],'as':_0x2b4519['as'],'attributes':_0x2b4519['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bce('0xc')](function(_0x2a4a56){logger[_0x7bce('0xd')](_0x7bce('0x15'),_0x321d97);logger[_0x7bce('0x10')](_0x7bce('0x15'),_0x321d97,JSON['stringify'](_0x2a4a56));_0x197b39(_0x2a4a56);})[_0x7bce('0x20')](function(_0x5a5d8d){logger[_0x7bce('0x12')](_0x7bce('0x15'),_0x5a5d8d[_0x7bce('0x14')],_0x321d97);_0x103df3(_0x119e80['error'](0x1f4,_0x5a5d8d[_0x7bce('0x14')]));});});};exports[_0x7bce('0x21')]=function(_0x18d25e){var _0x4ed587=this;return new Promise(function(_0x119dd5,_0x529973){return db[_0x7bce('0x16')][_0x7bce('0x22')](_0x18d25e['body'],{'raw':_0x18d25e[_0x7bce('0x18')]?_0x18d25e[_0x7bce('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7bce('0xc')](function(_0x9a6c9){logger['info'](_0x7bce('0x21'),_0x18d25e);logger[_0x7bce('0x10')]('CreateMemberReport',_0x18d25e,JSON[_0x7bce('0x11')](_0x9a6c9));_0x119dd5(_0x9a6c9);})[_0x7bce('0x20')](function(_0x75b174){logger['error'](_0x7bce('0x21'),_0x75b174[_0x7bce('0x14')],_0x18d25e);_0x529973(_0x4ed587['error'](0x1f4,_0x75b174[_0x7bce('0x14')]));});});};exports['UpdateMemberReport']=function(_0x536e62){var _0x567ea3=this;return new Promise(function(_0x1bb2bc,_0x40ae28){return db[_0x7bce('0x16')][_0x7bce('0x23')](_0x536e62[_0x7bce('0x24')],{'raw':_0x536e62['options']?_0x536e62['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x536e62[_0x7bce('0x18')]?_0x536e62[_0x7bce('0x18')][_0x7bce('0x1a')]||null:null,'attributes':_0x536e62[_0x7bce('0x18')]?_0x536e62[_0x7bce('0x18')]['attributes']||null:null,'limit':_0x536e62[_0x7bce('0x18')]?_0x536e62[_0x7bce('0x18')][_0x7bce('0x1c')]||null:null})[_0x7bce('0xc')](function(_0x21cfb2){logger['info'](_0x7bce('0x25'),_0x536e62);logger[_0x7bce('0x10')](_0x7bce('0x25'),_0x536e62,JSON[_0x7bce('0x11')](_0x21cfb2));_0x1bb2bc(_0x21cfb2);})[_0x7bce('0x20')](function(_0x3a4c43){logger[_0x7bce('0x12')](_0x7bce('0x25'),_0x3a4c43[_0x7bce('0x14')],_0x536e62);_0x40ae28(_0x567ea3[_0x7bce('0x12')](0x1f4,_0x3a4c43['message']));});});}; \ No newline at end of file +var _0x9107=['limit','map','include','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','findAll','options','raw','where','attributes'];(function(_0x1c1ab1,_0x5b9f1c){var _0x2502d7=function(_0x4b5961){while(--_0x4b5961){_0x1c1ab1['push'](_0x1c1ab1['shift']());}};_0x2502d7(++_0x5b9f1c);}(_0x9107,0x10c));var _0x7910=function(_0x20af3c,_0x12602b){_0x20af3c=_0x20af3c-0x0;var _0x595803=_0x9107[_0x20af3c];return _0x595803;};'use strict';var _=require(_0x7910('0x0'));var util=require(_0x7910('0x1'));var moment=require('moment');var BPromise=require(_0x7910('0x2'));var rs=require(_0x7910('0x3'));var fs=require('fs');var Redis=require(_0x7910('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7910('0x5'))('rpc');var config=require(_0x7910('0x6'));var jayson=require(_0x7910('0x7'));var client=jayson[_0x7910('0x8')][_0x7910('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ae9d8,_0x21fb3e,_0x2add8a){return new BPromise(function(_0x1bf149,_0x3fb8b1){return client[_0x7910('0xa')](_0x3ae9d8,_0x2add8a)[_0x7910('0xb')](function(_0x58ccaf){logger[_0x7910('0xc')]('MemberReport,\x20%s,\x20%s',_0x21fb3e,'request\x20sent');logger[_0x7910('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x21fb3e,_0x7910('0xe'),JSON[_0x7910('0xf')](_0x58ccaf));if(_0x58ccaf['error']){if(_0x58ccaf[_0x7910('0x10')][_0x7910('0x11')]===0x1f4){logger[_0x7910('0x10')](_0x7910('0x12'),_0x21fb3e,_0x58ccaf[_0x7910('0x10')]['message']);return _0x3fb8b1(_0x58ccaf[_0x7910('0x10')][_0x7910('0x13')]);}logger[_0x7910('0x10')]('MemberReport,\x20%s,\x20%s',_0x21fb3e,_0x58ccaf[_0x7910('0x10')][_0x7910('0x13')]);return _0x1bf149(_0x58ccaf[_0x7910('0x10')][_0x7910('0x13')]);}else{logger[_0x7910('0xc')](_0x7910('0x12'),_0x21fb3e,'request\x20sent');_0x1bf149(_0x58ccaf[_0x7910('0x14')][_0x7910('0x13')]);}})[_0x7910('0x15')](function(_0x56a436){logger[_0x7910('0x10')]('MemberReport,\x20%s,\x20%s',_0x21fb3e,_0x56a436);_0x3fb8b1(_0x56a436);});});}exports['GetMemberReport']=function(_0x264122){var _0x5cf130=this;return new Promise(function(_0x1b4d15,_0x5bbf93){return db[_0x7910('0x16')][_0x7910('0x17')]({'raw':_0x264122['options']?_0x264122[_0x7910('0x18')][_0x7910('0x19')]===undefined?!![]:![]:!![],'where':_0x264122[_0x7910('0x18')]?_0x264122['options'][_0x7910('0x1a')]||null:null,'attributes':_0x264122[_0x7910('0x18')]?_0x264122[_0x7910('0x18')][_0x7910('0x1b')]||null:null,'limit':_0x264122[_0x7910('0x18')]?_0x264122[_0x7910('0x18')][_0x7910('0x1c')]||null:null,'include':_0x264122['options']?_0x264122[_0x7910('0x18')]['include']?_[_0x7910('0x1d')](_0x264122[_0x7910('0x18')][_0x7910('0x1e')],function(_0x31f8c1){return{'model':db[_0x31f8c1['model']],'as':_0x31f8c1['as'],'attributes':_0x31f8c1[_0x7910('0x1b')],'include':_0x31f8c1['include']?_[_0x7910('0x1d')](_0x31f8c1[_0x7910('0x1e')],function(_0x400561){return{'model':db[_0x400561[_0x7910('0x1f')]],'as':_0x400561['as'],'attributes':_0x400561['attributes'],'include':_0x400561[_0x7910('0x1e')]?_['map'](_0x400561[_0x7910('0x1e')],function(_0x4a41fb){return{'model':db[_0x4a41fb[_0x7910('0x1f')]],'as':_0x4a41fb['as'],'attributes':_0x4a41fb[_0x7910('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x203f97){logger[_0x7910('0xc')](_0x7910('0x20'),_0x264122);logger[_0x7910('0xd')](_0x7910('0x20'),_0x264122,JSON[_0x7910('0xf')](_0x203f97));_0x1b4d15(_0x203f97);})[_0x7910('0x15')](function(_0x594c0f){logger[_0x7910('0x10')]('GetMemberReport',_0x594c0f['message'],_0x264122);_0x5bbf93(_0x5cf130[_0x7910('0x10')](0x1f4,_0x594c0f[_0x7910('0x13')]));});});};exports['CreateMemberReport']=function(_0x4f5c17){var _0x1d7b93=this;return new Promise(function(_0x291488,_0xe3de94){return db[_0x7910('0x16')][_0x7910('0x21')](_0x4f5c17[_0x7910('0x22')],{'raw':_0x4f5c17[_0x7910('0x18')]?_0x4f5c17[_0x7910('0x18')][_0x7910('0x19')]===undefined?!![]:![]:!![]})[_0x7910('0xb')](function(_0x32b1a1){logger[_0x7910('0xc')](_0x7910('0x23'),_0x4f5c17);logger[_0x7910('0xd')](_0x7910('0x23'),_0x4f5c17,JSON[_0x7910('0xf')](_0x32b1a1));_0x291488(_0x32b1a1);})[_0x7910('0x15')](function(_0x3ebbec){logger['error']('CreateMemberReport',_0x3ebbec['message'],_0x4f5c17);_0xe3de94(_0x1d7b93['error'](0x1f4,_0x3ebbec[_0x7910('0x13')]));});});};exports[_0x7910('0x24')]=function(_0x3e412c){var _0x143537=this;return new Promise(function(_0x4193d4,_0x5ab655){return db[_0x7910('0x16')]['update'](_0x3e412c['body'],{'raw':_0x3e412c[_0x7910('0x18')]?_0x3e412c[_0x7910('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e412c[_0x7910('0x18')]?_0x3e412c[_0x7910('0x18')]['where']||null:null,'attributes':_0x3e412c[_0x7910('0x18')]?_0x3e412c[_0x7910('0x18')][_0x7910('0x1b')]||null:null,'limit':_0x3e412c['options']?_0x3e412c[_0x7910('0x18')][_0x7910('0x1c')]||null:null})['then'](function(_0x4e7a91){logger[_0x7910('0xc')](_0x7910('0x24'),_0x3e412c);logger['debug'](_0x7910('0x24'),_0x3e412c,JSON['stringify'](_0x4e7a91));_0x4193d4(_0x4e7a91);})[_0x7910('0x15')](function(_0xf7503d){logger[_0x7910('0x10')](_0x7910('0x24'),_0xf7503d[_0x7910('0x13')],_0x3e412c);_0x5ab655(_0x143537[_0x7910('0x10')](0x1f4,_0xf7503d[_0x7910('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 65acb09..48bca78 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 _0x05de=['get','index','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x156e9e,_0x380747){var _0x1ecb87=function(_0xa106e3){while(--_0xa106e3){_0x156e9e['push'](_0x156e9e['shift']());}};_0x1ecb87(++_0x380747);}(_0x05de,0x16a));var _0xe05d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x05de[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe05d('0x0'));var util=require(_0xe05d('0x1'));var path=require(_0xe05d('0x2'));var timeout=require(_0xe05d('0x3'));var express=require(_0xe05d('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe05d('0x5'));var config=require(_0xe05d('0x6'));var controller=require('./migration.controller');router[_0xe05d('0x7')]('/',controller[_0xe05d('0x8')]);module['exports']=router; \ No newline at end of file +var _0xc9a1=['util','path','express','../../components/auth/service','../../components/interaction/service','get','exports','multer'];(function(_0x554f77,_0x981c71){var _0xe89b8e=function(_0x4b00d9){while(--_0x4b00d9){_0x554f77['push'](_0x554f77['shift']());}};_0xe89b8e(++_0x981c71);}(_0xc9a1,0xb7));var _0x1c9a=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc9a1[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x1c9a('0x0'));var util=require(_0x1c9a('0x1'));var path=require(_0x1c9a('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c9a('0x3'));var router=express['Router']();var auth=require(_0x1c9a('0x4'));var interaction=require(_0x1c9a('0x5'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x1c9a('0x6')]('/',controller['index']);module[_0x1c9a('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 8ff1929..3cdcbe3 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 _0xbcbd=['exports','STRING','version','sequelize'];(function(_0xbef9fe,_0x53f478){var _0x23b729=function(_0x46823a){while(--_0x46823a){_0xbef9fe['push'](_0xbef9fe['shift']());}};_0x23b729(++_0x53f478);}(_0xbcbd,0x173));var _0xdbcb=function(_0x36f5cb,_0x2a720f){_0x36f5cb=_0x36f5cb-0x0;var _0x58d6ce=_0xbcbd[_0x36f5cb];return _0x58d6ce;};'use strict';var Sequelize=require(_0xdbcb('0x0'));module[_0xdbcb('0x1')]={'version':{'type':Sequelize[_0xdbcb('0x2')],'unique':_0xdbcb('0x3')}}; \ No newline at end of file +var _0xed2e=['sequelize','exports','STRING','version'];(function(_0x2a9b1f,_0x3af52e){var _0xbc7f63=function(_0xaa01b4){while(--_0xaa01b4){_0x2a9b1f['push'](_0x2a9b1f['shift']());}};_0xbc7f63(++_0x3af52e);}(_0xed2e,0x198));var _0xeed2=function(_0x56daee,_0x3e7fea){_0x56daee=_0x56daee-0x0;var _0x2f1f37=_0xed2e[_0x56daee];return _0x2f1f37;};'use strict';var Sequelize=require(_0xeed2('0x0'));module[_0xeed2('0x1')]={'version':{'type':Sequelize[_0xeed2('0x2')],'unique':_0xeed2('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 275005b..d7bfc0c 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 _0x58a9=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','merge','include','findAll','rows','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','Migration','rawAttributes'];(function(_0x570398,_0x146bde){var _0x463e5f=function(_0x30010d){while(--_0x30010d){_0x570398['push'](_0x570398['shift']());}};_0x463e5f(++_0x146bde);}(_0x58a9,0x1a3));var _0x958a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58a9[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x958a('0x0'));var emlformat=require(_0x958a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x958a('0x2'));var jsonpatch=require(_0x958a('0x3'));var rp=require(_0x958a('0x4'));var moment=require('moment');var BPromise=require(_0x958a('0x5'));var Mustache=require(_0x958a('0x6'));var util=require('util');var path=require(_0x958a('0x7'));var sox=require(_0x958a('0x8'));var csv=require('to-csv');var ejs=require(_0x958a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x958a('0xa'));var crypto=require(_0x958a('0xb'));var jsforce=require(_0x958a('0xc'));var deskjs=require(_0x958a('0xd'));var toCsv=require(_0x958a('0xe'));var querystring=require(_0x958a('0xf'));var Papa=require('papaparse');var Redis=require(_0x958a('0x10'));var authService=require(_0x958a('0x11'));var qs=require(_0x958a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x958a('0x13'));var utils=require(_0x958a('0x14'));var config=require(_0x958a('0x15'));var db=require(_0x958a('0x16'))['db'];function respondWithStatusCode(_0x40706a,_0x3c8f4a){_0x3c8f4a=_0x3c8f4a||0xcc;return function(_0x28e9d9){if(_0x28e9d9){return _0x40706a[_0x958a('0x17')](_0x3c8f4a);}return _0x40706a['status'](_0x3c8f4a)[_0x958a('0x18')]();};}function respondWithResult(_0x1a9e37,_0x12c19c){_0x12c19c=_0x12c19c||0xc8;return function(_0x3fed0f){if(_0x3fed0f){return _0x1a9e37['status'](_0x12c19c)[_0x958a('0x19')](_0x3fed0f);}};}function respondWithFilteredResult(_0x3e55f9,_0x11e7ae){return function(_0xaa293b){if(_0xaa293b){var _0x1e6b89=_0xaa293b[_0x958a('0x1a')],_0x5bb5d9=_0x11e7ae[_0x958a('0x1b')],_0x24f08e=_0x11e7ae[_0x958a('0x1b')]+_0x11e7ae[_0x958a('0x1c')],_0xc38887;if(_0x24f08e>=_0x1e6b89){_0x24f08e=_0x1e6b89;_0xc38887=0xc8;}else{_0xc38887=0xce;}_0x3e55f9[_0x958a('0x1d')](_0xc38887);return _0x3e55f9[_0x958a('0x1e')](_0x958a('0x1f'),_0x5bb5d9+'-'+_0x24f08e+'/'+_0x1e6b89)[_0x958a('0x19')](_0xaa293b);}return null;};}function patchUpdates(_0x5196bf){return function(_0x33df77){try{jsonpatch['apply'](_0x33df77,_0x5196bf,!![]);}catch(_0x1c2aae){return BPromise[_0x958a('0x20')](_0x1c2aae);}return _0x33df77[_0x958a('0x21')]();};}function saveUpdates(_0x1c92d2,_0x355657){return function(_0x1b7b22){if(_0x1b7b22){return _0x1b7b22[_0x958a('0x22')](_0x1c92d2)[_0x958a('0x23')](function(_0x3154ce){return _0x3154ce;});}return null;};}function removeEntity(_0x3fb5c6,_0xa42262){return function(_0x1b5315){if(_0x1b5315){return _0x1b5315[_0x958a('0x24')]()['then'](function(){_0x3fb5c6['status'](0xcc)[_0x958a('0x18')]();});}};}function handleEntityNotFound(_0x1e5a87,_0x131029){return function(_0x13a88b){if(!_0x13a88b){_0x1e5a87['sendStatus'](0x194);}return _0x13a88b;};}function handleError(_0x35e5a6,_0x429ea9){_0x429ea9=_0x429ea9||0x1f4;return function(_0x354ffe){logger['error'](_0x354ffe[_0x958a('0x25')]);if(_0x354ffe['name']){delete _0x354ffe[_0x958a('0x26')];}_0x35e5a6[_0x958a('0x1d')](_0x429ea9)[_0x958a('0x27')](_0x354ffe);};}exports[_0x958a('0x28')]=function(_0x360c6c,_0x11dad3){var _0x15c9a2={},_0x5a5f6b={},_0x2fd250={'count':0x0,'rows':[]};var _0xe0d2=db[_0x958a('0x29')][_0x958a('0x2a')];_0x5a5f6b[_0x958a('0x2b')]=_[_0x958a('0x2c')](_0xe0d2);_0x5a5f6b['query']=_['keys'](_0x360c6c['query']);_0x5a5f6b[_0x958a('0x2d')]=_[_0x958a('0x2e')](_0x5a5f6b[_0x958a('0x2b')],_0x5a5f6b[_0x958a('0x2f')]);_0x15c9a2[_0x958a('0x30')]=_['intersection'](_0x5a5f6b['model'],qs[_0x958a('0x31')](_0x360c6c[_0x958a('0x2f')][_0x958a('0x31')]));_0x15c9a2[_0x958a('0x30')]=_0x15c9a2[_0x958a('0x30')][_0x958a('0x32')]?_0x15c9a2[_0x958a('0x30')]:_0x5a5f6b['model'];if(!_0x360c6c[_0x958a('0x2f')][_0x958a('0x33')](_0x958a('0x34'))){_0x15c9a2[_0x958a('0x1c')]=qs[_0x958a('0x1c')](_0x360c6c[_0x958a('0x2f')][_0x958a('0x1c')]);_0x15c9a2[_0x958a('0x1b')]=qs[_0x958a('0x1b')](_0x360c6c[_0x958a('0x2f')][_0x958a('0x1b')]);}_0x15c9a2[_0x958a('0x35')]=qs['sort'](_0x360c6c[_0x958a('0x2f')][_0x958a('0x36')]);_0x15c9a2[_0x958a('0x37')]=qs[_0x958a('0x2d')](_['pick'](_0x360c6c[_0x958a('0x2f')],_0x5a5f6b[_0x958a('0x2d')]));if(_0x360c6c[_0x958a('0x2f')][_0x958a('0x38')]){_0x15c9a2[_0x958a('0x37')]=_['merge'](_0x15c9a2['where'],{'$or':_['map'](_0xe0d2,function(_0x2c6d98){if(_0x2c6d98[_0x958a('0x39')][_0x958a('0x3a')]!==_0x958a('0x3b')){var _0x194b43={};_0x194b43[_0x2c6d98[_0x958a('0x3c')]]={'$like':'%'+_0x360c6c[_0x958a('0x2f')][_0x958a('0x38')]+'%'};return _0x194b43;}})});}_0x15c9a2=_[_0x958a('0x3d')]({},_0x15c9a2,_0x360c6c['options']);var _0x2b5e70={'where':_0x15c9a2[_0x958a('0x37')]};return db[_0x958a('0x29')]['count'](_0x2b5e70)['then'](function(_0x354fe9){_0x2fd250[_0x958a('0x1a')]=_0x354fe9;if(_0x360c6c['query']['includeAll']){_0x15c9a2[_0x958a('0x3e')]=[{'all':!![]}];}return db['Migration'][_0x958a('0x3f')](_0x15c9a2);})['then'](function(_0x1b9a9f){_0x2fd250[_0x958a('0x40')]=_0x1b9a9f;return _0x2fd250;})[_0x958a('0x23')](respondWithFilteredResult(_0x11dad3,_0x15c9a2))[_0x958a('0x41')](handleError(_0x11dad3,null));}; \ No newline at end of file +var _0xc0f9=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','error','stack','name','send','index','Migration','rawAttributes','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','options','then','includeAll','include','findAll','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware'];(function(_0x4b1910,_0x4657d2){var _0x30fd03=function(_0x1dcdc6){while(--_0x1dcdc6){_0x4b1910['push'](_0x4b1910['shift']());}};_0x30fd03(++_0x4657d2);}(_0xc0f9,0x174));var _0x9c0f=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xc0f9[_0x10b48a];return _0x2c4533;};'use strict';var pdf=require(_0x9c0f('0x0'));var emlformat=require(_0x9c0f('0x1'));var rimraf=require(_0x9c0f('0x2'));var zipdir=require(_0x9c0f('0x3'));var jsonpatch=require(_0x9c0f('0x4'));var rp=require('request-promise');var moment=require(_0x9c0f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9c0f('0x6'));var path=require(_0x9c0f('0x7'));var sox=require(_0x9c0f('0x8'));var csv=require(_0x9c0f('0x9'));var ejs=require(_0x9c0f('0xa'));var fs=require('fs');var _=require(_0x9c0f('0xb'));var squel=require(_0x9c0f('0xc'));var crypto=require(_0x9c0f('0xd'));var jsforce=require(_0x9c0f('0xe'));var deskjs=require(_0x9c0f('0xf'));var toCsv=require(_0x9c0f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9c0f('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9c0f('0x11'));var logger=require(_0x9c0f('0x12'))(_0x9c0f('0x13'));var utils=require(_0x9c0f('0x14'));var config=require(_0x9c0f('0x15'));var db=require(_0x9c0f('0x16'))['db'];function respondWithStatusCode(_0x285775,_0x30f987){_0x30f987=_0x30f987||0xcc;return function(_0x124ea0){if(_0x124ea0){return _0x285775[_0x9c0f('0x17')](_0x30f987);}return _0x285775[_0x9c0f('0x18')](_0x30f987)[_0x9c0f('0x19')]();};}function respondWithResult(_0x483262,_0x3e684b){_0x3e684b=_0x3e684b||0xc8;return function(_0x10559b){if(_0x10559b){return _0x483262[_0x9c0f('0x18')](_0x3e684b)[_0x9c0f('0x1a')](_0x10559b);}};}function respondWithFilteredResult(_0x5c578c,_0x2310ae){return function(_0x1f8e47){if(_0x1f8e47){var _0x2ee004=_0x1f8e47[_0x9c0f('0x1b')],_0x4f25e4=_0x2310ae['offset'],_0x1f6050=_0x2310ae[_0x9c0f('0x1c')]+_0x2310ae[_0x9c0f('0x1d')],_0x1515c8;if(_0x1f6050>=_0x2ee004){_0x1f6050=_0x2ee004;_0x1515c8=0xc8;}else{_0x1515c8=0xce;}_0x5c578c[_0x9c0f('0x18')](_0x1515c8);return _0x5c578c[_0x9c0f('0x1e')]('Content-Range',_0x4f25e4+'-'+_0x1f6050+'/'+_0x2ee004)[_0x9c0f('0x1a')](_0x1f8e47);}return null;};}function patchUpdates(_0x58b869){return function(_0x82bb3){try{jsonpatch[_0x9c0f('0x1f')](_0x82bb3,_0x58b869,!![]);}catch(_0x45039b){return BPromise[_0x9c0f('0x20')](_0x45039b);}return _0x82bb3[_0x9c0f('0x21')]();};}function saveUpdates(_0x17c478,_0x3ac21f){return function(_0x242207){if(_0x242207){return _0x242207[_0x9c0f('0x22')](_0x17c478)['then'](function(_0x41d655){return _0x41d655;});}return null;};}function removeEntity(_0x21c35e,_0x279cdf){return function(_0x4e004f){if(_0x4e004f){return _0x4e004f['destroy']()['then'](function(){_0x21c35e['status'](0xcc)[_0x9c0f('0x19')]();});}};}function handleEntityNotFound(_0x3a5435,_0x17151f){return function(_0xf084b2){if(!_0xf084b2){_0x3a5435[_0x9c0f('0x17')](0x194);}return _0xf084b2;};}function handleError(_0x4ccd34,_0x3d0bc7){_0x3d0bc7=_0x3d0bc7||0x1f4;return function(_0x5cb224){logger[_0x9c0f('0x23')](_0x5cb224[_0x9c0f('0x24')]);if(_0x5cb224[_0x9c0f('0x25')]){delete _0x5cb224[_0x9c0f('0x25')];}_0x4ccd34[_0x9c0f('0x18')](_0x3d0bc7)[_0x9c0f('0x26')](_0x5cb224);};}exports[_0x9c0f('0x27')]=function(_0xaedb0a,_0x5ad781){var _0x40e41a={},_0x45fc92={},_0x171078={'count':0x0,'rows':[]};var _0x457828=db[_0x9c0f('0x28')][_0x9c0f('0x29')];_0x45fc92[_0x9c0f('0x2a')]=_['keys'](_0x457828);_0x45fc92[_0x9c0f('0x2b')]=_['keys'](_0xaedb0a[_0x9c0f('0x2b')]);_0x45fc92['filters']=_['intersection'](_0x45fc92['model'],_0x45fc92['query']);_0x40e41a[_0x9c0f('0x2c')]=_[_0x9c0f('0x2d')](_0x45fc92[_0x9c0f('0x2a')],qs[_0x9c0f('0x2e')](_0xaedb0a[_0x9c0f('0x2b')][_0x9c0f('0x2e')]));_0x40e41a[_0x9c0f('0x2c')]=_0x40e41a[_0x9c0f('0x2c')][_0x9c0f('0x2f')]?_0x40e41a['attributes']:_0x45fc92[_0x9c0f('0x2a')];if(!_0xaedb0a[_0x9c0f('0x2b')]['hasOwnProperty'](_0x9c0f('0x30'))){_0x40e41a[_0x9c0f('0x1d')]=qs[_0x9c0f('0x1d')](_0xaedb0a[_0x9c0f('0x2b')]['limit']);_0x40e41a[_0x9c0f('0x1c')]=qs[_0x9c0f('0x1c')](_0xaedb0a[_0x9c0f('0x2b')]['offset']);}_0x40e41a[_0x9c0f('0x31')]=qs[_0x9c0f('0x32')](_0xaedb0a[_0x9c0f('0x2b')][_0x9c0f('0x32')]);_0x40e41a[_0x9c0f('0x33')]=qs[_0x9c0f('0x34')](_[_0x9c0f('0x35')](_0xaedb0a['query'],_0x45fc92[_0x9c0f('0x34')]));if(_0xaedb0a[_0x9c0f('0x2b')][_0x9c0f('0x36')]){_0x40e41a[_0x9c0f('0x33')]=_[_0x9c0f('0x37')](_0x40e41a[_0x9c0f('0x33')],{'$or':_['map'](_0x457828,function(_0x1c125e){if(_0x1c125e[_0x9c0f('0x38')][_0x9c0f('0x39')]!==_0x9c0f('0x3a')){var _0x11c4d9={};_0x11c4d9[_0x1c125e['field']]={'$like':'%'+_0xaedb0a[_0x9c0f('0x2b')][_0x9c0f('0x36')]+'%'};return _0x11c4d9;}})});}_0x40e41a=_[_0x9c0f('0x37')]({},_0x40e41a,_0xaedb0a[_0x9c0f('0x3b')]);var _0x1c3d8a={'where':_0x40e41a[_0x9c0f('0x33')]};return db['Migration'][_0x9c0f('0x1b')](_0x1c3d8a)[_0x9c0f('0x3c')](function(_0x454120){_0x171078[_0x9c0f('0x1b')]=_0x454120;if(_0xaedb0a[_0x9c0f('0x2b')][_0x9c0f('0x3d')]){_0x40e41a[_0x9c0f('0x3e')]=[{'all':!![]}];}return db[_0x9c0f('0x28')][_0x9c0f('0x3f')](_0x40e41a);})['then'](function(_0x324d58){_0x171078['rows']=_0x324d58;return _0x171078;})[_0x9c0f('0x3c')](respondWithFilteredResult(_0x5ad781,_0x40e41a))[_0x9c0f('0x40')](handleError(_0x5ad781,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f88e17b..aa68897 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 _0x4610=['../../config/environment','exports','lodash','../../config/logger','bluebird','path','rimraf'];(function(_0x38de9a,_0x135855){var _0x210c33=function(_0x5d3aa4){while(--_0x5d3aa4){_0x38de9a['push'](_0x38de9a['shift']());}};_0x210c33(++_0x135855);}(_0x4610,0x1b4));var _0x0461=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x4610[_0x3bcf9e];return _0x1bb37c;};'use strict';var _=require(_0x0461('0x0'));var util=require('util');var logger=require(_0x0461('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0461('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0461('0x3'));var rimraf=require(_0x0461('0x4'));var config=require(_0x0461('0x5'));var attributes=require('./migration.attributes');module[_0x0461('0x6')]=function(_0x435757,_0x3a2ef9){return _0x435757['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0287=['define','migrations','lodash','util','../../config/logger','moment','bluebird','./migration.attributes'];(function(_0x5bac50,_0x540d00){var _0x28afd5=function(_0x25b25d){while(--_0x25b25d){_0x5bac50['push'](_0x5bac50['shift']());}};_0x28afd5(++_0x540d00);}(_0x0287,0x10a));var _0x7028=function(_0x1555f5,_0xb904c0){_0x1555f5=_0x1555f5-0x0;var _0x307306=_0x0287[_0x1555f5];return _0x307306;};'use strict';var _=require(_0x7028('0x0'));var util=require(_0x7028('0x1'));var logger=require(_0x7028('0x2'))('api');var moment=require(_0x7028('0x3'));var BPromise=require(_0x7028('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7028('0x5'));module['exports']=function(_0x21328a,_0x72aaf0){return _0x21328a[_0x7028('0x6')]('Migration',attributes,{'tableName':_0x7028('0x7'),'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 516110a..6f5d49f 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 _0x56a4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x3c7b73,_0x2879e6){var _0x31d8d7=function(_0x333096){while(--_0x333096){_0x3c7b73['push'](_0x3c7b73['shift']());}};_0x31d8d7(++_0x2879e6);}(_0x56a4,0x11b));var _0x456a=function(_0x1781f9,_0x5c36a3){_0x1781f9=_0x1781f9-0x0;var _0x4bd468=_0x56a4[_0x1781f9];return _0x4bd468;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var moment=require('moment');var BPromise=require(_0x456a('0x2'));var rs=require(_0x456a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson['client'][_0x456a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b38d,_0x497df4,_0x2b6329){return new BPromise(function(_0x20c8e0,_0x37f1b4){return client['request'](_0x52b38d,_0x2b6329)[_0x456a('0xa')](function(_0x595c4b){logger[_0x456a('0xb')](_0x456a('0xc'),_0x497df4,_0x456a('0xd'));logger[_0x456a('0xe')](_0x456a('0xf'),_0x497df4,_0x456a('0xd'),JSON[_0x456a('0x10')](_0x595c4b));if(_0x595c4b[_0x456a('0x11')]){if(_0x595c4b[_0x456a('0x11')][_0x456a('0x12')]===0x1f4){logger[_0x456a('0x11')]('Migration,\x20%s,\x20%s',_0x497df4,_0x595c4b[_0x456a('0x11')]['message']);return _0x37f1b4(_0x595c4b['error'][_0x456a('0x13')]);}logger[_0x456a('0x11')](_0x456a('0xc'),_0x497df4,_0x595c4b[_0x456a('0x11')]['message']);return _0x20c8e0(_0x595c4b[_0x456a('0x11')][_0x456a('0x13')]);}else{logger[_0x456a('0xb')](_0x456a('0xc'),_0x497df4,_0x456a('0xd'));_0x20c8e0(_0x595c4b[_0x456a('0x14')]['message']);}})[_0x456a('0x15')](function(_0x42f7d8){logger[_0x456a('0x11')](_0x456a('0xc'),_0x497df4,_0x42f7d8);_0x37f1b4(_0x42f7d8);});});} \ No newline at end of file +var _0x0c02=['Migration,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4fd719,_0x20555e){var _0x5c1f48=function(_0x46e19f){while(--_0x46e19f){_0x4fd719['push'](_0x4fd719['shift']());}};_0x5c1f48(++_0x20555e);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6408,_0x4e1dac,_0x5da127){return new BPromise(function(_0x4db532,_0x1e35e2){return client[_0x20c0('0xc')](_0x5d6408,_0x5da127)[_0x20c0('0xd')](function(_0x41a4af){logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x4e1dac,'request\x20sent',JSON['stringify'](_0x41a4af));if(_0x41a4af[_0x20c0('0x10')]){if(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x11')]===0x1f4){logger[_0x20c0('0x10')]('Migration,\x20%s,\x20%s',_0x4e1dac,_0x41a4af[_0x20c0('0x10')]['message']);return _0x1e35e2(_0x41a4af['error'][_0x20c0('0x12')]);}logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);return _0x4db532(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);}else{logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');_0x4db532(_0x41a4af[_0x20c0('0x13')][_0x20c0('0x12')]);}})[_0x20c0('0x14')](function(_0x46b9e5){logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x46b9e5);_0x1e35e2(_0x46b9e5);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index f500dcf..aff8f86 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 _0xd285=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports'];(function(_0x40c177,_0x62a98c){var _0x4673b8=function(_0x45c1a1){while(--_0x45c1a1){_0x40c177['push'](_0x40c177['shift']());}};_0x4673b8(++_0x62a98c);}(_0xd285,0x132));var _0x5d28=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xd285[_0x4a8bad];return _0x30cf32;};'use strict';var multer=require('multer');var util=require(_0x5d28('0x0'));var path=require(_0x5d28('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d28('0x2'));var router=express[_0x5d28('0x3')]();var auth=require(_0x5d28('0x4'));var interaction=require(_0x5d28('0x5'));var config=require(_0x5d28('0x6'));var controller=require(_0x5d28('0x7'));router[_0x5d28('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d28('0x9')]);router[_0x5d28('0x8')](_0x5d28('0xa'),auth[_0x5d28('0xb')](),controller[_0x5d28('0xc')]);router[_0x5d28('0xd')]('/',auth[_0x5d28('0xb')](),controller[_0x5d28('0xe')]);router['put'](_0x5d28('0xa'),auth[_0x5d28('0xb')](),controller[_0x5d28('0xf')]);router['delete'](_0x5d28('0xa'),auth[_0x5d28('0xb')](),controller[_0x5d28('0x10')]);module[_0x5d28('0x11')]=router; \ No newline at end of file +var _0x9306=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','post','put'];(function(_0x313349,_0x27ed1a){var _0x2761c8=function(_0x2e0fc2){while(--_0x2e0fc2){_0x313349['push'](_0x313349['shift']());}};_0x2761c8(++_0x27ed1a);}(_0x9306,0x69));var _0x6930=function(_0x32a33a,_0x246224){_0x32a33a=_0x32a33a-0x0;var _0x51f7b6=_0x9306[_0x32a33a];return _0x51f7b6;};'use strict';var multer=require('multer');var util=require(_0x6930('0x0'));var path=require(_0x6930('0x1'));var timeout=require(_0x6930('0x2'));var express=require(_0x6930('0x3'));var router=express[_0x6930('0x4')]();var auth=require(_0x6930('0x5'));var interaction=require(_0x6930('0x6'));var config=require(_0x6930('0x7'));var controller=require(_0x6930('0x8'));router[_0x6930('0x9')]('/',auth[_0x6930('0xa')](),controller['index']);router[_0x6930('0x9')](_0x6930('0xb'),auth[_0x6930('0xa')](),controller['show']);router[_0x6930('0xc')]('/',auth[_0x6930('0xa')](),controller['create']);router[_0x6930('0xd')](_0x6930('0xb'),auth[_0x6930('0xa')](),controller[_0x6930('0xe')]);router[_0x6930('0xf')](_0x6930('0xb'),auth[_0x6930('0xa')](),controller[_0x6930('0x10')]);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 4064e92..a7f0a66 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 _0x3332=['exports','ENUM','externip','STRING'];(function(_0x36b802,_0x29317d){var _0x4f8fdd=function(_0x31b1d2){while(--_0x31b1d2){_0x36b802['push'](_0x36b802['shift']());}};_0x4f8fdd(++_0x29317d);}(_0x3332,0x184));var _0x2333=function(_0x6aaa69,_0x4457b5){_0x6aaa69=_0x6aaa69-0x0;var _0x25359f=_0x3332[_0x6aaa69];return _0x25359f;};'use strict';var Sequelize=require('sequelize');module[_0x2333('0x0')]={'type':{'type':Sequelize[_0x2333('0x1')]('localnet',_0x2333('0x2'))},'value':{'type':Sequelize[_0x2333('0x3')]}}; \ No newline at end of file +var _0xcf33=['exports','ENUM','localnet','externip','sequelize'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xcf33,0x13a));var _0x3cf3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcf33[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x3cf3('0x0'));module[_0x3cf3('0x1')]={'type':{'type':Sequelize[_0x3cf3('0x2')](_0x3cf3('0x3'),_0x3cf3('0x4'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index b6690d0..988ccbc 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 _0x5ba4=['order','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','rows','show','params','find','create','sequelize','transaction','body','type','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','readFileSync','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','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','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','Network','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0x5ba4,0x148));var _0x45ba=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x5ba4[_0x485b5a];return _0xd2b34d;};'use strict';var pdf=require(_0x45ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x45ba('0x1'));var zipdir=require(_0x45ba('0x2'));var jsonpatch=require(_0x45ba('0x3'));var rp=require(_0x45ba('0x4'));var moment=require(_0x45ba('0x5'));var BPromise=require(_0x45ba('0x6'));var Mustache=require(_0x45ba('0x7'));var util=require(_0x45ba('0x8'));var path=require(_0x45ba('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x45ba('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x45ba('0xb'));var crypto=require('crypto');var jsforce=require(_0x45ba('0xc'));var deskjs=require(_0x45ba('0xd'));var toCsv=require(_0x45ba('0xe'));var querystring=require('querystring');var Papa=require(_0x45ba('0xf'));var Redis=require(_0x45ba('0x10'));var authService=require(_0x45ba('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x45ba('0x12'));var logger=require(_0x45ba('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x45ba('0x14'));var client=jayson[_0x45ba('0x15')][_0x45ba('0x16')]({'port':0x232a});function checkPasswordPattern(_0x110178,_0x16630e,_0x48f73f){if(_0x48f73f){var _0x28e0c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e0c3[_0x45ba('0x17')](_0x16630e)){return _0x110178;}else{throw new Error(_0x45ba('0x18'));}}else{return _0x110178;}}function respondWithRpcPromise(_0x29e14e,_0x533fa2,_0x5e8e1c,_0x4a14ef){return new BPromise(function(_0x17b0d2,_0x41702b){var _0x529292=_0x4a14ef||client;return _0x529292[_0x45ba('0x19')](_0x29e14e,_0x5e8e1c)[_0x45ba('0x1a')](function(_0x39ac39){logger[_0x45ba('0x1b')](_0x45ba('0x1c'),_0x533fa2,_0x45ba('0x1d'));logger[_0x45ba('0x1e')]('Network,\x20%s,\x20%s,\x20%s',_0x533fa2,'request\x20sent',JSON[_0x45ba('0x1f')](_0x39ac39));if(_0x39ac39[_0x45ba('0x20')]){if(_0x39ac39[_0x45ba('0x20')][_0x45ba('0x21')]===0x1f4){logger[_0x45ba('0x20')](_0x45ba('0x1c'),_0x533fa2,_0x39ac39[_0x45ba('0x20')]['message']);return _0x41702b(_0x39ac39['error'][_0x45ba('0x22')]);}logger['error'](_0x45ba('0x1c'),_0x533fa2,_0x39ac39[_0x45ba('0x20')][_0x45ba('0x22')]);return _0x17b0d2(_0x39ac39[_0x45ba('0x20')][_0x45ba('0x22')]);}else{logger[_0x45ba('0x1b')](_0x45ba('0x1c'),_0x533fa2,_0x45ba('0x1d'));_0x17b0d2(_0x39ac39[_0x45ba('0x23')][_0x45ba('0x22')]);}})[_0x45ba('0x24')](function(_0xec6f8e){logger['error']('Network,\x20%s,\x20%s',_0x533fa2,_0xec6f8e);_0x41702b(_0xec6f8e);});});}function respondWithStatusCode(_0x24bb5c,_0x988723){_0x988723=_0x988723||0xcc;return function(_0x416ec8){if(_0x416ec8){return _0x24bb5c[_0x45ba('0x25')](_0x988723);}return _0x24bb5c[_0x45ba('0x26')](_0x988723)[_0x45ba('0x27')]();};}function respondWithResult(_0x233b28,_0x29330b){_0x29330b=_0x29330b||0xc8;return function(_0x4b39dd){if(_0x4b39dd){return _0x233b28[_0x45ba('0x26')](_0x29330b)[_0x45ba('0x28')](_0x4b39dd);}};}function respondWithFilteredResult(_0xb9ad87,_0x27cb41){return function(_0x392139){if(_0x392139){var _0x315488=_0x392139[_0x45ba('0x29')],_0x2f300a=_0x27cb41[_0x45ba('0x2a')],_0x48710a=_0x27cb41[_0x45ba('0x2a')]+_0x27cb41['limit'],_0x152872;if(_0x48710a>=_0x315488){_0x48710a=_0x315488;_0x152872=0xc8;}else{_0x152872=0xce;}_0xb9ad87[_0x45ba('0x26')](_0x152872);return _0xb9ad87[_0x45ba('0x2b')](_0x45ba('0x2c'),_0x2f300a+'-'+_0x48710a+'/'+_0x315488)[_0x45ba('0x28')](_0x392139);}return null;};}function patchUpdates(_0x5a155c){return function(_0x291545){try{jsonpatch[_0x45ba('0x2d')](_0x291545,_0x5a155c,!![]);}catch(_0x3a3732){return BPromise[_0x45ba('0x2e')](_0x3a3732);}return _0x291545[_0x45ba('0x2f')]();};}function saveUpdates(_0x5c05e6,_0x55cb6c){return function(_0x571578){if(_0x571578){return _0x571578[_0x45ba('0x30')](_0x5c05e6)[_0x45ba('0x1a')](function(_0x59a652){return _0x59a652;});}return null;};}function removeEntity(_0x10f408,_0x56b7a6){return function(_0xef6fb){if(_0xef6fb){return _0xef6fb['destroy']()[_0x45ba('0x1a')](function(){_0x10f408[_0x45ba('0x26')](0xcc)[_0x45ba('0x27')]();});}};}function handleEntityNotFound(_0x4a5bd6,_0x1e265b){return function(_0x13c38f){if(!_0x13c38f){_0x4a5bd6[_0x45ba('0x25')](0x194);}return _0x13c38f;};}function handleError(_0x1a22c4,_0x2a98c7){_0x2a98c7=_0x2a98c7||0x1f4;return function(_0x1ad670){logger['error'](_0x1ad670[_0x45ba('0x31')]);if(_0x1ad670['name']){delete _0x1ad670[_0x45ba('0x32')];}_0x1a22c4[_0x45ba('0x26')](_0x2a98c7)[_0x45ba('0x33')](_0x1ad670);};}exports['index']=function(_0x3f4881,_0x1b9b21){var _0xf469f6={},_0x3347c6={},_0x4fe9a6={'count':0x0,'rows':[]};var _0x37acab=db[_0x45ba('0x34')][_0x45ba('0x35')];_0x3347c6[_0x45ba('0x36')]=_[_0x45ba('0x37')](_0x37acab);_0x3347c6['query']=_[_0x45ba('0x37')](_0x3f4881[_0x45ba('0x38')]);_0x3347c6[_0x45ba('0x39')]=_['intersection'](_0x3347c6[_0x45ba('0x36')],_0x3347c6[_0x45ba('0x38')]);_0xf469f6[_0x45ba('0x3a')]=_[_0x45ba('0x3b')](_0x3347c6[_0x45ba('0x36')],qs[_0x45ba('0x3c')](_0x3f4881['query'][_0x45ba('0x3c')]));_0xf469f6[_0x45ba('0x3a')]=_0xf469f6[_0x45ba('0x3a')][_0x45ba('0x3d')]?_0xf469f6[_0x45ba('0x3a')]:_0x3347c6['model'];if(!_0x3f4881[_0x45ba('0x38')][_0x45ba('0x3e')]('nolimit')){_0xf469f6[_0x45ba('0x3f')]=qs[_0x45ba('0x3f')](_0x3f4881['query'][_0x45ba('0x3f')]);_0xf469f6[_0x45ba('0x2a')]=qs[_0x45ba('0x2a')](_0x3f4881[_0x45ba('0x38')][_0x45ba('0x2a')]);}_0xf469f6[_0x45ba('0x40')]=qs[_0x45ba('0x41')](_0x3f4881[_0x45ba('0x38')]['sort']);_0xf469f6[_0x45ba('0x42')]=qs[_0x45ba('0x39')](_['pick'](_0x3f4881[_0x45ba('0x38')],_0x3347c6[_0x45ba('0x39')]));if(_0x3f4881['query'][_0x45ba('0x43')]){_0xf469f6[_0x45ba('0x42')]=_[_0x45ba('0x44')](_0xf469f6['where'],{'$or':_[_0x45ba('0x45')](_0x37acab,function(_0x1d4b2c){if(_0x1d4b2c['type'][_0x45ba('0x46')]!=='VIRTUAL'){var _0x19a39c={};_0x19a39c[_0x1d4b2c[_0x45ba('0x47')]]={'$like':'%'+_0x3f4881[_0x45ba('0x38')][_0x45ba('0x43')]+'%'};return _0x19a39c;}})});}_0xf469f6=_[_0x45ba('0x44')]({},_0xf469f6,_0x3f4881[_0x45ba('0x48')]);var _0x2f3001={'where':_0xf469f6[_0x45ba('0x42')]};return db[_0x45ba('0x34')]['count'](_0x2f3001)[_0x45ba('0x1a')](function(_0x12214d){_0x4fe9a6[_0x45ba('0x29')]=_0x12214d;if(_0x3f4881[_0x45ba('0x38')][_0x45ba('0x49')]){_0xf469f6[_0x45ba('0x4a')]=[{'all':!![]}];}return db['Network'][_0x45ba('0x4b')](_0xf469f6);})[_0x45ba('0x1a')](function(_0x22e34b){_0x4fe9a6[_0x45ba('0x4c')]=_0x22e34b;return _0x4fe9a6;})[_0x45ba('0x1a')](respondWithFilteredResult(_0x1b9b21,_0xf469f6))[_0x45ba('0x24')](handleError(_0x1b9b21,null));};exports[_0x45ba('0x4d')]=function(_0x577af4,_0x86d3c7){var _0x54523c={'raw':!![],'where':{'id':_0x577af4[_0x45ba('0x4e')]['id']}},_0x5a97e9={};_0x5a97e9[_0x45ba('0x36')]=_[_0x45ba('0x37')](db[_0x45ba('0x34')][_0x45ba('0x35')]);_0x5a97e9[_0x45ba('0x38')]=_[_0x45ba('0x37')](_0x577af4[_0x45ba('0x38')]);_0x5a97e9[_0x45ba('0x39')]=_[_0x45ba('0x3b')](_0x5a97e9['model'],_0x5a97e9['query']);_0x54523c[_0x45ba('0x3a')]=_['intersection'](_0x5a97e9['model'],qs['fields'](_0x577af4[_0x45ba('0x38')][_0x45ba('0x3c')]));_0x54523c[_0x45ba('0x3a')]=_0x54523c['attributes']['length']?_0x54523c[_0x45ba('0x3a')]:_0x5a97e9[_0x45ba('0x36')];if(_0x577af4['query'][_0x45ba('0x49')]){_0x54523c[_0x45ba('0x4a')]=[{'all':!![]}];}_0x54523c=_[_0x45ba('0x44')]({},_0x54523c,_0x577af4[_0x45ba('0x48')]);return db[_0x45ba('0x34')][_0x45ba('0x4f')](_0x54523c)['then'](handleEntityNotFound(_0x86d3c7,null))[_0x45ba('0x1a')](respondWithResult(_0x86d3c7,null))[_0x45ba('0x24')](handleError(_0x86d3c7,null));};exports[_0x45ba('0x50')]=function(_0x35dc9d,_0x321dfd,_0x5b3bb8){var _0x26f95e;return db[_0x45ba('0x51')][_0x45ba('0x52')](function(_0x702d27){return db[_0x45ba('0x34')][_0x45ba('0x50')](_0x35dc9d[_0x45ba('0x53')],{'raw':!![]})['then'](function(_0x4fef3e){_0x26f95e=_0x4fef3e;return db['Network']['findAll']({'where':{'type':_0x35dc9d[_0x45ba('0x53')][_0x45ba('0x54')]},'raw':!![]});})[_0x45ba('0x1a')](function(_0x56a9de){var _0x2bb7b4=fs['readFileSync'](path[_0x45ba('0x55')](config[_0x45ba('0x56')],_0x45ba('0x57')),_0x45ba('0x58'));var _0x336be2=ejs[_0x45ba('0x59')](_0x2bb7b4,{'networks':_0x56a9de||[]});fs[_0x45ba('0x5a')](util[_0x45ba('0x5b')](_0x45ba('0x5c'),_0x35dc9d[_0x45ba('0x53')][_0x45ba('0x54')][_0x45ba('0x5d')]()),_0x336be2);})['then'](function(){return respondWithRpcPromise(_0x45ba('0x5e'),_0x45ba('0x50'),{'module':_0x45ba('0x5f')});})[_0x45ba('0x1a')](function(){return _0x26f95e;});})[_0x45ba('0x1a')](respondWithResult(_0x321dfd,0xc9))['catch'](handleError(_0x321dfd,null));};exports[_0x45ba('0x30')]=function(_0x232571,_0x4a0a43,_0x44e93b){var _0x1cc036;return db[_0x45ba('0x51')][_0x45ba('0x52')](function(_0x1e368f){return db[_0x45ba('0x34')][_0x45ba('0x4f')]({'where':{'id':_0x232571['params']['id']}})[_0x45ba('0x1a')](handleEntityNotFound(_0x4a0a43,null))[_0x45ba('0x1a')](saveUpdates(_0x232571['body'],null))[_0x45ba('0x1a')](function(_0x242a32){if(_0x242a32){_0x1cc036=_0x242a32;return db[_0x45ba('0x34')]['findAll']({'where':{'type':_0x1cc036[_0x45ba('0x54')]},'raw':!![]});}return null;})[_0x45ba('0x1a')](function(_0x2dba85){if(_0x2dba85){var _0x55b5f3=fs[_0x45ba('0x60')](path[_0x45ba('0x55')](config[_0x45ba('0x56')],'server/files/templates/network.ejs'),_0x45ba('0x58'));var _0x722d75=ejs[_0x45ba('0x59')](_0x55b5f3,{'networks':_0x2dba85||[]});fs[_0x45ba('0x5a')](util[_0x45ba('0x5b')](_0x45ba('0x5c'),_0x1cc036[_0x45ba('0x54')]['toLowerCase']()),_0x722d75);return respondWithRpcPromise(_0x45ba('0x5e'),_0x45ba('0x30'),{'module':_0x45ba('0x5f')});}return null;})['then'](function(_0x3acde5){if(_0x3acde5){return _0x1cc036;}return null;});})['then'](respondWithResult(_0x4a0a43,null))[_0x45ba('0x24')](handleError(_0x4a0a43,null));};exports[_0x45ba('0x61')]=function(_0x339a37,_0x4e1434,_0x5b8ccd){var _0x4a81b0;return db['Network'][_0x45ba('0x4f')]({'where':{'id':_0x339a37[_0x45ba('0x4e')]['id']}})[_0x45ba('0x1a')](function(_0x540c14){_0x4a81b0=_0x540c14;return _0x540c14;})[_0x45ba('0x1a')](handleEntityNotFound(_0x4e1434,null))[_0x45ba('0x1a')](removeEntity(_0x4e1434,null))[_0x45ba('0x1a')](function(){if(_0x4a81b0){return db[_0x45ba('0x34')][_0x45ba('0x4b')]({'where':{'type':_0x4a81b0[_0x45ba('0x54')]},'raw':!![]});}})[_0x45ba('0x1a')](function(_0x283035){if(_0x283035){var _0x4f0802=fs[_0x45ba('0x60')](path['join'](config[_0x45ba('0x56')],'server/files/templates/network.ejs'),_0x45ba('0x58'));var _0x441550=ejs[_0x45ba('0x59')](_0x4f0802,{'networks':_0x283035||[]});fs[_0x45ba('0x5a')](util[_0x45ba('0x5b')](_0x45ba('0x5c'),_0x4a81b0[_0x45ba('0x54')]['toLowerCase']()),_0x441550);return respondWithRpcPromise(_0x45ba('0x5e'),_0x45ba('0x61'),{'module':_0x45ba('0x5f')});}})['catch'](handleError(_0x4e1434,null));}; \ No newline at end of file +var _0x4e7c=['field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','transaction','body','readFileSync','root','server/files/templates/network.ejs','utf8','render','format','toLowerCase','Reload','chan_sip.so','sequelize','join','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','code','error','message','Network,\x20%s,\x20%s','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','Network','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL'];(function(_0x5428b6,_0x1913f2){var _0xa1d7a2=function(_0x47fd90){while(--_0x47fd90){_0x5428b6['push'](_0x5428b6['shift']());}};_0xa1d7a2(++_0x1913f2);}(_0x4e7c,0x1a3));var _0xc4e7=function(_0x5545ac,_0x2f129a){_0x5545ac=_0x5545ac-0x0;var _0x47ba74=_0x4e7c[_0x5545ac];return _0x47ba74;};'use strict';var pdf=require(_0xc4e7('0x0'));var emlformat=require(_0xc4e7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e7('0x2'));var moment=require(_0xc4e7('0x3'));var BPromise=require(_0xc4e7('0x4'));var Mustache=require('mustache');var util=require(_0xc4e7('0x5'));var path=require(_0xc4e7('0x6'));var sox=require(_0xc4e7('0x7'));var csv=require(_0xc4e7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc4e7('0x9'));var squel=require(_0xc4e7('0xa'));var crypto=require(_0xc4e7('0xb'));var jsforce=require(_0xc4e7('0xc'));var deskjs=require(_0xc4e7('0xd'));var toCsv=require(_0xc4e7('0x8'));var querystring=require('querystring');var Papa=require(_0xc4e7('0xe'));var Redis=require('ioredis');var authService=require(_0xc4e7('0xf'));var qs=require(_0xc4e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4e7('0x11'))(_0xc4e7('0x12'));var utils=require(_0xc4e7('0x13'));var config=require(_0xc4e7('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc4e7('0x15'));var client=jayson[_0xc4e7('0x16')][_0xc4e7('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4106d4,_0x45d0b5,_0x44a442){if(_0x44a442){var _0x6bf98b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6bf98b[_0xc4e7('0x18')](_0x45d0b5)){return _0x4106d4;}else{throw new Error(_0xc4e7('0x19'));}}else{return _0x4106d4;}}function respondWithRpcPromise(_0x279baf,_0x2974cb,_0x3b251e,_0x1f17b6){return new BPromise(function(_0x541db1,_0x28f847){var _0x504a71=_0x1f17b6||client;return _0x504a71[_0xc4e7('0x1a')](_0x279baf,_0x3b251e)[_0xc4e7('0x1b')](function(_0x2d942a){logger['info']('Network,\x20%s,\x20%s',_0x2974cb,_0xc4e7('0x1c'));logger[_0xc4e7('0x1d')]('Network,\x20%s,\x20%s,\x20%s',_0x2974cb,_0xc4e7('0x1c'),JSON['stringify'](_0x2d942a));if(_0x2d942a['error']){if(_0x2d942a['error'][_0xc4e7('0x1e')]===0x1f4){logger[_0xc4e7('0x1f')]('Network,\x20%s,\x20%s',_0x2974cb,_0x2d942a[_0xc4e7('0x1f')][_0xc4e7('0x20')]);return _0x28f847(_0x2d942a[_0xc4e7('0x1f')]['message']);}logger['error'](_0xc4e7('0x21'),_0x2974cb,_0x2d942a[_0xc4e7('0x1f')][_0xc4e7('0x20')]);return _0x541db1(_0x2d942a[_0xc4e7('0x1f')]['message']);}else{logger[_0xc4e7('0x22')](_0xc4e7('0x21'),_0x2974cb,_0xc4e7('0x1c'));_0x541db1(_0x2d942a[_0xc4e7('0x23')][_0xc4e7('0x20')]);}})['catch'](function(_0x90d7b5){logger[_0xc4e7('0x1f')](_0xc4e7('0x21'),_0x2974cb,_0x90d7b5);_0x28f847(_0x90d7b5);});});}function respondWithStatusCode(_0x5911db,_0x164786){_0x164786=_0x164786||0xcc;return function(_0x18f214){if(_0x18f214){return _0x5911db[_0xc4e7('0x24')](_0x164786);}return _0x5911db[_0xc4e7('0x25')](_0x164786)[_0xc4e7('0x26')]();};}function respondWithResult(_0xa88de,_0x1d35a2){_0x1d35a2=_0x1d35a2||0xc8;return function(_0x530b2e){if(_0x530b2e){return _0xa88de[_0xc4e7('0x25')](_0x1d35a2)[_0xc4e7('0x27')](_0x530b2e);}};}function respondWithFilteredResult(_0x52918a,_0x21842e){return function(_0x5f3ea5){if(_0x5f3ea5){var _0x1021a7=_0x5f3ea5[_0xc4e7('0x28')],_0x1364d7=_0x21842e[_0xc4e7('0x29')],_0x3e6f7f=_0x21842e[_0xc4e7('0x29')]+_0x21842e[_0xc4e7('0x2a')],_0x1db0fb;if(_0x3e6f7f>=_0x1021a7){_0x3e6f7f=_0x1021a7;_0x1db0fb=0xc8;}else{_0x1db0fb=0xce;}_0x52918a['status'](_0x1db0fb);return _0x52918a[_0xc4e7('0x2b')](_0xc4e7('0x2c'),_0x1364d7+'-'+_0x3e6f7f+'/'+_0x1021a7)[_0xc4e7('0x27')](_0x5f3ea5);}return null;};}function patchUpdates(_0x138493){return function(_0x56f0d7){try{jsonpatch[_0xc4e7('0x2d')](_0x56f0d7,_0x138493,!![]);}catch(_0x14f056){return BPromise[_0xc4e7('0x2e')](_0x14f056);}return _0x56f0d7[_0xc4e7('0x2f')]();};}function saveUpdates(_0x43d781,_0x1b7826){return function(_0x3ae5df){if(_0x3ae5df){return _0x3ae5df[_0xc4e7('0x30')](_0x43d781)[_0xc4e7('0x1b')](function(_0x4969e1){return _0x4969e1;});}return null;};}function removeEntity(_0x54e8d0,_0x4040e6){return function(_0x422774){if(_0x422774){return _0x422774[_0xc4e7('0x31')]()['then'](function(){_0x54e8d0[_0xc4e7('0x25')](0xcc)[_0xc4e7('0x26')]();});}};}function handleEntityNotFound(_0x2849ca,_0x3e6e8e){return function(_0xaafde0){if(!_0xaafde0){_0x2849ca[_0xc4e7('0x24')](0x194);}return _0xaafde0;};}function handleError(_0x4a689e,_0xa9a9fd){_0xa9a9fd=_0xa9a9fd||0x1f4;return function(_0x4c15b0){logger[_0xc4e7('0x1f')](_0x4c15b0[_0xc4e7('0x32')]);if(_0x4c15b0[_0xc4e7('0x33')]){delete _0x4c15b0[_0xc4e7('0x33')];}_0x4a689e[_0xc4e7('0x25')](_0xa9a9fd)['send'](_0x4c15b0);};}exports['index']=function(_0xf40586,_0x14053e){var _0x59a7e6={},_0x12103c={},_0x401da4={'count':0x0,'rows':[]};var _0x3d2e5c=db[_0xc4e7('0x34')]['rawAttributes'];_0x12103c['model']=_[_0xc4e7('0x35')](_0x3d2e5c);_0x12103c[_0xc4e7('0x36')]=_[_0xc4e7('0x35')](_0xf40586['query']);_0x12103c[_0xc4e7('0x37')]=_[_0xc4e7('0x38')](_0x12103c[_0xc4e7('0x39')],_0x12103c[_0xc4e7('0x36')]);_0x59a7e6['attributes']=_[_0xc4e7('0x38')](_0x12103c[_0xc4e7('0x39')],qs[_0xc4e7('0x3a')](_0xf40586['query'][_0xc4e7('0x3a')]));_0x59a7e6[_0xc4e7('0x3b')]=_0x59a7e6['attributes'][_0xc4e7('0x3c')]?_0x59a7e6[_0xc4e7('0x3b')]:_0x12103c['model'];if(!_0xf40586[_0xc4e7('0x36')][_0xc4e7('0x3d')]('nolimit')){_0x59a7e6['limit']=qs[_0xc4e7('0x2a')](_0xf40586[_0xc4e7('0x36')][_0xc4e7('0x2a')]);_0x59a7e6[_0xc4e7('0x29')]=qs[_0xc4e7('0x29')](_0xf40586[_0xc4e7('0x36')][_0xc4e7('0x29')]);}_0x59a7e6['order']=qs['sort'](_0xf40586[_0xc4e7('0x36')][_0xc4e7('0x3e')]);_0x59a7e6[_0xc4e7('0x3f')]=qs[_0xc4e7('0x37')](_[_0xc4e7('0x40')](_0xf40586['query'],_0x12103c[_0xc4e7('0x37')]));if(_0xf40586['query'][_0xc4e7('0x41')]){_0x59a7e6[_0xc4e7('0x3f')]=_[_0xc4e7('0x42')](_0x59a7e6[_0xc4e7('0x3f')],{'$or':_[_0xc4e7('0x43')](_0x3d2e5c,function(_0x15db0f){if(_0x15db0f[_0xc4e7('0x44')][_0xc4e7('0x45')]!==_0xc4e7('0x46')){var _0x3c476b={};_0x3c476b[_0x15db0f[_0xc4e7('0x47')]]={'$like':'%'+_0xf40586['query'][_0xc4e7('0x41')]+'%'};return _0x3c476b;}})});}_0x59a7e6=_[_0xc4e7('0x42')]({},_0x59a7e6,_0xf40586[_0xc4e7('0x48')]);var _0x51215c={'where':_0x59a7e6[_0xc4e7('0x3f')]};return db[_0xc4e7('0x34')]['count'](_0x51215c)[_0xc4e7('0x1b')](function(_0x2f0c63){_0x401da4['count']=_0x2f0c63;if(_0xf40586[_0xc4e7('0x36')][_0xc4e7('0x49')]){_0x59a7e6[_0xc4e7('0x4a')]=[{'all':!![]}];}return db[_0xc4e7('0x34')][_0xc4e7('0x4b')](_0x59a7e6);})['then'](function(_0x469add){_0x401da4[_0xc4e7('0x4c')]=_0x469add;return _0x401da4;})[_0xc4e7('0x1b')](respondWithFilteredResult(_0x14053e,_0x59a7e6))[_0xc4e7('0x4d')](handleError(_0x14053e,null));};exports[_0xc4e7('0x4e')]=function(_0x26bc39,_0x423e69){var _0x2b3942={'raw':!![],'where':{'id':_0x26bc39[_0xc4e7('0x4f')]['id']}},_0x1fa17d={};_0x1fa17d[_0xc4e7('0x39')]=_[_0xc4e7('0x35')](db[_0xc4e7('0x34')][_0xc4e7('0x50')]);_0x1fa17d[_0xc4e7('0x36')]=_[_0xc4e7('0x35')](_0x26bc39['query']);_0x1fa17d[_0xc4e7('0x37')]=_[_0xc4e7('0x38')](_0x1fa17d[_0xc4e7('0x39')],_0x1fa17d[_0xc4e7('0x36')]);_0x2b3942[_0xc4e7('0x3b')]=_[_0xc4e7('0x38')](_0x1fa17d[_0xc4e7('0x39')],qs[_0xc4e7('0x3a')](_0x26bc39[_0xc4e7('0x36')][_0xc4e7('0x3a')]));_0x2b3942[_0xc4e7('0x3b')]=_0x2b3942[_0xc4e7('0x3b')][_0xc4e7('0x3c')]?_0x2b3942[_0xc4e7('0x3b')]:_0x1fa17d[_0xc4e7('0x39')];if(_0x26bc39['query'][_0xc4e7('0x49')]){_0x2b3942[_0xc4e7('0x4a')]=[{'all':!![]}];}_0x2b3942=_[_0xc4e7('0x42')]({},_0x2b3942,_0x26bc39['options']);return db[_0xc4e7('0x34')][_0xc4e7('0x51')](_0x2b3942)[_0xc4e7('0x1b')](handleEntityNotFound(_0x423e69,null))[_0xc4e7('0x1b')](respondWithResult(_0x423e69,null))['catch'](handleError(_0x423e69,null));};exports[_0xc4e7('0x52')]=function(_0x5e8023,_0x2ed262,_0x361d67){var _0x278511;return db['sequelize'][_0xc4e7('0x53')](function(_0x1129aa){return db['Network'][_0xc4e7('0x52')](_0x5e8023[_0xc4e7('0x54')],{'raw':!![]})[_0xc4e7('0x1b')](function(_0x3365cb){_0x278511=_0x3365cb;return db['Network'][_0xc4e7('0x4b')]({'where':{'type':_0x5e8023[_0xc4e7('0x54')][_0xc4e7('0x44')]},'raw':!![]});})['then'](function(_0x408ae3){var _0x481a7c=fs[_0xc4e7('0x55')](path['join'](config[_0xc4e7('0x56')],_0xc4e7('0x57')),_0xc4e7('0x58'));var _0x56524d=ejs[_0xc4e7('0x59')](_0x481a7c,{'networks':_0x408ae3||[]});fs['writeFileSync'](util[_0xc4e7('0x5a')]('/etc/asterisk/sip_xcally_%s.conf',_0x5e8023[_0xc4e7('0x54')]['type'][_0xc4e7('0x5b')]()),_0x56524d);})[_0xc4e7('0x1b')](function(){return respondWithRpcPromise(_0xc4e7('0x5c'),'create',{'module':_0xc4e7('0x5d')});})[_0xc4e7('0x1b')](function(){return _0x278511;});})[_0xc4e7('0x1b')](respondWithResult(_0x2ed262,0xc9))[_0xc4e7('0x4d')](handleError(_0x2ed262,null));};exports['update']=function(_0x1c9d48,_0x5ef2d4,_0x3ca9a1){var _0x1e4d98;return db[_0xc4e7('0x5e')][_0xc4e7('0x53')](function(_0x4fc00e){return db['Network']['find']({'where':{'id':_0x1c9d48[_0xc4e7('0x4f')]['id']}})[_0xc4e7('0x1b')](handleEntityNotFound(_0x5ef2d4,null))['then'](saveUpdates(_0x1c9d48[_0xc4e7('0x54')],null))[_0xc4e7('0x1b')](function(_0x46aa35){if(_0x46aa35){_0x1e4d98=_0x46aa35;return db[_0xc4e7('0x34')][_0xc4e7('0x4b')]({'where':{'type':_0x1e4d98[_0xc4e7('0x44')]},'raw':!![]});}return null;})[_0xc4e7('0x1b')](function(_0x562fdc){if(_0x562fdc){var _0x55958f=fs[_0xc4e7('0x55')](path[_0xc4e7('0x5f')](config[_0xc4e7('0x56')],_0xc4e7('0x57')),_0xc4e7('0x58'));var _0x51f115=ejs[_0xc4e7('0x59')](_0x55958f,{'networks':_0x562fdc||[]});fs[_0xc4e7('0x60')](util[_0xc4e7('0x5a')](_0xc4e7('0x61'),_0x1e4d98[_0xc4e7('0x44')][_0xc4e7('0x5b')]()),_0x51f115);return respondWithRpcPromise('Reload',_0xc4e7('0x30'),{'module':_0xc4e7('0x5d')});}return null;})[_0xc4e7('0x1b')](function(_0x209a97){if(_0x209a97){return _0x1e4d98;}return null;});})[_0xc4e7('0x1b')](respondWithResult(_0x5ef2d4,null))[_0xc4e7('0x4d')](handleError(_0x5ef2d4,null));};exports[_0xc4e7('0x31')]=function(_0x2ac1bd,_0x412dbd,_0x3803d2){var _0x39465a;return db[_0xc4e7('0x34')][_0xc4e7('0x51')]({'where':{'id':_0x2ac1bd[_0xc4e7('0x4f')]['id']}})['then'](function(_0x16b90c){_0x39465a=_0x16b90c;return _0x16b90c;})[_0xc4e7('0x1b')](handleEntityNotFound(_0x412dbd,null))['then'](removeEntity(_0x412dbd,null))[_0xc4e7('0x1b')](function(){if(_0x39465a){return db[_0xc4e7('0x34')]['findAll']({'where':{'type':_0x39465a[_0xc4e7('0x44')]},'raw':!![]});}})[_0xc4e7('0x1b')](function(_0x5485bf){if(_0x5485bf){var _0x4d576e=fs[_0xc4e7('0x55')](path[_0xc4e7('0x5f')](config['root'],'server/files/templates/network.ejs'),_0xc4e7('0x58'));var _0x4a3d54=ejs['render'](_0x4d576e,{'networks':_0x5485bf||[]});fs[_0xc4e7('0x60')](util[_0xc4e7('0x5a')](_0xc4e7('0x61'),_0x39465a[_0xc4e7('0x44')][_0xc4e7('0x5b')]()),_0x4a3d54);return respondWithRpcPromise(_0xc4e7('0x5c'),_0xc4e7('0x31'),{'module':_0xc4e7('0x5d')});}})[_0xc4e7('0x4d')](handleError(_0x412dbd,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 44d12ff..a904070 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 _0xe531=['moment','bluebird','request-promise','path','rimraf','./network.attributes','exports','network','lodash','util','../../config/logger','api'];(function(_0x309092,_0x46e003){var _0x3f1017=function(_0xada241){while(--_0xada241){_0x309092['push'](_0x309092['shift']());}};_0x3f1017(++_0x46e003);}(_0xe531,0x98));var _0x1e53=function(_0x167b2e,_0x4b900a){_0x167b2e=_0x167b2e-0x0;var _0x1e7d43=_0xe531[_0x167b2e];return _0x1e7d43;};'use strict';var _=require(_0x1e53('0x0'));var util=require(_0x1e53('0x1'));var logger=require(_0x1e53('0x2'))(_0x1e53('0x3'));var moment=require(_0x1e53('0x4'));var BPromise=require(_0x1e53('0x5'));var rp=require(_0x1e53('0x6'));var fs=require('fs');var path=require(_0x1e53('0x7'));var rimraf=require(_0x1e53('0x8'));var config=require('../../config/environment');var attributes=require(_0x1e53('0x9'));module[_0x1e53('0xa')]=function(_0x1c7fb9,_0x3f0a55){return _0x1c7fb9['define']('Network',attributes,{'tableName':_0x1e53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b81=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','define','Network','network','lodash'];(function(_0x56ecbf,_0x24eefe){var _0x63e73a=function(_0x6d03eb){while(--_0x6d03eb){_0x56ecbf['push'](_0x56ecbf['shift']());}};_0x63e73a(++_0x24eefe);}(_0x0b81,0x1bb));var _0x10b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b81[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x10b8('0x0'));var util=require('util');var logger=require(_0x10b8('0x1'))(_0x10b8('0x2'));var moment=require('moment');var BPromise=require(_0x10b8('0x3'));var rp=require(_0x10b8('0x4'));var fs=require('fs');var path=require(_0x10b8('0x5'));var rimraf=require(_0x10b8('0x6'));var config=require(_0x10b8('0x7'));var attributes=require(_0x10b8('0x8'));module['exports']=function(_0x1bb938,_0x18cda1){return _0x1bb938[_0x10b8('0x9')](_0x10b8('0xa'),attributes,{'tableName':_0x10b8('0xb'),'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 535d483..03d7c71 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 _0xaa3f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Network,\x20%s,\x20%s','catch','lodash','util'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x928a02,_0x2257cd){_0x928a02=_0x928a02-0x0;var _0x30705c=_0xaa3f[_0x928a02];return _0x30705c;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeecce5,_0x352958,_0xbf270c){return new BPromise(function(_0x328d5f,_0x2e422d){return client[_0xfaa3('0xb')](_0xeecce5,_0xbf270c)['then'](function(_0x37bcd5){logger[_0xfaa3('0xc')]('Network,\x20%s,\x20%s',_0x352958,'request\x20sent');logger[_0xfaa3('0xd')](_0xfaa3('0xe'),_0x352958,_0xfaa3('0xf'),JSON[_0xfaa3('0x10')](_0x37bcd5));if(_0x37bcd5[_0xfaa3('0x11')]){if(_0x37bcd5[_0xfaa3('0x11')]['code']===0x1f4){logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x2e422d(_0x37bcd5[_0xfaa3('0x11')]['message']);}logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x328d5f(_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);}else{logger[_0xfaa3('0xc')](_0xfaa3('0x13'),_0x352958,'request\x20sent');_0x328d5f(_0x37bcd5['result'][_0xfaa3('0x12')]);}})[_0xfaa3('0x14')](function(_0x407384){logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x407384);_0x2e422d(_0x407384);});});} \ No newline at end of file +var _0x1261=['then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x10e393,_0x169380){var _0x402051=function(_0x14584b){while(--_0x14584b){_0x10e393['push'](_0x10e393['shift']());}};_0x402051(++_0x169380);}(_0x1261,0x144));var _0x1126=function(_0x5c33d4,_0x3621db){_0x5c33d4=_0x5c33d4-0x0;var _0x76150=_0x1261[_0x5c33d4];return _0x76150;};'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});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Network,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index cf7c53e..be2e424 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 _0xf957=['index','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x300387,_0x5b03eb){var _0x1eaf27=function(_0x5030e7){while(--_0x5030e7){_0x300387['push'](_0x300387['shift']());}};_0x1eaf27(++_0x5b03eb);}(_0xf957,0x1e4));var _0x7f95=function(_0x3f2c50,_0x2c6a58){_0x3f2c50=_0x3f2c50-0x0;var _0x9194cc=_0xf957[_0x3f2c50];return _0x9194cc;};'use strict';var multer=require(_0x7f95('0x0'));var util=require(_0x7f95('0x1'));var path=require(_0x7f95('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f95('0x3'));var router=express[_0x7f95('0x4')]();var auth=require(_0x7f95('0x5'));var interaction=require(_0x7f95('0x6'));var config=require(_0x7f95('0x7'));var controller=require(_0x7f95('0x8'));router[_0x7f95('0x9')]('/',auth['isAuthenticated'](),controller[_0x7f95('0xa')]);router[_0x7f95('0x9')]('/describe',auth[_0x7f95('0xb')](),controller[_0x7f95('0xc')]);router[_0x7f95('0x9')](_0x7f95('0xd'),auth[_0x7f95('0xb')](),controller['show']);router[_0x7f95('0x9')]('/:id/dispositions',auth[_0x7f95('0xb')](),controller[_0x7f95('0xe')]);router[_0x7f95('0x9')](_0x7f95('0xf'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x10')]);router['get'](_0x7f95('0x11'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x7f95('0x12'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x13')]);router[_0x7f95('0x9')](_0x7f95('0x14'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x15')]);router[_0x7f95('0x16')]('/',auth[_0x7f95('0xb')](),controller[_0x7f95('0x17')]);router[_0x7f95('0x16')](_0x7f95('0x18'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x19')]);router[_0x7f95('0x16')](_0x7f95('0xf'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x1a')]);router[_0x7f95('0x16')](_0x7f95('0x1b'),controller[_0x7f95('0x1c')]);router[_0x7f95('0x16')](_0x7f95('0x11'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x1d')]);router[_0x7f95('0x16')](_0x7f95('0x14'),auth['isAuthenticated'](),controller[_0x7f95('0x1e')]);router[_0x7f95('0x16')]('/:id/send',auth[_0x7f95('0xb')](),controller['send']);router[_0x7f95('0x1f')](_0x7f95('0xd'),auth['isAuthenticated'](),controller[_0x7f95('0x20')]);router[_0x7f95('0x21')](_0x7f95('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x7f95('0x21')](_0x7f95('0x18'),auth['isAuthenticated'](),controller[_0x7f95('0x22')]);router[_0x7f95('0x21')](_0x7f95('0xf'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x23')]);router[_0x7f95('0x21')](_0x7f95('0x14'),auth[_0x7f95('0xb')](),controller[_0x7f95('0x24')]);module[_0x7f95('0x25')]=router; \ No newline at end of file +var _0xc7d4=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getAgents','post','addDisposition','/:id/notify','notify','addApplications','/:id/users','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','path'];(function(_0x33077b,_0x2d66b5){var _0x1a98be=function(_0x448971){while(--_0x448971){_0x33077b['push'](_0x33077b['shift']());}};_0x1a98be(++_0x2d66b5);}(_0xc7d4,0x1db));var _0x4c7d=function(_0x11d910,_0xb81183){_0x11d910=_0x11d910-0x0;var _0x3da5af=_0xc7d4[_0x11d910];return _0x3da5af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c7d('0x0'));var timeout=require(_0x4c7d('0x1'));var express=require(_0x4c7d('0x2'));var router=express[_0x4c7d('0x3')]();var auth=require(_0x4c7d('0x4'));var interaction=require(_0x4c7d('0x5'));var config=require(_0x4c7d('0x6'));var controller=require(_0x4c7d('0x7'));router[_0x4c7d('0x8')]('/',auth[_0x4c7d('0x9')](),controller['index']);router['get'](_0x4c7d('0xa'),auth['isAuthenticated'](),controller[_0x4c7d('0xb')]);router[_0x4c7d('0x8')](_0x4c7d('0xc'),auth[_0x4c7d('0x9')](),controller[_0x4c7d('0xd')]);router[_0x4c7d('0x8')](_0x4c7d('0xe'),auth['isAuthenticated'](),controller[_0x4c7d('0xf')]);router[_0x4c7d('0x8')](_0x4c7d('0x10'),auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x11')]);router[_0x4c7d('0x8')](_0x4c7d('0x12'),auth[_0x4c7d('0x9')](),controller['getApplications']);router[_0x4c7d('0x8')](_0x4c7d('0x13'),auth[_0x4c7d('0x9')](),controller['getInteractions']);router[_0x4c7d('0x8')]('/:id/users',auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x14')]);router[_0x4c7d('0x15')]('/',auth[_0x4c7d('0x9')](),controller['create']);router[_0x4c7d('0x15')](_0x4c7d('0xe'),auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x16')]);router['post'](_0x4c7d('0x10'),auth[_0x4c7d('0x9')](),controller['addAnswer']);router[_0x4c7d('0x15')](_0x4c7d('0x17'),controller[_0x4c7d('0x18')]);router[_0x4c7d('0x15')]('/:id/applications',auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x19')]);router['post'](_0x4c7d('0x1a'),auth[_0x4c7d('0x9')](),controller['addAgents']);router[_0x4c7d('0x15')]('/:id/send',auth['isAuthenticated'](),controller[_0x4c7d('0x1b')]);router[_0x4c7d('0x1c')](_0x4c7d('0xc'),auth['isAuthenticated'](),controller[_0x4c7d('0x1d')]);router['delete'](_0x4c7d('0xc'),auth[_0x4c7d('0x9')](),controller['destroy']);router[_0x4c7d('0x1e')](_0x4c7d('0xe'),auth['isAuthenticated'](),controller[_0x4c7d('0x1f')]);router[_0x4c7d('0x1e')](_0x4c7d('0x10'),auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x20')]);router['delete']('/:id/users',auth[_0x4c7d('0x9')](),controller[_0x4c7d('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 07050c6..fb5c513 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 _0xe602=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x5e0dde,_0x3c138c){var _0x5e1503=function(_0x35d86b){while(--_0x35d86b){_0x5e0dde['push'](_0x5e0dde['shift']());}};_0x5e1503(++_0x3c138c);}(_0xe602,0xdb));var _0x2e60=function(_0x48c8d0,_0x4bf7ff){_0x48c8d0=_0x48c8d0-0x0;var _0x235518=_0xe602[_0x48c8d0];return _0x235518;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2e60('0x0'));module[_0x2e60('0x1')]={'name':{'type':Sequelize[_0x2e60('0x2')],'unique':_0x2e60('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2e60('0x2')],'defaultValue':function(){return rs[_0x2e60('0x4')]();}},'replyUri':{'type':Sequelize[_0x2e60('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2e60('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2e60('0x5')],'defaultValue':function(){return _0x2e60('0x6');}},'notificationSound':{'type':Sequelize[_0x2e60('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2e60('0x2')]},'queueTransfer':{'type':Sequelize[_0x2e60('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e60('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2e60('0x7')],'defaultValue':![],'comment':_0x2e60('0x9'),'set':function(_0x23e279){if(!_0x23e279)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x2e60('0xa')](_0x2e60('0xb'),_0x23e279);}}}; \ No newline at end of file +var _0x8511=['sequelize','randomstring','exports','STRING','name','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'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8511,0xf0));var _0x1851=function(_0x322113,_0x33a35b){_0x322113=_0x322113-0x0;var _0x14b84e=_0x8511[_0x322113];return _0x14b84e;};'use strict';var Sequelize=require(_0x1851('0x0'));var rs=require(_0x1851('0x1'));module[_0x1851('0x2')]={'name':{'type':Sequelize[_0x1851('0x3')],'unique':_0x1851('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x1851('0x3')]},'token':{'type':Sequelize[_0x1851('0x3')],'defaultValue':function(){return rs[_0x1851('0x5')]();}},'replyUri':{'type':Sequelize[_0x1851('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1851('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1851('0x6')],'defaultValue':function(){return _0x1851('0x7');}},'notificationSound':{'type':Sequelize[_0x1851('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1851('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1851('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1851('0x3')]},'queueTransfer':{'type':Sequelize[_0x1851('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1851('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1851('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1851('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1851('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1851('0xb'),'set':function(_0x18c7d3){if(!_0x18c7d3)this[_0x1851('0xc')](_0x1851('0xd'),null);this[_0x1851('0xc')](_0x1851('0xe'),_0x18c7d3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1677499..79fc1df 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 _0x3559=['contact','threadId','externalUrl','OpenchannelInteraction','ContactId','firstName','messageId','interaction','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','push','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','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','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','map','type','VIRTUAL','field','options','OpenchannelAccount','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','role','UserProfileSection','userProfileId','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','nolimit','OpenchannelAccountId','filter','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','openchannel','CmContact','Sequelize','createdAt','updatedAt','difference','CompanyId','ListId','from','ValidationError','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','applications','list','orderBy','priority','asc','account'];(function(_0x32ab83,_0xebe18){var _0x49acdb=function(_0x34af85){while(--_0x34af85){_0x32ab83['push'](_0x32ab83['shift']());}};_0x49acdb(++_0xebe18);}(_0x3559,0x1a1));var _0x9355=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3559[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x9355('0x0'));var emlformat=require(_0x9355('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9355('0x2'));var jsonpatch=require(_0x9355('0x3'));var rp=require(_0x9355('0x4'));var moment=require('moment');var BPromise=require(_0x9355('0x5'));var Mustache=require(_0x9355('0x6'));var util=require(_0x9355('0x7'));var path=require(_0x9355('0x8'));var sox=require(_0x9355('0x9'));var csv=require(_0x9355('0xa'));var ejs=require(_0x9355('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9355('0xc'));var crypto=require(_0x9355('0xd'));var jsforce=require(_0x9355('0xe'));var deskjs=require(_0x9355('0xf'));var toCsv=require(_0x9355('0xa'));var querystring=require('querystring');var Papa=require(_0x9355('0x10'));var Redis=require(_0x9355('0x11'));var authService=require(_0x9355('0x12'));var qs=require(_0x9355('0x13'));var hardwareService=require(_0x9355('0x14'));var logger=require(_0x9355('0x15'))('api');var utils=require(_0x9355('0x16'));var config=require(_0x9355('0x17'));var db=require(_0x9355('0x18'))['db'];config[_0x9355('0x19')]=_[_0x9355('0x1a')](config[_0x9355('0x19')],{'host':_0x9355('0x1b'),'port':0x18eb});var socket=require(_0x9355('0x1c'))(new Redis(config[_0x9355('0x19')]));require('./openchannelAccount.socket')[_0x9355('0x1d')](socket);var jayson=require(_0x9355('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x53ea0e,_0x525a9d,_0x103603){if(_0x103603){var _0x192d3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x192d3d['test'](_0x525a9d)){return _0x53ea0e;}else{throw new Error(_0x9355('0x1f'));}}else{return _0x53ea0e;}}function respondWithRpcPromise(_0x2139ff,_0x436210,_0x2b0207,_0x3a9b76){return new BPromise(function(_0x4bf39d,_0x3aee8a){var _0x307680=_0x3a9b76||client;return _0x307680[_0x9355('0x20')](_0x2139ff,_0x2b0207)[_0x9355('0x21')](function(_0x3d83b5){logger[_0x9355('0x22')](_0x9355('0x23'),_0x436210,_0x9355('0x24'));logger[_0x9355('0x25')](_0x9355('0x26'),_0x436210,'request\x20sent',JSON['stringify'](_0x3d83b5));if(_0x3d83b5['error']){if(_0x3d83b5[_0x9355('0x27')]['code']===0x1f4){logger[_0x9355('0x27')](_0x9355('0x23'),_0x436210,_0x3d83b5['error']['message']);return _0x3aee8a(_0x3d83b5[_0x9355('0x27')][_0x9355('0x28')]);}logger[_0x9355('0x27')](_0x9355('0x23'),_0x436210,_0x3d83b5[_0x9355('0x27')][_0x9355('0x28')]);return _0x4bf39d(_0x3d83b5[_0x9355('0x27')][_0x9355('0x28')]);}else{logger[_0x9355('0x22')](_0x9355('0x23'),_0x436210,_0x9355('0x24'));_0x4bf39d(_0x3d83b5[_0x9355('0x29')][_0x9355('0x28')]);}})['catch'](function(_0x9387d3){logger[_0x9355('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x436210,_0x9387d3);_0x3aee8a(_0x9387d3);});});}function respondWithStatusCode(_0x1c3acf,_0x348e4a){_0x348e4a=_0x348e4a||0xcc;return function(_0x4b9987){if(_0x4b9987){return _0x1c3acf[_0x9355('0x2a')](_0x348e4a);}return _0x1c3acf[_0x9355('0x2b')](_0x348e4a)[_0x9355('0x2c')]();};}function respondWithResult(_0x1c71ab,_0x29c5ab){_0x29c5ab=_0x29c5ab||0xc8;return function(_0x5e425f){if(_0x5e425f){return _0x1c71ab['status'](_0x29c5ab)['json'](_0x5e425f);}};}function respondWithFilteredResult(_0x37e437,_0x34e16d){return function(_0x4cb7c7){if(_0x4cb7c7){var _0x13e4b4=_0x4cb7c7[_0x9355('0x2d')],_0xb44fc=_0x34e16d[_0x9355('0x2e')],_0x36e46d=_0x34e16d[_0x9355('0x2e')]+_0x34e16d[_0x9355('0x2f')],_0x852ab9;if(_0x36e46d>=_0x13e4b4){_0x36e46d=_0x13e4b4;_0x852ab9=0xc8;}else{_0x852ab9=0xce;}_0x37e437[_0x9355('0x2b')](_0x852ab9);return _0x37e437[_0x9355('0x30')](_0x9355('0x31'),_0xb44fc+'-'+_0x36e46d+'/'+_0x13e4b4)[_0x9355('0x32')](_0x4cb7c7);}return null;};}function patchUpdates(_0x55f663){return function(_0x1336f1){try{jsonpatch[_0x9355('0x33')](_0x1336f1,_0x55f663,!![]);}catch(_0x57367c){return BPromise['reject'](_0x57367c);}return _0x1336f1[_0x9355('0x34')]();};}function saveUpdates(_0x5b49b8,_0x232239){return function(_0x30e62c){if(_0x30e62c){return _0x30e62c[_0x9355('0x35')](_0x5b49b8)[_0x9355('0x21')](function(_0x50ca2c){return _0x50ca2c;});}return null;};}function removeEntity(_0x28df96,_0x53c84a){return function(_0x186517){if(_0x186517){return _0x186517['destroy']()['then'](function(){var _0xfad3d4=_0x186517[_0x9355('0x36')]({'plain':!![]});var _0x2fc672=_0x9355('0x37');return db[_0x9355('0x38')][_0x9355('0x39')]({'where':{'type':_0x2fc672,'resourceId':_0xfad3d4['id']}})[_0x9355('0x21')](function(){return _0x186517;});})[_0x9355('0x21')](function(){_0x28df96[_0x9355('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3785e6,_0x4d3554){return function(_0x22fe31){if(!_0x22fe31){_0x3785e6[_0x9355('0x2a')](0x194);}return _0x22fe31;};}function handleError(_0x44988a,_0x585862){_0x585862=_0x585862||0x1f4;return function(_0x48c804){logger[_0x9355('0x27')](_0x48c804[_0x9355('0x3a')]);if(_0x48c804['name']){delete _0x48c804[_0x9355('0x3b')];}_0x44988a['status'](_0x585862)[_0x9355('0x3c')](_0x48c804);};}exports[_0x9355('0x3d')]=function(_0x42d95a,_0x453bbc){var _0x54ef08={'include':[{'model':db[_0x9355('0x3e')],'as':_0x9355('0x3f')}]},_0x269c1e={},_0xa6c83={'count':0x0,'rows':[]};var _0x3918d5=db['OpenchannelAccount'][_0x9355('0x40')];_0x269c1e[_0x9355('0x41')]=_[_0x9355('0x42')](_0x3918d5);_0x269c1e[_0x9355('0x43')]=_['keys'](_0x42d95a[_0x9355('0x43')]);_0x269c1e[_0x9355('0x44')]=_[_0x9355('0x45')](_0x269c1e['model'],_0x269c1e[_0x9355('0x43')]);_0x54ef08[_0x9355('0x46')]=_[_0x9355('0x45')](_0x269c1e[_0x9355('0x41')],qs['fields'](_0x42d95a[_0x9355('0x43')][_0x9355('0x47')]));_0x54ef08[_0x9355('0x46')]=_0x54ef08[_0x9355('0x46')][_0x9355('0x48')]?_0x54ef08['attributes']:_0x269c1e[_0x9355('0x41')];if(!_0x42d95a[_0x9355('0x43')][_0x9355('0x49')]('nolimit')){_0x54ef08[_0x9355('0x2f')]=qs[_0x9355('0x2f')](_0x42d95a[_0x9355('0x43')]['limit']);_0x54ef08['offset']=qs['offset'](_0x42d95a['query'][_0x9355('0x2e')]);}_0x54ef08['order']=qs[_0x9355('0x4a')](_0x42d95a[_0x9355('0x43')][_0x9355('0x4a')]);_0x54ef08[_0x9355('0x4b')]=qs[_0x9355('0x44')](_[_0x9355('0x4c')](_0x42d95a[_0x9355('0x43')],_0x269c1e[_0x9355('0x44')]));if(_0x42d95a[_0x9355('0x43')]['filter']){_0x54ef08[_0x9355('0x4b')]=_['merge'](_0x54ef08['where'],{'$or':_[_0x9355('0x4d')](_0x3918d5,function(_0x337792){if(_0x337792[_0x9355('0x4e')]['key']!==_0x9355('0x4f')){var _0x587481={};_0x587481[_0x337792[_0x9355('0x50')]]={'$like':'%'+_0x42d95a[_0x9355('0x43')]['filter']+'%'};return _0x587481;}})});}_0x54ef08=_['merge']({},_0x54ef08,_0x42d95a[_0x9355('0x51')]);var _0x243232={'where':_0x54ef08[_0x9355('0x4b')]};return db[_0x9355('0x52')][_0x9355('0x2d')](_0x243232)[_0x9355('0x21')](function(_0x196916){_0xa6c83['count']=_0x196916;if(_0x42d95a['query'][_0x9355('0x53')]){_0x54ef08[_0x9355('0x54')]=[{'all':!![]}];}return db[_0x9355('0x52')][_0x9355('0x55')](_0x54ef08);})['then'](function(_0x56acc2){_0xa6c83[_0x9355('0x56')]=_0x56acc2;return _0xa6c83;})[_0x9355('0x21')](respondWithFilteredResult(_0x453bbc,_0x54ef08))[_0x9355('0x57')](handleError(_0x453bbc,null));};exports['show']=function(_0x280e53,_0x4ae7ba){var _0x621d32={'raw':![],'where':{'id':_0x280e53[_0x9355('0x58')]['id']},'include':[{'model':db[_0x9355('0x3e')],'as':'mandatoryDispositionPause'}]},_0x40abe7={};_0x40abe7[_0x9355('0x41')]=_[_0x9355('0x42')](db[_0x9355('0x52')][_0x9355('0x40')]);_0x40abe7[_0x9355('0x43')]=_['keys'](_0x280e53[_0x9355('0x43')]);_0x40abe7[_0x9355('0x44')]=_[_0x9355('0x45')](_0x40abe7['model'],_0x40abe7['query']);_0x621d32[_0x9355('0x46')]=_['intersection'](_0x40abe7['model'],qs['fields'](_0x280e53['query'][_0x9355('0x47')]));_0x621d32[_0x9355('0x46')]=_0x621d32[_0x9355('0x46')][_0x9355('0x48')]?_0x621d32[_0x9355('0x46')]:_0x40abe7[_0x9355('0x41')];if(_0x280e53[_0x9355('0x43')][_0x9355('0x53')]){_0x621d32[_0x9355('0x54')]=[{'all':!![]}];}_0x621d32=_[_0x9355('0x59')]({},_0x621d32,_0x280e53[_0x9355('0x51')]);return db[_0x9355('0x52')][_0x9355('0x5a')](_0x621d32)[_0x9355('0x21')](handleEntityNotFound(_0x4ae7ba,null))['then'](respondWithResult(_0x4ae7ba,null))[_0x9355('0x57')](handleError(_0x4ae7ba,null));};exports[_0x9355('0x5b')]=function(_0x17ada4,_0x40b0d3){return db['OpenchannelAccount'][_0x9355('0x5b')](_0x17ada4[_0x9355('0x5c')],{})['then'](function(_0x48955f){var _0x5d4002=_0x17ada4[_0x9355('0x5d')][_0x9355('0x36')]({'plain':!![]});if(!_0x5d4002)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d4002[_0x9355('0x5e')]===_0x9355('0x5d')){var _0xc0c8cf=_0x48955f['get']({'plain':!![]});var _0x570fdc=_0x9355('0x37');return db[_0x9355('0x5f')][_0x9355('0x5a')]({'where':{'name':_0x570fdc,'userProfileId':_0x5d4002[_0x9355('0x60')]},'raw':!![]})[_0x9355('0x21')](function(_0x33009e){if(_0x33009e&&_0x33009e['autoAssociation']===0x0){return db[_0x9355('0x38')][_0x9355('0x5b')]({'name':_0xc0c8cf[_0x9355('0x3b')],'resourceId':_0xc0c8cf['id'],'type':_0x33009e[_0x9355('0x3b')],'sectionId':_0x33009e['id']},{})[_0x9355('0x21')](function(){return _0x48955f;});}else{return _0x48955f;}})[_0x9355('0x57')](function(_0x4c9de0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c9de0);throw _0x4c9de0;});}return _0x48955f;})[_0x9355('0x21')](respondWithResult(_0x40b0d3,0xc9))[_0x9355('0x57')](handleError(_0x40b0d3,null));};exports[_0x9355('0x35')]=function(_0x7d1b27,_0x5d64da){if(_0x7d1b27[_0x9355('0x5c')]['id']){delete _0x7d1b27['body']['id'];}return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x7d1b27['params']['id']},'include':[{'model':db[_0x9355('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5d64da,null))[_0x9355('0x21')](saveUpdates(_0x7d1b27[_0x9355('0x5c')],null))[_0x9355('0x21')](respondWithResult(_0x5d64da,null))[_0x9355('0x57')](handleError(_0x5d64da,null));};exports[_0x9355('0x39')]=function(_0x4ede46,_0x1c4dc3){return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x4ede46[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x1c4dc3,null))[_0x9355('0x21')](removeEntity(_0x1c4dc3,null))['catch'](handleError(_0x1c4dc3,null));};exports['describe']=function(_0x4fdc87,_0x197eee){return db[_0x9355('0x52')][_0x9355('0x61')]()[_0x9355('0x21')](respondWithResult(_0x197eee,null))[_0x9355('0x57')](handleError(_0x197eee,null));};exports[_0x9355('0x62')]=function(_0x3b2fe,_0x5e33c0,_0x4bf4a4){if(_0x3b2fe[_0x9355('0x5c')]['id']){delete _0x3b2fe[_0x9355('0x5c')]['id'];}return db['OpenchannelAccount'][_0x9355('0x5a')]({'where':{'id':_0x3b2fe['params']['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x5e33c0,null))['then'](function(_0x4c8412){if(_0x4c8412){_0x3b2fe['body'][_0x9355('0x63')]=_0x4c8412['id'];return db[_0x9355('0x64')][_0x9355('0x5b')](_0x3b2fe[_0x9355('0x5c')]);}})[_0x9355('0x21')](respondWithResult(_0x5e33c0,null))['catch'](handleError(_0x5e33c0,null));};exports[_0x9355('0x65')]=function(_0x10b36b,_0x58a6ff,_0x409b25){var _0x10638c={'raw':![],'where':{}};var _0x51238f={};var _0x40cac4={'count':0x0,'rows':[]};return db[_0x9355('0x52')][_0x9355('0x66')]({'where':{'id':_0x10b36b[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x58a6ff,null))['then'](function(_0x35ff81){if(_0x35ff81){_0x51238f[_0x9355('0x41')]=_['keys'](db[_0x9355('0x64')][_0x9355('0x40')]);_0x51238f[_0x9355('0x43')]=_[_0x9355('0x42')](_0x10b36b[_0x9355('0x43')]);_0x51238f[_0x9355('0x44')]=_['intersection'](_0x51238f[_0x9355('0x41')],_0x51238f[_0x9355('0x43')]);_0x10638c[_0x9355('0x46')]=_[_0x9355('0x45')](_0x51238f['model'],qs[_0x9355('0x47')](_0x10b36b['query'][_0x9355('0x47')]));_0x10638c[_0x9355('0x46')]=_0x10638c['attributes'][_0x9355('0x48')]?_0x10638c[_0x9355('0x46')]:_0x51238f['model'];if(!_0x10b36b[_0x9355('0x43')][_0x9355('0x49')](_0x9355('0x67'))){_0x10638c['limit']=qs[_0x9355('0x2f')](_0x10b36b[_0x9355('0x43')][_0x9355('0x2f')]);_0x10638c[_0x9355('0x2e')]=qs[_0x9355('0x2e')](_0x10b36b[_0x9355('0x43')][_0x9355('0x2e')]);}_0x10638c['order']=qs[_0x9355('0x4a')](_0x10b36b[_0x9355('0x43')][_0x9355('0x4a')]);_0x10638c[_0x9355('0x4b')]=qs[_0x9355('0x44')](_[_0x9355('0x4c')](_0x10b36b[_0x9355('0x43')],_0x51238f[_0x9355('0x44')]));_0x10638c[_0x9355('0x4b')][_0x9355('0x68')]=_0x35ff81['id'];if(_0x10b36b['query'][_0x9355('0x69')]){_0x10638c['where']=_['merge'](_0x10638c[_0x9355('0x4b')],{'$or':_[_0x9355('0x4d')](_0x10638c[_0x9355('0x46')],function(_0x57c564){var _0x2302d0={};_0x2302d0[_0x57c564]={'$like':'%'+_0x10b36b[_0x9355('0x43')][_0x9355('0x69')]+'%'};return _0x2302d0;})});}_0x10638c=_[_0x9355('0x59')]({},_0x10638c,_0x10b36b[_0x9355('0x51')]);return db[_0x9355('0x64')][_0x9355('0x2d')]({'where':_0x10638c[_0x9355('0x4b')]})[_0x9355('0x21')](function(_0x4cb6f2){_0x40cac4['count']=_0x4cb6f2;if(_0x10b36b['query'][_0x9355('0x53')]){_0x10638c[_0x9355('0x54')]=[{'all':!![]}];}return db[_0x9355('0x64')][_0x9355('0x55')](_0x10638c);})[_0x9355('0x21')](function(_0x380f68){_0x40cac4[_0x9355('0x56')]=_0x380f68;return _0x40cac4;});}})['then'](respondWithFilteredResult(_0x58a6ff,_0x10638c))['catch'](handleError(_0x58a6ff,null));};exports['removeDispositions']=function(_0x5523c5,_0x3181b6,_0x517b5d){return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x5523c5[_0x9355('0x58')]['id']}})['then'](handleEntityNotFound(_0x3181b6,null))['then'](function(_0x39bc28){if(_0x39bc28){return _0x39bc28[_0x9355('0x6a')](_0x5523c5['query'][_0x9355('0x6b')]);}})[_0x9355('0x21')](respondWithStatusCode(_0x3181b6,null))[_0x9355('0x57')](handleError(_0x3181b6,null));};exports['addAnswer']=function(_0x1a64fd,_0x491c1c,_0x2730ed){if(_0x1a64fd[_0x9355('0x5c')]['id']){delete _0x1a64fd[_0x9355('0x5c')]['id'];}return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x1a64fd[_0x9355('0x58')]['id']}})['then'](handleEntityNotFound(_0x491c1c,null))['then'](function(_0x1a9467){if(_0x1a9467){_0x1a64fd['body']['OpenchannelAccountId']=_0x1a9467['id'];return db[_0x9355('0x6c')]['create'](_0x1a64fd[_0x9355('0x5c')]);}})['then'](respondWithResult(_0x491c1c,null))[_0x9355('0x57')](handleError(_0x491c1c,null));};exports[_0x9355('0x6d')]=function(_0xc71be4,_0x496cff,_0x51ed04){var _0x37c170={'raw':![],'where':{}};var _0x13e697={};var _0x12ca20={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9355('0x66')]({'where':{'id':_0xc71be4[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x496cff,null))['then'](function(_0xa47892){if(_0xa47892){_0x13e697[_0x9355('0x41')]=_[_0x9355('0x42')](db[_0x9355('0x6c')][_0x9355('0x40')]);_0x13e697[_0x9355('0x43')]=_[_0x9355('0x42')](_0xc71be4[_0x9355('0x43')]);_0x13e697[_0x9355('0x44')]=_[_0x9355('0x45')](_0x13e697['model'],_0x13e697[_0x9355('0x43')]);_0x37c170[_0x9355('0x46')]=_[_0x9355('0x45')](_0x13e697[_0x9355('0x41')],qs[_0x9355('0x47')](_0xc71be4['query'][_0x9355('0x47')]));_0x37c170[_0x9355('0x46')]=_0x37c170['attributes']['length']?_0x37c170[_0x9355('0x46')]:_0x13e697[_0x9355('0x41')];if(!_0xc71be4[_0x9355('0x43')][_0x9355('0x49')](_0x9355('0x67'))){_0x37c170[_0x9355('0x2f')]=qs[_0x9355('0x2f')](_0xc71be4[_0x9355('0x43')][_0x9355('0x2f')]);_0x37c170[_0x9355('0x2e')]=qs[_0x9355('0x2e')](_0xc71be4[_0x9355('0x43')][_0x9355('0x2e')]);}_0x37c170[_0x9355('0x6e')]=qs[_0x9355('0x4a')](_0xc71be4[_0x9355('0x43')][_0x9355('0x4a')]);_0x37c170['where']=qs[_0x9355('0x44')](_['pick'](_0xc71be4['query'],_0x13e697['filters']));_0x37c170['where'][_0x9355('0x68')]=_0xa47892['id'];if(_0xc71be4[_0x9355('0x43')][_0x9355('0x69')]){_0x37c170[_0x9355('0x4b')]=_['merge'](_0x37c170['where'],{'$or':_[_0x9355('0x4d')](_0x37c170[_0x9355('0x46')],function(_0x221d44){var _0x2f75e1={};_0x2f75e1[_0x221d44]={'$like':'%'+_0xc71be4[_0x9355('0x43')][_0x9355('0x69')]+'%'};return _0x2f75e1;})});}_0x37c170=_[_0x9355('0x59')]({},_0x37c170,_0xc71be4[_0x9355('0x51')]);return db[_0x9355('0x6c')][_0x9355('0x2d')]({'where':_0x37c170['where']})['then'](function(_0x22b528){_0x12ca20[_0x9355('0x2d')]=_0x22b528;if(_0xc71be4['query'][_0x9355('0x53')]){_0x37c170[_0x9355('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9355('0x55')](_0x37c170);})[_0x9355('0x21')](function(_0x522f1d){_0x12ca20[_0x9355('0x56')]=_0x522f1d;return _0x12ca20;});}})[_0x9355('0x21')](respondWithFilteredResult(_0x496cff,_0x37c170))[_0x9355('0x57')](handleError(_0x496cff,null));};exports[_0x9355('0x6f')]=function(_0x3dc765,_0x4e20c9,_0x15b537){return db[_0x9355('0x52')]['find']({'where':{'id':_0x3dc765[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x4e20c9,null))['then'](function(_0x3865ae){if(_0x3865ae){return _0x3865ae[_0x9355('0x6f')](_0x3dc765[_0x9355('0x43')][_0x9355('0x6b')]);}})[_0x9355('0x21')](respondWithStatusCode(_0x4e20c9,null))[_0x9355('0x57')](handleError(_0x4e20c9,null));};exports['notify']=function(_0x32677f,_0x20bfa2,_0x467051){var _0xd26267={'body':_0x32677f[_0x9355('0x5c')],'channel':_0x9355('0x70')};var _0x17bc00=[];var _0x15d79d=[];var _0x173dcf={};var _0x331540=![];return db[_0x9355('0x71')][_0x9355('0x61')]()[_0x9355('0x21')](function(_0x57f458){if(!_0x57f458){throw new db[(_0x9355('0x72'))]['ValidationError']('no\x20available\x20attributes');}_0x17bc00=_['difference'](_[_0x9355('0x42')](_0x57f458),[_0x9355('0x73'),_0x9355('0x74')]);_0x15d79d=_[_0x9355('0x75')](_[_0x9355('0x42')](_0x57f458),[_0x9355('0x73'),'updatedAt',_0x9355('0x76'),_0x9355('0x77')]);if(_0x32677f[_0x9355('0x5c')]['id']){delete _0x32677f['body']['id'];}if(_['isNil'](_0x32677f[_0x9355('0x5c')][_0x9355('0x78')])){throw new db['Sequelize'][(_0x9355('0x79'))]('from\x20is\x20mandatory');}if(_[_0x9355('0x7a')](_0x32677f['body']['body'])||_0x32677f[_0x9355('0x5c')][_0x9355('0x5c')]===''){throw new db[(_0x9355('0x72'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x32677f[_0x9355('0x5c')][_0x9355('0x7b')])){throw new db['Sequelize'][(_0x9355('0x79'))](_0x9355('0x7c')+_0x15d79d);}if(!_['includes'](_0x15d79d,_0x32677f[_0x9355('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x9355('0x79'))](_0x9355('0x7d')+_0x15d79d);}_0x173dcf[_0x32677f[_0x9355('0x5c')][_0x9355('0x7b')]]=_0x32677f[_0x9355('0x5c')][_0x9355('0x78')];})[_0x9355('0x21')](function(){return db['OpenchannelAccount'][_0x9355('0x5a')]({'where':{'id':_0x32677f['params']['id']},'include':[{'model':db[_0x9355('0x7e')],'as':'List','include':[{'model':db[_0x9355('0x71')],'as':_0x9355('0x7f'),'where':_0x173dcf,'limit':0x1,'order':[[_0x9355('0x74'),_0x9355('0x80')]]}]},{'model':db[_0x9355('0x81')],'as':_0x9355('0x82')}]});})[_0x9355('0x21')](handleEntityNotFound(_0x20bfa2,null))['then'](function(_0x2ccb9e){if(_0x2ccb9e&&_0x2ccb9e[_0x9355('0x83')]){_0xd26267['account']=_0x2ccb9e;_0xd26267[_0x9355('0x84')]=_0x2ccb9e[_0x9355('0x82')];_0xd26267[_0x9355('0x85')]=_0x2ccb9e[_0x9355('0x83')];_0xd26267[_0x9355('0x84')]=_[_0x9355('0x86')](_0xd26267[_0x9355('0x84')],[_0x9355('0x87')],[_0x9355('0x88')]);if(_0xd26267['account'][_0x9355('0x82')]){delete _0xd26267[_0x9355('0x89')][_0x9355('0x82')];}if(_0xd26267[_0x9355('0x89')][_0x9355('0x83')]&&_0xd26267[_0x9355('0x89')]['List'][_0x9355('0x7f')][_0x9355('0x48')]){return _0xd26267[_0x9355('0x89')]['List'][_0x9355('0x7f')][0x0];}var _0x92c8d5=_['defaults'](_0x32677f[_0x9355('0x5c')],{'firstName':_0x32677f[_0x9355('0x5c')][_0x9355('0x78')],'ListId':_0x2ccb9e[_0x9355('0x77')]});_0x92c8d5[_0x32677f[_0x9355('0x5c')][_0x9355('0x7b')]]=_0x32677f[_0x9355('0x5c')][_0x9355('0x78')];return db[_0x9355('0x71')][_0x9355('0x5b')](_0x92c8d5,{'fields':_0x17bc00,'raw':!![]});}})[_0x9355('0x21')](handleEntityNotFound(_0x20bfa2,null))[_0x9355('0x21')](function(_0x2a3386){_0xd26267[_0x9355('0x8a')]=_0x2a3386;if(_0x2a3386){var _0x13744d={'ContactId':_0x2a3386['id'],'OpenchannelAccountId':_0x32677f[_0x9355('0x58')]['id'],'from':(_0x2a3386['firstName']||'')+'\x20'+(_0x2a3386['lastName']||'')};var _0x363268={'OpenchannelAccountId':_0x32677f[_0x9355('0x58')]['id'],'closed':![]};if(_0x32677f['body'][_0x9355('0x8b')]){_0x363268[_0x9355('0x8b')]=_0x32677f['body']['threadId'];return db['OpenchannelInteraction']['find']({'where':_0x363268})[_0x9355('0x21')](function(_0x289d02){if(_0x289d02){return[_0x289d02,![]];}_0x13744d['threadId']=_0x32677f[_0x9355('0x5c')][_0x9355('0x8b')];_0x13744d[_0x9355('0x8c')]=_0x32677f['body']['externalUrl'];return db[_0x9355('0x8d')]['create'](_0x13744d)['then'](function(_0x3a48bf){return[_0x3a48bf,!![]];});});}else{_0x363268['threadId']=null;}_0x363268[_0x9355('0x8e')]=_0x2a3386['id'];return db['OpenchannelInteraction']['find']({'where':_0x363268})['then'](function(_0x91b11a){if(_0x91b11a){return[_0x91b11a,![]];}return db[_0x9355('0x8d')][_0x9355('0x5b')](_0x13744d)['then'](function(_0xe7ac4f){return[_0xe7ac4f,!![]];});});}})['spread'](function(_0x272ad6,_0x2dafe1){if(_0x272ad6){_0x331540=_0x2dafe1;if(!_0x2dafe1){var _0x1fe384={'from':(_0xd26267[_0x9355('0x8a')][_0x9355('0x8f')]||'')+'\x20'+(_0xd26267['contact']['lastName']||'')};if(_0x32677f[_0x9355('0x5c')][_0x9355('0x8b')]&&_0x32677f['body'][_0x9355('0x90')]&&_0x32677f[_0x9355('0x5c')]['threadId']!=_0x32677f[_0x9355('0x5c')][_0x9355('0x90')]){_0x1fe384[_0x9355('0x8b')]=_0x32677f[_0x9355('0x5c')][_0x9355('0x90')];}return _0x272ad6[_0x9355('0x35')](_0x1fe384);}else{return _0x272ad6;}}})[_0x9355('0x21')](function(_0x32afee){_0xd26267[_0x9355('0x91')]=_0x32afee[_0x9355('0x36')]({'plain':!![]});_0xd26267[_0x9355('0x91')]['created']=_0x331540;if(_0xd26267[_0x9355('0x91')]['created']){if(_0xd26267[_0x9355('0x89')][_0x9355('0x92')]){_0xd26267[_0x9355('0x84')]['push']({'id':0x0,'priority':_0xd26267[_0x9355('0x84')][_0x9355('0x48')]+0x1,'app':_0x9355('0x93'),'appdata':'unmanaged','interval':_0x9355('0x94')});}}return db[_0x9355('0x95')][_0x9355('0x5b')]({'body':_0x32677f[_0x9355('0x5c')][_0x9355('0x5c')],'OpenchannelAccountId':_0x32677f['params']['id'],'OpenchannelInteractionId':_0x32afee['id'],'direction':'in','ContactId':_0xd26267[_0x9355('0x8a')]['id'],'AttachmentId':_0x32677f[_0x9355('0x5c')][_0x9355('0x96')]});})['then'](function(_0x50ffde){_0xd26267['message']=_0x50ffde;if(_0xd26267[_0x9355('0x91')][_0x9355('0x97')]){return db['User'][_0x9355('0x5a')]({'attributes':['id',_0x9355('0x3b')],'where':{'id':_0xd26267['interaction'][_0x9355('0x97')]}})['then'](function(_0x58a115){if(_0x58a115){_0xd26267['applications'][_0x9355('0x98')]({'id':0x0,'priority':0x0,'app':_0x9355('0x99'),'appdata':_0x58a115[_0x9355('0x3b')]+','+(_0xd26267['account'][_0x9355('0x9a')]||0xa),'interval':_0x9355('0x94')});_0xd26267[_0x9355('0x9b')]=![];}return respondWithRpcPromise('Start',_0x9355('0x9c'),_0xd26267);});}return respondWithRpcPromise(_0x9355('0x9d'),_0x9355('0x9c'),_0xd26267);})[_0x9355('0x21')](function(_0x56604b){respondWithRpcPromise(_0x9355('0x9e'),_0x9355('0x9e'),{'event':'notify','message':_0x56604b},client9002);return _0x56604b;})[_0x9355('0x21')](respondWithResult(_0x20bfa2,null))['catch'](handleError(_0x20bfa2,null));};exports[_0x9355('0x9f')]=function(_0x42e745,_0x2ad1f4,_0x5a8d1a){return db[_0x9355('0x52')]['findOne']({'where':{'id':_0x42e745['params']['id']}})['then'](handleEntityNotFound(_0x2ad1f4,null))[_0x9355('0x21')](function(_0x4df3e9){if(_0x4df3e9){return db[_0x9355('0xa0')][_0x9355('0xa1')](function(_0x345b7d){return db[_0x9355('0x81')][_0x9355('0x39')]({'where':{'OpenchannelAccountId':_0x42e745['params']['id']},'transaction':_0x345b7d})[_0x9355('0x21')](function(_0x3aeed8){var _0x3ac552=_[_0x9355('0x4d')](_0x42e745[_0x9355('0x5c')],function(_0x45c18f){_0x45c18f[_0x9355('0x68')]=_0x42e745[_0x9355('0x58')]['id'];return _0x45c18f;});return db[_0x9355('0x81')]['bulkCreate'](_0x3ac552,{'transaction':_0x345b7d});});})[_0x9355('0x21')](function(){return db[_0x9355('0x81')][_0x9355('0xa2')]({'where':{'OpenchannelAccountId':_0x42e745['params']['id']},'order':_0x9355('0x87')});});}})['then'](respondWithResult(_0x2ad1f4,null))[_0x9355('0x57')](handleError(_0x2ad1f4,null));};exports[_0x9355('0xa3')]=function(_0x4e729b,_0x33c07d,_0x592c27){var _0x2dfb15={};var _0x29febb={};var _0x200c65;var _0x2d96f8;return db[_0x9355('0x52')]['findOne']({'where':{'id':_0x4e729b[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x33c07d,null))[_0x9355('0x21')](function(_0x4bc2a3){if(_0x4bc2a3){_0x200c65=_0x4bc2a3;_0x29febb[_0x9355('0x41')]=_[_0x9355('0x42')](db[_0x9355('0x81')][_0x9355('0x40')]);_0x29febb[_0x9355('0x43')]=_[_0x9355('0x42')](_0x4e729b[_0x9355('0x43')]);_0x29febb[_0x9355('0x44')]=_[_0x9355('0x45')](_0x29febb[_0x9355('0x41')],_0x29febb[_0x9355('0x43')]);_0x2dfb15[_0x9355('0x46')]=_['intersection'](_0x29febb[_0x9355('0x41')],qs['fields'](_0x4e729b['query'][_0x9355('0x47')]));_0x2dfb15['attributes']=_0x2dfb15[_0x9355('0x46')][_0x9355('0x48')]?_0x2dfb15['attributes']:_0x29febb['model'];_0x2dfb15[_0x9355('0x6e')]=qs[_0x9355('0x4a')](_0x4e729b[_0x9355('0x43')][_0x9355('0x4a')]);_0x2dfb15[_0x9355('0x4b')]=qs['filters'](_['pick'](_0x4e729b['query'],_0x29febb[_0x9355('0x44')]));if(_0x4e729b['query']['filter']){_0x2dfb15[_0x9355('0x4b')]=_[_0x9355('0x59')](_0x2dfb15[_0x9355('0x4b')],{'$or':_[_0x9355('0x4d')](_0x2dfb15[_0x9355('0x46')],function(_0x137fb4){var _0x174dfa={};_0x174dfa[_0x137fb4]={'$like':'%'+_0x4e729b['query']['filter']+'%'};return _0x174dfa;})});}_0x2dfb15=_[_0x9355('0x59')]({},_0x2dfb15,_0x4e729b['options']);return _0x200c65[_0x9355('0xa3')](_0x2dfb15);}})[_0x9355('0x21')](function(_0x58e2f0){if(_0x58e2f0){_0x2d96f8=_0x58e2f0[_0x9355('0x48')];if(!_0x4e729b[_0x9355('0x43')][_0x9355('0x49')]('nolimit')){_0x2dfb15[_0x9355('0x2f')]=qs[_0x9355('0x2f')](_0x4e729b[_0x9355('0x43')][_0x9355('0x2f')]);_0x2dfb15[_0x9355('0x2e')]=qs[_0x9355('0x2e')](_0x4e729b['query'][_0x9355('0x2e')]);}return _0x200c65[_0x9355('0xa3')](_0x2dfb15);}})['then'](function(_0x46ed69){if(_0x46ed69){return _0x46ed69?{'count':_0x2d96f8,'rows':_0x46ed69}:null;}})[_0x9355('0x21')](respondWithResult(_0x33c07d,null))[_0x9355('0x57')](handleError(_0x33c07d,null));};exports[_0x9355('0xa4')]=function(_0x107b4f,_0x5f2587,_0x4614e2){var _0x5e2aa9={'raw':![],'where':{}};var _0x18009e={};var _0x4e129a={'count':0x0,'rows':[]};return db[_0x9355('0x52')][_0x9355('0x66')]({'where':{'id':_0x107b4f[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x5f2587,null))[_0x9355('0x21')](function(_0x12bd74){if(_0x12bd74){_0x18009e[_0x9355('0x41')]=_[_0x9355('0x42')](db['OpenchannelInteraction']['rawAttributes']);_0x18009e[_0x9355('0x43')]=_[_0x9355('0x42')](_0x107b4f[_0x9355('0x43')]);_0x18009e[_0x9355('0x44')]=_[_0x9355('0x45')](_0x18009e[_0x9355('0x41')],_0x18009e['query']);_0x5e2aa9[_0x9355('0x46')]=_[_0x9355('0x45')](_0x18009e['model'],qs[_0x9355('0x47')](_0x107b4f['query'][_0x9355('0x47')]));_0x5e2aa9[_0x9355('0x46')]=_0x5e2aa9['attributes'][_0x9355('0x48')]?_0x5e2aa9[_0x9355('0x46')]:_0x18009e[_0x9355('0x41')];if(!_0x107b4f[_0x9355('0x43')]['hasOwnProperty'](_0x9355('0x67'))){_0x5e2aa9[_0x9355('0x2f')]=qs['limit'](_0x107b4f[_0x9355('0x43')][_0x9355('0x2f')]);_0x5e2aa9[_0x9355('0x2e')]=qs[_0x9355('0x2e')](_0x107b4f[_0x9355('0x43')][_0x9355('0x2e')]);}_0x5e2aa9[_0x9355('0x6e')]=qs[_0x9355('0x4a')](_0x107b4f[_0x9355('0x43')][_0x9355('0x4a')]);_0x5e2aa9[_0x9355('0x4b')]=qs[_0x9355('0x44')](_[_0x9355('0x4c')](_0x107b4f[_0x9355('0x43')],_0x18009e[_0x9355('0x44')]));_0x5e2aa9[_0x9355('0x4b')][_0x9355('0x68')]=_0x12bd74['id'];if(_0x107b4f[_0x9355('0x43')][_0x9355('0x69')]){_0x5e2aa9[_0x9355('0x4b')]=_[_0x9355('0x59')](_0x5e2aa9[_0x9355('0x4b')],{'$or':_['map'](_0x5e2aa9[_0x9355('0x46')],function(_0x157de5){var _0x3d1b2b={};_0x3d1b2b[_0x157de5]={'$like':'%'+_0x107b4f[_0x9355('0x43')]['filter']+'%'};return _0x3d1b2b;})});}_0x5e2aa9=_[_0x9355('0x59')]({},_0x5e2aa9,_0x107b4f[_0x9355('0x51')]);return db[_0x9355('0x8d')]['count']({'where':_0x5e2aa9['where']})[_0x9355('0x21')](function(_0x32edcd){_0x4e129a[_0x9355('0x2d')]=_0x32edcd;if(_0x107b4f[_0x9355('0x43')][_0x9355('0x53')]){_0x5e2aa9[_0x9355('0x54')]=[{'model':db[_0x9355('0x71')],'as':'Contact','required':![]},{'model':db[_0x9355('0xa5')],'as':_0x9355('0xa6'),'attributes':['name',_0x9355('0xa7'),_0x9355('0xa8')],'required':![]},{'model':db[_0x9355('0xa9')],'as':_0x9355('0xaa'),'attributes':['id',_0x9355('0x3b'),_0x9355('0xab')],'where':_0x107b4f[_0x9355('0x43')][_0x9355('0xac')]?{'id':_0x107b4f[_0x9355('0x43')][_0x9355('0xac')]}:undefined,'required':_0x107b4f[_0x9355('0x43')][_0x9355('0xac')]?!![]:![]}];}return db[_0x9355('0x8d')][_0x9355('0x55')](_0x5e2aa9);})[_0x9355('0x21')](function(_0x41be89){_0x4e129a['rows']=_0x41be89;return _0x4e129a;});}})[_0x9355('0x21')](respondWithFilteredResult(_0x5f2587,_0x5e2aa9))[_0x9355('0x57')](handleError(_0x5f2587,null));};exports[_0x9355('0xad')]=function(_0x131bcb,_0x5871d2,_0x2c636f){return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x131bcb['params']['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x5871d2,null))[_0x9355('0x21')](function(_0x119d8a){if(_0x119d8a){return _0x119d8a[_0x9355('0xad')](_0x131bcb[_0x9355('0x5c')][_0x9355('0x6b')],_['omit'](_0x131bcb[_0x9355('0x5c')],[_0x9355('0x6b'),'id'])||{})[_0x9355('0xae')](function(_0x2677bb){for(var _0x1f5471=0x0;_0x1f5471<_0x131bcb[_0x9355('0x5c')][_0x9355('0x6b')][_0x9355('0x48')];_0x1f5471+=0x1){socket[_0x9355('0xaf')]('userOpenchannelAccount:save',{'UserId':_0x131bcb[_0x9355('0x5c')][_0x9355('0x6b')][_0x1f5471],'OpenchannelAccountId':_0x131bcb[_0x9355('0x58')]['id']});}return _0x2677bb;});}})[_0x9355('0x21')](respondWithResult(_0x5871d2,null))[_0x9355('0x57')](handleError(_0x5871d2,null));};exports[_0x9355('0xb0')]=function(_0x2d069f,_0x46239f,_0x135c84){return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x2d069f[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x46239f,null))['then'](function(_0x514152){if(_0x514152){return _0x514152[_0x9355('0xb0')](_0x2d069f[_0x9355('0x43')][_0x9355('0x6b')])[_0x9355('0x21')](function(){if(_[_0x9355('0xb1')](_0x2d069f['query'][_0x9355('0x6b')])){for(var _0x70be44=0x0;_0x70be44<_0x2d069f[_0x9355('0x43')][_0x9355('0x6b')][_0x9355('0x48')];_0x70be44+=0x1){socket['emit'](_0x9355('0xb2'),{'UserId':Number(_0x2d069f[_0x9355('0x43')][_0x9355('0x6b')][_0x70be44]),'OpenchannelAccountId':Number(_0x2d069f[_0x9355('0x58')]['id'])});}}else{socket[_0x9355('0xaf')](_0x9355('0xb2'),{'UserId':Number(_0x2d069f[_0x9355('0x43')][_0x9355('0x6b')]),'OpenchannelAccountId':Number(_0x2d069f[_0x9355('0x58')]['id'])});}});}})[_0x9355('0x21')](respondWithStatusCode(_0x46239f,null))[_0x9355('0x57')](handleError(_0x46239f,null));};exports[_0x9355('0xb3')]=function(_0x2356d4,_0x49aa65,_0x4b5eaa){var _0x2bd144={};var _0x5aec7b={};var _0x3b9844;var _0x26b2f4;return db[_0x9355('0x52')][_0x9355('0x66')]({'where':{'id':_0x2356d4[_0x9355('0x58')]['id']}})[_0x9355('0x21')](handleEntityNotFound(_0x49aa65,null))[_0x9355('0x21')](function(_0x11c884){if(_0x11c884){_0x3b9844=_0x11c884;_0x5aec7b[_0x9355('0x41')]=_[_0x9355('0x42')](db[_0x9355('0xa5')][_0x9355('0x40')]);_0x5aec7b['query']=_[_0x9355('0x42')](_0x2356d4[_0x9355('0x43')]);_0x5aec7b[_0x9355('0x44')]=_['intersection'](_0x5aec7b[_0x9355('0x41')],_0x5aec7b['query']);_0x2bd144[_0x9355('0x46')]=_[_0x9355('0x45')](_0x5aec7b[_0x9355('0x41')],qs['fields'](_0x2356d4[_0x9355('0x43')][_0x9355('0x47')]));_0x2bd144[_0x9355('0x46')]=_0x2bd144[_0x9355('0x46')][_0x9355('0x48')]?_0x2bd144[_0x9355('0x46')]:_0x5aec7b[_0x9355('0x41')];_0x2bd144[_0x9355('0x6e')]=qs['sort'](_0x2356d4[_0x9355('0x43')][_0x9355('0x4a')]);_0x2bd144['where']=qs[_0x9355('0x44')](_[_0x9355('0x4c')](_0x2356d4[_0x9355('0x43')],_0x5aec7b[_0x9355('0x44')]));if(_0x2356d4['query'][_0x9355('0x69')]){_0x2bd144[_0x9355('0x4b')]=_[_0x9355('0x59')](_0x2bd144[_0x9355('0x4b')],{'$or':_[_0x9355('0x4d')](_0x2bd144[_0x9355('0x46')],function(_0x464f65){var _0x4dbf92={};_0x4dbf92[_0x464f65]={'$like':'%'+_0x2356d4[_0x9355('0x43')][_0x9355('0x69')]+'%'};return _0x4dbf92;})});}_0x2bd144=_[_0x9355('0x59')]({},_0x2bd144,_0x2356d4[_0x9355('0x51')]);return _0x3b9844[_0x9355('0xb3')](_0x2bd144);}})[_0x9355('0x21')](function(_0x135224){if(_0x135224){_0x26b2f4=_0x135224[_0x9355('0x48')];if(!_0x2356d4[_0x9355('0x43')][_0x9355('0x49')](_0x9355('0x67'))){_0x2bd144[_0x9355('0x2f')]=qs['limit'](_0x2356d4[_0x9355('0x43')][_0x9355('0x2f')]);_0x2bd144[_0x9355('0x2e')]=qs[_0x9355('0x2e')](_0x2356d4[_0x9355('0x43')][_0x9355('0x2e')]);}return _0x3b9844[_0x9355('0xb3')](_0x2bd144);}})[_0x9355('0x21')](function(_0x55b6b5){if(_0x55b6b5){return _0x55b6b5?{'count':_0x26b2f4,'rows':_0x55b6b5}:null;}})[_0x9355('0x21')](respondWithResult(_0x49aa65,null))[_0x9355('0x57')](handleError(_0x49aa65,null));};exports[_0x9355('0x3c')]=function(_0x1dbfb4,_0x454c62,_0x1c51e3){var _0x550a8a,_0xe4cfc2,_0x1fe769;if(_[_0x9355('0x7a')](_0x1dbfb4['body']['body'])||_0x1dbfb4[_0x9355('0x5c')][_0x9355('0x5c')]===''){throw new db[(_0x9355('0x72'))][(_0x9355('0x79'))](_0x9355('0xb4'));}if(_['isNil'](_0x1dbfb4['body']['to'])){}_0x550a8a=_0x1dbfb4[_0x9355('0x5c')]['to'];return db[_0x9355('0x52')]['findOne']({'where':{'id':_0x1dbfb4['params']['id']}})['then'](handleEntityNotFound(_0x454c62,null))[_0x9355('0x21')](function(_0x15877e){if(_0x15877e){return db[_0x9355('0x52')][_0x9355('0x5a')]({'where':{'id':_0x15877e['id']},'include':[{'model':db[_0x9355('0x7e')],'as':_0x9355('0x83'),'include':[{'model':db[_0x9355('0x71')],'as':_0x9355('0x7f'),'where':{[_0x15877e[_0x9355('0x7b')]]:_0x550a8a},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x9355('0x21')](handleEntityNotFound(_0x454c62,null))['then'](function(_0x17fbe3){if(_0x17fbe3&&_0x17fbe3[_0x9355('0x83')]){_0xe4cfc2=_0x17fbe3['get']({'plain':!![]});if(_0xe4cfc2[_0x9355('0x83')]&&_0xe4cfc2[_0x9355('0x83')][_0x9355('0x7f')][_0x9355('0x48')]){return _0xe4cfc2[_0x9355('0x83')][_0x9355('0x7f')][0x0];}return db[_0x9355('0x71')][_0x9355('0x5b')](_['defaults'](_0x1dbfb4[_0x9355('0x5c')],{'firstName':_0x550a8a,[_0x17fbe3[_0x9355('0x7b')]]:_0x550a8a,'phone':_0x550a8a,'ListId':_0xe4cfc2[_0x9355('0x77')]}));}})['then'](handleEntityNotFound(_0x454c62,null))[_0x9355('0x21')](function(_0x115f67){if(_0x115f67){_0x1fe769=_0x115f67;return db[_0x9355('0x8d')][_0x9355('0x5a')]({'where':{'ContactId':_0x1fe769['id'],'closed':![],'OpenchannelAccountId':_0xe4cfc2['id']}})[_0x9355('0x21')](function(_0x1f0a53){if(_0x1f0a53){return[_0x1f0a53,![]];}return db[_0x9355('0x8d')][_0x9355('0x5b')]({'UserId':_0x1dbfb4[_0x9355('0x5d')]['id'],'ContactId':_0x1fe769['id'],'OpenchannelAccountId':_0xe4cfc2['id'],'lastMsgDirection':_0x9355('0xb5'),'Messages':[_[_0x9355('0x59')](_0x1dbfb4['body'],{'read':![],'body':_0x1dbfb4[_0x9355('0x5c')][_0x9355('0x5c')],'OpenchannelAccountId':_0xe4cfc2['id'],'UserId':_0x1dbfb4[_0x9355('0x5d')]['id'],'ContactId':_0x1fe769['id']})]},{'include':[{'model':db[_0x9355('0x95')],'as':_0x9355('0xb6')}]})[_0x9355('0x21')](function(_0x50e789){return[_0x50e789,!![]];});});}})[_0x9355('0xae')](function(_0x2fcbad,_0x1da830){if(_0x1da830){return _0x2fcbad;}return db[_0x9355('0x95')]['create'](_[_0x9355('0x59')](_0x1dbfb4['body'],{'read':![],'body':_0x1dbfb4[_0x9355('0x5c')]['body'],'OpenchannelAccountId':_0xe4cfc2['id'],'OpenchannelInteractionId':_0x2fcbad['id'],'UserId':_0x1dbfb4['user']['id'],'ContactId':_0x1fe769['id']}))['then'](function(_0x14f32a){_0x2fcbad[_0x9355('0xb7')][_0x9355('0xb6')]=[];_0x2fcbad[_0x9355('0xb7')]['Messages'][_0x9355('0xb8')](_0x14f32a['dataValues']);return _0x2fcbad;});});}})['then'](respondWithResult(_0x454c62,null))['catch'](handleError(_0x454c62,null));}; \ No newline at end of file +var _0x2fee=['query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','body','describe','OpnechannelAccountId','getDispositions','Disposition','nolimit','OpenchannelAccountId','map','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','Applications','account','applications','orderBy','priority','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','unmanaged','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model'];(function(_0x11a485,_0x44430f){var _0x19308b=function(_0x337eb6){while(--_0x337eb6){_0x11a485['push'](_0x11a485['shift']());}};_0x19308b(++_0x44430f);}(_0x2fee,0x77));var _0xe2fe=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x2fee[_0x18abd2];return _0x1dcad6;};'use strict';var pdf=require(_0xe2fe('0x0'));var emlformat=require(_0xe2fe('0x1'));var rimraf=require(_0xe2fe('0x2'));var zipdir=require(_0xe2fe('0x3'));var jsonpatch=require(_0xe2fe('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2fe('0x5'));var Mustache=require(_0xe2fe('0x6'));var util=require(_0xe2fe('0x7'));var path=require(_0xe2fe('0x8'));var sox=require(_0xe2fe('0x9'));var csv=require(_0xe2fe('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe2fe('0xb'));var squel=require(_0xe2fe('0xc'));var crypto=require('crypto');var jsforce=require(_0xe2fe('0xd'));var deskjs=require(_0xe2fe('0xe'));var toCsv=require(_0xe2fe('0xa'));var querystring=require(_0xe2fe('0xf'));var Papa=require(_0xe2fe('0x10'));var Redis=require(_0xe2fe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe2fe('0x12'));var hardwareService=require(_0xe2fe('0x13'));var logger=require('../../config/logger')(_0xe2fe('0x14'));var utils=require(_0xe2fe('0x15'));var config=require(_0xe2fe('0x16'));var db=require(_0xe2fe('0x17'))['db'];config[_0xe2fe('0x18')]=_[_0xe2fe('0x19')](config[_0xe2fe('0x18')],{'host':_0xe2fe('0x1a'),'port':0x18eb});var socket=require(_0xe2fe('0x1b'))(new Redis(config[_0xe2fe('0x18')]));require(_0xe2fe('0x1c'))[_0xe2fe('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe2fe('0x1e')][_0xe2fe('0x1f')]({'port':0x232c});var client9002=jayson[_0xe2fe('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x343df8,_0x3c6d55,_0x2c497b){if(_0x2c497b){var _0x247b52=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x247b52[_0xe2fe('0x20')](_0x3c6d55)){return _0x343df8;}else{throw new Error(_0xe2fe('0x21'));}}else{return _0x343df8;}}function respondWithRpcPromise(_0x2d18fd,_0x3f446b,_0x3248dd,_0x24bf2b){return new BPromise(function(_0x49d733,_0x21dc4c){var _0x4b706f=_0x24bf2b||client;return _0x4b706f[_0xe2fe('0x22')](_0x2d18fd,_0x3248dd)[_0xe2fe('0x23')](function(_0x1084c7){logger['info'](_0xe2fe('0x24'),_0x3f446b,_0xe2fe('0x25'));logger[_0xe2fe('0x26')](_0xe2fe('0x27'),_0x3f446b,_0xe2fe('0x25'),JSON[_0xe2fe('0x28')](_0x1084c7));if(_0x1084c7[_0xe2fe('0x29')]){if(_0x1084c7[_0xe2fe('0x29')][_0xe2fe('0x2a')]===0x1f4){logger[_0xe2fe('0x29')](_0xe2fe('0x24'),_0x3f446b,_0x1084c7[_0xe2fe('0x29')][_0xe2fe('0x2b')]);return _0x21dc4c(_0x1084c7[_0xe2fe('0x29')]['message']);}logger[_0xe2fe('0x29')](_0xe2fe('0x24'),_0x3f446b,_0x1084c7['error']['message']);return _0x49d733(_0x1084c7[_0xe2fe('0x29')][_0xe2fe('0x2b')]);}else{logger[_0xe2fe('0x2c')](_0xe2fe('0x24'),_0x3f446b,'request\x20sent');_0x49d733(_0x1084c7['result']['message']);}})['catch'](function(_0x3e057b){logger[_0xe2fe('0x29')](_0xe2fe('0x24'),_0x3f446b,_0x3e057b);_0x21dc4c(_0x3e057b);});});}function respondWithStatusCode(_0x909c6,_0x2dd96f){_0x2dd96f=_0x2dd96f||0xcc;return function(_0x42e8ba){if(_0x42e8ba){return _0x909c6[_0xe2fe('0x2d')](_0x2dd96f);}return _0x909c6[_0xe2fe('0x2e')](_0x2dd96f)[_0xe2fe('0x2f')]();};}function respondWithResult(_0x4718d,_0x5f121e){_0x5f121e=_0x5f121e||0xc8;return function(_0x4c96b5){if(_0x4c96b5){return _0x4718d[_0xe2fe('0x2e')](_0x5f121e)['json'](_0x4c96b5);}};}function respondWithFilteredResult(_0x56c3fd,_0x5f588a){return function(_0x5b463c){if(_0x5b463c){var _0x57540a=_0x5b463c[_0xe2fe('0x30')],_0x33ef6f=_0x5f588a[_0xe2fe('0x31')],_0x4fbadb=_0x5f588a[_0xe2fe('0x31')]+_0x5f588a[_0xe2fe('0x32')],_0xe07bf5;if(_0x4fbadb>=_0x57540a){_0x4fbadb=_0x57540a;_0xe07bf5=0xc8;}else{_0xe07bf5=0xce;}_0x56c3fd[_0xe2fe('0x2e')](_0xe07bf5);return _0x56c3fd[_0xe2fe('0x33')](_0xe2fe('0x34'),_0x33ef6f+'-'+_0x4fbadb+'/'+_0x57540a)[_0xe2fe('0x35')](_0x5b463c);}return null;};}function patchUpdates(_0x15abf0){return function(_0x30e521){try{jsonpatch[_0xe2fe('0x36')](_0x30e521,_0x15abf0,!![]);}catch(_0x381ca4){return BPromise['reject'](_0x381ca4);}return _0x30e521[_0xe2fe('0x37')]();};}function saveUpdates(_0x1ffcee,_0x42fef2){return function(_0x27ceb3){if(_0x27ceb3){return _0x27ceb3[_0xe2fe('0x38')](_0x1ffcee)['then'](function(_0x2d2098){return _0x2d2098;});}return null;};}function removeEntity(_0x1fa4c7,_0x14885d){return function(_0xee5237){if(_0xee5237){return _0xee5237['destroy']()['then'](function(){var _0x5a20e5=_0xee5237[_0xe2fe('0x39')]({'plain':!![]});var _0x390bf6=_0xe2fe('0x3a');return db[_0xe2fe('0x3b')][_0xe2fe('0x3c')]({'where':{'type':_0x390bf6,'resourceId':_0x5a20e5['id']}})[_0xe2fe('0x23')](function(){return _0xee5237;});})[_0xe2fe('0x23')](function(){_0x1fa4c7[_0xe2fe('0x2e')](0xcc)[_0xe2fe('0x2f')]();});}};}function handleEntityNotFound(_0x33a26e,_0x280099){return function(_0x2680bf){if(!_0x2680bf){_0x33a26e['sendStatus'](0x194);}return _0x2680bf;};}function handleError(_0x2eae5a,_0xedcff){_0xedcff=_0xedcff||0x1f4;return function(_0x55a7a3){logger[_0xe2fe('0x29')](_0x55a7a3['stack']);if(_0x55a7a3[_0xe2fe('0x3d')]){delete _0x55a7a3[_0xe2fe('0x3d')];}_0x2eae5a['status'](_0xedcff)[_0xe2fe('0x3e')](_0x55a7a3);};}exports[_0xe2fe('0x3f')]=function(_0x42c432,_0x3850d4){var _0x55ac39={'include':[{'model':db[_0xe2fe('0x40')],'as':_0xe2fe('0x41')}]},_0x534a53={},_0x78c41a={'count':0x0,'rows':[]};var _0x39a88f=db[_0xe2fe('0x42')][_0xe2fe('0x43')];_0x534a53[_0xe2fe('0x44')]=_['keys'](_0x39a88f);_0x534a53[_0xe2fe('0x45')]=_[_0xe2fe('0x46')](_0x42c432[_0xe2fe('0x45')]);_0x534a53['filters']=_[_0xe2fe('0x47')](_0x534a53[_0xe2fe('0x44')],_0x534a53[_0xe2fe('0x45')]);_0x55ac39['attributes']=_[_0xe2fe('0x47')](_0x534a53['model'],qs[_0xe2fe('0x48')](_0x42c432['query'][_0xe2fe('0x48')]));_0x55ac39['attributes']=_0x55ac39[_0xe2fe('0x49')][_0xe2fe('0x4a')]?_0x55ac39[_0xe2fe('0x49')]:_0x534a53['model'];if(!_0x42c432[_0xe2fe('0x45')][_0xe2fe('0x4b')]('nolimit')){_0x55ac39['limit']=qs['limit'](_0x42c432['query'][_0xe2fe('0x32')]);_0x55ac39['offset']=qs[_0xe2fe('0x31')](_0x42c432[_0xe2fe('0x45')][_0xe2fe('0x31')]);}_0x55ac39[_0xe2fe('0x4c')]=qs[_0xe2fe('0x4d')](_0x42c432[_0xe2fe('0x45')]['sort']);_0x55ac39['where']=qs[_0xe2fe('0x4e')](_[_0xe2fe('0x4f')](_0x42c432[_0xe2fe('0x45')],_0x534a53[_0xe2fe('0x4e')]));if(_0x42c432['query'][_0xe2fe('0x50')]){_0x55ac39['where']=_[_0xe2fe('0x51')](_0x55ac39[_0xe2fe('0x52')],{'$or':_['map'](_0x39a88f,function(_0x378a5e){if(_0x378a5e[_0xe2fe('0x53')]['key']!==_0xe2fe('0x54')){var _0x3a6df9={};_0x3a6df9[_0x378a5e['field']]={'$like':'%'+_0x42c432['query'][_0xe2fe('0x50')]+'%'};return _0x3a6df9;}})});}_0x55ac39=_[_0xe2fe('0x51')]({},_0x55ac39,_0x42c432[_0xe2fe('0x55')]);var _0x3d4287={'where':_0x55ac39[_0xe2fe('0x52')]};return db[_0xe2fe('0x42')][_0xe2fe('0x30')](_0x3d4287)[_0xe2fe('0x23')](function(_0x4e3a07){_0x78c41a[_0xe2fe('0x30')]=_0x4e3a07;if(_0x42c432[_0xe2fe('0x45')][_0xe2fe('0x56')]){_0x55ac39['include']=[{'all':!![]}];}return db[_0xe2fe('0x42')][_0xe2fe('0x57')](_0x55ac39);})['then'](function(_0x2e9288){_0x78c41a['rows']=_0x2e9288;return _0x78c41a;})[_0xe2fe('0x23')](respondWithFilteredResult(_0x3850d4,_0x55ac39))['catch'](handleError(_0x3850d4,null));};exports[_0xe2fe('0x58')]=function(_0x1375e4,_0x251ae4){var _0x29aa99={'raw':![],'where':{'id':_0x1375e4[_0xe2fe('0x59')]['id']},'include':[{'model':db[_0xe2fe('0x40')],'as':_0xe2fe('0x41')}]},_0x2f2cf8={};_0x2f2cf8[_0xe2fe('0x44')]=_['keys'](db['OpenchannelAccount'][_0xe2fe('0x43')]);_0x2f2cf8[_0xe2fe('0x45')]=_[_0xe2fe('0x46')](_0x1375e4[_0xe2fe('0x45')]);_0x2f2cf8['filters']=_[_0xe2fe('0x47')](_0x2f2cf8[_0xe2fe('0x44')],_0x2f2cf8[_0xe2fe('0x45')]);_0x29aa99[_0xe2fe('0x49')]=_[_0xe2fe('0x47')](_0x2f2cf8[_0xe2fe('0x44')],qs[_0xe2fe('0x48')](_0x1375e4[_0xe2fe('0x45')][_0xe2fe('0x48')]));_0x29aa99[_0xe2fe('0x49')]=_0x29aa99[_0xe2fe('0x49')][_0xe2fe('0x4a')]?_0x29aa99[_0xe2fe('0x49')]:_0x2f2cf8[_0xe2fe('0x44')];if(_0x1375e4[_0xe2fe('0x45')]['includeAll']){_0x29aa99['include']=[{'all':!![]}];}_0x29aa99=_[_0xe2fe('0x51')]({},_0x29aa99,_0x1375e4[_0xe2fe('0x55')]);return db[_0xe2fe('0x42')][_0xe2fe('0x5a')](_0x29aa99)[_0xe2fe('0x23')](handleEntityNotFound(_0x251ae4,null))['then'](respondWithResult(_0x251ae4,null))[_0xe2fe('0x5b')](handleError(_0x251ae4,null));};exports[_0xe2fe('0x5c')]=function(_0x3a8945,_0x5991e3){return db[_0xe2fe('0x42')]['create'](_0x3a8945['body'],{})[_0xe2fe('0x23')](function(_0x1075c9){var _0x3a748b=_0x3a8945[_0xe2fe('0x5d')][_0xe2fe('0x39')]({'plain':!![]});if(!_0x3a748b)throw new Error(_0xe2fe('0x5e'));if(_0x3a748b['role']===_0xe2fe('0x5d')){var _0x1af4c4=_0x1075c9[_0xe2fe('0x39')]({'plain':!![]});var _0x2a99fd=_0xe2fe('0x3a');return db[_0xe2fe('0x5f')][_0xe2fe('0x5a')]({'where':{'name':_0x2a99fd,'userProfileId':_0x3a748b['userProfileId']},'raw':!![]})['then'](function(_0x188b97){if(_0x188b97&&_0x188b97[_0xe2fe('0x60')]===0x0){return db[_0xe2fe('0x3b')][_0xe2fe('0x5c')]({'name':_0x1af4c4['name'],'resourceId':_0x1af4c4['id'],'type':_0x188b97['name'],'sectionId':_0x188b97['id']},{})[_0xe2fe('0x23')](function(){return _0x1075c9;});}else{return _0x1075c9;}})[_0xe2fe('0x5b')](function(_0x114b29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x114b29);throw _0x114b29;});}return _0x1075c9;})[_0xe2fe('0x23')](respondWithResult(_0x5991e3,0xc9))[_0xe2fe('0x5b')](handleError(_0x5991e3,null));};exports[_0xe2fe('0x38')]=function(_0x58caec,_0x40c32a){if(_0x58caec['body']['id']){delete _0x58caec[_0xe2fe('0x61')]['id'];}return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x58caec[_0xe2fe('0x59')]['id']},'include':[{'model':db[_0xe2fe('0x40')],'as':_0xe2fe('0x41')}]})['then'](handleEntityNotFound(_0x40c32a,null))[_0xe2fe('0x23')](saveUpdates(_0x58caec['body'],null))[_0xe2fe('0x23')](respondWithResult(_0x40c32a,null))[_0xe2fe('0x5b')](handleError(_0x40c32a,null));};exports[_0xe2fe('0x3c')]=function(_0x1b7f9e,_0x392751){return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x1b7f9e[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x392751,null))[_0xe2fe('0x23')](removeEntity(_0x392751,null))[_0xe2fe('0x5b')](handleError(_0x392751,null));};exports[_0xe2fe('0x62')]=function(_0x4604b3,_0x2869b8){return db[_0xe2fe('0x42')][_0xe2fe('0x62')]()['then'](respondWithResult(_0x2869b8,null))[_0xe2fe('0x5b')](handleError(_0x2869b8,null));};exports['addDisposition']=function(_0x7920d2,_0x49cc23,_0x368360){if(_0x7920d2[_0xe2fe('0x61')]['id']){delete _0x7920d2[_0xe2fe('0x61')]['id'];}return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x7920d2[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x49cc23,null))['then'](function(_0x50d940){if(_0x50d940){_0x7920d2[_0xe2fe('0x61')][_0xe2fe('0x63')]=_0x50d940['id'];return db['Disposition'][_0xe2fe('0x5c')](_0x7920d2[_0xe2fe('0x61')]);}})[_0xe2fe('0x23')](respondWithResult(_0x49cc23,null))['catch'](handleError(_0x49cc23,null));};exports[_0xe2fe('0x64')]=function(_0xd71bc0,_0xcaf255,_0x146bae){var _0x586ec3={'raw':![],'where':{}};var _0x4121c0={};var _0x4c9ebb={'count':0x0,'rows':[]};return db[_0xe2fe('0x42')]['findOne']({'where':{'id':_0xd71bc0[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0xcaf255,null))[_0xe2fe('0x23')](function(_0x164372){if(_0x164372){_0x4121c0[_0xe2fe('0x44')]=_[_0xe2fe('0x46')](db[_0xe2fe('0x65')][_0xe2fe('0x43')]);_0x4121c0[_0xe2fe('0x45')]=_['keys'](_0xd71bc0['query']);_0x4121c0[_0xe2fe('0x4e')]=_[_0xe2fe('0x47')](_0x4121c0[_0xe2fe('0x44')],_0x4121c0[_0xe2fe('0x45')]);_0x586ec3[_0xe2fe('0x49')]=_[_0xe2fe('0x47')](_0x4121c0['model'],qs['fields'](_0xd71bc0[_0xe2fe('0x45')][_0xe2fe('0x48')]));_0x586ec3[_0xe2fe('0x49')]=_0x586ec3[_0xe2fe('0x49')][_0xe2fe('0x4a')]?_0x586ec3[_0xe2fe('0x49')]:_0x4121c0[_0xe2fe('0x44')];if(!_0xd71bc0[_0xe2fe('0x45')][_0xe2fe('0x4b')](_0xe2fe('0x66'))){_0x586ec3[_0xe2fe('0x32')]=qs['limit'](_0xd71bc0['query'][_0xe2fe('0x32')]);_0x586ec3[_0xe2fe('0x31')]=qs[_0xe2fe('0x31')](_0xd71bc0[_0xe2fe('0x45')]['offset']);}_0x586ec3[_0xe2fe('0x4c')]=qs[_0xe2fe('0x4d')](_0xd71bc0['query'][_0xe2fe('0x4d')]);_0x586ec3[_0xe2fe('0x52')]=qs[_0xe2fe('0x4e')](_[_0xe2fe('0x4f')](_0xd71bc0['query'],_0x4121c0[_0xe2fe('0x4e')]));_0x586ec3[_0xe2fe('0x52')][_0xe2fe('0x67')]=_0x164372['id'];if(_0xd71bc0[_0xe2fe('0x45')]['filter']){_0x586ec3['where']=_[_0xe2fe('0x51')](_0x586ec3[_0xe2fe('0x52')],{'$or':_[_0xe2fe('0x68')](_0x586ec3[_0xe2fe('0x49')],function(_0x316a9f){var _0x4b0f87={};_0x4b0f87[_0x316a9f]={'$like':'%'+_0xd71bc0[_0xe2fe('0x45')][_0xe2fe('0x50')]+'%'};return _0x4b0f87;})});}_0x586ec3=_[_0xe2fe('0x51')]({},_0x586ec3,_0xd71bc0[_0xe2fe('0x55')]);return db[_0xe2fe('0x65')][_0xe2fe('0x30')]({'where':_0x586ec3[_0xe2fe('0x52')]})[_0xe2fe('0x23')](function(_0x39c5d7){_0x4c9ebb[_0xe2fe('0x30')]=_0x39c5d7;if(_0xd71bc0['query'][_0xe2fe('0x56')]){_0x586ec3[_0xe2fe('0x69')]=[{'all':!![]}];}return db[_0xe2fe('0x65')][_0xe2fe('0x57')](_0x586ec3);})['then'](function(_0x1a3320){_0x4c9ebb[_0xe2fe('0x6a')]=_0x1a3320;return _0x4c9ebb;});}})[_0xe2fe('0x23')](respondWithFilteredResult(_0xcaf255,_0x586ec3))[_0xe2fe('0x5b')](handleError(_0xcaf255,null));};exports[_0xe2fe('0x6b')]=function(_0x43af25,_0x496acc,_0x32a76c){return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x43af25[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x496acc,null))['then'](function(_0xe99a7a){if(_0xe99a7a){return _0xe99a7a['removeDispositions'](_0x43af25[_0xe2fe('0x45')][_0xe2fe('0x6c')]);}})[_0xe2fe('0x23')](respondWithStatusCode(_0x496acc,null))[_0xe2fe('0x5b')](handleError(_0x496acc,null));};exports[_0xe2fe('0x6d')]=function(_0xde91de,_0x50a55d,_0x2bbe46){if(_0xde91de[_0xe2fe('0x61')]['id']){delete _0xde91de[_0xe2fe('0x61')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0xde91de[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x50a55d,null))[_0xe2fe('0x23')](function(_0x2de24e){if(_0x2de24e){_0xde91de[_0xe2fe('0x61')][_0xe2fe('0x67')]=_0x2de24e['id'];return db[_0xe2fe('0x6e')][_0xe2fe('0x5c')](_0xde91de[_0xe2fe('0x61')]);}})['then'](respondWithResult(_0x50a55d,null))['catch'](handleError(_0x50a55d,null));};exports[_0xe2fe('0x6f')]=function(_0x3b7e0b,_0x19e351,_0x2b7d8c){var _0x28ca9f={'raw':![],'where':{}};var _0x581c0b={};var _0x444302={'count':0x0,'rows':[]};return db[_0xe2fe('0x42')]['findOne']({'where':{'id':_0x3b7e0b[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x19e351,null))[_0xe2fe('0x23')](function(_0x445a68){if(_0x445a68){_0x581c0b[_0xe2fe('0x44')]=_[_0xe2fe('0x46')](db['CannedAnswer']['rawAttributes']);_0x581c0b[_0xe2fe('0x45')]=_[_0xe2fe('0x46')](_0x3b7e0b['query']);_0x581c0b[_0xe2fe('0x4e')]=_['intersection'](_0x581c0b[_0xe2fe('0x44')],_0x581c0b['query']);_0x28ca9f['attributes']=_[_0xe2fe('0x47')](_0x581c0b[_0xe2fe('0x44')],qs[_0xe2fe('0x48')](_0x3b7e0b[_0xe2fe('0x45')][_0xe2fe('0x48')]));_0x28ca9f['attributes']=_0x28ca9f[_0xe2fe('0x49')][_0xe2fe('0x4a')]?_0x28ca9f[_0xe2fe('0x49')]:_0x581c0b['model'];if(!_0x3b7e0b[_0xe2fe('0x45')][_0xe2fe('0x4b')](_0xe2fe('0x66'))){_0x28ca9f[_0xe2fe('0x32')]=qs[_0xe2fe('0x32')](_0x3b7e0b[_0xe2fe('0x45')][_0xe2fe('0x32')]);_0x28ca9f['offset']=qs[_0xe2fe('0x31')](_0x3b7e0b[_0xe2fe('0x45')]['offset']);}_0x28ca9f[_0xe2fe('0x4c')]=qs[_0xe2fe('0x4d')](_0x3b7e0b[_0xe2fe('0x45')][_0xe2fe('0x4d')]);_0x28ca9f[_0xe2fe('0x52')]=qs['filters'](_['pick'](_0x3b7e0b[_0xe2fe('0x45')],_0x581c0b['filters']));_0x28ca9f[_0xe2fe('0x52')][_0xe2fe('0x67')]=_0x445a68['id'];if(_0x3b7e0b[_0xe2fe('0x45')][_0xe2fe('0x50')]){_0x28ca9f[_0xe2fe('0x52')]=_[_0xe2fe('0x51')](_0x28ca9f['where'],{'$or':_[_0xe2fe('0x68')](_0x28ca9f[_0xe2fe('0x49')],function(_0x25aa53){var _0x149cd1={};_0x149cd1[_0x25aa53]={'$like':'%'+_0x3b7e0b[_0xe2fe('0x45')]['filter']+'%'};return _0x149cd1;})});}_0x28ca9f=_[_0xe2fe('0x51')]({},_0x28ca9f,_0x3b7e0b['options']);return db[_0xe2fe('0x6e')]['count']({'where':_0x28ca9f[_0xe2fe('0x52')]})[_0xe2fe('0x23')](function(_0x41f3da){_0x444302['count']=_0x41f3da;if(_0x3b7e0b[_0xe2fe('0x45')]['includeAll']){_0x28ca9f[_0xe2fe('0x69')]=[{'all':!![]}];}return db[_0xe2fe('0x6e')]['findAll'](_0x28ca9f);})[_0xe2fe('0x23')](function(_0xf0ff95){_0x444302[_0xe2fe('0x6a')]=_0xf0ff95;return _0x444302;});}})['then'](respondWithFilteredResult(_0x19e351,_0x28ca9f))[_0xe2fe('0x5b')](handleError(_0x19e351,null));};exports['removeAnswers']=function(_0x4a97ad,_0x6c48d,_0x287665){return db['OpenchannelAccount'][_0xe2fe('0x5a')]({'where':{'id':_0x4a97ad[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x6c48d,null))[_0xe2fe('0x23')](function(_0x54aebd){if(_0x54aebd){return _0x54aebd[_0xe2fe('0x70')](_0x4a97ad[_0xe2fe('0x45')][_0xe2fe('0x6c')]);}})['then'](respondWithStatusCode(_0x6c48d,null))[_0xe2fe('0x5b')](handleError(_0x6c48d,null));};exports[_0xe2fe('0x71')]=function(_0x21f07e,_0x5be0a5,_0x75de0a){var _0x2dc670={'body':_0x21f07e[_0xe2fe('0x61')],'channel':'openchannel'};var _0x1c30df=[];var _0x14456d=[];var _0xabf8f6={};var _0x250622=![];return db[_0xe2fe('0x72')][_0xe2fe('0x62')]()[_0xe2fe('0x23')](function(_0x470ad5){if(!_0x470ad5){throw new db[(_0xe2fe('0x73'))][(_0xe2fe('0x74'))](_0xe2fe('0x75'));}_0x1c30df=_['difference'](_[_0xe2fe('0x46')](_0x470ad5),['createdAt','updatedAt']);_0x14456d=_[_0xe2fe('0x76')](_[_0xe2fe('0x46')](_0x470ad5),['createdAt',_0xe2fe('0x77'),_0xe2fe('0x78'),_0xe2fe('0x79')]);if(_0x21f07e[_0xe2fe('0x61')]['id']){delete _0x21f07e[_0xe2fe('0x61')]['id'];}if(_[_0xe2fe('0x7a')](_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x7b')])){throw new db[(_0xe2fe('0x73'))][(_0xe2fe('0x74'))](_0xe2fe('0x7c'));}if(_[_0xe2fe('0x7a')](_0x21f07e['body'][_0xe2fe('0x61')])||_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x61')]===''){throw new db['Sequelize'][(_0xe2fe('0x74'))](_0xe2fe('0x7d'));}if(_[_0xe2fe('0x7a')](_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x7e')])){throw new db[(_0xe2fe('0x73'))][(_0xe2fe('0x74'))](_0xe2fe('0x7f')+_0x14456d);}if(!_['includes'](_0x14456d,_0x21f07e['body']['mapKey'])){throw new db[(_0xe2fe('0x73'))][(_0xe2fe('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14456d);}_0xabf8f6[_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x7e')]]=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x7b')];})['then'](function(){return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x21f07e[_0xe2fe('0x59')]['id']},'include':[{'model':db[_0xe2fe('0x80')],'as':_0xe2fe('0x81'),'include':[{'model':db[_0xe2fe('0x72')],'as':'Contacts','where':_0xabf8f6,'limit':0x1,'order':[[_0xe2fe('0x77'),_0xe2fe('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':_0xe2fe('0x83')}]});})[_0xe2fe('0x23')](handleEntityNotFound(_0x5be0a5,null))['then'](function(_0x3b6e21){if(_0x3b6e21&&_0x3b6e21['List']){_0x2dc670[_0xe2fe('0x84')]=_0x3b6e21;_0x2dc670[_0xe2fe('0x85')]=_0x3b6e21[_0xe2fe('0x83')];_0x2dc670['list']=_0x3b6e21[_0xe2fe('0x81')];_0x2dc670[_0xe2fe('0x85')]=_[_0xe2fe('0x86')](_0x2dc670['applications'],[_0xe2fe('0x87')],[_0xe2fe('0x88')]);if(_0x2dc670[_0xe2fe('0x84')][_0xe2fe('0x83')]){delete _0x2dc670['account'][_0xe2fe('0x83')];}if(_0x2dc670['account'][_0xe2fe('0x81')]&&_0x2dc670['account'][_0xe2fe('0x81')][_0xe2fe('0x89')][_0xe2fe('0x4a')]){return _0x2dc670[_0xe2fe('0x84')][_0xe2fe('0x81')]['Contacts'][0x0];}var _0xbb5ea9=_[_0xe2fe('0x19')](_0x21f07e['body'],{'firstName':_0x21f07e[_0xe2fe('0x61')]['from'],'ListId':_0x3b6e21[_0xe2fe('0x79')]});_0xbb5ea9[_0x21f07e['body'][_0xe2fe('0x7e')]]=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x7b')];return db['CmContact']['create'](_0xbb5ea9,{'fields':_0x1c30df,'raw':!![]});}})[_0xe2fe('0x23')](handleEntityNotFound(_0x5be0a5,null))[_0xe2fe('0x23')](function(_0x29b7b9){_0x2dc670[_0xe2fe('0x8a')]=_0x29b7b9;if(_0x29b7b9){var _0x1004cc={'ContactId':_0x29b7b9['id'],'OpenchannelAccountId':_0x21f07e[_0xe2fe('0x59')]['id'],'from':(_0x29b7b9[_0xe2fe('0x8b')]||'')+'\x20'+(_0x29b7b9[_0xe2fe('0x8c')]||'')};var _0x326588={'OpenchannelAccountId':_0x21f07e[_0xe2fe('0x59')]['id'],'closed':![]};if(_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x8d')]){_0x326588[_0xe2fe('0x8d')]=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x8d')];return db[_0xe2fe('0x8e')]['find']({'where':_0x326588})[_0xe2fe('0x23')](function(_0x3cf1ad){if(_0x3cf1ad){return[_0x3cf1ad,![]];}_0x1004cc['threadId']=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x8d')];_0x1004cc[_0xe2fe('0x8f')]=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x8f')];return db[_0xe2fe('0x8e')][_0xe2fe('0x5c')](_0x1004cc)[_0xe2fe('0x23')](function(_0x246585){return[_0x246585,!![]];});});}else{_0x326588[_0xe2fe('0x8d')]=null;}_0x326588[_0xe2fe('0x90')]=_0x29b7b9['id'];return db[_0xe2fe('0x8e')][_0xe2fe('0x5a')]({'where':_0x326588})[_0xe2fe('0x23')](function(_0x5e83be){if(_0x5e83be){return[_0x5e83be,![]];}return db[_0xe2fe('0x8e')][_0xe2fe('0x5c')](_0x1004cc)[_0xe2fe('0x23')](function(_0x413563){return[_0x413563,!![]];});});}})[_0xe2fe('0x91')](function(_0x49a2fb,_0x500e55){if(_0x49a2fb){_0x250622=_0x500e55;if(!_0x500e55){var _0x12ca8c={'from':(_0x2dc670['contact'][_0xe2fe('0x8b')]||'')+'\x20'+(_0x2dc670['contact'][_0xe2fe('0x8c')]||'')};if(_0x21f07e[_0xe2fe('0x61')]['threadId']&&_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x92')]&&_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x8d')]!=_0x21f07e['body']['messageId']){_0x12ca8c['threadId']=_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x92')];}return _0x49a2fb[_0xe2fe('0x38')](_0x12ca8c);}else{return _0x49a2fb;}}})[_0xe2fe('0x23')](function(_0x326297){_0x2dc670[_0xe2fe('0x93')]=_0x326297[_0xe2fe('0x39')]({'plain':!![]});_0x2dc670[_0xe2fe('0x93')]['created']=_0x250622;if(_0x2dc670[_0xe2fe('0x93')][_0xe2fe('0x94')]){if(_0x2dc670[_0xe2fe('0x84')][_0xe2fe('0x95')]){_0x2dc670['applications']['push']({'id':0x0,'priority':_0x2dc670[_0xe2fe('0x85')][_0xe2fe('0x4a')]+0x1,'app':'close','appdata':_0xe2fe('0x96'),'interval':'*,*,*,*'});}}return db[_0xe2fe('0x97')][_0xe2fe('0x5c')]({'body':_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x61')],'OpenchannelAccountId':_0x21f07e[_0xe2fe('0x59')]['id'],'OpenchannelInteractionId':_0x326297['id'],'direction':'in','ContactId':_0x2dc670[_0xe2fe('0x8a')]['id'],'AttachmentId':_0x21f07e[_0xe2fe('0x61')][_0xe2fe('0x98')]});})[_0xe2fe('0x23')](function(_0x366c33){_0x2dc670[_0xe2fe('0x2b')]=_0x366c33;if(_0x2dc670['interaction']['UserId']){return db[_0xe2fe('0x99')][_0xe2fe('0x5a')]({'attributes':['id',_0xe2fe('0x3d')],'where':{'id':_0x2dc670['interaction'][_0xe2fe('0x9a')]}})[_0xe2fe('0x23')](function(_0x1f8341){if(_0x1f8341){_0x2dc670['applications'][_0xe2fe('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1f8341['name']+','+(_0x2dc670[_0xe2fe('0x84')][_0xe2fe('0x9c')]||0xa),'interval':_0xe2fe('0x9d')});_0x2dc670[_0xe2fe('0x9e')]=![];}return respondWithRpcPromise(_0xe2fe('0x9f'),_0xe2fe('0xa0'),_0x2dc670);});}return respondWithRpcPromise('Start',_0xe2fe('0xa0'),_0x2dc670);})[_0xe2fe('0x23')](function(_0x206e6d){respondWithRpcPromise('EventManager',_0xe2fe('0xa1'),{'event':_0xe2fe('0x71'),'message':_0x206e6d},client9002);return _0x206e6d;})[_0xe2fe('0x23')](respondWithResult(_0x5be0a5,null))[_0xe2fe('0x5b')](handleError(_0x5be0a5,null));};exports[_0xe2fe('0xa2')]=function(_0x571cec,_0x4250a3,_0x278a9d){return db[_0xe2fe('0x42')][_0xe2fe('0xa3')]({'where':{'id':_0x571cec[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x4250a3,null))[_0xe2fe('0x23')](function(_0x2cf2cd){if(_0x2cf2cd){return db[_0xe2fe('0xa4')][_0xe2fe('0xa5')](function(_0xbb5388){return db['OpenchannelApplication'][_0xe2fe('0x3c')]({'where':{'OpenchannelAccountId':_0x571cec[_0xe2fe('0x59')]['id']},'transaction':_0xbb5388})[_0xe2fe('0x23')](function(_0x50e555){var _0x4d2c94=_[_0xe2fe('0x68')](_0x571cec[_0xe2fe('0x61')],function(_0x132d4b){_0x132d4b[_0xe2fe('0x67')]=_0x571cec[_0xe2fe('0x59')]['id'];return _0x132d4b;});return db[_0xe2fe('0xa6')][_0xe2fe('0xa7')](_0x4d2c94,{'transaction':_0xbb5388});});})[_0xe2fe('0x23')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x571cec[_0xe2fe('0x59')]['id']},'order':_0xe2fe('0x87')});});}})[_0xe2fe('0x23')](respondWithResult(_0x4250a3,null))[_0xe2fe('0x5b')](handleError(_0x4250a3,null));};exports[_0xe2fe('0xa8')]=function(_0x2d2d8a,_0x59e7f2,_0x18e19d){var _0x436974={};var _0x190951={};var _0x5195e5;var _0x4b846e;return db['OpenchannelAccount'][_0xe2fe('0xa3')]({'where':{'id':_0x2d2d8a[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x59e7f2,null))['then'](function(_0x7a35f1){if(_0x7a35f1){_0x5195e5=_0x7a35f1;_0x190951['model']=_['keys'](db['OpenchannelApplication'][_0xe2fe('0x43')]);_0x190951[_0xe2fe('0x45')]=_[_0xe2fe('0x46')](_0x2d2d8a[_0xe2fe('0x45')]);_0x190951['filters']=_[_0xe2fe('0x47')](_0x190951['model'],_0x190951[_0xe2fe('0x45')]);_0x436974['attributes']=_[_0xe2fe('0x47')](_0x190951[_0xe2fe('0x44')],qs[_0xe2fe('0x48')](_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x48')]));_0x436974[_0xe2fe('0x49')]=_0x436974[_0xe2fe('0x49')]['length']?_0x436974[_0xe2fe('0x49')]:_0x190951[_0xe2fe('0x44')];_0x436974[_0xe2fe('0x4c')]=qs[_0xe2fe('0x4d')](_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x4d')]);_0x436974[_0xe2fe('0x52')]=qs['filters'](_[_0xe2fe('0x4f')](_0x2d2d8a[_0xe2fe('0x45')],_0x190951[_0xe2fe('0x4e')]));if(_0x2d2d8a[_0xe2fe('0x45')]['filter']){_0x436974['where']=_[_0xe2fe('0x51')](_0x436974[_0xe2fe('0x52')],{'$or':_[_0xe2fe('0x68')](_0x436974['attributes'],function(_0x133fbf){var _0x4a7dee={};_0x4a7dee[_0x133fbf]={'$like':'%'+_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x50')]+'%'};return _0x4a7dee;})});}_0x436974=_[_0xe2fe('0x51')]({},_0x436974,_0x2d2d8a['options']);return _0x5195e5[_0xe2fe('0xa8')](_0x436974);}})[_0xe2fe('0x23')](function(_0x44c234){if(_0x44c234){_0x4b846e=_0x44c234[_0xe2fe('0x4a')];if(!_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x4b')](_0xe2fe('0x66'))){_0x436974[_0xe2fe('0x32')]=qs[_0xe2fe('0x32')](_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x32')]);_0x436974['offset']=qs['offset'](_0x2d2d8a[_0xe2fe('0x45')][_0xe2fe('0x31')]);}return _0x5195e5[_0xe2fe('0xa8')](_0x436974);}})[_0xe2fe('0x23')](function(_0x4c51ec){if(_0x4c51ec){return _0x4c51ec?{'count':_0x4b846e,'rows':_0x4c51ec}:null;}})[_0xe2fe('0x23')](respondWithResult(_0x59e7f2,null))['catch'](handleError(_0x59e7f2,null));};exports[_0xe2fe('0xa9')]=function(_0x11eb0f,_0x196831,_0x370599){var _0x32ea5b={'raw':![],'where':{}};var _0x4b4e63={};var _0x45e5ce={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe2fe('0xa3')]({'where':{'id':_0x11eb0f[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x196831,null))[_0xe2fe('0x23')](function(_0x2c44dc){if(_0x2c44dc){_0x4b4e63['model']=_[_0xe2fe('0x46')](db[_0xe2fe('0x8e')]['rawAttributes']);_0x4b4e63['query']=_['keys'](_0x11eb0f[_0xe2fe('0x45')]);_0x4b4e63[_0xe2fe('0x4e')]=_[_0xe2fe('0x47')](_0x4b4e63[_0xe2fe('0x44')],_0x4b4e63[_0xe2fe('0x45')]);_0x32ea5b[_0xe2fe('0x49')]=_[_0xe2fe('0x47')](_0x4b4e63[_0xe2fe('0x44')],qs['fields'](_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x48')]));_0x32ea5b[_0xe2fe('0x49')]=_0x32ea5b[_0xe2fe('0x49')][_0xe2fe('0x4a')]?_0x32ea5b[_0xe2fe('0x49')]:_0x4b4e63[_0xe2fe('0x44')];if(!_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x4b')]('nolimit')){_0x32ea5b[_0xe2fe('0x32')]=qs[_0xe2fe('0x32')](_0x11eb0f[_0xe2fe('0x45')]['limit']);_0x32ea5b[_0xe2fe('0x31')]=qs[_0xe2fe('0x31')](_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x31')]);}_0x32ea5b[_0xe2fe('0x4c')]=qs[_0xe2fe('0x4d')](_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x4d')]);_0x32ea5b['where']=qs['filters'](_['pick'](_0x11eb0f[_0xe2fe('0x45')],_0x4b4e63[_0xe2fe('0x4e')]));_0x32ea5b[_0xe2fe('0x52')][_0xe2fe('0x67')]=_0x2c44dc['id'];if(_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x50')]){_0x32ea5b[_0xe2fe('0x52')]=_[_0xe2fe('0x51')](_0x32ea5b[_0xe2fe('0x52')],{'$or':_[_0xe2fe('0x68')](_0x32ea5b[_0xe2fe('0x49')],function(_0x36df00){var _0x3bb021={};_0x3bb021[_0x36df00]={'$like':'%'+_0x11eb0f[_0xe2fe('0x45')]['filter']+'%'};return _0x3bb021;})});}_0x32ea5b=_[_0xe2fe('0x51')]({},_0x32ea5b,_0x11eb0f['options']);return db[_0xe2fe('0x8e')]['count']({'where':_0x32ea5b[_0xe2fe('0x52')]})[_0xe2fe('0x23')](function(_0x1d75cc){_0x45e5ce[_0xe2fe('0x30')]=_0x1d75cc;if(_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0x56')]){_0x32ea5b[_0xe2fe('0x69')]=[{'model':db['CmContact'],'as':_0xe2fe('0xaa'),'required':![]},{'model':db[_0xe2fe('0x99')],'as':'Owner','attributes':[_0xe2fe('0x3d'),'fullname',_0xe2fe('0xab')],'required':![]},{'model':db[_0xe2fe('0xac')],'as':_0xe2fe('0xad'),'attributes':['id',_0xe2fe('0x3d'),_0xe2fe('0xae')],'where':_0x11eb0f['query'][_0xe2fe('0xaf')]?{'id':_0x11eb0f['query'][_0xe2fe('0xaf')]}:undefined,'required':_0x11eb0f[_0xe2fe('0x45')][_0xe2fe('0xaf')]?!![]:![]}];}return db[_0xe2fe('0x8e')][_0xe2fe('0x57')](_0x32ea5b);})['then'](function(_0x1a7ea6){_0x45e5ce[_0xe2fe('0x6a')]=_0x1a7ea6;return _0x45e5ce;});}})[_0xe2fe('0x23')](respondWithFilteredResult(_0x196831,_0x32ea5b))[_0xe2fe('0x5b')](handleError(_0x196831,null));};exports['addAgents']=function(_0x5977de,_0x4d9704,_0x410688){return db[_0xe2fe('0x42')][_0xe2fe('0x5a')]({'where':{'id':_0x5977de[_0xe2fe('0x59')]['id']}})['then'](handleEntityNotFound(_0x4d9704,null))['then'](function(_0x2ee1d0){if(_0x2ee1d0){return _0x2ee1d0[_0xe2fe('0xb0')](_0x5977de['body'][_0xe2fe('0x6c')],_[_0xe2fe('0xb1')](_0x5977de[_0xe2fe('0x61')],[_0xe2fe('0x6c'),'id'])||{})[_0xe2fe('0x91')](function(_0xcb4f00){for(var _0xb46529=0x0;_0xb46529<_0x5977de['body'][_0xe2fe('0x6c')][_0xe2fe('0x4a')];_0xb46529+=0x1){socket[_0xe2fe('0xb2')](_0xe2fe('0xb3'),{'UserId':_0x5977de[_0xe2fe('0x61')]['ids'][_0xb46529],'OpenchannelAccountId':_0x5977de[_0xe2fe('0x59')]['id']});}return _0xcb4f00;});}})['then'](respondWithResult(_0x4d9704,null))['catch'](handleError(_0x4d9704,null));};exports[_0xe2fe('0xb4')]=function(_0x4bb744,_0x55ea0f,_0x1a8de4){return db['OpenchannelAccount'][_0xe2fe('0x5a')]({'where':{'id':_0x4bb744['params']['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x55ea0f,null))[_0xe2fe('0x23')](function(_0x4da7a7){if(_0x4da7a7){return _0x4da7a7['removeAgents'](_0x4bb744['query']['ids'])[_0xe2fe('0x23')](function(){if(_[_0xe2fe('0xb5')](_0x4bb744[_0xe2fe('0x45')][_0xe2fe('0x6c')])){for(var _0x277bdf=0x0;_0x277bdf<_0x4bb744[_0xe2fe('0x45')]['ids'][_0xe2fe('0x4a')];_0x277bdf+=0x1){socket[_0xe2fe('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4bb744[_0xe2fe('0x45')]['ids'][_0x277bdf]),'OpenchannelAccountId':Number(_0x4bb744[_0xe2fe('0x59')]['id'])});}}else{socket['emit'](_0xe2fe('0xb6'),{'UserId':Number(_0x4bb744[_0xe2fe('0x45')]['ids']),'OpenchannelAccountId':Number(_0x4bb744[_0xe2fe('0x59')]['id'])});}});}})[_0xe2fe('0x23')](respondWithStatusCode(_0x55ea0f,null))[_0xe2fe('0x5b')](handleError(_0x55ea0f,null));};exports[_0xe2fe('0xb7')]=function(_0x53c986,_0x510e03,_0x4829dd){var _0x3a5cc6={};var _0x81bcc0={};var _0x3a8c00;var _0x285eb7;return db[_0xe2fe('0x42')][_0xe2fe('0xa3')]({'where':{'id':_0x53c986['params']['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x510e03,null))[_0xe2fe('0x23')](function(_0x394b74){if(_0x394b74){_0x3a8c00=_0x394b74;_0x81bcc0[_0xe2fe('0x44')]=_['keys'](db[_0xe2fe('0x99')][_0xe2fe('0x43')]);_0x81bcc0[_0xe2fe('0x45')]=_[_0xe2fe('0x46')](_0x53c986[_0xe2fe('0x45')]);_0x81bcc0[_0xe2fe('0x4e')]=_[_0xe2fe('0x47')](_0x81bcc0[_0xe2fe('0x44')],_0x81bcc0[_0xe2fe('0x45')]);_0x3a5cc6['attributes']=_['intersection'](_0x81bcc0['model'],qs[_0xe2fe('0x48')](_0x53c986[_0xe2fe('0x45')]['fields']));_0x3a5cc6[_0xe2fe('0x49')]=_0x3a5cc6['attributes']['length']?_0x3a5cc6[_0xe2fe('0x49')]:_0x81bcc0['model'];_0x3a5cc6['order']=qs[_0xe2fe('0x4d')](_0x53c986['query'][_0xe2fe('0x4d')]);_0x3a5cc6[_0xe2fe('0x52')]=qs['filters'](_['pick'](_0x53c986[_0xe2fe('0x45')],_0x81bcc0[_0xe2fe('0x4e')]));if(_0x53c986['query'][_0xe2fe('0x50')]){_0x3a5cc6[_0xe2fe('0x52')]=_['merge'](_0x3a5cc6[_0xe2fe('0x52')],{'$or':_[_0xe2fe('0x68')](_0x3a5cc6[_0xe2fe('0x49')],function(_0x4fe3ff){var _0xdb2b52={};_0xdb2b52[_0x4fe3ff]={'$like':'%'+_0x53c986['query'][_0xe2fe('0x50')]+'%'};return _0xdb2b52;})});}_0x3a5cc6=_[_0xe2fe('0x51')]({},_0x3a5cc6,_0x53c986[_0xe2fe('0x55')]);return _0x3a8c00['getAgents'](_0x3a5cc6);}})[_0xe2fe('0x23')](function(_0xe1dbb){if(_0xe1dbb){_0x285eb7=_0xe1dbb['length'];if(!_0x53c986['query'][_0xe2fe('0x4b')](_0xe2fe('0x66'))){_0x3a5cc6[_0xe2fe('0x32')]=qs['limit'](_0x53c986['query'][_0xe2fe('0x32')]);_0x3a5cc6[_0xe2fe('0x31')]=qs[_0xe2fe('0x31')](_0x53c986[_0xe2fe('0x45')][_0xe2fe('0x31')]);}return _0x3a8c00[_0xe2fe('0xb7')](_0x3a5cc6);}})[_0xe2fe('0x23')](function(_0x1ad671){if(_0x1ad671){return _0x1ad671?{'count':_0x285eb7,'rows':_0x1ad671}:null;}})[_0xe2fe('0x23')](respondWithResult(_0x510e03,null))[_0xe2fe('0x5b')](handleError(_0x510e03,null));};exports[_0xe2fe('0x3e')]=function(_0x4db246,_0x2e3196,_0xf2c474){var _0x2c99c3,_0x5a3526,_0x419b72;if(_[_0xe2fe('0x7a')](_0x4db246[_0xe2fe('0x61')][_0xe2fe('0x61')])||_0x4db246[_0xe2fe('0x61')][_0xe2fe('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0xe2fe('0x7d'));}if(_[_0xe2fe('0x7a')](_0x4db246['body']['to'])){}_0x2c99c3=_0x4db246[_0xe2fe('0x61')]['to'];return db['OpenchannelAccount'][_0xe2fe('0xa3')]({'where':{'id':_0x4db246[_0xe2fe('0x59')]['id']}})[_0xe2fe('0x23')](handleEntityNotFound(_0x2e3196,null))[_0xe2fe('0x23')](function(_0x1cc750){if(_0x1cc750){return db['OpenchannelAccount'][_0xe2fe('0x5a')]({'where':{'id':_0x1cc750['id']},'include':[{'model':db[_0xe2fe('0x80')],'as':'List','include':[{'model':db[_0xe2fe('0x72')],'as':_0xe2fe('0x89'),'where':{[_0x1cc750[_0xe2fe('0x7e')]]:_0x2c99c3},'limit':0x1,'order':[[_0xe2fe('0x77'),_0xe2fe('0x82')]]}]}]})[_0xe2fe('0x23')](handleEntityNotFound(_0x2e3196,null))['then'](function(_0x135a2e){if(_0x135a2e&&_0x135a2e[_0xe2fe('0x81')]){_0x5a3526=_0x135a2e[_0xe2fe('0x39')]({'plain':!![]});if(_0x5a3526[_0xe2fe('0x81')]&&_0x5a3526[_0xe2fe('0x81')][_0xe2fe('0x89')][_0xe2fe('0x4a')]){return _0x5a3526[_0xe2fe('0x81')]['Contacts'][0x0];}return db['CmContact'][_0xe2fe('0x5c')](_[_0xe2fe('0x19')](_0x4db246[_0xe2fe('0x61')],{'firstName':_0x2c99c3,[_0x135a2e['mapKey']]:_0x2c99c3,'phone':_0x2c99c3,'ListId':_0x5a3526[_0xe2fe('0x79')]}));}})[_0xe2fe('0x23')](handleEntityNotFound(_0x2e3196,null))[_0xe2fe('0x23')](function(_0x4ecbbf){if(_0x4ecbbf){_0x419b72=_0x4ecbbf;return db['OpenchannelInteraction'][_0xe2fe('0x5a')]({'where':{'ContactId':_0x419b72['id'],'closed':![],'OpenchannelAccountId':_0x5a3526['id']}})[_0xe2fe('0x23')](function(_0x46b792){if(_0x46b792){return[_0x46b792,![]];}return db['OpenchannelInteraction'][_0xe2fe('0x5c')]({'UserId':_0x4db246[_0xe2fe('0x5d')]['id'],'ContactId':_0x419b72['id'],'OpenchannelAccountId':_0x5a3526['id'],'lastMsgDirection':_0xe2fe('0xb8'),'Messages':[_[_0xe2fe('0x51')](_0x4db246[_0xe2fe('0x61')],{'read':![],'body':_0x4db246['body'][_0xe2fe('0x61')],'OpenchannelAccountId':_0x5a3526['id'],'UserId':_0x4db246['user']['id'],'ContactId':_0x419b72['id']})]},{'include':[{'model':db[_0xe2fe('0x97')],'as':'Messages'}]})[_0xe2fe('0x23')](function(_0x303bd5){return[_0x303bd5,!![]];});});}})[_0xe2fe('0x91')](function(_0x544279,_0x431650){if(_0x431650){return _0x544279;}return db[_0xe2fe('0x97')][_0xe2fe('0x5c')](_[_0xe2fe('0x51')](_0x4db246[_0xe2fe('0x61')],{'read':![],'body':_0x4db246[_0xe2fe('0x61')][_0xe2fe('0x61')],'OpenchannelAccountId':_0x5a3526['id'],'OpenchannelInteractionId':_0x544279['id'],'UserId':_0x4db246[_0xe2fe('0x5d')]['id'],'ContactId':_0x419b72['id']}))['then'](function(_0x477183){_0x544279[_0xe2fe('0xb9')][_0xe2fe('0xba')]=[];_0x544279[_0xe2fe('0xb9')][_0xe2fe('0xba')][_0xe2fe('0xbb')](_0x477183[_0xe2fe('0xb9')]);return _0x544279;});});}})[_0xe2fe('0x23')](respondWithResult(_0x2e3196,null))[_0xe2fe('0x5b')](handleError(_0x2e3196,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3a9e596..d70c249 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 _0xb205=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x5341d2,_0x2da6d6){var _0x3a4d6a=function(_0x254688){while(--_0x254688){_0x5341d2['push'](_0x5341d2['shift']());}};_0x3a4d6a(++_0x2da6d6);}(_0xb205,0xf0));var _0x5b20=function(_0x5595c2,_0x4e6687){_0x5595c2=_0x5595c2-0x0;var _0x2e407c=_0xb205[_0x5595c2];return _0x2e407c;};'use strict';var EventEmitter=require(_0x5b20('0x0'));var OpenchannelAccount=require(_0x5b20('0x1'))['db'][_0x5b20('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5b20('0x3')](0x0);var events={'afterCreate':_0x5b20('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x37fe91){return function(_0x573200,_0x17046a,_0x36473a){OpenchannelAccountEvents['emit'](_0x37fe91+':'+_0x573200['id'],_0x573200);OpenchannelAccountEvents[_0x5b20('0x5')](_0x37fe91,_0x573200);_0x36473a(null);};}for(var e in events){if(events[_0x5b20('0x6')](e)){var event=events[e];OpenchannelAccount[_0x5b20('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xfbf1=['update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners'];(function(_0x48cda1,_0x5042a2){var _0x4bcc6f=function(_0x317a02){while(--_0x317a02){_0x48cda1['push'](_0x48cda1['shift']());}};_0x4bcc6f(++_0x5042a2);}(_0xfbf1,0xa8));var _0x1fbf=function(_0x196f54,_0x8e2b6){_0x196f54=_0x196f54-0x0;var _0x203cab=_0xfbf1[_0x196f54];return _0x203cab;};'use strict';var EventEmitter=require(_0x1fbf('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x1fbf('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1fbf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fbf('0x3'),'afterDestroy':_0x1fbf('0x4')};function emitEvent(_0x1de6c5){return function(_0x312b15,_0x145461,_0x3c2230){OpenchannelAccountEvents[_0x1fbf('0x5')](_0x1de6c5+':'+_0x312b15['id'],_0x312b15);OpenchannelAccountEvents['emit'](_0x1de6c5,_0x312b15);_0x3c2230(null);};}for(var e in events){if(events[_0x1fbf('0x6')](e)){var event=events[e];OpenchannelAccount[_0x1fbf('0x7')](e,emitEvent(event));}}module[_0x1fbf('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index e6792fe..f29e085 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 _0x31f5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','define','openchannel_accounts'];(function(_0x1493ed,_0x52a9ab){var _0x532033=function(_0x52771c){while(--_0x52771c){_0x1493ed['push'](_0x1493ed['shift']());}};_0x532033(++_0x52a9ab);}(_0x31f5,0x1a4));var _0x531f=function(_0x1aa3ca,_0x41c611){_0x1aa3ca=_0x1aa3ca-0x0;var _0x5bf25e=_0x31f5[_0x1aa3ca];return _0x5bf25e;};'use strict';var _=require('lodash');var util=require(_0x531f('0x0'));var logger=require(_0x531f('0x1'))(_0x531f('0x2'));var moment=require(_0x531f('0x3'));var BPromise=require(_0x531f('0x4'));var rp=require(_0x531f('0x5'));var fs=require('fs');var path=require(_0x531f('0x6'));var rimraf=require(_0x531f('0x7'));var config=require(_0x531f('0x8'));var attributes=require(_0x531f('0x9'));module['exports']=function(_0x1a087c,_0x1d82f0){return _0x1a087c[_0x531f('0xa')]('OpenchannelAccount',attributes,{'tableName':_0x531f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x747f=['exports','openchannel_accounts','lodash','util','moment','bluebird','path','./openchannelAccount.attributes'];(function(_0x23bbce,_0x215199){var _0xf1846f=function(_0x995e34){while(--_0x995e34){_0x23bbce['push'](_0x23bbce['shift']());}};_0xf1846f(++_0x215199);}(_0x747f,0x8a));var _0xf747=function(_0x321e69,_0x45d2e2){_0x321e69=_0x321e69-0x0;var _0x112e0a=_0x747f[_0x321e69];return _0x112e0a;};'use strict';var _=require(_0xf747('0x0'));var util=require(_0xf747('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf747('0x2'));var BPromise=require(_0xf747('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf747('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf747('0x5'));module[_0xf747('0x6')]=function(_0x8eba0e,_0x3d0f0b){return _0x8eba0e['define']('OpenchannelAccount',attributes,{'tableName':_0xf747('0x7'),'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 33bb85e..b5d5ded 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x2ef3,0xba));var _0x32ef=function(_0x258457,_0x45f411){_0x258457=_0x258457-0x0;var _0x462b52=_0x2ef3[_0x258457];return _0x462b52;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x47c1c8,_0x2b7413){var _0x2e2177=function(_0xa6ae89){while(--_0xa6ae89){_0x47c1c8['push'](_0x47c1c8['shift']());}};_0x2e2177(++_0x2b7413);}(_0x814b,0x1a2));var _0xb814=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x814b[_0x115d5b];return _0x6cfc50;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3d7f374..368fb9c 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 _0x2608=['./openchannelAccount.events','save','update'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x2608,0x1c8));var _0x8260=function(_0x4f9628,_0x4dede5){_0x4f9628=_0x4f9628-0x0;var _0x21b6a7=_0x2608[_0x4f9628];return _0x21b6a7;};'use strict';var OpenchannelAccountEvents=require(_0x8260('0x0'));var events=[_0x8260('0x1'),'remove',_0x8260('0x2')];function createListener(_0x4da490,_0x3dda40){return function(_0x2c08ea){_0x3dda40['emit'](_0x4da490,_0x2c08ea);};}function removeListener(_0x39b2e6,_0x42ea49){return function(){OpenchannelAccountEvents['removeListener'](_0x39b2e6,_0x42ea49);};}exports['register']=function(_0x1e30f6){for(var _0x200e18=0x0,_0xb721e7=events['length'];_0x200e18<_0xb721e7;_0x200e18++){var _0x3e59cf=events[_0x200e18];var _0x228211=createListener('openchannelAccount:'+_0x3e59cf,_0x1e30f6);OpenchannelAccountEvents['on'](_0x3e59cf,_0x228211);}}; \ No newline at end of file +var _0x63b1=['openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x63b1,0x193));var _0x163b=function(_0x1706cd,_0x3aaf96){_0x1706cd=_0x1706cd-0x0;var _0x191f86=_0x63b1[_0x1706cd];return _0x191f86;};'use strict';var OpenchannelAccountEvents=require(_0x163b('0x0'));var events=[_0x163b('0x1'),'remove',_0x163b('0x2')];function createListener(_0x4c36ba,_0x1e57a3){return function(_0xa5d1e){_0x1e57a3[_0x163b('0x3')](_0x4c36ba,_0xa5d1e);};}function removeListener(_0x497080,_0x44042f){return function(){OpenchannelAccountEvents[_0x163b('0x4')](_0x497080,_0x44042f);};}exports['register']=function(_0x3e54c2){for(var _0x3443a1=0x0,_0x192de5=events['length'];_0x3443a1<_0x192de5;_0x3443a1++){var _0xcce260=events[_0x3443a1];var _0x58480b=createListener(_0x163b('0x5')+_0xcce260,_0x3e54c2);OpenchannelAccountEvents['on'](_0xcce260,_0x58480b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index f47f1ea..be21e26 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 _0x7a79=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x31210e,_0x1785ff){var _0x2167db=function(_0x11470f){while(--_0x11470f){_0x31210e['push'](_0x31210e['shift']());}};_0x2167db(++_0x1785ff);}(_0x7a79,0x153));var _0x97a7=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x7a79[_0x16dbcd];return _0x34706e;};'use strict';var multer=require(_0x97a7('0x0'));var util=require(_0x97a7('0x1'));var path=require(_0x97a7('0x2'));var timeout=require(_0x97a7('0x3'));var express=require(_0x97a7('0x4'));var router=express[_0x97a7('0x5')]();var auth=require(_0x97a7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x97a7('0x7'));var controller=require(_0x97a7('0x8'));router[_0x97a7('0x9')]('/',auth[_0x97a7('0xa')](),controller['index']);router[_0x97a7('0x9')](_0x97a7('0xb'),auth['isAuthenticated'](),controller[_0x97a7('0xc')]);router[_0x97a7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x97a7('0xe')](_0x97a7('0xb'),auth['isAuthenticated'](),controller[_0x97a7('0xf')]);router[_0x97a7('0x10')](_0x97a7('0xb'),auth[_0x97a7('0xa')](),controller[_0x97a7('0x11')]);module[_0x97a7('0x12')]=router; \ No newline at end of file +var _0x2501=['show','post','create','put','update','delete','destroy','exports','connect-timeout','express','../../components/auth/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x36bfdd,_0x425a87){var _0x2f60c0=function(_0x384135){while(--_0x384135){_0x36bfdd['push'](_0x36bfdd['shift']());}};_0x2f60c0(++_0x425a87);}(_0x2501,0x68));var _0x1250=function(_0x3276e7,_0x349cb8){_0x3276e7=_0x3276e7-0x0;var _0x536279=_0x2501[_0x3276e7];return _0x536279;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1250('0x0'));var express=require(_0x1250('0x1'));var router=express['Router']();var auth=require(_0x1250('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1250('0x3'));router[_0x1250('0x4')]('/',auth[_0x1250('0x5')](),controller[_0x1250('0x6')]);router[_0x1250('0x4')](_0x1250('0x7'),auth[_0x1250('0x5')](),controller[_0x1250('0x8')]);router[_0x1250('0x9')]('/',auth[_0x1250('0x5')](),controller[_0x1250('0xa')]);router[_0x1250('0xb')](_0x1250('0x7'),auth[_0x1250('0x5')](),controller[_0x1250('0xc')]);router[_0x1250('0xd')](_0x1250('0x7'),auth['isAuthenticated'](),controller[_0x1250('0xe')]);module[_0x1250('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6b76fcb..c3bc035 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 _0x9fc3=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x55a787,_0x1466a3){var _0x5d90a0=function(_0x5405fb){while(--_0x5405fb){_0x55a787['push'](_0x55a787['shift']());}};_0x5d90a0(++_0x1466a3);}(_0x9fc3,0xcb));var _0x39fc=function(_0x42cd68,_0xe46663){_0x42cd68=_0x42cd68-0x0;var _0x48bf06=_0x9fc3[_0x42cd68];return _0x48bf06;};'use strict';var Sequelize=require(_0x39fc('0x0'));module[_0x39fc('0x1')]={'priority':{'type':Sequelize[_0x39fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':_0x39fc('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x39fc('0x3')],'defaultValue':_0x39fc('0x5')}}; \ No newline at end of file +var _0xff6f=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4d7413,_0x290a4e){var _0x37370e=function(_0x21b021){while(--_0x21b021){_0x4d7413['push'](_0x4d7413['shift']());}};_0x37370e(++_0x290a4e);}(_0xff6f,0x11e));var _0xfff6=function(_0x6b1fb,_0x35f6b7){_0x6b1fb=_0x6b1fb-0x0;var _0x493db0=_0xff6f[_0x6b1fb];return _0x493db0;};'use strict';var Sequelize=require(_0xfff6('0x0'));module[_0xfff6('0x1')]={'priority':{'type':Sequelize[_0xfff6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfff6('0x3')],'allowNull':![],'defaultValue':_0xfff6('0x4')},'appdata':{'type':Sequelize[_0xfff6('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfff6('0x3')],'defaultValue':_0xfff6('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9175859..bc196cf 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x51e136,_0x263a46){var _0x41d8c8=function(_0x2c51c7){while(--_0x2c51c7){_0x51e136['push'](_0x51e136['shift']());}};_0x41d8c8(++_0x263a46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x313b01,_0x3532e5){var _0xa1a400=function(_0x27f677){while(--_0x27f677){_0x313b01['push'](_0x313b01['shift']());}};_0xa1a400(++_0x3532e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c336776..454cc39 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 _0xf875=['moment','request-promise','path','./openchannelApplication.attributes','exports','openchannel_applications','lodash','../../config/logger','api'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xf875,0x138));var _0x5f87=function(_0x249e80,_0x4334be){_0x249e80=_0x249e80-0x0;var _0x23d6ab=_0xf875[_0x249e80];return _0x23d6ab;};'use strict';var _=require(_0x5f87('0x0'));var util=require('util');var logger=require(_0x5f87('0x1'))(_0x5f87('0x2'));var moment=require(_0x5f87('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f87('0x4'));var fs=require('fs');var path=require(_0x5f87('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f87('0x6'));module[_0x5f87('0x7')]=function(_0x2753a7,_0x1ae2d8){return _0x2753a7['define']('OpenchannelApplication',attributes,{'tableName':_0x5f87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc7ad=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment'];(function(_0x225c26,_0x103c6c){var _0x15c68f=function(_0x572441){while(--_0x572441){_0x225c26['push'](_0x225c26['shift']());}};_0x15c68f(++_0x103c6c);}(_0xc7ad,0xca));var _0xdc7a=function(_0x2c1ae2,_0x53b044){_0x2c1ae2=_0x2c1ae2-0x0;var _0xd6ef93=_0xc7ad[_0x2c1ae2];return _0xd6ef93;};'use strict';var _=require(_0xdc7a('0x0'));var util=require(_0xdc7a('0x1'));var logger=require(_0xdc7a('0x2'))('api');var moment=require(_0xdc7a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc7a('0x4'));var rimraf=require('rimraf');var config=require(_0xdc7a('0x5'));var attributes=require(_0xdc7a('0x6'));module[_0xdc7a('0x7')]=function(_0x1eb79d,_0x45161c){return _0x1eb79d[_0xdc7a('0x8')](_0xdc7a('0x9'),attributes,{'tableName':_0xdc7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc7a('0xb'),'collate':_0xdc7a('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8dce870..4d4a0b5 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 _0x0ab2=['message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x0ab2,0x1d4));var _0x20ab=function(_0x451f34,_0x158857){_0x451f34=_0x451f34-0x0;var _0x4c4c39=_0x0ab2[_0x451f34];return _0x4c4c39;};'use strict';var _=require('lodash');var util=require(_0x20ab('0x0'));var moment=require('moment');var BPromise=require(_0x20ab('0x1'));var rs=require(_0x20ab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20ab('0x3'))['db'];var utils=require(_0x20ab('0x4'));var logger=require(_0x20ab('0x5'))(_0x20ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x20ab('0x7'));var client=jayson[_0x20ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x370c34,_0x58ede1,_0x2adc86){return new BPromise(function(_0x355402,_0x433bb0){return client[_0x20ab('0x9')](_0x370c34,_0x2adc86)[_0x20ab('0xa')](function(_0xb95cc9){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x58ede1,_0x20ab('0xb'));logger[_0x20ab('0xc')](_0x20ab('0xd'),_0x58ede1,_0x20ab('0xb'),JSON[_0x20ab('0xe')](_0xb95cc9));if(_0xb95cc9[_0x20ab('0xf')]){if(_0xb95cc9[_0x20ab('0xf')][_0x20ab('0x10')]===0x1f4){logger[_0x20ab('0xf')](_0x20ab('0x11'),_0x58ede1,_0xb95cc9['error'][_0x20ab('0x12')]);return _0x433bb0(_0xb95cc9['error'][_0x20ab('0x12')]);}logger['error'](_0x20ab('0x11'),_0x58ede1,_0xb95cc9[_0x20ab('0xf')][_0x20ab('0x12')]);return _0x355402(_0xb95cc9['error'][_0x20ab('0x12')]);}else{logger[_0x20ab('0x13')](_0x20ab('0x11'),_0x58ede1,_0x20ab('0xb'));_0x355402(_0xb95cc9[_0x20ab('0x14')][_0x20ab('0x12')]);}})[_0x20ab('0x15')](function(_0x417943){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x58ede1,_0x417943);_0x433bb0(_0x417943);});});}exports[_0x20ab('0x16')]=function(_0x54c02c){var _0x4b1178=this;return new Promise(function(_0x123a42,_0x22652a){return db['OpenchannelApplication']['update'](_0x54c02c[_0x20ab('0x17')],{'raw':_0x54c02c['options']?_0x54c02c[_0x20ab('0x18')][_0x20ab('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c02c[_0x20ab('0x18')]?_0x54c02c[_0x20ab('0x18')]['where']||null:null,'attributes':_0x54c02c[_0x20ab('0x18')]?_0x54c02c['options']['attributes']||null:null,'limit':_0x54c02c['options']?_0x54c02c['options'][_0x20ab('0x1a')]||null:null})[_0x20ab('0xa')](function(_0x43eb8b){logger['info']('UpdateOpenchannelApplication',_0x54c02c);logger[_0x20ab('0xc')]('UpdateOpenchannelApplication',_0x54c02c,JSON[_0x20ab('0xe')](_0x43eb8b));_0x123a42(_0x43eb8b);})['catch'](function(_0x1684c1){logger[_0x20ab('0xf')](_0x20ab('0x16'),_0x1684c1[_0x20ab('0x12')],_0x54c02c);_0x22652a(_0x4b1178[_0x20ab('0xf')](0x1f4,_0x1684c1[_0x20ab('0x12')]));});});}; \ No newline at end of file +var _0xa1c4=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x38e74f,_0x2c5e66){var _0x3b27aa=function(_0x20501d){while(--_0x20501d){_0x38e74f['push'](_0x38e74f['shift']());}};_0x3b27aa(++_0x2c5e66);}(_0xa1c4,0xdf));var _0x4a1c=function(_0x43caa2,_0x1ffb73){_0x43caa2=_0x43caa2-0x0;var _0x51b342=_0xa1c4[_0x43caa2];return _0x51b342;};'use strict';var _=require(_0x4a1c('0x0'));var util=require(_0x4a1c('0x1'));var moment=require(_0x4a1c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a1c('0x3'));var db=require(_0x4a1c('0x4'))['db'];var utils=require(_0x4a1c('0x5'));var logger=require(_0x4a1c('0x6'))(_0x4a1c('0x7'));var config=require(_0x4a1c('0x8'));var jayson=require(_0x4a1c('0x9'));var client=jayson[_0x4a1c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7dcf22,_0x3f1d25,_0x140610){return new BPromise(function(_0x1194b1,_0x142466){return client[_0x4a1c('0xb')](_0x7dcf22,_0x140610)[_0x4a1c('0xc')](function(_0x3f15a6){logger[_0x4a1c('0xd')](_0x4a1c('0xe'),_0x3f1d25,_0x4a1c('0xf'));logger[_0x4a1c('0x10')](_0x4a1c('0x11'),_0x3f1d25,_0x4a1c('0xf'),JSON[_0x4a1c('0x12')](_0x3f15a6));if(_0x3f15a6[_0x4a1c('0x13')]){if(_0x3f15a6[_0x4a1c('0x13')]['code']===0x1f4){logger['error'](_0x4a1c('0xe'),_0x3f1d25,_0x3f15a6['error'][_0x4a1c('0x14')]);return _0x142466(_0x3f15a6[_0x4a1c('0x13')][_0x4a1c('0x14')]);}logger[_0x4a1c('0x13')](_0x4a1c('0xe'),_0x3f1d25,_0x3f15a6[_0x4a1c('0x13')][_0x4a1c('0x14')]);return _0x1194b1(_0x3f15a6['error'][_0x4a1c('0x14')]);}else{logger[_0x4a1c('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x3f1d25,'request\x20sent');_0x1194b1(_0x3f15a6['result'][_0x4a1c('0x14')]);}})[_0x4a1c('0x15')](function(_0x50eb1c){logger['error'](_0x4a1c('0xe'),_0x3f1d25,_0x50eb1c);_0x142466(_0x50eb1c);});});}exports[_0x4a1c('0x16')]=function(_0xc269a4){var _0x2379f3=this;return new Promise(function(_0x328efc,_0x2c276c){return db[_0x4a1c('0x17')][_0x4a1c('0x18')](_0xc269a4[_0x4a1c('0x19')],{'raw':_0xc269a4['options']?_0xc269a4[_0x4a1c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc269a4[_0x4a1c('0x1a')]?_0xc269a4[_0x4a1c('0x1a')][_0x4a1c('0x1b')]||null:null,'attributes':_0xc269a4[_0x4a1c('0x1a')]?_0xc269a4[_0x4a1c('0x1a')][_0x4a1c('0x1c')]||null:null,'limit':_0xc269a4[_0x4a1c('0x1a')]?_0xc269a4[_0x4a1c('0x1a')][_0x4a1c('0x1d')]||null:null})['then'](function(_0xf9a531){logger[_0x4a1c('0xd')](_0x4a1c('0x16'),_0xc269a4);logger[_0x4a1c('0x10')](_0x4a1c('0x16'),_0xc269a4,JSON[_0x4a1c('0x12')](_0xf9a531));_0x328efc(_0xf9a531);})[_0x4a1c('0x15')](function(_0x37177c){logger[_0x4a1c('0x13')](_0x4a1c('0x16'),_0x37177c[_0x4a1c('0x14')],_0xc269a4);_0x2c276c(_0x2379f3['error'](0x1f4,_0x37177c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 68f2a65..953d281 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 _0x09cd=['/:id/download','download','post','/:id/messages','addMessage','/:id/tags','openchannelinteraction:addtags','addTags','put','tracked','openchannel','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','index','isAuthenticated','describe','/:id','show','getMessages'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x09cd,0xab));var _0xd09c=function(_0x531edd,_0xed6ee5){_0x531edd=_0x531edd-0x0;var _0x13dccd=_0x09cd[_0x531edd];return _0x13dccd;};'use strict';var multer=require(_0xd09c('0x0'));var util=require(_0xd09c('0x1'));var path=require(_0xd09c('0x2'));var timeout=require(_0xd09c('0x3'));var express=require(_0xd09c('0x4'));var router=express['Router']();var auth=require(_0xd09c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd09c('0x6'));var controller=require(_0xd09c('0x7'));router[_0xd09c('0x8')]('/',auth['isAuthenticated'](),controller[_0xd09c('0x9')]);router[_0xd09c('0x8')]('/describe',auth[_0xd09c('0xa')](),controller[_0xd09c('0xb')]);router[_0xd09c('0x8')](_0xd09c('0xc'),auth[_0xd09c('0xa')](),controller[_0xd09c('0xd')]);router['get']('/:id/messages',auth[_0xd09c('0xa')](),controller[_0xd09c('0xe')]);router[_0xd09c('0x8')](_0xd09c('0xf'),auth[_0xd09c('0xa')](),controller[_0xd09c('0x10')]);router[_0xd09c('0x11')]('/',auth[_0xd09c('0xa')](),controller['create']);router['post'](_0xd09c('0x12'),auth[_0xd09c('0xa')](),controller[_0xd09c('0x13')]);router[_0xd09c('0x11')](_0xd09c('0x14'),auth[_0xd09c('0xa')](),interaction['tracked']('openchannel',_0xd09c('0x15')),controller[_0xd09c('0x16')]);router[_0xd09c('0x17')]('/:id',auth[_0xd09c('0xa')](),interaction[_0xd09c('0x18')](_0xd09c('0x19'),'openchannelinteraction:update'),controller['update']);router[_0xd09c('0x1a')](_0xd09c('0xc'),auth[_0xd09c('0xa')](),interaction[_0xd09c('0x18')](_0xd09c('0x19'),_0xd09c('0x1b')),controller[_0xd09c('0x1c')]);router['delete']('/:id/tags',auth[_0xd09c('0xa')](),controller[_0xd09c('0x1d')]);module[_0xd09c('0x1e')]=router; \ No newline at end of file +var _0x4743=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','update','delete','destroy','exports','multer'];(function(_0x669e58,_0x68ffdf){var _0x3f0834=function(_0x4d38cd){while(--_0x4d38cd){_0x669e58['push'](_0x669e58['shift']());}};_0x3f0834(++_0x68ffdf);}(_0x4743,0xd1));var _0x3474=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x4743[_0x4d337e];return _0x247963;};'use strict';var multer=require(_0x3474('0x0'));var util=require(_0x3474('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3474('0x2'));var router=express[_0x3474('0x3')]();var auth=require(_0x3474('0x4'));var interaction=require(_0x3474('0x5'));var config=require(_0x3474('0x6'));var controller=require(_0x3474('0x7'));router['get']('/',auth[_0x3474('0x8')](),controller[_0x3474('0x9')]);router[_0x3474('0xa')]('/describe',auth[_0x3474('0x8')](),controller['describe']);router[_0x3474('0xa')](_0x3474('0xb'),auth['isAuthenticated'](),controller[_0x3474('0xc')]);router[_0x3474('0xa')]('/:id/messages',auth[_0x3474('0x8')](),controller[_0x3474('0xd')]);router[_0x3474('0xa')](_0x3474('0xe'),auth[_0x3474('0x8')](),controller[_0x3474('0xf')]);router[_0x3474('0x10')]('/',auth['isAuthenticated'](),controller[_0x3474('0x11')]);router['post'](_0x3474('0x12'),auth[_0x3474('0x8')](),controller[_0x3474('0x13')]);router[_0x3474('0x10')](_0x3474('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x3474('0x15'),_0x3474('0x16')),controller[_0x3474('0x17')]);router[_0x3474('0x18')](_0x3474('0xb'),auth[_0x3474('0x8')](),interaction[_0x3474('0x19')](_0x3474('0x15'),'openchannelinteraction:update'),controller[_0x3474('0x1a')]);router[_0x3474('0x1b')](_0x3474('0xb'),auth[_0x3474('0x8')](),interaction[_0x3474('0x19')]('openchannel','openchannelinteraction:destroy'),controller[_0x3474('0x1c')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x3474('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 0c8f3b3..5a014b9 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 _0xb661=['STRING','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x9ea933,_0x565d76){var _0x4fdcd0=function(_0x1b1b59){while(--_0x1b1b59){_0x9ea933['push'](_0x9ea933['shift']());}};_0x4fdcd0(++_0x565d76);}(_0xb661,0x1d0));var _0x1b66=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xb661[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x1b66('0x0'));module[_0x1b66('0x1')]={'closed':{'type':Sequelize[_0x1b66('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b66('0x3')]},'disposition':{'type':Sequelize[_0x1b66('0x4')]},'note':{'type':Sequelize[_0x1b66('0x4')]},'read1stAt':{'type':Sequelize[_0x1b66('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1b66('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x1b66('0x4')]}}; \ No newline at end of file +var _0xd73c=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x7a2ae6,_0x270336){var _0xb55533=function(_0x35f1ed){while(--_0x35f1ed){_0x7a2ae6['push'](_0x7a2ae6['shift']());}};_0xb55533(++_0x270336);}(_0xd73c,0x134));var _0xcd73=function(_0x2e6abb,_0x2f3aaa){_0x2e6abb=_0x2e6abb-0x0;var _0x302df8=_0xd73c[_0x2e6abb];return _0x302df8;};'use strict';var Sequelize=require(_0xcd73('0x0'));module[_0xcd73('0x1')]={'closed':{'type':Sequelize[_0xcd73('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcd73('0x3')]},'disposition':{'type':Sequelize[_0xcd73('0x4')]},'note':{'type':Sequelize[_0xcd73('0x4')]},'read1stAt':{'type':Sequelize[_0xcd73('0x3')]},'threadId':{'type':Sequelize[_0xcd73('0x4')]},'externalUrl':{'type':Sequelize[_0xcd73('0x4')]},'lastMsgAt':{'type':Sequelize[_0xcd73('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcd73('0x5')]('in',_0xcd73('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xcd73('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index e0f8a1a..695d838 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 _0x6ae6=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','./openchannelInteraction.socket','sendStatus','status','end','json','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','createdAt','value','utc','format','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','Messages.count','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','filter','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','order','group','i.id','Sequelize','QueryTypes','SELECT','clone','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','Account.key','i.*','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.fax','Contact.fax','User.name','TagIds','limit','ui.OpenchannelInteractionId\x20IN\x20?','map','groupBy','OpenchannelInteractionId','Users','Tags','push','rows','catch','params','include','merge','options','create','body','update','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','download','root','files','tmp','server','attachments','transcript-%d-%s.zip','Messages','secret','User','fullname','CmContact','Contact','lastName','Attachment','OpenchannelAccount','Account','Owner','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','direction','out','firstName','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0x6ae6,0x1b2));var _0x66ae=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x6ae6[_0x1f44e4];return _0x591989;};'use strict';var pdf=require(_0x66ae('0x0'));var emlformat=require(_0x66ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x66ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x66ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66ae('0x4'));var util=require(_0x66ae('0x5'));var path=require(_0x66ae('0x6'));var sox=require(_0x66ae('0x7'));var csv=require(_0x66ae('0x8'));var ejs=require(_0x66ae('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x66ae('0xa'));var crypto=require(_0x66ae('0xb'));var jsforce=require(_0x66ae('0xc'));var deskjs=require(_0x66ae('0xd'));var toCsv=require(_0x66ae('0x8'));var querystring=require(_0x66ae('0xe'));var Papa=require(_0x66ae('0xf'));var Redis=require(_0x66ae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x66ae('0x11'));var hardwareService=require(_0x66ae('0x12'));var logger=require(_0x66ae('0x13'))('api');var utils=require(_0x66ae('0x14'));var config=require(_0x66ae('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x66ae('0x16')](config[_0x66ae('0x17')],{'host':_0x66ae('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66ae('0x17')]));require(_0x66ae('0x19'))['register'](socket);function respondWithStatusCode(_0x1a4d88,_0x3d01a8){_0x3d01a8=_0x3d01a8||0xcc;return function(_0x26a6b1){if(_0x26a6b1){return _0x1a4d88[_0x66ae('0x1a')](_0x3d01a8);}return _0x1a4d88[_0x66ae('0x1b')](_0x3d01a8)[_0x66ae('0x1c')]();};}function respondWithResult(_0x1b1c58,_0x4ad973){_0x4ad973=_0x4ad973||0xc8;return function(_0x5bc9f4){if(_0x5bc9f4){return _0x1b1c58[_0x66ae('0x1b')](_0x4ad973)[_0x66ae('0x1d')](_0x5bc9f4);}};}function respondWithFilteredResult(_0x1e4365,_0xa51c7a){return function(_0x55de32){if(_0x55de32){var _0x3b2e1b=_0x55de32[_0x66ae('0x1e')],_0x4ec6fb=_0xa51c7a[_0x66ae('0x1f')],_0x5c2c39=_0xa51c7a['offset']+_0xa51c7a['limit'],_0x2078a2;if(_0x5c2c39>=_0x3b2e1b){_0x5c2c39=_0x3b2e1b;_0x2078a2=0xc8;}else{_0x2078a2=0xce;}_0x1e4365['status'](_0x2078a2);return _0x1e4365['set'](_0x66ae('0x20'),_0x4ec6fb+'-'+_0x5c2c39+'/'+_0x3b2e1b)[_0x66ae('0x1d')](_0x55de32);}return null;};}function patchUpdates(_0x38eebf){return function(_0x1991a0){try{jsonpatch[_0x66ae('0x21')](_0x1991a0,_0x38eebf,!![]);}catch(_0x58bb2f){return BPromise['reject'](_0x58bb2f);}return _0x1991a0[_0x66ae('0x22')]();};}function saveUpdates(_0x47b748,_0x166406){return function(_0x5edf93){if(_0x5edf93){return _0x5edf93['update'](_0x47b748)[_0x66ae('0x23')](function(_0x14a72a){return _0x14a72a;});}return null;};}function removeEntity(_0x5116ae,_0x358d10){return function(_0x2201da){if(_0x2201da){return _0x2201da[_0x66ae('0x24')]()[_0x66ae('0x23')](function(){_0x5116ae[_0x66ae('0x1b')](0xcc)[_0x66ae('0x1c')]();});}};}function handleEntityNotFound(_0xd645ea,_0x52b8d5){return function(_0x573ca3){if(!_0x573ca3){_0xd645ea[_0x66ae('0x1a')](0x194);}return _0x573ca3;};}function handleError(_0x3de0a5,_0xfbdb30){_0xfbdb30=_0xfbdb30||0x1f4;return function(_0x48bd3c){logger[_0x66ae('0x25')](_0x48bd3c[_0x66ae('0x26')]);if(_0x48bd3c[_0x66ae('0x27')]){delete _0x48bd3c[_0x66ae('0x27')];}_0x3de0a5[_0x66ae('0x1b')](_0xfbdb30)[_0x66ae('0x28')](_0x48bd3c);};}exports[_0x66ae('0x29')]=function(_0x2d472a,_0x42faa5){var _0x460b4b={},_0x41268a={},_0x5ee4b1={'count':0x0,'rows':[]};var _0x832c92=db[_0x66ae('0x2a')][_0x66ae('0x2b')];_0x41268a[_0x66ae('0x2c')]=_[_0x66ae('0x2d')](_0x832c92);_0x41268a[_0x66ae('0x2e')]=_['keys'](_0x2d472a['query']);_0x41268a[_0x66ae('0x2f')]=_['intersection'](_0x41268a[_0x66ae('0x2c')],_0x41268a[_0x66ae('0x2e')]);_0x460b4b['attributes']=_[_0x66ae('0x30')](_0x41268a['model'],qs['fields'](_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x31')]));_0x460b4b[_0x66ae('0x32')]=_0x460b4b[_0x66ae('0x32')][_0x66ae('0x33')]?_0x460b4b[_0x66ae('0x32')]:_0x41268a[_0x66ae('0x2c')];if(!_0x2d472a['query'][_0x66ae('0x34')](_0x66ae('0x35'))){_0x460b4b['limit']=qs['limit'](_0x2d472a[_0x66ae('0x2e')]['limit']);_0x460b4b[_0x66ae('0x1f')]=qs['offset'](_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x1f')]);}_0x460b4b['order']=qs[_0x66ae('0x36')](_0x2d472a['query'][_0x66ae('0x36')]);_0x460b4b[_0x66ae('0x37')]=qs[_0x66ae('0x2f')](_[_0x66ae('0x38')](_0x2d472a['query'],_0x41268a['filters']));var _0x3fec91=[];var _0x1e5565=squel[_0x66ae('0x39')]()[_0x66ae('0x3a')]('id')[_0x66ae('0x3a')](_0x66ae('0x27'))[_0x66ae('0x3a')](_0x66ae('0x3b'))[_0x66ae('0x3c')](_0x66ae('0x3d'));var _0x106ac7=squel[_0x66ae('0x39')]()[_0x66ae('0x3a')](_0x66ae('0x3e'))['from'](_0x66ae('0x3f'),'me')['where'](_0x66ae('0x40'))['where'](_0x66ae('0x41'))[_0x66ae('0x37')]('me.read\x20=\x20false');var _0x5866d1=squel[_0x66ae('0x39')]()[_0x66ae('0x3a')](_0x66ae('0x42'))[_0x66ae('0x3a')](_0x66ae('0x43'))['from']('user_has_openchannel_interactions','ui')['left_join'](_0x66ae('0x44'),'u',_0x66ae('0x45'));var _0x349ec8=squel[_0x66ae('0x39')]()[_0x66ae('0x3c')](_0x66ae('0x46'),'i')[_0x66ae('0x47')]('user_has_openchannel_interactions','ui',_0x66ae('0x48'))[_0x66ae('0x47')](_0x66ae('0x44'),'u',_0x66ae('0x45'))[_0x66ae('0x47')](_0x66ae('0x49'),'c',_0x66ae('0x4a'))[_0x66ae('0x47')](_0x66ae('0x44'),'o','o.id\x20=\x20i.UserId')[_0x66ae('0x47')]('openchannel_accounts','a',_0x66ae('0x4b'))[_0x66ae('0x47')](_0x66ae('0x3f'),'me',_0x66ae('0x40'));var _0x4c2560=squel[_0x66ae('0x4c')]();if(_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x4d')]){var _0x5624fb=JSON['parse'](_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x4d')]);_[_0x66ae('0x2d')](_0x5624fb)['forEach'](function(_0x3f2301){var _0x56f13d=_0x5624fb[_0x3f2301];if(_0x3f2301===_0x66ae('0x4e')){var _0x268897=moment(_0x56f13d[_0x66ae('0x4f')]['dateStart'])['startOf']('day')[_0x66ae('0x50')]()[_0x66ae('0x51')]();var _0x1277f6=moment(_0x1277f6)[_0x66ae('0x50')]()['endOf'](_0x66ae('0x52'))[_0x66ae('0x51')]();_0x4c2560[_0x66ae('0x53')](_0x66ae('0x54'),_0x268897,_0x1277f6);}else{if(_[_0x66ae('0x55')](_0x56f13d[_0x66ae('0x56')])){_0x56f13d[_0x66ae('0x56')][_0x66ae('0x57')](function(_0x1413dd){switch(_0x56f13d['condition']['value']){case'IS':if(_0x3f2301!==_0x66ae('0x58')&&_0x3f2301!==_0x66ae('0x59')){if(_[_0x66ae('0x55')](_0x56f13d['value'])&&_0x56f13d[_0x66ae('0x4f')][_0x66ae('0x33')]>0x1){_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+'\x20IN\x20?',_0x56f13d['value']);}else{_0x4c2560[_0x66ae('0x53')](_0x56f13d['tableAlias']+'.'+_0x3f2301+_0x66ae('0x5b'),_0x56f13d[_0x66ae('0x4f')][0x0]);}}break;case'=':_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x5b'),_0x56f13d[_0x66ae('0x4f')]);break;case _0x66ae('0x5c'):if(_0x3f2301===_0x66ae('0x5d')){_0x4c2560[_0x66ae('0x53')](_0x66ae('0x5e')+'\x20LIKE\x20?','%'+_0x56f13d[_0x66ae('0x4f')]+'%');_0x4c2560['or'](_0x66ae('0x5f')+_0x66ae('0x60'),'%'+_0x56f13d['value']+'%');_0x4c2560['or'](_0x66ae('0x61')+_0x66ae('0x60'),'%'+_0x56f13d[_0x66ae('0x4f')]+'%');}else{_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x60'),'%'+_0x56f13d['value']+'%');}break;case'>':_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x62'),_0x56f13d[_0x66ae('0x4f')]);break;case'<':_0x4c2560[_0x66ae('0x53')](_0x56f13d['tableAlias']+'.'+_0x3f2301+_0x66ae('0x63'),_0x56f13d['value']);break;}});}else{switch(_0x56f13d[_0x66ae('0x56')][_0x66ae('0x4f')]){case'IS':if(_0x3f2301!==_0x66ae('0x58')&&_0x3f2301!==_0x66ae('0x59')){if(_[_0x66ae('0x55')](_0x56f13d[_0x66ae('0x4f')])&&_0x56f13d[_0x66ae('0x4f')][_0x66ae('0x33')]>0x1){_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+'\x20IN\x20?',_0x56f13d['value']);}else{_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+'\x20=\x20?',_0x56f13d[_0x66ae('0x4f')][0x0]);}}break;case'=':_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+'\x20=\x20?',_0x56f13d[_0x66ae('0x4f')]);break;case'LIKE':if(_0x3f2301===_0x66ae('0x5d')){_0x4c2560[_0x66ae('0x53')]('c.firstName'+_0x66ae('0x60'),'%'+_0x56f13d['value']+'%');_0x4c2560['or'](_0x66ae('0x5f')+_0x66ae('0x60'),'%'+_0x56f13d[_0x66ae('0x4f')]+'%');_0x4c2560['or'](_0x66ae('0x61')+'\x20LIKE\x20?','%'+_0x56f13d[_0x66ae('0x4f')]+'%');}else{_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x60'),'%'+_0x56f13d[_0x66ae('0x4f')]+'%');}break;case'>':_0x4c2560['and'](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x62'),_0x56f13d[_0x66ae('0x4f')]);break;case'<':_0x4c2560[_0x66ae('0x53')](_0x56f13d[_0x66ae('0x5a')]+'.'+_0x3f2301+_0x66ae('0x63'),_0x56f13d['value']);break;}}}});}else{var _0x503d73=_(Object['keys'](_0x2d472a[_0x66ae('0x2e')]))['map'](function(_0x10e79f){return _0x832c92[_0x66ae('0x34')](_0x10e79f)?_0x10e79f:undefined;})[_0x66ae('0x64')](function(_0x3dabdc){return!_['isNil'](_0x3dabdc);})[_0x66ae('0x4f')]();if(!_[_0x66ae('0x65')](_0x503d73)){_0x503d73[_0x66ae('0x57')](function(_0x300230){if(_0x300230===_0x66ae('0x66')){_0x349ec8['where'](_0x66ae('0x67'),[][_0x66ae('0x68')](_0x2d472a['query'][_0x300230]));}else if(_0x300230===_0x66ae('0x4e')){var _0x48d066=JSON[_0x66ae('0x69')](_0x2d472a[_0x66ae('0x2e')][_0x300230])['$gte'];var _0x451cb2=JSON[_0x66ae('0x69')](_0x2d472a[_0x66ae('0x2e')][_0x300230])[_0x66ae('0x6a')];_0x349ec8[_0x66ae('0x37')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48d066,_0x451cb2);}else{_0x349ec8['where']('i.'+_0x300230+_0x66ae('0x5b'),_0x2d472a[_0x66ae('0x2e')][_0x300230]);}});}if(_0x2d472a['query'][_0x66ae('0x64')]){var _0x179fe1=_0x2d472a[_0x66ae('0x2e')]['filter'][_0x66ae('0x6b')]('\x5c','\x5c\x5c')[_0x66ae('0x6b')]('\x27\x27',_0x66ae('0x6c'));if(qs[_0x66ae('0x6d')](_0x179fe1)){_0x4c2560['or'](_0x66ae('0x6e'),_0x179fe1+'%');}else{var _0x5736ab=[];_0x179fe1[_0x66ae('0x6f')]('\x20')[_0x66ae('0x57')](function(_0x10d485){_0x5736ab['push']('+'+_0x10d485[_0x66ae('0x70')]());});var _0xfd5ac8=_0x5736ab[_0x66ae('0x71')]('\x20');_0x4c2560['or'](_0x66ae('0x72'),_0xfd5ac8)['or'](_0x66ae('0x73'),_0x179fe1+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x179fe1+'%');}}}_0x349ec8[_0x66ae('0x37')](_0x4c2560);if(_0x460b4b[_0x66ae('0x74')]){_0x460b4b[_0x66ae('0x74')][_0x66ae('0x57')](function(_0x4cb8e9){_0x349ec8[_0x66ae('0x74')]('i.'+_0x4cb8e9[0x0],_0x4cb8e9[0x1]==='DESC'?![]:!![]);});}_0x349ec8[_0x66ae('0x75')](_0x66ae('0x76'));var _0x5088f3={'type':db[_0x66ae('0x77')][_0x66ae('0x78')][_0x66ae('0x79')],'raw':!![]};var _0x17ca15=_0x349ec8[_0x66ae('0x7a')]()['field'](_0x66ae('0x3e'));if(!_0x2d472a[_0x66ae('0x2e')]['advancedFilter']){if(_0x2d472a[_0x66ae('0x2e')]['read']){if(_0x2d472a[_0x66ae('0x2e')]['read']==0x1){_0x17ca15['where'](util[_0x66ae('0x51')](_0x66ae('0x7b'),_0x106ac7[_0x66ae('0x70')]()));_0x349ec8[_0x66ae('0x7c')](_0x66ae('0x7d'));}else{_0x17ca15[_0x66ae('0x37')](util[_0x66ae('0x51')](_0x66ae('0x7e'),_0x106ac7[_0x66ae('0x70')]()));_0x349ec8['having'](_0x66ae('0x7f'));}}if(_0x2d472a[_0x66ae('0x2e')]['tag']){var _0x16fb5d=_[_0x66ae('0x55')](_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x80')])?_0x2d472a[_0x66ae('0x2e')]['tag']:new Array(_0x2d472a[_0x66ae('0x2e')][_0x66ae('0x80')]);var _0x385434=squel[_0x66ae('0x4c')]();_0x16fb5d[_0x66ae('0x57')](function(_0x479ca9){_0x385434['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x479ca9+',%');});_0x349ec8[_0x66ae('0x7c')](_0x385434);_0x17ca15[_0x66ae('0x47')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id');_0x17ca15[_0x66ae('0x47')](_0x66ae('0x3d'),'t',_0x66ae('0x81'));_0x17ca15[_0x66ae('0x37')](_0x66ae('0x82'),_0x16fb5d);}}else{var _0x5624fb=JSON['parse'](_0x2d472a[_0x66ae('0x2e')]['advancedFilter']);_[_0x66ae('0x2d')](_0x5624fb)[_0x66ae('0x57')](function(_0x26cc0e){var _0x4da6a4=_0x5624fb[_0x26cc0e];if(_0x26cc0e==='TagId'){var _0x278e7b=_0x4da6a4['value'];var _0x485c7a=squel[_0x66ae('0x4c')]();_0x278e7b[_0x66ae('0x57')](function(_0x43f044){_0x485c7a['or'](_0x66ae('0x83'),'%,'+_0x43f044+',%');});_0x349ec8[_0x66ae('0x7c')](_0x485c7a);_0x17ca15['left_join']('mail_interaction_has_tags','it',_0x66ae('0x84'));_0x17ca15['left_join'](_0x66ae('0x3d'),'t','t.id\x20=\x20it.TagId');_0x17ca15['where']('t.id\x20IN\x20?',_0x278e7b);}else if(_0x26cc0e===_0x66ae('0x59')){if(_0x4da6a4[_0x66ae('0x4f')][_0x66ae('0x33')]===0x1){if(_0x4da6a4[_0x66ae('0x4f')][0x0]===0x1){_0x17ca15[_0x66ae('0x37')](util['format'](_0x66ae('0x7b'),_0x106ac7[_0x66ae('0x70')]()));_0x349ec8[_0x66ae('0x7c')]('`Messages.count`\x20=\x200');}else{_0x17ca15[_0x66ae('0x37')](util['format'](_0x66ae('0x7e'),_0x106ac7[_0x66ae('0x70')]()));_0x349ec8[_0x66ae('0x7c')]('`Messages.count`\x20>\x200');}}}});}db[_0x66ae('0x85')][_0x66ae('0x2e')](_0x17ca15[_0x66ae('0x70')](),_0x5088f3)['then'](function(_0x2904f8){_0x5ee4b1[_0x66ae('0x1e')]=_0x2904f8[_0x66ae('0x33')];if(_0x5ee4b1['count']===0x0)return[];return db['sequelize'][_0x66ae('0x2e')](_0x1e5565[_0x66ae('0x70')](),_0x5088f3)[_0x66ae('0x23')](function(_0x298f69){_0x3fec91=_[_0x66ae('0x86')](_0x298f69,'id');_0x5088f3=_['merge'](_0x5088f3,{'model':db[_0x66ae('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x349ec8['field'](_0x106ac7,_0x66ae('0x59'));_0x349ec8['field']('a.key',_0x66ae('0x87'));_0x349ec8[_0x66ae('0x3a')](_0x66ae('0x88'));_0x349ec8[_0x66ae('0x3a')](_0x66ae('0x5e'),_0x66ae('0x89'));_0x349ec8['field'](_0x66ae('0x5f'),_0x66ae('0x8a'));_0x349ec8['field']('c.email','Contact.email');_0x349ec8[_0x66ae('0x3a')](_0x66ae('0x8b'),_0x66ae('0x8c'));_0x349ec8['field']('c.mobile','Contact.mobile');_0x349ec8[_0x66ae('0x3a')](_0x66ae('0x8d'),_0x66ae('0x8e'));_0x349ec8[_0x66ae('0x3a')]('u.fullname',_0x66ae('0x8f'));_0x349ec8[_0x66ae('0x3a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x66ae('0x90'));_0x349ec8['left_join']('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id');_0x349ec8['left_join'](_0x66ae('0x3d'),'t',_0x66ae('0x81'));_0x349ec8[_0x66ae('0x91')](_0x460b4b[_0x66ae('0x91')]);_0x349ec8[_0x66ae('0x1f')](_0x460b4b[_0x66ae('0x1f')]);return db[_0x66ae('0x85')][_0x66ae('0x2e')](_0x349ec8[_0x66ae('0x70')](),_0x5088f3);})[_0x66ae('0x23')](function(_0x1aa423){_0x5866d1[_0x66ae('0x37')](_0x66ae('0x92'),_[_0x66ae('0x93')](_0x1aa423,'id'));return db[_0x66ae('0x85')][_0x66ae('0x2e')](_0x5866d1[_0x66ae('0x70')](),_0x5088f3)[_0x66ae('0x23')](function(_0x4e5f6d){var _0x33d2c6=_[_0x66ae('0x94')](_0x4e5f6d,_0x66ae('0x95'));_0x1aa423[_0x66ae('0x57')](function(_0x55d655){if(_0x33d2c6[_0x55d655['id']]){_0x55d655[_0x66ae('0x96')]=_[_0x66ae('0x93')](_0x33d2c6[_0x55d655['id']],function(_0x141fac){return{'id':_0x141fac['id']};});}if(_0x55d655[_0x66ae('0x90')]){_0x55d655[_0x66ae('0x97')]=[];_0x55d655[_0x66ae('0x90')][_0x66ae('0x6f')](',')[_0x66ae('0x57')](function(_0x8a1056){_0x55d655['Tags'][_0x66ae('0x98')](_0x3fec91[_0x8a1056]);});}delete _0x55d655[_0x66ae('0x90')];});return _0x1aa423;});});})[_0x66ae('0x23')](function(_0x16372e){_0x5ee4b1[_0x66ae('0x99')]=_0x16372e;return _0x5ee4b1;})[_0x66ae('0x23')](respondWithFilteredResult(_0x42faa5,_0x460b4b))[_0x66ae('0x9a')](handleError(_0x42faa5,null));};exports['show']=function(_0x55aa66,_0x4963e1){var _0x27c20d={'raw':![],'where':{'id':_0x55aa66[_0x66ae('0x9b')]['id']}},_0x2c8501={};_0x2c8501[_0x66ae('0x2c')]=_['keys'](db[_0x66ae('0x2a')][_0x66ae('0x2b')]);_0x2c8501[_0x66ae('0x2e')]=_[_0x66ae('0x2d')](_0x55aa66['query']);_0x2c8501[_0x66ae('0x2f')]=_['intersection'](_0x2c8501[_0x66ae('0x2c')],_0x2c8501[_0x66ae('0x2e')]);_0x27c20d['attributes']=_[_0x66ae('0x30')](_0x2c8501[_0x66ae('0x2c')],qs[_0x66ae('0x31')](_0x55aa66['query']['fields']));_0x27c20d[_0x66ae('0x32')]=_0x27c20d[_0x66ae('0x32')][_0x66ae('0x33')]?_0x27c20d[_0x66ae('0x32')]:_0x2c8501[_0x66ae('0x2c')];if(_0x55aa66[_0x66ae('0x2e')]['includeAll']){_0x27c20d[_0x66ae('0x9c')]=[{'all':!![]}];}_0x27c20d=_[_0x66ae('0x9d')]({},_0x27c20d,_0x55aa66[_0x66ae('0x9e')]);return db[_0x66ae('0x2a')]['find'](_0x27c20d)[_0x66ae('0x23')](handleEntityNotFound(_0x4963e1,null))[_0x66ae('0x23')](respondWithResult(_0x4963e1,null))[_0x66ae('0x9a')](handleError(_0x4963e1,null));};exports[_0x66ae('0x9f')]=function(_0x36f1d4,_0x40cc92){return db[_0x66ae('0x2a')][_0x66ae('0x9f')](_0x36f1d4[_0x66ae('0xa0')],{})['then'](respondWithResult(_0x40cc92,0xc9))[_0x66ae('0x9a')](handleError(_0x40cc92,null));};exports[_0x66ae('0xa1')]=function(_0x935cb8,_0x3fdd77){if(_0x935cb8[_0x66ae('0xa0')]['id']){delete _0x935cb8[_0x66ae('0xa0')]['id'];}return db[_0x66ae('0x2a')]['find']({'where':{'id':_0x935cb8['params']['id']}})[_0x66ae('0x23')](handleEntityNotFound(_0x3fdd77,null))[_0x66ae('0x23')](saveUpdates(_0x935cb8[_0x66ae('0xa0')],null))[_0x66ae('0x23')](respondWithResult(_0x3fdd77,null))[_0x66ae('0x9a')](handleError(_0x3fdd77,null));};exports['destroy']=function(_0x130667,_0x30f902){return db[_0x66ae('0x2a')][_0x66ae('0xa2')]({'where':{'id':_0x130667['params']['id']}})['then'](handleEntityNotFound(_0x30f902,null))['then'](removeEntity(_0x30f902,null))[_0x66ae('0x9a')](handleError(_0x30f902,null));};exports[_0x66ae('0xa3')]=function(_0x5538df,_0x4d946a){return db[_0x66ae('0x2a')][_0x66ae('0xa3')]()[_0x66ae('0x23')](respondWithResult(_0x4d946a,null))[_0x66ae('0x9a')](handleError(_0x4d946a,null));};exports[_0x66ae('0xa4')]=function(_0x28d545,_0x3fae9b,_0x14d3f1){return db[_0x66ae('0xa5')][_0x66ae('0xa2')]({'where':{'id':_0x28d545[_0x66ae('0x9b')]['id']}})[_0x66ae('0x23')](handleEntityNotFound(_0x3fae9b,null))['then'](function(_0x3767d7){if(_0x3767d7){return _0x3767d7[_0x66ae('0xa4')](_0x28d545[_0x66ae('0xa0')][_0x66ae('0xa6')],_[_0x66ae('0xa7')](_0x28d545[_0x66ae('0xa0')],[_0x66ae('0xa6'),'id'])||{});}})[_0x66ae('0x23')](respondWithResult(_0x3fae9b,null))[_0x66ae('0x9a')](handleError(_0x3fae9b,null));};exports[_0x66ae('0xa8')]=function(_0xa831f4,_0x2aecd4,_0x3f38b9){var _0x1ea3bd={'raw':![],'where':{}};var _0x589c99={};var _0x4843f9={'count':0x0,'rows':[]};return db[_0x66ae('0x2a')][_0x66ae('0xa9')]({'where':{'id':_0xa831f4[_0x66ae('0x9b')]['id']}})['then'](handleEntityNotFound(_0x2aecd4,null))[_0x66ae('0x23')](function(_0x1eabc4){if(_0x1eabc4){_0x589c99[_0x66ae('0x2c')]=_[_0x66ae('0x2d')](db[_0x66ae('0xa5')][_0x66ae('0x2b')]);_0x589c99['query']=_['keys'](_0xa831f4[_0x66ae('0x2e')]);_0x589c99['filters']=_[_0x66ae('0x30')](_0x589c99[_0x66ae('0x2c')],_0x589c99['query']);_0x1ea3bd[_0x66ae('0x32')]=_['intersection'](_0x589c99[_0x66ae('0x2c')],qs[_0x66ae('0x31')](_0xa831f4[_0x66ae('0x2e')]['fields']));_0x1ea3bd[_0x66ae('0x32')]=_0x1ea3bd[_0x66ae('0x32')]['length']?_0x1ea3bd[_0x66ae('0x32')]:_0x589c99[_0x66ae('0x2c')];if(!_0xa831f4[_0x66ae('0x2e')][_0x66ae('0x34')](_0x66ae('0x35'))){_0x1ea3bd[_0x66ae('0x91')]=qs[_0x66ae('0x91')](_0xa831f4[_0x66ae('0x2e')][_0x66ae('0x91')]);_0x1ea3bd[_0x66ae('0x1f')]=qs['offset'](_0xa831f4[_0x66ae('0x2e')][_0x66ae('0x1f')]);}_0x1ea3bd[_0x66ae('0x74')]=qs[_0x66ae('0x36')](_0xa831f4[_0x66ae('0x2e')][_0x66ae('0x36')]);_0x1ea3bd[_0x66ae('0x37')]=qs[_0x66ae('0x2f')](_['pick'](_0xa831f4[_0x66ae('0x2e')],_0x589c99[_0x66ae('0x2f')]));_0x1ea3bd[_0x66ae('0x37')][_0x66ae('0x95')]=_0x1eabc4['id'];if(_0xa831f4['query'][_0x66ae('0x64')]){_0x1ea3bd[_0x66ae('0x37')]=_[_0x66ae('0x9d')](_0x1ea3bd[_0x66ae('0x37')],{'$or':_[_0x66ae('0x93')](_0x1ea3bd[_0x66ae('0x32')],function(_0x595310){var _0x4e458b={};_0x4e458b[_0x595310]={'$like':'%'+_0xa831f4[_0x66ae('0x2e')]['filter']+'%'};return _0x4e458b;})});}if(_0xa831f4[_0x66ae('0x2e')][_0x66ae('0xaa')]){var _0x1f0d6f=_0xa831f4[_0x66ae('0x2e')][_0x66ae('0xaa')]['split'](',');var _0x57d997={};_0x57d997[_0x1f0d6f[0x0]]={'$gte':moment(_0x1f0d6f[0x1])[_0x66ae('0x51')](_0x66ae('0xab'))};_0x1ea3bd[_0x66ae('0x37')]=_[_0x66ae('0x9d')](_0x1ea3bd[_0x66ae('0x37')],_0x57d997);}_0x1ea3bd=_[_0x66ae('0x9d')]({},_0x1ea3bd,_0xa831f4['options']);return db['OpenchannelMessage'][_0x66ae('0x1e')]({'where':_0x1ea3bd['where']})['then'](function(_0x1afbf1){_0x4843f9[_0x66ae('0x1e')]=_0x1afbf1;if(_0xa831f4[_0x66ae('0x2e')][_0x66ae('0xac')]){_0x1ea3bd[_0x66ae('0x9c')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x66ae('0xad')](_0x1ea3bd);})['then'](function(_0x30b0d0){_0x4843f9[_0x66ae('0x99')]=_0x30b0d0;return _0x4843f9;});}})['then'](respondWithFilteredResult(_0x2aecd4,_0x1ea3bd))[_0x66ae('0x9a')](handleError(_0x2aecd4,null));};exports['addTags']=function(_0x4689cc,_0x203985,_0x337fc5){return db[_0x66ae('0x2a')][_0x66ae('0xa2')]({'where':{'id':_0x4689cc[_0x66ae('0x9b')]['id']}})[_0x66ae('0x23')](handleEntityNotFound(_0x203985,null))[_0x66ae('0x23')](function(_0x365e82){if(_0x365e82){return _0x365e82[_0x66ae('0xae')](_0x4689cc['body'][_0x66ae('0xa6')],_[_0x66ae('0xa7')](_0x4689cc[_0x66ae('0xa0')],[_0x66ae('0xa6'),'id'])||{})[_0x66ae('0xaf')](function(){return db[_0x66ae('0xb0')][_0x66ae('0xad')]({'attributes':['id',_0x66ae('0x27'),'color'],'where':{'id':_0x4689cc[_0x66ae('0xa0')][_0x66ae('0xa6')]}});})[_0x66ae('0x23')](function(_0x5a0730){socket['emit'](_0x66ae('0xb1'),{'id':Number(_0x4689cc[_0x66ae('0x9b')]['id']),'tags':_0x5a0730||[]});return{'id':Number(_0x4689cc[_0x66ae('0x9b')]['id']),'tags':_0x5a0730||[]};});}})[_0x66ae('0x23')](respondWithResult(_0x203985,null))[_0x66ae('0x9a')](handleError(_0x203985,null));};exports[_0x66ae('0xb2')]=function(_0x311e0c,_0x458c6d,_0x464072){return db[_0x66ae('0x2a')][_0x66ae('0xa2')]({'where':{'id':_0x311e0c['params']['id']}})[_0x66ae('0x23')](handleEntityNotFound(_0x458c6d,null))[_0x66ae('0x23')](function(_0x40cbfe){if(_0x40cbfe){return _0x40cbfe['removeTags'](_0x311e0c['query'][_0x66ae('0xa6')]);}})[_0x66ae('0x23')](respondWithStatusCode(_0x458c6d,null))[_0x66ae('0x9a')](handleError(_0x458c6d,null));};exports[_0x66ae('0xb3')]=function(_0x5b8757,_0x56858b){var _0x2114b9=moment()['unix']()[_0x66ae('0x70')]();var _0x3bbe1c=path[_0x66ae('0x71')](config[_0x66ae('0xb4')],'server',_0x66ae('0xb5'),_0x66ae('0xb6'));var _0x307519=path[_0x66ae('0x71')](config[_0x66ae('0xb4')],_0x66ae('0xb7'),'files',_0x66ae('0xb8'));var _0x340972=path[_0x66ae('0x71')](_0x3bbe1c,_0x2114b9);var _0x3a1666=util['format'](_0x66ae('0xb9'),_0x5b8757[_0x66ae('0x9b')]['id'],_0x2114b9);var _0x18dcde=path['join'](_0x3bbe1c,_0x3a1666);var _0x5b4523=![];return db[_0x66ae('0x2a')][_0x66ae('0xa2')]({'where':{'id':_0x5b8757['params']['id']},'include':[{'model':db[_0x66ae('0xa5')],'as':_0x66ae('0xba'),'attributes':['id',_0x66ae('0xa0'),_0x66ae('0x4e'),'direction',_0x66ae('0xbb')],'include':[{'model':db[_0x66ae('0xbc')],'as':_0x66ae('0xbc'),'attributes':['id',_0x66ae('0xbd')],'raw':!![]},{'model':db[_0x66ae('0xbe')],'as':_0x66ae('0xbf'),'attributes':['id','firstName',_0x66ae('0xc0')],'raw':!![]},{'model':db[_0x66ae('0xc1')],'as':_0x66ae('0xc1'),'raw':!![]}]},{'model':db[_0x66ae('0xc2')],'as':_0x66ae('0xc3'),'attributes':['id',_0x66ae('0x27')]},{'model':db['User'],'as':_0x66ae('0xc4'),'attributes':['id',_0x66ae('0xbd')]}]})[_0x66ae('0x23')](handleEntityNotFound(_0x56858b,null))[_0x66ae('0x23')](function(_0x3fa341){if(_0x3fa341){var _0x3ba185=_0x3fa341['get']({'plain':!![]});_0x5b4523=!![];var _0x1d3150={'format':'A4','border':_0x66ae('0xc5'),'header':{'height':'40px','contents':{'first':_0x66ae('0xc6')}},'footer':{'height':_0x66ae('0xc7'),'contents':{'default':util['format'](_0x66ae('0xc8'),util['format'](_0x66ae('0xc9'),'Openchannel',_0x3ba185['id']),moment()[_0x66ae('0x51')]('YYYY-MM-DD')[_0x66ae('0x70')]())}}};fs[_0x66ae('0xca')](_0x340972);var _0x335aa6={'channel':'Openchannel','account':_0x3ba185[_0x66ae('0xc3')][_0x66ae('0x27')],'agent':_0x3ba185[_0x66ae('0xc4')]?_0x3ba185[_0x66ae('0xc4')]['fullname']:_0x66ae('0xcb'),'createdAt':moment(_0x3ba185[_0x66ae('0x4e')])[_0x66ae('0x51')](_0x66ae('0xab'))['toString'](),'closedAt':_0x3ba185[_0x66ae('0xcc')]?moment(_0x3ba185[_0x66ae('0xcd')])[_0x66ae('0x51')](_0x66ae('0xab'))[_0x66ae('0x70')]():'','disposition':_0x3ba185[_0x66ae('0xce')],'visibility':_0x3ba185[_0x66ae('0xcf')]?_0x66ae('0xd0'):_0x66ae('0xd1'),'messages':_(_0x3ba185[_0x66ae('0xba')])['filter']({'secret':![]})[_0x66ae('0x93')](function(_0x113f67){if(_0x113f67[_0x66ae('0xc1')]){var _0x53b14f=path[_0x66ae('0x71')](_0x307519,_0x113f67[_0x66ae('0xc1')]['basename']);if(fs[_0x66ae('0xd2')](_0x53b14f)){fs['createReadStream'](_0x53b14f)[_0x66ae('0xd3')](fs[_0x66ae('0xd4')](path[_0x66ae('0x71')](_0x340972,_0x113f67[_0x66ae('0xc1')]['basename'])));}}return{'date':moment(_0x113f67[_0x66ae('0x4e')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x113f67[_0x66ae('0xd5')]===_0x66ae('0xd6')?_0x113f67[_0x66ae('0xbc')]?_0x113f67[_0x66ae('0xbc')][_0x66ae('0xbd')]:'System':_0x113f67[_0x66ae('0xbf')][_0x66ae('0xd7')]+(_0x113f67['Contact']['lastName']?'\x20'+_0x113f67[_0x66ae('0xbf')][_0x66ae('0xc0')]:''),'body':_0x113f67[_0x66ae('0xc1')]?_0x113f67['Attachment']['basename']:_0x113f67['body'],'direction':_0x113f67[_0x66ae('0xd5')]===_0x66ae('0xd6')?'A':'C','secret':_0x113f67[_0x66ae('0xbb')],'attachment':_0x113f67['Attachment']};})['value']()};return ejs[_0x66ae('0xd8')](path[_0x66ae('0x71')](config[_0x66ae('0xb4')],'server',_0x66ae('0xd9'),_0x66ae('0xda')),{'interaction':_0x335aa6})[_0x66ae('0x23')](function(_0x1df461){return new BPromise(function(_0x1d8466,_0x4c7311){pdf['create'](_0x1df461,_0x1d3150)[_0x66ae('0xdb')](path[_0x66ae('0x71')](_0x340972,'transcript-'+_0x3ba185['id']+'-'+_0x2114b9+_0x66ae('0xdc')),function(_0xc1d87c,_0x15bd82){if(_0xc1d87c)return _0x4c7311(_0xc1d87c);_0x1d8466(_0x15bd82);});});});}})[_0x66ae('0x23')](function(){if(_0x5b4523){return new BPromise(function(_0x42e571,_0x16c3d1){zipdir(_0x340972,{'saveTo':_0x18dcde},function(_0x5cccde,_0x1fd640){if(_0x5cccde)return _0x16c3d1(_0x5cccde);return _0x42e571(_0x1fd640);});})[_0x66ae('0x23')](function(){return new BPromise(function(_0x4c00aa,_0x3f3ef5){rimraf(_0x340972,function(_0x2ce75c){if(_0x2ce75c)_0x3f3ef5(_0x2ce75c);return _0x4c00aa();});});})[_0x66ae('0x23')](function(){return _0x56858b[_0x66ae('0xb3')](_0x18dcde,_0x3a1666,function(_0x5ead15){if(_0x5ead15){console[_0x66ae('0xdd')](_0x66ae('0xde'),_0x5ead15);}else{fs[_0x66ae('0xdf')](_0x18dcde);}});});}else{return _0x56858b[_0x66ae('0x1a')](0xc8);}})[_0x66ae('0x9a')](handleError(_0x56858b,null));}; \ No newline at end of file +var _0x00e1=['clone','read','having','`Messages.count`\x20=\x200','%s\x20>\x200','tag','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','`Messages.count`\x20>\x200','sequelize','keyBy','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','OpenchannelInteractionId','Tags','push','rows','show','params','includeAll','include','merge','options','find','create','body','catch','OpenchannelInteraction','describe','OpenchannelMessage','addMessage','ids','findOne','rawAttributes','pick','findAll','addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','User','CmContact','Contact','lastName','Attachment','Account','Owner','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','fullname','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.html','transcript-','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','count','offset','limit','reject','save','update','then','destroy','sendStatus','error','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','where','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','expr','advancedFilter','createdAt','dateStart','startOf','format','utc','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','value','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','c.firstName','c.lastName','map','hasOwnProperty','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','SELECT'];(function(_0x247a5e,_0x40b75d){var _0x16e004=function(_0x4e38c7){while(--_0x4e38c7){_0x247a5e['push'](_0x247a5e['shift']());}};_0x16e004(++_0x40b75d);}(_0x00e1,0x151));var _0x100e=function(_0x111ab0,_0x39ac73){_0x111ab0=_0x111ab0-0x0;var _0x19b94b=_0x00e1[_0x111ab0];return _0x19b94b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x100e('0x0'));var rimraf=require(_0x100e('0x1'));var zipdir=require(_0x100e('0x2'));var jsonpatch=require(_0x100e('0x3'));var rp=require(_0x100e('0x4'));var moment=require(_0x100e('0x5'));var BPromise=require(_0x100e('0x6'));var Mustache=require(_0x100e('0x7'));var util=require(_0x100e('0x8'));var path=require(_0x100e('0x9'));var sox=require(_0x100e('0xa'));var csv=require('to-csv');var ejs=require(_0x100e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x100e('0xc'));var crypto=require(_0x100e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x100e('0xe'));var toCsv=require(_0x100e('0xf'));var querystring=require(_0x100e('0x10'));var Papa=require(_0x100e('0x11'));var Redis=require(_0x100e('0x12'));var authService=require(_0x100e('0x13'));var qs=require(_0x100e('0x14'));var hardwareService=require(_0x100e('0x15'));var logger=require(_0x100e('0x16'))(_0x100e('0x17'));var utils=require('../../config/utils');var config=require(_0x100e('0x18'));var db=require(_0x100e('0x19'))['db'];config[_0x100e('0x1a')]=_[_0x100e('0x1b')](config[_0x100e('0x1a')],{'host':_0x100e('0x1c'),'port':0x18eb});var socket=require(_0x100e('0x1d'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0xcc03d,_0x93ba81){_0x93ba81=_0x93ba81||0xcc;return function(_0x1e371c){if(_0x1e371c){return _0xcc03d['sendStatus'](_0x93ba81);}return _0xcc03d[_0x100e('0x1e')](_0x93ba81)[_0x100e('0x1f')]();};}function respondWithResult(_0x39967c,_0x13fb41){_0x13fb41=_0x13fb41||0xc8;return function(_0x161927){if(_0x161927){return _0x39967c['status'](_0x13fb41)[_0x100e('0x20')](_0x161927);}};}function respondWithFilteredResult(_0x30cd19,_0xd9c25e){return function(_0x5ed477){if(_0x5ed477){var _0x42fe6c=_0x5ed477[_0x100e('0x21')],_0x318e22=_0xd9c25e[_0x100e('0x22')],_0x36f732=_0xd9c25e['offset']+_0xd9c25e[_0x100e('0x23')],_0x304593;if(_0x36f732>=_0x42fe6c){_0x36f732=_0x42fe6c;_0x304593=0xc8;}else{_0x304593=0xce;}_0x30cd19['status'](_0x304593);return _0x30cd19['set']('Content-Range',_0x318e22+'-'+_0x36f732+'/'+_0x42fe6c)[_0x100e('0x20')](_0x5ed477);}return null;};}function patchUpdates(_0x11f596){return function(_0x33fb6b){try{jsonpatch['apply'](_0x33fb6b,_0x11f596,!![]);}catch(_0x227f01){return BPromise[_0x100e('0x24')](_0x227f01);}return _0x33fb6b[_0x100e('0x25')]();};}function saveUpdates(_0x18de3f,_0x38a6af){return function(_0x457b45){if(_0x457b45){return _0x457b45[_0x100e('0x26')](_0x18de3f)[_0x100e('0x27')](function(_0x4ba837){return _0x4ba837;});}return null;};}function removeEntity(_0x4713b7,_0x4624aa){return function(_0x56aa25){if(_0x56aa25){return _0x56aa25[_0x100e('0x28')]()['then'](function(){_0x4713b7[_0x100e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x61df04,_0x1224cc){return function(_0x18c404){if(!_0x18c404){_0x61df04[_0x100e('0x29')](0x194);}return _0x18c404;};}function handleError(_0x3221b3,_0x11c9d6){_0x11c9d6=_0x11c9d6||0x1f4;return function(_0x1f0e21){logger[_0x100e('0x2a')](_0x1f0e21['stack']);if(_0x1f0e21[_0x100e('0x2b')]){delete _0x1f0e21['name'];}_0x3221b3[_0x100e('0x1e')](_0x11c9d6)[_0x100e('0x2c')](_0x1f0e21);};}exports[_0x100e('0x2d')]=function(_0x189059,_0x4e8544){var _0x4ed700={},_0x385a4b={},_0x1c9ed0={'count':0x0,'rows':[]};var _0x10c2e4=db['OpenchannelInteraction']['rawAttributes'];_0x385a4b[_0x100e('0x2e')]=_[_0x100e('0x2f')](_0x10c2e4);_0x385a4b['query']=_['keys'](_0x189059[_0x100e('0x30')]);_0x385a4b[_0x100e('0x31')]=_[_0x100e('0x32')](_0x385a4b['model'],_0x385a4b[_0x100e('0x30')]);_0x4ed700['attributes']=_[_0x100e('0x32')](_0x385a4b[_0x100e('0x2e')],qs['fields'](_0x189059[_0x100e('0x30')][_0x100e('0x33')]));_0x4ed700[_0x100e('0x34')]=_0x4ed700[_0x100e('0x34')][_0x100e('0x35')]?_0x4ed700[_0x100e('0x34')]:_0x385a4b['model'];if(!_0x189059[_0x100e('0x30')]['hasOwnProperty'](_0x100e('0x36'))){_0x4ed700[_0x100e('0x23')]=qs[_0x100e('0x23')](_0x189059[_0x100e('0x30')][_0x100e('0x23')]);_0x4ed700[_0x100e('0x22')]=qs[_0x100e('0x22')](_0x189059[_0x100e('0x30')][_0x100e('0x22')]);}_0x4ed700[_0x100e('0x37')]=qs['sort'](_0x189059[_0x100e('0x30')][_0x100e('0x38')]);_0x4ed700['where']=qs[_0x100e('0x31')](_['pick'](_0x189059[_0x100e('0x30')],_0x385a4b[_0x100e('0x31')]));var _0x2c3cb1=[];var _0x421277=squel[_0x100e('0x39')]()[_0x100e('0x3a')]('id')[_0x100e('0x3a')]('name')['field'](_0x100e('0x3b'))[_0x100e('0x3c')](_0x100e('0x3d'));var _0x5216d7=squel[_0x100e('0x39')]()[_0x100e('0x3a')](_0x100e('0x3e'))['from'](_0x100e('0x3f'),'me')[_0x100e('0x40')]('me.OpenchannelInteractionId\x20=\x20i.id')[_0x100e('0x40')]('me.direction\x20=\x20\x27in\x27')[_0x100e('0x40')](_0x100e('0x41'));var _0x3bd146=squel[_0x100e('0x39')]()[_0x100e('0x3a')](_0x100e('0x42'))[_0x100e('0x3a')](_0x100e('0x43'))[_0x100e('0x3c')](_0x100e('0x44'),'ui')['left_join']('users','u',_0x100e('0x45'));var _0x115867=squel['select']()['from'](_0x100e('0x46'),'i')[_0x100e('0x47')]('user_has_openchannel_interactions','ui','ui.UserId\x20=\x20i.UserId')['left_join']('users','u',_0x100e('0x45'))['left_join']('cm_contacts','c',_0x100e('0x48'))[_0x100e('0x47')](_0x100e('0x49'),'o',_0x100e('0x4a'))['left_join'](_0x100e('0x4b'),'a',_0x100e('0x4c'))['left_join']('openchannel_messages','me',_0x100e('0x4d'));var _0x27d7ea=squel[_0x100e('0x4e')]();if(_0x189059['query'][_0x100e('0x4f')]){var _0x3c20fd=JSON['parse'](_0x189059[_0x100e('0x30')][_0x100e('0x4f')]);_[_0x100e('0x2f')](_0x3c20fd)['forEach'](function(_0x15a763){var _0x48ed9d=_0x3c20fd[_0x15a763];if(_0x15a763===_0x100e('0x50')){var _0x467dd6=moment(_0x48ed9d['value'][_0x100e('0x51')])[_0x100e('0x52')]('day')['utc']()[_0x100e('0x53')]();var _0x371962=moment(_0x371962)[_0x100e('0x54')]()[_0x100e('0x55')](_0x100e('0x56'))[_0x100e('0x53')]();_0x27d7ea[_0x100e('0x57')](_0x100e('0x58'),_0x467dd6,_0x371962);}else{if(_[_0x100e('0x59')](_0x48ed9d['condition'])){_0x48ed9d[_0x100e('0x5a')][_0x100e('0x5b')](function(_0x104585){switch(_0x48ed9d[_0x100e('0x5a')]['value']){case'IS':if(_0x15a763!==_0x100e('0x5c')&&_0x15a763!=='Messages.count'){if(_[_0x100e('0x59')](_0x48ed9d[_0x100e('0x5d')])&&_0x48ed9d['value'][_0x100e('0x35')]>0x1){_0x27d7ea['and'](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x5f'),_0x48ed9d[_0x100e('0x5d')]);}else{_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x60'),_0x48ed9d['value'][0x0]);}}break;case'=':_0x27d7ea[_0x100e('0x57')](_0x48ed9d['tableAlias']+'.'+_0x15a763+_0x100e('0x60'),_0x48ed9d[_0x100e('0x5d')]);break;case _0x100e('0x61'):if(_0x15a763===_0x100e('0x62')){_0x27d7ea['and']('c.firstName'+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');_0x27d7ea['or']('c.lastName'+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');_0x27d7ea['or'](_0x100e('0x64')+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');}else{_0x27d7ea['and'](_0x48ed9d['tableAlias']+'.'+_0x15a763+'\x20LIKE\x20?','%'+_0x48ed9d[_0x100e('0x5d')]+'%');}break;case'>':_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x65'),_0x48ed9d[_0x100e('0x5d')]);break;case'<':_0x27d7ea[_0x100e('0x57')](_0x48ed9d['tableAlias']+'.'+_0x15a763+_0x100e('0x66'),_0x48ed9d[_0x100e('0x5d')]);break;}});}else{switch(_0x48ed9d[_0x100e('0x5a')][_0x100e('0x5d')]){case'IS':if(_0x15a763!==_0x100e('0x5c')&&_0x15a763!==_0x100e('0x67')){if(_[_0x100e('0x59')](_0x48ed9d[_0x100e('0x5d')])&&_0x48ed9d[_0x100e('0x5d')][_0x100e('0x35')]>0x1){_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x5f'),_0x48ed9d['value']);}else{_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x60'),_0x48ed9d[_0x100e('0x5d')][0x0]);}}break;case'=':_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x60'),_0x48ed9d[_0x100e('0x5d')]);break;case'LIKE':if(_0x15a763==='ContactId'){_0x27d7ea[_0x100e('0x57')](_0x100e('0x68')+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');_0x27d7ea['or'](_0x100e('0x69')+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');_0x27d7ea['or'](_0x100e('0x64')+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');}else{_0x27d7ea[_0x100e('0x57')](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x63'),'%'+_0x48ed9d[_0x100e('0x5d')]+'%');}break;case'>':_0x27d7ea['and'](_0x48ed9d[_0x100e('0x5e')]+'.'+_0x15a763+_0x100e('0x65'),_0x48ed9d[_0x100e('0x5d')]);break;case'<':_0x27d7ea[_0x100e('0x57')](_0x48ed9d['tableAlias']+'.'+_0x15a763+_0x100e('0x66'),_0x48ed9d[_0x100e('0x5d')]);break;}}}});}else{var _0xd3db2c=_(Object[_0x100e('0x2f')](_0x189059[_0x100e('0x30')]))[_0x100e('0x6a')](function(_0x12b24f){return _0x10c2e4[_0x100e('0x6b')](_0x12b24f)?_0x12b24f:undefined;})['filter'](function(_0x459b12){return!_['isNil'](_0x459b12);})[_0x100e('0x5d')]();if(!_[_0x100e('0x6c')](_0xd3db2c)){_0xd3db2c['forEach'](function(_0x1355fa){if(_0x1355fa===_0x100e('0x6d')){_0x115867['where'](_0x100e('0x6e'),[][_0x100e('0x6f')](_0x189059['query'][_0x1355fa]));}else if(_0x1355fa===_0x100e('0x50')){var _0x522be4=JSON[_0x100e('0x70')](_0x189059[_0x100e('0x30')][_0x1355fa])[_0x100e('0x71')];var _0x1127a1=JSON[_0x100e('0x70')](_0x189059[_0x100e('0x30')][_0x1355fa])[_0x100e('0x72')];_0x115867[_0x100e('0x40')](_0x100e('0x58'),_0x522be4,_0x1127a1);}else{_0x115867[_0x100e('0x40')]('i.'+_0x1355fa+'\x20=\x20?',_0x189059[_0x100e('0x30')][_0x1355fa]);}});}if(_0x189059[_0x100e('0x30')][_0x100e('0x73')]){var _0x285b8a=_0x189059[_0x100e('0x30')]['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x100e('0x74'));if(qs[_0x100e('0x75')](_0x285b8a)){_0x27d7ea['or'](_0x100e('0x76'),_0x285b8a+'%');}else{var _0x34d190=[];_0x285b8a[_0x100e('0x77')]('\x20')[_0x100e('0x5b')](function(_0x5781ae){_0x34d190['push']('+'+_0x5781ae[_0x100e('0x78')]());});var _0x50e878=_0x34d190['join']('\x20');_0x27d7ea['or'](_0x100e('0x79'),_0x50e878)['or'](_0x100e('0x7a'),_0x285b8a+'%')['or'](_0x100e('0x7b'),_0x285b8a+'%');}}}_0x115867[_0x100e('0x40')](_0x27d7ea);if(_0x4ed700[_0x100e('0x37')]){_0x4ed700[_0x100e('0x37')][_0x100e('0x5b')](function(_0x35c419){_0x115867[_0x100e('0x37')]('i.'+_0x35c419[0x0],_0x35c419[0x1]===_0x100e('0x7c')?![]:!![]);});}_0x115867[_0x100e('0x7d')](_0x100e('0x7e'));var _0x3cbfe4={'type':db[_0x100e('0x7f')]['QueryTypes'][_0x100e('0x80')],'raw':!![]};var _0xa24722=_0x115867[_0x100e('0x81')]()['field'](_0x100e('0x3e'));if(!_0x189059[_0x100e('0x30')]['advancedFilter']){if(_0x189059[_0x100e('0x30')][_0x100e('0x82')]){if(_0x189059[_0x100e('0x30')][_0x100e('0x82')]==0x1){_0xa24722[_0x100e('0x40')](util[_0x100e('0x53')]('%s\x20=\x200',_0x5216d7[_0x100e('0x78')]()));_0x115867[_0x100e('0x83')](_0x100e('0x84'));}else{_0xa24722[_0x100e('0x40')](util[_0x100e('0x53')](_0x100e('0x85'),_0x5216d7[_0x100e('0x78')]()));_0x115867[_0x100e('0x83')]('`Messages.count`\x20>\x200');}}if(_0x189059['query']['tag']){var _0x1b196a=_['isArray'](_0x189059[_0x100e('0x30')][_0x100e('0x86')])?_0x189059[_0x100e('0x30')][_0x100e('0x86')]:new Array(_0x189059[_0x100e('0x30')][_0x100e('0x86')]);var _0x2c50fc=squel[_0x100e('0x4e')]();_0x1b196a[_0x100e('0x5b')](function(_0x1fbb2b){_0x2c50fc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fbb2b+',%');});_0x115867[_0x100e('0x83')](_0x2c50fc);_0xa24722[_0x100e('0x47')](_0x100e('0x87'),'it',_0x100e('0x88'));_0xa24722[_0x100e('0x47')](_0x100e('0x3d'),'t',_0x100e('0x89'));_0xa24722['where'](_0x100e('0x8a'),_0x1b196a);}}else{var _0x3c20fd=JSON['parse'](_0x189059[_0x100e('0x30')][_0x100e('0x4f')]);_['keys'](_0x3c20fd)['forEach'](function(_0x1631e4){var _0x5d0a11=_0x3c20fd[_0x1631e4];if(_0x1631e4===_0x100e('0x5c')){var _0x237643=_0x5d0a11[_0x100e('0x5d')];var _0x4b5840=squel[_0x100e('0x4e')]();_0x237643[_0x100e('0x5b')](function(_0x5b368b){_0x4b5840['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5b368b+',%');});_0x115867[_0x100e('0x83')](_0x4b5840);_0xa24722['left_join']('mail_interaction_has_tags','it',_0x100e('0x8b'));_0xa24722['left_join']('tools_tags','t',_0x100e('0x89'));_0xa24722[_0x100e('0x40')](_0x100e('0x8a'),_0x237643);}else if(_0x1631e4===_0x100e('0x67')){if(_0x5d0a11[_0x100e('0x5d')]['length']===0x1){if(_0x5d0a11['value'][0x0]===0x1){_0xa24722[_0x100e('0x40')](util[_0x100e('0x53')]('%s\x20=\x200',_0x5216d7[_0x100e('0x78')]()));_0x115867[_0x100e('0x83')](_0x100e('0x84'));}else{_0xa24722[_0x100e('0x40')](util['format'](_0x100e('0x85'),_0x5216d7[_0x100e('0x78')]()));_0x115867[_0x100e('0x83')](_0x100e('0x8c'));}}}});}db[_0x100e('0x8d')]['query'](_0xa24722[_0x100e('0x78')](),_0x3cbfe4)[_0x100e('0x27')](function(_0x12ca71){_0x1c9ed0['count']=_0x12ca71[_0x100e('0x35')];if(_0x1c9ed0[_0x100e('0x21')]===0x0)return[];return db['sequelize'][_0x100e('0x30')](_0x421277[_0x100e('0x78')](),_0x3cbfe4)[_0x100e('0x27')](function(_0x19a0b4){_0x2c3cb1=_[_0x100e('0x8e')](_0x19a0b4,'id');_0x3cbfe4=_['merge'](_0x3cbfe4,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x115867[_0x100e('0x3a')](_0x5216d7,_0x100e('0x67'));_0x115867['field']('a.key',_0x100e('0x8f'));_0x115867[_0x100e('0x3a')](_0x100e('0x90'));_0x115867[_0x100e('0x3a')](_0x100e('0x68'),_0x100e('0x91'));_0x115867[_0x100e('0x3a')](_0x100e('0x69'),_0x100e('0x92'));_0x115867[_0x100e('0x3a')](_0x100e('0x64'),_0x100e('0x93'));_0x115867[_0x100e('0x3a')](_0x100e('0x94'),_0x100e('0x95'));_0x115867['field'](_0x100e('0x96'),_0x100e('0x97'));_0x115867[_0x100e('0x3a')](_0x100e('0x98'),_0x100e('0x99'));_0x115867[_0x100e('0x3a')](_0x100e('0x9a'),_0x100e('0x9b'));_0x115867[_0x100e('0x3a')](_0x100e('0x9c'),_0x100e('0x9d'));_0x115867['left_join'](_0x100e('0x87'),'it',_0x100e('0x88'));_0x115867['left_join'](_0x100e('0x3d'),'t',_0x100e('0x89'));_0x115867[_0x100e('0x23')](_0x4ed700[_0x100e('0x23')]);_0x115867[_0x100e('0x22')](_0x4ed700[_0x100e('0x22')]);return db[_0x100e('0x8d')]['query'](_0x115867[_0x100e('0x78')](),_0x3cbfe4);})['then'](function(_0xd6ff7){_0x3bd146[_0x100e('0x40')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0xd6ff7,'id'));return db[_0x100e('0x8d')][_0x100e('0x30')](_0x3bd146[_0x100e('0x78')](),_0x3cbfe4)[_0x100e('0x27')](function(_0x443c4b){var _0x1c9b36=_[_0x100e('0x9e')](_0x443c4b,_0x100e('0x9f'));_0xd6ff7[_0x100e('0x5b')](function(_0x12bcac){if(_0x1c9b36[_0x12bcac['id']]){_0x12bcac['Users']=_['map'](_0x1c9b36[_0x12bcac['id']],function(_0xf6eb6){return{'id':_0xf6eb6['id']};});}if(_0x12bcac[_0x100e('0x9d')]){_0x12bcac[_0x100e('0xa0')]=[];_0x12bcac[_0x100e('0x9d')][_0x100e('0x77')](',')[_0x100e('0x5b')](function(_0x4acc09){_0x12bcac[_0x100e('0xa0')][_0x100e('0xa1')](_0x2c3cb1[_0x4acc09]);});}delete _0x12bcac['TagIds'];});return _0xd6ff7;});});})[_0x100e('0x27')](function(_0x2a553a){_0x1c9ed0[_0x100e('0xa2')]=_0x2a553a;return _0x1c9ed0;})['then'](respondWithFilteredResult(_0x4e8544,_0x4ed700))['catch'](handleError(_0x4e8544,null));};exports[_0x100e('0xa3')]=function(_0x3e3d1e,_0x29acb3){var _0x5e8a73={'raw':![],'where':{'id':_0x3e3d1e[_0x100e('0xa4')]['id']}},_0x29250d={};_0x29250d[_0x100e('0x2e')]=_[_0x100e('0x2f')](db['OpenchannelInteraction']['rawAttributes']);_0x29250d['query']=_[_0x100e('0x2f')](_0x3e3d1e['query']);_0x29250d['filters']=_[_0x100e('0x32')](_0x29250d[_0x100e('0x2e')],_0x29250d[_0x100e('0x30')]);_0x5e8a73['attributes']=_[_0x100e('0x32')](_0x29250d[_0x100e('0x2e')],qs[_0x100e('0x33')](_0x3e3d1e[_0x100e('0x30')][_0x100e('0x33')]));_0x5e8a73['attributes']=_0x5e8a73['attributes'][_0x100e('0x35')]?_0x5e8a73['attributes']:_0x29250d[_0x100e('0x2e')];if(_0x3e3d1e[_0x100e('0x30')][_0x100e('0xa5')]){_0x5e8a73[_0x100e('0xa6')]=[{'all':!![]}];}_0x5e8a73=_[_0x100e('0xa7')]({},_0x5e8a73,_0x3e3d1e[_0x100e('0xa8')]);return db['OpenchannelInteraction'][_0x100e('0xa9')](_0x5e8a73)[_0x100e('0x27')](handleEntityNotFound(_0x29acb3,null))[_0x100e('0x27')](respondWithResult(_0x29acb3,null))['catch'](handleError(_0x29acb3,null));};exports[_0x100e('0xaa')]=function(_0x208ece,_0x4e1778){return db['OpenchannelInteraction'][_0x100e('0xaa')](_0x208ece[_0x100e('0xab')],{})[_0x100e('0x27')](respondWithResult(_0x4e1778,0xc9))[_0x100e('0xac')](handleError(_0x4e1778,null));};exports['update']=function(_0x430859,_0x235708){if(_0x430859['body']['id']){delete _0x430859['body']['id'];}return db[_0x100e('0xad')][_0x100e('0xa9')]({'where':{'id':_0x430859[_0x100e('0xa4')]['id']}})[_0x100e('0x27')](handleEntityNotFound(_0x235708,null))[_0x100e('0x27')](saveUpdates(_0x430859[_0x100e('0xab')],null))['then'](respondWithResult(_0x235708,null))['catch'](handleError(_0x235708,null));};exports[_0x100e('0x28')]=function(_0x1b437e,_0xcba6c3){return db['OpenchannelInteraction'][_0x100e('0xa9')]({'where':{'id':_0x1b437e[_0x100e('0xa4')]['id']}})['then'](handleEntityNotFound(_0xcba6c3,null))[_0x100e('0x27')](removeEntity(_0xcba6c3,null))[_0x100e('0xac')](handleError(_0xcba6c3,null));};exports[_0x100e('0xae')]=function(_0x1d2b54,_0x3c6652){return db[_0x100e('0xad')][_0x100e('0xae')]()[_0x100e('0x27')](respondWithResult(_0x3c6652,null))[_0x100e('0xac')](handleError(_0x3c6652,null));};exports['addMessage']=function(_0x863377,_0x23a237,_0x1b5670){return db[_0x100e('0xaf')][_0x100e('0xa9')]({'where':{'id':_0x863377['params']['id']}})[_0x100e('0x27')](handleEntityNotFound(_0x23a237,null))['then'](function(_0x2ec3b7){if(_0x2ec3b7){return _0x2ec3b7[_0x100e('0xb0')](_0x863377[_0x100e('0xab')][_0x100e('0xb1')],_['omit'](_0x863377[_0x100e('0xab')],[_0x100e('0xb1'),'id'])||{});}})[_0x100e('0x27')](respondWithResult(_0x23a237,null))['catch'](handleError(_0x23a237,null));};exports['getMessages']=function(_0x4f2274,_0x415e6a,_0x371e56){var _0x3a437d={'raw':![],'where':{}};var _0x395f58={};var _0x2e6451={'count':0x0,'rows':[]};return db[_0x100e('0xad')][_0x100e('0xb2')]({'where':{'id':_0x4f2274[_0x100e('0xa4')]['id']}})['then'](handleEntityNotFound(_0x415e6a,null))['then'](function(_0x330422){if(_0x330422){_0x395f58['model']=_[_0x100e('0x2f')](db[_0x100e('0xaf')][_0x100e('0xb3')]);_0x395f58['query']=_['keys'](_0x4f2274[_0x100e('0x30')]);_0x395f58[_0x100e('0x31')]=_[_0x100e('0x32')](_0x395f58[_0x100e('0x2e')],_0x395f58[_0x100e('0x30')]);_0x3a437d[_0x100e('0x34')]=_[_0x100e('0x32')](_0x395f58[_0x100e('0x2e')],qs[_0x100e('0x33')](_0x4f2274['query'][_0x100e('0x33')]));_0x3a437d['attributes']=_0x3a437d[_0x100e('0x34')][_0x100e('0x35')]?_0x3a437d[_0x100e('0x34')]:_0x395f58[_0x100e('0x2e')];if(!_0x4f2274[_0x100e('0x30')][_0x100e('0x6b')](_0x100e('0x36'))){_0x3a437d[_0x100e('0x23')]=qs[_0x100e('0x23')](_0x4f2274[_0x100e('0x30')][_0x100e('0x23')]);_0x3a437d[_0x100e('0x22')]=qs[_0x100e('0x22')](_0x4f2274[_0x100e('0x30')][_0x100e('0x22')]);}_0x3a437d[_0x100e('0x37')]=qs[_0x100e('0x38')](_0x4f2274[_0x100e('0x30')][_0x100e('0x38')]);_0x3a437d[_0x100e('0x40')]=qs[_0x100e('0x31')](_[_0x100e('0xb4')](_0x4f2274[_0x100e('0x30')],_0x395f58[_0x100e('0x31')]));_0x3a437d[_0x100e('0x40')][_0x100e('0x9f')]=_0x330422['id'];if(_0x4f2274[_0x100e('0x30')]['filter']){_0x3a437d[_0x100e('0x40')]=_[_0x100e('0xa7')](_0x3a437d[_0x100e('0x40')],{'$or':_[_0x100e('0x6a')](_0x3a437d[_0x100e('0x34')],function(_0x5c4f27){var _0x49aa7e={};_0x49aa7e[_0x5c4f27]={'$like':'%'+_0x4f2274['query'][_0x100e('0x73')]+'%'};return _0x49aa7e;})});}if(_0x4f2274[_0x100e('0x30')][_0x100e('0x71')]){var _0x15b306=_0x4f2274[_0x100e('0x30')][_0x100e('0x71')][_0x100e('0x77')](',');var _0x312f3c={};_0x312f3c[_0x15b306[0x0]]={'$gte':moment(_0x15b306[0x1])[_0x100e('0x53')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3a437d[_0x100e('0x40')]=_[_0x100e('0xa7')](_0x3a437d[_0x100e('0x40')],_0x312f3c);}_0x3a437d=_['merge']({},_0x3a437d,_0x4f2274[_0x100e('0xa8')]);return db['OpenchannelMessage'][_0x100e('0x21')]({'where':_0x3a437d[_0x100e('0x40')]})[_0x100e('0x27')](function(_0x36c67d){_0x2e6451[_0x100e('0x21')]=_0x36c67d;if(_0x4f2274['query'][_0x100e('0xa5')]){_0x3a437d[_0x100e('0xa6')]=[{'all':!![]}];}return db[_0x100e('0xaf')][_0x100e('0xb5')](_0x3a437d);})[_0x100e('0x27')](function(_0x106a52){_0x2e6451[_0x100e('0xa2')]=_0x106a52;return _0x2e6451;});}})[_0x100e('0x27')](respondWithFilteredResult(_0x415e6a,_0x3a437d))[_0x100e('0xac')](handleError(_0x415e6a,null));};exports[_0x100e('0xb6')]=function(_0x4dd47e,_0x40df91,_0x2804f5){return db[_0x100e('0xad')][_0x100e('0xa9')]({'where':{'id':_0x4dd47e[_0x100e('0xa4')]['id']}})['then'](handleEntityNotFound(_0x40df91,null))[_0x100e('0x27')](function(_0x52323c){if(_0x52323c){return _0x52323c[_0x100e('0xb7')](_0x4dd47e[_0x100e('0xab')][_0x100e('0xb1')],_['omit'](_0x4dd47e[_0x100e('0xab')],[_0x100e('0xb1'),'id'])||{})['spread'](function(){return db[_0x100e('0xb8')][_0x100e('0xb5')]({'attributes':['id','name',_0x100e('0x3b')],'where':{'id':_0x4dd47e['body'][_0x100e('0xb1')]}});})['then'](function(_0x429b71){socket[_0x100e('0xb9')](_0x100e('0xba'),{'id':Number(_0x4dd47e[_0x100e('0xa4')]['id']),'tags':_0x429b71||[]});return{'id':Number(_0x4dd47e[_0x100e('0xa4')]['id']),'tags':_0x429b71||[]};});}})['then'](respondWithResult(_0x40df91,null))['catch'](handleError(_0x40df91,null));};exports[_0x100e('0xbb')]=function(_0x18dc4a,_0x76b90c,_0x343525){return db['OpenchannelInteraction'][_0x100e('0xa9')]({'where':{'id':_0x18dc4a[_0x100e('0xa4')]['id']}})[_0x100e('0x27')](handleEntityNotFound(_0x76b90c,null))[_0x100e('0x27')](function(_0x3db474){if(_0x3db474){return _0x3db474['removeTags'](_0x18dc4a['query'][_0x100e('0xb1')]);}})['then'](respondWithStatusCode(_0x76b90c,null))['catch'](handleError(_0x76b90c,null));};exports[_0x100e('0xbc')]=function(_0x418e16,_0x5bfe30){var _0x4aa368=moment()[_0x100e('0xbd')]()[_0x100e('0x78')]();var _0x2fc465=path[_0x100e('0xbe')](config[_0x100e('0xbf')],_0x100e('0xc0'),_0x100e('0xc1'),_0x100e('0xc2'));var _0x399a9d=path[_0x100e('0xbe')](config[_0x100e('0xbf')],'server',_0x100e('0xc1'),_0x100e('0xc3'));var _0x3a7082=path[_0x100e('0xbe')](_0x2fc465,_0x4aa368);var _0x5a969=util[_0x100e('0x53')](_0x100e('0xc4'),_0x418e16[_0x100e('0xa4')]['id'],_0x4aa368);var _0x2ad249=path[_0x100e('0xbe')](_0x2fc465,_0x5a969);var _0x363b45=![];return db[_0x100e('0xad')]['find']({'where':{'id':_0x418e16[_0x100e('0xa4')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x100e('0xc5'),'attributes':['id','body',_0x100e('0x50'),_0x100e('0xc6'),'secret'],'include':[{'model':db[_0x100e('0xc7')],'as':_0x100e('0xc7'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x100e('0xc8')],'as':_0x100e('0xc9'),'attributes':['id','firstName',_0x100e('0xca')],'raw':!![]},{'model':db[_0x100e('0xcb')],'as':'Attachment','raw':!![]}]},{'model':db['OpenchannelAccount'],'as':_0x100e('0xcc'),'attributes':['id',_0x100e('0x2b')]},{'model':db[_0x100e('0xc7')],'as':_0x100e('0xcd'),'attributes':['id','fullname']}]})[_0x100e('0x27')](handleEntityNotFound(_0x5bfe30,null))[_0x100e('0x27')](function(_0x3047e8){if(_0x3047e8){var _0x96d0be=_0x3047e8['get']({'plain':!![]});_0x363b45=!![];var _0x2d9fe4={'format':'A4','border':_0x100e('0xce'),'header':{'height':'40px','contents':{'first':_0x100e('0xcf')}},'footer':{'height':_0x100e('0xd0'),'contents':{'default':util[_0x100e('0x53')](_0x100e('0xd1'),util[_0x100e('0x53')](_0x100e('0xd2'),_0x100e('0xd3'),_0x96d0be['id']),moment()[_0x100e('0x53')](_0x100e('0xd4'))['toString']())}}};fs['mkdirSync'](_0x3a7082);var _0x2df38e={'channel':_0x100e('0xd3'),'account':_0x96d0be['Account'][_0x100e('0x2b')],'agent':_0x96d0be[_0x100e('0xcd')]?_0x96d0be[_0x100e('0xcd')][_0x100e('0xd5')]:_0x100e('0xd6'),'createdAt':moment(_0x96d0be['createdAt'])[_0x100e('0x53')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x96d0be['closed']?moment(_0x96d0be[_0x100e('0xd7')])[_0x100e('0x53')](_0x100e('0xd8'))[_0x100e('0x78')]():'','disposition':_0x96d0be['disposition'],'visibility':_0x96d0be[_0x100e('0xd9')]?_0x100e('0xda'):_0x100e('0xdb'),'messages':_(_0x96d0be[_0x100e('0xc5')])[_0x100e('0x73')]({'secret':![]})[_0x100e('0x6a')](function(_0x892b25){if(_0x892b25['Attachment']){var _0x23ce33=path['join'](_0x399a9d,_0x892b25['Attachment'][_0x100e('0xdc')]);if(fs['existsSync'](_0x23ce33)){fs[_0x100e('0xdd')](_0x23ce33)[_0x100e('0xde')](fs[_0x100e('0xdf')](path[_0x100e('0xbe')](_0x3a7082,_0x892b25[_0x100e('0xcb')]['basename'])));}}return{'date':moment(_0x892b25['createdAt'])['format'](_0x100e('0xd8'))['toString'](),'sender':_0x892b25['direction']===_0x100e('0xe0')?_0x892b25[_0x100e('0xc7')]?_0x892b25['User'][_0x100e('0xd5')]:'System':_0x892b25[_0x100e('0xc9')][_0x100e('0xe1')]+(_0x892b25[_0x100e('0xc9')][_0x100e('0xca')]?'\x20'+_0x892b25[_0x100e('0xc9')][_0x100e('0xca')]:''),'body':_0x892b25[_0x100e('0xcb')]?_0x892b25[_0x100e('0xcb')][_0x100e('0xdc')]:_0x892b25[_0x100e('0xab')],'direction':_0x892b25['direction']==='out'?'A':'C','secret':_0x892b25['secret'],'attachment':_0x892b25[_0x100e('0xcb')]};})[_0x100e('0x5d')]()};return ejs[_0x100e('0xe2')](path[_0x100e('0xbe')](config['root'],_0x100e('0xc0'),_0x100e('0xe3'),_0x100e('0xe4')),{'interaction':_0x2df38e})[_0x100e('0x27')](function(_0x1ed80c){return new BPromise(function(_0x1961f5,_0x13bf62){pdf[_0x100e('0xaa')](_0x1ed80c,_0x2d9fe4)['toFile'](path[_0x100e('0xbe')](_0x3a7082,_0x100e('0xe5')+_0x96d0be['id']+'-'+_0x4aa368+'.pdf'),function(_0x18067f,_0x13f11d){if(_0x18067f)return _0x13bf62(_0x18067f);_0x1961f5(_0x13f11d);});});});}})['then'](function(){if(_0x363b45){return new BPromise(function(_0x3b2712,_0x595172){zipdir(_0x3a7082,{'saveTo':_0x2ad249},function(_0x26f8ea,_0x26a47b){if(_0x26f8ea)return _0x595172(_0x26f8ea);return _0x3b2712(_0x26a47b);});})[_0x100e('0x27')](function(){return new BPromise(function(_0x34c037,_0x17c99c){rimraf(_0x3a7082,function(_0x34e9ca){if(_0x34e9ca)_0x17c99c(_0x34e9ca);return _0x34c037();});});})[_0x100e('0x27')](function(){return _0x5bfe30[_0x100e('0xbc')](_0x2ad249,_0x5a969,function(_0x7e15e5){if(_0x7e15e5){console[_0x100e('0xe6')](_0x100e('0xe7'),_0x7e15e5);}else{fs[_0x100e('0xe8')](_0x2ad249);}});});}else{return _0x5bfe30['sendStatus'](0xc8);}})[_0x100e('0xac')](handleError(_0x5bfe30,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4307c38..a65db93 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 _0x5947=['hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x48f292,_0x181e38){var _0x2f4163=function(_0x5734a5){while(--_0x5734a5){_0x48f292['push'](_0x48f292['shift']());}};_0x2f4163(++_0x181e38);}(_0x5947,0x14b));var _0x7594=function(_0x4bcaf5,_0x135420){_0x4bcaf5=_0x4bcaf5-0x0;var _0x40fb60=_0x5947[_0x4bcaf5];return _0x40fb60;};'use strict';var EventEmitter=require(_0x7594('0x0'));var OpenchannelInteraction=require(_0x7594('0x1'))['db'][_0x7594('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7594('0x3')](0x0);var events={'afterCreate':_0x7594('0x4'),'afterUpdate':_0x7594('0x5'),'afterDestroy':_0x7594('0x6')};function emitEvent(_0x50f79c){return function(_0x1a5ef1,_0x3a763f,_0x5270bd){OpenchannelInteractionEvents[_0x7594('0x7')](_0x50f79c+':'+_0x1a5ef1['id'],_0x1a5ef1);OpenchannelInteractionEvents[_0x7594('0x7')](_0x50f79c,_0x1a5ef1);_0x5270bd(null);};}for(var e in events){if(events[_0x7594('0x8')](e)){var event=events[e];OpenchannelInteraction[_0x7594('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4f94=['OpenchannelInteraction','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1fc322,_0x35f918){var _0x2d4f5f=function(_0x240570){while(--_0x240570){_0x1fc322['push'](_0x1fc322['shift']());}};_0x2d4f5f(++_0x35f918);}(_0x4f94,0xa8));var _0x44f9=function(_0xb2521e,_0x4ba285){_0xb2521e=_0xb2521e-0x0;var _0x2c67ee=_0x4f94[_0xb2521e];return _0x2c67ee;};'use strict';var EventEmitter=require(_0x44f9('0x0'));var OpenchannelInteraction=require(_0x44f9('0x1'))['db'][_0x44f9('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x44f9('0x3')](0x0);var events={'afterCreate':_0x44f9('0x4'),'afterUpdate':_0x44f9('0x5'),'afterDestroy':_0x44f9('0x6')};function emitEvent(_0x1a5e57){return function(_0x1e95eb,_0x180bef,_0x3e67b1){OpenchannelInteractionEvents['emit'](_0x1a5e57+':'+_0x1e95eb['id'],_0x1e95eb);OpenchannelInteractionEvents['emit'](_0x1a5e57,_0x1e95eb);_0x3e67b1(null);};}for(var e in events){if(events[_0x44f9('0x7')](e)){var event=events[e];OpenchannelInteraction[_0x44f9('0x8')](e,emitEvent(event));}}module[_0x44f9('0x9')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ed2a4da..c906849 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 _0xf3be=['lodash','util','../../config/logger','api','bluebird','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5c2b52,_0x4fa1bd){var _0x2819b0=function(_0x59ffca){while(--_0x59ffca){_0x5c2b52['push'](_0x5c2b52['shift']());}};_0x2819b0(++_0x4fa1bd);}(_0xf3be,0x1e1));var _0xef3b=function(_0xf5256c,_0x2596bb){_0xf5256c=_0xf5256c-0x0;var _0xe80778=_0xf3be[_0xf5256c];return _0xe80778;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var logger=require(_0xef3b('0x2'))(_0xef3b('0x3'));var moment=require('moment');var BPromise=require(_0xef3b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef3b('0x5'));module[_0xef3b('0x6')]=function(_0x48f499,_0x3dfcc2){return _0x48f499[_0xef3b('0x7')](_0xef3b('0x8'),attributes,{'tableName':_0xef3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47069a,_0x3a36db,_0x5af366){if(_0x47069a['changed'](_0xef3b('0xa'))){_0x47069a['closedAt']=moment()[_0xef3b('0xb')](_0xef3b('0xc'));}_0x5af366(null,_0x47069a);}}});}; \ No newline at end of file +var _0xb2ff=['exports','OpenchannelInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','path','../../config/environment','./openchannelInteraction.attributes'];(function(_0x2ff8a0,_0x557b75){var _0x2df1c8=function(_0x59565b){while(--_0x59565b){_0x2ff8a0['push'](_0x2ff8a0['shift']());}};_0x2df1c8(++_0x557b75);}(_0xb2ff,0x123));var _0xfb2f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2ff[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var logger=require('../../config/logger')(_0xfb2f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb2f('0x3'));var rimraf=require('rimraf');var config=require(_0xfb2f('0x4'));var attributes=require(_0xfb2f('0x5'));module[_0xfb2f('0x6')]=function(_0x1d3416,_0x542ce7){return _0x1d3416['define'](_0xfb2f('0x7'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34c04e,_0x4588d6,_0x29e9e4){if(_0x34c04e[_0xfb2f('0x8')]('closed')){_0x34c04e[_0xfb2f('0x9')]=moment()['format'](_0xfb2f('0xa'));}_0x29e9e4(null,_0x34c04e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4cfd319..02ef3aa 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 _0x53ec=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','stringify','catch','where','addTags','ids'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x53ec,0x192));var _0xc53e=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0x53ec[_0x1ca93c];return _0x185169;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});config[_0xc53e('0xa')]=_[_0xc53e('0xb')](config['redis'],{'host':_0xc53e('0xc'),'port':0x18eb});var socket=require(_0xc53e('0xd'))(new Redis(config[_0xc53e('0xa')]));require(_0xc53e('0xe'))[_0xc53e('0xf')](socket);function respondWithRpcPromise(_0x2c88cb,_0xd82002,_0x361e9d){return new BPromise(function(_0xa98198,_0x4b7cfa){return client['request'](_0x2c88cb,_0x361e9d)[_0xc53e('0x10')](function(_0x5a2da7){logger['info'](_0xc53e('0x11'),_0xd82002,_0xc53e('0x12'));logger[_0xc53e('0x13')](_0xc53e('0x14'),_0xd82002,'request\x20sent',JSON['stringify'](_0x5a2da7));if(_0x5a2da7[_0xc53e('0x15')]){if(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x16')]===0x1f4){logger[_0xc53e('0x15')](_0xc53e('0x11'),_0xd82002,_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);return _0x4b7cfa(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);}logger[_0xc53e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd82002,_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);return _0xa98198(_0x5a2da7[_0xc53e('0x15')][_0xc53e('0x17')]);}else{logger[_0xc53e('0x18')](_0xc53e('0x11'),_0xd82002,_0xc53e('0x12'));_0xa98198(_0x5a2da7[_0xc53e('0x19')][_0xc53e('0x17')]);}})['catch'](function(_0x546fab){logger[_0xc53e('0x15')](_0xc53e('0x11'),_0xd82002,_0x546fab);_0x4b7cfa(_0x546fab);});});}exports[_0xc53e('0x1a')]=function(_0x2e85df){var _0x20066e=this;return new Promise(function(_0x2cfe2b,_0x15a015){return db[_0xc53e('0x1b')][_0xc53e('0x1c')](_0x2e85df[_0xc53e('0x1d')],{'raw':_0x2e85df[_0xc53e('0x1e')]?_0x2e85df[_0xc53e('0x1e')][_0xc53e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e85df['options']?_0x2e85df['options']['where']||null:null,'attributes':_0x2e85df[_0xc53e('0x1e')]?_0x2e85df[_0xc53e('0x1e')][_0xc53e('0x20')]||null:null,'limit':_0x2e85df[_0xc53e('0x1e')]?_0x2e85df[_0xc53e('0x1e')]['limit']||null:null})['then'](function(_0xe06e42){logger['info'](_0xc53e('0x1a'),_0x2e85df);logger[_0xc53e('0x13')](_0xc53e('0x1a'),_0x2e85df,JSON[_0xc53e('0x21')](_0xe06e42));_0x2cfe2b(_0xe06e42);})[_0xc53e('0x22')](function(_0x4df8cf){logger[_0xc53e('0x15')]('UpdateOpenchannelInteraction',_0x4df8cf['message'],_0x2e85df);_0x15a015(_0x20066e['error'](0x1f4,_0x4df8cf[_0xc53e('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x28240a){return new Promise(function(_0x4f203d,_0x24a77e){return db['OpenchannelInteraction']['find']({'where':_0x28240a[_0xc53e('0x1e')]?_0x28240a[_0xc53e('0x1e')][_0xc53e('0x23')]||null:null})[_0xc53e('0x10')](function(_0x6415f6){if(_0x6415f6){return _0x6415f6[_0xc53e('0x24')](_0x28240a[_0xc53e('0x1d')][_0xc53e('0x25')],_['omit'](_0x28240a[_0xc53e('0x1d')],[_0xc53e('0x25'),'id'])||{});}})[_0xc53e('0x26')](function(_0x56206b){logger[_0xc53e('0x18')]('AddTags',_0x28240a);logger[_0xc53e('0x13')](_0xc53e('0x27'),_0x28240a,JSON['stringify'](_0x56206b));_0x4f203d(_0x56206b);})['catch'](function(_0x3cd8a1){logger[_0xc53e('0x15')](_0xc53e('0x27'),_0x3cd8a1[_0xc53e('0x17')],_0x28240a);_0x24a77e(_this[_0xc53e('0x15')](0x1f4,_0x3cd8a1[_0xc53e('0x17')]));});});}; \ No newline at end of file +var _0xaa3f=['OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x130e48,_0x373529){var _0x34e941=function(_0x35886d){while(--_0x35886d){_0x130e48['push'](_0x130e48['shift']());}};_0x34e941(++_0x373529);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x1f296f,_0x14f3dd){_0x1f296f=_0x1f296f-0x0;var _0x52785a=_0xaa3f[_0x1f296f];return _0x52785a;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});config[_0xfaa3('0xb')]=_[_0xfaa3('0xc')](config[_0xfaa3('0xb')],{'host':_0xfaa3('0xd'),'port':0x18eb});var socket=require(_0xfaa3('0xe'))(new Redis(config[_0xfaa3('0xb')]));require('./openchannelInteraction.socket')[_0xfaa3('0xf')](socket);function respondWithRpcPromise(_0x28de66,_0x49380c,_0x5ca0da){return new BPromise(function(_0x44d88e,_0xce3b1f){return client[_0xfaa3('0x10')](_0x28de66,_0x5ca0da)[_0xfaa3('0x11')](function(_0x23e4b6){logger[_0xfaa3('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49380c,_0xfaa3('0x13'));logger['debug'](_0xfaa3('0x14'),_0x49380c,_0xfaa3('0x13'),JSON[_0xfaa3('0x15')](_0x23e4b6));if(_0x23e4b6['error']){if(_0x23e4b6[_0xfaa3('0x16')]['code']===0x1f4){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0xce3b1f(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0x44d88e(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x49380c,'request\x20sent');_0x44d88e(_0x23e4b6['result']['message']);}})[_0xfaa3('0x19')](function(_0x5cc884){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x5cc884);_0xce3b1f(_0x5cc884);});});}exports[_0xfaa3('0x1a')]=function(_0x34b276){var _0x1c32dd=this;return new Promise(function(_0x310b0d,_0x1dd053){return db[_0xfaa3('0x1b')][_0xfaa3('0x1c')](_0x34b276[_0xfaa3('0x1d')],{'raw':_0x34b276['options']?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')]['where']||null:null,'attributes':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x20')]||null:null,'limit':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x21')]||null:null})[_0xfaa3('0x11')](function(_0x11841c){logger['info'](_0xfaa3('0x1a'),_0x34b276);logger[_0xfaa3('0x22')](_0xfaa3('0x1a'),_0x34b276,JSON[_0xfaa3('0x15')](_0x11841c));_0x310b0d(_0x11841c);})[_0xfaa3('0x19')](function(_0xf83bbe){logger[_0xfaa3('0x16')](_0xfaa3('0x1a'),_0xf83bbe[_0xfaa3('0x18')],_0x34b276);_0x1dd053(_0x1c32dd[_0xfaa3('0x16')](0x1f4,_0xf83bbe[_0xfaa3('0x18')]));});});};exports[_0xfaa3('0x23')]=function(_0x18bd3e){return new Promise(function(_0x1bc202,_0x2d7c43){return db['OpenchannelInteraction'][_0xfaa3('0x24')]({'where':_0x18bd3e[_0xfaa3('0x1e')]?_0x18bd3e[_0xfaa3('0x1e')]['where']||null:null})[_0xfaa3('0x11')](function(_0x50fb9f){if(_0x50fb9f){return _0x50fb9f[_0xfaa3('0x25')](_0x18bd3e['body'][_0xfaa3('0x26')],_[_0xfaa3('0x27')](_0x18bd3e[_0xfaa3('0x1d')],[_0xfaa3('0x26'),'id'])||{});}})[_0xfaa3('0x28')](function(_0x33ae08){logger[_0xfaa3('0x12')](_0xfaa3('0x29'),_0x18bd3e);logger['debug'](_0xfaa3('0x29'),_0x18bd3e,JSON[_0xfaa3('0x15')](_0x33ae08));_0x1bc202(_0x33ae08);})[_0xfaa3('0x19')](function(_0x174f78){logger[_0xfaa3('0x16')](_0xfaa3('0x29'),_0x174f78[_0xfaa3('0x18')],_0x18bd3e);_0x2d7c43(_this[_0xfaa3('0x16')](0x1f4,_0x174f78[_0xfaa3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 7df4dc4..d139c87 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 _0xbdca=['save','remove','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0xa13012,_0x3d8be4){var _0x3a0b5d=function(_0xd3ca2e){while(--_0xd3ca2e){_0xa13012['push'](_0xa13012['shift']());}};_0x3a0b5d(++_0x3d8be4);}(_0xbdca,0xff));var _0xabdc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbdca[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelInteractionEvents=require(_0xabdc('0x0'));var events=[_0xabdc('0x1'),_0xabdc('0x2'),_0xabdc('0x3')];function createListener(_0x406fab,_0x5d7b3f){return function(_0x1b44e9){_0x5d7b3f[_0xabdc('0x4')](_0x406fab,_0x1b44e9);};}function removeListener(_0x39a914,_0x475644){return function(){OpenchannelInteractionEvents[_0xabdc('0x5')](_0x39a914,_0x475644);};}exports['register']=function(_0x1d49cb){for(var _0x4aefc2=0x0,_0x2ab669=events[_0xabdc('0x6')];_0x4aefc2<_0x2ab669;_0x4aefc2++){var _0x2db38b=events[_0x4aefc2];var _0x4ad11d=createListener(_0xabdc('0x7')+_0x2db38b,_0x1d49cb);OpenchannelInteractionEvents['on'](_0x2db38b,_0x4ad11d);}}; \ No newline at end of file +var _0x0cf1=['save','remove','update','emit','register','openchannelInteraction:'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x0cf1,0x114));var _0x10cf=function(_0x102833,_0xa0e376){_0x102833=_0x102833-0x0;var _0x26fc65=_0x0cf1[_0x102833];return _0x26fc65;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x10cf('0x0'),_0x10cf('0x1'),_0x10cf('0x2')];function createListener(_0x476a5e,_0x47fa98){return function(_0x34fc30){_0x47fa98[_0x10cf('0x3')](_0x476a5e,_0x34fc30);};}function removeListener(_0x4597c2,_0xc10cea){return function(){OpenchannelInteractionEvents['removeListener'](_0x4597c2,_0xc10cea);};}exports[_0x10cf('0x4')]=function(_0x14fc02){for(var _0x419abc=0x0,_0x28f479=events['length'];_0x419abc<_0x28f479;_0x419abc++){var _0x34d50e=events[_0x419abc];var _0x5c68e9=createListener(_0x10cf('0x5')+_0x34d50e,_0x14fc02);OpenchannelInteractionEvents['on'](_0x34d50e,_0x5c68e9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index af18059..9aca592 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 _0xd944=['destroy','util','path','express','Router','../../components/interaction/service','index','get','/describe','isAuthenticated','/:id','show','post','tracked','openchannel','create','put','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd944,0x145));var _0x4d94=function(_0x51b664,_0x5423d5){_0x51b664=_0x51b664-0x0;var _0x1e7d94=_0xd944[_0x51b664];return _0x1e7d94;};'use strict';var multer=require('multer');var util=require(_0x4d94('0x0'));var path=require(_0x4d94('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d94('0x2'));var router=express[_0x4d94('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d94('0x4'));var config=require('../../config/environment');var controller=require('./openchannelMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4d94('0x5')]);router[_0x4d94('0x6')](_0x4d94('0x7'),auth[_0x4d94('0x8')](),controller['describe']);router['get'](_0x4d94('0x9'),auth[_0x4d94('0x8')](),controller[_0x4d94('0xa')]);router[_0x4d94('0xb')]('/',auth['isAuthenticated'](),interaction[_0x4d94('0xc')](_0x4d94('0xd'),'openchannelmessage:create'),controller[_0x4d94('0xe')]);router[_0x4d94('0xf')](_0x4d94('0x9'),auth['isAuthenticated'](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x4d94('0xf')]('/:id/reject',auth[_0x4d94('0x8')](),controller['reject']);router[_0x4d94('0x10')](_0x4d94('0x9'),auth['isAuthenticated'](),controller[_0x4d94('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc642=['Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','describe','post','tracked','openchannel','openchannelmessage:create','create','/:id','update','/:id/accept','/:id/reject','destroy','util','connect-timeout','express'];(function(_0x25d00f,_0x1f1134){var _0x23526c=function(_0xbf3525){while(--_0xbf3525){_0x25d00f['push'](_0x25d00f['shift']());}};_0x23526c(++_0x1f1134);}(_0xc642,0x151));var _0x2c64=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc642[_0x618414];return _0x21c19a;};'use strict';var multer=require('multer');var util=require(_0x2c64('0x0'));var path=require('path');var timeout=require(_0x2c64('0x1'));var express=require(_0x2c64('0x2'));var router=express[_0x2c64('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2c64('0x4'));var config=require(_0x2c64('0x5'));var controller=require(_0x2c64('0x6'));router[_0x2c64('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2c64('0x7')]('/describe',auth[_0x2c64('0x8')](),controller[_0x2c64('0x9')]);router[_0x2c64('0x7')]('/:id',auth[_0x2c64('0x8')](),controller['show']);router[_0x2c64('0xa')]('/',auth['isAuthenticated'](),interaction[_0x2c64('0xb')](_0x2c64('0xc'),_0x2c64('0xd')),controller[_0x2c64('0xe')]);router['put'](_0x2c64('0xf'),auth[_0x2c64('0x8')](),controller[_0x2c64('0x10')]);router['put'](_0x2c64('0x11'),auth[_0x2c64('0x8')](),controller['accept']);router['put'](_0x2c64('0x12'),auth[_0x2c64('0x8')](),controller['reject']);router['delete'](_0x2c64('0xf'),auth[_0x2c64('0x8')](),controller[_0x2c64('0x13')]);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 dc5f897..cbc59cc 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 _0xd3db=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd3db,0xc3));var _0xbd3d=function(_0x14c0a7,_0x5611d6){_0x14c0a7=_0x14c0a7-0x0;var _0x2efd85=_0xd3db[_0x14c0a7];return _0x2efd85;};'use strict';var Sequelize=require(_0xbd3d('0x0'));module['exports']={'body':{'type':Sequelize[_0xbd3d('0x1')](_0xbd3d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbd3d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbd3d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbd3d('0x4')]('in','out'),'defaultValue':_0xbd3d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbd3d('0x6')]}}; \ No newline at end of file +var _0xa3df=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x47cd62,_0x19bbf3){var _0x7923b9=function(_0x420f48){while(--_0x420f48){_0x47cd62['push'](_0x47cd62['shift']());}};_0x7923b9(++_0x19bbf3);}(_0xa3df,0x1e8));var _0xfa3d=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0xa3df[_0x1e2080];return _0x260111;};'use strict';var Sequelize=require('sequelize');module[_0xfa3d('0x0')]={'body':{'type':Sequelize[_0xfa3d('0x1')](_0xfa3d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfa3d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfa3d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfa3d('0x4')]('in',_0xfa3d('0x5')),'defaultValue':_0xfa3d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfa3d('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 48c14db..582c513 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 _0x9186=['bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','OpenchannelMessage','include','show','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x451e44,_0x2a4226){var _0x58f6ca=function(_0x504c35){while(--_0x504c35){_0x451e44['push'](_0x451e44['shift']());}};_0x58f6ca(++_0x2a4226);}(_0x9186,0x1e6));var _0x6918=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0x9186[_0xe896bf];return _0x4c7a8a;};'use strict';var pdf=require(_0x6918('0x0'));var emlformat=require(_0x6918('0x1'));var rimraf=require(_0x6918('0x2'));var zipdir=require(_0x6918('0x3'));var jsonpatch=require(_0x6918('0x4'));var rp=require('request-promise');var moment=require(_0x6918('0x5'));var BPromise=require(_0x6918('0x6'));var Mustache=require(_0x6918('0x7'));var util=require(_0x6918('0x8'));var path=require(_0x6918('0x9'));var sox=require(_0x6918('0xa'));var csv=require('to-csv');var ejs=require(_0x6918('0xb'));var fs=require('fs');var _=require(_0x6918('0xc'));var squel=require('squel');var crypto=require(_0x6918('0xd'));var jsforce=require(_0x6918('0xe'));var deskjs=require(_0x6918('0xf'));var toCsv=require(_0x6918('0x10'));var querystring=require(_0x6918('0x11'));var Papa=require(_0x6918('0x12'));var Redis=require(_0x6918('0x13'));var authService=require(_0x6918('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6918('0x15'));var logger=require(_0x6918('0x16'))(_0x6918('0x17'));var utils=require(_0x6918('0x18'));var config=require(_0x6918('0x19'));var db=require('../../mysqldb')['db'];config[_0x6918('0x1a')]=_[_0x6918('0x1b')](config[_0x6918('0x1a')],{'host':_0x6918('0x1c'),'port':0x18eb});var socket=require(_0x6918('0x1d'))(new Redis(config[_0x6918('0x1a')]));require(_0x6918('0x1e'))[_0x6918('0x1f')](socket);var jayson=require(_0x6918('0x20'));var client=jayson['client'][_0x6918('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x6918('0x21')]({'port':0x232a});function checkPasswordPattern(_0x39d8ec,_0x2ce41c,_0x2a5c80){if(_0x2a5c80){var _0x25e5ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25e5ec[_0x6918('0x22')](_0x2ce41c)){return _0x39d8ec;}else{throw new Error(_0x6918('0x23'));}}else{return _0x39d8ec;}}function respondWithRpcPromise(_0x584635,_0xae7de,_0x5284c8,_0x403a50){return new BPromise(function(_0x2f840c,_0x57da8a){var _0x1ef623=_0x403a50||client;return _0x1ef623[_0x6918('0x24')](_0x584635,_0x5284c8)[_0x6918('0x25')](function(_0x2b737c){logger[_0x6918('0x26')](_0x6918('0x27'),_0xae7de,_0x6918('0x28'));logger[_0x6918('0x29')](_0x6918('0x2a'),_0xae7de,_0x6918('0x28'),JSON[_0x6918('0x2b')](_0x2b737c));if(_0x2b737c['error']){if(_0x2b737c['error']['code']===0x1f4){logger[_0x6918('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0xae7de,_0x2b737c[_0x6918('0x2c')][_0x6918('0x2d')]);return _0x57da8a(_0x2b737c[_0x6918('0x2c')]['message']);}logger[_0x6918('0x2c')](_0x6918('0x27'),_0xae7de,_0x2b737c['error'][_0x6918('0x2d')]);return _0x2f840c(_0x2b737c[_0x6918('0x2c')]['message']);}else{logger[_0x6918('0x26')](_0x6918('0x27'),_0xae7de,_0x6918('0x28'));_0x2f840c(_0x2b737c[_0x6918('0x2e')][_0x6918('0x2d')]);}})[_0x6918('0x2f')](function(_0x4d8c15){logger[_0x6918('0x2c')](_0x6918('0x27'),_0xae7de,_0x4d8c15);_0x57da8a(_0x4d8c15);});});}function respondWithStatusCode(_0x5a27fe,_0x47a805){_0x47a805=_0x47a805||0xcc;return function(_0x155b9a){if(_0x155b9a){return _0x5a27fe['sendStatus'](_0x47a805);}return _0x5a27fe[_0x6918('0x30')](_0x47a805)[_0x6918('0x31')]();};}function respondWithResult(_0x5a970e,_0x5db617){_0x5db617=_0x5db617||0xc8;return function(_0x19b6dd){if(_0x19b6dd){return _0x5a970e['status'](_0x5db617)['json'](_0x19b6dd);}};}function respondWithFilteredResult(_0x570e83,_0x49256f){return function(_0x5167e4){if(_0x5167e4){var _0x2acac4=_0x5167e4[_0x6918('0x32')],_0x4e1207=_0x49256f[_0x6918('0x33')],_0x3b4450=_0x49256f[_0x6918('0x33')]+_0x49256f[_0x6918('0x34')],_0x33ac8d;if(_0x3b4450>=_0x2acac4){_0x3b4450=_0x2acac4;_0x33ac8d=0xc8;}else{_0x33ac8d=0xce;}_0x570e83['status'](_0x33ac8d);return _0x570e83[_0x6918('0x35')](_0x6918('0x36'),_0x4e1207+'-'+_0x3b4450+'/'+_0x2acac4)[_0x6918('0x37')](_0x5167e4);}return null;};}function patchUpdates(_0x2b73bd){return function(_0x1cbf63){try{jsonpatch['apply'](_0x1cbf63,_0x2b73bd,!![]);}catch(_0x3fec39){return BPromise[_0x6918('0x38')](_0x3fec39);}return _0x1cbf63[_0x6918('0x39')]();};}function saveUpdates(_0x22a994,_0x1be1c4){return function(_0x199273){if(_0x199273){return _0x199273['update'](_0x22a994)[_0x6918('0x25')](function(_0x4887f0){return _0x4887f0;});}return null;};}function removeEntity(_0x4f55f8,_0x51517f){return function(_0x5849cd){if(_0x5849cd){return _0x5849cd[_0x6918('0x3a')]()[_0x6918('0x25')](function(){_0x4f55f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f2a1,_0x9e60bf){return function(_0x898524){if(!_0x898524){_0x55f2a1['sendStatus'](0x194);}return _0x898524;};}function handleError(_0x2f158f,_0x53bd5d){_0x53bd5d=_0x53bd5d||0x1f4;return function(_0x49f0bf){logger[_0x6918('0x2c')](_0x49f0bf[_0x6918('0x3b')]);if(_0x49f0bf['name']){delete _0x49f0bf[_0x6918('0x3c')];}_0x2f158f[_0x6918('0x30')](_0x53bd5d)[_0x6918('0x3d')](_0x49f0bf);};}exports[_0x6918('0x3e')]=function(_0x20fd74,_0xe853da){var _0x1e7903={},_0x4c75b7={},_0x1abd86={'count':0x0,'rows':[]};var _0x4cfea8=db['OpenchannelMessage'][_0x6918('0x3f')];_0x4c75b7[_0x6918('0x40')]=_[_0x6918('0x41')](_0x4cfea8);_0x4c75b7['query']=_[_0x6918('0x41')](_0x20fd74[_0x6918('0x42')]);_0x4c75b7['filters']=_[_0x6918('0x43')](_0x4c75b7['model'],_0x4c75b7[_0x6918('0x42')]);_0x1e7903[_0x6918('0x44')]=_[_0x6918('0x43')](_0x4c75b7['model'],qs[_0x6918('0x45')](_0x20fd74['query']['fields']));_0x1e7903['attributes']=_0x1e7903[_0x6918('0x44')][_0x6918('0x46')]?_0x1e7903[_0x6918('0x44')]:_0x4c75b7[_0x6918('0x40')];if(!_0x20fd74[_0x6918('0x42')]['hasOwnProperty']('nolimit')){_0x1e7903['limit']=qs[_0x6918('0x34')](_0x20fd74[_0x6918('0x42')][_0x6918('0x34')]);_0x1e7903[_0x6918('0x33')]=qs[_0x6918('0x33')](_0x20fd74[_0x6918('0x42')][_0x6918('0x33')]);}_0x1e7903['order']=qs[_0x6918('0x47')](_0x20fd74[_0x6918('0x42')][_0x6918('0x47')]);_0x1e7903[_0x6918('0x48')]=qs[_0x6918('0x49')](_[_0x6918('0x4a')](_0x20fd74[_0x6918('0x42')],_0x4c75b7[_0x6918('0x49')]));if(_0x20fd74[_0x6918('0x42')]['filter']){_0x1e7903['where']=_[_0x6918('0x4b')](_0x1e7903[_0x6918('0x48')],{'$or':_[_0x6918('0x4c')](_0x4cfea8,function(_0x20fa6f){if(_0x20fa6f[_0x6918('0x4d')][_0x6918('0x4e')]!==_0x6918('0x4f')){var _0x3085b9={};_0x3085b9[_0x20fa6f[_0x6918('0x50')]]={'$like':'%'+_0x20fd74[_0x6918('0x42')][_0x6918('0x51')]+'%'};return _0x3085b9;}})});}_0x1e7903=_['merge']({},_0x1e7903,_0x20fd74[_0x6918('0x52')]);var _0xa303cb={'where':_0x1e7903['where']};return db[_0x6918('0x53')]['count'](_0xa303cb)['then'](function(_0x3d13b0){_0x1abd86['count']=_0x3d13b0;if(_0x20fd74[_0x6918('0x42')]['includeAll']){_0x1e7903[_0x6918('0x54')]=[{'all':!![]}];}return db[_0x6918('0x53')]['findAll'](_0x1e7903);})[_0x6918('0x25')](function(_0x128d83){_0x1abd86['rows']=_0x128d83;return _0x1abd86;})[_0x6918('0x25')](respondWithFilteredResult(_0xe853da,_0x1e7903))[_0x6918('0x2f')](handleError(_0xe853da,null));};exports[_0x6918('0x55')]=function(_0x51cbc7,_0x19b6c2){var _0x45983a={'raw':!![],'where':{'id':_0x51cbc7['params']['id']}},_0x852f80={};_0x852f80[_0x6918('0x40')]=_['keys'](db[_0x6918('0x53')][_0x6918('0x3f')]);_0x852f80[_0x6918('0x42')]=_[_0x6918('0x41')](_0x51cbc7[_0x6918('0x42')]);_0x852f80['filters']=_['intersection'](_0x852f80['model'],_0x852f80[_0x6918('0x42')]);_0x45983a['attributes']=_[_0x6918('0x43')](_0x852f80[_0x6918('0x40')],qs['fields'](_0x51cbc7[_0x6918('0x42')][_0x6918('0x45')]));_0x45983a['attributes']=_0x45983a['attributes'][_0x6918('0x46')]?_0x45983a['attributes']:_0x852f80['model'];if(_0x51cbc7[_0x6918('0x42')]['includeAll']){_0x45983a['include']=[{'all':!![]}];}_0x45983a=_[_0x6918('0x4b')]({},_0x45983a,_0x51cbc7[_0x6918('0x52')]);return db[_0x6918('0x53')][_0x6918('0x56')](_0x45983a)[_0x6918('0x25')](handleEntityNotFound(_0x19b6c2,null))[_0x6918('0x25')](respondWithResult(_0x19b6c2,null))[_0x6918('0x2f')](handleError(_0x19b6c2,null));};exports[_0x6918('0x57')]=function(_0x17ecb1,_0x9b3c71){return db[_0x6918('0x53')][_0x6918('0x57')](_0x17ecb1['body'],{})[_0x6918('0x25')](respondWithResult(_0x9b3c71,0xc9))[_0x6918('0x2f')](handleError(_0x9b3c71,null));};exports['update']=function(_0x564858,_0x4b9f7a){if(_0x564858[_0x6918('0x58')]['id']){delete _0x564858['body']['id'];}return db[_0x6918('0x53')][_0x6918('0x56')]({'where':{'id':_0x564858[_0x6918('0x59')]['id']}})[_0x6918('0x25')](handleEntityNotFound(_0x4b9f7a,null))[_0x6918('0x25')](saveUpdates(_0x564858[_0x6918('0x58')],null))[_0x6918('0x25')](respondWithResult(_0x4b9f7a,null))['catch'](handleError(_0x4b9f7a,null));};exports['destroy']=function(_0x834e78,_0x1e4073){return db[_0x6918('0x53')][_0x6918('0x56')]({'where':{'id':_0x834e78[_0x6918('0x59')]['id']}})[_0x6918('0x25')](handleEntityNotFound(_0x1e4073,null))[_0x6918('0x25')](removeEntity(_0x1e4073,null))[_0x6918('0x2f')](handleError(_0x1e4073,null));};exports[_0x6918('0x5a')]=function(_0x241975,_0x3d10c2){return db[_0x6918('0x53')][_0x6918('0x5a')]()[_0x6918('0x25')](respondWithResult(_0x3d10c2,null))[_0x6918('0x2f')](handleError(_0x3d10c2,null));};var interaction_log=require(_0x6918('0x16'))(_0x6918('0x5b'));exports[_0x6918('0x5c')]=function(_0x42aad0,_0x5e4c97,_0x3d48ee){var _0x19bd55={'channel':_0x6918('0x5d')};if(_0x42aad0[_0x6918('0x58')]['id']){delete _0x42aad0[_0x6918('0x58')]['id'];}_0x42aad0['body'][_0x6918('0x5e')]=!![];_0x42aad0[_0x6918('0x58')][_0x6918('0x5f')]=moment()[_0x6918('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x42aad0[_0x6918('0x58')][_0x6918('0x61')]=_0x42aad0[_0x6918('0x58')][_0x6918('0x61')]||_0x42aad0[_0x6918('0x62')]['id'];return db[_0x6918('0x53')][_0x6918('0x56')]({'where':{'id':_0x42aad0[_0x6918('0x59')]['id'],'UserId':null},'include':[{'model':db[_0x6918('0x63')],'as':_0x6918('0x64')}]})['then'](handleEntityNotFound(_0x5e4c97,null))[_0x6918('0x25')](saveUpdates(_0x42aad0[_0x6918('0x58')],null))[_0x6918('0x25')](function(_0x2e27a1){if(_0x2e27a1){_0x19bd55[_0x6918('0x2d')]=_0x2e27a1[_0x6918('0x65')]({'plain':!![]});return db[_0x6918('0x66')][_0x6918('0x56')]({'where':{'id':_0x2e27a1[_0x6918('0x67')]}});}return null;})[_0x6918('0x25')](handleEntityNotFound(_0x5e4c97,null))[_0x6918('0x25')](function(_0xd5b90a){if(_0xd5b90a){return _0xd5b90a[_0x6918('0x68')]({'UserId':_0x42aad0['body'][_0x6918('0x61')],'read1stAt':_[_0x6918('0x69')](_0xd5b90a[_0x6918('0x6a')])?moment()[_0x6918('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6918('0x25')](function(_0x470814){if(_0x470814){_0x19bd55[_0x6918('0x6b')]=_0x470814[_0x6918('0x65')]({'plain':!![]});interaction_log[_0x6918('0x26')](_0x6918('0x6c'),_0x42aad0[_0x6918('0x62')]['id'],_0x42aad0['user'][_0x6918('0x3c')],_0x42aad0[_0x6918('0x62')][_0x6918('0x6d')],_0x19bd55[_0x6918('0x6b')]['id'],_0x42aad0['body']?JSON[_0x6918('0x2b')](_0x42aad0[_0x6918('0x58')]):_0x6918('0x6e'));return respondWithRpcPromise(_0x6918('0x6f'),_0x6918('0x70'),_0x19bd55);}return null;})[_0x6918('0x25')](function(_0xdf7eb8){if(_0xdf7eb8){if(_0x42aad0[_0x6918('0x58')][_0x6918('0x71')]){_0x19bd55[_0x6918('0x2d')][_0x6918('0x72')]=util['format'](_0x6918('0x73'),_0x42aad0[_0x6918('0x62')][_0x6918('0x3c')]);_0x19bd55[_0x6918('0x2d')][_0x6918('0x74')]=_0x19bd55[_0x6918('0x74')];_0x19bd55[_0x6918('0x2d')][_0x6918('0x75')]=_0x6918('0x5c');return respondWithRpcPromise(_0x6918('0x76'),_0x6918('0x76'),{'event':_0x6918('0x77'),'message':_0x19bd55[_0x6918('0x2d')]},client9002)[_0x6918('0x25')](function(){return _0x19bd55;});}return _0x19bd55;}return null;})['then'](respondWithResult(_0x5e4c97,null))['catch'](handleError(_0x5e4c97,null));};var interaction_log=require(_0x6918('0x16'))(_0x6918('0x5b'));exports['reject']=function(_0x2ac680,_0x27b457,_0x20f7a3){var _0x4f9d25={'agent':{},'channel':'openchannel'};if(_0x2ac680[_0x6918('0x58')]['id']){delete _0x2ac680[_0x6918('0x58')]['id'];}_0x2ac680['body'][_0x6918('0x61')]=_0x2ac680['body'][_0x6918('0x61')]||_0x2ac680[_0x6918('0x62')]['id'];_0x4f9d25['agent']['id']=_0x2ac680['body'][_0x6918('0x61')];return db[_0x6918('0x53')]['find']({'where':{'id':_0x2ac680[_0x6918('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27b457,null))[_0x6918('0x25')](function(_0x49778e){if(_0x49778e){_0x4f9d25[_0x6918('0x2d')]=_0x49778e['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x49778e[_0x6918('0x67')]}});}return null;})[_0x6918('0x25')](handleEntityNotFound(_0x27b457,null))[_0x6918('0x25')](function(_0x5bb979){if(_0x5bb979){_0x4f9d25[_0x6918('0x6b')]=_0x5bb979[_0x6918('0x65')]({'plain':!![]});interaction_log[_0x6918('0x26')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ac680[_0x6918('0x62')]['id'],_0x2ac680[_0x6918('0x62')][_0x6918('0x3c')],_0x2ac680[_0x6918('0x62')][_0x6918('0x6d')],_0x4f9d25[_0x6918('0x6b')]['id'],_0x2ac680[_0x6918('0x58')]?JSON[_0x6918('0x2b')](_0x2ac680[_0x6918('0x58')]):_0x6918('0x6e'));return respondWithRpcPromise(_0x6918('0x78'),_0x6918('0x79'),_0x4f9d25);}return null;})[_0x6918('0x25')](function(_0x3242f0){if(_0x3242f0){_0x3242f0['message'][_0x6918('0x72')]=util['format'](_0x6918('0x73'),_0x2ac680[_0x6918('0x62')]['name']);_0x3242f0['message'][_0x6918('0x74')]=_0x4f9d25['channel'];_0x3242f0[_0x6918('0x2d')][_0x6918('0x75')]=_0x6918('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0x6918('0x7a'),'message':_0x3242f0[_0x6918('0x2d')]},client9002);return _0x4f9d25;}return null;})[_0x6918('0x25')](respondWithResult(_0x27b457,null))[_0x6918('0x2f')](handleError(_0x27b457,null));}; \ No newline at end of file +var _0x5a27=['http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','status','stack','name','send','rawAttributes','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','map','type','key','VIRTUAL','field','options','OpenchannelMessage','count','findAll','rows','show','params','includeAll','include','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','get','OpenchannelInteraction','UserId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','rejectmessage','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client'];(function(_0x21ee43,_0x137b22){var _0x2fcf8c=function(_0x11c613){while(--_0x11c613){_0x21ee43['push'](_0x21ee43['shift']());}};_0x2fcf8c(++_0x137b22);}(_0x5a27,0x1d5));var _0x75a2=function(_0x6b671c,_0x23ef9a){_0x6b671c=_0x6b671c-0x0;var _0x316ea7=_0x5a27[_0x6b671c];return _0x316ea7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x75a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75a2('0x1'));var rp=require(_0x75a2('0x2'));var moment=require(_0x75a2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75a2('0x4'));var path=require(_0x75a2('0x5'));var sox=require(_0x75a2('0x6'));var csv=require(_0x75a2('0x7'));var ejs=require(_0x75a2('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x75a2('0x9'));var crypto=require(_0x75a2('0xa'));var jsforce=require(_0x75a2('0xb'));var deskjs=require(_0x75a2('0xc'));var toCsv=require(_0x75a2('0x7'));var querystring=require(_0x75a2('0xd'));var Papa=require(_0x75a2('0xe'));var Redis=require(_0x75a2('0xf'));var authService=require(_0x75a2('0x10'));var qs=require(_0x75a2('0x11'));var hardwareService=require(_0x75a2('0x12'));var logger=require(_0x75a2('0x13'))(_0x75a2('0x14'));var utils=require(_0x75a2('0x15'));var config=require('../../config/environment');var db=require(_0x75a2('0x16'))['db'];config[_0x75a2('0x17')]=_[_0x75a2('0x18')](config[_0x75a2('0x17')],{'host':_0x75a2('0x19'),'port':0x18eb});var socket=require(_0x75a2('0x1a'))(new Redis(config[_0x75a2('0x17')]));require(_0x75a2('0x1b'))[_0x75a2('0x1c')](socket);var jayson=require(_0x75a2('0x1d'));var client=jayson[_0x75a2('0x1e')][_0x75a2('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x75a2('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2dc71b,_0x5bbfaa,_0x3ea4f5){if(_0x3ea4f5){var _0x542aec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x542aec[_0x75a2('0x20')](_0x5bbfaa)){return _0x2dc71b;}else{throw new Error(_0x75a2('0x21'));}}else{return _0x2dc71b;}}function respondWithRpcPromise(_0x2ccc46,_0x1fd5c0,_0x19544d,_0x20c464){return new BPromise(function(_0xa08f72,_0x32201f){var _0x4f305d=_0x20c464||client;return _0x4f305d[_0x75a2('0x22')](_0x2ccc46,_0x19544d)[_0x75a2('0x23')](function(_0xbf6736){logger[_0x75a2('0x24')](_0x75a2('0x25'),_0x1fd5c0,'request\x20sent');logger[_0x75a2('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1fd5c0,_0x75a2('0x27'),JSON['stringify'](_0xbf6736));if(_0xbf6736[_0x75a2('0x28')]){if(_0xbf6736[_0x75a2('0x28')][_0x75a2('0x29')]===0x1f4){logger[_0x75a2('0x28')](_0x75a2('0x25'),_0x1fd5c0,_0xbf6736[_0x75a2('0x28')][_0x75a2('0x2a')]);return _0x32201f(_0xbf6736['error'][_0x75a2('0x2a')]);}logger['error'](_0x75a2('0x25'),_0x1fd5c0,_0xbf6736[_0x75a2('0x28')]['message']);return _0xa08f72(_0xbf6736[_0x75a2('0x28')]['message']);}else{logger['info'](_0x75a2('0x25'),_0x1fd5c0,_0x75a2('0x27'));_0xa08f72(_0xbf6736[_0x75a2('0x2b')][_0x75a2('0x2a')]);}})[_0x75a2('0x2c')](function(_0x412210){logger[_0x75a2('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1fd5c0,_0x412210);_0x32201f(_0x412210);});});}function respondWithStatusCode(_0x2c8aee,_0x232be6){_0x232be6=_0x232be6||0xcc;return function(_0xd7ed4e){if(_0xd7ed4e){return _0x2c8aee[_0x75a2('0x2d')](_0x232be6);}return _0x2c8aee['status'](_0x232be6)[_0x75a2('0x2e')]();};}function respondWithResult(_0x7be7bc,_0x1d4cd4){_0x1d4cd4=_0x1d4cd4||0xc8;return function(_0x345650){if(_0x345650){return _0x7be7bc['status'](_0x1d4cd4)[_0x75a2('0x2f')](_0x345650);}};}function respondWithFilteredResult(_0x43c589,_0x16ae66){return function(_0x951dd9){if(_0x951dd9){var _0x2e27e1=_0x951dd9['count'],_0x425ed3=_0x16ae66[_0x75a2('0x30')],_0x30378e=_0x16ae66[_0x75a2('0x30')]+_0x16ae66[_0x75a2('0x31')],_0x15615d;if(_0x30378e>=_0x2e27e1){_0x30378e=_0x2e27e1;_0x15615d=0xc8;}else{_0x15615d=0xce;}_0x43c589['status'](_0x15615d);return _0x43c589[_0x75a2('0x32')](_0x75a2('0x33'),_0x425ed3+'-'+_0x30378e+'/'+_0x2e27e1)[_0x75a2('0x2f')](_0x951dd9);}return null;};}function patchUpdates(_0x194652){return function(_0x503e5b){try{jsonpatch[_0x75a2('0x34')](_0x503e5b,_0x194652,!![]);}catch(_0x47266e){return BPromise['reject'](_0x47266e);}return _0x503e5b[_0x75a2('0x35')]();};}function saveUpdates(_0x4b2107,_0x133380){return function(_0x2f3e9a){if(_0x2f3e9a){return _0x2f3e9a[_0x75a2('0x36')](_0x4b2107)[_0x75a2('0x23')](function(_0x1f8864){return _0x1f8864;});}return null;};}function removeEntity(_0x2ea54b,_0x587d79){return function(_0x1c71dc){if(_0x1c71dc){return _0x1c71dc[_0x75a2('0x37')]()[_0x75a2('0x23')](function(){_0x2ea54b[_0x75a2('0x38')](0xcc)[_0x75a2('0x2e')]();});}};}function handleEntityNotFound(_0x38d7a2,_0x1c0976){return function(_0x10d916){if(!_0x10d916){_0x38d7a2[_0x75a2('0x2d')](0x194);}return _0x10d916;};}function handleError(_0x2d3f7d,_0x3c7236){_0x3c7236=_0x3c7236||0x1f4;return function(_0x491b38){logger[_0x75a2('0x28')](_0x491b38[_0x75a2('0x39')]);if(_0x491b38['name']){delete _0x491b38[_0x75a2('0x3a')];}_0x2d3f7d[_0x75a2('0x38')](_0x3c7236)[_0x75a2('0x3b')](_0x491b38);};}exports['index']=function(_0xea6ed0,_0x21d2b5){var _0x1da9fb={},_0x2a5985={},_0x1cf0ed={'count':0x0,'rows':[]};var _0x17fb63=db['OpenchannelMessage'][_0x75a2('0x3c')];_0x2a5985[_0x75a2('0x3d')]=_['keys'](_0x17fb63);_0x2a5985['query']=_[_0x75a2('0x3e')](_0xea6ed0['query']);_0x2a5985['filters']=_[_0x75a2('0x3f')](_0x2a5985[_0x75a2('0x3d')],_0x2a5985[_0x75a2('0x40')]);_0x1da9fb[_0x75a2('0x41')]=_[_0x75a2('0x3f')](_0x2a5985[_0x75a2('0x3d')],qs[_0x75a2('0x42')](_0xea6ed0['query'][_0x75a2('0x42')]));_0x1da9fb[_0x75a2('0x41')]=_0x1da9fb['attributes'][_0x75a2('0x43')]?_0x1da9fb['attributes']:_0x2a5985[_0x75a2('0x3d')];if(!_0xea6ed0['query'][_0x75a2('0x44')]('nolimit')){_0x1da9fb['limit']=qs[_0x75a2('0x31')](_0xea6ed0['query']['limit']);_0x1da9fb[_0x75a2('0x30')]=qs['offset'](_0xea6ed0[_0x75a2('0x40')]['offset']);}_0x1da9fb[_0x75a2('0x45')]=qs[_0x75a2('0x46')](_0xea6ed0[_0x75a2('0x40')][_0x75a2('0x46')]);_0x1da9fb['where']=qs[_0x75a2('0x47')](_['pick'](_0xea6ed0[_0x75a2('0x40')],_0x2a5985[_0x75a2('0x47')]));if(_0xea6ed0[_0x75a2('0x40')][_0x75a2('0x48')]){_0x1da9fb[_0x75a2('0x49')]=_[_0x75a2('0x4a')](_0x1da9fb[_0x75a2('0x49')],{'$or':_[_0x75a2('0x4b')](_0x17fb63,function(_0x5caa31){if(_0x5caa31[_0x75a2('0x4c')][_0x75a2('0x4d')]!==_0x75a2('0x4e')){var _0x2b7126={};_0x2b7126[_0x5caa31[_0x75a2('0x4f')]]={'$like':'%'+_0xea6ed0[_0x75a2('0x40')][_0x75a2('0x48')]+'%'};return _0x2b7126;}})});}_0x1da9fb=_[_0x75a2('0x4a')]({},_0x1da9fb,_0xea6ed0[_0x75a2('0x50')]);var _0x5d936b={'where':_0x1da9fb['where']};return db[_0x75a2('0x51')]['count'](_0x5d936b)[_0x75a2('0x23')](function(_0x27b09d){_0x1cf0ed[_0x75a2('0x52')]=_0x27b09d;if(_0xea6ed0[_0x75a2('0x40')]['includeAll']){_0x1da9fb['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x75a2('0x53')](_0x1da9fb);})[_0x75a2('0x23')](function(_0x572245){_0x1cf0ed[_0x75a2('0x54')]=_0x572245;return _0x1cf0ed;})[_0x75a2('0x23')](respondWithFilteredResult(_0x21d2b5,_0x1da9fb))[_0x75a2('0x2c')](handleError(_0x21d2b5,null));};exports[_0x75a2('0x55')]=function(_0x3d3307,_0x2b6f2f){var _0xe94d92={'raw':!![],'where':{'id':_0x3d3307[_0x75a2('0x56')]['id']}},_0x431483={};_0x431483[_0x75a2('0x3d')]=_[_0x75a2('0x3e')](db[_0x75a2('0x51')][_0x75a2('0x3c')]);_0x431483[_0x75a2('0x40')]=_[_0x75a2('0x3e')](_0x3d3307[_0x75a2('0x40')]);_0x431483[_0x75a2('0x47')]=_['intersection'](_0x431483[_0x75a2('0x3d')],_0x431483[_0x75a2('0x40')]);_0xe94d92['attributes']=_[_0x75a2('0x3f')](_0x431483[_0x75a2('0x3d')],qs[_0x75a2('0x42')](_0x3d3307[_0x75a2('0x40')]['fields']));_0xe94d92[_0x75a2('0x41')]=_0xe94d92[_0x75a2('0x41')][_0x75a2('0x43')]?_0xe94d92['attributes']:_0x431483[_0x75a2('0x3d')];if(_0x3d3307['query'][_0x75a2('0x57')]){_0xe94d92[_0x75a2('0x58')]=[{'all':!![]}];}_0xe94d92=_[_0x75a2('0x4a')]({},_0xe94d92,_0x3d3307[_0x75a2('0x50')]);return db[_0x75a2('0x51')][_0x75a2('0x59')](_0xe94d92)[_0x75a2('0x23')](handleEntityNotFound(_0x2b6f2f,null))[_0x75a2('0x23')](respondWithResult(_0x2b6f2f,null))[_0x75a2('0x2c')](handleError(_0x2b6f2f,null));};exports[_0x75a2('0x5a')]=function(_0x13fe13,_0x23faf6){return db['OpenchannelMessage'][_0x75a2('0x5a')](_0x13fe13[_0x75a2('0x5b')],{})[_0x75a2('0x23')](respondWithResult(_0x23faf6,0xc9))[_0x75a2('0x2c')](handleError(_0x23faf6,null));};exports['update']=function(_0x204301,_0x36b1e5){if(_0x204301['body']['id']){delete _0x204301[_0x75a2('0x5b')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x204301[_0x75a2('0x56')]['id']}})[_0x75a2('0x23')](handleEntityNotFound(_0x36b1e5,null))[_0x75a2('0x23')](saveUpdates(_0x204301[_0x75a2('0x5b')],null))[_0x75a2('0x23')](respondWithResult(_0x36b1e5,null))[_0x75a2('0x2c')](handleError(_0x36b1e5,null));};exports['destroy']=function(_0x3035bf,_0x478cc5){return db[_0x75a2('0x51')][_0x75a2('0x59')]({'where':{'id':_0x3035bf[_0x75a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x478cc5,null))[_0x75a2('0x23')](removeEntity(_0x478cc5,null))[_0x75a2('0x2c')](handleError(_0x478cc5,null));};exports['describe']=function(_0x2b27c9,_0x57fa60){return db['OpenchannelMessage'][_0x75a2('0x5c')]()['then'](respondWithResult(_0x57fa60,null))['catch'](handleError(_0x57fa60,null));};var interaction_log=require(_0x75a2('0x13'))(_0x75a2('0x5d'));exports[_0x75a2('0x5e')]=function(_0x3afd24,_0x1a8c40,_0x3847e5){var _0x184457={'channel':_0x75a2('0x5f')};if(_0x3afd24[_0x75a2('0x5b')]['id']){delete _0x3afd24[_0x75a2('0x5b')]['id'];}_0x3afd24['body'][_0x75a2('0x60')]=!![];_0x3afd24[_0x75a2('0x5b')][_0x75a2('0x61')]=moment()['format'](_0x75a2('0x62'));_0x3afd24[_0x75a2('0x5b')]['UserId']=_0x3afd24['body']['UserId']||_0x3afd24[_0x75a2('0x63')]['id'];return db[_0x75a2('0x51')][_0x75a2('0x59')]({'where':{'id':_0x3afd24[_0x75a2('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x75a2('0x64')],'as':'Contact'}]})[_0x75a2('0x23')](handleEntityNotFound(_0x1a8c40,null))[_0x75a2('0x23')](saveUpdates(_0x3afd24[_0x75a2('0x5b')],null))[_0x75a2('0x23')](function(_0x747cff){if(_0x747cff){_0x184457[_0x75a2('0x2a')]=_0x747cff[_0x75a2('0x65')]({'plain':!![]});return db[_0x75a2('0x66')][_0x75a2('0x59')]({'where':{'id':_0x747cff['OpenchannelInteractionId']}});}return null;})[_0x75a2('0x23')](handleEntityNotFound(_0x1a8c40,null))[_0x75a2('0x23')](function(_0x4a6d62){if(_0x4a6d62){return _0x4a6d62[_0x75a2('0x36')]({'UserId':_0x3afd24[_0x75a2('0x5b')][_0x75a2('0x67')],'read1stAt':_[_0x75a2('0x68')](_0x4a6d62[_0x75a2('0x69')])?moment()['format'](_0x75a2('0x62')):undefined});}return null;})[_0x75a2('0x23')](function(_0x555ea7){if(_0x555ea7){_0x184457[_0x75a2('0x6a')]=_0x555ea7[_0x75a2('0x65')]({'plain':!![]});interaction_log[_0x75a2('0x24')](_0x75a2('0x6b'),_0x3afd24[_0x75a2('0x63')]['id'],_0x3afd24[_0x75a2('0x63')][_0x75a2('0x3a')],_0x3afd24[_0x75a2('0x63')][_0x75a2('0x6c')],_0x184457[_0x75a2('0x6a')]['id'],_0x3afd24['body']?JSON['stringify'](_0x3afd24['body']):_0x75a2('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x75a2('0x6e'),_0x184457);}return null;})[_0x75a2('0x23')](function(_0x327281){if(_0x327281){if(_0x3afd24[_0x75a2('0x5b')][_0x75a2('0x6f')]){_0x184457[_0x75a2('0x2a')][_0x75a2('0x70')]=util[_0x75a2('0x71')](_0x75a2('0x72'),_0x3afd24[_0x75a2('0x63')][_0x75a2('0x3a')]);_0x184457[_0x75a2('0x2a')]['channel']=_0x184457[_0x75a2('0x73')];_0x184457[_0x75a2('0x2a')][_0x75a2('0x74')]=_0x75a2('0x5e');return respondWithRpcPromise(_0x75a2('0x75'),_0x75a2('0x75'),{'event':_0x75a2('0x76'),'message':_0x184457[_0x75a2('0x2a')]},client9002)['then'](function(){return _0x184457;});}return _0x184457;}return null;})[_0x75a2('0x23')](respondWithResult(_0x1a8c40,null))['catch'](handleError(_0x1a8c40,null));};var interaction_log=require(_0x75a2('0x13'))(_0x75a2('0x5d'));exports[_0x75a2('0x77')]=function(_0x57f626,_0x4ce25f,_0x498de1){var _0x2e232b={'agent':{},'channel':_0x75a2('0x5f')};if(_0x57f626[_0x75a2('0x5b')]['id']){delete _0x57f626['body']['id'];}_0x57f626[_0x75a2('0x5b')][_0x75a2('0x67')]=_0x57f626[_0x75a2('0x5b')][_0x75a2('0x67')]||_0x57f626[_0x75a2('0x63')]['id'];_0x2e232b[_0x75a2('0x78')]['id']=_0x57f626[_0x75a2('0x5b')][_0x75a2('0x67')];return db[_0x75a2('0x51')][_0x75a2('0x59')]({'where':{'id':_0x57f626[_0x75a2('0x56')]['id'],'UserId':null}})[_0x75a2('0x23')](handleEntityNotFound(_0x4ce25f,null))['then'](function(_0x21cf94){if(_0x21cf94){_0x2e232b[_0x75a2('0x2a')]=_0x21cf94[_0x75a2('0x65')]({'plain':!![]});return db[_0x75a2('0x66')][_0x75a2('0x59')]({'where':{'id':_0x21cf94['OpenchannelInteractionId']}});}return null;})[_0x75a2('0x23')](handleEntityNotFound(_0x4ce25f,null))['then'](function(_0x44b523){if(_0x44b523){_0x2e232b['interaction']=_0x44b523[_0x75a2('0x65')]({'plain':!![]});interaction_log[_0x75a2('0x24')](_0x75a2('0x79'),_0x57f626[_0x75a2('0x63')]['id'],_0x57f626[_0x75a2('0x63')][_0x75a2('0x3a')],_0x57f626['user']['role'],_0x2e232b['interaction']['id'],_0x57f626[_0x75a2('0x5b')]?JSON[_0x75a2('0x7a')](_0x57f626[_0x75a2('0x5b')]):_0x75a2('0x6d'));return respondWithRpcPromise('RejectMessage',_0x75a2('0x7b'),_0x2e232b);}return null;})[_0x75a2('0x23')](function(_0x54aff1){if(_0x54aff1){_0x54aff1[_0x75a2('0x2a')][_0x75a2('0x70')]=util['format'](_0x75a2('0x72'),_0x57f626[_0x75a2('0x63')][_0x75a2('0x3a')]);_0x54aff1[_0x75a2('0x2a')][_0x75a2('0x73')]=_0x2e232b[_0x75a2('0x73')];_0x54aff1[_0x75a2('0x2a')][_0x75a2('0x74')]='reject';respondWithRpcPromise(_0x75a2('0x75'),_0x75a2('0x75'),{'event':_0x75a2('0x7c'),'message':_0x54aff1[_0x75a2('0x2a')]},client9002);return _0x2e232b;}return null;})['then'](respondWithResult(_0x4ce25f,null))[_0x75a2('0x2c')](handleError(_0x4ce25f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 34ad49a..1025ed3 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 _0x042a=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit'];(function(_0x4e0416,_0x589c3e){var _0x5312ca=function(_0x227bc6){while(--_0x227bc6){_0x4e0416['push'](_0x4e0416['shift']());}};_0x5312ca(++_0x589c3e);}(_0x042a,0x1ce));var _0xa042=function(_0x4b9f48,_0x3a590f){_0x4b9f48=_0x4b9f48-0x0;var _0x2a775c=_0x042a[_0x4b9f48];return _0x2a775c;};'use strict';var EventEmitter=require(_0xa042('0x0'));var OpenchannelMessage=require(_0xa042('0x1'))['db'][_0xa042('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa042('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa042('0x4'),'afterDestroy':_0xa042('0x5')};function emitEvent(_0x17ac2e){return function(_0x40a60b,_0x533ddc,_0x271807){OpenchannelMessageEvents['emit'](_0x17ac2e+':'+_0x40a60b['id'],_0x40a60b);OpenchannelMessageEvents[_0xa042('0x6')](_0x17ac2e,_0x40a60b);_0x271807(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xb9b8=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x438492,_0x1ba727){var _0x512a06=function(_0x492260){while(--_0x492260){_0x438492['push'](_0x438492['shift']());}};_0x512a06(++_0x1ba727);}(_0xb9b8,0x1d0));var _0x8b9b=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0xb9b8[_0xa3c06b];return _0x33aa1d;};'use strict';var EventEmitter=require(_0x8b9b('0x0'));var OpenchannelMessage=require(_0x8b9b('0x1'))['db'][_0x8b9b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8b9b('0x3')](0x0);var events={'afterCreate':_0x8b9b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ce1ef){return function(_0x42a67f,_0x30f164,_0x56a317){OpenchannelMessageEvents['emit'](_0x1ce1ef+':'+_0x42a67f['id'],_0x42a67f);OpenchannelMessageEvents[_0x8b9b('0x5')](_0x1ce1ef,_0x42a67f);_0x56a317(null);};}for(var e in events){if(events[_0x8b9b('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x8b9b('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3e05be9..6d37d54 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 _0xb4e6=['fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','error','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','openchannel_messages'];(function(_0x2d4587,_0x1bb2b6){var _0x2d657a=function(_0x21bb6e){while(--_0x21bb6e){_0x2d4587['push'](_0x2d4587['shift']());}};_0x2d657a(++_0x1bb2b6);}(_0xb4e6,0x19c));var _0x6b4e=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0xb4e6[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x6b4e('0x0'));var util=require(_0x6b4e('0x1'));var logger=require(_0x6b4e('0x2'))(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var rp=require(_0x6b4e('0x6'));var fs=require('fs');var path=require(_0x6b4e('0x7'));var rimraf=require(_0x6b4e('0x8'));var config=require(_0x6b4e('0x9'));var attributes=require(_0x6b4e('0xa'));module['exports']=function(_0x22b0fd,_0x254098){return _0x22b0fd['define']('OpenchannelMessage',attributes,{'tableName':_0x6b4e('0xb'),'paranoid':![],'indexes':[{'name':_0x6b4e('0xc'),'fields':[_0x6b4e('0xd')],'type':_0x6b4e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33bb35,_0x226fbd,_0x189d28){var _0x378bf1=_0x22b0fd[_0x6b4e('0xf')];var _0x28dc0f=_0x33bb35[_0x6b4e('0x10')]({'plain':!![]});if(_0x28dc0f[_0x6b4e('0x11')][_0x6b4e('0x12')]()==='in'||_0x28dc0f['direction'][_0x6b4e('0x12')]()===_0x6b4e('0x13')&&!_0x28dc0f[_0x6b4e('0x14')]&&!_[_0x6b4e('0x15')](_0x28dc0f[_0x6b4e('0x16')])){_0x378bf1[_0x6b4e('0x17')][_0x6b4e('0x18')]({'where':{'id':_0x28dc0f[_0x6b4e('0x19')]}})[_0x6b4e('0x1a')](function(_0x4ecf4c){if(_0x4ecf4c){_0x4ecf4c[_0x6b4e('0x1b')]({'lastMsgAt':_0x28dc0f[_0x6b4e('0x1c')],'lastMsgDirection':_0x28dc0f[_0x6b4e('0x11')][_0x6b4e('0x12')]()});}})['catch'](function(_0x142041){console['error'](_0x142041);});}if(_0x28dc0f[_0x6b4e('0x11')]===_0x6b4e('0x13')&&!_0x28dc0f[_0x6b4e('0x14')]){var _0x39b5e8;_0x378bf1[_0x6b4e('0x1d')][_0x6b4e('0x1e')]()[_0x6b4e('0x1a')](function(_0x5aa717){return _0x378bf1[_0x6b4e('0x1f')][_0x6b4e('0x20')]({'where':{'id':_0x28dc0f[_0x6b4e('0x21')]},'include':[{'model':_0x378bf1[_0x6b4e('0x17')],'as':_0x6b4e('0x22'),'where':{'id':_0x28dc0f[_0x6b4e('0x19')]},'limit':0x1,'include':[{'model':_0x378bf1[_0x6b4e('0x1d')],'as':_0x6b4e('0x23'),'attributes':_[_0x6b4e('0x24')](_0x5aa717)}]}]});})[_0x6b4e('0x1a')](function(_0x1cc970){_0x39b5e8=_0x1cc970['get']({'plain':!![]});if(_0x39b5e8&&_0x39b5e8[_0x6b4e('0x25')]){logger[_0x6b4e('0x26')](_0x6b4e('0x27'),_0x6b4e('0x28'),util[_0x6b4e('0x29')](_0x6b4e('0x2a'),_0x28dc0f['id'],_0x39b5e8[_0x6b4e('0x25')]));if(_0x39b5e8['Interactions']&&_0x39b5e8['Interactions']['length']){_0x28dc0f[_0x6b4e('0x2b')]=_['omit'](_0x39b5e8[_0x6b4e('0x22')][0x0],_0x6b4e('0x23'));_0x28dc0f[_0x6b4e('0x23')]=_0x39b5e8[_0x6b4e('0x22')][0x0][_0x6b4e('0x23')];}var _0x226fbd={'method':'POST','uri':encodeURI(_0x39b5e8[_0x6b4e('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x226fbd[_0x6b4e('0x2c')]){case _0x6b4e('0x2d'):_0x226fbd['qs']=_0x28dc0f;break;case _0x6b4e('0x2e'):_0x226fbd[_0x6b4e('0xd')]=_0x28dc0f;break;}return rp(_0x226fbd)['then'](function(_0xcef703){logger['info'](_0x6b4e('0x27'),_0x6b4e('0x28'),util['format'](_0x6b4e('0x2f'),_0x28dc0f['id'],_0x39b5e8[_0x6b4e('0x25')]));if(_0xcef703[_0x6b4e('0xd')][_0x6b4e('0x30')]&&_0xcef703[_0x6b4e('0xd')][_0x6b4e('0x30')]!=_0x28dc0f[_0x6b4e('0x2b')]['threadId']){return _0x378bf1['OpenchannelInteraction'][_0x6b4e('0x1b')]({'threadId':_0xcef703['body'][_0x6b4e('0x30')]},{'logging':!![],'where':{'id':_0x28dc0f['Interaction']['id']}});}else{return;}})[_0x6b4e('0x1a')](function(){return _0x33bb35[_0x6b4e('0x1b')]({'read':!![]});})[_0x6b4e('0x31')](function(_0x1d6898){logger[_0x6b4e('0x32')](_0x6b4e('0x27'),_0x6b4e('0x28'),util[_0x6b4e('0x33')](_0x1d6898,{'showHidden':![],'depth':null}));_0x189d28();});}else{_0x189d28();}})['finally'](function(){_0x189d28();});}else{_0x189d28();}}},'charset':'utf8mb4','collate':_0x6b4e('0x34')});}; \ No newline at end of file +var _0x07d8=['UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','length','Interaction','omit','Contact','POST','afterCreate','threadId','inspect','finally','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','body','models','get','toLowerCase','direction','out','secret'];(function(_0x255e38,_0x2efa62){var _0x267d2a=function(_0x1ad9ca){while(--_0x1ad9ca){_0x255e38['push'](_0x255e38['shift']());}};_0x267d2a(++_0x2efa62);}(_0x07d8,0x1c3));var _0x807d=function(_0xe2ae2b,_0x48d240){_0xe2ae2b=_0xe2ae2b-0x0;var _0xa5cac5=_0x07d8[_0xe2ae2b];return _0xa5cac5;};'use strict';var _=require(_0x807d('0x0'));var util=require(_0x807d('0x1'));var logger=require(_0x807d('0x2'))(_0x807d('0x3'));var moment=require('moment');var BPromise=require(_0x807d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x807d('0x5'));var rimraf=require(_0x807d('0x6'));var config=require(_0x807d('0x7'));var attributes=require(_0x807d('0x8'));module[_0x807d('0x9')]=function(_0x2f4050,_0x428014){return _0x2f4050[_0x807d('0xa')](_0x807d('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x807d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a4f25,_0x500726,_0x260e70){var _0x29d9c5=_0x2f4050[_0x807d('0xd')];var _0x497fe0=_0x3a4f25[_0x807d('0xe')]({'plain':!![]});if(_0x497fe0['direction'][_0x807d('0xf')]()==='in'||_0x497fe0[_0x807d('0x10')][_0x807d('0xf')]()===_0x807d('0x11')&&!_0x497fe0[_0x807d('0x12')]&&!_['isNil'](_0x497fe0[_0x807d('0x13')])){_0x29d9c5[_0x807d('0x14')]['findOne']({'where':{'id':_0x497fe0[_0x807d('0x15')]}})[_0x807d('0x16')](function(_0x54f7a8){if(_0x54f7a8){_0x54f7a8[_0x807d('0x17')]({'lastMsgAt':_0x497fe0[_0x807d('0x18')],'lastMsgDirection':_0x497fe0[_0x807d('0x10')][_0x807d('0xf')]()});}})[_0x807d('0x19')](function(_0x5c892b){console[_0x807d('0x1a')](_0x5c892b);});}if(_0x497fe0[_0x807d('0x10')]===_0x807d('0x11')&&!_0x497fe0[_0x807d('0x12')]){var _0x452976;_0x29d9c5['CmContact'][_0x807d('0x1b')]()[_0x807d('0x16')](function(_0x437b44){return _0x29d9c5[_0x807d('0x1c')][_0x807d('0x1d')]({'where':{'id':_0x497fe0[_0x807d('0x1e')]},'include':[{'model':_0x29d9c5[_0x807d('0x14')],'as':_0x807d('0x1f'),'where':{'id':_0x497fe0[_0x807d('0x15')]},'limit':0x1,'include':[{'model':_0x29d9c5[_0x807d('0x20')],'as':'Contact','attributes':_[_0x807d('0x21')](_0x437b44)}]}]});})['then'](function(_0x2c5913){_0x452976=_0x2c5913[_0x807d('0xe')]({'plain':!![]});if(_0x452976&&_0x452976[_0x807d('0x22')]){logger[_0x807d('0x23')](_0x807d('0x24'),'afterCreate',util[_0x807d('0x25')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x497fe0['id'],_0x452976[_0x807d('0x22')]));if(_0x452976[_0x807d('0x1f')]&&_0x452976[_0x807d('0x1f')][_0x807d('0x26')]){_0x497fe0[_0x807d('0x27')]=_[_0x807d('0x28')](_0x452976[_0x807d('0x1f')][0x0],_0x807d('0x29'));_0x497fe0['Contact']=_0x452976[_0x807d('0x1f')][0x0][_0x807d('0x29')];}var _0x500726={'method':_0x807d('0x2a'),'uri':encodeURI(_0x452976[_0x807d('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x500726['method']){case'GET':_0x500726['qs']=_0x497fe0;break;case _0x807d('0x2a'):_0x500726['body']=_0x497fe0;break;}return rp(_0x500726)[_0x807d('0x16')](function(_0x2fa892){logger[_0x807d('0x23')](_0x807d('0x24'),_0x807d('0x2b'),util[_0x807d('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x497fe0['id'],_0x452976[_0x807d('0x22')]));if(_0x2fa892[_0x807d('0xc')][_0x807d('0x2c')]&&_0x2fa892[_0x807d('0xc')]['threadId']!=_0x497fe0[_0x807d('0x27')]['threadId']){return _0x29d9c5[_0x807d('0x14')][_0x807d('0x17')]({'threadId':_0x2fa892[_0x807d('0xc')][_0x807d('0x2c')]},{'logging':!![],'where':{'id':_0x497fe0[_0x807d('0x27')]['id']}});}else{return;}})[_0x807d('0x16')](function(){return _0x3a4f25[_0x807d('0x17')]({'read':!![]});})[_0x807d('0x19')](function(_0x1c152c){logger['error'](_0x807d('0x24'),_0x807d('0x2b'),util[_0x807d('0x2d')](_0x1c152c,{'showHidden':![],'depth':null}));_0x260e70();});}else{_0x260e70();}})[_0x807d('0x2e')](function(){_0x260e70();});}else{_0x260e70();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 012ca7b..5c37352 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 _0x7c9d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x7c9d,0x9b));var _0xd7c9=function(_0x1423ec,_0x22ee7e){_0x1423ec=_0x1423ec-0x0;var _0x5abbda=_0x7c9d[_0x1423ec];return _0x5abbda;};'use strict';var _=require(_0xd7c9('0x0'));var util=require(_0xd7c9('0x1'));var moment=require(_0xd7c9('0x2'));var BPromise=require(_0xd7c9('0x3'));var rs=require(_0xd7c9('0x4'));var fs=require('fs');var Redis=require(_0xd7c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7c9('0x6'));var logger=require(_0xd7c9('0x7'))(_0xd7c9('0x8'));var config=require(_0xd7c9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7c9('0xa')]({'port':0x232a});config[_0xd7c9('0xb')]=_[_0xd7c9('0xc')](config[_0xd7c9('0xb')],{'host':_0xd7c9('0xd'),'port':0x18eb});var socket=require(_0xd7c9('0xe'))(new Redis(config[_0xd7c9('0xb')]));require(_0xd7c9('0xf'))[_0xd7c9('0x10')](socket);function respondWithRpcPromise(_0xd732e4,_0xeb5604,_0x478d41){return new BPromise(function(_0x445164,_0x18614a){return client[_0xd7c9('0x11')](_0xd732e4,_0x478d41)[_0xd7c9('0x12')](function(_0x5df6ec){logger[_0xd7c9('0x13')](_0xd7c9('0x14'),_0xeb5604,'request\x20sent');logger[_0xd7c9('0x15')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xeb5604,'request\x20sent',JSON[_0xd7c9('0x16')](_0x5df6ec));if(_0x5df6ec[_0xd7c9('0x17')]){if(_0x5df6ec[_0xd7c9('0x17')]['code']===0x1f4){logger[_0xd7c9('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xeb5604,_0x5df6ec[_0xd7c9('0x17')][_0xd7c9('0x18')]);return _0x18614a(_0x5df6ec[_0xd7c9('0x17')][_0xd7c9('0x18')]);}logger[_0xd7c9('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xeb5604,_0x5df6ec['error']['message']);return _0x445164(_0x5df6ec[_0xd7c9('0x17')][_0xd7c9('0x18')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xeb5604,_0xd7c9('0x19'));_0x445164(_0x5df6ec['result']['message']);}})[_0xd7c9('0x1a')](function(_0x423d64){logger[_0xd7c9('0x17')](_0xd7c9('0x14'),_0xeb5604,_0x423d64);_0x18614a(_0x423d64);});});}exports[_0xd7c9('0x1b')]=function(_0x1b2a95){var _0x166982=this;return new Promise(function(_0x306441,_0x509c00){return db[_0xd7c9('0x1c')]['create'](_0x1b2a95[_0xd7c9('0x1d')],{'raw':_0x1b2a95[_0xd7c9('0x1e')]?_0x1b2a95['options'][_0xd7c9('0x1f')]===undefined?!![]:![]:!![]})[_0xd7c9('0x12')](function(_0x2ec835){logger[_0xd7c9('0x13')]('CreateOpenchannelMessage',_0x1b2a95);logger[_0xd7c9('0x15')]('CreateOpenchannelMessage',_0x1b2a95,JSON[_0xd7c9('0x16')](_0x2ec835));_0x306441(_0x2ec835);})[_0xd7c9('0x1a')](function(_0x58ef22){logger[_0xd7c9('0x17')](_0xd7c9('0x1b'),_0x58ef22[_0xd7c9('0x18')],_0x1b2a95);_0x509c00(_0x166982['error'](0x1f4,_0x58ef22[_0xd7c9('0x18')]));});});}; \ No newline at end of file +var _0x988c=['create','body','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x988c,0xca));var _0xc988=function(_0x3a5e6f,_0x5286ac){_0x3a5e6f=_0x3a5e6f-0x0;var _0xc6dd35=_0x988c[_0x3a5e6f];return _0xc6dd35;};'use strict';var _=require(_0xc988('0x0'));var util=require(_0xc988('0x1'));var moment=require('moment');var BPromise=require(_0xc988('0x2'));var rs=require(_0xc988('0x3'));var fs=require('fs');var Redis=require(_0xc988('0x4'));var db=require(_0xc988('0x5'))['db'];var utils=require(_0xc988('0x6'));var logger=require('../../config/logger')(_0xc988('0x7'));var config=require(_0xc988('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc988('0x9')]['http']({'port':0x232a});config[_0xc988('0xa')]=_[_0xc988('0xb')](config[_0xc988('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc988('0xc'))(new Redis(config[_0xc988('0xa')]));require(_0xc988('0xd'))[_0xc988('0xe')](socket);function respondWithRpcPromise(_0x2caf68,_0x2bee04,_0x481ba6){return new BPromise(function(_0x58e0ae,_0x22c96d){return client[_0xc988('0xf')](_0x2caf68,_0x481ba6)['then'](function(_0x1fb73b){logger[_0xc988('0x10')](_0xc988('0x11'),_0x2bee04,_0xc988('0x12'));logger[_0xc988('0x13')](_0xc988('0x14'),_0x2bee04,'request\x20sent',JSON[_0xc988('0x15')](_0x1fb73b));if(_0x1fb73b[_0xc988('0x16')]){if(_0x1fb73b[_0xc988('0x16')][_0xc988('0x17')]===0x1f4){logger[_0xc988('0x16')](_0xc988('0x11'),_0x2bee04,_0x1fb73b[_0xc988('0x16')][_0xc988('0x18')]);return _0x22c96d(_0x1fb73b[_0xc988('0x16')]['message']);}logger[_0xc988('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x2bee04,_0x1fb73b[_0xc988('0x16')][_0xc988('0x18')]);return _0x58e0ae(_0x1fb73b[_0xc988('0x16')][_0xc988('0x18')]);}else{logger[_0xc988('0x10')](_0xc988('0x11'),_0x2bee04,_0xc988('0x12'));_0x58e0ae(_0x1fb73b[_0xc988('0x19')]['message']);}})[_0xc988('0x1a')](function(_0x4b01fa){logger[_0xc988('0x16')](_0xc988('0x11'),_0x2bee04,_0x4b01fa);_0x22c96d(_0x4b01fa);});});}exports[_0xc988('0x1b')]=function(_0x2b102e){var _0x50b277=this;return new Promise(function(_0x199500,_0x57d134){return db[_0xc988('0x1c')][_0xc988('0x1d')](_0x2b102e[_0xc988('0x1e')],{'raw':_0x2b102e['options']?_0x2b102e['options'][_0xc988('0x1f')]===undefined?!![]:![]:!![]})[_0xc988('0x20')](function(_0x48f97f){logger[_0xc988('0x10')]('CreateOpenchannelMessage',_0x2b102e);logger['debug'](_0xc988('0x1b'),_0x2b102e,JSON[_0xc988('0x15')](_0x48f97f));_0x199500(_0x48f97f);})['catch'](function(_0x38f182){logger[_0xc988('0x16')](_0xc988('0x1b'),_0x38f182[_0xc988('0x18')],_0x2b102e);_0x57d134(_0x50b277[_0xc988('0x16')](0x1f4,_0x38f182[_0xc988('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1c44aeb..1901469 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 _0x5577=['length','openchannelMessage:','./openchannelMessage.events','remove','update','emit','removeListener'];(function(_0x39309b,_0x53da73){var _0x5ce8bc=function(_0x57ecd1){while(--_0x57ecd1){_0x39309b['push'](_0x39309b['shift']());}};_0x5ce8bc(++_0x53da73);}(_0x5577,0x1b4));var _0x7557=function(_0x79eebe,_0x2073f1){_0x79eebe=_0x79eebe-0x0;var _0x10ec34=_0x5577[_0x79eebe];return _0x10ec34;};'use strict';var OpenchannelMessageEvents=require(_0x7557('0x0'));var events=['save',_0x7557('0x1'),_0x7557('0x2')];function createListener(_0x52a8c6,_0x34636a){return function(_0x289758){_0x34636a[_0x7557('0x3')](_0x52a8c6,_0x289758);};}function removeListener(_0x3c4697,_0x1274d5){return function(){OpenchannelMessageEvents[_0x7557('0x4')](_0x3c4697,_0x1274d5);};}exports['register']=function(_0x7bb8c){for(var _0x41a4a5=0x0,_0x3da895=events[_0x7557('0x5')];_0x41a4a5<_0x3da895;_0x41a4a5++){var _0x33e9aa=events[_0x41a4a5];var _0x37f335=createListener(_0x7557('0x6')+_0x33e9aa,_0x7bb8c);OpenchannelMessageEvents['on'](_0x33e9aa,_0x37f335);}}; \ No newline at end of file +var _0x8098=['register','openchannelMessage:','remove','update','removeListener'];(function(_0xa3d443,_0x121b37){var _0x489486=function(_0x16ecd1){while(--_0x16ecd1){_0xa3d443['push'](_0xa3d443['shift']());}};_0x489486(++_0x121b37);}(_0x8098,0x1ba));var _0x8809=function(_0x5bbe2d,_0x515afe){_0x5bbe2d=_0x5bbe2d-0x0;var _0x4e1fb0=_0x8098[_0x5bbe2d];return _0x4e1fb0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x8809('0x0'),_0x8809('0x1')];function createListener(_0x4037be,_0x22f28d){return function(_0x3348e0){_0x22f28d['emit'](_0x4037be,_0x3348e0);};}function removeListener(_0x2bb438,_0x1d7425){return function(){OpenchannelMessageEvents[_0x8809('0x2')](_0x2bb438,_0x1d7425);};}exports[_0x8809('0x3')]=function(_0x5804f0){for(var _0xeb811=0x0,_0x2af39c=events['length'];_0xeb811<_0x2af39c;_0xeb811++){var _0x3f4bee=events[_0xeb811];var _0x3fd084=createListener(_0x8809('0x4')+_0x3f4bee,_0x5804f0);OpenchannelMessageEvents['on'](_0x3f4bee,_0x3fd084);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index dc93eb7..4de5e93 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 _0x218a=['get','/describe','getMembers','getTeams','post','create','/:id/teams','/:id/users','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x3d2dd0,_0x42ad7e){var _0x501d50=function(_0x396825){while(--_0x396825){_0x3d2dd0['push'](_0x3d2dd0['shift']());}};_0x501d50(++_0x42ad7e);}(_0x218a,0x1b9));var _0xa218=function(_0x1f9cd7,_0x589d40){_0x1f9cd7=_0x1f9cd7-0x0;var _0x18b9d5=_0x218a[_0x1f9cd7];return _0x18b9d5;};'use strict';var multer=require(_0xa218('0x0'));var util=require('util');var path=require(_0xa218('0x1'));var timeout=require(_0xa218('0x2'));var express=require(_0xa218('0x3'));var router=express[_0xa218('0x4')]();var auth=require(_0xa218('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa218('0x6'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0xa218('0x7')](),controller[_0xa218('0x8')]);router[_0xa218('0x9')](_0xa218('0xa'),auth[_0xa218('0x7')](),controller['describe']);router['get']('/:id',auth[_0xa218('0x7')](),controller['show']);router[_0xa218('0x9')]('/:id/members',auth[_0xa218('0x7')](),controller[_0xa218('0xb')]);router[_0xa218('0x9')]('/:id/teams',auth[_0xa218('0x7')](),controller[_0xa218('0xc')]);router[_0xa218('0x9')]('/:id/users',auth[_0xa218('0x7')](),controller['getAgents']);router[_0xa218('0xd')]('/',auth[_0xa218('0x7')](),controller[_0xa218('0xe')]);router[_0xa218('0xd')](_0xa218('0xf'),auth[_0xa218('0x7')](),controller['addTeams']);router[_0xa218('0xd')](_0xa218('0x10'),auth[_0xa218('0x7')](),controller[_0xa218('0x11')]);router[_0xa218('0x12')](_0xa218('0x13'),auth[_0xa218('0x7')](),controller[_0xa218('0x14')]);router[_0xa218('0x15')](_0xa218('0x13'),auth[_0xa218('0x7')](),controller['destroy']);router[_0xa218('0x15')](_0xa218('0xf'),auth[_0xa218('0x7')](),controller[_0xa218('0x16')]);router[_0xa218('0x15')](_0xa218('0x10'),auth['isAuthenticated'](),controller[_0xa218('0x17')]);module[_0xa218('0x18')]=router; \ No newline at end of file +var _0x245c=['/:id/members','getMembers','/:id/users','getAgents','post','create','addTeams','update','/:id/teams','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../config/environment','index','get','describe','/:id','isAuthenticated','show'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x245c,0x17c));var _0xc245=function(_0x22460e,_0x535766){_0x22460e=_0x22460e-0x0;var _0x1e16a4=_0x245c[_0x22460e];return _0x1e16a4;};'use strict';var multer=require(_0xc245('0x0'));var util=require('util');var path=require(_0xc245('0x1'));var timeout=require(_0xc245('0x2'));var express=require('express');var router=express[_0xc245('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc245('0x4'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc245('0x5')]);router[_0xc245('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xc245('0x7')]);router[_0xc245('0x6')](_0xc245('0x8'),auth[_0xc245('0x9')](),controller[_0xc245('0xa')]);router[_0xc245('0x6')](_0xc245('0xb'),auth[_0xc245('0x9')](),controller[_0xc245('0xc')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xc245('0xd'),auth[_0xc245('0x9')](),controller[_0xc245('0xe')]);router[_0xc245('0xf')]('/',auth[_0xc245('0x9')](),controller[_0xc245('0x10')]);router['post']('/:id/teams',auth[_0xc245('0x9')](),controller[_0xc245('0x11')]);router[_0xc245('0xf')](_0xc245('0xd'),auth[_0xc245('0x9')](),controller['addAgents']);router['put'](_0xc245('0x8'),auth['isAuthenticated'](),controller[_0xc245('0x12')]);router['delete'](_0xc245('0x8'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xc245('0x13'),auth[_0xc245('0x9')](),controller[_0xc245('0x14')]);router['delete'](_0xc245('0xd'),auth['isAuthenticated'](),controller[_0xc245('0x15')]);module[_0xc245('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 88a2672..1ee6ae0 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 _0x9284=['exports','STRING','name','INTEGER','beepall','roundrobin','sequelize'];(function(_0x3dd76,_0x33101b){var _0x28bf61=function(_0x4f0506){while(--_0x4f0506){_0x3dd76['push'](_0x3dd76['shift']());}};_0x28bf61(++_0x33101b);}(_0x9284,0x1bf));var _0x4928=function(_0x41fa23,_0x4887a8){_0x41fa23=_0x41fa23-0x0;var _0x1dc89b=_0x9284[_0x41fa23];return _0x1dc89b;};'use strict';var Sequelize=require(_0x4928('0x0'));module[_0x4928('0x1')]={'name':{'type':Sequelize[_0x4928('0x2')],'unique':_0x4928('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4928('0x2')]},'timeout':{'type':Sequelize[_0x4928('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4928('0x5'),_0x4928('0x6'))}}; \ No newline at end of file +var _0x6e44=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x25a0b9,_0x492ec9){var _0x505e5e=function(_0x43500){while(--_0x43500){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x505e5e(++_0x492ec9);}(_0x6e44,0x1a1));var _0x46e4=function(_0x2cb642,_0x248ad5){_0x2cb642=_0x2cb642-0x0;var _0x346dad=_0x6e44[_0x2cb642];return _0x346dad;};'use strict';var Sequelize=require(_0x46e4('0x0'));module[_0x46e4('0x1')]={'name':{'type':Sequelize[_0x46e4('0x2')],'unique':_0x46e4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x46e4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46e4('0x4')](_0x46e4('0x5'),_0x46e4('0x6'),_0x46e4('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6e698a0..3e09e2a 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 _0xa14c=['createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','teams','Team','User','online','interface','flatMap','Agents','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','emit','removeTeams','ids','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','count','offset','set','json','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','OpenchannelQueue','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','getMembers','findOne','OpenchannelQueueId','map','UserId','agent'];(function(_0x3ce989,_0x119f7a){var _0x5197bf=function(_0xc3d5ff){while(--_0xc3d5ff){_0x3ce989['push'](_0x3ce989['shift']());}};_0x5197bf(++_0x119f7a);}(_0xa14c,0xb3));var _0xca14=function(_0x479a4b,_0x1fbbb4){_0x479a4b=_0x479a4b-0x0;var _0x3f171f=_0xa14c[_0x479a4b];return _0x3f171f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xca14('0x0'));var zipdir=require(_0xca14('0x1'));var jsonpatch=require(_0xca14('0x2'));var rp=require(_0xca14('0x3'));var moment=require('moment');var BPromise=require(_0xca14('0x4'));var Mustache=require(_0xca14('0x5'));var util=require(_0xca14('0x6'));var path=require('path');var sox=require(_0xca14('0x7'));var csv=require('to-csv');var ejs=require(_0xca14('0x8'));var fs=require('fs');var _=require(_0xca14('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xca14('0xa'));var deskjs=require(_0xca14('0xb'));var toCsv=require(_0xca14('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca14('0xd'));var authService=require(_0xca14('0xe'));var qs=require(_0xca14('0xf'));var hardwareService=require(_0xca14('0x10'));var logger=require(_0xca14('0x11'))(_0xca14('0x12'));var utils=require('../../config/utils');var config=require(_0xca14('0x13'));var db=require(_0xca14('0x14'))['db'];config[_0xca14('0x15')]=_['defaults'](config[_0xca14('0x15')],{'host':_0xca14('0x16'),'port':0x18eb});var socket=require(_0xca14('0x17'))(new Redis(config[_0xca14('0x15')]));require(_0xca14('0x18'))[_0xca14('0x19')](socket);function respondWithStatusCode(_0x3d38e0,_0x7399ee){_0x7399ee=_0x7399ee||0xcc;return function(_0x53a1e8){if(_0x53a1e8){return _0x3d38e0[_0xca14('0x1a')](_0x7399ee);}return _0x3d38e0['status'](_0x7399ee)['end']();};}function respondWithResult(_0x449698,_0x24ada2){_0x24ada2=_0x24ada2||0xc8;return function(_0x5cadd0){if(_0x5cadd0){return _0x449698[_0xca14('0x1b')](_0x24ada2)['json'](_0x5cadd0);}};}function respondWithFilteredResult(_0x25e70e,_0x21a8d8){return function(_0x10d023){if(_0x10d023){var _0xa24d66=_0x10d023[_0xca14('0x1c')],_0x1431f4=_0x21a8d8['offset'],_0x5a1e75=_0x21a8d8[_0xca14('0x1d')]+_0x21a8d8['limit'],_0x5660fb;if(_0x5a1e75>=_0xa24d66){_0x5a1e75=_0xa24d66;_0x5660fb=0xc8;}else{_0x5660fb=0xce;}_0x25e70e['status'](_0x5660fb);return _0x25e70e[_0xca14('0x1e')]('Content-Range',_0x1431f4+'-'+_0x5a1e75+'/'+_0xa24d66)[_0xca14('0x1f')](_0x10d023);}return null;};}function patchUpdates(_0x1c8f73){return function(_0x3b91dd){try{jsonpatch[_0xca14('0x20')](_0x3b91dd,_0x1c8f73,!![]);}catch(_0x457dba){return BPromise[_0xca14('0x21')](_0x457dba);}return _0x3b91dd['save']();};}function saveUpdates(_0x35f1ec,_0x391cf3){return function(_0x109b22){if(_0x109b22){return _0x109b22[_0xca14('0x22')](_0x35f1ec)[_0xca14('0x23')](function(_0x1af72e){return _0x1af72e;});}return null;};}function removeEntity(_0x391e39,_0x56cc4f){return function(_0x5d93b0){if(_0x5d93b0){return _0x5d93b0[_0xca14('0x24')]()[_0xca14('0x23')](function(){var _0x4e93af=_0x5d93b0[_0xca14('0x25')]({'plain':!![]});var _0x1b5119=_0xca14('0x26');return db[_0xca14('0x27')][_0xca14('0x24')]({'where':{'type':_0x1b5119,'resourceId':_0x4e93af['id']}})[_0xca14('0x23')](function(){return _0x5d93b0;});})[_0xca14('0x23')](function(){_0x391e39[_0xca14('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83bcb4,_0x176d73){return function(_0x4527c5){if(!_0x4527c5){_0x83bcb4['sendStatus'](0x194);}return _0x4527c5;};}function handleError(_0x5e05c1,_0x5dbedd){_0x5dbedd=_0x5dbedd||0x1f4;return function(_0x3ac7f7){logger['error'](_0x3ac7f7[_0xca14('0x28')]);if(_0x3ac7f7['name']){delete _0x3ac7f7[_0xca14('0x29')];}_0x5e05c1[_0xca14('0x1b')](_0x5dbedd)[_0xca14('0x2a')](_0x3ac7f7);};}exports['index']=function(_0xb4646c,_0x31fa4f){var _0x2c4493={},_0x5086cf={},_0x57f919={'count':0x0,'rows':[]};var _0xc828e3=db[_0xca14('0x2b')]['rawAttributes'];_0x5086cf[_0xca14('0x2c')]=_[_0xca14('0x2d')](_0xc828e3);_0x5086cf[_0xca14('0x2e')]=_[_0xca14('0x2d')](_0xb4646c[_0xca14('0x2e')]);_0x5086cf['filters']=_[_0xca14('0x2f')](_0x5086cf['model'],_0x5086cf[_0xca14('0x2e')]);_0x2c4493['attributes']=_[_0xca14('0x2f')](_0x5086cf[_0xca14('0x2c')],qs[_0xca14('0x30')](_0xb4646c[_0xca14('0x2e')][_0xca14('0x30')]));_0x2c4493[_0xca14('0x31')]=_0x2c4493[_0xca14('0x31')][_0xca14('0x32')]?_0x2c4493[_0xca14('0x31')]:_0x5086cf[_0xca14('0x2c')];if(!_0xb4646c['query'][_0xca14('0x33')](_0xca14('0x34'))){_0x2c4493[_0xca14('0x35')]=qs[_0xca14('0x35')](_0xb4646c[_0xca14('0x2e')][_0xca14('0x35')]);_0x2c4493['offset']=qs[_0xca14('0x1d')](_0xb4646c[_0xca14('0x2e')]['offset']);}_0x2c4493[_0xca14('0x36')]=qs[_0xca14('0x37')](_0xb4646c[_0xca14('0x2e')][_0xca14('0x37')]);_0x2c4493['where']=qs['filters'](_[_0xca14('0x38')](_0xb4646c[_0xca14('0x2e')],_0x5086cf[_0xca14('0x39')]));if(_0xb4646c['query'][_0xca14('0x3a')]){_0x2c4493[_0xca14('0x3b')]=_['merge'](_0x2c4493[_0xca14('0x3b')],{'$or':_['map'](_0xc828e3,function(_0x2b93bf){if(_0x2b93bf[_0xca14('0x3c')]['key']!==_0xca14('0x3d')){var _0x3adb33={};_0x3adb33[_0x2b93bf[_0xca14('0x3e')]]={'$like':'%'+_0xb4646c[_0xca14('0x2e')][_0xca14('0x3a')]+'%'};return _0x3adb33;}})});}_0x2c4493=_[_0xca14('0x3f')]({},_0x2c4493,_0xb4646c[_0xca14('0x40')]);var _0x11dc9b={'where':_0x2c4493[_0xca14('0x3b')]};return db[_0xca14('0x2b')][_0xca14('0x1c')](_0x11dc9b)[_0xca14('0x23')](function(_0x590d1c){_0x57f919['count']=_0x590d1c;if(_0xb4646c[_0xca14('0x2e')][_0xca14('0x41')]){_0x2c4493[_0xca14('0x42')]=[{'all':!![]}];}return db[_0xca14('0x2b')][_0xca14('0x43')](_0x2c4493);})['then'](function(_0x3f7a8a){_0x57f919[_0xca14('0x44')]=_0x3f7a8a;return _0x57f919;})[_0xca14('0x23')](respondWithFilteredResult(_0x31fa4f,_0x2c4493))['catch'](handleError(_0x31fa4f,null));};exports[_0xca14('0x45')]=function(_0x30a862,_0x57afb0){var _0x1fdbd6={'raw':!![],'where':{'id':_0x30a862[_0xca14('0x46')]['id']}},_0x46b716={};_0x46b716[_0xca14('0x2c')]=_['keys'](db[_0xca14('0x2b')][_0xca14('0x47')]);_0x46b716[_0xca14('0x2e')]=_[_0xca14('0x2d')](_0x30a862[_0xca14('0x2e')]);_0x46b716[_0xca14('0x39')]=_[_0xca14('0x2f')](_0x46b716[_0xca14('0x2c')],_0x46b716[_0xca14('0x2e')]);_0x1fdbd6[_0xca14('0x31')]=_[_0xca14('0x2f')](_0x46b716['model'],qs[_0xca14('0x30')](_0x30a862[_0xca14('0x2e')][_0xca14('0x30')]));_0x1fdbd6[_0xca14('0x31')]=_0x1fdbd6[_0xca14('0x31')][_0xca14('0x32')]?_0x1fdbd6[_0xca14('0x31')]:_0x46b716[_0xca14('0x2c')];if(_0x30a862[_0xca14('0x2e')][_0xca14('0x41')]){_0x1fdbd6[_0xca14('0x42')]=[{'all':!![]}];}_0x1fdbd6=_[_0xca14('0x3f')]({},_0x1fdbd6,_0x30a862[_0xca14('0x40')]);return db['OpenchannelQueue'][_0xca14('0x48')](_0x1fdbd6)[_0xca14('0x23')](handleEntityNotFound(_0x57afb0,null))[_0xca14('0x23')](respondWithResult(_0x57afb0,null))['catch'](handleError(_0x57afb0,null));};exports[_0xca14('0x49')]=function(_0x554206,_0x4e1940){return db[_0xca14('0x2b')][_0xca14('0x49')](_0x554206[_0xca14('0x4a')],{})[_0xca14('0x23')](function(_0x386dee){var _0x10ece0=_0x554206[_0xca14('0x4b')][_0xca14('0x25')]({'plain':!![]});if(!_0x10ece0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10ece0['role']===_0xca14('0x4b')){var _0x5d5c98=_0x386dee[_0xca14('0x25')]({'plain':!![]});var _0x44e0d5='OpenchannelQueues';return db['UserProfileSection'][_0xca14('0x48')]({'where':{'name':_0x44e0d5,'userProfileId':_0x10ece0[_0xca14('0x4c')]},'raw':!![]})[_0xca14('0x23')](function(_0x817b6f){if(_0x817b6f&&_0x817b6f[_0xca14('0x4d')]===0x0){return db[_0xca14('0x27')]['create']({'name':_0x5d5c98[_0xca14('0x29')],'resourceId':_0x5d5c98['id'],'type':_0x817b6f[_0xca14('0x29')],'sectionId':_0x817b6f['id']},{})['then'](function(){return _0x386dee;});}else{return _0x386dee;}})['catch'](function(_0x1aad15){logger['error'](_0xca14('0x4e'),_0x1aad15);throw _0x1aad15;});}return _0x386dee;})['then'](respondWithResult(_0x4e1940,0xc9))[_0xca14('0x4f')](handleError(_0x4e1940,null));};exports[_0xca14('0x22')]=function(_0x2d60b,_0x51c898){if(_0x2d60b[_0xca14('0x4a')]['id']){delete _0x2d60b[_0xca14('0x4a')]['id'];}return db[_0xca14('0x2b')][_0xca14('0x48')]({'where':{'id':_0x2d60b['params']['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x51c898,null))[_0xca14('0x23')](saveUpdates(_0x2d60b['body'],null))[_0xca14('0x23')](respondWithResult(_0x51c898,null))['catch'](handleError(_0x51c898,null));};exports[_0xca14('0x24')]=function(_0x4c4895,_0x29f7de){return db[_0xca14('0x2b')]['find']({'where':{'id':_0x4c4895[_0xca14('0x46')]['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x29f7de,null))['then'](removeEntity(_0x29f7de,null))[_0xca14('0x4f')](handleError(_0x29f7de,null));};exports[_0xca14('0x50')]=function(_0x3e6ae6,_0x3d9eae){return db[_0xca14('0x2b')][_0xca14('0x50')]()[_0xca14('0x23')](respondWithResult(_0x3d9eae,null))['catch'](handleError(_0x3d9eae,null));};exports[_0xca14('0x51')]=function(_0x5688cd,_0x2b6731,_0x5d5598){var _0x3a1ec3={'raw':!![],'where':{}},_0x4eb7c4={},_0x1565e1;return db[_0xca14('0x2b')][_0xca14('0x52')]({'where':{'id':_0x5688cd[_0xca14('0x46')]['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x2b6731,null))[_0xca14('0x23')](function(_0x3f478c){if(_0x3f478c){_0x1565e1=_0x3f478c[_0xca14('0x25')]({'plain':!![]});_0x4eb7c4[_0xca14('0x2c')]=_[_0xca14('0x2d')](db['UserOpenchannelQueue'][_0xca14('0x47')]);_0x4eb7c4[_0xca14('0x2e')]=_[_0xca14('0x2d')](_0x5688cd[_0xca14('0x2e')]);_0x4eb7c4[_0xca14('0x39')]=_[_0xca14('0x2f')](_0x4eb7c4[_0xca14('0x2c')],_0x4eb7c4[_0xca14('0x2e')]);_0x3a1ec3['attributes']=_['intersection'](_0x4eb7c4[_0xca14('0x2c')],qs[_0xca14('0x30')](_0x5688cd[_0xca14('0x2e')][_0xca14('0x30')]));_0x3a1ec3[_0xca14('0x31')]=_0x3a1ec3[_0xca14('0x31')]['length']?_0x3a1ec3[_0xca14('0x31')]:_0x4eb7c4['model'];if(!_0x5688cd[_0xca14('0x2e')][_0xca14('0x33')](_0xca14('0x34'))){_0x3a1ec3['limit']=qs['limit'](_0x5688cd[_0xca14('0x2e')][_0xca14('0x35')]);_0x3a1ec3[_0xca14('0x1d')]=qs[_0xca14('0x1d')](_0x5688cd['query'][_0xca14('0x1d')]);}_0x3a1ec3[_0xca14('0x36')]=qs[_0xca14('0x37')](_0x5688cd['query'][_0xca14('0x37')]);_0x3a1ec3[_0xca14('0x3b')]=qs[_0xca14('0x39')](_[_0xca14('0x38')](_0x5688cd[_0xca14('0x2e')],_0x4eb7c4[_0xca14('0x39')]));_0x3a1ec3['where'][_0xca14('0x53')]=_0x3f478c['id'];if(_0x5688cd['query']['filter']){_0x3a1ec3[_0xca14('0x3b')]=_[_0xca14('0x3f')](_0x3a1ec3[_0xca14('0x3b')],{'$or':_[_0xca14('0x54')](_0x3a1ec3[_0xca14('0x31')],function(_0x364ae7){var _0x48fc31={};_0x48fc31[_0x364ae7]={'$like':'%'+_0x5688cd['query']['filter']+'%'};return _0x48fc31;})});}_0x3a1ec3=_[_0xca14('0x3f')]({},_0x3a1ec3,_0x5688cd[_0xca14('0x40')]);return db['UserOpenchannelQueue']['findAll'](_0x3a1ec3);}})['then'](function(_0xfa9b5){if(_0xfa9b5){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0xfa9b5,_0xca14('0x55')),'role':_0xca14('0x56')},'attributes':['id',_0xca14('0x29'),'openchannelPause','updatedAt',_0xca14('0x57')]});}})['then'](function(_0x3429a7){if(_0x3429a7){return{'count':_0x3429a7[_0xca14('0x1c')],'rows':_['map'](_0x3429a7['rows'],function(_0x2773cc){return{'membername':_0x2773cc[_0xca14('0x29')],'UserId':_0x2773cc['id'],'queue_name':_0x1565e1['name'],'OpenchannelQueueId':_0x1565e1['id'],'interface':util[_0xca14('0x58')](_0xca14('0x59'),_0xca14('0x5a'),_0x2773cc[_0xca14('0x29')]),'penalty':0x0,'paused':_0x2773cc['openchannelPause'],'createdAt':_0x2773cc[_0xca14('0x57')],'updatedAt':_0x2773cc[_0xca14('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xca14('0x23')](respondWithFilteredResult(_0x2b6731,_0x3a1ec3))['catch'](handleError(_0x2b6731,null));};exports[_0xca14('0x5c')]=function(_0x141dbd,_0x326067,_0x29d6b1){var _0x49c04a={};var _0x2e48c8={};var _0x345ca7;var _0x252834;return db[_0xca14('0x2b')][_0xca14('0x52')]({'where':{'id':_0x141dbd['params']['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x326067,null))[_0xca14('0x23')](function(_0x238a81){if(_0x238a81){_0x345ca7=_0x238a81;_0x2e48c8[_0xca14('0x2c')]=_[_0xca14('0x2d')](db['Team'][_0xca14('0x47')]);_0x2e48c8[_0xca14('0x2e')]=_[_0xca14('0x2d')](_0x141dbd[_0xca14('0x2e')]);_0x2e48c8[_0xca14('0x39')]=_[_0xca14('0x2f')](_0x2e48c8[_0xca14('0x2c')],_0x2e48c8[_0xca14('0x2e')]);_0x49c04a[_0xca14('0x31')]=_[_0xca14('0x2f')](_0x2e48c8[_0xca14('0x2c')],qs[_0xca14('0x30')](_0x141dbd[_0xca14('0x2e')][_0xca14('0x30')]));_0x49c04a[_0xca14('0x31')]=_0x49c04a[_0xca14('0x31')]['length']?_0x49c04a['attributes']:_0x2e48c8['model'];_0x49c04a['order']=qs[_0xca14('0x37')](_0x141dbd[_0xca14('0x2e')][_0xca14('0x37')]);_0x49c04a[_0xca14('0x3b')]=qs[_0xca14('0x39')](_[_0xca14('0x38')](_0x141dbd['query'],_0x2e48c8[_0xca14('0x39')]));if(_0x141dbd['query']['filter']){_0x49c04a[_0xca14('0x3b')]=_[_0xca14('0x3f')](_0x49c04a[_0xca14('0x3b')],{'$or':_[_0xca14('0x54')](_0x49c04a['attributes'],function(_0x1c4f38){var _0x1329b2={};_0x1329b2[_0x1c4f38]={'$like':'%'+_0x141dbd[_0xca14('0x2e')]['filter']+'%'};return _0x1329b2;})});}_0x49c04a=_[_0xca14('0x3f')]({},_0x49c04a,_0x141dbd[_0xca14('0x40')]);return _0x345ca7[_0xca14('0x5c')](_0x49c04a);}})['then'](function(_0x232325){if(_0x232325){_0x252834=_0x232325[_0xca14('0x32')];if(!_0x141dbd[_0xca14('0x2e')]['hasOwnProperty']('nolimit')){_0x49c04a[_0xca14('0x35')]=qs[_0xca14('0x35')](_0x141dbd[_0xca14('0x2e')][_0xca14('0x35')]);_0x49c04a['offset']=qs[_0xca14('0x1d')](_0x141dbd[_0xca14('0x2e')]['offset']);}return _0x345ca7[_0xca14('0x5c')](_0x49c04a);}})[_0xca14('0x23')](function(_0x2ccbd4){if(_0x2ccbd4){return _0x2ccbd4?{'count':_0x252834,'rows':_0x2ccbd4}:null;}})['then'](respondWithResult(_0x326067,null))[_0xca14('0x4f')](handleError(_0x326067,null));};exports[_0xca14('0x5d')]=function(_0xa5a8c7,_0x5653b7,_0x52e594){var _0x4444e8=_0xa5a8c7['body'][_0xca14('0x5e')];return db[_0xca14('0x5f')][_0xca14('0x43')]({'where':{'id':_[_0xca14('0x54')](_0x4444e8,'id')},'attributes':['id'],'include':[{'model':db[_0xca14('0x60')],'as':'Agents','attributes':['id',_0xca14('0x29'),_0xca14('0x61'),'voicePause',_0xca14('0x62')],'raw':!![]}]})[_0xca14('0x23')](function(_0x4cac56){if(_0x4cac56){var _0x290963=_[_0xca14('0x63')](_0x4cac56,function(_0x4f2767){var _0x531529=_0x4f2767[_0xca14('0x25')]({'plain':!![]});return _0x531529[_0xca14('0x64')];});return db[_0xca14('0x2b')][_0xca14('0x48')]({'where':{'id':_0xa5a8c7[_0xca14('0x46')]['id']}})['then'](function(_0x304c03){return db[_0xca14('0x65')][_0xca14('0x66')](function(_0x2e0a03){return _0x304c03[_0xca14('0x5d')](_[_0xca14('0x54')](_0x4444e8,'id'),{'transaction':_0x2e0a03})['then'](function(){return BPromise[_0xca14('0x67')](_0x290963,function(_0xa03d5f){return db[_0xca14('0x68')][_0xca14('0x69')]({'where':{'UserId':_0xa03d5f['id'],'OpenchannelQueueId':_0xa5a8c7[_0xca14('0x46')]['id']},'transaction':_0x2e0a03});});})[_0xca14('0x23')](function(){_0x290963['forEach'](function(_0x35e64c){socket[_0xca14('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x35e64c['id'],'OpenchannelQueueId':_0x304c03['id']});});});});});}})[_0xca14('0x23')](respondWithStatusCode(_0x5653b7,null))['catch'](handleError(_0x5653b7,null));};exports[_0xca14('0x6b')]=function(_0x57ff56,_0x30bc1d,_0x5229d3){return db[_0xca14('0x5f')]['findAll']({'where':{'id':_0x57ff56[_0xca14('0x2e')][_0xca14('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xca14('0x60')],'as':_0xca14('0x64'),'attributes':['id'],'raw':!![]}]})[_0xca14('0x23')](handleEntityNotFound(_0x30bc1d,null))[_0xca14('0x23')](function(_0x54fec9){var _0x3deaff=_[_0xca14('0x54')](_0x54fec9,'id');var _0x2824c9=[];var _0x16bab5=[];var _0x32b443=squel['select']();_0x32b443['field'](_0xca14('0x6d'))[_0xca14('0x6e')](_0xca14('0x6f'),'tq')[_0xca14('0x70')](_0xca14('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xca14('0x3b')]('OpenchannelQueueId\x20=\x20?',_0x57ff56[_0xca14('0x46')]['id']);for(var _0x2099b8=0x0;_0x2099b8<_0x54fec9[_0xca14('0x32')];_0x2099b8+=0x1){let _0x516138=_0x54fec9[_0x2099b8];for(var _0x3bf6eb=0x0;_0x3bf6eb<_0x516138[_0xca14('0x64')][_0xca14('0x32')];_0x3bf6eb+=0x1){let _0x49016b=_0x516138[_0xca14('0x64')][_0x3bf6eb];var _0x59972a=_0x32b443[_0xca14('0x72')]();_0x59972a['where'](_0xca14('0x73'),_0x49016b['id']);_0x16bab5[_0xca14('0x74')](db[_0xca14('0x65')][_0xca14('0x2e')](_0x59972a[_0xca14('0x75')](),{'type':db[_0xca14('0x65')][_0xca14('0x76')]['SELECT']})[_0xca14('0x23')](function(_0x23d13a){if(_0x23d13a[_0xca14('0x32')]===0x1){return _0x49016b['id'];}else{var _0x378713=_['every'](_[_0xca14('0x54')](_0x23d13a,_0xca14('0x77')),function(_0x4c564d){return _[_0xca14('0x78')](_0x3deaff,_0x4c564d);});if(_0x378713){return _0x49016b['id'];}}}));}}return BPromise['all'](_0x16bab5)[_0xca14('0x23')](function(_0x10d24c){_0x2824c9=_(_0x2824c9)[_0xca14('0x79')](_0x10d24c)[_0xca14('0x7a')]()[_0xca14('0x7b')]();return db[_0xca14('0x2b')]['find']({'where':{'id':_0x57ff56[_0xca14('0x46')]['id']}})[_0xca14('0x23')](function(_0x418ff1){return db[_0xca14('0x65')]['transaction'](function(_0x4a3197){return _0x418ff1[_0xca14('0x6b')](_0x57ff56[_0xca14('0x2e')]['ids'],{'transaction':_0x4a3197})[_0xca14('0x23')](function(){if(!_[_0xca14('0x7c')](_0x2824c9)){return _0x418ff1[_0xca14('0x7d')](_0x2824c9,{'transaction':_0x4a3197});}})['then'](function(){_0x2824c9[_0xca14('0x7e')](function(_0x1fac69){socket[_0xca14('0x6a')]('userOpenchannelQueue:remove',{'UserId':_0x1fac69,'OpenchannelQueueId':_0x418ff1['id']});});});});});});})['then'](respondWithStatusCode(_0x30bc1d,null))['catch'](handleError(_0x30bc1d,null));};exports[_0xca14('0x7f')]=function(_0x3739c9,_0x9d2441,_0x31430f){return db['OpenchannelQueue'][_0xca14('0x48')]({'where':{'id':_0x3739c9[_0xca14('0x46')]['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x9d2441,null))[_0xca14('0x23')](function(_0x5ec2bb){if(_0x5ec2bb){return _0x5ec2bb[_0xca14('0x7f')](_0x3739c9['body'][_0xca14('0x6c')],_[_0xca14('0x80')](_0x3739c9['body'],['ids','id'])||{})[_0xca14('0x81')](function(_0x496725){for(var _0x3e885d=0x0;_0x3e885d<_0x3739c9[_0xca14('0x4a')][_0xca14('0x6c')][_0xca14('0x32')];_0x3e885d+=0x1){socket[_0xca14('0x6a')](_0xca14('0x82'),{'UserId':_0x3739c9[_0xca14('0x4a')][_0xca14('0x6c')][_0x3e885d],'OpenchannelQueueId':_0x3739c9[_0xca14('0x46')]['id']});}return _0x496725;});}})['then'](respondWithResult(_0x9d2441,null))[_0xca14('0x4f')](handleError(_0x9d2441,null));};exports['removeAgents']=function(_0x360290,_0x2d8a82,_0x10b1d3){return db[_0xca14('0x2b')][_0xca14('0x48')]({'where':{'id':_0x360290[_0xca14('0x46')]['id']}})[_0xca14('0x23')](handleEntityNotFound(_0x2d8a82,null))['then'](function(_0x2ffdfe){if(_0x2ffdfe){return _0x2ffdfe['removeAgents'](_0x360290[_0xca14('0x2e')][_0xca14('0x6c')])[_0xca14('0x23')](function(){if(_['isArray'](_0x360290[_0xca14('0x2e')][_0xca14('0x6c')])){for(var _0x25cd29=0x0;_0x25cd29<_0x360290[_0xca14('0x2e')][_0xca14('0x6c')][_0xca14('0x32')];_0x25cd29+=0x1){socket[_0xca14('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x360290[_0xca14('0x2e')]['ids'][_0x25cd29]),'OpenchannelQueueId':Number(_0x360290[_0xca14('0x46')]['id'])});}}else{socket[_0xca14('0x6a')](_0xca14('0x83'),{'UserId':Number(_0x360290['query'][_0xca14('0x6c')]),'OpenchannelQueueId':Number(_0x360290[_0xca14('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x2d8a82,null))[_0xca14('0x4f')](handleError(_0x2d8a82,null));};exports[_0xca14('0x84')]=function(_0x16e368,_0xafbad8,_0x55d7ee){var _0x300f58={};var _0x4dd523={};var _0x373a29;var _0x7ed8b2;return db[_0xca14('0x2b')][_0xca14('0x52')]({'where':{'id':_0x16e368['params']['id']}})[_0xca14('0x23')](handleEntityNotFound(_0xafbad8,null))['then'](function(_0x10849b){if(_0x10849b){_0x373a29=_0x10849b;_0x4dd523[_0xca14('0x2c')]=_[_0xca14('0x2d')](db[_0xca14('0x60')]['rawAttributes']);_0x4dd523[_0xca14('0x2e')]=_[_0xca14('0x2d')](_0x16e368[_0xca14('0x2e')]);_0x4dd523[_0xca14('0x39')]=_[_0xca14('0x2f')](_0x4dd523[_0xca14('0x2c')],_0x4dd523['query']);_0x300f58[_0xca14('0x31')]=_[_0xca14('0x2f')](_0x4dd523['model'],qs[_0xca14('0x30')](_0x16e368['query'][_0xca14('0x30')]));_0x300f58[_0xca14('0x31')]=_0x300f58[_0xca14('0x31')]['length']?_0x300f58['attributes']:_0x4dd523[_0xca14('0x2c')];_0x300f58[_0xca14('0x36')]=qs[_0xca14('0x37')](_0x16e368[_0xca14('0x2e')]['sort']);_0x300f58[_0xca14('0x3b')]=qs['filters'](_[_0xca14('0x38')](_0x16e368[_0xca14('0x2e')],_0x4dd523['filters']));if(_0x16e368[_0xca14('0x2e')][_0xca14('0x3a')]){_0x300f58[_0xca14('0x3b')]=_[_0xca14('0x3f')](_0x300f58[_0xca14('0x3b')],{'$or':_[_0xca14('0x54')](_0x300f58[_0xca14('0x31')],function(_0x3dbc38){var _0x2c8b85={};_0x2c8b85[_0x3dbc38]={'$like':'%'+_0x16e368[_0xca14('0x2e')]['filter']+'%'};return _0x2c8b85;})});}_0x300f58=_[_0xca14('0x3f')]({},_0x300f58,_0x16e368[_0xca14('0x40')]);return _0x373a29[_0xca14('0x84')](_0x300f58);}})[_0xca14('0x23')](function(_0x321e3c){if(_0x321e3c){_0x7ed8b2=_0x321e3c[_0xca14('0x32')];if(!_0x16e368['query'][_0xca14('0x33')]('nolimit')){_0x300f58[_0xca14('0x35')]=qs[_0xca14('0x35')](_0x16e368[_0xca14('0x2e')]['limit']);_0x300f58[_0xca14('0x1d')]=qs['offset'](_0x16e368['query'][_0xca14('0x1d')]);}return _0x373a29[_0xca14('0x84')](_0x300f58);}})[_0xca14('0x23')](function(_0x266895){if(_0x266895){return _0x266895?{'count':_0x7ed8b2,'rows':_0x266895}:null;}})[_0xca14('0x23')](respondWithResult(_0xafbad8,null))[_0xca14('0x4f')](handleError(_0xafbad8,null));}; \ No newline at end of file +var _0xa1ff=['emit','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','desk.js','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','params','destroy','find','describe','getMembers','findOne','hasOwnProperty','pick','OpenchannelQueueId','map','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','Team','Agents','online','voicePause','sequelize','transaction','addTeams','each','findOrCreate','ids','select','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','union','value','isEmpty','removeAgents','forEach'];(function(_0x26bafe,_0x13e506){var _0x307879=function(_0x5a1548){while(--_0x5a1548){_0x26bafe['push'](_0x26bafe['shift']());}};_0x307879(++_0x13e506);}(_0xa1ff,0x86));var _0xfa1f=function(_0x19c14b,_0x5c2113){_0x19c14b=_0x19c14b-0x0;var _0x5b5eef=_0xa1ff[_0x19c14b];return _0x5b5eef;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfa1f('0x0'));var zipdir=require(_0xfa1f('0x1'));var jsonpatch=require(_0xfa1f('0x2'));var rp=require(_0xfa1f('0x3'));var moment=require(_0xfa1f('0x4'));var BPromise=require(_0xfa1f('0x5'));var Mustache=require(_0xfa1f('0x6'));var util=require(_0xfa1f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfa1f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfa1f('0x9'));var crypto=require(_0xfa1f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfa1f('0xb'));var toCsv=require(_0xfa1f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa1f('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa1f('0xd'))(_0xfa1f('0xe'));var utils=require(_0xfa1f('0xf'));var config=require(_0xfa1f('0x10'));var db=require(_0xfa1f('0x11'))['db'];config['redis']=_[_0xfa1f('0x12')](config[_0xfa1f('0x13')],{'host':_0xfa1f('0x14'),'port':0x18eb});var socket=require(_0xfa1f('0x15'))(new Redis(config[_0xfa1f('0x13')]));require(_0xfa1f('0x16'))[_0xfa1f('0x17')](socket);function respondWithStatusCode(_0x58c568,_0x56f3ea){_0x56f3ea=_0x56f3ea||0xcc;return function(_0x166958){if(_0x166958){return _0x58c568[_0xfa1f('0x18')](_0x56f3ea);}return _0x58c568['status'](_0x56f3ea)[_0xfa1f('0x19')]();};}function respondWithResult(_0x3322a5,_0x27a3e1){_0x27a3e1=_0x27a3e1||0xc8;return function(_0x495114){if(_0x495114){return _0x3322a5[_0xfa1f('0x1a')](_0x27a3e1)[_0xfa1f('0x1b')](_0x495114);}};}function respondWithFilteredResult(_0x362ac6,_0x26eb20){return function(_0x3602c6){if(_0x3602c6){var _0x3d1e9c=_0x3602c6[_0xfa1f('0x1c')],_0x25e8cf=_0x26eb20[_0xfa1f('0x1d')],_0x516be0=_0x26eb20['offset']+_0x26eb20[_0xfa1f('0x1e')],_0x14b2f6;if(_0x516be0>=_0x3d1e9c){_0x516be0=_0x3d1e9c;_0x14b2f6=0xc8;}else{_0x14b2f6=0xce;}_0x362ac6[_0xfa1f('0x1a')](_0x14b2f6);return _0x362ac6[_0xfa1f('0x1f')](_0xfa1f('0x20'),_0x25e8cf+'-'+_0x516be0+'/'+_0x3d1e9c)['json'](_0x3602c6);}return null;};}function patchUpdates(_0x51f479){return function(_0x1752fd){try{jsonpatch['apply'](_0x1752fd,_0x51f479,!![]);}catch(_0x501578){return BPromise[_0xfa1f('0x21')](_0x501578);}return _0x1752fd[_0xfa1f('0x22')]();};}function saveUpdates(_0x3f32da,_0x359eaa){return function(_0x227bd9){if(_0x227bd9){return _0x227bd9[_0xfa1f('0x23')](_0x3f32da)[_0xfa1f('0x24')](function(_0x1b5ac7){return _0x1b5ac7;});}return null;};}function removeEntity(_0x49908e,_0x3d7e2e){return function(_0x4f0896){if(_0x4f0896){return _0x4f0896['destroy']()[_0xfa1f('0x24')](function(){var _0x27b512=_0x4f0896[_0xfa1f('0x25')]({'plain':!![]});var _0x3b2589='OpenchannelQueues';return db[_0xfa1f('0x26')]['destroy']({'where':{'type':_0x3b2589,'resourceId':_0x27b512['id']}})['then'](function(){return _0x4f0896;});})[_0xfa1f('0x24')](function(){_0x49908e[_0xfa1f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x500326,_0x174519){return function(_0xaddad3){if(!_0xaddad3){_0x500326[_0xfa1f('0x18')](0x194);}return _0xaddad3;};}function handleError(_0x441919,_0x112d6d){_0x112d6d=_0x112d6d||0x1f4;return function(_0x904bee){logger[_0xfa1f('0x27')](_0x904bee[_0xfa1f('0x28')]);if(_0x904bee[_0xfa1f('0x29')]){delete _0x904bee[_0xfa1f('0x29')];}_0x441919[_0xfa1f('0x1a')](_0x112d6d)[_0xfa1f('0x2a')](_0x904bee);};}exports[_0xfa1f('0x2b')]=function(_0x378c3f,_0x5540b4){var _0x414c5c={},_0x4c8250={},_0x140f48={'count':0x0,'rows':[]};var _0x1fcaba=db[_0xfa1f('0x2c')][_0xfa1f('0x2d')];_0x4c8250[_0xfa1f('0x2e')]=_[_0xfa1f('0x2f')](_0x1fcaba);_0x4c8250[_0xfa1f('0x30')]=_[_0xfa1f('0x2f')](_0x378c3f[_0xfa1f('0x30')]);_0x4c8250['filters']=_[_0xfa1f('0x31')](_0x4c8250[_0xfa1f('0x2e')],_0x4c8250[_0xfa1f('0x30')]);_0x414c5c[_0xfa1f('0x32')]=_[_0xfa1f('0x31')](_0x4c8250[_0xfa1f('0x2e')],qs[_0xfa1f('0x33')](_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x33')]));_0x414c5c[_0xfa1f('0x32')]=_0x414c5c[_0xfa1f('0x32')][_0xfa1f('0x34')]?_0x414c5c[_0xfa1f('0x32')]:_0x4c8250[_0xfa1f('0x2e')];if(!_0x378c3f['query']['hasOwnProperty'](_0xfa1f('0x35'))){_0x414c5c[_0xfa1f('0x1e')]=qs[_0xfa1f('0x1e')](_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x1e')]);_0x414c5c[_0xfa1f('0x1d')]=qs[_0xfa1f('0x1d')](_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x1d')]);}_0x414c5c[_0xfa1f('0x36')]=qs[_0xfa1f('0x37')](_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x37')]);_0x414c5c[_0xfa1f('0x38')]=qs[_0xfa1f('0x39')](_['pick'](_0x378c3f[_0xfa1f('0x30')],_0x4c8250[_0xfa1f('0x39')]));if(_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x3a')]){_0x414c5c[_0xfa1f('0x38')]=_[_0xfa1f('0x3b')](_0x414c5c[_0xfa1f('0x38')],{'$or':_['map'](_0x1fcaba,function(_0x2c6154){if(_0x2c6154['type'][_0xfa1f('0x3c')]!==_0xfa1f('0x3d')){var _0x4dc189={};_0x4dc189[_0x2c6154[_0xfa1f('0x3e')]]={'$like':'%'+_0x378c3f[_0xfa1f('0x30')]['filter']+'%'};return _0x4dc189;}})});}_0x414c5c=_[_0xfa1f('0x3b')]({},_0x414c5c,_0x378c3f[_0xfa1f('0x3f')]);var _0xaf5b58={'where':_0x414c5c[_0xfa1f('0x38')]};return db[_0xfa1f('0x2c')][_0xfa1f('0x1c')](_0xaf5b58)[_0xfa1f('0x24')](function(_0x1ab82d){_0x140f48[_0xfa1f('0x1c')]=_0x1ab82d;if(_0x378c3f[_0xfa1f('0x30')][_0xfa1f('0x40')]){_0x414c5c[_0xfa1f('0x41')]=[{'all':!![]}];}return db[_0xfa1f('0x2c')][_0xfa1f('0x42')](_0x414c5c);})['then'](function(_0x4c877f){_0x140f48[_0xfa1f('0x43')]=_0x4c877f;return _0x140f48;})['then'](respondWithFilteredResult(_0x5540b4,_0x414c5c))[_0xfa1f('0x44')](handleError(_0x5540b4,null));};exports['show']=function(_0x60325f,_0x468459){var _0x4b1ea5={'raw':!![],'where':{'id':_0x60325f['params']['id']}},_0x44a338={};_0x44a338['model']=_[_0xfa1f('0x2f')](db[_0xfa1f('0x2c')][_0xfa1f('0x2d')]);_0x44a338['query']=_[_0xfa1f('0x2f')](_0x60325f['query']);_0x44a338['filters']=_[_0xfa1f('0x31')](_0x44a338[_0xfa1f('0x2e')],_0x44a338[_0xfa1f('0x30')]);_0x4b1ea5[_0xfa1f('0x32')]=_[_0xfa1f('0x31')](_0x44a338['model'],qs[_0xfa1f('0x33')](_0x60325f[_0xfa1f('0x30')][_0xfa1f('0x33')]));_0x4b1ea5[_0xfa1f('0x32')]=_0x4b1ea5[_0xfa1f('0x32')][_0xfa1f('0x34')]?_0x4b1ea5['attributes']:_0x44a338['model'];if(_0x60325f['query']['includeAll']){_0x4b1ea5[_0xfa1f('0x41')]=[{'all':!![]}];}_0x4b1ea5=_[_0xfa1f('0x3b')]({},_0x4b1ea5,_0x60325f['options']);return db[_0xfa1f('0x2c')]['find'](_0x4b1ea5)[_0xfa1f('0x24')](handleEntityNotFound(_0x468459,null))[_0xfa1f('0x24')](respondWithResult(_0x468459,null))['catch'](handleError(_0x468459,null));};exports[_0xfa1f('0x45')]=function(_0x5d94af,_0x506059){return db[_0xfa1f('0x2c')][_0xfa1f('0x45')](_0x5d94af[_0xfa1f('0x46')],{})[_0xfa1f('0x24')](function(_0x40909e){var _0x20992d=_0x5d94af['user'][_0xfa1f('0x25')]({'plain':!![]});if(!_0x20992d)throw new Error(_0xfa1f('0x47'));if(_0x20992d[_0xfa1f('0x48')]==='user'){var _0x747511=_0x40909e[_0xfa1f('0x25')]({'plain':!![]});var _0x4204fd=_0xfa1f('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x4204fd,'userProfileId':_0x20992d[_0xfa1f('0x4a')]},'raw':!![]})['then'](function(_0xbd7b8a){if(_0xbd7b8a&&_0xbd7b8a['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x747511[_0xfa1f('0x29')],'resourceId':_0x747511['id'],'type':_0xbd7b8a[_0xfa1f('0x29')],'sectionId':_0xbd7b8a['id']},{})['then'](function(){return _0x40909e;});}else{return _0x40909e;}})[_0xfa1f('0x44')](function(_0x37e827){logger[_0xfa1f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e827);throw _0x37e827;});}return _0x40909e;})[_0xfa1f('0x24')](respondWithResult(_0x506059,0xc9))[_0xfa1f('0x44')](handleError(_0x506059,null));};exports[_0xfa1f('0x23')]=function(_0x343141,_0x2c4592){if(_0x343141['body']['id']){delete _0x343141[_0xfa1f('0x46')]['id'];}return db[_0xfa1f('0x2c')]['find']({'where':{'id':_0x343141[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x2c4592,null))[_0xfa1f('0x24')](saveUpdates(_0x343141['body'],null))[_0xfa1f('0x24')](respondWithResult(_0x2c4592,null))[_0xfa1f('0x44')](handleError(_0x2c4592,null));};exports[_0xfa1f('0x4c')]=function(_0x5a2ff8,_0x3e69a8){return db['OpenchannelQueue'][_0xfa1f('0x4d')]({'where':{'id':_0x5a2ff8[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x3e69a8,null))[_0xfa1f('0x24')](removeEntity(_0x3e69a8,null))['catch'](handleError(_0x3e69a8,null));};exports[_0xfa1f('0x4e')]=function(_0x55d6a2,_0x2c8170){return db[_0xfa1f('0x2c')][_0xfa1f('0x4e')]()[_0xfa1f('0x24')](respondWithResult(_0x2c8170,null))[_0xfa1f('0x44')](handleError(_0x2c8170,null));};exports[_0xfa1f('0x4f')]=function(_0x503364,_0xc12d73,_0x2447f9){var _0x39cfa1={'raw':!![],'where':{}},_0x2a7809={},_0x5d5710;return db[_0xfa1f('0x2c')][_0xfa1f('0x50')]({'where':{'id':_0x503364[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0xc12d73,null))[_0xfa1f('0x24')](function(_0xa04bc1){if(_0xa04bc1){_0x5d5710=_0xa04bc1[_0xfa1f('0x25')]({'plain':!![]});_0x2a7809[_0xfa1f('0x2e')]=_[_0xfa1f('0x2f')](db['UserOpenchannelQueue'][_0xfa1f('0x2d')]);_0x2a7809[_0xfa1f('0x30')]=_['keys'](_0x503364[_0xfa1f('0x30')]);_0x2a7809[_0xfa1f('0x39')]=_[_0xfa1f('0x31')](_0x2a7809[_0xfa1f('0x2e')],_0x2a7809[_0xfa1f('0x30')]);_0x39cfa1['attributes']=_[_0xfa1f('0x31')](_0x2a7809[_0xfa1f('0x2e')],qs['fields'](_0x503364[_0xfa1f('0x30')][_0xfa1f('0x33')]));_0x39cfa1['attributes']=_0x39cfa1[_0xfa1f('0x32')][_0xfa1f('0x34')]?_0x39cfa1[_0xfa1f('0x32')]:_0x2a7809['model'];if(!_0x503364[_0xfa1f('0x30')][_0xfa1f('0x51')](_0xfa1f('0x35'))){_0x39cfa1[_0xfa1f('0x1e')]=qs['limit'](_0x503364[_0xfa1f('0x30')][_0xfa1f('0x1e')]);_0x39cfa1['offset']=qs['offset'](_0x503364['query'][_0xfa1f('0x1d')]);}_0x39cfa1[_0xfa1f('0x36')]=qs[_0xfa1f('0x37')](_0x503364[_0xfa1f('0x30')][_0xfa1f('0x37')]);_0x39cfa1[_0xfa1f('0x38')]=qs[_0xfa1f('0x39')](_[_0xfa1f('0x52')](_0x503364['query'],_0x2a7809[_0xfa1f('0x39')]));_0x39cfa1['where'][_0xfa1f('0x53')]=_0xa04bc1['id'];if(_0x503364[_0xfa1f('0x30')]['filter']){_0x39cfa1[_0xfa1f('0x38')]=_['merge'](_0x39cfa1[_0xfa1f('0x38')],{'$or':_[_0xfa1f('0x54')](_0x39cfa1['attributes'],function(_0x29bca4){var _0x5544b7={};_0x5544b7[_0x29bca4]={'$like':'%'+_0x503364[_0xfa1f('0x30')][_0xfa1f('0x3a')]+'%'};return _0x5544b7;})});}_0x39cfa1=_[_0xfa1f('0x3b')]({},_0x39cfa1,_0x503364[_0xfa1f('0x3f')]);return db[_0xfa1f('0x55')][_0xfa1f('0x42')](_0x39cfa1);}})[_0xfa1f('0x24')](function(_0x2d6fba){if(_0x2d6fba){return db[_0xfa1f('0x56')][_0xfa1f('0x57')]({'where':{'id':_[_0xfa1f('0x54')](_0x2d6fba,_0xfa1f('0x58')),'role':_0xfa1f('0x59')},'attributes':['id',_0xfa1f('0x29'),_0xfa1f('0x5a'),'updatedAt',_0xfa1f('0x5b')]});}})[_0xfa1f('0x24')](function(_0x2cc368){if(_0x2cc368){return{'count':_0x2cc368[_0xfa1f('0x1c')],'rows':_[_0xfa1f('0x54')](_0x2cc368[_0xfa1f('0x43')],function(_0x613257){return{'membername':_0x613257[_0xfa1f('0x29')],'UserId':_0x613257['id'],'queue_name':_0x5d5710[_0xfa1f('0x29')],'OpenchannelQueueId':_0x5d5710['id'],'interface':util[_0xfa1f('0x5c')](_0xfa1f('0x5d'),_0xfa1f('0x5e'),_0x613257[_0xfa1f('0x29')]),'penalty':0x0,'paused':_0x613257[_0xfa1f('0x5a')],'createdAt':_0x613257[_0xfa1f('0x5b')],'updatedAt':_0x613257['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xfa1f('0x24')](respondWithFilteredResult(_0xc12d73,_0x39cfa1))[_0xfa1f('0x44')](handleError(_0xc12d73,null));};exports[_0xfa1f('0x5f')]=function(_0x5626ba,_0x381d01,_0x429bcc){var _0x3f5ece={};var _0x222f08={};var _0x2e94f6;var _0x523241;return db['OpenchannelQueue'][_0xfa1f('0x50')]({'where':{'id':_0x5626ba[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x381d01,null))[_0xfa1f('0x24')](function(_0x54302c){if(_0x54302c){_0x2e94f6=_0x54302c;_0x222f08[_0xfa1f('0x2e')]=_[_0xfa1f('0x2f')](db[_0xfa1f('0x60')][_0xfa1f('0x2d')]);_0x222f08[_0xfa1f('0x30')]=_['keys'](_0x5626ba['query']);_0x222f08['filters']=_[_0xfa1f('0x31')](_0x222f08[_0xfa1f('0x2e')],_0x222f08['query']);_0x3f5ece[_0xfa1f('0x32')]=_[_0xfa1f('0x31')](_0x222f08[_0xfa1f('0x2e')],qs[_0xfa1f('0x33')](_0x5626ba['query'][_0xfa1f('0x33')]));_0x3f5ece['attributes']=_0x3f5ece['attributes'][_0xfa1f('0x34')]?_0x3f5ece['attributes']:_0x222f08[_0xfa1f('0x2e')];_0x3f5ece[_0xfa1f('0x36')]=qs[_0xfa1f('0x37')](_0x5626ba[_0xfa1f('0x30')][_0xfa1f('0x37')]);_0x3f5ece[_0xfa1f('0x38')]=qs['filters'](_['pick'](_0x5626ba[_0xfa1f('0x30')],_0x222f08['filters']));if(_0x5626ba[_0xfa1f('0x30')][_0xfa1f('0x3a')]){_0x3f5ece[_0xfa1f('0x38')]=_[_0xfa1f('0x3b')](_0x3f5ece['where'],{'$or':_[_0xfa1f('0x54')](_0x3f5ece[_0xfa1f('0x32')],function(_0x4d51c8){var _0x3d98a9={};_0x3d98a9[_0x4d51c8]={'$like':'%'+_0x5626ba[_0xfa1f('0x30')][_0xfa1f('0x3a')]+'%'};return _0x3d98a9;})});}_0x3f5ece=_['merge']({},_0x3f5ece,_0x5626ba['options']);return _0x2e94f6['getTeams'](_0x3f5ece);}})[_0xfa1f('0x24')](function(_0xa5d421){if(_0xa5d421){_0x523241=_0xa5d421['length'];if(!_0x5626ba['query']['hasOwnProperty'](_0xfa1f('0x35'))){_0x3f5ece['limit']=qs[_0xfa1f('0x1e')](_0x5626ba[_0xfa1f('0x30')][_0xfa1f('0x1e')]);_0x3f5ece['offset']=qs['offset'](_0x5626ba['query'][_0xfa1f('0x1d')]);}return _0x2e94f6[_0xfa1f('0x5f')](_0x3f5ece);}})[_0xfa1f('0x24')](function(_0x2f20b3){if(_0x2f20b3){return _0x2f20b3?{'count':_0x523241,'rows':_0x2f20b3}:null;}})[_0xfa1f('0x24')](respondWithResult(_0x381d01,null))[_0xfa1f('0x44')](handleError(_0x381d01,null));};exports['addTeams']=function(_0x3491a8,_0x59e206,_0x5031d2){var _0x49584a=_0x3491a8['body']['teams'];return db[_0xfa1f('0x60')][_0xfa1f('0x42')]({'where':{'id':_[_0xfa1f('0x54')](_0x49584a,'id')},'attributes':['id'],'include':[{'model':db[_0xfa1f('0x56')],'as':_0xfa1f('0x61'),'attributes':['id',_0xfa1f('0x29'),_0xfa1f('0x62'),_0xfa1f('0x63'),'interface'],'raw':!![]}]})[_0xfa1f('0x24')](function(_0x253dc9){if(_0x253dc9){var _0x2b2a10=_['flatMap'](_0x253dc9,function(_0x3c814d){var _0x5dda87=_0x3c814d[_0xfa1f('0x25')]({'plain':!![]});return _0x5dda87['Agents'];});return db[_0xfa1f('0x2c')][_0xfa1f('0x4d')]({'where':{'id':_0x3491a8[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](function(_0x2db1d8){return db[_0xfa1f('0x64')][_0xfa1f('0x65')](function(_0xd58f61){return _0x2db1d8[_0xfa1f('0x66')](_[_0xfa1f('0x54')](_0x49584a,'id'),{'transaction':_0xd58f61})[_0xfa1f('0x24')](function(){return BPromise[_0xfa1f('0x67')](_0x2b2a10,function(_0xdb1bba){return db[_0xfa1f('0x55')][_0xfa1f('0x68')]({'where':{'UserId':_0xdb1bba['id'],'OpenchannelQueueId':_0x3491a8[_0xfa1f('0x4b')]['id']},'transaction':_0xd58f61});});})[_0xfa1f('0x24')](function(){_0x2b2a10['forEach'](function(_0x425f80){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x425f80['id'],'OpenchannelQueueId':_0x2db1d8['id']});});});});});}})[_0xfa1f('0x24')](respondWithStatusCode(_0x59e206,null))[_0xfa1f('0x44')](handleError(_0x59e206,null));};exports['removeTeams']=function(_0x3b00b1,_0x3d384b,_0xb04e18){return db['Team'][_0xfa1f('0x42')]({'where':{'id':_0x3b00b1[_0xfa1f('0x30')][_0xfa1f('0x69')]},'attributes':['id'],'include':[{'model':db[_0xfa1f('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfa1f('0x24')](handleEntityNotFound(_0x3d384b,null))[_0xfa1f('0x24')](function(_0x11bbca){var _0x4d57bc=_[_0xfa1f('0x54')](_0x11bbca,'id');var _0x56be8b=[];var _0x40979b=[];var _0x2a0fd5=squel[_0xfa1f('0x6a')]();_0x2a0fd5[_0xfa1f('0x3e')](_0xfa1f('0x6b'))['from']('team_has_openchannel_queues','tq')['join'](_0xfa1f('0x6c'),'ut',_0xfa1f('0x6d'))[_0xfa1f('0x38')](_0xfa1f('0x6e'),_0x3b00b1['params']['id']);for(var _0x184238=0x0;_0x184238<_0x11bbca[_0xfa1f('0x34')];_0x184238+=0x1){let _0x28b4b7=_0x11bbca[_0x184238];for(var _0x4f4a83=0x0;_0x4f4a83<_0x28b4b7[_0xfa1f('0x61')][_0xfa1f('0x34')];_0x4f4a83+=0x1){let _0x20c549=_0x28b4b7[_0xfa1f('0x61')][_0x4f4a83];var _0x31d74c=_0x2a0fd5[_0xfa1f('0x6f')]();_0x31d74c[_0xfa1f('0x38')](_0xfa1f('0x70'),_0x20c549['id']);_0x40979b[_0xfa1f('0x71')](db['sequelize'][_0xfa1f('0x30')](_0x31d74c[_0xfa1f('0x72')](),{'type':db[_0xfa1f('0x64')][_0xfa1f('0x73')]['SELECT']})[_0xfa1f('0x24')](function(_0x14eec7){if(_0x14eec7['length']===0x1){return _0x20c549['id'];}else{var _0x83e343=_['every'](_['map'](_0x14eec7,'TeamId'),function(_0x2273c6){return _['includes'](_0x4d57bc,_0x2273c6);});if(_0x83e343){return _0x20c549['id'];}}}));}}return BPromise[_0xfa1f('0x74')](_0x40979b)[_0xfa1f('0x24')](function(_0x3e5532){_0x56be8b=_(_0x56be8b)[_0xfa1f('0x75')](_0x3e5532)['compact']()[_0xfa1f('0x76')]();return db[_0xfa1f('0x2c')][_0xfa1f('0x4d')]({'where':{'id':_0x3b00b1[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](function(_0x3aecfe){return db['sequelize'][_0xfa1f('0x65')](function(_0x19abb1){return _0x3aecfe['removeTeams'](_0x3b00b1[_0xfa1f('0x30')][_0xfa1f('0x69')],{'transaction':_0x19abb1})[_0xfa1f('0x24')](function(){if(!_[_0xfa1f('0x77')](_0x56be8b)){return _0x3aecfe[_0xfa1f('0x78')](_0x56be8b,{'transaction':_0x19abb1});}})[_0xfa1f('0x24')](function(){_0x56be8b[_0xfa1f('0x79')](function(_0x94cb0d){socket[_0xfa1f('0x7a')](_0xfa1f('0x7b'),{'UserId':_0x94cb0d,'OpenchannelQueueId':_0x3aecfe['id']});});});});});});})[_0xfa1f('0x24')](respondWithStatusCode(_0x3d384b,null))['catch'](handleError(_0x3d384b,null));};exports[_0xfa1f('0x7c')]=function(_0x164dd2,_0x344ac2,_0x1592f8){return db[_0xfa1f('0x2c')][_0xfa1f('0x4d')]({'where':{'id':_0x164dd2[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x344ac2,null))[_0xfa1f('0x24')](function(_0x128f21){if(_0x128f21){return _0x128f21[_0xfa1f('0x7c')](_0x164dd2['body'][_0xfa1f('0x69')],_[_0xfa1f('0x7d')](_0x164dd2[_0xfa1f('0x46')],[_0xfa1f('0x69'),'id'])||{})['spread'](function(_0x30f34b){for(var _0x1fc5bf=0x0;_0x1fc5bf<_0x164dd2[_0xfa1f('0x46')][_0xfa1f('0x69')][_0xfa1f('0x34')];_0x1fc5bf+=0x1){socket[_0xfa1f('0x7a')](_0xfa1f('0x7e'),{'UserId':_0x164dd2[_0xfa1f('0x46')]['ids'][_0x1fc5bf],'OpenchannelQueueId':_0x164dd2[_0xfa1f('0x4b')]['id']});}return _0x30f34b;});}})[_0xfa1f('0x24')](respondWithResult(_0x344ac2,null))[_0xfa1f('0x44')](handleError(_0x344ac2,null));};exports['removeAgents']=function(_0x80cf3e,_0x4493d8,_0x1fb664){return db[_0xfa1f('0x2c')]['find']({'where':{'id':_0x80cf3e[_0xfa1f('0x4b')]['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x4493d8,null))[_0xfa1f('0x24')](function(_0x4b9d56){if(_0x4b9d56){return _0x4b9d56[_0xfa1f('0x78')](_0x80cf3e[_0xfa1f('0x30')][_0xfa1f('0x69')])[_0xfa1f('0x24')](function(){if(_['isArray'](_0x80cf3e[_0xfa1f('0x30')][_0xfa1f('0x69')])){for(var _0x34328c=0x0;_0x34328c<_0x80cf3e[_0xfa1f('0x30')][_0xfa1f('0x69')][_0xfa1f('0x34')];_0x34328c+=0x1){socket[_0xfa1f('0x7a')](_0xfa1f('0x7b'),{'UserId':Number(_0x80cf3e[_0xfa1f('0x30')]['ids'][_0x34328c]),'OpenchannelQueueId':Number(_0x80cf3e[_0xfa1f('0x4b')]['id'])});}}else{socket[_0xfa1f('0x7a')](_0xfa1f('0x7b'),{'UserId':Number(_0x80cf3e[_0xfa1f('0x30')][_0xfa1f('0x69')]),'OpenchannelQueueId':Number(_0x80cf3e[_0xfa1f('0x4b')]['id'])});}});}})[_0xfa1f('0x24')](respondWithStatusCode(_0x4493d8,null))[_0xfa1f('0x44')](handleError(_0x4493d8,null));};exports['getAgents']=function(_0x499149,_0x2b35b8,_0x418f11){var _0x1f460d={};var _0x64bc28={};var _0x45e632;var _0x13221b;return db[_0xfa1f('0x2c')][_0xfa1f('0x50')]({'where':{'id':_0x499149['params']['id']}})[_0xfa1f('0x24')](handleEntityNotFound(_0x2b35b8,null))[_0xfa1f('0x24')](function(_0x5546f4){if(_0x5546f4){_0x45e632=_0x5546f4;_0x64bc28['model']=_[_0xfa1f('0x2f')](db['User'][_0xfa1f('0x2d')]);_0x64bc28[_0xfa1f('0x30')]=_['keys'](_0x499149[_0xfa1f('0x30')]);_0x64bc28['filters']=_[_0xfa1f('0x31')](_0x64bc28[_0xfa1f('0x2e')],_0x64bc28[_0xfa1f('0x30')]);_0x1f460d['attributes']=_[_0xfa1f('0x31')](_0x64bc28[_0xfa1f('0x2e')],qs[_0xfa1f('0x33')](_0x499149[_0xfa1f('0x30')][_0xfa1f('0x33')]));_0x1f460d[_0xfa1f('0x32')]=_0x1f460d[_0xfa1f('0x32')]['length']?_0x1f460d[_0xfa1f('0x32')]:_0x64bc28['model'];_0x1f460d[_0xfa1f('0x36')]=qs[_0xfa1f('0x37')](_0x499149[_0xfa1f('0x30')][_0xfa1f('0x37')]);_0x1f460d[_0xfa1f('0x38')]=qs['filters'](_[_0xfa1f('0x52')](_0x499149[_0xfa1f('0x30')],_0x64bc28[_0xfa1f('0x39')]));if(_0x499149[_0xfa1f('0x30')][_0xfa1f('0x3a')]){_0x1f460d['where']=_[_0xfa1f('0x3b')](_0x1f460d[_0xfa1f('0x38')],{'$or':_[_0xfa1f('0x54')](_0x1f460d[_0xfa1f('0x32')],function(_0x50b762){var _0x1baa4b={};_0x1baa4b[_0x50b762]={'$like':'%'+_0x499149[_0xfa1f('0x30')][_0xfa1f('0x3a')]+'%'};return _0x1baa4b;})});}_0x1f460d=_[_0xfa1f('0x3b')]({},_0x1f460d,_0x499149['options']);return _0x45e632[_0xfa1f('0x7f')](_0x1f460d);}})['then'](function(_0x267e47){if(_0x267e47){_0x13221b=_0x267e47[_0xfa1f('0x34')];if(!_0x499149['query'][_0xfa1f('0x51')]('nolimit')){_0x1f460d[_0xfa1f('0x1e')]=qs[_0xfa1f('0x1e')](_0x499149[_0xfa1f('0x30')]['limit']);_0x1f460d[_0xfa1f('0x1d')]=qs['offset'](_0x499149['query'][_0xfa1f('0x1d')]);}return _0x45e632[_0xfa1f('0x7f')](_0x1f460d);}})['then'](function(_0x39f478){if(_0x39f478){return _0x39f478?{'count':_0x13221b,'rows':_0x39f478}:null;}})[_0xfa1f('0x24')](respondWithResult(_0x2b35b8,null))[_0xfa1f('0x44')](handleError(_0x2b35b8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 99764ad..a9d62a0 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 _0x39d1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x5ebb51,_0x108c16){var _0x3f2ba7=function(_0x3ef766){while(--_0x3ef766){_0x5ebb51['push'](_0x5ebb51['shift']());}};_0x3f2ba7(++_0x108c16);}(_0x39d1,0xd6));var _0x139d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39d1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x139d('0x0'));var OpenchannelQueue=require(_0x139d('0x1'))['db'][_0x139d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x139d('0x3')](0x0);var events={'afterCreate':_0x139d('0x4'),'afterUpdate':_0x139d('0x5'),'afterDestroy':_0x139d('0x6')};function emitEvent(_0x38c084){return function(_0x46d1e5,_0x144e5f,_0x3fe8bf){OpenchannelQueueEvents[_0x139d('0x7')](_0x38c084+':'+_0x46d1e5['id'],_0x46d1e5);OpenchannelQueueEvents[_0x139d('0x7')](_0x38c084,_0x46d1e5);_0x3fe8bf(null);};}for(var e in events){if(events[_0x139d('0x8')](e)){var event=events[e];OpenchannelQueue[_0x139d('0x9')](e,emitEvent(event));}}module[_0x139d('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x3562=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','emit'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x3562,0x14b));var _0x2356=function(_0x6b3f9c,_0x433d66){_0x6b3f9c=_0x6b3f9c-0x0;var _0x4178e3=_0x3562[_0x6b3f9c];return _0x4178e3;};'use strict';var EventEmitter=require(_0x2356('0x0'));var OpenchannelQueue=require(_0x2356('0x1'))['db'][_0x2356('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2356('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f28c5){return function(_0x1e88b8,_0x12610e,_0x481e4a){OpenchannelQueueEvents[_0x2356('0x4')](_0x3f28c5+':'+_0x1e88b8['id'],_0x1e88b8);OpenchannelQueueEvents[_0x2356('0x4')](_0x3f28c5,_0x1e88b8);_0x481e4a(null);};}for(var e in events){if(events[_0x2356('0x5')](e)){var event=events[e];OpenchannelQueue[_0x2356('0x6')](e,emitEvent(event));}}module[_0x2356('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 4a8a927..08c1cb2 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 _0x5beb=['../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x5beb,0xd6));var _0xb5be=function(_0x4d55a9,_0x2ed0ec){_0x4d55a9=_0x4d55a9-0x0;var _0x57f302=_0x5beb[_0x4d55a9];return _0x57f302;};'use strict';var _=require(_0xb5be('0x0'));var util=require(_0xb5be('0x1'));var logger=require(_0xb5be('0x2'))(_0xb5be('0x3'));var moment=require(_0xb5be('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5be('0x5'));var rimraf=require(_0xb5be('0x6'));var config=require(_0xb5be('0x7'));var attributes=require(_0xb5be('0x8'));module['exports']=function(_0x35b08a,_0x41e2a3){return _0x35b08a[_0xb5be('0x9')](_0xb5be('0xa'),attributes,{'tableName':_0xb5be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','api','bluebird','request-promise','path'];(function(_0x49748c,_0x3d2005){var _0xedf6b6=function(_0x11628d){while(--_0x11628d){_0x49748c['push'](_0x49748c['shift']());}};_0xedf6b6(++_0x3d2005);}(_0x5464,0x15a));var _0x4546=function(_0x484fe4,_0x3fa179){_0x484fe4=_0x484fe4-0x0;var _0x185b2d=_0x5464[_0x484fe4];return _0x185b2d;};'use strict';var _=require(_0x4546('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4546('0x1'));var moment=require('moment');var BPromise=require(_0x4546('0x2'));var rp=require(_0x4546('0x3'));var fs=require('fs');var path=require(_0x4546('0x4'));var rimraf=require('rimraf');var config=require(_0x4546('0x5'));var attributes=require(_0x4546('0x6'));module[_0x4546('0x7')]=function(_0x398a0f,_0x59316c){return _0x398a0f['define'](_0x4546('0x8'),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 2d73f77..82559c9 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 _0x3c17=['result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','catch','find','ShowOpenchannelQueue','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x3c17,0x1a1));var _0x73c1=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x3c17[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var moment=require(_0x73c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x73c1('0x2'));var fs=require('fs');var Redis=require(_0x73c1('0x3'));var db=require(_0x73c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73c1('0x5'))(_0x73c1('0x6'));var config=require(_0x73c1('0x7'));var jayson=require(_0x73c1('0x8'));var client=jayson['client'][_0x73c1('0x9')]({'port':0x232a});config['redis']=_[_0x73c1('0xa')](config[_0x73c1('0xb')],{'host':_0x73c1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x73c1('0xd'))[_0x73c1('0xe')](socket);function respondWithRpcPromise(_0x400875,_0x16c774,_0x2b2578){return new BPromise(function(_0x11518f,_0x45c37d){return client['request'](_0x400875,_0x2b2578)['then'](function(_0x1c712c){logger[_0x73c1('0xf')](_0x73c1('0x10'),_0x16c774,_0x73c1('0x11'));logger['debug'](_0x73c1('0x12'),_0x16c774,'request\x20sent',JSON[_0x73c1('0x13')](_0x1c712c));if(_0x1c712c['error']){if(_0x1c712c[_0x73c1('0x14')][_0x73c1('0x15')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x16c774,_0x1c712c[_0x73c1('0x14')]['message']);return _0x45c37d(_0x1c712c[_0x73c1('0x14')]['message']);}logger[_0x73c1('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x16c774,_0x1c712c[_0x73c1('0x14')][_0x73c1('0x16')]);return _0x11518f(_0x1c712c[_0x73c1('0x14')][_0x73c1('0x16')]);}else{logger[_0x73c1('0xf')](_0x73c1('0x10'),_0x16c774,_0x73c1('0x11'));_0x11518f(_0x1c712c[_0x73c1('0x17')][_0x73c1('0x16')]);}})['catch'](function(_0x16e509){logger[_0x73c1('0x14')](_0x73c1('0x10'),_0x16c774,_0x16e509);_0x45c37d(_0x16e509);});});}exports[_0x73c1('0x18')]=function(_0x4b1b94){var _0x3fbaea=this;return new Promise(function(_0x2c5eda,_0x344fb5){return db[_0x73c1('0x19')][_0x73c1('0x1a')]({'raw':_0x4b1b94[_0x73c1('0x1b')]?_0x4b1b94[_0x73c1('0x1b')][_0x73c1('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b1b94['options']?_0x4b1b94[_0x73c1('0x1b')][_0x73c1('0x1d')]||null:null,'attributes':_0x4b1b94[_0x73c1('0x1b')]?_0x4b1b94['options'][_0x73c1('0x1e')]||null:null,'limit':_0x4b1b94[_0x73c1('0x1b')]?_0x4b1b94[_0x73c1('0x1b')][_0x73c1('0x1f')]||null:null,'include':_0x4b1b94[_0x73c1('0x1b')]?_0x4b1b94['options'][_0x73c1('0x20')]?_['map'](_0x4b1b94['options'][_0x73c1('0x20')],function(_0x1c567d){return{'model':db[_0x1c567d[_0x73c1('0x21')]],'as':_0x1c567d['as'],'attributes':_0x1c567d[_0x73c1('0x1e')],'include':_0x1c567d[_0x73c1('0x20')]?_[_0x73c1('0x22')](_0x1c567d[_0x73c1('0x20')],function(_0x9bae95){return{'model':db[_0x9bae95[_0x73c1('0x21')]],'as':_0x9bae95['as'],'attributes':_0x9bae95[_0x73c1('0x1e')],'include':_0x9bae95[_0x73c1('0x20')]?_[_0x73c1('0x22')](_0x9bae95[_0x73c1('0x20')],function(_0x240137){return{'model':db[_0x240137['model']],'as':_0x240137['as'],'attributes':_0x240137[_0x73c1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x73c1('0x23')](function(_0x33b5bc){logger[_0x73c1('0xf')](_0x73c1('0x18'),_0x4b1b94);logger[_0x73c1('0x24')](_0x73c1('0x18'),_0x4b1b94,JSON[_0x73c1('0x13')](_0x33b5bc));_0x2c5eda(_0x33b5bc);})[_0x73c1('0x25')](function(_0x5130c6){logger['error'](_0x73c1('0x18'),_0x5130c6[_0x73c1('0x16')],_0x4b1b94);_0x344fb5(_0x3fbaea[_0x73c1('0x14')](0x1f4,_0x5130c6[_0x73c1('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x3e54b2){var _0x11432d=this;return new Promise(function(_0x1a23ea,_0x5298e0){return db[_0x73c1('0x19')][_0x73c1('0x26')]({'raw':_0x3e54b2[_0x73c1('0x1b')]?_0x3e54b2[_0x73c1('0x1b')][_0x73c1('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e54b2[_0x73c1('0x1b')]?_0x3e54b2['options'][_0x73c1('0x1d')]||null:null,'attributes':_0x3e54b2[_0x73c1('0x1b')]?_0x3e54b2[_0x73c1('0x1b')][_0x73c1('0x1e')]||null:null,'include':_0x3e54b2[_0x73c1('0x1b')]?_0x3e54b2[_0x73c1('0x1b')][_0x73c1('0x20')]?_[_0x73c1('0x22')](_0x3e54b2[_0x73c1('0x1b')][_0x73c1('0x20')],function(_0x48741d){return{'model':db[_0x48741d[_0x73c1('0x21')]],'as':_0x48741d['as'],'attributes':_0x48741d['attributes'],'include':_0x48741d[_0x73c1('0x20')]?_[_0x73c1('0x22')](_0x48741d[_0x73c1('0x20')],function(_0x18587f){return{'model':db[_0x18587f['model']],'as':_0x18587f['as'],'attributes':_0x18587f['attributes'],'include':_0x18587f['include']?_[_0x73c1('0x22')](_0x18587f['include'],function(_0x26c0df){return{'model':db[_0x26c0df[_0x73c1('0x21')]],'as':_0x26c0df['as'],'attributes':_0x26c0df[_0x73c1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x73c1('0x23')](function(_0x138c32){logger[_0x73c1('0xf')](_0x73c1('0x27'),_0x3e54b2);logger[_0x73c1('0x24')](_0x73c1('0x27'),_0x3e54b2,JSON[_0x73c1('0x13')](_0x138c32));_0x1a23ea(_0x138c32);})[_0x73c1('0x25')](function(_0x50f46d){logger[_0x73c1('0x14')](_0x73c1('0x27'),_0x50f46d[_0x73c1('0x16')],_0x3e54b2);_0x5298e0(_0x11432d[_0x73c1('0x14')](0x1f4,_0x50f46d[_0x73c1('0x16')]));});});}; \ No newline at end of file +var _0x5301=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5301,0x157));var _0x1530=function(_0x328c32,_0x238f24){_0x328c32=_0x328c32-0x0;var _0x402980=_0x5301[_0x328c32];return _0x402980;};'use strict';var _=require('lodash');var util=require(_0x1530('0x0'));var moment=require(_0x1530('0x1'));var BPromise=require(_0x1530('0x2'));var rs=require(_0x1530('0x3'));var fs=require('fs');var Redis=require(_0x1530('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1530('0x5'));var logger=require(_0x1530('0x6'))(_0x1530('0x7'));var config=require(_0x1530('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1530('0x9')]['http']({'port':0x232a});config[_0x1530('0xa')]=_['defaults'](config[_0x1530('0xa')],{'host':_0x1530('0xb'),'port':0x18eb});var socket=require(_0x1530('0xc'))(new Redis(config[_0x1530('0xa')]));require(_0x1530('0xd'))['register'](socket);function respondWithRpcPromise(_0x54580d,_0x3d3b2b,_0x46fc58){return new BPromise(function(_0x136521,_0x35f76c){return client['request'](_0x54580d,_0x46fc58)[_0x1530('0xe')](function(_0x41b292){logger[_0x1530('0xf')](_0x1530('0x10'),_0x3d3b2b,'request\x20sent');logger['debug'](_0x1530('0x11'),_0x3d3b2b,_0x1530('0x12'),JSON['stringify'](_0x41b292));if(_0x41b292[_0x1530('0x13')]){if(_0x41b292[_0x1530('0x13')]['code']===0x1f4){logger[_0x1530('0x13')](_0x1530('0x10'),_0x3d3b2b,_0x41b292[_0x1530('0x13')][_0x1530('0x14')]);return _0x35f76c(_0x41b292[_0x1530('0x13')][_0x1530('0x14')]);}logger[_0x1530('0x13')](_0x1530('0x10'),_0x3d3b2b,_0x41b292[_0x1530('0x13')][_0x1530('0x14')]);return _0x136521(_0x41b292[_0x1530('0x13')][_0x1530('0x14')]);}else{logger['info'](_0x1530('0x10'),_0x3d3b2b,_0x1530('0x12'));_0x136521(_0x41b292['result']['message']);}})['catch'](function(_0x51714b){logger[_0x1530('0x13')](_0x1530('0x10'),_0x3d3b2b,_0x51714b);_0x35f76c(_0x51714b);});});}exports[_0x1530('0x15')]=function(_0x5de99c){var _0xc6efa8=this;return new Promise(function(_0xa5f085,_0x5c9002){return db[_0x1530('0x16')][_0x1530('0x17')]({'raw':_0x5de99c[_0x1530('0x18')]?_0x5de99c[_0x1530('0x18')][_0x1530('0x19')]===undefined?!![]:![]:!![],'where':_0x5de99c['options']?_0x5de99c[_0x1530('0x18')][_0x1530('0x1a')]||null:null,'attributes':_0x5de99c['options']?_0x5de99c[_0x1530('0x18')][_0x1530('0x1b')]||null:null,'limit':_0x5de99c[_0x1530('0x18')]?_0x5de99c[_0x1530('0x18')][_0x1530('0x1c')]||null:null,'include':_0x5de99c[_0x1530('0x18')]?_0x5de99c[_0x1530('0x18')][_0x1530('0x1d')]?_[_0x1530('0x1e')](_0x5de99c[_0x1530('0x18')]['include'],function(_0x219744){return{'model':db[_0x219744[_0x1530('0x1f')]],'as':_0x219744['as'],'attributes':_0x219744[_0x1530('0x1b')],'include':_0x219744[_0x1530('0x1d')]?_['map'](_0x219744[_0x1530('0x1d')],function(_0x33f342){return{'model':db[_0x33f342[_0x1530('0x1f')]],'as':_0x33f342['as'],'attributes':_0x33f342[_0x1530('0x1b')],'include':_0x33f342[_0x1530('0x1d')]?_[_0x1530('0x1e')](_0x33f342[_0x1530('0x1d')],function(_0x4fe3ad){return{'model':db[_0x4fe3ad[_0x1530('0x1f')]],'as':_0x4fe3ad['as'],'attributes':_0x4fe3ad['attributes']};}):[]};}):[]};}):[]:[]})[_0x1530('0xe')](function(_0xf96c11){logger['info'](_0x1530('0x15'),_0x5de99c);logger[_0x1530('0x20')](_0x1530('0x15'),_0x5de99c,JSON[_0x1530('0x21')](_0xf96c11));_0xa5f085(_0xf96c11);})[_0x1530('0x22')](function(_0x56e2f9){logger[_0x1530('0x13')](_0x1530('0x15'),_0x56e2f9[_0x1530('0x14')],_0x5de99c);_0x5c9002(_0xc6efa8[_0x1530('0x13')](0x1f4,_0x56e2f9[_0x1530('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x52f289){var _0x5b9137=this;return new Promise(function(_0x5222b5,_0x402d65){return db['OpenchannelQueue']['find']({'raw':_0x52f289[_0x1530('0x18')]?_0x52f289[_0x1530('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52f289[_0x1530('0x18')]?_0x52f289['options'][_0x1530('0x1a')]||null:null,'attributes':_0x52f289[_0x1530('0x18')]?_0x52f289[_0x1530('0x18')]['attributes']||null:null,'include':_0x52f289[_0x1530('0x18')]?_0x52f289[_0x1530('0x18')]['include']?_[_0x1530('0x1e')](_0x52f289['options'][_0x1530('0x1d')],function(_0x2224ce){return{'model':db[_0x2224ce['model']],'as':_0x2224ce['as'],'attributes':_0x2224ce[_0x1530('0x1b')],'include':_0x2224ce[_0x1530('0x1d')]?_[_0x1530('0x1e')](_0x2224ce['include'],function(_0x5a5312){return{'model':db[_0x5a5312[_0x1530('0x1f')]],'as':_0x5a5312['as'],'attributes':_0x5a5312['attributes'],'include':_0x5a5312[_0x1530('0x1d')]?_[_0x1530('0x1e')](_0x5a5312[_0x1530('0x1d')],function(_0x39f7fc){return{'model':db[_0x39f7fc[_0x1530('0x1f')]],'as':_0x39f7fc['as'],'attributes':_0x39f7fc[_0x1530('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1530('0xe')](function(_0x4525d0){logger['info'](_0x1530('0x23'),_0x52f289);logger['debug']('ShowOpenchannelQueue',_0x52f289,JSON[_0x1530('0x21')](_0x4525d0));_0x5222b5(_0x4525d0);})['catch'](function(_0x192dd7){logger['error'](_0x1530('0x23'),_0x192dd7['message'],_0x52f289);_0x402d65(_0x5b9137[_0x1530('0x13')](0x1f4,_0x192dd7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c449a68..a54d957 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 30c7e0e..4c8e2f7 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 _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x347d10,_0x2d798f){var _0x1154c5=function(_0x201ce9){while(--_0x201ce9){_0x347d10['push'](_0x347d10['shift']());}};_0x1154c5(++_0x2d798f);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d773f,_0x3462b3){_0x3d773f=_0x3d773f-0x0;var _0x22bf3a=_0xb10b[_0x3d773f];return _0x22bf3a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 99a2d20..eb13d6f 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 _0xb8e0=['moment','exports','STRING','DATE'];(function(_0x47cb5b,_0x1ca039){var _0x18a370=function(_0x3737da){while(--_0x3737da){_0x47cb5b['push'](_0x47cb5b['shift']());}};_0x18a370(++_0x1ca039);}(_0xb8e0,0x158));var _0x0b8e=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0xb8e0[_0x114d1f];return _0x5b91d4;};'use strict';var moment=require(_0x0b8e('0x0'));var Sequelize=require('sequelize');module[_0x0b8e('0x1')]={'uniqueid':{'type':Sequelize[_0x0b8e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0b8e('0x2')]},'joinAt':{'type':Sequelize[_0x0b8e('0x3')]},'leaveAt':{'type':Sequelize[_0x0b8e('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0b8e('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd0dd=['DATE','moment','sequelize','STRING'];(function(_0xc940bf,_0x4a378f){var _0x36e7f2=function(_0x2533c5){while(--_0x2533c5){_0xc940bf['push'](_0xc940bf['shift']());}};_0x36e7f2(++_0x4a378f);}(_0xd0dd,0x1a1));var _0xdd0d=function(_0x10c33b,_0x4ef33d){_0x10c33b=_0x10c33b-0x0;var _0x314a02=_0xd0dd[_0x10c33b];return _0x314a02;};'use strict';var moment=require(_0xdd0d('0x0'));var Sequelize=require(_0xdd0d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xdd0d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdd0d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdd0d('0x3')]},'acceptAt':{'type':Sequelize[_0xdd0d('0x3')]},'exitAt':{'type':Sequelize[_0xdd0d('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 75b4327..7e3bfb9 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 _0xdd18=['includeAll','include','OpenchannelQueueReport','show','params','options','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','count'];(function(_0x4a7317,_0x51a674){var _0x4b4607=function(_0x4b45e3){while(--_0x4b45e3){_0x4a7317['push'](_0x4a7317['shift']());}};_0x4b4607(++_0x51a674);}(_0xdd18,0x1c1));var _0x8dd1=function(_0x14e6b1,_0x27757a){_0x14e6b1=_0x14e6b1-0x0;var _0x4dba9c=_0xdd18[_0x14e6b1];return _0x4dba9c;};'use strict';var pdf=require(_0x8dd1('0x0'));var emlformat=require(_0x8dd1('0x1'));var rimraf=require(_0x8dd1('0x2'));var zipdir=require(_0x8dd1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dd1('0x4'));var moment=require('moment');var BPromise=require(_0x8dd1('0x5'));var Mustache=require(_0x8dd1('0x6'));var util=require(_0x8dd1('0x7'));var path=require(_0x8dd1('0x8'));var sox=require(_0x8dd1('0x9'));var csv=require(_0x8dd1('0xa'));var ejs=require(_0x8dd1('0xb'));var fs=require('fs');var _=require(_0x8dd1('0xc'));var squel=require(_0x8dd1('0xd'));var crypto=require(_0x8dd1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8dd1('0xf'));var toCsv=require(_0x8dd1('0xa'));var querystring=require(_0x8dd1('0x10'));var Papa=require(_0x8dd1('0x11'));var Redis=require(_0x8dd1('0x12'));var authService=require(_0x8dd1('0x13'));var qs=require(_0x8dd1('0x14'));var hardwareService=require(_0x8dd1('0x15'));var logger=require(_0x8dd1('0x16'))(_0x8dd1('0x17'));var utils=require(_0x8dd1('0x18'));var config=require('../../config/environment');var db=require(_0x8dd1('0x19'))['db'];function respondWithStatusCode(_0xa8af5d,_0x22cfdc){_0x22cfdc=_0x22cfdc||0xcc;return function(_0x2b7dce){if(_0x2b7dce){return _0xa8af5d[_0x8dd1('0x1a')](_0x22cfdc);}return _0xa8af5d['status'](_0x22cfdc)['end']();};}function respondWithResult(_0x200ebd,_0x5b1cab){_0x5b1cab=_0x5b1cab||0xc8;return function(_0x4eb931){if(_0x4eb931){return _0x200ebd[_0x8dd1('0x1b')](_0x5b1cab)['json'](_0x4eb931);}};}function respondWithFilteredResult(_0x50d455,_0xfd63b3){return function(_0x2d5a0e){if(_0x2d5a0e){var _0x1d5517=_0x2d5a0e['count'],_0x30de76=_0xfd63b3[_0x8dd1('0x1c')],_0x49dd54=_0xfd63b3[_0x8dd1('0x1c')]+_0xfd63b3[_0x8dd1('0x1d')],_0x5b790d;if(_0x49dd54>=_0x1d5517){_0x49dd54=_0x1d5517;_0x5b790d=0xc8;}else{_0x5b790d=0xce;}_0x50d455[_0x8dd1('0x1b')](_0x5b790d);return _0x50d455[_0x8dd1('0x1e')](_0x8dd1('0x1f'),_0x30de76+'-'+_0x49dd54+'/'+_0x1d5517)[_0x8dd1('0x20')](_0x2d5a0e);}return null;};}function patchUpdates(_0x3c0bdd){return function(_0x443ec4){try{jsonpatch['apply'](_0x443ec4,_0x3c0bdd,!![]);}catch(_0x32bb05){return BPromise['reject'](_0x32bb05);}return _0x443ec4[_0x8dd1('0x21')]();};}function saveUpdates(_0x1b6222,_0x4b5df1){return function(_0x18432a){if(_0x18432a){return _0x18432a[_0x8dd1('0x22')](_0x1b6222)[_0x8dd1('0x23')](function(_0x49377c){return _0x49377c;});}return null;};}function removeEntity(_0x4100aa,_0x5dd0ac){return function(_0x433d54){if(_0x433d54){return _0x433d54[_0x8dd1('0x24')]()[_0x8dd1('0x23')](function(){_0x4100aa[_0x8dd1('0x1b')](0xcc)[_0x8dd1('0x25')]();});}};}function handleEntityNotFound(_0x2135dd,_0x1bd3c5){return function(_0x50cee9){if(!_0x50cee9){_0x2135dd['sendStatus'](0x194);}return _0x50cee9;};}function handleError(_0x5cc87b,_0x4b96cd){_0x4b96cd=_0x4b96cd||0x1f4;return function(_0x16dea5){logger['error'](_0x16dea5[_0x8dd1('0x26')]);if(_0x16dea5[_0x8dd1('0x27')]){delete _0x16dea5[_0x8dd1('0x27')];}_0x5cc87b['status'](_0x4b96cd)[_0x8dd1('0x28')](_0x16dea5);};}exports[_0x8dd1('0x29')]=function(_0x54191b,_0x230c5b){var _0x2e4c30={},_0x4a7f61={},_0x2e7455={'count':0x0,'rows':[]};var _0x1a202e=db['OpenchannelQueueReport'][_0x8dd1('0x2a')];_0x4a7f61[_0x8dd1('0x2b')]=_['keys'](_0x1a202e);_0x4a7f61[_0x8dd1('0x2c')]=_[_0x8dd1('0x2d')](_0x54191b['query']);_0x4a7f61[_0x8dd1('0x2e')]=_['intersection'](_0x4a7f61[_0x8dd1('0x2b')],_0x4a7f61[_0x8dd1('0x2c')]);_0x2e4c30[_0x8dd1('0x2f')]=_[_0x8dd1('0x30')](_0x4a7f61[_0x8dd1('0x2b')],qs[_0x8dd1('0x31')](_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x31')]));_0x2e4c30[_0x8dd1('0x2f')]=_0x2e4c30[_0x8dd1('0x2f')][_0x8dd1('0x32')]?_0x2e4c30[_0x8dd1('0x2f')]:_0x4a7f61[_0x8dd1('0x2b')];if(!_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x33')](_0x8dd1('0x34'))){_0x2e4c30[_0x8dd1('0x1d')]=qs[_0x8dd1('0x1d')](_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x1d')]);_0x2e4c30['offset']=qs[_0x8dd1('0x1c')](_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x1c')]);}_0x2e4c30[_0x8dd1('0x35')]=qs['sort'](_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x36')]);_0x2e4c30['where']=qs['filters'](_[_0x8dd1('0x37')](_0x54191b[_0x8dd1('0x2c')],_0x4a7f61[_0x8dd1('0x2e')]));if(_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x38')]){_0x2e4c30[_0x8dd1('0x39')]=_[_0x8dd1('0x3a')](_0x2e4c30[_0x8dd1('0x39')],{'$or':_[_0x8dd1('0x3b')](_0x1a202e,function(_0x642c71){if(_0x642c71[_0x8dd1('0x3c')]['key']!=='VIRTUAL'){var _0xa2b302={};_0xa2b302[_0x642c71['field']]={'$like':'%'+_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x38')]+'%'};return _0xa2b302;}})});}_0x2e4c30=_[_0x8dd1('0x3a')]({},_0x2e4c30,_0x54191b['options']);var _0x3f4a45={'where':_0x2e4c30[_0x8dd1('0x39')]};return db['OpenchannelQueueReport'][_0x8dd1('0x3d')](_0x3f4a45)[_0x8dd1('0x23')](function(_0x2127f3){_0x2e7455[_0x8dd1('0x3d')]=_0x2127f3;if(_0x54191b[_0x8dd1('0x2c')][_0x8dd1('0x3e')]){_0x2e4c30[_0x8dd1('0x3f')]=[{'all':!![]}];}return db[_0x8dd1('0x40')]['findAll'](_0x2e4c30);})[_0x8dd1('0x23')](function(_0x2fb437){_0x2e7455['rows']=_0x2fb437;return _0x2e7455;})[_0x8dd1('0x23')](respondWithFilteredResult(_0x230c5b,_0x2e4c30))['catch'](handleError(_0x230c5b,null));};exports[_0x8dd1('0x41')]=function(_0xa38e35,_0x1a9bc2){var _0x1b786a={'raw':!![],'where':{'id':_0xa38e35[_0x8dd1('0x42')]['id']}},_0x3776bf={};_0x3776bf[_0x8dd1('0x2b')]=_[_0x8dd1('0x2d')](db[_0x8dd1('0x40')][_0x8dd1('0x2a')]);_0x3776bf['query']=_['keys'](_0xa38e35[_0x8dd1('0x2c')]);_0x3776bf[_0x8dd1('0x2e')]=_[_0x8dd1('0x30')](_0x3776bf[_0x8dd1('0x2b')],_0x3776bf[_0x8dd1('0x2c')]);_0x1b786a[_0x8dd1('0x2f')]=_['intersection'](_0x3776bf[_0x8dd1('0x2b')],qs[_0x8dd1('0x31')](_0xa38e35['query'][_0x8dd1('0x31')]));_0x1b786a[_0x8dd1('0x2f')]=_0x1b786a[_0x8dd1('0x2f')]['length']?_0x1b786a['attributes']:_0x3776bf[_0x8dd1('0x2b')];if(_0xa38e35[_0x8dd1('0x2c')][_0x8dd1('0x3e')]){_0x1b786a[_0x8dd1('0x3f')]=[{'all':!![]}];}_0x1b786a=_[_0x8dd1('0x3a')]({},_0x1b786a,_0xa38e35[_0x8dd1('0x43')]);return db[_0x8dd1('0x40')]['find'](_0x1b786a)['then'](handleEntityNotFound(_0x1a9bc2,null))[_0x8dd1('0x23')](respondWithResult(_0x1a9bc2,null))[_0x8dd1('0x44')](handleError(_0x1a9bc2,null));};exports[_0x8dd1('0x45')]=function(_0x2e2a33,_0x5823b0){return db[_0x8dd1('0x40')]['create'](_0x2e2a33[_0x8dd1('0x46')],{})['then'](respondWithResult(_0x5823b0,0xc9))['catch'](handleError(_0x5823b0,null));};exports['update']=function(_0x3a06b8,_0xa14527){if(_0x3a06b8[_0x8dd1('0x46')]['id']){delete _0x3a06b8[_0x8dd1('0x46')]['id'];}return db[_0x8dd1('0x40')][_0x8dd1('0x47')]({'where':{'id':_0x3a06b8['params']['id']}})['then'](handleEntityNotFound(_0xa14527,null))[_0x8dd1('0x23')](saveUpdates(_0x3a06b8['body'],null))[_0x8dd1('0x23')](respondWithResult(_0xa14527,null))[_0x8dd1('0x44')](handleError(_0xa14527,null));};exports['destroy']=function(_0x709505,_0x11ad22){return db[_0x8dd1('0x40')]['find']({'where':{'id':_0x709505[_0x8dd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x11ad22,null))[_0x8dd1('0x23')](removeEntity(_0x11ad22,null))[_0x8dd1('0x44')](handleError(_0x11ad22,null));};exports[_0x8dd1('0x48')]=function(_0x5699fe,_0xd02210){return db[_0x8dd1('0x40')][_0x8dd1('0x48')]()[_0x8dd1('0x23')](respondWithResult(_0xd02210,null))['catch'](handleError(_0xd02210,null));}; \ No newline at end of file +var _0xfac8=['merge','map','key','VIRTUAL','field','options','count','include','findAll','rows','show','includeAll','find','create','body','catch','update','params','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','Content-Range','apply','reject','save','then','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xfac8,0x190));var _0x8fac=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xfac8[_0x1a89ca];return _0x29cbb2;};'use strict';var pdf=require(_0x8fac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8fac('0x1'));var zipdir=require(_0x8fac('0x2'));var jsonpatch=require(_0x8fac('0x3'));var rp=require(_0x8fac('0x4'));var moment=require(_0x8fac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8fac('0x6'));var util=require(_0x8fac('0x7'));var path=require(_0x8fac('0x8'));var sox=require(_0x8fac('0x9'));var csv=require(_0x8fac('0xa'));var ejs=require(_0x8fac('0xb'));var fs=require('fs');var _=require(_0x8fac('0xc'));var squel=require('squel');var crypto=require(_0x8fac('0xd'));var jsforce=require(_0x8fac('0xe'));var deskjs=require(_0x8fac('0xf'));var toCsv=require(_0x8fac('0xa'));var querystring=require('querystring');var Papa=require(_0x8fac('0x10'));var Redis=require(_0x8fac('0x11'));var authService=require(_0x8fac('0x12'));var qs=require(_0x8fac('0x13'));var hardwareService=require(_0x8fac('0x14'));var logger=require(_0x8fac('0x15'))(_0x8fac('0x16'));var utils=require(_0x8fac('0x17'));var config=require(_0x8fac('0x18'));var db=require(_0x8fac('0x19'))['db'];function respondWithStatusCode(_0x378b09,_0x582350){_0x582350=_0x582350||0xcc;return function(_0x436f12){if(_0x436f12){return _0x378b09[_0x8fac('0x1a')](_0x582350);}return _0x378b09['status'](_0x582350)[_0x8fac('0x1b')]();};}function respondWithResult(_0x3bb652,_0x5ee9fe){_0x5ee9fe=_0x5ee9fe||0xc8;return function(_0x1f3f9e){if(_0x1f3f9e){return _0x3bb652[_0x8fac('0x1c')](_0x5ee9fe)[_0x8fac('0x1d')](_0x1f3f9e);}};}function respondWithFilteredResult(_0x2f0777,_0x15b947){return function(_0x42cf01){if(_0x42cf01){var _0x10fba7=_0x42cf01['count'],_0x34fb0d=_0x15b947['offset'],_0x4fc8b5=_0x15b947[_0x8fac('0x1e')]+_0x15b947['limit'],_0x1559a3;if(_0x4fc8b5>=_0x10fba7){_0x4fc8b5=_0x10fba7;_0x1559a3=0xc8;}else{_0x1559a3=0xce;}_0x2f0777[_0x8fac('0x1c')](_0x1559a3);return _0x2f0777['set'](_0x8fac('0x1f'),_0x34fb0d+'-'+_0x4fc8b5+'/'+_0x10fba7)[_0x8fac('0x1d')](_0x42cf01);}return null;};}function patchUpdates(_0x53b1a4){return function(_0x404a50){try{jsonpatch[_0x8fac('0x20')](_0x404a50,_0x53b1a4,!![]);}catch(_0x9b001a){return BPromise[_0x8fac('0x21')](_0x9b001a);}return _0x404a50[_0x8fac('0x22')]();};}function saveUpdates(_0x3b7ecc,_0x11fd66){return function(_0x40c0b0){if(_0x40c0b0){return _0x40c0b0['update'](_0x3b7ecc)['then'](function(_0x556e0e){return _0x556e0e;});}return null;};}function removeEntity(_0x25f9a1,_0x1c51c7){return function(_0x31d69e){if(_0x31d69e){return _0x31d69e['destroy']()[_0x8fac('0x23')](function(){_0x25f9a1[_0x8fac('0x1c')](0xcc)[_0x8fac('0x1b')]();});}};}function handleEntityNotFound(_0xa05c3d,_0x13e1f9){return function(_0x3249cd){if(!_0x3249cd){_0xa05c3d[_0x8fac('0x1a')](0x194);}return _0x3249cd;};}function handleError(_0x326cd2,_0x4491e3){_0x4491e3=_0x4491e3||0x1f4;return function(_0x481514){logger['error'](_0x481514['stack']);if(_0x481514[_0x8fac('0x24')]){delete _0x481514[_0x8fac('0x24')];}_0x326cd2[_0x8fac('0x1c')](_0x4491e3)[_0x8fac('0x25')](_0x481514);};}exports[_0x8fac('0x26')]=function(_0x300ad4,_0x2e93dc){var _0x2c8126={},_0x8bad47={},_0x4016e8={'count':0x0,'rows':[]};var _0x424188=db[_0x8fac('0x27')][_0x8fac('0x28')];_0x8bad47[_0x8fac('0x29')]=_[_0x8fac('0x2a')](_0x424188);_0x8bad47[_0x8fac('0x2b')]=_[_0x8fac('0x2a')](_0x300ad4[_0x8fac('0x2b')]);_0x8bad47[_0x8fac('0x2c')]=_['intersection'](_0x8bad47['model'],_0x8bad47[_0x8fac('0x2b')]);_0x2c8126[_0x8fac('0x2d')]=_[_0x8fac('0x2e')](_0x8bad47[_0x8fac('0x29')],qs[_0x8fac('0x2f')](_0x300ad4['query'][_0x8fac('0x2f')]));_0x2c8126[_0x8fac('0x2d')]=_0x2c8126['attributes'][_0x8fac('0x30')]?_0x2c8126[_0x8fac('0x2d')]:_0x8bad47[_0x8fac('0x29')];if(!_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x31')](_0x8fac('0x32'))){_0x2c8126[_0x8fac('0x33')]=qs[_0x8fac('0x33')](_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x33')]);_0x2c8126[_0x8fac('0x1e')]=qs[_0x8fac('0x1e')](_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x1e')]);}_0x2c8126['order']=qs[_0x8fac('0x34')](_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x34')]);_0x2c8126[_0x8fac('0x35')]=qs['filters'](_[_0x8fac('0x36')](_0x300ad4[_0x8fac('0x2b')],_0x8bad47[_0x8fac('0x2c')]));if(_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x37')]){_0x2c8126[_0x8fac('0x35')]=_[_0x8fac('0x38')](_0x2c8126[_0x8fac('0x35')],{'$or':_[_0x8fac('0x39')](_0x424188,function(_0x18b416){if(_0x18b416['type'][_0x8fac('0x3a')]!==_0x8fac('0x3b')){var _0x1e5d14={};_0x1e5d14[_0x18b416[_0x8fac('0x3c')]]={'$like':'%'+_0x300ad4[_0x8fac('0x2b')][_0x8fac('0x37')]+'%'};return _0x1e5d14;}})});}_0x2c8126=_[_0x8fac('0x38')]({},_0x2c8126,_0x300ad4[_0x8fac('0x3d')]);var _0x453c4d={'where':_0x2c8126[_0x8fac('0x35')]};return db['OpenchannelQueueReport'][_0x8fac('0x3e')](_0x453c4d)['then'](function(_0x3a09ee){_0x4016e8[_0x8fac('0x3e')]=_0x3a09ee;if(_0x300ad4[_0x8fac('0x2b')]['includeAll']){_0x2c8126[_0x8fac('0x3f')]=[{'all':!![]}];}return db[_0x8fac('0x27')][_0x8fac('0x40')](_0x2c8126);})[_0x8fac('0x23')](function(_0x30114e){_0x4016e8[_0x8fac('0x41')]=_0x30114e;return _0x4016e8;})[_0x8fac('0x23')](respondWithFilteredResult(_0x2e93dc,_0x2c8126))['catch'](handleError(_0x2e93dc,null));};exports[_0x8fac('0x42')]=function(_0x58796e,_0x525a49){var _0x163dec={'raw':!![],'where':{'id':_0x58796e['params']['id']}},_0x3f1670={};_0x3f1670['model']=_[_0x8fac('0x2a')](db[_0x8fac('0x27')][_0x8fac('0x28')]);_0x3f1670['query']=_['keys'](_0x58796e[_0x8fac('0x2b')]);_0x3f1670[_0x8fac('0x2c')]=_[_0x8fac('0x2e')](_0x3f1670[_0x8fac('0x29')],_0x3f1670[_0x8fac('0x2b')]);_0x163dec['attributes']=_[_0x8fac('0x2e')](_0x3f1670[_0x8fac('0x29')],qs['fields'](_0x58796e[_0x8fac('0x2b')]['fields']));_0x163dec[_0x8fac('0x2d')]=_0x163dec[_0x8fac('0x2d')][_0x8fac('0x30')]?_0x163dec[_0x8fac('0x2d')]:_0x3f1670[_0x8fac('0x29')];if(_0x58796e[_0x8fac('0x2b')][_0x8fac('0x43')]){_0x163dec[_0x8fac('0x3f')]=[{'all':!![]}];}_0x163dec=_['merge']({},_0x163dec,_0x58796e['options']);return db[_0x8fac('0x27')][_0x8fac('0x44')](_0x163dec)[_0x8fac('0x23')](handleEntityNotFound(_0x525a49,null))[_0x8fac('0x23')](respondWithResult(_0x525a49,null))['catch'](handleError(_0x525a49,null));};exports[_0x8fac('0x45')]=function(_0x115c16,_0x5695af){return db[_0x8fac('0x27')][_0x8fac('0x45')](_0x115c16[_0x8fac('0x46')],{})['then'](respondWithResult(_0x5695af,0xc9))[_0x8fac('0x47')](handleError(_0x5695af,null));};exports[_0x8fac('0x48')]=function(_0x26e0c7,_0x1bd9b3){if(_0x26e0c7[_0x8fac('0x46')]['id']){delete _0x26e0c7[_0x8fac('0x46')]['id'];}return db['OpenchannelQueueReport'][_0x8fac('0x44')]({'where':{'id':_0x26e0c7[_0x8fac('0x49')]['id']}})[_0x8fac('0x23')](handleEntityNotFound(_0x1bd9b3,null))['then'](saveUpdates(_0x26e0c7[_0x8fac('0x46')],null))[_0x8fac('0x23')](respondWithResult(_0x1bd9b3,null))[_0x8fac('0x47')](handleError(_0x1bd9b3,null));};exports[_0x8fac('0x4a')]=function(_0x49a490,_0x438545){return db[_0x8fac('0x27')][_0x8fac('0x44')]({'where':{'id':_0x49a490[_0x8fac('0x49')]['id']}})[_0x8fac('0x23')](handleEntityNotFound(_0x438545,null))[_0x8fac('0x23')](removeEntity(_0x438545,null))[_0x8fac('0x47')](handleError(_0x438545,null));};exports[_0x8fac('0x4b')]=function(_0x1e8ec6,_0x209ee8){return db['OpenchannelQueueReport'][_0x8fac('0x4b')]()[_0x8fac('0x23')](respondWithResult(_0x209ee8,null))[_0x8fac('0x47')](handleError(_0x209ee8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c9e3379..61852af 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 _0x5577=['rimraf','../../config/environment','./openchannelQueueReport.attributes','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x63416d,_0xc47f1){var _0x27b160=function(_0x3191cb){while(--_0x3191cb){_0x63416d['push'](_0x63416d['shift']());}};_0x27b160(++_0xc47f1);}(_0x5577,0x1b4));var _0x7557=function(_0x47f89d,_0x2039df){_0x47f89d=_0x47f89d-0x0;var _0x1d512a=_0x5577[_0x47f89d];return _0x1d512a;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var logger=require(_0x7557('0x1'))(_0x7557('0x2'));var moment=require('moment');var BPromise=require(_0x7557('0x3'));var rp=require(_0x7557('0x4'));var fs=require('fs');var path=require(_0x7557('0x5'));var rimraf=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var attributes=require(_0x7557('0x8'));module['exports']=function(_0x7bb8c,_0x41a4a5){return _0x7bb8c[_0x7557('0x9')](_0x7557('0xa'),attributes,{'tableName':_0x7557('0xb'),'paranoid':![],'indexes':[{'name':_0x7557('0xc'),'fields':[_0x7557('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['report_openchannel_queue','uniqueid','util','../../config/logger','bluebird','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport'];(function(_0x26ecab,_0x574afc){var _0x168cd2=function(_0x1dc55f){while(--_0x1dc55f){_0x26ecab['push'](_0x26ecab['shift']());}};_0x168cd2(++_0x574afc);}(_0xb821,0xa7));var _0x1b82=function(_0x48fdb0,_0x35280f){_0x48fdb0=_0x48fdb0-0x0;var _0x44c607=_0xb821[_0x48fdb0];return _0x44c607;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[{'name':_0x1b82('0xa'),'fields':[_0x1b82('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 7bddfa0..bb90bb4 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 _0x5e39=['bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','limit','debug','lodash','util','moment'];(function(_0x2cba15,_0x2d6ccf){var _0x43d0bb=function(_0x7de708){while(--_0x7de708){_0x2cba15['push'](_0x2cba15['shift']());}};_0x43d0bb(++_0x2d6ccf);}(_0x5e39,0x102));var _0x95e3=function(_0x342c31,_0x1fc203){_0x342c31=_0x342c31-0x0;var _0x500118=_0x5e39[_0x342c31];return _0x500118;};'use strict';var _=require(_0x95e3('0x0'));var util=require(_0x95e3('0x1'));var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95e3('0x4'));var logger=require(_0x95e3('0x5'))(_0x95e3('0x6'));var config=require('../../config/environment');var jayson=require(_0x95e3('0x7'));var client=jayson[_0x95e3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f0d13,_0x1e5fbb,_0x21e68d){return new BPromise(function(_0x12e4be,_0x4590e2){return client['request'](_0x9f0d13,_0x21e68d)[_0x95e3('0x9')](function(_0x59c939){logger[_0x95e3('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e5fbb,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1e5fbb,_0x95e3('0xb'),JSON['stringify'](_0x59c939));if(_0x59c939[_0x95e3('0xc')]){if(_0x59c939[_0x95e3('0xc')][_0x95e3('0xd')]===0x1f4){logger['error'](_0x95e3('0xe'),_0x1e5fbb,_0x59c939[_0x95e3('0xc')][_0x95e3('0xf')]);return _0x4590e2(_0x59c939[_0x95e3('0xc')]['message']);}logger[_0x95e3('0xc')](_0x95e3('0xe'),_0x1e5fbb,_0x59c939[_0x95e3('0xc')][_0x95e3('0xf')]);return _0x12e4be(_0x59c939[_0x95e3('0xc')][_0x95e3('0xf')]);}else{logger[_0x95e3('0xa')](_0x95e3('0xe'),_0x1e5fbb,_0x95e3('0xb'));_0x12e4be(_0x59c939['result'][_0x95e3('0xf')]);}})[_0x95e3('0x10')](function(_0x327b73){logger[_0x95e3('0xc')](_0x95e3('0xe'),_0x1e5fbb,_0x327b73);_0x4590e2(_0x327b73);});});}exports[_0x95e3('0x11')]=function(_0x87c2b7){var _0x3860cd=this;return new Promise(function(_0x5fa968,_0x4bd0a1){return db[_0x95e3('0x12')][_0x95e3('0x13')](_0x87c2b7[_0x95e3('0x14')],{'raw':_0x87c2b7[_0x95e3('0x15')]?_0x87c2b7[_0x95e3('0x15')][_0x95e3('0x16')]===undefined?!![]:![]:!![]})[_0x95e3('0x9')](function(_0x2b36e6){logger[_0x95e3('0xa')](_0x95e3('0x11'),_0x87c2b7);logger['debug'](_0x95e3('0x11'),_0x87c2b7,JSON[_0x95e3('0x17')](_0x2b36e6));_0x5fa968(_0x2b36e6);})[_0x95e3('0x10')](function(_0x198adf){logger['error'](_0x95e3('0x11'),_0x198adf['message'],_0x87c2b7);_0x4bd0a1(_0x3860cd[_0x95e3('0xc')](0x1f4,_0x198adf[_0x95e3('0xf')]));});});};exports[_0x95e3('0x18')]=function(_0x91b767){var _0x524867=this;return new Promise(function(_0x575e89,_0x4623da){return db[_0x95e3('0x12')][_0x95e3('0x19')](_0x91b767['body'],{'raw':_0x91b767[_0x95e3('0x15')]?_0x91b767['options'][_0x95e3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x91b767[_0x95e3('0x15')]?_0x91b767['options'][_0x95e3('0x1a')]||null:null,'attributes':_0x91b767[_0x95e3('0x15')]?_0x91b767[_0x95e3('0x15')]['attributes']||null:null,'limit':_0x91b767[_0x95e3('0x15')]?_0x91b767[_0x95e3('0x15')][_0x95e3('0x1b')]||null:null})[_0x95e3('0x9')](function(_0x36f729){logger['info'](_0x95e3('0x18'),_0x91b767);logger[_0x95e3('0x1c')](_0x95e3('0x18'),_0x91b767,JSON[_0x95e3('0x17')](_0x36f729));_0x575e89(_0x36f729);})['catch'](function(_0x13d9d7){logger[_0x95e3('0xc')](_0x95e3('0x18'),_0x13d9d7[_0x95e3('0xf')],_0x91b767);_0x4623da(_0x524867[_0x95e3('0xc')](0x1f4,_0x13d9d7[_0x95e3('0xf')]));});});}; \ No newline at end of file +var _0x80a2=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','raw','UpdateOpenchannelQueueReport','update','options'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x80a2,0xce));var _0x280a=function(_0x508677,_0x4f53cb){_0x508677=_0x508677-0x0;var _0x1ef259=_0x80a2[_0x508677];return _0x1ef259;};'use strict';var _=require(_0x280a('0x0'));var util=require(_0x280a('0x1'));var moment=require(_0x280a('0x2'));var BPromise=require(_0x280a('0x3'));var rs=require(_0x280a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x280a('0x5'))['db'];var utils=require(_0x280a('0x6'));var logger=require('../../config/logger')(_0x280a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x280a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39470b,_0x4872af,_0x257cd8){return new BPromise(function(_0x3d00d7,_0x3ac678){return client[_0x280a('0x9')](_0x39470b,_0x257cd8)[_0x280a('0xa')](function(_0x14fe03){logger[_0x280a('0xb')](_0x280a('0xc'),_0x4872af,_0x280a('0xd'));logger[_0x280a('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4872af,'request\x20sent',JSON[_0x280a('0xf')](_0x14fe03));if(_0x14fe03[_0x280a('0x10')]){if(_0x14fe03['error']['code']===0x1f4){logger['error'](_0x280a('0xc'),_0x4872af,_0x14fe03[_0x280a('0x10')][_0x280a('0x11')]);return _0x3ac678(_0x14fe03[_0x280a('0x10')][_0x280a('0x11')]);}logger[_0x280a('0x10')](_0x280a('0xc'),_0x4872af,_0x14fe03[_0x280a('0x10')][_0x280a('0x11')]);return _0x3d00d7(_0x14fe03['error'][_0x280a('0x11')]);}else{logger[_0x280a('0xb')](_0x280a('0xc'),_0x4872af,_0x280a('0xd'));_0x3d00d7(_0x14fe03['result']['message']);}})[_0x280a('0x12')](function(_0x1a0d23){logger[_0x280a('0x10')](_0x280a('0xc'),_0x4872af,_0x1a0d23);_0x3ac678(_0x1a0d23);});});}exports[_0x280a('0x13')]=function(_0x5c472f){var _0x4bea5c=this;return new Promise(function(_0x3b9e58,_0x3d081e){return db[_0x280a('0x14')]['create'](_0x5c472f[_0x280a('0x15')],{'raw':_0x5c472f['options']?_0x5c472f['options'][_0x280a('0x16')]===undefined?!![]:![]:!![]})[_0x280a('0xa')](function(_0x2a24bf){logger[_0x280a('0xb')](_0x280a('0x13'),_0x5c472f);logger[_0x280a('0xe')](_0x280a('0x13'),_0x5c472f,JSON['stringify'](_0x2a24bf));_0x3b9e58(_0x2a24bf);})[_0x280a('0x12')](function(_0x13948c){logger['error'](_0x280a('0x13'),_0x13948c[_0x280a('0x11')],_0x5c472f);_0x3d081e(_0x4bea5c['error'](0x1f4,_0x13948c['message']));});});};exports[_0x280a('0x17')]=function(_0x4aec43){var _0xb09907=this;return new Promise(function(_0x406eb1,_0x33a77e){return db['OpenchannelQueueReport'][_0x280a('0x18')](_0x4aec43[_0x280a('0x15')],{'raw':_0x4aec43[_0x280a('0x19')]?_0x4aec43[_0x280a('0x19')][_0x280a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aec43['options']?_0x4aec43['options'][_0x280a('0x1a')]||null:null,'attributes':_0x4aec43[_0x280a('0x19')]?_0x4aec43['options'][_0x280a('0x1b')]||null:null,'limit':_0x4aec43[_0x280a('0x19')]?_0x4aec43[_0x280a('0x19')][_0x280a('0x1c')]||null:null})[_0x280a('0xa')](function(_0x475af4){logger[_0x280a('0xb')](_0x280a('0x17'),_0x4aec43);logger['debug'](_0x280a('0x17'),_0x4aec43,JSON[_0x280a('0xf')](_0x475af4));_0x406eb1(_0x475af4);})[_0x280a('0x12')](function(_0x471ffb){logger[_0x280a('0x10')]('UpdateOpenchannelQueueReport',_0x471ffb[_0x280a('0x11')],_0x4aec43);_0x33a77e(_0xb09907[_0x280a('0x10')](0x1f4,_0x471ffb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 31ba901..45dba1a 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 _0x4ce7=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x4892a4,_0x4af72c){var _0x5719a7=function(_0x3b61ea){while(--_0x3b61ea){_0x4892a4['push'](_0x4892a4['shift']());}};_0x5719a7(++_0x4af72c);}(_0x4ce7,0x1c3));var _0x74ce=function(_0x8abd52,_0x4e7413){_0x8abd52=_0x8abd52-0x0;var _0x561dd8=_0x4ce7[_0x8abd52];return _0x561dd8;};'use strict';var multer=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var path=require('path');var timeout=require(_0x74ce('0x2'));var express=require(_0x74ce('0x3'));var router=express['Router']();var auth=require(_0x74ce('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x74ce('0x5')]('/',auth[_0x74ce('0x6')](),controller[_0x74ce('0x7')]);router[_0x74ce('0x5')](_0x74ce('0x8'),auth[_0x74ce('0x6')](),controller[_0x74ce('0x9')]);router['get'](_0x74ce('0xa'),auth[_0x74ce('0x6')](),controller[_0x74ce('0xb')]);router[_0x74ce('0xc')]('/',auth['isAuthenticated'](),controller[_0x74ce('0xd')]);router[_0x74ce('0xe')](_0x74ce('0xa'),auth[_0x74ce('0x6')](),controller[_0x74ce('0xf')]);router[_0x74ce('0x10')](_0x74ce('0xa'),auth['isAuthenticated'](),controller[_0x74ce('0x11')]);module[_0x74ce('0x12')]=router; \ No newline at end of file +var _0x4c01=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x4c01,0x13c));var _0x14c0=function(_0xe920d6,_0x5a0508){_0xe920d6=_0xe920d6-0x0;var _0xf578b7=_0x4c01[_0xe920d6];return _0xf578b7;};'use strict';var multer=require(_0x14c0('0x0'));var util=require('util');var path=require(_0x14c0('0x1'));var timeout=require(_0x14c0('0x2'));var express=require(_0x14c0('0x3'));var router=express[_0x14c0('0x4')]();var auth=require(_0x14c0('0x5'));var interaction=require(_0x14c0('0x6'));var config=require(_0x14c0('0x7'));var controller=require(_0x14c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x14c0('0x9')]);router[_0x14c0('0xa')](_0x14c0('0xb'),auth[_0x14c0('0xc')](),controller['describe']);router[_0x14c0('0xa')](_0x14c0('0xd'),auth['isAuthenticated'](),controller[_0x14c0('0xe')]);router[_0x14c0('0xf')]('/',auth['isAuthenticated'](),controller[_0x14c0('0x10')]);router[_0x14c0('0x11')](_0x14c0('0xd'),auth[_0x14c0('0xc')](),controller[_0x14c0('0x12')]);router['delete'](_0x14c0('0xd'),auth[_0x14c0('0xc')](),controller[_0x14c0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8033a44..a939381 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 _0x154a=['queue','moment','sequelize','STRING','ENUM','account'];(function(_0x46e82b,_0x497aff){var _0x19b98a=function(_0x3f270b){while(--_0x3f270b){_0x46e82b['push'](_0x46e82b['shift']());}};_0x19b98a(++_0x497aff);}(_0x154a,0xf1));var _0xa154=function(_0x192145,_0x20dcfd){_0x192145=_0x192145-0x0;var _0x57bf7b=_0x154a[_0x192145];return _0x57bf7b;};'use strict';var moment=require(_0xa154('0x0'));var Sequelize=require(_0xa154('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa154('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa154('0x3')](_0xa154('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xa154('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8ce2=['agent','queue','moment','exports','ENUM','account'];(function(_0x49e560,_0x587bc7){var _0x4ddbc6=function(_0xaac1d8){while(--_0xaac1d8){_0x49e560['push'](_0x49e560['shift']());}};_0x4ddbc6(++_0x587bc7);}(_0x8ce2,0x188));var _0x28ce=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8ce2[_0x20c9b2];return _0x2c6030;};'use strict';var moment=require(_0x28ce('0x0'));var Sequelize=require('sequelize');module[_0x28ce('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x28ce('0x2')](_0x28ce('0x3'),_0x28ce('0x4'),_0x28ce('0x5')),'allowNull':![],'defaultValue':_0x28ce('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1fba3b7..0ec4e9c 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 _0xb43b=['include','options','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','limit','set','apply','save','then','sendStatus','stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','type','key','field','includeAll','findAll','rows','catch','fields'];(function(_0x2874a5,_0x32b680){var _0x1e427a=function(_0x550897){while(--_0x550897){_0x2874a5['push'](_0x2874a5['shift']());}};_0x1e427a(++_0x32b680);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1cc6f4,_0x840d05){_0x1cc6f4=_0x1cc6f4-0x0;var _0x29c487=_0xb43b[_0x1cc6f4];return _0x29c487;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var hardwareService=require(_0xbb43('0x12'));var logger=require(_0xbb43('0x13'))(_0xbb43('0x14'));var utils=require(_0xbb43('0x15'));var config=require(_0xbb43('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a473,_0x2a5a4d){_0x2a5a4d=_0x2a5a4d||0xcc;return function(_0x50e2c0){if(_0x50e2c0){return _0x36a473['sendStatus'](_0x2a5a4d);}return _0x36a473[_0xbb43('0x17')](_0x2a5a4d)['end']();};}function respondWithResult(_0x593d0b,_0x438591){_0x438591=_0x438591||0xc8;return function(_0x5a509f){if(_0x5a509f){return _0x593d0b[_0xbb43('0x17')](_0x438591)[_0xbb43('0x18')](_0x5a509f);}};}function respondWithFilteredResult(_0x55926f,_0x4a6e18){return function(_0x4d5bcf){if(_0x4d5bcf){var _0x338120=_0x4d5bcf[_0xbb43('0x19')],_0x2abce0=_0x4a6e18['offset'],_0x57bd1d=_0x4a6e18['offset']+_0x4a6e18[_0xbb43('0x1a')],_0x526330;if(_0x57bd1d>=_0x338120){_0x57bd1d=_0x338120;_0x526330=0xc8;}else{_0x526330=0xce;}_0x55926f[_0xbb43('0x17')](_0x526330);return _0x55926f[_0xbb43('0x1b')]('Content-Range',_0x2abce0+'-'+_0x57bd1d+'/'+_0x338120)[_0xbb43('0x18')](_0x4d5bcf);}return null;};}function patchUpdates(_0x4f28b8){return function(_0x3bb57d){try{jsonpatch[_0xbb43('0x1c')](_0x3bb57d,_0x4f28b8,!![]);}catch(_0x4dfc54){return BPromise['reject'](_0x4dfc54);}return _0x3bb57d[_0xbb43('0x1d')]();};}function saveUpdates(_0x1b6e69,_0xdb7f2e){return function(_0x2bf2d4){if(_0x2bf2d4){return _0x2bf2d4['update'](_0x1b6e69)[_0xbb43('0x1e')](function(_0x5f4416){return _0x5f4416;});}return null;};}function removeEntity(_0x3a257d,_0x4bfaca){return function(_0x2f5e31){if(_0x2f5e31){return _0x2f5e31['destroy']()[_0xbb43('0x1e')](function(){_0x3a257d[_0xbb43('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0768,_0x4dfb7f){return function(_0xf24e60){if(!_0xf24e60){_0x1d0768[_0xbb43('0x1f')](0x194);}return _0xf24e60;};}function handleError(_0x16384e,_0x4d6d77){_0x4d6d77=_0x4d6d77||0x1f4;return function(_0x53f0d5){logger['error'](_0x53f0d5[_0xbb43('0x20')]);if(_0x53f0d5[_0xbb43('0x21')]){delete _0x53f0d5['name'];}_0x16384e[_0xbb43('0x17')](_0x4d6d77)[_0xbb43('0x22')](_0x53f0d5);};}exports[_0xbb43('0x23')]=function(_0x3874fb,_0x4ed43f){var _0x4b5342={},_0x27fd7a={},_0x42800f={'count':0x0,'rows':[]};var _0xa88db0=db[_0xbb43('0x24')][_0xbb43('0x25')];_0x27fd7a[_0xbb43('0x26')]=_[_0xbb43('0x27')](_0xa88db0);_0x27fd7a[_0xbb43('0x28')]=_['keys'](_0x3874fb[_0xbb43('0x28')]);_0x27fd7a['filters']=_[_0xbb43('0x29')](_0x27fd7a[_0xbb43('0x26')],_0x27fd7a[_0xbb43('0x28')]);_0x4b5342[_0xbb43('0x2a')]=_['intersection'](_0x27fd7a[_0xbb43('0x26')],qs['fields'](_0x3874fb['query']['fields']));_0x4b5342[_0xbb43('0x2a')]=_0x4b5342['attributes'][_0xbb43('0x2b')]?_0x4b5342[_0xbb43('0x2a')]:_0x27fd7a[_0xbb43('0x26')];if(!_0x3874fb['query'][_0xbb43('0x2c')](_0xbb43('0x2d'))){_0x4b5342[_0xbb43('0x1a')]=qs[_0xbb43('0x1a')](_0x3874fb[_0xbb43('0x28')][_0xbb43('0x1a')]);_0x4b5342[_0xbb43('0x2e')]=qs[_0xbb43('0x2e')](_0x3874fb['query'][_0xbb43('0x2e')]);}_0x4b5342[_0xbb43('0x2f')]=qs[_0xbb43('0x30')](_0x3874fb[_0xbb43('0x28')][_0xbb43('0x30')]);_0x4b5342[_0xbb43('0x31')]=qs[_0xbb43('0x32')](_[_0xbb43('0x33')](_0x3874fb[_0xbb43('0x28')],_0x27fd7a[_0xbb43('0x32')]));if(_0x3874fb[_0xbb43('0x28')][_0xbb43('0x34')]){_0x4b5342[_0xbb43('0x31')]=_[_0xbb43('0x35')](_0x4b5342[_0xbb43('0x31')],{'$or':_[_0xbb43('0x36')](_0xa88db0,function(_0x549841){if(_0x549841[_0xbb43('0x37')][_0xbb43('0x38')]!=='VIRTUAL'){var _0x285014={};_0x285014[_0x549841[_0xbb43('0x39')]]={'$like':'%'+_0x3874fb[_0xbb43('0x28')]['filter']+'%'};return _0x285014;}})});}_0x4b5342=_['merge']({},_0x4b5342,_0x3874fb['options']);var _0x40df31={'where':_0x4b5342[_0xbb43('0x31')]};return db['OpenchannelTransferReport']['count'](_0x40df31)[_0xbb43('0x1e')](function(_0x275425){_0x42800f[_0xbb43('0x19')]=_0x275425;if(_0x3874fb[_0xbb43('0x28')][_0xbb43('0x3a')]){_0x4b5342['include']=[{'all':!![]}];}return db[_0xbb43('0x24')][_0xbb43('0x3b')](_0x4b5342);})[_0xbb43('0x1e')](function(_0x3340aa){_0x42800f[_0xbb43('0x3c')]=_0x3340aa;return _0x42800f;})['then'](respondWithFilteredResult(_0x4ed43f,_0x4b5342))[_0xbb43('0x3d')](handleError(_0x4ed43f,null));};exports['show']=function(_0x1c076f,_0x93aa1c){var _0x56c808={'raw':!![],'where':{'id':_0x1c076f['params']['id']}},_0x4783fe={};_0x4783fe[_0xbb43('0x26')]=_[_0xbb43('0x27')](db[_0xbb43('0x24')][_0xbb43('0x25')]);_0x4783fe['query']=_[_0xbb43('0x27')](_0x1c076f[_0xbb43('0x28')]);_0x4783fe['filters']=_[_0xbb43('0x29')](_0x4783fe['model'],_0x4783fe[_0xbb43('0x28')]);_0x56c808[_0xbb43('0x2a')]=_[_0xbb43('0x29')](_0x4783fe[_0xbb43('0x26')],qs[_0xbb43('0x3e')](_0x1c076f[_0xbb43('0x28')]['fields']));_0x56c808[_0xbb43('0x2a')]=_0x56c808['attributes'][_0xbb43('0x2b')]?_0x56c808[_0xbb43('0x2a')]:_0x4783fe[_0xbb43('0x26')];if(_0x1c076f[_0xbb43('0x28')]['includeAll']){_0x56c808[_0xbb43('0x3f')]=[{'all':!![]}];}_0x56c808=_[_0xbb43('0x35')]({},_0x56c808,_0x1c076f[_0xbb43('0x40')]);return db[_0xbb43('0x24')][_0xbb43('0x41')](_0x56c808)[_0xbb43('0x1e')](handleEntityNotFound(_0x93aa1c,null))[_0xbb43('0x1e')](respondWithResult(_0x93aa1c,null))[_0xbb43('0x3d')](handleError(_0x93aa1c,null));};exports['create']=function(_0x2eaece,_0x8c57af){return db['OpenchannelTransferReport'][_0xbb43('0x42')](_0x2eaece['body'],{})['then'](respondWithResult(_0x8c57af,0xc9))['catch'](handleError(_0x8c57af,null));};exports['update']=function(_0x1c3482,_0x5a649b){if(_0x1c3482[_0xbb43('0x43')]['id']){delete _0x1c3482['body']['id'];}return db[_0xbb43('0x24')][_0xbb43('0x41')]({'where':{'id':_0x1c3482[_0xbb43('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a649b,null))[_0xbb43('0x1e')](saveUpdates(_0x1c3482['body'],null))[_0xbb43('0x1e')](respondWithResult(_0x5a649b,null))[_0xbb43('0x3d')](handleError(_0x5a649b,null));};exports[_0xbb43('0x45')]=function(_0x29840e,_0x417ad9){return db[_0xbb43('0x24')][_0xbb43('0x41')]({'where':{'id':_0x29840e['params']['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x417ad9,null))[_0xbb43('0x1e')](removeEntity(_0x417ad9,null))[_0xbb43('0x3d')](handleError(_0x417ad9,null));};exports[_0xbb43('0x46')]=function(_0x4bea2a,_0x46a4af){return db[_0xbb43('0x24')][_0xbb43('0x46')]()[_0xbb43('0x1e')](respondWithResult(_0x46a4af,null))['catch'](handleError(_0x46a4af,null));}; \ No newline at end of file +var _0x9ffd=['sendStatus','stack','name','send','index','OpenchannelTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','key','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x413924,_0x4d74a0){var _0x30a095=function(_0x4a0719){while(--_0x4a0719){_0x413924['push'](_0x413924['shift']());}};_0x30a095(++_0x4d74a0);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2f854c,_0x3b4d07){_0x2f854c=_0x2f854c-0x0;var _0x383cf4=_0x9ffd[_0x2f854c];return _0x383cf4;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd9ff('0x11'));var logger=require(_0xd9ff('0x12'))(_0xd9ff('0x13'));var utils=require(_0xd9ff('0x14'));var config=require(_0xd9ff('0x15'));var db=require(_0xd9ff('0x16'))['db'];function respondWithStatusCode(_0x1885da,_0x1c2a16){_0x1c2a16=_0x1c2a16||0xcc;return function(_0x47d842){if(_0x47d842){return _0x1885da['sendStatus'](_0x1c2a16);}return _0x1885da[_0xd9ff('0x17')](_0x1c2a16)[_0xd9ff('0x18')]();};}function respondWithResult(_0x415c58,_0x350a5d){_0x350a5d=_0x350a5d||0xc8;return function(_0x12c39a){if(_0x12c39a){return _0x415c58['status'](_0x350a5d)[_0xd9ff('0x19')](_0x12c39a);}};}function respondWithFilteredResult(_0x3c9ace,_0x5c1a28){return function(_0xf14c9f){if(_0xf14c9f){var _0x5db010=_0xf14c9f[_0xd9ff('0x1a')],_0x4ffe54=_0x5c1a28['offset'],_0x547e28=_0x5c1a28[_0xd9ff('0x1b')]+_0x5c1a28[_0xd9ff('0x1c')],_0x4c5718;if(_0x547e28>=_0x5db010){_0x547e28=_0x5db010;_0x4c5718=0xc8;}else{_0x4c5718=0xce;}_0x3c9ace[_0xd9ff('0x17')](_0x4c5718);return _0x3c9ace[_0xd9ff('0x1d')](_0xd9ff('0x1e'),_0x4ffe54+'-'+_0x547e28+'/'+_0x5db010)[_0xd9ff('0x19')](_0xf14c9f);}return null;};}function patchUpdates(_0x3ccf15){return function(_0x128588){try{jsonpatch[_0xd9ff('0x1f')](_0x128588,_0x3ccf15,!![]);}catch(_0x1f028f){return BPromise[_0xd9ff('0x20')](_0x1f028f);}return _0x128588[_0xd9ff('0x21')]();};}function saveUpdates(_0x46a6ab,_0x4c8740){return function(_0x4cf8ec){if(_0x4cf8ec){return _0x4cf8ec[_0xd9ff('0x22')](_0x46a6ab)[_0xd9ff('0x23')](function(_0x4eea4d){return _0x4eea4d;});}return null;};}function removeEntity(_0x588151,_0x5ab7b6){return function(_0x4b1477){if(_0x4b1477){return _0x4b1477[_0xd9ff('0x24')]()['then'](function(){_0x588151[_0xd9ff('0x17')](0xcc)[_0xd9ff('0x18')]();});}};}function handleEntityNotFound(_0x291f52,_0x9f074e){return function(_0x278b66){if(!_0x278b66){_0x291f52[_0xd9ff('0x25')](0x194);}return _0x278b66;};}function handleError(_0x4b058a,_0x4fada1){_0x4fada1=_0x4fada1||0x1f4;return function(_0x1136e9){logger['error'](_0x1136e9[_0xd9ff('0x26')]);if(_0x1136e9['name']){delete _0x1136e9[_0xd9ff('0x27')];}_0x4b058a['status'](_0x4fada1)[_0xd9ff('0x28')](_0x1136e9);};}exports[_0xd9ff('0x29')]=function(_0x2138b4,_0x2970e8){var _0x5d685e={},_0x11a17b={},_0xe11f88={'count':0x0,'rows':[]};var _0x1c78c4=db[_0xd9ff('0x2a')]['rawAttributes'];_0x11a17b[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](_0x1c78c4);_0x11a17b[_0xd9ff('0x2d')]=_[_0xd9ff('0x2c')](_0x2138b4[_0xd9ff('0x2d')]);_0x11a17b[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x11a17b[_0xd9ff('0x2b')],_0x11a17b[_0xd9ff('0x2d')]);_0x5d685e['attributes']=_[_0xd9ff('0x2f')](_0x11a17b['model'],qs[_0xd9ff('0x30')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x30')]));_0x5d685e['attributes']=_0x5d685e[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x5d685e[_0xd9ff('0x31')]:_0x11a17b[_0xd9ff('0x2b')];if(!_0x2138b4['query'][_0xd9ff('0x33')]('nolimit')){_0x5d685e[_0xd9ff('0x1c')]=qs[_0xd9ff('0x1c')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1c')]);_0x5d685e[_0xd9ff('0x1b')]=qs[_0xd9ff('0x1b')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1b')]);}_0x5d685e[_0xd9ff('0x34')]=qs[_0xd9ff('0x35')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5d685e[_0xd9ff('0x36')]=qs[_0xd9ff('0x2e')](_['pick'](_0x2138b4[_0xd9ff('0x2d')],_0x11a17b[_0xd9ff('0x2e')]));if(_0x2138b4[_0xd9ff('0x2d')]['filter']){_0x5d685e[_0xd9ff('0x36')]=_['merge'](_0x5d685e[_0xd9ff('0x36')],{'$or':_['map'](_0x1c78c4,function(_0x20a021){if(_0x20a021['type'][_0xd9ff('0x37')]!==_0xd9ff('0x38')){var _0x11566b={};_0x11566b[_0x20a021['field']]={'$like':'%'+_0x2138b4['query']['filter']+'%'};return _0x11566b;}})});}_0x5d685e=_[_0xd9ff('0x39')]({},_0x5d685e,_0x2138b4[_0xd9ff('0x3a')]);var _0x405c3b={'where':_0x5d685e[_0xd9ff('0x36')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1a')](_0x405c3b)['then'](function(_0x4c00c2){_0xe11f88['count']=_0x4c00c2;if(_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x3b')]){_0x5d685e[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')]['findAll'](_0x5d685e);})[_0xd9ff('0x23')](function(_0x5b8e17){_0xe11f88[_0xd9ff('0x3d')]=_0x5b8e17;return _0xe11f88;})[_0xd9ff('0x23')](respondWithFilteredResult(_0x2970e8,_0x5d685e))[_0xd9ff('0x3e')](handleError(_0x2970e8,null));};exports[_0xd9ff('0x3f')]=function(_0x59fc07,_0x1e34da){var _0x2d4d97={'raw':!![],'where':{'id':_0x59fc07[_0xd9ff('0x40')]['id']}},_0x4961a7={};_0x4961a7[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](db[_0xd9ff('0x2a')][_0xd9ff('0x41')]);_0x4961a7[_0xd9ff('0x2d')]=_['keys'](_0x59fc07[_0xd9ff('0x2d')]);_0x4961a7[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],_0x4961a7[_0xd9ff('0x2d')]);_0x2d4d97['attributes']=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],qs[_0xd9ff('0x30')](_0x59fc07['query']['fields']));_0x2d4d97[_0xd9ff('0x31')]=_0x2d4d97[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x2d4d97[_0xd9ff('0x31')]:_0x4961a7[_0xd9ff('0x2b')];if(_0x59fc07[_0xd9ff('0x2d')]['includeAll']){_0x2d4d97[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x2d4d97=_[_0xd9ff('0x39')]({},_0x2d4d97,_0x59fc07['options']);return db[_0xd9ff('0x2a')][_0xd9ff('0x42')](_0x2d4d97)[_0xd9ff('0x23')](handleEntityNotFound(_0x1e34da,null))[_0xd9ff('0x23')](respondWithResult(_0x1e34da,null))[_0xd9ff('0x3e')](handleError(_0x1e34da,null));};exports['create']=function(_0x5cf34e,_0x5718ab){return db[_0xd9ff('0x2a')]['create'](_0x5cf34e[_0xd9ff('0x43')],{})[_0xd9ff('0x23')](respondWithResult(_0x5718ab,0xc9))[_0xd9ff('0x3e')](handleError(_0x5718ab,null));};exports['update']=function(_0x396736,_0x153f09){if(_0x396736['body']['id']){delete _0x396736[_0xd9ff('0x43')]['id'];}return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x396736[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x153f09,null))[_0xd9ff('0x23')](saveUpdates(_0x396736['body'],null))[_0xd9ff('0x23')](respondWithResult(_0x153f09,null))['catch'](handleError(_0x153f09,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x3d91e6['params']['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x23')](removeEntity(_0x2bf37a,null))[_0xd9ff('0x3e')](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x44')]=function(_0x5c3e11,_0x537282){return db['OpenchannelTransferReport'][_0xd9ff('0x44')]()[_0xd9ff('0x23')](respondWithResult(_0x537282,null))[_0xd9ff('0x3e')](handleError(_0x537282,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index cc29fad..35b3e66 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 _0x46ed=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','lodash','util','../../config/logger','bluebird','path'];(function(_0x1eeff8,_0x501ab6){var _0x4fbda3=function(_0xb168ae){while(--_0xb168ae){_0x1eeff8['push'](_0x1eeff8['shift']());}};_0x4fbda3(++_0x501ab6);}(_0x46ed,0x10e));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require(_0xd46e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd46e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x4'));var rimraf=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x29d813,_0x2248cf){return _0x29d813[_0xd46e('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0xd46e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4ae=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','define','report_openchannel_transfer','uniqueid'];(function(_0x1f5812,_0x5d342a){var _0x460582=function(_0x40037f){while(--_0x40037f){_0x1f5812['push'](_0x1f5812['shift']());}};_0x460582(++_0x5d342a);}(_0xd4ae,0xfa));var _0xed4a=function(_0x3c3a03,_0x3c0da1){_0x3c3a03=_0x3c3a03-0x0;var _0x57ff53=_0xd4ae[_0x3c3a03];return _0x57ff53;};'use strict';var _=require(_0xed4a('0x0'));var util=require(_0xed4a('0x1'));var logger=require(_0xed4a('0x2'))(_0xed4a('0x3'));var moment=require('moment');var BPromise=require(_0xed4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed4a('0x5'));var config=require(_0xed4a('0x6'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x112722,_0x4b66f8){return _0x112722[_0xed4a('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0xed4a('0x8'),'paranoid':![],'indexes':[{'name':_0xed4a('0x9'),'fields':[_0xed4a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f40523b..630c372 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 _0xf360=['error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0xf360,0x9e));var _0x0f36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf360[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0f36('0x0'));var util=require(_0x0f36('0x1'));var moment=require(_0x0f36('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f36('0x4'))['db'];var utils=require(_0x0f36('0x5'));var logger=require(_0x0f36('0x6'))('rpc');var config=require(_0x0f36('0x7'));var jayson=require(_0x0f36('0x8'));var client=jayson[_0x0f36('0x9')][_0x0f36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db632,_0x259878,_0x2d4bb7){return new BPromise(function(_0x370193,_0x5c356f){return client[_0x0f36('0xb')](_0x2db632,_0x2d4bb7)[_0x0f36('0xc')](function(_0x47718b){logger[_0x0f36('0xd')](_0x0f36('0xe'),_0x259878,_0x0f36('0xf'));logger['debug'](_0x0f36('0x10'),_0x259878,_0x0f36('0xf'),JSON[_0x0f36('0x11')](_0x47718b));if(_0x47718b['error']){if(_0x47718b[_0x0f36('0x12')]['code']===0x1f4){logger['error'](_0x0f36('0xe'),_0x259878,_0x47718b[_0x0f36('0x12')]['message']);return _0x5c356f(_0x47718b[_0x0f36('0x12')][_0x0f36('0x13')]);}logger[_0x0f36('0x12')](_0x0f36('0xe'),_0x259878,_0x47718b['error'][_0x0f36('0x13')]);return _0x370193(_0x47718b['error'][_0x0f36('0x13')]);}else{logger[_0x0f36('0xd')](_0x0f36('0xe'),_0x259878,_0x0f36('0xf'));_0x370193(_0x47718b[_0x0f36('0x14')][_0x0f36('0x13')]);}})[_0x0f36('0x15')](function(_0x486739){logger['error'](_0x0f36('0xe'),_0x259878,_0x486739);_0x5c356f(_0x486739);});});} \ No newline at end of file +var _0x9a13=['OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x11fdc4,_0x1951a4){var _0x3c3ffa=function(_0x2577f4){while(--_0x2577f4){_0x11fdc4['push'](_0x11fdc4['shift']());}};_0x3c3ffa(++_0x1951a4);}(_0x9a13,0x76));var _0x39a1=function(_0x5ba426,_0x5bdf47){_0x5ba426=_0x5ba426-0x0;var _0x4c1e23=_0x9a13[_0x5ba426];return _0x4c1e23;};'use strict';var _=require(_0x39a1('0x0'));var util=require(_0x39a1('0x1'));var moment=require(_0x39a1('0x2'));var BPromise=require(_0x39a1('0x3'));var rs=require(_0x39a1('0x4'));var fs=require('fs');var Redis=require(_0x39a1('0x5'));var db=require(_0x39a1('0x6'))['db'];var utils=require(_0x39a1('0x7'));var logger=require(_0x39a1('0x8'))('rpc');var config=require(_0x39a1('0x9'));var jayson=require(_0x39a1('0xa'));var client=jayson[_0x39a1('0xb')][_0x39a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd7aac5,_0x5307ca,_0x58054b){return new BPromise(function(_0x3e2f17,_0x5d5c08){return client[_0x39a1('0xd')](_0xd7aac5,_0x58054b)[_0x39a1('0xe')](function(_0xdc316){logger[_0x39a1('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5307ca,_0x39a1('0x10'));logger[_0x39a1('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5307ca,_0x39a1('0x10'),JSON[_0x39a1('0x12')](_0xdc316));if(_0xdc316[_0x39a1('0x13')]){if(_0xdc316[_0x39a1('0x13')]['code']===0x1f4){logger['error'](_0x39a1('0x14'),_0x5307ca,_0xdc316['error'][_0x39a1('0x15')]);return _0x5d5c08(_0xdc316['error'][_0x39a1('0x15')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5307ca,_0xdc316['error'][_0x39a1('0x15')]);return _0x3e2f17(_0xdc316[_0x39a1('0x13')][_0x39a1('0x15')]);}else{logger[_0x39a1('0xf')](_0x39a1('0x14'),_0x5307ca,_0x39a1('0x10'));_0x3e2f17(_0xdc316['result'][_0x39a1('0x15')]);}})[_0x39a1('0x16')](function(_0x12f783){logger[_0x39a1('0x13')](_0x39a1('0x14'),_0x5307ca,_0x12f783);_0x5d5c08(_0x12f783);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 4a05de9..b69b4f2 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 _0x5f6a=['isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller','get'];(function(_0x2368c1,_0x1e7cc6){var _0x1f1b07=function(_0x88b66){while(--_0x88b66){_0x2368c1['push'](_0x2368c1['shift']());}};_0x1f1b07(++_0x1e7cc6);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x2f473d,_0x75ca32){_0x2f473d=_0x2f473d-0x0;var _0x240d71=_0x5f6a[_0x2f473d];return _0x240d71;};'use strict';var multer=require(_0xa5f6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa5f6('0x1'));var express=require(_0xa5f6('0x2'));var router=express[_0xa5f6('0x3')]();var auth=require(_0xa5f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa5f6('0x5'));var controller=require(_0xa5f6('0x6'));router[_0xa5f6('0x7')]('/',auth[_0xa5f6('0x8')](),controller[_0xa5f6('0x9')]);router[_0xa5f6('0x7')](_0xa5f6('0xa'),auth[_0xa5f6('0x8')](),controller[_0xa5f6('0xb')]);router[_0xa5f6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa5f6('0xa'),auth[_0xa5f6('0x8')](),controller[_0xa5f6('0xd')]);router[_0xa5f6('0xe')](_0xa5f6('0xa'),auth['isAuthenticated'](),controller[_0xa5f6('0xf')]);module[_0xa5f6('0x10')]=router; \ No newline at end of file +var _0x5ab4=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x40a6f0,_0x556962){var _0x1c5519=function(_0x3d5513){while(--_0x3d5513){_0x40a6f0['push'](_0x40a6f0['shift']());}};_0x1c5519(++_0x556962);}(_0x5ab4,0x9f));var _0x45ab=function(_0x3abc8a,_0x1e5643){_0x3abc8a=_0x3abc8a-0x0;var _0x4889fe=_0x5ab4[_0x3abc8a];return _0x4889fe;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var auth=require(_0x45ab('0x5'));var interaction=require(_0x45ab('0x6'));var config=require(_0x45ab('0x7'));var controller=require(_0x45ab('0x8'));router[_0x45ab('0x9')]('/',auth[_0x45ab('0xa')](),controller['index']);router[_0x45ab('0x9')](_0x45ab('0xb'),auth[_0x45ab('0xa')](),controller[_0x45ab('0xc')]);router[_0x45ab('0xd')]('/',auth[_0x45ab('0xa')](),controller[_0x45ab('0xe')]);router[_0x45ab('0xf')](_0x45ab('0xb'),auth[_0x45ab('0xa')](),controller[_0x45ab('0x10')]);router[_0x45ab('0x11')](_0x45ab('0xb'),auth['isAuthenticated'](),controller[_0x45ab('0x12')]);module[_0x45ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b2da93c..d82975d 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 _0xbc69=['name','sequelize'];(function(_0x52246c,_0x32403f){var _0x3a690c=function(_0x182b60){while(--_0x182b60){_0x52246c['push'](_0x52246c['shift']());}};_0x3a690c(++_0x32403f);}(_0xbc69,0xa9));var _0x9bc6=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xbc69[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require(_0x9bc6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9bc6('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x70e4=['STRING','name','exports'];(function(_0x10f316,_0x5822db){var _0x568d7e=function(_0x304445){while(--_0x304445){_0x10f316['push'](_0x10f316['shift']());}};_0x568d7e(++_0x5822db);}(_0x70e4,0xcb));var _0x470e=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x70e4[_0x1597e2];return _0x4c8c0a;};'use strict';var Sequelize=require('sequelize');module[_0x470e('0x0')]={'name':{'type':Sequelize[_0x470e('0x1')],'unique':_0x470e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x470e('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 855b95f..64382de 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 _0x62bb=['key','VIRTUAL','field','options','includeAll','include','catch','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','type'];(function(_0x48f3fd,_0x4beefb){var _0x41ab12=function(_0x1e1cdd){while(--_0x1e1cdd){_0x48f3fd['push'](_0x48f3fd['shift']());}};_0x41ab12(++_0x4beefb);}(_0x62bb,0xae));var _0xb62b=function(_0x5971ca,_0x54b79a){_0x5971ca=_0x5971ca-0x0;var _0x46c0b6=_0x62bb[_0x5971ca];return _0x46c0b6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb62b('0x0'));var rp=require(_0xb62b('0x1'));var moment=require(_0xb62b('0x2'));var BPromise=require(_0xb62b('0x3'));var Mustache=require(_0xb62b('0x4'));var util=require('util');var path=require(_0xb62b('0x5'));var sox=require(_0xb62b('0x6'));var csv=require('to-csv');var ejs=require(_0xb62b('0x7'));var fs=require('fs');var _=require(_0xb62b('0x8'));var squel=require(_0xb62b('0x9'));var crypto=require(_0xb62b('0xa'));var jsforce=require(_0xb62b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb62b('0xc'));var querystring=require('querystring');var Papa=require(_0xb62b('0xd'));var Redis=require(_0xb62b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb62b('0xf'));var hardwareService=require(_0xb62b('0x10'));var logger=require(_0xb62b('0x11'))(_0xb62b('0x12'));var utils=require(_0xb62b('0x13'));var config=require('../../config/environment');var db=require(_0xb62b('0x14'))['db'];function respondWithStatusCode(_0x5d5a4c,_0x25111d){_0x25111d=_0x25111d||0xcc;return function(_0x1d9e59){if(_0x1d9e59){return _0x5d5a4c[_0xb62b('0x15')](_0x25111d);}return _0x5d5a4c[_0xb62b('0x16')](_0x25111d)[_0xb62b('0x17')]();};}function respondWithResult(_0x50c41b,_0x4ed7a0){_0x4ed7a0=_0x4ed7a0||0xc8;return function(_0x2a81f3){if(_0x2a81f3){return _0x50c41b[_0xb62b('0x16')](_0x4ed7a0)[_0xb62b('0x18')](_0x2a81f3);}};}function respondWithFilteredResult(_0x2aa28b,_0x11649e){return function(_0x4df62f){if(_0x4df62f){var _0x51f172=_0x4df62f[_0xb62b('0x19')],_0x13d8a8=_0x11649e['offset'],_0x18f633=_0x11649e[_0xb62b('0x1a')]+_0x11649e[_0xb62b('0x1b')],_0x494f19;if(_0x18f633>=_0x51f172){_0x18f633=_0x51f172;_0x494f19=0xc8;}else{_0x494f19=0xce;}_0x2aa28b['status'](_0x494f19);return _0x2aa28b[_0xb62b('0x1c')](_0xb62b('0x1d'),_0x13d8a8+'-'+_0x18f633+'/'+_0x51f172)[_0xb62b('0x18')](_0x4df62f);}return null;};}function patchUpdates(_0x2de9ec){return function(_0x1fccf8){try{jsonpatch[_0xb62b('0x1e')](_0x1fccf8,_0x2de9ec,!![]);}catch(_0x350661){return BPromise['reject'](_0x350661);}return _0x1fccf8['save']();};}function saveUpdates(_0x134129,_0x5dec09){return function(_0x218774){if(_0x218774){return _0x218774[_0xb62b('0x1f')](_0x134129)[_0xb62b('0x20')](function(_0x50be93){return _0x50be93;});}return null;};}function removeEntity(_0x5f34b2,_0x5bc781){return function(_0x24b210){if(_0x24b210){return _0x24b210[_0xb62b('0x21')]()[_0xb62b('0x20')](function(){var _0x33493d=_0x24b210[_0xb62b('0x22')]({'plain':!![]});var _0x51ab80=_0xb62b('0x23');return db[_0xb62b('0x24')][_0xb62b('0x21')]({'where':{'type':_0x51ab80,'resourceId':_0x33493d['id']}})['then'](function(){return _0x24b210;});})[_0xb62b('0x20')](function(){_0x5f34b2[_0xb62b('0x16')](0xcc)[_0xb62b('0x17')]();});}};}function handleEntityNotFound(_0x2565f0,_0x9d4a96){return function(_0x22aa49){if(!_0x22aa49){_0x2565f0['sendStatus'](0x194);}return _0x22aa49;};}function handleError(_0x29d549,_0x2f8040){_0x2f8040=_0x2f8040||0x1f4;return function(_0x10d99c){logger[_0xb62b('0x25')](_0x10d99c[_0xb62b('0x26')]);if(_0x10d99c[_0xb62b('0x27')]){delete _0x10d99c[_0xb62b('0x27')];}_0x29d549['status'](_0x2f8040)[_0xb62b('0x28')](_0x10d99c);};}exports['index']=function(_0x2db3d9,_0xff664c){var _0x14fd18={},_0x2287d9={},_0x1eab8f={'count':0x0,'rows':[]};var _0x15822d=db['Pause'][_0xb62b('0x29')];_0x2287d9[_0xb62b('0x2a')]=_[_0xb62b('0x2b')](_0x15822d);_0x2287d9[_0xb62b('0x2c')]=_['keys'](_0x2db3d9[_0xb62b('0x2c')]);_0x2287d9['filters']=_[_0xb62b('0x2d')](_0x2287d9[_0xb62b('0x2a')],_0x2287d9[_0xb62b('0x2c')]);_0x14fd18[_0xb62b('0x2e')]=_[_0xb62b('0x2d')](_0x2287d9[_0xb62b('0x2a')],qs[_0xb62b('0x2f')](_0x2db3d9[_0xb62b('0x2c')]['fields']));_0x14fd18[_0xb62b('0x2e')]=_0x14fd18[_0xb62b('0x2e')][_0xb62b('0x30')]?_0x14fd18['attributes']:_0x2287d9[_0xb62b('0x2a')];if(!_0x2db3d9[_0xb62b('0x2c')][_0xb62b('0x31')]('nolimit')){_0x14fd18['limit']=qs[_0xb62b('0x1b')](_0x2db3d9[_0xb62b('0x2c')][_0xb62b('0x1b')]);_0x14fd18[_0xb62b('0x1a')]=qs[_0xb62b('0x1a')](_0x2db3d9[_0xb62b('0x2c')][_0xb62b('0x1a')]);}_0x14fd18[_0xb62b('0x32')]=qs[_0xb62b('0x33')](_0x2db3d9[_0xb62b('0x2c')]['sort']);_0x14fd18['where']=qs['filters'](_[_0xb62b('0x34')](_0x2db3d9[_0xb62b('0x2c')],_0x2287d9[_0xb62b('0x35')]));if(_0x2db3d9[_0xb62b('0x2c')]['filter']){_0x14fd18[_0xb62b('0x36')]=_[_0xb62b('0x37')](_0x14fd18[_0xb62b('0x36')],{'$or':_['map'](_0x15822d,function(_0x807e07){if(_0x807e07[_0xb62b('0x38')][_0xb62b('0x39')]!==_0xb62b('0x3a')){var _0x54b4ed={};_0x54b4ed[_0x807e07[_0xb62b('0x3b')]]={'$like':'%'+_0x2db3d9[_0xb62b('0x2c')]['filter']+'%'};return _0x54b4ed;}})});}_0x14fd18=_[_0xb62b('0x37')]({},_0x14fd18,_0x2db3d9[_0xb62b('0x3c')]);var _0x20053d={'where':_0x14fd18['where']};return db['Pause'][_0xb62b('0x19')](_0x20053d)['then'](function(_0x21dfd0){_0x1eab8f[_0xb62b('0x19')]=_0x21dfd0;if(_0x2db3d9['query'][_0xb62b('0x3d')]){_0x14fd18[_0xb62b('0x3e')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x14fd18);})[_0xb62b('0x20')](function(_0xadf8d1){_0x1eab8f['rows']=_0xadf8d1;return _0x1eab8f;})[_0xb62b('0x20')](respondWithFilteredResult(_0xff664c,_0x14fd18))[_0xb62b('0x3f')](handleError(_0xff664c,null));};exports[_0xb62b('0x40')]=function(_0x1d351a,_0x230a85){var _0x58c248={'raw':!![],'where':{'id':_0x1d351a[_0xb62b('0x41')]['id']}},_0x1a94b2={};_0x1a94b2[_0xb62b('0x2a')]=_[_0xb62b('0x2b')](db[_0xb62b('0x42')]['rawAttributes']);_0x1a94b2['query']=_[_0xb62b('0x2b')](_0x1d351a[_0xb62b('0x2c')]);_0x1a94b2[_0xb62b('0x35')]=_['intersection'](_0x1a94b2[_0xb62b('0x2a')],_0x1a94b2[_0xb62b('0x2c')]);_0x58c248[_0xb62b('0x2e')]=_['intersection'](_0x1a94b2['model'],qs[_0xb62b('0x2f')](_0x1d351a[_0xb62b('0x2c')][_0xb62b('0x2f')]));_0x58c248[_0xb62b('0x2e')]=_0x58c248[_0xb62b('0x2e')]['length']?_0x58c248[_0xb62b('0x2e')]:_0x1a94b2[_0xb62b('0x2a')];if(_0x1d351a[_0xb62b('0x2c')][_0xb62b('0x3d')]){_0x58c248['include']=[{'all':!![]}];}_0x58c248=_[_0xb62b('0x37')]({},_0x58c248,_0x1d351a['options']);return db[_0xb62b('0x42')][_0xb62b('0x43')](_0x58c248)['then'](handleEntityNotFound(_0x230a85,null))[_0xb62b('0x20')](respondWithResult(_0x230a85,null))['catch'](handleError(_0x230a85,null));};exports['create']=function(_0x5b8c3a,_0x559850){return db[_0xb62b('0x42')][_0xb62b('0x44')](_0x5b8c3a[_0xb62b('0x45')],{})[_0xb62b('0x20')](function(_0x4daffa){var _0x564b49=_0x5b8c3a[_0xb62b('0x46')][_0xb62b('0x22')]({'plain':!![]});if(!_0x564b49)throw new Error(_0xb62b('0x47'));if(_0x564b49[_0xb62b('0x48')]===_0xb62b('0x46')){var _0x2726d9=_0x4daffa[_0xb62b('0x22')]({'plain':!![]});var _0x50d973=_0xb62b('0x23');return db[_0xb62b('0x49')][_0xb62b('0x43')]({'where':{'name':_0x50d973,'userProfileId':_0x564b49[_0xb62b('0x4a')]},'raw':!![]})[_0xb62b('0x20')](function(_0x36e864){if(_0x36e864&&_0x36e864[_0xb62b('0x4b')]===0x0){return db[_0xb62b('0x24')][_0xb62b('0x44')]({'name':_0x2726d9[_0xb62b('0x27')],'resourceId':_0x2726d9['id'],'type':_0x36e864[_0xb62b('0x27')],'sectionId':_0x36e864['id']},{})[_0xb62b('0x20')](function(){return _0x4daffa;});}else{return _0x4daffa;}})[_0xb62b('0x3f')](function(_0xe97aa0){logger[_0xb62b('0x25')](_0xb62b('0x4c'),_0xe97aa0);throw _0xe97aa0;});}return _0x4daffa;})[_0xb62b('0x20')](respondWithResult(_0x559850,0xc9))[_0xb62b('0x3f')](handleError(_0x559850,null));};exports[_0xb62b('0x1f')]=function(_0xb521fd,_0xfcea18){if(_0xb521fd[_0xb62b('0x45')]['id']){delete _0xb521fd[_0xb62b('0x45')]['id'];}return db[_0xb62b('0x42')]['find']({'where':{'id':_0xb521fd[_0xb62b('0x41')]['id']}})[_0xb62b('0x20')](handleEntityNotFound(_0xfcea18,null))[_0xb62b('0x20')](saveUpdates(_0xb521fd[_0xb62b('0x45')],null))[_0xb62b('0x20')](respondWithResult(_0xfcea18,null))['catch'](handleError(_0xfcea18,null));};exports[_0xb62b('0x21')]=function(_0x524a32,_0xf6a7c3){return db[_0xb62b('0x42')][_0xb62b('0x43')]({'where':{'id':_0x524a32[_0xb62b('0x41')]['id']}})[_0xb62b('0x20')](handleEntityNotFound(_0xf6a7c3,null))[_0xb62b('0x20')](removeEntity(_0xf6a7c3,null))[_0xb62b('0x3f')](handleError(_0xf6a7c3,null));}; \ No newline at end of file +var _0xaaeb=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','destroy','Pauses','UserProfileResource','then','error','stack','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir'];(function(_0xecba91,_0xe5f15e){var _0x3b7286=function(_0x4e5610){while(--_0x4e5610){_0xecba91['push'](_0xecba91['shift']());}};_0x3b7286(++_0xe5f15e);}(_0xaaeb,0xa5));var _0xbaae=function(_0x460358,_0x354877){_0x460358=_0x460358-0x0;var _0xdfdfa8=_0xaaeb[_0x460358];return _0xdfdfa8;};'use strict';var pdf=require(_0xbaae('0x0'));var emlformat=require(_0xbaae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbaae('0x2'));var jsonpatch=require(_0xbaae('0x3'));var rp=require(_0xbaae('0x4'));var moment=require(_0xbaae('0x5'));var BPromise=require(_0xbaae('0x6'));var Mustache=require('mustache');var util=require(_0xbaae('0x7'));var path=require(_0xbaae('0x8'));var sox=require(_0xbaae('0x9'));var csv=require(_0xbaae('0xa'));var ejs=require(_0xbaae('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbaae('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbaae('0xd'));var toCsv=require(_0xbaae('0xa'));var querystring=require(_0xbaae('0xe'));var Papa=require(_0xbaae('0xf'));var Redis=require(_0xbaae('0x10'));var authService=require(_0xbaae('0x11'));var qs=require(_0xbaae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaae('0x13'))(_0xbaae('0x14'));var utils=require(_0xbaae('0x15'));var config=require(_0xbaae('0x16'));var db=require(_0xbaae('0x17'))['db'];function respondWithStatusCode(_0x39c333,_0x57d8b7){_0x57d8b7=_0x57d8b7||0xcc;return function(_0x2fd6d5){if(_0x2fd6d5){return _0x39c333[_0xbaae('0x18')](_0x57d8b7);}return _0x39c333[_0xbaae('0x19')](_0x57d8b7)[_0xbaae('0x1a')]();};}function respondWithResult(_0x59098a,_0xa64fd4){_0xa64fd4=_0xa64fd4||0xc8;return function(_0x14c742){if(_0x14c742){return _0x59098a[_0xbaae('0x19')](_0xa64fd4)['json'](_0x14c742);}};}function respondWithFilteredResult(_0x3a325e,_0x449a62){return function(_0x2151f0){if(_0x2151f0){var _0x42d454=_0x2151f0[_0xbaae('0x1b')],_0x2d9698=_0x449a62[_0xbaae('0x1c')],_0x109340=_0x449a62['offset']+_0x449a62['limit'],_0x472fca;if(_0x109340>=_0x42d454){_0x109340=_0x42d454;_0x472fca=0xc8;}else{_0x472fca=0xce;}_0x3a325e[_0xbaae('0x19')](_0x472fca);return _0x3a325e[_0xbaae('0x1d')](_0xbaae('0x1e'),_0x2d9698+'-'+_0x109340+'/'+_0x42d454)[_0xbaae('0x1f')](_0x2151f0);}return null;};}function patchUpdates(_0xfc2806){return function(_0x212223){try{jsonpatch['apply'](_0x212223,_0xfc2806,!![]);}catch(_0xcaf996){return BPromise[_0xbaae('0x20')](_0xcaf996);}return _0x212223[_0xbaae('0x21')]();};}function saveUpdates(_0x4a5507,_0xdb4884){return function(_0x55436b){if(_0x55436b){return _0x55436b[_0xbaae('0x22')](_0x4a5507)['then'](function(_0x5f5933){return _0x5f5933;});}return null;};}function removeEntity(_0x3c989f,_0x41d3c1){return function(_0x1a7530){if(_0x1a7530){return _0x1a7530[_0xbaae('0x23')]()['then'](function(){var _0x4870a4=_0x1a7530['get']({'plain':!![]});var _0x4a69c6=_0xbaae('0x24');return db[_0xbaae('0x25')]['destroy']({'where':{'type':_0x4a69c6,'resourceId':_0x4870a4['id']}})[_0xbaae('0x26')](function(){return _0x1a7530;});})['then'](function(){_0x3c989f[_0xbaae('0x19')](0xcc)[_0xbaae('0x1a')]();});}};}function handleEntityNotFound(_0x9dc669,_0x273ed0){return function(_0x19cde2){if(!_0x19cde2){_0x9dc669[_0xbaae('0x18')](0x194);}return _0x19cde2;};}function handleError(_0x4e0b31,_0x51870f){_0x51870f=_0x51870f||0x1f4;return function(_0x48ed4e){logger[_0xbaae('0x27')](_0x48ed4e[_0xbaae('0x28')]);if(_0x48ed4e['name']){delete _0x48ed4e['name'];}_0x4e0b31[_0xbaae('0x19')](_0x51870f)[_0xbaae('0x29')](_0x48ed4e);};}exports[_0xbaae('0x2a')]=function(_0x5aec1b,_0x5455a0){var _0x2c40e3={},_0x278cc0={},_0x1c7720={'count':0x0,'rows':[]};var _0x132231=db[_0xbaae('0x2b')][_0xbaae('0x2c')];_0x278cc0[_0xbaae('0x2d')]=_[_0xbaae('0x2e')](_0x132231);_0x278cc0[_0xbaae('0x2f')]=_['keys'](_0x5aec1b[_0xbaae('0x2f')]);_0x278cc0[_0xbaae('0x30')]=_[_0xbaae('0x31')](_0x278cc0['model'],_0x278cc0[_0xbaae('0x2f')]);_0x2c40e3['attributes']=_['intersection'](_0x278cc0[_0xbaae('0x2d')],qs['fields'](_0x5aec1b['query'][_0xbaae('0x32')]));_0x2c40e3[_0xbaae('0x33')]=_0x2c40e3[_0xbaae('0x33')][_0xbaae('0x34')]?_0x2c40e3[_0xbaae('0x33')]:_0x278cc0[_0xbaae('0x2d')];if(!_0x5aec1b[_0xbaae('0x2f')]['hasOwnProperty'](_0xbaae('0x35'))){_0x2c40e3['limit']=qs[_0xbaae('0x36')](_0x5aec1b['query'][_0xbaae('0x36')]);_0x2c40e3[_0xbaae('0x1c')]=qs['offset'](_0x5aec1b[_0xbaae('0x2f')][_0xbaae('0x1c')]);}_0x2c40e3['order']=qs['sort'](_0x5aec1b['query'][_0xbaae('0x37')]);_0x2c40e3[_0xbaae('0x38')]=qs['filters'](_[_0xbaae('0x39')](_0x5aec1b[_0xbaae('0x2f')],_0x278cc0['filters']));if(_0x5aec1b[_0xbaae('0x2f')][_0xbaae('0x3a')]){_0x2c40e3[_0xbaae('0x38')]=_['merge'](_0x2c40e3['where'],{'$or':_[_0xbaae('0x3b')](_0x132231,function(_0x1e1950){if(_0x1e1950[_0xbaae('0x3c')]['key']!==_0xbaae('0x3d')){var _0x154186={};_0x154186[_0x1e1950[_0xbaae('0x3e')]]={'$like':'%'+_0x5aec1b['query']['filter']+'%'};return _0x154186;}})});}_0x2c40e3=_[_0xbaae('0x3f')]({},_0x2c40e3,_0x5aec1b[_0xbaae('0x40')]);var _0x39309c={'where':_0x2c40e3['where']};return db['Pause'][_0xbaae('0x1b')](_0x39309c)['then'](function(_0x5162b1){_0x1c7720[_0xbaae('0x1b')]=_0x5162b1;if(_0x5aec1b[_0xbaae('0x2f')][_0xbaae('0x41')]){_0x2c40e3[_0xbaae('0x42')]=[{'all':!![]}];}return db[_0xbaae('0x2b')][_0xbaae('0x43')](_0x2c40e3);})['then'](function(_0x515f74){_0x1c7720[_0xbaae('0x44')]=_0x515f74;return _0x1c7720;})[_0xbaae('0x26')](respondWithFilteredResult(_0x5455a0,_0x2c40e3))['catch'](handleError(_0x5455a0,null));};exports[_0xbaae('0x45')]=function(_0x300d9c,_0x54b188){var _0x511e3b={'raw':!![],'where':{'id':_0x300d9c[_0xbaae('0x46')]['id']}},_0x5fb996={};_0x5fb996['model']=_[_0xbaae('0x2e')](db['Pause'][_0xbaae('0x2c')]);_0x5fb996['query']=_[_0xbaae('0x2e')](_0x300d9c[_0xbaae('0x2f')]);_0x5fb996['filters']=_[_0xbaae('0x31')](_0x5fb996[_0xbaae('0x2d')],_0x5fb996[_0xbaae('0x2f')]);_0x511e3b[_0xbaae('0x33')]=_[_0xbaae('0x31')](_0x5fb996[_0xbaae('0x2d')],qs[_0xbaae('0x32')](_0x300d9c['query'][_0xbaae('0x32')]));_0x511e3b[_0xbaae('0x33')]=_0x511e3b[_0xbaae('0x33')][_0xbaae('0x34')]?_0x511e3b[_0xbaae('0x33')]:_0x5fb996[_0xbaae('0x2d')];if(_0x300d9c[_0xbaae('0x2f')][_0xbaae('0x41')]){_0x511e3b['include']=[{'all':!![]}];}_0x511e3b=_['merge']({},_0x511e3b,_0x300d9c[_0xbaae('0x40')]);return db[_0xbaae('0x2b')][_0xbaae('0x47')](_0x511e3b)[_0xbaae('0x26')](handleEntityNotFound(_0x54b188,null))[_0xbaae('0x26')](respondWithResult(_0x54b188,null))['catch'](handleError(_0x54b188,null));};exports[_0xbaae('0x48')]=function(_0x25f62b,_0x4a388d){return db[_0xbaae('0x2b')][_0xbaae('0x48')](_0x25f62b[_0xbaae('0x49')],{})['then'](function(_0x4ee191){var _0x3dd41f=_0x25f62b[_0xbaae('0x4a')][_0xbaae('0x4b')]({'plain':!![]});if(!_0x3dd41f)throw new Error(_0xbaae('0x4c'));if(_0x3dd41f[_0xbaae('0x4d')]===_0xbaae('0x4a')){var _0x46ef85=_0x4ee191['get']({'plain':!![]});var _0x287752='Pauses';return db[_0xbaae('0x4e')][_0xbaae('0x47')]({'where':{'name':_0x287752,'userProfileId':_0x3dd41f[_0xbaae('0x4f')]},'raw':!![]})[_0xbaae('0x26')](function(_0x4b52e6){if(_0x4b52e6&&_0x4b52e6[_0xbaae('0x50')]===0x0){return db[_0xbaae('0x25')][_0xbaae('0x48')]({'name':_0x46ef85['name'],'resourceId':_0x46ef85['id'],'type':_0x4b52e6[_0xbaae('0x51')],'sectionId':_0x4b52e6['id']},{})[_0xbaae('0x26')](function(){return _0x4ee191;});}else{return _0x4ee191;}})[_0xbaae('0x52')](function(_0x4ef92b){logger[_0xbaae('0x27')](_0xbaae('0x53'),_0x4ef92b);throw _0x4ef92b;});}return _0x4ee191;})['then'](respondWithResult(_0x4a388d,0xc9))[_0xbaae('0x52')](handleError(_0x4a388d,null));};exports['update']=function(_0x17706b,_0x456e03){if(_0x17706b[_0xbaae('0x49')]['id']){delete _0x17706b[_0xbaae('0x49')]['id'];}return db[_0xbaae('0x2b')][_0xbaae('0x47')]({'where':{'id':_0x17706b['params']['id']}})[_0xbaae('0x26')](handleEntityNotFound(_0x456e03,null))[_0xbaae('0x26')](saveUpdates(_0x17706b[_0xbaae('0x49')],null))[_0xbaae('0x26')](respondWithResult(_0x456e03,null))[_0xbaae('0x52')](handleError(_0x456e03,null));};exports['destroy']=function(_0x26a882,_0x5c5363){return db[_0xbaae('0x2b')][_0xbaae('0x47')]({'where':{'id':_0x26a882['params']['id']}})[_0xbaae('0x26')](handleEntityNotFound(_0x5c5363,null))['then'](removeEntity(_0x5c5363,null))['catch'](handleError(_0x5c5363,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1b58356..c3dc613 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 _0x66d8=['api','moment','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util','../../config/logger'];(function(_0x3a6194,_0x4574e2){var _0x298116=function(_0x27297c){while(--_0x27297c){_0x3a6194['push'](_0x3a6194['shift']());}};_0x298116(++_0x4574e2);}(_0x66d8,0x101));var _0x866d=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x66d8[_0x450689];return _0x46ffb0;};'use strict';var _=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var logger=require(_0x866d('0x2'))(_0x866d('0x3'));var moment=require(_0x866d('0x4'));var BPromise=require('bluebird');var rp=require(_0x866d('0x5'));var fs=require('fs');var path=require(_0x866d('0x6'));var rimraf=require(_0x866d('0x7'));var config=require(_0x866d('0x8'));var attributes=require(_0x866d('0x9'));module[_0x866d('0xa')]=function(_0x46a275,_0x46b09f){return _0x46a275['define'](_0x866d('0xb'),attributes,{'tableName':_0x866d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac29=['moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','api'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xac29,0x183));var _0x9ac2=function(_0x2f325d,_0x1e70e2){_0x2f325d=_0x2f325d-0x0;var _0x41dd22=_0xac29[_0x2f325d];return _0x41dd22;};'use strict';var _=require(_0x9ac2('0x0'));var util=require(_0x9ac2('0x1'));var logger=require('../../config/logger')(_0x9ac2('0x2'));var moment=require(_0x9ac2('0x3'));var BPromise=require(_0x9ac2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ac2('0x5'));var rimraf=require(_0x9ac2('0x6'));var config=require(_0x9ac2('0x7'));var attributes=require(_0x9ac2('0x8'));module[_0x9ac2('0x9')]=function(_0x27e33b,_0x1a7598){return _0x27e33b[_0x9ac2('0xa')](_0x9ac2('0xb'),attributes,{'tableName':_0x9ac2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 4fe4ac0..3a66428 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 _0x51a8=['Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Pause','options','raw','where','attributes','include','map','model','ShowPause','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1ac216,_0x4e2b6d){var _0x3b1e63=function(_0x2f8937){while(--_0x2f8937){_0x1ac216['push'](_0x1ac216['shift']());}};_0x3b1e63(++_0x4e2b6d);}(_0x51a8,0xec));var _0x851a=function(_0xbb25e,_0x637f18){_0xbb25e=_0xbb25e-0x0;var _0x582a50=_0x51a8[_0xbb25e];return _0x582a50;};'use strict';var _=require(_0x851a('0x0'));var util=require(_0x851a('0x1'));var moment=require('moment');var BPromise=require(_0x851a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x851a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x851a('0x4'));var logger=require(_0x851a('0x5'))(_0x851a('0x6'));var config=require(_0x851a('0x7'));var jayson=require(_0x851a('0x8'));var client=jayson['client'][_0x851a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4775c2,_0x233c96,_0x2814c6){return new BPromise(function(_0x16363c,_0x1d16d7){return client[_0x851a('0xa')](_0x4775c2,_0x2814c6)[_0x851a('0xb')](function(_0x1c6dd8){logger['info'](_0x851a('0xc'),_0x233c96,_0x851a('0xd'));logger['debug'](_0x851a('0xe'),_0x233c96,_0x851a('0xd'),JSON[_0x851a('0xf')](_0x1c6dd8));if(_0x1c6dd8[_0x851a('0x10')]){if(_0x1c6dd8['error'][_0x851a('0x11')]===0x1f4){logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);return _0x1d16d7(_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);}logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);return _0x16363c(_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);}else{logger[_0x851a('0x13')](_0x851a('0xc'),_0x233c96,_0x851a('0xd'));_0x16363c(_0x1c6dd8[_0x851a('0x14')][_0x851a('0x12')]);}})[_0x851a('0x15')](function(_0x1a9141){logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1a9141);_0x1d16d7(_0x1a9141);});});}exports['ShowPause']=function(_0x53b4ce){var _0x41f977=this;return new Promise(function(_0x4c9d2f,_0x467013){return db[_0x851a('0x16')]['find']({'raw':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x18')]===undefined?!![]:![]:!![],'where':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x19')]||null:null,'attributes':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x1a')]||null:null,'include':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce['options'][_0x851a('0x1b')]?_[_0x851a('0x1c')](_0x53b4ce[_0x851a('0x17')][_0x851a('0x1b')],function(_0x50c80b){return{'model':db[_0x50c80b['model']],'as':_0x50c80b['as'],'attributes':_0x50c80b[_0x851a('0x1a')],'include':_0x50c80b['include']?_[_0x851a('0x1c')](_0x50c80b[_0x851a('0x1b')],function(_0x2439b7){return{'model':db[_0x2439b7[_0x851a('0x1d')]],'as':_0x2439b7['as'],'attributes':_0x2439b7['attributes'],'include':_0x2439b7['include']?_[_0x851a('0x1c')](_0x2439b7[_0x851a('0x1b')],function(_0x5c4c5e){return{'model':db[_0x5c4c5e['model']],'as':_0x5c4c5e['as'],'attributes':_0x5c4c5e[_0x851a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x851a('0xb')](function(_0x2c5cec){logger[_0x851a('0x13')](_0x851a('0x1e'),_0x53b4ce);logger['debug']('ShowPause',_0x53b4ce,JSON['stringify'](_0x2c5cec));_0x4c9d2f(_0x2c5cec);})['catch'](function(_0x271940){logger[_0x851a('0x10')](_0x851a('0x1e'),_0x271940[_0x851a('0x12')],_0x53b4ce);_0x467013(_0x41f977[_0x851a('0x10')](0x1f4,_0x271940[_0x851a('0x12')]));});});}; \ No newline at end of file +var _0x8388=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','Pause,\x20%s,\x20%s','info','result','catch','ShowPause','find','options','raw','where','include','map','model','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x24a5f1,_0x10ebf4){var _0x34e240=function(_0x2dbce7){while(--_0x2dbce7){_0x24a5f1['push'](_0x24a5f1['shift']());}};_0x34e240(++_0x10ebf4);}(_0x8388,0x18d));var _0x8838=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x8388[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca2d0f,_0x2d9615,_0x27707c){return new BPromise(function(_0x56596f,_0x4645f4){return client['request'](_0xca2d0f,_0x27707c)['then'](function(_0x8555b2){logger['info']('Pause,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));logger[_0x8838('0xc')](_0x8838('0xd'),_0x2d9615,_0x8838('0xb'),JSON['stringify'](_0x8555b2));if(_0x8555b2[_0x8838('0xe')]){if(_0x8555b2[_0x8838('0xe')][_0x8838('0xf')]===0x1f4){logger[_0x8838('0xe')]('Pause,\x20%s,\x20%s',_0x2d9615,_0x8555b2[_0x8838('0xe')]['message']);return _0x4645f4(_0x8555b2['error'][_0x8838('0x10')]);}logger[_0x8838('0xe')](_0x8838('0x11'),_0x2d9615,_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);return _0x56596f(_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);}else{logger[_0x8838('0x12')]('Pause,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));_0x56596f(_0x8555b2[_0x8838('0x13')]['message']);}})[_0x8838('0x14')](function(_0xab3fb8){logger[_0x8838('0xe')]('Pause,\x20%s,\x20%s',_0x2d9615,_0xab3fb8);_0x4645f4(_0xab3fb8);});});}exports[_0x8838('0x15')]=function(_0x522d44){var _0xc4129=this;return new Promise(function(_0x204120,_0xe9e4f4){return db['Pause'][_0x8838('0x16')]({'raw':_0x522d44[_0x8838('0x17')]?_0x522d44['options'][_0x8838('0x18')]===undefined?!![]:![]:!![],'where':_0x522d44[_0x8838('0x17')]?_0x522d44['options'][_0x8838('0x19')]||null:null,'attributes':_0x522d44[_0x8838('0x17')]?_0x522d44['options']['attributes']||null:null,'include':_0x522d44[_0x8838('0x17')]?_0x522d44[_0x8838('0x17')][_0x8838('0x1a')]?_[_0x8838('0x1b')](_0x522d44[_0x8838('0x17')][_0x8838('0x1a')],function(_0x908e5b){return{'model':db[_0x908e5b[_0x8838('0x1c')]],'as':_0x908e5b['as'],'attributes':_0x908e5b[_0x8838('0x1d')],'include':_0x908e5b['include']?_[_0x8838('0x1b')](_0x908e5b['include'],function(_0x1dc6b4){return{'model':db[_0x1dc6b4[_0x8838('0x1c')]],'as':_0x1dc6b4['as'],'attributes':_0x1dc6b4['attributes'],'include':_0x1dc6b4['include']?_[_0x8838('0x1b')](_0x1dc6b4[_0x8838('0x1a')],function(_0x105887){return{'model':db[_0x105887[_0x8838('0x1c')]],'as':_0x105887['as'],'attributes':_0x105887[_0x8838('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8838('0x1e')](function(_0x1b7c30){logger[_0x8838('0x12')](_0x8838('0x15'),_0x522d44);logger[_0x8838('0xc')]('ShowPause',_0x522d44,JSON['stringify'](_0x1b7c30));_0x204120(_0x1b7c30);})[_0x8838('0x14')](function(_0x52907a){logger[_0x8838('0xe')](_0x8838('0x15'),_0x52907a['message'],_0x522d44);_0xe9e4f4(_0xc4129['error'](0x1f4,_0x52907a[_0x8838('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b19b8ea..2a470ae 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 _0x03c3=['./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','upload','/webhook','webhookPost','put','delete','path','../../config/environment'];(function(_0x372c0c,_0x3f88e9){var _0x247b1e=function(_0x1e62ad){while(--_0x1e62ad){_0x372c0c['push'](_0x372c0c['shift']());}};_0x247b1e(++_0x3f88e9);}(_0x03c3,0xc2));var _0x303c=function(_0x52d15b,_0x41dbd2){_0x52d15b=_0x52d15b-0x0;var _0x55e57a=_0x03c3[_0x52d15b];return _0x55e57a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x303c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x303c('0x1'));var controller=require(_0x303c('0x2'));router[_0x303c('0x3')]('/',auth[_0x303c('0x4')](),controller[_0x303c('0x5')]);router[_0x303c('0x3')]('/webhook',controller[_0x303c('0x6')]);router[_0x303c('0x3')](_0x303c('0x7'),auth[_0x303c('0x4')](),controller[_0x303c('0x8')]);router[_0x303c('0x3')](_0x303c('0x9'),auth[_0x303c('0x4')](),controller['download']);var upload=multer({'storage':multer[_0x303c('0xa')]({'destination':function(_0x552474,_0x4c5cd9,_0x240241){_0x240241(null,path[_0x303c('0xb')](config[_0x303c('0xc')],_0x303c('0xd')));},'filename':function(_0x1efdf3,_0x355b7d,_0x815749){_0x355b7d[_0x303c('0xe')]=_0x355b7d[_0x303c('0xe')][_0x303c('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x815749(null,util[_0x303c('0x10')](_0x303c('0x11'),path[_0x303c('0x12')](_0x355b7d[_0x303c('0xe')],path[_0x303c('0x13')](_0x355b7d[_0x303c('0xe')])),Date[_0x303c('0x14')](),path[_0x303c('0x13')](_0x355b7d[_0x303c('0xe')])));}})});router[_0x303c('0x15')]('/',upload['single'](_0x303c('0x16')),controller[_0x303c('0x17')]);router[_0x303c('0x15')](_0x303c('0x18'),controller[_0x303c('0x19')]);router[_0x303c('0x1a')]('/:id',auth[_0x303c('0x4')](),controller['update']);router[_0x303c('0x1b')](_0x303c('0x7'),auth[_0x303c('0x4')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xfb1a=['./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','upload','/webhook','webhookPost','put','update','delete','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ceee0,_0x2d0c12){var _0x4693e1=function(_0x4b067c){while(--_0x4b067c){_0x3ceee0['push'](_0x3ceee0['shift']());}};_0x4693e1(++_0x2d0c12);}(_0xfb1a,0x1b4));var _0xafb1=function(_0x1169f2,_0x163a54){_0x1169f2=_0x1169f2-0x0;var _0x94927b=_0xfb1a[_0x1169f2];return _0x94927b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xafb1('0x0'));var timeout=require('connect-timeout');var express=require(_0xafb1('0x1'));var router=express[_0xafb1('0x2')]();var auth=require(_0xafb1('0x3'));var interaction=require(_0xafb1('0x4'));var config=require(_0xafb1('0x5'));var controller=require(_0xafb1('0x6'));router[_0xafb1('0x7')]('/',auth[_0xafb1('0x8')](),controller[_0xafb1('0x9')]);router[_0xafb1('0x7')]('/webhook',controller[_0xafb1('0xa')]);router[_0xafb1('0x7')](_0xafb1('0xb'),auth[_0xafb1('0x8')](),controller[_0xafb1('0xc')]);router[_0xafb1('0x7')](_0xafb1('0xd'),auth[_0xafb1('0x8')](),controller[_0xafb1('0xe')]);var upload=multer({'storage':multer[_0xafb1('0xf')]({'destination':function(_0x464cfe,_0x3608c4,_0x5a84b8){_0x5a84b8(null,path[_0xafb1('0x10')](config[_0xafb1('0x11')],_0xafb1('0x12')));},'filename':function(_0x1d3bbb,_0x40889c,_0x4210fa){_0x40889c[_0xafb1('0x13')]=_0x40889c[_0xafb1('0x13')][_0xafb1('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4210fa(null,util[_0xafb1('0x15')](_0xafb1('0x16'),path[_0xafb1('0x17')](_0x40889c[_0xafb1('0x13')],path[_0xafb1('0x18')](_0x40889c[_0xafb1('0x13')])),Date['now'](),path['extname'](_0x40889c[_0xafb1('0x13')])));}})});router[_0xafb1('0x19')]('/',upload[_0xafb1('0x1a')](_0xafb1('0x1b')),controller[_0xafb1('0x1c')]);router[_0xafb1('0x19')](_0xafb1('0x1d'),controller[_0xafb1('0x1e')]);router[_0xafb1('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xafb1('0x20')]);router['delete'](_0xafb1('0xb'),auth['isAuthenticated'](),controller[_0xafb1('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index dcf82e2..8b04c18 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 _0x93bb=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x44b844,_0x2a8ece){var _0x4d3032=function(_0x5b2e8b){while(--_0x5b2e8b){_0x44b844['push'](_0x44b844['shift']());}};_0x4d3032(++_0x2a8ece);}(_0x93bb,0x139));var _0xb93b=function(_0x99f1d5,_0xba1a67){_0x99f1d5=_0x99f1d5-0x0;var _0x30a3a7=_0x93bb[_0x99f1d5];return _0x30a3a7;};'use strict';var Sequelize=require(_0xb93b('0x0'));module[_0xb93b('0x1')]={'name':{'type':Sequelize[_0xb93b('0x2')]},'type':{'type':Sequelize[_0xb93b('0x3')](_0xb93b('0x4'),'script')},'description':{'type':Sequelize[_0xb93b('0x5')]},'version':{'type':Sequelize[_0xb93b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xb93b('0x6')},'active':{'type':Sequelize[_0xb93b('0x7')],'defaultValue':0x0,'comment':_0xb93b('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xb93b('0x9'),_0xb93b('0xa'),_0xb93b('0xb'),_0xb93b('0xc')),'defaultValue':_0xb93b('0xb'),'comment':_0xb93b('0xd')},'icon':{'type':Sequelize[_0xb93b('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xb93b('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c82=['html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x150f93,_0x275045){var _0x51b109=function(_0x10266d){while(--_0x10266d){_0x150f93['push'](_0x150f93['shift']());}};_0x51b109(++_0x275045);}(_0x5c82,0x16a));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x25c8('0x0'));module[_0x25c8('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x25c8('0x2'),_0x25c8('0x3'))},'description':{'type':Sequelize[_0x25c8('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x25c8('0x5')],'comment':_0x25c8('0x6')},'active':{'type':Sequelize[_0x25c8('0x7')],'defaultValue':0x0,'comment':_0x25c8('0x8')},'sidebar':{'type':Sequelize[_0x25c8('0x9')]('adminOnly','agentOnly','always',_0x25c8('0xa')),'defaultValue':_0x25c8('0xb'),'comment':_0x25c8('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x25c8('0x5')]},'agentUrl':{'type':Sequelize[_0x25c8('0x5')]},'scriptName':{'type':Sequelize[_0x25c8('0x5')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index dc0562a..9c7c3b1 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 _0xbeac=['endsWith','download','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','limit','set','Content-Range','save','update','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','model','keys','query','intersection','attributes','fields','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','Plugin','rows','catch','show','params','rawAttributes','length','include','find','join','root','format','%s.zip','warning','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','server/files/plugins','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','body'];(function(_0x250940,_0x37aeae){var _0x2b5b22=function(_0x60010a){while(--_0x60010a){_0x250940['push'](_0x250940['shift']());}};_0x2b5b22(++_0x37aeae);}(_0xbeac,0x14d));var _0xcbea=function(_0x530b53,_0x5010ab){_0x530b53=_0x530b53-0x0;var _0x514fef=_0xbeac[_0x530b53];return _0x514fef;};'use strict';var pdf=require(_0xcbea('0x0'));var emlformat=require(_0xcbea('0x1'));var rimraf=require(_0xcbea('0x2'));var zipdir=require(_0xcbea('0x3'));var jsonpatch=require(_0xcbea('0x4'));var rp=require(_0xcbea('0x5'));var moment=require(_0xcbea('0x6'));var BPromise=require(_0xcbea('0x7'));var Mustache=require(_0xcbea('0x8'));var util=require(_0xcbea('0x9'));var path=require(_0xcbea('0xa'));var sox=require(_0xcbea('0xb'));var csv=require(_0xcbea('0xc'));var ejs=require(_0xcbea('0xd'));var fs=require('fs');var _=require(_0xcbea('0xe'));var squel=require(_0xcbea('0xf'));var crypto=require(_0xcbea('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbea('0xc'));var querystring=require(_0xcbea('0x11'));var Papa=require(_0xcbea('0x12'));var extract=require(_0xcbea('0x13'));var rimraf=require(_0xcbea('0x2'));var archiver=require(_0xcbea('0x14'));var Redis=require(_0xcbea('0x15'));var authService=require(_0xcbea('0x16'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbea('0x17'))(_0xcbea('0x18'));var utils=require(_0xcbea('0x19'));var config=require(_0xcbea('0x1a'));var db=require(_0xcbea('0x1b'))['db'];config['redis']=_[_0xcbea('0x1c')](config[_0xcbea('0x1d')],{'host':_0xcbea('0x1e'),'port':0x18eb});var socket=require(_0xcbea('0x1f'))(new Redis(config['redis']));require('./plugin.socket')[_0xcbea('0x20')](socket);function respondWithStatusCode(_0x507aaf,_0x57af1e){_0x57af1e=_0x57af1e||0xcc;return function(_0x376807){if(_0x376807){return _0x507aaf[_0xcbea('0x21')](_0x57af1e);}return _0x507aaf[_0xcbea('0x22')](_0x57af1e)['end']();};}function respondWithResult(_0x3530f8,_0x18353d){_0x18353d=_0x18353d||0xc8;return function(_0x2cfdf6){if(_0x2cfdf6){return _0x3530f8['status'](_0x18353d)[_0xcbea('0x23')](_0x2cfdf6);}};}function respondWithFilteredResult(_0x5abb81,_0x132374){return function(_0x587115){if(_0x587115){var _0x1f7341=_0x587115[_0xcbea('0x24')],_0x43b477=_0x132374['offset'],_0x5c1a0f=_0x132374['offset']+_0x132374[_0xcbea('0x25')],_0x1c403e;if(_0x5c1a0f>=_0x1f7341){_0x5c1a0f=_0x1f7341;_0x1c403e=0xc8;}else{_0x1c403e=0xce;}_0x5abb81[_0xcbea('0x22')](_0x1c403e);return _0x5abb81[_0xcbea('0x26')](_0xcbea('0x27'),_0x43b477+'-'+_0x5c1a0f+'/'+_0x1f7341)[_0xcbea('0x23')](_0x587115);}return null;};}function patchUpdates(_0x43e779){return function(_0x3a3159){try{jsonpatch['apply'](_0x3a3159,_0x43e779,!![]);}catch(_0x229907){return BPromise['reject'](_0x229907);}return _0x3a3159[_0xcbea('0x28')]();};}function saveUpdates(_0x46ba21,_0x1019ca){return function(_0x259579){if(_0x259579){return _0x259579[_0xcbea('0x29')](_0x46ba21)[_0xcbea('0x2a')](function(_0x4cf144){return _0x4cf144;});}return null;};}function removeEntity(_0x18a23c,_0x10414c){return function(_0xb995bb){if(_0xb995bb){return _0xb995bb[_0xcbea('0x2b')]()['then'](function(){var _0xd074e2=_0xb995bb[_0xcbea('0x2c')]({'plain':!![]});var _0x171803=_0xcbea('0x2d');return db[_0xcbea('0x2e')]['destroy']({'where':{'type':_0x171803,'resourceId':_0xd074e2['id']}})[_0xcbea('0x2a')](function(){return _0xb995bb;});})['then'](function(){_0x18a23c['status'](0xcc)[_0xcbea('0x2f')]();});}};}function handleEntityNotFound(_0x5ca020,_0x46570e){return function(_0x2954ad){if(!_0x2954ad){_0x5ca020[_0xcbea('0x21')](0x194);}return _0x2954ad;};}function handleError(_0x432fc9,_0x12a53a){_0x12a53a=_0x12a53a||0x1f4;return function(_0x157c30){logger['error'](_0x157c30[_0xcbea('0x30')]);if(_0x157c30['name']){delete _0x157c30[_0xcbea('0x31')];}_0x432fc9[_0xcbea('0x22')](_0x12a53a)[_0xcbea('0x32')](_0x157c30);};}exports['index']=function(_0x14ca76,_0xce253f){var _0x44cbfb={},_0x5be6d9={},_0x911f18={'count':0x0,'rows':[]};var _0x39aa94=db['Plugin']['rawAttributes'];_0x5be6d9[_0xcbea('0x33')]=_[_0xcbea('0x34')](_0x39aa94);_0x5be6d9[_0xcbea('0x35')]=_['keys'](_0x14ca76[_0xcbea('0x35')]);_0x5be6d9['filters']=_[_0xcbea('0x36')](_0x5be6d9[_0xcbea('0x33')],_0x5be6d9[_0xcbea('0x35')]);_0x44cbfb[_0xcbea('0x37')]=_[_0xcbea('0x36')](_0x5be6d9[_0xcbea('0x33')],qs[_0xcbea('0x38')](_0x14ca76[_0xcbea('0x35')]['fields']));_0x44cbfb[_0xcbea('0x37')]=_0x44cbfb[_0xcbea('0x37')]['length']?_0x44cbfb[_0xcbea('0x37')]:_0x5be6d9[_0xcbea('0x33')];if(!_0x14ca76[_0xcbea('0x35')]['hasOwnProperty'](_0xcbea('0x39'))){_0x44cbfb[_0xcbea('0x25')]=qs[_0xcbea('0x25')](_0x14ca76[_0xcbea('0x35')][_0xcbea('0x25')]);_0x44cbfb[_0xcbea('0x3a')]=qs[_0xcbea('0x3a')](_0x14ca76[_0xcbea('0x35')][_0xcbea('0x3a')]);}_0x44cbfb[_0xcbea('0x3b')]=qs[_0xcbea('0x3c')](_0x14ca76[_0xcbea('0x35')][_0xcbea('0x3c')]);_0x44cbfb[_0xcbea('0x3d')]=qs[_0xcbea('0x3e')](_[_0xcbea('0x3f')](_0x14ca76[_0xcbea('0x35')],_0x5be6d9[_0xcbea('0x3e')]));if(_0x14ca76[_0xcbea('0x35')][_0xcbea('0x40')]){_0x44cbfb[_0xcbea('0x3d')]=_[_0xcbea('0x41')](_0x44cbfb[_0xcbea('0x3d')],{'$or':_['map'](_0x39aa94,function(_0x2a1c42){if(_0x2a1c42[_0xcbea('0x42')][_0xcbea('0x43')]!==_0xcbea('0x44')){var _0x1d94db={};_0x1d94db[_0x2a1c42[_0xcbea('0x45')]]={'$like':'%'+_0x14ca76[_0xcbea('0x35')]['filter']+'%'};return _0x1d94db;}})});}_0x44cbfb=_[_0xcbea('0x41')]({},_0x44cbfb,_0x14ca76[_0xcbea('0x46')]);var _0x19b5d8={'where':_0x44cbfb['where']};return db['Plugin'][_0xcbea('0x24')](_0x19b5d8)[_0xcbea('0x2a')](function(_0x3b9d55){_0x911f18[_0xcbea('0x24')]=_0x3b9d55;if(_0x14ca76[_0xcbea('0x35')][_0xcbea('0x47')]){_0x44cbfb['include']=[{'all':!![]}];}return db[_0xcbea('0x48')]['findAll'](_0x44cbfb);})[_0xcbea('0x2a')](function(_0x3efb31){_0x911f18[_0xcbea('0x49')]=_0x3efb31;return _0x911f18;})[_0xcbea('0x2a')](respondWithFilteredResult(_0xce253f,_0x44cbfb))[_0xcbea('0x4a')](handleError(_0xce253f,null));};exports[_0xcbea('0x4b')]=function(_0x18201b,_0x578192){var _0x5eb4dd={'raw':!![],'where':{'id':_0x18201b[_0xcbea('0x4c')]['id']}},_0x263d8c={};_0x263d8c[_0xcbea('0x33')]=_[_0xcbea('0x34')](db['Plugin'][_0xcbea('0x4d')]);_0x263d8c[_0xcbea('0x35')]=_[_0xcbea('0x34')](_0x18201b['query']);_0x263d8c[_0xcbea('0x3e')]=_[_0xcbea('0x36')](_0x263d8c[_0xcbea('0x33')],_0x263d8c[_0xcbea('0x35')]);_0x5eb4dd[_0xcbea('0x37')]=_[_0xcbea('0x36')](_0x263d8c[_0xcbea('0x33')],qs[_0xcbea('0x38')](_0x18201b[_0xcbea('0x35')][_0xcbea('0x38')]));_0x5eb4dd[_0xcbea('0x37')]=_0x5eb4dd[_0xcbea('0x37')][_0xcbea('0x4e')]?_0x5eb4dd[_0xcbea('0x37')]:_0x263d8c['model'];if(_0x18201b[_0xcbea('0x35')][_0xcbea('0x47')]){_0x5eb4dd[_0xcbea('0x4f')]=[{'all':!![]}];}_0x5eb4dd=_[_0xcbea('0x41')]({},_0x5eb4dd,_0x18201b['options']);return db[_0xcbea('0x48')][_0xcbea('0x50')](_0x5eb4dd)[_0xcbea('0x2a')](handleEntityNotFound(_0x578192,null))['then'](respondWithResult(_0x578192,null))[_0xcbea('0x4a')](handleError(_0x578192,null));};exports['download']=function(_0x29f97f,_0x4f80ba,_0xc97d1a){return db['Plugin'][_0xcbea('0x50')]({'where':{'id':_0x29f97f[_0xcbea('0x4c')]['id']},'attributes':[_0xcbea('0x31'),'path'],'raw':!![]})[_0xcbea('0x2a')](handleEntityNotFound(_0x4f80ba,null))[_0xcbea('0x2a')](function(_0xb91888){if(_0xb91888){var _0x3d764a=path[_0xcbea('0x51')](config[_0xcbea('0x52')],'server/files/plugins',util[_0xcbea('0x53')](_0xcbea('0x54'),path['basename'](_0xb91888[_0xcbea('0xa')])));var _0x879b6e=fs['createWriteStream'](_0x3d764a);var _0x2b5686=archiver('zip',{'zlib':{'level':0x9}});_0x2b5686['on'](_0xcbea('0x55'),function(_0x23aee9){if(_0x23aee9['code']==='ENOENT'){logger[_0xcbea('0x56')](_0x23aee9);}else{throw new db['Sequelize'][(_0xcbea('0x57'))](_0xcbea('0x58'));}});_0x2b5686['on'](_0xcbea('0x56'),function(_0x3359d8){throw new db[(_0xcbea('0x59'))]['Error'](_0xcbea('0x58'));});_0x2b5686['pipe'](_0x879b6e);_0x2b5686[_0xcbea('0x5a')]('**/*',{'cwd':path[_0xcbea('0x51')](config[_0xcbea('0x52')],_0xcbea('0x5b'),path['dirname'](_0xb91888[_0xcbea('0xa')])),'ignore':[path[_0xcbea('0x51')](path['basename'](_0xb91888['path']),_0xcbea('0x5c')),path[_0xcbea('0x51')](path[_0xcbea('0x5d')](_0xb91888[_0xcbea('0xa')]),_0xcbea('0x5e'))],'nodir':!![]})[_0xcbea('0x5f')]();_0x879b6e['on'](_0xcbea('0x60'),function(){if(!fs[_0xcbea('0x61')](_0x3d764a)){throw new db[(_0xcbea('0x59'))]['Error']('Plugin\x20not\x20found');}return _0x4f80ba['download'](_0x3d764a,util[_0xcbea('0x53')](_0xcbea('0x54'),path['basename'](_0xb91888[_0xcbea('0xa')])),function(_0x46ab3d){if(_0x46ab3d){throw new db[(_0xcbea('0x59'))][(_0xcbea('0x57'))](_0xcbea('0x62'));}fs['unlinkSync'](_0x3d764a);logger[_0xcbea('0x63')](_0xcbea('0x64'));logger[_0xcbea('0x63')](_0xcbea('0x65'));});});}return null;})[_0xcbea('0x4a')](handleError(_0x4f80ba,null));};exports[_0xcbea('0x66')]=function(_0x11440f,_0x321de6,_0x2a8c34){var _0x1a3999=path[_0xcbea('0x5d')](_0x11440f[_0xcbea('0x67')][_0xcbea('0x68')],path[_0xcbea('0x69')](_0x11440f['file']['filename']));var _0x55b6b9=path[_0xcbea('0x51')](config['root'],'server/files/plugins',_0x11440f[_0xcbea('0x67')][_0xcbea('0x68')]);var _0x2b2082=path['join'](config['root'],_0xcbea('0x5b'),_0x1a3999);logger[_0xcbea('0x63')](_0xcbea('0x6a'),_0x55b6b9);logger[_0xcbea('0x63')]('Plugin\x20upload\x20destination:\x20%s',_0x2b2082);try{fs['chmodSync'](_0x55b6b9,parseInt('0777',0x8));extract(_0x55b6b9,{'dir':_0x2b2082},function(_0x109dec){if(_0x109dec){logger['error'](_0x109dec);handleError(_0x109dec,!![]);};var _0x311983=fs['readdirSync'](_0x2b2082);if(_0x311983[_0xcbea('0x4e')]>0x1){removeReferences(_0x55b6b9,_0x2b2082);logger['error'](_0xcbea('0x6b'));return _0x2a8c34(new Error(_0xcbea('0x6b')));}var _0x550243=fs[_0xcbea('0x6c')](path[_0xcbea('0x51')](_0x2b2082,_0x311983[0x0]));if(_0x550243['isFile']()){removeReferences(_0x55b6b9,_0x2b2082);logger[_0xcbea('0x56')](_0xcbea('0x6b'));return _0x2a8c34(new Error(_0xcbea('0x6b')));}if(_0x550243['isDirectory']()){var _0x55555b=fs['readdirSync'](path[_0xcbea('0x51')](_0x2b2082,_0x311983[0x0]));if(_0x55555b[_0xcbea('0x4e')]===0x0){removeReferences(_0x55b6b9,_0x2b2082);logger[_0xcbea('0x56')](_0xcbea('0x6b'));return _0x2a8c34(new Error(_0xcbea('0x6b')));}var _0xa44403=_0x55555b[_0xcbea('0x6d')](function(_0x4d9e73){return _0x4d9e73===_0xcbea('0x6e');});if(!_0xa44403){return _0x2a8c34(new Error('Plugin\x20manifest\x20missing'));}var _0xa22b6=fs[_0xcbea('0x6f')](path['join'](_0x2b2082,_0x311983[0x0],_0xcbea('0x6e')));var _0x1c6eea=JSON[_0xcbea('0x70')](_0xa22b6);if('undefined'==typeof _0x1c6eea[_0xcbea('0x31')]){return _0x2a8c34(new Error(_0xcbea('0x71')));}if(_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x42')]){return _0x2a8c34(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x73')]){return _0x2a8c34(new Error(_0xcbea('0x74')));}if(_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x75')]){return _0x2a8c34(new Error(_0xcbea('0x76')));}if(_0x1c6eea[_0xcbea('0x42')]===_0xcbea('0x77')){if('undefined'==typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')]){return _0x2a8c34(new Error(_0xcbea('0x79')));}if(_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7a')]&&_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7b')]){return _0x2a8c34(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1c6eea['type']==='script'){if('undefined'==typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x7c')]){return _0x2a8c34(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xcbea('0x72')==typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x7d')]){return _0x2a8c34(new Error(_0xcbea('0x7e')));}}else{return _0x2a8c34(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x15a368=_0x1c6eea[_0xcbea('0x31')];var _0x44a28a=_0x1c6eea[_0xcbea('0x7f')];var _0x301b58=_0x1c6eea[_0xcbea('0x42')];var _0x41144=_0x1c6eea[_0xcbea('0x80')]?_0x1c6eea[_0xcbea('0x80')]:_0xcbea('0x81');var _0x513d9d=_0x1c6eea['icon']?_0x1c6eea['icon']:_0xcbea('0x82');var _0x348fc3='';var _0x321ea9='';var _0x4cf8e8='';var _0x1870b6='';var _0x2d09a8=_0x1c6eea[_0xcbea('0x73')];if(_0x301b58==='html'){if(_0xcbea('0x72')!=typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7a')]){var _0x193c29=_0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xcbea('0x83')](_0x193c29)){_0x348fc3=path[_0xcbea('0x51')]('plugins',_0x1a3999,_0x311983[0x0],_0x193c29);}else{_0x348fc3=_0x193c29;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xcbea('0x72')!=typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7b')]){var _0x5d8144=_0x1c6eea['parameters'][_0xcbea('0x78')][_0xcbea('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xcbea('0x83')](_0x5d8144)){_0x321ea9=path[_0xcbea('0x51')](_0xcbea('0x84'),_0x1a3999,_0x311983[0x0],_0x5d8144);}else{_0x321ea9=_0x5d8144;}}else{logger[_0xcbea('0x63')](_0xcbea('0x85'));}}else if(_0x301b58==='script'){_0x4cf8e8=_0x1c6eea[_0xcbea('0x75')][_0xcbea('0x7c')];_0x1870b6=_0x1c6eea['parameters'][_0xcbea('0x7d')];if('undefined'!=typeof _0x1c6eea['parameters'][_0xcbea('0x78')]){if(_0xcbea('0x72')!=typeof _0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7a')]){var _0x193c29=_0x1c6eea['parameters'][_0xcbea('0x78')][_0xcbea('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xcbea('0x83')](_0x193c29)){_0x348fc3=path[_0xcbea('0x51')](_0xcbea('0x84'),_0x1a3999,_0x311983[0x0],_0x193c29);}else{_0x348fc3=_0x193c29;}}if('undefined'!=typeof _0x1c6eea['parameters']['views']['agent']){var _0x5d8144=_0x1c6eea[_0xcbea('0x75')][_0xcbea('0x78')][_0xcbea('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xcbea('0x83')](_0x5d8144)){_0x321ea9=path[_0xcbea('0x51')](_0xcbea('0x84'),_0x1a3999,_0x311983[0x0],_0x5d8144);}else{_0x321ea9=_0x5d8144;}}}}var _0x50462b={'name':_0x15a368,'description':_0x44a28a,'path':path['join'](_0x1a3999,_0x311983[0x0]),'type':_0x301b58,'sidebar':_0x41144,'icon':_0x513d9d,'adminUrl':_0x348fc3,'agentUrl':_0x321ea9,'scriptName':_0x4cf8e8,'scriptPath':_0x1870b6,'version':_0x2d09a8};removeReferences(_0x55b6b9,null);return db[_0xcbea('0x48')][_0xcbea('0x86')](_0x50462b)[_0xcbea('0x2a')](function(_0x3f503d){var _0xedc870={'role':_0x11440f['body']['role'],'userProfileId':_0x11440f['body'][_0xcbea('0x87')]};if(!_0xedc870)throw new Error(_0xcbea('0x88'));if(_0xedc870['role']===_0xcbea('0x89')){var _0x44f863=_0x3f503d[_0xcbea('0x2c')]({'plain':!![]});return db[_0xcbea('0x8a')]['find']({'where':{'name':_0xcbea('0x2d'),'userProfileId':_0xedc870['userProfileId']},'raw':!![]})[_0xcbea('0x2a')](function(_0x173843){if(_0x173843&&_0x173843['autoAssociation']===0x0){return db[_0xcbea('0x2e')][_0xcbea('0x86')]({'name':_0x44f863[_0xcbea('0x31')],'resourceId':_0x44f863['id'],'type':_0x173843['name'],'sectionId':_0x173843['id']},{})[_0xcbea('0x2a')](function(){return _0x3f503d;});}else{return _0x3f503d;}})[_0xcbea('0x4a')](function(_0x388d49){logger['error'](_0xcbea('0x8b'),_0x388d49);throw _0x388d49;});}return _0x3f503d;})[_0xcbea('0x2a')](respondWithResult(_0x321de6,null))[_0xcbea('0x4a')](handleError(_0x321de6,null));}});}catch(_0x25c406){_0x321de6[_0xcbea('0x22')](0x1f4)[_0xcbea('0x32')](_0x25c406);}};function removeReferences(_0x2f60e8,_0x1f6155){try{if(_0x2f60e8){fs[_0xcbea('0x8c')](_0x2f60e8);logger[_0xcbea('0x63')](_0xcbea('0x8d'));}if(_0x1f6155){rimraf(_0x1f6155,function(){});logger[_0xcbea('0x63')](_0xcbea('0x8e'));}}catch(_0x2cab89){logger[_0xcbea('0x56')](_0x2cab89);}}exports[_0xcbea('0x29')]=function(_0x1ce414,_0x51ca23,_0x434bd5){return db[_0xcbea('0x48')][_0xcbea('0x50')]({'where':{'id':_0x1ce414[_0xcbea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51ca23,null))['then'](saveUpdates(_0x1ce414['body'],null))['then'](respondWithResult(_0x51ca23,null))[_0xcbea('0x4a')](handleError(_0x51ca23,null));};exports[_0xcbea('0x8f')]=function(_0x2d89b8,_0x20f575,_0x590768){return db[_0xcbea('0x48')][_0xcbea('0x50')]({'where':{'id':_0x2d89b8['params']['id']}})['then'](function(_0x1a75be){if(_0x1a75be){return _0x1a75be[_0xcbea('0x2b')]();}})[_0xcbea('0x2a')](function(_0x557768){rimraf(path[_0xcbea('0x51')](config[_0xcbea('0x52')],_0xcbea('0x5b'),path[_0xcbea('0x90')](_0x557768[_0xcbea('0xa')])),function(){});return _0x557768;})[_0xcbea('0x2a')](handleEntityNotFound(_0x20f575,null))['then'](respondWithStatusCode(_0x20f575,null))[_0xcbea('0x4a')](handleError(_0x20f575,null));};exports[_0xcbea('0x91')]=function(_0x318bc2,_0x5eaca5,_0x26a30f){return BPromise['resolve']()[_0xcbea('0x2a')](function(){if(!_0x318bc2[_0xcbea('0x35')][_0xcbea('0xa')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x318bc2[_0xcbea('0x35')][_0xcbea('0x92')]){throw new Error(_0xcbea('0x93'));}var _0x281456=_0x318bc2[_0xcbea('0x35')][_0xcbea('0x94')]?_0x318bc2[_0xcbea('0x35')]['hostname']+':'+_0x318bc2[_0xcbea('0x35')][_0xcbea('0x92')]:'http://localhost:'+_0x318bc2[_0xcbea('0x35')]['port'];var _0x36b0cd=_0x318bc2[_0xcbea('0x35')][_0xcbea('0x23')]?_0x318bc2['query']['json']:!![];var _0x4c12c1=_0x318bc2[_0xcbea('0x35')]['encoding']?_0x318bc2[_0xcbea('0x35')][_0xcbea('0x95')]:null;var _0x3c008d={'method':_0x318bc2[_0xcbea('0x96')],'uri':util[_0xcbea('0x53')](_0xcbea('0x97'),_0x281456,_0x318bc2[_0xcbea('0x35')][_0xcbea('0xa')]),'json':_0x36b0cd,'resolveWithFullResponse':!![],'encoding':_0x4c12c1,'qs':_0x318bc2[_0xcbea('0x35')]};if(_0x318bc2['headers']){_0x3c008d[_0xcbea('0x98')]=_0x318bc2[_0xcbea('0x98')];if(_0x3c008d['headers'][_0xcbea('0x99')]){delete _0x3c008d[_0xcbea('0x98')]['content-length'];}}if(_0x3c008d[_0xcbea('0x98')][_0xcbea('0x9a')]){delete _0x3c008d[_0xcbea('0x98')][_0xcbea('0x9a')];}return rp(_0x3c008d);})['then'](function(_0x3da299){if(_0x3da299){_0x5eaca5[_0xcbea('0x26')](_0x3da299[_0xcbea('0x98')]);logger[_0xcbea('0x63')](_0x3da299[_0xcbea('0x9b')]);if(_[_0xcbea('0x9c')](_0x318bc2['query']['path'],_0xcbea('0x9d'))&&_0x3da299[_0xcbea('0x9e')]==0x1f4){return _0x5eaca5[_0xcbea('0x21')](_0x3da299[_0xcbea('0x9e')]);}else{return _0x5eaca5['status'](_0x3da299[_0xcbea('0x9e')])[_0xcbea('0x32')](_0x3da299['body']);}}else{return _0x5eaca5[_0xcbea('0x21')](0xc8);}})[_0xcbea('0x4a')](handleError(_0x5eaca5,null));};exports[_0xcbea('0x9f')]=function(_0xdd238d,_0x46365e,_0x420275){return BPromise[_0xcbea('0xa0')]()[_0xcbea('0x2a')](function(){if(!_0xdd238d[_0xcbea('0x35')]['path']){throw new Error(_0xcbea('0xa1'));}if(!_0xdd238d[_0xcbea('0x35')][_0xcbea('0x92')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5e91a0=_0xdd238d[_0xcbea('0x35')][_0xcbea('0x94')]?_0xdd238d['query'][_0xcbea('0x94')]+':'+_0xdd238d['query'][_0xcbea('0x92')]:_0xcbea('0xa2')+_0xdd238d[_0xcbea('0x35')][_0xcbea('0x92')];var _0x2b3341=_0xdd238d['query'][_0xcbea('0x23')]?_0xdd238d['query']['json']:!![];var _0xbc209=_0xdd238d[_0xcbea('0x35')][_0xcbea('0x95')]?_0xdd238d[_0xcbea('0x35')]['encoding']:null;var _0x32dedd={'method':_0xdd238d[_0xcbea('0x96')],'uri':util['format'](_0xcbea('0x97'),_0x5e91a0,_0xdd238d['query']['path']),'json':_0x2b3341,'resolveWithFullResponse':!![],'encoding':_0xbc209,'body':_0xdd238d[_0xcbea('0x9b')]};if(_0xdd238d['headers']){_0x32dedd[_0xcbea('0x98')]=_0xdd238d[_0xcbea('0x98')];if(_0x32dedd[_0xcbea('0x98')]['content-length']){delete _0x32dedd['headers']['content-length'];}}if(_0x32dedd[_0xcbea('0x98')][_0xcbea('0x9a')]){delete _0x32dedd[_0xcbea('0x98')][_0xcbea('0x9a')];}return rp(_0x32dedd);})[_0xcbea('0x2a')](function(_0x58bca3){if(_0x58bca3){_0x46365e[_0xcbea('0x26')](_0x58bca3['headers']);logger[_0xcbea('0x63')](_0x58bca3[_0xcbea('0x9b')]);return _0x46365e['status'](_0x58bca3[_0xcbea('0x9e')])[_0xcbea('0x32')](_0x58bca3[_0xcbea('0x9b')]);}else{return _0x46365e[_0xcbea('0x21')](0xc8);}})[_0xcbea('0x4a')](handleError(_0x46365e,null));}; \ No newline at end of file +var _0x6b99=['port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','stack','name','send','Plugin','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','merge','find','download','root','server/files/plugins','format','%s.zip','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve'];(function(_0x5c2923,_0x27947f){var _0x4006c2=function(_0x14e7e4){while(--_0x14e7e4){_0x5c2923['push'](_0x5c2923['shift']());}};_0x4006c2(++_0x27947f);}(_0x6b99,0x172));var _0x96b9=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x6b99[_0x590a38];return _0xf36626;};'use strict';var pdf=require(_0x96b9('0x0'));var emlformat=require(_0x96b9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x96b9('0x2'));var jsonpatch=require(_0x96b9('0x3'));var rp=require(_0x96b9('0x4'));var moment=require('moment');var BPromise=require(_0x96b9('0x5'));var Mustache=require('mustache');var util=require(_0x96b9('0x6'));var path=require(_0x96b9('0x7'));var sox=require(_0x96b9('0x8'));var csv=require(_0x96b9('0x9'));var ejs=require(_0x96b9('0xa'));var fs=require('fs');var _=require(_0x96b9('0xb'));var squel=require(_0x96b9('0xc'));var crypto=require(_0x96b9('0xd'));var jsforce=require(_0x96b9('0xe'));var deskjs=require(_0x96b9('0xf'));var toCsv=require(_0x96b9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x96b9('0x10'));var rimraf=require(_0x96b9('0x11'));var archiver=require(_0x96b9('0x12'));var Redis=require(_0x96b9('0x13'));var authService=require(_0x96b9('0x14'));var qs=require(_0x96b9('0x15'));var hardwareService=require(_0x96b9('0x16'));var logger=require('../../config/logger')(_0x96b9('0x17'));var utils=require(_0x96b9('0x18'));var config=require(_0x96b9('0x19'));var db=require(_0x96b9('0x1a'))['db'];config[_0x96b9('0x1b')]=_[_0x96b9('0x1c')](config[_0x96b9('0x1b')],{'host':_0x96b9('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x96b9('0x1e'))[_0x96b9('0x1f')](socket);function respondWithStatusCode(_0x4eab76,_0xc82519){_0xc82519=_0xc82519||0xcc;return function(_0x49c85f){if(_0x49c85f){return _0x4eab76[_0x96b9('0x20')](_0xc82519);}return _0x4eab76[_0x96b9('0x21')](_0xc82519)[_0x96b9('0x22')]();};}function respondWithResult(_0x2078fe,_0x281402){_0x281402=_0x281402||0xc8;return function(_0x4f86c8){if(_0x4f86c8){return _0x2078fe['status'](_0x281402)[_0x96b9('0x23')](_0x4f86c8);}};}function respondWithFilteredResult(_0x2067fa,_0x428ee3){return function(_0x33c5b5){if(_0x33c5b5){var _0x120626=_0x33c5b5['count'],_0x20f5ed=_0x428ee3[_0x96b9('0x24')],_0x5c32f1=_0x428ee3['offset']+_0x428ee3[_0x96b9('0x25')],_0x2df448;if(_0x5c32f1>=_0x120626){_0x5c32f1=_0x120626;_0x2df448=0xc8;}else{_0x2df448=0xce;}_0x2067fa[_0x96b9('0x21')](_0x2df448);return _0x2067fa[_0x96b9('0x26')](_0x96b9('0x27'),_0x20f5ed+'-'+_0x5c32f1+'/'+_0x120626)['json'](_0x33c5b5);}return null;};}function patchUpdates(_0x554efc){return function(_0x3aece7){try{jsonpatch[_0x96b9('0x28')](_0x3aece7,_0x554efc,!![]);}catch(_0x5075e1){return BPromise[_0x96b9('0x29')](_0x5075e1);}return _0x3aece7['save']();};}function saveUpdates(_0x39c3bc,_0x52468e){return function(_0x227a8b){if(_0x227a8b){return _0x227a8b[_0x96b9('0x2a')](_0x39c3bc)[_0x96b9('0x2b')](function(_0x2a1fb9){return _0x2a1fb9;});}return null;};}function removeEntity(_0x48ac9d,_0x238dfa){return function(_0x38375a){if(_0x38375a){return _0x38375a[_0x96b9('0x2c')]()[_0x96b9('0x2b')](function(){var _0x31b506=_0x38375a[_0x96b9('0x2d')]({'plain':!![]});var _0x372723=_0x96b9('0x2e');return db[_0x96b9('0x2f')][_0x96b9('0x2c')]({'where':{'type':_0x372723,'resourceId':_0x31b506['id']}})[_0x96b9('0x2b')](function(){return _0x38375a;});})['then'](function(){_0x48ac9d[_0x96b9('0x21')](0xcc)[_0x96b9('0x22')]();});}};}function handleEntityNotFound(_0x2a50b8,_0x4f4efe){return function(_0x562562){if(!_0x562562){_0x2a50b8['sendStatus'](0x194);}return _0x562562;};}function handleError(_0x673184,_0x3d5ad2){_0x3d5ad2=_0x3d5ad2||0x1f4;return function(_0x51ac93){logger['error'](_0x51ac93[_0x96b9('0x30')]);if(_0x51ac93['name']){delete _0x51ac93[_0x96b9('0x31')];}_0x673184[_0x96b9('0x21')](_0x3d5ad2)[_0x96b9('0x32')](_0x51ac93);};}exports['index']=function(_0x1a21d7,_0x34e9e2){var _0x32d998={},_0x3cc962={},_0x56583d={'count':0x0,'rows':[]};var _0x3996aa=db[_0x96b9('0x33')]['rawAttributes'];_0x3cc962[_0x96b9('0x34')]=_['keys'](_0x3996aa);_0x3cc962[_0x96b9('0x35')]=_[_0x96b9('0x36')](_0x1a21d7[_0x96b9('0x35')]);_0x3cc962[_0x96b9('0x37')]=_[_0x96b9('0x38')](_0x3cc962[_0x96b9('0x34')],_0x3cc962[_0x96b9('0x35')]);_0x32d998[_0x96b9('0x39')]=_['intersection'](_0x3cc962[_0x96b9('0x34')],qs[_0x96b9('0x3a')](_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x3a')]));_0x32d998[_0x96b9('0x39')]=_0x32d998['attributes'][_0x96b9('0x3b')]?_0x32d998[_0x96b9('0x39')]:_0x3cc962[_0x96b9('0x34')];if(!_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x3c')](_0x96b9('0x3d'))){_0x32d998['limit']=qs[_0x96b9('0x25')](_0x1a21d7['query'][_0x96b9('0x25')]);_0x32d998[_0x96b9('0x24')]=qs[_0x96b9('0x24')](_0x1a21d7[_0x96b9('0x35')]['offset']);}_0x32d998[_0x96b9('0x3e')]=qs[_0x96b9('0x3f')](_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x3f')]);_0x32d998[_0x96b9('0x40')]=qs['filters'](_[_0x96b9('0x41')](_0x1a21d7['query'],_0x3cc962[_0x96b9('0x37')]));if(_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x42')]){_0x32d998[_0x96b9('0x40')]=_['merge'](_0x32d998[_0x96b9('0x40')],{'$or':_[_0x96b9('0x43')](_0x3996aa,function(_0x25727a){if(_0x25727a[_0x96b9('0x44')][_0x96b9('0x45')]!==_0x96b9('0x46')){var _0x362dc0={};_0x362dc0[_0x25727a[_0x96b9('0x47')]]={'$like':'%'+_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x42')]+'%'};return _0x362dc0;}})});}_0x32d998=_['merge']({},_0x32d998,_0x1a21d7[_0x96b9('0x48')]);var _0xa7c750={'where':_0x32d998[_0x96b9('0x40')]};return db[_0x96b9('0x33')]['count'](_0xa7c750)['then'](function(_0x15caa0){_0x56583d['count']=_0x15caa0;if(_0x1a21d7[_0x96b9('0x35')][_0x96b9('0x49')]){_0x32d998[_0x96b9('0x4a')]=[{'all':!![]}];}return db[_0x96b9('0x33')][_0x96b9('0x4b')](_0x32d998);})[_0x96b9('0x2b')](function(_0x2aeff7){_0x56583d[_0x96b9('0x4c')]=_0x2aeff7;return _0x56583d;})[_0x96b9('0x2b')](respondWithFilteredResult(_0x34e9e2,_0x32d998))[_0x96b9('0x4d')](handleError(_0x34e9e2,null));};exports[_0x96b9('0x4e')]=function(_0x226463,_0x414df3){var _0x1c0885={'raw':!![],'where':{'id':_0x226463[_0x96b9('0x4f')]['id']}},_0x51233={};_0x51233[_0x96b9('0x34')]=_[_0x96b9('0x36')](db[_0x96b9('0x33')]['rawAttributes']);_0x51233['query']=_[_0x96b9('0x36')](_0x226463[_0x96b9('0x35')]);_0x51233['filters']=_[_0x96b9('0x38')](_0x51233[_0x96b9('0x34')],_0x51233[_0x96b9('0x35')]);_0x1c0885['attributes']=_['intersection'](_0x51233[_0x96b9('0x34')],qs[_0x96b9('0x3a')](_0x226463[_0x96b9('0x35')][_0x96b9('0x3a')]));_0x1c0885[_0x96b9('0x39')]=_0x1c0885[_0x96b9('0x39')][_0x96b9('0x3b')]?_0x1c0885[_0x96b9('0x39')]:_0x51233[_0x96b9('0x34')];if(_0x226463[_0x96b9('0x35')][_0x96b9('0x49')]){_0x1c0885[_0x96b9('0x4a')]=[{'all':!![]}];}_0x1c0885=_[_0x96b9('0x50')]({},_0x1c0885,_0x226463['options']);return db[_0x96b9('0x33')][_0x96b9('0x51')](_0x1c0885)[_0x96b9('0x2b')](handleEntityNotFound(_0x414df3,null))[_0x96b9('0x2b')](respondWithResult(_0x414df3,null))['catch'](handleError(_0x414df3,null));};exports[_0x96b9('0x52')]=function(_0x1871d4,_0x5cc045,_0x517054){return db[_0x96b9('0x33')][_0x96b9('0x51')]({'where':{'id':_0x1871d4[_0x96b9('0x4f')]['id']},'attributes':[_0x96b9('0x31'),'path'],'raw':!![]})[_0x96b9('0x2b')](handleEntityNotFound(_0x5cc045,null))[_0x96b9('0x2b')](function(_0x139730){if(_0x139730){var _0x170c14=path['join'](config[_0x96b9('0x53')],_0x96b9('0x54'),util[_0x96b9('0x55')](_0x96b9('0x56'),path['basename'](_0x139730[_0x96b9('0x7')])));var _0x511725=fs['createWriteStream'](_0x170c14);var _0x19d26c=archiver(_0x96b9('0x57'),{'zlib':{'level':0x9}});_0x19d26c['on'](_0x96b9('0x58'),function(_0x4b6536){if(_0x4b6536[_0x96b9('0x59')]===_0x96b9('0x5a')){logger[_0x96b9('0x5b')](_0x4b6536);}else{throw new db[(_0x96b9('0x5c'))][(_0x96b9('0x5d'))](_0x96b9('0x5e'));}});_0x19d26c['on']('error',function(_0x3815de){throw new db['Sequelize'][(_0x96b9('0x5d'))](_0x96b9('0x5e'));});_0x19d26c[_0x96b9('0x5f')](_0x511725);_0x19d26c[_0x96b9('0x60')](_0x96b9('0x61'),{'cwd':path[_0x96b9('0x62')](config[_0x96b9('0x53')],_0x96b9('0x54'),path[_0x96b9('0x63')](_0x139730[_0x96b9('0x7')])),'ignore':[path[_0x96b9('0x62')](path[_0x96b9('0x64')](_0x139730[_0x96b9('0x7')]),_0x96b9('0x65')),path[_0x96b9('0x62')](path[_0x96b9('0x64')](_0x139730[_0x96b9('0x7')]),_0x96b9('0x66'))],'nodir':!![]})[_0x96b9('0x67')]();_0x511725['on'](_0x96b9('0x68'),function(){if(!fs[_0x96b9('0x69')](_0x170c14)){throw new db[(_0x96b9('0x5c'))]['Error'](_0x96b9('0x6a'));}return _0x5cc045[_0x96b9('0x52')](_0x170c14,util[_0x96b9('0x55')](_0x96b9('0x56'),path[_0x96b9('0x64')](_0x139730[_0x96b9('0x7')])),function(_0x41cf2f){if(_0x41cf2f){throw new db[(_0x96b9('0x5c'))]['Error'](_0x96b9('0x6b'));}fs['unlinkSync'](_0x170c14);logger[_0x96b9('0x6c')]('Download\x20completed');logger[_0x96b9('0x6c')](_0x96b9('0x6d'));});});}return null;})[_0x96b9('0x4d')](handleError(_0x5cc045,null));};exports[_0x96b9('0x6e')]=function(_0x527801,_0x301556,_0xe220a0){var _0xcd3fc9=path[_0x96b9('0x64')](_0x527801[_0x96b9('0x6f')][_0x96b9('0x70')],path[_0x96b9('0x71')](_0x527801[_0x96b9('0x6f')][_0x96b9('0x70')]));var _0x31fbe8=path['join'](config['root'],_0x96b9('0x54'),_0x527801[_0x96b9('0x6f')][_0x96b9('0x70')]);var _0x287498=path[_0x96b9('0x62')](config['root'],_0x96b9('0x54'),_0xcd3fc9);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x31fbe8);logger['info'](_0x96b9('0x72'),_0x287498);try{fs[_0x96b9('0x73')](_0x31fbe8,parseInt(_0x96b9('0x74'),0x8));extract(_0x31fbe8,{'dir':_0x287498},function(_0x274882){if(_0x274882){logger['error'](_0x274882);handleError(_0x274882,!![]);};var _0x2d68e6=fs[_0x96b9('0x75')](_0x287498);if(_0x2d68e6[_0x96b9('0x3b')]>0x1){removeReferences(_0x31fbe8,_0x287498);logger[_0x96b9('0x5b')]('Invalid\x20plugin\x20structure');return _0xe220a0(new Error(_0x96b9('0x76')));}var _0x52b63f=fs[_0x96b9('0x77')](path[_0x96b9('0x62')](_0x287498,_0x2d68e6[0x0]));if(_0x52b63f[_0x96b9('0x78')]()){removeReferences(_0x31fbe8,_0x287498);logger['error'](_0x96b9('0x76'));return _0xe220a0(new Error(_0x96b9('0x76')));}if(_0x52b63f['isDirectory']()){var _0x39b471=fs['readdirSync'](path[_0x96b9('0x62')](_0x287498,_0x2d68e6[0x0]));if(_0x39b471['length']===0x0){removeReferences(_0x31fbe8,_0x287498);logger[_0x96b9('0x5b')](_0x96b9('0x76'));return _0xe220a0(new Error('Invalid\x20plugin\x20structure'));}var _0x1172e0=_0x39b471[_0x96b9('0x79')](function(_0x1d767c){return _0x1d767c===_0x96b9('0x7a');});if(!_0x1172e0){return _0xe220a0(new Error(_0x96b9('0x7b')));}var _0x4635d8=fs[_0x96b9('0x7c')](path[_0x96b9('0x62')](_0x287498,_0x2d68e6[0x0],_0x96b9('0x7a')));var _0x6dda19=JSON[_0x96b9('0x7d')](_0x4635d8);if('undefined'==typeof _0x6dda19[_0x96b9('0x31')]){return _0xe220a0(new Error(_0x96b9('0x7e')));}if(_0x96b9('0x7f')==typeof _0x6dda19[_0x96b9('0x44')]){return _0xe220a0(new Error(_0x96b9('0x80')));}if(_0x96b9('0x7f')==typeof _0x6dda19[_0x96b9('0x81')]){return _0xe220a0(new Error(_0x96b9('0x82')));}if(_0x96b9('0x7f')==typeof _0x6dda19[_0x96b9('0x83')]){return _0xe220a0(new Error(_0x96b9('0x84')));}if(_0x6dda19[_0x96b9('0x44')]===_0x96b9('0x85')){if(_0x96b9('0x7f')==typeof _0x6dda19['parameters'][_0x96b9('0x86')]){return _0xe220a0(new Error(_0x96b9('0x87')));}if(_0x96b9('0x7f')==typeof _0x6dda19['parameters'][_0x96b9('0x86')][_0x96b9('0x88')]&&_0x96b9('0x7f')==typeof _0x6dda19['parameters'][_0x96b9('0x86')][_0x96b9('0x89')]){return _0xe220a0(new Error(_0x96b9('0x8a')));}}else if(_0x6dda19[_0x96b9('0x44')]===_0x96b9('0x8b')){if(_0x96b9('0x7f')==typeof _0x6dda19[_0x96b9('0x83')]['scriptName']){return _0xe220a0(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x96b9('0x7f')==typeof _0x6dda19[_0x96b9('0x83')][_0x96b9('0x8c')]){return _0xe220a0(new Error(_0x96b9('0x8d')));}}else{return _0xe220a0(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x1965aa=_0x6dda19[_0x96b9('0x31')];var _0x2e8ce6=_0x6dda19['description'];var _0xfe0408=_0x6dda19[_0x96b9('0x44')];var _0x7c89a=_0x6dda19[_0x96b9('0x8e')]?_0x6dda19['sidebar']:_0x96b9('0x8f');var _0x344346=_0x6dda19[_0x96b9('0x90')]?_0x6dda19[_0x96b9('0x90')]:_0x96b9('0x91');var _0x155ac2='';var _0x499768='';var _0x1e5c0b='';var _0x4ee28f='';var _0x2edd42=_0x6dda19['version'];if(_0xfe0408==='html'){if(_0x96b9('0x7f')!=typeof _0x6dda19[_0x96b9('0x83')]['views'][_0x96b9('0x88')]){var _0x2af64d=_0x6dda19[_0x96b9('0x83')]['views'][_0x96b9('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x96b9('0x92')](_0x2af64d)){_0x155ac2=path[_0x96b9('0x62')](_0x96b9('0x93'),_0xcd3fc9,_0x2d68e6[0x0],_0x2af64d);}else{_0x155ac2=_0x2af64d;}}else{logger[_0x96b9('0x6c')](_0x96b9('0x94'));}if('undefined'!=typeof _0x6dda19[_0x96b9('0x83')]['views'][_0x96b9('0x89')]){var _0x56711f=_0x6dda19[_0x96b9('0x83')]['views'][_0x96b9('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x96b9('0x92')](_0x56711f)){_0x499768=path['join'](_0x96b9('0x93'),_0xcd3fc9,_0x2d68e6[0x0],_0x56711f);}else{_0x499768=_0x56711f;}}else{logger[_0x96b9('0x6c')](_0x96b9('0x95'));}}else if(_0xfe0408===_0x96b9('0x8b')){_0x1e5c0b=_0x6dda19['parameters'][_0x96b9('0x96')];_0x4ee28f=_0x6dda19['parameters'][_0x96b9('0x8c')];if(_0x96b9('0x7f')!=typeof _0x6dda19[_0x96b9('0x83')][_0x96b9('0x86')]){if(_0x96b9('0x7f')!=typeof _0x6dda19[_0x96b9('0x83')][_0x96b9('0x86')][_0x96b9('0x88')]){var _0x2af64d=_0x6dda19[_0x96b9('0x83')]['views'][_0x96b9('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x96b9('0x92')](_0x2af64d)){_0x155ac2=path['join'](_0x96b9('0x93'),_0xcd3fc9,_0x2d68e6[0x0],_0x2af64d);}else{_0x155ac2=_0x2af64d;}}if(_0x96b9('0x7f')!=typeof _0x6dda19['parameters'][_0x96b9('0x86')]['agent']){var _0x56711f=_0x6dda19['parameters'][_0x96b9('0x86')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x56711f)){_0x499768=path['join'](_0x96b9('0x93'),_0xcd3fc9,_0x2d68e6[0x0],_0x56711f);}else{_0x499768=_0x56711f;}}}}var _0x149c31={'name':_0x1965aa,'description':_0x2e8ce6,'path':path[_0x96b9('0x62')](_0xcd3fc9,_0x2d68e6[0x0]),'type':_0xfe0408,'sidebar':_0x7c89a,'icon':_0x344346,'adminUrl':_0x155ac2,'agentUrl':_0x499768,'scriptName':_0x1e5c0b,'scriptPath':_0x4ee28f,'version':_0x2edd42};removeReferences(_0x31fbe8,null);return db[_0x96b9('0x33')]['create'](_0x149c31)[_0x96b9('0x2b')](function(_0x27ffb1){var _0x3c176a={'role':_0x527801[_0x96b9('0x97')][_0x96b9('0x98')],'userProfileId':_0x527801[_0x96b9('0x97')]['userProfileId']};if(!_0x3c176a)throw new Error(_0x96b9('0x99'));if(_0x3c176a['role']===_0x96b9('0x9a')){var _0x48c33e=_0x27ffb1['get']({'plain':!![]});return db[_0x96b9('0x9b')][_0x96b9('0x51')]({'where':{'name':_0x96b9('0x2e'),'userProfileId':_0x3c176a[_0x96b9('0x9c')]},'raw':!![]})[_0x96b9('0x2b')](function(_0x1cffaa){if(_0x1cffaa&&_0x1cffaa[_0x96b9('0x9d')]===0x0){return db[_0x96b9('0x2f')][_0x96b9('0x9e')]({'name':_0x48c33e['name'],'resourceId':_0x48c33e['id'],'type':_0x1cffaa['name'],'sectionId':_0x1cffaa['id']},{})[_0x96b9('0x2b')](function(){return _0x27ffb1;});}else{return _0x27ffb1;}})['catch'](function(_0x1b2ce9){logger[_0x96b9('0x5b')](_0x96b9('0x9f'),_0x1b2ce9);throw _0x1b2ce9;});}return _0x27ffb1;})[_0x96b9('0x2b')](respondWithResult(_0x301556,null))[_0x96b9('0x4d')](handleError(_0x301556,null));}});}catch(_0x32df60){_0x301556[_0x96b9('0x21')](0x1f4)[_0x96b9('0x32')](_0x32df60);}};function removeReferences(_0x10f48e,_0x33962a){try{if(_0x10f48e){fs[_0x96b9('0xa0')](_0x10f48e);logger[_0x96b9('0x6c')](_0x96b9('0xa1'));}if(_0x33962a){rimraf(_0x33962a,function(){});logger[_0x96b9('0x6c')](_0x96b9('0xa2'));}}catch(_0x5433e2){logger['error'](_0x5433e2);}}exports[_0x96b9('0x2a')]=function(_0x70da16,_0x256abf,_0x89c97c){return db[_0x96b9('0x33')][_0x96b9('0x51')]({'where':{'id':_0x70da16[_0x96b9('0x4f')]['id']}})[_0x96b9('0x2b')](handleEntityNotFound(_0x256abf,null))['then'](saveUpdates(_0x70da16[_0x96b9('0x97')],null))['then'](respondWithResult(_0x256abf,null))['catch'](handleError(_0x256abf,null));};exports['delete']=function(_0x227e5e,_0x2cee42,_0x45c48e){return db[_0x96b9('0x33')]['find']({'where':{'id':_0x227e5e[_0x96b9('0x4f')]['id']}})[_0x96b9('0x2b')](function(_0x17d977){if(_0x17d977){return _0x17d977[_0x96b9('0x2c')]();}})['then'](function(_0x334577){rimraf(path[_0x96b9('0x62')](config[_0x96b9('0x53')],_0x96b9('0x54'),path['dirname'](_0x334577[_0x96b9('0x7')])),function(){});return _0x334577;})[_0x96b9('0x2b')](handleEntityNotFound(_0x2cee42,null))[_0x96b9('0x2b')](respondWithStatusCode(_0x2cee42,null))['catch'](handleError(_0x2cee42,null));};exports['webhookGet']=function(_0x3af8af,_0x3b71fe,_0x4971e1){return BPromise[_0x96b9('0xa3')]()[_0x96b9('0x2b')](function(){if(!_0x3af8af[_0x96b9('0x35')][_0x96b9('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3af8af[_0x96b9('0x35')][_0x96b9('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x6f3b2d=_0x3af8af[_0x96b9('0x35')][_0x96b9('0xa5')]?_0x3af8af['query'][_0x96b9('0xa5')]+':'+_0x3af8af['query']['port']:'http://localhost:'+_0x3af8af[_0x96b9('0x35')][_0x96b9('0xa4')];var _0x3a68fe=_0x3af8af[_0x96b9('0x35')][_0x96b9('0x23')]?_0x3af8af['query'][_0x96b9('0x23')]:!![];var _0x49c28c=_0x3af8af[_0x96b9('0x35')][_0x96b9('0xa6')]?_0x3af8af[_0x96b9('0x35')]['encoding']:null;var _0xfea281={'method':_0x3af8af[_0x96b9('0xa7')],'uri':util[_0x96b9('0x55')](_0x96b9('0xa8'),_0x6f3b2d,_0x3af8af[_0x96b9('0x35')][_0x96b9('0x7')]),'json':_0x3a68fe,'resolveWithFullResponse':!![],'encoding':_0x49c28c,'qs':_0x3af8af[_0x96b9('0x35')]};if(_0x3af8af['headers']){_0xfea281[_0x96b9('0xa9')]=_0x3af8af[_0x96b9('0xa9')];if(_0xfea281[_0x96b9('0xa9')][_0x96b9('0xaa')]){delete _0xfea281[_0x96b9('0xa9')]['content-length'];}}if(_0xfea281[_0x96b9('0xa9')][_0x96b9('0xab')]){delete _0xfea281[_0x96b9('0xa9')]['content-type'];}return rp(_0xfea281);})['then'](function(_0x11854a){if(_0x11854a){_0x3b71fe[_0x96b9('0x26')](_0x11854a[_0x96b9('0xa9')]);logger['info'](_0x11854a[_0x96b9('0x97')]);if(_[_0x96b9('0xac')](_0x3af8af[_0x96b9('0x35')][_0x96b9('0x7')],_0x96b9('0x52'))&&_0x11854a['statusCode']==0x1f4){return _0x3b71fe[_0x96b9('0x20')](_0x11854a[_0x96b9('0xad')]);}else{return _0x3b71fe['status'](_0x11854a['statusCode'])[_0x96b9('0x32')](_0x11854a[_0x96b9('0x97')]);}}else{return _0x3b71fe[_0x96b9('0x20')](0xc8);}})[_0x96b9('0x4d')](handleError(_0x3b71fe,null));};exports[_0x96b9('0xae')]=function(_0x47e379,_0x1cf948,_0xf0400a){return BPromise[_0x96b9('0xa3')]()['then'](function(){if(!_0x47e379[_0x96b9('0x35')][_0x96b9('0x7')]){throw new Error(_0x96b9('0xaf'));}if(!_0x47e379[_0x96b9('0x35')][_0x96b9('0xa4')]){throw new Error(_0x96b9('0xb0'));}var _0x27dc61=_0x47e379[_0x96b9('0x35')][_0x96b9('0xa5')]?_0x47e379[_0x96b9('0x35')][_0x96b9('0xa5')]+':'+_0x47e379[_0x96b9('0x35')]['port']:_0x96b9('0xb1')+_0x47e379['query'][_0x96b9('0xa4')];var _0x115421=_0x47e379[_0x96b9('0x35')][_0x96b9('0x23')]?_0x47e379[_0x96b9('0x35')][_0x96b9('0x23')]:!![];var _0x4ea345=_0x47e379[_0x96b9('0x35')][_0x96b9('0xa6')]?_0x47e379[_0x96b9('0x35')][_0x96b9('0xa6')]:null;var _0x564af3={'method':_0x47e379['method'],'uri':util['format'](_0x96b9('0xa8'),_0x27dc61,_0x47e379[_0x96b9('0x35')][_0x96b9('0x7')]),'json':_0x115421,'resolveWithFullResponse':!![],'encoding':_0x4ea345,'body':_0x47e379[_0x96b9('0x97')]};if(_0x47e379['headers']){_0x564af3['headers']=_0x47e379[_0x96b9('0xa9')];if(_0x564af3[_0x96b9('0xa9')]['content-length']){delete _0x564af3['headers']['content-length'];}}if(_0x564af3['headers'][_0x96b9('0xab')]){delete _0x564af3[_0x96b9('0xa9')][_0x96b9('0xab')];}return rp(_0x564af3);})['then'](function(_0x30ee5d){if(_0x30ee5d){_0x1cf948[_0x96b9('0x26')](_0x30ee5d[_0x96b9('0xa9')]);logger[_0x96b9('0x6c')](_0x30ee5d['body']);return _0x1cf948[_0x96b9('0x21')](_0x30ee5d[_0x96b9('0xad')])['send'](_0x30ee5d[_0x96b9('0x97')]);}else{return _0x1cf948['sendStatus'](0xc8);}})[_0x96b9('0x4d')](handleError(_0x1cf948,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e6a0f3a..30c0226 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 _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x541100,_0x9484b){var _0x4a0a01=function(_0x42a565){while(--_0x42a565){_0x541100['push'](_0x541100['shift']());}};_0x4a0a01(++_0x9484b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a2635,_0x2a33a8){_0x1a2635=_0x1a2635-0x0;var _0x2ccd92=_0xb10b[_0x1a2635];return _0x2ccd92;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x414a82,_0x8ef837){var _0x35e333=function(_0x36cf52){while(--_0x36cf52){_0x414a82['push'](_0x414a82['shift']());}};_0x35e333(++_0x8ef837);}(_0x7a54,0x106));var _0x47a5=function(_0x22ca03,_0x47c70f){_0x22ca03=_0x22ca03-0x0;var _0x46282f=_0x7a54[_0x22ca03];return _0x46282f;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var Plugin=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){PluginEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);PluginEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x47a5('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 a49c634..5630625 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 _0xdfb1=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','plugins'];(function(_0x55a787,_0x1466a3){var _0x5d90a0=function(_0x5405fb){while(--_0x5405fb){_0x55a787['push'](_0x55a787['shift']());}};_0x5d90a0(++_0x1466a3);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x1e85dd,_0x551b53){_0x1e85dd=_0x1e85dd-0x0;var _0x352611=_0xdfb1[_0x1e85dd];return _0x352611;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require('moment');var BPromise=require(_0x1dfb('0x4'));var rp=require(_0x1dfb('0x5'));var fs=require('fs');var path=require(_0x1dfb('0x6'));var rimraf=require(_0x1dfb('0x7'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x31f0ff,_0x36bf77){return _0x31f0ff[_0x1dfb('0x8')]('Plugin',attributes,{'tableName':_0x1dfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6929=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','lodash','util','../../config/logger'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x6929,0xc0));var _0x9692=function(_0x56784e,_0x4ab2a2){_0x56784e=_0x56784e-0x0;var _0x2bf9f7=_0x6929[_0x56784e];return _0x2bf9f7;};'use strict';var _=require(_0x9692('0x0'));var util=require(_0x9692('0x1'));var logger=require(_0x9692('0x2'))('api');var moment=require(_0x9692('0x3'));var BPromise=require(_0x9692('0x4'));var rp=require(_0x9692('0x5'));var fs=require('fs');var path=require(_0x9692('0x6'));var rimraf=require(_0x9692('0x7'));var config=require(_0x9692('0x8'));var attributes=require(_0x9692('0x9'));module[_0x9692('0xa')]=function(_0x36cbb9,_0x2ba531){return _0x36cbb9[_0x9692('0xb')]('Plugin',attributes,{'tableName':_0x9692('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e1174bf..a41c399 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 _0x3969=['CreatePlugin','debug','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','Plugin','body','options','raw'];(function(_0x3acef9,_0x65d155){var _0x4bb694=function(_0x3fe5c2){while(--_0x3fe5c2){_0x3acef9['push'](_0x3acef9['shift']());}};_0x4bb694(++_0x65d155);}(_0x3969,0x157));var _0x9396=function(_0x56bd19,_0x4ad63f){_0x56bd19=_0x56bd19-0x0;var _0x285506=_0x3969[_0x56bd19];return _0x285506;};'use strict';var _=require('lodash');var util=require(_0x9396('0x0'));var moment=require('moment');var BPromise=require(_0x9396('0x1'));var rs=require(_0x9396('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9396('0x3'))['db'];var utils=require(_0x9396('0x4'));var logger=require(_0x9396('0x5'))(_0x9396('0x6'));var config=require(_0x9396('0x7'));var jayson=require(_0x9396('0x8'));var client=jayson[_0x9396('0x9')][_0x9396('0xa')]({'port':0x232a});config[_0x9396('0xb')]=_['defaults'](config[_0x9396('0xb')],{'host':_0x9396('0xc'),'port':0x18eb});var socket=require(_0x9396('0xd'))(new Redis(config[_0x9396('0xb')]));require(_0x9396('0xe'))['register'](socket);function respondWithRpcPromise(_0x270514,_0xa800ac,_0x416dec){return new BPromise(function(_0x532c82,_0x2fe068){return client[_0x9396('0xf')](_0x270514,_0x416dec)['then'](function(_0x279602){logger[_0x9396('0x10')](_0x9396('0x11'),_0xa800ac,_0x9396('0x12'));logger['debug'](_0x9396('0x13'),_0xa800ac,'request\x20sent',JSON[_0x9396('0x14')](_0x279602));if(_0x279602['error']){if(_0x279602['error'][_0x9396('0x15')]===0x1f4){logger[_0x9396('0x16')]('Plugin,\x20%s,\x20%s',_0xa800ac,_0x279602[_0x9396('0x16')][_0x9396('0x17')]);return _0x2fe068(_0x279602[_0x9396('0x16')][_0x9396('0x17')]);}logger[_0x9396('0x16')](_0x9396('0x11'),_0xa800ac,_0x279602[_0x9396('0x16')][_0x9396('0x17')]);return _0x532c82(_0x279602[_0x9396('0x16')][_0x9396('0x17')]);}else{logger[_0x9396('0x10')]('Plugin,\x20%s,\x20%s',_0xa800ac,_0x9396('0x12'));_0x532c82(_0x279602['result']['message']);}})[_0x9396('0x18')](function(_0x229fea){logger[_0x9396('0x16')](_0x9396('0x11'),_0xa800ac,_0x229fea);_0x2fe068(_0x229fea);});});}exports['CreatePlugin']=function(_0x47e8ca){var _0x3c7bf4=this;return new Promise(function(_0x545db9,_0x4b9de8){return db[_0x9396('0x19')]['create'](_0x47e8ca[_0x9396('0x1a')],{'raw':_0x47e8ca[_0x9396('0x1b')]?_0x47e8ca[_0x9396('0x1b')][_0x9396('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x48dd9d){logger[_0x9396('0x10')](_0x9396('0x1d'),_0x47e8ca);logger[_0x9396('0x1e')](_0x9396('0x1d'),_0x47e8ca,JSON[_0x9396('0x14')](_0x48dd9d));_0x545db9(_0x48dd9d);})['catch'](function(_0x426af3){logger[_0x9396('0x16')](_0x9396('0x1d'),_0x426af3['message'],_0x47e8ca);_0x4b9de8(_0x3c7bf4[_0x9396('0x16')](0x1f4,_0x426af3['message']));});});}; \ No newline at end of file +var _0x73fb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Plugin','body','options','raw','CreatePlugin'];(function(_0xb9dfb5,_0x4cd54c){var _0x2db7e2=function(_0x180e46){while(--_0x180e46){_0xb9dfb5['push'](_0xb9dfb5['shift']());}};_0x2db7e2(++_0x4cd54c);}(_0x73fb,0xcc));var _0xb73f=function(_0x5829c7,_0x25cf07){_0x5829c7=_0x5829c7-0x0;var _0x51c51c=_0x73fb[_0x5829c7];return _0x51c51c;};'use strict';var _=require(_0xb73f('0x0'));var util=require(_0xb73f('0x1'));var moment=require(_0xb73f('0x2'));var BPromise=require(_0xb73f('0x3'));var rs=require(_0xb73f('0x4'));var fs=require('fs');var Redis=require(_0xb73f('0x5'));var db=require(_0xb73f('0x6'))['db'];var utils=require(_0xb73f('0x7'));var logger=require(_0xb73f('0x8'))(_0xb73f('0x9'));var config=require('../../config/environment');var jayson=require(_0xb73f('0xa'));var client=jayson[_0xb73f('0xb')][_0xb73f('0xc')]({'port':0x232a});config['redis']=_[_0xb73f('0xd')](config[_0xb73f('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xb73f('0xf')](socket);function respondWithRpcPromise(_0x53af6e,_0x553c9d,_0x5ad3f7){return new BPromise(function(_0x43680d,_0x12028d){return client[_0xb73f('0x10')](_0x53af6e,_0x5ad3f7)[_0xb73f('0x11')](function(_0x35fac3){logger['info'](_0xb73f('0x12'),_0x553c9d,'request\x20sent');logger[_0xb73f('0x13')](_0xb73f('0x14'),_0x553c9d,_0xb73f('0x15'),JSON[_0xb73f('0x16')](_0x35fac3));if(_0x35fac3[_0xb73f('0x17')]){if(_0x35fac3['error'][_0xb73f('0x18')]===0x1f4){logger[_0xb73f('0x17')](_0xb73f('0x12'),_0x553c9d,_0x35fac3['error'][_0xb73f('0x19')]);return _0x12028d(_0x35fac3[_0xb73f('0x17')][_0xb73f('0x19')]);}logger['error'](_0xb73f('0x12'),_0x553c9d,_0x35fac3[_0xb73f('0x17')]['message']);return _0x43680d(_0x35fac3[_0xb73f('0x17')][_0xb73f('0x19')]);}else{logger[_0xb73f('0x1a')](_0xb73f('0x12'),_0x553c9d,_0xb73f('0x15'));_0x43680d(_0x35fac3[_0xb73f('0x1b')][_0xb73f('0x19')]);}})[_0xb73f('0x1c')](function(_0x2129ff){logger[_0xb73f('0x17')]('Plugin,\x20%s,\x20%s',_0x553c9d,_0x2129ff);_0x12028d(_0x2129ff);});});}exports['CreatePlugin']=function(_0x7f6955){var _0x311de9=this;return new Promise(function(_0x2d36a2,_0x2ad533){return db[_0xb73f('0x1d')]['create'](_0x7f6955[_0xb73f('0x1e')],{'raw':_0x7f6955[_0xb73f('0x1f')]?_0x7f6955['options'][_0xb73f('0x20')]===undefined?!![]:![]:!![]})[_0xb73f('0x11')](function(_0x200e78){logger[_0xb73f('0x1a')](_0xb73f('0x21'),_0x7f6955);logger[_0xb73f('0x13')](_0xb73f('0x21'),_0x7f6955,JSON[_0xb73f('0x16')](_0x200e78));_0x2d36a2(_0x200e78);})['catch'](function(_0x3e608f){logger[_0xb73f('0x17')](_0xb73f('0x21'),_0x3e608f[_0xb73f('0x19')],_0x7f6955);_0x2ad533(_0x311de9[_0xb73f('0x17')](0x1f4,_0x3e608f[_0xb73f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f228669..f608649 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 _0x3b10=['emit','removeListener','register','./plugin.events','remove','update'];(function(_0x34b935,_0x1b0e16){var _0x4acb3c=function(_0x111735){while(--_0x111735){_0x34b935['push'](_0x34b935['shift']());}};_0x4acb3c(++_0x1b0e16);}(_0x3b10,0x18f));var _0x03b1=function(_0x2291dd,_0x1112c3){_0x2291dd=_0x2291dd-0x0;var _0x2376f9=_0x3b10[_0x2291dd];return _0x2376f9;};'use strict';var PluginEvents=require(_0x03b1('0x0'));var events=['save',_0x03b1('0x1'),_0x03b1('0x2')];function createListener(_0x29fdea,_0x337302){return function(_0x151dc0){_0x337302[_0x03b1('0x3')](_0x29fdea,_0x151dc0);};}function removeListener(_0x4727ca,_0x58e899){return function(){PluginEvents[_0x03b1('0x4')](_0x4727ca,_0x58e899);};}exports[_0x03b1('0x5')]=function(_0x41aded){for(var _0x5eb07a=0x0,_0x54fccd=events['length'];_0x5eb07a<_0x54fccd;_0x5eb07a++){var _0x242f50=events[_0x5eb07a];var _0x7f97d1=createListener('plugin:'+_0x242f50,_0x41aded);PluginEvents['on'](_0x242f50,_0x7f97d1);}}; \ No newline at end of file +var _0x38a7=['removeListener','length','plugin:','save','remove','emit'];(function(_0x3041c1,_0x467fe9){var _0x451b14=function(_0xc56942){while(--_0xc56942){_0x3041c1['push'](_0x3041c1['shift']());}};_0x451b14(++_0x467fe9);}(_0x38a7,0x1d1));var _0x738a=function(_0x217b85,_0x491fe6){_0x217b85=_0x217b85-0x0;var _0x51745a=_0x38a7[_0x217b85];return _0x51745a;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x738a('0x0'),_0x738a('0x1'),'update'];function createListener(_0x8ca577,_0xba30c1){return function(_0x53bfe2){_0xba30c1[_0x738a('0x2')](_0x8ca577,_0x53bfe2);};}function removeListener(_0x4a4890,_0x35bdbc){return function(){PluginEvents[_0x738a('0x3')](_0x4a4890,_0x35bdbc);};}exports['register']=function(_0x521354){for(var _0x3d7ab5=0x0,_0x3a5994=events[_0x738a('0x4')];_0x3d7ab5<_0x3a5994;_0x3d7ab5++){var _0x1547d0=events[_0x3d7ab5];var _0x36a91c=createListener(_0x738a('0x5')+_0x1547d0,_0x521354);PluginEvents['on'](_0x1547d0,_0x36a91c);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 033f0fb..0b11797 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 _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0xa33997,_0x47c1d0){var _0x5cf263=function(_0x3e3eb2){while(--_0x3e3eb2){_0xa33997['push'](_0xa33997['shift']());}};_0x5cf263(++_0x47c1d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x45fd5a,_0x32b841){var _0x33dc8b=function(_0x1b1479){while(--_0x1b1479){_0x45fd5a['push'](_0x45fd5a['shift']());}};_0x33dc8b(++_0x32b841);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('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 f3a510e..dd9d19f 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 _0x9261=['cwd','chdir','dirname','dump','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','lodash','../../config/pm2','api','path','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','describe','params','create','body','join','../../files/plugins','script'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x9261,0x1de));var _0x1926=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x9261[_0x4067ac];return _0x53d74d;};'use strict';var _=require(_0x1926('0x0'));var pm2=require(_0x1926('0x1'));var logger=require('../../config/logger')(_0x1926('0x2'));var path=require(_0x1926('0x3'));var exec=require(_0x1926('0x4'))['exec'];var BPromise=require(_0x1926('0x5'));function handleEntityNotFound(_0x2fb805,_0x269cb1){return function(_0x31eef2){if(!_0x31eef2){_0x2fb805[_0x1926('0x6')](0x194);;}return _0x31eef2;};}function respondWithResult(_0x549cec,_0x17f1c6){_0x17f1c6=_0x17f1c6||0xc8;return function(_0x4cf00b){if(_0x4cf00b){return _0x549cec[_0x1926('0x7')](_0x17f1c6)[_0x1926('0x8')](_0x4cf00b);}return null;};}function handleError(_0x4b2a5f,_0x37affe){_0x37affe=_0x37affe||0x1f4;return function(_0x2fb92c){logger[_0x1926('0x9')](_0x2fb92c[_0x1926('0xa')]);if(_0x2fb92c[_0x1926('0xb')]){delete _0x2fb92c[_0x1926('0xb')];}_0x4b2a5f[_0x1926('0x7')](_0x37affe)[_0x1926('0xc')](_0x2fb92c);};}function execChildProcess(){return new BPromise(function(_0x284dd6,_0x1ec703){exec(_0x1926('0xd'),function(_0xdf0c50,_0x2d20b5,_0x382bcc){logger[_0x1926('0xe')](_0x2d20b5);logger[_0x1926('0xe')](_0x382bcc);if(_0xdf0c50){logger[_0x1926('0x9')](_0xdf0c50);return _0x1ec703(_0xdf0c50);}return _0x284dd6(_0x2d20b5);});});}exports[_0x1926('0xf')]=function(_0x2ac6d3,_0x30e4a0){return pm2[_0x1926('0x10')]()[_0x1926('0x11')](function(_0x2ed996){if(_0x2ed996){var _0x4ff9ff=_[_0x1926('0x12')](_0x2ed996,function(_0x472e41){return _0x472e41['name']===_0x1926('0x13')||_0x472e41[_0x1926('0xb')]===_0x1926('0x14');});return{'rows':_0x4ff9ff,'count':_0x4ff9ff['length']};}return null;})[_0x1926('0x11')](respondWithResult(_0x30e4a0,null))[_0x1926('0x15')](handleError(_0x30e4a0,null));};exports['show']=function(_0x21e214,_0x4552e0){return pm2[_0x1926('0x16')](_0x21e214[_0x1926('0x17')]['id'])[_0x1926('0x11')](respondWithResult(_0x4552e0,null))[_0x1926('0x11')](handleEntityNotFound(_0x4552e0,null))[_0x1926('0x15')](handleError(_0x4552e0,null));};exports[_0x1926('0x18')]=function(_0x1e4b49,_0x3e452b){if(_0x1e4b49[_0x1926('0x19')][_0x1926('0xb')]&&_0x1e4b49[_0x1926('0x19')]['script']){var _0x4866f5=path[_0x1926('0x1a')](__dirname,_0x1926('0x1b'),_0x1e4b49[_0x1926('0x19')][_0x1926('0x1c')]);var _0x2361e2=process[_0x1926('0x1d')]();process[_0x1926('0x1e')](path[_0x1926('0x1f')](_0x4866f5));return execChildProcess()[_0x1926('0x11')](function(_0x3e0ab0){process[_0x1926('0x1e')](_0x2361e2);return pm2['start']({'name':_0x1e4b49['body']['name'],'script':_0x4866f5});})['then'](function(_0x447d76){pm2[_0x1926('0x20')]();return _0x447d76[0x0];})[_0x1926('0x11')](respondWithResult(_0x3e452b,0xc9))[_0x1926('0x15')](handleError(_0x3e452b,null));}else{return _0x3e452b['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x1926('0x21')]=function(_0x142f45,_0x55385a){if(_0x142f45[_0x1926('0x19')]['id']){delete _0x142f45[_0x1926('0x19')]['id'];}var _0x3cb4ee={'online':_0x1926('0x22'),'stopped':_0x1926('0x23')};if(_0x3cb4ee[_0x1926('0x24')](_0x142f45[_0x1926('0x19')][_0x1926('0x7')])){return pm2[_0x3cb4ee[_0x142f45[_0x1926('0x19')]['status']]](_0x142f45[_0x1926('0x17')]['id'])[_0x1926('0x11')](respondWithResult(_0x55385a,0xc8))[_0x1926('0x15')](handleError(_0x55385a,null));}else{return _0x55385a[_0x1926('0x7')](0x1f4)['send']({'message':_0x1926('0x25')});}};exports[_0x1926('0x26')]=function(_0x406631,_0x11ecc9){if(_0x406631[_0x1926('0x19')]['id']){delete _0x406631['body']['id'];}if(_0x406631[_0x1926('0x17')]['id']){return pm2['delete'](_0x406631[_0x1926('0x17')]['id'])[_0x1926('0x11')](function(_0x2dfb79){pm2[_0x1926('0x20')]();return _0x2dfb79[0x0];})['then'](respondWithResult(_0x11ecc9,null))[_0x1926('0x15')](handleError(_0x11ecc9,null));}else{return _0x11ecc9[_0x1926('0x7')](0x1f4)[_0x1926('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x9fd4=['restart','hasOwnProperty','Unknown\x20status','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','body','join','script','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update'];(function(_0x539236,_0x556604){var _0x154191=function(_0x41ec30){while(--_0x41ec30){_0x539236['push'](_0x539236['shift']());}};_0x154191(++_0x556604);}(_0x9fd4,0x16c));var _0x49fd=function(_0xb78f74,_0x2548d1){_0xb78f74=_0xb78f74-0x0;var _0x465eb1=_0x9fd4[_0xb78f74];return _0x465eb1;};'use strict';var _=require(_0x49fd('0x0'));var pm2=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var path=require(_0x49fd('0x4'));var exec=require(_0x49fd('0x5'))[_0x49fd('0x6')];var BPromise=require(_0x49fd('0x7'));function handleEntityNotFound(_0x3f149e,_0x55dda5){return function(_0x481f6a){if(!_0x481f6a){_0x3f149e[_0x49fd('0x8')](0x194);;}return _0x481f6a;};}function respondWithResult(_0x42fdc7,_0x1bc16e){_0x1bc16e=_0x1bc16e||0xc8;return function(_0x9353cd){if(_0x9353cd){return _0x42fdc7['status'](_0x1bc16e)[_0x49fd('0x9')](_0x9353cd);}return null;};}function handleError(_0x461ac1,_0x36f605){_0x36f605=_0x36f605||0x1f4;return function(_0x3bf3fd){logger[_0x49fd('0xa')](_0x3bf3fd['stack']);if(_0x3bf3fd[_0x49fd('0xb')]){delete _0x3bf3fd[_0x49fd('0xb')];}_0x461ac1[_0x49fd('0xc')](_0x36f605)[_0x49fd('0xd')](_0x3bf3fd);};}function execChildProcess(){return new BPromise(function(_0x426ec2,_0x2c6d77){exec(_0x49fd('0xe'),function(_0x53a44e,_0x70933e,_0x1a6ee5){logger[_0x49fd('0xf')](_0x70933e);logger[_0x49fd('0xf')](_0x1a6ee5);if(_0x53a44e){logger[_0x49fd('0xa')](_0x53a44e);return _0x2c6d77(_0x53a44e);}return _0x426ec2(_0x70933e);});});}exports[_0x49fd('0x10')]=function(_0x26f2c1,_0x3fa518){return pm2[_0x49fd('0x11')]()[_0x49fd('0x12')](function(_0x157b09){if(_0x157b09){var _0x44c18c=_[_0x49fd('0x13')](_0x157b09,function(_0x1a9063){return _0x1a9063[_0x49fd('0xb')]===_0x49fd('0x14')||_0x1a9063[_0x49fd('0xb')]===_0x49fd('0x15');});return{'rows':_0x44c18c,'count':_0x44c18c[_0x49fd('0x16')]};}return null;})[_0x49fd('0x12')](respondWithResult(_0x3fa518,null))[_0x49fd('0x17')](handleError(_0x3fa518,null));};exports[_0x49fd('0x18')]=function(_0x320fe5,_0x475eee){return pm2[_0x49fd('0x19')](_0x320fe5[_0x49fd('0x1a')]['id'])['then'](respondWithResult(_0x475eee,null))[_0x49fd('0x12')](handleEntityNotFound(_0x475eee,null))[_0x49fd('0x17')](handleError(_0x475eee,null));};exports['create']=function(_0x5c323a,_0x449c9a){if(_0x5c323a['body'][_0x49fd('0xb')]&&_0x5c323a[_0x49fd('0x1b')]['script']){var _0xf7efcf=path[_0x49fd('0x1c')](__dirname,'../../files/plugins',_0x5c323a[_0x49fd('0x1b')][_0x49fd('0x1d')]);var _0x2e1c40=process[_0x49fd('0x1e')]();process[_0x49fd('0x1f')](path[_0x49fd('0x20')](_0xf7efcf));return execChildProcess()['then'](function(_0x46019d){process[_0x49fd('0x1f')](_0x2e1c40);return pm2[_0x49fd('0x21')]({'name':_0x5c323a['body'][_0x49fd('0xb')],'script':_0xf7efcf});})[_0x49fd('0x12')](function(_0x146d55){pm2['dump']();return _0x146d55[0x0];})['then'](respondWithResult(_0x449c9a,0xc9))['catch'](handleError(_0x449c9a,null));}else{return _0x449c9a[_0x49fd('0xc')](0x1f4)[_0x49fd('0xd')]({'message':_0x49fd('0x22')});}};exports[_0x49fd('0x23')]=function(_0x9587b9,_0x293d2b){if(_0x9587b9[_0x49fd('0x1b')]['id']){delete _0x9587b9[_0x49fd('0x1b')]['id'];}var _0x54c8bb={'online':_0x49fd('0x24'),'stopped':'stop'};if(_0x54c8bb[_0x49fd('0x25')](_0x9587b9[_0x49fd('0x1b')]['status'])){return pm2[_0x54c8bb[_0x9587b9[_0x49fd('0x1b')][_0x49fd('0xc')]]](_0x9587b9[_0x49fd('0x1a')]['id'])[_0x49fd('0x12')](respondWithResult(_0x293d2b,0xc8))[_0x49fd('0x17')](handleError(_0x293d2b,null));}else{return _0x293d2b[_0x49fd('0xc')](0x1f4)[_0x49fd('0xd')]({'message':_0x49fd('0x26')});}};exports['destroy']=function(_0x42181b,_0x4869fc){if(_0x42181b[_0x49fd('0x1b')]['id']){delete _0x42181b['body']['id'];}if(_0x42181b[_0x49fd('0x1a')]['id']){return pm2[_0x49fd('0x27')](_0x42181b[_0x49fd('0x1a')]['id'])['then'](function(_0x50d304){pm2['dump']();return _0x50d304[0x0];})[_0x49fd('0x12')](respondWithResult(_0x4869fc,null))[_0x49fd('0x17')](handleError(_0x4869fc,null));}else{return _0x4869fc['status'](0x1f4)[_0x49fd('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8349841..44da186 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 _0x7409=['../../config/environment','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3bac32,_0x12cb8b){var _0x199c64=function(_0x475e91){while(--_0x475e91){_0x3bac32['push'](_0x3bac32['shift']());}};_0x199c64(++_0x12cb8b);}(_0x7409,0x6e));var _0x9740=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x7409[_0x131585];return _0x1fcca2;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var auth=require(_0x9740('0x5'));var interaction=require(_0x9740('0x6'));var config=require(_0x9740('0x7'));module[_0x9740('0x8')]=router; \ No newline at end of file +var _0x91c6=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','connect-timeout','express'];(function(_0x89efd1,_0xe83371){var _0x3af8f=function(_0x50b3f2){while(--_0x50b3f2){_0x89efd1['push'](_0x89efd1['shift']());}};_0x3af8f(++_0xe83371);}(_0x91c6,0xf9));var _0x691c=function(_0x1f9ad8,_0x46cfdf){_0x1f9ad8=_0x1f9ad8-0x0;var _0x4ec92d=_0x91c6[_0x1f9ad8];return _0x4ec92d;};'use strict';var multer=require(_0x691c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x691c('0x1'));var express=require(_0x691c('0x2'));var router=express[_0x691c('0x3')]();var auth=require(_0x691c('0x4'));var interaction=require(_0x691c('0x5'));var config=require('../../config/environment');module[_0x691c('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 bb30c2f..181d88b 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 _0x1bb0=['INTEGER','sequelize','STRING','DATE'];(function(_0x4416e6,_0x5c79b8){var _0x5e64b4=function(_0x2a5c09){while(--_0x2a5c09){_0x4416e6['push'](_0x4416e6['shift']());}};_0x5e64b4(++_0x5c79b8);}(_0x1bb0,0x171));var _0x01bb=function(_0x50f9a9,_0x3a1a94){_0x50f9a9=_0x50f9a9-0x0;var _0x3d3363=_0x1bb0[_0x50f9a9];return _0x3d3363;};'use strict';var Sequelize=require(_0x01bb('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x01bb('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x01bb('0x1')]},'starttime':{'type':Sequelize[_0x01bb('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x01bb('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x01bb('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x01bb('0x1')]}}; \ No newline at end of file +var _0x4522=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x400b6c,_0x4a6139){var _0x4c4e3e=function(_0x191233){while(--_0x191233){_0x400b6c['push'](_0x400b6c['shift']());}};_0x4c4e3e(++_0x4a6139);}(_0x4522,0xfd));var _0x2452=function(_0x5a9b51,_0x2a3868){_0x5a9b51=_0x5a9b51-0x0;var _0x516228=_0x4522[_0x5a9b51];return _0x516228;};'use strict';var Sequelize=require(_0x2452('0x0'));module[_0x2452('0x1')]={'state':{'type':Sequelize[_0x2452('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2452('0x3')]},'scheduledat':{'type':Sequelize[_0x2452('0x4')]},'uniqueid':{'type':Sequelize[_0x2452('0x3')]},'starttime':{'type':Sequelize[_0x2452('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2452('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x2452('0x3')]},'campaigntype':{'type':Sequelize[_0x2452('0x3')]},'membername':{'type':Sequelize[_0x2452('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 80897e3..c966acd 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 _0x89fd=['rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4caafc,_0x313289){var _0x1b078b=function(_0x5505ac){while(--_0x5505ac){_0x4caafc['push'](_0x4caafc['shift']());}};_0x1b078b(++_0x313289);}(_0x89fd,0x1a6));var _0xd89f=function(_0x1177e0,_0x3cf131){_0x1177e0=_0x1177e0-0x0;var _0x391d61=_0x89fd[_0x1177e0];return _0x391d61;};'use strict';var _=require(_0xd89f('0x0'));var util=require(_0xd89f('0x1'));var logger=require(_0xd89f('0x2'))(_0xd89f('0x3'));var moment=require(_0xd89f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd89f('0x5'));var fs=require('fs');var path=require(_0xd89f('0x6'));var rimraf=require(_0xd89f('0x7'));var config=require(_0xd89f('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xd89f('0x9')]=function(_0x45f6f7,_0x240461){return _0x45f6f7[_0xd89f('0xa')](_0xd89f('0xb'),attributes,{'tableName':_0xd89f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2567=['api','moment','bluebird','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash'];(function(_0x3ca879,_0x2e88ee){var _0x1f0bae=function(_0x114b52){while(--_0x114b52){_0x3ca879['push'](_0x3ca879['shift']());}};_0x1f0bae(++_0x2e88ee);}(_0x2567,0x117));var _0x7256=function(_0x39b503,_0x42b6dd){_0x39b503=_0x39b503-0x0;var _0x137615=_0x2567[_0x39b503];return _0x137615;};'use strict';var _=require(_0x7256('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7256('0x1'));var moment=require(_0x7256('0x2'));var BPromise=require(_0x7256('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7256('0x4'));var config=require(_0x7256('0x5'));var attributes=require(_0x7256('0x6'));module[_0x7256('0x7')]=function(_0x918de6,_0x5e6192){return _0x918de6[_0x7256('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x7256('0x9'),'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 d25fa06..6284069 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 _0xc13b=['http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','create','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x40d096,_0x195ff4){var _0x4f6f19=function(_0x14f6ee){while(--_0x14f6ee){_0x40d096['push'](_0x40d096['shift']());}};_0x4f6f19(++_0x195ff4);}(_0xc13b,0x120));var _0xbc13=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc13b[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xbc13('0x0'));var util=require(_0xbc13('0x1'));var moment=require(_0xbc13('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc13('0x3'));var fs=require('fs');var Redis=require(_0xbc13('0x4'));var db=require(_0xbc13('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc13('0x6'))(_0xbc13('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc13('0x8')][_0xbc13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1419cd,_0x4b0032,_0x1e9002){return new BPromise(function(_0x2d9f98,_0x468fa9){return client[_0xbc13('0xa')](_0x1419cd,_0x1e9002)['then'](function(_0x51f7e7){logger[_0xbc13('0xb')](_0xbc13('0xc'),_0x4b0032,_0xbc13('0xd'));logger[_0xbc13('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4b0032,_0xbc13('0xd'),JSON[_0xbc13('0xf')](_0x51f7e7));if(_0x51f7e7[_0xbc13('0x10')]){if(_0x51f7e7['error'][_0xbc13('0x11')]===0x1f4){logger[_0xbc13('0x10')](_0xbc13('0xc'),_0x4b0032,_0x51f7e7[_0xbc13('0x10')][_0xbc13('0x12')]);return _0x468fa9(_0x51f7e7[_0xbc13('0x10')]['message']);}logger[_0xbc13('0x10')](_0xbc13('0xc'),_0x4b0032,_0x51f7e7['error']['message']);return _0x2d9f98(_0x51f7e7[_0xbc13('0x10')][_0xbc13('0x12')]);}else{logger[_0xbc13('0xb')](_0xbc13('0xc'),_0x4b0032,_0xbc13('0xd'));_0x2d9f98(_0x51f7e7[_0xbc13('0x13')][_0xbc13('0x12')]);}})[_0xbc13('0x14')](function(_0x218574){logger[_0xbc13('0x10')](_0xbc13('0xc'),_0x4b0032,_0x218574);_0x468fa9(_0x218574);});});}exports[_0xbc13('0x15')]=function(_0x3b97c7){var _0x3fe4fc=this;return new Promise(function(_0x525c21,_0x3f09bd){return db['ReportAgentPreview'][_0xbc13('0x16')](_0x3b97c7[_0xbc13('0x17')],{'raw':_0x3b97c7[_0xbc13('0x18')]?_0x3b97c7[_0xbc13('0x18')][_0xbc13('0x19')]===undefined?!![]:![]:!![]})[_0xbc13('0x1a')](function(_0x3685a2){logger[_0xbc13('0xb')]('CreateReportAgentPreview',_0x3b97c7);logger[_0xbc13('0xe')](_0xbc13('0x15'),_0x3b97c7,JSON[_0xbc13('0xf')](_0x3685a2));_0x525c21(_0x3685a2);})[_0xbc13('0x14')](function(_0x4c65c7){logger[_0xbc13('0x10')](_0xbc13('0x15'),_0x4c65c7[_0xbc13('0x12')],_0x3b97c7);_0x3f09bd(_0x3fe4fc[_0xbc13('0x10')](0x1f4,_0x4c65c7['message']));});});}; \ No newline at end of file +var _0xcc39=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','stringify','util'];(function(_0x445eeb,_0xc20a13){var _0x38b853=function(_0x3e64ac){while(--_0x3e64ac){_0x445eeb['push'](_0x445eeb['shift']());}};_0x38b853(++_0xc20a13);}(_0xcc39,0x1bf));var _0x9cc3=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0xcc39[_0x485f53];return _0x480f1e;};'use strict';var _=require('lodash');var util=require(_0x9cc3('0x0'));var moment=require(_0x9cc3('0x1'));var BPromise=require(_0x9cc3('0x2'));var rs=require(_0x9cc3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cc3('0x4'))['db'];var utils=require(_0x9cc3('0x5'));var logger=require(_0x9cc3('0x6'))('rpc');var config=require(_0x9cc3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cc3('0x8')][_0x9cc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44a840,_0x57bc3b,_0x2dc157){return new BPromise(function(_0x160f2a,_0x38f309){return client[_0x9cc3('0xa')](_0x44a840,_0x2dc157)[_0x9cc3('0xb')](function(_0x53398b){logger[_0x9cc3('0xc')](_0x9cc3('0xd'),_0x57bc3b,'request\x20sent');logger[_0x9cc3('0xe')](_0x9cc3('0xf'),_0x57bc3b,_0x9cc3('0x10'),JSON['stringify'](_0x53398b));if(_0x53398b[_0x9cc3('0x11')]){if(_0x53398b[_0x9cc3('0x11')][_0x9cc3('0x12')]===0x1f4){logger['error'](_0x9cc3('0xd'),_0x57bc3b,_0x53398b['error'][_0x9cc3('0x13')]);return _0x38f309(_0x53398b[_0x9cc3('0x11')]['message']);}logger[_0x9cc3('0x11')](_0x9cc3('0xd'),_0x57bc3b,_0x53398b['error'][_0x9cc3('0x13')]);return _0x160f2a(_0x53398b['error'][_0x9cc3('0x13')]);}else{logger['info'](_0x9cc3('0xd'),_0x57bc3b,'request\x20sent');_0x160f2a(_0x53398b[_0x9cc3('0x14')][_0x9cc3('0x13')]);}})[_0x9cc3('0x15')](function(_0x15750e){logger['error'](_0x9cc3('0xd'),_0x57bc3b,_0x15750e);_0x38f309(_0x15750e);});});}exports[_0x9cc3('0x16')]=function(_0x2bd641){var _0x2231ca=this;return new Promise(function(_0x374b63,_0x3f774f){return db[_0x9cc3('0x17')]['create'](_0x2bd641[_0x9cc3('0x18')],{'raw':_0x2bd641[_0x9cc3('0x19')]?_0x2bd641['options'][_0x9cc3('0x1a')]===undefined?!![]:![]:!![]})[_0x9cc3('0xb')](function(_0x58b16f){logger[_0x9cc3('0xc')]('CreateReportAgentPreview',_0x2bd641);logger[_0x9cc3('0xe')](_0x9cc3('0x16'),_0x2bd641,JSON[_0x9cc3('0x1b')](_0x58b16f));_0x374b63(_0x58b16f);})['catch'](function(_0x518cdb){logger['error'](_0x9cc3('0x16'),_0x518cdb['message'],_0x2bd641);_0x3f774f(_0x2231ca['error'](0x1f4,_0x518cdb['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f3ee690..b0efaf4 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 _0xe7c2=['/chat/queues/:id','showChatQueues','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','put','/agents/:id/capacity','agentCapacity','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe7c2,0x114));var _0x2e7c=function(_0x13da46,_0x489adb){_0x13da46=_0x13da46-0x0;var _0x12f1b9=_0xe7c2[_0x13da46];return _0x12f1b9;};'use strict';var multer=require(_0x2e7c('0x0'));var util=require(_0x2e7c('0x1'));var path=require(_0x2e7c('0x2'));var express=require(_0x2e7c('0x3'));var router=express[_0x2e7c('0x4')]();var auth=require(_0x2e7c('0x5'));var controller=require(_0x2e7c('0x6'));router[_0x2e7c('0x7')]('/voice/channels',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x9')]);router[_0x2e7c('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0xa')]);router[_0x2e7c('0x7')](_0x2e7c('0xb'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0xc')]);router[_0x2e7c('0x7')]('/voice/queues',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0xd')]);router['get']('/chat/queues',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0xe')]);router[_0x2e7c('0x7')](_0x2e7c('0xf'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x10')]);router['get'](_0x2e7c('0x11'),auth[_0x2e7c('0x8')](),controller['mailAccounts']);router[_0x2e7c('0x7')](_0x2e7c('0x12'),auth[_0x2e7c('0x8')](),controller['openchannelQueues']);router[_0x2e7c('0x7')](_0x2e7c('0x13'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x14')]);router['get'](_0x2e7c('0x15'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x16')]);router[_0x2e7c('0x7')]('/voice/queues/preview/:id',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x17')]);router['get'](_0x2e7c('0x18'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x2e7c('0x7')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x2e7c('0x19')]);router[_0x2e7c('0x7')](_0x2e7c('0x1a'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x1b')]);router['get'](_0x2e7c('0x1c'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x1d')]);router[_0x2e7c('0x7')](_0x2e7c('0x1e'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x1f')]);router['get'](_0x2e7c('0x20'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x21')]);router[_0x2e7c('0x7')](_0x2e7c('0x22'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x23')]);router[_0x2e7c('0x7')]('/agents',auth['isAuthenticated'](),controller['agents']);router[_0x2e7c('0x24')](_0x2e7c('0x25'),auth['isAuthenticated'](),controller[_0x2e7c('0x26')]);router[_0x2e7c('0x7')]('/telephones',auth[_0x2e7c('0x8')](),controller['telephones']);router[_0x2e7c('0x7')]('/trunks',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x27')]);router['get'](_0x2e7c('0x28'),auth['isAuthenticated'](),controller['campaigns']);router[_0x2e7c('0x7')](_0x2e7c('0x29'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x2a')]);router[_0x2e7c('0x7')](_0x2e7c('0x2b'),auth['isAuthenticated'](),controller[_0x2e7c('0x2c')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2e7c('0x2d')]);router[_0x2e7c('0x7')]('/openchannel/queues/waitinginteractions',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x2e')]);router[_0x2e7c('0x7')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2e7c('0x2f')]);router['get'](_0x2e7c('0x30'),auth[_0x2e7c('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x2e7c('0x31')]('/mail/queues/:id/notify',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x32')](_0x2e7c('0x33')));router[_0x2e7c('0x7')](_0x2e7c('0x34'),auth[_0x2e7c('0x8')](),controller['showMailQueues']);router[_0x2e7c('0x31')](_0x2e7c('0x35'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x32')]('chat'));router['get'](_0x2e7c('0x36'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x37')]);router['post']('/fax/queues/:id/notify',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x32')](_0x2e7c('0x38')));router[_0x2e7c('0x7')]('/fax/queues/:id',auth[_0x2e7c('0x8')](),controller['showFaxQueues']);router[_0x2e7c('0x31')](_0x2e7c('0x39'),auth[_0x2e7c('0x8')](),controller['queueNotify'](_0x2e7c('0x3a')));router[_0x2e7c('0x7')](_0x2e7c('0x3b'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x3c')]);router[_0x2e7c('0x31')](_0x2e7c('0x3d'),auth[_0x2e7c('0x8')](),controller['queueNotify']('sms'));router[_0x2e7c('0x7')](_0x2e7c('0x3e'),auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x3f')]);router['post']('/agents/:id/notify',auth[_0x2e7c('0x8')](),controller[_0x2e7c('0x40')]);module[_0x2e7c('0x41')]=router; \ No newline at end of file +var _0x3c66=['/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','/telephones','telephones','trunks','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','post'];(function(_0x1bc575,_0x34b07d){var _0x7b6e21=function(_0x5c28ef){while(--_0x5c28ef){_0x1bc575['push'](_0x1bc575['shift']());}};_0x7b6e21(++_0x34b07d);}(_0x3c66,0x8b));var _0x63c6=function(_0x32cf45,_0x2a718a){_0x32cf45=_0x32cf45-0x0;var _0x248ff3=_0x3c66[_0x32cf45];return _0x248ff3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0x63c6('0x0'));var router=express[_0x63c6('0x1')]();var auth=require(_0x63c6('0x2'));var controller=require(_0x63c6('0x3'));router[_0x63c6('0x4')](_0x63c6('0x5'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x7')]);router[_0x63c6('0x4')](_0x63c6('0x8'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x9')]);router['get'](_0x63c6('0xa'),auth['isAuthenticated'](),controller[_0x63c6('0xb')]);router[_0x63c6('0x4')]('/voice/queues',auth[_0x63c6('0x6')](),controller[_0x63c6('0xc')]);router[_0x63c6('0x4')](_0x63c6('0xd'),auth[_0x63c6('0x6')](),controller[_0x63c6('0xe')]);router['get'](_0x63c6('0xf'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x10')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router['get']('/openchannel/queues',auth[_0x63c6('0x6')](),controller[_0x63c6('0x11')]);router[_0x63c6('0x4')](_0x63c6('0x12'),auth[_0x63c6('0x6')](),controller['smsQueues']);router[_0x63c6('0x4')](_0x63c6('0x13'),auth['isAuthenticated'](),controller[_0x63c6('0x14')]);router['get']('/voice/queues/preview/:id',auth[_0x63c6('0x6')](),controller['voiceQueuesPreview']);router[_0x63c6('0x4')](_0x63c6('0x15'),auth['isAuthenticated'](),controller[_0x63c6('0x16')]);router[_0x63c6('0x4')](_0x63c6('0x17'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x18')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x63c6('0x19')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x63c6('0x6')](),controller[_0x63c6('0x1a')]);router['get'](_0x63c6('0x1b'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x1c')]);router[_0x63c6('0x4')](_0x63c6('0x1d'),auth['isAuthenticated'](),controller[_0x63c6('0x1e')]);router[_0x63c6('0x4')](_0x63c6('0x1f'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x20')]);router[_0x63c6('0x4')](_0x63c6('0x21'),auth[_0x63c6('0x6')](),controller['agents']);router[_0x63c6('0x22')](_0x63c6('0x23'),auth[_0x63c6('0x6')](),controller['agentCapacity']);router['get'](_0x63c6('0x24'),auth['isAuthenticated'](),controller[_0x63c6('0x25')]);router['get']('/trunks',auth[_0x63c6('0x6')](),controller[_0x63c6('0x26')]);router[_0x63c6('0x4')]('/campaigns',auth[_0x63c6('0x6')](),controller['campaigns']);router[_0x63c6('0x4')](_0x63c6('0x27'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x28')]);router[_0x63c6('0x4')](_0x63c6('0x29'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x2a')]);router['get'](_0x63c6('0x2b'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x2c')]);router[_0x63c6('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x63c6('0x6')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x63c6('0x2d'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x2e')]);router[_0x63c6('0x4')](_0x63c6('0x2f'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x30')]);router['post'](_0x63c6('0x31'),auth['isAuthenticated'](),controller[_0x63c6('0x32')]('mail'));router[_0x63c6('0x4')]('/mail/queues/:id',auth[_0x63c6('0x6')](),controller['showMailQueues']);router['post'](_0x63c6('0x33'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x32')]('chat'));router[_0x63c6('0x4')](_0x63c6('0x34'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x35')]);router['post'](_0x63c6('0x36'),auth[_0x63c6('0x6')](),controller['queueNotify'](_0x63c6('0x37')));router[_0x63c6('0x4')](_0x63c6('0x38'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x39')]);router[_0x63c6('0x3a')](_0x63c6('0x3b'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x32')](_0x63c6('0x3c')));router[_0x63c6('0x4')](_0x63c6('0x3d'),auth['isAuthenticated'](),controller[_0x63c6('0x3e')]);router['post'](_0x63c6('0x3f'),auth[_0x63c6('0x6')](),controller['queueNotify']('sms'));router[_0x63c6('0x4')](_0x63c6('0x40'),auth[_0x63c6('0x6')](),controller[_0x63c6('0x41')]);router[_0x63c6('0x3a')]('/agents/:id/notify',auth[_0x63c6('0x6')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index efccd5d..fdaa8ad 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 _0xf856=['queueNotify','capitalize','Website','Account','\x20Queue\x20not\x20found','Message','findOne','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','MessageId','create','Start','agentTransferTimeout','moment','lodash','../../mysqldb','api','jayson/promise','client','http','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','INTERACTION','format','length','updateAttributes','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf856,0x101));var _0x6f85=function(_0x6c5bc8,_0x38043c){_0x6c5bc8=_0x6c5bc8-0x0;var _0x3a9cc8=_0xf856[_0x6c5bc8];return _0x3a9cc8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x6f85('0x0'));var _=require(_0x6f85('0x1'));var util=require('util');var db=require(_0x6f85('0x2'))['db'];var logger=require('../../config/logger')(_0x6f85('0x3'));var jayson=require(_0x6f85('0x4'));var amiClient=jayson[_0x6f85('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0x6f85('0x5')][_0x6f85('0x6')]({'port':0x232b});var routingClient=jayson[_0x6f85('0x5')][_0x6f85('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x3e943d,_0x44d661,_0x59b0f8){return new BPromise(function(_0x3ae10f,_0x400635){var _0x4827e2=_0x59b0f8?_0x59b0f8:amiClient;return _0x4827e2['request'](_0x3e943d,_0x44d661)[_0x6f85('0x7')](function(_0x41e129){if(_0x41e129['error']){if(_0x41e129[_0x6f85('0x8')][_0x6f85('0x9')]===0x1f4){return _0x400635(_0x41e129['error'][_0x6f85('0xa')]);}return _0x3ae10f(_0x41e129[_0x6f85('0x8')][_0x6f85('0xa')]);}else{_0x3ae10f(_0x41e129[_0x6f85('0xb')]);}})[_0x6f85('0xc')](function(_0x5a91f3){_0x400635(_0x5a91f3);});});}function respondWithResult(_0x4ada6e,_0x22d26f){_0x22d26f=_0x22d26f||0xc8;return function(_0x2285de){if(_0x2285de){return _0x4ada6e[_0x6f85('0xd')](_0x22d26f)['json'](_0x2285de);}return _0x4ada6e[_0x6f85('0xe')](0x194);};}function handleError(_0x217e90,_0x2d1d05){_0x2d1d05=_0x2d1d05||0x1f4;return function(_0x5521ed){logger[_0x6f85('0x8')](_0x5521ed[_0x6f85('0xf')]);if(_0x5521ed[_0x6f85('0x10')]){delete _0x5521ed[_0x6f85('0x10')];}_0x217e90['status'](_0x2d1d05)['send'](_0x5521ed);};}function findById(_0x510ac6){return function(_0x4007ec){if(!_['isNil'](_0x510ac6)&&!_[_0x6f85('0x11')](_0x4007ec)&&!_[_0x6f85('0x11')](_0x4007ec['rows'])){return _['find'](_0x4007ec['rows'],function(_0x55a4aa){return _0x55a4aa['id']==_0x510ac6;});}return null;};}exports[_0x6f85('0x12')]=function(_0x484236,_0x26fa95){return respondWithRpcPromise(_0x6f85('0x13'),_0x484236[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x26fa95,null))['catch'](handleError(_0x26fa95,null));};exports[_0x6f85('0x15')]=function(_0x43d12a,_0x365598){return respondWithRpcPromise(_0x6f85('0x16'),_[_0x6f85('0x17')](_0x43d12a[_0x6f85('0x14')],_0x43d12a[_0x6f85('0x18')]))[_0x6f85('0x7')](respondWithResult(_0x365598,null))[_0x6f85('0xc')](handleError(_0x365598,null));};exports[_0x6f85('0x19')]=function(_0x309935,_0x1a5cf9){return respondWithRpcPromise(_0x6f85('0x1a'),_[_0x6f85('0x17')](_0x309935[_0x6f85('0x14')],_0x309935['params']))[_0x6f85('0x7')](respondWithResult(_0x1a5cf9,null))[_0x6f85('0xc')](handleError(_0x1a5cf9,null));};exports[_0x6f85('0x1b')]=function(_0x5c1d20,_0x38a585){return respondWithRpcPromise(_0x6f85('0x1c'),_0x5c1d20[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x38a585,null))[_0x6f85('0xc')](handleError(_0x38a585,null));};exports[_0x6f85('0x1d')]=function(_0x3a6f6a,_0x53f545){return respondWithRpcPromise(_0x6f85('0x1c'),_0x3a6f6a[_0x6f85('0x14')])[_0x6f85('0x7')](findById(_0x3a6f6a['params']['id']))[_0x6f85('0x7')](respondWithResult(_0x53f545,null))[_0x6f85('0xc')](handleError(_0x53f545,null));};exports[_0x6f85('0x1e')]=function(_0x464734,_0x262e37){return respondWithRpcPromise(_0x6f85('0x1f'),_['merge'](_0x464734[_0x6f85('0x14')],_0x464734[_0x6f85('0x18')]))['then'](respondWithResult(_0x262e37,null))['catch'](handleError(_0x262e37,null));};exports[_0x6f85('0x20')]=function(_0x2c5a7a,_0x1a6364){return respondWithRpcPromise(_0x6f85('0x21'),_0x2c5a7a[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x1a6364,null))[_0x6f85('0xc')](handleError(_0x1a6364,null));};exports[_0x6f85('0x22')]=function(_0x2bd7cf,_0x18bc15){return respondWithRpcPromise(_0x6f85('0x23'),_[_0x6f85('0x17')](_0x2bd7cf[_0x6f85('0x14')],_0x2bd7cf[_0x6f85('0x18')]))['then'](respondWithResult(_0x18bc15,null))['catch'](handleError(_0x18bc15,null));};exports[_0x6f85('0x24')]=function(_0x3e3e2e,_0x10e416){return respondWithRpcPromise(_0x6f85('0x25'),_[_0x6f85('0x17')](_0x3e3e2e[_0x6f85('0x14')],_0x3e3e2e['params']))['then'](respondWithResult(_0x10e416,null))[_0x6f85('0xc')](handleError(_0x10e416,null));};exports[_0x6f85('0x26')]=function(_0x94065a,_0x5ce794){return respondWithRpcPromise(_0x6f85('0x27'),_[_0x6f85('0x17')](_0x94065a['query'],_0x94065a['params']))[_0x6f85('0x7')](respondWithResult(_0x5ce794,null))[_0x6f85('0xc')](handleError(_0x5ce794,null));};exports[_0x6f85('0x28')]=function(_0x13eb72,_0x11b98d){return respondWithRpcPromise('Outbound',_0x13eb72[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x11b98d,null))[_0x6f85('0xc')](handleError(_0x11b98d,null));};exports[_0x6f85('0x29')]=function(_0x244191,_0x2b391b){return respondWithRpcPromise(_0x6f85('0x2a'),_0x244191[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x2b391b,null))['catch'](handleError(_0x2b391b,null));};exports['agents']=function(_0x949042,_0x1b1327){var _0x3620bd;return respondWithRpcPromise(_0x6f85('0x2b'),_0x949042[_0x6f85('0x14')])[_0x6f85('0x7')](function(_0x58d0a7){_0x3620bd=_0x58d0a7;return respondWithRpcPromise(_0x6f85('0x2b'),_0x949042[_0x6f85('0x14')],routingClient);})[_0x6f85('0x7')](function(_0x5cba9e){return _[_0x6f85('0x17')]({},_0x5cba9e,_0x3620bd);})[_0x6f85('0x7')](respondWithResult(_0x1b1327,null))[_0x6f85('0xc')](handleError(_0x1b1327,null));};exports[_0x6f85('0x2c')]=function(_0x5a3151,_0x4a3d5d){if(_0x5a3151['body']&&_0x5a3151[_0x6f85('0x2d')][_0x6f85('0x2e')]&&_0x5a3151[_0x6f85('0x2f')]&&_0x5a3151[_0x6f85('0x2f')][_0x6f85('0x10')]){for(var _0xe4e5b8 in _0x5a3151[_0x6f85('0x2d')]['interaction']){if(_0x5a3151['body'][_0x6f85('0x2e')][_0x6f85('0x30')](_0xe4e5b8)){db[_0x6f85('0x31')]['findAll']({'where':{'channel':_0xe4e5b8,'membername':_0x5a3151[_0x6f85('0x2f')]['name'],'type':_0x6f85('0x32'),'exitAt':null,'uniqueid':_0x5a3151[_0x6f85('0x2d')][_0x6f85('0x2e')][_0xe4e5b8]&&_0x5a3151[_0x6f85('0x2d')][_0x6f85('0x2e')][_0xe4e5b8]['length']?{'$notIn':_0x5a3151[_0x6f85('0x2d')]['interaction'][_0xe4e5b8]}:{'$ne':null}}})['then'](function(_0x313ddd){var _0x4548ae=moment()[_0x6f85('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x53b967=0x0,_0x49bae5=_0x313ddd[_0x6f85('0x34')];_0x53b967<_0x49bae5;_0x53b967+=0x1){_0x313ddd[_0x53b967][_0x6f85('0x35')]({'exitAt':_0x4548ae});}});for(var _0x165d48=0x0;_0x165d48<_0x5a3151['body'][_0x6f85('0x2e')][_0xe4e5b8]['length'];_0x165d48+=0x1){db[_0x6f85('0x31')][_0x6f85('0x36')]({'where':{'channel':_0xe4e5b8,'membername':_0x5a3151[_0x6f85('0x2f')]['name'],'type':'INTERACTION','uniqueid':_0x5a3151['body'][_0x6f85('0x2e')][_0xe4e5b8][_0x165d48],'exitAt':null},'defaults':{'channel':_0xe4e5b8,'membername':_0x5a3151[_0x6f85('0x2f')][_0x6f85('0x10')],'interface':_[_0x6f85('0x11')](_0x5a3151['user'][_0x6f85('0x37')])?util[_0x6f85('0x33')](_0x6f85('0x38'),_0x5a3151[_0x6f85('0x2f')][_0x6f85('0x10')]):_0x5a3151['user'][_0x6f85('0x37')],'type':_0x6f85('0x32'),'enterAt':moment()[_0x6f85('0x33')](_0x6f85('0x39')),'role':_0x6f85('0x3a'),'internal':_0x5a3151[_0x6f85('0x2f')][_0x6f85('0x3b')],'uniqueid':_0x5a3151['body']['interaction'][_0xe4e5b8][_0x165d48]}});}}}}return respondWithRpcPromise(_0x6f85('0x3c'),{'id':_0x5a3151[_0x6f85('0x18')]['id'],'capacity':_0x5a3151[_0x6f85('0x2d')][_0x6f85('0x3d')]},routingClient)['then'](respondWithResult(_0x4a3d5d,null))[_0x6f85('0xc')](handleError(_0x4a3d5d,null));};exports['telephones']=function(_0x52ad02,_0x21b21f){return respondWithRpcPromise('Telephones',_0x52ad02[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x21b21f,null))[_0x6f85('0xc')](handleError(_0x21b21f,null));};exports[_0x6f85('0x3e')]=function(_0x586891,_0x114ab3){return respondWithRpcPromise(_0x6f85('0x3f'),_0x586891[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x114ab3,null))[_0x6f85('0xc')](handleError(_0x114ab3,null));};exports['campaigns']=function(_0x204214,_0x532e6a){return respondWithRpcPromise(_0x6f85('0x40'),_0x204214['query'])['then'](respondWithResult(_0x532e6a,null))[_0x6f85('0xc')](handleError(_0x532e6a,null));};exports[_0x6f85('0x41')]=function(_0x25a07f,_0x5c19db){return respondWithRpcPromise(_0x6f85('0x42'),_0x25a07f[_0x6f85('0x14')],routingClient)['then'](respondWithResult(_0x5c19db,null))[_0x6f85('0xc')](handleError(_0x5c19db,null));};exports[_0x6f85('0x43')]=function(_0x4b01fb,_0x15e73b){return respondWithRpcPromise('ChatQueues',_0x4b01fb[_0x6f85('0x14')],routingClient)['then'](findById(_0x4b01fb['params']['id']))[_0x6f85('0x7')](respondWithResult(_0x15e73b,null))[_0x6f85('0xc')](handleError(_0x15e73b,null));};exports['mailQueues']=function(_0x1b1cbc,_0x1396be){return respondWithRpcPromise(_0x6f85('0x44'),_0x1b1cbc[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x1396be,null))[_0x6f85('0xc')](handleError(_0x1396be,null));};exports[_0x6f85('0x45')]=function(_0x560c12,_0x4d4569){return respondWithRpcPromise(_0x6f85('0x44'),_0x560c12['query'],routingClient)[_0x6f85('0x7')](findById(_0x560c12[_0x6f85('0x18')]['id']))[_0x6f85('0x7')](respondWithResult(_0x4d4569,null))[_0x6f85('0xc')](handleError(_0x4d4569,null));};exports[_0x6f85('0x46')]=function(_0x1b5595,_0xfc7732){return respondWithRpcPromise(_0x6f85('0x47'),_0x1b5595[_0x6f85('0x14')],mailClient)[_0x6f85('0x7')](respondWithResult(_0xfc7732,null))[_0x6f85('0xc')](handleError(_0xfc7732,null));};exports[_0x6f85('0x48')]=function(_0x2de8ea,_0x10dbca){return respondWithRpcPromise(_0x6f85('0x49'),_0x2de8ea[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x10dbca,null))[_0x6f85('0xc')](handleError(_0x10dbca,null));};exports[_0x6f85('0x4a')]=function(_0x20f3c0,_0x2f4d46){return respondWithRpcPromise('OpenchannelQueues',_0x20f3c0['query'],routingClient)['then'](findById(_0x20f3c0[_0x6f85('0x18')]['id']))['then'](respondWithResult(_0x2f4d46,null))[_0x6f85('0xc')](handleError(_0x2f4d46,null));};exports['smsQueues']=function(_0x507413,_0x4a1979){return respondWithRpcPromise(_0x6f85('0x4b'),_0x507413['query'],routingClient)[_0x6f85('0x7')](respondWithResult(_0x4a1979,null))[_0x6f85('0xc')](handleError(_0x4a1979,null));};exports[_0x6f85('0x4c')]=function(_0x4e03b1,_0x515789){return respondWithRpcPromise('SmsQueues',_0x4e03b1['query'],routingClient)[_0x6f85('0x7')](findById(_0x4e03b1['params']['id']))[_0x6f85('0x7')](respondWithResult(_0x515789,null))['catch'](handleError(_0x515789,null));};exports['faxQueues']=function(_0x5ddf10,_0x1f6d14){return respondWithRpcPromise(_0x6f85('0x4d'),_0x5ddf10[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x1f6d14,null))[_0x6f85('0xc')](handleError(_0x1f6d14,null));};exports[_0x6f85('0x4e')]=function(_0x2cc21f,_0x19b768){return respondWithRpcPromise(_0x6f85('0x4d'),_0x2cc21f['query'],routingClient)[_0x6f85('0x7')](findById(_0x2cc21f[_0x6f85('0x18')]['id']))['then'](respondWithResult(_0x19b768,null))[_0x6f85('0xc')](handleError(_0x19b768,null));};exports[_0x6f85('0x4f')]=function(_0x6477bc,_0x6b799b){return respondWithRpcPromise(_0x6f85('0x50'),_0x6477bc[_0x6f85('0x14')])[_0x6f85('0x7')](respondWithResult(_0x6b799b,null))[_0x6f85('0xc')](handleError(_0x6b799b,null));};exports[_0x6f85('0x51')]=function(_0x2fa193,_0x434c27){return respondWithRpcPromise(_0x6f85('0x52'),_0x2fa193[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x434c27,null))['catch'](handleError(_0x434c27,null));};exports[_0x6f85('0x53')]=function(_0x56216e,_0x147024){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x56216e['query'],routingClient)['then'](respondWithResult(_0x147024,null))['catch'](handleError(_0x147024,null));};exports[_0x6f85('0x54')]=function(_0x4a6bbd,_0x27b000){return respondWithRpcPromise(_0x6f85('0x55'),_0x4a6bbd[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x27b000,null))[_0x6f85('0xc')](handleError(_0x27b000,null));};exports['smsQueuesWaitingInteractions']=function(_0x4f56f0,_0x3a27a4){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x4f56f0[_0x6f85('0x14')],routingClient)[_0x6f85('0x7')](respondWithResult(_0x3a27a4,null))[_0x6f85('0xc')](handleError(_0x3a27a4,null));};exports[_0x6f85('0x56')]=function(_0x3e9646,_0x184950){return respondWithRpcPromise(_0x6f85('0x57'),_0x3e9646['query'],routingClient)[_0x6f85('0x7')](respondWithResult(_0x184950,null))[_0x6f85('0xc')](handleError(_0x184950,null));};exports[_0x6f85('0x58')]=function(_0x439153){return function(_0x57d824,_0xdf987f){var _0x163fd8,_0xc97725;var _0xe871ed=_[_0x6f85('0x59')](_0x439153);var _0x210435=_0x439153==='chat'?_0x6f85('0x5a'):_0x6f85('0x5b');return db[_0xe871ed+'Queue']['findOne']({'raw':!![],'where':{'id':_0x57d824[_0x6f85('0x18')]['id']}})[_0x6f85('0x7')](function(_0x3d5f34){if(_[_0x6f85('0x11')](_0x3d5f34)){throw new Error(_0xe871ed+_0x6f85('0x5c'));}_0x163fd8=_0x3d5f34;return db[_0xe871ed+_0x6f85('0x5d')][_0x6f85('0x5e')]({'where':{'id':_0x57d824[_0x6f85('0x2d')]['messageId']},'include':[{'model':db[_0xe871ed+_0x6f85('0x5f')],'as':'Interaction'},{'model':db[_0xe871ed+_0x210435],'as':'Account'}]});})['then'](function(_0x23c796){if(_[_0x6f85('0x11')](_0x23c796)){throw new Error(_0xe871ed+_0x6f85('0x60'));}_0xc97725=_0x23c796;return _0x23c796[_0x6f85('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6f85('0x7')](function(){var _0x5e323a={'uniqueid':_0x439153+'.'+_0xc97725['id']+'.'+_0xc97725[_0x6f85('0x5f')]['id'],'FromUserId':_0x57d824[_0x6f85('0x2f')]['id'],'type':_0x6f85('0x62')};_0x5e323a[_0xe871ed+'MessageId']=_0xc97725['id'];_0x5e323a[_0xe871ed+_0x6f85('0x63')]=_0xc97725['Interaction']['id'];_0x5e323a[_0x6f85('0x64')+_0xe871ed+_0x210435+'Id']=_0xc97725[_0x6f85('0x5b')]['id'];_0x5e323a['To'+_0xe871ed+_0x6f85('0x65')]=_0x163fd8['id'];return db[_0xe871ed+_0x6f85('0x66')]['create'](_0x5e323a);})[_0x6f85('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x439153,'interaction':_0xc97725[_0x6f85('0x5f')],'message':_0xc97725,'account':_0xc97725[_0x6f85('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6f85('0x62'),'appdata':_0x163fd8['name']+','+(_0xc97725['Account'][_0x6f85('0x67')]||0x12c),'interval':_0x6f85('0x68')}]},routingClient);})[_0x6f85('0x7')](respondWithResult(_0xdf987f,null))[_0x6f85('0xc')](handleError(_0xdf987f,null));};};exports[_0x6f85('0x69')]=function(_0x28653d,_0x1386e0){var _0x166029,_0x33227c;if(_[_0x6f85('0x11')](_0x28653d[_0x6f85('0x2d')][_0x6f85('0x6a')])){throw new Error(_0x6f85('0x6b'));}var _0x3216e8=_0x28653d[_0x6f85('0x2d')][_0x6f85('0x6a')];var _0x2f405a=_[_0x6f85('0x59')](_0x3216e8);var _0xa187b8=_0x3216e8===_0x6f85('0x6c')?_0x6f85('0x5a'):'Account';return db[_0x6f85('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x28653d[_0x6f85('0x18')]['id'],'role':'agent'}})['then'](function(_0x2ccd30){if(_['isNil'](_0x2ccd30)){throw new Error(_0x6f85('0x6e'));}_0x166029=_0x2ccd30;return db[_0x2f405a+'Message']['findOne']({'where':{'id':_0x28653d['body']['messageId']},'include':[{'model':db[_0x2f405a+_0x6f85('0x5f')],'as':_0x6f85('0x5f')},{'model':db[_0x2f405a+_0xa187b8],'as':'Account'}]});})[_0x6f85('0x7')](function(_0x3d0eab){if(_['isNil'](_0x3d0eab)){throw new Error(_0x2f405a+_0x6f85('0x60'));}_0x33227c=_0x3d0eab;return _0x3d0eab[_0x6f85('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6f85('0x7')](function(){var _0x16f3a7={'uniqueid':_0x3216e8+'.'+_0x33227c['id']+'.'+_0x33227c[_0x6f85('0x5f')]['id'],'FromUserId':_0x28653d[_0x6f85('0x2f')]['id'],'type':_0x6f85('0x62'),'ToUserId':_0x166029['id']};_0x16f3a7[_0x2f405a+_0x6f85('0x6f')]=_0x33227c['id'];_0x16f3a7[_0x2f405a+_0x6f85('0x63')]=_0x33227c[_0x6f85('0x5f')]['id'];_0x16f3a7[_0x6f85('0x64')+_0x2f405a+_0xa187b8+'Id']=_0x33227c[_0x6f85('0x5b')]['id'];return db[_0x2f405a+_0x6f85('0x66')][_0x6f85('0x70')](_0x16f3a7);})[_0x6f85('0x7')](function(){return respondWithRpcPromise(_0x6f85('0x71'),{'channel':_0x3216e8,'interaction':_0x33227c[_0x6f85('0x5f')],'message':_0x33227c,'account':_0x33227c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6f85('0x3a'),'appdata':_0x166029[_0x6f85('0x10')]+','+(_0x33227c[_0x6f85('0x5b')][_0x6f85('0x72')]||0x12c),'interval':_0x6f85('0x68')}]},routingClient);})[_0x6f85('0x7')](respondWithResult(_0x1386e0,null))[_0x6f85('0xc')](handleError(_0x1386e0,null));}; \ No newline at end of file +var _0x08a3=['Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','findOne','Message','messageId','InteractionId','*,*,*,*','bluebird','moment','lodash','util','../../config/logger','api','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','body','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showFaxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','Interaction','Account','update','queue','MessageId','From','QueueId','TransferReport','create'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x08a3,0x176));var _0x308a=function(_0x484d05,_0x43d6f8){_0x484d05=_0x484d05-0x0;var _0x283ebb=_0x08a3[_0x484d05];return _0x283ebb;};'use strict';var BPromise=require(_0x308a('0x0'));var moment=require(_0x308a('0x1'));var _=require(_0x308a('0x2'));var util=require(_0x308a('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x308a('0x4'))(_0x308a('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x308a('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x308a('0x6')]({'port':0x232b});var routingClient=jayson[_0x308a('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x58cb8f,_0x56405e,_0x494e7d){return new BPromise(function(_0x2bb567,_0x4865c1){var _0x54def9=_0x494e7d?_0x494e7d:amiClient;return _0x54def9[_0x308a('0x8')](_0x58cb8f,_0x56405e)[_0x308a('0x9')](function(_0x3c4363){if(_0x3c4363[_0x308a('0xa')]){if(_0x3c4363[_0x308a('0xa')][_0x308a('0xb')]===0x1f4){return _0x4865c1(_0x3c4363[_0x308a('0xa')][_0x308a('0xc')]);}return _0x2bb567(_0x3c4363[_0x308a('0xa')][_0x308a('0xc')]);}else{_0x2bb567(_0x3c4363[_0x308a('0xd')]);}})[_0x308a('0xe')](function(_0x3ab49e){_0x4865c1(_0x3ab49e);});});}function respondWithResult(_0x685ac2,_0x1801d2){_0x1801d2=_0x1801d2||0xc8;return function(_0x4a8219){if(_0x4a8219){return _0x685ac2[_0x308a('0xf')](_0x1801d2)[_0x308a('0x10')](_0x4a8219);}return _0x685ac2[_0x308a('0x11')](0x194);};}function handleError(_0x370dec,_0x421dca){_0x421dca=_0x421dca||0x1f4;return function(_0x557839){logger[_0x308a('0xa')](_0x557839[_0x308a('0x12')]);if(_0x557839[_0x308a('0x13')]){delete _0x557839[_0x308a('0x13')];}_0x370dec[_0x308a('0xf')](_0x421dca)['send'](_0x557839);};}function findById(_0x5d9794){return function(_0x8c209){if(!_[_0x308a('0x14')](_0x5d9794)&&!_[_0x308a('0x14')](_0x8c209)&&!_[_0x308a('0x14')](_0x8c209['rows'])){return _[_0x308a('0x15')](_0x8c209[_0x308a('0x16')],function(_0x2f4de5){return _0x2f4de5['id']==_0x5d9794;});}return null;};}exports[_0x308a('0x17')]=function(_0x5cc1f9,_0x422c9d){return respondWithRpcPromise(_0x308a('0x18'),_0x5cc1f9[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0x422c9d,null))[_0x308a('0xe')](handleError(_0x422c9d,null));};exports[_0x308a('0x1a')]=function(_0x491057,_0x381694){return respondWithRpcPromise(_0x308a('0x1b'),_[_0x308a('0x1c')](_0x491057[_0x308a('0x19')],_0x491057[_0x308a('0x1d')]))[_0x308a('0x9')](respondWithResult(_0x381694,null))[_0x308a('0xe')](handleError(_0x381694,null));};exports[_0x308a('0x1e')]=function(_0x4e7b17,_0x4a750c){return respondWithRpcPromise(_0x308a('0x1f'),_['merge'](_0x4e7b17[_0x308a('0x19')],_0x4e7b17[_0x308a('0x1d')]))[_0x308a('0x9')](respondWithResult(_0x4a750c,null))['catch'](handleError(_0x4a750c,null));};exports[_0x308a('0x20')]=function(_0x570bf3,_0x5809ba){return respondWithRpcPromise('VoiceQueues',_0x570bf3['query'])[_0x308a('0x9')](respondWithResult(_0x5809ba,null))['catch'](handleError(_0x5809ba,null));};exports[_0x308a('0x21')]=function(_0x1f23e6,_0x1ebd3c){return respondWithRpcPromise(_0x308a('0x22'),_0x1f23e6[_0x308a('0x19')])[_0x308a('0x9')](findById(_0x1f23e6['params']['id']))[_0x308a('0x9')](respondWithResult(_0x1ebd3c,null))['catch'](handleError(_0x1ebd3c,null));};exports[_0x308a('0x23')]=function(_0x58c0e8,_0xe8db87){return respondWithRpcPromise(_0x308a('0x24'),_[_0x308a('0x1c')](_0x58c0e8[_0x308a('0x19')],_0x58c0e8[_0x308a('0x1d')]))[_0x308a('0x9')](respondWithResult(_0xe8db87,null))[_0x308a('0xe')](handleError(_0xe8db87,null));};exports[_0x308a('0x25')]=function(_0x1e5c95,_0x2b28a2){return respondWithRpcPromise(_0x308a('0x26'),_0x1e5c95[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0x2b28a2,null))['catch'](handleError(_0x2b28a2,null));};exports['voiceQueuesChannel']=function(_0xf80dd2,_0x57c199){return respondWithRpcPromise(_0x308a('0x27'),_[_0x308a('0x1c')](_0xf80dd2[_0x308a('0x19')],_0xf80dd2['params']))['then'](respondWithResult(_0x57c199,null))[_0x308a('0xe')](handleError(_0x57c199,null));};exports[_0x308a('0x28')]=function(_0x5721db,_0x32029e){return respondWithRpcPromise(_0x308a('0x29'),_[_0x308a('0x1c')](_0x5721db['query'],_0x5721db[_0x308a('0x1d')]))[_0x308a('0x9')](respondWithResult(_0x32029e,null))[_0x308a('0xe')](handleError(_0x32029e,null));};exports['voiceQueuesChannelRedirect']=function(_0xebac93,_0x3490fc){return respondWithRpcPromise(_0x308a('0x2a'),_[_0x308a('0x1c')](_0xebac93[_0x308a('0x19')],_0xebac93[_0x308a('0x1d')]))['then'](respondWithResult(_0x3490fc,null))[_0x308a('0xe')](handleError(_0x3490fc,null));};exports[_0x308a('0x2b')]=function(_0x51c073,_0x3820f4){return respondWithRpcPromise('Outbound',_0x51c073[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0x3820f4,null))['catch'](handleError(_0x3820f4,null));};exports[_0x308a('0x2c')]=function(_0x5b3f68,_0x2ba985){return respondWithRpcPromise(_0x308a('0x2d'),_0x5b3f68['query'])[_0x308a('0x9')](respondWithResult(_0x2ba985,null))['catch'](handleError(_0x2ba985,null));};exports[_0x308a('0x2e')]=function(_0x112b92,_0x593ac6){var _0x10f6fd;return respondWithRpcPromise(_0x308a('0x2f'),_0x112b92[_0x308a('0x19')])[_0x308a('0x9')](function(_0x4fc4ab){_0x10f6fd=_0x4fc4ab;return respondWithRpcPromise(_0x308a('0x2f'),_0x112b92[_0x308a('0x19')],routingClient);})[_0x308a('0x9')](function(_0x486f7f){return _['merge']({},_0x486f7f,_0x10f6fd);})[_0x308a('0x9')](respondWithResult(_0x593ac6,null))[_0x308a('0xe')](handleError(_0x593ac6,null));};exports[_0x308a('0x30')]=function(_0x665c7b,_0x30107e){if(_0x665c7b['body']&&_0x665c7b['body'][_0x308a('0x31')]&&_0x665c7b[_0x308a('0x32')]&&_0x665c7b[_0x308a('0x32')][_0x308a('0x13')]){for(var _0x3e1ed3 in _0x665c7b['body'][_0x308a('0x31')]){if(_0x665c7b[_0x308a('0x33')][_0x308a('0x31')][_0x308a('0x34')](_0x3e1ed3)){db[_0x308a('0x35')][_0x308a('0x36')]({'where':{'channel':_0x3e1ed3,'membername':_0x665c7b[_0x308a('0x32')][_0x308a('0x13')],'type':_0x308a('0x37'),'exitAt':null,'uniqueid':_0x665c7b[_0x308a('0x33')][_0x308a('0x31')][_0x3e1ed3]&&_0x665c7b['body'][_0x308a('0x31')][_0x3e1ed3][_0x308a('0x38')]?{'$notIn':_0x665c7b[_0x308a('0x33')][_0x308a('0x31')][_0x3e1ed3]}:{'$ne':null}}})[_0x308a('0x9')](function(_0x5d8156){var _0x4194d5=moment()[_0x308a('0x39')](_0x308a('0x3a'));for(var _0x32463b=0x0,_0x372402=_0x5d8156['length'];_0x32463b<_0x372402;_0x32463b+=0x1){_0x5d8156[_0x32463b][_0x308a('0x3b')]({'exitAt':_0x4194d5});}});for(var _0x4b3501=0x0;_0x4b3501<_0x665c7b[_0x308a('0x33')][_0x308a('0x31')][_0x3e1ed3]['length'];_0x4b3501+=0x1){db[_0x308a('0x35')][_0x308a('0x3c')]({'where':{'channel':_0x3e1ed3,'membername':_0x665c7b['user']['name'],'type':'INTERACTION','uniqueid':_0x665c7b[_0x308a('0x33')][_0x308a('0x31')][_0x3e1ed3][_0x4b3501],'exitAt':null},'defaults':{'channel':_0x3e1ed3,'membername':_0x665c7b['user']['name'],'interface':_[_0x308a('0x14')](_0x665c7b[_0x308a('0x32')][_0x308a('0x3d')])?util[_0x308a('0x39')]('SIP/%s',_0x665c7b[_0x308a('0x32')][_0x308a('0x13')]):_0x665c7b[_0x308a('0x32')]['interface'],'type':_0x308a('0x37'),'enterAt':moment()[_0x308a('0x39')](_0x308a('0x3a')),'role':_0x308a('0x3e'),'internal':_0x665c7b[_0x308a('0x32')][_0x308a('0x3f')],'uniqueid':_0x665c7b['body'][_0x308a('0x31')][_0x3e1ed3][_0x4b3501]}});}}}}return respondWithRpcPromise(_0x308a('0x40'),{'id':_0x665c7b[_0x308a('0x1d')]['id'],'capacity':_0x665c7b[_0x308a('0x33')][_0x308a('0x41')]},routingClient)['then'](respondWithResult(_0x30107e,null))[_0x308a('0xe')](handleError(_0x30107e,null));};exports[_0x308a('0x42')]=function(_0x134971,_0xbee9b1){return respondWithRpcPromise(_0x308a('0x43'),_0x134971[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0xbee9b1,null))['catch'](handleError(_0xbee9b1,null));};exports[_0x308a('0x44')]=function(_0x53c4df,_0x442333){return respondWithRpcPromise(_0x308a('0x45'),_0x53c4df[_0x308a('0x19')])['then'](respondWithResult(_0x442333,null))[_0x308a('0xe')](handleError(_0x442333,null));};exports[_0x308a('0x46')]=function(_0x21902a,_0x407ddd){return respondWithRpcPromise(_0x308a('0x47'),_0x21902a[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0x407ddd,null))[_0x308a('0xe')](handleError(_0x407ddd,null));};exports[_0x308a('0x48')]=function(_0x386e2d,_0x53ce30){return respondWithRpcPromise('ChatQueues',_0x386e2d[_0x308a('0x19')],routingClient)[_0x308a('0x9')](respondWithResult(_0x53ce30,null))['catch'](handleError(_0x53ce30,null));};exports[_0x308a('0x49')]=function(_0x420663,_0x54cd7e){return respondWithRpcPromise(_0x308a('0x4a'),_0x420663[_0x308a('0x19')],routingClient)[_0x308a('0x9')](findById(_0x420663['params']['id']))[_0x308a('0x9')](respondWithResult(_0x54cd7e,null))[_0x308a('0xe')](handleError(_0x54cd7e,null));};exports[_0x308a('0x4b')]=function(_0x3d510a,_0x41cd0c){return respondWithRpcPromise(_0x308a('0x4c'),_0x3d510a[_0x308a('0x19')],routingClient)['then'](respondWithResult(_0x41cd0c,null))['catch'](handleError(_0x41cd0c,null));};exports[_0x308a('0x4d')]=function(_0x5bf700,_0xf34255){return respondWithRpcPromise('MailQueues',_0x5bf700[_0x308a('0x19')],routingClient)['then'](findById(_0x5bf700[_0x308a('0x1d')]['id']))[_0x308a('0x9')](respondWithResult(_0xf34255,null))[_0x308a('0xe')](handleError(_0xf34255,null));};exports[_0x308a('0x4e')]=function(_0x36a438,_0x52ab13){return respondWithRpcPromise(_0x308a('0x4f'),_0x36a438[_0x308a('0x19')],mailClient)['then'](respondWithResult(_0x52ab13,null))['catch'](handleError(_0x52ab13,null));};exports[_0x308a('0x50')]=function(_0x543595,_0x3f31c6){return respondWithRpcPromise(_0x308a('0x51'),_0x543595[_0x308a('0x19')],routingClient)['then'](respondWithResult(_0x3f31c6,null))[_0x308a('0xe')](handleError(_0x3f31c6,null));};exports[_0x308a('0x52')]=function(_0x529d98,_0x43c7b8){return respondWithRpcPromise('OpenchannelQueues',_0x529d98[_0x308a('0x19')],routingClient)[_0x308a('0x9')](findById(_0x529d98['params']['id']))['then'](respondWithResult(_0x43c7b8,null))[_0x308a('0xe')](handleError(_0x43c7b8,null));};exports[_0x308a('0x53')]=function(_0x5da861,_0x4ad5f8){return respondWithRpcPromise(_0x308a('0x54'),_0x5da861[_0x308a('0x19')],routingClient)[_0x308a('0x9')](respondWithResult(_0x4ad5f8,null))[_0x308a('0xe')](handleError(_0x4ad5f8,null));};exports[_0x308a('0x55')]=function(_0x794ba2,_0x715f7b){return respondWithRpcPromise(_0x308a('0x54'),_0x794ba2[_0x308a('0x19')],routingClient)[_0x308a('0x9')](findById(_0x794ba2[_0x308a('0x1d')]['id']))[_0x308a('0x9')](respondWithResult(_0x715f7b,null))[_0x308a('0xe')](handleError(_0x715f7b,null));};exports['faxQueues']=function(_0x2d2a6e,_0x57a887){return respondWithRpcPromise('FaxQueues',_0x2d2a6e[_0x308a('0x19')],routingClient)[_0x308a('0x9')](respondWithResult(_0x57a887,null))[_0x308a('0xe')](handleError(_0x57a887,null));};exports[_0x308a('0x56')]=function(_0x3c238b,_0x59802b){return respondWithRpcPromise(_0x308a('0x57'),_0x3c238b[_0x308a('0x19')],routingClient)['then'](findById(_0x3c238b[_0x308a('0x1d')]['id']))['then'](respondWithResult(_0x59802b,null))['catch'](handleError(_0x59802b,null));};exports['faxAccounts']=function(_0x1f878a,_0x47822f){return respondWithRpcPromise(_0x308a('0x58'),_0x1f878a[_0x308a('0x19')])[_0x308a('0x9')](respondWithResult(_0x47822f,null))[_0x308a('0xe')](handleError(_0x47822f,null));};exports['chatQueuesWaitingInteractions']=function(_0x2383f5,_0x24cfc2){return respondWithRpcPromise(_0x308a('0x59'),_0x2383f5[_0x308a('0x19')],routingClient)[_0x308a('0x9')](respondWithResult(_0x24cfc2,null))[_0x308a('0xe')](handleError(_0x24cfc2,null));};exports[_0x308a('0x5a')]=function(_0x217b2a,_0x40d2a1){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x217b2a[_0x308a('0x19')],routingClient)['then'](respondWithResult(_0x40d2a1,null))[_0x308a('0xe')](handleError(_0x40d2a1,null));};exports[_0x308a('0x5b')]=function(_0x36df19,_0xfde840){return respondWithRpcPromise(_0x308a('0x5c'),_0x36df19[_0x308a('0x19')],routingClient)['then'](respondWithResult(_0xfde840,null))[_0x308a('0xe')](handleError(_0xfde840,null));};exports[_0x308a('0x5d')]=function(_0x5988fb,_0x349800){return respondWithRpcPromise(_0x308a('0x5e'),_0x5988fb['query'],routingClient)[_0x308a('0x9')](respondWithResult(_0x349800,null))[_0x308a('0xe')](handleError(_0x349800,null));};exports['faxQueuesWaitingInteractions']=function(_0x59e48a,_0x297702){return respondWithRpcPromise(_0x308a('0x5f'),_0x59e48a[_0x308a('0x19')],routingClient)[_0x308a('0x9')](respondWithResult(_0x297702,null))[_0x308a('0xe')](handleError(_0x297702,null));};exports[_0x308a('0x60')]=function(_0x465028){return function(_0x5ae918,_0x528f60){var _0x1b8343,_0x3e6261;var _0xcbb2d2=_[_0x308a('0x61')](_0x465028);var _0x428331=_0x465028===_0x308a('0x62')?_0x308a('0x63'):'Account';return db[_0xcbb2d2+_0x308a('0x64')]['findOne']({'raw':!![],'where':{'id':_0x5ae918['params']['id']}})['then'](function(_0x15d559){if(_['isNil'](_0x15d559)){throw new Error(_0xcbb2d2+'\x20Queue\x20not\x20found');}_0x1b8343=_0x15d559;return db[_0xcbb2d2+'Message']['findOne']({'where':{'id':_0x5ae918['body']['messageId']},'include':[{'model':db[_0xcbb2d2+_0x308a('0x65')],'as':'Interaction'},{'model':db[_0xcbb2d2+_0x428331],'as':_0x308a('0x66')}]});})[_0x308a('0x9')](function(_0x323aa4){if(_[_0x308a('0x14')](_0x323aa4)){throw new Error(_0xcbb2d2+'\x20Message\x20not\x20found');}_0x3e6261=_0x323aa4;return _0x323aa4[_0x308a('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x308a('0x9')](function(){var _0x59c284={'uniqueid':_0x465028+'.'+_0x3e6261['id']+'.'+_0x3e6261[_0x308a('0x65')]['id'],'FromUserId':_0x5ae918[_0x308a('0x32')]['id'],'type':_0x308a('0x68')};_0x59c284[_0xcbb2d2+_0x308a('0x69')]=_0x3e6261['id'];_0x59c284[_0xcbb2d2+'InteractionId']=_0x3e6261[_0x308a('0x65')]['id'];_0x59c284[_0x308a('0x6a')+_0xcbb2d2+_0x428331+'Id']=_0x3e6261[_0x308a('0x66')]['id'];_0x59c284['To'+_0xcbb2d2+_0x308a('0x6b')]=_0x1b8343['id'];return db[_0xcbb2d2+_0x308a('0x6c')][_0x308a('0x6d')](_0x59c284);})[_0x308a('0x9')](function(){return respondWithRpcPromise(_0x308a('0x6e'),{'channel':_0x465028,'interaction':_0x3e6261[_0x308a('0x65')],'message':_0x3e6261,'account':_0x3e6261[_0x308a('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0x308a('0x68'),'appdata':_0x1b8343[_0x308a('0x13')]+','+(_0x3e6261[_0x308a('0x66')][_0x308a('0x6f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x308a('0x9')](respondWithResult(_0x528f60,null))[_0x308a('0xe')](handleError(_0x528f60,null));};};exports[_0x308a('0x70')]=function(_0x4ed086,_0x5ca7ab){var _0xdf9dd8,_0x45ba57;if(_[_0x308a('0x14')](_0x4ed086['body'][_0x308a('0x71')])){throw new Error(_0x308a('0x72'));}var _0x11493f=_0x4ed086[_0x308a('0x33')][_0x308a('0x71')];var _0x49ade7=_[_0x308a('0x61')](_0x11493f);var _0x3bbbea=_0x11493f===_0x308a('0x62')?_0x308a('0x63'):_0x308a('0x66');return db[_0x308a('0x73')][_0x308a('0x74')]({'raw':!![],'where':{'id':_0x4ed086[_0x308a('0x1d')]['id'],'role':_0x308a('0x3e')}})[_0x308a('0x9')](function(_0xb32b7d){if(_[_0x308a('0x14')](_0xb32b7d)){throw new Error('Agent\x20not\x20found');}_0xdf9dd8=_0xb32b7d;return db[_0x49ade7+_0x308a('0x75')][_0x308a('0x74')]({'where':{'id':_0x4ed086[_0x308a('0x33')][_0x308a('0x76')]},'include':[{'model':db[_0x49ade7+_0x308a('0x65')],'as':_0x308a('0x65')},{'model':db[_0x49ade7+_0x3bbbea],'as':_0x308a('0x66')}]});})['then'](function(_0x51df93){if(_[_0x308a('0x14')](_0x51df93)){throw new Error(_0x49ade7+'\x20Message\x20not\x20found');}_0x45ba57=_0x51df93;return _0x51df93[_0x308a('0x67')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x36b747={'uniqueid':_0x11493f+'.'+_0x45ba57['id']+'.'+_0x45ba57[_0x308a('0x65')]['id'],'FromUserId':_0x4ed086[_0x308a('0x32')]['id'],'type':_0x308a('0x68'),'ToUserId':_0xdf9dd8['id']};_0x36b747[_0x49ade7+_0x308a('0x69')]=_0x45ba57['id'];_0x36b747[_0x49ade7+_0x308a('0x77')]=_0x45ba57[_0x308a('0x65')]['id'];_0x36b747['From'+_0x49ade7+_0x3bbbea+'Id']=_0x45ba57[_0x308a('0x66')]['id'];return db[_0x49ade7+_0x308a('0x6c')][_0x308a('0x6d')](_0x36b747);})[_0x308a('0x9')](function(){return respondWithRpcPromise(_0x308a('0x6e'),{'channel':_0x11493f,'interaction':_0x45ba57[_0x308a('0x65')],'message':_0x45ba57,'account':_0x45ba57['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0xdf9dd8[_0x308a('0x13')]+','+(_0x45ba57[_0x308a('0x66')]['agentTransferTimeout']||0x12c),'interval':_0x308a('0x78')}]},routingClient);})[_0x308a('0x9')](respondWithResult(_0x5ca7ab,null))[_0x308a('0xe')](handleError(_0x5ca7ab,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b3e5ad1..4541e9f 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 _0x47b3=['index','/:id','show','/:id/run','run','post','create','update','delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x3e246c,_0x59708e){var _0xe9d837=function(_0x2e7b7e){while(--_0x2e7b7e){_0x3e246c['push'](_0x3e246c['shift']());}};_0xe9d837(++_0x59708e);}(_0x47b3,0xf3));var _0x347b=function(_0x171458,_0x5b6976){_0x171458=_0x171458-0x0;var _0x47a6da=_0x47b3[_0x171458];return _0x47a6da;};'use strict';var multer=require('multer');var util=require(_0x347b('0x0'));var path=require('path');var timeout=require(_0x347b('0x1'));var express=require(_0x347b('0x2'));var router=express['Router']();var auth=require(_0x347b('0x3'));var interaction=require(_0x347b('0x4'));var config=require(_0x347b('0x5'));var controller=require(_0x347b('0x6'));router[_0x347b('0x7')]('/',auth[_0x347b('0x8')](),controller[_0x347b('0x9')]);router[_0x347b('0x7')](_0x347b('0xa'),auth['isAuthenticated'](),controller[_0x347b('0xb')]);router['get'](_0x347b('0xc'),auth[_0x347b('0x8')](),controller[_0x347b('0xd')]);router[_0x347b('0xe')]('/',auth[_0x347b('0x8')](),controller[_0x347b('0xf')]);router['put'](_0x347b('0xa'),auth[_0x347b('0x8')](),controller[_0x347b('0x10')]);router[_0x347b('0x11')](_0x347b('0xa'),auth[_0x347b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7b36=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','run','create','put','update','delete'];(function(_0x4340ed,_0x40b3c5){var _0x44c85e=function(_0x1060a7){while(--_0x1060a7){_0x4340ed['push'](_0x4340ed['shift']());}};_0x44c85e(++_0x40b3c5);}(_0x7b36,0x16b));var _0x67b3=function(_0x204af1,_0x22d9fc){_0x204af1=_0x204af1-0x0;var _0x201cb8=_0x7b36[_0x204af1];return _0x201cb8;};'use strict';var multer=require(_0x67b3('0x0'));var util=require(_0x67b3('0x1'));var path=require(_0x67b3('0x2'));var timeout=require(_0x67b3('0x3'));var express=require(_0x67b3('0x4'));var router=express[_0x67b3('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x67b3('0x6'));var controller=require('./schedule.controller');router[_0x67b3('0x7')]('/',auth[_0x67b3('0x8')](),controller[_0x67b3('0x9')]);router[_0x67b3('0x7')](_0x67b3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x67b3('0x7')](_0x67b3('0xb'),auth[_0x67b3('0x8')](),controller[_0x67b3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x67b3('0xd')]);router[_0x67b3('0xe')](_0x67b3('0xa'),auth[_0x67b3('0x8')](),controller[_0x67b3('0xf')]);router[_0x67b3('0x10')](_0x67b3('0xa'),auth[_0x67b3('0x8')](),controller[_0x67b3('0x11')]);module[_0x67b3('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 30264cd..48935e6 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 _0xf6d3=['weeks','hours','minutes','days','ENUM','csv','xlsx','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','years','quarters','months'];(function(_0x14975a,_0x49b819){var _0x28262c=function(_0x4be424){while(--_0x4be424){_0x14975a['push'](_0x14975a['shift']());}};_0x28262c(++_0x49b819);}(_0xf6d3,0x174));var _0x3f6d=function(_0x2ccf2d,_0x476c5e){_0x2ccf2d=_0x2ccf2d-0x0;var _0x2713bd=_0xf6d3[_0x2ccf2d];return _0x2713bd;};'use strict';var Sequelize=require(_0x3f6d('0x0'));module[_0x3f6d('0x1')]={'name':{'type':Sequelize[_0x3f6d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3f6d('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3f6d('0x2')],'allowNull':![],'defaultValue':_0x3f6d('0x3')},'startAt':{'type':Sequelize[_0x3f6d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3f6d('0x5'),_0x3f6d('0x6'),_0x3f6d('0x7'),_0x3f6d('0x8'),'days',_0x3f6d('0x9'),_0x3f6d('0xa')),'allowNull':![],'defaultValue':_0x3f6d('0xb')},'output':{'type':Sequelize[_0x3f6d('0xc')](_0x3f6d('0xd'),'pdf',_0x3f6d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x3f6d('0xf'),_0x3f6d('0x10')),'allowNull':![],'defaultValue':_0x3f6d('0xf')},'sendMail':{'type':Sequelize[_0x3f6d('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3f6d('0x12')]},'bcc':{'type':Sequelize[_0x3f6d('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3f6d('0x11')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5ac7=['xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','years','quarters','weeks','days','minutes','ENUM','csv','pdf'];(function(_0x593a37,_0x20ac5b){var _0x4bde96=function(_0x236f2d){while(--_0x236f2d){_0x593a37['push'](_0x593a37['shift']());}};_0x4bde96(++_0x20ac5b);}(_0x5ac7,0x1c6));var _0x75ac=function(_0x3b02ef,_0x130431){_0x3b02ef=_0x3b02ef-0x0;var _0x5d0ff1=_0x5ac7[_0x3b02ef];return _0x5d0ff1;};'use strict';var Sequelize=require(_0x75ac('0x0'));module[_0x75ac('0x1')]={'name':{'type':Sequelize[_0x75ac('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x75ac('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x75ac('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x75ac('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x75ac('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x75ac('0x6'),_0x75ac('0x7'),'months',_0x75ac('0x8'),_0x75ac('0x9'),'hours',_0x75ac('0xa')),'allowNull':![],'defaultValue':_0x75ac('0x9')},'output':{'type':Sequelize[_0x75ac('0xb')](_0x75ac('0xc'),_0x75ac('0xd'),_0x75ac('0xe')),'allowNull':![],'defaultValue':_0x75ac('0xc')},'type':{'type':Sequelize[_0x75ac('0xb')](_0x75ac('0xf'),_0x75ac('0x10')),'allowNull':![],'defaultValue':_0x75ac('0xf')},'sendMail':{'type':Sequelize[_0x75ac('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x75ac('0x2')]},'cc':{'type':Sequelize[_0x75ac('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x75ac('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 3a16ea9..f0cda35 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 _0x85db=['save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','send','Schedule','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','field','filter','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x85db,0x1bb));var _0xb85d=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x85db[_0x479160];return _0x47ac6d;};'use strict';var pdf=require(_0xb85d('0x0'));var emlformat=require(_0xb85d('0x1'));var rimraf=require(_0xb85d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb85d('0x3'));var moment=require(_0xb85d('0x4'));var BPromise=require(_0xb85d('0x5'));var Mustache=require(_0xb85d('0x6'));var util=require(_0xb85d('0x7'));var path=require(_0xb85d('0x8'));var sox=require('sox');var csv=require(_0xb85d('0x9'));var ejs=require(_0xb85d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb85d('0xb'));var crypto=require(_0xb85d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb85d('0xd'));var Redis=require(_0xb85d('0xe'));var authService=require(_0xb85d('0xf'));var qs=require(_0xb85d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb85d('0x11'))(_0xb85d('0x12'));var utils=require(_0xb85d('0x13'));var config=require(_0xb85d('0x14'));var db=require(_0xb85d('0x15'))['db'];function respondWithStatusCode(_0x2253e8,_0x5b0c42){_0x5b0c42=_0x5b0c42||0xcc;return function(_0xa9e559){if(_0xa9e559){return _0x2253e8[_0xb85d('0x16')](_0x5b0c42);}return _0x2253e8['status'](_0x5b0c42)['end']();};}function respondWithResult(_0x30cf43,_0x5eb3d3){_0x5eb3d3=_0x5eb3d3||0xc8;return function(_0x474e3e){if(_0x474e3e){return _0x30cf43[_0xb85d('0x17')](_0x5eb3d3)[_0xb85d('0x18')](_0x474e3e);}};}function respondWithFilteredResult(_0x330d51,_0x1c5cca){return function(_0x5a1ae1){if(_0x5a1ae1){var _0x27957d=_0x5a1ae1[_0xb85d('0x19')],_0x363a36=_0x1c5cca[_0xb85d('0x1a')],_0xf9982d=_0x1c5cca['offset']+_0x1c5cca[_0xb85d('0x1b')],_0xc9da06;if(_0xf9982d>=_0x27957d){_0xf9982d=_0x27957d;_0xc9da06=0xc8;}else{_0xc9da06=0xce;}_0x330d51[_0xb85d('0x17')](_0xc9da06);return _0x330d51['set'](_0xb85d('0x1c'),_0x363a36+'-'+_0xf9982d+'/'+_0x27957d)[_0xb85d('0x18')](_0x5a1ae1);}return null;};}function patchUpdates(_0x27e182){return function(_0x2e7fb6){try{jsonpatch[_0xb85d('0x1d')](_0x2e7fb6,_0x27e182,!![]);}catch(_0x5648cf){return BPromise[_0xb85d('0x1e')](_0x5648cf);}return _0x2e7fb6[_0xb85d('0x1f')]();};}function saveUpdates(_0xebdff3,_0x113754){return function(_0x232bb1){if(_0x232bb1){return _0x232bb1[_0xb85d('0x20')](_0xebdff3)[_0xb85d('0x21')](function(_0x2bccaa){return _0x2bccaa;});}return null;};}function removeEntity(_0x58fa64,_0x43294e){return function(_0x34714e){if(_0x34714e){return _0x34714e[_0xb85d('0x22')]()[_0xb85d('0x21')](function(){var _0xc5fcca=_0x34714e[_0xb85d('0x23')]({'plain':!![]});var _0x11c1f7=_0xb85d('0x24');return db[_0xb85d('0x25')][_0xb85d('0x22')]({'where':{'type':_0x11c1f7,'resourceId':_0xc5fcca['id']}})[_0xb85d('0x21')](function(){return _0x34714e;});})[_0xb85d('0x21')](function(){_0x58fa64[_0xb85d('0x17')](0xcc)[_0xb85d('0x26')]();});}};}function handleEntityNotFound(_0x2a67e0,_0x97726e){return function(_0x4e8c33){if(!_0x4e8c33){_0x2a67e0[_0xb85d('0x16')](0x194);}return _0x4e8c33;};}function handleError(_0x10a457,_0x21abb4){_0x21abb4=_0x21abb4||0x1f4;return function(_0xedfb8d){logger[_0xb85d('0x27')](_0xedfb8d[_0xb85d('0x28')]);if(_0xedfb8d[_0xb85d('0x29')]){delete _0xedfb8d[_0xb85d('0x29')];}_0x10a457['status'](_0x21abb4)[_0xb85d('0x2a')](_0xedfb8d);};}exports['index']=function(_0x5410af,_0x362cc9){var _0x32c5e6={},_0x16232e={},_0xbfa41f={'count':0x0,'rows':[]};var _0xca0c58=db[_0xb85d('0x2b')][_0xb85d('0x2c')];_0x16232e[_0xb85d('0x2d')]=_[_0xb85d('0x2e')](_0xca0c58);_0x16232e[_0xb85d('0x2f')]=_[_0xb85d('0x2e')](_0x5410af['query']);_0x16232e['filters']=_[_0xb85d('0x30')](_0x16232e['model'],_0x16232e[_0xb85d('0x2f')]);_0x32c5e6[_0xb85d('0x31')]=_['intersection'](_0x16232e['model'],qs[_0xb85d('0x32')](_0x5410af[_0xb85d('0x2f')][_0xb85d('0x32')]));_0x32c5e6['attributes']=_0x32c5e6[_0xb85d('0x31')][_0xb85d('0x33')]?_0x32c5e6[_0xb85d('0x31')]:_0x16232e[_0xb85d('0x2d')];if(!_0x5410af[_0xb85d('0x2f')][_0xb85d('0x34')](_0xb85d('0x35'))){_0x32c5e6[_0xb85d('0x1b')]=qs[_0xb85d('0x1b')](_0x5410af[_0xb85d('0x2f')][_0xb85d('0x1b')]);_0x32c5e6[_0xb85d('0x1a')]=qs[_0xb85d('0x1a')](_0x5410af[_0xb85d('0x2f')][_0xb85d('0x1a')]);}_0x32c5e6['order']=qs[_0xb85d('0x36')](_0x5410af[_0xb85d('0x2f')][_0xb85d('0x36')]);_0x32c5e6[_0xb85d('0x37')]=qs[_0xb85d('0x38')](_[_0xb85d('0x39')](_0x5410af[_0xb85d('0x2f')],_0x16232e[_0xb85d('0x38')]));if(_0x5410af[_0xb85d('0x2f')]['filter']){_0x32c5e6[_0xb85d('0x37')]=_[_0xb85d('0x3a')](_0x32c5e6[_0xb85d('0x37')],{'$or':_[_0xb85d('0x3b')](_0xca0c58,function(_0x4cafad){if(_0x4cafad['type']['key']!=='VIRTUAL'){var _0x2e91d4={};_0x2e91d4[_0x4cafad[_0xb85d('0x3c')]]={'$like':'%'+_0x5410af['query'][_0xb85d('0x3d')]+'%'};return _0x2e91d4;}})});}_0x32c5e6=_[_0xb85d('0x3a')]({},_0x32c5e6,_0x5410af['options']);var _0x297b48={'where':_0x32c5e6['where']};return db[_0xb85d('0x2b')][_0xb85d('0x19')](_0x297b48)[_0xb85d('0x21')](function(_0x2bc691){_0xbfa41f[_0xb85d('0x19')]=_0x2bc691;if(_0x5410af[_0xb85d('0x2f')][_0xb85d('0x3e')]){_0x32c5e6[_0xb85d('0x3f')]=[{'all':!![]}];}return db[_0xb85d('0x2b')][_0xb85d('0x40')](_0x32c5e6);})['then'](function(_0x33c661){_0xbfa41f[_0xb85d('0x41')]=_0x33c661;return _0xbfa41f;})[_0xb85d('0x21')](respondWithFilteredResult(_0x362cc9,_0x32c5e6))[_0xb85d('0x42')](handleError(_0x362cc9,null));};exports[_0xb85d('0x43')]=function(_0x4f86bc,_0x5f323f){var _0x1d7391={'raw':![],'where':{'id':_0x4f86bc[_0xb85d('0x44')]['id']}},_0xd513e3={};_0xd513e3['model']=_[_0xb85d('0x2e')](db[_0xb85d('0x2b')][_0xb85d('0x2c')]);_0xd513e3[_0xb85d('0x2f')]=_[_0xb85d('0x2e')](_0x4f86bc[_0xb85d('0x2f')]);_0xd513e3[_0xb85d('0x38')]=_[_0xb85d('0x30')](_0xd513e3[_0xb85d('0x2d')],_0xd513e3[_0xb85d('0x2f')]);_0x1d7391['attributes']=_[_0xb85d('0x30')](_0xd513e3['model'],qs[_0xb85d('0x32')](_0x4f86bc[_0xb85d('0x2f')][_0xb85d('0x32')]));_0x1d7391['attributes']=_0x1d7391[_0xb85d('0x31')][_0xb85d('0x33')]?_0x1d7391[_0xb85d('0x31')]:_0xd513e3[_0xb85d('0x2d')];if(_0x4f86bc[_0xb85d('0x2f')][_0xb85d('0x3e')]){_0x1d7391['include']=[{'all':!![]}];}_0x1d7391=_[_0xb85d('0x3a')]({},_0x1d7391,_0x4f86bc[_0xb85d('0x45')]);return db['Schedule'][_0xb85d('0x46')](_0x1d7391)[_0xb85d('0x21')](handleEntityNotFound(_0x5f323f,null))['then'](respondWithResult(_0x5f323f,null))[_0xb85d('0x42')](handleError(_0x5f323f,null));};exports['create']=function(_0x1a4eac,_0x4a2ff2){return db['Schedule']['create'](_0x1a4eac[_0xb85d('0x47')],{})[_0xb85d('0x21')](function(_0x15dcab){var _0x4ee2bc=_0x1a4eac[_0xb85d('0x48')][_0xb85d('0x23')]({'plain':!![]});if(!_0x4ee2bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ee2bc['role']==='user'){var _0x3cbe77=_0x15dcab[_0xb85d('0x23')]({'plain':!![]});var _0x1d023b=_0xb85d('0x24');return db[_0xb85d('0x49')][_0xb85d('0x46')]({'where':{'name':_0x1d023b,'userProfileId':_0x4ee2bc[_0xb85d('0x4a')]},'raw':!![]})[_0xb85d('0x21')](function(_0x569873){if(_0x569873&&_0x569873['autoAssociation']===0x0){return db['UserProfileResource'][_0xb85d('0x4b')]({'name':_0x3cbe77['name'],'resourceId':_0x3cbe77['id'],'type':_0x569873[_0xb85d('0x29')],'sectionId':_0x569873['id']},{})[_0xb85d('0x21')](function(){return _0x15dcab;});}else{return _0x15dcab;}})[_0xb85d('0x42')](function(_0x4d8e8c){logger[_0xb85d('0x27')](_0xb85d('0x4c'),_0x4d8e8c);throw _0x4d8e8c;});}return _0x15dcab;})[_0xb85d('0x21')](respondWithResult(_0x4a2ff2,0xc9))['catch'](handleError(_0x4a2ff2,null));};exports[_0xb85d('0x20')]=function(_0xaef2d1,_0x47f288){if(_0xaef2d1[_0xb85d('0x47')]['id']){delete _0xaef2d1[_0xb85d('0x47')]['id'];}return db['Schedule'][_0xb85d('0x46')]({'where':{'id':_0xaef2d1['params']['id']}})[_0xb85d('0x21')](handleEntityNotFound(_0x47f288,null))[_0xb85d('0x21')](saveUpdates(_0xaef2d1['body'],null))[_0xb85d('0x21')](respondWithResult(_0x47f288,null))[_0xb85d('0x42')](handleError(_0x47f288,null));};exports[_0xb85d('0x22')]=function(_0x16390b,_0x314d8a){return db['Schedule'][_0xb85d('0x46')]({'where':{'id':_0x16390b[_0xb85d('0x44')]['id']}})[_0xb85d('0x21')](handleEntityNotFound(_0x314d8a,null))[_0xb85d('0x21')](removeEntity(_0x314d8a,null))[_0xb85d('0x42')](handleError(_0x314d8a,null));};exports[_0xb85d('0x4d')]=function(_0x3b9847,_0x447933,_0x3f7142){var _0x248e19=require(_0xb85d('0x4e'));return db[_0xb85d('0x2b')]['find']({'where':{'id':_0x3b9847[_0xb85d('0x44')]['id']},'raw':!![]})[_0xb85d('0x21')](handleEntityNotFound(_0x447933,null))[_0xb85d('0x21')](function(){_0x248e19['run'](_0x3b9847['params']['id']);})[_0xb85d('0x21')](respondWithStatusCode(_0x447933,null))[_0xb85d('0x42')](handleError(_0x447933,null));}; \ No newline at end of file +var _0xf342=['send','index','Schedule','rawAttributes','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','stack','name'];(function(_0x41207a,_0x36dcfe){var _0x536f2a=function(_0x3bcfbd){while(--_0x3bcfbd){_0x41207a['push'](_0x41207a['shift']());}};_0x536f2a(++_0x36dcfe);}(_0xf342,0x1d6));var _0x2f34=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf342[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x2f34('0x0'));var emlformat=require(_0x2f34('0x1'));var rimraf=require(_0x2f34('0x2'));var zipdir=require(_0x2f34('0x3'));var jsonpatch=require(_0x2f34('0x4'));var rp=require(_0x2f34('0x5'));var moment=require(_0x2f34('0x6'));var BPromise=require(_0x2f34('0x7'));var Mustache=require(_0x2f34('0x8'));var util=require(_0x2f34('0x9'));var path=require(_0x2f34('0xa'));var sox=require(_0x2f34('0xb'));var csv=require(_0x2f34('0xc'));var ejs=require(_0x2f34('0xd'));var fs=require('fs');var _=require(_0x2f34('0xe'));var squel=require(_0x2f34('0xf'));var crypto=require(_0x2f34('0x10'));var jsforce=require(_0x2f34('0x11'));var deskjs=require(_0x2f34('0x12'));var toCsv=require(_0x2f34('0xc'));var querystring=require(_0x2f34('0x13'));var Papa=require(_0x2f34('0x14'));var Redis=require('ioredis');var authService=require(_0x2f34('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2f34('0x16'));var logger=require(_0x2f34('0x17'))(_0x2f34('0x18'));var utils=require(_0x2f34('0x19'));var config=require(_0x2f34('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22ed15,_0x403e2f){_0x403e2f=_0x403e2f||0xcc;return function(_0x48a804){if(_0x48a804){return _0x22ed15[_0x2f34('0x1b')](_0x403e2f);}return _0x22ed15['status'](_0x403e2f)[_0x2f34('0x1c')]();};}function respondWithResult(_0x2adf27,_0x45de87){_0x45de87=_0x45de87||0xc8;return function(_0x23462d){if(_0x23462d){return _0x2adf27[_0x2f34('0x1d')](_0x45de87)[_0x2f34('0x1e')](_0x23462d);}};}function respondWithFilteredResult(_0x48ef42,_0x2e53a2){return function(_0x5de74c){if(_0x5de74c){var _0x14b139=_0x5de74c[_0x2f34('0x1f')],_0x3999fe=_0x2e53a2[_0x2f34('0x20')],_0x4fb5a3=_0x2e53a2[_0x2f34('0x20')]+_0x2e53a2[_0x2f34('0x21')],_0x1c46b0;if(_0x4fb5a3>=_0x14b139){_0x4fb5a3=_0x14b139;_0x1c46b0=0xc8;}else{_0x1c46b0=0xce;}_0x48ef42['status'](_0x1c46b0);return _0x48ef42[_0x2f34('0x22')](_0x2f34('0x23'),_0x3999fe+'-'+_0x4fb5a3+'/'+_0x14b139)[_0x2f34('0x1e')](_0x5de74c);}return null;};}function patchUpdates(_0x4dda64){return function(_0x39e55d){try{jsonpatch[_0x2f34('0x24')](_0x39e55d,_0x4dda64,!![]);}catch(_0x59dc2d){return BPromise[_0x2f34('0x25')](_0x59dc2d);}return _0x39e55d['save']();};}function saveUpdates(_0x350b94,_0x28600a){return function(_0x3ddd67){if(_0x3ddd67){return _0x3ddd67[_0x2f34('0x26')](_0x350b94)[_0x2f34('0x27')](function(_0x1e617c){return _0x1e617c;});}return null;};}function removeEntity(_0x5a020f,_0x2446f9){return function(_0x2374d0){if(_0x2374d0){return _0x2374d0[_0x2f34('0x28')]()[_0x2f34('0x27')](function(){var _0x2c72ae=_0x2374d0[_0x2f34('0x29')]({'plain':!![]});var _0x2c9150=_0x2f34('0x2a');return db[_0x2f34('0x2b')][_0x2f34('0x28')]({'where':{'type':_0x2c9150,'resourceId':_0x2c72ae['id']}})[_0x2f34('0x27')](function(){return _0x2374d0;});})[_0x2f34('0x27')](function(){_0x5a020f['status'](0xcc)[_0x2f34('0x1c')]();});}};}function handleEntityNotFound(_0x2fdb3e,_0x506a4c){return function(_0x1036b4){if(!_0x1036b4){_0x2fdb3e['sendStatus'](0x194);}return _0x1036b4;};}function handleError(_0x2b2213,_0x2cd65a){_0x2cd65a=_0x2cd65a||0x1f4;return function(_0x47b84e){logger['error'](_0x47b84e[_0x2f34('0x2c')]);if(_0x47b84e[_0x2f34('0x2d')]){delete _0x47b84e[_0x2f34('0x2d')];}_0x2b2213[_0x2f34('0x1d')](_0x2cd65a)[_0x2f34('0x2e')](_0x47b84e);};}exports[_0x2f34('0x2f')]=function(_0x1bccf3,_0x1291f2){var _0x42e164={},_0x155242={},_0x583e04={'count':0x0,'rows':[]};var _0x20b746=db[_0x2f34('0x30')][_0x2f34('0x31')];_0x155242['model']=_[_0x2f34('0x32')](_0x20b746);_0x155242[_0x2f34('0x33')]=_[_0x2f34('0x32')](_0x1bccf3['query']);_0x155242[_0x2f34('0x34')]=_['intersection'](_0x155242[_0x2f34('0x35')],_0x155242[_0x2f34('0x33')]);_0x42e164[_0x2f34('0x36')]=_[_0x2f34('0x37')](_0x155242[_0x2f34('0x35')],qs[_0x2f34('0x38')](_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x38')]));_0x42e164['attributes']=_0x42e164[_0x2f34('0x36')]['length']?_0x42e164[_0x2f34('0x36')]:_0x155242['model'];if(!_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x39')]('nolimit')){_0x42e164[_0x2f34('0x21')]=qs['limit'](_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x21')]);_0x42e164[_0x2f34('0x20')]=qs['offset'](_0x1bccf3[_0x2f34('0x33')]['offset']);}_0x42e164[_0x2f34('0x3a')]=qs['sort'](_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x3b')]);_0x42e164[_0x2f34('0x3c')]=qs['filters'](_['pick'](_0x1bccf3['query'],_0x155242[_0x2f34('0x34')]));if(_0x1bccf3['query'][_0x2f34('0x3d')]){_0x42e164[_0x2f34('0x3c')]=_['merge'](_0x42e164[_0x2f34('0x3c')],{'$or':_[_0x2f34('0x3e')](_0x20b746,function(_0x55c2de){if(_0x55c2de[_0x2f34('0x3f')][_0x2f34('0x40')]!==_0x2f34('0x41')){var _0x52385a={};_0x52385a[_0x55c2de[_0x2f34('0x42')]]={'$like':'%'+_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x3d')]+'%'};return _0x52385a;}})});}_0x42e164=_[_0x2f34('0x43')]({},_0x42e164,_0x1bccf3[_0x2f34('0x44')]);var _0x5e28ef={'where':_0x42e164[_0x2f34('0x3c')]};return db[_0x2f34('0x30')]['count'](_0x5e28ef)[_0x2f34('0x27')](function(_0x5c7cb5){_0x583e04[_0x2f34('0x1f')]=_0x5c7cb5;if(_0x1bccf3[_0x2f34('0x33')][_0x2f34('0x45')]){_0x42e164[_0x2f34('0x46')]=[{'all':!![]}];}return db[_0x2f34('0x30')][_0x2f34('0x47')](_0x42e164);})[_0x2f34('0x27')](function(_0x90d2ea){_0x583e04[_0x2f34('0x48')]=_0x90d2ea;return _0x583e04;})[_0x2f34('0x27')](respondWithFilteredResult(_0x1291f2,_0x42e164))[_0x2f34('0x49')](handleError(_0x1291f2,null));};exports['show']=function(_0x59034a,_0x258e34){var _0x473803={'raw':![],'where':{'id':_0x59034a[_0x2f34('0x4a')]['id']}},_0x447eaf={};_0x447eaf['model']=_[_0x2f34('0x32')](db[_0x2f34('0x30')][_0x2f34('0x31')]);_0x447eaf[_0x2f34('0x33')]=_[_0x2f34('0x32')](_0x59034a[_0x2f34('0x33')]);_0x447eaf['filters']=_['intersection'](_0x447eaf[_0x2f34('0x35')],_0x447eaf[_0x2f34('0x33')]);_0x473803[_0x2f34('0x36')]=_[_0x2f34('0x37')](_0x447eaf[_0x2f34('0x35')],qs[_0x2f34('0x38')](_0x59034a[_0x2f34('0x33')][_0x2f34('0x38')]));_0x473803[_0x2f34('0x36')]=_0x473803[_0x2f34('0x36')]['length']?_0x473803[_0x2f34('0x36')]:_0x447eaf['model'];if(_0x59034a['query']['includeAll']){_0x473803['include']=[{'all':!![]}];}_0x473803=_[_0x2f34('0x43')]({},_0x473803,_0x59034a[_0x2f34('0x44')]);return db[_0x2f34('0x30')][_0x2f34('0x4b')](_0x473803)[_0x2f34('0x27')](handleEntityNotFound(_0x258e34,null))['then'](respondWithResult(_0x258e34,null))['catch'](handleError(_0x258e34,null));};exports['create']=function(_0x1dfbfa,_0x67de3b){return db[_0x2f34('0x30')]['create'](_0x1dfbfa[_0x2f34('0x4c')],{})['then'](function(_0x156dc4){var _0xcb52e7=_0x1dfbfa[_0x2f34('0x4d')][_0x2f34('0x29')]({'plain':!![]});if(!_0xcb52e7)throw new Error(_0x2f34('0x4e'));if(_0xcb52e7[_0x2f34('0x4f')]==='user'){var _0x3213e5=_0x156dc4[_0x2f34('0x29')]({'plain':!![]});var _0xe744b3=_0x2f34('0x2a');return db[_0x2f34('0x50')][_0x2f34('0x4b')]({'where':{'name':_0xe744b3,'userProfileId':_0xcb52e7['userProfileId']},'raw':!![]})['then'](function(_0x41fcd1){if(_0x41fcd1&&_0x41fcd1['autoAssociation']===0x0){return db[_0x2f34('0x2b')][_0x2f34('0x51')]({'name':_0x3213e5['name'],'resourceId':_0x3213e5['id'],'type':_0x41fcd1[_0x2f34('0x2d')],'sectionId':_0x41fcd1['id']},{})[_0x2f34('0x27')](function(){return _0x156dc4;});}else{return _0x156dc4;}})[_0x2f34('0x49')](function(_0x2a2a91){logger[_0x2f34('0x52')](_0x2f34('0x53'),_0x2a2a91);throw _0x2a2a91;});}return _0x156dc4;})[_0x2f34('0x27')](respondWithResult(_0x67de3b,0xc9))[_0x2f34('0x49')](handleError(_0x67de3b,null));};exports[_0x2f34('0x26')]=function(_0x513309,_0x582542){if(_0x513309['body']['id']){delete _0x513309[_0x2f34('0x4c')]['id'];}return db[_0x2f34('0x30')][_0x2f34('0x4b')]({'where':{'id':_0x513309[_0x2f34('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582542,null))['then'](saveUpdates(_0x513309['body'],null))['then'](respondWithResult(_0x582542,null))[_0x2f34('0x49')](handleError(_0x582542,null));};exports[_0x2f34('0x28')]=function(_0x3ec88e,_0x2b2683){return db['Schedule'][_0x2f34('0x4b')]({'where':{'id':_0x3ec88e[_0x2f34('0x4a')]['id']}})[_0x2f34('0x27')](handleEntityNotFound(_0x2b2683,null))['then'](removeEntity(_0x2b2683,null))[_0x2f34('0x49')](handleError(_0x2b2683,null));};exports[_0x2f34('0x54')]=function(_0x2e156b,_0x23d5a3,_0x33d413){var _0x2e6476=require(_0x2f34('0x55'));return db[_0x2f34('0x30')][_0x2f34('0x4b')]({'where':{'id':_0x2e156b[_0x2f34('0x4a')]['id']},'raw':!![]})[_0x2f34('0x27')](handleEntityNotFound(_0x23d5a3,null))[_0x2f34('0x27')](function(){_0x2e6476[_0x2f34('0x54')](_0x2e156b['params']['id']);})[_0x2f34('0x27')](respondWithStatusCode(_0x23d5a3,null))[_0x2f34('0x49')](handleError(_0x23d5a3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1ef314e..6c1be58 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 _0x5f05=['../../config/environment','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x503c6c,_0x12a36e){var _0x5bc5cd=function(_0x190730){while(--_0x190730){_0x503c6c['push'](_0x503c6c['shift']());}};_0x5bc5cd(++_0x12a36e);}(_0x5f05,0x75));var _0x55f0=function(_0x1244ad,_0xbf3cbd){_0x1244ad=_0x1244ad-0x0;var _0x287b83=_0x5f05[_0x1244ad];return _0x287b83;};'use strict';var _=require(_0x55f0('0x0'));var util=require(_0x55f0('0x1'));var logger=require(_0x55f0('0x2'))(_0x55f0('0x3'));var moment=require(_0x55f0('0x4'));var BPromise=require(_0x55f0('0x5'));var rp=require(_0x55f0('0x6'));var fs=require('fs');var path=require(_0x55f0('0x7'));var rimraf=require(_0x55f0('0x8'));var config=require(_0x55f0('0x9'));var attributes=require('./schedule.attributes');module[_0x55f0('0xa')]=function(_0x45254e,_0x299623){return _0x45254e[_0x55f0('0xb')](_0x55f0('0xc'),attributes,{'tableName':_0x55f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d17=['Schedule','lodash','request-promise','path','rimraf','./schedule.attributes','exports'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x6d17,0xc5));var _0x76d1=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x6d17[_0x5e6bec];return _0x5dc5cf;};'use strict';var _=require(_0x76d1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x76d1('0x1'));var fs=require('fs');var path=require(_0x76d1('0x2'));var rimraf=require(_0x76d1('0x3'));var config=require('../../config/environment');var attributes=require(_0x76d1('0x4'));module[_0x76d1('0x5')]=function(_0xc2162a,_0x42672d){return _0xc2162a['define'](_0x76d1('0x6'),attributes,{'tableName':'tools_schedules','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 a22fd92..24204e5 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 _0xe603=['../../config/environment','client','http','request','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a9d66,_0x2a4e27){var _0x3302e6=function(_0x3ba04d){while(--_0x3ba04d){_0x4a9d66['push'](_0x4a9d66['shift']());}};_0x3302e6(++_0x2a4e27);}(_0xe603,0xfe));var _0x3e60=function(_0x6a63c3,_0x1dbd96){_0x6a63c3=_0x6a63c3-0x0;var _0x43b920=_0xe603[_0x6a63c3];return _0x43b920;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3e60('0x0'));var BPromise=require(_0x3e60('0x1'));var rs=require(_0x3e60('0x2'));var fs=require('fs');var Redis=require(_0x3e60('0x3'));var db=require(_0x3e60('0x4'))['db'];var utils=require(_0x3e60('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e60('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3e60('0x7')][_0x3e60('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x580834,_0x32d148,_0x56b15c){return new BPromise(function(_0x4b97e6,_0x56948f){return client[_0x3e60('0x9')](_0x580834,_0x56b15c)['then'](function(_0x2aafb1){logger[_0x3e60('0xa')]('Schedule,\x20%s,\x20%s',_0x32d148,_0x3e60('0xb'));logger[_0x3e60('0xc')](_0x3e60('0xd'),_0x32d148,_0x3e60('0xb'),JSON['stringify'](_0x2aafb1));if(_0x2aafb1[_0x3e60('0xe')]){if(_0x2aafb1[_0x3e60('0xe')][_0x3e60('0xf')]===0x1f4){logger[_0x3e60('0xe')](_0x3e60('0x10'),_0x32d148,_0x2aafb1[_0x3e60('0xe')][_0x3e60('0x11')]);return _0x56948f(_0x2aafb1[_0x3e60('0xe')][_0x3e60('0x11')]);}logger[_0x3e60('0xe')](_0x3e60('0x10'),_0x32d148,_0x2aafb1[_0x3e60('0xe')][_0x3e60('0x11')]);return _0x4b97e6(_0x2aafb1['error'][_0x3e60('0x11')]);}else{logger[_0x3e60('0xa')](_0x3e60('0x10'),_0x32d148,_0x3e60('0xb'));_0x4b97e6(_0x2aafb1[_0x3e60('0x12')][_0x3e60('0x11')]);}})[_0x3e60('0x13')](function(_0x2c0aeb){logger[_0x3e60('0xe')](_0x3e60('0x10'),_0x32d148,_0x2c0aeb);_0x56948f(_0x2c0aeb);});});} \ No newline at end of file +var _0x4e41=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x4e41,0xf9));var _0x14e4=function(_0x4c6824,_0xc1c6dd){_0x4c6824=_0x4c6824-0x0;var _0x48b434=_0x4e41[_0x4c6824];return _0x48b434;};'use strict';var _=require('lodash');var util=require(_0x14e4('0x0'));var moment=require(_0x14e4('0x1'));var BPromise=require(_0x14e4('0x2'));var rs=require(_0x14e4('0x3'));var fs=require('fs');var Redis=require(_0x14e4('0x4'));var db=require(_0x14e4('0x5'))['db'];var utils=require(_0x14e4('0x6'));var logger=require(_0x14e4('0x7'))('rpc');var config=require(_0x14e4('0x8'));var jayson=require(_0x14e4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2096f4,_0x2e3dee,_0x177a82){return new BPromise(function(_0x14a5f1,_0x46a9b3){return client[_0x14e4('0xa')](_0x2096f4,_0x177a82)[_0x14e4('0xb')](function(_0x3752b1){logger[_0x14e4('0xc')](_0x14e4('0xd'),_0x2e3dee,_0x14e4('0xe'));logger['debug'](_0x14e4('0xf'),_0x2e3dee,_0x14e4('0xe'),JSON[_0x14e4('0x10')](_0x3752b1));if(_0x3752b1[_0x14e4('0x11')]){if(_0x3752b1[_0x14e4('0x11')][_0x14e4('0x12')]===0x1f4){logger[_0x14e4('0x11')](_0x14e4('0xd'),_0x2e3dee,_0x3752b1[_0x14e4('0x11')]['message']);return _0x46a9b3(_0x3752b1['error'][_0x14e4('0x13')]);}logger[_0x14e4('0x11')](_0x14e4('0xd'),_0x2e3dee,_0x3752b1['error'][_0x14e4('0x13')]);return _0x14a5f1(_0x3752b1[_0x14e4('0x11')][_0x14e4('0x13')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x2e3dee,_0x14e4('0xe'));_0x14a5f1(_0x3752b1[_0x14e4('0x14')][_0x14e4('0x13')]);}})[_0x14e4('0x15')](function(_0xf53da9){logger[_0x14e4('0x11')]('Schedule,\x20%s,\x20%s',_0x2e3dee,_0xf53da9);_0x46a9b3(_0xf53da9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 625a74d..76e2792 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 _0xc2b8=['describe','show','/:id/download','download','post','create','put','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe'];(function(_0x4e3a8e,_0xcc3981){var _0x35986e=function(_0x31c3da){while(--_0x31c3da){_0x4e3a8e['push'](_0x4e3a8e['shift']());}};_0x35986e(++_0xcc3981);}(_0xc2b8,0x1ab));var _0x8c2b=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0xc2b8[_0x2c753c];return _0x23ba20;};'use strict';var multer=require(_0x8c2b('0x0'));var util=require('util');var path=require(_0x8c2b('0x1'));var timeout=require(_0x8c2b('0x2'));var express=require(_0x8c2b('0x3'));var router=express[_0x8c2b('0x4')]();var auth=require(_0x8c2b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x8c2b('0x6')]('/',auth[_0x8c2b('0x7')](),controller[_0x8c2b('0x8')]);router['get'](_0x8c2b('0x9'),auth[_0x8c2b('0x7')](),controller[_0x8c2b('0xa')]);router['get']('/:id',auth[_0x8c2b('0x7')](),controller[_0x8c2b('0xb')]);router[_0x8c2b('0x6')](_0x8c2b('0xc'),auth[_0x8c2b('0x7')](),controller[_0x8c2b('0xd')]);router[_0x8c2b('0xe')]('/',auth[_0x8c2b('0x7')](),controller[_0x8c2b('0xf')]);router[_0x8c2b('0x10')](_0x8c2b('0x11'),auth[_0x8c2b('0x7')](),controller['update']);router['delete'](_0x8c2b('0x11'),auth[_0x8c2b('0x7')](),controller['destroy']);module[_0x8c2b('0x12')]=router; \ No newline at end of file +var _0x1539=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','index','/describe','describe','/:id','isAuthenticated','download','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x37f5a1,_0x461925){var _0x3a97a5=function(_0x11f158){while(--_0x11f158){_0x37f5a1['push'](_0x37f5a1['shift']());}};_0x3a97a5(++_0x461925);}(_0x1539,0x139));var _0x9153=function(_0x54e8c0,_0x5a9170){_0x54e8c0=_0x54e8c0-0x0;var _0x3ce0b8=_0x1539[_0x54e8c0];return _0x3ce0b8;};'use strict';var multer=require('multer');var util=require(_0x9153('0x0'));var path=require(_0x9153('0x1'));var timeout=require(_0x9153('0x2'));var express=require('express');var router=express[_0x9153('0x3')]();var auth=require(_0x9153('0x4'));var interaction=require(_0x9153('0x5'));var config=require('../../config/environment');var controller=require(_0x9153('0x6'));router[_0x9153('0x7')]('/',auth['isAuthenticated'](),controller[_0x9153('0x8')]);router['get'](_0x9153('0x9'),auth['isAuthenticated'](),controller[_0x9153('0xa')]);router[_0x9153('0x7')](_0x9153('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9153('0x7')]('/:id/download',auth[_0x9153('0xc')](),controller[_0x9153('0xd')]);router[_0x9153('0xe')]('/',auth['isAuthenticated'](),controller[_0x9153('0xf')]);router[_0x9153('0x10')](_0x9153('0xb'),auth[_0x9153('0xc')](),controller[_0x9153('0x11')]);router[_0x9153('0x12')](_0x9153('0xb'),auth[_0x9153('0xc')](),controller[_0x9153('0x13')]);module[_0x9153('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 228293a..30800f2 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 _0xa2cf=['DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','moment','path','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','duration'];(function(_0xcdaedf,_0x3d7092){var _0x36e0fc=function(_0x4368f6){while(--_0x4368f6){_0xcdaedf['push'](_0xcdaedf['shift']());}};_0x36e0fc(++_0x3d7092);}(_0xa2cf,0xbb));var _0xfa2c=function(_0x39b072,_0x3184c8){_0x39b072=_0x39b072-0x0;var _0x24cdab=_0xa2cf[_0x39b072];return _0x24cdab;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfa2c('0x0'));var path=require(_0xfa2c('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfa2c('0x2')](_0xfa2c('0x3'))?path[_0xfa2c('0x4')](this[_0xfa2c('0x2')](_0xfa2c('0x3'))):undefined;}},'interactionid':{'type':Sequelize[_0xfa2c('0x5')]},'channel':{'type':Sequelize[_0xfa2c('0x5')]},'value':{'type':Sequelize[_0xfa2c('0x5')],'set':function(_0x24433f){var _0x195ea0=_0x24433f[_0xfa2c('0x6')](/\\/g,'/');this[_0xfa2c('0x7')](_0xfa2c('0x3'),_0x195ea0);}},'rating':{'type':Sequelize[_0xfa2c('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xfa2c('0x8')],'set':function(_0x4491db){this['setDataValue']('startedAt',moment()[_0xfa2c('0x9')](_0x4491db,'ms'));this['setDataValue']('closedAt',moment());this[_0xfa2c('0x7')](_0xfa2c('0xa'),_0x4491db);}},'startedAt':{'type':Sequelize[_0xfa2c('0xb')],'get':function(){return moment(this[_0xfa2c('0x2')](_0xfa2c('0xc')))[_0xfa2c('0xd')](_0xfa2c('0xe'))[_0xfa2c('0xf')]();}},'closedAt':{'type':Sequelize[_0xfa2c('0xb')],'get':function(){return moment(this['getDataValue'](_0xfa2c('0x10')))[_0xfa2c('0xd')](_0xfa2c('0xe'))[_0xfa2c('0xf')]();}},'createdAt':{'type':Sequelize[_0xfa2c('0xb')],'get':function(){return moment(this['getDataValue'](_0xfa2c('0x11')))[_0xfa2c('0xd')](_0xfa2c('0xe'))[_0xfa2c('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xfa2c('0x2')]('updatedAt'))[_0xfa2c('0xd')](_0xfa2c('0xe'))[_0xfa2c('0xf')]();}}}; \ No newline at end of file +var _0x6ca1=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','value','getDataValue','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ca1,0x150));var _0x16ca=function(_0x31d8d4,_0x4cadac){_0x31d8d4=_0x31d8d4-0x0;var _0x1f822e=_0x6ca1[_0x31d8d4];return _0x1f822e;};'use strict';var Sequelize=require(_0x16ca('0x0'));var moment=require(_0x16ca('0x1'));var path=require(_0x16ca('0x2'));var config=require(_0x16ca('0x3'));module[_0x16ca('0x4')]={'format':{'type':Sequelize[_0x16ca('0x5')],'get':function(){return this['getDataValue'](_0x16ca('0x6'))?path['extname'](this[_0x16ca('0x7')](_0x16ca('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x16ca('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x16ca('0x8')],'set':function(_0x28adaf){var _0x2772b5=_0x28adaf['replace'](/\\/g,'/');this[_0x16ca('0x9')](_0x16ca('0x6'),_0x2772b5);}},'rating':{'type':Sequelize[_0x16ca('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x3d602e){this[_0x16ca('0x9')](_0x16ca('0xb'),moment()[_0x16ca('0xc')](_0x3d602e,'ms'));this[_0x16ca('0x9')](_0x16ca('0xd'),moment());this[_0x16ca('0x9')](_0x16ca('0xe'),_0x3d602e);}},'startedAt':{'type':Sequelize[_0x16ca('0xf')],'get':function(){return moment(this['getDataValue'](_0x16ca('0xb')))[_0x16ca('0x10')](_0x16ca('0x11'))[_0x16ca('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x16ca('0x7')]('closedAt'))[_0x16ca('0x10')](_0x16ca('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x16ca('0xf')],'get':function(){return moment(this[_0x16ca('0x7')](_0x16ca('0x13')))[_0x16ca('0x10')](_0x16ca('0x11'))[_0x16ca('0x12')]();}},'updatedAt':{'type':Sequelize[_0x16ca('0xf')],'get':function(){return moment(this[_0x16ca('0x7')](_0x16ca('0x14')))[_0x16ca('0x10')](_0x16ca('0x11'))[_0x16ca('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 723a5a2..bb326f8 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 _0xfc03=['to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','set','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','model','keys','format','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','type','key','VIRTUAL','field','merge','options','findAll','rows','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','Not\x20found','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x34b464,_0x5b2b06){var _0x5a2bcb=function(_0x14479a){while(--_0x14479a){_0x34b464['push'](_0x34b464['shift']());}};_0x5a2bcb(++_0x5b2b06);}(_0xfc03,0x16f));var _0x3fc0=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xfc03[_0x486f4a];return _0x135d99;};'use strict';var pdf=require(_0x3fc0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3fc0('0x1'));var zipdir=require(_0x3fc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fc0('0x3'));var moment=require('moment');var BPromise=require(_0x3fc0('0x4'));var Mustache=require(_0x3fc0('0x5'));var util=require(_0x3fc0('0x6'));var path=require(_0x3fc0('0x7'));var sox=require(_0x3fc0('0x8'));var csv=require(_0x3fc0('0x9'));var ejs=require(_0x3fc0('0xa'));var fs=require('fs');var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x9'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var hardwareService=require(_0x3fc0('0x12'));var logger=require(_0x3fc0('0x13'))(_0x3fc0('0x14'));var utils=require('../../config/utils');var config=require(_0x3fc0('0x15'));var db=require(_0x3fc0('0x16'))['db'];function respondWithStatusCode(_0x1ecb57,_0x5e75e8){_0x5e75e8=_0x5e75e8||0xcc;return function(_0x1011b7){if(_0x1011b7){return _0x1ecb57['sendStatus'](_0x5e75e8);}return _0x1ecb57[_0x3fc0('0x17')](_0x5e75e8)[_0x3fc0('0x18')]();};}function respondWithResult(_0x5a006b,_0x3fe564){_0x3fe564=_0x3fe564||0xc8;return function(_0x422926){if(_0x422926){return _0x5a006b[_0x3fc0('0x17')](_0x3fe564)['json'](_0x422926);}};}function respondWithFilteredResult(_0x29ad7a,_0x3ac8c3){return function(_0x367ce1){if(_0x367ce1){var _0x27619a=_0x367ce1[_0x3fc0('0x19')],_0x562ecc=_0x3ac8c3['offset'],_0x277dbf=_0x3ac8c3[_0x3fc0('0x1a')]+_0x3ac8c3['limit'],_0x3d869e;if(_0x277dbf>=_0x27619a){_0x277dbf=_0x27619a;_0x3d869e=0xc8;}else{_0x3d869e=0xce;}_0x29ad7a[_0x3fc0('0x17')](_0x3d869e);return _0x29ad7a[_0x3fc0('0x1b')]('Content-Range',_0x562ecc+'-'+_0x277dbf+'/'+_0x27619a)[_0x3fc0('0x1c')](_0x367ce1);}return null;};}function patchUpdates(_0x33ffbc){return function(_0x1c33c8){try{jsonpatch[_0x3fc0('0x1d')](_0x1c33c8,_0x33ffbc,!![]);}catch(_0x1bd575){return BPromise[_0x3fc0('0x1e')](_0x1bd575);}return _0x1c33c8[_0x3fc0('0x1f')]();};}function saveUpdates(_0x2457f9,_0x458f88){return function(_0x5c859e){if(_0x5c859e){return _0x5c859e[_0x3fc0('0x20')](_0x2457f9)[_0x3fc0('0x21')](function(_0x34ffa7){return _0x34ffa7;});}return null;};}function removeEntity(_0x3d6c0a,_0x3a09cd){return function(_0x448293){if(_0x448293){return _0x448293['destroy']()[_0x3fc0('0x21')](function(){_0x3d6c0a[_0x3fc0('0x17')](0xcc)[_0x3fc0('0x18')]();});}};}function handleEntityNotFound(_0x28fc65,_0x46c213){return function(_0x303dd2){if(!_0x303dd2){_0x28fc65[_0x3fc0('0x22')](0x194);}return _0x303dd2;};}function handleError(_0x31743e,_0x3698ca){_0x3698ca=_0x3698ca||0x1f4;return function(_0x35a3e2){logger[_0x3fc0('0x23')](_0x35a3e2[_0x3fc0('0x24')]);if(_0x35a3e2[_0x3fc0('0x25')]){delete _0x35a3e2[_0x3fc0('0x25')];}_0x31743e[_0x3fc0('0x17')](_0x3698ca)[_0x3fc0('0x26')](_0x35a3e2);};}exports['index']=function(_0x365c8e,_0x1b539b){var _0x1d9932={},_0x35c34c={},_0x5a9179={'count':0x0,'rows':[]};var _0x134317=db[_0x3fc0('0x27')][_0x3fc0('0x28')];_0x35c34c[_0x3fc0('0x29')]=_['differenceBy'](_[_0x3fc0('0x2a')](_0x134317),[_0x3fc0('0x2b')]);_0x35c34c[_0x3fc0('0x2c')]=_[_0x3fc0('0x2a')](_0x365c8e[_0x3fc0('0x2c')]);_0x35c34c[_0x3fc0('0x2d')]=_['intersection'](_0x35c34c[_0x3fc0('0x29')],_0x35c34c[_0x3fc0('0x2c')]);_0x1d9932[_0x3fc0('0x2e')]=_[_0x3fc0('0x2f')](_0x35c34c[_0x3fc0('0x29')],qs[_0x3fc0('0x30')](_0x365c8e[_0x3fc0('0x2c')][_0x3fc0('0x30')]));_0x1d9932['attributes']=_0x1d9932['attributes'][_0x3fc0('0x31')]?_0x1d9932['attributes']:_0x35c34c[_0x3fc0('0x29')];if(!_0x365c8e[_0x3fc0('0x2c')][_0x3fc0('0x32')](_0x3fc0('0x33'))){_0x1d9932[_0x3fc0('0x34')]=qs['limit'](_0x365c8e['query'][_0x3fc0('0x34')]);_0x1d9932[_0x3fc0('0x1a')]=qs[_0x3fc0('0x1a')](_0x365c8e[_0x3fc0('0x2c')][_0x3fc0('0x1a')]);}_0x1d9932['order']=qs[_0x3fc0('0x35')](_0x365c8e[_0x3fc0('0x2c')][_0x3fc0('0x35')]);_0x1d9932['where']=qs[_0x3fc0('0x2d')](_[_0x3fc0('0x36')](_0x365c8e[_0x3fc0('0x2c')],_0x35c34c[_0x3fc0('0x2d')]));if(_0x365c8e['query'][_0x3fc0('0x37')]){_0x1d9932[_0x3fc0('0x38')]=_['merge'](_0x1d9932[_0x3fc0('0x38')],{'$or':_['map'](_0x134317,function(_0x3fb78e){if(_0x3fb78e[_0x3fc0('0x39')][_0x3fc0('0x3a')]!==_0x3fc0('0x3b')){var _0x302a02={};_0x302a02[_0x3fb78e[_0x3fc0('0x3c')]]={'$like':'%'+_0x365c8e[_0x3fc0('0x2c')][_0x3fc0('0x37')]+'%'};return _0x302a02;}})});}_0x1d9932=_[_0x3fc0('0x3d')]({},_0x1d9932,_0x365c8e[_0x3fc0('0x3e')]);var _0x41b4b3={'where':_0x1d9932['where']};return db[_0x3fc0('0x27')][_0x3fc0('0x19')](_0x41b4b3)[_0x3fc0('0x21')](function(_0x28b4d5){_0x5a9179[_0x3fc0('0x19')]=_0x28b4d5;if(_0x365c8e[_0x3fc0('0x2c')]['includeAll']){_0x1d9932['include']=[{'all':!![]}];}return db[_0x3fc0('0x27')][_0x3fc0('0x3f')](_0x1d9932);})[_0x3fc0('0x21')](function(_0x3e285f){_0x5a9179[_0x3fc0('0x40')]=_0x3e285f;return _0x5a9179;})['then'](respondWithFilteredResult(_0x1b539b,_0x1d9932))['catch'](handleError(_0x1b539b,null));};exports['show']=function(_0x1bc6ad,_0x39d65c){var _0x40ead6={'raw':![],'where':{'id':_0x1bc6ad['params']['id']}},_0x54a6d5={};_0x54a6d5[_0x3fc0('0x29')]=_[_0x3fc0('0x2a')](db[_0x3fc0('0x27')][_0x3fc0('0x28')]);_0x54a6d5['query']=_['keys'](_0x1bc6ad[_0x3fc0('0x2c')]);_0x54a6d5[_0x3fc0('0x2d')]=_['intersection'](_0x54a6d5[_0x3fc0('0x29')],_0x54a6d5['query']);_0x40ead6[_0x3fc0('0x2e')]=_[_0x3fc0('0x2f')](_0x54a6d5[_0x3fc0('0x29')],qs[_0x3fc0('0x30')](_0x1bc6ad[_0x3fc0('0x2c')][_0x3fc0('0x30')]));_0x40ead6[_0x3fc0('0x2e')]=_0x40ead6[_0x3fc0('0x2e')]['length']?_0x40ead6[_0x3fc0('0x2e')]:_0x54a6d5['model'];if(_0x1bc6ad[_0x3fc0('0x2c')][_0x3fc0('0x41')]){_0x40ead6[_0x3fc0('0x42')]=[{'all':!![]}];}_0x40ead6=_[_0x3fc0('0x3d')]({},_0x40ead6,_0x1bc6ad[_0x3fc0('0x3e')]);return db['ScreenRecording'][_0x3fc0('0x43')](_0x40ead6)[_0x3fc0('0x21')](handleEntityNotFound(_0x39d65c,null))[_0x3fc0('0x21')](respondWithResult(_0x39d65c,null))[_0x3fc0('0x44')](handleError(_0x39d65c,null));};exports['create']=function(_0x287e10,_0x5a1672){return db[_0x3fc0('0x27')][_0x3fc0('0x45')](_0x287e10[_0x3fc0('0x46')],{})[_0x3fc0('0x21')](respondWithResult(_0x5a1672,0xc9))[_0x3fc0('0x44')](handleError(_0x5a1672,null));};exports['update']=function(_0x4208e9,_0x398101){if(_0x4208e9[_0x3fc0('0x46')]['id']){delete _0x4208e9['body']['id'];}delete _0x4208e9[_0x3fc0('0x46')][_0x3fc0('0x47')];delete _0x4208e9['body'][_0x3fc0('0x48')];delete _0x4208e9[_0x3fc0('0x46')][_0x3fc0('0x49')];delete _0x4208e9['body']['value'];return db[_0x3fc0('0x27')][_0x3fc0('0x43')]({'where':{'id':_0x4208e9[_0x3fc0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x398101,null))[_0x3fc0('0x21')](saveUpdates(_0x4208e9['body'],null))[_0x3fc0('0x21')](respondWithResult(_0x398101,null))['catch'](handleError(_0x398101,null));};exports['destroy']=function(_0x5be8cc,_0x31c4bf){return db[_0x3fc0('0x27')][_0x3fc0('0x43')]({'where':{'id':_0x5be8cc[_0x3fc0('0x4a')]['id']}})[_0x3fc0('0x21')](handleEntityNotFound(_0x31c4bf,null))[_0x3fc0('0x21')](removeEntity(_0x31c4bf,null))['catch'](handleError(_0x31c4bf,null));};exports[_0x3fc0('0x4b')]=function(_0x35173b,_0x48ac26){return db['ScreenRecording'][_0x3fc0('0x4b')]()[_0x3fc0('0x21')](respondWithResult(_0x48ac26,null))[_0x3fc0('0x44')](handleError(_0x48ac26,null));};exports[_0x3fc0('0x4c')]=function(_0x21075d,_0x330b8f,_0x2270a3){var _0x2da185=require(_0x3fc0('0x4d'));var _0x1cc9f2=![];var _0x1c120c={};if(_0x21075d[_0x3fc0('0x2c')]['type']&&_0x21075d[_0x3fc0('0x2c')][_0x3fc0('0x39')]===_0x3fc0('0x4e')){_0x1c120c[_0x3fc0('0x4e')]=_0x21075d[_0x3fc0('0x4a')]['id'];}else{_0x1c120c['id']=_0x21075d['params']['id'];}return db[_0x3fc0('0x27')]['find']({'where':_0x1c120c,'attributes':['id',_0x3fc0('0x4f')],'raw':!![]})[_0x3fc0('0x21')](handleEntityNotFound(_0x330b8f,null))[_0x3fc0('0x21')](function(_0x10c05b){if(_0x10c05b){var _0x519973=path[_0x3fc0('0x50')](config[_0x3fc0('0x51')],_0x3fc0('0x52'),_0x10c05b[_0x3fc0('0x4f')]);var _0xe7f024=util[_0x3fc0('0x2b')]('%s.cypher',_0x519973);if(fs[_0x3fc0('0x53')](_0xe7f024)){_0x1cc9f2=!![];return _0x2da185[_0x3fc0('0x54')](_0xe7f024,_0x519973,config[_0x3fc0('0x55')][_0x3fc0('0x56')])[_0x3fc0('0x21')](function(){return _0x10c05b;});}return _0x10c05b;}})[_0x3fc0('0x21')](function(_0x5b9b40){if(_0x5b9b40){var _0x14240b=path[_0x3fc0('0x50')](config[_0x3fc0('0x51')],'server/files/screen_recordings',_0x5b9b40[_0x3fc0('0x4f')]);if(!fs[_0x3fc0('0x53')](_0x14240b)){throw new db[(_0x3fc0('0x57'))][(_0x3fc0('0x58'))](_0x3fc0('0x59'));}if(_0x5b9b40[_0x3fc0('0x5a')]){return _0x330b8f[_0x3fc0('0x4c')](_0x14240b,_0x5b9b40[_0x3fc0('0x5a')]+path[_0x3fc0('0x5b')](_0x14240b),function(){if(_0x1cc9f2){fs[_0x3fc0('0x5c')](_0x14240b);}});}else{return _0x330b8f[_0x3fc0('0x4c')](_0x14240b,function(_0x194a3b){if(_0x1cc9f2){fs[_0x3fc0('0x5c')](_0x14240b);}});}}})[_0x3fc0('0x44')](function(_0x359557){if(_0x359557['message']===_0x3fc0('0x59')){_0x330b8f[_0x3fc0('0x17')](0x194)[_0x3fc0('0x26')](_0x3fc0('0x5d'));}else{return handleError(_0x330b8f,null);}});}; \ No newline at end of file +var _0x8b29=['unlink','message','send','Not\x20found','html-pdf','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','Content-Range','apply','reject','save','destroy','then','end','stack','name','rawAttributes','model','differenceBy','keys','format','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','findAll','catch','show','params','include','ScreenRecording','find','create','update','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname'];(function(_0x4a213f,_0x1f36b0){var _0x4e73e7=function(_0x852cc4){while(--_0x852cc4){_0x4a213f['push'](_0x4a213f['shift']());}};_0x4e73e7(++_0x1f36b0);}(_0x8b29,0xbe));var _0x98b2=function(_0x19571f,_0x1d1b9e){_0x19571f=_0x19571f-0x0;var _0x1b46ea=_0x8b29[_0x19571f];return _0x1b46ea;};'use strict';var pdf=require(_0x98b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x98b2('0x1'));var zipdir=require(_0x98b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98b2('0x3'));var BPromise=require(_0x98b2('0x4'));var Mustache=require('mustache');var util=require(_0x98b2('0x5'));var path=require('path');var sox=require(_0x98b2('0x6'));var csv=require(_0x98b2('0x7'));var ejs=require(_0x98b2('0x8'));var fs=require('fs');var _=require(_0x98b2('0x9'));var squel=require(_0x98b2('0xa'));var crypto=require(_0x98b2('0xb'));var jsforce=require(_0x98b2('0xc'));var deskjs=require(_0x98b2('0xd'));var toCsv=require(_0x98b2('0x7'));var querystring=require(_0x98b2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98b2('0xf'));var qs=require(_0x98b2('0x10'));var hardwareService=require(_0x98b2('0x11'));var logger=require(_0x98b2('0x12'))(_0x98b2('0x13'));var utils=require(_0x98b2('0x14'));var config=require('../../config/environment');var db=require(_0x98b2('0x15'))['db'];function respondWithStatusCode(_0x42603e,_0x4e3679){_0x4e3679=_0x4e3679||0xcc;return function(_0x27865e){if(_0x27865e){return _0x42603e[_0x98b2('0x16')](_0x4e3679);}return _0x42603e[_0x98b2('0x17')](_0x4e3679)['end']();};}function respondWithResult(_0x525889,_0x2d19ee){_0x2d19ee=_0x2d19ee||0xc8;return function(_0x56bcbd){if(_0x56bcbd){return _0x525889[_0x98b2('0x17')](_0x2d19ee)['json'](_0x56bcbd);}};}function respondWithFilteredResult(_0x5098db,_0x544e3c){return function(_0x831ee8){if(_0x831ee8){var _0x413464=_0x831ee8['count'],_0xe49e9a=_0x544e3c[_0x98b2('0x18')],_0x5ecea1=_0x544e3c[_0x98b2('0x18')]+_0x544e3c[_0x98b2('0x19')],_0x5bb60d;if(_0x5ecea1>=_0x413464){_0x5ecea1=_0x413464;_0x5bb60d=0xc8;}else{_0x5bb60d=0xce;}_0x5098db[_0x98b2('0x17')](_0x5bb60d);return _0x5098db['set'](_0x98b2('0x1a'),_0xe49e9a+'-'+_0x5ecea1+'/'+_0x413464)['json'](_0x831ee8);}return null;};}function patchUpdates(_0x989082){return function(_0x4931f4){try{jsonpatch[_0x98b2('0x1b')](_0x4931f4,_0x989082,!![]);}catch(_0x1dfc04){return BPromise[_0x98b2('0x1c')](_0x1dfc04);}return _0x4931f4[_0x98b2('0x1d')]();};}function saveUpdates(_0x54d395,_0x51835f){return function(_0x242cbd){if(_0x242cbd){return _0x242cbd['update'](_0x54d395)['then'](function(_0x5d6b38){return _0x5d6b38;});}return null;};}function removeEntity(_0xf45da9,_0x4a3fa1){return function(_0x4ddded){if(_0x4ddded){return _0x4ddded[_0x98b2('0x1e')]()[_0x98b2('0x1f')](function(){_0xf45da9['status'](0xcc)[_0x98b2('0x20')]();});}};}function handleEntityNotFound(_0x13d149,_0xfae112){return function(_0x4f33d8){if(!_0x4f33d8){_0x13d149[_0x98b2('0x16')](0x194);}return _0x4f33d8;};}function handleError(_0x58be0e,_0x1d6e33){_0x1d6e33=_0x1d6e33||0x1f4;return function(_0x4c34f1){logger['error'](_0x4c34f1[_0x98b2('0x21')]);if(_0x4c34f1[_0x98b2('0x22')]){delete _0x4c34f1[_0x98b2('0x22')];}_0x58be0e['status'](_0x1d6e33)['send'](_0x4c34f1);};}exports['index']=function(_0x11c6aa,_0xdedd6c){var _0x50aafb={},_0xecb32b={},_0x28db65={'count':0x0,'rows':[]};var _0x26625b=db['ScreenRecording'][_0x98b2('0x23')];_0xecb32b[_0x98b2('0x24')]=_[_0x98b2('0x25')](_[_0x98b2('0x26')](_0x26625b),[_0x98b2('0x27')]);_0xecb32b['query']=_[_0x98b2('0x26')](_0x11c6aa['query']);_0xecb32b[_0x98b2('0x28')]=_[_0x98b2('0x29')](_0xecb32b['model'],_0xecb32b[_0x98b2('0x2a')]);_0x50aafb[_0x98b2('0x2b')]=_['intersection'](_0xecb32b[_0x98b2('0x24')],qs[_0x98b2('0x2c')](_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x2c')]));_0x50aafb['attributes']=_0x50aafb['attributes'][_0x98b2('0x2d')]?_0x50aafb[_0x98b2('0x2b')]:_0xecb32b[_0x98b2('0x24')];if(!_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x2e')](_0x98b2('0x2f'))){_0x50aafb['limit']=qs[_0x98b2('0x19')](_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x19')]);_0x50aafb[_0x98b2('0x18')]=qs[_0x98b2('0x18')](_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x18')]);}_0x50aafb[_0x98b2('0x30')]=qs[_0x98b2('0x31')](_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x31')]);_0x50aafb[_0x98b2('0x32')]=qs[_0x98b2('0x28')](_['pick'](_0x11c6aa['query'],_0xecb32b[_0x98b2('0x28')]));if(_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x33')]){_0x50aafb[_0x98b2('0x32')]=_[_0x98b2('0x34')](_0x50aafb[_0x98b2('0x32')],{'$or':_['map'](_0x26625b,function(_0x47d969){if(_0x47d969[_0x98b2('0x35')][_0x98b2('0x36')]!==_0x98b2('0x37')){var _0x4b9c32={};_0x4b9c32[_0x47d969[_0x98b2('0x38')]]={'$like':'%'+_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x33')]+'%'};return _0x4b9c32;}})});}_0x50aafb=_[_0x98b2('0x34')]({},_0x50aafb,_0x11c6aa[_0x98b2('0x39')]);var _0x3eea54={'where':_0x50aafb[_0x98b2('0x32')]};return db['ScreenRecording'][_0x98b2('0x3a')](_0x3eea54)['then'](function(_0x18e14e){_0x28db65[_0x98b2('0x3a')]=_0x18e14e;if(_0x11c6aa[_0x98b2('0x2a')][_0x98b2('0x3b')]){_0x50aafb['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x98b2('0x3c')](_0x50aafb);})[_0x98b2('0x1f')](function(_0x42c69c){_0x28db65['rows']=_0x42c69c;return _0x28db65;})[_0x98b2('0x1f')](respondWithFilteredResult(_0xdedd6c,_0x50aafb))[_0x98b2('0x3d')](handleError(_0xdedd6c,null));};exports[_0x98b2('0x3e')]=function(_0x378e4f,_0x311fa7){var _0xb55576={'raw':![],'where':{'id':_0x378e4f[_0x98b2('0x3f')]['id']}},_0x4ee6a5={};_0x4ee6a5[_0x98b2('0x24')]=_[_0x98b2('0x26')](db['ScreenRecording'][_0x98b2('0x23')]);_0x4ee6a5[_0x98b2('0x2a')]=_[_0x98b2('0x26')](_0x378e4f[_0x98b2('0x2a')]);_0x4ee6a5[_0x98b2('0x28')]=_[_0x98b2('0x29')](_0x4ee6a5['model'],_0x4ee6a5[_0x98b2('0x2a')]);_0xb55576['attributes']=_[_0x98b2('0x29')](_0x4ee6a5[_0x98b2('0x24')],qs[_0x98b2('0x2c')](_0x378e4f[_0x98b2('0x2a')][_0x98b2('0x2c')]));_0xb55576[_0x98b2('0x2b')]=_0xb55576[_0x98b2('0x2b')][_0x98b2('0x2d')]?_0xb55576[_0x98b2('0x2b')]:_0x4ee6a5['model'];if(_0x378e4f[_0x98b2('0x2a')]['includeAll']){_0xb55576[_0x98b2('0x40')]=[{'all':!![]}];}_0xb55576=_[_0x98b2('0x34')]({},_0xb55576,_0x378e4f[_0x98b2('0x39')]);return db[_0x98b2('0x41')][_0x98b2('0x42')](_0xb55576)[_0x98b2('0x1f')](handleEntityNotFound(_0x311fa7,null))['then'](respondWithResult(_0x311fa7,null))[_0x98b2('0x3d')](handleError(_0x311fa7,null));};exports[_0x98b2('0x43')]=function(_0x3dd679,_0x2bd1ca){return db[_0x98b2('0x41')]['create'](_0x3dd679['body'],{})[_0x98b2('0x1f')](respondWithResult(_0x2bd1ca,0xc9))[_0x98b2('0x3d')](handleError(_0x2bd1ca,null));};exports[_0x98b2('0x44')]=function(_0x389581,_0x598bbc){if(_0x389581['body']['id']){delete _0x389581['body']['id'];}delete _0x389581[_0x98b2('0x45')][_0x98b2('0x46')];delete _0x389581[_0x98b2('0x45')][_0x98b2('0x47')];delete _0x389581[_0x98b2('0x45')][_0x98b2('0x48')];delete _0x389581[_0x98b2('0x45')][_0x98b2('0x49')];return db[_0x98b2('0x41')]['find']({'where':{'id':_0x389581[_0x98b2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x598bbc,null))[_0x98b2('0x1f')](saveUpdates(_0x389581[_0x98b2('0x45')],null))[_0x98b2('0x1f')](respondWithResult(_0x598bbc,null))[_0x98b2('0x3d')](handleError(_0x598bbc,null));};exports['destroy']=function(_0x40cc81,_0x263585){return db[_0x98b2('0x41')][_0x98b2('0x42')]({'where':{'id':_0x40cc81[_0x98b2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x263585,null))[_0x98b2('0x1f')](removeEntity(_0x263585,null))[_0x98b2('0x3d')](handleError(_0x263585,null));};exports[_0x98b2('0x4a')]=function(_0x2fb91e,_0x35846b){return db[_0x98b2('0x41')][_0x98b2('0x4a')]()[_0x98b2('0x1f')](respondWithResult(_0x35846b,null))[_0x98b2('0x3d')](handleError(_0x35846b,null));};exports[_0x98b2('0x4b')]=function(_0x236ca6,_0x384fcf,_0x4d77d3){var _0x3b083a=require(_0x98b2('0x4c'));var _0x5e4779=![];var _0x5116d5={};if(_0x236ca6[_0x98b2('0x2a')]['type']&&_0x236ca6[_0x98b2('0x2a')][_0x98b2('0x35')]===_0x98b2('0x4d')){_0x5116d5[_0x98b2('0x4d')]=_0x236ca6[_0x98b2('0x3f')]['id'];}else{_0x5116d5['id']=_0x236ca6[_0x98b2('0x3f')]['id'];}return db['ScreenRecording'][_0x98b2('0x42')]({'where':_0x5116d5,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x384fcf,null))[_0x98b2('0x1f')](function(_0x27da73){if(_0x27da73){var _0x5217e0=path[_0x98b2('0x4e')](config[_0x98b2('0x4f')],'server/files/screen_recordings',_0x27da73[_0x98b2('0x49')]);var _0x466240=util[_0x98b2('0x27')](_0x98b2('0x50'),_0x5217e0);if(fs['existsSync'](_0x466240)){_0x5e4779=!![];return _0x3b083a['decryptFile'](_0x466240,_0x5217e0,config[_0x98b2('0x51')][_0x98b2('0x52')])[_0x98b2('0x1f')](function(){return _0x27da73;});}return _0x27da73;}})[_0x98b2('0x1f')](function(_0x3aceb2){if(_0x3aceb2){var _0x5bfb14=path['join'](config[_0x98b2('0x4f')],'server/files/screen_recordings',_0x3aceb2[_0x98b2('0x49')]);if(!fs[_0x98b2('0x53')](_0x5bfb14)){throw new db[(_0x98b2('0x54'))][(_0x98b2('0x55'))](_0x98b2('0x56'));}if(_0x3aceb2[_0x98b2('0x57')]){return _0x384fcf['download'](_0x5bfb14,_0x3aceb2[_0x98b2('0x57')]+path[_0x98b2('0x58')](_0x5bfb14),function(){if(_0x5e4779){fs[_0x98b2('0x59')](_0x5bfb14);}});}else{return _0x384fcf[_0x98b2('0x4b')](_0x5bfb14,function(_0x16c46b){if(_0x5e4779){fs[_0x98b2('0x59')](_0x5bfb14);}});}}})['catch'](function(_0x497c24){if(_0x497c24[_0x98b2('0x5a')]===_0x98b2('0x56')){_0x384fcf[_0x98b2('0x17')](0x194)[_0x98b2('0x5b')](_0x98b2('0x5c'));}else{return handleError(_0x384fcf,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index bdf8703..dc727ab 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 _0x24ee=['files','finally','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','isNil','value','join','server'];(function(_0x18e981,_0x422693){var _0x5bf33b=function(_0x31954e){while(--_0x31954e){_0x18e981['push'](_0x18e981['shift']());}};_0x5bf33b(++_0x422693);}(_0x24ee,0x1b2));var _0xe24e=function(_0x21a314,_0xbe022b){_0x21a314=_0x21a314-0x0;var _0x3eb9f6=_0x24ee[_0x21a314];return _0x3eb9f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe24e('0x0'));var BPromise=require(_0xe24e('0x1'));var rp=require(_0xe24e('0x2'));var fs=require('fs');var path=require(_0xe24e('0x3'));var rimraf=require(_0xe24e('0x4'));var config=require(_0xe24e('0x5'));var attributes=require(_0xe24e('0x6'));module[_0xe24e('0x7')]=function(_0x4d7d92,_0x196805){return _0x4d7d92[_0xe24e('0x8')](_0xe24e('0x9'),attributes,{'tableName':_0xe24e('0xa'),'paranoid':![],'indexes':[{'name':_0xe24e('0xb'),'fields':[_0xe24e('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x482363,_0x24dc6a,_0x3c6ef0){return new BPromise(function(_0x500e9b,_0x3f9a43){if(!_[_0xe24e('0xc')](_0x482363[_0xe24e('0xd')])){var _0x54961b=path[_0xe24e('0xe')](config['root'],_0xe24e('0xf'),_0xe24e('0x10'),_0xe24e('0xa'),_0x482363[_0xe24e('0xd')]);if(fs['existsSync'](_0x54961b)){rimraf(_0x54961b,function(_0x5e3bca){if(_0x5e3bca){console['log'](_0x5e3bca);}});}}_0x500e9b();})['catch'](function(_0x1a624b){BPromise['resolve']();})[_0xe24e('0x11')](function(){_0x3c6ef0();});}}});}; \ No newline at end of file +var _0xb1c8=['isNil','join','root','files','value','existsSync','catch','resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x1f74db,_0x46d348){var _0x4763c5=function(_0x4996ce){while(--_0x4996ce){_0x1f74db['push'](_0x1f74db['shift']());}};_0x4763c5(++_0x46d348);}(_0xb1c8,0x1d1));var _0x8b1c=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xb1c8[_0x52bfa5];return _0x26f80b;};'use strict';var _=require(_0x8b1c('0x0'));var util=require(_0x8b1c('0x1'));var logger=require(_0x8b1c('0x2'))(_0x8b1c('0x3'));var moment=require(_0x8b1c('0x4'));var BPromise=require(_0x8b1c('0x5'));var rp=require(_0x8b1c('0x6'));var fs=require('fs');var path=require(_0x8b1c('0x7'));var rimraf=require('rimraf');var config=require(_0x8b1c('0x8'));var attributes=require(_0x8b1c('0x9'));module[_0x8b1c('0xa')]=function(_0x42e8a8,_0x12567b){return _0x42e8a8[_0x8b1c('0xb')](_0x8b1c('0xc'),attributes,{'tableName':_0x8b1c('0xd'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x8b1c('0xe')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x396410,_0x3b3aa3,_0x1d615c){return new BPromise(function(_0x50121f,_0x22b09b){if(!_[_0x8b1c('0xf')](_0x396410['value'])){var _0x191bf0=path[_0x8b1c('0x10')](config[_0x8b1c('0x11')],'server',_0x8b1c('0x12'),_0x8b1c('0xd'),_0x396410[_0x8b1c('0x13')]);if(fs[_0x8b1c('0x14')](_0x191bf0)){rimraf(_0x191bf0,function(_0x2430cc){if(_0x2430cc){console['log'](_0x2430cc);}});}}_0x50121f();})[_0x8b1c('0x15')](function(_0x6b2c35){BPromise[_0x8b1c('0x16')]();})[_0x8b1c('0x17')](function(){_0x1d615c();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 128c52e..ea0bf28 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 _0xcca7=['request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0xcca7,0x1aa));var _0x7cca=function(_0x4b7173,_0x384a88){_0x4b7173=_0x4b7173-0x0;var _0x2d8a6f=_0xcca7[_0x4b7173];return _0x2d8a6f;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));var BPromise=require(_0x7cca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7cca('0x5'))(_0x7cca('0x6'));var config=require(_0x7cca('0x7'));var jayson=require(_0x7cca('0x8'));var client=jayson[_0x7cca('0x9')][_0x7cca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aec51,_0x508f29,_0x937fad){return new BPromise(function(_0xd7a28d,_0x1aed1b){return client[_0x7cca('0xb')](_0x5aec51,_0x937fad)[_0x7cca('0xc')](function(_0xe800a5){logger[_0x7cca('0xd')](_0x7cca('0xe'),_0x508f29,_0x7cca('0xf'));logger[_0x7cca('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x508f29,_0x7cca('0xf'),JSON[_0x7cca('0x11')](_0xe800a5));if(_0xe800a5[_0x7cca('0x12')]){if(_0xe800a5[_0x7cca('0x12')][_0x7cca('0x13')]===0x1f4){logger['error'](_0x7cca('0xe'),_0x508f29,_0xe800a5[_0x7cca('0x12')][_0x7cca('0x14')]);return _0x1aed1b(_0xe800a5['error']['message']);}logger[_0x7cca('0x12')](_0x7cca('0xe'),_0x508f29,_0xe800a5[_0x7cca('0x12')][_0x7cca('0x14')]);return _0xd7a28d(_0xe800a5[_0x7cca('0x12')][_0x7cca('0x14')]);}else{logger[_0x7cca('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x508f29,_0x7cca('0xf'));_0xd7a28d(_0xe800a5['result']['message']);}})['catch'](function(_0x33a466){logger[_0x7cca('0x12')](_0x7cca('0xe'),_0x508f29,_0x33a466);_0x1aed1b(_0x33a466);});});} \ No newline at end of file +var _0x5178=['request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x5178,0x171));var _0x8517=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5178[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index f7b8dd5..2f596d2 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 _0x3f15=['logo','originalname','post','single','file','addLogo','logologin','extname','addLogoLogin','addPreferred','put','update','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s'];(function(_0x20fcac,_0x4bd0d0){var _0x8c85d2=function(_0x3e17a6){while(--_0x3e17a6){_0x20fcac['push'](_0x20fcac['shift']());}};_0x8c85d2(++_0x4bd0d0);}(_0x3f15,0x75));var _0x53f1=function(_0x9ab3e2,_0x5aea14){_0x9ab3e2=_0x9ab3e2-0x0;var _0x38a283=_0x3f15[_0x9ab3e2];return _0x38a283;};'use strict';var multer=require('multer');var util=require(_0x53f1('0x0'));var path=require(_0x53f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x53f1('0x2'));var router=express['Router']();var auth=require(_0x53f1('0x3'));var interaction=require(_0x53f1('0x4'));var config=require(_0x53f1('0x5'));var controller=require(_0x53f1('0x6'));router['get']('/',auth[_0x53f1('0x7')](),controller['index']);router[_0x53f1('0x8')](_0x53f1('0x9'),controller[_0x53f1('0xa')]);router[_0x53f1('0x8')]('/:id/logo',controller[_0x53f1('0xb')]);router[_0x53f1('0x8')](_0x53f1('0xc'),controller['getLogoLogin']);router[_0x53f1('0x8')](_0x53f1('0xd'),controller[_0x53f1('0xe')]);router[_0x53f1('0x8')](_0x53f1('0xf'),controller[_0x53f1('0x10')]);var upload=multer({'storage':multer[_0x53f1('0x11')]({'destination':function(_0x4e2965,_0x3ce857,_0x5c77fc){_0x5c77fc(null,path[_0x53f1('0x12')](config[_0x53f1('0x13')],_0x53f1('0x14')));},'filename':function(_0x1bd9af,_0x19a985,_0x6243f){_0x6243f(null,util[_0x53f1('0x15')](_0x53f1('0x16'),_0x53f1('0x17'),path['extname'](_0x19a985[_0x53f1('0x18')])));}})});router[_0x53f1('0x19')]('/:id/logo',upload[_0x53f1('0x1a')](_0x53f1('0x1b')),controller[_0x53f1('0x1c')]);var upload=multer({'storage':multer[_0x53f1('0x11')]({'destination':function(_0x24c995,_0x3964a0,_0x4396e7){_0x4396e7(null,path[_0x53f1('0x12')](config[_0x53f1('0x13')],'server/files/images/logos/'));},'filename':function(_0x303fa1,_0x3f4a5c,_0x2ce47b){_0x2ce47b(null,util[_0x53f1('0x15')](_0x53f1('0x16'),_0x53f1('0x1d'),path[_0x53f1('0x1e')](_0x3f4a5c[_0x53f1('0x18')])));}})});router[_0x53f1('0x19')](_0x53f1('0xc'),upload[_0x53f1('0x1a')](_0x53f1('0x1b')),controller[_0x53f1('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55887d,_0x5ece52,_0x1fb456){_0x1fb456(null,path[_0x53f1('0x12')](config['root'],_0x53f1('0x14')));},'filename':function(_0x39bfa5,_0x829060,_0x16df82){_0x16df82(null,util[_0x53f1('0x15')](_0x53f1('0x16'),'preferred',path['extname'](_0x829060[_0x53f1('0x18')])));}})});router[_0x53f1('0x19')](_0x53f1('0xf'),upload['single'](_0x53f1('0x1b')),controller[_0x53f1('0x20')]);router[_0x53f1('0x21')](_0x53f1('0x9'),auth['isAuthenticated'](),controller[_0x53f1('0x22')]);module['exports']=router; \ No newline at end of file +var _0x8cfa=['getLogoLogin','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','exports','multer','util','path','connect-timeout','../../components/auth/service','./setting.controller','get','index','/:id','/:id/logo','getLogo'];(function(_0x1fd7c6,_0x5cd8dd){var _0x1f6bd8=function(_0x42621a){while(--_0x42621a){_0x1fd7c6['push'](_0x1fd7c6['shift']());}};_0x1f6bd8(++_0x5cd8dd);}(_0x8cfa,0x1e4));var _0xa8cf=function(_0x56d3cf,_0x20787b){_0x56d3cf=_0x56d3cf-0x0;var _0x5881e6=_0x8cfa[_0x56d3cf];return _0x5881e6;};'use strict';var multer=require(_0xa8cf('0x0'));var util=require(_0xa8cf('0x1'));var path=require(_0xa8cf('0x2'));var timeout=require(_0xa8cf('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xa8cf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa8cf('0x5'));router[_0xa8cf('0x6')]('/',auth['isAuthenticated'](),controller[_0xa8cf('0x7')]);router['get'](_0xa8cf('0x8'),controller['show']);router[_0xa8cf('0x6')](_0xa8cf('0x9'),controller[_0xa8cf('0xa')]);router[_0xa8cf('0x6')]('/:id/logo_login',controller[_0xa8cf('0xb')]);router[_0xa8cf('0x6')]('/:id/gdpr',controller['gdpr']);router[_0xa8cf('0x6')](_0xa8cf('0xc'),controller[_0xa8cf('0xd')]);var upload=multer({'storage':multer[_0xa8cf('0xe')]({'destination':function(_0x5c93ea,_0x4acdfc,_0x22178f){_0x22178f(null,path[_0xa8cf('0xf')](config[_0xa8cf('0x10')],_0xa8cf('0x11')));},'filename':function(_0x2cfc41,_0x82b669,_0x5961b3){_0x5961b3(null,util[_0xa8cf('0x12')](_0xa8cf('0x13'),_0xa8cf('0x14'),path[_0xa8cf('0x15')](_0x82b669[_0xa8cf('0x16')])));}})});router[_0xa8cf('0x17')]('/:id/logo',upload['single'](_0xa8cf('0x18')),controller[_0xa8cf('0x19')]);var upload=multer({'storage':multer[_0xa8cf('0xe')]({'destination':function(_0x5b5793,_0x199d91,_0x2c52e3){_0x2c52e3(null,path[_0xa8cf('0xf')](config['root'],_0xa8cf('0x11')));},'filename':function(_0xd67b31,_0x3e39fe,_0x216618){_0x216618(null,util[_0xa8cf('0x12')](_0xa8cf('0x13'),_0xa8cf('0x1a'),path[_0xa8cf('0x15')](_0x3e39fe[_0xa8cf('0x16')])));}})});router['post'](_0xa8cf('0x1b'),upload[_0xa8cf('0x1c')](_0xa8cf('0x18')),controller[_0xa8cf('0x1d')]);var upload=multer({'storage':multer[_0xa8cf('0xe')]({'destination':function(_0x4a0a5a,_0x15c7c1,_0x1fa558){_0x1fa558(null,path[_0xa8cf('0xf')](config['root'],'server/files/images/logos/'));},'filename':function(_0x380e09,_0x29e3f1,_0x899236){_0x899236(null,util[_0xa8cf('0x12')](_0xa8cf('0x13'),_0xa8cf('0x1e'),path[_0xa8cf('0x15')](_0x29e3f1['originalname'])));}})});router['post']('/:id/preferred',upload[_0xa8cf('0x1c')](_0xa8cf('0x18')),controller[_0xa8cf('0x1f')]);router['put'](_0xa8cf('0x8'),auth['isAuthenticated'](),controller['update']);module[_0xa8cf('0x20')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index f9f4945..cba6dcf 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 _0xa3f1=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports','INTEGER','min_mailbox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3f1,0x177));var _0x1a3f=function(_0xc48c5a,_0x10b34c){_0xc48c5a=_0xc48c5a-0x0;var _0xc5cfbf=_0xa3f1[_0xc48c5a];return _0xc5cfbf;};'use strict';var Sequelize=require('sequelize');module[_0x1a3f('0x0')]={'min_internal':{'type':Sequelize[_0x1a3f('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1a3f('0x1')](0xb),'unique':_0x1a3f('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1a3f('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x1a3f('0x3')]},'defaultLogo':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x1a3f('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1a3f('0x3')]},'turnaddr':{'type':Sequelize[_0x1a3f('0x3')]},'turnusername':{'type':Sequelize[_0x1a3f('0x3')]},'turnpassword':{'type':Sequelize[_0x1a3f('0x3')]},'pageTitle':{'type':Sequelize[_0x1a3f('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1a3f('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1a3f('0x3')],'defaultValue':_0x1a3f('0x5')},'enableEmailPreview':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1a3f('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1a3f('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1a3f('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1a3f('0x3')],'defaultValue':_0x1a3f('0x6')},'chatTimeout':{'type':Sequelize[_0x1a3f('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1a3f('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1a3f('0x3')]}}; \ No newline at end of file +var _0xc6de=['INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','min_internal'];(function(_0x5be791,_0x94dd5a){var _0x2ea8b8=function(_0x4423c0){while(--_0x4423c0){_0x5be791['push'](_0x5be791['shift']());}};_0x2ea8b8(++_0x94dd5a);}(_0xc6de,0x1e3));var _0xec6d=function(_0x257896,_0x8de612){_0x257896=_0x257896-0x0;var _0x1ff242=_0xc6de[_0x257896];return _0x1ff242;};'use strict';var Sequelize=require(_0xec6d('0x0'));module[_0xec6d('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xec6d('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xec6d('0x3')](0xb),'unique':_0xec6d('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xec6d('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xec6d('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xec6d('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xec6d('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xec6d('0x5')]},'turnaddr':{'type':Sequelize[_0xec6d('0x5')]},'turnusername':{'type':Sequelize[_0xec6d('0x5')]},'turnpassword':{'type':Sequelize[_0xec6d('0x5')]},'pageTitle':{'type':Sequelize[_0xec6d('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xec6d('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xec6d('0x5')],'defaultValue':_0xec6d('0x7')},'enableEmailPreview':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xec6d('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xec6d('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xec6d('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xec6d('0x8')},'chatTimeout':{'type':Sequelize[_0xec6d('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xec6d('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 727645b..4b10153 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 _0xc337=['custom','gdpr','securePassword','addPreferred','preferred','getPreferred','server/files/images/logos','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','offset','set','apply','reject','save','update','end','stack','name','index','Setting','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','body','get','readFileSync','join','render','root','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','defaultPreferred','existsSync','logo','toLower','default_logo.png','default','upperFirst','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','defaultLogo','defaultLoginLogo','default_loginLogo.png'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc337,0x17f));var _0x7c33=function(_0x34886c,_0x34b7cb){_0x34886c=_0x34886c-0x0;var _0x509806=_0xc337[_0x34886c];return _0x509806;};'use strict';var pdf=require(_0x7c33('0x0'));var emlformat=require(_0x7c33('0x1'));var rimraf=require(_0x7c33('0x2'));var zipdir=require(_0x7c33('0x3'));var jsonpatch=require(_0x7c33('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7c33('0x5'));var Mustache=require(_0x7c33('0x6'));var util=require(_0x7c33('0x7'));var path=require(_0x7c33('0x8'));var sox=require(_0x7c33('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c33('0xa'));var jsforce=require(_0x7c33('0xb'));var deskjs=require(_0x7c33('0xc'));var toCsv=require(_0x7c33('0xd'));var querystring=require('querystring');var Papa=require(_0x7c33('0xe'));var Redis=require('ioredis');var authService=require(_0x7c33('0xf'));var qs=require(_0x7c33('0x10'));var hardwareService=require(_0x7c33('0x11'));var logger=require('../../config/logger')(_0x7c33('0x12'));var utils=require(_0x7c33('0x13'));var config=require(_0x7c33('0x14'));var db=require(_0x7c33('0x15'))['db'];var jayson=require(_0x7c33('0x16'));var client=jayson[_0x7c33('0x17')][_0x7c33('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1ebac9,_0x5175ab,_0x416b17){if(_0x416b17){var _0x5e7253=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e7253[_0x7c33('0x19')](_0x5175ab)){return _0x1ebac9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1ebac9;}}function respondWithRpcPromise(_0x35450d,_0xb4db25,_0x3485fa,_0x21bed5){return new BPromise(function(_0x2d92e7,_0x1dc767){var _0x20621f=_0x21bed5||client;return _0x20621f[_0x7c33('0x1a')](_0x35450d,_0x3485fa)[_0x7c33('0x1b')](function(_0x255285){logger[_0x7c33('0x1c')](_0x7c33('0x1d'),_0xb4db25,'request\x20sent');logger[_0x7c33('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0xb4db25,_0x7c33('0x1f'),JSON[_0x7c33('0x20')](_0x255285));if(_0x255285[_0x7c33('0x21')]){if(_0x255285[_0x7c33('0x21')][_0x7c33('0x22')]===0x1f4){logger[_0x7c33('0x21')](_0x7c33('0x1d'),_0xb4db25,_0x255285[_0x7c33('0x21')][_0x7c33('0x23')]);return _0x1dc767(_0x255285[_0x7c33('0x21')][_0x7c33('0x23')]);}logger[_0x7c33('0x21')]('Setting,\x20%s,\x20%s',_0xb4db25,_0x255285[_0x7c33('0x21')][_0x7c33('0x23')]);return _0x2d92e7(_0x255285['error'][_0x7c33('0x23')]);}else{logger['info'](_0x7c33('0x1d'),_0xb4db25,_0x7c33('0x1f'));_0x2d92e7(_0x255285[_0x7c33('0x24')][_0x7c33('0x23')]);}})['catch'](function(_0x510fe6){logger[_0x7c33('0x21')](_0x7c33('0x1d'),_0xb4db25,_0x510fe6);_0x1dc767(_0x510fe6);});});}function respondWithStatusCode(_0x58a662,_0x5c5872){_0x5c5872=_0x5c5872||0xcc;return function(_0x32ddb4){if(_0x32ddb4){return _0x58a662[_0x7c33('0x25')](_0x5c5872);}return _0x58a662[_0x7c33('0x26')](_0x5c5872)['end']();};}function respondWithResult(_0xea701f,_0x4d5111){_0x4d5111=_0x4d5111||0xc8;return function(_0x55105a){if(_0x55105a){return _0xea701f[_0x7c33('0x26')](_0x4d5111)[_0x7c33('0x27')](_0x55105a);}};}function respondWithFilteredResult(_0x11a93f,_0x2d8f61){return function(_0x15c69a){if(_0x15c69a){var _0x5cd7e9=_0x15c69a[_0x7c33('0x28')],_0x25cec0=_0x2d8f61[_0x7c33('0x29')],_0x2e8651=_0x2d8f61[_0x7c33('0x29')]+_0x2d8f61['limit'],_0x47aa6c;if(_0x2e8651>=_0x5cd7e9){_0x2e8651=_0x5cd7e9;_0x47aa6c=0xc8;}else{_0x47aa6c=0xce;}_0x11a93f[_0x7c33('0x26')](_0x47aa6c);return _0x11a93f[_0x7c33('0x2a')]('Content-Range',_0x25cec0+'-'+_0x2e8651+'/'+_0x5cd7e9)[_0x7c33('0x27')](_0x15c69a);}return null;};}function patchUpdates(_0x3d83c0){return function(_0x2c657f){try{jsonpatch[_0x7c33('0x2b')](_0x2c657f,_0x3d83c0,!![]);}catch(_0x26d087){return BPromise[_0x7c33('0x2c')](_0x26d087);}return _0x2c657f[_0x7c33('0x2d')]();};}function saveUpdates(_0x1c2b70,_0x460277){return function(_0x50f0b0){if(_0x50f0b0){return _0x50f0b0[_0x7c33('0x2e')](_0x1c2b70)[_0x7c33('0x1b')](function(_0x420870){return _0x420870;});}return null;};}function removeEntity(_0x5c7e7f,_0x305052){return function(_0x2d2535){if(_0x2d2535){return _0x2d2535['destroy']()[_0x7c33('0x1b')](function(){_0x5c7e7f['status'](0xcc)[_0x7c33('0x2f')]();});}};}function handleEntityNotFound(_0x2c404f,_0x12da20){return function(_0x29e7ee){if(!_0x29e7ee){_0x2c404f['sendStatus'](0x194);}return _0x29e7ee;};}function handleError(_0x14e721,_0xf129a3){_0xf129a3=_0xf129a3||0x1f4;return function(_0xc9e1a9){logger[_0x7c33('0x21')](_0xc9e1a9[_0x7c33('0x30')]);if(_0xc9e1a9[_0x7c33('0x31')]){delete _0xc9e1a9['name'];}_0x14e721['status'](_0xf129a3)['send'](_0xc9e1a9);};}exports[_0x7c33('0x32')]=function(_0x3f5e36,_0x85aacb){var _0xb3666b={},_0x5d8381={},_0x297960={'count':0x0,'rows':[]};var _0x2c1a88=db[_0x7c33('0x33')][_0x7c33('0x34')];_0x5d8381[_0x7c33('0x35')]=_[_0x7c33('0x36')](_0x2c1a88);_0x5d8381[_0x7c33('0x37')]=_[_0x7c33('0x36')](_0x3f5e36[_0x7c33('0x37')]);_0x5d8381[_0x7c33('0x38')]=_[_0x7c33('0x39')](_0x5d8381[_0x7c33('0x35')],_0x5d8381[_0x7c33('0x37')]);_0xb3666b['attributes']=_['intersection'](_0x5d8381[_0x7c33('0x35')],qs[_0x7c33('0x3a')](_0x3f5e36[_0x7c33('0x37')]['fields']));_0xb3666b[_0x7c33('0x3b')]=_0xb3666b[_0x7c33('0x3b')][_0x7c33('0x3c')]?_0xb3666b[_0x7c33('0x3b')]:_0x5d8381[_0x7c33('0x35')];if(!_0x3f5e36[_0x7c33('0x37')][_0x7c33('0x3d')](_0x7c33('0x3e'))){_0xb3666b[_0x7c33('0x3f')]=qs[_0x7c33('0x3f')](_0x3f5e36[_0x7c33('0x37')][_0x7c33('0x3f')]);_0xb3666b[_0x7c33('0x29')]=qs[_0x7c33('0x29')](_0x3f5e36['query'][_0x7c33('0x29')]);}_0xb3666b[_0x7c33('0x40')]=qs[_0x7c33('0x41')](_0x3f5e36['query'][_0x7c33('0x41')]);_0xb3666b[_0x7c33('0x42')]=qs[_0x7c33('0x38')](_[_0x7c33('0x43')](_0x3f5e36[_0x7c33('0x37')],_0x5d8381[_0x7c33('0x38')]));if(_0x3f5e36[_0x7c33('0x37')]['filter']){_0xb3666b[_0x7c33('0x42')]=_[_0x7c33('0x44')](_0xb3666b['where'],{'$or':_['map'](_0x2c1a88,function(_0x376e27){if(_0x376e27[_0x7c33('0x45')][_0x7c33('0x46')]!==_0x7c33('0x47')){var _0x2e3cd9={};_0x2e3cd9[_0x376e27['field']]={'$like':'%'+_0x3f5e36[_0x7c33('0x37')][_0x7c33('0x48')]+'%'};return _0x2e3cd9;}})});}_0xb3666b=_[_0x7c33('0x44')]({},_0xb3666b,_0x3f5e36[_0x7c33('0x49')]);var _0x540f57={'where':_0xb3666b[_0x7c33('0x42')]};return db[_0x7c33('0x33')][_0x7c33('0x28')](_0x540f57)['then'](function(_0x5cc711){_0x297960[_0x7c33('0x28')]=_0x5cc711;if(_0x3f5e36[_0x7c33('0x37')][_0x7c33('0x4a')]){_0xb3666b[_0x7c33('0x4b')]=[{'all':!![]}];}return db[_0x7c33('0x33')][_0x7c33('0x4c')](_0xb3666b);})[_0x7c33('0x1b')](function(_0x22ee42){_0x297960['rows']=_0x22ee42;return _0x297960;})['then'](respondWithFilteredResult(_0x85aacb,_0xb3666b))[_0x7c33('0x4d')](handleError(_0x85aacb,null));};exports['show']=function(_0x35bf86,_0x61824a){var _0x325b89={'raw':![],'where':{'id':_0x35bf86[_0x7c33('0x4e')]['id']}},_0x10f48b={};_0x10f48b['model']=_[_0x7c33('0x36')](db[_0x7c33('0x33')][_0x7c33('0x34')]);_0x10f48b[_0x7c33('0x37')]=_[_0x7c33('0x36')](_0x35bf86['query']);_0x10f48b[_0x7c33('0x38')]=_['intersection'](_0x10f48b[_0x7c33('0x35')],_0x10f48b[_0x7c33('0x37')]);_0x325b89[_0x7c33('0x3b')]=_[_0x7c33('0x39')](_0x10f48b[_0x7c33('0x35')],qs['fields'](_0x35bf86[_0x7c33('0x37')][_0x7c33('0x3a')]));_0x325b89['attributes']=_0x325b89[_0x7c33('0x3b')]['length']?_0x325b89['attributes']:_0x10f48b[_0x7c33('0x35')];if(_0x35bf86[_0x7c33('0x37')][_0x7c33('0x4a')]){_0x325b89[_0x7c33('0x4b')]=[{'all':!![]}];}_0x325b89=_[_0x7c33('0x44')]({},_0x325b89,_0x35bf86['options']);return db['Setting'][_0x7c33('0x4f')](_0x325b89)['then'](handleEntityNotFound(_0x61824a,null))['then'](respondWithResult(_0x61824a,null))[_0x7c33('0x4d')](handleError(_0x61824a,null));};exports[_0x7c33('0x2e')]=function(_0x17a5aa,_0x36009b,_0x2fb394){var _0x5c4b99;return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x17a5aa[_0x7c33('0x4e')]['id']}})[_0x7c33('0x1b')](handleEntityNotFound(_0x36009b,null))[_0x7c33('0x1b')](saveUpdates(_0x17a5aa[_0x7c33('0x50')],null))[_0x7c33('0x1b')](function(_0x3fe069){if(_0x3fe069){_0x5c4b99=_0x3fe069[_0x7c33('0x51')]({'plain':!![]});var _0x163e1b=fs[_0x7c33('0x52')](path[_0x7c33('0x53')](config['root'],'server/files/templates/stun.ejs'),'utf8');var _0x5f0a71=ejs[_0x7c33('0x54')](_0x163e1b,_0x5c4b99);var _0x3a1a80=fs['readFileSync'](path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x7c33('0x56')),_0x7c33('0x57'));var _0xa66251=ejs[_0x7c33('0x54')](_0x3a1a80,_0x5c4b99);fs[_0x7c33('0x58')](_0x7c33('0x59'),_0x5f0a71);fs[_0x7c33('0x58')](_0x7c33('0x5a'),_0xa66251);return respondWithRpcPromise(_0x7c33('0x5b'),_0x7c33('0x2e'),{'module':_0x7c33('0x5c')});}})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x7c33('0x5d')});})[_0x7c33('0x1b')](function(){return _0x5c4b99||null;})[_0x7c33('0x1b')](respondWithResult(_0x36009b,null))[_0x7c33('0x4d')](handleError(_0x36009b,null));};exports[_0x7c33('0x5e')]=function(_0x66e8f4,_0x3e4aa1,_0x1575e5){if(_0x66e8f4[_0x7c33('0x5f')]&&_0x66e8f4[_0x7c33('0x5f')][_0x7c33('0x60')]){_0x66e8f4[_0x7c33('0x50')]['logo']=_0x66e8f4[_0x7c33('0x5f')][_0x7c33('0x60')];}return db[_0x7c33('0x33')]['find']({'where':{'id':_0x66e8f4[_0x7c33('0x4e')]['id']}})[_0x7c33('0x1b')](handleEntityNotFound(_0x3e4aa1,null))[_0x7c33('0x1b')](saveUpdates(_0x66e8f4[_0x7c33('0x50')],null))[_0x7c33('0x1b')](respondWithResult(_0x3e4aa1,null))[_0x7c33('0x4d')](handleError(_0x3e4aa1,null));};exports[_0x7c33('0x61')]=function(_0x5524b9,_0x9560bf,_0x439b83){if(_0x5524b9[_0x7c33('0x5f')]&&_0x5524b9[_0x7c33('0x5f')]['filename']){_0x5524b9[_0x7c33('0x50')][_0x7c33('0x62')]=_0x5524b9['file'][_0x7c33('0x60')];}return db[_0x7c33('0x33')]['find']({'where':{'id':_0x5524b9['params']['id']}})[_0x7c33('0x1b')](handleEntityNotFound(_0x9560bf,null))[_0x7c33('0x1b')](saveUpdates(_0x5524b9[_0x7c33('0x50')],null))['then'](respondWithResult(_0x9560bf,null))['catch'](handleError(_0x9560bf,null));};var utilLicense=require(_0x7c33('0x63'));exports[_0x7c33('0x64')]=function(_0x4d9c2e,_0x1e6ac4,_0x45ec40){var _0x199b50='server/files/images/logos';var _0xd58e51={'custom':![]};return utilLicense[_0x7c33('0x65')]()[_0x7c33('0x1b')](function(_0x471407){if(_0x471407){_0xd58e51=_0x471407;}return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x4d9c2e[_0x7c33('0x4e')]['id']},'attributes':['logo','loginLogo','preferred','defaultLogo','defaultLoginLogo',_0x7c33('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x1e6ac4,null))[_0x7c33('0x1b')](function(_0x115efc){if(_0x115efc){var _0x26642f=_0x115efc['logo']&&fs[_0x7c33('0x67')](path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x199b50,_['toLower'](_0x115efc[_0x7c33('0x68')])))?path['join'](config[_0x7c33('0x55')],_0x199b50,_[_0x7c33('0x69')](_0x115efc['logo'])):path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x199b50,_['toLower'](_0x7c33('0x6a')));var _0x9b13b2=_0x7c33('0x6b')+_[_0x7c33('0x6c')](_0x7c33('0x68'));if(_0x115efc[_0x9b13b2]||!_0xd58e51['custom']){_0x26642f=path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x199b50,_['toLower'](_0x7c33('0x6a')));}if(!fs['existsSync'](_0x26642f)){throw new db[(_0x7c33('0x6d'))][(_0x7c33('0x6e'))](_0x7c33('0x6f'));}return _0x1e6ac4[_0x7c33('0x70')](_0x26642f);}})[_0x7c33('0x4d')](handleError(_0x1e6ac4,null));};var utilLicense=require(_0x7c33('0x63'));exports[_0x7c33('0x71')]=function(_0x15c45b,_0x30d176,_0x13206b){var _0x412cd5='server/files/images/logos';var _0x2af617={'custom':![]};return utilLicense[_0x7c33('0x65')]()[_0x7c33('0x1b')](function(_0x50b845){if(_0x50b845){_0x2af617=_0x50b845;}return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x15c45b[_0x7c33('0x4e')]['id']},'attributes':[_0x7c33('0x68'),'loginLogo','preferred',_0x7c33('0x72'),_0x7c33('0x73'),_0x7c33('0x66')],'raw':!![]});})[_0x7c33('0x1b')](handleEntityNotFound(_0x30d176,null))['then'](function(_0x56c803){if(_0x56c803){var _0x48d7f0=_0x56c803['loginLogo']&&fs[_0x7c33('0x67')](path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x412cd5,_[_0x7c33('0x69')](_0x56c803[_0x7c33('0x62')])))?path['join'](config[_0x7c33('0x55')],_0x412cd5,_[_0x7c33('0x69')](_0x56c803[_0x7c33('0x62')])):path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x412cd5,_[_0x7c33('0x69')](_0x7c33('0x74')));var _0x2bc70a='default'+_[_0x7c33('0x6c')]('loginLogo');if(_0x56c803[_0x2bc70a]||!_0x2af617[_0x7c33('0x75')]){_0x48d7f0=path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x412cd5,_[_0x7c33('0x69')](_0x7c33('0x74')));}if(!fs[_0x7c33('0x67')](_0x48d7f0)){throw new db[(_0x7c33('0x6d'))][(_0x7c33('0x6e'))]('Logo\x20not\x20found');}return _0x30d176[_0x7c33('0x70')](_0x48d7f0);}})[_0x7c33('0x4d')](handleError(_0x30d176,null));};exports[_0x7c33('0x76')]=function(_0x268602,_0x1ed326){return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x268602[_0x7c33('0x4e')]['id']},'attributes':[_0x7c33('0x77')]})[_0x7c33('0x1b')](respondWithResult(_0x1ed326,null))['catch'](handleError(_0x1ed326,null));};exports[_0x7c33('0x78')]=function(_0x6ca8f9,_0x1ad3cd,_0x590050){if(_0x6ca8f9[_0x7c33('0x5f')]&&_0x6ca8f9['file']['filename']){_0x6ca8f9[_0x7c33('0x50')][_0x7c33('0x79')]=_0x6ca8f9[_0x7c33('0x5f')][_0x7c33('0x60')];}return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x6ca8f9['params']['id']}})[_0x7c33('0x1b')](handleEntityNotFound(_0x1ad3cd,null))[_0x7c33('0x1b')](saveUpdates(_0x6ca8f9[_0x7c33('0x50')],null))[_0x7c33('0x1b')](respondWithResult(_0x1ad3cd,null))[_0x7c33('0x4d')](handleError(_0x1ad3cd,null));};var utilLicense=require('../../config/license/util');exports[_0x7c33('0x7a')]=function(_0x4d6fa5,_0x3897a2,_0x46163b){var _0x2ab02d=_0x7c33('0x7b');var _0x23ec9e={'custom':![]};return utilLicense[_0x7c33('0x65')]()[_0x7c33('0x1b')](function(_0x2312d5){if(_0x2312d5){_0x23ec9e=_0x2312d5;}return db[_0x7c33('0x33')][_0x7c33('0x4f')]({'where':{'id':_0x4d6fa5[_0x7c33('0x4e')]['id']},'attributes':[_0x7c33('0x68'),_0x7c33('0x62'),_0x7c33('0x79'),'defaultLogo',_0x7c33('0x73'),_0x7c33('0x66')],'raw':!![]});})[_0x7c33('0x1b')](handleEntityNotFound(_0x3897a2,null))[_0x7c33('0x1b')](function(_0x177950){if(_0x177950){var _0x57b7a8=_0x177950[_0x7c33('0x79')]&&fs[_0x7c33('0x67')](path[_0x7c33('0x53')](config[_0x7c33('0x55')],_0x2ab02d,_[_0x7c33('0x69')](_0x177950[_0x7c33('0x79')])))?path['join'](config[_0x7c33('0x55')],_0x2ab02d,_[_0x7c33('0x69')](_0x177950[_0x7c33('0x79')])):path['join'](config['root'],_0x2ab02d,_['toLower'](_0x7c33('0x7c')));var _0x455a68=_0x7c33('0x6b')+_[_0x7c33('0x6c')](_0x7c33('0x79'));if(_0x177950[_0x455a68]||!_0x23ec9e[_0x7c33('0x75')]||!_0x23ec9e[_0x7c33('0x79')]){_0x57b7a8=path['join'](config['root'],_0x2ab02d,_[_0x7c33('0x69')](_0x7c33('0x7c')));}if(!fs[_0x7c33('0x67')](_0x57b7a8)){throw new db['Sequelize']['ValidationError'](_0x7c33('0x6f'));}return _0x3897a2[_0x7c33('0x70')](_0x57b7a8);}})[_0x7c33('0x4d')](handleError(_0x3897a2,null));}; \ No newline at end of file +var _0x5f80=['loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','Sequelize','Logo\x20not\x20found','getLogoLogin','defaultLogo','custom','default_loginLogo.png','ValidationError','download','gdpr','securePassword','addPreferred','default_preferred.png','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','update','destroy','end','stack','name','send','index','Setting','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','find','params','body','get','readFileSync','root','render','join','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','addLogo','file','filename','logo','addLogoLogin'];(function(_0x277a8d,_0x8f4900){var _0x3e1793=function(_0x5e8f41){while(--_0x5e8f41){_0x277a8d['push'](_0x277a8d['shift']());}};_0x3e1793(++_0x8f4900);}(_0x5f80,0x94));var _0x05f8=function(_0x3099bb,_0x5d29e3){_0x3099bb=_0x3099bb-0x0;var _0x31df2a=_0x5f80[_0x3099bb];return _0x31df2a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x05f8('0x0'));var rimraf=require(_0x05f8('0x1'));var zipdir=require(_0x05f8('0x2'));var jsonpatch=require(_0x05f8('0x3'));var rp=require(_0x05f8('0x4'));var moment=require(_0x05f8('0x5'));var BPromise=require(_0x05f8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05f8('0x7'));var sox=require(_0x05f8('0x8'));var csv=require(_0x05f8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x05f8('0xa'));var squel=require(_0x05f8('0xb'));var crypto=require('crypto');var jsforce=require(_0x05f8('0xc'));var deskjs=require(_0x05f8('0xd'));var toCsv=require(_0x05f8('0x9'));var querystring=require(_0x05f8('0xe'));var Papa=require(_0x05f8('0xf'));var Redis=require(_0x05f8('0x10'));var authService=require(_0x05f8('0x11'));var qs=require(_0x05f8('0x12'));var hardwareService=require(_0x05f8('0x13'));var logger=require(_0x05f8('0x14'))('api');var utils=require(_0x05f8('0x15'));var config=require(_0x05f8('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x05f8('0x17'));var client=jayson[_0x05f8('0x18')][_0x05f8('0x19')]({'port':0x232a});function checkPasswordPattern(_0x412a7e,_0xfb1a12,_0x4da925){if(_0x4da925){var _0x49b9c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49b9c7['test'](_0xfb1a12)){return _0x412a7e;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x412a7e;}}function respondWithRpcPromise(_0x3d4bfe,_0x14322d,_0x1b10cd,_0x30862b){return new BPromise(function(_0x5ea395,_0x22632d){var _0x4ea3b9=_0x30862b||client;return _0x4ea3b9[_0x05f8('0x1a')](_0x3d4bfe,_0x1b10cd)[_0x05f8('0x1b')](function(_0x329bd8){logger[_0x05f8('0x1c')](_0x05f8('0x1d'),_0x14322d,_0x05f8('0x1e'));logger['debug'](_0x05f8('0x1f'),_0x14322d,_0x05f8('0x1e'),JSON[_0x05f8('0x20')](_0x329bd8));if(_0x329bd8[_0x05f8('0x21')]){if(_0x329bd8[_0x05f8('0x21')][_0x05f8('0x22')]===0x1f4){logger[_0x05f8('0x21')]('Setting,\x20%s,\x20%s',_0x14322d,_0x329bd8[_0x05f8('0x21')][_0x05f8('0x23')]);return _0x22632d(_0x329bd8[_0x05f8('0x21')]['message']);}logger[_0x05f8('0x21')](_0x05f8('0x1d'),_0x14322d,_0x329bd8['error'][_0x05f8('0x23')]);return _0x5ea395(_0x329bd8[_0x05f8('0x21')][_0x05f8('0x23')]);}else{logger[_0x05f8('0x1c')]('Setting,\x20%s,\x20%s',_0x14322d,_0x05f8('0x1e'));_0x5ea395(_0x329bd8['result'][_0x05f8('0x23')]);}})['catch'](function(_0x366d50){logger[_0x05f8('0x21')](_0x05f8('0x1d'),_0x14322d,_0x366d50);_0x22632d(_0x366d50);});});}function respondWithStatusCode(_0x3dd422,_0xa36c66){_0xa36c66=_0xa36c66||0xcc;return function(_0x33c5f3){if(_0x33c5f3){return _0x3dd422[_0x05f8('0x24')](_0xa36c66);}return _0x3dd422[_0x05f8('0x25')](_0xa36c66)['end']();};}function respondWithResult(_0x6f3507,_0xef4369){_0xef4369=_0xef4369||0xc8;return function(_0x40e57e){if(_0x40e57e){return _0x6f3507[_0x05f8('0x25')](_0xef4369)['json'](_0x40e57e);}};}function respondWithFilteredResult(_0xec2512,_0x51a472){return function(_0x1bf02d){if(_0x1bf02d){var _0x2b48b7=_0x1bf02d[_0x05f8('0x26')],_0x7eea01=_0x51a472[_0x05f8('0x27')],_0x12d17f=_0x51a472['offset']+_0x51a472[_0x05f8('0x28')],_0x140ce0;if(_0x12d17f>=_0x2b48b7){_0x12d17f=_0x2b48b7;_0x140ce0=0xc8;}else{_0x140ce0=0xce;}_0xec2512[_0x05f8('0x25')](_0x140ce0);return _0xec2512[_0x05f8('0x29')](_0x05f8('0x2a'),_0x7eea01+'-'+_0x12d17f+'/'+_0x2b48b7)[_0x05f8('0x2b')](_0x1bf02d);}return null;};}function patchUpdates(_0x103001){return function(_0x1c2126){try{jsonpatch['apply'](_0x1c2126,_0x103001,!![]);}catch(_0x316020){return BPromise[_0x05f8('0x2c')](_0x316020);}return _0x1c2126['save']();};}function saveUpdates(_0x18d495,_0x409e98){return function(_0x2f4509){if(_0x2f4509){return _0x2f4509[_0x05f8('0x2d')](_0x18d495)[_0x05f8('0x1b')](function(_0x5a4dbe){return _0x5a4dbe;});}return null;};}function removeEntity(_0x57687b,_0x29fdd6){return function(_0x2260b1){if(_0x2260b1){return _0x2260b1[_0x05f8('0x2e')]()['then'](function(){_0x57687b['status'](0xcc)[_0x05f8('0x2f')]();});}};}function handleEntityNotFound(_0x4cb1b4,_0x1ab6f1){return function(_0x45ed8d){if(!_0x45ed8d){_0x4cb1b4[_0x05f8('0x24')](0x194);}return _0x45ed8d;};}function handleError(_0x57db6c,_0x1c781a){_0x1c781a=_0x1c781a||0x1f4;return function(_0x5b0e24){logger[_0x05f8('0x21')](_0x5b0e24[_0x05f8('0x30')]);if(_0x5b0e24[_0x05f8('0x31')]){delete _0x5b0e24[_0x05f8('0x31')];}_0x57db6c[_0x05f8('0x25')](_0x1c781a)[_0x05f8('0x32')](_0x5b0e24);};}exports[_0x05f8('0x33')]=function(_0x426e34,_0x269548){var _0x50c805={},_0x5c3373={},_0xc2e27d={'count':0x0,'rows':[]};var _0x24ee51=db[_0x05f8('0x34')][_0x05f8('0x35')];_0x5c3373[_0x05f8('0x36')]=_['keys'](_0x24ee51);_0x5c3373[_0x05f8('0x37')]=_[_0x05f8('0x38')](_0x426e34[_0x05f8('0x37')]);_0x5c3373[_0x05f8('0x39')]=_[_0x05f8('0x3a')](_0x5c3373['model'],_0x5c3373[_0x05f8('0x37')]);_0x50c805['attributes']=_[_0x05f8('0x3a')](_0x5c3373[_0x05f8('0x36')],qs[_0x05f8('0x3b')](_0x426e34[_0x05f8('0x37')][_0x05f8('0x3b')]));_0x50c805['attributes']=_0x50c805[_0x05f8('0x3c')][_0x05f8('0x3d')]?_0x50c805[_0x05f8('0x3c')]:_0x5c3373[_0x05f8('0x36')];if(!_0x426e34[_0x05f8('0x37')][_0x05f8('0x3e')](_0x05f8('0x3f'))){_0x50c805[_0x05f8('0x28')]=qs[_0x05f8('0x28')](_0x426e34[_0x05f8('0x37')]['limit']);_0x50c805[_0x05f8('0x27')]=qs['offset'](_0x426e34[_0x05f8('0x37')][_0x05f8('0x27')]);}_0x50c805[_0x05f8('0x40')]=qs['sort'](_0x426e34[_0x05f8('0x37')][_0x05f8('0x41')]);_0x50c805['where']=qs[_0x05f8('0x39')](_[_0x05f8('0x42')](_0x426e34['query'],_0x5c3373['filters']));if(_0x426e34['query']['filter']){_0x50c805[_0x05f8('0x43')]=_[_0x05f8('0x44')](_0x50c805[_0x05f8('0x43')],{'$or':_[_0x05f8('0x45')](_0x24ee51,function(_0xc9e904){if(_0xc9e904['type'][_0x05f8('0x46')]!==_0x05f8('0x47')){var _0x43feef={};_0x43feef[_0xc9e904[_0x05f8('0x48')]]={'$like':'%'+_0x426e34[_0x05f8('0x37')][_0x05f8('0x49')]+'%'};return _0x43feef;}})});}_0x50c805=_['merge']({},_0x50c805,_0x426e34[_0x05f8('0x4a')]);var _0x4c956b={'where':_0x50c805[_0x05f8('0x43')]};return db[_0x05f8('0x34')][_0x05f8('0x26')](_0x4c956b)[_0x05f8('0x1b')](function(_0x262dae){_0xc2e27d[_0x05f8('0x26')]=_0x262dae;if(_0x426e34[_0x05f8('0x37')][_0x05f8('0x4b')]){_0x50c805[_0x05f8('0x4c')]=[{'all':!![]}];}return db[_0x05f8('0x34')][_0x05f8('0x4d')](_0x50c805);})['then'](function(_0x237098){_0xc2e27d[_0x05f8('0x4e')]=_0x237098;return _0xc2e27d;})[_0x05f8('0x1b')](respondWithFilteredResult(_0x269548,_0x50c805))[_0x05f8('0x4f')](handleError(_0x269548,null));};exports[_0x05f8('0x50')]=function(_0x397197,_0x34af44){var _0x18134b={'raw':![],'where':{'id':_0x397197['params']['id']}},_0x4ddf1a={};_0x4ddf1a['model']=_[_0x05f8('0x38')](db[_0x05f8('0x34')]['rawAttributes']);_0x4ddf1a[_0x05f8('0x37')]=_[_0x05f8('0x38')](_0x397197[_0x05f8('0x37')]);_0x4ddf1a[_0x05f8('0x39')]=_['intersection'](_0x4ddf1a[_0x05f8('0x36')],_0x4ddf1a['query']);_0x18134b[_0x05f8('0x3c')]=_[_0x05f8('0x3a')](_0x4ddf1a[_0x05f8('0x36')],qs['fields'](_0x397197[_0x05f8('0x37')][_0x05f8('0x3b')]));_0x18134b[_0x05f8('0x3c')]=_0x18134b['attributes']['length']?_0x18134b[_0x05f8('0x3c')]:_0x4ddf1a['model'];if(_0x397197[_0x05f8('0x37')]['includeAll']){_0x18134b[_0x05f8('0x4c')]=[{'all':!![]}];}_0x18134b=_[_0x05f8('0x44')]({},_0x18134b,_0x397197['options']);return db[_0x05f8('0x34')][_0x05f8('0x51')](_0x18134b)[_0x05f8('0x1b')](handleEntityNotFound(_0x34af44,null))[_0x05f8('0x1b')](respondWithResult(_0x34af44,null))[_0x05f8('0x4f')](handleError(_0x34af44,null));};exports[_0x05f8('0x2d')]=function(_0x18d0f7,_0x56714e,_0x29af53){var _0x22cc67;return db[_0x05f8('0x34')]['find']({'where':{'id':_0x18d0f7[_0x05f8('0x52')]['id']}})[_0x05f8('0x1b')](handleEntityNotFound(_0x56714e,null))[_0x05f8('0x1b')](saveUpdates(_0x18d0f7[_0x05f8('0x53')],null))['then'](function(_0x19d28f){if(_0x19d28f){_0x22cc67=_0x19d28f[_0x05f8('0x54')]({'plain':!![]});var _0x35b2e0=fs[_0x05f8('0x55')](path['join'](config[_0x05f8('0x56')],'server/files/templates/stun.ejs'),'utf8');var _0x3b41d2=ejs[_0x05f8('0x57')](_0x35b2e0,_0x22cc67);var _0x543fc1=fs[_0x05f8('0x55')](path[_0x05f8('0x58')](config['root'],'server/files/templates/turn.ejs'),_0x05f8('0x59'));var _0x373858=ejs[_0x05f8('0x57')](_0x543fc1,_0x22cc67);fs[_0x05f8('0x5a')](_0x05f8('0x5b'),_0x3b41d2);fs['writeFileSync'](_0x05f8('0x5c'),_0x373858);return respondWithRpcPromise(_0x05f8('0x5d'),_0x05f8('0x2d'),{'module':_0x05f8('0x5e')});}})[_0x05f8('0x1b')](function(){return respondWithRpcPromise(_0x05f8('0x5d'),_0x05f8('0x2d'),{'module':'res_rtp_asterisk.so'});})[_0x05f8('0x1b')](function(){return _0x22cc67||null;})[_0x05f8('0x1b')](respondWithResult(_0x56714e,null))['catch'](handleError(_0x56714e,null));};exports[_0x05f8('0x5f')]=function(_0x223e21,_0x2f5e36,_0x56d7a3){if(_0x223e21['file']&&_0x223e21[_0x05f8('0x60')][_0x05f8('0x61')]){_0x223e21[_0x05f8('0x53')][_0x05f8('0x62')]=_0x223e21[_0x05f8('0x60')][_0x05f8('0x61')];}return db['Setting'][_0x05f8('0x51')]({'where':{'id':_0x223e21[_0x05f8('0x52')]['id']}})[_0x05f8('0x1b')](handleEntityNotFound(_0x2f5e36,null))[_0x05f8('0x1b')](saveUpdates(_0x223e21['body'],null))['then'](respondWithResult(_0x2f5e36,null))['catch'](handleError(_0x2f5e36,null));};exports[_0x05f8('0x63')]=function(_0x183769,_0x20c726,_0x74b385){if(_0x183769[_0x05f8('0x60')]&&_0x183769[_0x05f8('0x60')][_0x05f8('0x61')]){_0x183769[_0x05f8('0x53')][_0x05f8('0x64')]=_0x183769[_0x05f8('0x60')][_0x05f8('0x61')];}return db[_0x05f8('0x34')][_0x05f8('0x51')]({'where':{'id':_0x183769[_0x05f8('0x52')]['id']}})['then'](handleEntityNotFound(_0x20c726,null))['then'](saveUpdates(_0x183769[_0x05f8('0x53')],null))['then'](respondWithResult(_0x20c726,null))[_0x05f8('0x4f')](handleError(_0x20c726,null));};var utilLicense=require(_0x05f8('0x65'));exports['getLogo']=function(_0x1207a1,_0x89aacd,_0x3c899e){var _0x126e07=_0x05f8('0x66');var _0x1f6d35={'custom':![]};return utilLicense[_0x05f8('0x67')]()[_0x05f8('0x1b')](function(_0xb10cb1){if(_0xb10cb1){_0x1f6d35=_0xb10cb1;}return db['Setting']['find']({'where':{'id':_0x1207a1[_0x05f8('0x52')]['id']},'attributes':[_0x05f8('0x62'),_0x05f8('0x64'),_0x05f8('0x68'),'defaultLogo',_0x05f8('0x69'),_0x05f8('0x6a')],'raw':!![]});})[_0x05f8('0x1b')](handleEntityNotFound(_0x89aacd,null))[_0x05f8('0x1b')](function(_0x272bd5){if(_0x272bd5){var _0x38cdf9=_0x272bd5[_0x05f8('0x62')]&&fs[_0x05f8('0x6b')](path[_0x05f8('0x58')](config['root'],_0x126e07,_['toLower'](_0x272bd5[_0x05f8('0x62')])))?path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x126e07,_[_0x05f8('0x6c')](_0x272bd5[_0x05f8('0x62')])):path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x126e07,_[_0x05f8('0x6c')](_0x05f8('0x6d')));var _0x596980=_0x05f8('0x6e')+_[_0x05f8('0x6f')](_0x05f8('0x62'));if(_0x272bd5[_0x596980]||!_0x1f6d35['custom']){_0x38cdf9=path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x126e07,_[_0x05f8('0x6c')](_0x05f8('0x6d')));}if(!fs[_0x05f8('0x6b')](_0x38cdf9)){throw new db[(_0x05f8('0x70'))]['ValidationError'](_0x05f8('0x71'));}return _0x89aacd['download'](_0x38cdf9);}})[_0x05f8('0x4f')](handleError(_0x89aacd,null));};var utilLicense=require('../../config/license/util');exports[_0x05f8('0x72')]=function(_0x4361bf,_0x12508,_0x1ac6b5){var _0x291a80='server/files/images/logos';var _0x2279f5={'custom':![]};return utilLicense[_0x05f8('0x67')]()['then'](function(_0x4b3780){if(_0x4b3780){_0x2279f5=_0x4b3780;}return db[_0x05f8('0x34')]['find']({'where':{'id':_0x4361bf[_0x05f8('0x52')]['id']},'attributes':[_0x05f8('0x62'),_0x05f8('0x64'),_0x05f8('0x68'),_0x05f8('0x73'),_0x05f8('0x69'),_0x05f8('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x12508,null))['then'](function(_0x24f6e9){if(_0x24f6e9){var _0x1d12c2=_0x24f6e9[_0x05f8('0x64')]&&fs[_0x05f8('0x6b')](path['join'](config[_0x05f8('0x56')],_0x291a80,_[_0x05f8('0x6c')](_0x24f6e9[_0x05f8('0x64')])))?path['join'](config[_0x05f8('0x56')],_0x291a80,_[_0x05f8('0x6c')](_0x24f6e9[_0x05f8('0x64')])):path[_0x05f8('0x58')](config['root'],_0x291a80,_[_0x05f8('0x6c')]('default_loginLogo.png'));var _0x51950b='default'+_[_0x05f8('0x6f')]('loginLogo');if(_0x24f6e9[_0x51950b]||!_0x2279f5[_0x05f8('0x74')]){_0x1d12c2=path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x291a80,_[_0x05f8('0x6c')](_0x05f8('0x75')));}if(!fs[_0x05f8('0x6b')](_0x1d12c2)){throw new db['Sequelize'][(_0x05f8('0x76'))](_0x05f8('0x71'));}return _0x12508[_0x05f8('0x77')](_0x1d12c2);}})[_0x05f8('0x4f')](handleError(_0x12508,null));};exports[_0x05f8('0x78')]=function(_0x145f83,_0x5497ab){return db['Setting']['find']({'where':{'id':_0x145f83[_0x05f8('0x52')]['id']},'attributes':[_0x05f8('0x79')]})[_0x05f8('0x1b')](respondWithResult(_0x5497ab,null))[_0x05f8('0x4f')](handleError(_0x5497ab,null));};exports[_0x05f8('0x7a')]=function(_0x2b1b1c,_0x399042,_0x56481c){if(_0x2b1b1c[_0x05f8('0x60')]&&_0x2b1b1c[_0x05f8('0x60')]['filename']){_0x2b1b1c[_0x05f8('0x53')]['preferred']=_0x2b1b1c[_0x05f8('0x60')]['filename'];}return db[_0x05f8('0x34')][_0x05f8('0x51')]({'where':{'id':_0x2b1b1c[_0x05f8('0x52')]['id']}})[_0x05f8('0x1b')](handleEntityNotFound(_0x399042,null))[_0x05f8('0x1b')](saveUpdates(_0x2b1b1c['body'],null))[_0x05f8('0x1b')](respondWithResult(_0x399042,null))['catch'](handleError(_0x399042,null));};var utilLicense=require(_0x05f8('0x65'));exports['getPreferred']=function(_0x2f64b1,_0x3b0f4e,_0x2aa80d){var _0x299ee7='server/files/images/logos';var _0x521f06={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1c1f0b){if(_0x1c1f0b){_0x521f06=_0x1c1f0b;}return db['Setting'][_0x05f8('0x51')]({'where':{'id':_0x2f64b1[_0x05f8('0x52')]['id']},'attributes':[_0x05f8('0x62'),_0x05f8('0x64'),_0x05f8('0x68'),_0x05f8('0x73'),_0x05f8('0x69'),'defaultPreferred'],'raw':!![]});})[_0x05f8('0x1b')](handleEntityNotFound(_0x3b0f4e,null))['then'](function(_0x473eab){if(_0x473eab){var _0x58dddd=_0x473eab[_0x05f8('0x68')]&&fs[_0x05f8('0x6b')](path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x299ee7,_[_0x05f8('0x6c')](_0x473eab[_0x05f8('0x68')])))?path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x299ee7,_[_0x05f8('0x6c')](_0x473eab[_0x05f8('0x68')])):path[_0x05f8('0x58')](config['root'],_0x299ee7,_['toLower'](_0x05f8('0x7b')));var _0x53c015=_0x05f8('0x6e')+_[_0x05f8('0x6f')](_0x05f8('0x68'));if(_0x473eab[_0x53c015]||!_0x521f06[_0x05f8('0x74')]||!_0x521f06[_0x05f8('0x68')]){_0x58dddd=path[_0x05f8('0x58')](config[_0x05f8('0x56')],_0x299ee7,_[_0x05f8('0x6c')](_0x05f8('0x7b')));}if(!fs[_0x05f8('0x6b')](_0x58dddd)){throw new db[(_0x05f8('0x70'))][(_0x05f8('0x76'))](_0x05f8('0x71'));}return _0x3b0f4e['download'](_0x58dddd);}})['catch'](handleError(_0x3b0f4e,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b7f3b6b..6087fba 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 _0x7113=['../../config/logger','api','moment','bluebird','path','../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','util'];(function(_0x28bcbc,_0x30ec21){var _0x3a814e=function(_0x175dc0){while(--_0x175dc0){_0x28bcbc['push'](_0x28bcbc['shift']());}};_0x3a814e(++_0x30ec21);}(_0x7113,0x73));var _0x3711=function(_0x15ef66,_0x4919e6){_0x15ef66=_0x15ef66-0x0;var _0x12f7a7=_0x7113[_0x15ef66];return _0x12f7a7;};'use strict';var _=require(_0x3711('0x0'));var util=require(_0x3711('0x1'));var logger=require(_0x3711('0x2'))(_0x3711('0x3'));var moment=require(_0x3711('0x4'));var BPromise=require(_0x3711('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3711('0x6'));var rimraf=require('rimraf');var config=require(_0x3711('0x7'));var attributes=require(_0x3711('0x8'));module[_0x3711('0x9')]=function(_0x434163,_0x2862fd){return _0x434163[_0x3711('0xa')](_0x3711('0xb'),attributes,{'tableName':_0x3711('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9128=['rimraf','../../config/environment','./setting.attributes','Setting','settings','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9128,0x1a7));var _0x8912=function(_0x4df69e,_0x5131d5){_0x4df69e=_0x4df69e-0x0;var _0x1f9041=_0x9128[_0x4df69e];return _0x1f9041;};'use strict';var _=require(_0x8912('0x0'));var util=require(_0x8912('0x1'));var logger=require(_0x8912('0x2'))('api');var moment=require(_0x8912('0x3'));var BPromise=require(_0x8912('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8912('0x5'));var rimraf=require(_0x8912('0x6'));var config=require(_0x8912('0x7'));var attributes=require(_0x8912('0x8'));module['exports']=function(_0x1d0966,_0x3f6c8d){return _0x1d0966['define'](_0x8912('0x9'),attributes,{'tableName':_0x8912('0xa'),'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 d16e9b7..e90f0ed 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 _0xfc80=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x840b8a,_0xbb3434){var _0x4f2fc0=function(_0x341327){while(--_0x341327){_0x840b8a['push'](_0x840b8a['shift']());}};_0x4f2fc0(++_0xbb3434);}(_0xfc80,0x17c));var _0x0fc8=function(_0xa1b2,_0x4f4ebe){_0xa1b2=_0xa1b2-0x0;var _0x4329d8=_0xfc80[_0xa1b2];return _0x4329d8;};'use strict';var _=require(_0x0fc8('0x0'));var util=require(_0x0fc8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fc8('0x2'));var fs=require('fs');var Redis=require(_0x0fc8('0x3'));var db=require(_0x0fc8('0x4'))['db'];var utils=require(_0x0fc8('0x5'));var logger=require(_0x0fc8('0x6'))(_0x0fc8('0x7'));var config=require(_0x0fc8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0fc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29fb8e,_0x4026a4,_0x4e229d){return new BPromise(function(_0x403e65,_0x28cb3a){return client[_0x0fc8('0xa')](_0x29fb8e,_0x4e229d)[_0x0fc8('0xb')](function(_0x36ca63){logger[_0x0fc8('0xc')](_0x0fc8('0xd'),_0x4026a4,_0x0fc8('0xe'));logger[_0x0fc8('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x4026a4,_0x0fc8('0xe'),JSON[_0x0fc8('0x10')](_0x36ca63));if(_0x36ca63[_0x0fc8('0x11')]){if(_0x36ca63[_0x0fc8('0x11')][_0x0fc8('0x12')]===0x1f4){logger[_0x0fc8('0x11')](_0x0fc8('0xd'),_0x4026a4,_0x36ca63['error'][_0x0fc8('0x13')]);return _0x28cb3a(_0x36ca63[_0x0fc8('0x11')]['message']);}logger[_0x0fc8('0x11')](_0x0fc8('0xd'),_0x4026a4,_0x36ca63[_0x0fc8('0x11')]['message']);return _0x403e65(_0x36ca63[_0x0fc8('0x11')][_0x0fc8('0x13')]);}else{logger[_0x0fc8('0xc')]('Setting,\x20%s,\x20%s',_0x4026a4,_0x0fc8('0xe'));_0x403e65(_0x36ca63[_0x0fc8('0x14')][_0x0fc8('0x13')]);}})[_0x0fc8('0x15')](function(_0x5b86c4){logger['error']('Setting,\x20%s,\x20%s',_0x4026a4,_0x5b86c4);_0x28cb3a(_0x5b86c4);});});} \ No newline at end of file +var _0xb103=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','info','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s'];(function(_0xaec00f,_0x2a2d42){var _0x4baddd=function(_0x507ba7){while(--_0x507ba7){_0xaec00f['push'](_0xaec00f['shift']());}};_0x4baddd(++_0x2a2d42);}(_0xb103,0x79));var _0x3b10=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xb103[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var moment=require('moment');var BPromise=require(_0x3b10('0x2'));var rs=require(_0x3b10('0x3'));var fs=require('fs');var Redis=require(_0x3b10('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b10('0x5'));var logger=require('../../config/logger')(_0x3b10('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b10('0x7')][_0x3b10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17bec1,_0x367364,_0x57b5eb){return new BPromise(function(_0x5c9ec4,_0x285b55){return client['request'](_0x17bec1,_0x57b5eb)['then'](function(_0x5ec761){logger[_0x3b10('0x9')]('Setting,\x20%s,\x20%s',_0x367364,_0x3b10('0xa'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x367364,_0x3b10('0xa'),JSON[_0x3b10('0xb')](_0x5ec761));if(_0x5ec761[_0x3b10('0xc')]){if(_0x5ec761[_0x3b10('0xc')][_0x3b10('0xd')]===0x1f4){logger['error'](_0x3b10('0xe'),_0x367364,_0x5ec761[_0x3b10('0xc')][_0x3b10('0xf')]);return _0x285b55(_0x5ec761['error'][_0x3b10('0xf')]);}logger[_0x3b10('0xc')](_0x3b10('0xe'),_0x367364,_0x5ec761[_0x3b10('0xc')]['message']);return _0x5c9ec4(_0x5ec761['error'][_0x3b10('0xf')]);}else{logger[_0x3b10('0x9')](_0x3b10('0xe'),_0x367364,_0x3b10('0xa'));_0x5c9ec4(_0x5ec761['result'][_0x3b10('0xf')]);}})[_0x3b10('0x10')](function(_0x1b6f35){logger['error'](_0x3b10('0xe'),_0x367364,_0x1b6f35);_0x285b55(_0x1b6f35);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index a942454..9233c5d 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 _0x03c8=['isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','status','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get'];(function(_0x50533b,_0x214e47){var _0x409e30=function(_0x28ca22){while(--_0x28ca22){_0x50533b['push'](_0x50533b['shift']());}};_0x409e30(++_0x214e47);}(_0x03c8,0x9a));var _0x803c=function(_0x1625ff,_0x1b54c9){_0x1625ff=_0x1625ff-0x0;var _0x1d02b6=_0x03c8[_0x1625ff];return _0x1d02b6;};'use strict';var multer=require(_0x803c('0x0'));var util=require(_0x803c('0x1'));var path=require(_0x803c('0x2'));var timeout=require(_0x803c('0x3'));var express=require(_0x803c('0x4'));var router=express['Router']();var auth=require(_0x803c('0x5'));var interaction=require(_0x803c('0x6'));var config=require(_0x803c('0x7'));var controller=require(_0x803c('0x8'));router[_0x803c('0x9')]('/',auth[_0x803c('0xa')](),controller[_0x803c('0xb')]);router[_0x803c('0x9')](_0x803c('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x803c('0x9')]('/:id',auth[_0x803c('0xa')](),controller[_0x803c('0xd')]);router['get'](_0x803c('0xe'),auth[_0x803c('0xa')](),controller[_0x803c('0xf')]);router[_0x803c('0x9')](_0x803c('0x10'),auth[_0x803c('0xa')](),controller[_0x803c('0x11')]);router[_0x803c('0x9')](_0x803c('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0x803c('0x9')](_0x803c('0x13'),auth[_0x803c('0xa')](),controller[_0x803c('0x14')]);router['get'](_0x803c('0x15'),controller[_0x803c('0x16')]);router[_0x803c('0x9')](_0x803c('0x17'),auth[_0x803c('0xa')](),controller['getAgents']);router[_0x803c('0x18')]('/',auth['isAuthenticated'](),controller[_0x803c('0x19')]);router[_0x803c('0x18')](_0x803c('0xe'),auth[_0x803c('0xa')](),controller[_0x803c('0x1a')]);router[_0x803c('0x18')]('/:id/canned_answers',auth[_0x803c('0xa')](),controller[_0x803c('0x1b')]);router['post'](_0x803c('0x1c'),controller[_0x803c('0x1d')]);router[_0x803c('0x18')](_0x803c('0x12'),auth[_0x803c('0xa')](),controller[_0x803c('0x1e')]);router[_0x803c('0x18')](_0x803c('0x1f'),auth[_0x803c('0xa')](),controller[_0x803c('0x20')]);router['post'](_0x803c('0x15'),controller[_0x803c('0x21')]);router[_0x803c('0x18')](_0x803c('0x17'),auth[_0x803c('0xa')](),controller['addAgents']);router['put'](_0x803c('0x22'),auth[_0x803c('0xa')](),controller[_0x803c('0x23')]);router[_0x803c('0x24')](_0x803c('0x22'),auth['isAuthenticated'](),controller['destroy']);router[_0x803c('0x24')](_0x803c('0xe'),auth[_0x803c('0xa')](),controller[_0x803c('0x25')]);router['delete']('/:id/canned_answers',auth[_0x803c('0xa')](),controller[_0x803c('0x26')]);router[_0x803c('0x24')](_0x803c('0x17'),auth[_0x803c('0xa')](),controller[_0x803c('0x27')]);module[_0x803c('0x28')]=router; \ No newline at end of file +var _0x492f=['post','create','addAnswer','notify','addApplications','send','status','addAgents','put','update','delete','removeDispositions','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/status','statusGet','/:id/users','getAgents'];(function(_0x972ed1,_0x2337db){var _0x4d8726=function(_0x1161e6){while(--_0x1161e6){_0x972ed1['push'](_0x972ed1['shift']());}};_0x4d8726(++_0x2337db);}(_0x492f,0x12d));var _0xf492=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0x492f[_0x21d532];return _0x37bda1;};'use strict';var multer=require(_0xf492('0x0'));var util=require('util');var path=require(_0xf492('0x1'));var timeout=require('connect-timeout');var express=require(_0xf492('0x2'));var router=express[_0xf492('0x3')]();var auth=require(_0xf492('0x4'));var interaction=require(_0xf492('0x5'));var config=require('../../config/environment');var controller=require(_0xf492('0x6'));router['get']('/',auth[_0xf492('0x7')](),controller['index']);router['get'](_0xf492('0x8'),auth[_0xf492('0x7')](),controller[_0xf492('0x9')]);router[_0xf492('0xa')](_0xf492('0xb'),auth['isAuthenticated'](),controller[_0xf492('0xc')]);router[_0xf492('0xa')](_0xf492('0xd'),auth[_0xf492('0x7')](),controller[_0xf492('0xe')]);router[_0xf492('0xa')](_0xf492('0xf'),auth[_0xf492('0x7')](),controller[_0xf492('0x10')]);router[_0xf492('0xa')](_0xf492('0x11'),auth[_0xf492('0x7')](),controller['getApplications']);router[_0xf492('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf492('0x12')]);router['get'](_0xf492('0x13'),controller[_0xf492('0x14')]);router[_0xf492('0xa')](_0xf492('0x15'),auth['isAuthenticated'](),controller[_0xf492('0x16')]);router[_0xf492('0x17')]('/',auth[_0xf492('0x7')](),controller[_0xf492('0x18')]);router['post'](_0xf492('0xd'),auth[_0xf492('0x7')](),controller['addDisposition']);router[_0xf492('0x17')](_0xf492('0xf'),auth[_0xf492('0x7')](),controller[_0xf492('0x19')]);router[_0xf492('0x17')]('/:id/notify',controller[_0xf492('0x1a')]);router[_0xf492('0x17')]('/:id/applications',auth[_0xf492('0x7')](),controller[_0xf492('0x1b')]);router[_0xf492('0x17')]('/:id/send',auth[_0xf492('0x7')](),controller[_0xf492('0x1c')]);router['post'](_0xf492('0x13'),controller[_0xf492('0x1d')]);router[_0xf492('0x17')](_0xf492('0x15'),auth[_0xf492('0x7')](),controller[_0xf492('0x1e')]);router[_0xf492('0x1f')](_0xf492('0xb'),auth[_0xf492('0x7')](),controller[_0xf492('0x20')]);router[_0xf492('0x21')](_0xf492('0xb'),auth[_0xf492('0x7')](),controller['destroy']);router[_0xf492('0x21')](_0xf492('0xd'),auth[_0xf492('0x7')](),controller[_0xf492('0x22')]);router[_0xf492('0x21')](_0xf492('0xf'),auth[_0xf492('0x7')](),controller['removeAnswers']);router[_0xf492('0x21')](_0xf492('0x15'),auth[_0xf492('0x7')](),controller['removeAgents']);module[_0xf492('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 25649b6..e23395b 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 _0x5c3d=['twilio','clicksend','plivo','clickatell','csc','infobip','intelepeer','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','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate'];(function(_0x97435b,_0x3972c7){var _0x30feb9=function(_0x43d373){while(--_0x43d373){_0x97435b['push'](_0x97435b['shift']());}};_0x30feb9(++_0x3972c7);}(_0x5c3d,0x93));var _0xd5c3=function(_0x265fd6,_0x1db46e){_0x265fd6=_0x265fd6-0x0;var _0x2b83a9=_0x5c3d[_0x265fd6];return _0x2b83a9;};'use strict';var Sequelize=require(_0xd5c3('0x0'));var rs=require('randomstring');module[_0xd5c3('0x1')]={'name':{'type':Sequelize[_0xd5c3('0x2')],'unique':_0xd5c3('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xd5c3('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd5c3('0x4')]();}},'phone':{'type':Sequelize[_0xd5c3('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd5c3('0x5'),'skebby','connectel',_0xd5c3('0x6'),_0xd5c3('0x7'),_0xd5c3('0x8'),_0xd5c3('0x9'),_0xd5c3('0xa'),_0xd5c3('0xb'))},'accountSid':{'type':Sequelize[_0xd5c3('0x2')]},'authId':{'type':Sequelize[_0xd5c3('0x2')]},'authToken':{'type':Sequelize[_0xd5c3('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd5c3('0x2')]},'apiKey':{'type':Sequelize[_0xd5c3('0x2')]},'senderString':{'type':Sequelize[_0xd5c3('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd5c3('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd5c3('0xc')],'defaultValue':function(){return _0xd5c3('0xd');}},'notificationSound':{'type':Sequelize[_0xd5c3('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd5c3('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd5c3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd5c3('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd5c3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd5c3('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd5c3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd5c3('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd5c3('0xf')],'comment':_0xd5c3('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xd5c3('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11fb2e){if(!_0x11fb2e)this[_0xd5c3('0x11')](_0xd5c3('0x12'),null);this[_0xd5c3('0x11')]('mandatoryDisposition',_0x11fb2e);}}}; \ No newline at end of file +var _0x9920=['ENUM','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x23ac53,_0x40b6ba){var _0x36f04f=function(_0x18f670){while(--_0x18f670){_0x23ac53['push'](_0x23ac53['shift']());}};_0x36f04f(++_0x40b6ba);}(_0x9920,0x1dd));var _0x0992=function(_0x392cfa,_0x16eca7){_0x392cfa=_0x392cfa-0x0;var _0x38ba40=_0x9920[_0x392cfa];return _0x38ba40;};'use strict';var Sequelize=require(_0x0992('0x0'));var rs=require(_0x0992('0x1'));module[_0x0992('0x2')]={'name':{'type':Sequelize[_0x0992('0x3')],'unique':_0x0992('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x0992('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0992('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0992('0x3')],'defaultValue':function(){return rs[_0x0992('0x5')]();}},'phone':{'type':Sequelize[_0x0992('0x3')]},'type':{'type':Sequelize[_0x0992('0x6')]('twilio',_0x0992('0x7'),_0x0992('0x8'),_0x0992('0x9'),_0x0992('0xa'),_0x0992('0xb'),_0x0992('0xc'),_0x0992('0xd'),_0x0992('0xe'))},'accountSid':{'type':Sequelize[_0x0992('0x3')]},'authId':{'type':Sequelize[_0x0992('0x3')]},'authToken':{'type':Sequelize[_0x0992('0x3')]},'smsMethod':{'type':Sequelize[_0x0992('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0992('0x3')]},'password':{'type':Sequelize[_0x0992('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x0992('0x3')]},'deliveryReport':{'type':Sequelize[_0x0992('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x0992('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0992('0x10');}},'notificationSound':{'type':Sequelize[_0x0992('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0992('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0992('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0992('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0992('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0992('0x11')],'comment':_0x0992('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0992('0xf')],'defaultValue':![],'comment':_0x0992('0x13'),'set':function(_0x3cc997){if(!_0x3cc997)this[_0x0992('0x14')](_0x0992('0x15'),null);this['setDataValue'](_0x0992('0x16'),_0x3cc997);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4a81c80..3beb2b7 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 _0xe0b8=['defaults','localhost','socket.io-emitter','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','stack','send','index','Pause','mandatoryDispositionPause','SmsAccount','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','name','update','body','describe','addDisposition','SmsAccountId','Disposition','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','sms','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','From','Text','MessageUUID','results','segmentedMessage','fromNumber','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','DESC','SmsMessage','Messages','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','clickatell','redif','connectel','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','state','message-id','csc','addAgents','spread','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis'];(function(_0x2975f1,_0x509c70){var _0x187204=function(_0x3b2bef){while(--_0x3b2bef){_0x2975f1['push'](_0x2975f1['shift']());}};_0x187204(++_0x509c70);}(_0xe0b8,0x1ad));var _0x8e0b=function(_0x529bf1,_0x2d7dcb){_0x529bf1=_0x529bf1-0x0;var _0x514cb5=_0xe0b8[_0x529bf1];return _0x514cb5;};'use strict';var pdf=require(_0x8e0b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e0b('0x1'));var rp=require(_0x8e0b('0x2'));var moment=require(_0x8e0b('0x3'));var BPromise=require(_0x8e0b('0x4'));var Mustache=require(_0x8e0b('0x5'));var util=require(_0x8e0b('0x6'));var path=require(_0x8e0b('0x7'));var sox=require(_0x8e0b('0x8'));var csv=require(_0x8e0b('0x9'));var ejs=require(_0x8e0b('0xa'));var fs=require('fs');var _=require(_0x8e0b('0xb'));var squel=require('squel');var crypto=require(_0x8e0b('0xc'));var jsforce=require(_0x8e0b('0xd'));var deskjs=require(_0x8e0b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8e0b('0xf'));var Papa=require(_0x8e0b('0x10'));var Redis=require(_0x8e0b('0x11'));var authService=require(_0x8e0b('0x12'));var qs=require(_0x8e0b('0x13'));var hardwareService=require(_0x8e0b('0x14'));var logger=require(_0x8e0b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8e0b('0x16'));var db=require(_0x8e0b('0x17'))['db'];config[_0x8e0b('0x18')]=_[_0x8e0b('0x19')](config[_0x8e0b('0x18')],{'host':_0x8e0b('0x1a'),'port':0x18eb});var socket=require(_0x8e0b('0x1b'))(new Redis(config[_0x8e0b('0x18')]));require('./smsAccount.socket')[_0x8e0b('0x1c')](socket);var jayson=require(_0x8e0b('0x1d'));var client=jayson['client'][_0x8e0b('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x3cbd70,_0x5b87cb,_0x12da39){if(_0x12da39){var _0x301d7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x301d7f[_0x8e0b('0x1f')](_0x5b87cb)){return _0x3cbd70;}else{throw new Error(_0x8e0b('0x20'));}}else{return _0x3cbd70;}}function respondWithRpcPromise(_0x520fb8,_0xe565d,_0x2c8842,_0xded6b1){return new BPromise(function(_0x37cdee,_0x306ea2){var _0x5d4861=_0xded6b1||client;return _0x5d4861[_0x8e0b('0x21')](_0x520fb8,_0x2c8842)[_0x8e0b('0x22')](function(_0x27bbc7){logger['info'](_0x8e0b('0x23'),_0xe565d,_0x8e0b('0x24'));logger['debug'](_0x8e0b('0x25'),_0xe565d,_0x8e0b('0x24'),JSON[_0x8e0b('0x26')](_0x27bbc7));if(_0x27bbc7['error']){if(_0x27bbc7[_0x8e0b('0x27')]['code']===0x1f4){logger[_0x8e0b('0x27')](_0x8e0b('0x23'),_0xe565d,_0x27bbc7[_0x8e0b('0x27')][_0x8e0b('0x28')]);return _0x306ea2(_0x27bbc7[_0x8e0b('0x27')][_0x8e0b('0x28')]);}logger[_0x8e0b('0x27')]('SmsAccount,\x20%s,\x20%s',_0xe565d,_0x27bbc7[_0x8e0b('0x27')][_0x8e0b('0x28')]);return _0x37cdee(_0x27bbc7[_0x8e0b('0x27')]['message']);}else{logger[_0x8e0b('0x29')]('SmsAccount,\x20%s,\x20%s',_0xe565d,_0x8e0b('0x24'));_0x37cdee(_0x27bbc7['result'][_0x8e0b('0x28')]);}})[_0x8e0b('0x2a')](function(_0x470a90){logger[_0x8e0b('0x27')](_0x8e0b('0x23'),_0xe565d,_0x470a90);_0x306ea2(_0x470a90);});});}function respondWithStatusCode(_0x3fe08b,_0x4fa114){_0x4fa114=_0x4fa114||0xcc;return function(_0x552127){if(_0x552127){return _0x3fe08b[_0x8e0b('0x2b')](_0x4fa114);}return _0x3fe08b['status'](_0x4fa114)[_0x8e0b('0x2c')]();};}function respondWithResult(_0xc87e2d,_0x38fa83){_0x38fa83=_0x38fa83||0xc8;return function(_0xa80943){if(_0xa80943){return _0xc87e2d[_0x8e0b('0x2d')](_0x38fa83)[_0x8e0b('0x2e')](_0xa80943);}};}function respondWithFilteredResult(_0x5d2ea1,_0x418a9a){return function(_0x274ffe){if(_0x274ffe){var _0x281606=_0x274ffe['count'],_0x256eed=_0x418a9a[_0x8e0b('0x2f')],_0x3d97c2=_0x418a9a['offset']+_0x418a9a[_0x8e0b('0x30')],_0x5d52c4;if(_0x3d97c2>=_0x281606){_0x3d97c2=_0x281606;_0x5d52c4=0xc8;}else{_0x5d52c4=0xce;}_0x5d2ea1[_0x8e0b('0x2d')](_0x5d52c4);return _0x5d2ea1[_0x8e0b('0x31')](_0x8e0b('0x32'),_0x256eed+'-'+_0x3d97c2+'/'+_0x281606)[_0x8e0b('0x2e')](_0x274ffe);}return null;};}function patchUpdates(_0x2e224d){return function(_0x5a6243){try{jsonpatch[_0x8e0b('0x33')](_0x5a6243,_0x2e224d,!![]);}catch(_0x1029d2){return BPromise[_0x8e0b('0x34')](_0x1029d2);}return _0x5a6243[_0x8e0b('0x35')]();};}function saveUpdates(_0x2d0a36,_0x1e7814){return function(_0x5a7406){if(_0x5a7406){return _0x5a7406['update'](_0x2d0a36)[_0x8e0b('0x22')](function(_0x226964){return _0x226964;});}return null;};}function removeEntity(_0x248939,_0x16069a){return function(_0x119d00){if(_0x119d00){return _0x119d00[_0x8e0b('0x36')]()['then'](function(){var _0x38a773=_0x119d00[_0x8e0b('0x37')]({'plain':!![]});var _0x81d61d=_0x8e0b('0x38');return db['UserProfileResource'][_0x8e0b('0x36')]({'where':{'type':_0x81d61d,'resourceId':_0x38a773['id']}})[_0x8e0b('0x22')](function(){return _0x119d00;});})[_0x8e0b('0x22')](function(){_0x248939[_0x8e0b('0x2d')](0xcc)[_0x8e0b('0x2c')]();});}};}function handleEntityNotFound(_0x1186a0,_0x38c7d5){return function(_0x2f2f6c){if(!_0x2f2f6c){_0x1186a0['sendStatus'](0x194);}return _0x2f2f6c;};}function handleError(_0x29a445,_0x34f590){_0x34f590=_0x34f590||0x1f4;return function(_0x211399){logger['error'](_0x211399[_0x8e0b('0x39')]);if(_0x211399['name']){delete _0x211399['name'];}_0x29a445['status'](_0x34f590)[_0x8e0b('0x3a')](_0x211399);};}exports[_0x8e0b('0x3b')]=function(_0x4178cb,_0xc2d2e2){var _0x5d9b9a={'include':[{'model':db[_0x8e0b('0x3c')],'as':_0x8e0b('0x3d')}]},_0x87c4f4={},_0x542e90={'count':0x0,'rows':[]};var _0x9d6bf1=db[_0x8e0b('0x3e')]['rawAttributes'];_0x87c4f4[_0x8e0b('0x3f')]=_[_0x8e0b('0x40')](_0x9d6bf1);_0x87c4f4[_0x8e0b('0x41')]=_[_0x8e0b('0x40')](_0x4178cb[_0x8e0b('0x41')]);_0x87c4f4['filters']=_[_0x8e0b('0x42')](_0x87c4f4[_0x8e0b('0x3f')],_0x87c4f4[_0x8e0b('0x41')]);_0x5d9b9a[_0x8e0b('0x43')]=_[_0x8e0b('0x42')](_0x87c4f4[_0x8e0b('0x3f')],qs[_0x8e0b('0x44')](_0x4178cb[_0x8e0b('0x41')]['fields']));_0x5d9b9a[_0x8e0b('0x43')]=_0x5d9b9a[_0x8e0b('0x43')][_0x8e0b('0x45')]?_0x5d9b9a['attributes']:_0x87c4f4[_0x8e0b('0x3f')];if(!_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x46')](_0x8e0b('0x47'))){_0x5d9b9a[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x30')]);_0x5d9b9a[_0x8e0b('0x2f')]=qs[_0x8e0b('0x2f')](_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x2f')]);}_0x5d9b9a[_0x8e0b('0x48')]=qs['sort'](_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x49')]);_0x5d9b9a[_0x8e0b('0x4a')]=qs[_0x8e0b('0x4b')](_[_0x8e0b('0x4c')](_0x4178cb[_0x8e0b('0x41')],_0x87c4f4[_0x8e0b('0x4b')]));if(_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x4d')]){_0x5d9b9a[_0x8e0b('0x4a')]=_[_0x8e0b('0x4e')](_0x5d9b9a[_0x8e0b('0x4a')],{'$or':_[_0x8e0b('0x4f')](_0x9d6bf1,function(_0x2332e9){if(_0x2332e9[_0x8e0b('0x50')][_0x8e0b('0x51')]!==_0x8e0b('0x52')){var _0x1cbd28={};_0x1cbd28[_0x2332e9[_0x8e0b('0x53')]]={'$like':'%'+_0x4178cb[_0x8e0b('0x41')]['filter']+'%'};return _0x1cbd28;}})});}_0x5d9b9a=_[_0x8e0b('0x4e')]({},_0x5d9b9a,_0x4178cb[_0x8e0b('0x54')]);var _0x18d335={'where':_0x5d9b9a[_0x8e0b('0x4a')]};return db['SmsAccount'][_0x8e0b('0x55')](_0x18d335)[_0x8e0b('0x22')](function(_0x10501e){_0x542e90[_0x8e0b('0x55')]=_0x10501e;if(_0x4178cb[_0x8e0b('0x41')][_0x8e0b('0x56')]){_0x5d9b9a[_0x8e0b('0x57')]=[{'all':!![]}];}return db[_0x8e0b('0x3e')][_0x8e0b('0x58')](_0x5d9b9a);})[_0x8e0b('0x22')](function(_0x11e8d6){_0x542e90[_0x8e0b('0x59')]=_0x11e8d6;return _0x542e90;})[_0x8e0b('0x22')](respondWithFilteredResult(_0xc2d2e2,_0x5d9b9a))[_0x8e0b('0x2a')](handleError(_0xc2d2e2,null));};exports[_0x8e0b('0x5a')]=function(_0x5ea633,_0x2e88c8){var _0x46698b={'raw':![],'where':{'id':_0x5ea633[_0x8e0b('0x5b')]['id']},'include':[{'model':db[_0x8e0b('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2e7dd7={};_0x2e7dd7['model']=_[_0x8e0b('0x40')](db[_0x8e0b('0x3e')][_0x8e0b('0x5c')]);_0x2e7dd7[_0x8e0b('0x41')]=_[_0x8e0b('0x40')](_0x5ea633[_0x8e0b('0x41')]);_0x2e7dd7[_0x8e0b('0x4b')]=_[_0x8e0b('0x42')](_0x2e7dd7[_0x8e0b('0x3f')],_0x2e7dd7[_0x8e0b('0x41')]);_0x46698b[_0x8e0b('0x43')]=_[_0x8e0b('0x42')](_0x2e7dd7['model'],qs[_0x8e0b('0x44')](_0x5ea633['query'][_0x8e0b('0x44')]));_0x46698b[_0x8e0b('0x43')]=_0x46698b['attributes'][_0x8e0b('0x45')]?_0x46698b[_0x8e0b('0x43')]:_0x2e7dd7[_0x8e0b('0x3f')];if(_0x5ea633[_0x8e0b('0x41')][_0x8e0b('0x56')]){_0x46698b[_0x8e0b('0x57')]=[{'all':!![]}];}_0x46698b=_[_0x8e0b('0x4e')]({},_0x46698b,_0x5ea633[_0x8e0b('0x54')]);return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')](_0x46698b)['then'](handleEntityNotFound(_0x2e88c8,null))['then'](respondWithResult(_0x2e88c8,null))[_0x8e0b('0x2a')](handleError(_0x2e88c8,null));};exports[_0x8e0b('0x5e')]=function(_0x1ac5c7,_0xea5bbf){return db[_0x8e0b('0x3e')][_0x8e0b('0x5e')](_0x1ac5c7['body'],{})[_0x8e0b('0x22')](function(_0x1faa13){var _0x13a454=_0x1ac5c7[_0x8e0b('0x5f')][_0x8e0b('0x37')]({'plain':!![]});if(!_0x13a454)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13a454[_0x8e0b('0x60')]==='user'){var _0x563b56=_0x1faa13[_0x8e0b('0x37')]({'plain':!![]});var _0x4d43a9='SmsAccounts';return db['UserProfileSection'][_0x8e0b('0x5d')]({'where':{'name':_0x4d43a9,'userProfileId':_0x13a454[_0x8e0b('0x61')]},'raw':!![]})[_0x8e0b('0x22')](function(_0x3c5eb2){if(_0x3c5eb2&&_0x3c5eb2[_0x8e0b('0x62')]===0x0){return db[_0x8e0b('0x63')]['create']({'name':_0x563b56['name'],'resourceId':_0x563b56['id'],'type':_0x3c5eb2[_0x8e0b('0x64')],'sectionId':_0x3c5eb2['id']},{})[_0x8e0b('0x22')](function(){return _0x1faa13;});}else{return _0x1faa13;}})['catch'](function(_0x58d28d){logger[_0x8e0b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d28d);throw _0x58d28d;});}return _0x1faa13;})[_0x8e0b('0x22')](respondWithResult(_0xea5bbf,0xc9))[_0x8e0b('0x2a')](handleError(_0xea5bbf,null));};exports[_0x8e0b('0x65')]=function(_0x44d2d5,_0x464b4c){if(_0x44d2d5[_0x8e0b('0x66')]['id']){delete _0x44d2d5['body']['id'];}return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x44d2d5['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x464b4c,null))['then'](saveUpdates(_0x44d2d5['body'],null))[_0x8e0b('0x22')](respondWithResult(_0x464b4c,null))[_0x8e0b('0x2a')](handleError(_0x464b4c,null));};exports[_0x8e0b('0x36')]=function(_0x225d4b,_0x45e111){return db[_0x8e0b('0x3e')]['find']({'where':{'id':_0x225d4b['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x45e111,null))[_0x8e0b('0x22')](removeEntity(_0x45e111,null))[_0x8e0b('0x2a')](handleError(_0x45e111,null));};exports['describe']=function(_0x64a6af,_0x505180){return db[_0x8e0b('0x3e')][_0x8e0b('0x67')]()[_0x8e0b('0x22')](respondWithResult(_0x505180,null))['catch'](handleError(_0x505180,null));};exports[_0x8e0b('0x68')]=function(_0x4c4660,_0x4d7950,_0x3ed26a){if(_0x4c4660[_0x8e0b('0x66')]['id']){delete _0x4c4660[_0x8e0b('0x66')]['id'];}return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x4c4660[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x4d7950,null))[_0x8e0b('0x22')](function(_0x2be81c){if(_0x2be81c){_0x4c4660['body'][_0x8e0b('0x69')]=_0x2be81c['id'];return db[_0x8e0b('0x6a')][_0x8e0b('0x5e')](_0x4c4660['body']);}})['then'](respondWithResult(_0x4d7950,null))[_0x8e0b('0x2a')](handleError(_0x4d7950,null));};exports['getDispositions']=function(_0x5dad9a,_0x10bad0,_0x495ee1){var _0x3158db={'raw':![],'where':{}};var _0xeea063={};var _0x54f3d6={'count':0x0,'rows':[]};return db[_0x8e0b('0x3e')]['findOne']({'where':{'id':_0x5dad9a[_0x8e0b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x10bad0,null))[_0x8e0b('0x22')](function(_0xf02fb){if(_0xf02fb){_0xeea063['model']=_['keys'](db[_0x8e0b('0x6a')][_0x8e0b('0x5c')]);_0xeea063['query']=_[_0x8e0b('0x40')](_0x5dad9a[_0x8e0b('0x41')]);_0xeea063[_0x8e0b('0x4b')]=_[_0x8e0b('0x42')](_0xeea063['model'],_0xeea063[_0x8e0b('0x41')]);_0x3158db['attributes']=_[_0x8e0b('0x42')](_0xeea063[_0x8e0b('0x3f')],qs[_0x8e0b('0x44')](_0x5dad9a[_0x8e0b('0x41')][_0x8e0b('0x44')]));_0x3158db[_0x8e0b('0x43')]=_0x3158db[_0x8e0b('0x43')]['length']?_0x3158db['attributes']:_0xeea063[_0x8e0b('0x3f')];if(!_0x5dad9a[_0x8e0b('0x41')][_0x8e0b('0x46')](_0x8e0b('0x47'))){_0x3158db[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x5dad9a[_0x8e0b('0x41')][_0x8e0b('0x30')]);_0x3158db[_0x8e0b('0x2f')]=qs[_0x8e0b('0x2f')](_0x5dad9a[_0x8e0b('0x41')]['offset']);}_0x3158db['order']=qs['sort'](_0x5dad9a['query'][_0x8e0b('0x49')]);_0x3158db['where']=qs[_0x8e0b('0x4b')](_['pick'](_0x5dad9a['query'],_0xeea063[_0x8e0b('0x4b')]));_0x3158db[_0x8e0b('0x4a')][_0x8e0b('0x69')]=_0xf02fb['id'];if(_0x5dad9a['query'][_0x8e0b('0x4d')]){_0x3158db[_0x8e0b('0x4a')]=_[_0x8e0b('0x4e')](_0x3158db[_0x8e0b('0x4a')],{'$or':_[_0x8e0b('0x4f')](_0x3158db[_0x8e0b('0x43')],function(_0x119fad){var _0x2d755d={};_0x2d755d[_0x119fad]={'$like':'%'+_0x5dad9a['query'][_0x8e0b('0x4d')]+'%'};return _0x2d755d;})});}_0x3158db=_[_0x8e0b('0x4e')]({},_0x3158db,_0x5dad9a[_0x8e0b('0x54')]);return db[_0x8e0b('0x6a')][_0x8e0b('0x55')]({'where':_0x3158db[_0x8e0b('0x4a')]})[_0x8e0b('0x22')](function(_0x1420ad){_0x54f3d6[_0x8e0b('0x55')]=_0x1420ad;if(_0x5dad9a['query'][_0x8e0b('0x56')]){_0x3158db[_0x8e0b('0x57')]=[{'all':!![]}];}return db[_0x8e0b('0x6a')][_0x8e0b('0x58')](_0x3158db);})[_0x8e0b('0x22')](function(_0x438b3f){_0x54f3d6['rows']=_0x438b3f;return _0x54f3d6;});}})['then'](respondWithFilteredResult(_0x10bad0,_0x3158db))['catch'](handleError(_0x10bad0,null));};exports[_0x8e0b('0x6b')]=function(_0x37705c,_0x51a61b,_0x4aa08e){return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x37705c['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x51a61b,null))['then'](function(_0x4e5624){if(_0x4e5624){return _0x4e5624[_0x8e0b('0x6b')](_0x37705c[_0x8e0b('0x41')][_0x8e0b('0x6c')]);}})[_0x8e0b('0x22')](respondWithStatusCode(_0x51a61b,null))[_0x8e0b('0x2a')](handleError(_0x51a61b,null));};exports[_0x8e0b('0x6d')]=function(_0x32caad,_0x1c8612,_0x5655e4){if(_0x32caad['body']['id']){delete _0x32caad[_0x8e0b('0x66')]['id'];}return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x32caad['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x1c8612,null))[_0x8e0b('0x22')](function(_0xc16325){if(_0xc16325){_0x32caad[_0x8e0b('0x66')]['SmsAccountId']=_0xc16325['id'];return db['CannedAnswer']['create'](_0x32caad[_0x8e0b('0x66')]);}})['then'](respondWithResult(_0x1c8612,null))[_0x8e0b('0x2a')](handleError(_0x1c8612,null));};exports[_0x8e0b('0x6e')]=function(_0x4d821a,_0x9a3840,_0x10bb3d){var _0x3f65d9={'raw':![],'where':{}};var _0x74e0d4={};var _0x1f5a6e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8e0b('0x6f')]({'where':{'id':_0x4d821a[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x9a3840,null))[_0x8e0b('0x22')](function(_0xfad579){if(_0xfad579){_0x74e0d4[_0x8e0b('0x3f')]=_[_0x8e0b('0x40')](db[_0x8e0b('0x70')][_0x8e0b('0x5c')]);_0x74e0d4['query']=_[_0x8e0b('0x40')](_0x4d821a[_0x8e0b('0x41')]);_0x74e0d4[_0x8e0b('0x4b')]=_[_0x8e0b('0x42')](_0x74e0d4[_0x8e0b('0x3f')],_0x74e0d4[_0x8e0b('0x41')]);_0x3f65d9[_0x8e0b('0x43')]=_[_0x8e0b('0x42')](_0x74e0d4[_0x8e0b('0x3f')],qs[_0x8e0b('0x44')](_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x44')]));_0x3f65d9[_0x8e0b('0x43')]=_0x3f65d9[_0x8e0b('0x43')]['length']?_0x3f65d9['attributes']:_0x74e0d4['model'];if(!_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x46')](_0x8e0b('0x47'))){_0x3f65d9[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x30')]);_0x3f65d9['offset']=qs[_0x8e0b('0x2f')](_0x4d821a[_0x8e0b('0x41')]['offset']);}_0x3f65d9['order']=qs[_0x8e0b('0x49')](_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x49')]);_0x3f65d9['where']=qs['filters'](_[_0x8e0b('0x4c')](_0x4d821a[_0x8e0b('0x41')],_0x74e0d4[_0x8e0b('0x4b')]));_0x3f65d9[_0x8e0b('0x4a')][_0x8e0b('0x69')]=_0xfad579['id'];if(_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x4d')]){_0x3f65d9[_0x8e0b('0x4a')]=_[_0x8e0b('0x4e')](_0x3f65d9[_0x8e0b('0x4a')],{'$or':_[_0x8e0b('0x4f')](_0x3f65d9[_0x8e0b('0x43')],function(_0x1d4d73){var _0x205108={};_0x205108[_0x1d4d73]={'$like':'%'+_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x4d')]+'%'};return _0x205108;})});}_0x3f65d9=_['merge']({},_0x3f65d9,_0x4d821a['options']);return db[_0x8e0b('0x70')][_0x8e0b('0x55')]({'where':_0x3f65d9[_0x8e0b('0x4a')]})[_0x8e0b('0x22')](function(_0x41b057){_0x1f5a6e[_0x8e0b('0x55')]=_0x41b057;if(_0x4d821a[_0x8e0b('0x41')][_0x8e0b('0x56')]){_0x3f65d9[_0x8e0b('0x57')]=[{'all':!![]}];}return db[_0x8e0b('0x70')][_0x8e0b('0x58')](_0x3f65d9);})[_0x8e0b('0x22')](function(_0x286a70){_0x1f5a6e[_0x8e0b('0x59')]=_0x286a70;return _0x1f5a6e;});}})['then'](respondWithFilteredResult(_0x9a3840,_0x3f65d9))[_0x8e0b('0x2a')](handleError(_0x9a3840,null));};exports['removeAnswers']=function(_0x5b81e0,_0x49201a,_0x34f39f){return db['SmsAccount'][_0x8e0b('0x5d')]({'where':{'id':_0x5b81e0[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x49201a,null))[_0x8e0b('0x22')](function(_0x41556e){if(_0x41556e){return _0x41556e[_0x8e0b('0x71')](_0x5b81e0[_0x8e0b('0x41')][_0x8e0b('0x6c')]);}})[_0x8e0b('0x22')](respondWithStatusCode(_0x49201a,null))[_0x8e0b('0x2a')](handleError(_0x49201a,null));};exports['notify']=function(_0x4aae35,_0x511c06,_0x104e82){var _0xec185a={'channel':_0x8e0b('0x72')};var _0x5319ec=[];var _0x334fb3=[];var _0xd2d441={};return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x4aae35[_0x8e0b('0x5b')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x8e0b('0x73')}]})[_0x8e0b('0x22')](handleEntityNotFound(_0x511c06,null))['then'](function(_0x1aa5e4){_0xec185a[_0x8e0b('0x74')]=_0x1aa5e4;_0xec185a[_0x8e0b('0x75')]=_['orderBy'](_0x1aa5e4[_0x8e0b('0x73')],[_0x8e0b('0x76')],[_0x8e0b('0x77')]);if(_0xec185a[_0x8e0b('0x74')]['Applications']){delete _0xec185a['account']['Applications'];}return db[_0x8e0b('0x78')][_0x8e0b('0x67')]();})[_0x8e0b('0x22')](function(_0x27f811){if(!_0x27f811){throw new db[(_0x8e0b('0x79'))][(_0x8e0b('0x7a'))](_0x8e0b('0x7b'));}_0x5319ec=_[_0x8e0b('0x7c')](_['keys'](_0x27f811),[_0x8e0b('0x7d'),_0x8e0b('0x7e')]);_0x334fb3=_[_0x8e0b('0x7c')](_['keys'](_0x27f811),[_0x8e0b('0x7d'),'updatedAt',_0x8e0b('0x7f'),_0x8e0b('0x80')]);_0xec185a[_0x8e0b('0x66')]={'mapKey':'mobile'};if(_0xec185a[_0x8e0b('0x74')][_0x8e0b('0x50')]){switch(_0xec185a[_0x8e0b('0x74')][_0x8e0b('0x50')]){case _0x8e0b('0x81'):_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')]['From'];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35[_0x8e0b('0x66')]['Body'];_0xec185a['body'][_0x8e0b('0x83')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x84')];break;case _0x8e0b('0x85'):_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]='+'+_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x86')];_0xec185a['body'][_0x8e0b('0x66')]=_0x4aae35['body'][_0x8e0b('0x87')];break;case'connectel':_0xec185a['body'][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x82')];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35['body'][_0x8e0b('0x28')];break;case _0x8e0b('0x88'):_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')]['from'];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35['body'][_0x8e0b('0x66')];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x83')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x89')];break;case _0x8e0b('0x8a'):_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8b')];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8c')];_0xec185a[_0x8e0b('0x66')]['messageId']=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8d')];break;case'infobip':_0xec185a['body']['from']='+'+_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8e')][0x0][_0x8e0b('0x82')];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8e')][0x0]['text'];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x83')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8e')][0x0][_0x8e0b('0x83')];break;case'csc':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')]['originatingAddress'];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x8f')]['message'];break;case'clickatell':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x90')];_0xec185a['body'][_0x8e0b('0x66')]=_0x4aae35[_0x8e0b('0x66')]['text'];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x83')]=_0x4aae35['body'][_0x8e0b('0x91')];break;case _0x8e0b('0x92'):_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')]=_0x4aae35['body'][_0x8e0b('0x82')];_0xec185a['body']['body']=_0x4aae35[_0x8e0b('0x66')][_0x8e0b('0x28')];_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x83')]=_0x4aae35[_0x8e0b('0x66')]['refid'];break;}}if(_0xec185a[_0x8e0b('0x66')]['id']){delete _0xec185a[_0x8e0b('0x66')]['id'];}if(_[_0x8e0b('0x93')](_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')])){throw new db[(_0x8e0b('0x79'))][(_0x8e0b('0x7a'))]('from\x20is\x20mandatory');}if(_[_0x8e0b('0x93')](_0xec185a['body']['body'])||_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x66')]===''){throw new db[(_0x8e0b('0x79'))][(_0x8e0b('0x7a'))](_0x8e0b('0x94'));}if(_[_0x8e0b('0x93')](_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x95')])){throw new db['Sequelize'][(_0x8e0b('0x7a'))](_0x8e0b('0x96')+_0x334fb3);}if(!_[_0x8e0b('0x97')](_0x334fb3,_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x95')])){throw new db[(_0x8e0b('0x79'))]['ValidationError'](_0x8e0b('0x98')+_0x334fb3);}_0xd2d441[_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x95')]]=_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')];return db[_0x8e0b('0x99')][_0x8e0b('0x5d')]({'where':{'id':_0xec185a[_0x8e0b('0x74')][_0x8e0b('0x80')]},'include':[{'model':db['CmContact'],'as':_0x8e0b('0x9a'),'where':_0xd2d441,'limit':0x1,'order':[[_0x8e0b('0x7e'),'DESC']]}]});})[_0x8e0b('0x22')](handleEntityNotFound(_0x511c06,null))[_0x8e0b('0x22')](function(_0x4fcd91){if(_0x4fcd91){_0xec185a[_0x8e0b('0x9b')]=_[_0x8e0b('0x9c')](_0x4fcd91,[_0x8e0b('0x9a')]);if(_0x4fcd91[_0x8e0b('0x9a')]['length']){return _0x4fcd91[_0x8e0b('0x9a')][0x0];}var _0x4b4e41=_[_0x8e0b('0x19')](_0xec185a[_0x8e0b('0x66')],{'firstName':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')],'ListId':_0x4fcd91['id']});_0x4b4e41[_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x95')]]=_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')];return db['CmContact'][_0x8e0b('0x5e')](_0x4b4e41,{'fields':_0x5319ec,'raw':!![]});}})[_0x8e0b('0x22')](handleEntityNotFound(_0x511c06,null))['then'](function(_0x30c73c){if(_0x30c73c){_0xec185a['contact']=_0x30c73c;var _0x295c6f={'ContactId':_0x30c73c['id'],'phone':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x82')],'SmsAccountId':_0x4aae35[_0x8e0b('0x5b')]['id']};var _0x1278ea={'ContactId':_0x30c73c['id'],'SmsAccountId':_0x4aae35[_0x8e0b('0x5b')]['id'],'closed':![]};return db['SmsInteraction'][_0x8e0b('0x5d')]({'where':_0x1278ea})['then'](function(_0x56564c){if(_0x56564c){return[_0x56564c,![]];}return db[_0x8e0b('0x9d')][_0x8e0b('0x5e')](_0x295c6f)[_0x8e0b('0x22')](function(_0x254ee5){return[_0x254ee5,!![]];});});}})['spread'](function(_0x5f25ec,_0x32e388){_0xec185a['interaction']=_0x5f25ec[_0x8e0b('0x37')]({'plain':!![]});_0xec185a[_0x8e0b('0x9e')][_0x8e0b('0x9f')]=![];if(_0x32e388){if(_0xec185a[_0x8e0b('0x74')][_0x8e0b('0xa0')]){_0xec185a['applications'][_0x8e0b('0xa1')]({'id':0x0,'priority':_0xec185a[_0x8e0b('0x75')][_0x8e0b('0x45')]+0x1,'app':_0x8e0b('0xa2'),'appdata':_0x8e0b('0xa3'),'interval':_0x8e0b('0xa4')});}_0xec185a[_0x8e0b('0x9e')][_0x8e0b('0x9f')]=!![];}return db['SmsMessage'][_0x8e0b('0x5e')]({'phone':_0xec185a['body'][_0x8e0b('0x82')],'messageId':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0x83')],'body':_0xec185a['body'][_0x8e0b('0x66')],'SmsAccountId':_0x4aae35[_0x8e0b('0x5b')]['id'],'SmsInteractionId':_0x5f25ec['id'],'direction':'in','ContactId':_0x5f25ec['ContactId'],'AttachmentId':_0xec185a[_0x8e0b('0x66')][_0x8e0b('0xa5')]});})[_0x8e0b('0x22')](function(_0x10acbd){_0xec185a[_0x8e0b('0x28')]=_0x10acbd;if(_0xec185a[_0x8e0b('0x9e')][_0x8e0b('0xa6')]){return db['User'][_0x8e0b('0x5d')]({'attributes':['id','name'],'where':{'id':_0xec185a[_0x8e0b('0x9e')][_0x8e0b('0xa6')]}})[_0x8e0b('0x22')](function(_0x3b3f60){if(_0x3b3f60){_0xec185a['applications'][_0x8e0b('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b3f60[_0x8e0b('0x64')]+','+(_0xec185a['account'][_0x8e0b('0xa8')]||0xa),'interval':_0x8e0b('0xa4')});}return respondWithRpcPromise(_0x8e0b('0xa9'),_0x8e0b('0xaa'),_0xec185a);});}return respondWithRpcPromise(_0x8e0b('0xa9'),'startRouting',_0xec185a);})[_0x8e0b('0x22')](function(_0xfe22b7){if(_0xfe22b7){var _0x4f0bcb=0xc8;var _0x3ac92a=_0x8e0b('0xab');logger[_0x8e0b('0x29')](_0x8e0b('0x25'),_0x3ac92a,_0x4f0bcb,_0x8e0b('0xac'));logger[_0x8e0b('0xad')](_0x8e0b('0xae'),_0x3ac92a,_0x4f0bcb,_0x8e0b('0xac'),JSON[_0x8e0b('0x26')](_0xfe22b7));if(_0xec185a['account'][_0x8e0b('0x50')]===_0x8e0b('0x81')){return _0x511c06['status'](_0x4f0bcb)[_0x8e0b('0x31')](_0x8e0b('0xaf'),_0x8e0b('0xb0'))['send']('\x0a');}else{return _0x511c06[_0x8e0b('0x2d')](_0x4f0bcb)[_0x8e0b('0x2e')](_0xfe22b7);}}})[_0x8e0b('0x2a')](handleError(_0x511c06,null));};exports[_0x8e0b('0xb1')]=function(_0x2cc78e,_0x5089ff,_0x2f56a1){return db[_0x8e0b('0x3e')][_0x8e0b('0x6f')]({'where':{'id':_0x2cc78e['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x5089ff,null))[_0x8e0b('0x22')](function(_0x471d4a){if(_0x471d4a){return db[_0x8e0b('0xb2')][_0x8e0b('0xb3')](function(_0x1ce386){return db[_0x8e0b('0xb4')][_0x8e0b('0x36')]({'where':{'SmsAccountId':_0x2cc78e[_0x8e0b('0x5b')]['id']},'transaction':_0x1ce386})[_0x8e0b('0x22')](function(_0x1897b3){var _0xb6eb15=_['map'](_0x2cc78e[_0x8e0b('0x66')],function(_0x1a14dc){_0x1a14dc[_0x8e0b('0x69')]=_0x2cc78e[_0x8e0b('0x5b')]['id'];return _0x1a14dc;});return db[_0x8e0b('0xb4')][_0x8e0b('0xb5')](_0xb6eb15,{'transaction':_0x1ce386});});})[_0x8e0b('0x22')](function(){return db[_0x8e0b('0xb4')][_0x8e0b('0xb6')]({'where':{'SmsAccountId':_0x2cc78e[_0x8e0b('0x5b')]['id']},'order':_0x8e0b('0x76')});});}})[_0x8e0b('0x22')](respondWithResult(_0x5089ff,null))[_0x8e0b('0x2a')](handleError(_0x5089ff,null));};exports[_0x8e0b('0xb7')]=function(_0x474698,_0x46d64b,_0x336a5a){var _0x3d736c={};var _0x4f71f1={};var _0x571559;var _0x579133;return db[_0x8e0b('0x3e')]['findOne']({'where':{'id':_0x474698['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x46d64b,null))[_0x8e0b('0x22')](function(_0x3a00d4){if(_0x3a00d4){_0x571559=_0x3a00d4;_0x4f71f1[_0x8e0b('0x3f')]=_[_0x8e0b('0x40')](db[_0x8e0b('0xb4')][_0x8e0b('0x5c')]);_0x4f71f1['query']=_[_0x8e0b('0x40')](_0x474698[_0x8e0b('0x41')]);_0x4f71f1[_0x8e0b('0x4b')]=_[_0x8e0b('0x42')](_0x4f71f1['model'],_0x4f71f1[_0x8e0b('0x41')]);_0x3d736c['attributes']=_[_0x8e0b('0x42')](_0x4f71f1['model'],qs['fields'](_0x474698['query'][_0x8e0b('0x44')]));_0x3d736c[_0x8e0b('0x43')]=_0x3d736c['attributes']['length']?_0x3d736c[_0x8e0b('0x43')]:_0x4f71f1[_0x8e0b('0x3f')];_0x3d736c['order']=qs[_0x8e0b('0x49')](_0x474698[_0x8e0b('0x41')][_0x8e0b('0x49')]);_0x3d736c[_0x8e0b('0x4a')]=qs[_0x8e0b('0x4b')](_[_0x8e0b('0x4c')](_0x474698[_0x8e0b('0x41')],_0x4f71f1[_0x8e0b('0x4b')]));if(_0x474698['query'][_0x8e0b('0x4d')]){_0x3d736c['where']=_['merge'](_0x3d736c[_0x8e0b('0x4a')],{'$or':_[_0x8e0b('0x4f')](_0x3d736c['attributes'],function(_0x45c1ed){var _0x30cd1c={};_0x30cd1c[_0x45c1ed]={'$like':'%'+_0x474698[_0x8e0b('0x41')]['filter']+'%'};return _0x30cd1c;})});}_0x3d736c=_[_0x8e0b('0x4e')]({},_0x3d736c,_0x474698[_0x8e0b('0x54')]);return _0x571559[_0x8e0b('0xb7')](_0x3d736c);}})[_0x8e0b('0x22')](function(_0x571f7e){if(_0x571f7e){_0x579133=_0x571f7e['length'];if(!_0x474698['query']['hasOwnProperty'](_0x8e0b('0x47'))){_0x3d736c[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x474698[_0x8e0b('0x41')]['limit']);_0x3d736c[_0x8e0b('0x2f')]=qs[_0x8e0b('0x2f')](_0x474698[_0x8e0b('0x41')][_0x8e0b('0x2f')]);}return _0x571559[_0x8e0b('0xb7')](_0x3d736c);}})[_0x8e0b('0x22')](function(_0x4e5b1e){if(_0x4e5b1e){return _0x4e5b1e?{'count':_0x579133,'rows':_0x4e5b1e}:null;}})[_0x8e0b('0x22')](respondWithResult(_0x46d64b,null))[_0x8e0b('0x2a')](handleError(_0x46d64b,null));};exports[_0x8e0b('0xb8')]=function(_0x162bd9,_0x2e72a6,_0x41ba05){var _0x44aafb={'raw':![],'where':{}};var _0x2345ec={};var _0xf4741f={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x162bd9[_0x8e0b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2e72a6,null))[_0x8e0b('0x22')](function(_0x2af095){if(_0x2af095){_0x2345ec[_0x8e0b('0x3f')]=_[_0x8e0b('0x40')](db[_0x8e0b('0x9d')][_0x8e0b('0x5c')]);_0x2345ec[_0x8e0b('0x41')]=_[_0x8e0b('0x40')](_0x162bd9[_0x8e0b('0x41')]);_0x2345ec['filters']=_[_0x8e0b('0x42')](_0x2345ec['model'],_0x2345ec[_0x8e0b('0x41')]);_0x44aafb[_0x8e0b('0x43')]=_['intersection'](_0x2345ec[_0x8e0b('0x3f')],qs[_0x8e0b('0x44')](_0x162bd9['query'][_0x8e0b('0x44')]));_0x44aafb[_0x8e0b('0x43')]=_0x44aafb['attributes'][_0x8e0b('0x45')]?_0x44aafb[_0x8e0b('0x43')]:_0x2345ec['model'];if(!_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x46')]('nolimit')){_0x44aafb[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x30')]);_0x44aafb[_0x8e0b('0x2f')]=qs[_0x8e0b('0x2f')](_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x2f')]);}_0x44aafb[_0x8e0b('0x48')]=qs[_0x8e0b('0x49')](_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x49')]);_0x44aafb[_0x8e0b('0x4a')]=qs['filters'](_[_0x8e0b('0x4c')](_0x162bd9['query'],_0x2345ec[_0x8e0b('0x4b')]));_0x44aafb['where'][_0x8e0b('0x69')]=_0x2af095['id'];if(_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x4d')]){_0x44aafb[_0x8e0b('0x4a')]=_[_0x8e0b('0x4e')](_0x44aafb['where'],{'$or':_['map'](_0x44aafb[_0x8e0b('0x43')],function(_0x5cb69d){var _0x5180ca={};_0x5180ca[_0x5cb69d]={'$like':'%'+_0x162bd9['query']['filter']+'%'};return _0x5180ca;})});}_0x44aafb=_[_0x8e0b('0x4e')]({},_0x44aafb,_0x162bd9['options']);return db['SmsInteraction'][_0x8e0b('0x55')]({'where':_0x44aafb[_0x8e0b('0x4a')]})[_0x8e0b('0x22')](function(_0x451c3e){_0xf4741f[_0x8e0b('0x55')]=_0x451c3e;if(_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0x56')]){_0x44aafb[_0x8e0b('0x57')]=[{'model':db[_0x8e0b('0x78')],'as':_0x8e0b('0xb9'),'required':![]},{'model':db[_0x8e0b('0xba')],'as':_0x8e0b('0xbb'),'attributes':[_0x8e0b('0x64'),_0x8e0b('0xbc'),_0x8e0b('0xbd')],'required':![]},{'model':db['Tag'],'as':_0x8e0b('0xbe'),'attributes':['id',_0x8e0b('0x64'),_0x8e0b('0xbf')],'where':_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0xc0')]?{'id':_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0xc0')]}:undefined,'required':_0x162bd9[_0x8e0b('0x41')][_0x8e0b('0xc0')]?!![]:![]}];}return db[_0x8e0b('0x9d')][_0x8e0b('0x58')](_0x44aafb);})[_0x8e0b('0x22')](function(_0x374dbb){_0xf4741f[_0x8e0b('0x59')]=_0x374dbb;return _0xf4741f;});}})[_0x8e0b('0x22')](respondWithFilteredResult(_0x2e72a6,_0x44aafb))[_0x8e0b('0x2a')](handleError(_0x2e72a6,null));};exports[_0x8e0b('0x3a')]=function(_0x372662,_0x6c99b9,_0x59ea4b){var _0x45b7b2,_0x4eb8ed,_0x56ead7;if(_[_0x8e0b('0x93')](_0x372662[_0x8e0b('0x66')][_0x8e0b('0x66')])||_0x372662['body'][_0x8e0b('0x66')]===''){throw new db['Sequelize'][(_0x8e0b('0x7a'))](_0x8e0b('0x94'));}if(_['isNil'](_0x372662[_0x8e0b('0x66')]['to'])){throw new db['Sequelize'][(_0x8e0b('0x7a'))](_0x8e0b('0xc1'));}_0x45b7b2=_0x372662[_0x8e0b('0x66')]['to'];return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x372662[_0x8e0b('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x8e0b('0xc2'),'include':[{'model':db[_0x8e0b('0x78')],'as':_0x8e0b('0x9a'),'where':{'mobile':_0x45b7b2},'limit':0x1,'order':[[_0x8e0b('0x7e'),_0x8e0b('0xc3')]]}]}]})[_0x8e0b('0x22')](handleEntityNotFound(_0x6c99b9,null))[_0x8e0b('0x22')](function(_0x247e11){if(_0x247e11&&_0x247e11[_0x8e0b('0xc2')]){_0x4eb8ed=_0x247e11['get']({'plain':!![]});if(_0x4eb8ed['List']&&_0x4eb8ed[_0x8e0b('0xc2')][_0x8e0b('0x9a')][_0x8e0b('0x45')]){return _0x4eb8ed[_0x8e0b('0xc2')][_0x8e0b('0x9a')][0x0];}return db[_0x8e0b('0x78')][_0x8e0b('0x5e')](_['defaults'](_0x372662[_0x8e0b('0x66')],{'firstName':_0x45b7b2,'mobile':_0x45b7b2,'phone':_0x45b7b2,'ListId':_0x4eb8ed[_0x8e0b('0x80')]}));}})['then'](handleEntityNotFound(_0x6c99b9,null))['then'](function(_0xc0ccb){if(_0xc0ccb){_0x56ead7=_0xc0ccb;return db['SmsInteraction'][_0x8e0b('0x5d')]({'where':{'ContactId':_0x56ead7['id'],'closed':![],'SmsAccountId':_0x4eb8ed['id']}})[_0x8e0b('0x22')](function(_0x11b08d){if(_0x11b08d){return[_0x11b08d,![]];}return db[_0x8e0b('0x9d')][_0x8e0b('0x5e')]({'UserId':_0x372662[_0x8e0b('0x5f')]['id'],'ContactId':_0x56ead7['id'],'SmsAccountId':_0x4eb8ed['id'],'phone':_0x45b7b2,'firstMsgDirection':'out','Messages':[_[_0x8e0b('0x4e')](_0x372662[_0x8e0b('0x66')],{'read':![],'body':_0x372662['body'][_0x8e0b('0x66')],'phone':_0x45b7b2,'SmsAccountId':_0x4eb8ed['id'],'UserId':_0x372662['user']['id'],'ContactId':_0x56ead7['id']})]},{'include':[{'model':db[_0x8e0b('0xc4')],'as':_0x8e0b('0xc5')}]})[_0x8e0b('0x22')](function(_0x46f505){return[_0x46f505,!![]];});});}})['spread'](function(_0x43d475,_0x4f5a34){if(_0x4f5a34){return _0x43d475;}return db[_0x8e0b('0xc4')]['create'](_[_0x8e0b('0x4e')](_0x372662[_0x8e0b('0x66')],{'read':![],'body':_0x372662[_0x8e0b('0x66')]['body'],'phone':_0x45b7b2,'SmsAccountId':_0x4eb8ed['id'],'SmsInteractionId':_0x43d475['id'],'UserId':_0x372662[_0x8e0b('0x5f')]['id'],'ContactId':_0x56ead7['id']}))[_0x8e0b('0x22')](function(_0xcab04a){_0x43d475[_0x8e0b('0xc6')][_0x8e0b('0xc5')]=[];_0x43d475[_0x8e0b('0xc6')][_0x8e0b('0xc5')][_0x8e0b('0xa1')](_0xcab04a['dataValues']);return _0x43d475;});})[_0x8e0b('0x22')](respondWithResult(_0x6c99b9,null))['catch'](handleError(_0x6c99b9,null));};exports[_0x8e0b('0x2d')]=function(_0xce1ff9,_0x1d358f,_0x4739db){if(_0xce1ff9['body']['id']){delete _0xce1ff9[_0x8e0b('0x66')]['id'];}console[_0x8e0b('0xc7')]('endpoint\x20/status\x20POST\x20/',_0xce1ff9[_0x8e0b('0x66')]);var _0x34701c,_0x2d38f5,_0x968129;return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0xce1ff9[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x1d358f,null))[_0x8e0b('0x22')](function(_0x2668e1){if(_0x2668e1){_0x968129=_0x2668e1;logger[_0x8e0b('0xad')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8e0b('0x2d'),_0x8e0b('0xc8'),_0x2668e1['type'],util[_0x8e0b('0xc9')](_0xce1ff9['body'],{'showHidden':![],'depth':null}));switch(_0x2668e1[_0x8e0b('0x50')]){case _0x8e0b('0x85'):if(_0xce1ff9['body'][_0x8e0b('0xca')]&&_0xce1ff9['body'][_0x8e0b('0x2d')]){_0x2d38f5=_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x2d')];return db[_0x8e0b('0xc4')][_0x8e0b('0x5d')]({'where':{'messageId':_0xce1ff9['body'][_0x8e0b('0xca')]}});}break;case'connectel':if(_0xce1ff9['body'][_0x8e0b('0xcb')]&&_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0xcc')]){_0x2d38f5=_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0xcc')];return db[_0x8e0b('0xc4')][_0x8e0b('0x5d')]({'where':{'messageId':_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0xcb')]}});}break;case _0x8e0b('0x88'):if(_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x89')]&&_0xce1ff9['body']['status_code']){_0x2d38f5=_0xce1ff9['body'][_0x8e0b('0xcd')];return db[_0x8e0b('0xc4')][_0x8e0b('0x5d')]({'where':{'messageId':_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x89')]}});}break;case _0x8e0b('0xce'):var _0x22d518=_0xce1ff9['body'][_0x8e0b('0x8e')][0x0];if(_0x22d518[_0x8e0b('0x83')]&&_0x22d518[_0x8e0b('0x2d')][_0x8e0b('0xcf')]===_0x8e0b('0xd0')){_0x2d38f5=_0x22d518[_0x8e0b('0x2d')][_0x8e0b('0xcf')];return db['SmsMessage'][_0x8e0b('0x5d')]({'where':{'messageId':_0x22d518[_0x8e0b('0x83')]}});}break;case _0x8e0b('0xd1'):if(_0xce1ff9[_0x8e0b('0x66')]['messageId']&&_0xce1ff9['body'][_0x8e0b('0x2d')]){_0x2d38f5=_0xce1ff9[_0x8e0b('0x66')]['status'];return db['SmsMessage'][_0x8e0b('0x5d')]({'where':{'messageId':_0xce1ff9['body'][_0x8e0b('0x83')]}});}break;case _0x8e0b('0x92'):if(_0xce1ff9['body'][_0x8e0b('0xd2')]&&_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x2d')]){_0x2d38f5=_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x2d')];return db[_0x8e0b('0xc4')][_0x8e0b('0x5d')]({'where':{'messageId':_0xce1ff9['body'][_0x8e0b('0xd2')]}});}break;}}})[_0x8e0b('0x22')](handleEntityNotFound(_0x1d358f,null))['then'](function(_0x5af5de){if(_0x5af5de){_0x34701c=_0x5af5de;switch(_0x968129[_0x8e0b('0x50')]){case'skebby':if(_0x2d38f5===_0x8e0b('0xd0')){return _0x34701c[_0x8e0b('0x65')]({'read':!![]});}else{logger[_0x8e0b('0x27')](_0x8e0b('0x25'),'status',_0x8e0b('0x85'),util[_0x8e0b('0xc9')](_0xce1ff9[_0x8e0b('0x66')],{'showHidden':![],'depth':null}));}break;case _0x8e0b('0xd3'):if(_0x2d38f5==='1'){return _0x34701c[_0x8e0b('0x65')]({'read':!![]});}else{logger[_0x8e0b('0x27')](_0x8e0b('0x25'),'status',_0x8e0b('0x85'),util['inspect'](_0xce1ff9['body'],{'showHidden':![],'depth':null}));}break;case _0x8e0b('0x88'):if(!_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0xd4')]&&_0x2d38f5>=0xc8&&_0x2d38f5<=0xce){return _0x34701c['update']({'read':!![]});}else{logger[_0x8e0b('0x27')](_0x8e0b('0x25'),_0x8e0b('0x2d'),_0x8e0b('0x88'),util[_0x8e0b('0xc9')](_0xce1ff9['body'],{'showHidden':![],'depth':null}));}break;case _0x8e0b('0xce'):var _0xe6a8b0=_0xce1ff9[_0x8e0b('0x66')][_0x8e0b('0x8e')][0x0];if(_0xe6a8b0['status'][_0x8e0b('0xcf')]===_0x8e0b('0xd0')){return _0x34701c[_0x8e0b('0x65')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8e0b('0x2d'),_0x8e0b('0xce'),util['inspect'](_0xce1ff9[_0x8e0b('0x66')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2d38f5==_0x8e0b('0xd5')||_0x2d38f5=='RECEIVED_BY_RECIPIENT'){return _0x34701c[_0x8e0b('0x65')]({'read':!![]});}else{logger['error'](_0x8e0b('0x25'),_0x8e0b('0x2d'),_0x8e0b('0xd1'),util[_0x8e0b('0xc9')](_0xce1ff9['body'],{'showHidden':![],'depth':null}));}break;case _0x8e0b('0x92'):if(_0x2d38f5===_0x8e0b('0xd6')||_0x2d38f5===_0x8e0b('0xd7')){return _0x34701c[_0x8e0b('0x65')]({'read':!![]});}else{logger['error'](_0x8e0b('0x25'),'status','intelepeer',util[_0x8e0b('0xc9')](_0xce1ff9[_0x8e0b('0x66')],{'showHidden':![],'depth':null}));}break;}return _0x34701c;}})[_0x8e0b('0x22')](respondWithResult(_0x1d358f,null))[_0x8e0b('0x2a')](handleError(_0x1d358f,null));};exports[_0x8e0b('0xd8')]=function(_0x1a57a5,_0x13f54f,_0x566493){var _0x31ba0f,_0x16d773,_0x443bd4;return db[_0x8e0b('0x3e')][_0x8e0b('0x5d')]({'where':{'id':_0x1a57a5[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x13f54f,null))[_0x8e0b('0x22')](function(_0x44f60a){if(_0x44f60a){_0x443bd4=_0x44f60a;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8e0b('0x2d'),_0x8e0b('0xc8'),_0x44f60a['type'],util[_0x8e0b('0xc9')](_0x1a57a5['query'],{'showHidden':![],'depth':null}));switch(_0x44f60a['type']){case'csc':if(_0x1a57a5[_0x8e0b('0x41')]['message-id']&&_0x1a57a5['query'][_0x8e0b('0xd9')]){_0x16d773=_0x1a57a5[_0x8e0b('0x41')][_0x8e0b('0xd9')];return db[_0x8e0b('0xc4')]['find']({'where':{'messageId':_0x1a57a5['query'][_0x8e0b('0xda')]}});}break;}}})[_0x8e0b('0x22')](handleEntityNotFound(_0x13f54f,null))['then'](function(_0xa5b6ec){if(_0xa5b6ec){_0x31ba0f=_0xa5b6ec;switch(_0x443bd4[_0x8e0b('0x50')]){case'csc':if(_0x16d773==='2'||_0x16d773==='6'){return _0x31ba0f[_0x8e0b('0x65')]({'read':!![]});}else{logger[_0x8e0b('0x27')](_0x8e0b('0x25'),_0x8e0b('0x2d'),_0x8e0b('0xdb'),util['inspect'](_0x1a57a5[_0x8e0b('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x31ba0f;}})[_0x8e0b('0x22')](respondWithResult(_0x13f54f,null))[_0x8e0b('0x2a')](handleError(_0x13f54f,null));};exports[_0x8e0b('0xdc')]=function(_0x1f9665,_0x432e8c,_0x46bc5f){return db[_0x8e0b('0x3e')]['find']({'where':{'id':_0x1f9665['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x432e8c,null))[_0x8e0b('0x22')](function(_0x103879){if(_0x103879){return _0x103879[_0x8e0b('0xdc')](_0x1f9665[_0x8e0b('0x66')][_0x8e0b('0x6c')],_['omit'](_0x1f9665[_0x8e0b('0x66')],['ids','id'])||{})[_0x8e0b('0xdd')](function(_0xf2b582){for(var _0x2c2b56=0x0;_0x2c2b56<_0x1f9665[_0x8e0b('0x66')][_0x8e0b('0x6c')][_0x8e0b('0x45')];_0x2c2b56+=0x1){socket[_0x8e0b('0xde')]('userSmsAccount:save',{'UserId':_0x1f9665['body'][_0x8e0b('0x6c')][_0x2c2b56],'SmsAccountId':_0x1f9665['params']['id']});}return _0xf2b582;});}})[_0x8e0b('0x22')](respondWithResult(_0x432e8c,null))[_0x8e0b('0x2a')](handleError(_0x432e8c,null));};exports['removeAgents']=function(_0x52c535,_0x4c24f4,_0x4c474a){return db['SmsAccount']['find']({'where':{'id':_0x52c535['params']['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x4c24f4,null))[_0x8e0b('0x22')](function(_0x56ebb9){if(_0x56ebb9){return _0x56ebb9[_0x8e0b('0xdf')](_0x52c535[_0x8e0b('0x41')][_0x8e0b('0x6c')])['then'](function(){if(_[_0x8e0b('0xe0')](_0x52c535[_0x8e0b('0x41')][_0x8e0b('0x6c')])){for(var _0x310401=0x0;_0x310401<_0x52c535[_0x8e0b('0x41')][_0x8e0b('0x6c')][_0x8e0b('0x45')];_0x310401+=0x1){socket[_0x8e0b('0xde')](_0x8e0b('0xe1'),{'UserId':Number(_0x52c535[_0x8e0b('0x41')][_0x8e0b('0x6c')][_0x310401]),'SmsAccountId':Number(_0x52c535['params']['id'])});}}else{socket[_0x8e0b('0xde')](_0x8e0b('0xe1'),{'UserId':Number(_0x52c535['query'][_0x8e0b('0x6c')]),'SmsAccountId':Number(_0x52c535[_0x8e0b('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c24f4,null))[_0x8e0b('0x2a')](handleError(_0x4c24f4,null));};exports[_0x8e0b('0xe2')]=function(_0x404655,_0x445d0b,_0x2605f0){var _0x1bcd93={};var _0x43818d={};var _0x4d5512;var _0x593c25;return db[_0x8e0b('0x3e')][_0x8e0b('0x6f')]({'where':{'id':_0x404655[_0x8e0b('0x5b')]['id']}})[_0x8e0b('0x22')](handleEntityNotFound(_0x445d0b,null))['then'](function(_0x128c1f){if(_0x128c1f){_0x4d5512=_0x128c1f;_0x43818d['model']=_[_0x8e0b('0x40')](db[_0x8e0b('0xba')][_0x8e0b('0x5c')]);_0x43818d[_0x8e0b('0x41')]=_['keys'](_0x404655['query']);_0x43818d[_0x8e0b('0x4b')]=_['intersection'](_0x43818d['model'],_0x43818d[_0x8e0b('0x41')]);_0x1bcd93[_0x8e0b('0x43')]=_[_0x8e0b('0x42')](_0x43818d[_0x8e0b('0x3f')],qs['fields'](_0x404655[_0x8e0b('0x41')][_0x8e0b('0x44')]));_0x1bcd93[_0x8e0b('0x43')]=_0x1bcd93['attributes'][_0x8e0b('0x45')]?_0x1bcd93[_0x8e0b('0x43')]:_0x43818d['model'];_0x1bcd93[_0x8e0b('0x48')]=qs[_0x8e0b('0x49')](_0x404655[_0x8e0b('0x41')][_0x8e0b('0x49')]);_0x1bcd93[_0x8e0b('0x4a')]=qs[_0x8e0b('0x4b')](_[_0x8e0b('0x4c')](_0x404655['query'],_0x43818d['filters']));if(_0x404655['query'][_0x8e0b('0x4d')]){_0x1bcd93['where']=_[_0x8e0b('0x4e')](_0x1bcd93['where'],{'$or':_[_0x8e0b('0x4f')](_0x1bcd93[_0x8e0b('0x43')],function(_0x25911d){var _0x4f6c3a={};_0x4f6c3a[_0x25911d]={'$like':'%'+_0x404655[_0x8e0b('0x41')][_0x8e0b('0x4d')]+'%'};return _0x4f6c3a;})});}_0x1bcd93=_[_0x8e0b('0x4e')]({},_0x1bcd93,_0x404655[_0x8e0b('0x54')]);return _0x4d5512[_0x8e0b('0xe2')](_0x1bcd93);}})[_0x8e0b('0x22')](function(_0x4e3abe){if(_0x4e3abe){_0x593c25=_0x4e3abe[_0x8e0b('0x45')];if(!_0x404655[_0x8e0b('0x41')][_0x8e0b('0x46')](_0x8e0b('0x47'))){_0x1bcd93[_0x8e0b('0x30')]=qs[_0x8e0b('0x30')](_0x404655[_0x8e0b('0x41')][_0x8e0b('0x30')]);_0x1bcd93[_0x8e0b('0x2f')]=qs[_0x8e0b('0x2f')](_0x404655[_0x8e0b('0x41')][_0x8e0b('0x2f')]);}return _0x4d5512[_0x8e0b('0xe2')](_0x1bcd93);}})[_0x8e0b('0x22')](function(_0x511f54){if(_0x511f54){return _0x511f54?{'count':_0x593c25,'rows':_0x511f54}:null;}})[_0x8e0b('0x22')](respondWithResult(_0x445d0b,null))['catch'](handleError(_0x445d0b,null));}; \ No newline at end of file +var _0x990a=['apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','stack','name','mandatoryDispositionPause','SmsAccount','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','Pause','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','SmsAccountId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','sender','clicksend','message_id','messageId','MessageUUID','results','csc','originatingAddress','segmentedMessage','replyMessageId','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','defaults','contact','interaction','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','addApplications','bulkCreate','priority','getApplications','getInteractions','SmsInteraction','User','Owner','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','user','Messages','spread','dataValues','log','endpoint\x20/status\x20POST\x20/','inspect','skebby','skebby_dispatch_id','connectel','requestid','statusInt','status_code','infobip','DELIVERED','groupName','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','getAgents','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./smsAccount.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','Content-Range','json'];(function(_0xfee79f,_0x217d48){var _0x36ee67=function(_0x327720){while(--_0x327720){_0xfee79f['push'](_0xfee79f['shift']());}};_0x36ee67(++_0x217d48);}(_0x990a,0xae));var _0xa990=function(_0x2beaef,_0x769872){_0x2beaef=_0x2beaef-0x0;var _0xfbc5bf=_0x990a[_0x2beaef];return _0xfbc5bf;};'use strict';var pdf=require(_0xa990('0x0'));var emlformat=require(_0xa990('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa990('0x2'));var rp=require('request-promise');var moment=require(_0xa990('0x3'));var BPromise=require(_0xa990('0x4'));var Mustache=require(_0xa990('0x5'));var util=require(_0xa990('0x6'));var path=require('path');var sox=require(_0xa990('0x7'));var csv=require(_0xa990('0x8'));var ejs=require(_0xa990('0x9'));var fs=require('fs');var _=require(_0xa990('0xa'));var squel=require(_0xa990('0xb'));var crypto=require('crypto');var jsforce=require(_0xa990('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa990('0xd'));var Papa=require('papaparse');var Redis=require(_0xa990('0xe'));var authService=require(_0xa990('0xf'));var qs=require(_0xa990('0x10'));var hardwareService=require(_0xa990('0x11'));var logger=require('../../config/logger')(_0xa990('0x12'));var utils=require(_0xa990('0x13'));var config=require(_0xa990('0x14'));var db=require(_0xa990('0x15'))['db'];config[_0xa990('0x16')]=_['defaults'](config[_0xa990('0x16')],{'host':_0xa990('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa990('0x16')]));require(_0xa990('0x18'))[_0xa990('0x19')](socket);var jayson=require(_0xa990('0x1a'));var client=jayson['client'][_0xa990('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x4a4385,_0x31fdea,_0x4e069e){if(_0x4e069e){var _0x3e7797=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e7797[_0xa990('0x1c')](_0x31fdea)){return _0x4a4385;}else{throw new Error(_0xa990('0x1d'));}}else{return _0x4a4385;}}function respondWithRpcPromise(_0x3ce768,_0x25e1c9,_0x1db121,_0x100ae2){return new BPromise(function(_0x2de4a2,_0x5194c6){var _0x5e6b67=_0x100ae2||client;return _0x5e6b67[_0xa990('0x1e')](_0x3ce768,_0x1db121)[_0xa990('0x1f')](function(_0xa0aeca){logger[_0xa990('0x20')](_0xa990('0x21'),_0x25e1c9,_0xa990('0x22'));logger[_0xa990('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25e1c9,_0xa990('0x22'),JSON[_0xa990('0x24')](_0xa0aeca));if(_0xa0aeca[_0xa990('0x25')]){if(_0xa0aeca[_0xa990('0x25')][_0xa990('0x26')]===0x1f4){logger['error'](_0xa990('0x21'),_0x25e1c9,_0xa0aeca['error']['message']);return _0x5194c6(_0xa0aeca[_0xa990('0x25')][_0xa990('0x27')]);}logger[_0xa990('0x25')](_0xa990('0x21'),_0x25e1c9,_0xa0aeca[_0xa990('0x25')][_0xa990('0x27')]);return _0x2de4a2(_0xa0aeca['error'][_0xa990('0x27')]);}else{logger[_0xa990('0x20')](_0xa990('0x21'),_0x25e1c9,_0xa990('0x22'));_0x2de4a2(_0xa0aeca[_0xa990('0x28')]['message']);}})[_0xa990('0x29')](function(_0x1f7ebb){logger['error'](_0xa990('0x21'),_0x25e1c9,_0x1f7ebb);_0x5194c6(_0x1f7ebb);});});}function respondWithStatusCode(_0x52c8f8,_0x3db606){_0x3db606=_0x3db606||0xcc;return function(_0x4abc1c){if(_0x4abc1c){return _0x52c8f8[_0xa990('0x2a')](_0x3db606);}return _0x52c8f8['status'](_0x3db606)[_0xa990('0x2b')]();};}function respondWithResult(_0x2eb4f2,_0xa59e0a){_0xa59e0a=_0xa59e0a||0xc8;return function(_0x1069e1){if(_0x1069e1){return _0x2eb4f2[_0xa990('0x2c')](_0xa59e0a)['json'](_0x1069e1);}};}function respondWithFilteredResult(_0x520456,_0x84497f){return function(_0x46b074){if(_0x46b074){var _0x163109=_0x46b074[_0xa990('0x2d')],_0x41ac07=_0x84497f[_0xa990('0x2e')],_0x58465b=_0x84497f[_0xa990('0x2e')]+_0x84497f['limit'],_0x59bf15;if(_0x58465b>=_0x163109){_0x58465b=_0x163109;_0x59bf15=0xc8;}else{_0x59bf15=0xce;}_0x520456[_0xa990('0x2c')](_0x59bf15);return _0x520456['set'](_0xa990('0x2f'),_0x41ac07+'-'+_0x58465b+'/'+_0x163109)[_0xa990('0x30')](_0x46b074);}return null;};}function patchUpdates(_0x3273ea){return function(_0x42a7c6){try{jsonpatch[_0xa990('0x31')](_0x42a7c6,_0x3273ea,!![]);}catch(_0x50ed5b){return BPromise[_0xa990('0x32')](_0x50ed5b);}return _0x42a7c6[_0xa990('0x33')]();};}function saveUpdates(_0x36cb36,_0x126081){return function(_0x51ccd6){if(_0x51ccd6){return _0x51ccd6[_0xa990('0x34')](_0x36cb36)[_0xa990('0x1f')](function(_0x32947e){return _0x32947e;});}return null;};}function removeEntity(_0x1cfc75,_0x4841ad){return function(_0x580bf9){if(_0x580bf9){return _0x580bf9['destroy']()[_0xa990('0x1f')](function(){var _0x305a63=_0x580bf9[_0xa990('0x35')]({'plain':!![]});var _0x5ba386=_0xa990('0x36');return db[_0xa990('0x37')][_0xa990('0x38')]({'where':{'type':_0x5ba386,'resourceId':_0x305a63['id']}})[_0xa990('0x1f')](function(){return _0x580bf9;});})[_0xa990('0x1f')](function(){_0x1cfc75[_0xa990('0x2c')](0xcc)[_0xa990('0x2b')]();});}};}function handleEntityNotFound(_0x468a34,_0x2bd3dd){return function(_0x409713){if(!_0x409713){_0x468a34['sendStatus'](0x194);}return _0x409713;};}function handleError(_0x10d522,_0x2deb2e){_0x2deb2e=_0x2deb2e||0x1f4;return function(_0x5844ed){logger[_0xa990('0x25')](_0x5844ed[_0xa990('0x39')]);if(_0x5844ed[_0xa990('0x3a')]){delete _0x5844ed[_0xa990('0x3a')];}_0x10d522[_0xa990('0x2c')](_0x2deb2e)['send'](_0x5844ed);};}exports['index']=function(_0x33ff92,_0x39abf8){var _0x19c649={'include':[{'model':db['Pause'],'as':_0xa990('0x3b')}]},_0x3ea3de={},_0x2e29d2={'count':0x0,'rows':[]};var _0x2be7e5=db[_0xa990('0x3c')]['rawAttributes'];_0x3ea3de['model']=_['keys'](_0x2be7e5);_0x3ea3de[_0xa990('0x3d')]=_[_0xa990('0x3e')](_0x33ff92[_0xa990('0x3d')]);_0x3ea3de[_0xa990('0x3f')]=_[_0xa990('0x40')](_0x3ea3de[_0xa990('0x41')],_0x3ea3de['query']);_0x19c649[_0xa990('0x42')]=_[_0xa990('0x40')](_0x3ea3de[_0xa990('0x41')],qs[_0xa990('0x43')](_0x33ff92[_0xa990('0x3d')][_0xa990('0x43')]));_0x19c649['attributes']=_0x19c649['attributes'][_0xa990('0x44')]?_0x19c649[_0xa990('0x42')]:_0x3ea3de[_0xa990('0x41')];if(!_0x33ff92[_0xa990('0x3d')][_0xa990('0x45')](_0xa990('0x46'))){_0x19c649[_0xa990('0x47')]=qs[_0xa990('0x47')](_0x33ff92[_0xa990('0x3d')][_0xa990('0x47')]);_0x19c649[_0xa990('0x2e')]=qs[_0xa990('0x2e')](_0x33ff92['query'][_0xa990('0x2e')]);}_0x19c649[_0xa990('0x48')]=qs[_0xa990('0x49')](_0x33ff92[_0xa990('0x3d')]['sort']);_0x19c649['where']=qs[_0xa990('0x3f')](_[_0xa990('0x4a')](_0x33ff92[_0xa990('0x3d')],_0x3ea3de[_0xa990('0x3f')]));if(_0x33ff92[_0xa990('0x3d')]['filter']){_0x19c649[_0xa990('0x4b')]=_[_0xa990('0x4c')](_0x19c649[_0xa990('0x4b')],{'$or':_[_0xa990('0x4d')](_0x2be7e5,function(_0x552bd1){if(_0x552bd1[_0xa990('0x4e')][_0xa990('0x4f')]!==_0xa990('0x50')){var _0x2130e5={};_0x2130e5[_0x552bd1[_0xa990('0x51')]]={'$like':'%'+_0x33ff92[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x2130e5;}})});}_0x19c649=_['merge']({},_0x19c649,_0x33ff92[_0xa990('0x53')]);var _0x3b614d={'where':_0x19c649[_0xa990('0x4b')]};return db[_0xa990('0x3c')][_0xa990('0x2d')](_0x3b614d)['then'](function(_0x78c56d){_0x2e29d2[_0xa990('0x2d')]=_0x78c56d;if(_0x33ff92[_0xa990('0x3d')][_0xa990('0x54')]){_0x19c649[_0xa990('0x55')]=[{'all':!![]}];}return db['SmsAccount'][_0xa990('0x56')](_0x19c649);})['then'](function(_0x185154){_0x2e29d2['rows']=_0x185154;return _0x2e29d2;})[_0xa990('0x1f')](respondWithFilteredResult(_0x39abf8,_0x19c649))[_0xa990('0x29')](handleError(_0x39abf8,null));};exports[_0xa990('0x57')]=function(_0x2a2e6b,_0x8aae56){var _0x44fa4b={'raw':![],'where':{'id':_0x2a2e6b[_0xa990('0x58')]['id']},'include':[{'model':db[_0xa990('0x59')],'as':_0xa990('0x3b')}]},_0x14018c={};_0x14018c[_0xa990('0x41')]=_['keys'](db[_0xa990('0x3c')][_0xa990('0x5a')]);_0x14018c[_0xa990('0x3d')]=_['keys'](_0x2a2e6b[_0xa990('0x3d')]);_0x14018c['filters']=_[_0xa990('0x40')](_0x14018c[_0xa990('0x41')],_0x14018c[_0xa990('0x3d')]);_0x44fa4b[_0xa990('0x42')]=_[_0xa990('0x40')](_0x14018c[_0xa990('0x41')],qs[_0xa990('0x43')](_0x2a2e6b['query']['fields']));_0x44fa4b[_0xa990('0x42')]=_0x44fa4b[_0xa990('0x42')]['length']?_0x44fa4b[_0xa990('0x42')]:_0x14018c[_0xa990('0x41')];if(_0x2a2e6b[_0xa990('0x3d')][_0xa990('0x54')]){_0x44fa4b[_0xa990('0x55')]=[{'all':!![]}];}_0x44fa4b=_[_0xa990('0x4c')]({},_0x44fa4b,_0x2a2e6b['options']);return db[_0xa990('0x3c')]['find'](_0x44fa4b)[_0xa990('0x1f')](handleEntityNotFound(_0x8aae56,null))[_0xa990('0x1f')](respondWithResult(_0x8aae56,null))[_0xa990('0x29')](handleError(_0x8aae56,null));};exports[_0xa990('0x5b')]=function(_0x342743,_0x1e471f){return db[_0xa990('0x3c')][_0xa990('0x5b')](_0x342743[_0xa990('0x5c')],{})[_0xa990('0x1f')](function(_0x2d339c){var _0x692852=_0x342743['user'][_0xa990('0x35')]({'plain':!![]});if(!_0x692852)throw new Error(_0xa990('0x5d'));if(_0x692852[_0xa990('0x5e')]==='user'){var _0x5a0630=_0x2d339c[_0xa990('0x35')]({'plain':!![]});var _0x176e79=_0xa990('0x36');return db[_0xa990('0x5f')][_0xa990('0x60')]({'where':{'name':_0x176e79,'userProfileId':_0x692852[_0xa990('0x61')]},'raw':!![]})[_0xa990('0x1f')](function(_0x80639f){if(_0x80639f&&_0x80639f[_0xa990('0x62')]===0x0){return db[_0xa990('0x37')][_0xa990('0x5b')]({'name':_0x5a0630[_0xa990('0x3a')],'resourceId':_0x5a0630['id'],'type':_0x80639f[_0xa990('0x3a')],'sectionId':_0x80639f['id']},{})[_0xa990('0x1f')](function(){return _0x2d339c;});}else{return _0x2d339c;}})[_0xa990('0x29')](function(_0x5a5b0a){logger[_0xa990('0x25')](_0xa990('0x63'),_0x5a5b0a);throw _0x5a5b0a;});}return _0x2d339c;})['then'](respondWithResult(_0x1e471f,0xc9))[_0xa990('0x29')](handleError(_0x1e471f,null));};exports['update']=function(_0x1700bf,_0x4d0a5e){if(_0x1700bf['body']['id']){delete _0x1700bf[_0xa990('0x5c')]['id'];}return db[_0xa990('0x3c')]['find']({'where':{'id':_0x1700bf[_0xa990('0x58')]['id']},'include':[{'model':db[_0xa990('0x59')],'as':_0xa990('0x3b')}]})['then'](handleEntityNotFound(_0x4d0a5e,null))[_0xa990('0x1f')](saveUpdates(_0x1700bf[_0xa990('0x5c')],null))['then'](respondWithResult(_0x4d0a5e,null))[_0xa990('0x29')](handleError(_0x4d0a5e,null));};exports[_0xa990('0x38')]=function(_0x3be83d,_0x446ce2){return db[_0xa990('0x3c')][_0xa990('0x60')]({'where':{'id':_0x3be83d[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x446ce2,null))['then'](removeEntity(_0x446ce2,null))['catch'](handleError(_0x446ce2,null));};exports[_0xa990('0x64')]=function(_0xafe237,_0x58dd9f){return db[_0xa990('0x3c')][_0xa990('0x64')]()[_0xa990('0x1f')](respondWithResult(_0x58dd9f,null))[_0xa990('0x29')](handleError(_0x58dd9f,null));};exports['addDisposition']=function(_0x48d704,_0x1ea5f2,_0x583648){if(_0x48d704[_0xa990('0x5c')]['id']){delete _0x48d704[_0xa990('0x5c')]['id'];}return db['SmsAccount'][_0xa990('0x60')]({'where':{'id':_0x48d704['params']['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x1ea5f2,null))['then'](function(_0x4d4bbd){if(_0x4d4bbd){_0x48d704[_0xa990('0x5c')]['SmsAccountId']=_0x4d4bbd['id'];return db[_0xa990('0x65')]['create'](_0x48d704[_0xa990('0x5c')]);}})[_0xa990('0x1f')](respondWithResult(_0x1ea5f2,null))[_0xa990('0x29')](handleError(_0x1ea5f2,null));};exports[_0xa990('0x66')]=function(_0x24a32f,_0x56a8d2,_0x5ea002){var _0x4179e2={'raw':![],'where':{}};var _0x3bde48={};var _0x5f184b={'count':0x0,'rows':[]};return db[_0xa990('0x3c')][_0xa990('0x67')]({'where':{'id':_0x24a32f[_0xa990('0x58')]['id']}})['then'](handleEntityNotFound(_0x56a8d2,null))[_0xa990('0x1f')](function(_0x20899f){if(_0x20899f){_0x3bde48[_0xa990('0x41')]=_[_0xa990('0x3e')](db['Disposition']['rawAttributes']);_0x3bde48[_0xa990('0x3d')]=_[_0xa990('0x3e')](_0x24a32f[_0xa990('0x3d')]);_0x3bde48['filters']=_[_0xa990('0x40')](_0x3bde48[_0xa990('0x41')],_0x3bde48['query']);_0x4179e2['attributes']=_[_0xa990('0x40')](_0x3bde48[_0xa990('0x41')],qs[_0xa990('0x43')](_0x24a32f[_0xa990('0x3d')][_0xa990('0x43')]));_0x4179e2[_0xa990('0x42')]=_0x4179e2[_0xa990('0x42')]['length']?_0x4179e2[_0xa990('0x42')]:_0x3bde48[_0xa990('0x41')];if(!_0x24a32f[_0xa990('0x3d')][_0xa990('0x45')]('nolimit')){_0x4179e2['limit']=qs[_0xa990('0x47')](_0x24a32f[_0xa990('0x3d')]['limit']);_0x4179e2[_0xa990('0x2e')]=qs['offset'](_0x24a32f['query'][_0xa990('0x2e')]);}_0x4179e2[_0xa990('0x48')]=qs[_0xa990('0x49')](_0x24a32f[_0xa990('0x3d')][_0xa990('0x49')]);_0x4179e2[_0xa990('0x4b')]=qs[_0xa990('0x3f')](_[_0xa990('0x4a')](_0x24a32f[_0xa990('0x3d')],_0x3bde48[_0xa990('0x3f')]));_0x4179e2[_0xa990('0x4b')][_0xa990('0x68')]=_0x20899f['id'];if(_0x24a32f[_0xa990('0x3d')][_0xa990('0x52')]){_0x4179e2[_0xa990('0x4b')]=_['merge'](_0x4179e2[_0xa990('0x4b')],{'$or':_['map'](_0x4179e2[_0xa990('0x42')],function(_0x4a666){var _0x404ad1={};_0x404ad1[_0x4a666]={'$like':'%'+_0x24a32f[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x404ad1;})});}_0x4179e2=_[_0xa990('0x4c')]({},_0x4179e2,_0x24a32f[_0xa990('0x53')]);return db['Disposition'][_0xa990('0x2d')]({'where':_0x4179e2['where']})[_0xa990('0x1f')](function(_0x209832){_0x5f184b[_0xa990('0x2d')]=_0x209832;if(_0x24a32f[_0xa990('0x3d')][_0xa990('0x54')]){_0x4179e2[_0xa990('0x55')]=[{'all':!![]}];}return db[_0xa990('0x65')]['findAll'](_0x4179e2);})['then'](function(_0xa33707){_0x5f184b[_0xa990('0x69')]=_0xa33707;return _0x5f184b;});}})[_0xa990('0x1f')](respondWithFilteredResult(_0x56a8d2,_0x4179e2))[_0xa990('0x29')](handleError(_0x56a8d2,null));};exports[_0xa990('0x6a')]=function(_0x1e53f3,_0x5df6ed,_0x2ea5d0){return db[_0xa990('0x3c')][_0xa990('0x60')]({'where':{'id':_0x1e53f3['params']['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x5df6ed,null))[_0xa990('0x1f')](function(_0x8ee76c){if(_0x8ee76c){return _0x8ee76c[_0xa990('0x6a')](_0x1e53f3[_0xa990('0x3d')][_0xa990('0x6b')]);}})[_0xa990('0x1f')](respondWithStatusCode(_0x5df6ed,null))[_0xa990('0x29')](handleError(_0x5df6ed,null));};exports[_0xa990('0x6c')]=function(_0x30ced5,_0x3c8419,_0x382604){if(_0x30ced5[_0xa990('0x5c')]['id']){delete _0x30ced5[_0xa990('0x5c')]['id'];}return db['SmsAccount'][_0xa990('0x60')]({'where':{'id':_0x30ced5[_0xa990('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c8419,null))[_0xa990('0x1f')](function(_0x9560da){if(_0x9560da){_0x30ced5[_0xa990('0x5c')][_0xa990('0x68')]=_0x9560da['id'];return db['CannedAnswer'][_0xa990('0x5b')](_0x30ced5[_0xa990('0x5c')]);}})[_0xa990('0x1f')](respondWithResult(_0x3c8419,null))[_0xa990('0x29')](handleError(_0x3c8419,null));};exports[_0xa990('0x6d')]=function(_0x3bc666,_0x176ef5,_0xad45b8){var _0x3cdff5={'raw':![],'where':{}};var _0x158795={};var _0x4f8eee={'count':0x0,'rows':[]};return db[_0xa990('0x3c')]['findOne']({'where':{'id':_0x3bc666[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x176ef5,null))[_0xa990('0x1f')](function(_0x2b8972){if(_0x2b8972){_0x158795[_0xa990('0x41')]=_[_0xa990('0x3e')](db[_0xa990('0x6e')][_0xa990('0x5a')]);_0x158795[_0xa990('0x3d')]=_[_0xa990('0x3e')](_0x3bc666[_0xa990('0x3d')]);_0x158795[_0xa990('0x3f')]=_[_0xa990('0x40')](_0x158795[_0xa990('0x41')],_0x158795['query']);_0x3cdff5[_0xa990('0x42')]=_[_0xa990('0x40')](_0x158795['model'],qs[_0xa990('0x43')](_0x3bc666[_0xa990('0x3d')][_0xa990('0x43')]));_0x3cdff5[_0xa990('0x42')]=_0x3cdff5[_0xa990('0x42')][_0xa990('0x44')]?_0x3cdff5[_0xa990('0x42')]:_0x158795[_0xa990('0x41')];if(!_0x3bc666['query'][_0xa990('0x45')](_0xa990('0x46'))){_0x3cdff5[_0xa990('0x47')]=qs['limit'](_0x3bc666[_0xa990('0x3d')][_0xa990('0x47')]);_0x3cdff5[_0xa990('0x2e')]=qs['offset'](_0x3bc666[_0xa990('0x3d')][_0xa990('0x2e')]);}_0x3cdff5['order']=qs[_0xa990('0x49')](_0x3bc666[_0xa990('0x3d')][_0xa990('0x49')]);_0x3cdff5['where']=qs[_0xa990('0x3f')](_['pick'](_0x3bc666[_0xa990('0x3d')],_0x158795[_0xa990('0x3f')]));_0x3cdff5[_0xa990('0x4b')]['SmsAccountId']=_0x2b8972['id'];if(_0x3bc666[_0xa990('0x3d')][_0xa990('0x52')]){_0x3cdff5[_0xa990('0x4b')]=_[_0xa990('0x4c')](_0x3cdff5[_0xa990('0x4b')],{'$or':_[_0xa990('0x4d')](_0x3cdff5[_0xa990('0x42')],function(_0x3f4f52){var _0x1f0f19={};_0x1f0f19[_0x3f4f52]={'$like':'%'+_0x3bc666[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x1f0f19;})});}_0x3cdff5=_[_0xa990('0x4c')]({},_0x3cdff5,_0x3bc666['options']);return db['CannedAnswer']['count']({'where':_0x3cdff5['where']})[_0xa990('0x1f')](function(_0x48b6e0){_0x4f8eee['count']=_0x48b6e0;if(_0x3bc666['query'][_0xa990('0x54')]){_0x3cdff5[_0xa990('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa990('0x56')](_0x3cdff5);})['then'](function(_0x1dd941){_0x4f8eee[_0xa990('0x69')]=_0x1dd941;return _0x4f8eee;});}})[_0xa990('0x1f')](respondWithFilteredResult(_0x176ef5,_0x3cdff5))[_0xa990('0x29')](handleError(_0x176ef5,null));};exports[_0xa990('0x6f')]=function(_0x26ca9f,_0x38371c,_0x3e6a1c){return db[_0xa990('0x3c')][_0xa990('0x60')]({'where':{'id':_0x26ca9f[_0xa990('0x58')]['id']}})['then'](handleEntityNotFound(_0x38371c,null))[_0xa990('0x1f')](function(_0x5aac07){if(_0x5aac07){return _0x5aac07[_0xa990('0x6f')](_0x26ca9f['query']['ids']);}})['then'](respondWithStatusCode(_0x38371c,null))[_0xa990('0x29')](handleError(_0x38371c,null));};exports['notify']=function(_0x35031e,_0x41c647,_0x27e640){var _0x30c091={'channel':'sms'};var _0x27828f=[];var _0x322a13=[];var _0xd5f624={};return db['SmsAccount'][_0xa990('0x60')]({'where':{'id':_0x35031e['params']['id']},'include':[{'model':db[_0xa990('0x70')],'as':_0xa990('0x71')}]})[_0xa990('0x1f')](handleEntityNotFound(_0x41c647,null))[_0xa990('0x1f')](function(_0x4bd0b1){_0x30c091[_0xa990('0x72')]=_0x4bd0b1;_0x30c091[_0xa990('0x73')]=_[_0xa990('0x74')](_0x4bd0b1[_0xa990('0x71')],['priority'],[_0xa990('0x75')]);if(_0x30c091[_0xa990('0x72')]['Applications']){delete _0x30c091[_0xa990('0x72')][_0xa990('0x71')];}return db[_0xa990('0x76')][_0xa990('0x64')]();})[_0xa990('0x1f')](function(_0x23acdd){if(!_0x23acdd){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))](_0xa990('0x79'));}_0x27828f=_[_0xa990('0x7a')](_['keys'](_0x23acdd),[_0xa990('0x7b'),_0xa990('0x7c')]);_0x322a13=_[_0xa990('0x7a')](_[_0xa990('0x3e')](_0x23acdd),[_0xa990('0x7b'),'updatedAt',_0xa990('0x7d'),'ListId']);_0x30c091[_0xa990('0x5c')]={'mapKey':_0xa990('0x7e')};if(_0x30c091[_0xa990('0x72')][_0xa990('0x4e')]){switch(_0x30c091['account'][_0xa990('0x4e')]){case _0xa990('0x7f'):_0x30c091[_0xa990('0x5c')][_0xa990('0x80')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x81')];_0x30c091[_0xa990('0x5c')]['body']=_0x35031e[_0xa990('0x5c')][_0xa990('0x82')];_0x30c091['body']['messageId']=_0x35031e[_0xa990('0x5c')]['MessageSid'];break;case'skebby':_0x30c091[_0xa990('0x5c')]['from']='+'+_0x35031e[_0xa990('0x5c')][_0xa990('0x83')];_0x30c091['body'][_0xa990('0x5c')]=_0x35031e[_0xa990('0x5c')]['text'];break;case'connectel':_0x30c091[_0xa990('0x5c')]['from']=_0x35031e[_0xa990('0x5c')]['from'];_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')]=_0x35031e['body'][_0xa990('0x27')];break;case _0xa990('0x84'):_0x30c091[_0xa990('0x5c')]['from']=_0x35031e[_0xa990('0x5c')][_0xa990('0x80')];_0x30c091[_0xa990('0x5c')]['body']=_0x35031e[_0xa990('0x5c')][_0xa990('0x5c')];_0x30c091[_0xa990('0x5c')]['messageId']=_0x35031e[_0xa990('0x5c')][_0xa990('0x85')];break;case'plivo':_0x30c091[_0xa990('0x5c')][_0xa990('0x80')]=_0x35031e['body'][_0xa990('0x81')];_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')]=_0x35031e[_0xa990('0x5c')]['Text'];_0x30c091[_0xa990('0x5c')][_0xa990('0x86')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x87')];break;case'infobip':_0x30c091[_0xa990('0x5c')][_0xa990('0x80')]='+'+_0x35031e[_0xa990('0x5c')][_0xa990('0x88')][0x0][_0xa990('0x80')];_0x30c091['body']['body']=_0x35031e[_0xa990('0x5c')][_0xa990('0x88')][0x0]['text'];_0x30c091[_0xa990('0x5c')][_0xa990('0x86')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x88')][0x0][_0xa990('0x86')];break;case _0xa990('0x89'):_0x30c091[_0xa990('0x5c')]['from']=_0x35031e[_0xa990('0x5c')][_0xa990('0x8a')];_0x30c091['body'][_0xa990('0x5c')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x8b')][_0xa990('0x27')];break;case'clickatell':_0x30c091[_0xa990('0x5c')][_0xa990('0x80')]=_0x35031e['body']['fromNumber'];_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')]=_0x35031e[_0xa990('0x5c')]['text'];_0x30c091['body'][_0xa990('0x86')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x8c')];break;case _0xa990('0x8d'):_0x30c091['body'][_0xa990('0x80')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x80')];_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x27')];_0x30c091[_0xa990('0x5c')][_0xa990('0x86')]=_0x35031e[_0xa990('0x5c')][_0xa990('0x8e')];break;}}if(_0x30c091['body']['id']){delete _0x30c091[_0xa990('0x5c')]['id'];}if(_[_0xa990('0x8f')](_0x30c091[_0xa990('0x5c')][_0xa990('0x80')])){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))]('from\x20is\x20mandatory');}if(_[_0xa990('0x8f')](_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')])||_0x30c091[_0xa990('0x5c')][_0xa990('0x5c')]===''){throw new db[(_0xa990('0x77'))]['ValidationError'](_0xa990('0x90'));}if(_[_0xa990('0x8f')](_0x30c091[_0xa990('0x5c')]['mapKey'])){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))](_0xa990('0x91')+_0x322a13);}if(!_[_0xa990('0x92')](_0x322a13,_0x30c091[_0xa990('0x5c')][_0xa990('0x93')])){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))](_0xa990('0x94')+_0x322a13);}_0xd5f624[_0x30c091[_0xa990('0x5c')][_0xa990('0x93')]]=_0x30c091[_0xa990('0x5c')][_0xa990('0x80')];return db[_0xa990('0x95')][_0xa990('0x60')]({'where':{'id':_0x30c091['account'][_0xa990('0x96')]},'include':[{'model':db[_0xa990('0x76')],'as':_0xa990('0x97'),'where':_0xd5f624,'limit':0x1,'order':[[_0xa990('0x7c'),_0xa990('0x98')]]}]});})[_0xa990('0x1f')](handleEntityNotFound(_0x41c647,null))['then'](function(_0x6a140){if(_0x6a140){_0x30c091[_0xa990('0x99')]=_[_0xa990('0x9a')](_0x6a140,['Contacts']);if(_0x6a140[_0xa990('0x97')][_0xa990('0x44')]){return _0x6a140[_0xa990('0x97')][0x0];}var _0x4fa82f=_[_0xa990('0x9b')](_0x30c091[_0xa990('0x5c')],{'firstName':_0x30c091[_0xa990('0x5c')]['from'],'ListId':_0x6a140['id']});_0x4fa82f[_0x30c091[_0xa990('0x5c')][_0xa990('0x93')]]=_0x30c091[_0xa990('0x5c')][_0xa990('0x80')];return db[_0xa990('0x76')]['create'](_0x4fa82f,{'fields':_0x27828f,'raw':!![]});}})[_0xa990('0x1f')](handleEntityNotFound(_0x41c647,null))[_0xa990('0x1f')](function(_0x374434){if(_0x374434){_0x30c091[_0xa990('0x9c')]=_0x374434;var _0x44477f={'ContactId':_0x374434['id'],'phone':_0x30c091[_0xa990('0x5c')][_0xa990('0x80')],'SmsAccountId':_0x35031e[_0xa990('0x58')]['id']};var _0x4a2117={'ContactId':_0x374434['id'],'SmsAccountId':_0x35031e[_0xa990('0x58')]['id'],'closed':![]};return db['SmsInteraction'][_0xa990('0x60')]({'where':_0x4a2117})[_0xa990('0x1f')](function(_0x177fcf){if(_0x177fcf){return[_0x177fcf,![]];}return db['SmsInteraction'][_0xa990('0x5b')](_0x44477f)[_0xa990('0x1f')](function(_0x5abc8f){return[_0x5abc8f,!![]];});});}})['spread'](function(_0x5c8eba,_0x3b8b49){_0x30c091[_0xa990('0x9d')]=_0x5c8eba['get']({'plain':!![]});_0x30c091['interaction']['created']=![];if(_0x3b8b49){if(_0x30c091[_0xa990('0x72')][_0xa990('0x9e')]){_0x30c091[_0xa990('0x73')][_0xa990('0x9f')]({'id':0x0,'priority':_0x30c091['applications'][_0xa990('0x44')]+0x1,'app':_0xa990('0xa0'),'appdata':_0xa990('0xa1'),'interval':_0xa990('0xa2')});}_0x30c091[_0xa990('0x9d')]['created']=!![];}return db[_0xa990('0xa3')][_0xa990('0x5b')]({'phone':_0x30c091[_0xa990('0x5c')][_0xa990('0x80')],'messageId':_0x30c091['body'][_0xa990('0x86')],'body':_0x30c091['body']['body'],'SmsAccountId':_0x35031e['params']['id'],'SmsInteractionId':_0x5c8eba['id'],'direction':'in','ContactId':_0x5c8eba[_0xa990('0xa4')],'AttachmentId':_0x30c091[_0xa990('0x5c')][_0xa990('0xa5')]});})['then'](function(_0x9896a1){_0x30c091[_0xa990('0x27')]=_0x9896a1;if(_0x30c091['interaction'][_0xa990('0xa6')]){return db['User'][_0xa990('0x60')]({'attributes':['id',_0xa990('0x3a')],'where':{'id':_0x30c091[_0xa990('0x9d')][_0xa990('0xa6')]}})[_0xa990('0x1f')](function(_0x52dd39){if(_0x52dd39){_0x30c091[_0xa990('0x73')][_0xa990('0xa7')]({'id':0x0,'priority':0x0,'app':_0xa990('0xa8'),'appdata':_0x52dd39[_0xa990('0x3a')]+','+(_0x30c091[_0xa990('0x72')][_0xa990('0xa9')]||0xa),'interval':_0xa990('0xa2')});}return respondWithRpcPromise('Start',_0xa990('0xaa'),_0x30c091);});}return respondWithRpcPromise('Start',_0xa990('0xaa'),_0x30c091);})[_0xa990('0x1f')](function(_0x435c55){if(_0x435c55){var _0x3beb06=0xc8;var _0x414c31=_0xa990('0xab');logger[_0xa990('0x20')](_0xa990('0xac'),_0x414c31,_0x3beb06,'entity\x20found');logger[_0xa990('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x414c31,_0x3beb06,_0xa990('0xad'),JSON[_0xa990('0x24')](_0x435c55));if(_0x30c091[_0xa990('0x72')][_0xa990('0x4e')]===_0xa990('0x7f')){return _0x41c647[_0xa990('0x2c')](_0x3beb06)['set'](_0xa990('0xae'),_0xa990('0xaf'))[_0xa990('0xb0')](_0xa990('0xb1'));}else{return _0x41c647['status'](_0x3beb06)['json'](_0x435c55);}}})[_0xa990('0x29')](handleError(_0x41c647,null));};exports[_0xa990('0xb2')]=function(_0x3deade,_0x117dfe,_0x99a21){return db[_0xa990('0x3c')]['findOne']({'where':{'id':_0x3deade[_0xa990('0x58')]['id']}})['then'](handleEntityNotFound(_0x117dfe,null))[_0xa990('0x1f')](function(_0x26abc5){if(_0x26abc5){return db['sequelize']['transaction'](function(_0x102a69){return db[_0xa990('0x70')][_0xa990('0x38')]({'where':{'SmsAccountId':_0x3deade[_0xa990('0x58')]['id']},'transaction':_0x102a69})[_0xa990('0x1f')](function(_0x3f0207){var _0x390656=_[_0xa990('0x4d')](_0x3deade[_0xa990('0x5c')],function(_0x51409a){_0x51409a[_0xa990('0x68')]=_0x3deade[_0xa990('0x58')]['id'];return _0x51409a;});return db['SmsApplication'][_0xa990('0xb3')](_0x390656,{'transaction':_0x102a69});});})[_0xa990('0x1f')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x3deade['params']['id']},'order':_0xa990('0xb4')});});}})[_0xa990('0x1f')](respondWithResult(_0x117dfe,null))[_0xa990('0x29')](handleError(_0x117dfe,null));};exports[_0xa990('0xb5')]=function(_0x50e1c2,_0x2b7c09,_0x29fc60){var _0x53f77f={};var _0x20c538={};var _0x379b68;var _0x2495fc;return db[_0xa990('0x3c')][_0xa990('0x67')]({'where':{'id':_0x50e1c2['params']['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x2b7c09,null))[_0xa990('0x1f')](function(_0x3f0529){if(_0x3f0529){_0x379b68=_0x3f0529;_0x20c538[_0xa990('0x41')]=_[_0xa990('0x3e')](db[_0xa990('0x70')][_0xa990('0x5a')]);_0x20c538[_0xa990('0x3d')]=_[_0xa990('0x3e')](_0x50e1c2['query']);_0x20c538[_0xa990('0x3f')]=_[_0xa990('0x40')](_0x20c538[_0xa990('0x41')],_0x20c538['query']);_0x53f77f[_0xa990('0x42')]=_['intersection'](_0x20c538[_0xa990('0x41')],qs[_0xa990('0x43')](_0x50e1c2['query']['fields']));_0x53f77f['attributes']=_0x53f77f[_0xa990('0x42')][_0xa990('0x44')]?_0x53f77f[_0xa990('0x42')]:_0x20c538[_0xa990('0x41')];_0x53f77f[_0xa990('0x48')]=qs[_0xa990('0x49')](_0x50e1c2[_0xa990('0x3d')][_0xa990('0x49')]);_0x53f77f[_0xa990('0x4b')]=qs['filters'](_[_0xa990('0x4a')](_0x50e1c2['query'],_0x20c538[_0xa990('0x3f')]));if(_0x50e1c2[_0xa990('0x3d')][_0xa990('0x52')]){_0x53f77f['where']=_[_0xa990('0x4c')](_0x53f77f['where'],{'$or':_[_0xa990('0x4d')](_0x53f77f[_0xa990('0x42')],function(_0x4ac3f5){var _0x303ec4={};_0x303ec4[_0x4ac3f5]={'$like':'%'+_0x50e1c2[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x303ec4;})});}_0x53f77f=_['merge']({},_0x53f77f,_0x50e1c2['options']);return _0x379b68[_0xa990('0xb5')](_0x53f77f);}})[_0xa990('0x1f')](function(_0x37ff9f){if(_0x37ff9f){_0x2495fc=_0x37ff9f[_0xa990('0x44')];if(!_0x50e1c2[_0xa990('0x3d')]['hasOwnProperty'](_0xa990('0x46'))){_0x53f77f[_0xa990('0x47')]=qs[_0xa990('0x47')](_0x50e1c2[_0xa990('0x3d')][_0xa990('0x47')]);_0x53f77f[_0xa990('0x2e')]=qs[_0xa990('0x2e')](_0x50e1c2['query']['offset']);}return _0x379b68['getApplications'](_0x53f77f);}})[_0xa990('0x1f')](function(_0x20c061){if(_0x20c061){return _0x20c061?{'count':_0x2495fc,'rows':_0x20c061}:null;}})[_0xa990('0x1f')](respondWithResult(_0x2b7c09,null))[_0xa990('0x29')](handleError(_0x2b7c09,null));};exports[_0xa990('0xb6')]=function(_0x5792,_0x21addb,_0xef7b68){var _0x50ffbe={'raw':![],'where':{}};var _0x5bd504={};var _0x568e40={'count':0x0,'rows':[]};return db[_0xa990('0x3c')]['findOne']({'where':{'id':_0x5792[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x21addb,null))[_0xa990('0x1f')](function(_0x314ee0){if(_0x314ee0){_0x5bd504[_0xa990('0x41')]=_[_0xa990('0x3e')](db[_0xa990('0xb7')]['rawAttributes']);_0x5bd504[_0xa990('0x3d')]=_['keys'](_0x5792['query']);_0x5bd504['filters']=_[_0xa990('0x40')](_0x5bd504[_0xa990('0x41')],_0x5bd504[_0xa990('0x3d')]);_0x50ffbe[_0xa990('0x42')]=_[_0xa990('0x40')](_0x5bd504[_0xa990('0x41')],qs[_0xa990('0x43')](_0x5792['query']['fields']));_0x50ffbe['attributes']=_0x50ffbe['attributes'][_0xa990('0x44')]?_0x50ffbe['attributes']:_0x5bd504[_0xa990('0x41')];if(!_0x5792[_0xa990('0x3d')][_0xa990('0x45')]('nolimit')){_0x50ffbe[_0xa990('0x47')]=qs[_0xa990('0x47')](_0x5792['query']['limit']);_0x50ffbe['offset']=qs[_0xa990('0x2e')](_0x5792[_0xa990('0x3d')]['offset']);}_0x50ffbe[_0xa990('0x48')]=qs[_0xa990('0x49')](_0x5792[_0xa990('0x3d')][_0xa990('0x49')]);_0x50ffbe[_0xa990('0x4b')]=qs[_0xa990('0x3f')](_[_0xa990('0x4a')](_0x5792[_0xa990('0x3d')],_0x5bd504[_0xa990('0x3f')]));_0x50ffbe[_0xa990('0x4b')][_0xa990('0x68')]=_0x314ee0['id'];if(_0x5792[_0xa990('0x3d')][_0xa990('0x52')]){_0x50ffbe[_0xa990('0x4b')]=_[_0xa990('0x4c')](_0x50ffbe[_0xa990('0x4b')],{'$or':_[_0xa990('0x4d')](_0x50ffbe[_0xa990('0x42')],function(_0x35c6a1){var _0x5ad689={};_0x5ad689[_0x35c6a1]={'$like':'%'+_0x5792[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x5ad689;})});}_0x50ffbe=_[_0xa990('0x4c')]({},_0x50ffbe,_0x5792[_0xa990('0x53')]);return db[_0xa990('0xb7')][_0xa990('0x2d')]({'where':_0x50ffbe[_0xa990('0x4b')]})['then'](function(_0x1b7d0f){_0x568e40[_0xa990('0x2d')]=_0x1b7d0f;if(_0x5792[_0xa990('0x3d')]['includeAll']){_0x50ffbe[_0xa990('0x55')]=[{'model':db[_0xa990('0x76')],'as':'Contact','required':![]},{'model':db[_0xa990('0xb8')],'as':_0xa990('0xb9'),'attributes':[_0xa990('0x3a'),'fullname',_0xa990('0xba')],'required':![]},{'model':db[_0xa990('0xbb')],'as':_0xa990('0xbc'),'attributes':['id',_0xa990('0x3a'),'color'],'where':_0x5792['query'][_0xa990('0xbd')]?{'id':_0x5792[_0xa990('0x3d')][_0xa990('0xbd')]}:undefined,'required':_0x5792[_0xa990('0x3d')]['tag']?!![]:![]}];}return db[_0xa990('0xb7')][_0xa990('0x56')](_0x50ffbe);})['then'](function(_0x372d9f){_0x568e40[_0xa990('0x69')]=_0x372d9f;return _0x568e40;});}})[_0xa990('0x1f')](respondWithFilteredResult(_0x21addb,_0x50ffbe))[_0xa990('0x29')](handleError(_0x21addb,null));};exports[_0xa990('0xb0')]=function(_0x8aa1e0,_0x4e953e,_0x1cf2df){var _0x1a4737,_0x25c588,_0x1fc8d1;if(_[_0xa990('0x8f')](_0x8aa1e0[_0xa990('0x5c')][_0xa990('0x5c')])||_0x8aa1e0[_0xa990('0x5c')]['body']===''){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))](_0xa990('0x90'));}if(_[_0xa990('0x8f')](_0x8aa1e0[_0xa990('0x5c')]['to'])){throw new db[(_0xa990('0x77'))][(_0xa990('0x78'))](_0xa990('0xbe'));}_0x1a4737=_0x8aa1e0['body']['to'];return db[_0xa990('0x3c')]['find']({'where':{'id':_0x8aa1e0[_0xa990('0x58')]['id']},'include':[{'model':db[_0xa990('0x95')],'as':_0xa990('0xbf'),'include':[{'model':db['CmContact'],'as':_0xa990('0x97'),'where':{'mobile':_0x1a4737},'limit':0x1,'order':[[_0xa990('0x7c'),_0xa990('0x98')]]}]}]})[_0xa990('0x1f')](handleEntityNotFound(_0x4e953e,null))['then'](function(_0x433e06){if(_0x433e06&&_0x433e06[_0xa990('0xbf')]){_0x25c588=_0x433e06[_0xa990('0x35')]({'plain':!![]});if(_0x25c588[_0xa990('0xbf')]&&_0x25c588[_0xa990('0xbf')][_0xa990('0x97')][_0xa990('0x44')]){return _0x25c588[_0xa990('0xbf')][_0xa990('0x97')][0x0];}return db[_0xa990('0x76')]['create'](_['defaults'](_0x8aa1e0['body'],{'firstName':_0x1a4737,'mobile':_0x1a4737,'phone':_0x1a4737,'ListId':_0x25c588[_0xa990('0x96')]}));}})[_0xa990('0x1f')](handleEntityNotFound(_0x4e953e,null))[_0xa990('0x1f')](function(_0x1347d7){if(_0x1347d7){_0x1fc8d1=_0x1347d7;return db['SmsInteraction']['find']({'where':{'ContactId':_0x1fc8d1['id'],'closed':![],'SmsAccountId':_0x25c588['id']}})[_0xa990('0x1f')](function(_0x10e315){if(_0x10e315){return[_0x10e315,![]];}return db['SmsInteraction'][_0xa990('0x5b')]({'UserId':_0x8aa1e0[_0xa990('0xc0')]['id'],'ContactId':_0x1fc8d1['id'],'SmsAccountId':_0x25c588['id'],'phone':_0x1a4737,'firstMsgDirection':'out','Messages':[_[_0xa990('0x4c')](_0x8aa1e0[_0xa990('0x5c')],{'read':![],'body':_0x8aa1e0[_0xa990('0x5c')]['body'],'phone':_0x1a4737,'SmsAccountId':_0x25c588['id'],'UserId':_0x8aa1e0[_0xa990('0xc0')]['id'],'ContactId':_0x1fc8d1['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xa990('0xc1')}]})[_0xa990('0x1f')](function(_0x1feaaa){return[_0x1feaaa,!![]];});});}})[_0xa990('0xc2')](function(_0x4c5982,_0x23b296){if(_0x23b296){return _0x4c5982;}return db['SmsMessage'][_0xa990('0x5b')](_[_0xa990('0x4c')](_0x8aa1e0[_0xa990('0x5c')],{'read':![],'body':_0x8aa1e0[_0xa990('0x5c')][_0xa990('0x5c')],'phone':_0x1a4737,'SmsAccountId':_0x25c588['id'],'SmsInteractionId':_0x4c5982['id'],'UserId':_0x8aa1e0[_0xa990('0xc0')]['id'],'ContactId':_0x1fc8d1['id']}))[_0xa990('0x1f')](function(_0x3acc0f){_0x4c5982[_0xa990('0xc3')]['Messages']=[];_0x4c5982[_0xa990('0xc3')]['Messages'][_0xa990('0x9f')](_0x3acc0f[_0xa990('0xc3')]);return _0x4c5982;});})[_0xa990('0x1f')](respondWithResult(_0x4e953e,null))[_0xa990('0x29')](handleError(_0x4e953e,null));};exports[_0xa990('0x2c')]=function(_0xd031a5,_0x416035,_0x4ccdd1){if(_0xd031a5[_0xa990('0x5c')]['id']){delete _0xd031a5['body']['id'];}console[_0xa990('0xc4')](_0xa990('0xc5'),_0xd031a5[_0xa990('0x5c')]);var _0x268f12,_0x3b89b4,_0x592be6;return db[_0xa990('0x3c')]['find']({'where':{'id':_0xd031a5['params']['id']}})['then'](handleEntityNotFound(_0x416035,null))[_0xa990('0x1f')](function(_0x276ea9){if(_0x276ea9){_0x592be6=_0x276ea9;logger[_0xa990('0x23')](_0xa990('0xac'),_0xa990('0x2c'),'received\x20delivery\x20report\x20from',_0x276ea9['type'],util[_0xa990('0xc6')](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));switch(_0x276ea9[_0xa990('0x4e')]){case _0xa990('0xc7'):if(_0xd031a5[_0xa990('0x5c')]['skebby_dispatch_id']&&_0xd031a5[_0xa990('0x5c')]['status']){_0x3b89b4=_0xd031a5[_0xa990('0x5c')]['status'];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0xd031a5[_0xa990('0x5c')][_0xa990('0xc8')]}});}break;case _0xa990('0xc9'):if(_0xd031a5[_0xa990('0x5c')][_0xa990('0xca')]&&_0xd031a5[_0xa990('0x5c')][_0xa990('0xcb')]){_0x3b89b4=_0xd031a5[_0xa990('0x5c')][_0xa990('0xcb')];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0xd031a5[_0xa990('0x5c')][_0xa990('0xca')]}});}break;case _0xa990('0x84'):if(_0xd031a5[_0xa990('0x5c')][_0xa990('0x85')]&&_0xd031a5[_0xa990('0x5c')][_0xa990('0xcc')]){_0x3b89b4=_0xd031a5[_0xa990('0x5c')]['status_code'];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0xd031a5[_0xa990('0x5c')][_0xa990('0x85')]}});}break;case _0xa990('0xcd'):var _0x231e45=_0xd031a5[_0xa990('0x5c')][_0xa990('0x88')][0x0];if(_0x231e45['messageId']&&_0x231e45[_0xa990('0x2c')]['groupName']===_0xa990('0xce')){_0x3b89b4=_0x231e45['status'][_0xa990('0xcf')];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0x231e45[_0xa990('0x86')]}});}break;case _0xa990('0xd0'):if(_0xd031a5[_0xa990('0x5c')][_0xa990('0x86')]&&_0xd031a5[_0xa990('0x5c')][_0xa990('0x2c')]){_0x3b89b4=_0xd031a5['body'][_0xa990('0x2c')];return db[_0xa990('0xa3')]['find']({'where':{'messageId':_0xd031a5[_0xa990('0x5c')][_0xa990('0x86')]}});}break;case _0xa990('0x8d'):if(_0xd031a5[_0xa990('0x5c')][_0xa990('0xd1')]&&_0xd031a5[_0xa990('0x5c')][_0xa990('0x2c')]){_0x3b89b4=_0xd031a5[_0xa990('0x5c')]['status'];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0xd031a5[_0xa990('0x5c')]['redif']}});}break;}}})[_0xa990('0x1f')](handleEntityNotFound(_0x416035,null))[_0xa990('0x1f')](function(_0x1e0f58){if(_0x1e0f58){_0x268f12=_0x1e0f58;switch(_0x592be6['type']){case _0xa990('0xc7'):if(_0x3b89b4===_0xa990('0xce')){return _0x268f12[_0xa990('0x34')]({'read':!![]});}else{logger[_0xa990('0x25')](_0xa990('0xac'),_0xa990('0x2c'),_0xa990('0xc7'),util['inspect'](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa990('0xc9'):if(_0x3b89b4==='1'){return _0x268f12[_0xa990('0x34')]({'read':!![]});}else{logger['error'](_0xa990('0xac'),_0xa990('0x2c'),'skebby',util[_0xa990('0xc6')](_0xd031a5['body'],{'showHidden':![],'depth':null}));}break;case _0xa990('0x84'):if(!_0xd031a5['body']['error_code']&&_0x3b89b4>=0xc8&&_0x3b89b4<=0xce){return _0x268f12[_0xa990('0x34')]({'read':!![]});}else{logger[_0xa990('0x25')](_0xa990('0xac'),_0xa990('0x2c'),_0xa990('0x84'),util['inspect'](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5136db=_0xd031a5['body'][_0xa990('0x88')][0x0];if(_0x5136db[_0xa990('0x2c')][_0xa990('0xcf')]==='DELIVERED'){return _0x268f12[_0xa990('0x34')]({'read':!![]});}else{logger[_0xa990('0x25')](_0xa990('0xac'),_0xa990('0x2c'),_0xa990('0xcd'),util[_0xa990('0xc6')](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa990('0xd0'):if(_0x3b89b4==_0xa990('0xd2')||_0x3b89b4==_0xa990('0xd3')){return _0x268f12['update']({'read':!![]});}else{logger[_0xa990('0x25')](_0xa990('0xac'),_0xa990('0x2c'),'clickatell',util[_0xa990('0xc6')](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa990('0x8d'):if(_0x3b89b4===_0xa990('0xd4')||_0x3b89b4===_0xa990('0xd5')){return _0x268f12[_0xa990('0x34')]({'read':!![]});}else{logger['error'](_0xa990('0xac'),_0xa990('0x2c'),'intelepeer',util[_0xa990('0xc6')](_0xd031a5[_0xa990('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x268f12;}})[_0xa990('0x1f')](respondWithResult(_0x416035,null))['catch'](handleError(_0x416035,null));};exports['statusGet']=function(_0x4624ff,_0x391034,_0x3a4b09){var _0x58ead0,_0x51859c,_0x181806;return db['SmsAccount'][_0xa990('0x60')]({'where':{'id':_0x4624ff[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x391034,null))[_0xa990('0x1f')](function(_0x43ccc6){if(_0x43ccc6){_0x181806=_0x43ccc6;logger[_0xa990('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa990('0xd6'),_0x43ccc6['type'],util[_0xa990('0xc6')](_0x4624ff['query'],{'showHidden':![],'depth':null}));switch(_0x43ccc6[_0xa990('0x4e')]){case _0xa990('0x89'):if(_0x4624ff[_0xa990('0x3d')][_0xa990('0xd7')]&&_0x4624ff[_0xa990('0x3d')][_0xa990('0xd8')]){_0x51859c=_0x4624ff[_0xa990('0x3d')][_0xa990('0xd8')];return db[_0xa990('0xa3')][_0xa990('0x60')]({'where':{'messageId':_0x4624ff['query'][_0xa990('0xd7')]}});}break;}}})[_0xa990('0x1f')](handleEntityNotFound(_0x391034,null))['then'](function(_0x134ad3){if(_0x134ad3){_0x58ead0=_0x134ad3;switch(_0x181806[_0xa990('0x4e')]){case _0xa990('0x89'):if(_0x51859c==='2'||_0x51859c==='6'){return _0x58ead0['update']({'read':!![]});}else{logger['error'](_0xa990('0xac'),_0xa990('0x2c'),_0xa990('0x89'),util['inspect'](_0x4624ff[_0xa990('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x58ead0;}})['then'](respondWithResult(_0x391034,null))[_0xa990('0x29')](handleError(_0x391034,null));};exports[_0xa990('0xd9')]=function(_0x3d8924,_0x3363c8,_0x454b80){return db[_0xa990('0x3c')][_0xa990('0x60')]({'where':{'id':_0x3d8924['params']['id']}})['then'](handleEntityNotFound(_0x3363c8,null))[_0xa990('0x1f')](function(_0x3f14d4){if(_0x3f14d4){return _0x3f14d4[_0xa990('0xd9')](_0x3d8924[_0xa990('0x5c')][_0xa990('0x6b')],_['omit'](_0x3d8924[_0xa990('0x5c')],[_0xa990('0x6b'),'id'])||{})[_0xa990('0xc2')](function(_0x58b51c){for(var _0x7f1faa=0x0;_0x7f1faa<_0x3d8924['body']['ids'][_0xa990('0x44')];_0x7f1faa+=0x1){socket[_0xa990('0xda')](_0xa990('0xdb'),{'UserId':_0x3d8924[_0xa990('0x5c')][_0xa990('0x6b')][_0x7f1faa],'SmsAccountId':_0x3d8924[_0xa990('0x58')]['id']});}return _0x58b51c;});}})['then'](respondWithResult(_0x3363c8,null))[_0xa990('0x29')](handleError(_0x3363c8,null));};exports[_0xa990('0xdc')]=function(_0x2fcf32,_0x2cbc2e,_0x592414){return db[_0xa990('0x3c')][_0xa990('0x60')]({'where':{'id':_0x2fcf32[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x2cbc2e,null))[_0xa990('0x1f')](function(_0x378474){if(_0x378474){return _0x378474[_0xa990('0xdc')](_0x2fcf32[_0xa990('0x3d')]['ids'])['then'](function(){if(_[_0xa990('0xdd')](_0x2fcf32[_0xa990('0x3d')][_0xa990('0x6b')])){for(var _0x1b25ef=0x0;_0x1b25ef<_0x2fcf32[_0xa990('0x3d')]['ids'][_0xa990('0x44')];_0x1b25ef+=0x1){socket[_0xa990('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x2fcf32['query'][_0xa990('0x6b')][_0x1b25ef]),'SmsAccountId':Number(_0x2fcf32['params']['id'])});}}else{socket[_0xa990('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x2fcf32[_0xa990('0x3d')][_0xa990('0x6b')]),'SmsAccountId':Number(_0x2fcf32[_0xa990('0x58')]['id'])});}});}})[_0xa990('0x1f')](respondWithStatusCode(_0x2cbc2e,null))[_0xa990('0x29')](handleError(_0x2cbc2e,null));};exports['getAgents']=function(_0x240a34,_0x2d904b,_0x5e3f59){var _0x2622f5={};var _0x4f25c3={};var _0x1f6cc6;var _0x4bfb13;return db[_0xa990('0x3c')][_0xa990('0x67')]({'where':{'id':_0x240a34[_0xa990('0x58')]['id']}})[_0xa990('0x1f')](handleEntityNotFound(_0x2d904b,null))[_0xa990('0x1f')](function(_0x39b1a6){if(_0x39b1a6){_0x1f6cc6=_0x39b1a6;_0x4f25c3[_0xa990('0x41')]=_[_0xa990('0x3e')](db['User'][_0xa990('0x5a')]);_0x4f25c3[_0xa990('0x3d')]=_[_0xa990('0x3e')](_0x240a34[_0xa990('0x3d')]);_0x4f25c3[_0xa990('0x3f')]=_[_0xa990('0x40')](_0x4f25c3['model'],_0x4f25c3[_0xa990('0x3d')]);_0x2622f5['attributes']=_['intersection'](_0x4f25c3[_0xa990('0x41')],qs[_0xa990('0x43')](_0x240a34[_0xa990('0x3d')][_0xa990('0x43')]));_0x2622f5[_0xa990('0x42')]=_0x2622f5[_0xa990('0x42')][_0xa990('0x44')]?_0x2622f5['attributes']:_0x4f25c3[_0xa990('0x41')];_0x2622f5[_0xa990('0x48')]=qs['sort'](_0x240a34['query'][_0xa990('0x49')]);_0x2622f5[_0xa990('0x4b')]=qs[_0xa990('0x3f')](_[_0xa990('0x4a')](_0x240a34[_0xa990('0x3d')],_0x4f25c3[_0xa990('0x3f')]));if(_0x240a34[_0xa990('0x3d')][_0xa990('0x52')]){_0x2622f5[_0xa990('0x4b')]=_[_0xa990('0x4c')](_0x2622f5[_0xa990('0x4b')],{'$or':_[_0xa990('0x4d')](_0x2622f5['attributes'],function(_0xbe2afc){var _0x1415bc={};_0x1415bc[_0xbe2afc]={'$like':'%'+_0x240a34[_0xa990('0x3d')][_0xa990('0x52')]+'%'};return _0x1415bc;})});}_0x2622f5=_[_0xa990('0x4c')]({},_0x2622f5,_0x240a34[_0xa990('0x53')]);return _0x1f6cc6[_0xa990('0xde')](_0x2622f5);}})[_0xa990('0x1f')](function(_0x29e6e0){if(_0x29e6e0){_0x4bfb13=_0x29e6e0['length'];if(!_0x240a34[_0xa990('0x3d')]['hasOwnProperty']('nolimit')){_0x2622f5[_0xa990('0x47')]=qs[_0xa990('0x47')](_0x240a34[_0xa990('0x3d')][_0xa990('0x47')]);_0x2622f5[_0xa990('0x2e')]=qs[_0xa990('0x2e')](_0x240a34[_0xa990('0x3d')][_0xa990('0x2e')]);}return _0x1f6cc6[_0xa990('0xde')](_0x2622f5);}})[_0xa990('0x1f')](function(_0x119917){if(_0x119917){return _0x119917?{'count':_0x4bfb13,'rows':_0x119917}:null;}})[_0xa990('0x1f')](respondWithResult(_0x2d904b,null))[_0xa990('0x29')](handleError(_0x2d904b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index eeab018..ff6e232 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 _0xe317=['exports','events','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x221a56,_0x41b706){var _0xf78dc7=function(_0x591c69){while(--_0x591c69){_0x221a56['push'](_0x221a56['shift']());}};_0xf78dc7(++_0x41b706);}(_0xe317,0x161));var _0x7e31=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe317[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7e31('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7e31('0x1'),'afterUpdate':_0x7e31('0x2'),'afterDestroy':_0x7e31('0x3')};function emitEvent(_0x1c956f){return function(_0x195117,_0x1e7fa7,_0x3ed76e){SmsAccountEvents[_0x7e31('0x4')](_0x1c956f+':'+_0x195117['id'],_0x195117);SmsAccountEvents[_0x7e31('0x4')](_0x1c956f,_0x195117);_0x3ed76e(null);};}for(var e in events){if(events[_0x7e31('0x5')](e)){var event=events[e];SmsAccount[_0x7e31('0x6')](e,emitEvent(event));}}module[_0x7e31('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x74cd=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74cd,0x1c0));var _0xd74c=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x74cd[_0x3e112d];return _0x531c31;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xd74c('0x0'))['db'][_0xd74c('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd74c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd74c('0x3'),'afterDestroy':_0xd74c('0x4')};function emitEvent(_0x26cd01){return function(_0x403238,_0x19daf5,_0x3c9f49){SmsAccountEvents[_0xd74c('0x5')](_0x26cd01+':'+_0x403238['id'],_0x403238);SmsAccountEvents[_0xd74c('0x5')](_0x26cd01,_0x403238);_0x3c9f49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xd74c('0x6')](e,emitEvent(event));}}module[_0xd74c('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d922ee4..1f5a05f 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 _0x7cdc=['util','../../config/logger','api','moment','bluebird','rimraf','./smsAccount.attributes','exports','define','lodash'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7cdc,0x167));var _0xc7cd=function(_0x40522d,_0x168b2c){_0x40522d=_0x40522d-0x0;var _0x211cd2=_0x7cdc[_0x40522d];return _0x211cd2;};'use strict';var _=require(_0xc7cd('0x0'));var util=require(_0xc7cd('0x1'));var logger=require(_0xc7cd('0x2'))(_0xc7cd('0x3'));var moment=require(_0xc7cd('0x4'));var BPromise=require(_0xc7cd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc7cd('0x6'));var config=require('../../config/environment');var attributes=require(_0xc7cd('0x7'));module[_0xc7cd('0x8')]=function(_0x384259,_0x4255ff){return _0x384259[_0xc7cd('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d19=['lodash','../../config/logger','moment','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts'];(function(_0x186dfe,_0x6f2d67){var _0x4dd63e=function(_0x49a513){while(--_0x49a513){_0x186dfe['push'](_0x186dfe['shift']());}};_0x4dd63e(++_0x6f2d67);}(_0x9d19,0xc8));var _0x99d1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x9d19[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x99d1('0x0'));var util=require('util');var logger=require(_0x99d1('0x1'))('api');var moment=require(_0x99d1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x99d1('0x3'));var attributes=require(_0x99d1('0x4'));module['exports']=function(_0x26eac5,_0x2b1722){return _0x26eac5[_0x99d1('0x5')](_0x99d1('0x6'),attributes,{'tableName':_0x99d1('0x7'),'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 3aa5c85..69331c1 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 _0xc7e0=['attributes','include','map','model','info','ShowSmsAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','find','raw','options'];(function(_0x18b4e8,_0x30e9e1){var _0x4b6265=function(_0x46bc8b){while(--_0x46bc8b){_0x18b4e8['push'](_0x18b4e8['shift']());}};_0x4b6265(++_0x30e9e1);}(_0xc7e0,0x1ce));var _0x0c7e=function(_0x116425,_0x4ca868){_0x116425=_0x116425-0x0;var _0x374deb=_0xc7e0[_0x116425];return _0x374deb;};'use strict';var _=require(_0x0c7e('0x0'));var util=require('util');var moment=require(_0x0c7e('0x1'));var BPromise=require(_0x0c7e('0x2'));var rs=require(_0x0c7e('0x3'));var fs=require('fs');var Redis=require(_0x0c7e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c7e('0x5'));var logger=require('../../config/logger')(_0x0c7e('0x6'));var config=require(_0x0c7e('0x7'));var jayson=require(_0x0c7e('0x8'));var client=jayson[_0x0c7e('0x9')][_0x0c7e('0xa')]({'port':0x232a});config['redis']=_[_0x0c7e('0xb')](config[_0x0c7e('0xc')],{'host':_0x0c7e('0xd'),'port':0x18eb});var socket=require(_0x0c7e('0xe'))(new Redis(config[_0x0c7e('0xc')]));require('./smsAccount.socket')[_0x0c7e('0xf')](socket);function respondWithRpcPromise(_0x1da2c4,_0x2b3c63,_0x5b5b42){return new BPromise(function(_0x15f3ef,_0x441dec){return client[_0x0c7e('0x10')](_0x1da2c4,_0x5b5b42)[_0x0c7e('0x11')](function(_0x5d9dea){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2b3c63,'request\x20sent');logger[_0x0c7e('0x12')](_0x0c7e('0x13'),_0x2b3c63,_0x0c7e('0x14'),JSON[_0x0c7e('0x15')](_0x5d9dea));if(_0x5d9dea['error']){if(_0x5d9dea[_0x0c7e('0x16')][_0x0c7e('0x17')]===0x1f4){logger[_0x0c7e('0x16')](_0x0c7e('0x18'),_0x2b3c63,_0x5d9dea[_0x0c7e('0x16')][_0x0c7e('0x19')]);return _0x441dec(_0x5d9dea[_0x0c7e('0x16')][_0x0c7e('0x19')]);}logger[_0x0c7e('0x16')](_0x0c7e('0x18'),_0x2b3c63,_0x5d9dea[_0x0c7e('0x16')][_0x0c7e('0x19')]);return _0x15f3ef(_0x5d9dea[_0x0c7e('0x16')][_0x0c7e('0x19')]);}else{logger['info'](_0x0c7e('0x18'),_0x2b3c63,_0x0c7e('0x14'));_0x15f3ef(_0x5d9dea[_0x0c7e('0x1a')][_0x0c7e('0x19')]);}})[_0x0c7e('0x1b')](function(_0x522449){logger[_0x0c7e('0x16')](_0x0c7e('0x18'),_0x2b3c63,_0x522449);_0x441dec(_0x522449);});});}exports['ShowSmsAccount']=function(_0x4619ca){var _0x51296a=this;return new Promise(function(_0x9a5426,_0x146a3f){return db[_0x0c7e('0x1c')][_0x0c7e('0x1d')]({'raw':_0x4619ca['options']?_0x4619ca['options'][_0x0c7e('0x1e')]===undefined?!![]:![]:!![],'where':_0x4619ca[_0x0c7e('0x1f')]?_0x4619ca[_0x0c7e('0x1f')]['where']||null:null,'attributes':_0x4619ca[_0x0c7e('0x1f')]?_0x4619ca[_0x0c7e('0x1f')][_0x0c7e('0x20')]||null:null,'include':_0x4619ca[_0x0c7e('0x1f')]?_0x4619ca[_0x0c7e('0x1f')][_0x0c7e('0x21')]?_[_0x0c7e('0x22')](_0x4619ca[_0x0c7e('0x1f')]['include'],function(_0x5ece63){return{'model':db[_0x5ece63[_0x0c7e('0x23')]],'as':_0x5ece63['as'],'attributes':_0x5ece63['attributes'],'include':_0x5ece63[_0x0c7e('0x21')]?_[_0x0c7e('0x22')](_0x5ece63['include'],function(_0x5af085){return{'model':db[_0x5af085[_0x0c7e('0x23')]],'as':_0x5af085['as'],'attributes':_0x5af085[_0x0c7e('0x20')],'include':_0x5af085[_0x0c7e('0x21')]?_['map'](_0x5af085[_0x0c7e('0x21')],function(_0xa41625){return{'model':db[_0xa41625[_0x0c7e('0x23')]],'as':_0xa41625['as'],'attributes':_0xa41625[_0x0c7e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0c7e('0x11')](function(_0x5e2e26){logger[_0x0c7e('0x24')]('ShowSmsAccount',_0x4619ca);logger[_0x0c7e('0x12')](_0x0c7e('0x25'),_0x4619ca,JSON[_0x0c7e('0x15')](_0x5e2e26));_0x9a5426(_0x5e2e26);})[_0x0c7e('0x1b')](function(_0x189a84){logger[_0x0c7e('0x16')](_0x0c7e('0x25'),_0x189a84['message'],_0x4619ca);_0x146a3f(_0x51296a[_0x0c7e('0x16')](0x1f4,_0x189a84[_0x0c7e('0x19')]));});});}; \ No newline at end of file +var _0x5250=['catch','ShowSmsAccount','find','options','raw','where','attributes','map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x1091f8,_0x44c5d7){var _0x58325b=function(_0x5cbe74){while(--_0x5cbe74){_0x1091f8['push'](_0x1091f8['shift']());}};_0x58325b(++_0x44c5d7);}(_0x5250,0xc4));var _0x0525=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x5250[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x0525('0x0'));var util=require(_0x0525('0x1'));var moment=require(_0x0525('0x2'));var BPromise=require(_0x0525('0x3'));var rs=require(_0x0525('0x4'));var fs=require('fs');var Redis=require(_0x0525('0x5'));var db=require(_0x0525('0x6'))['db'];var utils=require(_0x0525('0x7'));var logger=require(_0x0525('0x8'))(_0x0525('0x9'));var config=require(_0x0525('0xa'));var jayson=require(_0x0525('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x0525('0xc')]=_[_0x0525('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0525('0xe'))(new Redis(config[_0x0525('0xc')]));require(_0x0525('0xf'))[_0x0525('0x10')](socket);function respondWithRpcPromise(_0x1c85b3,_0x184f25,_0x93356c){return new BPromise(function(_0x36d787,_0x1463eb){return client[_0x0525('0x11')](_0x1c85b3,_0x93356c)['then'](function(_0x3d52e8){logger[_0x0525('0x12')](_0x0525('0x13'),_0x184f25,_0x0525('0x14'));logger['debug'](_0x0525('0x15'),_0x184f25,_0x0525('0x14'),JSON[_0x0525('0x16')](_0x3d52e8));if(_0x3d52e8['error']){if(_0x3d52e8[_0x0525('0x17')]['code']===0x1f4){logger[_0x0525('0x17')](_0x0525('0x13'),_0x184f25,_0x3d52e8['error']['message']);return _0x1463eb(_0x3d52e8['error'][_0x0525('0x18')]);}logger[_0x0525('0x17')]('SmsAccount,\x20%s,\x20%s',_0x184f25,_0x3d52e8['error'][_0x0525('0x18')]);return _0x36d787(_0x3d52e8[_0x0525('0x17')][_0x0525('0x18')]);}else{logger[_0x0525('0x12')]('SmsAccount,\x20%s,\x20%s',_0x184f25,_0x0525('0x14'));_0x36d787(_0x3d52e8[_0x0525('0x19')][_0x0525('0x18')]);}})[_0x0525('0x1a')](function(_0xc688ad){logger['error'](_0x0525('0x13'),_0x184f25,_0xc688ad);_0x1463eb(_0xc688ad);});});}exports[_0x0525('0x1b')]=function(_0x3bcf1d){var _0xd2c236=this;return new Promise(function(_0x3f21e5,_0x2f1221){return db['SmsAccount'][_0x0525('0x1c')]({'raw':_0x3bcf1d[_0x0525('0x1d')]?_0x3bcf1d['options'][_0x0525('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bcf1d['options']?_0x3bcf1d[_0x0525('0x1d')][_0x0525('0x1f')]||null:null,'attributes':_0x3bcf1d[_0x0525('0x1d')]?_0x3bcf1d['options'][_0x0525('0x20')]||null:null,'include':_0x3bcf1d['options']?_0x3bcf1d[_0x0525('0x1d')]['include']?_[_0x0525('0x21')](_0x3bcf1d[_0x0525('0x1d')][_0x0525('0x22')],function(_0x2f5e86){return{'model':db[_0x2f5e86['model']],'as':_0x2f5e86['as'],'attributes':_0x2f5e86[_0x0525('0x20')],'include':_0x2f5e86[_0x0525('0x22')]?_[_0x0525('0x21')](_0x2f5e86[_0x0525('0x22')],function(_0x1c8cdf){return{'model':db[_0x1c8cdf[_0x0525('0x23')]],'as':_0x1c8cdf['as'],'attributes':_0x1c8cdf[_0x0525('0x20')],'include':_0x1c8cdf['include']?_['map'](_0x1c8cdf[_0x0525('0x22')],function(_0x91910e){return{'model':db[_0x91910e[_0x0525('0x23')]],'as':_0x91910e['as'],'attributes':_0x91910e[_0x0525('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0525('0x24')](function(_0x5e45de){logger[_0x0525('0x12')](_0x0525('0x1b'),_0x3bcf1d);logger['debug']('ShowSmsAccount',_0x3bcf1d,JSON[_0x0525('0x16')](_0x5e45de));_0x3f21e5(_0x5e45de);})['catch'](function(_0x133132){logger['error'](_0x0525('0x1b'),_0x133132['message'],_0x3bcf1d);_0x2f1221(_0xd2c236['error'](0x1f4,_0x133132[_0x0525('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 3e1920e..7606a71 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 _0xefd7=['length','smsAccount:','./smsAccount.events','save','update','emit','removeListener','register'];(function(_0x891c55,_0x233fe8){var _0x260823=function(_0x1e3f67){while(--_0x1e3f67){_0x891c55['push'](_0x891c55['shift']());}};_0x260823(++_0x233fe8);}(_0xefd7,0x1ba));var _0x7efd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xefd7[_0x2dafbe];return _0x58a45a;};'use strict';var SmsAccountEvents=require(_0x7efd('0x0'));var events=[_0x7efd('0x1'),'remove',_0x7efd('0x2')];function createListener(_0x5844bc,_0x34d424){return function(_0x2606a2){_0x34d424[_0x7efd('0x3')](_0x5844bc,_0x2606a2);};}function removeListener(_0x1c25e3,_0x48e141){return function(){SmsAccountEvents[_0x7efd('0x4')](_0x1c25e3,_0x48e141);};}exports[_0x7efd('0x5')]=function(_0x27e2b0){for(var _0x3cdc9b=0x0,_0x120980=events[_0x7efd('0x6')];_0x3cdc9b<_0x120980;_0x3cdc9b++){var _0x391a31=events[_0x3cdc9b];var _0x1ebb06=createListener(_0x7efd('0x7')+_0x391a31,_0x27e2b0);SmsAccountEvents['on'](_0x391a31,_0x1ebb06);}}; \ No newline at end of file +var _0x47cc=['smsAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0x493948,_0x33a99e){var _0x265c8b=function(_0x4fd424){while(--_0x4fd424){_0x493948['push'](_0x493948['shift']());}};_0x265c8b(++_0x33a99e);}(_0x47cc,0x139));var _0xc47c=function(_0x2ffec8,_0x2d3a58){_0x2ffec8=_0x2ffec8-0x0;var _0x58ce5a=_0x47cc[_0x2ffec8];return _0x58ce5a;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0xc47c('0x0'),_0xc47c('0x1'),_0xc47c('0x2')];function createListener(_0x31981c,_0x1f3e18){return function(_0x413095){_0x1f3e18[_0xc47c('0x3')](_0x31981c,_0x413095);};}function removeListener(_0x4ea932,_0x529a80){return function(){SmsAccountEvents[_0xc47c('0x4')](_0x4ea932,_0x529a80);};}exports[_0xc47c('0x5')]=function(_0x5eaf2b){for(var _0x128b0d=0x0,_0x41ce0a=events[_0xc47c('0x6')];_0x128b0d<_0x41ce0a;_0x128b0d++){var _0x4c3e52=events[_0x128b0d];var _0x150305=createListener(_0xc47c('0x7')+_0x4c3e52,_0x5eaf2b);SmsAccountEvents['on'](_0x4c3e52,_0x150305);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index acfb5cd..14ed7e9 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 _0x9f9d=['./smsApplication.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9f9d,0x1d3));var _0xd9f9=function(_0x47bbbb,_0x49f79b){_0x47bbbb=_0x47bbbb-0x0;var _0x4c5ed2=_0x9f9d[_0x47bbbb];return _0x4c5ed2;};'use strict';var multer=require(_0xd9f9('0x0'));var util=require(_0xd9f9('0x1'));var path=require(_0xd9f9('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9f9('0x3'));var router=express[_0xd9f9('0x4')]();var auth=require(_0xd9f9('0x5'));var interaction=require(_0xd9f9('0x6'));var config=require(_0xd9f9('0x7'));var controller=require(_0xd9f9('0x8'));router[_0xd9f9('0x9')]('/',auth[_0xd9f9('0xa')](),controller[_0xd9f9('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd9f9('0xc')]);router[_0xd9f9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd9f9('0xe')](_0xd9f9('0xf'),auth[_0xd9f9('0xa')](),controller[_0xd9f9('0x10')]);router[_0xd9f9('0x11')](_0xd9f9('0xf'),auth[_0xd9f9('0xa')](),controller[_0xd9f9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3bab=['express','Router','../../components/interaction/service','./smsApplication.controller','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout'];(function(_0x355f3a,_0x5b19e1){var _0x124389=function(_0x3b8b5d){while(--_0x3b8b5d){_0x355f3a['push'](_0x355f3a['shift']());}};_0x124389(++_0x5b19e1);}(_0x3bab,0x11e));var _0xb3ba=function(_0x16622e,_0x3b50c7){_0x16622e=_0x16622e-0x0;var _0x4a7abd=_0x3bab[_0x16622e];return _0x4a7abd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3ba('0x0'));var timeout=require(_0xb3ba('0x1'));var express=require(_0xb3ba('0x2'));var router=express[_0xb3ba('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb3ba('0x4'));var config=require('../../config/environment');var controller=require(_0xb3ba('0x5'));router['get']('/',auth[_0xb3ba('0x6')](),controller[_0xb3ba('0x7')]);router['get']('/:id',auth[_0xb3ba('0x6')](),controller[_0xb3ba('0x8')]);router[_0xb3ba('0x9')]('/',auth[_0xb3ba('0x6')](),controller[_0xb3ba('0xa')]);router[_0xb3ba('0xb')](_0xb3ba('0xc'),auth[_0xb3ba('0x6')](),controller[_0xb3ba('0xd')]);router['delete'](_0xb3ba('0xc'),auth[_0xb3ba('0x6')](),controller[_0xb3ba('0xe')]);module[_0xb3ba('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 045a390..8623c54 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 _0x4201=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x3a5b35,_0x30de49){var _0x16c10b=function(_0x1d3cb2){while(--_0x1d3cb2){_0x3a5b35['push'](_0x3a5b35['shift']());}};_0x16c10b(++_0x30de49);}(_0x4201,0x71));var _0x1420=function(_0x51dbba,_0x817f0d){_0x51dbba=_0x51dbba-0x0;var _0x34906d=_0x4201[_0x51dbba];return _0x34906d;};'use strict';var Sequelize=require(_0x1420('0x0'));module[_0x1420('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1420('0x2')],'allowNull':![],'defaultValue':_0x1420('0x3')},'appdata':{'type':Sequelize[_0x1420('0x4')]()},'description':{'type':Sequelize[_0x1420('0x2')]},'interval':{'type':Sequelize[_0x1420('0x2')],'defaultValue':_0x1420('0x5')}}; \ No newline at end of file +var _0x5430=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4b1874,_0x9c06ef){var _0x5a0fb2=function(_0x32dc9a){while(--_0x32dc9a){_0x4b1874['push'](_0x4b1874['shift']());}};_0x5a0fb2(++_0x9c06ef);}(_0x5430,0x10c));var _0x0543=function(_0x345136,_0x3c4dfe){_0x345136=_0x345136-0x0;var _0x1088b4=_0x5430[_0x345136];return _0x1088b4;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'priority':{'type':Sequelize[_0x0543('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0543('0x3')],'allowNull':![],'defaultValue':_0x0543('0x4')},'appdata':{'type':Sequelize[_0x0543('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0543('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 612f7b8..f9db0a2 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 _0x6037=['pick','merge','map','type','field','filter','options','includeAll','findAll','rows','catch','show','params','SmsApplication','include','find','create','update','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where'];(function(_0x17cdc6,_0x365749){var _0x25bace=function(_0xa969a7){while(--_0xa969a7){_0x17cdc6['push'](_0x17cdc6['shift']());}};_0x25bace(++_0x365749);}(_0x6037,0xe2));var _0x7603=function(_0x149298,_0x15f0f3){_0x149298=_0x149298-0x0;var _0xfd1af0=_0x6037[_0x149298];return _0xfd1af0;};'use strict';var pdf=require(_0x7603('0x0'));var emlformat=require(_0x7603('0x1'));var rimraf=require(_0x7603('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7603('0x3'));var rp=require('request-promise');var moment=require(_0x7603('0x4'));var BPromise=require(_0x7603('0x5'));var Mustache=require('mustache');var util=require(_0x7603('0x6'));var path=require(_0x7603('0x7'));var sox=require('sox');var csv=require(_0x7603('0x8'));var ejs=require(_0x7603('0x9'));var fs=require('fs');var _=require(_0x7603('0xa'));var squel=require(_0x7603('0xb'));var crypto=require(_0x7603('0xc'));var jsforce=require(_0x7603('0xd'));var deskjs=require(_0x7603('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7603('0xf'));var Papa=require('papaparse');var Redis=require(_0x7603('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7603('0x11'));var logger=require(_0x7603('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7603('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498c9d,_0x39c06a){_0x39c06a=_0x39c06a||0xcc;return function(_0x2d58c6){if(_0x2d58c6){return _0x498c9d[_0x7603('0x14')](_0x39c06a);}return _0x498c9d[_0x7603('0x15')](_0x39c06a)[_0x7603('0x16')]();};}function respondWithResult(_0x5d1be9,_0xadb488){_0xadb488=_0xadb488||0xc8;return function(_0x2bee74){if(_0x2bee74){return _0x5d1be9[_0x7603('0x15')](_0xadb488)[_0x7603('0x17')](_0x2bee74);}};}function respondWithFilteredResult(_0x5e93d2,_0x207c50){return function(_0x5a7021){if(_0x5a7021){var _0x2b84ea=_0x5a7021[_0x7603('0x18')],_0x144d8f=_0x207c50['offset'],_0x40d8d5=_0x207c50[_0x7603('0x19')]+_0x207c50['limit'],_0x35cb05;if(_0x40d8d5>=_0x2b84ea){_0x40d8d5=_0x2b84ea;_0x35cb05=0xc8;}else{_0x35cb05=0xce;}_0x5e93d2['status'](_0x35cb05);return _0x5e93d2[_0x7603('0x1a')](_0x7603('0x1b'),_0x144d8f+'-'+_0x40d8d5+'/'+_0x2b84ea)[_0x7603('0x17')](_0x5a7021);}return null;};}function patchUpdates(_0x30f6e8){return function(_0x2a2f2d){try{jsonpatch['apply'](_0x2a2f2d,_0x30f6e8,!![]);}catch(_0x372653){return BPromise[_0x7603('0x1c')](_0x372653);}return _0x2a2f2d[_0x7603('0x1d')]();};}function saveUpdates(_0x4640d0,_0x58d32b){return function(_0x47a111){if(_0x47a111){return _0x47a111['update'](_0x4640d0)[_0x7603('0x1e')](function(_0x1c9746){return _0x1c9746;});}return null;};}function removeEntity(_0x665cd2,_0x2944a5){return function(_0x194936){if(_0x194936){return _0x194936[_0x7603('0x1f')]()[_0x7603('0x1e')](function(){_0x665cd2[_0x7603('0x15')](0xcc)[_0x7603('0x16')]();});}};}function handleEntityNotFound(_0x398950,_0x59bd03){return function(_0x2e1d7f){if(!_0x2e1d7f){_0x398950[_0x7603('0x14')](0x194);}return _0x2e1d7f;};}function handleError(_0x7726dd,_0x97c5ac){_0x97c5ac=_0x97c5ac||0x1f4;return function(_0x584e6e){logger[_0x7603('0x20')](_0x584e6e[_0x7603('0x21')]);if(_0x584e6e[_0x7603('0x22')]){delete _0x584e6e[_0x7603('0x22')];}_0x7726dd[_0x7603('0x15')](_0x97c5ac)['send'](_0x584e6e);};}exports[_0x7603('0x23')]=function(_0x59935c,_0x295328){var _0x4e8797={},_0xa7f109={},_0x1f5e0c={'count':0x0,'rows':[]};var _0x521ec6=db['SmsApplication'][_0x7603('0x24')];_0xa7f109[_0x7603('0x25')]=_[_0x7603('0x26')](_0x521ec6);_0xa7f109['query']=_['keys'](_0x59935c[_0x7603('0x27')]);_0xa7f109[_0x7603('0x28')]=_[_0x7603('0x29')](_0xa7f109[_0x7603('0x25')],_0xa7f109[_0x7603('0x27')]);_0x4e8797[_0x7603('0x2a')]=_[_0x7603('0x29')](_0xa7f109[_0x7603('0x25')],qs[_0x7603('0x2b')](_0x59935c[_0x7603('0x27')]['fields']));_0x4e8797['attributes']=_0x4e8797[_0x7603('0x2a')][_0x7603('0x2c')]?_0x4e8797[_0x7603('0x2a')]:_0xa7f109[_0x7603('0x25')];if(!_0x59935c[_0x7603('0x27')][_0x7603('0x2d')]('nolimit')){_0x4e8797['limit']=qs[_0x7603('0x2e')](_0x59935c[_0x7603('0x27')][_0x7603('0x2e')]);_0x4e8797[_0x7603('0x19')]=qs[_0x7603('0x19')](_0x59935c[_0x7603('0x27')][_0x7603('0x19')]);}_0x4e8797[_0x7603('0x2f')]=qs[_0x7603('0x30')](_0x59935c[_0x7603('0x27')]['sort']);_0x4e8797[_0x7603('0x31')]=qs[_0x7603('0x28')](_[_0x7603('0x32')](_0x59935c[_0x7603('0x27')],_0xa7f109['filters']));if(_0x59935c[_0x7603('0x27')]['filter']){_0x4e8797[_0x7603('0x31')]=_[_0x7603('0x33')](_0x4e8797['where'],{'$or':_[_0x7603('0x34')](_0x521ec6,function(_0x14191b){if(_0x14191b[_0x7603('0x35')]['key']!=='VIRTUAL'){var _0x5437b8={};_0x5437b8[_0x14191b[_0x7603('0x36')]]={'$like':'%'+_0x59935c[_0x7603('0x27')][_0x7603('0x37')]+'%'};return _0x5437b8;}})});}_0x4e8797=_[_0x7603('0x33')]({},_0x4e8797,_0x59935c[_0x7603('0x38')]);var _0x5911dd={'where':_0x4e8797[_0x7603('0x31')]};return db['SmsApplication'][_0x7603('0x18')](_0x5911dd)['then'](function(_0x1e7adb){_0x1f5e0c['count']=_0x1e7adb;if(_0x59935c[_0x7603('0x27')][_0x7603('0x39')]){_0x4e8797['include']=[{'all':!![]}];}return db['SmsApplication'][_0x7603('0x3a')](_0x4e8797);})[_0x7603('0x1e')](function(_0x4fc5b8){_0x1f5e0c[_0x7603('0x3b')]=_0x4fc5b8;return _0x1f5e0c;})[_0x7603('0x1e')](respondWithFilteredResult(_0x295328,_0x4e8797))[_0x7603('0x3c')](handleError(_0x295328,null));};exports[_0x7603('0x3d')]=function(_0x3d51f2,_0xce3690){var _0x56a6ba={'raw':!![],'where':{'id':_0x3d51f2[_0x7603('0x3e')]['id']}},_0x26918a={};_0x26918a[_0x7603('0x25')]=_[_0x7603('0x26')](db[_0x7603('0x3f')][_0x7603('0x24')]);_0x26918a[_0x7603('0x27')]=_['keys'](_0x3d51f2[_0x7603('0x27')]);_0x26918a['filters']=_[_0x7603('0x29')](_0x26918a[_0x7603('0x25')],_0x26918a[_0x7603('0x27')]);_0x56a6ba[_0x7603('0x2a')]=_[_0x7603('0x29')](_0x26918a[_0x7603('0x25')],qs[_0x7603('0x2b')](_0x3d51f2[_0x7603('0x27')][_0x7603('0x2b')]));_0x56a6ba[_0x7603('0x2a')]=_0x56a6ba[_0x7603('0x2a')][_0x7603('0x2c')]?_0x56a6ba[_0x7603('0x2a')]:_0x26918a[_0x7603('0x25')];if(_0x3d51f2['query']['includeAll']){_0x56a6ba[_0x7603('0x40')]=[{'all':!![]}];}_0x56a6ba=_[_0x7603('0x33')]({},_0x56a6ba,_0x3d51f2['options']);return db[_0x7603('0x3f')][_0x7603('0x41')](_0x56a6ba)[_0x7603('0x1e')](handleEntityNotFound(_0xce3690,null))[_0x7603('0x1e')](respondWithResult(_0xce3690,null))[_0x7603('0x3c')](handleError(_0xce3690,null));};exports[_0x7603('0x42')]=function(_0x147a99,_0x489f31){return db['SmsApplication']['create'](_0x147a99['body'],{})[_0x7603('0x1e')](respondWithResult(_0x489f31,0xc9))['catch'](handleError(_0x489f31,null));};exports[_0x7603('0x43')]=function(_0x3fbe8e,_0x995ebd){if(_0x3fbe8e['body']['id']){delete _0x3fbe8e[_0x7603('0x44')]['id'];}return db['SmsApplication'][_0x7603('0x41')]({'where':{'id':_0x3fbe8e[_0x7603('0x3e')]['id']}})[_0x7603('0x1e')](handleEntityNotFound(_0x995ebd,null))[_0x7603('0x1e')](saveUpdates(_0x3fbe8e[_0x7603('0x44')],null))['then'](respondWithResult(_0x995ebd,null))[_0x7603('0x3c')](handleError(_0x995ebd,null));};exports[_0x7603('0x1f')]=function(_0x342292,_0xa8b41c){return db[_0x7603('0x3f')]['find']({'where':{'id':_0x342292[_0x7603('0x3e')]['id']}})[_0x7603('0x1e')](handleEntityNotFound(_0xa8b41c,null))[_0x7603('0x1e')](removeEntity(_0xa8b41c,null))['catch'](handleError(_0xa8b41c,null));}; \ No newline at end of file +var _0x5cbb=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','SmsApplication','rawAttributes','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','then','includeAll','include','findAll','catch','params','fields','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x5cbb,0x77));var _0xb5cb=function(_0x4ff78a,_0x18d276){_0x4ff78a=_0x4ff78a-0x0;var _0x14ae37=_0x5cbb[_0x4ff78a];return _0x14ae37;};'use strict';var pdf=require(_0xb5cb('0x0'));var emlformat=require(_0xb5cb('0x1'));var rimraf=require(_0xb5cb('0x2'));var zipdir=require(_0xb5cb('0x3'));var jsonpatch=require(_0xb5cb('0x4'));var rp=require(_0xb5cb('0x5'));var moment=require(_0xb5cb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb5cb('0x7'));var util=require('util');var path=require(_0xb5cb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5cb('0x9'));var squel=require('squel');var crypto=require(_0xb5cb('0xa'));var jsforce=require(_0xb5cb('0xb'));var deskjs=require(_0xb5cb('0xc'));var toCsv=require(_0xb5cb('0xd'));var querystring=require(_0xb5cb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5cb('0xf'));var qs=require(_0xb5cb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5cb('0x11'))(_0xb5cb('0x12'));var utils=require(_0xb5cb('0x13'));var config=require(_0xb5cb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f828c,_0x40affa){_0x40affa=_0x40affa||0xcc;return function(_0x12ff1f){if(_0x12ff1f){return _0x3f828c[_0xb5cb('0x15')](_0x40affa);}return _0x3f828c['status'](_0x40affa)[_0xb5cb('0x16')]();};}function respondWithResult(_0x1c1aea,_0x7844dc){_0x7844dc=_0x7844dc||0xc8;return function(_0xc98a53){if(_0xc98a53){return _0x1c1aea[_0xb5cb('0x17')](_0x7844dc)[_0xb5cb('0x18')](_0xc98a53);}};}function respondWithFilteredResult(_0x2eabeb,_0x4e2f0e){return function(_0x3df6b8){if(_0x3df6b8){var _0x32fb8a=_0x3df6b8[_0xb5cb('0x19')],_0x29126d=_0x4e2f0e[_0xb5cb('0x1a')],_0x5ebf26=_0x4e2f0e[_0xb5cb('0x1a')]+_0x4e2f0e[_0xb5cb('0x1b')],_0x3f22b4;if(_0x5ebf26>=_0x32fb8a){_0x5ebf26=_0x32fb8a;_0x3f22b4=0xc8;}else{_0x3f22b4=0xce;}_0x2eabeb['status'](_0x3f22b4);return _0x2eabeb[_0xb5cb('0x1c')](_0xb5cb('0x1d'),_0x29126d+'-'+_0x5ebf26+'/'+_0x32fb8a)[_0xb5cb('0x18')](_0x3df6b8);}return null;};}function patchUpdates(_0x184457){return function(_0x43e584){try{jsonpatch[_0xb5cb('0x1e')](_0x43e584,_0x184457,!![]);}catch(_0x5c1bf9){return BPromise[_0xb5cb('0x1f')](_0x5c1bf9);}return _0x43e584['save']();};}function saveUpdates(_0x2e73b1,_0x20f10a){return function(_0x1e951f){if(_0x1e951f){return _0x1e951f[_0xb5cb('0x20')](_0x2e73b1)['then'](function(_0xbf4018){return _0xbf4018;});}return null;};}function removeEntity(_0x40e311,_0x27be11){return function(_0x3c3f7a){if(_0x3c3f7a){return _0x3c3f7a[_0xb5cb('0x21')]()['then'](function(){_0x40e311['status'](0xcc)[_0xb5cb('0x16')]();});}};}function handleEntityNotFound(_0x247e93,_0x4340a6){return function(_0x2928ed){if(!_0x2928ed){_0x247e93['sendStatus'](0x194);}return _0x2928ed;};}function handleError(_0x5c3386,_0x1d5b47){_0x1d5b47=_0x1d5b47||0x1f4;return function(_0x594d20){logger['error'](_0x594d20[_0xb5cb('0x22')]);if(_0x594d20[_0xb5cb('0x23')]){delete _0x594d20[_0xb5cb('0x23')];}_0x5c3386[_0xb5cb('0x17')](_0x1d5b47)['send'](_0x594d20);};}exports['index']=function(_0x37db90,_0x224cd5){var _0x261256={},_0x4cb107={},_0x132f95={'count':0x0,'rows':[]};var _0x360a8d=db[_0xb5cb('0x24')][_0xb5cb('0x25')];_0x4cb107[_0xb5cb('0x26')]=_['keys'](_0x360a8d);_0x4cb107[_0xb5cb('0x27')]=_[_0xb5cb('0x28')](_0x37db90['query']);_0x4cb107[_0xb5cb('0x29')]=_['intersection'](_0x4cb107[_0xb5cb('0x26')],_0x4cb107[_0xb5cb('0x27')]);_0x261256[_0xb5cb('0x2a')]=_[_0xb5cb('0x2b')](_0x4cb107[_0xb5cb('0x26')],qs['fields'](_0x37db90[_0xb5cb('0x27')]['fields']));_0x261256[_0xb5cb('0x2a')]=_0x261256[_0xb5cb('0x2a')][_0xb5cb('0x2c')]?_0x261256['attributes']:_0x4cb107[_0xb5cb('0x26')];if(!_0x37db90[_0xb5cb('0x27')][_0xb5cb('0x2d')](_0xb5cb('0x2e'))){_0x261256[_0xb5cb('0x1b')]=qs['limit'](_0x37db90[_0xb5cb('0x27')]['limit']);_0x261256[_0xb5cb('0x1a')]=qs[_0xb5cb('0x1a')](_0x37db90[_0xb5cb('0x27')][_0xb5cb('0x1a')]);}_0x261256['order']=qs[_0xb5cb('0x2f')](_0x37db90[_0xb5cb('0x27')][_0xb5cb('0x2f')]);_0x261256[_0xb5cb('0x30')]=qs[_0xb5cb('0x29')](_[_0xb5cb('0x31')](_0x37db90[_0xb5cb('0x27')],_0x4cb107[_0xb5cb('0x29')]));if(_0x37db90[_0xb5cb('0x27')][_0xb5cb('0x32')]){_0x261256[_0xb5cb('0x30')]=_[_0xb5cb('0x33')](_0x261256[_0xb5cb('0x30')],{'$or':_[_0xb5cb('0x34')](_0x360a8d,function(_0x200031){if(_0x200031['type'][_0xb5cb('0x35')]!==_0xb5cb('0x36')){var _0x511902={};_0x511902[_0x200031[_0xb5cb('0x37')]]={'$like':'%'+_0x37db90[_0xb5cb('0x27')]['filter']+'%'};return _0x511902;}})});}_0x261256=_['merge']({},_0x261256,_0x37db90[_0xb5cb('0x38')]);var _0x5ac13f={'where':_0x261256[_0xb5cb('0x30')]};return db[_0xb5cb('0x24')][_0xb5cb('0x19')](_0x5ac13f)[_0xb5cb('0x39')](function(_0xe7af5f){_0x132f95[_0xb5cb('0x19')]=_0xe7af5f;if(_0x37db90[_0xb5cb('0x27')][_0xb5cb('0x3a')]){_0x261256[_0xb5cb('0x3b')]=[{'all':!![]}];}return db[_0xb5cb('0x24')][_0xb5cb('0x3c')](_0x261256);})['then'](function(_0x142864){_0x132f95['rows']=_0x142864;return _0x132f95;})[_0xb5cb('0x39')](respondWithFilteredResult(_0x224cd5,_0x261256))[_0xb5cb('0x3d')](handleError(_0x224cd5,null));};exports['show']=function(_0x57a61f,_0x2c56f7){var _0x8ec624={'raw':!![],'where':{'id':_0x57a61f[_0xb5cb('0x3e')]['id']}},_0x754d41={};_0x754d41['model']=_['keys'](db[_0xb5cb('0x24')][_0xb5cb('0x25')]);_0x754d41['query']=_['keys'](_0x57a61f[_0xb5cb('0x27')]);_0x754d41[_0xb5cb('0x29')]=_[_0xb5cb('0x2b')](_0x754d41[_0xb5cb('0x26')],_0x754d41[_0xb5cb('0x27')]);_0x8ec624['attributes']=_['intersection'](_0x754d41[_0xb5cb('0x26')],qs[_0xb5cb('0x3f')](_0x57a61f[_0xb5cb('0x27')][_0xb5cb('0x3f')]));_0x8ec624[_0xb5cb('0x2a')]=_0x8ec624[_0xb5cb('0x2a')][_0xb5cb('0x2c')]?_0x8ec624[_0xb5cb('0x2a')]:_0x754d41[_0xb5cb('0x26')];if(_0x57a61f[_0xb5cb('0x27')]['includeAll']){_0x8ec624['include']=[{'all':!![]}];}_0x8ec624=_['merge']({},_0x8ec624,_0x57a61f['options']);return db[_0xb5cb('0x24')][_0xb5cb('0x40')](_0x8ec624)[_0xb5cb('0x39')](handleEntityNotFound(_0x2c56f7,null))[_0xb5cb('0x39')](respondWithResult(_0x2c56f7,null))[_0xb5cb('0x3d')](handleError(_0x2c56f7,null));};exports[_0xb5cb('0x41')]=function(_0x5f0ba5,_0x65e195){return db[_0xb5cb('0x24')][_0xb5cb('0x41')](_0x5f0ba5[_0xb5cb('0x42')],{})[_0xb5cb('0x39')](respondWithResult(_0x65e195,0xc9))['catch'](handleError(_0x65e195,null));};exports[_0xb5cb('0x20')]=function(_0x466bf7,_0x3c03bb){if(_0x466bf7[_0xb5cb('0x42')]['id']){delete _0x466bf7[_0xb5cb('0x42')]['id'];}return db[_0xb5cb('0x24')][_0xb5cb('0x40')]({'where':{'id':_0x466bf7[_0xb5cb('0x3e')]['id']}})[_0xb5cb('0x39')](handleEntityNotFound(_0x3c03bb,null))[_0xb5cb('0x39')](saveUpdates(_0x466bf7[_0xb5cb('0x42')],null))[_0xb5cb('0x39')](respondWithResult(_0x3c03bb,null))[_0xb5cb('0x3d')](handleError(_0x3c03bb,null));};exports['destroy']=function(_0x33ede6,_0x3d0ff2){return db[_0xb5cb('0x24')][_0xb5cb('0x40')]({'where':{'id':_0x33ede6[_0xb5cb('0x3e')]['id']}})[_0xb5cb('0x39')](handleEntityNotFound(_0x3d0ff2,null))[_0xb5cb('0x39')](removeEntity(_0x3d0ff2,null))['catch'](handleError(_0x3d0ff2,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ba8973f..adb1893 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 _0x0295=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','api','request-promise','path'];(function(_0x49c792,_0x4303f7){var _0x279e85=function(_0x3d277a){while(--_0x3d277a){_0x49c792['push'](_0x49c792['shift']());}};_0x279e85(++_0x4303f7);}(_0x0295,0x1f0));var _0x5029=function(_0x51cf44,_0x2b04e1){_0x51cf44=_0x51cf44-0x0;var _0xb4dbd6=_0x0295[_0x51cf44];return _0xb4dbd6;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5029('0x9')});}; \ No newline at end of file +var _0x53ec=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x35a2f8,_0x4cd579){var _0x45e07a=function(_0xb40d04){while(--_0xb40d04){_0x35a2f8['push'](_0x35a2f8['shift']());}};_0x45e07a(++_0x4cd579);}(_0x53ec,0x192));var _0xc53e=function(_0x1a87a8,_0x127bc9){_0x1a87a8=_0x1a87a8-0x0;var _0x51b8b7=_0x53ec[_0x1a87a8];return _0x51b8b7;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc53e('0xb'),'collate':_0xc53e('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index a512c81..cc50a54 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 _0x8286=['stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x40bd56,_0x2491d1){var _0x20947d=function(_0x26a39c){while(--_0x26a39c){_0x40bd56['push'](_0x40bd56['shift']());}};_0x20947d(++_0x2491d1);}(_0x8286,0xcd));var _0x6828=function(_0x16fb0f,_0x3009d8){_0x16fb0f=_0x16fb0f-0x0;var _0x2679af=_0x8286[_0x16fb0f];return _0x2679af;};'use strict';var _=require(_0x6828('0x0'));var util=require('util');var moment=require(_0x6828('0x1'));var BPromise=require('bluebird');var rs=require(_0x6828('0x2'));var fs=require('fs');var Redis=require(_0x6828('0x3'));var db=require(_0x6828('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6828('0x5'));var jayson=require(_0x6828('0x6'));var client=jayson[_0x6828('0x7')][_0x6828('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x528afe,_0x32743e,_0x233461){return new BPromise(function(_0x14d54f,_0x24b3a4){return client[_0x6828('0x9')](_0x528afe,_0x233461)[_0x6828('0xa')](function(_0xad8ddd){logger[_0x6828('0xb')](_0x6828('0xc'),_0x32743e,_0x6828('0xd'));logger['debug'](_0x6828('0xe'),_0x32743e,'request\x20sent',JSON[_0x6828('0xf')](_0xad8ddd));if(_0xad8ddd[_0x6828('0x10')]){if(_0xad8ddd[_0x6828('0x10')]['code']===0x1f4){logger[_0x6828('0x10')](_0x6828('0xc'),_0x32743e,_0xad8ddd[_0x6828('0x10')][_0x6828('0x11')]);return _0x24b3a4(_0xad8ddd[_0x6828('0x10')][_0x6828('0x11')]);}logger['error'](_0x6828('0xc'),_0x32743e,_0xad8ddd[_0x6828('0x10')][_0x6828('0x11')]);return _0x14d54f(_0xad8ddd[_0x6828('0x10')][_0x6828('0x11')]);}else{logger[_0x6828('0xb')](_0x6828('0xc'),_0x32743e,_0x6828('0xd'));_0x14d54f(_0xad8ddd[_0x6828('0x12')]['message']);}})[_0x6828('0x13')](function(_0x33b50e){logger[_0x6828('0x10')]('SmsApplication,\x20%s,\x20%s',_0x32743e,_0x33b50e);_0x24b3a4(_0x33b50e);});});} \ No newline at end of file +var _0xfa9e=['http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfa9e,0xcd));var _0xefa9=function(_0x4b1ae4,_0x1e9e14){_0x4b1ae4=_0x4b1ae4-0x0;var _0x300eb4=_0xfa9e[_0x4b1ae4];return _0x300eb4;};'use strict';var _=require(_0xefa9('0x0'));var util=require('util');var moment=require(_0xefa9('0x1'));var BPromise=require(_0xefa9('0x2'));var rs=require(_0xefa9('0x3'));var fs=require('fs');var Redis=require(_0xefa9('0x4'));var db=require(_0xefa9('0x5'))['db'];var utils=require(_0xefa9('0x6'));var logger=require(_0xefa9('0x7'))('rpc');var config=require(_0xefa9('0x8'));var jayson=require(_0xefa9('0x9'));var client=jayson[_0xefa9('0xa')][_0xefa9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10c9aa,_0xc73e7b,_0xf66f9b){return new BPromise(function(_0x59447a,_0x4c02c8){return client[_0xefa9('0xc')](_0x10c9aa,_0xf66f9b)[_0xefa9('0xd')](function(_0x555433){logger['info'](_0xefa9('0xe'),_0xc73e7b,_0xefa9('0xf'));logger[_0xefa9('0x10')](_0xefa9('0x11'),_0xc73e7b,'request\x20sent',JSON['stringify'](_0x555433));if(_0x555433[_0xefa9('0x12')]){if(_0x555433[_0xefa9('0x12')][_0xefa9('0x13')]===0x1f4){logger[_0xefa9('0x12')](_0xefa9('0xe'),_0xc73e7b,_0x555433[_0xefa9('0x12')][_0xefa9('0x14')]);return _0x4c02c8(_0x555433['error'][_0xefa9('0x14')]);}logger[_0xefa9('0x12')]('SmsApplication,\x20%s,\x20%s',_0xc73e7b,_0x555433[_0xefa9('0x12')]['message']);return _0x59447a(_0x555433[_0xefa9('0x12')][_0xefa9('0x14')]);}else{logger[_0xefa9('0x15')](_0xefa9('0xe'),_0xc73e7b,'request\x20sent');_0x59447a(_0x555433[_0xefa9('0x16')][_0xefa9('0x14')]);}})[_0xefa9('0x17')](function(_0x3633ec){logger[_0xefa9('0x12')](_0xefa9('0xe'),_0xc73e7b,_0x3633ec);_0x4c02c8(_0x3633ec);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c52b13f..b86881b 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 _0x1baa=['isAuthenticated','index','describe','show','/:id/messages','getMessages','download','create','post','addMessage','tracked','sms','smsinteraction:addtags','put','/:id','smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','../../config/environment','get'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x1baa,0x111));var _0xa1ba=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1baa[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xa1ba('0x0'));var util=require(_0xa1ba('0x1'));var path=require('path');var timeout=require(_0xa1ba('0x2'));var express=require(_0xa1ba('0x3'));var router=express[_0xa1ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1ba('0x5'));var controller=require('./smsInteraction.controller');router[_0xa1ba('0x6')]('/',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x8')]);router['get']('/describe',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x9')]);router[_0xa1ba('0x6')]('/:id',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0xa')]);router[_0xa1ba('0x6')](_0xa1ba('0xb'),auth[_0xa1ba('0x7')](),controller[_0xa1ba('0xc')]);router[_0xa1ba('0x6')]('/:id/download',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0xd')]);router['post']('/',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0xe')]);router[_0xa1ba('0xf')]('/:id/messages',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x10')]);router[_0xa1ba('0xf')]('/:id/tags',auth[_0xa1ba('0x7')](),interaction[_0xa1ba('0x11')](_0xa1ba('0x12'),_0xa1ba('0x13')),controller['addTags']);router[_0xa1ba('0x14')](_0xa1ba('0x15'),auth['isAuthenticated'](),interaction[_0xa1ba('0x11')]('sms','smsinteraction:update'),controller['update']);router['delete'](_0xa1ba('0x15'),auth['isAuthenticated'](),interaction[_0xa1ba('0x11')](_0xa1ba('0x12'),_0xa1ba('0x16')),controller[_0xa1ba('0x17')]);router[_0xa1ba('0x18')](_0xa1ba('0x19'),auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x1a')]);module[_0xa1ba('0x1b')]=router; \ No newline at end of file +var _0x771a=['/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x2a5339,_0x237b03){var _0x50f704=function(_0x21a47){while(--_0x21a47){_0x2a5339['push'](_0x2a5339['shift']());}};_0x50f704(++_0x237b03);}(_0x771a,0x72));var _0xa771=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x771a[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0xa771('0x0'));var util=require(_0xa771('0x1'));var path=require(_0xa771('0x2'));var timeout=require(_0xa771('0x3'));var express=require(_0xa771('0x4'));var router=express['Router']();var auth=require(_0xa771('0x5'));var interaction=require(_0xa771('0x6'));var config=require('../../config/environment');var controller=require(_0xa771('0x7'));router[_0xa771('0x8')]('/',auth[_0xa771('0x9')](),controller[_0xa771('0xa')]);router[_0xa771('0x8')](_0xa771('0xb'),auth['isAuthenticated'](),controller[_0xa771('0xc')]);router[_0xa771('0x8')](_0xa771('0xd'),auth[_0xa771('0x9')](),controller[_0xa771('0xe')]);router[_0xa771('0x8')](_0xa771('0xf'),auth['isAuthenticated'](),controller[_0xa771('0x10')]);router[_0xa771('0x8')](_0xa771('0x11'),auth['isAuthenticated'](),controller[_0xa771('0x12')]);router['post']('/',auth[_0xa771('0x9')](),controller[_0xa771('0x13')]);router[_0xa771('0x14')](_0xa771('0xf'),auth[_0xa771('0x9')](),controller[_0xa771('0x15')]);router[_0xa771('0x14')](_0xa771('0x16'),auth[_0xa771('0x9')](),interaction[_0xa771('0x17')](_0xa771('0x18'),_0xa771('0x19')),controller[_0xa771('0x1a')]);router[_0xa771('0x1b')](_0xa771('0xd'),auth[_0xa771('0x9')](),interaction[_0xa771('0x17')]('sms',_0xa771('0x1c')),controller[_0xa771('0x1d')]);router[_0xa771('0x1e')](_0xa771('0xd'),auth[_0xa771('0x9')](),interaction[_0xa771('0x17')](_0xa771('0x18'),_0xa771('0x1f')),controller['destroy']);router[_0xa771('0x1e')](_0xa771('0x16'),auth[_0xa771('0x9')](),controller[_0xa771('0x20')]);module[_0xa771('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index f9a8ee2..d557dde 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 _0x8804=['sequelize','moment','exports','STRING','ENUM','DATE','out'];(function(_0x27fdec,_0x1fa897){var _0x6021f6=function(_0x387636){while(--_0x387636){_0x27fdec['push'](_0x27fdec['shift']());}};_0x6021f6(++_0x1fa897);}(_0x8804,0x9a));var _0x4880=function(_0x212eb1,_0x5c6183){_0x212eb1=_0x212eb1-0x0;var _0x499425=_0x8804[_0x212eb1];return _0x499425;};'use strict';var Sequelize=require(_0x4880('0x0'));var moment=require(_0x4880('0x1'));module[_0x4880('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4880('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4880('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4880('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4880('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8ea7=['out','moment','exports','DATE','STRING','ENUM'];(function(_0x7ba032,_0x19c3ae){var _0x255dee=function(_0x4f4275){while(--_0x4f4275){_0x7ba032['push'](_0x7ba032['shift']());}};_0x255dee(++_0x19c3ae);}(_0x8ea7,0x1cf));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x78ea('0x0'));module[_0x78ea('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x78ea('0x2')]},'disposition':{'type':Sequelize[_0x78ea('0x3')]},'note':{'type':Sequelize[_0x78ea('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x78ea('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x78ea('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x78ea('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x78ea('0x4')]('in',_0x78ea('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f75041a..d16b65d 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 _0x8085=['replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','`Messages.count`\x20=\x200','%s\x20>\x200','having','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','expr','mail_interaction_has_tags','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','User.name','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','TagIds','Tags','push','rows','catch','show','fields','includeAll','options','find','create','body','params','describe','SmsMessage','addMessage','ids','omit','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','unix','root','files','tmp','attachments','transcript-%d-%s.zip','Messages','createdAt','direction','secret','User','CmContact','firstName','SmsAccount','Account','Owner','fullname','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','mkdirSync','Sms','N.A.','closed','closedAt','disposition','out','System','server','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','SmsInteraction','rawAttributes','keys','query','filters','intersection','attributes','model','nolimit','offset','sort','where','pick','field','color','from','tools_tags','select','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','advancedFilter','parse','forEach','dateStart','format','endOf','day','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','TagId','Messages.count','length','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','\x20>\x20?','isArray','c.lastName','c.email','map','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','filter'];(function(_0x200004,_0x473941){var _0x48aad2=function(_0x5ce4cc){while(--_0x5ce4cc){_0x200004['push'](_0x200004['shift']());}};_0x48aad2(++_0x473941);}(_0x8085,0x71));var _0x5808=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x8085[_0x5a79e2];return _0x266c45;};'use strict';var pdf=require(_0x5808('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5808('0x1'));var jsonpatch=require(_0x5808('0x2'));var rp=require(_0x5808('0x3'));var moment=require(_0x5808('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5808('0x5'));var path=require(_0x5808('0x6'));var sox=require('sox');var csv=require(_0x5808('0x7'));var ejs=require(_0x5808('0x8'));var fs=require('fs');var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0x7'));var querystring=require(_0x5808('0xe'));var Papa=require(_0x5808('0xf'));var Redis=require(_0x5808('0x10'));var authService=require(_0x5808('0x11'));var qs=require(_0x5808('0x12'));var hardwareService=require(_0x5808('0x13'));var logger=require(_0x5808('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5808('0x15'));var db=require(_0x5808('0x16'))['db'];config[_0x5808('0x17')]=_[_0x5808('0x18')](config[_0x5808('0x17')],{'host':_0x5808('0x19'),'port':0x18eb});var socket=require(_0x5808('0x1a'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x5808('0x1b')](socket);function respondWithStatusCode(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xcc;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1c')](_0x3582d6);}return _0x19252b[_0x5808('0x1d')](_0x3582d6)[_0x5808('0x1e')]();};}function respondWithResult(_0x2af9da,_0x1dda8d){_0x1dda8d=_0x1dda8d||0xc8;return function(_0x46dd8a){if(_0x46dd8a){return _0x2af9da[_0x5808('0x1d')](_0x1dda8d)['json'](_0x46dd8a);}};}function respondWithFilteredResult(_0x3342ae,_0x5cd687){return function(_0x406e65){if(_0x406e65){var _0x25dc4e=_0x406e65[_0x5808('0x1f')],_0x3bf0ee=_0x5cd687['offset'],_0x529a0d=_0x5cd687['offset']+_0x5cd687[_0x5808('0x20')],_0x9e58d4;if(_0x529a0d>=_0x25dc4e){_0x529a0d=_0x25dc4e;_0x9e58d4=0xc8;}else{_0x9e58d4=0xce;}_0x3342ae['status'](_0x9e58d4);return _0x3342ae[_0x5808('0x21')](_0x5808('0x22'),_0x3bf0ee+'-'+_0x529a0d+'/'+_0x25dc4e)[_0x5808('0x23')](_0x406e65);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x24')](_0xe82ad0);}return _0x578d70[_0x5808('0x25')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x26')](_0x39bca3)[_0x5808('0x27')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x28')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1e')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x29')](_0x27c991[_0x5808('0x2a')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x2b')];}_0x24ee0f[_0x5808('0x1d')](_0x2c2cb5)[_0x5808('0x2c')](_0x27c991);};}exports[_0x5808('0x2d')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=db[_0x5808('0x2e')][_0x5808('0x2f')];_0x4ad6d8['model']=_[_0x5808('0x30')](_0x4f6342);_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x30')](_0x28c1eb[_0x5808('0x31')]);_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x4ad6d8['model'],_0x4ad6d8[_0x5808('0x31')]);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x33')](_0x4ad6d8['model'],qs['fields'](_0x28c1eb[_0x5808('0x31')]['fields']));_0x1117ac[_0x5808('0x34')]=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8[_0x5808('0x35')];if(!_0x28c1eb['query']['hasOwnProperty'](_0x5808('0x36'))){_0x1117ac['limit']=qs[_0x5808('0x20')](_0x28c1eb['query'][_0x5808('0x20')]);_0x1117ac[_0x5808('0x37')]=qs[_0x5808('0x37')](_0x28c1eb['query'][_0x5808('0x37')]);}_0x1117ac['order']=qs[_0x5808('0x38')](_0x28c1eb['query']['sort']);_0x1117ac[_0x5808('0x39')]=qs[_0x5808('0x32')](_[_0x5808('0x3a')](_0x28c1eb['query'],_0x4ad6d8['filters']));var _0x243ce3=[];var _0x2aa211=squel['select']()[_0x5808('0x3b')]('id')[_0x5808('0x3b')](_0x5808('0x2b'))['field'](_0x5808('0x3c'))[_0x5808('0x3d')](_0x5808('0x3e'));var _0x47cd32=squel[_0x5808('0x3f')]()[_0x5808('0x3b')]('COUNT(*)')['from'](_0x5808('0x40'),'me')['where'](_0x5808('0x41'))[_0x5808('0x39')](_0x5808('0x42'))[_0x5808('0x39')](_0x5808('0x43'));var _0x5300a7=squel['select']()[_0x5808('0x3b')](_0x5808('0x44'))[_0x5808('0x3b')]('ui.SmsInteractionId')[_0x5808('0x3d')](_0x5808('0x45'),'ui')[_0x5808('0x46')](_0x5808('0x47'),'u',_0x5808('0x48'));var _0x5eea38=squel[_0x5808('0x3f')]()[_0x5808('0x3d')](_0x5808('0x49'),'i')['left_join'](_0x5808('0x45'),'ui',_0x5808('0x4a'))[_0x5808('0x46')]('users','u','u.id\x20=\x20ui.UserId')[_0x5808('0x46')](_0x5808('0x4b'),'c',_0x5808('0x4c'))[_0x5808('0x46')](_0x5808('0x47'),'o',_0x5808('0x4d'))[_0x5808('0x46')](_0x5808('0x4e'),'a',_0x5808('0x4f'))[_0x5808('0x46')](_0x5808('0x40'),'me',_0x5808('0x41'));var _0x225a3c=squel['expr']();if(_0x28c1eb['query'][_0x5808('0x50')]){var _0x37cbc8=JSON[_0x5808('0x51')](_0x28c1eb[_0x5808('0x31')][_0x5808('0x50')]);_[_0x5808('0x30')](_0x37cbc8)[_0x5808('0x52')](function(_0x545713){var _0x5cf743=_0x37cbc8[_0x545713];if(_0x545713==='createdAt'){var _0x1a50e8=moment(_0x5cf743['value'][_0x5808('0x53')])['startOf']('day')['utc']()[_0x5808('0x54')]();var _0x3c974c=moment(_0x3c974c)['utc']()[_0x5808('0x55')](_0x5808('0x56'))[_0x5808('0x54')]();_0x225a3c['and'](_0x5808('0x57'),_0x1a50e8,_0x3c974c);}else{if(_['isArray'](_0x5cf743[_0x5808('0x58')])){_0x5cf743[_0x5808('0x58')][_0x5808('0x52')](function(_0x5cc977){switch(_0x5cf743[_0x5808('0x58')][_0x5808('0x59')]){case'IS':if(_0x545713!==_0x5808('0x5a')&&_0x545713!==_0x5808('0x5b')){if(_['isArray'](_0x5cf743[_0x5808('0x59')])&&_0x5cf743[_0x5808('0x59')][_0x5808('0x5c')]>0x1){_0x225a3c[_0x5808('0x5d')](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+_0x5808('0x5f'),_0x5cf743['value']);}else{_0x225a3c[_0x5808('0x5d')](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+_0x5808('0x60'),_0x5cf743[_0x5808('0x59')][0x0]);}}break;case'=':_0x225a3c[_0x5808('0x5d')](_0x5cf743['tableAlias']+'.'+_0x545713+_0x5808('0x60'),_0x5cf743[_0x5808('0x59')]);break;case _0x5808('0x61'):if(_0x545713===_0x5808('0x62')){_0x225a3c[_0x5808('0x5d')](_0x5808('0x63')+'\x20LIKE\x20?','%'+_0x5cf743[_0x5808('0x59')]+'%');_0x225a3c['or']('c.lastName'+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');_0x225a3c['or']('c.email'+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');}else{_0x225a3c[_0x5808('0x5d')](_0x5cf743['tableAlias']+'.'+_0x545713+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');}break;case'>':_0x225a3c['and'](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+_0x5808('0x65'),_0x5cf743['value']);break;case'<':_0x225a3c['and'](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+'\x20<\x20?',_0x5cf743[_0x5808('0x59')]);break;}});}else{switch(_0x5cf743['condition']['value']){case'IS':if(_0x545713!==_0x5808('0x5a')&&_0x545713!==_0x5808('0x5b')){if(_[_0x5808('0x66')](_0x5cf743[_0x5808('0x59')])&&_0x5cf743[_0x5808('0x59')][_0x5808('0x5c')]>0x1){_0x225a3c[_0x5808('0x5d')](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+_0x5808('0x5f'),_0x5cf743[_0x5808('0x59')]);}else{_0x225a3c['and'](_0x5cf743['tableAlias']+'.'+_0x545713+'\x20=\x20?',_0x5cf743[_0x5808('0x59')][0x0]);}}break;case'=':_0x225a3c[_0x5808('0x5d')](_0x5cf743['tableAlias']+'.'+_0x545713+_0x5808('0x60'),_0x5cf743['value']);break;case _0x5808('0x61'):if(_0x545713===_0x5808('0x62')){_0x225a3c[_0x5808('0x5d')](_0x5808('0x63')+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');_0x225a3c['or'](_0x5808('0x67')+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');_0x225a3c['or'](_0x5808('0x68')+'\x20LIKE\x20?','%'+_0x5cf743[_0x5808('0x59')]+'%');}else{_0x225a3c[_0x5808('0x5d')](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+_0x5808('0x64'),'%'+_0x5cf743[_0x5808('0x59')]+'%');}break;case'>':_0x225a3c[_0x5808('0x5d')](_0x5cf743['tableAlias']+'.'+_0x545713+'\x20>\x20?',_0x5cf743['value']);break;case'<':_0x225a3c[_0x5808('0x5d')](_0x5cf743[_0x5808('0x5e')]+'.'+_0x545713+'\x20<\x20?',_0x5cf743[_0x5808('0x59')]);break;}}}});}else{var _0xa5f7a0=_(Object[_0x5808('0x30')](_0x28c1eb[_0x5808('0x31')]))[_0x5808('0x69')](function(_0x179880){return _0x4f6342['hasOwnProperty'](_0x179880)?_0x179880:undefined;})['filter'](function(_0x141131){return!_[_0x5808('0x6a')](_0x141131);})[_0x5808('0x59')]();if(!_[_0x5808('0x6b')](_0xa5f7a0)){_0xa5f7a0[_0x5808('0x52')](function(_0x56a8c9){if(_0x56a8c9===_0x5808('0x6c')){_0x5eea38[_0x5808('0x39')](_0x5808('0x6d'),[][_0x5808('0x6e')](_0x28c1eb[_0x5808('0x31')][_0x56a8c9]));}else if(_0x56a8c9==='createdAt'){var _0x32f15d=JSON[_0x5808('0x51')](_0x28c1eb[_0x5808('0x31')][_0x56a8c9])[_0x5808('0x6f')];var _0x28322a=JSON[_0x5808('0x51')](_0x28c1eb[_0x5808('0x31')][_0x56a8c9])[_0x5808('0x70')];_0x5eea38[_0x5808('0x39')](_0x5808('0x57'),_0x32f15d,_0x28322a);}else{_0x5eea38[_0x5808('0x39')]('i.'+_0x56a8c9+'\x20=\x20?',_0x28c1eb['query'][_0x56a8c9]);}});}if(_0x28c1eb[_0x5808('0x31')][_0x5808('0x71')]){var _0x42bb9d=_0x28c1eb['query'][_0x5808('0x71')][_0x5808('0x72')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5808('0x73'));if(qs[_0x5808('0x74')](_0x42bb9d)){_0x225a3c['or']('i.id\x20LIKE\x20?',_0x42bb9d+'%')['or'](_0x5808('0x75'),_0x42bb9d+'%');}else{var _0x188248=[];_0x42bb9d[_0x5808('0x76')]('\x20')[_0x5808('0x52')](function(_0x4bdc43){_0x188248['push']('+'+_0x4bdc43[_0x5808('0x77')]());});var _0x30203e=_0x188248[_0x5808('0x78')]('\x20');_0x225a3c['or'](_0x5808('0x79'),_0x30203e)['or'](_0x5808('0x7a'),_0x42bb9d+'%');}}}_0x5eea38['where'](_0x225a3c);if(_0x1117ac['order']){_0x1117ac[_0x5808('0x7b')]['forEach'](function(_0xe7f623){_0x5eea38['order']('i.'+_0xe7f623[0x0],_0xe7f623[0x1]===_0x5808('0x7c')?![]:!![]);});}_0x5eea38[_0x5808('0x7d')]('i.id');var _0x1a1066={'type':db[_0x5808('0x7e')][_0x5808('0x7f')][_0x5808('0x80')],'raw':!![]};var _0x17693c=_0x5eea38[_0x5808('0x81')]()[_0x5808('0x3b')]('COUNT(*)');if(!_0x28c1eb['query'][_0x5808('0x50')]){if(_0x28c1eb[_0x5808('0x31')][_0x5808('0x82')]){if(_0x28c1eb['query'][_0x5808('0x82')]==0x1){_0x17693c['where'](util['format']('%s\x20=\x200',_0x47cd32[_0x5808('0x77')]()));_0x5eea38['having'](_0x5808('0x83'));}else{_0x17693c[_0x5808('0x39')](util[_0x5808('0x54')](_0x5808('0x84'),_0x47cd32[_0x5808('0x77')]()));_0x5eea38[_0x5808('0x85')]('`Messages.count`\x20>\x200');}}if(_0x28c1eb[_0x5808('0x31')][_0x5808('0x86')]){var _0x23784f=_[_0x5808('0x66')](_0x28c1eb['query'][_0x5808('0x86')])?_0x28c1eb['query'][_0x5808('0x86')]:new Array(_0x28c1eb['query'][_0x5808('0x86')]);var _0x2f6c67=squel['expr']();_0x23784f[_0x5808('0x52')](function(_0x32e24a){_0x2f6c67['or'](_0x5808('0x87'),'%,'+_0x32e24a+',%');});_0x5eea38[_0x5808('0x85')](_0x2f6c67);_0x17693c[_0x5808('0x46')](_0x5808('0x88'),'it',_0x5808('0x89'));_0x17693c['left_join'](_0x5808('0x3e'),'t',_0x5808('0x8a'));_0x17693c['where'](_0x5808('0x8b'),_0x23784f);}}else{var _0x37cbc8=JSON[_0x5808('0x51')](_0x28c1eb['query'][_0x5808('0x50')]);_[_0x5808('0x30')](_0x37cbc8)[_0x5808('0x52')](function(_0x2c0e15){var _0x3c8711=_0x37cbc8[_0x2c0e15];if(_0x2c0e15===_0x5808('0x5a')){var _0x88fb07=_0x3c8711[_0x5808('0x59')];var _0x646789=squel[_0x5808('0x8c')]();_0x88fb07['forEach'](function(_0x1487ca){_0x646789['or'](_0x5808('0x87'),'%,'+_0x1487ca+',%');});_0x5eea38[_0x5808('0x85')](_0x646789);_0x17693c['left_join'](_0x5808('0x8d'),'it','it.MailInteractionId\x20=\x20i.id');_0x17693c[_0x5808('0x46')]('tools_tags','t',_0x5808('0x8a'));_0x17693c[_0x5808('0x39')](_0x5808('0x8b'),_0x88fb07);}else if(_0x2c0e15==='Messages.count'){if(_0x3c8711['value']['length']===0x1){if(_0x3c8711['value'][0x0]===0x1){_0x17693c[_0x5808('0x39')](util[_0x5808('0x54')]('%s\x20=\x200',_0x47cd32[_0x5808('0x77')]()));_0x5eea38[_0x5808('0x85')](_0x5808('0x83'));}else{_0x17693c[_0x5808('0x39')](util[_0x5808('0x54')]('%s\x20>\x200',_0x47cd32[_0x5808('0x77')]()));_0x5eea38[_0x5808('0x85')](_0x5808('0x8e'));}}}});}db[_0x5808('0x8f')][_0x5808('0x31')](_0x17693c['toString'](),_0x1a1066)[_0x5808('0x27')](function(_0x7f341c){_0x560e83[_0x5808('0x1f')]=_0x7f341c[_0x5808('0x5c')];if(_0x560e83[_0x5808('0x1f')]===0x0)return[];return db[_0x5808('0x8f')][_0x5808('0x31')](_0x2aa211[_0x5808('0x77')](),_0x1a1066)[_0x5808('0x27')](function(_0x3e999c){_0x243ce3=_[_0x5808('0x90')](_0x3e999c,'id');_0x1a1066=_[_0x5808('0x91')](_0x1a1066,{'model':db[_0x5808('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5eea38[_0x5808('0x3b')](_0x47cd32,'Messages.count');_0x5eea38[_0x5808('0x3b')](_0x5808('0x92'),_0x5808('0x93'));_0x5eea38[_0x5808('0x3b')]('i.*');_0x5eea38['field'](_0x5808('0x63'),_0x5808('0x94'));_0x5eea38[_0x5808('0x3b')](_0x5808('0x67'),_0x5808('0x95'));_0x5eea38[_0x5808('0x3b')](_0x5808('0x68'),_0x5808('0x96'));_0x5eea38[_0x5808('0x3b')](_0x5808('0x97'),_0x5808('0x98'));_0x5eea38[_0x5808('0x3b')]('c.mobile',_0x5808('0x99'));_0x5eea38['field'](_0x5808('0x9a'),'Contact.fax');_0x5eea38['field']('u.fullname',_0x5808('0x9b'));_0x5eea38[_0x5808('0x3b')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');_0x5eea38[_0x5808('0x46')](_0x5808('0x88'),'it',_0x5808('0x89'));_0x5eea38[_0x5808('0x46')]('tools_tags','t',_0x5808('0x8a'));_0x5eea38[_0x5808('0x20')](_0x1117ac['limit']);_0x5eea38[_0x5808('0x37')](_0x1117ac['offset']);return db[_0x5808('0x8f')]['query'](_0x5eea38['toString'](),_0x1a1066);})['then'](function(_0x488637){_0x5300a7[_0x5808('0x39')](_0x5808('0x9c'),_[_0x5808('0x69')](_0x488637,'id'));return db['sequelize'][_0x5808('0x31')](_0x5300a7[_0x5808('0x77')](),_0x1a1066)[_0x5808('0x27')](function(_0xb5d197){var _0x31cf6f=_[_0x5808('0x9d')](_0xb5d197,_0x5808('0x9e'));_0x488637['forEach'](function(_0x36991d){if(_0x31cf6f[_0x36991d['id']]){_0x36991d['Users']=_[_0x5808('0x69')](_0x31cf6f[_0x36991d['id']],function(_0x263dea){return{'id':_0x263dea['id']};});}if(_0x36991d['TagIds']){_0x36991d['Tags']=[];_0x36991d[_0x5808('0x9f')][_0x5808('0x76')](',')[_0x5808('0x52')](function(_0x2c4c45){_0x36991d[_0x5808('0xa0')][_0x5808('0xa1')](_0x243ce3[_0x2c4c45]);});}delete _0x36991d[_0x5808('0x9f')];});return _0x488637;});});})[_0x5808('0x27')](function(_0x4dc79d){_0x560e83[_0x5808('0xa2')]=_0x4dc79d;return _0x560e83;})[_0x5808('0x27')](respondWithFilteredResult(_0x19ac63,_0x1117ac))[_0x5808('0xa3')](handleError(_0x19ac63,null));};exports[_0x5808('0xa4')]=function(_0x25535e,_0x34a739){var _0x28b6ac={'raw':![],'where':{'id':_0x25535e['params']['id']}},_0x5d2c90={};_0x5d2c90['model']=_['keys'](db['SmsInteraction']['rawAttributes']);_0x5d2c90['query']=_[_0x5808('0x30')](_0x25535e[_0x5808('0x31')]);_0x5d2c90[_0x5808('0x32')]=_[_0x5808('0x33')](_0x5d2c90[_0x5808('0x35')],_0x5d2c90[_0x5808('0x31')]);_0x28b6ac[_0x5808('0x34')]=_[_0x5808('0x33')](_0x5d2c90[_0x5808('0x35')],qs['fields'](_0x25535e['query'][_0x5808('0xa5')]));_0x28b6ac[_0x5808('0x34')]=_0x28b6ac[_0x5808('0x34')][_0x5808('0x5c')]?_0x28b6ac[_0x5808('0x34')]:_0x5d2c90['model'];if(_0x25535e[_0x5808('0x31')][_0x5808('0xa6')]){_0x28b6ac['include']=[{'all':!![]}];}_0x28b6ac=_[_0x5808('0x91')]({},_0x28b6ac,_0x25535e[_0x5808('0xa7')]);return db['SmsInteraction'][_0x5808('0xa8')](_0x28b6ac)[_0x5808('0x27')](handleEntityNotFound(_0x34a739,null))[_0x5808('0x27')](respondWithResult(_0x34a739,null))['catch'](handleError(_0x34a739,null));};exports[_0x5808('0xa9')]=function(_0x2583c2,_0x2a8851){return db[_0x5808('0x2e')]['create'](_0x2583c2[_0x5808('0xaa')],{})[_0x5808('0x27')](respondWithResult(_0x2a8851,0xc9))[_0x5808('0xa3')](handleError(_0x2a8851,null));};exports['update']=function(_0x5d14f4,_0x5b031c){if(_0x5d14f4[_0x5808('0xaa')]['id']){delete _0x5d14f4['body']['id'];}return db[_0x5808('0x2e')][_0x5808('0xa8')]({'where':{'id':_0x5d14f4[_0x5808('0xab')]['id']}})[_0x5808('0x27')](handleEntityNotFound(_0x5b031c,null))['then'](saveUpdates(_0x5d14f4[_0x5808('0xaa')],null))[_0x5808('0x27')](respondWithResult(_0x5b031c,null))[_0x5808('0xa3')](handleError(_0x5b031c,null));};exports[_0x5808('0x28')]=function(_0x4665c5,_0x2c65a5){return db[_0x5808('0x2e')][_0x5808('0xa8')]({'where':{'id':_0x4665c5[_0x5808('0xab')]['id']}})['then'](handleEntityNotFound(_0x2c65a5,null))[_0x5808('0x27')](removeEntity(_0x2c65a5,null))[_0x5808('0xa3')](handleError(_0x2c65a5,null));};exports['describe']=function(_0x294d76,_0x4fd581){return db[_0x5808('0x2e')][_0x5808('0xac')]()['then'](respondWithResult(_0x4fd581,null))[_0x5808('0xa3')](handleError(_0x4fd581,null));};exports['addMessage']=function(_0x2ebeb8,_0x27536a,_0x517af0){return db[_0x5808('0xad')][_0x5808('0xa8')]({'where':{'id':_0x2ebeb8[_0x5808('0xab')]['id']}})['then'](handleEntityNotFound(_0x27536a,null))[_0x5808('0x27')](function(_0x2fc2fc){if(_0x2fc2fc){return _0x2fc2fc[_0x5808('0xae')](_0x2ebeb8[_0x5808('0xaa')][_0x5808('0xaf')],_[_0x5808('0xb0')](_0x2ebeb8[_0x5808('0xaa')],[_0x5808('0xaf'),'id'])||{});}})[_0x5808('0x27')](respondWithResult(_0x27536a,null))[_0x5808('0xa3')](handleError(_0x27536a,null));};exports['getMessages']=function(_0x51b1f4,_0xd8c1fc,_0x331b75){var _0x3fb4a1={'raw':![],'where':{}};var _0x399aa6={};var _0x123a7f={'count':0x0,'rows':[]};return db[_0x5808('0x2e')]['findOne']({'where':{'id':_0x51b1f4['params']['id']}})['then'](handleEntityNotFound(_0xd8c1fc,null))['then'](function(_0x20b351){if(_0x20b351){_0x399aa6[_0x5808('0x35')]=_[_0x5808('0x30')](db['SmsMessage'][_0x5808('0x2f')]);_0x399aa6[_0x5808('0x31')]=_[_0x5808('0x30')](_0x51b1f4[_0x5808('0x31')]);_0x399aa6[_0x5808('0x32')]=_[_0x5808('0x33')](_0x399aa6[_0x5808('0x35')],_0x399aa6[_0x5808('0x31')]);_0x3fb4a1[_0x5808('0x34')]=_[_0x5808('0x33')](_0x399aa6['model'],qs['fields'](_0x51b1f4[_0x5808('0x31')][_0x5808('0xa5')]));_0x3fb4a1['attributes']=_0x3fb4a1[_0x5808('0x34')][_0x5808('0x5c')]?_0x3fb4a1['attributes']:_0x399aa6[_0x5808('0x35')];if(!_0x51b1f4[_0x5808('0x31')][_0x5808('0xb1')]('nolimit')){_0x3fb4a1[_0x5808('0x20')]=qs[_0x5808('0x20')](_0x51b1f4[_0x5808('0x31')][_0x5808('0x20')]);_0x3fb4a1[_0x5808('0x37')]=qs['offset'](_0x51b1f4[_0x5808('0x31')][_0x5808('0x37')]);}_0x3fb4a1[_0x5808('0x7b')]=qs[_0x5808('0x38')](_0x51b1f4[_0x5808('0x31')][_0x5808('0x38')]);_0x3fb4a1['where']=qs[_0x5808('0x32')](_[_0x5808('0x3a')](_0x51b1f4[_0x5808('0x31')],_0x399aa6[_0x5808('0x32')]));_0x3fb4a1[_0x5808('0x39')][_0x5808('0x9e')]=_0x20b351['id'];if(_0x51b1f4[_0x5808('0x31')][_0x5808('0x71')]){_0x3fb4a1['where']=_[_0x5808('0x91')](_0x3fb4a1['where'],{'$or':_[_0x5808('0x69')](_0x3fb4a1[_0x5808('0x34')],function(_0x18c4fa){var _0x3d8d90={};_0x3d8d90[_0x18c4fa]={'$like':'%'+_0x51b1f4[_0x5808('0x31')]['filter']+'%'};return _0x3d8d90;})});}if(_0x51b1f4[_0x5808('0x31')]['$gte']){var _0x55dda8=_0x51b1f4[_0x5808('0x31')][_0x5808('0x6f')][_0x5808('0x76')](',');var _0x8f3b35={};_0x8f3b35[_0x55dda8[0x0]]={'$gte':moment(_0x55dda8[0x1])[_0x5808('0x54')](_0x5808('0xb2'))};_0x3fb4a1[_0x5808('0x39')]=_[_0x5808('0x91')](_0x3fb4a1[_0x5808('0x39')],_0x8f3b35);}_0x3fb4a1=_['merge']({},_0x3fb4a1,_0x51b1f4[_0x5808('0xa7')]);return db['SmsMessage'][_0x5808('0x1f')]({'where':_0x3fb4a1[_0x5808('0x39')]})[_0x5808('0x27')](function(_0x1f20c6){_0x123a7f[_0x5808('0x1f')]=_0x1f20c6;if(_0x51b1f4[_0x5808('0x31')][_0x5808('0xa6')]){_0x3fb4a1[_0x5808('0xb3')]=[{'all':!![]}];}return db[_0x5808('0xad')][_0x5808('0xb4')](_0x3fb4a1);})[_0x5808('0x27')](function(_0x19e5af){_0x123a7f[_0x5808('0xa2')]=_0x19e5af;return _0x123a7f;});}})[_0x5808('0x27')](respondWithFilteredResult(_0xd8c1fc,_0x3fb4a1))[_0x5808('0xa3')](handleError(_0xd8c1fc,null));};exports[_0x5808('0xb5')]=function(_0x515eca,_0x384be9,_0x1e1840){return db[_0x5808('0x2e')][_0x5808('0xa8')]({'where':{'id':_0x515eca[_0x5808('0xab')]['id']}})[_0x5808('0x27')](handleEntityNotFound(_0x384be9,null))[_0x5808('0x27')](function(_0x3de512){if(_0x3de512){return _0x3de512[_0x5808('0xb6')](_0x515eca[_0x5808('0xaa')][_0x5808('0xaf')],_[_0x5808('0xb0')](_0x515eca[_0x5808('0xaa')],[_0x5808('0xaf'),'id'])||{})[_0x5808('0xb7')](function(){return db[_0x5808('0xb8')][_0x5808('0xb4')]({'attributes':['id',_0x5808('0x2b'),_0x5808('0x3c')],'where':{'id':_0x515eca[_0x5808('0xaa')]['ids']}});})[_0x5808('0x27')](function(_0x256b0c){socket[_0x5808('0xb9')](_0x5808('0xba'),{'id':Number(_0x515eca[_0x5808('0xab')]['id']),'tags':_0x256b0c||[]});return{'id':Number(_0x515eca['params']['id']),'tags':_0x256b0c||[]};});}})[_0x5808('0x27')](respondWithResult(_0x384be9,null))['catch'](handleError(_0x384be9,null));};exports[_0x5808('0xbb')]=function(_0x58d3b3,_0x501a5a,_0x533e41){return db[_0x5808('0x2e')][_0x5808('0xa8')]({'where':{'id':_0x58d3b3[_0x5808('0xab')]['id']}})[_0x5808('0x27')](handleEntityNotFound(_0x501a5a,null))['then'](function(_0x550bc0){if(_0x550bc0){return _0x550bc0['removeTags'](_0x58d3b3[_0x5808('0x31')][_0x5808('0xaf')]);}})[_0x5808('0x27')](respondWithStatusCode(_0x501a5a,null))[_0x5808('0xa3')](handleError(_0x501a5a,null));};exports['download']=function(_0x1bae20,_0x2d4670){var _0x2f853=moment()[_0x5808('0xbc')]()[_0x5808('0x77')]();var _0x313528=path[_0x5808('0x78')](config[_0x5808('0xbd')],'server',_0x5808('0xbe'),_0x5808('0xbf'));var _0x34c5ba=path[_0x5808('0x78')](config[_0x5808('0xbd')],'server','files',_0x5808('0xc0'));var _0xc1b298=path[_0x5808('0x78')](_0x313528,_0x2f853);var _0x379298=util[_0x5808('0x54')](_0x5808('0xc1'),_0x1bae20[_0x5808('0xab')]['id'],_0x2f853);var _0x79f917=path[_0x5808('0x78')](_0x313528,_0x379298);var _0x2ff8ea=![];return db[_0x5808('0x2e')][_0x5808('0xa8')]({'where':{'id':_0x1bae20[_0x5808('0xab')]['id']},'include':[{'model':db[_0x5808('0xad')],'as':_0x5808('0xc2'),'attributes':['id',_0x5808('0xaa'),_0x5808('0xc3'),_0x5808('0xc4'),_0x5808('0xc5')],'include':[{'model':db[_0x5808('0xc6')],'as':_0x5808('0xc6'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x5808('0xc7')],'as':'Contact','attributes':['id',_0x5808('0xc8'),'lastName'],'raw':!![]}]},{'model':db[_0x5808('0xc9')],'as':_0x5808('0xca'),'attributes':['id',_0x5808('0x2b')]},{'model':db[_0x5808('0xc6')],'as':_0x5808('0xcb'),'attributes':['id',_0x5808('0xcc')]}]})['then'](handleEntityNotFound(_0x2d4670,null))[_0x5808('0x27')](function(_0x1f329b){if(_0x1f329b){var _0x577cb5=_0x1f329b[_0x5808('0xcd')]({'plain':!![]});_0x2ff8ea=!![];var _0x49cfa1={'format':'A4','border':'10px','header':{'height':_0x5808('0xce'),'contents':{'first':_0x5808('0xcf')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x5808('0xd0'),util[_0x5808('0x54')]('%s\x20#%d','Sms',_0x577cb5['id']),moment()[_0x5808('0x54')](_0x5808('0xd1'))[_0x5808('0x77')]())}}};fs[_0x5808('0xd2')](_0xc1b298);var _0x4fa0ab={'channel':_0x5808('0xd3'),'account':_0x577cb5[_0x5808('0xca')][_0x5808('0x2b')],'agent':_0x577cb5[_0x5808('0xcb')]?_0x577cb5[_0x5808('0xcb')][_0x5808('0xcc')]:_0x5808('0xd4'),'createdAt':moment(_0x577cb5[_0x5808('0xc3')])[_0x5808('0x54')](_0x5808('0xb2'))[_0x5808('0x77')](),'closedAt':_0x577cb5[_0x5808('0xd5')]?moment(_0x577cb5[_0x5808('0xd6')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x577cb5[_0x5808('0xd7')],'messages':_(_0x577cb5[_0x5808('0xc2')])[_0x5808('0x71')]({'secret':![]})[_0x5808('0x69')](function(_0x3dd506){return{'date':moment(_0x3dd506['createdAt'])['format'](_0x5808('0xb2'))[_0x5808('0x77')](),'sender':_0x3dd506[_0x5808('0xc4')]===_0x5808('0xd8')?_0x3dd506[_0x5808('0xc6')]?_0x3dd506[_0x5808('0xc6')][_0x5808('0xcc')]:_0x5808('0xd9'):_0x3dd506['Contact'][_0x5808('0xc8')]+(_0x3dd506['Contact']['lastName']?'\x20'+_0x3dd506['Contact']['lastName']:''),'body':_0x3dd506[_0x5808('0xaa')],'direction':_0x3dd506[_0x5808('0xc4')]===_0x5808('0xd8')?'A':'C','secret':_0x3dd506[_0x5808('0xc5')]};})['value']()};return ejs['renderFile'](path[_0x5808('0x78')](config[_0x5808('0xbd')],_0x5808('0xda'),_0x5808('0xdb'),_0x5808('0xdc')),{'interaction':_0x4fa0ab})['then'](function(_0x82fee8){return new BPromise(function(_0x62d9ae,_0x421a01){pdf[_0x5808('0xa9')](_0x82fee8,_0x49cfa1)[_0x5808('0xdd')](path[_0x5808('0x78')](_0xc1b298,_0x5808('0xde')+_0x577cb5['id']+'-'+_0x2f853+_0x5808('0xdf')),function(_0x30eee8,_0x195f3d){if(_0x30eee8)return _0x421a01(_0x30eee8);_0x62d9ae(_0x195f3d);});});});}})[_0x5808('0x27')](function(){if(_0x2ff8ea){return new BPromise(function(_0x4aa725,_0x294db6){zipdir(_0xc1b298,{'saveTo':_0x79f917},function(_0x4c9438,_0x4f757d){if(_0x4c9438)return _0x294db6(_0x4c9438);return _0x4aa725(_0x4f757d);});})['then'](function(){return new BPromise(function(_0x19b20c,_0x3a2bee){rimraf(_0xc1b298,function(_0x3c2c02){if(_0x3c2c02)_0x3a2bee(_0x3c2c02);return _0x19b20c();});});})['then'](function(){return _0x2d4670['download'](_0x79f917,_0x379298,function(_0x35078e){if(_0x35078e){console[_0x5808('0xe0')](_0x5808('0xe1'),_0x35078e);}else{fs[_0x5808('0xe2')](_0x79f917);}});});}else{return _0x2d4670[_0x5808('0x1c')](0xc8);}})[_0x5808('0xa3')](handleError(_0x2d4670,null));}; \ No newline at end of file +var _0x9fe7=['direction','secret','User','fullname','Contact','firstName','SmsAccount','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\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','Owner','N.A.','closed','closedAt','disposition','out','System','lastName','renderFile','views','toFile','.pdf','log','err','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','error','stack','name','send','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','format','utc','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','Messages.count','length','tableAlias','\x20=\x20?','LIKE','ContactId','c.email','\x20<\x20?','\x20IN\x20?','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','map','filter','SmsAccountId','$gte','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','then','count','keyBy','Account.key','i.*','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','Users','TagIds','Tags','split','show','params','SmsInteraction','rawAttributes','includeAll','merge','options','find','catch','body','update','destroy','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','removeTags','download','unix','root','server','files','tmp','attachments','Messages'];(function(_0x13439f,_0x5c7a77){var _0xaa316f=function(_0xd1cf48){while(--_0xd1cf48){_0x13439f['push'](_0x13439f['shift']());}};_0xaa316f(++_0x5c7a77);}(_0x9fe7,0x1df));var _0x79fe=function(_0xe71c81,_0x48f7a8){_0xe71c81=_0xe71c81-0x0;var _0x575765=_0x9fe7[_0xe71c81];return _0x575765;};'use strict';var pdf=require(_0x79fe('0x0'));var emlformat=require(_0x79fe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x79fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79fe('0x3'));var moment=require(_0x79fe('0x4'));var BPromise=require(_0x79fe('0x5'));var Mustache=require('mustache');var util=require(_0x79fe('0x6'));var path=require(_0x79fe('0x7'));var sox=require(_0x79fe('0x8'));var csv=require('to-csv');var ejs=require(_0x79fe('0x9'));var fs=require('fs');var _=require(_0x79fe('0xa'));var squel=require(_0x79fe('0xb'));var crypto=require('crypto');var jsforce=require(_0x79fe('0xc'));var deskjs=require(_0x79fe('0xd'));var toCsv=require(_0x79fe('0xe'));var querystring=require(_0x79fe('0xf'));var Papa=require(_0x79fe('0x10'));var Redis=require('ioredis');var authService=require(_0x79fe('0x11'));var qs=require(_0x79fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79fe('0x13'))(_0x79fe('0x14'));var utils=require(_0x79fe('0x15'));var config=require(_0x79fe('0x16'));var db=require('../../mysqldb')['db'];config[_0x79fe('0x17')]=_[_0x79fe('0x18')](config[_0x79fe('0x17')],{'host':_0x79fe('0x19'),'port':0x18eb});var socket=require(_0x79fe('0x1a'))(new Redis(config[_0x79fe('0x17')]));require(_0x79fe('0x1b'))[_0x79fe('0x1c')](socket);function respondWithStatusCode(_0x4be1c4,_0x3bd14a){_0x3bd14a=_0x3bd14a||0xcc;return function(_0x238e60){if(_0x238e60){return _0x4be1c4[_0x79fe('0x1d')](_0x3bd14a);}return _0x4be1c4[_0x79fe('0x1e')](_0x3bd14a)[_0x79fe('0x1f')]();};}function respondWithResult(_0x25e91b,_0x58124b){_0x58124b=_0x58124b||0xc8;return function(_0x127ec4){if(_0x127ec4){return _0x25e91b[_0x79fe('0x1e')](_0x58124b)[_0x79fe('0x20')](_0x127ec4);}};}function respondWithFilteredResult(_0x5f0af3,_0x5eadbf){return function(_0x416b5b){if(_0x416b5b){var _0x16f93a=_0x416b5b['count'],_0x39be95=_0x5eadbf[_0x79fe('0x21')],_0x40a549=_0x5eadbf[_0x79fe('0x21')]+_0x5eadbf[_0x79fe('0x22')],_0x536641;if(_0x40a549>=_0x16f93a){_0x40a549=_0x16f93a;_0x536641=0xc8;}else{_0x536641=0xce;}_0x5f0af3['status'](_0x536641);return _0x5f0af3[_0x79fe('0x23')](_0x79fe('0x24'),_0x39be95+'-'+_0x40a549+'/'+_0x16f93a)[_0x79fe('0x20')](_0x416b5b);}return null;};}function patchUpdates(_0x4c7062){return function(_0x203405){try{jsonpatch['apply'](_0x203405,_0x4c7062,!![]);}catch(_0x15f019){return BPromise[_0x79fe('0x25')](_0x15f019);}return _0x203405[_0x79fe('0x26')]();};}function saveUpdates(_0x191bd8,_0x1ac8d7){return function(_0x23bff8){if(_0x23bff8){return _0x23bff8['update'](_0x191bd8)['then'](function(_0x107641){return _0x107641;});}return null;};}function removeEntity(_0x4e9888,_0x16aa35){return function(_0x3721bc){if(_0x3721bc){return _0x3721bc['destroy']()['then'](function(){_0x4e9888[_0x79fe('0x1e')](0xcc)[_0x79fe('0x1f')]();});}};}function handleEntityNotFound(_0x59339b,_0x46d93d){return function(_0x1c1f74){if(!_0x1c1f74){_0x59339b['sendStatus'](0x194);}return _0x1c1f74;};}function handleError(_0x4d60e8,_0x4ea368){_0x4ea368=_0x4ea368||0x1f4;return function(_0x3720fa){logger[_0x79fe('0x27')](_0x3720fa[_0x79fe('0x28')]);if(_0x3720fa['name']){delete _0x3720fa[_0x79fe('0x29')];}_0x4d60e8[_0x79fe('0x1e')](_0x4ea368)[_0x79fe('0x2a')](_0x3720fa);};}exports['index']=function(_0x4e2740,_0x14e055){var _0x51200f={},_0x196215={},_0x5cbb87={'count':0x0,'rows':[]};var _0x4d1a9a=db['SmsInteraction']['rawAttributes'];_0x196215[_0x79fe('0x2b')]=_[_0x79fe('0x2c')](_0x4d1a9a);_0x196215['query']=_[_0x79fe('0x2c')](_0x4e2740['query']);_0x196215[_0x79fe('0x2d')]=_[_0x79fe('0x2e')](_0x196215[_0x79fe('0x2b')],_0x196215[_0x79fe('0x2f')]);_0x51200f[_0x79fe('0x30')]=_['intersection'](_0x196215[_0x79fe('0x2b')],qs[_0x79fe('0x31')](_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x31')]));_0x51200f[_0x79fe('0x30')]=_0x51200f[_0x79fe('0x30')]['length']?_0x51200f[_0x79fe('0x30')]:_0x196215[_0x79fe('0x2b')];if(!_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x32')](_0x79fe('0x33'))){_0x51200f[_0x79fe('0x22')]=qs['limit'](_0x4e2740[_0x79fe('0x2f')]['limit']);_0x51200f[_0x79fe('0x21')]=qs['offset'](_0x4e2740[_0x79fe('0x2f')]['offset']);}_0x51200f[_0x79fe('0x34')]=qs[_0x79fe('0x35')](_0x4e2740[_0x79fe('0x2f')]['sort']);_0x51200f[_0x79fe('0x36')]=qs[_0x79fe('0x2d')](_[_0x79fe('0x37')](_0x4e2740[_0x79fe('0x2f')],_0x196215[_0x79fe('0x2d')]));var _0x5b15bb=[];var _0x53957b=squel[_0x79fe('0x38')]()['field']('id')[_0x79fe('0x39')](_0x79fe('0x29'))['field'](_0x79fe('0x3a'))[_0x79fe('0x3b')](_0x79fe('0x3c'));var _0xc3f7ac=squel[_0x79fe('0x38')]()[_0x79fe('0x39')]('COUNT(*)')[_0x79fe('0x3b')](_0x79fe('0x3d'),'me')[_0x79fe('0x36')](_0x79fe('0x3e'))['where'](_0x79fe('0x3f'))['where'](_0x79fe('0x40'));var _0x5e29b5=squel[_0x79fe('0x38')]()['field'](_0x79fe('0x41'))[_0x79fe('0x39')]('ui.SmsInteractionId')['from'](_0x79fe('0x42'),'ui')[_0x79fe('0x43')](_0x79fe('0x44'),'u',_0x79fe('0x45'));var _0x522241=squel['select']()[_0x79fe('0x3b')](_0x79fe('0x46'),'i')[_0x79fe('0x43')](_0x79fe('0x42'),'ui',_0x79fe('0x47'))[_0x79fe('0x43')](_0x79fe('0x44'),'u',_0x79fe('0x45'))['left_join'](_0x79fe('0x48'),'c',_0x79fe('0x49'))[_0x79fe('0x43')](_0x79fe('0x44'),'o',_0x79fe('0x4a'))[_0x79fe('0x43')]('sms_accounts','a',_0x79fe('0x4b'))[_0x79fe('0x43')](_0x79fe('0x3d'),'me',_0x79fe('0x3e'));var _0xc8d4b2=squel[_0x79fe('0x4c')]();if(_0x4e2740['query'][_0x79fe('0x4d')]){var _0x4cf8fa=JSON[_0x79fe('0x4e')](_0x4e2740['query'][_0x79fe('0x4d')]);_['keys'](_0x4cf8fa)['forEach'](function(_0x28068f){var _0x379272=_0x4cf8fa[_0x28068f];if(_0x28068f===_0x79fe('0x4f')){var _0x53d129=moment(_0x379272[_0x79fe('0x50')][_0x79fe('0x51')])[_0x79fe('0x52')]('day')['utc']()[_0x79fe('0x53')]();var _0x205d67=moment(_0x205d67)[_0x79fe('0x54')]()[_0x79fe('0x55')](_0x79fe('0x56'))[_0x79fe('0x53')]();_0xc8d4b2[_0x79fe('0x57')](_0x79fe('0x58'),_0x53d129,_0x205d67);}else{if(_[_0x79fe('0x59')](_0x379272['condition'])){_0x379272[_0x79fe('0x5a')][_0x79fe('0x5b')](function(_0x496486){switch(_0x379272[_0x79fe('0x5a')]['value']){case'IS':if(_0x28068f!==_0x79fe('0x5c')&&_0x28068f!==_0x79fe('0x5d')){if(_[_0x79fe('0x59')](_0x379272[_0x79fe('0x50')])&&_0x379272['value'][_0x79fe('0x5e')]>0x1){_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20IN\x20?',_0x379272['value']);}else{_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20=\x20?',_0x379272[_0x79fe('0x50')][0x0]);}}break;case'=':_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+_0x79fe('0x60'),_0x379272['value']);break;case _0x79fe('0x61'):if(_0x28068f===_0x79fe('0x62')){_0xc8d4b2[_0x79fe('0x57')]('c.firstName'+'\x20LIKE\x20?','%'+_0x379272['value']+'%');_0xc8d4b2['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x379272[_0x79fe('0x50')]+'%');_0xc8d4b2['or'](_0x79fe('0x63')+'\x20LIKE\x20?','%'+_0x379272[_0x79fe('0x50')]+'%');}else{_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20LIKE\x20?','%'+_0x379272['value']+'%');}break;case'>':_0xc8d4b2['and'](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20>\x20?',_0x379272[_0x79fe('0x50')]);break;case'<':_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+_0x79fe('0x64'),_0x379272[_0x79fe('0x50')]);break;}});}else{switch(_0x379272[_0x79fe('0x5a')][_0x79fe('0x50')]){case'IS':if(_0x28068f!==_0x79fe('0x5c')&&_0x28068f!==_0x79fe('0x5d')){if(_[_0x79fe('0x59')](_0x379272[_0x79fe('0x50')])&&_0x379272['value'][_0x79fe('0x5e')]>0x1){_0xc8d4b2[_0x79fe('0x57')](_0x379272['tableAlias']+'.'+_0x28068f+_0x79fe('0x65'),_0x379272['value']);}else{_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20=\x20?',_0x379272[_0x79fe('0x50')][0x0]);}}break;case'=':_0xc8d4b2['and'](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+'\x20=\x20?',_0x379272['value']);break;case'LIKE':if(_0x28068f===_0x79fe('0x62')){_0xc8d4b2[_0x79fe('0x57')](_0x79fe('0x66')+_0x79fe('0x67'),'%'+_0x379272[_0x79fe('0x50')]+'%');_0xc8d4b2['or'](_0x79fe('0x68')+_0x79fe('0x67'),'%'+_0x379272[_0x79fe('0x50')]+'%');_0xc8d4b2['or'](_0x79fe('0x63')+'\x20LIKE\x20?','%'+_0x379272[_0x79fe('0x50')]+'%');}else{_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+_0x79fe('0x67'),'%'+_0x379272['value']+'%');}break;case'>':_0xc8d4b2[_0x79fe('0x57')](_0x379272['tableAlias']+'.'+_0x28068f+_0x79fe('0x69'),_0x379272['value']);break;case'<':_0xc8d4b2[_0x79fe('0x57')](_0x379272[_0x79fe('0x5f')]+'.'+_0x28068f+_0x79fe('0x64'),_0x379272[_0x79fe('0x50')]);break;}}}});}else{var _0x4e5a50=_(Object[_0x79fe('0x2c')](_0x4e2740[_0x79fe('0x2f')]))[_0x79fe('0x6a')](function(_0x1f240e){return _0x4d1a9a['hasOwnProperty'](_0x1f240e)?_0x1f240e:undefined;})[_0x79fe('0x6b')](function(_0x25dc5c){return!_['isNil'](_0x25dc5c);})[_0x79fe('0x50')]();if(!_['isEmpty'](_0x4e5a50)){_0x4e5a50['forEach'](function(_0x37ccea){if(_0x37ccea===_0x79fe('0x6c')){_0x522241[_0x79fe('0x36')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x4e2740[_0x79fe('0x2f')][_0x37ccea]));}else if(_0x37ccea==='createdAt'){var _0x49bfc9=JSON[_0x79fe('0x4e')](_0x4e2740[_0x79fe('0x2f')][_0x37ccea])[_0x79fe('0x6d')];var _0x1519ab=JSON[_0x79fe('0x4e')](_0x4e2740[_0x79fe('0x2f')][_0x37ccea])[_0x79fe('0x6e')];_0x522241[_0x79fe('0x36')](_0x79fe('0x58'),_0x49bfc9,_0x1519ab);}else{_0x522241['where']('i.'+_0x37ccea+_0x79fe('0x60'),_0x4e2740[_0x79fe('0x2f')][_0x37ccea]);}});}if(_0x4e2740['query'][_0x79fe('0x6b')]){var _0x3cbe68=_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x6b')][_0x79fe('0x6f')]('\x5c','\x5c\x5c')[_0x79fe('0x6f')]('\x27\x27',_0x79fe('0x70'));if(qs[_0x79fe('0x71')](_0x3cbe68)){_0xc8d4b2['or'](_0x79fe('0x72'),_0x3cbe68+'%')['or'](_0x79fe('0x73'),_0x3cbe68+'%');}else{var _0x35ea01=[];_0x3cbe68['split']('\x20')[_0x79fe('0x5b')](function(_0x4502d7){_0x35ea01[_0x79fe('0x74')]('+'+_0x4502d7[_0x79fe('0x75')]());});var _0xbb92d5=_0x35ea01[_0x79fe('0x76')]('\x20');_0xc8d4b2['or'](_0x79fe('0x77'),_0xbb92d5)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3cbe68+'%');}}}_0x522241[_0x79fe('0x36')](_0xc8d4b2);if(_0x51200f[_0x79fe('0x34')]){_0x51200f[_0x79fe('0x34')]['forEach'](function(_0x4e7bdc){_0x522241['order']('i.'+_0x4e7bdc[0x0],_0x4e7bdc[0x1]==='DESC'?![]:!![]);});}_0x522241[_0x79fe('0x78')]('i.id');var _0x31440b={'type':db[_0x79fe('0x79')][_0x79fe('0x7a')][_0x79fe('0x7b')],'raw':!![]};var _0x253353=_0x522241['clone']()[_0x79fe('0x39')]('COUNT(*)');if(!_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x4d')]){if(_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x7c')]){if(_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x7c')]==0x1){_0x253353[_0x79fe('0x36')](util['format'](_0x79fe('0x7d'),_0xc3f7ac['toString']()));_0x522241[_0x79fe('0x7e')](_0x79fe('0x7f'));}else{_0x253353[_0x79fe('0x36')](util['format'](_0x79fe('0x80'),_0xc3f7ac[_0x79fe('0x75')]()));_0x522241[_0x79fe('0x7e')](_0x79fe('0x81'));}}if(_0x4e2740['query'][_0x79fe('0x82')]){var _0x27dbe9=_[_0x79fe('0x59')](_0x4e2740['query'][_0x79fe('0x82')])?_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x82')]:new Array(_0x4e2740[_0x79fe('0x2f')][_0x79fe('0x82')]);var _0x1113ee=squel[_0x79fe('0x4c')]();_0x27dbe9[_0x79fe('0x5b')](function(_0x25edcd){_0x1113ee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25edcd+',%');});_0x522241[_0x79fe('0x7e')](_0x1113ee);_0x253353['left_join'](_0x79fe('0x83'),'it',_0x79fe('0x84'));_0x253353[_0x79fe('0x43')](_0x79fe('0x3c'),'t',_0x79fe('0x85'));_0x253353['where'](_0x79fe('0x86'),_0x27dbe9);}}else{var _0x4cf8fa=JSON[_0x79fe('0x4e')](_0x4e2740[_0x79fe('0x2f')]['advancedFilter']);_[_0x79fe('0x2c')](_0x4cf8fa)[_0x79fe('0x5b')](function(_0x18262c){var _0x256035=_0x4cf8fa[_0x18262c];if(_0x18262c===_0x79fe('0x5c')){var _0x5490ff=_0x256035[_0x79fe('0x50')];var _0x31fd27=squel[_0x79fe('0x4c')]();_0x5490ff[_0x79fe('0x5b')](function(_0x113b8c){_0x31fd27['or'](_0x79fe('0x87'),'%,'+_0x113b8c+',%');});_0x522241[_0x79fe('0x7e')](_0x31fd27);_0x253353[_0x79fe('0x43')](_0x79fe('0x88'),'it',_0x79fe('0x89'));_0x253353['left_join'](_0x79fe('0x3c'),'t','t.id\x20=\x20it.TagId');_0x253353[_0x79fe('0x36')]('t.id\x20IN\x20?',_0x5490ff);}else if(_0x18262c===_0x79fe('0x5d')){if(_0x256035[_0x79fe('0x50')][_0x79fe('0x5e')]===0x1){if(_0x256035[_0x79fe('0x50')][0x0]===0x1){_0x253353[_0x79fe('0x36')](util['format'](_0x79fe('0x7d'),_0xc3f7ac[_0x79fe('0x75')]()));_0x522241[_0x79fe('0x7e')](_0x79fe('0x7f'));}else{_0x253353['where'](util[_0x79fe('0x53')]('%s\x20>\x200',_0xc3f7ac[_0x79fe('0x75')]()));_0x522241[_0x79fe('0x7e')](_0x79fe('0x81'));}}}});}db[_0x79fe('0x8a')][_0x79fe('0x2f')](_0x253353['toString'](),_0x31440b)[_0x79fe('0x8b')](function(_0x5b248d){_0x5cbb87[_0x79fe('0x8c')]=_0x5b248d[_0x79fe('0x5e')];if(_0x5cbb87['count']===0x0)return[];return db[_0x79fe('0x8a')][_0x79fe('0x2f')](_0x53957b[_0x79fe('0x75')](),_0x31440b)[_0x79fe('0x8b')](function(_0x40392a){_0x5b15bb=_[_0x79fe('0x8d')](_0x40392a,'id');_0x31440b=_['merge'](_0x31440b,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x522241[_0x79fe('0x39')](_0xc3f7ac,_0x79fe('0x5d'));_0x522241[_0x79fe('0x39')]('a.key',_0x79fe('0x8e'));_0x522241[_0x79fe('0x39')](_0x79fe('0x8f'));_0x522241[_0x79fe('0x39')](_0x79fe('0x66'),'Contact.firstName');_0x522241[_0x79fe('0x39')](_0x79fe('0x68'),_0x79fe('0x90'));_0x522241['field'](_0x79fe('0x63'),_0x79fe('0x91'));_0x522241[_0x79fe('0x39')](_0x79fe('0x92'),'Contact.phone');_0x522241[_0x79fe('0x39')](_0x79fe('0x93'),'Contact.mobile');_0x522241[_0x79fe('0x39')](_0x79fe('0x94'),_0x79fe('0x95'));_0x522241[_0x79fe('0x39')](_0x79fe('0x96'),'User.name');_0x522241[_0x79fe('0x39')](_0x79fe('0x97'),'TagIds');_0x522241['left_join']('sms_interaction_has_tags','it',_0x79fe('0x84'));_0x522241[_0x79fe('0x43')](_0x79fe('0x3c'),'t',_0x79fe('0x85'));_0x522241[_0x79fe('0x22')](_0x51200f['limit']);_0x522241[_0x79fe('0x21')](_0x51200f[_0x79fe('0x21')]);return db['sequelize'][_0x79fe('0x2f')](_0x522241['toString'](),_0x31440b);})['then'](function(_0x4662f8){_0x5e29b5[_0x79fe('0x36')](_0x79fe('0x98'),_[_0x79fe('0x6a')](_0x4662f8,'id'));return db[_0x79fe('0x8a')][_0x79fe('0x2f')](_0x5e29b5[_0x79fe('0x75')](),_0x31440b)[_0x79fe('0x8b')](function(_0x646fb5){var _0x3eeb90=_[_0x79fe('0x99')](_0x646fb5,'SmsInteractionId');_0x4662f8[_0x79fe('0x5b')](function(_0x245b77){if(_0x3eeb90[_0x245b77['id']]){_0x245b77[_0x79fe('0x9a')]=_[_0x79fe('0x6a')](_0x3eeb90[_0x245b77['id']],function(_0x21c241){return{'id':_0x21c241['id']};});}if(_0x245b77[_0x79fe('0x9b')]){_0x245b77[_0x79fe('0x9c')]=[];_0x245b77[_0x79fe('0x9b')][_0x79fe('0x9d')](',')['forEach'](function(_0x3730b0){_0x245b77[_0x79fe('0x9c')][_0x79fe('0x74')](_0x5b15bb[_0x3730b0]);});}delete _0x245b77[_0x79fe('0x9b')];});return _0x4662f8;});});})['then'](function(_0xfcbd13){_0x5cbb87['rows']=_0xfcbd13;return _0x5cbb87;})[_0x79fe('0x8b')](respondWithFilteredResult(_0x14e055,_0x51200f))['catch'](handleError(_0x14e055,null));};exports[_0x79fe('0x9e')]=function(_0x44b212,_0x1d0b25){var _0x34cab1={'raw':![],'where':{'id':_0x44b212[_0x79fe('0x9f')]['id']}},_0x582b93={};_0x582b93['model']=_['keys'](db[_0x79fe('0xa0')][_0x79fe('0xa1')]);_0x582b93[_0x79fe('0x2f')]=_[_0x79fe('0x2c')](_0x44b212[_0x79fe('0x2f')]);_0x582b93['filters']=_[_0x79fe('0x2e')](_0x582b93['model'],_0x582b93['query']);_0x34cab1[_0x79fe('0x30')]=_['intersection'](_0x582b93[_0x79fe('0x2b')],qs[_0x79fe('0x31')](_0x44b212[_0x79fe('0x2f')][_0x79fe('0x31')]));_0x34cab1[_0x79fe('0x30')]=_0x34cab1[_0x79fe('0x30')][_0x79fe('0x5e')]?_0x34cab1[_0x79fe('0x30')]:_0x582b93['model'];if(_0x44b212[_0x79fe('0x2f')][_0x79fe('0xa2')]){_0x34cab1['include']=[{'all':!![]}];}_0x34cab1=_[_0x79fe('0xa3')]({},_0x34cab1,_0x44b212[_0x79fe('0xa4')]);return db[_0x79fe('0xa0')][_0x79fe('0xa5')](_0x34cab1)['then'](handleEntityNotFound(_0x1d0b25,null))['then'](respondWithResult(_0x1d0b25,null))[_0x79fe('0xa6')](handleError(_0x1d0b25,null));};exports['create']=function(_0x6865fa,_0x29323e){return db[_0x79fe('0xa0')]['create'](_0x6865fa[_0x79fe('0xa7')],{})[_0x79fe('0x8b')](respondWithResult(_0x29323e,0xc9))[_0x79fe('0xa6')](handleError(_0x29323e,null));};exports[_0x79fe('0xa8')]=function(_0x208301,_0x2bc878){if(_0x208301['body']['id']){delete _0x208301['body']['id'];}return db[_0x79fe('0xa0')]['find']({'where':{'id':_0x208301[_0x79fe('0x9f')]['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x2bc878,null))[_0x79fe('0x8b')](saveUpdates(_0x208301[_0x79fe('0xa7')],null))['then'](respondWithResult(_0x2bc878,null))[_0x79fe('0xa6')](handleError(_0x2bc878,null));};exports[_0x79fe('0xa9')]=function(_0x13ca3f,_0x3f541f){return db['SmsInteraction'][_0x79fe('0xa5')]({'where':{'id':_0x13ca3f['params']['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x3f541f,null))['then'](removeEntity(_0x3f541f,null))[_0x79fe('0xa6')](handleError(_0x3f541f,null));};exports[_0x79fe('0xaa')]=function(_0x391b14,_0x1c61c3){return db[_0x79fe('0xa0')][_0x79fe('0xaa')]()['then'](respondWithResult(_0x1c61c3,null))[_0x79fe('0xa6')](handleError(_0x1c61c3,null));};exports['addMessage']=function(_0x34382,_0x359701,_0x15c17b){return db[_0x79fe('0xab')][_0x79fe('0xa5')]({'where':{'id':_0x34382[_0x79fe('0x9f')]['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x359701,null))[_0x79fe('0x8b')](function(_0x4099f6){if(_0x4099f6){return _0x4099f6[_0x79fe('0xac')](_0x34382[_0x79fe('0xa7')][_0x79fe('0xad')],_[_0x79fe('0xae')](_0x34382[_0x79fe('0xa7')],['ids','id'])||{});}})['then'](respondWithResult(_0x359701,null))[_0x79fe('0xa6')](handleError(_0x359701,null));};exports[_0x79fe('0xaf')]=function(_0x4b82bc,_0x3d8cdb,_0x339f2c){var _0x320e81={'raw':![],'where':{}};var _0x116bfb={};var _0x323837={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x79fe('0xb0')]({'where':{'id':_0x4b82bc[_0x79fe('0x9f')]['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x3d8cdb,null))['then'](function(_0x436cbb){if(_0x436cbb){_0x116bfb[_0x79fe('0x2b')]=_[_0x79fe('0x2c')](db[_0x79fe('0xab')][_0x79fe('0xa1')]);_0x116bfb[_0x79fe('0x2f')]=_[_0x79fe('0x2c')](_0x4b82bc[_0x79fe('0x2f')]);_0x116bfb[_0x79fe('0x2d')]=_['intersection'](_0x116bfb[_0x79fe('0x2b')],_0x116bfb['query']);_0x320e81['attributes']=_['intersection'](_0x116bfb['model'],qs[_0x79fe('0x31')](_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0x31')]));_0x320e81[_0x79fe('0x30')]=_0x320e81[_0x79fe('0x30')][_0x79fe('0x5e')]?_0x320e81['attributes']:_0x116bfb['model'];if(!_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0x32')](_0x79fe('0x33'))){_0x320e81[_0x79fe('0x22')]=qs['limit'](_0x4b82bc[_0x79fe('0x2f')]['limit']);_0x320e81[_0x79fe('0x21')]=qs[_0x79fe('0x21')](_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0x21')]);}_0x320e81['order']=qs[_0x79fe('0x35')](_0x4b82bc[_0x79fe('0x2f')]['sort']);_0x320e81[_0x79fe('0x36')]=qs[_0x79fe('0x2d')](_['pick'](_0x4b82bc[_0x79fe('0x2f')],_0x116bfb[_0x79fe('0x2d')]));_0x320e81[_0x79fe('0x36')][_0x79fe('0xb1')]=_0x436cbb['id'];if(_0x4b82bc[_0x79fe('0x2f')]['filter']){_0x320e81[_0x79fe('0x36')]=_[_0x79fe('0xa3')](_0x320e81[_0x79fe('0x36')],{'$or':_[_0x79fe('0x6a')](_0x320e81['attributes'],function(_0xe417fa){var _0x215a5f={};_0x215a5f[_0xe417fa]={'$like':'%'+_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0x6b')]+'%'};return _0x215a5f;})});}if(_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0x6d')]){var _0x259590=_0x4b82bc[_0x79fe('0x2f')]['$gte'][_0x79fe('0x9d')](',');var _0x578b8e={};_0x578b8e[_0x259590[0x0]]={'$gte':moment(_0x259590[0x1])[_0x79fe('0x53')](_0x79fe('0xb2'))};_0x320e81[_0x79fe('0x36')]=_[_0x79fe('0xa3')](_0x320e81['where'],_0x578b8e);}_0x320e81=_[_0x79fe('0xa3')]({},_0x320e81,_0x4b82bc[_0x79fe('0xa4')]);return db[_0x79fe('0xab')][_0x79fe('0x8c')]({'where':_0x320e81[_0x79fe('0x36')]})[_0x79fe('0x8b')](function(_0x3ce2b4){_0x323837[_0x79fe('0x8c')]=_0x3ce2b4;if(_0x4b82bc[_0x79fe('0x2f')][_0x79fe('0xa2')]){_0x320e81['include']=[{'all':!![]}];}return db[_0x79fe('0xab')][_0x79fe('0xb3')](_0x320e81);})[_0x79fe('0x8b')](function(_0x47b5bd){_0x323837[_0x79fe('0xb4')]=_0x47b5bd;return _0x323837;});}})[_0x79fe('0x8b')](respondWithFilteredResult(_0x3d8cdb,_0x320e81))[_0x79fe('0xa6')](handleError(_0x3d8cdb,null));};exports[_0x79fe('0xb5')]=function(_0x400e20,_0x45f4e1,_0x277324){return db[_0x79fe('0xa0')][_0x79fe('0xa5')]({'where':{'id':_0x400e20[_0x79fe('0x9f')]['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x45f4e1,null))[_0x79fe('0x8b')](function(_0x398efc){if(_0x398efc){return _0x398efc['setTags'](_0x400e20['body'][_0x79fe('0xad')],_[_0x79fe('0xae')](_0x400e20['body'],[_0x79fe('0xad'),'id'])||{})[_0x79fe('0xb6')](function(){return db['Tag'][_0x79fe('0xb3')]({'attributes':['id','name',_0x79fe('0x3a')],'where':{'id':_0x400e20[_0x79fe('0xa7')][_0x79fe('0xad')]}});})[_0x79fe('0x8b')](function(_0x65c244){socket[_0x79fe('0xb7')]('smsInteractionTags:save',{'id':Number(_0x400e20['params']['id']),'tags':_0x65c244||[]});return{'id':Number(_0x400e20['params']['id']),'tags':_0x65c244||[]};});}})[_0x79fe('0x8b')](respondWithResult(_0x45f4e1,null))[_0x79fe('0xa6')](handleError(_0x45f4e1,null));};exports[_0x79fe('0xb8')]=function(_0x3fecea,_0x134fe5,_0x56c728){return db[_0x79fe('0xa0')][_0x79fe('0xa5')]({'where':{'id':_0x3fecea['params']['id']}})[_0x79fe('0x8b')](handleEntityNotFound(_0x134fe5,null))[_0x79fe('0x8b')](function(_0x5dc71c){if(_0x5dc71c){return _0x5dc71c[_0x79fe('0xb8')](_0x3fecea['query'][_0x79fe('0xad')]);}})[_0x79fe('0x8b')](respondWithStatusCode(_0x134fe5,null))[_0x79fe('0xa6')](handleError(_0x134fe5,null));};exports[_0x79fe('0xb9')]=function(_0x5dcd68,_0x15976c){var _0x53b425=moment()[_0x79fe('0xba')]()[_0x79fe('0x75')]();var _0x57f77c=path[_0x79fe('0x76')](config[_0x79fe('0xbb')],_0x79fe('0xbc'),_0x79fe('0xbd'),_0x79fe('0xbe'));var _0x5839aa=path['join'](config[_0x79fe('0xbb')],_0x79fe('0xbc'),_0x79fe('0xbd'),_0x79fe('0xbf'));var _0x3c97d9=path[_0x79fe('0x76')](_0x57f77c,_0x53b425);var _0x50f907=util[_0x79fe('0x53')]('transcript-%d-%s.zip',_0x5dcd68[_0x79fe('0x9f')]['id'],_0x53b425);var _0x5c4f52=path['join'](_0x57f77c,_0x50f907);var _0x1397a5=![];return db[_0x79fe('0xa0')][_0x79fe('0xa5')]({'where':{'id':_0x5dcd68[_0x79fe('0x9f')]['id']},'include':[{'model':db[_0x79fe('0xab')],'as':_0x79fe('0xc0'),'attributes':['id',_0x79fe('0xa7'),_0x79fe('0x4f'),_0x79fe('0xc1'),_0x79fe('0xc2')],'include':[{'model':db[_0x79fe('0xc3')],'as':_0x79fe('0xc3'),'attributes':['id',_0x79fe('0xc4')],'raw':!![]},{'model':db['CmContact'],'as':_0x79fe('0xc5'),'attributes':['id',_0x79fe('0xc6'),'lastName'],'raw':!![]}]},{'model':db[_0x79fe('0xc7')],'as':_0x79fe('0xc8'),'attributes':['id',_0x79fe('0x29')]},{'model':db[_0x79fe('0xc3')],'as':'Owner','attributes':['id',_0x79fe('0xc4')]}]})[_0x79fe('0x8b')](handleEntityNotFound(_0x15976c,null))[_0x79fe('0x8b')](function(_0x150a8a){if(_0x150a8a){var _0x15d0b7=_0x150a8a[_0x79fe('0xc9')]({'plain':!![]});_0x1397a5=!![];var _0x37a652={'format':'A4','border':'10px','header':{'height':_0x79fe('0xca'),'contents':{'first':_0x79fe('0xcb')}},'footer':{'height':_0x79fe('0xcc'),'contents':{'default':util[_0x79fe('0x53')](_0x79fe('0xcd'),util[_0x79fe('0x53')](_0x79fe('0xce'),_0x79fe('0xcf'),_0x15d0b7['id']),moment()[_0x79fe('0x53')](_0x79fe('0xd0'))[_0x79fe('0x75')]())}}};fs[_0x79fe('0xd1')](_0x3c97d9);var _0x1bd316={'channel':_0x79fe('0xcf'),'account':_0x15d0b7[_0x79fe('0xc8')][_0x79fe('0x29')],'agent':_0x15d0b7[_0x79fe('0xd2')]?_0x15d0b7[_0x79fe('0xd2')][_0x79fe('0xc4')]:_0x79fe('0xd3'),'createdAt':moment(_0x15d0b7[_0x79fe('0x4f')])[_0x79fe('0x53')](_0x79fe('0xb2'))[_0x79fe('0x75')](),'closedAt':_0x15d0b7[_0x79fe('0xd4')]?moment(_0x15d0b7[_0x79fe('0xd5')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x79fe('0x75')]():'','disposition':_0x15d0b7[_0x79fe('0xd6')],'messages':_(_0x15d0b7['Messages'])[_0x79fe('0x6b')]({'secret':![]})[_0x79fe('0x6a')](function(_0x449891){return{'date':moment(_0x449891[_0x79fe('0x4f')])[_0x79fe('0x53')](_0x79fe('0xb2'))[_0x79fe('0x75')](),'sender':_0x449891[_0x79fe('0xc1')]===_0x79fe('0xd7')?_0x449891[_0x79fe('0xc3')]?_0x449891[_0x79fe('0xc3')][_0x79fe('0xc4')]:_0x79fe('0xd8'):_0x449891[_0x79fe('0xc5')][_0x79fe('0xc6')]+(_0x449891[_0x79fe('0xc5')][_0x79fe('0xd9')]?'\x20'+_0x449891['Contact'][_0x79fe('0xd9')]:''),'body':_0x449891[_0x79fe('0xa7')],'direction':_0x449891[_0x79fe('0xc1')]===_0x79fe('0xd7')?'A':'C','secret':_0x449891[_0x79fe('0xc2')]};})['value']()};return ejs[_0x79fe('0xda')](path['join'](config[_0x79fe('0xbb')],'server',_0x79fe('0xdb'),'downloadInteraction.html'),{'interaction':_0x1bd316})[_0x79fe('0x8b')](function(_0x59649b){return new BPromise(function(_0x72f9c,_0x9e0592){pdf['create'](_0x59649b,_0x37a652)[_0x79fe('0xdc')](path['join'](_0x3c97d9,'transcript-'+_0x15d0b7['id']+'-'+_0x53b425+_0x79fe('0xdd')),function(_0x1338a6,_0x182fdf){if(_0x1338a6)return _0x9e0592(_0x1338a6);_0x72f9c(_0x182fdf);});});});}})[_0x79fe('0x8b')](function(){if(_0x1397a5){return new BPromise(function(_0x181e39,_0x3d0fd6){zipdir(_0x3c97d9,{'saveTo':_0x5c4f52},function(_0x49d9b2,_0x44bb5a){if(_0x49d9b2)return _0x3d0fd6(_0x49d9b2);return _0x181e39(_0x44bb5a);});})[_0x79fe('0x8b')](function(){return new BPromise(function(_0x490275,_0x5cbaab){rimraf(_0x3c97d9,function(_0x5cb7e9){if(_0x5cb7e9)_0x5cbaab(_0x5cb7e9);return _0x490275();});});})[_0x79fe('0x8b')](function(){return _0x15976c[_0x79fe('0xb9')](_0x5c4f52,_0x50f907,function(_0x313684){if(_0x313684){console[_0x79fe('0xde')](_0x79fe('0xdf'),_0x313684);}else{fs['unlinkSync'](_0x5c4f52);}});});}else{return _0x15976c[_0x79fe('0x1d')](0xc8);}})[_0x79fe('0xa6')](handleError(_0x15976c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 79822f1..8e01f4e 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 _0xc694=['SmsInteraction','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xc694,0x11e));var _0x4c69=function(_0x4b6804,_0x301b24){_0x4b6804=_0x4b6804-0x0;var _0x11b4f1=_0xc694[_0x4b6804];return _0x11b4f1;};'use strict';var EventEmitter=require(_0x4c69('0x0'));var SmsInteraction=require(_0x4c69('0x1'))['db'][_0x4c69('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c69('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f26a1){return function(_0x32ea21,_0x479bf8,_0x18ab56){SmsInteractionEvents[_0x4c69('0x4')](_0x1f26a1+':'+_0x32ea21['id'],_0x32ea21);SmsInteractionEvents[_0x4c69('0x4')](_0x1f26a1,_0x32ea21);_0x18ab56(null);};}for(var e in events){if(events[_0x4c69('0x5')](e)){var event=events[e];SmsInteraction[_0x4c69('0x6')](e,emitEvent(event));}}module[_0x4c69('0x7')]=SmsInteractionEvents; \ No newline at end of file +var _0xfc44=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x543475,_0x548fde){var _0x34f9e1=function(_0x5e813c){while(--_0x5e813c){_0x543475['push'](_0x543475['shift']());}};_0x34f9e1(++_0x548fde);}(_0xfc44,0xbe));var _0x4fc4=function(_0x7f1d19,_0x2326e0){_0x7f1d19=_0x7f1d19-0x0;var _0x397ba3=_0xfc44[_0x7f1d19];return _0x397ba3;};'use strict';var EventEmitter=require(_0x4fc4('0x0'));var SmsInteraction=require(_0x4fc4('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4fc4('0x2')](0x0);var events={'afterCreate':_0x4fc4('0x3'),'afterUpdate':'update','afterDestroy':_0x4fc4('0x4')};function emitEvent(_0xfec422){return function(_0x3565f8,_0x29dcb3,_0x1242ec){SmsInteractionEvents[_0x4fc4('0x5')](_0xfec422+':'+_0x3565f8['id'],_0x3565f8);SmsInteractionEvents[_0x4fc4('0x5')](_0xfec422,_0x3565f8);_0x1242ec(null);};}for(var e in events){if(events[_0x4fc4('0x6')](e)){var event=events[e];SmsInteraction[_0x4fc4('0x7')](e,emitEvent(event));}}module[_0x4fc4('0x8')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ff8b9a4..9950a7e 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 _0x00dc=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed'];(function(_0x4d35c7,_0xb930e0){var _0x595121=function(_0x501d32){while(--_0x501d32){_0x4d35c7['push'](_0x4d35c7['shift']());}};_0x595121(++_0xb930e0);}(_0x00dc,0xe5));var _0xc00d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00dc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc00d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc00d('0x1'));var moment=require(_0xc00d('0x2'));var BPromise=require('bluebird');var rp=require(_0xc00d('0x3'));var fs=require('fs');var path=require(_0xc00d('0x4'));var rimraf=require(_0xc00d('0x5'));var config=require(_0xc00d('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0xc5801,_0x4cbfb0){return _0xc5801[_0xc00d('0x7')](_0xc00d('0x8'),attributes,{'tableName':_0xc00d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x376721,_0x57dad5,_0x159fed){if(_0x376721[_0xc00d('0xa')](_0xc00d('0xb'))){_0x376721[_0xc00d('0xc')]=moment()[_0xc00d('0xd')](_0xc00d('0xe'));}_0x159fed(null,_0x376721);}}});}; \ No newline at end of file +var _0x015d=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x52d28a,_0xcea297){var _0x3ad972=function(_0x3bbcfe){while(--_0x3bbcfe){_0x52d28a['push'](_0x52d28a['shift']());}};_0x3ad972(++_0xcea297);}(_0x015d,0xd1));var _0xd015=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x015d[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xd015('0x0'));var util=require(_0xd015('0x1'));var logger=require(_0xd015('0x2'))('api');var moment=require(_0xd015('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd015('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xd015('0x5')]=function(_0x2d262c,_0x45a48e){return _0x2d262c[_0xd015('0x6')](_0xd015('0x7'),attributes,{'tableName':_0xd015('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ff8a4,_0x5ddbf8,_0x19b5b0){if(_0x3ff8a4[_0xd015('0x9')](_0xd015('0xa'))){_0x3ff8a4[_0xd015('0xb')]=moment()['format'](_0xd015('0xc'));}_0x19b5b0(null,_0x3ff8a4);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 01f9f5d..336f4cd 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 _0x8d08=['catch','update','options','where','attributes','then','UpdateSmsInteraction','SmsInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x310d33,_0x521412){var _0xb322f0=function(_0x3d385e){while(--_0x3d385e){_0x310d33['push'](_0x310d33['shift']());}};_0xb322f0(++_0x521412);}(_0x8d08,0xaf));var _0x88d0=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x8d08[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var moment=require(_0x88d0('0x2'));var BPromise=require(_0x88d0('0x3'));var rs=require(_0x88d0('0x4'));var fs=require('fs');var Redis=require(_0x88d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88d0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88d0('0x7')][_0x88d0('0x8')]({'port':0x232a});config['redis']=_[_0x88d0('0x9')](config[_0x88d0('0xa')],{'host':_0x88d0('0xb'),'port':0x18eb});var socket=require(_0x88d0('0xc'))(new Redis(config[_0x88d0('0xa')]));require('./smsInteraction.socket')[_0x88d0('0xd')](socket);function respondWithRpcPromise(_0x317f1e,_0x213b99,_0x4d0070){return new BPromise(function(_0x454891,_0x26d619){return client[_0x88d0('0xe')](_0x317f1e,_0x4d0070)['then'](function(_0x51b7d5){logger['info'](_0x88d0('0xf'),_0x213b99,_0x88d0('0x10'));logger[_0x88d0('0x11')](_0x88d0('0x12'),_0x213b99,'request\x20sent',JSON[_0x88d0('0x13')](_0x51b7d5));if(_0x51b7d5[_0x88d0('0x14')]){if(_0x51b7d5['error'][_0x88d0('0x15')]===0x1f4){logger[_0x88d0('0x14')](_0x88d0('0xf'),_0x213b99,_0x51b7d5['error']['message']);return _0x26d619(_0x51b7d5[_0x88d0('0x14')][_0x88d0('0x16')]);}logger[_0x88d0('0x14')](_0x88d0('0xf'),_0x213b99,_0x51b7d5[_0x88d0('0x14')]['message']);return _0x454891(_0x51b7d5['error'][_0x88d0('0x16')]);}else{logger[_0x88d0('0x17')](_0x88d0('0xf'),_0x213b99,_0x88d0('0x10'));_0x454891(_0x51b7d5[_0x88d0('0x18')][_0x88d0('0x16')]);}})[_0x88d0('0x19')](function(_0x2951ee){logger[_0x88d0('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x213b99,_0x2951ee);_0x26d619(_0x2951ee);});});}exports['UpdateSmsInteraction']=function(_0x8ce4c1){var _0x113a6c=this;return new Promise(function(_0x34881e,_0xc5202a){return db['SmsInteraction'][_0x88d0('0x1a')](_0x8ce4c1['body'],{'raw':_0x8ce4c1[_0x88d0('0x1b')]?_0x8ce4c1[_0x88d0('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ce4c1[_0x88d0('0x1b')]?_0x8ce4c1[_0x88d0('0x1b')][_0x88d0('0x1c')]||null:null,'attributes':_0x8ce4c1['options']?_0x8ce4c1[_0x88d0('0x1b')][_0x88d0('0x1d')]||null:null,'limit':_0x8ce4c1[_0x88d0('0x1b')]?_0x8ce4c1[_0x88d0('0x1b')]['limit']||null:null})[_0x88d0('0x1e')](function(_0xfac6ae){logger[_0x88d0('0x17')](_0x88d0('0x1f'),_0x8ce4c1);logger[_0x88d0('0x11')](_0x88d0('0x1f'),_0x8ce4c1,JSON[_0x88d0('0x13')](_0xfac6ae));_0x34881e(_0xfac6ae);})[_0x88d0('0x19')](function(_0x53d283){logger[_0x88d0('0x14')](_0x88d0('0x1f'),_0x53d283[_0x88d0('0x16')],_0x8ce4c1);_0xc5202a(_0x113a6c[_0x88d0('0x14')](0x1f4,_0x53d283[_0x88d0('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x2b93a7){return new Promise(function(_0xde6f5a,_0x2648f6){return db[_0x88d0('0x20')][_0x88d0('0x21')]({'where':_0x2b93a7[_0x88d0('0x1b')]?_0x2b93a7[_0x88d0('0x1b')][_0x88d0('0x1c')]||null:null})[_0x88d0('0x1e')](function(_0x52fd00){if(_0x52fd00){return _0x52fd00[_0x88d0('0x22')](_0x2b93a7['body'][_0x88d0('0x23')],_[_0x88d0('0x24')](_0x2b93a7[_0x88d0('0x25')],[_0x88d0('0x23'),'id'])||{});}})[_0x88d0('0x26')](function(_0x7a1496){logger['info'](_0x88d0('0x27'),_0x2b93a7);logger[_0x88d0('0x11')]('AddTags',_0x2b93a7,JSON[_0x88d0('0x13')](_0x7a1496));_0xde6f5a(_0x7a1496);})[_0x88d0('0x19')](function(_0x361233){logger[_0x88d0('0x14')]('AddTags',_0x361233[_0x88d0('0x16')],_0x2b93a7);_0x2648f6(_this[_0x88d0('0x14')](0x1f4,_0x361233[_0x88d0('0x16')]));});});}; \ No newline at end of file +var _0x9725=['message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','find','omit','ids','spread','AddTags','stringify','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1ba19c,_0x3975e2){var _0x4e069b=function(_0xd95964){while(--_0xd95964){_0x1ba19c['push'](_0x1ba19c['shift']());}};_0x4e069b(++_0x3975e2);}(_0x9725,0x109));var _0x5972=function(_0x367c51,_0x4981d){_0x367c51=_0x367c51-0x0;var _0xbae154=_0x9725[_0x367c51];return _0xbae154;};'use strict';var _=require(_0x5972('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5972('0x1'));var rs=require(_0x5972('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5972('0x3'));var logger=require(_0x5972('0x4'))(_0x5972('0x5'));var config=require(_0x5972('0x6'));var jayson=require(_0x5972('0x7'));var client=jayson[_0x5972('0x8')][_0x5972('0x9')]({'port':0x232a});config[_0x5972('0xa')]=_[_0x5972('0xb')](config[_0x5972('0xa')],{'host':_0x5972('0xc'),'port':0x18eb});var socket=require(_0x5972('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x15c301,_0x55d1f8,_0x4c3278){return new BPromise(function(_0xc96345,_0x54230b){return client[_0x5972('0xe')](_0x15c301,_0x4c3278)['then'](function(_0x594423){logger[_0x5972('0xf')](_0x5972('0x10'),_0x55d1f8,_0x5972('0x11'));logger[_0x5972('0x12')](_0x5972('0x13'),_0x55d1f8,_0x5972('0x11'),JSON['stringify'](_0x594423));if(_0x594423['error']){if(_0x594423[_0x5972('0x14')][_0x5972('0x15')]===0x1f4){logger[_0x5972('0x14')](_0x5972('0x10'),_0x55d1f8,_0x594423[_0x5972('0x14')][_0x5972('0x16')]);return _0x54230b(_0x594423['error'][_0x5972('0x16')]);}logger[_0x5972('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x55d1f8,_0x594423[_0x5972('0x14')][_0x5972('0x16')]);return _0xc96345(_0x594423[_0x5972('0x14')][_0x5972('0x16')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x55d1f8,_0x5972('0x11'));_0xc96345(_0x594423[_0x5972('0x17')][_0x5972('0x16')]);}})[_0x5972('0x18')](function(_0x37eeed){logger[_0x5972('0x14')](_0x5972('0x10'),_0x55d1f8,_0x37eeed);_0x54230b(_0x37eeed);});});}exports[_0x5972('0x19')]=function(_0xc2ee46){var _0x591b33=this;return new Promise(function(_0x26d3aa,_0x14480c){return db[_0x5972('0x1a')][_0x5972('0x1b')](_0xc2ee46[_0x5972('0x1c')],{'raw':_0xc2ee46[_0x5972('0x1d')]?_0xc2ee46[_0x5972('0x1d')][_0x5972('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc2ee46['options']?_0xc2ee46[_0x5972('0x1d')][_0x5972('0x1f')]||null:null,'attributes':_0xc2ee46[_0x5972('0x1d')]?_0xc2ee46[_0x5972('0x1d')][_0x5972('0x20')]||null:null,'limit':_0xc2ee46['options']?_0xc2ee46[_0x5972('0x1d')][_0x5972('0x21')]||null:null})[_0x5972('0x22')](function(_0x2d2d67){logger[_0x5972('0xf')](_0x5972('0x19'),_0xc2ee46);logger[_0x5972('0x12')](_0x5972('0x19'),_0xc2ee46,JSON['stringify'](_0x2d2d67));_0x26d3aa(_0x2d2d67);})[_0x5972('0x18')](function(_0x2e3cdb){logger[_0x5972('0x14')](_0x5972('0x19'),_0x2e3cdb[_0x5972('0x16')],_0xc2ee46);_0x14480c(_0x591b33[_0x5972('0x14')](0x1f4,_0x2e3cdb['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x51f80c){return new Promise(function(_0x7f752f,_0xaaf6dc){return db['SmsInteraction'][_0x5972('0x23')]({'where':_0x51f80c['options']?_0x51f80c[_0x5972('0x1d')][_0x5972('0x1f')]||null:null})['then'](function(_0x50c2b3){if(_0x50c2b3){return _0x50c2b3['addTags'](_0x51f80c[_0x5972('0x1c')]['ids'],_[_0x5972('0x24')](_0x51f80c[_0x5972('0x1c')],[_0x5972('0x25'),'id'])||{});}})[_0x5972('0x26')](function(_0x661bc2){logger[_0x5972('0xf')](_0x5972('0x27'),_0x51f80c);logger[_0x5972('0x12')](_0x5972('0x27'),_0x51f80c,JSON[_0x5972('0x28')](_0x661bc2));_0x7f752f(_0x661bc2);})[_0x5972('0x18')](function(_0x5323ec){logger[_0x5972('0x14')](_0x5972('0x27'),_0x5323ec[_0x5972('0x16')],_0x51f80c);_0xaaf6dc(_this[_0x5972('0x14')](0x1f4,_0x5323ec[_0x5972('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e798b6c..b35a8ae 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 _0xc70c=['register','./smsInteraction.events','save','remove','update'];(function(_0x52fc45,_0x1673be){var _0xbbad2f=function(_0x37d023){while(--_0x37d023){_0x52fc45['push'](_0x52fc45['shift']());}};_0xbbad2f(++_0x1673be);}(_0xc70c,0xa6));var _0xcc70=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc70c[_0x40a045];return _0x1a687c;};'use strict';var SmsInteractionEvents=require(_0xcc70('0x0'));var events=[_0xcc70('0x1'),_0xcc70('0x2'),_0xcc70('0x3')];function createListener(_0x3fef1e,_0x570ea0){return function(_0x29aa3d){_0x570ea0['emit'](_0x3fef1e,_0x29aa3d);};}function removeListener(_0x77ff1d,_0x25b13c){return function(){SmsInteractionEvents['removeListener'](_0x77ff1d,_0x25b13c);};}exports[_0xcc70('0x4')]=function(_0xaee0ab){for(var _0x20bae1=0x0,_0x4118e6=events['length'];_0x20bae1<_0x4118e6;_0x20bae1++){var _0x1bf3ba=events[_0x20bae1];var _0x42409f=createListener('smsInteraction:'+_0x1bf3ba,_0xaee0ab);SmsInteractionEvents['on'](_0x1bf3ba,_0x42409f);}}; \ No newline at end of file +var _0xe5ff=['save','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5ff,0xf7));var _0xfe5f=function(_0x21ab76,_0x1e8f2){_0x21ab76=_0x21ab76-0x0;var _0x12322a=_0xe5ff[_0x21ab76];return _0x12322a;};'use strict';var SmsInteractionEvents=require(_0xfe5f('0x0'));var events=[_0xfe5f('0x1'),'remove',_0xfe5f('0x2')];function createListener(_0x2710b5,_0x75362a){return function(_0x40c425){_0x75362a[_0xfe5f('0x3')](_0x2710b5,_0x40c425);};}function removeListener(_0x103a08,_0x1213bf){return function(){SmsInteractionEvents[_0xfe5f('0x4')](_0x103a08,_0x1213bf);};}exports[_0xfe5f('0x5')]=function(_0x4169d9){for(var _0x2b01c4=0x0,_0x195769=events[_0xfe5f('0x6')];_0x2b01c4<_0x195769;_0x2b01c4++){var _0x419b47=events[_0x2b01c4];var _0x2f5e71=createListener(_0xfe5f('0x7')+_0x419b47,_0x4169d9);SmsInteractionEvents['on'](_0x419b47,_0x2f5e71);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8461673..8fce054 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 _0x9245=['../../components/auth/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','/:id','show','tracked','smsmessage:create','post','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9245,0x164));var _0x5924=function(_0x813327,_0x2e6cc5){_0x813327=_0x813327-0x0;var _0x38f4dc=_0x9245[_0x813327];return _0x38f4dc;};'use strict';var multer=require(_0x5924('0x0'));var util=require(_0x5924('0x1'));var path=require(_0x5924('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5924('0x3')]();var auth=require(_0x5924('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5924('0x5'));var controller=require(_0x5924('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5924('0x7')](_0x5924('0x8'),auth[_0x5924('0x9')](),controller['describe']);router['get'](_0x5924('0xa'),auth[_0x5924('0x9')](),controller[_0x5924('0xb')]);router['post']('/',auth[_0x5924('0x9')](),interaction[_0x5924('0xc')]('sms',_0x5924('0xd')),controller['create']);router[_0x5924('0xe')](_0x5924('0xf'),controller[_0x5924('0x10')]);router[_0x5924('0x11')](_0x5924('0xa'),auth[_0x5924('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x5924('0x9')](),controller[_0x5924('0x12')]);router[_0x5924('0x11')](_0x5924('0x13'),auth[_0x5924('0x9')](),controller[_0x5924('0x14')]);router[_0x5924('0x15')](_0x5924('0xa'),auth[_0x5924('0x9')](),controller[_0x5924('0x16')]);module[_0x5924('0x17')]=router; \ No newline at end of file +var _0xbb4b=['../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','/:id','update','put','accept','/:id/reject','delete','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x37406a,_0xfb2661){var _0x3431cb=function(_0x3955ca){while(--_0x3955ca){_0x37406a['push'](_0x37406a['shift']());}};_0x3431cb(++_0xfb2661);}(_0xbb4b,0x13e));var _0xbbb4=function(_0x3d0d49,_0x4fe283){_0x3d0d49=_0x3d0d49-0x0;var _0x152df9=_0xbb4b[_0x3d0d49];return _0x152df9;};'use strict';var multer=require(_0xbbb4('0x0'));var util=require(_0xbbb4('0x1'));var path=require(_0xbbb4('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbb4('0x3'));var router=express[_0xbbb4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbbb4('0x5'));var config=require(_0xbbb4('0x6'));var controller=require(_0xbbb4('0x7'));router['get']('/',auth[_0xbbb4('0x8')](),controller[_0xbbb4('0x9')]);router[_0xbbb4('0xa')](_0xbbb4('0xb'),auth[_0xbbb4('0x8')](),controller[_0xbbb4('0xc')]);router[_0xbbb4('0xa')]('/:id',auth[_0xbbb4('0x8')](),controller[_0xbbb4('0xd')]);router[_0xbbb4('0xe')]('/',auth[_0xbbb4('0x8')](),interaction[_0xbbb4('0xf')](_0xbbb4('0x10'),_0xbbb4('0x11')),controller[_0xbbb4('0x12')]);router[_0xbbb4('0xe')](_0xbbb4('0x13'),controller['status']);router['put'](_0xbbb4('0x14'),auth[_0xbbb4('0x8')](),controller[_0xbbb4('0x15')]);router[_0xbbb4('0x16')]('/:id/accept',auth[_0xbbb4('0x8')](),controller[_0xbbb4('0x17')]);router['put'](_0xbbb4('0x18'),auth[_0xbbb4('0x8')](),controller['reject']);router[_0xbbb4('0x19')](_0xbbb4('0x14'),auth[_0xbbb4('0x8')](),controller['destroy']);module[_0xbbb4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 38766c9..3dda77a 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 _0x126e=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x41f51f,_0x3af801){var _0x27a041=function(_0x30f99c){while(--_0x30f99c){_0x41f51f['push'](_0x41f51f['shift']());}};_0x27a041(++_0x3af801);}(_0x126e,0x108));var _0xe126=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x126e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'body':{'type':Sequelize[_0xe126('0x1')](_0xe126('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe126('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe126('0x4')]('in',_0xe126('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe126('0x6')](0xbe)},'phone':{'type':Sequelize[_0xe126('0x6')]},'readAt':{'type':Sequelize[_0xe126('0x7')]},'secret':{'type':Sequelize[_0xe126('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbe2a=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x4ce91b,_0x6dd68a){var _0x285f97=function(_0x25b5d2){while(--_0x25b5d2){_0x4ce91b['push'](_0x4ce91b['shift']());}};_0x285f97(++_0x6dd68a);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x3ebb8a,_0x21ada1){_0x3ebb8a=_0x3ebb8a-0x0;var _0x3e487c=_0xbe2a[_0x3ebb8a];return _0x3e487c;};'use strict';var Sequelize=require(_0xabe2('0x0'));module[_0xabe2('0x1')]={'body':{'type':Sequelize[_0xabe2('0x2')](_0xabe2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xabe2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xabe2('0x5')]('in',_0xabe2('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xabe2('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xabe2('0x8')]},'secret':{'type':Sequelize[_0xabe2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 30f4abd..8c9261d 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 _0x5d58=['to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','count','offset','set','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','../../config/logger','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','SmsInteractionId','interaction','get','role','stringify','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','sms-interactions','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','Status','infobip','results','groupName','DELIVERED','request-promise','moment','mustache','util','sox'];(function(_0x57d1ba,_0x16af95){var _0x5b5f30=function(_0x10dfe1){while(--_0x10dfe1){_0x57d1ba['push'](_0x57d1ba['shift']());}};_0x5b5f30(++_0x16af95);}(_0x5d58,0x187));var _0x85d5=function(_0x4ff972,_0x152cf0){_0x4ff972=_0x4ff972-0x0;var _0x1becc1=_0x5d58[_0x4ff972];return _0x1becc1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x85d5('0x0'));var moment=require(_0x85d5('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x85d5('0x2'));var util=require(_0x85d5('0x3'));var path=require('path');var sox=require(_0x85d5('0x4'));var csv=require(_0x85d5('0x5'));var ejs=require(_0x85d5('0x6'));var fs=require('fs');var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x5'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85d5('0xd'));var utils=require(_0x85d5('0xe'));var config=require(_0x85d5('0xf'));var db=require(_0x85d5('0x10'))['db'];config[_0x85d5('0x11')]=_[_0x85d5('0x12')](config[_0x85d5('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x85d5('0x13'))[_0x85d5('0x14')](socket);var jayson=require(_0x85d5('0x15'));var client=jayson[_0x85d5('0x16')][_0x85d5('0x17')]({'port':0x232c});var client9002=jayson[_0x85d5('0x16')][_0x85d5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x586382,_0x18e977,_0x2d7c95){if(_0x2d7c95){var _0x1621ed=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1621ed[_0x85d5('0x18')](_0x18e977)){return _0x586382;}else{throw new Error(_0x85d5('0x19'));}}else{return _0x586382;}}function respondWithRpcPromise(_0x3dc83c,_0x2dbf13,_0x12bef9,_0x17652b){return new BPromise(function(_0x17acb0,_0x3eab37){var _0x432bd6=_0x17652b||client;return _0x432bd6[_0x85d5('0x1a')](_0x3dc83c,_0x12bef9)[_0x85d5('0x1b')](function(_0x341e8e){logger[_0x85d5('0x1c')](_0x85d5('0x1d'),_0x2dbf13,_0x85d5('0x1e'));logger['debug'](_0x85d5('0x1f'),_0x2dbf13,_0x85d5('0x1e'),JSON['stringify'](_0x341e8e));if(_0x341e8e[_0x85d5('0x20')]){if(_0x341e8e[_0x85d5('0x20')]['code']===0x1f4){logger['error'](_0x85d5('0x1d'),_0x2dbf13,_0x341e8e['error'][_0x85d5('0x21')]);return _0x3eab37(_0x341e8e['error'][_0x85d5('0x21')]);}logger[_0x85d5('0x20')]('SmsMessage,\x20%s,\x20%s',_0x2dbf13,_0x341e8e['error']['message']);return _0x17acb0(_0x341e8e['error'][_0x85d5('0x21')]);}else{logger[_0x85d5('0x1c')](_0x85d5('0x1d'),_0x2dbf13,_0x85d5('0x1e'));_0x17acb0(_0x341e8e[_0x85d5('0x22')][_0x85d5('0x21')]);}})['catch'](function(_0x7e9a11){logger['error'](_0x85d5('0x1d'),_0x2dbf13,_0x7e9a11);_0x3eab37(_0x7e9a11);});});}function respondWithStatusCode(_0x1ed432,_0x233ccd){_0x233ccd=_0x233ccd||0xcc;return function(_0x5cc2cf){if(_0x5cc2cf){return _0x1ed432[_0x85d5('0x23')](_0x233ccd);}return _0x1ed432[_0x85d5('0x24')](_0x233ccd)[_0x85d5('0x25')]();};}function respondWithResult(_0x370c97,_0x4605c5){_0x4605c5=_0x4605c5||0xc8;return function(_0x56031f){if(_0x56031f){return _0x370c97[_0x85d5('0x24')](_0x4605c5)[_0x85d5('0x26')](_0x56031f);}};}function respondWithFilteredResult(_0x330f8a,_0x22a961){return function(_0x43ac91){if(_0x43ac91){var _0x572daf=_0x43ac91[_0x85d5('0x27')],_0x539dc9=_0x22a961[_0x85d5('0x28')],_0x2ce7a9=_0x22a961[_0x85d5('0x28')]+_0x22a961['limit'],_0x24a0a3;if(_0x2ce7a9>=_0x572daf){_0x2ce7a9=_0x572daf;_0x24a0a3=0xc8;}else{_0x24a0a3=0xce;}_0x330f8a[_0x85d5('0x24')](_0x24a0a3);return _0x330f8a[_0x85d5('0x29')]('Content-Range',_0x539dc9+'-'+_0x2ce7a9+'/'+_0x572daf)['json'](_0x43ac91);}return null;};}function patchUpdates(_0x26b8eb){return function(_0x153713){try{jsonpatch['apply'](_0x153713,_0x26b8eb,!![]);}catch(_0x13e772){return BPromise['reject'](_0x13e772);}return _0x153713[_0x85d5('0x2a')]();};}function saveUpdates(_0x391ce1,_0x5e426d){return function(_0x377ca1){if(_0x377ca1){return _0x377ca1[_0x85d5('0x2b')](_0x391ce1)[_0x85d5('0x1b')](function(_0x2220b2){return _0x2220b2;});}return null;};}function removeEntity(_0x53f7f3,_0x4b09f0){return function(_0x40820e){if(_0x40820e){return _0x40820e[_0x85d5('0x2c')]()[_0x85d5('0x1b')](function(){_0x53f7f3[_0x85d5('0x24')](0xcc)[_0x85d5('0x25')]();});}};}function handleEntityNotFound(_0x5fb7f4,_0x2b1651){return function(_0x3c07e1){if(!_0x3c07e1){_0x5fb7f4[_0x85d5('0x23')](0x194);}return _0x3c07e1;};}function handleError(_0x539edd,_0x5a15fd){_0x5a15fd=_0x5a15fd||0x1f4;return function(_0x27308c){logger[_0x85d5('0x20')](_0x27308c[_0x85d5('0x2d')]);if(_0x27308c[_0x85d5('0x2e')]){delete _0x27308c[_0x85d5('0x2e')];}_0x539edd[_0x85d5('0x24')](_0x5a15fd)[_0x85d5('0x2f')](_0x27308c);};}exports[_0x85d5('0x30')]=function(_0x5783df,_0x358555){var _0x42e8b4={},_0x11ed28={},_0x1fdb00={'count':0x0,'rows':[]};var _0x555214=db[_0x85d5('0x31')][_0x85d5('0x32')];_0x11ed28[_0x85d5('0x33')]=_[_0x85d5('0x34')](_0x555214);_0x11ed28['query']=_[_0x85d5('0x34')](_0x5783df['query']);_0x11ed28['filters']=_[_0x85d5('0x35')](_0x11ed28['model'],_0x11ed28[_0x85d5('0x36')]);_0x42e8b4['attributes']=_['intersection'](_0x11ed28[_0x85d5('0x33')],qs[_0x85d5('0x37')](_0x5783df[_0x85d5('0x36')][_0x85d5('0x37')]));_0x42e8b4[_0x85d5('0x38')]=_0x42e8b4['attributes']['length']?_0x42e8b4[_0x85d5('0x38')]:_0x11ed28[_0x85d5('0x33')];if(!_0x5783df[_0x85d5('0x36')][_0x85d5('0x39')](_0x85d5('0x3a'))){_0x42e8b4[_0x85d5('0x3b')]=qs['limit'](_0x5783df['query'][_0x85d5('0x3b')]);_0x42e8b4['offset']=qs[_0x85d5('0x28')](_0x5783df[_0x85d5('0x36')][_0x85d5('0x28')]);}_0x42e8b4[_0x85d5('0x3c')]=qs[_0x85d5('0x3d')](_0x5783df['query']['sort']);_0x42e8b4[_0x85d5('0x3e')]=qs[_0x85d5('0x3f')](_[_0x85d5('0x40')](_0x5783df[_0x85d5('0x36')],_0x11ed28[_0x85d5('0x3f')]));if(_0x5783df[_0x85d5('0x36')][_0x85d5('0x41')]){_0x42e8b4[_0x85d5('0x3e')]=_[_0x85d5('0x42')](_0x42e8b4[_0x85d5('0x3e')],{'$or':_[_0x85d5('0x43')](_0x555214,function(_0x37d890){if(_0x37d890[_0x85d5('0x44')][_0x85d5('0x45')]!==_0x85d5('0x46')){var _0x26fc66={};_0x26fc66[_0x37d890[_0x85d5('0x47')]]={'$like':'%'+_0x5783df['query']['filter']+'%'};return _0x26fc66;}})});}_0x42e8b4=_[_0x85d5('0x42')]({},_0x42e8b4,_0x5783df[_0x85d5('0x48')]);var _0xbbc80d={'where':_0x42e8b4[_0x85d5('0x3e')]};return db[_0x85d5('0x31')][_0x85d5('0x27')](_0xbbc80d)['then'](function(_0x1188f2){_0x1fdb00['count']=_0x1188f2;if(_0x5783df['query'][_0x85d5('0x49')]){_0x42e8b4[_0x85d5('0x4a')]=[{'all':!![]}];}return db[_0x85d5('0x31')][_0x85d5('0x4b')](_0x42e8b4);})[_0x85d5('0x1b')](function(_0x588d8a){_0x1fdb00[_0x85d5('0x4c')]=_0x588d8a;return _0x1fdb00;})['then'](respondWithFilteredResult(_0x358555,_0x42e8b4))[_0x85d5('0x4d')](handleError(_0x358555,null));};exports[_0x85d5('0x4e')]=function(_0x219154,_0x4f2548){var _0x58a44d={'raw':!![],'where':{'id':_0x219154[_0x85d5('0x4f')]['id']}},_0x4de88b={};_0x4de88b[_0x85d5('0x33')]=_[_0x85d5('0x34')](db['SmsMessage']['rawAttributes']);_0x4de88b[_0x85d5('0x36')]=_[_0x85d5('0x34')](_0x219154[_0x85d5('0x36')]);_0x4de88b[_0x85d5('0x3f')]=_['intersection'](_0x4de88b[_0x85d5('0x33')],_0x4de88b[_0x85d5('0x36')]);_0x58a44d[_0x85d5('0x38')]=_[_0x85d5('0x35')](_0x4de88b[_0x85d5('0x33')],qs[_0x85d5('0x37')](_0x219154[_0x85d5('0x36')][_0x85d5('0x37')]));_0x58a44d[_0x85d5('0x38')]=_0x58a44d[_0x85d5('0x38')][_0x85d5('0x50')]?_0x58a44d[_0x85d5('0x38')]:_0x4de88b[_0x85d5('0x33')];if(_0x219154[_0x85d5('0x36')][_0x85d5('0x49')]){_0x58a44d['include']=[{'all':!![]}];}_0x58a44d=_[_0x85d5('0x42')]({},_0x58a44d,_0x219154[_0x85d5('0x48')]);return db[_0x85d5('0x31')][_0x85d5('0x51')](_0x58a44d)['then'](handleEntityNotFound(_0x4f2548,null))[_0x85d5('0x1b')](respondWithResult(_0x4f2548,null))['catch'](handleError(_0x4f2548,null));};exports[_0x85d5('0x52')]=function(_0x363aeb,_0x2755cc){return db[_0x85d5('0x31')]['create'](_0x363aeb[_0x85d5('0x53')],{})['then'](respondWithResult(_0x2755cc,0xc9))['catch'](handleError(_0x2755cc,null));};exports['update']=function(_0x25b90d,_0x410d7f){if(_0x25b90d[_0x85d5('0x53')]['id']){delete _0x25b90d[_0x85d5('0x53')]['id'];}return db[_0x85d5('0x31')]['find']({'where':{'id':_0x25b90d['params']['id']}})[_0x85d5('0x1b')](handleEntityNotFound(_0x410d7f,null))[_0x85d5('0x1b')](saveUpdates(_0x25b90d[_0x85d5('0x53')],null))[_0x85d5('0x1b')](respondWithResult(_0x410d7f,null))['catch'](handleError(_0x410d7f,null));};exports[_0x85d5('0x2c')]=function(_0x41b001,_0x36723c){return db['SmsMessage']['find']({'where':{'id':_0x41b001[_0x85d5('0x4f')]['id']}})[_0x85d5('0x1b')](handleEntityNotFound(_0x36723c,null))[_0x85d5('0x1b')](removeEntity(_0x36723c,null))['catch'](handleError(_0x36723c,null));};exports[_0x85d5('0x54')]=function(_0x3e7263,_0xa5153d){return db[_0x85d5('0x31')]['describe']()[_0x85d5('0x1b')](respondWithResult(_0xa5153d,null))[_0x85d5('0x4d')](handleError(_0xa5153d,null));};var interaction_log=require(_0x85d5('0x55'))('sms-interactions');exports[_0x85d5('0x56')]=function(_0x2f52aa,_0x388ee8,_0x561bde){var _0x34aa42={'channel':_0x85d5('0x57')};if(_0x2f52aa['body']['id']){delete _0x2f52aa[_0x85d5('0x53')]['id'];}_0x2f52aa['body'][_0x85d5('0x58')]=!![];_0x2f52aa['body'][_0x85d5('0x59')]=moment()[_0x85d5('0x5a')](_0x85d5('0x5b'));_0x2f52aa[_0x85d5('0x53')]['UserId']=_0x2f52aa[_0x85d5('0x53')][_0x85d5('0x5c')]||_0x2f52aa[_0x85d5('0x5d')]['id'];return db[_0x85d5('0x31')][_0x85d5('0x51')]({'where':{'id':_0x2f52aa[_0x85d5('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0x85d5('0x5e')],'as':_0x85d5('0x5f')}]})['then'](handleEntityNotFound(_0x388ee8,null))['then'](saveUpdates(_0x2f52aa[_0x85d5('0x53')],null))['then'](function(_0x29e17f){if(_0x29e17f){_0x34aa42[_0x85d5('0x21')]=_0x29e17f['get']({'plain':!![]});return db['SmsInteraction'][_0x85d5('0x51')]({'where':{'id':_0x29e17f[_0x85d5('0x60')]}});}return null;})[_0x85d5('0x1b')](handleEntityNotFound(_0x388ee8,null))['then'](function(_0x1c0753){if(_0x1c0753){return _0x1c0753[_0x85d5('0x2b')]({'UserId':_0x2f52aa[_0x85d5('0x53')][_0x85d5('0x5c')],'read1stAt':_['isNil'](_0x1c0753['read1stAt'])?moment()[_0x85d5('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x15371b){if(_0x15371b){_0x34aa42[_0x85d5('0x61')]=_0x15371b[_0x85d5('0x62')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f52aa[_0x85d5('0x5d')]['id'],_0x2f52aa[_0x85d5('0x5d')][_0x85d5('0x2e')],_0x2f52aa['user'][_0x85d5('0x63')],_0x34aa42[_0x85d5('0x61')]['id'],_0x2f52aa[_0x85d5('0x53')]?JSON[_0x85d5('0x64')](_0x2f52aa[_0x85d5('0x53')]):_0x85d5('0x65'));return respondWithRpcPromise(_0x85d5('0x66'),_0x85d5('0x67'),_0x34aa42);}return null;})['then'](function(_0x575cf8){if(_0x575cf8){if(_0x2f52aa[_0x85d5('0x53')][_0x85d5('0x68')]){_0x34aa42[_0x85d5('0x21')]['interface']=util[_0x85d5('0x5a')](_0x85d5('0x69'),_0x2f52aa['user'][_0x85d5('0x2e')]);_0x34aa42[_0x85d5('0x21')][_0x85d5('0x6a')]=_0x34aa42[_0x85d5('0x6a')];_0x34aa42[_0x85d5('0x21')]['event']=_0x85d5('0x56');return respondWithRpcPromise(_0x85d5('0x6b'),_0x85d5('0x6b'),{'event':_0x85d5('0x6c'),'message':_0x34aa42[_0x85d5('0x21')]},client9002)['then'](function(){return _0x34aa42;});}return _0x34aa42;}return null;})[_0x85d5('0x1b')](respondWithResult(_0x388ee8,null))[_0x85d5('0x4d')](handleError(_0x388ee8,null));};var interaction_log=require(_0x85d5('0x55'))(_0x85d5('0x6d'));exports[_0x85d5('0x6e')]=function(_0x400712,_0x378f56,_0xcff925){var _0x3166ce={'agent':{},'channel':_0x85d5('0x57')};if(_0x400712['body']['id']){delete _0x400712[_0x85d5('0x53')]['id'];}_0x400712[_0x85d5('0x53')][_0x85d5('0x5c')]=_0x400712[_0x85d5('0x53')][_0x85d5('0x5c')]||_0x400712[_0x85d5('0x5d')]['id'];_0x3166ce['agent']['id']=_0x400712[_0x85d5('0x53')]['UserId'];return db['SmsMessage'][_0x85d5('0x51')]({'where':{'id':_0x400712[_0x85d5('0x4f')]['id'],'UserId':null}})[_0x85d5('0x1b')](handleEntityNotFound(_0x378f56,null))[_0x85d5('0x1b')](function(_0x47044b){if(_0x47044b){_0x3166ce[_0x85d5('0x21')]=_0x47044b[_0x85d5('0x62')]({'plain':!![]});return db[_0x85d5('0x6f')][_0x85d5('0x51')]({'where':{'id':_0x47044b['SmsInteractionId']}});}return null;})[_0x85d5('0x1b')](handleEntityNotFound(_0x378f56,null))[_0x85d5('0x1b')](function(_0x8ef5f1){if(_0x8ef5f1){_0x3166ce[_0x85d5('0x61')]=_0x8ef5f1[_0x85d5('0x62')]({'plain':!![]});interaction_log[_0x85d5('0x1c')](_0x85d5('0x70'),_0x400712[_0x85d5('0x5d')]['id'],_0x400712[_0x85d5('0x5d')][_0x85d5('0x2e')],_0x400712[_0x85d5('0x5d')][_0x85d5('0x63')],_0x3166ce[_0x85d5('0x61')]['id'],_0x400712[_0x85d5('0x53')]?JSON[_0x85d5('0x64')](_0x400712['body']):'null');return respondWithRpcPromise(_0x85d5('0x71'),'rejectMessage',_0x3166ce);}return null;})[_0x85d5('0x1b')](function(_0xa18a5e){if(_0xa18a5e){_0xa18a5e[_0x85d5('0x21')][_0x85d5('0x72')]=util[_0x85d5('0x5a')](_0x85d5('0x69'),_0x400712[_0x85d5('0x5d')][_0x85d5('0x2e')]);_0xa18a5e[_0x85d5('0x21')]['channel']=_0x3166ce[_0x85d5('0x6a')];_0xa18a5e[_0x85d5('0x21')]['event']=_0x85d5('0x6e');respondWithRpcPromise('EventManager',_0x85d5('0x6b'),{'event':_0x85d5('0x73'),'message':_0xa18a5e[_0x85d5('0x21')]},client9002);return _0x3166ce;}return null;})[_0x85d5('0x1b')](respondWithResult(_0x378f56,null))['catch'](handleError(_0x378f56,null));};exports[_0x85d5('0x24')]=function(_0x381cde,_0x59d51b,_0x31a9a5){if(_0x381cde[_0x85d5('0x53')]['id']){delete _0x381cde['body']['id'];}var _0x45b1e2;return db[_0x85d5('0x31')][_0x85d5('0x51')]({'where':{'id':_0x381cde['params']['id']}})[_0x85d5('0x1b')](handleEntityNotFound(_0x59d51b,null))[_0x85d5('0x1b')](function(_0x2dacf7){if(_0x2dacf7){_0x45b1e2=_0x2dacf7;return db[_0x85d5('0x74')][_0x85d5('0x51')]({'where':{'id':_0x2dacf7[_0x85d5('0x75')]}});}})['then'](handleEntityNotFound(_0x59d51b,null))[_0x85d5('0x1b')](function(_0x3f604a){if(_0x3f604a){logger['debug'](_0x85d5('0x1f'),'status',_0x85d5('0x76'),_0x3f604a[_0x85d5('0x44')],util[_0x85d5('0x77')](_0x381cde['body'],{'showHidden':![],'depth':null}));switch(_0x3f604a[_0x85d5('0x44')]){case _0x85d5('0x78'):if(_0x381cde[_0x85d5('0x53')][_0x85d5('0x79')]&&_0x381cde[_0x85d5('0x53')]['MessageSid']===_0x45b1e2[_0x85d5('0x7a')]){return _0x45b1e2[_0x85d5('0x2b')]({'read':!![]});}else{logger[_0x85d5('0x20')](_0x85d5('0x7b'),'status',_0x85d5('0x78'),util[_0x85d5('0x77')](_0x381cde[_0x85d5('0x53')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x381cde[_0x85d5('0x53')]['MessageUUID']&&_0x381cde[_0x85d5('0x53')][_0x85d5('0x7c')]===_0x45b1e2['messageId']&&_['indexOf']([_0x85d5('0x7d'),_0x85d5('0x7e')],_0x381cde[_0x85d5('0x53')][_0x85d5('0x7f')])>=0x0){return _0x45b1e2[_0x85d5('0x2b')]({'read':!![]});}else{logger[_0x85d5('0x20')](_0x85d5('0x7b'),_0x85d5('0x24'),'plivio',util[_0x85d5('0x77')](_0x381cde[_0x85d5('0x53')],{'showHidden':![],'depth':null}));}break;case _0x85d5('0x80'):var _0x52bdee=_0x381cde[_0x85d5('0x53')][_0x85d5('0x81')][0x0];if(_0x52bdee['status'][_0x85d5('0x82')]===_0x85d5('0x83')){return _0x45b1e2[_0x85d5('0x2b')]({'read':!![]});}else{logger[_0x85d5('0x20')](_0x85d5('0x7b'),_0x85d5('0x24'),_0x85d5('0x80'),util['inspect'](_0x381cde[_0x85d5('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x45b1e2;}})[_0x85d5('0x1b')](respondWithResult(_0x59d51b,null))[_0x85d5('0x4d')](handleError(_0x59d51b,null));}; \ No newline at end of file +var _0x5d17=['delivered','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','SmsMessage','rawAttributes','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','options','includeAll','include','findAll','params','find','create','body','update','destroy','describe','accept','sms','read','readAt','UserId','user','CmContact','Contact','get','SmsInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','manual','SIP/%s','EventManager','sms-interactions','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','event','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d17,0x114));var _0x75d1=function(_0x35a9a7,_0x5e8c7f){_0x35a9a7=_0x35a9a7-0x0;var _0x142c13=_0x5d17[_0x35a9a7];return _0x142c13;};'use strict';var pdf=require(_0x75d1('0x0'));var emlformat=require(_0x75d1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75d1('0x2'));var rp=require(_0x75d1('0x3'));var moment=require(_0x75d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75d1('0x5'));var util=require(_0x75d1('0x6'));var path=require(_0x75d1('0x7'));var sox=require(_0x75d1('0x8'));var csv=require('to-csv');var ejs=require(_0x75d1('0x9'));var fs=require('fs');var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x75d1('0x11'));var logger=require(_0x75d1('0x12'))('api');var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var db=require(_0x75d1('0x15'))['db'];config[_0x75d1('0x16')]=_[_0x75d1('0x17')](config[_0x75d1('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x75d1('0x18'))(new Redis(config[_0x75d1('0x16')]));require(_0x75d1('0x19'))[_0x75d1('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x75d1('0x1b')][_0x75d1('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2fd022,_0x52e649,_0x1f9620){if(_0x1f9620){var _0x3fff9b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fff9b[_0x75d1('0x1d')](_0x52e649)){return _0x2fd022;}else{throw new Error(_0x75d1('0x1e'));}}else{return _0x2fd022;}}function respondWithRpcPromise(_0x1160ca,_0x39a26b,_0x2845bc,_0x59dead){return new BPromise(function(_0x1bc5de,_0x3d0717){var _0x2c2a6d=_0x59dead||client;return _0x2c2a6d['request'](_0x1160ca,_0x2845bc)['then'](function(_0xc6b282){logger[_0x75d1('0x1f')]('SmsMessage,\x20%s,\x20%s',_0x39a26b,_0x75d1('0x20'));logger[_0x75d1('0x21')](_0x75d1('0x22'),_0x39a26b,_0x75d1('0x20'),JSON[_0x75d1('0x23')](_0xc6b282));if(_0xc6b282[_0x75d1('0x24')]){if(_0xc6b282['error'][_0x75d1('0x25')]===0x1f4){logger[_0x75d1('0x24')]('SmsMessage,\x20%s,\x20%s',_0x39a26b,_0xc6b282[_0x75d1('0x24')][_0x75d1('0x26')]);return _0x3d0717(_0xc6b282['error'][_0x75d1('0x26')]);}logger['error'](_0x75d1('0x27'),_0x39a26b,_0xc6b282[_0x75d1('0x24')][_0x75d1('0x26')]);return _0x1bc5de(_0xc6b282['error']['message']);}else{logger[_0x75d1('0x1f')](_0x75d1('0x27'),_0x39a26b,_0x75d1('0x20'));_0x1bc5de(_0xc6b282[_0x75d1('0x28')]['message']);}})[_0x75d1('0x29')](function(_0x2b5848){logger[_0x75d1('0x24')]('SmsMessage,\x20%s,\x20%s',_0x39a26b,_0x2b5848);_0x3d0717(_0x2b5848);});});}function respondWithStatusCode(_0x54095d,_0x57efd6){_0x57efd6=_0x57efd6||0xcc;return function(_0x364dc9){if(_0x364dc9){return _0x54095d[_0x75d1('0x2a')](_0x57efd6);}return _0x54095d[_0x75d1('0x2b')](_0x57efd6)[_0x75d1('0x2c')]();};}function respondWithResult(_0x38653d,_0x519ceb){_0x519ceb=_0x519ceb||0xc8;return function(_0x4d292e){if(_0x4d292e){return _0x38653d[_0x75d1('0x2b')](_0x519ceb)[_0x75d1('0x2d')](_0x4d292e);}};}function respondWithFilteredResult(_0x4967b5,_0x2408b6){return function(_0x5aa4fa){if(_0x5aa4fa){var _0xdb338d=_0x5aa4fa[_0x75d1('0x2e')],_0x244da6=_0x2408b6['offset'],_0x91e7c9=_0x2408b6[_0x75d1('0x2f')]+_0x2408b6[_0x75d1('0x30')],_0x3fb7b9;if(_0x91e7c9>=_0xdb338d){_0x91e7c9=_0xdb338d;_0x3fb7b9=0xc8;}else{_0x3fb7b9=0xce;}_0x4967b5[_0x75d1('0x2b')](_0x3fb7b9);return _0x4967b5[_0x75d1('0x31')]('Content-Range',_0x244da6+'-'+_0x91e7c9+'/'+_0xdb338d)[_0x75d1('0x2d')](_0x5aa4fa);}return null;};}function patchUpdates(_0x551824){return function(_0x1b2bbb){try{jsonpatch[_0x75d1('0x32')](_0x1b2bbb,_0x551824,!![]);}catch(_0x4c449d){return BPromise[_0x75d1('0x33')](_0x4c449d);}return _0x1b2bbb[_0x75d1('0x34')]();};}function saveUpdates(_0x15ff9b,_0x100a4b){return function(_0x22b190){if(_0x22b190){return _0x22b190['update'](_0x15ff9b)[_0x75d1('0x35')](function(_0x5ee66c){return _0x5ee66c;});}return null;};}function removeEntity(_0x20de89,_0xa0f4c9){return function(_0x4b936c){if(_0x4b936c){return _0x4b936c['destroy']()['then'](function(){_0x20de89[_0x75d1('0x2b')](0xcc)[_0x75d1('0x2c')]();});}};}function handleEntityNotFound(_0x40dc07,_0x131f51){return function(_0x38972c){if(!_0x38972c){_0x40dc07[_0x75d1('0x2a')](0x194);}return _0x38972c;};}function handleError(_0x3effda,_0x2dce68){_0x2dce68=_0x2dce68||0x1f4;return function(_0x433092){logger['error'](_0x433092[_0x75d1('0x36')]);if(_0x433092[_0x75d1('0x37')]){delete _0x433092[_0x75d1('0x37')];}_0x3effda[_0x75d1('0x2b')](_0x2dce68)[_0x75d1('0x38')](_0x433092);};}exports['index']=function(_0x4f79d9,_0x487431){var _0x1058b7={},_0x17c0f6={},_0x7c9dc3={'count':0x0,'rows':[]};var _0x29d72f=db[_0x75d1('0x39')][_0x75d1('0x3a')];_0x17c0f6['model']=_['keys'](_0x29d72f);_0x17c0f6['query']=_[_0x75d1('0x3b')](_0x4f79d9['query']);_0x17c0f6['filters']=_[_0x75d1('0x3c')](_0x17c0f6[_0x75d1('0x3d')],_0x17c0f6[_0x75d1('0x3e')]);_0x1058b7[_0x75d1('0x3f')]=_['intersection'](_0x17c0f6[_0x75d1('0x3d')],qs[_0x75d1('0x40')](_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x40')]));_0x1058b7[_0x75d1('0x3f')]=_0x1058b7[_0x75d1('0x3f')][_0x75d1('0x41')]?_0x1058b7[_0x75d1('0x3f')]:_0x17c0f6[_0x75d1('0x3d')];if(!_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x42')](_0x75d1('0x43'))){_0x1058b7[_0x75d1('0x30')]=qs[_0x75d1('0x30')](_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x30')]);_0x1058b7[_0x75d1('0x2f')]=qs[_0x75d1('0x2f')](_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x2f')]);}_0x1058b7[_0x75d1('0x44')]=qs[_0x75d1('0x45')](_0x4f79d9['query']['sort']);_0x1058b7[_0x75d1('0x46')]=qs[_0x75d1('0x47')](_[_0x75d1('0x48')](_0x4f79d9[_0x75d1('0x3e')],_0x17c0f6['filters']));if(_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x49')]){_0x1058b7[_0x75d1('0x46')]=_[_0x75d1('0x4a')](_0x1058b7['where'],{'$or':_[_0x75d1('0x4b')](_0x29d72f,function(_0xfa2137){if(_0xfa2137[_0x75d1('0x4c')][_0x75d1('0x4d')]!=='VIRTUAL'){var _0x34d132={};_0x34d132[_0xfa2137['field']]={'$like':'%'+_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x49')]+'%'};return _0x34d132;}})});}_0x1058b7=_[_0x75d1('0x4a')]({},_0x1058b7,_0x4f79d9[_0x75d1('0x4e')]);var _0x32dcd7={'where':_0x1058b7[_0x75d1('0x46')]};return db['SmsMessage'][_0x75d1('0x2e')](_0x32dcd7)['then'](function(_0x5b7663){_0x7c9dc3[_0x75d1('0x2e')]=_0x5b7663;if(_0x4f79d9[_0x75d1('0x3e')][_0x75d1('0x4f')]){_0x1058b7[_0x75d1('0x50')]=[{'all':!![]}];}return db[_0x75d1('0x39')][_0x75d1('0x51')](_0x1058b7);})[_0x75d1('0x35')](function(_0x5b7b7c){_0x7c9dc3['rows']=_0x5b7b7c;return _0x7c9dc3;})[_0x75d1('0x35')](respondWithFilteredResult(_0x487431,_0x1058b7))[_0x75d1('0x29')](handleError(_0x487431,null));};exports['show']=function(_0x2d380d,_0x2fa44a){var _0x2066c8={'raw':!![],'where':{'id':_0x2d380d[_0x75d1('0x52')]['id']}},_0x4bb3b6={};_0x4bb3b6[_0x75d1('0x3d')]=_[_0x75d1('0x3b')](db[_0x75d1('0x39')][_0x75d1('0x3a')]);_0x4bb3b6[_0x75d1('0x3e')]=_[_0x75d1('0x3b')](_0x2d380d['query']);_0x4bb3b6[_0x75d1('0x47')]=_[_0x75d1('0x3c')](_0x4bb3b6[_0x75d1('0x3d')],_0x4bb3b6[_0x75d1('0x3e')]);_0x2066c8[_0x75d1('0x3f')]=_[_0x75d1('0x3c')](_0x4bb3b6[_0x75d1('0x3d')],qs['fields'](_0x2d380d[_0x75d1('0x3e')][_0x75d1('0x40')]));_0x2066c8[_0x75d1('0x3f')]=_0x2066c8['attributes'][_0x75d1('0x41')]?_0x2066c8[_0x75d1('0x3f')]:_0x4bb3b6[_0x75d1('0x3d')];if(_0x2d380d[_0x75d1('0x3e')][_0x75d1('0x4f')]){_0x2066c8[_0x75d1('0x50')]=[{'all':!![]}];}_0x2066c8=_['merge']({},_0x2066c8,_0x2d380d[_0x75d1('0x4e')]);return db[_0x75d1('0x39')][_0x75d1('0x53')](_0x2066c8)[_0x75d1('0x35')](handleEntityNotFound(_0x2fa44a,null))[_0x75d1('0x35')](respondWithResult(_0x2fa44a,null))[_0x75d1('0x29')](handleError(_0x2fa44a,null));};exports[_0x75d1('0x54')]=function(_0x104a44,_0x131082){return db[_0x75d1('0x39')][_0x75d1('0x54')](_0x104a44[_0x75d1('0x55')],{})['then'](respondWithResult(_0x131082,0xc9))['catch'](handleError(_0x131082,null));};exports[_0x75d1('0x56')]=function(_0x4c1f5e,_0x18ae80){if(_0x4c1f5e[_0x75d1('0x55')]['id']){delete _0x4c1f5e['body']['id'];}return db[_0x75d1('0x39')][_0x75d1('0x53')]({'where':{'id':_0x4c1f5e[_0x75d1('0x52')]['id']}})[_0x75d1('0x35')](handleEntityNotFound(_0x18ae80,null))[_0x75d1('0x35')](saveUpdates(_0x4c1f5e[_0x75d1('0x55')],null))[_0x75d1('0x35')](respondWithResult(_0x18ae80,null))['catch'](handleError(_0x18ae80,null));};exports[_0x75d1('0x57')]=function(_0x453b9b,_0x474645){return db[_0x75d1('0x39')][_0x75d1('0x53')]({'where':{'id':_0x453b9b[_0x75d1('0x52')]['id']}})[_0x75d1('0x35')](handleEntityNotFound(_0x474645,null))[_0x75d1('0x35')](removeEntity(_0x474645,null))[_0x75d1('0x29')](handleError(_0x474645,null));};exports[_0x75d1('0x58')]=function(_0x4fdcd8,_0x4e8e50){return db[_0x75d1('0x39')][_0x75d1('0x58')]()[_0x75d1('0x35')](respondWithResult(_0x4e8e50,null))['catch'](handleError(_0x4e8e50,null));};var interaction_log=require(_0x75d1('0x12'))('sms-interactions');exports[_0x75d1('0x59')]=function(_0x36859a,_0x349852,_0x16cc70){var _0x5d2219={'channel':_0x75d1('0x5a')};if(_0x36859a['body']['id']){delete _0x36859a['body']['id'];}_0x36859a[_0x75d1('0x55')][_0x75d1('0x5b')]=!![];_0x36859a[_0x75d1('0x55')][_0x75d1('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36859a[_0x75d1('0x55')][_0x75d1('0x5d')]=_0x36859a[_0x75d1('0x55')][_0x75d1('0x5d')]||_0x36859a[_0x75d1('0x5e')]['id'];return db['SmsMessage'][_0x75d1('0x53')]({'where':{'id':_0x36859a[_0x75d1('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x75d1('0x5f')],'as':_0x75d1('0x60')}]})[_0x75d1('0x35')](handleEntityNotFound(_0x349852,null))[_0x75d1('0x35')](saveUpdates(_0x36859a[_0x75d1('0x55')],null))[_0x75d1('0x35')](function(_0x40f50b){if(_0x40f50b){_0x5d2219[_0x75d1('0x26')]=_0x40f50b[_0x75d1('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x75d1('0x53')]({'where':{'id':_0x40f50b[_0x75d1('0x62')]}});}return null;})[_0x75d1('0x35')](handleEntityNotFound(_0x349852,null))[_0x75d1('0x35')](function(_0x3754b1){if(_0x3754b1){return _0x3754b1[_0x75d1('0x56')]({'UserId':_0x36859a[_0x75d1('0x55')]['UserId'],'read1stAt':_['isNil'](_0x3754b1[_0x75d1('0x63')])?moment()[_0x75d1('0x64')](_0x75d1('0x65')):undefined});}return null;})[_0x75d1('0x35')](function(_0x2b408){if(_0x2b408){_0x5d2219['interaction']=_0x2b408['get']({'plain':!![]});interaction_log[_0x75d1('0x1f')](_0x75d1('0x66'),_0x36859a['user']['id'],_0x36859a[_0x75d1('0x5e')][_0x75d1('0x37')],_0x36859a[_0x75d1('0x5e')][_0x75d1('0x67')],_0x5d2219[_0x75d1('0x68')]['id'],_0x36859a[_0x75d1('0x55')]?JSON['stringify'](_0x36859a['body']):_0x75d1('0x69'));return respondWithRpcPromise(_0x75d1('0x6a'),'acceptMessage',_0x5d2219);}return null;})[_0x75d1('0x35')](function(_0x5a70f6){if(_0x5a70f6){if(_0x36859a[_0x75d1('0x55')][_0x75d1('0x6b')]){_0x5d2219[_0x75d1('0x26')]['interface']=util[_0x75d1('0x64')](_0x75d1('0x6c'),_0x36859a[_0x75d1('0x5e')][_0x75d1('0x37')]);_0x5d2219[_0x75d1('0x26')]['channel']=_0x5d2219['channel'];_0x5d2219[_0x75d1('0x26')]['event']=_0x75d1('0x59');return respondWithRpcPromise(_0x75d1('0x6d'),_0x75d1('0x6d'),{'event':'acceptmessage','message':_0x5d2219['message']},client9002)[_0x75d1('0x35')](function(){return _0x5d2219;});}return _0x5d2219;}return null;})['then'](respondWithResult(_0x349852,null))[_0x75d1('0x29')](handleError(_0x349852,null));};var interaction_log=require(_0x75d1('0x12'))(_0x75d1('0x6e'));exports['reject']=function(_0xb91da4,_0x353bec,_0x644ced){var _0x41981f={'agent':{},'channel':_0x75d1('0x5a')};if(_0xb91da4[_0x75d1('0x55')]['id']){delete _0xb91da4[_0x75d1('0x55')]['id'];}_0xb91da4[_0x75d1('0x55')][_0x75d1('0x5d')]=_0xb91da4[_0x75d1('0x55')][_0x75d1('0x5d')]||_0xb91da4[_0x75d1('0x5e')]['id'];_0x41981f[_0x75d1('0x6f')]['id']=_0xb91da4[_0x75d1('0x55')]['UserId'];return db['SmsMessage'][_0x75d1('0x53')]({'where':{'id':_0xb91da4[_0x75d1('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x353bec,null))[_0x75d1('0x35')](function(_0x59ec25){if(_0x59ec25){_0x41981f['message']=_0x59ec25['get']({'plain':!![]});return db[_0x75d1('0x70')][_0x75d1('0x53')]({'where':{'id':_0x59ec25[_0x75d1('0x62')]}});}return null;})[_0x75d1('0x35')](handleEntityNotFound(_0x353bec,null))[_0x75d1('0x35')](function(_0x5d5a72){if(_0x5d5a72){_0x41981f[_0x75d1('0x68')]=_0x5d5a72[_0x75d1('0x61')]({'plain':!![]});interaction_log[_0x75d1('0x1f')](_0x75d1('0x71'),_0xb91da4[_0x75d1('0x5e')]['id'],_0xb91da4['user'][_0x75d1('0x37')],_0xb91da4['user'][_0x75d1('0x67')],_0x41981f[_0x75d1('0x68')]['id'],_0xb91da4[_0x75d1('0x55')]?JSON['stringify'](_0xb91da4['body']):'null');return respondWithRpcPromise(_0x75d1('0x72'),_0x75d1('0x73'),_0x41981f);}return null;})[_0x75d1('0x35')](function(_0x22caf3){if(_0x22caf3){_0x22caf3[_0x75d1('0x26')][_0x75d1('0x74')]=util['format'](_0x75d1('0x6c'),_0xb91da4[_0x75d1('0x5e')]['name']);_0x22caf3[_0x75d1('0x26')]['channel']=_0x41981f['channel'];_0x22caf3['message'][_0x75d1('0x75')]='reject';respondWithRpcPromise('EventManager',_0x75d1('0x6d'),{'event':'rejectmessage','message':_0x22caf3[_0x75d1('0x26')]},client9002);return _0x41981f;}return null;})[_0x75d1('0x35')](respondWithResult(_0x353bec,null))[_0x75d1('0x29')](handleError(_0x353bec,null));};exports[_0x75d1('0x2b')]=function(_0x1cc123,_0x1aa806,_0x388210){if(_0x1cc123[_0x75d1('0x55')]['id']){delete _0x1cc123['body']['id'];}var _0x195a0a;return db['SmsMessage'][_0x75d1('0x53')]({'where':{'id':_0x1cc123[_0x75d1('0x52')]['id']}})[_0x75d1('0x35')](handleEntityNotFound(_0x1aa806,null))['then'](function(_0x10bc92){if(_0x10bc92){_0x195a0a=_0x10bc92;return db[_0x75d1('0x76')][_0x75d1('0x53')]({'where':{'id':_0x10bc92[_0x75d1('0x77')]}});}})[_0x75d1('0x35')](handleEntityNotFound(_0x1aa806,null))[_0x75d1('0x35')](function(_0x1bb574){if(_0x1bb574){logger['debug'](_0x75d1('0x22'),_0x75d1('0x2b'),_0x75d1('0x78'),_0x1bb574[_0x75d1('0x4c')],util[_0x75d1('0x79')](_0x1cc123['body'],{'showHidden':![],'depth':null}));switch(_0x1bb574['type']){case _0x75d1('0x7a'):if(_0x1cc123['body'][_0x75d1('0x7b')]&&_0x1cc123[_0x75d1('0x55')][_0x75d1('0x7b')]===_0x195a0a[_0x75d1('0x7c')]){return _0x195a0a['update']({'read':!![]});}else{logger['error'](_0x75d1('0x7d'),_0x75d1('0x2b'),_0x75d1('0x7a'),util[_0x75d1('0x79')](_0x1cc123[_0x75d1('0x55')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1cc123[_0x75d1('0x55')][_0x75d1('0x7e')]&&_0x1cc123['body'][_0x75d1('0x7e')]===_0x195a0a[_0x75d1('0x7c')]&&_[_0x75d1('0x7f')]([_0x75d1('0x80'),_0x75d1('0x81')],_0x1cc123[_0x75d1('0x55')]['Status'])>=0x0){return _0x195a0a[_0x75d1('0x56')]({'read':!![]});}else{logger[_0x75d1('0x24')](_0x75d1('0x7d'),_0x75d1('0x2b'),_0x75d1('0x82'),util[_0x75d1('0x79')](_0x1cc123['body'],{'showHidden':![],'depth':null}));}break;case _0x75d1('0x83'):var _0x55e642=_0x1cc123[_0x75d1('0x55')][_0x75d1('0x84')][0x0];if(_0x55e642[_0x75d1('0x2b')][_0x75d1('0x85')]===_0x75d1('0x86')){return _0x195a0a[_0x75d1('0x56')]({'read':!![]});}else{logger['error'](_0x75d1('0x7d'),_0x75d1('0x2b'),_0x75d1('0x83'),util['inspect'](_0x1cc123[_0x75d1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x195a0a;}})[_0x75d1('0x35')](respondWithResult(_0x1aa806,null))['catch'](handleError(_0x1aa806,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 521eb1f..9754840 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 _0xcabf=['hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','emit','hasOwnProperty'];(function(_0xba47a2,_0x560d88){var _0x56a260=function(_0x27de7e){while(--_0x27de7e){_0xba47a2['push'](_0xba47a2['shift']());}};_0x56a260(++_0x560d88);}(_0xcabf,0x1ba));var _0xfcab=function(_0x2ef27c,_0x4a9e49){_0x2ef27c=_0x2ef27c-0x0;var _0x3715e3=_0xcabf[_0x2ef27c];return _0x3715e3;};'use strict';var EventEmitter=require(_0xfcab('0x0'));var SmsMessage=require(_0xfcab('0x1'))['db'][_0xfcab('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfcab('0x3'),'afterUpdate':_0xfcab('0x4'),'afterDestroy':_0xfcab('0x5')};function emitEvent(_0x420e5d){return function(_0x3e1a3a,_0x4b8d67,_0x149271){SmsMessageEvents[_0xfcab('0x6')](_0x420e5d+':'+_0x3e1a3a['id'],_0x3e1a3a);SmsMessageEvents[_0xfcab('0x6')](_0x420e5d,_0x3e1a3a);_0x149271(null);};}for(var e in events){if(events[_0xfcab('0x7')](e)){var event=events[e];SmsMessage[_0xfcab('0x8')](e,emitEvent(event));}}module[_0xfcab('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xbc86=['hook','exports','events','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3a9815,_0x47eb16){var _0x188653=function(_0x203e84){while(--_0x203e84){_0x3a9815['push'](_0x3a9815['shift']());}};_0x188653(++_0x47eb16);}(_0xbc86,0x102));var _0x6bc8=function(_0x57606d,_0x4d2860){_0x57606d=_0x57606d-0x0;var _0x361ed7=_0xbc86[_0x57606d];return _0x361ed7;};'use strict';var EventEmitter=require(_0x6bc8('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6bc8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bc8('0x2'),'afterDestroy':_0x6bc8('0x3')};function emitEvent(_0x1826d3){return function(_0x5783c7,_0x412edd,_0x5092bc){SmsMessageEvents[_0x6bc8('0x4')](_0x1826d3+':'+_0x5783c7['id'],_0x5783c7);SmsMessageEvents[_0x6bc8('0x4')](_0x1826d3,_0x5783c7);_0x5092bc(null);};}for(var e in events){if(events[_0x6bc8('0x5')](e)){var event=events[e];SmsMessage[_0x6bc8('0x6')](e,emitEvent(event));}}module[_0x6bc8('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 0b2da70..49d0370 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 _0x3e7b=['refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','rimraf','./smsMessage.attributes','exports','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','login?username=','&password=','split','POST','total_sent','internal_order_id','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','text','timestamp','keys','length','apiKey','createHash','digest','hex','GET','https://sms.csc.lv/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','message'];(function(_0x4073ea,_0x56357c){var _0x44df4a=function(_0x165cf9){while(--_0x165cf9){_0x4073ea['push'](_0x4073ea['shift']());}};_0x44df4a(++_0x56357c);}(_0x3e7b,0x77));var _0xb3e7=function(_0x14c504,_0x87ba9a){_0x14c504=_0x14c504-0x0;var _0x14b021=_0x3e7b[_0x14c504];return _0x14b021;};'use strict';var _=require(_0xb3e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb3e7('0x1'));var moment=require(_0xb3e7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb3e7('0x3'));var config=require('../../config/environment');var attributes=require(_0xb3e7('0x4'));module[_0xb3e7('0x5')]=function(_0x54f92f,_0x4df2bb){return _0x54f92f['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xb3e7('0x6'),'fields':[_0xb3e7('0x6')]},{'name':_0xb3e7('0x7'),'fields':[_0xb3e7('0x8')],'type':_0xb3e7('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c89f0,_0x5a76c2,_0x212c18){var _0x594936=_0x54f92f[_0xb3e7('0xa')];var _0x233c97=_0x3c89f0[_0xb3e7('0xb')]({'plain':!![]});if(_0x233c97[_0xb3e7('0xc')][_0xb3e7('0xd')]()==='in'||_0x233c97[_0xb3e7('0xc')][_0xb3e7('0xd')]()===_0xb3e7('0xe')&&!_0x233c97[_0xb3e7('0xf')]&&!_[_0xb3e7('0x10')](_0x233c97[_0xb3e7('0x11')])){_0x594936['SmsInteraction'][_0xb3e7('0x12')]({'where':{'id':_0x233c97[_0xb3e7('0x13')]}})[_0xb3e7('0x14')](function(_0x21a258){if(_0x21a258){_0x21a258[_0xb3e7('0x15')]({'lastMsgAt':_0x233c97[_0xb3e7('0x16')],'lastMsgDirection':_0x233c97[_0xb3e7('0xc')][_0xb3e7('0xd')]()});}})[_0xb3e7('0x17')](function(_0x330641){console['error'](_0x330641);});}if(_0x233c97[_0xb3e7('0xc')]===_0xb3e7('0xe')&&!_0x233c97[_0xb3e7('0xf')]){var _0x433b4a;_0x594936[_0xb3e7('0x18')][_0xb3e7('0x19')]({'where':{'id':_0x233c97[_0xb3e7('0x1a')]},'raw':!![]})[_0xb3e7('0x14')](function(_0x525123){_0x433b4a=_0x525123;if(_0x433b4a&&_0x433b4a[_0xb3e7('0x1b')]){switch(_0x433b4a[_0xb3e7('0x1b')]){case _0xb3e7('0x1c'):var _0x3c216c=require('twilio');if(_0x433b4a['accountSid']&&_0x433b4a[_0xb3e7('0x1d')]&&_0x433b4a[_0xb3e7('0x1e')]){var _0x3037f4=new _0x3c216c(_0x433b4a[_0xb3e7('0x1f')],_0x433b4a[_0xb3e7('0x1d')]);_0x3037f4[_0xb3e7('0x20')][_0xb3e7('0x21')]({'body':_0x233c97[_0xb3e7('0x8')],'to':_0x233c97[_0xb3e7('0x1e')],'from':_0x433b4a['phone'],'statusCallback':_0x433b4a[_0xb3e7('0x22')]+_0xb3e7('0x23')+_0x233c97['id']+_0xb3e7('0x24')+_0x433b4a[_0xb3e7('0x25')]})[_0xb3e7('0x14')](function(_0x246af9){if(_0x246af9[_0xb3e7('0x26')]){return _0x3c89f0[_0xb3e7('0x15')]({'messageId':_0x246af9[_0xb3e7('0x26')]});}})['catch'](function(_0x25471e){logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),'twilio',util['inspect'](_0x25471e,{'showHidden':![],'depth':null}));});}else{logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xb3e7('0x2a'):var _0x13f038=_0xb3e7('0x2b');if(_0x433b4a[_0xb3e7('0x2c')]&&_0x433b4a[_0xb3e7('0x2d')]){var _0x285915={'recipient':[_0x233c97['phone']],'message':_0x233c97[_0xb3e7('0x8')],'message_type':_0x433b4a['smsMethod']};var _0x244881={'url':_0x13f038+_0xb3e7('0x2e')+_0x433b4a[_0xb3e7('0x2c')]+_0xb3e7('0x2f')+_0x433b4a[_0xb3e7('0x2d')],'method':'GET'};rp(_0x244881)[_0xb3e7('0x14')](function(_0x3087ae){var _0x4cf9a7=_0x3087ae[_0xb3e7('0x30')](';');var _0x3596da={'user_key':_0x4cf9a7[0x0],'session_key':_0x4cf9a7[0x1]};_0x244881={'url':_0x13f038+'sms','method':_0xb3e7('0x31'),'headers':{'user_key':_0x3596da['user_key'],'Session_key':_0x3596da['session_key']},'json':!![],'body':_0x285915};return rp(_0x244881);})[_0xb3e7('0x14')](function(_0x36becd){if(_0x36becd[_0xb3e7('0x32')]>=0x1){var _0x360690={'messageId':_0x36becd[_0xb3e7('0x33')]};if(_0x433b4a['smsMethod']!=='GP'||!_0x433b4a[_0xb3e7('0x34')]){_0x360690[_0xb3e7('0x35')]=!![];}return _0x3c89f0[_0xb3e7('0x15')](_0x360690);}else{return logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x2a'),util[_0xb3e7('0x36')](_0x36becd,{'showHidden':![],'depth':null}));}})[_0xb3e7('0x17')](function(_0x174d0f){return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x2a'),util[_0xb3e7('0x36')](_0x174d0f,{'showHidden':![],'depth':null}));});}else{logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb3e7('0x37'):if(_0x433b4a[_0xb3e7('0x1d')]){var _0x36b4b5={'recipient':_0x233c97[_0xb3e7('0x1e')],'message':_0x233c97['body'],'sender':_0x433b4a[_0xb3e7('0x38')]||_0x433b4a[_0xb3e7('0x1e')],'authorization':_0x433b4a[_0xb3e7('0x1d')]};var _0x5a76c2={'method':_0xb3e7('0x31'),'uri':_0xb3e7('0x39'),'body':_0x36b4b5,'json':!![]};rp(_0x5a76c2)[_0xb3e7('0x14')](function(_0x18c788){var _0x1c0797={'messageId':_0x18c788[_0xb3e7('0x3a')]};if(!_0x433b4a[_0xb3e7('0x34')]){_0x1c0797[_0xb3e7('0x35')]=!![];}return _0x3c89f0[_0xb3e7('0x15')](_0x1c0797);})[_0xb3e7('0x17')](function(_0x209e3e){logger['error'](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x37'),util['inspect'](_0x209e3e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb3e7('0x28'),_0xb3e7('0x29'),'connectel',_0xb3e7('0x3b'));}break;case'clicksend':if(_0x433b4a['username']&&_0x433b4a[_0xb3e7('0x2d')]){var _0x36b4b5={'messages':[{'source':_0xb3e7('0x3c'),'to':_0x233c97[_0xb3e7('0x1e')],'body':_0x233c97['body'],'from':_0x433b4a['senderString']||_0x433b4a[_0xb3e7('0x1e')]}]};var _0x39ea9c=util[_0xb3e7('0x3d')](_0xb3e7('0x3e'),_0x433b4a[_0xb3e7('0x2c')],_0x433b4a[_0xb3e7('0x2d')]);var _0x5a76c2={'method':_0xb3e7('0x31'),'uri':_0xb3e7('0x3f'),'body':_0x36b4b5,'headers':{'Authorization':util[_0xb3e7('0x3d')]('Basic\x20%s',new Buffer(_0x39ea9c)[_0xb3e7('0x40')](_0xb3e7('0x41')))},'json':!![]};rp(_0x5a76c2)['then'](function(_0x462bcc){if(_0x462bcc[_0xb3e7('0x42')]>=0xc8&&_0x462bcc[_0xb3e7('0x42')]<=0xce){if(_0x462bcc[_0xb3e7('0x43')]&&_0x462bcc['data']['queued_count']>0x0){var _0x4d9240=_[_0xb3e7('0x44')](_0x462bcc['data'][_0xb3e7('0x20')]);var _0x5286f0={'messageId':_0x4d9240[_0xb3e7('0x45')]};if(!_0x433b4a[_0xb3e7('0x34')]){_0x5286f0[_0xb3e7('0x35')]=!![];}return _0x3c89f0[_0xb3e7('0x15')](_0x5286f0);}else{logger['error'](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x46'),util[_0xb3e7('0x36')](_0x462bcc,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x46'),util[_0xb3e7('0x36')](_0x462bcc,{'showHidden':![],'depth':null}));}})[_0xb3e7('0x17')](function(_0x274909){logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x46'),util[_0xb3e7('0x36')](_0x274909,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb3e7('0x28'),'afterCreate',_0xb3e7('0x46'),_0xb3e7('0x47'));}break;case'plivo':if(_0x433b4a[_0xb3e7('0x48')]&&_0x433b4a[_0xb3e7('0x1d')]){var _0x36b4b5={'dst':_0x233c97[_0xb3e7('0x1e')],'text':_0x233c97[_0xb3e7('0x8')],'src':_0x433b4a[_0xb3e7('0x38')]||_0x433b4a[_0xb3e7('0x1e')],'url':_0x433b4a['remote']+_0xb3e7('0x23')+_0x233c97['id']+_0xb3e7('0x24')+_0x433b4a[_0xb3e7('0x25')]};var _0x39ea9c=util[_0xb3e7('0x3d')](_0xb3e7('0x3e'),_0x433b4a[_0xb3e7('0x48')],_0x433b4a[_0xb3e7('0x1d')]);var _0x5a76c2={'method':_0xb3e7('0x31'),'uri':util[_0xb3e7('0x3d')](_0xb3e7('0x49'),_0x433b4a['authId']),'body':_0x36b4b5,'headers':{'Authorization':util[_0xb3e7('0x3d')](_0xb3e7('0x4a'),new Buffer(_0x39ea9c)['toString'](_0xb3e7('0x41')))},'json':!![]};rp(_0x5a76c2)[_0xb3e7('0x14')](function(_0x56d172){var _0x17a716={'messageId':_0x56d172[_0xb3e7('0x4b')][0x0]};return _0x3c89f0[_0xb3e7('0x15')](_0x17a716);})['catch'](function(_0x36ce36){logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x4c'),util[_0xb3e7('0x36')](_0x36ce36,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb3e7('0x28'),'afterCreate',_0xb3e7('0x4c'),_0xb3e7('0x4d'));}break;case _0xb3e7('0x4e'):if(_0x433b4a['username']&&_0x433b4a[_0xb3e7('0x2d')]){if(_0x433b4a[_0xb3e7('0x4f')]){var _0x50c1f8={'method':'POST','uri':_0x433b4a['baseUrl']+_0xb3e7('0x50'),'body':{'username':_0x433b4a[_0xb3e7('0x2c')],'password':_0x433b4a[_0xb3e7('0x2d')]},'json':!![]};return rp(_0x50c1f8)[_0xb3e7('0x14')](function(_0x191843){var _0xf034dd={'method':_0xb3e7('0x31'),'uri':_0x433b4a[_0xb3e7('0x4f')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x433b4a[_0xb3e7('0x1e')],'destinations':[{'to':_0x233c97[_0xb3e7('0x1e')]}],'text':_0x233c97['body'],'notifyUrl':_0x433b4a[_0xb3e7('0x22')]+_0xb3e7('0x23')+_0x233c97['id']+_0xb3e7('0x24')+_0x433b4a[_0xb3e7('0x25')],'notifyContentType':_0xb3e7('0x51'),'callbackData':_0x433b4a[_0xb3e7('0x1e')]+';'+_0x233c97['body']}]},'headers':{'Authorization':_0xb3e7('0x52')+_0x191843['token']},'json':!![]};return rp(_0xf034dd)[_0xb3e7('0x14')](function(_0xa37059){if(_0xa37059['messages']){var _0x296d95={'messageId':_0xa37059[_0xb3e7('0x20')][0x0]['messageId']};if(!_0x433b4a[_0xb3e7('0x34')]){_0x296d95['read']=!![];}return _0x3c89f0[_0xb3e7('0x15')](_0x296d95);}else{return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x4e'),util[_0xb3e7('0x36')](_0xa37059,{'showHidden':![],'depth':null}));}});})[_0xb3e7('0x17')](function(_0x37ca95){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),'infobip',util[_0xb3e7('0x36')](_0x37ca95,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x4e'),_0xb3e7('0x53'));}}else{logger[_0xb3e7('0x27')](_0xb3e7('0x28'),'afterCreate',_0xb3e7('0x4e'),_0xb3e7('0x47'));}break;case _0xb3e7('0x54'):var _0x43586b=require(_0xb3e7('0x55'));if(_0x433b4a['apiKey']){var _0x47bb06={};_0x47bb06[_0xb3e7('0x56')]=_0x433b4a[_0xb3e7('0x2c')];_0x47bb06[_0xb3e7('0x1e')]=_0x233c97['phone'];_0x47bb06[_0xb3e7('0x57')]=_0x433b4a[_0xb3e7('0x1e')];_0x47bb06[_0xb3e7('0x58')]=_0x233c97[_0xb3e7('0x8')];_0x47bb06[_0xb3e7('0x59')]=+new Date();var _0x34fc88='';var _0x1bd64b='';var _0x45b67d=Object[_0xb3e7('0x5a')](_0x47bb06);_0x45b67d['sort']();for(var _0x5c2e8c=0x0;_0x5c2e8c<_0x45b67d[_0xb3e7('0x5b')];_0x5c2e8c++){if(_0x34fc88!=''){_0x34fc88+='&';}_0x34fc88+=_0x45b67d[_0x5c2e8c]+'='+encodeURIComponent(_0x47bb06[_0x45b67d[_0x5c2e8c]]);_0x1bd64b+=_0x47bb06[_0x45b67d[_0x5c2e8c]];}_0x1bd64b+=_0x433b4a[_0xb3e7('0x5c')];_0x1bd64b=_0x43586b[_0xb3e7('0x5d')]('md5')[_0xb3e7('0x15')](_0x1bd64b)[_0xb3e7('0x5e')](_0xb3e7('0x5f'));if(_0x34fc88!==''){_0x34fc88+='&';}_0x34fc88+='signature='+_0x1bd64b;var _0x244881={'method':_0xb3e7('0x60'),'uri':_0xb3e7('0x61')+_0x34fc88,'json':!![]};return rp(_0x244881)[_0xb3e7('0x14')](function(_0x54396a){var _0xba3b28=Object['keys'](_0x54396a);if(_0x54396a[_0xba3b28[0x0]][_0xb3e7('0x27')]&&parseInt(_0x54396a[_0xba3b28[0x0]][_0xb3e7('0x27')])===0x0){var _0x29180d={'messageId':_0x54396a[_0xba3b28[0x0]][_0xb3e7('0x62')]};if(!_0x433b4a[_0xb3e7('0x34')]){_0x29180d['read']=!![];}return _0x3c89f0[_0xb3e7('0x15')](_0x29180d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),'csc',util[_0xb3e7('0x36')](_0x54396a[_0xb3e7('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x54fee4){return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x54'),util[_0xb3e7('0x36')](_0x54fee4,{'showHidden':![],'depth':null}));});}else{logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x54'),'Missing\x20parameters:\x20apiKey');}break;case _0xb3e7('0x63'):if(_0x433b4a['apiKey']){var _0x596fac={'method':'POST','uri':_0xb3e7('0x64'),'headers':{'Authorization':_0x433b4a[_0xb3e7('0x5c')]},'body':{'content':_0x233c97[_0xb3e7('0x8')],'to':[_0x233c97[_0xb3e7('0x1e')]],'from':_0x433b4a['phone'],'binary':![],'clientMessageId':_0xb3e7('0x65'),'charset':_0xb3e7('0x66')},'json':!![]};rp(_0x596fac)[_0xb3e7('0x14')](function(_0xb11093){if(!_0xb11093[_0xb3e7('0x27')]){var _0x28a5e2={'messageId':_0xb11093['messages'][0x0][_0xb3e7('0x67')]};if(!_0x433b4a[_0xb3e7('0x34')]){_0x28a5e2[_0xb3e7('0x35')]=!![];}return _0x3c89f0['update'](_0x28a5e2);}else{return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),'afterCreate',_0xb3e7('0x63'),util[_0xb3e7('0x36')](_0xb11093[_0xb3e7('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x28df2b){return logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x63'),util[_0xb3e7('0x36')](_0x28df2b,{'showHidden':![],'depth':null}));});}else{logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x63'),_0xb3e7('0x68'));}break;case _0xb3e7('0x69'):if(_0x433b4a[_0xb3e7('0x5c')]){var _0x176c95={};var _0x244881={'method':_0xb3e7('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xb3e7('0x6a')+_0x433b4a['apiKey'],'Content-Type':_0xb3e7('0x51')},'body':{'from':_0x433b4a[_0xb3e7('0x1e')],'to':_0x233c97[_0xb3e7('0x1e')],'text':_0x233c97[_0xb3e7('0x8')]},'json':!![]};return rp(_0x244881)[_0xb3e7('0x14')](function(_0x4c3137){if(_0x4c3137[_0xb3e7('0x6b')]==0xca){_0x176c95['message']=_0x4c3137;var _0x3c768f={'method':_0xb3e7('0x31'),'uri':_0xb3e7('0x6c'),'headers':{'Authorization':_0xb3e7('0x6a')+_0x433b4a[_0xb3e7('0x5c')],'Content-Type':_0xb3e7('0x51')},'body':{'refid':_0x176c95['message']['refid']},'json':!![]};return rp(_0x3c768f)[_0xb3e7('0x14')](function(_0x32ca23){_0x176c95[_0xb3e7('0x6d')]=_0x32ca23;var _0x5d9a07={'messageId':_0x176c95[_0xb3e7('0x6e')][_0xb3e7('0x6f')],'read':!![]};return _0x3c89f0[_0xb3e7('0x15')](_0x5d9a07);});}else{return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),'afterCreate','intelepeer',util[_0xb3e7('0x36')](_0x4c3137,{'showHidden':![],'depth':null}));}})[_0xb3e7('0x17')](function(_0x302275){return logger[_0xb3e7('0x27')](_0xb3e7('0x28'),_0xb3e7('0x29'),_0xb3e7('0x69'),util[_0xb3e7('0x36')](_0x302275,{'showHidden':![],'depth':null}));});}else{return logger[_0xb3e7('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb3e7('0x29'),_0xb3e7('0x69'),'Token\x20not\x20received');}break;}}})[_0xb3e7('0x70')](function(){_0x212c18();});}else{_0x212c18();}}},'charset':_0xb3e7('0x71'),'collate':_0xb3e7('0x72')});}; \ No newline at end of file +var _0xa927=['Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','crypto','apiKey','login','sender','text','keys','sort','length','md5','digest','hex','https://sms.csc.lv/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','application/json','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','out','find','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','username','&password=','GET','split','sms','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa927,0x113));var _0x7a92=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa927[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a92('0x0'))('api');var moment=require(_0x7a92('0x1'));var BPromise=require(_0x7a92('0x2'));var rp=require(_0x7a92('0x3'));var fs=require('fs');var path=require(_0x7a92('0x4'));var rimraf=require(_0x7a92('0x5'));var config=require(_0x7a92('0x6'));var attributes=require(_0x7a92('0x7'));module[_0x7a92('0x8')]=function(_0x219945,_0x4b5934){return _0x219945[_0x7a92('0x9')](_0x7a92('0xa'),attributes,{'tableName':_0x7a92('0xb'),'paranoid':![],'indexes':[{'name':_0x7a92('0xc'),'fields':[_0x7a92('0xc')]},{'name':_0x7a92('0xd'),'fields':[_0x7a92('0xe')],'type':_0x7a92('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42cdb6,_0x68828a,_0x280406){var _0x10dbcf=_0x219945[_0x7a92('0x10')];var _0x457c03=_0x42cdb6['get']({'plain':!![]});if(_0x457c03[_0x7a92('0x11')][_0x7a92('0x12')]()==='in'||_0x457c03['direction']['toLowerCase']()==='out'&&!_0x457c03[_0x7a92('0x13')]&&!_[_0x7a92('0x14')](_0x457c03[_0x7a92('0x15')])){_0x10dbcf[_0x7a92('0x16')]['findOne']({'where':{'id':_0x457c03[_0x7a92('0x17')]}})[_0x7a92('0x18')](function(_0x43852d){if(_0x43852d){_0x43852d[_0x7a92('0x19')]({'lastMsgAt':_0x457c03[_0x7a92('0x1a')],'lastMsgDirection':_0x457c03[_0x7a92('0x11')][_0x7a92('0x12')]()});}})[_0x7a92('0x1b')](function(_0x27af4e){console[_0x7a92('0x1c')](_0x27af4e);});}if(_0x457c03['direction']===_0x7a92('0x1d')&&!_0x457c03[_0x7a92('0x13')]){var _0x3d0c47;_0x10dbcf['SmsAccount'][_0x7a92('0x1e')]({'where':{'id':_0x457c03['SmsAccountId']},'raw':!![]})[_0x7a92('0x18')](function(_0x11f0af){_0x3d0c47=_0x11f0af;if(_0x3d0c47&&_0x3d0c47[_0x7a92('0x1f')]){switch(_0x3d0c47[_0x7a92('0x1f')]){case _0x7a92('0x20'):var _0x3bdfb3=require(_0x7a92('0x20'));if(_0x3d0c47[_0x7a92('0x21')]&&_0x3d0c47[_0x7a92('0x22')]&&_0x3d0c47['phone']){var _0x1780ea=new _0x3bdfb3(_0x3d0c47[_0x7a92('0x21')],_0x3d0c47[_0x7a92('0x22')]);_0x1780ea[_0x7a92('0x23')][_0x7a92('0x24')]({'body':_0x457c03['body'],'to':_0x457c03['phone'],'from':_0x3d0c47[_0x7a92('0x25')],'statusCallback':_0x3d0c47[_0x7a92('0x26')]+_0x7a92('0x27')+_0x457c03['id']+_0x7a92('0x28')+_0x3d0c47['token']})['then'](function(_0x276eb5){if(_0x276eb5[_0x7a92('0x29')]){return _0x42cdb6[_0x7a92('0x19')]({'messageId':_0x276eb5[_0x7a92('0x29')]});}})[_0x7a92('0x1b')](function(_0x548b5f){logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x20'),util[_0x7a92('0x2c')](_0x548b5f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),_0x7a92('0x20'),_0x7a92('0x2d'));}break;case _0x7a92('0x2e'):var _0x474f50='https://api.skebby.it/API/v1.0/REST/';if(_0x3d0c47['username']&&_0x3d0c47[_0x7a92('0x2f')]){var _0x168840={'recipient':[_0x457c03[_0x7a92('0x25')]],'message':_0x457c03[_0x7a92('0xe')],'message_type':_0x3d0c47[_0x7a92('0x30')]};var _0x52cfb1={'url':_0x474f50+'login?username='+_0x3d0c47[_0x7a92('0x31')]+_0x7a92('0x32')+_0x3d0c47[_0x7a92('0x2f')],'method':_0x7a92('0x33')};rp(_0x52cfb1)[_0x7a92('0x18')](function(_0x2a993b){var _0x3be5fc=_0x2a993b[_0x7a92('0x34')](';');var _0x6cac3a={'user_key':_0x3be5fc[0x0],'session_key':_0x3be5fc[0x1]};_0x52cfb1={'url':_0x474f50+_0x7a92('0x35'),'method':'POST','headers':{'user_key':_0x6cac3a[_0x7a92('0x36')],'Session_key':_0x6cac3a['session_key']},'json':!![],'body':_0x168840};return rp(_0x52cfb1);})['then'](function(_0x4df552){if(_0x4df552[_0x7a92('0x37')]>=0x1){var _0x37a1fd={'messageId':_0x4df552[_0x7a92('0x38')]};if(_0x3d0c47[_0x7a92('0x30')]!=='GP'||!_0x3d0c47[_0x7a92('0x39')]){_0x37a1fd[_0x7a92('0x3a')]=!![];}return _0x42cdb6[_0x7a92('0x19')](_0x37a1fd);}else{return logger['error'](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x2e'),util['inspect'](_0x4df552,{'showHidden':![],'depth':null}));}})[_0x7a92('0x1b')](function(_0x1d9b57){return logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),'skebby',util['inspect'](_0x1d9b57,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x2e'),_0x7a92('0x3b'));}break;case _0x7a92('0x3c'):if(_0x3d0c47[_0x7a92('0x22')]){var _0x1ff30b={'recipient':_0x457c03[_0x7a92('0x25')],'message':_0x457c03[_0x7a92('0xe')],'sender':_0x3d0c47[_0x7a92('0x3d')]||_0x3d0c47[_0x7a92('0x25')],'authorization':_0x3d0c47[_0x7a92('0x22')]};var _0x68828a={'method':'POST','uri':'https://smsapi.connectel.se/api/send/','body':_0x1ff30b,'json':!![]};rp(_0x68828a)[_0x7a92('0x18')](function(_0x33b23c){var _0x47d8a0={'messageId':_0x33b23c[_0x7a92('0x3e')]};if(!_0x3d0c47[_0x7a92('0x39')]){_0x47d8a0[_0x7a92('0x3a')]=!![];}return _0x42cdb6['update'](_0x47d8a0);})['catch'](function(_0x50ed57){logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),_0x7a92('0x3c'),util[_0x7a92('0x2c')](_0x50ed57,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x7a92('0x3f'));}break;case _0x7a92('0x40'):if(_0x3d0c47[_0x7a92('0x31')]&&_0x3d0c47['password']){var _0x1ff30b={'messages':[{'source':_0x7a92('0x41'),'to':_0x457c03[_0x7a92('0x25')],'body':_0x457c03[_0x7a92('0xe')],'from':_0x3d0c47[_0x7a92('0x3d')]||_0x3d0c47[_0x7a92('0x25')]}]};var _0x5b0456=util[_0x7a92('0x42')](_0x7a92('0x43'),_0x3d0c47['username'],_0x3d0c47[_0x7a92('0x2f')]);var _0x68828a={'method':_0x7a92('0x44'),'uri':_0x7a92('0x45'),'body':_0x1ff30b,'headers':{'Authorization':util[_0x7a92('0x42')](_0x7a92('0x46'),new Buffer(_0x5b0456)[_0x7a92('0x47')]('base64'))},'json':!![]};rp(_0x68828a)['then'](function(_0xf5779e){if(_0xf5779e[_0x7a92('0x48')]>=0xc8&&_0xf5779e[_0x7a92('0x48')]<=0xce){if(_0xf5779e[_0x7a92('0x49')]&&_0xf5779e[_0x7a92('0x49')][_0x7a92('0x4a')]>0x0){var _0x22f664=_['head'](_0xf5779e[_0x7a92('0x49')]['messages']);var _0xc6b26e={'messageId':_0x22f664[_0x7a92('0x4b')]};if(!_0x3d0c47['deliveryReport']){_0xc6b26e[_0x7a92('0x3a')]=!![];}return _0x42cdb6[_0x7a92('0x19')](_0xc6b26e);}else{logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),'clickSend',util[_0x7a92('0x2c')](_0xf5779e,{'showHidden':![],'depth':null}));}}else{logger[_0x7a92('0x1c')](_0x7a92('0x2a'),'afterCreate',_0x7a92('0x4c'),util['inspect'](_0xf5779e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x342529){logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x4c'),util[_0x7a92('0x2c')](_0x342529,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),'clickSend',_0x7a92('0x3b'));}break;case _0x7a92('0x4d'):if(_0x3d0c47[_0x7a92('0x4e')]&&_0x3d0c47[_0x7a92('0x22')]){var _0x1ff30b={'dst':_0x457c03[_0x7a92('0x25')],'text':_0x457c03[_0x7a92('0xe')],'src':_0x3d0c47['senderString']||_0x3d0c47['phone'],'url':_0x3d0c47[_0x7a92('0x26')]+_0x7a92('0x27')+_0x457c03['id']+'/status?token='+_0x3d0c47['token']};var _0x5b0456=util[_0x7a92('0x42')](_0x7a92('0x43'),_0x3d0c47['authId'],_0x3d0c47['authToken']);var _0x68828a={'method':_0x7a92('0x44'),'uri':util[_0x7a92('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3d0c47[_0x7a92('0x4e')]),'body':_0x1ff30b,'headers':{'Authorization':util[_0x7a92('0x42')]('Basic\x20%s',new Buffer(_0x5b0456)[_0x7a92('0x47')]('base64'))},'json':!![]};rp(_0x68828a)[_0x7a92('0x18')](function(_0x554c6b){var _0x3102fd={'messageId':_0x554c6b['message_uuid'][0x0]};return _0x42cdb6[_0x7a92('0x19')](_0x3102fd);})['catch'](function(_0x29e60e){logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),_0x7a92('0x4d'),util[_0x7a92('0x2c')](_0x29e60e,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0x7a92('0x4f'));}break;case _0x7a92('0x50'):if(_0x3d0c47[_0x7a92('0x31')]&&_0x3d0c47['password']){if(_0x3d0c47[_0x7a92('0x51')]){var _0x3ed116={'method':_0x7a92('0x44'),'uri':_0x3d0c47[_0x7a92('0x51')]+_0x7a92('0x52'),'body':{'username':_0x3d0c47['username'],'password':_0x3d0c47[_0x7a92('0x2f')]},'json':!![]};return rp(_0x3ed116)[_0x7a92('0x18')](function(_0x187066){var _0x5b7f64={'method':_0x7a92('0x44'),'uri':_0x3d0c47[_0x7a92('0x51')]+_0x7a92('0x53'),'body':{'messages':[{'from':_0x3d0c47[_0x7a92('0x25')],'destinations':[{'to':_0x457c03[_0x7a92('0x25')]}],'text':_0x457c03[_0x7a92('0xe')],'notifyUrl':_0x3d0c47[_0x7a92('0x26')]+_0x7a92('0x27')+_0x457c03['id']+_0x7a92('0x28')+_0x3d0c47[_0x7a92('0x54')],'notifyContentType':'application/json','callbackData':_0x3d0c47['phone']+';'+_0x457c03[_0x7a92('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x187066[_0x7a92('0x54')]},'json':!![]};return rp(_0x5b7f64)['then'](function(_0x57495a){if(_0x57495a['messages']){var _0x3dca8a={'messageId':_0x57495a[_0x7a92('0x23')][0x0][_0x7a92('0xc')]};if(!_0x3d0c47[_0x7a92('0x39')]){_0x3dca8a[_0x7a92('0x3a')]=!![];}return _0x42cdb6[_0x7a92('0x19')](_0x3dca8a);}else{return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x50'),util[_0x7a92('0x2c')](_0x57495a,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5274d9){return logger['error'](_0x7a92('0x2a'),'afterCreate','infobip',util[_0x7a92('0x2c')](_0x5274d9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x7a92('0x2a'),'afterCreate',_0x7a92('0x50'),_0x7a92('0x3b'));}break;case'csc':var _0x13c38b=require(_0x7a92('0x55'));if(_0x3d0c47[_0x7a92('0x56')]){var _0x270f3a={};_0x270f3a[_0x7a92('0x57')]=_0x3d0c47[_0x7a92('0x31')];_0x270f3a[_0x7a92('0x25')]=_0x457c03[_0x7a92('0x25')];_0x270f3a[_0x7a92('0x58')]=_0x3d0c47['phone'];_0x270f3a[_0x7a92('0x59')]=_0x457c03['body'];_0x270f3a['timestamp']=+new Date();var _0xfe3301='';var _0x4400a0='';var _0x11bad9=Object[_0x7a92('0x5a')](_0x270f3a);_0x11bad9[_0x7a92('0x5b')]();for(var _0x19c2b0=0x0;_0x19c2b0<_0x11bad9[_0x7a92('0x5c')];_0x19c2b0++){if(_0xfe3301!=''){_0xfe3301+='&';}_0xfe3301+=_0x11bad9[_0x19c2b0]+'='+encodeURIComponent(_0x270f3a[_0x11bad9[_0x19c2b0]]);_0x4400a0+=_0x270f3a[_0x11bad9[_0x19c2b0]];}_0x4400a0+=_0x3d0c47[_0x7a92('0x56')];_0x4400a0=_0x13c38b['createHash'](_0x7a92('0x5d'))[_0x7a92('0x19')](_0x4400a0)[_0x7a92('0x5e')](_0x7a92('0x5f'));if(_0xfe3301!==''){_0xfe3301+='&';}_0xfe3301+='signature='+_0x4400a0;var _0x52cfb1={'method':_0x7a92('0x33'),'uri':_0x7a92('0x60')+_0xfe3301,'json':!![]};return rp(_0x52cfb1)[_0x7a92('0x18')](function(_0x11a1bd){var _0x247c25=Object['keys'](_0x11a1bd);if(_0x11a1bd[_0x247c25[0x0]]['error']&&parseInt(_0x11a1bd[_0x247c25[0x0]][_0x7a92('0x1c')])===0x0){var _0x51f4df={'messageId':_0x11a1bd[_0x247c25[0x0]][_0x7a92('0x61')]};if(!_0x3d0c47[_0x7a92('0x39')]){_0x51f4df['read']=!![];}return _0x42cdb6[_0x7a92('0x19')](_0x51f4df);}else{return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x62'),util['inspect'](_0x11a1bd[_0x7a92('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x47f691){return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x62'),util[_0x7a92('0x2c')](_0x47f691,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')](_0x7a92('0x2a'),'afterCreate',_0x7a92('0x62'),_0x7a92('0x63'));}break;case'clickatell':if(_0x3d0c47[_0x7a92('0x56')]){var _0x592675={'method':_0x7a92('0x44'),'uri':_0x7a92('0x64'),'headers':{'Authorization':_0x3d0c47[_0x7a92('0x56')]},'body':{'content':_0x457c03['body'],'to':[_0x457c03[_0x7a92('0x25')]],'from':_0x3d0c47[_0x7a92('0x25')],'binary':![],'clientMessageId':_0x7a92('0x65'),'charset':_0x7a92('0x66')},'json':!![]};rp(_0x592675)[_0x7a92('0x18')](function(_0x4bbecc){if(!_0x4bbecc[_0x7a92('0x1c')]){var _0x5558bd={'messageId':_0x4bbecc[_0x7a92('0x23')][0x0][_0x7a92('0x67')]};if(!_0x3d0c47[_0x7a92('0x39')]){_0x5558bd['read']=!![];}return _0x42cdb6[_0x7a92('0x19')](_0x5558bd);}else{return logger['error'](_0x7a92('0x2a'),_0x7a92('0x2b'),'clickatell',util[_0x7a92('0x2c')](_0x4bbecc[_0x7a92('0x1c')],{'showHidden':![],'depth':null}));}})[_0x7a92('0x1b')](function(_0x5ced62){return logger[_0x7a92('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7a92('0x2b'),_0x7a92('0x68'),util[_0x7a92('0x2c')](_0x5ced62,{'showHidden':![],'depth':null}));});}else{logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0x3d0c47[_0x7a92('0x56')]){var _0x4052ea={};var _0x52cfb1={'method':_0x7a92('0x44'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x3d0c47[_0x7a92('0x56')],'Content-Type':'application/json'},'body':{'from':_0x3d0c47['phone'],'to':_0x457c03[_0x7a92('0x25')],'text':_0x457c03[_0x7a92('0xe')]},'json':!![]};return rp(_0x52cfb1)[_0x7a92('0x18')](function(_0x16995e){if(_0x16995e['code']==0xca){_0x4052ea[_0x7a92('0x69')]=_0x16995e;var _0x333359={'method':_0x7a92('0x44'),'uri':_0x7a92('0x6a'),'headers':{'Authorization':_0x7a92('0x6b')+_0x3d0c47[_0x7a92('0x56')],'Content-Type':_0x7a92('0x6c')},'body':{'refid':_0x4052ea[_0x7a92('0x69')][_0x7a92('0x6d')]},'json':!![]};return rp(_0x333359)[_0x7a92('0x18')](function(_0x468c70){_0x4052ea[_0x7a92('0x6e')]=_0x468c70;var _0x327a99={'messageId':_0x4052ea[_0x7a92('0x69')][_0x7a92('0x6d')],'read':!![]};return _0x42cdb6[_0x7a92('0x19')](_0x327a99);});}else{return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),'intelepeer',util[_0x7a92('0x2c')](_0x16995e,{'showHidden':![],'depth':null}));}})[_0x7a92('0x1b')](function(_0x47ccad){return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x6f'),util[_0x7a92('0x2c')](_0x47ccad,{'showHidden':![],'depth':null}));});}else{return logger[_0x7a92('0x1c')](_0x7a92('0x2a'),_0x7a92('0x2b'),_0x7a92('0x6f'),_0x7a92('0x70'));}break;}}})['finally'](function(){_0x280406();});}else{_0x280406();}}},'charset':_0x7a92('0x71'),'collate':_0x7a92('0x72')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f5ce6aa..759fb94 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 _0x0ae5=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage'];(function(_0x186550,_0x26f3ee){var _0x4b4c70=function(_0x2e255e){while(--_0x2e255e){_0x186550['push'](_0x186550['shift']());}};_0x4b4c70(++_0x26f3ee);}(_0x0ae5,0x1ad));var _0x50ae=function(_0xa338ce,_0x428cc3){_0xa338ce=_0xa338ce-0x0;var _0x2ee7d1=_0x0ae5[_0xa338ce];return _0x2ee7d1;};'use strict';var _=require(_0x50ae('0x0'));var util=require(_0x50ae('0x1'));var moment=require(_0x50ae('0x2'));var BPromise=require(_0x50ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50ae('0x4'));var db=require(_0x50ae('0x5'))['db'];var utils=require(_0x50ae('0x6'));var logger=require(_0x50ae('0x7'))(_0x50ae('0x8'));var config=require(_0x50ae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x50ae('0xa')]['http']({'port':0x232a});config[_0x50ae('0xb')]=_[_0x50ae('0xc')](config[_0x50ae('0xb')],{'host':_0x50ae('0xd'),'port':0x18eb});var socket=require(_0x50ae('0xe'))(new Redis(config[_0x50ae('0xb')]));require(_0x50ae('0xf'))[_0x50ae('0x10')](socket);function respondWithRpcPromise(_0x2fb301,_0x16155b,_0x5efe6d){return new BPromise(function(_0x1176f5,_0x2e6fdf){return client['request'](_0x2fb301,_0x5efe6d)[_0x50ae('0x11')](function(_0x181633){logger[_0x50ae('0x12')](_0x50ae('0x13'),_0x16155b,_0x50ae('0x14'));logger[_0x50ae('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x16155b,_0x50ae('0x14'),JSON['stringify'](_0x181633));if(_0x181633[_0x50ae('0x16')]){if(_0x181633[_0x50ae('0x16')][_0x50ae('0x17')]===0x1f4){logger['error'](_0x50ae('0x13'),_0x16155b,_0x181633[_0x50ae('0x16')]['message']);return _0x2e6fdf(_0x181633['error'][_0x50ae('0x18')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x16155b,_0x181633['error'][_0x50ae('0x18')]);return _0x1176f5(_0x181633[_0x50ae('0x16')][_0x50ae('0x18')]);}else{logger[_0x50ae('0x12')](_0x50ae('0x13'),_0x16155b,_0x50ae('0x14'));_0x1176f5(_0x181633[_0x50ae('0x19')]['message']);}})[_0x50ae('0x1a')](function(_0x376d02){logger[_0x50ae('0x16')](_0x50ae('0x13'),_0x16155b,_0x376d02);_0x2e6fdf(_0x376d02);});});}exports['CreateSmsMessage']=function(_0x34510e){var _0x5d6945=this;return new Promise(function(_0xa902d8,_0x4312c4){return db[_0x50ae('0x1b')][_0x50ae('0x1c')](_0x34510e[_0x50ae('0x1d')],{'raw':_0x34510e[_0x50ae('0x1e')]?_0x34510e[_0x50ae('0x1e')][_0x50ae('0x1f')]===undefined?!![]:![]:!![]})[_0x50ae('0x11')](function(_0x36c617){logger['info'](_0x50ae('0x20'),_0x34510e);logger['debug'](_0x50ae('0x20'),_0x34510e,JSON['stringify'](_0x36c617));_0xa902d8(_0x36c617);})['catch'](function(_0x2d76e7){logger[_0x50ae('0x16')](_0x50ae('0x20'),_0x2d76e7[_0x50ae('0x18')],_0x34510e);_0x4312c4(_0x5d6945[_0x50ae('0x16')](0x1f4,_0x2d76e7[_0x50ae('0x18')]));});});}; \ No newline at end of file +var _0x9f58=['create','body','options','raw','debug','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x2e34cc,_0x41c060){var _0x2abce6=function(_0x50d415){while(--_0x50d415){_0x2e34cc['push'](_0x2e34cc['shift']());}};_0x2abce6(++_0x41c060);}(_0x9f58,0x185));var _0x89f5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9f58[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x89f5('0x0'));var moment=require(_0x89f5('0x1'));var BPromise=require(_0x89f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89f5('0x4'))(_0x89f5('0x5'));var config=require('../../config/environment');var jayson=require(_0x89f5('0x6'));var client=jayson[_0x89f5('0x7')]['http']({'port':0x232a});config[_0x89f5('0x8')]=_[_0x89f5('0x9')](config[_0x89f5('0x8')],{'host':_0x89f5('0xa'),'port':0x18eb});var socket=require(_0x89f5('0xb'))(new Redis(config[_0x89f5('0x8')]));require('./smsMessage.socket')[_0x89f5('0xc')](socket);function respondWithRpcPromise(_0x25251a,_0x1d9ac4,_0x4c4283){return new BPromise(function(_0x1d75b3,_0x162f5b){return client[_0x89f5('0xd')](_0x25251a,_0x4c4283)[_0x89f5('0xe')](function(_0x2363e5){logger['info'](_0x89f5('0xf'),_0x1d9ac4,_0x89f5('0x10'));logger['debug'](_0x89f5('0x11'),_0x1d9ac4,_0x89f5('0x10'),JSON[_0x89f5('0x12')](_0x2363e5));if(_0x2363e5[_0x89f5('0x13')]){if(_0x2363e5['error'][_0x89f5('0x14')]===0x1f4){logger[_0x89f5('0x13')](_0x89f5('0xf'),_0x1d9ac4,_0x2363e5[_0x89f5('0x13')][_0x89f5('0x15')]);return _0x162f5b(_0x2363e5[_0x89f5('0x13')][_0x89f5('0x15')]);}logger['error'](_0x89f5('0xf'),_0x1d9ac4,_0x2363e5[_0x89f5('0x13')][_0x89f5('0x15')]);return _0x1d75b3(_0x2363e5[_0x89f5('0x13')]['message']);}else{logger[_0x89f5('0x16')](_0x89f5('0xf'),_0x1d9ac4,_0x89f5('0x10'));_0x1d75b3(_0x2363e5[_0x89f5('0x17')][_0x89f5('0x15')]);}})[_0x89f5('0x18')](function(_0x1b7096){logger[_0x89f5('0x13')](_0x89f5('0xf'),_0x1d9ac4,_0x1b7096);_0x162f5b(_0x1b7096);});});}exports[_0x89f5('0x19')]=function(_0x27ba16){var _0x3148b7=this;return new Promise(function(_0x443bac,_0x3b5021){return db[_0x89f5('0x1a')][_0x89f5('0x1b')](_0x27ba16[_0x89f5('0x1c')],{'raw':_0x27ba16[_0x89f5('0x1d')]?_0x27ba16[_0x89f5('0x1d')][_0x89f5('0x1e')]===undefined?!![]:![]:!![]})[_0x89f5('0xe')](function(_0x4c11c5){logger['info'](_0x89f5('0x19'),_0x27ba16);logger[_0x89f5('0x1f')](_0x89f5('0x19'),_0x27ba16,JSON[_0x89f5('0x12')](_0x4c11c5));_0x443bac(_0x4c11c5);})['catch'](function(_0x148897){logger[_0x89f5('0x13')](_0x89f5('0x19'),_0x148897['message'],_0x27ba16);_0x3b5021(_0x3148b7[_0x89f5('0x13')](0x1f4,_0x148897[_0x89f5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9e47430..5b6e919 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 _0x2b65=['removeListener','length','smsMessage:','save','remove','update','emit'];(function(_0x325190,_0x3b1a46){var _0x2f075e=function(_0x2f207a){while(--_0x2f207a){_0x325190['push'](_0x325190['shift']());}};_0x2f075e(++_0x3b1a46);}(_0x2b65,0x122));var _0x52b6=function(_0x5285d0,_0x3d424c){_0x5285d0=_0x5285d0-0x0;var _0x4dd0a2=_0x2b65[_0x5285d0];return _0x4dd0a2;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x52b6('0x0'),_0x52b6('0x1'),_0x52b6('0x2')];function createListener(_0x5b3650,_0x692c1f){return function(_0x255c21){_0x692c1f[_0x52b6('0x3')](_0x5b3650,_0x255c21);};}function removeListener(_0x2b1456,_0x4ceb2f){return function(){SmsMessageEvents[_0x52b6('0x4')](_0x2b1456,_0x4ceb2f);};}exports['register']=function(_0x224897){for(var _0x27fbf2=0x0,_0xeb630f=events[_0x52b6('0x5')];_0x27fbf2<_0xeb630f;_0x27fbf2++){var _0x95870c=events[_0x27fbf2];var _0x22e6cf=createListener(_0x52b6('0x6')+_0x95870c,_0x224897);SmsMessageEvents['on'](_0x95870c,_0x22e6cf);}}; \ No newline at end of file +var _0x6400=['removeListener','register','length','./smsMessage.events','save','remove','update','emit'];(function(_0x7faa11,_0x419d96){var _0x2d9384=function(_0x5124c8){while(--_0x5124c8){_0x7faa11['push'](_0x7faa11['shift']());}};_0x2d9384(++_0x419d96);}(_0x6400,0x1bb));var _0x0640=function(_0x4fdd16,_0x3174cb){_0x4fdd16=_0x4fdd16-0x0;var _0x553370=_0x6400[_0x4fdd16];return _0x553370;};'use strict';var SmsMessageEvents=require(_0x0640('0x0'));var events=[_0x0640('0x1'),_0x0640('0x2'),_0x0640('0x3')];function createListener(_0x15421b,_0x4882d2){return function(_0x499ace){_0x4882d2[_0x0640('0x4')](_0x15421b,_0x499ace);};}function removeListener(_0x51d6df,_0x24397a){return function(){SmsMessageEvents[_0x0640('0x5')](_0x51d6df,_0x24397a);};}exports[_0x0640('0x6')]=function(_0x56f242){for(var _0x2ce2e8=0x0,_0x4bd01a=events[_0x0640('0x7')];_0x2ce2e8<_0x4bd01a;_0x2ce2e8++){var _0x31bd2c=events[_0x2ce2e8];var _0x429057=createListener('smsMessage:'+_0x31bd2c,_0x56f242);SmsMessageEvents['on'](_0x31bd2c,_0x429057);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 56e91f7..8d49819 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 _0xb658=['get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','./smsQueue.controller'];(function(_0x3beea0,_0x416691){var _0x314eb1=function(_0x937185){while(--_0x937185){_0x3beea0['push'](_0x3beea0['shift']());}};_0x314eb1(++_0x416691);}(_0xb658,0x14b));var _0x8b65=function(_0x5cffdf,_0x21ff2b){_0x5cffdf=_0x5cffdf-0x0;var _0x256d46=_0xb658[_0x5cffdf];return _0x256d46;};'use strict';var multer=require(_0x8b65('0x0'));var util=require(_0x8b65('0x1'));var path=require(_0x8b65('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b65('0x3'));var router=express[_0x8b65('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8b65('0x5'));var config=require('../../config/environment');var controller=require(_0x8b65('0x6'));router[_0x8b65('0x7')]('/',auth[_0x8b65('0x8')](),controller[_0x8b65('0x9')]);router[_0x8b65('0x7')](_0x8b65('0xa'),auth[_0x8b65('0x8')](),controller[_0x8b65('0xb')]);router['get'](_0x8b65('0xc'),auth[_0x8b65('0x8')](),controller[_0x8b65('0xd')]);router[_0x8b65('0x7')]('/:id/members',auth[_0x8b65('0x8')](),controller[_0x8b65('0xe')]);router['get'](_0x8b65('0xf'),auth['isAuthenticated'](),controller[_0x8b65('0x10')]);router[_0x8b65('0x7')](_0x8b65('0x11'),auth[_0x8b65('0x8')](),controller[_0x8b65('0x12')]);router['post']('/',auth[_0x8b65('0x8')](),controller['create']);router[_0x8b65('0x13')](_0x8b65('0xf'),auth['isAuthenticated'](),controller[_0x8b65('0x14')]);router[_0x8b65('0x13')](_0x8b65('0x11'),auth[_0x8b65('0x8')](),controller['addAgents']);router['put'](_0x8b65('0xc'),auth[_0x8b65('0x8')](),controller[_0x8b65('0x15')]);router[_0x8b65('0x16')](_0x8b65('0xc'),auth[_0x8b65('0x8')](),controller[_0x8b65('0x17')]);router[_0x8b65('0x16')](_0x8b65('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8b65('0x16')](_0x8b65('0x11'),auth[_0x8b65('0x8')](),controller[_0x8b65('0x18')]);module[_0x8b65('0x19')]=router; \ No newline at end of file +var _0xa0c3=['/:id/users','getAgents','create','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','/:id/teams','getTeams'];(function(_0x1d72d0,_0x89db32){var _0x234ae9=function(_0x4ae372){while(--_0x4ae372){_0x1d72d0['push'](_0x1d72d0['shift']());}};_0x234ae9(++_0x89db32);}(_0xa0c3,0x1ce));var _0x3a0c=function(_0x1362d9,_0x32e9d1){_0x1362d9=_0x1362d9-0x0;var _0x3afa1b=_0xa0c3[_0x1362d9];return _0x3afa1b;};'use strict';var multer=require(_0x3a0c('0x0'));var util=require(_0x3a0c('0x1'));var path=require(_0x3a0c('0x2'));var timeout=require(_0x3a0c('0x3'));var express=require(_0x3a0c('0x4'));var router=express[_0x3a0c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3a0c('0x6'));var config=require(_0x3a0c('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x9')]);router['get'](_0x3a0c('0xa'),auth['isAuthenticated'](),controller[_0x3a0c('0xb')]);router[_0x3a0c('0xc')](_0x3a0c('0xd'),auth[_0x3a0c('0x8')](),controller[_0x3a0c('0xe')]);router['get'](_0x3a0c('0xf'),auth[_0x3a0c('0x8')](),controller['getMembers']);router[_0x3a0c('0xc')](_0x3a0c('0x10'),auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x11')]);router[_0x3a0c('0xc')](_0x3a0c('0x12'),auth['isAuthenticated'](),controller[_0x3a0c('0x13')]);router['post']('/',auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x14')]);router[_0x3a0c('0x15')]('/:id/teams',auth[_0x3a0c('0x8')](),controller['addTeams']);router[_0x3a0c('0x15')](_0x3a0c('0x12'),auth['isAuthenticated'](),controller[_0x3a0c('0x16')]);router[_0x3a0c('0x17')]('/:id',auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x18')]);router[_0x3a0c('0x19')](_0x3a0c('0xd'),auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x1a')]);router[_0x3a0c('0x19')](_0x3a0c('0x10'),auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x1b')]);router[_0x3a0c('0x19')](_0x3a0c('0x12'),auth[_0x3a0c('0x8')](),controller[_0x3a0c('0x1c')]);module[_0x3a0c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index b731239..cbd5f7d 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 _0x0b52=['rrmemory','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3bb10b,_0x546bc2){var _0x19d91b=function(_0x28c784){while(--_0x28c784){_0x3bb10b['push'](_0x3bb10b['shift']());}};_0x19d91b(++_0x546bc2);}(_0x0b52,0xe8));var _0x20b5=function(_0x3c0c89,_0x4cc96a){_0x3c0c89=_0x3c0c89-0x0;var _0x139d10=_0x0b52[_0x3c0c89];return _0x139d10;};'use strict';var Sequelize=require(_0x20b5('0x0'));module[_0x20b5('0x1')]={'name':{'type':Sequelize[_0x20b5('0x2')],'unique':_0x20b5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20b5('0x2')]},'timeout':{'type':Sequelize[_0x20b5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20b5('0x5')](_0x20b5('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x7189=['ENUM','rrmemory','beepall','roundrobin','exports','name','STRING','INTEGER'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x7189,0x6c));var _0x9718=function(_0xd49d86,_0x426071){_0xd49d86=_0xd49d86-0x0;var _0x12cd0b=_0x7189[_0xd49d86];return _0x12cd0b;};'use strict';var Sequelize=require('sequelize');module[_0x9718('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9718('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9718('0x2')]},'timeout':{'type':Sequelize[_0x9718('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9718('0x4')](_0x9718('0x5'),_0x9718('0x6'),_0x9718('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 211bf9a..7f33ec1 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 _0x5ad3=['map','type','key','VIRTUAL','field','merge','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','user','UserProfileSection','autoAssociation','describe','UserSmsQueue','order','SmsQueueId','filter','User','UserId','agent','smsPause','createdAt','updatedAt','getTeams','findOne','Team','addTeams','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','Agents','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','userSmsQueue:remove','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','./smsQueue.socket','register','sendStatus','end','status','json','offset','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick'];(function(_0x23467a,_0x41c08a){var _0x14470f=function(_0x275e09){while(--_0x275e09){_0x23467a['push'](_0x23467a['shift']());}};_0x14470f(++_0x41c08a);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x2fc6cf,_0x2bb133){_0x2fc6cf=_0x2fc6cf-0x0;var _0xf2ade3=_0x5ad3[_0x2fc6cf];return _0xf2ade3;};'use strict';var pdf=require(_0x35ad('0x0'));var emlformat=require(_0x35ad('0x1'));var rimraf=require(_0x35ad('0x2'));var zipdir=require(_0x35ad('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35ad('0x4'));var moment=require(_0x35ad('0x5'));var BPromise=require(_0x35ad('0x6'));var Mustache=require(_0x35ad('0x7'));var util=require(_0x35ad('0x8'));var path=require(_0x35ad('0x9'));var sox=require(_0x35ad('0xa'));var csv=require(_0x35ad('0xb'));var ejs=require(_0x35ad('0xc'));var fs=require('fs');var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35ad('0x14'))(_0x35ad('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x35ad('0x16'))['db'];config[_0x35ad('0x17')]=_['defaults'](config[_0x35ad('0x17')],{'host':_0x35ad('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x35ad('0x19'))[_0x35ad('0x1a')](socket);function respondWithStatusCode(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xcc;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x1b')](_0x4b7ad9);}return _0x3cda5e['status'](_0x4b7ad9)[_0x35ad('0x1c')]();};}function respondWithResult(_0x4d5185,_0x4e3cd8){_0x4e3cd8=_0x4e3cd8||0xc8;return function(_0x3a981a){if(_0x3a981a){return _0x4d5185[_0x35ad('0x1d')](_0x4e3cd8)[_0x35ad('0x1e')](_0x3a981a);}};}function respondWithFilteredResult(_0x56cb8e,_0x2a87bf){return function(_0x2f3f27){if(_0x2f3f27){var _0x233394=_0x2f3f27['count'],_0x3158a1=_0x2a87bf[_0x35ad('0x1f')],_0x3a73c8=_0x2a87bf[_0x35ad('0x1f')]+_0x2a87bf['limit'],_0x418416;if(_0x3a73c8>=_0x233394){_0x3a73c8=_0x233394;_0x418416=0xc8;}else{_0x418416=0xce;}_0x56cb8e['status'](_0x418416);return _0x56cb8e[_0x35ad('0x20')](_0x35ad('0x21'),_0x3158a1+'-'+_0x3a73c8+'/'+_0x233394)['json'](_0x2f3f27);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x22')](_0x37c03d);}return _0x32735e[_0x35ad('0x23')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x24')](_0x30542c)[_0x35ad('0x25')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x26')]()['then'](function(){var _0x43059e=_0x1cb9da[_0x35ad('0x27')]({'plain':!![]});var _0xa3cb9f=_0x35ad('0x28');return db[_0x35ad('0x29')]['destroy']({'where':{'type':_0xa3cb9f,'resourceId':_0x43059e['id']}})[_0x35ad('0x25')](function(){return _0x1cb9da;});})[_0x35ad('0x25')](function(){_0xebc6c5[_0x35ad('0x1d')](0xcc)[_0x35ad('0x1c')]();});}};}function handleEntityNotFound(_0x2ddb59,_0x20a682){return function(_0x2e601a){if(!_0x2e601a){_0x2ddb59[_0x35ad('0x1b')](0x194);}return _0x2e601a;};}function handleError(_0x5418c2,_0x2e7ddd){_0x2e7ddd=_0x2e7ddd||0x1f4;return function(_0x11da54){logger[_0x35ad('0x2a')](_0x11da54[_0x35ad('0x2b')]);if(_0x11da54[_0x35ad('0x2c')]){delete _0x11da54['name'];}_0x5418c2['status'](_0x2e7ddd)[_0x35ad('0x2d')](_0x11da54);};}exports['index']=function(_0x235e5e,_0x4ccaea){var _0x53603f={},_0x589e4a={},_0x5380e5={'count':0x0,'rows':[]};var _0x55906e=db['SmsQueue']['rawAttributes'];_0x589e4a[_0x35ad('0x2e')]=_['keys'](_0x55906e);_0x589e4a[_0x35ad('0x2f')]=_['keys'](_0x235e5e[_0x35ad('0x2f')]);_0x589e4a['filters']=_[_0x35ad('0x30')](_0x589e4a['model'],_0x589e4a[_0x35ad('0x2f')]);_0x53603f[_0x35ad('0x31')]=_[_0x35ad('0x30')](_0x589e4a['model'],qs[_0x35ad('0x32')](_0x235e5e[_0x35ad('0x2f')][_0x35ad('0x32')]));_0x53603f[_0x35ad('0x31')]=_0x53603f[_0x35ad('0x31')]['length']?_0x53603f['attributes']:_0x589e4a[_0x35ad('0x2e')];if(!_0x235e5e[_0x35ad('0x2f')][_0x35ad('0x33')](_0x35ad('0x34'))){_0x53603f['limit']=qs[_0x35ad('0x35')](_0x235e5e[_0x35ad('0x2f')][_0x35ad('0x35')]);_0x53603f[_0x35ad('0x1f')]=qs[_0x35ad('0x1f')](_0x235e5e[_0x35ad('0x2f')]['offset']);}_0x53603f['order']=qs[_0x35ad('0x36')](_0x235e5e[_0x35ad('0x2f')][_0x35ad('0x36')]);_0x53603f[_0x35ad('0x37')]=qs[_0x35ad('0x38')](_[_0x35ad('0x39')](_0x235e5e[_0x35ad('0x2f')],_0x589e4a[_0x35ad('0x38')]));if(_0x235e5e[_0x35ad('0x2f')]['filter']){_0x53603f[_0x35ad('0x37')]=_['merge'](_0x53603f[_0x35ad('0x37')],{'$or':_[_0x35ad('0x3a')](_0x55906e,function(_0x450635){if(_0x450635[_0x35ad('0x3b')][_0x35ad('0x3c')]!==_0x35ad('0x3d')){var _0x2d6b71={};_0x2d6b71[_0x450635[_0x35ad('0x3e')]]={'$like':'%'+_0x235e5e[_0x35ad('0x2f')]['filter']+'%'};return _0x2d6b71;}})});}_0x53603f=_[_0x35ad('0x3f')]({},_0x53603f,_0x235e5e[_0x35ad('0x40')]);var _0x406934={'where':_0x53603f['where']};return db[_0x35ad('0x41')][_0x35ad('0x42')](_0x406934)[_0x35ad('0x25')](function(_0x5e137e){_0x5380e5[_0x35ad('0x42')]=_0x5e137e;if(_0x235e5e[_0x35ad('0x2f')][_0x35ad('0x43')]){_0x53603f[_0x35ad('0x44')]=[{'all':!![]}];}return db[_0x35ad('0x41')][_0x35ad('0x45')](_0x53603f);})[_0x35ad('0x25')](function(_0x557bf4){_0x5380e5[_0x35ad('0x46')]=_0x557bf4;return _0x5380e5;})['then'](respondWithFilteredResult(_0x4ccaea,_0x53603f))[_0x35ad('0x47')](handleError(_0x4ccaea,null));};exports[_0x35ad('0x48')]=function(_0x3df623,_0x2dfee9){var _0x1785b5={'raw':!![],'where':{'id':_0x3df623[_0x35ad('0x49')]['id']}},_0x26bc9f={};_0x26bc9f[_0x35ad('0x2e')]=_[_0x35ad('0x4a')](db['SmsQueue'][_0x35ad('0x4b')]);_0x26bc9f[_0x35ad('0x2f')]=_[_0x35ad('0x4a')](_0x3df623[_0x35ad('0x2f')]);_0x26bc9f[_0x35ad('0x38')]=_['intersection'](_0x26bc9f[_0x35ad('0x2e')],_0x26bc9f[_0x35ad('0x2f')]);_0x1785b5['attributes']=_['intersection'](_0x26bc9f[_0x35ad('0x2e')],qs[_0x35ad('0x32')](_0x3df623[_0x35ad('0x2f')][_0x35ad('0x32')]));_0x1785b5['attributes']=_0x1785b5[_0x35ad('0x31')][_0x35ad('0x4c')]?_0x1785b5[_0x35ad('0x31')]:_0x26bc9f[_0x35ad('0x2e')];if(_0x3df623[_0x35ad('0x2f')][_0x35ad('0x43')]){_0x1785b5[_0x35ad('0x44')]=[{'all':!![]}];}_0x1785b5=_['merge']({},_0x1785b5,_0x3df623[_0x35ad('0x40')]);return db[_0x35ad('0x41')][_0x35ad('0x4d')](_0x1785b5)['then'](handleEntityNotFound(_0x2dfee9,null))['then'](respondWithResult(_0x2dfee9,null))['catch'](handleError(_0x2dfee9,null));};exports[_0x35ad('0x4e')]=function(_0x43899a,_0x34d531){return db[_0x35ad('0x41')]['create'](_0x43899a[_0x35ad('0x4f')],{})[_0x35ad('0x25')](function(_0x3583ca){var _0x2e384a=_0x43899a[_0x35ad('0x50')][_0x35ad('0x27')]({'plain':!![]});if(!_0x2e384a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e384a['role']===_0x35ad('0x50')){var _0x3e5d31=_0x3583ca['get']({'plain':!![]});var _0x4fbf0c=_0x35ad('0x28');return db[_0x35ad('0x51')][_0x35ad('0x4d')]({'where':{'name':_0x4fbf0c,'userProfileId':_0x2e384a['userProfileId']},'raw':!![]})['then'](function(_0xa35ee4){if(_0xa35ee4&&_0xa35ee4[_0x35ad('0x52')]===0x0){return db[_0x35ad('0x29')]['create']({'name':_0x3e5d31[_0x35ad('0x2c')],'resourceId':_0x3e5d31['id'],'type':_0xa35ee4[_0x35ad('0x2c')],'sectionId':_0xa35ee4['id']},{})[_0x35ad('0x25')](function(){return _0x3583ca;});}else{return _0x3583ca;}})[_0x35ad('0x47')](function(_0x271493){logger[_0x35ad('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271493);throw _0x271493;});}return _0x3583ca;})[_0x35ad('0x25')](respondWithResult(_0x34d531,0xc9))[_0x35ad('0x47')](handleError(_0x34d531,null));};exports[_0x35ad('0x24')]=function(_0x5773c6,_0x325b2a){if(_0x5773c6[_0x35ad('0x4f')]['id']){delete _0x5773c6[_0x35ad('0x4f')]['id'];}return db[_0x35ad('0x41')]['find']({'where':{'id':_0x5773c6['params']['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x325b2a,null))[_0x35ad('0x25')](saveUpdates(_0x5773c6[_0x35ad('0x4f')],null))[_0x35ad('0x25')](respondWithResult(_0x325b2a,null))[_0x35ad('0x47')](handleError(_0x325b2a,null));};exports['destroy']=function(_0x25d816,_0x39fa94){return db[_0x35ad('0x41')][_0x35ad('0x4d')]({'where':{'id':_0x25d816[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x39fa94,null))['then'](removeEntity(_0x39fa94,null))['catch'](handleError(_0x39fa94,null));};exports[_0x35ad('0x53')]=function(_0x38183c,_0x2034c1){return db[_0x35ad('0x41')][_0x35ad('0x53')]()[_0x35ad('0x25')](respondWithResult(_0x2034c1,null))[_0x35ad('0x47')](handleError(_0x2034c1,null));};exports['getMembers']=function(_0x1da9a7,_0x13229d,_0xa8f927){var _0x2ee8f1={'raw':!![],'where':{}},_0x522054={},_0x12735e;return db[_0x35ad('0x41')]['findOne']({'where':{'id':_0x1da9a7[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x13229d,null))[_0x35ad('0x25')](function(_0x3f9607){if(_0x3f9607){_0x12735e=_0x3f9607[_0x35ad('0x27')]({'plain':!![]});_0x522054[_0x35ad('0x2e')]=_[_0x35ad('0x4a')](db[_0x35ad('0x54')]['rawAttributes']);_0x522054[_0x35ad('0x2f')]=_[_0x35ad('0x4a')](_0x1da9a7[_0x35ad('0x2f')]);_0x522054['filters']=_[_0x35ad('0x30')](_0x522054['model'],_0x522054[_0x35ad('0x2f')]);_0x2ee8f1[_0x35ad('0x31')]=_[_0x35ad('0x30')](_0x522054[_0x35ad('0x2e')],qs['fields'](_0x1da9a7[_0x35ad('0x2f')][_0x35ad('0x32')]));_0x2ee8f1[_0x35ad('0x31')]=_0x2ee8f1[_0x35ad('0x31')][_0x35ad('0x4c')]?_0x2ee8f1['attributes']:_0x522054[_0x35ad('0x2e')];if(!_0x1da9a7['query'][_0x35ad('0x33')](_0x35ad('0x34'))){_0x2ee8f1['limit']=qs[_0x35ad('0x35')](_0x1da9a7['query'][_0x35ad('0x35')]);_0x2ee8f1[_0x35ad('0x1f')]=qs['offset'](_0x1da9a7[_0x35ad('0x2f')][_0x35ad('0x1f')]);}_0x2ee8f1[_0x35ad('0x55')]=qs[_0x35ad('0x36')](_0x1da9a7[_0x35ad('0x2f')][_0x35ad('0x36')]);_0x2ee8f1[_0x35ad('0x37')]=qs['filters'](_[_0x35ad('0x39')](_0x1da9a7[_0x35ad('0x2f')],_0x522054[_0x35ad('0x38')]));_0x2ee8f1[_0x35ad('0x37')][_0x35ad('0x56')]=_0x3f9607['id'];if(_0x1da9a7[_0x35ad('0x2f')][_0x35ad('0x57')]){_0x2ee8f1['where']=_[_0x35ad('0x3f')](_0x2ee8f1[_0x35ad('0x37')],{'$or':_[_0x35ad('0x3a')](_0x2ee8f1[_0x35ad('0x31')],function(_0x2cb521){var _0x49a255={};_0x49a255[_0x2cb521]={'$like':'%'+_0x1da9a7[_0x35ad('0x2f')][_0x35ad('0x57')]+'%'};return _0x49a255;})});}_0x2ee8f1=_['merge']({},_0x2ee8f1,_0x1da9a7[_0x35ad('0x40')]);return db[_0x35ad('0x54')][_0x35ad('0x45')](_0x2ee8f1);}})[_0x35ad('0x25')](function(_0x4bd652){if(_0x4bd652){return db[_0x35ad('0x58')]['findAndCountAll']({'where':{'id':_[_0x35ad('0x3a')](_0x4bd652,_0x35ad('0x59')),'role':_0x35ad('0x5a')},'attributes':['id','name',_0x35ad('0x5b'),'updatedAt',_0x35ad('0x5c')]});}})['then'](function(_0x5ad236){if(_0x5ad236){return{'count':_0x5ad236[_0x35ad('0x42')],'rows':_[_0x35ad('0x3a')](_0x5ad236['rows'],function(_0x29337b){return{'membername':_0x29337b[_0x35ad('0x2c')],'UserId':_0x29337b['id'],'queue_name':_0x12735e[_0x35ad('0x2c')],'SmsQueueId':_0x12735e['id'],'interface':util['format']('%s/%s','SIP',_0x29337b['name']),'penalty':0x0,'paused':_0x29337b[_0x35ad('0x5b')],'createdAt':_0x29337b[_0x35ad('0x5c')],'updatedAt':_0x29337b[_0x35ad('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x35ad('0x25')](respondWithFilteredResult(_0x13229d,_0x2ee8f1))[_0x35ad('0x47')](handleError(_0x13229d,null));};exports[_0x35ad('0x5e')]=function(_0x4b6f5b,_0x1fc6f9,_0xda823){var _0x59fbea={};var _0x17e1d5={};var _0x104dd4;var _0x4cfa39;return db[_0x35ad('0x41')][_0x35ad('0x5f')]({'where':{'id':_0x4b6f5b[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x1fc6f9,null))['then'](function(_0x1e7722){if(_0x1e7722){_0x104dd4=_0x1e7722;_0x17e1d5[_0x35ad('0x2e')]=_[_0x35ad('0x4a')](db[_0x35ad('0x60')][_0x35ad('0x4b')]);_0x17e1d5[_0x35ad('0x2f')]=_[_0x35ad('0x4a')](_0x4b6f5b[_0x35ad('0x2f')]);_0x17e1d5[_0x35ad('0x38')]=_[_0x35ad('0x30')](_0x17e1d5['model'],_0x17e1d5['query']);_0x59fbea[_0x35ad('0x31')]=_[_0x35ad('0x30')](_0x17e1d5['model'],qs[_0x35ad('0x32')](_0x4b6f5b[_0x35ad('0x2f')][_0x35ad('0x32')]));_0x59fbea[_0x35ad('0x31')]=_0x59fbea[_0x35ad('0x31')][_0x35ad('0x4c')]?_0x59fbea['attributes']:_0x17e1d5[_0x35ad('0x2e')];_0x59fbea[_0x35ad('0x55')]=qs[_0x35ad('0x36')](_0x4b6f5b[_0x35ad('0x2f')][_0x35ad('0x36')]);_0x59fbea[_0x35ad('0x37')]=qs[_0x35ad('0x38')](_[_0x35ad('0x39')](_0x4b6f5b['query'],_0x17e1d5[_0x35ad('0x38')]));if(_0x4b6f5b[_0x35ad('0x2f')][_0x35ad('0x57')]){_0x59fbea[_0x35ad('0x37')]=_['merge'](_0x59fbea[_0x35ad('0x37')],{'$or':_['map'](_0x59fbea[_0x35ad('0x31')],function(_0x5c670e){var _0x4edf91={};_0x4edf91[_0x5c670e]={'$like':'%'+_0x4b6f5b[_0x35ad('0x2f')][_0x35ad('0x57')]+'%'};return _0x4edf91;})});}_0x59fbea=_[_0x35ad('0x3f')]({},_0x59fbea,_0x4b6f5b['options']);return _0x104dd4[_0x35ad('0x5e')](_0x59fbea);}})['then'](function(_0x4125ed){if(_0x4125ed){_0x4cfa39=_0x4125ed[_0x35ad('0x4c')];if(!_0x4b6f5b[_0x35ad('0x2f')][_0x35ad('0x33')]('nolimit')){_0x59fbea[_0x35ad('0x35')]=qs['limit'](_0x4b6f5b[_0x35ad('0x2f')]['limit']);_0x59fbea[_0x35ad('0x1f')]=qs[_0x35ad('0x1f')](_0x4b6f5b['query']['offset']);}return _0x104dd4['getTeams'](_0x59fbea);}})[_0x35ad('0x25')](function(_0x3f0897){if(_0x3f0897){return _0x3f0897?{'count':_0x4cfa39,'rows':_0x3f0897}:null;}})[_0x35ad('0x25')](respondWithResult(_0x1fc6f9,null))[_0x35ad('0x47')](handleError(_0x1fc6f9,null));};exports[_0x35ad('0x61')]=function(_0x4d8e97,_0x518980,_0x365201){var _0x5ee19d=_0x4d8e97[_0x35ad('0x4f')]['teams'];return db[_0x35ad('0x60')][_0x35ad('0x45')]({'where':{'id':_[_0x35ad('0x3a')](_0x5ee19d,'id')},'attributes':['id'],'include':[{'model':db[_0x35ad('0x58')],'as':'Agents','attributes':['id',_0x35ad('0x2c'),_0x35ad('0x62'),_0x35ad('0x63'),_0x35ad('0x64')],'raw':!![]}]})[_0x35ad('0x25')](function(_0x4b07e9){if(_0x4b07e9){var _0x13a33c=_[_0x35ad('0x65')](_0x4b07e9,function(_0x5670cb){var _0x2f352b=_0x5670cb[_0x35ad('0x27')]({'plain':!![]});return _0x2f352b['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x4d8e97[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](function(_0x84cb01){return db[_0x35ad('0x66')]['transaction'](function(_0x30c1d0){return _0x84cb01[_0x35ad('0x61')](_[_0x35ad('0x3a')](_0x5ee19d,'id'),{'transaction':_0x30c1d0})[_0x35ad('0x25')](function(){return BPromise[_0x35ad('0x67')](_0x13a33c,function(_0x378354){return db[_0x35ad('0x54')][_0x35ad('0x68')]({'where':{'UserId':_0x378354['id'],'SmsQueueId':_0x4d8e97[_0x35ad('0x49')]['id']},'transaction':_0x30c1d0});});})[_0x35ad('0x25')](function(){_0x13a33c[_0x35ad('0x69')](function(_0x49f6ca){socket[_0x35ad('0x6a')](_0x35ad('0x6b'),{'UserId':_0x49f6ca['id'],'SmsQueueId':_0x84cb01['id']});});});});});}})[_0x35ad('0x25')](respondWithStatusCode(_0x518980,null))[_0x35ad('0x47')](handleError(_0x518980,null));};exports[_0x35ad('0x6c')]=function(_0x48fdf4,_0x4e1638,_0x3b0004){return db[_0x35ad('0x60')][_0x35ad('0x45')]({'where':{'id':_0x48fdf4[_0x35ad('0x2f')][_0x35ad('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x35ad('0x58')],'as':_0x35ad('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x35ad('0x25')](handleEntityNotFound(_0x4e1638,null))[_0x35ad('0x25')](function(_0x7ebe81){var _0x5dc9af=_[_0x35ad('0x3a')](_0x7ebe81,'id');var _0x52c150=[];var _0x104b9b=[];var _0x2bdaf3=squel[_0x35ad('0x6f')]();_0x2bdaf3['field'](_0x35ad('0x70'))[_0x35ad('0x71')](_0x35ad('0x72'),'tq')[_0x35ad('0x73')]('user_has_teams','ut',_0x35ad('0x74'))[_0x35ad('0x37')]('SmsQueueId\x20=\x20?',_0x48fdf4['params']['id']);for(var _0x961ce6=0x0;_0x961ce6<_0x7ebe81[_0x35ad('0x4c')];_0x961ce6+=0x1){let _0x53c8c8=_0x7ebe81[_0x961ce6];for(var _0xf216d7=0x0;_0xf216d7<_0x53c8c8[_0x35ad('0x6e')][_0x35ad('0x4c')];_0xf216d7+=0x1){let _0x52fd18=_0x53c8c8[_0x35ad('0x6e')][_0xf216d7];var _0x550020=_0x2bdaf3[_0x35ad('0x75')]();_0x550020['where'](_0x35ad('0x76'),_0x52fd18['id']);_0x104b9b[_0x35ad('0x77')](db[_0x35ad('0x66')][_0x35ad('0x2f')](_0x550020[_0x35ad('0x78')](),{'type':db['sequelize'][_0x35ad('0x79')][_0x35ad('0x7a')]})[_0x35ad('0x25')](function(_0x102801){if(_0x102801['length']===0x1){return _0x52fd18['id'];}else{var _0x4f1e2d=_[_0x35ad('0x7b')](_['map'](_0x102801,_0x35ad('0x7c')),function(_0x505465){return _[_0x35ad('0x7d')](_0x5dc9af,_0x505465);});if(_0x4f1e2d){return _0x52fd18['id'];}}}));}}return BPromise['all'](_0x104b9b)['then'](function(_0x220e4f){_0x52c150=_(_0x52c150)['union'](_0x220e4f)[_0x35ad('0x7e')]()[_0x35ad('0x7f')]();return db[_0x35ad('0x41')][_0x35ad('0x4d')]({'where':{'id':_0x48fdf4[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](function(_0x3be1fd){return db[_0x35ad('0x66')]['transaction'](function(_0x1c1696){return _0x3be1fd[_0x35ad('0x6c')](_0x48fdf4[_0x35ad('0x2f')][_0x35ad('0x6d')],{'transaction':_0x1c1696})['then'](function(){if(!_[_0x35ad('0x80')](_0x52c150)){return _0x3be1fd[_0x35ad('0x81')](_0x52c150,{'transaction':_0x1c1696});}})['then'](function(){_0x52c150['forEach'](function(_0xc240a4){socket[_0x35ad('0x6a')](_0x35ad('0x82'),{'UserId':_0xc240a4,'SmsQueueId':_0x3be1fd['id']});});});});});});})['then'](respondWithStatusCode(_0x4e1638,null))[_0x35ad('0x47')](handleError(_0x4e1638,null));};exports['addAgents']=function(_0x22163f,_0x1c8764,_0x4312e6){return db[_0x35ad('0x41')][_0x35ad('0x4d')]({'where':{'id':_0x22163f[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x1c8764,null))[_0x35ad('0x25')](function(_0x2c8d04){if(_0x2c8d04){return _0x2c8d04['addAgents'](_0x22163f[_0x35ad('0x4f')][_0x35ad('0x6d')],_[_0x35ad('0x83')](_0x22163f['body'],['ids','id'])||{})[_0x35ad('0x84')](function(_0x3b829a){for(var _0x2d0da9=0x0;_0x2d0da9<_0x22163f[_0x35ad('0x4f')]['ids'][_0x35ad('0x4c')];_0x2d0da9+=0x1){socket[_0x35ad('0x6a')](_0x35ad('0x6b'),{'UserId':_0x22163f[_0x35ad('0x4f')][_0x35ad('0x6d')][_0x2d0da9],'SmsQueueId':_0x22163f[_0x35ad('0x49')]['id']});}return _0x3b829a;});}})[_0x35ad('0x25')](respondWithResult(_0x1c8764,null))[_0x35ad('0x47')](handleError(_0x1c8764,null));};exports[_0x35ad('0x81')]=function(_0x1efcc1,_0x5d68f3,_0x53c7f7){return db[_0x35ad('0x41')][_0x35ad('0x4d')]({'where':{'id':_0x1efcc1[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x5d68f3,null))[_0x35ad('0x25')](function(_0x45504e){if(_0x45504e){return _0x45504e[_0x35ad('0x81')](_0x1efcc1['query']['ids'])[_0x35ad('0x25')](function(){if(_[_0x35ad('0x85')](_0x1efcc1['query']['ids'])){for(var _0x1f1e2d=0x0;_0x1f1e2d<_0x1efcc1['query'][_0x35ad('0x6d')][_0x35ad('0x4c')];_0x1f1e2d+=0x1){socket[_0x35ad('0x6a')]('userSmsQueue:remove',{'UserId':Number(_0x1efcc1['query']['ids'][_0x1f1e2d]),'SmsQueueId':Number(_0x1efcc1[_0x35ad('0x49')]['id'])});}}else{socket[_0x35ad('0x6a')](_0x35ad('0x82'),{'UserId':Number(_0x1efcc1[_0x35ad('0x2f')][_0x35ad('0x6d')]),'SmsQueueId':Number(_0x1efcc1[_0x35ad('0x49')]['id'])});}});}})[_0x35ad('0x25')](respondWithStatusCode(_0x5d68f3,null))[_0x35ad('0x47')](handleError(_0x5d68f3,null));};exports['getAgents']=function(_0x12230b,_0x325489,_0x30c1cb){var _0x3f0c31={};var _0x4f53b6={};var _0x3e8acb;var _0x4eefd5;return db[_0x35ad('0x41')][_0x35ad('0x5f')]({'where':{'id':_0x12230b[_0x35ad('0x49')]['id']}})[_0x35ad('0x25')](handleEntityNotFound(_0x325489,null))['then'](function(_0x40425d){if(_0x40425d){_0x3e8acb=_0x40425d;_0x4f53b6[_0x35ad('0x2e')]=_[_0x35ad('0x4a')](db['User'][_0x35ad('0x4b')]);_0x4f53b6[_0x35ad('0x2f')]=_[_0x35ad('0x4a')](_0x12230b[_0x35ad('0x2f')]);_0x4f53b6[_0x35ad('0x38')]=_[_0x35ad('0x30')](_0x4f53b6['model'],_0x4f53b6[_0x35ad('0x2f')]);_0x3f0c31[_0x35ad('0x31')]=_[_0x35ad('0x30')](_0x4f53b6[_0x35ad('0x2e')],qs[_0x35ad('0x32')](_0x12230b[_0x35ad('0x2f')][_0x35ad('0x32')]));_0x3f0c31[_0x35ad('0x31')]=_0x3f0c31[_0x35ad('0x31')][_0x35ad('0x4c')]?_0x3f0c31[_0x35ad('0x31')]:_0x4f53b6[_0x35ad('0x2e')];_0x3f0c31[_0x35ad('0x55')]=qs[_0x35ad('0x36')](_0x12230b[_0x35ad('0x2f')][_0x35ad('0x36')]);_0x3f0c31[_0x35ad('0x37')]=qs['filters'](_[_0x35ad('0x39')](_0x12230b[_0x35ad('0x2f')],_0x4f53b6[_0x35ad('0x38')]));if(_0x12230b[_0x35ad('0x2f')][_0x35ad('0x57')]){_0x3f0c31[_0x35ad('0x37')]=_[_0x35ad('0x3f')](_0x3f0c31[_0x35ad('0x37')],{'$or':_[_0x35ad('0x3a')](_0x3f0c31[_0x35ad('0x31')],function(_0xca800e){var _0x545cca={};_0x545cca[_0xca800e]={'$like':'%'+_0x12230b[_0x35ad('0x2f')]['filter']+'%'};return _0x545cca;})});}_0x3f0c31=_[_0x35ad('0x3f')]({},_0x3f0c31,_0x12230b['options']);return _0x3e8acb[_0x35ad('0x86')](_0x3f0c31);}})['then'](function(_0x1e081f){if(_0x1e081f){_0x4eefd5=_0x1e081f[_0x35ad('0x4c')];if(!_0x12230b[_0x35ad('0x2f')][_0x35ad('0x33')](_0x35ad('0x34'))){_0x3f0c31['limit']=qs[_0x35ad('0x35')](_0x12230b[_0x35ad('0x2f')][_0x35ad('0x35')]);_0x3f0c31[_0x35ad('0x1f')]=qs['offset'](_0x12230b[_0x35ad('0x2f')][_0x35ad('0x1f')]);}return _0x3e8acb[_0x35ad('0x86')](_0x3f0c31);}})['then'](function(_0x4fa7df){if(_0x4fa7df){return _0x4fa7df?{'count':_0x4eefd5,'rows':_0x4fa7df}:null;}})[_0x35ad('0x25')](respondWithResult(_0x325489,null))[_0x35ad('0x47')](handleError(_0x325489,null));}; \ No newline at end of file +var _0x3667=['order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','teams','findAll','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','ids','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','SmsQueue','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit'];(function(_0x514986,_0x3effff){var _0x4e5c07=function(_0x216b4c){while(--_0x216b4c){_0x514986['push'](_0x514986['shift']());}};_0x4e5c07(++_0x3effff);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7366('0x0'));var emlformat=require(_0x7366('0x1'));var rimraf=require(_0x7366('0x2'));var zipdir=require(_0x7366('0x3'));var jsonpatch=require(_0x7366('0x4'));var rp=require('request-promise');var moment=require(_0x7366('0x5'));var BPromise=require(_0x7366('0x6'));var Mustache=require('mustache');var util=require(_0x7366('0x7'));var path=require(_0x7366('0x8'));var sox=require(_0x7366('0x9'));var csv=require(_0x7366('0xa'));var ejs=require(_0x7366('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7366('0xc'));var crypto=require(_0x7366('0xd'));var jsforce=require(_0x7366('0xe'));var deskjs=require(_0x7366('0xf'));var toCsv=require(_0x7366('0xa'));var querystring=require(_0x7366('0x10'));var Papa=require(_0x7366('0x11'));var Redis=require(_0x7366('0x12'));var authService=require(_0x7366('0x13'));var qs=require(_0x7366('0x14'));var hardwareService=require(_0x7366('0x15'));var logger=require(_0x7366('0x16'))(_0x7366('0x17'));var utils=require(_0x7366('0x18'));var config=require(_0x7366('0x19'));var db=require(_0x7366('0x1a'))['db'];config[_0x7366('0x1b')]=_[_0x7366('0x1c')](config[_0x7366('0x1b')],{'host':_0x7366('0x1d'),'port':0x18eb});var socket=require(_0x7366('0x1e'))(new Redis(config[_0x7366('0x1b')]));require(_0x7366('0x1f'))[_0x7366('0x20')](socket);function respondWithStatusCode(_0x308253,_0x27500c){_0x27500c=_0x27500c||0xcc;return function(_0x22562f){if(_0x22562f){return _0x308253[_0x7366('0x21')](_0x27500c);}return _0x308253['status'](_0x27500c)[_0x7366('0x22')]();};}function respondWithResult(_0x308752,_0x338719){_0x338719=_0x338719||0xc8;return function(_0x2c0422){if(_0x2c0422){return _0x308752[_0x7366('0x23')](_0x338719)[_0x7366('0x24')](_0x2c0422);}};}function respondWithFilteredResult(_0x2bc2af,_0x22d348){return function(_0x83e5d5){if(_0x83e5d5){var _0x41113f=_0x83e5d5['count'],_0x1a71f5=_0x22d348[_0x7366('0x25')],_0x49e50b=_0x22d348[_0x7366('0x25')]+_0x22d348[_0x7366('0x26')],_0x208ac8;if(_0x49e50b>=_0x41113f){_0x49e50b=_0x41113f;_0x208ac8=0xc8;}else{_0x208ac8=0xce;}_0x2bc2af['status'](_0x208ac8);return _0x2bc2af[_0x7366('0x27')](_0x7366('0x28'),_0x1a71f5+'-'+_0x49e50b+'/'+_0x41113f)[_0x7366('0x24')](_0x83e5d5);}return null;};}function patchUpdates(_0x532ce2){return function(_0x16e038){try{jsonpatch[_0x7366('0x29')](_0x16e038,_0x532ce2,!![]);}catch(_0x482946){return BPromise[_0x7366('0x2a')](_0x482946);}return _0x16e038[_0x7366('0x2b')]();};}function saveUpdates(_0xaab659,_0x1a12d2){return function(_0x3c30a2){if(_0x3c30a2){return _0x3c30a2[_0x7366('0x2c')](_0xaab659)[_0x7366('0x2d')](function(_0x22ed7e){return _0x22ed7e;});}return null;};}function removeEntity(_0x2095a1,_0x301220){return function(_0x12aed6){if(_0x12aed6){return _0x12aed6[_0x7366('0x2e')]()[_0x7366('0x2d')](function(){var _0x563b22=_0x12aed6[_0x7366('0x2f')]({'plain':!![]});var _0x4fe7cf=_0x7366('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x4fe7cf,'resourceId':_0x563b22['id']}})[_0x7366('0x2d')](function(){return _0x12aed6;});})['then'](function(){_0x2095a1[_0x7366('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x256633,_0x191177){return function(_0x5c37e2){if(!_0x5c37e2){_0x256633[_0x7366('0x21')](0x194);}return _0x5c37e2;};}function handleError(_0x565aa7,_0x31c642){_0x31c642=_0x31c642||0x1f4;return function(_0x2b61af){logger['error'](_0x2b61af[_0x7366('0x31')]);if(_0x2b61af['name']){delete _0x2b61af[_0x7366('0x32')];}_0x565aa7[_0x7366('0x23')](_0x31c642)[_0x7366('0x33')](_0x2b61af);};}exports[_0x7366('0x34')]=function(_0x2dda4b,_0x5e075c){var _0x166628={},_0x447807={},_0x538d42={'count':0x0,'rows':[]};var _0x4a0863=db['SmsQueue']['rawAttributes'];_0x447807[_0x7366('0x35')]=_[_0x7366('0x36')](_0x4a0863);_0x447807[_0x7366('0x37')]=_[_0x7366('0x36')](_0x2dda4b['query']);_0x447807[_0x7366('0x38')]=_[_0x7366('0x39')](_0x447807[_0x7366('0x35')],_0x447807[_0x7366('0x37')]);_0x166628['attributes']=_[_0x7366('0x39')](_0x447807[_0x7366('0x35')],qs['fields'](_0x2dda4b[_0x7366('0x37')][_0x7366('0x3a')]));_0x166628[_0x7366('0x3b')]=_0x166628[_0x7366('0x3b')][_0x7366('0x3c')]?_0x166628[_0x7366('0x3b')]:_0x447807[_0x7366('0x35')];if(!_0x2dda4b[_0x7366('0x37')][_0x7366('0x3d')]('nolimit')){_0x166628[_0x7366('0x26')]=qs[_0x7366('0x26')](_0x2dda4b['query'][_0x7366('0x26')]);_0x166628[_0x7366('0x25')]=qs[_0x7366('0x25')](_0x2dda4b['query'][_0x7366('0x25')]);}_0x166628['order']=qs[_0x7366('0x3e')](_0x2dda4b['query']['sort']);_0x166628[_0x7366('0x3f')]=qs['filters'](_[_0x7366('0x40')](_0x2dda4b[_0x7366('0x37')],_0x447807['filters']));if(_0x2dda4b[_0x7366('0x37')]['filter']){_0x166628[_0x7366('0x3f')]=_[_0x7366('0x41')](_0x166628[_0x7366('0x3f')],{'$or':_[_0x7366('0x42')](_0x4a0863,function(_0x4a670c){if(_0x4a670c[_0x7366('0x43')][_0x7366('0x44')]!==_0x7366('0x45')){var _0x4a7c5d={};_0x4a7c5d[_0x4a670c[_0x7366('0x46')]]={'$like':'%'+_0x2dda4b[_0x7366('0x37')][_0x7366('0x47')]+'%'};return _0x4a7c5d;}})});}_0x166628=_[_0x7366('0x41')]({},_0x166628,_0x2dda4b[_0x7366('0x48')]);var _0x234d13={'where':_0x166628[_0x7366('0x3f')]};return db['SmsQueue']['count'](_0x234d13)[_0x7366('0x2d')](function(_0xbe381d){_0x538d42['count']=_0xbe381d;if(_0x2dda4b[_0x7366('0x37')][_0x7366('0x49')]){_0x166628['include']=[{'all':!![]}];}return db[_0x7366('0x4a')]['findAll'](_0x166628);})[_0x7366('0x2d')](function(_0x1834cf){_0x538d42['rows']=_0x1834cf;return _0x538d42;})['then'](respondWithFilteredResult(_0x5e075c,_0x166628))[_0x7366('0x4b')](handleError(_0x5e075c,null));};exports[_0x7366('0x4c')]=function(_0x2ac2e6,_0x3e11f1){var _0x4d3df0={'raw':!![],'where':{'id':_0x2ac2e6[_0x7366('0x4d')]['id']}},_0x33c4ae={};_0x33c4ae[_0x7366('0x35')]=_[_0x7366('0x36')](db[_0x7366('0x4a')][_0x7366('0x4e')]);_0x33c4ae[_0x7366('0x37')]=_['keys'](_0x2ac2e6[_0x7366('0x37')]);_0x33c4ae[_0x7366('0x38')]=_[_0x7366('0x39')](_0x33c4ae['model'],_0x33c4ae[_0x7366('0x37')]);_0x4d3df0[_0x7366('0x3b')]=_['intersection'](_0x33c4ae[_0x7366('0x35')],qs[_0x7366('0x3a')](_0x2ac2e6[_0x7366('0x37')]['fields']));_0x4d3df0[_0x7366('0x3b')]=_0x4d3df0[_0x7366('0x3b')][_0x7366('0x3c')]?_0x4d3df0['attributes']:_0x33c4ae[_0x7366('0x35')];if(_0x2ac2e6[_0x7366('0x37')][_0x7366('0x49')]){_0x4d3df0['include']=[{'all':!![]}];}_0x4d3df0=_[_0x7366('0x41')]({},_0x4d3df0,_0x2ac2e6[_0x7366('0x48')]);return db[_0x7366('0x4a')][_0x7366('0x4f')](_0x4d3df0)['then'](handleEntityNotFound(_0x3e11f1,null))[_0x7366('0x2d')](respondWithResult(_0x3e11f1,null))[_0x7366('0x4b')](handleError(_0x3e11f1,null));};exports[_0x7366('0x50')]=function(_0x202ddb,_0x3cf180){return db[_0x7366('0x4a')][_0x7366('0x50')](_0x202ddb[_0x7366('0x51')],{})[_0x7366('0x2d')](function(_0x59f078){var _0x3ec767=_0x202ddb[_0x7366('0x52')]['get']({'plain':!![]});if(!_0x3ec767)throw new Error(_0x7366('0x53'));if(_0x3ec767[_0x7366('0x54')]==='user'){var _0x2ea6ce=_0x59f078['get']({'plain':!![]});var _0x3a16d6=_0x7366('0x30');return db[_0x7366('0x55')][_0x7366('0x4f')]({'where':{'name':_0x3a16d6,'userProfileId':_0x3ec767['userProfileId']},'raw':!![]})[_0x7366('0x2d')](function(_0x36ef47){if(_0x36ef47&&_0x36ef47[_0x7366('0x56')]===0x0){return db[_0x7366('0x57')][_0x7366('0x50')]({'name':_0x2ea6ce[_0x7366('0x32')],'resourceId':_0x2ea6ce['id'],'type':_0x36ef47[_0x7366('0x32')],'sectionId':_0x36ef47['id']},{})[_0x7366('0x2d')](function(){return _0x59f078;});}else{return _0x59f078;}})[_0x7366('0x4b')](function(_0x336b4d){logger[_0x7366('0x58')](_0x7366('0x59'),_0x336b4d);throw _0x336b4d;});}return _0x59f078;})['then'](respondWithResult(_0x3cf180,0xc9))[_0x7366('0x4b')](handleError(_0x3cf180,null));};exports['update']=function(_0x480c54,_0x1d488b){if(_0x480c54[_0x7366('0x51')]['id']){delete _0x480c54['body']['id'];}return db[_0x7366('0x4a')][_0x7366('0x4f')]({'where':{'id':_0x480c54['params']['id']}})['then'](handleEntityNotFound(_0x1d488b,null))[_0x7366('0x2d')](saveUpdates(_0x480c54['body'],null))[_0x7366('0x2d')](respondWithResult(_0x1d488b,null))[_0x7366('0x4b')](handleError(_0x1d488b,null));};exports['destroy']=function(_0x11c1cb,_0x1b3923){return db[_0x7366('0x4a')]['find']({'where':{'id':_0x11c1cb[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](handleEntityNotFound(_0x1b3923,null))[_0x7366('0x2d')](removeEntity(_0x1b3923,null))[_0x7366('0x4b')](handleError(_0x1b3923,null));};exports['describe']=function(_0x2a0869,_0x1d67da){return db[_0x7366('0x4a')][_0x7366('0x5a')]()[_0x7366('0x2d')](respondWithResult(_0x1d67da,null))['catch'](handleError(_0x1d67da,null));};exports[_0x7366('0x5b')]=function(_0x9080f4,_0x5b3160,_0x1ec71e){var _0x54c117={'raw':!![],'where':{}},_0x2335cc={},_0x5cbefc;return db[_0x7366('0x4a')][_0x7366('0x5c')]({'where':{'id':_0x9080f4['params']['id']}})[_0x7366('0x2d')](handleEntityNotFound(_0x5b3160,null))[_0x7366('0x2d')](function(_0x1ebce6){if(_0x1ebce6){_0x5cbefc=_0x1ebce6[_0x7366('0x2f')]({'plain':!![]});_0x2335cc['model']=_['keys'](db[_0x7366('0x5d')]['rawAttributes']);_0x2335cc[_0x7366('0x37')]=_[_0x7366('0x36')](_0x9080f4[_0x7366('0x37')]);_0x2335cc[_0x7366('0x38')]=_[_0x7366('0x39')](_0x2335cc[_0x7366('0x35')],_0x2335cc[_0x7366('0x37')]);_0x54c117[_0x7366('0x3b')]=_[_0x7366('0x39')](_0x2335cc['model'],qs[_0x7366('0x3a')](_0x9080f4['query']['fields']));_0x54c117['attributes']=_0x54c117[_0x7366('0x3b')]['length']?_0x54c117[_0x7366('0x3b')]:_0x2335cc['model'];if(!_0x9080f4[_0x7366('0x37')]['hasOwnProperty'](_0x7366('0x5e'))){_0x54c117[_0x7366('0x26')]=qs['limit'](_0x9080f4['query'][_0x7366('0x26')]);_0x54c117[_0x7366('0x25')]=qs[_0x7366('0x25')](_0x9080f4[_0x7366('0x37')]['offset']);}_0x54c117[_0x7366('0x5f')]=qs[_0x7366('0x3e')](_0x9080f4[_0x7366('0x37')]['sort']);_0x54c117['where']=qs[_0x7366('0x38')](_[_0x7366('0x40')](_0x9080f4[_0x7366('0x37')],_0x2335cc['filters']));_0x54c117[_0x7366('0x3f')][_0x7366('0x60')]=_0x1ebce6['id'];if(_0x9080f4[_0x7366('0x37')][_0x7366('0x47')]){_0x54c117[_0x7366('0x3f')]=_[_0x7366('0x41')](_0x54c117[_0x7366('0x3f')],{'$or':_[_0x7366('0x42')](_0x54c117[_0x7366('0x3b')],function(_0x3a606f){var _0x249ee6={};_0x249ee6[_0x3a606f]={'$like':'%'+_0x9080f4['query'][_0x7366('0x47')]+'%'};return _0x249ee6;})});}_0x54c117=_[_0x7366('0x41')]({},_0x54c117,_0x9080f4['options']);return db[_0x7366('0x5d')]['findAll'](_0x54c117);}})['then'](function(_0xb46920){if(_0xb46920){return db[_0x7366('0x61')][_0x7366('0x62')]({'where':{'id':_[_0x7366('0x42')](_0xb46920,_0x7366('0x63')),'role':_0x7366('0x64')},'attributes':['id','name',_0x7366('0x65'),_0x7366('0x66'),_0x7366('0x67')]});}})['then'](function(_0xd5b230){if(_0xd5b230){return{'count':_0xd5b230['count'],'rows':_['map'](_0xd5b230[_0x7366('0x68')],function(_0x5c962b){return{'membername':_0x5c962b[_0x7366('0x32')],'UserId':_0x5c962b['id'],'queue_name':_0x5cbefc[_0x7366('0x32')],'SmsQueueId':_0x5cbefc['id'],'interface':util[_0x7366('0x69')](_0x7366('0x6a'),'SIP',_0x5c962b['name']),'penalty':0x0,'paused':_0x5c962b[_0x7366('0x65')],'createdAt':_0x5c962b[_0x7366('0x67')],'updatedAt':_0x5c962b[_0x7366('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7366('0x2d')](respondWithFilteredResult(_0x5b3160,_0x54c117))['catch'](handleError(_0x5b3160,null));};exports[_0x7366('0x6b')]=function(_0x5bc368,_0x4c7835,_0x386c82){var _0x48e3b4={};var _0x4ff998={};var _0x41583b;var _0x39ada0;return db['SmsQueue'][_0x7366('0x5c')]({'where':{'id':_0x5bc368[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](handleEntityNotFound(_0x4c7835,null))[_0x7366('0x2d')](function(_0x1ddde2){if(_0x1ddde2){_0x41583b=_0x1ddde2;_0x4ff998[_0x7366('0x35')]=_[_0x7366('0x36')](db[_0x7366('0x6c')][_0x7366('0x4e')]);_0x4ff998[_0x7366('0x37')]=_['keys'](_0x5bc368['query']);_0x4ff998['filters']=_[_0x7366('0x39')](_0x4ff998[_0x7366('0x35')],_0x4ff998[_0x7366('0x37')]);_0x48e3b4['attributes']=_[_0x7366('0x39')](_0x4ff998[_0x7366('0x35')],qs[_0x7366('0x3a')](_0x5bc368[_0x7366('0x37')][_0x7366('0x3a')]));_0x48e3b4['attributes']=_0x48e3b4[_0x7366('0x3b')][_0x7366('0x3c')]?_0x48e3b4['attributes']:_0x4ff998[_0x7366('0x35')];_0x48e3b4[_0x7366('0x5f')]=qs[_0x7366('0x3e')](_0x5bc368[_0x7366('0x37')][_0x7366('0x3e')]);_0x48e3b4['where']=qs['filters'](_[_0x7366('0x40')](_0x5bc368[_0x7366('0x37')],_0x4ff998[_0x7366('0x38')]));if(_0x5bc368[_0x7366('0x37')][_0x7366('0x47')]){_0x48e3b4[_0x7366('0x3f')]=_[_0x7366('0x41')](_0x48e3b4[_0x7366('0x3f')],{'$or':_[_0x7366('0x42')](_0x48e3b4[_0x7366('0x3b')],function(_0x3cff83){var _0x2d1797={};_0x2d1797[_0x3cff83]={'$like':'%'+_0x5bc368[_0x7366('0x37')][_0x7366('0x47')]+'%'};return _0x2d1797;})});}_0x48e3b4=_['merge']({},_0x48e3b4,_0x5bc368[_0x7366('0x48')]);return _0x41583b['getTeams'](_0x48e3b4);}})[_0x7366('0x2d')](function(_0x4ee609){if(_0x4ee609){_0x39ada0=_0x4ee609[_0x7366('0x3c')];if(!_0x5bc368['query'][_0x7366('0x3d')](_0x7366('0x5e'))){_0x48e3b4['limit']=qs[_0x7366('0x26')](_0x5bc368[_0x7366('0x37')]['limit']);_0x48e3b4['offset']=qs[_0x7366('0x25')](_0x5bc368[_0x7366('0x37')]['offset']);}return _0x41583b[_0x7366('0x6b')](_0x48e3b4);}})['then'](function(_0x2c8e84){if(_0x2c8e84){return _0x2c8e84?{'count':_0x39ada0,'rows':_0x2c8e84}:null;}})['then'](respondWithResult(_0x4c7835,null))['catch'](handleError(_0x4c7835,null));};exports[_0x7366('0x6d')]=function(_0x40a7a3,_0x26082c,_0x57e811){var _0x306a43=_0x40a7a3[_0x7366('0x51')][_0x7366('0x6e')];return db['Team'][_0x7366('0x6f')]({'where':{'id':_[_0x7366('0x42')](_0x306a43,'id')},'attributes':['id'],'include':[{'model':db[_0x7366('0x61')],'as':_0x7366('0x70'),'attributes':['id',_0x7366('0x32'),_0x7366('0x71'),'voicePause',_0x7366('0x72')],'raw':!![]}]})[_0x7366('0x2d')](function(_0x4281f5){if(_0x4281f5){var _0x519e60=_[_0x7366('0x73')](_0x4281f5,function(_0x5896ad){var _0xcf2b45=_0x5896ad[_0x7366('0x2f')]({'plain':!![]});return _0xcf2b45[_0x7366('0x70')];});return db[_0x7366('0x4a')][_0x7366('0x4f')]({'where':{'id':_0x40a7a3[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](function(_0x240449){return db[_0x7366('0x74')][_0x7366('0x75')](function(_0x3d18b5){return _0x240449[_0x7366('0x6d')](_[_0x7366('0x42')](_0x306a43,'id'),{'transaction':_0x3d18b5})['then'](function(){return BPromise[_0x7366('0x76')](_0x519e60,function(_0x17edb0){return db[_0x7366('0x5d')][_0x7366('0x77')]({'where':{'UserId':_0x17edb0['id'],'SmsQueueId':_0x40a7a3[_0x7366('0x4d')]['id']},'transaction':_0x3d18b5});});})['then'](function(){_0x519e60[_0x7366('0x78')](function(_0x44e9ce){socket['emit'](_0x7366('0x79'),{'UserId':_0x44e9ce['id'],'SmsQueueId':_0x240449['id']});});});});});}})[_0x7366('0x2d')](respondWithStatusCode(_0x26082c,null))[_0x7366('0x4b')](handleError(_0x26082c,null));};exports['removeTeams']=function(_0x114ec6,_0x4faa49,_0x54aaa5){return db['Team'][_0x7366('0x6f')]({'where':{'id':_0x114ec6[_0x7366('0x37')][_0x7366('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x7366('0x61')],'as':_0x7366('0x70'),'attributes':['id'],'raw':!![]}]})[_0x7366('0x2d')](handleEntityNotFound(_0x4faa49,null))['then'](function(_0x506c11){var _0x133be0=_[_0x7366('0x42')](_0x506c11,'id');var _0x1f2bbe=[];var _0xe26771=[];var _0x4da8a6=squel[_0x7366('0x7b')]();_0x4da8a6[_0x7366('0x46')](_0x7366('0x7c'))[_0x7366('0x7d')](_0x7366('0x7e'),'tq')[_0x7366('0x7f')]('user_has_teams','ut',_0x7366('0x80'))[_0x7366('0x3f')](_0x7366('0x81'),_0x114ec6[_0x7366('0x4d')]['id']);for(var _0x108dba=0x0;_0x108dba<_0x506c11[_0x7366('0x3c')];_0x108dba+=0x1){let _0x345505=_0x506c11[_0x108dba];for(var _0x5ac943=0x0;_0x5ac943<_0x345505[_0x7366('0x70')][_0x7366('0x3c')];_0x5ac943+=0x1){let _0x5c6e21=_0x345505[_0x7366('0x70')][_0x5ac943];var _0xf65272=_0x4da8a6[_0x7366('0x82')]();_0xf65272[_0x7366('0x3f')](_0x7366('0x83'),_0x5c6e21['id']);_0xe26771['push'](db['sequelize']['query'](_0xf65272[_0x7366('0x84')](),{'type':db[_0x7366('0x74')][_0x7366('0x85')][_0x7366('0x86')]})[_0x7366('0x2d')](function(_0x36b58c){if(_0x36b58c[_0x7366('0x3c')]===0x1){return _0x5c6e21['id'];}else{var _0x2e44d6=_['every'](_[_0x7366('0x42')](_0x36b58c,_0x7366('0x87')),function(_0x5366a0){return _[_0x7366('0x88')](_0x133be0,_0x5366a0);});if(_0x2e44d6){return _0x5c6e21['id'];}}}));}}return BPromise['all'](_0xe26771)['then'](function(_0x590754){_0x1f2bbe=_(_0x1f2bbe)[_0x7366('0x89')](_0x590754)[_0x7366('0x8a')]()[_0x7366('0x8b')]();return db[_0x7366('0x4a')][_0x7366('0x4f')]({'where':{'id':_0x114ec6[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](function(_0x4063a5){return db[_0x7366('0x74')][_0x7366('0x75')](function(_0x4c1c09){return _0x4063a5[_0x7366('0x8c')](_0x114ec6[_0x7366('0x37')]['ids'],{'transaction':_0x4c1c09})['then'](function(){if(!_[_0x7366('0x8d')](_0x1f2bbe)){return _0x4063a5[_0x7366('0x8e')](_0x1f2bbe,{'transaction':_0x4c1c09});}})[_0x7366('0x2d')](function(){_0x1f2bbe[_0x7366('0x78')](function(_0x1f9a58){socket['emit'](_0x7366('0x8f'),{'UserId':_0x1f9a58,'SmsQueueId':_0x4063a5['id']});});});});});});})[_0x7366('0x2d')](respondWithStatusCode(_0x4faa49,null))[_0x7366('0x4b')](handleError(_0x4faa49,null));};exports[_0x7366('0x90')]=function(_0x4223b9,_0x57a6b7,_0x18c2bf){return db[_0x7366('0x4a')][_0x7366('0x4f')]({'where':{'id':_0x4223b9[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](handleEntityNotFound(_0x57a6b7,null))[_0x7366('0x2d')](function(_0x44cc3f){if(_0x44cc3f){return _0x44cc3f[_0x7366('0x90')](_0x4223b9['body']['ids'],_[_0x7366('0x91')](_0x4223b9[_0x7366('0x51')],[_0x7366('0x7a'),'id'])||{})[_0x7366('0x92')](function(_0x2efc7c){for(var _0x36fdb0=0x0;_0x36fdb0<_0x4223b9[_0x7366('0x51')][_0x7366('0x7a')]['length'];_0x36fdb0+=0x1){socket[_0x7366('0x93')]('userSmsQueue:save',{'UserId':_0x4223b9[_0x7366('0x51')][_0x7366('0x7a')][_0x36fdb0],'SmsQueueId':_0x4223b9[_0x7366('0x4d')]['id']});}return _0x2efc7c;});}})[_0x7366('0x2d')](respondWithResult(_0x57a6b7,null))[_0x7366('0x4b')](handleError(_0x57a6b7,null));};exports[_0x7366('0x8e')]=function(_0x204c49,_0x2a58cc,_0x3040b2){return db[_0x7366('0x4a')][_0x7366('0x4f')]({'where':{'id':_0x204c49[_0x7366('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a58cc,null))[_0x7366('0x2d')](function(_0xd4246a){if(_0xd4246a){return _0xd4246a[_0x7366('0x8e')](_0x204c49[_0x7366('0x37')][_0x7366('0x7a')])[_0x7366('0x2d')](function(){if(_[_0x7366('0x94')](_0x204c49[_0x7366('0x37')]['ids'])){for(var _0x2c94a2=0x0;_0x2c94a2<_0x204c49[_0x7366('0x37')][_0x7366('0x7a')][_0x7366('0x3c')];_0x2c94a2+=0x1){socket[_0x7366('0x93')](_0x7366('0x8f'),{'UserId':Number(_0x204c49[_0x7366('0x37')][_0x7366('0x7a')][_0x2c94a2]),'SmsQueueId':Number(_0x204c49[_0x7366('0x4d')]['id'])});}}else{socket[_0x7366('0x93')](_0x7366('0x8f'),{'UserId':Number(_0x204c49[_0x7366('0x37')][_0x7366('0x7a')]),'SmsQueueId':Number(_0x204c49['params']['id'])});}});}})[_0x7366('0x2d')](respondWithStatusCode(_0x2a58cc,null))[_0x7366('0x4b')](handleError(_0x2a58cc,null));};exports['getAgents']=function(_0x530ccf,_0x52cd65,_0x4d2a2e){var _0x40596b={};var _0x5127fe={};var _0x445ae7;var _0x1846a8;return db['SmsQueue'][_0x7366('0x5c')]({'where':{'id':_0x530ccf[_0x7366('0x4d')]['id']}})[_0x7366('0x2d')](handleEntityNotFound(_0x52cd65,null))['then'](function(_0x1f51ed){if(_0x1f51ed){_0x445ae7=_0x1f51ed;_0x5127fe[_0x7366('0x35')]=_['keys'](db[_0x7366('0x61')][_0x7366('0x4e')]);_0x5127fe[_0x7366('0x37')]=_[_0x7366('0x36')](_0x530ccf[_0x7366('0x37')]);_0x5127fe[_0x7366('0x38')]=_['intersection'](_0x5127fe[_0x7366('0x35')],_0x5127fe[_0x7366('0x37')]);_0x40596b['attributes']=_[_0x7366('0x39')](_0x5127fe[_0x7366('0x35')],qs[_0x7366('0x3a')](_0x530ccf['query'][_0x7366('0x3a')]));_0x40596b[_0x7366('0x3b')]=_0x40596b['attributes'][_0x7366('0x3c')]?_0x40596b[_0x7366('0x3b')]:_0x5127fe[_0x7366('0x35')];_0x40596b[_0x7366('0x5f')]=qs['sort'](_0x530ccf['query'][_0x7366('0x3e')]);_0x40596b[_0x7366('0x3f')]=qs['filters'](_['pick'](_0x530ccf['query'],_0x5127fe[_0x7366('0x38')]));if(_0x530ccf[_0x7366('0x37')]['filter']){_0x40596b[_0x7366('0x3f')]=_['merge'](_0x40596b[_0x7366('0x3f')],{'$or':_[_0x7366('0x42')](_0x40596b[_0x7366('0x3b')],function(_0x574461){var _0xa1a330={};_0xa1a330[_0x574461]={'$like':'%'+_0x530ccf[_0x7366('0x37')][_0x7366('0x47')]+'%'};return _0xa1a330;})});}_0x40596b=_['merge']({},_0x40596b,_0x530ccf[_0x7366('0x48')]);return _0x445ae7[_0x7366('0x95')](_0x40596b);}})[_0x7366('0x2d')](function(_0x109736){if(_0x109736){_0x1846a8=_0x109736[_0x7366('0x3c')];if(!_0x530ccf[_0x7366('0x37')][_0x7366('0x3d')](_0x7366('0x5e'))){_0x40596b[_0x7366('0x26')]=qs[_0x7366('0x26')](_0x530ccf['query'][_0x7366('0x26')]);_0x40596b['offset']=qs[_0x7366('0x25')](_0x530ccf[_0x7366('0x37')][_0x7366('0x25')]);}return _0x445ae7[_0x7366('0x95')](_0x40596b);}})[_0x7366('0x2d')](function(_0x45adfb){if(_0x45adfb){return _0x45adfb?{'count':_0x1846a8,'rows':_0x45adfb}:null;}})[_0x7366('0x2d')](respondWithResult(_0x52cd65,null))['catch'](handleError(_0x52cd65,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c4152d5..f03429c 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 _0xbc8c=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2a1826,_0x40f48d){var _0x5d57cd=function(_0x3c5af8){while(--_0x3c5af8){_0x2a1826['push'](_0x2a1826['shift']());}};_0x5d57cd(++_0x40f48d);}(_0xbc8c,0x1c3));var _0xcbc8=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xbc8c[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require(_0xcbc8('0x0'));var SmsQueue=require(_0xcbc8('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xcbc8('0x2')](0x0);var events={'afterCreate':_0xcbc8('0x3'),'afterUpdate':_0xcbc8('0x4'),'afterDestroy':_0xcbc8('0x5')};function emitEvent(_0x24f861){return function(_0x554d6b,_0xfe5144,_0xe573c8){SmsQueueEvents[_0xcbc8('0x6')](_0x24f861+':'+_0x554d6b['id'],_0x554d6b);SmsQueueEvents[_0xcbc8('0x6')](_0x24f861,_0x554d6b);_0xe573c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xcbc8('0x7')](e,emitEvent(event));}}module[_0xcbc8('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x842b=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0x842b,0xbf));var _0xb842=function(_0x455bfb,_0x9dd486){_0x455bfb=_0x455bfb-0x0;var _0x1d88b=_0x842b[_0x455bfb];return _0x1d88b;};'use strict';var EventEmitter=require(_0xb842('0x0'));var SmsQueue=require(_0xb842('0x1'))['db'][_0xb842('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb842('0x3')](0x0);var events={'afterCreate':_0xb842('0x4'),'afterUpdate':_0xb842('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3db397){return function(_0x27e88d,_0x221347,_0x27c1c5){SmsQueueEvents[_0xb842('0x6')](_0x3db397+':'+_0x27e88d['id'],_0x27e88d);SmsQueueEvents[_0xb842('0x6')](_0x3db397,_0x27e88d);_0x27c1c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xb842('0x7')](e,emitEvent(event));}}module[_0xb842('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b5e86e1..8eb347f 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 _0xeae8=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xeae8,0x66));var _0x8eae=function(_0x41c552,_0x58e2e0){_0x41c552=_0x41c552-0x0;var _0x390b0d=_0xeae8[_0x41c552];return _0x390b0d;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var logger=require(_0x8eae('0x2'))('api');var moment=require(_0x8eae('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eae('0x5'));var config=require(_0x8eae('0x6'));var attributes=require(_0x8eae('0x7'));module[_0x8eae('0x8')]=function(_0xcc5f34,_0x123053){return _0xcc5f34[_0x8eae('0x9')](_0x8eae('0xa'),attributes,{'tableName':_0x8eae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['lodash','util','../../config/logger','api','path','rimraf','./smsQueue.attributes','exports','SmsQueue'];(function(_0x35e8f8,_0x4bbf04){var _0x152dfc=function(_0x4b4140){while(--_0x4b4140){_0x35e8f8['push'](_0x35e8f8['shift']());}};_0x152dfc(++_0x4bbf04);}(_0xd8fb,0x99));var _0xbd8f=function(_0x468b19,_0x5d85e0){_0x468b19=_0x468b19-0x0;var _0x60ac09=_0xd8fb[_0x468b19];return _0x60ac09;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2103afb..b2b5df4 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 _0x65e0=['then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','limit','map','include','model','attributes','ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register'];(function(_0x35ebf4,_0x43ff06){var _0x43786f=function(_0x351bd5){while(--_0x351bd5){_0x35ebf4['push'](_0x35ebf4['shift']());}};_0x43786f(++_0x43ff06);}(_0x65e0,0x96));var _0x065e=function(_0x55e099,_0x9fa64a){_0x55e099=_0x55e099-0x0;var _0x551a58=_0x65e0[_0x55e099];return _0x551a58;};'use strict';var _=require(_0x065e('0x0'));var util=require(_0x065e('0x1'));var moment=require(_0x065e('0x2'));var BPromise=require(_0x065e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x065e('0x4'));var db=require(_0x065e('0x5'))['db'];var utils=require(_0x065e('0x6'));var logger=require(_0x065e('0x7'))(_0x065e('0x8'));var config=require(_0x065e('0x9'));var jayson=require(_0x065e('0xa'));var client=jayson['client'][_0x065e('0xb')]({'port':0x232a});config['redis']=_[_0x065e('0xc')](config[_0x065e('0xd')],{'host':_0x065e('0xe'),'port':0x18eb});var socket=require(_0x065e('0xf'))(new Redis(config[_0x065e('0xd')]));require(_0x065e('0x10'))[_0x065e('0x11')](socket);function respondWithRpcPromise(_0x3d0ceb,_0x1ba10f,_0x354b4e){return new BPromise(function(_0x522969,_0x2ce665){return client['request'](_0x3d0ceb,_0x354b4e)[_0x065e('0x12')](function(_0x54cffc){logger[_0x065e('0x13')](_0x065e('0x14'),_0x1ba10f,_0x065e('0x15'));logger[_0x065e('0x16')](_0x065e('0x17'),_0x1ba10f,_0x065e('0x15'),JSON[_0x065e('0x18')](_0x54cffc));if(_0x54cffc[_0x065e('0x19')]){if(_0x54cffc[_0x065e('0x19')][_0x065e('0x1a')]===0x1f4){logger[_0x065e('0x19')](_0x065e('0x14'),_0x1ba10f,_0x54cffc[_0x065e('0x19')][_0x065e('0x1b')]);return _0x2ce665(_0x54cffc[_0x065e('0x19')][_0x065e('0x1b')]);}logger[_0x065e('0x19')](_0x065e('0x14'),_0x1ba10f,_0x54cffc[_0x065e('0x19')][_0x065e('0x1b')]);return _0x522969(_0x54cffc[_0x065e('0x19')]['message']);}else{logger[_0x065e('0x13')]('SmsQueue,\x20%s,\x20%s',_0x1ba10f,_0x065e('0x15'));_0x522969(_0x54cffc[_0x065e('0x1c')][_0x065e('0x1b')]);}})[_0x065e('0x1d')](function(_0xc17146){logger[_0x065e('0x19')](_0x065e('0x14'),_0x1ba10f,_0xc17146);_0x2ce665(_0xc17146);});});}exports[_0x065e('0x1e')]=function(_0x400732){var _0x9dffdd=this;return new Promise(function(_0x11f8eb,_0x2863ed){return db[_0x065e('0x1f')][_0x065e('0x20')]({'raw':_0x400732['options']?_0x400732['options'][_0x065e('0x21')]===undefined?!![]:![]:!![],'where':_0x400732[_0x065e('0x22')]?_0x400732['options']['where']||null:null,'attributes':_0x400732[_0x065e('0x22')]?_0x400732[_0x065e('0x22')]['attributes']||null:null,'limit':_0x400732['options']?_0x400732[_0x065e('0x22')][_0x065e('0x23')]||null:null,'include':_0x400732[_0x065e('0x22')]?_0x400732[_0x065e('0x22')]['include']?_[_0x065e('0x24')](_0x400732['options'][_0x065e('0x25')],function(_0x343a59){return{'model':db[_0x343a59[_0x065e('0x26')]],'as':_0x343a59['as'],'attributes':_0x343a59[_0x065e('0x27')],'include':_0x343a59[_0x065e('0x25')]?_[_0x065e('0x24')](_0x343a59['include'],function(_0x8dae59){return{'model':db[_0x8dae59['model']],'as':_0x8dae59['as'],'attributes':_0x8dae59[_0x065e('0x27')],'include':_0x8dae59[_0x065e('0x25')]?_[_0x065e('0x24')](_0x8dae59[_0x065e('0x25')],function(_0x3e1b14){return{'model':db[_0x3e1b14[_0x065e('0x26')]],'as':_0x3e1b14['as'],'attributes':_0x3e1b14[_0x065e('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e2d18){logger[_0x065e('0x13')](_0x065e('0x1e'),_0x400732);logger[_0x065e('0x16')]('GetSmsQueue',_0x400732,JSON['stringify'](_0x1e2d18));_0x11f8eb(_0x1e2d18);})['catch'](function(_0x8997c9){logger[_0x065e('0x19')]('GetSmsQueue',_0x8997c9[_0x065e('0x1b')],_0x400732);_0x2863ed(_0x9dffdd['error'](0x1f4,_0x8997c9[_0x065e('0x1b')]));});});};exports[_0x065e('0x28')]=function(_0x5a862f){var _0x300662=this;return new Promise(function(_0x25d337,_0x507c0e){return db[_0x065e('0x1f')][_0x065e('0x29')]({'raw':_0x5a862f[_0x065e('0x22')]?_0x5a862f[_0x065e('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x5a862f[_0x065e('0x22')]?_0x5a862f[_0x065e('0x22')]['where']||null:null,'attributes':_0x5a862f[_0x065e('0x22')]?_0x5a862f[_0x065e('0x22')][_0x065e('0x27')]||null:null,'include':_0x5a862f[_0x065e('0x22')]?_0x5a862f[_0x065e('0x22')][_0x065e('0x25')]?_[_0x065e('0x24')](_0x5a862f[_0x065e('0x22')][_0x065e('0x25')],function(_0x5d3165){return{'model':db[_0x5d3165[_0x065e('0x26')]],'as':_0x5d3165['as'],'attributes':_0x5d3165[_0x065e('0x27')],'include':_0x5d3165[_0x065e('0x25')]?_[_0x065e('0x24')](_0x5d3165[_0x065e('0x25')],function(_0x576028){return{'model':db[_0x576028['model']],'as':_0x576028['as'],'attributes':_0x576028[_0x065e('0x27')],'include':_0x576028[_0x065e('0x25')]?_[_0x065e('0x24')](_0x576028[_0x065e('0x25')],function(_0x55fe55){return{'model':db[_0x55fe55[_0x065e('0x26')]],'as':_0x55fe55['as'],'attributes':_0x55fe55[_0x065e('0x27')]};}):[]};}):[]};}):[]:[]})[_0x065e('0x12')](function(_0x4114cb){logger[_0x065e('0x13')](_0x065e('0x28'),_0x5a862f);logger[_0x065e('0x16')](_0x065e('0x28'),_0x5a862f,JSON['stringify'](_0x4114cb));_0x25d337(_0x4114cb);})[_0x065e('0x1d')](function(_0x3f3c46){logger[_0x065e('0x19')]('ShowSmsQueue',_0x3f3c46[_0x065e('0x1b')],_0x5a862f);_0x507c0e(_0x300662[_0x065e('0x19')](0x1f4,_0x3f3c46[_0x065e('0x1b')]));});});}; \ No newline at end of file +var _0x2531=['message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsQueue.socket','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s'];(function(_0x2dfd05,_0x1b1610){var _0x135494=function(_0x540501){while(--_0x540501){_0x2dfd05['push'](_0x2dfd05['shift']());}};_0x135494(++_0x1b1610);}(_0x2531,0xb1));var _0x1253=function(_0x173eb6,_0x1076e){_0x173eb6=_0x173eb6-0x0;var _0x57641c=_0x2531[_0x173eb6];return _0x57641c;};'use strict';var _=require(_0x1253('0x0'));var util=require(_0x1253('0x1'));var moment=require(_0x1253('0x2'));var BPromise=require('bluebird');var rs=require(_0x1253('0x3'));var fs=require('fs');var Redis=require(_0x1253('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1253('0x5'));var logger=require(_0x1253('0x6'))(_0x1253('0x7'));var config=require(_0x1253('0x8'));var jayson=require(_0x1253('0x9'));var client=jayson['client'][_0x1253('0xa')]({'port':0x232a});config[_0x1253('0xb')]=_['defaults'](config[_0x1253('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1253('0xc'))(new Redis(config['redis']));require(_0x1253('0xd'))['register'](socket);function respondWithRpcPromise(_0x5f1750,_0x5a604c,_0x111859){return new BPromise(function(_0x2e902c,_0x3c5ca8){return client[_0x1253('0xe')](_0x5f1750,_0x111859)[_0x1253('0xf')](function(_0x12aadd){logger[_0x1253('0x10')]('SmsQueue,\x20%s,\x20%s',_0x5a604c,_0x1253('0x11'));logger[_0x1253('0x12')](_0x1253('0x13'),_0x5a604c,_0x1253('0x11'),JSON['stringify'](_0x12aadd));if(_0x12aadd[_0x1253('0x14')]){if(_0x12aadd['error'][_0x1253('0x15')]===0x1f4){logger[_0x1253('0x14')](_0x1253('0x16'),_0x5a604c,_0x12aadd['error'][_0x1253('0x17')]);return _0x3c5ca8(_0x12aadd[_0x1253('0x14')][_0x1253('0x17')]);}logger[_0x1253('0x14')](_0x1253('0x16'),_0x5a604c,_0x12aadd[_0x1253('0x14')]['message']);return _0x2e902c(_0x12aadd[_0x1253('0x14')][_0x1253('0x17')]);}else{logger[_0x1253('0x10')](_0x1253('0x16'),_0x5a604c,_0x1253('0x11'));_0x2e902c(_0x12aadd[_0x1253('0x18')]['message']);}})[_0x1253('0x19')](function(_0x530b40){logger[_0x1253('0x14')]('SmsQueue,\x20%s,\x20%s',_0x5a604c,_0x530b40);_0x3c5ca8(_0x530b40);});});}exports['GetSmsQueue']=function(_0x12b044){var _0x177bbc=this;return new Promise(function(_0x261daa,_0x536279){return db[_0x1253('0x1a')][_0x1253('0x1b')]({'raw':_0x12b044[_0x1253('0x1c')]?_0x12b044[_0x1253('0x1c')][_0x1253('0x1d')]===undefined?!![]:![]:!![],'where':_0x12b044[_0x1253('0x1c')]?_0x12b044[_0x1253('0x1c')][_0x1253('0x1e')]||null:null,'attributes':_0x12b044[_0x1253('0x1c')]?_0x12b044[_0x1253('0x1c')][_0x1253('0x1f')]||null:null,'limit':_0x12b044[_0x1253('0x1c')]?_0x12b044[_0x1253('0x1c')][_0x1253('0x20')]||null:null,'include':_0x12b044['options']?_0x12b044['options'][_0x1253('0x21')]?_[_0x1253('0x22')](_0x12b044[_0x1253('0x1c')]['include'],function(_0x25c9a1){return{'model':db[_0x25c9a1['model']],'as':_0x25c9a1['as'],'attributes':_0x25c9a1[_0x1253('0x1f')],'include':_0x25c9a1[_0x1253('0x21')]?_[_0x1253('0x22')](_0x25c9a1[_0x1253('0x21')],function(_0x42c2de){return{'model':db[_0x42c2de['model']],'as':_0x42c2de['as'],'attributes':_0x42c2de[_0x1253('0x1f')],'include':_0x42c2de[_0x1253('0x21')]?_[_0x1253('0x22')](_0x42c2de['include'],function(_0x58b606){return{'model':db[_0x58b606[_0x1253('0x23')]],'as':_0x58b606['as'],'attributes':_0x58b606[_0x1253('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1253('0xf')](function(_0x1e9aaf){logger[_0x1253('0x10')](_0x1253('0x24'),_0x12b044);logger['debug']('GetSmsQueue',_0x12b044,JSON['stringify'](_0x1e9aaf));_0x261daa(_0x1e9aaf);})['catch'](function(_0x333815){logger[_0x1253('0x14')](_0x1253('0x24'),_0x333815[_0x1253('0x17')],_0x12b044);_0x536279(_0x177bbc[_0x1253('0x14')](0x1f4,_0x333815[_0x1253('0x17')]));});});};exports[_0x1253('0x25')]=function(_0x43a93b){var _0xd23bb2=this;return new Promise(function(_0x3383af,_0x49cc6e){return db[_0x1253('0x1a')][_0x1253('0x26')]({'raw':_0x43a93b[_0x1253('0x1c')]?_0x43a93b['options'][_0x1253('0x1d')]===undefined?!![]:![]:!![],'where':_0x43a93b['options']?_0x43a93b[_0x1253('0x1c')]['where']||null:null,'attributes':_0x43a93b[_0x1253('0x1c')]?_0x43a93b[_0x1253('0x1c')]['attributes']||null:null,'include':_0x43a93b[_0x1253('0x1c')]?_0x43a93b[_0x1253('0x1c')][_0x1253('0x21')]?_[_0x1253('0x22')](_0x43a93b[_0x1253('0x1c')]['include'],function(_0x4fe5c3){return{'model':db[_0x4fe5c3[_0x1253('0x23')]],'as':_0x4fe5c3['as'],'attributes':_0x4fe5c3[_0x1253('0x1f')],'include':_0x4fe5c3[_0x1253('0x21')]?_[_0x1253('0x22')](_0x4fe5c3[_0x1253('0x21')],function(_0xab4609){return{'model':db[_0xab4609[_0x1253('0x23')]],'as':_0xab4609['as'],'attributes':_0xab4609[_0x1253('0x1f')],'include':_0xab4609[_0x1253('0x21')]?_[_0x1253('0x22')](_0xab4609[_0x1253('0x21')],function(_0x57b71c){return{'model':db[_0x57b71c[_0x1253('0x23')]],'as':_0x57b71c['as'],'attributes':_0x57b71c[_0x1253('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1253('0xf')](function(_0x2aa3e0){logger[_0x1253('0x10')](_0x1253('0x25'),_0x43a93b);logger[_0x1253('0x12')](_0x1253('0x25'),_0x43a93b,JSON[_0x1253('0x27')](_0x2aa3e0));_0x3383af(_0x2aa3e0);})[_0x1253('0x19')](function(_0x44e005){logger[_0x1253('0x14')](_0x1253('0x25'),_0x44e005[_0x1253('0x17')],_0x43a93b);_0x49cc6e(_0xd23bb2[_0x1253('0x14')](0x1f4,_0x44e005[_0x1253('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c0e741e..ad91c6e 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 _0xcff4=['remove','update','emit','removeListener','register','smsQueue:','./smsQueue.events','save'];(function(_0x21a96a,_0x75e2d6){var _0x1d6986=function(_0x2a3f8d){while(--_0x2a3f8d){_0x21a96a['push'](_0x21a96a['shift']());}};_0x1d6986(++_0x75e2d6);}(_0xcff4,0x11e));var _0x4cff=function(_0x2543e6,_0xdaa25b){_0x2543e6=_0x2543e6-0x0;var _0x5a6b9b=_0xcff4[_0x2543e6];return _0x5a6b9b;};'use strict';var SmsQueueEvents=require(_0x4cff('0x0'));var events=[_0x4cff('0x1'),_0x4cff('0x2'),_0x4cff('0x3')];function createListener(_0x3c4650,_0x627b49){return function(_0x59febf){_0x627b49[_0x4cff('0x4')](_0x3c4650,_0x59febf);};}function removeListener(_0x47a41f,_0x34a2f1){return function(){SmsQueueEvents[_0x4cff('0x5')](_0x47a41f,_0x34a2f1);};}exports[_0x4cff('0x6')]=function(_0x46dfc1){for(var _0x355206=0x0,_0x3c486a=events['length'];_0x355206<_0x3c486a;_0x355206++){var _0x1af778=events[_0x355206];var _0x85a634=createListener(_0x4cff('0x7')+_0x1af778,_0x46dfc1);SmsQueueEvents['on'](_0x1af778,_0x85a634);}}; \ No newline at end of file +var _0xc03e=['register','length','smsQueue:','./smsQueue.events','update','emit','removeListener'];(function(_0x7997b9,_0x3b244b){var _0x511558=function(_0x5818bf){while(--_0x5818bf){_0x7997b9['push'](_0x7997b9['shift']());}};_0x511558(++_0x3b244b);}(_0xc03e,0x15a));var _0xec03=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xc03e[_0x457b64];return _0x437111;};'use strict';var SmsQueueEvents=require(_0xec03('0x0'));var events=['save','remove',_0xec03('0x1')];function createListener(_0x58e2d6,_0x3af7cc){return function(_0x5b2577){_0x3af7cc[_0xec03('0x2')](_0x58e2d6,_0x5b2577);};}function removeListener(_0x269001,_0x3e3a78){return function(){SmsQueueEvents[_0xec03('0x3')](_0x269001,_0x3e3a78);};}exports[_0xec03('0x4')]=function(_0x1ce78a){for(var _0x31db21=0x0,_0xcaaf03=events[_0xec03('0x5')];_0x31db21<_0xcaaf03;_0x31db21++){var _0x529ebd=events[_0x31db21];var _0x4205e9=createListener(_0xec03('0x6')+_0x529ebd,_0x1ce78a);SmsQueueEvents['on'](_0x529ebd,_0x4205e9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 026c5ae..ad28364 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 _0xc319=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x3a9dc,_0x12a8b1){var _0x2cce34=function(_0x914d5d){while(--_0x914d5d){_0x3a9dc['push'](_0x3a9dc['shift']());}};_0x2cce34(++_0x12a8b1);}(_0xc319,0x12e));var _0x9c31=function(_0x3526ff,_0x5b7d65){_0x3526ff=_0x3526ff-0x0;var _0x26a52e=_0xc319[_0x3526ff];return _0x26a52e;};'use strict';var multer=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var path=require(_0x9c31('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c31('0x3'));var router=express[_0x9c31('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c31('0x5'));var config=require(_0x9c31('0x6'));var controller=require(_0x9c31('0x7'));router[_0x9c31('0x8')]('/',auth['isAuthenticated'](),controller[_0x9c31('0x9')]);router[_0x9c31('0x8')](_0x9c31('0xa'),auth[_0x9c31('0xb')](),controller[_0x9c31('0xc')]);router[_0x9c31('0x8')](_0x9c31('0xd'),auth[_0x9c31('0xb')](),controller[_0x9c31('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9c31('0xf')](_0x9c31('0xd'),auth[_0x9c31('0xb')](),controller[_0x9c31('0x10')]);router[_0x9c31('0x11')]('/:id',auth[_0x9c31('0xb')](),controller[_0x9c31('0x12')]);module[_0x9c31('0x13')]=router; \ No newline at end of file +var _0x13fe=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x13fe,0x138));var _0xe13f=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x13fe[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe13f('0x0'));var util=require(_0xe13f('0x1'));var path=require(_0xe13f('0x2'));var timeout=require(_0xe13f('0x3'));var express=require(_0xe13f('0x4'));var router=express[_0xe13f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe13f('0x6'));var config=require(_0xe13f('0x7'));var controller=require(_0xe13f('0x8'));router[_0xe13f('0x9')]('/',auth[_0xe13f('0xa')](),controller[_0xe13f('0xb')]);router[_0xe13f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe13f('0xc')]);router[_0xe13f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe13f('0xd')]);router[_0xe13f('0xe')]('/',auth['isAuthenticated'](),controller[_0xe13f('0xf')]);router[_0xe13f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe13f('0x11')]);router[_0xe13f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe13f('0x13')]);module[_0xe13f('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index af8ddc8..4a0009b 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 _0xdf91=['exports','STRING','DATE'];(function(_0x34d8c5,_0x194236){var _0xf84430=function(_0x1a3acc){while(--_0x1a3acc){_0x34d8c5['push'](_0x34d8c5['shift']());}};_0xf84430(++_0x194236);}(_0xdf91,0x1e9));var _0x1df9=function(_0x525864,_0x1bb3ea){_0x525864=_0x525864-0x0;var _0x4f9964=_0xdf91[_0x525864];return _0x4f9964;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1df9('0x0')]={'uniqueid':{'type':Sequelize[_0x1df9('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1df9('0x1')]},'joinAt':{'type':Sequelize[_0x1df9('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1df9('0x2')]},'reason':{'type':Sequelize[_0x1df9('0x1')]}}; \ No newline at end of file +var _0x6a30=['STRING','DATE','moment','sequelize'];(function(_0x3e3c7f,_0x1a7310){var _0x4041a1=function(_0x1fda03){while(--_0x1fda03){_0x3e3c7f['push'](_0x3e3c7f['shift']());}};_0x4041a1(++_0x1a7310);}(_0x6a30,0x11e));var _0x06a3=function(_0xee49bf,_0x39a064){_0xee49bf=_0xee49bf-0x0;var _0x501138=_0x6a30[_0xee49bf];return _0x501138;};'use strict';var moment=require(_0x06a3('0x0'));var Sequelize=require(_0x06a3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x06a3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x06a3('0x3')]},'leaveAt':{'type':Sequelize[_0x06a3('0x3')]},'acceptAt':{'type':Sequelize[_0x06a3('0x3')]},'exitAt':{'type':Sequelize[_0x06a3('0x3')]},'reason':{'type':Sequelize[_0x06a3('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 4a36b15..ea767a2 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 _0x1678=['keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','map','type','key','field','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','reject','update','then','destroy','stack','name','send','SmsQueueReport','model'];(function(_0x3675ae,_0x3f3abb){var _0x29fc79=function(_0x5e0569){while(--_0x5e0569){_0x3675ae['push'](_0x3675ae['shift']());}};_0x29fc79(++_0x3f3abb);}(_0x1678,0x17b));var _0x8167=function(_0x3dd0f4,_0x26d840){_0x3dd0f4=_0x3dd0f4-0x0;var _0x3244be=_0x1678[_0x3dd0f4];return _0x3244be;};'use strict';var pdf=require(_0x8167('0x0'));var emlformat=require(_0x8167('0x1'));var rimraf=require(_0x8167('0x2'));var zipdir=require(_0x8167('0x3'));var jsonpatch=require(_0x8167('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8167('0x5'));var Mustache=require(_0x8167('0x6'));var util=require(_0x8167('0x7'));var path=require(_0x8167('0x8'));var sox=require(_0x8167('0x9'));var csv=require(_0x8167('0xa'));var ejs=require(_0x8167('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8167('0xc'));var crypto=require(_0x8167('0xd'));var jsforce=require(_0x8167('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8167('0xf'));var Papa=require(_0x8167('0x10'));var Redis=require('ioredis');var authService=require(_0x8167('0x11'));var qs=require(_0x8167('0x12'));var hardwareService=require(_0x8167('0x13'));var logger=require(_0x8167('0x14'))(_0x8167('0x15'));var utils=require(_0x8167('0x16'));var config=require(_0x8167('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564b01,_0x11bf1c){_0x11bf1c=_0x11bf1c||0xcc;return function(_0x4b5b3c){if(_0x4b5b3c){return _0x564b01[_0x8167('0x18')](_0x11bf1c);}return _0x564b01[_0x8167('0x19')](_0x11bf1c)[_0x8167('0x1a')]();};}function respondWithResult(_0x3e7521,_0x45cb52){_0x45cb52=_0x45cb52||0xc8;return function(_0x4abe96){if(_0x4abe96){return _0x3e7521[_0x8167('0x19')](_0x45cb52)['json'](_0x4abe96);}};}function respondWithFilteredResult(_0x5968f3,_0x591413){return function(_0x491703){if(_0x491703){var _0x1d6344=_0x491703[_0x8167('0x1b')],_0x240fce=_0x591413[_0x8167('0x1c')],_0x2aab53=_0x591413[_0x8167('0x1c')]+_0x591413[_0x8167('0x1d')],_0x9bd451;if(_0x2aab53>=_0x1d6344){_0x2aab53=_0x1d6344;_0x9bd451=0xc8;}else{_0x9bd451=0xce;}_0x5968f3[_0x8167('0x19')](_0x9bd451);return _0x5968f3[_0x8167('0x1e')]('Content-Range',_0x240fce+'-'+_0x2aab53+'/'+_0x1d6344)[_0x8167('0x1f')](_0x491703);}return null;};}function patchUpdates(_0x4a4918){return function(_0x2c6255){try{jsonpatch['apply'](_0x2c6255,_0x4a4918,!![]);}catch(_0x41b81a){return BPromise[_0x8167('0x20')](_0x41b81a);}return _0x2c6255['save']();};}function saveUpdates(_0x84d048,_0x25a59a){return function(_0x2d9c47){if(_0x2d9c47){return _0x2d9c47[_0x8167('0x21')](_0x84d048)[_0x8167('0x22')](function(_0x30d4e3){return _0x30d4e3;});}return null;};}function removeEntity(_0x448cf8,_0x331c68){return function(_0x5ee50c){if(_0x5ee50c){return _0x5ee50c[_0x8167('0x23')]()['then'](function(){_0x448cf8['status'](0xcc)[_0x8167('0x1a')]();});}};}function handleEntityNotFound(_0x5a29f2,_0x5024a6){return function(_0x3be9c9){if(!_0x3be9c9){_0x5a29f2[_0x8167('0x18')](0x194);}return _0x3be9c9;};}function handleError(_0xbf60c3,_0x4edb8a){_0x4edb8a=_0x4edb8a||0x1f4;return function(_0x3d466c){logger['error'](_0x3d466c[_0x8167('0x24')]);if(_0x3d466c['name']){delete _0x3d466c[_0x8167('0x25')];}_0xbf60c3[_0x8167('0x19')](_0x4edb8a)[_0x8167('0x26')](_0x3d466c);};}exports['index']=function(_0x7ce0a5,_0x1cb49c){var _0x120834={},_0x3995b2={},_0x643d1b={'count':0x0,'rows':[]};var _0x10fb6c=db[_0x8167('0x27')]['rawAttributes'];_0x3995b2[_0x8167('0x28')]=_[_0x8167('0x29')](_0x10fb6c);_0x3995b2['query']=_[_0x8167('0x29')](_0x7ce0a5[_0x8167('0x2a')]);_0x3995b2[_0x8167('0x2b')]=_[_0x8167('0x2c')](_0x3995b2[_0x8167('0x28')],_0x3995b2[_0x8167('0x2a')]);_0x120834[_0x8167('0x2d')]=_['intersection'](_0x3995b2[_0x8167('0x28')],qs[_0x8167('0x2e')](_0x7ce0a5['query'][_0x8167('0x2e')]));_0x120834[_0x8167('0x2d')]=_0x120834[_0x8167('0x2d')][_0x8167('0x2f')]?_0x120834[_0x8167('0x2d')]:_0x3995b2['model'];if(!_0x7ce0a5[_0x8167('0x2a')]['hasOwnProperty'](_0x8167('0x30'))){_0x120834[_0x8167('0x1d')]=qs[_0x8167('0x1d')](_0x7ce0a5[_0x8167('0x2a')][_0x8167('0x1d')]);_0x120834['offset']=qs['offset'](_0x7ce0a5['query']['offset']);}_0x120834[_0x8167('0x31')]=qs[_0x8167('0x32')](_0x7ce0a5[_0x8167('0x2a')][_0x8167('0x32')]);_0x120834[_0x8167('0x33')]=qs[_0x8167('0x2b')](_['pick'](_0x7ce0a5[_0x8167('0x2a')],_0x3995b2['filters']));if(_0x7ce0a5[_0x8167('0x2a')][_0x8167('0x34')]){_0x120834['where']=_['merge'](_0x120834[_0x8167('0x33')],{'$or':_[_0x8167('0x35')](_0x10fb6c,function(_0x3a13a2){if(_0x3a13a2[_0x8167('0x36')][_0x8167('0x37')]!=='VIRTUAL'){var _0x4a6665={};_0x4a6665[_0x3a13a2[_0x8167('0x38')]]={'$like':'%'+_0x7ce0a5['query'][_0x8167('0x34')]+'%'};return _0x4a6665;}})});}_0x120834=_[_0x8167('0x39')]({},_0x120834,_0x7ce0a5['options']);var _0x2bb498={'where':_0x120834[_0x8167('0x33')]};return db[_0x8167('0x27')][_0x8167('0x1b')](_0x2bb498)[_0x8167('0x22')](function(_0x2dd03f){_0x643d1b[_0x8167('0x1b')]=_0x2dd03f;if(_0x7ce0a5[_0x8167('0x2a')][_0x8167('0x3a')]){_0x120834[_0x8167('0x3b')]=[{'all':!![]}];}return db[_0x8167('0x27')][_0x8167('0x3c')](_0x120834);})[_0x8167('0x22')](function(_0x73ec2f){_0x643d1b[_0x8167('0x3d')]=_0x73ec2f;return _0x643d1b;})['then'](respondWithFilteredResult(_0x1cb49c,_0x120834))[_0x8167('0x3e')](handleError(_0x1cb49c,null));};exports['show']=function(_0x38633b,_0x4a398f){var _0x8de8ab={'raw':!![],'where':{'id':_0x38633b['params']['id']}},_0xbbcfd2={};_0xbbcfd2[_0x8167('0x28')]=_['keys'](db['SmsQueueReport'][_0x8167('0x3f')]);_0xbbcfd2['query']=_[_0x8167('0x29')](_0x38633b['query']);_0xbbcfd2[_0x8167('0x2b')]=_[_0x8167('0x2c')](_0xbbcfd2['model'],_0xbbcfd2[_0x8167('0x2a')]);_0x8de8ab[_0x8167('0x2d')]=_[_0x8167('0x2c')](_0xbbcfd2[_0x8167('0x28')],qs[_0x8167('0x2e')](_0x38633b[_0x8167('0x2a')][_0x8167('0x2e')]));_0x8de8ab[_0x8167('0x2d')]=_0x8de8ab[_0x8167('0x2d')][_0x8167('0x2f')]?_0x8de8ab[_0x8167('0x2d')]:_0xbbcfd2[_0x8167('0x28')];if(_0x38633b[_0x8167('0x2a')][_0x8167('0x3a')]){_0x8de8ab['include']=[{'all':!![]}];}_0x8de8ab=_[_0x8167('0x39')]({},_0x8de8ab,_0x38633b[_0x8167('0x40')]);return db[_0x8167('0x27')]['find'](_0x8de8ab)[_0x8167('0x22')](handleEntityNotFound(_0x4a398f,null))[_0x8167('0x22')](respondWithResult(_0x4a398f,null))[_0x8167('0x3e')](handleError(_0x4a398f,null));};exports[_0x8167('0x41')]=function(_0x46dec5,_0x214aa1){return db[_0x8167('0x27')][_0x8167('0x41')](_0x46dec5[_0x8167('0x42')],{})[_0x8167('0x22')](respondWithResult(_0x214aa1,0xc9))[_0x8167('0x3e')](handleError(_0x214aa1,null));};exports[_0x8167('0x21')]=function(_0x3b9843,_0x543fef){if(_0x3b9843[_0x8167('0x42')]['id']){delete _0x3b9843[_0x8167('0x42')]['id'];}return db[_0x8167('0x27')][_0x8167('0x43')]({'where':{'id':_0x3b9843[_0x8167('0x44')]['id']}})[_0x8167('0x22')](handleEntityNotFound(_0x543fef,null))[_0x8167('0x22')](saveUpdates(_0x3b9843['body'],null))[_0x8167('0x22')](respondWithResult(_0x543fef,null))['catch'](handleError(_0x543fef,null));};exports[_0x8167('0x23')]=function(_0x3a864a,_0x2404ae){return db[_0x8167('0x27')][_0x8167('0x43')]({'where':{'id':_0x3a864a['params']['id']}})[_0x8167('0x22')](handleEntityNotFound(_0x2404ae,null))[_0x8167('0x22')](removeEntity(_0x2404ae,null))[_0x8167('0x3e')](handleError(_0x2404ae,null));};exports[_0x8167('0x45')]=function(_0x28b70c,_0x50783b){return db[_0x8167('0x27')][_0x8167('0x45')]()[_0x8167('0x22')](respondWithResult(_0x50783b,null))[_0x8167('0x3e')](handleError(_0x50783b,null));}; \ No newline at end of file +var _0x1280=['model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','includeAll','findAll','catch','show','keys','length','include','options','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SmsQueueReport','rawAttributes','query','intersection','attributes'];(function(_0x5b6d6b,_0x4d5dbb){var _0x569054=function(_0x25a5bc){while(--_0x25a5bc){_0x5b6d6b['push'](_0x5b6d6b['shift']());}};_0x569054(++_0x4d5dbb);}(_0x1280,0xac));var _0x0128=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x1280[_0x34eb31];return _0x254994;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require('mustache');var util=require(_0x0128('0x7'));var path=require(_0x0128('0x8'));var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0128('0xb'));var crypto=require(_0x0128('0xc'));var jsforce=require(_0x0128('0xd'));var deskjs=require(_0x0128('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var hardwareService=require(_0x0128('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0128('0x14'));var config=require(_0x0128('0x15'));var db=require(_0x0128('0x16'))['db'];function respondWithStatusCode(_0x5b148b,_0xb44c5c){_0xb44c5c=_0xb44c5c||0xcc;return function(_0x511f20){if(_0x511f20){return _0x5b148b[_0x0128('0x17')](_0xb44c5c);}return _0x5b148b['status'](_0xb44c5c)[_0x0128('0x18')]();};}function respondWithResult(_0x4d24c4,_0xbc843d){_0xbc843d=_0xbc843d||0xc8;return function(_0x4bad0a){if(_0x4bad0a){return _0x4d24c4[_0x0128('0x19')](_0xbc843d)[_0x0128('0x1a')](_0x4bad0a);}};}function respondWithFilteredResult(_0x3f6a3c,_0x5a42eb){return function(_0x2046f8){if(_0x2046f8){var _0x43f107=_0x2046f8[_0x0128('0x1b')],_0x59a472=_0x5a42eb[_0x0128('0x1c')],_0x46a5fd=_0x5a42eb[_0x0128('0x1c')]+_0x5a42eb[_0x0128('0x1d')],_0x40ff84;if(_0x46a5fd>=_0x43f107){_0x46a5fd=_0x43f107;_0x40ff84=0xc8;}else{_0x40ff84=0xce;}_0x3f6a3c['status'](_0x40ff84);return _0x3f6a3c[_0x0128('0x1e')](_0x0128('0x1f'),_0x59a472+'-'+_0x46a5fd+'/'+_0x43f107)[_0x0128('0x1a')](_0x2046f8);}return null;};}function patchUpdates(_0x431b13){return function(_0xe5b7d2){try{jsonpatch[_0x0128('0x20')](_0xe5b7d2,_0x431b13,!![]);}catch(_0x5a8a8f){return BPromise[_0x0128('0x21')](_0x5a8a8f);}return _0xe5b7d2[_0x0128('0x22')]();};}function saveUpdates(_0x5d946e,_0x4ad121){return function(_0x2c000a){if(_0x2c000a){return _0x2c000a[_0x0128('0x23')](_0x5d946e)[_0x0128('0x24')](function(_0x17949a){return _0x17949a;});}return null;};}function removeEntity(_0x34f6c4,_0x3ba828){return function(_0x10b436){if(_0x10b436){return _0x10b436[_0x0128('0x25')]()['then'](function(){_0x34f6c4['status'](0xcc)[_0x0128('0x18')]();});}};}function handleEntityNotFound(_0x5c21e3,_0x3638e3){return function(_0x33354b){if(!_0x33354b){_0x5c21e3[_0x0128('0x17')](0x194);}return _0x33354b;};}function handleError(_0x47d79d,_0x135b8b){_0x135b8b=_0x135b8b||0x1f4;return function(_0x54e1cc){logger[_0x0128('0x26')](_0x54e1cc[_0x0128('0x27')]);if(_0x54e1cc[_0x0128('0x28')]){delete _0x54e1cc[_0x0128('0x28')];}_0x47d79d[_0x0128('0x19')](_0x135b8b)['send'](_0x54e1cc);};}exports[_0x0128('0x29')]=function(_0x3a9e26,_0x4f5090){var _0x2b1819={},_0x976553={},_0x4ee634={'count':0x0,'rows':[]};var _0xb6e133=db[_0x0128('0x2a')][_0x0128('0x2b')];_0x976553['model']=_['keys'](_0xb6e133);_0x976553[_0x0128('0x2c')]=_['keys'](_0x3a9e26['query']);_0x976553['filters']=_[_0x0128('0x2d')](_0x976553['model'],_0x976553[_0x0128('0x2c')]);_0x2b1819[_0x0128('0x2e')]=_[_0x0128('0x2d')](_0x976553[_0x0128('0x2f')],qs['fields'](_0x3a9e26[_0x0128('0x2c')][_0x0128('0x30')]));_0x2b1819[_0x0128('0x2e')]=_0x2b1819[_0x0128('0x2e')]['length']?_0x2b1819[_0x0128('0x2e')]:_0x976553[_0x0128('0x2f')];if(!_0x3a9e26[_0x0128('0x2c')][_0x0128('0x31')](_0x0128('0x32'))){_0x2b1819[_0x0128('0x1d')]=qs[_0x0128('0x1d')](_0x3a9e26['query']['limit']);_0x2b1819['offset']=qs[_0x0128('0x1c')](_0x3a9e26[_0x0128('0x2c')][_0x0128('0x1c')]);}_0x2b1819['order']=qs[_0x0128('0x33')](_0x3a9e26['query'][_0x0128('0x33')]);_0x2b1819[_0x0128('0x34')]=qs[_0x0128('0x35')](_[_0x0128('0x36')](_0x3a9e26['query'],_0x976553['filters']));if(_0x3a9e26[_0x0128('0x2c')][_0x0128('0x37')]){_0x2b1819[_0x0128('0x34')]=_[_0x0128('0x38')](_0x2b1819['where'],{'$or':_['map'](_0xb6e133,function(_0x2a534b){if(_0x2a534b[_0x0128('0x39')][_0x0128('0x3a')]!==_0x0128('0x3b')){var _0x31a2be={};_0x31a2be[_0x2a534b['field']]={'$like':'%'+_0x3a9e26[_0x0128('0x2c')][_0x0128('0x37')]+'%'};return _0x31a2be;}})});}_0x2b1819=_[_0x0128('0x38')]({},_0x2b1819,_0x3a9e26['options']);var _0x595852={'where':_0x2b1819[_0x0128('0x34')]};return db[_0x0128('0x2a')][_0x0128('0x1b')](_0x595852)[_0x0128('0x24')](function(_0x29da11){_0x4ee634['count']=_0x29da11;if(_0x3a9e26[_0x0128('0x2c')][_0x0128('0x3c')]){_0x2b1819['include']=[{'all':!![]}];}return db[_0x0128('0x2a')][_0x0128('0x3d')](_0x2b1819);})['then'](function(_0x38e1eb){_0x4ee634['rows']=_0x38e1eb;return _0x4ee634;})[_0x0128('0x24')](respondWithFilteredResult(_0x4f5090,_0x2b1819))[_0x0128('0x3e')](handleError(_0x4f5090,null));};exports[_0x0128('0x3f')]=function(_0x3385a9,_0x348baf){var _0x181ff1={'raw':!![],'where':{'id':_0x3385a9['params']['id']}},_0x5bf361={};_0x5bf361[_0x0128('0x2f')]=_['keys'](db['SmsQueueReport'][_0x0128('0x2b')]);_0x5bf361['query']=_[_0x0128('0x40')](_0x3385a9[_0x0128('0x2c')]);_0x5bf361[_0x0128('0x35')]=_[_0x0128('0x2d')](_0x5bf361[_0x0128('0x2f')],_0x5bf361[_0x0128('0x2c')]);_0x181ff1[_0x0128('0x2e')]=_[_0x0128('0x2d')](_0x5bf361[_0x0128('0x2f')],qs[_0x0128('0x30')](_0x3385a9[_0x0128('0x2c')][_0x0128('0x30')]));_0x181ff1[_0x0128('0x2e')]=_0x181ff1['attributes'][_0x0128('0x41')]?_0x181ff1[_0x0128('0x2e')]:_0x5bf361['model'];if(_0x3385a9[_0x0128('0x2c')][_0x0128('0x3c')]){_0x181ff1[_0x0128('0x42')]=[{'all':!![]}];}_0x181ff1=_[_0x0128('0x38')]({},_0x181ff1,_0x3385a9[_0x0128('0x43')]);return db['SmsQueueReport'][_0x0128('0x44')](_0x181ff1)[_0x0128('0x24')](handleEntityNotFound(_0x348baf,null))[_0x0128('0x24')](respondWithResult(_0x348baf,null))[_0x0128('0x3e')](handleError(_0x348baf,null));};exports[_0x0128('0x45')]=function(_0x3555bc,_0x318d88){return db[_0x0128('0x2a')][_0x0128('0x45')](_0x3555bc['body'],{})[_0x0128('0x24')](respondWithResult(_0x318d88,0xc9))['catch'](handleError(_0x318d88,null));};exports[_0x0128('0x23')]=function(_0x7105f8,_0x16d779){if(_0x7105f8[_0x0128('0x46')]['id']){delete _0x7105f8[_0x0128('0x46')]['id'];}return db[_0x0128('0x2a')][_0x0128('0x44')]({'where':{'id':_0x7105f8[_0x0128('0x47')]['id']}})['then'](handleEntityNotFound(_0x16d779,null))['then'](saveUpdates(_0x7105f8[_0x0128('0x46')],null))[_0x0128('0x24')](respondWithResult(_0x16d779,null))['catch'](handleError(_0x16d779,null));};exports[_0x0128('0x25')]=function(_0x133c7f,_0x47d364){return db[_0x0128('0x2a')][_0x0128('0x44')]({'where':{'id':_0x133c7f[_0x0128('0x47')]['id']}})[_0x0128('0x24')](handleEntityNotFound(_0x47d364,null))['then'](removeEntity(_0x47d364,null))['catch'](handleError(_0x47d364,null));};exports[_0x0128('0x48')]=function(_0x5051fa,_0x315103){return db['SmsQueueReport'][_0x0128('0x48')]()[_0x0128('0x24')](respondWithResult(_0x315103,null))[_0x0128('0x3e')](handleError(_0x315103,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f858439..c14ba91 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 _0xf368=['bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xf368,0x175));var _0x8f36=function(_0x1696f3,_0xc9c535){_0x1696f3=_0x1696f3-0x0;var _0x305313=_0xf368[_0x1696f3];return _0x305313;};'use strict';var _=require(_0x8f36('0x0'));var util=require('util');var logger=require(_0x8f36('0x1'))(_0x8f36('0x2'));var moment=require(_0x8f36('0x3'));var BPromise=require(_0x8f36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f36('0x5'));var rimraf=require(_0x8f36('0x6'));var config=require(_0x8f36('0x7'));var attributes=require(_0x8f36('0x8'));module['exports']=function(_0x5dbe30,_0x41c8ac){return _0x5dbe30[_0x8f36('0x9')](_0x8f36('0xa'),attributes,{'tableName':_0x8f36('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8f36('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2f2=['request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x57182b,_0xa44def){var _0x14aaf9=function(_0x5f2a23){while(--_0x5f2a23){_0x57182b['push'](_0x57182b['shift']());}};_0x14aaf9(++_0xa44def);}(_0xe2f2,0x95));var _0x2e2f=function(_0xf0e14a,_0x4fc9f9){_0xf0e14a=_0xf0e14a-0x0;var _0x98407=_0xe2f2[_0xf0e14a];return _0x98407;};'use strict';var _=require(_0x2e2f('0x0'));var util=require(_0x2e2f('0x1'));var logger=require(_0x2e2f('0x2'))(_0x2e2f('0x3'));var moment=require(_0x2e2f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e2f('0x6'));var config=require(_0x2e2f('0x7'));var attributes=require(_0x2e2f('0x8'));module[_0x2e2f('0x9')]=function(_0x32ca73,_0x45414f){return _0x32ca73[_0x2e2f('0xa')](_0x2e2f('0xb'),attributes,{'tableName':_0x2e2f('0xc'),'paranoid':![],'indexes':[{'name':_0x2e2f('0xd'),'fields':[_0x2e2f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 0339f1b..05e2204 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 _0x795c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','update','body','raw','where','UpdateSmsQueueReport','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x795c,0xfb));var _0xc795=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x795c[_0x138f59];return _0x3d114d;};'use strict';var _=require('lodash');var util=require(_0xc795('0x0'));var moment=require(_0xc795('0x1'));var BPromise=require('bluebird');var rs=require(_0xc795('0x2'));var fs=require('fs');var Redis=require(_0xc795('0x3'));var db=require(_0xc795('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc795('0x5'))(_0xc795('0x6'));var config=require(_0xc795('0x7'));var jayson=require(_0xc795('0x8'));var client=jayson[_0xc795('0x9')][_0xc795('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43528a,_0x11827b,_0x437d3e){return new BPromise(function(_0x1aa6fa,_0x52024b){return client[_0xc795('0xb')](_0x43528a,_0x437d3e)[_0xc795('0xc')](function(_0x17c06f){logger[_0xc795('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x11827b,_0xc795('0xe'));logger[_0xc795('0xf')](_0xc795('0x10'),_0x11827b,_0xc795('0xe'),JSON[_0xc795('0x11')](_0x17c06f));if(_0x17c06f[_0xc795('0x12')]){if(_0x17c06f[_0xc795('0x12')]['code']===0x1f4){logger[_0xc795('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x11827b,_0x17c06f[_0xc795('0x12')][_0xc795('0x13')]);return _0x52024b(_0x17c06f[_0xc795('0x12')][_0xc795('0x13')]);}logger[_0xc795('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x11827b,_0x17c06f[_0xc795('0x12')][_0xc795('0x13')]);return _0x1aa6fa(_0x17c06f['error']['message']);}else{logger[_0xc795('0xd')](_0xc795('0x14'),_0x11827b,_0xc795('0xe'));_0x1aa6fa(_0x17c06f[_0xc795('0x15')][_0xc795('0x13')]);}})[_0xc795('0x16')](function(_0x2b33a6){logger['error'](_0xc795('0x14'),_0x11827b,_0x2b33a6);_0x52024b(_0x2b33a6);});});}exports[_0xc795('0x17')]=function(_0x59a05e){var _0x5f419a=this;return new Promise(function(_0x2044e0,_0x4d085c){return db[_0xc795('0x18')][_0xc795('0x19')](_0x59a05e['body'],{'raw':_0x59a05e[_0xc795('0x1a')]?_0x59a05e['options']['raw']===undefined?!![]:![]:!![]})[_0xc795('0xc')](function(_0x11b12c){logger[_0xc795('0xd')]('CreateSmsQueueReport',_0x59a05e);logger[_0xc795('0xf')]('CreateSmsQueueReport',_0x59a05e,JSON[_0xc795('0x11')](_0x11b12c));_0x2044e0(_0x11b12c);})[_0xc795('0x16')](function(_0x460a5a){logger[_0xc795('0x12')](_0xc795('0x17'),_0x460a5a[_0xc795('0x13')],_0x59a05e);_0x4d085c(_0x5f419a[_0xc795('0x12')](0x1f4,_0x460a5a[_0xc795('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x1ea3cc){var _0x16c2e8=this;return new Promise(function(_0x598fbe,_0x2ae578){return db[_0xc795('0x18')][_0xc795('0x1b')](_0x1ea3cc[_0xc795('0x1c')],{'raw':_0x1ea3cc['options']?_0x1ea3cc[_0xc795('0x1a')][_0xc795('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ea3cc['options']?_0x1ea3cc['options'][_0xc795('0x1e')]||null:null,'attributes':_0x1ea3cc[_0xc795('0x1a')]?_0x1ea3cc[_0xc795('0x1a')]['attributes']||null:null,'limit':_0x1ea3cc[_0xc795('0x1a')]?_0x1ea3cc['options']['limit']||null:null})[_0xc795('0xc')](function(_0x2fd2bf){logger['info'](_0xc795('0x1f'),_0x1ea3cc);logger[_0xc795('0xf')](_0xc795('0x1f'),_0x1ea3cc,JSON[_0xc795('0x11')](_0x2fd2bf));_0x598fbe(_0x2fd2bf);})['catch'](function(_0x4d2e5){logger['error']('UpdateSmsQueueReport',_0x4d2e5[_0xc795('0x13')],_0x1ea3cc);_0x2ae578(_0x16c2e8[_0xc795('0x12')](0x1f4,_0x4d2e5['message']));});});}; \ No newline at end of file +var _0xe7a6=['stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','create','body','options','raw','debug'];(function(_0x4a57b7,_0x275414){var _0x592105=function(_0x323ed9){while(--_0x323ed9){_0x4a57b7['push'](_0x4a57b7['shift']());}};_0x592105(++_0x275414);}(_0xe7a6,0xc7));var _0x6e7a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe7a6[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x6e7a('0x0'));var moment=require(_0x6e7a('0x1'));var BPromise=require(_0x6e7a('0x2'));var rs=require(_0x6e7a('0x3'));var fs=require('fs');var Redis=require(_0x6e7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e7a('0x5'))('rpc');var config=require(_0x6e7a('0x6'));var jayson=require(_0x6e7a('0x7'));var client=jayson['client'][_0x6e7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3be92c,_0x2027cc,_0x2f4fe2){return new BPromise(function(_0x56d0c4,_0x473ed5){return client[_0x6e7a('0x9')](_0x3be92c,_0x2f4fe2)[_0x6e7a('0xa')](function(_0x1de8a4){logger[_0x6e7a('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x2027cc,_0x6e7a('0xc'));logger['debug'](_0x6e7a('0xd'),_0x2027cc,_0x6e7a('0xc'),JSON['stringify'](_0x1de8a4));if(_0x1de8a4[_0x6e7a('0xe')]){if(_0x1de8a4[_0x6e7a('0xe')][_0x6e7a('0xf')]===0x1f4){logger[_0x6e7a('0xe')](_0x6e7a('0x10'),_0x2027cc,_0x1de8a4['error'][_0x6e7a('0x11')]);return _0x473ed5(_0x1de8a4[_0x6e7a('0xe')][_0x6e7a('0x11')]);}logger['error'](_0x6e7a('0x10'),_0x2027cc,_0x1de8a4[_0x6e7a('0xe')][_0x6e7a('0x11')]);return _0x56d0c4(_0x1de8a4[_0x6e7a('0xe')][_0x6e7a('0x11')]);}else{logger[_0x6e7a('0xb')](_0x6e7a('0x10'),_0x2027cc,_0x6e7a('0xc'));_0x56d0c4(_0x1de8a4['result'][_0x6e7a('0x11')]);}})[_0x6e7a('0x12')](function(_0x3536a5){logger[_0x6e7a('0xe')](_0x6e7a('0x10'),_0x2027cc,_0x3536a5);_0x473ed5(_0x3536a5);});});}exports[_0x6e7a('0x13')]=function(_0x141ffb){var _0x5014cb=this;return new Promise(function(_0x39c76e,_0x265af7){return db['SmsQueueReport'][_0x6e7a('0x14')](_0x141ffb[_0x6e7a('0x15')],{'raw':_0x141ffb['options']?_0x141ffb[_0x6e7a('0x16')][_0x6e7a('0x17')]===undefined?!![]:![]:!![]})[_0x6e7a('0xa')](function(_0x5e9512){logger[_0x6e7a('0xb')](_0x6e7a('0x13'),_0x141ffb);logger[_0x6e7a('0x18')]('CreateSmsQueueReport',_0x141ffb,JSON[_0x6e7a('0x19')](_0x5e9512));_0x39c76e(_0x5e9512);})[_0x6e7a('0x12')](function(_0x46cf11){logger['error'](_0x6e7a('0x13'),_0x46cf11[_0x6e7a('0x11')],_0x141ffb);_0x265af7(_0x5014cb[_0x6e7a('0xe')](0x1f4,_0x46cf11[_0x6e7a('0x11')]));});});};exports[_0x6e7a('0x1a')]=function(_0x3d8138){var _0x249783=this;return new Promise(function(_0x16aec8,_0x77b6c2){return db[_0x6e7a('0x1b')][_0x6e7a('0x1c')](_0x3d8138[_0x6e7a('0x15')],{'raw':_0x3d8138[_0x6e7a('0x16')]?_0x3d8138[_0x6e7a('0x16')][_0x6e7a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d8138[_0x6e7a('0x16')]?_0x3d8138[_0x6e7a('0x16')][_0x6e7a('0x1d')]||null:null,'attributes':_0x3d8138[_0x6e7a('0x16')]?_0x3d8138['options'][_0x6e7a('0x1e')]||null:null,'limit':_0x3d8138[_0x6e7a('0x16')]?_0x3d8138['options'][_0x6e7a('0x1f')]||null:null})[_0x6e7a('0xa')](function(_0x234138){logger[_0x6e7a('0xb')](_0x6e7a('0x1a'),_0x3d8138);logger[_0x6e7a('0x18')](_0x6e7a('0x1a'),_0x3d8138,JSON[_0x6e7a('0x19')](_0x234138));_0x16aec8(_0x234138);})['catch'](function(_0x4c808a){logger[_0x6e7a('0xe')](_0x6e7a('0x1a'),_0x4c808a[_0x6e7a('0x11')],_0x3d8138);_0x77b6c2(_0x249783[_0x6e7a('0xe')](0x1f4,_0x4c808a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a4f6ddd..9c1ce3c 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 _0xfef0=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsTransferReport.controller'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xfef0,0x19a));var _0x0fef=function(_0x4c408e,_0x100277){_0x4c408e=_0x4c408e-0x0;var _0x5ee2fe=_0xfef0[_0x4c408e];return _0x5ee2fe;};'use strict';var multer=require(_0x0fef('0x0'));var util=require(_0x0fef('0x1'));var path=require(_0x0fef('0x2'));var timeout=require(_0x0fef('0x3'));var express=require(_0x0fef('0x4'));var router=express[_0x0fef('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fef('0x6'));var controller=require(_0x0fef('0x7'));router[_0x0fef('0x8')]('/',auth[_0x0fef('0x9')](),controller[_0x0fef('0xa')]);router[_0x0fef('0x8')](_0x0fef('0xb'),auth[_0x0fef('0x9')](),controller[_0x0fef('0xc')]);router['get'](_0x0fef('0xd'),auth[_0x0fef('0x9')](),controller[_0x0fef('0xe')]);router[_0x0fef('0xf')]('/',auth[_0x0fef('0x9')](),controller[_0x0fef('0x10')]);router[_0x0fef('0x11')]('/:id',auth[_0x0fef('0x9')](),controller[_0x0fef('0x12')]);router[_0x0fef('0x13')](_0x0fef('0xd'),auth[_0x0fef('0x9')](),controller[_0x0fef('0x14')]);module[_0x0fef('0x15')]=router; \ No newline at end of file +var _0x1897=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','delete'];(function(_0x1f0e99,_0x3e4a79){var _0xee8aa=function(_0x3bac43){while(--_0x3bac43){_0x1f0e99['push'](_0x1f0e99['shift']());}};_0xee8aa(++_0x3e4a79);}(_0x1897,0x158));var _0x7189=function(_0x3aa17a,_0x42e72c){_0x3aa17a=_0x3aa17a-0x0;var _0x3c8895=_0x1897[_0x3aa17a];return _0x3c8895;};'use strict';var multer=require(_0x7189('0x0'));var util=require(_0x7189('0x1'));var path=require(_0x7189('0x2'));var timeout=require(_0x7189('0x3'));var express=require(_0x7189('0x4'));var router=express[_0x7189('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7189('0x6'));var config=require('../../config/environment');var controller=require(_0x7189('0x7'));router[_0x7189('0x8')]('/',auth[_0x7189('0x9')](),controller[_0x7189('0xa')]);router[_0x7189('0x8')](_0x7189('0xb'),auth[_0x7189('0x9')](),controller['describe']);router[_0x7189('0x8')](_0x7189('0xc'),auth[_0x7189('0x9')](),controller['show']);router[_0x7189('0xd')]('/',auth[_0x7189('0x9')](),controller['create']);router[_0x7189('0xe')](_0x7189('0xc'),auth[_0x7189('0x9')](),controller[_0x7189('0xf')]);router[_0x7189('0x10')](_0x7189('0xc'),auth['isAuthenticated'](),controller[_0x7189('0x11')]);module[_0x7189('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a0142bc..dbd4cd3 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 _0x7a00=['exports','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x7a00,0x115));var _0x07a0=function(_0x4045ff,_0x5c8ac7){_0x4045ff=_0x4045ff-0x0;var _0x517eea=_0x7a00[_0x4045ff];return _0x517eea;};'use strict';var moment=require(_0x07a0('0x0'));var Sequelize=require(_0x07a0('0x1'));module[_0x07a0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x07a0('0x3')](_0x07a0('0x4'),_0x07a0('0x5'),_0x07a0('0x6')),'allowNull':![],'defaultValue':_0x07a0('0x6')},'transferredAt':{'type':Sequelize[_0x07a0('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x07a0('0x8')]}}; \ No newline at end of file +var _0x46af=['exports','STRING','queue','NOW','sequelize'];(function(_0x5aaf0a,_0x720781){var _0x3c0965=function(_0x43fa13){while(--_0x43fa13){_0x5aaf0a['push'](_0x5aaf0a['shift']());}};_0x3c0965(++_0x720781);}(_0x46af,0x81));var _0xf46a=function(_0x3f7f6c,_0x50671f){_0x3f7f6c=_0x3f7f6c-0x0;var _0x5da0fb=_0x46af[_0x3f7f6c];return _0x5da0fb;};'use strict';var moment=require('moment');var Sequelize=require(_0xf46a('0x0'));module[_0xf46a('0x1')]={'uniqueid':{'type':Sequelize[_0xf46a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0xf46a('0x3')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf46a('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 40b3844..3cef40e 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 _0xdf02=['where','merge','map','type','key','field','filter','then','includeAll','findAll','catch','params','length','include','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply','save','destroy','sendStatus','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x8dcedc,_0x37b5d8){var _0x5dd3ce=function(_0x2adec3){while(--_0x2adec3){_0x8dcedc['push'](_0x8dcedc['shift']());}};_0x5dd3ce(++_0x37b5d8);}(_0xdf02,0xde));var _0x2df0=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xdf02[_0x5f3f88];return _0xd08119;};'use strict';var pdf=require(_0x2df0('0x0'));var emlformat=require(_0x2df0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2df0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2df0('0x3'));var moment=require(_0x2df0('0x4'));var BPromise=require(_0x2df0('0x5'));var Mustache=require(_0x2df0('0x6'));var util=require(_0x2df0('0x7'));var path=require(_0x2df0('0x8'));var sox=require(_0x2df0('0x9'));var csv=require('to-csv');var ejs=require(_0x2df0('0xa'));var fs=require('fs');var _=require(_0x2df0('0xb'));var squel=require(_0x2df0('0xc'));var crypto=require(_0x2df0('0xd'));var jsforce=require(_0x2df0('0xe'));var deskjs=require(_0x2df0('0xf'));var toCsv=require(_0x2df0('0x10'));var querystring=require(_0x2df0('0x11'));var Papa=require(_0x2df0('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2df0('0x13'));var hardwareService=require(_0x2df0('0x14'));var logger=require(_0x2df0('0x15'))(_0x2df0('0x16'));var utils=require(_0x2df0('0x17'));var config=require(_0x2df0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207688,_0x3d5fa2){_0x3d5fa2=_0x3d5fa2||0xcc;return function(_0x11d64b){if(_0x11d64b){return _0x207688['sendStatus'](_0x3d5fa2);}return _0x207688[_0x2df0('0x19')](_0x3d5fa2)[_0x2df0('0x1a')]();};}function respondWithResult(_0xf46be3,_0x475c56){_0x475c56=_0x475c56||0xc8;return function(_0x229288){if(_0x229288){return _0xf46be3['status'](_0x475c56)[_0x2df0('0x1b')](_0x229288);}};}function respondWithFilteredResult(_0x4957c0,_0x3e3f6a){return function(_0x4367ad){if(_0x4367ad){var _0x26677c=_0x4367ad[_0x2df0('0x1c')],_0x276512=_0x3e3f6a[_0x2df0('0x1d')],_0x14f0a5=_0x3e3f6a[_0x2df0('0x1d')]+_0x3e3f6a[_0x2df0('0x1e')],_0x3ec50d;if(_0x14f0a5>=_0x26677c){_0x14f0a5=_0x26677c;_0x3ec50d=0xc8;}else{_0x3ec50d=0xce;}_0x4957c0['status'](_0x3ec50d);return _0x4957c0[_0x2df0('0x1f')]('Content-Range',_0x276512+'-'+_0x14f0a5+'/'+_0x26677c)[_0x2df0('0x1b')](_0x4367ad);}return null;};}function patchUpdates(_0x2291ac){return function(_0x25702d){try{jsonpatch[_0x2df0('0x20')](_0x25702d,_0x2291ac,!![]);}catch(_0xd80862){return BPromise['reject'](_0xd80862);}return _0x25702d[_0x2df0('0x21')]();};}function saveUpdates(_0x1cbf49,_0x259b24){return function(_0x2a100a){if(_0x2a100a){return _0x2a100a['update'](_0x1cbf49)['then'](function(_0x159bcb){return _0x159bcb;});}return null;};}function removeEntity(_0x15978a,_0x9aac8c){return function(_0xc9bb5e){if(_0xc9bb5e){return _0xc9bb5e[_0x2df0('0x22')]()['then'](function(){_0x15978a[_0x2df0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ec1e1,_0x222056){return function(_0x12aca7){if(!_0x12aca7){_0x1ec1e1[_0x2df0('0x23')](0x194);}return _0x12aca7;};}function handleError(_0x545906,_0x311b55){_0x311b55=_0x311b55||0x1f4;return function(_0x5c0cb0){logger['error'](_0x5c0cb0['stack']);if(_0x5c0cb0[_0x2df0('0x24')]){delete _0x5c0cb0[_0x2df0('0x24')];}_0x545906[_0x2df0('0x19')](_0x311b55)[_0x2df0('0x25')](_0x5c0cb0);};}exports[_0x2df0('0x26')]=function(_0x32ce5e,_0x5b4037){var _0x4156cc={},_0x283700={},_0x4128a0={'count':0x0,'rows':[]};var _0x3970fa=db[_0x2df0('0x27')][_0x2df0('0x28')];_0x283700[_0x2df0('0x29')]=_[_0x2df0('0x2a')](_0x3970fa);_0x283700['query']=_['keys'](_0x32ce5e[_0x2df0('0x2b')]);_0x283700[_0x2df0('0x2c')]=_[_0x2df0('0x2d')](_0x283700[_0x2df0('0x29')],_0x283700[_0x2df0('0x2b')]);_0x4156cc[_0x2df0('0x2e')]=_[_0x2df0('0x2d')](_0x283700[_0x2df0('0x29')],qs[_0x2df0('0x2f')](_0x32ce5e[_0x2df0('0x2b')][_0x2df0('0x2f')]));_0x4156cc[_0x2df0('0x2e')]=_0x4156cc[_0x2df0('0x2e')]['length']?_0x4156cc[_0x2df0('0x2e')]:_0x283700[_0x2df0('0x29')];if(!_0x32ce5e['query'][_0x2df0('0x30')](_0x2df0('0x31'))){_0x4156cc[_0x2df0('0x1e')]=qs[_0x2df0('0x1e')](_0x32ce5e[_0x2df0('0x2b')]['limit']);_0x4156cc['offset']=qs[_0x2df0('0x1d')](_0x32ce5e[_0x2df0('0x2b')][_0x2df0('0x1d')]);}_0x4156cc['order']=qs['sort'](_0x32ce5e['query']['sort']);_0x4156cc['where']=qs[_0x2df0('0x2c')](_['pick'](_0x32ce5e[_0x2df0('0x2b')],_0x283700['filters']));if(_0x32ce5e[_0x2df0('0x2b')]['filter']){_0x4156cc[_0x2df0('0x32')]=_[_0x2df0('0x33')](_0x4156cc[_0x2df0('0x32')],{'$or':_[_0x2df0('0x34')](_0x3970fa,function(_0x1ba6b5){if(_0x1ba6b5[_0x2df0('0x35')][_0x2df0('0x36')]!=='VIRTUAL'){var _0x4e13d4={};_0x4e13d4[_0x1ba6b5[_0x2df0('0x37')]]={'$like':'%'+_0x32ce5e[_0x2df0('0x2b')][_0x2df0('0x38')]+'%'};return _0x4e13d4;}})});}_0x4156cc=_['merge']({},_0x4156cc,_0x32ce5e['options']);var _0x461cd4={'where':_0x4156cc[_0x2df0('0x32')]};return db[_0x2df0('0x27')]['count'](_0x461cd4)[_0x2df0('0x39')](function(_0x4bfa2c){_0x4128a0[_0x2df0('0x1c')]=_0x4bfa2c;if(_0x32ce5e[_0x2df0('0x2b')][_0x2df0('0x3a')]){_0x4156cc['include']=[{'all':!![]}];}return db[_0x2df0('0x27')][_0x2df0('0x3b')](_0x4156cc);})[_0x2df0('0x39')](function(_0x5c199d){_0x4128a0['rows']=_0x5c199d;return _0x4128a0;})[_0x2df0('0x39')](respondWithFilteredResult(_0x5b4037,_0x4156cc))[_0x2df0('0x3c')](handleError(_0x5b4037,null));};exports['show']=function(_0x52b79d,_0x29bee9){var _0x6215d5={'raw':!![],'where':{'id':_0x52b79d[_0x2df0('0x3d')]['id']}},_0x32032f={};_0x32032f[_0x2df0('0x29')]=_['keys'](db[_0x2df0('0x27')][_0x2df0('0x28')]);_0x32032f[_0x2df0('0x2b')]=_['keys'](_0x52b79d['query']);_0x32032f[_0x2df0('0x2c')]=_[_0x2df0('0x2d')](_0x32032f['model'],_0x32032f[_0x2df0('0x2b')]);_0x6215d5[_0x2df0('0x2e')]=_[_0x2df0('0x2d')](_0x32032f[_0x2df0('0x29')],qs['fields'](_0x52b79d[_0x2df0('0x2b')][_0x2df0('0x2f')]));_0x6215d5[_0x2df0('0x2e')]=_0x6215d5['attributes'][_0x2df0('0x3e')]?_0x6215d5[_0x2df0('0x2e')]:_0x32032f[_0x2df0('0x29')];if(_0x52b79d[_0x2df0('0x2b')][_0x2df0('0x3a')]){_0x6215d5[_0x2df0('0x3f')]=[{'all':!![]}];}_0x6215d5=_['merge']({},_0x6215d5,_0x52b79d['options']);return db[_0x2df0('0x27')][_0x2df0('0x40')](_0x6215d5)['then'](handleEntityNotFound(_0x29bee9,null))['then'](respondWithResult(_0x29bee9,null))[_0x2df0('0x3c')](handleError(_0x29bee9,null));};exports[_0x2df0('0x41')]=function(_0x4858e2,_0x20344b){return db[_0x2df0('0x27')][_0x2df0('0x41')](_0x4858e2[_0x2df0('0x42')],{})[_0x2df0('0x39')](respondWithResult(_0x20344b,0xc9))[_0x2df0('0x3c')](handleError(_0x20344b,null));};exports['update']=function(_0x30dcb9,_0x244b32){if(_0x30dcb9['body']['id']){delete _0x30dcb9[_0x2df0('0x42')]['id'];}return db[_0x2df0('0x27')][_0x2df0('0x40')]({'where':{'id':_0x30dcb9[_0x2df0('0x3d')]['id']}})[_0x2df0('0x39')](handleEntityNotFound(_0x244b32,null))[_0x2df0('0x39')](saveUpdates(_0x30dcb9[_0x2df0('0x42')],null))[_0x2df0('0x39')](respondWithResult(_0x244b32,null))[_0x2df0('0x3c')](handleError(_0x244b32,null));};exports[_0x2df0('0x22')]=function(_0x56c2f8,_0x55154e){return db[_0x2df0('0x27')][_0x2df0('0x40')]({'where':{'id':_0x56c2f8['params']['id']}})[_0x2df0('0x39')](handleEntityNotFound(_0x55154e,null))[_0x2df0('0x39')](removeEntity(_0x55154e,null))[_0x2df0('0x3c')](handleError(_0x55154e,null));};exports[_0x2df0('0x43')]=function(_0x5a9c69,_0x7e3c82){return db['SmsTransferReport'][_0x2df0('0x43')]()['then'](respondWithResult(_0x7e3c82,null))['catch'](handleError(_0x7e3c82,null));}; \ No newline at end of file +var _0xc38f=['limit','sort','where','pick','filters','filter','merge','map','type','key','SmsTransferReport','includeAll','include','catch','show','rawAttributes','options','create','body','find','params','describe','html-pdf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','query','intersection','fields','length','attributes','hasOwnProperty'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0xc38f,0x1eb));var _0xfc38=function(_0x4c5670,_0x97ed9c){_0x4c5670=_0x4c5670-0x0;var _0x2a6452=_0xc38f[_0x4c5670];return _0x2a6452;};'use strict';var pdf=require(_0xfc38('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc38('0x1'));var rp=require(_0xfc38('0x2'));var moment=require(_0xfc38('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc38('0x4'));var path=require('path');var sox=require(_0xfc38('0x5'));var csv=require(_0xfc38('0x6'));var ejs=require(_0xfc38('0x7'));var fs=require('fs');var _=require(_0xfc38('0x8'));var squel=require('squel');var crypto=require(_0xfc38('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfc38('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfc38('0xb'));var Papa=require('papaparse');var Redis=require(_0xfc38('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfc38('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc38('0xe'))(_0xfc38('0xf'));var utils=require(_0xfc38('0x10'));var config=require(_0xfc38('0x11'));var db=require(_0xfc38('0x12'))['db'];function respondWithStatusCode(_0xf62fb0,_0x3e2ba0){_0x3e2ba0=_0x3e2ba0||0xcc;return function(_0x16774e){if(_0x16774e){return _0xf62fb0['sendStatus'](_0x3e2ba0);}return _0xf62fb0['status'](_0x3e2ba0)[_0xfc38('0x13')]();};}function respondWithResult(_0x236ffb,_0x29fbab){_0x29fbab=_0x29fbab||0xc8;return function(_0x14ef87){if(_0x14ef87){return _0x236ffb[_0xfc38('0x14')](_0x29fbab)[_0xfc38('0x15')](_0x14ef87);}};}function respondWithFilteredResult(_0x1d12ca,_0x17660d){return function(_0x40b9c8){if(_0x40b9c8){var _0x492c6b=_0x40b9c8[_0xfc38('0x16')],_0x5c8a2c=_0x17660d['offset'],_0x49d065=_0x17660d[_0xfc38('0x17')]+_0x17660d['limit'],_0xd18180;if(_0x49d065>=_0x492c6b){_0x49d065=_0x492c6b;_0xd18180=0xc8;}else{_0xd18180=0xce;}_0x1d12ca['status'](_0xd18180);return _0x1d12ca[_0xfc38('0x18')](_0xfc38('0x19'),_0x5c8a2c+'-'+_0x49d065+'/'+_0x492c6b)[_0xfc38('0x15')](_0x40b9c8);}return null;};}function patchUpdates(_0x38333d){return function(_0x2c0013){try{jsonpatch[_0xfc38('0x1a')](_0x2c0013,_0x38333d,!![]);}catch(_0x1f1c40){return BPromise[_0xfc38('0x1b')](_0x1f1c40);}return _0x2c0013['save']();};}function saveUpdates(_0x24693d,_0x284a3d){return function(_0x448be6){if(_0x448be6){return _0x448be6[_0xfc38('0x1c')](_0x24693d)[_0xfc38('0x1d')](function(_0x2c0239){return _0x2c0239;});}return null;};}function removeEntity(_0x2dacac,_0x5bc2e1){return function(_0x4493a8){if(_0x4493a8){return _0x4493a8[_0xfc38('0x1e')]()[_0xfc38('0x1d')](function(){_0x2dacac[_0xfc38('0x14')](0xcc)[_0xfc38('0x13')]();});}};}function handleEntityNotFound(_0x505716,_0x22edf6){return function(_0x1e6a51){if(!_0x1e6a51){_0x505716[_0xfc38('0x1f')](0x194);}return _0x1e6a51;};}function handleError(_0x532ba7,_0x56dffc){_0x56dffc=_0x56dffc||0x1f4;return function(_0x576d51){logger[_0xfc38('0x20')](_0x576d51[_0xfc38('0x21')]);if(_0x576d51[_0xfc38('0x22')]){delete _0x576d51[_0xfc38('0x22')];}_0x532ba7[_0xfc38('0x14')](_0x56dffc)[_0xfc38('0x23')](_0x576d51);};}exports[_0xfc38('0x24')]=function(_0x4cf6d6,_0xdc659c){var _0x32f0ac={},_0x3d6d35={},_0x2d7657={'count':0x0,'rows':[]};var _0x23eb3e=db['SmsTransferReport']['rawAttributes'];_0x3d6d35[_0xfc38('0x25')]=_[_0xfc38('0x26')](_0x23eb3e);_0x3d6d35[_0xfc38('0x27')]=_[_0xfc38('0x26')](_0x4cf6d6[_0xfc38('0x27')]);_0x3d6d35['filters']=_[_0xfc38('0x28')](_0x3d6d35[_0xfc38('0x25')],_0x3d6d35[_0xfc38('0x27')]);_0x32f0ac['attributes']=_['intersection'](_0x3d6d35['model'],qs[_0xfc38('0x29')](_0x4cf6d6[_0xfc38('0x27')][_0xfc38('0x29')]));_0x32f0ac['attributes']=_0x32f0ac['attributes'][_0xfc38('0x2a')]?_0x32f0ac[_0xfc38('0x2b')]:_0x3d6d35[_0xfc38('0x25')];if(!_0x4cf6d6['query'][_0xfc38('0x2c')]('nolimit')){_0x32f0ac[_0xfc38('0x2d')]=qs['limit'](_0x4cf6d6['query'][_0xfc38('0x2d')]);_0x32f0ac[_0xfc38('0x17')]=qs[_0xfc38('0x17')](_0x4cf6d6[_0xfc38('0x27')][_0xfc38('0x17')]);}_0x32f0ac['order']=qs[_0xfc38('0x2e')](_0x4cf6d6[_0xfc38('0x27')]['sort']);_0x32f0ac[_0xfc38('0x2f')]=qs['filters'](_[_0xfc38('0x30')](_0x4cf6d6[_0xfc38('0x27')],_0x3d6d35[_0xfc38('0x31')]));if(_0x4cf6d6[_0xfc38('0x27')][_0xfc38('0x32')]){_0x32f0ac[_0xfc38('0x2f')]=_[_0xfc38('0x33')](_0x32f0ac['where'],{'$or':_[_0xfc38('0x34')](_0x23eb3e,function(_0x13e449){if(_0x13e449[_0xfc38('0x35')][_0xfc38('0x36')]!=='VIRTUAL'){var _0x30f152={};_0x30f152[_0x13e449['field']]={'$like':'%'+_0x4cf6d6['query'][_0xfc38('0x32')]+'%'};return _0x30f152;}})});}_0x32f0ac=_[_0xfc38('0x33')]({},_0x32f0ac,_0x4cf6d6['options']);var _0x5942cf={'where':_0x32f0ac[_0xfc38('0x2f')]};return db[_0xfc38('0x37')]['count'](_0x5942cf)[_0xfc38('0x1d')](function(_0x2ad3a4){_0x2d7657['count']=_0x2ad3a4;if(_0x4cf6d6[_0xfc38('0x27')][_0xfc38('0x38')]){_0x32f0ac[_0xfc38('0x39')]=[{'all':!![]}];}return db[_0xfc38('0x37')]['findAll'](_0x32f0ac);})[_0xfc38('0x1d')](function(_0x3ea298){_0x2d7657['rows']=_0x3ea298;return _0x2d7657;})['then'](respondWithFilteredResult(_0xdc659c,_0x32f0ac))[_0xfc38('0x3a')](handleError(_0xdc659c,null));};exports[_0xfc38('0x3b')]=function(_0x7e5120,_0x241527){var _0xd761fd={'raw':!![],'where':{'id':_0x7e5120['params']['id']}},_0x2a4613={};_0x2a4613[_0xfc38('0x25')]=_[_0xfc38('0x26')](db[_0xfc38('0x37')][_0xfc38('0x3c')]);_0x2a4613[_0xfc38('0x27')]=_[_0xfc38('0x26')](_0x7e5120[_0xfc38('0x27')]);_0x2a4613['filters']=_[_0xfc38('0x28')](_0x2a4613[_0xfc38('0x25')],_0x2a4613[_0xfc38('0x27')]);_0xd761fd[_0xfc38('0x2b')]=_[_0xfc38('0x28')](_0x2a4613['model'],qs[_0xfc38('0x29')](_0x7e5120[_0xfc38('0x27')]['fields']));_0xd761fd[_0xfc38('0x2b')]=_0xd761fd[_0xfc38('0x2b')]['length']?_0xd761fd['attributes']:_0x2a4613[_0xfc38('0x25')];if(_0x7e5120[_0xfc38('0x27')][_0xfc38('0x38')]){_0xd761fd['include']=[{'all':!![]}];}_0xd761fd=_[_0xfc38('0x33')]({},_0xd761fd,_0x7e5120[_0xfc38('0x3d')]);return db['SmsTransferReport']['find'](_0xd761fd)[_0xfc38('0x1d')](handleEntityNotFound(_0x241527,null))[_0xfc38('0x1d')](respondWithResult(_0x241527,null))[_0xfc38('0x3a')](handleError(_0x241527,null));};exports[_0xfc38('0x3e')]=function(_0x1c3dae,_0x45cd8b){return db[_0xfc38('0x37')]['create'](_0x1c3dae[_0xfc38('0x3f')],{})[_0xfc38('0x1d')](respondWithResult(_0x45cd8b,0xc9))[_0xfc38('0x3a')](handleError(_0x45cd8b,null));};exports['update']=function(_0x5bde90,_0x2986c4){if(_0x5bde90[_0xfc38('0x3f')]['id']){delete _0x5bde90[_0xfc38('0x3f')]['id'];}return db[_0xfc38('0x37')][_0xfc38('0x40')]({'where':{'id':_0x5bde90[_0xfc38('0x41')]['id']}})[_0xfc38('0x1d')](handleEntityNotFound(_0x2986c4,null))[_0xfc38('0x1d')](saveUpdates(_0x5bde90['body'],null))[_0xfc38('0x1d')](respondWithResult(_0x2986c4,null))[_0xfc38('0x3a')](handleError(_0x2986c4,null));};exports[_0xfc38('0x1e')]=function(_0x66e84e,_0x49bbd4){return db[_0xfc38('0x37')][_0xfc38('0x40')]({'where':{'id':_0x66e84e[_0xfc38('0x41')]['id']}})[_0xfc38('0x1d')](handleEntityNotFound(_0x49bbd4,null))[_0xfc38('0x1d')](removeEntity(_0x49bbd4,null))[_0xfc38('0x3a')](handleError(_0x49bbd4,null));};exports[_0xfc38('0x42')]=function(_0x108008,_0x3a6ac0){return db[_0xfc38('0x37')][_0xfc38('0x42')]()[_0xfc38('0x1d')](respondWithResult(_0x3a6ac0,null))[_0xfc38('0x3a')](handleError(_0x3a6ac0,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6f7281e..138f978 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 _0xa7d3=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x452eb1,_0x42b32b){var _0x963bca=function(_0x56e6c5){while(--_0x56e6c5){_0x452eb1['push'](_0x452eb1['shift']());}};_0x963bca(++_0x42b32b);}(_0xa7d3,0x8c));var _0x3a7d=function(_0x1f25d9,_0x5c51cc){_0x1f25d9=_0x1f25d9-0x0;var _0x167f0d=_0xa7d3[_0x1f25d9];return _0x167f0d;};'use strict';var _=require(_0x3a7d('0x0'));var util=require(_0x3a7d('0x1'));var logger=require(_0x3a7d('0x2'))(_0x3a7d('0x3'));var moment=require(_0x3a7d('0x4'));var BPromise=require('bluebird');var rp=require(_0x3a7d('0x5'));var fs=require('fs');var path=require(_0x3a7d('0x6'));var rimraf=require(_0x3a7d('0x7'));var config=require(_0x3a7d('0x8'));var attributes=require(_0x3a7d('0x9'));module[_0x3a7d('0xa')]=function(_0x84e3dd,_0x54be46){return _0x84e3dd[_0x3a7d('0xb')](_0x3a7d('0xc'),attributes,{'tableName':_0x3a7d('0xd'),'paranoid':![],'indexes':[{'name':_0x3a7d('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2733=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsTransferReport','report_sms_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2733,0x68));var _0x3273=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x2733[_0x616290];return _0x453879;};'use strict';var _=require(_0x3273('0x0'));var util=require(_0x3273('0x1'));var logger=require(_0x3273('0x2'))(_0x3273('0x3'));var moment=require(_0x3273('0x4'));var BPromise=require(_0x3273('0x5'));var rp=require(_0x3273('0x6'));var fs=require('fs');var path=require(_0x3273('0x7'));var rimraf=require(_0x3273('0x8'));var config=require(_0x3273('0x9'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0xaea68,_0x3ffe81){return _0xaea68[_0x3273('0xa')](_0x3273('0xb'),attributes,{'tableName':_0x3273('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 78d4fa1..c812619 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0xbd77c1,_0x50b969){var _0x47fa83=function(_0x38dac1){while(--_0x38dac1){_0xbd77c1['push'](_0xbd77c1['shift']());}};_0x47fa83(++_0x50b969);}(_0x524e,0x15e));var _0xe524=function(_0x18bfae,_0x325e51){_0x18bfae=_0x18bfae-0x0;var _0xc483f4=_0x524e[_0x18bfae];return _0xc483f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0xf06c=['client','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xfe08be,_0x147909){var _0x2caa6d=function(_0x3113d4){while(--_0x3113d4){_0xfe08be['push'](_0xfe08be['shift']());}};_0x2caa6d(++_0x147909);}(_0xf06c,0xc7));var _0xcf06=function(_0x5e8904,_0x422ad7){_0x5e8904=_0x5e8904-0x0;var _0x14517d=_0xf06c[_0x5e8904];return _0x14517d;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var moment=require(_0xcf06('0x2'));var BPromise=require(_0xcf06('0x3'));var rs=require(_0xcf06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf06('0x5'))['db'];var utils=require(_0xcf06('0x6'));var logger=require(_0xcf06('0x7'))('rpc');var config=require(_0xcf06('0x8'));var jayson=require(_0xcf06('0x9'));var client=jayson[_0xcf06('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22ac40,_0x5d1aa0,_0x2723ad){return new BPromise(function(_0x48ed0c,_0x4dd606){return client['request'](_0x22ac40,_0x2723ad)['then'](function(_0x6ecf1a){logger[_0xcf06('0xb')](_0xcf06('0xc'),_0x5d1aa0,'request\x20sent');logger['debug'](_0xcf06('0xd'),_0x5d1aa0,'request\x20sent',JSON[_0xcf06('0xe')](_0x6ecf1a));if(_0x6ecf1a['error']){if(_0x6ecf1a[_0xcf06('0xf')]['code']===0x1f4){logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x6ecf1a[_0xcf06('0xf')][_0xcf06('0x10')]);return _0x4dd606(_0x6ecf1a['error']['message']);}logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x6ecf1a[_0xcf06('0xf')][_0xcf06('0x10')]);return _0x48ed0c(_0x6ecf1a['error'][_0xcf06('0x10')]);}else{logger[_0xcf06('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x5d1aa0,'request\x20sent');_0x48ed0c(_0x6ecf1a[_0xcf06('0x11')][_0xcf06('0x10')]);}})[_0xcf06('0x12')](function(_0x57c316){logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x57c316);_0x4dd606(_0x57c316);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9fb6604..f497189 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 _0x42bd=['now','single','file','create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','download','join','root','server/files/sounds/original/','originalname','replace','format','extname'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x42bd,0x182));var _0xd42b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x42bd[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xd42b('0x0'));var util=require(_0xd42b('0x1'));var path=require(_0xd42b('0x2'));var timeout=require(_0xd42b('0x3'));var express=require('express');var router=express[_0xd42b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd42b('0x5'));var config=require(_0xd42b('0x6'));var controller=require(_0xd42b('0x7'));router[_0xd42b('0x8')]('/',auth[_0xd42b('0x9')](),controller[_0xd42b('0xa')]);router['get']('/:id',auth[_0xd42b('0x9')](),controller['show']);router[_0xd42b('0x8')]('/:id/download',auth[_0xd42b('0x9')](),controller[_0xd42b('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x126469,_0x36af86,_0x2a0c6d){_0x2a0c6d(null,path[_0xd42b('0xc')](config[_0xd42b('0xd')],_0xd42b('0xe')));},'filename':function(_0x1771fb,_0x5cba12,_0x100324){_0x5cba12[_0xd42b('0xf')]=_0x5cba12[_0xd42b('0xf')][_0xd42b('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x100324(null,util[_0xd42b('0x11')]('%s-%s%s',path['basename'](_0x5cba12[_0xd42b('0xf')],path[_0xd42b('0x12')](_0x5cba12[_0xd42b('0xf')])),Date[_0xd42b('0x13')](),path[_0xd42b('0x12')](_0x5cba12['originalname'])));}})});router['post']('/',upload[_0xd42b('0x14')](_0xd42b('0x15')),controller[_0xd42b('0x16')]);router[_0xd42b('0x17')](_0xd42b('0x18'),auth[_0xd42b('0x9')](),controller['update']);router[_0xd42b('0x19')](_0xd42b('0x18'),auth[_0xd42b('0x9')](),controller[_0xd42b('0x19')]);module[_0xd42b('0x1a')]=router; \ No newline at end of file +var _0xfaf4=['delete','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','basename','extname','now','post','single','file','create','put','update'];(function(_0x2d5911,_0x4ac6da){var _0x5c65d6=function(_0x392a20){while(--_0x392a20){_0x2d5911['push'](_0x2d5911['shift']());}};_0x5c65d6(++_0x4ac6da);}(_0xfaf4,0x89));var _0x4faf=function(_0x1c4513,_0x5dbae3){_0x1c4513=_0x1c4513-0x0;var _0x3ee430=_0xfaf4[_0x1c4513];return _0x3ee430;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4faf('0x0'));var express=require('express');var router=express[_0x4faf('0x1')]();var auth=require(_0x4faf('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x4faf('0x3'));var controller=require('./sound.controller');router[_0x4faf('0x4')]('/',auth['isAuthenticated'](),controller[_0x4faf('0x5')]);router[_0x4faf('0x4')](_0x4faf('0x6'),auth[_0x4faf('0x7')](),controller[_0x4faf('0x8')]);router[_0x4faf('0x4')](_0x4faf('0x9'),auth[_0x4faf('0x7')](),controller[_0x4faf('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x85da0e,_0x4eeb27,_0x122552){_0x122552(null,path[_0x4faf('0xb')](config[_0x4faf('0xc')],_0x4faf('0xd')));},'filename':function(_0x4ec917,_0x44d9a6,_0x38da77){_0x44d9a6[_0x4faf('0xe')]=_0x44d9a6[_0x4faf('0xe')][_0x4faf('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38da77(null,util['format']('%s-%s%s',path[_0x4faf('0x10')](_0x44d9a6['originalname'],path[_0x4faf('0x11')](_0x44d9a6['originalname'])),Date[_0x4faf('0x12')](),path[_0x4faf('0x11')](_0x44d9a6[_0x4faf('0xe')])));}})});router[_0x4faf('0x13')]('/',upload[_0x4faf('0x14')](_0x4faf('0x15')),controller[_0x4faf('0x16')]);router[_0x4faf('0x17')](_0x4faf('0x6'),auth[_0x4faf('0x7')](),controller[_0x4faf('0x18')]);router['delete'](_0x4faf('0x6'),auth['isAuthenticated'](),controller[_0x4faf('0x19')]);module[_0x4faf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3071dec..c37cc24 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 _0xa3e4=['sequelize','exports','name','STRING','INTEGER','BIGINT','FLOAT'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xa3e4,0xc4));var _0x4a3e=function(_0x52f73a,_0x4418dd){_0x52f73a=_0x52f73a-0x0;var _0x4b5d40=_0xa3e4[_0x52f73a];return _0x4b5d40;};'use strict';var Sequelize=require(_0x4a3e('0x0'));module[_0x4a3e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4a3e('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4a3e('0x3')]},'display_name':{'type':Sequelize[_0x4a3e('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x4a3e('0x3')]},'original_format':{'type':Sequelize[_0x4a3e('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x4a3e('0x4')]},'original_bitRate':{'type':Sequelize[_0x4a3e('0x5')]},'original_sampleRate':{'type':Sequelize[_0x4a3e('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x4a3e('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x4a3e('0x5')]},'converted_channelCount':{'type':Sequelize[_0x4a3e('0x4')]},'converted_bitRate':{'type':Sequelize[_0x4a3e('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x4a3e('0x4')]}}; \ No newline at end of file +var _0x0fc4=['BIGINT','INTEGER','sequelize','STRING','name','FLOAT'];(function(_0x25a787,_0x6926e7){var _0x37712a=function(_0x461c51){while(--_0x461c51){_0x25a787['push'](_0x25a787['shift']());}};_0x37712a(++_0x6926e7);}(_0x0fc4,0x164));var _0x40fc=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x0fc4[_0x18a436];return _0x5c2cf8;};'use strict';var Sequelize=require(_0x40fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x40fc('0x1')],'unique':_0x40fc('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x40fc('0x1')]},'display_name':{'type':Sequelize[_0x40fc('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x40fc('0x1')]},'original_format':{'type':Sequelize[_0x40fc('0x1')]},'original_duration':{'type':Sequelize[_0x40fc('0x3')]},'original_sampleCount':{'type':Sequelize[_0x40fc('0x4')]},'original_channelCount':{'type':Sequelize[_0x40fc('0x5')]},'original_bitRate':{'type':Sequelize[_0x40fc('0x4')]},'original_sampleRate':{'type':Sequelize[_0x40fc('0x5')]},'converted_format':{'type':Sequelize[_0x40fc('0x1')]},'converted_duration':{'type':Sequelize[_0x40fc('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x40fc('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x40fc('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 694183c..931aa8d 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 _0x7a6d=['original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Sounds','UserProfileResource','destroy','stack','name','send','Sound','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','findAll','catch','show','params','intersection','includeAll','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','create','basename','extname','file','filename','originalname','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x7a6d,0x117));var _0xd7a6=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x7a6d[_0x3358ba];return _0x296e73;};'use strict';var pdf=require(_0xd7a6('0x0'));var emlformat=require(_0xd7a6('0x1'));var rimraf=require(_0xd7a6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7a6('0x3'));var rp=require(_0xd7a6('0x4'));var moment=require(_0xd7a6('0x5'));var BPromise=require(_0xd7a6('0x6'));var Mustache=require(_0xd7a6('0x7'));var util=require(_0xd7a6('0x8'));var path=require(_0xd7a6('0x9'));var sox=require(_0xd7a6('0xa'));var csv=require(_0xd7a6('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd7a6('0xc'));var squel=require(_0xd7a6('0xd'));var crypto=require(_0xd7a6('0xe'));var jsforce=require(_0xd7a6('0xf'));var deskjs=require(_0xd7a6('0x10'));var toCsv=require(_0xd7a6('0xb'));var querystring=require('querystring');var Papa=require(_0xd7a6('0x11'));var Redis=require(_0xd7a6('0x12'));var authService=require(_0xd7a6('0x13'));var qs=require(_0xd7a6('0x14'));var hardwareService=require(_0xd7a6('0x15'));var logger=require(_0xd7a6('0x16'))(_0xd7a6('0x17'));var utils=require(_0xd7a6('0x18'));var config=require(_0xd7a6('0x19'));var db=require(_0xd7a6('0x1a'))['db'];function respondWithStatusCode(_0x402be6,_0x42bf40){_0x42bf40=_0x42bf40||0xcc;return function(_0x5afc9a){if(_0x5afc9a){return _0x402be6[_0xd7a6('0x1b')](_0x42bf40);}return _0x402be6[_0xd7a6('0x1c')](_0x42bf40)[_0xd7a6('0x1d')]();};}function respondWithResult(_0x19435c,_0x5490d8){_0x5490d8=_0x5490d8||0xc8;return function(_0x3beb7c){if(_0x3beb7c){return _0x19435c[_0xd7a6('0x1c')](_0x5490d8)[_0xd7a6('0x1e')](_0x3beb7c);}};}function respondWithFilteredResult(_0x55c9c1,_0x4e6e9f){return function(_0x28bf00){if(_0x28bf00){var _0xb7170f=_0x28bf00[_0xd7a6('0x1f')],_0x1af3a1=_0x4e6e9f[_0xd7a6('0x20')],_0x479665=_0x4e6e9f['offset']+_0x4e6e9f[_0xd7a6('0x21')],_0x307204;if(_0x479665>=_0xb7170f){_0x479665=_0xb7170f;_0x307204=0xc8;}else{_0x307204=0xce;}_0x55c9c1[_0xd7a6('0x1c')](_0x307204);return _0x55c9c1[_0xd7a6('0x22')](_0xd7a6('0x23'),_0x1af3a1+'-'+_0x479665+'/'+_0xb7170f)[_0xd7a6('0x1e')](_0x28bf00);}return null;};}function patchUpdates(_0x28e9c4){return function(_0x3508e7){try{jsonpatch[_0xd7a6('0x24')](_0x3508e7,_0x28e9c4,!![]);}catch(_0x38fc7f){return BPromise[_0xd7a6('0x25')](_0x38fc7f);}return _0x3508e7['save']();};}function saveUpdates(_0x431da4,_0x53ea87){return function(_0x37483c){if(_0x37483c){return _0x37483c[_0xd7a6('0x26')](_0x431da4)[_0xd7a6('0x27')](function(_0x40bf5f){return _0x40bf5f;});}return null;};}function removeEntity(_0x25d4a1,_0x147813){return function(_0x379b93){if(_0x379b93){return _0x379b93['destroy']()[_0xd7a6('0x27')](function(){var _0x374e52=_0x379b93[_0xd7a6('0x28')]({'plain':!![]});var _0x1391f7=_0xd7a6('0x29');return db[_0xd7a6('0x2a')][_0xd7a6('0x2b')]({'where':{'type':_0x1391f7,'resourceId':_0x374e52['id']}})[_0xd7a6('0x27')](function(){return _0x379b93;});})[_0xd7a6('0x27')](function(){_0x25d4a1[_0xd7a6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c8816,_0x4fb5d1){return function(_0x4a8cab){if(!_0x4a8cab){_0x6c8816[_0xd7a6('0x1b')](0x194);}return _0x4a8cab;};}function handleError(_0x54dc52,_0x20a16a){_0x20a16a=_0x20a16a||0x1f4;return function(_0x5f2bbb){logger['error'](_0x5f2bbb[_0xd7a6('0x2c')]);if(_0x5f2bbb['name']){delete _0x5f2bbb[_0xd7a6('0x2d')];}_0x54dc52[_0xd7a6('0x1c')](_0x20a16a)[_0xd7a6('0x2e')](_0x5f2bbb);};}exports['index']=function(_0x2a2505,_0x3472f3){var _0x4b8309={},_0x298bc6={},_0x2e3904={'count':0x0,'rows':[]};var _0x545eaf=db[_0xd7a6('0x2f')][_0xd7a6('0x30')];_0x298bc6[_0xd7a6('0x31')]=_['keys'](_0x545eaf);_0x298bc6[_0xd7a6('0x32')]=_[_0xd7a6('0x33')](_0x2a2505['query']);_0x298bc6[_0xd7a6('0x34')]=_['intersection'](_0x298bc6[_0xd7a6('0x31')],_0x298bc6['query']);_0x4b8309[_0xd7a6('0x35')]=_['intersection'](_0x298bc6['model'],qs[_0xd7a6('0x36')](_0x2a2505[_0xd7a6('0x32')][_0xd7a6('0x36')]));_0x4b8309[_0xd7a6('0x35')]=_0x4b8309[_0xd7a6('0x35')][_0xd7a6('0x37')]?_0x4b8309[_0xd7a6('0x35')]:_0x298bc6[_0xd7a6('0x31')];if(!_0x2a2505[_0xd7a6('0x32')][_0xd7a6('0x38')](_0xd7a6('0x39'))){_0x4b8309[_0xd7a6('0x21')]=qs[_0xd7a6('0x21')](_0x2a2505[_0xd7a6('0x32')][_0xd7a6('0x21')]);_0x4b8309[_0xd7a6('0x20')]=qs['offset'](_0x2a2505[_0xd7a6('0x32')]['offset']);}_0x4b8309['order']=qs[_0xd7a6('0x3a')](_0x2a2505['query'][_0xd7a6('0x3a')]);_0x4b8309[_0xd7a6('0x3b')]=qs[_0xd7a6('0x34')](_[_0xd7a6('0x3c')](_0x2a2505[_0xd7a6('0x32')],_0x298bc6[_0xd7a6('0x34')]));if(_0x2a2505[_0xd7a6('0x32')][_0xd7a6('0x3d')]){_0x4b8309['where']=_[_0xd7a6('0x3e')](_0x4b8309[_0xd7a6('0x3b')],{'$or':_[_0xd7a6('0x3f')](_0x545eaf,function(_0x50f42c){if(_0x50f42c[_0xd7a6('0x40')][_0xd7a6('0x41')]!==_0xd7a6('0x42')){var _0x26de35={};_0x26de35[_0x50f42c[_0xd7a6('0x43')]]={'$like':'%'+_0x2a2505['query'][_0xd7a6('0x3d')]+'%'};return _0x26de35;}})});}_0x4b8309=_['merge']({},_0x4b8309,_0x2a2505['options']);var _0x4277cb={'where':_0x4b8309['where']};return db[_0xd7a6('0x2f')][_0xd7a6('0x1f')](_0x4277cb)[_0xd7a6('0x27')](function(_0x481496){_0x2e3904['count']=_0x481496;if(_0x2a2505[_0xd7a6('0x32')]['includeAll']){_0x4b8309[_0xd7a6('0x44')]=[{'all':!![]}];}return db[_0xd7a6('0x2f')][_0xd7a6('0x45')](_0x4b8309);})[_0xd7a6('0x27')](function(_0xf583be){_0x2e3904['rows']=_0xf583be;return _0x2e3904;})[_0xd7a6('0x27')](respondWithFilteredResult(_0x3472f3,_0x4b8309))[_0xd7a6('0x46')](handleError(_0x3472f3,null));};exports[_0xd7a6('0x47')]=function(_0x32e5c6,_0x238b98){var _0x1761f6={'raw':!![],'where':{'id':_0x32e5c6[_0xd7a6('0x48')]['id']}},_0x409446={};_0x409446[_0xd7a6('0x31')]=_[_0xd7a6('0x33')](db[_0xd7a6('0x2f')][_0xd7a6('0x30')]);_0x409446[_0xd7a6('0x32')]=_[_0xd7a6('0x33')](_0x32e5c6[_0xd7a6('0x32')]);_0x409446[_0xd7a6('0x34')]=_[_0xd7a6('0x49')](_0x409446['model'],_0x409446['query']);_0x1761f6[_0xd7a6('0x35')]=_[_0xd7a6('0x49')](_0x409446['model'],qs[_0xd7a6('0x36')](_0x32e5c6['query']['fields']));_0x1761f6[_0xd7a6('0x35')]=_0x1761f6['attributes'][_0xd7a6('0x37')]?_0x1761f6[_0xd7a6('0x35')]:_0x409446[_0xd7a6('0x31')];if(_0x32e5c6[_0xd7a6('0x32')][_0xd7a6('0x4a')]){_0x1761f6[_0xd7a6('0x44')]=[{'all':!![]}];}_0x1761f6=_['merge']({},_0x1761f6,_0x32e5c6['options']);return db['Sound'][_0xd7a6('0x4b')](_0x1761f6)['then'](handleEntityNotFound(_0x238b98,null))[_0xd7a6('0x27')](respondWithResult(_0x238b98,null))[_0xd7a6('0x46')](handleError(_0x238b98,null));};exports[_0xd7a6('0x4c')]=function(_0x4cd2af,_0x1df5ac,_0x15ff6a){return db['Sound']['find']({'where':{'id':_0x4cd2af[_0xd7a6('0x48')]['id']},'attributes':[_0xd7a6('0x2d'),_0xd7a6('0x4d'),_0xd7a6('0x4e')],'raw':!![]})[_0xd7a6('0x27')](handleEntityNotFound(_0x1df5ac,null))['then'](function(_0x25af5c){if(_0x25af5c){if(!fs[_0xd7a6('0x4f')](path[_0xd7a6('0x50')](config[_0xd7a6('0x51')],_0xd7a6('0x52'),_0x25af5c['save_name']+'.'+_0x25af5c[_0xd7a6('0x4e')]))){throw new db[(_0xd7a6('0x53'))][(_0xd7a6('0x54'))](_0xd7a6('0x55'));}return _0x1df5ac[_0xd7a6('0x4c')](path[_0xd7a6('0x50')](config[_0xd7a6('0x51')],_0xd7a6('0x52'),util[_0xd7a6('0x56')]('%s.%s',_0x25af5c[_0xd7a6('0x4d')],_0x25af5c[_0xd7a6('0x4e')])),util['format']('%s.%s',_0x25af5c['name'],_0x25af5c[_0xd7a6('0x4e')]));}return null;})['catch'](handleError(_0x1df5ac,null));};exports[_0xd7a6('0x57')]=function(_0x31ee16,_0x3a919a,_0x29b3f0){var _0x3517bb={'name':path[_0xd7a6('0x58')](_0x31ee16['file']['originalname'],path[_0xd7a6('0x59')](_0x31ee16[_0xd7a6('0x5a')]['originalname'])),'save_name':path[_0xd7a6('0x58')](_0x31ee16['file'][_0xd7a6('0x5b')],path[_0xd7a6('0x59')](_0x31ee16[_0xd7a6('0x5a')][_0xd7a6('0x5b')])),'original_format':path[_0xd7a6('0x59')](_0x31ee16[_0xd7a6('0x5a')][_0xd7a6('0x5c')])[_0xd7a6('0x5d')](0x1),'converted_format':_0xd7a6('0x5e')};var _0x4025f2=path[_0xd7a6('0x50')](config['root'],_0xd7a6('0x5f'),_0x31ee16[_0xd7a6('0x5a')][_0xd7a6('0x5b')]);var _0x183694=path['join'](config[_0xd7a6('0x51')],'server/files/sounds/converted',util[_0xd7a6('0x56')](_0xd7a6('0x60'),path[_0xd7a6('0x58')](_0x31ee16[_0xd7a6('0x5a')][_0xd7a6('0x5b')],path[_0xd7a6('0x59')](_0x31ee16['file'][_0xd7a6('0x5b')])),_0x3517bb[_0xd7a6('0x4e')]));logger[_0xd7a6('0x61')](_0xd7a6('0x62'),_0x4025f2);logger[_0xd7a6('0x61')]('Sound\x20upload\x20destination:\x20%s',_0x183694);try{fs['chmodSync'](_0x4025f2,parseInt(_0xd7a6('0x63'),0x8));var _0x27716f=sox[_0xd7a6('0x64')](_0x4025f2,_0x183694,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x27716f['on'](_0xd7a6('0x65'),function(_0xb56404){fs[_0xd7a6('0x66')](_0x4025f2);_0x3a919a['status'](0x1f4)[_0xd7a6('0x2e')](_0xb56404);});_0x27716f['on'](_0xd7a6('0x67'),function(_0x45279f){_0x3517bb[_0xd7a6('0x68')]=isNaN(_0x45279f[_0xd7a6('0x69')])?null:_0x45279f['duration']*0x3e8;_0x3517bb[_0xd7a6('0x6a')]=isNaN(_0x45279f['sampleCount'])?null:_0x45279f[_0xd7a6('0x6b')];_0x3517bb[_0xd7a6('0x6c')]=isNaN(_0x45279f[_0xd7a6('0x6d')])?null:_0x45279f['channelCount'];_0x3517bb[_0xd7a6('0x6e')]=isNaN(_0x45279f[_0xd7a6('0x6f')])?null:_0x45279f[_0xd7a6('0x6f')];_0x3517bb[_0xd7a6('0x70')]=isNaN(_0x45279f[_0xd7a6('0x71')])?null:_0x45279f[_0xd7a6('0x71')];});_0x27716f['on'](_0xd7a6('0x72'),function(_0x4108f1){_0x3517bb[_0xd7a6('0x73')]=isNaN(_0x4108f1[_0xd7a6('0x69')])?null:_0x4108f1[_0xd7a6('0x69')]*0x3e8;_0x3517bb[_0xd7a6('0x74')]=isNaN(_0x4108f1[_0xd7a6('0x6b')])?null:_0x4108f1['sampleCount'];_0x3517bb[_0xd7a6('0x75')]=isNaN(_0x4108f1[_0xd7a6('0x6d')])?null:_0x4108f1[_0xd7a6('0x6d')];_0x3517bb[_0xd7a6('0x76')]=isNaN(_0x4108f1[_0xd7a6('0x6f')])?null:_0x4108f1[_0xd7a6('0x6f')];_0x3517bb[_0xd7a6('0x77')]=isNaN(_0x4108f1['sampleRate'])?null:_0x4108f1[_0xd7a6('0x71')];});_0x27716f['on'](_0xd7a6('0x1d'),function(){fs[_0xd7a6('0x78')](_0x183694,parseInt(_0xd7a6('0x63'),0x8));return db[_0xd7a6('0x2f')][_0xd7a6('0x57')](_0x3517bb)[_0xd7a6('0x27')](function(_0xffa59b){var _0x492a7d={'role':_0x31ee16['body'][_0xd7a6('0x79')],'userProfileId':_0x31ee16['body']['userProfileId']};if(!_0x492a7d)throw new Error(_0xd7a6('0x7a'));if(_0x492a7d['role']===_0xd7a6('0x7b')){var _0x52ae88=_0xffa59b[_0xd7a6('0x28')]({'plain':!![]});return db[_0xd7a6('0x7c')]['find']({'where':{'name':_0xd7a6('0x29'),'userProfileId':_0x492a7d['userProfileId']},'raw':!![]})['then'](function(_0x112f6f){if(_0x112f6f&&_0x112f6f[_0xd7a6('0x7d')]===0x0){return db[_0xd7a6('0x2a')][_0xd7a6('0x57')]({'name':_0x52ae88['name'],'resourceId':_0x52ae88['id'],'type':_0x112f6f[_0xd7a6('0x2d')],'sectionId':_0x112f6f['id']},{})['then'](function(){return _0xffa59b;});}else{return _0xffa59b;}})[_0xd7a6('0x46')](function(_0x2170d2){logger[_0xd7a6('0x65')](_0xd7a6('0x7e'),_0x2170d2);throw _0x2170d2;});}return _0xffa59b;})[_0xd7a6('0x27')](respondWithResult(_0x3a919a,null))[_0xd7a6('0x46')](handleError(_0x3a919a,null));});_0x27716f[_0xd7a6('0x7f')]();}catch(_0x407508){_0x3a919a[_0xd7a6('0x1c')](0x1f4)[_0xd7a6('0x2e')](_0x407508);}};exports['update']=function(_0xc4e493,_0x2549d1,_0x382b3d){return db[_0xd7a6('0x2f')][_0xd7a6('0x4b')]({'where':{'id':_0xc4e493[_0xd7a6('0x48')]['id']}})[_0xd7a6('0x27')](handleEntityNotFound(_0x2549d1,null))[_0xd7a6('0x27')](saveUpdates(_['pick'](_0xc4e493['body'],[_0xd7a6('0x2d'),_0xd7a6('0x80')]),null))['then'](respondWithResult(_0x2549d1,null))[_0xd7a6('0x46')](handleError(_0x2549d1,null));};exports['delete']=function(_0x4aa85c,_0x2afc73,_0x52e8ce){return db['Sound'][_0xd7a6('0x4b')]({'where':{'id':_0x4aa85c[_0xd7a6('0x48')]['id']}})[_0xd7a6('0x27')](function(_0xaad018){if(_0xaad018){return _0xaad018[_0xd7a6('0x2b')]();}})[_0xd7a6('0x27')](function(_0xd92c3f){var _0x5e23e1=path['join'](config[_0xd7a6('0x51')],_0xd7a6('0x5f'),util[_0xd7a6('0x56')]('%s.%s',_0xd92c3f['save_name'],_0xd92c3f['original_format']));var _0x3d532c=path[_0xd7a6('0x50')](config[_0xd7a6('0x51')],'server/files/sounds/converted',util['format']('%s.%s',_0xd92c3f[_0xd7a6('0x4d')],_0xd92c3f['converted_format']));fs[_0xd7a6('0x66')](_0x5e23e1);fs[_0xd7a6('0x66')](_0x3d532c);return _0xd92c3f;})[_0xd7a6('0x27')](function(_0x3761c3){if(_0x3761c3){return _0x2afc73[_0xd7a6('0x1c')](0xcc)[_0xd7a6('0x1d')]();}})['then'](handleEntityNotFound(_0x2afc73,null))['catch'](handleError(_0x2afc73,null));}; \ No newline at end of file +var _0x43ce=['unlinkSync','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','Sound','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','intersection','find','catch','download','save_name','existsSync','join','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','originalname','extname','file','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x43ce,0x99));var _0xe43c=function(_0x2725b4,_0x4dc8d5){_0x2725b4=_0x2725b4-0x0;var _0x3d6170=_0x43ce[_0x2725b4];return _0x3d6170;};'use strict';var pdf=require(_0xe43c('0x0'));var emlformat=require(_0xe43c('0x1'));var rimraf=require(_0xe43c('0x2'));var zipdir=require(_0xe43c('0x3'));var jsonpatch=require(_0xe43c('0x4'));var rp=require(_0xe43c('0x5'));var moment=require('moment');var BPromise=require(_0xe43c('0x6'));var Mustache=require(_0xe43c('0x7'));var util=require('util');var path=require(_0xe43c('0x8'));var sox=require(_0xe43c('0x9'));var csv=require(_0xe43c('0xa'));var ejs=require(_0xe43c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe43c('0xc'));var crypto=require(_0xe43c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe43c('0xa'));var querystring=require(_0xe43c('0xe'));var Papa=require(_0xe43c('0xf'));var Redis=require(_0xe43c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe43c('0x11'));var hardwareService=require(_0xe43c('0x12'));var logger=require(_0xe43c('0x13'))(_0xe43c('0x14'));var utils=require(_0xe43c('0x15'));var config=require(_0xe43c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46873d,_0x10ca54){_0x10ca54=_0x10ca54||0xcc;return function(_0x11329b){if(_0x11329b){return _0x46873d[_0xe43c('0x17')](_0x10ca54);}return _0x46873d[_0xe43c('0x18')](_0x10ca54)[_0xe43c('0x19')]();};}function respondWithResult(_0x5857f4,_0x3eb186){_0x3eb186=_0x3eb186||0xc8;return function(_0x4acd52){if(_0x4acd52){return _0x5857f4[_0xe43c('0x18')](_0x3eb186)[_0xe43c('0x1a')](_0x4acd52);}};}function respondWithFilteredResult(_0x44234f,_0x261d90){return function(_0x57f194){if(_0x57f194){var _0x40b11d=_0x57f194[_0xe43c('0x1b')],_0x34e6e2=_0x261d90[_0xe43c('0x1c')],_0x38276f=_0x261d90[_0xe43c('0x1c')]+_0x261d90[_0xe43c('0x1d')],_0x39c664;if(_0x38276f>=_0x40b11d){_0x38276f=_0x40b11d;_0x39c664=0xc8;}else{_0x39c664=0xce;}_0x44234f[_0xe43c('0x18')](_0x39c664);return _0x44234f[_0xe43c('0x1e')](_0xe43c('0x1f'),_0x34e6e2+'-'+_0x38276f+'/'+_0x40b11d)[_0xe43c('0x1a')](_0x57f194);}return null;};}function patchUpdates(_0x17815a){return function(_0x30a43d){try{jsonpatch[_0xe43c('0x20')](_0x30a43d,_0x17815a,!![]);}catch(_0x38a332){return BPromise[_0xe43c('0x21')](_0x38a332);}return _0x30a43d[_0xe43c('0x22')]();};}function saveUpdates(_0x368afc,_0xf97de0){return function(_0xd945f9){if(_0xd945f9){return _0xd945f9['update'](_0x368afc)[_0xe43c('0x23')](function(_0x3704c3){return _0x3704c3;});}return null;};}function removeEntity(_0x48ae65,_0x4dde7d){return function(_0x302cfb){if(_0x302cfb){return _0x302cfb[_0xe43c('0x24')]()[_0xe43c('0x23')](function(){var _0x1255dd=_0x302cfb[_0xe43c('0x25')]({'plain':!![]});var _0x42245a=_0xe43c('0x26');return db[_0xe43c('0x27')]['destroy']({'where':{'type':_0x42245a,'resourceId':_0x1255dd['id']}})[_0xe43c('0x23')](function(){return _0x302cfb;});})[_0xe43c('0x23')](function(){_0x48ae65[_0xe43c('0x18')](0xcc)[_0xe43c('0x19')]();});}};}function handleEntityNotFound(_0x54c0e9,_0x3d1ce5){return function(_0x9d60a8){if(!_0x9d60a8){_0x54c0e9['sendStatus'](0x194);}return _0x9d60a8;};}function handleError(_0x2e756f,_0xcf080e){_0xcf080e=_0xcf080e||0x1f4;return function(_0x1ca1d6){logger[_0xe43c('0x28')](_0x1ca1d6[_0xe43c('0x29')]);if(_0x1ca1d6[_0xe43c('0x2a')]){delete _0x1ca1d6[_0xe43c('0x2a')];}_0x2e756f[_0xe43c('0x18')](_0xcf080e)[_0xe43c('0x2b')](_0x1ca1d6);};}exports['index']=function(_0xee57eb,_0xbe9b5a){var _0xfe765e={},_0x28e2e4={},_0x5ce311={'count':0x0,'rows':[]};var _0x2e64e9=db[_0xe43c('0x2c')][_0xe43c('0x2d')];_0x28e2e4[_0xe43c('0x2e')]=_[_0xe43c('0x2f')](_0x2e64e9);_0x28e2e4['query']=_[_0xe43c('0x2f')](_0xee57eb[_0xe43c('0x30')]);_0x28e2e4[_0xe43c('0x31')]=_['intersection'](_0x28e2e4['model'],_0x28e2e4[_0xe43c('0x30')]);_0xfe765e[_0xe43c('0x32')]=_['intersection'](_0x28e2e4['model'],qs[_0xe43c('0x33')](_0xee57eb['query'][_0xe43c('0x33')]));_0xfe765e[_0xe43c('0x32')]=_0xfe765e[_0xe43c('0x32')][_0xe43c('0x34')]?_0xfe765e['attributes']:_0x28e2e4[_0xe43c('0x2e')];if(!_0xee57eb['query'][_0xe43c('0x35')](_0xe43c('0x36'))){_0xfe765e['limit']=qs[_0xe43c('0x1d')](_0xee57eb[_0xe43c('0x30')]['limit']);_0xfe765e['offset']=qs[_0xe43c('0x1c')](_0xee57eb[_0xe43c('0x30')]['offset']);}_0xfe765e[_0xe43c('0x37')]=qs[_0xe43c('0x38')](_0xee57eb[_0xe43c('0x30')][_0xe43c('0x38')]);_0xfe765e[_0xe43c('0x39')]=qs[_0xe43c('0x31')](_['pick'](_0xee57eb[_0xe43c('0x30')],_0x28e2e4[_0xe43c('0x31')]));if(_0xee57eb[_0xe43c('0x30')][_0xe43c('0x3a')]){_0xfe765e[_0xe43c('0x39')]=_[_0xe43c('0x3b')](_0xfe765e[_0xe43c('0x39')],{'$or':_['map'](_0x2e64e9,function(_0x1160fe){if(_0x1160fe[_0xe43c('0x3c')][_0xe43c('0x3d')]!==_0xe43c('0x3e')){var _0x4b54d3={};_0x4b54d3[_0x1160fe[_0xe43c('0x3f')]]={'$like':'%'+_0xee57eb[_0xe43c('0x30')][_0xe43c('0x3a')]+'%'};return _0x4b54d3;}})});}_0xfe765e=_[_0xe43c('0x3b')]({},_0xfe765e,_0xee57eb[_0xe43c('0x40')]);var _0x43054f={'where':_0xfe765e[_0xe43c('0x39')]};return db['Sound']['count'](_0x43054f)[_0xe43c('0x23')](function(_0x5638f4){_0x5ce311[_0xe43c('0x1b')]=_0x5638f4;if(_0xee57eb[_0xe43c('0x30')][_0xe43c('0x41')]){_0xfe765e[_0xe43c('0x42')]=[{'all':!![]}];}return db['Sound'][_0xe43c('0x43')](_0xfe765e);})[_0xe43c('0x23')](function(_0x51ebe5){_0x5ce311['rows']=_0x51ebe5;return _0x5ce311;})[_0xe43c('0x23')](respondWithFilteredResult(_0xbe9b5a,_0xfe765e))['catch'](handleError(_0xbe9b5a,null));};exports[_0xe43c('0x44')]=function(_0x31fcf1,_0x13ed7a){var _0x50e9db={'raw':!![],'where':{'id':_0x31fcf1[_0xe43c('0x45')]['id']}},_0x3a2f7a={};_0x3a2f7a[_0xe43c('0x2e')]=_[_0xe43c('0x2f')](db['Sound'][_0xe43c('0x2d')]);_0x3a2f7a['query']=_[_0xe43c('0x2f')](_0x31fcf1[_0xe43c('0x30')]);_0x3a2f7a[_0xe43c('0x31')]=_[_0xe43c('0x46')](_0x3a2f7a['model'],_0x3a2f7a[_0xe43c('0x30')]);_0x50e9db[_0xe43c('0x32')]=_['intersection'](_0x3a2f7a['model'],qs[_0xe43c('0x33')](_0x31fcf1['query'][_0xe43c('0x33')]));_0x50e9db[_0xe43c('0x32')]=_0x50e9db[_0xe43c('0x32')][_0xe43c('0x34')]?_0x50e9db[_0xe43c('0x32')]:_0x3a2f7a[_0xe43c('0x2e')];if(_0x31fcf1[_0xe43c('0x30')]['includeAll']){_0x50e9db[_0xe43c('0x42')]=[{'all':!![]}];}_0x50e9db=_[_0xe43c('0x3b')]({},_0x50e9db,_0x31fcf1[_0xe43c('0x40')]);return db[_0xe43c('0x2c')][_0xe43c('0x47')](_0x50e9db)['then'](handleEntityNotFound(_0x13ed7a,null))[_0xe43c('0x23')](respondWithResult(_0x13ed7a,null))[_0xe43c('0x48')](handleError(_0x13ed7a,null));};exports[_0xe43c('0x49')]=function(_0x28a85e,_0x5d88cf,_0x3513ec){return db[_0xe43c('0x2c')][_0xe43c('0x47')]({'where':{'id':_0x28a85e[_0xe43c('0x45')]['id']},'attributes':[_0xe43c('0x2a'),_0xe43c('0x4a'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5d88cf,null))[_0xe43c('0x23')](function(_0x2a889f){if(_0x2a889f){if(!fs[_0xe43c('0x4b')](path[_0xe43c('0x4c')](config['root'],_0xe43c('0x4d'),_0x2a889f[_0xe43c('0x4a')]+'.'+_0x2a889f[_0xe43c('0x4e')]))){throw new db['Sequelize'][(_0xe43c('0x4f'))](_0xe43c('0x50'));}return _0x5d88cf[_0xe43c('0x49')](path[_0xe43c('0x4c')](config[_0xe43c('0x51')],_0xe43c('0x4d'),util[_0xe43c('0x52')](_0xe43c('0x53'),_0x2a889f[_0xe43c('0x4a')],_0x2a889f[_0xe43c('0x4e')])),util[_0xe43c('0x52')](_0xe43c('0x53'),_0x2a889f[_0xe43c('0x2a')],_0x2a889f[_0xe43c('0x4e')]));}return null;})[_0xe43c('0x48')](handleError(_0x5d88cf,null));};exports[_0xe43c('0x54')]=function(_0x52b2fc,_0xba109f,_0x369134){var _0x4d2d5c={'name':path[_0xe43c('0x55')](_0x52b2fc['file'][_0xe43c('0x56')],path[_0xe43c('0x57')](_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x56')])),'save_name':path['basename'](_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x59')],path[_0xe43c('0x57')](_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x59')])),'original_format':path['extname'](_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x56')])[_0xe43c('0x5a')](0x1),'converted_format':'wav'};var _0x43b5b2=path['join'](config['root'],_0xe43c('0x5b'),_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x59')]);var _0x5cc06b=path[_0xe43c('0x4c')](config[_0xe43c('0x51')],'server/files/sounds/converted',util[_0xe43c('0x52')](_0xe43c('0x53'),path[_0xe43c('0x55')](_0x52b2fc[_0xe43c('0x58')][_0xe43c('0x59')],path[_0xe43c('0x57')](_0x52b2fc[_0xe43c('0x58')]['filename'])),_0x4d2d5c['converted_format']));logger[_0xe43c('0x5c')](_0xe43c('0x5d'),_0x43b5b2);logger['info'](_0xe43c('0x5e'),_0x5cc06b);try{fs[_0xe43c('0x5f')](_0x43b5b2,parseInt(_0xe43c('0x60'),0x8));var _0xb04c01=sox[_0xe43c('0x61')](_0x43b5b2,_0x5cc06b,{'sampleRate':0x1f40,'format':_0xe43c('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb04c01['on'](_0xe43c('0x28'),function(_0x3ec20d){fs[_0xe43c('0x63')](_0x43b5b2);_0xba109f[_0xe43c('0x18')](0x1f4)[_0xe43c('0x2b')](_0x3ec20d);});_0xb04c01['on']('src',function(_0x33b56e){_0x4d2d5c[_0xe43c('0x64')]=isNaN(_0x33b56e[_0xe43c('0x65')])?null:_0x33b56e['duration']*0x3e8;_0x4d2d5c['original_sampleCount']=isNaN(_0x33b56e[_0xe43c('0x66')])?null:_0x33b56e[_0xe43c('0x66')];_0x4d2d5c[_0xe43c('0x67')]=isNaN(_0x33b56e[_0xe43c('0x68')])?null:_0x33b56e[_0xe43c('0x68')];_0x4d2d5c[_0xe43c('0x69')]=isNaN(_0x33b56e[_0xe43c('0x6a')])?null:_0x33b56e[_0xe43c('0x6a')];_0x4d2d5c[_0xe43c('0x6b')]=isNaN(_0x33b56e[_0xe43c('0x6c')])?null:_0x33b56e[_0xe43c('0x6c')];});_0xb04c01['on'](_0xe43c('0x6d'),function(_0x380db8){_0x4d2d5c[_0xe43c('0x6e')]=isNaN(_0x380db8[_0xe43c('0x65')])?null:_0x380db8['duration']*0x3e8;_0x4d2d5c['converted_sampleCount']=isNaN(_0x380db8[_0xe43c('0x66')])?null:_0x380db8[_0xe43c('0x66')];_0x4d2d5c[_0xe43c('0x6f')]=isNaN(_0x380db8[_0xe43c('0x68')])?null:_0x380db8[_0xe43c('0x68')];_0x4d2d5c[_0xe43c('0x70')]=isNaN(_0x380db8[_0xe43c('0x6a')])?null:_0x380db8['bitRate'];_0x4d2d5c[_0xe43c('0x71')]=isNaN(_0x380db8[_0xe43c('0x6c')])?null:_0x380db8[_0xe43c('0x6c')];});_0xb04c01['on'](_0xe43c('0x19'),function(){fs[_0xe43c('0x5f')](_0x5cc06b,parseInt(_0xe43c('0x60'),0x8));return db[_0xe43c('0x2c')]['create'](_0x4d2d5c)['then'](function(_0x4fa677){var _0x47e1eb={'role':_0x52b2fc[_0xe43c('0x72')][_0xe43c('0x73')],'userProfileId':_0x52b2fc[_0xe43c('0x72')][_0xe43c('0x74')]};if(!_0x47e1eb)throw new Error(_0xe43c('0x75'));if(_0x47e1eb[_0xe43c('0x73')]==='user'){var _0x48fb2a=_0x4fa677['get']({'plain':!![]});return db[_0xe43c('0x76')][_0xe43c('0x47')]({'where':{'name':_0xe43c('0x26'),'userProfileId':_0x47e1eb[_0xe43c('0x74')]},'raw':!![]})[_0xe43c('0x23')](function(_0x542971){if(_0x542971&&_0x542971['autoAssociation']===0x0){return db[_0xe43c('0x27')]['create']({'name':_0x48fb2a[_0xe43c('0x2a')],'resourceId':_0x48fb2a['id'],'type':_0x542971[_0xe43c('0x2a')],'sectionId':_0x542971['id']},{})[_0xe43c('0x23')](function(){return _0x4fa677;});}else{return _0x4fa677;}})[_0xe43c('0x48')](function(_0x2f206a){logger['error'](_0xe43c('0x77'),_0x2f206a);throw _0x2f206a;});}return _0x4fa677;})[_0xe43c('0x23')](respondWithResult(_0xba109f,null))[_0xe43c('0x48')](handleError(_0xba109f,null));});_0xb04c01[_0xe43c('0x78')]();}catch(_0x516240){_0xba109f['status'](0x1f4)[_0xe43c('0x2b')](_0x516240);}};exports[_0xe43c('0x79')]=function(_0x57e846,_0x3a7706,_0x24a9b5){return db['Sound']['find']({'where':{'id':_0x57e846[_0xe43c('0x45')]['id']}})[_0xe43c('0x23')](handleEntityNotFound(_0x3a7706,null))['then'](saveUpdates(_[_0xe43c('0x7a')](_0x57e846[_0xe43c('0x72')],[_0xe43c('0x2a'),_0xe43c('0x7b')]),null))[_0xe43c('0x23')](respondWithResult(_0x3a7706,null))[_0xe43c('0x48')](handleError(_0x3a7706,null));};exports[_0xe43c('0x7c')]=function(_0x62f88e,_0x214254,_0x563afa){return db['Sound'][_0xe43c('0x47')]({'where':{'id':_0x62f88e[_0xe43c('0x45')]['id']}})['then'](function(_0x217526){if(_0x217526){return _0x217526['destroy']();}})[_0xe43c('0x23')](function(_0x1fb4de){var _0x19e789=path[_0xe43c('0x4c')](config[_0xe43c('0x51')],_0xe43c('0x5b'),util[_0xe43c('0x52')](_0xe43c('0x53'),_0x1fb4de[_0xe43c('0x4a')],_0x1fb4de[_0xe43c('0x7d')]));var _0x1631dc=path[_0xe43c('0x4c')](config[_0xe43c('0x51')],_0xe43c('0x4d'),util[_0xe43c('0x52')](_0xe43c('0x53'),_0x1fb4de[_0xe43c('0x4a')],_0x1fb4de[_0xe43c('0x4e')]));fs['unlinkSync'](_0x19e789);fs[_0xe43c('0x63')](_0x1631dc);return _0x1fb4de;})[_0xe43c('0x23')](function(_0x4f3663){if(_0x4f3663){return _0x214254['status'](0xcc)[_0xe43c('0x19')]();}})[_0xe43c('0x23')](handleEntityNotFound(_0x214254,null))[_0xe43c('0x48')](handleError(_0x214254,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index b529dae..23cce42 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 _0xff23=['rimraf','./sound.attributes','define','tools_sounds','util','moment','request-promise','path'];(function(_0x52aadd,_0x29363e){var _0x51e4ef=function(_0x5b2b66){while(--_0x5b2b66){_0x52aadd['push'](_0x52aadd['shift']());}};_0x51e4ef(++_0x29363e);}(_0xff23,0xfc));var _0x3ff2=function(_0x421df5,_0x53a905){_0x421df5=_0x421df5-0x0;var _0xaea9c9=_0xff23[_0x421df5];return _0xaea9c9;};'use strict';var _=require('lodash');var util=require(_0x3ff2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3ff2('0x1'));var BPromise=require('bluebird');var rp=require(_0x3ff2('0x2'));var fs=require('fs');var path=require(_0x3ff2('0x3'));var rimraf=require(_0x3ff2('0x4'));var config=require('../../config/environment');var attributes=require(_0x3ff2('0x5'));module['exports']=function(_0x11ff80,_0x1d6559){return _0x11ff80[_0x3ff2('0x6')]('Sound',attributes,{'tableName':_0x3ff2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c33=['./sound.attributes','define','Sound','tools_sounds','util','api','bluebird','request-promise','path','rimraf'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x6c33,0xf4));var _0x36c3=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0x6c33[_0x59987a];return _0x460646;};'use strict';var _=require('lodash');var util=require(_0x36c3('0x0'));var logger=require('../../config/logger')(_0x36c3('0x1'));var moment=require('moment');var BPromise=require(_0x36c3('0x2'));var rp=require(_0x36c3('0x3'));var fs=require('fs');var path=require(_0x36c3('0x4'));var rimraf=require(_0x36c3('0x5'));var config=require('../../config/environment');var attributes=require(_0x36c3('0x6'));module['exports']=function(_0x262b82,_0x4db5a1){return _0x262b82[_0x36c3('0x7')](_0x36c3('0x8'),attributes,{'tableName':_0x36c3('0x9'),'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 0cc7737..8b1dfe3 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 _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x2a837d,_0x5615af){var _0x54cc25=function(_0x3f8f3c){while(--_0x3f8f3c){_0x2a837d['push'](_0x2a837d['shift']());}};_0x54cc25(++_0x5615af);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x50f8d8,_0xec0ad6){var _0x2f357e=function(_0x5648aa){while(--_0x5648aa){_0x50f8d8['push'](_0x50f8d8['shift']());}};_0x2f357e(++_0xec0ad6);}(_0xb10b,0x12a));var _0xbb10=function(_0xc61ea8,_0x56e451){_0xc61ea8=_0xc61ea8-0x0;var _0x22c845=_0xb10b[_0xc61ea8];return _0x22c845;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0029d95..1a12629 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 _0x80df=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5cc3e9,_0x260358){var _0x3b24e5=function(_0x100e97){while(--_0x100e97){_0x5cc3e9['push'](_0x5cc3e9['shift']());}};_0x3b24e5(++_0x260358);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var path=require(_0xf80d('0x2'));var timeout=require(_0xf80d('0x3'));var express=require('express');var router=express[_0xf80d('0x4')]();var auth=require(_0xf80d('0x5'));var interaction=require(_0xf80d('0x6'));var config=require(_0xf80d('0x7'));var controller=require(_0xf80d('0x8'));router[_0xf80d('0x9')]('/',auth[_0xf80d('0xa')](),controller[_0xf80d('0xb')]);router[_0xf80d('0x9')](_0xf80d('0xc'),auth['isAuthenticated'](),controller[_0xf80d('0xd')]);router[_0xf80d('0xe')]('/',auth[_0xf80d('0xa')](),controller[_0xf80d('0xf')]);router[_0xf80d('0x10')](_0xf80d('0xc'),auth[_0xf80d('0xa')](),controller[_0xf80d('0x11')]);router[_0xf80d('0x12')](_0xf80d('0xc'),auth[_0xf80d('0xa')](),controller[_0xf80d('0x13')]);module[_0xf80d('0x14')]=router; \ No newline at end of file +var _0x3c31=['show','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x818500,_0xe7620c){var _0x342023=function(_0x17c939){while(--_0x17c939){_0x818500['push'](_0x818500['shift']());}};_0x342023(++_0xe7620c);}(_0x3c31,0xb1));var _0x13c3=function(_0x147f5d,_0x14f5c4){_0x147f5d=_0x147f5d-0x0;var _0x503160=_0x3c31[_0x147f5d];return _0x503160;};'use strict';var multer=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var path=require(_0x13c3('0x2'));var timeout=require(_0x13c3('0x3'));var express=require('express');var router=express[_0x13c3('0x4')]();var auth=require(_0x13c3('0x5'));var interaction=require(_0x13c3('0x6'));var config=require(_0x13c3('0x7'));var controller=require(_0x13c3('0x8'));router[_0x13c3('0x9')]('/',auth[_0x13c3('0xa')](),controller[_0x13c3('0xb')]);router[_0x13c3('0x9')](_0x13c3('0xc'),auth[_0x13c3('0xa')](),controller[_0x13c3('0xd')]);router['post']('/',auth[_0x13c3('0xa')](),controller[_0x13c3('0xe')]);router[_0x13c3('0xf')](_0x13c3('0xc'),auth['isAuthenticated'](),controller[_0x13c3('0x10')]);router['delete'](_0x13c3('0xc'),auth['isAuthenticated'](),controller[_0x13c3('0x11')]);module[_0x13c3('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 5a08d65..3c9005e 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 _0xa7ba=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7ba,0x190));var _0xaa7b=function(_0x42d1ba,_0x48992e){_0x42d1ba=_0x42d1ba-0x0;var _0x2f8ea7=_0xa7ba[_0x42d1ba];return _0x2f8ea7;};'use strict';var Sequelize=require('sequelize');module[_0xaa7b('0x0')]={'uniqueid':{'type':Sequelize[_0xaa7b('0x1')]},'body':{'type':Sequelize[_0xaa7b('0x2')](_0xaa7b('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xaa7b('0x4')]('in','out'),'defaultValue':_0xaa7b('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xfee8=['sequelize','exports','STRING','TEXT','out'];(function(_0x2eb256,_0x28d4b7){var _0x44d134=function(_0x181219){while(--_0x181219){_0x2eb256['push'](_0x2eb256['shift']());}};_0x44d134(++_0x28d4b7);}(_0xfee8,0x64));var _0x8fee=function(_0x1d8b1d,_0x11d691){_0x1d8b1d=_0x1d8b1d-0x0;var _0x109ed1=_0xfee8[_0x1d8b1d];return _0x109ed1;};'use strict';var Sequelize=require(_0x8fee('0x0'));module[_0x8fee('0x1')]={'uniqueid':{'type':Sequelize[_0x8fee('0x2')]},'body':{'type':Sequelize[_0x8fee('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8fee('0x4')),'defaultValue':_0x8fee('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 5566358..cf8426a 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 _0x928e=['where','pick','filter','field','includeAll','include','findAll','rows','show','params','fields','merge','options','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x928e,0x9e));var _0xe928=function(_0x250ad4,_0x26c311){_0x250ad4=_0x250ad4-0x0;var _0x8503e7=_0x928e[_0x250ad4];return _0x8503e7;};'use strict';var pdf=require(_0xe928('0x0'));var emlformat=require(_0xe928('0x1'));var rimraf=require(_0xe928('0x2'));var zipdir=require(_0xe928('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe928('0x4'));var moment=require(_0xe928('0x5'));var BPromise=require(_0xe928('0x6'));var Mustache=require(_0xe928('0x7'));var util=require(_0xe928('0x8'));var path=require(_0xe928('0x9'));var sox=require(_0xe928('0xa'));var csv=require('to-csv');var ejs=require(_0xe928('0xb'));var fs=require('fs');var _=require(_0xe928('0xc'));var squel=require(_0xe928('0xd'));var crypto=require(_0xe928('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe928('0xf'));var toCsv=require(_0xe928('0x10'));var querystring=require(_0xe928('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe928('0x12'));var qs=require(_0xe928('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe928('0x14'));var utils=require(_0xe928('0x15'));var config=require(_0xe928('0x16'));var db=require(_0xe928('0x17'))['db'];function respondWithStatusCode(_0x358c96,_0x2b62bd){_0x2b62bd=_0x2b62bd||0xcc;return function(_0x5dbc53){if(_0x5dbc53){return _0x358c96[_0xe928('0x18')](_0x2b62bd);}return _0x358c96[_0xe928('0x19')](_0x2b62bd)['end']();};}function respondWithResult(_0xccef73,_0x593916){_0x593916=_0x593916||0xc8;return function(_0x4ff3b6){if(_0x4ff3b6){return _0xccef73[_0xe928('0x19')](_0x593916)[_0xe928('0x1a')](_0x4ff3b6);}};}function respondWithFilteredResult(_0x596fed,_0x45067d){return function(_0x49bf21){if(_0x49bf21){var _0x3c962c=_0x49bf21[_0xe928('0x1b')],_0x4f3429=_0x45067d['offset'],_0x1860fc=_0x45067d[_0xe928('0x1c')]+_0x45067d[_0xe928('0x1d')],_0x317eed;if(_0x1860fc>=_0x3c962c){_0x1860fc=_0x3c962c;_0x317eed=0xc8;}else{_0x317eed=0xce;}_0x596fed['status'](_0x317eed);return _0x596fed['set'](_0xe928('0x1e'),_0x4f3429+'-'+_0x1860fc+'/'+_0x3c962c)[_0xe928('0x1a')](_0x49bf21);}return null;};}function patchUpdates(_0x4afa04){return function(_0x2913e7){try{jsonpatch[_0xe928('0x1f')](_0x2913e7,_0x4afa04,!![]);}catch(_0x21ae70){return BPromise[_0xe928('0x20')](_0x21ae70);}return _0x2913e7['save']();};}function saveUpdates(_0x1ca89b,_0xdbe872){return function(_0x4ffb54){if(_0x4ffb54){return _0x4ffb54[_0xe928('0x21')](_0x1ca89b)[_0xe928('0x22')](function(_0x433bf9){return _0x433bf9;});}return null;};}function removeEntity(_0x57c869,_0x561fa1){return function(_0x42da95){if(_0x42da95){return _0x42da95[_0xe928('0x23')]()[_0xe928('0x22')](function(){_0x57c869[_0xe928('0x19')](0xcc)[_0xe928('0x24')]();});}};}function handleEntityNotFound(_0x5d438d,_0x1e48e3){return function(_0x1ebf86){if(!_0x1ebf86){_0x5d438d[_0xe928('0x18')](0x194);}return _0x1ebf86;};}function handleError(_0x2536cf,_0x5209e9){_0x5209e9=_0x5209e9||0x1f4;return function(_0x460403){logger[_0xe928('0x25')](_0x460403[_0xe928('0x26')]);if(_0x460403[_0xe928('0x27')]){delete _0x460403[_0xe928('0x27')];}_0x2536cf[_0xe928('0x19')](_0x5209e9)[_0xe928('0x28')](_0x460403);};}exports[_0xe928('0x29')]=function(_0x5f0c46,_0x144ae3){var _0x1b81b1={},_0x2854c2={},_0x3e9c97={'count':0x0,'rows':[]};var _0x26b0ee=db[_0xe928('0x2a')][_0xe928('0x2b')];_0x2854c2[_0xe928('0x2c')]=_[_0xe928('0x2d')](_0x26b0ee);_0x2854c2[_0xe928('0x2e')]=_['keys'](_0x5f0c46['query']);_0x2854c2[_0xe928('0x2f')]=_['intersection'](_0x2854c2['model'],_0x2854c2['query']);_0x1b81b1[_0xe928('0x30')]=_[_0xe928('0x31')](_0x2854c2[_0xe928('0x2c')],qs['fields'](_0x5f0c46[_0xe928('0x2e')]['fields']));_0x1b81b1[_0xe928('0x30')]=_0x1b81b1['attributes'][_0xe928('0x32')]?_0x1b81b1['attributes']:_0x2854c2['model'];if(!_0x5f0c46[_0xe928('0x2e')][_0xe928('0x33')](_0xe928('0x34'))){_0x1b81b1['limit']=qs[_0xe928('0x1d')](_0x5f0c46['query']['limit']);_0x1b81b1[_0xe928('0x1c')]=qs['offset'](_0x5f0c46[_0xe928('0x2e')]['offset']);}_0x1b81b1[_0xe928('0x35')]=qs[_0xe928('0x36')](_0x5f0c46[_0xe928('0x2e')][_0xe928('0x36')]);_0x1b81b1[_0xe928('0x37')]=qs[_0xe928('0x2f')](_[_0xe928('0x38')](_0x5f0c46[_0xe928('0x2e')],_0x2854c2['filters']));if(_0x5f0c46[_0xe928('0x2e')][_0xe928('0x39')]){_0x1b81b1['where']=_['merge'](_0x1b81b1['where'],{'$or':_['map'](_0x26b0ee,function(_0x24c16b){if(_0x24c16b['type']['key']!=='VIRTUAL'){var _0x1a35f9={};_0x1a35f9[_0x24c16b[_0xe928('0x3a')]]={'$like':'%'+_0x5f0c46[_0xe928('0x2e')][_0xe928('0x39')]+'%'};return _0x1a35f9;}})});}_0x1b81b1=_['merge']({},_0x1b81b1,_0x5f0c46['options']);var _0x5a0be4={'where':_0x1b81b1[_0xe928('0x37')]};return db[_0xe928('0x2a')][_0xe928('0x1b')](_0x5a0be4)[_0xe928('0x22')](function(_0x231bde){_0x3e9c97[_0xe928('0x1b')]=_0x231bde;if(_0x5f0c46[_0xe928('0x2e')][_0xe928('0x3b')]){_0x1b81b1[_0xe928('0x3c')]=[{'all':!![]}];}return db[_0xe928('0x2a')][_0xe928('0x3d')](_0x1b81b1);})[_0xe928('0x22')](function(_0x1b1202){_0x3e9c97[_0xe928('0x3e')]=_0x1b1202;return _0x3e9c97;})[_0xe928('0x22')](respondWithFilteredResult(_0x144ae3,_0x1b81b1))['catch'](handleError(_0x144ae3,null));};exports[_0xe928('0x3f')]=function(_0x156e56,_0x254acc){var _0x1415e5={'raw':!![],'where':{'id':_0x156e56[_0xe928('0x40')]['id']}},_0x4a84a6={};_0x4a84a6[_0xe928('0x2c')]=_['keys'](db[_0xe928('0x2a')][_0xe928('0x2b')]);_0x4a84a6['query']=_[_0xe928('0x2d')](_0x156e56[_0xe928('0x2e')]);_0x4a84a6['filters']=_[_0xe928('0x31')](_0x4a84a6['model'],_0x4a84a6[_0xe928('0x2e')]);_0x1415e5[_0xe928('0x30')]=_['intersection'](_0x4a84a6[_0xe928('0x2c')],qs[_0xe928('0x41')](_0x156e56[_0xe928('0x2e')][_0xe928('0x41')]));_0x1415e5[_0xe928('0x30')]=_0x1415e5[_0xe928('0x30')][_0xe928('0x32')]?_0x1415e5[_0xe928('0x30')]:_0x4a84a6[_0xe928('0x2c')];if(_0x156e56['query'][_0xe928('0x3b')]){_0x1415e5[_0xe928('0x3c')]=[{'all':!![]}];}_0x1415e5=_[_0xe928('0x42')]({},_0x1415e5,_0x156e56[_0xe928('0x43')]);return db[_0xe928('0x2a')][_0xe928('0x44')](_0x1415e5)[_0xe928('0x22')](handleEntityNotFound(_0x254acc,null))['then'](respondWithResult(_0x254acc,null))['catch'](handleError(_0x254acc,null));};exports['create']=function(_0x238af7,_0x20f5de){return db[_0xe928('0x2a')]['create'](_0x238af7[_0xe928('0x45')],{})[_0xe928('0x22')](respondWithResult(_0x20f5de,0xc9))['catch'](handleError(_0x20f5de,null));};exports[_0xe928('0x21')]=function(_0x26b7d5,_0x1a6df7){if(_0x26b7d5[_0xe928('0x45')]['id']){delete _0x26b7d5['body']['id'];}return db[_0xe928('0x2a')][_0xe928('0x44')]({'where':{'id':_0x26b7d5[_0xe928('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a6df7,null))[_0xe928('0x22')](saveUpdates(_0x26b7d5[_0xe928('0x45')],null))[_0xe928('0x22')](respondWithResult(_0x1a6df7,null))[_0xe928('0x46')](handleError(_0x1a6df7,null));};exports[_0xe928('0x23')]=function(_0x2b98f0,_0x4e0558){return db[_0xe928('0x2a')]['find']({'where':{'id':_0x2b98f0[_0xe928('0x40')]['id']}})['then'](handleEntityNotFound(_0x4e0558,null))[_0xe928('0x22')](removeEntity(_0x4e0558,null))[_0xe928('0x46')](handleError(_0x4e0558,null));}; \ No newline at end of file +var _0xe491=['offset','limit','set','Content-Range','json','reject','update','then','destroy','end','error','name','send','index','SquareMessage','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','fields','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count'];(function(_0x4a0f62,_0x19f781){var _0x3ffcc1=function(_0x337256){while(--_0x337256){_0x4a0f62['push'](_0x4a0f62['shift']());}};_0x3ffcc1(++_0x19f781);}(_0xe491,0x18c));var _0x1e49=function(_0x4db30a,_0x5c9800){_0x4db30a=_0x4db30a-0x0;var _0x4ea1e2=_0xe491[_0x4db30a];return _0x4ea1e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1e49('0x0'));var rimraf=require(_0x1e49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e49('0x2'));var rp=require(_0x1e49('0x3'));var moment=require(_0x1e49('0x4'));var BPromise=require(_0x1e49('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1e49('0x6'));var csv=require('to-csv');var ejs=require(_0x1e49('0x7'));var fs=require('fs');var _=require(_0x1e49('0x8'));var squel=require(_0x1e49('0x9'));var crypto=require(_0x1e49('0xa'));var jsforce=require(_0x1e49('0xb'));var deskjs=require(_0x1e49('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1e49('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1e49('0xe'));var hardwareService=require(_0x1e49('0xf'));var logger=require(_0x1e49('0x10'))(_0x1e49('0x11'));var utils=require(_0x1e49('0x12'));var config=require(_0x1e49('0x13'));var db=require(_0x1e49('0x14'))['db'];function respondWithStatusCode(_0x33262f,_0x1a057e){_0x1a057e=_0x1a057e||0xcc;return function(_0x447daa){if(_0x447daa){return _0x33262f[_0x1e49('0x15')](_0x1a057e);}return _0x33262f[_0x1e49('0x16')](_0x1a057e)['end']();};}function respondWithResult(_0x5e3861,_0x19fcdf){_0x19fcdf=_0x19fcdf||0xc8;return function(_0x114bb3){if(_0x114bb3){return _0x5e3861[_0x1e49('0x16')](_0x19fcdf)['json'](_0x114bb3);}};}function respondWithFilteredResult(_0x58bfdd,_0x10450c){return function(_0x14f816){if(_0x14f816){var _0x41a341=_0x14f816[_0x1e49('0x17')],_0x25fad4=_0x10450c[_0x1e49('0x18')],_0x2cbabe=_0x10450c['offset']+_0x10450c[_0x1e49('0x19')],_0x55e5fc;if(_0x2cbabe>=_0x41a341){_0x2cbabe=_0x41a341;_0x55e5fc=0xc8;}else{_0x55e5fc=0xce;}_0x58bfdd[_0x1e49('0x16')](_0x55e5fc);return _0x58bfdd[_0x1e49('0x1a')](_0x1e49('0x1b'),_0x25fad4+'-'+_0x2cbabe+'/'+_0x41a341)[_0x1e49('0x1c')](_0x14f816);}return null;};}function patchUpdates(_0x11072c){return function(_0x2d5545){try{jsonpatch['apply'](_0x2d5545,_0x11072c,!![]);}catch(_0x51de18){return BPromise[_0x1e49('0x1d')](_0x51de18);}return _0x2d5545['save']();};}function saveUpdates(_0x232535,_0x4a92ea){return function(_0x14c8ba){if(_0x14c8ba){return _0x14c8ba[_0x1e49('0x1e')](_0x232535)[_0x1e49('0x1f')](function(_0x19d410){return _0x19d410;});}return null;};}function removeEntity(_0x268289,_0x4f0469){return function(_0x417b44){if(_0x417b44){return _0x417b44[_0x1e49('0x20')]()[_0x1e49('0x1f')](function(){_0x268289[_0x1e49('0x16')](0xcc)[_0x1e49('0x21')]();});}};}function handleEntityNotFound(_0x162cb6,_0x5d07de){return function(_0x11e93e){if(!_0x11e93e){_0x162cb6[_0x1e49('0x15')](0x194);}return _0x11e93e;};}function handleError(_0x3b4eaa,_0x320621){_0x320621=_0x320621||0x1f4;return function(_0x2bf7dc){logger[_0x1e49('0x22')](_0x2bf7dc['stack']);if(_0x2bf7dc[_0x1e49('0x23')]){delete _0x2bf7dc[_0x1e49('0x23')];}_0x3b4eaa[_0x1e49('0x16')](_0x320621)[_0x1e49('0x24')](_0x2bf7dc);};}exports[_0x1e49('0x25')]=function(_0x4cc1c5,_0x333b15){var _0x3bbd84={},_0x5290a3={},_0x258882={'count':0x0,'rows':[]};var _0x3cd1ea=db[_0x1e49('0x26')][_0x1e49('0x27')];_0x5290a3[_0x1e49('0x28')]=_[_0x1e49('0x29')](_0x3cd1ea);_0x5290a3[_0x1e49('0x2a')]=_['keys'](_0x4cc1c5[_0x1e49('0x2a')]);_0x5290a3['filters']=_[_0x1e49('0x2b')](_0x5290a3[_0x1e49('0x28')],_0x5290a3[_0x1e49('0x2a')]);_0x3bbd84[_0x1e49('0x2c')]=_[_0x1e49('0x2b')](_0x5290a3[_0x1e49('0x28')],qs['fields'](_0x4cc1c5['query']['fields']));_0x3bbd84[_0x1e49('0x2c')]=_0x3bbd84['attributes'][_0x1e49('0x2d')]?_0x3bbd84[_0x1e49('0x2c')]:_0x5290a3[_0x1e49('0x28')];if(!_0x4cc1c5[_0x1e49('0x2a')][_0x1e49('0x2e')](_0x1e49('0x2f'))){_0x3bbd84['limit']=qs[_0x1e49('0x19')](_0x4cc1c5['query']['limit']);_0x3bbd84[_0x1e49('0x18')]=qs[_0x1e49('0x18')](_0x4cc1c5[_0x1e49('0x2a')][_0x1e49('0x18')]);}_0x3bbd84[_0x1e49('0x30')]=qs['sort'](_0x4cc1c5[_0x1e49('0x2a')][_0x1e49('0x31')]);_0x3bbd84['where']=qs['filters'](_[_0x1e49('0x32')](_0x4cc1c5[_0x1e49('0x2a')],_0x5290a3[_0x1e49('0x33')]));if(_0x4cc1c5['query']['filter']){_0x3bbd84['where']=_[_0x1e49('0x34')](_0x3bbd84[_0x1e49('0x35')],{'$or':_[_0x1e49('0x36')](_0x3cd1ea,function(_0x22aa6e){if(_0x22aa6e[_0x1e49('0x37')][_0x1e49('0x38')]!==_0x1e49('0x39')){var _0x5b5620={};_0x5b5620[_0x22aa6e[_0x1e49('0x3a')]]={'$like':'%'+_0x4cc1c5[_0x1e49('0x2a')]['filter']+'%'};return _0x5b5620;}})});}_0x3bbd84=_[_0x1e49('0x34')]({},_0x3bbd84,_0x4cc1c5[_0x1e49('0x3b')]);var _0x51179b={'where':_0x3bbd84[_0x1e49('0x35')]};return db[_0x1e49('0x26')][_0x1e49('0x17')](_0x51179b)[_0x1e49('0x1f')](function(_0x54de79){_0x258882['count']=_0x54de79;if(_0x4cc1c5[_0x1e49('0x2a')][_0x1e49('0x3c')]){_0x3bbd84[_0x1e49('0x3d')]=[{'all':!![]}];}return db[_0x1e49('0x26')][_0x1e49('0x3e')](_0x3bbd84);})[_0x1e49('0x1f')](function(_0x354601){_0x258882[_0x1e49('0x3f')]=_0x354601;return _0x258882;})[_0x1e49('0x1f')](respondWithFilteredResult(_0x333b15,_0x3bbd84))[_0x1e49('0x40')](handleError(_0x333b15,null));};exports['show']=function(_0x22e6ce,_0x2740f4){var _0x45d51c={'raw':!![],'where':{'id':_0x22e6ce['params']['id']}},_0x37bec2={};_0x37bec2[_0x1e49('0x28')]=_[_0x1e49('0x29')](db[_0x1e49('0x26')][_0x1e49('0x27')]);_0x37bec2[_0x1e49('0x2a')]=_[_0x1e49('0x29')](_0x22e6ce[_0x1e49('0x2a')]);_0x37bec2['filters']=_[_0x1e49('0x2b')](_0x37bec2[_0x1e49('0x28')],_0x37bec2[_0x1e49('0x2a')]);_0x45d51c['attributes']=_[_0x1e49('0x2b')](_0x37bec2[_0x1e49('0x28')],qs[_0x1e49('0x41')](_0x22e6ce[_0x1e49('0x2a')][_0x1e49('0x41')]));_0x45d51c[_0x1e49('0x2c')]=_0x45d51c[_0x1e49('0x2c')]['length']?_0x45d51c[_0x1e49('0x2c')]:_0x37bec2[_0x1e49('0x28')];if(_0x22e6ce[_0x1e49('0x2a')][_0x1e49('0x3c')]){_0x45d51c[_0x1e49('0x3d')]=[{'all':!![]}];}_0x45d51c=_[_0x1e49('0x34')]({},_0x45d51c,_0x22e6ce['options']);return db[_0x1e49('0x26')][_0x1e49('0x42')](_0x45d51c)['then'](handleEntityNotFound(_0x2740f4,null))[_0x1e49('0x1f')](respondWithResult(_0x2740f4,null))[_0x1e49('0x40')](handleError(_0x2740f4,null));};exports['create']=function(_0x242f26,_0x498a74){return db[_0x1e49('0x26')][_0x1e49('0x43')](_0x242f26['body'],{})[_0x1e49('0x1f')](respondWithResult(_0x498a74,0xc9))['catch'](handleError(_0x498a74,null));};exports['update']=function(_0x138926,_0x11ce89){if(_0x138926[_0x1e49('0x44')]['id']){delete _0x138926[_0x1e49('0x44')]['id'];}return db['SquareMessage'][_0x1e49('0x42')]({'where':{'id':_0x138926[_0x1e49('0x45')]['id']}})[_0x1e49('0x1f')](handleEntityNotFound(_0x11ce89,null))[_0x1e49('0x1f')](saveUpdates(_0x138926[_0x1e49('0x44')],null))[_0x1e49('0x1f')](respondWithResult(_0x11ce89,null))[_0x1e49('0x40')](handleError(_0x11ce89,null));};exports[_0x1e49('0x20')]=function(_0x4cf658,_0x336346){return db[_0x1e49('0x26')]['find']({'where':{'id':_0x4cf658[_0x1e49('0x45')]['id']}})[_0x1e49('0x1f')](handleEntityNotFound(_0x336346,null))[_0x1e49('0x1f')](removeEntity(_0x336346,null))[_0x1e49('0x40')](handleError(_0x336346,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0f3222c..1579027 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 _0x8d02=['SquareMessage','square_messages','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x34a49c,_0x311bf9){var _0x178e9d=function(_0x5dd714){while(--_0x5dd714){_0x34a49c['push'](_0x34a49c['shift']());}};_0x178e9d(++_0x311bf9);}(_0x8d02,0xb8));var _0x28d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8d02[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x28d0('0x0'));var util=require(_0x28d0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x28d0('0x2'));var BPromise=require(_0x28d0('0x3'));var rp=require(_0x28d0('0x4'));var fs=require('fs');var path=require(_0x28d0('0x5'));var rimraf=require(_0x28d0('0x6'));var config=require(_0x28d0('0x7'));var attributes=require(_0x28d0('0x8'));module[_0x28d0('0x9')]=function(_0x4eb516,_0xfedb2d){return _0x4eb516[_0x28d0('0xa')](_0x28d0('0xb'),attributes,{'tableName':_0x28d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc095=['../../config/logger','request-promise','path','../../config/environment','./squareMessage.attributes','define'];(function(_0x4fdeeb,_0x483814){var _0xe516a5=function(_0x202366){while(--_0x202366){_0x4fdeeb['push'](_0x4fdeeb['shift']());}};_0xe516a5(++_0x483814);}(_0xc095,0x1c8));var _0x5c09=function(_0x4f8d41,_0xb3e999){_0x4f8d41=_0x4f8d41-0x0;var _0xfa4003=_0xc095[_0x4f8d41];return _0xfa4003;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c09('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c09('0x1'));var fs=require('fs');var path=require(_0x5c09('0x2'));var rimraf=require('rimraf');var config=require(_0x5c09('0x3'));var attributes=require(_0x5c09('0x4'));module['exports']=function(_0x1b6951,_0x45cd7c){return _0x1b6951[_0x5c09('0x5')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ae6eb41..40f597c 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 _0xc53c=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareMessage','create','body','options','raw','then','catch','util','moment','bluebird'];(function(_0x30d4dd,_0x197464){var _0x162c70=function(_0x5a9999){while(--_0x5a9999){_0x30d4dd['push'](_0x30d4dd['shift']());}};_0x162c70(++_0x197464);}(_0xc53c,0x192));var _0xcc53=function(_0x36f0d4,_0x59d034){_0x36f0d4=_0x36f0d4-0x0;var _0x4d3c56=_0xc53c[_0x36f0d4];return _0x4d3c56;};'use strict';var _=require('lodash');var util=require(_0xcc53('0x0'));var moment=require(_0xcc53('0x1'));var BPromise=require(_0xcc53('0x2'));var rs=require(_0xcc53('0x3'));var fs=require('fs');var Redis=require(_0xcc53('0x4'));var db=require(_0xcc53('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc53('0x6'))('rpc');var config=require(_0xcc53('0x7'));var jayson=require(_0xcc53('0x8'));var client=jayson[_0xcc53('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x371cf3,_0x1f58d9,_0x4109df){return new BPromise(function(_0x1d62e1,_0xbf9611){return client['request'](_0x371cf3,_0x4109df)['then'](function(_0x96c4ad){logger[_0xcc53('0xa')](_0xcc53('0xb'),_0x1f58d9,_0xcc53('0xc'));logger[_0xcc53('0xd')](_0xcc53('0xe'),_0x1f58d9,'request\x20sent',JSON[_0xcc53('0xf')](_0x96c4ad));if(_0x96c4ad[_0xcc53('0x10')]){if(_0x96c4ad['error'][_0xcc53('0x11')]===0x1f4){logger[_0xcc53('0x10')]('SquareMessage,\x20%s,\x20%s',_0x1f58d9,_0x96c4ad['error'][_0xcc53('0x12')]);return _0xbf9611(_0x96c4ad[_0xcc53('0x10')]['message']);}logger[_0xcc53('0x10')](_0xcc53('0xb'),_0x1f58d9,_0x96c4ad[_0xcc53('0x10')][_0xcc53('0x12')]);return _0x1d62e1(_0x96c4ad[_0xcc53('0x10')][_0xcc53('0x12')]);}else{logger[_0xcc53('0xa')]('SquareMessage,\x20%s,\x20%s',_0x1f58d9,'request\x20sent');_0x1d62e1(_0x96c4ad[_0xcc53('0x13')]['message']);}})['catch'](function(_0x4fb8bc){logger['error'](_0xcc53('0xb'),_0x1f58d9,_0x4fb8bc);_0xbf9611(_0x4fb8bc);});});}exports[_0xcc53('0x14')]=function(_0x3c9eab){var _0x251215=this;return new Promise(function(_0x374f20,_0x311039){return db['SquareMessage'][_0xcc53('0x15')](_0x3c9eab[_0xcc53('0x16')],{'raw':_0x3c9eab[_0xcc53('0x17')]?_0x3c9eab[_0xcc53('0x17')][_0xcc53('0x18')]===undefined?!![]:![]:!![]})[_0xcc53('0x19')](function(_0xb8f8a9){logger['info'](_0xcc53('0x14'),_0x3c9eab);logger[_0xcc53('0xd')]('CreateSquareMessage',_0x3c9eab,JSON['stringify'](_0xb8f8a9));_0x374f20(_0xb8f8a9);})[_0xcc53('0x1a')](function(_0x92bd5d){logger[_0xcc53('0x10')]('CreateSquareMessage',_0x92bd5d[_0xcc53('0x12')],_0x3c9eab);_0x311039(_0x251215[_0xcc53('0x10')](0x1f4,_0x92bd5d['message']));});});}; \ No newline at end of file +var _0x22f8=['result','catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x23f622,_0x38c9e9){var _0x415580=function(_0x2c081f){while(--_0x2c081f){_0x23f622['push'](_0x23f622['shift']());}};_0x415580(++_0x38c9e9);}(_0x22f8,0x7f));var _0x822f=function(_0x27a9cc,_0x3bae61){_0x27a9cc=_0x27a9cc-0x0;var _0x37d740=_0x22f8[_0x27a9cc];return _0x37d740;};'use strict';var _=require(_0x822f('0x0'));var util=require('util');var moment=require(_0x822f('0x1'));var BPromise=require(_0x822f('0x2'));var rs=require(_0x822f('0x3'));var fs=require('fs');var Redis=require(_0x822f('0x4'));var db=require(_0x822f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x822f('0x6'))(_0x822f('0x7'));var config=require(_0x822f('0x8'));var jayson=require(_0x822f('0x9'));var client=jayson[_0x822f('0xa')][_0x822f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426de0,_0x3b28ee,_0x569dc7){return new BPromise(function(_0xdf3d49,_0x505ca5){return client[_0x822f('0xc')](_0x426de0,_0x569dc7)[_0x822f('0xd')](function(_0x3620ec){logger[_0x822f('0xe')](_0x822f('0xf'),_0x3b28ee,_0x822f('0x10'));logger[_0x822f('0x11')](_0x822f('0x12'),_0x3b28ee,_0x822f('0x10'),JSON[_0x822f('0x13')](_0x3620ec));if(_0x3620ec[_0x822f('0x14')]){if(_0x3620ec[_0x822f('0x14')][_0x822f('0x15')]===0x1f4){logger[_0x822f('0x14')](_0x822f('0xf'),_0x3b28ee,_0x3620ec[_0x822f('0x14')]['message']);return _0x505ca5(_0x3620ec[_0x822f('0x14')]['message']);}logger[_0x822f('0x14')](_0x822f('0xf'),_0x3b28ee,_0x3620ec[_0x822f('0x14')][_0x822f('0x16')]);return _0xdf3d49(_0x3620ec[_0x822f('0x14')][_0x822f('0x16')]);}else{logger[_0x822f('0xe')](_0x822f('0xf'),_0x3b28ee,_0x822f('0x10'));_0xdf3d49(_0x3620ec[_0x822f('0x17')]['message']);}})[_0x822f('0x18')](function(_0x85b11){logger[_0x822f('0x14')](_0x822f('0xf'),_0x3b28ee,_0x85b11);_0x505ca5(_0x85b11);});});}exports[_0x822f('0x19')]=function(_0x64bf92){var _0x45c4db=this;return new Promise(function(_0x2d9573,_0x195d6e){return db[_0x822f('0x1a')]['create'](_0x64bf92[_0x822f('0x1b')],{'raw':_0x64bf92[_0x822f('0x1c')]?_0x64bf92[_0x822f('0x1c')][_0x822f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x466b90){logger[_0x822f('0xe')](_0x822f('0x19'),_0x64bf92);logger[_0x822f('0x11')](_0x822f('0x19'),_0x64bf92,JSON['stringify'](_0x466b90));_0x2d9573(_0x466b90);})[_0x822f('0x18')](function(_0x46a9a1){logger[_0x822f('0x14')](_0x822f('0x19'),_0x46a9a1['message'],_0x64bf92);_0x195d6e(_0x45c4db[_0x822f('0x14')](0x1f4,_0x46a9a1[_0x822f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 825f9c6..1b94ec3 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 _0x2bb0=['update','destroy','exports','multer','util','path','express','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','test','create'];(function(_0xc053a5,_0x40b290){var _0x3354e6=function(_0x53ec08){while(--_0x53ec08){_0xc053a5['push'](_0xc053a5['shift']());}};_0x3354e6(++_0x40b290);}(_0x2bb0,0xf3));var _0x02bb=function(_0xde8751,_0x47bfee){_0xde8751=_0xde8751-0x0;var _0x17db6e=_0x2bb0[_0xde8751];return _0x17db6e;};'use strict';var multer=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var path=require(_0x02bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x02bb('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x02bb('0x4'));var config=require('../../config/environment');var controller=require(_0x02bb('0x5'));router[_0x02bb('0x6')]('/',auth[_0x02bb('0x7')](),controller[_0x02bb('0x8')]);router[_0x02bb('0x6')](_0x02bb('0x9'),auth[_0x02bb('0x7')](),controller['show']);router[_0x02bb('0x6')](_0x02bb('0xa'),auth[_0x02bb('0x7')](),timeout('15s'),controller[_0x02bb('0xb')]);router['post']('/',auth[_0x02bb('0x7')](),controller[_0x02bb('0xc')]);router['put'](_0x02bb('0x9'),auth[_0x02bb('0x7')](),controller[_0x02bb('0xd')]);router['delete'](_0x02bb('0x9'),auth['isAuthenticated'](),controller[_0x02bb('0xe')]);module[_0x02bb('0xf')]=router; \ No newline at end of file +var _0x4de7=['../../components/auth/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x1b6d13,_0x274205){var _0x3b19c1=function(_0x415c0e){while(--_0x415c0e){_0x1b6d13['push'](_0x1b6d13['shift']());}};_0x3b19c1(++_0x274205);}(_0x4de7,0x1f3));var _0x74de=function(_0x425d11,_0x1aaf28){_0x425d11=_0x425d11-0x0;var _0x21eb6b=_0x4de7[_0x425d11];return _0x21eb6b;};'use strict';var multer=require(_0x74de('0x0'));var util=require('util');var path=require(_0x74de('0x1'));var timeout=require(_0x74de('0x2'));var express=require(_0x74de('0x3'));var router=express[_0x74de('0x4')]();var auth=require(_0x74de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74de('0x6'));var controller=require(_0x74de('0x7'));router[_0x74de('0x8')]('/',auth['isAuthenticated'](),controller[_0x74de('0x9')]);router[_0x74de('0x8')](_0x74de('0xa'),auth[_0x74de('0xb')](),controller[_0x74de('0xc')]);router[_0x74de('0x8')](_0x74de('0xd'),auth[_0x74de('0xb')](),timeout(_0x74de('0xe')),controller[_0x74de('0xf')]);router['post']('/',auth[_0x74de('0xb')](),controller['create']);router[_0x74de('0x10')](_0x74de('0xa'),auth['isAuthenticated'](),controller[_0x74de('0x11')]);router[_0x74de('0x12')](_0x74de('0xa'),auth[_0x74de('0xb')](),controller[_0x74de('0x13')]);module[_0x74de('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 246af73..0240a82 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 _0x6982=['name','STRING','sequelize','exports'];(function(_0x26d33d,_0x3da842){var _0x122a7e=function(_0x46ac37){while(--_0x46ac37){_0x26d33d['push'](_0x26d33d['shift']());}};_0x122a7e(++_0x3da842);}(_0x6982,0x1ea));var _0x2698=function(_0x25e816,_0x3586a0){_0x25e816=_0x25e816-0x0;var _0x2aa8d1=_0x6982[_0x25e816];return _0x2aa8d1;};'use strict';var Sequelize=require(_0x2698('0x0'));module[_0x2698('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2698('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2698('0x3')]}}; \ No newline at end of file +var _0xd86e=['STRING','sequelize','exports'];(function(_0x5c2d08,_0x1f3413){var _0x377655=function(_0x1da8aa){while(--_0x1da8aa){_0x5c2d08['push'](_0x5c2d08['shift']());}};_0x377655(++_0x1f3413);}(_0xd86e,0xe2));var _0xed86=function(_0x5950f4,_0x2a1816){_0x5950f4=_0x5950f4-0x0;var _0x21f517=_0xd86e[_0x5950f4];return _0x21f517;};'use strict';var Sequelize=require(_0xed86('0x0'));module[_0xed86('0x1')]={'name':{'type':Sequelize[_0xed86('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xed86('0x2')]},'description':{'type':Sequelize[_0xed86('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e182880..1fa4f94 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 _0x4e49=['SquareOdbc','findAll','rows','show','params','keys','catch','create','body','user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','count','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e49,0x15d));var _0x94e4=function(_0x2beb29,_0x2e6832){_0x2beb29=_0x2beb29-0x0;var _0x3b2687=_0x4e49[_0x2beb29];return _0x3b2687;};'use strict';var pdf=require(_0x94e4('0x0'));var emlformat=require(_0x94e4('0x1'));var rimraf=require(_0x94e4('0x2'));var zipdir=require(_0x94e4('0x3'));var jsonpatch=require(_0x94e4('0x4'));var rp=require(_0x94e4('0x5'));var moment=require(_0x94e4('0x6'));var BPromise=require(_0x94e4('0x7'));var Mustache=require('mustache');var util=require(_0x94e4('0x8'));var path=require(_0x94e4('0x9'));var sox=require(_0x94e4('0xa'));var csv=require('to-csv');var ejs=require(_0x94e4('0xb'));var fs=require('fs');var _=require(_0x94e4('0xc'));var squel=require(_0x94e4('0xd'));var crypto=require(_0x94e4('0xe'));var jsforce=require(_0x94e4('0xf'));var deskjs=require(_0x94e4('0x10'));var toCsv=require(_0x94e4('0x11'));var querystring=require(_0x94e4('0x12'));var Papa=require(_0x94e4('0x13'));var Redis=require('ioredis');var authService=require(_0x94e4('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x94e4('0x15'));var utils=require('../../config/utils');var config=require(_0x94e4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d529f,_0x136a0b){_0x136a0b=_0x136a0b||0xcc;return function(_0x11cf1b){if(_0x11cf1b){return _0x3d529f[_0x94e4('0x17')](_0x136a0b);}return _0x3d529f[_0x94e4('0x18')](_0x136a0b)[_0x94e4('0x19')]();};}function respondWithResult(_0x260c39,_0x13ff8b){_0x13ff8b=_0x13ff8b||0xc8;return function(_0x4368e3){if(_0x4368e3){return _0x260c39['status'](_0x13ff8b)[_0x94e4('0x1a')](_0x4368e3);}};}function respondWithFilteredResult(_0x3f287e,_0x5f21d7){return function(_0x1ee342){if(_0x1ee342){var _0x1358d9=_0x1ee342['count'],_0x238f14=_0x5f21d7[_0x94e4('0x1b')],_0x1a2847=_0x5f21d7[_0x94e4('0x1b')]+_0x5f21d7[_0x94e4('0x1c')],_0x12609c;if(_0x1a2847>=_0x1358d9){_0x1a2847=_0x1358d9;_0x12609c=0xc8;}else{_0x12609c=0xce;}_0x3f287e[_0x94e4('0x18')](_0x12609c);return _0x3f287e[_0x94e4('0x1d')](_0x94e4('0x1e'),_0x238f14+'-'+_0x1a2847+'/'+_0x1358d9)[_0x94e4('0x1a')](_0x1ee342);}return null;};}function patchUpdates(_0x571c60){return function(_0x214640){try{jsonpatch['apply'](_0x214640,_0x571c60,!![]);}catch(_0x40edf4){return BPromise[_0x94e4('0x1f')](_0x40edf4);}return _0x214640['save']();};}function saveUpdates(_0x41b31,_0x435d83){return function(_0x326ab6){if(_0x326ab6){return _0x326ab6[_0x94e4('0x20')](_0x41b31)[_0x94e4('0x21')](function(_0x2e819b){return _0x2e819b;});}return null;};}function removeEntity(_0x1a36dc,_0x4867a2){return function(_0x531644){if(_0x531644){return _0x531644[_0x94e4('0x22')]()['then'](function(){var _0x4fe864=_0x531644[_0x94e4('0x23')]({'plain':!![]});var _0x53f32a=_0x94e4('0x24');return db[_0x94e4('0x25')][_0x94e4('0x22')]({'where':{'type':_0x53f32a,'resourceId':_0x4fe864['id']}})['then'](function(){return _0x531644;});})[_0x94e4('0x21')](function(){_0x1a36dc[_0x94e4('0x18')](0xcc)[_0x94e4('0x19')]();});}};}function handleEntityNotFound(_0x12dda3,_0x2f6593){return function(_0x37fcca){if(!_0x37fcca){_0x12dda3[_0x94e4('0x17')](0x194);}return _0x37fcca;};}function handleError(_0x565b78,_0x4dd01d){_0x4dd01d=_0x4dd01d||0x1f4;return function(_0x463ab0){logger['error'](_0x463ab0[_0x94e4('0x26')]);if(_0x463ab0[_0x94e4('0x27')]){delete _0x463ab0[_0x94e4('0x27')];}_0x565b78[_0x94e4('0x18')](_0x4dd01d)[_0x94e4('0x28')](_0x463ab0);};}exports[_0x94e4('0x29')]=function(_0x41a5e5,_0x2ebbb7){var _0x52afe7={},_0x2849ae={},_0x348c77={'count':0x0,'rows':[]};var _0x2a8cdf=db['SquareOdbc'][_0x94e4('0x2a')];_0x2849ae['model']=_['keys'](_0x2a8cdf);_0x2849ae[_0x94e4('0x2b')]=_['keys'](_0x41a5e5[_0x94e4('0x2b')]);_0x2849ae['filters']=_[_0x94e4('0x2c')](_0x2849ae[_0x94e4('0x2d')],_0x2849ae[_0x94e4('0x2b')]);_0x52afe7[_0x94e4('0x2e')]=_[_0x94e4('0x2c')](_0x2849ae[_0x94e4('0x2d')],qs[_0x94e4('0x2f')](_0x41a5e5['query'][_0x94e4('0x2f')]));_0x52afe7[_0x94e4('0x2e')]=_0x52afe7[_0x94e4('0x2e')][_0x94e4('0x30')]?_0x52afe7['attributes']:_0x2849ae[_0x94e4('0x2d')];if(!_0x41a5e5[_0x94e4('0x2b')][_0x94e4('0x31')](_0x94e4('0x32'))){_0x52afe7[_0x94e4('0x1c')]=qs['limit'](_0x41a5e5['query'][_0x94e4('0x1c')]);_0x52afe7['offset']=qs['offset'](_0x41a5e5[_0x94e4('0x2b')][_0x94e4('0x1b')]);}_0x52afe7[_0x94e4('0x33')]=qs[_0x94e4('0x34')](_0x41a5e5[_0x94e4('0x2b')]['sort']);_0x52afe7[_0x94e4('0x35')]=qs['filters'](_['pick'](_0x41a5e5['query'],_0x2849ae['filters']));if(_0x41a5e5[_0x94e4('0x2b')]['filter']){_0x52afe7[_0x94e4('0x35')]=_[_0x94e4('0x36')](_0x52afe7[_0x94e4('0x35')],{'$or':_['map'](_0x2a8cdf,function(_0x161c05){if(_0x161c05[_0x94e4('0x37')]['key']!=='VIRTUAL'){var _0x2b34c3={};_0x2b34c3[_0x161c05['field']]={'$like':'%'+_0x41a5e5['query'][_0x94e4('0x38')]+'%'};return _0x2b34c3;}})});}_0x52afe7=_['merge']({},_0x52afe7,_0x41a5e5[_0x94e4('0x39')]);var _0x4fd901={'where':_0x52afe7[_0x94e4('0x35')]};return db['SquareOdbc'][_0x94e4('0x3a')](_0x4fd901)[_0x94e4('0x21')](function(_0x5273c9){_0x348c77[_0x94e4('0x3a')]=_0x5273c9;if(_0x41a5e5[_0x94e4('0x2b')][_0x94e4('0x3b')]){_0x52afe7[_0x94e4('0x3c')]=[{'all':!![]}];}return db[_0x94e4('0x3d')][_0x94e4('0x3e')](_0x52afe7);})[_0x94e4('0x21')](function(_0x3102ba){_0x348c77[_0x94e4('0x3f')]=_0x3102ba;return _0x348c77;})[_0x94e4('0x21')](respondWithFilteredResult(_0x2ebbb7,_0x52afe7))['catch'](handleError(_0x2ebbb7,null));};exports[_0x94e4('0x40')]=function(_0x6f7742,_0x2e452f){var _0x38ab04={'raw':!![],'where':{'id':_0x6f7742[_0x94e4('0x41')]['id']}},_0x399c21={};_0x399c21[_0x94e4('0x2d')]=_[_0x94e4('0x42')](db[_0x94e4('0x3d')][_0x94e4('0x2a')]);_0x399c21[_0x94e4('0x2b')]=_[_0x94e4('0x42')](_0x6f7742[_0x94e4('0x2b')]);_0x399c21['filters']=_[_0x94e4('0x2c')](_0x399c21[_0x94e4('0x2d')],_0x399c21[_0x94e4('0x2b')]);_0x38ab04[_0x94e4('0x2e')]=_['intersection'](_0x399c21[_0x94e4('0x2d')],qs[_0x94e4('0x2f')](_0x6f7742[_0x94e4('0x2b')]['fields']));_0x38ab04[_0x94e4('0x2e')]=_0x38ab04[_0x94e4('0x2e')][_0x94e4('0x30')]?_0x38ab04['attributes']:_0x399c21[_0x94e4('0x2d')];if(_0x6f7742[_0x94e4('0x2b')]['includeAll']){_0x38ab04['include']=[{'all':!![]}];}_0x38ab04=_[_0x94e4('0x36')]({},_0x38ab04,_0x6f7742[_0x94e4('0x39')]);return db[_0x94e4('0x3d')]['find'](_0x38ab04)[_0x94e4('0x21')](handleEntityNotFound(_0x2e452f,null))[_0x94e4('0x21')](respondWithResult(_0x2e452f,null))[_0x94e4('0x43')](handleError(_0x2e452f,null));};exports[_0x94e4('0x44')]=function(_0x37265e,_0x2fef51){return db[_0x94e4('0x3d')][_0x94e4('0x44')](_0x37265e[_0x94e4('0x45')],{})['then'](function(_0x1100c6){var _0x132292=_0x37265e[_0x94e4('0x46')][_0x94e4('0x23')]({'plain':!![]});if(!_0x132292)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x132292[_0x94e4('0x47')]===_0x94e4('0x46')){var _0x6a4d4b=_0x1100c6[_0x94e4('0x23')]({'plain':!![]});var _0x4219e2=_0x94e4('0x24');return db['UserProfileSection'][_0x94e4('0x48')]({'where':{'name':_0x4219e2,'userProfileId':_0x132292[_0x94e4('0x49')]},'raw':!![]})[_0x94e4('0x21')](function(_0x44e162){if(_0x44e162&&_0x44e162[_0x94e4('0x4a')]===0x0){return db[_0x94e4('0x25')][_0x94e4('0x44')]({'name':_0x6a4d4b[_0x94e4('0x27')],'resourceId':_0x6a4d4b['id'],'type':_0x44e162['name'],'sectionId':_0x44e162['id']},{})[_0x94e4('0x21')](function(){return _0x1100c6;});}else{return _0x1100c6;}})[_0x94e4('0x43')](function(_0x38fbde){logger[_0x94e4('0x4b')](_0x94e4('0x4c'),_0x38fbde);throw _0x38fbde;});}return _0x1100c6;})['then'](respondWithResult(_0x2fef51,0xc9))[_0x94e4('0x43')](handleError(_0x2fef51,null));};exports[_0x94e4('0x20')]=function(_0x522c97,_0x3ced72){if(_0x522c97['body']['id']){delete _0x522c97[_0x94e4('0x45')]['id'];}return db[_0x94e4('0x3d')]['find']({'where':{'id':_0x522c97[_0x94e4('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ced72,null))[_0x94e4('0x21')](saveUpdates(_0x522c97[_0x94e4('0x45')],null))['then'](respondWithResult(_0x3ced72,null))[_0x94e4('0x43')](handleError(_0x3ced72,null));};exports[_0x94e4('0x22')]=function(_0x18d5a7,_0x3f4363){return db[_0x94e4('0x3d')][_0x94e4('0x48')]({'where':{'id':_0x18d5a7['params']['id']}})[_0x94e4('0x21')](handleEntityNotFound(_0x3f4363,null))[_0x94e4('0x21')](removeEntity(_0x3f4363,null))['catch'](handleError(_0x3f4363,null));};exports[_0x94e4('0x4d')]=function(_0x14689b,_0x17c887,_0x2ae2be){var _0x4be280;return db[_0x94e4('0x3d')]['find']({'where':{'id':_0x14689b[_0x94e4('0x41')]['id']},'attributes':['id',_0x94e4('0x4e')]})[_0x94e4('0x21')](handleEntityNotFound(_0x17c887,null))['then'](function(_0x22e8c5){if(_0x22e8c5){var _0x46e4f8=require(_0x94e4('0x4f'))();_0x46e4f8[_0x94e4('0x50')](_0x22e8c5[_0x94e4('0x4e')]);_0x46e4f8[_0x94e4('0x51')]();return _0x22e8c5;}})[_0x94e4('0x21')](respondWithResult(_0x17c887,null))[_0x94e4('0x43')](handleError(_0x17c887,null));}; \ No newline at end of file +var _0x30bf=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','name','index','SquareOdbc','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','field','filter','options','count','findAll','rows','catch','show','params','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x271ebd,_0x1c24ac){var _0x313e1d=function(_0x2ae8ac){while(--_0x2ae8ac){_0x271ebd['push'](_0x271ebd['shift']());}};_0x313e1d(++_0x1c24ac);}(_0x30bf,0xf2));var _0xf30b=function(_0x1adbc5,_0x414d56){_0x1adbc5=_0x1adbc5-0x0;var _0x5283a3=_0x30bf[_0x1adbc5];return _0x5283a3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf30b('0x0'));var rimraf=require(_0xf30b('0x1'));var zipdir=require(_0xf30b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf30b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf30b('0x4'));var util=require(_0xf30b('0x5'));var path=require(_0xf30b('0x6'));var sox=require(_0xf30b('0x7'));var csv=require(_0xf30b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf30b('0x9'));var squel=require(_0xf30b('0xa'));var crypto=require(_0xf30b('0xb'));var jsforce=require(_0xf30b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf30b('0xd'));var Papa=require(_0xf30b('0xe'));var Redis=require(_0xf30b('0xf'));var authService=require(_0xf30b('0x10'));var qs=require(_0xf30b('0x11'));var hardwareService=require(_0xf30b('0x12'));var logger=require(_0xf30b('0x13'))(_0xf30b('0x14'));var utils=require(_0xf30b('0x15'));var config=require(_0xf30b('0x16'));var db=require(_0xf30b('0x17'))['db'];function respondWithStatusCode(_0x44f1de,_0x253d00){_0x253d00=_0x253d00||0xcc;return function(_0x3799bc){if(_0x3799bc){return _0x44f1de[_0xf30b('0x18')](_0x253d00);}return _0x44f1de['status'](_0x253d00)[_0xf30b('0x19')]();};}function respondWithResult(_0x408f6e,_0x53a064){_0x53a064=_0x53a064||0xc8;return function(_0x58ad1e){if(_0x58ad1e){return _0x408f6e['status'](_0x53a064)[_0xf30b('0x1a')](_0x58ad1e);}};}function respondWithFilteredResult(_0x643a36,_0x4a53ea){return function(_0x5f1d93){if(_0x5f1d93){var _0x19d020=_0x5f1d93['count'],_0x8576ea=_0x4a53ea[_0xf30b('0x1b')],_0xc46e69=_0x4a53ea[_0xf30b('0x1b')]+_0x4a53ea[_0xf30b('0x1c')],_0x5a6b37;if(_0xc46e69>=_0x19d020){_0xc46e69=_0x19d020;_0x5a6b37=0xc8;}else{_0x5a6b37=0xce;}_0x643a36[_0xf30b('0x1d')](_0x5a6b37);return _0x643a36[_0xf30b('0x1e')](_0xf30b('0x1f'),_0x8576ea+'-'+_0xc46e69+'/'+_0x19d020)[_0xf30b('0x1a')](_0x5f1d93);}return null;};}function patchUpdates(_0x27398d){return function(_0x3c17e3){try{jsonpatch[_0xf30b('0x20')](_0x3c17e3,_0x27398d,!![]);}catch(_0x23a188){return BPromise[_0xf30b('0x21')](_0x23a188);}return _0x3c17e3[_0xf30b('0x22')]();};}function saveUpdates(_0x526bea,_0x21bb1f){return function(_0x387086){if(_0x387086){return _0x387086[_0xf30b('0x23')](_0x526bea)[_0xf30b('0x24')](function(_0x31603c){return _0x31603c;});}return null;};}function removeEntity(_0x905d6f,_0x1864b1){return function(_0x218119){if(_0x218119){return _0x218119['destroy']()[_0xf30b('0x24')](function(){var _0x3a2c31=_0x218119[_0xf30b('0x25')]({'plain':!![]});var _0x3fd1e4='ODBC';return db[_0xf30b('0x26')][_0xf30b('0x27')]({'where':{'type':_0x3fd1e4,'resourceId':_0x3a2c31['id']}})[_0xf30b('0x24')](function(){return _0x218119;});})[_0xf30b('0x24')](function(){_0x905d6f['status'](0xcc)[_0xf30b('0x19')]();});}};}function handleEntityNotFound(_0x4f3606,_0x4ccc87){return function(_0x5c8388){if(!_0x5c8388){_0x4f3606[_0xf30b('0x18')](0x194);}return _0x5c8388;};}function handleError(_0x89daeb,_0x3e5de5){_0x3e5de5=_0x3e5de5||0x1f4;return function(_0xa733f){logger['error'](_0xa733f['stack']);if(_0xa733f[_0xf30b('0x28')]){delete _0xa733f[_0xf30b('0x28')];}_0x89daeb[_0xf30b('0x1d')](_0x3e5de5)['send'](_0xa733f);};}exports[_0xf30b('0x29')]=function(_0x3d9d32,_0x581cf7){var _0x435039={},_0x33429b={},_0x2cb982={'count':0x0,'rows':[]};var _0x30444c=db[_0xf30b('0x2a')][_0xf30b('0x2b')];_0x33429b[_0xf30b('0x2c')]=_[_0xf30b('0x2d')](_0x30444c);_0x33429b[_0xf30b('0x2e')]=_[_0xf30b('0x2d')](_0x3d9d32['query']);_0x33429b[_0xf30b('0x2f')]=_[_0xf30b('0x30')](_0x33429b[_0xf30b('0x2c')],_0x33429b[_0xf30b('0x2e')]);_0x435039[_0xf30b('0x31')]=_['intersection'](_0x33429b[_0xf30b('0x2c')],qs[_0xf30b('0x32')](_0x3d9d32[_0xf30b('0x2e')][_0xf30b('0x32')]));_0x435039['attributes']=_0x435039[_0xf30b('0x31')][_0xf30b('0x33')]?_0x435039[_0xf30b('0x31')]:_0x33429b['model'];if(!_0x3d9d32[_0xf30b('0x2e')][_0xf30b('0x34')]('nolimit')){_0x435039[_0xf30b('0x1c')]=qs[_0xf30b('0x1c')](_0x3d9d32[_0xf30b('0x2e')][_0xf30b('0x1c')]);_0x435039[_0xf30b('0x1b')]=qs[_0xf30b('0x1b')](_0x3d9d32[_0xf30b('0x2e')]['offset']);}_0x435039['order']=qs[_0xf30b('0x35')](_0x3d9d32['query'][_0xf30b('0x35')]);_0x435039[_0xf30b('0x36')]=qs[_0xf30b('0x2f')](_[_0xf30b('0x37')](_0x3d9d32[_0xf30b('0x2e')],_0x33429b[_0xf30b('0x2f')]));if(_0x3d9d32[_0xf30b('0x2e')]['filter']){_0x435039['where']=_[_0xf30b('0x38')](_0x435039[_0xf30b('0x36')],{'$or':_[_0xf30b('0x39')](_0x30444c,function(_0x4b0142){if(_0x4b0142[_0xf30b('0x3a')][_0xf30b('0x3b')]!=='VIRTUAL'){var _0x49430f={};_0x49430f[_0x4b0142[_0xf30b('0x3c')]]={'$like':'%'+_0x3d9d32[_0xf30b('0x2e')][_0xf30b('0x3d')]+'%'};return _0x49430f;}})});}_0x435039=_[_0xf30b('0x38')]({},_0x435039,_0x3d9d32[_0xf30b('0x3e')]);var _0x2fc21a={'where':_0x435039['where']};return db[_0xf30b('0x2a')][_0xf30b('0x3f')](_0x2fc21a)[_0xf30b('0x24')](function(_0x39282e){_0x2cb982['count']=_0x39282e;if(_0x3d9d32['query']['includeAll']){_0x435039['include']=[{'all':!![]}];}return db[_0xf30b('0x2a')][_0xf30b('0x40')](_0x435039);})['then'](function(_0x53e5b9){_0x2cb982[_0xf30b('0x41')]=_0x53e5b9;return _0x2cb982;})['then'](respondWithFilteredResult(_0x581cf7,_0x435039))[_0xf30b('0x42')](handleError(_0x581cf7,null));};exports[_0xf30b('0x43')]=function(_0xd47fa7,_0x2b76e4){var _0x261fd={'raw':!![],'where':{'id':_0xd47fa7[_0xf30b('0x44')]['id']}},_0x562f33={};_0x562f33[_0xf30b('0x2c')]=_[_0xf30b('0x2d')](db[_0xf30b('0x2a')]['rawAttributes']);_0x562f33[_0xf30b('0x2e')]=_[_0xf30b('0x2d')](_0xd47fa7[_0xf30b('0x2e')]);_0x562f33['filters']=_[_0xf30b('0x30')](_0x562f33[_0xf30b('0x2c')],_0x562f33[_0xf30b('0x2e')]);_0x261fd[_0xf30b('0x31')]=_[_0xf30b('0x30')](_0x562f33['model'],qs[_0xf30b('0x32')](_0xd47fa7[_0xf30b('0x2e')][_0xf30b('0x32')]));_0x261fd[_0xf30b('0x31')]=_0x261fd[_0xf30b('0x31')][_0xf30b('0x33')]?_0x261fd['attributes']:_0x562f33[_0xf30b('0x2c')];if(_0xd47fa7[_0xf30b('0x2e')][_0xf30b('0x45')]){_0x261fd[_0xf30b('0x46')]=[{'all':!![]}];}_0x261fd=_['merge']({},_0x261fd,_0xd47fa7[_0xf30b('0x3e')]);return db[_0xf30b('0x2a')][_0xf30b('0x47')](_0x261fd)[_0xf30b('0x24')](handleEntityNotFound(_0x2b76e4,null))[_0xf30b('0x24')](respondWithResult(_0x2b76e4,null))[_0xf30b('0x42')](handleError(_0x2b76e4,null));};exports['create']=function(_0xa53c3f,_0x1900d5){return db[_0xf30b('0x2a')][_0xf30b('0x48')](_0xa53c3f['body'],{})[_0xf30b('0x24')](function(_0x3513d3){var _0x20a7cd=_0xa53c3f['user'][_0xf30b('0x25')]({'plain':!![]});if(!_0x20a7cd)throw new Error(_0xf30b('0x49'));if(_0x20a7cd[_0xf30b('0x4a')]==='user'){var _0x5f4490=_0x3513d3[_0xf30b('0x25')]({'plain':!![]});var _0x26a595=_0xf30b('0x4b');return db['UserProfileSection'][_0xf30b('0x47')]({'where':{'name':_0x26a595,'userProfileId':_0x20a7cd[_0xf30b('0x4c')]},'raw':!![]})['then'](function(_0x3cdaa4){if(_0x3cdaa4&&_0x3cdaa4[_0xf30b('0x4d')]===0x0){return db[_0xf30b('0x26')][_0xf30b('0x48')]({'name':_0x5f4490[_0xf30b('0x28')],'resourceId':_0x5f4490['id'],'type':_0x3cdaa4[_0xf30b('0x28')],'sectionId':_0x3cdaa4['id']},{})['then'](function(){return _0x3513d3;});}else{return _0x3513d3;}})[_0xf30b('0x42')](function(_0x10a176){logger[_0xf30b('0x4e')](_0xf30b('0x4f'),_0x10a176);throw _0x10a176;});}return _0x3513d3;})[_0xf30b('0x24')](respondWithResult(_0x1900d5,0xc9))[_0xf30b('0x42')](handleError(_0x1900d5,null));};exports[_0xf30b('0x23')]=function(_0x571ea5,_0x3d6633){if(_0x571ea5[_0xf30b('0x50')]['id']){delete _0x571ea5[_0xf30b('0x50')]['id'];}return db[_0xf30b('0x2a')]['find']({'where':{'id':_0x571ea5['params']['id']}})[_0xf30b('0x24')](handleEntityNotFound(_0x3d6633,null))[_0xf30b('0x24')](saveUpdates(_0x571ea5[_0xf30b('0x50')],null))[_0xf30b('0x24')](respondWithResult(_0x3d6633,null))['catch'](handleError(_0x3d6633,null));};exports['destroy']=function(_0x5bca8a,_0x9c0f9e){return db['SquareOdbc']['find']({'where':{'id':_0x5bca8a[_0xf30b('0x44')]['id']}})[_0xf30b('0x24')](handleEntityNotFound(_0x9c0f9e,null))['then'](removeEntity(_0x9c0f9e,null))[_0xf30b('0x42')](handleError(_0x9c0f9e,null));};exports[_0xf30b('0x51')]=function(_0x36fb0b,_0x58850c,_0x5a1401){var _0x413c05;return db[_0xf30b('0x2a')][_0xf30b('0x47')]({'where':{'id':_0x36fb0b[_0xf30b('0x44')]['id']},'attributes':['id',_0xf30b('0x52')]})[_0xf30b('0x24')](handleEntityNotFound(_0x58850c,null))[_0xf30b('0x24')](function(_0x9a0800){if(_0x9a0800){var _0x2b951a=require(_0xf30b('0x53'))();_0x2b951a['openSync'](_0x9a0800[_0xf30b('0x52')]);_0x2b951a[_0xf30b('0x54')]();return _0x9a0800;}})[_0xf30b('0x24')](respondWithResult(_0x58850c,null))[_0xf30b('0x42')](handleError(_0x58850c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index d6e7fcd..77ea788 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 _0x2a6e=['../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f1c02,_0x3f24bf){var _0x5bb7de=function(_0x839c27){while(--_0x839c27){_0x2f1c02['push'](_0x2f1c02['shift']());}};_0x5bb7de(++_0x3f24bf);}(_0x2a6e,0xe9));var _0xe2a6=function(_0x1c8b1b,_0x14fdbd){_0x1c8b1b=_0x1c8b1b-0x0;var _0x228d6f=_0x2a6e[_0x1c8b1b];return _0x228d6f;};'use strict';var _=require('lodash');var util=require(_0xe2a6('0x0'));var logger=require('../../config/logger')(_0xe2a6('0x1'));var moment=require(_0xe2a6('0x2'));var BPromise=require(_0xe2a6('0x3'));var rp=require(_0xe2a6('0x4'));var fs=require('fs');var path=require(_0xe2a6('0x5'));var rimraf=require(_0xe2a6('0x6'));var config=require(_0xe2a6('0x7'));var attributes=require(_0xe2a6('0x8'));module[_0xe2a6('0x9')]=function(_0x444989,_0x13babe){return _0x444989['define'](_0xe2a6('0xa'),attributes,{'tableName':_0xe2a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3089=['square_odbc','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x230258,_0x24b55e){var _0x383571=function(_0x2b6bb1){while(--_0x2b6bb1){_0x230258['push'](_0x230258['shift']());}};_0x383571(++_0x24b55e);}(_0x3089,0x187));var _0x9308=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x3089[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x9308('0x0'));var util=require(_0x9308('0x1'));var logger=require(_0x9308('0x2'))(_0x9308('0x3'));var moment=require('moment');var BPromise=require(_0x9308('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9308('0x5'));var rimraf=require(_0x9308('0x6'));var config=require(_0x9308('0x7'));var attributes=require(_0x9308('0x8'));module[_0x9308('0x9')]=function(_0x41ab42,_0x1148cd){return _0x41ab42[_0x9308('0xa')](_0x9308('0xb'),attributes,{'tableName':_0x9308('0xc'),'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 6d7bfdb..2921c2d 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 _0x6f26=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','model','map','lodash','util','moment','bluebird'];(function(_0x23925a,_0x168a91){var _0x26577e=function(_0x349029){while(--_0x349029){_0x23925a['push'](_0x23925a['shift']());}};_0x26577e(++_0x168a91);}(_0x6f26,0xb6));var _0x66f2=function(_0x4eb9ae,_0x5eaac4){_0x4eb9ae=_0x4eb9ae-0x0;var _0x54c234=_0x6f26[_0x4eb9ae];return _0x54c234;};'use strict';var _=require(_0x66f2('0x0'));var util=require(_0x66f2('0x1'));var moment=require(_0x66f2('0x2'));var BPromise=require(_0x66f2('0x3'));var rs=require(_0x66f2('0x4'));var fs=require('fs');var Redis=require(_0x66f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x66f2('0x6'));var logger=require(_0x66f2('0x7'))(_0x66f2('0x8'));var config=require(_0x66f2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36d5e7,_0x3821e4,_0x1ab747){return new BPromise(function(_0xf5b9b9,_0x273443){return client[_0x66f2('0xa')](_0x36d5e7,_0x1ab747)[_0x66f2('0xb')](function(_0x1d3a7f){logger['info'](_0x66f2('0xc'),_0x3821e4,_0x66f2('0xd'));logger[_0x66f2('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3821e4,_0x66f2('0xd'),JSON[_0x66f2('0xf')](_0x1d3a7f));if(_0x1d3a7f['error']){if(_0x1d3a7f[_0x66f2('0x10')][_0x66f2('0x11')]===0x1f4){logger[_0x66f2('0x10')](_0x66f2('0xc'),_0x3821e4,_0x1d3a7f[_0x66f2('0x10')][_0x66f2('0x12')]);return _0x273443(_0x1d3a7f[_0x66f2('0x10')]['message']);}logger[_0x66f2('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3821e4,_0x1d3a7f[_0x66f2('0x10')]['message']);return _0xf5b9b9(_0x1d3a7f[_0x66f2('0x10')][_0x66f2('0x12')]);}else{logger[_0x66f2('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x3821e4,_0x66f2('0xd'));_0xf5b9b9(_0x1d3a7f[_0x66f2('0x14')]['message']);}})[_0x66f2('0x15')](function(_0x6082bb){logger['error'](_0x66f2('0xc'),_0x3821e4,_0x6082bb);_0x273443(_0x6082bb);});});}exports[_0x66f2('0x16')]=function(_0x573bcb){var _0x40d61b=this;return new Promise(function(_0x4bb8c9,_0x4872af){return db[_0x66f2('0x17')][_0x66f2('0x18')]({'raw':_0x573bcb['options']?_0x573bcb[_0x66f2('0x19')][_0x66f2('0x1a')]===undefined?!![]:![]:!![],'where':_0x573bcb['options']?_0x573bcb['options']['where']||null:null,'attributes':_0x573bcb[_0x66f2('0x19')]?_0x573bcb[_0x66f2('0x19')][_0x66f2('0x1b')]||null:null,'include':_0x573bcb[_0x66f2('0x19')]?_0x573bcb[_0x66f2('0x19')]['include']?_['map'](_0x573bcb[_0x66f2('0x19')][_0x66f2('0x1c')],function(_0x485095){return{'model':db[_0x485095[_0x66f2('0x1d')]],'as':_0x485095['as'],'attributes':_0x485095['attributes'],'include':_0x485095['include']?_[_0x66f2('0x1e')](_0x485095[_0x66f2('0x1c')],function(_0x3bfa39){return{'model':db[_0x3bfa39[_0x66f2('0x1d')]],'as':_0x3bfa39['as'],'attributes':_0x3bfa39[_0x66f2('0x1b')],'include':_0x3bfa39[_0x66f2('0x1c')]?_[_0x66f2('0x1e')](_0x3bfa39[_0x66f2('0x1c')],function(_0x572750){return{'model':db[_0x572750[_0x66f2('0x1d')]],'as':_0x572750['as'],'attributes':_0x572750[_0x66f2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x66f2('0xb')](function(_0x39f5a3){logger[_0x66f2('0x13')](_0x66f2('0x16'),_0x573bcb);logger[_0x66f2('0xe')](_0x66f2('0x16'),_0x573bcb,JSON[_0x66f2('0xf')](_0x39f5a3));_0x4bb8c9(_0x39f5a3);})['catch'](function(_0x480270){logger[_0x66f2('0x10')]('ShowSquareOdbc',_0x480270[_0x66f2('0x12')],_0x573bcb);_0x4872af(_0x40d61b['error'](0x1f4,_0x480270['message']));});});}; \ No newline at end of file +var _0x13af=['error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','options','attributes','include','map','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2217bb,_0x3f7754){var _0x3130af=function(_0x5bb970){while(--_0x5bb970){_0x2217bb['push'](_0x2217bb['shift']());}};_0x3130af(++_0x3f7754);}(_0x13af,0xc1));var _0xf13a=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x13af[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xf13a('0x0'));var util=require('util');var moment=require(_0xf13a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf13a('0x2'));var fs=require('fs');var Redis=require(_0xf13a('0x3'));var db=require(_0xf13a('0x4'))['db'];var utils=require(_0xf13a('0x5'));var logger=require(_0xf13a('0x6'))(_0xf13a('0x7'));var config=require('../../config/environment');var jayson=require(_0xf13a('0x8'));var client=jayson['client'][_0xf13a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x244383,_0x42bb1f,_0x3d409c){return new BPromise(function(_0x40567b,_0x4d66c0){return client[_0xf13a('0xa')](_0x244383,_0x3d409c)[_0xf13a('0xb')](function(_0x227703){logger['info'](_0xf13a('0xc'),_0x42bb1f,_0xf13a('0xd'));logger[_0xf13a('0xe')](_0xf13a('0xf'),_0x42bb1f,_0xf13a('0xd'),JSON[_0xf13a('0x10')](_0x227703));if(_0x227703[_0xf13a('0x11')]){if(_0x227703[_0xf13a('0x11')][_0xf13a('0x12')]===0x1f4){logger[_0xf13a('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x42bb1f,_0x227703[_0xf13a('0x11')]['message']);return _0x4d66c0(_0x227703[_0xf13a('0x11')]['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x42bb1f,_0x227703[_0xf13a('0x11')][_0xf13a('0x13')]);return _0x40567b(_0x227703[_0xf13a('0x11')][_0xf13a('0x13')]);}else{logger[_0xf13a('0x14')](_0xf13a('0xc'),_0x42bb1f,_0xf13a('0xd'));_0x40567b(_0x227703[_0xf13a('0x15')][_0xf13a('0x13')]);}})[_0xf13a('0x16')](function(_0x1598ec){logger[_0xf13a('0x11')](_0xf13a('0xc'),_0x42bb1f,_0x1598ec);_0x4d66c0(_0x1598ec);});});}exports[_0xf13a('0x17')]=function(_0x319457){var _0x397041=this;return new Promise(function(_0x1dd89d,_0xfa1f0d){return db[_0xf13a('0x18')]['find']({'raw':_0x319457[_0xf13a('0x19')]?_0x319457[_0xf13a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x319457[_0xf13a('0x19')]?_0x319457[_0xf13a('0x19')]['where']||null:null,'attributes':_0x319457[_0xf13a('0x19')]?_0x319457[_0xf13a('0x19')][_0xf13a('0x1a')]||null:null,'include':_0x319457[_0xf13a('0x19')]?_0x319457[_0xf13a('0x19')][_0xf13a('0x1b')]?_[_0xf13a('0x1c')](_0x319457['options'][_0xf13a('0x1b')],function(_0x3b61bb){return{'model':db[_0x3b61bb[_0xf13a('0x1d')]],'as':_0x3b61bb['as'],'attributes':_0x3b61bb[_0xf13a('0x1a')],'include':_0x3b61bb['include']?_[_0xf13a('0x1c')](_0x3b61bb[_0xf13a('0x1b')],function(_0x2a99f2){return{'model':db[_0x2a99f2['model']],'as':_0x2a99f2['as'],'attributes':_0x2a99f2[_0xf13a('0x1a')],'include':_0x2a99f2[_0xf13a('0x1b')]?_['map'](_0x2a99f2[_0xf13a('0x1b')],function(_0x3b3541){return{'model':db[_0x3b3541[_0xf13a('0x1d')]],'as':_0x3b3541['as'],'attributes':_0x3b3541[_0xf13a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf13a('0xb')](function(_0x3bf090){logger[_0xf13a('0x14')](_0xf13a('0x17'),_0x319457);logger[_0xf13a('0xe')](_0xf13a('0x17'),_0x319457,JSON[_0xf13a('0x10')](_0x3bf090));_0x1dd89d(_0x3bf090);})[_0xf13a('0x16')](function(_0x1143c4){logger[_0xf13a('0x11')](_0xf13a('0x17'),_0x1143c4[_0xf13a('0x13')],_0x319457);_0xfa1f0d(_0x397041[_0xf13a('0x11')](0x1f4,_0x1143c4[_0xf13a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 82f7f27..65d4a82 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 _0x1d9f=['/:id/users','addUsers','put','update','delete','removeUsers','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','getUsers','create','post'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x1d9f,0x141));var _0xf1d9=function(_0x2ea59c,_0xc3b86){_0x2ea59c=_0x2ea59c-0x0;var _0x42cbe2=_0x1d9f[_0x2ea59c];return _0x42cbe2;};'use strict';var multer=require(_0xf1d9('0x0'));var util=require(_0xf1d9('0x1'));var path=require(_0xf1d9('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1d9('0x3'));var router=express[_0xf1d9('0x4')]();var auth=require(_0xf1d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1d9('0x6'));var controller=require(_0xf1d9('0x7'));router[_0xf1d9('0x8')]('/',auth[_0xf1d9('0x9')](),controller['index']);router[_0xf1d9('0x8')](_0xf1d9('0xa'),auth[_0xf1d9('0x9')](),controller[_0xf1d9('0xb')]);router['get']('/:id/users',auth[_0xf1d9('0x9')](),controller[_0xf1d9('0xc')]);router['post']('/',auth[_0xf1d9('0x9')](),controller[_0xf1d9('0xd')]);router[_0xf1d9('0xe')](_0xf1d9('0xf'),auth[_0xf1d9('0x9')](),controller[_0xf1d9('0x10')]);router[_0xf1d9('0x11')](_0xf1d9('0xa'),auth['isAuthenticated'](),controller[_0xf1d9('0x12')]);router[_0xf1d9('0x13')](_0xf1d9('0xa'),auth[_0xf1d9('0x9')](),controller['destroy']);router[_0xf1d9('0x13')](_0xf1d9('0xf'),auth[_0xf1d9('0x9')](),controller[_0xf1d9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x04d8=['../../config/environment','./squareProject.controller','get','index','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x237ce4,_0x14afbe){var _0x522799=function(_0x3d9916){while(--_0x3d9916){_0x237ce4['push'](_0x237ce4['shift']());}};_0x522799(++_0x14afbe);}(_0x04d8,0xbf));var _0x804d=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x04d8[_0x26f1b2];return _0x1624a4;};'use strict';var multer=require(_0x804d('0x0'));var util=require(_0x804d('0x1'));var path=require(_0x804d('0x2'));var timeout=require(_0x804d('0x3'));var express=require('express');var router=express[_0x804d('0x4')]();var auth=require(_0x804d('0x5'));var interaction=require(_0x804d('0x6'));var config=require(_0x804d('0x7'));var controller=require(_0x804d('0x8'));router[_0x804d('0x9')]('/',auth['isAuthenticated'](),controller[_0x804d('0xa')]);router['get'](_0x804d('0xb'),auth['isAuthenticated'](),controller[_0x804d('0xc')]);router[_0x804d('0x9')](_0x804d('0xd'),auth[_0x804d('0xe')](),controller[_0x804d('0xf')]);router[_0x804d('0x10')]('/',auth[_0x804d('0xe')](),controller[_0x804d('0x11')]);router[_0x804d('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router[_0x804d('0x12')](_0x804d('0xb'),auth[_0x804d('0xe')](),controller[_0x804d('0x13')]);router['delete']('/:id',auth[_0x804d('0xe')](),controller['destroy']);router[_0x804d('0x14')](_0x804d('0xd'),auth[_0x804d('0xe')](),controller['removeUsers']);module[_0x804d('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5baec86..e0f7a1b 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 _0x5d17=['BLOB','getDataValue','preproduction','utf8','long','production','sequelize','exports','STRING','TEXT'];(function(_0x501cdc,_0x856687){var _0x47f336=function(_0x5ce843){while(--_0x5ce843){_0x501cdc['push'](_0x501cdc['shift']());}};_0x47f336(++_0x856687);}(_0x5d17,0x114));var _0x75d1=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x5d17[_0x458363];return _0x4d0290;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x75d1('0x2')]},'notes':{'type':Sequelize[_0x75d1('0x3')]},'preproduction':{'type':Sequelize[_0x75d1('0x4')]('long'),'get':function(){if(this[_0x75d1('0x5')](_0x75d1('0x6'))){return this[_0x75d1('0x5')](_0x75d1('0x6'))['toString'](_0x75d1('0x7'));}}},'production':{'type':Sequelize[_0x75d1('0x4')](_0x75d1('0x8')),'get':function(){if(this[_0x75d1('0x5')](_0x75d1('0x9'))){return this[_0x75d1('0x5')](_0x75d1('0x9'))['toString']('utf8');}}}}; \ No newline at end of file +var _0x4cfd=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','sequelize','exports','name','STRING'];(function(_0xd204b0,_0x4c7d1d){var _0xfc8310=function(_0x4f4b5a){while(--_0x4f4b5a){_0xd204b0['push'](_0xd204b0['shift']());}};_0xfc8310(++_0x4c7d1d);}(_0x4cfd,0x170));var _0xd4cf=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x4cfd[_0x59befa];return _0x1dd63d;};'use strict';var Sequelize=require(_0xd4cf('0x0'));module[_0xd4cf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd4cf('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd4cf('0x3')]},'notes':{'type':Sequelize[_0xd4cf('0x4')]},'preproduction':{'type':Sequelize[_0xd4cf('0x5')](_0xd4cf('0x6')),'get':function(){if(this[_0xd4cf('0x7')]('preproduction')){return this[_0xd4cf('0x7')](_0xd4cf('0x8'))[_0xd4cf('0x9')](_0xd4cf('0xa'));}}},'production':{'type':Sequelize[_0xd4cf('0x5')](_0xd4cf('0x6')),'get':function(){if(this['getDataValue'](_0xd4cf('0xb'))){return this[_0xd4cf('0x7')](_0xd4cf('0xb'))[_0xd4cf('0x9')](_0xd4cf('0xa'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c8c1827..b4e78b6 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 _0x1ac4=['UserProfileSection','userProfileId','autoAssociation','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','nolimit','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','role','get','SquareProjects'];(function(_0x489543,_0x588996){var _0x18cf3b=function(_0x3be4aa){while(--_0x3be4aa){_0x489543['push'](_0x489543['shift']());}};_0x18cf3b(++_0x588996);}(_0x1ac4,0x18d));var _0x41ac=function(_0x3a88d1,_0x4cc6a0){_0x3a88d1=_0x3a88d1-0x0;var _0x5b43bf=_0x1ac4[_0x3a88d1];return _0x5b43bf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41ac('0x0'));var jsonpatch=require(_0x41ac('0x1'));var rp=require(_0x41ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x41ac('0x3'));var util=require(_0x41ac('0x4'));var path=require(_0x41ac('0x5'));var sox=require(_0x41ac('0x6'));var csv=require(_0x41ac('0x7'));var ejs=require(_0x41ac('0x8'));var fs=require('fs');var _=require(_0x41ac('0x9'));var squel=require(_0x41ac('0xa'));var crypto=require(_0x41ac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x41ac('0xc'));var toCsv=require(_0x41ac('0x7'));var querystring=require('querystring');var Papa=require(_0x41ac('0xd'));var Redis=require(_0x41ac('0xe'));var authService=require(_0x41ac('0xf'));var qs=require(_0x41ac('0x10'));var hardwareService=require(_0x41ac('0x11'));var logger=require(_0x41ac('0x12'))(_0x41ac('0x13'));var utils=require(_0x41ac('0x14'));var config=require(_0x41ac('0x15'));var db=require(_0x41ac('0x16'))['db'];config[_0x41ac('0x17')]=_[_0x41ac('0x18')](config[_0x41ac('0x17')],{'host':_0x41ac('0x19'),'port':0x18eb});var socket=require(_0x41ac('0x1a'))(new Redis(config['redis']));require(_0x41ac('0x1b'))[_0x41ac('0x1c')](socket);function respondWithStatusCode(_0xea202f,_0x5ac39f){_0x5ac39f=_0x5ac39f||0xcc;return function(_0x1030b6){if(_0x1030b6){return _0xea202f['sendStatus'](_0x5ac39f);}return _0xea202f['status'](_0x5ac39f)[_0x41ac('0x1d')]();};}function respondWithResult(_0x40d918,_0x104d37){_0x104d37=_0x104d37||0xc8;return function(_0x2f91b4){if(_0x2f91b4){return _0x40d918[_0x41ac('0x1e')](_0x104d37)[_0x41ac('0x1f')](_0x2f91b4);}};}function respondWithFilteredResult(_0x22120f,_0x235529){return function(_0x369ba2){if(_0x369ba2){var _0x367123=_0x369ba2[_0x41ac('0x20')],_0x17c71c=_0x235529[_0x41ac('0x21')],_0x3649f2=_0x235529[_0x41ac('0x21')]+_0x235529['limit'],_0x205f55;if(_0x3649f2>=_0x367123){_0x3649f2=_0x367123;_0x205f55=0xc8;}else{_0x205f55=0xce;}_0x22120f[_0x41ac('0x1e')](_0x205f55);return _0x22120f['set'](_0x41ac('0x22'),_0x17c71c+'-'+_0x3649f2+'/'+_0x367123)[_0x41ac('0x1f')](_0x369ba2);}return null;};}function patchUpdates(_0x5f49b8){return function(_0x185632){try{jsonpatch[_0x41ac('0x23')](_0x185632,_0x5f49b8,!![]);}catch(_0x4b4120){return BPromise[_0x41ac('0x24')](_0x4b4120);}return _0x185632['save']();};}function saveUpdates(_0x45cf91,_0xdd2743){return function(_0x159037){if(_0x159037){return _0x159037[_0x41ac('0x25')](_0x45cf91)[_0x41ac('0x26')](function(_0x12d123){return _0x12d123;});}return null;};}function removeEntity(_0x2ce41a,_0x5f3d7d){return function(_0x279675){if(_0x279675){return _0x279675[_0x41ac('0x27')]()[_0x41ac('0x26')](function(){var _0x1c53c8=_0x279675['get']({'plain':!![]});var _0x3b9cea='SquareProjects';return db[_0x41ac('0x28')][_0x41ac('0x27')]({'where':{'type':_0x3b9cea,'resourceId':_0x1c53c8['id']}})[_0x41ac('0x26')](function(){return _0x279675;});})[_0x41ac('0x26')](function(){_0x2ce41a[_0x41ac('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446098,_0x42e33a){return function(_0x4a60dc){if(!_0x4a60dc){_0x446098[_0x41ac('0x29')](0x194);}return _0x4a60dc;};}function handleError(_0x1ea6be,_0x1415e7){_0x1415e7=_0x1415e7||0x1f4;return function(_0x559765){logger[_0x41ac('0x2a')](_0x559765[_0x41ac('0x2b')]);if(_0x559765[_0x41ac('0x2c')]){delete _0x559765[_0x41ac('0x2c')];}_0x1ea6be[_0x41ac('0x1e')](_0x1415e7)[_0x41ac('0x2d')](_0x559765);};}exports[_0x41ac('0x2e')]=function(_0x58cbd6,_0x22beba){var _0x408f64={},_0x320cd3={},_0x28936e={'count':0x0,'rows':[]};var _0x4f141b=db[_0x41ac('0x2f')][_0x41ac('0x30')];_0x320cd3['model']=_[_0x41ac('0x31')](_0x4f141b);_0x320cd3[_0x41ac('0x32')]=_[_0x41ac('0x31')](_0x58cbd6['query']);_0x320cd3['filters']=_[_0x41ac('0x33')](_0x320cd3[_0x41ac('0x34')],_0x320cd3['query']);_0x408f64[_0x41ac('0x35')]=_['intersection'](_0x320cd3[_0x41ac('0x34')],qs[_0x41ac('0x36')](_0x58cbd6[_0x41ac('0x32')]['fields']));_0x408f64['attributes']=_0x408f64[_0x41ac('0x35')][_0x41ac('0x37')]?_0x408f64[_0x41ac('0x35')]:_0x320cd3[_0x41ac('0x34')];if(!_0x58cbd6['query'][_0x41ac('0x38')]('nolimit')){_0x408f64[_0x41ac('0x39')]=qs[_0x41ac('0x39')](_0x58cbd6[_0x41ac('0x32')][_0x41ac('0x39')]);_0x408f64[_0x41ac('0x21')]=qs[_0x41ac('0x21')](_0x58cbd6['query'][_0x41ac('0x21')]);}_0x408f64['order']=qs[_0x41ac('0x3a')](_0x58cbd6[_0x41ac('0x32')][_0x41ac('0x3a')]);_0x408f64[_0x41ac('0x3b')]=qs[_0x41ac('0x3c')](_[_0x41ac('0x3d')](_0x58cbd6[_0x41ac('0x32')],_0x320cd3[_0x41ac('0x3c')]));if(_0x58cbd6['query'][_0x41ac('0x3e')]){_0x408f64[_0x41ac('0x3b')]=_[_0x41ac('0x3f')](_0x408f64[_0x41ac('0x3b')],{'$or':_[_0x41ac('0x40')](_0x4f141b,function(_0x57282d){if(_0x57282d[_0x41ac('0x41')][_0x41ac('0x42')]!==_0x41ac('0x43')){var _0x4f0d11={};_0x4f0d11[_0x57282d[_0x41ac('0x44')]]={'$like':'%'+_0x58cbd6['query'][_0x41ac('0x3e')]+'%'};return _0x4f0d11;}})});}_0x408f64=_[_0x41ac('0x3f')]({},_0x408f64,_0x58cbd6[_0x41ac('0x45')]);var _0x22718b={'where':_0x408f64[_0x41ac('0x3b')]};return db[_0x41ac('0x2f')][_0x41ac('0x20')](_0x22718b)[_0x41ac('0x26')](function(_0x50ee7f){_0x28936e[_0x41ac('0x20')]=_0x50ee7f;if(_0x58cbd6[_0x41ac('0x32')][_0x41ac('0x46')]){_0x408f64['include']=[{'all':!![]}];}return db[_0x41ac('0x2f')][_0x41ac('0x47')](_0x408f64);})[_0x41ac('0x26')](function(_0x4368b9){_0x28936e[_0x41ac('0x48')]=_0x4368b9;return _0x28936e;})[_0x41ac('0x26')](respondWithFilteredResult(_0x22beba,_0x408f64))[_0x41ac('0x49')](handleError(_0x22beba,null));};exports[_0x41ac('0x4a')]=function(_0x5ce9c0,_0x345f66){var _0xdcdbf0={'raw':![],'where':{'id':_0x5ce9c0[_0x41ac('0x4b')]['id']}},_0x156442={};_0x156442['model']=_[_0x41ac('0x31')](db[_0x41ac('0x2f')]['rawAttributes']);_0x156442['query']=_['keys'](_0x5ce9c0[_0x41ac('0x32')]);_0x156442[_0x41ac('0x3c')]=_[_0x41ac('0x33')](_0x156442[_0x41ac('0x34')],_0x156442[_0x41ac('0x32')]);_0xdcdbf0[_0x41ac('0x35')]=_[_0x41ac('0x33')](_0x156442['model'],qs[_0x41ac('0x36')](_0x5ce9c0['query'][_0x41ac('0x36')]));_0xdcdbf0[_0x41ac('0x35')]=_0xdcdbf0['attributes'][_0x41ac('0x37')]?_0xdcdbf0[_0x41ac('0x35')]:_0x156442[_0x41ac('0x34')];if(_0x5ce9c0[_0x41ac('0x32')][_0x41ac('0x46')]){_0xdcdbf0['include']=[{'all':!![]}];}_0xdcdbf0=_[_0x41ac('0x3f')]({},_0xdcdbf0,_0x5ce9c0[_0x41ac('0x45')]);return db[_0x41ac('0x2f')][_0x41ac('0x4c')](_0xdcdbf0)[_0x41ac('0x26')](handleEntityNotFound(_0x345f66,null))[_0x41ac('0x26')](respondWithResult(_0x345f66,null))[_0x41ac('0x49')](handleError(_0x345f66,null));};exports[_0x41ac('0x4d')]=function(_0xa5410,_0x5d3374){return db['SquareProject'][_0x41ac('0x4d')](_0xa5410[_0x41ac('0x4e')],{})[_0x41ac('0x26')](function(_0x3ab51d){var _0xbea478=_0xa5410[_0x41ac('0x4f')]['get']({'plain':!![]});if(!_0xbea478)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbea478[_0x41ac('0x50')]===_0x41ac('0x4f')){var _0x2aa9d3=_0x3ab51d[_0x41ac('0x51')]({'plain':!![]});var _0x2655d1=_0x41ac('0x52');return db[_0x41ac('0x53')][_0x41ac('0x4c')]({'where':{'name':_0x2655d1,'userProfileId':_0xbea478[_0x41ac('0x54')]},'raw':!![]})[_0x41ac('0x26')](function(_0x23e272){if(_0x23e272&&_0x23e272[_0x41ac('0x55')]===0x0){return db[_0x41ac('0x28')][_0x41ac('0x4d')]({'name':_0x2aa9d3['name'],'resourceId':_0x2aa9d3['id'],'type':_0x23e272[_0x41ac('0x2c')],'sectionId':_0x23e272['id']},{})[_0x41ac('0x26')](function(){return _0x3ab51d;});}else{return _0x3ab51d;}})[_0x41ac('0x49')](function(_0x18202d){logger[_0x41ac('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18202d);throw _0x18202d;});}return _0x3ab51d;})[_0x41ac('0x26')](respondWithResult(_0x5d3374,0xc9))[_0x41ac('0x49')](handleError(_0x5d3374,null));};exports[_0x41ac('0x25')]=function(_0x1588db,_0x50fd07){if(_0x1588db[_0x41ac('0x4e')]['id']){delete _0x1588db[_0x41ac('0x4e')]['id'];}return db[_0x41ac('0x2f')]['find']({'where':{'id':_0x1588db[_0x41ac('0x4b')]['id']}})[_0x41ac('0x26')](handleEntityNotFound(_0x50fd07,null))['then'](saveUpdates(_0x1588db[_0x41ac('0x4e')],null))[_0x41ac('0x26')](respondWithResult(_0x50fd07,null))[_0x41ac('0x49')](handleError(_0x50fd07,null));};exports[_0x41ac('0x27')]=function(_0x2456f0,_0x280e3f){return db[_0x41ac('0x2f')][_0x41ac('0x4c')]({'where':{'id':_0x2456f0[_0x41ac('0x4b')]['id']}})[_0x41ac('0x26')](handleEntityNotFound(_0x280e3f,null))[_0x41ac('0x26')](removeEntity(_0x280e3f,null))['catch'](handleError(_0x280e3f,null));};exports[_0x41ac('0x56')]=function(_0x36139e,_0x33b44d,_0x41656c){return db[_0x41ac('0x2f')]['find']({'where':{'id':_0x36139e[_0x41ac('0x4b')]['id']}})[_0x41ac('0x26')](handleEntityNotFound(_0x33b44d,null))[_0x41ac('0x26')](function(_0x57f0e5){if(_0x57f0e5){return _0x57f0e5['addUsers'](_0x36139e[_0x41ac('0x4e')]['ids'],_[_0x41ac('0x57')](_0x36139e[_0x41ac('0x4e')],[_0x41ac('0x58'),'id'])||{});}})['then'](respondWithResult(_0x33b44d,null))['catch'](handleError(_0x33b44d,null));};exports[_0x41ac('0x59')]=function(_0x1dcab7,_0x5ba631,_0x10cc0b){return db['SquareProject']['find']({'where':{'id':_0x1dcab7[_0x41ac('0x4b')]['id']}})[_0x41ac('0x26')](handleEntityNotFound(_0x5ba631,null))[_0x41ac('0x26')](function(_0x2f2586){if(_0x2f2586){return _0x2f2586[_0x41ac('0x59')](_0x1dcab7[_0x41ac('0x32')][_0x41ac('0x58')])[_0x41ac('0x26')](function(){if(_[_0x41ac('0x5a')](_0x1dcab7[_0x41ac('0x32')][_0x41ac('0x58')])){for(var _0x55122d=0x0;_0x55122d<_0x1dcab7[_0x41ac('0x32')][_0x41ac('0x58')][_0x41ac('0x37')];_0x55122d+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x1dcab7[_0x41ac('0x32')][_0x41ac('0x58')][_0x55122d]),'SquareProjectId':Number(_0x1dcab7[_0x41ac('0x4b')]['id'])});}}else{socket[_0x41ac('0x5b')](_0x41ac('0x5c'),{'UserId':Number(_0x1dcab7[_0x41ac('0x32')]['ids']),'SquareProjectId':Number(_0x1dcab7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ba631,null))[_0x41ac('0x49')](handleError(_0x5ba631,null));};exports[_0x41ac('0x5d')]=function(_0x9c6fad,_0x53bc11,_0x1c5388){var _0x978dc8={};var _0x4eb55a={};var _0x41b761;var _0x21b0d2;return db[_0x41ac('0x2f')]['findOne']({'where':{'id':_0x9c6fad[_0x41ac('0x4b')]['id']}})[_0x41ac('0x26')](handleEntityNotFound(_0x53bc11,null))[_0x41ac('0x26')](function(_0x4b3a77){if(_0x4b3a77){_0x41b761=_0x4b3a77;_0x4eb55a['model']=_[_0x41ac('0x31')](db[_0x41ac('0x5e')][_0x41ac('0x30')]);_0x4eb55a[_0x41ac('0x32')]=_['keys'](_0x9c6fad[_0x41ac('0x32')]);_0x4eb55a['filters']=_[_0x41ac('0x33')](_0x4eb55a[_0x41ac('0x34')],_0x4eb55a['query']);_0x978dc8['attributes']=_['intersection'](_0x4eb55a['model'],qs[_0x41ac('0x36')](_0x9c6fad[_0x41ac('0x32')][_0x41ac('0x36')]));_0x978dc8['attributes']=_0x978dc8[_0x41ac('0x35')]['length']?_0x978dc8[_0x41ac('0x35')]:_0x4eb55a[_0x41ac('0x34')];_0x978dc8['order']=qs[_0x41ac('0x3a')](_0x9c6fad[_0x41ac('0x32')][_0x41ac('0x3a')]);_0x978dc8[_0x41ac('0x3b')]=qs['filters'](_[_0x41ac('0x3d')](_0x9c6fad[_0x41ac('0x32')],_0x4eb55a[_0x41ac('0x3c')]));if(_0x9c6fad[_0x41ac('0x32')][_0x41ac('0x3e')]){_0x978dc8[_0x41ac('0x3b')]=_[_0x41ac('0x3f')](_0x978dc8['where'],{'$or':_[_0x41ac('0x40')](_0x978dc8[_0x41ac('0x35')],function(_0x4290fa){var _0x38dbe9={};_0x38dbe9[_0x4290fa]={'$like':'%'+_0x9c6fad['query'][_0x41ac('0x3e')]+'%'};return _0x38dbe9;})});}_0x978dc8=_[_0x41ac('0x3f')]({},_0x978dc8,_0x9c6fad['options']);return _0x41b761[_0x41ac('0x5d')](_0x978dc8);}})[_0x41ac('0x26')](function(_0x50a7a1){if(_0x50a7a1){_0x21b0d2=_0x50a7a1[_0x41ac('0x37')];if(!_0x9c6fad[_0x41ac('0x32')][_0x41ac('0x38')](_0x41ac('0x5f'))){_0x978dc8[_0x41ac('0x39')]=qs[_0x41ac('0x39')](_0x9c6fad[_0x41ac('0x32')]['limit']);_0x978dc8[_0x41ac('0x21')]=qs[_0x41ac('0x21')](_0x9c6fad[_0x41ac('0x32')]['offset']);}return _0x41b761[_0x41ac('0x5d')](_0x978dc8);}})['then'](function(_0x17bc7d){if(_0x17bc7d){return _0x17bc7d?{'count':_0x21b0d2,'rows':_0x17bc7d}:null;}})['then'](respondWithResult(_0x53bc11,null))[_0x41ac('0x49')](handleError(_0x53bc11,null));}; \ No newline at end of file +var _0xe107=['type','key','VIRTUAL','field','includeAll','include','findAll','catch','params','rawAttributes','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','order','pick','options','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','api','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','SquareProjects','UserProfileResource','destroy','end','error','name','send','SquareProject','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','filter','merge','map'];(function(_0x4f22a9,_0x22a80a){var _0x1a4ed0=function(_0x4931b4){while(--_0x4931b4){_0x4f22a9['push'](_0x4f22a9['shift']());}};_0x1a4ed0(++_0x22a80a);}(_0xe107,0x1d7));var _0x7e10=function(_0x58e1f5,_0xa8dd1d){_0x58e1f5=_0x58e1f5-0x0;var _0x409c9d=_0xe107[_0x58e1f5];return _0x409c9d;};'use strict';var pdf=require(_0x7e10('0x0'));var emlformat=require(_0x7e10('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e10('0x2'));var rp=require(_0x7e10('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e10('0x4'));var util=require(_0x7e10('0x5'));var path=require(_0x7e10('0x6'));var sox=require(_0x7e10('0x7'));var csv=require(_0x7e10('0x8'));var ejs=require(_0x7e10('0x9'));var fs=require('fs');var _=require(_0x7e10('0xa'));var squel=require(_0x7e10('0xb'));var crypto=require(_0x7e10('0xc'));var jsforce=require(_0x7e10('0xd'));var deskjs=require(_0x7e10('0xe'));var toCsv=require(_0x7e10('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e10('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e10('0x10'))(_0x7e10('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7e10('0x12')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e10('0x13'))(new Redis(config[_0x7e10('0x12')]));require(_0x7e10('0x14'))[_0x7e10('0x15')](socket);function respondWithStatusCode(_0x57cdf1,_0x5d404b){_0x5d404b=_0x5d404b||0xcc;return function(_0x534f4a){if(_0x534f4a){return _0x57cdf1[_0x7e10('0x16')](_0x5d404b);}return _0x57cdf1[_0x7e10('0x17')](_0x5d404b)['end']();};}function respondWithResult(_0x17ad04,_0x497e97){_0x497e97=_0x497e97||0xc8;return function(_0x38723f){if(_0x38723f){return _0x17ad04[_0x7e10('0x17')](_0x497e97)['json'](_0x38723f);}};}function respondWithFilteredResult(_0x3c387d,_0x3995ff){return function(_0x3a4408){if(_0x3a4408){var _0x5d3bc2=_0x3a4408[_0x7e10('0x18')],_0x3137b0=_0x3995ff['offset'],_0x4a728d=_0x3995ff[_0x7e10('0x19')]+_0x3995ff[_0x7e10('0x1a')],_0x1185b0;if(_0x4a728d>=_0x5d3bc2){_0x4a728d=_0x5d3bc2;_0x1185b0=0xc8;}else{_0x1185b0=0xce;}_0x3c387d[_0x7e10('0x17')](_0x1185b0);return _0x3c387d[_0x7e10('0x1b')](_0x7e10('0x1c'),_0x3137b0+'-'+_0x4a728d+'/'+_0x5d3bc2)[_0x7e10('0x1d')](_0x3a4408);}return null;};}function patchUpdates(_0x4f95b7){return function(_0x12c3a1){try{jsonpatch[_0x7e10('0x1e')](_0x12c3a1,_0x4f95b7,!![]);}catch(_0x230e16){return BPromise[_0x7e10('0x1f')](_0x230e16);}return _0x12c3a1[_0x7e10('0x20')]();};}function saveUpdates(_0x4a0f25,_0x5a40e7){return function(_0x114fb1){if(_0x114fb1){return _0x114fb1[_0x7e10('0x21')](_0x4a0f25)['then'](function(_0x177cc3){return _0x177cc3;});}return null;};}function removeEntity(_0x22be6e,_0x438016){return function(_0x18c5f7){if(_0x18c5f7){return _0x18c5f7['destroy']()[_0x7e10('0x22')](function(){var _0x2c6cdc=_0x18c5f7['get']({'plain':!![]});var _0x53571e=_0x7e10('0x23');return db[_0x7e10('0x24')][_0x7e10('0x25')]({'where':{'type':_0x53571e,'resourceId':_0x2c6cdc['id']}})[_0x7e10('0x22')](function(){return _0x18c5f7;});})['then'](function(){_0x22be6e[_0x7e10('0x17')](0xcc)[_0x7e10('0x26')]();});}};}function handleEntityNotFound(_0x1f74a1,_0x4d704a){return function(_0x4953a5){if(!_0x4953a5){_0x1f74a1[_0x7e10('0x16')](0x194);}return _0x4953a5;};}function handleError(_0x11c495,_0x1a5beb){_0x1a5beb=_0x1a5beb||0x1f4;return function(_0x55a577){logger[_0x7e10('0x27')](_0x55a577['stack']);if(_0x55a577[_0x7e10('0x28')]){delete _0x55a577[_0x7e10('0x28')];}_0x11c495[_0x7e10('0x17')](_0x1a5beb)[_0x7e10('0x29')](_0x55a577);};}exports['index']=function(_0x1ddc63,_0x97b228){var _0xc59ed={},_0x31b71b={},_0x38a8e1={'count':0x0,'rows':[]};var _0x2419f4=db[_0x7e10('0x2a')]['rawAttributes'];_0x31b71b['model']=_[_0x7e10('0x2b')](_0x2419f4);_0x31b71b[_0x7e10('0x2c')]=_[_0x7e10('0x2b')](_0x1ddc63['query']);_0x31b71b[_0x7e10('0x2d')]=_[_0x7e10('0x2e')](_0x31b71b['model'],_0x31b71b[_0x7e10('0x2c')]);_0xc59ed[_0x7e10('0x2f')]=_[_0x7e10('0x2e')](_0x31b71b[_0x7e10('0x30')],qs[_0x7e10('0x31')](_0x1ddc63['query'][_0x7e10('0x31')]));_0xc59ed[_0x7e10('0x2f')]=_0xc59ed[_0x7e10('0x2f')][_0x7e10('0x32')]?_0xc59ed[_0x7e10('0x2f')]:_0x31b71b[_0x7e10('0x30')];if(!_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x33')]('nolimit')){_0xc59ed[_0x7e10('0x1a')]=qs[_0x7e10('0x1a')](_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x1a')]);_0xc59ed[_0x7e10('0x19')]=qs[_0x7e10('0x19')](_0x1ddc63[_0x7e10('0x2c')]['offset']);}_0xc59ed['order']=qs[_0x7e10('0x34')](_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x34')]);_0xc59ed[_0x7e10('0x35')]=qs['filters'](_['pick'](_0x1ddc63['query'],_0x31b71b['filters']));if(_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x36')]){_0xc59ed['where']=_[_0x7e10('0x37')](_0xc59ed[_0x7e10('0x35')],{'$or':_[_0x7e10('0x38')](_0x2419f4,function(_0x1b7993){if(_0x1b7993[_0x7e10('0x39')][_0x7e10('0x3a')]!==_0x7e10('0x3b')){var _0x1500f4={};_0x1500f4[_0x1b7993[_0x7e10('0x3c')]]={'$like':'%'+_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x36')]+'%'};return _0x1500f4;}})});}_0xc59ed=_[_0x7e10('0x37')]({},_0xc59ed,_0x1ddc63['options']);var _0x1d334d={'where':_0xc59ed['where']};return db[_0x7e10('0x2a')][_0x7e10('0x18')](_0x1d334d)[_0x7e10('0x22')](function(_0x33bbe1){_0x38a8e1[_0x7e10('0x18')]=_0x33bbe1;if(_0x1ddc63[_0x7e10('0x2c')][_0x7e10('0x3d')]){_0xc59ed[_0x7e10('0x3e')]=[{'all':!![]}];}return db['SquareProject'][_0x7e10('0x3f')](_0xc59ed);})[_0x7e10('0x22')](function(_0x36bd03){_0x38a8e1['rows']=_0x36bd03;return _0x38a8e1;})[_0x7e10('0x22')](respondWithFilteredResult(_0x97b228,_0xc59ed))[_0x7e10('0x40')](handleError(_0x97b228,null));};exports['show']=function(_0x132883,_0x5a8de8){var _0x54d606={'raw':![],'where':{'id':_0x132883[_0x7e10('0x41')]['id']}},_0x6f292b={};_0x6f292b[_0x7e10('0x30')]=_[_0x7e10('0x2b')](db['SquareProject'][_0x7e10('0x42')]);_0x6f292b[_0x7e10('0x2c')]=_[_0x7e10('0x2b')](_0x132883[_0x7e10('0x2c')]);_0x6f292b[_0x7e10('0x2d')]=_['intersection'](_0x6f292b['model'],_0x6f292b[_0x7e10('0x2c')]);_0x54d606[_0x7e10('0x2f')]=_[_0x7e10('0x2e')](_0x6f292b[_0x7e10('0x30')],qs[_0x7e10('0x31')](_0x132883[_0x7e10('0x2c')]['fields']));_0x54d606[_0x7e10('0x2f')]=_0x54d606[_0x7e10('0x2f')][_0x7e10('0x32')]?_0x54d606[_0x7e10('0x2f')]:_0x6f292b['model'];if(_0x132883[_0x7e10('0x2c')]['includeAll']){_0x54d606[_0x7e10('0x3e')]=[{'all':!![]}];}_0x54d606=_[_0x7e10('0x37')]({},_0x54d606,_0x132883['options']);return db[_0x7e10('0x2a')][_0x7e10('0x43')](_0x54d606)[_0x7e10('0x22')](handleEntityNotFound(_0x5a8de8,null))[_0x7e10('0x22')](respondWithResult(_0x5a8de8,null))['catch'](handleError(_0x5a8de8,null));};exports['create']=function(_0x299951,_0x11f9d5){return db[_0x7e10('0x2a')]['create'](_0x299951[_0x7e10('0x44')],{})[_0x7e10('0x22')](function(_0x44cc18){var _0x4f1a6c=_0x299951[_0x7e10('0x45')][_0x7e10('0x46')]({'plain':!![]});if(!_0x4f1a6c)throw new Error(_0x7e10('0x47'));if(_0x4f1a6c[_0x7e10('0x48')]==='user'){var _0x22998d=_0x44cc18[_0x7e10('0x46')]({'plain':!![]});var _0x5e4596=_0x7e10('0x23');return db[_0x7e10('0x49')][_0x7e10('0x43')]({'where':{'name':_0x5e4596,'userProfileId':_0x4f1a6c[_0x7e10('0x4a')]},'raw':!![]})[_0x7e10('0x22')](function(_0x403675){if(_0x403675&&_0x403675[_0x7e10('0x4b')]===0x0){return db[_0x7e10('0x24')]['create']({'name':_0x22998d['name'],'resourceId':_0x22998d['id'],'type':_0x403675[_0x7e10('0x28')],'sectionId':_0x403675['id']},{})['then'](function(){return _0x44cc18;});}else{return _0x44cc18;}})['catch'](function(_0x55ff67){logger[_0x7e10('0x27')](_0x7e10('0x4c'),_0x55ff67);throw _0x55ff67;});}return _0x44cc18;})['then'](respondWithResult(_0x11f9d5,0xc9))[_0x7e10('0x40')](handleError(_0x11f9d5,null));};exports[_0x7e10('0x21')]=function(_0x5a9f29,_0x91295c){if(_0x5a9f29[_0x7e10('0x44')]['id']){delete _0x5a9f29[_0x7e10('0x44')]['id'];}return db[_0x7e10('0x2a')]['find']({'where':{'id':_0x5a9f29[_0x7e10('0x41')]['id']}})[_0x7e10('0x22')](handleEntityNotFound(_0x91295c,null))[_0x7e10('0x22')](saveUpdates(_0x5a9f29['body'],null))[_0x7e10('0x22')](respondWithResult(_0x91295c,null))[_0x7e10('0x40')](handleError(_0x91295c,null));};exports[_0x7e10('0x25')]=function(_0x48f529,_0x4f1164){return db[_0x7e10('0x2a')][_0x7e10('0x43')]({'where':{'id':_0x48f529[_0x7e10('0x41')]['id']}})[_0x7e10('0x22')](handleEntityNotFound(_0x4f1164,null))['then'](removeEntity(_0x4f1164,null))['catch'](handleError(_0x4f1164,null));};exports[_0x7e10('0x4d')]=function(_0x28cb65,_0x644e0e,_0x82c6ae){return db[_0x7e10('0x2a')][_0x7e10('0x43')]({'where':{'id':_0x28cb65[_0x7e10('0x41')]['id']}})[_0x7e10('0x22')](handleEntityNotFound(_0x644e0e,null))['then'](function(_0x140414){if(_0x140414){return _0x140414[_0x7e10('0x4d')](_0x28cb65['body'][_0x7e10('0x4e')],_[_0x7e10('0x4f')](_0x28cb65['body'],[_0x7e10('0x4e'),'id'])||{});}})[_0x7e10('0x22')](respondWithResult(_0x644e0e,null))[_0x7e10('0x40')](handleError(_0x644e0e,null));};exports[_0x7e10('0x50')]=function(_0x48d341,_0x4695f4,_0x43494e){return db[_0x7e10('0x2a')][_0x7e10('0x43')]({'where':{'id':_0x48d341['params']['id']}})[_0x7e10('0x22')](handleEntityNotFound(_0x4695f4,null))[_0x7e10('0x22')](function(_0x445c0b){if(_0x445c0b){return _0x445c0b['removeUsers'](_0x48d341['query'][_0x7e10('0x4e')])[_0x7e10('0x22')](function(){if(_[_0x7e10('0x51')](_0x48d341[_0x7e10('0x2c')]['ids'])){for(var _0x22e1e2=0x0;_0x22e1e2<_0x48d341[_0x7e10('0x2c')][_0x7e10('0x4e')][_0x7e10('0x32')];_0x22e1e2+=0x1){socket[_0x7e10('0x52')](_0x7e10('0x53'),{'UserId':Number(_0x48d341[_0x7e10('0x2c')]['ids'][_0x22e1e2]),'SquareProjectId':Number(_0x48d341[_0x7e10('0x41')]['id'])});}}else{socket[_0x7e10('0x52')](_0x7e10('0x53'),{'UserId':Number(_0x48d341[_0x7e10('0x2c')]['ids']),'SquareProjectId':Number(_0x48d341[_0x7e10('0x41')]['id'])});}});}})[_0x7e10('0x22')](respondWithStatusCode(_0x4695f4,null))[_0x7e10('0x40')](handleError(_0x4695f4,null));};exports[_0x7e10('0x54')]=function(_0x53f4da,_0x493e48,_0x12ed8a){var _0x47af61={};var _0xcdbf4f={};var _0x7e26a9;var _0x33dfd3;return db[_0x7e10('0x2a')]['findOne']({'where':{'id':_0x53f4da['params']['id']}})[_0x7e10('0x22')](handleEntityNotFound(_0x493e48,null))['then'](function(_0x2fc3dd){if(_0x2fc3dd){_0x7e26a9=_0x2fc3dd;_0xcdbf4f[_0x7e10('0x30')]=_[_0x7e10('0x2b')](db['User'][_0x7e10('0x42')]);_0xcdbf4f['query']=_[_0x7e10('0x2b')](_0x53f4da[_0x7e10('0x2c')]);_0xcdbf4f[_0x7e10('0x2d')]=_[_0x7e10('0x2e')](_0xcdbf4f[_0x7e10('0x30')],_0xcdbf4f[_0x7e10('0x2c')]);_0x47af61[_0x7e10('0x2f')]=_[_0x7e10('0x2e')](_0xcdbf4f[_0x7e10('0x30')],qs[_0x7e10('0x31')](_0x53f4da[_0x7e10('0x2c')][_0x7e10('0x31')]));_0x47af61[_0x7e10('0x2f')]=_0x47af61[_0x7e10('0x2f')][_0x7e10('0x32')]?_0x47af61[_0x7e10('0x2f')]:_0xcdbf4f[_0x7e10('0x30')];_0x47af61[_0x7e10('0x55')]=qs[_0x7e10('0x34')](_0x53f4da['query'][_0x7e10('0x34')]);_0x47af61['where']=qs[_0x7e10('0x2d')](_[_0x7e10('0x56')](_0x53f4da[_0x7e10('0x2c')],_0xcdbf4f['filters']));if(_0x53f4da[_0x7e10('0x2c')][_0x7e10('0x36')]){_0x47af61[_0x7e10('0x35')]=_[_0x7e10('0x37')](_0x47af61['where'],{'$or':_[_0x7e10('0x38')](_0x47af61[_0x7e10('0x2f')],function(_0x360c38){var _0x3d3cde={};_0x3d3cde[_0x360c38]={'$like':'%'+_0x53f4da['query'][_0x7e10('0x36')]+'%'};return _0x3d3cde;})});}_0x47af61=_[_0x7e10('0x37')]({},_0x47af61,_0x53f4da[_0x7e10('0x57')]);return _0x7e26a9[_0x7e10('0x54')](_0x47af61);}})[_0x7e10('0x22')](function(_0x38a817){if(_0x38a817){_0x33dfd3=_0x38a817[_0x7e10('0x32')];if(!_0x53f4da['query'][_0x7e10('0x33')]('nolimit')){_0x47af61['limit']=qs['limit'](_0x53f4da[_0x7e10('0x2c')][_0x7e10('0x1a')]);_0x47af61['offset']=qs[_0x7e10('0x19')](_0x53f4da[_0x7e10('0x2c')][_0x7e10('0x19')]);}return _0x7e26a9[_0x7e10('0x54')](_0x47af61);}})[_0x7e10('0x22')](function(_0x34bb93){if(_0x34bb93){return _0x34bb93?{'count':_0x33dfd3,'rows':_0x34bb93}:null;}})['then'](respondWithResult(_0x493e48,null))[_0x7e10('0x40')](handleError(_0x493e48,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 83fec0a..0203f24 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 _0x3bca=['SquareProject','save','remove','emit','hook','events','../../mysqldb'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x3bca,0x132));var _0xa3bc=function(_0x842fa1,_0x18fd82){_0x842fa1=_0x842fa1-0x0;var _0x446b6d=_0x3bca[_0x842fa1];return _0x446b6d;};'use strict';var EventEmitter=require(_0xa3bc('0x0'));var SquareProject=require(_0xa3bc('0x1'))['db'][_0xa3bc('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa3bc('0x3'),'afterUpdate':'update','afterDestroy':_0xa3bc('0x4')};function emitEvent(_0x36a083){return function(_0x4164b0,_0x453d77,_0x264db3){SquareProjectEvents['emit'](_0x36a083+':'+_0x4164b0['id'],_0x4164b0);SquareProjectEvents[_0xa3bc('0x5')](_0x36a083,_0x4164b0);_0x264db3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa3bc('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x48ef=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x48ef,0x9d));var _0xf48e=function(_0x2aae31,_0x1014a2){_0x2aae31=_0x2aae31-0x0;var _0x379006=_0x48ef[_0x2aae31];return _0x379006;};'use strict';var EventEmitter=require(_0xf48e('0x0'));var SquareProject=require(_0xf48e('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf48e('0x2')](0x0);var events={'afterCreate':_0xf48e('0x3'),'afterUpdate':'update','afterDestroy':_0xf48e('0x4')};function emitEvent(_0x141e2a){return function(_0x25011e,_0x1784a4,_0x51ae7c){SquareProjectEvents[_0xf48e('0x5')](_0x141e2a+':'+_0x25011e['id'],_0x25011e);SquareProjectEvents[_0xf48e('0x5')](_0x141e2a,_0x25011e);_0x51ae7c(null);};}for(var e in events){if(events[_0xf48e('0x6')](e)){var event=events[e];SquareProject[_0xf48e('0x7')](e,emitEvent(event));}}module[_0xf48e('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 12d4bce..43557b3 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 _0x43d6=['bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','lodash','util','../../config/logger','moment'];(function(_0x3b0c7d,_0x366c62){var _0x342b64=function(_0x2887ed){while(--_0x2887ed){_0x3b0c7d['push'](_0x3b0c7d['shift']());}};_0x342b64(++_0x366c62);}(_0x43d6,0x140));var _0x643d=function(_0x25f03f,_0x657f9e){_0x25f03f=_0x25f03f-0x0;var _0x8cbd8a=_0x43d6[_0x25f03f];return _0x8cbd8a;};'use strict';var _=require(_0x643d('0x0'));var util=require(_0x643d('0x1'));var logger=require(_0x643d('0x2'))('api');var moment=require(_0x643d('0x3'));var BPromise=require(_0x643d('0x4'));var rp=require(_0x643d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x643d('0x6'));var config=require(_0x643d('0x7'));var attributes=require(_0x643d('0x8'));module['exports']=function(_0x337328,_0x3e18f9){return _0x337328[_0x643d('0x9')](_0x643d('0xa'),attributes,{'tableName':_0x643d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6da2=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SquareProject'];(function(_0xf7058b,_0x22c9b7){var _0x24cbf0=function(_0x2997ac){while(--_0x2997ac){_0xf7058b['push'](_0xf7058b['shift']());}};_0x24cbf0(++_0x22c9b7);}(_0x6da2,0x1e4));var _0x26da=function(_0x584b3f,_0x3b21a5){_0x584b3f=_0x584b3f-0x0;var _0x359088=_0x6da2[_0x584b3f];return _0x359088;};'use strict';var _=require('lodash');var util=require(_0x26da('0x0'));var logger=require(_0x26da('0x1'))(_0x26da('0x2'));var moment=require(_0x26da('0x3'));var BPromise=require(_0x26da('0x4'));var rp=require(_0x26da('0x5'));var fs=require('fs');var path=require(_0x26da('0x6'));var rimraf=require(_0x26da('0x7'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x26da('0x8')]=function(_0x17b7bf,_0x3f7523){return _0x17b7bf[_0x26da('0x9')](_0x26da('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index dec45c6..1857ef5 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x37eb7f,_0x3275c0){var _0x21ff83=function(_0x8b4498){while(--_0x8b4498){_0x37eb7f['push'](_0x37eb7f['shift']());}};_0x21ff83(++_0x3275c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x46de0d,_0x23ea52){var _0x4dfe8e=function(_0x43077b){while(--_0x43077b){_0x46de0d['push'](_0x46de0d['shift']());}};_0x4dfe8e(++_0x23ea52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d1f5ff3..76adb9a 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 _0x2830=['save','remove','update','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x4be472,_0x437eb8){var _0x511ea8=function(_0x29e81c){while(--_0x29e81c){_0x4be472['push'](_0x4be472['shift']());}};_0x511ea8(++_0x437eb8);}(_0x2830,0x117));var _0x0283=function(_0x207bd8,_0x4c36ca){_0x207bd8=_0x207bd8-0x0;var _0x2d7a72=_0x2830[_0x207bd8];return _0x2d7a72;};'use strict';var SquareProjectEvents=require(_0x0283('0x0'));var events=[_0x0283('0x1'),_0x0283('0x2'),_0x0283('0x3')];function createListener(_0x194d20,_0x2da1d2){return function(_0x3df172){_0x2da1d2['emit'](_0x194d20,_0x3df172);};}function removeListener(_0x414c89,_0x4aa050){return function(){SquareProjectEvents[_0x0283('0x4')](_0x414c89,_0x4aa050);};}exports[_0x0283('0x5')]=function(_0xc56cd7){for(var _0x2125db=0x0,_0x14d6e5=events[_0x0283('0x6')];_0x2125db<_0x14d6e5;_0x2125db++){var _0x29e976=events[_0x2125db];var _0x47ffae=createListener(_0x0283('0x7')+_0x29e976,_0xc56cd7);SquareProjectEvents['on'](_0x29e976,_0x47ffae);}}; \ No newline at end of file +var _0xc6d8=['remove','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x159912,_0x4cf66c){var _0x5f0e74=function(_0x1fcf2a){while(--_0x1fcf2a){_0x159912['push'](_0x159912['shift']());}};_0x5f0e74(++_0x4cf66c);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2f00dd,_0xd659bd){_0x2f00dd=_0x2f00dd-0x0;var _0x1bfa6c=_0xc6d8[_0x2f00dd];return _0x1bfa6c;};'use strict';var SquareProjectEvents=require(_0x8c6d('0x0'));var events=['save',_0x8c6d('0x1'),'update'];function createListener(_0x3b88d1,_0x5974d3){return function(_0x292852){_0x5974d3['emit'](_0x3b88d1,_0x292852);};}function removeListener(_0x5b6b04,_0x352b8c){return function(){SquareProjectEvents[_0x8c6d('0x2')](_0x5b6b04,_0x352b8c);};}exports[_0x8c6d('0x3')]=function(_0x4f5e8f){for(var _0x3c265c=0x0,_0x2dbb52=events[_0x8c6d('0x4')];_0x3c265c<_0x2dbb52;_0x3c265c++){var _0x5529f1=events[_0x3c265c];var _0x1496ba=createListener(_0x8c6d('0x5')+_0x5529f1,_0x4f5e8f);SquareProjectEvents['on'](_0x5529f1,_0x1496ba);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4aa2608..d0f189d 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 _0x09e3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x09e3,0x134));var _0x309e=function(_0x4947a4,_0x43d310){_0x4947a4=_0x4947a4-0x0;var _0x3d72a4=_0x09e3[_0x4947a4];return _0x3d72a4;};'use strict';var multer=require(_0x309e('0x0'));var util=require(_0x309e('0x1'));var path=require(_0x309e('0x2'));var timeout=require(_0x309e('0x3'));var express=require(_0x309e('0x4'));var router=express[_0x309e('0x5')]();var auth=require(_0x309e('0x6'));var interaction=require(_0x309e('0x7'));var config=require(_0x309e('0x8'));var controller=require(_0x309e('0x9'));router[_0x309e('0xa')]('/',auth[_0x309e('0xb')](),controller['index']);router[_0x309e('0xa')](_0x309e('0xc'),auth[_0x309e('0xb')](),controller[_0x309e('0xd')]);router['get'](_0x309e('0xe'),auth['isAuthenticated'](),controller[_0x309e('0xf')]);router[_0x309e('0x10')]('/',auth[_0x309e('0xb')](),controller[_0x309e('0x11')]);router[_0x309e('0x12')](_0x309e('0xc'),auth[_0x309e('0xb')](),controller[_0x309e('0x13')]);router[_0x309e('0x14')](_0x309e('0xc'),auth[_0x309e('0xb')](),controller[_0x309e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5dcd=['/:id/download','isAuthenticated','download','post','create','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','index','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5dcd,0xf8));var _0xd5dc=function(_0x934929,_0x5d3247){_0x934929=_0x934929-0x0;var _0x5977a6=_0x5dcd[_0x934929];return _0x5977a6;};'use strict';var multer=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var path=require(_0xd5dc('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5dc('0x3'));var router=express[_0xd5dc('0x4')]();var auth=require(_0xd5dc('0x5'));var interaction=require(_0xd5dc('0x6'));var config=require('../../config/environment');var controller=require(_0xd5dc('0x7'));router[_0xd5dc('0x8')]('/',auth['isAuthenticated'](),controller[_0xd5dc('0x9')]);router[_0xd5dc('0x8')](_0xd5dc('0xa'),auth['isAuthenticated'](),controller[_0xd5dc('0xb')]);router[_0xd5dc('0x8')](_0xd5dc('0xc'),auth[_0xd5dc('0xd')](),controller[_0xd5dc('0xe')]);router[_0xd5dc('0xf')]('/',auth[_0xd5dc('0xd')](),controller[_0xd5dc('0x10')]);router[_0xd5dc('0x11')](_0xd5dc('0xa'),auth[_0xd5dc('0xd')](),controller[_0xd5dc('0x12')]);router['delete']('/:id',auth[_0xd5dc('0xd')](),controller['destroy']);module[_0xd5dc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index aa75e48..acf4957 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 _0x804b=['exports','STRING','sequelize'];(function(_0x256178,_0x5614d4){var _0xc7cb05=function(_0x255413){while(--_0x255413){_0x256178['push'](_0x256178['shift']());}};_0xc7cb05(++_0x5614d4);}(_0x804b,0x119));var _0xb804=function(_0xeafe0e,_0x345ca0){_0xeafe0e=_0xeafe0e-0x0;var _0x595cf5=_0x804b[_0xeafe0e];return _0x595cf5;};'use strict';var Sequelize=require(_0xb804('0x0'));module[_0xb804('0x1')]={'uniqueid':{'type':Sequelize[_0xb804('0x2')]},'callerid':{'type':Sequelize[_0xb804('0x2')]},'calleridname':{'type':Sequelize[_0xb804('0x2')]},'context':{'type':Sequelize[_0xb804('0x2')]},'extension':{'type':Sequelize[_0xb804('0x2')]},'priority':{'type':Sequelize[_0xb804('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xb804('0x2')]},'filename':{'type':Sequelize[_0xb804('0x2')]},'savePath':{'type':Sequelize[_0xb804('0x2')]}}; \ No newline at end of file +var _0x8812=['exports','STRING'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x8812,0x1be));var _0x2881=function(_0x381344,_0x520b51){_0x381344=_0x381344-0x0;var _0x3f992c=_0x8812[_0x381344];return _0x3f992c;};'use strict';var Sequelize=require('sequelize');module[_0x2881('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2881('0x1')]},'calleridname':{'type':Sequelize[_0x2881('0x1')]},'context':{'type':Sequelize[_0x2881('0x1')]},'extension':{'type':Sequelize[_0x2881('0x1')]},'priority':{'type':Sequelize[_0x2881('0x1')]},'accountcode':{'type':Sequelize[_0x2881('0x1')]},'dnid':{'type':Sequelize[_0x2881('0x1')]},'projectName':{'type':Sequelize[_0x2881('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x2881('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ad8c7b8..c46aaf7 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 _0x7708=['filters','intersection','attributes','fields','length','nolimit','offset','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','count','include','findAll','rows','show','params','includeAll','find','catch','create','body','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','html-pdf','eml-format','zip-dir','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query'];(function(_0x534465,_0x437255){var _0x1054cd=function(_0xa3ab27){while(--_0xa3ab27){_0x534465['push'](_0x534465['shift']());}};_0x1054cd(++_0x437255);}(_0x7708,0x188));var _0x8770=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7708[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x8770('0x0'));var emlformat=require(_0x8770('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8770('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8770('0x3'));var util=require(_0x8770('0x4'));var path=require('path');var sox=require(_0x8770('0x5'));var csv=require('to-csv');var ejs=require(_0x8770('0x6'));var fs=require('fs');var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0xc'));var querystring=require('querystring');var Papa=require(_0x8770('0xd'));var Redis=require(_0x8770('0xe'));var authService=require(_0x8770('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require(_0x8770('0x13'));var config=require('../../config/environment');var db=require(_0x8770('0x14'))['db'];function respondWithStatusCode(_0x34d66c,_0x2adcbf){_0x2adcbf=_0x2adcbf||0xcc;return function(_0x51efbc){if(_0x51efbc){return _0x34d66c[_0x8770('0x15')](_0x2adcbf);}return _0x34d66c[_0x8770('0x16')](_0x2adcbf)[_0x8770('0x17')]();};}function respondWithResult(_0x3ba999,_0x2f2571){_0x2f2571=_0x2f2571||0xc8;return function(_0x12a06f){if(_0x12a06f){return _0x3ba999[_0x8770('0x16')](_0x2f2571)[_0x8770('0x18')](_0x12a06f);}};}function respondWithFilteredResult(_0x5514b5,_0x1d15d6){return function(_0x106a20){if(_0x106a20){var _0x5dd4e7=_0x106a20['count'],_0x2f7918=_0x1d15d6['offset'],_0x52254f=_0x1d15d6['offset']+_0x1d15d6[_0x8770('0x19')],_0x1c8ab6;if(_0x52254f>=_0x5dd4e7){_0x52254f=_0x5dd4e7;_0x1c8ab6=0xc8;}else{_0x1c8ab6=0xce;}_0x5514b5[_0x8770('0x16')](_0x1c8ab6);return _0x5514b5[_0x8770('0x1a')](_0x8770('0x1b'),_0x2f7918+'-'+_0x52254f+'/'+_0x5dd4e7)['json'](_0x106a20);}return null;};}function patchUpdates(_0x550be9){return function(_0x349bd4){try{jsonpatch[_0x8770('0x1c')](_0x349bd4,_0x550be9,!![]);}catch(_0x26cbcd){return BPromise[_0x8770('0x1d')](_0x26cbcd);}return _0x349bd4[_0x8770('0x1e')]();};}function saveUpdates(_0x4e1fa6,_0x3e1fe7){return function(_0x1234dd){if(_0x1234dd){return _0x1234dd[_0x8770('0x1f')](_0x4e1fa6)[_0x8770('0x20')](function(_0x582048){return _0x582048;});}return null;};}function removeEntity(_0x5e6709,_0x156767){return function(_0x348e2f){if(_0x348e2f){return _0x348e2f[_0x8770('0x21')]()[_0x8770('0x20')](function(){_0x5e6709[_0x8770('0x16')](0xcc)[_0x8770('0x17')]();});}};}function handleEntityNotFound(_0x5819dc,_0x468fc0){return function(_0x23ad66){if(!_0x23ad66){_0x5819dc[_0x8770('0x15')](0x194);}return _0x23ad66;};}function handleError(_0x2515c5,_0x51cdb5){_0x51cdb5=_0x51cdb5||0x1f4;return function(_0x460474){logger['error'](_0x460474[_0x8770('0x22')]);if(_0x460474[_0x8770('0x23')]){delete _0x460474[_0x8770('0x23')];}_0x2515c5[_0x8770('0x16')](_0x51cdb5)[_0x8770('0x24')](_0x460474);};}exports[_0x8770('0x25')]=function(_0x293f53,_0x367564){var _0xb3f4aa={},_0xa480={},_0x5f4973={'count':0x0,'rows':[]};var _0x1a7440=db[_0x8770('0x26')][_0x8770('0x27')];_0xa480[_0x8770('0x28')]=_[_0x8770('0x29')](_0x1a7440);_0xa480[_0x8770('0x2a')]=_['keys'](_0x293f53['query']);_0xa480[_0x8770('0x2b')]=_[_0x8770('0x2c')](_0xa480[_0x8770('0x28')],_0xa480[_0x8770('0x2a')]);_0xb3f4aa[_0x8770('0x2d')]=_['intersection'](_0xa480['model'],qs[_0x8770('0x2e')](_0x293f53[_0x8770('0x2a')][_0x8770('0x2e')]));_0xb3f4aa[_0x8770('0x2d')]=_0xb3f4aa['attributes'][_0x8770('0x2f')]?_0xb3f4aa['attributes']:_0xa480['model'];if(!_0x293f53[_0x8770('0x2a')]['hasOwnProperty'](_0x8770('0x30'))){_0xb3f4aa[_0x8770('0x19')]=qs[_0x8770('0x19')](_0x293f53[_0x8770('0x2a')][_0x8770('0x19')]);_0xb3f4aa[_0x8770('0x31')]=qs[_0x8770('0x31')](_0x293f53[_0x8770('0x2a')][_0x8770('0x31')]);}_0xb3f4aa['order']=qs[_0x8770('0x32')](_0x293f53[_0x8770('0x2a')][_0x8770('0x32')]);_0xb3f4aa['where']=qs['filters'](_[_0x8770('0x33')](_0x293f53[_0x8770('0x2a')],_0xa480[_0x8770('0x2b')]));if(_0x293f53['query'][_0x8770('0x34')]){_0xb3f4aa['where']=_[_0x8770('0x35')](_0xb3f4aa[_0x8770('0x36')],{'$or':_[_0x8770('0x37')](_0x1a7440,function(_0x147f89){if(_0x147f89[_0x8770('0x38')][_0x8770('0x39')]!==_0x8770('0x3a')){var _0x17488d={};_0x17488d[_0x147f89[_0x8770('0x3b')]]={'$like':'%'+_0x293f53[_0x8770('0x2a')]['filter']+'%'};return _0x17488d;}})});}_0xb3f4aa=_[_0x8770('0x35')]({},_0xb3f4aa,_0x293f53[_0x8770('0x3c')]);var _0x24b870={'where':_0xb3f4aa['where']};return db[_0x8770('0x26')][_0x8770('0x3d')](_0x24b870)[_0x8770('0x20')](function(_0xcc8310){_0x5f4973[_0x8770('0x3d')]=_0xcc8310;if(_0x293f53[_0x8770('0x2a')]['includeAll']){_0xb3f4aa[_0x8770('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x8770('0x3f')](_0xb3f4aa);})['then'](function(_0x41134a){_0x5f4973[_0x8770('0x40')]=_0x41134a;return _0x5f4973;})[_0x8770('0x20')](respondWithFilteredResult(_0x367564,_0xb3f4aa))['catch'](handleError(_0x367564,null));};exports[_0x8770('0x41')]=function(_0x3f35ac,_0x2300d3){var _0x94343f={'raw':!![],'where':{'id':_0x3f35ac[_0x8770('0x42')]['id']}},_0x408e86={};_0x408e86['model']=_[_0x8770('0x29')](db['SquareRecording']['rawAttributes']);_0x408e86[_0x8770('0x2a')]=_[_0x8770('0x29')](_0x3f35ac[_0x8770('0x2a')]);_0x408e86[_0x8770('0x2b')]=_[_0x8770('0x2c')](_0x408e86['model'],_0x408e86[_0x8770('0x2a')]);_0x94343f[_0x8770('0x2d')]=_['intersection'](_0x408e86[_0x8770('0x28')],qs['fields'](_0x3f35ac[_0x8770('0x2a')][_0x8770('0x2e')]));_0x94343f[_0x8770('0x2d')]=_0x94343f[_0x8770('0x2d')][_0x8770('0x2f')]?_0x94343f[_0x8770('0x2d')]:_0x408e86[_0x8770('0x28')];if(_0x3f35ac[_0x8770('0x2a')][_0x8770('0x43')]){_0x94343f[_0x8770('0x3e')]=[{'all':!![]}];}_0x94343f=_[_0x8770('0x35')]({},_0x94343f,_0x3f35ac['options']);return db[_0x8770('0x26')][_0x8770('0x44')](_0x94343f)[_0x8770('0x20')](handleEntityNotFound(_0x2300d3,null))[_0x8770('0x20')](respondWithResult(_0x2300d3,null))[_0x8770('0x45')](handleError(_0x2300d3,null));};exports[_0x8770('0x46')]=function(_0x52cc4f,_0x35df43){return db[_0x8770('0x26')][_0x8770('0x46')](_0x52cc4f[_0x8770('0x47')],{})[_0x8770('0x20')](respondWithResult(_0x35df43,0xc9))[_0x8770('0x45')](handleError(_0x35df43,null));};exports[_0x8770('0x1f')]=function(_0xe31cfb,_0x5cc8de){if(_0xe31cfb[_0x8770('0x47')]['id']){delete _0xe31cfb[_0x8770('0x47')]['id'];}return db[_0x8770('0x26')][_0x8770('0x44')]({'where':{'id':_0xe31cfb[_0x8770('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cc8de,null))['then'](saveUpdates(_0xe31cfb[_0x8770('0x47')],null))['then'](respondWithResult(_0x5cc8de,null))[_0x8770('0x45')](handleError(_0x5cc8de,null));};exports['destroy']=function(_0x4f9e0b,_0x3805d8){return db[_0x8770('0x26')][_0x8770('0x44')]({'where':{'id':_0x4f9e0b[_0x8770('0x42')]['id']}})['then'](handleEntityNotFound(_0x3805d8,null))[_0x8770('0x20')](removeEntity(_0x3805d8,null))[_0x8770('0x45')](handleError(_0x3805d8,null));};exports['download']=function(_0x4d8bde,_0x100bba,_0x20b44e){var _0x10890f=require('../../components/encryptor');var _0x1584dc=![];var _0x5b6638={};if(_0x4d8bde[_0x8770('0x2a')][_0x8770('0x38')]&&_0x4d8bde[_0x8770('0x2a')]['type']===_0x8770('0x48')){_0x5b6638['uniqueid']=_0x4d8bde['params']['id'];}else{_0x5b6638['id']=_0x4d8bde['params']['id'];}return db[_0x8770('0x26')][_0x8770('0x44')]({'where':_0x5b6638,'attributes':['id',_0x8770('0x49'),_0x8770('0x4a')],'raw':!![]})[_0x8770('0x20')](handleEntityNotFound(_0x100bba,null))[_0x8770('0x20')](function(_0x5c4cec){if(_0x5c4cec){var _0x20aed8=_0x5c4cec['savePath'];var _0x314e20=util[_0x8770('0x4b')](_0x8770('0x4c'),_0x20aed8);if(fs[_0x8770('0x4d')](_0x314e20)){_0x1584dc=!![];return _0x10890f['decryptFile'](_0x314e20,_0x20aed8,config[_0x8770('0x4e')][_0x8770('0x4f')])['then'](function(){return _0x5c4cec;});}return _0x5c4cec;}})['then'](function(_0x552cab){if(_0x552cab){var _0x48f12c=_0x552cab[_0x8770('0x49')];if(!fs[_0x8770('0x4d')](_0x48f12c)){throw new db['Sequelize'][(_0x8770('0x50'))](_0x8770('0x51'));}if(_0x552cab[_0x8770('0x4a')]){return _0x100bba[_0x8770('0x52')](_0x48f12c,_0x552cab[_0x8770('0x4a')]+path[_0x8770('0x53')](_0x48f12c),function(){if(_0x1584dc){fs[_0x8770('0x54')](_0x48f12c);}});}else{return _0x100bba[_0x8770('0x52')](_0x48f12c,function(_0x2815d3){if(_0x1584dc){fs[_0x8770('0x54')](_0x48f12c);}});}}})[_0x8770('0x45')](function(_0x528f67){if(_0x528f67[_0x8770('0x55')]===_0x8770('0x51')){_0x100bba[_0x8770('0x16')](0x194)['send'](_0x8770('0x56'));}else{return handleError(_0x100bba,null);}});}; \ No newline at end of file +var _0x955f=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','catch','params','includeAll','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareRecording','rawAttributes','model'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x955f,0x1eb));var _0xf955=function(_0x2f489e,_0x34c28a){_0x2f489e=_0x2f489e-0x0;var _0x310cdb=_0x955f[_0x2f489e];return _0x310cdb;};'use strict';var pdf=require(_0xf955('0x0'));var emlformat=require(_0xf955('0x1'));var rimraf=require(_0xf955('0x2'));var zipdir=require(_0xf955('0x3'));var jsonpatch=require(_0xf955('0x4'));var rp=require('request-promise');var moment=require(_0xf955('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf955('0x6'));var path=require('path');var sox=require(_0xf955('0x7'));var csv=require(_0xf955('0x8'));var ejs=require(_0xf955('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x8'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf955('0x12'))('api');var utils=require(_0xf955('0x13'));var config=require(_0xf955('0x14'));var db=require(_0xf955('0x15'))['db'];function respondWithStatusCode(_0x5757b6,_0x2f61b8){_0x2f61b8=_0x2f61b8||0xcc;return function(_0x542347){if(_0x542347){return _0x5757b6[_0xf955('0x16')](_0x2f61b8);}return _0x5757b6['status'](_0x2f61b8)[_0xf955('0x17')]();};}function respondWithResult(_0x2ff7e5,_0x22507a){_0x22507a=_0x22507a||0xc8;return function(_0x109bc5){if(_0x109bc5){return _0x2ff7e5[_0xf955('0x18')](_0x22507a)[_0xf955('0x19')](_0x109bc5);}};}function respondWithFilteredResult(_0x1c3235,_0x2783f2){return function(_0x3c6af7){if(_0x3c6af7){var _0x24e75c=_0x3c6af7[_0xf955('0x1a')],_0x5350e4=_0x2783f2[_0xf955('0x1b')],_0xc29b35=_0x2783f2[_0xf955('0x1b')]+_0x2783f2[_0xf955('0x1c')],_0x54e60b;if(_0xc29b35>=_0x24e75c){_0xc29b35=_0x24e75c;_0x54e60b=0xc8;}else{_0x54e60b=0xce;}_0x1c3235['status'](_0x54e60b);return _0x1c3235['set'](_0xf955('0x1d'),_0x5350e4+'-'+_0xc29b35+'/'+_0x24e75c)[_0xf955('0x19')](_0x3c6af7);}return null;};}function patchUpdates(_0x3c49c0){return function(_0x4d7b5b){try{jsonpatch[_0xf955('0x1e')](_0x4d7b5b,_0x3c49c0,!![]);}catch(_0x3576fa){return BPromise[_0xf955('0x1f')](_0x3576fa);}return _0x4d7b5b[_0xf955('0x20')]();};}function saveUpdates(_0x3ae4fb,_0x5f4d9a){return function(_0x17d86a){if(_0x17d86a){return _0x17d86a[_0xf955('0x21')](_0x3ae4fb)[_0xf955('0x22')](function(_0x488d04){return _0x488d04;});}return null;};}function removeEntity(_0x43a5f2,_0x5daa73){return function(_0x21ae24){if(_0x21ae24){return _0x21ae24[_0xf955('0x23')]()[_0xf955('0x22')](function(){_0x43a5f2[_0xf955('0x18')](0xcc)[_0xf955('0x17')]();});}};}function handleEntityNotFound(_0x565641,_0x25f4f2){return function(_0x5fab1c){if(!_0x5fab1c){_0x565641[_0xf955('0x16')](0x194);}return _0x5fab1c;};}function handleError(_0x13a1a7,_0x17dec2){_0x17dec2=_0x17dec2||0x1f4;return function(_0x102e36){logger[_0xf955('0x24')](_0x102e36['stack']);if(_0x102e36[_0xf955('0x25')]){delete _0x102e36[_0xf955('0x25')];}_0x13a1a7[_0xf955('0x18')](_0x17dec2)[_0xf955('0x26')](_0x102e36);};}exports[_0xf955('0x27')]=function(_0x13a86d,_0x3796f7){var _0x51f3ab={},_0x3caea6={},_0x145098={'count':0x0,'rows':[]};var _0x41c9f6=db[_0xf955('0x28')][_0xf955('0x29')];_0x3caea6[_0xf955('0x2a')]=_['keys'](_0x41c9f6);_0x3caea6[_0xf955('0x2b')]=_[_0xf955('0x2c')](_0x13a86d['query']);_0x3caea6[_0xf955('0x2d')]=_[_0xf955('0x2e')](_0x3caea6[_0xf955('0x2a')],_0x3caea6[_0xf955('0x2b')]);_0x51f3ab['attributes']=_[_0xf955('0x2e')](_0x3caea6['model'],qs[_0xf955('0x2f')](_0x13a86d[_0xf955('0x2b')][_0xf955('0x2f')]));_0x51f3ab[_0xf955('0x30')]=_0x51f3ab[_0xf955('0x30')][_0xf955('0x31')]?_0x51f3ab[_0xf955('0x30')]:_0x3caea6[_0xf955('0x2a')];if(!_0x13a86d['query'][_0xf955('0x32')](_0xf955('0x33'))){_0x51f3ab[_0xf955('0x1c')]=qs[_0xf955('0x1c')](_0x13a86d['query'][_0xf955('0x1c')]);_0x51f3ab[_0xf955('0x1b')]=qs[_0xf955('0x1b')](_0x13a86d[_0xf955('0x2b')][_0xf955('0x1b')]);}_0x51f3ab['order']=qs['sort'](_0x13a86d['query'][_0xf955('0x34')]);_0x51f3ab[_0xf955('0x35')]=qs[_0xf955('0x2d')](_[_0xf955('0x36')](_0x13a86d[_0xf955('0x2b')],_0x3caea6[_0xf955('0x2d')]));if(_0x13a86d['query'][_0xf955('0x37')]){_0x51f3ab['where']=_[_0xf955('0x38')](_0x51f3ab[_0xf955('0x35')],{'$or':_[_0xf955('0x39')](_0x41c9f6,function(_0x51762d){if(_0x51762d[_0xf955('0x3a')]['key']!==_0xf955('0x3b')){var _0x40edaf={};_0x40edaf[_0x51762d[_0xf955('0x3c')]]={'$like':'%'+_0x13a86d[_0xf955('0x2b')]['filter']+'%'};return _0x40edaf;}})});}_0x51f3ab=_[_0xf955('0x38')]({},_0x51f3ab,_0x13a86d[_0xf955('0x3d')]);var _0x5a48be={'where':_0x51f3ab[_0xf955('0x35')]};return db[_0xf955('0x28')][_0xf955('0x1a')](_0x5a48be)['then'](function(_0x292e53){_0x145098[_0xf955('0x1a')]=_0x292e53;if(_0x13a86d[_0xf955('0x2b')]['includeAll']){_0x51f3ab[_0xf955('0x3e')]=[{'all':!![]}];}return db[_0xf955('0x28')][_0xf955('0x3f')](_0x51f3ab);})[_0xf955('0x22')](function(_0x2bfbe4){_0x145098[_0xf955('0x40')]=_0x2bfbe4;return _0x145098;})[_0xf955('0x22')](respondWithFilteredResult(_0x3796f7,_0x51f3ab))[_0xf955('0x41')](handleError(_0x3796f7,null));};exports['show']=function(_0x8fa41b,_0x7123c1){var _0x2aacdf={'raw':!![],'where':{'id':_0x8fa41b[_0xf955('0x42')]['id']}},_0xe633fa={};_0xe633fa[_0xf955('0x2a')]=_[_0xf955('0x2c')](db[_0xf955('0x28')][_0xf955('0x29')]);_0xe633fa[_0xf955('0x2b')]=_[_0xf955('0x2c')](_0x8fa41b[_0xf955('0x2b')]);_0xe633fa[_0xf955('0x2d')]=_[_0xf955('0x2e')](_0xe633fa[_0xf955('0x2a')],_0xe633fa[_0xf955('0x2b')]);_0x2aacdf[_0xf955('0x30')]=_[_0xf955('0x2e')](_0xe633fa[_0xf955('0x2a')],qs['fields'](_0x8fa41b[_0xf955('0x2b')][_0xf955('0x2f')]));_0x2aacdf[_0xf955('0x30')]=_0x2aacdf['attributes'][_0xf955('0x31')]?_0x2aacdf['attributes']:_0xe633fa[_0xf955('0x2a')];if(_0x8fa41b['query'][_0xf955('0x43')]){_0x2aacdf[_0xf955('0x3e')]=[{'all':!![]}];}_0x2aacdf=_[_0xf955('0x38')]({},_0x2aacdf,_0x8fa41b[_0xf955('0x3d')]);return db['SquareRecording'][_0xf955('0x44')](_0x2aacdf)[_0xf955('0x22')](handleEntityNotFound(_0x7123c1,null))[_0xf955('0x22')](respondWithResult(_0x7123c1,null))['catch'](handleError(_0x7123c1,null));};exports['create']=function(_0x1bd760,_0x314281){return db[_0xf955('0x28')][_0xf955('0x45')](_0x1bd760['body'],{})[_0xf955('0x22')](respondWithResult(_0x314281,0xc9))[_0xf955('0x41')](handleError(_0x314281,null));};exports[_0xf955('0x21')]=function(_0x5a350d,_0x388e59){if(_0x5a350d['body']['id']){delete _0x5a350d[_0xf955('0x46')]['id'];}return db[_0xf955('0x28')][_0xf955('0x44')]({'where':{'id':_0x5a350d['params']['id']}})[_0xf955('0x22')](handleEntityNotFound(_0x388e59,null))[_0xf955('0x22')](saveUpdates(_0x5a350d[_0xf955('0x46')],null))[_0xf955('0x22')](respondWithResult(_0x388e59,null))['catch'](handleError(_0x388e59,null));};exports[_0xf955('0x23')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x28')][_0xf955('0x44')]({'where':{'id':_0x4ff0f1['params']['id']}})[_0xf955('0x22')](handleEntityNotFound(_0x1c6d76,null))['then'](removeEntity(_0x1c6d76,null))[_0xf955('0x41')](handleError(_0x1c6d76,null));};exports['download']=function(_0x38edc7,_0x55e625,_0x57535f){var _0x3151b4=require(_0xf955('0x47'));var _0x4961cc=![];var _0x142e8f={};if(_0x38edc7['query']['type']&&_0x38edc7['query']['type']===_0xf955('0x48')){_0x142e8f[_0xf955('0x48')]=_0x38edc7['params']['id'];}else{_0x142e8f['id']=_0x38edc7['params']['id'];}return db[_0xf955('0x28')][_0xf955('0x44')]({'where':_0x142e8f,'attributes':['id',_0xf955('0x49'),_0xf955('0x4a')],'raw':!![]})[_0xf955('0x22')](handleEntityNotFound(_0x55e625,null))[_0xf955('0x22')](function(_0x190500){if(_0x190500){var _0x3a69ca=_0x190500[_0xf955('0x49')];var _0x141314=util[_0xf955('0x4b')](_0xf955('0x4c'),_0x3a69ca);if(fs['existsSync'](_0x141314)){_0x4961cc=!![];return _0x3151b4[_0xf955('0x4d')](_0x141314,_0x3a69ca,config[_0xf955('0x4e')][_0xf955('0x4f')])[_0xf955('0x22')](function(){return _0x190500;});}return _0x190500;}})[_0xf955('0x22')](function(_0x4dc34b){if(_0x4dc34b){var _0xf5d575=_0x4dc34b[_0xf955('0x49')];if(!fs[_0xf955('0x50')](_0xf5d575)){throw new db[(_0xf955('0x51'))][(_0xf955('0x52'))](_0xf955('0x53'));}if(_0x4dc34b[_0xf955('0x4a')]){return _0x55e625[_0xf955('0x54')](_0xf5d575,_0x4dc34b[_0xf955('0x4a')]+path[_0xf955('0x55')](_0xf5d575),function(){if(_0x4961cc){fs['unlink'](_0xf5d575);}});}else{return _0x55e625[_0xf955('0x54')](_0xf5d575,function(_0xc20065){if(_0x4961cc){fs[_0xf955('0x56')](_0xf5d575);}});}}})[_0xf955('0x41')](function(_0x116458){if(_0x116458[_0xf955('0x57')]===_0xf955('0x53')){_0x55e625[_0xf955('0x18')](0x194)[_0xf955('0x26')](_0xf955('0x58'));}else{return handleError(_0x55e625,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7f2067f..e1704c1 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 _0x1307=['define','SquareRecording','square_recordings','lodash','util','moment','bluebird','request-promise','../../config/environment','./squareRecording.attributes','exports'];(function(_0x165e96,_0x2b3c71){var _0x5b68f5=function(_0x6e6949){while(--_0x6e6949){_0x165e96['push'](_0x165e96['shift']());}};_0x5b68f5(++_0x2b3c71);}(_0x1307,0xd4));var _0x7130=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1307[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7130('0x0'));var util=require(_0x7130('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7130('0x2'));var BPromise=require(_0x7130('0x3'));var rp=require(_0x7130('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7130('0x5'));var attributes=require(_0x7130('0x6'));module[_0x7130('0x7')]=function(_0x255e03,_0x4a1b26){return _0x255e03[_0x7130('0x8')](_0x7130('0x9'),attributes,{'tableName':_0x7130('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f49=['../../config/environment','exports','define','SquareRecording','square_recordings','lodash','../../config/logger','api','request-promise','rimraf'];(function(_0x36c433,_0x7a506e){var _0x506299=function(_0x175327){while(--_0x175327){_0x36c433['push'](_0x36c433['shift']());}};_0x506299(++_0x7a506e);}(_0x7f49,0x9b));var _0x97f4=function(_0x4660a5,_0x38bf2f){_0x4660a5=_0x4660a5-0x0;var _0xe803f9=_0x7f49[_0x4660a5];return _0xe803f9;};'use strict';var _=require(_0x97f4('0x0'));var util=require('util');var logger=require(_0x97f4('0x1'))(_0x97f4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x97f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97f4('0x4'));var config=require(_0x97f4('0x5'));var attributes=require('./squareRecording.attributes');module[_0x97f4('0x6')]=function(_0x478ef1,_0x17b734){return _0x478ef1[_0x97f4('0x7')](_0x97f4('0x8'),attributes,{'tableName':_0x97f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 279ee59..d48df5b 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 _0x9e23=['SquareRecording,\x20%s,\x20%s','result','catch','SquareRecording','create','body','CreateSquareRecording','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5972e0,_0x4b0be6){var _0x1e9e2e=function(_0x1b0eba){while(--_0x1b0eba){_0x5972e0['push'](_0x5972e0['shift']());}};_0x1e9e2e(++_0x4b0be6);}(_0x9e23,0x120));var _0x39e2=function(_0x4eb5a3,_0x2af0c4){_0x4eb5a3=_0x4eb5a3-0x0;var _0x2a21f7=_0x9e23[_0x4eb5a3];return _0x2a21f7;};'use strict';var _=require('lodash');var util=require(_0x39e2('0x0'));var moment=require(_0x39e2('0x1'));var BPromise=require(_0x39e2('0x2'));var rs=require(_0x39e2('0x3'));var fs=require('fs');var Redis=require(_0x39e2('0x4'));var db=require(_0x39e2('0x5'))['db'];var utils=require(_0x39e2('0x6'));var logger=require('../../config/logger')(_0x39e2('0x7'));var config=require(_0x39e2('0x8'));var jayson=require(_0x39e2('0x9'));var client=jayson['client'][_0x39e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfb5da2,_0x3380d1,_0x3d0a5b){return new BPromise(function(_0x4c3f88,_0x287144){return client[_0x39e2('0xb')](_0xfb5da2,_0x3d0a5b)[_0x39e2('0xc')](function(_0x5ca169){logger[_0x39e2('0xd')]('SquareRecording,\x20%s,\x20%s',_0x3380d1,_0x39e2('0xe'));logger['debug'](_0x39e2('0xf'),_0x3380d1,_0x39e2('0xe'),JSON[_0x39e2('0x10')](_0x5ca169));if(_0x5ca169[_0x39e2('0x11')]){if(_0x5ca169[_0x39e2('0x11')][_0x39e2('0x12')]===0x1f4){logger[_0x39e2('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3380d1,_0x5ca169[_0x39e2('0x11')][_0x39e2('0x13')]);return _0x287144(_0x5ca169[_0x39e2('0x11')][_0x39e2('0x13')]);}logger[_0x39e2('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3380d1,_0x5ca169['error'][_0x39e2('0x13')]);return _0x4c3f88(_0x5ca169[_0x39e2('0x11')][_0x39e2('0x13')]);}else{logger[_0x39e2('0xd')](_0x39e2('0x14'),_0x3380d1,_0x39e2('0xe'));_0x4c3f88(_0x5ca169[_0x39e2('0x15')][_0x39e2('0x13')]);}})[_0x39e2('0x16')](function(_0x508472){logger[_0x39e2('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3380d1,_0x508472);_0x287144(_0x508472);});});}exports['CreateSquareRecording']=function(_0x446e01){var _0x391b44=this;return new Promise(function(_0x27cc13,_0x2d0e92){return db[_0x39e2('0x17')][_0x39e2('0x18')](_0x446e01[_0x39e2('0x19')],{'raw':_0x446e01['options']?_0x446e01['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2b2433){logger[_0x39e2('0xd')](_0x39e2('0x1a'),_0x446e01);logger[_0x39e2('0x1b')](_0x39e2('0x1a'),_0x446e01,JSON[_0x39e2('0x10')](_0x2b2433));_0x27cc13(_0x2b2433);})[_0x39e2('0x16')](function(_0xca971){logger['error'](_0x39e2('0x1a'),_0xca971[_0x39e2('0x13')],_0x446e01);_0x2d0e92(_0x391b44[_0x39e2('0x11')](0x1f4,_0xca971[_0x39e2('0x13')]));});});}; \ No newline at end of file +var _0x9828=['error','message','CreateSquareRecording','options','raw','then','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x480396,_0x182723){var _0x153ea7=function(_0x871510){while(--_0x871510){_0x480396['push'](_0x480396['shift']());}};_0x153ea7(++_0x182723);}(_0x9828,0x11b));var _0x8982=function(_0x5f0260,_0x472c00){_0x5f0260=_0x5f0260-0x0;var _0x161a71=_0x9828[_0x5f0260];return _0x161a71;};'use strict';var _=require(_0x8982('0x0'));var util=require(_0x8982('0x1'));var moment=require(_0x8982('0x2'));var BPromise=require(_0x8982('0x3'));var rs=require(_0x8982('0x4'));var fs=require('fs');var Redis=require(_0x8982('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8982('0x6'));var logger=require(_0x8982('0x7'))(_0x8982('0x8'));var config=require('../../config/environment');var jayson=require(_0x8982('0x9'));var client=jayson[_0x8982('0xa')][_0x8982('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ea507,_0x4bb10a,_0x562fbb){return new BPromise(function(_0x154ec1,_0x1e34e8){return client[_0x8982('0xc')](_0x2ea507,_0x562fbb)['then'](function(_0x39003b){logger[_0x8982('0xd')](_0x8982('0xe'),_0x4bb10a,_0x8982('0xf'));logger[_0x8982('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4bb10a,_0x8982('0xf'),JSON['stringify'](_0x39003b));if(_0x39003b[_0x8982('0x11')]){if(_0x39003b[_0x8982('0x11')]['code']===0x1f4){logger[_0x8982('0x11')](_0x8982('0xe'),_0x4bb10a,_0x39003b['error'][_0x8982('0x12')]);return _0x1e34e8(_0x39003b['error']['message']);}logger['error'](_0x8982('0xe'),_0x4bb10a,_0x39003b['error'][_0x8982('0x12')]);return _0x154ec1(_0x39003b[_0x8982('0x11')][_0x8982('0x12')]);}else{logger[_0x8982('0xd')](_0x8982('0xe'),_0x4bb10a,_0x8982('0xf'));_0x154ec1(_0x39003b['result'][_0x8982('0x12')]);}})['catch'](function(_0x7ecf3a){logger['error']('SquareRecording,\x20%s,\x20%s',_0x4bb10a,_0x7ecf3a);_0x1e34e8(_0x7ecf3a);});});}exports[_0x8982('0x13')]=function(_0x14cb0f){var _0x17132f=this;return new Promise(function(_0x3b22c2,_0x2f6484){return db['SquareRecording']['create'](_0x14cb0f['body'],{'raw':_0x14cb0f['options']?_0x14cb0f[_0x8982('0x14')][_0x8982('0x15')]===undefined?!![]:![]:!![]})[_0x8982('0x16')](function(_0x403c4e){logger[_0x8982('0xd')](_0x8982('0x13'),_0x14cb0f);logger[_0x8982('0x10')](_0x8982('0x13'),_0x14cb0f,JSON[_0x8982('0x17')](_0x403c4e));_0x3b22c2(_0x403c4e);})[_0x8982('0x18')](function(_0x564dc1){logger[_0x8982('0x11')](_0x8982('0x13'),_0x564dc1[_0x8982('0x12')],_0x14cb0f);_0x2f6484(_0x17132f[_0x8982('0x11')](0x1f4,_0x564dc1[_0x8982('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 22d0701..b465824 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 _0x0f5b=['index','/describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareReport.controller','get','isAuthenticated'];(function(_0x5e07cb,_0xf5d6d1){var _0x4460d7=function(_0x41ecf1){while(--_0x41ecf1){_0x5e07cb['push'](_0x5e07cb['shift']());}};_0x4460d7(++_0xf5d6d1);}(_0x0f5b,0x8e));var _0xb0f5=function(_0x256662,_0xcbc858){_0x256662=_0x256662-0x0;var _0x2a7aaa=_0x0f5b[_0x256662];return _0x2a7aaa;};'use strict';var multer=require(_0xb0f5('0x0'));var util=require(_0xb0f5('0x1'));var path=require(_0xb0f5('0x2'));var timeout=require(_0xb0f5('0x3'));var express=require(_0xb0f5('0x4'));var router=express[_0xb0f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0f5('0x6'));var controller=require(_0xb0f5('0x7'));router[_0xb0f5('0x8')]('/',auth[_0xb0f5('0x9')](),controller[_0xb0f5('0xa')]);router[_0xb0f5('0x8')](_0xb0f5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb0f5('0x8')](_0xb0f5('0xc'),auth[_0xb0f5('0x9')](),controller['show']);router[_0xb0f5('0xd')]('/',auth[_0xb0f5('0x9')](),controller[_0xb0f5('0xe')]);router['put'](_0xb0f5('0xc'),auth[_0xb0f5('0x9')](),controller[_0xb0f5('0xf')]);router[_0xb0f5('0x10')](_0xb0f5('0xc'),auth[_0xb0f5('0x9')](),controller[_0xb0f5('0x11')]);module[_0xb0f5('0x12')]=router; \ No newline at end of file +var _0xd976=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','multer','util'];(function(_0x3f3fd0,_0x2a75b7){var _0x359426=function(_0x56ce54){while(--_0x56ce54){_0x3f3fd0['push'](_0x3f3fd0['shift']());}};_0x359426(++_0x2a75b7);}(_0xd976,0x17a));var _0x6d97=function(_0x5dec48,_0x219d72){_0x5dec48=_0x5dec48-0x0;var _0x31b936=_0xd976[_0x5dec48];return _0x31b936;};'use strict';var multer=require(_0x6d97('0x0'));var util=require(_0x6d97('0x1'));var path=require('path');var timeout=require(_0x6d97('0x2'));var express=require(_0x6d97('0x3'));var router=express[_0x6d97('0x4')]();var auth=require(_0x6d97('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6d97('0x6'));var controller=require(_0x6d97('0x7'));router[_0x6d97('0x8')]('/',auth[_0x6d97('0x9')](),controller[_0x6d97('0xa')]);router['get'](_0x6d97('0xb'),auth['isAuthenticated'](),controller[_0x6d97('0xc')]);router['get'](_0x6d97('0xd'),auth['isAuthenticated'](),controller[_0x6d97('0xe')]);router[_0x6d97('0xf')]('/',auth[_0x6d97('0x9')](),controller['create']);router[_0x6d97('0x10')](_0x6d97('0xd'),auth[_0x6d97('0x9')](),controller[_0x6d97('0x11')]);router[_0x6d97('0x12')](_0x6d97('0xd'),auth[_0x6d97('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 4b85351..57836c2 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 _0x3ef0=['STRING','DATE','sequelize'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x3ef0,0x19a));var _0x03ef=function(_0x49a2bb,_0x444804){_0x49a2bb=_0x49a2bb-0x0;var _0x23d3f7=_0x3ef0[_0x49a2bb];return _0x23d3f7;};'use strict';var Sequelize=require(_0x03ef('0x0'));module['exports']={'network':{'type':Sequelize[_0x03ef('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x03ef('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x03ef('0x1')]},'type':{'type':Sequelize[_0x03ef('0x1')]},'uniqueid':{'type':Sequelize[_0x03ef('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x03ef('0x1')]},'callingpres':{'type':Sequelize[_0x03ef('0x1')]},'callingani2':{'type':Sequelize[_0x03ef('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x03ef('0x1')]},'dnid':{'type':Sequelize[_0x03ef('0x1')]},'rdnis':{'type':Sequelize[_0x03ef('0x1')]},'context':{'type':Sequelize[_0x03ef('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x03ef('0x1')]},'accountcode':{'type':Sequelize[_0x03ef('0x1')]},'threadid':{'type':Sequelize[_0x03ef('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x03ef('0x2')]},'leaveAt':{'type':Sequelize[_0x03ef('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa991=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x2c319c,_0x58a374){var _0x47335b=function(_0x33be33){while(--_0x33be33){_0x2c319c['push'](_0x2c319c['shift']());}};_0x47335b(++_0x58a374);}(_0xa991,0x143));var _0x1a99=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xa991[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0x1a99('0x0'));module['exports']={'network':{'type':Sequelize[_0x1a99('0x1')]},'network_script':{'type':Sequelize[_0x1a99('0x1')]},'request':{'type':Sequelize[_0x1a99('0x1')]},'channel':{'type':Sequelize[_0x1a99('0x1')]},'language':{'type':Sequelize[_0x1a99('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1a99('0x1')]},'version':{'type':Sequelize[_0x1a99('0x1')]},'callerid':{'type':Sequelize[_0x1a99('0x1')]},'calleridname':{'type':Sequelize[_0x1a99('0x1')]},'callingpres':{'type':Sequelize[_0x1a99('0x1')]},'callingani2':{'type':Sequelize[_0x1a99('0x1')]},'callington':{'type':Sequelize[_0x1a99('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x1a99('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1a99('0x1')]},'extension':{'type':Sequelize[_0x1a99('0x1')]},'priority':{'type':Sequelize[_0x1a99('0x1')]},'enhanced':{'type':Sequelize[_0x1a99('0x1')]},'accountcode':{'type':Sequelize[_0x1a99('0x1')]},'threadid':{'type':Sequelize[_0x1a99('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1a99('0x2')]},'leaveAt':{'type':Sequelize[_0x1a99('0x2')]},'bot':{'type':Sequelize[_0x1a99('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 383419c..53fbf2a 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 _0x2493=['length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','field','includeAll','include','catch','show','params','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x3c3e9d,_0xb44cc3){var _0xe123c8=function(_0x4cee61){while(--_0x4cee61){_0x3c3e9d['push'](_0x3c3e9d['shift']());}};_0xe123c8(++_0xb44cc3);}(_0x2493,0x1c5));var _0x3249=function(_0x551139,_0x4c43a8){_0x551139=_0x551139-0x0;var _0x1701c7=_0x2493[_0x551139];return _0x1701c7;};'use strict';var pdf=require(_0x3249('0x0'));var emlformat=require(_0x3249('0x1'));var rimraf=require(_0x3249('0x2'));var zipdir=require(_0x3249('0x3'));var jsonpatch=require(_0x3249('0x4'));var rp=require(_0x3249('0x5'));var moment=require(_0x3249('0x6'));var BPromise=require(_0x3249('0x7'));var Mustache=require(_0x3249('0x8'));var util=require('util');var path=require(_0x3249('0x9'));var sox=require(_0x3249('0xa'));var csv=require(_0x3249('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3249('0xc'));var squel=require('squel');var crypto=require(_0x3249('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3249('0xe'));var toCsv=require(_0x3249('0xb'));var querystring=require(_0x3249('0xf'));var Papa=require(_0x3249('0x10'));var Redis=require(_0x3249('0x11'));var authService=require(_0x3249('0x12'));var qs=require(_0x3249('0x13'));var hardwareService=require(_0x3249('0x14'));var logger=require('../../config/logger')(_0x3249('0x15'));var utils=require('../../config/utils');var config=require(_0x3249('0x16'));var db=require(_0x3249('0x17'))['db'];function respondWithStatusCode(_0x47bbd6,_0x440095){_0x440095=_0x440095||0xcc;return function(_0x33720f){if(_0x33720f){return _0x47bbd6[_0x3249('0x18')](_0x440095);}return _0x47bbd6[_0x3249('0x19')](_0x440095)['end']();};}function respondWithResult(_0x152044,_0x33f007){_0x33f007=_0x33f007||0xc8;return function(_0x463fa4){if(_0x463fa4){return _0x152044[_0x3249('0x19')](_0x33f007)['json'](_0x463fa4);}};}function respondWithFilteredResult(_0x327d4e,_0x40b89d){return function(_0x83f1fe){if(_0x83f1fe){var _0x364029=_0x83f1fe[_0x3249('0x1a')],_0x60ead4=_0x40b89d[_0x3249('0x1b')],_0x458725=_0x40b89d[_0x3249('0x1b')]+_0x40b89d[_0x3249('0x1c')],_0x5328a4;if(_0x458725>=_0x364029){_0x458725=_0x364029;_0x5328a4=0xc8;}else{_0x5328a4=0xce;}_0x327d4e[_0x3249('0x19')](_0x5328a4);return _0x327d4e[_0x3249('0x1d')](_0x3249('0x1e'),_0x60ead4+'-'+_0x458725+'/'+_0x364029)['json'](_0x83f1fe);}return null;};}function patchUpdates(_0x1f52be){return function(_0x1f7628){try{jsonpatch[_0x3249('0x1f')](_0x1f7628,_0x1f52be,!![]);}catch(_0x2e7f76){return BPromise[_0x3249('0x20')](_0x2e7f76);}return _0x1f7628[_0x3249('0x21')]();};}function saveUpdates(_0x20d794,_0x37abe7){return function(_0x3a7dfb){if(_0x3a7dfb){return _0x3a7dfb[_0x3249('0x22')](_0x20d794)[_0x3249('0x23')](function(_0x20a800){return _0x20a800;});}return null;};}function removeEntity(_0x4cabcd,_0x1ca6f9){return function(_0x4b275e){if(_0x4b275e){return _0x4b275e[_0x3249('0x24')]()['then'](function(){_0x4cabcd[_0x3249('0x19')](0xcc)[_0x3249('0x25')]();});}};}function handleEntityNotFound(_0x2eae70,_0x5c0aa3){return function(_0x4c97bb){if(!_0x4c97bb){_0x2eae70[_0x3249('0x18')](0x194);}return _0x4c97bb;};}function handleError(_0x32cb2d,_0x29d91c){_0x29d91c=_0x29d91c||0x1f4;return function(_0x524871){logger['error'](_0x524871[_0x3249('0x26')]);if(_0x524871[_0x3249('0x27')]){delete _0x524871['name'];}_0x32cb2d[_0x3249('0x19')](_0x29d91c)[_0x3249('0x28')](_0x524871);};}exports[_0x3249('0x29')]=function(_0x22a113,_0x202a1b){var _0x325b9b={},_0x56c470={},_0x6d5362={'count':0x0,'rows':[]};var _0xc69e88=db[_0x3249('0x2a')][_0x3249('0x2b')];_0x56c470[_0x3249('0x2c')]=_[_0x3249('0x2d')](_0xc69e88);_0x56c470['query']=_[_0x3249('0x2d')](_0x22a113[_0x3249('0x2e')]);_0x56c470[_0x3249('0x2f')]=_[_0x3249('0x30')](_0x56c470[_0x3249('0x2c')],_0x56c470['query']);_0x325b9b[_0x3249('0x31')]=_[_0x3249('0x30')](_0x56c470['model'],qs['fields'](_0x22a113[_0x3249('0x2e')][_0x3249('0x32')]));_0x325b9b[_0x3249('0x31')]=_0x325b9b[_0x3249('0x31')][_0x3249('0x33')]?_0x325b9b[_0x3249('0x31')]:_0x56c470[_0x3249('0x2c')];if(!_0x22a113['query'][_0x3249('0x34')]('nolimit')){_0x325b9b[_0x3249('0x1c')]=qs['limit'](_0x22a113[_0x3249('0x2e')]['limit']);_0x325b9b[_0x3249('0x1b')]=qs['offset'](_0x22a113[_0x3249('0x2e')][_0x3249('0x1b')]);}_0x325b9b[_0x3249('0x35')]=qs[_0x3249('0x36')](_0x22a113['query'][_0x3249('0x36')]);_0x325b9b[_0x3249('0x37')]=qs[_0x3249('0x2f')](_[_0x3249('0x38')](_0x22a113[_0x3249('0x2e')],_0x56c470[_0x3249('0x2f')]));if(_0x22a113[_0x3249('0x2e')][_0x3249('0x39')]){_0x325b9b[_0x3249('0x37')]=_['merge'](_0x325b9b[_0x3249('0x37')],{'$or':_[_0x3249('0x3a')](_0xc69e88,function(_0x298dc2){if(_0x298dc2[_0x3249('0x3b')][_0x3249('0x3c')]!=='VIRTUAL'){var _0x5d59e2={};_0x5d59e2[_0x298dc2[_0x3249('0x3d')]]={'$like':'%'+_0x22a113[_0x3249('0x2e')][_0x3249('0x39')]+'%'};return _0x5d59e2;}})});}_0x325b9b=_['merge']({},_0x325b9b,_0x22a113['options']);var _0x84d4c6={'where':_0x325b9b['where']};return db[_0x3249('0x2a')]['count'](_0x84d4c6)['then'](function(_0x99a8ba){_0x6d5362[_0x3249('0x1a')]=_0x99a8ba;if(_0x22a113['query'][_0x3249('0x3e')]){_0x325b9b[_0x3249('0x3f')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x325b9b);})[_0x3249('0x23')](function(_0x4769ba){_0x6d5362['rows']=_0x4769ba;return _0x6d5362;})[_0x3249('0x23')](respondWithFilteredResult(_0x202a1b,_0x325b9b))[_0x3249('0x40')](handleError(_0x202a1b,null));};exports[_0x3249('0x41')]=function(_0x1267d9,_0x1eada4){var _0x2e77fc={'raw':!![],'where':{'id':_0x1267d9[_0x3249('0x42')]['id']}},_0x20aa43={};_0x20aa43[_0x3249('0x2c')]=_['keys'](db[_0x3249('0x2a')][_0x3249('0x2b')]);_0x20aa43[_0x3249('0x2e')]=_[_0x3249('0x2d')](_0x1267d9['query']);_0x20aa43['filters']=_[_0x3249('0x30')](_0x20aa43[_0x3249('0x2c')],_0x20aa43[_0x3249('0x2e')]);_0x2e77fc[_0x3249('0x31')]=_['intersection'](_0x20aa43['model'],qs[_0x3249('0x32')](_0x1267d9[_0x3249('0x2e')][_0x3249('0x32')]));_0x2e77fc[_0x3249('0x31')]=_0x2e77fc['attributes'][_0x3249('0x33')]?_0x2e77fc[_0x3249('0x31')]:_0x20aa43[_0x3249('0x2c')];if(_0x1267d9[_0x3249('0x2e')][_0x3249('0x3e')]){_0x2e77fc[_0x3249('0x3f')]=[{'all':!![]}];}_0x2e77fc=_['merge']({},_0x2e77fc,_0x1267d9[_0x3249('0x43')]);return db[_0x3249('0x2a')]['find'](_0x2e77fc)[_0x3249('0x23')](handleEntityNotFound(_0x1eada4,null))[_0x3249('0x23')](respondWithResult(_0x1eada4,null))[_0x3249('0x40')](handleError(_0x1eada4,null));};exports['create']=function(_0x2fa345,_0x18210d){return db[_0x3249('0x2a')][_0x3249('0x44')](_0x2fa345[_0x3249('0x45')],{})[_0x3249('0x23')](respondWithResult(_0x18210d,0xc9))[_0x3249('0x40')](handleError(_0x18210d,null));};exports[_0x3249('0x22')]=function(_0x5e5c8f,_0x40a50c){if(_0x5e5c8f['body']['id']){delete _0x5e5c8f[_0x3249('0x45')]['id'];}return db[_0x3249('0x2a')][_0x3249('0x46')]({'where':{'id':_0x5e5c8f['params']['id']}})['then'](handleEntityNotFound(_0x40a50c,null))['then'](saveUpdates(_0x5e5c8f[_0x3249('0x45')],null))[_0x3249('0x23')](respondWithResult(_0x40a50c,null))[_0x3249('0x40')](handleError(_0x40a50c,null));};exports['destroy']=function(_0x381a9c,_0x4cf899){return db[_0x3249('0x2a')]['find']({'where':{'id':_0x381a9c[_0x3249('0x42')]['id']}})[_0x3249('0x23')](handleEntityNotFound(_0x4cf899,null))[_0x3249('0x23')](removeEntity(_0x4cf899,null))[_0x3249('0x40')](handleError(_0x4cf899,null));};exports[_0x3249('0x47')]=function(_0x59859d,_0x6ec7a6){return db[_0x3249('0x2a')][_0x3249('0x47')]()[_0x3249('0x23')](respondWithResult(_0x6ec7a6,null))[_0x3249('0x40')](handleError(_0x6ec7a6,null));}; \ No newline at end of file +var _0x5c3c=['then','destroy','sendStatus','error','stack','name','send','SquareReport','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','save','update'];(function(_0x2cbccc,_0x22226d){var _0x51e668=function(_0xfadc80){while(--_0xfadc80){_0x2cbccc['push'](_0x2cbccc['shift']());}};_0x51e668(++_0x22226d);}(_0x5c3c,0x197));var _0xc5c3=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x5c3c[_0x298ed3];return _0x5aad28;};'use strict';var pdf=require(_0xc5c3('0x0'));var emlformat=require(_0xc5c3('0x1'));var rimraf=require(_0xc5c3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc5c3('0x3'));var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require('path');var sox=require(_0xc5c3('0x8'));var csv=require(_0xc5c3('0x9'));var ejs=require(_0xc5c3('0xa'));var fs=require('fs');var _=require(_0xc5c3('0xb'));var squel=require(_0xc5c3('0xc'));var crypto=require(_0xc5c3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc5c3('0xe'));var toCsv=require(_0xc5c3('0x9'));var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require(_0xc5c3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc5c3('0x12'));var logger=require(_0xc5c3('0x13'))(_0xc5c3('0x14'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ed2a,_0x5389a1){_0x5389a1=_0x5389a1||0xcc;return function(_0x49dc1e){if(_0x49dc1e){return _0x29ed2a['sendStatus'](_0x5389a1);}return _0x29ed2a[_0xc5c3('0x16')](_0x5389a1)[_0xc5c3('0x17')]();};}function respondWithResult(_0x5cf3e,_0x25f296){_0x25f296=_0x25f296||0xc8;return function(_0x2d5bd7){if(_0x2d5bd7){return _0x5cf3e[_0xc5c3('0x16')](_0x25f296)[_0xc5c3('0x18')](_0x2d5bd7);}};}function respondWithFilteredResult(_0xe131ae,_0x565209){return function(_0x208326){if(_0x208326){var _0x3ff2fb=_0x208326[_0xc5c3('0x19')],_0x2a7d83=_0x565209[_0xc5c3('0x1a')],_0x5e7209=_0x565209[_0xc5c3('0x1a')]+_0x565209[_0xc5c3('0x1b')],_0x221b42;if(_0x5e7209>=_0x3ff2fb){_0x5e7209=_0x3ff2fb;_0x221b42=0xc8;}else{_0x221b42=0xce;}_0xe131ae['status'](_0x221b42);return _0xe131ae[_0xc5c3('0x1c')]('Content-Range',_0x2a7d83+'-'+_0x5e7209+'/'+_0x3ff2fb)['json'](_0x208326);}return null;};}function patchUpdates(_0x165080){return function(_0x5a8ce1){try{jsonpatch['apply'](_0x5a8ce1,_0x165080,!![]);}catch(_0x5a0483){return BPromise['reject'](_0x5a0483);}return _0x5a8ce1[_0xc5c3('0x1d')]();};}function saveUpdates(_0x596a8e,_0x5d21fd){return function(_0x1673f8){if(_0x1673f8){return _0x1673f8[_0xc5c3('0x1e')](_0x596a8e)[_0xc5c3('0x1f')](function(_0x99692){return _0x99692;});}return null;};}function removeEntity(_0x371640,_0x51dbc6){return function(_0x3d2ab4){if(_0x3d2ab4){return _0x3d2ab4[_0xc5c3('0x20')]()['then'](function(){_0x371640[_0xc5c3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1da7a0,_0x4e4f00){return function(_0x405466){if(!_0x405466){_0x1da7a0[_0xc5c3('0x21')](0x194);}return _0x405466;};}function handleError(_0x438da0,_0x4420e7){_0x4420e7=_0x4420e7||0x1f4;return function(_0x4e5dd9){logger[_0xc5c3('0x22')](_0x4e5dd9[_0xc5c3('0x23')]);if(_0x4e5dd9[_0xc5c3('0x24')]){delete _0x4e5dd9[_0xc5c3('0x24')];}_0x438da0[_0xc5c3('0x16')](_0x4420e7)[_0xc5c3('0x25')](_0x4e5dd9);};}exports['index']=function(_0x1a55fd,_0x2a9b78){var _0x296936={},_0x185234={},_0x1a817c={'count':0x0,'rows':[]};var _0x542ece=db[_0xc5c3('0x26')]['rawAttributes'];_0x185234[_0xc5c3('0x27')]=_[_0xc5c3('0x28')](_0x542ece);_0x185234['query']=_[_0xc5c3('0x28')](_0x1a55fd['query']);_0x185234[_0xc5c3('0x29')]=_[_0xc5c3('0x2a')](_0x185234[_0xc5c3('0x27')],_0x185234[_0xc5c3('0x2b')]);_0x296936[_0xc5c3('0x2c')]=_[_0xc5c3('0x2a')](_0x185234[_0xc5c3('0x27')],qs[_0xc5c3('0x2d')](_0x1a55fd['query'][_0xc5c3('0x2d')]));_0x296936[_0xc5c3('0x2c')]=_0x296936[_0xc5c3('0x2c')][_0xc5c3('0x2e')]?_0x296936['attributes']:_0x185234['model'];if(!_0x1a55fd['query'][_0xc5c3('0x2f')](_0xc5c3('0x30'))){_0x296936['limit']=qs[_0xc5c3('0x1b')](_0x1a55fd['query'][_0xc5c3('0x1b')]);_0x296936[_0xc5c3('0x1a')]=qs['offset'](_0x1a55fd[_0xc5c3('0x2b')][_0xc5c3('0x1a')]);}_0x296936[_0xc5c3('0x31')]=qs[_0xc5c3('0x32')](_0x1a55fd[_0xc5c3('0x2b')][_0xc5c3('0x32')]);_0x296936[_0xc5c3('0x33')]=qs['filters'](_[_0xc5c3('0x34')](_0x1a55fd[_0xc5c3('0x2b')],_0x185234[_0xc5c3('0x29')]));if(_0x1a55fd[_0xc5c3('0x2b')][_0xc5c3('0x35')]){_0x296936[_0xc5c3('0x33')]=_[_0xc5c3('0x36')](_0x296936[_0xc5c3('0x33')],{'$or':_[_0xc5c3('0x37')](_0x542ece,function(_0x390a82){if(_0x390a82[_0xc5c3('0x38')][_0xc5c3('0x39')]!==_0xc5c3('0x3a')){var _0x56df1f={};_0x56df1f[_0x390a82[_0xc5c3('0x3b')]]={'$like':'%'+_0x1a55fd[_0xc5c3('0x2b')][_0xc5c3('0x35')]+'%'};return _0x56df1f;}})});}_0x296936=_[_0xc5c3('0x36')]({},_0x296936,_0x1a55fd[_0xc5c3('0x3c')]);var _0x591307={'where':_0x296936[_0xc5c3('0x33')]};return db[_0xc5c3('0x26')]['count'](_0x591307)[_0xc5c3('0x1f')](function(_0x2b0fd0){_0x1a817c[_0xc5c3('0x19')]=_0x2b0fd0;if(_0x1a55fd[_0xc5c3('0x2b')]['includeAll']){_0x296936[_0xc5c3('0x3d')]=[{'all':!![]}];}return db[_0xc5c3('0x26')][_0xc5c3('0x3e')](_0x296936);})['then'](function(_0x59ab90){_0x1a817c[_0xc5c3('0x3f')]=_0x59ab90;return _0x1a817c;})[_0xc5c3('0x1f')](respondWithFilteredResult(_0x2a9b78,_0x296936))[_0xc5c3('0x40')](handleError(_0x2a9b78,null));};exports[_0xc5c3('0x41')]=function(_0x1ed39b,_0x29979a){var _0x2f2987={'raw':!![],'where':{'id':_0x1ed39b[_0xc5c3('0x42')]['id']}},_0x30ed31={};_0x30ed31[_0xc5c3('0x27')]=_['keys'](db[_0xc5c3('0x26')][_0xc5c3('0x43')]);_0x30ed31['query']=_['keys'](_0x1ed39b['query']);_0x30ed31[_0xc5c3('0x29')]=_[_0xc5c3('0x2a')](_0x30ed31['model'],_0x30ed31[_0xc5c3('0x2b')]);_0x2f2987[_0xc5c3('0x2c')]=_[_0xc5c3('0x2a')](_0x30ed31['model'],qs[_0xc5c3('0x2d')](_0x1ed39b['query'][_0xc5c3('0x2d')]));_0x2f2987['attributes']=_0x2f2987[_0xc5c3('0x2c')][_0xc5c3('0x2e')]?_0x2f2987['attributes']:_0x30ed31[_0xc5c3('0x27')];if(_0x1ed39b[_0xc5c3('0x2b')][_0xc5c3('0x44')]){_0x2f2987[_0xc5c3('0x3d')]=[{'all':!![]}];}_0x2f2987=_[_0xc5c3('0x36')]({},_0x2f2987,_0x1ed39b[_0xc5c3('0x3c')]);return db['SquareReport'][_0xc5c3('0x45')](_0x2f2987)[_0xc5c3('0x1f')](handleEntityNotFound(_0x29979a,null))[_0xc5c3('0x1f')](respondWithResult(_0x29979a,null))[_0xc5c3('0x40')](handleError(_0x29979a,null));};exports[_0xc5c3('0x46')]=function(_0x1cfc9a,_0x51bc59){return db['SquareReport'][_0xc5c3('0x46')](_0x1cfc9a[_0xc5c3('0x47')],{})[_0xc5c3('0x1f')](respondWithResult(_0x51bc59,0xc9))[_0xc5c3('0x40')](handleError(_0x51bc59,null));};exports['update']=function(_0x189b09,_0x37625c){if(_0x189b09[_0xc5c3('0x47')]['id']){delete _0x189b09[_0xc5c3('0x47')]['id'];}return db[_0xc5c3('0x26')][_0xc5c3('0x45')]({'where':{'id':_0x189b09[_0xc5c3('0x42')]['id']}})[_0xc5c3('0x1f')](handleEntityNotFound(_0x37625c,null))['then'](saveUpdates(_0x189b09['body'],null))[_0xc5c3('0x1f')](respondWithResult(_0x37625c,null))[_0xc5c3('0x40')](handleError(_0x37625c,null));};exports[_0xc5c3('0x20')]=function(_0x1a49e0,_0x457d63){return db[_0xc5c3('0x26')][_0xc5c3('0x45')]({'where':{'id':_0x1a49e0[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x457d63,null))['then'](removeEntity(_0x457d63,null))[_0xc5c3('0x40')](handleError(_0x457d63,null));};exports['describe']=function(_0xf63bf1,_0x2c51f3){return db[_0xc5c3('0x26')][_0xc5c3('0x48')]()[_0xc5c3('0x1f')](respondWithResult(_0x2c51f3,null))[_0xc5c3('0x40')](handleError(_0x2c51f3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5437631..b38dc62 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 _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x45d6ab,_0x5dd3e9){var _0x4320c8=function(_0x20de09){while(--_0x20de09){_0x45d6ab['push'](_0x45d6ab['shift']());}};_0x4320c8(++_0x5dd3e9);}(_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':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x45f39c,_0x1acddc){var _0x47b48c=function(_0x2a1940){while(--_0x2a1940){_0x45f39c['push'](_0x45f39c['shift']());}};_0x47b48c(++_0x1acddc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 06c61ef..1472a20 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 _0xa533=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','then','UpdateSquareReport','body','raw','where','attributes','moment','bluebird'];(function(_0x4d52f0,_0x2e666d){var _0x2938ae=function(_0x170ac8){while(--_0x170ac8){_0x4d52f0['push'](_0x4d52f0['shift']());}};_0x2938ae(++_0x2e666d);}(_0xa533,0x13e));var _0x3a53=function(_0x392cc6,_0x3031f7){_0x392cc6=_0x392cc6-0x0;var _0x3f9f22=_0xa533[_0x392cc6];return _0x3f9f22;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a53('0x0'));var BPromise=require(_0x3a53('0x1'));var rs=require(_0x3a53('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a53('0x3'))['db'];var utils=require(_0x3a53('0x4'));var logger=require(_0x3a53('0x5'))(_0x3a53('0x6'));var config=require(_0x3a53('0x7'));var jayson=require(_0x3a53('0x8'));var client=jayson[_0x3a53('0x9')][_0x3a53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcad27,_0x143868,_0x2b9c28){return new BPromise(function(_0x5da482,_0x160b75){return client['request'](_0xcad27,_0x2b9c28)['then'](function(_0x12475c){logger[_0x3a53('0xb')](_0x3a53('0xc'),_0x143868,_0x3a53('0xd'));logger[_0x3a53('0xe')](_0x3a53('0xf'),_0x143868,_0x3a53('0xd'),JSON[_0x3a53('0x10')](_0x12475c));if(_0x12475c[_0x3a53('0x11')]){if(_0x12475c[_0x3a53('0x11')][_0x3a53('0x12')]===0x1f4){logger['error'](_0x3a53('0xc'),_0x143868,_0x12475c['error'][_0x3a53('0x13')]);return _0x160b75(_0x12475c[_0x3a53('0x11')][_0x3a53('0x13')]);}logger[_0x3a53('0x11')](_0x3a53('0xc'),_0x143868,_0x12475c['error'][_0x3a53('0x13')]);return _0x5da482(_0x12475c[_0x3a53('0x11')][_0x3a53('0x13')]);}else{logger[_0x3a53('0xb')](_0x3a53('0xc'),_0x143868,'request\x20sent');_0x5da482(_0x12475c[_0x3a53('0x14')][_0x3a53('0x13')]);}})[_0x3a53('0x15')](function(_0x4eb752){logger[_0x3a53('0x11')]('SquareReport,\x20%s,\x20%s',_0x143868,_0x4eb752);_0x160b75(_0x4eb752);});});}exports[_0x3a53('0x16')]=function(_0x24e356){var _0x3c1213=this;return new Promise(function(_0x3acef8,_0x1f251f){return db[_0x3a53('0x17')][_0x3a53('0x18')](_0x24e356['body'],{'raw':_0x24e356[_0x3a53('0x19')]?_0x24e356[_0x3a53('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3a53('0x1a')](function(_0x17d063){logger[_0x3a53('0xb')]('CreateSquareReport',_0x24e356);logger[_0x3a53('0xe')](_0x3a53('0x16'),_0x24e356,JSON[_0x3a53('0x10')](_0x17d063));_0x3acef8(_0x17d063);})[_0x3a53('0x15')](function(_0x5dcf5f){logger[_0x3a53('0x11')]('CreateSquareReport',_0x5dcf5f['message'],_0x24e356);_0x1f251f(_0x3c1213['error'](0x1f4,_0x5dcf5f['message']));});});};exports[_0x3a53('0x1b')]=function(_0x2d2b45){var _0x365593=this;return new Promise(function(_0x1f3c89,_0x391047){return db[_0x3a53('0x17')]['update'](_0x2d2b45[_0x3a53('0x1c')],{'raw':_0x2d2b45[_0x3a53('0x19')]?_0x2d2b45['options'][_0x3a53('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d2b45[_0x3a53('0x19')]?_0x2d2b45['options'][_0x3a53('0x1e')]||null:null,'attributes':_0x2d2b45['options']?_0x2d2b45[_0x3a53('0x19')][_0x3a53('0x1f')]||null:null,'limit':_0x2d2b45[_0x3a53('0x19')]?_0x2d2b45[_0x3a53('0x19')]['limit']||null:null})[_0x3a53('0x1a')](function(_0x467892){logger[_0x3a53('0xb')](_0x3a53('0x1b'),_0x2d2b45);logger['debug'](_0x3a53('0x1b'),_0x2d2b45,JSON['stringify'](_0x467892));_0x1f3c89(_0x467892);})[_0x3a53('0x15')](function(_0x71f734){logger['error'](_0x3a53('0x1b'),_0x71f734[_0x3a53('0x13')],_0x2d2b45);_0x391047(_0x365593[_0x3a53('0x11')](0x1f4,_0x71f734['message']));});});}; \ No newline at end of file +var _0xa338=['info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareReport','create','body','options','then','debug','UpdateSquareReport','SquareReport','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x207854,_0x21ec4e){var _0x4e38bc=function(_0x5ed11f){while(--_0x5ed11f){_0x207854['push'](_0x207854['shift']());}};_0x4e38bc(++_0x21ec4e);}(_0xa338,0xf6));var _0x8a33=function(_0x2a0b99,_0x3ff6a5){_0x2a0b99=_0x2a0b99-0x0;var _0x4ddf7d=_0xa338[_0x2a0b99];return _0x4ddf7d;};'use strict';var _=require('lodash');var util=require(_0x8a33('0x0'));var moment=require('moment');var BPromise=require(_0x8a33('0x1'));var rs=require(_0x8a33('0x2'));var fs=require('fs');var Redis=require(_0x8a33('0x3'));var db=require(_0x8a33('0x4'))['db'];var utils=require(_0x8a33('0x5'));var logger=require('../../config/logger')(_0x8a33('0x6'));var config=require(_0x8a33('0x7'));var jayson=require(_0x8a33('0x8'));var client=jayson[_0x8a33('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdfbf98,_0x5ef44f,_0x5793a2){return new BPromise(function(_0x1a71dd,_0x24f025){return client['request'](_0xdfbf98,_0x5793a2)['then'](function(_0x45a057){logger[_0x8a33('0xa')](_0x8a33('0xb'),_0x5ef44f,'request\x20sent');logger['debug'](_0x8a33('0xc'),_0x5ef44f,_0x8a33('0xd'),JSON[_0x8a33('0xe')](_0x45a057));if(_0x45a057[_0x8a33('0xf')]){if(_0x45a057[_0x8a33('0xf')][_0x8a33('0x10')]===0x1f4){logger[_0x8a33('0xf')](_0x8a33('0xb'),_0x5ef44f,_0x45a057[_0x8a33('0xf')]['message']);return _0x24f025(_0x45a057[_0x8a33('0xf')][_0x8a33('0x11')]);}logger['error'](_0x8a33('0xb'),_0x5ef44f,_0x45a057[_0x8a33('0xf')][_0x8a33('0x11')]);return _0x1a71dd(_0x45a057[_0x8a33('0xf')][_0x8a33('0x11')]);}else{logger[_0x8a33('0xa')](_0x8a33('0xb'),_0x5ef44f,'request\x20sent');_0x1a71dd(_0x45a057['result'][_0x8a33('0x11')]);}})[_0x8a33('0x12')](function(_0x44c184){logger[_0x8a33('0xf')]('SquareReport,\x20%s,\x20%s',_0x5ef44f,_0x44c184);_0x24f025(_0x44c184);});});}exports[_0x8a33('0x13')]=function(_0xca3030){var _0x239181=this;return new Promise(function(_0x24718f,_0x3f0f70){return db['SquareReport'][_0x8a33('0x14')](_0xca3030[_0x8a33('0x15')],{'raw':_0xca3030[_0x8a33('0x16')]?_0xca3030[_0x8a33('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x8a33('0x17')](function(_0x365a3a){logger[_0x8a33('0xa')]('CreateSquareReport',_0xca3030);logger[_0x8a33('0x18')](_0x8a33('0x13'),_0xca3030,JSON['stringify'](_0x365a3a));_0x24718f(_0x365a3a);})[_0x8a33('0x12')](function(_0x20b977){logger[_0x8a33('0xf')](_0x8a33('0x13'),_0x20b977[_0x8a33('0x11')],_0xca3030);_0x3f0f70(_0x239181['error'](0x1f4,_0x20b977[_0x8a33('0x11')]));});});};exports[_0x8a33('0x19')]=function(_0x5b90ff){var _0x2f6fae=this;return new Promise(function(_0x2f4b27,_0x3e1b17){return db[_0x8a33('0x1a')][_0x8a33('0x1b')](_0x5b90ff[_0x8a33('0x15')],{'raw':_0x5b90ff['options']?_0x5b90ff['options'][_0x8a33('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b90ff[_0x8a33('0x16')]?_0x5b90ff[_0x8a33('0x16')][_0x8a33('0x1d')]||null:null,'attributes':_0x5b90ff['options']?_0x5b90ff[_0x8a33('0x16')][_0x8a33('0x1e')]||null:null,'limit':_0x5b90ff['options']?_0x5b90ff['options'][_0x8a33('0x1f')]||null:null})['then'](function(_0x13f5c6){logger['info'](_0x8a33('0x19'),_0x5b90ff);logger[_0x8a33('0x18')]('UpdateSquareReport',_0x5b90ff,JSON[_0x8a33('0xe')](_0x13f5c6));_0x2f4b27(_0x13f5c6);})[_0x8a33('0x12')](function(_0x116a34){logger[_0x8a33('0xf')](_0x8a33('0x19'),_0x116a34[_0x8a33('0x11')],_0x5b90ff);_0x3e1b17(_0x2f6fae[_0x8a33('0xf')](0x1f4,_0x116a34[_0x8a33('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ed70831..e955606 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 _0x777d=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','util'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x777d,0x1da));var _0xd777=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0x777d[_0x3f4a8e];return _0x7f68fd;};'use strict';var multer=require('multer');var util=require(_0xd777('0x0'));var path=require(_0xd777('0x1'));var timeout=require(_0xd777('0x2'));var express=require(_0xd777('0x3'));var router=express['Router']();var auth=require(_0xd777('0x4'));var interaction=require(_0xd777('0x5'));var config=require(_0xd777('0x6'));var controller=require(_0xd777('0x7'));router[_0xd777('0x8')]('/',auth[_0xd777('0x9')](),controller[_0xd777('0xa')]);router[_0xd777('0x8')](_0xd777('0xb'),auth[_0xd777('0x9')](),controller[_0xd777('0xc')]);router['get'](_0xd777('0xd'),auth[_0xd777('0x9')](),controller[_0xd777('0xe')]);router['post']('/',auth[_0xd777('0x9')](),controller[_0xd777('0xf')]);router['put'](_0xd777('0xd'),auth[_0xd777('0x9')](),controller[_0xd777('0x10')]);router[_0xd777('0x11')](_0xd777('0xd'),auth[_0xd777('0x9')](),controller[_0xd777('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa0c5=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x6afc9c,_0xf6b755){var _0x195d68=function(_0x48f1eb){while(--_0x48f1eb){_0x6afc9c['push'](_0x6afc9c['shift']());}};_0x195d68(++_0xf6b755);}(_0xa0c5,0xd1));var _0x5a0c=function(_0x25656f,_0x4cf8be){_0x25656f=_0x25656f-0x0;var _0x6e703f=_0xa0c5[_0x25656f];return _0x6e703f;};'use strict';var multer=require(_0x5a0c('0x0'));var util=require(_0x5a0c('0x1'));var path=require(_0x5a0c('0x2'));var timeout=require(_0x5a0c('0x3'));var express=require(_0x5a0c('0x4'));var router=express[_0x5a0c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5a0c('0x6'));var config=require(_0x5a0c('0x7'));var controller=require(_0x5a0c('0x8'));router[_0x5a0c('0x9')]('/',auth[_0x5a0c('0xa')](),controller['index']);router[_0x5a0c('0x9')](_0x5a0c('0xb'),auth[_0x5a0c('0xa')](),controller['describe']);router[_0x5a0c('0x9')]('/:id',auth[_0x5a0c('0xa')](),controller[_0x5a0c('0xc')]);router[_0x5a0c('0xd')]('/',auth['isAuthenticated'](),controller[_0x5a0c('0xe')]);router[_0x5a0c('0xf')](_0x5a0c('0x10'),auth[_0x5a0c('0xa')](),controller[_0x5a0c('0x11')]);router[_0x5a0c('0x12')](_0x5a0c('0x10'),auth[_0x5a0c('0xa')](),controller[_0x5a0c('0x13')]);module[_0x5a0c('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 1bfa6bf..b14cc9f 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 _0x32e0=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e0,0x15d));var _0x032e=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x32e0[_0x25662e];return _0x59b7bc;};'use strict';var Sequelize=require(_0x032e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x032e('0x1')]},'node':{'type':Sequelize[_0x032e('0x1')]},'application':{'type':Sequelize[_0x032e('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x025f=['exports','STRING','TEXT','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x025f,0x1cb));var _0xf025=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x025f[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xf025('0x0'));module[_0xf025('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xf025('0x2')]},'application':{'type':Sequelize[_0xf025('0x2')]},'data':{'type':Sequelize[_0xf025('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf025('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8ed3afa..34bf656 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 _0x9235=['fields','hasOwnProperty','limit','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x31ab90,_0x145a96){var _0x2d6123=function(_0x2bf73f){while(--_0x2bf73f){_0x31ab90['push'](_0x31ab90['shift']());}};_0x2d6123(++_0x145a96);}(_0x9235,0x1dc));var _0x5923=function(_0x20594a,_0x296861){_0x20594a=_0x20594a-0x0;var _0x8c51ec=_0x9235[_0x20594a];return _0x8c51ec;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5923('0x0'));var rimraf=require(_0x5923('0x1'));var zipdir=require(_0x5923('0x2'));var jsonpatch=require(_0x5923('0x3'));var rp=require(_0x5923('0x4'));var moment=require('moment');var BPromise=require(_0x5923('0x5'));var Mustache=require(_0x5923('0x6'));var util=require(_0x5923('0x7'));var path=require('path');var sox=require(_0x5923('0x8'));var csv=require(_0x5923('0x9'));var ejs=require(_0x5923('0xa'));var fs=require('fs');var _=require(_0x5923('0xb'));var squel=require(_0x5923('0xc'));var crypto=require(_0x5923('0xd'));var jsforce=require(_0x5923('0xe'));var deskjs=require(_0x5923('0xf'));var toCsv=require(_0x5923('0x9'));var querystring=require(_0x5923('0x10'));var Papa=require(_0x5923('0x11'));var Redis=require('ioredis');var authService=require(_0x5923('0x12'));var qs=require(_0x5923('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5923('0x14'))(_0x5923('0x15'));var utils=require(_0x5923('0x16'));var config=require(_0x5923('0x17'));var db=require(_0x5923('0x18'))['db'];function respondWithStatusCode(_0x2283b9,_0x4f9795){_0x4f9795=_0x4f9795||0xcc;return function(_0x46fc3a){if(_0x46fc3a){return _0x2283b9[_0x5923('0x19')](_0x4f9795);}return _0x2283b9[_0x5923('0x1a')](_0x4f9795)['end']();};}function respondWithResult(_0xdc9f58,_0x56a6b9){_0x56a6b9=_0x56a6b9||0xc8;return function(_0x1238fd){if(_0x1238fd){return _0xdc9f58[_0x5923('0x1a')](_0x56a6b9)[_0x5923('0x1b')](_0x1238fd);}};}function respondWithFilteredResult(_0x2bb896,_0x124242){return function(_0x13e364){if(_0x13e364){var _0xfd2476=_0x13e364[_0x5923('0x1c')],_0x32d7ca=_0x124242[_0x5923('0x1d')],_0x519048=_0x124242['offset']+_0x124242['limit'],_0x47eb7a;if(_0x519048>=_0xfd2476){_0x519048=_0xfd2476;_0x47eb7a=0xc8;}else{_0x47eb7a=0xce;}_0x2bb896['status'](_0x47eb7a);return _0x2bb896[_0x5923('0x1e')](_0x5923('0x1f'),_0x32d7ca+'-'+_0x519048+'/'+_0xfd2476)['json'](_0x13e364);}return null;};}function patchUpdates(_0x517c1a){return function(_0x12a096){try{jsonpatch['apply'](_0x12a096,_0x517c1a,!![]);}catch(_0x29bb80){return BPromise['reject'](_0x29bb80);}return _0x12a096[_0x5923('0x20')]();};}function saveUpdates(_0x424b2b,_0x4e0c60){return function(_0x4facea){if(_0x4facea){return _0x4facea[_0x5923('0x21')](_0x424b2b)['then'](function(_0x25b402){return _0x25b402;});}return null;};}function removeEntity(_0x4fcb47,_0x2f362e){return function(_0x2bcc21){if(_0x2bcc21){return _0x2bcc21[_0x5923('0x22')]()[_0x5923('0x23')](function(){_0x4fcb47['status'](0xcc)[_0x5923('0x24')]();});}};}function handleEntityNotFound(_0x41b8cc,_0x1dcbf6){return function(_0x427141){if(!_0x427141){_0x41b8cc['sendStatus'](0x194);}return _0x427141;};}function handleError(_0x4de7a0,_0xa93476){_0xa93476=_0xa93476||0x1f4;return function(_0x59e52e){logger[_0x5923('0x25')](_0x59e52e[_0x5923('0x26')]);if(_0x59e52e[_0x5923('0x27')]){delete _0x59e52e[_0x5923('0x27')];}_0x4de7a0[_0x5923('0x1a')](_0xa93476)[_0x5923('0x28')](_0x59e52e);};}exports['index']=function(_0x32f6e7,_0xda8f9){var _0x1afb83={},_0x1993a7={},_0x31ce0d={'count':0x0,'rows':[]};var _0x50086a=db[_0x5923('0x29')][_0x5923('0x2a')];_0x1993a7[_0x5923('0x2b')]=_[_0x5923('0x2c')](_0x50086a);_0x1993a7[_0x5923('0x2d')]=_[_0x5923('0x2c')](_0x32f6e7[_0x5923('0x2d')]);_0x1993a7[_0x5923('0x2e')]=_[_0x5923('0x2f')](_0x1993a7[_0x5923('0x2b')],_0x1993a7[_0x5923('0x2d')]);_0x1afb83[_0x5923('0x30')]=_[_0x5923('0x2f')](_0x1993a7[_0x5923('0x2b')],qs[_0x5923('0x31')](_0x32f6e7['query'][_0x5923('0x31')]));_0x1afb83[_0x5923('0x30')]=_0x1afb83['attributes']['length']?_0x1afb83[_0x5923('0x30')]:_0x1993a7[_0x5923('0x2b')];if(!_0x32f6e7[_0x5923('0x2d')][_0x5923('0x32')]('nolimit')){_0x1afb83['limit']=qs[_0x5923('0x33')](_0x32f6e7[_0x5923('0x2d')][_0x5923('0x33')]);_0x1afb83[_0x5923('0x1d')]=qs['offset'](_0x32f6e7[_0x5923('0x2d')][_0x5923('0x1d')]);}_0x1afb83['order']=qs['sort'](_0x32f6e7['query'][_0x5923('0x34')]);_0x1afb83['where']=qs['filters'](_[_0x5923('0x35')](_0x32f6e7[_0x5923('0x2d')],_0x1993a7['filters']));if(_0x32f6e7[_0x5923('0x2d')][_0x5923('0x36')]){_0x1afb83[_0x5923('0x37')]=_['merge'](_0x1afb83[_0x5923('0x37')],{'$or':_[_0x5923('0x38')](_0x50086a,function(_0x5eaacd){if(_0x5eaacd[_0x5923('0x39')][_0x5923('0x3a')]!==_0x5923('0x3b')){var _0x312422={};_0x312422[_0x5eaacd[_0x5923('0x3c')]]={'$like':'%'+_0x32f6e7['query'][_0x5923('0x36')]+'%'};return _0x312422;}})});}_0x1afb83=_[_0x5923('0x3d')]({},_0x1afb83,_0x32f6e7['options']);var _0x4614ee={'where':_0x1afb83[_0x5923('0x37')]};return db[_0x5923('0x29')][_0x5923('0x1c')](_0x4614ee)['then'](function(_0x22097b){_0x31ce0d['count']=_0x22097b;if(_0x32f6e7[_0x5923('0x2d')][_0x5923('0x3e')]){_0x1afb83[_0x5923('0x3f')]=[{'all':!![]}];}return db[_0x5923('0x29')][_0x5923('0x40')](_0x1afb83);})[_0x5923('0x23')](function(_0x2fe5c0){_0x31ce0d[_0x5923('0x41')]=_0x2fe5c0;return _0x31ce0d;})['then'](respondWithFilteredResult(_0xda8f9,_0x1afb83))[_0x5923('0x42')](handleError(_0xda8f9,null));};exports[_0x5923('0x43')]=function(_0x145003,_0x28b864){var _0x21f86b={'raw':!![],'where':{'id':_0x145003[_0x5923('0x44')]['id']}},_0x4d414a={};_0x4d414a[_0x5923('0x2b')]=_['keys'](db[_0x5923('0x29')]['rawAttributes']);_0x4d414a[_0x5923('0x2d')]=_[_0x5923('0x2c')](_0x145003[_0x5923('0x2d')]);_0x4d414a[_0x5923('0x2e')]=_[_0x5923('0x2f')](_0x4d414a[_0x5923('0x2b')],_0x4d414a[_0x5923('0x2d')]);_0x21f86b['attributes']=_[_0x5923('0x2f')](_0x4d414a[_0x5923('0x2b')],qs['fields'](_0x145003[_0x5923('0x2d')][_0x5923('0x31')]));_0x21f86b[_0x5923('0x30')]=_0x21f86b[_0x5923('0x30')][_0x5923('0x45')]?_0x21f86b[_0x5923('0x30')]:_0x4d414a['model'];if(_0x145003[_0x5923('0x2d')][_0x5923('0x3e')]){_0x21f86b[_0x5923('0x3f')]=[{'all':!![]}];}_0x21f86b=_[_0x5923('0x3d')]({},_0x21f86b,_0x145003[_0x5923('0x46')]);return db[_0x5923('0x29')][_0x5923('0x47')](_0x21f86b)['then'](handleEntityNotFound(_0x28b864,null))[_0x5923('0x23')](respondWithResult(_0x28b864,null))[_0x5923('0x42')](handleError(_0x28b864,null));};exports[_0x5923('0x48')]=function(_0x54e176,_0x42fd43){return db[_0x5923('0x29')]['create'](_0x54e176[_0x5923('0x49')],{})[_0x5923('0x23')](respondWithResult(_0x42fd43,0xc9))[_0x5923('0x42')](handleError(_0x42fd43,null));};exports['update']=function(_0x471b0c,_0x579fde){if(_0x471b0c['body']['id']){delete _0x471b0c[_0x5923('0x49')]['id'];}return db['SquareDetailsReport'][_0x5923('0x47')]({'where':{'id':_0x471b0c[_0x5923('0x44')]['id']}})['then'](handleEntityNotFound(_0x579fde,null))[_0x5923('0x23')](saveUpdates(_0x471b0c['body'],null))[_0x5923('0x23')](respondWithResult(_0x579fde,null))[_0x5923('0x42')](handleError(_0x579fde,null));};exports[_0x5923('0x22')]=function(_0x504a84,_0x820fd3){return db[_0x5923('0x29')][_0x5923('0x47')]({'where':{'id':_0x504a84['params']['id']}})[_0x5923('0x23')](handleEntityNotFound(_0x820fd3,null))['then'](removeEntity(_0x820fd3,null))[_0x5923('0x42')](handleError(_0x820fd3,null));};exports[_0x5923('0x4a')]=function(_0x1627b2,_0x2b0664){return db[_0x5923('0x29')][_0x5923('0x4a')]()[_0x5923('0x23')](respondWithResult(_0x2b0664,null))['catch'](handleError(_0x2b0664,null));}; \ No newline at end of file +var _0xe0cb=['pick','filter','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','SquareDetailsReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters'];(function(_0x3b2057,_0x4dc80d){var _0x1be262=function(_0x287d25){while(--_0x287d25){_0x3b2057['push'](_0x3b2057['shift']());}};_0x1be262(++_0x4dc80d);}(_0xe0cb,0xed));var _0xbe0c=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0xe0cb[_0x4d934b];return _0xc0338b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbe0c('0x0'));var rimraf=require(_0xbe0c('0x1'));var zipdir=require(_0xbe0c('0x2'));var jsonpatch=require(_0xbe0c('0x3'));var rp=require(_0xbe0c('0x4'));var moment=require(_0xbe0c('0x5'));var BPromise=require(_0xbe0c('0x6'));var Mustache=require(_0xbe0c('0x7'));var util=require(_0xbe0c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xbe0c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe0c('0xa'));var squel=require(_0xbe0c('0xb'));var crypto=require(_0xbe0c('0xc'));var jsforce=require(_0xbe0c('0xd'));var deskjs=require(_0xbe0c('0xe'));var toCsv=require(_0xbe0c('0x9'));var querystring=require(_0xbe0c('0xf'));var Papa=require(_0xbe0c('0x10'));var Redis=require('ioredis');var authService=require(_0xbe0c('0x11'));var qs=require(_0xbe0c('0x12'));var hardwareService=require(_0xbe0c('0x13'));var logger=require(_0xbe0c('0x14'))(_0xbe0c('0x15'));var utils=require(_0xbe0c('0x16'));var config=require(_0xbe0c('0x17'));var db=require(_0xbe0c('0x18'))['db'];function respondWithStatusCode(_0x598cc4,_0x5cba0c){_0x5cba0c=_0x5cba0c||0xcc;return function(_0x167d3a){if(_0x167d3a){return _0x598cc4[_0xbe0c('0x19')](_0x5cba0c);}return _0x598cc4[_0xbe0c('0x1a')](_0x5cba0c)[_0xbe0c('0x1b')]();};}function respondWithResult(_0x41f9b3,_0x280734){_0x280734=_0x280734||0xc8;return function(_0x4762da){if(_0x4762da){return _0x41f9b3['status'](_0x280734)[_0xbe0c('0x1c')](_0x4762da);}};}function respondWithFilteredResult(_0xdbe40f,_0x3c4ea4){return function(_0x26b28a){if(_0x26b28a){var _0x25d224=_0x26b28a[_0xbe0c('0x1d')],_0x523482=_0x3c4ea4[_0xbe0c('0x1e')],_0x2f7c5a=_0x3c4ea4[_0xbe0c('0x1e')]+_0x3c4ea4[_0xbe0c('0x1f')],_0xbe6b5c;if(_0x2f7c5a>=_0x25d224){_0x2f7c5a=_0x25d224;_0xbe6b5c=0xc8;}else{_0xbe6b5c=0xce;}_0xdbe40f['status'](_0xbe6b5c);return _0xdbe40f['set'](_0xbe0c('0x20'),_0x523482+'-'+_0x2f7c5a+'/'+_0x25d224)['json'](_0x26b28a);}return null;};}function patchUpdates(_0x246fb9){return function(_0x5bae5b){try{jsonpatch['apply'](_0x5bae5b,_0x246fb9,!![]);}catch(_0x1b2050){return BPromise['reject'](_0x1b2050);}return _0x5bae5b[_0xbe0c('0x21')]();};}function saveUpdates(_0x3597dc,_0x4f878d){return function(_0x468487){if(_0x468487){return _0x468487[_0xbe0c('0x22')](_0x3597dc)[_0xbe0c('0x23')](function(_0x5cb74a){return _0x5cb74a;});}return null;};}function removeEntity(_0x3ec6d9,_0x5ae24c){return function(_0x1a4f59){if(_0x1a4f59){return _0x1a4f59[_0xbe0c('0x24')]()[_0xbe0c('0x23')](function(){_0x3ec6d9[_0xbe0c('0x1a')](0xcc)[_0xbe0c('0x1b')]();});}};}function handleEntityNotFound(_0x36b5b9,_0x40703e){return function(_0x3bf2f8){if(!_0x3bf2f8){_0x36b5b9[_0xbe0c('0x19')](0x194);}return _0x3bf2f8;};}function handleError(_0x27c8dd,_0x1c9f3d){_0x1c9f3d=_0x1c9f3d||0x1f4;return function(_0x531aec){logger[_0xbe0c('0x25')](_0x531aec[_0xbe0c('0x26')]);if(_0x531aec[_0xbe0c('0x27')]){delete _0x531aec[_0xbe0c('0x27')];}_0x27c8dd['status'](_0x1c9f3d)[_0xbe0c('0x28')](_0x531aec);};}exports[_0xbe0c('0x29')]=function(_0x490094,_0x23041c){var _0x1c5a7b={},_0x155bb7={},_0x46f5ee={'count':0x0,'rows':[]};var _0x18d4d8=db[_0xbe0c('0x2a')][_0xbe0c('0x2b')];_0x155bb7[_0xbe0c('0x2c')]=_['keys'](_0x18d4d8);_0x155bb7[_0xbe0c('0x2d')]=_[_0xbe0c('0x2e')](_0x490094[_0xbe0c('0x2d')]);_0x155bb7['filters']=_[_0xbe0c('0x2f')](_0x155bb7[_0xbe0c('0x2c')],_0x155bb7[_0xbe0c('0x2d')]);_0x1c5a7b[_0xbe0c('0x30')]=_['intersection'](_0x155bb7[_0xbe0c('0x2c')],qs[_0xbe0c('0x31')](_0x490094['query'][_0xbe0c('0x31')]));_0x1c5a7b[_0xbe0c('0x30')]=_0x1c5a7b[_0xbe0c('0x30')][_0xbe0c('0x32')]?_0x1c5a7b[_0xbe0c('0x30')]:_0x155bb7[_0xbe0c('0x2c')];if(!_0x490094[_0xbe0c('0x2d')]['hasOwnProperty'](_0xbe0c('0x33'))){_0x1c5a7b[_0xbe0c('0x1f')]=qs[_0xbe0c('0x1f')](_0x490094[_0xbe0c('0x2d')]['limit']);_0x1c5a7b[_0xbe0c('0x1e')]=qs[_0xbe0c('0x1e')](_0x490094[_0xbe0c('0x2d')]['offset']);}_0x1c5a7b['order']=qs[_0xbe0c('0x34')](_0x490094[_0xbe0c('0x2d')][_0xbe0c('0x34')]);_0x1c5a7b[_0xbe0c('0x35')]=qs[_0xbe0c('0x36')](_[_0xbe0c('0x37')](_0x490094[_0xbe0c('0x2d')],_0x155bb7[_0xbe0c('0x36')]));if(_0x490094[_0xbe0c('0x2d')][_0xbe0c('0x38')]){_0x1c5a7b[_0xbe0c('0x35')]=_['merge'](_0x1c5a7b['where'],{'$or':_['map'](_0x18d4d8,function(_0x594318){if(_0x594318['type'][_0xbe0c('0x39')]!==_0xbe0c('0x3a')){var _0x1a4324={};_0x1a4324[_0x594318[_0xbe0c('0x3b')]]={'$like':'%'+_0x490094[_0xbe0c('0x2d')]['filter']+'%'};return _0x1a4324;}})});}_0x1c5a7b=_['merge']({},_0x1c5a7b,_0x490094[_0xbe0c('0x3c')]);var _0x57e941={'where':_0x1c5a7b[_0xbe0c('0x35')]};return db['SquareDetailsReport'][_0xbe0c('0x1d')](_0x57e941)[_0xbe0c('0x23')](function(_0x5bf227){_0x46f5ee[_0xbe0c('0x1d')]=_0x5bf227;if(_0x490094['query']['includeAll']){_0x1c5a7b[_0xbe0c('0x3d')]=[{'all':!![]}];}return db[_0xbe0c('0x2a')][_0xbe0c('0x3e')](_0x1c5a7b);})[_0xbe0c('0x23')](function(_0x2f056f){_0x46f5ee[_0xbe0c('0x3f')]=_0x2f056f;return _0x46f5ee;})[_0xbe0c('0x23')](respondWithFilteredResult(_0x23041c,_0x1c5a7b))[_0xbe0c('0x40')](handleError(_0x23041c,null));};exports[_0xbe0c('0x41')]=function(_0x35ff67,_0x37aec8){var _0x132604={'raw':!![],'where':{'id':_0x35ff67[_0xbe0c('0x42')]['id']}},_0x1bbca5={};_0x1bbca5['model']=_['keys'](db[_0xbe0c('0x2a')][_0xbe0c('0x2b')]);_0x1bbca5['query']=_[_0xbe0c('0x2e')](_0x35ff67['query']);_0x1bbca5[_0xbe0c('0x36')]=_[_0xbe0c('0x2f')](_0x1bbca5[_0xbe0c('0x2c')],_0x1bbca5[_0xbe0c('0x2d')]);_0x132604[_0xbe0c('0x30')]=_['intersection'](_0x1bbca5[_0xbe0c('0x2c')],qs['fields'](_0x35ff67[_0xbe0c('0x2d')][_0xbe0c('0x31')]));_0x132604[_0xbe0c('0x30')]=_0x132604[_0xbe0c('0x30')][_0xbe0c('0x32')]?_0x132604[_0xbe0c('0x30')]:_0x1bbca5[_0xbe0c('0x2c')];if(_0x35ff67['query'][_0xbe0c('0x43')]){_0x132604[_0xbe0c('0x3d')]=[{'all':!![]}];}_0x132604=_[_0xbe0c('0x44')]({},_0x132604,_0x35ff67['options']);return db[_0xbe0c('0x2a')][_0xbe0c('0x45')](_0x132604)['then'](handleEntityNotFound(_0x37aec8,null))[_0xbe0c('0x23')](respondWithResult(_0x37aec8,null))[_0xbe0c('0x40')](handleError(_0x37aec8,null));};exports[_0xbe0c('0x46')]=function(_0x2d3700,_0x479ee9){return db[_0xbe0c('0x2a')][_0xbe0c('0x46')](_0x2d3700[_0xbe0c('0x47')],{})[_0xbe0c('0x23')](respondWithResult(_0x479ee9,0xc9))['catch'](handleError(_0x479ee9,null));};exports[_0xbe0c('0x22')]=function(_0x28b083,_0x2558c3){if(_0x28b083[_0xbe0c('0x47')]['id']){delete _0x28b083[_0xbe0c('0x47')]['id'];}return db['SquareDetailsReport'][_0xbe0c('0x45')]({'where':{'id':_0x28b083['params']['id']}})[_0xbe0c('0x23')](handleEntityNotFound(_0x2558c3,null))[_0xbe0c('0x23')](saveUpdates(_0x28b083[_0xbe0c('0x47')],null))['then'](respondWithResult(_0x2558c3,null))[_0xbe0c('0x40')](handleError(_0x2558c3,null));};exports['destroy']=function(_0x45b274,_0x43707a){return db['SquareDetailsReport']['find']({'where':{'id':_0x45b274[_0xbe0c('0x42')]['id']}})[_0xbe0c('0x23')](handleEntityNotFound(_0x43707a,null))[_0xbe0c('0x23')](removeEntity(_0x43707a,null))[_0xbe0c('0x40')](handleError(_0x43707a,null));};exports['describe']=function(_0x26dd0d,_0x511d03){return db['SquareDetailsReport'][_0xbe0c('0x48')]()[_0xbe0c('0x23')](respondWithResult(_0x511d03,null))['catch'](handleError(_0x511d03,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b564b57..1dd8f70 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 _0x5bc1=['../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b8303,_0x2c8cc9){var _0x38c3a1=function(_0x214377){while(--_0x214377){_0x4b8303['push'](_0x4b8303['shift']());}};_0x38c3a1(++_0x2c8cc9);}(_0x5bc1,0xb5));var _0x15bc=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x5bc1[_0x333798];return _0x389f4e;};'use strict';var _=require('lodash');var util=require(_0x15bc('0x0'));var logger=require(_0x15bc('0x1'))(_0x15bc('0x2'));var moment=require(_0x15bc('0x3'));var BPromise=require(_0x15bc('0x4'));var rp=require(_0x15bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15bc('0x6'));var attributes=require(_0x15bc('0x7'));module[_0x15bc('0x8')]=function(_0x52766f,_0x109031){return _0x52766f['define'](_0x15bc('0x9'),attributes,{'tableName':_0x15bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67d1=['define','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x67d1,0xf1));var _0x167d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x67d1[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var logger=require(_0x167d('0x1'))('api');var moment=require(_0x167d('0x2'));var BPromise=require(_0x167d('0x3'));var rp=require(_0x167d('0x4'));var fs=require('fs');var path=require(_0x167d('0x5'));var rimraf=require('rimraf');var config=require(_0x167d('0x6'));var attributes=require(_0x167d('0x7'));module[_0x167d('0x8')]=function(_0xb7d8b7,_0x4960de){return _0xb7d8b7[_0x167d('0x9')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','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 bf2ea76..2394158 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 _0x79a8=['then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x79a8,0x1d0));var _0x879a=function(_0x4fb789,_0x6b8092){_0x4fb789=_0x4fb789-0x0;var _0x49b5e4=_0x79a8[_0x4fb789];return _0x49b5e4;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var moment=require(_0x879a('0x1'));var BPromise=require(_0x879a('0x2'));var rs=require(_0x879a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x879a('0x5'))(_0x879a('0x6'));var config=require(_0x879a('0x7'));var jayson=require(_0x879a('0x8'));var client=jayson[_0x879a('0x9')][_0x879a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d353e,_0x2427bf,_0x4bf3ab){return new BPromise(function(_0xe27fe6,_0x5cb5c9){return client[_0x879a('0xb')](_0x1d353e,_0x4bf3ab)[_0x879a('0xc')](function(_0x5eba04){logger[_0x879a('0xd')](_0x879a('0xe'),_0x2427bf,_0x879a('0xf'));logger['debug'](_0x879a('0x10'),_0x2427bf,_0x879a('0xf'),JSON['stringify'](_0x5eba04));if(_0x5eba04['error']){if(_0x5eba04[_0x879a('0x11')][_0x879a('0x12')]===0x1f4){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04['error'][_0x879a('0x13')]);return _0x5cb5c9(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);return _0xe27fe6(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}else{logger[_0x879a('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x2427bf,'request\x20sent');_0xe27fe6(_0x5eba04[_0x879a('0x14')][_0x879a('0x13')]);}})['catch'](function(_0x119260){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x119260);_0x5cb5c9(_0x119260);});});}exports[_0x879a('0x15')]=function(_0x32d9f5){var _0x61427a=this;return new Promise(function(_0x4160bd,_0x849ec5){return db[_0x879a('0x16')][_0x879a('0x17')](_0x32d9f5[_0x879a('0x18')],{'raw':_0x32d9f5[_0x879a('0x19')]?_0x32d9f5[_0x879a('0x19')][_0x879a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x830b36){logger[_0x879a('0xd')]('CreateSquareDetailsReport',_0x32d9f5);logger[_0x879a('0x1b')](_0x879a('0x15'),_0x32d9f5,JSON['stringify'](_0x830b36));_0x4160bd(_0x830b36);})['catch'](function(_0x4ed0d6){logger[_0x879a('0x11')](_0x879a('0x15'),_0x4ed0d6[_0x879a('0x13')],_0x32d9f5);_0x849ec5(_0x61427a[_0x879a('0x11')](0x1f4,_0x4ed0d6['message']));});});}; \ No newline at end of file +var _0x7f27=['create','body','options','raw','then','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x315270,_0xd76626){var _0x1918c5=function(_0x51db9c){while(--_0x51db9c){_0x315270['push'](_0x315270['shift']());}};_0x1918c5(++_0xd76626);}(_0x7f27,0x12e));var _0x77f2=function(_0x23f12f,_0x48f457){_0x23f12f=_0x23f12f-0x0;var _0x563de4=_0x7f27[_0x23f12f];return _0x563de4;};'use strict';var _=require(_0x77f2('0x0'));var util=require(_0x77f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x77f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77f2('0x3'));var logger=require(_0x77f2('0x4'))(_0x77f2('0x5'));var config=require('../../config/environment');var jayson=require(_0x77f2('0x6'));var client=jayson['client'][_0x77f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd68cb5,_0x5269e1,_0x1c1228){return new BPromise(function(_0x43121f,_0xae0da6){return client[_0x77f2('0x8')](_0xd68cb5,_0x1c1228)['then'](function(_0x7ef4f5){logger[_0x77f2('0x9')](_0x77f2('0xa'),_0x5269e1,_0x77f2('0xb'));logger[_0x77f2('0xc')](_0x77f2('0xd'),_0x5269e1,_0x77f2('0xb'),JSON[_0x77f2('0xe')](_0x7ef4f5));if(_0x7ef4f5[_0x77f2('0xf')]){if(_0x7ef4f5['error'][_0x77f2('0x10')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5269e1,_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);return _0xae0da6(_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);}logger[_0x77f2('0xf')](_0x77f2('0xa'),_0x5269e1,_0x7ef4f5['error'][_0x77f2('0x11')]);return _0x43121f(_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);}else{logger[_0x77f2('0x9')](_0x77f2('0xa'),_0x5269e1,_0x77f2('0xb'));_0x43121f(_0x7ef4f5[_0x77f2('0x12')][_0x77f2('0x11')]);}})[_0x77f2('0x13')](function(_0x58f6dd){logger[_0x77f2('0xf')](_0x77f2('0xa'),_0x5269e1,_0x58f6dd);_0xae0da6(_0x58f6dd);});});}exports[_0x77f2('0x14')]=function(_0xffdf18){var _0x2368ec=this;return new Promise(function(_0x4db73f,_0xefb59a){return db[_0x77f2('0x15')][_0x77f2('0x16')](_0xffdf18[_0x77f2('0x17')],{'raw':_0xffdf18[_0x77f2('0x18')]?_0xffdf18[_0x77f2('0x18')][_0x77f2('0x19')]===undefined?!![]:![]:!![]})[_0x77f2('0x1a')](function(_0x3a8ce2){logger[_0x77f2('0x9')](_0x77f2('0x14'),_0xffdf18);logger[_0x77f2('0xc')](_0x77f2('0x14'),_0xffdf18,JSON[_0x77f2('0xe')](_0x3a8ce2));_0x4db73f(_0x3a8ce2);})[_0x77f2('0x13')](function(_0x4a2599){logger[_0x77f2('0xf')](_0x77f2('0x14'),_0x4a2599[_0x77f2('0x11')],_0xffdf18);_0xefb59a(_0x2368ec[_0x77f2('0xf')](0x1f4,_0x4a2599[_0x77f2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 718bba9..704872a 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 _0x0689=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x2c768d,_0x5b3efb){var _0x2e0941=function(_0x3caae9){while(--_0x3caae9){_0x2c768d['push'](_0x2c768d['shift']());}};_0x2e0941(++_0x5b3efb);}(_0x0689,0x117));var _0x9068=function(_0x153faa,_0x75f2a){_0x153faa=_0x153faa-0x0;var _0x43c32a=_0x0689[_0x153faa];return _0x43c32a;};'use strict';var express=require(_0x9068('0x0'));var router=express[_0x9068('0x1')]();var auth=require(_0x9068('0x2'));var controller=require(_0x9068('0x3'));router[_0x9068('0x4')]('/',auth['isAuthenticated'](),controller[_0x9068('0x5')]);router[_0x9068('0x4')](_0x9068('0x6'),auth[_0x9068('0x7')](),controller[_0x9068('0x8')]);module['exports']=router; \ No newline at end of file +var _0xb277=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express','Router'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb277,0x139));var _0x7b27=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xb277[_0x110c3d];return _0x226d67;};'use strict';var express=require(_0x7b27('0x0'));var router=express[_0x7b27('0x1')]();var auth=require(_0x7b27('0x2'));var controller=require(_0x7b27('0x3'));router[_0x7b27('0x4')]('/',auth[_0x7b27('0x5')](),controller[_0x7b27('0x6')]);router[_0x7b27('0x4')](_0x7b27('0x7'),auth['isAuthenticated'](),controller['killProcess']);module[_0x7b27('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 10705a9..63529d9 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 _0xfc94=['pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc94,0xe1));var _0x4fc9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfc94[_0x40a045];return _0x1a687c;};'use strict';var info=require(_0x4fc9('0x0'));var exec=require(_0x4fc9('0x1'))['exec'];var logger=require('../../config/logger')('api');var util=require(_0x4fc9('0x2'));var BPromise=require(_0x4fc9('0x3'));var _=require('lodash');function handleError(_0x2ffebf,_0x39b602,_0x4c992f){_0x39b602=_0x39b602||0x1f4;return function(_0x5469de){logger[_0x4fc9('0x4')](_0x4fc9('0x5'),_0x4c992f,_0x39b602,util[_0x4fc9('0x6')](_0x5469de,{'showHidden':![],'depth':null}));delete _0x5469de[_0x4fc9('0x7')];_0x2ffebf[_0x4fc9('0x8')](_0x39b602)[_0x4fc9('0x9')](_0x5469de);};}exports['index']=function(_0x4db894,_0x48610d){return info[_0x4fc9('0xa')]()[_0x4fc9('0xb')](function(_0x314821){return _0x48610d[_0x4fc9('0x8')](0xc8)[_0x4fc9('0xc')](_0x314821);})[_0x4fc9('0xd')](function(_0x5a4e95){return _0x48610d[_0x4fc9('0x8')](0x1f4)[_0x4fc9('0xc')](_0x5a4e95);});};exports[_0x4fc9('0xe')]=function(_0x10f7b4,_0x213b89){var _0x4edf36=[_0x4fc9('0xf')];return new BPromise(function(_0x5eed67,_0x4766bb){return exec(util['format'](_0x4fc9('0x10'),_0x10f7b4[_0x4fc9('0x11')][_0x4fc9('0x12')]),function(_0x16d932,_0x5e21fc,_0x2a885e){if(_0x16d932){return _0x4766bb(_0x16d932);}return _0x5eed67(_0x5e21fc);});})['then'](function(_0x597939){var _0x48cc0a=![];var _0x5ef240=_0x597939[_0x4fc9('0x13')](/\n/);for(var _0x56c55b=0x0,_0x40e28a=_0x4edf36[_0x4fc9('0x14')];_0x56c55b<_0x40e28a,_0x48cc0a===![];_0x56c55b+=0x1){if(_0x597939[_0x4fc9('0x15')](_0x4edf36[_0x56c55b])>=0x0){_0x48cc0a=!![];}}if(!_0x48cc0a){throw new Error(util[_0x4fc9('0x16')](_0x4fc9('0x17'),_0x10f7b4['params']['pid']));}process[_0x4fc9('0x18')](_0x10f7b4[_0x4fc9('0x11')][_0x4fc9('0x12')],_0x4fc9('0x19'));return _0x213b89[_0x4fc9('0x8')](0xc8)['json']({'message':util['format'](_0x4fc9('0x1a'),_0x10f7b4[_0x4fc9('0x11')][_0x4fc9('0x12')])});})[_0x4fc9('0xd')](handleError(_0x213b89,null,'killProcess'));}; \ No newline at end of file +var _0x3da7=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','kill','json','catch','systeminformation','exec','api','bluebird','error'];(function(_0x5a8ff9,_0x418297){var _0x54e411=function(_0x3a1130){while(--_0x3a1130){_0x5a8ff9['push'](_0x5a8ff9['shift']());}};_0x54e411(++_0x418297);}(_0x3da7,0x154));var _0x73da=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x3da7[_0x3b5ad9];return _0x611ae9;};'use strict';var info=require(_0x73da('0x0'));var exec=require('child_process')[_0x73da('0x1')];var logger=require('../../config/logger')(_0x73da('0x2'));var util=require('util');var BPromise=require(_0x73da('0x3'));var _=require('lodash');function handleError(_0x2fb83a,_0x556e53,_0x2a2d72){_0x556e53=_0x556e53||0x1f4;return function(_0x134950){logger[_0x73da('0x4')](_0x73da('0x5'),_0x2a2d72,_0x556e53,util[_0x73da('0x6')](_0x134950,{'showHidden':![],'depth':null}));delete _0x134950[_0x73da('0x7')];_0x2fb83a[_0x73da('0x8')](_0x556e53)[_0x73da('0x9')](_0x134950);};}exports['index']=function(_0x207070,_0x773ec5){return info[_0x73da('0xa')]()['then'](function(_0x19a91d){return _0x773ec5[_0x73da('0x8')](0xc8)['json'](_0x19a91d);})['catch'](function(_0x1cbd62){return _0x773ec5[_0x73da('0x8')](0x1f4)['json'](_0x1cbd62);});};exports[_0x73da('0xb')]=function(_0x3ae116,_0x17a14f){var _0x3700f6=[_0x73da('0xc')];return new BPromise(function(_0x56205f,_0x2a0cdc){return exec(util[_0x73da('0xd')](_0x73da('0xe'),_0x3ae116[_0x73da('0xf')][_0x73da('0x10')]),function(_0x4ef0ac,_0x3485d2,_0xda295d){if(_0x4ef0ac){return _0x2a0cdc(_0x4ef0ac);}return _0x56205f(_0x3485d2);});})[_0x73da('0x11')](function(_0x3d48b3){var _0x4fd235=![];var _0x43c7e8=_0x3d48b3['split'](/\n/);for(var _0x10bbab=0x0,_0x516219=_0x3700f6[_0x73da('0x12')];_0x10bbab<_0x516219,_0x4fd235===![];_0x10bbab+=0x1){if(_0x3d48b3[_0x73da('0x13')](_0x3700f6[_0x10bbab])>=0x0){_0x4fd235=!![];}}if(!_0x4fd235){throw new Error(util[_0x73da('0xd')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3ae116[_0x73da('0xf')]['pid']));}process[_0x73da('0x14')](_0x3ae116['params'][_0x73da('0x10')],'SIGINT');return _0x17a14f[_0x73da('0x8')](0xc8)[_0x73da('0x15')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3ae116['params'][_0x73da('0x10')])});})[_0x73da('0x16')](handleError(_0x17a14f,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e1c7ec8..5e431b8 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 _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x5eb8[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['put'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports'];(function(_0x46fe8f,_0x1474ca){var _0x6ac068=function(_0x4552d9){while(--_0x4552d9){_0x46fe8f['push'](_0x46fe8f['shift']());}};_0x6ac068(++_0x1474ca);}(_0x0b0e,0x187));var _0xe0b0=function(_0x154584,_0x421e12){_0x154584=_0x154584-0x0;var _0x969074=_0x0b0e[_0x154584];return _0x969074;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0xc')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router[_0xe0b0('0xe')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xf')]);router['delete'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7b6bc8f..8a0452b 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 _0x4946=['sequelize','exports','name','STRING'];(function(_0x5b0c8a,_0x3db62a){var _0x50b946=function(_0x4f4b88){while(--_0x4f4b88){_0x5b0c8a['push'](_0x5b0c8a['shift']());}};_0x50b946(++_0x3db62a);}(_0x4946,0x1bc));var _0x6494=function(_0x47a204,_0x24b906){_0x47a204=_0x47a204-0x0;var _0x5623fc=_0x4946[_0x47a204];return _0x5623fc;};'use strict';var Sequelize=require(_0x6494('0x0'));module[_0x6494('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6494('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6494('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2c98=['STRING','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c98,0xf1));var _0x82c9=function(_0x238643,_0x36fa9c){_0x238643=_0x238643-0x0;var _0xd139ee=_0x2c98[_0x238643];return _0xd139ee;};'use strict';var Sequelize=require(_0x82c9('0x0'));module[_0x82c9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x82c9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x82c9('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x82c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f02e817..3371d03 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 _0xae10=['UserProfileResource','error','stack','name','send','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','findAll','rows','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x385ff1,_0x99847e){var _0x31e688=function(_0x20d64c){while(--_0x20d64c){_0x385ff1['push'](_0x385ff1['shift']());}};_0x31e688(++_0x99847e);}(_0xae10,0x1ad));var _0x0ae1=function(_0x54d857,_0x3dccec){_0x54d857=_0x54d857-0x0;var _0x4f26d5=_0xae10[_0x54d857];return _0x4f26d5;};'use strict';var pdf=require(_0x0ae1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0ae1('0x1'));var zipdir=require(_0x0ae1('0x2'));var jsonpatch=require(_0x0ae1('0x3'));var rp=require(_0x0ae1('0x4'));var moment=require(_0x0ae1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0ae1('0x6'));var util=require(_0x0ae1('0x7'));var path=require(_0x0ae1('0x8'));var sox=require(_0x0ae1('0x9'));var csv=require(_0x0ae1('0xa'));var ejs=require(_0x0ae1('0xb'));var fs=require('fs');var _=require(_0x0ae1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0ae1('0xd'));var deskjs=require(_0x0ae1('0xe'));var toCsv=require(_0x0ae1('0xa'));var querystring=require('querystring');var Papa=require(_0x0ae1('0xf'));var Redis=require(_0x0ae1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0ae1('0x11'));var logger=require('../../config/logger')(_0x0ae1('0x12'));var utils=require(_0x0ae1('0x13'));var config=require('../../config/environment');var db=require(_0x0ae1('0x14'))['db'];function respondWithStatusCode(_0x3279c6,_0x49192d){_0x49192d=_0x49192d||0xcc;return function(_0x27a9e5){if(_0x27a9e5){return _0x3279c6['sendStatus'](_0x49192d);}return _0x3279c6[_0x0ae1('0x15')](_0x49192d)[_0x0ae1('0x16')]();};}function respondWithResult(_0x51f4bb,_0x1d8a22){_0x1d8a22=_0x1d8a22||0xc8;return function(_0x198093){if(_0x198093){return _0x51f4bb[_0x0ae1('0x15')](_0x1d8a22)[_0x0ae1('0x17')](_0x198093);}};}function respondWithFilteredResult(_0x5a1c80,_0x4c51dd){return function(_0x3efe4b){if(_0x3efe4b){var _0x5ddcc9=_0x3efe4b[_0x0ae1('0x18')],_0x25772b=_0x4c51dd['offset'],_0x3a92e1=_0x4c51dd[_0x0ae1('0x19')]+_0x4c51dd['limit'],_0x1fedb3;if(_0x3a92e1>=_0x5ddcc9){_0x3a92e1=_0x5ddcc9;_0x1fedb3=0xc8;}else{_0x1fedb3=0xce;}_0x5a1c80[_0x0ae1('0x15')](_0x1fedb3);return _0x5a1c80[_0x0ae1('0x1a')](_0x0ae1('0x1b'),_0x25772b+'-'+_0x3a92e1+'/'+_0x5ddcc9)['json'](_0x3efe4b);}return null;};}function patchUpdates(_0xd88ec){return function(_0x173d29){try{jsonpatch[_0x0ae1('0x1c')](_0x173d29,_0xd88ec,!![]);}catch(_0x2ac3b3){return BPromise[_0x0ae1('0x1d')](_0x2ac3b3);}return _0x173d29[_0x0ae1('0x1e')]();};}function saveUpdates(_0xec763c,_0x1c61e5){return function(_0xcccd2){if(_0xcccd2){return _0xcccd2['update'](_0xec763c)[_0x0ae1('0x1f')](function(_0x424418){return _0x424418;});}return null;};}function removeEntity(_0x261a75,_0xeace2d){return function(_0x39805e){if(_0x39805e){return _0x39805e[_0x0ae1('0x20')]()[_0x0ae1('0x1f')](function(){var _0x101a2f=_0x39805e['get']({'plain':!![]});var _0x640896='Tags';return db[_0x0ae1('0x21')]['destroy']({'where':{'type':_0x640896,'resourceId':_0x101a2f['id']}})[_0x0ae1('0x1f')](function(){return _0x39805e;});})['then'](function(){_0x261a75[_0x0ae1('0x15')](0xcc)[_0x0ae1('0x16')]();});}};}function handleEntityNotFound(_0x1ddb13,_0x218e7d){return function(_0x577932){if(!_0x577932){_0x1ddb13['sendStatus'](0x194);}return _0x577932;};}function handleError(_0xe25a25,_0x87580c){_0x87580c=_0x87580c||0x1f4;return function(_0x366266){logger[_0x0ae1('0x22')](_0x366266[_0x0ae1('0x23')]);if(_0x366266['name']){delete _0x366266[_0x0ae1('0x24')];}_0xe25a25[_0x0ae1('0x15')](_0x87580c)[_0x0ae1('0x25')](_0x366266);};}exports['index']=function(_0x5a5a5d,_0x2e5b03){var _0x23dc76={},_0x25362a={},_0x1c4b0f={'count':0x0,'rows':[]};var _0x2f35d2=db[_0x0ae1('0x26')][_0x0ae1('0x27')];_0x25362a[_0x0ae1('0x28')]=_[_0x0ae1('0x29')](_0x2f35d2);_0x25362a[_0x0ae1('0x2a')]=_['keys'](_0x5a5a5d[_0x0ae1('0x2a')]);_0x25362a[_0x0ae1('0x2b')]=_[_0x0ae1('0x2c')](_0x25362a['model'],_0x25362a[_0x0ae1('0x2a')]);_0x23dc76[_0x0ae1('0x2d')]=_[_0x0ae1('0x2c')](_0x25362a['model'],qs[_0x0ae1('0x2e')](_0x5a5a5d['query'][_0x0ae1('0x2e')]));_0x23dc76[_0x0ae1('0x2d')]=_0x23dc76[_0x0ae1('0x2d')][_0x0ae1('0x2f')]?_0x23dc76[_0x0ae1('0x2d')]:_0x25362a[_0x0ae1('0x28')];if(!_0x5a5a5d['query'][_0x0ae1('0x30')]('nolimit')){_0x23dc76[_0x0ae1('0x31')]=qs[_0x0ae1('0x31')](_0x5a5a5d['query']['limit']);_0x23dc76[_0x0ae1('0x19')]=qs[_0x0ae1('0x19')](_0x5a5a5d[_0x0ae1('0x2a')][_0x0ae1('0x19')]);}_0x23dc76[_0x0ae1('0x32')]=qs[_0x0ae1('0x33')](_0x5a5a5d[_0x0ae1('0x2a')][_0x0ae1('0x33')]);_0x23dc76[_0x0ae1('0x34')]=qs[_0x0ae1('0x2b')](_[_0x0ae1('0x35')](_0x5a5a5d['query'],_0x25362a[_0x0ae1('0x2b')]));if(_0x5a5a5d[_0x0ae1('0x2a')][_0x0ae1('0x36')]){_0x23dc76['where']=_[_0x0ae1('0x37')](_0x23dc76[_0x0ae1('0x34')],{'$or':_[_0x0ae1('0x38')](_0x2f35d2,function(_0x4e1da7){if(_0x4e1da7['type'][_0x0ae1('0x39')]!=='VIRTUAL'){var _0x363005={};_0x363005[_0x4e1da7[_0x0ae1('0x3a')]]={'$like':'%'+_0x5a5a5d['query'][_0x0ae1('0x36')]+'%'};return _0x363005;}})});}_0x23dc76=_[_0x0ae1('0x37')]({},_0x23dc76,_0x5a5a5d[_0x0ae1('0x3b')]);var _0x4a2074={'where':_0x23dc76[_0x0ae1('0x34')]};return db[_0x0ae1('0x26')][_0x0ae1('0x18')](_0x4a2074)[_0x0ae1('0x1f')](function(_0x358ea2){_0x1c4b0f[_0x0ae1('0x18')]=_0x358ea2;if(_0x5a5a5d[_0x0ae1('0x2a')][_0x0ae1('0x3c')]){_0x23dc76['include']=[{'all':!![]}];}return db[_0x0ae1('0x26')][_0x0ae1('0x3d')](_0x23dc76);})[_0x0ae1('0x1f')](function(_0x5a28b3){_0x1c4b0f[_0x0ae1('0x3e')]=_0x5a28b3;return _0x1c4b0f;})['then'](respondWithFilteredResult(_0x2e5b03,_0x23dc76))[_0x0ae1('0x3f')](handleError(_0x2e5b03,null));};exports[_0x0ae1('0x40')]=function(_0x4fc004,_0x2b37df){var _0x3ff8ca={'raw':!![],'where':{'id':_0x4fc004[_0x0ae1('0x41')]['id']}},_0x3c180e={};_0x3c180e[_0x0ae1('0x28')]=_['keys'](db[_0x0ae1('0x26')][_0x0ae1('0x27')]);_0x3c180e[_0x0ae1('0x2a')]=_[_0x0ae1('0x29')](_0x4fc004['query']);_0x3c180e[_0x0ae1('0x2b')]=_[_0x0ae1('0x2c')](_0x3c180e['model'],_0x3c180e['query']);_0x3ff8ca[_0x0ae1('0x2d')]=_[_0x0ae1('0x2c')](_0x3c180e[_0x0ae1('0x28')],qs[_0x0ae1('0x2e')](_0x4fc004['query'][_0x0ae1('0x2e')]));_0x3ff8ca['attributes']=_0x3ff8ca['attributes'][_0x0ae1('0x2f')]?_0x3ff8ca[_0x0ae1('0x2d')]:_0x3c180e[_0x0ae1('0x28')];if(_0x4fc004[_0x0ae1('0x2a')][_0x0ae1('0x3c')]){_0x3ff8ca[_0x0ae1('0x42')]=[{'all':!![]}];}_0x3ff8ca=_[_0x0ae1('0x37')]({},_0x3ff8ca,_0x4fc004[_0x0ae1('0x3b')]);return db[_0x0ae1('0x26')][_0x0ae1('0x43')](_0x3ff8ca)[_0x0ae1('0x1f')](handleEntityNotFound(_0x2b37df,null))[_0x0ae1('0x1f')](respondWithResult(_0x2b37df,null))[_0x0ae1('0x3f')](handleError(_0x2b37df,null));};exports['create']=function(_0x5598d3,_0x40e076){return db['Tag']['create'](_0x5598d3[_0x0ae1('0x44')],{})[_0x0ae1('0x1f')](function(_0x2e4553){var _0x2b9cca=_0x5598d3[_0x0ae1('0x45')][_0x0ae1('0x46')]({'plain':!![]});if(!_0x2b9cca)throw new Error(_0x0ae1('0x47'));if(_0x2b9cca[_0x0ae1('0x48')]===_0x0ae1('0x45')){var _0x1afcae=_0x2e4553[_0x0ae1('0x46')]({'plain':!![]});var _0x8bb3e0='Tags';return db[_0x0ae1('0x49')][_0x0ae1('0x43')]({'where':{'name':_0x8bb3e0,'userProfileId':_0x2b9cca[_0x0ae1('0x4a')]},'raw':!![]})[_0x0ae1('0x1f')](function(_0x1a4e4e){if(_0x1a4e4e&&_0x1a4e4e[_0x0ae1('0x4b')]===0x0){return db[_0x0ae1('0x21')]['create']({'name':_0x1afcae[_0x0ae1('0x24')],'resourceId':_0x1afcae['id'],'type':_0x1a4e4e[_0x0ae1('0x24')],'sectionId':_0x1a4e4e['id']},{})['then'](function(){return _0x2e4553;});}else{return _0x2e4553;}})[_0x0ae1('0x3f')](function(_0x4d150b){logger[_0x0ae1('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d150b);throw _0x4d150b;});}return _0x2e4553;})[_0x0ae1('0x1f')](respondWithResult(_0x40e076,0xc9))[_0x0ae1('0x3f')](handleError(_0x40e076,null));};exports[_0x0ae1('0x4c')]=function(_0x55ef99,_0x2f23b6){if(_0x55ef99[_0x0ae1('0x44')]['id']){delete _0x55ef99[_0x0ae1('0x44')]['id'];}return db[_0x0ae1('0x26')][_0x0ae1('0x43')]({'where':{'id':_0x55ef99[_0x0ae1('0x41')]['id']}})[_0x0ae1('0x1f')](handleEntityNotFound(_0x2f23b6,null))[_0x0ae1('0x1f')](saveUpdates(_0x55ef99[_0x0ae1('0x44')],null))[_0x0ae1('0x1f')](respondWithResult(_0x2f23b6,null))[_0x0ae1('0x3f')](handleError(_0x2f23b6,null));};exports[_0x0ae1('0x20')]=function(_0x523af7,_0x59ed6c){return db[_0x0ae1('0x26')][_0x0ae1('0x43')]({'where':{'id':_0x523af7[_0x0ae1('0x41')]['id']}})[_0x0ae1('0x1f')](handleEntityNotFound(_0x59ed6c,null))[_0x0ae1('0x1f')](removeEntity(_0x59ed6c,null))[_0x0ae1('0x3f')](handleError(_0x59ed6c,null));}; \ No newline at end of file +var _0x6aea=['../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','model','keys','query','intersection','attributes','fields','length','limit','sort','where','filters','map','key','field','filter','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6aea,0xcb));var _0xa6ae=function(_0x1b39d7,_0x108410){_0x1b39d7=_0x1b39d7-0x0;var _0x2335bd=_0x6aea[_0x1b39d7];return _0x2335bd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa6ae('0x0'));var rimraf=require(_0xa6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6ae('0x2'));var rp=require('request-promise');var moment=require(_0xa6ae('0x3'));var BPromise=require(_0xa6ae('0x4'));var Mustache=require(_0xa6ae('0x5'));var util=require(_0xa6ae('0x6'));var path=require(_0xa6ae('0x7'));var sox=require(_0xa6ae('0x8'));var csv=require(_0xa6ae('0x9'));var ejs=require(_0xa6ae('0xa'));var fs=require('fs');var _=require(_0xa6ae('0xb'));var squel=require('squel');var crypto=require(_0xa6ae('0xc'));var jsforce=require(_0xa6ae('0xd'));var deskjs=require(_0xa6ae('0xe'));var toCsv=require(_0xa6ae('0x9'));var querystring=require(_0xa6ae('0xf'));var Papa=require(_0xa6ae('0x10'));var Redis=require('ioredis');var authService=require(_0xa6ae('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6ae('0x12'))('api');var utils=require(_0xa6ae('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x421cf3,_0x5f06f2){_0x5f06f2=_0x5f06f2||0xcc;return function(_0x13bbda){if(_0x13bbda){return _0x421cf3[_0xa6ae('0x14')](_0x5f06f2);}return _0x421cf3[_0xa6ae('0x15')](_0x5f06f2)[_0xa6ae('0x16')]();};}function respondWithResult(_0x2ecc18,_0x2a7c6a){_0x2a7c6a=_0x2a7c6a||0xc8;return function(_0x52a8c3){if(_0x52a8c3){return _0x2ecc18['status'](_0x2a7c6a)[_0xa6ae('0x17')](_0x52a8c3);}};}function respondWithFilteredResult(_0x2c96cb,_0x40d12e){return function(_0x570762){if(_0x570762){var _0xcb094=_0x570762[_0xa6ae('0x18')],_0x4c197a=_0x40d12e[_0xa6ae('0x19')],_0x405f82=_0x40d12e[_0xa6ae('0x19')]+_0x40d12e['limit'],_0x32d5e7;if(_0x405f82>=_0xcb094){_0x405f82=_0xcb094;_0x32d5e7=0xc8;}else{_0x32d5e7=0xce;}_0x2c96cb[_0xa6ae('0x15')](_0x32d5e7);return _0x2c96cb[_0xa6ae('0x1a')](_0xa6ae('0x1b'),_0x4c197a+'-'+_0x405f82+'/'+_0xcb094)[_0xa6ae('0x17')](_0x570762);}return null;};}function patchUpdates(_0x49e9fd){return function(_0x3974dc){try{jsonpatch[_0xa6ae('0x1c')](_0x3974dc,_0x49e9fd,!![]);}catch(_0x2ee91a){return BPromise[_0xa6ae('0x1d')](_0x2ee91a);}return _0x3974dc[_0xa6ae('0x1e')]();};}function saveUpdates(_0x5a2244,_0x5dd892){return function(_0x1a0e7c){if(_0x1a0e7c){return _0x1a0e7c['update'](_0x5a2244)[_0xa6ae('0x1f')](function(_0x3b0231){return _0x3b0231;});}return null;};}function removeEntity(_0x1a6f71,_0x3a2080){return function(_0x1b6502){if(_0x1b6502){return _0x1b6502['destroy']()[_0xa6ae('0x1f')](function(){var _0x33d02c=_0x1b6502[_0xa6ae('0x20')]({'plain':!![]});var _0x2908ae=_0xa6ae('0x21');return db[_0xa6ae('0x22')]['destroy']({'where':{'type':_0x2908ae,'resourceId':_0x33d02c['id']}})[_0xa6ae('0x1f')](function(){return _0x1b6502;});})['then'](function(){_0x1a6f71[_0xa6ae('0x15')](0xcc)[_0xa6ae('0x16')]();});}};}function handleEntityNotFound(_0x14355c,_0x52af3f){return function(_0x504569){if(!_0x504569){_0x14355c[_0xa6ae('0x14')](0x194);}return _0x504569;};}function handleError(_0x5c002c,_0x293bc7){_0x293bc7=_0x293bc7||0x1f4;return function(_0x4236d6){logger[_0xa6ae('0x23')](_0x4236d6[_0xa6ae('0x24')]);if(_0x4236d6['name']){delete _0x4236d6[_0xa6ae('0x25')];}_0x5c002c[_0xa6ae('0x15')](_0x293bc7)[_0xa6ae('0x26')](_0x4236d6);};}exports[_0xa6ae('0x27')]=function(_0xfa57c8,_0x257c13){var _0x230ed8={},_0x5008e9={},_0x437092={'count':0x0,'rows':[]};var _0x30aae3=db[_0xa6ae('0x28')]['rawAttributes'];_0x5008e9[_0xa6ae('0x29')]=_[_0xa6ae('0x2a')](_0x30aae3);_0x5008e9[_0xa6ae('0x2b')]=_['keys'](_0xfa57c8[_0xa6ae('0x2b')]);_0x5008e9['filters']=_[_0xa6ae('0x2c')](_0x5008e9[_0xa6ae('0x29')],_0x5008e9[_0xa6ae('0x2b')]);_0x230ed8[_0xa6ae('0x2d')]=_[_0xa6ae('0x2c')](_0x5008e9[_0xa6ae('0x29')],qs['fields'](_0xfa57c8['query'][_0xa6ae('0x2e')]));_0x230ed8[_0xa6ae('0x2d')]=_0x230ed8[_0xa6ae('0x2d')][_0xa6ae('0x2f')]?_0x230ed8[_0xa6ae('0x2d')]:_0x5008e9[_0xa6ae('0x29')];if(!_0xfa57c8[_0xa6ae('0x2b')]['hasOwnProperty']('nolimit')){_0x230ed8['limit']=qs[_0xa6ae('0x30')](_0xfa57c8[_0xa6ae('0x2b')]['limit']);_0x230ed8[_0xa6ae('0x19')]=qs['offset'](_0xfa57c8[_0xa6ae('0x2b')][_0xa6ae('0x19')]);}_0x230ed8['order']=qs[_0xa6ae('0x31')](_0xfa57c8[_0xa6ae('0x2b')][_0xa6ae('0x31')]);_0x230ed8[_0xa6ae('0x32')]=qs[_0xa6ae('0x33')](_['pick'](_0xfa57c8['query'],_0x5008e9[_0xa6ae('0x33')]));if(_0xfa57c8[_0xa6ae('0x2b')]['filter']){_0x230ed8[_0xa6ae('0x32')]=_['merge'](_0x230ed8[_0xa6ae('0x32')],{'$or':_[_0xa6ae('0x34')](_0x30aae3,function(_0x347027){if(_0x347027['type'][_0xa6ae('0x35')]!=='VIRTUAL'){var _0x112af5={};_0x112af5[_0x347027[_0xa6ae('0x36')]]={'$like':'%'+_0xfa57c8[_0xa6ae('0x2b')][_0xa6ae('0x37')]+'%'};return _0x112af5;}})});}_0x230ed8=_[_0xa6ae('0x38')]({},_0x230ed8,_0xfa57c8[_0xa6ae('0x39')]);var _0x4c5756={'where':_0x230ed8[_0xa6ae('0x32')]};return db[_0xa6ae('0x28')][_0xa6ae('0x18')](_0x4c5756)[_0xa6ae('0x1f')](function(_0xdace51){_0x437092[_0xa6ae('0x18')]=_0xdace51;if(_0xfa57c8['query']['includeAll']){_0x230ed8[_0xa6ae('0x3a')]=[{'all':!![]}];}return db[_0xa6ae('0x28')]['findAll'](_0x230ed8);})['then'](function(_0x36d579){_0x437092[_0xa6ae('0x3b')]=_0x36d579;return _0x437092;})[_0xa6ae('0x1f')](respondWithFilteredResult(_0x257c13,_0x230ed8))[_0xa6ae('0x3c')](handleError(_0x257c13,null));};exports[_0xa6ae('0x3d')]=function(_0x8e022c,_0x5668cb){var _0x21cee2={'raw':!![],'where':{'id':_0x8e022c[_0xa6ae('0x3e')]['id']}},_0x1f7961={};_0x1f7961[_0xa6ae('0x29')]=_[_0xa6ae('0x2a')](db[_0xa6ae('0x28')][_0xa6ae('0x3f')]);_0x1f7961[_0xa6ae('0x2b')]=_[_0xa6ae('0x2a')](_0x8e022c[_0xa6ae('0x2b')]);_0x1f7961[_0xa6ae('0x33')]=_[_0xa6ae('0x2c')](_0x1f7961['model'],_0x1f7961['query']);_0x21cee2[_0xa6ae('0x2d')]=_[_0xa6ae('0x2c')](_0x1f7961[_0xa6ae('0x29')],qs[_0xa6ae('0x2e')](_0x8e022c[_0xa6ae('0x2b')]['fields']));_0x21cee2[_0xa6ae('0x2d')]=_0x21cee2[_0xa6ae('0x2d')]['length']?_0x21cee2[_0xa6ae('0x2d')]:_0x1f7961[_0xa6ae('0x29')];if(_0x8e022c[_0xa6ae('0x2b')][_0xa6ae('0x40')]){_0x21cee2[_0xa6ae('0x3a')]=[{'all':!![]}];}_0x21cee2=_[_0xa6ae('0x38')]({},_0x21cee2,_0x8e022c[_0xa6ae('0x39')]);return db['Tag']['find'](_0x21cee2)[_0xa6ae('0x1f')](handleEntityNotFound(_0x5668cb,null))[_0xa6ae('0x1f')](respondWithResult(_0x5668cb,null))['catch'](handleError(_0x5668cb,null));};exports['create']=function(_0x302c1a,_0x4ef38d){return db[_0xa6ae('0x28')]['create'](_0x302c1a['body'],{})[_0xa6ae('0x1f')](function(_0x3e24b7){var _0x155732=_0x302c1a[_0xa6ae('0x41')][_0xa6ae('0x20')]({'plain':!![]});if(!_0x155732)throw new Error(_0xa6ae('0x42'));if(_0x155732[_0xa6ae('0x43')]===_0xa6ae('0x41')){var _0x26bf78=_0x3e24b7[_0xa6ae('0x20')]({'plain':!![]});var _0x241439=_0xa6ae('0x21');return db['UserProfileSection'][_0xa6ae('0x44')]({'where':{'name':_0x241439,'userProfileId':_0x155732[_0xa6ae('0x45')]},'raw':!![]})[_0xa6ae('0x1f')](function(_0x4ba057){if(_0x4ba057&&_0x4ba057['autoAssociation']===0x0){return db[_0xa6ae('0x22')][_0xa6ae('0x46')]({'name':_0x26bf78[_0xa6ae('0x25')],'resourceId':_0x26bf78['id'],'type':_0x4ba057['name'],'sectionId':_0x4ba057['id']},{})[_0xa6ae('0x1f')](function(){return _0x3e24b7;});}else{return _0x3e24b7;}})[_0xa6ae('0x3c')](function(_0x214511){logger[_0xa6ae('0x23')](_0xa6ae('0x47'),_0x214511);throw _0x214511;});}return _0x3e24b7;})[_0xa6ae('0x1f')](respondWithResult(_0x4ef38d,0xc9))[_0xa6ae('0x3c')](handleError(_0x4ef38d,null));};exports[_0xa6ae('0x48')]=function(_0x14134b,_0x5831b4){if(_0x14134b[_0xa6ae('0x49')]['id']){delete _0x14134b[_0xa6ae('0x49')]['id'];}return db[_0xa6ae('0x28')]['find']({'where':{'id':_0x14134b[_0xa6ae('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5831b4,null))[_0xa6ae('0x1f')](saveUpdates(_0x14134b[_0xa6ae('0x49')],null))[_0xa6ae('0x1f')](respondWithResult(_0x5831b4,null))['catch'](handleError(_0x5831b4,null));};exports['destroy']=function(_0xf39e81,_0x3adee4){return db[_0xa6ae('0x28')][_0xa6ae('0x44')]({'where':{'id':_0xf39e81['params']['id']}})[_0xa6ae('0x1f')](handleEntityNotFound(_0x3adee4,null))[_0xa6ae('0x1f')](removeEntity(_0x3adee4,null))[_0xa6ae('0x3c')](handleError(_0x3adee4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a174e21..2712ca4 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 _0x6b4d=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2d0354,_0x2ec10e){var _0xfaa9c2=function(_0x4f2708){while(--_0x4f2708){_0x2d0354['push'](_0x2d0354['shift']());}};_0xfaa9c2(++_0x2ec10e);}(_0x6b4d,0xac));var _0xd6b4=function(_0x3009cd,_0x11203f){_0x3009cd=_0x3009cd-0x0;var _0x2629c3=_0x6b4d[_0x3009cd];return _0x2629c3;};'use strict';var _=require(_0xd6b4('0x0'));var util=require(_0xd6b4('0x1'));var logger=require(_0xd6b4('0x2'))(_0xd6b4('0x3'));var moment=require(_0xd6b4('0x4'));var BPromise=require(_0xd6b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6b4('0x6'));var config=require(_0xd6b4('0x7'));var attributes=require(_0xd6b4('0x8'));module[_0xd6b4('0x9')]=function(_0x5c9f12,_0x3b94ad){return _0x5c9f12[_0xd6b4('0xa')](_0xd6b4('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9ec=['../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','../../config/logger','api','bluebird','path','rimraf'];(function(_0x26ee89,_0xa3a77){var _0x3d9b69=function(_0x2097b1){while(--_0x2097b1){_0x26ee89['push'](_0x26ee89['shift']());}};_0x3d9b69(++_0xa3a77);}(_0xe9ec,0x103));var _0xce9e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe9ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xce9e('0x0'))(_0xce9e('0x1'));var moment=require('moment');var BPromise=require(_0xce9e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce9e('0x3'));var rimraf=require(_0xce9e('0x4'));var config=require(_0xce9e('0x5'));var attributes=require(_0xce9e('0x6'));module[_0xce9e('0x7')]=function(_0x286ca0,_0x516a75){return _0x286ca0[_0xce9e('0x8')](_0xce9e('0x9'),attributes,{'tableName':_0xce9e('0xa'),'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 994ddbb..eb60d84 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 _0x2df4=['../../config/logger','rpc','../../config/environment','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5df90f,_0x5b3deb){var _0x1dae44=function(_0x2c9394){while(--_0x2c9394){_0x5df90f['push'](_0x5df90f['shift']());}};_0x1dae44(++_0x5b3deb);}(_0x2df4,0xeb));var _0x42df=function(_0xfd084b,_0x26977e){_0xfd084b=_0xfd084b-0x0;var _0x375d60=_0x2df4[_0xfd084b];return _0x375d60;};'use strict';var _=require('lodash');var util=require(_0x42df('0x0'));var moment=require('moment');var BPromise=require(_0x42df('0x1'));var rs=require(_0x42df('0x2'));var fs=require('fs');var Redis=require(_0x42df('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x42df('0x4'));var logger=require(_0x42df('0x5'))(_0x42df('0x6'));var config=require(_0x42df('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3309c4,_0x289ed7,_0x115be1){return new BPromise(function(_0x128266,_0x169d79){return client['request'](_0x3309c4,_0x115be1)[_0x42df('0x8')](function(_0x23df8d){logger[_0x42df('0x9')]('Tag,\x20%s,\x20%s',_0x289ed7,_0x42df('0xa'));logger[_0x42df('0xb')](_0x42df('0xc'),_0x289ed7,_0x42df('0xa'),JSON[_0x42df('0xd')](_0x23df8d));if(_0x23df8d['error']){if(_0x23df8d[_0x42df('0xe')][_0x42df('0xf')]===0x1f4){logger[_0x42df('0xe')](_0x42df('0x10'),_0x289ed7,_0x23df8d['error']['message']);return _0x169d79(_0x23df8d[_0x42df('0xe')][_0x42df('0x11')]);}logger[_0x42df('0xe')](_0x42df('0x10'),_0x289ed7,_0x23df8d[_0x42df('0xe')]['message']);return _0x128266(_0x23df8d[_0x42df('0xe')]['message']);}else{logger['info'](_0x42df('0x10'),_0x289ed7,'request\x20sent');_0x128266(_0x23df8d[_0x42df('0x12')][_0x42df('0x11')]);}})[_0x42df('0x13')](function(_0x3bd2a9){logger[_0x42df('0xe')](_0x42df('0x10'),_0x289ed7,_0x3bd2a9);_0x169d79(_0x3bd2a9);});});} \ No newline at end of file +var _0x1b8b=['stringify','error','code','Tag,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x5dd6d8,_0xe461ae){var _0x271126=function(_0x1536f8){while(--_0x1536f8){_0x5dd6d8['push'](_0x5dd6d8['shift']());}};_0x271126(++_0xe461ae);}(_0x1b8b,0x157));var _0xb1b8=function(_0x4caff1,_0x4d7ce1){_0x4caff1=_0x4caff1-0x0;var _0x2e088f=_0x1b8b[_0x4caff1];return _0x2e088f;};'use strict';var _=require(_0xb1b8('0x0'));var util=require(_0xb1b8('0x1'));var moment=require(_0xb1b8('0x2'));var BPromise=require(_0xb1b8('0x3'));var rs=require(_0xb1b8('0x4'));var fs=require('fs');var Redis=require(_0xb1b8('0x5'));var db=require(_0xb1b8('0x6'))['db'];var utils=require(_0xb1b8('0x7'));var logger=require(_0xb1b8('0x8'))(_0xb1b8('0x9'));var config=require(_0xb1b8('0xa'));var jayson=require(_0xb1b8('0xb'));var client=jayson[_0xb1b8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7015,_0xe12497,_0x2412ca){return new BPromise(function(_0x55a053,_0x58e84b){return client[_0xb1b8('0xd')](_0x4e7015,_0x2412ca)['then'](function(_0x2c9930){logger['info']('Tag,\x20%s,\x20%s',_0xe12497,_0xb1b8('0xe'));logger[_0xb1b8('0xf')](_0xb1b8('0x10'),_0xe12497,_0xb1b8('0xe'),JSON[_0xb1b8('0x11')](_0x2c9930));if(_0x2c9930[_0xb1b8('0x12')]){if(_0x2c9930[_0xb1b8('0x12')][_0xb1b8('0x13')]===0x1f4){logger['error'](_0xb1b8('0x14'),_0xe12497,_0x2c9930[_0xb1b8('0x12')][_0xb1b8('0x15')]);return _0x58e84b(_0x2c9930[_0xb1b8('0x12')][_0xb1b8('0x15')]);}logger['error']('Tag,\x20%s,\x20%s',_0xe12497,_0x2c9930[_0xb1b8('0x12')]['message']);return _0x55a053(_0x2c9930[_0xb1b8('0x12')][_0xb1b8('0x15')]);}else{logger[_0xb1b8('0x16')]('Tag,\x20%s,\x20%s',_0xe12497,'request\x20sent');_0x55a053(_0x2c9930[_0xb1b8('0x17')][_0xb1b8('0x15')]);}})['catch'](function(_0x3719d1){logger[_0xb1b8('0x12')](_0xb1b8('0x14'),_0xe12497,_0x3719d1);_0x58e84b(_0x3719d1);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1d376f3..18a57d2 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 _0x81de=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','/:id/queues','isAuthenticated','getQueues','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeQueues'];(function(_0x16de23,_0x2d4cfe){var _0x11460d=function(_0x4271c4){while(--_0x4271c4){_0x16de23['push'](_0x16de23['shift']());}};_0x11460d(++_0x2d4cfe);}(_0x81de,0xc1));var _0xe81d=function(_0x57c2be,_0x23fa3e){_0x57c2be=_0x57c2be-0x0;var _0x242109=_0x81de[_0x57c2be];return _0x242109;};'use strict';var multer=require(_0xe81d('0x0'));var util=require(_0xe81d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe81d('0x2'));var router=express[_0xe81d('0x3')]();var auth=require(_0xe81d('0x4'));var interaction=require(_0xe81d('0x5'));var config=require(_0xe81d('0x6'));var controller=require(_0xe81d('0x7'));router[_0xe81d('0x8')]('/',auth['isAuthenticated'](),controller[_0xe81d('0x9')]);router[_0xe81d('0x8')](_0xe81d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe81d('0x8')](_0xe81d('0xb'),auth[_0xe81d('0xc')](),controller[_0xe81d('0xd')]);router[_0xe81d('0x8')](_0xe81d('0xe'),auth[_0xe81d('0xc')](),controller[_0xe81d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe81d('0x10')]);router[_0xe81d('0x11')]('/:id/queues',auth[_0xe81d('0xc')](),controller['addQueues']);router[_0xe81d('0x11')](_0xe81d('0xe'),auth[_0xe81d('0xc')](),controller[_0xe81d('0x12')]);router[_0xe81d('0x13')]('/:id',auth[_0xe81d('0xc')](),controller[_0xe81d('0x14')]);router[_0xe81d('0x15')](_0xe81d('0xa'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe81d('0xb'),auth['isAuthenticated'](),controller[_0xe81d('0x16')]);router[_0xe81d('0x15')](_0xe81d('0xe'),auth[_0xe81d('0xc')](),controller['removeAgents']);module[_0xe81d('0x17')]=router; \ No newline at end of file +var _0x6730=['removeQueues','removeAgents','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','show','/:id/queues','getQueues','getAgents','post','create','addQueues','/:id/users','put','/:id','update','delete','destroy'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x6730,0x1ab));var _0x0673=function(_0x119b72,_0x54cfee){_0x119b72=_0x119b72-0x0;var _0x5b75e0=_0x6730[_0x119b72];return _0x5b75e0;};'use strict';var multer=require('multer');var util=require(_0x0673('0x0'));var path=require(_0x0673('0x1'));var timeout=require(_0x0673('0x2'));var express=require('express');var router=express[_0x0673('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0673('0x4'));var config=require(_0x0673('0x5'));var controller=require(_0x0673('0x6'));router[_0x0673('0x7')]('/',auth[_0x0673('0x8')](),controller[_0x0673('0x9')]);router[_0x0673('0x7')]('/:id',auth[_0x0673('0x8')](),controller[_0x0673('0xa')]);router[_0x0673('0x7')](_0x0673('0xb'),auth[_0x0673('0x8')](),controller[_0x0673('0xc')]);router[_0x0673('0x7')]('/:id/users',auth[_0x0673('0x8')](),controller[_0x0673('0xd')]);router[_0x0673('0xe')]('/',auth[_0x0673('0x8')](),controller[_0x0673('0xf')]);router[_0x0673('0xe')](_0x0673('0xb'),auth[_0x0673('0x8')](),controller[_0x0673('0x10')]);router[_0x0673('0xe')](_0x0673('0x11'),auth[_0x0673('0x8')](),controller['addAgents']);router[_0x0673('0x12')](_0x0673('0x13'),auth[_0x0673('0x8')](),controller[_0x0673('0x14')]);router[_0x0673('0x15')](_0x0673('0x13'),auth['isAuthenticated'](),controller[_0x0673('0x16')]);router[_0x0673('0x15')](_0x0673('0xb'),auth[_0x0673('0x8')](),controller[_0x0673('0x17')]);router[_0x0673('0x15')](_0x0673('0x11'),auth[_0x0673('0x8')](),controller[_0x0673('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 0988b2f..8ffcd3d 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 _0x824e=['name','sequelize','exports','STRING'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x824e,0x1dd));var _0xe824=function(_0x401089,_0x469a19){_0x401089=_0x401089-0x0;var _0x128e7c=_0x824e[_0x401089];return _0x128e7c;};'use strict';var Sequelize=require(_0xe824('0x0'));module[_0xe824('0x1')]={'name':{'type':Sequelize[_0xe824('0x2')],'allowNull':![],'unique':_0xe824('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x661c=['name','sequelize','exports','STRING'];(function(_0x3407be,_0x3ad78b){var _0x1743e2=function(_0x564703){while(--_0x564703){_0x3407be['push'](_0x3407be['shift']());}};_0x1743e2(++_0x3ad78b);}(_0x661c,0x191));var _0xc661=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x661c[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0xc661('0x0'));module[_0xc661('0x1')]={'name':{'type':Sequelize[_0xc661('0x2')],'allowNull':![],'unique':_0xc661('0x3')},'description':{'type':Sequelize[_0xc661('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 62fbc09..9c84a0f 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 _0x50a5=['fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','params','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Teams','UserProfileSection','userProfileId','autoAssociation','destroy','getQueues','findOne','Sequelize','ValidationError','Unknown\x20channel','capitalize','channel','toLowerCase','Queue','order','pick','options','Queues','addQueues','add','ids','isValidChannel','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','online','interface','filter','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','openchannel','userTeam:remove','getAgents','User','map','html-pdf','eml-format','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','UserProfileResource','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x50a5,0xd1));var _0x550a=function(_0x3106fb,_0x179cf4){_0x3106fb=_0x3106fb-0x0;var _0x14c29a=_0x50a5[_0x3106fb];return _0x14c29a;};'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 hardwareService=require(_0x550a('0x12'));var logger=require(_0x550a('0x13'))(_0x550a('0x14'));var utils=require('../../config/utils');var config=require(_0x550a('0x15'));var db=require(_0x550a('0x16'))['db'];config[_0x550a('0x17')]=_[_0x550a('0x18')](config[_0x550a('0x17')],{'host':_0x550a('0x19'),'port':0x18eb});var socket=require(_0x550a('0x1a'))(new Redis(config[_0x550a('0x17')]));require('./team.socket')[_0x550a('0x1b')](socket);function respondWithStatusCode(_0x4d22ea,_0x535eab){_0x535eab=_0x535eab||0xcc;return function(_0x1c602a){if(_0x1c602a){return _0x4d22ea[_0x550a('0x1c')](_0x535eab);}return _0x4d22ea['status'](_0x535eab)[_0x550a('0x1d')]();};}function respondWithResult(_0x4d1cb8,_0x388aaa){_0x388aaa=_0x388aaa||0xc8;return function(_0x4fa030){if(_0x4fa030){return _0x4d1cb8[_0x550a('0x1e')](_0x388aaa)[_0x550a('0x1f')](_0x4fa030);}};}function respondWithFilteredResult(_0x11994d,_0x18834d){return function(_0x179ae5){if(_0x179ae5){var _0x104972=_0x179ae5[_0x550a('0x20')],_0x5d4f5d=_0x18834d[_0x550a('0x21')],_0x3658fe=_0x18834d[_0x550a('0x21')]+_0x18834d[_0x550a('0x22')],_0x5d8f86;if(_0x3658fe>=_0x104972){_0x3658fe=_0x104972;_0x5d8f86=0xc8;}else{_0x5d8f86=0xce;}_0x11994d[_0x550a('0x1e')](_0x5d8f86);return _0x11994d['set'](_0x550a('0x23'),_0x5d4f5d+'-'+_0x3658fe+'/'+_0x104972)[_0x550a('0x1f')](_0x179ae5);}return null;};}function patchUpdates(_0x252242){return function(_0x1556c3){try{jsonpatch[_0x550a('0x24')](_0x1556c3,_0x252242,!![]);}catch(_0x4bb936){return BPromise[_0x550a('0x25')](_0x4bb936);}return _0x1556c3[_0x550a('0x26')]();};}function saveUpdates(_0x3d1c2d,_0x1fcf3b){return function(_0x4c550d){if(_0x4c550d){return _0x4c550d[_0x550a('0x27')](_0x3d1c2d)[_0x550a('0x28')](function(_0xc48d09){return _0xc48d09;});}return null;};}function removeEntity(_0x512517,_0x2d03e5){return function(_0x18aa4b){if(_0x18aa4b){return _0x18aa4b['destroy']()[_0x550a('0x28')](function(){var _0x5f2b67=_0x18aa4b['get']({'plain':!![]});var _0x132679='Teams';return db[_0x550a('0x29')]['destroy']({'where':{'type':_0x132679,'resourceId':_0x5f2b67['id']}})['then'](function(){return _0x18aa4b;});})[_0x550a('0x28')](function(){_0x512517[_0x550a('0x1e')](0xcc)[_0x550a('0x1d')]();});}};}function handleEntityNotFound(_0x1eadba,_0x288187){return function(_0x13b611){if(!_0x13b611){_0x1eadba[_0x550a('0x1c')](0x194);}return _0x13b611;};}function handleError(_0x2c6c76,_0x4bb0d2){_0x4bb0d2=_0x4bb0d2||0x1f4;return function(_0x51b453){logger[_0x550a('0x2a')](_0x51b453[_0x550a('0x2b')]);if(_0x51b453[_0x550a('0x2c')]){delete _0x51b453['name'];}_0x2c6c76[_0x550a('0x1e')](_0x4bb0d2)['send'](_0x51b453);};}exports[_0x550a('0x2d')]=function(_0x366372,_0x369905){var _0x3c1d92={},_0x28acfe={},_0x34db1d={'count':0x0,'rows':[]};var _0x25da1e=db[_0x550a('0x2e')][_0x550a('0x2f')];_0x28acfe[_0x550a('0x30')]=_[_0x550a('0x31')](_0x25da1e);_0x28acfe['query']=_[_0x550a('0x31')](_0x366372[_0x550a('0x32')]);_0x28acfe['filters']=_[_0x550a('0x33')](_0x28acfe[_0x550a('0x30')],_0x28acfe['query']);_0x3c1d92[_0x550a('0x34')]=_['intersection'](_0x28acfe[_0x550a('0x30')],qs[_0x550a('0x35')](_0x366372[_0x550a('0x32')]['fields']));_0x3c1d92[_0x550a('0x34')]=_0x3c1d92['attributes'][_0x550a('0x36')]?_0x3c1d92[_0x550a('0x34')]:_0x28acfe[_0x550a('0x30')];if(!_0x366372[_0x550a('0x32')][_0x550a('0x37')](_0x550a('0x38'))){_0x3c1d92[_0x550a('0x22')]=qs[_0x550a('0x22')](_0x366372[_0x550a('0x32')][_0x550a('0x22')]);_0x3c1d92[_0x550a('0x21')]=qs[_0x550a('0x21')](_0x366372[_0x550a('0x32')][_0x550a('0x21')]);}_0x3c1d92['order']=qs[_0x550a('0x39')](_0x366372['query'][_0x550a('0x39')]);_0x3c1d92[_0x550a('0x3a')]=qs[_0x550a('0x3b')](_['pick'](_0x366372['query'],_0x28acfe['filters']));if(_0x366372[_0x550a('0x32')]['filter']){_0x3c1d92[_0x550a('0x3a')]=_[_0x550a('0x3c')](_0x3c1d92[_0x550a('0x3a')],{'$or':_['map'](_0x25da1e,function(_0x1eb4f7){if(_0x1eb4f7[_0x550a('0x3d')][_0x550a('0x3e')]!==_0x550a('0x3f')){var _0x1b6c12={};_0x1b6c12[_0x1eb4f7[_0x550a('0x40')]]={'$like':'%'+_0x366372[_0x550a('0x32')]['filter']+'%'};return _0x1b6c12;}})});}_0x3c1d92=_[_0x550a('0x3c')]({},_0x3c1d92,_0x366372['options']);var _0x5c5e58={'where':_0x3c1d92[_0x550a('0x3a')]};return db['Team'][_0x550a('0x20')](_0x5c5e58)['then'](function(_0x4cf05f){_0x34db1d[_0x550a('0x20')]=_0x4cf05f;if(_0x366372[_0x550a('0x32')][_0x550a('0x41')]){_0x3c1d92[_0x550a('0x42')]=[{'all':!![]}];}return db[_0x550a('0x2e')][_0x550a('0x43')](_0x3c1d92);})[_0x550a('0x28')](function(_0x210ddc){_0x34db1d[_0x550a('0x44')]=_0x210ddc;return _0x34db1d;})[_0x550a('0x28')](respondWithFilteredResult(_0x369905,_0x3c1d92))['catch'](handleError(_0x369905,null));};exports['show']=function(_0x37dc74,_0x15cfb6){var _0x5d82e9={'raw':![],'where':{'id':_0x37dc74[_0x550a('0x45')]['id']}},_0x132d71={};_0x132d71[_0x550a('0x30')]=_[_0x550a('0x31')](db[_0x550a('0x2e')][_0x550a('0x2f')]);_0x132d71[_0x550a('0x32')]=_[_0x550a('0x31')](_0x37dc74['query']);_0x132d71['filters']=_[_0x550a('0x33')](_0x132d71['model'],_0x132d71[_0x550a('0x32')]);_0x5d82e9[_0x550a('0x34')]=_['intersection'](_0x132d71[_0x550a('0x30')],qs['fields'](_0x37dc74[_0x550a('0x32')][_0x550a('0x35')]));_0x5d82e9['attributes']=_0x5d82e9[_0x550a('0x34')][_0x550a('0x36')]?_0x5d82e9[_0x550a('0x34')]:_0x132d71['model'];if(_0x37dc74[_0x550a('0x32')][_0x550a('0x41')]){_0x5d82e9[_0x550a('0x42')]=[{'all':!![]}];}_0x5d82e9=_[_0x550a('0x3c')]({},_0x5d82e9,_0x37dc74['options']);return db[_0x550a('0x2e')][_0x550a('0x46')](_0x5d82e9)[_0x550a('0x28')](handleEntityNotFound(_0x15cfb6,null))['then'](respondWithResult(_0x15cfb6,null))[_0x550a('0x47')](handleError(_0x15cfb6,null));};exports['create']=function(_0x58b345,_0x57e1f2){return db[_0x550a('0x2e')][_0x550a('0x48')](_0x58b345[_0x550a('0x49')],{})[_0x550a('0x28')](function(_0x12763f){var _0x299e36=_0x58b345['user'][_0x550a('0x4a')]({'plain':!![]});if(!_0x299e36)throw new Error(_0x550a('0x4b'));if(_0x299e36['role']===_0x550a('0x4c')){var _0x51ed93=_0x12763f[_0x550a('0x4a')]({'plain':!![]});var _0xec76df=_0x550a('0x4d');return db[_0x550a('0x4e')][_0x550a('0x46')]({'where':{'name':_0xec76df,'userProfileId':_0x299e36[_0x550a('0x4f')]},'raw':!![]})[_0x550a('0x28')](function(_0x5a31f1){if(_0x5a31f1&&_0x5a31f1[_0x550a('0x50')]===0x0){return db['UserProfileResource'][_0x550a('0x48')]({'name':_0x51ed93['name'],'resourceId':_0x51ed93['id'],'type':_0x5a31f1[_0x550a('0x2c')],'sectionId':_0x5a31f1['id']},{})[_0x550a('0x28')](function(){return _0x12763f;});}else{return _0x12763f;}})[_0x550a('0x47')](function(_0x3dcc2f){logger[_0x550a('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dcc2f);throw _0x3dcc2f;});}return _0x12763f;})[_0x550a('0x28')](respondWithResult(_0x57e1f2,0xc9))[_0x550a('0x47')](handleError(_0x57e1f2,null));};exports['update']=function(_0x4d5151,_0x4bfb56){if(_0x4d5151[_0x550a('0x49')]['id']){delete _0x4d5151[_0x550a('0x49')]['id'];}return db[_0x550a('0x2e')]['find']({'where':{'id':_0x4d5151[_0x550a('0x45')]['id']}})[_0x550a('0x28')](handleEntityNotFound(_0x4bfb56,null))[_0x550a('0x28')](saveUpdates(_0x4d5151[_0x550a('0x49')],null))[_0x550a('0x28')](respondWithResult(_0x4bfb56,null))[_0x550a('0x47')](handleError(_0x4bfb56,null));};exports[_0x550a('0x51')]=function(_0x34fba1,_0x569b35){return db[_0x550a('0x2e')][_0x550a('0x46')]({'where':{'id':_0x34fba1[_0x550a('0x45')]['id']}})['then'](handleEntityNotFound(_0x569b35,null))[_0x550a('0x28')](removeEntity(_0x569b35,null))[_0x550a('0x47')](handleError(_0x569b35,null));};exports[_0x550a('0x52')]=function(_0x308a5d,_0x564b32,_0x57445a){return db['Team'][_0x550a('0x53')]({'where':{'id':_0x308a5d['params']['id']}})[_0x550a('0x28')](handleEntityNotFound(_0x564b32,null))['then'](function(_0x3b02c0){if(!_0x308a5d[_0x550a('0x32')]['channel']||!utils['isValidChannel'](_0x308a5d[_0x550a('0x32')]['channel'])){throw new db[(_0x550a('0x54'))][(_0x550a('0x55'))](_0x550a('0x56'));}var _0x152190={};var _0x9141a9={};_0x9141a9['model']=_[_0x550a('0x31')](db[_[_0x550a('0x57')](_0x308a5d[_0x550a('0x32')][_0x550a('0x58')][_0x550a('0x59')]())+_0x550a('0x5a')]['rawAttributes']);_0x9141a9[_0x550a('0x32')]=_['keys'](_0x308a5d['query']);_0x9141a9[_0x550a('0x3b')]=_['intersection'](_0x9141a9['model'],_0x9141a9[_0x550a('0x32')]);_0x152190[_0x550a('0x34')]=_[_0x550a('0x33')](_0x9141a9[_0x550a('0x30')],qs[_0x550a('0x35')](_0x308a5d['query']['fields']));_0x152190[_0x550a('0x34')]=_0x152190['attributes'][_0x550a('0x36')]?_0x152190[_0x550a('0x34')]:_0x9141a9['model'];_0x152190['limit']=qs[_0x550a('0x22')](_0x308a5d[_0x550a('0x32')][_0x550a('0x22')]);_0x152190[_0x550a('0x21')]=qs[_0x550a('0x21')](_0x308a5d[_0x550a('0x32')]['offset']);_0x152190[_0x550a('0x5b')]=qs[_0x550a('0x39')](_0x308a5d[_0x550a('0x32')]['sort']);_0x152190['where']=qs[_0x550a('0x3b')](_[_0x550a('0x5c')](_0x308a5d[_0x550a('0x32')],_0x9141a9[_0x550a('0x3b')]));_0x152190=_[_0x550a('0x3c')]({},_0x152190,_0x308a5d[_0x550a('0x5d')]);return _0x3b02c0[_0x550a('0x4a')+_[_0x550a('0x57')](_0x308a5d[_0x550a('0x32')][_0x550a('0x58')][_0x550a('0x59')]())+_0x550a('0x5e')](_0x152190);})[_0x550a('0x28')](respondWithResult(_0x564b32,null))[_0x550a('0x47')](handleError(_0x564b32,null));};exports[_0x550a('0x5f')]=function(_0x3b9716,_0x36090c,_0x1b85fa){return db[_0x550a('0x2e')][_0x550a('0x53')]({'where':{'id':_0x3b9716[_0x550a('0x45')]['id']}})[_0x550a('0x28')](function(_0x132108){if(_0x132108){if(!_0x3b9716['body'][_0x550a('0x58')]||!utils['isValidChannel'](_0x3b9716['body']['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x132108[_0x550a('0x60')+_['capitalize'](_0x3b9716[_0x550a('0x49')][_0x550a('0x58')]['toLowerCase']())+'Queues'](_0x3b9716[_0x550a('0x49')][_0x550a('0x61')]);}return null;})[_0x550a('0x28')](handleEntityNotFound(_0x36090c,null))['then'](respondWithStatusCode(_0x36090c,null))[_0x550a('0x47')](handleError(_0x36090c,null));};exports['removeQueues']=function(_0x20346f,_0x1b0cc9,_0x36f16b){return db['Team'][_0x550a('0x53')]({'where':{'id':_0x20346f['params']['id']}})[_0x550a('0x28')](function(_0x44a518){if(_0x44a518){if(!_0x20346f['query'][_0x550a('0x58')]||!utils[_0x550a('0x62')](_0x20346f[_0x550a('0x32')][_0x550a('0x58')])){throw new db['Sequelize']['ValidationError'](_0x550a('0x56'));}return _0x44a518[_0x550a('0x63')+_[_0x550a('0x57')](_0x20346f[_0x550a('0x32')]['channel'][_0x550a('0x59')]())+'Queues'](_0x20346f[_0x550a('0x32')][_0x550a('0x61')]);}return null;})[_0x550a('0x28')](handleEntityNotFound(_0x1b0cc9,null))[_0x550a('0x28')](respondWithStatusCode(_0x1b0cc9,null))[_0x550a('0x47')](handleError(_0x1b0cc9,null));};exports[_0x550a('0x64')]=function(_0x23d3d0,_0x2082bd,_0x10e174){return db[_0x550a('0x2e')]['find']({'where':{'id':_0x23d3d0[_0x550a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2082bd,null))['then'](function(_0x5a3164){if(_0x5a3164){var _0x1bc13c=[_0x550a('0x65'),_0x550a('0x66'),_0x550a('0x67'),_0x550a('0x68'),_0x550a('0x69'),_0x550a('0x6a')];return BPromise['each'](_0x1bc13c,function(_0x55e435){return _0x5a3164[_0x550a('0x4a')+_0x55e435+_0x550a('0x5e')]({'attributes':['id','name']})['then'](function(_0x293b29){return BPromise[_0x550a('0x6b')](_0x293b29,function(_0x4d07e3){return _0x4d07e3[_0x550a('0x64')](_0x23d3d0['body'][_0x550a('0x61')])['then'](function(){if(_0x55e435===_0x550a('0x65')){return db['User'][_0x550a('0x43')]({'where':{'id':_0x23d3d0[_0x550a('0x49')][_0x550a('0x61')]},'attributes':['id','name',_0x550a('0x6c'),'voicePause',_0x550a('0x6d')],'raw':!![]})[_0x550a('0x28')](function(_0x31484b){return BPromise[_0x550a('0x6b')](_[_0x550a('0x6e')](_0x31484b,{'online':0x1}),function(_0x5e7b91){return db[_0x550a('0x6f')][_0x550a('0x70')]({'membername':_0x5e7b91['name'],'UserId':_0x5e7b91['id'],'queue_name':_0x4d07e3[_0x550a('0x2c')],'VoiceQueueId':_0x4d07e3['id'],'interface':_[_0x550a('0x71')](_0x5e7b91[_0x550a('0x6d')])?util[_0x550a('0x72')](_0x550a('0x73'),_0x5e7b91['name']):_0x5e7b91[_0x550a('0x6d')],'paused':_0x5e7b91[_0x550a('0x74')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x5a3164;});})['then'](function(){return _0x5a3164;});}})['then'](function(_0x111f31){if(_0x111f31){return _0x111f31[_0x550a('0x64')](_0x23d3d0[_0x550a('0x49')][_0x550a('0x61')],_[_0x550a('0x75')](_0x23d3d0['body'],['ids','id'])||{})[_0x550a('0x76')](function(_0x263e04){for(var _0x3aa0d9=0x0;_0x3aa0d9<_0x23d3d0['body'][_0x550a('0x61')][_0x550a('0x36')];_0x3aa0d9+=0x1){socket[_0x550a('0x77')](_0x550a('0x78'),{'UserId':_0x23d3d0[_0x550a('0x49')][_0x550a('0x61')][_0x3aa0d9],'TeamId':_0x23d3d0['params']['id']});}return _0x263e04;});}})[_0x550a('0x28')](respondWithResult(_0x2082bd,null))[_0x550a('0x47')](handleError(_0x2082bd,null));};exports[_0x550a('0x79')]=function(_0x5b7d8d,_0x1b6b7a,_0x482358){return db[_0x550a('0x2e')][_0x550a('0x46')]({'where':{'id':_0x5b7d8d[_0x550a('0x45')]['id']}})[_0x550a('0x28')](handleEntityNotFound(_0x1b6b7a,null))[_0x550a('0x28')](function(_0x4571a7){if(_0x4571a7){return BPromise[_0x550a('0x6b')]([_0x550a('0x7a'),_0x550a('0x7b'),_0x550a('0x7c'),_0x550a('0x7d'),'fax',_0x550a('0x7e')],function(_0xb3f42a){return _0x4571a7['get'+_[_0x550a('0x57')](_0xb3f42a)+_0x550a('0x5e')]({'attributes':['id',_0x550a('0x2c')]})['then'](function(_0x48439b){return BPromise[_0x550a('0x6b')](_0x48439b,function(_0x3fbd99){return _0x3fbd99[_0x550a('0x79')](_0x5b7d8d['query'][_0x550a('0x61')])[_0x550a('0x28')](function(){if(_0xb3f42a===_0x550a('0x7a')){return db[_0x550a('0x6f')][_0x550a('0x51')]({'where':{'VoiceQueueId':_0x3fbd99['id'],'UserId':_0x5b7d8d[_0x550a('0x32')][_0x550a('0x61')]}});}});});})['then'](function(){return _0x4571a7;});})[_0x550a('0x28')](function(){return _0x4571a7;});}})[_0x550a('0x28')](function(_0x53c6f0){if(_0x53c6f0){return _0x53c6f0[_0x550a('0x79')](_0x5b7d8d['query'][_0x550a('0x61')])['then'](function(){if(_['isArray'](_0x5b7d8d[_0x550a('0x32')][_0x550a('0x61')])){for(var _0x87292c=0x0;_0x87292c<_0x5b7d8d['query'][_0x550a('0x61')][_0x550a('0x36')];_0x87292c+=0x1){socket[_0x550a('0x77')](_0x550a('0x7f'),{'UserId':Number(_0x5b7d8d[_0x550a('0x32')][_0x550a('0x61')][_0x87292c]),'TeamId':Number(_0x5b7d8d[_0x550a('0x45')]['id'])});}}else{socket[_0x550a('0x77')](_0x550a('0x7f'),{'UserId':Number(_0x5b7d8d[_0x550a('0x32')][_0x550a('0x61')]),'TeamId':Number(_0x5b7d8d[_0x550a('0x45')]['id'])});}});}})[_0x550a('0x28')](respondWithStatusCode(_0x1b6b7a,null))[_0x550a('0x47')](handleError(_0x1b6b7a,null));};exports[_0x550a('0x80')]=function(_0x1f7394,_0x207ea6,_0x4e1238){var _0x4fa912={};var _0x478197={};var _0x350a53;var _0x3a9a2a;return db[_0x550a('0x2e')]['findOne']({'where':{'id':_0x1f7394[_0x550a('0x45')]['id']}})['then'](handleEntityNotFound(_0x207ea6,null))[_0x550a('0x28')](function(_0x132d5a){if(_0x132d5a){_0x350a53=_0x132d5a;_0x478197[_0x550a('0x30')]=_[_0x550a('0x31')](db[_0x550a('0x81')]['rawAttributes']);_0x478197['query']=_[_0x550a('0x31')](_0x1f7394[_0x550a('0x32')]);_0x478197[_0x550a('0x3b')]=_[_0x550a('0x33')](_0x478197[_0x550a('0x30')],_0x478197[_0x550a('0x32')]);_0x4fa912['attributes']=_[_0x550a('0x33')](_0x478197['model'],qs[_0x550a('0x35')](_0x1f7394[_0x550a('0x32')][_0x550a('0x35')]));_0x4fa912['attributes']=_0x4fa912[_0x550a('0x34')][_0x550a('0x36')]?_0x4fa912[_0x550a('0x34')]:_0x478197['model'];_0x4fa912['order']=qs['sort'](_0x1f7394['query']['sort']);_0x4fa912[_0x550a('0x3a')]=qs[_0x550a('0x3b')](_[_0x550a('0x5c')](_0x1f7394['query'],_0x478197['filters']));if(_0x1f7394[_0x550a('0x32')][_0x550a('0x6e')]){_0x4fa912[_0x550a('0x3a')]=_[_0x550a('0x3c')](_0x4fa912[_0x550a('0x3a')],{'$or':_[_0x550a('0x82')](_0x4fa912[_0x550a('0x34')],function(_0x5b47e3){var _0x436b26={};_0x436b26[_0x5b47e3]={'$like':'%'+_0x1f7394[_0x550a('0x32')][_0x550a('0x6e')]+'%'};return _0x436b26;})});}_0x4fa912=_[_0x550a('0x3c')]({},_0x4fa912,_0x1f7394['options']);return _0x350a53[_0x550a('0x80')](_0x4fa912);}})['then'](function(_0x63a740){if(_0x63a740){_0x3a9a2a=_0x63a740[_0x550a('0x36')];if(!_0x1f7394[_0x550a('0x32')][_0x550a('0x37')](_0x550a('0x38'))){_0x4fa912[_0x550a('0x22')]=qs['limit'](_0x1f7394[_0x550a('0x32')]['limit']);_0x4fa912['offset']=qs['offset'](_0x1f7394[_0x550a('0x32')][_0x550a('0x21')]);}return _0x350a53['getAgents'](_0x4fa912);}})[_0x550a('0x28')](function(_0x1760bb){if(_0x1760bb){return _0x1760bb?{'count':_0x3a9a2a,'rows':_0x1760bb}:null;}})[_0x550a('0x28')](respondWithResult(_0x207ea6,null))[_0x550a('0x47')](handleError(_0x207ea6,null));}; \ No newline at end of file +var _0x2dd8=['hasOwnProperty','sort','where','filters','filter','map','type','field','merge','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','Queue','pick','toLowerCase','Queues','addQueues','add','removeQueues','remove','ids','addAgents','Chat','Mail','Sms','Openchannel','each','Voice','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','omit','userTeam:save','removeAgents','voice','chat','mail','sms','emit','getAgents','User','order','nolimit','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','Teams','UserProfileResource','error','name','index','Team','rawAttributes','model','query','keys','intersection','attributes','fields'];(function(_0x2e9d73,_0x114ba0){var _0x11cfdb=function(_0x2a4a4f){while(--_0x2a4a4f){_0x2e9d73['push'](_0x2e9d73['shift']());}};_0x11cfdb(++_0x114ba0);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x82dd('0x0'));var emlformat=require(_0x82dd('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x82dd('0x2'));var rp=require(_0x82dd('0x3'));var moment=require(_0x82dd('0x4'));var BPromise=require(_0x82dd('0x5'));var Mustache=require(_0x82dd('0x6'));var util=require(_0x82dd('0x7'));var path=require(_0x82dd('0x8'));var sox=require('sox');var csv=require(_0x82dd('0x9'));var ejs=require(_0x82dd('0xa'));var fs=require('fs');var _=require(_0x82dd('0xb'));var squel=require(_0x82dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x82dd('0xd'));var deskjs=require(_0x82dd('0xe'));var toCsv=require(_0x82dd('0x9'));var querystring=require(_0x82dd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82dd('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x82dd('0x11'));var logger=require(_0x82dd('0x12'))(_0x82dd('0x13'));var utils=require(_0x82dd('0x14'));var config=require(_0x82dd('0x15'));var db=require('../../mysqldb')['db'];config[_0x82dd('0x16')]=_[_0x82dd('0x17')](config[_0x82dd('0x16')],{'host':_0x82dd('0x18'),'port':0x18eb});var socket=require(_0x82dd('0x19'))(new Redis(config['redis']));require('./team.socket')[_0x82dd('0x1a')](socket);function respondWithStatusCode(_0x255abd,_0x6fcc1b){_0x6fcc1b=_0x6fcc1b||0xcc;return function(_0x46beb0){if(_0x46beb0){return _0x255abd[_0x82dd('0x1b')](_0x6fcc1b);}return _0x255abd[_0x82dd('0x1c')](_0x6fcc1b)[_0x82dd('0x1d')]();};}function respondWithResult(_0x275802,_0x101eb7){_0x101eb7=_0x101eb7||0xc8;return function(_0x1b90e0){if(_0x1b90e0){return _0x275802[_0x82dd('0x1c')](_0x101eb7)[_0x82dd('0x1e')](_0x1b90e0);}};}function respondWithFilteredResult(_0x1bdd14,_0x51d2a9){return function(_0x352400){if(_0x352400){var _0x66f34e=_0x352400[_0x82dd('0x1f')],_0x34d991=_0x51d2a9[_0x82dd('0x20')],_0x40a47a=_0x51d2a9[_0x82dd('0x20')]+_0x51d2a9[_0x82dd('0x21')],_0x445fa0;if(_0x40a47a>=_0x66f34e){_0x40a47a=_0x66f34e;_0x445fa0=0xc8;}else{_0x445fa0=0xce;}_0x1bdd14[_0x82dd('0x1c')](_0x445fa0);return _0x1bdd14[_0x82dd('0x22')](_0x82dd('0x23'),_0x34d991+'-'+_0x40a47a+'/'+_0x66f34e)[_0x82dd('0x1e')](_0x352400);}return null;};}function patchUpdates(_0x5ebea8){return function(_0x45205d){try{jsonpatch[_0x82dd('0x24')](_0x45205d,_0x5ebea8,!![]);}catch(_0x28352e){return BPromise[_0x82dd('0x25')](_0x28352e);}return _0x45205d[_0x82dd('0x26')]();};}function saveUpdates(_0x251b5b,_0x15f5b8){return function(_0x45e92c){if(_0x45e92c){return _0x45e92c['update'](_0x251b5b)['then'](function(_0x1c095e){return _0x1c095e;});}return null;};}function removeEntity(_0x96dbc0,_0x4e1463){return function(_0x59a173){if(_0x59a173){return _0x59a173[_0x82dd('0x27')]()[_0x82dd('0x28')](function(){var _0x3b0740=_0x59a173[_0x82dd('0x29')]({'plain':!![]});var _0x4609c1=_0x82dd('0x2a');return db[_0x82dd('0x2b')][_0x82dd('0x27')]({'where':{'type':_0x4609c1,'resourceId':_0x3b0740['id']}})[_0x82dd('0x28')](function(){return _0x59a173;});})[_0x82dd('0x28')](function(){_0x96dbc0[_0x82dd('0x1c')](0xcc)[_0x82dd('0x1d')]();});}};}function handleEntityNotFound(_0x2b443b,_0x242e59){return function(_0x5543c2){if(!_0x5543c2){_0x2b443b[_0x82dd('0x1b')](0x194);}return _0x5543c2;};}function handleError(_0x3abff0,_0x12d421){_0x12d421=_0x12d421||0x1f4;return function(_0x53965f){logger[_0x82dd('0x2c')](_0x53965f['stack']);if(_0x53965f[_0x82dd('0x2d')]){delete _0x53965f[_0x82dd('0x2d')];}_0x3abff0[_0x82dd('0x1c')](_0x12d421)['send'](_0x53965f);};}exports[_0x82dd('0x2e')]=function(_0x212720,_0x47c0ff){var _0x5cfdee={},_0x3fcc0d={},_0x3ae12a={'count':0x0,'rows':[]};var _0x4c2a51=db[_0x82dd('0x2f')][_0x82dd('0x30')];_0x3fcc0d[_0x82dd('0x31')]=_['keys'](_0x4c2a51);_0x3fcc0d[_0x82dd('0x32')]=_[_0x82dd('0x33')](_0x212720['query']);_0x3fcc0d['filters']=_[_0x82dd('0x34')](_0x3fcc0d[_0x82dd('0x31')],_0x3fcc0d['query']);_0x5cfdee[_0x82dd('0x35')]=_[_0x82dd('0x34')](_0x3fcc0d[_0x82dd('0x31')],qs[_0x82dd('0x36')](_0x212720[_0x82dd('0x32')]['fields']));_0x5cfdee[_0x82dd('0x35')]=_0x5cfdee[_0x82dd('0x35')]['length']?_0x5cfdee[_0x82dd('0x35')]:_0x3fcc0d[_0x82dd('0x31')];if(!_0x212720[_0x82dd('0x32')][_0x82dd('0x37')]('nolimit')){_0x5cfdee[_0x82dd('0x21')]=qs[_0x82dd('0x21')](_0x212720[_0x82dd('0x32')][_0x82dd('0x21')]);_0x5cfdee[_0x82dd('0x20')]=qs[_0x82dd('0x20')](_0x212720[_0x82dd('0x32')][_0x82dd('0x20')]);}_0x5cfdee['order']=qs[_0x82dd('0x38')](_0x212720['query'][_0x82dd('0x38')]);_0x5cfdee[_0x82dd('0x39')]=qs[_0x82dd('0x3a')](_['pick'](_0x212720[_0x82dd('0x32')],_0x3fcc0d[_0x82dd('0x3a')]));if(_0x212720[_0x82dd('0x32')][_0x82dd('0x3b')]){_0x5cfdee['where']=_['merge'](_0x5cfdee[_0x82dd('0x39')],{'$or':_[_0x82dd('0x3c')](_0x4c2a51,function(_0x101303){if(_0x101303[_0x82dd('0x3d')]['key']!=='VIRTUAL'){var _0x15207e={};_0x15207e[_0x101303[_0x82dd('0x3e')]]={'$like':'%'+_0x212720['query'][_0x82dd('0x3b')]+'%'};return _0x15207e;}})});}_0x5cfdee=_[_0x82dd('0x3f')]({},_0x5cfdee,_0x212720[_0x82dd('0x40')]);var _0xe5cdd7={'where':_0x5cfdee[_0x82dd('0x39')]};return db[_0x82dd('0x2f')][_0x82dd('0x1f')](_0xe5cdd7)[_0x82dd('0x28')](function(_0x46ec17){_0x3ae12a[_0x82dd('0x1f')]=_0x46ec17;if(_0x212720[_0x82dd('0x32')][_0x82dd('0x41')]){_0x5cfdee[_0x82dd('0x42')]=[{'all':!![]}];}return db[_0x82dd('0x2f')][_0x82dd('0x43')](_0x5cfdee);})[_0x82dd('0x28')](function(_0x24e4aa){_0x3ae12a[_0x82dd('0x44')]=_0x24e4aa;return _0x3ae12a;})[_0x82dd('0x28')](respondWithFilteredResult(_0x47c0ff,_0x5cfdee))['catch'](handleError(_0x47c0ff,null));};exports[_0x82dd('0x45')]=function(_0x4cd127,_0x56fa01){var _0x3c7c5f={'raw':![],'where':{'id':_0x4cd127[_0x82dd('0x46')]['id']}},_0x39f930={};_0x39f930['model']=_[_0x82dd('0x33')](db[_0x82dd('0x2f')][_0x82dd('0x30')]);_0x39f930[_0x82dd('0x32')]=_[_0x82dd('0x33')](_0x4cd127[_0x82dd('0x32')]);_0x39f930['filters']=_[_0x82dd('0x34')](_0x39f930[_0x82dd('0x31')],_0x39f930[_0x82dd('0x32')]);_0x3c7c5f[_0x82dd('0x35')]=_[_0x82dd('0x34')](_0x39f930['model'],qs[_0x82dd('0x36')](_0x4cd127[_0x82dd('0x32')]['fields']));_0x3c7c5f[_0x82dd('0x35')]=_0x3c7c5f[_0x82dd('0x35')][_0x82dd('0x47')]?_0x3c7c5f[_0x82dd('0x35')]:_0x39f930[_0x82dd('0x31')];if(_0x4cd127[_0x82dd('0x32')]['includeAll']){_0x3c7c5f[_0x82dd('0x42')]=[{'all':!![]}];}_0x3c7c5f=_[_0x82dd('0x3f')]({},_0x3c7c5f,_0x4cd127[_0x82dd('0x40')]);return db[_0x82dd('0x2f')]['find'](_0x3c7c5f)[_0x82dd('0x28')](handleEntityNotFound(_0x56fa01,null))[_0x82dd('0x28')](respondWithResult(_0x56fa01,null))[_0x82dd('0x48')](handleError(_0x56fa01,null));};exports['create']=function(_0x5e8a07,_0x240030){return db[_0x82dd('0x2f')][_0x82dd('0x49')](_0x5e8a07[_0x82dd('0x4a')],{})[_0x82dd('0x28')](function(_0x4ff539){var _0x5d5dd1=_0x5e8a07[_0x82dd('0x4b')][_0x82dd('0x29')]({'plain':!![]});if(!_0x5d5dd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d5dd1['role']==='user'){var _0x676ebd=_0x4ff539['get']({'plain':!![]});var _0x2805a0=_0x82dd('0x2a');return db[_0x82dd('0x4c')][_0x82dd('0x4d')]({'where':{'name':_0x2805a0,'userProfileId':_0x5d5dd1[_0x82dd('0x4e')]},'raw':!![]})[_0x82dd('0x28')](function(_0x34a530){if(_0x34a530&&_0x34a530[_0x82dd('0x4f')]===0x0){return db[_0x82dd('0x2b')]['create']({'name':_0x676ebd[_0x82dd('0x2d')],'resourceId':_0x676ebd['id'],'type':_0x34a530[_0x82dd('0x2d')],'sectionId':_0x34a530['id']},{})[_0x82dd('0x28')](function(){return _0x4ff539;});}else{return _0x4ff539;}})[_0x82dd('0x48')](function(_0x449209){logger[_0x82dd('0x2c')](_0x82dd('0x50'),_0x449209);throw _0x449209;});}return _0x4ff539;})[_0x82dd('0x28')](respondWithResult(_0x240030,0xc9))['catch'](handleError(_0x240030,null));};exports[_0x82dd('0x51')]=function(_0x18d7b5,_0x409420){if(_0x18d7b5[_0x82dd('0x4a')]['id']){delete _0x18d7b5[_0x82dd('0x4a')]['id'];}return db[_0x82dd('0x2f')][_0x82dd('0x4d')]({'where':{'id':_0x18d7b5['params']['id']}})[_0x82dd('0x28')](handleEntityNotFound(_0x409420,null))[_0x82dd('0x28')](saveUpdates(_0x18d7b5['body'],null))[_0x82dd('0x28')](respondWithResult(_0x409420,null))[_0x82dd('0x48')](handleError(_0x409420,null));};exports[_0x82dd('0x27')]=function(_0x494e2b,_0x9caf0f){return db['Team'][_0x82dd('0x4d')]({'where':{'id':_0x494e2b[_0x82dd('0x46')]['id']}})[_0x82dd('0x28')](handleEntityNotFound(_0x9caf0f,null))[_0x82dd('0x28')](removeEntity(_0x9caf0f,null))[_0x82dd('0x48')](handleError(_0x9caf0f,null));};exports[_0x82dd('0x52')]=function(_0x11fb7a,_0x2f2792,_0x186db4){return db['Team'][_0x82dd('0x53')]({'where':{'id':_0x11fb7a[_0x82dd('0x46')]['id']}})[_0x82dd('0x28')](handleEntityNotFound(_0x2f2792,null))['then'](function(_0xfe4392){if(!_0x11fb7a[_0x82dd('0x32')][_0x82dd('0x54')]||!utils[_0x82dd('0x55')](_0x11fb7a['query'][_0x82dd('0x54')])){throw new db[(_0x82dd('0x56'))][(_0x82dd('0x57'))](_0x82dd('0x58'));}var _0x11001f={};var _0x37a4a5={};_0x37a4a5['model']=_[_0x82dd('0x33')](db[_[_0x82dd('0x59')](_0x11fb7a[_0x82dd('0x32')][_0x82dd('0x54')]['toLowerCase']())+_0x82dd('0x5a')]['rawAttributes']);_0x37a4a5[_0x82dd('0x32')]=_[_0x82dd('0x33')](_0x11fb7a['query']);_0x37a4a5[_0x82dd('0x3a')]=_['intersection'](_0x37a4a5['model'],_0x37a4a5[_0x82dd('0x32')]);_0x11001f['attributes']=_[_0x82dd('0x34')](_0x37a4a5['model'],qs[_0x82dd('0x36')](_0x11fb7a[_0x82dd('0x32')]['fields']));_0x11001f['attributes']=_0x11001f['attributes'][_0x82dd('0x47')]?_0x11001f[_0x82dd('0x35')]:_0x37a4a5[_0x82dd('0x31')];_0x11001f['limit']=qs[_0x82dd('0x21')](_0x11fb7a[_0x82dd('0x32')]['limit']);_0x11001f[_0x82dd('0x20')]=qs['offset'](_0x11fb7a['query'][_0x82dd('0x20')]);_0x11001f['order']=qs[_0x82dd('0x38')](_0x11fb7a['query'][_0x82dd('0x38')]);_0x11001f[_0x82dd('0x39')]=qs['filters'](_[_0x82dd('0x5b')](_0x11fb7a['query'],_0x37a4a5[_0x82dd('0x3a')]));_0x11001f=_[_0x82dd('0x3f')]({},_0x11001f,_0x11fb7a[_0x82dd('0x40')]);return _0xfe4392[_0x82dd('0x29')+_[_0x82dd('0x59')](_0x11fb7a[_0x82dd('0x32')][_0x82dd('0x54')][_0x82dd('0x5c')]())+_0x82dd('0x5d')](_0x11001f);})['then'](respondWithResult(_0x2f2792,null))['catch'](handleError(_0x2f2792,null));};exports[_0x82dd('0x5e')]=function(_0xebf523,_0x4dc699,_0x2abe32){return db['Team'][_0x82dd('0x53')]({'where':{'id':_0xebf523[_0x82dd('0x46')]['id']}})['then'](function(_0x1e2173){if(_0x1e2173){if(!_0xebf523['body']['channel']||!utils[_0x82dd('0x55')](_0xebf523[_0x82dd('0x4a')][_0x82dd('0x54')])){throw new db[(_0x82dd('0x56'))]['ValidationError'](_0x82dd('0x58'));}return _0x1e2173[_0x82dd('0x5f')+_['capitalize'](_0xebf523[_0x82dd('0x4a')][_0x82dd('0x54')]['toLowerCase']())+'Queues'](_0xebf523[_0x82dd('0x4a')]['ids']);}return null;})[_0x82dd('0x28')](handleEntityNotFound(_0x4dc699,null))[_0x82dd('0x28')](respondWithStatusCode(_0x4dc699,null))[_0x82dd('0x48')](handleError(_0x4dc699,null));};exports[_0x82dd('0x60')]=function(_0x22dcff,_0xcf7518,_0x1b966d){return db[_0x82dd('0x2f')][_0x82dd('0x53')]({'where':{'id':_0x22dcff[_0x82dd('0x46')]['id']}})[_0x82dd('0x28')](function(_0x238903){if(_0x238903){if(!_0x22dcff[_0x82dd('0x32')][_0x82dd('0x54')]||!utils[_0x82dd('0x55')](_0x22dcff[_0x82dd('0x32')][_0x82dd('0x54')])){throw new db[(_0x82dd('0x56'))][(_0x82dd('0x57'))](_0x82dd('0x58'));}return _0x238903[_0x82dd('0x61')+_[_0x82dd('0x59')](_0x22dcff['query'][_0x82dd('0x54')][_0x82dd('0x5c')]())+_0x82dd('0x5d')](_0x22dcff[_0x82dd('0x32')][_0x82dd('0x62')]);}return null;})['then'](handleEntityNotFound(_0xcf7518,null))[_0x82dd('0x28')](respondWithStatusCode(_0xcf7518,null))[_0x82dd('0x48')](handleError(_0xcf7518,null));};exports[_0x82dd('0x63')]=function(_0x2b0cc6,_0x48bd4f,_0x5298ae){return db['Team'][_0x82dd('0x4d')]({'where':{'id':_0x2b0cc6[_0x82dd('0x46')]['id']}})[_0x82dd('0x28')](handleEntityNotFound(_0x48bd4f,null))[_0x82dd('0x28')](function(_0x28e86f){if(_0x28e86f){var _0x51060b=['Voice',_0x82dd('0x64'),_0x82dd('0x65'),_0x82dd('0x66'),'Fax',_0x82dd('0x67')];return BPromise[_0x82dd('0x68')](_0x51060b,function(_0x35cd7d){return _0x28e86f[_0x82dd('0x29')+_0x35cd7d+'Queues']({'attributes':['id',_0x82dd('0x2d')]})[_0x82dd('0x28')](function(_0x1f0fe1){return BPromise[_0x82dd('0x68')](_0x1f0fe1,function(_0x11be2d){return _0x11be2d[_0x82dd('0x63')](_0x2b0cc6['body'][_0x82dd('0x62')])['then'](function(){if(_0x35cd7d===_0x82dd('0x69')){return db['User'][_0x82dd('0x43')]({'where':{'id':_0x2b0cc6[_0x82dd('0x4a')]['ids']},'attributes':['id','name',_0x82dd('0x6a'),_0x82dd('0x6b'),'interface'],'raw':!![]})[_0x82dd('0x28')](function(_0x412752){return BPromise['each'](_[_0x82dd('0x3b')](_0x412752,{'online':0x1}),function(_0xebfc1f){return db[_0x82dd('0x6c')][_0x82dd('0x6d')]({'membername':_0xebfc1f[_0x82dd('0x2d')],'UserId':_0xebfc1f['id'],'queue_name':_0x11be2d[_0x82dd('0x2d')],'VoiceQueueId':_0x11be2d['id'],'interface':_[_0x82dd('0x6e')](_0xebfc1f[_0x82dd('0x6f')])?util[_0x82dd('0x70')](_0x82dd('0x71'),_0xebfc1f[_0x82dd('0x2d')]):_0xebfc1f[_0x82dd('0x6f')],'paused':_0xebfc1f['voicePause']||![],'penalty':0x0});});});}});});})[_0x82dd('0x28')](function(){return _0x28e86f;});})[_0x82dd('0x28')](function(){return _0x28e86f;});}})['then'](function(_0x4aae92){if(_0x4aae92){return _0x4aae92['addAgents'](_0x2b0cc6[_0x82dd('0x4a')][_0x82dd('0x62')],_[_0x82dd('0x72')](_0x2b0cc6[_0x82dd('0x4a')],[_0x82dd('0x62'),'id'])||{})['spread'](function(_0x15bd12){for(var _0x7d5867=0x0;_0x7d5867<_0x2b0cc6['body']['ids'][_0x82dd('0x47')];_0x7d5867+=0x1){socket['emit'](_0x82dd('0x73'),{'UserId':_0x2b0cc6['body']['ids'][_0x7d5867],'TeamId':_0x2b0cc6['params']['id']});}return _0x15bd12;});}})['then'](respondWithResult(_0x48bd4f,null))[_0x82dd('0x48')](handleError(_0x48bd4f,null));};exports[_0x82dd('0x74')]=function(_0x5ca0e8,_0x574707,_0x46c810){return db[_0x82dd('0x2f')][_0x82dd('0x4d')]({'where':{'id':_0x5ca0e8['params']['id']}})[_0x82dd('0x28')](handleEntityNotFound(_0x574707,null))[_0x82dd('0x28')](function(_0x183d04){if(_0x183d04){return BPromise[_0x82dd('0x68')]([_0x82dd('0x75'),_0x82dd('0x76'),_0x82dd('0x77'),_0x82dd('0x78'),'fax','openchannel'],function(_0x222837){return _0x183d04[_0x82dd('0x29')+_[_0x82dd('0x59')](_0x222837)+_0x82dd('0x5d')]({'attributes':['id',_0x82dd('0x2d')]})['then'](function(_0x28cf7c){return BPromise[_0x82dd('0x68')](_0x28cf7c,function(_0x826620){return _0x826620['removeAgents'](_0x5ca0e8['query']['ids'])[_0x82dd('0x28')](function(){if(_0x222837===_0x82dd('0x75')){return db[_0x82dd('0x6c')]['destroy']({'where':{'VoiceQueueId':_0x826620['id'],'UserId':_0x5ca0e8[_0x82dd('0x32')]['ids']}});}});});})[_0x82dd('0x28')](function(){return _0x183d04;});})[_0x82dd('0x28')](function(){return _0x183d04;});}})['then'](function(_0x1dda9a){if(_0x1dda9a){return _0x1dda9a[_0x82dd('0x74')](_0x5ca0e8[_0x82dd('0x32')][_0x82dd('0x62')])['then'](function(){if(_['isArray'](_0x5ca0e8['query'][_0x82dd('0x62')])){for(var _0x705c34=0x0;_0x705c34<_0x5ca0e8[_0x82dd('0x32')][_0x82dd('0x62')][_0x82dd('0x47')];_0x705c34+=0x1){socket[_0x82dd('0x79')]('userTeam:remove',{'UserId':Number(_0x5ca0e8[_0x82dd('0x32')][_0x82dd('0x62')][_0x705c34]),'TeamId':Number(_0x5ca0e8[_0x82dd('0x46')]['id'])});}}else{socket[_0x82dd('0x79')]('userTeam:remove',{'UserId':Number(_0x5ca0e8[_0x82dd('0x32')][_0x82dd('0x62')]),'TeamId':Number(_0x5ca0e8[_0x82dd('0x46')]['id'])});}});}})[_0x82dd('0x28')](respondWithStatusCode(_0x574707,null))['catch'](handleError(_0x574707,null));};exports[_0x82dd('0x7a')]=function(_0x2dcb14,_0x55eb7f,_0x6e0c78){var _0xb0f9cf={};var _0x217291={};var _0x1e4dd0;var _0x357eca;return db[_0x82dd('0x2f')]['findOne']({'where':{'id':_0x2dcb14['params']['id']}})['then'](handleEntityNotFound(_0x55eb7f,null))['then'](function(_0x48da98){if(_0x48da98){_0x1e4dd0=_0x48da98;_0x217291['model']=_[_0x82dd('0x33')](db[_0x82dd('0x7b')][_0x82dd('0x30')]);_0x217291['query']=_[_0x82dd('0x33')](_0x2dcb14[_0x82dd('0x32')]);_0x217291[_0x82dd('0x3a')]=_[_0x82dd('0x34')](_0x217291[_0x82dd('0x31')],_0x217291[_0x82dd('0x32')]);_0xb0f9cf[_0x82dd('0x35')]=_[_0x82dd('0x34')](_0x217291[_0x82dd('0x31')],qs[_0x82dd('0x36')](_0x2dcb14[_0x82dd('0x32')][_0x82dd('0x36')]));_0xb0f9cf['attributes']=_0xb0f9cf[_0x82dd('0x35')][_0x82dd('0x47')]?_0xb0f9cf[_0x82dd('0x35')]:_0x217291[_0x82dd('0x31')];_0xb0f9cf[_0x82dd('0x7c')]=qs['sort'](_0x2dcb14[_0x82dd('0x32')][_0x82dd('0x38')]);_0xb0f9cf[_0x82dd('0x39')]=qs[_0x82dd('0x3a')](_[_0x82dd('0x5b')](_0x2dcb14[_0x82dd('0x32')],_0x217291[_0x82dd('0x3a')]));if(_0x2dcb14[_0x82dd('0x32')][_0x82dd('0x3b')]){_0xb0f9cf[_0x82dd('0x39')]=_[_0x82dd('0x3f')](_0xb0f9cf[_0x82dd('0x39')],{'$or':_[_0x82dd('0x3c')](_0xb0f9cf[_0x82dd('0x35')],function(_0x235967){var _0x44b594={};_0x44b594[_0x235967]={'$like':'%'+_0x2dcb14[_0x82dd('0x32')][_0x82dd('0x3b')]+'%'};return _0x44b594;})});}_0xb0f9cf=_[_0x82dd('0x3f')]({},_0xb0f9cf,_0x2dcb14[_0x82dd('0x40')]);return _0x1e4dd0[_0x82dd('0x7a')](_0xb0f9cf);}})[_0x82dd('0x28')](function(_0x1f5953){if(_0x1f5953){_0x357eca=_0x1f5953[_0x82dd('0x47')];if(!_0x2dcb14[_0x82dd('0x32')]['hasOwnProperty'](_0x82dd('0x7d'))){_0xb0f9cf[_0x82dd('0x21')]=qs[_0x82dd('0x21')](_0x2dcb14[_0x82dd('0x32')][_0x82dd('0x21')]);_0xb0f9cf['offset']=qs['offset'](_0x2dcb14['query']['offset']);}return _0x1e4dd0['getAgents'](_0xb0f9cf);}})[_0x82dd('0x28')](function(_0x11f679){if(_0x11f679){return _0x11f679?{'count':_0x357eca,'rows':_0x11f679}:null;}})['then'](respondWithResult(_0x55eb7f,null))[_0x82dd('0x48')](handleError(_0x55eb7f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 55a016e..51cd1b1 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 _0x0f4a=['Team','save','update','emit','hook','events','../../mysqldb'];(function(_0x256788,_0x4f6f51){var _0x638b08=function(_0x353e7c){while(--_0x353e7c){_0x256788['push'](_0x256788['shift']());}};_0x638b08(++_0x4f6f51);}(_0x0f4a,0x15c));var _0xa0f4=function(_0x29e608,_0x1a6ccc){_0x29e608=_0x29e608-0x0;var _0x5d1d75=_0x0f4a[_0x29e608];return _0x5d1d75;};'use strict';var EventEmitter=require(_0xa0f4('0x0'));var Team=require(_0xa0f4('0x1'))['db'][_0xa0f4('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa0f4('0x3'),'afterUpdate':_0xa0f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x437d28){return function(_0x2edb33,_0x4c975d,_0x48b88d){TeamEvents[_0xa0f4('0x5')](_0x437d28+':'+_0x2edb33['id'],_0x2edb33);TeamEvents['emit'](_0x437d28,_0x2edb33);_0x48b88d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xa0f4('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc83f=['hook','exports','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x155739,_0x164e4d){var _0x452653=function(_0x3e0adc){while(--_0x3e0adc){_0x155739['push'](_0x155739['shift']());}};_0x452653(++_0x164e4d);}(_0xc83f,0xe2));var _0xfc83=function(_0x1124e6,_0x5db98a){_0x1124e6=_0x1124e6-0x0;var _0x2c7735=_0xc83f[_0x1124e6];return _0x2c7735;};'use strict';var EventEmitter=require('events');var Team=require(_0xfc83('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc83('0x1'),'afterDestroy':_0xfc83('0x2')};function emitEvent(_0x5e630f){return function(_0x16433f,_0xb14b84,_0x3dfa3b){TeamEvents[_0xfc83('0x3')](_0x5e630f+':'+_0x16433f['id'],_0x16433f);TeamEvents[_0xfc83('0x3')](_0x5e630f,_0x16433f);_0x3dfa3b(null);};}for(var e in events){if(events[_0xfc83('0x4')](e)){var event=events[e];Team[_0xfc83('0x5')](e,emitEvent(event));}}module[_0xfc83('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ff38d5c..2cb52aa 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 _0x4e40=['teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./team.attributes','exports','define'];(function(_0x368a98,_0x3cb1eb){var _0x5b0f1d=function(_0x1a5ebd){while(--_0x1a5ebd){_0x368a98['push'](_0x368a98['shift']());}};_0x5b0f1d(++_0x3cb1eb);}(_0x4e40,0xf8));var _0x04e4=function(_0x1f0191,_0x54c331){_0x1f0191=_0x1f0191-0x0;var _0x44fa92=_0x4e40[_0x1f0191];return _0x44fa92;};'use strict';var _=require(_0x04e4('0x0'));var util=require(_0x04e4('0x1'));var logger=require(_0x04e4('0x2'))(_0x04e4('0x3'));var moment=require(_0x04e4('0x4'));var BPromise=require(_0x04e4('0x5'));var rp=require(_0x04e4('0x6'));var fs=require('fs');var path=require(_0x04e4('0x7'));var rimraf=require('rimraf');var config=require(_0x04e4('0x8'));var attributes=require(_0x04e4('0x9'));module[_0x04e4('0xa')]=function(_0x37fade,_0x33d1b2){return _0x37fade[_0x04e4('0xb')]('Team',attributes,{'tableName':_0x04e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf05b=['exports','define','Team','teams','util','api','moment','request-promise','path','rimraf','../../config/environment','./team.attributes'];(function(_0x500650,_0x1c633f){var _0x3330d9=function(_0x5e4676){while(--_0x5e4676){_0x500650['push'](_0x500650['shift']());}};_0x3330d9(++_0x1c633f);}(_0xf05b,0x178));var _0xbf05=function(_0x16740d,_0x2f9332){_0x16740d=_0x16740d-0x0;var _0x299d79=_0xf05b[_0x16740d];return _0x299d79;};'use strict';var _=require('lodash');var util=require(_0xbf05('0x0'));var logger=require('../../config/logger')(_0xbf05('0x1'));var moment=require(_0xbf05('0x2'));var BPromise=require('bluebird');var rp=require(_0xbf05('0x3'));var fs=require('fs');var path=require(_0xbf05('0x4'));var rimraf=require(_0xbf05('0x5'));var config=require(_0xbf05('0x6'));var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x30b147,_0x5bf5be){return _0x30b147[_0xbf05('0x9')](_0xbf05('0xa'),attributes,{'tableName':_0xbf05('0xb'),'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 339adbf..5fc1c2e 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 _0x1374=['http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x1374,0x10d));var _0x4137=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1374[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x4137('0x0'));var moment=require(_0x4137('0x1'));var BPromise=require(_0x4137('0x2'));var rs=require(_0x4137('0x3'));var fs=require('fs');var Redis=require(_0x4137('0x4'));var db=require(_0x4137('0x5'))['db'];var utils=require(_0x4137('0x6'));var logger=require(_0x4137('0x7'))(_0x4137('0x8'));var config=require(_0x4137('0x9'));var jayson=require(_0x4137('0xa'));var client=jayson['client'][_0x4137('0xb')]({'port':0x232a});config[_0x4137('0xc')]=_[_0x4137('0xd')](config[_0x4137('0xc')],{'host':_0x4137('0xe'),'port':0x18eb});var socket=require(_0x4137('0xf'))(new Redis(config[_0x4137('0xc')]));require(_0x4137('0x10'))[_0x4137('0x11')](socket);function respondWithRpcPromise(_0x28fdfe,_0x43a33b,_0x19f0ba){return new BPromise(function(_0x493662,_0x552e72){return client['request'](_0x28fdfe,_0x19f0ba)[_0x4137('0x12')](function(_0x2cd22c){logger[_0x4137('0x13')](_0x4137('0x14'),_0x43a33b,_0x4137('0x15'));logger[_0x4137('0x16')](_0x4137('0x17'),_0x43a33b,_0x4137('0x15'),JSON['stringify'](_0x2cd22c));if(_0x2cd22c[_0x4137('0x18')]){if(_0x2cd22c[_0x4137('0x18')][_0x4137('0x19')]===0x1f4){logger[_0x4137('0x18')](_0x4137('0x14'),_0x43a33b,_0x2cd22c[_0x4137('0x18')]['message']);return _0x552e72(_0x2cd22c[_0x4137('0x18')][_0x4137('0x1a')]);}logger['error'](_0x4137('0x14'),_0x43a33b,_0x2cd22c[_0x4137('0x18')][_0x4137('0x1a')]);return _0x493662(_0x2cd22c[_0x4137('0x18')]['message']);}else{logger[_0x4137('0x13')](_0x4137('0x14'),_0x43a33b,_0x4137('0x15'));_0x493662(_0x2cd22c[_0x4137('0x1b')][_0x4137('0x1a')]);}})['catch'](function(_0x4c8fc2){logger['error'](_0x4137('0x14'),_0x43a33b,_0x4c8fc2);_0x552e72(_0x4c8fc2);});});} \ No newline at end of file +var _0x4eac=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3cf907,_0x557f7b){var _0x18f88f=function(_0x29d715){while(--_0x29d715){_0x3cf907['push'](_0x3cf907['shift']());}};_0x18f88f(++_0x557f7b);}(_0x4eac,0xc0));var _0xc4ea=function(_0x35f7f6,_0x4b695c){_0x35f7f6=_0x35f7f6-0x0;var _0x317847=_0x4eac[_0x35f7f6];return _0x317847;};'use strict';var _=require(_0xc4ea('0x0'));var util=require(_0xc4ea('0x1'));var moment=require(_0xc4ea('0x2'));var BPromise=require(_0xc4ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4ea('0x4'))['db'];var utils=require(_0xc4ea('0x5'));var logger=require(_0xc4ea('0x6'))(_0xc4ea('0x7'));var config=require(_0xc4ea('0x8'));var jayson=require(_0xc4ea('0x9'));var client=jayson[_0xc4ea('0xa')][_0xc4ea('0xb')]({'port':0x232a});config[_0xc4ea('0xc')]=_['defaults'](config[_0xc4ea('0xc')],{'host':_0xc4ea('0xd'),'port':0x18eb});var socket=require(_0xc4ea('0xe'))(new Redis(config[_0xc4ea('0xc')]));require('./team.socket')[_0xc4ea('0xf')](socket);function respondWithRpcPromise(_0x2a6149,_0x36729c,_0x35226d){return new BPromise(function(_0x501d10,_0x5df360){return client[_0xc4ea('0x10')](_0x2a6149,_0x35226d)[_0xc4ea('0x11')](function(_0x5a052c){logger[_0xc4ea('0x12')](_0xc4ea('0x13'),_0x36729c,_0xc4ea('0x14'));logger['debug'](_0xc4ea('0x15'),_0x36729c,_0xc4ea('0x14'),JSON[_0xc4ea('0x16')](_0x5a052c));if(_0x5a052c[_0xc4ea('0x17')]){if(_0x5a052c[_0xc4ea('0x17')][_0xc4ea('0x18')]===0x1f4){logger[_0xc4ea('0x17')](_0xc4ea('0x13'),_0x36729c,_0x5a052c['error']['message']);return _0x5df360(_0x5a052c['error']['message']);}logger[_0xc4ea('0x17')](_0xc4ea('0x13'),_0x36729c,_0x5a052c['error'][_0xc4ea('0x19')]);return _0x501d10(_0x5a052c[_0xc4ea('0x17')][_0xc4ea('0x19')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x36729c,'request\x20sent');_0x501d10(_0x5a052c[_0xc4ea('0x1a')][_0xc4ea('0x19')]);}})[_0xc4ea('0x1b')](function(_0x42ff38){logger['error']('Team,\x20%s,\x20%s',_0x36729c,_0x42ff38);_0x5df360(_0x42ff38);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 86e61b1..c3978ed 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 _0x3cc3=['team:','./team.events','save','emit','removeListener','register','length'];(function(_0x784604,_0x504fa9){var _0xc85f1a=function(_0x40dea9){while(--_0x40dea9){_0x784604['push'](_0x784604['shift']());}};_0xc85f1a(++_0x504fa9);}(_0x3cc3,0x10b));var _0x33cc=function(_0x3140db,_0x420b9d){_0x3140db=_0x3140db-0x0;var _0x55f837=_0x3cc3[_0x3140db];return _0x55f837;};'use strict';var TeamEvents=require(_0x33cc('0x0'));var events=[_0x33cc('0x1'),'remove','update'];function createListener(_0x45103c,_0xcd31a0){return function(_0x571581){_0xcd31a0[_0x33cc('0x2')](_0x45103c,_0x571581);};}function removeListener(_0x424936,_0x3f5ed1){return function(){TeamEvents[_0x33cc('0x3')](_0x424936,_0x3f5ed1);};}exports[_0x33cc('0x4')]=function(_0x397fb1){for(var _0x542346=0x0,_0x58bc15=events[_0x33cc('0x5')];_0x542346<_0x58bc15;_0x542346++){var _0x433d29=events[_0x542346];var _0x1c5da1=createListener(_0x33cc('0x6')+_0x433d29,_0x397fb1);TeamEvents['on'](_0x433d29,_0x1c5da1);}}; \ No newline at end of file +var _0x8b96=['register','length','team:','./team.events','save','remove','removeListener'];(function(_0x5499fc,_0x410d26){var _0x4857f3=function(_0x273029){while(--_0x273029){_0x5499fc['push'](_0x5499fc['shift']());}};_0x4857f3(++_0x410d26);}(_0x8b96,0x176));var _0x68b9=function(_0x44101e,_0x414390){_0x44101e=_0x44101e-0x0;var _0x3d7be2=_0x8b96[_0x44101e];return _0x3d7be2;};'use strict';var TeamEvents=require(_0x68b9('0x0'));var events=[_0x68b9('0x1'),_0x68b9('0x2'),'update'];function createListener(_0x336801,_0x570275){return function(_0x31ed01){_0x570275['emit'](_0x336801,_0x31ed01);};}function removeListener(_0x4f6679,_0x3c2139){return function(){TeamEvents[_0x68b9('0x3')](_0x4f6679,_0x3c2139);};}exports[_0x68b9('0x4')]=function(_0x76261a){for(var _0x1bb067=0x0,_0xc94ce2=events[_0x68b9('0x5')];_0x1bb067<_0xc94ce2;_0x1bb067++){var _0x40a6ae=events[_0x1bb067];var _0x106c5e=createListener(_0x68b9('0x6')+_0x40a6ae,_0x76261a);TeamEvents['on'](_0x40a6ae,_0x106c5e);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 11f905a..afbc28d 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 _0xd6b8=['update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0xd6b8,0xc9));var _0x8d6b=function(_0x37ea76,_0x3f2b7b){_0x37ea76=_0x37ea76-0x0;var _0x1ddaf9=_0xd6b8[_0x37ea76];return _0x1ddaf9;};'use strict';var multer=require(_0x8d6b('0x0'));var util=require(_0x8d6b('0x1'));var path=require('path');var timeout=require(_0x8d6b('0x2'));var express=require(_0x8d6b('0x3'));var router=express['Router']();var auth=require(_0x8d6b('0x4'));var interaction=require(_0x8d6b('0x5'));var config=require(_0x8d6b('0x6'));var controller=require(_0x8d6b('0x7'));router[_0x8d6b('0x8')]('/',auth[_0x8d6b('0x9')](),controller[_0x8d6b('0xa')]);router[_0x8d6b('0x8')](_0x8d6b('0xb'),auth['isAuthenticated'](),controller[_0x8d6b('0xc')]);router['post']('/',auth[_0x8d6b('0x9')](),controller[_0x8d6b('0xd')]);router[_0x8d6b('0xe')](_0x8d6b('0xb'),auth[_0x8d6b('0x9')](),controller[_0x8d6b('0xf')]);router[_0x8d6b('0x10')](_0x8d6b('0xb'),auth[_0x8d6b('0x9')](),controller[_0x8d6b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0c8b=['path','connect-timeout','./template.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x4efb4a,_0x43bd7a){var _0x265085=function(_0x268a2a){while(--_0x268a2a){_0x4efb4a['push'](_0x4efb4a['shift']());}};_0x265085(++_0x43bd7a);}(_0x0c8b,0x1df));var _0xb0c8=function(_0x727f82,_0x29531d){_0x727f82=_0x727f82-0x0;var _0x324e51=_0x0c8b[_0x727f82];return _0x324e51;};'use strict';var multer=require(_0xb0c8('0x0'));var util=require('util');var path=require(_0xb0c8('0x1'));var timeout=require(_0xb0c8('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb0c8('0x3'));router[_0xb0c8('0x4')]('/',auth['isAuthenticated'](),controller[_0xb0c8('0x5')]);router[_0xb0c8('0x4')](_0xb0c8('0x6'),auth['isAuthenticated'](),controller[_0xb0c8('0x7')]);router[_0xb0c8('0x8')]('/',auth[_0xb0c8('0x9')](),controller['create']);router[_0xb0c8('0xa')](_0xb0c8('0x6'),auth['isAuthenticated'](),controller[_0xb0c8('0xb')]);router[_0xb0c8('0xc')](_0xb0c8('0x6'),auth['isAuthenticated'](),controller[_0xb0c8('0xd')]);module[_0xb0c8('0xe')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 01f8c36..d70a756 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 _0x1053=['exports','STRING'];(function(_0x42b9f2,_0x2cba5d){var _0x333f72=function(_0x37a436){while(--_0x37a436){_0x42b9f2['push'](_0x42b9f2['shift']());}};_0x333f72(++_0x2cba5d);}(_0x1053,0x12c));var _0x3105=function(_0x19c0ea,_0x19f687){_0x19c0ea=_0x19c0ea-0x0;var _0x3db00e=_0x1053[_0x19c0ea];return _0x3db00e;};'use strict';var Sequelize=require('sequelize');module[_0x3105('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3105('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe37b=['TEXT','STRING'];(function(_0x379b7e,_0xa9be4){var _0x599434=function(_0x11f413){while(--_0x11f413){_0x379b7e['push'](_0x379b7e['shift']());}};_0x599434(++_0xa9be4);}(_0xe37b,0x1d9));var _0xbe37=function(_0x2f2379,_0x34d299){_0x2f2379=_0x2f2379-0x0;var _0x227ef9=_0xe37b[_0x2f2379];return _0x227ef9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbe37('0x0')]},'html':{'type':Sequelize[_0xbe37('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b5efe40..af10793 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 _0xb6a0=['where','merge','map','type','key','VIRTUAL','field','includeAll','include','Template','findAll','rows','catch','show','params','filters','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','index','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort'];(function(_0x332f63,_0x1ce853){var _0x2065b1=function(_0x1f9242){while(--_0x1f9242){_0x332f63['push'](_0x332f63['shift']());}};_0x2065b1(++_0x1ce853);}(_0xb6a0,0x157));var _0x0b6a=function(_0x4da23d,_0x2440fb){_0x4da23d=_0x4da23d-0x0;var _0x4cb1ba=_0xb6a0[_0x4da23d];return _0x4cb1ba;};'use strict';var pdf=require(_0x0b6a('0x0'));var emlformat=require(_0x0b6a('0x1'));var rimraf=require(_0x0b6a('0x2'));var zipdir=require(_0x0b6a('0x3'));var jsonpatch=require(_0x0b6a('0x4'));var rp=require(_0x0b6a('0x5'));var moment=require(_0x0b6a('0x6'));var BPromise=require(_0x0b6a('0x7'));var Mustache=require(_0x0b6a('0x8'));var util=require(_0x0b6a('0x9'));var path=require('path');var sox=require(_0x0b6a('0xa'));var csv=require('to-csv');var ejs=require(_0x0b6a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b6a('0xc'));var crypto=require(_0x0b6a('0xd'));var jsforce=require(_0x0b6a('0xe'));var deskjs=require(_0x0b6a('0xf'));var toCsv=require(_0x0b6a('0x10'));var querystring=require(_0x0b6a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b6a('0x12'));var qs=require(_0x0b6a('0x13'));var hardwareService=require(_0x0b6a('0x14'));var logger=require(_0x0b6a('0x15'))(_0x0b6a('0x16'));var utils=require(_0x0b6a('0x17'));var config=require(_0x0b6a('0x18'));var db=require(_0x0b6a('0x19'))['db'];function respondWithStatusCode(_0x141950,_0x70e384){_0x70e384=_0x70e384||0xcc;return function(_0x1854f8){if(_0x1854f8){return _0x141950[_0x0b6a('0x1a')](_0x70e384);}return _0x141950[_0x0b6a('0x1b')](_0x70e384)[_0x0b6a('0x1c')]();};}function respondWithResult(_0x5128fb,_0x2a24b4){_0x2a24b4=_0x2a24b4||0xc8;return function(_0x54462c){if(_0x54462c){return _0x5128fb[_0x0b6a('0x1b')](_0x2a24b4)['json'](_0x54462c);}};}function respondWithFilteredResult(_0x123c91,_0xd06f10){return function(_0x2512b0){if(_0x2512b0){var _0x1e2872=_0x2512b0[_0x0b6a('0x1d')],_0x2cac1d=_0xd06f10[_0x0b6a('0x1e')],_0x5d4c33=_0xd06f10['offset']+_0xd06f10['limit'],_0x3e36d1;if(_0x5d4c33>=_0x1e2872){_0x5d4c33=_0x1e2872;_0x3e36d1=0xc8;}else{_0x3e36d1=0xce;}_0x123c91[_0x0b6a('0x1b')](_0x3e36d1);return _0x123c91['set'](_0x0b6a('0x1f'),_0x2cac1d+'-'+_0x5d4c33+'/'+_0x1e2872)[_0x0b6a('0x20')](_0x2512b0);}return null;};}function patchUpdates(_0x44c418){return function(_0x4ced99){try{jsonpatch[_0x0b6a('0x21')](_0x4ced99,_0x44c418,!![]);}catch(_0x50c857){return BPromise[_0x0b6a('0x22')](_0x50c857);}return _0x4ced99[_0x0b6a('0x23')]();};}function saveUpdates(_0x38eecd,_0x42e18a){return function(_0x2e44fe){if(_0x2e44fe){return _0x2e44fe[_0x0b6a('0x24')](_0x38eecd)['then'](function(_0x101acb){return _0x101acb;});}return null;};}function removeEntity(_0x5650b7,_0x4289b9){return function(_0x20b1bc){if(_0x20b1bc){return _0x20b1bc[_0x0b6a('0x25')]()[_0x0b6a('0x26')](function(){var _0x319ef7=_0x20b1bc[_0x0b6a('0x27')]({'plain':!![]});var _0x3dbdcd=_0x0b6a('0x28');return db[_0x0b6a('0x29')][_0x0b6a('0x25')]({'where':{'type':_0x3dbdcd,'resourceId':_0x319ef7['id']}})[_0x0b6a('0x26')](function(){return _0x20b1bc;});})[_0x0b6a('0x26')](function(){_0x5650b7[_0x0b6a('0x1b')](0xcc)[_0x0b6a('0x1c')]();});}};}function handleEntityNotFound(_0x3284ba,_0x123c09){return function(_0x49dc75){if(!_0x49dc75){_0x3284ba[_0x0b6a('0x1a')](0x194);}return _0x49dc75;};}function handleError(_0x406cfc,_0x41612b){_0x41612b=_0x41612b||0x1f4;return function(_0x5c79bc){logger[_0x0b6a('0x2a')](_0x5c79bc[_0x0b6a('0x2b')]);if(_0x5c79bc[_0x0b6a('0x2c')]){delete _0x5c79bc['name'];}_0x406cfc[_0x0b6a('0x1b')](_0x41612b)['send'](_0x5c79bc);};}exports[_0x0b6a('0x2d')]=function(_0x165c66,_0x55d092){var _0x72cda={},_0x292a66={},_0x24b7ff={'count':0x0,'rows':[]};var _0x20b5af=db['Template'][_0x0b6a('0x2e')];_0x292a66[_0x0b6a('0x2f')]=_['keys'](_0x20b5af);_0x292a66[_0x0b6a('0x30')]=_[_0x0b6a('0x31')](_0x165c66[_0x0b6a('0x30')]);_0x292a66['filters']=_[_0x0b6a('0x32')](_0x292a66[_0x0b6a('0x2f')],_0x292a66[_0x0b6a('0x30')]);_0x72cda[_0x0b6a('0x33')]=_[_0x0b6a('0x32')](_0x292a66[_0x0b6a('0x2f')],qs[_0x0b6a('0x34')](_0x165c66[_0x0b6a('0x30')][_0x0b6a('0x34')]));_0x72cda[_0x0b6a('0x33')]=_0x72cda['attributes']['length']?_0x72cda[_0x0b6a('0x33')]:_0x292a66['model'];if(!_0x165c66['query'][_0x0b6a('0x35')](_0x0b6a('0x36'))){_0x72cda[_0x0b6a('0x37')]=qs[_0x0b6a('0x37')](_0x165c66['query'][_0x0b6a('0x37')]);_0x72cda[_0x0b6a('0x1e')]=qs[_0x0b6a('0x1e')](_0x165c66[_0x0b6a('0x30')]['offset']);}_0x72cda['order']=qs[_0x0b6a('0x38')](_0x165c66['query']['sort']);_0x72cda[_0x0b6a('0x39')]=qs['filters'](_['pick'](_0x165c66[_0x0b6a('0x30')],_0x292a66['filters']));if(_0x165c66[_0x0b6a('0x30')]['filter']){_0x72cda[_0x0b6a('0x39')]=_[_0x0b6a('0x3a')](_0x72cda[_0x0b6a('0x39')],{'$or':_[_0x0b6a('0x3b')](_0x20b5af,function(_0x5bca50){if(_0x5bca50[_0x0b6a('0x3c')][_0x0b6a('0x3d')]!==_0x0b6a('0x3e')){var _0x58c24c={};_0x58c24c[_0x5bca50[_0x0b6a('0x3f')]]={'$like':'%'+_0x165c66[_0x0b6a('0x30')]['filter']+'%'};return _0x58c24c;}})});}_0x72cda=_[_0x0b6a('0x3a')]({},_0x72cda,_0x165c66['options']);var _0xcda426={'where':_0x72cda[_0x0b6a('0x39')]};return db['Template']['count'](_0xcda426)['then'](function(_0x1cb6b2){_0x24b7ff[_0x0b6a('0x1d')]=_0x1cb6b2;if(_0x165c66[_0x0b6a('0x30')][_0x0b6a('0x40')]){_0x72cda[_0x0b6a('0x41')]=[{'all':!![]}];}return db[_0x0b6a('0x42')][_0x0b6a('0x43')](_0x72cda);})[_0x0b6a('0x26')](function(_0x5cd3f8){_0x24b7ff[_0x0b6a('0x44')]=_0x5cd3f8;return _0x24b7ff;})[_0x0b6a('0x26')](respondWithFilteredResult(_0x55d092,_0x72cda))[_0x0b6a('0x45')](handleError(_0x55d092,null));};exports[_0x0b6a('0x46')]=function(_0x395f1f,_0x194e3e){var _0x282233={'raw':!![],'where':{'id':_0x395f1f[_0x0b6a('0x47')]['id']}},_0x5a8a52={};_0x5a8a52['model']=_['keys'](db[_0x0b6a('0x42')][_0x0b6a('0x2e')]);_0x5a8a52[_0x0b6a('0x30')]=_['keys'](_0x395f1f[_0x0b6a('0x30')]);_0x5a8a52[_0x0b6a('0x48')]=_[_0x0b6a('0x32')](_0x5a8a52[_0x0b6a('0x2f')],_0x5a8a52['query']);_0x282233[_0x0b6a('0x33')]=_['intersection'](_0x5a8a52[_0x0b6a('0x2f')],qs['fields'](_0x395f1f[_0x0b6a('0x30')][_0x0b6a('0x34')]));_0x282233[_0x0b6a('0x33')]=_0x282233[_0x0b6a('0x33')]['length']?_0x282233[_0x0b6a('0x33')]:_0x5a8a52[_0x0b6a('0x2f')];if(_0x395f1f['query']['includeAll']){_0x282233[_0x0b6a('0x41')]=[{'all':!![]}];}_0x282233=_['merge']({},_0x282233,_0x395f1f['options']);return db[_0x0b6a('0x42')][_0x0b6a('0x49')](_0x282233)[_0x0b6a('0x26')](handleEntityNotFound(_0x194e3e,null))[_0x0b6a('0x26')](respondWithResult(_0x194e3e,null))[_0x0b6a('0x45')](handleError(_0x194e3e,null));};exports[_0x0b6a('0x4a')]=function(_0x5ce6c9,_0x423dd6){return db[_0x0b6a('0x42')][_0x0b6a('0x4a')](_0x5ce6c9['body'],{})[_0x0b6a('0x26')](function(_0xb4957e){var _0x357a9e=_0x5ce6c9['user'][_0x0b6a('0x27')]({'plain':!![]});if(!_0x357a9e)throw new Error(_0x0b6a('0x4b'));if(_0x357a9e[_0x0b6a('0x4c')]==='user'){var _0x2cdf9c=_0xb4957e[_0x0b6a('0x27')]({'plain':!![]});var _0x158bc9=_0x0b6a('0x28');return db['UserProfileSection'][_0x0b6a('0x49')]({'where':{'name':_0x158bc9,'userProfileId':_0x357a9e['userProfileId']},'raw':!![]})[_0x0b6a('0x26')](function(_0x6dd296){if(_0x6dd296&&_0x6dd296[_0x0b6a('0x4d')]===0x0){return db[_0x0b6a('0x29')]['create']({'name':_0x2cdf9c[_0x0b6a('0x2c')],'resourceId':_0x2cdf9c['id'],'type':_0x6dd296[_0x0b6a('0x2c')],'sectionId':_0x6dd296['id']},{})[_0x0b6a('0x26')](function(){return _0xb4957e;});}else{return _0xb4957e;}})[_0x0b6a('0x45')](function(_0x4f93dd){logger[_0x0b6a('0x2a')](_0x0b6a('0x4e'),_0x4f93dd);throw _0x4f93dd;});}return _0xb4957e;})[_0x0b6a('0x26')](respondWithResult(_0x423dd6,0xc9))[_0x0b6a('0x45')](handleError(_0x423dd6,null));};exports[_0x0b6a('0x24')]=function(_0x7a2f66,_0x47c458){if(_0x7a2f66[_0x0b6a('0x4f')]['id']){delete _0x7a2f66['body']['id'];}return db[_0x0b6a('0x42')][_0x0b6a('0x49')]({'where':{'id':_0x7a2f66['params']['id']}})[_0x0b6a('0x26')](handleEntityNotFound(_0x47c458,null))[_0x0b6a('0x26')](saveUpdates(_0x7a2f66[_0x0b6a('0x4f')],null))[_0x0b6a('0x26')](respondWithResult(_0x47c458,null))[_0x0b6a('0x45')](handleError(_0x47c458,null));};exports['destroy']=function(_0x4a9455,_0x5e07d8){return db['Template'][_0x0b6a('0x49')]({'where':{'id':_0x4a9455['params']['id']}})['then'](handleEntityNotFound(_0x5e07d8,null))[_0x0b6a('0x26')](removeEntity(_0x5e07d8,null))[_0x0b6a('0x45')](handleError(_0x5e07d8,null));}; \ No newline at end of file +var _0xb85f=['reject','save','update','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','send','Template','rawAttributes','keys','query','intersection','attributes','model','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','count','offset','limit','status','set','Content-Range','apply'];(function(_0x447af3,_0x381c44){var _0x202e95=function(_0x29daef){while(--_0x29daef){_0x447af3['push'](_0x447af3['shift']());}};_0x202e95(++_0x381c44);}(_0xb85f,0xc8));var _0xfb85=function(_0x5f51a0,_0x47a5c2){_0x5f51a0=_0x5f51a0-0x0;var _0x211411=_0xb85f[_0x5f51a0];return _0x211411;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfb85('0x0'));var rimraf=require(_0xfb85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb85('0x2'));var rp=require(_0xfb85('0x3'));var moment=require(_0xfb85('0x4'));var BPromise=require(_0xfb85('0x5'));var Mustache=require(_0xfb85('0x6'));var util=require(_0xfb85('0x7'));var path=require(_0xfb85('0x8'));var sox=require(_0xfb85('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfb85('0xa'));var squel=require(_0xfb85('0xb'));var crypto=require('crypto');var jsforce=require(_0xfb85('0xc'));var deskjs=require(_0xfb85('0xd'));var toCsv=require(_0xfb85('0xe'));var querystring=require(_0xfb85('0xf'));var Papa=require('papaparse');var Redis=require(_0xfb85('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfb85('0x11'));var hardwareService=require(_0xfb85('0x12'));var logger=require(_0xfb85('0x13'))(_0xfb85('0x14'));var utils=require(_0xfb85('0x15'));var config=require('../../config/environment');var db=require(_0xfb85('0x16'))['db'];function respondWithStatusCode(_0x16d71c,_0x5dca0c){_0x5dca0c=_0x5dca0c||0xcc;return function(_0x256662){if(_0x256662){return _0x16d71c['sendStatus'](_0x5dca0c);}return _0x16d71c['status'](_0x5dca0c)['end']();};}function respondWithResult(_0x52766b,_0x24914c){_0x24914c=_0x24914c||0xc8;return function(_0x23440d){if(_0x23440d){return _0x52766b['status'](_0x24914c)[_0xfb85('0x17')](_0x23440d);}};}function respondWithFilteredResult(_0xa5770b,_0x21c6ad){return function(_0x349902){if(_0x349902){var _0x241916=_0x349902[_0xfb85('0x18')],_0x220dc2=_0x21c6ad[_0xfb85('0x19')],_0xa2a32=_0x21c6ad['offset']+_0x21c6ad[_0xfb85('0x1a')],_0x2c48c1;if(_0xa2a32>=_0x241916){_0xa2a32=_0x241916;_0x2c48c1=0xc8;}else{_0x2c48c1=0xce;}_0xa5770b[_0xfb85('0x1b')](_0x2c48c1);return _0xa5770b[_0xfb85('0x1c')](_0xfb85('0x1d'),_0x220dc2+'-'+_0xa2a32+'/'+_0x241916)[_0xfb85('0x17')](_0x349902);}return null;};}function patchUpdates(_0x12884a){return function(_0x63981c){try{jsonpatch[_0xfb85('0x1e')](_0x63981c,_0x12884a,!![]);}catch(_0x4ddbd0){return BPromise[_0xfb85('0x1f')](_0x4ddbd0);}return _0x63981c[_0xfb85('0x20')]();};}function saveUpdates(_0x17f36f,_0x2c2867){return function(_0x3fab36){if(_0x3fab36){return _0x3fab36[_0xfb85('0x21')](_0x17f36f)[_0xfb85('0x22')](function(_0x58a4e0){return _0x58a4e0;});}return null;};}function removeEntity(_0x279277,_0x2f39c7){return function(_0x348fa4){if(_0x348fa4){return _0x348fa4[_0xfb85('0x23')]()[_0xfb85('0x22')](function(){var _0x39e69f=_0x348fa4[_0xfb85('0x24')]({'plain':!![]});var _0x18fd94=_0xfb85('0x25');return db[_0xfb85('0x26')][_0xfb85('0x23')]({'where':{'type':_0x18fd94,'resourceId':_0x39e69f['id']}})['then'](function(){return _0x348fa4;});})[_0xfb85('0x22')](function(){_0x279277[_0xfb85('0x1b')](0xcc)[_0xfb85('0x27')]();});}};}function handleEntityNotFound(_0xf18535,_0x36e9f7){return function(_0xfdf2c){if(!_0xfdf2c){_0xf18535['sendStatus'](0x194);}return _0xfdf2c;};}function handleError(_0xce8952,_0x2205d9){_0x2205d9=_0x2205d9||0x1f4;return function(_0x36b39b){logger[_0xfb85('0x28')](_0x36b39b[_0xfb85('0x29')]);if(_0x36b39b[_0xfb85('0x2a')]){delete _0x36b39b[_0xfb85('0x2a')];}_0xce8952['status'](_0x2205d9)[_0xfb85('0x2b')](_0x36b39b);};}exports['index']=function(_0x11db8d,_0x4cbb7d){var _0x17d674={},_0x50c886={},_0x39a830={'count':0x0,'rows':[]};var _0x3622a1=db[_0xfb85('0x2c')][_0xfb85('0x2d')];_0x50c886['model']=_[_0xfb85('0x2e')](_0x3622a1);_0x50c886['query']=_[_0xfb85('0x2e')](_0x11db8d[_0xfb85('0x2f')]);_0x50c886['filters']=_[_0xfb85('0x30')](_0x50c886['model'],_0x50c886[_0xfb85('0x2f')]);_0x17d674[_0xfb85('0x31')]=_['intersection'](_0x50c886[_0xfb85('0x32')],qs['fields'](_0x11db8d[_0xfb85('0x2f')]['fields']));_0x17d674[_0xfb85('0x31')]=_0x17d674['attributes']['length']?_0x17d674[_0xfb85('0x31')]:_0x50c886['model'];if(!_0x11db8d[_0xfb85('0x2f')]['hasOwnProperty'](_0xfb85('0x33'))){_0x17d674[_0xfb85('0x1a')]=qs[_0xfb85('0x1a')](_0x11db8d[_0xfb85('0x2f')][_0xfb85('0x1a')]);_0x17d674[_0xfb85('0x19')]=qs['offset'](_0x11db8d['query'][_0xfb85('0x19')]);}_0x17d674[_0xfb85('0x34')]=qs['sort'](_0x11db8d[_0xfb85('0x2f')][_0xfb85('0x35')]);_0x17d674[_0xfb85('0x36')]=qs[_0xfb85('0x37')](_[_0xfb85('0x38')](_0x11db8d[_0xfb85('0x2f')],_0x50c886['filters']));if(_0x11db8d[_0xfb85('0x2f')][_0xfb85('0x39')]){_0x17d674[_0xfb85('0x36')]=_[_0xfb85('0x3a')](_0x17d674[_0xfb85('0x36')],{'$or':_['map'](_0x3622a1,function(_0xeef227){if(_0xeef227[_0xfb85('0x3b')][_0xfb85('0x3c')]!==_0xfb85('0x3d')){var _0x247c46={};_0x247c46[_0xeef227['field']]={'$like':'%'+_0x11db8d['query'][_0xfb85('0x39')]+'%'};return _0x247c46;}})});}_0x17d674=_[_0xfb85('0x3a')]({},_0x17d674,_0x11db8d[_0xfb85('0x3e')]);var _0x32ec40={'where':_0x17d674['where']};return db[_0xfb85('0x2c')]['count'](_0x32ec40)[_0xfb85('0x22')](function(_0x5bc544){_0x39a830[_0xfb85('0x18')]=_0x5bc544;if(_0x11db8d[_0xfb85('0x2f')][_0xfb85('0x3f')]){_0x17d674['include']=[{'all':!![]}];}return db['Template'][_0xfb85('0x40')](_0x17d674);})[_0xfb85('0x22')](function(_0x17fa2b){_0x39a830[_0xfb85('0x41')]=_0x17fa2b;return _0x39a830;})[_0xfb85('0x22')](respondWithFilteredResult(_0x4cbb7d,_0x17d674))[_0xfb85('0x42')](handleError(_0x4cbb7d,null));};exports[_0xfb85('0x43')]=function(_0x525ea9,_0x1d82b2){var _0x557f30={'raw':!![],'where':{'id':_0x525ea9['params']['id']}},_0x1a4c2c={};_0x1a4c2c[_0xfb85('0x32')]=_[_0xfb85('0x2e')](db[_0xfb85('0x2c')][_0xfb85('0x2d')]);_0x1a4c2c[_0xfb85('0x2f')]=_[_0xfb85('0x2e')](_0x525ea9[_0xfb85('0x2f')]);_0x1a4c2c[_0xfb85('0x37')]=_[_0xfb85('0x30')](_0x1a4c2c['model'],_0x1a4c2c[_0xfb85('0x2f')]);_0x557f30['attributes']=_[_0xfb85('0x30')](_0x1a4c2c[_0xfb85('0x32')],qs['fields'](_0x525ea9[_0xfb85('0x2f')]['fields']));_0x557f30['attributes']=_0x557f30[_0xfb85('0x31')][_0xfb85('0x44')]?_0x557f30[_0xfb85('0x31')]:_0x1a4c2c['model'];if(_0x525ea9['query'][_0xfb85('0x3f')]){_0x557f30['include']=[{'all':!![]}];}_0x557f30=_['merge']({},_0x557f30,_0x525ea9['options']);return db[_0xfb85('0x2c')][_0xfb85('0x45')](_0x557f30)[_0xfb85('0x22')](handleEntityNotFound(_0x1d82b2,null))['then'](respondWithResult(_0x1d82b2,null))[_0xfb85('0x42')](handleError(_0x1d82b2,null));};exports[_0xfb85('0x46')]=function(_0x217f82,_0x2eecd5){return db[_0xfb85('0x2c')][_0xfb85('0x46')](_0x217f82[_0xfb85('0x47')],{})[_0xfb85('0x22')](function(_0x16deca){var _0x30ad8d=_0x217f82[_0xfb85('0x48')][_0xfb85('0x24')]({'plain':!![]});if(!_0x30ad8d)throw new Error(_0xfb85('0x49'));if(_0x30ad8d[_0xfb85('0x4a')]===_0xfb85('0x48')){var _0x3726d5=_0x16deca[_0xfb85('0x24')]({'plain':!![]});var _0x1cdda4='Templates';return db['UserProfileSection'][_0xfb85('0x45')]({'where':{'name':_0x1cdda4,'userProfileId':_0x30ad8d['userProfileId']},'raw':!![]})[_0xfb85('0x22')](function(_0x32fa6c){if(_0x32fa6c&&_0x32fa6c[_0xfb85('0x4b')]===0x0){return db[_0xfb85('0x26')][_0xfb85('0x46')]({'name':_0x3726d5[_0xfb85('0x2a')],'resourceId':_0x3726d5['id'],'type':_0x32fa6c['name'],'sectionId':_0x32fa6c['id']},{})[_0xfb85('0x22')](function(){return _0x16deca;});}else{return _0x16deca;}})[_0xfb85('0x42')](function(_0x2ddcdc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ddcdc);throw _0x2ddcdc;});}return _0x16deca;})['then'](respondWithResult(_0x2eecd5,0xc9))['catch'](handleError(_0x2eecd5,null));};exports[_0xfb85('0x21')]=function(_0xae529a,_0xd89a6d){if(_0xae529a[_0xfb85('0x47')]['id']){delete _0xae529a[_0xfb85('0x47')]['id'];}return db['Template'][_0xfb85('0x45')]({'where':{'id':_0xae529a[_0xfb85('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd89a6d,null))['then'](saveUpdates(_0xae529a[_0xfb85('0x47')],null))['then'](respondWithResult(_0xd89a6d,null))[_0xfb85('0x42')](handleError(_0xd89a6d,null));};exports[_0xfb85('0x23')]=function(_0x5ddc9f,_0x3657c0){return db[_0xfb85('0x2c')]['find']({'where':{'id':_0x5ddc9f[_0xfb85('0x4c')]['id']}})[_0xfb85('0x22')](handleEntityNotFound(_0x3657c0,null))[_0xfb85('0x22')](removeEntity(_0x3657c0,null))[_0xfb85('0x42')](handleError(_0x3657c0,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1c5729d..b210f5a 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 _0x0972=['util','api','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0972,0x64));var _0x2097=function(_0x1502e2,_0x33b912){_0x1502e2=_0x1502e2-0x0;var _0x4b3717=_0x0972[_0x1502e2];return _0x4b3717;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('Template',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea28=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x124ea1,_0x8019ca){var _0x5efb8d=function(_0x360753){while(--_0x360753){_0x124ea1['push'](_0x124ea1['shift']());}};_0x5efb8d(++_0x8019ca);}(_0xea28,0x13a));var _0x8ea2=function(_0x19305b,_0x10923e){_0x19305b=_0x19305b-0x0;var _0x17836d=_0xea28[_0x19305b];return _0x17836d;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 6026ba8..bcb37c1 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 _0x4863=['where','attributes','limit','map','model','include','GetTemplate','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Template','findAll','raw','options'];(function(_0x675792,_0x53c921){var _0x3f6be1=function(_0x487510){while(--_0x487510){_0x675792['push'](_0x675792['shift']());}};_0x3f6be1(++_0x53c921);}(_0x4863,0xee));var _0x3486=function(_0x3cbf03,_0x23b644){_0x3cbf03=_0x3cbf03-0x0;var _0x502169=_0x4863[_0x3cbf03];return _0x502169;};'use strict';var _=require('lodash');var util=require(_0x3486('0x0'));var moment=require(_0x3486('0x1'));var BPromise=require(_0x3486('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3486('0x3'))['db'];var utils=require(_0x3486('0x4'));var logger=require(_0x3486('0x5'))(_0x3486('0x6'));var config=require(_0x3486('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3486('0x8')][_0x3486('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c251,_0x10166b,_0x4cee56){return new BPromise(function(_0x4db50f,_0x172407){return client[_0x3486('0xa')](_0x27c251,_0x4cee56)[_0x3486('0xb')](function(_0x5a0be5){logger[_0x3486('0xc')](_0x3486('0xd'),_0x10166b,'request\x20sent');logger[_0x3486('0xe')](_0x3486('0xf'),_0x10166b,_0x3486('0x10'),JSON[_0x3486('0x11')](_0x5a0be5));if(_0x5a0be5[_0x3486('0x12')]){if(_0x5a0be5[_0x3486('0x12')][_0x3486('0x13')]===0x1f4){logger[_0x3486('0x12')](_0x3486('0xd'),_0x10166b,_0x5a0be5[_0x3486('0x12')]['message']);return _0x172407(_0x5a0be5[_0x3486('0x12')][_0x3486('0x14')]);}logger[_0x3486('0x12')](_0x3486('0xd'),_0x10166b,_0x5a0be5[_0x3486('0x12')][_0x3486('0x14')]);return _0x4db50f(_0x5a0be5[_0x3486('0x12')][_0x3486('0x14')]);}else{logger[_0x3486('0xc')](_0x3486('0xd'),_0x10166b,'request\x20sent');_0x4db50f(_0x5a0be5['result'][_0x3486('0x14')]);}})[_0x3486('0x15')](function(_0x1bbbfb){logger['error'](_0x3486('0xd'),_0x10166b,_0x1bbbfb);_0x172407(_0x1bbbfb);});});}exports['GetTemplate']=function(_0x53394a){var _0x4e7f0a=this;return new Promise(function(_0x349cd4,_0x4b6513){return db[_0x3486('0x16')][_0x3486('0x17')]({'raw':_0x53394a['options']?_0x53394a['options'][_0x3486('0x18')]===undefined?!![]:![]:!![],'where':_0x53394a[_0x3486('0x19')]?_0x53394a[_0x3486('0x19')][_0x3486('0x1a')]||null:null,'attributes':_0x53394a[_0x3486('0x19')]?_0x53394a['options'][_0x3486('0x1b')]||null:null,'limit':_0x53394a[_0x3486('0x19')]?_0x53394a[_0x3486('0x19')][_0x3486('0x1c')]||null:null,'include':_0x53394a['options']?_0x53394a[_0x3486('0x19')]['include']?_[_0x3486('0x1d')](_0x53394a['options']['include'],function(_0x1cf7ae){return{'model':db[_0x1cf7ae[_0x3486('0x1e')]],'as':_0x1cf7ae['as'],'attributes':_0x1cf7ae[_0x3486('0x1b')],'include':_0x1cf7ae[_0x3486('0x1f')]?_[_0x3486('0x1d')](_0x1cf7ae[_0x3486('0x1f')],function(_0x4f62aa){return{'model':db[_0x4f62aa[_0x3486('0x1e')]],'as':_0x4f62aa['as'],'attributes':_0x4f62aa[_0x3486('0x1b')],'include':_0x4f62aa[_0x3486('0x1f')]?_[_0x3486('0x1d')](_0x4f62aa['include'],function(_0x2ed2b0){return{'model':db[_0x2ed2b0['model']],'as':_0x2ed2b0['as'],'attributes':_0x2ed2b0[_0x3486('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3486('0xb')](function(_0x49e913){logger[_0x3486('0xc')](_0x3486('0x20'),_0x53394a);logger['debug'](_0x3486('0x20'),_0x53394a,JSON[_0x3486('0x11')](_0x49e913));_0x349cd4(_0x49e913);})['catch'](function(_0x317f68){logger[_0x3486('0x12')](_0x3486('0x20'),_0x317f68['message'],_0x53394a);_0x4b6513(_0x4e7f0a[_0x3486('0x12')](0x1f4,_0x317f68['message']));});});}; \ No newline at end of file +var _0x291c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x291c,0x101));var _0xc291=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x291c[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var moment=require('moment');var BPromise=require(_0xc291('0x2'));var rs=require(_0xc291('0x3'));var fs=require('fs');var Redis=require(_0xc291('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc291('0x5'));var logger=require(_0xc291('0x6'))(_0xc291('0x7'));var config=require(_0xc291('0x8'));var jayson=require(_0xc291('0x9'));var client=jayson[_0xc291('0xa')][_0xc291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b36af,_0x37399d,_0xb8a1f8){return new BPromise(function(_0x56d5b7,_0x8feefb){return client[_0xc291('0xc')](_0x4b36af,_0xb8a1f8)[_0xc291('0xd')](function(_0x1a986f){logger[_0xc291('0xe')]('Template,\x20%s,\x20%s',_0x37399d,_0xc291('0xf'));logger['debug'](_0xc291('0x10'),_0x37399d,_0xc291('0xf'),JSON[_0xc291('0x11')](_0x1a986f));if(_0x1a986f[_0xc291('0x12')]){if(_0x1a986f[_0xc291('0x12')][_0xc291('0x13')]===0x1f4){logger['error'](_0xc291('0x14'),_0x37399d,_0x1a986f[_0xc291('0x12')][_0xc291('0x15')]);return _0x8feefb(_0x1a986f[_0xc291('0x12')][_0xc291('0x15')]);}logger[_0xc291('0x12')](_0xc291('0x14'),_0x37399d,_0x1a986f['error'][_0xc291('0x15')]);return _0x56d5b7(_0x1a986f[_0xc291('0x12')][_0xc291('0x15')]);}else{logger[_0xc291('0xe')](_0xc291('0x14'),_0x37399d,'request\x20sent');_0x56d5b7(_0x1a986f['result']['message']);}})[_0xc291('0x16')](function(_0x5d67e0){logger[_0xc291('0x12')](_0xc291('0x14'),_0x37399d,_0x5d67e0);_0x8feefb(_0x5d67e0);});});}exports[_0xc291('0x17')]=function(_0x2f25c2){var _0xa50d23=this;return new Promise(function(_0x46e2d0,_0x4f6a35){return db[_0xc291('0x18')]['findAll']({'raw':_0x2f25c2[_0xc291('0x19')]?_0x2f25c2[_0xc291('0x19')][_0xc291('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f25c2[_0xc291('0x19')]?_0x2f25c2[_0xc291('0x19')][_0xc291('0x1b')]||null:null,'attributes':_0x2f25c2['options']?_0x2f25c2[_0xc291('0x19')][_0xc291('0x1c')]||null:null,'limit':_0x2f25c2[_0xc291('0x19')]?_0x2f25c2[_0xc291('0x19')][_0xc291('0x1d')]||null:null,'include':_0x2f25c2[_0xc291('0x19')]?_0x2f25c2['options'][_0xc291('0x1e')]?_['map'](_0x2f25c2[_0xc291('0x19')][_0xc291('0x1e')],function(_0x586705){return{'model':db[_0x586705[_0xc291('0x1f')]],'as':_0x586705['as'],'attributes':_0x586705[_0xc291('0x1c')],'include':_0x586705['include']?_[_0xc291('0x20')](_0x586705[_0xc291('0x1e')],function(_0x79d8a){return{'model':db[_0x79d8a['model']],'as':_0x79d8a['as'],'attributes':_0x79d8a[_0xc291('0x1c')],'include':_0x79d8a[_0xc291('0x1e')]?_[_0xc291('0x20')](_0x79d8a[_0xc291('0x1e')],function(_0x1c3fcd){return{'model':db[_0x1c3fcd[_0xc291('0x1f')]],'as':_0x1c3fcd['as'],'attributes':_0x1c3fcd[_0xc291('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc291('0xd')](function(_0x183687){logger[_0xc291('0xe')](_0xc291('0x17'),_0x2f25c2);logger['debug']('GetTemplate',_0x2f25c2,JSON[_0xc291('0x11')](_0x183687));_0x46e2d0(_0x183687);})[_0xc291('0x16')](function(_0x214a6b){logger['error'](_0xc291('0x17'),_0x214a6b['message'],_0x2f25c2);_0x4f6a35(_0xa50d23[_0xc291('0x12')](0x1f4,_0x214a6b[_0xc291('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index a870813..2e9a789 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x376c05,_0x2a0d98){var _0x57aa29=function(_0x4363b6){while(--_0x4363b6){_0x376c05['push'](_0x376c05['shift']());}};_0x57aa29(++_0x2a0d98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x1fcbe9,_0x5c25da){var _0x37cf3b=function(_0x4c40eb){while(--_0x4c40eb){_0x1fcbe9['push'](_0x1fcbe9['shift']());}};_0x37cf3b(++_0x5c25da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 997fe45..a35464f 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 _0x70ec=['sequelize','exports','BOOLEAN'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x70ec,0xed));var _0xc70e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x70ec[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xc70e('0x0'));module[_0xc70e('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xc70e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xef03=['STRING','BOOLEAN'];(function(_0x1c78f7,_0x1013a8){var _0x3bae29=function(_0x19dbf6){while(--_0x19dbf6){_0x1c78f7['push'](_0x1c78f7['shift']());}};_0x3bae29(++_0x1013a8);}(_0xef03,0x8e));var _0x3ef0=function(_0xc1de2e,_0x5add91){_0xc1de2e=_0xc1de2e-0x0;var _0x4cfd49=_0xef03[_0xc1de2e];return _0x4cfd49;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3ef0('0x0')]},'channel':{'type':Sequelize[_0x3ef0('0x0')]},'description':{'type':Sequelize[_0x3ef0('0x0')]},'status':{'type':Sequelize[_0x3ef0('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 2f8272f..662e79f 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 _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file +var _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 149aff7..4a39d49 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 _0x757a=['define','tools_triggers','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x2dee81,_0x58c3df){var _0xa3a214=function(_0x459326){while(--_0x459326){_0x2dee81['push'](_0x2dee81['shift']());}};_0xa3a214(++_0x58c3df);}(_0x757a,0xde));var _0xa757=function(_0xa03e5,_0x4dcb78){_0xa03e5=_0xa03e5-0x0;var _0x462339=_0x757a[_0xa03e5];return _0x462339;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('Trigger',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./trigger.attributes','define','tools_triggers'];(function(_0x47f1b7,_0x3d5185){var _0x5e7e65=function(_0x42c060){while(--_0x42c060){_0x47f1b7['push'](_0x47f1b7['shift']());}};_0x5e7e65(++_0x3d5185);}(_0xac4a,0x13f));var _0xaac4=function(_0x587a69,_0x5e21cb){_0x587a69=_0x587a69-0x0;var _0x3c400a=_0xac4a[_0x587a69];return _0x3c400a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('Trigger',attributes,{'tableName':_0xaac4('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 0527404..e631060 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 _0x3013=['stringify','error','message','result','catch','Trigger','findAll','options','raw','limit','include','model','attributes','map','GetTrigger','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x3914f5,_0x2751b8){var _0x245cb5=function(_0x3c1167){while(--_0x3c1167){_0x3914f5['push'](_0x3914f5['shift']());}};_0x245cb5(++_0x2751b8);}(_0x3013,0x1f3));var _0x3301=function(_0x5bdbc1,_0xafcb4a){_0x5bdbc1=_0x5bdbc1-0x0;var _0x17a0d5=_0x3013[_0x5bdbc1];return _0x17a0d5;};'use strict';var _=require(_0x3301('0x0'));var util=require(_0x3301('0x1'));var moment=require(_0x3301('0x2'));var BPromise=require(_0x3301('0x3'));var rs=require(_0x3301('0x4'));var fs=require('fs');var Redis=require(_0x3301('0x5'));var db=require(_0x3301('0x6'))['db'];var utils=require(_0x3301('0x7'));var logger=require(_0x3301('0x8'))(_0x3301('0x9'));var config=require(_0x3301('0xa'));var jayson=require(_0x3301('0xb'));var client=jayson['client'][_0x3301('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a2575,_0x481dd1,_0x58adfe){return new BPromise(function(_0x2e6281,_0x234abe){return client['request'](_0x4a2575,_0x58adfe)[_0x3301('0xd')](function(_0xd20cf7){logger[_0x3301('0xe')](_0x3301('0xf'),_0x481dd1,_0x3301('0x10'));logger[_0x3301('0x11')](_0x3301('0x12'),_0x481dd1,_0x3301('0x10'),JSON[_0x3301('0x13')](_0xd20cf7));if(_0xd20cf7[_0x3301('0x14')]){if(_0xd20cf7[_0x3301('0x14')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x481dd1,_0xd20cf7[_0x3301('0x14')][_0x3301('0x15')]);return _0x234abe(_0xd20cf7[_0x3301('0x14')][_0x3301('0x15')]);}logger[_0x3301('0x14')](_0x3301('0xf'),_0x481dd1,_0xd20cf7['error'][_0x3301('0x15')]);return _0x2e6281(_0xd20cf7[_0x3301('0x14')]['message']);}else{logger[_0x3301('0xe')](_0x3301('0xf'),_0x481dd1,_0x3301('0x10'));_0x2e6281(_0xd20cf7[_0x3301('0x16')][_0x3301('0x15')]);}})[_0x3301('0x17')](function(_0x10970c){logger[_0x3301('0x14')](_0x3301('0xf'),_0x481dd1,_0x10970c);_0x234abe(_0x10970c);});});}exports['GetTrigger']=function(_0x4937cc){var _0x28aa04=this;return new Promise(function(_0x193c35,_0x549a1a){return db[_0x3301('0x18')][_0x3301('0x19')]({'raw':_0x4937cc['options']?_0x4937cc[_0x3301('0x1a')][_0x3301('0x1b')]===undefined?!![]:![]:!![],'where':_0x4937cc[_0x3301('0x1a')]?_0x4937cc[_0x3301('0x1a')]['where']||null:null,'attributes':_0x4937cc[_0x3301('0x1a')]?_0x4937cc[_0x3301('0x1a')]['attributes']||null:null,'limit':_0x4937cc[_0x3301('0x1a')]?_0x4937cc[_0x3301('0x1a')][_0x3301('0x1c')]||null:null,'include':_0x4937cc[_0x3301('0x1a')]?_0x4937cc[_0x3301('0x1a')][_0x3301('0x1d')]?_['map'](_0x4937cc[_0x3301('0x1a')][_0x3301('0x1d')],function(_0x236424){return{'model':db[_0x236424[_0x3301('0x1e')]],'as':_0x236424['as'],'attributes':_0x236424[_0x3301('0x1f')],'include':_0x236424[_0x3301('0x1d')]?_[_0x3301('0x20')](_0x236424[_0x3301('0x1d')],function(_0x95e70c){return{'model':db[_0x95e70c[_0x3301('0x1e')]],'as':_0x95e70c['as'],'attributes':_0x95e70c[_0x3301('0x1f')],'include':_0x95e70c[_0x3301('0x1d')]?_['map'](_0x95e70c[_0x3301('0x1d')],function(_0x2bf978){return{'model':db[_0x2bf978[_0x3301('0x1e')]],'as':_0x2bf978['as'],'attributes':_0x2bf978[_0x3301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3301('0xd')](function(_0x14c14f){logger[_0x3301('0xe')](_0x3301('0x21'),_0x4937cc);logger[_0x3301('0x11')]('GetTrigger',_0x4937cc,JSON[_0x3301('0x13')](_0x14c14f));_0x193c35(_0x14c14f);})['catch'](function(_0x3a01f9){logger[_0x3301('0x14')](_0x3301('0x21'),_0x3a01f9[_0x3301('0x15')],_0x4937cc);_0x549a1a(_0x28aa04[_0x3301('0x14')](0x1f4,_0x3a01f9[_0x3301('0x15')]));});});};exports[_0x3301('0x22')]=function(_0x47502c){var _0x1294c9=this;return new Promise(function(_0x21f2a3,_0x4c9789){return db[_0x3301('0x18')][_0x3301('0x23')]({'raw':_0x47502c[_0x3301('0x1a')]?_0x47502c[_0x3301('0x1a')][_0x3301('0x1b')]===undefined?!![]:![]:!![],'where':_0x47502c[_0x3301('0x1a')]?_0x47502c['options'][_0x3301('0x24')]||null:null,'attributes':_0x47502c[_0x3301('0x1a')]?_0x47502c[_0x3301('0x1a')][_0x3301('0x1f')]||null:null,'include':_0x47502c['options']?_0x47502c[_0x3301('0x1a')]['include']?_[_0x3301('0x20')](_0x47502c[_0x3301('0x1a')][_0x3301('0x1d')],function(_0x39677b){return{'model':db[_0x39677b[_0x3301('0x1e')]],'as':_0x39677b['as'],'attributes':_0x39677b[_0x3301('0x1f')],'include':_0x39677b[_0x3301('0x1d')]?_[_0x3301('0x20')](_0x39677b[_0x3301('0x1d')],function(_0x4f891d){return{'model':db[_0x4f891d['model']],'as':_0x4f891d['as'],'attributes':_0x4f891d[_0x3301('0x1f')],'include':_0x4f891d[_0x3301('0x1d')]?_['map'](_0x4f891d[_0x3301('0x1d')],function(_0x186134){return{'model':db[_0x186134[_0x3301('0x1e')]],'as':_0x186134['as'],'attributes':_0x186134['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a203a){logger[_0x3301('0xe')](_0x3301('0x22'),_0x47502c);logger[_0x3301('0x11')]('ShowTrigger',_0x47502c,JSON['stringify'](_0x2a203a));_0x21f2a3(_0x2a203a);})['catch'](function(_0x2a1d04){logger[_0x3301('0x14')](_0x3301('0x22'),_0x2a1d04[_0x3301('0x15')],_0x47502c);_0x4c9789(_0x1294c9[_0x3301('0x14')](0x1f4,_0x2a1d04[_0x3301('0x15')]));});});}; \ No newline at end of file +var _0x0feb=['code','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','limit','include','model','attributes','map','GetTrigger','find','ShowTrigger','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x1686ad,_0x1dad5c){var _0x11f2ec=function(_0x5050dd){while(--_0x5050dd){_0x1686ad['push'](_0x1686ad['shift']());}};_0x11f2ec(++_0x1dad5c);}(_0x0feb,0x11a));var _0xb0fe=function(_0xc7770,_0x1bd770){_0xc7770=_0xc7770-0x0;var _0x317c59=_0x0feb[_0xc7770];return _0x317c59;};'use strict';var _=require(_0xb0fe('0x0'));var util=require('util');var moment=require(_0xb0fe('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0fe('0x2'));var fs=require('fs');var Redis=require(_0xb0fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0fe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb0fe('0x5'));var jayson=require(_0xb0fe('0x6'));var client=jayson[_0xb0fe('0x7')][_0xb0fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b1022,_0x541348,_0x56e076){return new BPromise(function(_0x4dd279,_0x2ad3c6){return client['request'](_0x4b1022,_0x56e076)[_0xb0fe('0x9')](function(_0x1ef878){logger[_0xb0fe('0xa')]('Trigger,\x20%s,\x20%s',_0x541348,_0xb0fe('0xb'));logger[_0xb0fe('0xc')]('Trigger,\x20%s,\x20%s,\x20%s',_0x541348,_0xb0fe('0xb'),JSON[_0xb0fe('0xd')](_0x1ef878));if(_0x1ef878[_0xb0fe('0xe')]){if(_0x1ef878[_0xb0fe('0xe')][_0xb0fe('0xf')]===0x1f4){logger[_0xb0fe('0xe')](_0xb0fe('0x10'),_0x541348,_0x1ef878['error'][_0xb0fe('0x11')]);return _0x2ad3c6(_0x1ef878[_0xb0fe('0xe')][_0xb0fe('0x11')]);}logger[_0xb0fe('0xe')](_0xb0fe('0x10'),_0x541348,_0x1ef878[_0xb0fe('0xe')][_0xb0fe('0x11')]);return _0x4dd279(_0x1ef878[_0xb0fe('0xe')][_0xb0fe('0x11')]);}else{logger['info'](_0xb0fe('0x10'),_0x541348,_0xb0fe('0xb'));_0x4dd279(_0x1ef878[_0xb0fe('0x12')][_0xb0fe('0x11')]);}})[_0xb0fe('0x13')](function(_0x596b1e){logger[_0xb0fe('0xe')](_0xb0fe('0x10'),_0x541348,_0x596b1e);_0x2ad3c6(_0x596b1e);});});}exports['GetTrigger']=function(_0x488f83){var _0x2a1c29=this;return new Promise(function(_0xa6ef4,_0x44263c){return db[_0xb0fe('0x14')][_0xb0fe('0x15')]({'raw':_0x488f83[_0xb0fe('0x16')]?_0x488f83[_0xb0fe('0x16')][_0xb0fe('0x17')]===undefined?!![]:![]:!![],'where':_0x488f83[_0xb0fe('0x16')]?_0x488f83[_0xb0fe('0x16')][_0xb0fe('0x18')]||null:null,'attributes':_0x488f83['options']?_0x488f83[_0xb0fe('0x16')]['attributes']||null:null,'limit':_0x488f83[_0xb0fe('0x16')]?_0x488f83[_0xb0fe('0x16')][_0xb0fe('0x19')]||null:null,'include':_0x488f83[_0xb0fe('0x16')]?_0x488f83[_0xb0fe('0x16')][_0xb0fe('0x1a')]?_['map'](_0x488f83[_0xb0fe('0x16')]['include'],function(_0xa8f475){return{'model':db[_0xa8f475[_0xb0fe('0x1b')]],'as':_0xa8f475['as'],'attributes':_0xa8f475[_0xb0fe('0x1c')],'include':_0xa8f475[_0xb0fe('0x1a')]?_[_0xb0fe('0x1d')](_0xa8f475[_0xb0fe('0x1a')],function(_0x45b8c9){return{'model':db[_0x45b8c9[_0xb0fe('0x1b')]],'as':_0x45b8c9['as'],'attributes':_0x45b8c9['attributes'],'include':_0x45b8c9[_0xb0fe('0x1a')]?_['map'](_0x45b8c9[_0xb0fe('0x1a')],function(_0x270e35){return{'model':db[_0x270e35['model']],'as':_0x270e35['as'],'attributes':_0x270e35[_0xb0fe('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2da4){logger[_0xb0fe('0xa')]('GetTrigger',_0x488f83);logger[_0xb0fe('0xc')](_0xb0fe('0x1e'),_0x488f83,JSON[_0xb0fe('0xd')](_0x3a2da4));_0xa6ef4(_0x3a2da4);})[_0xb0fe('0x13')](function(_0x3283c9){logger[_0xb0fe('0xe')](_0xb0fe('0x1e'),_0x3283c9[_0xb0fe('0x11')],_0x488f83);_0x44263c(_0x2a1c29[_0xb0fe('0xe')](0x1f4,_0x3283c9[_0xb0fe('0x11')]));});});};exports['ShowTrigger']=function(_0x1bd926){var _0x32cdfc=this;return new Promise(function(_0x54d8f7,_0x36396e){return db[_0xb0fe('0x14')][_0xb0fe('0x1f')]({'raw':_0x1bd926[_0xb0fe('0x16')]?_0x1bd926[_0xb0fe('0x16')][_0xb0fe('0x17')]===undefined?!![]:![]:!![],'where':_0x1bd926[_0xb0fe('0x16')]?_0x1bd926['options'][_0xb0fe('0x18')]||null:null,'attributes':_0x1bd926[_0xb0fe('0x16')]?_0x1bd926[_0xb0fe('0x16')][_0xb0fe('0x1c')]||null:null,'include':_0x1bd926[_0xb0fe('0x16')]?_0x1bd926['options'][_0xb0fe('0x1a')]?_[_0xb0fe('0x1d')](_0x1bd926['options'][_0xb0fe('0x1a')],function(_0x51bbce){return{'model':db[_0x51bbce[_0xb0fe('0x1b')]],'as':_0x51bbce['as'],'attributes':_0x51bbce[_0xb0fe('0x1c')],'include':_0x51bbce[_0xb0fe('0x1a')]?_['map'](_0x51bbce[_0xb0fe('0x1a')],function(_0x58ed65){return{'model':db[_0x58ed65[_0xb0fe('0x1b')]],'as':_0x58ed65['as'],'attributes':_0x58ed65[_0xb0fe('0x1c')],'include':_0x58ed65[_0xb0fe('0x1a')]?_[_0xb0fe('0x1d')](_0x58ed65[_0xb0fe('0x1a')],function(_0x4df951){return{'model':db[_0x4df951[_0xb0fe('0x1b')]],'as':_0x4df951['as'],'attributes':_0x4df951['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0fe('0x9')](function(_0x5e1c72){logger['info']('ShowTrigger',_0x1bd926);logger['debug'](_0xb0fe('0x20'),_0x1bd926,JSON[_0xb0fe('0xd')](_0x5e1c72));_0x54d8f7(_0x5e1c72);})[_0xb0fe('0x13')](function(_0x57a2ca){logger['error']('ShowTrigger',_0x57a2ca[_0xb0fe('0x11')],_0x1bd926);_0x36396e(_0x32cdfc[_0xb0fe('0xe')](0x1f4,_0x57a2ca[_0xb0fe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8aaf8b8..218081e 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 _0x5189=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','create','put'];(function(_0x461ac2,_0x4d9114){var _0x52b16e=function(_0x2033f0){while(--_0x2033f0){_0x461ac2['push'](_0x461ac2['shift']());}};_0x52b16e(++_0x4d9114);}(_0x5189,0x89));var _0x9518=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x5189[_0xab9f3d];return _0x5283bf;};'use strict';var multer=require(_0x9518('0x0'));var util=require(_0x9518('0x1'));var path=require(_0x9518('0x2'));var timeout=require(_0x9518('0x3'));var express=require(_0x9518('0x4'));var router=express['Router']();var auth=require(_0x9518('0x5'));var interaction=require(_0x9518('0x6'));var config=require(_0x9518('0x7'));var controller=require(_0x9518('0x8'));router[_0x9518('0x9')]('/',auth[_0x9518('0xa')](),controller['index']);router[_0x9518('0x9')]('/:id',auth[_0x9518('0xa')](),controller[_0x9518('0xb')]);router[_0x9518('0xc')]('/:id/clone',auth[_0x9518('0xa')](),controller['clone']);router[_0x9518('0xc')]('/',auth[_0x9518('0xa')](),controller[_0x9518('0xd')]);router[_0x9518('0xe')](_0x9518('0xf'),auth[_0x9518('0xa')](),controller['update']);router[_0x9518('0x10')]('/:id',auth[_0x9518('0xa')](),controller[_0x9518('0x11')]);module[_0x9518('0x12')]=router; \ No newline at end of file +var _0x6ff0=['show','post','/:id/clone','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated'];(function(_0x284a09,_0x38884f){var _0x21c401=function(_0x235b28){while(--_0x235b28){_0x284a09['push'](_0x284a09['shift']());}};_0x21c401(++_0x38884f);}(_0x6ff0,0x12e));var _0x06ff=function(_0x490f59,_0x51681d){_0x490f59=_0x490f59-0x0;var _0x5e4394=_0x6ff0[_0x490f59];return _0x5e4394;};'use strict';var multer=require(_0x06ff('0x0'));var util=require(_0x06ff('0x1'));var path=require(_0x06ff('0x2'));var timeout=require(_0x06ff('0x3'));var express=require(_0x06ff('0x4'));var router=express['Router']();var auth=require(_0x06ff('0x5'));var interaction=require(_0x06ff('0x6'));var config=require(_0x06ff('0x7'));var controller=require(_0x06ff('0x8'));router[_0x06ff('0x9')]('/',auth['isAuthenticated'](),controller[_0x06ff('0xa')]);router[_0x06ff('0x9')](_0x06ff('0xb'),auth[_0x06ff('0xc')](),controller[_0x06ff('0xd')]);router[_0x06ff('0xe')](_0x06ff('0xf'),auth[_0x06ff('0xc')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0x06ff('0x10')]);router[_0x06ff('0x11')](_0x06ff('0xb'),auth['isAuthenticated'](),controller[_0x06ff('0x12')]);router[_0x06ff('0x13')](_0x06ff('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x06ff('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 245dc32..32a6ee1 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 _0xbaf0=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp'];(function(_0x380168,_0x40546c){var _0x12e86d=function(_0x559ef7){while(--_0x559ef7){_0x380168['push'](_0x380168['shift']());}};_0x12e86d(++_0x40546c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x4'),_0x0baf('0x5'),'peer'),'allowNull':![],'defaultValue':_0x0baf('0x4')},'context':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':_0x0baf('0x6')},'callingpres':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x7'),_0x0baf('0x8'),_0x0baf('0x9'),_0x0baf('0xa'),_0x0baf('0xb'),'PROHIB_PASSED_SCREEN',_0x0baf('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x0baf('0x1')]},'permit':{'type':Sequelize[_0x0baf('0x1')]},'secret':{'type':Sequelize[_0x0baf('0x1')]},'md5secret':{'type':Sequelize[_0x0baf('0x1')]},'remotesecret':{'type':Sequelize[_0x0baf('0x1')]},'transport':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0xd'),'set':function(_0x245a6b){this[_0x0baf('0xe')](_0x0baf('0xf'),_0x245a6b?_0x245a6b[_0x0baf('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x0baf('0x11')](_0x0baf('0xf'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0baf('0x14'),'info',_0x0baf('0x15'),_0x0baf('0x16'),_0x0baf('0x17')),'defaultValue':_0x0baf('0x14')},'directmedia':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no','nonat','update',_0x0baf('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x1')]},'directmediadeny':{'type':Sequelize[_0x0baf('0x1')]},'nat':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x63c820){this[_0x0baf('0xe')](_0x0baf('0x1a'),_0x63c820?_0x63c820[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')](_0x0baf('0x1a'))?this['getDataValue']('nat')[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x1b')},'callgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0baf('0x1')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'language':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0baf('0x1d'),'set':function(_0x482522){this[_0x0baf('0xe')]('allow',_0x482522?_0x482522['join'](';'):_0x0baf('0x1d'));},'get':function(){return this['getDataValue']('allow')?this[_0x0baf('0x11')](_0x0baf('0x1e'))[_0x0baf('0x12')](';'):null;},'comment':_0x0baf('0x1f')},'autoframing':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x20'),'set':function(_0x1ca35a){this[_0x0baf('0xe')](_0x0baf('0x21'),_0x1ca35a?_0x1ca35a[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')]('insecure')?this[_0x0baf('0x11')](_0x0baf('0x21'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x23'))},'promiscredir':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0baf('0x1')]},'callerid':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x24')},'amaflags':{'type':Sequelize[_0x0baf('0x1')]},'callcounter':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':_0x0baf('0x18')},'busylevel':{'type':Sequelize[_0x0baf('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x0baf('0x1')]},'videosupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'))},'session_expires':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2a'),'uas'),'defaultValue':_0x0baf('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0baf('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x0baf('0x1')]},'defaultuser':{'type':Sequelize[_0x0baf('0x1')]},'rtptimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x1')]},'callbackextension':{'type':Sequelize[_0x0baf('0x1')]},'timert1':{'type':Sequelize[_0x0baf('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0baf('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0baf('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0baf('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x0baf('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x0baf('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x0baf('0x25')](0xb)},'encryption':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'force_avp':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0baf('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0baf('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x1')]},'dtlscipher':{'type':Sequelize[_0x0baf('0x1')]},'dtlscafile':{'type':Sequelize[_0x0baf('0x1')]},'dtlscapath':{'type':Sequelize[_0x0baf('0x1')]},'dtlssetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2e'),_0x0baf('0x2f'),_0x0baf('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0baf('0x1')]},'recordofffeature':{'type':Sequelize[_0x0baf('0x1')]},'call_limit':{'type':Sequelize[_0x0baf('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'vmexten':{'type':Sequelize[_0x0baf('0x1')]},'mohinterpret':{'type':Sequelize[_0x0baf('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x0baf('0x1')]},'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x31')},'canreinvite':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x32'),'update',_0x0baf('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0baf('0x1')]},'otherFields':{'type':Sequelize[_0x0baf('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0713=['join','getDataValue','split','rfc2833','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update,nonat','BOOLEAN','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport'];(function(_0x57df44,_0x5b4cda){var _0x17f4bc=function(_0x475433){while(--_0x475433){_0x57df44['push'](_0x57df44['shift']());}};_0x17f4bc(++_0x5b4cda);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x3'),_0x3071('0x4'),'peer'),'allowNull':![],'defaultValue':_0x3071('0x3')},'context':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'defaultValue':_0x3071('0x5')},'callingpres':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd'))},'deny':{'type':Sequelize[_0x3071('0x0')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3071('0x0')]},'md5secret':{'type':Sequelize[_0x3071('0x0')]},'remotesecret':{'type':Sequelize[_0x3071('0x0')]},'transport':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0xe'),'set':function(_0x4a470a){this[_0x3071('0xf')](_0x3071('0x10'),_0x4a470a?_0x4a470a[_0x3071('0x11')](','):null);},'get':function(){return this[_0x3071('0x12')](_0x3071('0x10'))?this['getDataValue']('transport')[_0x3071('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x14'),'info',_0x3071('0x15'),'inband',_0x3071('0x16')),'defaultValue':_0x3071('0x14')},'directmedia':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no',_0x3071('0x18'),_0x3071('0x19'),_0x3071('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3071('0x0')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x1b'),'set':function(_0x1068d9){this[_0x3071('0xf')](_0x3071('0x1c'),_0x1068d9?_0x1068d9[_0x3071('0x11')](','):null);},'get':function(){return this[_0x3071('0x12')](_0x3071('0x1c'))?this['getDataValue'](_0x3071('0x1c'))[_0x3071('0x13')](','):null;},'comment':_0x3071('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x3071('0x0')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3071('0x0')]},'language':{'type':Sequelize[_0x3071('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3071('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x1e')},'allow':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'defaultValue':_0x3071('0x1f'),'set':function(_0x211b4f){this['setDataValue']('allow',_0x211b4f?_0x211b4f[_0x3071('0x11')](';'):_0x3071('0x1f'));},'get':function(){return this[_0x3071('0x12')](_0x3071('0x20'))?this[_0x3071('0x12')](_0x3071('0x20'))[_0x3071('0x13')](';'):null;},'comment':_0x3071('0x21')},'autoframing':{'type':Sequelize[_0x3071('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x22'),'set':function(_0x177138){this['setDataValue'](_0x3071('0x23'),_0x177138?_0x177138[_0x3071('0x11')](','):null);},'get':function(){return this[_0x3071('0x12')](_0x3071('0x23'))?this[_0x3071('0x12')](_0x3071('0x23'))[_0x3071('0x13')](','):null;},'comment':_0x3071('0x24')},'trustrpid':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3071('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x3071('0x17'),'no',_0x3071('0x25'))},'promiscredir':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'accountcode':{'type':Sequelize[_0x3071('0x26')](0xb)},'setvar':{'type':Sequelize[_0x3071('0x0')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3071('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x3071('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x3071('0x0')]},'template':{'type':Sequelize[_0x3071('0x0')]},'videosupport':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3071('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x3071('0x0')]},'session_timers':{'type':Sequelize[_0x3071('0x2')]('accept',_0x3071('0x27'),_0x3071('0x28'))},'session_expires':{'type':Sequelize[_0x3071('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x3071('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x29'),'uas'),'defaultValue':_0x3071('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x3071('0x0')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3071('0x0')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3071('0x26')](0x5)},'qualify':{'type':Sequelize[_0x3071('0x2')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3071('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x3071('0x0')]},'defaultuser':{'type':Sequelize[_0x3071('0x0')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3071('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x3071('0x2')]('yes','no',_0x3071('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3071('0x0')]},'callbackextension':{'type':Sequelize[_0x3071('0x0')]},'timert1':{'type':Sequelize[_0x3071('0x26')](0xb)},'timerb':{'type':Sequelize[_0x3071('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x3071('0x0')]},'contactacl':{'type':Sequelize[_0x3071('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0x3071('0x0')]},'use_q850_reason':{'type':Sequelize[_0x3071('0x0')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'force_avp':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x3071('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x3071('0x2c'),_0x3071('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x3071('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3071('0x0')]},'dtlsprivatekey':{'type':Sequelize[_0x3071('0x0')]},'dtlscipher':{'type':Sequelize[_0x3071('0x0')]},'dtlscafile':{'type':Sequelize[_0x3071('0x0')]},'dtlscapath':{'type':Sequelize[_0x3071('0x0')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3071('0x2e'),_0x3071('0x2f'),_0x3071('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3071('0x0')]},'usereqphone':{'type':Sequelize[_0x3071('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3071('0x0')]},'call_limit':{'type':Sequelize[_0x3071('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3071('0x2')](_0x3071('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x3071('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0x3071('0x0')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x3071('0x0')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3071('0x0')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x3071('0x2')]('yes','no',_0x3071('0x18'),_0x3071('0x19'),_0x3071('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3071('0x0')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3071('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 a7f85e7..ed91ecc 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 _0xfaea=['params','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','UserProfileSection','userProfileId','Reload','writeFileSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','clone'];(function(_0x1e707c,_0x1b89c1){var _0x3d6e3f=function(_0x5833e5){while(--_0x5833e5){_0x1e707c['push'](_0x1e707c['shift']());}};_0x3d6e3f(++_0x1b89c1);}(_0xfaea,0xfd));var _0xafae=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0xfaea[_0x5f1cf8];return _0x27d0fa;};'use strict';var pdf=require(_0xafae('0x0'));var emlformat=require(_0xafae('0x1'));var rimraf=require(_0xafae('0x2'));var zipdir=require(_0xafae('0x3'));var jsonpatch=require(_0xafae('0x4'));var rp=require('request-promise');var moment=require(_0xafae('0x5'));var BPromise=require(_0xafae('0x6'));var Mustache=require('mustache');var util=require(_0xafae('0x7'));var path=require(_0xafae('0x8'));var sox=require('sox');var csv=require(_0xafae('0x9'));var ejs=require(_0xafae('0xa'));var fs=require('fs');var _=require(_0xafae('0xb'));var squel=require(_0xafae('0xc'));var crypto=require('crypto');var jsforce=require(_0xafae('0xd'));var deskjs=require(_0xafae('0xe'));var toCsv=require(_0xafae('0x9'));var querystring=require(_0xafae('0xf'));var Papa=require(_0xafae('0x10'));var Redis=require('ioredis');var authService=require(_0xafae('0x11'));var qs=require(_0xafae('0x12'));var hardwareService=require(_0xafae('0x13'));var logger=require(_0xafae('0x14'))(_0xafae('0x15'));var utils=require(_0xafae('0x16'));var config=require(_0xafae('0x17'));var db=require(_0xafae('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xafae('0x19')][_0xafae('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x659040,_0x443a39,_0x48c785){if(_0x48c785){var _0x1528ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1528ae[_0xafae('0x1b')](_0x443a39)){return _0x659040;}else{throw new Error(_0xafae('0x1c'));}}else{return _0x659040;}}function respondWithRpcPromise(_0x3141af,_0x287b71,_0x1cb7ed,_0x5d8b5b){return new BPromise(function(_0xed366e,_0x3c5982){var _0x4c8108=_0x5d8b5b||client;return _0x4c8108['request'](_0x3141af,_0x1cb7ed)['then'](function(_0x2cd5d3){logger['info'](_0xafae('0x1d'),_0x287b71,_0xafae('0x1e'));logger[_0xafae('0x1f')](_0xafae('0x20'),_0x287b71,'request\x20sent',JSON[_0xafae('0x21')](_0x2cd5d3));if(_0x2cd5d3[_0xafae('0x22')]){if(_0x2cd5d3['error'][_0xafae('0x23')]===0x1f4){logger['error'](_0xafae('0x1d'),_0x287b71,_0x2cd5d3['error']['message']);return _0x3c5982(_0x2cd5d3[_0xafae('0x22')]['message']);}logger[_0xafae('0x22')]('Trunk,\x20%s,\x20%s',_0x287b71,_0x2cd5d3[_0xafae('0x22')][_0xafae('0x24')]);return _0xed366e(_0x2cd5d3[_0xafae('0x22')]['message']);}else{logger[_0xafae('0x25')](_0xafae('0x1d'),_0x287b71,'request\x20sent');_0xed366e(_0x2cd5d3[_0xafae('0x26')][_0xafae('0x24')]);}})[_0xafae('0x27')](function(_0x8e2a85){logger[_0xafae('0x22')](_0xafae('0x1d'),_0x287b71,_0x8e2a85);_0x3c5982(_0x8e2a85);});});}function respondWithStatusCode(_0x165d4d,_0x31d5f3){_0x31d5f3=_0x31d5f3||0xcc;return function(_0x1499c9){if(_0x1499c9){return _0x165d4d[_0xafae('0x28')](_0x31d5f3);}return _0x165d4d[_0xafae('0x29')](_0x31d5f3)[_0xafae('0x2a')]();};}function respondWithResult(_0x3fe48c,_0x50ab7c){_0x50ab7c=_0x50ab7c||0xc8;return function(_0x11f1f1){if(_0x11f1f1){return _0x3fe48c[_0xafae('0x29')](_0x50ab7c)[_0xafae('0x2b')](_0x11f1f1);}};}function respondWithFilteredResult(_0x502350,_0x3db307){return function(_0x1e8c1f){if(_0x1e8c1f){var _0x3aa923=_0x1e8c1f[_0xafae('0x2c')],_0x3a315b=_0x3db307[_0xafae('0x2d')],_0x5d3e1b=_0x3db307[_0xafae('0x2d')]+_0x3db307[_0xafae('0x2e')],_0x3b6035;if(_0x5d3e1b>=_0x3aa923){_0x5d3e1b=_0x3aa923;_0x3b6035=0xc8;}else{_0x3b6035=0xce;}_0x502350[_0xafae('0x29')](_0x3b6035);return _0x502350[_0xafae('0x2f')]('Content-Range',_0x3a315b+'-'+_0x5d3e1b+'/'+_0x3aa923)[_0xafae('0x2b')](_0x1e8c1f);}return null;};}function patchUpdates(_0x3547f3){return function(_0x2e68fb){try{jsonpatch['apply'](_0x2e68fb,_0x3547f3,!![]);}catch(_0x37c704){return BPromise[_0xafae('0x30')](_0x37c704);}return _0x2e68fb[_0xafae('0x31')]();};}function saveUpdates(_0x4d64ea,_0x146131){return function(_0x3ad2bd){if(_0x3ad2bd){return _0x3ad2bd[_0xafae('0x32')](_0x4d64ea)[_0xafae('0x33')](function(_0x2b1f2f){return _0x2b1f2f;});}return null;};}function removeEntity(_0x1b0ef1,_0x2c3027){return function(_0x5ad1b1){if(_0x5ad1b1){return _0x5ad1b1[_0xafae('0x34')]()[_0xafae('0x33')](function(){var _0x141df8=_0x5ad1b1[_0xafae('0x35')]({'plain':!![]});var _0x3ac4ef='Trunks';return db[_0xafae('0x36')][_0xafae('0x34')]({'where':{'type':_0x3ac4ef,'resourceId':_0x141df8['id']}})['then'](function(){return _0x5ad1b1;});})['then'](function(){_0x1b0ef1[_0xafae('0x29')](0xcc)[_0xafae('0x2a')]();});}};}function handleEntityNotFound(_0x5c30a2,_0x2d0c31){return function(_0x3990fd){if(!_0x3990fd){_0x5c30a2[_0xafae('0x28')](0x194);}return _0x3990fd;};}function handleError(_0x3fe8f8,_0x53d628){_0x53d628=_0x53d628||0x1f4;return function(_0x1a488f){logger[_0xafae('0x22')](_0x1a488f[_0xafae('0x37')]);if(_0x1a488f[_0xafae('0x38')]){delete _0x1a488f['name'];}_0x3fe8f8[_0xafae('0x29')](_0x53d628)[_0xafae('0x39')](_0x1a488f);};}exports[_0xafae('0x3a')]=function(_0x425407,_0x3d2c51){var _0x4d4723={},_0x35c543={},_0x37f02d={'count':0x0,'rows':[]};var _0x2bce70=db[_0xafae('0x3b')][_0xafae('0x3c')];_0x35c543[_0xafae('0x3d')]=_['keys'](_0x2bce70);_0x35c543[_0xafae('0x3e')]=_[_0xafae('0x3f')](_0x425407[_0xafae('0x3e')]);_0x35c543[_0xafae('0x40')]=_[_0xafae('0x41')](_0x35c543[_0xafae('0x3d')],_0x35c543['query']);_0x4d4723[_0xafae('0x42')]=_['intersection'](_0x35c543[_0xafae('0x3d')],qs[_0xafae('0x43')](_0x425407[_0xafae('0x3e')][_0xafae('0x43')]));_0x4d4723[_0xafae('0x42')]=_0x4d4723['attributes']['length']?_0x4d4723['attributes']:_0x35c543[_0xafae('0x3d')];if(!_0x425407[_0xafae('0x3e')]['hasOwnProperty'](_0xafae('0x44'))){_0x4d4723[_0xafae('0x2e')]=qs[_0xafae('0x2e')](_0x425407[_0xafae('0x3e')][_0xafae('0x2e')]);_0x4d4723[_0xafae('0x2d')]=qs['offset'](_0x425407['query']['offset']);}_0x4d4723[_0xafae('0x45')]=qs[_0xafae('0x46')](_0x425407['query']['sort']);_0x4d4723[_0xafae('0x47')]=qs[_0xafae('0x40')](_['pick'](_0x425407[_0xafae('0x3e')],_0x35c543[_0xafae('0x40')]));if(_0x425407[_0xafae('0x3e')][_0xafae('0x48')]){_0x4d4723[_0xafae('0x47')]=_[_0xafae('0x49')](_0x4d4723[_0xafae('0x47')],{'$or':_['map'](_0x2bce70,function(_0xfca8cc){if(_0xfca8cc[_0xafae('0x4a')][_0xafae('0x4b')]!==_0xafae('0x4c')){var _0x3800f1={};_0x3800f1[_0xfca8cc['field']]={'$like':'%'+_0x425407[_0xafae('0x3e')][_0xafae('0x48')]+'%'};return _0x3800f1;}})});}_0x4d4723=_[_0xafae('0x49')]({},_0x4d4723,_0x425407[_0xafae('0x4d')]);var _0x134f4c={'where':_0x4d4723['where']};return db[_0xafae('0x3b')][_0xafae('0x2c')](_0x134f4c)[_0xafae('0x33')](function(_0x462964){_0x37f02d[_0xafae('0x2c')]=_0x462964;if(_0x425407[_0xafae('0x3e')]['includeAll']){_0x4d4723[_0xafae('0x4e')]=[{'all':!![]}];}return db[_0xafae('0x3b')][_0xafae('0x4f')](_0x4d4723);})[_0xafae('0x33')](function(_0x45af01){_0x37f02d[_0xafae('0x50')]=_0x45af01;return _0x37f02d;})['then'](respondWithFilteredResult(_0x3d2c51,_0x4d4723))[_0xafae('0x27')](handleError(_0x3d2c51,null));};exports[_0xafae('0x51')]=function(_0x307969,_0x2da452){var _0x2c26fa={'raw':![],'where':{'id':_0x307969['params']['id']}},_0x365090={};_0x365090[_0xafae('0x3d')]=_[_0xafae('0x3f')](db[_0xafae('0x3b')][_0xafae('0x3c')]);_0x365090[_0xafae('0x3e')]=_[_0xafae('0x3f')](_0x307969[_0xafae('0x3e')]);_0x365090[_0xafae('0x40')]=_[_0xafae('0x41')](_0x365090[_0xafae('0x3d')],_0x365090[_0xafae('0x3e')]);_0x2c26fa[_0xafae('0x42')]=_[_0xafae('0x41')](_0x365090['model'],qs[_0xafae('0x43')](_0x307969[_0xafae('0x3e')][_0xafae('0x43')]));_0x2c26fa[_0xafae('0x42')]=_0x2c26fa[_0xafae('0x42')][_0xafae('0x52')]?_0x2c26fa['attributes']:_0x365090[_0xafae('0x3d')];if(_0x307969[_0xafae('0x3e')][_0xafae('0x53')]){_0x2c26fa[_0xafae('0x4e')]=[{'all':!![]}];}_0x2c26fa=_[_0xafae('0x49')]({},_0x2c26fa,_0x307969['options']);return db[_0xafae('0x3b')][_0xafae('0x54')](_0x2c26fa)[_0xafae('0x33')](handleEntityNotFound(_0x2da452,null))[_0xafae('0x33')](respondWithResult(_0x2da452,null))[_0xafae('0x27')](handleError(_0x2da452,null));};exports[_0xafae('0x55')]=function(_0x4ce898,_0x1830c9){var _0x13643c={'raw':![],'where':{'id':_0x4ce898[_0xafae('0x56')]['id']}},_0x189976={};_0x189976[_0xafae('0x3d')]=_[_0xafae('0x3f')](db[_0xafae('0x3b')][_0xafae('0x3c')]);_0x13643c[_0xafae('0x42')]=_['intersection'](_0x189976[_0xafae('0x3d')],qs[_0xafae('0x43')](_0x4ce898[_0xafae('0x3e')][_0xafae('0x43')]));_0x13643c[_0xafae('0x42')]=_0x13643c[_0xafae('0x42')]['length']?_0x13643c[_0xafae('0x42')]:_0x189976[_0xafae('0x3d')];if(_0x4ce898['query'][_0xafae('0x53')]){_0x13643c[_0xafae('0x4e')]=[{'all':!![]}];}_0x13643c=_[_0xafae('0x49')]({},_0x13643c,_0x4ce898[_0xafae('0x4d')]);return db[_0xafae('0x3b')][_0xafae('0x54')](_0x13643c)[_0xafae('0x33')](handleEntityNotFound(_0x1830c9,null))[_0xafae('0x33')](function(_0x1dda20){if(_0x1dda20){var _0x57babf=_0x1dda20[_0xafae('0x35')]({'plain':!![]});_0x57babf=qs[_0xafae('0x57')](_0x57babf,['id',_0xafae('0x58'),'updatedAt']);_0x4ce898[_0xafae('0x59')]=_['omit'](_0x4ce898[_0xafae('0x59')],['id',_0xafae('0x58'),_0xafae('0x5a')]);return db[_0xafae('0x3b')][_0xafae('0x5b')](_['merge'](_0x57babf,_0x4ce898[_0xafae('0x59')]),{'include':_0x4ce898[_0xafae('0x3e')][_0xafae('0x53')]?[{'all':!![]}]:undefined})['then'](function(_0xbf7dc){var _0x228906=_0x4ce898[_0xafae('0x5c')]['get']({'plain':!![]});if(!_0x228906)throw new Error(_0xafae('0x5d'));if(_0x228906[_0xafae('0x5e')]===_0xafae('0x5c')){var _0x364a4e=_0xbf7dc[_0xafae('0x35')]({'plain':!![]});var _0x21617f=_0xafae('0x5f');return db['UserProfileSection'][_0xafae('0x54')]({'where':{'name':_0x21617f,'userProfileId':_0x228906['userProfileId']},'raw':!![]})['then'](function(_0x5cd503){if(_0x5cd503&&_0x5cd503[_0xafae('0x60')]===0x0){return db[_0xafae('0x36')][_0xafae('0x5b')]({'name':_0x364a4e[_0xafae('0x38')],'resourceId':_0x364a4e['id'],'type':_0x5cd503[_0xafae('0x38')],'sectionId':_0x5cd503['id']},{})[_0xafae('0x33')](function(){return _0xbf7dc;});}else{return _0xbf7dc;}})[_0xafae('0x27')](function(_0x3aaff3){logger[_0xafae('0x22')](_0xafae('0x61'),_0x3aaff3);throw _0x3aaff3;});}return _0xbf7dc;});}})[_0xafae('0x33')](respondWithResult(_0x1830c9,0xc9))[_0xafae('0x27')](handleError(_0x1830c9,null));};exports['create']=function(_0x58ab46,_0x5a21c8,_0x56041d){var _0x30768e;return db[_0xafae('0x3b')]['create'](_0x58ab46[_0xafae('0x59')],{'raw':!![]})[_0xafae('0x33')](function(_0x18ebf4){_0x30768e=_0x18ebf4;return db[_0xafae('0x3b')][_0xafae('0x4f')]({'raw':!![]});})[_0xafae('0x33')](function(_0x482580){var _0x5ba9c8=fs['readFileSync'](path[_0xafae('0x62')](config[_0xafae('0x63')],_0xafae('0x64')),_0xafae('0x65'));var _0x32b8bb=fs[_0xafae('0x66')](path[_0xafae('0x62')](config[_0xafae('0x63')],_0xafae('0x67')),_0xafae('0x65'));var _0x1000a3=ejs[_0xafae('0x68')](_0x5ba9c8,{'trunks':_0x482580||[]});fs['writeFileSync'](_0xafae('0x69'),_0x1000a3);if(_0x30768e[_0xafae('0x6a')]){var _0x350560=ejs[_0xafae('0x68')](_0x32b8bb,{'trunks':_0x482580||[]});fs['writeFileSync'](_0xafae('0x6b'),_0x350560);}})[_0xafae('0x33')](function(){return respondWithRpcPromise('Reload',_0xafae('0x5b'),{'module':_0xafae('0x6c')});})[_0xafae('0x33')](function(){var _0x7dd4b1=_0x58ab46[_0xafae('0x5c')]['get']({'plain':!![]});if(!_0x7dd4b1)throw new Error(_0xafae('0x5d'));if(_0x7dd4b1[_0xafae('0x5e')]===_0xafae('0x5c')){var _0x402bb4=_0x30768e[_0xafae('0x35')]({'plain':!![]});return db[_0xafae('0x6d')][_0xafae('0x54')]({'where':{'name':_0xafae('0x5f'),'userProfileId':_0x7dd4b1[_0xafae('0x6e')]},'raw':!![]})[_0xafae('0x33')](function(_0x9dcca8){if(_0x9dcca8&&_0x9dcca8[_0xafae('0x60')]===0x0){return db['UserProfileResource'][_0xafae('0x5b')]({'name':_0x402bb4[_0xafae('0x38')],'resourceId':_0x402bb4['id'],'type':_0x9dcca8[_0xafae('0x38')],'sectionId':_0x9dcca8['id']},{})[_0xafae('0x33')](function(){return _0x30768e;});}else{return _0x30768e;}})[_0xafae('0x27')](function(_0x5d957c){logger[_0xafae('0x22')](_0xafae('0x61'),_0x5d957c);throw _0x5d957c;});}return _0x30768e;})[_0xafae('0x33')](respondWithResult(_0x5a21c8,0xc9))[_0xafae('0x27')](handleError(_0x5a21c8,null));};exports[_0xafae('0x32')]=function(_0x1ea184,_0x3c86af,_0x47c7c1){var _0xda39a;return db['Trunk'][_0xafae('0x54')]({'where':{'id':_0x1ea184[_0xafae('0x56')]['id']}})['then'](handleEntityNotFound(_0x3c86af,null))[_0xafae('0x33')](saveUpdates(_0x1ea184[_0xafae('0x59')],null))[_0xafae('0x33')](function(_0x3af48b){if(_0x3af48b){_0xda39a=_0x3af48b;return db[_0xafae('0x3b')][_0xafae('0x4f')]({'raw':!![]});}})['then'](function(_0x15cb60){if(_0x15cb60){var _0xf71b48=fs[_0xafae('0x66')](path[_0xafae('0x62')](config[_0xafae('0x63')],_0xafae('0x64')),_0xafae('0x65'));var _0x19672a=fs[_0xafae('0x66')](path['join'](config[_0xafae('0x63')],_0xafae('0x67')),'utf8');var _0x36c06e=ejs['render'](_0xf71b48,{'trunks':_0x15cb60||[]});fs['writeFileSync'](_0xafae('0x69'),_0x36c06e);var _0xb7fe42=ejs[_0xafae('0x68')](_0x19672a,{'trunks':_0x15cb60||[]});fs['writeFileSync'](_0xafae('0x6b'),_0xb7fe42);return respondWithRpcPromise(_0xafae('0x6f'),'update',{'module':'chan_sip.so'});}return null;})[_0xafae('0x33')](function(_0x4e24b8){if(_0x4e24b8){return _0xda39a;}})[_0xafae('0x33')](respondWithResult(_0x3c86af,null))[_0xafae('0x27')](handleError(_0x3c86af,null));};exports[_0xafae('0x34')]=function(_0x45c663,_0x4b45dd,_0x49c060){var _0x134fee;return db[_0xafae('0x3b')][_0xafae('0x54')]({'where':{'id':_0x45c663[_0xafae('0x56')]['id']}})[_0xafae('0x33')](handleEntityNotFound(_0x4b45dd,null))[_0xafae('0x33')](removeEntity(_0x4b45dd,null))[_0xafae('0x33')](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x27f0ef){var _0x463901=fs[_0xafae('0x66')](path['join'](config[_0xafae('0x63')],'server/files/templates/trunk.ejs'),'utf8');var _0x26f88d=fs[_0xafae('0x66')](path['join'](config[_0xafae('0x63')],'server/files/templates/registry.ejs'),_0xafae('0x65'));var _0x2a7c77=ejs[_0xafae('0x68')](_0x463901,{'trunks':_0x27f0ef});var _0xf46ad7=ejs[_0xafae('0x68')](_0x26f88d,{'trunks':_0x27f0ef});fs[_0xafae('0x70')](_0xafae('0x69'),_0x2a7c77);fs['writeFileSync'](_0xafae('0x6b'),_0xf46ad7);return respondWithRpcPromise(_0xafae('0x6f'),_0xafae('0x34'),{'module':_0xafae('0x6c')});})[_0xafae('0x27')](handleError(_0x4b45dd,null));}; \ No newline at end of file +var _0x3b8a=['userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','update','destroy','then','get','Trunks','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','Trunk','findAll','show','rawAttributes','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1ed1df,_0x5b20e7){var _0x15d1c3=function(_0x3d32b2){while(--_0x3d32b2){_0x1ed1df['push'](_0x1ed1df['shift']());}};_0x15d1c3(++_0x5b20e7);}(_0x3b8a,0x7f));var _0xa3b8=function(_0x4c4bb7,_0x2ff0c9){_0x4c4bb7=_0x4c4bb7-0x0;var _0x142dd1=_0x3b8a[_0x4c4bb7];return _0x142dd1;};'use strict';var pdf=require(_0xa3b8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa3b8('0x1'));var jsonpatch=require(_0xa3b8('0x2'));var rp=require(_0xa3b8('0x3'));var moment=require(_0xa3b8('0x4'));var BPromise=require(_0xa3b8('0x5'));var Mustache=require(_0xa3b8('0x6'));var util=require(_0xa3b8('0x7'));var path=require(_0xa3b8('0x8'));var sox=require('sox');var csv=require(_0xa3b8('0x9'));var ejs=require(_0xa3b8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa3b8('0xb'));var crypto=require(_0xa3b8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa3b8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa3b8('0xe'));var Papa=require(_0xa3b8('0xf'));var Redis=require(_0xa3b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3b8('0x11'));var hardwareService=require(_0xa3b8('0x12'));var logger=require(_0xa3b8('0x13'))('api');var utils=require(_0xa3b8('0x14'));var config=require(_0xa3b8('0x15'));var db=require(_0xa3b8('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa3b8('0x17')][_0xa3b8('0x18')]({'port':0x232a});function checkPasswordPattern(_0x42543,_0x31c7c1,_0x2cadcc){if(_0x2cadcc){var _0x340c96=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x340c96['test'](_0x31c7c1)){return _0x42543;}else{throw new Error(_0xa3b8('0x19'));}}else{return _0x42543;}}function respondWithRpcPromise(_0x51d552,_0x2b6f88,_0x51f240,_0x1550d2){return new BPromise(function(_0x1f3015,_0x40800b){var _0x14e0ef=_0x1550d2||client;return _0x14e0ef[_0xa3b8('0x1a')](_0x51d552,_0x51f240)['then'](function(_0x348118){logger[_0xa3b8('0x1b')](_0xa3b8('0x1c'),_0x2b6f88,'request\x20sent');logger[_0xa3b8('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2b6f88,_0xa3b8('0x1e'),JSON['stringify'](_0x348118));if(_0x348118[_0xa3b8('0x1f')]){if(_0x348118[_0xa3b8('0x1f')][_0xa3b8('0x20')]===0x1f4){logger['error'](_0xa3b8('0x1c'),_0x2b6f88,_0x348118[_0xa3b8('0x1f')][_0xa3b8('0x21')]);return _0x40800b(_0x348118[_0xa3b8('0x1f')][_0xa3b8('0x21')]);}logger[_0xa3b8('0x1f')]('Trunk,\x20%s,\x20%s',_0x2b6f88,_0x348118[_0xa3b8('0x1f')][_0xa3b8('0x21')]);return _0x1f3015(_0x348118[_0xa3b8('0x1f')][_0xa3b8('0x21')]);}else{logger[_0xa3b8('0x1b')](_0xa3b8('0x1c'),_0x2b6f88,'request\x20sent');_0x1f3015(_0x348118[_0xa3b8('0x22')][_0xa3b8('0x21')]);}})[_0xa3b8('0x23')](function(_0x3ef054){logger['error']('Trunk,\x20%s,\x20%s',_0x2b6f88,_0x3ef054);_0x40800b(_0x3ef054);});});}function respondWithStatusCode(_0x42544a,_0x476e38){_0x476e38=_0x476e38||0xcc;return function(_0x127eba){if(_0x127eba){return _0x42544a[_0xa3b8('0x24')](_0x476e38);}return _0x42544a['status'](_0x476e38)[_0xa3b8('0x25')]();};}function respondWithResult(_0x557edd,_0x109f8d){_0x109f8d=_0x109f8d||0xc8;return function(_0x4fad34){if(_0x4fad34){return _0x557edd[_0xa3b8('0x26')](_0x109f8d)[_0xa3b8('0x27')](_0x4fad34);}};}function respondWithFilteredResult(_0x2433ec,_0x14cdde){return function(_0x85534f){if(_0x85534f){var _0x439ffe=_0x85534f['count'],_0x48c2ed=_0x14cdde['offset'],_0x4fb7f8=_0x14cdde[_0xa3b8('0x28')]+_0x14cdde[_0xa3b8('0x29')],_0x2ff231;if(_0x4fb7f8>=_0x439ffe){_0x4fb7f8=_0x439ffe;_0x2ff231=0xc8;}else{_0x2ff231=0xce;}_0x2433ec[_0xa3b8('0x26')](_0x2ff231);return _0x2433ec[_0xa3b8('0x2a')](_0xa3b8('0x2b'),_0x48c2ed+'-'+_0x4fb7f8+'/'+_0x439ffe)[_0xa3b8('0x27')](_0x85534f);}return null;};}function patchUpdates(_0x216004){return function(_0xe5bc08){try{jsonpatch['apply'](_0xe5bc08,_0x216004,!![]);}catch(_0x38be4b){return BPromise[_0xa3b8('0x2c')](_0x38be4b);}return _0xe5bc08['save']();};}function saveUpdates(_0x1a2d7c,_0x4cce1c){return function(_0x48fb89){if(_0x48fb89){return _0x48fb89[_0xa3b8('0x2d')](_0x1a2d7c)['then'](function(_0x4f6b22){return _0x4f6b22;});}return null;};}function removeEntity(_0x241378,_0x1cd432){return function(_0xedb02){if(_0xedb02){return _0xedb02[_0xa3b8('0x2e')]()[_0xa3b8('0x2f')](function(){var _0xfaa996=_0xedb02[_0xa3b8('0x30')]({'plain':!![]});var _0x32bc45=_0xa3b8('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x32bc45,'resourceId':_0xfaa996['id']}})['then'](function(){return _0xedb02;});})[_0xa3b8('0x2f')](function(){_0x241378['status'](0xcc)[_0xa3b8('0x25')]();});}};}function handleEntityNotFound(_0x270eb9,_0x3db463){return function(_0x2fa00e){if(!_0x2fa00e){_0x270eb9['sendStatus'](0x194);}return _0x2fa00e;};}function handleError(_0x1b39aa,_0x36f917){_0x36f917=_0x36f917||0x1f4;return function(_0x3f23ae){logger[_0xa3b8('0x1f')](_0x3f23ae[_0xa3b8('0x32')]);if(_0x3f23ae[_0xa3b8('0x33')]){delete _0x3f23ae[_0xa3b8('0x33')];}_0x1b39aa[_0xa3b8('0x26')](_0x36f917)[_0xa3b8('0x34')](_0x3f23ae);};}exports[_0xa3b8('0x35')]=function(_0x4cb222,_0x153b25){var _0x485350={},_0x55606c={},_0x1188b8={'count':0x0,'rows':[]};var _0x1210f8=db['Trunk']['rawAttributes'];_0x55606c['model']=_[_0xa3b8('0x36')](_0x1210f8);_0x55606c[_0xa3b8('0x37')]=_[_0xa3b8('0x36')](_0x4cb222[_0xa3b8('0x37')]);_0x55606c[_0xa3b8('0x38')]=_[_0xa3b8('0x39')](_0x55606c[_0xa3b8('0x3a')],_0x55606c[_0xa3b8('0x37')]);_0x485350[_0xa3b8('0x3b')]=_[_0xa3b8('0x39')](_0x55606c['model'],qs[_0xa3b8('0x3c')](_0x4cb222[_0xa3b8('0x37')][_0xa3b8('0x3c')]));_0x485350[_0xa3b8('0x3b')]=_0x485350[_0xa3b8('0x3b')][_0xa3b8('0x3d')]?_0x485350['attributes']:_0x55606c[_0xa3b8('0x3a')];if(!_0x4cb222[_0xa3b8('0x37')]['hasOwnProperty'](_0xa3b8('0x3e'))){_0x485350['limit']=qs[_0xa3b8('0x29')](_0x4cb222['query']['limit']);_0x485350['offset']=qs['offset'](_0x4cb222[_0xa3b8('0x37')][_0xa3b8('0x28')]);}_0x485350['order']=qs['sort'](_0x4cb222[_0xa3b8('0x37')][_0xa3b8('0x3f')]);_0x485350[_0xa3b8('0x40')]=qs[_0xa3b8('0x38')](_[_0xa3b8('0x41')](_0x4cb222['query'],_0x55606c[_0xa3b8('0x38')]));if(_0x4cb222[_0xa3b8('0x37')]['filter']){_0x485350['where']=_['merge'](_0x485350[_0xa3b8('0x40')],{'$or':_[_0xa3b8('0x42')](_0x1210f8,function(_0x1376e9){if(_0x1376e9[_0xa3b8('0x43')][_0xa3b8('0x44')]!==_0xa3b8('0x45')){var _0x1b5385={};_0x1b5385[_0x1376e9[_0xa3b8('0x46')]]={'$like':'%'+_0x4cb222['query'][_0xa3b8('0x47')]+'%'};return _0x1b5385;}})});}_0x485350=_[_0xa3b8('0x48')]({},_0x485350,_0x4cb222[_0xa3b8('0x49')]);var _0x6534b1={'where':_0x485350[_0xa3b8('0x40')]};return db['Trunk'][_0xa3b8('0x4a')](_0x6534b1)['then'](function(_0x170579){_0x1188b8[_0xa3b8('0x4a')]=_0x170579;if(_0x4cb222[_0xa3b8('0x37')][_0xa3b8('0x4b')]){_0x485350[_0xa3b8('0x4c')]=[{'all':!![]}];}return db[_0xa3b8('0x4d')][_0xa3b8('0x4e')](_0x485350);})[_0xa3b8('0x2f')](function(_0xd05ef0){_0x1188b8['rows']=_0xd05ef0;return _0x1188b8;})[_0xa3b8('0x2f')](respondWithFilteredResult(_0x153b25,_0x485350))['catch'](handleError(_0x153b25,null));};exports[_0xa3b8('0x4f')]=function(_0x3dfb3c,_0x10199c){var _0x160159={'raw':![],'where':{'id':_0x3dfb3c['params']['id']}},_0x5e9e00={};_0x5e9e00['model']=_[_0xa3b8('0x36')](db[_0xa3b8('0x4d')][_0xa3b8('0x50')]);_0x5e9e00[_0xa3b8('0x37')]=_[_0xa3b8('0x36')](_0x3dfb3c[_0xa3b8('0x37')]);_0x5e9e00['filters']=_[_0xa3b8('0x39')](_0x5e9e00[_0xa3b8('0x3a')],_0x5e9e00[_0xa3b8('0x37')]);_0x160159[_0xa3b8('0x3b')]=_['intersection'](_0x5e9e00[_0xa3b8('0x3a')],qs[_0xa3b8('0x3c')](_0x3dfb3c[_0xa3b8('0x37')][_0xa3b8('0x3c')]));_0x160159['attributes']=_0x160159[_0xa3b8('0x3b')]['length']?_0x160159[_0xa3b8('0x3b')]:_0x5e9e00[_0xa3b8('0x3a')];if(_0x3dfb3c[_0xa3b8('0x37')][_0xa3b8('0x4b')]){_0x160159[_0xa3b8('0x4c')]=[{'all':!![]}];}_0x160159=_['merge']({},_0x160159,_0x3dfb3c[_0xa3b8('0x49')]);return db[_0xa3b8('0x4d')][_0xa3b8('0x51')](_0x160159)[_0xa3b8('0x2f')](handleEntityNotFound(_0x10199c,null))['then'](respondWithResult(_0x10199c,null))[_0xa3b8('0x23')](handleError(_0x10199c,null));};exports[_0xa3b8('0x52')]=function(_0x4089d0,_0x404587){var _0x41180c={'raw':![],'where':{'id':_0x4089d0['params']['id']}},_0x107e00={};_0x107e00[_0xa3b8('0x3a')]=_['keys'](db[_0xa3b8('0x4d')][_0xa3b8('0x50')]);_0x41180c[_0xa3b8('0x3b')]=_['intersection'](_0x107e00[_0xa3b8('0x3a')],qs[_0xa3b8('0x3c')](_0x4089d0[_0xa3b8('0x37')][_0xa3b8('0x3c')]));_0x41180c[_0xa3b8('0x3b')]=_0x41180c[_0xa3b8('0x3b')][_0xa3b8('0x3d')]?_0x41180c[_0xa3b8('0x3b')]:_0x107e00['model'];if(_0x4089d0[_0xa3b8('0x37')]['includeAll']){_0x41180c[_0xa3b8('0x4c')]=[{'all':!![]}];}_0x41180c=_['merge']({},_0x41180c,_0x4089d0[_0xa3b8('0x49')]);return db[_0xa3b8('0x4d')][_0xa3b8('0x51')](_0x41180c)[_0xa3b8('0x2f')](handleEntityNotFound(_0x404587,null))[_0xa3b8('0x2f')](function(_0x4113af){if(_0x4113af){var _0x33c061=_0x4113af['get']({'plain':!![]});_0x33c061=qs[_0xa3b8('0x53')](_0x33c061,['id','createdAt',_0xa3b8('0x54')]);_0x4089d0['body']=_[_0xa3b8('0x53')](_0x4089d0[_0xa3b8('0x55')],['id',_0xa3b8('0x56'),_0xa3b8('0x54')]);return db[_0xa3b8('0x4d')]['create'](_['merge'](_0x33c061,_0x4089d0[_0xa3b8('0x55')]),{'include':_0x4089d0[_0xa3b8('0x37')][_0xa3b8('0x4b')]?[{'all':!![]}]:undefined})[_0xa3b8('0x2f')](function(_0x58ea15){var _0x5e51d7=_0x4089d0[_0xa3b8('0x57')]['get']({'plain':!![]});if(!_0x5e51d7)throw new Error(_0xa3b8('0x58'));if(_0x5e51d7[_0xa3b8('0x59')]==='user'){var _0x176159=_0x58ea15['get']({'plain':!![]});var _0x64141c=_0xa3b8('0x31');return db[_0xa3b8('0x5a')][_0xa3b8('0x51')]({'where':{'name':_0x64141c,'userProfileId':_0x5e51d7[_0xa3b8('0x5b')]},'raw':!![]})[_0xa3b8('0x2f')](function(_0x4187f0){if(_0x4187f0&&_0x4187f0[_0xa3b8('0x5c')]===0x0){return db[_0xa3b8('0x5d')][_0xa3b8('0x5e')]({'name':_0x176159[_0xa3b8('0x33')],'resourceId':_0x176159['id'],'type':_0x4187f0[_0xa3b8('0x33')],'sectionId':_0x4187f0['id']},{})['then'](function(){return _0x58ea15;});}else{return _0x58ea15;}})[_0xa3b8('0x23')](function(_0x478389){logger[_0xa3b8('0x1f')](_0xa3b8('0x5f'),_0x478389);throw _0x478389;});}return _0x58ea15;});}})[_0xa3b8('0x2f')](respondWithResult(_0x404587,0xc9))[_0xa3b8('0x23')](handleError(_0x404587,null));};exports[_0xa3b8('0x5e')]=function(_0x9e7d86,_0x4708b1,_0x1c440f){var _0x8346c0;return db[_0xa3b8('0x4d')][_0xa3b8('0x5e')](_0x9e7d86[_0xa3b8('0x55')],{'raw':!![]})[_0xa3b8('0x2f')](function(_0x32905d){_0x8346c0=_0x32905d;return db[_0xa3b8('0x4d')][_0xa3b8('0x4e')]({'raw':!![]});})[_0xa3b8('0x2f')](function(_0x244c4c){var _0x378808=fs[_0xa3b8('0x60')](path[_0xa3b8('0x61')](config['root'],_0xa3b8('0x62')),_0xa3b8('0x63'));var _0x14f3a3=fs[_0xa3b8('0x60')](path[_0xa3b8('0x61')](config[_0xa3b8('0x64')],_0xa3b8('0x65')),_0xa3b8('0x63'));var _0x499648=ejs['render'](_0x378808,{'trunks':_0x244c4c||[]});fs[_0xa3b8('0x66')](_0xa3b8('0x67'),_0x499648);if(_0x8346c0[_0xa3b8('0x68')]){var _0x51fb9f=ejs[_0xa3b8('0x69')](_0x14f3a3,{'trunks':_0x244c4c||[]});fs[_0xa3b8('0x66')](_0xa3b8('0x6a'),_0x51fb9f);}})[_0xa3b8('0x2f')](function(){return respondWithRpcPromise(_0xa3b8('0x6b'),_0xa3b8('0x5e'),{'module':'chan_sip.so'});})[_0xa3b8('0x2f')](function(){var _0x3aaaae=_0x9e7d86[_0xa3b8('0x57')][_0xa3b8('0x30')]({'plain':!![]});if(!_0x3aaaae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aaaae[_0xa3b8('0x59')]==='user'){var _0x3d05d6=_0x8346c0[_0xa3b8('0x30')]({'plain':!![]});return db[_0xa3b8('0x5a')]['find']({'where':{'name':'Trunks','userProfileId':_0x3aaaae[_0xa3b8('0x5b')]},'raw':!![]})[_0xa3b8('0x2f')](function(_0x24f4b9){if(_0x24f4b9&&_0x24f4b9['autoAssociation']===0x0){return db[_0xa3b8('0x5d')][_0xa3b8('0x5e')]({'name':_0x3d05d6[_0xa3b8('0x33')],'resourceId':_0x3d05d6['id'],'type':_0x24f4b9[_0xa3b8('0x33')],'sectionId':_0x24f4b9['id']},{})[_0xa3b8('0x2f')](function(){return _0x8346c0;});}else{return _0x8346c0;}})[_0xa3b8('0x23')](function(_0x2e86be){logger[_0xa3b8('0x1f')](_0xa3b8('0x5f'),_0x2e86be);throw _0x2e86be;});}return _0x8346c0;})[_0xa3b8('0x2f')](respondWithResult(_0x4708b1,0xc9))['catch'](handleError(_0x4708b1,null));};exports['update']=function(_0x3e0dc8,_0x17e064,_0x24ce7c){var _0x41862d;return db[_0xa3b8('0x4d')][_0xa3b8('0x51')]({'where':{'id':_0x3e0dc8['params']['id']}})[_0xa3b8('0x2f')](handleEntityNotFound(_0x17e064,null))[_0xa3b8('0x2f')](saveUpdates(_0x3e0dc8[_0xa3b8('0x55')],null))[_0xa3b8('0x2f')](function(_0x5d3def){if(_0x5d3def){_0x41862d=_0x5d3def;return db['Trunk'][_0xa3b8('0x4e')]({'raw':!![]});}})[_0xa3b8('0x2f')](function(_0x2c6c63){if(_0x2c6c63){var _0x52b8df=fs[_0xa3b8('0x60')](path[_0xa3b8('0x61')](config[_0xa3b8('0x64')],'server/files/templates/trunk.ejs'),'utf8');var _0x89a253=fs[_0xa3b8('0x60')](path[_0xa3b8('0x61')](config['root'],'server/files/templates/registry.ejs'),_0xa3b8('0x63'));var _0x2c5180=ejs['render'](_0x52b8df,{'trunks':_0x2c6c63||[]});fs[_0xa3b8('0x66')](_0xa3b8('0x67'),_0x2c5180);var _0x2f1096=ejs[_0xa3b8('0x69')](_0x89a253,{'trunks':_0x2c6c63||[]});fs[_0xa3b8('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x2f1096);return respondWithRpcPromise(_0xa3b8('0x6b'),_0xa3b8('0x2d'),{'module':_0xa3b8('0x6c')});}return null;})[_0xa3b8('0x2f')](function(_0x2f19cb){if(_0x2f19cb){return _0x41862d;}})['then'](respondWithResult(_0x17e064,null))['catch'](handleError(_0x17e064,null));};exports[_0xa3b8('0x2e')]=function(_0x5883a6,_0x16a4f8,_0x5f1b17){var _0x3f0088;return db[_0xa3b8('0x4d')][_0xa3b8('0x51')]({'where':{'id':_0x5883a6['params']['id']}})['then'](handleEntityNotFound(_0x16a4f8,null))['then'](removeEntity(_0x16a4f8,null))[_0xa3b8('0x2f')](function(){return db[_0xa3b8('0x4d')][_0xa3b8('0x4e')]({'raw':!![]});})['then'](function(_0x52a3fe){var _0x2c4cee=fs['readFileSync'](path[_0xa3b8('0x61')](config[_0xa3b8('0x64')],_0xa3b8('0x62')),'utf8');var _0xa4c158=fs[_0xa3b8('0x60')](path[_0xa3b8('0x61')](config[_0xa3b8('0x64')],_0xa3b8('0x65')),'utf8');var _0xcf769b=ejs[_0xa3b8('0x69')](_0x2c4cee,{'trunks':_0x52a3fe});var _0x32d8f4=ejs[_0xa3b8('0x69')](_0xa4c158,{'trunks':_0x52a3fe});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0xcf769b);fs[_0xa3b8('0x66')](_0xa3b8('0x6a'),_0x32d8f4);return respondWithRpcPromise('Reload',_0xa3b8('0x2e'),{'module':_0xa3b8('0x6c')});})[_0xa3b8('0x23')](handleError(_0x16a4f8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4ea5319..fc8a0ee 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 _0x04de=['./trunk.attributes','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x04de,0x107));var _0xe04d=function(_0x134a33,_0x378e79){_0x134a33=_0x134a33-0x0;var _0x5a28a9=_0x04de[_0x134a33];return _0x5a28a9;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f5=['bluebird','request-promise','path','rimraf','./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','moment'];(function(_0x4941bc,_0x199598){var _0xf3862d=function(_0x7bdbd5){while(--_0x7bdbd5){_0x4941bc['push'](_0x4941bc['shift']());}};_0xf3862d(++_0x199598);}(_0x68f5,0x11a));var _0x568f=function(_0x4d1ee9,_0x170b08){_0x4d1ee9=_0x4d1ee9-0x0;var _0xac8e9f=_0x68f5[_0x4d1ee9];return _0xac8e9f;};'use strict';var _=require(_0x568f('0x0'));var util=require(_0x568f('0x1'));var logger=require(_0x568f('0x2'))('api');var moment=require(_0x568f('0x3'));var BPromise=require(_0x568f('0x4'));var rp=require(_0x568f('0x5'));var fs=require('fs');var path=require(_0x568f('0x6'));var rimraf=require(_0x568f('0x7'));var config=require('../../config/environment');var attributes=require(_0x568f('0x8'));module[_0x568f('0x9')]=function(_0x31444b,_0x3181fd){return _0x31444b['define']('Trunk',attributes,{'tableName':_0x568f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 43c8242..661c457 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 _0x1db6=['model','map','ShowTrunk','find','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include'];(function(_0x53f571,_0x330271){var _0x269155=function(_0x4ed484){while(--_0x4ed484){_0x53f571['push'](_0x53f571['shift']());}};_0x269155(++_0x330271);}(_0x1db6,0xa9));var _0x61db=function(_0x3c0e56,_0x54c2b3){_0x3c0e56=_0x3c0e56-0x0;var _0x2047a0=_0x1db6[_0x3c0e56];return _0x2047a0;};'use strict';var _=require(_0x61db('0x0'));var util=require(_0x61db('0x1'));var moment=require(_0x61db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61db('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x61db('0x4'));var logger=require('../../config/logger')(_0x61db('0x5'));var config=require(_0x61db('0x6'));var jayson=require(_0x61db('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c4f89,_0x28cbcb,_0x44083c){return new BPromise(function(_0x2ac5aa,_0x41c889){return client[_0x61db('0x8')](_0x5c4f89,_0x44083c)[_0x61db('0x9')](function(_0x4b2cc3){logger[_0x61db('0xa')]('Trunk,\x20%s,\x20%s',_0x28cbcb,'request\x20sent');logger[_0x61db('0xb')](_0x61db('0xc'),_0x28cbcb,_0x61db('0xd'),JSON[_0x61db('0xe')](_0x4b2cc3));if(_0x4b2cc3[_0x61db('0xf')]){if(_0x4b2cc3[_0x61db('0xf')][_0x61db('0x10')]===0x1f4){logger[_0x61db('0xf')]('Trunk,\x20%s,\x20%s',_0x28cbcb,_0x4b2cc3[_0x61db('0xf')]['message']);return _0x41c889(_0x4b2cc3['error'][_0x61db('0x11')]);}logger[_0x61db('0xf')](_0x61db('0x12'),_0x28cbcb,_0x4b2cc3[_0x61db('0xf')]['message']);return _0x2ac5aa(_0x4b2cc3[_0x61db('0xf')]['message']);}else{logger[_0x61db('0xa')]('Trunk,\x20%s,\x20%s',_0x28cbcb,_0x61db('0xd'));_0x2ac5aa(_0x4b2cc3[_0x61db('0x13')][_0x61db('0x11')]);}})[_0x61db('0x14')](function(_0x5bb788){logger[_0x61db('0xf')](_0x61db('0x12'),_0x28cbcb,_0x5bb788);_0x41c889(_0x5bb788);});});}exports[_0x61db('0x15')]=function(_0x137da8){var _0x5d68e1=this;return new Promise(function(_0x4346e2,_0x523210){return db[_0x61db('0x16')]['findAll']({'raw':_0x137da8[_0x61db('0x17')]?_0x137da8[_0x61db('0x17')][_0x61db('0x18')]===undefined?!![]:![]:!![],'where':_0x137da8[_0x61db('0x17')]?_0x137da8[_0x61db('0x17')][_0x61db('0x19')]||null:null,'attributes':_0x137da8[_0x61db('0x17')]?_0x137da8['options'][_0x61db('0x1a')]||null:null,'limit':_0x137da8[_0x61db('0x17')]?_0x137da8[_0x61db('0x17')][_0x61db('0x1b')]||null:null,'include':_0x137da8['options']?_0x137da8['options'][_0x61db('0x1c')]?_['map'](_0x137da8['options']['include'],function(_0x51aab6){return{'model':db[_0x51aab6[_0x61db('0x1d')]],'as':_0x51aab6['as'],'attributes':_0x51aab6[_0x61db('0x1a')],'include':_0x51aab6[_0x61db('0x1c')]?_[_0x61db('0x1e')](_0x51aab6['include'],function(_0x2eed0d){return{'model':db[_0x2eed0d[_0x61db('0x1d')]],'as':_0x2eed0d['as'],'attributes':_0x2eed0d[_0x61db('0x1a')],'include':_0x2eed0d[_0x61db('0x1c')]?_[_0x61db('0x1e')](_0x2eed0d[_0x61db('0x1c')],function(_0x19b380){return{'model':db[_0x19b380[_0x61db('0x1d')]],'as':_0x19b380['as'],'attributes':_0x19b380[_0x61db('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xef5654){logger[_0x61db('0xa')](_0x61db('0x15'),_0x137da8);logger[_0x61db('0xb')]('GetTrunk',_0x137da8,JSON[_0x61db('0xe')](_0xef5654));_0x4346e2(_0xef5654);})['catch'](function(_0x18f08b){logger[_0x61db('0xf')](_0x61db('0x15'),_0x18f08b[_0x61db('0x11')],_0x137da8);_0x523210(_0x5d68e1[_0x61db('0xf')](0x1f4,_0x18f08b['message']));});});};exports[_0x61db('0x1f')]=function(_0x14c333){var _0x11edc8=this;return new Promise(function(_0x3c69aa,_0x4c6a33){return db['Trunk'][_0x61db('0x20')]({'raw':_0x14c333[_0x61db('0x17')]?_0x14c333[_0x61db('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x14c333[_0x61db('0x17')]?_0x14c333[_0x61db('0x17')][_0x61db('0x19')]||null:null,'attributes':_0x14c333[_0x61db('0x17')]?_0x14c333['options'][_0x61db('0x1a')]||null:null,'include':_0x14c333[_0x61db('0x17')]?_0x14c333[_0x61db('0x17')]['include']?_[_0x61db('0x1e')](_0x14c333[_0x61db('0x17')][_0x61db('0x1c')],function(_0x5dda7b){return{'model':db[_0x5dda7b[_0x61db('0x1d')]],'as':_0x5dda7b['as'],'attributes':_0x5dda7b[_0x61db('0x1a')],'include':_0x5dda7b['include']?_[_0x61db('0x1e')](_0x5dda7b[_0x61db('0x1c')],function(_0x143094){return{'model':db[_0x143094[_0x61db('0x1d')]],'as':_0x143094['as'],'attributes':_0x143094[_0x61db('0x1a')],'include':_0x143094[_0x61db('0x1c')]?_[_0x61db('0x1e')](_0x143094[_0x61db('0x1c')],function(_0x4b3978){return{'model':db[_0x4b3978[_0x61db('0x1d')]],'as':_0x4b3978['as'],'attributes':_0x4b3978[_0x61db('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x564aad){logger['info'](_0x61db('0x1f'),_0x14c333);logger[_0x61db('0xb')](_0x61db('0x1f'),_0x14c333,JSON[_0x61db('0xe')](_0x564aad));_0x3c69aa(_0x564aad);})[_0x61db('0x14')](function(_0x32c676){logger[_0x61db('0xf')](_0x61db('0x1f'),_0x32c676[_0x61db('0x11')],_0x14c333);_0x4c6a33(_0x11edc8[_0x61db('0xf')](0x1f4,_0x32c676[_0x61db('0x11')]));});});}; \ No newline at end of file +var _0xd381=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetTrunk','debug','ShowTrunk','find','bluebird'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd381,0x13f));var _0x1d38=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0xd381[_0x39d39d];return _0x577ac3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1d38('0x0'));var rs=require(_0x1d38('0x1'));var fs=require('fs');var Redis=require(_0x1d38('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d38('0x3'));var logger=require(_0x1d38('0x4'))(_0x1d38('0x5'));var config=require(_0x1d38('0x6'));var jayson=require(_0x1d38('0x7'));var client=jayson['client'][_0x1d38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f2056,_0x216d58,_0x385c1f){return new BPromise(function(_0x279adf,_0x3d3c92){return client['request'](_0x2f2056,_0x385c1f)[_0x1d38('0x9')](function(_0x190b36){logger[_0x1d38('0xa')](_0x1d38('0xb'),_0x216d58,_0x1d38('0xc'));logger['debug'](_0x1d38('0xd'),_0x216d58,_0x1d38('0xc'),JSON[_0x1d38('0xe')](_0x190b36));if(_0x190b36[_0x1d38('0xf')]){if(_0x190b36[_0x1d38('0xf')][_0x1d38('0x10')]===0x1f4){logger[_0x1d38('0xf')]('Trunk,\x20%s,\x20%s',_0x216d58,_0x190b36[_0x1d38('0xf')][_0x1d38('0x11')]);return _0x3d3c92(_0x190b36[_0x1d38('0xf')][_0x1d38('0x11')]);}logger['error'](_0x1d38('0xb'),_0x216d58,_0x190b36[_0x1d38('0xf')][_0x1d38('0x11')]);return _0x279adf(_0x190b36[_0x1d38('0xf')][_0x1d38('0x11')]);}else{logger[_0x1d38('0xa')](_0x1d38('0xb'),_0x216d58,'request\x20sent');_0x279adf(_0x190b36['result'][_0x1d38('0x11')]);}})[_0x1d38('0x12')](function(_0x54339e){logger[_0x1d38('0xf')](_0x1d38('0xb'),_0x216d58,_0x54339e);_0x3d3c92(_0x54339e);});});}exports['GetTrunk']=function(_0x10ce3b){var _0x19e4db=this;return new Promise(function(_0x4a6b74,_0x1ca67f){return db['Trunk'][_0x1d38('0x13')]({'raw':_0x10ce3b[_0x1d38('0x14')]?_0x10ce3b[_0x1d38('0x14')][_0x1d38('0x15')]===undefined?!![]:![]:!![],'where':_0x10ce3b[_0x1d38('0x14')]?_0x10ce3b[_0x1d38('0x14')][_0x1d38('0x16')]||null:null,'attributes':_0x10ce3b['options']?_0x10ce3b['options']['attributes']||null:null,'limit':_0x10ce3b[_0x1d38('0x14')]?_0x10ce3b[_0x1d38('0x14')][_0x1d38('0x17')]||null:null,'include':_0x10ce3b[_0x1d38('0x14')]?_0x10ce3b['options'][_0x1d38('0x18')]?_[_0x1d38('0x19')](_0x10ce3b[_0x1d38('0x14')][_0x1d38('0x18')],function(_0xd77225){return{'model':db[_0xd77225[_0x1d38('0x1a')]],'as':_0xd77225['as'],'attributes':_0xd77225[_0x1d38('0x1b')],'include':_0xd77225[_0x1d38('0x18')]?_[_0x1d38('0x19')](_0xd77225[_0x1d38('0x18')],function(_0x5d6d71){return{'model':db[_0x5d6d71[_0x1d38('0x1a')]],'as':_0x5d6d71['as'],'attributes':_0x5d6d71[_0x1d38('0x1b')],'include':_0x5d6d71[_0x1d38('0x18')]?_[_0x1d38('0x19')](_0x5d6d71[_0x1d38('0x18')],function(_0x4652a5){return{'model':db[_0x4652a5[_0x1d38('0x1a')]],'as':_0x4652a5['as'],'attributes':_0x4652a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d38('0x9')](function(_0x3237d6){logger[_0x1d38('0xa')](_0x1d38('0x1c'),_0x10ce3b);logger[_0x1d38('0x1d')](_0x1d38('0x1c'),_0x10ce3b,JSON[_0x1d38('0xe')](_0x3237d6));_0x4a6b74(_0x3237d6);})[_0x1d38('0x12')](function(_0x289ee5){logger[_0x1d38('0xf')](_0x1d38('0x1c'),_0x289ee5[_0x1d38('0x11')],_0x10ce3b);_0x1ca67f(_0x19e4db[_0x1d38('0xf')](0x1f4,_0x289ee5[_0x1d38('0x11')]));});});};exports[_0x1d38('0x1e')]=function(_0x14e97f){var _0x53e955=this;return new Promise(function(_0x153908,_0x411b93){return db['Trunk'][_0x1d38('0x1f')]({'raw':_0x14e97f[_0x1d38('0x14')]?_0x14e97f['options'][_0x1d38('0x15')]===undefined?!![]:![]:!![],'where':_0x14e97f['options']?_0x14e97f[_0x1d38('0x14')][_0x1d38('0x16')]||null:null,'attributes':_0x14e97f['options']?_0x14e97f[_0x1d38('0x14')]['attributes']||null:null,'include':_0x14e97f[_0x1d38('0x14')]?_0x14e97f[_0x1d38('0x14')][_0x1d38('0x18')]?_[_0x1d38('0x19')](_0x14e97f['options'][_0x1d38('0x18')],function(_0x2612a2){return{'model':db[_0x2612a2[_0x1d38('0x1a')]],'as':_0x2612a2['as'],'attributes':_0x2612a2[_0x1d38('0x1b')],'include':_0x2612a2[_0x1d38('0x18')]?_['map'](_0x2612a2[_0x1d38('0x18')],function(_0x385813){return{'model':db[_0x385813['model']],'as':_0x385813['as'],'attributes':_0x385813[_0x1d38('0x1b')],'include':_0x385813['include']?_[_0x1d38('0x19')](_0x385813[_0x1d38('0x18')],function(_0x5213b6){return{'model':db[_0x5213b6['model']],'as':_0x5213b6['as'],'attributes':_0x5213b6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d38('0x9')](function(_0x1e9bee){logger['info']('ShowTrunk',_0x14e97f);logger[_0x1d38('0x1d')]('ShowTrunk',_0x14e97f,JSON[_0x1d38('0xe')](_0x1e9bee));_0x153908(_0x1e9bee);})['catch'](function(_0xda5eb1){logger[_0x1d38('0xf')](_0x1d38('0x1e'),_0xda5eb1[_0x1d38('0x11')],_0x14e97f);_0x411b93(_0x53e955[_0x1d38('0xf')](0x1f4,_0xda5eb1[_0x1d38('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 3dbe76d..fd372ad 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 _0x7b9b=['/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','bulkCreate','/:id/contacts','create','addQueues','root','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','put','update','removeQueues','destroy','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/avatar','getAvatar','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams'];(function(_0x56e311,_0x554838){var _0x57d640=function(_0x47ba4e){while(--_0x47ba4e){_0x56e311['push'](_0x56e311['shift']());}};_0x57d640(++_0x554838);}(_0x7b9b,0x17c));var _0xb7b9=function(_0x145df3,_0x2044fb){_0x145df3=_0x145df3-0x0;var _0x4b27bb=_0x7b9b[_0x145df3];return _0x4b27bb;};'use strict';var multer=require(_0xb7b9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7b9('0x1'));var express=require(_0xb7b9('0x2'));var router=express[_0xb7b9('0x3')]();var auth=require(_0xb7b9('0x4'));var interaction=require(_0xb7b9('0x5'));var config=require(_0xb7b9('0x6'));var controller=require(_0xb7b9('0x7'));router['get']('/',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x9')]);router[_0xb7b9('0xa')](_0xb7b9('0xb'),auth['isAuthenticated'](),controller[_0xb7b9('0xc')]);router['get'](_0xb7b9('0xd'),auth[_0xb7b9('0x8')](),controller['show']);router[_0xb7b9('0xa')](_0xb7b9('0xe'),controller[_0xb7b9('0xf')]);router[_0xb7b9('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xb7b9('0xa')](_0xb7b9('0x10'),auth['isAuthenticated'](),controller[_0xb7b9('0x11')]);router[_0xb7b9('0xa')](_0xb7b9('0x12'),auth['isAuthenticated'](),controller[_0xb7b9('0x13')]);router['get'](_0xb7b9('0x14'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x15')]);router[_0xb7b9('0xa')](_0xb7b9('0x16'),auth['isAuthenticated'](),controller[_0xb7b9('0x17')]);router[_0xb7b9('0xa')](_0xb7b9('0x18'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x19')]);router[_0xb7b9('0xa')](_0xb7b9('0x1a'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x1b')]);router['get']('/:id/openchannel/interactions',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x1c')]);router[_0xb7b9('0xa')](_0xb7b9('0x1d'),auth['isAuthenticated'](),controller[_0xb7b9('0x1e')]);router[_0xb7b9('0xa')](_0xb7b9('0x1f'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x20')]);router[_0xb7b9('0xa')]('/:id/fax/interactions',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x21')]);router[_0xb7b9('0xa')](_0xb7b9('0x22'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x23')]);router['get'](_0xb7b9('0x24'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x25')]);router[_0xb7b9('0xa')](_0xb7b9('0x26'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x27')]);router['get'](_0xb7b9('0x28'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x29')]);router['get']('/:id/fax_accounts',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x2a')]);router[_0xb7b9('0xa')]('/:id/mail_accounts',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x2b')]);router['get'](_0xb7b9('0x2c'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x2d')]);router[_0xb7b9('0xa')](_0xb7b9('0x2e'),auth['isAuthenticated'](),controller[_0xb7b9('0x2f')]);router['get']('/:id/chat_websites',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x30')]);router[_0xb7b9('0xa')](_0xb7b9('0x31'),auth['isAuthenticated'](),controller[_0xb7b9('0x32')]);router['get']('/:id/scheduled_calls',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x33')]);router['get'](_0xb7b9('0x34'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x35')]);router[_0xb7b9('0x36')]('/create_many',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x37')]);router['post'](_0xb7b9('0x38'),auth[_0xb7b9('0x8')](),controller['addContacts']);router[_0xb7b9('0x36')]('/',auth['isAuthenticated'](),controller[_0xb7b9('0x39')]);router['post']('/:id/queues',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x3a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x321b3e,_0x2d6520,_0x19eed9){_0x19eed9(null,path['join'](config[_0xb7b9('0x3b')],'server/files/images/'));},'filename':function(_0x3a568a,_0x360a5d,_0x3b32ca){_0x3b32ca(null,util[_0xb7b9('0x3c')](_0xb7b9('0x3d'),Date[_0xb7b9('0x3e')](),_0x360a5d[_0xb7b9('0x3f')]));}})});router['post']('/:id/avatar',upload[_0xb7b9('0x40')](_0xb7b9('0x41')),controller['addAvatar']);router[_0xb7b9('0x36')](_0xb7b9('0x42'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x43')]);router[_0xb7b9('0x36')](_0xb7b9('0x44'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x45')]);router['post'](_0xb7b9('0x46'),auth[_0xb7b9('0x8')](),controller['pause']);router[_0xb7b9('0x36')](_0xb7b9('0x47'),auth[_0xb7b9('0x8')](),controller['unpause']);router[_0xb7b9('0x36')](_0xb7b9('0x22'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x48')]);router[_0xb7b9('0x36')](_0xb7b9('0x49'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x4a')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xb7b9('0x36')]('/:id/fax_interactions',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x4b')]);router['post'](_0xb7b9('0x4c'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x4d')]);router[_0xb7b9('0x36')]('/:id/openchannel_interactions',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x4e')]);router['post'](_0xb7b9('0x4f'),auth['isAuthenticated'](),controller[_0xb7b9('0x50')]);router[_0xb7b9('0x36')](_0xb7b9('0x51'),auth[_0xb7b9('0x8')](),controller['addMailAccounts']);router['post'](_0xb7b9('0x2c'),auth['isAuthenticated'](),controller[_0xb7b9('0x52')]);router[_0xb7b9('0x36')](_0xb7b9('0x2e'),auth[_0xb7b9('0x8')](),controller['addSmsAccounts']);router['post'](_0xb7b9('0x53'),auth['isAuthenticated'](),controller[_0xb7b9('0x54')]);router[_0xb7b9('0x36')](_0xb7b9('0x31'),auth['isAuthenticated'](),controller[_0xb7b9('0x55')]);router[_0xb7b9('0x36')](_0xb7b9('0x34'),auth[_0xb7b9('0x8')](),controller['createApiKey']);router[_0xb7b9('0x56')](_0xb7b9('0xd'),auth['isAuthenticated'](),controller[_0xb7b9('0x57')]);router['put']('/:id/password',auth[_0xb7b9('0x8')](),controller['changePassword']);router['delete'](_0xb7b9('0x10'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x58')]);router['delete']('/:id/teams',auth[_0xb7b9('0x8')](),controller['removeTeams']);router['delete'](_0xb7b9('0xd'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x59')]);router[_0xb7b9('0x5a')](_0xb7b9('0x49'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x5b')]);router[_0xb7b9('0x5a')](_0xb7b9('0x5c'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x5d')]);router[_0xb7b9('0x5a')](_0xb7b9('0x5e'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x5f')]);router[_0xb7b9('0x5a')](_0xb7b9('0x4c'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x60')]);router[_0xb7b9('0x5a')](_0xb7b9('0x61'),auth[_0xb7b9('0x8')](),controller['removeOpenchannelInteractions']);router[_0xb7b9('0x5a')](_0xb7b9('0x4f'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xb7b9('0x5a')](_0xb7b9('0x51'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x62')]);router[_0xb7b9('0x5a')](_0xb7b9('0x2c'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x63')]);router[_0xb7b9('0x5a')]('/:id/sms_accounts',auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x64')]);router[_0xb7b9('0x5a')](_0xb7b9('0x53'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x65')]);router['delete'](_0xb7b9('0x31'),auth[_0xb7b9('0x8')](),controller[_0xb7b9('0x66')]);router[_0xb7b9('0x5a')](_0xb7b9('0x34'),auth[_0xb7b9('0x8')](),controller['removeApiKey']);module[_0xb7b9('0x67')]=router; \ No newline at end of file +var _0xc21c=['getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','post','bulkCreate','addContacts','addQueues','diskStorage','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/:id','getAvatar','/:id/contacts','/:id/queues','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts'];(function(_0x264b91,_0x9c8a83){var _0x5c562d=function(_0x2b6090){while(--_0x2b6090){_0x264b91['push'](_0x264b91['shift']());}};_0x5c562d(++_0x9c8a83);}(_0xc21c,0x166));var _0xcc21=function(_0x26206e,_0x51c6ab){_0x26206e=_0x26206e-0x0;var _0x32aa5c=_0xc21c[_0x26206e];return _0x32aa5c;};'use strict';var multer=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var path=require('path');var timeout=require(_0xcc21('0x2'));var express=require(_0xcc21('0x3'));var router=express[_0xcc21('0x4')]();var auth=require(_0xcc21('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc21('0x6'));var controller=require(_0xcc21('0x7'));router[_0xcc21('0x8')]('/',auth[_0xcc21('0x9')](),controller[_0xcc21('0xa')]);router[_0xcc21('0x8')](_0xcc21('0xb'),auth['isAuthenticated'](),controller[_0xcc21('0xc')]);router[_0xcc21('0x8')](_0xcc21('0xd'),auth[_0xcc21('0x9')](),controller['show']);router[_0xcc21('0x8')]('/:id/avatar',controller[_0xcc21('0xe')]);router['get'](_0xcc21('0xf'),auth[_0xcc21('0x9')](),controller['getContacts']);router['get'](_0xcc21('0x10'),auth[_0xcc21('0x9')](),controller['getQueues']);router[_0xcc21('0x8')]('/:id/queues_rt',auth[_0xcc21('0x9')](),controller[_0xcc21('0x11')]);router[_0xcc21('0x8')]('/:id/groups',auth[_0xcc21('0x9')](),controller['getGroups']);router[_0xcc21('0x8')](_0xcc21('0x12'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x13')]);router[_0xcc21('0x8')](_0xcc21('0x14'),auth[_0xcc21('0x9')](),controller['getScreenRecordings']);router['get'](_0xcc21('0x15'),auth['isAuthenticated'](),controller[_0xcc21('0x16')]);router[_0xcc21('0x8')](_0xcc21('0x17'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x18')]);router['get'](_0xcc21('0x19'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x1a')]);router[_0xcc21('0x8')]('/:id/sms/interactions',auth[_0xcc21('0x9')](),controller[_0xcc21('0x1b')]);router[_0xcc21('0x8')](_0xcc21('0x1c'),auth[_0xcc21('0x9')](),controller['getFaxInteractions']);router[_0xcc21('0x8')](_0xcc21('0x1d'),auth['isAuthenticated'](),controller['getTeams']);router[_0xcc21('0x8')]('/:id/lists',auth[_0xcc21('0x9')](),controller[_0xcc21('0x1e')]);router[_0xcc21('0x8')](_0xcc21('0x1f'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x20')]);router['get'](_0xcc21('0x21'),auth['isAuthenticated'](),controller[_0xcc21('0x22')]);router[_0xcc21('0x8')](_0xcc21('0x23'),auth[_0xcc21('0x9')](),controller['getFaxAccounts']);router[_0xcc21('0x8')]('/:id/mail_accounts',auth[_0xcc21('0x9')](),controller[_0xcc21('0x24')]);router[_0xcc21('0x8')](_0xcc21('0x25'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x26')]);router[_0xcc21('0x8')](_0xcc21('0x27'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x28')]);router['get'](_0xcc21('0x29'),auth['isAuthenticated'](),controller[_0xcc21('0x2a')]);router[_0xcc21('0x8')](_0xcc21('0x2b'),auth['isAuthenticated'](),controller[_0xcc21('0x2c')]);router['get'](_0xcc21('0x2d'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0xcc21('0x9')](),controller['getApiKey']);router[_0xcc21('0x2e')]('/create_many',auth[_0xcc21('0x9')](),controller[_0xcc21('0x2f')]);router[_0xcc21('0x2e')]('/:id/contacts',auth[_0xcc21('0x9')](),controller[_0xcc21('0x30')]);router[_0xcc21('0x2e')]('/',auth[_0xcc21('0x9')](),controller['create']);router['post'](_0xcc21('0x10'),auth['isAuthenticated'](),controller[_0xcc21('0x31')]);var upload=multer({'storage':multer[_0xcc21('0x32')]({'destination':function(_0x132a4a,_0x590b7f,_0x46a3b8){_0x46a3b8(null,path['join'](config['root'],_0xcc21('0x33')));},'filename':function(_0x277f1e,_0x5916d4,_0x44f4e1){_0x44f4e1(null,util[_0xcc21('0x34')](_0xcc21('0x35'),Date[_0xcc21('0x36')](),_0x5916d4[_0xcc21('0x37')]));}})});router[_0xcc21('0x2e')]('/:id/avatar',upload[_0xcc21('0x38')](_0xcc21('0x39')),controller[_0xcc21('0x3a')]);router[_0xcc21('0x2e')](_0xcc21('0x3b'),auth['isAuthenticated'](),controller[_0xcc21('0x3c')]);router[_0xcc21('0x2e')](_0xcc21('0x3d'),auth['isAuthenticated'](),controller[_0xcc21('0x3e')]);router[_0xcc21('0x2e')](_0xcc21('0x3f'),auth[_0xcc21('0x9')](),controller['pause']);router['post'](_0xcc21('0x40'),auth[_0xcc21('0x9')](),controller['unpause']);router[_0xcc21('0x2e')](_0xcc21('0x1d'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x41')]);router[_0xcc21('0x2e')](_0xcc21('0x42'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x43')]);router['post'](_0xcc21('0x44'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x45')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xcc21('0x46')]);router[_0xcc21('0x2e')](_0xcc21('0x47'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x48')]);router['post'](_0xcc21('0x49'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x4a')]);router[_0xcc21('0x2e')](_0xcc21('0x23'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x4b')]);router[_0xcc21('0x2e')](_0xcc21('0x4c'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x4d')]);router[_0xcc21('0x2e')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xcc21('0x2e')](_0xcc21('0x27'),auth[_0xcc21('0x9')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0xcc21('0x9')](),controller[_0xcc21('0x4e')]);router[_0xcc21('0x2e')](_0xcc21('0x2b'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x4f')]);router[_0xcc21('0x2e')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xcc21('0x50')]);router[_0xcc21('0x51')](_0xcc21('0xd'),auth['isAuthenticated'](),controller[_0xcc21('0x52')]);router[_0xcc21('0x51')](_0xcc21('0x53'),auth[_0xcc21('0x9')](),controller['changePassword']);router[_0xcc21('0x54')](_0xcc21('0x10'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x55')]);router[_0xcc21('0x54')](_0xcc21('0x1d'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x56')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xcc21('0x42'),auth[_0xcc21('0x9')](),controller['removeChatInteractions']);router[_0xcc21('0x54')](_0xcc21('0x44'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x57')]);router[_0xcc21('0x54')](_0xcc21('0x58'),auth[_0xcc21('0x9')](),controller['removeFaxInteractions']);router[_0xcc21('0x54')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xcc21('0x59')]);router[_0xcc21('0x54')]('/:id/openchannel_interactions',auth[_0xcc21('0x9')](),controller[_0xcc21('0x5a')]);router[_0xcc21('0x54')](_0xcc21('0x23'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x5b')]);router['delete'](_0xcc21('0x4c'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x5c')]);router[_0xcc21('0x54')](_0xcc21('0x25'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x5d')]);router[_0xcc21('0x54')](_0xcc21('0x27'),auth['isAuthenticated'](),controller[_0xcc21('0x5e')]);router[_0xcc21('0x54')]('/:id/chat_websites',auth[_0xcc21('0x9')](),controller[_0xcc21('0x5f')]);router[_0xcc21('0x54')](_0xcc21('0x2b'),auth['isAuthenticated'](),controller[_0xcc21('0x60')]);router['delete']('/:id/api_key',auth[_0xcc21('0x9')](),controller[_0xcc21('0x61')]);module[_0xcc21('0x62')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7ce21c5..4695a79 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 _0x9c3a=['insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','certificate','passive','actpass','update,nonat','showWebBar','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','DATE','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','moment','util','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','internal','STRING','toLowerCase','ENUM','user','agent','local','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','yes','update','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow'];(function(_0x142f52,_0x52038d){var _0x50d2af=function(_0xa902fe){while(--_0xa902fe){_0x142f52['push'](_0x142f52['shift']());}};_0x50d2af(++_0x52038d);}(_0x9c3a,0x16d));var _0xa9c3=function(_0x3664c1,_0xa79960){_0x3664c1=_0x3664c1-0x0;var _0x4f1212=_0x9c3a[_0x3664c1];return _0x4f1212;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa9c3('0x0'));var util=require(_0xa9c3('0x1'));var _=require('lodash');module[_0xa9c3('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa9c3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1690a6){this[_0xa9c3('0x4')](_0xa9c3('0x3'),_0x1690a6);this[_0xa9c3('0x4')](_0xa9c3('0x5'),_0x1690a6);},'comment':_0xa9c3('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x27eaaf){this[_0xa9c3('0x4')](_0xa9c3('0x7'),_0x27eaaf);this['setDataValue']('callerid',util[_0xa9c3('0x8')]('\x22%s\x22\x20<%s>',_0x27eaaf,this[_0xa9c3('0x9')](_0xa9c3('0xa'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x31aef5){if(_0x31aef5){this[_0xa9c3('0x4')]('email',_0x31aef5[_0xa9c3('0xc')]());}}},'role':{'type':Sequelize[_0xa9c3('0xd')]('admin',_0xa9c3('0xe'),_0xa9c3('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa9c3('0xb')],'defaultValue':_0xa9c3('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xa9c3('0xa'),'set':function(_0xe8cb2a){this['setDataValue'](_0xa9c3('0xa'),_0xe8cb2a);this['setDataValue'](_0xa9c3('0x11'),_0xe8cb2a);this[_0xa9c3('0x4')](_0xa9c3('0x12'),util['format']('\x22%s\x22\x20<%s>',this['getDataValue'](_0xa9c3('0x7')),_0xe8cb2a));}},'salt':{'type':Sequelize[_0xa9c3('0xb')]},'phone':{'type':Sequelize[_0xa9c3('0xb')]},'mobile':{'type':Sequelize[_0xa9c3('0xb')]},'address':{'type':Sequelize[_0xa9c3('0xb')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xa9c3('0xb')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa9c3('0xb')]},'online':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa9c3('0xb')],'defaultValue':_0xa9c3('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa9c3('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9c3('0x16')},'ipaddr':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'port':{'type':Sequelize[_0xa9c3('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa9c3('0x17'),_0xa9c3('0xe'),_0xa9c3('0x18')),'allowNull':!![],'defaultValue':_0xa9c3('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9c3('0x19')},'callingpres':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x1a'),_0xa9c3('0x1b'),'ALLOWED_FAILED_SCREEN',_0xa9c3('0x1c'),'PROHIB_NOT_SCREENED',_0xa9c3('0x1d'),_0xa9c3('0x1e'),_0xa9c3('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![],'defaultValue':_0xa9c3('0x20'),'set':function(_0x5bf0a7){this[_0xa9c3('0x4')]('transport',_0x5bf0a7?_0x5bf0a7[_0xa9c3('0x21')](','):null);},'get':function(){return this[_0xa9c3('0x9')]('transport')?this['getDataValue'](_0xa9c3('0x22'))['split'](','):null;},'comment':_0xa9c3('0x23')},'dtmfmode':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x24'),'info','shortinfo','inband',_0xa9c3('0x25')),'allowNull':!![],'defaultValue':_0xa9c3('0x24')},'directmedia':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no','nonat',_0xa9c3('0x27'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3049a0){this[_0xa9c3('0x4')](_0xa9c3('0x28'),_0x3049a0?_0x3049a0[_0xa9c3('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xa9c3('0x28'))?this['getDataValue']('nat')[_0xa9c3('0x29')](','):null;},'comment':_0xa9c3('0x2a')},'callgroup':{'type':Sequelize[_0xa9c3('0xb')]},'namedcallgroup':{'type':Sequelize[_0xa9c3('0xb')]},'pickupgroup':{'type':Sequelize[_0xa9c3('0xb')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa9c3('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa9c3('0xb')]},'disallow':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1399f3){this[_0xa9c3('0x4')]('allow',_0x1399f3?_0x1399f3[_0xa9c3('0x21')](';'):_0xa9c3('0x2b'));},'get':function(){return this[_0xa9c3('0x9')](_0xa9c3('0x2c'))?this[_0xa9c3('0x9')](_0xa9c3('0x2c'))[_0xa9c3('0x29')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![],'set':function(_0x4b9da3){this[_0xa9c3('0x4')](_0xa9c3('0x2d'),_0x4b9da3?_0x4b9da3[_0xa9c3('0x21')](','):null);},'get':function(){return this[_0xa9c3('0x9')](_0xa9c3('0x2d'))?this['getDataValue'](_0xa9c3('0x2d'))[_0xa9c3('0x29')](','):null;},'comment':_0xa9c3('0x2e')},'trustrpid':{'type':Sequelize[_0xa9c3('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no',_0xa9c3('0x2f')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![],'defaultValue':_0xa9c3('0x30')},'amaflags':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa9c3('0xd')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa9c3('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xa9c3('0x31'),_0xa9c3('0x32'),_0xa9c3('0x33')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa9c3('0xd')]('uac',_0xa9c3('0x34')),'allowNull':!![],'defaultValue':_0xa9c3('0x34')},'t38pt_usertpsource':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![],'defaultValue':_0xa9c3('0x26')},'keepalive':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa9c3('0xd')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa9c3('0xd')]('yes','no',_0xa9c3('0x35'),_0xa9c3('0x36')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xa9c3('0x37'),_0xa9c3('0x38')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa9c3('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa9c3('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xa9c3('0x26'),'no','nonat',_0xa9c3('0x27'),_0xa9c3('0x39')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0,'set':function(_0x143408){this['setDataValue'](_0xa9c3('0x3a'),_0x143408);var _0x2ecd4d=this['get']({'plain':!![]});switch(_0x143408){case 0x0:case 0x1:var _0x92002e=_0x2ecd4d[_0xa9c3('0x22')]?_[_0xa9c3('0x3b')](_0x2ecd4d[_0xa9c3('0x22')])?_0x2ecd4d['transport'][_0xa9c3('0x21')]():_0x2ecd4d[_0xa9c3('0x22')]:_0xa9c3('0x20');if(_0x92002e===_0xa9c3('0x3c')){_0x92002e=_0xa9c3('0x20');}this['setDataValue'](_0xa9c3('0x22'),_0x92002e);this[_0xa9c3('0x4')](_0xa9c3('0x3d'),'no');this['setDataValue'](_0xa9c3('0x3e'),null);this[_0xa9c3('0x4')](_0xa9c3('0x3f'),null);this['setDataValue'](_0xa9c3('0x40'),null);this[_0xa9c3('0x4')](_0xa9c3('0x41'),null);this['setDataValue'](_0xa9c3('0x42'),null);this['setDataValue'](_0xa9c3('0x43'),null);this['setDataValue'](_0xa9c3('0x44'),null);this[_0xa9c3('0x4')](_0xa9c3('0x45'),null);this['setDataValue'](_0xa9c3('0x46'),'no');break;case 0x2:this[_0xa9c3('0x4')]('transport',_0xa9c3('0x3c'));this[_0xa9c3('0x4')](_0xa9c3('0x3d'),_0xa9c3('0x26'));this[_0xa9c3('0x4')](_0xa9c3('0x3e'),_0xa9c3('0x26'));this[_0xa9c3('0x4')](_0xa9c3('0x3f'),_0xa9c3('0x26'));this[_0xa9c3('0x4')](_0xa9c3('0x40'),_0xa9c3('0x26'));this[_0xa9c3('0x4')]('dtlsenable',_0xa9c3('0x26'));this[_0xa9c3('0x4')]('dtlsverify','no');this[_0xa9c3('0x4')]('dtlssetup',_0xa9c3('0x38'));this['setDataValue']('dtlscertfile',_0x2ecd4d[_0xa9c3('0x44')]||_0xa9c3('0x47'));this['setDataValue'](_0xa9c3('0x45'),_0x2ecd4d[_0xa9c3('0x45')]||_0xa9c3('0x48'));this[_0xa9c3('0x4')](_0xa9c3('0x46'),_0xa9c3('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xa9c3('0x49')],'set':function(_0xf2caa9){this[_0xa9c3('0x4')](_0xa9c3('0x4a'),_0xf2caa9?_0xf2caa9[_0xa9c3('0x21')](','):[]);},'get':function(){return this[_0xa9c3('0x9')](_0xa9c3('0x4a'))?_[_0xa9c3('0x4b')](this[_0xa9c3('0x9')](_0xa9c3('0x4a'))[_0xa9c3('0x29')](','),function(_0x36779d){return parseInt(_0x36779d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa9c3('0xb')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa9c3('0xb')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa9c3('0xb')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa9c3('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa9c3('0xd')](_0xa9c3('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa9c3('0xb')]},'passwordResetAt':{'type':Sequelize[_0xa9c3('0x4c')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa9c3('0x4d')],'get':function(){return this[_0xa9c3('0x9')](_0xa9c3('0x4e'))?this[_0xa9c3('0x9')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa9c3('0xb')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa9c3('0x13')],'defaultValue':![],'set':function(_0x21c42a){if(typeof _0x21c42a===_0xa9c3('0x4f')){var _0x28ebfe=_0x21c42a==='1'?!![]:_0x21c42a==='0'?![]:_0x21c42a==='true'?!![]:_0x21c42a===_0xa9c3('0x50')?![]:![];this[_0xa9c3('0x4')]('screenrecording',_0x28ebfe);}else{this['setDataValue'](_0xa9c3('0x51'),_0x21c42a);}}}}; \ No newline at end of file +var _0xd920=['always','accept','refuse','originate','uas','fingerprint','certificate','passive','actpass','update,nonat','showWebBar','get','isArray','encryption','avpf','force_avp','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','BOOLEAN','DATE','INTEGER','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>'];(function(_0x35e31a,_0xffa9bd){var _0x348cfe=function(_0x2ea0da){while(--_0x2ea0da){_0x35e31a['push'](_0x35e31a['shift']());}};_0x348cfe(++_0xffa9bd);}(_0xd920,0x17b));var _0x0d92=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0xd920[_0x238671];return _0x474844;};'use strict';var Sequelize=require(_0x0d92('0x0'));var moment=require('moment');var util=require(_0x0d92('0x1'));var _=require(_0x0d92('0x2'));module[_0x0d92('0x3')]={'name':{'type':Sequelize[_0x0d92('0x4')],'allowNull':![],'unique':_0x0d92('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x29f06d){this[_0x0d92('0x6')]('name',_0x29f06d);this['setDataValue'](_0x0d92('0x7'),_0x29f06d);},'comment':_0x0d92('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4b9bf9){this['setDataValue'](_0x0d92('0x9'),_0x4b9bf9);this['setDataValue'](_0x0d92('0xa'),util[_0x0d92('0xb')](_0x0d92('0xc'),_0x4b9bf9,this[_0x0d92('0xd')](_0x0d92('0xe'))));}},'alias':{'type':Sequelize[_0x0d92('0x4')]},'email':{'type':Sequelize[_0x0d92('0x4')],'allowNull':![],'unique':_0x0d92('0xf'),'validate':{'isEmail':!![]},'set':function(_0x1a7f75){if(_0x1a7f75){this[_0x0d92('0x6')](_0x0d92('0xf'),_0x1a7f75[_0x0d92('0x10')]());}}},'role':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x12'),_0x0d92('0x13'),_0x0d92('0x14'),_0x0d92('0x15')),'allowNull':![]},'password':{'type':Sequelize[_0x0d92('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0d92('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x0d92('0xe'),'set':function(_0x56cbc6){this[_0x0d92('0x6')]('internal',_0x56cbc6);this[_0x0d92('0x6')](_0x0d92('0x16'),_0x56cbc6);this[_0x0d92('0x6')]('callerid',util[_0x0d92('0xb')]('\x22%s\x22\x20<%s>',this[_0x0d92('0xd')](_0x0d92('0x9')),_0x56cbc6));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0d92('0x4')]},'address':{'type':Sequelize[_0x0d92('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x0d92('0x4')]},'city':{'type':Sequelize[_0x0d92('0x4')]},'country':{'type':Sequelize[_0x0d92('0x4')]},'online':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0d92('0x18')]},'voicePause':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0d92('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0d92('0x18')]},'chatCapacity':{'type':Sequelize[_0x0d92('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0d92('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0d92('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0d92('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x1a'),'user','peer'),'allowNull':!![],'defaultValue':_0x0d92('0x1a')},'context':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x1b'),_0x0d92('0x1c'),_0x0d92('0x1d'),_0x0d92('0x1e'),_0x0d92('0x1f'),_0x0d92('0x20'),_0x0d92('0x21'),_0x0d92('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![],'defaultValue':_0x0d92('0x23'),'set':function(_0x4d855e){this[_0x0d92('0x6')](_0x0d92('0x24'),_0x4d855e?_0x4d855e[_0x0d92('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x0d92('0x24'))?this[_0x0d92('0xd')](_0x0d92('0x24'))[_0x0d92('0x26')](','):null;},'comment':_0x0d92('0x27')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0d92('0x28'),_0x0d92('0x29'),_0x0d92('0x2a'),_0x0d92('0x2b'),_0x0d92('0x2c')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0d92('0x11')]('yes','no',_0x0d92('0x2d'),_0x0d92('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![],'defaultValue':_0x0d92('0x30'),'set':function(_0x18478e){this[_0x0d92('0x6')](_0x0d92('0x31'),_0x18478e?_0x18478e[_0x0d92('0x25')](','):null);},'get':function(){return this[_0x0d92('0xd')](_0x0d92('0x31'))?this[_0x0d92('0xd')](_0x0d92('0x31'))[_0x0d92('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0d92('0x4')]},'pickupgroup':{'type':Sequelize[_0x0d92('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0d92('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0d92('0x4')],'allowNull':![],'defaultValue':_0x0d92('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d92('0x33'),'set':function(_0x42a3ee){this[_0x0d92('0x6')](_0x0d92('0x34'),_0x42a3ee?_0x42a3ee[_0x0d92('0x25')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x0d92('0xd')](_0x0d92('0x34'))?this[_0x0d92('0xd')](_0x0d92('0x34'))[_0x0d92('0x26')](';'):null;},'comment':_0x0d92('0x35')},'autoframing':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x545b8c){this[_0x0d92('0x6')]('insecure',_0x545b8c?_0x545b8c[_0x0d92('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x0d92('0x36'))?this[_0x0d92('0xd')]('insecure')[_0x0d92('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0d92('0x11')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0d92('0x37')},'amaflags':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'allowNull':!![],'defaultValue':_0x0d92('0x2f')},'busylevel':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0d92('0x11')]('yes','no',_0x0d92('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0d92('0x39'),_0x0d92('0x3a'),_0x0d92('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0d92('0x11')]('uac','uas'),'allowNull':!![],'defaultValue':_0x0d92('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0d92('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0d92('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no',_0x0d92('0x3d'),_0x0d92('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0d92('0x11')]('active',_0x0d92('0x3f'),_0x0d92('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0d92('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0d92('0x11')](_0x0d92('0x2f'),'no',_0x0d92('0x2d'),'update',_0x0d92('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0d92('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x0d92('0x18')]},'showWebBar':{'type':Sequelize[_0x0d92('0x19')],'defaultValue':0x0,'set':function(_0x9e8dc5){this['setDataValue'](_0x0d92('0x42'),_0x9e8dc5);var _0x4e5a3f=this[_0x0d92('0x43')]({'plain':!![]});switch(_0x9e8dc5){case 0x0:case 0x1:var _0x1327cb=_0x4e5a3f[_0x0d92('0x24')]?_[_0x0d92('0x44')](_0x4e5a3f[_0x0d92('0x24')])?_0x4e5a3f[_0x0d92('0x24')][_0x0d92('0x25')]():_0x4e5a3f[_0x0d92('0x24')]:_0x0d92('0x23');if(_0x1327cb==='wss'){_0x1327cb=_0x0d92('0x23');}this[_0x0d92('0x6')](_0x0d92('0x24'),_0x1327cb);this['setDataValue'](_0x0d92('0x45'),'no');this[_0x0d92('0x6')](_0x0d92('0x46'),null);this['setDataValue'](_0x0d92('0x47'),null);this[_0x0d92('0x6')]('icesupport',null);this[_0x0d92('0x6')]('dtlsenable',null);this[_0x0d92('0x6')]('dtlsverify',null);this[_0x0d92('0x6')](_0x0d92('0x48'),null);this[_0x0d92('0x6')](_0x0d92('0x49'),null);this['setDataValue'](_0x0d92('0x4a'),null);this[_0x0d92('0x6')](_0x0d92('0x4b'),'no');break;case 0x2:this[_0x0d92('0x6')](_0x0d92('0x24'),_0x0d92('0x4c'));this[_0x0d92('0x6')](_0x0d92('0x45'),'yes');this['setDataValue'](_0x0d92('0x46'),_0x0d92('0x2f'));this[_0x0d92('0x6')](_0x0d92('0x47'),_0x0d92('0x2f'));this['setDataValue']('icesupport',_0x0d92('0x2f'));this[_0x0d92('0x6')]('dtlsenable',_0x0d92('0x2f'));this[_0x0d92('0x6')](_0x0d92('0x4d'),'no');this[_0x0d92('0x6')](_0x0d92('0x48'),_0x0d92('0x40'));this[_0x0d92('0x6')]('dtlscertfile',_0x4e5a3f[_0x0d92('0x49')]||_0x0d92('0x4e'));this[_0x0d92('0x6')](_0x0d92('0x4a'),_0x4e5a3f['dtlsprivatekey']||_0x0d92('0x4f'));this[_0x0d92('0x6')]('rtcp_mux',_0x0d92('0x2f'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf3ea56){this[_0x0d92('0x6')]('permissions',_0xf3ea56?_0xf3ea56[_0x0d92('0x25')](','):[]);},'get':function(){return this[_0x0d92('0xd')](_0x0d92('0x50'))?_[_0x0d92('0x51')](this[_0x0d92('0xd')](_0x0d92('0x50'))[_0x0d92('0x26')](','),function(_0x18ba22){return parseInt(_0x18ba22,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0d92('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0d92('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0d92('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0d92('0x11')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x0d92('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x0d92('0x52'))?this[_0x0d92('0xd')](_0x0d92('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0d92('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0d92('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0d92('0x17')],'defaultValue':![],'set':function(_0x194aac){if(typeof _0x194aac===_0x0d92('0x53')){var _0x2a7de6=_0x194aac==='1'?!![]:_0x194aac==='0'?![]:_0x194aac===_0x0d92('0x54')?!![]:_0x194aac===_0x0d92('0x55')?![]:![];this[_0x0d92('0x6')](_0x0d92('0x56'),_0x2a7de6);}else{this[_0x0d92('0x6')]('screenrecording',_0x194aac);}}}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c94b388..3cbee0a 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 _0xcbb5=['UserVoiceQueueRt','addAvatar','getAvatar','join','root','userpic','download','existsSync','server/files/images/','CmContact','order','getContacts','CmList','List','Tag','color','tag','findOne','isValidChannel','pick','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','UserId','VoiceRecording','includeAll','include','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','interface','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','MemberReport','concat','LOGININPAUSE','forEach','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','openchannelPause','lastPauseAt','mail','fax','sms','openchannel','manual','set','%s%s','Pause','Team','getTeams','addTeams','removeTeams','getLists','getVoiceQueues','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contained','$any','lastName','Contact','VoiceQueue','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','generateApiKey','apiKeyNonce','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','./user.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','destroy','get','Users','Agents','agent','telephone','map','value','includes','role','find','name','stack','index','User','rawAttributes','model','password','salt','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','sequelize','lower','col','field','options','findAll','rows','show','params','length','bulkCreate','body','update','describe','addContacts','ids','omit','agent\x20role','admin','user','getLicense','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','fullname','permissions','102','103','110','104','105','106','107','108','100','111','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','autoAssociation','UserProfileResource','changePassword','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','voicePause','Unknown\x20channel','add','toLowerCase','penalty','spread','capitalize','QueueId','emit','voice','push','SIP/%s','each','upsert','removeQueues','Queues','Queue:remove'];(function(_0x411061,_0x24a185){var _0x4ed903=function(_0x24f5d7){while(--_0x24f5d7){_0x411061['push'](_0x411061['shift']());}};_0x4ed903(++_0x24a185);}(_0xcbb5,0xa1));var _0x5cbb=function(_0x4f9e30,_0x44afe2){_0x4f9e30=_0x4f9e30-0x0;var _0x2aa6a9=_0xcbb5[_0x4f9e30];return _0x2aa6a9;};'use strict';var pdf=require(_0x5cbb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5cbb('0x1'));var zipdir=require(_0x5cbb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cbb('0x3'));var moment=require(_0x5cbb('0x4'));var BPromise=require(_0x5cbb('0x5'));var Mustache=require(_0x5cbb('0x6'));var util=require(_0x5cbb('0x7'));var path=require(_0x5cbb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5cbb('0x9'));var jsforce=require(_0x5cbb('0xa'));var deskjs=require(_0x5cbb('0xb'));var toCsv=require(_0x5cbb('0xc'));var querystring=require(_0x5cbb('0xd'));var Papa=require('papaparse');var Redis=require(_0x5cbb('0xe'));var authService=require(_0x5cbb('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5cbb('0x10'));var logger=require(_0x5cbb('0x11'))('api');var utils=require(_0x5cbb('0x12'));var config=require(_0x5cbb('0x13'));var db=require('../../mysqldb')['db'];config[_0x5cbb('0x14')]=_[_0x5cbb('0x15')](config[_0x5cbb('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5cbb('0x14')]));require(_0x5cbb('0x16'))[_0x5cbb('0x17')](socket);var jayson=require(_0x5cbb('0x18'));var client=jayson[_0x5cbb('0x19')][_0x5cbb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x121aa9,_0x12b82b,_0x3341d8){if(_0x3341d8){var _0x350cf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x350cf5[_0x5cbb('0x1b')](_0x12b82b)){return _0x121aa9;}else{throw new Error(_0x5cbb('0x1c'));}}else{return _0x121aa9;}}function respondWithRpcPromise(_0x45d168,_0x222255,_0x446a4c,_0x5e5a59){return new BPromise(function(_0x5ef917,_0x4f785d){var _0x21a23f=_0x5e5a59||client;return _0x21a23f[_0x5cbb('0x1d')](_0x45d168,_0x446a4c)[_0x5cbb('0x1e')](function(_0x412543){logger[_0x5cbb('0x1f')](_0x5cbb('0x20'),_0x222255,'request\x20sent');logger[_0x5cbb('0x21')](_0x5cbb('0x22'),_0x222255,_0x5cbb('0x23'),JSON[_0x5cbb('0x24')](_0x412543));if(_0x412543[_0x5cbb('0x25')]){if(_0x412543[_0x5cbb('0x25')][_0x5cbb('0x26')]===0x1f4){logger['error'](_0x5cbb('0x20'),_0x222255,_0x412543[_0x5cbb('0x25')][_0x5cbb('0x27')]);return _0x4f785d(_0x412543['error'][_0x5cbb('0x27')]);}logger[_0x5cbb('0x25')](_0x5cbb('0x20'),_0x222255,_0x412543[_0x5cbb('0x25')]['message']);return _0x5ef917(_0x412543[_0x5cbb('0x25')]['message']);}else{logger['info'](_0x5cbb('0x20'),_0x222255,'request\x20sent');_0x5ef917(_0x412543[_0x5cbb('0x28')]['message']);}})[_0x5cbb('0x29')](function(_0x122ee9){logger[_0x5cbb('0x25')](_0x5cbb('0x20'),_0x222255,_0x122ee9);_0x4f785d(_0x122ee9);});});}function respondWithStatusCode(_0x36f8f8,_0x4ca99d){_0x4ca99d=_0x4ca99d||0xcc;return function(_0x50a69b){if(_0x50a69b){return _0x36f8f8[_0x5cbb('0x2a')](_0x4ca99d);}return _0x36f8f8[_0x5cbb('0x2b')](_0x4ca99d)[_0x5cbb('0x2c')]();};}function respondWithResult(_0x24d408,_0x197e0a){_0x197e0a=_0x197e0a||0xc8;return function(_0x3d710e){if(_0x3d710e){return _0x24d408[_0x5cbb('0x2b')](_0x197e0a)['json'](_0x3d710e);}};}function respondWithFilteredResult(_0x591ab1,_0x3fc9f5){return function(_0x1bed06){if(_0x1bed06){var _0x2aaa2a=_0x1bed06[_0x5cbb('0x2d')],_0x41e26d=_0x3fc9f5[_0x5cbb('0x2e')],_0x4f8dee=_0x3fc9f5[_0x5cbb('0x2e')]+_0x3fc9f5[_0x5cbb('0x2f')],_0x13f48a;if(_0x4f8dee>=_0x2aaa2a){_0x4f8dee=_0x2aaa2a;_0x13f48a=0xc8;}else{_0x13f48a=0xce;}_0x591ab1['status'](_0x13f48a);return _0x591ab1['set'](_0x5cbb('0x30'),_0x41e26d+'-'+_0x4f8dee+'/'+_0x2aaa2a)[_0x5cbb('0x31')](_0x1bed06);}return null;};}function patchUpdates(_0x345d3a){return function(_0x5efbfd){try{jsonpatch[_0x5cbb('0x32')](_0x5efbfd,_0x345d3a,!![]);}catch(_0x5d41e1){return BPromise[_0x5cbb('0x33')](_0x5d41e1);}return _0x5efbfd[_0x5cbb('0x34')]();};}function saveUpdates(_0x1e6c66,_0x4c0028){return function(_0x7238d6){if(_0x7238d6){return _0x7238d6['update'](_0x1e6c66)[_0x5cbb('0x1e')](function(_0x3dc7a9){return _0x3dc7a9;});}return null;};}function removeEntity(_0x46de2e,_0x209d32){return function(_0x2f0117){if(_0x2f0117){return _0x2f0117[_0x5cbb('0x35')]()[_0x5cbb('0x1e')](function(){var _0x256d55=_0x2f0117[_0x5cbb('0x36')]({'plain':!![]});var _0x2cbbc3=[{'name':_0x5cbb('0x37'),'value':'user','ignore':!![]},{'name':_0x5cbb('0x38'),'value':_0x5cbb('0x39'),'ignore':![]},{'name':'Telephones','value':_0x5cbb('0x3a'),'ignore':![]}];var _0x3dcfa3=_(_0x2cbbc3)['filter']('ignore')[_0x5cbb('0x3b')](_0x5cbb('0x3c'))[_0x5cbb('0x3c')]();if(_[_0x5cbb('0x3d')](_0x3dcfa3,_0x256d55[_0x5cbb('0x3e')])){return;}var _0x5d562f=_[_0x5cbb('0x3f')](_0x2cbbc3,[_0x5cbb('0x3c'),_0x256d55[_0x5cbb('0x3e')]])[_0x5cbb('0x40')];return db['UserProfileResource'][_0x5cbb('0x35')]({'where':{'type':_0x5d562f,'resourceId':_0x256d55['id']}})['then'](function(){return _0x2f0117;});})[_0x5cbb('0x1e')](function(){_0x46de2e['status'](0xcc)[_0x5cbb('0x2c')]();});}};}function handleEntityNotFound(_0xa48e49,_0x3eee1d){return function(_0x2a1c7f){if(!_0x2a1c7f){_0xa48e49[_0x5cbb('0x2a')](0x194);}return _0x2a1c7f;};}function handleError(_0x1a1bb5,_0x44137e){_0x44137e=_0x44137e||0x1f4;return function(_0x41b1f1){logger[_0x5cbb('0x25')](_0x41b1f1[_0x5cbb('0x41')]);if(_0x41b1f1['name']){delete _0x41b1f1[_0x5cbb('0x40')];}_0x1a1bb5[_0x5cbb('0x2b')](_0x44137e)['send'](_0x41b1f1);};}exports[_0x5cbb('0x42')]=function(_0x4f5d57,_0x371f9a){var _0x4e5948={},_0x1eafad={},_0x167462={'count':0x0,'rows':[]};var _0x9e2176=db[_0x5cbb('0x43')][_0x5cbb('0x44')];_0x1eafad[_0x5cbb('0x45')]=_['differenceBy'](_['keys'](_0x9e2176),[_0x5cbb('0x46'),_0x5cbb('0x47')]);_0x1eafad['query']=_[_0x5cbb('0x48')](_0x4f5d57['query']);_0x1eafad[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x1eafad['model'],_0x1eafad[_0x5cbb('0x4b')]);_0x4e5948[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x1eafad['model'],qs[_0x5cbb('0x4d')](_0x4f5d57['query']['fields']));_0x4e5948[_0x5cbb('0x4c')]=_0x4e5948['attributes']['length']?_0x4e5948[_0x5cbb('0x4c')]:_0x1eafad[_0x5cbb('0x45')];if(!_0x4f5d57[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x4e5948['limit']=qs[_0x5cbb('0x2f')](_0x4f5d57[_0x5cbb('0x4b')]['limit']);_0x4e5948['offset']=qs['offset'](_0x4f5d57[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}_0x4e5948['order']=qs[_0x5cbb('0x50')](_0x4f5d57['query'][_0x5cbb('0x50')]);_0x4e5948[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_['pick'](_0x4f5d57[_0x5cbb('0x4b')],_0x1eafad[_0x5cbb('0x49')]));if(_0x4f5d57[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x4e5948[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x4e5948[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0x9e2176,function(_0x1fbd9b){return db[_0x5cbb('0x54')][_0x5cbb('0x51')](db[_0x5cbb('0x54')]['fn'](_0x5cbb('0x55'),db[_0x5cbb('0x54')][_0x5cbb('0x56')](_0x1fbd9b[_0x5cbb('0x57')])),{'$like':db[_0x5cbb('0x54')]['fn'](_0x5cbb('0x55'),'%'+_0x4f5d57['query'][_0x5cbb('0x52')]+'%')});})});}_0x4e5948=_[_0x5cbb('0x53')]({},_0x4e5948,_0x4f5d57[_0x5cbb('0x58')]);var _0x488a69={'where':_0x4e5948['where']};return db['User'][_0x5cbb('0x2d')](_0x488a69)[_0x5cbb('0x1e')](function(_0x171a0c){_0x167462[_0x5cbb('0x2d')]=_0x171a0c;if(_0x4f5d57[_0x5cbb('0x4b')]['includeAll']){_0x4e5948['include']=[{'all':!![]}];}return db[_0x5cbb('0x43')][_0x5cbb('0x59')](_0x4e5948);})[_0x5cbb('0x1e')](function(_0x989505){_0x167462[_0x5cbb('0x5a')]=_0x989505;return _0x167462;})[_0x5cbb('0x1e')](respondWithFilteredResult(_0x371f9a,_0x4e5948))[_0x5cbb('0x29')](handleError(_0x371f9a,null));};exports[_0x5cbb('0x5b')]=function(_0x2e57d8,_0x1035d2){var _0x34e00b={'raw':![],'where':{'id':_0x2e57d8[_0x5cbb('0x5c')]['id']}},_0x5dc620={};_0x5dc620['model']=_['differenceBy'](_[_0x5cbb('0x48')](db[_0x5cbb('0x43')][_0x5cbb('0x44')]),['password',_0x5cbb('0x47')]);_0x5dc620['query']=_[_0x5cbb('0x48')](_0x2e57d8['query']);_0x5dc620[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x5dc620['model'],_0x5dc620['query']);_0x34e00b[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x5dc620[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x2e57d8['query']['fields']));_0x34e00b['attributes']=_0x34e00b[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x34e00b[_0x5cbb('0x4c')]:_0x5dc620[_0x5cbb('0x45')];if(_0x2e57d8['query']['includeAll']){_0x34e00b['include']=[{'all':!![]}];}_0x34e00b=_[_0x5cbb('0x53')]({},_0x34e00b,_0x2e57d8[_0x5cbb('0x58')]);return db['User'][_0x5cbb('0x3f')](_0x34e00b)[_0x5cbb('0x1e')](handleEntityNotFound(_0x1035d2,null))['then'](respondWithResult(_0x1035d2,null))[_0x5cbb('0x29')](handleError(_0x1035d2,null));};exports[_0x5cbb('0x5e')]=function(_0x411585,_0x3e895b){return db['User']['bulkCreate'](_0x411585[_0x5cbb('0x5f')],{'raw':![],'individualHooks':!![]})[_0x5cbb('0x1e')](respondWithResult(_0x3e895b,0xc9))[_0x5cbb('0x29')](handleError(_0x3e895b,null));};exports[_0x5cbb('0x60')]=function(_0x42030d,_0x1ded83){if(_0x42030d[_0x5cbb('0x5f')]['id']){delete _0x42030d[_0x5cbb('0x5f')]['id'];}delete _0x42030d['body'][_0x5cbb('0x3e')];return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x42030d[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x1ded83,null))[_0x5cbb('0x1e')](saveUpdates(_0x42030d[_0x5cbb('0x5f')],null))[_0x5cbb('0x1e')](respondWithResult(_0x1ded83,null))['catch'](handleError(_0x1ded83,null));};exports[_0x5cbb('0x61')]=function(_0x27bed6,_0x4f58ad){return db[_0x5cbb('0x43')]['describe']()['then'](respondWithResult(_0x4f58ad,null))[_0x5cbb('0x29')](handleError(_0x4f58ad,null));};exports[_0x5cbb('0x62')]=function(_0x326563,_0x54d48d,_0x2eda8f){return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x326563[_0x5cbb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x54d48d,null))[_0x5cbb('0x1e')](function(_0x1b0c62){if(_0x1b0c62){return _0x1b0c62[_0x5cbb('0x62')](_0x326563['body'][_0x5cbb('0x63')],_[_0x5cbb('0x64')](_0x326563[_0x5cbb('0x5f')],['ids','id'])||{});}})[_0x5cbb('0x1e')](respondWithResult(_0x54d48d,null))[_0x5cbb('0x29')](handleError(_0x54d48d,null));};var getLicense=function(_0x3e1252){return new BPromise(function(_0x27735b,_0x58df50){var _0x28f4e0=0x0;_0x3e1252[_0x5cbb('0x5f')]['role']==='agent'&&_0x27735b(_0x5cbb('0x65'));return db['User']['count']({'where':{'$or':[{'role':_0x3e1252['body'][_0x5cbb('0x3e')]===_0x5cbb('0x3a')?'telephone':[_0x5cbb('0x66'),_0x5cbb('0x67')]}]}})['then'](function(_0x76626e){_0x28f4e0=_0x76626e;return require('../../config/license/util')[_0x5cbb('0x68')]();})['then'](function(_0x1bc2ab){var _0x370142=_0x3e1252['body'][_0x5cbb('0x3e')]===_0x5cbb('0x3a')?'telephones':_0x5cbb('0x69');if(!_[_0x5cbb('0x6a')](_0x1bc2ab[_0x370142])&&_0x28f4e0>=_0x1bc2ab[_0x370142]){return _0x58df50({'message':_0x5cbb('0x6b')});}return _0x27735b(util[_0x5cbb('0x6c')](_0x5cbb('0x6d'),_0x370142,_0x28f4e0));})[_0x5cbb('0x29')](function(_0x4827e6){return _0x58df50(_0x4827e6);});});};exports[_0x5cbb('0x6e')]=function(_0x33c2e3,_0x9eafdf){return getLicense(_0x33c2e3)['then'](function(_0x555a55){if(!_0x33c2e3['body'][_0x5cbb('0x6f')]){var _0x4769ee;return db[_0x5cbb('0x70')][_0x5cbb('0x71')](0x1)[_0x5cbb('0x1e')](function(_0x2d5ffc){_0x2d5ffc[_0x5cbb('0x72')]=!![];return checkPasswordPattern(_0x2d5ffc,_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x46')],_0x2d5ffc['securePassword']);})[_0x5cbb('0x1e')](function(_0x123339){_0x4769ee=_0x123339[_0x5cbb('0x73')];return db[_0x5cbb('0x43')][_0x5cbb('0x74')](_0x5cbb('0x6f'));})[_0x5cbb('0x1e')](function(_0x4f60dd){if(_[_0x5cbb('0x6a')](_0x4f60dd)){if(_0x4769ee){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]=_0x4769ee;}else{_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]=0x1;}}else{if(_[_0x5cbb('0x6a')](_0x4769ee)||_0x4769ee==_0x4f60dd){_0x33c2e3['body'][_0x5cbb('0x6f')]=_0x4f60dd+0x1;}else if(_0x4769ee>_0x4f60dd){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]=_0x4769ee;}else{return db[_0x5cbb('0x54')][_0x5cbb('0x4b')](_0x5cbb('0x75'),{'type':db[_0x5cbb('0x54')][_0x5cbb('0x76')][_0x5cbb('0x77')]})['then'](function(_0x3d02e9){if(_0x3d02e9&&_0x3d02e9[_0x5cbb('0x5d')]){for(var _0x4e8e3f=0x0,_0x31b7b3=_0x3d02e9[_0x5cbb('0x5d')];_0x4e8e3f<_0x31b7b3&&_[_0x5cbb('0x6a')](_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]);_0x4e8e3f++){if(_0x4769ee<=_0x3d02e9[_0x4e8e3f][_0x5cbb('0x78')]){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]=_0x3d02e9[_0x4e8e3f][_0x5cbb('0x78')];}else if(_0x4769ee>_0x3d02e9[_0x4e8e3f]['from']&&_0x4769ee<=_0x3d02e9[_0x4e8e3f]['to']){_0x33c2e3[_0x5cbb('0x5f')]['internal']=_0x4769ee;}}}if(_[_0x5cbb('0x6a')](_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')])){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')]=_0x4f60dd+0x1;}});}}});}})['then'](function(){if(_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x79')]){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x7a')]=_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')];_0x33c2e3[_0x5cbb('0x5f')]['VoiceMail']={'mailbox':_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x6f')],'password':_0x33c2e3[_0x5cbb('0x5f')]['password'],'fullname':_0x33c2e3['body'][_0x5cbb('0x7b')],'email':_0x33c2e3[_0x5cbb('0x5f')]['email']};}if(_0x33c2e3[_0x5cbb('0x5f')]&&_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x3e')]===_0x5cbb('0x39')){_0x33c2e3[_0x5cbb('0x5f')][_0x5cbb('0x7c')]=['101',_0x5cbb('0x7d'),_0x5cbb('0x7e'),_0x5cbb('0x7f'),_0x5cbb('0x80'),_0x5cbb('0x81'),_0x5cbb('0x82'),_0x5cbb('0x83'),_0x5cbb('0x84'),'109',_0x5cbb('0x85'),_0x5cbb('0x86')];}return db[_0x5cbb('0x43')][_0x5cbb('0x6e')](_0x33c2e3[_0x5cbb('0x5f')],{'include':[{'model':db[_0x5cbb('0x87')],'as':'VoiceMail'}]});})['then'](function(_0x2dae46){if(_0x33c2e3['body'][_0x5cbb('0x3e')]===_0x5cbb('0x67'))return _0x2dae46;var _0x342f09=_0x33c2e3[_0x5cbb('0x67')][_0x5cbb('0x36')]({'plain':!![]});if(!_0x342f09)throw new Error(_0x5cbb('0x88'));if(_0x342f09[_0x5cbb('0x3e')]===_0x5cbb('0x67')){var _0x475059=_0x2dae46[_0x5cbb('0x36')]({'plain':!![]});var _0x225f0d=[{'name':_0x5cbb('0x38'),'value':_0x5cbb('0x39')},{'name':_0x5cbb('0x89'),'value':_0x5cbb('0x3a')}];var _0x4aff4e=_[_0x5cbb('0x3f')](_0x225f0d,['value',_0x475059[_0x5cbb('0x3e')]])[_0x5cbb('0x40')];return db['UserProfileSection'][_0x5cbb('0x3f')]({'where':{'name':_0x4aff4e,'userProfileId':_0x342f09['userProfileId']},'raw':!![]})['then'](function(_0x57543e){if(_0x57543e&&_0x57543e[_0x5cbb('0x8a')]===0x0){return db[_0x5cbb('0x8b')][_0x5cbb('0x6e')]({'name':_0x475059['name'],'resourceId':_0x475059['id'],'type':_0x57543e[_0x5cbb('0x40')],'sectionId':_0x57543e['id']},{})[_0x5cbb('0x1e')](function(){return _0x2dae46;});}else{return _0x2dae46;}})[_0x5cbb('0x29')](function(_0x3501c0){logger[_0x5cbb('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3501c0);throw _0x3501c0;});}return _0x2dae46;})['then'](respondWithResult(_0x9eafdf,0xc9))[_0x5cbb('0x29')](handleError(_0x9eafdf,null));};exports[_0x5cbb('0x8c')]=function(_0x2d222b,_0x13143b,_0x4aed73){var _0x414449=![];if(_0x2d222b[_0x5cbb('0x5f')]['id']){delete _0x2d222b[_0x5cbb('0x5f')]['id'];}if(!_[_0x5cbb('0x6a')](_0x2d222b['body'][_0x5cbb('0x8d')])){if(_0x2d222b[_0x5cbb('0x5f')][_0x5cbb('0x8d')]===_0x2d222b[_0x5cbb('0x5f')][_0x5cbb('0x8e')]){throw new Error(_0x5cbb('0x8f'));}}return db['User']['find']({'where':{'id':_0x2d222b[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](function(_0x4d47bd){if(_0x4d47bd){if(_0x4d47bd['id']==_0x2d222b['user']['id']){if(!_0x2d222b['body'][_0x5cbb('0x8d')]||!_0x2d222b[_0x5cbb('0x5f')]['newPassword']){throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))](_0x5cbb('0x92'));}if(!_0x4d47bd[_0x5cbb('0x93')](_0x2d222b[_0x5cbb('0x5f')][_0x5cbb('0x8d')])){throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))](_0x5cbb('0x94'));}if(_0x2d222b['body'][_0x5cbb('0x8d')]==_0x2d222b[_0x5cbb('0x5f')]['newPassword']){throw new db[(_0x5cbb('0x90'))]['ValidationError'](_0x5cbb('0x95'));}return _0x4d47bd;}else if(_0x2d222b[_0x5cbb('0x67')]['role']==_0x5cbb('0x66')){if(!_0x2d222b[_0x5cbb('0x5f')][_0x5cbb('0x8e')]){throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x4d47bd;}else if(_0x2d222b['user']['role']==_0x5cbb('0x67')){if(!_0x2d222b['body'][_0x5cbb('0x8e')]){throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))](_0x5cbb('0x96'));}if(_0x4d47bd[_0x5cbb('0x3e')]!=_0x5cbb('0x39')){throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))]('Unauthorized');}return _0x4d47bd;}else{throw new db[(_0x5cbb('0x90'))][(_0x5cbb('0x91'))](_0x5cbb('0x97'));}}return null;})[_0x5cbb('0x1e')](handleEntityNotFound(_0x13143b,null))['then'](function(_0x3d8042){return db['Setting']['findOne']({'attributes':['id',_0x5cbb('0x72')]})[_0x5cbb('0x1e')](function(_0x270c5f){_0x414449=_0x270c5f[_0x5cbb('0x72')];return checkPasswordPattern(_0x3d8042,_0x2d222b[_0x5cbb('0x5f')][_0x5cbb('0x8e')],_0x414449);});})[_0x5cbb('0x1e')](saveUpdates({'password':_0x2d222b['body'][_0x5cbb('0x8e')],'passwordResetAt':_0x2d222b['user']['id']==_0x2d222b[_0x5cbb('0x5c')]['id']?moment():null},null))[_0x5cbb('0x1e')](respondWithResult(_0x13143b,null))[_0x5cbb('0x29')](handleError(_0x13143b,null));};exports[_0x5cbb('0x98')]=function(_0x47a42a,_0x1a8f8e,_0x25b3ec){var _0x4cbd8b=_0x47a42a[_0x5cbb('0x5f')][_0x5cbb('0x99')];return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x47a42a[_0x5cbb('0x5c')]['id']},'attributes':['id',_0x5cbb('0x40'),_0x5cbb('0x3e'),_0x5cbb('0x9a'),_0x5cbb('0x9b'),_0x5cbb('0x9c'),'interface']})[_0x5cbb('0x1e')](handleEntityNotFound(_0x1a8f8e,null))[_0x5cbb('0x1e')](function(_0x27ee21){if(_0x27ee21){if(!utils['isValidChannel'](_0x4cbd8b)){throw new db[(_0x5cbb('0x90'))]['ValidationError'](_0x5cbb('0x9d'));}return _0x27ee21[_0x5cbb('0x9e')+_['capitalize'](_0x4cbd8b[_0x5cbb('0x9f')]())+'Queues'](_0x47a42a[_0x5cbb('0x5f')][_0x5cbb('0x63')],{'penalty':_0x47a42a[_0x5cbb('0x5f')][_0x5cbb('0xa0')]||0x0})[_0x5cbb('0xa1')](function(_0x3ec2f9){for(var _0x1e83e9=0x0;_0x1e83e9<_0x47a42a[_0x5cbb('0x5f')]['ids'][_0x5cbb('0x5d')];_0x1e83e9+=0x1){var _0x37d26c={'UserId':_0x47a42a[_0x5cbb('0x5c')]['id']};_0x37d26c[_[_0x5cbb('0xa2')](_0x4cbd8b[_0x5cbb('0x9f')]())+_0x5cbb('0xa3')]=_0x47a42a['body'][_0x5cbb('0x63')][_0x1e83e9];socket[_0x5cbb('0xa4')]('user'+_[_0x5cbb('0xa2')](_0x4cbd8b[_0x5cbb('0x9f')]())+'Queue:save',_0x37d26c);}return _0x3ec2f9;})['then'](function(){if(_0x4cbd8b===_0x5cbb('0xa5')){return db['VoiceQueue']['findAll']({'where':{'id':_0x47a42a[_0x5cbb('0x5f')]['ids']||[]},'raw':!![],'attributes':['id',_0x5cbb('0x40')]});}})['then'](function(_0x322010){var _0x3bea3d=_0x27ee21[_0x5cbb('0x36')]({'plain':!![]});var _0x1899ec=[];if(_0x4cbd8b===_0x5cbb('0xa5')&&_0x3bea3d[_0x5cbb('0x3e')]===_0x5cbb('0x39')&&_0x3bea3d[_0x5cbb('0x9a')]){for(var _0x5add2d=0x0;_0x5add2d<_0x322010[_0x5cbb('0x5d')];_0x5add2d+=0x1){_0x1899ec[_0x5cbb('0xa6')]({'membername':_0x3bea3d['name'],'UserId':_0x3bea3d['id'],'queue_name':_0x322010[_0x5add2d]['name'],'VoiceQueueId':_0x322010[_0x5add2d]['id'],'interface':_[_0x5cbb('0x6a')](_0x3bea3d['interface'])?util[_0x5cbb('0x6c')](_0x5cbb('0xa7'),_0x3bea3d[_0x5cbb('0x40')]):_0x3bea3d['interface'],'paused':_0x3bea3d[_0x5cbb('0x9c')]||![],'penalty':_0x47a42a[_0x5cbb('0x5f')]['penalty']||0x0});}return BPromise[_0x5cbb('0xa8')](_0x1899ec,function(_0x2a0fc5){return db['UserVoiceQueueRt'][_0x5cbb('0xa9')](_0x2a0fc5);});}return _0x27ee21;});}})['then'](respondWithStatusCode(_0x1a8f8e,null))[_0x5cbb('0x29')](handleError(_0x1a8f8e,null));};exports[_0x5cbb('0xaa')]=function(_0x55dfbc,_0x69675c,_0x1211b0){var _0x4148d3;return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x55dfbc[_0x5cbb('0x5c')]['id']},'attributes':['id',_0x5cbb('0x40'),_0x5cbb('0x3e')]})[_0x5cbb('0x1e')](handleEntityNotFound(_0x69675c,null))[_0x5cbb('0x1e')](function(_0x107dee){if(_0x107dee){_0x4148d3=_0x107dee;if(!_0x55dfbc[_0x5cbb('0x4b')]['channel']||!utils['isValidChannel'](_0x55dfbc[_0x5cbb('0x4b')][_0x5cbb('0x99')])){throw new db['Sequelize']['ValidationError'](_0x5cbb('0x9d'));}return _0x107dee['remove'+_[_0x5cbb('0xa2')](_0x55dfbc['query']['channel'][_0x5cbb('0x9f')]())+_0x5cbb('0xab')](_0x55dfbc['query']['ids']);}})[_0x5cbb('0x1e')](function(_0x13d4cf){for(var _0xe61381=0x0;_0xe61381<_0x55dfbc['query']['ids']['length'];_0xe61381+=0x1){var _0x5411ad={'UserId':_0x55dfbc['params']['id']};_0x5411ad[_[_0x5cbb('0xa2')](_0x55dfbc[_0x5cbb('0x4b')][_0x5cbb('0x99')][_0x5cbb('0x9f')]())+'QueueId']=_0x55dfbc['query'][_0x5cbb('0x63')][_0xe61381];socket[_0x5cbb('0xa4')]('user'+_[_0x5cbb('0xa2')](_0x55dfbc['query']['channel'][_0x5cbb('0x9f')]())+_0x5cbb('0xac'),_0x5411ad);}return _0x13d4cf;})['then'](function(){if(_0x55dfbc['query']['channel']===_0x5cbb('0xa5')){return db[_0x5cbb('0xad')][_0x5cbb('0x35')]({'where':{'UserId':_0x55dfbc[_0x5cbb('0x5c')]['id'],'VoiceQueueId':_0x55dfbc[_0x5cbb('0x4b')]['ids']},'individualHooks':!![]})['then'](function(){return _0x4148d3;});}return _0x4148d3;})[_0x5cbb('0x1e')](respondWithStatusCode(_0x69675c,null))[_0x5cbb('0x29')](handleError(_0x69675c,null));};exports[_0x5cbb('0xae')]=function(_0x39fb65,_0x49f391,_0x290807){_0x39fb65['body']['userpic']=_0x39fb65['file']['filename'];return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x39fb65['params']['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x49f391,null))[_0x5cbb('0x1e')](saveUpdates(_0x39fb65[_0x5cbb('0x5f')],null))[_0x5cbb('0x1e')](respondWithResult(_0x49f391,null))[_0x5cbb('0x29')](handleError(_0x49f391,null));};exports[_0x5cbb('0xaf')]=function(_0x2b4fd6,_0x2e0372,_0x2d32da){var _0x28cf4c=path[_0x5cbb('0xb0')](config[_0x5cbb('0xb1')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x2b4fd6['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5cbb('0x1e')](handleEntityNotFound(_0x2e0372,null))['then'](function(_0x5f93e4){if(_0x5f93e4){if(_[_0x5cbb('0x6a')](_0x5f93e4[_0x5cbb('0xb2')])){return _0x2e0372[_0x5cbb('0xb3')](_0x28cf4c);}else{if(!fs[_0x5cbb('0xb4')](path['join'](config[_0x5cbb('0xb1')],_0x5cbb('0xb5'),_0x5f93e4[_0x5cbb('0xb2')]))){return _0x2e0372[_0x5cbb('0xb3')](_0x28cf4c);}return _0x2e0372[_0x5cbb('0xb3')](path[_0x5cbb('0xb0')](config[_0x5cbb('0xb1')],_0x5cbb('0xb5'),_0x5f93e4[_0x5cbb('0xb2')]));}}})[_0x5cbb('0x29')](handleError(_0x2e0372,null));};exports['getContacts']=function(_0x3bd711,_0x5e7318,_0x502dcd){var _0x345dfc={};var _0x33ce78={};var _0x3142cb;var _0xd6a5f7;return db['User']['findOne']({'where':{'id':_0x3bd711[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x5e7318,null))['then'](function(_0x318131){if(_0x318131){_0x3142cb=_0x318131;_0x33ce78[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0xb6')][_0x5cbb('0x44')]);_0x33ce78[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x3bd711['query']);_0x33ce78[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x33ce78[_0x5cbb('0x45')],_0x33ce78[_0x5cbb('0x4b')]);_0x345dfc[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x33ce78[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x345dfc[_0x5cbb('0x4c')]=_0x345dfc['attributes'][_0x5cbb('0x5d')]?_0x345dfc[_0x5cbb('0x4c')]:_0x33ce78[_0x5cbb('0x45')];_0x345dfc[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x3bd711[_0x5cbb('0x4b')]['sort']);_0x345dfc[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_['pick'](_0x3bd711[_0x5cbb('0x4b')],_0x33ce78[_0x5cbb('0x49')]));if(_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x345dfc[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x345dfc['where'],{'$or':_[_0x5cbb('0x3b')](_0x345dfc[_0x5cbb('0x4c')],function(_0x51488e){var _0xf89c68={};_0xf89c68[_0x51488e]={'$like':'%'+_0x3bd711['query'][_0x5cbb('0x52')]+'%'};return _0xf89c68;})});}_0x345dfc=_['merge']({},_0x345dfc,_0x3bd711[_0x5cbb('0x58')]);return _0x3142cb[_0x5cbb('0xb8')](_0x345dfc);}})[_0x5cbb('0x1e')](function(_0x2aaba9){if(_0x2aaba9){_0xd6a5f7=_0x2aaba9[_0x5cbb('0x5d')];if(_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0x4e')]('includeAll')){_0x345dfc['include']=[{'model':db[_0x5cbb('0xb9')],'as':_0x5cbb('0xba'),'required':![]},{'model':db[_0x5cbb('0xbb')],'as':'Tags','attributes':['id','name',_0x5cbb('0xbc')],'where':_0x3bd711['query'][_0x5cbb('0xbd')]?{'id':_0x3bd711[_0x5cbb('0x4b')]['tag']}:undefined,'required':_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0xbd')]?!![]:![]}];}if(!_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x345dfc[_0x5cbb('0x2f')]=qs['limit'](_0x3bd711[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x345dfc[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x3bd711['query']['offset']);}return _0x3142cb[_0x5cbb('0xb8')](_0x345dfc);}})[_0x5cbb('0x1e')](function(_0x5ec0c1){if(_0x5ec0c1){return _0x5ec0c1?{'count':_0xd6a5f7,'rows':_0x5ec0c1}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0x5e7318,null))[_0x5cbb('0x29')](handleError(_0x5e7318,null));};exports['getQueues']=function(_0x9f8879,_0x52b98e,_0xb7669){var _0x171be1;var _0x54f65b;var _0x32b718={};var _0x4f5811;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x9f8879['params']['id']},'attributes':['id',_0x5cbb('0x40'),'role']})[_0x5cbb('0x1e')](handleEntityNotFound(_0x52b98e,null))['then'](function(_0x268565){if(!utils[_0x5cbb('0xbf')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x99')])){throw new db[(_0x5cbb('0x90'))]['ValidationError']('Unknown\x20channel');}_0x171be1=_0x268565;var _0x5af92d={};_0x5af92d['model']=_[_0x5cbb('0x48')](db[_[_0x5cbb('0xa2')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x99')])+'Queue'][_0x5cbb('0x44')]);_0x5af92d[_0x5cbb('0x4b')]=_['keys'](_0x9f8879[_0x5cbb('0x4b')]);_0x5af92d['filters']=_[_0x5cbb('0x4a')](_0x5af92d[_0x5cbb('0x45')],_0x5af92d[_0x5cbb('0x4b')]);_0x32b718[_0x5cbb('0x4c')]=_['intersection'](_0x5af92d[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x32b718[_0x5cbb('0x4c')]=_0x32b718[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x32b718[_0x5cbb('0x4c')]:_0x5af92d[_0x5cbb('0x45')];_0x32b718[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x9f8879[_0x5cbb('0x4b')]['sort']);_0x32b718['where']=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x9f8879[_0x5cbb('0x4b')],_0x5af92d[_0x5cbb('0x49')]));if(_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x32b718['where']=_['merge'](_0x32b718[_0x5cbb('0x51')],{'$or':_['map'](_0x32b718['attributes'],function(_0x20eff2){var _0x1f4915={};_0x1f4915[_0x20eff2]={'$like':'%'+_0x9f8879[_0x5cbb('0x4b')]['filter']+'%'};return _0x1f4915;})});}_0x32b718=_[_0x5cbb('0x53')]({},_0x32b718,_0x9f8879['options']);switch(_0x171be1[_0x5cbb('0x3e')]){case _0x5cbb('0x66'):return db[_[_0x5cbb('0xa2')](_0x9f8879[_0x5cbb('0x4b')]['channel'])+_0x5cbb('0xc1')][_0x5cbb('0x59')](_0x32b718);case _0x5cbb('0x67'):case _0x5cbb('0x39'):return _0x171be1[_0x5cbb('0x36')+_[_0x5cbb('0xa2')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x99')])+_0x5cbb('0xab')](_0x32b718);default:throw new db['Sequelize'][(_0x5cbb('0x91'))](_0x5cbb('0xc2'));}})[_0x5cbb('0x1e')](function(_0x1ce1d4){_0x4f5811=_0x1ce1d4[_0x5cbb('0x5d')];if(!_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x32b718[_0x5cbb('0x2f')]=qs[_0x5cbb('0x2f')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x32b718[_0x5cbb('0x2e')]=qs['offset'](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}switch(_0x171be1[_0x5cbb('0x3e')]){case _0x5cbb('0x66'):return db[_['capitalize'](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x99')])+'Queue'][_0x5cbb('0x59')](_0x32b718);case _0x5cbb('0x67'):case _0x5cbb('0x39'):return _0x171be1[_0x5cbb('0x36')+_[_0x5cbb('0xa2')](_0x9f8879[_0x5cbb('0x4b')][_0x5cbb('0x99')])+'Queues'](_0x32b718);}})[_0x5cbb('0x1e')](function(_0xb3bd68){return{'count':_0x4f5811,'rows':_0xb3bd68};})[_0x5cbb('0x1e')](respondWithResult(_0x52b98e,null))[_0x5cbb('0x29')](handleError(_0x52b98e,null));};exports['getVoiceQueuesRt']=function(_0x58a0a0,_0x239220,_0xb6a449){var _0x61fa1e={};var _0x4ce3f4={};var _0x466a4a;var _0x457761;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x58a0a0['params']['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x239220,null))[_0x5cbb('0x1e')](function(_0x36b0cc){if(_0x36b0cc){_0x466a4a=_0x36b0cc;_0x4ce3f4['model']=_['keys'](db[_0x5cbb('0xad')][_0x5cbb('0x44')]);_0x4ce3f4[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x58a0a0[_0x5cbb('0x4b')]);_0x4ce3f4[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x4ce3f4['model'],_0x4ce3f4[_0x5cbb('0x4b')]);_0x61fa1e[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x4ce3f4[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x58a0a0[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x61fa1e[_0x5cbb('0x4c')]=_0x61fa1e[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x61fa1e['attributes']:_0x4ce3f4[_0x5cbb('0x45')];_0x61fa1e[_0x5cbb('0xb7')]=qs['sort'](_0x58a0a0[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0x61fa1e[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x58a0a0[_0x5cbb('0x4b')],_0x4ce3f4[_0x5cbb('0x49')]));if(_0x58a0a0[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x61fa1e[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x61fa1e['where'],{'$or':_[_0x5cbb('0x3b')](_0x61fa1e[_0x5cbb('0x4c')],function(_0x4dc1a2){var _0x6d542d={};_0x6d542d[_0x4dc1a2]={'$like':'%'+_0x58a0a0[_0x5cbb('0x4b')]['filter']+'%'};return _0x6d542d;})});}_0x61fa1e=_[_0x5cbb('0x53')]({},_0x61fa1e,_0x58a0a0[_0x5cbb('0x58')]);return _0x466a4a[_0x5cbb('0xc3')](_0x61fa1e);}})[_0x5cbb('0x1e')](function(_0x4b16a6){if(_0x4b16a6){_0x457761=_0x4b16a6['length'];if(!_0x58a0a0['query'][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x61fa1e['limit']=qs[_0x5cbb('0x2f')](_0x58a0a0[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x61fa1e[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x58a0a0['query'][_0x5cbb('0x2e')]);}return _0x466a4a[_0x5cbb('0xc3')](_0x61fa1e);}})[_0x5cbb('0x1e')](function(_0x3536f6){if(_0x3536f6){return _0x3536f6?{'count':_0x457761,'rows':_0x3536f6}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0x239220,null))[_0x5cbb('0x29')](handleError(_0x239220,null));};exports['getGroups']=function(_0x2c21b7,_0x3a45f8,_0x17834e){var _0x49696f={};var _0x5caf18={};var _0x1f327b;var _0x24a988;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x2c21b7['params']['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x3a45f8,null))[_0x5cbb('0x1e')](function(_0x8f29b1){if(_0x8f29b1){_0x1f327b=_0x8f29b1;_0x5caf18[_0x5cbb('0x45')]=_['keys'](db[_0x5cbb('0xc4')][_0x5cbb('0x44')]);_0x5caf18[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x2c21b7[_0x5cbb('0x4b')]);_0x5caf18[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x5caf18[_0x5cbb('0x45')],_0x5caf18['query']);_0x49696f[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x5caf18['model'],qs[_0x5cbb('0x4d')](_0x2c21b7[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x49696f['attributes']=_0x49696f[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x49696f[_0x5cbb('0x4c')]:_0x5caf18[_0x5cbb('0x45')];_0x49696f[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x2c21b7[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0x49696f[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x2c21b7['query'],_0x5caf18[_0x5cbb('0x49')]));if(_0x2c21b7[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x49696f[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x49696f[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0x49696f[_0x5cbb('0x4c')],function(_0x269f28){var _0x4834c6={};_0x4834c6[_0x269f28]={'$like':'%'+_0x2c21b7[_0x5cbb('0x4b')][_0x5cbb('0x52')]+'%'};return _0x4834c6;})});}_0x49696f=_[_0x5cbb('0x53')]({},_0x49696f,_0x2c21b7[_0x5cbb('0x58')]);return _0x1f327b[_0x5cbb('0xc5')](_0x49696f);}})[_0x5cbb('0x1e')](function(_0x38eb13){if(_0x38eb13){_0x24a988=_0x38eb13['length'];if(!_0x2c21b7[_0x5cbb('0x4b')]['hasOwnProperty']('nolimit')){_0x49696f['limit']=qs['limit'](_0x2c21b7['query'][_0x5cbb('0x2f')]);_0x49696f[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x2c21b7[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}return _0x1f327b[_0x5cbb('0xc5')](_0x49696f);}})[_0x5cbb('0x1e')](function(_0x421ba1){if(_0x421ba1){return _0x421ba1?{'count':_0x24a988,'rows':_0x421ba1}:null;}})['then'](respondWithResult(_0x3a45f8,null))['catch'](handleError(_0x3a45f8,null));};exports[_0x5cbb('0xc6')]=function(_0x2dc383,_0x51a282,_0x2f7268){var _0x5ccbe5={'raw':!![],'where':{}};var _0x4feea2={};var _0x245c22={'count':0x0,'rows':[]};return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x2dc383[_0x5cbb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x51a282,null))[_0x5cbb('0x1e')](function(_0x39e82f){if(_0x39e82f){_0x4feea2[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db['VoiceRecording'][_0x5cbb('0x44')]);_0x4feea2[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x2dc383[_0x5cbb('0x4b')]);_0x4feea2[_0x5cbb('0x49')]=_['intersection'](_0x4feea2[_0x5cbb('0x45')],_0x4feea2[_0x5cbb('0x4b')]);_0x5ccbe5[_0x5cbb('0x4c')]=_['intersection'](_0x4feea2[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x5ccbe5[_0x5cbb('0x4c')]=_0x5ccbe5['attributes'][_0x5cbb('0x5d')]?_0x5ccbe5[_0x5cbb('0x4c')]:_0x4feea2[_0x5cbb('0x45')];if(!_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x5ccbe5['limit']=qs['limit'](_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x5ccbe5['offset']=qs[_0x5cbb('0x2e')](_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}_0x5ccbe5[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0x5ccbe5[_0x5cbb('0x51')]=qs['filters'](_[_0x5cbb('0xc0')](_0x2dc383[_0x5cbb('0x4b')],_0x4feea2['filters']));_0x5ccbe5[_0x5cbb('0x51')][_0x5cbb('0xc7')]=_0x39e82f['id'];if(_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x5ccbe5[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x5ccbe5[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0x5ccbe5[_0x5cbb('0x4c')],function(_0x2f8156){var _0xa7ad61={};_0xa7ad61[_0x2f8156]={'$like':'%'+_0x2dc383[_0x5cbb('0x4b')]['filter']+'%'};return _0xa7ad61;})});}_0x5ccbe5=_[_0x5cbb('0x53')]({},_0x5ccbe5,_0x2dc383[_0x5cbb('0x58')]);return db[_0x5cbb('0xc8')][_0x5cbb('0x2d')]({'where':_0x5ccbe5[_0x5cbb('0x51')]})[_0x5cbb('0x1e')](function(_0xd76b36){_0x245c22[_0x5cbb('0x2d')]=_0xd76b36;if(_0x2dc383[_0x5cbb('0x4b')][_0x5cbb('0xc9')]){_0x5ccbe5[_0x5cbb('0xca')]=[{'all':!![]}];}return db[_0x5cbb('0xc8')][_0x5cbb('0x59')](_0x5ccbe5);})[_0x5cbb('0x1e')](function(_0x3ec70f){_0x245c22[_0x5cbb('0x5a')]=_0x3ec70f;return _0x245c22;});}})['then'](respondWithFilteredResult(_0x51a282,_0x5ccbe5))[_0x5cbb('0x29')](handleError(_0x51a282,null));};exports[_0x5cbb('0xcb')]=function(_0x17f466,_0x1d71e0,_0x931393){var _0x19b02d={'raw':!![],'where':{}};var _0x416b04={};var _0x518671={'count':0x0,'rows':[]};return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x17f466[_0x5cbb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d71e0,null))[_0x5cbb('0x1e')](function(_0x253728){if(_0x253728){_0x416b04['model']=_[_0x5cbb('0x48')](db[_0x5cbb('0xcc')][_0x5cbb('0x44')]);_0x416b04[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x17f466['query']);_0x416b04[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x416b04['model'],_0x416b04[_0x5cbb('0x4b')]);_0x19b02d[_0x5cbb('0x4c')]=_['intersection'](_0x416b04[_0x5cbb('0x45')],qs['fields'](_0x17f466['query']['fields']));_0x19b02d[_0x5cbb('0x4c')]=_0x19b02d[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x19b02d[_0x5cbb('0x4c')]:_0x416b04[_0x5cbb('0x45')];if(!_0x17f466['query'][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x19b02d[_0x5cbb('0x2f')]=qs[_0x5cbb('0x2f')](_0x17f466[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x19b02d[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x17f466[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}_0x19b02d[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x17f466[_0x5cbb('0x4b')]['sort']);_0x19b02d[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x17f466[_0x5cbb('0x4b')],_0x416b04[_0x5cbb('0x49')]));_0x19b02d[_0x5cbb('0x51')][_0x5cbb('0xc7')]=_0x253728['id'];if(_0x17f466['query']['filter']){_0x19b02d[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x19b02d[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0x19b02d[_0x5cbb('0x4c')],function(_0x29a20d){var _0x5de4c9={};_0x5de4c9[_0x29a20d]={'$like':'%'+_0x17f466[_0x5cbb('0x4b')][_0x5cbb('0x52')]+'%'};return _0x5de4c9;})});}_0x19b02d=_[_0x5cbb('0x53')]({},_0x19b02d,_0x17f466[_0x5cbb('0x58')]);return db[_0x5cbb('0xcc')][_0x5cbb('0x2d')]({'where':_0x19b02d[_0x5cbb('0x51')]})[_0x5cbb('0x1e')](function(_0x34cde8){_0x518671[_0x5cbb('0x2d')]=_0x34cde8;if(_0x17f466[_0x5cbb('0x4b')][_0x5cbb('0xc9')]){_0x19b02d['include']=[{'all':!![]}];}return db[_0x5cbb('0xcc')][_0x5cbb('0x59')](_0x19b02d);})[_0x5cbb('0x1e')](function(_0x7b12fd){_0x518671[_0x5cbb('0x5a')]=_0x7b12fd;return _0x518671;});}})[_0x5cbb('0x1e')](respondWithFilteredResult(_0x1d71e0,_0x19b02d))[_0x5cbb('0x29')](handleError(_0x1d71e0,null));};exports[_0x5cbb('0xcd')]=function(_0x50a642,_0xcce8f6,_0x2d5774){var _0xe81d09={};var _0x296c3a={};var _0x27d64b;var _0x54af51;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x50a642[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0xcce8f6,null))[_0x5cbb('0x1e')](function(_0x33fa9e){if(_0x33fa9e){_0x27d64b=_0x33fa9e;_0x296c3a['model']=_['keys'](db['ChatInteraction'][_0x5cbb('0x44')]);_0x296c3a[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x50a642[_0x5cbb('0x4b')]);_0x296c3a['filters']=_[_0x5cbb('0x4a')](_0x296c3a['model'],_0x296c3a[_0x5cbb('0x4b')]);_0xe81d09['attributes']=_[_0x5cbb('0x4a')](_0x296c3a[_0x5cbb('0x45')],qs['fields'](_0x50a642[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0xe81d09['attributes']=_0xe81d09[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0xe81d09[_0x5cbb('0x4c')]:_0x296c3a[_0x5cbb('0x45')];_0xe81d09[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x50a642['query'][_0x5cbb('0x50')]);_0xe81d09[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x50a642[_0x5cbb('0x4b')],_0x296c3a['filters']));if(_0x50a642[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0xe81d09[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0xe81d09[_0x5cbb('0x51')],{'$or':_['map'](_0xe81d09[_0x5cbb('0x4c')],function(_0x1f9811){var _0x2ded3a={};_0x2ded3a[_0x1f9811]={'$like':'%'+_0x50a642['query']['filter']+'%'};return _0x2ded3a;})});}_0xe81d09=_[_0x5cbb('0x53')]({},_0xe81d09,_0x50a642['options']);return _0x27d64b[_0x5cbb('0xcd')](_0xe81d09);}})[_0x5cbb('0x1e')](function(_0x10929e){if(_0x10929e){_0x54af51=_0x10929e[_0x5cbb('0x5d')];if(!_0x50a642[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0xe81d09['limit']=qs['limit'](_0x50a642[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0xe81d09[_0x5cbb('0x2e')]=qs['offset'](_0x50a642[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}return _0x27d64b[_0x5cbb('0xcd')](_0xe81d09);}})[_0x5cbb('0x1e')](function(_0x536976){if(_0x536976){return _0x536976?{'count':_0x54af51,'rows':_0x536976}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0xcce8f6,null))[_0x5cbb('0x29')](handleError(_0xcce8f6,null));};exports[_0x5cbb('0xce')]=function(_0x243e18,_0x52fb0d,_0x2e1fcc){var _0x11c4d6={};var _0x27b6cb={};var _0x47e326;var _0x43eb72;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x243e18[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x52fb0d,null))[_0x5cbb('0x1e')](function(_0x556fb8){if(_0x556fb8){_0x47e326=_0x556fb8;_0x27b6cb[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0xcf')][_0x5cbb('0x44')]);_0x27b6cb[_0x5cbb('0x4b')]=_['keys'](_0x243e18[_0x5cbb('0x4b')]);_0x27b6cb[_0x5cbb('0x49')]=_['intersection'](_0x27b6cb[_0x5cbb('0x45')],_0x27b6cb[_0x5cbb('0x4b')]);_0x11c4d6[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x27b6cb['model'],qs['fields'](_0x243e18[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x11c4d6[_0x5cbb('0x4c')]=_0x11c4d6[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x11c4d6[_0x5cbb('0x4c')]:_0x27b6cb[_0x5cbb('0x45')];_0x11c4d6[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x243e18['query'][_0x5cbb('0x50')]);_0x11c4d6[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x243e18[_0x5cbb('0x4b')],_0x27b6cb[_0x5cbb('0x49')]));if(_0x243e18[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x11c4d6[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x11c4d6['where'],{'$or':_[_0x5cbb('0x3b')](_0x11c4d6[_0x5cbb('0x4c')],function(_0x5631bc){var _0x1624c1={};_0x1624c1[_0x5631bc]={'$like':'%'+_0x243e18['query'][_0x5cbb('0x52')]+'%'};return _0x1624c1;})});}_0x11c4d6=_[_0x5cbb('0x53')]({},_0x11c4d6,_0x243e18[_0x5cbb('0x58')]);return _0x47e326[_0x5cbb('0xce')](_0x11c4d6);}})['then'](function(_0x59de23){if(_0x59de23){_0x43eb72=_0x59de23[_0x5cbb('0x5d')];if(!_0x243e18[_0x5cbb('0x4b')][_0x5cbb('0x4e')]('nolimit')){_0x11c4d6[_0x5cbb('0x2f')]=qs[_0x5cbb('0x2f')](_0x243e18[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x11c4d6[_0x5cbb('0x2e')]=qs['offset'](_0x243e18[_0x5cbb('0x4b')]['offset']);}return _0x47e326[_0x5cbb('0xce')](_0x11c4d6);}})['then'](function(_0x122dc7){if(_0x122dc7){return _0x122dc7?{'count':_0x43eb72,'rows':_0x122dc7}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0x52fb0d,null))[_0x5cbb('0x29')](handleError(_0x52fb0d,null));};exports[_0x5cbb('0xd0')]=function(_0x301481,_0x131e40,_0x27fabf){var _0xf09f88={'raw':!![],'where':{}};var _0x45da3f={};var _0x4d5ce7={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x301481[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x131e40,null))['then'](function(_0x3d7feb){if(_0x3d7feb){_0x45da3f[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db['MailInteraction']['rawAttributes']);_0x45da3f[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x301481[_0x5cbb('0x4b')]);_0x45da3f[_0x5cbb('0x49')]=_['intersection'](_0x45da3f[_0x5cbb('0x45')],_0x45da3f[_0x5cbb('0x4b')]);_0xf09f88[_0x5cbb('0x4c')]=_['intersection'](_0x45da3f[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x301481[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0xf09f88[_0x5cbb('0x4c')]=_0xf09f88[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0xf09f88[_0x5cbb('0x4c')]:_0x45da3f[_0x5cbb('0x45')];if(!_0x301481['query'][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0xf09f88['limit']=qs[_0x5cbb('0x2f')](_0x301481[_0x5cbb('0x4b')]['limit']);_0xf09f88['offset']=qs[_0x5cbb('0x2e')](_0x301481[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}_0xf09f88[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x301481[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0xf09f88[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x301481['query'],_0x45da3f[_0x5cbb('0x49')]));_0xf09f88[_0x5cbb('0x51')]['UserId']=_0x3d7feb['id'];if(_0x301481[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0xf09f88['where']=_[_0x5cbb('0x53')](_0xf09f88[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0xf09f88[_0x5cbb('0x4c')],function(_0x2aeb29){var _0x307589={};_0x307589[_0x2aeb29]={'$like':'%'+_0x301481[_0x5cbb('0x4b')]['filter']+'%'};return _0x307589;})});}_0xf09f88=_['merge']({},_0xf09f88,_0x301481[_0x5cbb('0x58')]);return db[_0x5cbb('0xd1')][_0x5cbb('0x2d')]({'where':_0xf09f88['where']})[_0x5cbb('0x1e')](function(_0x15a945){_0x4d5ce7['count']=_0x15a945;if(_0x301481['query']['includeAll']){_0xf09f88[_0x5cbb('0xca')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0xf09f88);})['then'](function(_0x4d7da8){_0x4d5ce7['rows']=_0x4d7da8;return _0x4d5ce7;});}})[_0x5cbb('0x1e')](respondWithFilteredResult(_0x131e40,_0xf09f88))['catch'](handleError(_0x131e40,null));};exports[_0x5cbb('0xd2')]=function(_0x2b22d6,_0x1a7879,_0x454da3){var _0x365e08={};var _0x285209={};var _0x3bedd9;var _0xcde021;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x2b22d6[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x1a7879,null))[_0x5cbb('0x1e')](function(_0x4b1fd7){if(_0x4b1fd7){_0x3bedd9=_0x4b1fd7;_0x285209[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0xd3')][_0x5cbb('0x44')]);_0x285209[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x2b22d6[_0x5cbb('0x4b')]);_0x285209[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x285209[_0x5cbb('0x45')],_0x285209[_0x5cbb('0x4b')]);_0x365e08['attributes']=_[_0x5cbb('0x4a')](_0x285209[_0x5cbb('0x45')],qs['fields'](_0x2b22d6['query'][_0x5cbb('0x4d')]));_0x365e08[_0x5cbb('0x4c')]=_0x365e08[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x365e08['attributes']:_0x285209[_0x5cbb('0x45')];_0x365e08['order']=qs[_0x5cbb('0x50')](_0x2b22d6['query'][_0x5cbb('0x50')]);_0x365e08[_0x5cbb('0x51')]=qs['filters'](_[_0x5cbb('0xc0')](_0x2b22d6['query'],_0x285209[_0x5cbb('0x49')]));if(_0x2b22d6[_0x5cbb('0x4b')]['filter']){_0x365e08[_0x5cbb('0x51')]=_['merge'](_0x365e08[_0x5cbb('0x51')],{'$or':_[_0x5cbb('0x3b')](_0x365e08[_0x5cbb('0x4c')],function(_0x5e5310){var _0x43f459={};_0x43f459[_0x5e5310]={'$like':'%'+_0x2b22d6[_0x5cbb('0x4b')][_0x5cbb('0x52')]+'%'};return _0x43f459;})});}_0x365e08=_['merge']({},_0x365e08,_0x2b22d6[_0x5cbb('0x58')]);return _0x3bedd9[_0x5cbb('0xd2')](_0x365e08);}})['then'](function(_0x2e8a60){if(_0x2e8a60){_0xcde021=_0x2e8a60[_0x5cbb('0x5d')];if(!_0x2b22d6['query'][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x365e08[_0x5cbb('0x2f')]=qs[_0x5cbb('0x2f')](_0x2b22d6['query'][_0x5cbb('0x2f')]);_0x365e08[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x2b22d6[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}return _0x3bedd9[_0x5cbb('0xd2')](_0x365e08);}})[_0x5cbb('0x1e')](function(_0x39968e){if(_0x39968e){return _0x39968e?{'count':_0xcde021,'rows':_0x39968e}:null;}})['then'](respondWithResult(_0x1a7879,null))[_0x5cbb('0x29')](handleError(_0x1a7879,null));};exports[_0x5cbb('0xd4')]=function(_0x209933,_0xa3a346,_0x314500){var _0x362a43={};var _0x578c79={};var _0xad63eb;var _0x3fa453;return db[_0x5cbb('0x43')]['findOne']({'where':{'id':_0x209933[_0x5cbb('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa3a346,null))[_0x5cbb('0x1e')](function(_0x1745ac){if(_0x1745ac){_0xad63eb=_0x1745ac;_0x578c79[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0xd5')]['rawAttributes']);_0x578c79[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x209933[_0x5cbb('0x4b')]);_0x578c79[_0x5cbb('0x49')]=_['intersection'](_0x578c79[_0x5cbb('0x45')],_0x578c79['query']);_0x362a43[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x578c79['model'],qs[_0x5cbb('0x4d')](_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x362a43[_0x5cbb('0x4c')]=_0x362a43['attributes']['length']?_0x362a43[_0x5cbb('0x4c')]:_0x578c79['model'];_0x362a43[_0x5cbb('0xb7')]=qs['sort'](_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0x362a43[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_[_0x5cbb('0xc0')](_0x209933[_0x5cbb('0x4b')],_0x578c79[_0x5cbb('0x49')]));if(_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x362a43[_0x5cbb('0x51')]=_[_0x5cbb('0x53')](_0x362a43['where'],{'$or':_[_0x5cbb('0x3b')](_0x362a43[_0x5cbb('0x4c')],function(_0x4ae412){var _0x485071={};_0x485071[_0x4ae412]={'$like':'%'+_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x52')]+'%'};return _0x485071;})});}_0x362a43=_[_0x5cbb('0x53')]({},_0x362a43,_0x209933[_0x5cbb('0x58')]);return _0xad63eb[_0x5cbb('0xd4')](_0x362a43);}})[_0x5cbb('0x1e')](function(_0x27806b){if(_0x27806b){_0x3fa453=_0x27806b[_0x5cbb('0x5d')];if(!_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x4e')]('nolimit')){_0x362a43[_0x5cbb('0x2f')]=qs[_0x5cbb('0x2f')](_0x209933['query']['limit']);_0x362a43['offset']=qs[_0x5cbb('0x2e')](_0x209933[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}return _0xad63eb[_0x5cbb('0xd4')](_0x362a43);}})[_0x5cbb('0x1e')](function(_0x38230f){if(_0x38230f){return _0x38230f?{'count':_0x3fa453,'rows':_0x38230f}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0xa3a346,null))[_0x5cbb('0x29')](handleError(_0xa3a346,null));};exports[_0x5cbb('0xd6')]=function(_0x2d5643,_0x1f6dfe,_0x126442){var _0x55726c;var _0x7b048d;var _0x36738f;return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x2d5643['params']['id'],'role':_0x5cbb('0x39')},'attributes':['id',_0x5cbb('0x40'),_0x5cbb('0xd7'),_0x5cbb('0xd8'),'role',_0x5cbb('0x6f'),_0x5cbb('0x9b')]})[_0x5cbb('0x1e')](handleEntityNotFound(_0x1f6dfe,null))['then'](function(_0x111ea0){if(_0x111ea0){_0x55726c=_0x111ea0;if(_0x2d5643[_0x5cbb('0x5f')][_0x5cbb('0xd9')]){_0x36738f=util['format'](_0x5cbb('0xda'),_0x55726c[_0x2d5643[_0x5cbb('0x5f')][_0x5cbb('0xd9')]]);}else if(_0x2d5643['body'][_0x5cbb('0xdb')]){_0x36738f=util[_0x5cbb('0x6c')]('SIP/%s',_0x2d5643['body'][_0x5cbb('0xdb')]);}else{_0x36738f=util[_0x5cbb('0x6c')](_0x5cbb('0xa7'),_0x55726c[_0x5cbb('0x40')]);}socket['to'](util['format']('user:%s',_0x55726c[_0x5cbb('0x40')]))[_0x5cbb('0xa4')](_0x5cbb('0xdc'),{'ip':_0x2d5643[_0x5cbb('0xdd')][_0x5cbb('0xde')]||_0x2d5643[_0x5cbb('0xdf')][_0x5cbb('0xe0')]||_0x2d5643[_0x5cbb('0xe1')]['remoteAddress']||_0x2d5643[_0x5cbb('0xdf')][_0x5cbb('0xe1')][_0x5cbb('0xe0')]});return db[_0x5cbb('0xad')][_0x5cbb('0x35')]({'where':{'membername':_0x55726c[_0x5cbb('0x40')]},'individualHooks':!![]});}})['then'](function(_0x213796){if(_0x55726c){return _0x55726c['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x21fea7){var _0x295d85=[];if(_0x21fea7){_0x7b048d=_0x21fea7;if(_0x7b048d[_0x5cbb('0x5d')]){for(var _0x1aef92=0x0;_0x1aef92<_0x7b048d[_0x5cbb('0x5d')];_0x1aef92++){_0x295d85[_0x5cbb('0xa6')]({'membername':_0x55726c[_0x5cbb('0x40')],'UserId':_0x55726c['id'],'queue_name':_0x7b048d[_0x1aef92][_0x5cbb('0x40')],'VoiceQueueId':_0x7b048d[_0x1aef92]['id'],'interface':_0x36738f,'paused':_0x55726c[_0x5cbb('0x9b')]||![],'penalty':_0x7b048d[_0x1aef92][_0x5cbb('0xe2')]||0x0});}return BPromise[_0x5cbb('0xa8')](_0x295d85,function(_0x5ef448){return db[_0x5cbb('0xad')][_0x5cbb('0xa9')](_0x5ef448);});}}})[_0x5cbb('0x1e')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x55726c[_0x5cbb('0x40')],'exitAt':null}});})[_0x5cbb('0x1e')](function(_0x341c51){var _0xe3e4ae=[];_0x341c51['forEach'](function(_0x4ca96f){_0xe3e4ae[_0x5cbb('0xa6')](_0x4ca96f[_0x5cbb('0x60')]({'exitAt':moment()['format'](_0x5cbb('0xe3'))}));});return BPromise[_0x5cbb('0xe4')](_0xe3e4ae);})['then'](function(){var _0x267c2e=[];var _0x2a3e0c=[];var _0x130b24=utils[_0x5cbb('0xe5')]();var _0x1fb05f={'membername':_0x55726c[_0x5cbb('0x40')],'interface':_0x36738f,'enterAt':moment()[_0x5cbb('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x55726c[_0x5cbb('0x3e')],'internal':_0x55726c['internal']};_0x130b24['forEach'](function(_0x9b59c4){_0x267c2e['push'](_[_0x5cbb('0x53')]({'channel':_0x9b59c4,'type':_0x5cbb('0xe6'),'data1':_0x2d5643[_0x5cbb('0x5f')][_0x5cbb('0xe7')],'data2':_0x36738f},_0x1fb05f));if(_0x55726c[_0x5cbb('0x9b')]){_0x2a3e0c['push'](_['merge']({'channel':_0x9b59c4,'type':_0x5cbb('0xe8'),'data1':'LOGININPAUSE'},_0x1fb05f));}});return db[_0x5cbb('0xe9')][_0x5cbb('0x5e')](_0x267c2e[_0x5cbb('0xea')](_0x2a3e0c),{'individualHooks':!![]});})['then'](function(){return _0x55726c[_0x5cbb('0x60')]({'online':!![],'lastLoginAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3')),'voicePause':_0x55726c[_0x5cbb('0x9b')]||![],'mailPause':_0x55726c[_0x5cbb('0x9b')]||![],'chatPause':_0x55726c[_0x5cbb('0x9b')]||![],'faxPause':_0x55726c[_0x5cbb('0x9b')]||![],'smsPause':_0x55726c[_0x5cbb('0x9b')]||![],'openchannelPause':_0x55726c[_0x5cbb('0x9b')]||![],'pauseType':_0x55726c[_0x5cbb('0x9b')]?_0x5cbb('0xeb'):null,'interface':_0x36738f,'lastPauseAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3'))});})[_0x5cbb('0x1e')](respondWithResult(_0x1f6dfe,null))['catch'](handleError(_0x1f6dfe,null));};exports['logout']=function(_0x238567,_0x38e19f,_0xbdc97a){var _0x528eed;return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x238567['params']['id'],'role':'agent'},'attributes':['id',_0x5cbb('0x40'),_0x5cbb('0x3e')]})[_0x5cbb('0x1e')](handleEntityNotFound(_0x38e19f,null))[_0x5cbb('0x1e')](function(_0x2cab8f){if(_0x2cab8f){_0x528eed=_0x2cab8f;return db['UserVoiceQueueRt'][_0x5cbb('0x35')]({'where':{'membername':_0x528eed[_0x5cbb('0x40')]},'individualHooks':!![]});}})[_0x5cbb('0x1e')](function(){return db['MemberReport'][_0x5cbb('0x59')]({'where':{'membername':_0x528eed[_0x5cbb('0x40')],'exitAt':null}});})['then'](function(_0x252b15){var _0x13be9c=[];_0x252b15[_0x5cbb('0xec')](function(_0x592148){_0x13be9c[_0x5cbb('0xa6')](_0x592148[_0x5cbb('0x60')]({'exitAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3'))}));});return BPromise[_0x5cbb('0xe4')](_0x13be9c);})['then'](function(){return _0x528eed[_0x5cbb('0x60')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x5cbb('0x1e')](respondWithResult(_0x38e19f,null))['catch'](handleError(_0x38e19f,null));};exports[_0x5cbb('0xed')]=function(_0x3f4999,_0x3a6c34,_0x1de79b){var _0x57dac6;return db['UserVoiceQueueRt'][_0x5cbb('0x60')]({'paused':0x1},{'where':{'UserId':_0x3f4999['params']['id']},'individualHooks':!![]})[_0x5cbb('0x1e')](function(){return db[_0x5cbb('0x43')]['find']({'where':{'id':_0x3f4999[_0x5cbb('0x5c')]['id'],'role':_0x5cbb('0x39')},'attributes':['id','name',_0x5cbb('0x3e'),_0x5cbb('0x6f'),_0x5cbb('0xd9')]});})[_0x5cbb('0x1e')](handleEntityNotFound(_0x3a6c34,null))[_0x5cbb('0x1e')](function(_0x3b45e2){if(_0x3b45e2){_0x57dac6=_0x3b45e2;return respondWithRpcPromise(_0x5cbb('0xee'),_0x5cbb('0xed'),{'id':_0x57dac6['id'],'name':_0x57dac6[_0x5cbb('0x40')],'pause':!![]});}})[_0x5cbb('0x1e')](function(){if(_0x57dac6){return db['MemberReport'][_0x5cbb('0x59')]({'where':{'membername':_0x57dac6[_0x5cbb('0x40')],'type':_0x5cbb('0xe8'),'exitAt':null}});}})['then'](function(_0x3b1009){if(_0x3b1009['length']){var _0x30835d=moment()[_0x5cbb('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x594e05=0x0,_0x11e9f0=_0x3b1009[_0x5cbb('0x5d')];_0x594e05<_0x11e9f0;_0x594e05++){_0x3b1009[_0x594e05][_0x5cbb('0xef')]({'exitAt':_0x30835d});}}})[_0x5cbb('0x1e')](function(){var _0x34f0c7=[];var _0x2b954a=utils[_0x5cbb('0xe5')]();_0x2b954a[_0x5cbb('0xec')](function(_0x4e890f){_0x34f0c7[_0x5cbb('0xa6')]({'channel':_0x4e890f,'membername':_0x57dac6[_0x5cbb('0x40')],'interface':_[_0x5cbb('0x6a')](_0x57dac6[_0x5cbb('0xd9')])?util['format'](_0x5cbb('0xa7'),_0x57dac6[_0x5cbb('0x40')]):_0x57dac6['interface'],'type':_0x5cbb('0xe8'),'enterAt':moment()[_0x5cbb('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3f4999[_0x5cbb('0x5f')]['type']||'DEFAULT\x20PAUSE','role':_0x57dac6[_0x5cbb('0x3e')],'internal':_0x57dac6[_0x5cbb('0x6f')]});});return db[_0x5cbb('0xe9')][_0x5cbb('0x5e')](_0x34f0c7,{'individualHooks':!![]});})[_0x5cbb('0x1e')](function(){return _0x57dac6[_0x5cbb('0x60')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3f4999['body'][_0x5cbb('0xf0')]||_0x5cbb('0xf1'),'lastPauseAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3'))});})['then'](respondWithResult(_0x3a6c34,null))['catch'](handleError(_0x3a6c34,null));};exports[_0x5cbb('0xf2')]=function(_0xe4fc2,_0x129113,_0x33f419){var _0x3d5cf5;return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0xe4fc2[_0x5cbb('0x5c')]['id']},'attributes':['id',_0x5cbb('0x40'),'role',_0x5cbb('0x9c'),'mailPause','chatPause','faxPause',_0x5cbb('0xf3'),'smsPause','pauseType',_0x5cbb('0xf4')]})['then'](handleEntityNotFound(_0x129113,null))[_0x5cbb('0x1e')](function(_0x9e66c8){if(_0x9e66c8){_0x3d5cf5=_0x9e66c8;if(_0xe4fc2[_0x5cbb('0x5f')][_0x5cbb('0x99')]&&!utils['isValidChannel'](_0xe4fc2['body'][_0x5cbb('0x99')])){throw new db['Sequelize'][(_0x5cbb('0x91'))]('Unknown\x20channel');}switch(_0xe4fc2[_0x5cbb('0x5f')]['channel']){case _0x5cbb('0xa5'):return respondWithRpcPromise(_0x5cbb('0xee'),_0x5cbb('0xf2'),{'id':_0x3d5cf5['id'],'name':_0x3d5cf5[_0x5cbb('0x40')],'pause':![]})['then'](function(){return db[_0x5cbb('0xad')][_0x5cbb('0x60')]({'paused':0x0},{'where':{'UserId':_0x3d5cf5['id']},'individualHooks':!![]});})[_0x5cbb('0x1e')](function(){return db['MemberReport'][_0x5cbb('0x3f')]({'where':{'channel':_0xe4fc2[_0x5cbb('0x5f')][_0x5cbb('0x99')],'membername':_0x3d5cf5['name'],'type':_0x5cbb('0xe8'),'exitAt':null}});})[_0x5cbb('0x1e')](function(_0x8f03e8){if(_0x8f03e8){return _0x8f03e8[_0x5cbb('0x60')]({'exitAt':moment()[_0x5cbb('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x5cbb('0x1e')](function(){return _0x3d5cf5[_0x5cbb('0x60')]({'voicePause':![]});});case _0x5cbb('0xf5'):case'chat':case _0x5cbb('0xf6'):case _0x5cbb('0xf7'):case _0x5cbb('0xf8'):return db[_0x5cbb('0xe9')][_0x5cbb('0x3f')]({'where':{'channel':_0xe4fc2['body'][_0x5cbb('0x99')],'membername':_0x3d5cf5['name'],'type':_0x5cbb('0xe8'),'exitAt':null}})[_0x5cbb('0x1e')](function(_0x33b599){if(_0x33b599){return _0x33b599[_0x5cbb('0x60')]({'exitAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3')),'data2':_0x5cbb('0xf9')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x1727ee={};_[_0x5cbb('0xfa')](_0x1727ee,util['format'](_0x5cbb('0xfb'),_0xe4fc2[_0x5cbb('0x5f')]['channel'],_0x5cbb('0xfc')),![]);return _0x3d5cf5[_0x5cbb('0x60')](_0x1727ee);});default:return respondWithRpcPromise('QueuePause',_0x5cbb('0xf2'),{'id':_0x3d5cf5['id'],'name':_0x3d5cf5[_0x5cbb('0x40')],'pause':![]})[_0x5cbb('0x1e')](function(){return db[_0x5cbb('0xad')]['update']({'paused':0x0},{'where':{'UserId':_0x3d5cf5['id']}});})[_0x5cbb('0x1e')](function(){return db[_0x5cbb('0xe9')][_0x5cbb('0x59')]({'where':{'membername':_0x3d5cf5[_0x5cbb('0x40')],'type':_0x5cbb('0xe8'),'exitAt':null}});})['then'](function(_0x786093){var _0x16a6ab=[];_0x786093['forEach'](function(_0x1f59f2){_0x16a6ab[_0x5cbb('0xa6')](_0x1f59f2[_0x5cbb('0x60')]({'exitAt':moment()[_0x5cbb('0x6c')](_0x5cbb('0xe3')),'data2':_0x5cbb('0xf9')}));});return BPromise[_0x5cbb('0xe4')](_0x16a6ab);})[_0x5cbb('0x1e')](function(){return _0x3d5cf5[_0x5cbb('0x60')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x5cbb('0x1e')](respondWithResult(_0x129113,null))['catch'](handleError(_0x129113,null));};exports['getTeams']=function(_0x2d72e9,_0x461479,_0x4c4a60){var _0x4573e6={};var _0x31ea9e={};var _0x498d48;var _0x2a3f36;return db[_0x5cbb('0x43')]['findOne']({'where':{'id':_0x2d72e9[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x461479,null))['then'](function(_0x4dff9e){if(_0x4dff9e){_0x498d48=_0x4dff9e;_0x31ea9e[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0xfd')]['rawAttributes']);_0x31ea9e['query']=_[_0x5cbb('0x48')](_0x2d72e9[_0x5cbb('0x4b')]);_0x31ea9e[_0x5cbb('0x49')]=_[_0x5cbb('0x4a')](_0x31ea9e[_0x5cbb('0x45')],_0x31ea9e[_0x5cbb('0x4b')]);_0x4573e6[_0x5cbb('0x4c')]=_['intersection'](_0x31ea9e[_0x5cbb('0x45')],qs[_0x5cbb('0x4d')](_0x2d72e9[_0x5cbb('0x4b')]['fields']));_0x4573e6[_0x5cbb('0x4c')]=_0x4573e6['attributes'][_0x5cbb('0x5d')]?_0x4573e6['attributes']:_0x31ea9e[_0x5cbb('0x45')];_0x4573e6[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x2d72e9[_0x5cbb('0x4b')]['sort']);_0x4573e6['where']=qs['filters'](_[_0x5cbb('0xc0')](_0x2d72e9[_0x5cbb('0x4b')],_0x31ea9e[_0x5cbb('0x49')]));if(_0x2d72e9[_0x5cbb('0x4b')]['filter']){_0x4573e6['where']=_[_0x5cbb('0x53')](_0x4573e6[_0x5cbb('0x51')],{'$or':_['map'](_0x4573e6[_0x5cbb('0x4c')],function(_0x209362){var _0x2a72b6={};_0x2a72b6[_0x209362]={'$like':'%'+_0x2d72e9[_0x5cbb('0x4b')][_0x5cbb('0x52')]+'%'};return _0x2a72b6;})});}_0x4573e6=_[_0x5cbb('0x53')]({},_0x4573e6,_0x2d72e9[_0x5cbb('0x58')]);return _0x498d48[_0x5cbb('0xfe')](_0x4573e6);}})['then'](function(_0x54c22c){if(_0x54c22c){_0x2a3f36=_0x54c22c[_0x5cbb('0x5d')];if(!_0x2d72e9['query'][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x4573e6['limit']=qs['limit'](_0x2d72e9[_0x5cbb('0x4b')]['limit']);_0x4573e6[_0x5cbb('0x2e')]=qs['offset'](_0x2d72e9[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);}return _0x498d48[_0x5cbb('0xfe')](_0x4573e6);}})[_0x5cbb('0x1e')](function(_0x2b6c81){if(_0x2b6c81){return _0x2b6c81?{'count':_0x2a3f36,'rows':_0x2b6c81}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0x461479,null))[_0x5cbb('0x29')](handleError(_0x461479,null));};exports[_0x5cbb('0xff')]=function(_0x26442f,_0x35ab09,_0x297e8c){return db['User'][_0x5cbb('0x3f')]({'where':{'id':_0x26442f['params']['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x35ab09,null))[_0x5cbb('0x1e')](function(_0x5c63e3){if(_0x5c63e3){return _0x5c63e3[_0x5cbb('0xff')](_0x26442f[_0x5cbb('0x5f')][_0x5cbb('0x63')],_[_0x5cbb('0x64')](_0x26442f[_0x5cbb('0x5f')],[_0x5cbb('0x63'),'id'])||{});}})['then'](respondWithResult(_0x35ab09,null))[_0x5cbb('0x29')](handleError(_0x35ab09,null));};exports[_0x5cbb('0x100')]=function(_0x22beea,_0x496b92,_0x524689){return db[_0x5cbb('0x43')][_0x5cbb('0x3f')]({'where':{'id':_0x22beea[_0x5cbb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x496b92,null))[_0x5cbb('0x1e')](function(_0x490b89){if(_0x490b89){return _0x490b89[_0x5cbb('0x100')](_0x22beea[_0x5cbb('0x4b')][_0x5cbb('0x63')]);}})[_0x5cbb('0x1e')](respondWithStatusCode(_0x496b92,null))['catch'](handleError(_0x496b92,null));};exports[_0x5cbb('0x101')]=function(_0x4d33c4,_0x137fef,_0x4aa5a5){var _0x2f20fc={};var _0x12ac17={};var _0x523823;var _0x2e2332;return db['User']['findOne']({'where':{'id':_0x4d33c4[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x137fef,null))[_0x5cbb('0x1e')](function(_0x4c95e4){if(_0x4c95e4){_0x523823=_0x4c95e4;_0x12ac17[_0x5cbb('0x45')]=_['keys'](db[_0x5cbb('0xb9')][_0x5cbb('0x44')]);_0x12ac17[_0x5cbb('0x4b')]=_['keys'](_0x4d33c4[_0x5cbb('0x4b')]);_0x12ac17['filters']=_[_0x5cbb('0x4a')](_0x12ac17['model'],_0x12ac17[_0x5cbb('0x4b')]);_0x2f20fc[_0x5cbb('0x4c')]=_[_0x5cbb('0x4a')](_0x12ac17['model'],qs[_0x5cbb('0x4d')](_0x4d33c4[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x2f20fc[_0x5cbb('0x4c')]=_0x2f20fc[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x2f20fc[_0x5cbb('0x4c')]:_0x12ac17[_0x5cbb('0x45')];_0x2f20fc[_0x5cbb('0xb7')]=qs['sort'](_0x4d33c4[_0x5cbb('0x4b')][_0x5cbb('0x50')]);_0x2f20fc[_0x5cbb('0x51')]=qs[_0x5cbb('0x49')](_['pick'](_0x4d33c4['query'],_0x12ac17[_0x5cbb('0x49')]));if(_0x4d33c4['query'][_0x5cbb('0x52')]){_0x2f20fc['where']=_[_0x5cbb('0x53')](_0x2f20fc['where'],{'$or':_['map'](_0x2f20fc[_0x5cbb('0x4c')],function(_0x10c596){var _0x3de910={};_0x3de910[_0x10c596]={'$like':'%'+_0x4d33c4['query'][_0x5cbb('0x52')]+'%'};return _0x3de910;})});}_0x2f20fc=_[_0x5cbb('0x53')]({},_0x2f20fc,_0x4d33c4[_0x5cbb('0x58')]);return _0x523823[_0x5cbb('0x101')](_0x2f20fc);}})[_0x5cbb('0x1e')](function(_0x4a28f8){if(_0x4a28f8){_0x2e2332=_0x4a28f8[_0x5cbb('0x5d')];if(!_0x4d33c4[_0x5cbb('0x4b')][_0x5cbb('0x4e')](_0x5cbb('0x4f'))){_0x2f20fc[_0x5cbb('0x2f')]=qs['limit'](_0x4d33c4[_0x5cbb('0x4b')][_0x5cbb('0x2f')]);_0x2f20fc[_0x5cbb('0x2e')]=qs[_0x5cbb('0x2e')](_0x4d33c4['query']['offset']);}return _0x523823['getLists'](_0x2f20fc);}})['then'](function(_0x7b7389){if(_0x7b7389){return _0x7b7389?{'count':_0x2e2332,'rows':_0x7b7389}:null;}})[_0x5cbb('0x1e')](respondWithResult(_0x137fef,null))[_0x5cbb('0x29')](handleError(_0x137fef,null));};exports['getAgents']=function(_0x53cc1a,_0x2f5907,_0x1cf532){var _0x1b55fe={};var _0x46f6a5={};var _0x2e806f;var _0x1c5c67;return db[_0x5cbb('0x43')][_0x5cbb('0xbe')]({'where':{'id':_0x53cc1a[_0x5cbb('0x5c')]['id']}})[_0x5cbb('0x1e')](handleEntityNotFound(_0x2f5907,null))[_0x5cbb('0x1e')](function(_0x4307ee){if(_0x4307ee){_0x2e806f=_0x4307ee;_0x46f6a5[_0x5cbb('0x45')]=_[_0x5cbb('0x48')](db[_0x5cbb('0x43')][_0x5cbb('0x44')]);_0x46f6a5[_0x5cbb('0x4b')]=_[_0x5cbb('0x48')](_0x53cc1a[_0x5cbb('0x4b')]);_0x46f6a5['filters']=_[_0x5cbb('0x4a')](_0x46f6a5[_0x5cbb('0x45')],_0x46f6a5['query']);_0x1b55fe[_0x5cbb('0x4c')]=_['intersection'](_0x46f6a5['model'],qs[_0x5cbb('0x4d')](_0x53cc1a[_0x5cbb('0x4b')][_0x5cbb('0x4d')]));_0x1b55fe[_0x5cbb('0x4c')]=_0x1b55fe[_0x5cbb('0x4c')][_0x5cbb('0x5d')]?_0x1b55fe[_0x5cbb('0x4c')]:_0x46f6a5['model'];_0x1b55fe[_0x5cbb('0xb7')]=qs[_0x5cbb('0x50')](_0x53cc1a['query'][_0x5cbb('0x50')]);_0x1b55fe[_0x5cbb('0x51')]=qs['filters'](_[_0x5cbb('0xc0')](_0x53cc1a[_0x5cbb('0x4b')],_0x46f6a5[_0x5cbb('0x49')]));if(_0x53cc1a[_0x5cbb('0x4b')][_0x5cbb('0x52')]){_0x1b55fe[_0x5cbb('0x51')]=_['merge'](_0x1b55fe['where'],{'$or':_[_0x5cbb('0x3b')](_0x1b55fe[_0x5cbb('0x4c')],function(_0x1636ea){var _0x3db294={};_0x3db294[_0x1636ea]={'$like':'%'+_0x53cc1a['query'][_0x5cbb('0x52')]+'%'};return _0x3db294;})});}_0x1b55fe[_0x5cbb('0x45')]=db[_0x5cbb('0x43')];_0x1b55fe['as']=_0x5cbb('0x38');_0x1b55fe=_[_0x5cbb('0x53')]({},_0x1b55fe,_0x53cc1a[_0x5cbb('0x58')]);return _0x2e806f[_0x5cbb('0x102')]({'include':[_0x1b55fe]});}})[_0x5cbb('0x1e')](function(_0x1a641a){if(_0x1a641a){var _0xbeac6f={},_0x1b2364=[],_0x45b3c4=0x0;for(var _0x1e0937=0x0;_0x1e0937<_0x1a641a[_0x5cbb('0x5d')];_0x1e0937+=0x1){for(var _0x4369ca=0x0,_0x4cf1ad;_0x4369ca<_0x1a641a[_0x1e0937]['Agents'][_0x5cbb('0x5d')];_0x4369ca+=0x1){_0x4cf1ad=_0x1a641a[_0x1e0937][_0x5cbb('0x38')][_0x4369ca][_0x5cbb('0x36')]({'plain':!![]});_0xbeac6f[_0x4cf1ad['id']]=_0x4cf1ad;}}_0xbeac6f=_[_0x5cbb('0x103')](_0xbeac6f);for(var _0x322c53=qs[_0x5cbb('0x2e')](_0x53cc1a[_0x5cbb('0x4b')][_0x5cbb('0x2e')]);_0x322c53<_0xbeac6f[_0x5cbb('0x5d')]&&_0x1b2364[_0x5cbb('0x5d')]=_0x475608){_0x33a38e=_0x475608;_0x3ca63f=0xc8;}else{_0x3ca63f=0xce;}_0x12ee11[_0xce98('0x28')](_0x3ca63f);return _0x12ee11[_0xce98('0x2e')](_0xce98('0x2f'),_0xbead69+'-'+_0x33a38e+'/'+_0x475608)['json'](_0xe8780e);}return null;};}function patchUpdates(_0x15897c){return function(_0x1844cc){try{jsonpatch[_0xce98('0x30')](_0x1844cc,_0x15897c,!![]);}catch(_0x4a8040){return BPromise[_0xce98('0x31')](_0x4a8040);}return _0x1844cc[_0xce98('0x32')]();};}function saveUpdates(_0x1e09b3,_0x552bb9){return function(_0xa5ef72){if(_0xa5ef72){return _0xa5ef72['update'](_0x1e09b3)[_0xce98('0x1c')](function(_0x242f81){return _0x242f81;});}return null;};}function removeEntity(_0x3d47da,_0x4fb517){return function(_0x3f4235){if(_0x3f4235){return _0x3f4235[_0xce98('0x33')]()['then'](function(){var _0x370518=_0x3f4235[_0xce98('0x34')]({'plain':!![]});var _0x3e7f37=[{'name':'Users','value':_0xce98('0x35'),'ignore':!![]},{'name':_0xce98('0x36'),'value':_0xce98('0x37'),'ignore':![]},{'name':_0xce98('0x38'),'value':_0xce98('0x39'),'ignore':![]}];var _0x3a3fab=_(_0x3e7f37)[_0xce98('0x3a')](_0xce98('0x3b'))[_0xce98('0x3c')](_0xce98('0x3d'))[_0xce98('0x3d')]();if(_[_0xce98('0x3e')](_0x3a3fab,_0x370518[_0xce98('0x3f')])){return;}var _0x22f7ae=_[_0xce98('0x40')](_0x3e7f37,['value',_0x370518[_0xce98('0x3f')]])[_0xce98('0x41')];return db[_0xce98('0x42')][_0xce98('0x33')]({'where':{'type':_0x22f7ae,'resourceId':_0x370518['id']}})[_0xce98('0x1c')](function(){return _0x3f4235;});})[_0xce98('0x1c')](function(){_0x3d47da[_0xce98('0x28')](0xcc)[_0xce98('0x29')]();});}};}function handleEntityNotFound(_0x5fa01f,_0x4c82c3){return function(_0x163b2b){if(!_0x163b2b){_0x5fa01f[_0xce98('0x27')](0x194);}return _0x163b2b;};}function handleError(_0x258c8f,_0x427937){_0x427937=_0x427937||0x1f4;return function(_0x1c83df){logger[_0xce98('0x21')](_0x1c83df['stack']);if(_0x1c83df[_0xce98('0x41')]){delete _0x1c83df['name'];}_0x258c8f[_0xce98('0x28')](_0x427937)[_0xce98('0x43')](_0x1c83df);};}exports[_0xce98('0x44')]=function(_0x3516d6,_0x15d05a){var _0x47e500={},_0x3b47d4={},_0x5b375f={'count':0x0,'rows':[]};var _0x417370=db['User'][_0xce98('0x45')];_0x3b47d4[_0xce98('0x46')]=_[_0xce98('0x47')](_['keys'](_0x417370),[_0xce98('0x48'),_0xce98('0x49')]);_0x3b47d4[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x3516d6[_0xce98('0x4a')]);_0x3b47d4[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x3b47d4['model'],_0x3b47d4['query']);_0x47e500[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x3b47d4[_0xce98('0x46')],qs[_0xce98('0x4f')](_0x3516d6[_0xce98('0x4a')][_0xce98('0x4f')]));_0x47e500[_0xce98('0x4e')]=_0x47e500[_0xce98('0x4e')][_0xce98('0x50')]?_0x47e500[_0xce98('0x4e')]:_0x3b47d4[_0xce98('0x46')];if(!_0x3516d6[_0xce98('0x4a')]['hasOwnProperty'](_0xce98('0x51'))){_0x47e500[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x3516d6[_0xce98('0x4a')]['limit']);_0x47e500['offset']=qs[_0xce98('0x2c')](_0x3516d6['query'][_0xce98('0x2c')]);}_0x47e500[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x3516d6[_0xce98('0x4a')]['sort']);_0x47e500['where']=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x3516d6[_0xce98('0x4a')],_0x3b47d4[_0xce98('0x4c')]));if(_0x3516d6[_0xce98('0x4a')][_0xce98('0x3a')]){_0x47e500[_0xce98('0x55')]=_[_0xce98('0x56')](_0x47e500[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x417370,function(_0x4fb89d){return db[_0xce98('0x57')][_0xce98('0x55')](db[_0xce98('0x57')]['fn'](_0xce98('0x58'),db['sequelize'][_0xce98('0x59')](_0x4fb89d[_0xce98('0x5a')])),{'$like':db['sequelize']['fn'](_0xce98('0x58'),'%'+_0x3516d6['query'][_0xce98('0x3a')]+'%')});})});}_0x47e500=_[_0xce98('0x56')]({},_0x47e500,_0x3516d6[_0xce98('0x5b')]);var _0x4f5ac7={'where':_0x47e500[_0xce98('0x55')]};return db[_0xce98('0x5c')][_0xce98('0x2b')](_0x4f5ac7)[_0xce98('0x1c')](function(_0x3eaaa2){_0x5b375f[_0xce98('0x2b')]=_0x3eaaa2;if(_0x3516d6[_0xce98('0x4a')][_0xce98('0x5d')]){_0x47e500['include']=[{'all':!![]}];}return db['User']['findAll'](_0x47e500);})['then'](function(_0x417592){_0x5b375f[_0xce98('0x5e')]=_0x417592;return _0x5b375f;})[_0xce98('0x1c')](respondWithFilteredResult(_0x15d05a,_0x47e500))[_0xce98('0x26')](handleError(_0x15d05a,null));};exports['show']=function(_0x5ec45b,_0x37b515){var _0xbd63e2={'raw':![],'where':{'id':_0x5ec45b['params']['id']}},_0x12f17d={};_0x12f17d[_0xce98('0x46')]=_[_0xce98('0x47')](_['keys'](db[_0xce98('0x5c')]['rawAttributes']),[_0xce98('0x48'),_0xce98('0x49')]);_0x12f17d[_0xce98('0x4a')]=_['keys'](_0x5ec45b['query']);_0x12f17d[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x12f17d[_0xce98('0x46')],_0x12f17d[_0xce98('0x4a')]);_0xbd63e2['attributes']=_[_0xce98('0x4d')](_0x12f17d['model'],qs[_0xce98('0x4f')](_0x5ec45b[_0xce98('0x4a')][_0xce98('0x4f')]));_0xbd63e2['attributes']=_0xbd63e2[_0xce98('0x4e')][_0xce98('0x50')]?_0xbd63e2[_0xce98('0x4e')]:_0x12f17d[_0xce98('0x46')];if(_0x5ec45b[_0xce98('0x4a')]['includeAll']){_0xbd63e2[_0xce98('0x5f')]=[{'all':!![]}];}_0xbd63e2=_[_0xce98('0x56')]({},_0xbd63e2,_0x5ec45b['options']);return db[_0xce98('0x5c')]['find'](_0xbd63e2)[_0xce98('0x1c')](handleEntityNotFound(_0x37b515,null))[_0xce98('0x1c')](respondWithResult(_0x37b515,null))['catch'](handleError(_0x37b515,null));};exports[_0xce98('0x60')]=function(_0x4c87a9,_0xca44b2){return db['User'][_0xce98('0x60')](_0x4c87a9[_0xce98('0x61')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xca44b2,0xc9))[_0xce98('0x26')](handleError(_0xca44b2,null));};exports['update']=function(_0x482b81,_0x3ecb53){if(_0x482b81[_0xce98('0x61')]['id']){delete _0x482b81['body']['id'];}delete _0x482b81[_0xce98('0x61')][_0xce98('0x3f')];return db['User'][_0xce98('0x40')]({'where':{'id':_0x482b81[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x3ecb53,null))['then'](saveUpdates(_0x482b81[_0xce98('0x61')],null))[_0xce98('0x1c')](respondWithResult(_0x3ecb53,null))[_0xce98('0x26')](handleError(_0x3ecb53,null));};exports[_0xce98('0x63')]=function(_0xbcaa5e,_0x7c9d19){return db[_0xce98('0x5c')][_0xce98('0x63')]()['then'](respondWithResult(_0x7c9d19,null))[_0xce98('0x26')](handleError(_0x7c9d19,null));};exports['addContacts']=function(_0x810914,_0x2edf83,_0x48cd0c){return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x810914[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x2edf83,null))['then'](function(_0x4eee7b){if(_0x4eee7b){return _0x4eee7b['addContacts'](_0x810914[_0xce98('0x61')]['ids'],_['omit'](_0x810914[_0xce98('0x61')],[_0xce98('0x64'),'id'])||{});}})[_0xce98('0x1c')](respondWithResult(_0x2edf83,null))[_0xce98('0x26')](handleError(_0x2edf83,null));};var getLicense=function(_0xc57646){return new BPromise(function(_0x42f21b,_0x664a1c){var _0x39f0ad=0x0;_0xc57646[_0xce98('0x61')]['role']==='agent'&&_0x42f21b('agent\x20role');return db[_0xce98('0x5c')]['count']({'where':{'$or':[{'role':_0xc57646['body'][_0xce98('0x3f')]===_0xce98('0x39')?_0xce98('0x39'):[_0xce98('0x65'),_0xce98('0x35')]}]}})['then'](function(_0x467851){_0x39f0ad=_0x467851;return require('../../config/license/util')[_0xce98('0x66')]();})[_0xce98('0x1c')](function(_0x4113a7){var _0x22fcb0=_0xc57646[_0xce98('0x61')][_0xce98('0x3f')]===_0xce98('0x39')?'telephones':'users';if(!_[_0xce98('0x67')](_0x4113a7[_0x22fcb0])&&_0x39f0ad>=_0x4113a7[_0x22fcb0]){return _0x664a1c({'message':_0xce98('0x68')});}return _0x42f21b(util[_0xce98('0x69')](_0xce98('0x6a'),_0x22fcb0,_0x39f0ad));})['catch'](function(_0x5bd0f5){return _0x664a1c(_0x5bd0f5);});});};exports[_0xce98('0x6b')]=function(_0x18a8a0,_0x2961d1){return getLicense(_0x18a8a0)[_0xce98('0x1c')](function(_0x5aee9a){if(!_0x18a8a0['body'][_0xce98('0x6c')]){var _0x6c62fb;return db[_0xce98('0x6d')][_0xce98('0x6e')](0x1)['then'](function(_0x400ca4){_0x400ca4[_0xce98('0x6f')]=!![];return checkPasswordPattern(_0x400ca4,_0x18a8a0[_0xce98('0x61')][_0xce98('0x48')],_0x400ca4[_0xce98('0x6f')]);})[_0xce98('0x1c')](function(_0x500391){_0x6c62fb=_0x500391['min_internal'];return db[_0xce98('0x5c')][_0xce98('0x70')]('internal');})[_0xce98('0x1c')](function(_0x33e10c){if(_[_0xce98('0x67')](_0x33e10c)){if(_0x6c62fb){_0x18a8a0[_0xce98('0x61')][_0xce98('0x6c')]=_0x6c62fb;}else{_0x18a8a0[_0xce98('0x61')][_0xce98('0x6c')]=0x1;}}else{if(_[_0xce98('0x67')](_0x6c62fb)||_0x6c62fb==_0x33e10c){_0x18a8a0[_0xce98('0x61')]['internal']=_0x33e10c+0x1;}else if(_0x6c62fb>_0x33e10c){_0x18a8a0[_0xce98('0x61')]['internal']=_0x6c62fb;}else{return db[_0xce98('0x57')][_0xce98('0x4a')](_0xce98('0x71'),{'type':db['sequelize'][_0xce98('0x72')][_0xce98('0x73')]})[_0xce98('0x1c')](function(_0x18b0cd){if(_0x18b0cd&&_0x18b0cd[_0xce98('0x50')]){for(var _0x5f2b5e=0x0,_0x47a541=_0x18b0cd['length'];_0x5f2b5e<_0x47a541&&_['isNil'](_0x18a8a0[_0xce98('0x61')]['internal']);_0x5f2b5e++){if(_0x6c62fb<=_0x18b0cd[_0x5f2b5e][_0xce98('0x74')]){_0x18a8a0[_0xce98('0x61')][_0xce98('0x6c')]=_0x18b0cd[_0x5f2b5e][_0xce98('0x74')];}else if(_0x6c62fb>_0x18b0cd[_0x5f2b5e][_0xce98('0x74')]&&_0x6c62fb<=_0x18b0cd[_0x5f2b5e]['to']){_0x18a8a0['body'][_0xce98('0x6c')]=_0x6c62fb;}}}if(_[_0xce98('0x67')](_0x18a8a0[_0xce98('0x61')]['internal'])){_0x18a8a0[_0xce98('0x61')][_0xce98('0x6c')]=_0x33e10c+0x1;}});}}});}})[_0xce98('0x1c')](function(){if(_0x18a8a0[_0xce98('0x61')][_0xce98('0x75')]){_0x18a8a0[_0xce98('0x61')][_0xce98('0x76')]=_0x18a8a0[_0xce98('0x61')][_0xce98('0x6c')];_0x18a8a0['body'][_0xce98('0x77')]={'mailbox':_0x18a8a0[_0xce98('0x61')]['internal'],'password':_0x18a8a0[_0xce98('0x61')][_0xce98('0x48')],'fullname':_0x18a8a0['body'][_0xce98('0x78')],'email':_0x18a8a0[_0xce98('0x61')][_0xce98('0x79')]};}if(_0x18a8a0['body']&&_0x18a8a0[_0xce98('0x61')]['role']===_0xce98('0x37')){_0x18a8a0['body'][_0xce98('0x7a')]=[_0xce98('0x7b'),'102',_0xce98('0x7c'),'110',_0xce98('0x7d'),_0xce98('0x7e'),_0xce98('0x7f'),_0xce98('0x80'),_0xce98('0x81'),_0xce98('0x82'),'100','111'];}return db[_0xce98('0x5c')]['create'](_0x18a8a0[_0xce98('0x61')],{'include':[{'model':db[_0xce98('0x77')],'as':_0xce98('0x77')}]});})[_0xce98('0x1c')](function(_0xdf3e29){if(_0x18a8a0['body'][_0xce98('0x3f')]==='user')return _0xdf3e29;var _0x1e48c4=_0x18a8a0[_0xce98('0x35')][_0xce98('0x34')]({'plain':!![]});if(!_0x1e48c4)throw new Error(_0xce98('0x83'));if(_0x1e48c4[_0xce98('0x3f')]==='user'){var _0x384056=_0xdf3e29[_0xce98('0x34')]({'plain':!![]});var _0x368c1a=[{'name':_0xce98('0x36'),'value':_0xce98('0x37')},{'name':_0xce98('0x38'),'value':'telephone'}];var _0xf3ea74=_[_0xce98('0x40')](_0x368c1a,[_0xce98('0x3d'),_0x384056[_0xce98('0x3f')]])[_0xce98('0x41')];return db['UserProfileSection'][_0xce98('0x40')]({'where':{'name':_0xf3ea74,'userProfileId':_0x1e48c4[_0xce98('0x84')]},'raw':!![]})[_0xce98('0x1c')](function(_0x5a6575){if(_0x5a6575&&_0x5a6575[_0xce98('0x85')]===0x0){return db['UserProfileResource'][_0xce98('0x6b')]({'name':_0x384056['name'],'resourceId':_0x384056['id'],'type':_0x5a6575['name'],'sectionId':_0x5a6575['id']},{})[_0xce98('0x1c')](function(){return _0xdf3e29;});}else{return _0xdf3e29;}})[_0xce98('0x26')](function(_0xc9fce9){logger[_0xce98('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc9fce9);throw _0xc9fce9;});}return _0xdf3e29;})['then'](respondWithResult(_0x2961d1,0xc9))['catch'](handleError(_0x2961d1,null));};exports[_0xce98('0x86')]=function(_0x3c184c,_0x179306,_0x5500f7){var _0x17c4a5=![];if(_0x3c184c['body']['id']){delete _0x3c184c['body']['id'];}if(!_[_0xce98('0x67')](_0x3c184c['body']['oldPassword'])){if(_0x3c184c['body'][_0xce98('0x87')]===_0x3c184c[_0xce98('0x61')][_0xce98('0x88')]){throw new Error(_0xce98('0x89'));}}return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x3c184c[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](function(_0x2cc992){if(_0x2cc992){if(_0x2cc992['id']==_0x3c184c[_0xce98('0x35')]['id']){if(!_0x3c184c[_0xce98('0x61')][_0xce98('0x87')]||!_0x3c184c[_0xce98('0x61')][_0xce98('0x88')]){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))](_0xce98('0x8c'));}if(!_0x2cc992[_0xce98('0x8d')](_0x3c184c[_0xce98('0x61')][_0xce98('0x87')])){throw new db[(_0xce98('0x8a'))]['ValidationError'](_0xce98('0x8e'));}if(_0x3c184c['body'][_0xce98('0x87')]==_0x3c184c['body'][_0xce98('0x88')]){throw new db['Sequelize'][(_0xce98('0x8b'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x2cc992;}else if(_0x3c184c[_0xce98('0x35')]['role']==_0xce98('0x65')){if(!_0x3c184c['body'][_0xce98('0x88')]){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))](_0xce98('0x8f'));}return _0x2cc992;}else if(_0x3c184c[_0xce98('0x35')][_0xce98('0x3f')]==_0xce98('0x35')){if(!_0x3c184c[_0xce98('0x61')][_0xce98('0x88')]){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2cc992['role']!='agent'){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))](_0xce98('0x90'));}return _0x2cc992;}else{throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))]('Unauthorized');}}return null;})[_0xce98('0x1c')](handleEntityNotFound(_0x179306,null))[_0xce98('0x1c')](function(_0x214fe8){return db['Setting'][_0xce98('0x91')]({'attributes':['id','securePassword']})[_0xce98('0x1c')](function(_0xa34616){_0x17c4a5=_0xa34616[_0xce98('0x6f')];return checkPasswordPattern(_0x214fe8,_0x3c184c['body']['newPassword'],_0x17c4a5);});})[_0xce98('0x1c')](saveUpdates({'password':_0x3c184c[_0xce98('0x61')][_0xce98('0x88')],'passwordResetAt':_0x3c184c[_0xce98('0x35')]['id']==_0x3c184c[_0xce98('0x62')]['id']?moment():null},null))[_0xce98('0x1c')](respondWithResult(_0x179306,null))['catch'](handleError(_0x179306,null));};exports['addQueues']=function(_0x2c4f93,_0xbd31e5,_0xdbe826){var _0x58e61d=_0x2c4f93[_0xce98('0x61')]['channel'];return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x2c4f93[_0xce98('0x62')]['id']},'attributes':['id',_0xce98('0x41'),'role','online',_0xce98('0x92'),'voicePause',_0xce98('0x93')]})[_0xce98('0x1c')](handleEntityNotFound(_0xbd31e5,null))[_0xce98('0x1c')](function(_0x31016c){if(_0x31016c){if(!utils[_0xce98('0x94')](_0x58e61d)){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))](_0xce98('0x95'));}return _0x31016c[_0xce98('0x96')+_[_0xce98('0x97')](_0x58e61d[_0xce98('0x98')]())+_0xce98('0x99')](_0x2c4f93['body']['ids'],{'penalty':_0x2c4f93[_0xce98('0x61')][_0xce98('0x9a')]||0x0})[_0xce98('0x9b')](function(_0x24df02){for(var _0x20e183=0x0;_0x20e183<_0x2c4f93[_0xce98('0x61')][_0xce98('0x64')][_0xce98('0x50')];_0x20e183+=0x1){var _0x1b5d17={'UserId':_0x2c4f93[_0xce98('0x62')]['id']};_0x1b5d17[_[_0xce98('0x97')](_0x58e61d['toLowerCase']())+_0xce98('0x9c')]=_0x2c4f93[_0xce98('0x61')][_0xce98('0x64')][_0x20e183];socket[_0xce98('0x9d')](_0xce98('0x35')+_[_0xce98('0x97')](_0x58e61d[_0xce98('0x98')]())+_0xce98('0x9e'),_0x1b5d17);}return _0x24df02;})[_0xce98('0x1c')](function(){if(_0x58e61d===_0xce98('0x9f')){return db[_0xce98('0xa0')]['findAll']({'where':{'id':_0x2c4f93[_0xce98('0x61')]['ids']||[]},'raw':!![],'attributes':['id',_0xce98('0x41')]});}})[_0xce98('0x1c')](function(_0x1183a6){var _0x327e2c=_0x31016c[_0xce98('0x34')]({'plain':!![]});var _0x141ab3=[];if(_0x58e61d===_0xce98('0x9f')&&_0x327e2c[_0xce98('0x3f')]==='agent'&&_0x327e2c[_0xce98('0xa1')]){for(var _0xd6915c=0x0;_0xd6915c<_0x1183a6[_0xce98('0x50')];_0xd6915c+=0x1){_0x141ab3[_0xce98('0xa2')]({'membername':_0x327e2c['name'],'UserId':_0x327e2c['id'],'queue_name':_0x1183a6[_0xd6915c]['name'],'VoiceQueueId':_0x1183a6[_0xd6915c]['id'],'interface':_['isNil'](_0x327e2c['interface'])?util[_0xce98('0x69')](_0xce98('0xa3'),_0x327e2c[_0xce98('0x41')]):_0x327e2c['interface'],'paused':_0x327e2c[_0xce98('0xa4')]||![],'penalty':_0x2c4f93[_0xce98('0x61')][_0xce98('0x9a')]||0x0});}return BPromise[_0xce98('0xa5')](_0x141ab3,function(_0x39aec5){return db['UserVoiceQueueRt'][_0xce98('0xa6')](_0x39aec5);});}return _0x31016c;});}})[_0xce98('0x1c')](respondWithStatusCode(_0xbd31e5,null))['catch'](handleError(_0xbd31e5,null));};exports['removeQueues']=function(_0x4017dd,_0x3e3d51,_0x3c3663){var _0x59f413;return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x4017dd[_0xce98('0x62')]['id']},'attributes':['id',_0xce98('0x41'),'role']})[_0xce98('0x1c')](handleEntityNotFound(_0x3e3d51,null))['then'](function(_0x2eca04){if(_0x2eca04){_0x59f413=_0x2eca04;if(!_0x4017dd[_0xce98('0x4a')][_0xce98('0xa7')]||!utils[_0xce98('0x94')](_0x4017dd['query'][_0xce98('0xa7')])){throw new db['Sequelize'][(_0xce98('0x8b'))](_0xce98('0x95'));}return _0x2eca04[_0xce98('0xa8')+_['capitalize'](_0x4017dd['query'][_0xce98('0xa7')]['toLowerCase']())+_0xce98('0x99')](_0x4017dd[_0xce98('0x4a')][_0xce98('0x64')]);}})['then'](function(_0x559a3b){for(var _0x10fa14=0x0;_0x10fa14<_0x4017dd[_0xce98('0x4a')][_0xce98('0x64')][_0xce98('0x50')];_0x10fa14+=0x1){var _0x16bc80={'UserId':_0x4017dd['params']['id']};_0x16bc80[_[_0xce98('0x97')](_0x4017dd[_0xce98('0x4a')]['channel']['toLowerCase']())+_0xce98('0x9c')]=_0x4017dd[_0xce98('0x4a')][_0xce98('0x64')][_0x10fa14];socket['emit']('user'+_[_0xce98('0x97')](_0x4017dd[_0xce98('0x4a')][_0xce98('0xa7')]['toLowerCase']())+_0xce98('0xa9'),_0x16bc80);}return _0x559a3b;})[_0xce98('0x1c')](function(){if(_0x4017dd['query'][_0xce98('0xa7')]==='voice'){return db[_0xce98('0xaa')][_0xce98('0x33')]({'where':{'UserId':_0x4017dd[_0xce98('0x62')]['id'],'VoiceQueueId':_0x4017dd[_0xce98('0x4a')][_0xce98('0x64')]},'individualHooks':!![]})[_0xce98('0x1c')](function(){return _0x59f413;});}return _0x59f413;})['then'](respondWithStatusCode(_0x3e3d51,null))[_0xce98('0x26')](handleError(_0x3e3d51,null));};exports[_0xce98('0xab')]=function(_0xb95c51,_0x379a0c,_0x1eb77a){_0xb95c51['body'][_0xce98('0xac')]=_0xb95c51[_0xce98('0xad')][_0xce98('0xae')];return db['User'][_0xce98('0x40')]({'where':{'id':_0xb95c51[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x379a0c,null))['then'](saveUpdates(_0xb95c51[_0xce98('0x61')],null))[_0xce98('0x1c')](respondWithResult(_0x379a0c,null))[_0xce98('0x26')](handleError(_0x379a0c,null));};exports[_0xce98('0xaf')]=function(_0x548e56,_0x57fc78,_0x30af89){var _0x3b0624=path[_0xce98('0xb0')](config[_0xce98('0xb1')],_0xce98('0xb2'));return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x548e56['params']['id']},'attributes':['id',_0xce98('0xac')],'raw':!![]})[_0xce98('0x1c')](handleEntityNotFound(_0x57fc78,null))[_0xce98('0x1c')](function(_0x2c5ed6){if(_0x2c5ed6){if(_['isNil'](_0x2c5ed6[_0xce98('0xac')])){return _0x57fc78[_0xce98('0xb3')](_0x3b0624);}else{if(!fs[_0xce98('0xb4')](path[_0xce98('0xb0')](config[_0xce98('0xb1')],'server/files/images/',_0x2c5ed6[_0xce98('0xac')]))){return _0x57fc78[_0xce98('0xb3')](_0x3b0624);}return _0x57fc78[_0xce98('0xb3')](path[_0xce98('0xb0')](config[_0xce98('0xb1')],_0xce98('0xb5'),_0x2c5ed6[_0xce98('0xac')]));}}})[_0xce98('0x26')](handleError(_0x57fc78,null));};exports[_0xce98('0xb6')]=function(_0x2b1f82,_0x4641c3,_0x46306e){var _0x56ee9e={};var _0x162a58={};var _0x459643;var _0x241176;return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0x2b1f82['params']['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x4641c3,null))[_0xce98('0x1c')](function(_0x572b50){if(_0x572b50){_0x459643=_0x572b50;_0x162a58[_0xce98('0x46')]=_[_0xce98('0x4b')](db['CmContact'][_0xce98('0x45')]);_0x162a58[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x2b1f82[_0xce98('0x4a')]);_0x162a58[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x162a58[_0xce98('0x46')],_0x162a58['query']);_0x56ee9e['attributes']=_['intersection'](_0x162a58[_0xce98('0x46')],qs[_0xce98('0x4f')](_0x2b1f82[_0xce98('0x4a')][_0xce98('0x4f')]));_0x56ee9e['attributes']=_0x56ee9e[_0xce98('0x4e')][_0xce98('0x50')]?_0x56ee9e[_0xce98('0x4e')]:_0x162a58[_0xce98('0x46')];_0x56ee9e[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x2b1f82[_0xce98('0x4a')][_0xce98('0x53')]);_0x56ee9e[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x2b1f82[_0xce98('0x4a')],_0x162a58[_0xce98('0x4c')]));if(_0x2b1f82['query']['filter']){_0x56ee9e[_0xce98('0x55')]=_[_0xce98('0x56')](_0x56ee9e[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x56ee9e['attributes'],function(_0x266735){var _0xad64cb={};_0xad64cb[_0x266735]={'$like':'%'+_0x2b1f82[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0xad64cb;})});}_0x56ee9e=_[_0xce98('0x56')]({},_0x56ee9e,_0x2b1f82[_0xce98('0x5b')]);return _0x459643[_0xce98('0xb6')](_0x56ee9e);}})[_0xce98('0x1c')](function(_0x4ee52c){if(_0x4ee52c){_0x241176=_0x4ee52c[_0xce98('0x50')];if(_0x2b1f82[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x5d'))){_0x56ee9e[_0xce98('0x5f')]=[{'model':db[_0xce98('0xb8')],'as':_0xce98('0xb9'),'required':![]},{'model':db['Tag'],'as':_0xce98('0xba'),'attributes':['id','name',_0xce98('0xbb')],'where':_0x2b1f82['query']['tag']?{'id':_0x2b1f82['query']['tag']}:undefined,'required':_0x2b1f82[_0xce98('0x4a')][_0xce98('0xbc')]?!![]:![]}];}if(!_0x2b1f82['query']['hasOwnProperty'](_0xce98('0x51'))){_0x56ee9e['limit']=qs[_0xce98('0x2d')](_0x2b1f82[_0xce98('0x4a')][_0xce98('0x2d')]);_0x56ee9e[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x2b1f82[_0xce98('0x4a')][_0xce98('0x2c')]);}return _0x459643['getContacts'](_0x56ee9e);}})[_0xce98('0x1c')](function(_0x118de3){if(_0x118de3){return _0x118de3?{'count':_0x241176,'rows':_0x118de3}:null;}})['then'](respondWithResult(_0x4641c3,null))[_0xce98('0x26')](handleError(_0x4641c3,null));};exports[_0xce98('0xbd')]=function(_0x54fe0f,_0x986adf,_0x517b71){var _0x59c620;var _0x23c13b;var _0x362edf={};var _0x3f28ee;return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0x54fe0f[_0xce98('0x62')]['id']},'attributes':['id',_0xce98('0x41'),_0xce98('0x3f')]})[_0xce98('0x1c')](handleEntityNotFound(_0x986adf,null))['then'](function(_0x27e3d0){if(!utils['isValidChannel'](_0x54fe0f[_0xce98('0x4a')][_0xce98('0xa7')])){throw new db[(_0xce98('0x8a'))]['ValidationError'](_0xce98('0x95'));}_0x59c620=_0x27e3d0;var _0x58e356={};_0x58e356[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_[_0xce98('0x97')](_0x54fe0f['query'][_0xce98('0xa7')])+'Queue'][_0xce98('0x45')]);_0x58e356[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x54fe0f['query']);_0x58e356[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x58e356['model'],_0x58e356['query']);_0x362edf[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x58e356[_0xce98('0x46')],qs[_0xce98('0x4f')](_0x54fe0f['query'][_0xce98('0x4f')]));_0x362edf[_0xce98('0x4e')]=_0x362edf['attributes'][_0xce98('0x50')]?_0x362edf[_0xce98('0x4e')]:_0x58e356[_0xce98('0x46')];_0x362edf['order']=qs[_0xce98('0x53')](_0x54fe0f['query'][_0xce98('0x53')]);_0x362edf[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x54fe0f[_0xce98('0x4a')],_0x58e356[_0xce98('0x4c')]));if(_0x54fe0f[_0xce98('0x4a')][_0xce98('0x3a')]){_0x362edf[_0xce98('0x55')]=_[_0xce98('0x56')](_0x362edf[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x362edf['attributes'],function(_0x1694a6){var _0x1c360f={};_0x1c360f[_0x1694a6]={'$like':'%'+_0x54fe0f[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x1c360f;})});}_0x362edf=_[_0xce98('0x56')]({},_0x362edf,_0x54fe0f[_0xce98('0x5b')]);switch(_0x59c620[_0xce98('0x3f')]){case _0xce98('0x65'):return db[_[_0xce98('0x97')](_0x54fe0f[_0xce98('0x4a')]['channel'])+'Queue'][_0xce98('0xbe')](_0x362edf);case _0xce98('0x35'):case'agent':return _0x59c620[_0xce98('0x34')+_[_0xce98('0x97')](_0x54fe0f[_0xce98('0x4a')]['channel'])+_0xce98('0x99')](_0x362edf);default:throw new db[(_0xce98('0x8a'))]['ValidationError'](_0xce98('0xbf'));}})[_0xce98('0x1c')](function(_0x28cb1c){_0x3f28ee=_0x28cb1c[_0xce98('0x50')];if(!_0x54fe0f[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x362edf['limit']=qs[_0xce98('0x2d')](_0x54fe0f[_0xce98('0x4a')][_0xce98('0x2d')]);_0x362edf[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x54fe0f['query'][_0xce98('0x2c')]);}switch(_0x59c620['role']){case _0xce98('0x65'):return db[_['capitalize'](_0x54fe0f[_0xce98('0x4a')][_0xce98('0xa7')])+'Queue']['findAll'](_0x362edf);case'user':case _0xce98('0x37'):return _0x59c620[_0xce98('0x34')+_[_0xce98('0x97')](_0x54fe0f[_0xce98('0x4a')]['channel'])+_0xce98('0x99')](_0x362edf);}})[_0xce98('0x1c')](function(_0x1d35d0){return{'count':_0x3f28ee,'rows':_0x1d35d0};})[_0xce98('0x1c')](respondWithResult(_0x986adf,null))[_0xce98('0x26')](handleError(_0x986adf,null));};exports[_0xce98('0xc0')]=function(_0x4181d9,_0x1a82f7,_0x31c057){var _0x17d17d={};var _0x3ba292={};var _0x3ac736;var _0x266d10;return db[_0xce98('0x5c')]['findOne']({'where':{'id':_0x4181d9['params']['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x1a82f7,null))['then'](function(_0x26e429){if(_0x26e429){_0x3ac736=_0x26e429;_0x3ba292[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xaa')][_0xce98('0x45')]);_0x3ba292[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x4181d9[_0xce98('0x4a')]);_0x3ba292[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x3ba292[_0xce98('0x46')],_0x3ba292[_0xce98('0x4a')]);_0x17d17d[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x3ba292[_0xce98('0x46')],qs[_0xce98('0x4f')](_0x4181d9[_0xce98('0x4a')][_0xce98('0x4f')]));_0x17d17d['attributes']=_0x17d17d[_0xce98('0x4e')][_0xce98('0x50')]?_0x17d17d[_0xce98('0x4e')]:_0x3ba292['model'];_0x17d17d[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x4181d9[_0xce98('0x4a')][_0xce98('0x53')]);_0x17d17d[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x4181d9[_0xce98('0x4a')],_0x3ba292['filters']));if(_0x4181d9[_0xce98('0x4a')][_0xce98('0x3a')]){_0x17d17d[_0xce98('0x55')]=_['merge'](_0x17d17d[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x17d17d['attributes'],function(_0x183c3d){var _0xc9c2cd={};_0xc9c2cd[_0x183c3d]={'$like':'%'+_0x4181d9[_0xce98('0x4a')]['filter']+'%'};return _0xc9c2cd;})});}_0x17d17d=_[_0xce98('0x56')]({},_0x17d17d,_0x4181d9['options']);return _0x3ac736[_0xce98('0xc0')](_0x17d17d);}})['then'](function(_0x29c52d){if(_0x29c52d){_0x266d10=_0x29c52d[_0xce98('0x50')];if(!_0x4181d9['query'][_0xce98('0xb7')](_0xce98('0x51'))){_0x17d17d[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x4181d9[_0xce98('0x4a')][_0xce98('0x2d')]);_0x17d17d[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x4181d9[_0xce98('0x4a')]['offset']);}return _0x3ac736['getVoiceQueuesRt'](_0x17d17d);}})['then'](function(_0x2b1b1a){if(_0x2b1b1a){return _0x2b1b1a?{'count':_0x266d10,'rows':_0x2b1b1a}:null;}})[_0xce98('0x1c')](respondWithResult(_0x1a82f7,null))[_0xce98('0x26')](handleError(_0x1a82f7,null));};exports['getGroups']=function(_0xa497c0,_0x3d815a,_0x2b7ce2){var _0x464728={};var _0x525cb1={};var _0x3796da;var _0x3bca87;return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0xa497c0[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x3d815a,null))[_0xce98('0x1c')](function(_0x187919){if(_0x187919){_0x3796da=_0x187919;_0x525cb1[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xc1')][_0xce98('0x45')]);_0x525cb1[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0xa497c0[_0xce98('0x4a')]);_0x525cb1['filters']=_[_0xce98('0x4d')](_0x525cb1['model'],_0x525cb1['query']);_0x464728[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x525cb1['model'],qs[_0xce98('0x4f')](_0xa497c0[_0xce98('0x4a')][_0xce98('0x4f')]));_0x464728['attributes']=_0x464728[_0xce98('0x4e')][_0xce98('0x50')]?_0x464728[_0xce98('0x4e')]:_0x525cb1[_0xce98('0x46')];_0x464728[_0xce98('0x52')]=qs['sort'](_0xa497c0['query'][_0xce98('0x53')]);_0x464728['where']=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0xa497c0[_0xce98('0x4a')],_0x525cb1[_0xce98('0x4c')]));if(_0xa497c0['query']['filter']){_0x464728[_0xce98('0x55')]=_['merge'](_0x464728['where'],{'$or':_[_0xce98('0x3c')](_0x464728[_0xce98('0x4e')],function(_0x22bb1e){var _0x389061={};_0x389061[_0x22bb1e]={'$like':'%'+_0xa497c0[_0xce98('0x4a')]['filter']+'%'};return _0x389061;})});}_0x464728=_[_0xce98('0x56')]({},_0x464728,_0xa497c0[_0xce98('0x5b')]);return _0x3796da[_0xce98('0xc2')](_0x464728);}})[_0xce98('0x1c')](function(_0x47abf2){if(_0x47abf2){_0x3bca87=_0x47abf2[_0xce98('0x50')];if(!_0xa497c0[_0xce98('0x4a')]['hasOwnProperty'](_0xce98('0x51'))){_0x464728['limit']=qs[_0xce98('0x2d')](_0xa497c0[_0xce98('0x4a')][_0xce98('0x2d')]);_0x464728['offset']=qs['offset'](_0xa497c0[_0xce98('0x4a')]['offset']);}return _0x3796da[_0xce98('0xc2')](_0x464728);}})[_0xce98('0x1c')](function(_0x53d17a){if(_0x53d17a){return _0x53d17a?{'count':_0x3bca87,'rows':_0x53d17a}:null;}})['then'](respondWithResult(_0x3d815a,null))[_0xce98('0x26')](handleError(_0x3d815a,null));};exports[_0xce98('0xc3')]=function(_0x1b4b93,_0x48f31a,_0x4257a2){var _0xe2801c={'raw':!![],'where':{}};var _0x5a8097={};var _0x42f872={'count':0x0,'rows':[]};return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0x1b4b93[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x48f31a,null))[_0xce98('0x1c')](function(_0xb4612f){if(_0xb4612f){_0x5a8097[_0xce98('0x46')]=_[_0xce98('0x4b')](db['VoiceRecording'][_0xce98('0x45')]);_0x5a8097[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x1b4b93[_0xce98('0x4a')]);_0x5a8097[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x5a8097['model'],_0x5a8097['query']);_0xe2801c['attributes']=_['intersection'](_0x5a8097[_0xce98('0x46')],qs['fields'](_0x1b4b93[_0xce98('0x4a')][_0xce98('0x4f')]));_0xe2801c[_0xce98('0x4e')]=_0xe2801c['attributes'][_0xce98('0x50')]?_0xe2801c[_0xce98('0x4e')]:_0x5a8097['model'];if(!_0x1b4b93[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0xe2801c[_0xce98('0x2d')]=qs['limit'](_0x1b4b93[_0xce98('0x4a')][_0xce98('0x2d')]);_0xe2801c[_0xce98('0x2c')]=qs['offset'](_0x1b4b93[_0xce98('0x4a')][_0xce98('0x2c')]);}_0xe2801c['order']=qs[_0xce98('0x53')](_0x1b4b93[_0xce98('0x4a')]['sort']);_0xe2801c[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x1b4b93[_0xce98('0x4a')],_0x5a8097[_0xce98('0x4c')]));_0xe2801c[_0xce98('0x55')][_0xce98('0xc4')]=_0xb4612f['id'];if(_0x1b4b93['query'][_0xce98('0x3a')]){_0xe2801c['where']=_['merge'](_0xe2801c[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0xe2801c[_0xce98('0x4e')],function(_0x5d1cd7){var _0x130b1a={};_0x130b1a[_0x5d1cd7]={'$like':'%'+_0x1b4b93[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x130b1a;})});}_0xe2801c=_[_0xce98('0x56')]({},_0xe2801c,_0x1b4b93[_0xce98('0x5b')]);return db['VoiceRecording']['count']({'where':_0xe2801c[_0xce98('0x55')]})[_0xce98('0x1c')](function(_0xc9417a){_0x42f872[_0xce98('0x2b')]=_0xc9417a;if(_0x1b4b93[_0xce98('0x4a')][_0xce98('0x5d')]){_0xe2801c[_0xce98('0x5f')]=[{'all':!![]}];}return db[_0xce98('0xc5')][_0xce98('0xbe')](_0xe2801c);})['then'](function(_0x420c21){_0x42f872['rows']=_0x420c21;return _0x42f872;});}})['then'](respondWithFilteredResult(_0x48f31a,_0xe2801c))['catch'](handleError(_0x48f31a,null));};exports[_0xce98('0xc6')]=function(_0x583cbe,_0x301913,_0x546831){var _0xb752c3={'raw':!![],'where':{}};var _0x24adca={};var _0x1dcbd8={'count':0x0,'rows':[]};return db['User'][_0xce98('0x91')]({'where':{'id':_0x583cbe['params']['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x301913,null))['then'](function(_0x2817a6){if(_0x2817a6){_0x24adca[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xc7')][_0xce98('0x45')]);_0x24adca['query']=_[_0xce98('0x4b')](_0x583cbe[_0xce98('0x4a')]);_0x24adca[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x24adca[_0xce98('0x46')],_0x24adca[_0xce98('0x4a')]);_0xb752c3[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x24adca['model'],qs[_0xce98('0x4f')](_0x583cbe[_0xce98('0x4a')]['fields']));_0xb752c3[_0xce98('0x4e')]=_0xb752c3[_0xce98('0x4e')]['length']?_0xb752c3[_0xce98('0x4e')]:_0x24adca['model'];if(!_0x583cbe[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0xb752c3[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x583cbe['query']['limit']);_0xb752c3[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x583cbe[_0xce98('0x4a')]['offset']);}_0xb752c3['order']=qs['sort'](_0x583cbe[_0xce98('0x4a')][_0xce98('0x53')]);_0xb752c3[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x583cbe[_0xce98('0x4a')],_0x24adca['filters']));_0xb752c3[_0xce98('0x55')][_0xce98('0xc4')]=_0x2817a6['id'];if(_0x583cbe['query'][_0xce98('0x3a')]){_0xb752c3[_0xce98('0x55')]=_['merge'](_0xb752c3[_0xce98('0x55')],{'$or':_['map'](_0xb752c3['attributes'],function(_0x1ae8a7){var _0x524298={};_0x524298[_0x1ae8a7]={'$like':'%'+_0x583cbe['query'][_0xce98('0x3a')]+'%'};return _0x524298;})});}_0xb752c3=_[_0xce98('0x56')]({},_0xb752c3,_0x583cbe[_0xce98('0x5b')]);return db[_0xce98('0xc7')][_0xce98('0x2b')]({'where':_0xb752c3[_0xce98('0x55')]})[_0xce98('0x1c')](function(_0x4071ee){_0x1dcbd8['count']=_0x4071ee;if(_0x583cbe['query'][_0xce98('0x5d')]){_0xb752c3[_0xce98('0x5f')]=[{'all':!![]}];}return db['ScreenRecording'][_0xce98('0xbe')](_0xb752c3);})[_0xce98('0x1c')](function(_0x344595){_0x1dcbd8['rows']=_0x344595;return _0x1dcbd8;});}})[_0xce98('0x1c')](respondWithFilteredResult(_0x301913,_0xb752c3))[_0xce98('0x26')](handleError(_0x301913,null));};exports['getChatInteractions']=function(_0xb20533,_0x3b5460,_0x5dc574){var _0x5edc2d={};var _0x3c478d={};var _0x1aed70;var _0x14f00d;return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0xb20533[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x3b5460,null))[_0xce98('0x1c')](function(_0x1ece54){if(_0x1ece54){_0x1aed70=_0x1ece54;_0x3c478d[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xc8')]['rawAttributes']);_0x3c478d[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0xb20533[_0xce98('0x4a')]);_0x3c478d['filters']=_[_0xce98('0x4d')](_0x3c478d[_0xce98('0x46')],_0x3c478d[_0xce98('0x4a')]);_0x5edc2d[_0xce98('0x4e')]=_['intersection'](_0x3c478d[_0xce98('0x46')],qs[_0xce98('0x4f')](_0xb20533['query'][_0xce98('0x4f')]));_0x5edc2d[_0xce98('0x4e')]=_0x5edc2d[_0xce98('0x4e')][_0xce98('0x50')]?_0x5edc2d[_0xce98('0x4e')]:_0x3c478d['model'];_0x5edc2d[_0xce98('0x52')]=qs[_0xce98('0x53')](_0xb20533['query']['sort']);_0x5edc2d['where']=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0xb20533[_0xce98('0x4a')],_0x3c478d['filters']));if(_0xb20533[_0xce98('0x4a')][_0xce98('0x3a')]){_0x5edc2d['where']=_['merge'](_0x5edc2d[_0xce98('0x55')],{'$or':_['map'](_0x5edc2d[_0xce98('0x4e')],function(_0x21253f){var _0x200f70={};_0x200f70[_0x21253f]={'$like':'%'+_0xb20533[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x200f70;})});}_0x5edc2d=_[_0xce98('0x56')]({},_0x5edc2d,_0xb20533[_0xce98('0x5b')]);return _0x1aed70[_0xce98('0xc9')](_0x5edc2d);}})['then'](function(_0x24deff){if(_0x24deff){_0x14f00d=_0x24deff['length'];if(!_0xb20533[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x5edc2d[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0xb20533[_0xce98('0x4a')][_0xce98('0x2d')]);_0x5edc2d[_0xce98('0x2c')]=qs['offset'](_0xb20533['query'][_0xce98('0x2c')]);}return _0x1aed70[_0xce98('0xc9')](_0x5edc2d);}})[_0xce98('0x1c')](function(_0x41a3f6){if(_0x41a3f6){return _0x41a3f6?{'count':_0x14f00d,'rows':_0x41a3f6}:null;}})[_0xce98('0x1c')](respondWithResult(_0x3b5460,null))[_0xce98('0x26')](handleError(_0x3b5460,null));};exports['getOpenchannelInteractions']=function(_0xe2a2cd,_0x45d6cf,_0x36adbb){var _0x31f6d2={};var _0x12d7e3={};var _0x33b255;var _0x251f6c;return db['User'][_0xce98('0x91')]({'where':{'id':_0xe2a2cd[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x45d6cf,null))[_0xce98('0x1c')](function(_0x468cd1){if(_0x468cd1){_0x33b255=_0x468cd1;_0x12d7e3[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xca')][_0xce98('0x45')]);_0x12d7e3[_0xce98('0x4a')]=_['keys'](_0xe2a2cd[_0xce98('0x4a')]);_0x12d7e3[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x12d7e3[_0xce98('0x46')],_0x12d7e3['query']);_0x31f6d2[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x12d7e3[_0xce98('0x46')],qs[_0xce98('0x4f')](_0xe2a2cd[_0xce98('0x4a')][_0xce98('0x4f')]));_0x31f6d2[_0xce98('0x4e')]=_0x31f6d2[_0xce98('0x4e')]['length']?_0x31f6d2[_0xce98('0x4e')]:_0x12d7e3[_0xce98('0x46')];_0x31f6d2[_0xce98('0x52')]=qs[_0xce98('0x53')](_0xe2a2cd['query']['sort']);_0x31f6d2[_0xce98('0x55')]=qs['filters'](_[_0xce98('0x54')](_0xe2a2cd[_0xce98('0x4a')],_0x12d7e3['filters']));if(_0xe2a2cd[_0xce98('0x4a')][_0xce98('0x3a')]){_0x31f6d2[_0xce98('0x55')]=_['merge'](_0x31f6d2[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x31f6d2[_0xce98('0x4e')],function(_0x283613){var _0x11df98={};_0x11df98[_0x283613]={'$like':'%'+_0xe2a2cd[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x11df98;})});}_0x31f6d2=_[_0xce98('0x56')]({},_0x31f6d2,_0xe2a2cd[_0xce98('0x5b')]);return _0x33b255[_0xce98('0xcb')](_0x31f6d2);}})[_0xce98('0x1c')](function(_0x2c8ac9){if(_0x2c8ac9){_0x251f6c=_0x2c8ac9[_0xce98('0x50')];if(!_0xe2a2cd[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x31f6d2[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0xe2a2cd['query']['limit']);_0x31f6d2[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0xe2a2cd[_0xce98('0x4a')][_0xce98('0x2c')]);}return _0x33b255[_0xce98('0xcb')](_0x31f6d2);}})[_0xce98('0x1c')](function(_0x5a1d6c){if(_0x5a1d6c){return _0x5a1d6c?{'count':_0x251f6c,'rows':_0x5a1d6c}:null;}})['then'](respondWithResult(_0x45d6cf,null))[_0xce98('0x26')](handleError(_0x45d6cf,null));};exports['getMailInteractions']=function(_0x4bfe60,_0x5a3ceb,_0x3c4ac3){var _0x27f958={'raw':!![],'where':{}};var _0x62aa6={};var _0x4d7a6a={'count':0x0,'rows':[]};return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0x4bfe60[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x5a3ceb,null))[_0xce98('0x1c')](function(_0x421ccc){if(_0x421ccc){_0x62aa6[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xcc')][_0xce98('0x45')]);_0x62aa6['query']=_[_0xce98('0x4b')](_0x4bfe60['query']);_0x62aa6[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x62aa6[_0xce98('0x46')],_0x62aa6['query']);_0x27f958[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x62aa6['model'],qs[_0xce98('0x4f')](_0x4bfe60[_0xce98('0x4a')][_0xce98('0x4f')]));_0x27f958['attributes']=_0x27f958['attributes'][_0xce98('0x50')]?_0x27f958['attributes']:_0x62aa6[_0xce98('0x46')];if(!_0x4bfe60[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x27f958[_0xce98('0x2d')]=qs['limit'](_0x4bfe60[_0xce98('0x4a')][_0xce98('0x2d')]);_0x27f958['offset']=qs[_0xce98('0x2c')](_0x4bfe60[_0xce98('0x4a')][_0xce98('0x2c')]);}_0x27f958['order']=qs['sort'](_0x4bfe60[_0xce98('0x4a')][_0xce98('0x53')]);_0x27f958[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x4bfe60[_0xce98('0x4a')],_0x62aa6[_0xce98('0x4c')]));_0x27f958[_0xce98('0x55')][_0xce98('0xc4')]=_0x421ccc['id'];if(_0x4bfe60[_0xce98('0x4a')][_0xce98('0x3a')]){_0x27f958[_0xce98('0x55')]=_[_0xce98('0x56')](_0x27f958['where'],{'$or':_['map'](_0x27f958[_0xce98('0x4e')],function(_0xa0cdfc){var _0x139383={};_0x139383[_0xa0cdfc]={'$like':'%'+_0x4bfe60[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x139383;})});}_0x27f958=_['merge']({},_0x27f958,_0x4bfe60['options']);return db['MailInteraction'][_0xce98('0x2b')]({'where':_0x27f958['where']})[_0xce98('0x1c')](function(_0x23f776){_0x4d7a6a[_0xce98('0x2b')]=_0x23f776;if(_0x4bfe60['query'][_0xce98('0x5d')]){_0x27f958[_0xce98('0x5f')]=[{'all':!![]}];}return db[_0xce98('0xcc')][_0xce98('0xbe')](_0x27f958);})[_0xce98('0x1c')](function(_0x40648b){_0x4d7a6a[_0xce98('0x5e')]=_0x40648b;return _0x4d7a6a;});}})[_0xce98('0x1c')](respondWithFilteredResult(_0x5a3ceb,_0x27f958))[_0xce98('0x26')](handleError(_0x5a3ceb,null));};exports[_0xce98('0xcd')]=function(_0x103fa5,_0x3031b4,_0xee3ff1){var _0x5b8566={};var _0x46e2ff={};var _0x4739e2;var _0x65f2cd;return db[_0xce98('0x5c')][_0xce98('0x91')]({'where':{'id':_0x103fa5[_0xce98('0x62')]['id']}})['then'](handleEntityNotFound(_0x3031b4,null))[_0xce98('0x1c')](function(_0x202924){if(_0x202924){_0x4739e2=_0x202924;_0x46e2ff[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xce')][_0xce98('0x45')]);_0x46e2ff[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x103fa5[_0xce98('0x4a')]);_0x46e2ff[_0xce98('0x4c')]=_['intersection'](_0x46e2ff[_0xce98('0x46')],_0x46e2ff[_0xce98('0x4a')]);_0x5b8566[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x46e2ff[_0xce98('0x46')],qs['fields'](_0x103fa5[_0xce98('0x4a')]['fields']));_0x5b8566[_0xce98('0x4e')]=_0x5b8566[_0xce98('0x4e')][_0xce98('0x50')]?_0x5b8566[_0xce98('0x4e')]:_0x46e2ff['model'];_0x5b8566[_0xce98('0x52')]=qs['sort'](_0x103fa5['query'][_0xce98('0x53')]);_0x5b8566['where']=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x103fa5[_0xce98('0x4a')],_0x46e2ff['filters']));if(_0x103fa5[_0xce98('0x4a')][_0xce98('0x3a')]){_0x5b8566[_0xce98('0x55')]=_[_0xce98('0x56')](_0x5b8566[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x5b8566[_0xce98('0x4e')],function(_0x2cd7ce){var _0x58f5e7={};_0x58f5e7[_0x2cd7ce]={'$like':'%'+_0x103fa5[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x58f5e7;})});}_0x5b8566=_[_0xce98('0x56')]({},_0x5b8566,_0x103fa5[_0xce98('0x5b')]);return _0x4739e2[_0xce98('0xcd')](_0x5b8566);}})['then'](function(_0x4bbbf4){if(_0x4bbbf4){_0x65f2cd=_0x4bbbf4[_0xce98('0x50')];if(!_0x103fa5[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x5b8566[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x103fa5['query']['limit']);_0x5b8566[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x103fa5[_0xce98('0x4a')][_0xce98('0x2c')]);}return _0x4739e2['getSmsInteractions'](_0x5b8566);}})[_0xce98('0x1c')](function(_0x3ed108){if(_0x3ed108){return _0x3ed108?{'count':_0x65f2cd,'rows':_0x3ed108}:null;}})[_0xce98('0x1c')](respondWithResult(_0x3031b4,null))[_0xce98('0x26')](handleError(_0x3031b4,null));};exports[_0xce98('0xcf')]=function(_0x19ae49,_0x10e67e,_0x2a50e0){var _0x2e46a8={};var _0x545e40={};var _0x4885c9;var _0x978c79;return db[_0xce98('0x5c')]['findOne']({'where':{'id':_0x19ae49[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x10e67e,null))[_0xce98('0x1c')](function(_0x1a24e6){if(_0x1a24e6){_0x4885c9=_0x1a24e6;_0x545e40[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xd0')]['rawAttributes']);_0x545e40[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x19ae49[_0xce98('0x4a')]);_0x545e40[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x545e40['model'],_0x545e40[_0xce98('0x4a')]);_0x2e46a8[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x545e40['model'],qs[_0xce98('0x4f')](_0x19ae49[_0xce98('0x4a')][_0xce98('0x4f')]));_0x2e46a8[_0xce98('0x4e')]=_0x2e46a8[_0xce98('0x4e')][_0xce98('0x50')]?_0x2e46a8[_0xce98('0x4e')]:_0x545e40[_0xce98('0x46')];_0x2e46a8[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x19ae49[_0xce98('0x4a')][_0xce98('0x53')]);_0x2e46a8[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x19ae49[_0xce98('0x4a')],_0x545e40[_0xce98('0x4c')]));if(_0x19ae49['query'][_0xce98('0x3a')]){_0x2e46a8[_0xce98('0x55')]=_[_0xce98('0x56')](_0x2e46a8['where'],{'$or':_[_0xce98('0x3c')](_0x2e46a8['attributes'],function(_0x437eb6){var _0xed0cea={};_0xed0cea[_0x437eb6]={'$like':'%'+_0x19ae49[_0xce98('0x4a')]['filter']+'%'};return _0xed0cea;})});}_0x2e46a8=_['merge']({},_0x2e46a8,_0x19ae49[_0xce98('0x5b')]);return _0x4885c9['getFaxInteractions'](_0x2e46a8);}})[_0xce98('0x1c')](function(_0x523c99){if(_0x523c99){_0x978c79=_0x523c99[_0xce98('0x50')];if(!_0x19ae49[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x2e46a8[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x19ae49['query']['limit']);_0x2e46a8[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x19ae49[_0xce98('0x4a')]['offset']);}return _0x4885c9['getFaxInteractions'](_0x2e46a8);}})[_0xce98('0x1c')](function(_0x130ada){if(_0x130ada){return _0x130ada?{'count':_0x978c79,'rows':_0x130ada}:null;}})['then'](respondWithResult(_0x10e67e,null))['catch'](handleError(_0x10e67e,null));};exports['login']=function(_0x25f2eb,_0x713bf1,_0x3a2136){var _0x18b83d;var _0x2580be;var _0x4a9a40;return db[_0xce98('0x5c')]['find']({'where':{'id':_0x25f2eb[_0xce98('0x62')]['id'],'role':_0xce98('0x37')},'attributes':['id','name',_0xce98('0xd1'),'mobile',_0xce98('0x3f'),_0xce98('0x6c'),_0xce98('0x92')]})[_0xce98('0x1c')](handleEntityNotFound(_0x713bf1,null))[_0xce98('0x1c')](function(_0x42728d){if(_0x42728d){_0x18b83d=_0x42728d;if(_0x25f2eb[_0xce98('0x61')]['interface']){_0x4a9a40=util[_0xce98('0x69')](_0xce98('0xd2'),_0x18b83d[_0x25f2eb[_0xce98('0x61')]['interface']]);}else if(_0x25f2eb[_0xce98('0x61')][_0xce98('0xd3')]){_0x4a9a40=util[_0xce98('0x69')]('SIP/%s',_0x25f2eb['body'][_0xce98('0xd3')]);}else{_0x4a9a40=util[_0xce98('0x69')](_0xce98('0xa3'),_0x18b83d[_0xce98('0x41')]);}socket['to'](util[_0xce98('0x69')](_0xce98('0xd4'),_0x18b83d[_0xce98('0x41')]))[_0xce98('0x9d')](_0xce98('0xd5'),{'ip':_0x25f2eb[_0xce98('0xd6')]['x-forwarded-for']||_0x25f2eb[_0xce98('0xd7')][_0xce98('0xd8')]||_0x25f2eb[_0xce98('0xd9')][_0xce98('0xd8')]||_0x25f2eb[_0xce98('0xd7')][_0xce98('0xd9')]['remoteAddress']});return db[_0xce98('0xaa')][_0xce98('0x33')]({'where':{'membername':_0x18b83d[_0xce98('0x41')]},'individualHooks':!![]});}})['then'](function(_0x5d8e71){if(_0x18b83d){return _0x18b83d['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x9c7d2e){var _0x54eacd=[];if(_0x9c7d2e){_0x2580be=_0x9c7d2e;if(_0x2580be['length']){for(var _0x11206b=0x0;_0x11206b<_0x2580be[_0xce98('0x50')];_0x11206b++){_0x54eacd[_0xce98('0xa2')]({'membername':_0x18b83d[_0xce98('0x41')],'UserId':_0x18b83d['id'],'queue_name':_0x2580be[_0x11206b]['name'],'VoiceQueueId':_0x2580be[_0x11206b]['id'],'interface':_0x4a9a40,'paused':_0x18b83d[_0xce98('0x92')]||![],'penalty':_0x2580be[_0x11206b][_0xce98('0xda')]||0x0});}return BPromise[_0xce98('0xa5')](_0x54eacd,function(_0x11c481){return db['UserVoiceQueueRt'][_0xce98('0xa6')](_0x11c481);});}}})[_0xce98('0x1c')](function(){return db[_0xce98('0xdb')]['findAll']({'where':{'membername':_0x18b83d['name'],'exitAt':null}});})[_0xce98('0x1c')](function(_0x41f7bc){var _0x123bca=[];_0x41f7bc[_0xce98('0xdc')](function(_0x1bd733){_0x123bca[_0xce98('0xa2')](_0x1bd733[_0xce98('0xdd')]({'exitAt':moment()[_0xce98('0x69')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xce98('0xde')](_0x123bca);})[_0xce98('0x1c')](function(){var _0x21f4f8=[];var _0x3a21c3=[];var _0x30ce6c=utils['getChannels']();var _0x29c67a={'membername':_0x18b83d[_0xce98('0x41')],'interface':_0x4a9a40,'enterAt':moment()[_0xce98('0x69')](_0xce98('0xdf')),'role':_0x18b83d[_0xce98('0x3f')],'internal':_0x18b83d[_0xce98('0x6c')]};_0x30ce6c[_0xce98('0xdc')](function(_0x3b7b80){_0x21f4f8[_0xce98('0xa2')](_[_0xce98('0x56')]({'channel':_0x3b7b80,'type':'LOGIN','data1':_0x25f2eb['body'][_0xce98('0xe0')],'data2':_0x4a9a40},_0x29c67a));if(_0x18b83d[_0xce98('0x92')]){_0x3a21c3[_0xce98('0xa2')](_[_0xce98('0x56')]({'channel':_0x3b7b80,'type':'PAUSE','data1':_0xce98('0xe1')},_0x29c67a));}});return db[_0xce98('0xdb')][_0xce98('0x60')](_0x21f4f8[_0xce98('0xe2')](_0x3a21c3),{'individualHooks':!![]});})[_0xce98('0x1c')](function(){return _0x18b83d[_0xce98('0xdd')]({'online':!![],'lastLoginAt':moment()[_0xce98('0x69')](_0xce98('0xdf')),'voicePause':_0x18b83d[_0xce98('0x92')]||![],'mailPause':_0x18b83d[_0xce98('0x92')]||![],'chatPause':_0x18b83d['loginInPause']||![],'faxPause':_0x18b83d[_0xce98('0x92')]||![],'smsPause':_0x18b83d[_0xce98('0x92')]||![],'openchannelPause':_0x18b83d[_0xce98('0x92')]||![],'pauseType':_0x18b83d[_0xce98('0x92')]?_0xce98('0xe1'):null,'interface':_0x4a9a40,'lastPauseAt':moment()[_0xce98('0x69')](_0xce98('0xdf'))});})['then'](respondWithResult(_0x713bf1,null))[_0xce98('0x26')](handleError(_0x713bf1,null));};exports[_0xce98('0xe3')]=function(_0x5d26b6,_0x26ef33,_0x1caf35){var _0x1a20b7;return db[_0xce98('0x5c')]['find']({'where':{'id':_0x5d26b6[_0xce98('0x62')]['id'],'role':'agent'},'attributes':['id','name',_0xce98('0x3f')]})[_0xce98('0x1c')](handleEntityNotFound(_0x26ef33,null))[_0xce98('0x1c')](function(_0x92606e){if(_0x92606e){_0x1a20b7=_0x92606e;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x1a20b7['name']},'individualHooks':!![]});}})[_0xce98('0x1c')](function(){return db[_0xce98('0xdb')][_0xce98('0xbe')]({'where':{'membername':_0x1a20b7['name'],'exitAt':null}});})['then'](function(_0x5aab6d){var _0x1eee05=[];_0x5aab6d[_0xce98('0xdc')](function(_0x552f64){_0x1eee05['push'](_0x552f64[_0xce98('0xdd')]({'exitAt':moment()['format'](_0xce98('0xdf'))}));});return BPromise[_0xce98('0xde')](_0x1eee05);})[_0xce98('0x1c')](function(){return _0x1a20b7[_0xce98('0xdd')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xce98('0x1c')](respondWithResult(_0x26ef33,null))[_0xce98('0x26')](handleError(_0x26ef33,null));};exports['pause']=function(_0x56f0ea,_0xc399c6,_0x1f6054){var _0x32ed21;return db[_0xce98('0xaa')][_0xce98('0xdd')]({'paused':0x1},{'where':{'UserId':_0x56f0ea['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xce98('0x5c')]['find']({'where':{'id':_0x56f0ea[_0xce98('0x62')]['id'],'role':_0xce98('0x37')},'attributes':['id',_0xce98('0x41'),_0xce98('0x3f'),_0xce98('0x6c'),_0xce98('0x93')]});})[_0xce98('0x1c')](handleEntityNotFound(_0xc399c6,null))[_0xce98('0x1c')](function(_0x34bf95){if(_0x34bf95){_0x32ed21=_0x34bf95;return respondWithRpcPromise(_0xce98('0xe4'),_0xce98('0xe5'),{'id':_0x32ed21['id'],'name':_0x32ed21['name'],'pause':!![]});}})[_0xce98('0x1c')](function(){if(_0x32ed21){return db[_0xce98('0xdb')][_0xce98('0xbe')]({'where':{'membername':_0x32ed21[_0xce98('0x41')],'type':'PAUSE','exitAt':null}});}})[_0xce98('0x1c')](function(_0x1165fd){if(_0x1165fd[_0xce98('0x50')]){var _0x45b842=moment()[_0xce98('0x69')](_0xce98('0xdf'));for(var _0x77cf43=0x0,_0x2ee56a=_0x1165fd[_0xce98('0x50')];_0x77cf43<_0x2ee56a;_0x77cf43++){_0x1165fd[_0x77cf43][_0xce98('0xe6')]({'exitAt':_0x45b842});}}})['then'](function(){var _0x13a581=[];var _0x2ea7ed=utils[_0xce98('0xe7')]();_0x2ea7ed[_0xce98('0xdc')](function(_0x58dac6){_0x13a581[_0xce98('0xa2')]({'channel':_0x58dac6,'membername':_0x32ed21['name'],'interface':_[_0xce98('0x67')](_0x32ed21['interface'])?util[_0xce98('0x69')](_0xce98('0xa3'),_0x32ed21[_0xce98('0x41')]):_0x32ed21[_0xce98('0x93')],'type':'PAUSE','enterAt':moment()[_0xce98('0x69')](_0xce98('0xdf')),'data1':_0x56f0ea['body'][_0xce98('0xe8')]||_0xce98('0xe9'),'role':_0x32ed21[_0xce98('0x3f')],'internal':_0x32ed21[_0xce98('0x6c')]});});return db[_0xce98('0xdb')][_0xce98('0x60')](_0x13a581,{'individualHooks':!![]});})[_0xce98('0x1c')](function(){return _0x32ed21[_0xce98('0xdd')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x56f0ea[_0xce98('0x61')][_0xce98('0xe8')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xce98('0x69')](_0xce98('0xdf'))});})['then'](respondWithResult(_0xc399c6,null))[_0xce98('0x26')](handleError(_0xc399c6,null));};exports['unpause']=function(_0x23efe8,_0x5d74b1,_0x5b078a){var _0x3eaad5;return db[_0xce98('0x5c')]['find']({'where':{'id':_0x23efe8[_0xce98('0x62')]['id']},'attributes':['id',_0xce98('0x41'),'role',_0xce98('0xa4'),_0xce98('0xea'),_0xce98('0xeb'),_0xce98('0xec'),_0xce98('0xed'),_0xce98('0xee'),_0xce98('0xef'),_0xce98('0xf0')]})['then'](handleEntityNotFound(_0x5d74b1,null))[_0xce98('0x1c')](function(_0x3f3b12){if(_0x3f3b12){_0x3eaad5=_0x3f3b12;if(_0x23efe8['body'][_0xce98('0xa7')]&&!utils['isValidChannel'](_0x23efe8[_0xce98('0x61')][_0xce98('0xa7')])){throw new db[(_0xce98('0x8a'))][(_0xce98('0x8b'))](_0xce98('0x95'));}switch(_0x23efe8[_0xce98('0x61')][_0xce98('0xa7')]){case _0xce98('0x9f'):return respondWithRpcPromise(_0xce98('0xe4'),_0xce98('0xf1'),{'id':_0x3eaad5['id'],'name':_0x3eaad5[_0xce98('0x41')],'pause':![]})[_0xce98('0x1c')](function(){return db[_0xce98('0xaa')][_0xce98('0xdd')]({'paused':0x0},{'where':{'UserId':_0x3eaad5['id']},'individualHooks':!![]});})['then'](function(){return db[_0xce98('0xdb')][_0xce98('0x40')]({'where':{'channel':_0x23efe8[_0xce98('0x61')]['channel'],'membername':_0x3eaad5[_0xce98('0x41')],'type':'PAUSE','exitAt':null}});})[_0xce98('0x1c')](function(_0x15bcc4){if(_0x15bcc4){return _0x15bcc4['update']({'exitAt':moment()[_0xce98('0x69')](_0xce98('0xdf')),'data2':_0xce98('0xf2')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3eaad5['update']({'voicePause':![]});});case'mail':case _0xce98('0xf3'):case _0xce98('0xf4'):case _0xce98('0xf5'):case _0xce98('0xf6'):return db[_0xce98('0xdb')][_0xce98('0x40')]({'where':{'channel':_0x23efe8[_0xce98('0x61')][_0xce98('0xa7')],'membername':_0x3eaad5[_0xce98('0x41')],'type':_0xce98('0xf7'),'exitAt':null}})[_0xce98('0x1c')](function(_0xbd327e){if(_0xbd327e){return _0xbd327e['update']({'exitAt':moment()[_0xce98('0x69')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xce98('0xf2')},{'individualHooks':!![]});}return null;})[_0xce98('0x1c')](function(){var _0x2b9837={};_[_0xce98('0x2e')](_0x2b9837,util[_0xce98('0x69')]('%s%s',_0x23efe8[_0xce98('0x61')]['channel'],'Pause'),![]);return _0x3eaad5[_0xce98('0xdd')](_0x2b9837);});default:return respondWithRpcPromise(_0xce98('0xe4'),_0xce98('0xf1'),{'id':_0x3eaad5['id'],'name':_0x3eaad5[_0xce98('0x41')],'pause':![]})[_0xce98('0x1c')](function(){return db['UserVoiceQueueRt'][_0xce98('0xdd')]({'paused':0x0},{'where':{'UserId':_0x3eaad5['id']}});})[_0xce98('0x1c')](function(){return db[_0xce98('0xdb')][_0xce98('0xbe')]({'where':{'membername':_0x3eaad5[_0xce98('0x41')],'type':_0xce98('0xf7'),'exitAt':null}});})[_0xce98('0x1c')](function(_0x37fb08){var _0x43e92f=[];_0x37fb08['forEach'](function(_0x25e7b3){_0x43e92f[_0xce98('0xa2')](_0x25e7b3['update']({'exitAt':moment()[_0xce98('0x69')](_0xce98('0xdf')),'data2':_0xce98('0xf2')}));});return BPromise[_0xce98('0xde')](_0x43e92f);})[_0xce98('0x1c')](function(){return _0x3eaad5[_0xce98('0xdd')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x5d74b1,null))['catch'](handleError(_0x5d74b1,null));};exports[_0xce98('0xf8')]=function(_0x4ac538,_0x132265,_0x4deb60){var _0x1b9bbb={};var _0x222695={};var _0x291ded;var _0x4fa3d1;return db[_0xce98('0x5c')]['findOne']({'where':{'id':_0x4ac538[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x132265,null))[_0xce98('0x1c')](function(_0xd42096){if(_0xd42096){_0x291ded=_0xd42096;_0x222695[_0xce98('0x46')]=_[_0xce98('0x4b')](db[_0xce98('0xf9')][_0xce98('0x45')]);_0x222695[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x4ac538[_0xce98('0x4a')]);_0x222695[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x222695[_0xce98('0x46')],_0x222695[_0xce98('0x4a')]);_0x1b9bbb[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x222695['model'],qs[_0xce98('0x4f')](_0x4ac538[_0xce98('0x4a')][_0xce98('0x4f')]));_0x1b9bbb[_0xce98('0x4e')]=_0x1b9bbb[_0xce98('0x4e')][_0xce98('0x50')]?_0x1b9bbb[_0xce98('0x4e')]:_0x222695['model'];_0x1b9bbb[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x4ac538[_0xce98('0x4a')][_0xce98('0x53')]);_0x1b9bbb[_0xce98('0x55')]=qs['filters'](_[_0xce98('0x54')](_0x4ac538[_0xce98('0x4a')],_0x222695[_0xce98('0x4c')]));if(_0x4ac538['query'][_0xce98('0x3a')]){_0x1b9bbb[_0xce98('0x55')]=_[_0xce98('0x56')](_0x1b9bbb['where'],{'$or':_[_0xce98('0x3c')](_0x1b9bbb[_0xce98('0x4e')],function(_0x28cfaa){var _0xfc8214={};_0xfc8214[_0x28cfaa]={'$like':'%'+_0x4ac538['query'][_0xce98('0x3a')]+'%'};return _0xfc8214;})});}_0x1b9bbb=_[_0xce98('0x56')]({},_0x1b9bbb,_0x4ac538[_0xce98('0x5b')]);return _0x291ded['getTeams'](_0x1b9bbb);}})['then'](function(_0x1b979d){if(_0x1b979d){_0x4fa3d1=_0x1b979d[_0xce98('0x50')];if(!_0x4ac538[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x1b9bbb['limit']=qs[_0xce98('0x2d')](_0x4ac538[_0xce98('0x4a')]['limit']);_0x1b9bbb[_0xce98('0x2c')]=qs[_0xce98('0x2c')](_0x4ac538[_0xce98('0x4a')]['offset']);}return _0x291ded[_0xce98('0xf8')](_0x1b9bbb);}})[_0xce98('0x1c')](function(_0x251ed8){if(_0x251ed8){return _0x251ed8?{'count':_0x4fa3d1,'rows':_0x251ed8}:null;}})[_0xce98('0x1c')](respondWithResult(_0x132265,null))['catch'](handleError(_0x132265,null));};exports[_0xce98('0xfa')]=function(_0x559ea7,_0x3b5961,_0x95c748){return db[_0xce98('0x5c')][_0xce98('0x40')]({'where':{'id':_0x559ea7[_0xce98('0x62')]['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x3b5961,null))[_0xce98('0x1c')](function(_0x45f601){if(_0x45f601){return _0x45f601[_0xce98('0xfa')](_0x559ea7['body'][_0xce98('0x64')],_[_0xce98('0xfb')](_0x559ea7[_0xce98('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x3b5961,null))['catch'](handleError(_0x3b5961,null));};exports[_0xce98('0xfc')]=function(_0x2afa01,_0x5dbadb,_0xd6b0ec){return db[_0xce98('0x5c')]['find']({'where':{'id':_0x2afa01[_0xce98('0x62')]['id']}})['then'](handleEntityNotFound(_0x5dbadb,null))[_0xce98('0x1c')](function(_0x4724e0){if(_0x4724e0){return _0x4724e0[_0xce98('0xfc')](_0x2afa01[_0xce98('0x4a')][_0xce98('0x64')]);}})[_0xce98('0x1c')](respondWithStatusCode(_0x5dbadb,null))[_0xce98('0x26')](handleError(_0x5dbadb,null));};exports['getLists']=function(_0x992144,_0x5c6939,_0x5f2b65){var _0x2c6bbb={};var _0x1413ae={};var _0x2bf9c0;var _0x57a0f6;return db['User'][_0xce98('0x91')]({'where':{'id':_0x992144['params']['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x5c6939,null))['then'](function(_0x562a5f){if(_0x562a5f){_0x2bf9c0=_0x562a5f;_0x1413ae[_0xce98('0x46')]=_['keys'](db[_0xce98('0xb8')]['rawAttributes']);_0x1413ae['query']=_['keys'](_0x992144[_0xce98('0x4a')]);_0x1413ae[_0xce98('0x4c')]=_[_0xce98('0x4d')](_0x1413ae[_0xce98('0x46')],_0x1413ae['query']);_0x2c6bbb[_0xce98('0x4e')]=_[_0xce98('0x4d')](_0x1413ae[_0xce98('0x46')],qs[_0xce98('0x4f')](_0x992144[_0xce98('0x4a')][_0xce98('0x4f')]));_0x2c6bbb[_0xce98('0x4e')]=_0x2c6bbb[_0xce98('0x4e')]['length']?_0x2c6bbb[_0xce98('0x4e')]:_0x1413ae['model'];_0x2c6bbb[_0xce98('0x52')]=qs[_0xce98('0x53')](_0x992144['query'][_0xce98('0x53')]);_0x2c6bbb[_0xce98('0x55')]=qs['filters'](_['pick'](_0x992144['query'],_0x1413ae[_0xce98('0x4c')]));if(_0x992144[_0xce98('0x4a')][_0xce98('0x3a')]){_0x2c6bbb[_0xce98('0x55')]=_[_0xce98('0x56')](_0x2c6bbb[_0xce98('0x55')],{'$or':_[_0xce98('0x3c')](_0x2c6bbb[_0xce98('0x4e')],function(_0x351a5d){var _0x58b4df={};_0x58b4df[_0x351a5d]={'$like':'%'+_0x992144[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x58b4df;})});}_0x2c6bbb=_[_0xce98('0x56')]({},_0x2c6bbb,_0x992144[_0xce98('0x5b')]);return _0x2bf9c0[_0xce98('0xfd')](_0x2c6bbb);}})[_0xce98('0x1c')](function(_0x505084){if(_0x505084){_0x57a0f6=_0x505084[_0xce98('0x50')];if(!_0x992144[_0xce98('0x4a')][_0xce98('0xb7')](_0xce98('0x51'))){_0x2c6bbb[_0xce98('0x2d')]=qs[_0xce98('0x2d')](_0x992144[_0xce98('0x4a')][_0xce98('0x2d')]);_0x2c6bbb['offset']=qs[_0xce98('0x2c')](_0x992144['query'][_0xce98('0x2c')]);}return _0x2bf9c0[_0xce98('0xfd')](_0x2c6bbb);}})[_0xce98('0x1c')](function(_0xc26f4a){if(_0xc26f4a){return _0xc26f4a?{'count':_0x57a0f6,'rows':_0xc26f4a}:null;}})[_0xce98('0x1c')](respondWithResult(_0x5c6939,null))[_0xce98('0x26')](handleError(_0x5c6939,null));};exports[_0xce98('0xfe')]=function(_0x1834f8,_0x4f5d3f,_0x5491c6){var _0x10ecb8={};var _0x236ce2={};var _0x13492f;var _0x22e887;return db['User'][_0xce98('0x91')]({'where':{'id':_0x1834f8['params']['id']}})[_0xce98('0x1c')](handleEntityNotFound(_0x4f5d3f,null))['then'](function(_0xa586a1){if(_0xa586a1){_0x13492f=_0xa586a1;_0x236ce2[_0xce98('0x46')]=_[_0xce98('0x4b')](db['User'][_0xce98('0x45')]);_0x236ce2[_0xce98('0x4a')]=_[_0xce98('0x4b')](_0x1834f8[_0xce98('0x4a')]);_0x236ce2[_0xce98('0x4c')]=_['intersection'](_0x236ce2[_0xce98('0x46')],_0x236ce2[_0xce98('0x4a')]);_0x10ecb8[_0xce98('0x4e')]=_['intersection'](_0x236ce2[_0xce98('0x46')],qs['fields'](_0x1834f8[_0xce98('0x4a')]['fields']));_0x10ecb8[_0xce98('0x4e')]=_0x10ecb8[_0xce98('0x4e')][_0xce98('0x50')]?_0x10ecb8[_0xce98('0x4e')]:_0x236ce2[_0xce98('0x46')];_0x10ecb8[_0xce98('0x52')]=qs['sort'](_0x1834f8['query'][_0xce98('0x53')]);_0x10ecb8[_0xce98('0x55')]=qs[_0xce98('0x4c')](_[_0xce98('0x54')](_0x1834f8[_0xce98('0x4a')],_0x236ce2[_0xce98('0x4c')]));if(_0x1834f8[_0xce98('0x4a')][_0xce98('0x3a')]){_0x10ecb8[_0xce98('0x55')]=_['merge'](_0x10ecb8['where'],{'$or':_[_0xce98('0x3c')](_0x10ecb8[_0xce98('0x4e')],function(_0x4a69f0){var _0x31adfa={};_0x31adfa[_0x4a69f0]={'$like':'%'+_0x1834f8[_0xce98('0x4a')][_0xce98('0x3a')]+'%'};return _0x31adfa;})});}_0x10ecb8['model']=db['User'];_0x10ecb8['as']=_0xce98('0x36');_0x10ecb8=_[_0xce98('0x56')]({},_0x10ecb8,_0x1834f8[_0xce98('0x5b')]);return _0x13492f[_0xce98('0xff')]({'include':[_0x10ecb8]});}})['then'](function(_0x295e3a){if(_0x295e3a){var _0x323ee6={},_0x916405=[],_0x87b0d7=0x0;for(var _0x3ffa7a=0x0;_0x3ffa7a<_0x295e3a['length'];_0x3ffa7a+=0x1){for(var _0x46f3b5=0x0,_0x3c5aae;_0x46f3b5<_0x295e3a[_0x3ffa7a]['Agents'][_0xce98('0x50')];_0x46f3b5+=0x1){_0x3c5aae=_0x295e3a[_0x3ffa7a][_0xce98('0x36')][_0x46f3b5]['get']({'plain':!![]});_0x323ee6[_0x3c5aae['id']]=_0x3c5aae;}}_0x323ee6=_['values'](_0x323ee6);for(var _0x36f1d2=qs[_0xce98('0x2c')](_0x1834f8[_0xce98('0x4a')][_0xce98('0x2c')]);_0x36f1d2<_0x323ee6[_0xce98('0x50')]&&_0x916405['length']=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x1bde05,_0x1966e0){var _0x171cfd=function(_0x2f7e21){while(--_0x2f7e21){_0x1bde05['push'](_0x1bde05['shift']());}};_0x171cfd(++_0x1966e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0xb10b[_0x13e300];return _0x5a3eea;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 2117ef9..6aa1fdc 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 _0x4994=['register','user:','./user.events','remove','update','emit','removeListener'];(function(_0x112f37,_0x443d4f){var _0x3e28a2=function(_0x472fce){while(--_0x472fce){_0x112f37['push'](_0x112f37['shift']());}};_0x3e28a2(++_0x443d4f);}(_0x4994,0xa3));var _0x4499=function(_0x4f4cd4,_0x4d3f52){_0x4f4cd4=_0x4f4cd4-0x0;var _0x3cfe9e=_0x4994[_0x4f4cd4];return _0x3cfe9e;};'use strict';var UserEvents=require(_0x4499('0x0'));var events=['save',_0x4499('0x1'),_0x4499('0x2')];function createListener(_0x21910a,_0x2bc058){return function(_0x22416f){_0x2bc058[_0x4499('0x3')](_0x21910a,_0x22416f);};}function removeListener(_0x393d9d,_0x4c2184){return function(){UserEvents[_0x4499('0x4')](_0x393d9d,_0x4c2184);};}exports[_0x4499('0x5')]=function(_0x39ba29){for(var _0x4bf8c6=0x0,_0xfb3d86=events['length'];_0x4bf8c6<_0xfb3d86;_0x4bf8c6++){var _0x2232de=events[_0x4bf8c6];var _0x3774c3=createListener(_0x4499('0x6')+_0x2232de,_0x39ba29);UserEvents['on'](_0x2232de,_0x3774c3);}}; \ No newline at end of file +var _0xcb96=['register','length','./user.events','save','emit'];(function(_0x39fdd9,_0x28aa22){var _0x91c97b=function(_0x285a25){while(--_0x285a25){_0x39fdd9['push'](_0x39fdd9['shift']());}};_0x91c97b(++_0x28aa22);}(_0xcb96,0x1ba));var _0x6cb9=function(_0xab3395,_0x30baf9){_0xab3395=_0xab3395-0x0;var _0x28e9d6=_0xcb96[_0xab3395];return _0x28e9d6;};'use strict';var UserEvents=require(_0x6cb9('0x0'));var events=[_0x6cb9('0x1'),'remove','update'];function createListener(_0x5bf3d1,_0x48f3e1){return function(_0x2407cd){_0x48f3e1[_0x6cb9('0x2')](_0x5bf3d1,_0x2407cd);};}function removeListener(_0x246261,_0x56d744){return function(){UserEvents['removeListener'](_0x246261,_0x56d744);};}exports[_0x6cb9('0x3')]=function(_0x385f24){for(var _0x55fac1=0x0,_0x5322f3=events[_0x6cb9('0x4')];_0x55fac1<_0x5322f3;_0x55fac1++){var _0x97d2a7=events[_0x55fac1];var _0x17a1b3=createListener('user:'+_0x97d2a7,_0x385f24);UserEvents['on'](_0x97d2a7,_0x17a1b3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index af473ff..8139790 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 _0xfc46=['../../config/environment','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x42225e,_0x1164f2){var _0x2bf9e5=function(_0x3762d6){while(--_0x3762d6){_0x42225e['push'](_0x42225e['shift']());}};_0x2bf9e5(++_0x1164f2);}(_0xfc46,0x9a));var _0x6fc4=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0xfc46[_0x3ebb69];return _0x421e59;};'use strict';var multer=require(_0x6fc4('0x0'));var util=require('util');var path=require(_0x6fc4('0x1'));var timeout=require(_0x6fc4('0x2'));var express=require(_0x6fc4('0x3'));var router=express['Router']();var auth=require(_0x6fc4('0x4'));var interaction=require(_0x6fc4('0x5'));var config=require(_0x6fc4('0x6'));module[_0x6fc4('0x7')]=router; \ No newline at end of file +var _0x9fc5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fc5,0xb6));var _0x59fc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x9fc5[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require('multer');var util=require(_0x59fc('0x0'));var path=require(_0x59fc('0x1'));var timeout=require('connect-timeout');var express=require(_0x59fc('0x2'));var router=express[_0x59fc('0x3')]();var auth=require(_0x59fc('0x4'));var interaction=require(_0x59fc('0x5'));var config=require(_0x59fc('0x6'));module[_0x59fc('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4418105..4d547f9 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 _0x2523=['INTEGER','sequelize','exports'];(function(_0x3a5e97,_0x267119){var _0xe31270=function(_0x394638){while(--_0x394638){_0x3a5e97['push'](_0x3a5e97['shift']());}};_0xe31270(++_0x267119);}(_0x2523,0x64));var _0x3252=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x2523[_0x54aea3];return _0x21ae46;};'use strict';var Sequelize=require(_0x3252('0x0'));module[_0x3252('0x1')]={'penalty':{'type':Sequelize[_0x3252('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x41db=['sequelize','exports'];(function(_0x420e9c,_0x1a1cf3){var _0x25c1ae=function(_0x1fa22b){while(--_0x1fa22b){_0x420e9c['push'](_0x420e9c['shift']());}};_0x25c1ae(++_0x1a1cf3);}(_0x41db,0x13e));var _0xb41d=function(_0x2bcc62,_0x17d7ba){_0x2bcc62=_0x2bcc62-0x0;var _0x3af23d=_0x41db[_0x2bcc62];return _0x3af23d;};'use strict';var Sequelize=require(_0xb41d('0x0'));module[_0xb41d('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 251c9b2..c30b599 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 _0x0960=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x3229d9,_0xe3484d){var _0x38e221=function(_0x473e9e){while(--_0x473e9e){_0x3229d9['push'](_0x3229d9['shift']());}};_0x38e221(++_0xe3484d);}(_0x0960,0x78));var _0x0096=function(_0x21176e,_0x5ba0e2){_0x21176e=_0x21176e-0x0;var _0x1379ad=_0x0960[_0x21176e];return _0x1379ad;};'use strict';var _=require(_0x0096('0x0'));var util=require('util');var logger=require(_0x0096('0x1'))(_0x0096('0x2'));var moment=require(_0x0096('0x3'));var BPromise=require(_0x0096('0x4'));var rp=require(_0x0096('0x5'));var fs=require('fs');var path=require(_0x0096('0x6'));var rimraf=require('rimraf');var config=require(_0x0096('0x7'));var attributes=require(_0x0096('0x8'));module[_0x0096('0x9')]=function(_0x188b1c,_0xa667c5){return _0x188b1c[_0x0096('0xa')](_0x0096('0xb'),attributes,{'tableName':_0x0096('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf66d=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define'];(function(_0x42b0b9,_0xccb2f7){var _0x5c5ce1=function(_0x1cf929){while(--_0x1cf929){_0x42b0b9['push'](_0x42b0b9['shift']());}};_0x5c5ce1(++_0xccb2f7);}(_0xf66d,0x152));var _0xdf66=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xf66d[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xdf66('0x0'));var util=require(_0xdf66('0x1'));var logger=require(_0xdf66('0x2'))(_0xdf66('0x3'));var moment=require(_0xdf66('0x4'));var BPromise=require(_0xdf66('0x5'));var rp=require(_0xdf66('0x6'));var fs=require('fs');var path=require(_0xdf66('0x7'));var rimraf=require(_0xdf66('0x8'));var config=require(_0xdf66('0x9'));var attributes=require(_0xdf66('0xa'));module['exports']=function(_0x15a79f,_0x3e186f){return _0x15a79f[_0xdf66('0xb')](_0xdf66('0xc'),attributes,{'tableName':_0xdf66('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 f05b81e..a002c14 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 _0x0c2b=['message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0c2b,0x134));var _0xb0c2=function(_0x547804,_0x214623){_0x547804=_0x547804-0x0;var _0x3d9c58=_0x0c2b[_0x547804];return _0x3d9c58;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0c2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0c2('0x3'))['db'];var utils=require(_0xb0c2('0x4'));var logger=require(_0xb0c2('0x5'))(_0xb0c2('0x6'));var config=require(_0xb0c2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb0c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x156ed4,_0x38a655,_0x21a929){return new BPromise(function(_0x27e2fb,_0x3e6f23){return client[_0xb0c2('0x9')](_0x156ed4,_0x21a929)[_0xb0c2('0xa')](function(_0x4cca5e){logger[_0xb0c2('0xb')](_0xb0c2('0xc'),_0x38a655,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x38a655,_0xb0c2('0xd'),JSON['stringify'](_0x4cca5e));if(_0x4cca5e[_0xb0c2('0xe')]){if(_0x4cca5e[_0xb0c2('0xe')]['code']===0x1f4){logger[_0xb0c2('0xe')](_0xb0c2('0xc'),_0x38a655,_0x4cca5e[_0xb0c2('0xe')][_0xb0c2('0xf')]);return _0x3e6f23(_0x4cca5e[_0xb0c2('0xe')][_0xb0c2('0xf')]);}logger[_0xb0c2('0xe')](_0xb0c2('0xc'),_0x38a655,_0x4cca5e[_0xb0c2('0xe')][_0xb0c2('0xf')]);return _0x27e2fb(_0x4cca5e[_0xb0c2('0xe')]['message']);}else{logger[_0xb0c2('0xb')](_0xb0c2('0xc'),_0x38a655,_0xb0c2('0xd'));_0x27e2fb(_0x4cca5e['result']['message']);}})[_0xb0c2('0x10')](function(_0x182dfb){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x38a655,_0x182dfb);_0x3e6f23(_0x182dfb);});});} \ No newline at end of file +var _0x854e=['rpc','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x11e764,_0x3448a4){var _0x96ecf0=function(_0x44306f){while(--_0x44306f){_0x11e764['push'](_0x11e764['shift']());}};_0x96ecf0(++_0x3448a4);}(_0x854e,0xdd));var _0xe854=function(_0x4c1881,_0x323217){_0x4c1881=_0x4c1881-0x0;var _0x4e9528=_0x854e[_0x4c1881];return _0x4e9528;};'use strict';var _=require(_0xe854('0x0'));var util=require(_0xe854('0x1'));var moment=require(_0xe854('0x2'));var BPromise=require(_0xe854('0x3'));var rs=require(_0xe854('0x4'));var fs=require('fs');var Redis=require(_0xe854('0x5'));var db=require(_0xe854('0x6'))['db'];var utils=require(_0xe854('0x7'));var logger=require(_0xe854('0x8'))(_0xe854('0x9'));var config=require('../../config/environment');var jayson=require(_0xe854('0xa'));var client=jayson['client'][_0xe854('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30df6a,_0x5d9666,_0x27f04e){return new BPromise(function(_0x9e636b,_0x58f3ab){return client[_0xe854('0xc')](_0x30df6a,_0x27f04e)[_0xe854('0xd')](function(_0x16d272){logger[_0xe854('0xe')](_0xe854('0xf'),_0x5d9666,_0xe854('0x10'));logger[_0xe854('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5d9666,_0xe854('0x10'),JSON['stringify'](_0x16d272));if(_0x16d272[_0xe854('0x12')]){if(_0x16d272['error'][_0xe854('0x13')]===0x1f4){logger[_0xe854('0x12')](_0xe854('0xf'),_0x5d9666,_0x16d272[_0xe854('0x12')]['message']);return _0x58f3ab(_0x16d272['error'][_0xe854('0x14')]);}logger['error'](_0xe854('0xf'),_0x5d9666,_0x16d272[_0xe854('0x12')][_0xe854('0x14')]);return _0x9e636b(_0x16d272[_0xe854('0x12')][_0xe854('0x14')]);}else{logger['info'](_0xe854('0xf'),_0x5d9666,_0xe854('0x10'));_0x9e636b(_0x16d272[_0xe854('0x15')][_0xe854('0x14')]);}})[_0xe854('0x16')](function(_0x250f97){logger[_0xe854('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x5d9666,_0x250f97);_0x58f3ab(_0x250f97);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f068836..2dc6a18 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 _0x199c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x2237be,_0x2ed5c1){var _0x3312ab=function(_0x448a62){while(--_0x448a62){_0x2237be['push'](_0x2237be['shift']());}};_0x3312ab(++_0x2ed5c1);}(_0x199c,0x1d8));var _0xc199=function(_0x444958,_0x2fc23c){_0x444958=_0x444958-0x0;var _0x36403e=_0x199c[_0x444958];return _0x36403e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc199('0x0'));var timeout=require(_0xc199('0x1'));var express=require(_0xc199('0x2'));var router=express[_0xc199('0x3')]();var auth=require(_0xc199('0x4'));var interaction=require(_0xc199('0x5'));var config=require(_0xc199('0x6'));module[_0xc199('0x7')]=router; \ No newline at end of file +var _0x1b20=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','Router'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1b20,0x66));var _0x01b2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b20[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var auth=require(_0x01b2('0x3'));var interaction=require(_0x01b2('0x4'));var config=require(_0x01b2('0x5'));module[_0x01b2('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index cbd2547..7de8f0e 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 _0x7038=['exports','INTEGER','STRING','sequelize'];(function(_0x568a32,_0x17c98a){var _0x2a8e4f=function(_0x5438c9){while(--_0x5438c9){_0x568a32['push'](_0x568a32['shift']());}};_0x2a8e4f(++_0x17c98a);}(_0x7038,0x16b));var _0x8703=function(_0x51f9bd,_0x1b85f3){_0x51f9bd=_0x51f9bd-0x0;var _0x229c60=_0x7038[_0x51f9bd];return _0x229c60;};'use strict';var Sequelize=require(_0x8703('0x0'));module[_0x8703('0x1')]={'penalty':{'type':Sequelize[_0x8703('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8703('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8703('0x3')]}}; \ No newline at end of file +var _0x1b02=['STRING','sequelize','INTEGER'];(function(_0x1dc20c,_0x194042){var _0x4503f8=function(_0x1feb2b){while(--_0x1feb2b){_0x1dc20c['push'](_0x1dc20c['shift']());}};_0x4503f8(++_0x194042);}(_0x1b02,0x151));var _0x21b0=function(_0x34a7b5,_0x15c8fe){_0x34a7b5=_0x34a7b5-0x0;var _0x28dcf4=_0x1b02[_0x34a7b5];return _0x28dcf4;};'use strict';var Sequelize=require(_0x21b0('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x21b0('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x21b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 75dbab3..3be7772 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 _0xeae7=['api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x125cb8,_0xa11696){var _0x2c21ff=function(_0x5598ea){while(--_0x5598ea){_0x125cb8['push'](_0x125cb8['shift']());}};_0x2c21ff(++_0xa11696);}(_0xeae7,0xf4));var _0x7eae=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xeae7[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x7eae('0x0'));var util=require(_0x7eae('0x1'));var logger=require(_0x7eae('0x2'))(_0x7eae('0x3'));var moment=require(_0x7eae('0x4'));var BPromise=require(_0x7eae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7eae('0x6'));var rimraf=require(_0x7eae('0x7'));var config=require(_0x7eae('0x8'));var attributes=require(_0x7eae('0x9'));module['exports']=function(_0x341aa2,_0x5ac2ce){return _0x341aa2[_0x7eae('0xa')](_0x7eae('0xb'),attributes,{'tableName':_0x7eae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f15=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0x4eedff,_0x1e0516){var _0x643e14=function(_0x20c3bc){while(--_0x20c3bc){_0x4eedff['push'](_0x4eedff['shift']());}};_0x643e14(++_0x1e0516);}(_0x3f15,0x1a4));var _0x53f1=function(_0x3f5e89,_0x173861){_0x3f5e89=_0x3f5e89-0x0;var _0x3713aa=_0x3f15[_0x3f5e89];return _0x3713aa;};'use strict';var _=require(_0x53f1('0x0'));var util=require(_0x53f1('0x1'));var logger=require(_0x53f1('0x2'))(_0x53f1('0x3'));var moment=require(_0x53f1('0x4'));var BPromise=require(_0x53f1('0x5'));var rp=require(_0x53f1('0x6'));var fs=require('fs');var path=require(_0x53f1('0x7'));var rimraf=require(_0x53f1('0x8'));var config=require(_0x53f1('0x9'));var attributes=require('./userFaxQueue.attributes');module[_0x53f1('0xa')]=function(_0x271f2b,_0x229f17){return _0x271f2b[_0x53f1('0xb')](_0x53f1('0xc'),attributes,{'tableName':_0x53f1('0xd'),'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 2712c86..fa1045a 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 _0x797a=['request','info','UserFaxQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x929a6a,_0x55b5fe){var _0x475a83=function(_0x2c9bef){while(--_0x2c9bef){_0x929a6a['push'](_0x929a6a['shift']());}};_0x475a83(++_0x55b5fe);}(_0x797a,0x107));var _0xa797=function(_0x2f3125,_0x172fb7){_0x2f3125=_0x2f3125-0x0;var _0x9ff20b=_0x797a[_0x2f3125];return _0x9ff20b;};'use strict';var _=require(_0xa797('0x0'));var util=require(_0xa797('0x1'));var moment=require(_0xa797('0x2'));var BPromise=require(_0xa797('0x3'));var rs=require(_0xa797('0x4'));var fs=require('fs');var Redis=require(_0xa797('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa797('0x6'));var logger=require(_0xa797('0x7'))(_0xa797('0x8'));var config=require(_0xa797('0x9'));var jayson=require(_0xa797('0xa'));var client=jayson[_0xa797('0xb')][_0xa797('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x593b36,_0x2592b6,_0x1c4f02){return new BPromise(function(_0x407dc2,_0x45e8d6){return client[_0xa797('0xd')](_0x593b36,_0x1c4f02)['then'](function(_0x108ecd){logger[_0xa797('0xe')](_0xa797('0xf'),_0x2592b6,'request\x20sent');logger[_0xa797('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2592b6,'request\x20sent',JSON[_0xa797('0x11')](_0x108ecd));if(_0x108ecd[_0xa797('0x12')]){if(_0x108ecd['error'][_0xa797('0x13')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2592b6,_0x108ecd[_0xa797('0x12')][_0xa797('0x14')]);return _0x45e8d6(_0x108ecd[_0xa797('0x12')][_0xa797('0x14')]);}logger[_0xa797('0x12')](_0xa797('0xf'),_0x2592b6,_0x108ecd[_0xa797('0x12')][_0xa797('0x14')]);return _0x407dc2(_0x108ecd[_0xa797('0x12')]['message']);}else{logger[_0xa797('0xe')](_0xa797('0xf'),_0x2592b6,_0xa797('0x15'));_0x407dc2(_0x108ecd[_0xa797('0x16')]['message']);}})['catch'](function(_0x25f185){logger[_0xa797('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x2592b6,_0x25f185);_0x45e8d6(_0x25f185);});});} \ No newline at end of file +var _0xbece=['error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','code'];(function(_0x4f7c27,_0x578ee4){var _0x10accd=function(_0x169801){while(--_0x169801){_0x4f7c27['push'](_0x4f7c27['shift']());}};_0x10accd(++_0x578ee4);}(_0xbece,0x89));var _0xebec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xbece[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebec('0x0'));var BPromise=require(_0xebec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xebec('0x2'));var db=require(_0xebec('0x3'))['db'];var utils=require(_0xebec('0x4'));var logger=require(_0xebec('0x5'))(_0xebec('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebec('0x7')][_0xebec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23de51,_0x53ed24,_0x1ceedf){return new BPromise(function(_0x65f381,_0x1318cd){return client[_0xebec('0x9')](_0x23de51,_0x1ceedf)[_0xebec('0xa')](function(_0x36ef8c){logger['info'](_0xebec('0xb'),_0x53ed24,_0xebec('0xc'));logger['debug'](_0xebec('0xd'),_0x53ed24,'request\x20sent',JSON['stringify'](_0x36ef8c));if(_0x36ef8c['error']){if(_0x36ef8c['error'][_0xebec('0xe')]===0x1f4){logger[_0xebec('0xf')](_0xebec('0xb'),_0x53ed24,_0x36ef8c[_0xebec('0xf')][_0xebec('0x10')]);return _0x1318cd(_0x36ef8c[_0xebec('0xf')][_0xebec('0x10')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x53ed24,_0x36ef8c[_0xebec('0xf')][_0xebec('0x10')]);return _0x65f381(_0x36ef8c['error'][_0xebec('0x10')]);}else{logger['info'](_0xebec('0xb'),_0x53ed24,_0xebec('0xc'));_0x65f381(_0x36ef8c[_0xebec('0x11')][_0xebec('0x10')]);}})[_0xebec('0x12')](function(_0x2660f0){logger[_0xebec('0xf')](_0xebec('0xb'),_0x53ed24,_0x2660f0);_0x1318cd(_0x2660f0);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 78de3ff..6737dd6 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 _0x6003=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x4eeeda,_0x2d1d2c){var _0x51cb6d=function(_0x4925f1){while(--_0x4925f1){_0x4eeeda['push'](_0x4eeeda['shift']());}};_0x51cb6d(++_0x2d1d2c);}(_0x6003,0xae));var _0x3600=function(_0x17077b,_0x13430f){_0x17077b=_0x17077b-0x0;var _0x33c216=_0x6003[_0x17077b];return _0x33c216;};'use strict';var multer=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var path=require(_0x3600('0x2'));var timeout=require(_0x3600('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3600('0x4'));var interaction=require(_0x3600('0x5'));var config=require(_0x3600('0x6'));module['exports']=router; \ No newline at end of file +var _0x3024=['connect-timeout','express','../../components/interaction/service','exports','multer','util'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3024,0x64));var _0x4302=function(_0x410bd2,_0x3138e1){_0x410bd2=_0x410bd2-0x0;var _0x4c84e2=_0x3024[_0x410bd2];return _0x4c84e2;};'use strict';var multer=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var path=require('path');var timeout=require(_0x4302('0x2'));var express=require(_0x4302('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4302('0x4'));var config=require('../../config/environment');module[_0x4302('0x5')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e516108..9dd1346 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 _0xb9de=['exports','INTEGER','sequelize'];(function(_0x59b942,_0x321c20){var _0x160483=function(_0x41b13b){while(--_0x41b13b){_0x59b942['push'](_0x59b942['shift']());}};_0x160483(++_0x321c20);}(_0xb9de,0x19d));var _0xeb9d=function(_0x2aa058,_0xb9bbd){_0x2aa058=_0x2aa058-0x0;var _0x330071=_0xb9de[_0x2aa058];return _0x330071;};'use strict';var Sequelize=require(_0xeb9d('0x0'));module[_0xeb9d('0x1')]={'penalty':{'type':Sequelize[_0xeb9d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc085=['INTEGER','sequelize','exports'];(function(_0x5a9c4b,_0x402b00){var _0x1bc148=function(_0x1d66ab){while(--_0x1d66ab){_0x5a9c4b['push'](_0x5a9c4b['shift']());}};_0x1bc148(++_0x402b00);}(_0xc085,0x121));var _0x5c08=function(_0x192711,_0x561328){_0x192711=_0x192711-0x0;var _0x601440=_0xc085[_0x192711];return _0x601440;};'use strict';var Sequelize=require(_0x5c08('0x0'));module[_0x5c08('0x1')]={'penalty':{'type':Sequelize[_0x5c08('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 44908dc..854eb23 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x1c6d69,_0x2a13ee){var _0xcdd612=function(_0x2bcf89){while(--_0x2bcf89){_0x1c6d69['push'](_0x1c6d69['shift']());}};_0xcdd612(++_0x2a13ee);}(_0xfcf0,0x138));var _0x0fcf=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0xfcf0[_0x10df1e];return _0x3e24fb;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x82e089,_0x1eda4c){var _0x251917=function(_0x469ffc){while(--_0x469ffc){_0x82e089['push'](_0x82e089['shift']());}};_0x251917(++_0x1eda4c);}(_0x5fab,0x177));var _0xb5fa=function(_0x238202,_0x10da07){_0x238202=_0x238202-0x0;var _0x217367=_0x5fab[_0x238202];return _0x217367;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index ac30671..9839ac0 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 _0x70ce=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3a0cb1,_0x172525){var _0x3c1356=function(_0x5de640){while(--_0x5de640){_0x3a0cb1['push'](_0x3a0cb1['shift']());}};_0x3c1356(++_0x172525);}(_0x70ce,0x1c2));var _0xe70c=function(_0x25883d,_0x40148b){_0x25883d=_0x25883d-0x0;var _0xc66446=_0x70ce[_0x25883d];return _0xc66446;};'use strict';var _=require(_0xe70c('0x0'));var util=require(_0xe70c('0x1'));var moment=require(_0xe70c('0x2'));var BPromise=require(_0xe70c('0x3'));var rs=require(_0xe70c('0x4'));var fs=require('fs');var Redis=require(_0xe70c('0x5'));var db=require(_0xe70c('0x6'))['db'];var utils=require(_0xe70c('0x7'));var logger=require(_0xe70c('0x8'))(_0xe70c('0x9'));var config=require('../../config/environment');var jayson=require(_0xe70c('0xa'));var client=jayson[_0xe70c('0xb')][_0xe70c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c4a11,_0x386067,_0x5a2b9b){return new BPromise(function(_0x454dd5,_0x5142fb){return client[_0xe70c('0xd')](_0x4c4a11,_0x5a2b9b)['then'](function(_0x2e59cb){logger[_0xe70c('0xe')](_0xe70c('0xf'),_0x386067,_0xe70c('0x10'));logger[_0xe70c('0x11')](_0xe70c('0x12'),_0x386067,_0xe70c('0x10'),JSON[_0xe70c('0x13')](_0x2e59cb));if(_0x2e59cb[_0xe70c('0x14')]){if(_0x2e59cb[_0xe70c('0x14')][_0xe70c('0x15')]===0x1f4){logger[_0xe70c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x386067,_0x2e59cb[_0xe70c('0x14')][_0xe70c('0x16')]);return _0x5142fb(_0x2e59cb[_0xe70c('0x14')]['message']);}logger['error'](_0xe70c('0xf'),_0x386067,_0x2e59cb[_0xe70c('0x14')]['message']);return _0x454dd5(_0x2e59cb[_0xe70c('0x14')]['message']);}else{logger[_0xe70c('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x386067,_0xe70c('0x10'));_0x454dd5(_0x2e59cb['result'][_0xe70c('0x16')]);}})[_0xe70c('0x17')](function(_0x2cbecb){logger[_0xe70c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x386067,_0x2cbecb);_0x5142fb(_0x2cbecb);});});} \ No newline at end of file +var _0x53a1=['info','UserMailQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x8b306,_0x235868){var _0x38b96e=function(_0x41305d){while(--_0x41305d){_0x8b306['push'](_0x8b306['shift']());}};_0x38b96e(++_0x235868);}(_0x53a1,0x1bd));var _0x153a=function(_0xb57a17,_0x374b2f){_0xb57a17=_0xb57a17-0x0;var _0x26874c=_0x53a1[_0xb57a17];return _0x26874c;};'use strict';var _=require(_0x153a('0x0'));var util=require(_0x153a('0x1'));var moment=require(_0x153a('0x2'));var BPromise=require('bluebird');var rs=require(_0x153a('0x3'));var fs=require('fs');var Redis=require(_0x153a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x153a('0x5'));var logger=require('../../config/logger')(_0x153a('0x6'));var config=require(_0x153a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x153a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27a760,_0x2ff8c2,_0x12ed98){return new BPromise(function(_0x8514b1,_0x52ca7d){return client[_0x153a('0x9')](_0x27a760,_0x12ed98)[_0x153a('0xa')](function(_0x419cbd){logger[_0x153a('0xb')](_0x153a('0xc'),_0x2ff8c2,'request\x20sent');logger[_0x153a('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x2ff8c2,_0x153a('0xe'),JSON['stringify'](_0x419cbd));if(_0x419cbd[_0x153a('0xf')]){if(_0x419cbd['error']['code']===0x1f4){logger[_0x153a('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x2ff8c2,_0x419cbd[_0x153a('0xf')]['message']);return _0x52ca7d(_0x419cbd[_0x153a('0xf')]['message']);}logger['error'](_0x153a('0xc'),_0x2ff8c2,_0x419cbd[_0x153a('0xf')][_0x153a('0x10')]);return _0x8514b1(_0x419cbd[_0x153a('0xf')][_0x153a('0x10')]);}else{logger[_0x153a('0xb')](_0x153a('0xc'),_0x2ff8c2,_0x153a('0xe'));_0x8514b1(_0x419cbd[_0x153a('0x11')][_0x153a('0x10')]);}})[_0x153a('0x12')](function(_0x80f579){logger['error'](_0x153a('0xc'),_0x2ff8c2,_0x80f579);_0x52ca7d(_0x80f579);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a8a6434..687fc71 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 _0xe626=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x363823,_0x550635){var _0x1e0171=function(_0x4afb7a){while(--_0x4afb7a){_0x363823['push'](_0x363823['shift']());}};_0x1e0171(++_0x550635);}(_0xe626,0x9d));var _0x6e62=function(_0x5dc99b,_0x13e54f){_0x5dc99b=_0x5dc99b-0x0;var _0x175f1d=_0xe626[_0x5dc99b];return _0x175f1d;};'use strict';var multer=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var path=require(_0x6e62('0x2'));var timeout=require(_0x6e62('0x3'));var express=require('express');var router=express[_0x6e62('0x4')]();var auth=require(_0x6e62('0x5'));var interaction=require(_0x6e62('0x6'));var config=require(_0x6e62('0x7'));module[_0x6e62('0x8')]=router; \ No newline at end of file +var _0xa24d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x502a1c,_0x3c8a0f){var _0xf4aef7=function(_0x5a15f7){while(--_0x5a15f7){_0x502a1c['push'](_0x502a1c['shift']());}};_0xf4aef7(++_0x3c8a0f);}(_0xa24d,0x1c1));var _0xda24=function(_0x191ff0,_0x50515a){_0x191ff0=_0x191ff0-0x0;var _0x1003ac=_0xa24d[_0x191ff0];return _0x1003ac;};'use strict';var multer=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var path=require(_0xda24('0x2'));var timeout=require(_0xda24('0x3'));var express=require(_0xda24('0x4'));var router=express[_0xda24('0x5')]();var auth=require(_0xda24('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda24('0x7'));module[_0xda24('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 99b5c61..fd7f0b8 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 _0xa118=['INTEGER'];(function(_0x24a478,_0x512c3c){var _0x35120e=function(_0x4b739f){while(--_0x4b739f){_0x24a478['push'](_0x24a478['shift']());}};_0x35120e(++_0x512c3c);}(_0xa118,0xa2));var _0x8a11=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xa118[_0x27c24e];return _0x39004a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8a11('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf748=['INTEGER'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xf748,0x1c1));var _0x8f74=function(_0x22484b,_0xc43a49){_0x22484b=_0x22484b-0x0;var _0x16aeaf=_0xf748[_0x22484b];return _0x16aeaf;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8f74('0x0')],'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 ebb5a12..58a69a7 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 _0xb1c0=['bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment'];(function(_0x980338,_0x1674c1){var _0x51e77b=function(_0x31b689){while(--_0x31b689){_0x980338['push'](_0x980338['shift']());}};_0x51e77b(++_0x1674c1);}(_0xb1c0,0x6b));var _0x0b1c=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xb1c0[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require(_0x0b1c('0x0'));var logger=require(_0x0b1c('0x1'))('api');var moment=require(_0x0b1c('0x2'));var BPromise=require(_0x0b1c('0x3'));var rp=require(_0x0b1c('0x4'));var fs=require('fs');var path=require(_0x0b1c('0x5'));var rimraf=require('rimraf');var config=require(_0x0b1c('0x6'));var attributes=require(_0x0b1c('0x7'));module['exports']=function(_0x4b02ec,_0x4d9b67){return _0x4b02ec[_0x0b1c('0x8')](_0x0b1c('0x9'),attributes,{'tableName':_0x0b1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d5e=['exports','define','UserOpenchannelQueue','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x4a0b7f,_0x640bee){var _0x2f1df1=function(_0x5e8050){while(--_0x5e8050){_0x4a0b7f['push'](_0x4a0b7f['shift']());}};_0x2f1df1(++_0x640bee);}(_0x8d5e,0xb3));var _0xe8d5=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8d5e[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe8d5('0x0'))(_0xe8d5('0x1'));var moment=require(_0xe8d5('0x2'));var BPromise=require(_0xe8d5('0x3'));var rp=require(_0xe8d5('0x4'));var fs=require('fs');var path=require(_0xe8d5('0x5'));var rimraf=require('rimraf');var config=require(_0xe8d5('0x6'));var attributes=require(_0xe8d5('0x7'));module[_0xe8d5('0x8')]=function(_0x17e4d8,_0x3cb9b6){return _0x17e4d8[_0xe8d5('0x9')](_0xe8d5('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 5501108..616cd61 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 _0x1e45=['catch','lodash','util','bluebird','randomstring','../../config/utils','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x21ec51,_0x3281d3){var _0x2034ab=function(_0x752fe4){while(--_0x752fe4){_0x21ec51['push'](_0x21ec51['shift']());}};_0x2034ab(++_0x3281d3);}(_0x1e45,0xac));var _0x51e4=function(_0x584529,_0x51e656){_0x584529=_0x584529-0x0;var _0x33119b=_0x1e45[_0x584529];return _0x33119b;};'use strict';var _=require(_0x51e4('0x0'));var util=require(_0x51e4('0x1'));var moment=require('moment');var BPromise=require(_0x51e4('0x2'));var rs=require(_0x51e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51e4('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x51e4('0x5')][_0x51e4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x7167c8,_0x4dd423,_0x82df1f){return new BPromise(function(_0x1cb50d,_0x5c6d92){return client[_0x51e4('0x7')](_0x7167c8,_0x82df1f)['then'](function(_0x39d2ff){logger[_0x51e4('0x8')](_0x51e4('0x9'),_0x4dd423,_0x51e4('0xa'));logger[_0x51e4('0xb')](_0x51e4('0xc'),_0x4dd423,'request\x20sent',JSON[_0x51e4('0xd')](_0x39d2ff));if(_0x39d2ff[_0x51e4('0xe')]){if(_0x39d2ff[_0x51e4('0xe')][_0x51e4('0xf')]===0x1f4){logger['error'](_0x51e4('0x9'),_0x4dd423,_0x39d2ff['error'][_0x51e4('0x10')]);return _0x5c6d92(_0x39d2ff[_0x51e4('0xe')]['message']);}logger[_0x51e4('0xe')](_0x51e4('0x9'),_0x4dd423,_0x39d2ff[_0x51e4('0xe')]['message']);return _0x1cb50d(_0x39d2ff[_0x51e4('0xe')]['message']);}else{logger['info'](_0x51e4('0x9'),_0x4dd423,_0x51e4('0xa'));_0x1cb50d(_0x39d2ff[_0x51e4('0x11')][_0x51e4('0x10')]);}})[_0x51e4('0x12')](function(_0x4aa4b4){logger['error'](_0x51e4('0x9'),_0x4dd423,_0x4aa4b4);_0x5c6d92(_0x4aa4b4);});});} \ No newline at end of file +var _0x4ea3=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4fd181,_0x4d0322){var _0x27ed91=function(_0x29be1d){while(--_0x29be1d){_0x4fd181['push'](_0x4fd181['shift']());}};_0x27ed91(++_0x4d0322);}(_0x4ea3,0x1cf));var _0x34ea=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4ea3[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x34ea('0x0'));var util=require('util');var moment=require(_0x34ea('0x1'));var BPromise=require(_0x34ea('0x2'));var rs=require(_0x34ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x34ea('0x5'))(_0x34ea('0x6'));var config=require(_0x34ea('0x7'));var jayson=require(_0x34ea('0x8'));var client=jayson[_0x34ea('0x9')][_0x34ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2606b8,_0x219313,_0x528d09){return new BPromise(function(_0x3b3d29,_0x3842ed){return client[_0x34ea('0xb')](_0x2606b8,_0x528d09)[_0x34ea('0xc')](function(_0x33a442){logger[_0x34ea('0xd')](_0x34ea('0xe'),_0x219313,'request\x20sent');logger[_0x34ea('0xf')](_0x34ea('0x10'),_0x219313,_0x34ea('0x11'),JSON[_0x34ea('0x12')](_0x33a442));if(_0x33a442[_0x34ea('0x13')]){if(_0x33a442[_0x34ea('0x13')][_0x34ea('0x14')]===0x1f4){logger['error'](_0x34ea('0xe'),_0x219313,_0x33a442['error'][_0x34ea('0x15')]);return _0x3842ed(_0x33a442[_0x34ea('0x13')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x219313,_0x33a442[_0x34ea('0x13')][_0x34ea('0x15')]);return _0x3b3d29(_0x33a442['error'][_0x34ea('0x15')]);}else{logger['info'](_0x34ea('0xe'),_0x219313,_0x34ea('0x11'));_0x3b3d29(_0x33a442[_0x34ea('0x16')][_0x34ea('0x15')]);}})[_0x34ea('0x17')](function(_0x5edf4b){logger[_0x34ea('0x13')](_0x34ea('0xe'),_0x219313,_0x5edf4b);_0x3842ed(_0x5edf4b);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 704c336..8752b79 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 _0x119b=['clone','/:id/sections','addSections','addResources','put','update','destroy','removeSections','delete','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/resources','getResources','post','create','/:id/clone'];(function(_0x70aafd,_0x450a9b){var _0x4c023d=function(_0x50b4e5){while(--_0x50b4e5){_0x70aafd['push'](_0x70aafd['shift']());}};_0x4c023d(++_0x450a9b);}(_0x119b,0xb9));var _0xb119=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x119b[_0x4e783c];return _0x2fbd6d;};'use strict';var multer=require(_0xb119('0x0'));var util=require(_0xb119('0x1'));var path=require(_0xb119('0x2'));var timeout=require(_0xb119('0x3'));var express=require('express');var router=express[_0xb119('0x4')]();var auth=require(_0xb119('0x5'));var interaction=require(_0xb119('0x6'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0xb119('0x7')]('/',auth[_0xb119('0x8')](),controller[_0xb119('0x9')]);router[_0xb119('0x7')](_0xb119('0xa'),auth[_0xb119('0x8')](),controller['describe']);router['get'](_0xb119('0xb'),auth[_0xb119('0x8')](),controller[_0xb119('0xc')]);router[_0xb119('0x7')](_0xb119('0xd'),auth[_0xb119('0x8')](),controller[_0xb119('0xe')]);router[_0xb119('0xf')]('/',auth[_0xb119('0x8')](),controller[_0xb119('0x10')]);router[_0xb119('0xf')](_0xb119('0x11'),auth[_0xb119('0x8')](),controller[_0xb119('0x12')]);router[_0xb119('0xf')](_0xb119('0x13'),auth[_0xb119('0x8')](),controller[_0xb119('0x14')]);router[_0xb119('0xf')]('/:id/resources',auth['isAuthenticated'](),controller[_0xb119('0x15')]);router[_0xb119('0x16')](_0xb119('0xb'),auth['isAuthenticated'](),controller[_0xb119('0x17')]);router['delete'](_0xb119('0xb'),auth[_0xb119('0x8')](),controller[_0xb119('0x18')]);router['delete'](_0xb119('0x13'),auth[_0xb119('0x8')](),controller[_0xb119('0x19')]);router[_0xb119('0x1a')](_0xb119('0xd'),auth[_0xb119('0x8')](),controller[_0xb119('0x1b')]);module[_0xb119('0x1c')]=router; \ No newline at end of file +var _0x1c1b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','post','/:id/resources','addResources','put','destroy','delete','removeResources','exports','multer','path','connect-timeout'];(function(_0x6fcc4e,_0x267da2){var _0x32023f=function(_0xd4d71b){while(--_0xd4d71b){_0x6fcc4e['push'](_0x6fcc4e['shift']());}};_0x32023f(++_0x267da2);}(_0x1c1b,0xb5));var _0xb1c1=function(_0x56625d,_0x12e6e9){_0x56625d=_0x56625d-0x0;var _0x3bf11b=_0x1c1b[_0x56625d];return _0x3bf11b;};'use strict';var multer=require(_0xb1c1('0x0'));var util=require('util');var path=require(_0xb1c1('0x1'));var timeout=require(_0xb1c1('0x2'));var express=require(_0xb1c1('0x3'));var router=express[_0xb1c1('0x4')]();var auth=require(_0xb1c1('0x5'));var interaction=require(_0xb1c1('0x6'));var config=require(_0xb1c1('0x7'));var controller=require(_0xb1c1('0x8'));router[_0xb1c1('0x9')]('/',auth[_0xb1c1('0xa')](),controller[_0xb1c1('0xb')]);router['get'](_0xb1c1('0xc'),auth['isAuthenticated'](),controller[_0xb1c1('0xd')]);router[_0xb1c1('0x9')](_0xb1c1('0xe'),auth[_0xb1c1('0xa')](),controller['show']);router['get']('/:id/resources',auth[_0xb1c1('0xa')](),controller['getResources']);router[_0xb1c1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb1c1('0xf')]('/:id/clone',auth[_0xb1c1('0xa')](),controller['clone']);router[_0xb1c1('0xf')]('/:id/sections',auth[_0xb1c1('0xa')](),controller['addSections']);router['post'](_0xb1c1('0x10'),auth['isAuthenticated'](),controller[_0xb1c1('0x11')]);router[_0xb1c1('0x12')](_0xb1c1('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb1c1('0xe'),auth[_0xb1c1('0xa')](),controller[_0xb1c1('0x13')]);router['delete']('/:id/sections',auth[_0xb1c1('0xa')](),controller['removeSections']);router[_0xb1c1('0x14')]('/:id/resources',auth['isAuthenticated'](),controller[_0xb1c1('0x15')]);module[_0xb1c1('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 121b084..1c572ee 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 _0xf6af=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf6af,0xd7));var _0xff6a=function(_0x1fa50d,_0x2a6416){_0x1fa50d=_0x1fa50d-0x0;var _0x534610=_0xf6af[_0x1fa50d];return _0x534610;};'use strict';var Sequelize=require(_0xff6a('0x0'));module[_0xff6a('0x1')]={'name':{'type':Sequelize[_0xff6a('0x2')],'allowNull':![],'unique':_0xff6a('0x3')},'crudPermissions':{'type':Sequelize[_0xff6a('0x2')],'set':function(_0x4e9df4){this[_0xff6a('0x4')](_0xff6a('0x5'),_0x4e9df4?_0x4e9df4[_0xff6a('0x6')](''):[]);},'get':function(){return this[_0xff6a('0x7')](_0xff6a('0x5'))?this[_0xff6a('0x7')](_0xff6a('0x5'))[_0xff6a('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xff6a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd6c8=['sequelize','exports','STRING','name','crudPermissions','getDataValue'];(function(_0xd444ac,_0x149222){var _0x1413ab=function(_0x4f9826){while(--_0x4f9826){_0xd444ac['push'](_0xd444ac['shift']());}};_0x1413ab(++_0x149222);}(_0xd6c8,0x12c));var _0x8d6c=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0xd6c8[_0x460666];return _0x555cbf;};'use strict';var Sequelize=require(_0x8d6c('0x0'));module[_0x8d6c('0x1')]={'name':{'type':Sequelize[_0x8d6c('0x2')],'allowNull':![],'unique':_0x8d6c('0x3')},'crudPermissions':{'type':Sequelize[_0x8d6c('0x2')],'set':function(_0x143c40){this['setDataValue'](_0x8d6c('0x4'),_0x143c40?_0x143c40['join'](''):[]);},'get':function(){return this[_0x8d6c('0x5')](_0x8d6c('0x4'))?this[_0x8d6c('0x5')](_0x8d6c('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8d6c('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9e9d6e6..47879eb 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 _0xdab3=['error','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','UserProfile','findAll','rows','show','catch','create','body','clone','updatedAt','crudPermissions','omit','createdAt','sequelize','transaction','get','params','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','UserProfileSection','userProfileId','push','removeSections','ids','addResources','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','ignore','isEmpty','union','hasOwnProperty','nolimit','associatedResources','foreignKey','forEach','AnalyticExtractedReport','reportType','default','DefaultReports','custom','reportId','CustomReports','count','CmContact','color','ThroughTags','tag','field','value','resourceId','toLowerCase','squareprojects','SquareProject','squarerecordings','SquareProjects','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','teams','Team','queuecampaigns','users','telephones','Users','Agents','Telephones','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','AnalyticMetric','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','set','save','update','then','destroy'];(function(_0x145c99,_0x3fdb01){var _0x52a05f=function(_0x36feb0){while(--_0x36feb0){_0x145c99['push'](_0x145c99['shift']());}};_0x52a05f(++_0x3fdb01);}(_0xdab3,0x19e));var _0x3dab=function(_0x3a6be2,_0x2fa030){_0x3a6be2=_0x3a6be2-0x0;var _0x3c323e=_0xdab3[_0x3a6be2];return _0x3c323e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3dab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dab('0x1'));var rp=require(_0x3dab('0x2'));var moment=require(_0x3dab('0x3'));var BPromise=require(_0x3dab('0x4'));var Mustache=require(_0x3dab('0x5'));var util=require(_0x3dab('0x6'));var path=require(_0x3dab('0x7'));var sox=require(_0x3dab('0x8'));var csv=require('to-csv');var ejs=require(_0x3dab('0x9'));var fs=require('fs');var _=require(_0x3dab('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dab('0xb'));var deskjs=require(_0x3dab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3dab('0xd'));var Papa=require('papaparse');var Redis=require(_0x3dab('0xe'));var authService=require(_0x3dab('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3dab('0x10'));var logger=require(_0x3dab('0x11'))(_0x3dab('0x12'));var utils=require(_0x3dab('0x13'));var config=require('../../config/environment');var db=require(_0x3dab('0x14'))['db'];config['redis']=_[_0x3dab('0x15')](config[_0x3dab('0x16')],{'host':_0x3dab('0x17'),'port':0x18eb});var socket=require(_0x3dab('0x18'))(new Redis(config[_0x3dab('0x16')]));require(_0x3dab('0x19'))['register'](socket);function respondWithStatusCode(_0x5085b7,_0x2c020f){_0x2c020f=_0x2c020f||0xcc;return function(_0x16fef8){if(_0x16fef8){return _0x5085b7[_0x3dab('0x1a')](_0x2c020f);}return _0x5085b7[_0x3dab('0x1b')](_0x2c020f)[_0x3dab('0x1c')]();};}function respondWithResult(_0x5bc37c,_0x25ce04){_0x25ce04=_0x25ce04||0xc8;return function(_0x405053){if(_0x405053){return _0x5bc37c[_0x3dab('0x1b')](_0x25ce04)[_0x3dab('0x1d')](_0x405053);}};}function respondWithFilteredResult(_0x2041be,_0x13f078){return function(_0x878040){if(_0x878040){var _0x2dae98=_0x878040['count'],_0x3a8d57=_0x13f078[_0x3dab('0x1e')],_0x278b7e=_0x13f078[_0x3dab('0x1e')]+_0x13f078['limit'],_0x54bed0;if(_0x278b7e>=_0x2dae98){_0x278b7e=_0x2dae98;_0x54bed0=0xc8;}else{_0x54bed0=0xce;}_0x2041be['status'](_0x54bed0);return _0x2041be[_0x3dab('0x1f')]('Content-Range',_0x3a8d57+'-'+_0x278b7e+'/'+_0x2dae98)['json'](_0x878040);}return null;};}function patchUpdates(_0x598f81){return function(_0x39fc3a){try{jsonpatch['apply'](_0x39fc3a,_0x598f81,!![]);}catch(_0x48c713){return BPromise['reject'](_0x48c713);}return _0x39fc3a[_0x3dab('0x20')]();};}function saveUpdates(_0x2e8971,_0x5d80a2){return function(_0x2709ac){if(_0x2709ac){return _0x2709ac[_0x3dab('0x21')](_0x2e8971)[_0x3dab('0x22')](function(_0x3cd36e){return _0x3cd36e;});}return null;};}function removeEntity(_0x4310ea,_0x961c4d){return function(_0xd8c069){if(_0xd8c069){return _0xd8c069[_0x3dab('0x23')]()[_0x3dab('0x22')](function(){_0x4310ea[_0x3dab('0x1b')](0xcc)[_0x3dab('0x1c')]();});}};}function handleEntityNotFound(_0xde8141,_0x43ed3f){return function(_0x357679){if(!_0x357679){_0xde8141[_0x3dab('0x1a')](0x194);}return _0x357679;};}function handleError(_0x139019,_0x21407d){_0x21407d=_0x21407d||0x1f4;return function(_0x433178){logger[_0x3dab('0x24')](_0x433178['stack']);if(_0x433178[_0x3dab('0x25')]){delete _0x433178[_0x3dab('0x25')];}_0x139019[_0x3dab('0x1b')](_0x21407d)[_0x3dab('0x26')](_0x433178);};}exports['index']=function(_0x5f518d,_0x20ae3e){var _0x2fb7a7={},_0x5b1173={},_0x360515={'count':0x0,'rows':[]};var _0xe8240a=db['UserProfile'][_0x3dab('0x27')];_0x5b1173[_0x3dab('0x28')]=_[_0x3dab('0x29')](_0xe8240a);_0x5b1173[_0x3dab('0x2a')]=_[_0x3dab('0x29')](_0x5f518d[_0x3dab('0x2a')]);_0x5b1173[_0x3dab('0x2b')]=_[_0x3dab('0x2c')](_0x5b1173[_0x3dab('0x28')],_0x5b1173[_0x3dab('0x2a')]);_0x2fb7a7[_0x3dab('0x2d')]=_[_0x3dab('0x2c')](_0x5b1173['model'],qs[_0x3dab('0x2e')](_0x5f518d[_0x3dab('0x2a')][_0x3dab('0x2e')]));_0x2fb7a7[_0x3dab('0x2d')]=_0x2fb7a7[_0x3dab('0x2d')][_0x3dab('0x2f')]?_0x2fb7a7[_0x3dab('0x2d')]:_0x5b1173[_0x3dab('0x28')];if(!_0x5f518d['query']['hasOwnProperty']('nolimit')){_0x2fb7a7['limit']=qs[_0x3dab('0x30')](_0x5f518d[_0x3dab('0x2a')][_0x3dab('0x30')]);_0x2fb7a7[_0x3dab('0x1e')]=qs[_0x3dab('0x1e')](_0x5f518d[_0x3dab('0x2a')][_0x3dab('0x1e')]);}_0x2fb7a7[_0x3dab('0x31')]=qs[_0x3dab('0x32')](_0x5f518d[_0x3dab('0x2a')]['sort']);_0x2fb7a7[_0x3dab('0x33')]=qs['filters'](_[_0x3dab('0x34')](_0x5f518d[_0x3dab('0x2a')],_0x5b1173[_0x3dab('0x2b')]));if(_0x5f518d[_0x3dab('0x2a')][_0x3dab('0x35')]){_0x2fb7a7[_0x3dab('0x33')]=_[_0x3dab('0x36')](_0x2fb7a7['where'],{'$or':_[_0x3dab('0x37')](_0xe8240a,function(_0x2c145b){if(_0x2c145b[_0x3dab('0x38')][_0x3dab('0x39')]!==_0x3dab('0x3a')){var _0x42ca75={};_0x42ca75[_0x2c145b['field']]={'$like':'%'+_0x5f518d[_0x3dab('0x2a')][_0x3dab('0x35')]+'%'};return _0x42ca75;}})});}_0x2fb7a7=_['merge']({},_0x2fb7a7,_0x5f518d[_0x3dab('0x3b')]);var _0x11aedd={'where':_0x2fb7a7[_0x3dab('0x33')]};return db['UserProfile']['count'](_0x11aedd)[_0x3dab('0x22')](function(_0x498dd6){_0x360515['count']=_0x498dd6;if(_0x5f518d['query'][_0x3dab('0x3c')]){_0x2fb7a7[_0x3dab('0x3d')]=[{'all':!![]}];}return db[_0x3dab('0x3e')][_0x3dab('0x3f')](_0x2fb7a7);})['then'](function(_0x28f918){_0x360515[_0x3dab('0x40')]=_0x28f918;return _0x360515;})['then'](respondWithFilteredResult(_0x20ae3e,_0x2fb7a7))['catch'](handleError(_0x20ae3e,null));};exports[_0x3dab('0x41')]=function(_0x1c4dae,_0x47ac46){var _0x2e586a={'raw':![],'where':{'id':_0x1c4dae['params']['id']}},_0x2d9b83={};_0x2d9b83[_0x3dab('0x28')]=_['keys'](db[_0x3dab('0x3e')][_0x3dab('0x27')]);_0x2d9b83[_0x3dab('0x2a')]=_[_0x3dab('0x29')](_0x1c4dae[_0x3dab('0x2a')]);_0x2d9b83[_0x3dab('0x2b')]=_[_0x3dab('0x2c')](_0x2d9b83[_0x3dab('0x28')],_0x2d9b83[_0x3dab('0x2a')]);_0x2e586a[_0x3dab('0x2d')]=_[_0x3dab('0x2c')](_0x2d9b83[_0x3dab('0x28')],qs[_0x3dab('0x2e')](_0x1c4dae[_0x3dab('0x2a')][_0x3dab('0x2e')]));_0x2e586a[_0x3dab('0x2d')]=_0x2e586a[_0x3dab('0x2d')][_0x3dab('0x2f')]?_0x2e586a[_0x3dab('0x2d')]:_0x2d9b83[_0x3dab('0x28')];if(_0x1c4dae[_0x3dab('0x2a')][_0x3dab('0x3c')]){_0x2e586a['include']=[{'all':!![]}];}_0x2e586a=_['merge']({},_0x2e586a,_0x1c4dae[_0x3dab('0x3b')]);return db[_0x3dab('0x3e')]['find'](_0x2e586a)['then'](handleEntityNotFound(_0x47ac46,null))[_0x3dab('0x22')](respondWithResult(_0x47ac46,null))[_0x3dab('0x42')](handleError(_0x47ac46,null));};exports['create']=function(_0x4f1aa5,_0x1446a9){return db['UserProfile'][_0x3dab('0x43')](_0x4f1aa5[_0x3dab('0x44')],{})[_0x3dab('0x22')](respondWithResult(_0x1446a9,0xc9))[_0x3dab('0x42')](handleError(_0x1446a9,null));};exports[_0x3dab('0x45')]=function(_0x206af4,_0xc7e400){var _0x5a3841={'raw':![],'where':{'id':_0x206af4['params']['id']}},_0x589d38={};_0x589d38[_0x3dab('0x28')]=_[_0x3dab('0x29')](db[_0x3dab('0x3e')][_0x3dab('0x27')]);_0x5a3841[_0x3dab('0x2d')]=_[_0x3dab('0x2c')](_0x589d38[_0x3dab('0x28')],qs[_0x3dab('0x2e')](_0x206af4[_0x3dab('0x2a')][_0x3dab('0x2e')]));_0x5a3841[_0x3dab('0x2d')]=_0x5a3841['attributes']['length']?_0x5a3841[_0x3dab('0x2d')]:_0x589d38[_0x3dab('0x28')];if(_0x206af4['query'][_0x3dab('0x3c')]){_0x5a3841[_0x3dab('0x3d')]=[{'all':!![]}];}_0x5a3841=_[_0x3dab('0x36')]({},_0x5a3841,_0x206af4['options']);return db[_0x3dab('0x3e')]['find'](_0x5a3841)[_0x3dab('0x22')](handleEntityNotFound(_0xc7e400,null))[_0x3dab('0x22')](function(_0x1427ce){if(_0x1427ce){var _0x3ff9dc=_0x1427ce['get']({'plain':!![]});_0x3ff9dc=qs['omit'](_0x3ff9dc,['id','createdAt',_0x3dab('0x46'),_0x3dab('0x47')]);_0x206af4[_0x3dab('0x44')]=_[_0x3dab('0x48')](_0x206af4[_0x3dab('0x44')],['id',_0x3dab('0x49'),'updatedAt']);return db[_0x3dab('0x4a')][_0x3dab('0x4b')](function(_0x258788){return db[_0x3dab('0x3e')]['create'](_[_0x3dab('0x36')](_0x3ff9dc,_0x206af4[_0x3dab('0x44')]),{'include':_0x206af4[_0x3dab('0x2a')][_0x3dab('0x3c')]?[{'all':!![]}]:undefined,'transaction':_0x258788})[_0x3dab('0x22')](function(_0xfb1fd3){var _0x311531=_0xfb1fd3[_0x3dab('0x4c')]({'plain':!![]});return db['UserProfileSection'][_0x3dab('0x3f')]({'where':{'userProfileId':_0x206af4[_0x3dab('0x4d')]['id']},'raw':!![]})[_0x3dab('0x22')](function(_0x53cc8f){if(_0x53cc8f){return BPromise[_0x3dab('0x4e')](_0x53cc8f,function(_0x410263){return new BPromise(function(_0x510a42,_0x4c0f89){if(_0x410263[_0x3dab('0x4f')]===null||_0x410263[_0x3dab('0x4f')]===0x1)_0x510a42(null);return db[_0x3dab('0x50')]['findAll']({'where':{'sectionId':_0x410263['id']},'raw':!![]})['then'](function(_0x1769b4){var _0x1aa427=_[_0x3dab('0x37')](_0x1769b4,function(_0x14d54c){return qs[_0x3dab('0x48')](_0x14d54c,['id',_0x3dab('0x49'),'updatedAt',_0x3dab('0x51')]);});_0x510a42(_0x1aa427);})['catch'](function(_0x38f47c){_0x4c0f89(_0x38f47c);});})['then'](function(_0xd5299c){var _0x59f6d0=qs['omit'](_0x410263,['id',_0x3dab('0x49'),_0x3dab('0x46')]);_0x59f6d0['userProfileId']=_0x311531['id'];if(_0xd5299c)_0x59f6d0[_0x3dab('0x52')]=_0xd5299c;return _0x59f6d0;})['then'](function(_0x3e2788){return db['UserProfileSection'][_0x3dab('0x43')](_0x3e2788,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x258788});});})[_0x3dab('0x22')](function(){return _0x311531;});}});});});}})['then'](respondWithResult(_0xc7e400,0xc9))['catch'](handleError(_0xc7e400,null));};exports[_0x3dab('0x21')]=function(_0x42d7b7,_0x523b2){if(_0x42d7b7[_0x3dab('0x44')]['id']){delete _0x42d7b7[_0x3dab('0x44')]['id'];}return db[_0x3dab('0x3e')][_0x3dab('0x53')]({'where':{'id':_0x42d7b7[_0x3dab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x523b2,null))[_0x3dab('0x22')](saveUpdates(_0x42d7b7[_0x3dab('0x44')],null))[_0x3dab('0x22')](respondWithResult(_0x523b2,null))[_0x3dab('0x42')](handleError(_0x523b2,null));};exports[_0x3dab('0x23')]=function(_0x3d195a,_0x3c6cc1){return db[_0x3dab('0x3e')][_0x3dab('0x53')]({'where':{'id':_0x3d195a[_0x3dab('0x4d')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x3c6cc1,null))[_0x3dab('0x22')](removeEntity(_0x3c6cc1,null))['catch'](handleError(_0x3c6cc1,null));};exports['describe']=function(_0x577d87,_0x350703){return db[_0x3dab('0x3e')][_0x3dab('0x54')]()[_0x3dab('0x22')](respondWithResult(_0x350703,null))[_0x3dab('0x42')](handleError(_0x350703,null));};exports[_0x3dab('0x55')]=function(_0x9c28c7,_0xa0a03a){var _0x3bb61e=_0x9c28c7['body'];return db['UserProfile'][_0x3dab('0x53')]({'where':{'id':_0x9c28c7[_0x3dab('0x4d')]['id']}})['then'](handleEntityNotFound(_0xa0a03a,null))[_0x3dab('0x22')](function(_0x725e85){if(_0x725e85){return db[_0x3dab('0x4a')]['transaction'](function(_0x1bd8e3){return db[_0x3dab('0x56')][_0x3dab('0x23')]({'where':{'userProfileId':_0x9c28c7[_0x3dab('0x4d')]['id'],'sectionId':_['map'](_0x3bb61e,function(_0x2c0584){return _0x2c0584['sectionId'];})},'transaction':_0x1bd8e3})[_0x3dab('0x22')](function(){var _0x580bac=_[_0x3dab('0x37')](_0x3bb61e,function(_0x21676e){_0x21676e[_0x3dab('0x57')]=_0x9c28c7[_0x3dab('0x4d')]['id'];return _0x21676e;});var _0xdc6381=[];return BPromise[_0x3dab('0x4e')](_0x580bac,function(_0x294f89){return db[_0x3dab('0x56')][_0x3dab('0x43')](_0x294f89,{'include':[{'model':db[_0x3dab('0x50')],'as':_0x3dab('0x52')}],'raw':!![],'transaction':_0x1bd8e3})['then'](function(_0x4fc957){_0xdc6381[_0x3dab('0x58')](_0x4fc957[_0x3dab('0x4c')]({'plain':!![]}));});})[_0x3dab('0x22')](function(){return _0xdc6381;});});});}})[_0x3dab('0x22')](function(_0x4dc940){return _0x4dc940;})[_0x3dab('0x22')](respondWithResult(_0xa0a03a,null))[_0x3dab('0x42')](handleError(_0xa0a03a,null));};exports[_0x3dab('0x59')]=function(_0x23bd15,_0x4606ce){var _0xb1c97a;return db[_0x3dab('0x3e')]['find']({'where':{'id':_0x23bd15[_0x3dab('0x4d')]['id']},'attributes':['id',_0x3dab('0x25')]})[_0x3dab('0x22')](handleEntityNotFound(_0x4606ce,null))[_0x3dab('0x22')](function(_0x5339dc){if(_0x5339dc){_0xb1c97a=_0x5339dc;return db[_0x3dab('0x56')][_0x3dab('0x23')]({'where':{'userProfileId':_0x23bd15[_0x3dab('0x4d')]['id'],'sectionId':_0x23bd15[_0x3dab('0x2a')][_0x3dab('0x5a')]}});}})[_0x3dab('0x22')](function(){return _0xb1c97a;})[_0x3dab('0x22')](respondWithStatusCode(_0x4606ce,null))['catch'](handleError(_0x4606ce,null));};exports[_0x3dab('0x5b')]=function(_0x301327,_0x575759){return db[_0x3dab('0x3e')][_0x3dab('0x53')]({'where':{'id':_0x301327[_0x3dab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x575759,null))[_0x3dab('0x22')](function(_0x519763){if(_0x519763){return db[_0x3dab('0x4a')][_0x3dab('0x4b')](function(_0xdf265b){return db['UserProfileSection'][_0x3dab('0x3f')]({'where':{'userProfileId':_0x301327[_0x3dab('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x3dab('0x22')](function(_0x185c9f){if(_0x185c9f){return db[_0x3dab('0x56')][_0x3dab('0x23')]({'where':{'userProfileId':_0x301327[_0x3dab('0x4d')]['id'],'id':_[_0x3dab('0x37')](_0x185c9f,function(_0x52cd0a){return _0x52cd0a['id'];})},'transaction':_0xdf265b});}})[_0x3dab('0x22')](function(_0x4d1bdb){var _0xa80d18=_[_0x3dab('0x37')](_0x301327[_0x3dab('0x44')],function(_0x46ce93){_0x46ce93[_0x3dab('0x57')]=_0x301327['params']['id'];return _0x46ce93;});return db['UserProfileSection']['bulkCreate'](_0xa80d18,{'raw':!![],'transaction':_0xdf265b});})[_0x3dab('0x22')](function(_0x2c36a2){var _0x26ab7f=_[_0x3dab('0x35')](_['map'](_0x2c36a2,function(_0xd496e8){return _0xd496e8[_0x3dab('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x26ab7f){return db['UserProfileSection'][_0x3dab('0x3f')]({'where':{'userProfileId':_0x301327[_0x3dab('0x4d')]['id'],'sectionId':_['map'](_0x26ab7f,function(_0x10f580){return _0x10f580[_0x3dab('0x51')];})},'attributes':['id',_0x3dab('0x51')],'raw':!![]})[_0x3dab('0x22')](function(_0x21082d){var _0x75e863=_[_0x3dab('0x37')](_0x301327[_0x3dab('0x44')],function(_0x2c3205){_0x2c3205[_0x3dab('0x57')]=_0x301327[_0x3dab('0x4d')]['id'];return _0x2c3205;});return db[_0x3dab('0x50')]['bulkCreate'](_0x75e863,{'raw':!![],'transaction':_0xdf265b});});}})[_0x3dab('0x42')](handleError(_0x575759,null));});}})[_0x3dab('0x22')](function(_0x3ace21){var _0x4cd31b=_[_0x3dab('0x37')](_0x3ace21,function(_0x420687){return _0x420687['get']({'plain':!![]});});})[_0x3dab('0x22')](respondWithResult(_0x575759,null))['catch'](handleError(_0x575759,null));};exports[_0x3dab('0x5c')]=function(_0x263619,_0x4285bf,_0x16e5e1){return db[_0x3dab('0x3e')][_0x3dab('0x53')]({'where':{'id':_0x263619[_0x3dab('0x4d')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x4285bf,null))['then'](function(_0x2eab56){if(_0x2eab56){return _0x2eab56[_0x3dab('0x5c')](_0x263619[_0x3dab('0x2a')][_0x3dab('0x5a')]);}})[_0x3dab('0x22')](respondWithStatusCode(_0x4285bf,null))['catch'](handleError(_0x4285bf,null));};exports[_0x3dab('0x5d')]=function(_0x4564fb,_0x1e7124){var _0x3f17b3={'raw':![],'where':{}};var _0x596f15={};var _0x4948f6={'count':0x0,'rows':[]};var _0x521126=_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x5e')];if(typeof _0x521126===_0x3dab('0x5f')){throw new db[(_0x3dab('0x60'))][(_0x3dab('0x61'))](_0x3dab('0x62'));}var _0x2c627d=_0x4564fb['query'][_0x3dab('0x63')]||![];var _0x300c33=getQueryModels(_0x521126,_0x2c627d);if(typeof _0x300c33[_0x3dab('0x64')]==='undefined'){throw new db[(_0x3dab('0x60'))][(_0x3dab('0x61'))](_0x3dab('0x65')+_0x521126+'\x27');}var _0x323e41=[];if(!_['isEmpty'](_0x300c33[_0x3dab('0x66')])){_0x323e41=_0x300c33[_0x3dab('0x66')];}else{_0x323e41=[{'name':_0x521126}];}return db[_0x3dab('0x3e')][_0x3dab('0x67')]({'where':{'id':_0x4564fb[_0x3dab('0x4d')]['id']}})[_0x3dab('0x22')](handleEntityNotFound(_0x1e7124,null))[_0x3dab('0x22')](function(_0x317ebf){if(_0x317ebf){var _0x9aaf2d=[];for(var _0x38a001=0x0;_0x38a001<_0x323e41[_0x3dab('0x2f')];_0x38a001++){_0x9aaf2d[_0x3dab('0x58')](db[_0x3dab('0x56')][_0x3dab('0x67')]({'where':{'userProfileId':_0x317ebf['id'],'name':_0x323e41[_0x38a001][_0x3dab('0x25')]},'raw':!![]}));}return BPromise['all'](_0x9aaf2d);}})[_0x3dab('0x22')](function(_0x3061e3){var _0x186006=_[_0x3dab('0x35')](_0x3061e3,function(_0x3f97e8){return _0x3f97e8?_0x3f97e8:undefined;});var _0x450141=_['filter'](_0x323e41,[_0x3dab('0x68'),!![]]);var _0x248dd7=_['isEmpty'](_0x186006)&&_[_0x3dab('0x69')](_0x450141)?null:_[_0x3dab('0x6a')](_0x450141,_0x186006);if(_0x248dd7){var _0x510b7a=[];for(var _0x3fc995=0x0;_0x3fc995<_0x248dd7['length'];_0x3fc995++){var _0x197ae0=_[_0x3dab('0x53')](_0x323e41,function(_0x5108b5){return _0x248dd7[_0x3fc995]?_0x5108b5['name']===_0x248dd7[_0x3fc995][_0x3dab('0x25')]:null;});if(_0x197ae0){if(_0x248dd7[_0x3fc995]['ignore']){_0x510b7a['push'](getAllResources(_0x300c33[_0x3dab('0x64')],_0x248dd7[_0x3fc995]));}else{if(!_0x248dd7[_0x3fc995][_0x3dab('0x4f')]){_0x510b7a['push'](getAllowedResources(_0x197ae0,_0x248dd7[_0x3fc995],_0x300c33[_0x3dab('0x64')]));}else{if(_0x197ae0[_0x3dab('0x28')]){_0x510b7a[_0x3dab('0x58')](getAllFilteredResources(_0x197ae0,_0x248dd7[_0x3fc995]));}}}}}return BPromise['all'](_0x510b7a);}else{return null;}})[_0x3dab('0x22')](function(_0x1faa7d){var _0x35e215=_0x1faa7d;var _0x4e9364=null;if(_0x35e215){_0x4e9364=_0x35e215['length']===0x1?_0x35e215[0x0]:null;}if(_0x4e9364||_0x35e215){var _0x23cbc1=db[_0x300c33[_0x3dab('0x64')]][_0x3dab('0x27')];_0x596f15[_0x3dab('0x28')]=_[_0x3dab('0x29')](_0x23cbc1);_0x596f15['query']=_[_0x3dab('0x29')](_0x4564fb[_0x3dab('0x2a')]);_0x596f15['filters']=_[_0x3dab('0x2c')](_0x596f15[_0x3dab('0x28')],_0x596f15[_0x3dab('0x2a')]);_0x3f17b3[_0x3dab('0x2d')]=_[_0x3dab('0x2c')](_0x596f15[_0x3dab('0x28')],qs['fields'](_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x2e')]));_0x3f17b3[_0x3dab('0x2d')]=_0x3f17b3[_0x3dab('0x2d')]['length']?_0x3f17b3['attributes']:_0x596f15[_0x3dab('0x28')];if(!_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x6b')](_0x3dab('0x6c'))){_0x3f17b3[_0x3dab('0x30')]=qs[_0x3dab('0x30')](_0x4564fb[_0x3dab('0x2a')]['limit']);_0x3f17b3[_0x3dab('0x1e')]=qs[_0x3dab('0x1e')](_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x1e')]);}_0x3f17b3[_0x3dab('0x31')]=qs[_0x3dab('0x32')](_0x4564fb['query'][_0x3dab('0x32')]);_0x3f17b3[_0x3dab('0x33')]=qs[_0x3dab('0x2b')](_[_0x3dab('0x34')](_0x4564fb[_0x3dab('0x2a')],_0x596f15[_0x3dab('0x2b')]));if(_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x35')]){_0x3f17b3[_0x3dab('0x33')]=_[_0x3dab('0x36')](_0x3f17b3['where'],{'$or':_[_0x3dab('0x37')](_0x23cbc1,function(_0x290e5e){if(_0x290e5e[_0x3dab('0x38')][_0x3dab('0x39')]!==_0x3dab('0x3a')){var _0x5ea9e2={};_0x5ea9e2[_0x290e5e['field']]={'$like':'%'+_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x35')]+'%'};return _0x5ea9e2;}})});}var _0x764310=[];if(_0x4e9364){var _0x15dc13=_[_0x3dab('0x53')](_0x323e41,['name',_0x4e9364[_0x3dab('0x25')]]);if(_0x15dc13['field']){var _0x36ee76={};if(_0x300c33['childModel']==='AnalyticExtractedReport'){_0x36ee76[_0x15dc13['foreignKey']]=_[_0x3dab('0x37')](_0x4e9364[_0x3dab('0x6d')],'id');}else{_0x36ee76[_0x15dc13[_0x3dab('0x6e')]]=_0x4e9364['associatedResources'];}_0x764310['push'](_0x36ee76);}else{_0x3f17b3[_0x3dab('0x33')]['id']=_0x4e9364['associatedResources'];}}else{for(var _0x541858=0x0;_0x541858<_0x35e215['length'];_0x541858++){var _0x15dc13=_[_0x3dab('0x53')](_0x323e41,[_0x3dab('0x25'),_0x35e215[_0x541858][_0x3dab('0x25')]]);if(_0x15dc13['field']){var _0x36ee76={};_0x36ee76[_0x15dc13[_0x3dab('0x6e')]]=_0x35e215[_0x541858][_0x3dab('0x6d')];_0x764310['push'](_0x36ee76);}else{if(!_0x3f17b3[_0x3dab('0x33')]['id'])_0x3f17b3[_0x3dab('0x33')]['id']=[];_0x35e215[_0x541858][_0x3dab('0x6d')][_0x3dab('0x6f')](function(_0x1b5e06){_0x3f17b3['where']['id'][_0x3dab('0x58')](_0x1b5e06);});}}}if(!_['isEmpty'](_0x764310)){_0x3f17b3['where']=_[_0x3dab('0x36')](_0x3f17b3[_0x3dab('0x33')],{'$and':{'$or':_0x764310}});}_0x3f17b3=_[_0x3dab('0x36')]({},_0x3f17b3,_0x4564fb[_0x3dab('0x3b')]);if(_0x4e9364&&!_0x4e9364[_0x3dab('0x4f')]&&_0x300c33['childModel']===_0x3dab('0x70')){if(_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x3c')]){_0x3f17b3[_0x3dab('0x3d')]=[{'all':!![]}];}return db[_0x300c33[_0x3dab('0x64')]][_0x3dab('0x3f')](_0x3f17b3)[_0x3dab('0x22')](function(_0x503057){var _0x1f6c06=[];_0x503057['forEach'](function(_0x425c3b){var _0xb532d;switch(_0x425c3b[_0x3dab('0x71')]){case _0x3dab('0x72'):_0xb532d=_[_0x3dab('0x53')](_0x4e9364[_0x3dab('0x6d')],function(_0x411dc3){return _0x411dc3['id']===_0x425c3b['reportId']&&_0x411dc3[_0x3dab('0x38')]===_0x3dab('0x73');});break;case _0x3dab('0x74'):_0xb532d=_[_0x3dab('0x53')](_0x4e9364[_0x3dab('0x6d')],function(_0x3a0c7c){return _0x3a0c7c['id']===_0x425c3b[_0x3dab('0x75')]&&_0x3a0c7c['type']===_0x3dab('0x76');});break;}if(_0xb532d)_0x1f6c06[_0x3dab('0x58')](_0x425c3b);});_0x4948f6[_0x3dab('0x77')]=_0x1f6c06[_0x3dab('0x2f')];_0x4948f6[_0x3dab('0x40')]=_0x1f6c06;return _0x4948f6;});}else{return db[_0x300c33[_0x3dab('0x64')]][_0x3dab('0x77')]({'where':_0x3f17b3[_0x3dab('0x33')]})[_0x3dab('0x22')](function(_0x34ac90){_0x4948f6[_0x3dab('0x77')]=_0x34ac90;if(_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x3c')]){if(_0x300c33[_0x3dab('0x64')]===_0x3dab('0x78')){_0x3f17b3[_0x3dab('0x3d')]=[{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x3dab('0x79')],'required':_0x4564fb[_0x3dab('0x2a')]['tag']?!![]:![]},{'model':db['Tag'],'as':_0x3dab('0x7a'),'attributes':['id','name',_0x3dab('0x79')],'through':_0x4564fb['query']['tag']?{'attributes':[],'where':{'TagId':_0x4564fb[_0x3dab('0x2a')]['tag']||undefined}}:{},'required':_0x4564fb[_0x3dab('0x2a')][_0x3dab('0x7b')]?!![]:![]}];}else{_0x3f17b3[_0x3dab('0x3d')]=[{'all':!![]}];}}return db[_0x300c33[_0x3dab('0x64')]][_0x3dab('0x3f')](_0x3f17b3);})['then'](function(_0x5b1e49){_0x4948f6[_0x3dab('0x40')]=_0x5b1e49;return _0x4948f6;});}}else{return _0x4948f6;}})[_0x3dab('0x22')](respondWithFilteredResult(_0x1e7124,_0x3f17b3))[_0x3dab('0x42')](handleError(_0x1e7124,null));};function getAllResources(_0x4f7d49,_0x47e04d){return new BPromise(function(_0x29c89a,_0x57c687){if(_0x47e04d){var _0x44c6c2=_0x47e04d[_0x3dab('0x35')]?{[_0x47e04d[_0x3dab('0x35')]['field']]:_0x47e04d['filter']['value']}:undefined;return db[_0x4f7d49]['findAll']({'where':_0x44c6c2,'raw':!![]})['then'](function(_0x36ee44){_0x47e04d[_0x3dab('0x6d')]=_[_0x3dab('0x37')](_0x36ee44,'id');_0x29c89a(_0x47e04d);})[_0x3dab('0x42')](function(_0x4ed66a){_0x57c687(_0x4ed66a);});}else{_0x29c89a(null);}});}function getAllFilteredResources(_0x725565,_0x5f19f9){return new BPromise(function(_0x32ccb4,_0xa5f91){var _0x1b6eff=_0x725565['filter']?{[_0x725565[_0x3dab('0x35')][_0x3dab('0x7c')]]:_0x725565[_0x3dab('0x35')][_0x3dab('0x7d')]}:undefined;return db[_0x725565[_0x3dab('0x28')]][_0x3dab('0x3f')]({'where':_0x1b6eff,'raw':!![]})[_0x3dab('0x22')](function(_0x196e1b){_0x5f19f9[_0x3dab('0x6d')]=_[_0x3dab('0x37')](_0x196e1b,function(_0x109a64){return _0x109a64[_0x3dab('0x25')];});_0x32ccb4(_0x5f19f9);})[_0x3dab('0x42')](function(_0x496563){_0xa5f91(_0x496563);});});}function getAllowedResources(_0x4a0714,_0x520fc3,_0x96a7cb){return new BPromise(function(_0x4aabe2,_0x11eeb4){if(_0x520fc3){return db[_0x3dab('0x50')][_0x3dab('0x3f')]({'where':{'sectionId':_0x520fc3['id']},'raw':!![]})[_0x3dab('0x22')](function(_0x274810){if(_0x4a0714[_0x3dab('0x7c')]&&_0x4a0714[_0x3dab('0x7c')]!=='id'){_0x520fc3[_0x3dab('0x6d')]=_[_0x3dab('0x37')](_0x274810,function(_0x5bd61a){return _0x5bd61a[_0x4a0714['field']];});}else{if(_0x96a7cb===_0x3dab('0x70')){_0x520fc3['associatedResources']=_[_0x3dab('0x37')](_0x274810,function(_0x3a4119){return{'id':_0x3a4119['resourceId'],'type':_0x3a4119['type']};});}else{_0x520fc3[_0x3dab('0x6d')]=_['map'](_0x274810,function(_0x280bc1){return _0x280bc1[_0x3dab('0x7e')];});}}_0x4aabe2(_0x520fc3);})[_0x3dab('0x42')](function(_0x3a652b){_0x11eeb4(_0x3a652b);});}else{_0x4aabe2(null);}});}function getQueryModels(_0x8037d5,_0x1a8fa8){var _0x32365c=_0x8037d5[_0x3dab('0x7f')]();var _0x366c4d={'childModel':undefined,'parentSections':[]};switch(_0x32365c){case _0x3dab('0x80'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x81');break;case'odbc':_0x366c4d['childModel']='SquareOdbc';break;case _0x3dab('0x82'):_0x366c4d[_0x3dab('0x64')]='SquareRecording';_0x366c4d[_0x3dab('0x66')]=[{'name':_0x3dab('0x83'),'field':_0x3dab('0x25'),'foreignKey':'projectName'}];break;case _0x3dab('0x84'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x85');break;case _0x3dab('0x86'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x78');_0x366c4d[_0x3dab('0x66')]=[{'name':_0x3dab('0x87'),'field':'id','foreignKey':_0x3dab('0x88')}];break;case _0x3dab('0x89'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x8a');break;case _0x3dab('0x8b'):_0x366c4d['childModel']=_0x3dab('0x8c');break;case _0x3dab('0x8d'):_0x366c4d[_0x3dab('0x64')]='CmCustomField';break;case'chatqueues':_0x366c4d['childModel']=_0x3dab('0x8e');break;case _0x3dab('0x8f'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x90');break;case'faxqueues':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x91');break;case _0x3dab('0x92'):_0x366c4d[_0x3dab('0x64')]='FaxAccount';break;case _0x3dab('0x93'):case _0x3dab('0x94'):case _0x3dab('0x95'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x96');break;case _0x3dab('0x97'):_0x366c4d['childModel']=_0x3dab('0x98');break;case _0x3dab('0x99'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x9a');break;case _0x3dab('0x9b'):_0x366c4d[_0x3dab('0x64')]='VoiceRecording';_0x366c4d['parentSections']=[{'name':'Agents','field':_0x3dab('0x25'),'foreignKey':_0x3dab('0x9c'),'model':_0x3dab('0x9d'),'filter':{'field':_0x3dab('0x9e'),'value':[_0x3dab('0x9f')]}},{'name':'Telephones','field':_0x3dab('0x25'),'foreignKey':_0x3dab('0x9c'),'model':_0x3dab('0x9d'),'filter':{'field':_0x3dab('0x9e'),'value':[_0x3dab('0xa0')]}},{'name':_0x3dab('0xa1'),'field':_0x3dab('0x25'),'foreignKey':_0x3dab('0xa2'),'model':_0x3dab('0xa3'),'filter':{'field':_0x3dab('0x38'),'value':[_0x3dab('0xa4')]}},{'name':_0x3dab('0xa5'),'field':_0x3dab('0x25'),'foreignKey':_0x3dab('0xa2'),'model':_0x3dab('0xa3'),'filter':{'field':_0x3dab('0x38'),'value':[_0x3dab('0xa6')]}}];break;case'musiconholds':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xa7');break;case'chanspies':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xa8');break;case _0x3dab('0xa9'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xaa');break;case _0x3dab('0xab'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xac');break;case _0x3dab('0xad'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xae');break;case _0x3dab('0xaf'):_0x366c4d[_0x3dab('0x64')]='MailAccount';break;case _0x3dab('0xb0'):_0x366c4d[_0x3dab('0x64')]='MailSubstatus';break;case _0x3dab('0xb1'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xb2');break;case _0x3dab('0xb3'):_0x366c4d['childModel']=_0x3dab('0xb4');break;case _0x3dab('0xb5'):_0x366c4d[_0x3dab('0x64')]='SmsQueue';break;case _0x3dab('0xb6'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xb7');break;case _0x3dab('0xb8'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xb9');break;case'voicequeues':case _0x3dab('0xba'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xa3');if(_0x1a8fa8){_0x366c4d[_0x3dab('0x66')]=[{'name':'VoiceQueues'},{'name':_0x3dab('0xa5')}];}break;case _0x3dab('0xbb'):case'agents':case _0x3dab('0xbc'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x9d');if(_0x1a8fa8){_0x366c4d[_0x3dab('0x66')]=[{'name':_0x3dab('0xbd'),'filter':{'field':_0x3dab('0x9e'),'value':['admin','user']},'ignore':!![]},{'name':_0x3dab('0xbe')},{'name':_0x3dab('0xbf')}];}break;case'zendeskaccounts':_0x366c4d['childModel']=_0x3dab('0xc0');break;case _0x3dab('0xc1'):_0x366c4d['childModel']=_0x3dab('0xc2');break;case _0x3dab('0xc3'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xc4');break;case'sugarcrmaccounts':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xc5');break;case'deskaccounts':_0x366c4d[_0x3dab('0x64')]='DeskAccount';break;case'zohoaccounts':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xc6');break;case _0x3dab('0xc7'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x9d');break;case _0x3dab('0xc8'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xc9');break;case _0x3dab('0xca'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xcb');break;case _0x3dab('0xcc'):_0x366c4d[_0x3dab('0x64')]='Dashboard';break;case'intervals':_0x366c4d['childModel']=_0x3dab('0xcd');break;case _0x3dab('0xce'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xcf');break;case _0x3dab('0xd0'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xd1');break;case _0x3dab('0xd2'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xd3');break;case _0x3dab('0xd4'):_0x366c4d['childModel']='Tag';break;case _0x3dab('0xd5'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xd6');break;case _0x3dab('0xd7'):_0x366c4d['childModel']=_0x3dab('0xd8');break;case _0x3dab('0xd9'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xda');break;case _0x3dab('0xdb'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xdc');break;case _0x3dab('0xdd'):_0x366c4d[_0x3dab('0x64')]='Plugin';break;case _0x3dab('0xde'):_0x366c4d[_0x3dab('0x64')]=_0x3dab('0x70');_0x366c4d[_0x3dab('0x66')]=[{'name':_0x3dab('0xdf'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x366c4d[_0x3dab('0x64')]=_0x3dab('0xe0');break;default:return _0x366c4d;}return _0x366c4d;} \ No newline at end of file +var _0xd190=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','set','Content-Range','save','update','destroy','sendStatus','stack','name','send','UserProfile','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','field','options','count','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','clone','get','updatedAt','createdAt','UserProfileResource','omit','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','sequelize','transaction','map','push','ids','bulkCreate','removeResources','getResources','undefined','Sequelize','Unknown\x20section','childModel','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','autoAssociation','nolimit','pick','key','AnalyticExtractedReport','foreignKey','associatedResources','forEach','default','reportId','custom','CustomReports','CmContact','Tag','Tags','tag','ThroughTags','color','value','resourceId','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','CmList','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','tags','templates','triggers','Trigger','Trunk','variables','plugins','Plugin','extractedreports','metrics','AnalyticMetric','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xd190,0x1b8));var _0x0d19=function(_0x4f21d8,_0xfa467e){_0x4f21d8=_0x4f21d8-0x0;var _0x1348cc=_0xd190[_0x4f21d8];return _0x1348cc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d19('0x1'));var jsonpatch=require(_0x0d19('0x2'));var rp=require(_0x0d19('0x3'));var moment=require('moment');var BPromise=require(_0x0d19('0x4'));var Mustache=require(_0x0d19('0x5'));var util=require(_0x0d19('0x6'));var path=require(_0x0d19('0x7'));var sox=require(_0x0d19('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0d19('0x9'));var squel=require(_0x0d19('0xa'));var crypto=require(_0x0d19('0xb'));var jsforce=require(_0x0d19('0xc'));var deskjs=require(_0x0d19('0xd'));var toCsv=require(_0x0d19('0xe'));var querystring=require(_0x0d19('0xf'));var Papa=require(_0x0d19('0x10'));var Redis=require(_0x0d19('0x11'));var authService=require(_0x0d19('0x12'));var qs=require(_0x0d19('0x13'));var hardwareService=require(_0x0d19('0x14'));var logger=require('../../config/logger')(_0x0d19('0x15'));var utils=require(_0x0d19('0x16'));var config=require('../../config/environment');var db=require(_0x0d19('0x17'))['db'];config[_0x0d19('0x18')]=_[_0x0d19('0x19')](config[_0x0d19('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d19('0x1a'))(new Redis(config[_0x0d19('0x18')]));require(_0x0d19('0x1b'))[_0x0d19('0x1c')](socket);function respondWithStatusCode(_0x232370,_0x5d14f0){_0x5d14f0=_0x5d14f0||0xcc;return function(_0x106b45){if(_0x106b45){return _0x232370['sendStatus'](_0x5d14f0);}return _0x232370[_0x0d19('0x1d')](_0x5d14f0)[_0x0d19('0x1e')]();};}function respondWithResult(_0x48fd91,_0x27fa91){_0x27fa91=_0x27fa91||0xc8;return function(_0x7578f1){if(_0x7578f1){return _0x48fd91[_0x0d19('0x1d')](_0x27fa91)[_0x0d19('0x1f')](_0x7578f1);}};}function respondWithFilteredResult(_0x18ca73,_0x19e7b0){return function(_0x1d98ae){if(_0x1d98ae){var _0x5e0632=_0x1d98ae['count'],_0x9c708d=_0x19e7b0[_0x0d19('0x20')],_0x3d6b6f=_0x19e7b0['offset']+_0x19e7b0['limit'],_0x5d821c;if(_0x3d6b6f>=_0x5e0632){_0x3d6b6f=_0x5e0632;_0x5d821c=0xc8;}else{_0x5d821c=0xce;}_0x18ca73[_0x0d19('0x1d')](_0x5d821c);return _0x18ca73[_0x0d19('0x21')](_0x0d19('0x22'),_0x9c708d+'-'+_0x3d6b6f+'/'+_0x5e0632)[_0x0d19('0x1f')](_0x1d98ae);}return null;};}function patchUpdates(_0x4a9980){return function(_0x5e23f3){try{jsonpatch['apply'](_0x5e23f3,_0x4a9980,!![]);}catch(_0x52938a){return BPromise['reject'](_0x52938a);}return _0x5e23f3[_0x0d19('0x23')]();};}function saveUpdates(_0x3d6063,_0x3b9d90){return function(_0x2b55fd){if(_0x2b55fd){return _0x2b55fd[_0x0d19('0x24')](_0x3d6063)['then'](function(_0x57067a){return _0x57067a;});}return null;};}function removeEntity(_0x58afdd,_0x47f337){return function(_0x50a112){if(_0x50a112){return _0x50a112[_0x0d19('0x25')]()['then'](function(){_0x58afdd[_0x0d19('0x1d')](0xcc)[_0x0d19('0x1e')]();});}};}function handleEntityNotFound(_0x44defc,_0x448d8f){return function(_0x1f2c2f){if(!_0x1f2c2f){_0x44defc[_0x0d19('0x26')](0x194);}return _0x1f2c2f;};}function handleError(_0x4e21ef,_0x176852){_0x176852=_0x176852||0x1f4;return function(_0x25527c){logger['error'](_0x25527c[_0x0d19('0x27')]);if(_0x25527c['name']){delete _0x25527c[_0x0d19('0x28')];}_0x4e21ef[_0x0d19('0x1d')](_0x176852)[_0x0d19('0x29')](_0x25527c);};}exports['index']=function(_0x168c96,_0x3e0886){var _0x1a5253={},_0x203cb9={},_0xbf6635={'count':0x0,'rows':[]};var _0x75a845=db[_0x0d19('0x2a')][_0x0d19('0x2b')];_0x203cb9[_0x0d19('0x2c')]=_[_0x0d19('0x2d')](_0x75a845);_0x203cb9[_0x0d19('0x2e')]=_[_0x0d19('0x2d')](_0x168c96[_0x0d19('0x2e')]);_0x203cb9[_0x0d19('0x2f')]=_[_0x0d19('0x30')](_0x203cb9[_0x0d19('0x2c')],_0x203cb9[_0x0d19('0x2e')]);_0x1a5253[_0x0d19('0x31')]=_[_0x0d19('0x30')](_0x203cb9[_0x0d19('0x2c')],qs[_0x0d19('0x32')](_0x168c96[_0x0d19('0x2e')][_0x0d19('0x32')]));_0x1a5253[_0x0d19('0x31')]=_0x1a5253[_0x0d19('0x31')][_0x0d19('0x33')]?_0x1a5253[_0x0d19('0x31')]:_0x203cb9[_0x0d19('0x2c')];if(!_0x168c96[_0x0d19('0x2e')][_0x0d19('0x34')]('nolimit')){_0x1a5253[_0x0d19('0x35')]=qs[_0x0d19('0x35')](_0x168c96[_0x0d19('0x2e')][_0x0d19('0x35')]);_0x1a5253[_0x0d19('0x20')]=qs[_0x0d19('0x20')](_0x168c96['query'][_0x0d19('0x20')]);}_0x1a5253[_0x0d19('0x36')]=qs[_0x0d19('0x37')](_0x168c96[_0x0d19('0x2e')][_0x0d19('0x37')]);_0x1a5253[_0x0d19('0x38')]=qs[_0x0d19('0x2f')](_['pick'](_0x168c96['query'],_0x203cb9[_0x0d19('0x2f')]));if(_0x168c96[_0x0d19('0x2e')][_0x0d19('0x39')]){_0x1a5253[_0x0d19('0x38')]=_[_0x0d19('0x3a')](_0x1a5253[_0x0d19('0x38')],{'$or':_['map'](_0x75a845,function(_0x58906e){if(_0x58906e[_0x0d19('0x3b')]['key']!==_0x0d19('0x3c')){var _0x3bd27e={};_0x3bd27e[_0x58906e[_0x0d19('0x3d')]]={'$like':'%'+_0x168c96[_0x0d19('0x2e')][_0x0d19('0x39')]+'%'};return _0x3bd27e;}})});}_0x1a5253=_['merge']({},_0x1a5253,_0x168c96[_0x0d19('0x3e')]);var _0x3ae909={'where':_0x1a5253[_0x0d19('0x38')]};return db[_0x0d19('0x2a')][_0x0d19('0x3f')](_0x3ae909)[_0x0d19('0x40')](function(_0x4a9a38){_0xbf6635[_0x0d19('0x3f')]=_0x4a9a38;if(_0x168c96[_0x0d19('0x2e')][_0x0d19('0x41')]){_0x1a5253['include']=[{'all':!![]}];}return db[_0x0d19('0x2a')][_0x0d19('0x42')](_0x1a5253);})[_0x0d19('0x40')](function(_0x4b0ef1){_0xbf6635[_0x0d19('0x43')]=_0x4b0ef1;return _0xbf6635;})[_0x0d19('0x40')](respondWithFilteredResult(_0x3e0886,_0x1a5253))[_0x0d19('0x44')](handleError(_0x3e0886,null));};exports[_0x0d19('0x45')]=function(_0x579974,_0x333306){var _0x1a959a={'raw':![],'where':{'id':_0x579974[_0x0d19('0x46')]['id']}},_0x233f8a={};_0x233f8a[_0x0d19('0x2c')]=_[_0x0d19('0x2d')](db['UserProfile'][_0x0d19('0x2b')]);_0x233f8a[_0x0d19('0x2e')]=_['keys'](_0x579974[_0x0d19('0x2e')]);_0x233f8a[_0x0d19('0x2f')]=_[_0x0d19('0x30')](_0x233f8a[_0x0d19('0x2c')],_0x233f8a['query']);_0x1a959a[_0x0d19('0x31')]=_[_0x0d19('0x30')](_0x233f8a[_0x0d19('0x2c')],qs['fields'](_0x579974[_0x0d19('0x2e')][_0x0d19('0x32')]));_0x1a959a['attributes']=_0x1a959a[_0x0d19('0x31')]['length']?_0x1a959a[_0x0d19('0x31')]:_0x233f8a[_0x0d19('0x2c')];if(_0x579974[_0x0d19('0x2e')][_0x0d19('0x41')]){_0x1a959a[_0x0d19('0x47')]=[{'all':!![]}];}_0x1a959a=_['merge']({},_0x1a959a,_0x579974[_0x0d19('0x3e')]);return db[_0x0d19('0x2a')][_0x0d19('0x48')](_0x1a959a)[_0x0d19('0x40')](handleEntityNotFound(_0x333306,null))['then'](respondWithResult(_0x333306,null))[_0x0d19('0x44')](handleError(_0x333306,null));};exports['create']=function(_0x5ee34f,_0x36f507){return db[_0x0d19('0x2a')][_0x0d19('0x49')](_0x5ee34f[_0x0d19('0x4a')],{})['then'](respondWithResult(_0x36f507,0xc9))[_0x0d19('0x44')](handleError(_0x36f507,null));};exports[_0x0d19('0x4b')]=function(_0x24b431,_0x3c2578){var _0x1bf061={'raw':![],'where':{'id':_0x24b431[_0x0d19('0x46')]['id']}},_0x5c4a86={};_0x5c4a86['model']=_[_0x0d19('0x2d')](db[_0x0d19('0x2a')]['rawAttributes']);_0x1bf061[_0x0d19('0x31')]=_[_0x0d19('0x30')](_0x5c4a86['model'],qs[_0x0d19('0x32')](_0x24b431[_0x0d19('0x2e')][_0x0d19('0x32')]));_0x1bf061[_0x0d19('0x31')]=_0x1bf061[_0x0d19('0x31')][_0x0d19('0x33')]?_0x1bf061[_0x0d19('0x31')]:_0x5c4a86[_0x0d19('0x2c')];if(_0x24b431[_0x0d19('0x2e')][_0x0d19('0x41')]){_0x1bf061[_0x0d19('0x47')]=[{'all':!![]}];}_0x1bf061=_[_0x0d19('0x3a')]({},_0x1bf061,_0x24b431[_0x0d19('0x3e')]);return db['UserProfile']['find'](_0x1bf061)[_0x0d19('0x40')](handleEntityNotFound(_0x3c2578,null))[_0x0d19('0x40')](function(_0x4197eb){if(_0x4197eb){var _0x2fb458=_0x4197eb[_0x0d19('0x4c')]({'plain':!![]});_0x2fb458=qs['omit'](_0x2fb458,['id','createdAt',_0x0d19('0x4d'),'crudPermissions']);_0x24b431[_0x0d19('0x4a')]=_['omit'](_0x24b431[_0x0d19('0x4a')],['id',_0x0d19('0x4e'),_0x0d19('0x4d')]);return db['sequelize']['transaction'](function(_0x472b34){return db[_0x0d19('0x2a')]['create'](_[_0x0d19('0x3a')](_0x2fb458,_0x24b431['body']),{'include':_0x24b431[_0x0d19('0x2e')][_0x0d19('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x472b34})['then'](function(_0x2fe3ff){var _0x230018=_0x2fe3ff[_0x0d19('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x24b431['params']['id']},'raw':!![]})[_0x0d19('0x40')](function(_0x486fdd){if(_0x486fdd){return BPromise['each'](_0x486fdd,function(_0x1c133a){return new BPromise(function(_0x253d76,_0x5369f4){if(_0x1c133a['autoAssociation']===null||_0x1c133a['autoAssociation']===0x1)_0x253d76(null);return db[_0x0d19('0x4f')][_0x0d19('0x42')]({'where':{'sectionId':_0x1c133a['id']},'raw':!![]})['then'](function(_0x16f57d){var _0x3ad966=_['map'](_0x16f57d,function(_0x337fd5){return qs[_0x0d19('0x50')](_0x337fd5,['id',_0x0d19('0x4e'),'updatedAt',_0x0d19('0x51')]);});_0x253d76(_0x3ad966);})[_0x0d19('0x44')](function(_0x5e6d81){_0x5369f4(_0x5e6d81);});})['then'](function(_0xcead7b){var _0x181685=qs[_0x0d19('0x50')](_0x1c133a,['id','createdAt',_0x0d19('0x4d')]);_0x181685[_0x0d19('0x52')]=_0x230018['id'];if(_0xcead7b)_0x181685[_0x0d19('0x53')]=_0xcead7b;return _0x181685;})[_0x0d19('0x40')](function(_0x27790f){return db[_0x0d19('0x54')][_0x0d19('0x49')](_0x27790f,{'include':[{'model':db[_0x0d19('0x4f')],'as':_0x0d19('0x53')}],'raw':!![],'transaction':_0x472b34});});})['then'](function(){return _0x230018;});}});});});}})[_0x0d19('0x40')](respondWithResult(_0x3c2578,0xc9))['catch'](handleError(_0x3c2578,null));};exports[_0x0d19('0x24')]=function(_0x24a6d0,_0x1c1f32){if(_0x24a6d0[_0x0d19('0x4a')]['id']){delete _0x24a6d0[_0x0d19('0x4a')]['id'];}return db[_0x0d19('0x2a')][_0x0d19('0x48')]({'where':{'id':_0x24a6d0[_0x0d19('0x46')]['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x1c1f32,null))[_0x0d19('0x40')](saveUpdates(_0x24a6d0[_0x0d19('0x4a')],null))[_0x0d19('0x40')](respondWithResult(_0x1c1f32,null))[_0x0d19('0x44')](handleError(_0x1c1f32,null));};exports['destroy']=function(_0x5093b6,_0x488ca3){return db[_0x0d19('0x2a')][_0x0d19('0x48')]({'where':{'id':_0x5093b6[_0x0d19('0x46')]['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x488ca3,null))[_0x0d19('0x40')](removeEntity(_0x488ca3,null))['catch'](handleError(_0x488ca3,null));};exports['describe']=function(_0x422353,_0x7be305){return db['UserProfile'][_0x0d19('0x55')]()[_0x0d19('0x40')](respondWithResult(_0x7be305,null))['catch'](handleError(_0x7be305,null));};exports[_0x0d19('0x56')]=function(_0x3175b9,_0x1d7c1a){var _0x4dea0f=_0x3175b9['body'];return db[_0x0d19('0x2a')][_0x0d19('0x48')]({'where':{'id':_0x3175b9['params']['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x1d7c1a,null))[_0x0d19('0x40')](function(_0x323c74){if(_0x323c74){return db[_0x0d19('0x57')][_0x0d19('0x58')](function(_0x17a905){return db[_0x0d19('0x54')][_0x0d19('0x25')]({'where':{'userProfileId':_0x3175b9[_0x0d19('0x46')]['id'],'sectionId':_[_0x0d19('0x59')](_0x4dea0f,function(_0x1c2403){return _0x1c2403[_0x0d19('0x51')];})},'transaction':_0x17a905})['then'](function(){var _0x3f9d17=_['map'](_0x4dea0f,function(_0x14eac9){_0x14eac9[_0x0d19('0x52')]=_0x3175b9['params']['id'];return _0x14eac9;});var _0x32badd=[];return BPromise['each'](_0x3f9d17,function(_0x3e196f){return db['UserProfileSection'][_0x0d19('0x49')](_0x3e196f,{'include':[{'model':db['UserProfileResource'],'as':_0x0d19('0x53')}],'raw':!![],'transaction':_0x17a905})[_0x0d19('0x40')](function(_0xd2a2c4){_0x32badd[_0x0d19('0x5a')](_0xd2a2c4[_0x0d19('0x4c')]({'plain':!![]}));});})[_0x0d19('0x40')](function(){return _0x32badd;});});});}})[_0x0d19('0x40')](function(_0x226f77){return _0x226f77;})[_0x0d19('0x40')](respondWithResult(_0x1d7c1a,null))['catch'](handleError(_0x1d7c1a,null));};exports['removeSections']=function(_0x1a7982,_0x489bce){var _0x4eab3c;return db[_0x0d19('0x2a')][_0x0d19('0x48')]({'where':{'id':_0x1a7982[_0x0d19('0x46')]['id']},'attributes':['id',_0x0d19('0x28')]})['then'](handleEntityNotFound(_0x489bce,null))[_0x0d19('0x40')](function(_0x36955c){if(_0x36955c){_0x4eab3c=_0x36955c;return db['UserProfileSection'][_0x0d19('0x25')]({'where':{'userProfileId':_0x1a7982[_0x0d19('0x46')]['id'],'sectionId':_0x1a7982['query'][_0x0d19('0x5b')]}});}})['then'](function(){return _0x4eab3c;})['then'](respondWithStatusCode(_0x489bce,null))['catch'](handleError(_0x489bce,null));};exports['addResources']=function(_0xfa5959,_0x4e859d){return db[_0x0d19('0x2a')]['find']({'where':{'id':_0xfa5959[_0x0d19('0x46')]['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x4e859d,null))[_0x0d19('0x40')](function(_0x3418f1){if(_0x3418f1){return db['sequelize'][_0x0d19('0x58')](function(_0x53de90){return db[_0x0d19('0x54')][_0x0d19('0x42')]({'where':{'userProfileId':_0xfa5959[_0x0d19('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x0d19('0x40')](function(_0x210360){if(_0x210360){return db[_0x0d19('0x54')]['destroy']({'where':{'userProfileId':_0xfa5959['params']['id'],'id':_[_0x0d19('0x59')](_0x210360,function(_0x59cfe4){return _0x59cfe4['id'];})},'transaction':_0x53de90});}})[_0x0d19('0x40')](function(_0xb2fffd){var _0x59289b=_[_0x0d19('0x59')](_0xfa5959['body'],function(_0x23007c){_0x23007c[_0x0d19('0x52')]=_0xfa5959[_0x0d19('0x46')]['id'];return _0x23007c;});return db[_0x0d19('0x54')]['bulkCreate'](_0x59289b,{'raw':!![],'transaction':_0x53de90});})['then'](function(_0x3e5a27){var _0x280a8e=_[_0x0d19('0x39')](_['map'](_0x3e5a27,function(_0x37e6fa){return _0x37e6fa[_0x0d19('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x280a8e){return db[_0x0d19('0x54')][_0x0d19('0x42')]({'where':{'userProfileId':_0xfa5959[_0x0d19('0x46')]['id'],'sectionId':_[_0x0d19('0x59')](_0x280a8e,function(_0x252424){return _0x252424[_0x0d19('0x51')];})},'attributes':['id',_0x0d19('0x51')],'raw':!![]})[_0x0d19('0x40')](function(_0x1e4c9a){var _0x2b1fa6=_[_0x0d19('0x59')](_0xfa5959[_0x0d19('0x4a')],function(_0x8aa6f){_0x8aa6f[_0x0d19('0x52')]=_0xfa5959['params']['id'];return _0x8aa6f;});return db[_0x0d19('0x4f')][_0x0d19('0x5c')](_0x2b1fa6,{'raw':!![],'transaction':_0x53de90});});}})[_0x0d19('0x44')](handleError(_0x4e859d,null));});}})[_0x0d19('0x40')](function(_0x573946){var _0x20b51e=_['map'](_0x573946,function(_0xac2f6e){return _0xac2f6e['get']({'plain':!![]});});})['then'](respondWithResult(_0x4e859d,null))[_0x0d19('0x44')](handleError(_0x4e859d,null));};exports[_0x0d19('0x5d')]=function(_0x4a3353,_0x2a9604,_0x16a629){return db['UserProfile'][_0x0d19('0x48')]({'where':{'id':_0x4a3353[_0x0d19('0x46')]['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x2a9604,null))['then'](function(_0x2d9ce5){if(_0x2d9ce5){return _0x2d9ce5[_0x0d19('0x5d')](_0x4a3353[_0x0d19('0x2e')][_0x0d19('0x5b')]);}})[_0x0d19('0x40')](respondWithStatusCode(_0x2a9604,null))[_0x0d19('0x44')](handleError(_0x2a9604,null));};exports[_0x0d19('0x5e')]=function(_0x142f4a,_0x31906e){var _0x1146f3={'raw':![],'where':{}};var _0x1879c4={};var _0x1a68c1={'count':0x0,'rows':[]};var _0x4ba675=_0x142f4a[_0x0d19('0x2e')]['section'];if(typeof _0x4ba675===_0x0d19('0x5f')){throw new db[(_0x0d19('0x60'))]['ValidationError'](_0x0d19('0x61'));}var _0x3547d9=_0x142f4a[_0x0d19('0x2e')]['mergeResources']||![];var _0x3d95e5=getQueryModels(_0x4ba675,_0x3547d9);if(typeof _0x3d95e5[_0x0d19('0x62')]===_0x0d19('0x5f')){throw new db[(_0x0d19('0x60'))][(_0x0d19('0x63'))](_0x0d19('0x64')+_0x4ba675+'\x27');}var _0x57d47a=[];if(!_[_0x0d19('0x65')](_0x3d95e5[_0x0d19('0x66')])){_0x57d47a=_0x3d95e5[_0x0d19('0x66')];}else{_0x57d47a=[{'name':_0x4ba675}];}return db[_0x0d19('0x2a')]['findOne']({'where':{'id':_0x142f4a[_0x0d19('0x46')]['id']}})[_0x0d19('0x40')](handleEntityNotFound(_0x31906e,null))[_0x0d19('0x40')](function(_0x1f27c6){if(_0x1f27c6){var _0x197904=[];for(var _0x27ba3d=0x0;_0x27ba3d<_0x57d47a[_0x0d19('0x33')];_0x27ba3d++){_0x197904[_0x0d19('0x5a')](db[_0x0d19('0x54')][_0x0d19('0x67')]({'where':{'userProfileId':_0x1f27c6['id'],'name':_0x57d47a[_0x27ba3d][_0x0d19('0x28')]},'raw':!![]}));}return BPromise[_0x0d19('0x68')](_0x197904);}})[_0x0d19('0x40')](function(_0x3339fc){var _0x4f3d18=_['filter'](_0x3339fc,function(_0x43b66e){return _0x43b66e?_0x43b66e:undefined;});var _0x3a7acd=_[_0x0d19('0x39')](_0x57d47a,[_0x0d19('0x69'),!![]]);var _0x3d6b58=_[_0x0d19('0x65')](_0x4f3d18)&&_[_0x0d19('0x65')](_0x3a7acd)?null:_['union'](_0x3a7acd,_0x4f3d18);if(_0x3d6b58){var _0x4d77b4=[];for(var _0x40714c=0x0;_0x40714c<_0x3d6b58[_0x0d19('0x33')];_0x40714c++){var _0xb7a00f=_[_0x0d19('0x48')](_0x57d47a,function(_0x29c8b8){return _0x3d6b58[_0x40714c]?_0x29c8b8[_0x0d19('0x28')]===_0x3d6b58[_0x40714c]['name']:null;});if(_0xb7a00f){if(_0x3d6b58[_0x40714c][_0x0d19('0x69')]){_0x4d77b4['push'](getAllResources(_0x3d95e5['childModel'],_0x3d6b58[_0x40714c]));}else{if(!_0x3d6b58[_0x40714c][_0x0d19('0x6a')]){_0x4d77b4['push'](getAllowedResources(_0xb7a00f,_0x3d6b58[_0x40714c],_0x3d95e5[_0x0d19('0x62')]));}else{if(_0xb7a00f[_0x0d19('0x2c')]){_0x4d77b4[_0x0d19('0x5a')](getAllFilteredResources(_0xb7a00f,_0x3d6b58[_0x40714c]));}}}}}return BPromise[_0x0d19('0x68')](_0x4d77b4);}else{return null;}})[_0x0d19('0x40')](function(_0x1fc9f5){var _0x12a564=_0x1fc9f5;var _0x496911=null;if(_0x12a564){_0x496911=_0x12a564['length']===0x1?_0x12a564[0x0]:null;}if(_0x496911||_0x12a564){var _0x1d7822=db[_0x3d95e5['childModel']][_0x0d19('0x2b')];_0x1879c4[_0x0d19('0x2c')]=_[_0x0d19('0x2d')](_0x1d7822);_0x1879c4[_0x0d19('0x2e')]=_[_0x0d19('0x2d')](_0x142f4a[_0x0d19('0x2e')]);_0x1879c4[_0x0d19('0x2f')]=_[_0x0d19('0x30')](_0x1879c4[_0x0d19('0x2c')],_0x1879c4[_0x0d19('0x2e')]);_0x1146f3[_0x0d19('0x31')]=_[_0x0d19('0x30')](_0x1879c4[_0x0d19('0x2c')],qs[_0x0d19('0x32')](_0x142f4a['query'][_0x0d19('0x32')]));_0x1146f3[_0x0d19('0x31')]=_0x1146f3[_0x0d19('0x31')][_0x0d19('0x33')]?_0x1146f3[_0x0d19('0x31')]:_0x1879c4['model'];if(!_0x142f4a['query'][_0x0d19('0x34')](_0x0d19('0x6b'))){_0x1146f3['limit']=qs[_0x0d19('0x35')](_0x142f4a[_0x0d19('0x2e')][_0x0d19('0x35')]);_0x1146f3[_0x0d19('0x20')]=qs['offset'](_0x142f4a[_0x0d19('0x2e')]['offset']);}_0x1146f3[_0x0d19('0x36')]=qs[_0x0d19('0x37')](_0x142f4a['query']['sort']);_0x1146f3[_0x0d19('0x38')]=qs[_0x0d19('0x2f')](_[_0x0d19('0x6c')](_0x142f4a[_0x0d19('0x2e')],_0x1879c4[_0x0d19('0x2f')]));if(_0x142f4a['query'][_0x0d19('0x39')]){_0x1146f3[_0x0d19('0x38')]=_['merge'](_0x1146f3[_0x0d19('0x38')],{'$or':_[_0x0d19('0x59')](_0x1d7822,function(_0x1d62a3){if(_0x1d62a3[_0x0d19('0x3b')][_0x0d19('0x6d')]!==_0x0d19('0x3c')){var _0x177fde={};_0x177fde[_0x1d62a3[_0x0d19('0x3d')]]={'$like':'%'+_0x142f4a[_0x0d19('0x2e')][_0x0d19('0x39')]+'%'};return _0x177fde;}})});}var _0x4fe8fa=[];if(_0x496911){var _0x595ef1=_[_0x0d19('0x48')](_0x57d47a,[_0x0d19('0x28'),_0x496911[_0x0d19('0x28')]]);if(_0x595ef1[_0x0d19('0x3d')]){var _0x2c99a6={};if(_0x3d95e5[_0x0d19('0x62')]===_0x0d19('0x6e')){_0x2c99a6[_0x595ef1[_0x0d19('0x6f')]]=_[_0x0d19('0x59')](_0x496911['associatedResources'],'id');}else{_0x2c99a6[_0x595ef1[_0x0d19('0x6f')]]=_0x496911[_0x0d19('0x70')];}_0x4fe8fa[_0x0d19('0x5a')](_0x2c99a6);}else{_0x1146f3['where']['id']=_0x496911[_0x0d19('0x70')];}}else{for(var _0x2b06cd=0x0;_0x2b06cd<_0x12a564[_0x0d19('0x33')];_0x2b06cd++){var _0x595ef1=_[_0x0d19('0x48')](_0x57d47a,[_0x0d19('0x28'),_0x12a564[_0x2b06cd][_0x0d19('0x28')]]);if(_0x595ef1[_0x0d19('0x3d')]){var _0x2c99a6={};_0x2c99a6[_0x595ef1[_0x0d19('0x6f')]]=_0x12a564[_0x2b06cd][_0x0d19('0x70')];_0x4fe8fa['push'](_0x2c99a6);}else{if(!_0x1146f3[_0x0d19('0x38')]['id'])_0x1146f3[_0x0d19('0x38')]['id']=[];_0x12a564[_0x2b06cd][_0x0d19('0x70')][_0x0d19('0x71')](function(_0x3c0cf5){_0x1146f3[_0x0d19('0x38')]['id'][_0x0d19('0x5a')](_0x3c0cf5);});}}}if(!_[_0x0d19('0x65')](_0x4fe8fa)){_0x1146f3[_0x0d19('0x38')]=_[_0x0d19('0x3a')](_0x1146f3[_0x0d19('0x38')],{'$and':{'$or':_0x4fe8fa}});}_0x1146f3=_[_0x0d19('0x3a')]({},_0x1146f3,_0x142f4a[_0x0d19('0x3e')]);if(_0x496911&&!_0x496911[_0x0d19('0x6a')]&&_0x3d95e5[_0x0d19('0x62')]===_0x0d19('0x6e')){if(_0x142f4a[_0x0d19('0x2e')][_0x0d19('0x41')]){_0x1146f3[_0x0d19('0x47')]=[{'all':!![]}];}return db[_0x3d95e5[_0x0d19('0x62')]][_0x0d19('0x42')](_0x1146f3)[_0x0d19('0x40')](function(_0x24c93a){var _0x2af08e=[];_0x24c93a['forEach'](function(_0x32b060){var _0x325178;switch(_0x32b060['reportType']){case _0x0d19('0x72'):_0x325178=_[_0x0d19('0x48')](_0x496911[_0x0d19('0x70')],function(_0x335011){return _0x335011['id']===_0x32b060[_0x0d19('0x73')]&&_0x335011[_0x0d19('0x3b')]==='DefaultReports';});break;case _0x0d19('0x74'):_0x325178=_['find'](_0x496911[_0x0d19('0x70')],function(_0x3349bc){return _0x3349bc['id']===_0x32b060[_0x0d19('0x73')]&&_0x3349bc['type']===_0x0d19('0x75');});break;}if(_0x325178)_0x2af08e[_0x0d19('0x5a')](_0x32b060);});_0x1a68c1['count']=_0x2af08e[_0x0d19('0x33')];_0x1a68c1[_0x0d19('0x43')]=_0x2af08e;return _0x1a68c1;});}else{return db[_0x3d95e5['childModel']][_0x0d19('0x3f')]({'where':_0x1146f3[_0x0d19('0x38')]})[_0x0d19('0x40')](function(_0x33e8e2){_0x1a68c1[_0x0d19('0x3f')]=_0x33e8e2;if(_0x142f4a[_0x0d19('0x2e')]['includeAll']){if(_0x3d95e5[_0x0d19('0x62')]===_0x0d19('0x76')){_0x1146f3[_0x0d19('0x47')]=[{'model':db[_0x0d19('0x77')],'as':_0x0d19('0x78'),'attributes':['id',_0x0d19('0x28'),'color'],'required':_0x142f4a[_0x0d19('0x2e')][_0x0d19('0x79')]?!![]:![]},{'model':db['Tag'],'as':_0x0d19('0x7a'),'attributes':['id',_0x0d19('0x28'),_0x0d19('0x7b')],'through':_0x142f4a['query'][_0x0d19('0x79')]?{'attributes':[],'where':{'TagId':_0x142f4a[_0x0d19('0x2e')][_0x0d19('0x79')]||undefined}}:{},'required':_0x142f4a['query']['tag']?!![]:![]}];}else{_0x1146f3['include']=[{'all':!![]}];}}return db[_0x3d95e5['childModel']]['findAll'](_0x1146f3);})['then'](function(_0x2d033e){_0x1a68c1[_0x0d19('0x43')]=_0x2d033e;return _0x1a68c1;});}}else{return _0x1a68c1;}})[_0x0d19('0x40')](respondWithFilteredResult(_0x31906e,_0x1146f3))['catch'](handleError(_0x31906e,null));};function getAllResources(_0x14f2ce,_0x59cfd0){return new BPromise(function(_0x4b312f,_0x3d7a95){if(_0x59cfd0){var _0x10fd94=_0x59cfd0[_0x0d19('0x39')]?{[_0x59cfd0[_0x0d19('0x39')]['field']]:_0x59cfd0['filter'][_0x0d19('0x7c')]}:undefined;return db[_0x14f2ce]['findAll']({'where':_0x10fd94,'raw':!![]})[_0x0d19('0x40')](function(_0xdd0993){_0x59cfd0[_0x0d19('0x70')]=_[_0x0d19('0x59')](_0xdd0993,'id');_0x4b312f(_0x59cfd0);})[_0x0d19('0x44')](function(_0x214ef9){_0x3d7a95(_0x214ef9);});}else{_0x4b312f(null);}});}function getAllFilteredResources(_0x55eedf,_0x485fe9){return new BPromise(function(_0x46aa6e,_0x2b8b5a){var _0x1ec542=_0x55eedf['filter']?{[_0x55eedf[_0x0d19('0x39')][_0x0d19('0x3d')]]:_0x55eedf[_0x0d19('0x39')][_0x0d19('0x7c')]}:undefined;return db[_0x55eedf[_0x0d19('0x2c')]][_0x0d19('0x42')]({'where':_0x1ec542,'raw':!![]})['then'](function(_0x5d208a){_0x485fe9[_0x0d19('0x70')]=_[_0x0d19('0x59')](_0x5d208a,function(_0x2cf4a8){return _0x2cf4a8[_0x0d19('0x28')];});_0x46aa6e(_0x485fe9);})[_0x0d19('0x44')](function(_0x2039b8){_0x2b8b5a(_0x2039b8);});});}function getAllowedResources(_0x4bb019,_0x1a64c7,_0x5baae5){return new BPromise(function(_0x548e11,_0x49fc89){if(_0x1a64c7){return db[_0x0d19('0x4f')][_0x0d19('0x42')]({'where':{'sectionId':_0x1a64c7['id']},'raw':!![]})['then'](function(_0x55d382){if(_0x4bb019[_0x0d19('0x3d')]&&_0x4bb019['field']!=='id'){_0x1a64c7['associatedResources']=_[_0x0d19('0x59')](_0x55d382,function(_0x2f011e){return _0x2f011e[_0x4bb019['field']];});}else{if(_0x5baae5===_0x0d19('0x6e')){_0x1a64c7['associatedResources']=_[_0x0d19('0x59')](_0x55d382,function(_0x290340){return{'id':_0x290340[_0x0d19('0x7d')],'type':_0x290340[_0x0d19('0x3b')]};});}else{_0x1a64c7['associatedResources']=_[_0x0d19('0x59')](_0x55d382,function(_0x407770){return _0x407770[_0x0d19('0x7d')];});}}_0x548e11(_0x1a64c7);})[_0x0d19('0x44')](function(_0xd11ee2){_0x49fc89(_0xd11ee2);});}else{_0x548e11(null);}});}function getQueryModels(_0x4530ea,_0xe60788){var _0x471587=_0x4530ea['toLowerCase']();var _0x116cdc={'childModel':undefined,'parentSections':[]};switch(_0x471587){case _0x0d19('0x7e'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x7f');break;case _0x0d19('0x80'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x81');break;case _0x0d19('0x82'):_0x116cdc[_0x0d19('0x62')]='SquareRecording';_0x116cdc[_0x0d19('0x66')]=[{'name':_0x0d19('0x83'),'field':_0x0d19('0x28'),'foreignKey':_0x0d19('0x84')}];break;case'projects':_0x116cdc['childModel']=_0x0d19('0x85');break;case _0x0d19('0x86'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x76');_0x116cdc['parentSections']=[{'name':_0x0d19('0x87'),'field':'id','foreignKey':_0x0d19('0x88')}];break;case'lists':_0x116cdc['childModel']=_0x0d19('0x89');break;case'companies':_0x116cdc['childModel']=_0x0d19('0x8a');break;case'globalcustomfields':_0x116cdc['childModel']=_0x0d19('0x8b');break;case _0x0d19('0x8c'):_0x116cdc[_0x0d19('0x62')]='ChatQueue';break;case _0x0d19('0x8d'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x8e');break;case'faxqueues':_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x8f');break;case _0x0d19('0x90'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x91');break;case _0x0d19('0x92'):case _0x0d19('0x93'):case _0x0d19('0x94'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x95');break;case _0x0d19('0x96'):_0x116cdc['childModel']=_0x0d19('0x97');break;case _0x0d19('0x98'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x99');break;case _0x0d19('0x9a'):_0x116cdc['childModel']=_0x0d19('0x9b');_0x116cdc['parentSections']=[{'name':_0x0d19('0x9c'),'field':_0x0d19('0x28'),'foreignKey':_0x0d19('0x9d'),'model':_0x0d19('0x9e'),'filter':{'field':'role','value':[_0x0d19('0x9f')]}},{'name':_0x0d19('0xa0'),'field':_0x0d19('0x28'),'foreignKey':_0x0d19('0x9d'),'model':_0x0d19('0x9e'),'filter':{'field':_0x0d19('0xa1'),'value':[_0x0d19('0xa2')]}},{'name':_0x0d19('0xa3'),'field':_0x0d19('0x28'),'foreignKey':_0x0d19('0xa4'),'model':_0x0d19('0xa5'),'filter':{'field':'type','value':[_0x0d19('0xa6')]}},{'name':_0x0d19('0xa7'),'field':_0x0d19('0x28'),'foreignKey':'queue','model':_0x0d19('0xa5'),'filter':{'field':_0x0d19('0x3b'),'value':[_0x0d19('0xa8')]}}];break;case _0x0d19('0xa9'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xaa');break;case'chanspies':_0x116cdc[_0x0d19('0x62')]='VoiceChanSpy';break;case _0x0d19('0xab'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xac');break;case _0x0d19('0xad'):_0x116cdc['childModel']=_0x0d19('0xae');break;case _0x0d19('0xaf'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xb0');break;case _0x0d19('0xb1'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xb2');break;case _0x0d19('0xb3'):_0x116cdc['childModel']=_0x0d19('0xb4');break;case _0x0d19('0xb5'):_0x116cdc[_0x0d19('0x62')]='OpenchannelQueue';break;case'openchannelaccounts':_0x116cdc[_0x0d19('0x62')]='OpenchannelAccount';break;case'smsqueues':_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xb6');break;case _0x0d19('0xb7'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xb8');break;case _0x0d19('0xb9'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xba');break;case _0x0d19('0xbb'):case _0x0d19('0xbc'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xa5');if(_0xe60788){_0x116cdc['parentSections']=[{'name':_0x0d19('0xa3')},{'name':_0x0d19('0xa7')}];}break;case _0x0d19('0xbd'):case _0x0d19('0xbe'):case _0x0d19('0xbf'):_0x116cdc[_0x0d19('0x62')]='User';if(_0xe60788){_0x116cdc[_0x0d19('0x66')]=[{'name':_0x0d19('0xc0'),'filter':{'field':_0x0d19('0xa1'),'value':[_0x0d19('0xc1'),_0x0d19('0xc2')]},'ignore':!![]},{'name':'Agents'},{'name':_0x0d19('0xa0')}];}break;case _0x0d19('0xc3'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xc4');break;case _0x0d19('0xc5'):_0x116cdc[_0x0d19('0x62')]='SalesforceAccount';break;case _0x0d19('0xc6'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xc7');break;case _0x0d19('0xc8'):_0x116cdc['childModel']=_0x0d19('0xc9');break;case _0x0d19('0xca'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xcb');break;case _0x0d19('0xcc'):_0x116cdc['childModel']='ZohoAccount';break;case _0x0d19('0xcd'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0x9e');break;case _0x0d19('0xce'):_0x116cdc['childModel']='CannedAnswer';break;case _0x0d19('0xcf'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xd0');break;case _0x0d19('0xd1'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xd2');break;case _0x0d19('0xd3'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xd4');break;case _0x0d19('0xd5'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xd6');break;case _0x0d19('0xd7'):_0x116cdc[_0x0d19('0x62')]='Schedule';break;case _0x0d19('0xd8'):_0x116cdc[_0x0d19('0x62')]='Sound';break;case _0x0d19('0xd9'):_0x116cdc[_0x0d19('0x62')]='Tag';break;case _0x0d19('0xda'):_0x116cdc[_0x0d19('0x62')]='Template';break;case _0x0d19('0xdb'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xdc');break;case'trunks':_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xdd');break;case _0x0d19('0xde'):_0x116cdc[_0x0d19('0x62')]='Variable';break;case _0x0d19('0xdf'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xe0');break;case _0x0d19('0xe1'):_0x116cdc['childModel']=_0x0d19('0x6e');_0x116cdc[_0x0d19('0x66')]=[{'name':'Reports','field':'id','foreignKey':_0x0d19('0x73')}];break;case _0x0d19('0xe2'):_0x116cdc[_0x0d19('0x62')]=_0x0d19('0xe3');break;default:return _0x116cdc;}return _0x116cdc;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 680fbfc..25a4a76 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 _0x1fb2=['emit','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1fb2,0x18f));var _0x21fb=function(_0x24b1be,_0x513159){_0x24b1be=_0x24b1be-0x0;var _0x3cb1ae=_0x1fb2[_0x24b1be];return _0x3cb1ae;};'use strict';var EventEmitter=require(_0x21fb('0x0'));var UserProfile=require(_0x21fb('0x1'))['db'][_0x21fb('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x21fb('0x3')](0x0);var events={'afterCreate':_0x21fb('0x4'),'afterUpdate':'update','afterDestroy':_0x21fb('0x5')};function emitEvent(_0x3be91e){return function(_0x4fcce1,_0x2fd2e5,_0x1bac4a){UserProfileEvents[_0x21fb('0x6')](_0x3be91e+':'+_0x4fcce1['id'],_0x4fcce1);UserProfileEvents['emit'](_0x3be91e,_0x4fcce1);_0x1bac4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x21fb('0x7')](e,emitEvent(event));}}module[_0x21fb('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xbba1=['setMaxListeners','save','hasOwnProperty','hook','exports','events'];(function(_0x1e72b7,_0x3c182f){var _0x427c2e=function(_0x1baae9){while(--_0x1baae9){_0x1e72b7['push'](_0x1e72b7['shift']());}};_0x427c2e(++_0x3c182f);}(_0xbba1,0x17f));var _0x1bba=function(_0x2757cb,_0x8124f8){_0x2757cb=_0x2757cb-0x0;var _0x246284=_0xbba1[_0x2757cb];return _0x246284;};'use strict';var EventEmitter=require(_0x1bba('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1bba('0x1')](0x0);var events={'afterCreate':_0x1bba('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x41cdbc){return function(_0x599f9f,_0x505c67,_0x2cf721){UserProfileEvents['emit'](_0x41cdbc+':'+_0x599f9f['id'],_0x599f9f);UserProfileEvents['emit'](_0x41cdbc,_0x599f9f);_0x2cf721(null);};}for(var e in events){if(events[_0x1bba('0x3')](e)){var event=events[e];UserProfile[_0x1bba('0x4')](e,emitEvent(event));}}module[_0x1bba('0x5')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 77ee34d..bed8767 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 _0x0f4e=['api','path','rimraf','../../config/environment','exports','define','user_profiles','lodash','../../config/logger'];(function(_0x37bc10,_0x528f6f){var _0x10fff1=function(_0x295057){while(--_0x295057){_0x37bc10['push'](_0x37bc10['shift']());}};_0x10fff1(++_0x528f6f);}(_0x0f4e,0x166));var _0xe0f4=function(_0x14634f,_0x5ed190){_0x14634f=_0x14634f-0x0;var _0x5021f9=_0x0f4e[_0x14634f];return _0x5021f9;};'use strict';var _=require(_0xe0f4('0x0'));var util=require('util');var logger=require(_0xe0f4('0x1'))(_0xe0f4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0f4('0x3'));var rimraf=require(_0xe0f4('0x4'));var config=require(_0xe0f4('0x5'));var attributes=require('./userProfile.attributes');module[_0xe0f4('0x6')]=function(_0xdfedc8,_0xba1629){return _0xdfedc8[_0xe0f4('0x7')]('UserProfile',attributes,{'tableName':_0xe0f4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x108f=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userProfile.attributes','exports','UserProfile','user_profiles'];(function(_0x3cb756,_0x47050f){var _0x75bd=function(_0x4ce7a6){while(--_0x4ce7a6){_0x3cb756['push'](_0x3cb756['shift']());}};_0x75bd(++_0x47050f);}(_0x108f,0xbe));var _0xf108=function(_0x4239d9,_0x9d865e){_0x4239d9=_0x4239d9-0x0;var _0xdd619=_0x108f[_0x4239d9];return _0xdd619;};'use strict';var _=require(_0xf108('0x0'));var util=require(_0xf108('0x1'));var logger=require(_0xf108('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf108('0x3'));var rp=require(_0xf108('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf108('0x5'));var config=require('../../config/environment');var attributes=require(_0xf108('0x6'));module[_0xf108('0x7')]=function(_0x980986,_0x28821){return _0x980986['define'](_0xf108('0x8'),attributes,{'tableName':_0xf108('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index e0cd97f..bd343c4 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 _0xf247=['jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x29a7a9,_0x46c742){var _0x53713b=function(_0x148e02){while(--_0x148e02){_0x29a7a9['push'](_0x29a7a9['shift']());}};_0x53713b(++_0x46c742);}(_0xf247,0xc7));var _0x7f24=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0xf247[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x7f24('0x0'));var util=require(_0x7f24('0x1'));var moment=require(_0x7f24('0x2'));var BPromise=require(_0x7f24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f24('0x4'));var db=require(_0x7f24('0x5'))['db'];var utils=require(_0x7f24('0x6'));var logger=require('../../config/logger')(_0x7f24('0x7'));var config=require(_0x7f24('0x8'));var jayson=require(_0x7f24('0x9'));var client=jayson[_0x7f24('0xa')]['http']({'port':0x232a});config[_0x7f24('0xb')]=_['defaults'](config[_0x7f24('0xb')],{'host':_0x7f24('0xc'),'port':0x18eb});var socket=require(_0x7f24('0xd'))(new Redis(config[_0x7f24('0xb')]));require(_0x7f24('0xe'))['register'](socket);function respondWithRpcPromise(_0x979adb,_0x2cb2af,_0x4dffe8){return new BPromise(function(_0x533f20,_0x365d0b){return client[_0x7f24('0xf')](_0x979adb,_0x4dffe8)[_0x7f24('0x10')](function(_0x2f00ac){logger['info'](_0x7f24('0x11'),_0x2cb2af,_0x7f24('0x12'));logger[_0x7f24('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2cb2af,_0x7f24('0x12'),JSON[_0x7f24('0x14')](_0x2f00ac));if(_0x2f00ac[_0x7f24('0x15')]){if(_0x2f00ac[_0x7f24('0x15')][_0x7f24('0x16')]===0x1f4){logger[_0x7f24('0x15')]('UserProfile,\x20%s,\x20%s',_0x2cb2af,_0x2f00ac[_0x7f24('0x15')][_0x7f24('0x17')]);return _0x365d0b(_0x2f00ac[_0x7f24('0x15')]['message']);}logger['error'](_0x7f24('0x11'),_0x2cb2af,_0x2f00ac[_0x7f24('0x15')][_0x7f24('0x17')]);return _0x533f20(_0x2f00ac[_0x7f24('0x15')]['message']);}else{logger[_0x7f24('0x18')]('UserProfile,\x20%s,\x20%s',_0x2cb2af,_0x7f24('0x12'));_0x533f20(_0x2f00ac['result'][_0x7f24('0x17')]);}})[_0x7f24('0x19')](function(_0x583c7f){logger[_0x7f24('0x15')](_0x7f24('0x11'),_0x2cb2af,_0x583c7f);_0x365d0b(_0x583c7f);});});} \ No newline at end of file +var _0x7966=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x12ed67,_0x1a5083){var _0x197263=function(_0x2cf3d5){while(--_0x2cf3d5){_0x12ed67['push'](_0x12ed67['shift']());}};_0x197263(++_0x1a5083);}(_0x7966,0x1ea));var _0x6796=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7966[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x6796('0x0'));var util=require('util');var moment=require(_0x6796('0x1'));var BPromise=require(_0x6796('0x2'));var rs=require(_0x6796('0x3'));var fs=require('fs');var Redis=require(_0x6796('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6796('0x5'));var logger=require(_0x6796('0x6'))('rpc');var config=require(_0x6796('0x7'));var jayson=require(_0x6796('0x8'));var client=jayson[_0x6796('0x9')]['http']({'port':0x232a});config[_0x6796('0xa')]=_[_0x6796('0xb')](config[_0x6796('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6796('0xc'))(new Redis(config[_0x6796('0xa')]));require(_0x6796('0xd'))[_0x6796('0xe')](socket);function respondWithRpcPromise(_0x3d6afb,_0x1071d3,_0x409e1c){return new BPromise(function(_0x181905,_0x4538db){return client[_0x6796('0xf')](_0x3d6afb,_0x409e1c)[_0x6796('0x10')](function(_0x26a978){logger[_0x6796('0x11')]('UserProfile,\x20%s,\x20%s',_0x1071d3,_0x6796('0x12'));logger[_0x6796('0x13')](_0x6796('0x14'),_0x1071d3,'request\x20sent',JSON['stringify'](_0x26a978));if(_0x26a978[_0x6796('0x15')]){if(_0x26a978[_0x6796('0x15')]['code']===0x1f4){logger[_0x6796('0x15')](_0x6796('0x16'),_0x1071d3,_0x26a978[_0x6796('0x15')][_0x6796('0x17')]);return _0x4538db(_0x26a978[_0x6796('0x15')][_0x6796('0x17')]);}logger[_0x6796('0x15')](_0x6796('0x16'),_0x1071d3,_0x26a978[_0x6796('0x15')][_0x6796('0x17')]);return _0x181905(_0x26a978[_0x6796('0x15')][_0x6796('0x17')]);}else{logger[_0x6796('0x11')](_0x6796('0x16'),_0x1071d3,'request\x20sent');_0x181905(_0x26a978[_0x6796('0x18')][_0x6796('0x17')]);}})[_0x6796('0x19')](function(_0x2c12ab){logger[_0x6796('0x15')](_0x6796('0x16'),_0x1071d3,_0x2c12ab);_0x4538db(_0x2c12ab);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d9e9d7d..f1e1c31 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 _0x482d=['emit','removeListener','register','userProfile:','remove','update'];(function(_0x3b947b,_0x8d220c){var _0x5d7cfd=function(_0x50f9ae){while(--_0x50f9ae){_0x3b947b['push'](_0x3b947b['shift']());}};_0x5d7cfd(++_0x8d220c);}(_0x482d,0x16c));var _0xd482=function(_0x15547b,_0x1e4123){_0x15547b=_0x15547b-0x0;var _0x5d5acf=_0x482d[_0x15547b];return _0x5d5acf;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xd482('0x0'),_0xd482('0x1')];function createListener(_0x41b265,_0x11f7ee){return function(_0x44c605){_0x11f7ee[_0xd482('0x2')](_0x41b265,_0x44c605);};}function removeListener(_0x48a316,_0xf74d9f){return function(){UserProfileEvents[_0xd482('0x3')](_0x48a316,_0xf74d9f);};}exports[_0xd482('0x4')]=function(_0x57cd2c){for(var _0x3b9989=0x0,_0x5d6b47=events['length'];_0x3b9989<_0x5d6b47;_0x3b9989++){var _0x478af5=events[_0x3b9989];var _0x144d7d=createListener(_0xd482('0x5')+_0x478af5,_0x57cd2c);UserProfileEvents['on'](_0x478af5,_0x144d7d);}}; \ No newline at end of file +var _0xbe3b=['remove','emit','removeListener','register','length','userProfile:','save'];(function(_0x1fbfea,_0x45aea0){var _0x1867e8=function(_0x5211d8){while(--_0x5211d8){_0x1fbfea['push'](_0x1fbfea['shift']());}};_0x1867e8(++_0x45aea0);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x14d9b7,_0x41650d){_0x14d9b7=_0x14d9b7-0x0;var _0x254b92=_0xbe3b[_0x14d9b7];return _0x254b92;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xbbe3('0x0'),_0xbbe3('0x1'),'update'];function createListener(_0x364f65,_0x5b26bc){return function(_0x5bfd65){_0x5b26bc[_0xbbe3('0x2')](_0x364f65,_0x5bfd65);};}function removeListener(_0x497180,_0x5d74ec){return function(){UserProfileEvents[_0xbbe3('0x3')](_0x497180,_0x5d74ec);};}exports[_0xbbe3('0x4')]=function(_0x257eb0){for(var _0x331557=0x0,_0x4c6976=events[_0xbbe3('0x5')];_0x331557<_0x4c6976;_0x331557++){var _0x748756=events[_0x331557];var _0x40199b=createListener(_0xbbe3('0x6')+_0x748756,_0x257eb0);UserProfileEvents['on'](_0x748756,_0x40199b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 73aa274..642c361 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 _0xcf66=['delete','multer','util','path','express','Router','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id','show','put','update'];(function(_0x3ec06e,_0x746cef){var _0x48c8b2=function(_0x2d4438){while(--_0x2d4438){_0x3ec06e['push'](_0x3ec06e['shift']());}};_0x48c8b2(++_0x746cef);}(_0xcf66,0x71));var _0x6cf6=function(_0x4a3e33,_0xc44bac){_0x4a3e33=_0x4a3e33-0x0;var _0x1e55a6=_0xcf66[_0x4a3e33];return _0x1e55a6;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6cf6('0x5'));var controller=require(_0x6cf6('0x6'));router['get']('/',auth[_0x6cf6('0x7')](),controller[_0x6cf6('0x8')]);router[_0x6cf6('0x9')]('/describe',auth[_0x6cf6('0x7')](),controller[_0x6cf6('0xa')]);router[_0x6cf6('0x9')](_0x6cf6('0xb'),auth[_0x6cf6('0x7')](),controller[_0x6cf6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6cf6('0xd')]('/:id',auth[_0x6cf6('0x7')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xf')](_0x6cf6('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb8a0=['create','put','update','delete','destroy','path','connect-timeout','Router','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x3ea21e,_0x169470){_0x3ea21e=_0x3ea21e-0x0;var _0x5d3018=_0xb8a0[_0x3ea21e];return _0x5d3018;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b8a('0x0'));var timeout=require(_0x0b8a('0x1'));var express=require('express');var router=express[_0x0b8a('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x0b8a('0x3')]('/',auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x5')]);router[_0x0b8a('0x3')](_0x0b8a('0x6'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x7')]);router[_0x0b8a('0x3')](_0x0b8a('0x8'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x9')]);router[_0x0b8a('0xa')]('/',auth[_0x0b8a('0x4')](),controller[_0x0b8a('0xb')]);router[_0x0b8a('0xc')](_0x0b8a('0x8'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0xd')]);router[_0x0b8a('0xe')](_0x0b8a('0x8'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('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 acd03be..1450831 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 _0x2825=['sequelize','exports','INTEGER'];(function(_0x91d973,_0x3c1be7){var _0x4822c2=function(_0x2305ab){while(--_0x2305ab){_0x91d973['push'](_0x91d973['shift']());}};_0x4822c2(++_0x3c1be7);}(_0x2825,0x15c));var _0x5282=function(_0x3a6ee1,_0x16cc9b){_0x3a6ee1=_0x3a6ee1-0x0;var _0x2e7be4=_0x2825[_0x3a6ee1];return _0x2e7be4;};'use strict';var Sequelize=require(_0x5282('0x0'));module[_0x5282('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5282('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x208d=['sequelize','STRING'];(function(_0x36d1f8,_0x1603ed){var _0x273496=function(_0x2f0ac7){while(--_0x2f0ac7){_0x36d1f8['push'](_0x36d1f8['shift']());}};_0x273496(++_0x1603ed);}(_0x208d,0x70));var _0xd208=function(_0x46c1f5,_0x505b91){_0x46c1f5=_0x46c1f5-0x0;var _0x1a044d=_0x208d[_0x46c1f5];return _0x1a044d;};'use strict';var Sequelize=require(_0xd208('0x0'));module['exports']={'name':{'type':Sequelize[_0xd208('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ab26a9a..0ef4a0c 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 _0x2bd6=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','UserProfileResource','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x136429,_0x426356){var _0x32a082=function(_0x2f89ca){while(--_0x2f89ca){_0x136429['push'](_0x136429['shift']());}};_0x32a082(++_0x426356);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x2bd6[_0x2df507];return _0x1f7167;};'use strict';var pdf=require(_0x62bd('0x0'));var emlformat=require(_0x62bd('0x1'));var rimraf=require(_0x62bd('0x2'));var zipdir=require(_0x62bd('0x3'));var jsonpatch=require(_0x62bd('0x4'));var rp=require('request-promise');var moment=require(_0x62bd('0x5'));var BPromise=require(_0x62bd('0x6'));var Mustache=require(_0x62bd('0x7'));var util=require('util');var path=require(_0x62bd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x62bd('0x9'));var fs=require('fs');var _=require(_0x62bd('0xa'));var squel=require('squel');var crypto=require(_0x62bd('0xb'));var jsforce=require(_0x62bd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62bd('0xd'));var querystring=require(_0x62bd('0xe'));var Papa=require(_0x62bd('0xf'));var Redis=require(_0x62bd('0x10'));var authService=require(_0x62bd('0x11'));var qs=require(_0x62bd('0x12'));var hardwareService=require(_0x62bd('0x13'));var logger=require(_0x62bd('0x14'))(_0x62bd('0x15'));var utils=require(_0x62bd('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x282b92,_0x3271da){_0x3271da=_0x3271da||0xcc;return function(_0x32941d){if(_0x32941d){return _0x282b92[_0x62bd('0x17')](_0x3271da);}return _0x282b92[_0x62bd('0x18')](_0x3271da)[_0x62bd('0x19')]();};}function respondWithResult(_0x549520,_0x12815e){_0x12815e=_0x12815e||0xc8;return function(_0x5d42f8){if(_0x5d42f8){return _0x549520[_0x62bd('0x18')](_0x12815e)['json'](_0x5d42f8);}};}function respondWithFilteredResult(_0x4bc2d9,_0x82c6b9){return function(_0x397a41){if(_0x397a41){var _0x5260f9=_0x397a41[_0x62bd('0x1a')],_0x3073e1=_0x82c6b9[_0x62bd('0x1b')],_0x1d178b=_0x82c6b9['offset']+_0x82c6b9[_0x62bd('0x1c')],_0x3e2133;if(_0x1d178b>=_0x5260f9){_0x1d178b=_0x5260f9;_0x3e2133=0xc8;}else{_0x3e2133=0xce;}_0x4bc2d9[_0x62bd('0x18')](_0x3e2133);return _0x4bc2d9[_0x62bd('0x1d')](_0x62bd('0x1e'),_0x3073e1+'-'+_0x1d178b+'/'+_0x5260f9)['json'](_0x397a41);}return null;};}function patchUpdates(_0x3d050b){return function(_0x167d34){try{jsonpatch[_0x62bd('0x1f')](_0x167d34,_0x3d050b,!![]);}catch(_0x21613e){return BPromise['reject'](_0x21613e);}return _0x167d34[_0x62bd('0x20')]();};}function saveUpdates(_0x3e28d8,_0xb03f28){return function(_0x2298d9){if(_0x2298d9){return _0x2298d9['update'](_0x3e28d8)[_0x62bd('0x21')](function(_0x2cbc5c){return _0x2cbc5c;});}return null;};}function removeEntity(_0x365396,_0xa6bae9){return function(_0x5ec823){if(_0x5ec823){return _0x5ec823[_0x62bd('0x22')]()[_0x62bd('0x21')](function(){_0x365396[_0x62bd('0x18')](0xcc)[_0x62bd('0x19')]();});}};}function handleEntityNotFound(_0x2806c6,_0x10fad2){return function(_0x245628){if(!_0x245628){_0x2806c6[_0x62bd('0x17')](0x194);}return _0x245628;};}function handleError(_0x364258,_0x2213d9){_0x2213d9=_0x2213d9||0x1f4;return function(_0xe02ab1){logger[_0x62bd('0x23')](_0xe02ab1[_0x62bd('0x24')]);if(_0xe02ab1['name']){delete _0xe02ab1[_0x62bd('0x25')];}_0x364258[_0x62bd('0x18')](_0x2213d9)['send'](_0xe02ab1);};}exports[_0x62bd('0x26')]=function(_0x3c6761,_0x1f6339){var _0x56890f={},_0x191063={},_0x205d78={'count':0x0,'rows':[]};var _0x43add5=db[_0x62bd('0x27')][_0x62bd('0x28')];_0x191063[_0x62bd('0x29')]=_[_0x62bd('0x2a')](_0x43add5);_0x191063[_0x62bd('0x2b')]=_[_0x62bd('0x2a')](_0x3c6761['query']);_0x191063[_0x62bd('0x2c')]=_[_0x62bd('0x2d')](_0x191063[_0x62bd('0x29')],_0x191063[_0x62bd('0x2b')]);_0x56890f[_0x62bd('0x2e')]=_[_0x62bd('0x2d')](_0x191063['model'],qs[_0x62bd('0x2f')](_0x3c6761[_0x62bd('0x2b')][_0x62bd('0x2f')]));_0x56890f[_0x62bd('0x2e')]=_0x56890f[_0x62bd('0x2e')]['length']?_0x56890f[_0x62bd('0x2e')]:_0x191063['model'];if(!_0x3c6761['query'][_0x62bd('0x30')](_0x62bd('0x31'))){_0x56890f[_0x62bd('0x1c')]=qs[_0x62bd('0x1c')](_0x3c6761[_0x62bd('0x2b')]['limit']);_0x56890f[_0x62bd('0x1b')]=qs[_0x62bd('0x1b')](_0x3c6761[_0x62bd('0x2b')][_0x62bd('0x1b')]);}_0x56890f[_0x62bd('0x32')]=qs[_0x62bd('0x33')](_0x3c6761[_0x62bd('0x2b')][_0x62bd('0x33')]);_0x56890f[_0x62bd('0x34')]=qs['filters'](_[_0x62bd('0x35')](_0x3c6761['query'],_0x191063[_0x62bd('0x2c')]));if(_0x3c6761['query'][_0x62bd('0x36')]){_0x56890f[_0x62bd('0x34')]=_['merge'](_0x56890f[_0x62bd('0x34')],{'$or':_[_0x62bd('0x37')](_0x43add5,function(_0x2a0382){if(_0x2a0382[_0x62bd('0x38')][_0x62bd('0x39')]!==_0x62bd('0x3a')){var _0x1aed2e={};_0x1aed2e[_0x2a0382[_0x62bd('0x3b')]]={'$like':'%'+_0x3c6761['query']['filter']+'%'};return _0x1aed2e;}})});}_0x56890f=_[_0x62bd('0x3c')]({},_0x56890f,_0x3c6761[_0x62bd('0x3d')]);var _0x2f8c44={'where':_0x56890f[_0x62bd('0x34')]};return db[_0x62bd('0x27')][_0x62bd('0x1a')](_0x2f8c44)[_0x62bd('0x21')](function(_0x47d3d3){_0x205d78[_0x62bd('0x1a')]=_0x47d3d3;if(_0x3c6761['query'][_0x62bd('0x3e')]){_0x56890f[_0x62bd('0x3f')]=[{'all':!![]}];}return db[_0x62bd('0x27')][_0x62bd('0x40')](_0x56890f);})[_0x62bd('0x21')](function(_0x5e6a6d){_0x205d78[_0x62bd('0x41')]=_0x5e6a6d;return _0x205d78;})[_0x62bd('0x21')](respondWithFilteredResult(_0x1f6339,_0x56890f))[_0x62bd('0x42')](handleError(_0x1f6339,null));};exports['show']=function(_0x1f6845,_0x4dc01b){var _0xa282f1={'raw':![],'where':{'id':_0x1f6845[_0x62bd('0x43')]['id']}},_0x370e47={};_0x370e47[_0x62bd('0x29')]=_[_0x62bd('0x2a')](db[_0x62bd('0x27')][_0x62bd('0x28')]);_0x370e47[_0x62bd('0x2b')]=_[_0x62bd('0x2a')](_0x1f6845[_0x62bd('0x2b')]);_0x370e47[_0x62bd('0x2c')]=_['intersection'](_0x370e47[_0x62bd('0x29')],_0x370e47[_0x62bd('0x2b')]);_0xa282f1[_0x62bd('0x2e')]=_[_0x62bd('0x2d')](_0x370e47[_0x62bd('0x29')],qs[_0x62bd('0x2f')](_0x1f6845[_0x62bd('0x2b')][_0x62bd('0x2f')]));_0xa282f1[_0x62bd('0x2e')]=_0xa282f1[_0x62bd('0x2e')][_0x62bd('0x44')]?_0xa282f1[_0x62bd('0x2e')]:_0x370e47[_0x62bd('0x29')];if(_0x1f6845[_0x62bd('0x2b')][_0x62bd('0x3e')]){_0xa282f1['include']=[{'all':!![]}];}_0xa282f1=_['merge']({},_0xa282f1,_0x1f6845[_0x62bd('0x3d')]);return db['UserProfileResource'][_0x62bd('0x45')](_0xa282f1)[_0x62bd('0x21')](handleEntityNotFound(_0x4dc01b,null))[_0x62bd('0x21')](respondWithResult(_0x4dc01b,null))[_0x62bd('0x42')](handleError(_0x4dc01b,null));};exports[_0x62bd('0x46')]=function(_0x44b06f,_0xd0ae1b){return db[_0x62bd('0x27')]['create'](_0x44b06f['body'],{})[_0x62bd('0x21')](respondWithResult(_0xd0ae1b,0xc9))[_0x62bd('0x42')](handleError(_0xd0ae1b,null));};exports[_0x62bd('0x47')]=function(_0x3d0d52,_0x55dfd5){if(_0x3d0d52[_0x62bd('0x48')]['id']){delete _0x3d0d52[_0x62bd('0x48')]['id'];}return db[_0x62bd('0x27')][_0x62bd('0x45')]({'where':{'id':_0x3d0d52[_0x62bd('0x43')]['id']}})[_0x62bd('0x21')](handleEntityNotFound(_0x55dfd5,null))['then'](saveUpdates(_0x3d0d52[_0x62bd('0x48')],null))[_0x62bd('0x21')](respondWithResult(_0x55dfd5,null))[_0x62bd('0x42')](handleError(_0x55dfd5,null));};exports[_0x62bd('0x22')]=function(_0x30660a,_0x3c4f05){return db['UserProfileResource']['find']({'where':{'id':_0x30660a['params']['id']}})[_0x62bd('0x21')](handleEntityNotFound(_0x3c4f05,null))[_0x62bd('0x21')](removeEntity(_0x3c4f05,null))['catch'](handleError(_0x3c4f05,null));};exports[_0x62bd('0x49')]=function(_0x122273,_0x306b03){return db['UserProfileResource']['describe']()[_0x62bd('0x21')](respondWithResult(_0x306b03,null))[_0x62bd('0x42')](handleError(_0x306b03,null));}; \ No newline at end of file +var _0xeb79=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','name','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','order','sort','filter','where','map','type','key','VIRTUAL','field','merge','options','then','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','update','destroy','describe','rimraf','fast-json-patch','moment','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x3d7132,_0x4df4f4){var _0x41b1ec=function(_0x2380b7){while(--_0x2380b7){_0x3d7132['push'](_0x3d7132['shift']());}};_0x41b1ec(++_0x4df4f4);}(_0xeb79,0x87));var _0x9eb7=function(_0x3d0c34,_0x1f84a0){_0x3d0c34=_0x3d0c34-0x0;var _0x415c82=_0xeb79[_0x3d0c34];return _0x415c82;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9eb7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9eb7('0x1'));var rp=require('request-promise');var moment=require(_0x9eb7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9eb7('0x3'));var util=require(_0x9eb7('0x4'));var path=require(_0x9eb7('0x5'));var sox=require(_0x9eb7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9eb7('0x7'));var squel=require('squel');var crypto=require(_0x9eb7('0x8'));var jsforce=require(_0x9eb7('0x9'));var deskjs=require(_0x9eb7('0xa'));var toCsv=require(_0x9eb7('0xb'));var querystring=require(_0x9eb7('0xc'));var Papa=require(_0x9eb7('0xd'));var Redis=require(_0x9eb7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9eb7('0xf'));var hardwareService=require(_0x9eb7('0x10'));var logger=require(_0x9eb7('0x11'))(_0x9eb7('0x12'));var utils=require(_0x9eb7('0x13'));var config=require(_0x9eb7('0x14'));var db=require(_0x9eb7('0x15'))['db'];function respondWithStatusCode(_0x2befe6,_0x1eb44b){_0x1eb44b=_0x1eb44b||0xcc;return function(_0x9cbbce){if(_0x9cbbce){return _0x2befe6[_0x9eb7('0x16')](_0x1eb44b);}return _0x2befe6[_0x9eb7('0x17')](_0x1eb44b)[_0x9eb7('0x18')]();};}function respondWithResult(_0x2dbf93,_0x172c11){_0x172c11=_0x172c11||0xc8;return function(_0x4edeba){if(_0x4edeba){return _0x2dbf93[_0x9eb7('0x17')](_0x172c11)[_0x9eb7('0x19')](_0x4edeba);}};}function respondWithFilteredResult(_0x2de9e2,_0x294302){return function(_0x30ac29){if(_0x30ac29){var _0x12dd03=_0x30ac29[_0x9eb7('0x1a')],_0x7cd0f7=_0x294302[_0x9eb7('0x1b')],_0x40d5d4=_0x294302[_0x9eb7('0x1b')]+_0x294302[_0x9eb7('0x1c')],_0x3e7723;if(_0x40d5d4>=_0x12dd03){_0x40d5d4=_0x12dd03;_0x3e7723=0xc8;}else{_0x3e7723=0xce;}_0x2de9e2['status'](_0x3e7723);return _0x2de9e2[_0x9eb7('0x1d')](_0x9eb7('0x1e'),_0x7cd0f7+'-'+_0x40d5d4+'/'+_0x12dd03)[_0x9eb7('0x19')](_0x30ac29);}return null;};}function patchUpdates(_0x4d1fd0){return function(_0x377d44){try{jsonpatch[_0x9eb7('0x1f')](_0x377d44,_0x4d1fd0,!![]);}catch(_0x5b7695){return BPromise[_0x9eb7('0x20')](_0x5b7695);}return _0x377d44[_0x9eb7('0x21')]();};}function saveUpdates(_0x1dade3,_0x53a498){return function(_0x4762a9){if(_0x4762a9){return _0x4762a9['update'](_0x1dade3)['then'](function(_0x438f1b){return _0x438f1b;});}return null;};}function removeEntity(_0x1dfd6b,_0x5b5a7e){return function(_0x295f35){if(_0x295f35){return _0x295f35['destroy']()['then'](function(){_0x1dfd6b[_0x9eb7('0x17')](0xcc)[_0x9eb7('0x18')]();});}};}function handleEntityNotFound(_0x1d3ce3,_0x47b089){return function(_0x4c92c2){if(!_0x4c92c2){_0x1d3ce3['sendStatus'](0x194);}return _0x4c92c2;};}function handleError(_0x5078bd,_0x3404a9){_0x3404a9=_0x3404a9||0x1f4;return function(_0x2b2c8e){logger['error'](_0x2b2c8e[_0x9eb7('0x22')]);if(_0x2b2c8e[_0x9eb7('0x23')]){delete _0x2b2c8e[_0x9eb7('0x23')];}_0x5078bd[_0x9eb7('0x17')](_0x3404a9)[_0x9eb7('0x24')](_0x2b2c8e);};}exports[_0x9eb7('0x25')]=function(_0x1e4bc6,_0x5c50d5){var _0x198ae6={},_0x543cee={},_0x24d290={'count':0x0,'rows':[]};var _0x5375fa=db[_0x9eb7('0x26')][_0x9eb7('0x27')];_0x543cee[_0x9eb7('0x28')]=_[_0x9eb7('0x29')](_0x5375fa);_0x543cee[_0x9eb7('0x2a')]=_[_0x9eb7('0x29')](_0x1e4bc6['query']);_0x543cee[_0x9eb7('0x2b')]=_['intersection'](_0x543cee['model'],_0x543cee[_0x9eb7('0x2a')]);_0x198ae6['attributes']=_['intersection'](_0x543cee[_0x9eb7('0x28')],qs[_0x9eb7('0x2c')](_0x1e4bc6['query']['fields']));_0x198ae6[_0x9eb7('0x2d')]=_0x198ae6[_0x9eb7('0x2d')][_0x9eb7('0x2e')]?_0x198ae6[_0x9eb7('0x2d')]:_0x543cee['model'];if(!_0x1e4bc6[_0x9eb7('0x2a')][_0x9eb7('0x2f')]('nolimit')){_0x198ae6['limit']=qs['limit'](_0x1e4bc6['query'][_0x9eb7('0x1c')]);_0x198ae6['offset']=qs[_0x9eb7('0x1b')](_0x1e4bc6[_0x9eb7('0x2a')]['offset']);}_0x198ae6[_0x9eb7('0x30')]=qs[_0x9eb7('0x31')](_0x1e4bc6[_0x9eb7('0x2a')]['sort']);_0x198ae6['where']=qs[_0x9eb7('0x2b')](_['pick'](_0x1e4bc6['query'],_0x543cee[_0x9eb7('0x2b')]));if(_0x1e4bc6[_0x9eb7('0x2a')][_0x9eb7('0x32')]){_0x198ae6[_0x9eb7('0x33')]=_['merge'](_0x198ae6[_0x9eb7('0x33')],{'$or':_[_0x9eb7('0x34')](_0x5375fa,function(_0x36c00c){if(_0x36c00c[_0x9eb7('0x35')][_0x9eb7('0x36')]!==_0x9eb7('0x37')){var _0x33c827={};_0x33c827[_0x36c00c[_0x9eb7('0x38')]]={'$like':'%'+_0x1e4bc6[_0x9eb7('0x2a')]['filter']+'%'};return _0x33c827;}})});}_0x198ae6=_[_0x9eb7('0x39')]({},_0x198ae6,_0x1e4bc6[_0x9eb7('0x3a')]);var _0x3a6838={'where':_0x198ae6['where']};return db[_0x9eb7('0x26')][_0x9eb7('0x1a')](_0x3a6838)[_0x9eb7('0x3b')](function(_0x4bac01){_0x24d290['count']=_0x4bac01;if(_0x1e4bc6[_0x9eb7('0x2a')][_0x9eb7('0x3c')]){_0x198ae6['include']=[{'all':!![]}];}return db[_0x9eb7('0x26')][_0x9eb7('0x3d')](_0x198ae6);})[_0x9eb7('0x3b')](function(_0x75e144){_0x24d290[_0x9eb7('0x3e')]=_0x75e144;return _0x24d290;})['then'](respondWithFilteredResult(_0x5c50d5,_0x198ae6))[_0x9eb7('0x3f')](handleError(_0x5c50d5,null));};exports[_0x9eb7('0x40')]=function(_0xc97d89,_0x1ed308){var _0xc664ed={'raw':![],'where':{'id':_0xc97d89[_0x9eb7('0x41')]['id']}},_0x16281b={};_0x16281b['model']=_[_0x9eb7('0x29')](db['UserProfileResource'][_0x9eb7('0x27')]);_0x16281b[_0x9eb7('0x2a')]=_[_0x9eb7('0x29')](_0xc97d89[_0x9eb7('0x2a')]);_0x16281b['filters']=_[_0x9eb7('0x42')](_0x16281b[_0x9eb7('0x28')],_0x16281b[_0x9eb7('0x2a')]);_0xc664ed[_0x9eb7('0x2d')]=_[_0x9eb7('0x42')](_0x16281b[_0x9eb7('0x28')],qs[_0x9eb7('0x2c')](_0xc97d89['query'][_0x9eb7('0x2c')]));_0xc664ed['attributes']=_0xc664ed[_0x9eb7('0x2d')]['length']?_0xc664ed[_0x9eb7('0x2d')]:_0x16281b[_0x9eb7('0x28')];if(_0xc97d89['query'][_0x9eb7('0x3c')]){_0xc664ed[_0x9eb7('0x43')]=[{'all':!![]}];}_0xc664ed=_[_0x9eb7('0x39')]({},_0xc664ed,_0xc97d89['options']);return db[_0x9eb7('0x26')][_0x9eb7('0x44')](_0xc664ed)[_0x9eb7('0x3b')](handleEntityNotFound(_0x1ed308,null))[_0x9eb7('0x3b')](respondWithResult(_0x1ed308,null))[_0x9eb7('0x3f')](handleError(_0x1ed308,null));};exports[_0x9eb7('0x45')]=function(_0x40020a,_0x1bb4ae){return db[_0x9eb7('0x26')][_0x9eb7('0x45')](_0x40020a[_0x9eb7('0x46')],{})[_0x9eb7('0x3b')](respondWithResult(_0x1bb4ae,0xc9))[_0x9eb7('0x3f')](handleError(_0x1bb4ae,null));};exports[_0x9eb7('0x47')]=function(_0xfa3b8a,_0x5e9645){if(_0xfa3b8a[_0x9eb7('0x46')]['id']){delete _0xfa3b8a['body']['id'];}return db[_0x9eb7('0x26')][_0x9eb7('0x44')]({'where':{'id':_0xfa3b8a[_0x9eb7('0x41')]['id']}})[_0x9eb7('0x3b')](handleEntityNotFound(_0x5e9645,null))['then'](saveUpdates(_0xfa3b8a['body'],null))[_0x9eb7('0x3b')](respondWithResult(_0x5e9645,null))['catch'](handleError(_0x5e9645,null));};exports[_0x9eb7('0x48')]=function(_0x31c198,_0x1a3a7c){return db[_0x9eb7('0x26')][_0x9eb7('0x44')]({'where':{'id':_0x31c198['params']['id']}})[_0x9eb7('0x3b')](handleEntityNotFound(_0x1a3a7c,null))[_0x9eb7('0x3b')](removeEntity(_0x1a3a7c,null))['catch'](handleError(_0x1a3a7c,null));};exports['describe']=function(_0x186963,_0x514342){return db[_0x9eb7('0x26')][_0x9eb7('0x49')]()[_0x9eb7('0x3b')](respondWithResult(_0x514342,null))[_0x9eb7('0x3f')](handleError(_0x514342,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 3280d66..073f500 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 _0xddb4=['rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','api','bluebird','request-promise','path'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0xddb4,0x183));var _0x4ddb=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0xddb4[_0x4d394d];return _0x4f0003;};'use strict';var _=require(_0x4ddb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ddb('0x1'));var moment=require('moment');var BPromise=require(_0x4ddb('0x2'));var rp=require(_0x4ddb('0x3'));var fs=require('fs');var path=require(_0x4ddb('0x4'));var rimraf=require(_0x4ddb('0x5'));var config=require(_0x4ddb('0x6'));var attributes=require(_0x4ddb('0x7'));module['exports']=function(_0x553b16,_0x8dfa5b){return _0x553b16[_0x4ddb('0x8')](_0x4ddb('0x9'),attributes,{'tableName':_0x4ddb('0xa'),'paranoid':![],'indexes':[{'name':_0x4ddb('0xb'),'fields':[_0x4ddb('0xc'),_0x4ddb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ea8=['path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x10ab1a,_0x56c490){var _0x2dbf32=function(_0x1f2ce3){while(--_0x1f2ce3){_0x10ab1a['push'](_0x10ab1a['shift']());}};_0x2dbf32(++_0x56c490);}(_0x1ea8,0x174));var _0x81ea=function(_0x44cf2b,_0x222d5c){_0x44cf2b=_0x44cf2b-0x0;var _0x19b5ee=_0x1ea8[_0x44cf2b];return _0x19b5ee;};'use strict';var _=require('lodash');var util=require(_0x81ea('0x0'));var logger=require(_0x81ea('0x1'))(_0x81ea('0x2'));var moment=require(_0x81ea('0x3'));var BPromise=require(_0x81ea('0x4'));var rp=require(_0x81ea('0x5'));var fs=require('fs');var path=require(_0x81ea('0x6'));var rimraf=require('rimraf');var config=require(_0x81ea('0x7'));var attributes=require(_0x81ea('0x8'));module[_0x81ea('0x9')]=function(_0x201358,_0x4cd4ed){return _0x201358[_0x81ea('0xa')](_0x81ea('0xb'),attributes,{'tableName':_0x81ea('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x81ea('0xd'),'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 78197a5..21a49d5 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 _0x627e=['request','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x139bf7,_0x1e8bd5){var _0x206bc3=function(_0x44b085){while(--_0x44b085){_0x139bf7['push'](_0x139bf7['shift']());}};_0x206bc3(++_0x1e8bd5);}(_0x627e,0x14a));var _0xe627=function(_0x18f715,_0x31ee26){_0x18f715=_0x18f715-0x0;var _0x2e40c0=_0x627e[_0x18f715];return _0x2e40c0;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});} \ No newline at end of file +var _0xcaf2=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment'];(function(_0x3a487f,_0x42cdbf){var _0x4f3a40=function(_0x5c9d9e){while(--_0x5c9d9e){_0x3a487f['push'](_0x3a487f['shift']());}};_0x4f3a40(++_0x42cdbf);}(_0xcaf2,0x8a));var _0x2caf=function(_0x4f8f52,_0x139a03){_0x4f8f52=_0x4f8f52-0x0;var _0x16c1d4=_0xcaf2[_0x4f8f52];return _0x16c1d4;};'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);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 415cb59..6288b71 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 _0xea8c=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x26acd7,_0x2433d3){var _0x145397=function(_0x42af15){while(--_0x42af15){_0x26acd7['push'](_0x26acd7['shift']());}};_0x145397(++_0x2433d3);}(_0xea8c,0x116));var _0xcea8=function(_0x34cea6,_0x1ac364){_0x34cea6=_0x34cea6-0x0;var _0x40309e=_0xea8c[_0x34cea6];return _0x40309e;};'use strict';var multer=require(_0xcea8('0x0'));var util=require(_0xcea8('0x1'));var path=require(_0xcea8('0x2'));var timeout=require(_0xcea8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xcea8('0x4'));var interaction=require(_0xcea8('0x5'));var config=require(_0xcea8('0x6'));var controller=require(_0xcea8('0x7'));router[_0xcea8('0x8')]('/',auth[_0xcea8('0x9')](),controller[_0xcea8('0xa')]);router['get']('/describe',auth[_0xcea8('0x9')](),controller[_0xcea8('0xb')]);router[_0xcea8('0x8')](_0xcea8('0xc'),auth[_0xcea8('0x9')](),controller[_0xcea8('0xd')]);router[_0xcea8('0xe')]('/',auth['isAuthenticated'](),controller[_0xcea8('0xf')]);router[_0xcea8('0x10')](_0xcea8('0xc'),auth[_0xcea8('0x9')](),controller[_0xcea8('0x11')]);router[_0xcea8('0x12')](_0xcea8('0xc'),auth['isAuthenticated'](),controller[_0xcea8('0x13')]);module['exports']=router; \ No newline at end of file +var _0xec69=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','index','isAuthenticated','get','/:id','show','post','put','update','destroy','util','path'];(function(_0x3cca9d,_0x380216){var _0x1a9363=function(_0x2716ba){while(--_0x2716ba){_0x3cca9d['push'](_0x3cca9d['shift']());}};_0x1a9363(++_0x380216);}(_0xec69,0x1a7));var _0x9ec6=function(_0x2416b9,_0x313d5d){_0x2416b9=_0x2416b9-0x0;var _0x9eefeb=_0xec69[_0x2416b9];return _0x9eefeb;};'use strict';var multer=require('multer');var util=require(_0x9ec6('0x0'));var path=require(_0x9ec6('0x1'));var timeout=require(_0x9ec6('0x2'));var express=require(_0x9ec6('0x3'));var router=express[_0x9ec6('0x4')]();var auth=require(_0x9ec6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ec6('0x6'));var controller=require(_0x9ec6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9ec6('0x8')]);router['get']('/describe',auth[_0x9ec6('0x9')](),controller['describe']);router[_0x9ec6('0xa')](_0x9ec6('0xb'),auth[_0x9ec6('0x9')](),controller[_0x9ec6('0xc')]);router[_0x9ec6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ec6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9ec6('0xf')]);router['delete']('/:id',auth[_0x9ec6('0x9')](),controller[_0x9ec6('0x10')]);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 14591a0..14b00c8 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 _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x439490,_0x5f0754){var _0xce36c2=function(_0x3ba404){while(--_0x3ba404){_0x439490['push'](_0x439490['shift']());}};_0xce36c2(++_0x5f0754);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c0fbb,_0x420492){_0x4c0fbb=_0x4c0fbb-0x0;var _0x462c3d=_0xedd9[_0x4c0fbb];return _0x462c3d;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0x70e0=['split','sequelize','exports','STRING','BOOLEAN','crudPermissions','getDataValue'];(function(_0x508823,_0x316707){var _0x13523b=function(_0x36d27f){while(--_0x36d27f){_0x508823['push'](_0x508823['shift']());}};_0x13523b(++_0x316707);}(_0x70e0,0x17b));var _0x070e=function(_0x32f549,_0x128590){_0x32f549=_0x32f549-0x0;var _0x417ae4=_0x70e0[_0x32f549];return _0x417ae4;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x070e('0x2')],'set':function(_0x2593e5){this['setDataValue'](_0x070e('0x4'),_0x2593e5?_0x2593e5['join'](''):[]);},'get':function(){return this[_0x070e('0x5')]('crudPermissions')?this['getDataValue']('crudPermissions')[_0x070e('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 520a804..56ba44d 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 _0x2cf7=['offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','fields','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count'];(function(_0x526408,_0x585982){var _0x3f66e3=function(_0x55af4b){while(--_0x55af4b){_0x526408['push'](_0x526408['shift']());}};_0x3f66e3(++_0x585982);}(_0x2cf7,0xc0));var _0x72cf=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x2cf7[_0x1e4a8e];return _0x5408f9;};'use strict';var pdf=require(_0x72cf('0x0'));var emlformat=require(_0x72cf('0x1'));var rimraf=require(_0x72cf('0x2'));var zipdir=require(_0x72cf('0x3'));var jsonpatch=require(_0x72cf('0x4'));var rp=require(_0x72cf('0x5'));var moment=require(_0x72cf('0x6'));var BPromise=require(_0x72cf('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x72cf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x72cf('0x9'));var fs=require('fs');var _=require(_0x72cf('0xa'));var squel=require(_0x72cf('0xb'));var crypto=require(_0x72cf('0xc'));var jsforce=require(_0x72cf('0xd'));var deskjs=require(_0x72cf('0xe'));var toCsv=require(_0x72cf('0xf'));var querystring=require(_0x72cf('0x10'));var Papa=require(_0x72cf('0x11'));var Redis=require(_0x72cf('0x12'));var authService=require(_0x72cf('0x13'));var qs=require(_0x72cf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72cf('0x15'));var utils=require(_0x72cf('0x16'));var config=require(_0x72cf('0x17'));var db=require(_0x72cf('0x18'))['db'];function respondWithStatusCode(_0x514faa,_0x115a55){_0x115a55=_0x115a55||0xcc;return function(_0x28f683){if(_0x28f683){return _0x514faa[_0x72cf('0x19')](_0x115a55);}return _0x514faa['status'](_0x115a55)[_0x72cf('0x1a')]();};}function respondWithResult(_0x26e2c9,_0x1807d1){_0x1807d1=_0x1807d1||0xc8;return function(_0x46d1b2){if(_0x46d1b2){return _0x26e2c9[_0x72cf('0x1b')](_0x1807d1)[_0x72cf('0x1c')](_0x46d1b2);}};}function respondWithFilteredResult(_0x4ad39e,_0x459228){return function(_0x348d2d){if(_0x348d2d){var _0x4031f8=_0x348d2d[_0x72cf('0x1d')],_0x50a036=_0x459228[_0x72cf('0x1e')],_0x14ebec=_0x459228[_0x72cf('0x1e')]+_0x459228[_0x72cf('0x1f')],_0x35b9b8;if(_0x14ebec>=_0x4031f8){_0x14ebec=_0x4031f8;_0x35b9b8=0xc8;}else{_0x35b9b8=0xce;}_0x4ad39e[_0x72cf('0x1b')](_0x35b9b8);return _0x4ad39e[_0x72cf('0x20')](_0x72cf('0x21'),_0x50a036+'-'+_0x14ebec+'/'+_0x4031f8)[_0x72cf('0x1c')](_0x348d2d);}return null;};}function patchUpdates(_0x14dc38){return function(_0x494230){try{jsonpatch[_0x72cf('0x22')](_0x494230,_0x14dc38,!![]);}catch(_0x567ac7){return BPromise['reject'](_0x567ac7);}return _0x494230[_0x72cf('0x23')]();};}function saveUpdates(_0x5048b6,_0x290255){return function(_0x20871e){if(_0x20871e){return _0x20871e[_0x72cf('0x24')](_0x5048b6)[_0x72cf('0x25')](function(_0x26631c){return _0x26631c;});}return null;};}function removeEntity(_0x59a62e,_0x186aeb){return function(_0x46bc20){if(_0x46bc20){return _0x46bc20['destroy']()[_0x72cf('0x25')](function(){_0x59a62e['status'](0xcc)[_0x72cf('0x1a')]();});}};}function handleEntityNotFound(_0x32fec8,_0x4ba1d2){return function(_0x47643f){if(!_0x47643f){_0x32fec8[_0x72cf('0x19')](0x194);}return _0x47643f;};}function handleError(_0x5bf41d,_0x3cf0fe){_0x3cf0fe=_0x3cf0fe||0x1f4;return function(_0x5641da){logger[_0x72cf('0x26')](_0x5641da[_0x72cf('0x27')]);if(_0x5641da[_0x72cf('0x28')]){delete _0x5641da['name'];}_0x5bf41d[_0x72cf('0x1b')](_0x3cf0fe)[_0x72cf('0x29')](_0x5641da);};}exports[_0x72cf('0x2a')]=function(_0x2639cb,_0x309bf7){var _0x3ee578={},_0x5f46ee={},_0x1526ca={'count':0x0,'rows':[]};var _0x203138=db[_0x72cf('0x2b')][_0x72cf('0x2c')];_0x5f46ee[_0x72cf('0x2d')]=_[_0x72cf('0x2e')](_0x203138);_0x5f46ee['query']=_[_0x72cf('0x2e')](_0x2639cb[_0x72cf('0x2f')]);_0x5f46ee[_0x72cf('0x30')]=_['intersection'](_0x5f46ee[_0x72cf('0x2d')],_0x5f46ee['query']);_0x3ee578[_0x72cf('0x31')]=_[_0x72cf('0x32')](_0x5f46ee[_0x72cf('0x2d')],qs['fields'](_0x2639cb[_0x72cf('0x2f')]['fields']));_0x3ee578[_0x72cf('0x31')]=_0x3ee578['attributes'][_0x72cf('0x33')]?_0x3ee578[_0x72cf('0x31')]:_0x5f46ee[_0x72cf('0x2d')];if(!_0x2639cb[_0x72cf('0x2f')]['hasOwnProperty'](_0x72cf('0x34'))){_0x3ee578[_0x72cf('0x1f')]=qs[_0x72cf('0x1f')](_0x2639cb[_0x72cf('0x2f')]['limit']);_0x3ee578['offset']=qs[_0x72cf('0x1e')](_0x2639cb['query'][_0x72cf('0x1e')]);}_0x3ee578[_0x72cf('0x35')]=qs[_0x72cf('0x36')](_0x2639cb[_0x72cf('0x2f')][_0x72cf('0x36')]);_0x3ee578[_0x72cf('0x37')]=qs[_0x72cf('0x30')](_[_0x72cf('0x38')](_0x2639cb[_0x72cf('0x2f')],_0x5f46ee[_0x72cf('0x30')]));if(_0x2639cb[_0x72cf('0x2f')][_0x72cf('0x39')]){_0x3ee578[_0x72cf('0x37')]=_['merge'](_0x3ee578[_0x72cf('0x37')],{'$or':_[_0x72cf('0x3a')](_0x203138,function(_0x403196){if(_0x403196[_0x72cf('0x3b')][_0x72cf('0x3c')]!==_0x72cf('0x3d')){var _0x33ce9d={};_0x33ce9d[_0x403196['field']]={'$like':'%'+_0x2639cb['query'][_0x72cf('0x39')]+'%'};return _0x33ce9d;}})});}_0x3ee578=_['merge']({},_0x3ee578,_0x2639cb[_0x72cf('0x3e')]);var _0x6f0ee8={'where':_0x3ee578[_0x72cf('0x37')]};return db['UserProfileSection'][_0x72cf('0x1d')](_0x6f0ee8)[_0x72cf('0x25')](function(_0x3bdf91){_0x1526ca[_0x72cf('0x1d')]=_0x3bdf91;if(_0x2639cb['query'][_0x72cf('0x3f')]){_0x3ee578[_0x72cf('0x40')]=[{'all':!![]}];}return db[_0x72cf('0x2b')]['findAll'](_0x3ee578);})['then'](function(_0xc77ba9){_0x1526ca[_0x72cf('0x41')]=_0xc77ba9;return _0x1526ca;})[_0x72cf('0x25')](respondWithFilteredResult(_0x309bf7,_0x3ee578))[_0x72cf('0x42')](handleError(_0x309bf7,null));};exports[_0x72cf('0x43')]=function(_0x4b47f6,_0x1f6bf9){var _0x227deb={'raw':![],'where':{'id':_0x4b47f6['params']['id']}},_0x56522d={};_0x56522d['model']=_[_0x72cf('0x2e')](db['UserProfileSection'][_0x72cf('0x2c')]);_0x56522d[_0x72cf('0x2f')]=_[_0x72cf('0x2e')](_0x4b47f6[_0x72cf('0x2f')]);_0x56522d[_0x72cf('0x30')]=_[_0x72cf('0x32')](_0x56522d[_0x72cf('0x2d')],_0x56522d[_0x72cf('0x2f')]);_0x227deb['attributes']=_[_0x72cf('0x32')](_0x56522d['model'],qs[_0x72cf('0x44')](_0x4b47f6[_0x72cf('0x2f')][_0x72cf('0x44')]));_0x227deb[_0x72cf('0x31')]=_0x227deb[_0x72cf('0x31')]['length']?_0x227deb['attributes']:_0x56522d['model'];if(_0x4b47f6[_0x72cf('0x2f')]['includeAll']){_0x227deb['include']=[{'all':!![]}];}_0x227deb=_['merge']({},_0x227deb,_0x4b47f6[_0x72cf('0x3e')]);return db[_0x72cf('0x2b')][_0x72cf('0x45')](_0x227deb)[_0x72cf('0x25')](handleEntityNotFound(_0x1f6bf9,null))[_0x72cf('0x25')](respondWithResult(_0x1f6bf9,null))['catch'](handleError(_0x1f6bf9,null));};exports['create']=function(_0x574856,_0x512b35){return db['UserProfileSection'][_0x72cf('0x46')](_0x574856[_0x72cf('0x47')],{})[_0x72cf('0x25')](respondWithResult(_0x512b35,0xc9))[_0x72cf('0x42')](handleError(_0x512b35,null));};exports[_0x72cf('0x24')]=function(_0x30e4a2,_0x1dbd79){if(_0x30e4a2[_0x72cf('0x47')]['id']){delete _0x30e4a2[_0x72cf('0x47')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x30e4a2[_0x72cf('0x48')]['id']}})[_0x72cf('0x25')](handleEntityNotFound(_0x1dbd79,null))[_0x72cf('0x25')](saveUpdates(_0x30e4a2['body'],null))[_0x72cf('0x25')](respondWithResult(_0x1dbd79,null))[_0x72cf('0x42')](handleError(_0x1dbd79,null));};exports['destroy']=function(_0x3ccccb,_0x20e616){return db[_0x72cf('0x2b')][_0x72cf('0x45')]({'where':{'id':_0x3ccccb[_0x72cf('0x48')]['id']}})[_0x72cf('0x25')](handleEntityNotFound(_0x20e616,null))[_0x72cf('0x25')](removeEntity(_0x20e616,null))[_0x72cf('0x42')](handleError(_0x20e616,null));};exports[_0x72cf('0x49')]=function(_0x10d728,_0x5cd524){return db[_0x72cf('0x2b')]['describe']()[_0x72cf('0x25')](respondWithResult(_0x5cd524,null))[_0x72cf('0x42')](handleError(_0x5cd524,null));}; \ No newline at end of file +var _0xc687=['crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','map','type','key','field','UserProfileSection','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x2c9a7a,_0x1e8f21){var _0x50386a=function(_0x217065){while(--_0x217065){_0x2c9a7a['push'](_0x2c9a7a['shift']());}};_0x50386a(++_0x1e8f21);}(_0xc687,0x1d2));var _0x7c68=function(_0x3c30e1,_0x224261){_0x3c30e1=_0x3c30e1-0x0;var _0x394ec2=_0xc687[_0x3c30e1];return _0x394ec2;};'use strict';var pdf=require(_0x7c68('0x0'));var emlformat=require(_0x7c68('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7c68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c68('0x3'));var moment=require(_0x7c68('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7c68('0x5'));var util=require(_0x7c68('0x6'));var path=require(_0x7c68('0x7'));var sox=require('sox');var csv=require(_0x7c68('0x8'));var ejs=require(_0x7c68('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c68('0xa'));var jsforce=require(_0x7c68('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7c68('0x8'));var querystring=require(_0x7c68('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7c68('0xd'));var qs=require(_0x7c68('0xe'));var hardwareService=require(_0x7c68('0xf'));var logger=require('../../config/logger')(_0x7c68('0x10'));var utils=require(_0x7c68('0x11'));var config=require(_0x7c68('0x12'));var db=require(_0x7c68('0x13'))['db'];function respondWithStatusCode(_0x3ade68,_0x5bcbde){_0x5bcbde=_0x5bcbde||0xcc;return function(_0x55841f){if(_0x55841f){return _0x3ade68[_0x7c68('0x14')](_0x5bcbde);}return _0x3ade68[_0x7c68('0x15')](_0x5bcbde)[_0x7c68('0x16')]();};}function respondWithResult(_0x1d2230,_0x5c35fb){_0x5c35fb=_0x5c35fb||0xc8;return function(_0x59449d){if(_0x59449d){return _0x1d2230[_0x7c68('0x15')](_0x5c35fb)[_0x7c68('0x17')](_0x59449d);}};}function respondWithFilteredResult(_0x361525,_0x1db6a5){return function(_0x2c72e2){if(_0x2c72e2){var _0x1a2c1f=_0x2c72e2[_0x7c68('0x18')],_0x39ec58=_0x1db6a5['offset'],_0x5b0df7=_0x1db6a5['offset']+_0x1db6a5[_0x7c68('0x19')],_0x3be61e;if(_0x5b0df7>=_0x1a2c1f){_0x5b0df7=_0x1a2c1f;_0x3be61e=0xc8;}else{_0x3be61e=0xce;}_0x361525[_0x7c68('0x15')](_0x3be61e);return _0x361525['set'](_0x7c68('0x1a'),_0x39ec58+'-'+_0x5b0df7+'/'+_0x1a2c1f)[_0x7c68('0x17')](_0x2c72e2);}return null;};}function patchUpdates(_0x426ec8){return function(_0x39624a){try{jsonpatch[_0x7c68('0x1b')](_0x39624a,_0x426ec8,!![]);}catch(_0x3989bf){return BPromise[_0x7c68('0x1c')](_0x3989bf);}return _0x39624a[_0x7c68('0x1d')]();};}function saveUpdates(_0x2263fa,_0x417f22){return function(_0x3c0d4a){if(_0x3c0d4a){return _0x3c0d4a[_0x7c68('0x1e')](_0x2263fa)['then'](function(_0x772486){return _0x772486;});}return null;};}function removeEntity(_0x618a3e,_0x48ddaf){return function(_0x56073a){if(_0x56073a){return _0x56073a['destroy']()[_0x7c68('0x1f')](function(){_0x618a3e[_0x7c68('0x15')](0xcc)[_0x7c68('0x16')]();});}};}function handleEntityNotFound(_0x3d71f8,_0x5520e0){return function(_0x3a55d8){if(!_0x3a55d8){_0x3d71f8[_0x7c68('0x14')](0x194);}return _0x3a55d8;};}function handleError(_0x314f14,_0x51d470){_0x51d470=_0x51d470||0x1f4;return function(_0x22ec11){logger[_0x7c68('0x20')](_0x22ec11['stack']);if(_0x22ec11[_0x7c68('0x21')]){delete _0x22ec11[_0x7c68('0x21')];}_0x314f14['status'](_0x51d470)['send'](_0x22ec11);};}exports[_0x7c68('0x22')]=function(_0x5edb86,_0x3905c3){var _0x3f1e44={},_0x3d6d7a={},_0x516a9d={'count':0x0,'rows':[]};var _0x488709=db['UserProfileSection'][_0x7c68('0x23')];_0x3d6d7a[_0x7c68('0x24')]=_[_0x7c68('0x25')](_0x488709);_0x3d6d7a[_0x7c68('0x26')]=_[_0x7c68('0x25')](_0x5edb86['query']);_0x3d6d7a[_0x7c68('0x27')]=_[_0x7c68('0x28')](_0x3d6d7a[_0x7c68('0x24')],_0x3d6d7a['query']);_0x3f1e44[_0x7c68('0x29')]=_[_0x7c68('0x28')](_0x3d6d7a[_0x7c68('0x24')],qs[_0x7c68('0x2a')](_0x5edb86[_0x7c68('0x26')][_0x7c68('0x2a')]));_0x3f1e44[_0x7c68('0x29')]=_0x3f1e44[_0x7c68('0x29')]['length']?_0x3f1e44[_0x7c68('0x29')]:_0x3d6d7a[_0x7c68('0x24')];if(!_0x5edb86[_0x7c68('0x26')][_0x7c68('0x2b')](_0x7c68('0x2c'))){_0x3f1e44['limit']=qs[_0x7c68('0x19')](_0x5edb86[_0x7c68('0x26')][_0x7c68('0x19')]);_0x3f1e44[_0x7c68('0x2d')]=qs['offset'](_0x5edb86['query'][_0x7c68('0x2d')]);}_0x3f1e44['order']=qs[_0x7c68('0x2e')](_0x5edb86[_0x7c68('0x26')][_0x7c68('0x2e')]);_0x3f1e44[_0x7c68('0x2f')]=qs[_0x7c68('0x27')](_[_0x7c68('0x30')](_0x5edb86[_0x7c68('0x26')],_0x3d6d7a[_0x7c68('0x27')]));if(_0x5edb86[_0x7c68('0x26')][_0x7c68('0x31')]){_0x3f1e44[_0x7c68('0x2f')]=_[_0x7c68('0x32')](_0x3f1e44[_0x7c68('0x2f')],{'$or':_[_0x7c68('0x33')](_0x488709,function(_0x3eb5d1){if(_0x3eb5d1[_0x7c68('0x34')][_0x7c68('0x35')]!=='VIRTUAL'){var _0x5a6b31={};_0x5a6b31[_0x3eb5d1[_0x7c68('0x36')]]={'$like':'%'+_0x5edb86[_0x7c68('0x26')][_0x7c68('0x31')]+'%'};return _0x5a6b31;}})});}_0x3f1e44=_[_0x7c68('0x32')]({},_0x3f1e44,_0x5edb86['options']);var _0x46675d={'where':_0x3f1e44[_0x7c68('0x2f')]};return db[_0x7c68('0x37')][_0x7c68('0x18')](_0x46675d)['then'](function(_0x8af054){_0x516a9d[_0x7c68('0x18')]=_0x8af054;if(_0x5edb86[_0x7c68('0x26')][_0x7c68('0x38')]){_0x3f1e44[_0x7c68('0x39')]=[{'all':!![]}];}return db['UserProfileSection'][_0x7c68('0x3a')](_0x3f1e44);})[_0x7c68('0x1f')](function(_0x50c86c){_0x516a9d[_0x7c68('0x3b')]=_0x50c86c;return _0x516a9d;})[_0x7c68('0x1f')](respondWithFilteredResult(_0x3905c3,_0x3f1e44))[_0x7c68('0x3c')](handleError(_0x3905c3,null));};exports['show']=function(_0xae04d6,_0x4df4c9){var _0xb867d={'raw':![],'where':{'id':_0xae04d6[_0x7c68('0x3d')]['id']}},_0x50efb8={};_0x50efb8['model']=_[_0x7c68('0x25')](db['UserProfileSection'][_0x7c68('0x23')]);_0x50efb8[_0x7c68('0x26')]=_[_0x7c68('0x25')](_0xae04d6[_0x7c68('0x26')]);_0x50efb8[_0x7c68('0x27')]=_[_0x7c68('0x28')](_0x50efb8[_0x7c68('0x24')],_0x50efb8[_0x7c68('0x26')]);_0xb867d['attributes']=_[_0x7c68('0x28')](_0x50efb8[_0x7c68('0x24')],qs[_0x7c68('0x2a')](_0xae04d6[_0x7c68('0x26')][_0x7c68('0x2a')]));_0xb867d[_0x7c68('0x29')]=_0xb867d[_0x7c68('0x29')]['length']?_0xb867d[_0x7c68('0x29')]:_0x50efb8[_0x7c68('0x24')];if(_0xae04d6[_0x7c68('0x26')][_0x7c68('0x38')]){_0xb867d[_0x7c68('0x39')]=[{'all':!![]}];}_0xb867d=_[_0x7c68('0x32')]({},_0xb867d,_0xae04d6[_0x7c68('0x3e')]);return db['UserProfileSection'][_0x7c68('0x3f')](_0xb867d)[_0x7c68('0x1f')](handleEntityNotFound(_0x4df4c9,null))[_0x7c68('0x1f')](respondWithResult(_0x4df4c9,null))['catch'](handleError(_0x4df4c9,null));};exports[_0x7c68('0x40')]=function(_0xa27719,_0x3b8d46){return db[_0x7c68('0x37')][_0x7c68('0x40')](_0xa27719[_0x7c68('0x41')],{})[_0x7c68('0x1f')](respondWithResult(_0x3b8d46,0xc9))[_0x7c68('0x3c')](handleError(_0x3b8d46,null));};exports['update']=function(_0x43c360,_0x1afbd3){if(_0x43c360[_0x7c68('0x41')]['id']){delete _0x43c360[_0x7c68('0x41')]['id'];}return db[_0x7c68('0x37')]['find']({'where':{'id':_0x43c360[_0x7c68('0x3d')]['id']}})[_0x7c68('0x1f')](handleEntityNotFound(_0x1afbd3,null))[_0x7c68('0x1f')](saveUpdates(_0x43c360[_0x7c68('0x41')],null))[_0x7c68('0x1f')](respondWithResult(_0x1afbd3,null))[_0x7c68('0x3c')](handleError(_0x1afbd3,null));};exports[_0x7c68('0x42')]=function(_0x268a75,_0x4b0fb5){return db[_0x7c68('0x37')][_0x7c68('0x3f')]({'where':{'id':_0x268a75[_0x7c68('0x3d')]['id']}})[_0x7c68('0x1f')](handleEntityNotFound(_0x4b0fb5,null))['then'](removeEntity(_0x4b0fb5,null))[_0x7c68('0x3c')](handleError(_0x4b0fb5,null));};exports[_0x7c68('0x43')]=function(_0x31a704,_0x531603){return db['UserProfileSection'][_0x7c68('0x43')]()[_0x7c68('0x1f')](respondWithResult(_0x531603,null))[_0x7c68('0x3c')](handleError(_0x531603,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0159df8..2f6071c 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 _0xb6f5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x4eb4c0,_0x2fc46b){var _0x13f830=function(_0x2e0aac){while(--_0x2e0aac){_0x4eb4c0['push'](_0x4eb4c0['shift']());}};_0x13f830(++_0x2fc46b);}(_0xb6f5,0x138));var _0x5b6f=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xb6f5[_0x1911ed];return _0x11edaa;};'use strict';var _=require(_0x5b6f('0x0'));var util=require(_0x5b6f('0x1'));var logger=require(_0x5b6f('0x2'))(_0x5b6f('0x3'));var moment=require(_0x5b6f('0x4'));var BPromise=require(_0x5b6f('0x5'));var rp=require(_0x5b6f('0x6'));var fs=require('fs');var path=require(_0x5b6f('0x7'));var rimraf=require(_0x5b6f('0x8'));var config=require(_0x5b6f('0x9'));var attributes=require('./userProfileSection.attributes');module[_0x5b6f('0xa')]=function(_0x1c405e,_0x5977f3){return _0x1c405e[_0x5b6f('0xb')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x5b6f('0xc'),'fields':[_0x5b6f('0xd'),_0x5b6f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f04=['sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','user_profile_has_sections','compositeIndex'];(function(_0x54fdf9,_0x2dd664){var _0x5efa0d=function(_0x36ca33){while(--_0x36ca33){_0x54fdf9['push'](_0x54fdf9['shift']());}};_0x5efa0d(++_0x2dd664);}(_0x3f04,0xd4));var _0x43f0=function(_0x460013,_0x2ebc73){_0x460013=_0x460013-0x0;var _0x55924f=_0x3f04[_0x460013];return _0x55924f;};'use strict';var _=require(_0x43f0('0x0'));var util=require(_0x43f0('0x1'));var logger=require(_0x43f0('0x2'))('api');var moment=require(_0x43f0('0x3'));var BPromise=require(_0x43f0('0x4'));var rp=require(_0x43f0('0x5'));var fs=require('fs');var path=require(_0x43f0('0x6'));var rimraf=require('rimraf');var config=require(_0x43f0('0x7'));var attributes=require(_0x43f0('0x8'));module[_0x43f0('0x9')]=function(_0x253b37,_0x2420dc){return _0x253b37['define']('UserProfileSection',attributes,{'tableName':_0x43f0('0xa'),'paranoid':![],'indexes':[{'name':_0x43f0('0xb'),'fields':[_0x43f0('0xc'),_0x43f0('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 6694266..8591b1d 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 _0x16ea=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x16ea,0x1f2));var _0xa16e=function(_0x25436b,_0x33bad8){_0x25436b=_0x25436b-0x0;var _0x1ade40=_0x16ea[_0x25436b];return _0x1ade40;};'use strict';var _=require(_0xa16e('0x0'));var util=require(_0xa16e('0x1'));var moment=require(_0xa16e('0x2'));var BPromise=require(_0xa16e('0x3'));var rs=require(_0xa16e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa16e('0x5'));var logger=require(_0xa16e('0x6'))('rpc');var config=require(_0xa16e('0x7'));var jayson=require(_0xa16e('0x8'));var client=jayson['client'][_0xa16e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33be0d,_0x28df6b,_0x2e1f29){return new BPromise(function(_0x482a9e,_0x591ad7){return client[_0xa16e('0xa')](_0x33be0d,_0x2e1f29)[_0xa16e('0xb')](function(_0xd4b8ab){logger[_0xa16e('0xc')](_0xa16e('0xd'),_0x28df6b,_0xa16e('0xe'));logger['debug'](_0xa16e('0xf'),_0x28df6b,_0xa16e('0xe'),JSON[_0xa16e('0x10')](_0xd4b8ab));if(_0xd4b8ab['error']){if(_0xd4b8ab['error']['code']===0x1f4){logger['error'](_0xa16e('0xd'),_0x28df6b,_0xd4b8ab['error'][_0xa16e('0x11')]);return _0x591ad7(_0xd4b8ab[_0xa16e('0x12')][_0xa16e('0x11')]);}logger[_0xa16e('0x12')](_0xa16e('0xd'),_0x28df6b,_0xd4b8ab[_0xa16e('0x12')][_0xa16e('0x11')]);return _0x482a9e(_0xd4b8ab[_0xa16e('0x12')][_0xa16e('0x11')]);}else{logger[_0xa16e('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x28df6b,_0xa16e('0xe'));_0x482a9e(_0xd4b8ab[_0xa16e('0x13')][_0xa16e('0x11')]);}})[_0xa16e('0x14')](function(_0x5db28e){logger[_0xa16e('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x28df6b,_0x5db28e);_0x591ad7(_0x5db28e);});});} \ No newline at end of file +var _0x8cf5=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x8cf5,0x1e2));var _0x58cf=function(_0x548cde,_0x385d69){_0x548cde=_0x548cde-0x0;var _0x539f96=_0x8cf5[_0x548cde];return _0x539f96;};'use strict';var _=require(_0x58cf('0x0'));var util=require('util');var moment=require(_0x58cf('0x1'));var BPromise=require(_0x58cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58cf('0x3'));var logger=require(_0x58cf('0x4'))(_0x58cf('0x5'));var config=require(_0x58cf('0x6'));var jayson=require(_0x58cf('0x7'));var client=jayson[_0x58cf('0x8')][_0x58cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaa17b6,_0x2757fc,_0x3355cd){return new BPromise(function(_0x214797,_0x2a1153){return client['request'](_0xaa17b6,_0x3355cd)[_0x58cf('0xa')](function(_0x5cf147){logger[_0x58cf('0xb')](_0x58cf('0xc'),_0x2757fc,'request\x20sent');logger[_0x58cf('0xd')](_0x58cf('0xe'),_0x2757fc,_0x58cf('0xf'),JSON['stringify'](_0x5cf147));if(_0x5cf147['error']){if(_0x5cf147[_0x58cf('0x10')][_0x58cf('0x11')]===0x1f4){logger[_0x58cf('0x10')](_0x58cf('0xc'),_0x2757fc,_0x5cf147[_0x58cf('0x10')][_0x58cf('0x12')]);return _0x2a1153(_0x5cf147[_0x58cf('0x10')][_0x58cf('0x12')]);}logger[_0x58cf('0x10')](_0x58cf('0xc'),_0x2757fc,_0x5cf147['error'][_0x58cf('0x12')]);return _0x214797(_0x5cf147['error']['message']);}else{logger[_0x58cf('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x2757fc,_0x58cf('0xf'));_0x214797(_0x5cf147[_0x58cf('0x13')][_0x58cf('0x12')]);}})[_0x58cf('0x14')](function(_0x47dc16){logger[_0x58cf('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2757fc,_0x47dc16);_0x2a1153(_0x47dc16);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index da2109a..2eb80ea 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 _0xe6e9=['../../components/interaction/service','../../config/environment','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6e9,0x182));var _0x9e6e=function(_0x2e52c2,_0x293685){_0x2e52c2=_0x2e52c2-0x0;var _0x4e434f=_0xe6e9[_0x2e52c2];return _0x4e434f;};'use strict';var multer=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var path=require(_0x9e6e('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e6e('0x3'));var router=express[_0x9e6e('0x4')]();var auth=require(_0x9e6e('0x5'));var interaction=require(_0x9e6e('0x6'));var config=require(_0x9e6e('0x7'));module['exports']=router; \ No newline at end of file +var _0xfd87=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var auth=require(_0x7fd8('0x6'));var interaction=require(_0x7fd8('0x7'));var config=require(_0x7fd8('0x8'));module[_0x7fd8('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2064b1a..8ccc05b 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 _0x7d99=['exports','INTEGER','sequelize'];(function(_0x575e12,_0x246da3){var _0x6282ef=function(_0x1e6cd9){while(--_0x1e6cd9){_0x575e12['push'](_0x575e12['shift']());}};_0x6282ef(++_0x246da3);}(_0x7d99,0x17c));var _0x97d9=function(_0x27a03b,_0x11e2eb){_0x27a03b=_0x27a03b-0x0;var _0x1cdb5f=_0x7d99[_0x27a03b];return _0x1cdb5f;};'use strict';var Sequelize=require(_0x97d9('0x0'));module[_0x97d9('0x1')]={'penalty':{'type':Sequelize[_0x97d9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2fd0=['sequelize'];(function(_0x35aca4,_0x5be151){var _0x30c253=function(_0x12bcd7){while(--_0x12bcd7){_0x35aca4['push'](_0x35aca4['shift']());}};_0x30c253(++_0x5be151);}(_0x2fd0,0x12a));var _0x02fd=function(_0x457d50,_0x3b9d36){_0x457d50=_0x457d50-0x0;var _0x26e448=_0x2fd0[_0x457d50];return _0x26e448;};'use strict';var Sequelize=require(_0x02fd('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 700214a..f7bfdfb 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 _0x49df=['bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','../../config/logger','api','moment'];(function(_0x10bbb8,_0x19e2eb){var _0x2026a0=function(_0x36420e){while(--_0x36420e){_0x10bbb8['push'](_0x10bbb8['shift']());}};_0x2026a0(++_0x19e2eb);}(_0x49df,0xad));var _0xf49d=function(_0x2039c3,_0x2e21dc){_0x2039c3=_0x2039c3-0x0;var _0x971850=_0x49df[_0x2039c3];return _0x971850;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf49d('0x0'))(_0xf49d('0x1'));var moment=require(_0xf49d('0x2'));var BPromise=require(_0xf49d('0x3'));var rp=require(_0xf49d('0x4'));var fs=require('fs');var path=require(_0xf49d('0x5'));var rimraf=require(_0xf49d('0x6'));var config=require('../../config/environment');var attributes=require(_0xf49d('0x7'));module[_0xf49d('0x8')]=function(_0x325c19,_0xca1090){return _0x325c19[_0xf49d('0x9')](_0xf49d('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f59=['UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x337c33,_0x508d9a){var _0x23f2da=function(_0x4f4030){while(--_0x4f4030){_0x337c33['push'](_0x337c33['shift']());}};_0x23f2da(++_0x508d9a);}(_0x7f59,0x12e));var _0x97f5=function(_0x3317a1,_0x4d3b0d){_0x3317a1=_0x3317a1-0x0;var _0x5b8425=_0x7f59[_0x3317a1];return _0x5b8425;};'use strict';var _=require(_0x97f5('0x0'));var util=require(_0x97f5('0x1'));var logger=require('../../config/logger')(_0x97f5('0x2'));var moment=require(_0x97f5('0x3'));var BPromise=require(_0x97f5('0x4'));var rp=require(_0x97f5('0x5'));var fs=require('fs');var path=require(_0x97f5('0x6'));var rimraf=require(_0x97f5('0x7'));var config=require(_0x97f5('0x8'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x498110,_0x5d7027){return _0x498110[_0x97f5('0x9')](_0x97f5('0xa'),attributes,{'tableName':_0x97f5('0xb'),'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 0deb15a..454cc09 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 _0xf8c4=['ioredis','../../config/utils','rpc','client','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring'];(function(_0x37a928,_0x2a21fe){var _0x4a6007=function(_0x420ead){while(--_0x420ead){_0x37a928['push'](_0x37a928['shift']());}};_0x4a6007(++_0x2a21fe);}(_0xf8c4,0xe6));var _0x4f8c=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0xf8c4[_0x2a558d];return _0xa7bc9c;};'use strict';var _=require('lodash');var util=require(_0x4f8c('0x0'));var moment=require(_0x4f8c('0x1'));var BPromise=require(_0x4f8c('0x2'));var rs=require(_0x4f8c('0x3'));var fs=require('fs');var Redis=require(_0x4f8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f8c('0x5'));var logger=require('../../config/logger')(_0x4f8c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f8c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38733a,_0x55b8b4,_0x24a263){return new BPromise(function(_0x20d749,_0x5d2293){return client['request'](_0x38733a,_0x24a263)[_0x4f8c('0x8')](function(_0x424dbb){logger[_0x4f8c('0x9')](_0x4f8c('0xa'),_0x55b8b4,_0x4f8c('0xb'));logger[_0x4f8c('0xc')](_0x4f8c('0xd'),_0x55b8b4,_0x4f8c('0xb'),JSON[_0x4f8c('0xe')](_0x424dbb));if(_0x424dbb[_0x4f8c('0xf')]){if(_0x424dbb[_0x4f8c('0xf')]['code']===0x1f4){logger[_0x4f8c('0xf')](_0x4f8c('0xa'),_0x55b8b4,_0x424dbb[_0x4f8c('0xf')][_0x4f8c('0x10')]);return _0x5d2293(_0x424dbb[_0x4f8c('0xf')][_0x4f8c('0x10')]);}logger[_0x4f8c('0xf')](_0x4f8c('0xa'),_0x55b8b4,_0x424dbb[_0x4f8c('0xf')]['message']);return _0x20d749(_0x424dbb[_0x4f8c('0xf')]['message']);}else{logger[_0x4f8c('0x9')](_0x4f8c('0xa'),_0x55b8b4,'request\x20sent');_0x20d749(_0x424dbb['result'][_0x4f8c('0x10')]);}})[_0x4f8c('0x11')](function(_0x3faa96){logger[_0x4f8c('0xf')](_0x4f8c('0xa'),_0x55b8b4,_0x3faa96);_0x5d2293(_0x3faa96);});});} \ No newline at end of file +var _0x7c97=['../../config/environment','jayson/promise','client','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x7c97,0x19d));var _0x77c9=function(_0x45e9a6,_0x4e6df6){_0x45e9a6=_0x45e9a6-0x0;var _0x4bed6d=_0x7c97[_0x45e9a6];return _0x4bed6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x77c9('0x0'));var BPromise=require(_0x77c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77c9('0x2'));var db=require(_0x77c9('0x3'))['db'];var utils=require(_0x77c9('0x4'));var logger=require(_0x77c9('0x5'))(_0x77c9('0x6'));var config=require(_0x77c9('0x7'));var jayson=require(_0x77c9('0x8'));var client=jayson[_0x77c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e710a,_0x17c592,_0x5a288d){return new BPromise(function(_0x11e233,_0x545be1){return client['request'](_0x4e710a,_0x5a288d)[_0x77c9('0xa')](function(_0x188291){logger['info'](_0x77c9('0xb'),_0x17c592,_0x77c9('0xc'));logger['debug'](_0x77c9('0xd'),_0x17c592,'request\x20sent',JSON[_0x77c9('0xe')](_0x188291));if(_0x188291[_0x77c9('0xf')]){if(_0x188291[_0x77c9('0xf')][_0x77c9('0x10')]===0x1f4){logger[_0x77c9('0xf')](_0x77c9('0xb'),_0x17c592,_0x188291['error']['message']);return _0x545be1(_0x188291[_0x77c9('0xf')][_0x77c9('0x11')]);}logger[_0x77c9('0xf')](_0x77c9('0xb'),_0x17c592,_0x188291[_0x77c9('0xf')]['message']);return _0x11e233(_0x188291[_0x77c9('0xf')][_0x77c9('0x11')]);}else{logger[_0x77c9('0x12')](_0x77c9('0xb'),_0x17c592,'request\x20sent');_0x11e233(_0x188291[_0x77c9('0x13')][_0x77c9('0x11')]);}})['catch'](function(_0x1354cd){logger['error'](_0x77c9('0xb'),_0x17c592,_0x1354cd);_0x545be1(_0x1354cd);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index cd472bd..001d009 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 _0x7a54=['path','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x19e6cb,_0x25c8f2){_0x19e6cb=_0x19e6cb-0x0;var _0x46914c=_0x7a54[_0x19e6cb];return _0x46914c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));module[_0x47a5('0x7')]=router; \ No newline at end of file +var _0xf95f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf95f,0x142));var _0xff95=function(_0x150bff,_0x1fb61a){_0x150bff=_0x150bff-0x0;var _0x296f9a=_0xf95f[_0x150bff];return _0x296f9a;};'use strict';var multer=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var path=require(_0xff95('0x2'));var timeout=require(_0xff95('0x3'));var express=require(_0xff95('0x4'));var router=express[_0xff95('0x5')]();var auth=require(_0xff95('0x6'));var interaction=require(_0xff95('0x7'));var config=require(_0xff95('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 74fd0bc..63c7a1b 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 _0x1047=['INTEGER','exports'];(function(_0x4540d7,_0x2afe51){var _0x221cd3=function(_0x936133){while(--_0x936133){_0x4540d7['push'](_0x4540d7['shift']());}};_0x221cd3(++_0x2afe51);}(_0x1047,0xdd));var _0x7104=function(_0x57c1b3,_0x40517c){_0x57c1b3=_0x57c1b3-0x0;var _0x475838=_0x1047[_0x57c1b3];return _0x475838;};'use strict';var Sequelize=require('sequelize');module[_0x7104('0x0')]={'penalty':{'type':Sequelize[_0x7104('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd26e=['exports','sequelize'];(function(_0x3f957a,_0x1c5832){var _0x214855=function(_0x391a99){while(--_0x391a99){_0x3f957a['push'](_0x3f957a['shift']());}};_0x214855(++_0x1c5832);}(_0xd26e,0x71));var _0xed26=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0xd26e[_0x380af2];return _0x1789dc;};'use strict';var Sequelize=require(_0xed26('0x0'));module[_0xed26('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 e9ed511..b9ab6c8 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 _0x0661=['./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x0661,0x170));var _0x1066=function(_0x406a99,_0x52f88e){_0x406a99=_0x406a99-0x0;var _0x4ba7ad=_0x0661[_0x406a99];return _0x4ba7ad;};'use strict';var _=require(_0x1066('0x0'));var util=require(_0x1066('0x1'));var logger=require(_0x1066('0x2'))(_0x1066('0x3'));var moment=require('moment');var BPromise=require(_0x1066('0x4'));var rp=require(_0x1066('0x5'));var fs=require('fs');var path=require(_0x1066('0x6'));var rimraf=require(_0x1066('0x7'));var config=require(_0x1066('0x8'));var attributes=require(_0x1066('0x9'));module['exports']=function(_0x107ef2,_0x125b88){return _0x107ef2[_0x1066('0xa')](_0x1066('0xb'),attributes,{'tableName':_0x1066('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0479=['./userVoiceQueue.attributes','define','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x489d76,_0x353674){var _0x2f8fb2=function(_0x55b769){while(--_0x55b769){_0x489d76['push'](_0x489d76['shift']());}};_0x2f8fb2(++_0x353674);}(_0x0479,0x1e2));var _0x9047=function(_0x5e33f0,_0x2530a2){_0x5e33f0=_0x5e33f0-0x0;var _0x2f5bc6=_0x0479[_0x5e33f0];return _0x2f5bc6;};'use strict';var _=require('lodash');var util=require(_0x9047('0x0'));var logger=require(_0x9047('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9047('0x2'));var rp=require(_0x9047('0x3'));var fs=require('fs');var path=require(_0x9047('0x4'));var rimraf=require('rimraf');var config=require(_0x9047('0x5'));var attributes=require(_0x9047('0x6'));module['exports']=function(_0x5d1512,_0x3033d1){return _0x5d1512[_0x9047('0x7')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','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 7802671..82993da 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 _0xe920=['../../config/logger','rpc','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','UserVoiceQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa7b7f5,_0x518b91){var _0x39f5ad=function(_0x44c3f1){while(--_0x44c3f1){_0xa7b7f5['push'](_0xa7b7f5['shift']());}};_0x39f5ad(++_0x518b91);}(_0xe920,0xbe));var _0x0e92=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xe920[_0xb3b452];return _0x238983;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var moment=require(_0x0e92('0x2'));var BPromise=require(_0x0e92('0x3'));var rs=require(_0x0e92('0x4'));var fs=require('fs');var Redis=require(_0x0e92('0x5'));var db=require(_0x0e92('0x6'))['db'];var utils=require(_0x0e92('0x7'));var logger=require(_0x0e92('0x8'))(_0x0e92('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e92('0xa'));var client=jayson['client'][_0x0e92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33a315,_0x2d921f,_0x176c3b){return new BPromise(function(_0x5662dc,_0x3dbc96){return client[_0x0e92('0xc')](_0x33a315,_0x176c3b)[_0x0e92('0xd')](function(_0x129376){logger[_0x0e92('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x2d921f,'request\x20sent');logger['debug'](_0x0e92('0xf'),_0x2d921f,_0x0e92('0x10'),JSON['stringify'](_0x129376));if(_0x129376['error']){if(_0x129376['error'][_0x0e92('0x11')]===0x1f4){logger[_0x0e92('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x3dbc96(_0x129376['error'][_0x0e92('0x13')]);}logger[_0x0e92('0x12')](_0x0e92('0x14'),_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x5662dc(_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x2d921f,_0x0e92('0x10'));_0x5662dc(_0x129376[_0x0e92('0x15')]['message']);}})['catch'](function(_0x424c3a){logger['error'](_0x0e92('0x14'),_0x2d921f,_0x424c3a);_0x3dbc96(_0x424c3a);});});} \ No newline at end of file +var _0xb34d=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','lodash'];(function(_0x41b61a,_0x7b8aa0){var _0x5e1694=function(_0x116ad7){while(--_0x116ad7){_0x41b61a['push'](_0x41b61a['shift']());}};_0x5e1694(++_0x7b8aa0);}(_0xb34d,0x14f));var _0xdb34=function(_0x3477d6,_0x450bf2){_0x3477d6=_0x3477d6-0x0;var _0x19fd5a=_0xb34d[_0x3477d6];return _0x19fd5a;};'use strict';var _=require(_0xdb34('0x0'));var util=require('util');var moment=require(_0xdb34('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb34('0x2'));var fs=require('fs');var Redis=require(_0xdb34('0x3'));var db=require(_0xdb34('0x4'))['db'];var utils=require(_0xdb34('0x5'));var logger=require(_0xdb34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdb34('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1de9e7,_0x2ba733,_0x4715b0){return new BPromise(function(_0x24a9a6,_0x35929d){return client[_0xdb34('0x8')](_0x1de9e7,_0x4715b0)[_0xdb34('0x9')](function(_0xe0a04d){logger[_0xdb34('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ba733,_0xdb34('0xb'));logger[_0xdb34('0xc')](_0xdb34('0xd'),_0x2ba733,_0xdb34('0xb'),JSON[_0xdb34('0xe')](_0xe0a04d));if(_0xe0a04d[_0xdb34('0xf')]){if(_0xe0a04d[_0xdb34('0xf')][_0xdb34('0x10')]===0x1f4){logger[_0xdb34('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ba733,_0xe0a04d[_0xdb34('0xf')][_0xdb34('0x11')]);return _0x35929d(_0xe0a04d['error'][_0xdb34('0x11')]);}logger[_0xdb34('0xf')](_0xdb34('0x12'),_0x2ba733,_0xe0a04d[_0xdb34('0xf')][_0xdb34('0x11')]);return _0x24a9a6(_0xe0a04d[_0xdb34('0xf')][_0xdb34('0x11')]);}else{logger['info'](_0xdb34('0x12'),_0x2ba733,_0xdb34('0xb'));_0x24a9a6(_0xe0a04d[_0xdb34('0x13')][_0xdb34('0x11')]);}})[_0xdb34('0x14')](function(_0x200f1f){logger[_0xdb34('0xf')](_0xdb34('0x12'),_0x2ba733,_0x200f1f);_0x35929d(_0x200f1f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a869ae2..8ba94e8 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 _0xe2fe=['exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var auth=require(_0xee2f('0x3'));var interaction=require(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));module[_0xee2f('0x6')]=router; \ No newline at end of file +var _0xa24d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x13486c,_0x139348){var _0x135738=function(_0x3e494a){while(--_0x3e494a){_0x13486c['push'](_0x13486c['shift']());}};_0x135738(++_0x139348);}(_0xa24d,0x1c1));var _0xda24=function(_0x4c53c3,_0x360764){_0x4c53c3=_0x4c53c3-0x0;var _0x32bf24=_0xa24d[_0x4c53c3];return _0x32bf24;};'use strict';var multer=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var path=require(_0xda24('0x2'));var timeout=require(_0xda24('0x3'));var express=require(_0xda24('0x4'));var router=express[_0xda24('0x5')]();var auth=require(_0xda24('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda24('0x7'));module[_0xda24('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c3112c3..373a6c0 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 _0x1b8f=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x195d8e,_0x107b2f){var _0x1e9b51=function(_0x41b224){while(--_0x41b224){_0x195d8e['push'](_0x195d8e['shift']());}};_0x1e9b51(++_0x107b2f);}(_0x1b8f,0xa7));var _0xf1b8=function(_0x580144,_0x500db5){_0x580144=_0x580144-0x0;var _0x1c13cc=_0x1b8f[_0x580144];return _0x1c13cc;};'use strict';var Sequelize=require(_0xf1b8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf1b8('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf1b8('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xf1b8('0x2')},'UserId':{'type':Sequelize[_0xf1b8('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf1b8('0x3')],'allowNull':![],'unique':_0xf1b8('0x4'),'comment':_0xf1b8('0x2')},'VoiceQueueId':{'type':Sequelize[_0xf1b8('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xf1b8('0x3')],'allowNull':![],'unique':_0xf1b8('0x4'),'comment':_0xf1b8('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xf1b8('0x2')},'paused':{'type':Sequelize[_0xf1b8('0x1')](0xb),'defaultValue':0x0,'comment':_0xf1b8('0x2')}}; \ No newline at end of file +var _0xc076=['STRING','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x3ac917,_0x21a906){var _0x45bdc4=function(_0x537964){while(--_0x537964){_0x3ac917['push'](_0x3ac917['shift']());}};_0x45bdc4(++_0x21a906);}(_0xc076,0xf7));var _0x6c07=function(_0x23bd88,_0x769dc8){_0x23bd88=_0x23bd88-0x0;var _0x3118b3=_0xc076[_0x23bd88];return _0x3118b3;};'use strict';var Sequelize=require(_0x6c07('0x0'));module[_0x6c07('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6c07('0x2')},'membername':{'type':Sequelize[_0x6c07('0x3')],'allowNull':![],'comment':_0x6c07('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6c07('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x6c07('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x6c07('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x6c07('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x6c07('0x4')](0xb),'defaultValue':0x0,'comment':_0x6c07('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d96f57a..2a6715f 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 _0xa753=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4bfea7,_0x44284b){var _0x345f6e=function(_0x3b765d){while(--_0x3b765d){_0x4bfea7['push'](_0x4bfea7['shift']());}};_0x345f6e(++_0x44284b);}(_0xa753,0x1b7));var _0x3a75=function(_0x1ab2ae,_0x2e8e03){_0x1ab2ae=_0x1ab2ae-0x0;var _0x2c4da0=_0xa753[_0x1ab2ae];return _0x2c4da0;};'use strict';var EventEmitter=require(_0x3a75('0x0'));var UserVoiceQueueRt=require(_0x3a75('0x1'))['db'][_0x3a75('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3a75('0x3')](0x0);var events={'afterCreate':_0x3a75('0x4'),'afterUpdate':_0x3a75('0x5'),'afterDestroy':_0x3a75('0x6')};function emitEvent(_0x45a1aa){return function(_0xacfd8e,_0x53e260,_0x33dc14){UserVoiceQueueRtEvents[_0x3a75('0x7')](_0x45a1aa+':'+_0xacfd8e['id'],_0xacfd8e);UserVoiceQueueRtEvents['emit'](_0x45a1aa,_0xacfd8e);_0x33dc14(null);};}for(var e in events){if(events[_0x3a75('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x3a75('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x284f=['UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2b6c76,_0x5e93ac){var _0x201e62=function(_0x1ed896){while(--_0x1ed896){_0x2b6c76['push'](_0x2b6c76['shift']());}};_0x201e62(++_0x5e93ac);}(_0x284f,0x1dc));var _0xf284=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x284f[_0x58e469];return _0x4c01c5;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xf284('0x0'))['db'][_0xf284('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf284('0x2'),'afterUpdate':_0xf284('0x3'),'afterDestroy':_0xf284('0x4')};function emitEvent(_0x17318d){return function(_0x4e14bb,_0x333833,_0x595460){UserVoiceQueueRtEvents[_0xf284('0x5')](_0x17318d+':'+_0x4e14bb['id'],_0x4e14bb);UserVoiceQueueRtEvents['emit'](_0x17318d,_0x4e14bb);_0x595460(null);};}for(var e in events){if(events[_0xf284('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xf284('0x7')](e,emitEvent(event));}}module[_0xf284('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 e54cdb4..7fb2a10 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 _0x1b4c=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','user_has_voice_queues_rt'];(function(_0x5f4810,_0x9f3daa){var _0x3b76d1=function(_0x3f9052){while(--_0x3f9052){_0x5f4810['push'](_0x5f4810['shift']());}};_0x3b76d1(++_0x9f3daa);}(_0x1b4c,0x8f));var _0xc1b4=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x1b4c[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0xc1b4('0x0'));var util=require('util');var logger=require(_0xc1b4('0x1'))(_0xc1b4('0x2'));var moment=require(_0xc1b4('0x3'));var BPromise=require(_0xc1b4('0x4'));var rp=require(_0xc1b4('0x5'));var fs=require('fs');var path=require(_0xc1b4('0x6'));var rimraf=require(_0xc1b4('0x7'));var config=require(_0xc1b4('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x18d7d6,_0x505acd){return _0x18d7d6[_0xc1b4('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0xc1b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9628=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x291160,_0x10d8dd){var _0x3074f8=function(_0x794bec){while(--_0x794bec){_0x291160['push'](_0x291160['shift']());}};_0x3074f8(++_0x10d8dd);}(_0x9628,0x1d8));var _0x8962=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x9628[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x8962('0x0'));var util=require(_0x8962('0x1'));var logger=require(_0x8962('0x2'))('api');var moment=require(_0x8962('0x3'));var BPromise=require(_0x8962('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8962('0x5'));var config=require(_0x8962('0x6'));var attributes=require(_0x8962('0x7'));module[_0x8962('0x8')]=function(_0x1c5f60,_0x24f837){return _0x1c5f60[_0x8962('0x9')](_0x8962('0xa'),attributes,{'tableName':_0x8962('0xb'),'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 346005b..d9f537e 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 _0xc380=['redis','localhost','socket.io-emitter','register','request','then','info','debug','request\x20sent','stringify','code','UserVoiceQueueRt,\x20%s,\x20%s','message','error','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5d7242,_0x3e9a9a){var _0x53a4b2=function(_0x4bef27){while(--_0x4bef27){_0x5d7242['push'](_0x5d7242['shift']());}};_0x53a4b2(++_0x3e9a9a);}(_0xc380,0xf2));var _0x0c38=function(_0xcf8aed,_0x392c52){_0xcf8aed=_0xcf8aed-0x0;var _0x111abe=_0xc380[_0xcf8aed];return _0x111abe;};'use strict';var _=require(_0x0c38('0x0'));var util=require('util');var moment=require(_0x0c38('0x1'));var BPromise=require(_0x0c38('0x2'));var rs=require(_0x0c38('0x3'));var fs=require('fs');var Redis=require(_0x0c38('0x4'));var db=require(_0x0c38('0x5'))['db'];var utils=require(_0x0c38('0x6'));var logger=require(_0x0c38('0x7'))('rpc');var config=require(_0x0c38('0x8'));var jayson=require(_0x0c38('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x0c38('0xa')]=_['defaults'](config['redis'],{'host':_0x0c38('0xb'),'port':0x18eb});var socket=require(_0x0c38('0xc'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x0c38('0xd')](socket);function respondWithRpcPromise(_0x1d8319,_0x196217,_0x233df0){return new BPromise(function(_0x15895d,_0x3959bd){return client[_0x0c38('0xe')](_0x1d8319,_0x233df0)[_0x0c38('0xf')](function(_0x233159){logger[_0x0c38('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x196217,'request\x20sent');logger[_0x0c38('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x196217,_0x0c38('0x12'),JSON[_0x0c38('0x13')](_0x233159));if(_0x233159['error']){if(_0x233159['error'][_0x0c38('0x14')]===0x1f4){logger['error'](_0x0c38('0x15'),_0x196217,_0x233159['error'][_0x0c38('0x16')]);return _0x3959bd(_0x233159[_0x0c38('0x17')][_0x0c38('0x16')]);}logger[_0x0c38('0x17')](_0x0c38('0x15'),_0x196217,_0x233159['error']['message']);return _0x15895d(_0x233159[_0x0c38('0x17')][_0x0c38('0x16')]);}else{logger[_0x0c38('0x10')](_0x0c38('0x15'),_0x196217,_0x0c38('0x12'));_0x15895d(_0x233159[_0x0c38('0x18')]['message']);}})[_0x0c38('0x19')](function(_0x40065c){logger[_0x0c38('0x17')](_0x0c38('0x15'),_0x196217,_0x40065c);_0x3959bd(_0x40065c);});});}exports[_0x0c38('0x1a')]=function(_0x2ed16e){var _0x24cfb0=this;return new Promise(function(_0x52caab,_0x499982){return db[_0x0c38('0x1b')]['findAll']({'raw':_0x2ed16e[_0x0c38('0x1c')]?_0x2ed16e[_0x0c38('0x1c')][_0x0c38('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ed16e[_0x0c38('0x1c')]?_0x2ed16e[_0x0c38('0x1c')][_0x0c38('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0c38('0x1f'),db[_0x0c38('0x20')]['fn']('IF',db[_0x0c38('0x20')][_0x0c38('0x21')](_0x0c38('0x22')))),_0x0c38('0x23')]]})[_0x0c38('0xf')](function(_0x5b50d4){logger[_0x0c38('0x10')]('GetVoiceQueueRtPauses',_0x2ed16e);logger[_0x0c38('0x11')](_0x0c38('0x1a'),_0x2ed16e,JSON[_0x0c38('0x13')](_0x5b50d4));_0x52caab(_0x5b50d4);})[_0x0c38('0x19')](function(_0x304847){logger['error']('GetVoiceQueueRtPauses',_0x304847[_0x0c38('0x16')],_0x2ed16e);_0x499982(_0x24cfb0['error'](0x1f4,_0x304847[_0x0c38('0x16')]));});});}; \ No newline at end of file +var _0x9fca=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','outboundQueuePauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x4d3fe9,_0x30f9f0){var _0x4b603d=function(_0x56c41a){while(--_0x56c41a){_0x4d3fe9['push'](_0x4d3fe9['shift']());}};_0x4b603d(++_0x30f9f0);}(_0x9fca,0x129));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa9fc('0x0'));var util=require(_0xa9fc('0x1'));var moment=require(_0xa9fc('0x2'));var BPromise=require(_0xa9fc('0x3'));var rs=require(_0xa9fc('0x4'));var fs=require('fs');var Redis=require(_0xa9fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9fc('0x6'));var config=require(_0xa9fc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa9fc('0x8')][_0xa9fc('0x9')]({'port':0x232a});config[_0xa9fc('0xa')]=_[_0xa9fc('0xb')](config[_0xa9fc('0xa')],{'host':_0xa9fc('0xc'),'port':0x18eb});var socket=require(_0xa9fc('0xd'))(new Redis(config[_0xa9fc('0xa')]));require(_0xa9fc('0xe'))[_0xa9fc('0xf')](socket);function respondWithRpcPromise(_0x174dd0,_0x37c7ef,_0x597572){return new BPromise(function(_0x12e66a,_0x3888fb){return client[_0xa9fc('0x10')](_0x174dd0,_0x597572)[_0xa9fc('0x11')](function(_0x56ce96){logger[_0xa9fc('0x12')](_0xa9fc('0x13'),_0x37c7ef,_0xa9fc('0x14'));logger[_0xa9fc('0x15')](_0xa9fc('0x16'),_0x37c7ef,'request\x20sent',JSON['stringify'](_0x56ce96));if(_0x56ce96[_0xa9fc('0x17')]){if(_0x56ce96[_0xa9fc('0x17')][_0xa9fc('0x18')]===0x1f4){logger[_0xa9fc('0x17')](_0xa9fc('0x13'),_0x37c7ef,_0x56ce96[_0xa9fc('0x17')]['message']);return _0x3888fb(_0x56ce96['error'][_0xa9fc('0x19')]);}logger[_0xa9fc('0x17')](_0xa9fc('0x13'),_0x37c7ef,_0x56ce96[_0xa9fc('0x17')][_0xa9fc('0x19')]);return _0x12e66a(_0x56ce96[_0xa9fc('0x17')]['message']);}else{logger[_0xa9fc('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x37c7ef,_0xa9fc('0x14'));_0x12e66a(_0x56ce96[_0xa9fc('0x1a')][_0xa9fc('0x19')]);}})[_0xa9fc('0x1b')](function(_0x1de257){logger['error'](_0xa9fc('0x13'),_0x37c7ef,_0x1de257);_0x3888fb(_0x1de257);});});}exports[_0xa9fc('0x1c')]=function(_0x202e35){var _0x17a3c2=this;return new Promise(function(_0x2459c7,_0xaf40f7){return db[_0xa9fc('0x1d')][_0xa9fc('0x1e')]({'raw':_0x202e35[_0xa9fc('0x1f')]?_0x202e35[_0xa9fc('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x202e35['options']?_0x202e35[_0xa9fc('0x1f')][_0xa9fc('0x20')]||null:null,'attributes':[[db[_0xa9fc('0x21')]['fn'](_0xa9fc('0x22'),db[_0xa9fc('0x21')]['fn']('IF',db[_0xa9fc('0x21')][_0xa9fc('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0xa9fc('0x24')]]})['then'](function(_0x48e850){logger[_0xa9fc('0x12')](_0xa9fc('0x1c'),_0x202e35);logger['debug']('GetVoiceQueueRtPauses',_0x202e35,JSON[_0xa9fc('0x25')](_0x48e850));_0x2459c7(_0x48e850);})['catch'](function(_0x1046dc){logger['error'](_0xa9fc('0x1c'),_0x1046dc[_0xa9fc('0x19')],_0x202e35);_0xaf40f7(_0x17a3c2['error'](0x1f4,_0x1046dc['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1b65832..12dc0e8 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 _0x98a8=['save','remove','update','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x40a5aa,_0x29f4f0){var _0x3928d0=function(_0x495b9d){while(--_0x495b9d){_0x40a5aa['push'](_0x40a5aa['shift']());}};_0x3928d0(++_0x29f4f0);}(_0x98a8,0x12c));var _0x898a=function(_0x5d4879,_0x4fd551){_0x5d4879=_0x5d4879-0x0;var _0x36f581=_0x98a8[_0x5d4879];return _0x36f581;};'use strict';var UserVoiceQueueRtEvents=require(_0x898a('0x0'));var events=[_0x898a('0x1'),_0x898a('0x2'),_0x898a('0x3')];function createListener(_0x213c5d,_0x226db7){return function(_0x69c61f){_0x226db7['emit'](_0x213c5d,_0x69c61f);};}function removeListener(_0x2bb3e2,_0xf84a19){return function(){UserVoiceQueueRtEvents[_0x898a('0x4')](_0x2bb3e2,_0xf84a19);};}exports[_0x898a('0x5')]=function(_0x3e7ddd){for(var _0x5d7e59=0x0,_0x3aadc2=events['length'];_0x5d7e59<_0x3aadc2;_0x5d7e59++){var _0xfa8c50=events[_0x5d7e59];var _0x4fbce5=createListener(_0x898a('0x6')+_0xfa8c50,_0x3e7ddd);UserVoiceQueueRtEvents['on'](_0xfa8c50,_0x4fbce5);}}; \ No newline at end of file +var _0x33c5=['remove','emit','removeListener','register','length','userVoiceQueueRt:','save'];(function(_0x15ad02,_0x56ace9){var _0x3c87da=function(_0x32ced0){while(--_0x32ced0){_0x15ad02['push'](_0x15ad02['shift']());}};_0x3c87da(++_0x56ace9);}(_0x33c5,0xe6));var _0x533c=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x33c5[_0x2ffc46];return _0x1eda8f;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x533c('0x0'),_0x533c('0x1'),'update'];function createListener(_0x9dafa,_0x26b916){return function(_0x221e43){_0x26b916[_0x533c('0x2')](_0x9dafa,_0x221e43);};}function removeListener(_0x358127,_0x49609e){return function(){UserVoiceQueueRtEvents[_0x533c('0x3')](_0x358127,_0x49609e);};}exports[_0x533c('0x4')]=function(_0x31d912){for(var _0x151732=0x0,_0x34ca89=events[_0x533c('0x5')];_0x151732<_0x34ca89;_0x151732++){var _0x3a009b=events[_0x151732];var _0x36d74e=createListener(_0x533c('0x6')+_0x3a009b,_0x31d912);UserVoiceQueueRtEvents['on'](_0x3a009b,_0x36d74e);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 0651590..f27cc66 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 _0xac4a=['express','Router','../../config/environment','./variable.controller','get','index','/:id','show','post','put','isAuthenticated','destroy','exports','multer','util','path','connect-timeout'];(function(_0x15b454,_0x3a8893){var _0x4ee249=function(_0x579971){while(--_0x579971){_0x15b454['push'](_0x15b454['shift']());}};_0x4ee249(++_0x3a8893);}(_0xac4a,0x13f));var _0xaac4=function(_0x4916e4,_0x37e567){_0x4916e4=_0x4916e4-0x0;var _0x26b357=_0xac4a[_0x4916e4];return _0x26b357;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaac4('0x6'));var controller=require(_0xaac4('0x7'));router[_0xaac4('0x8')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x9')]);router['get'](_0xaac4('0xa'),auth['isAuthenticated'](),controller[_0xaac4('0xb')]);router[_0xaac4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaac4('0xd')]('/:id',auth[_0xaac4('0xe')](),controller['update']);router['delete'](_0xaac4('0xa'),auth[_0xaac4('0xe')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0xb7e7=['put','update','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','./variable.controller','get','/:id','isAuthenticated','post','create'];(function(_0x30dd9d,_0x354286){var _0x51e66b=function(_0x19484f){while(--_0x19484f){_0x30dd9d['push'](_0x30dd9d['shift']());}};_0x51e66b(++_0x354286);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb7e7[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x9')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['delete'](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);module[_0x7b7e('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 87a14f8..e90ae40 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 _0x1500=['STRING','exports'];(function(_0x47f473,_0x12eb07){var _0x55040d=function(_0xec9f13){while(--_0xec9f13){_0x47f473['push'](_0x47f473['shift']());}};_0x55040d(++_0x12eb07);}(_0x1500,0x191));var _0x0150=function(_0xfd0d1c,_0x583653){_0xfd0d1c=_0xfd0d1c-0x0;var _0x2e5993=_0x1500[_0xfd0d1c];return _0x2e5993;};'use strict';var Sequelize=require('sequelize');module[_0x0150('0x0')]={'name':{'type':Sequelize[_0x0150('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0150('0x1')]}}; \ No newline at end of file +var _0x3a89=['STRING','sequelize','exports','name'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3a89,0xc5));var _0x93a8=function(_0x3149bc,_0x24b6b7){_0x3149bc=_0x3149bc-0x0;var _0x325cd1=_0x3a89[_0x3149bc];return _0x325cd1;};'use strict';var Sequelize=require(_0x93a8('0x0'));module[_0x93a8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x93a8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x93a8('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 390f78b..723f008 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 _0xa74f=['rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','then','error','name','send','Variable','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','key','VIRTUAL','field','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x173c9d,_0x1e6090){var _0x35842e=function(_0xf224b3){while(--_0xf224b3){_0x173c9d['push'](_0x173c9d['shift']());}};_0x35842e(++_0x1e6090);}(_0xa74f,0x9a));var _0xfa74=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xa74f[_0x344adc];return _0x4014b2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfa74('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa74('0x1'));var moment=require(_0xfa74('0x2'));var BPromise=require(_0xfa74('0x3'));var Mustache=require(_0xfa74('0x4'));var util=require('util');var path=require(_0xfa74('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa74('0x6'));var fs=require('fs');var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfa74('0x10'));var logger=require(_0xfa74('0x11'))('api');var utils=require(_0xfa74('0x12'));var config=require(_0xfa74('0x13'));var db=require(_0xfa74('0x14'))['db'];function respondWithStatusCode(_0x307d35,_0x5bc6b7){_0x5bc6b7=_0x5bc6b7||0xcc;return function(_0x23591a){if(_0x23591a){return _0x307d35[_0xfa74('0x15')](_0x5bc6b7);}return _0x307d35[_0xfa74('0x16')](_0x5bc6b7)[_0xfa74('0x17')]();};}function respondWithResult(_0x4ad407,_0x3553e7){_0x3553e7=_0x3553e7||0xc8;return function(_0x33cda3){if(_0x33cda3){return _0x4ad407[_0xfa74('0x16')](_0x3553e7)[_0xfa74('0x18')](_0x33cda3);}};}function respondWithFilteredResult(_0xe3c97e,_0x47c8fb){return function(_0x199d20){if(_0x199d20){var _0x13d911=_0x199d20[_0xfa74('0x19')],_0x947da6=_0x47c8fb[_0xfa74('0x1a')],_0x1f1de0=_0x47c8fb['offset']+_0x47c8fb[_0xfa74('0x1b')],_0x3867f8;if(_0x1f1de0>=_0x13d911){_0x1f1de0=_0x13d911;_0x3867f8=0xc8;}else{_0x3867f8=0xce;}_0xe3c97e[_0xfa74('0x16')](_0x3867f8);return _0xe3c97e['set']('Content-Range',_0x947da6+'-'+_0x1f1de0+'/'+_0x13d911)[_0xfa74('0x18')](_0x199d20);}return null;};}function patchUpdates(_0x25a36b){return function(_0xb8fe6b){try{jsonpatch['apply'](_0xb8fe6b,_0x25a36b,!![]);}catch(_0x3bede6){return BPromise[_0xfa74('0x1c')](_0x3bede6);}return _0xb8fe6b[_0xfa74('0x1d')]();};}function saveUpdates(_0x59a00c,_0xd35110){return function(_0x302eb4){if(_0x302eb4){return _0x302eb4[_0xfa74('0x1e')](_0x59a00c)['then'](function(_0x5466ca){return _0x5466ca;});}return null;};}function removeEntity(_0x100851,_0x2257a0){return function(_0x9932db){if(_0x9932db){return _0x9932db[_0xfa74('0x1f')]()[_0xfa74('0x20')](function(){var _0x554e0e=_0x9932db['get']({'plain':!![]});var _0x3721bf='Variables';return db['UserProfileResource']['destroy']({'where':{'type':_0x3721bf,'resourceId':_0x554e0e['id']}})[_0xfa74('0x20')](function(){return _0x9932db;});})[_0xfa74('0x20')](function(){_0x100851[_0xfa74('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530f99,_0x9eb68c){return function(_0xeb6c11){if(!_0xeb6c11){_0x530f99['sendStatus'](0x194);}return _0xeb6c11;};}function handleError(_0x62e1be,_0x5d3b26){_0x5d3b26=_0x5d3b26||0x1f4;return function(_0x1a8cf7){logger[_0xfa74('0x21')](_0x1a8cf7['stack']);if(_0x1a8cf7[_0xfa74('0x22')]){delete _0x1a8cf7[_0xfa74('0x22')];}_0x62e1be[_0xfa74('0x16')](_0x5d3b26)[_0xfa74('0x23')](_0x1a8cf7);};}exports['index']=function(_0xd9c55d,_0x2f7cd7){var _0x204e01={},_0x57d90e={},_0x4d4bed={'count':0x0,'rows':[]};var _0x1322a4=db[_0xfa74('0x24')]['rawAttributes'];_0x57d90e['model']=_[_0xfa74('0x25')](_0x1322a4);_0x57d90e['query']=_[_0xfa74('0x25')](_0xd9c55d['query']);_0x57d90e[_0xfa74('0x26')]=_[_0xfa74('0x27')](_0x57d90e[_0xfa74('0x28')],_0x57d90e[_0xfa74('0x29')]);_0x204e01['attributes']=_[_0xfa74('0x27')](_0x57d90e[_0xfa74('0x28')],qs[_0xfa74('0x2a')](_0xd9c55d[_0xfa74('0x29')][_0xfa74('0x2a')]));_0x204e01[_0xfa74('0x2b')]=_0x204e01[_0xfa74('0x2b')]['length']?_0x204e01[_0xfa74('0x2b')]:_0x57d90e['model'];if(!_0xd9c55d[_0xfa74('0x29')][_0xfa74('0x2c')](_0xfa74('0x2d'))){_0x204e01[_0xfa74('0x1b')]=qs['limit'](_0xd9c55d['query'][_0xfa74('0x1b')]);_0x204e01[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0xd9c55d[_0xfa74('0x29')]['offset']);}_0x204e01[_0xfa74('0x2e')]=qs[_0xfa74('0x2f')](_0xd9c55d['query']['sort']);_0x204e01['where']=qs['filters'](_['pick'](_0xd9c55d[_0xfa74('0x29')],_0x57d90e[_0xfa74('0x26')]));if(_0xd9c55d[_0xfa74('0x29')][_0xfa74('0x30')]){_0x204e01[_0xfa74('0x31')]=_[_0xfa74('0x32')](_0x204e01[_0xfa74('0x31')],{'$or':_[_0xfa74('0x33')](_0x1322a4,function(_0x1a2d52){if(_0x1a2d52['type'][_0xfa74('0x34')]!==_0xfa74('0x35')){var _0x430339={};_0x430339[_0x1a2d52[_0xfa74('0x36')]]={'$like':'%'+_0xd9c55d[_0xfa74('0x29')][_0xfa74('0x30')]+'%'};return _0x430339;}})});}_0x204e01=_['merge']({},_0x204e01,_0xd9c55d[_0xfa74('0x37')]);var _0x1f0806={'where':_0x204e01[_0xfa74('0x31')]};return db[_0xfa74('0x24')]['count'](_0x1f0806)[_0xfa74('0x20')](function(_0x13d9a5){_0x4d4bed[_0xfa74('0x19')]=_0x13d9a5;if(_0xd9c55d[_0xfa74('0x29')]['includeAll']){_0x204e01[_0xfa74('0x38')]=[{'all':!![]}];}return db[_0xfa74('0x24')][_0xfa74('0x39')](_0x204e01);})['then'](function(_0x5d32bc){_0x4d4bed[_0xfa74('0x3a')]=_0x5d32bc;return _0x4d4bed;})[_0xfa74('0x20')](respondWithFilteredResult(_0x2f7cd7,_0x204e01))[_0xfa74('0x3b')](handleError(_0x2f7cd7,null));};exports[_0xfa74('0x3c')]=function(_0x55f4e3,_0x1ab026){var _0x171923={'raw':!![],'where':{'id':_0x55f4e3['params']['id']}},_0x54e66d={};_0x54e66d['model']=_['keys'](db[_0xfa74('0x24')][_0xfa74('0x3d')]);_0x54e66d[_0xfa74('0x29')]=_[_0xfa74('0x25')](_0x55f4e3[_0xfa74('0x29')]);_0x54e66d[_0xfa74('0x26')]=_[_0xfa74('0x27')](_0x54e66d['model'],_0x54e66d[_0xfa74('0x29')]);_0x171923[_0xfa74('0x2b')]=_[_0xfa74('0x27')](_0x54e66d[_0xfa74('0x28')],qs[_0xfa74('0x2a')](_0x55f4e3['query'][_0xfa74('0x2a')]));_0x171923[_0xfa74('0x2b')]=_0x171923[_0xfa74('0x2b')][_0xfa74('0x3e')]?_0x171923[_0xfa74('0x2b')]:_0x54e66d[_0xfa74('0x28')];if(_0x55f4e3[_0xfa74('0x29')][_0xfa74('0x3f')]){_0x171923[_0xfa74('0x38')]=[{'all':!![]}];}_0x171923=_[_0xfa74('0x32')]({},_0x171923,_0x55f4e3['options']);return db[_0xfa74('0x24')]['find'](_0x171923)[_0xfa74('0x20')](handleEntityNotFound(_0x1ab026,null))[_0xfa74('0x20')](respondWithResult(_0x1ab026,null))[_0xfa74('0x3b')](handleError(_0x1ab026,null));};exports[_0xfa74('0x40')]=function(_0x4911a5,_0x2d1ca7){return db[_0xfa74('0x24')]['create'](_0x4911a5[_0xfa74('0x41')],{})[_0xfa74('0x20')](function(_0x5cbb70){var _0x2be89f=_0x4911a5[_0xfa74('0x42')][_0xfa74('0x43')]({'plain':!![]});if(!_0x2be89f)throw new Error(_0xfa74('0x44'));if(_0x2be89f[_0xfa74('0x45')]==='user'){var _0x54e06c=_0x5cbb70[_0xfa74('0x43')]({'plain':!![]});var _0x91df44='Variables';return db[_0xfa74('0x46')][_0xfa74('0x47')]({'where':{'name':_0x91df44,'userProfileId':_0x2be89f[_0xfa74('0x48')]},'raw':!![]})['then'](function(_0x4af9ea){if(_0x4af9ea&&_0x4af9ea[_0xfa74('0x49')]===0x0){return db[_0xfa74('0x4a')][_0xfa74('0x40')]({'name':_0x54e06c[_0xfa74('0x22')],'resourceId':_0x54e06c['id'],'type':_0x4af9ea[_0xfa74('0x22')],'sectionId':_0x4af9ea['id']},{})[_0xfa74('0x20')](function(){return _0x5cbb70;});}else{return _0x5cbb70;}})[_0xfa74('0x3b')](function(_0x30992b){logger['error'](_0xfa74('0x4b'),_0x30992b);throw _0x30992b;});}return _0x5cbb70;})[_0xfa74('0x20')](respondWithResult(_0x2d1ca7,0xc9))[_0xfa74('0x3b')](handleError(_0x2d1ca7,null));};exports[_0xfa74('0x1e')]=function(_0x569801,_0x4ec218){if(_0x569801[_0xfa74('0x41')]['id']){delete _0x569801['body']['id'];}return db[_0xfa74('0x24')][_0xfa74('0x47')]({'where':{'id':_0x569801[_0xfa74('0x4c')]['id']}})[_0xfa74('0x20')](handleEntityNotFound(_0x4ec218,null))[_0xfa74('0x20')](saveUpdates(_0x569801[_0xfa74('0x41')],null))[_0xfa74('0x20')](respondWithResult(_0x4ec218,null))['catch'](handleError(_0x4ec218,null));};exports[_0xfa74('0x1f')]=function(_0x4bcee3,_0x21d7c5){return db['Variable']['find']({'where':{'id':_0x4bcee3[_0xfa74('0x4c')]['id']}})[_0xfa74('0x20')](handleEntityNotFound(_0x21d7c5,null))['then'](removeEntity(_0x21d7c5,null))['catch'](handleError(_0x21d7c5,null));}; \ No newline at end of file +var _0x9f62=['pick','filter','merge','type','key','VIRTUAL','includeAll','findAll','catch','show','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters'];(function(_0x11e36f,_0x13dcd9){var _0x310a3b=function(_0x4bd59b){while(--_0x4bd59b){_0x11e36f['push'](_0x11e36f['shift']());}};_0x310a3b(++_0x13dcd9);}(_0x9f62,0x154));var _0x29f6=function(_0x4cf108,_0x2e30e1){_0x4cf108=_0x4cf108-0x0;var _0x3f80fb=_0x9f62[_0x4cf108];return _0x3f80fb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x1'));var jsonpatch=require(_0x29f6('0x2'));var rp=require(_0x29f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29f6('0x4'));var util=require(_0x29f6('0x5'));var path=require(_0x29f6('0x6'));var sox=require(_0x29f6('0x7'));var csv=require('to-csv');var ejs=require(_0x29f6('0x8'));var fs=require('fs');var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29f6('0xf'))(_0x29f6('0x10'));var utils=require('../../config/utils');var config=require(_0x29f6('0x11'));var db=require(_0x29f6('0x12'))['db'];function respondWithStatusCode(_0x5cf872,_0x5b9b6a){_0x5b9b6a=_0x5b9b6a||0xcc;return function(_0x559585){if(_0x559585){return _0x5cf872['sendStatus'](_0x5b9b6a);}return _0x5cf872[_0x29f6('0x13')](_0x5b9b6a)[_0x29f6('0x14')]();};}function respondWithResult(_0x189344,_0x11a1fd){_0x11a1fd=_0x11a1fd||0xc8;return function(_0x17de6e){if(_0x17de6e){return _0x189344[_0x29f6('0x13')](_0x11a1fd)[_0x29f6('0x15')](_0x17de6e);}};}function respondWithFilteredResult(_0x2418ee,_0x1ae582){return function(_0x19331f){if(_0x19331f){var _0x28d314=_0x19331f[_0x29f6('0x16')],_0x370484=_0x1ae582[_0x29f6('0x17')],_0x1dde97=_0x1ae582[_0x29f6('0x17')]+_0x1ae582['limit'],_0x3a75d0;if(_0x1dde97>=_0x28d314){_0x1dde97=_0x28d314;_0x3a75d0=0xc8;}else{_0x3a75d0=0xce;}_0x2418ee['status'](_0x3a75d0);return _0x2418ee[_0x29f6('0x18')](_0x29f6('0x19'),_0x370484+'-'+_0x1dde97+'/'+_0x28d314)[_0x29f6('0x15')](_0x19331f);}return null;};}function patchUpdates(_0x5c8246){return function(_0xcb90){try{jsonpatch[_0x29f6('0x1a')](_0xcb90,_0x5c8246,!![]);}catch(_0x49252f){return BPromise[_0x29f6('0x1b')](_0x49252f);}return _0xcb90[_0x29f6('0x1c')]();};}function saveUpdates(_0x42a8fa,_0x41b9f0){return function(_0xb6e7a9){if(_0xb6e7a9){return _0xb6e7a9[_0x29f6('0x1d')](_0x42a8fa)['then'](function(_0xfb8fd2){return _0xfb8fd2;});}return null;};}function removeEntity(_0x59def4,_0x4acb15){return function(_0x470019){if(_0x470019){return _0x470019[_0x29f6('0x1e')]()[_0x29f6('0x1f')](function(){var _0xafb5dd=_0x470019['get']({'plain':!![]});var _0x2c672e='Variables';return db[_0x29f6('0x20')][_0x29f6('0x1e')]({'where':{'type':_0x2c672e,'resourceId':_0xafb5dd['id']}})[_0x29f6('0x1f')](function(){return _0x470019;});})[_0x29f6('0x1f')](function(){_0x59def4['status'](0xcc)[_0x29f6('0x14')]();});}};}function handleEntityNotFound(_0x4d494f,_0x47c385){return function(_0x1401fb){if(!_0x1401fb){_0x4d494f[_0x29f6('0x21')](0x194);}return _0x1401fb;};}function handleError(_0x2519ac,_0x342038){_0x342038=_0x342038||0x1f4;return function(_0x84ccb7){logger[_0x29f6('0x22')](_0x84ccb7[_0x29f6('0x23')]);if(_0x84ccb7['name']){delete _0x84ccb7[_0x29f6('0x24')];}_0x2519ac[_0x29f6('0x13')](_0x342038)[_0x29f6('0x25')](_0x84ccb7);};}exports[_0x29f6('0x26')]=function(_0xda0a63,_0x16a6ad){var _0x3790f5={},_0x17b2f2={},_0x3d88db={'count':0x0,'rows':[]};var _0x13a3a2=db[_0x29f6('0x27')][_0x29f6('0x28')];_0x17b2f2[_0x29f6('0x29')]=_[_0x29f6('0x2a')](_0x13a3a2);_0x17b2f2[_0x29f6('0x2b')]=_[_0x29f6('0x2a')](_0xda0a63[_0x29f6('0x2b')]);_0x17b2f2['filters']=_['intersection'](_0x17b2f2[_0x29f6('0x29')],_0x17b2f2['query']);_0x3790f5[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x17b2f2[_0x29f6('0x29')],qs[_0x29f6('0x2e')](_0xda0a63['query']['fields']));_0x3790f5[_0x29f6('0x2c')]=_0x3790f5[_0x29f6('0x2c')][_0x29f6('0x2f')]?_0x3790f5[_0x29f6('0x2c')]:_0x17b2f2[_0x29f6('0x29')];if(!_0xda0a63[_0x29f6('0x2b')][_0x29f6('0x30')](_0x29f6('0x31'))){_0x3790f5[_0x29f6('0x32')]=qs[_0x29f6('0x32')](_0xda0a63[_0x29f6('0x2b')][_0x29f6('0x32')]);_0x3790f5[_0x29f6('0x17')]=qs[_0x29f6('0x17')](_0xda0a63['query']['offset']);}_0x3790f5[_0x29f6('0x33')]=qs[_0x29f6('0x34')](_0xda0a63[_0x29f6('0x2b')]['sort']);_0x3790f5[_0x29f6('0x35')]=qs[_0x29f6('0x36')](_[_0x29f6('0x37')](_0xda0a63[_0x29f6('0x2b')],_0x17b2f2[_0x29f6('0x36')]));if(_0xda0a63['query'][_0x29f6('0x38')]){_0x3790f5[_0x29f6('0x35')]=_[_0x29f6('0x39')](_0x3790f5[_0x29f6('0x35')],{'$or':_['map'](_0x13a3a2,function(_0x30d747){if(_0x30d747[_0x29f6('0x3a')][_0x29f6('0x3b')]!==_0x29f6('0x3c')){var _0x5ddc09={};_0x5ddc09[_0x30d747['field']]={'$like':'%'+_0xda0a63[_0x29f6('0x2b')]['filter']+'%'};return _0x5ddc09;}})});}_0x3790f5=_[_0x29f6('0x39')]({},_0x3790f5,_0xda0a63['options']);var _0x3a1a75={'where':_0x3790f5['where']};return db[_0x29f6('0x27')][_0x29f6('0x16')](_0x3a1a75)['then'](function(_0x1431fc){_0x3d88db['count']=_0x1431fc;if(_0xda0a63[_0x29f6('0x2b')][_0x29f6('0x3d')]){_0x3790f5['include']=[{'all':!![]}];}return db[_0x29f6('0x27')][_0x29f6('0x3e')](_0x3790f5);})[_0x29f6('0x1f')](function(_0x1e9d5a){_0x3d88db['rows']=_0x1e9d5a;return _0x3d88db;})[_0x29f6('0x1f')](respondWithFilteredResult(_0x16a6ad,_0x3790f5))[_0x29f6('0x3f')](handleError(_0x16a6ad,null));};exports[_0x29f6('0x40')]=function(_0x2322eb,_0x1dbd17){var _0x4d4189={'raw':!![],'where':{'id':_0x2322eb['params']['id']}},_0xb5f2b1={};_0xb5f2b1[_0x29f6('0x29')]=_['keys'](db[_0x29f6('0x27')][_0x29f6('0x28')]);_0xb5f2b1['query']=_[_0x29f6('0x2a')](_0x2322eb[_0x29f6('0x2b')]);_0xb5f2b1[_0x29f6('0x36')]=_[_0x29f6('0x2d')](_0xb5f2b1['model'],_0xb5f2b1[_0x29f6('0x2b')]);_0x4d4189[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0xb5f2b1['model'],qs[_0x29f6('0x2e')](_0x2322eb['query'][_0x29f6('0x2e')]));_0x4d4189['attributes']=_0x4d4189['attributes']['length']?_0x4d4189[_0x29f6('0x2c')]:_0xb5f2b1[_0x29f6('0x29')];if(_0x2322eb[_0x29f6('0x2b')][_0x29f6('0x3d')]){_0x4d4189[_0x29f6('0x41')]=[{'all':!![]}];}_0x4d4189=_[_0x29f6('0x39')]({},_0x4d4189,_0x2322eb[_0x29f6('0x42')]);return db[_0x29f6('0x27')][_0x29f6('0x43')](_0x4d4189)[_0x29f6('0x1f')](handleEntityNotFound(_0x1dbd17,null))['then'](respondWithResult(_0x1dbd17,null))['catch'](handleError(_0x1dbd17,null));};exports[_0x29f6('0x44')]=function(_0x450e76,_0x7a65c0){return db[_0x29f6('0x27')]['create'](_0x450e76[_0x29f6('0x45')],{})[_0x29f6('0x1f')](function(_0x532df5){var _0x21f023=_0x450e76[_0x29f6('0x46')][_0x29f6('0x47')]({'plain':!![]});if(!_0x21f023)throw new Error(_0x29f6('0x48'));if(_0x21f023[_0x29f6('0x49')]===_0x29f6('0x46')){var _0x320b5e=_0x532df5[_0x29f6('0x47')]({'plain':!![]});var _0x2ca712=_0x29f6('0x4a');return db[_0x29f6('0x4b')][_0x29f6('0x43')]({'where':{'name':_0x2ca712,'userProfileId':_0x21f023['userProfileId']},'raw':!![]})[_0x29f6('0x1f')](function(_0x463551){if(_0x463551&&_0x463551[_0x29f6('0x4c')]===0x0){return db[_0x29f6('0x20')][_0x29f6('0x44')]({'name':_0x320b5e['name'],'resourceId':_0x320b5e['id'],'type':_0x463551[_0x29f6('0x24')],'sectionId':_0x463551['id']},{})['then'](function(){return _0x532df5;});}else{return _0x532df5;}})['catch'](function(_0x9dfc77){logger[_0x29f6('0x22')](_0x29f6('0x4d'),_0x9dfc77);throw _0x9dfc77;});}return _0x532df5;})[_0x29f6('0x1f')](respondWithResult(_0x7a65c0,0xc9))[_0x29f6('0x3f')](handleError(_0x7a65c0,null));};exports['update']=function(_0x167976,_0x458ada){if(_0x167976['body']['id']){delete _0x167976[_0x29f6('0x45')]['id'];}return db['Variable'][_0x29f6('0x43')]({'where':{'id':_0x167976[_0x29f6('0x4e')]['id']}})[_0x29f6('0x1f')](handleEntityNotFound(_0x458ada,null))[_0x29f6('0x1f')](saveUpdates(_0x167976['body'],null))[_0x29f6('0x1f')](respondWithResult(_0x458ada,null))[_0x29f6('0x3f')](handleError(_0x458ada,null));};exports[_0x29f6('0x1e')]=function(_0x217428,_0x3aa7eb){return db[_0x29f6('0x27')][_0x29f6('0x43')]({'where':{'id':_0x217428['params']['id']}})[_0x29f6('0x1f')](handleEntityNotFound(_0x3aa7eb,null))[_0x29f6('0x1f')](removeEntity(_0x3aa7eb,null))[_0x29f6('0x3f')](handleError(_0x3aa7eb,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 2d839ce..1f6fb5b 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 _0x4279=['moment','bluebird','request-promise','path','../../config/environment','exports','define','Variable','tools_variables','util','../../config/logger'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x4279,0x8d));var _0x9427=function(_0x48c738,_0x310f74){_0x48c738=_0x48c738-0x0;var _0x5eef70=_0x4279[_0x48c738];return _0x5eef70;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var logger=require(_0x9427('0x1'))('api');var moment=require(_0x9427('0x2'));var BPromise=require(_0x9427('0x3'));var rp=require(_0x9427('0x4'));var fs=require('fs');var path=require(_0x9427('0x5'));var rimraf=require('rimraf');var config=require(_0x9427('0x6'));var attributes=require('./variable.attributes');module[_0x9427('0x7')]=function(_0x2a0b3e,_0x5e9d1e){return _0x2a0b3e[_0x9427('0x8')](_0x9427('0x9'),attributes,{'tableName':_0x9427('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5af=['exports','Variable','tools_variables','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xe5af,0x9c));var _0xfe5a=function(_0x542884,_0x48761c){_0x542884=_0x542884-0x0;var _0x4cac82=_0xe5af[_0x542884];return _0x4cac82;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require(_0xfe5a('0x2'));var BPromise=require(_0xfe5a('0x3'));var rp=require(_0xfe5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x5'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'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 be20b10..276587d 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 _0xd10f=['Variable','find','options','raw','where','attributes','map','include','model','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowVariable'];(function(_0x373776,_0x38dad7){var _0x78a449=function(_0x2beca2){while(--_0x2beca2){_0x373776['push'](_0x373776['shift']());}};_0x78a449(++_0x38dad7);}(_0xd10f,0xab));var _0xfd10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd10f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd10('0x0'));var util=require('util');var moment=require(_0xfd10('0x1'));var BPromise=require(_0xfd10('0x2'));var rs=require(_0xfd10('0x3'));var fs=require('fs');var Redis=require(_0xfd10('0x4'));var db=require(_0xfd10('0x5'))['db'];var utils=require(_0xfd10('0x6'));var logger=require('../../config/logger')(_0xfd10('0x7'));var config=require(_0xfd10('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd10('0x9')][_0xfd10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056ce,_0x3e661b,_0x4ca798){return new BPromise(function(_0x224acc,_0x3727ac){return client['request'](_0x2056ce,_0x4ca798)['then'](function(_0xa3ea1c){logger[_0xfd10('0xb')](_0xfd10('0xc'),_0x3e661b,_0xfd10('0xd'));logger[_0xfd10('0xe')](_0xfd10('0xf'),_0x3e661b,_0xfd10('0xd'),JSON[_0xfd10('0x10')](_0xa3ea1c));if(_0xa3ea1c[_0xfd10('0x11')]){if(_0xa3ea1c['error']['code']===0x1f4){logger[_0xfd10('0x11')]('Variable,\x20%s,\x20%s',_0x3e661b,_0xa3ea1c[_0xfd10('0x11')][_0xfd10('0x12')]);return _0x3727ac(_0xa3ea1c[_0xfd10('0x11')][_0xfd10('0x12')]);}logger[_0xfd10('0x11')](_0xfd10('0xc'),_0x3e661b,_0xa3ea1c[_0xfd10('0x11')][_0xfd10('0x12')]);return _0x224acc(_0xa3ea1c['error'][_0xfd10('0x12')]);}else{logger[_0xfd10('0xb')]('Variable,\x20%s,\x20%s',_0x3e661b,'request\x20sent');_0x224acc(_0xa3ea1c[_0xfd10('0x13')][_0xfd10('0x12')]);}})['catch'](function(_0x55e6a8){logger[_0xfd10('0x11')](_0xfd10('0xc'),_0x3e661b,_0x55e6a8);_0x3727ac(_0x55e6a8);});});}exports[_0xfd10('0x14')]=function(_0x23de73){var _0x2d0b7a=this;return new Promise(function(_0x498457,_0x2d4eed){return db[_0xfd10('0x15')][_0xfd10('0x16')]({'raw':_0x23de73[_0xfd10('0x17')]?_0x23de73[_0xfd10('0x17')][_0xfd10('0x18')]===undefined?!![]:![]:!![],'where':_0x23de73[_0xfd10('0x17')]?_0x23de73['options'][_0xfd10('0x19')]||null:null,'attributes':_0x23de73[_0xfd10('0x17')]?_0x23de73[_0xfd10('0x17')][_0xfd10('0x1a')]||null:null,'include':_0x23de73[_0xfd10('0x17')]?_0x23de73[_0xfd10('0x17')]['include']?_[_0xfd10('0x1b')](_0x23de73[_0xfd10('0x17')][_0xfd10('0x1c')],function(_0x317454){return{'model':db[_0x317454[_0xfd10('0x1d')]],'as':_0x317454['as'],'attributes':_0x317454[_0xfd10('0x1a')],'include':_0x317454[_0xfd10('0x1c')]?_[_0xfd10('0x1b')](_0x317454[_0xfd10('0x1c')],function(_0x4eb80c){return{'model':db[_0x4eb80c[_0xfd10('0x1d')]],'as':_0x4eb80c['as'],'attributes':_0x4eb80c['attributes'],'include':_0x4eb80c[_0xfd10('0x1c')]?_[_0xfd10('0x1b')](_0x4eb80c[_0xfd10('0x1c')],function(_0x13774f){return{'model':db[_0x13774f[_0xfd10('0x1d')]],'as':_0x13774f['as'],'attributes':_0x13774f[_0xfd10('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfd10('0x1e')](function(_0x2c0515){logger[_0xfd10('0xb')](_0xfd10('0x14'),_0x23de73);logger['debug'](_0xfd10('0x14'),_0x23de73,JSON[_0xfd10('0x10')](_0x2c0515));_0x498457(_0x2c0515);})[_0xfd10('0x1f')](function(_0x3c57c9){logger[_0xfd10('0x11')](_0xfd10('0x14'),_0x3c57c9[_0xfd10('0x12')],_0x23de73);_0x2d4eed(_0x2d0b7a[_0xfd10('0x11')](0x1f4,_0x3c57c9['message']));});});}; \ No newline at end of file +var _0xf3b8=['stringify','error','Variable,\x20%s,\x20%s','message','result','catch','ShowVariable','options','attributes','include','model','map','lodash','moment','bluebird','../../config/utils','../../config/environment','client','http','request','then','info','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf3b8,0xbb));var _0x8f3b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xf3b8[_0x411add];return _0x238242;};'use strict';var _=require(_0x8f3b('0x0'));var util=require('util');var moment=require(_0x8f3b('0x1'));var BPromise=require(_0x8f3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f3b('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f3b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8f3b('0x5')][_0x8f3b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b438e,_0x8cd379,_0x1cc69f){return new BPromise(function(_0x676cba,_0x5c538f){return client[_0x8f3b('0x7')](_0x5b438e,_0x1cc69f)[_0x8f3b('0x8')](function(_0x154e08){logger[_0x8f3b('0x9')]('Variable,\x20%s,\x20%s',_0x8cd379,'request\x20sent');logger[_0x8f3b('0xa')](_0x8f3b('0xb'),_0x8cd379,_0x8f3b('0xc'),JSON[_0x8f3b('0xd')](_0x154e08));if(_0x154e08[_0x8f3b('0xe')]){if(_0x154e08[_0x8f3b('0xe')]['code']===0x1f4){logger['error'](_0x8f3b('0xf'),_0x8cd379,_0x154e08[_0x8f3b('0xe')]['message']);return _0x5c538f(_0x154e08[_0x8f3b('0xe')][_0x8f3b('0x10')]);}logger[_0x8f3b('0xe')](_0x8f3b('0xf'),_0x8cd379,_0x154e08[_0x8f3b('0xe')][_0x8f3b('0x10')]);return _0x676cba(_0x154e08[_0x8f3b('0xe')]['message']);}else{logger[_0x8f3b('0x9')](_0x8f3b('0xf'),_0x8cd379,_0x8f3b('0xc'));_0x676cba(_0x154e08[_0x8f3b('0x11')][_0x8f3b('0x10')]);}})[_0x8f3b('0x12')](function(_0x571f15){logger[_0x8f3b('0xe')](_0x8f3b('0xf'),_0x8cd379,_0x571f15);_0x5c538f(_0x571f15);});});}exports[_0x8f3b('0x13')]=function(_0x148209){var _0x176703=this;return new Promise(function(_0x18f705,_0x154e53){return db['Variable']['find']({'raw':_0x148209['options']?_0x148209[_0x8f3b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x148209[_0x8f3b('0x14')]?_0x148209[_0x8f3b('0x14')]['where']||null:null,'attributes':_0x148209['options']?_0x148209[_0x8f3b('0x14')][_0x8f3b('0x15')]||null:null,'include':_0x148209['options']?_0x148209['options'][_0x8f3b('0x16')]?_['map'](_0x148209[_0x8f3b('0x14')][_0x8f3b('0x16')],function(_0x9cbaa8){return{'model':db[_0x9cbaa8[_0x8f3b('0x17')]],'as':_0x9cbaa8['as'],'attributes':_0x9cbaa8[_0x8f3b('0x15')],'include':_0x9cbaa8[_0x8f3b('0x16')]?_[_0x8f3b('0x18')](_0x9cbaa8[_0x8f3b('0x16')],function(_0x4bf618){return{'model':db[_0x4bf618[_0x8f3b('0x17')]],'as':_0x4bf618['as'],'attributes':_0x4bf618['attributes'],'include':_0x4bf618[_0x8f3b('0x16')]?_[_0x8f3b('0x18')](_0x4bf618[_0x8f3b('0x16')],function(_0x4bff7c){return{'model':db[_0x4bff7c[_0x8f3b('0x17')]],'as':_0x4bff7c['as'],'attributes':_0x4bff7c[_0x8f3b('0x15')]};}):[]};}):[]};}):[]:[]})[_0x8f3b('0x8')](function(_0x2a19d9){logger[_0x8f3b('0x9')]('ShowVariable',_0x148209);logger[_0x8f3b('0xa')](_0x8f3b('0x13'),_0x148209,JSON['stringify'](_0x2a19d9));_0x18f705(_0x2a19d9);})['catch'](function(_0x11c407){logger[_0x8f3b('0xe')]('ShowVariable',_0x11c407[_0x8f3b('0x10')],_0x148209);_0x154e53(_0x176703[_0x8f3b('0xe')](0x1f4,_0x11c407[_0x8f3b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 41dc97a..515dd1d 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 _0xc955=['canUpdate','reset','/pull','pull','restart','/migrations','migrations','exports','Router','./version.controller','get','/fetch','isAuthenticated'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0xc955,0xcb));var _0x5c95=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xc955[_0x4709c0];return _0x13348b;};'use strict';var express=require('express');var router=express[_0x5c95('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5c95('0x1'));router[_0x5c95('0x2')]('/',controller['index']);router[_0x5c95('0x2')](_0x5c95('0x3'),auth[_0x5c95('0x4')](),auth[_0x5c95('0x5')](),controller['fetch']);router[_0x5c95('0x2')]('/reset',auth[_0x5c95('0x4')](),auth[_0x5c95('0x5')](),controller[_0x5c95('0x6')]);router['get'](_0x5c95('0x7'),auth[_0x5c95('0x4')](),auth[_0x5c95('0x5')](),controller[_0x5c95('0x8')]);router['get']('/restart',auth[_0x5c95('0x4')](),controller[_0x5c95('0x9')]);router['get'](_0x5c95('0xa'),controller[_0x5c95('0xb')]);module[_0x5c95('0xc')]=router; \ No newline at end of file +var _0xc519=['Router','./version.controller','get','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x29c949,_0x43a489){var _0x1a3c34=function(_0x31188f){while(--_0x31188f){_0x29c949['push'](_0x29c949['shift']());}};_0x1a3c34(++_0x43a489);}(_0xc519,0x11f));var _0x9c51=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0xc519[_0x34a14d];return _0x2015f2;};'use strict';var express=require(_0x9c51('0x0'));var router=express[_0x9c51('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9c51('0x2'));router[_0x9c51('0x3')]('/',controller['index']);router['get'](_0x9c51('0x4'),auth[_0x9c51('0x5')](),auth['canUpdate'](),controller[_0x9c51('0x6')]);router[_0x9c51('0x3')](_0x9c51('0x7'),auth['isAuthenticated'](),auth[_0x9c51('0x8')](),controller[_0x9c51('0x9')]);router['get']('/pull',auth[_0x9c51('0x5')](),auth['canUpdate'](),controller[_0x9c51('0xa')]);router[_0x9c51('0x3')](_0x9c51('0xb'),auth[_0x9c51('0x5')](),controller[_0x9c51('0xc')]);router[_0x9c51('0x3')](_0x9c51('0xd'),controller[_0x9c51('0xe')]);module[_0x9c51('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 88c55cc..e5b53ba 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 _0x1d4d=['2.0.0','json','origin','master','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','catch','migrations','readdirSync','join','server','.js','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','query','latest','fetch','exports'];(function(_0x4fd4c6,_0x23af0b){var _0x15640d=function(_0xabe89b){while(--_0xabe89b){_0x4fd4c6['push'](_0x4fd4c6['shift']());}};_0x15640d(++_0x23af0b);}(_0x1d4d,0x160));var _0xd1d4=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x1d4d[_0x581249];return _0x284bae;};'use strict';var Umzug=require(_0xd1d4('0x0'));var path=require(_0xd1d4('0x1'));var fs=require('fs');var _=require(_0xd1d4('0x2'));var pkginfo=require(_0xd1d4('0x3'))(module,_0xd1d4('0x4'));var compareVersions=require(_0xd1d4('0x5'));var exec=require(_0xd1d4('0x6'))[_0xd1d4('0x7')];var db=require(_0xd1d4('0x8'))['db'];var config=require(_0xd1d4('0x9'));var pm2=require('../../config/pm2');var logger=require(_0xd1d4('0xa'))(_0xd1d4('0xb'));var git=require(_0xd1d4('0xc'))(config[_0xd1d4('0xd')]);exports[_0xd1d4('0xe')]=function(_0x46ba4a,_0x4dec93){var _0x16f6f4={'current':module['exports'][_0xd1d4('0x4')],'phonebar':0x2};if(_0x46ba4a['query']&&_0x46ba4a[_0xd1d4('0xf')][_0xd1d4('0x10')]){return git[_0xd1d4('0x11')]()['tags'](function(_0x5bba6a,_0x186110){_0x16f6f4[_0xd1d4('0x10')]=(_0x5bba6a?module[_0xd1d4('0x12')][_0xd1d4('0x4')]:_0x186110['latest'])||_0xd1d4('0x13');return _0x4dec93['status'](0xc8)[_0xd1d4('0x14')](_0x16f6f4);});}else{return _0x4dec93['status'](0xc8)[_0xd1d4('0x14')](_0x16f6f4);}};exports[_0xd1d4('0x11')]=function(_0x337428,_0x7f8788){return git[_0xd1d4('0x11')]([_0xd1d4('0x15'),_0xd1d4('0x16')],function(_0xae8aca){if(_0xae8aca){logger[_0xd1d4('0x17')](_0xae8aca);return _0x7f8788[_0xd1d4('0x18')](0x1f4)[_0xd1d4('0x14')](_0xae8aca);}logger[_0xd1d4('0x19')](_0xd1d4('0x1a'));return _0x7f8788['status'](0xc8)[_0xd1d4('0x14')]({'output':_0xd1d4('0x1b')});});};exports[_0xd1d4('0x1c')]=function(_0xd93b32,_0x49d3d8){return git['reset']([_0xd1d4('0x1d'),'FETCH_HEAD'],function(_0x5883aa){if(_0x5883aa){logger['error'](_0x5883aa);return _0x49d3d8[_0xd1d4('0x18')](0x1f4)[_0xd1d4('0x14')](_0x5883aa);}logger[_0xd1d4('0x19')](_0xd1d4('0x1e'));return _0x49d3d8['status'](0xc8)[_0xd1d4('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0xd1d4('0x1f')]=function(_0xd68141,_0x554cfc){exec(_0xd1d4('0x20'),function(_0x35276d,_0x2b5ab0,_0x440449){logger[_0xd1d4('0x19')](_0x2b5ab0);logger[_0xd1d4('0x19')](_0x440449);if(_0x35276d){logger['error'](_0x35276d);return _0x554cfc[_0xd1d4('0x18')](0x1f4)['json'](_0x35276d);}return _0x554cfc['status'](0xc8)[_0xd1d4('0x14')]({'output':_0x2b5ab0});});};exports[_0xd1d4('0x21')]=function(_0x173656,_0x5516d4){return pm2[_0xd1d4('0x21')]('motion2')[_0xd1d4('0x22')](function(_0xa01a82){logger['info']('pm2\x20restart\x20motion\x20%s',_0xa01a82);return _0x5516d4[_0xd1d4('0x18')](0xc8)[_0xd1d4('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xd1d4('0x23')](function(_0x546205){logger['error'](_0x546205);return _0x5516d4[_0xd1d4('0x18')](0x1f4)['json'](_0x546205);});};exports[_0xd1d4('0x24')]=function(_0x226f71,_0x425b0f){var _0x37a39b=fs[_0xd1d4('0x25')](path[_0xd1d4('0x26')](config['root'],_0xd1d4('0x27'),_0xd1d4('0x24')));var _0xcc7351=[];for(var _0x18b11f=0x0;_0x18b11f<_0x37a39b['length'];_0x18b11f++){var _0x3ecb20=_0x37a39b[_0x18b11f]['replace'](_0xd1d4('0x28'),'');if(compareVersions(module[_0xd1d4('0x12')][_0xd1d4('0x4')],_0x3ecb20)===-0x1){_0xcc7351[_0xd1d4('0x29')](_0x3ecb20);}}if(_0xcc7351['length']){var _0x59db38=_0xcc7351[_0xd1d4('0x2a')](compareVersions);var _0x4b118d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd1d4('0x2b')],'modelName':_0xd1d4('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0xd1d4('0x2c')][_0xd1d4('0x2d')](),db[_0xd1d4('0x2c')][_0xd1d4('0x2e')],function(){throw new Error(_0xd1d4('0x2f'));}],'path':path[_0xd1d4('0x26')](config[_0xd1d4('0xd')],_0xd1d4('0x27'),_0xd1d4('0x24')),'pattern':/\.js$/}});_0x4b118d['up']({'migrations':_[_0xd1d4('0x30')](_0x59db38,function(_0x5ec750){return _0x5ec750+_0xd1d4('0x28');})})[_0xd1d4('0x22')](function(){return _0x425b0f[_0xd1d4('0x18')](0xc8)[_0xd1d4('0x14')]({'output':_0xd1d4('0x31')+module['exports'][_0xd1d4('0x4')]+'\x20to\x20'+_[_0xd1d4('0x32')](_0x59db38),'migrations':_['join'](_0x59db38)});})[_0xd1d4('0x23')](function(_0xe0399){if(_0xe0399 instanceof db['sequelize'][_0xd1d4('0x33')]){return _0x425b0f[_0xd1d4('0x18')](0xc8)[_0xd1d4('0x14')]({'output':_0xd1d4('0x34')});}else{return _0x425b0f['status'](0x1f4)['json'](_0xe0399);}});}else{return _0x425b0f[_0xd1d4('0x18')](0xc8)[_0xd1d4('0x14')]({'output':_0xd1d4('0x34')});}}; \ No newline at end of file +var _0xb570=['Database\x20already\x20up-to-date','umzug','pkginfo','compare-versions','exec','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','version','latest','fetch','tags','2.0.0','status','json','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb570,0x133));var _0x0b57=function(_0x3c0898,_0x25aca1){_0x3c0898=_0x3c0898-0x0;var _0x50016b=_0xb570[_0x3c0898];return _0x50016b;};'use strict';var Umzug=require(_0x0b57('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x0b57('0x1'))(module,'version');var compareVersions=require(_0x0b57('0x2'));var exec=require('child_process')[_0x0b57('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x0b57('0x4'));var pm2=require(_0x0b57('0x5'));var logger=require(_0x0b57('0x6'))('update');var git=require('simple-git')(config[_0x0b57('0x7')]);exports[_0x0b57('0x8')]=function(_0x143519,_0xa91497){var _0x5d8f07={'current':module[_0x0b57('0x9')][_0x0b57('0xa')],'phonebar':0x2};if(_0x143519['query']&&_0x143519['query'][_0x0b57('0xb')]){return git[_0x0b57('0xc')]()[_0x0b57('0xd')](function(_0x16944b,_0x3e91ed){_0x5d8f07[_0x0b57('0xb')]=(_0x16944b?module[_0x0b57('0x9')][_0x0b57('0xa')]:_0x3e91ed[_0x0b57('0xb')])||_0x0b57('0xe');return _0xa91497['status'](0xc8)['json'](_0x5d8f07);});}else{return _0xa91497[_0x0b57('0xf')](0xc8)[_0x0b57('0x10')](_0x5d8f07);}};exports[_0x0b57('0xc')]=function(_0x294434,_0x562ffe){return git[_0x0b57('0xc')](['origin',_0x0b57('0x11')],function(_0x284ea4){if(_0x284ea4){logger['error'](_0x284ea4);return _0x562ffe[_0x0b57('0xf')](0x1f4)['json'](_0x284ea4);}logger[_0x0b57('0x12')]('git\x20fetch');return _0x562ffe[_0x0b57('0xf')](0xc8)[_0x0b57('0x10')]({'output':_0x0b57('0x13')});});};exports[_0x0b57('0x14')]=function(_0x44e939,_0x3626ae){return git[_0x0b57('0x14')]([_0x0b57('0x15'),_0x0b57('0x16')],function(_0x388a15){if(_0x388a15){logger['error'](_0x388a15);return _0x3626ae['status'](0x1f4)[_0x0b57('0x10')](_0x388a15);}logger[_0x0b57('0x12')](_0x0b57('0x17'));return _0x3626ae['status'](0xc8)[_0x0b57('0x10')]({'output':_0x0b57('0x18')});});};exports[_0x0b57('0x19')]=function(_0x20f7cc,_0x174baa){exec('npm\x20install\x20--production',function(_0x334be4,_0x492a5d,_0x46ccba){logger[_0x0b57('0x12')](_0x492a5d);logger['info'](_0x46ccba);if(_0x334be4){logger[_0x0b57('0x1a')](_0x334be4);return _0x174baa[_0x0b57('0xf')](0x1f4)['json'](_0x334be4);}return _0x174baa[_0x0b57('0xf')](0xc8)[_0x0b57('0x10')]({'output':_0x492a5d});});};exports[_0x0b57('0x1b')]=function(_0x5cece5,_0x3d2191){return pm2[_0x0b57('0x1b')](_0x0b57('0x1c'))[_0x0b57('0x1d')](function(_0x760ee8){logger['info'](_0x0b57('0x1e'),_0x760ee8);return _0x3d2191[_0x0b57('0xf')](0xc8)['json']({'output':_0x0b57('0x1f')});})[_0x0b57('0x20')](function(_0xba7f19){logger[_0x0b57('0x1a')](_0xba7f19);return _0x3d2191[_0x0b57('0xf')](0x1f4)[_0x0b57('0x10')](_0xba7f19);});};exports[_0x0b57('0x21')]=function(_0x2acf24,_0x53496e){var _0x3a66c8=fs[_0x0b57('0x22')](path[_0x0b57('0x23')](config['root'],_0x0b57('0x24'),_0x0b57('0x21')));var _0x1dd538=[];for(var _0x497785=0x0;_0x497785<_0x3a66c8[_0x0b57('0x25')];_0x497785++){var _0x3c0efb=_0x3a66c8[_0x497785][_0x0b57('0x26')](_0x0b57('0x27'),'');if(compareVersions(module[_0x0b57('0x9')][_0x0b57('0xa')],_0x3c0efb)===-0x1){_0x1dd538[_0x0b57('0x28')](_0x3c0efb);}}if(_0x1dd538[_0x0b57('0x25')]){var _0x11b33b=_0x1dd538['sort'](compareVersions);var _0x3f5205=new Umzug({'storage':_0x0b57('0x29'),'storageOptions':{'model':db[_0x0b57('0x2a')],'modelName':_0x0b57('0x2a'),'columnName':_0x0b57('0xa')},'migrations':{'params':[db['sequelize'][_0x0b57('0x2b')](),db['sequelize'][_0x0b57('0x2c')],function(){throw new Error(_0x0b57('0x2d'));}],'path':path[_0x0b57('0x23')](config[_0x0b57('0x7')],_0x0b57('0x24'),_0x0b57('0x21')),'pattern':/\.js$/}});_0x3f5205['up']({'migrations':_[_0x0b57('0x2e')](_0x11b33b,function(_0x1e535a){return _0x1e535a+_0x0b57('0x27');})})['then'](function(){return _0x53496e['status'](0xc8)[_0x0b57('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x0b57('0x9')][_0x0b57('0xa')]+_0x0b57('0x2f')+_[_0x0b57('0x30')](_0x11b33b),'migrations':_['join'](_0x11b33b)});})['catch'](function(_0x4d2614){if(_0x4d2614 instanceof db[_0x0b57('0x29')][_0x0b57('0x31')]){return _0x53496e['status'](0xc8)[_0x0b57('0x10')]({'output':_0x0b57('0x32')});}else{return _0x53496e[_0x0b57('0xf')](0x1f4)[_0x0b57('0x10')](_0x4d2614);}});}else{return _0x53496e[_0x0b57('0xf')](0xc8)['json']({'output':_0x0b57('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 3ef4fc4..c4fe67a 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 _0x7046=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x15aef2,_0x51e33f){var _0x8603f5=function(_0x14f47c){while(--_0x14f47c){_0x15aef2['push'](_0x15aef2['shift']());}};_0x8603f5(++_0x51e33f);}(_0x7046,0x144));var _0x6704=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7046[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var auth=require(_0x6704('0x5'));var interaction=require(_0x6704('0x6'));var config=require('../../config/environment');var controller=require(_0x6704('0x7'));router[_0x6704('0x8')]('/',auth[_0x6704('0x9')](),controller[_0x6704('0xa')]);router[_0x6704('0x8')]('/describe',auth[_0x6704('0x9')](),controller['describe']);router['get'](_0x6704('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6704('0xc')]('/',auth[_0x6704('0x9')](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xb'),auth[_0x6704('0x9')](),controller[_0x6704('0xf')]);router[_0x6704('0x10')]('/:id',auth[_0x6704('0x9')](),controller[_0x6704('0x11')]);module['exports']=router; \ No newline at end of file +var _0x583c=['get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./voiceAgentReport.controller'];(function(_0x3e6060,_0x5b31b8){var _0x136dfe=function(_0x58bb26){while(--_0x58bb26){_0x3e6060['push'](_0x3e6060['shift']());}};_0x136dfe(++_0x5b31b8);}(_0x583c,0x12b));var _0xc583=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x583c[_0x53b133];return _0x5647e0;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var auth=require(_0xc583('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc583('0x6'));router[_0xc583('0x7')]('/',auth['isAuthenticated'](),controller[_0xc583('0x8')]);router[_0xc583('0x7')](_0xc583('0x9'),auth[_0xc583('0xa')](),controller['describe']);router[_0xc583('0x7')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xd')]('/',auth[_0xc583('0xa')](),controller[_0xc583('0xe')]);router[_0xc583('0xf')]('/:id',auth[_0xc583('0xa')](),controller[_0xc583('0x10')]);router['delete'](_0xc583('0xb'),auth[_0xc583('0xa')](),controller['destroy']);module[_0xc583('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2e74ede..bae4721 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 _0x9a70=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x551604,_0x52cf0c){var _0x31086b=function(_0x2ba750){while(--_0x2ba750){_0x551604['push'](_0x551604['shift']());}};_0x31086b(++_0x52cf0c);}(_0x9a70,0x98));var _0x09a7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9a70[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x09a7('0x0'));module[_0x09a7('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x09a7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x09a7('0x2')]},'queue':{'type':Sequelize[_0x09a7('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x09a7('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x09a7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x09a7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x09a7('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x09a7('0x4')]},'agentcomplete':{'type':Sequelize[_0x09a7('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x09a7('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x09a7('0x4')]},'agentacw':{'type':Sequelize[_0x09a7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x09a7('0x4')]},'reason':{'type':Sequelize[_0x09a7('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x09a7('0x2')]},'channelstate':{'type':Sequelize[_0x09a7('0x4')]},'channelstatedesc':{'type':Sequelize[_0x09a7('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x09a7('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x09a7('0x2')]},'context':{'type':Sequelize[_0x09a7('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x09a7('0x2')]},'destchannelstate':{'type':Sequelize[_0x09a7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x09a7('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x09a7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x09a7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x09a7('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x09a7('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x09a7('0x2')]},'destpriority':{'type':Sequelize[_0x09a7('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x09a7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x09a7('0x2')]},'transfer':{'type':Sequelize[_0x09a7('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x09a7('0x2')],'comment':_0x09a7('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x09a7('0x2')]},'agententerreason':{'type':Sequelize[_0x09a7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xce7f=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x4ebc7f,_0x42858d){var _0x527e4d=function(_0x2ccdce){while(--_0x2ccdce){_0x4ebc7f['push'](_0x4ebc7f['shift']());}};_0x527e4d(++_0x42858d);}(_0xce7f,0xfc));var _0xfce7=function(_0x1c391b,_0x331dc5){_0x1c391b=_0x1c391b-0x0;var _0x3da0c1=_0xce7f[_0x1c391b];return _0x3da0c1;};'use strict';var Sequelize=require(_0xfce7('0x0'));module[_0xfce7('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfce7('0x2')]},'calleridnum':{'type':Sequelize[_0xfce7('0x2')]},'calleridname':{'type':Sequelize[_0xfce7('0x2')]},'queue':{'type':Sequelize[_0xfce7('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfce7('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xfce7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xfce7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfce7('0x3')]},'agentdumpAt':{'type':Sequelize[_0xfce7('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xfce7('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfce7('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfce7('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfce7('0x5')]},'agentacw':{'type':Sequelize[_0xfce7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfce7('0x2')]},'lastevent':{'type':Sequelize[_0xfce7('0x2')]},'channel':{'type':Sequelize[_0xfce7('0x2')]},'channelstate':{'type':Sequelize[_0xfce7('0x5')]},'channelstatedesc':{'type':Sequelize[_0xfce7('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfce7('0x2')]},'connectedlinename':{'type':Sequelize[_0xfce7('0x2')]},'language':{'type':Sequelize[_0xfce7('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfce7('0x2')]},'exten':{'type':Sequelize[_0xfce7('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xfce7('0x2')]},'destchannelstate':{'type':Sequelize[_0xfce7('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xfce7('0x2')]},'destcalleridnum':{'type':Sequelize[_0xfce7('0x2')]},'destcalleridname':{'type':Sequelize[_0xfce7('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xfce7('0x2')]},'destlanguage':{'type':Sequelize[_0xfce7('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfce7('0x2')]},'destexten':{'type':Sequelize[_0xfce7('0x2')]},'destpriority':{'type':Sequelize[_0xfce7('0x2')]},'destuniqueid':{'type':Sequelize[_0xfce7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfce7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xfce7('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xfce7('0x2')]},'transferuniqueid':{'type':Sequelize[_0xfce7('0x2')]},'agententerreason':{'type':Sequelize[_0xfce7('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 54a398b..1f3a7cd 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 _0x88a5=['zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','VoiceAgentReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf'];(function(_0x499982,_0x315827){var _0x321daa=function(_0x200b16){while(--_0x200b16){_0x499982['push'](_0x499982['shift']());}};_0x321daa(++_0x315827);}(_0x88a5,0x90));var _0x588a=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x88a5[_0x110c3d];return _0x226d67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x588a('0x0'));var rimraf=require(_0x588a('0x1'));var zipdir=require(_0x588a('0x2'));var jsonpatch=require(_0x588a('0x3'));var rp=require(_0x588a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x588a('0x5'));var path=require(_0x588a('0x6'));var sox=require(_0x588a('0x7'));var csv=require('to-csv');var ejs=require(_0x588a('0x8'));var fs=require('fs');var _=require(_0x588a('0x9'));var squel=require(_0x588a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x588a('0xb'));var toCsv=require(_0x588a('0xc'));var querystring=require(_0x588a('0xd'));var Papa=require(_0x588a('0xe'));var Redis=require(_0x588a('0xf'));var authService=require(_0x588a('0x10'));var qs=require(_0x588a('0x11'));var hardwareService=require(_0x588a('0x12'));var logger=require('../../config/logger')(_0x588a('0x13'));var utils=require(_0x588a('0x14'));var config=require(_0x588a('0x15'));var db=require(_0x588a('0x16'))['db'];function respondWithStatusCode(_0x3c61c5,_0x11cda3){_0x11cda3=_0x11cda3||0xcc;return function(_0x548601){if(_0x548601){return _0x3c61c5[_0x588a('0x17')](_0x11cda3);}return _0x3c61c5[_0x588a('0x18')](_0x11cda3)[_0x588a('0x19')]();};}function respondWithResult(_0x44934e,_0x291493){_0x291493=_0x291493||0xc8;return function(_0x48f10c){if(_0x48f10c){return _0x44934e[_0x588a('0x18')](_0x291493)[_0x588a('0x1a')](_0x48f10c);}};}function respondWithFilteredResult(_0x2d8d2f,_0x1610ee){return function(_0x1f47ba){if(_0x1f47ba){var _0x4e8a00=_0x1f47ba['count'],_0x3e6496=_0x1610ee[_0x588a('0x1b')],_0x28ef2d=_0x1610ee[_0x588a('0x1b')]+_0x1610ee[_0x588a('0x1c')],_0x49874f;if(_0x28ef2d>=_0x4e8a00){_0x28ef2d=_0x4e8a00;_0x49874f=0xc8;}else{_0x49874f=0xce;}_0x2d8d2f[_0x588a('0x18')](_0x49874f);return _0x2d8d2f[_0x588a('0x1d')](_0x588a('0x1e'),_0x3e6496+'-'+_0x28ef2d+'/'+_0x4e8a00)[_0x588a('0x1a')](_0x1f47ba);}return null;};}function patchUpdates(_0x19c01b){return function(_0x150b98){try{jsonpatch[_0x588a('0x1f')](_0x150b98,_0x19c01b,!![]);}catch(_0x377ca4){return BPromise[_0x588a('0x20')](_0x377ca4);}return _0x150b98[_0x588a('0x21')]();};}function saveUpdates(_0x15763b,_0x3516b4){return function(_0x3c34fc){if(_0x3c34fc){return _0x3c34fc[_0x588a('0x22')](_0x15763b)[_0x588a('0x23')](function(_0x26bb86){return _0x26bb86;});}return null;};}function removeEntity(_0x5d892e,_0x3971e1){return function(_0x510939){if(_0x510939){return _0x510939[_0x588a('0x24')]()['then'](function(){_0x5d892e[_0x588a('0x18')](0xcc)[_0x588a('0x19')]();});}};}function handleEntityNotFound(_0xeb1f81,_0x44c5b1){return function(_0x2986f2){if(!_0x2986f2){_0xeb1f81[_0x588a('0x17')](0x194);}return _0x2986f2;};}function handleError(_0x154984,_0x576cf6){_0x576cf6=_0x576cf6||0x1f4;return function(_0x16bddf){logger['error'](_0x16bddf[_0x588a('0x25')]);if(_0x16bddf[_0x588a('0x26')]){delete _0x16bddf[_0x588a('0x26')];}_0x154984['status'](_0x576cf6)['send'](_0x16bddf);};}exports[_0x588a('0x27')]=function(_0x2d3ca0,_0x23b59f){var _0x41edc2={},_0x213e3e={},_0x3ae640={'count':0x0,'rows':[]};var _0x48f803=db[_0x588a('0x28')][_0x588a('0x29')];_0x213e3e[_0x588a('0x2a')]=_['keys'](_0x48f803);_0x213e3e[_0x588a('0x2b')]=_['keys'](_0x2d3ca0[_0x588a('0x2b')]);_0x213e3e[_0x588a('0x2c')]=_[_0x588a('0x2d')](_0x213e3e[_0x588a('0x2a')],_0x213e3e[_0x588a('0x2b')]);_0x41edc2[_0x588a('0x2e')]=_[_0x588a('0x2d')](_0x213e3e[_0x588a('0x2a')],qs[_0x588a('0x2f')](_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x2f')]));_0x41edc2[_0x588a('0x2e')]=_0x41edc2[_0x588a('0x2e')][_0x588a('0x30')]?_0x41edc2[_0x588a('0x2e')]:_0x213e3e[_0x588a('0x2a')];if(!_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x31')](_0x588a('0x32'))){_0x41edc2[_0x588a('0x1c')]=qs[_0x588a('0x1c')](_0x2d3ca0[_0x588a('0x2b')]['limit']);_0x41edc2[_0x588a('0x1b')]=qs['offset'](_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x1b')]);}_0x41edc2['order']=qs[_0x588a('0x33')](_0x2d3ca0['query'][_0x588a('0x33')]);_0x41edc2[_0x588a('0x34')]=qs['filters'](_[_0x588a('0x35')](_0x2d3ca0[_0x588a('0x2b')],_0x213e3e[_0x588a('0x2c')]));if(_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x36')]){_0x41edc2[_0x588a('0x34')]=_[_0x588a('0x37')](_0x41edc2['where'],{'$or':_['map'](_0x48f803,function(_0x53db82){if(_0x53db82[_0x588a('0x38')][_0x588a('0x39')]!==_0x588a('0x3a')){var _0x2fa0f6={};_0x2fa0f6[_0x53db82[_0x588a('0x3b')]]={'$like':'%'+_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x36')]+'%'};return _0x2fa0f6;}})});}_0x41edc2=_[_0x588a('0x37')]({},_0x41edc2,_0x2d3ca0[_0x588a('0x3c')]);var _0x328f06={'where':_0x41edc2[_0x588a('0x34')]};return db['VoiceAgentReport'][_0x588a('0x3d')](_0x328f06)['then'](function(_0x20c25b){_0x3ae640[_0x588a('0x3d')]=_0x20c25b;if(_0x2d3ca0[_0x588a('0x2b')][_0x588a('0x3e')]){_0x41edc2[_0x588a('0x3f')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x588a('0x40')](_0x41edc2);})[_0x588a('0x23')](function(_0x1e30af){_0x3ae640['rows']=_0x1e30af;return _0x3ae640;})[_0x588a('0x23')](respondWithFilteredResult(_0x23b59f,_0x41edc2))[_0x588a('0x41')](handleError(_0x23b59f,null));};exports[_0x588a('0x42')]=function(_0x1d474d,_0x4bc7ad){var _0x525591={'raw':![],'where':{'id':_0x1d474d[_0x588a('0x43')]['id']}},_0x5ae9fb={};_0x5ae9fb[_0x588a('0x2a')]=_[_0x588a('0x44')](db[_0x588a('0x28')][_0x588a('0x29')]);_0x5ae9fb[_0x588a('0x2b')]=_['keys'](_0x1d474d[_0x588a('0x2b')]);_0x5ae9fb['filters']=_[_0x588a('0x2d')](_0x5ae9fb[_0x588a('0x2a')],_0x5ae9fb[_0x588a('0x2b')]);_0x525591['attributes']=_['intersection'](_0x5ae9fb[_0x588a('0x2a')],qs['fields'](_0x1d474d[_0x588a('0x2b')]['fields']));_0x525591[_0x588a('0x2e')]=_0x525591[_0x588a('0x2e')][_0x588a('0x30')]?_0x525591[_0x588a('0x2e')]:_0x5ae9fb[_0x588a('0x2a')];if(_0x1d474d[_0x588a('0x2b')]['includeAll']){_0x525591[_0x588a('0x3f')]=[{'all':!![]}];}_0x525591=_[_0x588a('0x37')]({},_0x525591,_0x1d474d[_0x588a('0x3c')]);return db[_0x588a('0x28')][_0x588a('0x45')](_0x525591)[_0x588a('0x23')](handleEntityNotFound(_0x4bc7ad,null))[_0x588a('0x23')](respondWithResult(_0x4bc7ad,null))[_0x588a('0x41')](handleError(_0x4bc7ad,null));};exports[_0x588a('0x46')]=function(_0x34ac63,_0x1ef45b){return db['VoiceAgentReport']['create'](_0x34ac63[_0x588a('0x47')],{})['then'](respondWithResult(_0x1ef45b,0xc9))[_0x588a('0x41')](handleError(_0x1ef45b,null));};exports['update']=function(_0x5c7e1f,_0xc58c21){if(_0x5c7e1f['body']['id']){delete _0x5c7e1f[_0x588a('0x47')]['id'];}return db[_0x588a('0x28')]['find']({'where':{'id':_0x5c7e1f['params']['id']}})[_0x588a('0x23')](handleEntityNotFound(_0xc58c21,null))[_0x588a('0x23')](saveUpdates(_0x5c7e1f[_0x588a('0x47')],null))['then'](respondWithResult(_0xc58c21,null))[_0x588a('0x41')](handleError(_0xc58c21,null));};exports[_0x588a('0x24')]=function(_0x533649,_0x350efc){return db[_0x588a('0x28')]['find']({'where':{'id':_0x533649['params']['id']}})['then'](handleEntityNotFound(_0x350efc,null))[_0x588a('0x23')](removeEntity(_0x350efc,null))[_0x588a('0x41')](handleError(_0x350efc,null));};exports[_0x588a('0x48')]=function(_0x541830,_0x4a081e){return db[_0x588a('0x28')][_0x588a('0x48')]()['then'](respondWithResult(_0x4a081e,null))[_0x588a('0x41')](handleError(_0x4a081e,null));}; \ No newline at end of file +var _0x5cc6=['set','apply','reject','save','update','then','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','options','include','findAll','catch','params','includeAll','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit'];(function(_0x306d8e,_0x178242){var _0x29a343=function(_0x35adc3){while(--_0x35adc3){_0x306d8e['push'](_0x306d8e['shift']());}};_0x29a343(++_0x178242);}(_0x5cc6,0x6e));var _0x65cc=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x5cc6[_0x349367];return _0x14179b;};'use strict';var pdf=require(_0x65cc('0x0'));var emlformat=require(_0x65cc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x65cc('0x2'));var rp=require(_0x65cc('0x3'));var moment=require(_0x65cc('0x4'));var BPromise=require(_0x65cc('0x5'));var Mustache=require(_0x65cc('0x6'));var util=require(_0x65cc('0x7'));var path=require(_0x65cc('0x8'));var sox=require(_0x65cc('0x9'));var csv=require(_0x65cc('0xa'));var ejs=require(_0x65cc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65cc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x65cc('0xd'));var toCsv=require(_0x65cc('0xa'));var querystring=require(_0x65cc('0xe'));var Papa=require(_0x65cc('0xf'));var Redis=require(_0x65cc('0x10'));var authService=require(_0x65cc('0x11'));var qs=require(_0x65cc('0x12'));var hardwareService=require(_0x65cc('0x13'));var logger=require(_0x65cc('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x65cc('0x15'));var db=require(_0x65cc('0x16'))['db'];function respondWithStatusCode(_0x412529,_0x3619ea){_0x3619ea=_0x3619ea||0xcc;return function(_0x47fa60){if(_0x47fa60){return _0x412529[_0x65cc('0x17')](_0x3619ea);}return _0x412529['status'](_0x3619ea)[_0x65cc('0x18')]();};}function respondWithResult(_0x2192a0,_0x1e7ecd){_0x1e7ecd=_0x1e7ecd||0xc8;return function(_0x21cae9){if(_0x21cae9){return _0x2192a0[_0x65cc('0x19')](_0x1e7ecd)[_0x65cc('0x1a')](_0x21cae9);}};}function respondWithFilteredResult(_0x3d4a2e,_0x431dd3){return function(_0x4224f3){if(_0x4224f3){var _0x3c4388=_0x4224f3[_0x65cc('0x1b')],_0x2ce7a5=_0x431dd3[_0x65cc('0x1c')],_0x114451=_0x431dd3[_0x65cc('0x1c')]+_0x431dd3[_0x65cc('0x1d')],_0x32ce5f;if(_0x114451>=_0x3c4388){_0x114451=_0x3c4388;_0x32ce5f=0xc8;}else{_0x32ce5f=0xce;}_0x3d4a2e[_0x65cc('0x19')](_0x32ce5f);return _0x3d4a2e[_0x65cc('0x1e')]('Content-Range',_0x2ce7a5+'-'+_0x114451+'/'+_0x3c4388)[_0x65cc('0x1a')](_0x4224f3);}return null;};}function patchUpdates(_0x92301){return function(_0x4b0abc){try{jsonpatch[_0x65cc('0x1f')](_0x4b0abc,_0x92301,!![]);}catch(_0x9cf858){return BPromise[_0x65cc('0x20')](_0x9cf858);}return _0x4b0abc[_0x65cc('0x21')]();};}function saveUpdates(_0x124350,_0x15a44b){return function(_0x3e2193){if(_0x3e2193){return _0x3e2193[_0x65cc('0x22')](_0x124350)[_0x65cc('0x23')](function(_0x20cece){return _0x20cece;});}return null;};}function removeEntity(_0x2245e4,_0x3181cf){return function(_0xcf1d8a){if(_0xcf1d8a){return _0xcf1d8a['destroy']()[_0x65cc('0x23')](function(){_0x2245e4['status'](0xcc)[_0x65cc('0x18')]();});}};}function handleEntityNotFound(_0x2a248b,_0x2f5263){return function(_0x52cb4c){if(!_0x52cb4c){_0x2a248b['sendStatus'](0x194);}return _0x52cb4c;};}function handleError(_0x419ded,_0x2aad62){_0x2aad62=_0x2aad62||0x1f4;return function(_0x131698){logger[_0x65cc('0x24')](_0x131698[_0x65cc('0x25')]);if(_0x131698['name']){delete _0x131698[_0x65cc('0x26')];}_0x419ded[_0x65cc('0x19')](_0x2aad62)[_0x65cc('0x27')](_0x131698);};}exports[_0x65cc('0x28')]=function(_0x5aab3a,_0x48cbb1){var _0x4113ee={},_0x25d5c1={},_0x939015={'count':0x0,'rows':[]};var _0x31383b=db[_0x65cc('0x29')][_0x65cc('0x2a')];_0x25d5c1[_0x65cc('0x2b')]=_[_0x65cc('0x2c')](_0x31383b);_0x25d5c1[_0x65cc('0x2d')]=_['keys'](_0x5aab3a[_0x65cc('0x2d')]);_0x25d5c1[_0x65cc('0x2e')]=_[_0x65cc('0x2f')](_0x25d5c1[_0x65cc('0x2b')],_0x25d5c1[_0x65cc('0x2d')]);_0x4113ee['attributes']=_[_0x65cc('0x2f')](_0x25d5c1['model'],qs[_0x65cc('0x30')](_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x30')]));_0x4113ee[_0x65cc('0x31')]=_0x4113ee[_0x65cc('0x31')][_0x65cc('0x32')]?_0x4113ee[_0x65cc('0x31')]:_0x25d5c1['model'];if(!_0x5aab3a['query'][_0x65cc('0x33')](_0x65cc('0x34'))){_0x4113ee[_0x65cc('0x1d')]=qs[_0x65cc('0x1d')](_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x1d')]);_0x4113ee[_0x65cc('0x1c')]=qs['offset'](_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x1c')]);}_0x4113ee['order']=qs[_0x65cc('0x35')](_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x35')]);_0x4113ee[_0x65cc('0x36')]=qs['filters'](_[_0x65cc('0x37')](_0x5aab3a[_0x65cc('0x2d')],_0x25d5c1[_0x65cc('0x2e')]));if(_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x38')]){_0x4113ee[_0x65cc('0x36')]=_[_0x65cc('0x39')](_0x4113ee[_0x65cc('0x36')],{'$or':_[_0x65cc('0x3a')](_0x31383b,function(_0x5ec912){if(_0x5ec912[_0x65cc('0x3b')][_0x65cc('0x3c')]!=='VIRTUAL'){var _0x17f552={};_0x17f552[_0x5ec912['field']]={'$like':'%'+_0x5aab3a[_0x65cc('0x2d')][_0x65cc('0x38')]+'%'};return _0x17f552;}})});}_0x4113ee=_[_0x65cc('0x39')]({},_0x4113ee,_0x5aab3a[_0x65cc('0x3d')]);var _0x39d514={'where':_0x4113ee[_0x65cc('0x36')]};return db[_0x65cc('0x29')][_0x65cc('0x1b')](_0x39d514)[_0x65cc('0x23')](function(_0x4a6da7){_0x939015[_0x65cc('0x1b')]=_0x4a6da7;if(_0x5aab3a[_0x65cc('0x2d')]['includeAll']){_0x4113ee[_0x65cc('0x3e')]=[{'all':!![]}];}return db[_0x65cc('0x29')][_0x65cc('0x3f')](_0x4113ee);})['then'](function(_0x489e14){_0x939015['rows']=_0x489e14;return _0x939015;})['then'](respondWithFilteredResult(_0x48cbb1,_0x4113ee))[_0x65cc('0x40')](handleError(_0x48cbb1,null));};exports['show']=function(_0x1d8a63,_0x21d52f){var _0x43b616={'raw':![],'where':{'id':_0x1d8a63[_0x65cc('0x41')]['id']}},_0x1c946a={};_0x1c946a[_0x65cc('0x2b')]=_['keys'](db['VoiceAgentReport'][_0x65cc('0x2a')]);_0x1c946a[_0x65cc('0x2d')]=_[_0x65cc('0x2c')](_0x1d8a63[_0x65cc('0x2d')]);_0x1c946a[_0x65cc('0x2e')]=_[_0x65cc('0x2f')](_0x1c946a[_0x65cc('0x2b')],_0x1c946a[_0x65cc('0x2d')]);_0x43b616[_0x65cc('0x31')]=_[_0x65cc('0x2f')](_0x1c946a['model'],qs[_0x65cc('0x30')](_0x1d8a63[_0x65cc('0x2d')]['fields']));_0x43b616[_0x65cc('0x31')]=_0x43b616['attributes']['length']?_0x43b616[_0x65cc('0x31')]:_0x1c946a['model'];if(_0x1d8a63[_0x65cc('0x2d')][_0x65cc('0x42')]){_0x43b616['include']=[{'all':!![]}];}_0x43b616=_[_0x65cc('0x39')]({},_0x43b616,_0x1d8a63[_0x65cc('0x3d')]);return db[_0x65cc('0x29')][_0x65cc('0x43')](_0x43b616)[_0x65cc('0x23')](handleEntityNotFound(_0x21d52f,null))['then'](respondWithResult(_0x21d52f,null))[_0x65cc('0x40')](handleError(_0x21d52f,null));};exports[_0x65cc('0x44')]=function(_0x1a8cc6,_0x266490){return db[_0x65cc('0x29')]['create'](_0x1a8cc6[_0x65cc('0x45')],{})['then'](respondWithResult(_0x266490,0xc9))[_0x65cc('0x40')](handleError(_0x266490,null));};exports['update']=function(_0x49c139,_0x182285){if(_0x49c139[_0x65cc('0x45')]['id']){delete _0x49c139[_0x65cc('0x45')]['id'];}return db[_0x65cc('0x29')][_0x65cc('0x43')]({'where':{'id':_0x49c139[_0x65cc('0x41')]['id']}})[_0x65cc('0x23')](handleEntityNotFound(_0x182285,null))[_0x65cc('0x23')](saveUpdates(_0x49c139[_0x65cc('0x45')],null))['then'](respondWithResult(_0x182285,null))[_0x65cc('0x40')](handleError(_0x182285,null));};exports['destroy']=function(_0x3825d6,_0x395c3b){return db[_0x65cc('0x29')][_0x65cc('0x43')]({'where':{'id':_0x3825d6[_0x65cc('0x41')]['id']}})[_0x65cc('0x23')](handleEntityNotFound(_0x395c3b,null))[_0x65cc('0x23')](removeEntity(_0x395c3b,null))[_0x65cc('0x40')](handleError(_0x395c3b,null));};exports['describe']=function(_0x5c0ec1,_0x293781){return db[_0x65cc('0x29')]['describe']()['then'](respondWithResult(_0x293781,null))[_0x65cc('0x40')](handleError(_0x293781,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 2a1770b..a30b2d3 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 _0xa6ab=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f0df7,_0x5f3f53){var _0x1bbabf=function(_0x197d15){while(--_0x197d15){_0x5f0df7['push'](_0x5f0df7['shift']());}};_0x1bbabf(++_0x5f3f53);}(_0xa6ab,0x1b5));var _0xba6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa6ab[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xba6a('0x0'));var logger=require('../../config/logger')(_0xba6a('0x1'));var moment=require(_0xba6a('0x2'));var BPromise=require(_0xba6a('0x3'));var rp=require(_0xba6a('0x4'));var fs=require('fs');var path=require(_0xba6a('0x5'));var rimraf=require(_0xba6a('0x6'));var config=require('../../config/environment');var attributes=require(_0xba6a('0x7'));module[_0xba6a('0x8')]=function(_0x49f092,_0x4e7960){return _0x49f092[_0xba6a('0x9')](_0xba6a('0xa'),attributes,{'tableName':_0xba6a('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa29=['define','report_agent','destuniqueid','util','bluebird','request-promise','path'];(function(_0x352b7c,_0xf3c28b){var _0x2f96ff=function(_0x393352){while(--_0x393352){_0x352b7c['push'](_0x352b7c['shift']());}};_0x2f96ff(++_0xf3c28b);}(_0xaa29,0x130));var _0x9aa2=function(_0x19d95e,_0x42ab2b){_0x19d95e=_0x19d95e-0x0;var _0x4e94ea=_0xaa29[_0x19d95e];return _0x4e94ea;};'use strict';var _=require('lodash');var util=require(_0x9aa2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9aa2('0x1'));var rp=require(_0x9aa2('0x2'));var fs=require('fs');var path=require(_0x9aa2('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x5214c1,_0x2b01aa){return _0x5214c1[_0x9aa2('0x4')]('VoiceAgentReport',attributes,{'tableName':_0x9aa2('0x5'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x9aa2('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 61393ea..1575e63 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0x814b,0x1a2));var _0xb814=function(_0x3d5db9,_0x2dbe0a){_0x3d5db9=_0x3d5db9-0x0;var _0x3c114c=_0x814b[_0x3d5db9];return _0x3c114c;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x11266c,_0x4e8a6d){var _0x219cf4=function(_0x4d97df){while(--_0x4d97df){_0x11266c['push'](_0x11266c['shift']());}};_0x219cf4(++_0x4e8a6d);}(_0x7a54,0x106));var _0x47a5=function(_0x350853,_0x73f194){_0x350853=_0x350853-0x0;var _0x2a2f8c=_0x7a54[_0x350853];return _0x2a2f8c;};'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')]('VoiceAgentReport,\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['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4276baf..ab96a8f 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 _0x206e=['destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x315fd6,_0xb0ee78){var _0x2b9569=function(_0x519bb7){while(--_0x519bb7){_0x315fd6['push'](_0x315fd6['shift']());}};_0x2b9569(++_0xb0ee78);}(_0x206e,0x11f));var _0xe206=function(_0xddeac9,_0x2ebf8c){_0xddeac9=_0xddeac9-0x0;var _0x65fa72=_0x206e[_0xddeac9];return _0x65fa72;};'use strict';var multer=require('multer');var util=require(_0xe206('0x0'));var path=require(_0xe206('0x1'));var timeout=require(_0xe206('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe206('0x3'));var config=require(_0xe206('0x4'));var controller=require(_0xe206('0x5'));router[_0xe206('0x6')]('/',auth[_0xe206('0x7')](),controller[_0xe206('0x8')]);router['get'](_0xe206('0x9'),auth[_0xe206('0x7')](),controller[_0xe206('0xa')]);router['get'](_0xe206('0xb'),auth[_0xe206('0x7')](),controller['show']);router[_0xe206('0xc')]('/',auth['isAuthenticated'](),controller[_0xe206('0xd')]);router[_0xe206('0xe')](_0xe206('0xb'),auth[_0xe206('0x7')](),controller[_0xe206('0xf')]);router[_0xe206('0x10')]('/:id',auth[_0xe206('0x7')](),controller[_0xe206('0x11')]);module[_0xe206('0x12')]=router; \ No newline at end of file +var _0x331f=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','index','get','describe'];(function(_0x4da7df,_0x2b8457){var _0x44f9e1=function(_0x2b5cd6){while(--_0x2b5cd6){_0x4da7df['push'](_0x4da7df['shift']());}};_0x44f9e1(++_0x2b8457);}(_0x331f,0xaa));var _0xf331=function(_0x13677c,_0x319e61){_0x13677c=_0x13677c-0x0;var _0x2614e7=_0x331f[_0x13677c];return _0x2614e7;};'use strict';var multer=require(_0xf331('0x0'));var util=require(_0xf331('0x1'));var path=require(_0xf331('0x2'));var timeout=require(_0xf331('0x3'));var express=require('express');var router=express[_0xf331('0x4')]();var auth=require(_0xf331('0x5'));var interaction=require(_0xf331('0x6'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf331('0x7')]);router[_0xf331('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf331('0x9')]);router[_0xf331('0x8')](_0xf331('0xa'),auth[_0xf331('0xb')](),controller[_0xf331('0xc')]);router[_0xf331('0xd')]('/',auth[_0xf331('0xb')](),controller[_0xf331('0xe')]);router[_0xf331('0xf')]('/:id',auth[_0xf331('0xb')](),controller[_0xf331('0x10')]);router[_0xf331('0x11')](_0xf331('0xa'),auth[_0xf331('0xb')](),controller[_0xf331('0x12')]);module[_0xf331('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 000d584..1b00b01 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 _0x2f75=['exports','STRING','ENUM','internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x401f77,_0x197858){var _0x417575=function(_0x20f324){while(--_0x20f324){_0x401f77['push'](_0x401f77['shift']());}};_0x417575(++_0x197858);}(_0x2f75,0x133));var _0x52f7=function(_0x69e59c,_0x49f799){_0x69e59c=_0x69e59c-0x0;var _0x4fd3c3=_0x2f75[_0x69e59c];return _0x4fd3c3;};'use strict';var Sequelize=require(_0x52f7('0x0'));module[_0x52f7('0x1')]={'uniqueid':{'type':Sequelize[_0x52f7('0x2')]},'type':{'type':Sequelize[_0x52f7('0x3')]('inbound',_0x52f7('0x4'),_0x52f7('0x5'),'inbound-fax',_0x52f7('0x6'),_0x52f7('0x7'))},'tag':{'type':Sequelize[_0x52f7('0x2')]},'accountcode':{'type':Sequelize[_0x52f7('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x52f7('0x2')]},'destinationcontext':{'type':Sequelize[_0x52f7('0x2')]},'callerid':{'type':Sequelize[_0x52f7('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x52f7('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x52f7('0x8')]},'starttime':{'type':Sequelize[_0x52f7('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x52f7('0x9')]},'endtime':{'type':Sequelize[_0x52f7('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x52f7('0xa')]},'mohtime':{'type':Sequelize[_0x52f7('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x52f7('0x2')]},'amaflags':{'type':Sequelize[_0x52f7('0x2')]},'userfield':{'type':Sequelize[_0x52f7('0x2')]},'userDisposition':{'type':Sequelize[_0x52f7('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x52f7('0x2')]},'routeid':{'type':Sequelize[_0x52f7('0xa')]},'sipcallid':{'type':Sequelize[_0x52f7('0x2')]}}; \ No newline at end of file +var _0xdd4b=['INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','DATE'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xdd4b,0x177));var _0xbdd4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdd4b[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0xbdd4('0x0')]={'uniqueid':{'type':Sequelize[_0xbdd4('0x1')]},'type':{'type':Sequelize[_0xbdd4('0x2')](_0xbdd4('0x3'),_0xbdd4('0x4'),_0xbdd4('0x5'),_0xbdd4('0x6'),_0xbdd4('0x7'),_0xbdd4('0x8'))},'tag':{'type':Sequelize[_0xbdd4('0x1')]},'accountcode':{'type':Sequelize[_0xbdd4('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xbdd4('0x1')]},'destinationcontext':{'type':Sequelize[_0xbdd4('0x1')]},'callerid':{'type':Sequelize[_0xbdd4('0x1')]},'channel':{'type':Sequelize[_0xbdd4('0x1')]},'destinationchannel':{'type':Sequelize[_0xbdd4('0x1')]},'lastapplication':{'type':Sequelize[_0xbdd4('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xbdd4('0x9')]},'systemanswertime':{'type':Sequelize[_0xbdd4('0x9')]},'answertime':{'type':Sequelize[_0xbdd4('0x9')]},'endtime':{'type':Sequelize[_0xbdd4('0x9')]},'duration':{'type':Sequelize[_0xbdd4('0xa')]},'billableseconds':{'type':Sequelize[_0xbdd4('0xa')]},'mohtime':{'type':Sequelize[_0xbdd4('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbdd4('0x1')]},'amaflags':{'type':Sequelize[_0xbdd4('0x1')]},'userfield':{'type':Sequelize[_0xbdd4('0x1')]},'userDisposition':{'type':Sequelize[_0xbdd4('0x1')]},'note':{'type':Sequelize[_0xbdd4('0x1')]},'prefix':{'type':Sequelize[_0xbdd4('0x1')]},'routeid':{'type':Sequelize[_0xbdd4('0xa')]},'sipcallid':{'type':Sequelize[_0xbdd4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index dfa1d12..7295568 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 _0xc61d=['includeAll','include','fullname','alias','User','findAll','rows','show','params','rawAttributes','find','create','body','catch','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','save','update','destroy','error','stack','name','send','VoiceCallReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','count','then'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc61d,0xfb));var _0xdc61=function(_0xf86505,_0x33a05a){_0xf86505=_0xf86505-0x0;var _0x5290bf=_0xc61d[_0xf86505];return _0x5290bf;};'use strict';var pdf=require(_0xdc61('0x0'));var emlformat=require(_0xdc61('0x1'));var rimraf=require(_0xdc61('0x2'));var zipdir=require(_0xdc61('0x3'));var jsonpatch=require(_0xdc61('0x4'));var rp=require(_0xdc61('0x5'));var moment=require('moment');var BPromise=require(_0xdc61('0x6'));var Mustache=require(_0xdc61('0x7'));var util=require('util');var path=require(_0xdc61('0x8'));var sox=require(_0xdc61('0x9'));var csv=require(_0xdc61('0xa'));var ejs=require(_0xdc61('0xb'));var fs=require('fs');var _=require(_0xdc61('0xc'));var squel=require(_0xdc61('0xd'));var crypto=require(_0xdc61('0xe'));var jsforce=require(_0xdc61('0xf'));var deskjs=require(_0xdc61('0x10'));var toCsv=require(_0xdc61('0xa'));var querystring=require('querystring');var Papa=require(_0xdc61('0x11'));var Redis=require(_0xdc61('0x12'));var authService=require(_0xdc61('0x13'));var qs=require(_0xdc61('0x14'));var hardwareService=require(_0xdc61('0x15'));var logger=require('../../config/logger')(_0xdc61('0x16'));var utils=require('../../config/utils');var config=require(_0xdc61('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4649d2,_0x43cb27){_0x43cb27=_0x43cb27||0xcc;return function(_0x1bb2f2){if(_0x1bb2f2){return _0x4649d2[_0xdc61('0x18')](_0x43cb27);}return _0x4649d2[_0xdc61('0x19')](_0x43cb27)['end']();};}function respondWithResult(_0xbff332,_0x12c270){_0x12c270=_0x12c270||0xc8;return function(_0x5274b8){if(_0x5274b8){return _0xbff332[_0xdc61('0x19')](_0x12c270)[_0xdc61('0x1a')](_0x5274b8);}};}function respondWithFilteredResult(_0x42798c,_0x386b7f){return function(_0x4117f8){if(_0x4117f8){var _0x145183=_0x4117f8['count'],_0x45e810=_0x386b7f[_0xdc61('0x1b')],_0x191d06=_0x386b7f[_0xdc61('0x1b')]+_0x386b7f[_0xdc61('0x1c')],_0x2805d0;if(_0x191d06>=_0x145183){_0x191d06=_0x145183;_0x2805d0=0xc8;}else{_0x2805d0=0xce;}_0x42798c[_0xdc61('0x19')](_0x2805d0);return _0x42798c[_0xdc61('0x1d')](_0xdc61('0x1e'),_0x45e810+'-'+_0x191d06+'/'+_0x145183)[_0xdc61('0x1a')](_0x4117f8);}return null;};}function patchUpdates(_0x5dbe97){return function(_0x49354d){try{jsonpatch['apply'](_0x49354d,_0x5dbe97,!![]);}catch(_0x17120b){return BPromise['reject'](_0x17120b);}return _0x49354d[_0xdc61('0x1f')]();};}function saveUpdates(_0x387f9a,_0xf9aa4e){return function(_0x117d13){if(_0x117d13){return _0x117d13[_0xdc61('0x20')](_0x387f9a)['then'](function(_0x2c687d){return _0x2c687d;});}return null;};}function removeEntity(_0x39faf4,_0x338952){return function(_0x36548c){if(_0x36548c){return _0x36548c[_0xdc61('0x21')]()['then'](function(){_0x39faf4[_0xdc61('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53cad0,_0x4e9956){return function(_0x42a52a){if(!_0x42a52a){_0x53cad0[_0xdc61('0x18')](0x194);}return _0x42a52a;};}function handleError(_0x495dae,_0x230d58){_0x230d58=_0x230d58||0x1f4;return function(_0x2c4b9a){logger[_0xdc61('0x22')](_0x2c4b9a[_0xdc61('0x23')]);if(_0x2c4b9a[_0xdc61('0x24')]){delete _0x2c4b9a[_0xdc61('0x24')];}_0x495dae[_0xdc61('0x19')](_0x230d58)[_0xdc61('0x25')](_0x2c4b9a);};}exports['index']=function(_0x434095,_0x29e839){var _0x3988ec={},_0x8977d2={},_0x27109a={'count':0x0,'rows':[]};var _0x5c9006=db[_0xdc61('0x26')]['rawAttributes'];_0x8977d2[_0xdc61('0x27')]=_[_0xdc61('0x28')](_0x5c9006);_0x8977d2[_0xdc61('0x29')]=_[_0xdc61('0x28')](_0x434095['query']);_0x8977d2[_0xdc61('0x2a')]=_[_0xdc61('0x2b')](_0x8977d2[_0xdc61('0x27')],_0x8977d2['query']);_0x3988ec[_0xdc61('0x2c')]=_[_0xdc61('0x2b')](_0x8977d2['model'],qs[_0xdc61('0x2d')](_0x434095[_0xdc61('0x29')][_0xdc61('0x2d')]));_0x3988ec[_0xdc61('0x2c')]=_0x3988ec[_0xdc61('0x2c')][_0xdc61('0x2e')]?_0x3988ec[_0xdc61('0x2c')]:_0x8977d2['model'];if(!_0x434095[_0xdc61('0x29')]['hasOwnProperty'](_0xdc61('0x2f'))){_0x3988ec[_0xdc61('0x1c')]=qs[_0xdc61('0x1c')](_0x434095[_0xdc61('0x29')][_0xdc61('0x1c')]);_0x3988ec[_0xdc61('0x1b')]=qs[_0xdc61('0x1b')](_0x434095['query'][_0xdc61('0x1b')]);}_0x3988ec[_0xdc61('0x30')]=qs[_0xdc61('0x31')](_0x434095[_0xdc61('0x29')][_0xdc61('0x31')]);_0x3988ec['where']=qs[_0xdc61('0x2a')](_[_0xdc61('0x32')](_0x434095[_0xdc61('0x29')],_0x8977d2['filters']));if(_0x434095[_0xdc61('0x29')][_0xdc61('0x33')]){_0x3988ec[_0xdc61('0x34')]=_[_0xdc61('0x35')](_0x3988ec[_0xdc61('0x34')],{'$or':_[_0xdc61('0x36')](_0x5c9006,function(_0x45d9aa){if(_0x45d9aa[_0xdc61('0x37')][_0xdc61('0x38')]!=='VIRTUAL'){var _0x6d8ae9={};_0x6d8ae9[_0x45d9aa[_0xdc61('0x39')]]={'$like':'%'+_0x434095[_0xdc61('0x29')]['filter']+'%'};return _0x6d8ae9;}})});}_0x3988ec=_[_0xdc61('0x35')]({},_0x3988ec,_0x434095[_0xdc61('0x3a')]);var _0x42970a={'where':_0x3988ec['where']};return db['VoiceCallReport'][_0xdc61('0x3b')](_0x42970a)[_0xdc61('0x3c')](function(_0x5dc8d0){_0x27109a['count']=_0x5dc8d0;if(_0x434095[_0xdc61('0x29')][_0xdc61('0x3d')]){_0x3988ec[_0xdc61('0x3e')]=[{'attributes':['id','name',_0xdc61('0x3f'),_0xdc61('0x40')],'model':db[_0xdc61('0x41')],'as':_0xdc61('0x41')}];}return db['VoiceCallReport'][_0xdc61('0x42')](_0x3988ec);})[_0xdc61('0x3c')](function(_0x116159){_0x27109a[_0xdc61('0x43')]=_0x116159;return _0x27109a;})[_0xdc61('0x3c')](respondWithFilteredResult(_0x29e839,_0x3988ec))['catch'](handleError(_0x29e839,null));};exports[_0xdc61('0x44')]=function(_0x2998fe,_0x2d7f9f){var _0x503611={'raw':!![],'where':{'id':_0x2998fe[_0xdc61('0x45')]['id']}},_0x51cd6d={};_0x51cd6d[_0xdc61('0x27')]=_[_0xdc61('0x28')](db[_0xdc61('0x26')][_0xdc61('0x46')]);_0x51cd6d[_0xdc61('0x29')]=_[_0xdc61('0x28')](_0x2998fe[_0xdc61('0x29')]);_0x51cd6d['filters']=_[_0xdc61('0x2b')](_0x51cd6d[_0xdc61('0x27')],_0x51cd6d[_0xdc61('0x29')]);_0x503611[_0xdc61('0x2c')]=_['intersection'](_0x51cd6d[_0xdc61('0x27')],qs[_0xdc61('0x2d')](_0x2998fe[_0xdc61('0x29')]['fields']));_0x503611[_0xdc61('0x2c')]=_0x503611[_0xdc61('0x2c')][_0xdc61('0x2e')]?_0x503611[_0xdc61('0x2c')]:_0x51cd6d[_0xdc61('0x27')];if(_0x2998fe[_0xdc61('0x29')]['includeAll']){_0x503611[_0xdc61('0x3e')]=[{'all':!![]}];}_0x503611=_[_0xdc61('0x35')]({},_0x503611,_0x2998fe[_0xdc61('0x3a')]);return db[_0xdc61('0x26')][_0xdc61('0x47')](_0x503611)['then'](handleEntityNotFound(_0x2d7f9f,null))['then'](respondWithResult(_0x2d7f9f,null))['catch'](handleError(_0x2d7f9f,null));};exports[_0xdc61('0x48')]=function(_0x489176,_0x5271ef){return db['VoiceCallReport']['create'](_0x489176[_0xdc61('0x49')],{})[_0xdc61('0x3c')](respondWithResult(_0x5271ef,0xc9))[_0xdc61('0x4a')](handleError(_0x5271ef,null));};exports[_0xdc61('0x21')]=function(_0x2d9f8a,_0x45d420){return db[_0xdc61('0x26')]['find']({'where':{'id':_0x2d9f8a[_0xdc61('0x45')]['id']}})[_0xdc61('0x3c')](handleEntityNotFound(_0x45d420,null))[_0xdc61('0x3c')](removeEntity(_0x45d420,null))[_0xdc61('0x4a')](handleError(_0x45d420,null));};exports[_0xdc61('0x4b')]=function(_0x4c9266,_0x21c6e5){return db[_0xdc61('0x26')]['describe']()['then'](respondWithResult(_0x21c6e5,null))[_0xdc61('0x4a')](handleError(_0x21c6e5,null));};exports[_0xdc61('0x20')]=function(_0x1319fe,_0x5c0203){if(_0x1319fe[_0xdc61('0x49')][_0xdc61('0x4c')]){delete _0x1319fe[_0xdc61('0x49')]['uniqueid'];}return db['VoiceCallReport'][_0xdc61('0x47')]({'where':{'uniqueid':_0x1319fe['params']['id'],'UserId':{'$or':[null,_0x1319fe[_0xdc61('0x4d')]['id']]}}})['then'](handleEntityNotFound(_0x5c0203,null))['then'](saveUpdates(_0x1319fe[_0xdc61('0x49')],null))[_0xdc61('0x3c')](respondWithResult(_0x5c0203,null))[_0xdc61('0x4a')](handleError(_0x5c0203,null));}; \ No newline at end of file +var _0x7278=['query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','fullname','alias','User','findAll','catch','show','params','rawAttributes','intersection','create','body','describe','uniqueid','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceCallReport','model','keys'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0x7278,0x161));var _0x8727=function(_0x20cc7b,_0x337741){_0x20cc7b=_0x20cc7b-0x0;var _0x1c17a8=_0x7278[_0x20cc7b];return _0x1c17a8;};'use strict';var pdf=require(_0x8727('0x0'));var emlformat=require(_0x8727('0x1'));var rimraf=require(_0x8727('0x2'));var zipdir=require(_0x8727('0x3'));var jsonpatch=require(_0x8727('0x4'));var rp=require('request-promise');var moment=require(_0x8727('0x5'));var BPromise=require(_0x8727('0x6'));var Mustache=require(_0x8727('0x7'));var util=require(_0x8727('0x8'));var path=require(_0x8727('0x9'));var sox=require(_0x8727('0xa'));var csv=require(_0x8727('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var authService=require(_0x8727('0x12'));var qs=require(_0x8727('0x13'));var hardwareService=require(_0x8727('0x14'));var logger=require(_0x8727('0x15'))(_0x8727('0x16'));var utils=require(_0x8727('0x17'));var config=require(_0x8727('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c382d,_0x2d9d47){_0x2d9d47=_0x2d9d47||0xcc;return function(_0x176389){if(_0x176389){return _0x2c382d['sendStatus'](_0x2d9d47);}return _0x2c382d[_0x8727('0x19')](_0x2d9d47)[_0x8727('0x1a')]();};}function respondWithResult(_0x58e6f3,_0xbcde13){_0xbcde13=_0xbcde13||0xc8;return function(_0x3aa1b){if(_0x3aa1b){return _0x58e6f3[_0x8727('0x19')](_0xbcde13)[_0x8727('0x1b')](_0x3aa1b);}};}function respondWithFilteredResult(_0x2ea789,_0x3d84db){return function(_0x3865e9){if(_0x3865e9){var _0x1916f7=_0x3865e9[_0x8727('0x1c')],_0x11c828=_0x3d84db[_0x8727('0x1d')],_0x88857c=_0x3d84db[_0x8727('0x1d')]+_0x3d84db[_0x8727('0x1e')],_0x4842a0;if(_0x88857c>=_0x1916f7){_0x88857c=_0x1916f7;_0x4842a0=0xc8;}else{_0x4842a0=0xce;}_0x2ea789[_0x8727('0x19')](_0x4842a0);return _0x2ea789[_0x8727('0x1f')]('Content-Range',_0x11c828+'-'+_0x88857c+'/'+_0x1916f7)['json'](_0x3865e9);}return null;};}function patchUpdates(_0x1a90ed){return function(_0x4a0a7d){try{jsonpatch[_0x8727('0x20')](_0x4a0a7d,_0x1a90ed,!![]);}catch(_0xfd266f){return BPromise[_0x8727('0x21')](_0xfd266f);}return _0x4a0a7d[_0x8727('0x22')]();};}function saveUpdates(_0x2dae91,_0x537aaf){return function(_0x6e552f){if(_0x6e552f){return _0x6e552f[_0x8727('0x23')](_0x2dae91)[_0x8727('0x24')](function(_0x1d78df){return _0x1d78df;});}return null;};}function removeEntity(_0x2fe8ba,_0x3140e8){return function(_0x46d43e){if(_0x46d43e){return _0x46d43e[_0x8727('0x25')]()[_0x8727('0x24')](function(){_0x2fe8ba[_0x8727('0x19')](0xcc)[_0x8727('0x1a')]();});}};}function handleEntityNotFound(_0x1a69d5,_0x4c699b){return function(_0x464a32){if(!_0x464a32){_0x1a69d5[_0x8727('0x26')](0x194);}return _0x464a32;};}function handleError(_0x4c468d,_0x5adefe){_0x5adefe=_0x5adefe||0x1f4;return function(_0x3df7f2){logger[_0x8727('0x27')](_0x3df7f2[_0x8727('0x28')]);if(_0x3df7f2['name']){delete _0x3df7f2[_0x8727('0x29')];}_0x4c468d[_0x8727('0x19')](_0x5adefe)[_0x8727('0x2a')](_0x3df7f2);};}exports[_0x8727('0x2b')]=function(_0x2c8cd5,_0xf33348){var _0x262f36={},_0xd92f77={},_0x5d03f2={'count':0x0,'rows':[]};var _0x243f15=db[_0x8727('0x2c')]['rawAttributes'];_0xd92f77[_0x8727('0x2d')]=_[_0x8727('0x2e')](_0x243f15);_0xd92f77[_0x8727('0x2f')]=_[_0x8727('0x2e')](_0x2c8cd5[_0x8727('0x2f')]);_0xd92f77[_0x8727('0x30')]=_['intersection'](_0xd92f77[_0x8727('0x2d')],_0xd92f77['query']);_0x262f36[_0x8727('0x31')]=_['intersection'](_0xd92f77[_0x8727('0x2d')],qs[_0x8727('0x32')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x32')]));_0x262f36[_0x8727('0x31')]=_0x262f36[_0x8727('0x31')][_0x8727('0x33')]?_0x262f36['attributes']:_0xd92f77[_0x8727('0x2d')];if(!_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x34')](_0x8727('0x35'))){_0x262f36[_0x8727('0x1e')]=qs[_0x8727('0x1e')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x1e')]);_0x262f36[_0x8727('0x1d')]=qs[_0x8727('0x1d')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x1d')]);}_0x262f36['order']=qs['sort'](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x36')]);_0x262f36[_0x8727('0x37')]=qs[_0x8727('0x30')](_['pick'](_0x2c8cd5[_0x8727('0x2f')],_0xd92f77[_0x8727('0x30')]));if(_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x38')]){_0x262f36[_0x8727('0x37')]=_['merge'](_0x262f36[_0x8727('0x37')],{'$or':_[_0x8727('0x39')](_0x243f15,function(_0x8e9de8){if(_0x8e9de8[_0x8727('0x3a')][_0x8727('0x3b')]!==_0x8727('0x3c')){var _0x27b950={};_0x27b950[_0x8e9de8[_0x8727('0x3d')]]={'$like':'%'+_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x38')]+'%'};return _0x27b950;}})});}_0x262f36=_[_0x8727('0x3e')]({},_0x262f36,_0x2c8cd5[_0x8727('0x3f')]);var _0x5e1ea1={'where':_0x262f36[_0x8727('0x37')]};return db[_0x8727('0x2c')][_0x8727('0x1c')](_0x5e1ea1)[_0x8727('0x24')](function(_0x703078){_0x5d03f2[_0x8727('0x1c')]=_0x703078;if(_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x40')]){_0x262f36[_0x8727('0x41')]=[{'attributes':['id',_0x8727('0x29'),_0x8727('0x42'),_0x8727('0x43')],'model':db[_0x8727('0x44')],'as':_0x8727('0x44')}];}return db['VoiceCallReport'][_0x8727('0x45')](_0x262f36);})[_0x8727('0x24')](function(_0x19d08a){_0x5d03f2['rows']=_0x19d08a;return _0x5d03f2;})[_0x8727('0x24')](respondWithFilteredResult(_0xf33348,_0x262f36))[_0x8727('0x46')](handleError(_0xf33348,null));};exports[_0x8727('0x47')]=function(_0x641064,_0x57817f){var _0x3a2683={'raw':!![],'where':{'id':_0x641064[_0x8727('0x48')]['id']}},_0x37e87c={};_0x37e87c[_0x8727('0x2d')]=_[_0x8727('0x2e')](db[_0x8727('0x2c')][_0x8727('0x49')]);_0x37e87c[_0x8727('0x2f')]=_[_0x8727('0x2e')](_0x641064[_0x8727('0x2f')]);_0x37e87c['filters']=_[_0x8727('0x4a')](_0x37e87c[_0x8727('0x2d')],_0x37e87c[_0x8727('0x2f')]);_0x3a2683[_0x8727('0x31')]=_[_0x8727('0x4a')](_0x37e87c['model'],qs[_0x8727('0x32')](_0x641064[_0x8727('0x2f')][_0x8727('0x32')]));_0x3a2683['attributes']=_0x3a2683[_0x8727('0x31')][_0x8727('0x33')]?_0x3a2683[_0x8727('0x31')]:_0x37e87c[_0x8727('0x2d')];if(_0x641064[_0x8727('0x2f')][_0x8727('0x40')]){_0x3a2683['include']=[{'all':!![]}];}_0x3a2683=_[_0x8727('0x3e')]({},_0x3a2683,_0x641064[_0x8727('0x3f')]);return db[_0x8727('0x2c')]['find'](_0x3a2683)[_0x8727('0x24')](handleEntityNotFound(_0x57817f,null))[_0x8727('0x24')](respondWithResult(_0x57817f,null))[_0x8727('0x46')](handleError(_0x57817f,null));};exports[_0x8727('0x4b')]=function(_0x375f84,_0x11cb79){return db[_0x8727('0x2c')]['create'](_0x375f84[_0x8727('0x4c')],{})[_0x8727('0x24')](respondWithResult(_0x11cb79,0xc9))[_0x8727('0x46')](handleError(_0x11cb79,null));};exports[_0x8727('0x25')]=function(_0x152de6,_0x426727){return db[_0x8727('0x2c')]['find']({'where':{'id':_0x152de6[_0x8727('0x48')]['id']}})[_0x8727('0x24')](handleEntityNotFound(_0x426727,null))[_0x8727('0x24')](removeEntity(_0x426727,null))['catch'](handleError(_0x426727,null));};exports[_0x8727('0x4d')]=function(_0x22cd31,_0x24fd60){return db[_0x8727('0x2c')][_0x8727('0x4d')]()[_0x8727('0x24')](respondWithResult(_0x24fd60,null))[_0x8727('0x46')](handleError(_0x24fd60,null));};exports['update']=function(_0x23c2e8,_0x4d09b8){if(_0x23c2e8[_0x8727('0x4c')][_0x8727('0x4e')]){delete _0x23c2e8['body'][_0x8727('0x4e')];}return db[_0x8727('0x2c')][_0x8727('0x4f')]({'where':{'uniqueid':_0x23c2e8['params']['id'],'UserId':{'$or':[null,_0x23c2e8['user']['id']]}}})[_0x8727('0x24')](handleEntityNotFound(_0x4d09b8,null))[_0x8727('0x24')](saveUpdates(_0x23c2e8[_0x8727('0x4c')],null))['then'](respondWithResult(_0x4d09b8,null))[_0x8727('0x46')](handleError(_0x4d09b8,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4a71044..0797ee9 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 _0xb4bf=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash'];(function(_0xe8d631,_0x3d89f4){var _0x4e9099=function(_0x5e9a2e){while(--_0x5e9a2e){_0xe8d631['push'](_0xe8d631['shift']());}};_0x4e9099(++_0x3d89f4);}(_0xb4bf,0xcb));var _0xfb4b=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb4bf[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xfb4b('0x0'));var util=require('util');var logger=require(_0xfb4b('0x1'))(_0xfb4b('0x2'));var moment=require(_0xfb4b('0x3'));var BPromise=require(_0xfb4b('0x4'));var rp=require(_0xfb4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb4b('0x6'));var config=require('../../config/environment');var attributes=require(_0xfb4b('0x7'));module[_0xfb4b('0x8')]=function(_0x3663b3,_0x23ddcc){return _0x3663b3[_0xfb4b('0x9')]('VoiceCallReport',attributes,{'tableName':_0xfb4b('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfb4b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x063a=['path','rimraf','../../config/environment','exports','VoiceCallReport','report_call','uniqueid','lodash','api','bluebird','request-promise'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x063a,0x1e0));var _0xa063=function(_0x26d502,_0x47e0e2){_0x26d502=_0x26d502-0x0;var _0x4b3399=_0x063a[_0x26d502];return _0x4b3399;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa063('0x1'));var moment=require('moment');var BPromise=require(_0xa063('0x2'));var rp=require(_0xa063('0x3'));var fs=require('fs');var path=require(_0xa063('0x4'));var rimraf=require(_0xa063('0x5'));var config=require(_0xa063('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0xa063('0x7')]=function(_0xf9c494,_0x3de8e6){return _0xf9c494['define'](_0xa063('0x8'),attributes,{'tableName':_0xa063('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa063('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 73035a8..1e807ae 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 _0xc324=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s'];(function(_0x54d731,_0xc69e9c){var _0x50d681=function(_0x3f790d){while(--_0x3f790d){_0x54d731['push'](_0x54d731['shift']());}};_0x50d681(++_0xc69e9c);}(_0xc324,0x1dc));var _0x4c32=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc324[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4c32('0x0'));var util=require('util');var moment=require(_0x4c32('0x1'));var BPromise=require(_0x4c32('0x2'));var rs=require(_0x4c32('0x3'));var fs=require('fs');var Redis=require(_0x4c32('0x4'));var db=require(_0x4c32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c32('0x6'))(_0x4c32('0x7'));var config=require(_0x4c32('0x8'));var jayson=require(_0x4c32('0x9'));var client=jayson[_0x4c32('0xa')][_0x4c32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x234dbd,_0x40abde,_0x134921){return new BPromise(function(_0x2ec50e,_0x381573){return client[_0x4c32('0xc')](_0x234dbd,_0x134921)[_0x4c32('0xd')](function(_0x224e93){logger[_0x4c32('0xe')](_0x4c32('0xf'),_0x40abde,_0x4c32('0x10'));logger[_0x4c32('0x11')](_0x4c32('0x12'),_0x40abde,_0x4c32('0x10'),JSON[_0x4c32('0x13')](_0x224e93));if(_0x224e93[_0x4c32('0x14')]){if(_0x224e93[_0x4c32('0x14')][_0x4c32('0x15')]===0x1f4){logger[_0x4c32('0x14')](_0x4c32('0xf'),_0x40abde,_0x224e93[_0x4c32('0x14')][_0x4c32('0x16')]);return _0x381573(_0x224e93['error']['message']);}logger[_0x4c32('0x14')](_0x4c32('0xf'),_0x40abde,_0x224e93[_0x4c32('0x14')][_0x4c32('0x16')]);return _0x2ec50e(_0x224e93[_0x4c32('0x14')][_0x4c32('0x16')]);}else{logger[_0x4c32('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x40abde,_0x4c32('0x10'));_0x2ec50e(_0x224e93[_0x4c32('0x17')]['message']);}})[_0x4c32('0x18')](function(_0x1d0af4){logger[_0x4c32('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x40abde,_0x1d0af4);_0x381573(_0x1d0af4);});});}exports['GetVoiceCallReport']=function(_0x1fb0a5){var _0x39ab36=this;return new Promise(function(_0x3ec271,_0x5702a3){return db[_0x4c32('0x19')][_0x4c32('0x1a')]({'raw':_0x1fb0a5[_0x4c32('0x1b')]?_0x1fb0a5[_0x4c32('0x1b')][_0x4c32('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fb0a5[_0x4c32('0x1b')]?_0x1fb0a5[_0x4c32('0x1b')][_0x4c32('0x1d')]||null:null,'attributes':_0x1fb0a5['options']?_0x1fb0a5[_0x4c32('0x1b')]['attributes']||null:null,'limit':_0x1fb0a5['options']?_0x1fb0a5[_0x4c32('0x1b')][_0x4c32('0x1e')]||null:null,'include':_0x1fb0a5[_0x4c32('0x1b')]?_0x1fb0a5[_0x4c32('0x1b')][_0x4c32('0x1f')]?_[_0x4c32('0x20')](_0x1fb0a5[_0x4c32('0x1b')]['include'],function(_0x5881a2){return{'model':db[_0x5881a2[_0x4c32('0x21')]],'as':_0x5881a2['as'],'attributes':_0x5881a2[_0x4c32('0x22')],'include':_0x5881a2[_0x4c32('0x1f')]?_[_0x4c32('0x20')](_0x5881a2[_0x4c32('0x1f')],function(_0x32ddf8){return{'model':db[_0x32ddf8[_0x4c32('0x21')]],'as':_0x32ddf8['as'],'attributes':_0x32ddf8[_0x4c32('0x22')],'include':_0x32ddf8[_0x4c32('0x1f')]?_[_0x4c32('0x20')](_0x32ddf8[_0x4c32('0x1f')],function(_0x403225){return{'model':db[_0x403225[_0x4c32('0x21')]],'as':_0x403225['as'],'attributes':_0x403225[_0x4c32('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4c32('0xd')](function(_0x5c0f3a){logger[_0x4c32('0xe')](_0x4c32('0x23'),_0x1fb0a5);logger['debug'](_0x4c32('0x23'),_0x1fb0a5,JSON[_0x4c32('0x13')](_0x5c0f3a));_0x3ec271(_0x5c0f3a);})['catch'](function(_0x51a5db){logger['error'](_0x4c32('0x23'),_0x51a5db[_0x4c32('0x16')],_0x1fb0a5);_0x5702a3(_0x39ab36[_0x4c32('0x14')](0x1f4,_0x51a5db[_0x4c32('0x16')]));});});};exports[_0x4c32('0x24')]=function(_0x5fbf43){var _0x27621b=this;return new Promise(function(_0x55c593,_0x314909){return db['VoiceCallReport'][_0x4c32('0x25')](_0x5fbf43[_0x4c32('0x26')],{'raw':_0x5fbf43[_0x4c32('0x1b')]?_0x5fbf43[_0x4c32('0x1b')][_0x4c32('0x1c')]===undefined?!![]:![]:!![]})[_0x4c32('0xd')](function(_0x4bb542){logger[_0x4c32('0xe')](_0x4c32('0x24'),_0x5fbf43);logger[_0x4c32('0x11')](_0x4c32('0x24'),_0x5fbf43,JSON[_0x4c32('0x13')](_0x4bb542));_0x55c593(_0x4bb542);})[_0x4c32('0x18')](function(_0x5ef92a){logger[_0x4c32('0x14')](_0x4c32('0x24'),_0x5ef92a[_0x4c32('0x16')],_0x5fbf43);_0x314909(_0x27621b[_0x4c32('0x14')](0x1f4,_0x5ef92a[_0x4c32('0x16')]));});});};exports[_0x4c32('0x27')]=function(_0x5d4bde){var _0x3f78e7=this;return new Promise(function(_0x14a21c,_0x2b0951){return db[_0x4c32('0x19')][_0x4c32('0x28')](_0x5d4bde['body'],{'raw':_0x5d4bde[_0x4c32('0x1b')]?_0x5d4bde[_0x4c32('0x1b')][_0x4c32('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4bde[_0x4c32('0x1b')]?_0x5d4bde[_0x4c32('0x1b')][_0x4c32('0x1d')]||null:null,'attributes':_0x5d4bde[_0x4c32('0x1b')]?_0x5d4bde[_0x4c32('0x1b')][_0x4c32('0x22')]||null:null,'limit':_0x5d4bde[_0x4c32('0x1b')]?_0x5d4bde['options']['limit']||null:null})[_0x4c32('0xd')](function(_0x3b4f56){logger[_0x4c32('0xe')](_0x4c32('0x27'),_0x5d4bde);logger[_0x4c32('0x11')](_0x4c32('0x27'),_0x5d4bde,JSON[_0x4c32('0x13')](_0x3b4f56));_0x14a21c(_0x3b4f56);})[_0x4c32('0x18')](function(_0xcd9865){logger[_0x4c32('0x14')](_0x4c32('0x27'),_0xcd9865[_0x4c32('0x16')],_0x5d4bde);_0x2b0951(_0x3f78e7[_0x4c32('0x14')](0x1f4,_0xcd9865[_0x4c32('0x16')]));});});}; \ No newline at end of file +var _0x5e29=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','where','include','map','model','attributes','then','CreateVoiceCallReport','create','body','raw','VoiceCallReport','update','limit','UpdateVoiceCallReport','lodash'];(function(_0x245101,_0x11e6d8){var _0x32924a=function(_0x583c5c){while(--_0x583c5c){_0x245101['push'](_0x245101['shift']());}};_0x32924a(++_0x11e6d8);}(_0x5e29,0x1eb));var _0x95e2=function(_0x522d9d,_0x13104a){_0x522d9d=_0x522d9d-0x0;var _0x377218=_0x5e29[_0x522d9d];return _0x377218;};'use strict';var _=require(_0x95e2('0x0'));var util=require(_0x95e2('0x1'));var moment=require(_0x95e2('0x2'));var BPromise=require(_0x95e2('0x3'));var rs=require(_0x95e2('0x4'));var fs=require('fs');var Redis=require(_0x95e2('0x5'));var db=require(_0x95e2('0x6'))['db'];var utils=require(_0x95e2('0x7'));var logger=require(_0x95e2('0x8'))(_0x95e2('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x95e2('0xa')][_0x95e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9eedaa,_0x243944,_0x5540c5){return new BPromise(function(_0xc3b10b,_0x43819c){return client[_0x95e2('0xc')](_0x9eedaa,_0x5540c5)['then'](function(_0x426a15){logger[_0x95e2('0xd')](_0x95e2('0xe'),_0x243944,'request\x20sent');logger[_0x95e2('0xf')](_0x95e2('0x10'),_0x243944,_0x95e2('0x11'),JSON[_0x95e2('0x12')](_0x426a15));if(_0x426a15['error']){if(_0x426a15[_0x95e2('0x13')][_0x95e2('0x14')]===0x1f4){logger[_0x95e2('0x13')](_0x95e2('0xe'),_0x243944,_0x426a15[_0x95e2('0x13')]['message']);return _0x43819c(_0x426a15['error'][_0x95e2('0x15')]);}logger[_0x95e2('0x13')](_0x95e2('0xe'),_0x243944,_0x426a15['error'][_0x95e2('0x15')]);return _0xc3b10b(_0x426a15[_0x95e2('0x13')][_0x95e2('0x15')]);}else{logger[_0x95e2('0xd')](_0x95e2('0xe'),_0x243944,_0x95e2('0x11'));_0xc3b10b(_0x426a15[_0x95e2('0x16')][_0x95e2('0x15')]);}})[_0x95e2('0x17')](function(_0x4144a2){logger['error'](_0x95e2('0xe'),_0x243944,_0x4144a2);_0x43819c(_0x4144a2);});});}exports[_0x95e2('0x18')]=function(_0x4d3177){var _0x1bcd82=this;return new Promise(function(_0x33bcea,_0x2e70f6){return db['VoiceCallReport'][_0x95e2('0x19')]({'raw':_0x4d3177[_0x95e2('0x1a')]?_0x4d3177[_0x95e2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4d3177[_0x95e2('0x1a')]?_0x4d3177[_0x95e2('0x1a')][_0x95e2('0x1b')]||null:null,'attributes':_0x4d3177[_0x95e2('0x1a')]?_0x4d3177['options']['attributes']||null:null,'limit':_0x4d3177[_0x95e2('0x1a')]?_0x4d3177[_0x95e2('0x1a')]['limit']||null:null,'include':_0x4d3177[_0x95e2('0x1a')]?_0x4d3177[_0x95e2('0x1a')][_0x95e2('0x1c')]?_[_0x95e2('0x1d')](_0x4d3177['options'][_0x95e2('0x1c')],function(_0x58f0d8){return{'model':db[_0x58f0d8[_0x95e2('0x1e')]],'as':_0x58f0d8['as'],'attributes':_0x58f0d8[_0x95e2('0x1f')],'include':_0x58f0d8[_0x95e2('0x1c')]?_[_0x95e2('0x1d')](_0x58f0d8[_0x95e2('0x1c')],function(_0x5ee550){return{'model':db[_0x5ee550[_0x95e2('0x1e')]],'as':_0x5ee550['as'],'attributes':_0x5ee550[_0x95e2('0x1f')],'include':_0x5ee550['include']?_[_0x95e2('0x1d')](_0x5ee550[_0x95e2('0x1c')],function(_0x45a604){return{'model':db[_0x45a604[_0x95e2('0x1e')]],'as':_0x45a604['as'],'attributes':_0x45a604[_0x95e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x95e2('0x20')](function(_0x2cbf79){logger[_0x95e2('0xd')]('GetVoiceCallReport',_0x4d3177);logger[_0x95e2('0xf')](_0x95e2('0x18'),_0x4d3177,JSON['stringify'](_0x2cbf79));_0x33bcea(_0x2cbf79);})[_0x95e2('0x17')](function(_0x1c90b1){logger['error'](_0x95e2('0x18'),_0x1c90b1[_0x95e2('0x15')],_0x4d3177);_0x2e70f6(_0x1bcd82['error'](0x1f4,_0x1c90b1[_0x95e2('0x15')]));});});};exports[_0x95e2('0x21')]=function(_0x1ca78b){var _0xd11ad=this;return new Promise(function(_0x31c740,_0xd3a36d){return db['VoiceCallReport'][_0x95e2('0x22')](_0x1ca78b[_0x95e2('0x23')],{'raw':_0x1ca78b[_0x95e2('0x1a')]?_0x1ca78b[_0x95e2('0x1a')][_0x95e2('0x24')]===undefined?!![]:![]:!![]})[_0x95e2('0x20')](function(_0x2f0cef){logger[_0x95e2('0xd')](_0x95e2('0x21'),_0x1ca78b);logger[_0x95e2('0xf')](_0x95e2('0x21'),_0x1ca78b,JSON[_0x95e2('0x12')](_0x2f0cef));_0x31c740(_0x2f0cef);})['catch'](function(_0x1f1d81){logger['error'](_0x95e2('0x21'),_0x1f1d81[_0x95e2('0x15')],_0x1ca78b);_0xd3a36d(_0xd11ad[_0x95e2('0x13')](0x1f4,_0x1f1d81['message']));});});};exports['UpdateVoiceCallReport']=function(_0x10c2f5){var _0x1a8138=this;return new Promise(function(_0x2201ac,_0x2e9c71){return db[_0x95e2('0x25')][_0x95e2('0x26')](_0x10c2f5[_0x95e2('0x23')],{'raw':_0x10c2f5[_0x95e2('0x1a')]?_0x10c2f5['options'][_0x95e2('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10c2f5[_0x95e2('0x1a')]?_0x10c2f5[_0x95e2('0x1a')][_0x95e2('0x1b')]||null:null,'attributes':_0x10c2f5['options']?_0x10c2f5[_0x95e2('0x1a')]['attributes']||null:null,'limit':_0x10c2f5[_0x95e2('0x1a')]?_0x10c2f5['options'][_0x95e2('0x27')]||null:null})[_0x95e2('0x20')](function(_0x165935){logger[_0x95e2('0xd')](_0x95e2('0x28'),_0x10c2f5);logger[_0x95e2('0xf')](_0x95e2('0x28'),_0x10c2f5,JSON['stringify'](_0x165935));_0x2201ac(_0x165935);})[_0x95e2('0x17')](function(_0x55d9c5){logger[_0x95e2('0x13')](_0x95e2('0x28'),_0x55d9c5['message'],_0x10c2f5);_0x2e9c71(_0x1a8138[_0x95e2('0x13')](0x1f4,_0x55d9c5['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 8fc3218..7894c75 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 _0x1e9e=['/:id','isAuthenticated','delete','destroy','exports','multer','util','express','Router','../../config/environment','get','show','post','create','put'];(function(_0x1ec94b,_0x5abfb9){var _0x4cbe4e=function(_0x1df671){while(--_0x1df671){_0x1ec94b['push'](_0x1ec94b['shift']());}};_0x4cbe4e(++_0x5abfb9);}(_0x1e9e,0x15e));var _0xe1e9=function(_0x4a1347,_0x47a012){_0x4a1347=_0x4a1347-0x0;var _0x40c48c=_0x1e9e[_0x4a1347];return _0x40c48c;};'use strict';var multer=require(_0xe1e9('0x0'));var util=require(_0xe1e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1e9('0x2'));var router=express[_0xe1e9('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1e9('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xe1e9('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe1e9('0x6')]);router[_0xe1e9('0x7')]('/',auth['isAuthenticated'](),controller[_0xe1e9('0x8')]);router[_0xe1e9('0x9')](_0xe1e9('0xa'),auth[_0xe1e9('0xb')](),controller['update']);router[_0xe1e9('0xc')](_0xe1e9('0xa'),auth[_0xe1e9('0xb')](),controller[_0xe1e9('0xd')]);module[_0xe1e9('0xe')]=router; \ No newline at end of file +var _0x0d0e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x297689,_0x63c834){var _0xd9f9f0=function(_0x379219){while(--_0x379219){_0x297689['push'](_0x297689['shift']());}};_0xd9f9f0(++_0x63c834);}(_0x0d0e,0x81));var _0xe0d0=function(_0x124c9e,_0x546e91){_0x124c9e=_0x124c9e-0x0;var _0xd32b09=_0x0d0e[_0x124c9e];return _0xd32b09;};'use strict';var multer=require(_0xe0d0('0x0'));var util=require(_0xe0d0('0x1'));var path=require('path');var timeout=require(_0xe0d0('0x2'));var express=require(_0xe0d0('0x3'));var router=express['Router']();var auth=require(_0xe0d0('0x4'));var interaction=require(_0xe0d0('0x5'));var config=require(_0xe0d0('0x6'));var controller=require(_0xe0d0('0x7'));router[_0xe0d0('0x8')]('/',auth[_0xe0d0('0x9')](),controller[_0xe0d0('0xa')]);router[_0xe0d0('0x8')](_0xe0d0('0xb'),auth['isAuthenticated'](),controller[_0xe0d0('0xc')]);router['post']('/',auth[_0xe0d0('0x9')](),controller[_0xe0d0('0xd')]);router[_0xe0d0('0xe')]('/:id',auth[_0xe0d0('0x9')](),controller[_0xe0d0('0xf')]);router[_0xe0d0('0x10')](_0xe0d0('0xb'),auth[_0xe0d0('0x9')](),controller[_0xe0d0('0x11')]);module[_0xe0d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8e2abf4..738f359 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 _0xf496=['exports','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x14b161,_0x4cb6b3){var _0x952520=function(_0x482e94){while(--_0x482e94){_0x14b161['push'](_0x14b161['shift']());}};_0x952520(++_0x4cb6b3);}(_0xf496,0x19d));var _0x6f49=function(_0x16a65f,_0x423069){_0x16a65f=_0x16a65f-0x0;var _0xda4fab=_0xf496[_0x16a65f];return _0xda4fab;};'use strict';var Sequelize=require(_0x6f49('0x0'));module[_0x6f49('0x1')]={'name':{'type':Sequelize[_0x6f49('0x2')]},'prefix':{'type':Sequelize[_0x6f49('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x6f49('0x2')],'set':function(_0x4a7a39){this[_0x6f49('0x3')](_0x6f49('0x4'),_0x4a7a39?_0x4a7a39[_0x6f49('0x5')](''):[]);},'get':function(){return this[_0x6f49('0x6')]('options')?this[_0x6f49('0x6')](_0x6f49('0x4'))[_0x6f49('0x7')](''):[];}},'auth':{'type':Sequelize[_0x6f49('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x50b5=['sequelize','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x29bafc,_0x519f84){var _0x17d8fa=function(_0x28d49f){while(--_0x28d49f){_0x29bafc['push'](_0x29bafc['shift']());}};_0x17d8fa(++_0x519f84);}(_0x50b5,0x190));var _0x550b=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x50b5[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require(_0x550b('0x0'));module['exports']={'name':{'type':Sequelize[_0x550b('0x1')]},'prefix':{'type':Sequelize[_0x550b('0x1')],'unique':_0x550b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x550b('0x1')],'set':function(_0x225dac){this[_0x550b('0x3')](_0x550b('0x4'),_0x225dac?_0x225dac[_0x550b('0x5')](''):[]);},'get':function(){return this[_0x550b('0x6')](_0x550b('0x4'))?this[_0x550b('0x6')](_0x550b('0x4'))[_0x550b('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x550b('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x550b('0x1')]},'description':{'type':Sequelize[_0x550b('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index da93d8f..e2c54d2 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 _0xe639=['limit','status','set','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','map','type','field','merge','includeAll','include','findAll','rows','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','json','count','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe639,0x17d));var _0x9e63=function(_0x3c5830,_0x3cfd5f){_0x3c5830=_0x3c5830-0x0;var _0x5b5e4c=_0xe639[_0x3c5830];return _0x5b5e4c;};'use strict';var pdf=require(_0x9e63('0x0'));var emlformat=require(_0x9e63('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9e63('0x2'));var jsonpatch=require(_0x9e63('0x3'));var rp=require(_0x9e63('0x4'));var moment=require(_0x9e63('0x5'));var BPromise=require(_0x9e63('0x6'));var Mustache=require('mustache');var util=require(_0x9e63('0x7'));var path=require(_0x9e63('0x8'));var sox=require(_0x9e63('0x9'));var csv=require('to-csv');var ejs=require(_0x9e63('0xa'));var fs=require('fs');var _=require(_0x9e63('0xb'));var squel=require(_0x9e63('0xc'));var crypto=require(_0x9e63('0xd'));var jsforce=require(_0x9e63('0xe'));var deskjs=require(_0x9e63('0xf'));var toCsv=require(_0x9e63('0x10'));var querystring=require(_0x9e63('0x11'));var Papa=require('papaparse');var Redis=require(_0x9e63('0x12'));var authService=require(_0x9e63('0x13'));var qs=require(_0x9e63('0x14'));var hardwareService=require(_0x9e63('0x15'));var logger=require(_0x9e63('0x16'))('api');var utils=require(_0x9e63('0x17'));var config=require(_0x9e63('0x18'));var db=require(_0x9e63('0x19'))['db'];function respondWithStatusCode(_0x387eba,_0xd04191){_0xd04191=_0xd04191||0xcc;return function(_0x2b7c47){if(_0x2b7c47){return _0x387eba['sendStatus'](_0xd04191);}return _0x387eba['status'](_0xd04191)['end']();};}function respondWithResult(_0x1e86cf,_0x2b2679){_0x2b2679=_0x2b2679||0xc8;return function(_0xd9bd7b){if(_0xd9bd7b){return _0x1e86cf['status'](_0x2b2679)[_0x9e63('0x1a')](_0xd9bd7b);}};}function respondWithFilteredResult(_0x4e71d3,_0x3ddd55){return function(_0x549db2){if(_0x549db2){var _0x598998=_0x549db2[_0x9e63('0x1b')],_0x3c0363=_0x3ddd55[_0x9e63('0x1c')],_0x5c41a2=_0x3ddd55[_0x9e63('0x1c')]+_0x3ddd55[_0x9e63('0x1d')],_0x345d29;if(_0x5c41a2>=_0x598998){_0x5c41a2=_0x598998;_0x345d29=0xc8;}else{_0x345d29=0xce;}_0x4e71d3[_0x9e63('0x1e')](_0x345d29);return _0x4e71d3[_0x9e63('0x1f')]('Content-Range',_0x3c0363+'-'+_0x5c41a2+'/'+_0x598998)[_0x9e63('0x1a')](_0x549db2);}return null;};}function patchUpdates(_0x5209cd){return function(_0x4308fd){try{jsonpatch[_0x9e63('0x20')](_0x4308fd,_0x5209cd,!![]);}catch(_0x15d126){return BPromise[_0x9e63('0x21')](_0x15d126);}return _0x4308fd[_0x9e63('0x22')]();};}function saveUpdates(_0x1dbbfd,_0x22c26e){return function(_0x5c9b9f){if(_0x5c9b9f){return _0x5c9b9f[_0x9e63('0x23')](_0x1dbbfd)[_0x9e63('0x24')](function(_0x498243){return _0x498243;});}return null;};}function removeEntity(_0x25a147,_0x3538a3){return function(_0x2e4f04){if(_0x2e4f04){return _0x2e4f04[_0x9e63('0x25')]()[_0x9e63('0x24')](function(){var _0x51a4a5=_0x2e4f04[_0x9e63('0x26')]({'plain':!![]});var _0x413423=_0x9e63('0x27');return db[_0x9e63('0x28')][_0x9e63('0x25')]({'where':{'type':_0x413423,'resourceId':_0x51a4a5['id']}})[_0x9e63('0x24')](function(){return _0x2e4f04;});})[_0x9e63('0x24')](function(){_0x25a147[_0x9e63('0x1e')](0xcc)[_0x9e63('0x29')]();});}};}function handleEntityNotFound(_0xd01553,_0x4f1502){return function(_0x2454ee){if(!_0x2454ee){_0xd01553[_0x9e63('0x2a')](0x194);}return _0x2454ee;};}function handleError(_0xf93de1,_0x494218){_0x494218=_0x494218||0x1f4;return function(_0x557037){logger[_0x9e63('0x2b')](_0x557037[_0x9e63('0x2c')]);if(_0x557037['name']){delete _0x557037[_0x9e63('0x2d')];}_0xf93de1[_0x9e63('0x1e')](_0x494218)[_0x9e63('0x2e')](_0x557037);};}exports[_0x9e63('0x2f')]=function(_0x30fbe7,_0x2ee242){var _0x104cba={},_0x443b52={},_0x4034f0={'count':0x0,'rows':[]};var _0x5669cd=db[_0x9e63('0x30')][_0x9e63('0x31')];_0x443b52[_0x9e63('0x32')]=_[_0x9e63('0x33')](_0x5669cd);_0x443b52[_0x9e63('0x34')]=_['keys'](_0x30fbe7[_0x9e63('0x34')]);_0x443b52[_0x9e63('0x35')]=_[_0x9e63('0x36')](_0x443b52[_0x9e63('0x32')],_0x443b52[_0x9e63('0x34')]);_0x104cba[_0x9e63('0x37')]=_['intersection'](_0x443b52['model'],qs[_0x9e63('0x38')](_0x30fbe7[_0x9e63('0x34')]['fields']));_0x104cba[_0x9e63('0x37')]=_0x104cba['attributes']['length']?_0x104cba[_0x9e63('0x37')]:_0x443b52[_0x9e63('0x32')];if(!_0x30fbe7[_0x9e63('0x34')][_0x9e63('0x39')](_0x9e63('0x3a'))){_0x104cba[_0x9e63('0x1d')]=qs[_0x9e63('0x1d')](_0x30fbe7['query'][_0x9e63('0x1d')]);_0x104cba[_0x9e63('0x1c')]=qs[_0x9e63('0x1c')](_0x30fbe7[_0x9e63('0x34')]['offset']);}_0x104cba['order']=qs['sort'](_0x30fbe7['query'][_0x9e63('0x3b')]);_0x104cba[_0x9e63('0x3c')]=qs[_0x9e63('0x35')](_['pick'](_0x30fbe7[_0x9e63('0x34')],_0x443b52[_0x9e63('0x35')]));if(_0x30fbe7[_0x9e63('0x34')]['filter']){_0x104cba[_0x9e63('0x3c')]=_['merge'](_0x104cba[_0x9e63('0x3c')],{'$or':_[_0x9e63('0x3d')](_0x5669cd,function(_0x5f0099){if(_0x5f0099[_0x9e63('0x3e')]['key']!=='VIRTUAL'){var _0xc56202={};_0xc56202[_0x5f0099[_0x9e63('0x3f')]]={'$like':'%'+_0x30fbe7[_0x9e63('0x34')]['filter']+'%'};return _0xc56202;}})});}_0x104cba=_[_0x9e63('0x40')]({},_0x104cba,_0x30fbe7['options']);var _0x1bb703={'where':_0x104cba[_0x9e63('0x3c')]};return db[_0x9e63('0x30')][_0x9e63('0x1b')](_0x1bb703)[_0x9e63('0x24')](function(_0x1ad7fa){_0x4034f0[_0x9e63('0x1b')]=_0x1ad7fa;if(_0x30fbe7[_0x9e63('0x34')][_0x9e63('0x41')]){_0x104cba[_0x9e63('0x42')]=[{'all':!![]}];}return db[_0x9e63('0x30')][_0x9e63('0x43')](_0x104cba);})[_0x9e63('0x24')](function(_0x492950){_0x4034f0[_0x9e63('0x44')]=_0x492950;return _0x4034f0;})[_0x9e63('0x24')](respondWithFilteredResult(_0x2ee242,_0x104cba))['catch'](handleError(_0x2ee242,null));};exports[_0x9e63('0x45')]=function(_0xac919b,_0x48c607){var _0x3ea813={'raw':![],'where':{'id':_0xac919b['params']['id']}},_0x5a81a1={};_0x5a81a1['model']=_[_0x9e63('0x33')](db[_0x9e63('0x30')][_0x9e63('0x31')]);_0x5a81a1[_0x9e63('0x34')]=_['keys'](_0xac919b[_0x9e63('0x34')]);_0x5a81a1['filters']=_[_0x9e63('0x36')](_0x5a81a1[_0x9e63('0x32')],_0x5a81a1[_0x9e63('0x34')]);_0x3ea813[_0x9e63('0x37')]=_['intersection'](_0x5a81a1['model'],qs[_0x9e63('0x38')](_0xac919b[_0x9e63('0x34')][_0x9e63('0x38')]));_0x3ea813[_0x9e63('0x37')]=_0x3ea813[_0x9e63('0x37')][_0x9e63('0x46')]?_0x3ea813[_0x9e63('0x37')]:_0x5a81a1['model'];if(_0xac919b['query'][_0x9e63('0x41')]){_0x3ea813['include']=[{'all':!![]}];}_0x3ea813=_[_0x9e63('0x40')]({},_0x3ea813,_0xac919b['options']);return db[_0x9e63('0x30')][_0x9e63('0x47')](_0x3ea813)[_0x9e63('0x24')](handleEntityNotFound(_0x48c607,null))[_0x9e63('0x24')](respondWithResult(_0x48c607,null))[_0x9e63('0x48')](handleError(_0x48c607,null));};exports[_0x9e63('0x49')]=function(_0x50ecbf,_0x273407){return db[_0x9e63('0x30')][_0x9e63('0x49')](_0x50ecbf[_0x9e63('0x4a')],{})[_0x9e63('0x24')](function(_0x354f99){var _0x1f7691=_0x50ecbf[_0x9e63('0x4b')][_0x9e63('0x26')]({'plain':!![]});if(!_0x1f7691)throw new Error(_0x9e63('0x4c'));if(_0x1f7691[_0x9e63('0x4d')]==='user'){var _0x2f9881=_0x354f99[_0x9e63('0x26')]({'plain':!![]});var _0x2e1847=_0x9e63('0x27');return db[_0x9e63('0x4e')]['find']({'where':{'name':_0x2e1847,'userProfileId':_0x1f7691[_0x9e63('0x4f')]},'raw':!![]})[_0x9e63('0x24')](function(_0x3dc579){if(_0x3dc579&&_0x3dc579[_0x9e63('0x50')]===0x0){return db[_0x9e63('0x28')][_0x9e63('0x49')]({'name':_0x2f9881[_0x9e63('0x2d')],'resourceId':_0x2f9881['id'],'type':_0x3dc579['name'],'sectionId':_0x3dc579['id']},{})['then'](function(){return _0x354f99;});}else{return _0x354f99;}})['catch'](function(_0x1f4af7){logger[_0x9e63('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f4af7);throw _0x1f4af7;});}return _0x354f99;})['then'](respondWithResult(_0x273407,0xc9))[_0x9e63('0x48')](handleError(_0x273407,null));};exports['update']=function(_0x40265d,_0x493bca){if(_0x40265d['body']['id']){delete _0x40265d[_0x9e63('0x4a')]['id'];}return db[_0x9e63('0x30')]['find']({'where':{'id':_0x40265d[_0x9e63('0x51')]['id']}})[_0x9e63('0x24')](handleEntityNotFound(_0x493bca,null))['then'](saveUpdates(_0x40265d[_0x9e63('0x4a')],null))[_0x9e63('0x24')](respondWithResult(_0x493bca,null))[_0x9e63('0x48')](handleError(_0x493bca,null));};exports['destroy']=function(_0x3bfcab,_0x15c998){return db[_0x9e63('0x30')][_0x9e63('0x47')]({'where':{'id':_0x3bfcab[_0x9e63('0x51')]['id']}})[_0x9e63('0x24')](handleEntityNotFound(_0x15c998,null))[_0x9e63('0x24')](removeEntity(_0x15c998,null))[_0x9e63('0x48')](handleError(_0x15c998,null));}; \ No newline at end of file +var _0xf9f4=['create','body','user','role','userProfileId','autoAssociation','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','VoiceChanSpy','includeAll','include','findAll','rows','catch'];(function(_0x16481a,_0x345a40){var _0x5f73b1=function(_0x153b94){while(--_0x153b94){_0x16481a['push'](_0x16481a['shift']());}};_0x5f73b1(++_0x345a40);}(_0xf9f4,0xec));var _0x4f9f=function(_0xd3e75a,_0x4abf73){_0xd3e75a=_0xd3e75a-0x0;var _0x21ef89=_0xf9f4[_0xd3e75a];return _0x21ef89;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4f9f('0x0'));var zipdir=require(_0x4f9f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f9f('0x2'));var moment=require(_0x4f9f('0x3'));var BPromise=require(_0x4f9f('0x4'));var Mustache=require(_0x4f9f('0x5'));var util=require(_0x4f9f('0x6'));var path=require(_0x4f9f('0x7'));var sox=require(_0x4f9f('0x8'));var csv=require(_0x4f9f('0x9'));var ejs=require(_0x4f9f('0xa'));var fs=require('fs');var _=require(_0x4f9f('0xb'));var squel=require(_0x4f9f('0xc'));var crypto=require(_0x4f9f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f9f('0x9'));var querystring=require(_0x4f9f('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f9f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f9f('0x10'))(_0x4f9f('0x11'));var utils=require(_0x4f9f('0x12'));var config=require('../../config/environment');var db=require(_0x4f9f('0x13'))['db'];function respondWithStatusCode(_0x4b9353,_0x470180){_0x470180=_0x470180||0xcc;return function(_0xebe1f2){if(_0xebe1f2){return _0x4b9353[_0x4f9f('0x14')](_0x470180);}return _0x4b9353[_0x4f9f('0x15')](_0x470180)[_0x4f9f('0x16')]();};}function respondWithResult(_0x12032b,_0x5cdadc){_0x5cdadc=_0x5cdadc||0xc8;return function(_0xbacc57){if(_0xbacc57){return _0x12032b['status'](_0x5cdadc)[_0x4f9f('0x17')](_0xbacc57);}};}function respondWithFilteredResult(_0x16e3d5,_0x36d05c){return function(_0x179202){if(_0x179202){var _0xbf99d8=_0x179202[_0x4f9f('0x18')],_0x364b1e=_0x36d05c[_0x4f9f('0x19')],_0x3e60b6=_0x36d05c['offset']+_0x36d05c['limit'],_0x2571ca;if(_0x3e60b6>=_0xbf99d8){_0x3e60b6=_0xbf99d8;_0x2571ca=0xc8;}else{_0x2571ca=0xce;}_0x16e3d5[_0x4f9f('0x15')](_0x2571ca);return _0x16e3d5[_0x4f9f('0x1a')]('Content-Range',_0x364b1e+'-'+_0x3e60b6+'/'+_0xbf99d8)['json'](_0x179202);}return null;};}function patchUpdates(_0x359b42){return function(_0x316347){try{jsonpatch[_0x4f9f('0x1b')](_0x316347,_0x359b42,!![]);}catch(_0x351911){return BPromise[_0x4f9f('0x1c')](_0x351911);}return _0x316347[_0x4f9f('0x1d')]();};}function saveUpdates(_0x3437f6,_0x26474e){return function(_0x56e935){if(_0x56e935){return _0x56e935[_0x4f9f('0x1e')](_0x3437f6)[_0x4f9f('0x1f')](function(_0x44b583){return _0x44b583;});}return null;};}function removeEntity(_0x3d61fd,_0x1b38f1){return function(_0xc03f07){if(_0xc03f07){return _0xc03f07[_0x4f9f('0x20')]()[_0x4f9f('0x1f')](function(){var _0x38ffc9=_0xc03f07[_0x4f9f('0x21')]({'plain':!![]});var _0x3c7454=_0x4f9f('0x22');return db[_0x4f9f('0x23')][_0x4f9f('0x20')]({'where':{'type':_0x3c7454,'resourceId':_0x38ffc9['id']}})[_0x4f9f('0x1f')](function(){return _0xc03f07;});})['then'](function(){_0x3d61fd['status'](0xcc)[_0x4f9f('0x16')]();});}};}function handleEntityNotFound(_0x220ea6,_0x154675){return function(_0x5f3efb){if(!_0x5f3efb){_0x220ea6[_0x4f9f('0x14')](0x194);}return _0x5f3efb;};}function handleError(_0x12305f,_0x24244b){_0x24244b=_0x24244b||0x1f4;return function(_0x2fa87c){logger[_0x4f9f('0x24')](_0x2fa87c[_0x4f9f('0x25')]);if(_0x2fa87c[_0x4f9f('0x26')]){delete _0x2fa87c['name'];}_0x12305f[_0x4f9f('0x15')](_0x24244b)[_0x4f9f('0x27')](_0x2fa87c);};}exports['index']=function(_0x1cdcda,_0x35b29f){var _0x53b2d4={},_0x125c79={},_0x2bd1fc={'count':0x0,'rows':[]};var _0x63b65=db['VoiceChanSpy'][_0x4f9f('0x28')];_0x125c79[_0x4f9f('0x29')]=_['keys'](_0x63b65);_0x125c79['query']=_[_0x4f9f('0x2a')](_0x1cdcda['query']);_0x125c79[_0x4f9f('0x2b')]=_[_0x4f9f('0x2c')](_0x125c79[_0x4f9f('0x29')],_0x125c79['query']);_0x53b2d4[_0x4f9f('0x2d')]=_[_0x4f9f('0x2c')](_0x125c79[_0x4f9f('0x29')],qs[_0x4f9f('0x2e')](_0x1cdcda[_0x4f9f('0x2f')][_0x4f9f('0x2e')]));_0x53b2d4[_0x4f9f('0x2d')]=_0x53b2d4[_0x4f9f('0x2d')]['length']?_0x53b2d4['attributes']:_0x125c79['model'];if(!_0x1cdcda[_0x4f9f('0x2f')][_0x4f9f('0x30')](_0x4f9f('0x31'))){_0x53b2d4[_0x4f9f('0x32')]=qs[_0x4f9f('0x32')](_0x1cdcda[_0x4f9f('0x2f')][_0x4f9f('0x32')]);_0x53b2d4['offset']=qs['offset'](_0x1cdcda[_0x4f9f('0x2f')][_0x4f9f('0x19')]);}_0x53b2d4[_0x4f9f('0x33')]=qs[_0x4f9f('0x34')](_0x1cdcda[_0x4f9f('0x2f')]['sort']);_0x53b2d4[_0x4f9f('0x35')]=qs[_0x4f9f('0x2b')](_['pick'](_0x1cdcda[_0x4f9f('0x2f')],_0x125c79[_0x4f9f('0x2b')]));if(_0x1cdcda[_0x4f9f('0x2f')][_0x4f9f('0x36')]){_0x53b2d4['where']=_['merge'](_0x53b2d4[_0x4f9f('0x35')],{'$or':_[_0x4f9f('0x37')](_0x63b65,function(_0x1867fc){if(_0x1867fc[_0x4f9f('0x38')][_0x4f9f('0x39')]!==_0x4f9f('0x3a')){var _0x5873c0={};_0x5873c0[_0x1867fc[_0x4f9f('0x3b')]]={'$like':'%'+_0x1cdcda[_0x4f9f('0x2f')]['filter']+'%'};return _0x5873c0;}})});}_0x53b2d4=_[_0x4f9f('0x3c')]({},_0x53b2d4,_0x1cdcda[_0x4f9f('0x3d')]);var _0x58fb78={'where':_0x53b2d4['where']};return db[_0x4f9f('0x3e')]['count'](_0x58fb78)[_0x4f9f('0x1f')](function(_0x23dfba){_0x2bd1fc[_0x4f9f('0x18')]=_0x23dfba;if(_0x1cdcda['query'][_0x4f9f('0x3f')]){_0x53b2d4[_0x4f9f('0x40')]=[{'all':!![]}];}return db[_0x4f9f('0x3e')][_0x4f9f('0x41')](_0x53b2d4);})[_0x4f9f('0x1f')](function(_0x1fbebb){_0x2bd1fc[_0x4f9f('0x42')]=_0x1fbebb;return _0x2bd1fc;})[_0x4f9f('0x1f')](respondWithFilteredResult(_0x35b29f,_0x53b2d4))[_0x4f9f('0x43')](handleError(_0x35b29f,null));};exports['show']=function(_0x2e73cd,_0x1ceb35){var _0x3bd33a={'raw':![],'where':{'id':_0x2e73cd['params']['id']}},_0x5c7b84={};_0x5c7b84[_0x4f9f('0x29')]=_[_0x4f9f('0x2a')](db[_0x4f9f('0x3e')][_0x4f9f('0x28')]);_0x5c7b84[_0x4f9f('0x2f')]=_[_0x4f9f('0x2a')](_0x2e73cd['query']);_0x5c7b84[_0x4f9f('0x2b')]=_[_0x4f9f('0x2c')](_0x5c7b84[_0x4f9f('0x29')],_0x5c7b84[_0x4f9f('0x2f')]);_0x3bd33a['attributes']=_[_0x4f9f('0x2c')](_0x5c7b84['model'],qs['fields'](_0x2e73cd['query'][_0x4f9f('0x2e')]));_0x3bd33a['attributes']=_0x3bd33a['attributes']['length']?_0x3bd33a[_0x4f9f('0x2d')]:_0x5c7b84[_0x4f9f('0x29')];if(_0x2e73cd[_0x4f9f('0x2f')][_0x4f9f('0x3f')]){_0x3bd33a[_0x4f9f('0x40')]=[{'all':!![]}];}_0x3bd33a=_[_0x4f9f('0x3c')]({},_0x3bd33a,_0x2e73cd[_0x4f9f('0x3d')]);return db[_0x4f9f('0x3e')]['find'](_0x3bd33a)[_0x4f9f('0x1f')](handleEntityNotFound(_0x1ceb35,null))[_0x4f9f('0x1f')](respondWithResult(_0x1ceb35,null))['catch'](handleError(_0x1ceb35,null));};exports[_0x4f9f('0x44')]=function(_0x264dbe,_0x32a981){return db[_0x4f9f('0x3e')]['create'](_0x264dbe[_0x4f9f('0x45')],{})['then'](function(_0x5b24e7){var _0x5c80f4=_0x264dbe[_0x4f9f('0x46')]['get']({'plain':!![]});if(!_0x5c80f4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c80f4[_0x4f9f('0x47')]===_0x4f9f('0x46')){var _0x267268=_0x5b24e7[_0x4f9f('0x21')]({'plain':!![]});var _0x72fef9='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x72fef9,'userProfileId':_0x5c80f4[_0x4f9f('0x48')]},'raw':!![]})[_0x4f9f('0x1f')](function(_0x4ef898){if(_0x4ef898&&_0x4ef898[_0x4f9f('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x267268[_0x4f9f('0x26')],'resourceId':_0x267268['id'],'type':_0x4ef898[_0x4f9f('0x26')],'sectionId':_0x4ef898['id']},{})[_0x4f9f('0x1f')](function(){return _0x5b24e7;});}else{return _0x5b24e7;}})[_0x4f9f('0x43')](function(_0x2a1fd7){logger[_0x4f9f('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a1fd7);throw _0x2a1fd7;});}return _0x5b24e7;})[_0x4f9f('0x1f')](respondWithResult(_0x32a981,0xc9))[_0x4f9f('0x43')](handleError(_0x32a981,null));};exports[_0x4f9f('0x1e')]=function(_0x1cc0e7,_0x17dac1){if(_0x1cc0e7['body']['id']){delete _0x1cc0e7[_0x4f9f('0x45')]['id'];}return db[_0x4f9f('0x3e')][_0x4f9f('0x4a')]({'where':{'id':_0x1cc0e7[_0x4f9f('0x4b')]['id']}})[_0x4f9f('0x1f')](handleEntityNotFound(_0x17dac1,null))[_0x4f9f('0x1f')](saveUpdates(_0x1cc0e7[_0x4f9f('0x45')],null))[_0x4f9f('0x1f')](respondWithResult(_0x17dac1,null))['catch'](handleError(_0x17dac1,null));};exports['destroy']=function(_0x5de710,_0x48e1da){return db[_0x4f9f('0x3e')]['find']({'where':{'id':_0x5de710[_0x4f9f('0x4b')]['id']}})[_0x4f9f('0x1f')](handleEntityNotFound(_0x48e1da,null))[_0x4f9f('0x1f')](removeEntity(_0x48e1da,null))[_0x4f9f('0x43')](handleError(_0x48e1da,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 695005d..7159bd1 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 _0xfb1f=['push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','define','length','bulkCreate','catch','destroy','VoiceExtension','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system'];(function(_0x370fd5,_0x400607){var _0x522047=function(_0x5d8464){while(--_0x5d8464){_0x370fd5['push'](_0x370fd5['shift']());}};_0x522047(++_0x400607);}(_0xfb1f,0x6a));var _0xffb1=function(_0x30c680,_0x2db280){_0x30c680=_0x30c680-0x0;var _0x3c8897=_0xfb1f[_0x30c680];return _0x3c8897;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xffb1('0x0'));var attributes=require(_0xffb1('0x1'));var getUserApplications=function(_0x2334d4,_0xea672e,_0x2c1b0f){var _0x1b27f4=0x1;var _0x425846=[];var _0x33b5d9={'context':_0xea672e[_0xffb1('0x2')]||_0xffb1('0x3'),'exten':util[_0xffb1('0x4')](_0xffb1('0x5'),_0x2334d4[_0xffb1('0x6')],_0x2c1b0f),'type':_0xffb1('0x7'),'isApp':![],'ChanSpyId':_0x2334d4['id'],'UserId':_0xea672e['id']};_0x425846[_0xffb1('0x8')](_['merge']({'app':_0xffb1('0x9'),'appdata':util['format'](_0xffb1('0xa'),_0xffb1('0xb')),'priority':_0x1b27f4++},_0x33b5d9));if(_0x2334d4[_0xffb1('0xc')]){_0x425846[_0xffb1('0x8')](_[_0xffb1('0xd')]({'app':_0xffb1('0xe'),'appdata':util[_0xffb1('0x4')](_0xffb1('0xf'),_0x2334d4[_0xffb1('0x10')]),'priority':_0x1b27f4++},_0x33b5d9));}if(_0x2334d4['auth']){_0x425846[_0xffb1('0x8')](_[_0xffb1('0xd')]({'app':_0xffb1('0x11'),'appdata':_0x2334d4[_0xffb1('0x12')],'priority':_0x1b27f4++},_0x33b5d9));}_0x425846[_0xffb1('0x8')](_['merge']({'app':_0xffb1('0x13'),'appdata':util['format'](_0xffb1('0x14'),_0xea672e[_0xffb1('0x15')],_0x2334d4[_0xffb1('0x16')]?_0x2334d4['options'][_0xffb1('0x17')](''):''),'priority':_0x1b27f4++},_0x33b5d9));if(_0x2334d4[_0xffb1('0xc')]){_0x425846[_0xffb1('0x8')](_['merge']({'app':_0xffb1('0x18'),'priority':_0x1b27f4++},_0x33b5d9));}return _0x425846;};var getChanSpyApplications=function(_0x3a29ae,_0x537c3c){var _0x51be98=[];for(var _0x5a6486=0x0,_0x211ec5=0x1;_0x5a6486<_0x537c3c['length'];_0x5a6486++,_0x211ec5=0x1){_0x51be98=_0x51be98[_0xffb1('0x19')](getUserApplications(_0x3a29ae,_0x537c3c[_0x5a6486],_0x537c3c[_0x5a6486][_0xffb1('0x1a')]));if(_0x537c3c[_0x5a6486][_0xffb1('0x1a')]!=_0x537c3c[_0x5a6486][_0xffb1('0x15')]){_0x51be98=_0x51be98[_0xffb1('0x19')](getUserApplications(_0x3a29ae,_0x537c3c[_0x5a6486],_0x537c3c[_0x5a6486][_0xffb1('0x15')]));}}return _0x51be98;};var getChanSpyPromise=function(_0x2eb6c7,_0x387a6f){return new BPromise(function(_0x243426,_0x4e39e3){return _0x2eb6c7[_0xffb1('0x1b')][_0xffb1('0x1c')]({'attributes':['id',_0xffb1('0x15'),_0xffb1('0x1a')],'where':{'role':_0xffb1('0x1d'),'chanspy':!![]},'raw':!![]})[_0xffb1('0x1e')](function(_0x266424){if(_0x266424){return _0x243426(getChanSpyApplications(_0x387a6f,_0x266424));}return _0x243426([]);})['catch'](function(_0x5ee418){_0x4e39e3(_0x5ee418);});});};module[_0xffb1('0x1f')]=function(_0x1e8221,_0x2a442d){var _0x32840a=_0x1e8221['models'];return _0x1e8221[_0xffb1('0x20')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa7c242,_0x31bf9f,_0x2c9441){return getChanSpyPromise(_0x32840a,_0xa7c242)['then'](function(_0x868844){if(_0x868844&&_0x868844[_0xffb1('0x21')]){return _0x32840a['VoiceExtension'][_0xffb1('0x22')](_0x868844);}})['then'](function(){_0x2c9441();})[_0xffb1('0x23')](function(_0x711ade){_0x2c9441(_0x711ade);});},'afterUpdate':function(_0xdc80f3,_0x4688f0,_0x135fa0){return _0x32840a['VoiceExtension'][_0xffb1('0x24')]({'where':{'ChanSpyId':_0xdc80f3['id']}})[_0xffb1('0x1e')](function(){return getChanSpyPromise(_0x32840a,_0xdc80f3);})['then'](function(_0x3c7818){if(_0x3c7818&&_0x3c7818[_0xffb1('0x21')]){return _0x32840a[_0xffb1('0x25')]['bulkCreate'](_0x3c7818);}})[_0xffb1('0x1e')](function(){_0x135fa0();})['catch'](function(_0x27837c){_0x135fa0(_0x27837c);});},'afterDestroy':function(_0x13ec15,_0x21e05d,_0x423e59){return _0x32840a[_0xffb1('0x25')][_0xffb1('0x24')]({'where':{'ChanSpyId':_0x13ec15['id']}})[_0xffb1('0x1e')](function(){_0x423e59();})['catch'](function(_0x4108e4){_0x423e59(_0x4108e4);});}}});}; \ No newline at end of file +var _0xc095=['from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','merge','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context'];(function(_0x232542,_0x36ce84){var _0xfaa884=function(_0x258cbb){while(--_0x258cbb){_0x232542['push'](_0x232542['shift']());}};_0xfaa884(++_0x36ce84);}(_0xc095,0x18c));var _0x5c09=function(_0x270a8b,_0x44ed09){_0x270a8b=_0x270a8b-0x0;var _0x5a5758=_0xc095[_0x270a8b];return _0x5a5758;};'use strict';var _=require(_0x5c09('0x0'));var util=require(_0x5c09('0x1'));var BPromise=require(_0x5c09('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x68e28a,_0xf8c462,_0x17133e){var _0x22c79e=0x1;var _0x662739=[];var _0x31bba7={'context':_0xf8c462[_0x5c09('0x3')]||_0x5c09('0x4'),'exten':util[_0x5c09('0x5')](_0x5c09('0x6'),_0x68e28a[_0x5c09('0x7')],_0x17133e),'type':_0x5c09('0x8'),'isApp':![],'ChanSpyId':_0x68e28a['id'],'UserId':_0xf8c462['id']};_0x662739[_0x5c09('0x9')](_['merge']({'app':_0x5c09('0xa'),'appdata':util[_0x5c09('0x5')](_0x5c09('0xb'),_0x5c09('0xc')),'priority':_0x22c79e++},_0x31bba7));if(_0x68e28a['record']){_0x662739[_0x5c09('0x9')](_[_0x5c09('0xd')]({'app':_0x5c09('0xe'),'appdata':util['format']('${UNIQUEID}.%s,ab',_0x68e28a[_0x5c09('0xf')]),'priority':_0x22c79e++},_0x31bba7));}if(_0x68e28a[_0x5c09('0x10')]){_0x662739['push'](_[_0x5c09('0xd')]({'app':_0x5c09('0x11'),'appdata':_0x68e28a['password'],'priority':_0x22c79e++},_0x31bba7));}_0x662739[_0x5c09('0x9')](_['merge']({'app':_0x5c09('0x12'),'appdata':util['format'](_0x5c09('0x13'),_0xf8c462[_0x5c09('0x14')],_0x68e28a[_0x5c09('0x15')]?_0x68e28a[_0x5c09('0x15')][_0x5c09('0x16')](''):''),'priority':_0x22c79e++},_0x31bba7));if(_0x68e28a[_0x5c09('0x17')]){_0x662739[_0x5c09('0x9')](_[_0x5c09('0xd')]({'app':_0x5c09('0x18'),'priority':_0x22c79e++},_0x31bba7));}return _0x662739;};var getChanSpyApplications=function(_0xe911,_0x5d67b0){var _0x340564=[];for(var _0x59ad15=0x0,_0x333541=0x1;_0x59ad15<_0x5d67b0[_0x5c09('0x19')];_0x59ad15++,_0x333541=0x1){_0x340564=_0x340564[_0x5c09('0x1a')](getUserApplications(_0xe911,_0x5d67b0[_0x59ad15],_0x5d67b0[_0x59ad15][_0x5c09('0x1b')]));if(_0x5d67b0[_0x59ad15]['internal']!=_0x5d67b0[_0x59ad15][_0x5c09('0x14')]){_0x340564=_0x340564[_0x5c09('0x1a')](getUserApplications(_0xe911,_0x5d67b0[_0x59ad15],_0x5d67b0[_0x59ad15][_0x5c09('0x14')]));}}return _0x340564;};var getChanSpyPromise=function(_0x33d1f1,_0x37ade5){return new BPromise(function(_0x2e05c2,_0x346b7d){return _0x33d1f1[_0x5c09('0x1c')][_0x5c09('0x1d')]({'attributes':['id',_0x5c09('0x14'),_0x5c09('0x1b')],'where':{'role':_0x5c09('0x1e'),'chanspy':!![]},'raw':!![]})[_0x5c09('0x1f')](function(_0x5da446){if(_0x5da446){return _0x2e05c2(getChanSpyApplications(_0x37ade5,_0x5da446));}return _0x2e05c2([]);})[_0x5c09('0x20')](function(_0xfce792){_0x346b7d(_0xfce792);});});};module[_0x5c09('0x21')]=function(_0x533931,_0x3aecab){var _0x295180=_0x533931[_0x5c09('0x22')];return _0x533931[_0x5c09('0x23')]('VoiceChanSpy',attributes,{'tableName':_0x5c09('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17056d,_0x4e90ad,_0x2182f3){return getChanSpyPromise(_0x295180,_0x17056d)['then'](function(_0x112f11){if(_0x112f11&&_0x112f11[_0x5c09('0x19')]){return _0x295180[_0x5c09('0x25')][_0x5c09('0x26')](_0x112f11);}})[_0x5c09('0x1f')](function(){_0x2182f3();})[_0x5c09('0x20')](function(_0x56587a){_0x2182f3(_0x56587a);});},'afterUpdate':function(_0x1df169,_0x1beef3,_0x3d2604){return _0x295180[_0x5c09('0x25')][_0x5c09('0x27')]({'where':{'ChanSpyId':_0x1df169['id']}})[_0x5c09('0x1f')](function(){return getChanSpyPromise(_0x295180,_0x1df169);})[_0x5c09('0x1f')](function(_0x4825ed){if(_0x4825ed&&_0x4825ed['length']){return _0x295180[_0x5c09('0x25')][_0x5c09('0x26')](_0x4825ed);}})[_0x5c09('0x1f')](function(){_0x3d2604();})['catch'](function(_0x329e1f){_0x3d2604(_0x329e1f);});},'afterDestroy':function(_0x1fe2ba,_0x286285,_0x36de88){return _0x295180[_0x5c09('0x25')]['destroy']({'where':{'ChanSpyId':_0x1fe2ba['id']}})['then'](function(){_0x36de88();})[_0x5c09('0x20')](function(_0xa59aac){_0x36de88(_0xa59aac);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9718760..949e4e8 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 _0x8b1a=['rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4c53c3,_0x360764){var _0x32bf24=function(_0x53f989){while(--_0x53f989){_0x4c53c3['push'](_0x4c53c3['shift']());}};_0x32bf24(++_0x360764);}(_0x8b1a,0x152));var _0xa8b1=function(_0x48e5fe,_0x41fb97){_0x48e5fe=_0x48e5fe-0x0;var _0xc9205a=_0x8b1a[_0x48e5fe];return _0xc9205a;};'use strict';var _=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var moment=require(_0xa8b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8b1('0x3'));var fs=require('fs');var Redis=require(_0xa8b1('0x4'));var db=require(_0xa8b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8b1('0x6'))(_0xa8b1('0x7'));var config=require(_0xa8b1('0x8'));var jayson=require(_0xa8b1('0x9'));var client=jayson[_0xa8b1('0xa')][_0xa8b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5db169,_0x2a3030,_0x459cf9){return new BPromise(function(_0x5d958d,_0xabb2b9){return client[_0xa8b1('0xc')](_0x5db169,_0x459cf9)['then'](function(_0x112113){logger[_0xa8b1('0xd')](_0xa8b1('0xe'),_0x2a3030,'request\x20sent');logger['debug'](_0xa8b1('0xf'),_0x2a3030,'request\x20sent',JSON[_0xa8b1('0x10')](_0x112113));if(_0x112113[_0xa8b1('0x11')]){if(_0x112113[_0xa8b1('0x11')][_0xa8b1('0x12')]===0x1f4){logger[_0xa8b1('0x11')](_0xa8b1('0xe'),_0x2a3030,_0x112113[_0xa8b1('0x11')][_0xa8b1('0x13')]);return _0xabb2b9(_0x112113['error'][_0xa8b1('0x13')]);}logger[_0xa8b1('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a3030,_0x112113[_0xa8b1('0x11')]['message']);return _0x5d958d(_0x112113[_0xa8b1('0x11')]['message']);}else{logger[_0xa8b1('0xd')](_0xa8b1('0xe'),_0x2a3030,_0xa8b1('0x14'));_0x5d958d(_0x112113[_0xa8b1('0x15')][_0xa8b1('0x13')]);}})[_0xa8b1('0x16')](function(_0x219e46){logger[_0xa8b1('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a3030,_0x219e46);_0xabb2b9(_0x219e46);});});} \ No newline at end of file +var _0x78f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x3cf8cf,_0x4e71e7){var _0x1f56f9=function(_0x768e77){while(--_0x768e77){_0x3cf8cf['push'](_0x3cf8cf['shift']());}};_0x1f56f9(++_0x4e71e7);}(_0x78f0,0x15d));var _0x078f=function(_0x2cec9d,_0x26c51c){_0x2cec9d=_0x2cec9d-0x0;var _0x4695c7=_0x78f0[_0x2cec9d];return _0x4695c7;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4f0e791..8d7596e 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 _0x4ffa=['index','get','post','create','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x4ffa,0x124));var _0xa4ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4ffa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa4ff('0x0'));var timeout=require('connect-timeout');var express=require(_0xa4ff('0x1'));var router=express[_0xa4ff('0x2')]();var auth=require(_0xa4ff('0x3'));var interaction=require(_0xa4ff('0x4'));var config=require(_0xa4ff('0x5'));var controller=require(_0xa4ff('0x6'));router['get']('/',auth[_0xa4ff('0x7')](),controller[_0xa4ff('0x8')]);router[_0xa4ff('0x9')]('/:id',auth[_0xa4ff('0x7')](),controller['show']);router[_0xa4ff('0xa')]('/',auth[_0xa4ff('0x7')](),controller[_0xa4ff('0xb')]);router['put'](_0xa4ff('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa4ff('0xc'),auth[_0xa4ff('0x7')](),controller[_0xa4ff('0xd')]);module[_0xa4ff('0xe')]=router; \ No newline at end of file +var _0xdc9b=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','show','post','create','put'];(function(_0xceeceb,_0x1f00b3){var _0x26aa0c=function(_0x3e7cea){while(--_0x3e7cea){_0xceeceb['push'](_0xceeceb['shift']());}};_0x26aa0c(++_0x1f00b3);}(_0xdc9b,0x70));var _0xbdc9=function(_0x272c5f,_0x29a22f){_0x272c5f=_0x272c5f-0x0;var _0x252f3c=_0xdc9b[_0x272c5f];return _0x252f3c;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbdc9('0x5'));var controller=require(_0xbdc9('0x6'));router['get']('/',auth[_0xbdc9('0x7')](),controller[_0xbdc9('0x8')]);router['get'](_0xbdc9('0x9'),auth['isAuthenticated'](),controller[_0xbdc9('0xa')]);router[_0xbdc9('0xb')]('/',auth[_0xbdc9('0x7')](),controller[_0xbdc9('0xc')]);router[_0xbdc9('0xd')](_0xbdc9('0x9'),auth[_0xbdc9('0x7')](),controller[_0xbdc9('0xe')]);router[_0xbdc9('0xf')](_0xbdc9('0x9'),auth[_0xbdc9('0x7')](),controller[_0xbdc9('0x10')]);module[_0xbdc9('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 294f524..6e74641 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 _0x1bf5=['BOOLEAN','sequelize','exports','STRING'];(function(_0x564d22,_0x4b14a6){var _0x4b6f72=function(_0x219503){while(--_0x219503){_0x564d22['push'](_0x564d22['shift']());}};_0x4b6f72(++_0x4b14a6);}(_0x1bf5,0xe9));var _0x51bf=function(_0x58b39f,_0x2e2f91){_0x58b39f=_0x58b39f-0x0;var _0x527eee=_0x1bf5[_0x58b39f];return _0x527eee;};'use strict';var Sequelize=require(_0x51bf('0x0'));module[_0x51bf('0x1')]={'name':{'type':Sequelize[_0x51bf('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x51bf('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x51bf('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xafc5=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0xe627fd,_0x23eca5){var _0xe431c1=function(_0x5c1355){while(--_0x5c1355){_0xe627fd['push'](_0xe627fd['shift']());}};_0xe431c1(++_0x23eca5);}(_0xafc5,0x17c));var _0x5afc=function(_0x560dee,_0x211d6a){_0x560dee=_0x560dee-0x0;var _0x6eb804=_0xafc5[_0x560dee];return _0x6eb804;};'use strict';var Sequelize=require(_0x5afc('0x0'));module[_0x5afc('0x1')]={'name':{'type':Sequelize[_0x5afc('0x2')],'unique':_0x5afc('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5afc('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 76183af..e3d26fe 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 _0xc604=['key','field','options','count','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','role','user','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','render','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','get','UserProfileResource','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type'];(function(_0x481df4,_0x329355){var _0x2d136c=function(_0x10fba4){while(--_0x10fba4){_0x481df4['push'](_0x481df4['shift']());}};_0x2d136c(++_0x329355);}(_0xc604,0x83));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4c60('0x0'));var emlformat=require(_0x4c60('0x1'));var rimraf=require(_0x4c60('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c60('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c60('0x4'));var Mustache=require(_0x4c60('0x5'));var util=require(_0x4c60('0x6'));var path=require(_0x4c60('0x7'));var sox=require(_0x4c60('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c60('0x9'));var squel=require(_0x4c60('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c60('0xb'));var toCsv=require(_0x4c60('0xc'));var querystring=require(_0x4c60('0xd'));var Papa=require(_0x4c60('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4c60('0xf'));var logger=require(_0x4c60('0x10'))(_0x4c60('0x11'));var utils=require(_0x4c60('0x12'));var config=require(_0x4c60('0x13'));var db=require(_0x4c60('0x14'))['db'];var jayson=require(_0x4c60('0x15'));var client=jayson['client'][_0x4c60('0x16')]({'port':0x232a});function checkPasswordPattern(_0x57b1ec,_0x25a5cb,_0x117ea1){if(_0x117ea1){var _0x5d6ef9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d6ef9[_0x4c60('0x17')](_0x25a5cb)){return _0x57b1ec;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x57b1ec;}}function respondWithRpcPromise(_0x1c97f6,_0x52c22c,_0x5c2219,_0x73c2c1){return new BPromise(function(_0x585cbc,_0x568a29){var _0x20b63f=_0x73c2c1||client;return _0x20b63f[_0x4c60('0x18')](_0x1c97f6,_0x5c2219)[_0x4c60('0x19')](function(_0xd3c28d){logger[_0x4c60('0x1a')](_0x4c60('0x1b'),_0x52c22c,_0x4c60('0x1c'));logger[_0x4c60('0x1d')](_0x4c60('0x1e'),_0x52c22c,_0x4c60('0x1c'),JSON[_0x4c60('0x1f')](_0xd3c28d));if(_0xd3c28d['error']){if(_0xd3c28d[_0x4c60('0x20')][_0x4c60('0x21')]===0x1f4){logger[_0x4c60('0x20')]('VoiceContext,\x20%s,\x20%s',_0x52c22c,_0xd3c28d[_0x4c60('0x20')][_0x4c60('0x22')]);return _0x568a29(_0xd3c28d[_0x4c60('0x20')][_0x4c60('0x22')]);}logger[_0x4c60('0x20')](_0x4c60('0x1b'),_0x52c22c,_0xd3c28d[_0x4c60('0x20')][_0x4c60('0x22')]);return _0x585cbc(_0xd3c28d[_0x4c60('0x20')][_0x4c60('0x22')]);}else{logger[_0x4c60('0x1a')](_0x4c60('0x1b'),_0x52c22c,_0x4c60('0x1c'));_0x585cbc(_0xd3c28d[_0x4c60('0x23')]['message']);}})[_0x4c60('0x24')](function(_0x1dd63c){logger[_0x4c60('0x20')](_0x4c60('0x1b'),_0x52c22c,_0x1dd63c);_0x568a29(_0x1dd63c);});});}function respondWithStatusCode(_0xc9ce13,_0x2d01ea){_0x2d01ea=_0x2d01ea||0xcc;return function(_0x4b04d7){if(_0x4b04d7){return _0xc9ce13[_0x4c60('0x25')](_0x2d01ea);}return _0xc9ce13[_0x4c60('0x26')](_0x2d01ea)[_0x4c60('0x27')]();};}function respondWithResult(_0x2a5125,_0x2c0a61){_0x2c0a61=_0x2c0a61||0xc8;return function(_0x188789){if(_0x188789){return _0x2a5125[_0x4c60('0x26')](_0x2c0a61)[_0x4c60('0x28')](_0x188789);}};}function respondWithFilteredResult(_0x44a267,_0xa3f187){return function(_0x1721c6){if(_0x1721c6){var _0x504cc5=_0x1721c6['count'],_0x4bbfc7=_0xa3f187[_0x4c60('0x29')],_0x3c0ef4=_0xa3f187[_0x4c60('0x29')]+_0xa3f187[_0x4c60('0x2a')],_0x373996;if(_0x3c0ef4>=_0x504cc5){_0x3c0ef4=_0x504cc5;_0x373996=0xc8;}else{_0x373996=0xce;}_0x44a267[_0x4c60('0x26')](_0x373996);return _0x44a267['set'](_0x4c60('0x2b'),_0x4bbfc7+'-'+_0x3c0ef4+'/'+_0x504cc5)['json'](_0x1721c6);}return null;};}function patchUpdates(_0x9c7830){return function(_0x301467){try{jsonpatch[_0x4c60('0x2c')](_0x301467,_0x9c7830,!![]);}catch(_0x547c09){return BPromise[_0x4c60('0x2d')](_0x547c09);}return _0x301467['save']();};}function saveUpdates(_0x413132,_0x1ee17b){return function(_0x2e2d6b){if(_0x2e2d6b){return _0x2e2d6b[_0x4c60('0x2e')](_0x413132)['then'](function(_0x342fe2){return _0x342fe2;});}return null;};}function removeEntity(_0x525beb,_0x11e929){return function(_0xb0628a){if(_0xb0628a){return _0xb0628a[_0x4c60('0x2f')]()['then'](function(){var _0x8834d1=_0xb0628a[_0x4c60('0x30')]({'plain':!![]});var _0x16433a='Contexts';return db[_0x4c60('0x31')][_0x4c60('0x2f')]({'where':{'type':_0x16433a,'resourceId':_0x8834d1['id']}})[_0x4c60('0x19')](function(){return _0xb0628a;});})[_0x4c60('0x19')](function(){_0x525beb[_0x4c60('0x26')](0xcc)[_0x4c60('0x27')]();});}};}function handleEntityNotFound(_0x469fe9,_0x4bf3b5){return function(_0xec130f){if(!_0xec130f){_0x469fe9[_0x4c60('0x25')](0x194);}return _0xec130f;};}function handleError(_0x4eacbd,_0x5f41b1){_0x5f41b1=_0x5f41b1||0x1f4;return function(_0x56d094){logger[_0x4c60('0x20')](_0x56d094['stack']);if(_0x56d094[_0x4c60('0x32')]){delete _0x56d094['name'];}_0x4eacbd[_0x4c60('0x26')](_0x5f41b1)[_0x4c60('0x33')](_0x56d094);};}exports[_0x4c60('0x34')]=function(_0x53f432,_0x5c7808){var _0x4cdcf0={},_0x4378da={},_0x45ea14={'count':0x0,'rows':[]};var _0x3df9d4=db[_0x4c60('0x35')][_0x4c60('0x36')];_0x4378da[_0x4c60('0x37')]=_[_0x4c60('0x38')](_0x3df9d4);_0x4378da[_0x4c60('0x39')]=_[_0x4c60('0x38')](_0x53f432[_0x4c60('0x39')]);_0x4378da[_0x4c60('0x3a')]=_[_0x4c60('0x3b')](_0x4378da[_0x4c60('0x37')],_0x4378da[_0x4c60('0x39')]);_0x4cdcf0[_0x4c60('0x3c')]=_['intersection'](_0x4378da[_0x4c60('0x37')],qs[_0x4c60('0x3d')](_0x53f432['query'][_0x4c60('0x3d')]));_0x4cdcf0[_0x4c60('0x3c')]=_0x4cdcf0[_0x4c60('0x3c')][_0x4c60('0x3e')]?_0x4cdcf0['attributes']:_0x4378da['model'];if(!_0x53f432['query'][_0x4c60('0x3f')](_0x4c60('0x40'))){_0x4cdcf0[_0x4c60('0x2a')]=qs[_0x4c60('0x2a')](_0x53f432[_0x4c60('0x39')][_0x4c60('0x2a')]);_0x4cdcf0['offset']=qs[_0x4c60('0x29')](_0x53f432[_0x4c60('0x39')][_0x4c60('0x29')]);}_0x4cdcf0[_0x4c60('0x41')]=qs['sort'](_0x53f432['query'][_0x4c60('0x42')]);_0x4cdcf0[_0x4c60('0x43')]=qs[_0x4c60('0x3a')](_[_0x4c60('0x44')](_0x53f432[_0x4c60('0x39')],_0x4378da[_0x4c60('0x3a')]));if(_0x53f432[_0x4c60('0x39')][_0x4c60('0x45')]){_0x4cdcf0[_0x4c60('0x43')]=_[_0x4c60('0x46')](_0x4cdcf0[_0x4c60('0x43')],{'$or':_[_0x4c60('0x47')](_0x3df9d4,function(_0x32c45e){if(_0x32c45e[_0x4c60('0x48')][_0x4c60('0x49')]!=='VIRTUAL'){var _0x2a02ac={};_0x2a02ac[_0x32c45e[_0x4c60('0x4a')]]={'$like':'%'+_0x53f432['query'][_0x4c60('0x45')]+'%'};return _0x2a02ac;}})});}_0x4cdcf0=_[_0x4c60('0x46')]({},_0x4cdcf0,_0x53f432[_0x4c60('0x4b')]);var _0x54c306={'where':_0x4cdcf0[_0x4c60('0x43')]};return db[_0x4c60('0x35')][_0x4c60('0x4c')](_0x54c306)['then'](function(_0x560feb){_0x45ea14[_0x4c60('0x4c')]=_0x560feb;if(_0x53f432[_0x4c60('0x39')][_0x4c60('0x4d')]){_0x4cdcf0[_0x4c60('0x4e')]=[{'all':!![]}];}return db[_0x4c60('0x35')][_0x4c60('0x4f')](_0x4cdcf0);})['then'](function(_0x4c7eb){_0x45ea14[_0x4c60('0x50')]=_0x4c7eb;return _0x45ea14;})['then'](respondWithFilteredResult(_0x5c7808,_0x4cdcf0))['catch'](handleError(_0x5c7808,null));};exports[_0x4c60('0x51')]=function(_0x1afb4a,_0x673cbf){var _0x1b82ed={'raw':![],'where':{'id':_0x1afb4a[_0x4c60('0x52')]['id']}},_0x10263a={};_0x10263a[_0x4c60('0x37')]=_[_0x4c60('0x38')](db[_0x4c60('0x35')][_0x4c60('0x36')]);_0x10263a[_0x4c60('0x39')]=_[_0x4c60('0x38')](_0x1afb4a['query']);_0x10263a[_0x4c60('0x3a')]=_[_0x4c60('0x3b')](_0x10263a[_0x4c60('0x37')],_0x10263a[_0x4c60('0x39')]);_0x1b82ed[_0x4c60('0x3c')]=_[_0x4c60('0x3b')](_0x10263a[_0x4c60('0x37')],qs[_0x4c60('0x3d')](_0x1afb4a[_0x4c60('0x39')][_0x4c60('0x3d')]));_0x1b82ed[_0x4c60('0x3c')]=_0x1b82ed[_0x4c60('0x3c')][_0x4c60('0x3e')]?_0x1b82ed[_0x4c60('0x3c')]:_0x10263a[_0x4c60('0x37')];if(_0x1afb4a[_0x4c60('0x39')][_0x4c60('0x4d')]){_0x1b82ed[_0x4c60('0x4e')]=[{'all':!![]}];}_0x1b82ed=_[_0x4c60('0x46')]({},_0x1b82ed,_0x1afb4a[_0x4c60('0x4b')]);return db[_0x4c60('0x35')][_0x4c60('0x53')](_0x1b82ed)[_0x4c60('0x19')](handleEntityNotFound(_0x673cbf,null))[_0x4c60('0x19')](respondWithResult(_0x673cbf,null))[_0x4c60('0x24')](handleError(_0x673cbf,null));};exports[_0x4c60('0x54')]=function(_0x702087,_0x325cfe,_0x4aefb5){var _0x388919;return db[_0x4c60('0x35')][_0x4c60('0x54')](_0x702087[_0x4c60('0x55')],{'raw':!![]})[_0x4c60('0x19')](function(_0x2c0761){_0x388919=_0x2c0761;return db[_0x4c60('0x35')][_0x4c60('0x4f')]({'raw':!![]});})['then'](function(_0x989b68){var _0x42622b=fs[_0x4c60('0x56')](path['join'](config['root'],_0x4c60('0x57')),_0x4c60('0x58'));var _0x40ed3e=ejs['render'](_0x42622b,{'contexts':_0x989b68||[]});fs[_0x4c60('0x59')](_0x4c60('0x5a'),_0x40ed3e);})[_0x4c60('0x19')](function(){return respondWithRpcPromise(_0x4c60('0x5b'),_0x4c60('0x54'),{'module':_0x4c60('0x5c')});})[_0x4c60('0x19')](function(){var _0x531692=_0x702087['user'][_0x4c60('0x30')]({'plain':!![]});if(!_0x531692)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x531692[_0x4c60('0x5d')]===_0x4c60('0x5e')){var _0x235471=_0x388919[_0x4c60('0x30')]({'plain':!![]});return db['UserProfileSection'][_0x4c60('0x53')]({'where':{'name':_0x4c60('0x5f'),'userProfileId':_0x531692[_0x4c60('0x60')]},'raw':!![]})[_0x4c60('0x19')](function(_0x2b5ed9){if(_0x2b5ed9&&_0x2b5ed9[_0x4c60('0x61')]===0x0){return db[_0x4c60('0x31')]['create']({'name':_0x235471[_0x4c60('0x32')],'resourceId':_0x235471['id'],'type':_0x2b5ed9[_0x4c60('0x32')],'sectionId':_0x2b5ed9['id']},{})[_0x4c60('0x19')](function(){return _0x388919;});}else{return _0x388919;}})[_0x4c60('0x24')](function(_0x4f3f38){logger[_0x4c60('0x20')](_0x4c60('0x62'),_0x4f3f38);throw _0x4f3f38;});}return _0x388919;})[_0x4c60('0x19')](respondWithResult(_0x325cfe,0xc9))['catch'](handleError(_0x325cfe,null));};exports[_0x4c60('0x2e')]=function(_0x3944d5,_0x1c61e1,_0x4ffd6f){var _0x2d1571;return db[_0x4c60('0x35')][_0x4c60('0x53')]({'where':{'id':_0x3944d5['params']['id']}})[_0x4c60('0x19')](handleEntityNotFound(_0x1c61e1,null))['then'](saveUpdates(_0x3944d5[_0x4c60('0x55')],null))['then'](function(_0x52176c){if(_0x52176c){_0x2d1571=_0x52176c;return db[_0x4c60('0x35')]['findAll']({'raw':!![]});}})['then'](function(_0x27d860){var _0x486710=fs[_0x4c60('0x56')](path[_0x4c60('0x63')](config[_0x4c60('0x64')],_0x4c60('0x57')),_0x4c60('0x58'));var _0x4b0e2a=ejs['render'](_0x486710,{'contexts':_0x27d860||[]});fs[_0x4c60('0x59')](_0x4c60('0x5a'),_0x4b0e2a);})[_0x4c60('0x19')](function(){return respondWithRpcPromise(_0x4c60('0x5b'),'update',{'module':_0x4c60('0x5c')});})[_0x4c60('0x19')](function(){return _0x2d1571;})['then'](respondWithResult(_0x1c61e1,null))[_0x4c60('0x24')](handleError(_0x1c61e1,null));};exports['destroy']=function(_0x45ef43,_0x52210d,_0x3c5682){var _0x410a86;return db[_0x4c60('0x35')][_0x4c60('0x53')]({'where':{'id':_0x45ef43[_0x4c60('0x52')]['id']}})['then'](handleEntityNotFound(_0x52210d,null))['then'](removeEntity(_0x52210d,null))[_0x4c60('0x19')](function(){return db['VoiceContext'][_0x4c60('0x4f')]({'raw':!![]});})['then'](function(_0x18c947){var _0x536621=fs[_0x4c60('0x56')](path[_0x4c60('0x63')](config[_0x4c60('0x64')],_0x4c60('0x57')),_0x4c60('0x58'));var _0x46f252=ejs[_0x4c60('0x65')](_0x536621,{'contexts':_0x18c947});fs[_0x4c60('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x46f252);return respondWithRpcPromise(_0x4c60('0x5b'),_0x4c60('0x2f'),{'module':_0x4c60('0x5c')});})[_0x4c60('0x24')](handleError(_0x52210d,null));}; \ No newline at end of file +var _0x077b=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','join','server/files/templates/context.ejs','utf8','chan_sip.so','destroy','root','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','get','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','VIRTUAL','options','includeAll','show','find','create','findAll','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','role','Contexts'];(function(_0x24bf04,_0x5c478a){var _0x298902=function(_0x2b1a98){while(--_0x2b1a98){_0x24bf04['push'](_0x24bf04['shift']());}};_0x298902(++_0x5c478a);}(_0x077b,0x1e1));var _0xb077=function(_0x122c69,_0x5c96f6){_0x122c69=_0x122c69-0x0;var _0x51c78a=_0x077b[_0x122c69];return _0x51c78a;};'use strict';var pdf=require(_0xb077('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb077('0x1'));var rp=require(_0xb077('0x2'));var moment=require(_0xb077('0x3'));var BPromise=require(_0xb077('0x4'));var Mustache=require('mustache');var util=require(_0xb077('0x5'));var path=require(_0xb077('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb077('0x7'));var crypto=require(_0xb077('0x8'));var jsforce=require(_0xb077('0x9'));var deskjs=require(_0xb077('0xa'));var toCsv=require(_0xb077('0xb'));var querystring=require(_0xb077('0xc'));var Papa=require(_0xb077('0xd'));var Redis=require(_0xb077('0xe'));var authService=require(_0xb077('0xf'));var qs=require(_0xb077('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb077('0x11'))(_0xb077('0x12'));var utils=require(_0xb077('0x13'));var config=require(_0xb077('0x14'));var db=require(_0xb077('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3c377b,_0x25676d,_0x338eab){if(_0x338eab){var _0x27bde4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27bde4[_0xb077('0x16')](_0x25676d)){return _0x3c377b;}else{throw new Error(_0xb077('0x17'));}}else{return _0x3c377b;}}function respondWithRpcPromise(_0x42de2d,_0x515a89,_0x3732be,_0x3fb392){return new BPromise(function(_0x1aced1,_0x4764e2){var _0x41a676=_0x3fb392||client;return _0x41a676['request'](_0x42de2d,_0x3732be)[_0xb077('0x18')](function(_0x3e64c5){logger[_0xb077('0x19')](_0xb077('0x1a'),_0x515a89,'request\x20sent');logger[_0xb077('0x1b')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x515a89,_0xb077('0x1c'),JSON[_0xb077('0x1d')](_0x3e64c5));if(_0x3e64c5[_0xb077('0x1e')]){if(_0x3e64c5[_0xb077('0x1e')]['code']===0x1f4){logger[_0xb077('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x515a89,_0x3e64c5['error'][_0xb077('0x1f')]);return _0x4764e2(_0x3e64c5['error'][_0xb077('0x1f')]);}logger[_0xb077('0x1e')](_0xb077('0x1a'),_0x515a89,_0x3e64c5[_0xb077('0x1e')][_0xb077('0x1f')]);return _0x1aced1(_0x3e64c5[_0xb077('0x1e')]['message']);}else{logger[_0xb077('0x19')]('VoiceContext,\x20%s,\x20%s',_0x515a89,_0xb077('0x1c'));_0x1aced1(_0x3e64c5['result'][_0xb077('0x1f')]);}})[_0xb077('0x20')](function(_0x24a3d4){logger[_0xb077('0x1e')](_0xb077('0x1a'),_0x515a89,_0x24a3d4);_0x4764e2(_0x24a3d4);});});}function respondWithStatusCode(_0x5a0a79,_0x428241){_0x428241=_0x428241||0xcc;return function(_0x1da13f){if(_0x1da13f){return _0x5a0a79[_0xb077('0x21')](_0x428241);}return _0x5a0a79[_0xb077('0x22')](_0x428241)[_0xb077('0x23')]();};}function respondWithResult(_0x5a2e1f,_0x5dd805){_0x5dd805=_0x5dd805||0xc8;return function(_0x540196){if(_0x540196){return _0x5a2e1f['status'](_0x5dd805)[_0xb077('0x24')](_0x540196);}};}function respondWithFilteredResult(_0x457e37,_0x27b36a){return function(_0x1a7816){if(_0x1a7816){var _0x75554a=_0x1a7816[_0xb077('0x25')],_0x52f7b0=_0x27b36a[_0xb077('0x26')],_0x105958=_0x27b36a[_0xb077('0x26')]+_0x27b36a[_0xb077('0x27')],_0x3e02d4;if(_0x105958>=_0x75554a){_0x105958=_0x75554a;_0x3e02d4=0xc8;}else{_0x3e02d4=0xce;}_0x457e37[_0xb077('0x22')](_0x3e02d4);return _0x457e37[_0xb077('0x28')]('Content-Range',_0x52f7b0+'-'+_0x105958+'/'+_0x75554a)[_0xb077('0x24')](_0x1a7816);}return null;};}function patchUpdates(_0x1df472){return function(_0x2efea3){try{jsonpatch[_0xb077('0x29')](_0x2efea3,_0x1df472,!![]);}catch(_0x3854da){return BPromise[_0xb077('0x2a')](_0x3854da);}return _0x2efea3[_0xb077('0x2b')]();};}function saveUpdates(_0x889822,_0x4d216e){return function(_0x25438d){if(_0x25438d){return _0x25438d[_0xb077('0x2c')](_0x889822)[_0xb077('0x18')](function(_0x17d8d1){return _0x17d8d1;});}return null;};}function removeEntity(_0x252f84,_0x28b26a){return function(_0x38777c){if(_0x38777c){return _0x38777c['destroy']()[_0xb077('0x18')](function(){var _0x30fd6a=_0x38777c[_0xb077('0x2d')]({'plain':!![]});var _0x43d63b='Contexts';return db[_0xb077('0x2e')]['destroy']({'where':{'type':_0x43d63b,'resourceId':_0x30fd6a['id']}})[_0xb077('0x18')](function(){return _0x38777c;});})[_0xb077('0x18')](function(){_0x252f84[_0xb077('0x22')](0xcc)[_0xb077('0x23')]();});}};}function handleEntityNotFound(_0x33abbf,_0x3f79a2){return function(_0x2e236c){if(!_0x2e236c){_0x33abbf[_0xb077('0x21')](0x194);}return _0x2e236c;};}function handleError(_0xc1b7f,_0x2c214f){_0x2c214f=_0x2c214f||0x1f4;return function(_0x594d90){logger['error'](_0x594d90[_0xb077('0x2f')]);if(_0x594d90[_0xb077('0x30')]){delete _0x594d90[_0xb077('0x30')];}_0xc1b7f['status'](_0x2c214f)[_0xb077('0x31')](_0x594d90);};}exports[_0xb077('0x32')]=function(_0x5eae1e,_0x537fbc){var _0x42b381={},_0x194ff5={},_0x3d4402={'count':0x0,'rows':[]};var _0x4ef5a5=db[_0xb077('0x33')][_0xb077('0x34')];_0x194ff5[_0xb077('0x35')]=_[_0xb077('0x36')](_0x4ef5a5);_0x194ff5[_0xb077('0x37')]=_[_0xb077('0x36')](_0x5eae1e[_0xb077('0x37')]);_0x194ff5[_0xb077('0x38')]=_[_0xb077('0x39')](_0x194ff5[_0xb077('0x35')],_0x194ff5[_0xb077('0x37')]);_0x42b381[_0xb077('0x3a')]=_['intersection'](_0x194ff5[_0xb077('0x35')],qs['fields'](_0x5eae1e[_0xb077('0x37')][_0xb077('0x3b')]));_0x42b381[_0xb077('0x3a')]=_0x42b381[_0xb077('0x3a')][_0xb077('0x3c')]?_0x42b381[_0xb077('0x3a')]:_0x194ff5[_0xb077('0x35')];if(!_0x5eae1e['query'][_0xb077('0x3d')]('nolimit')){_0x42b381[_0xb077('0x27')]=qs['limit'](_0x5eae1e['query'][_0xb077('0x27')]);_0x42b381[_0xb077('0x26')]=qs['offset'](_0x5eae1e['query'][_0xb077('0x26')]);}_0x42b381['order']=qs['sort'](_0x5eae1e['query'][_0xb077('0x3e')]);_0x42b381[_0xb077('0x3f')]=qs[_0xb077('0x38')](_[_0xb077('0x40')](_0x5eae1e[_0xb077('0x37')],_0x194ff5[_0xb077('0x38')]));if(_0x5eae1e[_0xb077('0x37')]['filter']){_0x42b381[_0xb077('0x3f')]=_[_0xb077('0x41')](_0x42b381[_0xb077('0x3f')],{'$or':_[_0xb077('0x42')](_0x4ef5a5,function(_0x590347){if(_0x590347[_0xb077('0x43')][_0xb077('0x44')]!==_0xb077('0x45')){var _0x2c3247={};_0x2c3247[_0x590347['field']]={'$like':'%'+_0x5eae1e['query']['filter']+'%'};return _0x2c3247;}})});}_0x42b381=_[_0xb077('0x41')]({},_0x42b381,_0x5eae1e[_0xb077('0x46')]);var _0x1d036c={'where':_0x42b381[_0xb077('0x3f')]};return db[_0xb077('0x33')][_0xb077('0x25')](_0x1d036c)['then'](function(_0x39c8e5){_0x3d4402[_0xb077('0x25')]=_0x39c8e5;if(_0x5eae1e[_0xb077('0x37')][_0xb077('0x47')]){_0x42b381['include']=[{'all':!![]}];}return db[_0xb077('0x33')]['findAll'](_0x42b381);})[_0xb077('0x18')](function(_0x248772){_0x3d4402['rows']=_0x248772;return _0x3d4402;})[_0xb077('0x18')](respondWithFilteredResult(_0x537fbc,_0x42b381))['catch'](handleError(_0x537fbc,null));};exports[_0xb077('0x48')]=function(_0x1ab681,_0x484aa7){var _0x38fb05={'raw':![],'where':{'id':_0x1ab681['params']['id']}},_0x54f266={};_0x54f266[_0xb077('0x35')]=_['keys'](db['VoiceContext']['rawAttributes']);_0x54f266[_0xb077('0x37')]=_[_0xb077('0x36')](_0x1ab681['query']);_0x54f266['filters']=_[_0xb077('0x39')](_0x54f266[_0xb077('0x35')],_0x54f266[_0xb077('0x37')]);_0x38fb05[_0xb077('0x3a')]=_['intersection'](_0x54f266[_0xb077('0x35')],qs[_0xb077('0x3b')](_0x1ab681['query']['fields']));_0x38fb05['attributes']=_0x38fb05[_0xb077('0x3a')][_0xb077('0x3c')]?_0x38fb05['attributes']:_0x54f266['model'];if(_0x1ab681[_0xb077('0x37')][_0xb077('0x47')]){_0x38fb05['include']=[{'all':!![]}];}_0x38fb05=_[_0xb077('0x41')]({},_0x38fb05,_0x1ab681[_0xb077('0x46')]);return db[_0xb077('0x33')][_0xb077('0x49')](_0x38fb05)['then'](handleEntityNotFound(_0x484aa7,null))['then'](respondWithResult(_0x484aa7,null))[_0xb077('0x20')](handleError(_0x484aa7,null));};exports[_0xb077('0x4a')]=function(_0xa22f0f,_0x4c4883,_0x48e1bd){var _0x2d5c73;return db[_0xb077('0x33')][_0xb077('0x4a')](_0xa22f0f['body'],{'raw':!![]})['then'](function(_0x25e465){_0x2d5c73=_0x25e465;return db['VoiceContext'][_0xb077('0x4b')]({'raw':!![]});})[_0xb077('0x18')](function(_0x7c450b){var _0x490759=fs['readFileSync'](path['join'](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x2cc978=ejs[_0xb077('0x4c')](_0x490759,{'contexts':_0x7c450b||[]});fs[_0xb077('0x4d')](_0xb077('0x4e'),_0x2cc978);})['then'](function(){return respondWithRpcPromise(_0xb077('0x4f'),_0xb077('0x4a'),{'module':'chan_sip.so'});})[_0xb077('0x18')](function(){var _0xc4692c=_0xa22f0f[_0xb077('0x50')][_0xb077('0x2d')]({'plain':!![]});if(!_0xc4692c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc4692c[_0xb077('0x51')]===_0xb077('0x50')){var _0xd29975=_0x2d5c73[_0xb077('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0xb077('0x49')]({'where':{'name':_0xb077('0x52'),'userProfileId':_0xc4692c[_0xb077('0x53')]},'raw':!![]})['then'](function(_0x35ce82){if(_0x35ce82&&_0x35ce82[_0xb077('0x54')]===0x0){return db[_0xb077('0x2e')][_0xb077('0x4a')]({'name':_0xd29975[_0xb077('0x30')],'resourceId':_0xd29975['id'],'type':_0x35ce82[_0xb077('0x30')],'sectionId':_0x35ce82['id']},{})[_0xb077('0x18')](function(){return _0x2d5c73;});}else{return _0x2d5c73;}})['catch'](function(_0xb9720f){logger[_0xb077('0x1e')](_0xb077('0x55'),_0xb9720f);throw _0xb9720f;});}return _0x2d5c73;})['then'](respondWithResult(_0x4c4883,0xc9))[_0xb077('0x20')](handleError(_0x4c4883,null));};exports[_0xb077('0x2c')]=function(_0x19040a,_0x409e71,_0x9aa42){var _0x24c6a5;return db[_0xb077('0x33')][_0xb077('0x49')]({'where':{'id':_0x19040a[_0xb077('0x56')]['id']}})[_0xb077('0x18')](handleEntityNotFound(_0x409e71,null))[_0xb077('0x18')](saveUpdates(_0x19040a['body'],null))[_0xb077('0x18')](function(_0x414225){if(_0x414225){_0x24c6a5=_0x414225;return db[_0xb077('0x33')][_0xb077('0x4b')]({'raw':!![]});}})[_0xb077('0x18')](function(_0x5f44f3){var _0x38fd04=fs[_0xb077('0x57')](path[_0xb077('0x58')](config['root'],_0xb077('0x59')),_0xb077('0x5a'));var _0x20d167=ejs[_0xb077('0x4c')](_0x38fd04,{'contexts':_0x5f44f3||[]});fs['writeFileSync'](_0xb077('0x4e'),_0x20d167);})[_0xb077('0x18')](function(){return respondWithRpcPromise(_0xb077('0x4f'),'update',{'module':_0xb077('0x5b')});})[_0xb077('0x18')](function(){return _0x24c6a5;})[_0xb077('0x18')](respondWithResult(_0x409e71,null))[_0xb077('0x20')](handleError(_0x409e71,null));};exports[_0xb077('0x5c')]=function(_0x5a150f,_0x4fa2cd,_0x24d391){var _0x46a362;return db[_0xb077('0x33')][_0xb077('0x49')]({'where':{'id':_0x5a150f[_0xb077('0x56')]['id']}})[_0xb077('0x18')](handleEntityNotFound(_0x4fa2cd,null))['then'](removeEntity(_0x4fa2cd,null))[_0xb077('0x18')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xb077('0x18')](function(_0x2f0b1b){var _0xf2a84e=fs[_0xb077('0x57')](path[_0xb077('0x58')](config[_0xb077('0x5d')],_0xb077('0x59')),'utf8');var _0x184055=ejs[_0xb077('0x4c')](_0xf2a84e,{'contexts':_0x2f0b1b});fs['writeFileSync'](_0xb077('0x4e'),_0x184055);return respondWithRpcPromise(_0xb077('0x4f'),_0xb077('0x5c'),{'module':_0xb077('0x5b')});})[_0xb077('0x20')](handleError(_0x4fa2cd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7902b60..d4fea89 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 _0x263e=['bluebird','path','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x263e,0xd8));var _0xe263=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x263e[_0x2a5099];return _0x2802f1;};'use strict';var _=require(_0xe263('0x0'));var util=require(_0xe263('0x1'));var logger=require(_0xe263('0x2'))('api');var moment=require(_0xe263('0x3'));var BPromise=require(_0xe263('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe263('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe263('0x6'));module[_0xe263('0x7')]=function(_0x135c60,_0x53d70f){return _0x135c60[_0xe263('0x8')](_0xe263('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4933=['voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext'];(function(_0x2f1185,_0x301317){var _0x3394e9=function(_0x312e81){while(--_0x312e81){_0x2f1185['push'](_0x2f1185['shift']());}};_0x3394e9(++_0x301317);}(_0x4933,0x9d));var _0x3493=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0x4933[_0x3b7b8a];return _0x441206;};'use strict';var _=require(_0x3493('0x0'));var util=require(_0x3493('0x1'));var logger=require(_0x3493('0x2'))(_0x3493('0x3'));var moment=require(_0x3493('0x4'));var BPromise=require(_0x3493('0x5'));var rp=require(_0x3493('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3493('0x7'));var config=require(_0x3493('0x8'));var attributes=require(_0x3493('0x9'));module['exports']=function(_0x11b699,_0x222b93){return _0x11b699['define'](_0x3493('0xa'),attributes,{'tableName':_0x3493('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 855f4f2..a348d7a 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 _0xd28f=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x33a7ef,_0x425026){var _0x4004d2=function(_0xcbde3c){while(--_0xcbde3c){_0x33a7ef['push'](_0x33a7ef['shift']());}};_0x4004d2(++_0x425026);}(_0xd28f,0x15f));var _0xfd28=function(_0x424a95,_0x18a823){_0x424a95=_0x424a95-0x0;var _0x251592=_0xd28f[_0x424a95];return _0x251592;};'use strict';var _=require('lodash');var util=require(_0xfd28('0x0'));var moment=require(_0xfd28('0x1'));var BPromise=require(_0xfd28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd28('0x3'));var db=require(_0xfd28('0x4'))['db'];var utils=require(_0xfd28('0x5'));var logger=require(_0xfd28('0x6'))(_0xfd28('0x7'));var config=require(_0xfd28('0x8'));var jayson=require(_0xfd28('0x9'));var client=jayson[_0xfd28('0xa')][_0xfd28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d39f,_0x4087f0,_0x479f56){return new BPromise(function(_0x24a318,_0x534e7b){return client[_0xfd28('0xc')](_0x32d39f,_0x479f56)[_0xfd28('0xd')](function(_0x597ad6){logger['info'](_0xfd28('0xe'),_0x4087f0,_0xfd28('0xf'));logger[_0xfd28('0x10')](_0xfd28('0x11'),_0x4087f0,_0xfd28('0xf'),JSON[_0xfd28('0x12')](_0x597ad6));if(_0x597ad6[_0xfd28('0x13')]){if(_0x597ad6['error'][_0xfd28('0x14')]===0x1f4){logger[_0xfd28('0x13')](_0xfd28('0xe'),_0x4087f0,_0x597ad6[_0xfd28('0x13')][_0xfd28('0x15')]);return _0x534e7b(_0x597ad6[_0xfd28('0x13')][_0xfd28('0x15')]);}logger['error'](_0xfd28('0xe'),_0x4087f0,_0x597ad6[_0xfd28('0x13')][_0xfd28('0x15')]);return _0x24a318(_0x597ad6[_0xfd28('0x13')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x4087f0,_0xfd28('0xf'));_0x24a318(_0x597ad6['result'][_0xfd28('0x15')]);}})[_0xfd28('0x16')](function(_0x2b21eb){logger[_0xfd28('0x13')](_0xfd28('0xe'),_0x4087f0,_0x2b21eb);_0x534e7b(_0x2b21eb);});});} \ No newline at end of file +var _0xeec9=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x388a1a,_0x4c01b0){var _0xe50c87=function(_0x27c317){while(--_0x27c317){_0x388a1a['push'](_0x388a1a['shift']());}};_0xe50c87(++_0x4c01b0);}(_0xeec9,0x94));var _0x9eec=function(_0x375372,_0x5538ad){_0x375372=_0x375372-0x0;var _0x5cea78=_0xeec9[_0x375372];return _0x5cea78;};'use strict';var _=require('lodash');var util=require(_0x9eec('0x0'));var moment=require(_0x9eec('0x1'));var BPromise=require(_0x9eec('0x2'));var rs=require(_0x9eec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eec('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9eec('0x5'));var config=require('../../config/environment');var jayson=require(_0x9eec('0x6'));var client=jayson[_0x9eec('0x7')][_0x9eec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x599194,_0x50e20a,_0x5c4410){return new BPromise(function(_0x5539ef,_0x2095c0){return client['request'](_0x599194,_0x5c4410)[_0x9eec('0x9')](function(_0x203521){logger['info'](_0x9eec('0xa'),_0x50e20a,_0x9eec('0xb'));logger[_0x9eec('0xc')](_0x9eec('0xd'),_0x50e20a,'request\x20sent',JSON[_0x9eec('0xe')](_0x203521));if(_0x203521[_0x9eec('0xf')]){if(_0x203521[_0x9eec('0xf')][_0x9eec('0x10')]===0x1f4){logger[_0x9eec('0xf')]('VoiceContext,\x20%s,\x20%s',_0x50e20a,_0x203521[_0x9eec('0xf')][_0x9eec('0x11')]);return _0x2095c0(_0x203521[_0x9eec('0xf')][_0x9eec('0x11')]);}logger[_0x9eec('0xf')](_0x9eec('0xa'),_0x50e20a,_0x203521[_0x9eec('0xf')][_0x9eec('0x11')]);return _0x5539ef(_0x203521['error'][_0x9eec('0x11')]);}else{logger[_0x9eec('0x12')](_0x9eec('0xa'),_0x50e20a,_0x9eec('0xb'));_0x5539ef(_0x203521[_0x9eec('0x13')][_0x9eec('0x11')]);}})['catch'](function(_0x126bdd){logger[_0x9eec('0xf')](_0x9eec('0xa'),_0x50e20a,_0x126bdd);_0x2095c0(_0x126bdd);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6228035..8ffc896 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 _0xd184=['./voiceDialReport.controller','get','isAuthenticated','describe','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xd184,0x1da));var _0x4d18=function(_0x2d8ffd,_0x45601a){_0x2d8ffd=_0x2d8ffd-0x0;var _0x3b7817=_0xd184[_0x2d8ffd];return _0x3b7817;};'use strict';var multer=require('multer');var util=require(_0x4d18('0x0'));var path=require(_0x4d18('0x1'));var timeout=require(_0x4d18('0x2'));var express=require(_0x4d18('0x3'));var router=express[_0x4d18('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d18('0x5'));var config=require('../../config/environment');var controller=require(_0x4d18('0x6'));router[_0x4d18('0x7')]('/',auth[_0x4d18('0x8')](),controller['index']);router[_0x4d18('0x7')]('/describe',auth[_0x4d18('0x8')](),controller[_0x4d18('0x9')]);router[_0x4d18('0x7')]('/:id',auth[_0x4d18('0x8')](),controller[_0x4d18('0xa')]);router[_0x4d18('0xb')]('/',auth[_0x4d18('0x8')](),controller[_0x4d18('0xc')]);router[_0x4d18('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4d18('0x8')](),controller[_0x4d18('0xe')]);module[_0x4d18('0xf')]=router; \ No newline at end of file +var _0xd592=['/describe','/:id','show','isAuthenticated','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','get','index'];(function(_0x46ded9,_0x115858){var _0x22087b=function(_0x1327ff){while(--_0x1327ff){_0x46ded9['push'](_0x46ded9['shift']());}};_0x22087b(++_0x115858);}(_0xd592,0x125));var _0x2d59=function(_0x20fd0d,_0x53cae1){_0x20fd0d=_0x20fd0d-0x0;var _0x292701=_0xd592[_0x20fd0d];return _0x292701;};'use strict';var multer=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d59('0x2')]();var auth=require(_0x2d59('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d59('0x4'));var controller=require('./voiceDialReport.controller');router[_0x2d59('0x5')]('/',auth['isAuthenticated'](),controller[_0x2d59('0x6')]);router['get'](_0x2d59('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x2d59('0x5')](_0x2d59('0x8'),auth['isAuthenticated'](),controller[_0x2d59('0x9')]);router['post']('/',auth[_0x2d59('0xa')](),controller['create']);router[_0x2d59('0xb')]('/:id',auth[_0x2d59('0xa')](),controller[_0x2d59('0xc')]);router['delete'](_0x2d59('0x8'),auth['isAuthenticated'](),controller[_0x2d59('0xd')]);module[_0x2d59('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7f68179..7341931 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 _0x1bf7=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x3e7034,_0x1c36c2){var _0xd7a4b4=function(_0x5896b9){while(--_0x5896b9){_0x3e7034['push'](_0x3e7034['shift']());}};_0xd7a4b4(++_0x1c36c2);}(_0x1bf7,0x1cc));var _0x71bf=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x1bf7[_0x58db4e];return _0x40139a;};'use strict';var Sequelize=require(_0x71bf('0x0'));module[_0x71bf('0x1')]={'privilege':{'type':Sequelize[_0x71bf('0x2')]},'channel':{'type':Sequelize[_0x71bf('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x71bf('0x2')]},'calleridname':{'type':Sequelize[_0x71bf('0x2')]},'connectedlinenum':{'type':Sequelize[_0x71bf('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x71bf('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x71bf('0x2')]},'priority':{'type':Sequelize[_0x71bf('0x3')]},'uniqueid':{'type':Sequelize[_0x71bf('0x2')]},'linkedid':{'type':Sequelize[_0x71bf('0x2')]},'destchannel':{'type':Sequelize[_0x71bf('0x2')]},'destchannelstate':{'type':Sequelize[_0x71bf('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x71bf('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x71bf('0x2')]},'destlanguage':{'type':Sequelize[_0x71bf('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x71bf('0x2')]},'destexten':{'type':Sequelize[_0x71bf('0x2')]},'destpriority':{'type':Sequelize[_0x71bf('0x3')]},'destuniqueid':{'type':Sequelize[_0x71bf('0x2')]},'destlinkedid':{'type':Sequelize[_0x71bf('0x2')]},'dialstring':{'type':Sequelize[_0x71bf('0x2')]},'dialstatus':{'type':Sequelize[_0x71bf('0x2')]},'starttime':{'type':Sequelize[_0x71bf('0x4')]},'answertime':{'type':Sequelize[_0x71bf('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x71bf('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x71bf('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x71bf('0x3')]}}; \ No newline at end of file +var _0x8f18=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x5a8bb3,_0x17249f){var _0x3f0a3a=function(_0x3b84ce){while(--_0x3b84ce){_0x5a8bb3['push'](_0x5a8bb3['shift']());}};_0x3f0a3a(++_0x17249f);}(_0x8f18,0x1ea));var _0x88f1=function(_0x5c8d70,_0x27a343){_0x5c8d70=_0x5c8d70-0x0;var _0x59afc3=_0x8f18[_0x5c8d70];return _0x59afc3;};'use strict';var Sequelize=require(_0x88f1('0x0'));module[_0x88f1('0x1')]={'privilege':{'type':Sequelize[_0x88f1('0x2')]},'channel':{'type':Sequelize[_0x88f1('0x2')]},'channelstate':{'type':Sequelize[_0x88f1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x88f1('0x2')]},'calleridnum':{'type':Sequelize[_0x88f1('0x2')]},'calleridname':{'type':Sequelize[_0x88f1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x88f1('0x2')]},'connectedlinename':{'type':Sequelize[_0x88f1('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x88f1('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x88f1('0x2')]},'priority':{'type':Sequelize[_0x88f1('0x3')]},'uniqueid':{'type':Sequelize[_0x88f1('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x88f1('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x88f1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x88f1('0x2')]},'destcalleridname':{'type':Sequelize[_0x88f1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x88f1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x88f1('0x2')]},'destlanguage':{'type':Sequelize[_0x88f1('0x2')]},'destaccountcode':{'type':Sequelize[_0x88f1('0x2')]},'destcontext':{'type':Sequelize[_0x88f1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x88f1('0x2')]},'destlinkedid':{'type':Sequelize[_0x88f1('0x2')]},'dialstring':{'type':Sequelize[_0x88f1('0x2')]},'dialstatus':{'type':Sequelize[_0x88f1('0x2')]},'starttime':{'type':Sequelize[_0x88f1('0x4')]},'answertime':{'type':Sequelize[_0x88f1('0x4')]},'endtime':{'type':Sequelize[_0x88f1('0x4')]},'lastevent':{'type':Sequelize[_0x88f1('0x2')],'comment':_0x88f1('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x88f1('0x3')]},'holdtime':{'type':Sequelize[_0x88f1('0x3')]},'billableseconds':{'type':Sequelize[_0x88f1('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ae64487..8a792c6 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 _0xd5b6=['query','keys','intersection','model','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filters','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','attributes','find','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','VoiceDialReport'];(function(_0x1f8cb3,_0x5b81d8){var _0x2428e2=function(_0xa3dff5){while(--_0xa3dff5){_0x1f8cb3['push'](_0x1f8cb3['shift']());}};_0x2428e2(++_0x5b81d8);}(_0xd5b6,0x73));var _0x6d5b=function(_0x19c74f,_0x4489dd){_0x19c74f=_0x19c74f-0x0;var _0x1bb0c5=_0xd5b6[_0x19c74f];return _0x1bb0c5;};'use strict';var pdf=require(_0x6d5b('0x0'));var emlformat=require(_0x6d5b('0x1'));var rimraf=require(_0x6d5b('0x2'));var zipdir=require(_0x6d5b('0x3'));var jsonpatch=require(_0x6d5b('0x4'));var rp=require(_0x6d5b('0x5'));var moment=require(_0x6d5b('0x6'));var BPromise=require(_0x6d5b('0x7'));var Mustache=require('mustache');var util=require(_0x6d5b('0x8'));var path=require(_0x6d5b('0x9'));var sox=require(_0x6d5b('0xa'));var csv=require('to-csv');var ejs=require(_0x6d5b('0xb'));var fs=require('fs');var _=require(_0x6d5b('0xc'));var squel=require(_0x6d5b('0xd'));var crypto=require(_0x6d5b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d5b('0xf'));var querystring=require(_0x6d5b('0x10'));var Papa=require(_0x6d5b('0x11'));var Redis=require(_0x6d5b('0x12'));var authService=require(_0x6d5b('0x13'));var qs=require(_0x6d5b('0x14'));var hardwareService=require(_0x6d5b('0x15'));var logger=require(_0x6d5b('0x16'))(_0x6d5b('0x17'));var utils=require(_0x6d5b('0x18'));var config=require(_0x6d5b('0x19'));var db=require(_0x6d5b('0x1a'))['db'];function respondWithStatusCode(_0x3a54dd,_0x2cb5c1){_0x2cb5c1=_0x2cb5c1||0xcc;return function(_0x267798){if(_0x267798){return _0x3a54dd[_0x6d5b('0x1b')](_0x2cb5c1);}return _0x3a54dd[_0x6d5b('0x1c')](_0x2cb5c1)[_0x6d5b('0x1d')]();};}function respondWithResult(_0x53c367,_0x2be3ab){_0x2be3ab=_0x2be3ab||0xc8;return function(_0x33d3a9){if(_0x33d3a9){return _0x53c367[_0x6d5b('0x1c')](_0x2be3ab)[_0x6d5b('0x1e')](_0x33d3a9);}};}function respondWithFilteredResult(_0x12b0dc,_0x4cc031){return function(_0x3c8078){if(_0x3c8078){var _0x1e6814=_0x3c8078[_0x6d5b('0x1f')],_0x51eb25=_0x4cc031['offset'],_0x2baf47=_0x4cc031['offset']+_0x4cc031['limit'],_0x5debab;if(_0x2baf47>=_0x1e6814){_0x2baf47=_0x1e6814;_0x5debab=0xc8;}else{_0x5debab=0xce;}_0x12b0dc[_0x6d5b('0x1c')](_0x5debab);return _0x12b0dc[_0x6d5b('0x20')](_0x6d5b('0x21'),_0x51eb25+'-'+_0x2baf47+'/'+_0x1e6814)['json'](_0x3c8078);}return null;};}function patchUpdates(_0xb12444){return function(_0x25f8cc){try{jsonpatch[_0x6d5b('0x22')](_0x25f8cc,_0xb12444,!![]);}catch(_0x51a8d9){return BPromise[_0x6d5b('0x23')](_0x51a8d9);}return _0x25f8cc['save']();};}function saveUpdates(_0x40348a,_0x2e1ecf){return function(_0x26b175){if(_0x26b175){return _0x26b175['update'](_0x40348a)[_0x6d5b('0x24')](function(_0x195fd6){return _0x195fd6;});}return null;};}function removeEntity(_0xf59341,_0x18f8bb){return function(_0x672e5b){if(_0x672e5b){return _0x672e5b[_0x6d5b('0x25')]()[_0x6d5b('0x24')](function(){_0xf59341[_0x6d5b('0x1c')](0xcc)[_0x6d5b('0x1d')]();});}};}function handleEntityNotFound(_0xae55d9,_0x1b5261){return function(_0xc1087e){if(!_0xc1087e){_0xae55d9[_0x6d5b('0x1b')](0x194);}return _0xc1087e;};}function handleError(_0xc0d36c,_0x4d86e3){_0x4d86e3=_0x4d86e3||0x1f4;return function(_0x38efa7){logger['error'](_0x38efa7[_0x6d5b('0x26')]);if(_0x38efa7[_0x6d5b('0x27')]){delete _0x38efa7[_0x6d5b('0x27')];}_0xc0d36c[_0x6d5b('0x1c')](_0x4d86e3)[_0x6d5b('0x28')](_0x38efa7);};}exports[_0x6d5b('0x29')]=function(_0x1be755,_0x33ae72){var _0x1fac80={},_0x2076f1={},_0x158584={'count':0x0,'rows':[]};var _0x407513=db[_0x6d5b('0x2a')]['rawAttributes'];_0x2076f1['model']=_['keys'](_0x407513);_0x2076f1[_0x6d5b('0x2b')]=_[_0x6d5b('0x2c')](_0x1be755[_0x6d5b('0x2b')]);_0x2076f1['filters']=_[_0x6d5b('0x2d')](_0x2076f1[_0x6d5b('0x2e')],_0x2076f1['query']);_0x1fac80['attributes']=_[_0x6d5b('0x2d')](_0x2076f1[_0x6d5b('0x2e')],qs[_0x6d5b('0x2f')](_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x2f')]));_0x1fac80['attributes']=_0x1fac80['attributes'][_0x6d5b('0x30')]?_0x1fac80['attributes']:_0x2076f1[_0x6d5b('0x2e')];if(!_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x31')](_0x6d5b('0x32'))){_0x1fac80[_0x6d5b('0x33')]=qs[_0x6d5b('0x33')](_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x33')]);_0x1fac80['offset']=qs[_0x6d5b('0x34')](_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x34')]);}_0x1fac80[_0x6d5b('0x35')]=qs[_0x6d5b('0x36')](_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x36')]);_0x1fac80[_0x6d5b('0x37')]=qs['filters'](_[_0x6d5b('0x38')](_0x1be755[_0x6d5b('0x2b')],_0x2076f1[_0x6d5b('0x39')]));if(_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x3a')]){_0x1fac80[_0x6d5b('0x37')]=_['merge'](_0x1fac80['where'],{'$or':_[_0x6d5b('0x3b')](_0x407513,function(_0x39c419){if(_0x39c419[_0x6d5b('0x3c')][_0x6d5b('0x3d')]!==_0x6d5b('0x3e')){var _0xf1abf4={};_0xf1abf4[_0x39c419[_0x6d5b('0x3f')]]={'$like':'%'+_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x3a')]+'%'};return _0xf1abf4;}})});}_0x1fac80=_[_0x6d5b('0x40')]({},_0x1fac80,_0x1be755[_0x6d5b('0x41')]);var _0x55915a={'where':_0x1fac80['where']};return db[_0x6d5b('0x2a')][_0x6d5b('0x1f')](_0x55915a)[_0x6d5b('0x24')](function(_0x2bd66d){_0x158584['count']=_0x2bd66d;if(_0x1be755[_0x6d5b('0x2b')][_0x6d5b('0x42')]){_0x1fac80[_0x6d5b('0x43')]=[{'all':!![]}];}return db[_0x6d5b('0x2a')][_0x6d5b('0x44')](_0x1fac80);})[_0x6d5b('0x24')](function(_0x346769){_0x158584[_0x6d5b('0x45')]=_0x346769;return _0x158584;})[_0x6d5b('0x24')](respondWithFilteredResult(_0x33ae72,_0x1fac80))[_0x6d5b('0x46')](handleError(_0x33ae72,null));};exports[_0x6d5b('0x47')]=function(_0x150bce,_0x192d14){var _0x4e91a5={'raw':!![],'where':{'id':_0x150bce[_0x6d5b('0x48')]['id']}},_0x5ae3e4={};_0x5ae3e4[_0x6d5b('0x2e')]=_[_0x6d5b('0x2c')](db[_0x6d5b('0x2a')][_0x6d5b('0x49')]);_0x5ae3e4[_0x6d5b('0x2b')]=_[_0x6d5b('0x2c')](_0x150bce[_0x6d5b('0x2b')]);_0x5ae3e4[_0x6d5b('0x39')]=_['intersection'](_0x5ae3e4[_0x6d5b('0x2e')],_0x5ae3e4['query']);_0x4e91a5[_0x6d5b('0x4a')]=_['intersection'](_0x5ae3e4[_0x6d5b('0x2e')],qs[_0x6d5b('0x2f')](_0x150bce[_0x6d5b('0x2b')]['fields']));_0x4e91a5['attributes']=_0x4e91a5[_0x6d5b('0x4a')]['length']?_0x4e91a5[_0x6d5b('0x4a')]:_0x5ae3e4[_0x6d5b('0x2e')];if(_0x150bce[_0x6d5b('0x2b')]['includeAll']){_0x4e91a5[_0x6d5b('0x43')]=[{'all':!![]}];}_0x4e91a5=_['merge']({},_0x4e91a5,_0x150bce[_0x6d5b('0x41')]);return db[_0x6d5b('0x2a')][_0x6d5b('0x4b')](_0x4e91a5)['then'](handleEntityNotFound(_0x192d14,null))['then'](respondWithResult(_0x192d14,null))['catch'](handleError(_0x192d14,null));};exports['create']=function(_0x5b52b5,_0xea629b){return db[_0x6d5b('0x2a')]['create'](_0x5b52b5[_0x6d5b('0x4c')],{})[_0x6d5b('0x24')](respondWithResult(_0xea629b,0xc9))[_0x6d5b('0x46')](handleError(_0xea629b,null));};exports[_0x6d5b('0x4d')]=function(_0x15322e,_0x29d3a4){if(_0x15322e[_0x6d5b('0x4c')]['id']){delete _0x15322e[_0x6d5b('0x4c')]['id'];}return db[_0x6d5b('0x2a')]['find']({'where':{'id':_0x15322e[_0x6d5b('0x48')]['id']}})[_0x6d5b('0x24')](handleEntityNotFound(_0x29d3a4,null))[_0x6d5b('0x24')](saveUpdates(_0x15322e[_0x6d5b('0x4c')],null))[_0x6d5b('0x24')](respondWithResult(_0x29d3a4,null))[_0x6d5b('0x46')](handleError(_0x29d3a4,null));};exports[_0x6d5b('0x25')]=function(_0x1b543f,_0x72479c){return db[_0x6d5b('0x2a')][_0x6d5b('0x4b')]({'where':{'id':_0x1b543f['params']['id']}})['then'](handleEntityNotFound(_0x72479c,null))[_0x6d5b('0x24')](removeEntity(_0x72479c,null))[_0x6d5b('0x46')](handleError(_0x72479c,null));};exports[_0x6d5b('0x4e')]=function(_0x1f4dd8,_0x24f009){return db[_0x6d5b('0x2a')][_0x6d5b('0x4e')]()[_0x6d5b('0x24')](respondWithResult(_0x24f009,null))[_0x6d5b('0x46')](handleError(_0x24f009,null));}; \ No newline at end of file +var _0x9904=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','then','include','VoiceDialReport','findAll','rows','params','rawAttributes','includeAll','merge','options','find','create','body','catch','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','model','keys','query','filters','attributes','intersection'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x9904,0xf5));var _0x4990=function(_0xb8104c,_0x2deacc){_0xb8104c=_0xb8104c-0x0;var _0x38ac32=_0x9904[_0xb8104c];return _0x38ac32;};'use strict';var pdf=require(_0x4990('0x0'));var emlformat=require(_0x4990('0x1'));var rimraf=require(_0x4990('0x2'));var zipdir=require(_0x4990('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4990('0x4'));var moment=require(_0x4990('0x5'));var BPromise=require(_0x4990('0x6'));var Mustache=require(_0x4990('0x7'));var util=require(_0x4990('0x8'));var path=require('path');var sox=require(_0x4990('0x9'));var csv=require(_0x4990('0xa'));var ejs=require(_0x4990('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4990('0xc'));var crypto=require(_0x4990('0xd'));var jsforce=require(_0x4990('0xe'));var deskjs=require(_0x4990('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4990('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4990('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4990('0x12'))(_0x4990('0x13'));var utils=require('../../config/utils');var config=require(_0x4990('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2dc5,_0x5cb75e){_0x5cb75e=_0x5cb75e||0xcc;return function(_0x18ee83){if(_0x18ee83){return _0x4c2dc5['sendStatus'](_0x5cb75e);}return _0x4c2dc5[_0x4990('0x15')](_0x5cb75e)[_0x4990('0x16')]();};}function respondWithResult(_0x1f69e3,_0x55efdc){_0x55efdc=_0x55efdc||0xc8;return function(_0x5600e8){if(_0x5600e8){return _0x1f69e3[_0x4990('0x15')](_0x55efdc)[_0x4990('0x17')](_0x5600e8);}};}function respondWithFilteredResult(_0x18a653,_0x572489){return function(_0x325411){if(_0x325411){var _0x586745=_0x325411[_0x4990('0x18')],_0x56c1e9=_0x572489[_0x4990('0x19')],_0x11c611=_0x572489[_0x4990('0x19')]+_0x572489[_0x4990('0x1a')],_0x1cd9df;if(_0x11c611>=_0x586745){_0x11c611=_0x586745;_0x1cd9df=0xc8;}else{_0x1cd9df=0xce;}_0x18a653['status'](_0x1cd9df);return _0x18a653[_0x4990('0x1b')](_0x4990('0x1c'),_0x56c1e9+'-'+_0x11c611+'/'+_0x586745)[_0x4990('0x17')](_0x325411);}return null;};}function patchUpdates(_0xbe2dd2){return function(_0x5971fc){try{jsonpatch[_0x4990('0x1d')](_0x5971fc,_0xbe2dd2,!![]);}catch(_0x2e7b5d){return BPromise[_0x4990('0x1e')](_0x2e7b5d);}return _0x5971fc['save']();};}function saveUpdates(_0x177ba5,_0x3411a1){return function(_0x124270){if(_0x124270){return _0x124270[_0x4990('0x1f')](_0x177ba5)['then'](function(_0x2a738f){return _0x2a738f;});}return null;};}function removeEntity(_0x3787d2,_0x50a902){return function(_0x148829){if(_0x148829){return _0x148829[_0x4990('0x20')]()['then'](function(){_0x3787d2[_0x4990('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ebcba,_0x44796e){return function(_0x15f603){if(!_0x15f603){_0x5ebcba[_0x4990('0x21')](0x194);}return _0x15f603;};}function handleError(_0x18320f,_0x5bead7){_0x5bead7=_0x5bead7||0x1f4;return function(_0x3d3c06){logger['error'](_0x3d3c06[_0x4990('0x22')]);if(_0x3d3c06[_0x4990('0x23')]){delete _0x3d3c06['name'];}_0x18320f[_0x4990('0x15')](_0x5bead7)[_0x4990('0x24')](_0x3d3c06);};}exports['index']=function(_0x56bda1,_0x365d31){var _0x4b69d8={},_0x173027={},_0x1c3c0f={'count':0x0,'rows':[]};var _0x12f633=db['VoiceDialReport']['rawAttributes'];_0x173027[_0x4990('0x25')]=_[_0x4990('0x26')](_0x12f633);_0x173027[_0x4990('0x27')]=_[_0x4990('0x26')](_0x56bda1[_0x4990('0x27')]);_0x173027[_0x4990('0x28')]=_['intersection'](_0x173027[_0x4990('0x25')],_0x173027[_0x4990('0x27')]);_0x4b69d8[_0x4990('0x29')]=_[_0x4990('0x2a')](_0x173027[_0x4990('0x25')],qs[_0x4990('0x2b')](_0x56bda1[_0x4990('0x27')][_0x4990('0x2b')]));_0x4b69d8[_0x4990('0x29')]=_0x4b69d8[_0x4990('0x29')][_0x4990('0x2c')]?_0x4b69d8[_0x4990('0x29')]:_0x173027[_0x4990('0x25')];if(!_0x56bda1[_0x4990('0x27')][_0x4990('0x2d')](_0x4990('0x2e'))){_0x4b69d8[_0x4990('0x1a')]=qs[_0x4990('0x1a')](_0x56bda1[_0x4990('0x27')][_0x4990('0x1a')]);_0x4b69d8[_0x4990('0x19')]=qs['offset'](_0x56bda1[_0x4990('0x27')][_0x4990('0x19')]);}_0x4b69d8[_0x4990('0x2f')]=qs[_0x4990('0x30')](_0x56bda1['query'][_0x4990('0x30')]);_0x4b69d8['where']=qs['filters'](_[_0x4990('0x31')](_0x56bda1['query'],_0x173027[_0x4990('0x28')]));if(_0x56bda1['query'][_0x4990('0x32')]){_0x4b69d8[_0x4990('0x33')]=_['merge'](_0x4b69d8[_0x4990('0x33')],{'$or':_[_0x4990('0x34')](_0x12f633,function(_0x3e1b8e){if(_0x3e1b8e[_0x4990('0x35')][_0x4990('0x36')]!==_0x4990('0x37')){var _0x80dbbe={};_0x80dbbe[_0x3e1b8e[_0x4990('0x38')]]={'$like':'%'+_0x56bda1['query'][_0x4990('0x32')]+'%'};return _0x80dbbe;}})});}_0x4b69d8=_['merge']({},_0x4b69d8,_0x56bda1['options']);var _0x293a87={'where':_0x4b69d8[_0x4990('0x33')]};return db['VoiceDialReport']['count'](_0x293a87)[_0x4990('0x39')](function(_0x371c65){_0x1c3c0f[_0x4990('0x18')]=_0x371c65;if(_0x56bda1['query']['includeAll']){_0x4b69d8[_0x4990('0x3a')]=[{'all':!![]}];}return db[_0x4990('0x3b')][_0x4990('0x3c')](_0x4b69d8);})['then'](function(_0x1246e0){_0x1c3c0f[_0x4990('0x3d')]=_0x1246e0;return _0x1c3c0f;})[_0x4990('0x39')](respondWithFilteredResult(_0x365d31,_0x4b69d8))['catch'](handleError(_0x365d31,null));};exports['show']=function(_0x283a4b,_0x2b0abe){var _0x1db6d7={'raw':!![],'where':{'id':_0x283a4b[_0x4990('0x3e')]['id']}},_0x203d3e={};_0x203d3e[_0x4990('0x25')]=_['keys'](db[_0x4990('0x3b')][_0x4990('0x3f')]);_0x203d3e['query']=_[_0x4990('0x26')](_0x283a4b['query']);_0x203d3e['filters']=_[_0x4990('0x2a')](_0x203d3e[_0x4990('0x25')],_0x203d3e[_0x4990('0x27')]);_0x1db6d7[_0x4990('0x29')]=_['intersection'](_0x203d3e[_0x4990('0x25')],qs['fields'](_0x283a4b[_0x4990('0x27')][_0x4990('0x2b')]));_0x1db6d7[_0x4990('0x29')]=_0x1db6d7[_0x4990('0x29')][_0x4990('0x2c')]?_0x1db6d7[_0x4990('0x29')]:_0x203d3e[_0x4990('0x25')];if(_0x283a4b[_0x4990('0x27')][_0x4990('0x40')]){_0x1db6d7[_0x4990('0x3a')]=[{'all':!![]}];}_0x1db6d7=_[_0x4990('0x41')]({},_0x1db6d7,_0x283a4b[_0x4990('0x42')]);return db['VoiceDialReport'][_0x4990('0x43')](_0x1db6d7)[_0x4990('0x39')](handleEntityNotFound(_0x2b0abe,null))[_0x4990('0x39')](respondWithResult(_0x2b0abe,null))['catch'](handleError(_0x2b0abe,null));};exports[_0x4990('0x44')]=function(_0x2c914a,_0x2b79e4){return db[_0x4990('0x3b')][_0x4990('0x44')](_0x2c914a[_0x4990('0x45')],{})[_0x4990('0x39')](respondWithResult(_0x2b79e4,0xc9))['catch'](handleError(_0x2b79e4,null));};exports[_0x4990('0x1f')]=function(_0x2116ae,_0xdc2ca5){if(_0x2116ae[_0x4990('0x45')]['id']){delete _0x2116ae[_0x4990('0x45')]['id'];}return db[_0x4990('0x3b')][_0x4990('0x43')]({'where':{'id':_0x2116ae['params']['id']}})[_0x4990('0x39')](handleEntityNotFound(_0xdc2ca5,null))[_0x4990('0x39')](saveUpdates(_0x2116ae[_0x4990('0x45')],null))[_0x4990('0x39')](respondWithResult(_0xdc2ca5,null))[_0x4990('0x46')](handleError(_0xdc2ca5,null));};exports['destroy']=function(_0x16d00f,_0x1d074e){return db[_0x4990('0x3b')][_0x4990('0x43')]({'where':{'id':_0x16d00f[_0x4990('0x3e')]['id']}})[_0x4990('0x39')](handleEntityNotFound(_0x1d074e,null))['then'](removeEntity(_0x1d074e,null))['catch'](handleError(_0x1d074e,null));};exports['describe']=function(_0x3b3961,_0x174845){return db[_0x4990('0x3b')][_0x4990('0x47')]()[_0x4990('0x39')](respondWithResult(_0x174845,null))[_0x4990('0x46')](handleError(_0x174845,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9b7e3e6..ef96064 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 _0xc2af=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','uniqueid'];(function(_0x5736dc,_0x8138a1){var _0xc265e5=function(_0x3d37b7){while(--_0x3d37b7){_0x5736dc['push'](_0x5736dc['shift']());}};_0xc265e5(++_0x8138a1);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x32c61c,_0x4fe417){_0x32c61c=_0x32c61c-0x0;var _0x5bb7c7=_0xc2af[_0x32c61c];return _0x5bb7c7;};'use strict';var _=require(_0xfc2a('0x0'));var util=require('util');var logger=require(_0xfc2a('0x1'))('api');var moment=require(_0xfc2a('0x2'));var BPromise=require(_0xfc2a('0x3'));var rp=require(_0xfc2a('0x4'));var fs=require('fs');var path=require(_0xfc2a('0x5'));var rimraf=require(_0xfc2a('0x6'));var config=require(_0xfc2a('0x7'));var attributes=require(_0xfc2a('0x8'));module[_0xfc2a('0x9')]=function(_0x4e2d6b,_0x40f855){return _0x4e2d6b['define'](_0xfc2a('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xfc2a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb350=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xb350,0x6f));var _0x0b35=function(_0x1f864e,_0x474f41){_0x1f864e=_0x1f864e-0x0;var _0xb806b0=_0xb350[_0x1f864e];return _0xb806b0;};'use strict';var _=require(_0x0b35('0x0'));var util=require(_0x0b35('0x1'));var logger=require(_0x0b35('0x2'))(_0x0b35('0x3'));var moment=require('moment');var BPromise=require(_0x0b35('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b35('0x5'));var rimraf=require('rimraf');var config=require(_0x0b35('0x6'));var attributes=require(_0x0b35('0x7'));module[_0x0b35('0x8')]=function(_0x1218c3,_0x417722){return _0x1218c3[_0x0b35('0x9')](_0x0b35('0xa'),attributes,{'tableName':_0x0b35('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0b35('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 30cacde..88cc570 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 _0x6308=['update','where','attributes','limit','then','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','info','UpdateVoiceDialReport'];(function(_0x4dcab8,_0x5091f7){var _0x1cea02=function(_0x6f47dd){while(--_0x6f47dd){_0x4dcab8['push'](_0x4dcab8['shift']());}};_0x1cea02(++_0x5091f7);}(_0x6308,0x1f2));var _0x8630=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6308[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var moment=require(_0x8630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8630('0x2'));var db=require(_0x8630('0x3'))['db'];var utils=require(_0x8630('0x4'));var logger=require(_0x8630('0x5'))(_0x8630('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8630('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337086,_0x3d5a10,_0x1bcfea){return new BPromise(function(_0x2b87ea,_0x10cc17){return client[_0x8630('0x8')](_0x337086,_0x1bcfea)['then'](function(_0x8b3652){logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));logger[_0x8630('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3d5a10,_0x8630('0xa'),JSON[_0x8630('0xc')](_0x8b3652));if(_0x8b3652[_0x8630('0xd')]){if(_0x8b3652['error'][_0x8630('0xe')]===0x1f4){logger[_0x8630('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x3d5a10,_0x8b3652['error'][_0x8630('0xf')]);return _0x10cc17(_0x8b3652[_0x8630('0xd')]['message']);}logger[_0x8630('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x3d5a10,_0x8b3652[_0x8630('0xd')]['message']);return _0x2b87ea(_0x8b3652[_0x8630('0xd')]['message']);}else{logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));_0x2b87ea(_0x8b3652['result']['message']);}})[_0x8630('0x10')](function(_0x547667){logger[_0x8630('0xd')](_0x8630('0x9'),_0x3d5a10,_0x547667);_0x10cc17(_0x547667);});});}exports[_0x8630('0x11')]=function(_0x20f462){var _0x1304b9=this;return new Promise(function(_0x1e9780,_0x4356b9){return db[_0x8630('0x12')][_0x8630('0x13')](_0x20f462['body'],{'raw':_0x20f462['options']?_0x20f462[_0x8630('0x14')][_0x8630('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x5cff5c){logger[_0x8630('0x16')](_0x8630('0x11'),_0x20f462);logger[_0x8630('0xb')]('CreateVoiceDialReport',_0x20f462,JSON['stringify'](_0x5cff5c));_0x1e9780(_0x5cff5c);})[_0x8630('0x10')](function(_0x58c0b5){logger[_0x8630('0xd')](_0x8630('0x11'),_0x58c0b5[_0x8630('0xf')],_0x20f462);_0x4356b9(_0x1304b9[_0x8630('0xd')](0x1f4,_0x58c0b5['message']));});});};exports[_0x8630('0x17')]=function(_0xf24c11){var _0x37ca50=this;return new Promise(function(_0x3d1eec,_0x41871a){return db[_0x8630('0x12')][_0x8630('0x18')](_0xf24c11['body'],{'raw':_0xf24c11['options']?_0xf24c11[_0x8630('0x14')][_0x8630('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf24c11[_0x8630('0x14')]?_0xf24c11[_0x8630('0x14')][_0x8630('0x19')]||null:null,'attributes':_0xf24c11[_0x8630('0x14')]?_0xf24c11[_0x8630('0x14')][_0x8630('0x1a')]||null:null,'limit':_0xf24c11[_0x8630('0x14')]?_0xf24c11[_0x8630('0x14')][_0x8630('0x1b')]||null:null})[_0x8630('0x1c')](function(_0xc18164){logger[_0x8630('0x16')](_0x8630('0x17'),_0xf24c11);logger[_0x8630('0xb')](_0x8630('0x17'),_0xf24c11,JSON['stringify'](_0xc18164));_0x3d1eec(_0xc18164);})[_0x8630('0x10')](function(_0x4545c2){logger[_0x8630('0xd')](_0x8630('0x17'),_0x4545c2['message'],_0xf24c11);_0x41871a(_0x37ca50[_0x8630('0xd')](0x1f4,_0x4545c2[_0x8630('0xf')]));});});}; \ No newline at end of file +var _0x41bb=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceDialReport','create','options','raw','stringify','UpdateVoiceDialReport','update','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x55ba2b,_0x52081c){var _0x1805c1=function(_0x445594){while(--_0x445594){_0x55ba2b['push'](_0x55ba2b['shift']());}};_0x1805c1(++_0x52081c);}(_0x41bb,0xc5));var _0xb41b=function(_0x2681e9,_0x2e70fa){_0x2681e9=_0x2681e9-0x0;var _0x261d20=_0x41bb[_0x2681e9];return _0x261d20;};'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')]('VoiceDialReport,\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);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['VoiceDialReport'][_0xb41b('0x16')](_0x47154d['body'],{'raw':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x53bc44){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x19')](_0x53bc44));_0x5df8c2(_0x53bc44);})[_0xb41b('0x14')](function(_0x4c73da){logger['error'](_0xb41b('0x15'),_0x4c73da[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783[_0xb41b('0x10')](0x1f4,_0x4c73da['message']));});});};exports[_0xb41b('0x1a')]=function(_0x2441d6){var _0x546101=this;return new Promise(function(_0x2a5306,_0x34f908){return db['VoiceDialReport'][_0xb41b('0x1b')](_0x2441d6['body'],{'raw':_0x2441d6[_0xb41b('0x17')]?_0x2441d6[_0xb41b('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2441d6[_0xb41b('0x17')]?_0x2441d6[_0xb41b('0x17')]['where']||null:null,'attributes':_0x2441d6['options']?_0x2441d6[_0xb41b('0x17')][_0xb41b('0x1c')]||null:null,'limit':_0x2441d6[_0xb41b('0x17')]?_0x2441d6[_0xb41b('0x17')][_0xb41b('0x1d')]||null:null})[_0xb41b('0xb')](function(_0x253efb){logger['info'](_0xb41b('0x1a'),_0x2441d6);logger[_0xb41b('0xf')]('UpdateVoiceDialReport',_0x2441d6,JSON[_0xb41b('0x19')](_0x253efb));_0x2a5306(_0x253efb);})['catch'](function(_0x38277f){logger[_0xb41b('0x10')]('UpdateVoiceDialReport',_0x38277f[_0xb41b('0x12')],_0x2441d6);_0x34f908(_0x546101['error'](0x1f4,_0x38277f[_0xb41b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 67d0a4a..6ab5e77 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 _0xbb35=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','util'];(function(_0x3785ec,_0x145a1a){var _0x5b5999=function(_0x857e60){while(--_0x857e60){_0x3785ec['push'](_0x3785ec['shift']());}};_0x5b5999(++_0x145a1a);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x43932a,_0x106973){_0x43932a=_0x43932a-0x0;var _0x4cfef3=_0xbb35[_0x43932a];return _0x4cfef3;};'use strict';var multer=require('multer');var util=require(_0x5bb3('0x0'));var path=require(_0x5bb3('0x1'));var timeout=require(_0x5bb3('0x2'));var express=require(_0x5bb3('0x3'));var router=express[_0x5bb3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5bb3('0x5'));var config=require(_0x5bb3('0x6'));var controller=require(_0x5bb3('0x7'));router[_0x5bb3('0x8')]('/',auth[_0x5bb3('0x9')](),controller[_0x5bb3('0xa')]);router[_0x5bb3('0x8')](_0x5bb3('0xb'),auth[_0x5bb3('0x9')](),controller['show']);router[_0x5bb3('0xc')]('/',auth[_0x5bb3('0x9')](),controller[_0x5bb3('0xd')]);router[_0x5bb3('0xc')]('/:id/applications',auth[_0x5bb3('0x9')](),controller['addApplications']);router[_0x5bb3('0xe')]('/:id',auth[_0x5bb3('0x9')](),controller[_0x5bb3('0xf')]);router[_0x5bb3('0x10')](_0x5bb3('0xb'),auth[_0x5bb3('0x9')](),controller['destroy']);module[_0x5bb3('0x11')]=router; \ No newline at end of file +var _0x6f3e=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','show','post','create','/:id/applications','addApplications'];(function(_0x53a2a5,_0x22058e){var _0x3958af=function(_0x4a8bda){while(--_0x4a8bda){_0x53a2a5['push'](_0x53a2a5['shift']());}};_0x3958af(++_0x22058e);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe6f3('0x0'));var util=require(_0xe6f3('0x1'));var path=require(_0xe6f3('0x2'));var timeout=require(_0xe6f3('0x3'));var express=require(_0xe6f3('0x4'));var router=express[_0xe6f3('0x5')]();var auth=require(_0xe6f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe6f3('0x7'));var controller=require(_0xe6f3('0x8'));router['get']('/',auth[_0xe6f3('0x9')](),controller[_0xe6f3('0xa')]);router[_0xe6f3('0xb')]('/:id',auth[_0xe6f3('0x9')](),controller[_0xe6f3('0xc')]);router[_0xe6f3('0xd')]('/',auth['isAuthenticated'](),controller[_0xe6f3('0xe')]);router['post'](_0xe6f3('0xf'),auth[_0xe6f3('0x9')](),controller[_0xe6f3('0x10')]);router[_0xe6f3('0x11')](_0xe6f3('0x12'),auth[_0xe6f3('0x9')](),controller['update']);router[_0xe6f3('0x13')]('/:id',auth[_0xe6f3('0x9')](),controller[_0xe6f3('0x14')]);module[_0xe6f3('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 7fa431a..43ba81e 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 _0xbb53=['INTEGER','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','*,*,*,*','BOOLEAN'];(function(_0x1c73b1,_0x5c6f36){var _0x4b9c7c=function(_0x13176b){while(--_0x13176b){_0x1c73b1['push'](_0x1c73b1['shift']());}};_0x4b9c7c(++_0x5c6f36);}(_0xbb53,0x121));var _0x3bb5=function(_0x383029,_0x4a91f0){_0x383029=_0x383029-0x0;var _0x5290a2=_0xbb53[_0x383029];return _0x5290a2;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'context':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'unique':_0x3bb5('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'unique':_0x3bb5('0x3')},'priority':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x3bb5('0x3')},'tag':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3bb5('0x4')](_0x3bb5('0x5'),_0x3bb5('0x6'),_0x3bb5('0x7'),_0x3bb5('0x8'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize[_0x3bb5('0x2')]},'interval':{'type':Sequelize[_0x3bb5('0x2')],'allowNull':![],'defaultValue':_0x3bb5('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x3bb5('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x3bb5('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3bb5('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x3bb5('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x3bb5('0xd')],'get':function(_0x511bd8){return this['getDataValue'](_0x3bb5('0xe'));}}}; \ No newline at end of file +var _0x1d2d=['outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x47fb46,_0x179346){var _0x405ccf=function(_0x44de52){while(--_0x44de52){_0x47fb46['push'](_0x47fb46['shift']());}};_0x405ccf(++_0x179346);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3717c7,_0x114146){_0x3717c7=_0x3717c7-0x0;var _0x2e1fa3=_0x1d2d[_0x3717c7];return _0x2e1fa3;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'context':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'unique':_0xd1d2('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'defaultValue':_0xd1d2('0x4')},'appdata':{'type':Sequelize[_0xd1d2('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd1d2('0x5')](_0xd1d2('0x6'),_0xd1d2('0x7'),'internal',_0xd1d2('0x8'),_0xd1d2('0x9'),_0xd1d2('0xa'),_0xd1d2('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xd1d2('0x2')]},'interval':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'defaultValue':_0xd1d2('0xc')},'IntervalId':{'type':Sequelize[_0xd1d2('0xd')]},'isApp':{'type':Sequelize[_0xd1d2('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd1d2('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd1d2('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd1d2('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd1d2('0xf')},'answer':{'type':Sequelize[_0xd1d2('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd1d2('0x10')],'get':function(_0x33f088){return this[_0xd1d2('0x11')](_0xd1d2('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ca2f41f..0f13e4b 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 _0xcbe7=['recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','VoiceExtensionId','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','inbound','OutboundRoutes','InternalRoutes','internal','map','value','includes','type','find','UserProfileResource','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','field','options','VoiceExtension','includeAll','include','rows','catch','show','params','body','outbound','startsWith','concat','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context'];(function(_0x8f53e7,_0x46298b){var _0x538d1d=function(_0x5d37b3){while(--_0x5d37b3){_0x8f53e7['push'](_0x8f53e7['shift']());}};_0x538d1d(++_0x46298b);}(_0xcbe7,0x6e));var _0x7cbe=function(_0x1f4656,_0x201b59){_0x1f4656=_0x1f4656-0x0;var _0x35e26e=_0xcbe7[_0x1f4656];return _0x35e26e;};'use strict';var pdf=require(_0x7cbe('0x0'));var emlformat=require(_0x7cbe('0x1'));var rimraf=require(_0x7cbe('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cbe('0x3'));var rp=require('request-promise');var moment=require(_0x7cbe('0x4'));var BPromise=require(_0x7cbe('0x5'));var Mustache=require(_0x7cbe('0x6'));var util=require(_0x7cbe('0x7'));var path=require(_0x7cbe('0x8'));var sox=require(_0x7cbe('0x9'));var csv=require(_0x7cbe('0xa'));var ejs=require(_0x7cbe('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7cbe('0xc'));var crypto=require('crypto');var jsforce=require(_0x7cbe('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7cbe('0xe'));var Papa=require(_0x7cbe('0xf'));var Redis=require(_0x7cbe('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7cbe('0x11'));var logger=require(_0x7cbe('0x12'))('api');var utils=require(_0x7cbe('0x13'));var config=require('../../config/environment');var db=require(_0x7cbe('0x14'))['db'];config[_0x7cbe('0x15')]=_[_0x7cbe('0x16')](config['redis'],{'host':_0x7cbe('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7cbe('0x15')]));require(_0x7cbe('0x18'))[_0x7cbe('0x19')](socket);function respondWithStatusCode(_0x5ec72d,_0x357240){_0x357240=_0x357240||0xcc;return function(_0x3e5295){if(_0x3e5295){return _0x5ec72d['sendStatus'](_0x357240);}return _0x5ec72d[_0x7cbe('0x1a')](_0x357240)[_0x7cbe('0x1b')]();};}function respondWithResult(_0x4dba5d,_0x1c5850){_0x1c5850=_0x1c5850||0xc8;return function(_0x20b8a1){if(_0x20b8a1){return _0x4dba5d[_0x7cbe('0x1a')](_0x1c5850)[_0x7cbe('0x1c')](_0x20b8a1);}};}function respondWithFilteredResult(_0x1e6ee4,_0x2af01a){return function(_0x10fd02){if(_0x10fd02){var _0x344bec=_0x10fd02[_0x7cbe('0x1d')],_0x552f27=_0x2af01a[_0x7cbe('0x1e')],_0x122a2e=_0x2af01a['offset']+_0x2af01a[_0x7cbe('0x1f')],_0x238fc6;if(_0x122a2e>=_0x344bec){_0x122a2e=_0x344bec;_0x238fc6=0xc8;}else{_0x238fc6=0xce;}_0x1e6ee4[_0x7cbe('0x1a')](_0x238fc6);return _0x1e6ee4[_0x7cbe('0x20')](_0x7cbe('0x21'),_0x552f27+'-'+_0x122a2e+'/'+_0x344bec)[_0x7cbe('0x1c')](_0x10fd02);}return null;};}function patchUpdates(_0x1b2e80){return function(_0x423e36){try{jsonpatch['apply'](_0x423e36,_0x1b2e80,!![]);}catch(_0x147d5c){return BPromise[_0x7cbe('0x22')](_0x147d5c);}return _0x423e36[_0x7cbe('0x23')]();};}function saveUpdates(_0x12dd8d,_0x26895a){return function(_0x23ffac){if(_0x23ffac){return _0x23ffac[_0x7cbe('0x24')](_0x12dd8d)[_0x7cbe('0x25')](function(_0x536682){return _0x536682;});}return null;};}function removeEntity(_0x22284e,_0x3ec2cd){return function(_0x148d62){if(_0x148d62){return _0x148d62['destroy']()[_0x7cbe('0x25')](function(){var _0x9fdaf3=_0x148d62[_0x7cbe('0x26')]({'plain':!![]});var _0x193392=[{'name':'InboundRoutes','value':_0x7cbe('0x27'),'ignore':![]},{'name':_0x7cbe('0x28'),'value':'outbound','ignore':![]},{'name':_0x7cbe('0x29'),'value':_0x7cbe('0x2a'),'ignore':![]}];var _0x533f2b=_(_0x193392)['filter']('ignore')[_0x7cbe('0x2b')](_0x7cbe('0x2c'))[_0x7cbe('0x2c')]();if(_[_0x7cbe('0x2d')](_0x533f2b,_0x9fdaf3[_0x7cbe('0x2e')])){return;}var _0xa9d1b7=_[_0x7cbe('0x2f')](_0x193392,[_0x7cbe('0x2c'),_0x9fdaf3[_0x7cbe('0x2e')]])['name'];return db[_0x7cbe('0x30')][_0x7cbe('0x31')]({'where':{'type':_0xa9d1b7,'resourceId':_0x9fdaf3['id']}})['then'](function(){return _0x148d62;});})['then'](function(){_0x22284e['status'](0xcc)[_0x7cbe('0x1b')]();});}};}function handleEntityNotFound(_0x35b480,_0x3f3cc1){return function(_0x188463){if(!_0x188463){_0x35b480[_0x7cbe('0x32')](0x194);}return _0x188463;};}function handleError(_0x3970fb,_0x22a5ca){_0x22a5ca=_0x22a5ca||0x1f4;return function(_0x3be8d6){logger[_0x7cbe('0x33')](_0x3be8d6['stack']);if(_0x3be8d6[_0x7cbe('0x34')]){delete _0x3be8d6['name'];}_0x3970fb[_0x7cbe('0x1a')](_0x22a5ca)[_0x7cbe('0x35')](_0x3be8d6);};}exports[_0x7cbe('0x36')]=function(_0x5bbd38,_0x3218d7){var _0x44a76a={},_0x49fefd={},_0x513f37={'count':0x0,'rows':[]};var _0x5bacf8=db['VoiceExtension'][_0x7cbe('0x37')];_0x49fefd[_0x7cbe('0x38')]=_[_0x7cbe('0x39')](_0x5bacf8);_0x49fefd[_0x7cbe('0x3a')]=_['keys'](_0x5bbd38[_0x7cbe('0x3a')]);_0x49fefd[_0x7cbe('0x3b')]=_['intersection'](_0x49fefd['model'],_0x49fefd[_0x7cbe('0x3a')]);_0x44a76a['attributes']=_[_0x7cbe('0x3c')](_0x49fefd[_0x7cbe('0x38')],qs[_0x7cbe('0x3d')](_0x5bbd38[_0x7cbe('0x3a')]['fields']));_0x44a76a[_0x7cbe('0x3e')]=_0x44a76a['attributes'][_0x7cbe('0x3f')]?_0x44a76a[_0x7cbe('0x3e')]:_0x49fefd[_0x7cbe('0x38')];if(!_0x5bbd38[_0x7cbe('0x3a')][_0x7cbe('0x40')]('nolimit')){_0x44a76a[_0x7cbe('0x1f')]=qs['limit'](_0x5bbd38[_0x7cbe('0x3a')][_0x7cbe('0x1f')]);_0x44a76a[_0x7cbe('0x1e')]=qs[_0x7cbe('0x1e')](_0x5bbd38[_0x7cbe('0x3a')][_0x7cbe('0x1e')]);}_0x44a76a[_0x7cbe('0x41')]=qs[_0x7cbe('0x42')](_0x5bbd38[_0x7cbe('0x3a')][_0x7cbe('0x42')]);_0x44a76a[_0x7cbe('0x43')]=qs[_0x7cbe('0x3b')](_[_0x7cbe('0x44')](_0x5bbd38[_0x7cbe('0x3a')],_0x49fefd['filters']));if(_0x5bbd38[_0x7cbe('0x3a')][_0x7cbe('0x45')]){_0x44a76a['where']=_[_0x7cbe('0x46')](_0x44a76a[_0x7cbe('0x43')],{'$or':_[_0x7cbe('0x2b')](_0x5bacf8,function(_0x13f09d){if(_0x13f09d['type'][_0x7cbe('0x47')]!=='VIRTUAL'){var _0x150721={};_0x150721[_0x13f09d[_0x7cbe('0x48')]]={'$like':'%'+_0x5bbd38['query']['filter']+'%'};return _0x150721;}})});}_0x44a76a=_[_0x7cbe('0x46')]({},_0x44a76a,_0x5bbd38[_0x7cbe('0x49')]);var _0x56c475={'where':_0x44a76a[_0x7cbe('0x43')]};return db[_0x7cbe('0x4a')]['count'](_0x56c475)[_0x7cbe('0x25')](function(_0x1e44a6){_0x513f37[_0x7cbe('0x1d')]=_0x1e44a6;if(_0x5bbd38['query'][_0x7cbe('0x4b')]){_0x44a76a[_0x7cbe('0x4c')]=[{'all':!![]}];}return db[_0x7cbe('0x4a')]['findAll'](_0x44a76a);})[_0x7cbe('0x25')](function(_0x1d1775){_0x513f37[_0x7cbe('0x4d')]=_0x1d1775;return _0x513f37;})[_0x7cbe('0x25')](respondWithFilteredResult(_0x3218d7,_0x44a76a))[_0x7cbe('0x4e')](handleError(_0x3218d7,null));};exports[_0x7cbe('0x4f')]=function(_0x1f11f2,_0x2b6bd3){var _0x977ca6={'raw':![],'where':{'id':_0x1f11f2[_0x7cbe('0x50')]['id']}},_0x40f8a2={};_0x40f8a2['model']=_[_0x7cbe('0x39')](db['VoiceExtension'][_0x7cbe('0x37')]);_0x40f8a2[_0x7cbe('0x3a')]=_[_0x7cbe('0x39')](_0x1f11f2[_0x7cbe('0x3a')]);_0x40f8a2[_0x7cbe('0x3b')]=_[_0x7cbe('0x3c')](_0x40f8a2[_0x7cbe('0x38')],_0x40f8a2['query']);_0x977ca6[_0x7cbe('0x3e')]=_[_0x7cbe('0x3c')](_0x40f8a2['model'],qs['fields'](_0x1f11f2['query'][_0x7cbe('0x3d')]));_0x977ca6[_0x7cbe('0x3e')]=_0x977ca6[_0x7cbe('0x3e')][_0x7cbe('0x3f')]?_0x977ca6[_0x7cbe('0x3e')]:_0x40f8a2[_0x7cbe('0x38')];if(_0x1f11f2['query']['includeAll']){_0x977ca6[_0x7cbe('0x4c')]=[{'all':!![]}];}_0x977ca6=_[_0x7cbe('0x46')]({},_0x977ca6,_0x1f11f2[_0x7cbe('0x49')]);return db[_0x7cbe('0x4a')][_0x7cbe('0x2f')](_0x977ca6)['then'](handleEntityNotFound(_0x2b6bd3,null))['then'](respondWithResult(_0x2b6bd3,null))[_0x7cbe('0x4e')](handleError(_0x2b6bd3,null));};exports[_0x7cbe('0x31')]=function(_0x52180e,_0x26564b){return db['VoiceExtension'][_0x7cbe('0x2f')]({'where':{'id':_0x52180e[_0x7cbe('0x50')]['id']}})['then'](handleEntityNotFound(_0x26564b,null))[_0x7cbe('0x25')](removeEntity(_0x26564b,null))[_0x7cbe('0x4e')](handleError(_0x26564b,null));};exports['create']=function(_0x211db8,_0x25b87c){if(_0x211db8[_0x7cbe('0x51')]['type']===_0x7cbe('0x52')&&!_[_0x7cbe('0x53')](_0x211db8['body']['exten'],'_')){_0x211db8[_0x7cbe('0x51')]['exten']='_'[_0x7cbe('0x54')](_0x211db8[_0x7cbe('0x51')][_0x7cbe('0x55')]);}return db[_0x7cbe('0x4a')][_0x7cbe('0x56')](_0x211db8[_0x7cbe('0x51')],{'raw':![]})[_0x7cbe('0x25')](function(_0x252931){var _0x23119f=_0x211db8[_0x7cbe('0x57')]['get']({'plain':!![]});if(!_0x23119f)throw new Error(_0x7cbe('0x58'));if(_0x23119f[_0x7cbe('0x59')]===_0x7cbe('0x57')){var _0x40305c=_0x252931[_0x7cbe('0x26')]({'plain':!![]});var _0x26a61e=[{'name':_0x7cbe('0x5a'),'value':_0x7cbe('0x27')},{'name':_0x7cbe('0x28'),'value':'outbound'},{'name':_0x7cbe('0x29'),'value':_0x7cbe('0x2a')}];var _0x37ac60=_[_0x7cbe('0x2f')](_0x26a61e,[_0x7cbe('0x2c'),_0x40305c[_0x7cbe('0x2e')]])[_0x7cbe('0x34')];return db[_0x7cbe('0x5b')][_0x7cbe('0x2f')]({'where':{'name':_0x37ac60,'userProfileId':_0x23119f[_0x7cbe('0x5c')]},'raw':!![]})['then'](function(_0x32a365){if(_0x32a365&&_0x32a365[_0x7cbe('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x40305c[_0x7cbe('0x34')],'resourceId':_0x40305c['id'],'type':_0x32a365[_0x7cbe('0x34')],'sectionId':_0x32a365['id']},{})[_0x7cbe('0x25')](function(){return _0x252931;});}else{return _0x252931;}})['catch'](function(_0x3948fe){logger['error'](_0x7cbe('0x5e'),_0x3948fe);throw _0x3948fe;});}return _0x252931;})['then'](respondWithResult(_0x25b87c,0xc9))[_0x7cbe('0x4e')](handleError(_0x25b87c,null));};exports[_0x7cbe('0x24')]=function(_0x48ea83,_0x1cfef1){if(_0x48ea83[_0x7cbe('0x51')]['id']){delete _0x48ea83[_0x7cbe('0x51')]['id'];}return db[_0x7cbe('0x4a')][_0x7cbe('0x2f')]({'where':{'id':_0x48ea83[_0x7cbe('0x50')]['id']}})[_0x7cbe('0x25')](handleEntityNotFound(_0x1cfef1,null))[_0x7cbe('0x25')](function(_0x55853d){if(_0x55853d){return db[_0x7cbe('0x4a')][_0x7cbe('0x24')](_[_0x7cbe('0x44')](_0x48ea83['body'],[_0x7cbe('0x55'),_0x7cbe('0x5f'),'description',_0x7cbe('0x60'),_0x7cbe('0x61'),_0x7cbe('0x62')]),{'where':{'context':_0x55853d['context'],'exten':_0x55853d['exten']},'individualHooks':!![]})[_0x7cbe('0x25')](function(_0x2303e3){return _0x2303e3;});}return null;})[_0x7cbe('0x25')](respondWithStatusCode(_0x1cfef1,null))['catch'](handleError(_0x1cfef1,null));};exports[_0x7cbe('0x63')]=function(_0x69dc9f,_0x4c4485,_0x266c3d){return db[_0x7cbe('0x4a')]['findOne']({'where':{'id':_0x69dc9f[_0x7cbe('0x50')]['id']}})[_0x7cbe('0x25')](handleEntityNotFound(_0x4c4485,null))['then'](function(_0x4df6bb){if(_0x4df6bb){return db['sequelize'][_0x7cbe('0x64')](function(_0x53463d){return db[_0x7cbe('0x4a')][_0x7cbe('0x31')]({'where':{'VoiceExtensionId':_0x69dc9f[_0x7cbe('0x50')]['id']},'transaction':_0x53463d})[_0x7cbe('0x25')](function(_0x5848f7){var _0x5e596d=_[_0x7cbe('0x2b')](_0x69dc9f[_0x7cbe('0x51')],function(_0x41e90a){_0x41e90a[_0x7cbe('0x65')]=_0x69dc9f[_0x7cbe('0x50')]['id'];return _0x41e90a;});return db['VoiceExtension'][_0x7cbe('0x66')](_0x5e596d,{'transaction':_0x53463d});});})[_0x7cbe('0x25')](function(){return db[_0x7cbe('0x4a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x69dc9f[_0x7cbe('0x50')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x4c4485,null))[_0x7cbe('0x4e')](handleError(_0x4c4485,null));}; \ No newline at end of file +var _0x38b2=['localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','rows','catch','show','options','find','params','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','findOne','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x38b2,0x178));var _0x238b=function(_0x5a654a,_0x280a4b){_0x5a654a=_0x5a654a-0x0;var _0x9e952a=_0x38b2[_0x5a654a];return _0x9e952a;};'use strict';var pdf=require(_0x238b('0x0'));var emlformat=require(_0x238b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x238b('0x2'));var moment=require(_0x238b('0x3'));var BPromise=require(_0x238b('0x4'));var Mustache=require(_0x238b('0x5'));var util=require(_0x238b('0x6'));var path=require(_0x238b('0x7'));var sox=require('sox');var csv=require(_0x238b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x238b('0x9'));var squel=require(_0x238b('0xa'));var crypto=require(_0x238b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x238b('0xc'));var toCsv=require(_0x238b('0x8'));var querystring=require('querystring');var Papa=require(_0x238b('0xd'));var Redis=require(_0x238b('0xe'));var authService=require(_0x238b('0xf'));var qs=require(_0x238b('0x10'));var hardwareService=require(_0x238b('0x11'));var logger=require(_0x238b('0x12'))(_0x238b('0x13'));var utils=require(_0x238b('0x14'));var config=require(_0x238b('0x15'));var db=require(_0x238b('0x16'))['db'];config[_0x238b('0x17')]=_['defaults'](config[_0x238b('0x17')],{'host':_0x238b('0x18'),'port':0x18eb});var socket=require(_0x238b('0x19'))(new Redis(config[_0x238b('0x17')]));require(_0x238b('0x1a'))[_0x238b('0x1b')](socket);function respondWithStatusCode(_0x860fd4,_0x315796){_0x315796=_0x315796||0xcc;return function(_0x5d1619){if(_0x5d1619){return _0x860fd4[_0x238b('0x1c')](_0x315796);}return _0x860fd4[_0x238b('0x1d')](_0x315796)[_0x238b('0x1e')]();};}function respondWithResult(_0x49ab53,_0x4c7b4c){_0x4c7b4c=_0x4c7b4c||0xc8;return function(_0x1dd68d){if(_0x1dd68d){return _0x49ab53[_0x238b('0x1d')](_0x4c7b4c)[_0x238b('0x1f')](_0x1dd68d);}};}function respondWithFilteredResult(_0x76d76f,_0x1edd09){return function(_0x33cc06){if(_0x33cc06){var _0x589346=_0x33cc06[_0x238b('0x20')],_0x269ee8=_0x1edd09['offset'],_0x362982=_0x1edd09[_0x238b('0x21')]+_0x1edd09[_0x238b('0x22')],_0x32a75d;if(_0x362982>=_0x589346){_0x362982=_0x589346;_0x32a75d=0xc8;}else{_0x32a75d=0xce;}_0x76d76f[_0x238b('0x1d')](_0x32a75d);return _0x76d76f['set']('Content-Range',_0x269ee8+'-'+_0x362982+'/'+_0x589346)[_0x238b('0x1f')](_0x33cc06);}return null;};}function patchUpdates(_0xf2d284){return function(_0x728807){try{jsonpatch[_0x238b('0x23')](_0x728807,_0xf2d284,!![]);}catch(_0x880529){return BPromise[_0x238b('0x24')](_0x880529);}return _0x728807[_0x238b('0x25')]();};}function saveUpdates(_0xb1b0ac,_0x4b350c){return function(_0x579f36){if(_0x579f36){return _0x579f36['update'](_0xb1b0ac)[_0x238b('0x26')](function(_0x516f23){return _0x516f23;});}return null;};}function removeEntity(_0xc28bf7,_0x5b8e5b){return function(_0x3e09b6){if(_0x3e09b6){return _0x3e09b6[_0x238b('0x27')]()['then'](function(){var _0x3e4197=_0x3e09b6[_0x238b('0x28')]({'plain':!![]});var _0x556690=[{'name':_0x238b('0x29'),'value':_0x238b('0x2a'),'ignore':![]},{'name':_0x238b('0x2b'),'value':_0x238b('0x2c'),'ignore':![]},{'name':_0x238b('0x2d'),'value':_0x238b('0x2e'),'ignore':![]}];var _0x41ab42=_(_0x556690)[_0x238b('0x2f')]('ignore')[_0x238b('0x30')](_0x238b('0x31'))[_0x238b('0x31')]();if(_[_0x238b('0x32')](_0x41ab42,_0x3e4197[_0x238b('0x33')])){return;}var _0x186c1e=_['find'](_0x556690,[_0x238b('0x31'),_0x3e4197[_0x238b('0x33')]])[_0x238b('0x34')];return db[_0x238b('0x35')][_0x238b('0x27')]({'where':{'type':_0x186c1e,'resourceId':_0x3e4197['id']}})[_0x238b('0x26')](function(){return _0x3e09b6;});})['then'](function(){_0xc28bf7['status'](0xcc)[_0x238b('0x1e')]();});}};}function handleEntityNotFound(_0x162367,_0x594b91){return function(_0x281a51){if(!_0x281a51){_0x162367[_0x238b('0x1c')](0x194);}return _0x281a51;};}function handleError(_0x39d77e,_0x5ad07e){_0x5ad07e=_0x5ad07e||0x1f4;return function(_0x3196e5){logger['error'](_0x3196e5[_0x238b('0x36')]);if(_0x3196e5['name']){delete _0x3196e5['name'];}_0x39d77e[_0x238b('0x1d')](_0x5ad07e)[_0x238b('0x37')](_0x3196e5);};}exports[_0x238b('0x38')]=function(_0x46ca78,_0x1971b6){var _0x5557c1={},_0x25da1c={},_0x3dd514={'count':0x0,'rows':[]};var _0x19d76d=db[_0x238b('0x39')][_0x238b('0x3a')];_0x25da1c[_0x238b('0x3b')]=_['keys'](_0x19d76d);_0x25da1c[_0x238b('0x3c')]=_[_0x238b('0x3d')](_0x46ca78[_0x238b('0x3c')]);_0x25da1c[_0x238b('0x3e')]=_[_0x238b('0x3f')](_0x25da1c[_0x238b('0x3b')],_0x25da1c['query']);_0x5557c1[_0x238b('0x40')]=_[_0x238b('0x3f')](_0x25da1c[_0x238b('0x3b')],qs['fields'](_0x46ca78['query']['fields']));_0x5557c1[_0x238b('0x40')]=_0x5557c1[_0x238b('0x40')][_0x238b('0x41')]?_0x5557c1['attributes']:_0x25da1c[_0x238b('0x3b')];if(!_0x46ca78[_0x238b('0x3c')]['hasOwnProperty'](_0x238b('0x42'))){_0x5557c1[_0x238b('0x22')]=qs[_0x238b('0x22')](_0x46ca78[_0x238b('0x3c')][_0x238b('0x22')]);_0x5557c1['offset']=qs[_0x238b('0x21')](_0x46ca78[_0x238b('0x3c')][_0x238b('0x21')]);}_0x5557c1[_0x238b('0x43')]=qs[_0x238b('0x44')](_0x46ca78[_0x238b('0x3c')][_0x238b('0x44')]);_0x5557c1['where']=qs[_0x238b('0x3e')](_[_0x238b('0x45')](_0x46ca78[_0x238b('0x3c')],_0x25da1c['filters']));if(_0x46ca78['query']['filter']){_0x5557c1[_0x238b('0x46')]=_[_0x238b('0x47')](_0x5557c1['where'],{'$or':_['map'](_0x19d76d,function(_0x14e782){if(_0x14e782[_0x238b('0x33')]['key']!==_0x238b('0x48')){var _0x55caf4={};_0x55caf4[_0x14e782['field']]={'$like':'%'+_0x46ca78[_0x238b('0x3c')][_0x238b('0x2f')]+'%'};return _0x55caf4;}})});}_0x5557c1=_[_0x238b('0x47')]({},_0x5557c1,_0x46ca78['options']);var _0xbed0fd={'where':_0x5557c1[_0x238b('0x46')]};return db[_0x238b('0x39')][_0x238b('0x20')](_0xbed0fd)[_0x238b('0x26')](function(_0x3c729f){_0x3dd514[_0x238b('0x20')]=_0x3c729f;if(_0x46ca78[_0x238b('0x3c')]['includeAll']){_0x5557c1['include']=[{'all':!![]}];}return db[_0x238b('0x39')]['findAll'](_0x5557c1);})[_0x238b('0x26')](function(_0x3e64ec){_0x3dd514[_0x238b('0x49')]=_0x3e64ec;return _0x3dd514;})['then'](respondWithFilteredResult(_0x1971b6,_0x5557c1))[_0x238b('0x4a')](handleError(_0x1971b6,null));};exports[_0x238b('0x4b')]=function(_0xd48ebb,_0x1b739f){var _0x858076={'raw':![],'where':{'id':_0xd48ebb['params']['id']}},_0x5b8927={};_0x5b8927['model']=_[_0x238b('0x3d')](db['VoiceExtension'][_0x238b('0x3a')]);_0x5b8927[_0x238b('0x3c')]=_[_0x238b('0x3d')](_0xd48ebb[_0x238b('0x3c')]);_0x5b8927[_0x238b('0x3e')]=_[_0x238b('0x3f')](_0x5b8927[_0x238b('0x3b')],_0x5b8927['query']);_0x858076[_0x238b('0x40')]=_[_0x238b('0x3f')](_0x5b8927[_0x238b('0x3b')],qs['fields'](_0xd48ebb[_0x238b('0x3c')]['fields']));_0x858076['attributes']=_0x858076[_0x238b('0x40')][_0x238b('0x41')]?_0x858076[_0x238b('0x40')]:_0x5b8927['model'];if(_0xd48ebb[_0x238b('0x3c')]['includeAll']){_0x858076['include']=[{'all':!![]}];}_0x858076=_['merge']({},_0x858076,_0xd48ebb[_0x238b('0x4c')]);return db[_0x238b('0x39')][_0x238b('0x4d')](_0x858076)['then'](handleEntityNotFound(_0x1b739f,null))[_0x238b('0x26')](respondWithResult(_0x1b739f,null))[_0x238b('0x4a')](handleError(_0x1b739f,null));};exports[_0x238b('0x27')]=function(_0x264de0,_0x20ec34){return db['VoiceExtension'][_0x238b('0x4d')]({'where':{'id':_0x264de0[_0x238b('0x4e')]['id']}})[_0x238b('0x26')](handleEntityNotFound(_0x20ec34,null))[_0x238b('0x26')](removeEntity(_0x20ec34,null))[_0x238b('0x4a')](handleError(_0x20ec34,null));};exports[_0x238b('0x4f')]=function(_0x80c92e,_0x5da38b){if(_0x80c92e['body']['type']===_0x238b('0x2c')&&!_[_0x238b('0x50')](_0x80c92e[_0x238b('0x51')][_0x238b('0x52')],'_')){_0x80c92e[_0x238b('0x51')][_0x238b('0x52')]='_'[_0x238b('0x53')](_0x80c92e[_0x238b('0x51')][_0x238b('0x52')]);}return db[_0x238b('0x39')][_0x238b('0x4f')](_0x80c92e[_0x238b('0x51')],{'raw':![]})[_0x238b('0x26')](function(_0x57aa6f){var _0x4c6bc7=_0x80c92e[_0x238b('0x54')][_0x238b('0x28')]({'plain':!![]});if(!_0x4c6bc7)throw new Error(_0x238b('0x55'));if(_0x4c6bc7['role']==='user'){var _0x20574a=_0x57aa6f[_0x238b('0x28')]({'plain':!![]});var _0x3e251f=[{'name':_0x238b('0x29'),'value':_0x238b('0x2a')},{'name':_0x238b('0x2b'),'value':_0x238b('0x2c')},{'name':_0x238b('0x2d'),'value':_0x238b('0x2e')}];var _0x194c08=_[_0x238b('0x4d')](_0x3e251f,[_0x238b('0x31'),_0x20574a[_0x238b('0x33')]])[_0x238b('0x34')];return db[_0x238b('0x56')]['find']({'where':{'name':_0x194c08,'userProfileId':_0x4c6bc7['userProfileId']},'raw':!![]})[_0x238b('0x26')](function(_0x3239af){if(_0x3239af&&_0x3239af[_0x238b('0x57')]===0x0){return db[_0x238b('0x35')][_0x238b('0x4f')]({'name':_0x20574a['name'],'resourceId':_0x20574a['id'],'type':_0x3239af[_0x238b('0x34')],'sectionId':_0x3239af['id']},{})[_0x238b('0x26')](function(){return _0x57aa6f;});}else{return _0x57aa6f;}})[_0x238b('0x4a')](function(_0x3953d3){logger[_0x238b('0x58')](_0x238b('0x59'),_0x3953d3);throw _0x3953d3;});}return _0x57aa6f;})[_0x238b('0x26')](respondWithResult(_0x5da38b,0xc9))['catch'](handleError(_0x5da38b,null));};exports[_0x238b('0x5a')]=function(_0x418b31,_0x54ffd3){if(_0x418b31['body']['id']){delete _0x418b31[_0x238b('0x51')]['id'];}return db[_0x238b('0x39')][_0x238b('0x4d')]({'where':{'id':_0x418b31[_0x238b('0x4e')]['id']}})[_0x238b('0x26')](handleEntityNotFound(_0x54ffd3,null))[_0x238b('0x26')](function(_0x471397){if(_0x471397){return db[_0x238b('0x39')][_0x238b('0x5a')](_['pick'](_0x418b31['body'],[_0x238b('0x52'),_0x238b('0x5b'),_0x238b('0x5c'),_0x238b('0x5d'),_0x238b('0x5e'),'mandatoryDisposition']),{'where':{'context':_0x471397[_0x238b('0x5b')],'exten':_0x471397[_0x238b('0x52')]},'individualHooks':!![]})[_0x238b('0x26')](function(_0x4cb9b5){return _0x4cb9b5;});}return null;})[_0x238b('0x26')](respondWithStatusCode(_0x54ffd3,null))[_0x238b('0x4a')](handleError(_0x54ffd3,null));};exports['addApplications']=function(_0x1460fb,_0x614e2,_0x515695){return db[_0x238b('0x39')][_0x238b('0x5f')]({'where':{'id':_0x1460fb[_0x238b('0x4e')]['id']}})[_0x238b('0x26')](handleEntityNotFound(_0x614e2,null))[_0x238b('0x26')](function(_0x35738a){if(_0x35738a){return db['sequelize'][_0x238b('0x60')](function(_0x139731){return db[_0x238b('0x39')][_0x238b('0x27')]({'where':{'VoiceExtensionId':_0x1460fb['params']['id']},'transaction':_0x139731})[_0x238b('0x26')](function(_0x23a5e5){var _0x79eaee=_['map'](_0x1460fb['body'],function(_0x4e57c1){_0x4e57c1['VoiceExtensionId']=_0x1460fb[_0x238b('0x4e')]['id'];return _0x4e57c1;});return db['VoiceExtension'][_0x238b('0x61')](_0x79eaee,{'transaction':_0x139731});});})['then'](function(){return db[_0x238b('0x39')][_0x238b('0x62')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1460fb[_0x238b('0x4e')]['id']},'order':_0x238b('0x63')});});}})[_0x238b('0x26')](respondWithResult(_0x614e2,null))[_0x238b('0x4a')](handleError(_0x614e2,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4488cbf..3ac6aec 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 _0x7070=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','update','emit'];(function(_0x42b8f4,_0x29616d){var _0x4e86ac=function(_0x4ccf1c){while(--_0x4ccf1c){_0x42b8f4['push'](_0x42b8f4['shift']());}};_0x4e86ac(++_0x29616d);}(_0x7070,0x14b));var _0x0707=function(_0x1f33a6,_0x433514){_0x1f33a6=_0x1f33a6-0x0;var _0x10d2a9=_0x7070[_0x1f33a6];return _0x10d2a9;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x0707('0x0'))['db'][_0x0707('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0707('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0707('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ca2e0){return function(_0x5606bc,_0x6db2ba,_0x571773){VoiceExtensionEvents[_0x0707('0x4')](_0x3ca2e0+':'+_0x5606bc['id'],_0x5606bc);VoiceExtensionEvents[_0x0707('0x4')](_0x3ca2e0,_0x5606bc);_0x571773(null);};}for(var e in events){if(events[_0x0707('0x5')](e)){var event=events[e];VoiceExtension[_0x0707('0x6')](e,emitEvent(event));}}module[_0x0707('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x8a52=['remove','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','update'];(function(_0x4c2f4c,_0x5f1af7){var _0x530cc9=function(_0x874baa){while(--_0x874baa){_0x4c2f4c['push'](_0x4c2f4c['shift']());}};_0x530cc9(++_0x5f1af7);}(_0x8a52,0x1f3));var _0x28a5=function(_0x40e97c,_0x3d532e){_0x40e97c=_0x40e97c-0x0;var _0x334d30=_0x8a52[_0x40e97c];return _0x334d30;};'use strict';var EventEmitter=require(_0x28a5('0x0'));var VoiceExtension=require(_0x28a5('0x1'))['db'][_0x28a5('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x28a5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x28a5('0x4'),'afterDestroy':_0x28a5('0x5')};function emitEvent(_0x23142){return function(_0x668513,_0x2a03b4,_0x4af80c){VoiceExtensionEvents['emit'](_0x23142+':'+_0x668513['id'],_0x668513);VoiceExtensionEvents['emit'](_0x23142,_0x668513);_0x4af80c(null);};}for(var e in events){if(events[_0x28a5('0x6')](e)){var event=events[e];VoiceExtension[_0x28a5('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index e646292..39d9c9b 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 _0x7177=['exports','define','VoiceExtension','voice_extensions','lodash','../../config/logger','moment','bluebird','path','rimraf','./voiceExtension.attributes'];(function(_0x37d9fe,_0x297a55){var _0x35e7ff=function(_0x2ff8e1){while(--_0x2ff8e1){_0x37d9fe['push'](_0x37d9fe['shift']());}};_0x35e7ff(++_0x297a55);}(_0x7177,0x101));var _0x7717=function(_0x4f4ca5,_0x4c02b8){_0x4f4ca5=_0x4f4ca5-0x0;var _0x4a2021=_0x7177[_0x4f4ca5];return _0x4a2021;};'use strict';var _=require(_0x7717('0x0'));var util=require('util');var logger=require(_0x7717('0x1'))('api');var moment=require(_0x7717('0x2'));var BPromise=require(_0x7717('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7717('0x4'));var rimraf=require(_0x7717('0x5'));var config=require('../../config/environment');var attributes=require(_0x7717('0x6'));module[_0x7717('0x7')]=function(_0x40e3ec,_0x20ca81){return _0x40e3ec[_0x7717('0x8')](_0x7717('0x9'),attributes,{'tableName':_0x7717('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf47d=['../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xf47d,0x1d9));var _0xdf47=function(_0xba96b0,_0x36e8f8){_0xba96b0=_0xba96b0-0x0;var _0xdad969=_0xf47d[_0xba96b0];return _0xdad969;};'use strict';var _=require(_0xdf47('0x0'));var util=require(_0xdf47('0x1'));var logger=require(_0xdf47('0x2'))(_0xdf47('0x3'));var moment=require(_0xdf47('0x4'));var BPromise=require(_0xdf47('0x5'));var rp=require(_0xdf47('0x6'));var fs=require('fs');var path=require(_0xdf47('0x7'));var rimraf=require('rimraf');var config=require(_0xdf47('0x8'));var attributes=require(_0xdf47('0x9'));module[_0xdf47('0xa')]=function(_0x3d4465,_0x23f9ed){return _0x3d4465[_0xdf47('0xb')](_0xdf47('0xc'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 24a653b..0dc2392 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 _0xb7e7=['VoiceExtension','findAll','options','raw','where','attributes','include','map','model','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceExtension'];(function(_0x25b2b9,_0x325d5b){var _0x2d1838=function(_0x4c315d){while(--_0x4c315d){_0x25b2b9['push'](_0x25b2b9['shift']());}};_0x2d1838(++_0x325d5b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'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});config[_0x7b7e('0x8')]=_[_0x7b7e('0x9')](config['redis'],{'host':_0x7b7e('0xa'),'port':0x18eb});var socket=require(_0x7b7e('0xb'))(new Redis(config[_0x7b7e('0x8')]));require(_0x7b7e('0xc'))[_0x7b7e('0xd')](socket);function respondWithRpcPromise(_0x26bb8d,_0x242e70,_0x52de3b){return new BPromise(function(_0x299519,_0x1eef0a){return client[_0x7b7e('0xe')](_0x26bb8d,_0x52de3b)[_0x7b7e('0xf')](function(_0xd581fb){logger[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x242e70,_0x7b7e('0x12'));logger[_0x7b7e('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x242e70,_0x7b7e('0x12'),JSON[_0x7b7e('0x14')](_0xd581fb));if(_0xd581fb['error']){if(_0xd581fb[_0x7b7e('0x15')]['code']===0x1f4){logger['error'](_0x7b7e('0x11'),_0x242e70,_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);return _0x1eef0a(_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x242e70,_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);return _0x299519(_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);}else{logger[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x242e70,_0x7b7e('0x12'));_0x299519(_0xd581fb[_0x7b7e('0x17')][_0x7b7e('0x16')]);}})[_0x7b7e('0x18')](function(_0x12e8e9){logger[_0x7b7e('0x15')](_0x7b7e('0x11'),_0x242e70,_0x12e8e9);_0x1eef0a(_0x12e8e9);});});}exports[_0x7b7e('0x19')]=function(_0x9776c3){var _0x864287=this;return new Promise(function(_0x3a7b8b,_0x49eddb){return db[_0x7b7e('0x1a')][_0x7b7e('0x1b')]({'raw':_0x9776c3[_0x7b7e('0x1c')]?_0x9776c3['options'][_0x7b7e('0x1d')]===undefined?!![]:![]:!![],'where':_0x9776c3[_0x7b7e('0x1c')]?_0x9776c3[_0x7b7e('0x1c')][_0x7b7e('0x1e')]||null:null,'attributes':_0x9776c3[_0x7b7e('0x1c')]?_0x9776c3[_0x7b7e('0x1c')][_0x7b7e('0x1f')]||null:null,'limit':_0x9776c3[_0x7b7e('0x1c')]?_0x9776c3['options']['limit']||null:null,'include':_0x9776c3['options']?_0x9776c3[_0x7b7e('0x1c')][_0x7b7e('0x20')]?_[_0x7b7e('0x21')](_0x9776c3['options']['include'],function(_0x5dadbb){return{'model':db[_0x5dadbb[_0x7b7e('0x22')]],'as':_0x5dadbb['as'],'attributes':_0x5dadbb[_0x7b7e('0x1f')],'include':_0x5dadbb[_0x7b7e('0x20')]?_[_0x7b7e('0x21')](_0x5dadbb[_0x7b7e('0x20')],function(_0x48fad1){return{'model':db[_0x48fad1[_0x7b7e('0x22')]],'as':_0x48fad1['as'],'attributes':_0x48fad1[_0x7b7e('0x1f')],'include':_0x48fad1['include']?_['map'](_0x48fad1['include'],function(_0x12ef0b){return{'model':db[_0x12ef0b[_0x7b7e('0x22')]],'as':_0x12ef0b['as'],'attributes':_0x12ef0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0xf')](function(_0x51d4b5){logger[_0x7b7e('0x10')](_0x7b7e('0x19'),_0x9776c3);logger[_0x7b7e('0x13')]('GetVoiceExtension',_0x9776c3,JSON[_0x7b7e('0x14')](_0x51d4b5));_0x3a7b8b(_0x51d4b5);})[_0x7b7e('0x18')](function(_0x35602a){logger[_0x7b7e('0x15')](_0x7b7e('0x19'),_0x35602a['message'],_0x9776c3);_0x49eddb(_0x864287[_0x7b7e('0x15')](0x1f4,_0x35602a['message']));});});}; \ No newline at end of file +var _0x153f=['VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ff14a,_0x48acd0){var _0x40a0bb=function(_0x1d151e){while(--_0x1d151e){_0x3ff14a['push'](_0x3ff14a['shift']());}};_0x40a0bb(++_0x48acd0);}(_0x153f,0x15b));var _0xf153=function(_0x5113dd,_0x93fe46){_0x5113dd=_0x5113dd-0x0;var _0x276783=_0x153f[_0x5113dd];return _0x276783;};'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});config[_0xf153('0xc')]=_['defaults'](config[_0xf153('0xc')],{'host':_0xf153('0xd'),'port':0x18eb});var socket=require(_0xf153('0xe'))(new Redis(config[_0xf153('0xc')]));require(_0xf153('0xf'))[_0xf153('0x10')](socket);function respondWithRpcPromise(_0x44845c,_0x15a18b,_0x4f84b){return new BPromise(function(_0xeaccb0,_0x5c8ae9){return client[_0xf153('0x11')](_0x44845c,_0x4f84b)[_0xf153('0x12')](function(_0x2bea70){logger['info'](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));logger[_0xf153('0x15')](_0xf153('0x16'),_0x15a18b,_0xf153('0x14'),JSON[_0xf153('0x17')](_0x2bea70));if(_0x2bea70[_0xf153('0x18')]){if(_0x2bea70[_0xf153('0x18')][_0xf153('0x19')]===0x1f4){logger['error'](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);return _0x5c8ae9(_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);}logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')]['message']);return _0xeaccb0(_0x2bea70[_0xf153('0x18')]['message']);}else{logger[_0xf153('0x1b')](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));_0xeaccb0(_0x2bea70[_0xf153('0x1c')]['message']);}})[_0xf153('0x1d')](function(_0x19122e){logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x19122e);_0x5c8ae9(_0x19122e);});});}exports[_0xf153('0x1e')]=function(_0x2f290f){var _0x37952f=this;return new Promise(function(_0x2db2c7,_0x3735a7){return db[_0xf153('0x1f')][_0xf153('0x20')]({'raw':_0x2f290f[_0xf153('0x21')]?_0x2f290f['options'][_0xf153('0x22')]===undefined?!![]:![]:!![],'where':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x23')]||null:null,'attributes':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x24')]||null:null,'limit':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x25')]||null:null,'include':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x26')]?_[_0xf153('0x27')](_0x2f290f[_0xf153('0x21')][_0xf153('0x26')],function(_0x141ef4){return{'model':db[_0x141ef4[_0xf153('0x28')]],'as':_0x141ef4['as'],'attributes':_0x141ef4[_0xf153('0x24')],'include':_0x141ef4[_0xf153('0x26')]?_['map'](_0x141ef4[_0xf153('0x26')],function(_0x3f1c6f){return{'model':db[_0x3f1c6f['model']],'as':_0x3f1c6f['as'],'attributes':_0x3f1c6f[_0xf153('0x24')],'include':_0x3f1c6f[_0xf153('0x26')]?_['map'](_0x3f1c6f[_0xf153('0x26')],function(_0x10295e){return{'model':db[_0x10295e[_0xf153('0x28')]],'as':_0x10295e['as'],'attributes':_0x10295e[_0xf153('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf153('0x12')](function(_0x258976){logger[_0xf153('0x1b')](_0xf153('0x1e'),_0x2f290f);logger[_0xf153('0x15')](_0xf153('0x1e'),_0x2f290f,JSON[_0xf153('0x17')](_0x258976));_0x2db2c7(_0x258976);})[_0xf153('0x1d')](function(_0x5b5237){logger[_0xf153('0x18')](_0xf153('0x1e'),_0x5b5237[_0xf153('0x1a')],_0x2f290f);_0x3735a7(_0x37952f[_0xf153('0x18')](0x1f4,_0x5b5237['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index dc4c0f9..28f15fb 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 _0xb2ca=['register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xb2ca,0x162));var _0xab2c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb2ca[_0x278e3c];return _0x3e2d9b;};'use strict';var VoiceExtensionEvents=require(_0xab2c('0x0'));var events=[_0xab2c('0x1'),_0xab2c('0x2'),_0xab2c('0x3')];function createListener(_0x5c7f00,_0x1b01ee){return function(_0x58a19a){_0x1b01ee[_0xab2c('0x4')](_0x5c7f00,_0x58a19a);};}function removeListener(_0x921ce8,_0x79cf90){return function(){VoiceExtensionEvents[_0xab2c('0x5')](_0x921ce8,_0x79cf90);};}exports[_0xab2c('0x6')]=function(_0xf3edfc){for(var _0x3af972=0x0,_0x45d01e=events[_0xab2c('0x7')];_0x3af972<_0x45d01e;_0x3af972++){var _0x408a38=events[_0x3af972];var _0x5dc776=createListener(_0xab2c('0x8')+_0x408a38,_0xf3edfc);VoiceExtensionEvents['on'](_0x408a38,_0x5dc776);}}; \ No newline at end of file +var _0x34af=['removeListener','length','voiceExtension:','./voiceExtension.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34af,0x192));var _0xf34a=function(_0x3b375f,_0x43745a){_0x3b375f=_0x3b375f-0x0;var _0x3c4cdb=_0x34af[_0x3b375f];return _0x3c4cdb;};'use strict';var VoiceExtensionEvents=require(_0xf34a('0x0'));var events=[_0xf34a('0x1'),_0xf34a('0x2'),'update'];function createListener(_0xb24310,_0x583921){return function(_0x219985){_0x583921[_0xf34a('0x3')](_0xb24310,_0x219985);};}function removeListener(_0x1cbd0b,_0x520af8){return function(){VoiceExtensionEvents[_0xf34a('0x4')](_0x1cbd0b,_0x520af8);};}exports['register']=function(_0x211f5c){for(var _0x2c1975=0x0,_0x32dfc=events[_0xf34a('0x5')];_0x2c1975<_0x32dfc;_0x2c1975++){var _0x40a82f=events[_0x2c1975];var _0xb7b370=createListener(_0xf34a('0x6')+_0x40a82f,_0x211f5c);VoiceExtensionEvents['on'](_0x40a82f,_0xb7b370);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8d65044..e233cac 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 _0x4376=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','put','update','delete','destroy','exports','multer','util'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x4376,0xbb));var _0x6437=function(_0x32310a,_0x2cb19a){_0x32310a=_0x32310a-0x0;var _0x49eb77=_0x4376[_0x32310a];return _0x49eb77;};'use strict';var multer=require(_0x6437('0x0'));var util=require(_0x6437('0x1'));var path=require(_0x6437('0x2'));var timeout=require(_0x6437('0x3'));var express=require(_0x6437('0x4'));var router=express[_0x6437('0x5')]();var auth=require(_0x6437('0x6'));var interaction=require(_0x6437('0x7'));var config=require(_0x6437('0x8'));var controller=require(_0x6437('0x9'));router[_0x6437('0xa')]('/',auth[_0x6437('0xb')](),controller[_0x6437('0xc')]);router[_0x6437('0xa')](_0x6437('0xd'),auth[_0x6437('0xb')](),controller[_0x6437('0xe')]);router[_0x6437('0xa')](_0x6437('0xf'),auth[_0x6437('0xb')](),controller['getMessages']);router['post']('/',auth[_0x6437('0xb')](),controller['create']);router[_0x6437('0x10')](_0x6437('0xd'),auth[_0x6437('0xb')](),controller[_0x6437('0x11')]);router[_0x6437('0x12')](_0x6437('0xd'),auth[_0x6437('0xb')](),controller[_0x6437('0x13')]);module[_0x6437('0x14')]=router; \ No newline at end of file +var _0xc908=['express','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0xc908,0x1c9));var _0x8c90=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xc908[_0x2650e9];return _0x3511c8;};'use strict';var multer=require('multer');var util=require(_0x8c90('0x0'));var path=require(_0x8c90('0x1'));var timeout=require(_0x8c90('0x2'));var express=require(_0x8c90('0x3'));var router=express['Router']();var auth=require(_0x8c90('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8c90('0x5'));var controller=require(_0x8c90('0x6'));router[_0x8c90('0x7')]('/',auth[_0x8c90('0x8')](),controller[_0x8c90('0x9')]);router[_0x8c90('0x7')](_0x8c90('0xa'),auth[_0x8c90('0x8')](),controller[_0x8c90('0xb')]);router['get'](_0x8c90('0xc'),auth[_0x8c90('0x8')](),controller[_0x8c90('0xd')]);router[_0x8c90('0xe')]('/',auth[_0x8c90('0x8')](),controller[_0x8c90('0xf')]);router[_0x8c90('0x10')](_0x8c90('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8c90('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8c90('0x12')]);module[_0x8c90('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index f5e4800..e8ede88 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 _0x434c=['ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','exports','STRING','contest_mailbox','setDataValue','email','trim','yes'];(function(_0x17d561,_0x31d1c8){var _0x9b85a8=function(_0x15663d){while(--_0x15663d){_0x17d561['push'](_0x17d561['shift']());}};_0x9b85a8(++_0x31d1c8);}(_0x434c,0x1d9));var _0xc434=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x434c[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xc434('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc434('0x1')],'defaultValue':'from-voicemail','unique':_0xc434('0x2')},'mailbox':{'type':Sequelize[_0xc434('0x1')],'defaultValue':'','allowNull':![],'unique':_0xc434('0x2')},'password':{'type':Sequelize[_0xc434('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc434('0x1')],'validate':{'isEmail':!![]},'set':function(_0x52eb70){this[_0xc434('0x3')](_0xc434('0x4'),typeof _0x52eb70==='string'&&_0x52eb70[_0xc434('0x5')]()?_0x52eb70[_0xc434('0x5')]():null);}},'pager':{'type':Sequelize[_0xc434('0x1')]},'tz':{'type':Sequelize[_0xc434('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc434('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':_0xc434('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc434('0x1')]},'callback':{'type':Sequelize[_0xc434('0x1')]},'review':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc434('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc434('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xc434('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc434('0x7')](_0xc434('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc434('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc434('0x7')]('yes','no'),'defaultValue':_0xc434('0x6'),'allowNull':![]},'stamp':{'type':_0xc434('0x9')},'emailsubject':{'type':Sequelize[_0xc434('0x1')]},'emailbody':{'type':Sequelize[_0xc434('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc434('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc434('0xb')],'get':function(){return this[_0xc434('0xc')]('fullname')+_0xc434('0xd')+this[_0xc434('0xc')](_0xc434('0xe'));}}}; \ No newline at end of file +var _0x2e80=['exports','STRING','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TIMESTAMP','fullname','getDataValue','mailbox','sequelize'];(function(_0x102e1f,_0xe1ea15){var _0x43de95=function(_0x4b2e9e){while(--_0x4b2e9e){_0x102e1f['push'](_0x102e1f['shift']());}};_0x43de95(++_0xe1ea15);}(_0x2e80,0x109));var _0x02e8=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x2e80[_0x59b2a1];return _0x4908d1;};'use strict';var Sequelize=require(_0x02e8('0x0'));module[_0x02e8('0x1')]={'customer_id':{'type':Sequelize[_0x02e8('0x2')]},'context':{'type':Sequelize[_0x02e8('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x02e8('0x2')],'defaultValue':'','allowNull':![],'unique':_0x02e8('0x3')},'password':{'type':Sequelize[_0x02e8('0x2')]},'fullname':{'type':Sequelize[_0x02e8('0x2')]},'email':{'type':Sequelize[_0x02e8('0x2')],'validate':{'isEmail':!![]},'set':function(_0x30a52c){this[_0x02e8('0x4')]('email',typeof _0x30a52c===_0x02e8('0x5')&&_0x30a52c[_0x02e8('0x6')]()?_0x30a52c[_0x02e8('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x02e8('0x2')],'defaultValue':_0x02e8('0x7')},'attach':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':_0x02e8('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x02e8('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x02e8('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x02e8('0x8')]('yes','no'),'defaultValue':_0x02e8('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x02e8('0x8')](_0x02e8('0x9'),'no'),'defaultValue':_0x02e8('0x9'),'allowNull':![]},'stamp':{'type':_0x02e8('0xa')},'emailsubject':{'type':Sequelize[_0x02e8('0x2')]},'emailbody':{'type':Sequelize[_0x02e8('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x02e8('0xb'))+'\x20-\x20'+this[_0x02e8('0xc')](_0x02e8('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7225d9c..288fbf3 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 _0xbac1=['type','key','VIRTUAL','field','filter','options','includeAll','include','VoiceMail','rows','catch','show','params','intersection','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','Voicemails','UserProfileResource','then','end','sendStatus','error','name','send','index','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','map'];(function(_0x4fc45b,_0x3ab149){var _0x2fe2dd=function(_0x2f43db){while(--_0x2f43db){_0x4fc45b['push'](_0x4fc45b['shift']());}};_0x2fe2dd(++_0x3ab149);}(_0xbac1,0x17f));var _0x1bac=function(_0xbe3809,_0x26e640){_0xbe3809=_0xbe3809-0x0;var _0x2cdec1=_0xbac1[_0xbe3809];return _0x2cdec1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1bac('0x0'));var rimraf=require(_0x1bac('0x1'));var zipdir=require(_0x1bac('0x2'));var jsonpatch=require(_0x1bac('0x3'));var rp=require(_0x1bac('0x4'));var moment=require(_0x1bac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bac('0x6'));var util=require(_0x1bac('0x7'));var path=require(_0x1bac('0x8'));var sox=require(_0x1bac('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bac('0xa'));var squel=require(_0x1bac('0xb'));var crypto=require('crypto');var jsforce=require(_0x1bac('0xc'));var deskjs=require(_0x1bac('0xd'));var toCsv=require(_0x1bac('0xe'));var querystring=require('querystring');var Papa=require(_0x1bac('0xf'));var Redis=require(_0x1bac('0x10'));var authService=require(_0x1bac('0x11'));var qs=require(_0x1bac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bac('0x13'))(_0x1bac('0x14'));var utils=require(_0x1bac('0x15'));var config=require(_0x1bac('0x16'));var db=require(_0x1bac('0x17'))['db'];function respondWithStatusCode(_0x5bd63e,_0x1721f2){_0x1721f2=_0x1721f2||0xcc;return function(_0x111394){if(_0x111394){return _0x5bd63e['sendStatus'](_0x1721f2);}return _0x5bd63e[_0x1bac('0x18')](_0x1721f2)['end']();};}function respondWithResult(_0x59b00b,_0x22cb9a){_0x22cb9a=_0x22cb9a||0xc8;return function(_0x33d2dc){if(_0x33d2dc){return _0x59b00b[_0x1bac('0x18')](_0x22cb9a)[_0x1bac('0x19')](_0x33d2dc);}};}function respondWithFilteredResult(_0x281da9,_0x5b2fb2){return function(_0x109b5b){if(_0x109b5b){var _0x5d6017=_0x109b5b[_0x1bac('0x1a')],_0xa2da02=_0x5b2fb2['offset'],_0x59be64=_0x5b2fb2['offset']+_0x5b2fb2[_0x1bac('0x1b')],_0x47c516;if(_0x59be64>=_0x5d6017){_0x59be64=_0x5d6017;_0x47c516=0xc8;}else{_0x47c516=0xce;}_0x281da9[_0x1bac('0x18')](_0x47c516);return _0x281da9[_0x1bac('0x1c')](_0x1bac('0x1d'),_0xa2da02+'-'+_0x59be64+'/'+_0x5d6017)['json'](_0x109b5b);}return null;};}function patchUpdates(_0x586502){return function(_0x34a9c7){try{jsonpatch[_0x1bac('0x1e')](_0x34a9c7,_0x586502,!![]);}catch(_0x5c4716){return BPromise[_0x1bac('0x1f')](_0x5c4716);}return _0x34a9c7[_0x1bac('0x20')]();};}function saveUpdates(_0x5de03d,_0xf0f4f5){return function(_0x3ca2f8){if(_0x3ca2f8){return _0x3ca2f8[_0x1bac('0x21')](_0x5de03d)['then'](function(_0x372344){return _0x372344;});}return null;};}function removeEntity(_0x27e84b,_0x22df40){return function(_0x5469ec){if(_0x5469ec){return _0x5469ec[_0x1bac('0x22')]()['then'](function(){var _0x3003e9=_0x5469ec[_0x1bac('0x23')]({'plain':!![]});var _0x547bb8=_0x1bac('0x24');return db[_0x1bac('0x25')][_0x1bac('0x22')]({'where':{'type':_0x547bb8,'resourceId':_0x3003e9['id']}})[_0x1bac('0x26')](function(){return _0x5469ec;});})[_0x1bac('0x26')](function(){_0x27e84b[_0x1bac('0x18')](0xcc)[_0x1bac('0x27')]();});}};}function handleEntityNotFound(_0x353b10,_0x21ca9a){return function(_0x318ebe){if(!_0x318ebe){_0x353b10[_0x1bac('0x28')](0x194);}return _0x318ebe;};}function handleError(_0x2d7049,_0x3e6c0e){_0x3e6c0e=_0x3e6c0e||0x1f4;return function(_0x6a059){logger[_0x1bac('0x29')](_0x6a059['stack']);if(_0x6a059[_0x1bac('0x2a')]){delete _0x6a059[_0x1bac('0x2a')];}_0x2d7049['status'](_0x3e6c0e)[_0x1bac('0x2b')](_0x6a059);};}exports[_0x1bac('0x2c')]=function(_0x5ddb59,_0x3c2f62){var _0x55725b={},_0xd11b70={},_0x212ade={'count':0x0,'rows':[]};var _0x5922e8=db['VoiceMail'][_0x1bac('0x2d')];_0xd11b70[_0x1bac('0x2e')]=_[_0x1bac('0x2f')](_0x5922e8);_0xd11b70['query']=_['keys'](_0x5ddb59[_0x1bac('0x30')]);_0xd11b70['filters']=_['intersection'](_0xd11b70[_0x1bac('0x2e')],_0xd11b70[_0x1bac('0x30')]);_0x55725b[_0x1bac('0x31')]=_['intersection'](_0xd11b70[_0x1bac('0x2e')],qs[_0x1bac('0x32')](_0x5ddb59[_0x1bac('0x30')][_0x1bac('0x32')]));_0x55725b['attributes']=_0x55725b['attributes'][_0x1bac('0x33')]?_0x55725b['attributes']:_0xd11b70[_0x1bac('0x2e')];if(!_0x5ddb59['query'][_0x1bac('0x34')](_0x1bac('0x35'))){_0x55725b[_0x1bac('0x1b')]=qs[_0x1bac('0x1b')](_0x5ddb59[_0x1bac('0x30')]['limit']);_0x55725b[_0x1bac('0x36')]=qs['offset'](_0x5ddb59[_0x1bac('0x30')][_0x1bac('0x36')]);}_0x55725b[_0x1bac('0x37')]=qs[_0x1bac('0x38')](_0x5ddb59['query'][_0x1bac('0x38')]);_0x55725b[_0x1bac('0x39')]=qs[_0x1bac('0x3a')](_[_0x1bac('0x3b')](_0x5ddb59[_0x1bac('0x30')],_0xd11b70[_0x1bac('0x3a')]));if(_0x5ddb59[_0x1bac('0x30')]['filter']){_0x55725b[_0x1bac('0x39')]=_[_0x1bac('0x3c')](_0x55725b[_0x1bac('0x39')],{'$or':_[_0x1bac('0x3d')](_0x5922e8,function(_0x57a0dd){if(_0x57a0dd[_0x1bac('0x3e')][_0x1bac('0x3f')]!==_0x1bac('0x40')){var _0x2389fc={};_0x2389fc[_0x57a0dd[_0x1bac('0x41')]]={'$like':'%'+_0x5ddb59[_0x1bac('0x30')][_0x1bac('0x42')]+'%'};return _0x2389fc;}})});}_0x55725b=_[_0x1bac('0x3c')]({},_0x55725b,_0x5ddb59[_0x1bac('0x43')]);var _0x3b7716={'where':_0x55725b[_0x1bac('0x39')]};return db['VoiceMail'][_0x1bac('0x1a')](_0x3b7716)['then'](function(_0x16f61d){_0x212ade[_0x1bac('0x1a')]=_0x16f61d;if(_0x5ddb59[_0x1bac('0x30')][_0x1bac('0x44')]){_0x55725b[_0x1bac('0x45')]=[{'all':!![]}];}return db[_0x1bac('0x46')]['findAll'](_0x55725b);})['then'](function(_0x59ad60){_0x212ade[_0x1bac('0x47')]=_0x59ad60;return _0x212ade;})[_0x1bac('0x26')](respondWithFilteredResult(_0x3c2f62,_0x55725b))[_0x1bac('0x48')](handleError(_0x3c2f62,null));};exports[_0x1bac('0x49')]=function(_0x35229c,_0x3e1fa5){var _0xd9b91c={'raw':!![],'where':{'id':_0x35229c[_0x1bac('0x4a')]['id']}},_0x33d9e5={};_0x33d9e5[_0x1bac('0x2e')]=_[_0x1bac('0x2f')](db[_0x1bac('0x46')][_0x1bac('0x2d')]);_0x33d9e5['query']=_[_0x1bac('0x2f')](_0x35229c[_0x1bac('0x30')]);_0x33d9e5[_0x1bac('0x3a')]=_['intersection'](_0x33d9e5[_0x1bac('0x2e')],_0x33d9e5['query']);_0xd9b91c['attributes']=_[_0x1bac('0x4b')](_0x33d9e5['model'],qs[_0x1bac('0x32')](_0x35229c[_0x1bac('0x30')][_0x1bac('0x32')]));_0xd9b91c[_0x1bac('0x31')]=_0xd9b91c['attributes'][_0x1bac('0x33')]?_0xd9b91c[_0x1bac('0x31')]:_0x33d9e5['model'];if(_0x35229c['query']['includeAll']){_0xd9b91c[_0x1bac('0x45')]=[{'all':!![]}];}_0xd9b91c=_[_0x1bac('0x3c')]({},_0xd9b91c,_0x35229c[_0x1bac('0x43')]);return db[_0x1bac('0x46')][_0x1bac('0x4c')](_0xd9b91c)[_0x1bac('0x26')](handleEntityNotFound(_0x3e1fa5,null))[_0x1bac('0x26')](respondWithResult(_0x3e1fa5,null))[_0x1bac('0x48')](handleError(_0x3e1fa5,null));};exports['create']=function(_0x4c16ed,_0x5c2418){return db['VoiceMail'][_0x1bac('0x4d')](_0x4c16ed['body'],{})[_0x1bac('0x26')](function(_0x32031e){var _0xa32967=_0x4c16ed[_0x1bac('0x4e')]['get']({'plain':!![]});if(!_0xa32967)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa32967[_0x1bac('0x4f')]==='user'){var _0x492e92=_0x32031e['get']({'plain':!![]});var _0x3c2671=_0x1bac('0x24');return db[_0x1bac('0x50')][_0x1bac('0x4c')]({'where':{'name':_0x3c2671,'userProfileId':_0xa32967[_0x1bac('0x51')]},'raw':!![]})[_0x1bac('0x26')](function(_0x54ddde){if(_0x54ddde&&_0x54ddde[_0x1bac('0x52')]===0x0){return db[_0x1bac('0x25')]['create']({'name':_0x492e92['name'],'resourceId':_0x492e92['id'],'type':_0x54ddde['name'],'sectionId':_0x54ddde['id']},{})[_0x1bac('0x26')](function(){return _0x32031e;});}else{return _0x32031e;}})['catch'](function(_0xef3a7b){logger[_0x1bac('0x29')](_0x1bac('0x53'),_0xef3a7b);throw _0xef3a7b;});}return _0x32031e;})[_0x1bac('0x26')](respondWithResult(_0x5c2418,0xc9))[_0x1bac('0x48')](handleError(_0x5c2418,null));};exports[_0x1bac('0x21')]=function(_0x4862aa,_0x5f28ad){if(_0x4862aa['body']['id']){delete _0x4862aa[_0x1bac('0x54')]['id'];}return db[_0x1bac('0x46')][_0x1bac('0x4c')]({'where':{'id':_0x4862aa['params']['id']}})[_0x1bac('0x26')](handleEntityNotFound(_0x5f28ad,null))[_0x1bac('0x26')](saveUpdates(_0x4862aa[_0x1bac('0x54')],null))[_0x1bac('0x26')](respondWithResult(_0x5f28ad,null))['catch'](handleError(_0x5f28ad,null));};exports[_0x1bac('0x22')]=function(_0xc794d1,_0xcfc9a6){return db[_0x1bac('0x46')][_0x1bac('0x4c')]({'where':{'id':_0xc794d1[_0x1bac('0x4a')]['id']}})[_0x1bac('0x26')](handleEntityNotFound(_0xcfc9a6,null))[_0x1bac('0x26')](removeEntity(_0xcfc9a6,null))['catch'](handleError(_0xcfc9a6,null));};exports[_0x1bac('0x55')]=function(_0x1883db,_0x2dd5d7,_0xdce3c9){return db[_0x1bac('0x46')][_0x1bac('0x56')]({'where':{'id':_0x1883db['params']['id']}})['then'](handleEntityNotFound(_0x2dd5d7,null))[_0x1bac('0x26')](function(_0xbdc374){var _0x5d3a6f;var _0x397e9f={},_0x1bc6df={};_0x1bc6df['model']=_[_0x1bac('0x2f')](db[_0x1bac('0x57')]['rawAttributes']);_0x1bc6df[_0x1bac('0x30')]=_[_0x1bac('0x2f')](_0x1883db['query']);_0x1bc6df[_0x1bac('0x3a')]=_[_0x1bac('0x4b')](_0x1bc6df[_0x1bac('0x2e')],_0x1bc6df[_0x1bac('0x30')]);_0x397e9f['attributes']=_[_0x1bac('0x4b')](_0x1bc6df[_0x1bac('0x2e')],qs['fields'](_0x1883db[_0x1bac('0x30')][_0x1bac('0x32')]));_0x397e9f['attributes']=_0x397e9f[_0x1bac('0x31')][_0x1bac('0x33')]?_0x397e9f[_0x1bac('0x31')]:_0x1bc6df['model'];if(!_0x1883db[_0x1bac('0x30')][_0x1bac('0x34')](_0x1bac('0x35'))){_0x397e9f['limit']=qs['limit'](_0x1883db[_0x1bac('0x30')][_0x1bac('0x1b')]);_0x397e9f['offset']=qs[_0x1bac('0x36')](_0x1883db[_0x1bac('0x30')][_0x1bac('0x36')]);}_0x397e9f['order']=qs[_0x1bac('0x38')](_0x1883db[_0x1bac('0x30')][_0x1bac('0x38')]);_0x397e9f['where']=qs[_0x1bac('0x3a')](_[_0x1bac('0x3b')](_0x1883db[_0x1bac('0x30')],_0x1bc6df[_0x1bac('0x3a')]));if(_0x1883db['query'][_0x1bac('0x42')]){_0x397e9f[_0x1bac('0x39')]=_[_0x1bac('0x3c')](_0x397e9f[_0x1bac('0x39')],{'$or':_[_0x1bac('0x3d')](_0x397e9f[_0x1bac('0x31')],function(_0x5ebe00){var _0x2ea631={};_0x2ea631[_0x5ebe00]={'$like':'%'+_0x1883db[_0x1bac('0x30')][_0x1bac('0x42')]+'%'};return _0x2ea631;})});}_0x397e9f[_0x1bac('0x39')]=_[_0x1bac('0x3c')](_0x397e9f[_0x1bac('0x39')],{'mailboxuser':_0xbdc374['mailbox']});_0x397e9f=_[_0x1bac('0x3c')]({},_0x397e9f,_0x1883db['options']);return db[_0x1bac('0x57')][_0x1bac('0x58')](_0x397e9f)[_0x1bac('0x26')](respondWithFilteredResult(_0x2dd5d7,_0x397e9f));})[_0x1bac('0x48')](handleError(_0x2dd5d7,null));}; \ No newline at end of file +var _0x7b7f=['count','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','findOne','VoiceMailMessage','rawAttributes','nolimit','sort','map','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','VoiceMail','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','limit','order','pick','filter','where','merge','VIRTUAL','field','options'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7b7f,0x118));var _0xf7b7=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x7b7f[_0x4953da];return _0x2d3780;};'use strict';var pdf=require(_0xf7b7('0x0'));var emlformat=require(_0xf7b7('0x1'));var rimraf=require(_0xf7b7('0x2'));var zipdir=require(_0xf7b7('0x3'));var jsonpatch=require(_0xf7b7('0x4'));var rp=require(_0xf7b7('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf7b7('0x6'));var util=require(_0xf7b7('0x7'));var path=require(_0xf7b7('0x8'));var sox=require('sox');var csv=require(_0xf7b7('0x9'));var ejs=require(_0xf7b7('0xa'));var fs=require('fs');var _=require(_0xf7b7('0xb'));var squel=require(_0xf7b7('0xc'));var crypto=require(_0xf7b7('0xd'));var jsforce=require(_0xf7b7('0xe'));var deskjs=require(_0xf7b7('0xf'));var toCsv=require(_0xf7b7('0x9'));var querystring=require(_0xf7b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf7b7('0x11'));var logger=require(_0xf7b7('0x12'))('api');var utils=require(_0xf7b7('0x13'));var config=require(_0xf7b7('0x14'));var db=require(_0xf7b7('0x15'))['db'];function respondWithStatusCode(_0x517b4d,_0x578314){_0x578314=_0x578314||0xcc;return function(_0x24c42d){if(_0x24c42d){return _0x517b4d[_0xf7b7('0x16')](_0x578314);}return _0x517b4d[_0xf7b7('0x17')](_0x578314)[_0xf7b7('0x18')]();};}function respondWithResult(_0x3239a8,_0x27b27d){_0x27b27d=_0x27b27d||0xc8;return function(_0x2a4c5e){if(_0x2a4c5e){return _0x3239a8['status'](_0x27b27d)[_0xf7b7('0x19')](_0x2a4c5e);}};}function respondWithFilteredResult(_0x437ce4,_0x43783e){return function(_0x35ec56){if(_0x35ec56){var _0x4dd423=_0x35ec56['count'],_0x3b0353=_0x43783e[_0xf7b7('0x1a')],_0x4cb4e8=_0x43783e[_0xf7b7('0x1a')]+_0x43783e['limit'],_0x3a4224;if(_0x4cb4e8>=_0x4dd423){_0x4cb4e8=_0x4dd423;_0x3a4224=0xc8;}else{_0x3a4224=0xce;}_0x437ce4['status'](_0x3a4224);return _0x437ce4[_0xf7b7('0x1b')]('Content-Range',_0x3b0353+'-'+_0x4cb4e8+'/'+_0x4dd423)[_0xf7b7('0x19')](_0x35ec56);}return null;};}function patchUpdates(_0x4c6bb6){return function(_0x2a1837){try{jsonpatch[_0xf7b7('0x1c')](_0x2a1837,_0x4c6bb6,!![]);}catch(_0x304b2f){return BPromise[_0xf7b7('0x1d')](_0x304b2f);}return _0x2a1837[_0xf7b7('0x1e')]();};}function saveUpdates(_0x242856,_0x4f3916){return function(_0xfcbb00){if(_0xfcbb00){return _0xfcbb00[_0xf7b7('0x1f')](_0x242856)[_0xf7b7('0x20')](function(_0x2d4f3c){return _0x2d4f3c;});}return null;};}function removeEntity(_0x59b662,_0x41d261){return function(_0x2a2da1){if(_0x2a2da1){return _0x2a2da1[_0xf7b7('0x21')]()['then'](function(){var _0x29a920=_0x2a2da1[_0xf7b7('0x22')]({'plain':!![]});var _0x324546=_0xf7b7('0x23');return db[_0xf7b7('0x24')]['destroy']({'where':{'type':_0x324546,'resourceId':_0x29a920['id']}})['then'](function(){return _0x2a2da1;});})[_0xf7b7('0x20')](function(){_0x59b662[_0xf7b7('0x17')](0xcc)[_0xf7b7('0x18')]();});}};}function handleEntityNotFound(_0x402a99,_0xbd5f8e){return function(_0x492c56){if(!_0x492c56){_0x402a99['sendStatus'](0x194);}return _0x492c56;};}function handleError(_0x4ef8a1,_0x5320d7){_0x5320d7=_0x5320d7||0x1f4;return function(_0x58116b){logger[_0xf7b7('0x25')](_0x58116b['stack']);if(_0x58116b[_0xf7b7('0x26')]){delete _0x58116b[_0xf7b7('0x26')];}_0x4ef8a1['status'](_0x5320d7)[_0xf7b7('0x27')](_0x58116b);};}exports[_0xf7b7('0x28')]=function(_0x4d6c8c,_0x4559c7){var _0x401c8d={},_0x1cbb24={},_0x613d62={'count':0x0,'rows':[]};var _0xd84ec7=db[_0xf7b7('0x29')]['rawAttributes'];_0x1cbb24['model']=_['keys'](_0xd84ec7);_0x1cbb24[_0xf7b7('0x2a')]=_[_0xf7b7('0x2b')](_0x4d6c8c['query']);_0x1cbb24[_0xf7b7('0x2c')]=_[_0xf7b7('0x2d')](_0x1cbb24['model'],_0x1cbb24[_0xf7b7('0x2a')]);_0x401c8d[_0xf7b7('0x2e')]=_[_0xf7b7('0x2d')](_0x1cbb24['model'],qs[_0xf7b7('0x2f')](_0x4d6c8c['query'][_0xf7b7('0x2f')]));_0x401c8d['attributes']=_0x401c8d[_0xf7b7('0x2e')][_0xf7b7('0x30')]?_0x401c8d[_0xf7b7('0x2e')]:_0x1cbb24[_0xf7b7('0x31')];if(!_0x4d6c8c[_0xf7b7('0x2a')][_0xf7b7('0x32')]('nolimit')){_0x401c8d['limit']=qs[_0xf7b7('0x33')](_0x4d6c8c[_0xf7b7('0x2a')]['limit']);_0x401c8d[_0xf7b7('0x1a')]=qs['offset'](_0x4d6c8c['query'][_0xf7b7('0x1a')]);}_0x401c8d[_0xf7b7('0x34')]=qs['sort'](_0x4d6c8c['query']['sort']);_0x401c8d['where']=qs[_0xf7b7('0x2c')](_[_0xf7b7('0x35')](_0x4d6c8c[_0xf7b7('0x2a')],_0x1cbb24[_0xf7b7('0x2c')]));if(_0x4d6c8c[_0xf7b7('0x2a')][_0xf7b7('0x36')]){_0x401c8d[_0xf7b7('0x37')]=_[_0xf7b7('0x38')](_0x401c8d['where'],{'$or':_['map'](_0xd84ec7,function(_0x597ef4){if(_0x597ef4['type']['key']!==_0xf7b7('0x39')){var _0x4a1d4e={};_0x4a1d4e[_0x597ef4[_0xf7b7('0x3a')]]={'$like':'%'+_0x4d6c8c['query'][_0xf7b7('0x36')]+'%'};return _0x4a1d4e;}})});}_0x401c8d=_[_0xf7b7('0x38')]({},_0x401c8d,_0x4d6c8c[_0xf7b7('0x3b')]);var _0x5e8553={'where':_0x401c8d[_0xf7b7('0x37')]};return db[_0xf7b7('0x29')][_0xf7b7('0x3c')](_0x5e8553)[_0xf7b7('0x20')](function(_0x74b125){_0x613d62['count']=_0x74b125;if(_0x4d6c8c[_0xf7b7('0x2a')][_0xf7b7('0x3d')]){_0x401c8d[_0xf7b7('0x3e')]=[{'all':!![]}];}return db[_0xf7b7('0x29')][_0xf7b7('0x3f')](_0x401c8d);})[_0xf7b7('0x20')](function(_0x4a601d){_0x613d62[_0xf7b7('0x40')]=_0x4a601d;return _0x613d62;})['then'](respondWithFilteredResult(_0x4559c7,_0x401c8d))[_0xf7b7('0x41')](handleError(_0x4559c7,null));};exports[_0xf7b7('0x42')]=function(_0x33d75,_0x4fe99e){var _0xc2efd3={'raw':!![],'where':{'id':_0x33d75[_0xf7b7('0x43')]['id']}},_0x505f59={};_0x505f59[_0xf7b7('0x31')]=_[_0xf7b7('0x2b')](db[_0xf7b7('0x29')]['rawAttributes']);_0x505f59['query']=_[_0xf7b7('0x2b')](_0x33d75[_0xf7b7('0x2a')]);_0x505f59[_0xf7b7('0x2c')]=_[_0xf7b7('0x2d')](_0x505f59[_0xf7b7('0x31')],_0x505f59['query']);_0xc2efd3['attributes']=_[_0xf7b7('0x2d')](_0x505f59[_0xf7b7('0x31')],qs['fields'](_0x33d75['query'][_0xf7b7('0x2f')]));_0xc2efd3[_0xf7b7('0x2e')]=_0xc2efd3[_0xf7b7('0x2e')][_0xf7b7('0x30')]?_0xc2efd3['attributes']:_0x505f59[_0xf7b7('0x31')];if(_0x33d75['query'][_0xf7b7('0x3d')]){_0xc2efd3['include']=[{'all':!![]}];}_0xc2efd3=_['merge']({},_0xc2efd3,_0x33d75[_0xf7b7('0x3b')]);return db[_0xf7b7('0x29')][_0xf7b7('0x44')](_0xc2efd3)[_0xf7b7('0x20')](handleEntityNotFound(_0x4fe99e,null))['then'](respondWithResult(_0x4fe99e,null))['catch'](handleError(_0x4fe99e,null));};exports[_0xf7b7('0x45')]=function(_0x2b41a9,_0x5d0de2){return db[_0xf7b7('0x29')][_0xf7b7('0x45')](_0x2b41a9[_0xf7b7('0x46')],{})['then'](function(_0x201629){var _0x261811=_0x2b41a9['user'][_0xf7b7('0x22')]({'plain':!![]});if(!_0x261811)throw new Error(_0xf7b7('0x47'));if(_0x261811[_0xf7b7('0x48')]===_0xf7b7('0x49')){var _0x34f431=_0x201629[_0xf7b7('0x22')]({'plain':!![]});var _0x487c65=_0xf7b7('0x23');return db[_0xf7b7('0x4a')][_0xf7b7('0x44')]({'where':{'name':_0x487c65,'userProfileId':_0x261811[_0xf7b7('0x4b')]},'raw':!![]})[_0xf7b7('0x20')](function(_0x10637e){if(_0x10637e&&_0x10637e[_0xf7b7('0x4c')]===0x0){return db[_0xf7b7('0x24')][_0xf7b7('0x45')]({'name':_0x34f431['name'],'resourceId':_0x34f431['id'],'type':_0x10637e[_0xf7b7('0x26')],'sectionId':_0x10637e['id']},{})[_0xf7b7('0x20')](function(){return _0x201629;});}else{return _0x201629;}})[_0xf7b7('0x41')](function(_0x3fd435){logger[_0xf7b7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fd435);throw _0x3fd435;});}return _0x201629;})[_0xf7b7('0x20')](respondWithResult(_0x5d0de2,0xc9))['catch'](handleError(_0x5d0de2,null));};exports[_0xf7b7('0x1f')]=function(_0xd45835,_0x20c095){if(_0xd45835[_0xf7b7('0x46')]['id']){delete _0xd45835[_0xf7b7('0x46')]['id'];}return db[_0xf7b7('0x29')]['find']({'where':{'id':_0xd45835[_0xf7b7('0x43')]['id']}})[_0xf7b7('0x20')](handleEntityNotFound(_0x20c095,null))[_0xf7b7('0x20')](saveUpdates(_0xd45835['body'],null))[_0xf7b7('0x20')](respondWithResult(_0x20c095,null))['catch'](handleError(_0x20c095,null));};exports[_0xf7b7('0x21')]=function(_0x534299,_0x35ee1d){return db[_0xf7b7('0x29')][_0xf7b7('0x44')]({'where':{'id':_0x534299[_0xf7b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x35ee1d,null))[_0xf7b7('0x20')](removeEntity(_0x35ee1d,null))[_0xf7b7('0x41')](handleError(_0x35ee1d,null));};exports['getMessages']=function(_0x1e2e2a,_0x108729,_0x4d7319){return db[_0xf7b7('0x29')][_0xf7b7('0x4d')]({'where':{'id':_0x1e2e2a[_0xf7b7('0x43')]['id']}})[_0xf7b7('0x20')](handleEntityNotFound(_0x108729,null))[_0xf7b7('0x20')](function(_0x41f03c){var _0x549339;var _0x99981a={},_0x1b0f8f={};_0x1b0f8f[_0xf7b7('0x31')]=_[_0xf7b7('0x2b')](db[_0xf7b7('0x4e')][_0xf7b7('0x4f')]);_0x1b0f8f['query']=_[_0xf7b7('0x2b')](_0x1e2e2a['query']);_0x1b0f8f[_0xf7b7('0x2c')]=_[_0xf7b7('0x2d')](_0x1b0f8f['model'],_0x1b0f8f[_0xf7b7('0x2a')]);_0x99981a[_0xf7b7('0x2e')]=_[_0xf7b7('0x2d')](_0x1b0f8f[_0xf7b7('0x31')],qs[_0xf7b7('0x2f')](_0x1e2e2a[_0xf7b7('0x2a')]['fields']));_0x99981a[_0xf7b7('0x2e')]=_0x99981a[_0xf7b7('0x2e')][_0xf7b7('0x30')]?_0x99981a[_0xf7b7('0x2e')]:_0x1b0f8f['model'];if(!_0x1e2e2a['query']['hasOwnProperty'](_0xf7b7('0x50'))){_0x99981a[_0xf7b7('0x33')]=qs[_0xf7b7('0x33')](_0x1e2e2a[_0xf7b7('0x2a')][_0xf7b7('0x33')]);_0x99981a['offset']=qs[_0xf7b7('0x1a')](_0x1e2e2a['query'][_0xf7b7('0x1a')]);}_0x99981a['order']=qs[_0xf7b7('0x51')](_0x1e2e2a[_0xf7b7('0x2a')]['sort']);_0x99981a[_0xf7b7('0x37')]=qs[_0xf7b7('0x2c')](_[_0xf7b7('0x35')](_0x1e2e2a[_0xf7b7('0x2a')],_0x1b0f8f[_0xf7b7('0x2c')]));if(_0x1e2e2a[_0xf7b7('0x2a')][_0xf7b7('0x36')]){_0x99981a[_0xf7b7('0x37')]=_[_0xf7b7('0x38')](_0x99981a['where'],{'$or':_[_0xf7b7('0x52')](_0x99981a[_0xf7b7('0x2e')],function(_0x33eb9a){var _0x49f9e8={};_0x49f9e8[_0x33eb9a]={'$like':'%'+_0x1e2e2a[_0xf7b7('0x2a')][_0xf7b7('0x36')]+'%'};return _0x49f9e8;})});}_0x99981a[_0xf7b7('0x37')]=_['merge'](_0x99981a['where'],{'mailboxuser':_0x41f03c[_0xf7b7('0x53')]});_0x99981a=_[_0xf7b7('0x38')]({},_0x99981a,_0x1e2e2a[_0xf7b7('0x3b')]);return db[_0xf7b7('0x4e')][_0xf7b7('0x54')](_0x99981a)['then'](respondWithFilteredResult(_0x108729,_0x99981a));})[_0xf7b7('0x41')](handleError(_0x108729,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3967685..c493f7a 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 _0x07ff=['define','VoiceMail','voice_voicemail','context','util','api','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes'];(function(_0x493165,_0x154839){var _0x39c00e=function(_0x1c5746){while(--_0x1c5746){_0x493165['push'](_0x493165['shift']());}};_0x39c00e(++_0x154839);}(_0x07ff,0x130));var _0xf07f=function(_0x263d52,_0x2d5bc1){_0x263d52=_0x263d52-0x0;var _0x46b894=_0x07ff[_0x263d52];return _0x46b894;};'use strict';var _=require('lodash');var util=require(_0xf07f('0x0'));var logger=require('../../config/logger')(_0xf07f('0x1'));var moment=require(_0xf07f('0x2'));var BPromise=require(_0xf07f('0x3'));var rp=require(_0xf07f('0x4'));var fs=require('fs');var path=require(_0xf07f('0x5'));var rimraf=require(_0xf07f('0x6'));var config=require('../../config/environment');var attributes=require(_0xf07f('0x7'));module['exports']=function(_0x301060,_0x1d540c){return _0x301060[_0xf07f('0x8')](_0xf07f('0x9'),attributes,{'tableName':_0xf07f('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xf07f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb44b=['api','moment','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xb44b,0x1a3));var _0xbb44=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xb44b[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require(_0xbb44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbb44('0x1'));var moment=require(_0xbb44('0x2'));var BPromise=require('bluebird');var rp=require(_0xbb44('0x3'));var fs=require('fs');var path=require(_0xbb44('0x4'));var rimraf=require('rimraf');var config=require(_0xbb44('0x5'));var attributes=require(_0xbb44('0x6'));module[_0xbb44('0x7')]=function(_0x554457,_0x237440){return _0x554457[_0xbb44('0x8')](_0xbb44('0x9'),attributes,{'tableName':_0xbb44('0xa'),'paranoid':![],'indexes':[{'name':_0xbb44('0xb'),'fields':[_0xbb44('0xc'),_0xbb44('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index f758e86..3ddef21 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 _0xa30e=['result','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa30e,0x151));var _0xea30=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0xa30e[_0x39872b];return _0x55fa18;};'use strict';var _=require('lodash');var util=require(_0xea30('0x0'));var moment=require(_0xea30('0x1'));var BPromise=require(_0xea30('0x2'));var rs=require(_0xea30('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea30('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea30('0x5'));var config=require(_0xea30('0x6'));var jayson=require(_0xea30('0x7'));var client=jayson[_0xea30('0x8')][_0xea30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c6202,_0x34a6fd,_0x336821){return new BPromise(function(_0x3b376c,_0x40fd72){return client[_0xea30('0xa')](_0x4c6202,_0x336821)[_0xea30('0xb')](function(_0x48d479){logger[_0xea30('0xc')](_0xea30('0xd'),_0x34a6fd,_0xea30('0xe'));logger[_0xea30('0xf')](_0xea30('0x10'),_0x34a6fd,_0xea30('0xe'),JSON['stringify'](_0x48d479));if(_0x48d479['error']){if(_0x48d479[_0xea30('0x11')][_0xea30('0x12')]===0x1f4){logger[_0xea30('0x11')](_0xea30('0xd'),_0x34a6fd,_0x48d479[_0xea30('0x11')][_0xea30('0x13')]);return _0x40fd72(_0x48d479['error'][_0xea30('0x13')]);}logger[_0xea30('0x11')]('VoiceMail,\x20%s,\x20%s',_0x34a6fd,_0x48d479['error'][_0xea30('0x13')]);return _0x3b376c(_0x48d479['error'][_0xea30('0x13')]);}else{logger[_0xea30('0xc')](_0xea30('0xd'),_0x34a6fd,_0xea30('0xe'));_0x3b376c(_0x48d479[_0xea30('0x14')][_0xea30('0x13')]);}})['catch'](function(_0x4a85d4){logger[_0xea30('0x11')](_0xea30('0xd'),_0x34a6fd,_0x4a85d4);_0x40fd72(_0x4a85d4);});});} \ No newline at end of file +var _0x4cd6=['code','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x158932,_0x105c02){var _0x1600b8=function(_0x458769){while(--_0x458769){_0x158932['push'](_0x158932['shift']());}};_0x1600b8(++_0x105c02);}(_0x4cd6,0x7e));var _0x64cd=function(_0x37a635,_0x30bb4d){_0x37a635=_0x37a635-0x0;var _0x417405=_0x4cd6[_0x37a635];return _0x417405;};'use strict';var _=require(_0x64cd('0x0'));var util=require(_0x64cd('0x1'));var moment=require(_0x64cd('0x2'));var BPromise=require(_0x64cd('0x3'));var rs=require(_0x64cd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64cd('0x5'))(_0x64cd('0x6'));var config=require(_0x64cd('0x7'));var jayson=require(_0x64cd('0x8'));var client=jayson[_0x64cd('0x9')][_0x64cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c0d31,_0x2e6980,_0x39f8ee){return new BPromise(function(_0x3e8be7,_0x2e44c8){return client[_0x64cd('0xb')](_0x1c0d31,_0x39f8ee)[_0x64cd('0xc')](function(_0x11847b){logger['info']('VoiceMail,\x20%s,\x20%s',_0x2e6980,_0x64cd('0xd'));logger[_0x64cd('0xe')](_0x64cd('0xf'),_0x2e6980,_0x64cd('0xd'),JSON[_0x64cd('0x10')](_0x11847b));if(_0x11847b[_0x64cd('0x11')]){if(_0x11847b['error'][_0x64cd('0x12')]===0x1f4){logger['error'](_0x64cd('0x13'),_0x2e6980,_0x11847b[_0x64cd('0x11')][_0x64cd('0x14')]);return _0x2e44c8(_0x11847b[_0x64cd('0x11')][_0x64cd('0x14')]);}logger[_0x64cd('0x11')](_0x64cd('0x13'),_0x2e6980,_0x11847b[_0x64cd('0x11')][_0x64cd('0x14')]);return _0x3e8be7(_0x11847b[_0x64cd('0x11')][_0x64cd('0x14')]);}else{logger[_0x64cd('0x15')](_0x64cd('0x13'),_0x2e6980,'request\x20sent');_0x3e8be7(_0x11847b[_0x64cd('0x16')][_0x64cd('0x14')]);}})[_0x64cd('0x17')](function(_0x393e07){logger['error'](_0x64cd('0x13'),_0x2e6980,_0x393e07);_0x2e44c8(_0x393e07);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 1cc0e96..1e1093a 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 _0x3473=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3aacea,_0x4dec2d){var _0xabe687=function(_0x337a79){while(--_0x337a79){_0x3aacea['push'](_0x3aacea['shift']());}};_0xabe687(++_0x4dec2d);}(_0x3473,0x179));var _0x3347=function(_0xfa847c,_0x444a8c){_0xfa847c=_0xfa847c-0x0;var _0x3b22bf=_0x3473[_0xfa847c];return _0x3b22bf;};'use strict';var multer=require(_0x3347('0x0'));var util=require(_0x3347('0x1'));var path=require(_0x3347('0x2'));var timeout=require('connect-timeout');var express=require(_0x3347('0x3'));var router=express[_0x3347('0x4')]();var auth=require(_0x3347('0x5'));var interaction=require(_0x3347('0x6'));var config=require(_0x3347('0x7'));var controller=require(_0x3347('0x8'));router[_0x3347('0x9')]('/',auth[_0x3347('0xa')](),controller['index']);router[_0x3347('0x9')](_0x3347('0xb'),auth[_0x3347('0xa')](),controller[_0x3347('0xc')]);router[_0x3347('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x3347('0xd')]('/',auth['isAuthenticated'](),controller[_0x3347('0xe')]);router[_0x3347('0xf')](_0x3347('0xb'),auth[_0x3347('0xa')](),controller[_0x3347('0x10')]);router['delete'](_0x3347('0xb'),auth[_0x3347('0xa')](),controller[_0x3347('0x11')]);module[_0x3347('0x12')]=router; \ No newline at end of file +var _0x25b2=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download'];(function(_0x4e1b59,_0x4472c9){var _0x35efc5=function(_0x45fe7a){while(--_0x45fe7a){_0x4e1b59['push'](_0x4e1b59['shift']());}};_0x35efc5(++_0x4472c9);}(_0x25b2,0x98));var _0x225b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x25b2[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x225b('0x0'));var util=require(_0x225b('0x1'));var path=require(_0x225b('0x2'));var timeout=require(_0x225b('0x3'));var express=require(_0x225b('0x4'));var router=express[_0x225b('0x5')]();var auth=require(_0x225b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x225b('0x7'));var controller=require(_0x225b('0x8'));router[_0x225b('0x9')]('/',auth[_0x225b('0xa')](),controller[_0x225b('0xb')]);router[_0x225b('0x9')](_0x225b('0xc'),auth['isAuthenticated'](),controller[_0x225b('0xd')]);router['get'](_0x225b('0xe'),auth['isAuthenticated'](),controller[_0x225b('0xf')]);router['post']('/',auth[_0x225b('0xa')](),controller[_0x225b('0x10')]);router[_0x225b('0x11')]('/:id',auth[_0x225b('0xa')](),controller[_0x225b('0x12')]);router[_0x225b('0x13')](_0x225b('0xc'),auth[_0x225b('0xa')](),controller[_0x225b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d533c2e..3d90eb2 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 _0x2261=['BLOB','long','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x2261,0x10c));var _0x1226=function(_0x7fe6d7,_0x5ccf65){_0x7fe6d7=_0x7fe6d7-0x0;var _0x2e9bba=_0x2261[_0x7fe6d7];return _0x2e9bba;};'use strict';var Sequelize=require(_0x1226('0x0'));module[_0x1226('0x1')]={'name':{'type':Sequelize[_0x1226('0x2')],'get':function(_0x52ae39){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x1226('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x1226('0x5')](_0x1226('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x1226('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x31f9=['TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','long'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x31f9,0xbe));var _0x931f=function(_0x357e36,_0x521902){_0x357e36=_0x357e36-0x0;var _0x41d968=_0x31f9[_0x357e36];return _0x41d968;};'use strict';var Sequelize=require('sequelize');module[_0x931f('0x0')]={'name':{'type':Sequelize[_0x931f('0x1')],'get':function(_0x3a6a5e){return this[_0x931f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x931f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x931f('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x931f('0x4')],'defaultValue':''},'stamp':{'type':_0x931f('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9927ec8..86e38ab 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 _0xa8a8=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','differenceBy','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','VoiceMailMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','length','options','find','catch','create','body','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa8a8,0xec));var _0x8a8a=function(_0x91fb12,_0x5ed3ca){_0x91fb12=_0x91fb12-0x0;var _0x49b232=_0xa8a8[_0x91fb12];return _0x49b232;};'use strict';var pdf=require(_0x8a8a('0x0'));var emlformat=require(_0x8a8a('0x1'));var rimraf=require(_0x8a8a('0x2'));var zipdir=require(_0x8a8a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a8a('0x4'));var moment=require(_0x8a8a('0x5'));var BPromise=require(_0x8a8a('0x6'));var Mustache=require(_0x8a8a('0x7'));var util=require(_0x8a8a('0x8'));var path=require(_0x8a8a('0x9'));var sox=require(_0x8a8a('0xa'));var csv=require(_0x8a8a('0xb'));var ejs=require(_0x8a8a('0xc'));var fs=require('fs');var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a8a('0x13'));var hardwareService=require(_0x8a8a('0x14'));var logger=require('../../config/logger')(_0x8a8a('0x15'));var utils=require(_0x8a8a('0x16'));var config=require(_0x8a8a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x679da2,_0x42fab7){_0x42fab7=_0x42fab7||0xcc;return function(_0x330796){if(_0x330796){return _0x679da2[_0x8a8a('0x18')](_0x42fab7);}return _0x679da2['status'](_0x42fab7)[_0x8a8a('0x19')]();};}function respondWithResult(_0x4e5d74,_0x25e1d5){_0x25e1d5=_0x25e1d5||0xc8;return function(_0xb2a3bc){if(_0xb2a3bc){return _0x4e5d74[_0x8a8a('0x1a')](_0x25e1d5)[_0x8a8a('0x1b')](_0xb2a3bc);}};}function respondWithFilteredResult(_0x2ac893,_0x78b0f0){return function(_0x16d38d){if(_0x16d38d){var _0x51ce75=_0x16d38d[_0x8a8a('0x1c')],_0x1ed3be=_0x78b0f0[_0x8a8a('0x1d')],_0x568b83=_0x78b0f0[_0x8a8a('0x1d')]+_0x78b0f0[_0x8a8a('0x1e')],_0x1f36b6;if(_0x568b83>=_0x51ce75){_0x568b83=_0x51ce75;_0x1f36b6=0xc8;}else{_0x1f36b6=0xce;}_0x2ac893['status'](_0x1f36b6);return _0x2ac893[_0x8a8a('0x1f')](_0x8a8a('0x20'),_0x1ed3be+'-'+_0x568b83+'/'+_0x51ce75)[_0x8a8a('0x1b')](_0x16d38d);}return null;};}function patchUpdates(_0x2bce13){return function(_0x299827){try{jsonpatch[_0x8a8a('0x21')](_0x299827,_0x2bce13,!![]);}catch(_0x4d7a45){return BPromise['reject'](_0x4d7a45);}return _0x299827['save']();};}function saveUpdates(_0x4e3d0a,_0x4a6601){return function(_0x3a9b2f){if(_0x3a9b2f){return _0x3a9b2f[_0x8a8a('0x22')](_0x4e3d0a)[_0x8a8a('0x23')](function(_0x44719e){return _0x44719e;});}return null;};}function removeEntity(_0x22ebd4,_0x2f6af2){return function(_0x242bac){if(_0x242bac){return _0x242bac[_0x8a8a('0x24')]()[_0x8a8a('0x23')](function(){_0x22ebd4[_0x8a8a('0x1a')](0xcc)[_0x8a8a('0x19')]();});}};}function handleEntityNotFound(_0x3aa2bb,_0x3b4ece){return function(_0x625c1b){if(!_0x625c1b){_0x3aa2bb[_0x8a8a('0x18')](0x194);}return _0x625c1b;};}function handleError(_0x545a38,_0x3c096f){_0x3c096f=_0x3c096f||0x1f4;return function(_0x16c55b){logger[_0x8a8a('0x25')](_0x16c55b[_0x8a8a('0x26')]);if(_0x16c55b[_0x8a8a('0x27')]){delete _0x16c55b[_0x8a8a('0x27')];}_0x545a38[_0x8a8a('0x1a')](_0x3c096f)['send'](_0x16c55b);};}exports[_0x8a8a('0x28')]=function(_0x38c1e0,_0x2e217a){var _0x54ff7e={},_0x58f42b={},_0x2dafcd={'count':0x0,'rows':[]};var _0x129d11=db['VoiceMailMessage']['rawAttributes'];_0x58f42b['model']=_[_0x8a8a('0x29')](_['keys'](_0x129d11),[_0x8a8a('0x27')]);_0x58f42b[_0x8a8a('0x2a')]=_['keys'](_0x38c1e0[_0x8a8a('0x2a')]);_0x58f42b[_0x8a8a('0x2b')]=_[_0x8a8a('0x2c')](_0x58f42b[_0x8a8a('0x2d')],_0x58f42b[_0x8a8a('0x2a')]);_0x54ff7e[_0x8a8a('0x2e')]=_[_0x8a8a('0x2c')](_0x58f42b[_0x8a8a('0x2d')],qs['fields'](_0x38c1e0['query']['fields']));_0x54ff7e[_0x8a8a('0x2e')]=_0x54ff7e[_0x8a8a('0x2e')]['length']?_0x54ff7e[_0x8a8a('0x2e')]:_0x58f42b[_0x8a8a('0x2d')];if(!_0x38c1e0['query'][_0x8a8a('0x2f')](_0x8a8a('0x30'))){_0x54ff7e[_0x8a8a('0x1e')]=qs['limit'](_0x38c1e0['query'][_0x8a8a('0x1e')]);_0x54ff7e['offset']=qs[_0x8a8a('0x1d')](_0x38c1e0[_0x8a8a('0x2a')][_0x8a8a('0x1d')]);}_0x54ff7e[_0x8a8a('0x31')]=qs[_0x8a8a('0x32')](_0x38c1e0[_0x8a8a('0x2a')][_0x8a8a('0x32')]);_0x54ff7e[_0x8a8a('0x33')]=qs[_0x8a8a('0x2b')](_[_0x8a8a('0x34')](_0x38c1e0[_0x8a8a('0x2a')],_0x58f42b[_0x8a8a('0x2b')]));if(_0x38c1e0[_0x8a8a('0x2a')][_0x8a8a('0x35')]){_0x54ff7e[_0x8a8a('0x33')]=_[_0x8a8a('0x36')](_0x54ff7e[_0x8a8a('0x33')],{'$or':_[_0x8a8a('0x37')](_0x129d11,function(_0x4c8003){if(_0x4c8003['type']['key']!==_0x8a8a('0x38')){var _0x9e0128={};_0x9e0128[_0x4c8003[_0x8a8a('0x39')]]={'$like':'%'+_0x38c1e0[_0x8a8a('0x2a')][_0x8a8a('0x35')]+'%'};return _0x9e0128;}})});}_0x54ff7e=_['merge']({},_0x54ff7e,_0x38c1e0['options']);var _0x8d8481={'where':_0x54ff7e['where']};return db[_0x8a8a('0x3a')]['count'](_0x8d8481)['then'](function(_0x1b33eb){_0x2dafcd[_0x8a8a('0x1c')]=_0x1b33eb;if(_0x38c1e0[_0x8a8a('0x2a')][_0x8a8a('0x3b')]){_0x54ff7e[_0x8a8a('0x3c')]=[{'all':!![]}];}return db[_0x8a8a('0x3a')][_0x8a8a('0x3d')](_0x54ff7e);})['then'](function(_0x40d509){_0x2dafcd[_0x8a8a('0x3e')]=_0x40d509;return _0x2dafcd;})[_0x8a8a('0x23')](respondWithFilteredResult(_0x2e217a,_0x54ff7e))['catch'](handleError(_0x2e217a,null));};exports[_0x8a8a('0x3f')]=function(_0x323f89,_0x3f845e){var _0x572e5e={'raw':!![],'where':{'id':_0x323f89[_0x8a8a('0x40')]['id']}},_0x3fda48={};_0x3fda48[_0x8a8a('0x2d')]=_[_0x8a8a('0x41')](db[_0x8a8a('0x3a')][_0x8a8a('0x42')]);_0x3fda48['query']=_['keys'](_0x323f89[_0x8a8a('0x2a')]);_0x3fda48['filters']=_[_0x8a8a('0x2c')](_0x3fda48[_0x8a8a('0x2d')],_0x3fda48['query']);_0x572e5e['attributes']=_[_0x8a8a('0x2c')](_0x3fda48[_0x8a8a('0x2d')],qs[_0x8a8a('0x43')](_0x323f89[_0x8a8a('0x2a')]['fields']));_0x572e5e[_0x8a8a('0x2e')]=_0x572e5e['attributes'][_0x8a8a('0x44')]?_0x572e5e[_0x8a8a('0x2e')]:_0x3fda48['model'];if(_0x323f89[_0x8a8a('0x2a')][_0x8a8a('0x3b')]){_0x572e5e[_0x8a8a('0x3c')]=[{'all':!![]}];}_0x572e5e=_['merge']({},_0x572e5e,_0x323f89[_0x8a8a('0x45')]);return db[_0x8a8a('0x3a')][_0x8a8a('0x46')](_0x572e5e)['then'](handleEntityNotFound(_0x3f845e,null))['then'](respondWithResult(_0x3f845e,null))[_0x8a8a('0x47')](handleError(_0x3f845e,null));};exports[_0x8a8a('0x48')]=function(_0x1b842a,_0x5c6c98){return db[_0x8a8a('0x3a')][_0x8a8a('0x48')](_0x1b842a[_0x8a8a('0x49')],{})[_0x8a8a('0x23')](respondWithResult(_0x5c6c98,0xc9))[_0x8a8a('0x47')](handleError(_0x5c6c98,null));};exports[_0x8a8a('0x22')]=function(_0x13c233,_0x604d10){if(_0x13c233[_0x8a8a('0x49')]['id']){delete _0x13c233[_0x8a8a('0x49')]['id'];}return db[_0x8a8a('0x3a')]['find']({'where':{'id':_0x13c233[_0x8a8a('0x40')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x604d10,null))[_0x8a8a('0x23')](saveUpdates(_0x13c233[_0x8a8a('0x49')],null))[_0x8a8a('0x23')](respondWithResult(_0x604d10,null))[_0x8a8a('0x47')](handleError(_0x604d10,null));};exports['destroy']=function(_0x1dceca,_0x396ffd){return db[_0x8a8a('0x3a')][_0x8a8a('0x46')]({'where':{'id':_0x1dceca['params']['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x396ffd,null))[_0x8a8a('0x23')](removeEntity(_0x396ffd,null))[_0x8a8a('0x47')](handleError(_0x396ffd,null));};exports['download']=function(_0x4fa5a9,_0x467656,_0x39a8e0){return db[_0x8a8a('0x3a')][_0x8a8a('0x46')]({'where':{'id':_0x4fa5a9[_0x8a8a('0x40')]['id']},'attributes':['id',_0x8a8a('0x4a'),_0x8a8a('0x4b')]})[_0x8a8a('0x23')](handleEntityNotFound(_0x467656,null))[_0x8a8a('0x23')](function(_0x4ab312){if(_0x4ab312){if(!_0x4ab312['recording']){throw new db[(_0x8a8a('0x4c'))][(_0x8a8a('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x505dd4={'Content-Type':_0x8a8a('0x4e'),'Content-Disposition':'attachment'};if(_0x4ab312[_0x8a8a('0x4b')]){_0x505dd4['Content-Disposition']=_0x8a8a('0x4f')+_0x4ab312[_0x8a8a('0x4b')]+_0x8a8a('0x50');}_0x467656[_0x8a8a('0x1f')](_0x505dd4);return _0x467656[_0x8a8a('0x51')](new Buffer(_0x4ab312[_0x8a8a('0x4a')]));}})[_0x8a8a('0x47')](handleError(_0x467656,null));}; \ No newline at end of file +var _0x008c=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','VoiceMailMessage','rawAttributes','model','keys','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','key','field','includeAll','include','findAll','rows','show','params','merge','find','catch','create','update','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','set','html-pdf','eml-format','rimraf'];(function(_0x3d0862,_0x221459){var _0x2e6cf9=function(_0x29785d){while(--_0x29785d){_0x3d0862['push'](_0x3d0862['shift']());}};_0x2e6cf9(++_0x221459);}(_0x008c,0x188));var _0xc008=function(_0x37cd8c,_0x425de5){_0x37cd8c=_0x37cd8c-0x0;var _0x213168=_0x008c[_0x37cd8c];return _0x213168;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['differenceBy'](_[_0xc008('0x25')](_0x4caaf4),[_0xc008('0x26')]);_0x4fce9c[_0xc008('0x27')]=_[_0xc008('0x25')](_0x2e31c2['query']);_0x4fce9c[_0xc008('0x28')]=_[_0xc008('0x29')](_0x4fce9c['model'],_0x4fce9c['query']);_0x5e2aca['attributes']=_[_0xc008('0x29')](_0x4fce9c[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x2a')]));_0x5e2aca[_0xc008('0x2b')]=_0x5e2aca[_0xc008('0x2b')][_0xc008('0x2c')]?_0x5e2aca[_0xc008('0x2b')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x27')][_0xc008('0x2d')]('nolimit')){_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2e')](_0x2e31c2['query'][_0xc008('0x2e')]);_0x5e2aca[_0xc008('0x1a')]=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2f')]=qs[_0xc008('0x30')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x30')]);_0x5e2aca['where']=qs[_0xc008('0x28')](_[_0xc008('0x31')](_0x2e31c2[_0xc008('0x27')],_0x4fce9c[_0xc008('0x28')]));if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x32')]){_0x5e2aca[_0xc008('0x33')]=_['merge'](_0x5e2aca[_0xc008('0x33')],{'$or':_[_0xc008('0x34')](_0x4caaf4,function(_0x50e1d4){if(_0x50e1d4[_0xc008('0x35')][_0xc008('0x36')]!=='VIRTUAL'){var _0x263473={};_0x263473[_0x50e1d4[_0xc008('0x37')]]={'$like':'%'+_0x2e31c2[_0xc008('0x27')]['filter']+'%'};return _0x263473;}})});}_0x5e2aca=_['merge']({},_0x5e2aca,_0x2e31c2['options']);var _0x234f2a={'where':_0x5e2aca['where']};return db[_0xc008('0x22')][_0xc008('0x19')](_0x234f2a)[_0xc008('0x1d')](function(_0x440459){_0x4adbab[_0xc008('0x19')]=_0x440459;if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x38')]){_0x5e2aca[_0xc008('0x39')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x3a')](_0x5e2aca);})[_0xc008('0x1d')](function(_0xdfca2e){_0x4adbab[_0xc008('0x3b')]=_0xdfca2e;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))['catch'](handleError(_0x5bebd9,null));};exports[_0xc008('0x3c')]=function(_0x23c4db,_0x30b7df){var _0x2e98e5={'raw':!![],'where':{'id':_0x23c4db[_0xc008('0x3d')]['id']}},_0x49a16d={};_0x49a16d[_0xc008('0x24')]=_[_0xc008('0x25')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x49a16d['query']=_[_0xc008('0x25')](_0x23c4db[_0xc008('0x27')]);_0x49a16d[_0xc008('0x28')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],_0x49a16d['query']);_0x2e98e5[_0xc008('0x2b')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x23c4db['query'][_0xc008('0x2a')]));_0x2e98e5[_0xc008('0x2b')]=_0x2e98e5[_0xc008('0x2b')]['length']?_0x2e98e5[_0xc008('0x2b')]:_0x49a16d['model'];if(_0x23c4db[_0xc008('0x27')]['includeAll']){_0x2e98e5[_0xc008('0x39')]=[{'all':!![]}];}_0x2e98e5=_[_0xc008('0x3e')]({},_0x2e98e5,_0x23c4db['options']);return db[_0xc008('0x22')][_0xc008('0x3f')](_0x2e98e5)[_0xc008('0x1d')](handleEntityNotFound(_0x30b7df,null))['then'](respondWithResult(_0x30b7df,null))[_0xc008('0x40')](handleError(_0x30b7df,null));};exports[_0xc008('0x41')]=function(_0x200469,_0x44fc5d){return db[_0xc008('0x22')][_0xc008('0x41')](_0x200469['body'],{})['then'](respondWithResult(_0x44fc5d,0xc9))['catch'](handleError(_0x44fc5d,null));};exports[_0xc008('0x42')]=function(_0x36417a,_0x103a83){if(_0x36417a[_0xc008('0x43')]['id']){delete _0x36417a[_0xc008('0x43')]['id'];}return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x36417a[_0xc008('0x3d')]['id']}})['then'](handleEntityNotFound(_0x103a83,null))['then'](saveUpdates(_0x36417a['body'],null))[_0xc008('0x1d')](respondWithResult(_0x103a83,null))[_0xc008('0x40')](handleError(_0x103a83,null));};exports[_0xc008('0x1c')]=function(_0x511383,_0x28bc33){return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x511383[_0xc008('0x3d')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x1d')](removeEntity(_0x28bc33,null))[_0xc008('0x40')](handleError(_0x28bc33,null));};exports[_0xc008('0x44')]=function(_0x3fd7d9,_0x3965b7,_0x52c444){return db['VoiceMailMessage'][_0xc008('0x3f')]({'where':{'id':_0x3fd7d9['params']['id']},'attributes':['id',_0xc008('0x45'),_0xc008('0x46')]})[_0xc008('0x1d')](handleEntityNotFound(_0x3965b7,null))['then'](function(_0x144ab2){if(_0x144ab2){if(!_0x144ab2[_0xc008('0x45')]){throw new db[(_0xc008('0x47'))][(_0xc008('0x48'))](_0xc008('0x49'));}var _0x51105f={'Content-Type':_0xc008('0x4a'),'Content-Disposition':_0xc008('0x4b')};if(_0x144ab2['msg_id']){_0x51105f[_0xc008('0x4c')]=_0xc008('0x4d')+_0x144ab2['msg_id']+'.wav\x22';}_0x3965b7[_0xc008('0x4e')](_0x51105f);return _0x3965b7[_0xc008('0x20')](new Buffer(_0x144ab2[_0xc008('0x45')]));}})[_0xc008('0x40')](handleError(_0x3965b7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ef41ea7..eeb7dd5 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 _0x1309=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x24668d,_0x42d5cd){var _0x488e37=function(_0x4fde7b){while(--_0x4fde7b){_0x24668d['push'](_0x24668d['shift']());}};_0x488e37(++_0x42d5cd);}(_0x1309,0x6e));var _0x9130=function(_0x46dc40,_0x825063){_0x46dc40=_0x46dc40-0x0;var _0x339a20=_0x1309[_0x46dc40];return _0x339a20;};'use strict';var _=require(_0x9130('0x0'));var util=require(_0x9130('0x1'));var logger=require(_0x9130('0x2'))(_0x9130('0x3'));var moment=require(_0x9130('0x4'));var BPromise=require(_0x9130('0x5'));var rp=require(_0x9130('0x6'));var fs=require('fs');var path=require(_0x9130('0x7'));var rimraf=require(_0x9130('0x8'));var config=require(_0x9130('0x9'));var attributes=require(_0x9130('0xa'));module[_0x9130('0xb')]=function(_0x302441,_0x43c547){return _0x302441[_0x9130('0xc')](_0x9130('0xd'),attributes,{'tableName':_0x9130('0xe'),'paranoid':![],'indexes':[{'name':_0x9130('0xf'),'fields':[_0x9130('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x91f4=['util','../../config/logger','api','moment','bluebird','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x550227,_0x4e4ad6){var _0xb6a4bb=function(_0x51951c){while(--_0x51951c){_0x550227['push'](_0x550227['shift']());}};_0xb6a4bb(++_0x4e4ad6);}(_0x91f4,0x1d3));var _0x491f=function(_0x6a0849,_0x421d7e){_0x6a0849=_0x6a0849-0x0;var _0x2efa7c=_0x91f4[_0x6a0849];return _0x2efa7c;};'use strict';var _=require(_0x491f('0x0'));var util=require(_0x491f('0x1'));var logger=require(_0x491f('0x2'))(_0x491f('0x3'));var moment=require(_0x491f('0x4'));var BPromise=require(_0x491f('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('./voiceMailMessage.attributes');module['exports']=function(_0x4f8eff,_0x3ed4bd){return _0x4f8eff['define'](_0x491f('0x6'),attributes,{'tableName':_0x491f('0x7'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x491f('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 1904a52..eb821d8 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 _0xb8a6=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2fc06c,_0xa135d8){var _0x2f0355=function(_0x2fdf78){while(--_0x2fdf78){_0x2fc06c['push'](_0x2fc06c['shift']());}};_0x2f0355(++_0xa135d8);}(_0xb8a6,0xd7));var _0x6b8a=function(_0x2a964c,_0x21e9b5){_0x2a964c=_0x2a964c-0x0;var _0x2dce4d=_0xb8a6[_0x2a964c];return _0x2dce4d;};'use strict';var _=require(_0x6b8a('0x0'));var util=require('util');var moment=require(_0x6b8a('0x1'));var BPromise=require(_0x6b8a('0x2'));var rs=require(_0x6b8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b8a('0x4'))['db'];var utils=require(_0x6b8a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6b8a('0x6'));var jayson=require(_0x6b8a('0x7'));var client=jayson[_0x6b8a('0x8')][_0x6b8a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x524215,_0x487071,_0x7a7c30){return new BPromise(function(_0x2c206f,_0x3d6d9b){return client[_0x6b8a('0xa')](_0x524215,_0x7a7c30)[_0x6b8a('0xb')](function(_0x2aadfe){logger[_0x6b8a('0xc')](_0x6b8a('0xd'),_0x487071,_0x6b8a('0xe'));logger['debug'](_0x6b8a('0xf'),_0x487071,'request\x20sent',JSON[_0x6b8a('0x10')](_0x2aadfe));if(_0x2aadfe[_0x6b8a('0x11')]){if(_0x2aadfe[_0x6b8a('0x11')][_0x6b8a('0x12')]===0x1f4){logger[_0x6b8a('0x11')](_0x6b8a('0xd'),_0x487071,_0x2aadfe[_0x6b8a('0x11')]['message']);return _0x3d6d9b(_0x2aadfe['error'][_0x6b8a('0x13')]);}logger[_0x6b8a('0x11')](_0x6b8a('0xd'),_0x487071,_0x2aadfe[_0x6b8a('0x11')][_0x6b8a('0x13')]);return _0x2c206f(_0x2aadfe[_0x6b8a('0x11')][_0x6b8a('0x13')]);}else{logger[_0x6b8a('0xc')](_0x6b8a('0xd'),_0x487071,_0x6b8a('0xe'));_0x2c206f(_0x2aadfe['result'][_0x6b8a('0x13')]);}})['catch'](function(_0x428d24){logger[_0x6b8a('0x11')](_0x6b8a('0xd'),_0x487071,_0x428d24);_0x3d6d9b(_0x428d24);});});} \ No newline at end of file +var _0x5cbd=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5cbd,0x15e));var _0xd5cb=function(_0x2e1e86,_0x194a98){_0x2e1e86=_0x2e1e86-0x0;var _0x19c3f6=_0x5cbd[_0x2e1e86];return _0x19c3f6;};'use strict';var _=require(_0xd5cb('0x0'));var util=require(_0xd5cb('0x1'));var moment=require(_0xd5cb('0x2'));var BPromise=require(_0xd5cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5cb('0x4'));var db=require(_0xd5cb('0x5'))['db'];var utils=require(_0xd5cb('0x6'));var logger=require('../../config/logger')(_0xd5cb('0x7'));var config=require(_0xd5cb('0x8'));var jayson=require(_0xd5cb('0x9'));var client=jayson[_0xd5cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41436e,_0x36f4ad,_0x540635){return new BPromise(function(_0x5c590b,_0x30350b){return client['request'](_0x41436e,_0x540635)[_0xd5cb('0xb')](function(_0x15d836){logger[_0xd5cb('0xc')](_0xd5cb('0xd'),_0x36f4ad,_0xd5cb('0xe'));logger[_0xd5cb('0xf')](_0xd5cb('0x10'),_0x36f4ad,_0xd5cb('0xe'),JSON[_0xd5cb('0x11')](_0x15d836));if(_0x15d836['error']){if(_0x15d836['error'][_0xd5cb('0x12')]===0x1f4){logger[_0xd5cb('0x13')](_0xd5cb('0xd'),_0x36f4ad,_0x15d836[_0xd5cb('0x13')][_0xd5cb('0x14')]);return _0x30350b(_0x15d836[_0xd5cb('0x13')][_0xd5cb('0x14')]);}logger[_0xd5cb('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x36f4ad,_0x15d836['error']['message']);return _0x5c590b(_0x15d836[_0xd5cb('0x13')][_0xd5cb('0x14')]);}else{logger[_0xd5cb('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x36f4ad,_0xd5cb('0xe'));_0x5c590b(_0x15d836[_0xd5cb('0x15')][_0xd5cb('0x14')]);}})['catch'](function(_0x591a0a){logger[_0xd5cb('0x13')](_0xd5cb('0xd'),_0x36f4ad,_0x591a0a);_0x30350b(_0x591a0a);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8b059c7..d5e2c2d 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 _0x1cc7=['/:id/sounds','getSounds','post','addSound','put','update','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get'];(function(_0x5e0df8,_0x11acbb){var _0x139407=function(_0x2104d9){while(--_0x2104d9){_0x5e0df8['push'](_0x5e0df8['shift']());}};_0x139407(++_0x11acbb);}(_0x1cc7,0x15a));var _0x71cc=function(_0x56b561,_0x42bb94){_0x56b561=_0x56b561-0x0;var _0x3ddf14=_0x1cc7[_0x56b561];return _0x3ddf14;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x71cc('0x3'));var interaction=require(_0x71cc('0x4'));var config=require(_0x71cc('0x5'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x71cc('0x6')]);router['get'](_0x71cc('0x7'),auth[_0x71cc('0x8')](),controller[_0x71cc('0x9')]);router[_0x71cc('0xa')](_0x71cc('0xb'),auth['isAuthenticated'](),controller[_0x71cc('0xc')]);router[_0x71cc('0xd')]('/',auth[_0x71cc('0x8')](),controller['create']);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x71cc('0xe')]);router[_0x71cc('0xf')](_0x71cc('0x7'),auth['isAuthenticated'](),controller[_0x71cc('0x10')]);router['delete'](_0x71cc('0x7'),auth['isAuthenticated'](),controller[_0x71cc('0x11')]);router['delete'](_0x71cc('0x12'),auth[_0x71cc('0x8')](),controller[_0x71cc('0x13')]);module[_0x71cc('0x14')]=router; \ No newline at end of file +var _0x76dc=['../../config/environment','isAuthenticated','index','get','show','/:id/sounds','post','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x370def,_0x58953d){var _0x19aa5a=function(_0x4b93ee){while(--_0x4b93ee){_0x370def['push'](_0x370def['shift']());}};_0x19aa5a(++_0x58953d);}(_0x76dc,0x1f2));var _0xc76d=function(_0x3ebdee,_0x1cf5ca){_0x3ebdee=_0x3ebdee-0x0;var _0x3eb0f9=_0x76dc[_0x3ebdee];return _0x3eb0f9;};'use strict';var multer=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var path=require(_0xc76d('0x2'));var timeout=require(_0xc76d('0x3'));var express=require('express');var router=express[_0xc76d('0x4')]();var auth=require(_0xc76d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc76d('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xc76d('0x7')](),controller[_0xc76d('0x8')]);router[_0xc76d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc76d('0xa')]);router[_0xc76d('0x9')](_0xc76d('0xb'),auth['isAuthenticated'](),controller['getSounds']);router[_0xc76d('0xc')]('/',auth[_0xc76d('0x7')](),controller['create']);router[_0xc76d('0xc')]('/:id/sounds',auth[_0xc76d('0x7')](),controller[_0xc76d('0xd')]);router[_0xc76d('0xe')](_0xc76d('0xf'),auth[_0xc76d('0x7')](),controller[_0xc76d('0x10')]);router[_0xc76d('0x11')](_0xc76d('0xf'),auth[_0xc76d('0x7')](),controller[_0xc76d('0x12')]);router[_0xc76d('0x11')](_0xc76d('0x13'),auth[_0xc76d('0x7')](),controller[_0xc76d('0x14')]);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 29ddd2e..4fadabf 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 _0xc716=['quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','STRING','name','ENUM','custom','files'];(function(_0x1ce0c8,_0x1bf13a){var _0x194f0d=function(_0x275093){while(--_0x275093){_0x1ce0c8['push'](_0x1ce0c8['shift']());}};_0x194f0d(++_0x1bf13a);}(_0xc716,0x16c));var _0x6c71=function(_0x4fe982,_0x387df5){_0x4fe982=_0x4fe982-0x0;var _0x3cb1c4=_0xc716[_0x4fe982];return _0x3cb1c4;};'use strict';var Sequelize=require(_0x6c71('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c71('0x1')],'allowNull':![],'unique':_0x6c71('0x2')},'mode':{'type':Sequelize[_0x6c71('0x3')](_0x6c71('0x4'),_0x6c71('0x5'),'mp3nb',_0x6c71('0x6'),'quietmp3',_0x6c71('0x7')),'allowNull':!![],'defaultValue':_0x6c71('0x5')},'directory':{'type':Sequelize[_0x6c71('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x6c71('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6c71('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6c71('0x1')],'allowNull':!![],'defaultValue':_0x6c71('0x8')},'format':{'type':Sequelize[_0x6c71('0x1')],'allowNull':!![]},'stamp':{'type':_0x6c71('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c32=['custom','files','quietmp3nb','quietmp3','mp3','STRING','alpha','BOOLEAN','sequelize','exports','name','ENUM'];(function(_0x4e6dbf,_0x46900b){var _0x42ed1e=function(_0x2066be){while(--_0x2066be){_0x4e6dbf['push'](_0x4e6dbf['shift']());}};_0x42ed1e(++_0x46900b);}(_0x2c32,0x17c));var _0x22c3=function(_0x7bfb1f,_0x15816e){_0x7bfb1f=_0x7bfb1f-0x0;var _0x5b8155=_0x2c32[_0x7bfb1f];return _0x5b8155;};'use strict';var Sequelize=require(_0x22c3('0x0'));module[_0x22c3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22c3('0x2')},'mode':{'type':Sequelize[_0x22c3('0x3')](_0x22c3('0x4'),_0x22c3('0x5'),'mp3nb',_0x22c3('0x6'),_0x22c3('0x7'),_0x22c3('0x8')),'allowNull':!![],'defaultValue':_0x22c3('0x5')},'directory':{'type':Sequelize[_0x22c3('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x22c3('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x22c3('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x22c3('0x9')],'allowNull':!![],'defaultValue':_0x22c3('0xa')},'format':{'type':Sequelize[_0x22c3('0x9')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x22c3('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index f079661..9e0ebfe 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 _0xb7be=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','MusicOnHolds','UserProfileResource','then','error','stack','name','send','index','model','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','key','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','body','create','sequelize','transaction','mode','directory','root','server/files/moh','files','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','removeSound','map','getSounds','nolimit','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x1cb248,_0x13d180){var _0x4bc6b7=function(_0x53da8d){while(--_0x53da8d){_0x1cb248['push'](_0x1cb248['shift']());}};_0x4bc6b7(++_0x13d180);}(_0xb7be,0x138));var _0xeb7b=function(_0x360f55,_0x25658c){_0x360f55=_0x360f55-0x0;var _0x3fa3ec=_0xb7be[_0x360f55];return _0x3fa3ec;};'use strict';var pdf=require(_0xeb7b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb7b('0x1'));var jsonpatch=require(_0xeb7b('0x2'));var rp=require('request-promise');var moment=require(_0xeb7b('0x3'));var BPromise=require(_0xeb7b('0x4'));var Mustache=require(_0xeb7b('0x5'));var util=require('util');var path=require(_0xeb7b('0x6'));var sox=require(_0xeb7b('0x7'));var csv=require('to-csv');var ejs=require(_0xeb7b('0x8'));var fs=require('fs');var _=require(_0xeb7b('0x9'));var squel=require(_0xeb7b('0xa'));var crypto=require(_0xeb7b('0xb'));var jsforce=require(_0xeb7b('0xc'));var deskjs=require(_0xeb7b('0xd'));var toCsv=require(_0xeb7b('0xe'));var querystring=require(_0xeb7b('0xf'));var Papa=require(_0xeb7b('0x10'));var Redis=require(_0xeb7b('0x11'));var authService=require(_0xeb7b('0x12'));var qs=require(_0xeb7b('0x13'));var hardwareService=require(_0xeb7b('0x14'));var logger=require(_0xeb7b('0x15'))(_0xeb7b('0x16'));var utils=require('../../config/utils');var config=require(_0xeb7b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c9cdb,_0x13541b){_0x13541b=_0x13541b||0xcc;return function(_0x3068c6){if(_0x3068c6){return _0x1c9cdb[_0xeb7b('0x18')](_0x13541b);}return _0x1c9cdb[_0xeb7b('0x19')](_0x13541b)[_0xeb7b('0x1a')]();};}function respondWithResult(_0x138d98,_0x28985a){_0x28985a=_0x28985a||0xc8;return function(_0x5297ec){if(_0x5297ec){return _0x138d98[_0xeb7b('0x19')](_0x28985a)[_0xeb7b('0x1b')](_0x5297ec);}};}function respondWithFilteredResult(_0x4db3a0,_0x3772c3){return function(_0x17d6ad){if(_0x17d6ad){var _0x9470c=_0x17d6ad['count'],_0x3e743b=_0x3772c3[_0xeb7b('0x1c')],_0x2f892a=_0x3772c3['offset']+_0x3772c3[_0xeb7b('0x1d')],_0x30ef56;if(_0x2f892a>=_0x9470c){_0x2f892a=_0x9470c;_0x30ef56=0xc8;}else{_0x30ef56=0xce;}_0x4db3a0[_0xeb7b('0x19')](_0x30ef56);return _0x4db3a0[_0xeb7b('0x1e')](_0xeb7b('0x1f'),_0x3e743b+'-'+_0x2f892a+'/'+_0x9470c)[_0xeb7b('0x1b')](_0x17d6ad);}return null;};}function patchUpdates(_0x39ef39){return function(_0x361677){try{jsonpatch[_0xeb7b('0x20')](_0x361677,_0x39ef39,!![]);}catch(_0x439e94){return BPromise['reject'](_0x439e94);}return _0x361677[_0xeb7b('0x21')]();};}function saveUpdates(_0x1e70d7,_0x5b64eb){return function(_0x148383){if(_0x148383){return _0x148383[_0xeb7b('0x22')](_0x1e70d7)['then'](function(_0x5b966c){return _0x5b966c;});}return null;};}function removeEntity(_0x596726,_0x267015){return function(_0x2a205f){if(_0x2a205f){return _0x2a205f[_0xeb7b('0x23')]()['then'](function(){var _0x2d40f6=_0x2a205f['get']({'plain':!![]});var _0x1cee96=_0xeb7b('0x24');return db[_0xeb7b('0x25')]['destroy']({'where':{'type':_0x1cee96,'resourceId':_0x2d40f6['id']}})['then'](function(){return _0x2a205f;});})[_0xeb7b('0x26')](function(){_0x596726[_0xeb7b('0x19')](0xcc)[_0xeb7b('0x1a')]();});}};}function handleEntityNotFound(_0x39bc6f,_0x2917b4){return function(_0x570362){if(!_0x570362){_0x39bc6f[_0xeb7b('0x18')](0x194);}return _0x570362;};}function handleError(_0x1813aa,_0x2a827a){_0x2a827a=_0x2a827a||0x1f4;return function(_0x26636f){logger[_0xeb7b('0x27')](_0x26636f[_0xeb7b('0x28')]);if(_0x26636f[_0xeb7b('0x29')]){delete _0x26636f[_0xeb7b('0x29')];}_0x1813aa['status'](_0x2a827a)[_0xeb7b('0x2a')](_0x26636f);};}exports[_0xeb7b('0x2b')]=function(_0x356937,_0x5cbc07){var _0x51d818={},_0x5b2f23={},_0x39cbf3={'count':0x0,'rows':[]};var _0x393754=db['VoiceMusicOnHold']['rawAttributes'];_0x5b2f23[_0xeb7b('0x2c')]=_['keys'](_0x393754);_0x5b2f23['query']=_['keys'](_0x356937['query']);_0x5b2f23['filters']=_[_0xeb7b('0x2d')](_0x5b2f23[_0xeb7b('0x2c')],_0x5b2f23[_0xeb7b('0x2e')]);_0x51d818[_0xeb7b('0x2f')]=_[_0xeb7b('0x2d')](_0x5b2f23[_0xeb7b('0x2c')],qs[_0xeb7b('0x30')](_0x356937['query']['fields']));_0x51d818[_0xeb7b('0x2f')]=_0x51d818[_0xeb7b('0x2f')][_0xeb7b('0x31')]?_0x51d818[_0xeb7b('0x2f')]:_0x5b2f23[_0xeb7b('0x2c')];if(!_0x356937['query'][_0xeb7b('0x32')]('nolimit')){_0x51d818[_0xeb7b('0x1d')]=qs['limit'](_0x356937[_0xeb7b('0x2e')][_0xeb7b('0x1d')]);_0x51d818[_0xeb7b('0x1c')]=qs[_0xeb7b('0x1c')](_0x356937['query']['offset']);}_0x51d818['order']=qs['sort'](_0x356937[_0xeb7b('0x2e')][_0xeb7b('0x33')]);_0x51d818[_0xeb7b('0x34')]=qs[_0xeb7b('0x35')](_[_0xeb7b('0x36')](_0x356937[_0xeb7b('0x2e')],_0x5b2f23[_0xeb7b('0x35')]));if(_0x356937['query'][_0xeb7b('0x37')]){_0x51d818[_0xeb7b('0x34')]=_[_0xeb7b('0x38')](_0x51d818[_0xeb7b('0x34')],{'$or':_['map'](_0x393754,function(_0x168c15){if(_0x168c15['type'][_0xeb7b('0x39')]!==_0xeb7b('0x3a')){var _0x5a524b={};_0x5a524b[_0x168c15['field']]={'$like':'%'+_0x356937[_0xeb7b('0x2e')][_0xeb7b('0x37')]+'%'};return _0x5a524b;}})});}_0x51d818=_['merge']({},_0x51d818,_0x356937[_0xeb7b('0x3b')]);var _0x10edbd={'where':_0x51d818[_0xeb7b('0x34')]};return db[_0xeb7b('0x3c')]['count'](_0x10edbd)[_0xeb7b('0x26')](function(_0x12170e){_0x39cbf3['count']=_0x12170e;if(_0x356937['query'][_0xeb7b('0x3d')]){_0x51d818[_0xeb7b('0x3e')]=[{'all':!![]}];}return db[_0xeb7b('0x3c')][_0xeb7b('0x3f')](_0x51d818);})[_0xeb7b('0x26')](function(_0x49e895){_0x39cbf3[_0xeb7b('0x40')]=_0x49e895;return _0x39cbf3;})[_0xeb7b('0x26')](respondWithFilteredResult(_0x5cbc07,_0x51d818))['catch'](handleError(_0x5cbc07,null));};exports[_0xeb7b('0x41')]=function(_0x2c9e28,_0x53130f){var _0x10472e={'raw':![],'where':{'id':_0x2c9e28[_0xeb7b('0x42')]['id']}},_0x56e907={};_0x56e907[_0xeb7b('0x2c')]=_['keys'](db[_0xeb7b('0x3c')][_0xeb7b('0x43')]);_0x56e907[_0xeb7b('0x2e')]=_[_0xeb7b('0x44')](_0x2c9e28[_0xeb7b('0x2e')]);_0x56e907['filters']=_[_0xeb7b('0x2d')](_0x56e907['model'],_0x56e907['query']);_0x10472e['attributes']=_['intersection'](_0x56e907[_0xeb7b('0x2c')],qs[_0xeb7b('0x30')](_0x2c9e28[_0xeb7b('0x2e')]['fields']));_0x10472e[_0xeb7b('0x2f')]=_0x10472e['attributes'][_0xeb7b('0x31')]?_0x10472e[_0xeb7b('0x2f')]:_0x56e907[_0xeb7b('0x2c')];if(_0x2c9e28[_0xeb7b('0x2e')][_0xeb7b('0x3d')]){_0x10472e[_0xeb7b('0x3e')]=[{'all':!![]}];}_0x10472e=_[_0xeb7b('0x38')]({},_0x10472e,_0x2c9e28[_0xeb7b('0x3b')]);return db[_0xeb7b('0x3c')][_0xeb7b('0x45')](_0x10472e)[_0xeb7b('0x26')](handleEntityNotFound(_0x53130f,null))[_0xeb7b('0x26')](respondWithResult(_0x53130f,null))['catch'](handleError(_0x53130f,null));};exports['update']=function(_0x44e99c,_0x2b33a9){if(_0x44e99c[_0xeb7b('0x46')]['id']){delete _0x44e99c['body']['id'];}return db[_0xeb7b('0x3c')][_0xeb7b('0x45')]({'where':{'id':_0x44e99c[_0xeb7b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b33a9,null))[_0xeb7b('0x26')](saveUpdates(_0x44e99c['body'],null))['then'](respondWithResult(_0x2b33a9,null))['catch'](handleError(_0x2b33a9,null));};exports[_0xeb7b('0x47')]=function(_0x5bed3c,_0x77e1d5,_0x4a5036){return db[_0xeb7b('0x48')][_0xeb7b('0x49')](function(_0xfa0b42){if(_0x5bed3c[_0xeb7b('0x46')][_0xeb7b('0x4a')]==='files'){_0x5bed3c[_0xeb7b('0x46')][_0xeb7b('0x4b')]=path['join'](config[_0xeb7b('0x4c')],_0xeb7b('0x4d'),_0x5bed3c[_0xeb7b('0x46')][_0xeb7b('0x29')]);}return db['VoiceMusicOnHold'][_0xeb7b('0x47')](_0x5bed3c[_0xeb7b('0x46')],{'transaction':_0xfa0b42})['then'](function(_0x5c6cb8){if(_0x5bed3c[_0xeb7b('0x46')][_0xeb7b('0x4a')]===_0xeb7b('0x4e')){fs['mkdirSync'](_0x5c6cb8[_0xeb7b('0x4b')],parseInt('0777',0x8));}var _0xb627b=_0x5bed3c['user'][_0xeb7b('0x4f')]({'plain':!![]});if(!_0xb627b)throw new Error(_0xeb7b('0x50'));if(_0xb627b['role']===_0xeb7b('0x51')){var _0x4cdab6=_0x5c6cb8[_0xeb7b('0x4f')]({'plain':!![]});return db[_0xeb7b('0x52')][_0xeb7b('0x45')]({'where':{'name':_0xeb7b('0x24'),'userProfileId':_0xb627b[_0xeb7b('0x53')]},'raw':!![]})[_0xeb7b('0x26')](function(_0x1b35bb){if(_0x1b35bb&&_0x1b35bb[_0xeb7b('0x54')]===0x0){return db['UserProfileResource'][_0xeb7b('0x47')]({'name':_0x4cdab6[_0xeb7b('0x29')],'resourceId':_0x4cdab6['id'],'type':_0x1b35bb['name'],'sectionId':_0x1b35bb['id']},{})[_0xeb7b('0x26')](function(){return _0x5c6cb8;});}else{return _0x5c6cb8;}})[_0xeb7b('0x55')](function(_0x2aa5d2){logger[_0xeb7b('0x27')](_0xeb7b('0x56'),_0x2aa5d2);});}return _0x5c6cb8;});})['then'](respondWithResult(_0x77e1d5,0xc9))[_0xeb7b('0x55')](handleError(_0x77e1d5,null));};exports[_0xeb7b('0x23')]=function(_0x35c0c0,_0x1ce9ea,_0x309476){var _0x34fd62;return db[_0xeb7b('0x3c')][_0xeb7b('0x45')]({'where':{'id':_0x35c0c0[_0xeb7b('0x42')]['id']}})[_0xeb7b('0x26')](function(_0x95bfeb){if(_0x95bfeb){return db['sequelize'][_0xeb7b('0x49')](function(_0x3813ee){return _0x95bfeb['destroy']({'transaction':_0x3813ee,'raw':!![]})[_0xeb7b('0x26')](function(_0x5c5ac4){if(_0x5c5ac4[_0xeb7b('0x4b')]){fs[_0xeb7b('0x57')](_0x5c5ac4[_0xeb7b('0x4b')])[_0xeb7b('0x58')](function(_0x530566){fs[_0xeb7b('0x59')](path['join'](_0x5c5ac4[_0xeb7b('0x4b')],_0x530566));});fs['rmdirSync'](_0x5c5ac4['directory']);}return _0x5c5ac4;});})[_0xeb7b('0x55')](function(_0x4278ee){throw new db[(_0xeb7b('0x5a'))][(_0xeb7b('0x5b'))](_0x4278ee[_0xeb7b('0x5c')]);});}})[_0xeb7b('0x26')](handleEntityNotFound(_0x1ce9ea,null))[_0xeb7b('0x26')](removeEntity(_0x1ce9ea,null))['catch'](handleError(_0x1ce9ea,null));};exports[_0xeb7b('0x5d')]=function(_0x19c1bf,_0x3b8fbe,_0x1c2e1e){return db[_0xeb7b('0x48')][_0xeb7b('0x49')](function(_0x11dd56){var _0x2c9baf;return db[_0xeb7b('0x3c')][_0xeb7b('0x45')]({'where':{'id':_0x19c1bf['params']['id']}})[_0xeb7b('0x26')](function(_0x5744e2){if(_0x5744e2){_0x2c9baf=_0x5744e2;return _0x5744e2[_0xeb7b('0x5d')](_0x19c1bf[_0xeb7b('0x46')]['id'],{'transaction':_0x11dd56});}})[_0xeb7b('0x26')](function(_0x18c78d){if(_0x18c78d){return db[_0xeb7b('0x5e')][_0xeb7b('0x5f')]({'where':{'id':_0x19c1bf[_0xeb7b('0x46')]['id']},'attributes':['id','name',_0xeb7b('0x60'),_0xeb7b('0x61'),_0xeb7b('0x62')],'raw':!![]});}})[_0xeb7b('0x26')](function(_0x323b84){if(_0x323b84){var _0x4c14ec=path[_0xeb7b('0x63')](config[_0xeb7b('0x4c')],_0xeb7b('0x64'),util[_0xeb7b('0x65')](_0xeb7b('0x66'),path[_0xeb7b('0x67')](_0x323b84[_0xeb7b('0x60')],path['extname'](_0x323b84['save_name'])),_0x323b84[_0xeb7b('0x61')]));var _0x57261b=path['join'](config[_0xeb7b('0x4c')],_0xeb7b('0x4d'),_0x2c9baf['name'],util[_0xeb7b('0x65')](_0xeb7b('0x66'),_0x323b84[_0xeb7b('0x29')],_0x323b84[_0xeb7b('0x61')]));fs[_0xeb7b('0x68')](_0x4c14ec,_0x57261b);return _0x323b84;}})[_0xeb7b('0x55')](function(_0x461d4b){throw new db[(_0xeb7b('0x5a'))][(_0xeb7b('0x5b'))](_0x461d4b['message']);});})[_0xeb7b('0x26')](handleEntityNotFound(_0x3b8fbe,null))[_0xeb7b('0x26')](respondWithResult(_0x3b8fbe,0xc9))[_0xeb7b('0x55')](handleError(_0x3b8fbe,null));};exports['removeSound']=function(_0x4cebd8,_0x318a45,_0x7d2563){return db[_0xeb7b('0x48')]['transaction'](function(_0x34948c){var _0x366cdd;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x4cebd8['params']['id']}})[_0xeb7b('0x26')](handleEntityNotFound(_0x318a45,null))['then'](function(_0x4f5203){if(_0x4f5203){_0x366cdd=_0x4f5203;return _0x4f5203[_0xeb7b('0x69')](_0x4cebd8[_0xeb7b('0x42')]['id2']);}})[_0xeb7b('0x26')](function(_0xbf5d15){if(_0xbf5d15){return db[_0xeb7b('0x5e')][_0xeb7b('0x5f')]({'where':{'id':_0x4cebd8['params']['id2']},'attributes':['id',_0xeb7b('0x29'),_0xeb7b('0x60'),'converted_format',_0xeb7b('0x62')],'raw':!![]});}})[_0xeb7b('0x26')](function(_0x2a1b98){if(_0x2a1b98){fs['unlinkSync'](path[_0xeb7b('0x63')](_0x366cdd[_0xeb7b('0x4b')],util['format']('%s.%s',_0x2a1b98['name'],_0x2a1b98[_0xeb7b('0x61')])));return _0x2a1b98;}})[_0xeb7b('0x55')](function(_0x1d6ba0){throw new db[(_0xeb7b('0x5a'))][(_0xeb7b('0x5b'))](_0x1d6ba0[_0xeb7b('0x5c')]);});})[_0xeb7b('0x26')](handleEntityNotFound(_0x318a45,null))['then'](respondWithStatusCode(_0x318a45,0xcc))['catch'](handleError(_0x318a45,null));};exports['getSounds']=function(_0x58d5b6,_0x5ba273,_0x56b183){var _0xf30d72={};var _0x16fa9b={};var _0x342346;var _0x392d1e;return db[_0xeb7b('0x3c')][_0xeb7b('0x5f')]({'where':{'id':_0x58d5b6['params']['id']}})[_0xeb7b('0x26')](handleEntityNotFound(_0x5ba273,null))[_0xeb7b('0x26')](function(_0x49d033){if(_0x49d033){_0x342346=_0x49d033;_0x16fa9b[_0xeb7b('0x2c')]=_[_0xeb7b('0x44')](db[_0xeb7b('0x5e')]['rawAttributes']);_0x16fa9b[_0xeb7b('0x2e')]=_[_0xeb7b('0x44')](_0x58d5b6[_0xeb7b('0x2e')]);_0x16fa9b[_0xeb7b('0x35')]=_['intersection'](_0x16fa9b[_0xeb7b('0x2c')],_0x16fa9b[_0xeb7b('0x2e')]);_0xf30d72[_0xeb7b('0x2f')]=_[_0xeb7b('0x2d')](_0x16fa9b[_0xeb7b('0x2c')],qs[_0xeb7b('0x30')](_0x58d5b6['query'][_0xeb7b('0x30')]));_0xf30d72[_0xeb7b('0x2f')]=_0xf30d72[_0xeb7b('0x2f')]['length']?_0xf30d72[_0xeb7b('0x2f')]:_0x16fa9b['model'];_0xf30d72['order']=qs[_0xeb7b('0x33')](_0x58d5b6[_0xeb7b('0x2e')][_0xeb7b('0x33')]);_0xf30d72[_0xeb7b('0x34')]=qs[_0xeb7b('0x35')](_['pick'](_0x58d5b6[_0xeb7b('0x2e')],_0x16fa9b[_0xeb7b('0x35')]));if(_0x58d5b6[_0xeb7b('0x2e')][_0xeb7b('0x37')]){_0xf30d72[_0xeb7b('0x34')]=_[_0xeb7b('0x38')](_0xf30d72['where'],{'$or':_[_0xeb7b('0x6a')](_0xf30d72[_0xeb7b('0x2f')],function(_0x57a853){var _0xa7f94={};_0xa7f94[_0x57a853]={'$like':'%'+_0x58d5b6['query'][_0xeb7b('0x37')]+'%'};return _0xa7f94;})});}_0xf30d72=_[_0xeb7b('0x38')]({},_0xf30d72,_0x58d5b6[_0xeb7b('0x3b')]);return _0x342346[_0xeb7b('0x6b')](_0xf30d72);}})[_0xeb7b('0x26')](function(_0x545aff){if(_0x545aff){_0x392d1e=_0x545aff[_0xeb7b('0x31')];if(!_0x58d5b6['query'][_0xeb7b('0x32')](_0xeb7b('0x6c'))){_0xf30d72[_0xeb7b('0x1d')]=qs['limit'](_0x58d5b6[_0xeb7b('0x2e')][_0xeb7b('0x1d')]);_0xf30d72[_0xeb7b('0x1c')]=qs['offset'](_0x58d5b6['query'][_0xeb7b('0x1c')]);}return _0x342346[_0xeb7b('0x6b')](_0xf30d72);}})['then'](function(_0xa9b482){if(_0xa9b482){return _0xa9b482?{'count':_0x392d1e,'rows':_0xa9b482}:null;}})[_0xeb7b('0x26')](respondWithResult(_0x5ba273,null))[_0xeb7b('0x55')](handleError(_0x5ba273,null));}; \ No newline at end of file +var _0xb25b=['role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','server/files/sounds/converted','format','%s.%s','extname','converted_format','symlinkSync','removeSound','id2','createdAt','unlinkSync','order','getSounds','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','stack','name','send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','mode','directory','join','root','server/files/moh','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x6d28f0,_0x16035f){var _0x3f4fc6=function(_0x8cc38a){while(--_0x8cc38a){_0x6d28f0['push'](_0x6d28f0['shift']());}};_0x3f4fc6(++_0x16035f);}(_0xb25b,0xf4));var _0xbb25=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb25b[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbb25('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb25('0x1'));var rp=require(_0xbb25('0x2'));var moment=require(_0xbb25('0x3'));var BPromise=require(_0xbb25('0x4'));var Mustache=require(_0xbb25('0x5'));var util=require('util');var path=require(_0xbb25('0x6'));var sox=require(_0xbb25('0x7'));var csv=require(_0xbb25('0x8'));var ejs=require(_0xbb25('0x9'));var fs=require('fs');var _=require(_0xbb25('0xa'));var squel=require(_0xbb25('0xb'));var crypto=require(_0xbb25('0xc'));var jsforce=require(_0xbb25('0xd'));var deskjs=require(_0xbb25('0xe'));var toCsv=require(_0xbb25('0x8'));var querystring=require(_0xbb25('0xf'));var Papa=require('papaparse');var Redis=require(_0xbb25('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbb25('0x11'));var logger=require(_0xbb25('0x12'))(_0xbb25('0x13'));var utils=require(_0xbb25('0x14'));var config=require('../../config/environment');var db=require(_0xbb25('0x15'))['db'];function respondWithStatusCode(_0x5020c5,_0x3c39d4){_0x3c39d4=_0x3c39d4||0xcc;return function(_0xcb5c8b){if(_0xcb5c8b){return _0x5020c5[_0xbb25('0x16')](_0x3c39d4);}return _0x5020c5['status'](_0x3c39d4)[_0xbb25('0x17')]();};}function respondWithResult(_0x5dab1d,_0x4b2515){_0x4b2515=_0x4b2515||0xc8;return function(_0x16404d){if(_0x16404d){return _0x5dab1d['status'](_0x4b2515)[_0xbb25('0x18')](_0x16404d);}};}function respondWithFilteredResult(_0x4f8882,_0x27ac06){return function(_0x3f6529){if(_0x3f6529){var _0x3509af=_0x3f6529[_0xbb25('0x19')],_0x33baee=_0x27ac06[_0xbb25('0x1a')],_0xd0758d=_0x27ac06[_0xbb25('0x1a')]+_0x27ac06[_0xbb25('0x1b')],_0xa7290;if(_0xd0758d>=_0x3509af){_0xd0758d=_0x3509af;_0xa7290=0xc8;}else{_0xa7290=0xce;}_0x4f8882[_0xbb25('0x1c')](_0xa7290);return _0x4f8882[_0xbb25('0x1d')](_0xbb25('0x1e'),_0x33baee+'-'+_0xd0758d+'/'+_0x3509af)[_0xbb25('0x18')](_0x3f6529);}return null;};}function patchUpdates(_0x3cfbbb){return function(_0x59a6c8){try{jsonpatch[_0xbb25('0x1f')](_0x59a6c8,_0x3cfbbb,!![]);}catch(_0x2b69c8){return BPromise[_0xbb25('0x20')](_0x2b69c8);}return _0x59a6c8[_0xbb25('0x21')]();};}function saveUpdates(_0xaef44b,_0x2ce7c0){return function(_0x3c7299){if(_0x3c7299){return _0x3c7299[_0xbb25('0x22')](_0xaef44b)[_0xbb25('0x23')](function(_0x1b137f){return _0x1b137f;});}return null;};}function removeEntity(_0x20ca1f,_0x4b0c34){return function(_0x8eb0ac){if(_0x8eb0ac){return _0x8eb0ac[_0xbb25('0x24')]()[_0xbb25('0x23')](function(){var _0x29f9ff=_0x8eb0ac[_0xbb25('0x25')]({'plain':!![]});var _0xf0bb2=_0xbb25('0x26');return db['UserProfileResource'][_0xbb25('0x24')]({'where':{'type':_0xf0bb2,'resourceId':_0x29f9ff['id']}})[_0xbb25('0x23')](function(){return _0x8eb0ac;});})['then'](function(){_0x20ca1f['status'](0xcc)[_0xbb25('0x17')]();});}};}function handleEntityNotFound(_0x1c5e4c,_0x33d64c){return function(_0x3ec135){if(!_0x3ec135){_0x1c5e4c[_0xbb25('0x16')](0x194);}return _0x3ec135;};}function handleError(_0x2f9505,_0x317253){_0x317253=_0x317253||0x1f4;return function(_0x1c6f29){logger['error'](_0x1c6f29[_0xbb25('0x27')]);if(_0x1c6f29[_0xbb25('0x28')]){delete _0x1c6f29[_0xbb25('0x28')];}_0x2f9505['status'](_0x317253)[_0xbb25('0x29')](_0x1c6f29);};}exports[_0xbb25('0x2a')]=function(_0x3b4bab,_0x570a40){var _0x3ad8a9={},_0x18319c={},_0x41f1b0={'count':0x0,'rows':[]};var _0x465006=db[_0xbb25('0x2b')][_0xbb25('0x2c')];_0x18319c[_0xbb25('0x2d')]=_[_0xbb25('0x2e')](_0x465006);_0x18319c[_0xbb25('0x2f')]=_[_0xbb25('0x2e')](_0x3b4bab[_0xbb25('0x2f')]);_0x18319c['filters']=_[_0xbb25('0x30')](_0x18319c['model'],_0x18319c[_0xbb25('0x2f')]);_0x3ad8a9['attributes']=_[_0xbb25('0x30')](_0x18319c['model'],qs['fields'](_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x31')]));_0x3ad8a9[_0xbb25('0x32')]=_0x3ad8a9['attributes'][_0xbb25('0x33')]?_0x3ad8a9[_0xbb25('0x32')]:_0x18319c['model'];if(!_0x3b4bab['query'][_0xbb25('0x34')](_0xbb25('0x35'))){_0x3ad8a9['limit']=qs[_0xbb25('0x1b')](_0x3b4bab['query'][_0xbb25('0x1b')]);_0x3ad8a9[_0xbb25('0x1a')]=qs[_0xbb25('0x1a')](_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x1a')]);}_0x3ad8a9['order']=qs[_0xbb25('0x36')](_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x36')]);_0x3ad8a9[_0xbb25('0x37')]=qs['filters'](_[_0xbb25('0x38')](_0x3b4bab['query'],_0x18319c[_0xbb25('0x39')]));if(_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x3a')]){_0x3ad8a9[_0xbb25('0x37')]=_[_0xbb25('0x3b')](_0x3ad8a9[_0xbb25('0x37')],{'$or':_[_0xbb25('0x3c')](_0x465006,function(_0x3a07de){if(_0x3a07de['type'][_0xbb25('0x3d')]!==_0xbb25('0x3e')){var _0x26ac15={};_0x26ac15[_0x3a07de[_0xbb25('0x3f')]]={'$like':'%'+_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x3a')]+'%'};return _0x26ac15;}})});}_0x3ad8a9=_[_0xbb25('0x3b')]({},_0x3ad8a9,_0x3b4bab[_0xbb25('0x40')]);var _0x13bbe2={'where':_0x3ad8a9[_0xbb25('0x37')]};return db[_0xbb25('0x2b')][_0xbb25('0x19')](_0x13bbe2)['then'](function(_0x3fafe6){_0x41f1b0[_0xbb25('0x19')]=_0x3fafe6;if(_0x3b4bab[_0xbb25('0x2f')][_0xbb25('0x41')]){_0x3ad8a9['include']=[{'all':!![]}];}return db[_0xbb25('0x2b')][_0xbb25('0x42')](_0x3ad8a9);})[_0xbb25('0x23')](function(_0x37e8e2){_0x41f1b0[_0xbb25('0x43')]=_0x37e8e2;return _0x41f1b0;})[_0xbb25('0x23')](respondWithFilteredResult(_0x570a40,_0x3ad8a9))[_0xbb25('0x44')](handleError(_0x570a40,null));};exports[_0xbb25('0x45')]=function(_0x224457,_0x1b4557){var _0x337289={'raw':![],'where':{'id':_0x224457[_0xbb25('0x46')]['id']}},_0x5c35f3={};_0x5c35f3[_0xbb25('0x2d')]=_[_0xbb25('0x2e')](db[_0xbb25('0x2b')][_0xbb25('0x2c')]);_0x5c35f3['query']=_[_0xbb25('0x2e')](_0x224457[_0xbb25('0x2f')]);_0x5c35f3['filters']=_['intersection'](_0x5c35f3['model'],_0x5c35f3[_0xbb25('0x2f')]);_0x337289[_0xbb25('0x32')]=_['intersection'](_0x5c35f3['model'],qs['fields'](_0x224457['query'][_0xbb25('0x31')]));_0x337289['attributes']=_0x337289[_0xbb25('0x32')][_0xbb25('0x33')]?_0x337289[_0xbb25('0x32')]:_0x5c35f3['model'];if(_0x224457[_0xbb25('0x2f')]['includeAll']){_0x337289['include']=[{'all':!![]}];}_0x337289=_[_0xbb25('0x3b')]({},_0x337289,_0x224457[_0xbb25('0x40')]);return db[_0xbb25('0x2b')][_0xbb25('0x47')](_0x337289)[_0xbb25('0x23')](handleEntityNotFound(_0x1b4557,null))[_0xbb25('0x23')](respondWithResult(_0x1b4557,null))['catch'](handleError(_0x1b4557,null));};exports['update']=function(_0x3f0c9d,_0x521c14){if(_0x3f0c9d['body']['id']){delete _0x3f0c9d[_0xbb25('0x48')]['id'];}return db[_0xbb25('0x2b')]['find']({'where':{'id':_0x3f0c9d[_0xbb25('0x46')]['id']}})['then'](handleEntityNotFound(_0x521c14,null))[_0xbb25('0x23')](saveUpdates(_0x3f0c9d['body'],null))[_0xbb25('0x23')](respondWithResult(_0x521c14,null))[_0xbb25('0x44')](handleError(_0x521c14,null));};exports[_0xbb25('0x49')]=function(_0x556ba3,_0x4e0967,_0x36f043){return db[_0xbb25('0x4a')][_0xbb25('0x4b')](function(_0x3ed96a){if(_0x556ba3[_0xbb25('0x48')][_0xbb25('0x4c')]==='files'){_0x556ba3[_0xbb25('0x48')][_0xbb25('0x4d')]=path[_0xbb25('0x4e')](config[_0xbb25('0x4f')],_0xbb25('0x50'),_0x556ba3[_0xbb25('0x48')][_0xbb25('0x28')]);}return db[_0xbb25('0x2b')][_0xbb25('0x49')](_0x556ba3[_0xbb25('0x48')],{'transaction':_0x3ed96a})[_0xbb25('0x23')](function(_0x29cc94){if(_0x556ba3[_0xbb25('0x48')][_0xbb25('0x4c')]==='files'){fs['mkdirSync'](_0x29cc94[_0xbb25('0x4d')],parseInt('0777',0x8));}var _0x2cef2d=_0x556ba3[_0xbb25('0x51')][_0xbb25('0x25')]({'plain':!![]});if(!_0x2cef2d)throw new Error(_0xbb25('0x52'));if(_0x2cef2d[_0xbb25('0x53')]===_0xbb25('0x51')){var _0x224be1=_0x29cc94[_0xbb25('0x25')]({'plain':!![]});return db[_0xbb25('0x54')][_0xbb25('0x47')]({'where':{'name':_0xbb25('0x26'),'userProfileId':_0x2cef2d['userProfileId']},'raw':!![]})[_0xbb25('0x23')](function(_0x2c5333){if(_0x2c5333&&_0x2c5333[_0xbb25('0x55')]===0x0){return db[_0xbb25('0x56')][_0xbb25('0x49')]({'name':_0x224be1[_0xbb25('0x28')],'resourceId':_0x224be1['id'],'type':_0x2c5333[_0xbb25('0x28')],'sectionId':_0x2c5333['id']},{})[_0xbb25('0x23')](function(){return _0x29cc94;});}else{return _0x29cc94;}})[_0xbb25('0x44')](function(_0x18c0ab){logger['error'](_0xbb25('0x57'),_0x18c0ab);});}return _0x29cc94;});})[_0xbb25('0x23')](respondWithResult(_0x4e0967,0xc9))[_0xbb25('0x44')](handleError(_0x4e0967,null));};exports[_0xbb25('0x24')]=function(_0x230c50,_0x21f2c1,_0x964894){var _0x1e7ac2;return db['VoiceMusicOnHold'][_0xbb25('0x47')]({'where':{'id':_0x230c50['params']['id']}})['then'](function(_0x35d21b){if(_0x35d21b){return db[_0xbb25('0x4a')]['transaction'](function(_0x2c30b6){return _0x35d21b[_0xbb25('0x24')]({'transaction':_0x2c30b6,'raw':!![]})[_0xbb25('0x23')](function(_0x5cb965){if(_0x5cb965[_0xbb25('0x4d')]){fs[_0xbb25('0x58')](_0x5cb965[_0xbb25('0x4d')])['forEach'](function(_0x54c68c){fs['unlinkSync'](path[_0xbb25('0x4e')](_0x5cb965[_0xbb25('0x4d')],_0x54c68c));});fs[_0xbb25('0x59')](_0x5cb965[_0xbb25('0x4d')]);}return _0x5cb965;});})[_0xbb25('0x44')](function(_0x2c8fe4){throw new db[(_0xbb25('0x5a'))][(_0xbb25('0x5b'))](_0x2c8fe4[_0xbb25('0x5c')]);});}})[_0xbb25('0x23')](handleEntityNotFound(_0x21f2c1,null))['then'](removeEntity(_0x21f2c1,null))[_0xbb25('0x44')](handleError(_0x21f2c1,null));};exports[_0xbb25('0x5d')]=function(_0x4396ac,_0x21d0db,_0x160f3d){return db['sequelize'][_0xbb25('0x4b')](function(_0x4ea7a7){var _0x449b75;return db['VoiceMusicOnHold'][_0xbb25('0x47')]({'where':{'id':_0x4396ac['params']['id']}})['then'](function(_0x35f3e5){if(_0x35f3e5){_0x449b75=_0x35f3e5;return _0x35f3e5['addSound'](_0x4396ac[_0xbb25('0x48')]['id'],{'transaction':_0x4ea7a7});}})[_0xbb25('0x23')](function(_0x3836fc){if(_0x3836fc){return db[_0xbb25('0x5e')][_0xbb25('0x5f')]({'where':{'id':_0x4396ac[_0xbb25('0x48')]['id']},'attributes':['id',_0xbb25('0x28'),_0xbb25('0x60'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x46ae48){if(_0x46ae48){var _0x427b73=path['join'](config[_0xbb25('0x4f')],_0xbb25('0x61'),util[_0xbb25('0x62')](_0xbb25('0x63'),path['basename'](_0x46ae48[_0xbb25('0x60')],path[_0xbb25('0x64')](_0x46ae48[_0xbb25('0x60')])),_0x46ae48[_0xbb25('0x65')]));var _0x407fd5=path[_0xbb25('0x4e')](config[_0xbb25('0x4f')],_0xbb25('0x50'),_0x449b75['name'],util[_0xbb25('0x62')](_0xbb25('0x63'),_0x46ae48[_0xbb25('0x28')],_0x46ae48[_0xbb25('0x65')]));fs[_0xbb25('0x66')](_0x427b73,_0x407fd5);return _0x46ae48;}})[_0xbb25('0x44')](function(_0x28079b){throw new db[(_0xbb25('0x5a'))][(_0xbb25('0x5b'))](_0x28079b['message']);});})[_0xbb25('0x23')](handleEntityNotFound(_0x21d0db,null))[_0xbb25('0x23')](respondWithResult(_0x21d0db,0xc9))[_0xbb25('0x44')](handleError(_0x21d0db,null));};exports[_0xbb25('0x67')]=function(_0x11ac2c,_0x4ea7c9,_0x59e2cd){return db['sequelize'][_0xbb25('0x4b')](function(_0x5b4755){var _0x842fe6;return db[_0xbb25('0x2b')][_0xbb25('0x5f')]({'where':{'id':_0x11ac2c[_0xbb25('0x46')]['id']}})[_0xbb25('0x23')](handleEntityNotFound(_0x4ea7c9,null))[_0xbb25('0x23')](function(_0x32b22b){if(_0x32b22b){_0x842fe6=_0x32b22b;return _0x32b22b['removeSound'](_0x11ac2c[_0xbb25('0x46')][_0xbb25('0x68')]);}})[_0xbb25('0x23')](function(_0x421ee2){if(_0x421ee2){return db[_0xbb25('0x5e')]['findOne']({'where':{'id':_0x11ac2c[_0xbb25('0x46')]['id2']},'attributes':['id',_0xbb25('0x28'),_0xbb25('0x60'),'converted_format',_0xbb25('0x69')],'raw':!![]});}})[_0xbb25('0x23')](function(_0x5cd486){if(_0x5cd486){fs[_0xbb25('0x6a')](path[_0xbb25('0x4e')](_0x842fe6[_0xbb25('0x4d')],util[_0xbb25('0x62')](_0xbb25('0x63'),_0x5cd486[_0xbb25('0x28')],_0x5cd486[_0xbb25('0x65')])));return _0x5cd486;}})[_0xbb25('0x44')](function(_0x45efed){throw new db['Sequelize'][(_0xbb25('0x5b'))](_0x45efed[_0xbb25('0x5c')]);});})[_0xbb25('0x23')](handleEntityNotFound(_0x4ea7c9,null))['then'](respondWithStatusCode(_0x4ea7c9,0xcc))[_0xbb25('0x44')](handleError(_0x4ea7c9,null));};exports['getSounds']=function(_0x369840,_0x5ab7a8,_0x39f02e){var _0x144b6a={};var _0x42dd04={};var _0x1d4c06;var _0xa55f95;return db['VoiceMusicOnHold'][_0xbb25('0x5f')]({'where':{'id':_0x369840[_0xbb25('0x46')]['id']}})[_0xbb25('0x23')](handleEntityNotFound(_0x5ab7a8,null))[_0xbb25('0x23')](function(_0x265614){if(_0x265614){_0x1d4c06=_0x265614;_0x42dd04[_0xbb25('0x2d')]=_[_0xbb25('0x2e')](db[_0xbb25('0x5e')][_0xbb25('0x2c')]);_0x42dd04[_0xbb25('0x2f')]=_[_0xbb25('0x2e')](_0x369840[_0xbb25('0x2f')]);_0x42dd04[_0xbb25('0x39')]=_[_0xbb25('0x30')](_0x42dd04[_0xbb25('0x2d')],_0x42dd04[_0xbb25('0x2f')]);_0x144b6a[_0xbb25('0x32')]=_[_0xbb25('0x30')](_0x42dd04[_0xbb25('0x2d')],qs['fields'](_0x369840['query']['fields']));_0x144b6a[_0xbb25('0x32')]=_0x144b6a[_0xbb25('0x32')]['length']?_0x144b6a[_0xbb25('0x32')]:_0x42dd04[_0xbb25('0x2d')];_0x144b6a[_0xbb25('0x6b')]=qs[_0xbb25('0x36')](_0x369840[_0xbb25('0x2f')]['sort']);_0x144b6a[_0xbb25('0x37')]=qs[_0xbb25('0x39')](_[_0xbb25('0x38')](_0x369840['query'],_0x42dd04['filters']));if(_0x369840[_0xbb25('0x2f')][_0xbb25('0x3a')]){_0x144b6a[_0xbb25('0x37')]=_['merge'](_0x144b6a[_0xbb25('0x37')],{'$or':_[_0xbb25('0x3c')](_0x144b6a[_0xbb25('0x32')],function(_0x384ff9){var _0x3bb626={};_0x3bb626[_0x384ff9]={'$like':'%'+_0x369840[_0xbb25('0x2f')][_0xbb25('0x3a')]+'%'};return _0x3bb626;})});}_0x144b6a=_['merge']({},_0x144b6a,_0x369840[_0xbb25('0x40')]);return _0x1d4c06['getSounds'](_0x144b6a);}})[_0xbb25('0x23')](function(_0x38d9c1){if(_0x38d9c1){_0xa55f95=_0x38d9c1[_0xbb25('0x33')];if(!_0x369840[_0xbb25('0x2f')][_0xbb25('0x34')](_0xbb25('0x35'))){_0x144b6a['limit']=qs[_0xbb25('0x1b')](_0x369840[_0xbb25('0x2f')][_0xbb25('0x1b')]);_0x144b6a[_0xbb25('0x1a')]=qs['offset'](_0x369840['query'][_0xbb25('0x1a')]);}return _0x1d4c06[_0xbb25('0x6c')](_0x144b6a);}})[_0xbb25('0x23')](function(_0x2d4af2){if(_0x2d4af2){return _0x2d4af2?{'count':_0xa55f95,'rows':_0x2d4af2}:null;}})[_0xbb25('0x23')](respondWithResult(_0x5ab7a8,null))[_0xbb25('0x44')](handleError(_0x5ab7a8,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 81aac19..afab309 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 _0xef03=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3e4d00,_0x3d537a){var _0x381753=function(_0x2b25f5){while(--_0x2b25f5){_0x3e4d00['push'](_0x3e4d00['shift']());}};_0x381753(++_0x3d537a);}(_0xef03,0x122));var _0x3ef0=function(_0x1631f4,_0x4c72ba){_0x1631f4=_0x1631f4-0x0;var _0x4fc9b8=_0xef03[_0x1631f4];return _0x4fc9b8;};'use strict';var _=require(_0x3ef0('0x0'));var util=require(_0x3ef0('0x1'));var logger=require(_0x3ef0('0x2'))(_0x3ef0('0x3'));var moment=require(_0x3ef0('0x4'));var BPromise=require(_0x3ef0('0x5'));var rp=require(_0x3ef0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ef0('0x7'));var config=require(_0x3ef0('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x3ef0('0x9')]=function(_0x1f5b1e,_0x38fa1f){return _0x1f5b1e[_0x3ef0('0xa')](_0x3ef0('0xb'),attributes,{'tableName':_0x3ef0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aa3=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash'];(function(_0x51f88b,_0x570976){var _0x42e22d=function(_0x638849){while(--_0x638849){_0x51f88b['push'](_0x51f88b['shift']());}};_0x42e22d(++_0x570976);}(_0x0aa3,0x1a3));var _0x30aa=function(_0x11f8de,_0x514221){_0x11f8de=_0x11f8de-0x0;var _0x5360c1=_0x0aa3[_0x11f8de];return _0x5360c1;};'use strict';var _=require(_0x30aa('0x0'));var util=require(_0x30aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x30aa('0x2'));var BPromise=require(_0x30aa('0x3'));var rp=require(_0x30aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30aa('0x5'));var config=require(_0x30aa('0x6'));var attributes=require(_0x30aa('0x7'));module[_0x30aa('0x8')]=function(_0x13cf3e,_0x4f0c14){return _0x13cf3e['define'](_0x30aa('0x9'),attributes,{'tableName':'voice_musiconhold','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 62688b8..471ba49 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 _0xf39b=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x465aa9,_0x1bf1c8){var _0x4104e4=function(_0x388bb8){while(--_0x388bb8){_0x465aa9['push'](_0x465aa9['shift']());}};_0x4104e4(++_0x1bf1c8);}(_0xf39b,0x100));var _0xbf39=function(_0x578c63,_0x54cf1f){_0x578c63=_0x578c63-0x0;var _0x4f2bd4=_0xf39b[_0x578c63];return _0x4f2bd4;};'use strict';var _=require(_0xbf39('0x0'));var util=require(_0xbf39('0x1'));var moment=require(_0xbf39('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf39('0x3'));var fs=require('fs');var Redis=require(_0xbf39('0x4'));var db=require(_0xbf39('0x5'))['db'];var utils=require(_0xbf39('0x6'));var logger=require(_0xbf39('0x7'))(_0xbf39('0x8'));var config=require('../../config/environment');var jayson=require(_0xbf39('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18da47,_0x4892d0,_0x393698){return new BPromise(function(_0x52ff67,_0x5ed211){return client[_0xbf39('0xa')](_0x18da47,_0x393698)[_0xbf39('0xb')](function(_0x35dde7){logger[_0xbf39('0xc')](_0xbf39('0xd'),_0x4892d0,_0xbf39('0xe'));logger[_0xbf39('0xf')](_0xbf39('0x10'),_0x4892d0,_0xbf39('0xe'),JSON['stringify'](_0x35dde7));if(_0x35dde7[_0xbf39('0x11')]){if(_0x35dde7[_0xbf39('0x11')][_0xbf39('0x12')]===0x1f4){logger[_0xbf39('0x11')](_0xbf39('0xd'),_0x4892d0,_0x35dde7['error'][_0xbf39('0x13')]);return _0x5ed211(_0x35dde7[_0xbf39('0x11')][_0xbf39('0x13')]);}logger[_0xbf39('0x11')](_0xbf39('0xd'),_0x4892d0,_0x35dde7[_0xbf39('0x11')][_0xbf39('0x13')]);return _0x52ff67(_0x35dde7[_0xbf39('0x11')][_0xbf39('0x13')]);}else{logger[_0xbf39('0xc')](_0xbf39('0xd'),_0x4892d0,_0xbf39('0xe'));_0x52ff67(_0x35dde7[_0xbf39('0x14')][_0xbf39('0x13')]);}})['catch'](function(_0x5aa9cc){logger[_0xbf39('0x11')](_0xbf39('0xd'),_0x4892d0,_0x5aa9cc);_0x5ed211(_0x5aa9cc);});});} \ No newline at end of file +var _0x8ae8=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x20706c,_0xcf9921){var _0x3b1f9f=function(_0x28afda){while(--_0x28afda){_0x20706c['push'](_0x20706c['shift']());}};_0x3b1f9f(++_0xcf9921);}(_0x8ae8,0x163));var _0x88ae=function(_0x3619d9,_0x31b2f9){_0x3619d9=_0x3619d9-0x0;var _0x209b1e=_0x8ae8[_0x3619d9];return _0x209b1e;};'use strict';var _=require(_0x88ae('0x0'));var util=require('util');var moment=require(_0x88ae('0x1'));var BPromise=require(_0x88ae('0x2'));var rs=require(_0x88ae('0x3'));var fs=require('fs');var Redis=require(_0x88ae('0x4'));var db=require(_0x88ae('0x5'))['db'];var utils=require(_0x88ae('0x6'));var logger=require(_0x88ae('0x7'))(_0x88ae('0x8'));var config=require('../../config/environment');var jayson=require(_0x88ae('0x9'));var client=jayson[_0x88ae('0xa')][_0x88ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x423ebc,_0x3ea3af,_0x5064cd){return new BPromise(function(_0x2c220f,_0x15325b){return client[_0x88ae('0xc')](_0x423ebc,_0x5064cd)['then'](function(_0x4b4d76){logger[_0x88ae('0xd')](_0x88ae('0xe'),_0x3ea3af,_0x88ae('0xf'));logger[_0x88ae('0x10')](_0x88ae('0x11'),_0x3ea3af,_0x88ae('0xf'),JSON[_0x88ae('0x12')](_0x4b4d76));if(_0x4b4d76['error']){if(_0x4b4d76[_0x88ae('0x13')][_0x88ae('0x14')]===0x1f4){logger[_0x88ae('0x13')](_0x88ae('0xe'),_0x3ea3af,_0x4b4d76[_0x88ae('0x13')][_0x88ae('0x15')]);return _0x15325b(_0x4b4d76[_0x88ae('0x13')]['message']);}logger['error'](_0x88ae('0xe'),_0x3ea3af,_0x4b4d76['error']['message']);return _0x2c220f(_0x4b4d76[_0x88ae('0x13')][_0x88ae('0x15')]);}else{logger[_0x88ae('0xd')](_0x88ae('0xe'),_0x3ea3af,_0x88ae('0xf'));_0x2c220f(_0x4b4d76[_0x88ae('0x16')]['message']);}})[_0x88ae('0x17')](function(_0x2d9ca1){logger[_0x88ae('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3ea3af,_0x2d9ca1);_0x15325b(_0x2d9ca1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e9135b9..9df4740 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 _0x3b59=['addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','post','create'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x3b59,0x9c));var _0x93b5=function(_0x586890,_0x57399f){_0x586890=_0x586890-0x0;var _0x3bbc16=_0x3b59[_0x586890];return _0x3bbc16;};'use strict';var multer=require(_0x93b5('0x0'));var util=require(_0x93b5('0x1'));var path=require(_0x93b5('0x2'));var timeout=require(_0x93b5('0x3'));var express=require(_0x93b5('0x4'));var router=express[_0x93b5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x93b5('0x6'));var config=require('../../config/environment');var controller=require(_0x93b5('0x7'));router[_0x93b5('0x8')]('/',auth[_0x93b5('0x9')](),controller[_0x93b5('0xa')]);router['get'](_0x93b5('0xb'),auth[_0x93b5('0x9')](),controller[_0x93b5('0xc')]);router['get'](_0x93b5('0xd'),auth[_0x93b5('0x9')](),controller[_0x93b5('0xe')]);router[_0x93b5('0x8')](_0x93b5('0xf'),auth['isAuthenticated'](),controller[_0x93b5('0x10')]);router[_0x93b5('0x11')]('/',auth[_0x93b5('0x9')](),controller[_0x93b5('0x12')]);router[_0x93b5('0x11')]('/:id/users',auth[_0x93b5('0x9')](),controller[_0x93b5('0x13')]);router['put'](_0x93b5('0xd'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x14')]);router[_0x93b5('0x15')](_0x93b5('0xd'),auth['isAuthenticated'](),controller[_0x93b5('0x16')]);router[_0x93b5('0x15')]('/:id/users',auth[_0x93b5('0x9')](),controller[_0x93b5('0x17')]);module[_0x93b5('0x18')]=router; \ No newline at end of file +var _0x5081=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','getAgents','post','create','put','update','destroy','delete','/:id/users','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x335da3,_0x53d933){var _0x46491a=function(_0x3fa6ee){while(--_0x3fa6ee){_0x335da3['push'](_0x335da3['shift']());}};_0x46491a(++_0x53d933);}(_0x5081,0x148));var _0x1508=function(_0x179343,_0x10a542){_0x179343=_0x179343-0x0;var _0x1294ba=_0x5081[_0x179343];return _0x1294ba;};'use strict';var multer=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));var path=require(_0x1508('0x2'));var timeout=require(_0x1508('0x3'));var express=require(_0x1508('0x4'));var router=express[_0x1508('0x5')]();var auth=require(_0x1508('0x6'));var interaction=require(_0x1508('0x7'));var config=require(_0x1508('0x8'));var controller=require(_0x1508('0x9'));router[_0x1508('0xa')]('/',auth[_0x1508('0xb')](),controller['index']);router[_0x1508('0xa')]('/describe',auth[_0x1508('0xb')](),controller[_0x1508('0xc')]);router[_0x1508('0xa')](_0x1508('0xd'),auth[_0x1508('0xb')](),controller[_0x1508('0xe')]);router[_0x1508('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x1508('0xf')]);router[_0x1508('0x10')]('/',auth['isAuthenticated'](),controller[_0x1508('0x11')]);router[_0x1508('0x10')]('/:id/users',auth[_0x1508('0xb')](),controller['addAgents']);router[_0x1508('0x12')](_0x1508('0xd'),auth[_0x1508('0xb')](),controller[_0x1508('0x13')]);router['delete'](_0x1508('0xd'),auth[_0x1508('0xb')](),controller[_0x1508('0x14')]);router[_0x1508('0x15')](_0x1508('0x16'),auth[_0x1508('0xb')](),controller['removeAgents']);module[_0x1508('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3b6b5f1..a8d01e7 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 _0x5d76=['system-','getDataValue','exports','STRING','name'];(function(_0x14c0e0,_0x3ad847){var _0x4cbd72=function(_0x401e2e){while(--_0x401e2e){_0x14c0e0['push'](_0x14c0e0['shift']());}};_0x4cbd72(++_0x3ad847);}(_0x5d76,0x124));var _0x65d7=function(_0x25592c,_0x348da5){_0x25592c=_0x25592c-0x0;var _0x578114=_0x5d76[_0x25592c];return _0x578114;};'use strict';var Sequelize=require('sequelize');module[_0x65d7('0x0')]={'name':{'type':Sequelize[_0x65d7('0x1')],'allowNull':![],'unique':_0x65d7('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e8cde){return _0x65d7('0x3')+this[_0x65d7('0x4')](_0x65d7('0x2'))+'-';}},'description':{'type':Sequelize[_0x65d7('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2f2f=['exports','STRING','name','system-','INTEGER','sequelize'];(function(_0x4056ef,_0x45a82b){var _0xa6f94b=function(_0x572d85){while(--_0x572d85){_0x4056ef['push'](_0x4056ef['shift']());}};_0xa6f94b(++_0x45a82b);}(_0x2f2f,0x1d9));var _0xf2f2=function(_0x2ede13,_0x28ae23){_0x2ede13=_0x2ede13-0x0;var _0x264a0d=_0x2f2f[_0x2ede13];return _0x264a0d;};'use strict';var Sequelize=require(_0xf2f2('0x0'));module[_0xf2f2('0x1')]={'name':{'type':Sequelize[_0xf2f2('0x2')],'allowNull':![],'unique':_0xf2f2('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4715ed){return _0xf2f2('0x4')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf2f2('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf2f2('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4b5695a..71cc677 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 _0x6737=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','count','offset','set','json','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','key','VIRTUAL','includeAll','rows','params','include','merge','options','catch','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','callerIdAll','push','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs'];(function(_0x429c51,_0x334576){var _0x484398=function(_0x586a61){while(--_0x586a61){_0x429c51['push'](_0x429c51['shift']());}};_0x484398(++_0x334576);}(_0x6737,0xe2));var _0x7673=function(_0x412f6c,_0x35d61b){_0x412f6c=_0x412f6c-0x0;var _0xf48fae=_0x6737[_0x412f6c];return _0xf48fae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7673('0x0'));var rimraf=require(_0x7673('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7673('0x2'));var rp=require(_0x7673('0x3'));var moment=require(_0x7673('0x4'));var BPromise=require(_0x7673('0x5'));var Mustache=require('mustache');var util=require(_0x7673('0x6'));var path=require(_0x7673('0x7'));var sox=require('sox');var csv=require(_0x7673('0x8'));var ejs=require(_0x7673('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7673('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7673('0xb'));var Papa=require(_0x7673('0xc'));var Redis=require('ioredis');var authService=require(_0x7673('0xd'));var qs=require(_0x7673('0xe'));var hardwareService=require(_0x7673('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x7673('0x10'));var config=require('../../config/environment');var db=require(_0x7673('0x11'))['db'];config[_0x7673('0x12')]=_[_0x7673('0x13')](config[_0x7673('0x12')],{'host':_0x7673('0x14'),'port':0x18eb});var socket=require(_0x7673('0x15'))(new Redis(config[_0x7673('0x12')]));require(_0x7673('0x16'))[_0x7673('0x17')](socket);function respondWithStatusCode(_0x20a649,_0x5c8626){_0x5c8626=_0x5c8626||0xcc;return function(_0x26f0c4){if(_0x26f0c4){return _0x20a649[_0x7673('0x18')](_0x5c8626);}return _0x20a649[_0x7673('0x19')](_0x5c8626)[_0x7673('0x1a')]();};}function respondWithResult(_0x224cea,_0x2e83c4){_0x2e83c4=_0x2e83c4||0xc8;return function(_0x2a2840){if(_0x2a2840){return _0x224cea['status'](_0x2e83c4)['json'](_0x2a2840);}};}function respondWithFilteredResult(_0x164d05,_0x3b0e20){return function(_0x50f8d9){if(_0x50f8d9){var _0x3afbb3=_0x50f8d9[_0x7673('0x1b')],_0x17699a=_0x3b0e20[_0x7673('0x1c')],_0x58a821=_0x3b0e20['offset']+_0x3b0e20['limit'],_0x33ff7d;if(_0x58a821>=_0x3afbb3){_0x58a821=_0x3afbb3;_0x33ff7d=0xc8;}else{_0x33ff7d=0xce;}_0x164d05[_0x7673('0x19')](_0x33ff7d);return _0x164d05[_0x7673('0x1d')]('Content-Range',_0x17699a+'-'+_0x58a821+'/'+_0x3afbb3)[_0x7673('0x1e')](_0x50f8d9);}return null;};}function patchUpdates(_0x29bbd9){return function(_0x2e1260){try{jsonpatch[_0x7673('0x1f')](_0x2e1260,_0x29bbd9,!![]);}catch(_0x4245bf){return BPromise[_0x7673('0x20')](_0x4245bf);}return _0x2e1260['save']();};}function saveUpdates(_0x557161,_0xea9b37){return function(_0x21774f){if(_0x21774f){return _0x21774f[_0x7673('0x21')](_0x557161)[_0x7673('0x22')](function(_0x16bb16){return _0x16bb16;});}return null;};}function removeEntity(_0x54f38d,_0x2009e1){return function(_0x3b2a75){if(_0x3b2a75){return _0x3b2a75[_0x7673('0x23')]()[_0x7673('0x22')](function(){var _0x132dc6=_0x3b2a75[_0x7673('0x24')]({'plain':!![]});var _0x538280=_0x7673('0x25');return db[_0x7673('0x26')][_0x7673('0x23')]({'where':{'type':_0x538280,'resourceId':_0x132dc6['id']}})[_0x7673('0x22')](function(){return _0x3b2a75;});})['then'](function(){_0x54f38d['status'](0xcc)[_0x7673('0x1a')]();});}};}function handleEntityNotFound(_0x11b42b,_0x291d10){return function(_0x9d9eab){if(!_0x9d9eab){_0x11b42b[_0x7673('0x18')](0x194);}return _0x9d9eab;};}function handleError(_0x45a045,_0x442f42){_0x442f42=_0x442f42||0x1f4;return function(_0x5a59f9){logger['error'](_0x5a59f9[_0x7673('0x27')]);if(_0x5a59f9[_0x7673('0x28')]){delete _0x5a59f9[_0x7673('0x28')];}_0x45a045[_0x7673('0x19')](_0x442f42)[_0x7673('0x29')](_0x5a59f9);};}exports[_0x7673('0x2a')]=function(_0x224122,_0x4f12b9){var _0x4fcacc={},_0xe7e528={},_0x36c841={'count':0x0,'rows':[]};var _0x268863=db[_0x7673('0x2b')]['rawAttributes'];_0xe7e528[_0x7673('0x2c')]=_['keys'](_0x268863);_0xe7e528[_0x7673('0x2d')]=_[_0x7673('0x2e')](_0x224122[_0x7673('0x2d')]);_0xe7e528[_0x7673('0x2f')]=_[_0x7673('0x30')](_0xe7e528[_0x7673('0x2c')],_0xe7e528[_0x7673('0x2d')]);_0x4fcacc[_0x7673('0x31')]=_[_0x7673('0x30')](_0xe7e528[_0x7673('0x2c')],qs[_0x7673('0x32')](_0x224122[_0x7673('0x2d')][_0x7673('0x32')]));_0x4fcacc['attributes']=_0x4fcacc[_0x7673('0x31')][_0x7673('0x33')]?_0x4fcacc[_0x7673('0x31')]:_0xe7e528[_0x7673('0x2c')];if(!_0x224122[_0x7673('0x2d')][_0x7673('0x34')](_0x7673('0x35'))){_0x4fcacc['limit']=qs['limit'](_0x224122[_0x7673('0x2d')][_0x7673('0x36')]);_0x4fcacc[_0x7673('0x1c')]=qs[_0x7673('0x1c')](_0x224122[_0x7673('0x2d')][_0x7673('0x1c')]);}_0x4fcacc[_0x7673('0x37')]=qs['sort'](_0x224122[_0x7673('0x2d')][_0x7673('0x38')]);_0x4fcacc['where']=qs[_0x7673('0x2f')](_[_0x7673('0x39')](_0x224122[_0x7673('0x2d')],_0xe7e528[_0x7673('0x2f')]));if(_0x224122['query'][_0x7673('0x3a')]){_0x4fcacc[_0x7673('0x3b')]=_['merge'](_0x4fcacc[_0x7673('0x3b')],{'$or':_[_0x7673('0x3c')](_0x268863,function(_0x1be04a){if(_0x1be04a['type'][_0x7673('0x3d')]!==_0x7673('0x3e')){var _0x1c29b2={};_0x1c29b2[_0x1be04a['field']]={'$like':'%'+_0x224122['query'][_0x7673('0x3a')]+'%'};return _0x1c29b2;}})});}_0x4fcacc=_['merge']({},_0x4fcacc,_0x224122['options']);var _0x295f9f={'where':_0x4fcacc[_0x7673('0x3b')]};return db['VoicePrefix'][_0x7673('0x1b')](_0x295f9f)[_0x7673('0x22')](function(_0x2645a2){_0x36c841[_0x7673('0x1b')]=_0x2645a2;if(_0x224122[_0x7673('0x2d')][_0x7673('0x3f')]){_0x4fcacc['include']=[{'all':!![]}];}return db[_0x7673('0x2b')]['findAll'](_0x4fcacc);})[_0x7673('0x22')](function(_0x52f803){_0x36c841[_0x7673('0x40')]=_0x52f803;return _0x36c841;})[_0x7673('0x22')](respondWithFilteredResult(_0x4f12b9,_0x4fcacc))['catch'](handleError(_0x4f12b9,null));};exports['show']=function(_0x1cac93,_0x503412){var _0x23dca4={'raw':![],'where':{'id':_0x1cac93[_0x7673('0x41')]['id']}},_0x1531ab={};_0x1531ab[_0x7673('0x2c')]=_[_0x7673('0x2e')](db['VoicePrefix']['rawAttributes']);_0x1531ab[_0x7673('0x2d')]=_[_0x7673('0x2e')](_0x1cac93['query']);_0x1531ab[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x1531ab[_0x7673('0x2c')],_0x1531ab['query']);_0x23dca4[_0x7673('0x31')]=_[_0x7673('0x30')](_0x1531ab[_0x7673('0x2c')],qs[_0x7673('0x32')](_0x1cac93[_0x7673('0x2d')][_0x7673('0x32')]));_0x23dca4[_0x7673('0x31')]=_0x23dca4[_0x7673('0x31')][_0x7673('0x33')]?_0x23dca4['attributes']:_0x1531ab[_0x7673('0x2c')];if(_0x1cac93[_0x7673('0x2d')][_0x7673('0x3f')]){_0x23dca4[_0x7673('0x42')]=[{'all':!![]}];}_0x23dca4=_[_0x7673('0x43')]({},_0x23dca4,_0x1cac93[_0x7673('0x44')]);return db[_0x7673('0x2b')]['find'](_0x23dca4)[_0x7673('0x22')](handleEntityNotFound(_0x503412,null))[_0x7673('0x22')](respondWithResult(_0x503412,null))[_0x7673('0x45')](handleError(_0x503412,null));};exports[_0x7673('0x23')]=function(_0x46718a,_0x4b844d){return db[_0x7673('0x2b')][_0x7673('0x46')]({'where':{'id':_0x46718a[_0x7673('0x41')]['id']}})[_0x7673('0x22')](handleEntityNotFound(_0x4b844d,null))[_0x7673('0x22')](removeEntity(_0x4b844d,null))['catch'](handleError(_0x4b844d,null));};exports['describe']=function(_0x3d4440,_0x3e533b){return db['VoicePrefix'][_0x7673('0x47')]()[_0x7673('0x22')](respondWithResult(_0x3e533b,null))[_0x7673('0x45')](handleError(_0x3e533b,null));};exports[_0x7673('0x48')]=function(_0x94e6c1,_0x5494b9){var _0x23789d;return db[_0x7673('0x49')][_0x7673('0x4a')](function(_0x3e802d){return db['VoicePrefix'][_0x7673('0x48')](_0x94e6c1[_0x7673('0x4b')],{'transaction':_0x3e802d})[_0x7673('0x22')](function(_0xa93124){_0x23789d=_0xa93124[_0x7673('0x24')]({'plain':!![]});return db[_0x7673('0x4c')][_0x7673('0x46')]({'where':{'id':_0x23789d[_0x7673('0x4d')]},'raw':!![]})[_0x7673('0x22')](function(_0x362409){return createVoicePrefixExtensions(_0x23789d,_0x362409,_0x3e802d);});});})[_0x7673('0x22')](function(){var _0x572119=_0x94e6c1[_0x7673('0x4e')]['get']({'plain':!![]});if(!_0x572119)throw new Error(_0x7673('0x4f'));if(_0x572119[_0x7673('0x50')]===_0x7673('0x4e')){var _0x523698=_0x23789d;return db[_0x7673('0x51')][_0x7673('0x46')]({'where':{'name':_0x7673('0x25'),'userProfileId':_0x572119[_0x7673('0x52')]},'raw':!![]})[_0x7673('0x22')](function(_0x703a93){if(_0x703a93&&_0x703a93[_0x7673('0x53')]===0x0){return db[_0x7673('0x26')][_0x7673('0x48')]({'name':_0x523698[_0x7673('0x28')],'resourceId':_0x523698['id'],'type':_0x703a93[_0x7673('0x28')],'sectionId':_0x703a93['id']},{})[_0x7673('0x22')](function(){return _0x23789d;});}else{return _0x23789d;}})[_0x7673('0x45')](function(_0xb3c9e9){logger['error'](_0x7673('0x54'),_0xb3c9e9);throw _0xb3c9e9;});}return _0x23789d;})['then'](respondWithResult(_0x5494b9,null))[_0x7673('0x45')](handleError(_0x5494b9,null));};function Extension(_0x268ed3,_0x1d424a,_0x51c3ae,_0x6b8332){this['context']='from-sip';this[_0x7673('0x55')]=_0x268ed3;this['app']=_0x51c3ae;this['type']=_0x7673('0x56');this[_0x7673('0x57')]=_0x7673('0x58');this[_0x7673('0x59')]=_0x1d424a;this[_0x7673('0x5a')]=_0x6b8332;}function createVoicePrefixExtensions(_0x2fc43d,_0x151276,_0xb72b1c){return new BPromise(function(_0x1090e5,_0x3ce541){var _0x3a4ff0=new Extension(formatPrefixName(_0x2fc43d['prefix']),0x1,'NoOp',_0x7673('0x5b'));_0x3a4ff0[_0x7673('0x5c')]=_0x2fc43d['id'];return db[_0x7673('0x4c')][_0x7673('0x48')](_0x3a4ff0,{'transaction':_0xb72b1c})[_0x7673('0x22')](function(_0x48e51c){var _0x5caca9=_0x48e51c[_0x7673('0x24')]({'plain':!![]});var _0x7ac2d=_[_0x7673('0x3c')](addVoicePrefixExtensions(_0x2fc43d,_0x151276),function(_0x2f12ef){_0x2f12ef[_0x7673('0x4d')]=_0x5caca9['id'];_0x2f12ef['VoicePrefixId']=_0x2fc43d['id'];return _0x2f12ef;});return db[_0x7673('0x4c')][_0x7673('0x5d')](_0x7ac2d,{'transaction':_0xb72b1c})[_0x7673('0x22')](function(_0x5d121e){if(!_0x5d121e){return _0x3ce541(_0x7673('0x5e'));}else{return _0x1090e5(_0x5d121e);}})['catch'](function(_0x1240f9){return _0x3ce541(_0x1240f9);});});;});};function addVoicePrefixExtensions(_0x44c4d9,_0x31be3a){var _0x5d3a9d=[];var _0x278612=formatPrefixName(_0x44c4d9[_0x7673('0x5f')]);_0x5d3a9d['push'](new Extension(_0x278612,0x2,'Set','CDR(prefix)='+_0x44c4d9[_0x7673('0x28')]));if(_0x44c4d9[_0x7673('0x60')]){_0x5d3a9d[_0x7673('0x61')](new Extension(_0x278612,0x3,_0x7673('0x62'),'PREFIX-CALLERIDALL='+_0x44c4d9[_0x7673('0x60')]));}else{_0x5d3a9d['push'](new Extension(_0x278612,0x3,_0x7673('0x63'),_0x7673('0x64')));}_0x5d3a9d[_0x7673('0x61')](new Extension(_0x278612,0x4,_0x7673('0x65'),_0x31be3a['context']+','+_0x7673('0x66')+(0x8+_0x44c4d9[_0x7673('0x28')][_0x7673('0x33')])+'}'+','+0x1));return _0x5d3a9d;}function formatPrefixName(_0x5671c7){var _0x5115c0='_';for(var _0x2d21f2=0x0;_0x2d21f2<_0x5671c7[_0x7673('0x33')];_0x2d21f2++){if(_0x5671c7[_0x7673('0x67')](_0x2d21f2)=='-'){_0x5115c0+=_0x5671c7[_0x7673('0x67')](_0x2d21f2);}else{_0x5115c0+='['+_0x5671c7[_0x7673('0x67')](_0x2d21f2)+']';}}_0x5115c0+='.';return _0x5115c0;}exports['update']=function(_0x2a9f6d,_0x212ed5,_0x5f5cb0){var _0x5a5442=_0x2a9f6d['body'];_0x5a5442[_0x7673('0x5f')]=_0x7673('0x68')+_0x5a5442['name']+'-';return db[_0x7673('0x49')]['transaction'](function(_0x57787a){return db[_0x7673('0x2b')][_0x7673('0x21')](_0x5a5442,{'where':{'id':_0x5a5442['id']},'transaction':_0x57787a})[_0x7673('0x22')](function(){return db[_0x7673('0x4c')]['destroy']({'where':{'VoicePrefixId':_0x5a5442['id']},'transaction':_0x57787a})[_0x7673('0x22')](function(){return db['VoiceExtension'][_0x7673('0x46')]({'where':{'id':_0x5a5442[_0x7673('0x4d')]},'raw':!![]})[_0x7673('0x22')](function(_0x3a12e7){return createVoicePrefixExtensions(_0x5a5442,_0x3a12e7,_0x57787a);});});});})[_0x7673('0x22')](function(){return db[_0x7673('0x2b')][_0x7673('0x69')](_0x5a5442['id']);})['then'](respondWithResult(_0x212ed5,null))['catch'](handleError(_0x212ed5,null));};exports[_0x7673('0x6a')]=function(_0x34dd4f,_0x1dbd9e,_0x3170ed){return db['VoicePrefix'][_0x7673('0x46')]({'where':{'id':_0x34dd4f[_0x7673('0x41')]['id']}})[_0x7673('0x22')](handleEntityNotFound(_0x1dbd9e,null))[_0x7673('0x22')](function(_0x65586e){if(_0x65586e){return _0x65586e['addAgents'](_0x34dd4f[_0x7673('0x4b')][_0x7673('0x6b')],_[_0x7673('0x6c')](_0x34dd4f['body'],[_0x7673('0x6b'),'id'])||{})[_0x7673('0x6d')](function(_0x15561e){for(var _0x381b1c=0x0;_0x381b1c<_0x34dd4f[_0x7673('0x4b')][_0x7673('0x6b')]['length'];_0x381b1c+=0x1){socket[_0x7673('0x6e')](_0x7673('0x6f'),{'UserId':_0x34dd4f[_0x7673('0x4b')][_0x7673('0x6b')][_0x381b1c],'VoicePrefixId':_0x34dd4f[_0x7673('0x41')]['id']});}return _0x15561e;});}})[_0x7673('0x22')](respondWithResult(_0x1dbd9e,null))['catch'](handleError(_0x1dbd9e,null));};exports[_0x7673('0x70')]=function(_0xcf5802,_0x1aea63,_0x1128c3){return db['VoicePrefix'][_0x7673('0x46')]({'where':{'id':_0xcf5802[_0x7673('0x41')]['id']}})[_0x7673('0x22')](handleEntityNotFound(_0x1aea63,null))[_0x7673('0x22')](function(_0xfed5e5){if(_0xfed5e5){return _0xfed5e5[_0x7673('0x70')](_0xcf5802[_0x7673('0x2d')][_0x7673('0x6b')])[_0x7673('0x22')](function(){if(_[_0x7673('0x71')](_0xcf5802['query']['ids'])){for(var _0x401114=0x0;_0x401114<_0xcf5802[_0x7673('0x2d')][_0x7673('0x6b')]['length'];_0x401114+=0x1){socket[_0x7673('0x6e')](_0x7673('0x72'),{'UserId':Number(_0xcf5802[_0x7673('0x2d')]['ids'][_0x401114]),'VoicePrefixId':Number(_0xcf5802[_0x7673('0x41')]['id'])});}}else{socket['emit'](_0x7673('0x72'),{'UserId':Number(_0xcf5802[_0x7673('0x2d')]['ids']),'VoicePrefixId':Number(_0xcf5802['params']['id'])});}});}})[_0x7673('0x22')](respondWithStatusCode(_0x1aea63,null))[_0x7673('0x45')](handleError(_0x1aea63,null));};exports['getAgents']=function(_0x4af7ba,_0x384aac,_0x595493){var _0x2ddb04={};var _0x15635a={};var _0x2eb13a;var _0x3841c3;return db[_0x7673('0x2b')][_0x7673('0x73')]({'where':{'id':_0x4af7ba[_0x7673('0x41')]['id']}})[_0x7673('0x22')](handleEntityNotFound(_0x384aac,null))[_0x7673('0x22')](function(_0x506fdf){if(_0x506fdf){_0x2eb13a=_0x506fdf;_0x15635a[_0x7673('0x2c')]=_[_0x7673('0x2e')](db[_0x7673('0x74')]['rawAttributes']);_0x15635a[_0x7673('0x2d')]=_[_0x7673('0x2e')](_0x4af7ba[_0x7673('0x2d')]);_0x15635a[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x15635a[_0x7673('0x2c')],_0x15635a[_0x7673('0x2d')]);_0x2ddb04['attributes']=_[_0x7673('0x30')](_0x15635a['model'],qs[_0x7673('0x32')](_0x4af7ba[_0x7673('0x2d')][_0x7673('0x32')]));_0x2ddb04[_0x7673('0x31')]=_0x2ddb04['attributes'][_0x7673('0x33')]?_0x2ddb04[_0x7673('0x31')]:_0x15635a[_0x7673('0x2c')];_0x2ddb04['order']=qs[_0x7673('0x38')](_0x4af7ba[_0x7673('0x2d')][_0x7673('0x38')]);_0x2ddb04[_0x7673('0x3b')]=qs['filters'](_[_0x7673('0x39')](_0x4af7ba[_0x7673('0x2d')],_0x15635a['filters']));if(_0x4af7ba[_0x7673('0x2d')][_0x7673('0x3a')]){_0x2ddb04['where']=_[_0x7673('0x43')](_0x2ddb04['where'],{'$or':_[_0x7673('0x3c')](_0x2ddb04['attributes'],function(_0x390668){var _0x381337={};_0x381337[_0x390668]={'$like':'%'+_0x4af7ba[_0x7673('0x2d')][_0x7673('0x3a')]+'%'};return _0x381337;})});}_0x2ddb04=_[_0x7673('0x43')]({},_0x2ddb04,_0x4af7ba[_0x7673('0x44')]);return _0x2eb13a[_0x7673('0x75')](_0x2ddb04);}})[_0x7673('0x22')](function(_0x5a38c0){if(_0x5a38c0){_0x3841c3=_0x5a38c0['length'];if(!_0x4af7ba[_0x7673('0x2d')][_0x7673('0x34')](_0x7673('0x35'))){_0x2ddb04[_0x7673('0x36')]=qs['limit'](_0x4af7ba[_0x7673('0x2d')][_0x7673('0x36')]);_0x2ddb04[_0x7673('0x1c')]=qs[_0x7673('0x1c')](_0x4af7ba[_0x7673('0x2d')][_0x7673('0x1c')]);}return _0x2eb13a['getAgents'](_0x2ddb04);}})[_0x7673('0x22')](function(_0x5502ba){if(_0x5502ba){return _0x5502ba?{'count':_0x3841c3,'rows':_0x5502ba}:null;}})[_0x7673('0x22')](respondWithResult(_0x384aac,null))[_0x7673('0x45')](handleError(_0x384aac,null));}; \ No newline at end of file +var _0x277c=['to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','VoicePrefix','includeAll','include','catch','params','options','find','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','type','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x277c,0x153));var _0xc277=function(_0x287178,_0x5601fb){_0x287178=_0x287178-0x0;var _0x2fef65=_0x277c[_0x287178];return _0x2fef65;};'use strict';var pdf=require(_0xc277('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc277('0x1'));var zipdir=require(_0xc277('0x2'));var jsonpatch=require(_0xc277('0x3'));var rp=require(_0xc277('0x4'));var moment=require(_0xc277('0x5'));var BPromise=require(_0xc277('0x6'));var Mustache=require(_0xc277('0x7'));var util=require(_0xc277('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc277('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0x9'));var querystring=require(_0xc277('0xd'));var Papa=require(_0xc277('0xe'));var Redis=require(_0xc277('0xf'));var authService=require(_0xc277('0x10'));var qs=require(_0xc277('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc277('0x12'));var utils=require(_0xc277('0x13'));var config=require(_0xc277('0x14'));var db=require(_0xc277('0x15'))['db'];config['redis']=_[_0xc277('0x16')](config['redis'],{'host':_0xc277('0x17'),'port':0x18eb});var socket=require(_0xc277('0x18'))(new Redis(config[_0xc277('0x19')]));require(_0xc277('0x1a'))['register'](socket);function respondWithStatusCode(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xcc;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['sendStatus'](_0x182d35);}return _0x222bc8['status'](_0x182d35)[_0xc277('0x1b')]();};}function respondWithResult(_0x5c212c,_0x46d20c){_0x46d20c=_0x46d20c||0xc8;return function(_0x5d73f8){if(_0x5d73f8){return _0x5c212c[_0xc277('0x1c')](_0x46d20c)[_0xc277('0x1d')](_0x5d73f8);}};}function respondWithFilteredResult(_0x15f560,_0x4f522e){return function(_0x5cdb4b){if(_0x5cdb4b){var _0x44e243=_0x5cdb4b[_0xc277('0x1e')],_0x4d23a7=_0x4f522e[_0xc277('0x1f')],_0x4d8351=_0x4f522e[_0xc277('0x1f')]+_0x4f522e[_0xc277('0x20')],_0x1e1a9b;if(_0x4d8351>=_0x44e243){_0x4d8351=_0x44e243;_0x1e1a9b=0xc8;}else{_0x1e1a9b=0xce;}_0x15f560[_0xc277('0x1c')](_0x1e1a9b);return _0x15f560[_0xc277('0x21')]('Content-Range',_0x4d23a7+'-'+_0x4d8351+'/'+_0x44e243)['json'](_0x5cdb4b);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x22')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x23')](_0x28b7b1);}return _0x28900e[_0xc277('0x24')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x25')](_0xb4685f)[_0xc277('0x26')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x27')]()['then'](function(){var _0x48124d=_0x54b2e1[_0xc277('0x28')]({'plain':!![]});var _0x57b03=_0xc277('0x29');return db[_0xc277('0x2a')][_0xc277('0x27')]({'where':{'type':_0x57b03,'resourceId':_0x48124d['id']}})[_0xc277('0x26')](function(){return _0x54b2e1;});})[_0xc277('0x26')](function(){_0x2b9936[_0xc277('0x1c')](0xcc)[_0xc277('0x1b')]();});}};}function handleEntityNotFound(_0x3e04cb,_0x40d17a){return function(_0x5e480e){if(!_0x5e480e){_0x3e04cb['sendStatus'](0x194);}return _0x5e480e;};}function handleError(_0x31b6d4,_0x4318f4){_0x4318f4=_0x4318f4||0x1f4;return function(_0x4ebb0f){logger['error'](_0x4ebb0f[_0xc277('0x2b')]);if(_0x4ebb0f[_0xc277('0x2c')]){delete _0x4ebb0f[_0xc277('0x2c')];}_0x31b6d4[_0xc277('0x1c')](_0x4318f4)[_0xc277('0x2d')](_0x4ebb0f);};}exports['index']=function(_0x43757c,_0x5edf7e){var _0x12c2f9={},_0x74ff17={},_0x4348d9={'count':0x0,'rows':[]};var _0x881e70=db['VoicePrefix'][_0xc277('0x2e')];_0x74ff17['model']=_[_0xc277('0x2f')](_0x881e70);_0x74ff17[_0xc277('0x30')]=_[_0xc277('0x2f')](_0x43757c[_0xc277('0x30')]);_0x74ff17['filters']=_[_0xc277('0x31')](_0x74ff17[_0xc277('0x32')],_0x74ff17['query']);_0x12c2f9[_0xc277('0x33')]=_['intersection'](_0x74ff17[_0xc277('0x32')],qs[_0xc277('0x34')](_0x43757c[_0xc277('0x30')][_0xc277('0x34')]));_0x12c2f9[_0xc277('0x33')]=_0x12c2f9[_0xc277('0x33')][_0xc277('0x35')]?_0x12c2f9[_0xc277('0x33')]:_0x74ff17[_0xc277('0x32')];if(!_0x43757c[_0xc277('0x30')][_0xc277('0x36')]('nolimit')){_0x12c2f9[_0xc277('0x20')]=qs[_0xc277('0x20')](_0x43757c[_0xc277('0x30')]['limit']);_0x12c2f9[_0xc277('0x1f')]=qs[_0xc277('0x1f')](_0x43757c[_0xc277('0x30')][_0xc277('0x1f')]);}_0x12c2f9[_0xc277('0x37')]=qs['sort'](_0x43757c['query'][_0xc277('0x38')]);_0x12c2f9['where']=qs[_0xc277('0x39')](_[_0xc277('0x3a')](_0x43757c[_0xc277('0x30')],_0x74ff17[_0xc277('0x39')]));if(_0x43757c[_0xc277('0x30')][_0xc277('0x3b')]){_0x12c2f9[_0xc277('0x3c')]=_[_0xc277('0x3d')](_0x12c2f9[_0xc277('0x3c')],{'$or':_[_0xc277('0x3e')](_0x881e70,function(_0x1cf3f5){if(_0x1cf3f5['type'][_0xc277('0x3f')]!==_0xc277('0x40')){var _0xc1b1b5={};_0xc1b1b5[_0x1cf3f5['field']]={'$like':'%'+_0x43757c[_0xc277('0x30')][_0xc277('0x3b')]+'%'};return _0xc1b1b5;}})});}_0x12c2f9=_['merge']({},_0x12c2f9,_0x43757c['options']);var _0x2d2e5f={'where':_0x12c2f9[_0xc277('0x3c')]};return db[_0xc277('0x41')][_0xc277('0x1e')](_0x2d2e5f)[_0xc277('0x26')](function(_0x3d1975){_0x4348d9[_0xc277('0x1e')]=_0x3d1975;if(_0x43757c['query'][_0xc277('0x42')]){_0x12c2f9[_0xc277('0x43')]=[{'all':!![]}];}return db[_0xc277('0x41')]['findAll'](_0x12c2f9);})['then'](function(_0x54bbe9){_0x4348d9['rows']=_0x54bbe9;return _0x4348d9;})['then'](respondWithFilteredResult(_0x5edf7e,_0x12c2f9))[_0xc277('0x44')](handleError(_0x5edf7e,null));};exports['show']=function(_0x46fda3,_0x102ca3){var _0x1c7da={'raw':![],'where':{'id':_0x46fda3[_0xc277('0x45')]['id']}},_0x5d41ce={};_0x5d41ce[_0xc277('0x32')]=_[_0xc277('0x2f')](db[_0xc277('0x41')]['rawAttributes']);_0x5d41ce[_0xc277('0x30')]=_[_0xc277('0x2f')](_0x46fda3['query']);_0x5d41ce[_0xc277('0x39')]=_[_0xc277('0x31')](_0x5d41ce[_0xc277('0x32')],_0x5d41ce[_0xc277('0x30')]);_0x1c7da[_0xc277('0x33')]=_[_0xc277('0x31')](_0x5d41ce[_0xc277('0x32')],qs[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')][_0xc277('0x34')]));_0x1c7da[_0xc277('0x33')]=_0x1c7da['attributes'][_0xc277('0x35')]?_0x1c7da[_0xc277('0x33')]:_0x5d41ce[_0xc277('0x32')];if(_0x46fda3[_0xc277('0x30')]['includeAll']){_0x1c7da[_0xc277('0x43')]=[{'all':!![]}];}_0x1c7da=_['merge']({},_0x1c7da,_0x46fda3[_0xc277('0x46')]);return db[_0xc277('0x41')][_0xc277('0x47')](_0x1c7da)[_0xc277('0x26')](handleEntityNotFound(_0x102ca3,null))[_0xc277('0x26')](respondWithResult(_0x102ca3,null))['catch'](handleError(_0x102ca3,null));};exports[_0xc277('0x27')]=function(_0x40868b,_0x412bae){return db[_0xc277('0x41')]['find']({'where':{'id':_0x40868b[_0xc277('0x45')]['id']}})[_0xc277('0x26')](handleEntityNotFound(_0x412bae,null))[_0xc277('0x26')](removeEntity(_0x412bae,null))['catch'](handleError(_0x412bae,null));};exports[_0xc277('0x48')]=function(_0x54190b,_0xd8f679){return db[_0xc277('0x41')][_0xc277('0x48')]()[_0xc277('0x26')](respondWithResult(_0xd8f679,null))[_0xc277('0x44')](handleError(_0xd8f679,null));};exports[_0xc277('0x49')]=function(_0xbbeb90,_0x46c133){var _0x8752f2;return db[_0xc277('0x4a')][_0xc277('0x4b')](function(_0x34788f){return db['VoicePrefix'][_0xc277('0x49')](_0xbbeb90['body'],{'transaction':_0x34788f})[_0xc277('0x26')](function(_0x3cd5a1){_0x8752f2=_0x3cd5a1[_0xc277('0x28')]({'plain':!![]});return db[_0xc277('0x4c')][_0xc277('0x47')]({'where':{'id':_0x8752f2['VoiceExtensionId']},'raw':!![]})[_0xc277('0x26')](function(_0x368fa2){return createVoicePrefixExtensions(_0x8752f2,_0x368fa2,_0x34788f);});});})['then'](function(){var _0x5efcd6=_0xbbeb90[_0xc277('0x4d')]['get']({'plain':!![]});if(!_0x5efcd6)throw new Error(_0xc277('0x4e'));if(_0x5efcd6[_0xc277('0x4f')]===_0xc277('0x4d')){var _0x3bcb7b=_0x8752f2;return db[_0xc277('0x50')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x5efcd6[_0xc277('0x51')]},'raw':!![]})[_0xc277('0x26')](function(_0x1f4171){if(_0x1f4171&&_0x1f4171['autoAssociation']===0x0){return db[_0xc277('0x2a')]['create']({'name':_0x3bcb7b[_0xc277('0x2c')],'resourceId':_0x3bcb7b['id'],'type':_0x1f4171[_0xc277('0x2c')],'sectionId':_0x1f4171['id']},{})[_0xc277('0x26')](function(){return _0x8752f2;});}else{return _0x8752f2;}})['catch'](function(_0x5f5d03){logger['error'](_0xc277('0x52'),_0x5f5d03);throw _0x5f5d03;});}return _0x8752f2;})[_0xc277('0x26')](respondWithResult(_0x46c133,null))['catch'](handleError(_0x46c133,null));};function Extension(_0x50a1b5,_0x14b47c,_0x455b3b,_0x365eae){this[_0xc277('0x53')]='from-sip';this['exten']=_0x50a1b5;this['app']=_0x455b3b;this[_0xc277('0x54')]=_0xc277('0x55');this['description']=_0xc277('0x56');this[_0xc277('0x57')]=_0x14b47c;this['appdata']=_0x365eae;}function createVoicePrefixExtensions(_0x4e71bd,_0x3cbb8b,_0x2f64ff){return new BPromise(function(_0x18146f,_0x10942d){var _0x3b4bdf=new Extension(formatPrefixName(_0x4e71bd[_0xc277('0x58')]),0x1,_0xc277('0x59'),_0xc277('0x5a'));_0x3b4bdf['VoicePrefixId']=_0x4e71bd['id'];return db[_0xc277('0x4c')]['create'](_0x3b4bdf,{'transaction':_0x2f64ff})[_0xc277('0x26')](function(_0x149b2e){var _0x5039a4=_0x149b2e['get']({'plain':!![]});var _0x3de5e8=_[_0xc277('0x3e')](addVoicePrefixExtensions(_0x4e71bd,_0x3cbb8b),function(_0x40f261){_0x40f261['VoiceExtensionId']=_0x5039a4['id'];_0x40f261['VoicePrefixId']=_0x4e71bd['id'];return _0x40f261;});return db[_0xc277('0x4c')][_0xc277('0x5b')](_0x3de5e8,{'transaction':_0x2f64ff})[_0xc277('0x26')](function(_0xcceaa){if(!_0xcceaa){return _0x10942d(_0xc277('0x5c'));}else{return _0x18146f(_0xcceaa);}})[_0xc277('0x44')](function(_0x5176af){return _0x10942d(_0x5176af);});});;});};function addVoicePrefixExtensions(_0x31593d,_0x32dd7c){var _0x3fcf92=[];var _0x4698bd=formatPrefixName(_0x31593d[_0xc277('0x58')]);_0x3fcf92[_0xc277('0x5d')](new Extension(_0x4698bd,0x2,_0xc277('0x5e'),_0xc277('0x5f')+_0x31593d[_0xc277('0x2c')]));if(_0x31593d[_0xc277('0x60')]){_0x3fcf92[_0xc277('0x5d')](new Extension(_0x4698bd,0x3,'Set',_0xc277('0x61')+_0x31593d[_0xc277('0x60')]));}else{_0x3fcf92[_0xc277('0x5d')](new Extension(_0x4698bd,0x3,_0xc277('0x59'),'No\x20callerid\x20available'));}_0x3fcf92[_0xc277('0x5d')](new Extension(_0x4698bd,0x4,_0xc277('0x62'),_0x32dd7c[_0xc277('0x53')]+','+_0xc277('0x63')+(0x8+_0x31593d[_0xc277('0x2c')][_0xc277('0x35')])+'}'+','+0x1));return _0x3fcf92;}function formatPrefixName(_0x5a6170){var _0x3e8051='_';for(var _0x5496f7=0x0;_0x5496f7<_0x5a6170[_0xc277('0x35')];_0x5496f7++){if(_0x5a6170[_0xc277('0x64')](_0x5496f7)=='-'){_0x3e8051+=_0x5a6170['charAt'](_0x5496f7);}else{_0x3e8051+='['+_0x5a6170['charAt'](_0x5496f7)+']';}}_0x3e8051+='.';return _0x3e8051;}exports[_0xc277('0x25')]=function(_0xe84116,_0x59bd50,_0xaad68d){var _0x33be4a=_0xe84116[_0xc277('0x65')];_0x33be4a[_0xc277('0x58')]=_0xc277('0x66')+_0x33be4a[_0xc277('0x2c')]+'-';return db[_0xc277('0x4a')][_0xc277('0x4b')](function(_0x34b6a3){return db[_0xc277('0x41')]['update'](_0x33be4a,{'where':{'id':_0x33be4a['id']},'transaction':_0x34b6a3})['then'](function(){return db[_0xc277('0x4c')][_0xc277('0x27')]({'where':{'VoicePrefixId':_0x33be4a['id']},'transaction':_0x34b6a3})['then'](function(){return db[_0xc277('0x4c')][_0xc277('0x47')]({'where':{'id':_0x33be4a[_0xc277('0x67')]},'raw':!![]})['then'](function(_0x2192ac){return createVoicePrefixExtensions(_0x33be4a,_0x2192ac,_0x34b6a3);});});});})[_0xc277('0x26')](function(){return db[_0xc277('0x41')][_0xc277('0x68')](_0x33be4a['id']);})['then'](respondWithResult(_0x59bd50,null))[_0xc277('0x44')](handleError(_0x59bd50,null));};exports[_0xc277('0x69')]=function(_0x1b2364,_0x51e712,_0xa446e5){return db[_0xc277('0x41')][_0xc277('0x47')]({'where':{'id':_0x1b2364[_0xc277('0x45')]['id']}})[_0xc277('0x26')](handleEntityNotFound(_0x51e712,null))['then'](function(_0x2a81e7){if(_0x2a81e7){return _0x2a81e7[_0xc277('0x69')](_0x1b2364[_0xc277('0x65')][_0xc277('0x6a')],_[_0xc277('0x6b')](_0x1b2364[_0xc277('0x65')],[_0xc277('0x6a'),'id'])||{})[_0xc277('0x6c')](function(_0x6c2e86){for(var _0x9d3918=0x0;_0x9d3918<_0x1b2364[_0xc277('0x65')][_0xc277('0x6a')][_0xc277('0x35')];_0x9d3918+=0x1){socket[_0xc277('0x6d')](_0xc277('0x6e'),{'UserId':_0x1b2364['body'][_0xc277('0x6a')][_0x9d3918],'VoicePrefixId':_0x1b2364['params']['id']});}return _0x6c2e86;});}})['then'](respondWithResult(_0x51e712,null))[_0xc277('0x44')](handleError(_0x51e712,null));};exports['removeAgents']=function(_0x329858,_0x5e2574,_0x413aea){return db['VoicePrefix'][_0xc277('0x47')]({'where':{'id':_0x329858[_0xc277('0x45')]['id']}})[_0xc277('0x26')](handleEntityNotFound(_0x5e2574,null))[_0xc277('0x26')](function(_0x40ce9b){if(_0x40ce9b){return _0x40ce9b[_0xc277('0x6f')](_0x329858[_0xc277('0x30')][_0xc277('0x6a')])[_0xc277('0x26')](function(){if(_[_0xc277('0x70')](_0x329858[_0xc277('0x30')][_0xc277('0x6a')])){for(var _0x3b5057=0x0;_0x3b5057<_0x329858['query'][_0xc277('0x6a')][_0xc277('0x35')];_0x3b5057+=0x1){socket['emit'](_0xc277('0x71'),{'UserId':Number(_0x329858[_0xc277('0x30')][_0xc277('0x6a')][_0x3b5057]),'VoicePrefixId':Number(_0x329858[_0xc277('0x45')]['id'])});}}else{socket[_0xc277('0x6d')]('userVoicePrefix:remove',{'UserId':Number(_0x329858['query'][_0xc277('0x6a')]),'VoicePrefixId':Number(_0x329858['params']['id'])});}});}})[_0xc277('0x26')](respondWithStatusCode(_0x5e2574,null))[_0xc277('0x44')](handleError(_0x5e2574,null));};exports[_0xc277('0x72')]=function(_0x5383a6,_0x80f980,_0x4098f3){var _0x4399a6={};var _0x3ebb38={};var _0x239111;var _0x593d5e;return db['VoicePrefix']['findOne']({'where':{'id':_0x5383a6['params']['id']}})[_0xc277('0x26')](handleEntityNotFound(_0x80f980,null))[_0xc277('0x26')](function(_0x412353){if(_0x412353){_0x239111=_0x412353;_0x3ebb38[_0xc277('0x32')]=_['keys'](db['User'][_0xc277('0x2e')]);_0x3ebb38[_0xc277('0x30')]=_[_0xc277('0x2f')](_0x5383a6['query']);_0x3ebb38[_0xc277('0x39')]=_[_0xc277('0x31')](_0x3ebb38[_0xc277('0x32')],_0x3ebb38['query']);_0x4399a6[_0xc277('0x33')]=_[_0xc277('0x31')](_0x3ebb38[_0xc277('0x32')],qs[_0xc277('0x34')](_0x5383a6[_0xc277('0x30')][_0xc277('0x34')]));_0x4399a6['attributes']=_0x4399a6['attributes'][_0xc277('0x35')]?_0x4399a6['attributes']:_0x3ebb38[_0xc277('0x32')];_0x4399a6[_0xc277('0x37')]=qs['sort'](_0x5383a6['query'][_0xc277('0x38')]);_0x4399a6[_0xc277('0x3c')]=qs[_0xc277('0x39')](_[_0xc277('0x3a')](_0x5383a6['query'],_0x3ebb38[_0xc277('0x39')]));if(_0x5383a6[_0xc277('0x30')]['filter']){_0x4399a6[_0xc277('0x3c')]=_[_0xc277('0x3d')](_0x4399a6[_0xc277('0x3c')],{'$or':_['map'](_0x4399a6[_0xc277('0x33')],function(_0x33fcee){var _0x4af173={};_0x4af173[_0x33fcee]={'$like':'%'+_0x5383a6[_0xc277('0x30')][_0xc277('0x3b')]+'%'};return _0x4af173;})});}_0x4399a6=_[_0xc277('0x3d')]({},_0x4399a6,_0x5383a6['options']);return _0x239111['getAgents'](_0x4399a6);}})[_0xc277('0x26')](function(_0x29a44a){if(_0x29a44a){_0x593d5e=_0x29a44a['length'];if(!_0x5383a6[_0xc277('0x30')][_0xc277('0x36')](_0xc277('0x73'))){_0x4399a6[_0xc277('0x20')]=qs[_0xc277('0x20')](_0x5383a6['query']['limit']);_0x4399a6[_0xc277('0x1f')]=qs[_0xc277('0x1f')](_0x5383a6[_0xc277('0x30')][_0xc277('0x1f')]);}return _0x239111['getAgents'](_0x4399a6);}})[_0xc277('0x26')](function(_0x4815ea){if(_0x4815ea){return _0x4815ea?{'count':_0x593d5e,'rows':_0x4815ea}:null;}})[_0xc277('0x26')](respondWithResult(_0x80f980,null))['catch'](handleError(_0x80f980,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index d29c643..4e54acd 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 _0xac9d=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x3ecf0c,_0x5044a3){var _0x1a682b=function(_0x97c1e4){while(--_0x97c1e4){_0x3ecf0c['push'](_0x3ecf0c['shift']());}};_0x1a682b(++_0x5044a3);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0xac9d[_0x4a3ee3];return _0x56d16d;};'use strict';var EventEmitter=require(_0xdac9('0x0'));var VoicePrefix=require(_0xdac9('0x1'))['db'][_0xdac9('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdac9('0x3')](0x0);var events={'afterCreate':_0xdac9('0x4'),'afterUpdate':_0xdac9('0x5'),'afterDestroy':_0xdac9('0x6')};function emitEvent(_0x1b967e){return function(_0x51a5d7,_0x1c17a6,_0x5a984a){VoicePrefixEvents[_0xdac9('0x7')](_0x1b967e+':'+_0x51a5d7['id'],_0x51a5d7);VoicePrefixEvents[_0xdac9('0x7')](_0x1b967e,_0x51a5d7);_0x5a984a(null);};}for(var e in events){if(events[_0xdac9('0x8')](e)){var event=events[e];VoicePrefix[_0xdac9('0x9')](e,emitEvent(event));}}module[_0xdac9('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0xae24=['hook','exports','events','VoicePrefix','save','update','emit','hasOwnProperty'];(function(_0x5acaea,_0x442cb0){var _0x509dfa=function(_0x58a5d8){while(--_0x58a5d8){_0x5acaea['push'](_0x5acaea['shift']());}};_0x509dfa(++_0x442cb0);}(_0xae24,0x182));var _0x4ae2=function(_0x1409af,_0x4dd13c){_0x1409af=_0x1409af-0x0;var _0x544656=_0xae24[_0x1409af];return _0x544656;};'use strict';var EventEmitter=require(_0x4ae2('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x4ae2('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ae2('0x2'),'afterUpdate':_0x4ae2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5b6f4d){return function(_0x1afc7a,_0x5b25b5,_0x2ed9ff){VoicePrefixEvents[_0x4ae2('0x4')](_0x5b6f4d+':'+_0x1afc7a['id'],_0x1afc7a);VoicePrefixEvents[_0x4ae2('0x4')](_0x5b6f4d,_0x1afc7a);_0x2ed9ff(null);};}for(var e in events){if(events[_0x4ae2('0x5')](e)){var event=events[e];VoicePrefix[_0x4ae2('0x6')](e,emitEvent(event));}}module[_0x4ae2('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 0b8a790..378f048 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 _0xef1e=['request-promise','path','rimraf','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x43160f,_0x2b7d08){var _0x4d1e9d=function(_0x497136){while(--_0x497136){_0x43160f['push'](_0x43160f['shift']());}};_0x4d1e9d(++_0x2b7d08);}(_0xef1e,0x125));var _0xeef1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef1e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xeef1('0x0'));var util=require(_0xeef1('0x1'));var logger=require(_0xeef1('0x2'))(_0xeef1('0x3'));var moment=require(_0xeef1('0x4'));var BPromise=require(_0xeef1('0x5'));var rp=require(_0xeef1('0x6'));var fs=require('fs');var path=require(_0xeef1('0x7'));var rimraf=require(_0xeef1('0x8'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0xeef1('0x9')]=function(_0x46b4cb,_0x35e6b1){return _0x46b4cb[_0xeef1('0xa')](_0xeef1('0xb'),attributes,{'tableName':_0xeef1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06f5=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','../../config/logger','api','moment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x06f5,0xed));var _0x506f=function(_0x286b15,_0x5ddfe9){_0x286b15=_0x286b15-0x0;var _0x9a3dbf=_0x06f5[_0x286b15];return _0x9a3dbf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x506f('0x0'))(_0x506f('0x1'));var moment=require(_0x506f('0x2'));var BPromise=require(_0x506f('0x3'));var rp=require(_0x506f('0x4'));var fs=require('fs');var path=require(_0x506f('0x5'));var rimraf=require(_0x506f('0x6'));var config=require(_0x506f('0x7'));var attributes=require(_0x506f('0x8'));module['exports']=function(_0x914943,_0xaee622){return _0x914943[_0x506f('0x9')](_0x506f('0xa'),attributes,{'tableName':_0x506f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index cbcfae3..432be7a 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 _0xd854=['redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd854,0x109));var _0x4d85=function(_0x2afe37,_0x49ae40){_0x2afe37=_0x2afe37-0x0;var _0x48f454=_0xd854[_0x2afe37];return _0x48f454;};'use strict';var _=require(_0x4d85('0x0'));var util=require('util');var moment=require(_0x4d85('0x1'));var BPromise=require(_0x4d85('0x2'));var rs=require(_0x4d85('0x3'));var fs=require('fs');var Redis=require(_0x4d85('0x4'));var db=require(_0x4d85('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d85('0x6'));var config=require(_0x4d85('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d85('0x8')][_0x4d85('0x9')]({'port':0x232a});config[_0x4d85('0xa')]=_['defaults'](config['redis'],{'host':_0x4d85('0xb'),'port':0x18eb});var socket=require(_0x4d85('0xc'))(new Redis(config[_0x4d85('0xa')]));require(_0x4d85('0xd'))[_0x4d85('0xe')](socket);function respondWithRpcPromise(_0xf6f4b1,_0x21d842,_0x37a2b5){return new BPromise(function(_0x4692b3,_0x1baf8c){return client[_0x4d85('0xf')](_0xf6f4b1,_0x37a2b5)[_0x4d85('0x10')](function(_0x2abbf7){logger[_0x4d85('0x11')](_0x4d85('0x12'),_0x21d842,_0x4d85('0x13'));logger[_0x4d85('0x14')](_0x4d85('0x15'),_0x21d842,_0x4d85('0x13'),JSON['stringify'](_0x2abbf7));if(_0x2abbf7[_0x4d85('0x16')]){if(_0x2abbf7[_0x4d85('0x16')]['code']===0x1f4){logger[_0x4d85('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21d842,_0x2abbf7[_0x4d85('0x16')][_0x4d85('0x17')]);return _0x1baf8c(_0x2abbf7[_0x4d85('0x16')]['message']);}logger[_0x4d85('0x16')](_0x4d85('0x12'),_0x21d842,_0x2abbf7['error'][_0x4d85('0x17')]);return _0x4692b3(_0x2abbf7[_0x4d85('0x16')][_0x4d85('0x17')]);}else{logger[_0x4d85('0x11')](_0x4d85('0x12'),_0x21d842,_0x4d85('0x13'));_0x4692b3(_0x2abbf7['result'][_0x4d85('0x17')]);}})[_0x4d85('0x18')](function(_0x5b9286){logger[_0x4d85('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21d842,_0x5b9286);_0x1baf8c(_0x5b9286);});});} \ No newline at end of file +var _0x23a4=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4ef194,_0x3e86fd){var _0x1fad73=function(_0x4a3e16){while(--_0x4a3e16){_0x4ef194['push'](_0x4ef194['shift']());}};_0x1fad73(++_0x3e86fd);}(_0x23a4,0x9a));var _0x423a=function(_0x58f222,_0x38f93d){_0x58f222=_0x58f222-0x0;var _0x94f924=_0x23a4[_0x58f222];return _0x94f924;};'use strict';var _=require('lodash');var util=require(_0x423a('0x0'));var moment=require('moment');var BPromise=require(_0x423a('0x1'));var rs=require(_0x423a('0x2'));var fs=require('fs');var Redis=require(_0x423a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x423a('0x4'));var logger=require(_0x423a('0x5'))(_0x423a('0x6'));var config=require(_0x423a('0x7'));var jayson=require(_0x423a('0x8'));var client=jayson[_0x423a('0x9')][_0x423a('0xa')]({'port':0x232a});config['redis']=_[_0x423a('0xb')](config['redis'],{'host':_0x423a('0xc'),'port':0x18eb});var socket=require(_0x423a('0xd'))(new Redis(config['redis']));require(_0x423a('0xe'))[_0x423a('0xf')](socket);function respondWithRpcPromise(_0x2f3b17,_0x39e8ec,_0x549626){return new BPromise(function(_0x5c7f41,_0x3c652a){return client[_0x423a('0x10')](_0x2f3b17,_0x549626)['then'](function(_0x3887ff){logger[_0x423a('0x11')](_0x423a('0x12'),_0x39e8ec,_0x423a('0x13'));logger[_0x423a('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x39e8ec,_0x423a('0x13'),JSON[_0x423a('0x15')](_0x3887ff));if(_0x3887ff[_0x423a('0x16')]){if(_0x3887ff['error'][_0x423a('0x17')]===0x1f4){logger[_0x423a('0x16')](_0x423a('0x12'),_0x39e8ec,_0x3887ff[_0x423a('0x16')][_0x423a('0x18')]);return _0x3c652a(_0x3887ff['error'][_0x423a('0x18')]);}logger[_0x423a('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x39e8ec,_0x3887ff[_0x423a('0x16')][_0x423a('0x18')]);return _0x5c7f41(_0x3887ff[_0x423a('0x16')][_0x423a('0x18')]);}else{logger['info'](_0x423a('0x12'),_0x39e8ec,_0x423a('0x13'));_0x5c7f41(_0x3887ff[_0x423a('0x19')][_0x423a('0x18')]);}})[_0x423a('0x1a')](function(_0x133267){logger[_0x423a('0x16')](_0x423a('0x12'),_0x39e8ec,_0x133267);_0x3c652a(_0x133267);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 4128f3c..b27847a 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 _0x550c=['update','removeListener','length','voicePrefix:','./voicePrefix.events'];(function(_0x28111f,_0x254934){var _0x5203e6=function(_0x2c639a){while(--_0x2c639a){_0x28111f['push'](_0x28111f['shift']());}};_0x5203e6(++_0x254934);}(_0x550c,0xb8));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require(_0xc550('0x0'));var events=['save','remove',_0xc550('0x1')];function createListener(_0x438c98,_0x294062){return function(_0x8c3fc7){_0x294062['emit'](_0x438c98,_0x8c3fc7);};}function removeListener(_0x31b5a6,_0x37e285){return function(){VoicePrefixEvents[_0xc550('0x2')](_0x31b5a6,_0x37e285);};}exports['register']=function(_0x817124){for(var _0x157e44=0x0,_0xe38514=events[_0xc550('0x3')];_0x157e44<_0xe38514;_0x157e44++){var _0x492b6e=events[_0x157e44];var _0x225f5b=createListener(_0xc550('0x4')+_0x492b6e,_0x817124);VoicePrefixEvents['on'](_0x492b6e,_0x225f5b);}}; \ No newline at end of file +var _0x3f39=['save','remove','update','emit','register','voicePrefix:','./voicePrefix.events'];(function(_0x23c31d,_0x2e8382){var _0x4c8e11=function(_0x4e5e62){while(--_0x4e5e62){_0x23c31d['push'](_0x23c31d['shift']());}};_0x4c8e11(++_0x2e8382);}(_0x3f39,0xa7));var _0x93f3=function(_0x116e3b,_0x12ee70){_0x116e3b=_0x116e3b-0x0;var _0xb0fa41=_0x3f39[_0x116e3b];return _0xb0fa41;};'use strict';var VoicePrefixEvents=require(_0x93f3('0x0'));var events=[_0x93f3('0x1'),_0x93f3('0x2'),_0x93f3('0x3')];function createListener(_0xd769a1,_0xf9a59c){return function(_0x262684){_0xf9a59c[_0x93f3('0x4')](_0xd769a1,_0x262684);};}function removeListener(_0x5f0149,_0x3756d7){return function(){VoicePrefixEvents['removeListener'](_0x5f0149,_0x3756d7);};}exports[_0x93f3('0x5')]=function(_0x534fd9){for(var _0x2901c0=0x0,_0x3b4a49=events['length'];_0x2901c0<_0x3b4a49;_0x2901c0++){var _0x5993a8=events[_0x2901c0];var _0x2998c5=createListener(_0x93f3('0x6')+_0x5993a8,_0x534fd9);VoicePrefixEvents['on'](_0x5993a8,_0x2998c5);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 309d1ec..a616bbe 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 _0xdace=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addTeams','/:id/lists','addLists','addBlackLists','update','destroy','delete','removeTeams','removeAgents','removeBlackLists'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0xdace,0xad));var _0xedac=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xdace[_0x484c03];return _0x294127;};'use strict';var multer=require(_0xedac('0x0'));var util=require(_0xedac('0x1'));var path=require(_0xedac('0x2'));var timeout=require(_0xedac('0x3'));var express=require(_0xedac('0x4'));var router=express[_0xedac('0x5')]();var auth=require(_0xedac('0x6'));var interaction=require(_0xedac('0x7'));var config=require(_0xedac('0x8'));var controller=require(_0xedac('0x9'));router[_0xedac('0xa')]('/',auth[_0xedac('0xb')](),controller['index']);router[_0xedac('0xa')](_0xedac('0xc'),auth[_0xedac('0xb')](),controller['show']);router[_0xedac('0xa')]('/:id/hoppers',auth[_0xedac('0xb')](),controller['getHoppers']);router[_0xedac('0xa')](_0xedac('0xd'),auth['isAuthenticated'](),controller[_0xedac('0xe')]);router['get'](_0xedac('0xf'),auth[_0xedac('0xb')](),controller[_0xedac('0x10')]);router['get'](_0xedac('0x11'),auth[_0xedac('0xb')](),controller[_0xedac('0x12')]);router[_0xedac('0xa')](_0xedac('0x13'),auth[_0xedac('0xb')](),controller[_0xedac('0x14')]);router[_0xedac('0xa')](_0xedac('0x15'),auth['isAuthenticated'](),controller[_0xedac('0x16')]);router[_0xedac('0xa')](_0xedac('0x17'),auth['isAuthenticated'](),controller[_0xedac('0x18')]);router[_0xedac('0xa')]('/:id/lists',auth[_0xedac('0xb')](),controller[_0xedac('0x19')]);router[_0xedac('0xa')](_0xedac('0x1a'),auth[_0xedac('0xb')](),controller[_0xedac('0x1b')]);router['post']('/',auth[_0xedac('0xb')](),controller[_0xedac('0x1c')]);router[_0xedac('0x1d')](_0xedac('0x1e'),auth[_0xedac('0xb')](),controller[_0xedac('0x1f')]);router['post'](_0xedac('0x13'),auth[_0xedac('0xb')](),controller[_0xedac('0x20')]);router['post']('/:id/users',auth[_0xedac('0xb')](),controller['addAgents']);router['post'](_0xedac('0x21'),auth[_0xedac('0xb')](),controller[_0xedac('0x22')]);router[_0xedac('0x1d')](_0xedac('0x1a'),auth[_0xedac('0xb')](),controller[_0xedac('0x23')]);router['put'](_0xedac('0xc'),auth[_0xedac('0xb')](),controller[_0xedac('0x24')]);router['delete'](_0xedac('0xc'),auth['isAuthenticated'](),controller[_0xedac('0x25')]);router[_0xedac('0x26')](_0xedac('0x13'),auth[_0xedac('0xb')](),controller[_0xedac('0x27')]);router[_0xedac('0x26')]('/:id/users',auth[_0xedac('0xb')](),controller[_0xedac('0x28')]);router[_0xedac('0x26')](_0xedac('0x21'),auth[_0xedac('0xb')](),controller['removeLists']);router[_0xedac('0x26')](_0xedac('0x1a'),auth[_0xedac('0xb')](),controller[_0xedac('0x29')]);module[_0xedac('0x2a')]=router; \ No newline at end of file +var _0x7525=['getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/users','getAgents','getMembers','getLists','/:id/blacklists','post','create','/:id/clone','/:id/teams','addAgents','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7525,0x1a2));var _0x5752=function(_0x3b320e,_0x232e26){_0x3b320e=_0x3b320e-0x0;var _0x25108c=_0x7525[_0x3b320e];return _0x25108c;};'use strict';var multer=require(_0x5752('0x0'));var util=require(_0x5752('0x1'));var path=require('path');var timeout=require(_0x5752('0x2'));var express=require(_0x5752('0x3'));var router=express[_0x5752('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5752('0x5'));var config=require(_0x5752('0x6'));var controller=require('./voiceQueue.controller');router[_0x5752('0x7')]('/',auth[_0x5752('0x8')](),controller[_0x5752('0x9')]);router[_0x5752('0x7')](_0x5752('0xa'),auth[_0x5752('0x8')](),controller[_0x5752('0xb')]);router[_0x5752('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x5752('0xc')]);router[_0x5752('0x7')](_0x5752('0xd'),auth['isAuthenticated'](),controller[_0x5752('0xe')]);router[_0x5752('0x7')]('/:id/hopper_finals',auth[_0x5752('0x8')](),controller[_0x5752('0xf')]);router[_0x5752('0x7')](_0x5752('0x10'),auth[_0x5752('0x8')](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0x5752('0x8')](),controller['getTeams']);router[_0x5752('0x7')](_0x5752('0x11'),auth[_0x5752('0x8')](),controller[_0x5752('0x12')]);router[_0x5752('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x5752('0x13')]);router['get']('/:id/lists',auth[_0x5752('0x8')](),controller[_0x5752('0x14')]);router[_0x5752('0x7')](_0x5752('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x5752('0x16')]('/',auth['isAuthenticated'](),controller[_0x5752('0x17')]);router['post'](_0x5752('0x18'),auth['isAuthenticated'](),controller['clone']);router[_0x5752('0x16')](_0x5752('0x19'),auth[_0x5752('0x8')](),controller['addTeams']);router[_0x5752('0x16')](_0x5752('0x11'),auth[_0x5752('0x8')](),controller[_0x5752('0x1a')]);router['post'](_0x5752('0x1b'),auth[_0x5752('0x8')](),controller[_0x5752('0x1c')]);router[_0x5752('0x16')](_0x5752('0x15'),auth[_0x5752('0x8')](),controller[_0x5752('0x1d')]);router[_0x5752('0x1e')](_0x5752('0xa'),auth[_0x5752('0x8')](),controller[_0x5752('0x1f')]);router[_0x5752('0x20')](_0x5752('0xa'),auth[_0x5752('0x8')](),controller[_0x5752('0x21')]);router['delete'](_0x5752('0x19'),auth[_0x5752('0x8')](),controller['removeTeams']);router[_0x5752('0x20')](_0x5752('0x11'),auth[_0x5752('0x8')](),controller[_0x5752('0x22')]);router[_0x5752('0x20')](_0x5752('0x1b'),auth[_0x5752('0x8')](),controller['removeLists']);router['delete'](_0x5752('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x5752('0x23')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 7ae32fc..20bb78e 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 _0x351d=['default','ringall','leastrecent','fewestcalls','random','linear','wrandom','setDataValue','strategy','rrmemory','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound'];(function(_0xb04261,_0x50e162){var _0x430e34=function(_0x28e7f5){while(--_0x28e7f5){_0xb04261['push'](_0xb04261['shift']());}};_0x430e34(++_0x50e162);}(_0x351d,0x161));var _0xd351=function(_0x6f312f,_0x33da93){_0x6f312f=_0x6f312f-0x0;var _0x41590d=_0x351d[_0x6f312f];return _0x41590d;};'use strict';var Sequelize=require(_0xd351('0x0'));module[_0xd351('0x1')]={'name':{'type':Sequelize[_0xd351('0x2')],'allowNull':![],'unique':_0xd351('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x5'),_0xd351('0x6')),'allowNull':![],'defaultValue':_0xd351('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xd351('0x7')},'announce':{'type':Sequelize[_0xd351('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd351('0x4')]('rr',_0xd351('0x8'),_0xd351('0x9'),_0xd351('0xa'),_0xd351('0xb'),'rrmemory',_0xd351('0xc'),_0xd351('0xd'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x46fa06){this[_0xd351('0xe')](_0xd351('0xf'),_0x46fa06?_0x46fa06:_0xd351('0x10'));},'get':function(){var _0x475c79=this[_0xd351('0x11')](_0xd351('0x12'));var _0x4085cb=this[_0xd351('0x11')]('dialMethod');var _0x1833aa=this['getDataValue'](_0xd351('0xf'));if(_0x475c79==='inbound'){return _0x1833aa;}if(_0x4085cb===_0xd351('0x13')&&_0x1833aa===_0xd351('0x10')||_0x4085cb==='booked'&&_0x1833aa===_0xd351('0x14')){return _0x1833aa;}if(_0x4085cb===_0xd351('0x15')||_0x4085cb==='predictive'||_0x4085cb===_0xd351('0x16')){return _0x1833aa;}return null;}},'servicelevel':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd351('0x17')](0xb)},'timeout':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd351('0x2')]},'weight':{'type':Sequelize[_0xd351('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xd351('0x18'),'no'),'defaultValue':_0xd351('0x18')},'autopause':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xd351('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd351('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xd351('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd351('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':_0xd351('0x18')},'announce_holdtime':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no',_0xd351('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd351('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xd351('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xd351('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd351('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd351('0x2')]},'queue_youarenext':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd351('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd351('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xd351('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xd351('0x1a')],'set':function(_0x3b5d09){this[_0xd351('0xe')](_0xd351('0x1b'),_0x3b5d09?_0x3b5d09[_0xd351('0x1c')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0xd351('0x11')](_0xd351('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xd351('0x18'),'set':function(_0x406d60){this[_0xd351('0xe')](_0xd351('0x1d'),_0x406d60?_0x406d60[_0xd351('0x1c')](','):[]);},'get':function(){return this[_0xd351('0x11')]('joinempty')?this[_0xd351('0x11')](_0xd351('0x1d'))[_0xd351('0x1e')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xd351('0x2')],'defaultValue':'no','set':function(_0x235499){this[_0xd351('0xe')](_0xd351('0x1f'),_0x235499?_0x235499[_0xd351('0x1c')](','):[]);},'get':function(){return this[_0xd351('0x11')]('leavewhenempty')?this[_0xd351('0x11')]('leavewhenempty')[_0xd351('0x1e')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0xd351('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd351('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x4a9a54){this[_0xd351('0xe')](_0xd351('0x20'),_0x4a9a54);if(_0x4a9a54){if(this[_0xd351('0x11')](_0xd351('0x21'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd351('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd351('0x22')],'defaultValue':0x0,'comment':_0xd351('0x23')},'dialMethod':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x24'),_0xd351('0x15'),_0xd351('0x16'),'predictive',_0xd351('0x13')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd351('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xd351('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xd351('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x28'),_0xd351('0x29')),'defaultValue':_0xd351('0x29'),'comment':_0xd351('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd351('0x27')](0x2)[_0xd351('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xd351('0x17')](0x3)[_0xd351('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd351('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd351('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd351('0x17')](0x3)[_0xd351('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd351('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xd351('0x2')],'defaultValue':_0xd351('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd351('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd351('0x2e')},'dialQueueProject':{'type':Sequelize[_0xd351('0x2')],'comment':_0xd351('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd351('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd351('0x17')](0x5)[_0xd351('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd351('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd351('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd351('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd351('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd351('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd351('0x17')](0x5)[_0xd351('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd351('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd351('0x17')](0x3)[_0xd351('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd351('0x33')},'dialTimezone':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd351('0x2')],'defaultValue':_0xd351('0x34')},'dialPrefix':{'type':Sequelize[_0xd351('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x35'),'never',_0xd351('0x36')),'defaultValue':_0xd351('0x35')},'dialAMDActive':{'type':Sequelize[_0xd351('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd351('0x17')](0x9)[_0xd351('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd351('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xd351('0x17')](0x9)[_0xd351('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd351('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd351('0x17')](0x9)[_0xd351('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd351('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd351('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd351('0x3a')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd351('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd351('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd351('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd351('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd351('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd351('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd351('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd351('0x17')](0x9)[_0xd351('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd351('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xd351('0x17')](0x5)[_0xd351('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd351('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd351('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd351('0x4')](_0xd351('0x41'),_0xd351('0x42')),'defaultValue':_0xd351('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xd351('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd351('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd351('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd351('0x43')},'dialCutDigit':{'type':Sequelize[_0xd351('0x17')](0x3)[_0xd351('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd351('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd351('0x17')],'allowNull':!![],'comment':_0xd351('0x45')},'mandatoryDisposition':{'type':Sequelize[_0xd351('0x22')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2ec77b){if(!_0x2ec77b)this[_0xd351('0xe')](_0xd351('0x46'),null);this[_0xd351('0xe')](_0xd351('0x47'),_0x2ec77b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd351('0x17')](0x3)[_0xd351('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd351('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xc89c=['STRING','default','ringall','fewestcalls','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','type','dialMethod','getDataValue','booked','roundrobin','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','inbound'];(function(_0x3ccb44,_0x49574f){var _0x35e22f=function(_0xa27a0e){while(--_0xa27a0e){_0x3ccb44['push'](_0x3ccb44['shift']());}};_0x35e22f(++_0x49574f);}(_0xc89c,0x1a6));var _0xcc89=function(_0x2de0be,_0x4a21fa){_0x2de0be=_0x2de0be-0x0;var _0x5b69c3=_0xc89c[_0x2de0be];return _0x5b69c3;};'use strict';var Sequelize=require('sequelize');module[_0xcc89('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcc89('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xcc89('0x3')},'musiconhold':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':_0xcc89('0x5')},'announce':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0xcc89('0x2')]('rr',_0xcc89('0x6'),'leastrecent',_0xcc89('0x7'),'random','rrmemory',_0xcc89('0x8'),_0xcc89('0x9'),_0xcc89('0xa')),'allowNull':![],'defaultValue':_0xcc89('0x6'),'set':function(_0x378215){this[_0xcc89('0xb')](_0xcc89('0xc'),_0x378215?_0x378215:_0xcc89('0xd'));},'get':function(){var _0x333c83=this['getDataValue'](_0xcc89('0xe'));var _0x14e53c=this['getDataValue'](_0xcc89('0xf'));var _0x5f0256=this[_0xcc89('0x10')](_0xcc89('0xc'));if(_0x333c83===_0xcc89('0x3')){return _0x5f0256;}if(_0x14e53c===_0xcc89('0x11')&&_0x5f0256===_0xcc89('0xd')||_0x14e53c==='booked'&&_0x5f0256===_0xcc89('0x12')){return _0x5f0256;}if(_0x14e53c==='progressive'||_0x14e53c===_0xcc89('0x13')||_0x14e53c==='power'){return _0x5f0256;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xcc89('0x14')](0xb)},'timeout':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xcc89('0x4')]},'weight':{'type':Sequelize[_0xcc89('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defaultValue':_0xcc89('0x15')},'autopause':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no',_0xcc89('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xcc89('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xcc89('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xcc89('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xcc89('0x2')]('yes','no'),'defaultValue':_0xcc89('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xcc89('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xcc89('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xcc89('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xcc89('0x4')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xcc89('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xcc89('0x4')]},'queue_quantity1':{'type':Sequelize[_0xcc89('0x4')]},'queue_quantity2':{'type':Sequelize[_0xcc89('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0xcc89('0x4')]},'queue_less_than':{'type':Sequelize[_0xcc89('0x4')]},'periodic_announce':{'type':Sequelize[_0xcc89('0x17')],'set':function(_0x842c2c){this[_0xcc89('0xb')](_0xcc89('0x18'),_0x842c2c?_0x842c2c[_0xcc89('0x19')](','):[]);},'get':function(){return this[_0xcc89('0x10')](_0xcc89('0x18'))?this[_0xcc89('0x10')](_0xcc89('0x18'))[_0xcc89('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':_0xcc89('0x15'),'set':function(_0xdbab05){this[_0xcc89('0xb')](_0xcc89('0x1b'),_0xdbab05?_0xdbab05['join'](','):[]);},'get':function(){return this[_0xcc89('0x10')]('joinempty')?this[_0xcc89('0x10')]('joinempty')[_0xcc89('0x1a')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':'no','set':function(_0x2e087f){this[_0xcc89('0xb')](_0xcc89('0x1c'),_0x2e087f?_0x2e087f[_0xcc89('0x19')](','):[]);},'get':function(){return this[_0xcc89('0x10')](_0xcc89('0x1c'))?this[_0xcc89('0x10')](_0xcc89('0x1c'))[_0xcc89('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0xcc89('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xcc89('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xcc89('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xcc89('0x4')]},'description':{'type':Sequelize[_0xcc89('0x4')]},'acw':{'type':Sequelize[_0xcc89('0x1d')],'defaultValue':0x0,'set':function(_0x5df82b){this[_0xcc89('0xb')](_0xcc89('0x1e'),_0x5df82b);if(_0x5df82b){if(this['getDataValue'](_0xcc89('0x1f'))<0x2){this[_0xcc89('0xb')](_0xcc89('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xcc89('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcc89('0x20')},'dialMethod':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x21'),'progressive','power',_0xcc89('0x13'),_0xcc89('0x11')),'defaultValue':_0xcc89('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xcc89('0x14')](0x4)[_0xcc89('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xcc89('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcc89('0x24')},'dialPowerLevel':{'type':Sequelize[_0xcc89('0x25')](0x2)[_0xcc89('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xcc89('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x27'),'dropRate'),'defaultValue':_0xcc89('0x28'),'comment':_0xcc89('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xcc89('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xcc89('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xcc89('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcc89('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcc89('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':_0xcc89('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcc89('0x2d')},'dialQueueProject':{'type':Sequelize[_0xcc89('0x4')],'comment':_0xcc89('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcc89('0x14')](0x5)[_0xcc89('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcc89('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcc89('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xcc89('0x14')](0x5)[_0xcc89('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'defaultValue':0x3,'comment':_0xcc89('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcc89('0x14')](0x5)[_0xcc89('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcc89('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcc89('0x33')},'dialTimezone':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':_0xcc89('0x34')},'dialPrefix':{'type':Sequelize[_0xcc89('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x35'),_0xcc89('0x36'),_0xcc89('0x37')),'defaultValue':_0xcc89('0x35')},'dialAMDActive':{'type':Sequelize[_0xcc89('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcc89('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcc89('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xcc89('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcc89('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcc89('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcc89('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcc89('0x14')](0x5)[_0xcc89('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcc89('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcc89('0x14')](0x9)[_0xcc89('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcc89('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xcc89('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xcc89('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xcc89('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xcc89('0x2')](_0xcc89('0x40'),_0xcc89('0x41')),'defaultValue':_0xcc89('0x40')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xcc89('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xcc89('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcc89('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xcc89('0x14')](0x3)[_0xcc89('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcc89('0x42')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcc89('0x14')],'allowNull':!![],'comment':_0xcc89('0x43')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcc89('0x44'),'set':function(_0x45a6c9){if(!_0x45a6c9)this['setDataValue'](_0xcc89('0x45'),null);this['setDataValue'](_0xcc89('0x46'),_0x45a6c9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xcc89('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xcc89('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 e320569..6c75ef8 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 _0x5eb8=['sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','name','send','index','VoiceQueue','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','findOne','CmHopper','order','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','flatMap','penalty','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','all','union','compact','transaction','removeAgents','emit','userVoiceQueue:remove','addAgents','User','isNil','isArray','getAgents','getMembers','CmList','getLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','fromQuery','NOW()','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xe33285,_0x7f474){var _0x31ca6b=function(_0x51b2a6){while(--_0x51b2a6){_0xe33285['push'](_0xe33285['shift']());}};_0x31ca6b(++_0x7f474);}(_0x5eb8,0xb0));var _0x85eb=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0x5eb8[_0xa8d7ef];return _0x239d5e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x85eb('0x0'));var zipdir=require(_0x85eb('0x1'));var jsonpatch=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var moment=require(_0x85eb('0x4'));var BPromise=require(_0x85eb('0x5'));var Mustache=require(_0x85eb('0x6'));var util=require(_0x85eb('0x7'));var path=require(_0x85eb('0x8'));var sox=require(_0x85eb('0x9'));var csv=require(_0x85eb('0xa'));var ejs=require(_0x85eb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0xa'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var hardwareService=require(_0x85eb('0x13'));var logger=require(_0x85eb('0x14'))(_0x85eb('0x15'));var utils=require('../../config/utils');var config=require(_0x85eb('0x16'));var db=require(_0x85eb('0x17'))['db'];config['redis']=_[_0x85eb('0x18')](config[_0x85eb('0x19')],{'host':_0x85eb('0x1a'),'port':0x18eb});var socket=require(_0x85eb('0x1b'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x85eb('0x1c')](socket);function respondWithStatusCode(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xcc;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1d')](_0x18ca53);}return _0x5c760a[_0x85eb('0x1e')](_0x18ca53)[_0x85eb('0x1f')]();};}function respondWithResult(_0x49efdf,_0x2e5c0a){_0x2e5c0a=_0x2e5c0a||0xc8;return function(_0x59237b){if(_0x59237b){return _0x49efdf[_0x85eb('0x1e')](_0x2e5c0a)[_0x85eb('0x20')](_0x59237b);}};}function respondWithFilteredResult(_0x3e23e8,_0x5deab1){return function(_0x5dbeda){if(_0x5dbeda){var _0x5c5cbb=_0x5dbeda[_0x85eb('0x21')],_0x50d2a8=_0x5deab1[_0x85eb('0x22')],_0xe198ca=_0x5deab1[_0x85eb('0x22')]+_0x5deab1[_0x85eb('0x23')],_0x39ca96;if(_0xe198ca>=_0x5c5cbb){_0xe198ca=_0x5c5cbb;_0x39ca96=0xc8;}else{_0x39ca96=0xce;}_0x3e23e8['status'](_0x39ca96);return _0x3e23e8[_0x85eb('0x24')](_0x85eb('0x25'),_0x50d2a8+'-'+_0xe198ca+'/'+_0x5c5cbb)[_0x85eb('0x20')](_0x5dbeda);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x26')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x27')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x28')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x29')]()[_0x85eb('0x2a')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x2b')]({'plain':!![]});var _0x5dfc96=[{'name':_0x85eb('0x2c'),'value':_0x85eb('0x2d'),'ignore':![]},{'name':_0x85eb('0x2e'),'value':_0x85eb('0x2f'),'ignore':![]}];var _0x3e2326=_(_0x5dfc96)['filter'](_0x85eb('0x30'))[_0x85eb('0x31')](_0x85eb('0x32'))[_0x85eb('0x32')]();if(_[_0x85eb('0x33')](_0x3e2326,_0x312b3e[_0x85eb('0x34')])){return;}var _0x50541a=_['find'](_0x5dfc96,[_0x85eb('0x32'),_0x312b3e['type']])[_0x85eb('0x35')];return db['UserProfileResource'][_0x85eb('0x29')]({'where':{'type':_0x50541a,'resourceId':_0x312b3e['id']}})[_0x85eb('0x2a')](function(){return _0x1426c8;});})[_0x85eb('0x2a')](function(){_0x5b48d9[_0x85eb('0x1e')](0xcc)[_0x85eb('0x1f')]();});}};}function handleEntityNotFound(_0xf4ac13,_0x41ed76){return function(_0x5decd5){if(!_0x5decd5){_0xf4ac13[_0x85eb('0x1d')](0x194);}return _0x5decd5;};}function handleError(_0xcbcf2b,_0x515ee9){_0x515ee9=_0x515ee9||0x1f4;return function(_0x197898){logger['error'](_0x197898['stack']);if(_0x197898[_0x85eb('0x35')]){delete _0x197898[_0x85eb('0x35')];}_0xcbcf2b[_0x85eb('0x1e')](_0x515ee9)[_0x85eb('0x36')](_0x197898);};}exports[_0x85eb('0x37')]=function(_0x2c22bb,_0x39b574){var _0x3858e6={},_0xa3fe68={},_0x1008bf={'count':0x0,'rows':[]};var _0x4cbee0=db[_0x85eb('0x38')][_0x85eb('0x39')];_0xa3fe68['model']=_['keys'](_0x4cbee0);_0xa3fe68[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x2c22bb[_0x85eb('0x3a')]);_0xa3fe68[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0xa3fe68[_0x85eb('0x3e')],_0xa3fe68[_0x85eb('0x3a')]);_0x3858e6[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0xa3fe68[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x2c22bb[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x3858e6[_0x85eb('0x3f')]=_0x3858e6['attributes'][_0x85eb('0x41')]?_0x3858e6[_0x85eb('0x3f')]:_0xa3fe68['model'];if(!_0x2c22bb['query'][_0x85eb('0x42')](_0x85eb('0x43'))){_0x3858e6['limit']=qs[_0x85eb('0x23')](_0x2c22bb['query'][_0x85eb('0x23')]);_0x3858e6['offset']=qs[_0x85eb('0x22')](_0x2c22bb['query'][_0x85eb('0x22')]);}_0x3858e6['order']=qs[_0x85eb('0x44')](_0x2c22bb[_0x85eb('0x3a')]['sort']);_0x3858e6[_0x85eb('0x45')]=qs['filters'](_[_0x85eb('0x46')](_0x2c22bb[_0x85eb('0x3a')],_0xa3fe68['filters']));if(_0x2c22bb[_0x85eb('0x3a')]['filter']){_0x3858e6['where']=_[_0x85eb('0x47')](_0x3858e6['where'],{'$or':_[_0x85eb('0x31')](_0x4cbee0,function(_0x1dd920){if(_0x1dd920['type']['key']!==_0x85eb('0x48')){var _0x422ec3={};_0x422ec3[_0x1dd920['field']]={'$like':'%'+_0x2c22bb['query'][_0x85eb('0x49')]+'%'};return _0x422ec3;}})});}_0x3858e6=_[_0x85eb('0x47')]({},_0x3858e6,_0x2c22bb[_0x85eb('0x4a')]);var _0x202681={'where':_0x3858e6[_0x85eb('0x45')]};return db['VoiceQueue'][_0x85eb('0x21')](_0x202681)[_0x85eb('0x2a')](function(_0x208c27){_0x1008bf[_0x85eb('0x21')]=_0x208c27;if(_0x2c22bb[_0x85eb('0x3a')][_0x85eb('0x4b')]){_0x3858e6[_0x85eb('0x4c')]=[{'all':!![]}];}return db[_0x85eb('0x38')][_0x85eb('0x4d')](_0x3858e6);})['then'](function(_0x3a06af){_0x1008bf[_0x85eb('0x4e')]=_0x3a06af;return _0x1008bf;})['then'](respondWithFilteredResult(_0x39b574,_0x3858e6))[_0x85eb('0x4f')](handleError(_0x39b574,null));};exports[_0x85eb('0x50')]=function(_0x2dae5b,_0xecaacc){var _0x1b1559={'raw':![],'where':{'id':_0x2dae5b['params']['id']}},_0x2372ad={};_0x2372ad[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x38')][_0x85eb('0x39')]);_0x2372ad[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x2dae5b[_0x85eb('0x3a')]);_0x2372ad[_0x85eb('0x3c')]=_['intersection'](_0x2372ad[_0x85eb('0x3e')],_0x2372ad[_0x85eb('0x3a')]);_0x1b1559[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x2372ad[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x2dae5b[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x1b1559[_0x85eb('0x3f')]=_0x1b1559[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x1b1559[_0x85eb('0x3f')]:_0x2372ad['model'];if(_0x2dae5b[_0x85eb('0x3a')][_0x85eb('0x4b')]){_0x1b1559[_0x85eb('0x4c')]=[{'all':!![]}];}_0x1b1559=_['merge']({},_0x1b1559,_0x2dae5b[_0x85eb('0x4a')]);return db[_0x85eb('0x38')][_0x85eb('0x51')](_0x1b1559)[_0x85eb('0x2a')](handleEntityNotFound(_0xecaacc,null))[_0x85eb('0x2a')](respondWithResult(_0xecaacc,null))['catch'](handleError(_0xecaacc,null));};exports[_0x85eb('0x52')]=function(_0x12c4cc,_0x458e93){return db['VoiceQueue'][_0x85eb('0x52')](_0x12c4cc[_0x85eb('0x53')],{})[_0x85eb('0x2a')](function(_0x4c06ef){var _0x56f510=_0x12c4cc[_0x85eb('0x54')]['get']({'plain':!![]});if(!_0x56f510)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56f510[_0x85eb('0x55')]==='user'){var _0x39316d=_0x4c06ef[_0x85eb('0x2b')]({'plain':!![]});var _0x4e3d96=[{'name':'VoiceQueues','value':_0x85eb('0x2d')},{'name':_0x85eb('0x2e'),'value':_0x85eb('0x2f')}];var _0x40d64d=_[_0x85eb('0x51')](_0x4e3d96,['value',_0x39316d[_0x85eb('0x34')]])[_0x85eb('0x35')];return db[_0x85eb('0x56')][_0x85eb('0x51')]({'where':{'name':_0x40d64d,'userProfileId':_0x56f510[_0x85eb('0x57')]},'raw':!![]})['then'](function(_0x140919){if(_0x140919&&_0x140919['autoAssociation']===0x0){return db[_0x85eb('0x58')][_0x85eb('0x52')]({'name':_0x39316d['name'],'resourceId':_0x39316d['id'],'type':_0x140919[_0x85eb('0x35')],'sectionId':_0x140919['id']},{})[_0x85eb('0x2a')](function(){return _0x4c06ef;});}else{return _0x4c06ef;}})[_0x85eb('0x4f')](function(_0x26e04a){logger[_0x85eb('0x59')](_0x85eb('0x5a'),_0x26e04a);throw _0x26e04a;});}return _0x4c06ef;})['then'](respondWithResult(_0x458e93,0xc9))[_0x85eb('0x4f')](handleError(_0x458e93,null));};exports['clone']=function(_0x311857,_0x20f4b3){var _0x56410c={'raw':![],'where':{'id':_0x311857[_0x85eb('0x5b')]['id']}},_0x152452={};_0x152452['model']=_[_0x85eb('0x3b')](db['VoiceQueue'][_0x85eb('0x39')]);_0x56410c[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x152452[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x311857[_0x85eb('0x3a')]['fields']));_0x56410c[_0x85eb('0x3f')]=_0x56410c[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x56410c[_0x85eb('0x3f')]:_0x152452[_0x85eb('0x3e')];if(_0x311857[_0x85eb('0x3a')][_0x85eb('0x4b')]){_0x56410c[_0x85eb('0x4c')]=[{'all':!![]}];}_0x56410c=_[_0x85eb('0x47')]({},_0x56410c,_0x311857[_0x85eb('0x4a')]);return db[_0x85eb('0x38')]['find'](_0x56410c)[_0x85eb('0x2a')](handleEntityNotFound(_0x20f4b3,null))[_0x85eb('0x2a')](function(_0x46e5d3){if(_0x46e5d3){var _0xdaf2fe=_0x46e5d3[_0x85eb('0x2b')]({'plain':!![]});_0xdaf2fe=qs[_0x85eb('0x5c')](_0xdaf2fe,['id','createdAt',_0x85eb('0x5d')]);_0x311857['body']=_[_0x85eb('0x5c')](_0x311857[_0x85eb('0x53')],['id',_0x85eb('0x5e'),_0x85eb('0x5d')]);return db[_0x85eb('0x38')]['create'](_[_0x85eb('0x47')](_0xdaf2fe,_0x311857[_0x85eb('0x53')]),{'include':_0x311857[_0x85eb('0x3a')][_0x85eb('0x4b')]?[{'all':!![]}]:undefined})[_0x85eb('0x2a')](function(_0x14cab8){var _0x23fcf9=_0x311857[_0x85eb('0x54')]['get']({'plain':!![]});if(!_0x23fcf9)throw new Error(_0x85eb('0x5f'));if(_0x23fcf9['role']===_0x85eb('0x54')){var _0x3ff0f9=_0x14cab8[_0x85eb('0x2b')]({'plain':!![]});var _0x41960f=[{'name':_0x85eb('0x2c'),'value':'inbound'},{'name':_0x85eb('0x2e'),'value':_0x85eb('0x2f')}];var _0x10eb55=_[_0x85eb('0x51')](_0x41960f,[_0x85eb('0x32'),_0x3ff0f9[_0x85eb('0x34')]])['name'];return db['UserProfileSection'][_0x85eb('0x51')]({'where':{'name':_0x10eb55,'userProfileId':_0x23fcf9['userProfileId']},'raw':!![]})[_0x85eb('0x2a')](function(_0xc4b933){if(_0xc4b933&&_0xc4b933[_0x85eb('0x60')]===0x0){return db[_0x85eb('0x58')][_0x85eb('0x52')]({'name':_0x3ff0f9[_0x85eb('0x35')],'resourceId':_0x3ff0f9['id'],'type':_0xc4b933['name'],'sectionId':_0xc4b933['id']},{})[_0x85eb('0x2a')](function(){return _0x14cab8;});}else{return _0x14cab8;}})[_0x85eb('0x4f')](function(_0x3f30e4){logger[_0x85eb('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f30e4);throw _0x3f30e4;});}return _0x14cab8;});}})[_0x85eb('0x2a')](respondWithResult(_0x20f4b3,0xc9))[_0x85eb('0x4f')](handleError(_0x20f4b3,null));};exports[_0x85eb('0x28')]=function(_0x14bf0e,_0x5037c7){if(_0x14bf0e[_0x85eb('0x53')]['id']){delete _0x14bf0e[_0x85eb('0x53')]['id'];}return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x14bf0e[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x5037c7,null))[_0x85eb('0x2a')](saveUpdates(_0x14bf0e[_0x85eb('0x53')],null))[_0x85eb('0x2a')](respondWithResult(_0x5037c7,null))[_0x85eb('0x4f')](handleError(_0x5037c7,null));};exports[_0x85eb('0x29')]=function(_0x17197e,_0x1d9d3a){return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x17197e[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x1d9d3a,null))[_0x85eb('0x2a')](removeEntity(_0x1d9d3a,null))[_0x85eb('0x4f')](handleError(_0x1d9d3a,null));};exports['getHoppers']=function(_0x268816,_0x4dd31e,_0x121a9e){var _0x2346b1={'raw':![],'where':{}};var _0x1597c3={};var _0x1e87d2={'count':0x0,'rows':[]};return db[_0x85eb('0x38')][_0x85eb('0x61')]({'where':{'id':_0x268816[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x4dd31e,null))[_0x85eb('0x2a')](function(_0x569ebe){if(_0x569ebe){_0x1597c3[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x62')][_0x85eb('0x39')]);_0x1597c3[_0x85eb('0x3a')]=_['keys'](_0x268816[_0x85eb('0x3a')]);_0x1597c3['filters']=_[_0x85eb('0x3d')](_0x1597c3[_0x85eb('0x3e')],_0x1597c3[_0x85eb('0x3a')]);_0x2346b1['attributes']=_[_0x85eb('0x3d')](_0x1597c3[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x268816['query']['fields']));_0x2346b1[_0x85eb('0x3f')]=_0x2346b1[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x2346b1[_0x85eb('0x3f')]:_0x1597c3['model'];if(!_0x268816[_0x85eb('0x3a')]['hasOwnProperty'](_0x85eb('0x43'))){_0x2346b1[_0x85eb('0x23')]=qs[_0x85eb('0x23')](_0x268816[_0x85eb('0x3a')][_0x85eb('0x23')]);_0x2346b1[_0x85eb('0x22')]=qs['offset'](_0x268816[_0x85eb('0x3a')]['offset']);}_0x2346b1[_0x85eb('0x63')]=qs[_0x85eb('0x44')](_0x268816[_0x85eb('0x3a')][_0x85eb('0x44')]);_0x2346b1[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_[_0x85eb('0x46')](_0x268816[_0x85eb('0x3a')],_0x1597c3[_0x85eb('0x3c')]));_0x2346b1['where'][_0x85eb('0x64')]=_0x569ebe['id'];if(_0x268816[_0x85eb('0x3a')]['filter']){_0x2346b1['where']=_[_0x85eb('0x47')](_0x2346b1['where'],{'$or':_[_0x85eb('0x31')](_0x2346b1['attributes'],function(_0x101ae0){var _0x5ae95b={};_0x5ae95b[_0x101ae0]={'$like':'%'+_0x268816[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x5ae95b;})});}_0x2346b1=_['merge']({},_0x2346b1,_0x268816[_0x85eb('0x4a')]);return db[_0x85eb('0x62')]['count']({'where':_0x2346b1[_0x85eb('0x45')]})[_0x85eb('0x2a')](function(_0xf076af){_0x1e87d2[_0x85eb('0x21')]=_0xf076af;if(_0x268816['query'][_0x85eb('0x4b')]){_0x2346b1['include']=[{'all':!![]}];}return db[_0x85eb('0x62')][_0x85eb('0x4d')](_0x2346b1);})[_0x85eb('0x2a')](function(_0x5ea055){_0x1e87d2[_0x85eb('0x4e')]=_0x5ea055;return _0x1e87d2;});}})[_0x85eb('0x2a')](respondWithFilteredResult(_0x4dd31e,_0x2346b1))[_0x85eb('0x4f')](handleError(_0x4dd31e,null));};exports['getHopperHistories']=function(_0x37d98e,_0x5eb629,_0x26cc46){var _0x2b43dd={'raw':!![],'where':{}};var _0x9b263e={};var _0x58eb42={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x37d98e[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x5eb629,null))[_0x85eb('0x2a')](function(_0x543c22){if(_0x543c22){_0x9b263e[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x65')][_0x85eb('0x39')]);_0x9b263e[_0x85eb('0x3a')]=_['keys'](_0x37d98e['query']);_0x9b263e[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x9b263e['model'],_0x9b263e[_0x85eb('0x3a')]);_0x2b43dd[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x9b263e[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x2b43dd[_0x85eb('0x3f')]=_0x2b43dd[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x2b43dd[_0x85eb('0x3f')]:_0x9b263e[_0x85eb('0x3e')];if(!_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x42')](_0x85eb('0x43'))){_0x2b43dd['limit']=qs[_0x85eb('0x23')](_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x23')]);_0x2b43dd[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x22')]);}_0x2b43dd[_0x85eb('0x63')]=qs[_0x85eb('0x44')](_0x37d98e[_0x85eb('0x3a')]['sort']);_0x2b43dd[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_[_0x85eb('0x46')](_0x37d98e[_0x85eb('0x3a')],_0x9b263e['filters']));_0x2b43dd[_0x85eb('0x45')][_0x85eb('0x64')]=_0x543c22['id'];if(_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x49')]){_0x2b43dd[_0x85eb('0x45')]=_[_0x85eb('0x47')](_0x2b43dd['where'],{'$or':_[_0x85eb('0x31')](_0x2b43dd[_0x85eb('0x3f')],function(_0x12c3be){var _0x59fc6a={};_0x59fc6a[_0x12c3be]={'$like':'%'+_0x37d98e[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x59fc6a;})});}_0x2b43dd=_[_0x85eb('0x47')]({},_0x2b43dd,_0x37d98e[_0x85eb('0x4a')]);return db[_0x85eb('0x65')][_0x85eb('0x21')]({'where':_0x2b43dd[_0x85eb('0x45')]})[_0x85eb('0x2a')](function(_0x4e55e2){_0x58eb42[_0x85eb('0x21')]=_0x4e55e2;if(_0x37d98e[_0x85eb('0x3a')]['includeAll']){_0x2b43dd['include']=[{'all':!![]}];}return db[_0x85eb('0x65')]['findAll'](_0x2b43dd);})[_0x85eb('0x2a')](function(_0x1cae93){_0x58eb42[_0x85eb('0x4e')]=_0x1cae93;return _0x58eb42;});}})[_0x85eb('0x2a')](respondWithFilteredResult(_0x5eb629,_0x2b43dd))['catch'](handleError(_0x5eb629,null));};exports['getHopperFinals']=function(_0x38c6ed,_0x5f1b02,_0x3a0ddc){var _0xa47647={'raw':!![],'where':{}};var _0x153076={};var _0x36001e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x38c6ed[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x5f1b02,null))[_0x85eb('0x2a')](function(_0x4b600a){if(_0x4b600a){_0x153076['model']=_[_0x85eb('0x3b')](db[_0x85eb('0x66')][_0x85eb('0x39')]);_0x153076[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x38c6ed[_0x85eb('0x3a')]);_0x153076[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x153076[_0x85eb('0x3e')],_0x153076[_0x85eb('0x3a')]);_0xa47647[_0x85eb('0x3f')]=_['intersection'](_0x153076[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x38c6ed['query'][_0x85eb('0x40')]));_0xa47647[_0x85eb('0x3f')]=_0xa47647[_0x85eb('0x3f')][_0x85eb('0x41')]?_0xa47647[_0x85eb('0x3f')]:_0x153076[_0x85eb('0x3e')];if(!_0x38c6ed['query']['hasOwnProperty'](_0x85eb('0x43'))){_0xa47647['limit']=qs[_0x85eb('0x23')](_0x38c6ed['query'][_0x85eb('0x23')]);_0xa47647[_0x85eb('0x22')]=qs['offset'](_0x38c6ed['query'][_0x85eb('0x22')]);}_0xa47647[_0x85eb('0x63')]=qs['sort'](_0x38c6ed[_0x85eb('0x3a')][_0x85eb('0x44')]);_0xa47647[_0x85eb('0x45')]=qs['filters'](_['pick'](_0x38c6ed[_0x85eb('0x3a')],_0x153076[_0x85eb('0x3c')]));_0xa47647[_0x85eb('0x45')][_0x85eb('0x64')]=_0x4b600a['id'];if(_0x38c6ed[_0x85eb('0x3a')][_0x85eb('0x49')]){_0xa47647[_0x85eb('0x45')]=_[_0x85eb('0x47')](_0xa47647[_0x85eb('0x45')],{'$or':_[_0x85eb('0x31')](_0xa47647['attributes'],function(_0x17a5f8){var _0x4d8d44={};_0x4d8d44[_0x17a5f8]={'$like':'%'+_0x38c6ed[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x4d8d44;})});}_0xa47647=_[_0x85eb('0x47')]({},_0xa47647,_0x38c6ed[_0x85eb('0x4a')]);return db[_0x85eb('0x66')]['count']({'where':_0xa47647[_0x85eb('0x45')]})[_0x85eb('0x2a')](function(_0x3bf9b4){_0x36001e['count']=_0x3bf9b4;if(_0x38c6ed[_0x85eb('0x3a')][_0x85eb('0x4b')]){_0xa47647[_0x85eb('0x4c')]=[{'all':!![]}];}return db[_0x85eb('0x66')][_0x85eb('0x4d')](_0xa47647);})[_0x85eb('0x2a')](function(_0x209800){_0x36001e[_0x85eb('0x4e')]=_0x209800;return _0x36001e;});}})[_0x85eb('0x2a')](respondWithFilteredResult(_0x5f1b02,_0xa47647))[_0x85eb('0x4f')](handleError(_0x5f1b02,null));};exports[_0x85eb('0x67')]=function(_0x2bd1b0,_0x19c26d,_0xfe9f80){var _0x1f04b9={'raw':!![],'where':{}};var _0x13c3b4={};var _0x576bc0={'count':0x0,'rows':[]};return db[_0x85eb('0x38')][_0x85eb('0x61')]({'where':{'id':_0x2bd1b0[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x19c26d,null))[_0x85eb('0x2a')](function(_0x1e75f2){if(_0x1e75f2){_0x13c3b4[_0x85eb('0x3e')]=_['keys'](db[_0x85eb('0x68')][_0x85eb('0x39')]);_0x13c3b4['query']=_[_0x85eb('0x3b')](_0x2bd1b0['query']);_0x13c3b4[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x13c3b4[_0x85eb('0x3e')],_0x13c3b4[_0x85eb('0x3a')]);_0x1f04b9[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x13c3b4[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x2bd1b0['query']['fields']));_0x1f04b9[_0x85eb('0x3f')]=_0x1f04b9[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x1f04b9[_0x85eb('0x3f')]:_0x13c3b4['model'];if(!_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x42')](_0x85eb('0x43'))){_0x1f04b9['limit']=qs[_0x85eb('0x23')](_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x23')]);_0x1f04b9['offset']=qs[_0x85eb('0x22')](_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x22')]);}_0x1f04b9['order']=qs[_0x85eb('0x44')](_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x44')]);_0x1f04b9[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_[_0x85eb('0x46')](_0x2bd1b0[_0x85eb('0x3a')],_0x13c3b4[_0x85eb('0x3c')]));_0x1f04b9[_0x85eb('0x45')]['VoiceQueueId']=_0x1e75f2['id'];if(_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x49')]){_0x1f04b9[_0x85eb('0x45')]=_[_0x85eb('0x47')](_0x1f04b9[_0x85eb('0x45')],{'$or':_[_0x85eb('0x31')](_0x1f04b9['attributes'],function(_0x56f23b){var _0x8bb0d={};_0x8bb0d[_0x56f23b]={'$like':'%'+_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x8bb0d;})});}_0x1f04b9=_[_0x85eb('0x47')]({},_0x1f04b9,_0x2bd1b0[_0x85eb('0x4a')]);return db[_0x85eb('0x68')][_0x85eb('0x21')]({'where':_0x1f04b9['where']})[_0x85eb('0x2a')](function(_0x460b51){_0x576bc0['count']=_0x460b51;if(_0x2bd1b0[_0x85eb('0x3a')][_0x85eb('0x4b')]){_0x1f04b9[_0x85eb('0x4c')]=[{'all':!![]}];}return db[_0x85eb('0x68')][_0x85eb('0x4d')](_0x1f04b9);})[_0x85eb('0x2a')](function(_0x16a330){_0x576bc0[_0x85eb('0x4e')]=_0x16a330;return _0x576bc0;});}})[_0x85eb('0x2a')](respondWithFilteredResult(_0x19c26d,_0x1f04b9))['catch'](handleError(_0x19c26d,null));};exports['getTeams']=function(_0x5ac026,_0xfd3251,_0x2edecb){var _0x27fd58={};var _0x413509={};var _0xdf17a;var _0x368f63;return db[_0x85eb('0x38')][_0x85eb('0x61')]({'where':{'id':_0x5ac026[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0xfd3251,null))['then'](function(_0xc37e2){if(_0xc37e2){_0xdf17a=_0xc37e2;_0x413509[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x69')][_0x85eb('0x39')]);_0x413509[_0x85eb('0x3a')]=_['keys'](_0x5ac026[_0x85eb('0x3a')]);_0x413509['filters']=_[_0x85eb('0x3d')](_0x413509['model'],_0x413509[_0x85eb('0x3a')]);_0x27fd58[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x413509[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x5ac026[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x27fd58[_0x85eb('0x3f')]=_0x27fd58['attributes']['length']?_0x27fd58[_0x85eb('0x3f')]:_0x413509[_0x85eb('0x3e')];_0x27fd58[_0x85eb('0x63')]=qs[_0x85eb('0x44')](_0x5ac026[_0x85eb('0x3a')]['sort']);_0x27fd58[_0x85eb('0x45')]=qs['filters'](_['pick'](_0x5ac026[_0x85eb('0x3a')],_0x413509[_0x85eb('0x3c')]));if(_0x5ac026['query'][_0x85eb('0x49')]){_0x27fd58[_0x85eb('0x45')]=_[_0x85eb('0x47')](_0x27fd58[_0x85eb('0x45')],{'$or':_[_0x85eb('0x31')](_0x27fd58['attributes'],function(_0xb25d3c){var _0x2dbee7={};_0x2dbee7[_0xb25d3c]={'$like':'%'+_0x5ac026[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x2dbee7;})});}_0x27fd58=_[_0x85eb('0x47')]({},_0x27fd58,_0x5ac026[_0x85eb('0x4a')]);return _0xdf17a[_0x85eb('0x6a')](_0x27fd58);}})[_0x85eb('0x2a')](function(_0x4033fc){if(_0x4033fc){_0x368f63=_0x4033fc[_0x85eb('0x41')];if(!_0x5ac026['query']['hasOwnProperty']('nolimit')){_0x27fd58[_0x85eb('0x23')]=qs[_0x85eb('0x23')](_0x5ac026[_0x85eb('0x3a')]['limit']);_0x27fd58[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x5ac026['query'][_0x85eb('0x22')]);}return _0xdf17a[_0x85eb('0x6a')](_0x27fd58);}})[_0x85eb('0x2a')](function(_0x4a5074){if(_0x4a5074){return _0x4a5074?{'count':_0x368f63,'rows':_0x4a5074}:null;}})['then'](respondWithResult(_0xfd3251,null))[_0x85eb('0x4f')](handleError(_0xfd3251,null));};exports[_0x85eb('0x6b')]=function(_0x37be49,_0x7c487a,_0x21ca8d){var _0x397fe2=_0x37be49[_0x85eb('0x53')][_0x85eb('0x6c')];return db['Team'][_0x85eb('0x4d')]({'where':{'id':_[_0x85eb('0x31')](_0x397fe2,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x85eb('0x6d'),'attributes':['id','name',_0x85eb('0x6e'),_0x85eb('0x6f'),_0x85eb('0x70')],'raw':!![]}]})[_0x85eb('0x2a')](function(_0x7f6063){if(_0x7f6063){var _0x59e85d=_[_0x85eb('0x71')](_0x7f6063,function(_0x5172d8){var _0x531d5a=_0x5172d8[_0x85eb('0x2b')]({'plain':!![]});_0x531d5a[_0x85eb('0x6d')]['forEach'](function(_0x457ea1){_0x457ea1['penalty']=_[_0x85eb('0x51')](_0x397fe2,{'id':_0x531d5a['id']})[_0x85eb('0x72')];});return _0x531d5a[_0x85eb('0x6d')];});return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x37be49[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](function(_0x3c56a5){return db['sequelize']['transaction'](function(_0x2e177a){return _0x3c56a5[_0x85eb('0x6b')](_[_0x85eb('0x31')](_0x397fe2,'id'),{'transaction':_0x2e177a})[_0x85eb('0x2a')](function(){return BPromise[_0x85eb('0x73')](_0x59e85d,function(_0x15cef6){return db[_0x85eb('0x74')][_0x85eb('0x75')]({'where':{'UserId':_0x15cef6['id'],'VoiceQueueId':_0x37be49[_0x85eb('0x5b')]['id']},'defaults':{'penalty':_0x15cef6[_0x85eb('0x72')]},'transaction':_0x2e177a});});})[_0x85eb('0x2a')](function(){return BPromise[_0x85eb('0x73')](_[_0x85eb('0x49')](_0x59e85d,{'online':!![]}),function(_0x4fd2c5){return db[_0x85eb('0x76')][_0x85eb('0x77')]({'membername':_0x4fd2c5['name'],'UserId':_0x4fd2c5['id'],'queue_name':_0x3c56a5['name'],'VoiceQueueId':_0x3c56a5['id'],'interface':_['isNil'](_0x4fd2c5[_0x85eb('0x70')])?util[_0x85eb('0x78')](_0x85eb('0x79'),_0x4fd2c5[_0x85eb('0x35')]):_0x4fd2c5['interface'],'paused':_0x4fd2c5[_0x85eb('0x6f')]||![],'penalty':_0x4fd2c5[_0x85eb('0x72')]},{'transaction':_0x2e177a});});})[_0x85eb('0x2a')](function(){_0x59e85d[_0x85eb('0x7a')](function(_0x3818db){socket['emit'](_0x85eb('0x7b'),{'UserId':_0x3818db['id'],'VoiceQueueId':_0x3c56a5['id']});});});});});}})[_0x85eb('0x2a')](respondWithStatusCode(_0x7c487a,null))['catch'](handleError(_0x7c487a,null));};exports[_0x85eb('0x7c')]=function(_0x3d2551,_0x44242b,_0x2a087d){return db[_0x85eb('0x69')][_0x85eb('0x4d')]({'where':{'id':_0x3d2551[_0x85eb('0x3a')][_0x85eb('0x7d')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44242b,null))[_0x85eb('0x2a')](function(_0x4af880){var _0x1ab9d1=_[_0x85eb('0x31')](_0x4af880,'id');var _0xb11d22=[];var _0x423abb=[];var _0x249659=squel[_0x85eb('0x7e')]();_0x249659['field'](_0x85eb('0x7f'))[_0x85eb('0x80')](_0x85eb('0x81'),'tq')[_0x85eb('0x82')](_0x85eb('0x83'),'ut',_0x85eb('0x84'))[_0x85eb('0x45')](_0x85eb('0x85'),_0x3d2551[_0x85eb('0x5b')]['id']);for(var _0x57ef2f=0x0;_0x57ef2f<_0x4af880[_0x85eb('0x41')];_0x57ef2f+=0x1){let _0x3aec49=_0x4af880[_0x57ef2f];for(var _0x4c8ad6=0x0;_0x4c8ad6<_0x3aec49[_0x85eb('0x6d')][_0x85eb('0x41')];_0x4c8ad6+=0x1){let _0x194aa5=_0x3aec49[_0x85eb('0x6d')][_0x4c8ad6];var _0x401936=_0x249659[_0x85eb('0x86')]();_0x401936['where'](_0x85eb('0x87'),_0x194aa5['id']);_0x423abb[_0x85eb('0x88')](db['sequelize']['query'](_0x401936[_0x85eb('0x89')](),{'type':db[_0x85eb('0x8a')]['QueryTypes'][_0x85eb('0x8b')]})[_0x85eb('0x2a')](function(_0x535471){if(_0x535471[_0x85eb('0x41')]===0x1){return _0x194aa5['id'];}else{var _0x1cc31b=_[_0x85eb('0x8c')](_[_0x85eb('0x31')](_0x535471,_0x85eb('0x8d')),function(_0x49708e){return _['includes'](_0x1ab9d1,_0x49708e);});if(_0x1cc31b){return _0x194aa5['id'];}}}));}}return BPromise[_0x85eb('0x8e')](_0x423abb)[_0x85eb('0x2a')](function(_0x21c63e){_0xb11d22=_(_0xb11d22)[_0x85eb('0x8f')](_0x21c63e)[_0x85eb('0x90')]()[_0x85eb('0x32')]();return db[_0x85eb('0x38')]['find']({'where':{'id':_0x3d2551[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](function(_0x4200c3){return db[_0x85eb('0x8a')][_0x85eb('0x91')](function(_0x2fbf4e){return _0x4200c3[_0x85eb('0x7c')](_0x3d2551[_0x85eb('0x3a')][_0x85eb('0x7d')],{'transaction':_0x2fbf4e})[_0x85eb('0x2a')](function(){if(!_['isEmpty'](_0xb11d22)){return _0x4200c3[_0x85eb('0x92')](_0xb11d22,{'transaction':_0x2fbf4e})[_0x85eb('0x2a')](function(){return db[_0x85eb('0x76')][_0x85eb('0x29')]({'where':{'VoiceQueueId':_0x3d2551[_0x85eb('0x5b')]['id'],'UserId':_0xb11d22},'transaction':_0x2fbf4e});});}})['then'](function(){_0xb11d22['forEach'](function(_0x1360a8){socket[_0x85eb('0x93')](_0x85eb('0x94'),{'UserId':_0x1360a8,'VoiceQueueId':_0x4200c3['id']});});});});});});})[_0x85eb('0x2a')](respondWithStatusCode(_0x44242b,null))[_0x85eb('0x4f')](handleError(_0x44242b,null));};exports[_0x85eb('0x95')]=function(_0x57e36f,_0x149793,_0x43be9e){var _0x113c06,_0x5532b3;return db[_0x85eb('0x38')]['find']({'where':{'id':_0x57e36f[_0x85eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x149793,null))[_0x85eb('0x2a')](function(_0x44d473){if(_0x44d473){_0x5532b3=_0x44d473;return _0x44d473[_0x85eb('0x95')](_0x57e36f['body'][_0x85eb('0x7d')],_[_0x85eb('0x5c')](_0x57e36f[_0x85eb('0x53')],[_0x85eb('0x7d'),'id'])||{})['spread'](function(_0x2718ac){for(var _0x1cc81b=0x0;_0x1cc81b<_0x57e36f['body'][_0x85eb('0x7d')][_0x85eb('0x41')];_0x1cc81b+=0x1){socket[_0x85eb('0x93')]('userVoiceQueue:save',{'UserId':_0x57e36f['body'][_0x85eb('0x7d')][_0x1cc81b],'VoiceQueueId':_0x57e36f[_0x85eb('0x5b')]['id']});}return _0x2718ac;});}})[_0x85eb('0x2a')](function(_0x31b94b){_0x113c06=_0x31b94b||[];if(_0x5532b3){return db[_0x85eb('0x96')]['findAll']({'where':{'id':_0x57e36f[_0x85eb('0x53')][_0x85eb('0x7d')]},'attributes':['id','name',_0x85eb('0x6e'),_0x85eb('0x6f'),_0x85eb('0x70')],'raw':!![]});}})[_0x85eb('0x2a')](function(_0x4ba2c7){if(!_['isEmpty'](_0x4ba2c7)){var _0x2039f2=[];for(var _0x21dbce=0x0;_0x21dbce<_0x4ba2c7['length'];_0x21dbce++){if(_0x4ba2c7[_0x21dbce]['online']){_0x2039f2[_0x85eb('0x88')](db[_0x85eb('0x76')][_0x85eb('0x77')]({'membername':_0x4ba2c7[_0x21dbce]['name'],'UserId':_0x4ba2c7[_0x21dbce]['id'],'queue_name':_0x5532b3[_0x85eb('0x35')],'VoiceQueueId':_0x5532b3['id'],'interface':_[_0x85eb('0x97')](_0x4ba2c7[_0x21dbce]['interface'])?util[_0x85eb('0x78')](_0x85eb('0x79'),_0x4ba2c7[_0x21dbce][_0x85eb('0x35')]):_0x4ba2c7[_0x21dbce][_0x85eb('0x70')],'paused':_0x4ba2c7[_0x21dbce][_0x85eb('0x6f')]||![],'penalty':_0x57e36f[_0x85eb('0x53')]['penalty']||0x0}));}}return BPromise[_0x85eb('0x8e')](_0x2039f2);}})[_0x85eb('0x2a')](function(){return _0x113c06;})[_0x85eb('0x2a')](respondWithResult(_0x149793,null))['catch'](handleError(_0x149793,null));};exports['removeAgents']=function(_0x4b1c73,_0x69bd42,_0x5ad172){return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x4b1c73[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x69bd42,null))[_0x85eb('0x2a')](function(_0x3d04e7){if(_0x3d04e7){return _0x3d04e7[_0x85eb('0x92')](_0x4b1c73['query'][_0x85eb('0x7d')])[_0x85eb('0x2a')](function(){if(_[_0x85eb('0x98')](_0x4b1c73[_0x85eb('0x3a')][_0x85eb('0x7d')])){for(var _0x19ac26=0x0;_0x19ac26<_0x4b1c73[_0x85eb('0x3a')][_0x85eb('0x7d')][_0x85eb('0x41')];_0x19ac26+=0x1){socket[_0x85eb('0x93')](_0x85eb('0x94'),{'UserId':Number(_0x4b1c73[_0x85eb('0x3a')][_0x85eb('0x7d')][_0x19ac26]),'VoiceQueueId':Number(_0x4b1c73[_0x85eb('0x5b')]['id'])});}}else{socket[_0x85eb('0x93')]('userVoiceQueue:remove',{'UserId':Number(_0x4b1c73[_0x85eb('0x3a')][_0x85eb('0x7d')]),'VoiceQueueId':Number(_0x4b1c73[_0x85eb('0x5b')]['id'])});}});}})[_0x85eb('0x2a')](function(_0x4d4b2c){return db[_0x85eb('0x76')][_0x85eb('0x29')]({'where':{'VoiceQueueId':_0x4b1c73[_0x85eb('0x5b')]['id'],'UserId':_0x4b1c73[_0x85eb('0x3a')][_0x85eb('0x7d')]}})[_0x85eb('0x2a')](function(){return _0x4d4b2c;});})['then'](respondWithStatusCode(_0x69bd42,null))['catch'](handleError(_0x69bd42,null));};exports['getAgents']=function(_0x181239,_0xb58762,_0x163b1a){var _0x4b4144={};var _0x3f2c6d={};var _0x2997b6;var _0x5c767d;return db[_0x85eb('0x38')][_0x85eb('0x61')]({'where':{'id':_0x181239[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0xb58762,null))[_0x85eb('0x2a')](function(_0x2a19fc){if(_0x2a19fc){_0x2997b6=_0x2a19fc;_0x3f2c6d[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x96')][_0x85eb('0x39')]);_0x3f2c6d[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x181239['query']);_0x3f2c6d[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x3f2c6d['model'],_0x3f2c6d[_0x85eb('0x3a')]);_0x4b4144['attributes']=_[_0x85eb('0x3d')](_0x3f2c6d[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x181239[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x4b4144[_0x85eb('0x3f')]=_0x4b4144[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x4b4144['attributes']:_0x3f2c6d['model'];_0x4b4144[_0x85eb('0x63')]=qs[_0x85eb('0x44')](_0x181239['query'][_0x85eb('0x44')]);_0x4b4144[_0x85eb('0x45')]=qs['filters'](_[_0x85eb('0x46')](_0x181239[_0x85eb('0x3a')],_0x3f2c6d[_0x85eb('0x3c')]));if(_0x181239['query'][_0x85eb('0x49')]){_0x4b4144['where']=_[_0x85eb('0x47')](_0x4b4144[_0x85eb('0x45')],{'$or':_[_0x85eb('0x31')](_0x4b4144[_0x85eb('0x3f')],function(_0x52066b){var _0x2ba8c0={};_0x2ba8c0[_0x52066b]={'$like':'%'+_0x181239[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x2ba8c0;})});}_0x4b4144=_[_0x85eb('0x47')]({},_0x4b4144,_0x181239['options']);return _0x2997b6[_0x85eb('0x99')](_0x4b4144);}})[_0x85eb('0x2a')](function(_0x29b47a){if(_0x29b47a){_0x5c767d=_0x29b47a[_0x85eb('0x41')];if(!_0x181239[_0x85eb('0x3a')][_0x85eb('0x42')]('nolimit')){_0x4b4144[_0x85eb('0x23')]=qs[_0x85eb('0x23')](_0x181239['query']['limit']);_0x4b4144[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x181239[_0x85eb('0x3a')][_0x85eb('0x22')]);}return _0x2997b6[_0x85eb('0x99')](_0x4b4144);}})[_0x85eb('0x2a')](function(_0x278767){if(_0x278767){return _0x278767?{'count':_0x5c767d,'rows':_0x278767}:null;}})[_0x85eb('0x2a')](respondWithResult(_0xb58762,null))[_0x85eb('0x4f')](handleError(_0xb58762,null));};exports['getMembers']=function(_0x9de08a,_0x468745,_0x36c722){var _0x24ab53={};var _0x2cd5a3={};var _0x18078b;var _0x382a36;return db['VoiceQueue'][_0x85eb('0x61')]({'where':{'id':_0x9de08a[_0x85eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x468745,null))['then'](function(_0x3e3d6d){if(_0x3e3d6d){_0x18078b=_0x3e3d6d;_0x2cd5a3[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x76')]['rawAttributes']);_0x2cd5a3['query']=_[_0x85eb('0x3b')](_0x9de08a['query']);_0x2cd5a3[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x2cd5a3[_0x85eb('0x3e')],_0x2cd5a3['query']);_0x24ab53['attributes']=_[_0x85eb('0x3d')](_0x2cd5a3[_0x85eb('0x3e')],qs[_0x85eb('0x40')](_0x9de08a[_0x85eb('0x3a')]['fields']));_0x24ab53[_0x85eb('0x3f')]=_0x24ab53[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x24ab53['attributes']:_0x2cd5a3[_0x85eb('0x3e')];_0x24ab53['order']=qs['sort'](_0x9de08a[_0x85eb('0x3a')][_0x85eb('0x44')]);_0x24ab53[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_['pick'](_0x9de08a[_0x85eb('0x3a')],_0x2cd5a3[_0x85eb('0x3c')]));if(_0x9de08a[_0x85eb('0x3a')][_0x85eb('0x49')]){_0x24ab53[_0x85eb('0x45')]=_[_0x85eb('0x47')](_0x24ab53[_0x85eb('0x45')],{'$or':_['map'](_0x24ab53[_0x85eb('0x3f')],function(_0xa52152){var _0x44901e={};_0x44901e[_0xa52152]={'$like':'%'+_0x9de08a[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x44901e;})});}_0x24ab53=_['merge']({},_0x24ab53,_0x9de08a[_0x85eb('0x4a')]);return _0x18078b[_0x85eb('0x9a')](_0x24ab53);}})[_0x85eb('0x2a')](function(_0x1e5cd0){if(_0x1e5cd0){_0x382a36=_0x1e5cd0['length'];if(!_0x9de08a[_0x85eb('0x3a')][_0x85eb('0x42')](_0x85eb('0x43'))){_0x24ab53['limit']=qs[_0x85eb('0x23')](_0x9de08a[_0x85eb('0x3a')][_0x85eb('0x23')]);_0x24ab53[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x9de08a['query'][_0x85eb('0x22')]);}return _0x18078b['getMembers'](_0x24ab53);}})[_0x85eb('0x2a')](function(_0x54fcac){return _0x54fcac?{'count':_0x382a36,'rows':_0x54fcac}:null;})['then'](respondWithResult(_0x468745,null))['catch'](handleError(_0x468745,null));};exports['getLists']=function(_0x30eeb7,_0x3dc024,_0x5db7df){var _0x518051={};var _0x207537={};var _0x532769;var _0x590d0d;return db['VoiceQueue'][_0x85eb('0x61')]({'where':{'id':_0x30eeb7[_0x85eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3dc024,null))['then'](function(_0x13364f){if(_0x13364f){_0x532769=_0x13364f;_0x207537[_0x85eb('0x3e')]=_['keys'](db[_0x85eb('0x9b')][_0x85eb('0x39')]);_0x207537[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x30eeb7[_0x85eb('0x3a')]);_0x207537[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x207537[_0x85eb('0x3e')],_0x207537[_0x85eb('0x3a')]);_0x518051[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x207537[_0x85eb('0x3e')],qs['fields'](_0x30eeb7[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x518051[_0x85eb('0x3f')]=_0x518051[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x518051[_0x85eb('0x3f')]:_0x207537[_0x85eb('0x3e')];_0x518051[_0x85eb('0x63')]=qs[_0x85eb('0x44')](_0x30eeb7[_0x85eb('0x3a')][_0x85eb('0x44')]);_0x518051[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_['pick'](_0x30eeb7['query'],_0x207537[_0x85eb('0x3c')]));if(_0x30eeb7[_0x85eb('0x3a')][_0x85eb('0x49')]){_0x518051[_0x85eb('0x45')]=_['merge'](_0x518051[_0x85eb('0x45')],{'$or':_[_0x85eb('0x31')](_0x518051['attributes'],function(_0x1f4e87){var _0x1c3ed4={};_0x1c3ed4[_0x1f4e87]={'$like':'%'+_0x30eeb7[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x1c3ed4;})});}_0x518051=_['merge']({},_0x518051,_0x30eeb7[_0x85eb('0x4a')]);return _0x532769[_0x85eb('0x9c')](_0x518051);}})[_0x85eb('0x2a')](function(_0x3b564c){if(_0x3b564c){_0x590d0d=_0x3b564c[_0x85eb('0x41')];if(!_0x30eeb7['query'][_0x85eb('0x42')](_0x85eb('0x43'))){_0x518051[_0x85eb('0x23')]=qs[_0x85eb('0x23')](_0x30eeb7[_0x85eb('0x3a')]['limit']);_0x518051[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x30eeb7['query'][_0x85eb('0x22')]);}return _0x532769[_0x85eb('0x9c')](_0x518051);}})[_0x85eb('0x2a')](function(_0x4675d1){if(_0x4675d1){return _0x4675d1?{'count':_0x590d0d,'rows':_0x4675d1}:null;}})[_0x85eb('0x2a')](respondWithResult(_0x3dc024,null))[_0x85eb('0x4f')](handleError(_0x3dc024,null));};exports['addLists']=function(_0x311c09,_0x3a1e0e,_0x1af034){var _0x3cc838,_0x185691;return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x311c09[_0x85eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3a1e0e,null))[_0x85eb('0x2a')](function(_0x48591e){if(_0x48591e){_0x185691=_0x48591e;return _0x48591e['addLists'](_0x311c09['body']['ids'],_[_0x85eb('0x5c')](_0x311c09[_0x85eb('0x53')],[_0x85eb('0x7d'),'id'])||{});}return null;})[_0x85eb('0x9d')](function(_0x5402b9){var _0x64f58;_0x3cc838=_0x5402b9||[];var _0x336322=[];if(_0x5402b9){for(var _0x141c19=0x0;_0x141c19<_0x5402b9[_0x85eb('0x41')];_0x141c19+=0x1){var _0x43c8c9=_0x5402b9[_0x141c19][_0x85eb('0x2b')]({'plain':!![]});_0x185691[_0x85eb('0x9e')]=_0x311c09[_0x85eb('0x53')][_0x85eb('0x9e')]?_0x311c09[_0x85eb('0x53')][_0x85eb('0x9e')]:_0x185691[_0x85eb('0x9e')];switch(_0x185691['dialCheckDuplicateType']){case _0x85eb('0x9f'):_0x64f58=squel[_0x85eb('0xa0')]()[_0x85eb('0xa1')](_0x85eb('0xa2'))['fromQuery']([_0x85eb('0xa3'),_0x85eb('0xa4'),_0x85eb('0xa5'),_0x85eb('0xa6'),'VoiceQueueId','createdAt',_0x85eb('0x5d')],squel[_0x85eb('0x7e')]()[_0x85eb('0xa7')](_0x85eb('0xa3'),_0x85eb('0xa3'))['field']('NOW()',_0x85eb('0xa4'))[_0x85eb('0xa7')]('id',_0x85eb('0xa5'))[_0x85eb('0xa7')](_0x43c8c9[_0x85eb('0xa8')][_0x85eb('0x89')](),'ListId')['field'](_0x311c09[_0x85eb('0x5b')]['id'][_0x85eb('0x89')](),_0x85eb('0x64'))[_0x85eb('0xa7')]('NOW()','createdAt')[_0x85eb('0xa7')]('NOW()',_0x85eb('0x5d'))[_0x85eb('0x80')](_0x85eb('0xa9'))[_0x85eb('0x45')](_0x85eb('0xaa'))[_0x85eb('0x45')](_0x85eb('0xab'),_0x43c8c9[_0x85eb('0xa8')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x85eb('0xac'),squel[_0x85eb('0x7e')]()[_0x85eb('0xa7')](_0x85eb('0xad'))[_0x85eb('0x80')](_0x85eb('0xae'))[_0x85eb('0x45')](_0x85eb('0x85'),_0x311c09[_0x85eb('0x5b')]['id']['toString']()))[_0x85eb('0x45')](_0x85eb('0xac'),squel[_0x85eb('0x7e')]()['field']('COALESCE(phone,\x27\x27)')[_0x85eb('0x80')]('cm_hopper')['where'](_0x85eb('0x85'),_0x311c09[_0x85eb('0x5b')]['id']['toString']())))['toString']();break;case _0x85eb('0xaf'):_0x64f58=squel[_0x85eb('0xa0')]()[_0x85eb('0xa1')]('cm_hopper')[_0x85eb('0xb0')]([_0x85eb('0xa3'),_0x85eb('0xa4'),_0x85eb('0xa5'),_0x85eb('0xa6'),_0x85eb('0x64'),'createdAt','updatedAt'],squel[_0x85eb('0x7e')]()[_0x85eb('0xa7')](_0x85eb('0xa3'),'phone')['field'](_0x85eb('0xb1'),_0x85eb('0xa4'))[_0x85eb('0xa7')]('id','ContactId')[_0x85eb('0xa7')](_0x43c8c9[_0x85eb('0xa8')][_0x85eb('0x89')](),'ListId')[_0x85eb('0xa7')](_0x311c09[_0x85eb('0x5b')]['id']['toString'](),_0x85eb('0x64'))[_0x85eb('0xa7')](_0x85eb('0xb1'),'createdAt')[_0x85eb('0xa7')](_0x85eb('0xb1'),_0x85eb('0x5d'))[_0x85eb('0x80')](_0x85eb('0xa9'))[_0x85eb('0x45')](_0x85eb('0xaa'))[_0x85eb('0x45')](_0x85eb('0xab'),_0x43c8c9[_0x85eb('0xa8')][_0x85eb('0x89')]())[_0x85eb('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x85eb('0x45')](_0x85eb('0xac'),squel[_0x85eb('0x7e')]()['field'](_0x85eb('0xb2'))[_0x85eb('0x80')](_0x85eb('0xa2'))[_0x85eb('0x45')](_0x85eb('0x85'),_0x311c09['params']['id'][_0x85eb('0x89')]())))['toString']();break;default:_0x64f58=squel[_0x85eb('0xa0')]()[_0x85eb('0xa1')](_0x85eb('0xa2'))[_0x85eb('0xb0')]([_0x85eb('0xa3'),'scheduledAt',_0x85eb('0xa5'),_0x85eb('0xa6'),_0x85eb('0x64'),_0x85eb('0x5e'),_0x85eb('0x5d')],squel['select']()[_0x85eb('0xa7')]('phone',_0x85eb('0xa3'))['field']('NOW()',_0x85eb('0xa4'))[_0x85eb('0xa7')]('id',_0x85eb('0xa5'))[_0x85eb('0xa7')](_0x43c8c9[_0x85eb('0xa8')][_0x85eb('0x89')](),'ListId')[_0x85eb('0xa7')](_0x311c09[_0x85eb('0x5b')]['id']['toString'](),'VoiceQueueId')['field'](_0x85eb('0xb1'),_0x85eb('0x5e'))[_0x85eb('0xa7')]('NOW()',_0x85eb('0x5d'))[_0x85eb('0x80')](_0x85eb('0xa9'))[_0x85eb('0x45')](_0x85eb('0xaa'))['where'](_0x85eb('0xab'),_0x43c8c9['CmListId'][_0x85eb('0x89')]())['where'](_0x85eb('0xb3')))[_0x85eb('0x89')]();}_0x336322[_0x85eb('0x88')](db[_0x85eb('0x8a')]['query'](_0x64f58));}return BPromise[_0x85eb('0x8e')](_0x336322);}})[_0x85eb('0x2a')](function(){return _0x3cc838;})[_0x85eb('0x2a')](respondWithResult(_0x3a1e0e,null))[_0x85eb('0x4f')](handleError(_0x3a1e0e,null));};exports[_0x85eb('0xb4')]=function(_0x289594,_0x1145f3,_0x50f578){return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x289594[_0x85eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1145f3,null))[_0x85eb('0x2a')](function(_0x1406b3){if(_0x1406b3){return _0x1406b3[_0x85eb('0xb4')](_0x289594[_0x85eb('0x3a')][_0x85eb('0x7d')]);}})['then'](function(_0x38dab1){if(_0x38dab1){return db[_0x85eb('0x62')][_0x85eb('0x29')]({'where':{'ListId':_0x289594[_0x85eb('0x3a')][_0x85eb('0x7d')],'VoiceQueueId':_0x289594[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](function(){return _0x38dab1;});}})[_0x85eb('0x2a')](respondWithStatusCode(_0x1145f3,null))[_0x85eb('0x4f')](handleError(_0x1145f3,null));};exports[_0x85eb('0xb5')]=function(_0x1abda4,_0x14bc70,_0x4633ce){var _0x525da7={};var _0x49d6cd={};var _0x23ce17;var _0x547bf3;return db[_0x85eb('0x38')][_0x85eb('0x61')]({'where':{'id':_0x1abda4[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x14bc70,null))[_0x85eb('0x2a')](function(_0x2ac2d7){if(_0x2ac2d7){_0x23ce17=_0x2ac2d7;_0x49d6cd[_0x85eb('0x3e')]=_[_0x85eb('0x3b')](db[_0x85eb('0x9b')][_0x85eb('0x39')]);_0x49d6cd[_0x85eb('0x3a')]=_[_0x85eb('0x3b')](_0x1abda4['query']);_0x49d6cd[_0x85eb('0x3c')]=_[_0x85eb('0x3d')](_0x49d6cd[_0x85eb('0x3e')],_0x49d6cd[_0x85eb('0x3a')]);_0x525da7[_0x85eb('0x3f')]=_[_0x85eb('0x3d')](_0x49d6cd[_0x85eb('0x3e')],qs['fields'](_0x1abda4[_0x85eb('0x3a')][_0x85eb('0x40')]));_0x525da7[_0x85eb('0x3f')]=_0x525da7[_0x85eb('0x3f')][_0x85eb('0x41')]?_0x525da7[_0x85eb('0x3f')]:_0x49d6cd[_0x85eb('0x3e')];_0x525da7['order']=qs['sort'](_0x1abda4[_0x85eb('0x3a')][_0x85eb('0x44')]);_0x525da7[_0x85eb('0x45')]=qs[_0x85eb('0x3c')](_[_0x85eb('0x46')](_0x1abda4[_0x85eb('0x3a')],_0x49d6cd[_0x85eb('0x3c')]));if(_0x1abda4[_0x85eb('0x3a')][_0x85eb('0x49')]){_0x525da7[_0x85eb('0x45')]=_['merge'](_0x525da7[_0x85eb('0x45')],{'$or':_['map'](_0x525da7[_0x85eb('0x3f')],function(_0x42bfdd){var _0x9af341={};_0x9af341[_0x42bfdd]={'$like':'%'+_0x1abda4[_0x85eb('0x3a')][_0x85eb('0x49')]+'%'};return _0x9af341;})});}_0x525da7=_[_0x85eb('0x47')]({},_0x525da7,_0x1abda4[_0x85eb('0x4a')]);return _0x23ce17[_0x85eb('0xb5')](_0x525da7);}})[_0x85eb('0x2a')](function(_0x9b3db0){if(_0x9b3db0){_0x547bf3=_0x9b3db0['length'];if(!_0x1abda4['query'][_0x85eb('0x42')](_0x85eb('0x43'))){_0x525da7[_0x85eb('0x23')]=qs[_0x85eb('0x23')](_0x1abda4[_0x85eb('0x3a')][_0x85eb('0x23')]);_0x525da7[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x1abda4['query']['offset']);}return _0x23ce17['getBlackLists'](_0x525da7);}})[_0x85eb('0x2a')](function(_0x21c3e6){if(_0x21c3e6){return _0x21c3e6?{'count':_0x547bf3,'rows':_0x21c3e6}:null;}})[_0x85eb('0x2a')](respondWithResult(_0x14bc70,null))[_0x85eb('0x4f')](handleError(_0x14bc70,null));};exports['addBlackLists']=function(_0x61bc22,_0x58eb99,_0x5430e5){var _0x4f1121,_0x19baed;return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x61bc22['params']['id']}})['then'](handleEntityNotFound(_0x58eb99,null))[_0x85eb('0x2a')](function(_0x59a4ff){if(_0x59a4ff){_0x19baed=_0x59a4ff;return _0x59a4ff[_0x85eb('0xb6')](_0x61bc22[_0x85eb('0x53')][_0x85eb('0x7d')],_[_0x85eb('0x5c')](_0x61bc22['body'],[_0x85eb('0x7d'),'id'])||{});}return null;})[_0x85eb('0x9d')](function(_0x4634ac){var _0x3f08a7;_0x4f1121=_0x4634ac||[];var _0x392b7b=[];if(_0x4634ac){for(var _0x2af3cf=0x0;_0x2af3cf<_0x4634ac['length'];_0x2af3cf+=0x1){var _0x154c5b=_0x4634ac[_0x2af3cf][_0x85eb('0x2b')]({'plain':!![]});_0x3f08a7=squel['insert']()[_0x85eb('0xa1')](_0x85eb('0xb7'))['fromQuery']([_0x85eb('0xa3'),_0x85eb('0xa5'),'ListId',_0x85eb('0x64'),_0x85eb('0x5e'),_0x85eb('0x5d')],squel[_0x85eb('0x7e')]()['field'](_0x85eb('0xa3'),_0x85eb('0xa3'))[_0x85eb('0xa7')]('id',_0x85eb('0xa5'))[_0x85eb('0xa7')](_0x154c5b[_0x85eb('0xa8')][_0x85eb('0x89')](),'ListId')[_0x85eb('0xa7')](_0x61bc22[_0x85eb('0x5b')]['id'][_0x85eb('0x89')](),'VoiceQueueId')[_0x85eb('0xa7')]('NOW()',_0x85eb('0x5e'))[_0x85eb('0xa7')](_0x85eb('0xb1'),_0x85eb('0x5d'))[_0x85eb('0x80')](_0x85eb('0xa9'))[_0x85eb('0x45')]('deletedAt\x20IS\x20NULL')[_0x85eb('0x45')](_0x85eb('0xab'),_0x154c5b[_0x85eb('0xa8')]['toString']())[_0x85eb('0x45')](_0x85eb('0xb3')))[_0x85eb('0x89')]();_0x392b7b[_0x85eb('0x88')](db['sequelize']['query'](_0x3f08a7));}return BPromise[_0x85eb('0x8e')](_0x392b7b);}})[_0x85eb('0x2a')](function(){return _0x4f1121;})[_0x85eb('0x2a')](respondWithResult(_0x58eb99,null))[_0x85eb('0x4f')](handleError(_0x58eb99,null));};exports['removeBlackLists']=function(_0x1fda19,_0x3588f4,_0x58f8fc){return db[_0x85eb('0x38')][_0x85eb('0x51')]({'where':{'id':_0x1fda19[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](handleEntityNotFound(_0x3588f4,null))['then'](function(_0x54e429){if(_0x54e429){return _0x54e429[_0x85eb('0xb8')](_0x1fda19[_0x85eb('0x3a')][_0x85eb('0x7d')]);}})[_0x85eb('0x2a')](function(_0x1824ab){if(_0x1824ab){return db[_0x85eb('0x68')][_0x85eb('0x29')]({'where':{'ListId':_0x1fda19[_0x85eb('0x3a')][_0x85eb('0x7d')],'VoiceQueueId':_0x1fda19[_0x85eb('0x5b')]['id']}})[_0x85eb('0x2a')](function(){return _0x1824ab;});}})[_0x85eb('0x2a')](respondWithStatusCode(_0x3588f4,null))[_0x85eb('0x4f')](handleError(_0x3588f4,null));}; \ No newline at end of file +var _0xd7d1=['inbound','findOne','CmHopper','VoiceQueueId','count','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','forEach','penalty','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','sequelize','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','online','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','into','removeLists','getBlackLists','CmList','addBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./voiceQueue.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','QueueCampaigns','filter','ignore','map','value','includes','type','name','error','stack','send','index','VoiceQueue','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','field','includeAll','include','findAll','catch','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','createdAt','updatedAt'];(function(_0x1fc337,_0x305370){var _0x23dd4e=function(_0x3fb85c){while(--_0x3fb85c){_0x1fc337['push'](_0x1fc337['shift']());}};_0x23dd4e(++_0x305370);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x41e967,_0x3c3530){_0x41e967=_0x41e967-0x0;var _0x3e081e=_0xd7d1[_0x41e967];return _0x3e081e;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x17'))('api');var utils=require(_0x1d7d('0x18'));var config=require(_0x1d7d('0x19'));var db=require(_0x1d7d('0x1a'))['db'];config[_0x1d7d('0x1b')]=_['defaults'](config[_0x1d7d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d7d('0x1b')]));require(_0x1d7d('0x1c'))['register'](socket);function respondWithStatusCode(_0x55dba7,_0x1d3822){_0x1d3822=_0x1d3822||0xcc;return function(_0x334e78){if(_0x334e78){return _0x55dba7[_0x1d7d('0x1d')](_0x1d3822);}return _0x55dba7[_0x1d7d('0x1e')](_0x1d3822)[_0x1d7d('0x1f')]();};}function respondWithResult(_0x53423f,_0x28adf3){_0x28adf3=_0x28adf3||0xc8;return function(_0x1de6cc){if(_0x1de6cc){return _0x53423f['status'](_0x28adf3)[_0x1d7d('0x20')](_0x1de6cc);}};}function respondWithFilteredResult(_0x162c3a,_0x3c3417){return function(_0x47826a){if(_0x47826a){var _0x40db4d=_0x47826a['count'],_0x4db4f2=_0x3c3417['offset'],_0x664e3f=_0x3c3417[_0x1d7d('0x21')]+_0x3c3417[_0x1d7d('0x22')],_0x191024;if(_0x664e3f>=_0x40db4d){_0x664e3f=_0x40db4d;_0x191024=0xc8;}else{_0x191024=0xce;}_0x162c3a[_0x1d7d('0x1e')](_0x191024);return _0x162c3a[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x4db4f2+'-'+_0x664e3f+'/'+_0x40db4d)[_0x1d7d('0x20')](_0x47826a);}return null;};}function patchUpdates(_0x54d401){return function(_0x225f85){try{jsonpatch[_0x1d7d('0x25')](_0x225f85,_0x54d401,!![]);}catch(_0x3a93d0){return BPromise['reject'](_0x3a93d0);}return _0x225f85[_0x1d7d('0x26')]();};}function saveUpdates(_0x12c54b,_0x4a1cdc){return function(_0x5950bd){if(_0x5950bd){return _0x5950bd[_0x1d7d('0x27')](_0x12c54b)[_0x1d7d('0x28')](function(_0x3d631f){return _0x3d631f;});}return null;};}function removeEntity(_0x5097b8,_0x377653){return function(_0x106376){if(_0x106376){return _0x106376[_0x1d7d('0x29')]()[_0x1d7d('0x28')](function(){var _0x4fa346=_0x106376[_0x1d7d('0x2a')]({'plain':!![]});var _0x151198=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x1d7d('0x2b'),'value':'outbound','ignore':![]}];var _0x38c323=_(_0x151198)[_0x1d7d('0x2c')](_0x1d7d('0x2d'))[_0x1d7d('0x2e')](_0x1d7d('0x2f'))['value']();if(_[_0x1d7d('0x30')](_0x38c323,_0x4fa346[_0x1d7d('0x31')])){return;}var _0x352d5a=_['find'](_0x151198,[_0x1d7d('0x2f'),_0x4fa346[_0x1d7d('0x31')]])[_0x1d7d('0x32')];return db['UserProfileResource']['destroy']({'where':{'type':_0x352d5a,'resourceId':_0x4fa346['id']}})['then'](function(){return _0x106376;});})[_0x1d7d('0x28')](function(){_0x5097b8[_0x1d7d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebcbc,_0x3e4136){return function(_0x16a81d){if(!_0x16a81d){_0x1ebcbc[_0x1d7d('0x1d')](0x194);}return _0x16a81d;};}function handleError(_0x342f4e,_0x22fec9){_0x22fec9=_0x22fec9||0x1f4;return function(_0x452293){logger[_0x1d7d('0x33')](_0x452293[_0x1d7d('0x34')]);if(_0x452293[_0x1d7d('0x32')]){delete _0x452293['name'];}_0x342f4e['status'](_0x22fec9)[_0x1d7d('0x35')](_0x452293);};}exports[_0x1d7d('0x36')]=function(_0x90e852,_0x40318f){var _0x1d5dc5={},_0x16d652={},_0x1aee3c={'count':0x0,'rows':[]};var _0x40aca9=db[_0x1d7d('0x37')]['rawAttributes'];_0x16d652[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](_0x40aca9);_0x16d652[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x90e852['query']);_0x16d652['filters']=_[_0x1d7d('0x3b')](_0x16d652[_0x1d7d('0x38')],_0x16d652['query']);_0x1d5dc5[_0x1d7d('0x3c')]=_[_0x1d7d('0x3b')](_0x16d652['model'],qs['fields'](_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x1d5dc5[_0x1d7d('0x3c')]=_0x1d5dc5[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x1d5dc5[_0x1d7d('0x3c')]:_0x16d652[_0x1d7d('0x38')];if(!_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x1d5dc5['limit']=qs['limit'](_0x90e852['query']['limit']);_0x1d5dc5[_0x1d7d('0x21')]=qs['offset'](_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}_0x1d5dc5[_0x1d7d('0x41')]=qs['sort'](_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x1d5dc5[_0x1d7d('0x43')]=qs['filters'](_[_0x1d7d('0x44')](_0x90e852[_0x1d7d('0x3a')],_0x16d652[_0x1d7d('0x45')]));if(_0x90e852[_0x1d7d('0x3a')]['filter']){_0x1d5dc5[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x1d5dc5[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x40aca9,function(_0x5049ff){if(_0x5049ff[_0x1d7d('0x31')]['key']!==_0x1d7d('0x47')){var _0x31b850={};_0x31b850[_0x5049ff[_0x1d7d('0x48')]]={'$like':'%'+_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x2c')]+'%'};return _0x31b850;}})});}_0x1d5dc5=_['merge']({},_0x1d5dc5,_0x90e852['options']);var _0x33582a={'where':_0x1d5dc5[_0x1d7d('0x43')]};return db[_0x1d7d('0x37')]['count'](_0x33582a)['then'](function(_0x12f397){_0x1aee3c['count']=_0x12f397;if(_0x90e852[_0x1d7d('0x3a')][_0x1d7d('0x49')]){_0x1d5dc5[_0x1d7d('0x4a')]=[{'all':!![]}];}return db[_0x1d7d('0x37')][_0x1d7d('0x4b')](_0x1d5dc5);})[_0x1d7d('0x28')](function(_0x72f5d7){_0x1aee3c['rows']=_0x72f5d7;return _0x1aee3c;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x40318f,_0x1d5dc5))[_0x1d7d('0x4c')](handleError(_0x40318f,null));};exports['show']=function(_0x17c68b,_0x1e662d){var _0x40599b={'raw':![],'where':{'id':_0x17c68b[_0x1d7d('0x4d')]['id']}},_0x24b5e7={};_0x24b5e7[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](db[_0x1d7d('0x37')][_0x1d7d('0x4e')]);_0x24b5e7[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x17c68b[_0x1d7d('0x3a')]);_0x24b5e7['filters']=_[_0x1d7d('0x3b')](_0x24b5e7['model'],_0x24b5e7[_0x1d7d('0x3a')]);_0x40599b['attributes']=_[_0x1d7d('0x3b')](_0x24b5e7[_0x1d7d('0x38')],qs[_0x1d7d('0x3d')](_0x17c68b[_0x1d7d('0x3a')]['fields']));_0x40599b[_0x1d7d('0x3c')]=_0x40599b['attributes']['length']?_0x40599b[_0x1d7d('0x3c')]:_0x24b5e7['model'];if(_0x17c68b['query'][_0x1d7d('0x49')]){_0x40599b[_0x1d7d('0x4a')]=[{'all':!![]}];}_0x40599b=_['merge']({},_0x40599b,_0x17c68b[_0x1d7d('0x4f')]);return db[_0x1d7d('0x37')]['find'](_0x40599b)[_0x1d7d('0x28')](handleEntityNotFound(_0x1e662d,null))[_0x1d7d('0x28')](respondWithResult(_0x1e662d,null))[_0x1d7d('0x4c')](handleError(_0x1e662d,null));};exports[_0x1d7d('0x50')]=function(_0x4ed120,_0x4a577a){return db[_0x1d7d('0x37')][_0x1d7d('0x50')](_0x4ed120[_0x1d7d('0x51')],{})[_0x1d7d('0x28')](function(_0x3cc5b7){var _0x550c9f=_0x4ed120[_0x1d7d('0x52')][_0x1d7d('0x2a')]({'plain':!![]});if(!_0x550c9f)throw new Error(_0x1d7d('0x53'));if(_0x550c9f[_0x1d7d('0x54')]===_0x1d7d('0x52')){var _0x42a103=_0x3cc5b7[_0x1d7d('0x2a')]({'plain':!![]});var _0x296e7c=[{'name':_0x1d7d('0x55'),'value':'inbound'},{'name':_0x1d7d('0x2b'),'value':_0x1d7d('0x56')}];var _0x44b1f7=_['find'](_0x296e7c,['value',_0x42a103[_0x1d7d('0x31')]])[_0x1d7d('0x32')];return db[_0x1d7d('0x57')]['find']({'where':{'name':_0x44b1f7,'userProfileId':_0x550c9f[_0x1d7d('0x58')]},'raw':!![]})[_0x1d7d('0x28')](function(_0x5eff64){if(_0x5eff64&&_0x5eff64[_0x1d7d('0x59')]===0x0){return db[_0x1d7d('0x5a')][_0x1d7d('0x50')]({'name':_0x42a103[_0x1d7d('0x32')],'resourceId':_0x42a103['id'],'type':_0x5eff64['name'],'sectionId':_0x5eff64['id']},{})[_0x1d7d('0x28')](function(){return _0x3cc5b7;});}else{return _0x3cc5b7;}})[_0x1d7d('0x4c')](function(_0x4ba6ec){logger['error'](_0x1d7d('0x5b'),_0x4ba6ec);throw _0x4ba6ec;});}return _0x3cc5b7;})[_0x1d7d('0x28')](respondWithResult(_0x4a577a,0xc9))['catch'](handleError(_0x4a577a,null));};exports['clone']=function(_0x155ef4,_0x37f221){var _0x167d3c={'raw':![],'where':{'id':_0x155ef4['params']['id']}},_0x56f63c={};_0x56f63c[_0x1d7d('0x38')]=_['keys'](db[_0x1d7d('0x37')][_0x1d7d('0x4e')]);_0x167d3c[_0x1d7d('0x3c')]=_[_0x1d7d('0x3b')](_0x56f63c['model'],qs[_0x1d7d('0x3d')](_0x155ef4[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x167d3c[_0x1d7d('0x3c')]=_0x167d3c[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x167d3c[_0x1d7d('0x3c')]:_0x56f63c[_0x1d7d('0x38')];if(_0x155ef4[_0x1d7d('0x3a')][_0x1d7d('0x49')]){_0x167d3c[_0x1d7d('0x4a')]=[{'all':!![]}];}_0x167d3c=_[_0x1d7d('0x46')]({},_0x167d3c,_0x155ef4[_0x1d7d('0x4f')]);return db[_0x1d7d('0x37')][_0x1d7d('0x5c')](_0x167d3c)['then'](handleEntityNotFound(_0x37f221,null))[_0x1d7d('0x28')](function(_0x566d27){if(_0x566d27){var _0x1c9fe7=_0x566d27[_0x1d7d('0x2a')]({'plain':!![]});_0x1c9fe7=qs[_0x1d7d('0x5d')](_0x1c9fe7,['id',_0x1d7d('0x5e'),_0x1d7d('0x5f')]);_0x155ef4[_0x1d7d('0x51')]=_['omit'](_0x155ef4[_0x1d7d('0x51')],['id',_0x1d7d('0x5e'),'updatedAt']);return db[_0x1d7d('0x37')]['create'](_[_0x1d7d('0x46')](_0x1c9fe7,_0x155ef4[_0x1d7d('0x51')]),{'include':_0x155ef4[_0x1d7d('0x3a')][_0x1d7d('0x49')]?[{'all':!![]}]:undefined})[_0x1d7d('0x28')](function(_0x1fd6ec){var _0x516aa0=_0x155ef4[_0x1d7d('0x52')][_0x1d7d('0x2a')]({'plain':!![]});if(!_0x516aa0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x516aa0[_0x1d7d('0x54')]===_0x1d7d('0x52')){var _0x3c8a65=_0x1fd6ec['get']({'plain':!![]});var _0x3b3975=[{'name':_0x1d7d('0x55'),'value':_0x1d7d('0x60')},{'name':_0x1d7d('0x2b'),'value':'outbound'}];var _0x40e6be=_[_0x1d7d('0x5c')](_0x3b3975,[_0x1d7d('0x2f'),_0x3c8a65[_0x1d7d('0x31')]])[_0x1d7d('0x32')];return db['UserProfileSection'][_0x1d7d('0x5c')]({'where':{'name':_0x40e6be,'userProfileId':_0x516aa0[_0x1d7d('0x58')]},'raw':!![]})['then'](function(_0xac21ec){if(_0xac21ec&&_0xac21ec[_0x1d7d('0x59')]===0x0){return db[_0x1d7d('0x5a')][_0x1d7d('0x50')]({'name':_0x3c8a65['name'],'resourceId':_0x3c8a65['id'],'type':_0xac21ec[_0x1d7d('0x32')],'sectionId':_0xac21ec['id']},{})['then'](function(){return _0x1fd6ec;});}else{return _0x1fd6ec;}})[_0x1d7d('0x4c')](function(_0x138fc2){logger[_0x1d7d('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x138fc2);throw _0x138fc2;});}return _0x1fd6ec;});}})[_0x1d7d('0x28')](respondWithResult(_0x37f221,0xc9))[_0x1d7d('0x4c')](handleError(_0x37f221,null));};exports[_0x1d7d('0x27')]=function(_0x55ded9,_0x45b66d){if(_0x55ded9['body']['id']){delete _0x55ded9[_0x1d7d('0x51')]['id'];}return db[_0x1d7d('0x37')][_0x1d7d('0x5c')]({'where':{'id':_0x55ded9[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x45b66d,null))[_0x1d7d('0x28')](saveUpdates(_0x55ded9[_0x1d7d('0x51')],null))[_0x1d7d('0x28')](respondWithResult(_0x45b66d,null))[_0x1d7d('0x4c')](handleError(_0x45b66d,null));};exports[_0x1d7d('0x29')]=function(_0x5eb467,_0x5494ae){return db['VoiceQueue'][_0x1d7d('0x5c')]({'where':{'id':_0x5eb467[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5494ae,null))['then'](removeEntity(_0x5494ae,null))[_0x1d7d('0x4c')](handleError(_0x5494ae,null));};exports['getHoppers']=function(_0x139d9a,_0x33e656,_0x5e0f5d){var _0x1f55a2={'raw':![],'where':{}};var _0x206932={};var _0x4a8f1f={'count':0x0,'rows':[]};return db[_0x1d7d('0x37')][_0x1d7d('0x61')]({'where':{'id':_0x139d9a[_0x1d7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33e656,null))['then'](function(_0x2f774f){if(_0x2f774f){_0x206932[_0x1d7d('0x38')]=_['keys'](db[_0x1d7d('0x62')][_0x1d7d('0x4e')]);_0x206932[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x139d9a['query']);_0x206932[_0x1d7d('0x45')]=_[_0x1d7d('0x3b')](_0x206932[_0x1d7d('0x38')],_0x206932[_0x1d7d('0x3a')]);_0x1f55a2[_0x1d7d('0x3c')]=_[_0x1d7d('0x3b')](_0x206932[_0x1d7d('0x38')],qs[_0x1d7d('0x3d')](_0x139d9a[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x1f55a2[_0x1d7d('0x3c')]=_0x1f55a2[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x1f55a2['attributes']:_0x206932[_0x1d7d('0x38')];if(!_0x139d9a[_0x1d7d('0x3a')]['hasOwnProperty'](_0x1d7d('0x40'))){_0x1f55a2[_0x1d7d('0x22')]=qs['limit'](_0x139d9a['query']['limit']);_0x1f55a2[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x139d9a[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}_0x1f55a2['order']=qs[_0x1d7d('0x42')](_0x139d9a[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x1f55a2[_0x1d7d('0x43')]=qs['filters'](_[_0x1d7d('0x44')](_0x139d9a[_0x1d7d('0x3a')],_0x206932[_0x1d7d('0x45')]));_0x1f55a2[_0x1d7d('0x43')][_0x1d7d('0x63')]=_0x2f774f['id'];if(_0x139d9a[_0x1d7d('0x3a')]['filter']){_0x1f55a2[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x1f55a2['where'],{'$or':_[_0x1d7d('0x2e')](_0x1f55a2[_0x1d7d('0x3c')],function(_0x7d394b){var _0x56db77={};_0x56db77[_0x7d394b]={'$like':'%'+_0x139d9a[_0x1d7d('0x3a')]['filter']+'%'};return _0x56db77;})});}_0x1f55a2=_[_0x1d7d('0x46')]({},_0x1f55a2,_0x139d9a[_0x1d7d('0x4f')]);return db['CmHopper'][_0x1d7d('0x64')]({'where':_0x1f55a2[_0x1d7d('0x43')]})[_0x1d7d('0x28')](function(_0xc3c42f){_0x4a8f1f[_0x1d7d('0x64')]=_0xc3c42f;if(_0x139d9a[_0x1d7d('0x3a')][_0x1d7d('0x49')]){_0x1f55a2[_0x1d7d('0x4a')]=[{'all':!![]}];}return db[_0x1d7d('0x62')][_0x1d7d('0x4b')](_0x1f55a2);})[_0x1d7d('0x28')](function(_0x1490b7){_0x4a8f1f['rows']=_0x1490b7;return _0x4a8f1f;});}})['then'](respondWithFilteredResult(_0x33e656,_0x1f55a2))[_0x1d7d('0x4c')](handleError(_0x33e656,null));};exports[_0x1d7d('0x65')]=function(_0x25ec1c,_0x395818,_0x247289){var _0x1d6a3a={'raw':!![],'where':{}};var _0x2ebe6c={};var _0x515bd2={'count':0x0,'rows':[]};return db[_0x1d7d('0x37')][_0x1d7d('0x61')]({'where':{'id':_0x25ec1c[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x395818,null))['then'](function(_0x1bae34){if(_0x1bae34){_0x2ebe6c[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](db[_0x1d7d('0x66')]['rawAttributes']);_0x2ebe6c[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x25ec1c[_0x1d7d('0x3a')]);_0x2ebe6c[_0x1d7d('0x45')]=_['intersection'](_0x2ebe6c['model'],_0x2ebe6c['query']);_0x1d6a3a['attributes']=_[_0x1d7d('0x3b')](_0x2ebe6c[_0x1d7d('0x38')],qs['fields'](_0x25ec1c['query'][_0x1d7d('0x3d')]));_0x1d6a3a[_0x1d7d('0x3c')]=_0x1d6a3a[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x1d6a3a[_0x1d7d('0x3c')]:_0x2ebe6c[_0x1d7d('0x38')];if(!_0x25ec1c[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x1d6a3a[_0x1d7d('0x22')]=qs['limit'](_0x25ec1c[_0x1d7d('0x3a')]['limit']);_0x1d6a3a[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x25ec1c[_0x1d7d('0x3a')]['offset']);}_0x1d6a3a[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x25ec1c[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x1d6a3a[_0x1d7d('0x43')]=qs[_0x1d7d('0x45')](_[_0x1d7d('0x44')](_0x25ec1c[_0x1d7d('0x3a')],_0x2ebe6c[_0x1d7d('0x45')]));_0x1d6a3a[_0x1d7d('0x43')][_0x1d7d('0x63')]=_0x1bae34['id'];if(_0x25ec1c[_0x1d7d('0x3a')][_0x1d7d('0x2c')]){_0x1d6a3a[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x1d6a3a[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x1d6a3a[_0x1d7d('0x3c')],function(_0x37ba0e){var _0x443c53={};_0x443c53[_0x37ba0e]={'$like':'%'+_0x25ec1c[_0x1d7d('0x3a')][_0x1d7d('0x2c')]+'%'};return _0x443c53;})});}_0x1d6a3a=_[_0x1d7d('0x46')]({},_0x1d6a3a,_0x25ec1c['options']);return db[_0x1d7d('0x66')][_0x1d7d('0x64')]({'where':_0x1d6a3a[_0x1d7d('0x43')]})['then'](function(_0x169e17){_0x515bd2['count']=_0x169e17;if(_0x25ec1c['query']['includeAll']){_0x1d6a3a['include']=[{'all':!![]}];}return db[_0x1d7d('0x66')][_0x1d7d('0x4b')](_0x1d6a3a);})[_0x1d7d('0x28')](function(_0x4893bc){_0x515bd2[_0x1d7d('0x67')]=_0x4893bc;return _0x515bd2;});}})['then'](respondWithFilteredResult(_0x395818,_0x1d6a3a))[_0x1d7d('0x4c')](handleError(_0x395818,null));};exports[_0x1d7d('0x68')]=function(_0x2e4cc1,_0x4772cb,_0x26b1f6){var _0x20a9cd={'raw':!![],'where':{}};var _0x11c779={};var _0x171024={'count':0x0,'rows':[]};return db[_0x1d7d('0x37')][_0x1d7d('0x61')]({'where':{'id':_0x2e4cc1[_0x1d7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4772cb,null))[_0x1d7d('0x28')](function(_0x113ded){if(_0x113ded){_0x11c779[_0x1d7d('0x38')]=_['keys'](db[_0x1d7d('0x69')][_0x1d7d('0x4e')]);_0x11c779[_0x1d7d('0x3a')]=_['keys'](_0x2e4cc1['query']);_0x11c779[_0x1d7d('0x45')]=_['intersection'](_0x11c779[_0x1d7d('0x38')],_0x11c779[_0x1d7d('0x3a')]);_0x20a9cd['attributes']=_[_0x1d7d('0x3b')](_0x11c779[_0x1d7d('0x38')],qs['fields'](_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x20a9cd[_0x1d7d('0x3c')]=_0x20a9cd[_0x1d7d('0x3c')]['length']?_0x20a9cd['attributes']:_0x11c779[_0x1d7d('0x38')];if(!_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x20a9cd[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x20a9cd[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}_0x20a9cd[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x20a9cd[_0x1d7d('0x43')]=qs[_0x1d7d('0x45')](_['pick'](_0x2e4cc1[_0x1d7d('0x3a')],_0x11c779[_0x1d7d('0x45')]));_0x20a9cd[_0x1d7d('0x43')][_0x1d7d('0x63')]=_0x113ded['id'];if(_0x2e4cc1['query'][_0x1d7d('0x2c')]){_0x20a9cd[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x20a9cd[_0x1d7d('0x43')],{'$or':_['map'](_0x20a9cd[_0x1d7d('0x3c')],function(_0x48662a){var _0x3eb3da={};_0x3eb3da[_0x48662a]={'$like':'%'+_0x2e4cc1[_0x1d7d('0x3a')][_0x1d7d('0x2c')]+'%'};return _0x3eb3da;})});}_0x20a9cd=_['merge']({},_0x20a9cd,_0x2e4cc1[_0x1d7d('0x4f')]);return db['CmHopperFinal'][_0x1d7d('0x64')]({'where':_0x20a9cd[_0x1d7d('0x43')]})[_0x1d7d('0x28')](function(_0x466208){_0x171024['count']=_0x466208;if(_0x2e4cc1[_0x1d7d('0x3a')]['includeAll']){_0x20a9cd[_0x1d7d('0x4a')]=[{'all':!![]}];}return db[_0x1d7d('0x69')]['findAll'](_0x20a9cd);})[_0x1d7d('0x28')](function(_0x3dc8ee){_0x171024[_0x1d7d('0x67')]=_0x3dc8ee;return _0x171024;});}})[_0x1d7d('0x28')](respondWithFilteredResult(_0x4772cb,_0x20a9cd))['catch'](handleError(_0x4772cb,null));};exports['getHopperBlacks']=function(_0x54729b,_0x3fa54d,_0x3ae715){var _0x1d165d={'raw':!![],'where':{}};var _0x3c0827={};var _0x458f92={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1d7d('0x61')]({'where':{'id':_0x54729b[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3fa54d,null))[_0x1d7d('0x28')](function(_0x4c8174){if(_0x4c8174){_0x3c0827['model']=_[_0x1d7d('0x39')](db[_0x1d7d('0x6a')][_0x1d7d('0x4e')]);_0x3c0827[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x54729b[_0x1d7d('0x3a')]);_0x3c0827['filters']=_[_0x1d7d('0x3b')](_0x3c0827['model'],_0x3c0827[_0x1d7d('0x3a')]);_0x1d165d[_0x1d7d('0x3c')]=_['intersection'](_0x3c0827[_0x1d7d('0x38')],qs['fields'](_0x54729b[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x1d165d[_0x1d7d('0x3c')]=_0x1d165d[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x1d165d['attributes']:_0x3c0827[_0x1d7d('0x38')];if(!_0x54729b['query'][_0x1d7d('0x3f')]('nolimit')){_0x1d165d['limit']=qs[_0x1d7d('0x22')](_0x54729b[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x1d165d[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x54729b[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}_0x1d165d[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x54729b[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x1d165d[_0x1d7d('0x43')]=qs['filters'](_['pick'](_0x54729b[_0x1d7d('0x3a')],_0x3c0827['filters']));_0x1d165d[_0x1d7d('0x43')]['VoiceQueueId']=_0x4c8174['id'];if(_0x54729b['query'][_0x1d7d('0x2c')]){_0x1d165d[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x1d165d[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x1d165d[_0x1d7d('0x3c')],function(_0x1246df){var _0x464872={};_0x464872[_0x1246df]={'$like':'%'+_0x54729b[_0x1d7d('0x3a')]['filter']+'%'};return _0x464872;})});}_0x1d165d=_['merge']({},_0x1d165d,_0x54729b[_0x1d7d('0x4f')]);return db['CmHopperBlack'][_0x1d7d('0x64')]({'where':_0x1d165d[_0x1d7d('0x43')]})[_0x1d7d('0x28')](function(_0x268dd9){_0x458f92[_0x1d7d('0x64')]=_0x268dd9;if(_0x54729b[_0x1d7d('0x3a')][_0x1d7d('0x49')]){_0x1d165d[_0x1d7d('0x4a')]=[{'all':!![]}];}return db[_0x1d7d('0x6a')][_0x1d7d('0x4b')](_0x1d165d);})[_0x1d7d('0x28')](function(_0x7c2ba3){_0x458f92['rows']=_0x7c2ba3;return _0x458f92;});}})['then'](respondWithFilteredResult(_0x3fa54d,_0x1d165d))[_0x1d7d('0x4c')](handleError(_0x3fa54d,null));};exports[_0x1d7d('0x6b')]=function(_0xfd4b25,_0x4d80f2,_0x48f05e){var _0x19a53b={};var _0x470f5e={};var _0x54b2bb;var _0x1f0d9f;return db['VoiceQueue'][_0x1d7d('0x61')]({'where':{'id':_0xfd4b25['params']['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x4d80f2,null))[_0x1d7d('0x28')](function(_0x44f307){if(_0x44f307){_0x54b2bb=_0x44f307;_0x470f5e[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](db[_0x1d7d('0x6c')][_0x1d7d('0x4e')]);_0x470f5e[_0x1d7d('0x3a')]=_['keys'](_0xfd4b25[_0x1d7d('0x3a')]);_0x470f5e[_0x1d7d('0x45')]=_[_0x1d7d('0x3b')](_0x470f5e[_0x1d7d('0x38')],_0x470f5e[_0x1d7d('0x3a')]);_0x19a53b[_0x1d7d('0x3c')]=_['intersection'](_0x470f5e[_0x1d7d('0x38')],qs['fields'](_0xfd4b25[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x19a53b['attributes']=_0x19a53b[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x19a53b[_0x1d7d('0x3c')]:_0x470f5e[_0x1d7d('0x38')];_0x19a53b['order']=qs[_0x1d7d('0x42')](_0xfd4b25[_0x1d7d('0x3a')]['sort']);_0x19a53b['where']=qs[_0x1d7d('0x45')](_['pick'](_0xfd4b25['query'],_0x470f5e['filters']));if(_0xfd4b25[_0x1d7d('0x3a')]['filter']){_0x19a53b[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x19a53b['where'],{'$or':_['map'](_0x19a53b['attributes'],function(_0x2f2b27){var _0x40f4d8={};_0x40f4d8[_0x2f2b27]={'$like':'%'+_0xfd4b25[_0x1d7d('0x3a')]['filter']+'%'};return _0x40f4d8;})});}_0x19a53b=_[_0x1d7d('0x46')]({},_0x19a53b,_0xfd4b25[_0x1d7d('0x4f')]);return _0x54b2bb['getTeams'](_0x19a53b);}})['then'](function(_0x1651c7){if(_0x1651c7){_0x1f0d9f=_0x1651c7['length'];if(!_0xfd4b25['query'][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x19a53b[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0xfd4b25[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x19a53b[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0xfd4b25['query']['offset']);}return _0x54b2bb[_0x1d7d('0x6b')](_0x19a53b);}})[_0x1d7d('0x28')](function(_0x35e7f2){if(_0x35e7f2){return _0x35e7f2?{'count':_0x1f0d9f,'rows':_0x35e7f2}:null;}})['then'](respondWithResult(_0x4d80f2,null))[_0x1d7d('0x4c')](handleError(_0x4d80f2,null));};exports[_0x1d7d('0x6d')]=function(_0x50fc9b,_0x463ae8,_0x39d67f){var _0x1b686e=_0x50fc9b['body']['teams'];return db[_0x1d7d('0x6c')][_0x1d7d('0x4b')]({'where':{'id':_[_0x1d7d('0x2e')](_0x1b686e,'id')},'attributes':['id'],'include':[{'model':db[_0x1d7d('0x6e')],'as':_0x1d7d('0x6f'),'attributes':['id',_0x1d7d('0x32'),'online',_0x1d7d('0x70'),_0x1d7d('0x71')],'raw':!![]}]})['then'](function(_0x201650){if(_0x201650){var _0x4059a1=_['flatMap'](_0x201650,function(_0x5c8d2b){var _0x589ffe=_0x5c8d2b[_0x1d7d('0x2a')]({'plain':!![]});_0x589ffe[_0x1d7d('0x6f')][_0x1d7d('0x72')](function(_0x1cd083){_0x1cd083[_0x1d7d('0x73')]=_[_0x1d7d('0x5c')](_0x1b686e,{'id':_0x589ffe['id']})[_0x1d7d('0x73')];});return _0x589ffe[_0x1d7d('0x6f')];});return db[_0x1d7d('0x37')][_0x1d7d('0x5c')]({'where':{'id':_0x50fc9b[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](function(_0x4c5664){return db['sequelize']['transaction'](function(_0x30862a){return _0x4c5664[_0x1d7d('0x6d')](_[_0x1d7d('0x2e')](_0x1b686e,'id'),{'transaction':_0x30862a})[_0x1d7d('0x28')](function(){return BPromise[_0x1d7d('0x74')](_0x4059a1,function(_0xc86aab){return db[_0x1d7d('0x75')][_0x1d7d('0x76')]({'where':{'UserId':_0xc86aab['id'],'VoiceQueueId':_0x50fc9b['params']['id']},'defaults':{'penalty':_0xc86aab['penalty']},'transaction':_0x30862a});});})['then'](function(){return BPromise[_0x1d7d('0x74')](_[_0x1d7d('0x2c')](_0x4059a1,{'online':!![]}),function(_0x4df896){return db[_0x1d7d('0x77')]['upsert']({'membername':_0x4df896[_0x1d7d('0x32')],'UserId':_0x4df896['id'],'queue_name':_0x4c5664[_0x1d7d('0x32')],'VoiceQueueId':_0x4c5664['id'],'interface':_[_0x1d7d('0x78')](_0x4df896[_0x1d7d('0x71')])?util[_0x1d7d('0x79')](_0x1d7d('0x7a'),_0x4df896['name']):_0x4df896[_0x1d7d('0x71')],'paused':_0x4df896[_0x1d7d('0x70')]||![],'penalty':_0x4df896[_0x1d7d('0x73')]},{'transaction':_0x30862a});});})['then'](function(){_0x4059a1['forEach'](function(_0x43ce7f){socket[_0x1d7d('0x7b')](_0x1d7d('0x7c'),{'UserId':_0x43ce7f['id'],'VoiceQueueId':_0x4c5664['id']});});});});});}})['then'](respondWithStatusCode(_0x463ae8,null))[_0x1d7d('0x4c')](handleError(_0x463ae8,null));};exports['removeTeams']=function(_0x2f2fd7,_0x4565a0,_0x45208b){return db['Team']['findAll']({'where':{'id':_0x2f2fd7[_0x1d7d('0x3a')][_0x1d7d('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x1d7d('0x6e')],'as':_0x1d7d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1d7d('0x28')](handleEntityNotFound(_0x4565a0,null))[_0x1d7d('0x28')](function(_0x33243c){var _0x1f2e23=_[_0x1d7d('0x2e')](_0x33243c,'id');var _0x32aaf1=[];var _0xb5c537=[];var _0x5defbe=squel[_0x1d7d('0x7e')]();_0x5defbe[_0x1d7d('0x48')](_0x1d7d('0x7f'))['from']('team_has_voice_queues','tq')[_0x1d7d('0x80')]('user_has_teams','ut',_0x1d7d('0x81'))[_0x1d7d('0x43')](_0x1d7d('0x82'),_0x2f2fd7['params']['id']);for(var _0x5fe48f=0x0;_0x5fe48f<_0x33243c['length'];_0x5fe48f+=0x1){let _0x5c0be4=_0x33243c[_0x5fe48f];for(var _0x46b9e5=0x0;_0x46b9e5<_0x5c0be4[_0x1d7d('0x6f')]['length'];_0x46b9e5+=0x1){let _0x662219=_0x5c0be4[_0x1d7d('0x6f')][_0x46b9e5];var _0x20543c=_0x5defbe[_0x1d7d('0x83')]();_0x20543c[_0x1d7d('0x43')]('ut.UserId\x20=\x20?',_0x662219['id']);_0xb5c537[_0x1d7d('0x84')](db['sequelize'][_0x1d7d('0x3a')](_0x20543c[_0x1d7d('0x85')](),{'type':db['sequelize'][_0x1d7d('0x86')][_0x1d7d('0x87')]})[_0x1d7d('0x28')](function(_0x3bcfe0){if(_0x3bcfe0[_0x1d7d('0x3e')]===0x1){return _0x662219['id'];}else{var _0x1afc4d=_[_0x1d7d('0x88')](_[_0x1d7d('0x2e')](_0x3bcfe0,_0x1d7d('0x89')),function(_0x10b482){return _[_0x1d7d('0x30')](_0x1f2e23,_0x10b482);});if(_0x1afc4d){return _0x662219['id'];}}}));}}return BPromise[_0x1d7d('0x8a')](_0xb5c537)[_0x1d7d('0x28')](function(_0x5435a9){_0x32aaf1=_(_0x32aaf1)['union'](_0x5435a9)[_0x1d7d('0x8b')]()['value']();return db['VoiceQueue'][_0x1d7d('0x5c')]({'where':{'id':_0x2f2fd7['params']['id']}})[_0x1d7d('0x28')](function(_0x470991){return db[_0x1d7d('0x8c')]['transaction'](function(_0xefc2d2){return _0x470991[_0x1d7d('0x8d')](_0x2f2fd7[_0x1d7d('0x3a')][_0x1d7d('0x7d')],{'transaction':_0xefc2d2})[_0x1d7d('0x28')](function(){if(!_[_0x1d7d('0x8e')](_0x32aaf1)){return _0x470991[_0x1d7d('0x8f')](_0x32aaf1,{'transaction':_0xefc2d2})[_0x1d7d('0x28')](function(){return db[_0x1d7d('0x77')]['destroy']({'where':{'VoiceQueueId':_0x2f2fd7[_0x1d7d('0x4d')]['id'],'UserId':_0x32aaf1},'transaction':_0xefc2d2});});}})['then'](function(){_0x32aaf1['forEach'](function(_0x1db3a7){socket['emit'](_0x1d7d('0x90'),{'UserId':_0x1db3a7,'VoiceQueueId':_0x470991['id']});});});});});});})[_0x1d7d('0x28')](respondWithStatusCode(_0x4565a0,null))[_0x1d7d('0x4c')](handleError(_0x4565a0,null));};exports['addAgents']=function(_0x48e746,_0x276334,_0x26a64b){var _0x5c2113,_0x47706d;return db[_0x1d7d('0x37')][_0x1d7d('0x5c')]({'where':{'id':_0x48e746['params']['id']}})['then'](handleEntityNotFound(_0x276334,null))[_0x1d7d('0x28')](function(_0x109403){if(_0x109403){_0x47706d=_0x109403;return _0x109403[_0x1d7d('0x91')](_0x48e746['body'][_0x1d7d('0x7d')],_[_0x1d7d('0x5d')](_0x48e746['body'],['ids','id'])||{})['spread'](function(_0x1005fe){for(var _0x2381f6=0x0;_0x2381f6<_0x48e746[_0x1d7d('0x51')]['ids']['length'];_0x2381f6+=0x1){socket[_0x1d7d('0x7b')](_0x1d7d('0x7c'),{'UserId':_0x48e746['body']['ids'][_0x2381f6],'VoiceQueueId':_0x48e746[_0x1d7d('0x4d')]['id']});}return _0x1005fe;});}})[_0x1d7d('0x28')](function(_0x50a6c5){_0x5c2113=_0x50a6c5||[];if(_0x47706d){return db[_0x1d7d('0x6e')]['findAll']({'where':{'id':_0x48e746[_0x1d7d('0x51')][_0x1d7d('0x7d')]},'attributes':['id',_0x1d7d('0x32'),_0x1d7d('0x92'),_0x1d7d('0x70'),_0x1d7d('0x71')],'raw':!![]});}})[_0x1d7d('0x28')](function(_0x2edbe3){if(!_[_0x1d7d('0x8e')](_0x2edbe3)){var _0x3a1507=[];for(var _0x30b0e4=0x0;_0x30b0e4<_0x2edbe3['length'];_0x30b0e4++){if(_0x2edbe3[_0x30b0e4][_0x1d7d('0x92')]){_0x3a1507[_0x1d7d('0x84')](db[_0x1d7d('0x77')]['upsert']({'membername':_0x2edbe3[_0x30b0e4]['name'],'UserId':_0x2edbe3[_0x30b0e4]['id'],'queue_name':_0x47706d[_0x1d7d('0x32')],'VoiceQueueId':_0x47706d['id'],'interface':_[_0x1d7d('0x78')](_0x2edbe3[_0x30b0e4]['interface'])?util[_0x1d7d('0x79')](_0x1d7d('0x7a'),_0x2edbe3[_0x30b0e4][_0x1d7d('0x32')]):_0x2edbe3[_0x30b0e4][_0x1d7d('0x71')],'paused':_0x2edbe3[_0x30b0e4][_0x1d7d('0x70')]||![],'penalty':_0x48e746[_0x1d7d('0x51')]['penalty']||0x0}));}}return BPromise[_0x1d7d('0x8a')](_0x3a1507);}})['then'](function(){return _0x5c2113;})['then'](respondWithResult(_0x276334,null))['catch'](handleError(_0x276334,null));};exports[_0x1d7d('0x8f')]=function(_0x4933a3,_0x34571e,_0xffeb3){return db['VoiceQueue'][_0x1d7d('0x5c')]({'where':{'id':_0x4933a3[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x34571e,null))[_0x1d7d('0x28')](function(_0x5be0c4){if(_0x5be0c4){return _0x5be0c4['removeAgents'](_0x4933a3[_0x1d7d('0x3a')][_0x1d7d('0x7d')])[_0x1d7d('0x28')](function(){if(_['isArray'](_0x4933a3['query'][_0x1d7d('0x7d')])){for(var _0x5cd0d7=0x0;_0x5cd0d7<_0x4933a3[_0x1d7d('0x3a')][_0x1d7d('0x7d')][_0x1d7d('0x3e')];_0x5cd0d7+=0x1){socket[_0x1d7d('0x7b')]('userVoiceQueue:remove',{'UserId':Number(_0x4933a3[_0x1d7d('0x3a')]['ids'][_0x5cd0d7]),'VoiceQueueId':Number(_0x4933a3[_0x1d7d('0x4d')]['id'])});}}else{socket[_0x1d7d('0x7b')](_0x1d7d('0x90'),{'UserId':Number(_0x4933a3['query'][_0x1d7d('0x7d')]),'VoiceQueueId':Number(_0x4933a3[_0x1d7d('0x4d')]['id'])});}});}})['then'](function(_0x174498){return db[_0x1d7d('0x77')][_0x1d7d('0x29')]({'where':{'VoiceQueueId':_0x4933a3[_0x1d7d('0x4d')]['id'],'UserId':_0x4933a3['query'][_0x1d7d('0x7d')]}})[_0x1d7d('0x28')](function(){return _0x174498;});})[_0x1d7d('0x28')](respondWithStatusCode(_0x34571e,null))['catch'](handleError(_0x34571e,null));};exports['getAgents']=function(_0x16b00f,_0x4f32c3,_0x108088){var _0x47274c={};var _0x29418e={};var _0x4fdaa7;var _0x241014;return db['VoiceQueue'][_0x1d7d('0x61')]({'where':{'id':_0x16b00f['params']['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x4f32c3,null))['then'](function(_0x585219){if(_0x585219){_0x4fdaa7=_0x585219;_0x29418e[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](db[_0x1d7d('0x6e')][_0x1d7d('0x4e')]);_0x29418e[_0x1d7d('0x3a')]=_['keys'](_0x16b00f[_0x1d7d('0x3a')]);_0x29418e[_0x1d7d('0x45')]=_[_0x1d7d('0x3b')](_0x29418e['model'],_0x29418e[_0x1d7d('0x3a')]);_0x47274c['attributes']=_['intersection'](_0x29418e[_0x1d7d('0x38')],qs[_0x1d7d('0x3d')](_0x16b00f['query'][_0x1d7d('0x3d')]));_0x47274c[_0x1d7d('0x3c')]=_0x47274c[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x47274c[_0x1d7d('0x3c')]:_0x29418e['model'];_0x47274c[_0x1d7d('0x41')]=qs['sort'](_0x16b00f[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x47274c[_0x1d7d('0x43')]=qs['filters'](_['pick'](_0x16b00f['query'],_0x29418e['filters']));if(_0x16b00f['query'][_0x1d7d('0x2c')]){_0x47274c[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x47274c[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x47274c['attributes'],function(_0x5da7b4){var _0x15d9b7={};_0x15d9b7[_0x5da7b4]={'$like':'%'+_0x16b00f[_0x1d7d('0x3a')]['filter']+'%'};return _0x15d9b7;})});}_0x47274c=_[_0x1d7d('0x46')]({},_0x47274c,_0x16b00f[_0x1d7d('0x4f')]);return _0x4fdaa7[_0x1d7d('0x93')](_0x47274c);}})['then'](function(_0x3fb945){if(_0x3fb945){_0x241014=_0x3fb945[_0x1d7d('0x3e')];if(!_0x16b00f[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x47274c['limit']=qs[_0x1d7d('0x22')](_0x16b00f[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x47274c[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x16b00f[_0x1d7d('0x3a')]['offset']);}return _0x4fdaa7[_0x1d7d('0x93')](_0x47274c);}})[_0x1d7d('0x28')](function(_0x490b58){if(_0x490b58){return _0x490b58?{'count':_0x241014,'rows':_0x490b58}:null;}})['then'](respondWithResult(_0x4f32c3,null))[_0x1d7d('0x4c')](handleError(_0x4f32c3,null));};exports['getMembers']=function(_0x53f54e,_0x2fdc85,_0x36a382){var _0x135cd9={};var _0x4490f8={};var _0x679cd;var _0x16fea7;return db['VoiceQueue'][_0x1d7d('0x61')]({'where':{'id':_0x53f54e[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x2fdc85,null))['then'](function(_0x3bde09){if(_0x3bde09){_0x679cd=_0x3bde09;_0x4490f8[_0x1d7d('0x38')]=_['keys'](db[_0x1d7d('0x77')]['rawAttributes']);_0x4490f8[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x53f54e[_0x1d7d('0x3a')]);_0x4490f8[_0x1d7d('0x45')]=_[_0x1d7d('0x3b')](_0x4490f8['model'],_0x4490f8[_0x1d7d('0x3a')]);_0x135cd9[_0x1d7d('0x3c')]=_['intersection'](_0x4490f8['model'],qs[_0x1d7d('0x3d')](_0x53f54e[_0x1d7d('0x3a')]['fields']));_0x135cd9[_0x1d7d('0x3c')]=_0x135cd9[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x135cd9[_0x1d7d('0x3c')]:_0x4490f8['model'];_0x135cd9['order']=qs[_0x1d7d('0x42')](_0x53f54e[_0x1d7d('0x3a')][_0x1d7d('0x42')]);_0x135cd9[_0x1d7d('0x43')]=qs[_0x1d7d('0x45')](_[_0x1d7d('0x44')](_0x53f54e[_0x1d7d('0x3a')],_0x4490f8[_0x1d7d('0x45')]));if(_0x53f54e[_0x1d7d('0x3a')][_0x1d7d('0x2c')]){_0x135cd9[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x135cd9[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x135cd9[_0x1d7d('0x3c')],function(_0x3b1dfd){var _0x9009f4={};_0x9009f4[_0x3b1dfd]={'$like':'%'+_0x53f54e['query'][_0x1d7d('0x2c')]+'%'};return _0x9009f4;})});}_0x135cd9=_['merge']({},_0x135cd9,_0x53f54e['options']);return _0x679cd[_0x1d7d('0x94')](_0x135cd9);}})[_0x1d7d('0x28')](function(_0x3e2e43){if(_0x3e2e43){_0x16fea7=_0x3e2e43[_0x1d7d('0x3e')];if(!_0x53f54e[_0x1d7d('0x3a')]['hasOwnProperty'](_0x1d7d('0x40'))){_0x135cd9[_0x1d7d('0x22')]=qs['limit'](_0x53f54e[_0x1d7d('0x3a')]['limit']);_0x135cd9[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x53f54e[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}return _0x679cd[_0x1d7d('0x94')](_0x135cd9);}})['then'](function(_0x2c56c1){return _0x2c56c1?{'count':_0x16fea7,'rows':_0x2c56c1}:null;})[_0x1d7d('0x28')](respondWithResult(_0x2fdc85,null))[_0x1d7d('0x4c')](handleError(_0x2fdc85,null));};exports[_0x1d7d('0x95')]=function(_0x2d1258,_0x31eadc,_0x24b864){var _0x421c4d={};var _0x39be65={};var _0x34b43f;var _0x14a937;return db[_0x1d7d('0x37')]['findOne']({'where':{'id':_0x2d1258[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x31eadc,null))[_0x1d7d('0x28')](function(_0x4ed366){if(_0x4ed366){_0x34b43f=_0x4ed366;_0x39be65['model']=_[_0x1d7d('0x39')](db['CmList'][_0x1d7d('0x4e')]);_0x39be65[_0x1d7d('0x3a')]=_[_0x1d7d('0x39')](_0x2d1258[_0x1d7d('0x3a')]);_0x39be65[_0x1d7d('0x45')]=_[_0x1d7d('0x3b')](_0x39be65['model'],_0x39be65[_0x1d7d('0x3a')]);_0x421c4d['attributes']=_['intersection'](_0x39be65[_0x1d7d('0x38')],qs[_0x1d7d('0x3d')](_0x2d1258['query'][_0x1d7d('0x3d')]));_0x421c4d[_0x1d7d('0x3c')]=_0x421c4d['attributes'][_0x1d7d('0x3e')]?_0x421c4d['attributes']:_0x39be65[_0x1d7d('0x38')];_0x421c4d[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x2d1258['query'][_0x1d7d('0x42')]);_0x421c4d['where']=qs[_0x1d7d('0x45')](_[_0x1d7d('0x44')](_0x2d1258[_0x1d7d('0x3a')],_0x39be65[_0x1d7d('0x45')]));if(_0x2d1258[_0x1d7d('0x3a')]['filter']){_0x421c4d['where']=_[_0x1d7d('0x46')](_0x421c4d[_0x1d7d('0x43')],{'$or':_['map'](_0x421c4d[_0x1d7d('0x3c')],function(_0x210be0){var _0x5f1b69={};_0x5f1b69[_0x210be0]={'$like':'%'+_0x2d1258[_0x1d7d('0x3a')][_0x1d7d('0x2c')]+'%'};return _0x5f1b69;})});}_0x421c4d=_['merge']({},_0x421c4d,_0x2d1258[_0x1d7d('0x4f')]);return _0x34b43f[_0x1d7d('0x95')](_0x421c4d);}})[_0x1d7d('0x28')](function(_0x5c9e68){if(_0x5c9e68){_0x14a937=_0x5c9e68['length'];if(!_0x2d1258[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x421c4d[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x2d1258[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x421c4d[_0x1d7d('0x21')]=qs['offset'](_0x2d1258[_0x1d7d('0x3a')][_0x1d7d('0x21')]);}return _0x34b43f[_0x1d7d('0x95')](_0x421c4d);}})[_0x1d7d('0x28')](function(_0x3b440c){if(_0x3b440c){return _0x3b440c?{'count':_0x14a937,'rows':_0x3b440c}:null;}})['then'](respondWithResult(_0x31eadc,null))[_0x1d7d('0x4c')](handleError(_0x31eadc,null));};exports[_0x1d7d('0x96')]=function(_0x44d30c,_0x4288a7,_0xfeaeca){var _0x477415,_0x18b8b4;return db[_0x1d7d('0x37')]['find']({'where':{'id':_0x44d30c[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x4288a7,null))[_0x1d7d('0x28')](function(_0xad6eb5){if(_0xad6eb5){_0x18b8b4=_0xad6eb5;return _0xad6eb5['addLists'](_0x44d30c[_0x1d7d('0x51')][_0x1d7d('0x7d')],_[_0x1d7d('0x5d')](_0x44d30c[_0x1d7d('0x51')],['ids','id'])||{});}return null;})[_0x1d7d('0x97')](function(_0x819a12){var _0x5cd9e5;_0x477415=_0x819a12||[];var _0x15817c=[];if(_0x819a12){for(var _0x4c4b15=0x0;_0x4c4b15<_0x819a12[_0x1d7d('0x3e')];_0x4c4b15+=0x1){var _0x582172=_0x819a12[_0x4c4b15]['get']({'plain':!![]});_0x18b8b4[_0x1d7d('0x98')]=_0x44d30c[_0x1d7d('0x51')]['dialCheckDuplicateType']?_0x44d30c['body'][_0x1d7d('0x98')]:_0x18b8b4['dialCheckDuplicateType'];switch(_0x18b8b4[_0x1d7d('0x98')]){case _0x1d7d('0x99'):_0x5cd9e5=squel[_0x1d7d('0x9a')]()['into'](_0x1d7d('0x9b'))[_0x1d7d('0x9c')]([_0x1d7d('0x9d'),_0x1d7d('0x9e'),_0x1d7d('0x9f'),_0x1d7d('0xa0'),'VoiceQueueId','createdAt',_0x1d7d('0x5f')],squel[_0x1d7d('0x7e')]()[_0x1d7d('0x48')](_0x1d7d('0x9d'),_0x1d7d('0x9d'))['field']('NOW()',_0x1d7d('0x9e'))['field']('id','ContactId')[_0x1d7d('0x48')](_0x582172[_0x1d7d('0xa1')][_0x1d7d('0x85')](),_0x1d7d('0xa0'))[_0x1d7d('0x48')](_0x44d30c['params']['id'][_0x1d7d('0x85')](),_0x1d7d('0x63'))[_0x1d7d('0x48')](_0x1d7d('0xa2'),_0x1d7d('0x5e'))[_0x1d7d('0x48')]('NOW()',_0x1d7d('0x5f'))[_0x1d7d('0xa3')](_0x1d7d('0xa4'))[_0x1d7d('0x43')](_0x1d7d('0xa5'))[_0x1d7d('0x43')](_0x1d7d('0xa6'),_0x582172['CmListId'][_0x1d7d('0x85')]())[_0x1d7d('0x43')](_0x1d7d('0xa7'))[_0x1d7d('0x43')](_0x1d7d('0xa8'),squel['select']()[_0x1d7d('0x48')](_0x1d7d('0xa9'))[_0x1d7d('0xa3')](_0x1d7d('0xaa'))['where']('VoiceQueueId\x20=\x20?',_0x44d30c[_0x1d7d('0x4d')]['id'][_0x1d7d('0x85')]()))[_0x1d7d('0x43')](_0x1d7d('0xa8'),squel[_0x1d7d('0x7e')]()['field'](_0x1d7d('0xab'))[_0x1d7d('0xa3')](_0x1d7d('0x9b'))['where'](_0x1d7d('0x82'),_0x44d30c[_0x1d7d('0x4d')]['id'][_0x1d7d('0x85')]())))[_0x1d7d('0x85')]();break;case'onlyIfOpen':_0x5cd9e5=squel[_0x1d7d('0x9a')]()[_0x1d7d('0xac')](_0x1d7d('0x9b'))['fromQuery']([_0x1d7d('0x9d'),_0x1d7d('0x9e'),_0x1d7d('0x9f'),_0x1d7d('0xa0'),'VoiceQueueId','createdAt',_0x1d7d('0x5f')],squel[_0x1d7d('0x7e')]()[_0x1d7d('0x48')](_0x1d7d('0x9d'),_0x1d7d('0x9d'))['field'](_0x1d7d('0xa2'),'scheduledAt')[_0x1d7d('0x48')]('id',_0x1d7d('0x9f'))['field'](_0x582172[_0x1d7d('0xa1')]['toString'](),_0x1d7d('0xa0'))[_0x1d7d('0x48')](_0x44d30c['params']['id'][_0x1d7d('0x85')](),'VoiceQueueId')[_0x1d7d('0x48')](_0x1d7d('0xa2'),_0x1d7d('0x5e'))[_0x1d7d('0x48')]('NOW()','updatedAt')[_0x1d7d('0xa3')](_0x1d7d('0xa4'))[_0x1d7d('0x43')](_0x1d7d('0xa5'))[_0x1d7d('0x43')](_0x1d7d('0xa6'),_0x582172[_0x1d7d('0xa1')][_0x1d7d('0x85')]())[_0x1d7d('0x43')](_0x1d7d('0xa7'))[_0x1d7d('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1d7d('0x7e')]()[_0x1d7d('0x48')](_0x1d7d('0xab'))[_0x1d7d('0xa3')](_0x1d7d('0x9b'))['where']('VoiceQueueId\x20=\x20?',_0x44d30c[_0x1d7d('0x4d')]['id'][_0x1d7d('0x85')]())))['toString']();break;default:_0x5cd9e5=squel[_0x1d7d('0x9a')]()[_0x1d7d('0xac')]('cm_hopper')[_0x1d7d('0x9c')](['phone',_0x1d7d('0x9e'),_0x1d7d('0x9f'),_0x1d7d('0xa0'),'VoiceQueueId',_0x1d7d('0x5e'),_0x1d7d('0x5f')],squel[_0x1d7d('0x7e')]()[_0x1d7d('0x48')](_0x1d7d('0x9d'),_0x1d7d('0x9d'))[_0x1d7d('0x48')](_0x1d7d('0xa2'),_0x1d7d('0x9e'))[_0x1d7d('0x48')]('id',_0x1d7d('0x9f'))[_0x1d7d('0x48')](_0x582172[_0x1d7d('0xa1')]['toString'](),_0x1d7d('0xa0'))[_0x1d7d('0x48')](_0x44d30c[_0x1d7d('0x4d')]['id'][_0x1d7d('0x85')](),_0x1d7d('0x63'))[_0x1d7d('0x48')](_0x1d7d('0xa2'),_0x1d7d('0x5e'))[_0x1d7d('0x48')]('NOW()',_0x1d7d('0x5f'))[_0x1d7d('0xa3')]('cm_contacts')['where'](_0x1d7d('0xa5'))['where'](_0x1d7d('0xa6'),_0x582172[_0x1d7d('0xa1')][_0x1d7d('0x85')]())[_0x1d7d('0x43')](_0x1d7d('0xa7')))[_0x1d7d('0x85')]();}_0x15817c[_0x1d7d('0x84')](db[_0x1d7d('0x8c')][_0x1d7d('0x3a')](_0x5cd9e5));}return BPromise[_0x1d7d('0x8a')](_0x15817c);}})[_0x1d7d('0x28')](function(){return _0x477415;})[_0x1d7d('0x28')](respondWithResult(_0x4288a7,null))[_0x1d7d('0x4c')](handleError(_0x4288a7,null));};exports[_0x1d7d('0xad')]=function(_0x2d3060,_0x1925fc,_0x2bb9f3){return db[_0x1d7d('0x37')][_0x1d7d('0x5c')]({'where':{'id':_0x2d3060[_0x1d7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1925fc,null))['then'](function(_0x366121){if(_0x366121){return _0x366121['removeLists'](_0x2d3060['query']['ids']);}})[_0x1d7d('0x28')](function(_0x2369e9){if(_0x2369e9){return db[_0x1d7d('0x62')][_0x1d7d('0x29')]({'where':{'ListId':_0x2d3060['query'][_0x1d7d('0x7d')],'VoiceQueueId':_0x2d3060['params']['id']}})[_0x1d7d('0x28')](function(){return _0x2369e9;});}})['then'](respondWithStatusCode(_0x1925fc,null))[_0x1d7d('0x4c')](handleError(_0x1925fc,null));};exports[_0x1d7d('0xae')]=function(_0x4e36cd,_0x364ea8,_0x526248){var _0x2428c8={};var _0xd7385e={};var _0x4e0622;var _0x2d5fcd;return db['VoiceQueue'][_0x1d7d('0x61')]({'where':{'id':_0x4e36cd['params']['id']}})['then'](handleEntityNotFound(_0x364ea8,null))[_0x1d7d('0x28')](function(_0x275307){if(_0x275307){_0x4e0622=_0x275307;_0xd7385e[_0x1d7d('0x38')]=_[_0x1d7d('0x39')](db[_0x1d7d('0xaf')][_0x1d7d('0x4e')]);_0xd7385e['query']=_[_0x1d7d('0x39')](_0x4e36cd['query']);_0xd7385e['filters']=_['intersection'](_0xd7385e[_0x1d7d('0x38')],_0xd7385e['query']);_0x2428c8['attributes']=_['intersection'](_0xd7385e[_0x1d7d('0x38')],qs['fields'](_0x4e36cd[_0x1d7d('0x3a')][_0x1d7d('0x3d')]));_0x2428c8[_0x1d7d('0x3c')]=_0x2428c8[_0x1d7d('0x3c')][_0x1d7d('0x3e')]?_0x2428c8[_0x1d7d('0x3c')]:_0xd7385e[_0x1d7d('0x38')];_0x2428c8['order']=qs[_0x1d7d('0x42')](_0x4e36cd['query'][_0x1d7d('0x42')]);_0x2428c8[_0x1d7d('0x43')]=qs['filters'](_['pick'](_0x4e36cd[_0x1d7d('0x3a')],_0xd7385e['filters']));if(_0x4e36cd['query'][_0x1d7d('0x2c')]){_0x2428c8[_0x1d7d('0x43')]=_[_0x1d7d('0x46')](_0x2428c8[_0x1d7d('0x43')],{'$or':_[_0x1d7d('0x2e')](_0x2428c8[_0x1d7d('0x3c')],function(_0x4a6bab){var _0xb941c1={};_0xb941c1[_0x4a6bab]={'$like':'%'+_0x4e36cd['query']['filter']+'%'};return _0xb941c1;})});}_0x2428c8=_[_0x1d7d('0x46')]({},_0x2428c8,_0x4e36cd[_0x1d7d('0x4f')]);return _0x4e0622[_0x1d7d('0xae')](_0x2428c8);}})[_0x1d7d('0x28')](function(_0x50b6f9){if(_0x50b6f9){_0x2d5fcd=_0x50b6f9[_0x1d7d('0x3e')];if(!_0x4e36cd[_0x1d7d('0x3a')][_0x1d7d('0x3f')](_0x1d7d('0x40'))){_0x2428c8['limit']=qs[_0x1d7d('0x22')](_0x4e36cd[_0x1d7d('0x3a')][_0x1d7d('0x22')]);_0x2428c8[_0x1d7d('0x21')]=qs['offset'](_0x4e36cd[_0x1d7d('0x3a')]['offset']);}return _0x4e0622[_0x1d7d('0xae')](_0x2428c8);}})[_0x1d7d('0x28')](function(_0x238897){if(_0x238897){return _0x238897?{'count':_0x2d5fcd,'rows':_0x238897}:null;}})['then'](respondWithResult(_0x364ea8,null))[_0x1d7d('0x4c')](handleError(_0x364ea8,null));};exports[_0x1d7d('0xb0')]=function(_0x354aa0,_0x3fe599,_0x6b58c7){var _0x33219c,_0xf193ff;return db[_0x1d7d('0x37')][_0x1d7d('0x5c')]({'where':{'id':_0x354aa0[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3fe599,null))[_0x1d7d('0x28')](function(_0x263a30){if(_0x263a30){_0xf193ff=_0x263a30;return _0x263a30[_0x1d7d('0xb0')](_0x354aa0[_0x1d7d('0x51')][_0x1d7d('0x7d')],_[_0x1d7d('0x5d')](_0x354aa0[_0x1d7d('0x51')],[_0x1d7d('0x7d'),'id'])||{});}return null;})[_0x1d7d('0x97')](function(_0x482576){var _0x397f39;_0x33219c=_0x482576||[];var _0x2627c7=[];if(_0x482576){for(var _0x520ac2=0x0;_0x520ac2<_0x482576[_0x1d7d('0x3e')];_0x520ac2+=0x1){var _0x29e477=_0x482576[_0x520ac2][_0x1d7d('0x2a')]({'plain':!![]});_0x397f39=squel[_0x1d7d('0x9a')]()['into']('cm_hopper_black')[_0x1d7d('0x9c')]([_0x1d7d('0x9d'),_0x1d7d('0x9f'),'ListId',_0x1d7d('0x63'),_0x1d7d('0x5e'),_0x1d7d('0x5f')],squel[_0x1d7d('0x7e')]()[_0x1d7d('0x48')](_0x1d7d('0x9d'),_0x1d7d('0x9d'))['field']('id',_0x1d7d('0x9f'))[_0x1d7d('0x48')](_0x29e477['CmListId'][_0x1d7d('0x85')](),_0x1d7d('0xa0'))[_0x1d7d('0x48')](_0x354aa0[_0x1d7d('0x4d')]['id']['toString'](),_0x1d7d('0x63'))[_0x1d7d('0x48')](_0x1d7d('0xa2'),'createdAt')[_0x1d7d('0x48')](_0x1d7d('0xa2'),'updatedAt')[_0x1d7d('0xa3')](_0x1d7d('0xa4'))[_0x1d7d('0x43')]('deletedAt\x20IS\x20NULL')[_0x1d7d('0x43')](_0x1d7d('0xa6'),_0x29e477[_0x1d7d('0xa1')][_0x1d7d('0x85')]())[_0x1d7d('0x43')](_0x1d7d('0xa7')))[_0x1d7d('0x85')]();_0x2627c7[_0x1d7d('0x84')](db[_0x1d7d('0x8c')][_0x1d7d('0x3a')](_0x397f39));}return BPromise[_0x1d7d('0x8a')](_0x2627c7);}})[_0x1d7d('0x28')](function(){return _0x33219c;})[_0x1d7d('0x28')](respondWithResult(_0x3fe599,null))['catch'](handleError(_0x3fe599,null));};exports['removeBlackLists']=function(_0x2b86a8,_0x20e81e,_0x78890d){return db['VoiceQueue']['find']({'where':{'id':_0x2b86a8[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x20e81e,null))[_0x1d7d('0x28')](function(_0x3a6e56){if(_0x3a6e56){return _0x3a6e56['removeBlackLists'](_0x2b86a8[_0x1d7d('0x3a')][_0x1d7d('0x7d')]);}})[_0x1d7d('0x28')](function(_0x4caf34){if(_0x4caf34){return db[_0x1d7d('0x6a')][_0x1d7d('0x29')]({'where':{'ListId':_0x2b86a8[_0x1d7d('0x3a')][_0x1d7d('0x7d')],'VoiceQueueId':_0x2b86a8[_0x1d7d('0x4d')]['id']}})[_0x1d7d('0x28')](function(){return _0x4caf34;});}})[_0x1d7d('0x28')](respondWithStatusCode(_0x20e81e,null))[_0x1d7d('0x4c')](handleError(_0x20e81e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 53efcef..43b5921 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 _0xd4ab=['hook','exports','events','VoiceQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x155ad1,_0x4b1f6b){var _0x2d09c4=function(_0xa0a95){while(--_0xa0a95){_0x155ad1['push'](_0x155ad1['shift']());}};_0x2d09c4(++_0x4b1f6b);}(_0xd4ab,0xb6));var _0xbd4a=function(_0x20256d,_0x389b5d){_0x20256d=_0x20256d-0x0;var _0x523a83=_0xd4ab[_0x20256d];return _0x523a83;};'use strict';var EventEmitter=require(_0xbd4a('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xbd4a('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd4a('0x2'),'afterUpdate':_0xbd4a('0x3'),'afterDestroy':_0xbd4a('0x4')};function emitEvent(_0xf2e22){return function(_0x373180,_0x61d676,_0x518cc9){VoiceQueueEvents[_0xbd4a('0x5')](_0xf2e22+':'+_0x373180['id'],_0x373180);VoiceQueueEvents['emit'](_0xf2e22,_0x373180);_0x518cc9(null);};}for(var e in events){if(events[_0xbd4a('0x6')](e)){var event=events[e];VoiceQueue[_0xbd4a('0x7')](e,emitEvent(event));}}module[_0xbd4a('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x692a=['remove','emit','hasOwnProperty','hook','exports','events','VoiceQueue','save','update'];(function(_0xc28ca6,_0x3a6c98){var _0x4fcde4=function(_0x38a0b5){while(--_0x38a0b5){_0xc28ca6['push'](_0xc28ca6['shift']());}};_0x4fcde4(++_0x3a6c98);}(_0x692a,0x15b));var _0xa692=function(_0x290503,_0x11fac6){_0x290503=_0x290503-0x0;var _0x8a2e22=_0x692a[_0x290503];return _0x8a2e22;};'use strict';var EventEmitter=require(_0xa692('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xa692('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa692('0x2'),'afterUpdate':_0xa692('0x3'),'afterDestroy':_0xa692('0x4')};function emitEvent(_0x1e39bd){return function(_0x374747,_0x1dd163,_0x144de6){VoiceQueueEvents[_0xa692('0x5')](_0x1e39bd+':'+_0x374747['id'],_0x374747);VoiceQueueEvents[_0xa692('0x5')](_0x1e39bd,_0x374747);_0x144de6(null);};}for(var e in events){if(events[_0xa692('0x6')](e)){var event=events[e];VoiceQueue[_0xa692('0x7')](e,emitEvent(event));}}module[_0xa692('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d3358ea..b50c74e 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 _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceQueue.attributes','define','voice_queues'];(function(_0x2fd0df,_0x32be85){var _0x269922=function(_0x2562f1){while(--_0x2562f1){_0x2fd0df['push'](_0x2fd0df['shift']());}};_0x269922(++_0x32be85);}(_0xac4a,0x13f));var _0xaac4=function(_0x1cabcd,_0x51015a){_0x1cabcd=_0x1cabcd-0x0;var _0x2bd92e=_0xac4a[_0x1cabcd];return _0x2bd92e;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('VoiceQueue',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x489497,_0x5529f1){var _0x29da2c=function(_0x393fb5){while(--_0x393fb5){_0x489497['push'](_0x489497['shift']());}};_0x29da2c(++_0x5529f1);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2c3803,_0x380eb6){_0x2c3803=_0x2c3803-0x0;var _0x51c7d0=_0xee5b[_0x2c3803];return _0x51c7d0;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('VoiceQueue',attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6d7a70a..ede6e4f 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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x2a45ad,_0x3a70ed){var _0x20c4c8=function(_0x4db723){while(--_0x4db723){_0x2a45ad['push'](_0x2a45ad['shift']());}};_0x20c4c8(++_0x3a70ed);}(_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 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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file +var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x40baad,_0x5863ae){var _0x5244b7=function(_0x16d6e4){while(--_0x16d6e4){_0x40baad['push'](_0x40baad['shift']());}};_0x5244b7(++_0x5863ae);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 784925f..9993386 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 _0x001c=['./voiceQueue.events','save','remove','update','register','length'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x001c,0x19e));var _0xc001=function(_0x39a3ba,_0x29970b){_0x39a3ba=_0x39a3ba-0x0;var _0x27f0cc=_0x001c[_0x39a3ba];return _0x27f0cc;};'use strict';var VoiceQueueEvents=require(_0xc001('0x0'));var events=[_0xc001('0x1'),_0xc001('0x2'),_0xc001('0x3')];function createListener(_0x1adb4f,_0x18c064){return function(_0x4d037f){_0x18c064['emit'](_0x1adb4f,_0x4d037f);};}function removeListener(_0x4287ee,_0x190af2){return function(){VoiceQueueEvents['removeListener'](_0x4287ee,_0x190af2);};}exports[_0xc001('0x4')]=function(_0x4ec656){for(var _0x2829d2=0x0,_0x5009f8=events[_0xc001('0x5')];_0x2829d2<_0x5009f8;_0x2829d2++){var _0x44f200=events[_0x2829d2];var _0x4387e7=createListener('voiceQueue:'+_0x44f200,_0x4ec656);VoiceQueueEvents['on'](_0x44f200,_0x4387e7);}}; \ No newline at end of file +var _0x122a=['removeListener','register','length','voiceQueue:','save','update'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x122a,0x1ea));var _0xa122=function(_0x304af7,_0x118651){_0x304af7=_0x304af7-0x0;var _0x1a7abe=_0x122a[_0x304af7];return _0x1a7abe;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xa122('0x0'),'remove',_0xa122('0x1')];function createListener(_0x56abef,_0x1a56e5){return function(_0x2bed3b){_0x1a56e5['emit'](_0x56abef,_0x2bed3b);};}function removeListener(_0x56c5cb,_0x25d49c){return function(){VoiceQueueEvents[_0xa122('0x2')](_0x56c5cb,_0x25d49c);};}exports[_0xa122('0x3')]=function(_0x3b283c){for(var _0x3d9557=0x0,_0x1c6978=events[_0xa122('0x4')];_0x3d9557<_0x1c6978;_0x3d9557++){var _0x5f52fe=events[_0x3d9557];var _0x5bcfcb=createListener(_0xa122('0x5')+_0x5f52fe,_0x3b283c);VoiceQueueEvents['on'](_0x5f52fe,_0x5bcfcb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index f48dc5a..a53f82c 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 _0x152e=['/describe','describe','getVoiceQueuesReport','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','get'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x152e,0x15f));var _0xe152=function(_0x27c99a,_0x46adc6){_0x27c99a=_0x27c99a-0x0;var _0x1653d3=_0x152e[_0x27c99a];return _0x1653d3;};'use strict';var multer=require(_0xe152('0x0'));var util=require('util');var path=require(_0xe152('0x1'));var timeout=require('connect-timeout');var express=require(_0xe152('0x2'));var router=express[_0xe152('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe152('0x4'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xe152('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe152('0x5')](_0xe152('0x6'),auth['isAuthenticated'](),controller[_0xe152('0x7')]);router['get']('/index',auth['isAuthenticated'](),controller[_0xe152('0x8')]);router[_0xe152('0x5')](_0xe152('0x9'),auth[_0xe152('0xa')](),controller[_0xe152('0xb')]);router['post']('/',auth[_0xe152('0xa')](),controller[_0xe152('0xc')]);router[_0xe152('0xd')](_0xe152('0x9'),auth[_0xe152('0xa')](),controller[_0xe152('0xe')]);router['delete']('/:id',auth[_0xe152('0xa')](),controller[_0xe152('0xf')]);module[_0xe152('0x10')]=router; \ No newline at end of file +var _0x2c80=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x5b8aef,_0x19913e){var _0x183077=function(_0x457200){while(--_0x457200){_0x5b8aef['push'](_0x5b8aef['shift']());}};_0x183077(++_0x19913e);}(_0x2c80,0x147));var _0x02c8=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x2c80[_0x350182];return _0x4a0892;};'use strict';var multer=require(_0x02c8('0x0'));var util=require(_0x02c8('0x1'));var path=require(_0x02c8('0x2'));var timeout=require(_0x02c8('0x3'));var express=require(_0x02c8('0x4'));var router=express[_0x02c8('0x5')]();var auth=require(_0x02c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x02c8('0x7'));var controller=require(_0x02c8('0x8'));router[_0x02c8('0x9')]('/',auth[_0x02c8('0xa')](),controller[_0x02c8('0xb')]);router[_0x02c8('0x9')](_0x02c8('0xc'),auth[_0x02c8('0xa')](),controller[_0x02c8('0xd')]);router[_0x02c8('0x9')](_0x02c8('0xe'),auth[_0x02c8('0xa')](),controller[_0x02c8('0xf')]);router[_0x02c8('0x9')](_0x02c8('0x10'),auth[_0x02c8('0xa')](),controller[_0x02c8('0x11')]);router['post']('/',auth[_0x02c8('0xa')](),controller[_0x02c8('0x12')]);router[_0x02c8('0x13')](_0x02c8('0x10'),auth[_0x02c8('0xa')](),controller[_0x02c8('0x14')]);router[_0x02c8('0x15')](_0x02c8('0x10'),auth[_0x02c8('0xa')](),controller[_0x02c8('0x16')]);module[_0x02c8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ad11da7..47ab5ea 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 _0x376d=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','getDataValue','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','DATE'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x376d,0xf9));var _0xd376=function(_0x21e46b,_0x5aec9a){_0x21e46b=_0x21e46b-0x0;var _0x544823=_0x376d[_0x21e46b];return _0x544823;};'use strict';var Sequelize=require(_0xd376('0x0'));var moment=require(_0xd376('0x1'));module[_0xd376('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd376('0x3')]},'calleridnum':{'type':Sequelize[_0xd376('0x3')]},'calleridname':{'type':Sequelize[_0xd376('0x3')]},'queue':{'type':Sequelize[_0xd376('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x3082ae){var _0x4ef806=moment(_0x3082ae);var _0x49fe58=moment(this[_0xd376('0x4')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x51dd99=_0x4ef806['diff'](_0x49fe58,_0xd376('0x5'));this[_0xd376('0x6')](_0xd376('0x7'),_0x3082ae);this['setDataValue']('holdtime',_0x51dd99||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xd376('0x8')]},'queuecallerabandon':{'type':Sequelize[_0xd376('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xd376('0xa')]},'queuecallercomplete':{'type':Sequelize[_0xd376('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd376('0xa')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd376('0xa')]},'queuecallerexitreason':{'type':Sequelize[_0xd376('0x3')],'comment':_0xd376('0xb')},'originalposition':{'type':Sequelize[_0xd376('0x8')]},'channel':{'type':Sequelize[_0xd376('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd376('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xd376('0x3')]},'priority':{'type':Sequelize[_0xd376('0x3')]},'holdtime':{'type':Sequelize[_0xd376('0x8')]},'mohtime':{'type':Sequelize[_0xd376('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd376('0x3')]},'transfer':{'type':Sequelize[_0xd376('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd376('0x3')],'comment':_0xd376('0xc')},'transferexten':{'type':Sequelize[_0xd376('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xd376('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xd376('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4052=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x57b846,_0x127376){var _0x515681=function(_0x535025){while(--_0x535025){_0x57b846['push'](_0x57b846['shift']());}};_0x515681(++_0x127376);}(_0x4052,0x150));var _0x2405=function(_0x5e4915,_0x4446f5){_0x5e4915=_0x5e4915-0x0;var _0x4afd52=_0x4052[_0x5e4915];return _0x4afd52;};'use strict';var Sequelize=require(_0x2405('0x0'));var moment=require(_0x2405('0x1'));module[_0x2405('0x2')]={'type':{'type':Sequelize[_0x2405('0x3')]},'uniqueid':{'type':Sequelize[_0x2405('0x3')]},'calleridnum':{'type':Sequelize[_0x2405('0x3')]},'calleridname':{'type':Sequelize[_0x2405('0x3')]},'queue':{'type':Sequelize[_0x2405('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x2405('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x42550d){var _0x300b6c=moment(_0x42550d);var _0x57c640=moment(this[_0x2405('0x5')](_0x2405('0x6')))[_0x2405('0x7')](_0x2405('0x8'));var _0x121d5d=_0x300b6c['diff'](_0x57c640,_0x2405('0x9'));this[_0x2405('0xa')]('queuecallerleaveAt',_0x42550d);this['setDataValue'](_0x2405('0xb'),_0x121d5d||null);}},'position':{'type':Sequelize[_0x2405('0xc')]},'count':{'type':Sequelize[_0x2405('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x2405('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2405('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x2405('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2405('0x4')]},'queuecallerexit':{'type':Sequelize[_0x2405('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2405('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x2405('0xc')]},'channel':{'type':Sequelize[_0x2405('0x3')]},'connectedlinenum':{'type':Sequelize[_0x2405('0x3')]},'connectedlinename':{'type':Sequelize[_0x2405('0x3')]},'accountcode':{'type':Sequelize[_0x2405('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2405('0x3')]},'priority':{'type':Sequelize[_0x2405('0x3')]},'holdtime':{'type':Sequelize[_0x2405('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2405('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2405('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2405('0x3')],'comment':_0x2405('0xe')},'transferexten':{'type':Sequelize[_0x2405('0x3')]},'transferuniqueid':{'type':Sequelize[_0x2405('0x3')]},'disposition':{'type':Sequelize[_0x2405('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x2405('0xc')],'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 0f679dd..d14da20 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 _0x54ef=['error','name','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','field','options','VoiceQueueReport','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','describe','getVoiceQueuesReport','hasOwnProperty','filter','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x54ef,0x112));var _0xf54e=function(_0x2f2e74,_0x34efa7){_0x2f2e74=_0x2f2e74-0x0;var _0x383980=_0x54ef[_0x2f2e74];return _0x383980;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);function respondWithStatusCode(_0x5644aa,_0x331732){_0x331732=_0x331732||0xcc;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1d')](_0x331732);}return _0x5644aa[_0xf54e('0x1e')](_0x331732)['end']();};}function respondWithResult(_0x2366ee,_0x389abc){_0x389abc=_0x389abc||0xc8;return function(_0x3eb415){if(_0x3eb415){return _0x2366ee['status'](_0x389abc)['json'](_0x3eb415);}};}function respondWithFilteredResult(_0xd87020,_0x41fb35){return function(_0x1c02e7){if(_0x1c02e7){var _0x9647f=_0x1c02e7[_0xf54e('0x1f')],_0x15cc48=_0x41fb35[_0xf54e('0x20')],_0x3e7d96=_0x41fb35[_0xf54e('0x20')]+_0x41fb35[_0xf54e('0x21')],_0x2e27b6;if(_0x3e7d96>=_0x9647f){_0x3e7d96=_0x9647f;_0x2e27b6=0xc8;}else{_0x2e27b6=0xce;}_0xd87020['status'](_0x2e27b6);return _0xd87020['set'](_0xf54e('0x22'),_0x15cc48+'-'+_0x3e7d96+'/'+_0x9647f)['json'](_0x1c02e7);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x23')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x24')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x25')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x26')](_0x388aa0)[_0xf54e('0x27')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x28')]()[_0xf54e('0x27')](function(){_0x6f6d29[_0xf54e('0x1e')](0xcc)[_0xf54e('0x29')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x1d')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x2a')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x2b')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1e')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2c')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={},_0x25b643={},_0x3993e4={'count':0x0,'rows':[]};var _0x36f985=db['VoiceQueueReport']['rawAttributes'];_0x25b643[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](_0x36f985);_0x25b643[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0x269f47[_0xf54e('0x2f')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2d')],_0x25b643[_0xf54e('0x2f')]);_0xa13cd0[_0xf54e('0x32')]=_['intersection'](_0x25b643['model'],qs[_0xf54e('0x33')](_0x269f47[_0xf54e('0x2f')]['fields']));_0xa13cd0[_0xf54e('0x32')]=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643['model'];if(!_0x269f47['query']['hasOwnProperty'](_0xf54e('0x35'))){_0xa13cd0[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x269f47[_0xf54e('0x2f')][_0xf54e('0x21')]);_0xa13cd0[_0xf54e('0x20')]=qs['offset'](_0x269f47['query']['offset']);}_0xa13cd0[_0xf54e('0x36')]=qs[_0xf54e('0x37')](_0x269f47['query']['sort']);_0xa13cd0[_0xf54e('0x38')]=qs[_0xf54e('0x30')](_[_0xf54e('0x39')](_0x269f47['query'],_0x25b643[_0xf54e('0x30')]));if(_0x269f47[_0xf54e('0x2f')]['filter']){_0xa13cd0[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0xa13cd0[_0xf54e('0x38')],{'$or':_[_0xf54e('0x3b')](_0x36f985,function(_0x12ef97){if(_0x12ef97[_0xf54e('0x3c')]['key']!=='VIRTUAL'){var _0x3d5a68={};_0x3d5a68[_0x12ef97[_0xf54e('0x3d')]]={'$like':'%'+_0x269f47[_0xf54e('0x2f')]['filter']+'%'};return _0x3d5a68;}})});}_0xa13cd0=_[_0xf54e('0x3a')]({},_0xa13cd0,_0x269f47[_0xf54e('0x3e')]);var _0x448054={'where':_0xa13cd0[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1f')](_0x448054)[_0xf54e('0x27')](function(_0x1345b0){_0x3993e4[_0xf54e('0x1f')]=_0x1345b0;if(_0x269f47[_0xf54e('0x2f')][_0xf54e('0x40')]){_0xa13cd0[_0xf54e('0x41')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x42')](_0xa13cd0);})[_0xf54e('0x27')](function(_0x5085c1){_0x3993e4['rows']=_0x5085c1;return _0x3993e4;})['then'](respondWithFilteredResult(_0x21ba00,_0xa13cd0))[_0xf54e('0x43')](handleError(_0x21ba00,null));};exports[_0xf54e('0x44')]=function(_0x5398b2,_0x3dae9b){var _0x311ce1={'raw':![],'where':{'id':_0x5398b2['params']['id']}},_0x381c03={};_0x381c03[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](db[_0xf54e('0x3f')][_0xf54e('0x45')]);_0x381c03[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0x5398b2[_0xf54e('0x2f')]);_0x381c03[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x381c03['model'],_0x381c03[_0xf54e('0x2f')]);_0x311ce1[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x381c03[_0xf54e('0x2d')],qs[_0xf54e('0x33')](_0x5398b2[_0xf54e('0x2f')]['fields']));_0x311ce1[_0xf54e('0x32')]=_0x311ce1['attributes'][_0xf54e('0x34')]?_0x311ce1['attributes']:_0x381c03[_0xf54e('0x2d')];if(_0x5398b2[_0xf54e('0x2f')][_0xf54e('0x40')]){_0x311ce1['include']=[{'all':!![]}];}_0x311ce1=_[_0xf54e('0x3a')]({},_0x311ce1,_0x5398b2[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x46')](_0x311ce1)[_0xf54e('0x27')](handleEntityNotFound(_0x3dae9b,null))['then'](respondWithResult(_0x3dae9b,null))[_0xf54e('0x43')](handleError(_0x3dae9b,null));};exports[_0xf54e('0x47')]=function(_0x346bb4,_0x45592b){return db['VoiceQueueReport'][_0xf54e('0x47')](_0x346bb4[_0xf54e('0x48')],{})['then'](respondWithResult(_0x45592b,0xc9))[_0xf54e('0x43')](handleError(_0x45592b,null));};exports[_0xf54e('0x26')]=function(_0x3d24c7,_0xca0141){if(_0x3d24c7['body']['id']){delete _0x3d24c7[_0xf54e('0x48')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x46')]({'where':{'id':_0x3d24c7[_0xf54e('0x49')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0xca0141,null))[_0xf54e('0x27')](saveUpdates(_0x3d24c7[_0xf54e('0x48')],null))[_0xf54e('0x27')](respondWithResult(_0xca0141,null))[_0xf54e('0x43')](handleError(_0xca0141,null));};exports[_0xf54e('0x28')]=function(_0xaf9bf0,_0x1f4cf8){return db[_0xf54e('0x3f')][_0xf54e('0x46')]({'where':{'id':_0xaf9bf0[_0xf54e('0x49')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x1f4cf8,null))[_0xf54e('0x27')](removeEntity(_0x1f4cf8,null))[_0xf54e('0x43')](handleError(_0x1f4cf8,null));};exports[_0xf54e('0x4a')]=function(_0x480c44,_0x4e25e4){return db['VoiceQueueReport'][_0xf54e('0x4a')]()[_0xf54e('0x27')](respondWithResult(_0x4e25e4,null))[_0xf54e('0x43')](handleError(_0x4e25e4,null));};exports[_0xf54e('0x4b')]=function(_0xba297c,_0x3b7f40){var _0x22763f={},_0x149d0b={},_0x89b811={'count':0x0,'rows':[]};_0x149d0b[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](db['VoiceQueueReport'][_0xf54e('0x45')]);_0x149d0b[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0xba297c[_0xf54e('0x2f')]);_0x149d0b[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x149d0b[_0xf54e('0x2d')],_0x149d0b['query']);_0x22763f[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x149d0b[_0xf54e('0x2d')],qs['fields'](_0xba297c[_0xf54e('0x2f')]['fields']));_0x22763f[_0xf54e('0x32')]=_0x22763f[_0xf54e('0x32')][_0xf54e('0x34')]?_0x22763f['attributes']:_0x149d0b[_0xf54e('0x2d')];if(!_0xba297c[_0xf54e('0x2f')][_0xf54e('0x4c')](_0xf54e('0x35'))){_0x22763f[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0xba297c[_0xf54e('0x2f')]['limit']);_0x22763f['offset']=qs[_0xf54e('0x20')](_0xba297c[_0xf54e('0x2f')]['offset']);}_0x22763f[_0xf54e('0x36')]=qs['sort'](_0xba297c[_0xf54e('0x2f')]['sort']);_0x22763f[_0xf54e('0x38')]=qs[_0xf54e('0x30')](_[_0xf54e('0x39')](_0xba297c[_0xf54e('0x2f')],_0x149d0b[_0xf54e('0x30')]));if(_0xba297c[_0xf54e('0x2f')]['filter']){_0x22763f['where']=_[_0xf54e('0x3a')](_0x22763f[_0xf54e('0x38')],{'$or':_['map'](_0x22763f['attributes'],function(_0x2a5e54){var _0x511a99={};_0x511a99[_0x2a5e54]={'$like':'%'+_0xba297c[_0xf54e('0x2f')][_0xf54e('0x4d')]+'%'};return _0x511a99;})});}_0x22763f=_[_0xf54e('0x3a')]({},_0x22763f,_0xba297c[_0xf54e('0x3e')]);var _0x1d7c52={'where':_0x22763f[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1f')](_0x1d7c52)[_0xf54e('0x27')](function(_0x4d8040){_0x89b811[_0xf54e('0x1f')]=_0x4d8040;if(_0xba297c[_0xf54e('0x2f')][_0xf54e('0x40')]){_0x22763f[_0xf54e('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xf54e('0x42')](_0x22763f);})[_0xf54e('0x27')](function(_0xb7ff4d){_0x89b811[_0xf54e('0x4e')]=_0xb7ff4d;return _0x89b811;})[_0xf54e('0x27')](respondWithFilteredResult(_0x3b7f40,_0x22763f,'getVoiceQueuesReport'))[_0xf54e('0x43')](handleError(_0x3b7f40,null,_0xf54e('0x4b')));}; \ No newline at end of file +var _0xf4eb=['length','hasOwnProperty','order','sort','filter','where','merge','map','type','field','count','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','describe','getVoiceQueuesReport','nolimit','pick','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','./voiceQueueReport.socket','register','end','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','VoiceQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4eb,0xec));var _0xbf4e=function(_0xf13291,_0x5b369a){_0xf13291=_0xf13291-0x0;var _0x3706b1=_0xf4eb[_0xf13291];return _0x3706b1;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var hardwareService=require(_0xbf4e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xbf4e('0x10'));var config=require('../../config/environment');var db=require(_0xbf4e('0x11'))['db'];config[_0xbf4e('0x12')]=_['defaults'](config[_0xbf4e('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x12')]));require(_0xbf4e('0x13'))[_0xbf4e('0x14')](socket);function respondWithStatusCode(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xcc;return function(_0x61bd54){if(_0x61bd54){return _0x302841['sendStatus'](_0x3b74bd);}return _0x302841['status'](_0x3b74bd)[_0xbf4e('0x15')]();};}function respondWithResult(_0x1735ae,_0x28fc6b){_0x28fc6b=_0x28fc6b||0xc8;return function(_0x542909){if(_0x542909){return _0x1735ae[_0xbf4e('0x16')](_0x28fc6b)[_0xbf4e('0x17')](_0x542909);}};}function respondWithFilteredResult(_0x912fc0,_0x320e7d){return function(_0x5a631e){if(_0x5a631e){var _0x247322=_0x5a631e['count'],_0x577c27=_0x320e7d[_0xbf4e('0x18')],_0x5db03f=_0x320e7d[_0xbf4e('0x18')]+_0x320e7d[_0xbf4e('0x19')],_0x566ec3;if(_0x5db03f>=_0x247322){_0x5db03f=_0x247322;_0x566ec3=0xc8;}else{_0x566ec3=0xce;}_0x912fc0['status'](_0x566ec3);return _0x912fc0['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x5db03f+'/'+_0x247322)[_0xbf4e('0x17')](_0x5a631e);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1b')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1c')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1d')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1e')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x1f')]()[_0xbf4e('0x1e')](function(){_0x51648c[_0xbf4e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x20')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x21')]){delete _0x5bcf71[_0xbf4e('0x21')];}_0x2fb490[_0xbf4e('0x16')](_0x5e08b1)[_0xbf4e('0x22')](_0x5bcf71);};}exports['index']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={},_0x4cd4a1={},_0x681c3b={'count':0x0,'rows':[]};var _0x590c85=db[_0xbf4e('0x23')][_0xbf4e('0x24')];_0x4cd4a1[_0xbf4e('0x25')]=_['keys'](_0x590c85);_0x4cd4a1[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x2d4686[_0xbf4e('0x26')]);_0x4cd4a1[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x4cd4a1[_0xbf4e('0x25')],_0x4cd4a1['query']);_0x43879d[_0xbf4e('0x2a')]=_[_0xbf4e('0x29')](_0x4cd4a1['model'],qs[_0xbf4e('0x2b')](_0x2d4686[_0xbf4e('0x26')]['fields']));_0x43879d[_0xbf4e('0x2a')]=_0x43879d['attributes'][_0xbf4e('0x2c')]?_0x43879d['attributes']:_0x4cd4a1[_0xbf4e('0x25')];if(!_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x2d')]('nolimit')){_0x43879d[_0xbf4e('0x19')]=qs[_0xbf4e('0x19')](_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x19')]);_0x43879d[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x2d4686['query'][_0xbf4e('0x18')]);}_0x43879d[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x2f')]);_0x43879d['where']=qs['filters'](_['pick'](_0x2d4686['query'],_0x4cd4a1[_0xbf4e('0x28')]));if(_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x30')]){_0x43879d[_0xbf4e('0x31')]=_[_0xbf4e('0x32')](_0x43879d[_0xbf4e('0x31')],{'$or':_[_0xbf4e('0x33')](_0x590c85,function(_0x467b74){if(_0x467b74[_0xbf4e('0x34')]['key']!=='VIRTUAL'){var _0x303fd8={};_0x303fd8[_0x467b74[_0xbf4e('0x35')]]={'$like':'%'+_0x2d4686[_0xbf4e('0x26')]['filter']+'%'};return _0x303fd8;}})});}_0x43879d=_[_0xbf4e('0x32')]({},_0x43879d,_0x2d4686['options']);var _0x370d90={'where':_0x43879d[_0xbf4e('0x31')]};return db[_0xbf4e('0x23')][_0xbf4e('0x36')](_0x370d90)['then'](function(_0x31d8dc){_0x681c3b[_0xbf4e('0x36')]=_0x31d8dc;if(_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x43879d['include']=[{'all':!![]}];}return db[_0xbf4e('0x23')][_0xbf4e('0x38')](_0x43879d);})[_0xbf4e('0x1e')](function(_0x29fe9d){_0x681c3b[_0xbf4e('0x39')]=_0x29fe9d;return _0x681c3b;})[_0xbf4e('0x1e')](respondWithFilteredResult(_0x8e0ab5,_0x43879d))[_0xbf4e('0x3a')](handleError(_0x8e0ab5,null));};exports['show']=function(_0x176166,_0x7b3a94){var _0x518400={'raw':![],'where':{'id':_0x176166[_0xbf4e('0x3b')]['id']}},_0x47d6f2={};_0x47d6f2[_0xbf4e('0x25')]=_['keys'](db['VoiceQueueReport'][_0xbf4e('0x24')]);_0x47d6f2[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x176166[_0xbf4e('0x26')]);_0x47d6f2[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x47d6f2['model'],_0x47d6f2[_0xbf4e('0x26')]);_0x518400[_0xbf4e('0x2a')]=_['intersection'](_0x47d6f2['model'],qs['fields'](_0x176166['query'][_0xbf4e('0x2b')]));_0x518400['attributes']=_0x518400[_0xbf4e('0x2a')][_0xbf4e('0x2c')]?_0x518400['attributes']:_0x47d6f2['model'];if(_0x176166[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x518400[_0xbf4e('0x3c')]=[{'all':!![]}];}_0x518400=_[_0xbf4e('0x32')]({},_0x518400,_0x176166[_0xbf4e('0x3d')]);return db['VoiceQueueReport'][_0xbf4e('0x3e')](_0x518400)[_0xbf4e('0x1e')](handleEntityNotFound(_0x7b3a94,null))[_0xbf4e('0x1e')](respondWithResult(_0x7b3a94,null))[_0xbf4e('0x3a')](handleError(_0x7b3a94,null));};exports[_0xbf4e('0x3f')]=function(_0x1bc421,_0x4060c7){return db[_0xbf4e('0x23')]['create'](_0x1bc421[_0xbf4e('0x40')],{})[_0xbf4e('0x1e')](respondWithResult(_0x4060c7,0xc9))[_0xbf4e('0x3a')](handleError(_0x4060c7,null));};exports[_0xbf4e('0x41')]=function(_0x9bc1fe,_0x1198e8){if(_0x9bc1fe[_0xbf4e('0x40')]['id']){delete _0x9bc1fe[_0xbf4e('0x40')]['id'];}return db[_0xbf4e('0x23')][_0xbf4e('0x3e')]({'where':{'id':_0x9bc1fe[_0xbf4e('0x3b')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x1198e8,null))[_0xbf4e('0x1e')](saveUpdates(_0x9bc1fe[_0xbf4e('0x40')],null))[_0xbf4e('0x1e')](respondWithResult(_0x1198e8,null))[_0xbf4e('0x3a')](handleError(_0x1198e8,null));};exports[_0xbf4e('0x1f')]=function(_0x5492bf,_0x22d8ef){return db[_0xbf4e('0x23')][_0xbf4e('0x3e')]({'where':{'id':_0x5492bf['params']['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x22d8ef,null))['then'](removeEntity(_0x22d8ef,null))['catch'](handleError(_0x22d8ef,null));};exports[_0xbf4e('0x42')]=function(_0x200393,_0x4d32b3){return db[_0xbf4e('0x23')][_0xbf4e('0x42')]()[_0xbf4e('0x1e')](respondWithResult(_0x4d32b3,null))[_0xbf4e('0x3a')](handleError(_0x4d32b3,null));};exports[_0xbf4e('0x43')]=function(_0x2ac2c8,_0x419969){var _0x1cdd8c={},_0x3cd61b={},_0xc058e1={'count':0x0,'rows':[]};_0x3cd61b[_0xbf4e('0x25')]=_['keys'](db['VoiceQueueReport'][_0xbf4e('0x24')]);_0x3cd61b[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x2ac2c8['query']);_0x3cd61b[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x3cd61b['model'],_0x3cd61b['query']);_0x1cdd8c[_0xbf4e('0x2a')]=_['intersection'](_0x3cd61b['model'],qs[_0xbf4e('0x2b')](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x2b')]));_0x1cdd8c[_0xbf4e('0x2a')]=_0x1cdd8c[_0xbf4e('0x2a')]['length']?_0x1cdd8c[_0xbf4e('0x2a')]:_0x3cd61b['model'];if(!_0x2ac2c8[_0xbf4e('0x26')]['hasOwnProperty'](_0xbf4e('0x44'))){_0x1cdd8c['limit']=qs[_0xbf4e('0x19')](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x19')]);_0x1cdd8c[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x2ac2c8['query']['offset']);}_0x1cdd8c['order']=qs['sort'](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x2f')]);_0x1cdd8c['where']=qs[_0xbf4e('0x28')](_[_0xbf4e('0x45')](_0x2ac2c8[_0xbf4e('0x26')],_0x3cd61b[_0xbf4e('0x28')]));if(_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x30')]){_0x1cdd8c[_0xbf4e('0x31')]=_['merge'](_0x1cdd8c[_0xbf4e('0x31')],{'$or':_[_0xbf4e('0x33')](_0x1cdd8c[_0xbf4e('0x2a')],function(_0x5e548a){var _0x56338e={};_0x56338e[_0x5e548a]={'$like':'%'+_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x30')]+'%'};return _0x56338e;})});}_0x1cdd8c=_[_0xbf4e('0x32')]({},_0x1cdd8c,_0x2ac2c8['options']);var _0x432967={'where':_0x1cdd8c[_0xbf4e('0x31')]};return db[_0xbf4e('0x23')][_0xbf4e('0x36')](_0x432967)[_0xbf4e('0x1e')](function(_0x5532df){_0xc058e1[_0xbf4e('0x36')]=_0x5532df;if(_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x1cdd8c[_0xbf4e('0x3c')]=[{'all':!![]}];}return db[_0xbf4e('0x23')][_0xbf4e('0x38')](_0x1cdd8c);})['then'](function(_0x21cbd2){_0xc058e1['rows']=_0x21cbd2;return _0xc058e1;})[_0xbf4e('0x1e')](respondWithFilteredResult(_0x419969,_0x1cdd8c,_0xbf4e('0x43')))[_0xbf4e('0x3a')](handleError(_0x419969,null,_0xbf4e('0x43')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4d25de8..83c3f85 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 _0x81a2=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x51edbb,_0x56c95d){var _0x5d0b30=function(_0xdbbc63){while(--_0xdbbc63){_0x51edbb['push'](_0x51edbb['shift']());}};_0x5d0b30(++_0x56c95d);}(_0x81a2,0x1e6));var _0x281a=function(_0x4bdb5f,_0x556bc3){_0x4bdb5f=_0x4bdb5f-0x0;var _0x2b9533=_0x81a2[_0x4bdb5f];return _0x2b9533;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x281a('0x0'))['db'][_0x281a('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x281a('0x2')](0x0);var events={'afterCreate':_0x281a('0x3'),'afterUpdate':_0x281a('0x4'),'afterDestroy':_0x281a('0x5')};function emitEvent(_0x4543c0){return function(_0x509496,_0x436bc9,_0x49bdff){VoiceQueueReportEvents[_0x281a('0x6')](_0x4543c0+':'+_0x509496['id'],_0x509496);VoiceQueueReportEvents['emit'](_0x4543c0,_0x509496);_0x49bdff(null);};}for(var e in events){if(events[_0x281a('0x7')](e)){var event=events[e];VoiceQueueReport[_0x281a('0x8')](e,emitEvent(event));}}module[_0x281a('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9c03=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x254b92,_0x4f592d){var _0x8f68f3=function(_0x28036a){while(--_0x28036a){_0x254b92['push'](_0x254b92['shift']());}};_0x8f68f3(++_0x4f592d);}(_0x9c03,0x19d));var _0x39c0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9c03[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x39c0('0x0'));var VoiceQueueReport=require(_0x39c0('0x1'))['db'][_0x39c0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x39c0('0x3')](0x0);var events={'afterCreate':_0x39c0('0x4'),'afterUpdate':_0x39c0('0x5'),'afterDestroy':_0x39c0('0x6')};function emitEvent(_0x1a361e){return function(_0x57ee98,_0x1eccf6,_0x316941){VoiceQueueReportEvents[_0x39c0('0x7')](_0x1a361e+':'+_0x57ee98['id'],_0x57ee98);VoiceQueueReportEvents[_0x39c0('0x7')](_0x1a361e,_0x57ee98);_0x316941(null);};}for(var e in events){if(events[_0x39c0('0x8')](e)){var event=events[e];VoiceQueueReport[_0x39c0('0x9')](e,emitEvent(event));}}module[_0x39c0('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index defb568..87e680d 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 _0xce67=['../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4bdefd,_0x1cb6b5){var _0x4609c6=function(_0x5b1c1f){while(--_0x5b1c1f){_0x4bdefd['push'](_0x4bdefd['shift']());}};_0x4609c6(++_0x1cb6b5);}(_0xce67,0x19c));var _0x7ce6=function(_0x45c98b,_0x5dfaba){_0x45c98b=_0x45c98b-0x0;var _0x3231b0=_0xce67[_0x45c98b];return _0x3231b0;};'use strict';var _=require(_0x7ce6('0x0'));var util=require(_0x7ce6('0x1'));var logger=require(_0x7ce6('0x2'))(_0x7ce6('0x3'));var moment=require(_0x7ce6('0x4'));var BPromise=require(_0x7ce6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ce6('0x6'));var rimraf=require(_0x7ce6('0x7'));var config=require(_0x7ce6('0x8'));var attributes=require(_0x7ce6('0x9'));module[_0x7ce6('0xa')]=function(_0x59db6d,_0x4508d0){return _0x59db6d[_0x7ce6('0xb')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x7ce6('0xc')]},{'fields':[_0x7ce6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dda=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define','VoiceQueueReport'];(function(_0xa034d9,_0x5f035b){var _0x331f5d=function(_0x4ae7dd){while(--_0x4ae7dd){_0xa034d9['push'](_0xa034d9['shift']());}};_0x331f5d(++_0x5f035b);}(_0x6dda,0xfe));var _0xa6dd=function(_0x2f2fdf,_0x23d252){_0x2f2fdf=_0x2f2fdf-0x0;var _0x7b367f=_0x6dda[_0x2f2fdf];return _0x7b367f;};'use strict';var _=require(_0xa6dd('0x0'));var util=require(_0xa6dd('0x1'));var logger=require(_0xa6dd('0x2'))(_0xa6dd('0x3'));var moment=require(_0xa6dd('0x4'));var BPromise=require(_0xa6dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6dd('0x6'));var rimraf=require('rimraf');var config=require(_0xa6dd('0x7'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x94fc97,_0x22239a){return _0x94fc97[_0xa6dd('0x8')](_0xa6dd('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xa6dd('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 4db4500..1ba94db 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 _0xca94=['attributes','include','map','model','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','limit','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw'];(function(_0x456252,_0x13eabc){var _0x3e46b1=function(_0x1d7f64){while(--_0x1d7f64){_0x456252['push'](_0x456252['shift']());}};_0x3e46b1(++_0x13eabc);}(_0xca94,0xa0));var _0x4ca9=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0xca94[_0x5d0609];return _0xaa3fd1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4ca9('0x0'));var fs=require('fs');var Redis=require(_0x4ca9('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca9('0x2'));var logger=require(_0x4ca9('0x3'))('rpc');var config=require(_0x4ca9('0x4'));var jayson=require(_0x4ca9('0x5'));var client=jayson['client'][_0x4ca9('0x6')]({'port':0x232a});config[_0x4ca9('0x7')]=_['defaults'](config[_0x4ca9('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ca9('0x8'))(new Redis(config[_0x4ca9('0x7')]));require('./voiceQueueReport.socket')[_0x4ca9('0x9')](socket);function respondWithRpcPromise(_0x333df1,_0x368ed0,_0x1a287f){return new BPromise(function(_0x144203,_0xe15510){return client[_0x4ca9('0xa')](_0x333df1,_0x1a287f)[_0x4ca9('0xb')](function(_0x1f5e2c){logger['info'](_0x4ca9('0xc'),_0x368ed0,_0x4ca9('0xd'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x368ed0,_0x4ca9('0xd'),JSON['stringify'](_0x1f5e2c));if(_0x1f5e2c[_0x4ca9('0xe')]){if(_0x1f5e2c[_0x4ca9('0xe')][_0x4ca9('0xf')]===0x1f4){logger[_0x4ca9('0xe')](_0x4ca9('0xc'),_0x368ed0,_0x1f5e2c[_0x4ca9('0xe')]['message']);return _0xe15510(_0x1f5e2c['error'][_0x4ca9('0x10')]);}logger['error'](_0x4ca9('0xc'),_0x368ed0,_0x1f5e2c[_0x4ca9('0xe')][_0x4ca9('0x10')]);return _0x144203(_0x1f5e2c[_0x4ca9('0xe')][_0x4ca9('0x10')]);}else{logger[_0x4ca9('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x368ed0,_0x4ca9('0xd'));_0x144203(_0x1f5e2c[_0x4ca9('0x12')]['message']);}})[_0x4ca9('0x13')](function(_0x5d267a){logger['error'](_0x4ca9('0xc'),_0x368ed0,_0x5d267a);_0xe15510(_0x5d267a);});});}exports[_0x4ca9('0x14')]=function(_0x7f130e){var _0x38fd82=this;return new Promise(function(_0x479dfd,_0xd6ef05){return db[_0x4ca9('0x15')][_0x4ca9('0x16')]({'raw':_0x7f130e['options']?_0x7f130e[_0x4ca9('0x17')][_0x4ca9('0x18')]===undefined?!![]:![]:!![],'where':_0x7f130e[_0x4ca9('0x17')]?_0x7f130e['options']['where']||null:null,'attributes':_0x7f130e[_0x4ca9('0x17')]?_0x7f130e['options'][_0x4ca9('0x19')]||null:null,'limit':_0x7f130e[_0x4ca9('0x17')]?_0x7f130e[_0x4ca9('0x17')]['limit']||null:null,'include':_0x7f130e[_0x4ca9('0x17')]?_0x7f130e[_0x4ca9('0x17')][_0x4ca9('0x1a')]?_[_0x4ca9('0x1b')](_0x7f130e[_0x4ca9('0x17')][_0x4ca9('0x1a')],function(_0x334353){return{'model':db[_0x334353[_0x4ca9('0x1c')]],'as':_0x334353['as'],'attributes':_0x334353['attributes'],'include':_0x334353[_0x4ca9('0x1a')]?_['map'](_0x334353['include'],function(_0x60c250){return{'model':db[_0x60c250['model']],'as':_0x60c250['as'],'attributes':_0x60c250[_0x4ca9('0x19')],'include':_0x60c250[_0x4ca9('0x1a')]?_[_0x4ca9('0x1b')](_0x60c250['include'],function(_0x3ce881){return{'model':db[_0x3ce881[_0x4ca9('0x1c')]],'as':_0x3ce881['as'],'attributes':_0x3ce881[_0x4ca9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4ca9('0xb')](function(_0x1cd93b){logger[_0x4ca9('0x11')](_0x4ca9('0x14'),_0x7f130e);logger['debug'](_0x4ca9('0x14'),_0x7f130e,JSON[_0x4ca9('0x1d')](_0x1cd93b));_0x479dfd(_0x1cd93b);})[_0x4ca9('0x13')](function(_0x338fd8){logger[_0x4ca9('0xe')](_0x4ca9('0x14'),_0x338fd8[_0x4ca9('0x10')],_0x7f130e);_0xd6ef05(_0x38fd82[_0x4ca9('0xe')](0x1f4,_0x338fd8['message']));});});};exports[_0x4ca9('0x1e')]=function(_0x7ff7e1){var _0x1c2bc4=this;return new Promise(function(_0x52eecc,_0x1ebb59){return db[_0x4ca9('0x15')][_0x4ca9('0x1f')](_0x7ff7e1[_0x4ca9('0x20')],{'raw':_0x7ff7e1[_0x4ca9('0x17')]?_0x7ff7e1['options']['raw']===undefined?!![]:![]:!![]})[_0x4ca9('0xb')](function(_0x5280a0){logger[_0x4ca9('0x11')](_0x4ca9('0x1e'),_0x7ff7e1);logger['debug'](_0x4ca9('0x1e'),_0x7ff7e1,JSON[_0x4ca9('0x1d')](_0x5280a0));_0x52eecc(_0x5280a0);})[_0x4ca9('0x13')](function(_0x307088){logger[_0x4ca9('0xe')](_0x4ca9('0x1e'),_0x307088[_0x4ca9('0x10')],_0x7ff7e1);_0x1ebb59(_0x1c2bc4[_0x4ca9('0xe')](0x1f4,_0x307088[_0x4ca9('0x10')]));});});};exports[_0x4ca9('0x21')]=function(_0x55c4b1){var _0x4522ac=this;return new Promise(function(_0x34968a,_0x2940e3){return db['VoiceQueueReport'][_0x4ca9('0x22')](_0x55c4b1[_0x4ca9('0x20')],{'raw':_0x55c4b1[_0x4ca9('0x17')]?_0x55c4b1[_0x4ca9('0x17')][_0x4ca9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c4b1['options']?_0x55c4b1[_0x4ca9('0x17')][_0x4ca9('0x23')]||null:null,'attributes':_0x55c4b1[_0x4ca9('0x17')]?_0x55c4b1[_0x4ca9('0x17')][_0x4ca9('0x19')]||null:null,'limit':_0x55c4b1[_0x4ca9('0x17')]?_0x55c4b1[_0x4ca9('0x17')][_0x4ca9('0x24')]||null:null})[_0x4ca9('0xb')](function(_0x22f898){logger[_0x4ca9('0x11')](_0x4ca9('0x21'),_0x55c4b1);logger['debug'](_0x4ca9('0x21'),_0x55c4b1,JSON[_0x4ca9('0x1d')](_0x22f898));_0x34968a(_0x22f898);})[_0x4ca9('0x13')](function(_0x5d216d){logger[_0x4ca9('0xe')]('UpdateVoiceQueueReport',_0x5d216d[_0x4ca9('0x10')],_0x55c4b1);_0x2940e3(_0x4522ac[_0x4ca9('0xe')](0x1f4,_0x5d216d[_0x4ca9('0x10')]));});});}; \ No newline at end of file +var _0x1760=['raw','info','CreateVoiceQueueReport','debug','stringify','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','findAll','options','where','limit','include','map','model','attributes','then','GetVoiceQueueReport','VoiceQueueReport','create','body'];(function(_0x942e2b,_0x164e8a){var _0x30808e=function(_0x1b15d9){while(--_0x1b15d9){_0x942e2b['push'](_0x942e2b['shift']());}};_0x30808e(++_0x164e8a);}(_0x1760,0x14f));var _0x0176=function(_0x3c5d70,_0x481853){_0x3c5d70=_0x3c5d70-0x0;var _0xd5e442=_0x1760[_0x3c5d70];return _0xd5e442;};'use strict';var _=require(_0x0176('0x0'));var util=require('util');var moment=require(_0x0176('0x1'));var BPromise=require(_0x0176('0x2'));var rs=require(_0x0176('0x3'));var fs=require('fs');var Redis=require(_0x0176('0x4'));var db=require(_0x0176('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0176('0x6'))('rpc');var config=require(_0x0176('0x7'));var jayson=require(_0x0176('0x8'));var client=jayson[_0x0176('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x0176('0xa')],{'host':_0x0176('0xb'),'port':0x18eb});var socket=require(_0x0176('0xc'))(new Redis(config['redis']));require(_0x0176('0xd'))['register'](socket);function respondWithRpcPromise(_0x307910,_0x27819b,_0x453a9e){return new BPromise(function(_0x563255,_0x2ec728){return client[_0x0176('0xe')](_0x307910,_0x453a9e)['then'](function(_0x112cb1){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x27819b,_0x0176('0xf'));logger['debug'](_0x0176('0x10'),_0x27819b,'request\x20sent',JSON['stringify'](_0x112cb1));if(_0x112cb1[_0x0176('0x11')]){if(_0x112cb1[_0x0176('0x11')]['code']===0x1f4){logger[_0x0176('0x11')](_0x0176('0x12'),_0x27819b,_0x112cb1['error'][_0x0176('0x13')]);return _0x2ec728(_0x112cb1[_0x0176('0x11')][_0x0176('0x13')]);}logger[_0x0176('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x27819b,_0x112cb1[_0x0176('0x11')][_0x0176('0x13')]);return _0x563255(_0x112cb1[_0x0176('0x11')][_0x0176('0x13')]);}else{logger['info'](_0x0176('0x12'),_0x27819b,_0x0176('0xf'));_0x563255(_0x112cb1['result']['message']);}})[_0x0176('0x14')](function(_0x2f71e1){logger[_0x0176('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x27819b,_0x2f71e1);_0x2ec728(_0x2f71e1);});});}exports['GetVoiceQueueReport']=function(_0x3c4501){var _0x586b14=this;return new Promise(function(_0x2d1021,_0x68adaf){return db['VoiceQueueReport'][_0x0176('0x15')]({'raw':_0x3c4501[_0x0176('0x16')]?_0x3c4501[_0x0176('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3c4501[_0x0176('0x16')]?_0x3c4501[_0x0176('0x16')][_0x0176('0x17')]||null:null,'attributes':_0x3c4501[_0x0176('0x16')]?_0x3c4501[_0x0176('0x16')]['attributes']||null:null,'limit':_0x3c4501[_0x0176('0x16')]?_0x3c4501[_0x0176('0x16')][_0x0176('0x18')]||null:null,'include':_0x3c4501['options']?_0x3c4501[_0x0176('0x16')][_0x0176('0x19')]?_[_0x0176('0x1a')](_0x3c4501['options'][_0x0176('0x19')],function(_0x146198){return{'model':db[_0x146198[_0x0176('0x1b')]],'as':_0x146198['as'],'attributes':_0x146198['attributes'],'include':_0x146198[_0x0176('0x19')]?_[_0x0176('0x1a')](_0x146198[_0x0176('0x19')],function(_0xa999ee){return{'model':db[_0xa999ee[_0x0176('0x1b')]],'as':_0xa999ee['as'],'attributes':_0xa999ee['attributes'],'include':_0xa999ee[_0x0176('0x19')]?_[_0x0176('0x1a')](_0xa999ee[_0x0176('0x19')],function(_0x171220){return{'model':db[_0x171220['model']],'as':_0x171220['as'],'attributes':_0x171220[_0x0176('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0176('0x1d')](function(_0x30b3e5){logger['info'](_0x0176('0x1e'),_0x3c4501);logger['debug'](_0x0176('0x1e'),_0x3c4501,JSON['stringify'](_0x30b3e5));_0x2d1021(_0x30b3e5);})['catch'](function(_0x18164e){logger[_0x0176('0x11')](_0x0176('0x1e'),_0x18164e[_0x0176('0x13')],_0x3c4501);_0x68adaf(_0x586b14['error'](0x1f4,_0x18164e[_0x0176('0x13')]));});});};exports['CreateVoiceQueueReport']=function(_0xb2e89b){var _0x284b37=this;return new Promise(function(_0x46644b,_0x4bc0a0){return db[_0x0176('0x1f')][_0x0176('0x20')](_0xb2e89b[_0x0176('0x21')],{'raw':_0xb2e89b[_0x0176('0x16')]?_0xb2e89b[_0x0176('0x16')][_0x0176('0x22')]===undefined?!![]:![]:!![]})[_0x0176('0x1d')](function(_0x40b763){logger[_0x0176('0x23')](_0x0176('0x24'),_0xb2e89b);logger[_0x0176('0x25')](_0x0176('0x24'),_0xb2e89b,JSON[_0x0176('0x26')](_0x40b763));_0x46644b(_0x40b763);})['catch'](function(_0x3763ef){logger[_0x0176('0x11')](_0x0176('0x24'),_0x3763ef[_0x0176('0x13')],_0xb2e89b);_0x4bc0a0(_0x284b37['error'](0x1f4,_0x3763ef[_0x0176('0x13')]));});});};exports[_0x0176('0x27')]=function(_0x3bbf4f){var _0x2dae55=this;return new Promise(function(_0x2c1893,_0x2413e9){return db[_0x0176('0x1f')][_0x0176('0x28')](_0x3bbf4f[_0x0176('0x21')],{'raw':_0x3bbf4f[_0x0176('0x16')]?_0x3bbf4f[_0x0176('0x16')][_0x0176('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbf4f[_0x0176('0x16')]?_0x3bbf4f[_0x0176('0x16')]['where']||null:null,'attributes':_0x3bbf4f['options']?_0x3bbf4f['options'][_0x0176('0x1c')]||null:null,'limit':_0x3bbf4f['options']?_0x3bbf4f[_0x0176('0x16')]['limit']||null:null})[_0x0176('0x1d')](function(_0x40a236){logger[_0x0176('0x23')](_0x0176('0x27'),_0x3bbf4f);logger['debug'](_0x0176('0x27'),_0x3bbf4f,JSON['stringify'](_0x40a236));_0x2c1893(_0x40a236);})[_0x0176('0x14')](function(_0xe951f){logger[_0x0176('0x11')]('UpdateVoiceQueueReport',_0xe951f[_0x0176('0x13')],_0x3bbf4f);_0x2413e9(_0x2dae55['error'](0x1f4,_0xe951f[_0x0176('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index bb85c9e..c99d1a9 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 _0x016d=['save','remove','update','removeListener','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x458edc,_0x9baf98){var _0x44af29=function(_0x41929c){while(--_0x41929c){_0x458edc['push'](_0x458edc['shift']());}};_0x44af29(++_0x9baf98);}(_0x016d,0x102));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var VoiceQueueReportEvents=require(_0xd016('0x0'));var events=[_0xd016('0x1'),_0xd016('0x2'),_0xd016('0x3')];function createListener(_0x3c85a4,_0x1868a2){return function(_0x34eb8b){_0x1868a2['emit'](_0x3c85a4,_0x34eb8b);};}function removeListener(_0x349f6,_0x30421e){return function(){VoiceQueueReportEvents[_0xd016('0x4')](_0x349f6,_0x30421e);};}exports['register']=function(_0x22f403){for(var _0x311de6=0x0,_0x16d5b4=events[_0xd016('0x5')];_0x311de6<_0x16d5b4;_0x311de6++){var _0x5ed161=events[_0x311de6];var _0x44b23=createListener(_0xd016('0x6')+_0x5ed161,_0x22f403);VoiceQueueReportEvents['on'](_0x5ed161,_0x44b23);}}; \ No newline at end of file +var _0xfed1=['removeListener','register','length','voiceQueueReport:','save','update'];(function(_0xd8213,_0x1fef60){var _0x2383a6=function(_0x3e44cd){while(--_0x3e44cd){_0xd8213['push'](_0xd8213['shift']());}};_0x2383a6(++_0x1fef60);}(_0xfed1,0x1ae));var _0x1fed=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xfed1[_0x68c979];return _0x4f0001;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x1fed('0x0'),'remove',_0x1fed('0x1')];function createListener(_0x122de4,_0x4801e1){return function(_0x32d3c2){_0x4801e1['emit'](_0x122de4,_0x32d3c2);};}function removeListener(_0x56a2b3,_0x313b07){return function(){VoiceQueueReportEvents[_0x1fed('0x2')](_0x56a2b3,_0x313b07);};}exports[_0x1fed('0x3')]=function(_0x2ca03d){for(var _0x2327e8=0x0,_0x1a01b1=events[_0x1fed('0x4')];_0x2327e8<_0x1a01b1;_0x2327e8++){var _0x1c3d0c=events[_0x2327e8];var _0x3d0acf=createListener(_0x1fed('0x5')+_0x1c3d0c,_0x2ca03d);VoiceQueueReportEvents['on'](_0x1c3d0c,_0x3d0acf);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dfdd229..5f0e30b 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 _0xa9fc=['show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated'];(function(_0x57e5fa,_0x579542){var _0x4d8b97=function(_0xfc24f5){while(--_0xfc24f5){_0x57e5fa['push'](_0x57e5fa['shift']());}};_0x4d8b97(++_0x579542);}(_0xa9fc,0x19f));var _0xca9f=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xa9fc[_0x506172];return _0x2723c0;};'use strict';var multer=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var path=require(_0xca9f('0x2'));var timeout=require(_0xca9f('0x3'));var express=require(_0xca9f('0x4'));var router=express['Router']();var auth=require(_0xca9f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca9f('0x6'));var controller=require(_0xca9f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xca9f('0x8')]('/:id',auth[_0xca9f('0x9')](),controller[_0xca9f('0xa')]);router[_0xca9f('0xb')]('/',auth[_0xca9f('0x9')](),controller[_0xca9f('0xc')]);router[_0xca9f('0xd')](_0xca9f('0xe'),auth[_0xca9f('0x9')](),controller['update']);router[_0xca9f('0xf')](_0xca9f('0xe'),auth[_0xca9f('0x9')](),controller[_0xca9f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2d95=['express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','path'];(function(_0x110ea6,_0x5ed591){var _0x44846e=function(_0x10fe5d){while(--_0x10fe5d){_0x110ea6['push'](_0x110ea6['shift']());}};_0x44846e(++_0x5ed591);}(_0x2d95,0xca));var _0x52d9=function(_0x2fda64,_0xe75c80){_0x2fda64=_0x2fda64-0x0;var _0x4678db=_0x2d95[_0x2fda64];return _0x4678db;};'use strict';var multer=require(_0x52d9('0x0'));var util=require('util');var path=require(_0x52d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x52d9('0x2'));var router=express[_0x52d9('0x3')]();var auth=require(_0x52d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x52d9('0x5'));var controller=require(_0x52d9('0x6'));router[_0x52d9('0x7')]('/',auth[_0x52d9('0x8')](),controller[_0x52d9('0x9')]);router[_0x52d9('0x7')](_0x52d9('0xa'),auth[_0x52d9('0x8')](),controller[_0x52d9('0xb')]);router[_0x52d9('0xc')]('/',auth[_0x52d9('0x8')](),controller[_0x52d9('0xd')]);router[_0x52d9('0xe')](_0x52d9('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x52d9('0xa'),auth[_0x52d9('0x8')](),controller[_0x52d9('0xf')]);module[_0x52d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b9d4043..26c6768 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 _0x4c4e=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','DATE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4c4e,0x152));var _0xe4c4=function(_0x3be584,_0x2ddf36){_0x3be584=_0x3be584-0x0;var _0xea356d=_0x4c4e[_0x3be584];return _0xea356d;};'use strict';var Sequelize=require(_0xe4c4('0x0'));var moment=require('moment');module[_0xe4c4('0x1')]={'time':{'type':Sequelize[_0xe4c4('0x2')]},'callid':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe4c4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe4c4('0x3')],'allowNull':![],'defaultValue':moment()[_0xe4c4('0x4')](_0xe4c4('0x5'))}}; \ No newline at end of file +var _0xdbf5=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE','format'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xc4e59e,_0x5db55b){_0xc4e59e=_0xc4e59e-0x0;var _0x33bcd1=_0xdbf5[_0xc4e59e];return _0x33bcd1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5dbf('0x0'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5dbf('0x2')],'allowNull':![],'defaultValue':moment()[_0x5dbf('0x3')](_0x5dbf('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 827ce2f..e4c7b58 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 _0x3e59=['ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','then','stack','name','send','index','VoiceQueuesLog','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','type','VIRTUAL','field','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','options','create','body','update','find','destroy','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5c7247,_0x59daf8){var _0x399cea=function(_0x7c029){while(--_0x7c029){_0x5c7247['push'](_0x5c7247['shift']());}};_0x399cea(++_0x59daf8);}(_0x3e59,0x18a));var _0x93e5=function(_0x3f7830,_0x2ef515){_0x3f7830=_0x3f7830-0x0;var _0x392bcf=_0x3e59[_0x3f7830];return _0x392bcf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x93e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x93e5('0x1'));var moment=require('moment');var BPromise=require(_0x93e5('0x2'));var Mustache=require(_0x93e5('0x3'));var util=require(_0x93e5('0x4'));var path=require(_0x93e5('0x5'));var sox=require(_0x93e5('0x6'));var csv=require(_0x93e5('0x7'));var ejs=require(_0x93e5('0x8'));var fs=require('fs');var _=require(_0x93e5('0x9'));var squel=require(_0x93e5('0xa'));var crypto=require(_0x93e5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x93e5('0x7'));var querystring=require(_0x93e5('0xc'));var Papa=require(_0x93e5('0xd'));var Redis=require(_0x93e5('0xe'));var authService=require(_0x93e5('0xf'));var qs=require(_0x93e5('0x10'));var hardwareService=require(_0x93e5('0x11'));var logger=require('../../config/logger')(_0x93e5('0x12'));var utils=require(_0x93e5('0x13'));var config=require('../../config/environment');var db=require(_0x93e5('0x14'))['db'];function respondWithStatusCode(_0x2c3439,_0x24c726){_0x24c726=_0x24c726||0xcc;return function(_0x1b57d2){if(_0x1b57d2){return _0x2c3439[_0x93e5('0x15')](_0x24c726);}return _0x2c3439['status'](_0x24c726)[_0x93e5('0x16')]();};}function respondWithResult(_0x2f85e5,_0x5ab5fb){_0x5ab5fb=_0x5ab5fb||0xc8;return function(_0x4497e6){if(_0x4497e6){return _0x2f85e5[_0x93e5('0x17')](_0x5ab5fb)[_0x93e5('0x18')](_0x4497e6);}};}function respondWithFilteredResult(_0x42ea22,_0x2461fa){return function(_0x510cc3){if(_0x510cc3){var _0x2d962d=_0x510cc3[_0x93e5('0x19')],_0x18e24d=_0x2461fa[_0x93e5('0x1a')],_0x4928a8=_0x2461fa[_0x93e5('0x1a')]+_0x2461fa[_0x93e5('0x1b')],_0x1b0cf1;if(_0x4928a8>=_0x2d962d){_0x4928a8=_0x2d962d;_0x1b0cf1=0xc8;}else{_0x1b0cf1=0xce;}_0x42ea22[_0x93e5('0x17')](_0x1b0cf1);return _0x42ea22[_0x93e5('0x1c')]('Content-Range',_0x18e24d+'-'+_0x4928a8+'/'+_0x2d962d)[_0x93e5('0x18')](_0x510cc3);}return null;};}function patchUpdates(_0x420929){return function(_0x1fcb27){try{jsonpatch['apply'](_0x1fcb27,_0x420929,!![]);}catch(_0x575506){return BPromise[_0x93e5('0x1d')](_0x575506);}return _0x1fcb27['save']();};}function saveUpdates(_0x3da0c4,_0x3a31d5){return function(_0x107bfb){if(_0x107bfb){return _0x107bfb['update'](_0x3da0c4)[_0x93e5('0x1e')](function(_0x42e8db){return _0x42e8db;});}return null;};}function removeEntity(_0x32c891,_0x56df94){return function(_0x1b66b3){if(_0x1b66b3){return _0x1b66b3['destroy']()[_0x93e5('0x1e')](function(){_0x32c891[_0x93e5('0x17')](0xcc)[_0x93e5('0x16')]();});}};}function handleEntityNotFound(_0xd3d2f5,_0x1c8a93){return function(_0x38a734){if(!_0x38a734){_0xd3d2f5[_0x93e5('0x15')](0x194);}return _0x38a734;};}function handleError(_0x50144e,_0x191076){_0x191076=_0x191076||0x1f4;return function(_0x80cd5f){logger['error'](_0x80cd5f[_0x93e5('0x1f')]);if(_0x80cd5f[_0x93e5('0x20')]){delete _0x80cd5f[_0x93e5('0x20')];}_0x50144e[_0x93e5('0x17')](_0x191076)[_0x93e5('0x21')](_0x80cd5f);};}exports[_0x93e5('0x22')]=function(_0x4eb614,_0x2d7fa0){var _0x149224={},_0x21667e={},_0x1a8eb0={'count':0x0,'rows':[]};var _0x59307c=db[_0x93e5('0x23')]['rawAttributes'];_0x21667e[_0x93e5('0x24')]=_[_0x93e5('0x25')](_0x59307c);_0x21667e[_0x93e5('0x26')]=_['keys'](_0x4eb614[_0x93e5('0x26')]);_0x21667e[_0x93e5('0x27')]=_[_0x93e5('0x28')](_0x21667e[_0x93e5('0x24')],_0x21667e[_0x93e5('0x26')]);_0x149224[_0x93e5('0x29')]=_['intersection'](_0x21667e[_0x93e5('0x24')],qs[_0x93e5('0x2a')](_0x4eb614[_0x93e5('0x26')][_0x93e5('0x2a')]));_0x149224[_0x93e5('0x29')]=_0x149224['attributes'][_0x93e5('0x2b')]?_0x149224[_0x93e5('0x29')]:_0x21667e[_0x93e5('0x24')];if(!_0x4eb614[_0x93e5('0x26')][_0x93e5('0x2c')]('nolimit')){_0x149224[_0x93e5('0x1b')]=qs[_0x93e5('0x1b')](_0x4eb614[_0x93e5('0x26')][_0x93e5('0x1b')]);_0x149224[_0x93e5('0x1a')]=qs['offset'](_0x4eb614[_0x93e5('0x26')]['offset']);}_0x149224[_0x93e5('0x2d')]=qs[_0x93e5('0x2e')](_0x4eb614[_0x93e5('0x26')][_0x93e5('0x2e')]);_0x149224[_0x93e5('0x2f')]=qs[_0x93e5('0x27')](_['pick'](_0x4eb614[_0x93e5('0x26')],_0x21667e['filters']));if(_0x4eb614[_0x93e5('0x26')][_0x93e5('0x30')]){_0x149224[_0x93e5('0x2f')]=_['merge'](_0x149224['where'],{'$or':_[_0x93e5('0x31')](_0x59307c,function(_0x35c229){if(_0x35c229[_0x93e5('0x32')]['key']!==_0x93e5('0x33')){var _0x7aad8e={};_0x7aad8e[_0x35c229[_0x93e5('0x34')]]={'$like':'%'+_0x4eb614[_0x93e5('0x26')][_0x93e5('0x30')]+'%'};return _0x7aad8e;}})});}_0x149224=_[_0x93e5('0x35')]({},_0x149224,_0x4eb614['options']);var _0x2cff80={'where':_0x149224[_0x93e5('0x2f')]};return db[_0x93e5('0x23')][_0x93e5('0x19')](_0x2cff80)[_0x93e5('0x1e')](function(_0x1547f1){_0x1a8eb0[_0x93e5('0x19')]=_0x1547f1;if(_0x4eb614['query'][_0x93e5('0x36')]){_0x149224['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x93e5('0x37')](_0x149224);})[_0x93e5('0x1e')](function(_0xfba95e){_0x1a8eb0[_0x93e5('0x38')]=_0xfba95e;return _0x1a8eb0;})[_0x93e5('0x1e')](respondWithFilteredResult(_0x2d7fa0,_0x149224))[_0x93e5('0x39')](handleError(_0x2d7fa0,null));};exports[_0x93e5('0x3a')]=function(_0x481067,_0x389223){var _0x1e919e={'raw':!![],'where':{'id':_0x481067[_0x93e5('0x3b')]['id']}},_0x4b8aba={};_0x4b8aba[_0x93e5('0x24')]=_['keys'](db['VoiceQueuesLog'][_0x93e5('0x3c')]);_0x4b8aba[_0x93e5('0x26')]=_[_0x93e5('0x25')](_0x481067[_0x93e5('0x26')]);_0x4b8aba[_0x93e5('0x27')]=_[_0x93e5('0x28')](_0x4b8aba[_0x93e5('0x24')],_0x4b8aba[_0x93e5('0x26')]);_0x1e919e[_0x93e5('0x29')]=_[_0x93e5('0x28')](_0x4b8aba['model'],qs[_0x93e5('0x2a')](_0x481067[_0x93e5('0x26')][_0x93e5('0x2a')]));_0x1e919e[_0x93e5('0x29')]=_0x1e919e[_0x93e5('0x29')][_0x93e5('0x2b')]?_0x1e919e['attributes']:_0x4b8aba[_0x93e5('0x24')];if(_0x481067[_0x93e5('0x26')][_0x93e5('0x36')]){_0x1e919e['include']=[{'all':!![]}];}_0x1e919e=_['merge']({},_0x1e919e,_0x481067[_0x93e5('0x3d')]);return db['VoiceQueuesLog']['find'](_0x1e919e)[_0x93e5('0x1e')](handleEntityNotFound(_0x389223,null))['then'](respondWithResult(_0x389223,null))[_0x93e5('0x39')](handleError(_0x389223,null));};exports[_0x93e5('0x3e')]=function(_0x7e335d,_0xe1f377){return db['VoiceQueuesLog']['create'](_0x7e335d[_0x93e5('0x3f')],{})[_0x93e5('0x1e')](respondWithResult(_0xe1f377,0xc9))[_0x93e5('0x39')](handleError(_0xe1f377,null));};exports[_0x93e5('0x40')]=function(_0x5caa68,_0x44f624){if(_0x5caa68['body']['id']){delete _0x5caa68[_0x93e5('0x3f')]['id'];}return db[_0x93e5('0x23')][_0x93e5('0x41')]({'where':{'id':_0x5caa68[_0x93e5('0x3b')]['id']}})[_0x93e5('0x1e')](handleEntityNotFound(_0x44f624,null))[_0x93e5('0x1e')](saveUpdates(_0x5caa68['body'],null))['then'](respondWithResult(_0x44f624,null))[_0x93e5('0x39')](handleError(_0x44f624,null));};exports[_0x93e5('0x42')]=function(_0x597cbc,_0x161c1b){return db[_0x93e5('0x23')][_0x93e5('0x41')]({'where':{'id':_0x597cbc[_0x93e5('0x3b')]['id']}})['then'](handleEntityNotFound(_0x161c1b,null))['then'](removeEntity(_0x161c1b,null))[_0x93e5('0x39')](handleError(_0x161c1b,null));}; \ No newline at end of file +var _0x13df=['filter','map','type','key','field','merge','options','include','rows','catch','show','filters','includeAll','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','VoiceQueuesLog','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2af954,_0x3e925a){var _0x147599=function(_0x1a74ea){while(--_0x1a74ea){_0x2af954['push'](_0x2af954['shift']());}};_0x147599(++_0x3e925a);}(_0x13df,0x139));var _0xf13d=function(_0x4004b5,_0x4ede04){_0x4004b5=_0x4004b5-0x0;var _0x3cbd6f=_0x13df[_0x4004b5];return _0x3cbd6f;};'use strict';var pdf=require(_0xf13d('0x0'));var emlformat=require(_0xf13d('0x1'));var rimraf=require(_0xf13d('0x2'));var zipdir=require(_0xf13d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf13d('0x4'));var moment=require(_0xf13d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf13d('0x6'));var path=require(_0xf13d('0x7'));var sox=require(_0xf13d('0x8'));var csv=require(_0xf13d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf13d('0xa'));var squel=require('squel');var crypto=require(_0xf13d('0xb'));var jsforce=require(_0xf13d('0xc'));var deskjs=require(_0xf13d('0xd'));var toCsv=require(_0xf13d('0x9'));var querystring=require(_0xf13d('0xe'));var Papa=require(_0xf13d('0xf'));var Redis=require(_0xf13d('0x10'));var authService=require(_0xf13d('0x11'));var qs=require(_0xf13d('0x12'));var hardwareService=require(_0xf13d('0x13'));var logger=require(_0xf13d('0x14'))(_0xf13d('0x15'));var utils=require(_0xf13d('0x16'));var config=require(_0xf13d('0x17'));var db=require(_0xf13d('0x18'))['db'];function respondWithStatusCode(_0x3af0dd,_0x992d18){_0x992d18=_0x992d18||0xcc;return function(_0x3dc226){if(_0x3dc226){return _0x3af0dd[_0xf13d('0x19')](_0x992d18);}return _0x3af0dd[_0xf13d('0x1a')](_0x992d18)[_0xf13d('0x1b')]();};}function respondWithResult(_0x34b035,_0x4ed837){_0x4ed837=_0x4ed837||0xc8;return function(_0x42de8c){if(_0x42de8c){return _0x34b035['status'](_0x4ed837)['json'](_0x42de8c);}};}function respondWithFilteredResult(_0x1507ff,_0x4225f8){return function(_0x1f22ac){if(_0x1f22ac){var _0x312e3b=_0x1f22ac[_0xf13d('0x1c')],_0x35eb18=_0x4225f8[_0xf13d('0x1d')],_0x3381c3=_0x4225f8[_0xf13d('0x1d')]+_0x4225f8[_0xf13d('0x1e')],_0x1f49d9;if(_0x3381c3>=_0x312e3b){_0x3381c3=_0x312e3b;_0x1f49d9=0xc8;}else{_0x1f49d9=0xce;}_0x1507ff[_0xf13d('0x1a')](_0x1f49d9);return _0x1507ff['set'](_0xf13d('0x1f'),_0x35eb18+'-'+_0x3381c3+'/'+_0x312e3b)[_0xf13d('0x20')](_0x1f22ac);}return null;};}function patchUpdates(_0x139842){return function(_0x46a7bf){try{jsonpatch[_0xf13d('0x21')](_0x46a7bf,_0x139842,!![]);}catch(_0x2067cb){return BPromise[_0xf13d('0x22')](_0x2067cb);}return _0x46a7bf[_0xf13d('0x23')]();};}function saveUpdates(_0x5b1936,_0x1c8fd){return function(_0x5ecc9d){if(_0x5ecc9d){return _0x5ecc9d[_0xf13d('0x24')](_0x5b1936)['then'](function(_0x5b9b9c){return _0x5b9b9c;});}return null;};}function removeEntity(_0x256975,_0x91a054){return function(_0x1d4e1d){if(_0x1d4e1d){return _0x1d4e1d[_0xf13d('0x25')]()[_0xf13d('0x26')](function(){_0x256975[_0xf13d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ab72,_0x18fee9){return function(_0x387030){if(!_0x387030){_0x16ab72[_0xf13d('0x19')](0x194);}return _0x387030;};}function handleError(_0x452b53,_0x30167e){_0x30167e=_0x30167e||0x1f4;return function(_0x560680){logger[_0xf13d('0x27')](_0x560680[_0xf13d('0x28')]);if(_0x560680[_0xf13d('0x29')]){delete _0x560680[_0xf13d('0x29')];}_0x452b53[_0xf13d('0x1a')](_0x30167e)['send'](_0x560680);};}exports[_0xf13d('0x2a')]=function(_0x4cab1b,_0x1e2a9d){var _0x590492={},_0xba1819={},_0x33801a={'count':0x0,'rows':[]};var _0xad38e1=db[_0xf13d('0x2b')][_0xf13d('0x2c')];_0xba1819[_0xf13d('0x2d')]=_['keys'](_0xad38e1);_0xba1819[_0xf13d('0x2e')]=_[_0xf13d('0x2f')](_0x4cab1b[_0xf13d('0x2e')]);_0xba1819['filters']=_[_0xf13d('0x30')](_0xba1819[_0xf13d('0x2d')],_0xba1819['query']);_0x590492[_0xf13d('0x31')]=_[_0xf13d('0x30')](_0xba1819[_0xf13d('0x2d')],qs[_0xf13d('0x32')](_0x4cab1b[_0xf13d('0x2e')][_0xf13d('0x32')]));_0x590492[_0xf13d('0x31')]=_0x590492[_0xf13d('0x31')][_0xf13d('0x33')]?_0x590492[_0xf13d('0x31')]:_0xba1819[_0xf13d('0x2d')];if(!_0x4cab1b['query'][_0xf13d('0x34')](_0xf13d('0x35'))){_0x590492[_0xf13d('0x1e')]=qs['limit'](_0x4cab1b[_0xf13d('0x2e')][_0xf13d('0x1e')]);_0x590492[_0xf13d('0x1d')]=qs[_0xf13d('0x1d')](_0x4cab1b[_0xf13d('0x2e')][_0xf13d('0x1d')]);}_0x590492[_0xf13d('0x36')]=qs[_0xf13d('0x37')](_0x4cab1b['query'][_0xf13d('0x37')]);_0x590492[_0xf13d('0x38')]=qs['filters'](_['pick'](_0x4cab1b[_0xf13d('0x2e')],_0xba1819['filters']));if(_0x4cab1b[_0xf13d('0x2e')][_0xf13d('0x39')]){_0x590492[_0xf13d('0x38')]=_['merge'](_0x590492['where'],{'$or':_[_0xf13d('0x3a')](_0xad38e1,function(_0x2255cb){if(_0x2255cb[_0xf13d('0x3b')][_0xf13d('0x3c')]!=='VIRTUAL'){var _0x389f66={};_0x389f66[_0x2255cb[_0xf13d('0x3d')]]={'$like':'%'+_0x4cab1b[_0xf13d('0x2e')][_0xf13d('0x39')]+'%'};return _0x389f66;}})});}_0x590492=_[_0xf13d('0x3e')]({},_0x590492,_0x4cab1b[_0xf13d('0x3f')]);var _0x2f54f={'where':_0x590492[_0xf13d('0x38')]};return db[_0xf13d('0x2b')][_0xf13d('0x1c')](_0x2f54f)['then'](function(_0xdf1018){_0x33801a[_0xf13d('0x1c')]=_0xdf1018;if(_0x4cab1b[_0xf13d('0x2e')]['includeAll']){_0x590492[_0xf13d('0x40')]=[{'all':!![]}];}return db[_0xf13d('0x2b')]['findAll'](_0x590492);})[_0xf13d('0x26')](function(_0x28e397){_0x33801a[_0xf13d('0x41')]=_0x28e397;return _0x33801a;})[_0xf13d('0x26')](respondWithFilteredResult(_0x1e2a9d,_0x590492))[_0xf13d('0x42')](handleError(_0x1e2a9d,null));};exports[_0xf13d('0x43')]=function(_0x3c6646,_0x2d41ff){var _0x3cdbed={'raw':!![],'where':{'id':_0x3c6646['params']['id']}},_0x331b71={};_0x331b71[_0xf13d('0x2d')]=_[_0xf13d('0x2f')](db[_0xf13d('0x2b')][_0xf13d('0x2c')]);_0x331b71[_0xf13d('0x2e')]=_['keys'](_0x3c6646[_0xf13d('0x2e')]);_0x331b71[_0xf13d('0x44')]=_[_0xf13d('0x30')](_0x331b71['model'],_0x331b71[_0xf13d('0x2e')]);_0x3cdbed['attributes']=_[_0xf13d('0x30')](_0x331b71[_0xf13d('0x2d')],qs['fields'](_0x3c6646['query'][_0xf13d('0x32')]));_0x3cdbed[_0xf13d('0x31')]=_0x3cdbed[_0xf13d('0x31')][_0xf13d('0x33')]?_0x3cdbed[_0xf13d('0x31')]:_0x331b71[_0xf13d('0x2d')];if(_0x3c6646[_0xf13d('0x2e')][_0xf13d('0x45')]){_0x3cdbed[_0xf13d('0x40')]=[{'all':!![]}];}_0x3cdbed=_[_0xf13d('0x3e')]({},_0x3cdbed,_0x3c6646[_0xf13d('0x3f')]);return db[_0xf13d('0x2b')]['find'](_0x3cdbed)['then'](handleEntityNotFound(_0x2d41ff,null))[_0xf13d('0x26')](respondWithResult(_0x2d41ff,null))['catch'](handleError(_0x2d41ff,null));};exports[_0xf13d('0x46')]=function(_0x52023e,_0x4285c2){return db['VoiceQueuesLog']['create'](_0x52023e['body'],{})[_0xf13d('0x26')](respondWithResult(_0x4285c2,0xc9))[_0xf13d('0x42')](handleError(_0x4285c2,null));};exports[_0xf13d('0x24')]=function(_0x5b157f,_0x1ac9e0){if(_0x5b157f[_0xf13d('0x47')]['id']){delete _0x5b157f[_0xf13d('0x47')]['id'];}return db['VoiceQueuesLog'][_0xf13d('0x48')]({'where':{'id':_0x5b157f['params']['id']}})[_0xf13d('0x26')](handleEntityNotFound(_0x1ac9e0,null))['then'](saveUpdates(_0x5b157f[_0xf13d('0x47')],null))[_0xf13d('0x26')](respondWithResult(_0x1ac9e0,null))[_0xf13d('0x42')](handleError(_0x1ac9e0,null));};exports['destroy']=function(_0x260748,_0x399af2){return db['VoiceQueuesLog'][_0xf13d('0x48')]({'where':{'id':_0x260748[_0xf13d('0x49')]['id']}})[_0xf13d('0x26')](handleEntityNotFound(_0x399af2,null))['then'](removeEntity(_0x399af2,null))['catch'](handleError(_0x399af2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 400ab92..c38ccd6 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 _0x3108=['bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment'];(function(_0x53ec5c,_0xc9ec83){var _0x13f1fc=function(_0x1e6bb0){while(--_0x1e6bb0){_0x53ec5c['push'](_0x53ec5c['shift']());}};_0x13f1fc(++_0xc9ec83);}(_0x3108,0x87));var _0x8310=function(_0x346b93,_0x4d39e5){_0x346b93=_0x346b93-0x0;var _0x2fd001=_0x3108[_0x346b93];return _0x2fd001;};'use strict';var _=require(_0x8310('0x0'));var util=require(_0x8310('0x1'));var logger=require(_0x8310('0x2'))(_0x8310('0x3'));var moment=require(_0x8310('0x4'));var BPromise=require(_0x8310('0x5'));var rp=require(_0x8310('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8310('0x7'));var config=require(_0x8310('0x8'));var attributes=require(_0x8310('0x9'));module['exports']=function(_0x43e4ad,_0xa19793){return _0x43e4ad[_0x8310('0xa')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x8310('0xb'),'fields':[_0x8310('0xc'),_0x8310('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd06d=['VoiceQueuesLog','event_dtm','event','dtm','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define'];(function(_0x168cb7,_0x29e537){var _0x4a9b3f=function(_0x3934e1){while(--_0x3934e1){_0x168cb7['push'](_0x168cb7['shift']());}};_0x4a9b3f(++_0x29e537);}(_0xd06d,0x74));var _0xdd06=function(_0xe26c86,_0x541146){_0xe26c86=_0xe26c86-0x0;var _0x3d4dd7=_0xd06d[_0xe26c86];return _0x3d4dd7;};'use strict';var _=require(_0xdd06('0x0'));var util=require('util');var logger=require(_0xdd06('0x1'))(_0xdd06('0x2'));var moment=require('moment');var BPromise=require(_0xdd06('0x3'));var rp=require(_0xdd06('0x4'));var fs=require('fs');var path=require(_0xdd06('0x5'));var rimraf=require(_0xdd06('0x6'));var config=require(_0xdd06('0x7'));var attributes=require(_0xdd06('0x8'));module['exports']=function(_0x3f1a7c,_0x547abe){return _0x3f1a7c[_0xdd06('0x9')](_0xdd06('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xdd06('0xb'),'fields':[_0xdd06('0xc'),_0xdd06('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2d2a3fc..61b356e 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 _0x874b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x39bf4a,_0x56435d){var _0x1d4110=function(_0x92e828){while(--_0x92e828){_0x39bf4a['push'](_0x39bf4a['shift']());}};_0x1d4110(++_0x56435d);}(_0x874b,0xa5));var _0xb874=function(_0x44fe92,_0x510b3a){_0x44fe92=_0x44fe92-0x0;var _0x554f77=_0x874b[_0x44fe92];return _0x554f77;};'use strict';var _=require(_0xb874('0x0'));var util=require('util');var moment=require(_0xb874('0x1'));var BPromise=require(_0xb874('0x2'));var rs=require(_0xb874('0x3'));var fs=require('fs');var Redis=require(_0xb874('0x4'));var db=require(_0xb874('0x5'))['db'];var utils=require(_0xb874('0x6'));var logger=require(_0xb874('0x7'))(_0xb874('0x8'));var config=require(_0xb874('0x9'));var jayson=require(_0xb874('0xa'));var client=jayson['client'][_0xb874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x457f47,_0x191fff,_0x22a045){return new BPromise(function(_0x20f6eb,_0x294d60){return client[_0xb874('0xc')](_0x457f47,_0x22a045)[_0xb874('0xd')](function(_0x5e0f91){logger[_0xb874('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x191fff,_0xb874('0xf'));logger[_0xb874('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x191fff,'request\x20sent',JSON[_0xb874('0x11')](_0x5e0f91));if(_0x5e0f91[_0xb874('0x12')]){if(_0x5e0f91['error'][_0xb874('0x13')]===0x1f4){logger['error'](_0xb874('0x14'),_0x191fff,_0x5e0f91['error']['message']);return _0x294d60(_0x5e0f91['error'][_0xb874('0x15')]);}logger['error'](_0xb874('0x14'),_0x191fff,_0x5e0f91['error']['message']);return _0x20f6eb(_0x5e0f91[_0xb874('0x12')][_0xb874('0x15')]);}else{logger[_0xb874('0xe')](_0xb874('0x14'),_0x191fff,_0xb874('0xf'));_0x20f6eb(_0x5e0f91[_0xb874('0x16')][_0xb874('0x15')]);}})[_0xb874('0x17')](function(_0x11f742){logger[_0xb874('0x12')](_0xb874('0x14'),_0x191fff,_0x11f742);_0x294d60(_0x11f742);});});} \ No newline at end of file +var _0x96cc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x5968a7,_0x37cbd0){var _0x351106=function(_0x30ea92){while(--_0x30ea92){_0x5968a7['push'](_0x5968a7['shift']());}};_0x351106(++_0x37cbd0);}(_0x96cc,0x16c));var _0xc96c=function(_0x34479b,_0x53b1d1){_0x34479b=_0x34479b-0x0;var _0x23e1b8=_0x96cc[_0x34479b];return _0x23e1b8;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8632a58..5bb2ff6 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 _0xe205=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/download','download','downloads','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x3dd375,_0x4335d1){var _0x27f51c=function(_0x42e9b7){while(--_0x42e9b7){_0x3dd375['push'](_0x3dd375['shift']());}};_0x27f51c(++_0x4335d1);}(_0xe205,0xa7));var _0x5e20=function(_0x174d8b,_0x30ed1c){_0x174d8b=_0x174d8b-0x0;var _0x2d271d=_0xe205[_0x174d8b];return _0x2d271d;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var auth=require(_0x5e20('0x6'));var interaction=require(_0x5e20('0x7'));var config=require(_0x5e20('0x8'));var controller=require('./voiceRecording.controller');router[_0x5e20('0x9')]('/',auth[_0x5e20('0xa')](),controller[_0x5e20('0xb')]);router[_0x5e20('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xa')](),controller[_0x5e20('0xd')]);router['get'](_0x5e20('0xe'),auth[_0x5e20('0xa')](),controller[_0x5e20('0xf')]);router[_0x5e20('0x9')]('/:id/downloads',controller[_0x5e20('0x10')]);router[_0x5e20('0x11')]('/',auth[_0x5e20('0xa')](),controller[_0x5e20('0x12')]);router[_0x5e20('0x13')](_0x5e20('0x14'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);router[_0x5e20('0x16')](_0x5e20('0x14'),auth['isAuthenticated'](),controller[_0x5e20('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','create','put','update','delete','multer','util','path','express','Router'];(function(_0x187d96,_0x3b08f9){var _0x386e66=function(_0x549a44){while(--_0x549a44){_0x187d96['push'](_0x187d96['shift']());}};_0x386e66(++_0x3b08f9);}(_0xe706,0xa3));var _0x6e70=function(_0x23516c,_0x16ea34){_0x23516c=_0x23516c-0x0;var _0x591310=_0xe706[_0x23516c];return _0x591310;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x9')](_0x6e70('0x12'),controller[_0x6e70('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2c414bf..1d0b321 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 _0x674c=['path','exports','value','extname','getDataValue','STRING','setDataValue','membername','split','DATE','createdAt','format','toString','moment'];(function(_0x411f7c,_0x1220a8){var _0x1f5314=function(_0x433740){while(--_0x433740){_0x411f7c['push'](_0x411f7c['shift']());}};_0x1f5314(++_0x1220a8);}(_0x674c,0xfb));var _0xc674=function(_0x7d54e3,_0x32c6a6){_0x7d54e3=_0x7d54e3-0x0;var _0x14ce00=_0x674c[_0x7d54e3];return _0x14ce00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc674('0x0'));var path=require(_0xc674('0x1'));module[_0xc674('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xc674('0x3'))?path[_0xc674('0x4')](this[_0xc674('0x5')](_0xc674('0x3'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc674('0x6')],'set':function(_0x3d4274){if(_0x3d4274){this[_0xc674('0x7')]('channel',_0x3d4274);this[_0xc674('0x7')](_0xc674('0x8'),_0x3d4274[_0xc674('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xc674('0x6')]},'calleridnum':{'type':Sequelize[_0xc674('0x6')]},'calleridname':{'type':Sequelize[_0xc674('0x6')]},'connectedlinenum':{'type':Sequelize[_0xc674('0x6')]},'connectedlinename':{'type':Sequelize[_0xc674('0x6')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc674('0x6')]},'exten':{'type':Sequelize[_0xc674('0x6')]},'value':{'type':Sequelize[_0xc674('0x6')]},'type':{'type':Sequelize[_0xc674('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xc674('0x6')]},'userDisposition':{'type':Sequelize[_0xc674('0x6')]},'createdAt':{'type':Sequelize[_0xc674('0xa')],'get':function(){return moment(this['getDataValue'](_0xc674('0xb')))[_0xc674('0xc')]('MM-DD-YYYY\x20HH:mm')[_0xc674('0xd')]();}},'updatedAt':{'type':Sequelize[_0xc674('0xa')],'get':function(){return moment(this[_0xc674('0x5')]('updatedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xc674('0xd')]();}}}; \ No newline at end of file +var _0x0d52=['sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt'];(function(_0x3b04ad,_0x5b6345){var _0x4105ce=function(_0x194f4c){while(--_0x194f4c){_0x3b04ad['push'](_0x3b04ad['shift']());}};_0x4105ce(++_0x5b6345);}(_0x0d52,0xf7));var _0x20d5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x0d52[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x20d5('0x0'));var moment=require(_0x20d5('0x1'));var path=require(_0x20d5('0x2'));module[_0x20d5('0x3')]={'format':{'type':Sequelize[_0x20d5('0x4')],'get':function(){return this[_0x20d5('0x5')](_0x20d5('0x6'))?path[_0x20d5('0x7')](this[_0x20d5('0x5')](_0x20d5('0x6'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x20d5('0x8')],'set':function(_0x52fbfd){if(_0x52fbfd){this[_0x20d5('0x9')](_0x20d5('0xa'),_0x52fbfd);this[_0x20d5('0x9')](_0x20d5('0xb'),_0x52fbfd[_0x20d5('0xc')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x20d5('0x8')]},'connectedlinenum':{'type':Sequelize[_0x20d5('0x8')]},'connectedlinename':{'type':Sequelize[_0x20d5('0x8')]},'accountcode':{'type':Sequelize[_0x20d5('0x8')]},'context':{'type':Sequelize[_0x20d5('0x8')]},'exten':{'type':Sequelize[_0x20d5('0x8')]},'value':{'type':Sequelize[_0x20d5('0x8')]},'type':{'type':Sequelize[_0x20d5('0x8')]},'rating':{'type':Sequelize[_0x20d5('0xd')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x20d5('0x8')]},'userDisposition':{'type':Sequelize[_0x20d5('0x8')]},'createdAt':{'type':Sequelize[_0x20d5('0xe')],'get':function(){return moment(this[_0x20d5('0x5')](_0x20d5('0xf')))[_0x20d5('0x10')](_0x20d5('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x20d5('0xe')],'get':function(){return moment(this['getDataValue'](_0x20d5('0x12')))['format'](_0x20d5('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index fc0d2a2..5a66ca3 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 _0x99e9=['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','../../config/environment','../../mysqldb','status','json','count','offset','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','limit','order','sort','pick','filter','where','map','type','merge','VoiceRecording','includeAll','include','findAll','rows','catch','length','create','body','update','params','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','extname','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x2d92e2,_0x5815d0){var _0x30892f=function(_0x4e2ccd){while(--_0x4e2ccd){_0x2d92e2['push'](_0x2d92e2['shift']());}};_0x30892f(++_0x5815d0);}(_0x99e9,0xb4));var _0x999e=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x99e9[_0x52ea08];return _0x28d546;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x999e('0x0'));var rimraf=require(_0x999e('0x1'));var zipdir=require(_0x999e('0x2'));var jsonpatch=require(_0x999e('0x3'));var rp=require('request-promise');var moment=require(_0x999e('0x4'));var BPromise=require(_0x999e('0x5'));var Mustache=require(_0x999e('0x6'));var util=require('util');var path=require(_0x999e('0x7'));var sox=require('sox');var csv=require(_0x999e('0x8'));var ejs=require(_0x999e('0x9'));var fs=require('fs');var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0x8'));var querystring=require(_0x999e('0xe'));var Papa=require(_0x999e('0xf'));var Redis=require(_0x999e('0x10'));var authService=require(_0x999e('0x11'));var qs=require(_0x999e('0x12'));var hardwareService=require(_0x999e('0x13'));var logger=require(_0x999e('0x14'))(_0x999e('0x15'));var utils=require(_0x999e('0x16'));var config=require(_0x999e('0x17'));var db=require(_0x999e('0x18'))['db'];function respondWithStatusCode(_0x3dfe2d,_0xdb587b){_0xdb587b=_0xdb587b||0xcc;return function(_0x26b55a){if(_0x26b55a){return _0x3dfe2d['sendStatus'](_0xdb587b);}return _0x3dfe2d[_0x999e('0x19')](_0xdb587b)['end']();};}function respondWithResult(_0x3e6f5a,_0x387924){_0x387924=_0x387924||0xc8;return function(_0x2fbc3e){if(_0x2fbc3e){return _0x3e6f5a['status'](_0x387924)[_0x999e('0x1a')](_0x2fbc3e);}};}function respondWithFilteredResult(_0x4d1716,_0xa44e4c){return function(_0x539598){if(_0x539598){var _0x549ad4=_0x539598[_0x999e('0x1b')],_0x1eee64=_0xa44e4c[_0x999e('0x1c')],_0x22feac=_0xa44e4c[_0x999e('0x1c')]+_0xa44e4c['limit'],_0x2dd5f4;if(_0x22feac>=_0x549ad4){_0x22feac=_0x549ad4;_0x2dd5f4=0xc8;}else{_0x2dd5f4=0xce;}_0x4d1716['status'](_0x2dd5f4);return _0x4d1716['set'](_0x999e('0x1d'),_0x1eee64+'-'+_0x22feac+'/'+_0x549ad4)[_0x999e('0x1a')](_0x539598);}return null;};}function patchUpdates(_0xc4ef74){return function(_0x302f52){try{jsonpatch[_0x999e('0x1e')](_0x302f52,_0xc4ef74,!![]);}catch(_0x3ece5e){return BPromise['reject'](_0x3ece5e);}return _0x302f52['save']();};}function saveUpdates(_0xc20d3e,_0x3f4d7c){return function(_0x3b3642){if(_0x3b3642){return _0x3b3642['update'](_0xc20d3e)[_0x999e('0x1f')](function(_0x42e167){return _0x42e167;});}return null;};}function removeEntity(_0x3b73f0,_0x36fce4){return function(_0x373b80){if(_0x373b80){return _0x373b80[_0x999e('0x20')]()[_0x999e('0x1f')](function(){_0x3b73f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a6bf,_0x4f0091){return function(_0x4c5491){if(!_0x4c5491){_0x11a6bf[_0x999e('0x21')](0x194);}return _0x4c5491;};}function handleError(_0xe324d8,_0x3f548e){_0x3f548e=_0x3f548e||0x1f4;return function(_0x13027c){logger[_0x999e('0x22')](_0x13027c[_0x999e('0x23')]);if(_0x13027c['name']){delete _0x13027c[_0x999e('0x24')];}_0xe324d8[_0x999e('0x19')](_0x3f548e)[_0x999e('0x25')](_0x13027c);};}exports[_0x999e('0x26')]=function(_0x1b7adb,_0x1d2dc6){var _0x44b790={},_0x5798f3={},_0x28f803={'count':0x0,'rows':[]};var _0x5ba8b0=db['VoiceRecording'][_0x999e('0x27')];_0x5798f3[_0x999e('0x28')]=_[_0x999e('0x29')](_['keys'](_0x5ba8b0),[_0x999e('0x2a')]);_0x5798f3[_0x999e('0x2b')]=_[_0x999e('0x2c')](_0x1b7adb[_0x999e('0x2b')]);_0x5798f3[_0x999e('0x2d')]=_[_0x999e('0x2e')](_0x5798f3[_0x999e('0x28')],_0x5798f3[_0x999e('0x2b')]);_0x44b790[_0x999e('0x2f')]=_[_0x999e('0x2e')](_0x5798f3['model'],qs[_0x999e('0x30')](_0x1b7adb[_0x999e('0x2b')][_0x999e('0x30')]));_0x44b790['attributes']=_0x44b790[_0x999e('0x2f')]['length']?_0x44b790['attributes']:_0x5798f3[_0x999e('0x28')];if(!_0x1b7adb[_0x999e('0x2b')]['hasOwnProperty']('nolimit')){_0x44b790[_0x999e('0x31')]=qs[_0x999e('0x31')](_0x1b7adb[_0x999e('0x2b')][_0x999e('0x31')]);_0x44b790['offset']=qs[_0x999e('0x1c')](_0x1b7adb[_0x999e('0x2b')][_0x999e('0x1c')]);}_0x44b790[_0x999e('0x32')]=qs['sort'](_0x1b7adb['query'][_0x999e('0x33')]);_0x44b790['where']=qs[_0x999e('0x2d')](_[_0x999e('0x34')](_0x1b7adb[_0x999e('0x2b')],_0x5798f3[_0x999e('0x2d')]));if(_0x1b7adb['query'][_0x999e('0x35')]){_0x44b790[_0x999e('0x36')]=_['merge'](_0x44b790['where'],{'$or':_[_0x999e('0x37')](_0x5ba8b0,function(_0x4aa98c){if(_0x4aa98c[_0x999e('0x38')]['key']!=='VIRTUAL'){var _0x504ac1={};_0x504ac1[_0x4aa98c['field']]={'$like':'%'+_0x1b7adb[_0x999e('0x2b')]['filter']+'%'};return _0x504ac1;}})});}_0x44b790=_[_0x999e('0x39')]({},_0x44b790,_0x1b7adb['options']);var _0x4cfa34={'where':_0x44b790['where']};return db[_0x999e('0x3a')][_0x999e('0x1b')](_0x4cfa34)[_0x999e('0x1f')](function(_0xe3c089){_0x28f803[_0x999e('0x1b')]=_0xe3c089;if(_0x1b7adb[_0x999e('0x2b')][_0x999e('0x3b')]){_0x44b790[_0x999e('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x999e('0x3d')](_0x44b790);})[_0x999e('0x1f')](function(_0x1e1229){_0x28f803[_0x999e('0x3e')]=_0x1e1229;return _0x28f803;})['then'](respondWithFilteredResult(_0x1d2dc6,_0x44b790))[_0x999e('0x3f')](handleError(_0x1d2dc6,null));};exports['show']=function(_0x36194c,_0x35b318){var _0x2c19b2={'raw':![],'where':{'id':_0x36194c['params']['id']}},_0x327c7b={};_0x327c7b[_0x999e('0x28')]=_[_0x999e('0x2c')](db[_0x999e('0x3a')]['rawAttributes']);_0x327c7b['query']=_[_0x999e('0x2c')](_0x36194c[_0x999e('0x2b')]);_0x327c7b[_0x999e('0x2d')]=_[_0x999e('0x2e')](_0x327c7b[_0x999e('0x28')],_0x327c7b[_0x999e('0x2b')]);_0x2c19b2[_0x999e('0x2f')]=_[_0x999e('0x2e')](_0x327c7b[_0x999e('0x28')],qs[_0x999e('0x30')](_0x36194c['query']['fields']));_0x2c19b2[_0x999e('0x2f')]=_0x2c19b2[_0x999e('0x2f')][_0x999e('0x40')]?_0x2c19b2[_0x999e('0x2f')]:_0x327c7b[_0x999e('0x28')];if(_0x36194c[_0x999e('0x2b')]['includeAll']){_0x2c19b2[_0x999e('0x3c')]=[{'all':!![]}];}_0x2c19b2=_['merge']({},_0x2c19b2,_0x36194c['options']);return db[_0x999e('0x3a')]['find'](_0x2c19b2)['then'](handleEntityNotFound(_0x35b318,null))['then'](respondWithResult(_0x35b318,null))['catch'](handleError(_0x35b318,null));};exports[_0x999e('0x41')]=function(_0x2841f7,_0x5e50f5){return db[_0x999e('0x3a')][_0x999e('0x41')](_0x2841f7[_0x999e('0x42')],{})['then'](respondWithResult(_0x5e50f5,0xc9))['catch'](handleError(_0x5e50f5,null));};exports[_0x999e('0x43')]=function(_0x2ebafe,_0x2a5df5){if(_0x2ebafe['body']['id']){delete _0x2ebafe['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2ebafe[_0x999e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a5df5,null))['then'](saveUpdates(_0x2ebafe[_0x999e('0x42')],null))[_0x999e('0x1f')](respondWithResult(_0x2a5df5,null))['catch'](handleError(_0x2a5df5,null));};exports[_0x999e('0x20')]=function(_0x1a5c3d,_0x5603a8){return db[_0x999e('0x3a')]['find']({'where':{'id':_0x1a5c3d[_0x999e('0x44')]['id']}})[_0x999e('0x1f')](handleEntityNotFound(_0x5603a8,null))['then'](removeEntity(_0x5603a8,null))[_0x999e('0x3f')](handleError(_0x5603a8,null));};exports[_0x999e('0x45')]=function(_0x4d5d16,_0x56c6b2){return db[_0x999e('0x3a')]['describe']()['then'](respondWithResult(_0x56c6b2,null))['catch'](handleError(_0x56c6b2,null));};exports[_0x999e('0x46')]=function(_0x3b2023,_0x2a2a67,_0x365d95){var _0x37c3ff=require(_0x999e('0x47'));var _0x5b2645=![];var _0x14f8de={};if(_0x3b2023[_0x999e('0x2b')]['type']&&_0x3b2023[_0x999e('0x2b')][_0x999e('0x38')]===_0x999e('0x48')){_0x14f8de[_0x999e('0x48')]=_0x3b2023[_0x999e('0x44')]['id'];}else{_0x14f8de['id']=_0x3b2023[_0x999e('0x44')]['id'];}return db[_0x999e('0x3a')][_0x999e('0x49')]({'where':_0x14f8de,'attributes':['id',_0x999e('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x2a2a67,null))[_0x999e('0x1f')](function(_0x45b61a){if(_0x45b61a){var _0x39ae4b=_0x45b61a[_0x999e('0x4a')];var _0x525191=util[_0x999e('0x2a')](_0x999e('0x4b'),_0x39ae4b);if(fs[_0x999e('0x4c')](_0x525191)){_0x5b2645=!![];return _0x37c3ff[_0x999e('0x4d')](_0x525191,_0x39ae4b,config[_0x999e('0x4e')][_0x999e('0x4f')])[_0x999e('0x1f')](function(){return _0x45b61a;});}return _0x45b61a;}})[_0x999e('0x1f')](function(_0x4ecb26){if(_0x4ecb26){var _0x56368e=_0x4ecb26[_0x999e('0x4a')];if(!fs[_0x999e('0x4c')](_0x56368e)){throw new db[(_0x999e('0x50'))][(_0x999e('0x51'))](_0x999e('0x52'));}if(_0x4ecb26[_0x999e('0x53')]){return _0x2a2a67[_0x999e('0x46')](_0x56368e,_0x4ecb26['filename']+path['extname'](_0x56368e),function(){if(_0x5b2645){fs[_0x999e('0x54')](_0x56368e);}});}else{return _0x2a2a67[_0x999e('0x46')](_0x56368e,function(_0x36c3dc){if(_0x5b2645){fs[_0x999e('0x54')](_0x56368e);}});}}})[_0x999e('0x3f')](function(_0x51b329){if(_0x51b329[_0x999e('0x55')]===_0x999e('0x52')){_0x2a2a67[_0x999e('0x19')](0x194)[_0x999e('0x25')](_0x999e('0x56'));}else{return handleError(_0x2a2a67,null);}});};exports[_0x999e('0x57')]=function(_0x2b4bbe,_0x53734c,_0x30edde){var _0x521b7a=require(_0x999e('0x47'));var _0x43217e=![];var _0x2ce0b3={'$and':[db[_0x999e('0x58')][_0x999e('0x36')](db[_0x999e('0x58')]['fn']('MD5',db[_0x999e('0x58')][_0x999e('0x59')](_0x999e('0x48'))),_0x2b4bbe[_0x999e('0x2b')][_0x999e('0x5a')])]};if(_0x2b4bbe[_0x999e('0x2b')][_0x999e('0x38')]&&_0x2b4bbe[_0x999e('0x2b')][_0x999e('0x38')]===_0x999e('0x48')){_0x2ce0b3[_0x999e('0x5b')][_0x999e('0x5c')]({'uniqueid':_0x2b4bbe[_0x999e('0x44')]['id']});}else{_0x2ce0b3[_0x999e('0x5b')][_0x999e('0x5c')]({'id':_0x2b4bbe['params']['id']});}return db[_0x999e('0x3a')][_0x999e('0x49')]({'where':_0x2ce0b3,'attributes':['id',_0x999e('0x4a')],'raw':!![]})[_0x999e('0x1f')](handleEntityNotFound(_0x53734c,null))['then'](function(_0x4871c9){if(_0x4871c9){var _0x21c8be=util[_0x999e('0x2a')](_0x999e('0x4b'),_0x4871c9[_0x999e('0x4a')]);if(fs[_0x999e('0x4c')](_0x21c8be)){_0x43217e=!![];return _0x521b7a[_0x999e('0x4d')](_0x21c8be,_0x4871c9[_0x999e('0x4a')],config[_0x999e('0x4e')][_0x999e('0x4f')])['then'](function(){return _0x4871c9;});}return _0x4871c9;}})[_0x999e('0x1f')](function(_0x47c693){if(_0x47c693){if(!fs[_0x999e('0x4c')](_0x47c693[_0x999e('0x4a')])){throw new db['Sequelize'][(_0x999e('0x51'))](_0x999e('0x52'));}if(_0x47c693[_0x999e('0x53')]){return _0x53734c[_0x999e('0x46')](_0x47c693[_0x999e('0x4a')],_0x47c693['filename']+path[_0x999e('0x5d')](_0x47c693[_0x999e('0x4a')]),function(){if(_0x43217e){fs['unlink'](_0x47c693['value']);}});}else{return _0x53734c['download'](_0x47c693[_0x999e('0x4a')],function(_0x3f37e8){if(_0x43217e){fs[_0x999e('0x54')](_0x47c693[_0x999e('0x4a')]);}});}}})[_0x999e('0x3f')](handleError(_0x53734c,null));}; \ No newline at end of file +var _0xd0bb=['ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceRecording','differenceBy','keys','format','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','secrets','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv'];(function(_0xbe657a,_0x1fd00f){var _0x523aba=function(_0x58398f){while(--_0x58398f){_0xbe657a['push'](_0xbe657a['shift']());}};_0x523aba(++_0x1fd00f);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3c27df,_0xc6d32b){_0x3c27df=_0x3c27df-0x0;var _0x56f1f0=_0xd0bb[_0x3c27df];return _0x56f1f0;};'use strict';var pdf=require(_0xbd0b('0x0'));var emlformat=require(_0xbd0b('0x1'));var rimraf=require(_0xbd0b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd0b('0x3'));var rp=require('request-promise');var moment=require(_0xbd0b('0x4'));var BPromise=require(_0xbd0b('0x5'));var Mustache=require('mustache');var util=require(_0xbd0b('0x6'));var path=require('path');var sox=require(_0xbd0b('0x7'));var csv=require(_0xbd0b('0x8'));var ejs=require(_0xbd0b('0x9'));var fs=require('fs');var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x8'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var hardwareService=require(_0xbd0b('0x11'));var logger=require('../../config/logger')(_0xbd0b('0x12'));var utils=require(_0xbd0b('0x13'));var config=require('../../config/environment');var db=require(_0xbd0b('0x14'))['db'];function respondWithStatusCode(_0x15919b,_0x3a4b28){_0x3a4b28=_0x3a4b28||0xcc;return function(_0x315ed9){if(_0x315ed9){return _0x15919b[_0xbd0b('0x15')](_0x3a4b28);}return _0x15919b[_0xbd0b('0x16')](_0x3a4b28)[_0xbd0b('0x17')]();};}function respondWithResult(_0x1f25b6,_0x1a55ab){_0x1a55ab=_0x1a55ab||0xc8;return function(_0x1c10c1){if(_0x1c10c1){return _0x1f25b6[_0xbd0b('0x16')](_0x1a55ab)['json'](_0x1c10c1);}};}function respondWithFilteredResult(_0x115f2d,_0x4b113b){return function(_0x4a8014){if(_0x4a8014){var _0x36d1ca=_0x4a8014[_0xbd0b('0x18')],_0x4c0e52=_0x4b113b['offset'],_0x3183cf=_0x4b113b['offset']+_0x4b113b[_0xbd0b('0x19')],_0x40b075;if(_0x3183cf>=_0x36d1ca){_0x3183cf=_0x36d1ca;_0x40b075=0xc8;}else{_0x40b075=0xce;}_0x115f2d[_0xbd0b('0x16')](_0x40b075);return _0x115f2d[_0xbd0b('0x1a')](_0xbd0b('0x1b'),_0x4c0e52+'-'+_0x3183cf+'/'+_0x36d1ca)[_0xbd0b('0x1c')](_0x4a8014);}return null;};}function patchUpdates(_0x40b798){return function(_0x5aeb79){try{jsonpatch[_0xbd0b('0x1d')](_0x5aeb79,_0x40b798,!![]);}catch(_0x49499f){return BPromise[_0xbd0b('0x1e')](_0x49499f);}return _0x5aeb79[_0xbd0b('0x1f')]();};}function saveUpdates(_0x2d02d0,_0x3053bb){return function(_0x4b312d){if(_0x4b312d){return _0x4b312d[_0xbd0b('0x20')](_0x2d02d0)[_0xbd0b('0x21')](function(_0x40b021){return _0x40b021;});}return null;};}function removeEntity(_0x495d62,_0x1c5b52){return function(_0x560db4){if(_0x560db4){return _0x560db4[_0xbd0b('0x22')]()[_0xbd0b('0x21')](function(){_0x495d62[_0xbd0b('0x16')](0xcc)[_0xbd0b('0x17')]();});}};}function handleEntityNotFound(_0x297c85,_0x539359){return function(_0x75909f){if(!_0x75909f){_0x297c85['sendStatus'](0x194);}return _0x75909f;};}function handleError(_0x3e7e9c,_0x18b9dc){_0x18b9dc=_0x18b9dc||0x1f4;return function(_0x4b0924){logger[_0xbd0b('0x23')](_0x4b0924[_0xbd0b('0x24')]);if(_0x4b0924[_0xbd0b('0x25')]){delete _0x4b0924['name'];}_0x3e7e9c[_0xbd0b('0x16')](_0x18b9dc)[_0xbd0b('0x26')](_0x4b0924);};}exports[_0xbd0b('0x27')]=function(_0x1b5a00,_0x1129ae){var _0x122893={},_0x47f6f5={},_0x149403={'count':0x0,'rows':[]};var _0x28f1a7=db[_0xbd0b('0x28')]['rawAttributes'];_0x47f6f5['model']=_[_0xbd0b('0x29')](_[_0xbd0b('0x2a')](_0x28f1a7),[_0xbd0b('0x2b')]);_0x47f6f5[_0xbd0b('0x2c')]=_[_0xbd0b('0x2a')](_0x1b5a00[_0xbd0b('0x2c')]);_0x47f6f5[_0xbd0b('0x2d')]=_['intersection'](_0x47f6f5[_0xbd0b('0x2e')],_0x47f6f5[_0xbd0b('0x2c')]);_0x122893['attributes']=_['intersection'](_0x47f6f5[_0xbd0b('0x2e')],qs[_0xbd0b('0x2f')](_0x1b5a00['query'][_0xbd0b('0x2f')]));_0x122893[_0xbd0b('0x30')]=_0x122893[_0xbd0b('0x30')][_0xbd0b('0x31')]?_0x122893[_0xbd0b('0x30')]:_0x47f6f5[_0xbd0b('0x2e')];if(!_0x1b5a00['query'][_0xbd0b('0x32')](_0xbd0b('0x33'))){_0x122893[_0xbd0b('0x19')]=qs[_0xbd0b('0x19')](_0x1b5a00[_0xbd0b('0x2c')][_0xbd0b('0x19')]);_0x122893[_0xbd0b('0x34')]=qs[_0xbd0b('0x34')](_0x1b5a00[_0xbd0b('0x2c')][_0xbd0b('0x34')]);}_0x122893[_0xbd0b('0x35')]=qs[_0xbd0b('0x36')](_0x1b5a00[_0xbd0b('0x2c')][_0xbd0b('0x36')]);_0x122893['where']=qs[_0xbd0b('0x2d')](_[_0xbd0b('0x37')](_0x1b5a00['query'],_0x47f6f5[_0xbd0b('0x2d')]));if(_0x1b5a00[_0xbd0b('0x2c')][_0xbd0b('0x38')]){_0x122893[_0xbd0b('0x39')]=_[_0xbd0b('0x3a')](_0x122893[_0xbd0b('0x39')],{'$or':_['map'](_0x28f1a7,function(_0x327425){if(_0x327425[_0xbd0b('0x3b')][_0xbd0b('0x3c')]!==_0xbd0b('0x3d')){var _0x6ef6ed={};_0x6ef6ed[_0x327425['field']]={'$like':'%'+_0x1b5a00['query'][_0xbd0b('0x38')]+'%'};return _0x6ef6ed;}})});}_0x122893=_[_0xbd0b('0x3a')]({},_0x122893,_0x1b5a00[_0xbd0b('0x3e')]);var _0x2ac653={'where':_0x122893['where']};return db['VoiceRecording'][_0xbd0b('0x18')](_0x2ac653)['then'](function(_0x27f973){_0x149403[_0xbd0b('0x18')]=_0x27f973;if(_0x1b5a00[_0xbd0b('0x2c')][_0xbd0b('0x3f')]){_0x122893[_0xbd0b('0x40')]=[{'all':!![]}];}return db[_0xbd0b('0x28')][_0xbd0b('0x41')](_0x122893);})[_0xbd0b('0x21')](function(_0x2acc9f){_0x149403[_0xbd0b('0x42')]=_0x2acc9f;return _0x149403;})[_0xbd0b('0x21')](respondWithFilteredResult(_0x1129ae,_0x122893))[_0xbd0b('0x43')](handleError(_0x1129ae,null));};exports[_0xbd0b('0x44')]=function(_0x425c8a,_0x11b1a0){var _0x18e51a={'raw':![],'where':{'id':_0x425c8a[_0xbd0b('0x45')]['id']}},_0x16c77c={};_0x16c77c['model']=_[_0xbd0b('0x2a')](db[_0xbd0b('0x28')][_0xbd0b('0x46')]);_0x16c77c[_0xbd0b('0x2c')]=_[_0xbd0b('0x2a')](_0x425c8a[_0xbd0b('0x2c')]);_0x16c77c[_0xbd0b('0x2d')]=_[_0xbd0b('0x47')](_0x16c77c[_0xbd0b('0x2e')],_0x16c77c[_0xbd0b('0x2c')]);_0x18e51a[_0xbd0b('0x30')]=_[_0xbd0b('0x47')](_0x16c77c['model'],qs[_0xbd0b('0x2f')](_0x425c8a['query']['fields']));_0x18e51a[_0xbd0b('0x30')]=_0x18e51a[_0xbd0b('0x30')][_0xbd0b('0x31')]?_0x18e51a['attributes']:_0x16c77c[_0xbd0b('0x2e')];if(_0x425c8a[_0xbd0b('0x2c')][_0xbd0b('0x3f')]){_0x18e51a[_0xbd0b('0x40')]=[{'all':!![]}];}_0x18e51a=_[_0xbd0b('0x3a')]({},_0x18e51a,_0x425c8a['options']);return db[_0xbd0b('0x28')][_0xbd0b('0x48')](_0x18e51a)[_0xbd0b('0x21')](handleEntityNotFound(_0x11b1a0,null))[_0xbd0b('0x21')](respondWithResult(_0x11b1a0,null))[_0xbd0b('0x43')](handleError(_0x11b1a0,null));};exports[_0xbd0b('0x49')]=function(_0x480c00,_0x335728){return db[_0xbd0b('0x28')][_0xbd0b('0x49')](_0x480c00[_0xbd0b('0x4a')],{})[_0xbd0b('0x21')](respondWithResult(_0x335728,0xc9))[_0xbd0b('0x43')](handleError(_0x335728,null));};exports[_0xbd0b('0x20')]=function(_0x563c64,_0xc8b3f){if(_0x563c64[_0xbd0b('0x4a')]['id']){delete _0x563c64[_0xbd0b('0x4a')]['id'];}return db[_0xbd0b('0x28')][_0xbd0b('0x48')]({'where':{'id':_0x563c64[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x21')](handleEntityNotFound(_0xc8b3f,null))[_0xbd0b('0x21')](saveUpdates(_0x563c64[_0xbd0b('0x4a')],null))[_0xbd0b('0x21')](respondWithResult(_0xc8b3f,null))[_0xbd0b('0x43')](handleError(_0xc8b3f,null));};exports[_0xbd0b('0x22')]=function(_0x3cfb52,_0xbd64e2){return db[_0xbd0b('0x28')]['find']({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x21')](handleEntityNotFound(_0xbd64e2,null))['then'](removeEntity(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x3bc7d3,_0x5bae10){return db[_0xbd0b('0x28')][_0xbd0b('0x4b')]()[_0xbd0b('0x21')](respondWithResult(_0x5bae10,null))[_0xbd0b('0x43')](handleError(_0x5bae10,null));};exports['download']=function(_0x2d2e58,_0x58ccaf,_0x57fea1){var _0x5c5d9d=require('../../components/encryptor');var _0x80d89a=![];var _0x22f741={};if(_0x2d2e58[_0xbd0b('0x2c')][_0xbd0b('0x3b')]&&_0x2d2e58[_0xbd0b('0x2c')][_0xbd0b('0x3b')]===_0xbd0b('0x4c')){_0x22f741[_0xbd0b('0x4c')]=_0x2d2e58['params']['id'];}else{_0x22f741['id']=_0x2d2e58['params']['id'];}return db[_0xbd0b('0x28')][_0xbd0b('0x48')]({'where':_0x22f741,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x58ccaf,null))[_0xbd0b('0x21')](function(_0x349713){if(_0x349713){var _0x454981=_0x349713[_0xbd0b('0x4d')];var _0x550e84=util[_0xbd0b('0x2b')](_0xbd0b('0x4e'),_0x454981);if(fs[_0xbd0b('0x4f')](_0x550e84)){_0x80d89a=!![];return _0x5c5d9d[_0xbd0b('0x50')](_0x550e84,_0x454981,config['secrets'][_0xbd0b('0x51')])[_0xbd0b('0x21')](function(){return _0x349713;});}return _0x349713;}})['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=_0x122a19[_0xbd0b('0x4d')];if(!fs[_0xbd0b('0x4f')](_0x1ea443)){throw new db[(_0xbd0b('0x52'))][(_0xbd0b('0x53'))](_0xbd0b('0x54'));}if(_0x122a19[_0xbd0b('0x55')]){return _0x58ccaf['download'](_0x1ea443,_0x122a19[_0xbd0b('0x55')]+path[_0xbd0b('0x56')](_0x1ea443),function(){if(_0x80d89a){fs[_0xbd0b('0x57')](_0x1ea443);}});}else{return _0x58ccaf[_0xbd0b('0x58')](_0x1ea443,function(_0x303037){if(_0x80d89a){fs[_0xbd0b('0x57')](_0x1ea443);}});}}})['catch'](function(_0x570648){if(_0x570648[_0xbd0b('0x59')]===_0xbd0b('0x54')){_0x58ccaf['status'](0x194)[_0xbd0b('0x26')](_0xbd0b('0x5a'));}else{return handleError(_0x58ccaf,null);}});};exports[_0xbd0b('0x5b')]=function(_0x293ca,_0x1bbe1a,_0x5be34a){var _0x366ebf=require(_0xbd0b('0x5c'));var _0x18f764=![];var _0x26a7d9={'$and':[db[_0xbd0b('0x5d')][_0xbd0b('0x39')](db[_0xbd0b('0x5d')]['fn'](_0xbd0b('0x5e'),db[_0xbd0b('0x5d')][_0xbd0b('0x5f')](_0xbd0b('0x4c'))),_0x293ca[_0xbd0b('0x2c')][_0xbd0b('0x60')])]};if(_0x293ca[_0xbd0b('0x2c')][_0xbd0b('0x3b')]&&_0x293ca[_0xbd0b('0x2c')][_0xbd0b('0x3b')]==='uniqueid'){_0x26a7d9[_0xbd0b('0x61')][_0xbd0b('0x62')]({'uniqueid':_0x293ca[_0xbd0b('0x45')]['id']});}else{_0x26a7d9[_0xbd0b('0x61')]['push']({'id':_0x293ca['params']['id']});}return db[_0xbd0b('0x28')][_0xbd0b('0x48')]({'where':_0x26a7d9,'attributes':['id',_0xbd0b('0x4d')],'raw':!![]})[_0xbd0b('0x21')](handleEntityNotFound(_0x1bbe1a,null))[_0xbd0b('0x21')](function(_0x5813a2){if(_0x5813a2){var _0x19d32c=util['format'](_0xbd0b('0x4e'),_0x5813a2[_0xbd0b('0x4d')]);if(fs[_0xbd0b('0x4f')](_0x19d32c)){_0x18f764=!![];return _0x366ebf[_0xbd0b('0x50')](_0x19d32c,_0x5813a2[_0xbd0b('0x4d')],config[_0xbd0b('0x63')]['recording'])[_0xbd0b('0x21')](function(){return _0x5813a2;});}return _0x5813a2;}})[_0xbd0b('0x21')](function(_0x21a475){if(_0x21a475){if(!fs[_0xbd0b('0x4f')](_0x21a475['value'])){throw new db[(_0xbd0b('0x52'))][(_0xbd0b('0x53'))](_0xbd0b('0x54'));}if(_0x21a475[_0xbd0b('0x55')]){return _0x1bbe1a[_0xbd0b('0x58')](_0x21a475['value'],_0x21a475['filename']+path[_0xbd0b('0x56')](_0x21a475['value']),function(){if(_0x18f764){fs[_0xbd0b('0x57')](_0x21a475[_0xbd0b('0x4d')]);}});}else{return _0x1bbe1a[_0xbd0b('0x58')](_0x21a475[_0xbd0b('0x4d')],function(_0x3f711c){if(_0x18f764){fs[_0xbd0b('0x57')](_0x21a475['value']);}});}}})[_0xbd0b('0x43')](handleError(_0x1bbe1a,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7616b8a..30e8dce 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 _0x9390=['VoiceRecording','voice_recordings','uniqueid','../../config/logger','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x5f373d,_0x43e8d0){var _0x1e70ac=function(_0x4b2b9d){while(--_0x4b2b9d){_0x5f373d['push'](_0x5f373d['shift']());}};_0x1e70ac(++_0x43e8d0);}(_0x9390,0x1f2));var _0x0939=function(_0x28d82d,_0xeaa71d){_0x28d82d=_0x28d82d-0x0;var _0x63a87d=_0x9390[_0x28d82d];return _0x63a87d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0939('0x0'))('api');var moment=require(_0x0939('0x1'));var BPromise=require(_0x0939('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0939('0x3'));var rimraf=require('rimraf');var config=require(_0x0939('0x4'));var attributes=require(_0x0939('0x5'));module[_0x0939('0x6')]=function(_0xad6ddc,_0x503a25){return _0xad6ddc[_0x0939('0x7')](_0x0939('0x8'),attributes,{'tableName':_0x0939('0x9'),'paranoid':![],'indexes':[{'name':_0x0939('0xa'),'fields':[_0x0939('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2c2=['../../config/logger','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xe2c2,0x11d));var _0x2e2c=function(_0x2001fa,_0x2959d5){_0x2001fa=_0x2001fa-0x0;var _0x3b6fd4=_0xe2c2[_0x2001fa];return _0x3b6fd4;};'use strict';var _=require(_0x2e2c('0x0'));var util=require('util');var logger=require(_0x2e2c('0x1'))('api');var moment=require(_0x2e2c('0x2'));var BPromise=require(_0x2e2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e2c('0x4'));var rimraf=require('rimraf');var config=require(_0x2e2c('0x5'));var attributes=require(_0x2e2c('0x6'));module['exports']=function(_0x2e8a5c,_0x47611d){return _0x2e8a5c[_0x2e2c('0x7')](_0x2e2c('0x8'),attributes,{'tableName':_0x2e2c('0x9'),'paranoid':![],'indexes':[{'name':_0x2e2c('0xa'),'fields':[_0x2e2c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6cd3ceb..dccb21b 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 _0x9082=['where','attributes','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','%s.cypher','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw'];(function(_0x196230,_0x6e087c){var _0x3ce9ec=function(_0x416b71){while(--_0x416b71){_0x196230['push'](_0x196230['shift']());}};_0x3ce9ec(++_0x6e087c);}(_0x9082,0x14c));var _0x2908=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x9082[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x2908('0x0'));var util=require(_0x2908('0x1'));var moment=require(_0x2908('0x2'));var BPromise=require(_0x2908('0x3'));var rs=require(_0x2908('0x4'));var fs=require('fs');var Redis=require(_0x2908('0x5'));var db=require(_0x2908('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2908('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2908('0x8'));var client=jayson[_0x2908('0x9')][_0x2908('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a2d92,_0x17399d,_0x5213a1){return new BPromise(function(_0xbb7b31,_0x43060e){return client[_0x2908('0xb')](_0x1a2d92,_0x5213a1)[_0x2908('0xc')](function(_0x4216b1){logger[_0x2908('0xd')](_0x2908('0xe'),_0x17399d,_0x2908('0xf'));logger[_0x2908('0x10')](_0x2908('0x11'),_0x17399d,_0x2908('0xf'),JSON[_0x2908('0x12')](_0x4216b1));if(_0x4216b1[_0x2908('0x13')]){if(_0x4216b1[_0x2908('0x13')][_0x2908('0x14')]===0x1f4){logger[_0x2908('0x13')](_0x2908('0xe'),_0x17399d,_0x4216b1['error'][_0x2908('0x15')]);return _0x43060e(_0x4216b1['error'][_0x2908('0x15')]);}logger[_0x2908('0x13')](_0x2908('0xe'),_0x17399d,_0x4216b1[_0x2908('0x13')][_0x2908('0x15')]);return _0xbb7b31(_0x4216b1[_0x2908('0x13')][_0x2908('0x15')]);}else{logger[_0x2908('0xd')](_0x2908('0xe'),_0x17399d,_0x2908('0xf'));_0xbb7b31(_0x4216b1['result']['message']);}})[_0x2908('0x16')](function(_0x318bf9){logger[_0x2908('0x13')](_0x2908('0xe'),_0x17399d,_0x318bf9);_0x43060e(_0x318bf9);});});}exports[_0x2908('0x17')]=function(_0x1eeef){var _0x3123c2=this;return new Promise(function(_0x1ae39b,_0x577d32){return db['VoiceRecording'][_0x2908('0x18')](_0x1eeef[_0x2908('0x19')],{'raw':_0x1eeef['options']?_0x1eeef[_0x2908('0x1a')][_0x2908('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eeef[_0x2908('0x1a')]?_0x1eeef['options'][_0x2908('0x1c')]||null:null,'attributes':_0x1eeef[_0x2908('0x1a')]?_0x1eeef[_0x2908('0x1a')][_0x2908('0x1d')]||null:null,'limit':_0x1eeef['options']?_0x1eeef[_0x2908('0x1a')]['limit']||null:null})[_0x2908('0xc')](function(_0x25dc7f){logger[_0x2908('0xd')]('UpdateVoiceRecording',_0x1eeef);logger['debug'](_0x2908('0x17'),_0x1eeef,JSON[_0x2908('0x12')](_0x25dc7f));_0x1ae39b(_0x25dc7f);})[_0x2908('0x16')](function(_0x444b90){logger['error'](_0x2908('0x17'),_0x444b90[_0x2908('0x15')],_0x1eeef);_0x577d32(_0x3123c2[_0x2908('0x13')](0x1f4,_0x444b90[_0x2908('0x15')]));});});};exports[_0x2908('0x1e')]=function(_0x431c5c){var _0xdc4c77=this;return new Promise(function(_0x1ee032,_0x506c3d){var _0xe59e88=require(_0x2908('0x1f'));var _0x520552;return db[_0x2908('0x20')][_0x2908('0x21')]({'attributes':['id',_0x2908('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2908('0xc')](function(_0x227c04){_0x520552=_0x227c04;return db[_0x2908('0x23')][_0x2908('0x24')](_0x431c5c[_0x2908('0x19')]);})[_0x2908('0xc')](function(_0x23d44a){if(_0x520552[_0x2908('0x22')]&&fs[_0x2908('0x25')](_0x23d44a['value'])){var _0x30c7a8=util[_0x2908('0x26')](_0x2908('0x27'),_0x23d44a['value']);return _0xe59e88['encryptFile'](_0x23d44a[_0x2908('0x28')],_0x30c7a8,config[_0x2908('0x29')][_0x2908('0x2a')])['then'](function(){fs[_0x2908('0x2b')](_0x23d44a[_0x2908('0x28')]);logger[_0x2908('0xd')](_0x2908('0x2c'));return _0x23d44a;});}return _0x23d44a;})[_0x2908('0xc')](function(_0x2a8c2c){logger[_0x2908('0xd')](_0x2908('0x1e'),_0x431c5c);logger['debug']('CreateVoiceRecording',_0x431c5c,JSON['stringify'](_0x2a8c2c));_0x1ee032(_0x2a8c2c);})['catch'](function(_0x1e23c8){logger['error']('CreateVoiceRecording',_0x1e23c8[_0x2908('0x15')],_0x431c5c);_0x506c3d(_0xdc4c77['error'](0x1f4,_0x1e23c8[_0x2908('0x15')]));});});}; \ No newline at end of file +var _0xc701=['encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','CreateVoiceRecording','Setting','findOne','VoiceRecording','create','callRecordingEncryption','existsSync','value'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc701,0x7f));var _0x1c70=function(_0x45b1b3,_0x224dce){_0x45b1b3=_0x45b1b3-0x0;var _0x8f20cc=_0xc701[_0x45b1b3];return _0x8f20cc;};'use strict';var _=require('lodash');var util=require(_0x1c70('0x0'));var moment=require('moment');var BPromise=require(_0x1c70('0x1'));var rs=require(_0x1c70('0x2'));var fs=require('fs');var Redis=require(_0x1c70('0x3'));var db=require(_0x1c70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c70('0x5'))(_0x1c70('0x6'));var config=require(_0x1c70('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1c70('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31416e,_0x27cb23,_0x311666){return new BPromise(function(_0x4ca981,_0x594dcc){return client[_0x1c70('0x9')](_0x31416e,_0x311666)[_0x1c70('0xa')](function(_0x36f23a){logger[_0x1c70('0xb')](_0x1c70('0xc'),_0x27cb23,_0x1c70('0xd'));logger[_0x1c70('0xe')](_0x1c70('0xf'),_0x27cb23,_0x1c70('0xd'),JSON[_0x1c70('0x10')](_0x36f23a));if(_0x36f23a[_0x1c70('0x11')]){if(_0x36f23a[_0x1c70('0x11')][_0x1c70('0x12')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x27cb23,_0x36f23a['error']['message']);return _0x594dcc(_0x36f23a['error'][_0x1c70('0x13')]);}logger['error'](_0x1c70('0xc'),_0x27cb23,_0x36f23a['error'][_0x1c70('0x13')]);return _0x4ca981(_0x36f23a[_0x1c70('0x11')]['message']);}else{logger['info'](_0x1c70('0xc'),_0x27cb23,_0x1c70('0xd'));_0x4ca981(_0x36f23a[_0x1c70('0x14')][_0x1c70('0x13')]);}})[_0x1c70('0x15')](function(_0xafd197){logger[_0x1c70('0x11')](_0x1c70('0xc'),_0x27cb23,_0xafd197);_0x594dcc(_0xafd197);});});}exports[_0x1c70('0x16')]=function(_0x24aa86){var _0x4add28=this;return new Promise(function(_0x15f388,_0x3c3be9){return db['VoiceRecording'][_0x1c70('0x17')](_0x24aa86[_0x1c70('0x18')],{'raw':_0x24aa86['options']?_0x24aa86[_0x1c70('0x19')][_0x1c70('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24aa86[_0x1c70('0x19')]?_0x24aa86[_0x1c70('0x19')][_0x1c70('0x1b')]||null:null,'attributes':_0x24aa86[_0x1c70('0x19')]?_0x24aa86['options'][_0x1c70('0x1c')]||null:null,'limit':_0x24aa86[_0x1c70('0x19')]?_0x24aa86[_0x1c70('0x19')]['limit']||null:null})[_0x1c70('0xa')](function(_0x4330de){logger[_0x1c70('0xb')]('UpdateVoiceRecording',_0x24aa86);logger[_0x1c70('0xe')](_0x1c70('0x16'),_0x24aa86,JSON[_0x1c70('0x10')](_0x4330de));_0x15f388(_0x4330de);})['catch'](function(_0x55b5f3){logger[_0x1c70('0x11')]('UpdateVoiceRecording',_0x55b5f3[_0x1c70('0x13')],_0x24aa86);_0x3c3be9(_0x4add28[_0x1c70('0x11')](0x1f4,_0x55b5f3[_0x1c70('0x13')]));});});};exports[_0x1c70('0x1d')]=function(_0x289cb6){var _0x285142=this;return new Promise(function(_0x2ca58b,_0x599624){var _0x4e9707=require('../../components/encryptor');var _0x472926;return db[_0x1c70('0x1e')][_0x1c70('0x1f')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x1c70('0xa')](function(_0x2e2b2d){_0x472926=_0x2e2b2d;return db[_0x1c70('0x20')][_0x1c70('0x21')](_0x289cb6[_0x1c70('0x18')]);})[_0x1c70('0xa')](function(_0x4a79ee){if(_0x472926[_0x1c70('0x22')]&&fs[_0x1c70('0x23')](_0x4a79ee[_0x1c70('0x24')])){var _0x1a5e78=util['format']('%s.cypher',_0x4a79ee[_0x1c70('0x24')]);return _0x4e9707[_0x1c70('0x25')](_0x4a79ee['value'],_0x1a5e78,config[_0x1c70('0x26')][_0x1c70('0x27')])['then'](function(){fs['unlink'](_0x4a79ee[_0x1c70('0x24')]);logger['info'](_0x1c70('0x28'));return _0x4a79ee;});}return _0x4a79ee;})['then'](function(_0x4e6592){logger[_0x1c70('0xb')](_0x1c70('0x1d'),_0x289cb6);logger[_0x1c70('0xe')](_0x1c70('0x1d'),_0x289cb6,JSON['stringify'](_0x4e6592));_0x2ca58b(_0x4e6592);})[_0x1c70('0x15')](function(_0x2e5cd2){logger[_0x1c70('0x11')]('CreateVoiceRecording',_0x2e5cd2[_0x1c70('0x13')],_0x289cb6);_0x599624(_0x285142[_0x1c70('0x11')](0x1f4,_0x2e5cd2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3ccaf6e..f76d232 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 _0x5aad=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer'];(function(_0x194f6f,_0x83d298){var _0x46e479=function(_0x898902){while(--_0x898902){_0x194f6f['push'](_0x194f6f['shift']());}};_0x46e479(++_0x83d298);}(_0x5aad,0x143));var _0xd5aa=function(_0x325948,_0x2b7e3c){_0x325948=_0x325948-0x0;var _0x54f182=_0x5aad[_0x325948];return _0x54f182;};'use strict';var multer=require(_0xd5aa('0x0'));var util=require(_0xd5aa('0x1'));var path=require('path');var timeout=require(_0xd5aa('0x2'));var express=require(_0xd5aa('0x3'));var router=express[_0xd5aa('0x4')]();var auth=require(_0xd5aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd5aa('0x6'));var controller=require(_0xd5aa('0x7'));router[_0xd5aa('0x8')]('/',auth[_0xd5aa('0x9')](),controller[_0xd5aa('0xa')]);router['get'](_0xd5aa('0xb'),auth[_0xd5aa('0x9')](),controller['show']);router[_0xd5aa('0xc')]('/',auth['isAuthenticated'](),controller[_0xd5aa('0xd')]);router[_0xd5aa('0xe')](_0xd5aa('0xb'),auth[_0xd5aa('0x9')](),controller['update']);router[_0xd5aa('0xf')]('/:id',auth[_0xd5aa('0x9')](),controller[_0xd5aa('0x10')]);module[_0xd5aa('0x11')]=router; \ No newline at end of file +var _0x8552=['get','index','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x47f5c7,_0x5aa4ca){var _0x350562=function(_0x1b7c73){while(--_0x1b7c73){_0x47f5c7['push'](_0x47f5c7['shift']());}};_0x350562(++_0x5aa4ca);}(_0x8552,0x1b9));var _0x2855=function(_0x21c263,_0x1b44b1){_0x21c263=_0x21c263-0x0;var _0x544e45=_0x8552[_0x21c263];return _0x544e45;};'use strict';var multer=require(_0x2855('0x0'));var util=require(_0x2855('0x1'));var path=require('path');var timeout=require(_0x2855('0x2'));var express=require(_0x2855('0x3'));var router=express[_0x2855('0x4')]();var auth=require(_0x2855('0x5'));var interaction=require(_0x2855('0x6'));var config=require(_0x2855('0x7'));var controller=require(_0x2855('0x8'));router[_0x2855('0x9')]('/',auth['isAuthenticated'](),controller[_0x2855('0xa')]);router[_0x2855('0x9')](_0x2855('0xb'),auth['isAuthenticated'](),controller[_0x2855('0xc')]);router[_0x2855('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2855('0xe')](_0x2855('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2855('0xf')](_0x2855('0xb'),auth['isAuthenticated'](),controller[_0x2855('0x10')]);module[_0x2855('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e58cdf7..7790b94 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 _0xb55c=['blind','STRING','ENUM','Yes','moment','exports'];(function(_0x36e649,_0x2a99d2){var _0x5f2710=function(_0x214e9b){while(--_0x214e9b){_0x36e649['push'](_0x36e649['shift']());}};_0x5f2710(++_0x2a99d2);}(_0xb55c,0xbe));var _0xcb55=function(_0x3fddf3,_0x36ce44){_0x3fddf3=_0x3fddf3-0x0;var _0x15650d=_0xb55c[_0x3fddf3];return _0x15650d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcb55('0x0'));module[_0xcb55('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcb55('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xcb55('0x3')]},'transferercalleridname':{'type':Sequelize[_0xcb55('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xcb55('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xcb55('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xcb55('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xcb55('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xcb55('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xcb55('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xcb55('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcb55('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xcb55('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xcb55('0x3')]},'transfereecontext':{'type':Sequelize[_0xcb55('0x3')]},'transfereeexten':{'type':Sequelize[_0xcb55('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xcb55('0x3')]},'isexternal':{'type':Sequelize[_0xcb55('0x4')](_0xcb55('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xcb55('0x3')]}}; \ No newline at end of file +var _0x9cc3=['Yes','sequelize','ENUM','blind','attended','STRING'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0x9cc3,0x19f));var _0x39cc=function(_0x2a82d1,_0x280ff1){_0x2a82d1=_0x2a82d1-0x0;var _0x56db01=_0x9cc3[_0x2a82d1];return _0x56db01;};'use strict';var Sequelize=require(_0x39cc('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x39cc('0x1')](_0x39cc('0x2'),_0x39cc('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x39cc('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x39cc('0x4')]},'transferercalleridname':{'type':Sequelize[_0x39cc('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x39cc('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x39cc('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x39cc('0x4')]},'transferercontext':{'type':Sequelize[_0x39cc('0x4')]},'transfererexten':{'type':Sequelize[_0x39cc('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x39cc('0x4')]},'transfereechannel':{'type':Sequelize[_0x39cc('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x39cc('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x39cc('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x39cc('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x39cc('0x4')]},'transfereeexten':{'type':Sequelize[_0x39cc('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x39cc('0x1')](_0x39cc('0x5'),'No')},'context':{'type':Sequelize[_0x39cc('0x4')]},'extension':{'type':Sequelize[_0x39cc('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 37c9b4b..4e76f9a 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 _0xa716=['create','body','params','html-pdf','zip-dir','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','name','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','merge','includeAll','include','rows','show','find','catch'];(function(_0x20d948,_0x52e763){var _0x86864f=function(_0x45a809){while(--_0x45a809){_0x20d948['push'](_0x20d948['shift']());}};_0x86864f(++_0x52e763);}(_0xa716,0x12f));var _0x6a71=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa716[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0x6a71('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a71('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6a71('0x3'));var path=require('path');var sox=require(_0x6a71('0x4'));var csv=require(_0x6a71('0x5'));var ejs=require(_0x6a71('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6a71('0x7'));var crypto=require(_0x6a71('0x8'));var jsforce=require(_0x6a71('0x9'));var deskjs=require(_0x6a71('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6a71('0xb'));var Redis=require(_0x6a71('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6a71('0xd'));var logger=require(_0x6a71('0xe'))(_0x6a71('0xf'));var utils=require(_0x6a71('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x149e0f,_0x21fb8b){_0x21fb8b=_0x21fb8b||0xcc;return function(_0x317425){if(_0x317425){return _0x149e0f['sendStatus'](_0x21fb8b);}return _0x149e0f['status'](_0x21fb8b)['end']();};}function respondWithResult(_0x223c70,_0x3b9879){_0x3b9879=_0x3b9879||0xc8;return function(_0x826494){if(_0x826494){return _0x223c70[_0x6a71('0x11')](_0x3b9879)[_0x6a71('0x12')](_0x826494);}};}function respondWithFilteredResult(_0x71d573,_0x3c09ad){return function(_0x593fe2){if(_0x593fe2){var _0x1bc656=_0x593fe2[_0x6a71('0x13')],_0x1db753=_0x3c09ad['offset'],_0xafb98f=_0x3c09ad[_0x6a71('0x14')]+_0x3c09ad[_0x6a71('0x15')],_0x5d481a;if(_0xafb98f>=_0x1bc656){_0xafb98f=_0x1bc656;_0x5d481a=0xc8;}else{_0x5d481a=0xce;}_0x71d573[_0x6a71('0x11')](_0x5d481a);return _0x71d573['set'](_0x6a71('0x16'),_0x1db753+'-'+_0xafb98f+'/'+_0x1bc656)[_0x6a71('0x12')](_0x593fe2);}return null;};}function patchUpdates(_0x2cdc4a){return function(_0x390e1b){try{jsonpatch[_0x6a71('0x17')](_0x390e1b,_0x2cdc4a,!![]);}catch(_0x22d6a4){return BPromise[_0x6a71('0x18')](_0x22d6a4);}return _0x390e1b[_0x6a71('0x19')]();};}function saveUpdates(_0x380ad5,_0x306abd){return function(_0x34a52d){if(_0x34a52d){return _0x34a52d[_0x6a71('0x1a')](_0x380ad5)[_0x6a71('0x1b')](function(_0x4c8fd5){return _0x4c8fd5;});}return null;};}function removeEntity(_0x423905,_0x2690c4){return function(_0x5105b6){if(_0x5105b6){return _0x5105b6[_0x6a71('0x1c')]()[_0x6a71('0x1b')](function(){_0x423905[_0x6a71('0x11')](0xcc)[_0x6a71('0x1d')]();});}};}function handleEntityNotFound(_0x54b0ca,_0x349c0e){return function(_0x427bfa){if(!_0x427bfa){_0x54b0ca[_0x6a71('0x1e')](0x194);}return _0x427bfa;};}function handleError(_0x4f64e9,_0x4d4896){_0x4d4896=_0x4d4896||0x1f4;return function(_0x3a44c3){logger['error'](_0x3a44c3['stack']);if(_0x3a44c3[_0x6a71('0x1f')]){delete _0x3a44c3[_0x6a71('0x1f')];}_0x4f64e9[_0x6a71('0x11')](_0x4d4896)['send'](_0x3a44c3);};}exports[_0x6a71('0x20')]=function(_0x18f662,_0x4b4d93){var _0x596ed5={},_0x2ebca2={},_0x193104={'count':0x0,'rows':[]};var _0x50ebe8=db[_0x6a71('0x21')][_0x6a71('0x22')];_0x2ebca2[_0x6a71('0x23')]=_[_0x6a71('0x24')](_0x50ebe8);_0x2ebca2[_0x6a71('0x25')]=_[_0x6a71('0x24')](_0x18f662['query']);_0x2ebca2[_0x6a71('0x26')]=_['intersection'](_0x2ebca2[_0x6a71('0x23')],_0x2ebca2['query']);_0x596ed5[_0x6a71('0x27')]=_[_0x6a71('0x28')](_0x2ebca2['model'],qs[_0x6a71('0x29')](_0x18f662[_0x6a71('0x25')][_0x6a71('0x29')]));_0x596ed5[_0x6a71('0x27')]=_0x596ed5[_0x6a71('0x27')][_0x6a71('0x2a')]?_0x596ed5[_0x6a71('0x27')]:_0x2ebca2[_0x6a71('0x23')];if(!_0x18f662[_0x6a71('0x25')][_0x6a71('0x2b')](_0x6a71('0x2c'))){_0x596ed5[_0x6a71('0x15')]=qs[_0x6a71('0x15')](_0x18f662['query']['limit']);_0x596ed5[_0x6a71('0x14')]=qs[_0x6a71('0x14')](_0x18f662[_0x6a71('0x25')][_0x6a71('0x14')]);}_0x596ed5[_0x6a71('0x2d')]=qs[_0x6a71('0x2e')](_0x18f662[_0x6a71('0x25')][_0x6a71('0x2e')]);_0x596ed5['where']=qs['filters'](_['pick'](_0x18f662[_0x6a71('0x25')],_0x2ebca2[_0x6a71('0x26')]));if(_0x18f662[_0x6a71('0x25')][_0x6a71('0x2f')]){_0x596ed5[_0x6a71('0x30')]=_['merge'](_0x596ed5[_0x6a71('0x30')],{'$or':_[_0x6a71('0x31')](_0x50ebe8,function(_0x4b392f){if(_0x4b392f['type']['key']!=='VIRTUAL'){var _0x1a0bb3={};_0x1a0bb3[_0x4b392f['field']]={'$like':'%'+_0x18f662[_0x6a71('0x25')][_0x6a71('0x2f')]+'%'};return _0x1a0bb3;}})});}_0x596ed5=_[_0x6a71('0x32')]({},_0x596ed5,_0x18f662['options']);var _0x3d4f55={'where':_0x596ed5[_0x6a71('0x30')]};return db[_0x6a71('0x21')]['count'](_0x3d4f55)['then'](function(_0x1863e0){_0x193104[_0x6a71('0x13')]=_0x1863e0;if(_0x18f662[_0x6a71('0x25')][_0x6a71('0x33')]){_0x596ed5[_0x6a71('0x34')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x596ed5);})['then'](function(_0x57b787){_0x193104[_0x6a71('0x35')]=_0x57b787;return _0x193104;})[_0x6a71('0x1b')](respondWithFilteredResult(_0x4b4d93,_0x596ed5))['catch'](handleError(_0x4b4d93,null));};exports[_0x6a71('0x36')]=function(_0x5a2745,_0x16d0c3){var _0xb4655={'raw':!![],'where':{'id':_0x5a2745['params']['id']}},_0x57e85a={};_0x57e85a[_0x6a71('0x23')]=_[_0x6a71('0x24')](db[_0x6a71('0x21')][_0x6a71('0x22')]);_0x57e85a[_0x6a71('0x25')]=_['keys'](_0x5a2745[_0x6a71('0x25')]);_0x57e85a['filters']=_[_0x6a71('0x28')](_0x57e85a['model'],_0x57e85a[_0x6a71('0x25')]);_0xb4655[_0x6a71('0x27')]=_[_0x6a71('0x28')](_0x57e85a['model'],qs[_0x6a71('0x29')](_0x5a2745[_0x6a71('0x25')][_0x6a71('0x29')]));_0xb4655[_0x6a71('0x27')]=_0xb4655['attributes'][_0x6a71('0x2a')]?_0xb4655[_0x6a71('0x27')]:_0x57e85a[_0x6a71('0x23')];if(_0x5a2745[_0x6a71('0x25')][_0x6a71('0x33')]){_0xb4655[_0x6a71('0x34')]=[{'all':!![]}];}_0xb4655=_[_0x6a71('0x32')]({},_0xb4655,_0x5a2745['options']);return db[_0x6a71('0x21')][_0x6a71('0x37')](_0xb4655)[_0x6a71('0x1b')](handleEntityNotFound(_0x16d0c3,null))[_0x6a71('0x1b')](respondWithResult(_0x16d0c3,null))[_0x6a71('0x38')](handleError(_0x16d0c3,null));};exports[_0x6a71('0x39')]=function(_0x2a624a,_0x49a3c8){return db['VoiceTransferReport']['create'](_0x2a624a['body'],{})['then'](respondWithResult(_0x49a3c8,0xc9))['catch'](handleError(_0x49a3c8,null));};exports[_0x6a71('0x1a')]=function(_0x51076f,_0x3f36f6){if(_0x51076f[_0x6a71('0x3a')]['id']){delete _0x51076f[_0x6a71('0x3a')]['id'];}return db[_0x6a71('0x21')][_0x6a71('0x37')]({'where':{'id':_0x51076f[_0x6a71('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3f36f6,null))[_0x6a71('0x1b')](saveUpdates(_0x51076f['body'],null))[_0x6a71('0x1b')](respondWithResult(_0x3f36f6,null))[_0x6a71('0x38')](handleError(_0x3f36f6,null));};exports[_0x6a71('0x1c')]=function(_0x2e24c4,_0xf5a66f){return db[_0x6a71('0x21')][_0x6a71('0x37')]({'where':{'id':_0x2e24c4['params']['id']}})[_0x6a71('0x1b')](handleEntityNotFound(_0xf5a66f,null))[_0x6a71('0x1b')](removeEntity(_0xf5a66f,null))[_0x6a71('0x38')](handleError(_0xf5a66f,null));}; \ No newline at end of file +var _0x485b=['set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','VoiceTransferReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','findAll','catch','show','params','includeAll','options','find','create','body','update','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit'];(function(_0x455893,_0x909838){var _0x3851e8=function(_0x32ac8a){while(--_0x32ac8a){_0x455893['push'](_0x455893['shift']());}};_0x3851e8(++_0x909838);}(_0x485b,0x1e3));var _0xb485=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x485b[_0x92c450];return _0x2a9599;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb485('0x0'));var rimraf=require(_0xb485('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb485('0x2'));var moment=require(_0xb485('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb485('0x4'));var util=require(_0xb485('0x5'));var path=require(_0xb485('0x6'));var sox=require(_0xb485('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb485('0x8'));var squel=require(_0xb485('0x9'));var crypto=require(_0xb485('0xa'));var jsforce=require(_0xb485('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb485('0xc'));var querystring=require(_0xb485('0xd'));var Papa=require('papaparse');var Redis=require(_0xb485('0xe'));var authService=require(_0xb485('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb485('0x10'));var logger=require(_0xb485('0x11'))(_0xb485('0x12'));var utils=require(_0xb485('0x13'));var config=require(_0xb485('0x14'));var db=require(_0xb485('0x15'))['db'];function respondWithStatusCode(_0x399c34,_0x59877d){_0x59877d=_0x59877d||0xcc;return function(_0x9cab42){if(_0x9cab42){return _0x399c34[_0xb485('0x16')](_0x59877d);}return _0x399c34[_0xb485('0x17')](_0x59877d)[_0xb485('0x18')]();};}function respondWithResult(_0x348ea4,_0x436807){_0x436807=_0x436807||0xc8;return function(_0x8856f7){if(_0x8856f7){return _0x348ea4['status'](_0x436807)['json'](_0x8856f7);}};}function respondWithFilteredResult(_0x49f805,_0x713ac4){return function(_0x53b00f){if(_0x53b00f){var _0x2c5001=_0x53b00f[_0xb485('0x19')],_0x479f2a=_0x713ac4[_0xb485('0x1a')],_0x430805=_0x713ac4[_0xb485('0x1a')]+_0x713ac4[_0xb485('0x1b')],_0x1223fb;if(_0x430805>=_0x2c5001){_0x430805=_0x2c5001;_0x1223fb=0xc8;}else{_0x1223fb=0xce;}_0x49f805[_0xb485('0x17')](_0x1223fb);return _0x49f805[_0xb485('0x1c')](_0xb485('0x1d'),_0x479f2a+'-'+_0x430805+'/'+_0x2c5001)[_0xb485('0x1e')](_0x53b00f);}return null;};}function patchUpdates(_0x3f9df5){return function(_0x15b1df){try{jsonpatch[_0xb485('0x1f')](_0x15b1df,_0x3f9df5,!![]);}catch(_0x49c594){return BPromise[_0xb485('0x20')](_0x49c594);}return _0x15b1df[_0xb485('0x21')]();};}function saveUpdates(_0x2e7edd,_0x1af8a6){return function(_0x34ea31){if(_0x34ea31){return _0x34ea31['update'](_0x2e7edd)[_0xb485('0x22')](function(_0x398d40){return _0x398d40;});}return null;};}function removeEntity(_0x452750,_0x59d209){return function(_0x3e4f70){if(_0x3e4f70){return _0x3e4f70[_0xb485('0x23')]()[_0xb485('0x22')](function(){_0x452750[_0xb485('0x17')](0xcc)[_0xb485('0x18')]();});}};}function handleEntityNotFound(_0x4be92e,_0x57f63d){return function(_0xb87e1){if(!_0xb87e1){_0x4be92e['sendStatus'](0x194);}return _0xb87e1;};}function handleError(_0x54f5d5,_0x800473){_0x800473=_0x800473||0x1f4;return function(_0x1701a8){logger['error'](_0x1701a8[_0xb485('0x24')]);if(_0x1701a8[_0xb485('0x25')]){delete _0x1701a8[_0xb485('0x25')];}_0x54f5d5[_0xb485('0x17')](_0x800473)[_0xb485('0x26')](_0x1701a8);};}exports[_0xb485('0x27')]=function(_0x2db31f,_0x29fcfa){var _0x285268={},_0x23b0db={},_0x2841a3={'count':0x0,'rows':[]};var _0x302e4c=db[_0xb485('0x28')][_0xb485('0x29')];_0x23b0db[_0xb485('0x2a')]=_['keys'](_0x302e4c);_0x23b0db[_0xb485('0x2b')]=_[_0xb485('0x2c')](_0x2db31f[_0xb485('0x2b')]);_0x23b0db[_0xb485('0x2d')]=_['intersection'](_0x23b0db[_0xb485('0x2a')],_0x23b0db['query']);_0x285268[_0xb485('0x2e')]=_[_0xb485('0x2f')](_0x23b0db[_0xb485('0x2a')],qs['fields'](_0x2db31f[_0xb485('0x2b')][_0xb485('0x30')]));_0x285268[_0xb485('0x2e')]=_0x285268[_0xb485('0x2e')][_0xb485('0x31')]?_0x285268[_0xb485('0x2e')]:_0x23b0db[_0xb485('0x2a')];if(!_0x2db31f[_0xb485('0x2b')]['hasOwnProperty'](_0xb485('0x32'))){_0x285268['limit']=qs['limit'](_0x2db31f['query'][_0xb485('0x1b')]);_0x285268[_0xb485('0x1a')]=qs[_0xb485('0x1a')](_0x2db31f['query']['offset']);}_0x285268[_0xb485('0x33')]=qs[_0xb485('0x34')](_0x2db31f['query'][_0xb485('0x34')]);_0x285268[_0xb485('0x35')]=qs[_0xb485('0x2d')](_[_0xb485('0x36')](_0x2db31f[_0xb485('0x2b')],_0x23b0db['filters']));if(_0x2db31f[_0xb485('0x2b')][_0xb485('0x37')]){_0x285268[_0xb485('0x35')]=_[_0xb485('0x38')](_0x285268[_0xb485('0x35')],{'$or':_[_0xb485('0x39')](_0x302e4c,function(_0x395b9a){if(_0x395b9a[_0xb485('0x3a')][_0xb485('0x3b')]!==_0xb485('0x3c')){var _0x1cb087={};_0x1cb087[_0x395b9a[_0xb485('0x3d')]]={'$like':'%'+_0x2db31f['query']['filter']+'%'};return _0x1cb087;}})});}_0x285268=_[_0xb485('0x38')]({},_0x285268,_0x2db31f['options']);var _0x2d93af={'where':_0x285268['where']};return db[_0xb485('0x28')]['count'](_0x2d93af)[_0xb485('0x22')](function(_0x74d198){_0x2841a3[_0xb485('0x19')]=_0x74d198;if(_0x2db31f['query']['includeAll']){_0x285268[_0xb485('0x3e')]=[{'all':!![]}];}return db[_0xb485('0x28')][_0xb485('0x3f')](_0x285268);})[_0xb485('0x22')](function(_0x1ac6ab){_0x2841a3['rows']=_0x1ac6ab;return _0x2841a3;})[_0xb485('0x22')](respondWithFilteredResult(_0x29fcfa,_0x285268))[_0xb485('0x40')](handleError(_0x29fcfa,null));};exports[_0xb485('0x41')]=function(_0x18ade9,_0x43e174){var _0x107baf={'raw':!![],'where':{'id':_0x18ade9[_0xb485('0x42')]['id']}},_0x4b7877={};_0x4b7877['model']=_[_0xb485('0x2c')](db[_0xb485('0x28')][_0xb485('0x29')]);_0x4b7877['query']=_[_0xb485('0x2c')](_0x18ade9[_0xb485('0x2b')]);_0x4b7877[_0xb485('0x2d')]=_[_0xb485('0x2f')](_0x4b7877[_0xb485('0x2a')],_0x4b7877[_0xb485('0x2b')]);_0x107baf[_0xb485('0x2e')]=_[_0xb485('0x2f')](_0x4b7877[_0xb485('0x2a')],qs['fields'](_0x18ade9[_0xb485('0x2b')][_0xb485('0x30')]));_0x107baf['attributes']=_0x107baf[_0xb485('0x2e')]['length']?_0x107baf[_0xb485('0x2e')]:_0x4b7877[_0xb485('0x2a')];if(_0x18ade9[_0xb485('0x2b')][_0xb485('0x43')]){_0x107baf[_0xb485('0x3e')]=[{'all':!![]}];}_0x107baf=_[_0xb485('0x38')]({},_0x107baf,_0x18ade9[_0xb485('0x44')]);return db[_0xb485('0x28')][_0xb485('0x45')](_0x107baf)[_0xb485('0x22')](handleEntityNotFound(_0x43e174,null))[_0xb485('0x22')](respondWithResult(_0x43e174,null))[_0xb485('0x40')](handleError(_0x43e174,null));};exports[_0xb485('0x46')]=function(_0x15b6f3,_0x37349f){return db[_0xb485('0x28')]['create'](_0x15b6f3[_0xb485('0x47')],{})[_0xb485('0x22')](respondWithResult(_0x37349f,0xc9))['catch'](handleError(_0x37349f,null));};exports[_0xb485('0x48')]=function(_0x149d35,_0x1d3dad){if(_0x149d35['body']['id']){delete _0x149d35[_0xb485('0x47')]['id'];}return db[_0xb485('0x28')][_0xb485('0x45')]({'where':{'id':_0x149d35[_0xb485('0x42')]['id']}})[_0xb485('0x22')](handleEntityNotFound(_0x1d3dad,null))[_0xb485('0x22')](saveUpdates(_0x149d35[_0xb485('0x47')],null))[_0xb485('0x22')](respondWithResult(_0x1d3dad,null))['catch'](handleError(_0x1d3dad,null));};exports[_0xb485('0x23')]=function(_0x247e6e,_0x3795be){return db['VoiceTransferReport'][_0xb485('0x45')]({'where':{'id':_0x247e6e['params']['id']}})[_0xb485('0x22')](handleEntityNotFound(_0x3795be,null))[_0xb485('0x22')](removeEntity(_0x3795be,null))[_0xb485('0x40')](handleError(_0x3795be,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5fcb0d5..7d29c3a 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 _0x6021=['lodash','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer'];(function(_0x143107,_0xa9e8ae){var _0x5216ea=function(_0x5d68a7){while(--_0x5d68a7){_0x143107['push'](_0x143107['shift']());}};_0x5216ea(++_0xa9e8ae);}(_0x6021,0xa0));var _0x1602=function(_0x5008f4,_0x3ea72c){_0x5008f4=_0x5008f4-0x0;var _0x2cf917=_0x6021[_0x5008f4];return _0x2cf917;};'use strict';var _=require(_0x1602('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1602('0x1'));var rp=require(_0x1602('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1602('0x3'));var config=require(_0x1602('0x4'));var attributes=require(_0x1602('0x5'));module['exports']=function(_0x3fd2c5,_0x5eff6a){return _0x3fd2c5[_0x1602('0x6')]('VoiceTransferReport',attributes,{'tableName':_0x1602('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ba0=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','moment','bluebird','request-promise','path'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x5ba0,0x103));var _0x05ba=function(_0x56be72,_0xc8e47f){_0x56be72=_0x56be72-0x0;var _0x6bf2fc=_0x5ba0[_0x56be72];return _0x6bf2fc;};'use strict';var _=require(_0x05ba('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x05ba('0x1'));var BPromise=require(_0x05ba('0x2'));var rp=require(_0x05ba('0x3'));var fs=require('fs');var path=require(_0x05ba('0x4'));var rimraf=require(_0x05ba('0x5'));var config=require(_0x05ba('0x6'));var attributes=require(_0x05ba('0x7'));module[_0x05ba('0x8')]=function(_0x43f03f,_0x216220){return _0x43f03f[_0x05ba('0x9')](_0x05ba('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index dd01f79..675aa58 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 _0x2c0c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body','options','lodash'];(function(_0x58d6e2,_0x212485){var _0x2273de=function(_0xb90163){while(--_0xb90163){_0x58d6e2['push'](_0x58d6e2['shift']());}};_0x2273de(++_0x212485);}(_0x2c0c,0x195));var _0xc2c0=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x2c0c[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xc2c0('0x0'));var util=require(_0xc2c0('0x1'));var moment=require(_0xc2c0('0x2'));var BPromise=require(_0xc2c0('0x3'));var rs=require(_0xc2c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2c0('0x5'))['db'];var utils=require(_0xc2c0('0x6'));var logger=require(_0xc2c0('0x7'))(_0xc2c0('0x8'));var config=require(_0xc2c0('0x9'));var jayson=require(_0xc2c0('0xa'));var client=jayson[_0xc2c0('0xb')][_0xc2c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36f5c1,_0x3be3db,_0x34973f){return new BPromise(function(_0x457c18,_0x1a3415){return client[_0xc2c0('0xd')](_0x36f5c1,_0x34973f)[_0xc2c0('0xe')](function(_0x4aa1fa){logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3be3db,_0xc2c0('0x11'));logger[_0xc2c0('0x12')](_0xc2c0('0x13'),_0x3be3db,_0xc2c0('0x11'),JSON[_0xc2c0('0x14')](_0x4aa1fa));if(_0x4aa1fa['error']){if(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x16')]===0x1f4){logger[_0xc2c0('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x3be3db,_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);return _0x1a3415(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);}logger[_0xc2c0('0x15')](_0xc2c0('0x10'),_0x3be3db,_0x4aa1fa['error']['message']);return _0x457c18(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);}else{logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3be3db,'request\x20sent');_0x457c18(_0x4aa1fa['result'][_0xc2c0('0x17')]);}})[_0xc2c0('0x18')](function(_0xa41c40){logger[_0xc2c0('0x15')](_0xc2c0('0x10'),_0x3be3db,_0xa41c40);_0x1a3415(_0xa41c40);});});}exports[_0xc2c0('0x19')]=function(_0x247c65){var _0x2f5633=this;return new Promise(function(_0x15c6a2,_0x349382){return db['VoiceTransferReport'][_0xc2c0('0x1a')](_0x247c65[_0xc2c0('0x1b')],{'raw':_0x247c65[_0xc2c0('0x1c')]?_0x247c65['options']['raw']===undefined?!![]:![]:!![]})[_0xc2c0('0xe')](function(_0x4cafb7){logger[_0xc2c0('0xf')](_0xc2c0('0x19'),_0x247c65);logger[_0xc2c0('0x12')](_0xc2c0('0x19'),_0x247c65,JSON[_0xc2c0('0x14')](_0x4cafb7));_0x15c6a2(_0x4cafb7);})[_0xc2c0('0x18')](function(_0x1c8971){logger['error']('CreateVoiceTransferReport',_0x1c8971[_0xc2c0('0x17')],_0x247c65);_0x349382(_0x2f5633['error'](0x1f4,_0x1c8971[_0xc2c0('0x17')]));});});}; \ No newline at end of file +var _0x124f=['error','code','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x548972,_0x2cf74f){var _0x36f359=function(_0x3180a1){while(--_0x3180a1){_0x548972['push'](_0x548972['shift']());}};_0x36f359(++_0x2cf74f);}(_0x124f,0xec));var _0xf124=function(_0x17708a,_0x3de0da){_0x17708a=_0x17708a-0x0;var _0x36ab54=_0x124f[_0x17708a];return _0x36ab54;};'use strict';var _=require(_0xf124('0x0'));var util=require(_0xf124('0x1'));var moment=require(_0xf124('0x2'));var BPromise=require(_0xf124('0x3'));var rs=require(_0xf124('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf124('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf124('0x6'))('rpc');var config=require(_0xf124('0x7'));var jayson=require(_0xf124('0x8'));var client=jayson[_0xf124('0x9')][_0xf124('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14620b,_0x286e1f,_0x1a5919){return new BPromise(function(_0x40d902,_0x5d1041){return client[_0xf124('0xb')](_0x14620b,_0x1a5919)['then'](function(_0x43238a){logger[_0xf124('0xc')](_0xf124('0xd'),_0x286e1f,_0xf124('0xe'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x286e1f,_0xf124('0xe'),JSON[_0xf124('0xf')](_0x43238a));if(_0x43238a[_0xf124('0x10')]){if(_0x43238a['error'][_0xf124('0x11')]===0x1f4){logger[_0xf124('0x10')](_0xf124('0xd'),_0x286e1f,_0x43238a['error'][_0xf124('0x12')]);return _0x5d1041(_0x43238a[_0xf124('0x10')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x286e1f,_0x43238a[_0xf124('0x10')]['message']);return _0x40d902(_0x43238a['error'][_0xf124('0x12')]);}else{logger[_0xf124('0xc')](_0xf124('0xd'),_0x286e1f,_0xf124('0xe'));_0x40d902(_0x43238a[_0xf124('0x13')][_0xf124('0x12')]);}})[_0xf124('0x14')](function(_0x4983af){logger['error'](_0xf124('0xd'),_0x286e1f,_0x4983af);_0x5d1041(_0x4983af);});});}exports[_0xf124('0x15')]=function(_0x244d15){var _0x8f3936=this;return new Promise(function(_0x242096,_0x2edd15){return db['VoiceTransferReport'][_0xf124('0x16')](_0x244d15[_0xf124('0x17')],{'raw':_0x244d15[_0xf124('0x18')]?_0x244d15[_0xf124('0x18')][_0xf124('0x19')]===undefined?!![]:![]:!![]})[_0xf124('0x1a')](function(_0x11ed90){logger[_0xf124('0xc')](_0xf124('0x15'),_0x244d15);logger[_0xf124('0x1b')](_0xf124('0x15'),_0x244d15,JSON['stringify'](_0x11ed90));_0x242096(_0x11ed90);})[_0xf124('0x14')](function(_0x87e30b){logger[_0xf124('0x10')](_0xf124('0x15'),_0x87e30b[_0xf124('0x12')],_0x244d15);_0x2edd15(_0x8f3936[_0xf124('0x10')](0x1f4,_0x87e30b[_0xf124('0x12')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 057cb64..d486c05 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf91e=['then','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','seedDB','default','catch','error','exit','lodash','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','sync','listen'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0xf91e,0x73));var _0xef91=function(_0x4cc821,_0x2815f6){_0x4cc821=_0x4cc821-0x0;var _0x1bff2e=_0xf91e[_0x4cc821];return _0x1bff2e;};'use strict';var _=require(_0xef91('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xef91('0x1'));var config=require('./config/environment');var logger=require(_0xef91('0x2'))(_0xef91('0x3'));var pm2=require(_0xef91('0x4'));var pm2Config=require(_0xef91('0x5'));var schedule=require(_0xef91('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xef91('0x7')][_0xef91('0x8')]()['then'](function(){return rpc[_0xef91('0x9')]();})[_0xef91('0xa')](function(_0xde9285){logger[_0xef91('0xb')](_0xde9285);return chat['start']();})[_0xef91('0xa')](function(){return schedule['start']();})['then'](function(_0x278a32){logger['info'](_0x278a32);return pm2[_0xef91('0xc')](pm2Config);})[_0xef91('0xa')](function(_0x2115b0){logger['info'](_0xef91('0xd'),_[_0xef91('0xe')](_[_0xef91('0xf')](_0x2115b0,{'status':_0xef91('0x10')}),_0xef91('0x11'))[_0xef91('0x12')]());logger[_0xef91('0xb')](_0xef91('0x13'),_[_0xef91('0xe')](_['filter'](_0x2115b0,function(_0x5752dd){return _0x5752dd['status']!==_0xef91('0x10');}),'name')[_0xef91('0x12')]()||'None');config[_0xef91('0x14')]&&require('./config/seedDB')[_0xef91('0x15')]();require('./config/license')[_0xef91('0x15')]();})[_0xef91('0x16')](function(_0x5b55ea){logger[_0xef91('0x17')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5b55ea);process[_0xef91('0x18')](0x1);});}main(); \ No newline at end of file +var _0xe281=['seedDB','default','./config/license','catch','error','exit','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','listen','info','then','start','map','name','join','Offline\x20apps:','filter','status','None'];(function(_0x5ca5a4,_0x30e6da){var _0x4c08b6=function(_0x12f0b7){while(--_0x12f0b7){_0x5ca5a4['push'](_0x5ca5a4['shift']());}};_0x4c08b6(++_0x30e6da);}(_0xe281,0x158));var _0x1e28=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe281[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x1e28('0x0'));var mysqldb=require(_0x1e28('0x1'));var rpc=require('./rpc');var config=require(_0x1e28('0x2'));var logger=require(_0x1e28('0x3'))(_0x1e28('0x4'));var pm2=require(_0x1e28('0x5'));var pm2Config=require(_0x1e28('0x6'));var schedule=require('./config/schedule');var chat=require(_0x1e28('0x7'));function main(){return mysqldb['db'][_0x1e28('0x8')]['sync']()['then'](function(){return rpc[_0x1e28('0x9')]();})['then'](function(_0x4268ab){logger[_0x1e28('0xa')](_0x4268ab);return chat['start']();})[_0x1e28('0xb')](function(){return schedule[_0x1e28('0xc')]();})[_0x1e28('0xb')](function(_0x5500d3){logger['info'](_0x5500d3);return pm2[_0x1e28('0xc')](pm2Config);})[_0x1e28('0xb')](function(_0x3031f5){logger[_0x1e28('0xa')]('Online\x20apps:',_[_0x1e28('0xd')](_['filter'](_0x3031f5,{'status':'online'}),_0x1e28('0xe'))[_0x1e28('0xf')]());logger['info'](_0x1e28('0x10'),_[_0x1e28('0xd')](_[_0x1e28('0x11')](_0x3031f5,function(_0x4ffb28){return _0x4ffb28[_0x1e28('0x12')]!=='online';}),'name')['join']()||_0x1e28('0x13'));config[_0x1e28('0x14')]&&require('./config/seedDB')[_0x1e28('0x15')]();require(_0x1e28('0x16'))['default']();})[_0x1e28('0x17')](function(_0x7bd710){logger[_0x1e28('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x7bd710);process[_0x1e28('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 54438c3..89a2732 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 _0xc965=['Unrecognized\x20API\x20access\x20key','then','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','canUpdate','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','Forbidden','cookie','motion.token','motion.user','stringify','pick','redirect','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','toString','hex','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','HS512','../../mysqldb','../../config/environment','lodash','express-jwt','crypto','ipaddr.js','role','fullname','name','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','status','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','json','query','apikey','verify','secrets','session','getUuid','sub','isEqual','nonce','user','log'];(function(_0x3b71b1,_0x2afeb3){var _0x52c4f3=function(_0x5cbfc8){while(--_0x5cbfc8){_0x3b71b1['push'](_0x3b71b1['shift']());}};_0x52c4f3(++_0x2afeb3);}(_0xc965,0x16f));var _0x5c96=function(_0x403ca4,_0x459190){_0x403ca4=_0x403ca4-0x0;var _0x4a5338=_0xc965[_0x403ca4];return _0x4a5338;};'use strict';var db=require(_0x5c96('0x0'))['db'];var config=require(_0x5c96('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0x5c96('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x5c96('0x3'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x5c96('0x4'));var ipaddr=require(_0x5c96('0x5'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x5c96('0x6'),_0x5c96('0x7'),_0x5c96('0x8'),'internal',_0x5c96('0x9'),_0x5c96('0xa'),_0x5c96('0xb'),_0x5c96('0xc'),_0x5c96('0xd'),_0x5c96('0xe'),_0x5c96('0xf'),_0x5c96('0x10'),'openchannelPause',_0x5c96('0x11'),_0x5c96('0x12'),'phoneBarRemoteControlPort','phoneBarRemoteControl',_0x5c96('0x13'),_0x5c96('0x14')];exports[_0x5c96('0x15')]=function(){return isAuthenticated(!![])[_0x5c96('0x16')](function(_0x5e7f83,_0x5a87e5,_0x5e3928){if(_0x5e7f83['user']){_0x5e3928();}else{return db[_0x5c96('0x17')][_0x5c96('0x18')]({'where':{'id':_0x5e7f83[_0x5c96('0x19')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x1e558f){if(_0x1e558f&&_0x1e558f['closed']){return _0x5a87e5[_0x5c96('0x1a')](_0x1e558f[_0x5c96('0x1b')]===_0x5c96('0x1c')?0x195:0x193)['json']({'message':_0x1e558f['disposition']==='unmanaged'?_0x5c96('0x1d'):_0x5c96('0x1e')});}else{_0x5e3928();}})[_0x5c96('0x1f')](function(_0x171080){_0x5e3928(_0x171080);});}});};function isAuthenticated(_0x412679){return compose()['use'](function(_0xb2967a,_0x3013f6,_0x842091){if(_0xb2967a[_0x5c96('0x20')][_0x5c96('0x21')]){if(_[_0x5c96('0x22')](_0xb2967a['headers'][_0x5c96('0x21')],'Basic')){var _0x165b20=basicAuth(_0xb2967a);db[_0x5c96('0x23')][_0x5c96('0x24')]({'where':{'name':_0x165b20['name']}})['then'](function(_0x5190a2){if(!_0x5190a2||!_0x5190a2[_0x5c96('0x25')](_0x165b20[_0x5c96('0x26')])){return _0x3013f6[_0x5c96('0x1a')](0x191)['json']({'message':_0x5c96('0x27')});}_0xb2967a['user']={'id':_0x5190a2['id']};_0x842091();})[_0x5c96('0x1f')](function(_0x346d9a){_0x842091(_0x346d9a);});}else if(_[_0x5c96('0x22')](_0xb2967a[_0x5c96('0x20')][_0x5c96('0x21')],_0x5c96('0x28'))){validateJwt(_0xb2967a,_0x3013f6,_0x842091);}else{if(_0x412679){_0x842091();}else{return _0x3013f6[_0x5c96('0x1a')](0x193)[_0x5c96('0x29')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb2967a[_0x5c96('0x2a')][_0x5c96('0x2b')]){try{var _0x452f0d=jwt[_0x5c96('0x2c')](_0xb2967a[_0x5c96('0x2a')][_0x5c96('0x2b')],config[_0x5c96('0x2d')][_0x5c96('0x2e')],{'audience':hardwareConf[_0x5c96('0x2f')](),'issuer':hardwareConf['getUuid']()});db['User']['find']({'where':{'id':_0x452f0d[_0x5c96('0x30')]}})['then'](function(_0xf0b9e6){if(!_0xf0b9e6||!_[_0x5c96('0x31')](_0xf0b9e6['apiKeyNonce'],_0x452f0d[_0x5c96('0x32')])){return _0x3013f6[_0x5c96('0x1a')](0x193)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0xb2967a[_0x5c96('0x33')]={'id':_0xf0b9e6['id']};_0x842091();})['catch'](function(_0x5605d8){_0x842091(_0x5605d8);});}catch(_0x34b2a3){console[_0x5c96('0x34')](_0x34b2a3);return _0x3013f6[_0x5c96('0x1a')](0x193)[_0x5c96('0x29')]({'message':_0x5c96('0x35')});}}else if(_0x412679){_0x842091();}else{return _0x3013f6[_0x5c96('0x1a')](0x193)[_0x5c96('0x29')]({'message':'Unknown\x20authorization\x20format'});}})[_0x5c96('0x16')](function(_0x1ccb20,_0x59503a,_0x432cf3){if(_0x1ccb20[_0x5c96('0x33')]){db['User']['find']({'where':{'id':_0x1ccb20[_0x5c96('0x33')]['id']},'attributes':userAttributes})[_0x5c96('0x36')](function(_0x5e2255){if(!_0x5e2255){return _0x59503a[_0x5c96('0x1a')](0x194)['json']({'message':_0x5c96('0x37')});}_0x1ccb20[_0x5c96('0x33')]=_0x5e2255;_0x432cf3();})[_0x5c96('0x1f')](function(_0x1355bb){_0x432cf3(_0x1355bb);});}else if(_0x412679){_0x432cf3();}else{return _0x59503a[_0x5c96('0x1a')](0x194)[_0x5c96('0x29')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0x5c96('0x38')]=isAuthenticated;function canUpdate(){return compose()[_0x5c96('0x16')](function(_0x2aa197,_0x1ba063,_0x1e0520){return require(_0x5c96('0x39'))[_0x5c96('0x3a')]()[_0x5c96('0x36')](function(_0x53dc48){if(_0x53dc48[_0x5c96('0x3b')]){_0x1e0520();}else{return _0x1ba063['status'](0x193)[_0x5c96('0x29')]({'message':'Forbidden'});}})[_0x5c96('0x1f')](function(_0x49e350){_0x1e0520(_0x49e350);});});}exports[_0x5c96('0x3c')]=canUpdate;function signToken(_0xf681a,_0x12b55b){return jwt['sign']({'id':_0xf681a,'role':_0x12b55b},config[_0x5c96('0x2d')][_0x5c96('0x2e')],{'expiresIn':0x15180});}exports[_0x5c96('0x3d')]=signToken;exports[_0x5c96('0x3e')]=function(_0x310dd0){if(!_0x310dd0){throw new Error(_0x5c96('0x3f'));}return compose()[_0x5c96('0x16')](isAuthenticated())[_0x5c96('0x16')](function meetsRequirements(_0x20d9f3,_0x4b1f08,_0x2917b5){if(config[_0x5c96('0x40')]['indexOf'](_0x20d9f3[_0x5c96('0x33')][_0x5c96('0x6')])>=config[_0x5c96('0x40')][_0x5c96('0x41')](_0x310dd0)){return _0x2917b5();}else{return _0x4b1f08['status'](0x193)['json']({'message':_0x5c96('0x42')});}});};exports['setTokenCookie']=function(_0xa6450,_0x376333){if(!_0xa6450[_0x5c96('0x33')]){return _0x376333[_0x5c96('0x1a')](0x194)[_0x5c96('0x29')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x30ca97=signToken(_0xa6450[_0x5c96('0x33')]['id'],_0xa6450['user'][_0x5c96('0x6')]);_0x376333[_0x5c96('0x43')](_0x5c96('0x44'),_0x30ca97);_0x376333[_0x5c96('0x43')](_0x5c96('0x45'),JSON[_0x5c96('0x46')](_[_0x5c96('0x47')](_0xa6450[_0x5c96('0x33')],userAttributes)));_0x376333[_0x5c96('0x48')]('/dashboards/general');};exports[_0x5c96('0x49')]=function(_0x1566dc){if(_['isNil'](_0x1566dc[_0x5c96('0x4a')])||_[_0x5c96('0x4b')](_0x1566dc[_0x5c96('0x4c')]))return null;else return createJwt(_0x1566dc);};exports['generateApiKey']=function(_0x15b679){_0x15b679[_0x5c96('0x4a')]=crypto['randomBytes'](0x10)[_0x5c96('0x4d')](_0x5c96('0x4e'));_0x15b679[_0x5c96('0x4c')]=Math['floor'](Date[_0x5c96('0x4f')]()/0x3e8)['toString']();return createJwt(_0x15b679);};exports[_0x5c96('0x50')]=function(_0x28f790,_0x5758f5){if(_0x28f790['query'][_0x5c96('0x2b')]){jwt[_0x5c96('0x2c')](_0x28f790[_0x5c96('0x2a')][_0x5c96('0x2b')],config['secrets'][_0x5c96('0x2e')],{'nonce':_0x5758f5[_0x5c96('0x4a')],'iat':_0x5758f5[_0x5c96('0x4c')],'audience':hardwareConf[_0x5c96('0x2f')](),'issuer':hardwareConf[_0x5c96('0x2f')]()});return generateApiKey(_0x5758f5);}else{throw{'message':_0x5c96('0x51')};}};function createJwt(_0x35b853){return jwt[_0x5c96('0x52')]({'iat':_0x35b853[_0x5c96('0x4c')],'nonce':_0x35b853['apiKeyNonce']},config[_0x5c96('0x2d')][_0x5c96('0x2e')],{'algorithm':_0x5c96('0x53'),'subject':_0x35b853['id'][_0x5c96('0x4d')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x5c96('0x2f')]()});} \ No newline at end of file +var _0xddb8=['catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Bearer','verify','query','apikey','session','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','signToken','Required\x20role\x20needs\x20to\x20be\x20set','role','indexOf','setTokenCookie','cookie','motion.user','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','randomBytes','floor','now','toString','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','ipaddr.js','secrets','name','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','phoneBarRemoteControl','userProfileId','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','status','unmanaged','json','Forbidden.'];(function(_0x4f9a35,_0x31ea11){var _0x27b6a7=function(_0x274650){while(--_0x274650){_0x4f9a35['push'](_0x4f9a35['shift']());}};_0x27b6a7(++_0x31ea11);}(_0xddb8,0x1c7));var _0x8ddb=function(_0x52ae41,_0x49d19e){_0x52ae41=_0x52ae41-0x0;var _0x1ab8a8=_0xddb8[_0x52ae41];return _0x1ab8a8;};'use strict';var db=require(_0x8ddb('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x8ddb('0x1'));var _=require(_0x8ddb('0x2'));var jwt=require(_0x8ddb('0x3'));var expressJwt=require(_0x8ddb('0x4'));var compose=require(_0x8ddb('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x8ddb('0x6'));var ipaddr=require(_0x8ddb('0x7'));var validateJwt=expressJwt({'secret':config[_0x8ddb('0x8')]['session']});var userAttributes=['id','role','fullname',_0x8ddb('0x9'),'internal','email','userpic',_0x8ddb('0xa'),_0x8ddb('0xb'),_0x8ddb('0xc'),_0x8ddb('0xd'),_0x8ddb('0xe'),_0x8ddb('0xf'),_0x8ddb('0x10'),'pauseType','showWebBar','phoneBarRemoteControlPort',_0x8ddb('0x11'),'interface',_0x8ddb('0x12')];exports[_0x8ddb('0x13')]=function(){return isAuthenticated(!![])[_0x8ddb('0x14')](function(_0x59acf0,_0x29daa1,_0x58f808){if(_0x59acf0[_0x8ddb('0x15')]){_0x58f808();}else{return db['ChatInteraction'][_0x8ddb('0x16')]({'where':{'id':_0x59acf0[_0x8ddb('0x17')]['id']},'attributes':['id','closed',_0x8ddb('0x18')],'raw':!![]})[_0x8ddb('0x19')](function(_0x4e5714){if(_0x4e5714&&_0x4e5714[_0x8ddb('0x1a')]){return _0x29daa1[_0x8ddb('0x1b')](_0x4e5714[_0x8ddb('0x18')]===_0x8ddb('0x1c')?0x195:0x193)[_0x8ddb('0x1d')]({'message':_0x4e5714[_0x8ddb('0x18')]===_0x8ddb('0x1c')?'Unmanaged.':_0x8ddb('0x1e')});}else{_0x58f808();}})[_0x8ddb('0x1f')](function(_0x4bf1f5){_0x58f808(_0x4bf1f5);});}});};function isAuthenticated(_0x5dff9b){return compose()['use'](function(_0x2ea5a2,_0xb11592,_0x44ab39){if(_0x2ea5a2[_0x8ddb('0x20')][_0x8ddb('0x21')]){if(_[_0x8ddb('0x22')](_0x2ea5a2['headers'][_0x8ddb('0x21')],_0x8ddb('0x23'))){var _0x349f7b=basicAuth(_0x2ea5a2);db[_0x8ddb('0x24')][_0x8ddb('0x25')]({'where':{'name':_0x349f7b['name']}})[_0x8ddb('0x19')](function(_0xb0016){if(!_0xb0016||!_0xb0016[_0x8ddb('0x26')](_0x349f7b[_0x8ddb('0x27')])){return _0xb11592[_0x8ddb('0x1b')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x2ea5a2[_0x8ddb('0x15')]={'id':_0xb0016['id']};_0x44ab39();})[_0x8ddb('0x1f')](function(_0x362f52){_0x44ab39(_0x362f52);});}else if(_[_0x8ddb('0x22')](_0x2ea5a2[_0x8ddb('0x20')][_0x8ddb('0x21')],_0x8ddb('0x28'))){validateJwt(_0x2ea5a2,_0xb11592,_0x44ab39);}else{if(_0x5dff9b){_0x44ab39();}else{return _0xb11592[_0x8ddb('0x1b')](0x193)[_0x8ddb('0x1d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x2ea5a2['query']['apikey']){try{var _0x178c82=jwt[_0x8ddb('0x29')](_0x2ea5a2[_0x8ddb('0x2a')][_0x8ddb('0x2b')],config[_0x8ddb('0x8')][_0x8ddb('0x2c')],{'audience':hardwareConf[_0x8ddb('0x2d')](),'issuer':hardwareConf[_0x8ddb('0x2d')]()});db[_0x8ddb('0x24')][_0x8ddb('0x25')]({'where':{'id':_0x178c82[_0x8ddb('0x2e')]}})['then'](function(_0x4fe0d0){if(!_0x4fe0d0||!_[_0x8ddb('0x2f')](_0x4fe0d0[_0x8ddb('0x30')],_0x178c82[_0x8ddb('0x31')])){return _0xb11592[_0x8ddb('0x1b')](0x193)[_0x8ddb('0x1d')]({'message':_0x8ddb('0x32')});}_0x2ea5a2['user']={'id':_0x4fe0d0['id']};_0x44ab39();})['catch'](function(_0x2d7be7){_0x44ab39(_0x2d7be7);});}catch(_0x28a270){console[_0x8ddb('0x33')](_0x28a270);return _0xb11592[_0x8ddb('0x1b')](0x193)[_0x8ddb('0x1d')]({'message':_0x8ddb('0x34')});}}else if(_0x5dff9b){_0x44ab39();}else{return _0xb11592[_0x8ddb('0x1b')](0x193)[_0x8ddb('0x1d')]({'message':_0x8ddb('0x35')});}})[_0x8ddb('0x14')](function(_0x73dc40,_0x239d53,_0x5c94ee){if(_0x73dc40['user']){db[_0x8ddb('0x24')]['find']({'where':{'id':_0x73dc40['user']['id']},'attributes':userAttributes})['then'](function(_0x374e6b){if(!_0x374e6b){return _0x239d53[_0x8ddb('0x1b')](0x194)['json']({'message':_0x8ddb('0x36')});}_0x73dc40[_0x8ddb('0x15')]=_0x374e6b;_0x5c94ee();})[_0x8ddb('0x1f')](function(_0xa50948){_0x5c94ee(_0xa50948);});}else if(_0x5dff9b){_0x5c94ee();}else{return _0x239d53[_0x8ddb('0x1b')](0x194)[_0x8ddb('0x1d')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0x8ddb('0x37')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x5664a7,_0x358dd9,_0x1593d4){return require(_0x8ddb('0x38'))[_0x8ddb('0x39')]()[_0x8ddb('0x19')](function(_0x4ecd1e){if(_0x4ecd1e[_0x8ddb('0x3a')]){_0x1593d4();}else{return _0x358dd9[_0x8ddb('0x1b')](0x193)[_0x8ddb('0x1d')]({'message':_0x8ddb('0x3b')});}})[_0x8ddb('0x1f')](function(_0x4387e3){_0x1593d4(_0x4387e3);});});}exports[_0x8ddb('0x3c')]=canUpdate;function signToken(_0x650eb0,_0x35a34f){return jwt['sign']({'id':_0x650eb0,'role':_0x35a34f},config['secrets'][_0x8ddb('0x2c')],{'expiresIn':0x15180});}exports[_0x8ddb('0x3d')]=signToken;exports['hasRole']=function(_0xc8ecca){if(!_0xc8ecca){throw new Error(_0x8ddb('0x3e'));}return compose()[_0x8ddb('0x14')](isAuthenticated())[_0x8ddb('0x14')](function meetsRequirements(_0x44cfa8,_0x1d3a08,_0x5b99b1){if(config['userRoles']['indexOf'](_0x44cfa8['user'][_0x8ddb('0x3f')])>=config['userRoles'][_0x8ddb('0x40')](_0xc8ecca)){return _0x5b99b1();}else{return _0x1d3a08['status'](0x193)[_0x8ddb('0x1d')]({'message':_0x8ddb('0x3b')});}});};exports[_0x8ddb('0x41')]=function(_0x99466b,_0x1d6df6){if(!_0x99466b['user']){return _0x1d6df6['status'](0x194)[_0x8ddb('0x1d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0xa2d0c2=signToken(_0x99466b[_0x8ddb('0x15')]['id'],_0x99466b[_0x8ddb('0x15')][_0x8ddb('0x3f')]);_0x1d6df6['cookie']('motion.token',_0xa2d0c2);_0x1d6df6[_0x8ddb('0x42')](_0x8ddb('0x43'),JSON['stringify'](_[_0x8ddb('0x44')](_0x99466b['user'],userAttributes)));_0x1d6df6[_0x8ddb('0x45')](_0x8ddb('0x46'));};exports[_0x8ddb('0x47')]=function(_0x4991f1){if(_[_0x8ddb('0x48')](_0x4991f1[_0x8ddb('0x30')])||_[_0x8ddb('0x48')](_0x4991f1[_0x8ddb('0x49')]))return null;else return createJwt(_0x4991f1);};exports['generateApiKey']=function(_0x56e107){_0x56e107[_0x8ddb('0x30')]=crypto[_0x8ddb('0x4a')](0x10)['toString']('hex');_0x56e107[_0x8ddb('0x49')]=Math[_0x8ddb('0x4b')](Date[_0x8ddb('0x4c')]()/0x3e8)[_0x8ddb('0x4d')]();return createJwt(_0x56e107);};exports[_0x8ddb('0x4e')]=function(_0x340416,_0x5e71ad){if(_0x340416[_0x8ddb('0x2a')]['apikey']){jwt[_0x8ddb('0x29')](_0x340416[_0x8ddb('0x2a')]['apikey'],config['secrets'][_0x8ddb('0x2c')],{'nonce':_0x5e71ad['apiKeyNonce'],'iat':_0x5e71ad[_0x8ddb('0x49')],'audience':hardwareConf[_0x8ddb('0x2d')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x5e71ad);}else{throw{'message':_0x8ddb('0x4f')};}};function createJwt(_0x5e7eb3){return jwt[_0x8ddb('0x50')]({'iat':_0x5e7eb3[_0x8ddb('0x49')],'nonce':_0x5e7eb3['apiKeyNonce']},config[_0x8ddb('0x8')][_0x8ddb('0x2c')],{'algorithm':'HS512','subject':_0x5e7eb3['id']['toString'](),'issuer':hardwareConf[_0x8ddb('0x2d')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 482fef0..fa1f464 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 _0x8861=['createWriteStream','createDecipher','algorithm','unlink','crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','update','binary','write','end','final','close','decryptFile'];(function(_0x1583a0,_0x902eb2){var _0x33df74=function(_0x1ac04b){while(--_0x1ac04b){_0x1583a0['push'](_0x1583a0['shift']());}};_0x33df74(++_0x902eb2);}(_0x8861,0x125));var _0x1886=function(_0x1ea67e,_0x2f43c5){_0x1ea67e=_0x1ea67e-0x0;var _0x1d05fa=_0x8861[_0x1ea67e];return _0x1d05fa;};'use strict';var crypto=require(_0x1886('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x1886('0x1')};function combineOptions(_0x454ece){var _0x223091={};for(var _0x2097e2 in defaultOptions){if(defaultOptions[_0x1886('0x2')](_0x2097e2)){_0x223091[_0x2097e2]=defaultOptions[_0x2097e2];}}if(_0x454ece){for(var _0x4ab24f in _0x454ece){if(_0x454ece[_0x1886('0x2')](_0x4ab24f)){_0x223091[_0x4ab24f]=_0x454ece[_0x4ab24f];}}}return _0x223091;}exports[_0x1886('0x3')]=function(_0xcc2bd,_0x15ae73,_0x1de2ba,_0x417a68){return new BPromise(function(_0x31f72f,_0x1e7188){_0x417a68=combineOptions(_0x417a68);var _0x245e33=new Buffer(_0x1de2ba);var _0x59c3f4=fs[_0x1886('0x4')](_0xcc2bd);var _0x2f5076=fs['createWriteStream'](_0x15ae73);var _0xb747f0=crypto[_0x1886('0x5')](_0x417a68['algorithm'],_0x245e33);_0x59c3f4['on']('data',function(_0x7234fc){var _0xc19b32=new Buffer(_0xb747f0[_0x1886('0x6')](_0x7234fc),_0x1886('0x7'));_0x2f5076[_0x1886('0x8')](_0xc19b32);});_0x59c3f4['on'](_0x1886('0x9'),function(){try{var _0x16a53e=new Buffer(_0xb747f0[_0x1886('0xa')](_0x1886('0x7')),_0x1886('0x7'));_0x2f5076[_0x1886('0x8')](_0x16a53e);_0x2f5076[_0x1886('0x9')]();_0x2f5076['on'](_0x1886('0xb'),function(){return _0x31f72f(_0x15ae73);});}catch(_0x102807){fs['unlink'](_0x15ae73);return _0x1e7188(_0x102807);}});});};exports[_0x1886('0xc')]=function(_0x5f3312,_0x497088,_0x2105f0,_0x5a4528){return new BPromise(function(_0x355b3b,_0x4f1ab6){_0x5a4528=combineOptions(_0x5a4528);var _0x2259ff=new Buffer(_0x2105f0);var _0x25913e=fs[_0x1886('0x4')](_0x5f3312);var _0xe33a50=fs[_0x1886('0xd')](_0x497088);var _0x4efb47=crypto[_0x1886('0xe')](_0x5a4528[_0x1886('0xf')],_0x2259ff);_0x25913e['on']('data',function(_0x33817a){var _0xe58b5c=new Buffer(_0x4efb47[_0x1886('0x6')](_0x33817a),_0x1886('0x7'));_0xe33a50[_0x1886('0x8')](_0xe58b5c);});_0x25913e['on'](_0x1886('0x9'),function(){try{var _0x222e1a=new Buffer(_0x4efb47['final'](_0x1886('0x7')),_0x1886('0x7'));_0xe33a50[_0x1886('0x8')](_0x222e1a);_0xe33a50[_0x1886('0x9')]();_0xe33a50['on'](_0x1886('0xb'),function(){return _0x355b3b(_0x497088);});}catch(_0x475555){fs[_0x1886('0x10')](_0x497088);return _0x4f1ab6(_0x475555);}});});}; \ No newline at end of file +var _0x6d2e=['crypto','bluebird','aes192','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','final','end','close','unlink','createDecipher','data'];(function(_0x10e3f7,_0x353b97){var _0x3ee398=function(_0x16d5ce){while(--_0x16d5ce){_0x10e3f7['push'](_0x10e3f7['shift']());}};_0x3ee398(++_0x353b97);}(_0x6d2e,0x132));var _0xe6d2=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x6d2e[_0xa6cb09];return _0x12b437;};'use strict';var crypto=require(_0xe6d2('0x0'));var fs=require('fs');var BPromise=require(_0xe6d2('0x1'));var defaultOptions={'algorithm':_0xe6d2('0x2')};function combineOptions(_0x1804ab){var _0x12e10e={};for(var _0xf20e83 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0xf20e83)){_0x12e10e[_0xf20e83]=defaultOptions[_0xf20e83];}}if(_0x1804ab){for(var _0x55e2dd in _0x1804ab){if(_0x1804ab['hasOwnProperty'](_0x55e2dd)){_0x12e10e[_0x55e2dd]=_0x1804ab[_0x55e2dd];}}}return _0x12e10e;}exports[_0xe6d2('0x3')]=function(_0x18bffe,_0x45f8ee,_0x3d8170,_0x2feffd){return new BPromise(function(_0x22f258,_0x3adca6){_0x2feffd=combineOptions(_0x2feffd);var _0x29433a=new Buffer(_0x3d8170);var _0x4cf195=fs[_0xe6d2('0x4')](_0x18bffe);var _0x1bb123=fs[_0xe6d2('0x5')](_0x45f8ee);var _0x169818=crypto[_0xe6d2('0x6')](_0x2feffd[_0xe6d2('0x7')],_0x29433a);_0x4cf195['on']('data',function(_0x30dddd){var _0xdf5c0d=new Buffer(_0x169818[_0xe6d2('0x8')](_0x30dddd),_0xe6d2('0x9'));_0x1bb123[_0xe6d2('0xa')](_0xdf5c0d);});_0x4cf195['on']('end',function(){try{var _0x3b4e38=new Buffer(_0x169818[_0xe6d2('0xb')]('binary'),_0xe6d2('0x9'));_0x1bb123[_0xe6d2('0xa')](_0x3b4e38);_0x1bb123[_0xe6d2('0xc')]();_0x1bb123['on'](_0xe6d2('0xd'),function(){return _0x22f258(_0x45f8ee);});}catch(_0x2a03f3){fs[_0xe6d2('0xe')](_0x45f8ee);return _0x3adca6(_0x2a03f3);}});});};exports['decryptFile']=function(_0x1b1755,_0xf68ae0,_0x2650ca,_0x1d403b){return new BPromise(function(_0xec8976,_0x2d0e9c){_0x1d403b=combineOptions(_0x1d403b);var _0x40ff14=new Buffer(_0x2650ca);var _0x2c119b=fs[_0xe6d2('0x4')](_0x1b1755);var _0x4c06a6=fs[_0xe6d2('0x5')](_0xf68ae0);var _0x57e232=crypto[_0xe6d2('0xf')](_0x1d403b[_0xe6d2('0x7')],_0x40ff14);_0x2c119b['on'](_0xe6d2('0x10'),function(_0x5b6c47){var _0x457fc0=new Buffer(_0x57e232[_0xe6d2('0x8')](_0x5b6c47),_0xe6d2('0x9'));_0x4c06a6[_0xe6d2('0xa')](_0x457fc0);});_0x2c119b['on'](_0xe6d2('0xc'),function(){try{var _0x47ef65=new Buffer(_0x57e232[_0xe6d2('0xb')]('binary'),_0xe6d2('0x9'));_0x4c06a6['write'](_0x47ef65);_0x4c06a6[_0xe6d2('0xc')]();_0x4c06a6['on'](_0xe6d2('0xd'),function(){return _0xec8976(_0xf68ae0);});}catch(_0x16837c){fs[_0xe6d2('0xe')](_0xf68ae0);return _0x2d0e9c(_0x16837c);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 17e5f5b..c526e56 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 _0x9d24=['num','Empty','length','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9d24,0x197));var _0x49d2=function(_0x1f4e66,_0x4d06f7){_0x1f4e66=_0x1f4e66-0x0;var _0x2b3411=_0x9d24[_0x1f4e66];return _0x2b3411;};'use strict';var util=require(_0x49d2('0x0'));var path=require(_0x49d2('0x1'));var _=require(_0x49d2('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x49d2('0x3'));var rimraf=require(_0x49d2('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x49d2('0x5'))['dbH'];var logger=require('../../config/logger')(_0x49d2('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x49d2('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x31f566,_0x3c7952){var _0x21dc9d={'status':_0x31f566};var _0x38ab50={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c7952){_0x21dc9d[_0x49d2('0x8')]=_0x3c7952;}return db[_0x49d2('0x9')][_0x49d2('0xa')](_0x21dc9d,_0x38ab50);}function main(){var _0xc964c5=0x1388;var _0x469bbb;logger[_0x49d2('0xb')](util[_0x49d2('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x49d2('0xd')));return db[_0x49d2('0xe')][_0x49d2('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x49d2('0x10'),_0x49d2('0x11')]})['then'](function(_0xfa24cd){if(_0xfa24cd){_0x469bbb=_0xfa24cd;_0xc964c5=_0x469bbb[_0x49d2('0x11')]||0x1388;}})[_0x49d2('0x12')](function(){return dbH['sequelize'][_0x49d2('0x13')](util[_0x49d2('0xc')](_0x49d2('0x14'),QUERY),{'type':dbH['sequelize'][_0x49d2('0x15')][_0x49d2('0x16')]});})[_0x49d2('0x12')](function(_0x3c6adb){if(!_0x3c6adb[0x0][_0x49d2('0x17')]){return analyticExtractedReport(_0x49d2('0x18'));}var _0x1518af=[];var _0x328ab2=0x0;var _0x2043cc=!![];if(_0x3c6adb&&_0x3c6adb[_0x49d2('0x19')]){var _0x530809=_0x3c6adb[0x0][_0x49d2('0x17')]%(_0x328ab2+_0xc964c5);if(_0x469bbb[_0x49d2('0x10')]){for(;_0x2043cc;_0x328ab2+=_0xc964c5,_0x530809=_0x3c6adb[0x0][_0x49d2('0x17')]%(_0x328ab2+_0xc964c5)){if(_0x530809==0x0||_0x530809==_0x3c6adb[0x0][_0x49d2('0x17')]){_0x2043cc=![];}_0x1518af[_0x49d2('0x1a')](dbH[_0x49d2('0x1b')]['query'](util[_0x49d2('0xc')](_0x49d2('0x1c'),QUERY,_0xc964c5,_0x328ab2),{'type':dbH['sequelize']['QueryTypes'][_0x49d2('0x16')]}));}}else{_0x1518af[_0x49d2('0x1a')](dbH[_0x49d2('0x1b')][_0x49d2('0x13')](QUERY,{'type':dbH[_0x49d2('0x1b')][_0x49d2('0x15')][_0x49d2('0x16')]}));}}var _0x1ce814=path[_0x49d2('0x1d')](PATH);var _0x37fbd9=path['basename'](PATH,_0x49d2('0x1e'));var _0x417cb2=_0x469bbb[_0x49d2('0x10')]&&_0x1518af[_0x49d2('0x19')]>0x1;var _0x289a8f=[];if(!fs[_0x49d2('0x1f')](path[_0x49d2('0x20')](_0x1ce814,_0x37fbd9))&&_0x417cb2){fs['mkdirSync'](path[_0x49d2('0x20')](_0x1ce814,_0x37fbd9));}return BPromise[_0x49d2('0x21')](_0x1518af,function(_0x7e06d4){_0x289a8f[_0x49d2('0x1a')](_0x7e06d4);})['then'](function(){for(var _0x1fc932=0x0;_0x1fc932<_0x289a8f[_0x49d2('0x19')];_0x1fc932+=0x1){var _0x2c1739;var _0x107991=_0x289a8f[_0x1fc932];if(_0x417cb2){_0x2c1739=path[_0x49d2('0x20')](_0x1ce814,_0x37fbd9,util['format'](_0x49d2('0x22'),_0x37fbd9,_0x1fc932,_0x49d2('0x23')));}else{_0x2c1739=path[_0x49d2('0x20')](_0x1ce814,util[_0x49d2('0xc')](_0x49d2('0x24'),_0x37fbd9,_0x49d2('0x23')));}fs['writeFileSync'](_0x2c1739,csv(_0x107991));}})[_0x49d2('0x12')](function(){if(_0x417cb2){zipdir(path[_0x49d2('0x20')](_0x1ce814,_0x37fbd9),{'saveTo':path[_0x49d2('0x20')](_0x1ce814,util[_0x49d2('0xc')](_0x49d2('0x24'),_0x37fbd9,_0x49d2('0x25')))},function(_0x5b3bd4,_0x26f458){});rimraf(path[_0x49d2('0x20')](_0x1ce814,_0x37fbd9),function(){});}})[_0x49d2('0x12')](function(){logger[_0x49d2('0xb')](util[_0x49d2('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x49d2('0xd')));return analyticExtractedReport(_0x49d2('0x26'),_0x417cb2?util['format'](_0x49d2('0x24'),_0x37fbd9,_0x417cb2?_0x49d2('0x25'):_0x49d2('0x23')):null);});})[_0x49d2('0x27')](function(_0x1bfb82){logger['info'](util[_0x49d2('0xc')](_0x49d2('0x28'),EXTRACTED_REPORT_ID,'CSV'),util[_0x49d2('0x29')](_0x1bfb82,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x49d2('0x2a'));});}main(); \ No newline at end of file +var _0x69bc=['dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push'];(function(_0x517734,_0x43e4de){var _0x523b56=function(_0x5a8b91){while(--_0x5a8b91){_0x517734['push'](_0x517734['shift']());}};_0x523b56(++_0x43e4de);}(_0x69bc,0x11d));var _0xc69b=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x69bc[_0x16d10f];return _0x50c823;};'use strict';var util=require(_0xc69b('0x0'));var path=require('path');var _=require(_0xc69b('0x1'));var csv=require(_0xc69b('0x2'));var fs=require('fs');var BPromise=require(_0xc69b('0x3'));var zipdir=require(_0xc69b('0x4'));var rimraf=require('rimraf');var db=require(_0xc69b('0x5'))['db'];var dbH=require(_0xc69b('0x5'))[_0xc69b('0x6')];var logger=require('../../config/logger')(_0xc69b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xc69b('0x8')][0x2]);var QUERY=process[_0xc69b('0x8')][0x3];var PATH=process[_0xc69b('0x8')][0x4];function analyticExtractedReport(_0x1b374b,_0x7a1568){var _0x218895={'status':_0x1b374b};var _0x397417={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x7a1568){_0x218895[_0xc69b('0x9')]=_0x7a1568;}return db['AnalyticExtractedReport'][_0xc69b('0xa')](_0x218895,_0x397417);}function main(){var _0x28466e=0x1388;var _0xa70868;logger[_0xc69b('0xb')](util[_0xc69b('0xc')](_0xc69b('0xd'),EXTRACTED_REPORT_ID,_0xc69b('0xe')));return db[_0xc69b('0xf')][_0xc69b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc69b('0x11'),_0xc69b('0x12')]})[_0xc69b('0x13')](function(_0x171300){if(_0x171300){_0xa70868=_0x171300;_0x28466e=_0xa70868[_0xc69b('0x12')]||0x1388;}})[_0xc69b('0x13')](function(){return dbH[_0xc69b('0x14')][_0xc69b('0x15')](util[_0xc69b('0xc')](_0xc69b('0x16'),QUERY),{'type':dbH[_0xc69b('0x14')]['QueryTypes'][_0xc69b('0x17')]});})['then'](function(_0x21bd9d){if(!_0x21bd9d[0x0][_0xc69b('0x18')]){return analyticExtractedReport(_0xc69b('0x19'));}var _0xe30df0=[];var _0x40919a=0x0;var _0x479f93=!![];if(_0x21bd9d&&_0x21bd9d[_0xc69b('0x1a')]){var _0x2ec5a0=_0x21bd9d[0x0]['num']%(_0x40919a+_0x28466e);if(_0xa70868[_0xc69b('0x11')]){for(;_0x479f93;_0x40919a+=_0x28466e,_0x2ec5a0=_0x21bd9d[0x0][_0xc69b('0x18')]%(_0x40919a+_0x28466e)){if(_0x2ec5a0==0x0||_0x2ec5a0==_0x21bd9d[0x0][_0xc69b('0x18')]){_0x479f93=![];}_0xe30df0['push'](dbH[_0xc69b('0x14')][_0xc69b('0x15')](util['format'](_0xc69b('0x1b'),QUERY,_0x28466e,_0x40919a),{'type':dbH[_0xc69b('0x14')][_0xc69b('0x1c')][_0xc69b('0x17')]}));}}else{_0xe30df0[_0xc69b('0x1d')](dbH[_0xc69b('0x14')][_0xc69b('0x15')](QUERY,{'type':dbH[_0xc69b('0x14')][_0xc69b('0x1c')][_0xc69b('0x17')]}));}}var _0x344480=path[_0xc69b('0x1e')](PATH);var _0x5e8f6d=path[_0xc69b('0x1f')](PATH,_0xc69b('0x20'));var _0x3a5ac9=_0xa70868[_0xc69b('0x11')]&&_0xe30df0['length']>0x1;var _0x20f752=[];if(!fs[_0xc69b('0x21')](path[_0xc69b('0x22')](_0x344480,_0x5e8f6d))&&_0x3a5ac9){fs[_0xc69b('0x23')](path[_0xc69b('0x22')](_0x344480,_0x5e8f6d));}return BPromise[_0xc69b('0x24')](_0xe30df0,function(_0x18ded7){_0x20f752[_0xc69b('0x1d')](_0x18ded7);})[_0xc69b('0x13')](function(){for(var _0xdcf613=0x0;_0xdcf613<_0x20f752[_0xc69b('0x1a')];_0xdcf613+=0x1){var _0x129496;var _0x5f1acb=_0x20f752[_0xdcf613];if(_0x3a5ac9){_0x129496=path[_0xc69b('0x22')](_0x344480,_0x5e8f6d,util[_0xc69b('0xc')](_0xc69b('0x25'),_0x5e8f6d,_0xdcf613,_0xc69b('0x26')));}else{_0x129496=path[_0xc69b('0x22')](_0x344480,util[_0xc69b('0xc')](_0xc69b('0x27'),_0x5e8f6d,_0xc69b('0x26')));}fs[_0xc69b('0x28')](_0x129496,csv(_0x5f1acb));}})[_0xc69b('0x13')](function(){if(_0x3a5ac9){zipdir(path[_0xc69b('0x22')](_0x344480,_0x5e8f6d),{'saveTo':path['join'](_0x344480,util['format'](_0xc69b('0x27'),_0x5e8f6d,'zip'))},function(_0x25b09c,_0x36804b){});rimraf(path[_0xc69b('0x22')](_0x344480,_0x5e8f6d),function(){});}})['then'](function(){logger[_0xc69b('0xb')](util[_0xc69b('0xc')](_0xc69b('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xc69b('0x2a'),_0x3a5ac9?util['format'](_0xc69b('0x27'),_0x5e8f6d,_0x3a5ac9?'zip':_0xc69b('0x26')):null);});})['catch'](function(_0x1c0842){logger['info'](util[_0xc69b('0xc')](_0xc69b('0x2b'),EXTRACTED_REPORT_ID,_0xc69b('0xe')),util[_0xc69b('0x2c')](_0x1c0842,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 52c82f2..aae0aac 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 _0x2277=['/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','pdf','%s.%s','pipe','finish','log','err','end','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','lodash','bluebird','util','pdfmake/src/printer','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','num','Empty','dirname','basename','.pdf','Setting','splitSizePdf','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','split','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','landscape','header','black','toString','content','/fonts/Roboto-Regular.ttf'];(function(_0x537044,_0x4de18f){var _0x5ba75e=function(_0x58cccc){while(--_0x58cccc){_0x537044['push'](_0x537044['shift']());}};_0x5ba75e(++_0x4de18f);}(_0x2277,0x18f));var _0x7227=function(_0x338a2b,_0x4851ec){_0x338a2b=_0x338a2b-0x0;var _0x21030d=_0x2277[_0x338a2b];return _0x21030d;};'use strict';var _=require(_0x7227('0x0'));var fs=require('fs');var BPromise=require(_0x7227('0x1'));var util=require(_0x7227('0x2'));var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x7227('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x7227('0x4'));var db=require(_0x7227('0x5'))['db'];var dbH=require(_0x7227('0x5'))['dbH'];var logger=require('../../config/logger')(_0x7227('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x7227('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7227('0x7')][0x4];var NAME=process[_0x7227('0x7')][0x5];var FORMAT=_0x7227('0x8');var _extractedReport;function analyticExtractedReport(_0x4d5055,_0x328a90){var _0x4a11a1={'status':_0x4d5055};var _0x2fbf31={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x328a90){_0x4a11a1[_0x7227('0x9')]=_0x328a90;}return db[_0x7227('0xa')][_0x7227('0xb')](_0x4a11a1,_0x2fbf31);}function getHeader(_0xcd9047){var _0x1e686b=[];for(var _0x54b1b5 in _0xcd9047){if(_0xcd9047[_0x7227('0xc')](_0x54b1b5)){_0x1e686b[_0x7227('0xd')]({'text':_0x54b1b5,'style':'tableHeader'});}}return _0x1e686b;}function extractReport(_0x3b3adf){var _0xd65361=0x1388;var _0x275804;if(!_0x3b3adf[0x0][_0x7227('0xe')]){return analyticExtractedReport(_0x7227('0xf'));}var _0x4d312d=[];var _0x18a84b=0x0;var _0xace0dd=!![];var _0x25192d=path[_0x7227('0x10')](PATH);var _0x355ef8=path[_0x7227('0x11')](PATH,_0x7227('0x12'));var _0x23be11=![];var _0x437771=[];return db[_0x7227('0x13')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7227('0x14')]})['then'](function(_0x530a1e){if(_0x530a1e){_0x275804=_0x530a1e;_0xd65361=_0x275804[_0x7227('0x14')]||0x3e8;}})['then'](function(){if(_0x3b3adf&&_0x3b3adf[_0x7227('0x15')]){var _0x45e807=_0x3b3adf[0x0]['num']%(_0x18a84b+_0xd65361);if(_0x275804['split']){for(;_0xace0dd;_0x18a84b+=_0xd65361,_0x45e807=_0x3b3adf[0x0][_0x7227('0xe')]%(_0x18a84b+_0xd65361)){if(_0x45e807==0x0||_0x45e807==_0x3b3adf[0x0]['num']){_0xace0dd=![];}_0x4d312d[_0x7227('0xd')](dbH[_0x7227('0x16')][_0x7227('0x17')](util[_0x7227('0x18')](_0x7227('0x19'),QUERY,_0xd65361,_0x18a84b),{'type':dbH[_0x7227('0x16')][_0x7227('0x1a')]['SELECT']}));}}else{_0x4d312d[_0x7227('0xd')](dbH[_0x7227('0x16')]['query'](QUERY,{'type':dbH[_0x7227('0x16')][_0x7227('0x1a')][_0x7227('0x1b')]}));}}_0x23be11=_0x275804[_0x7227('0x1c')]&&_0x4d312d[_0x7227('0x15')]>0x1;if(!fs[_0x7227('0x1d')](path[_0x7227('0x1e')](_0x25192d,_0x355ef8))&&_0x23be11){fs[_0x7227('0x1f')](path[_0x7227('0x1e')](_0x25192d,_0x355ef8));}return BPromise[_0x7227('0x20')](_0x4d312d,function(_0x7f19f){_0x437771['push'](_0x7f19f);});})['then'](function(){return BPromise[_0x7227('0x20')](_0x4d312d,function(_0x3e278c,_0x797d02){var _0x20872a;var _0x398eaf=util[_0x7227('0x18')](_0x7227('0x21'),NAME,_extractedReport[_0x7227('0x22')],moment(_extractedReport[_0x7227('0x23')])[_0x7227('0x18')](FORMAT),moment(_extractedReport['endDate'])[_0x7227('0x18')](FORMAT));var _0x23adab={'pageSize':'A4','pageOrientation':_0x7227('0x24'),'content':[{'text':_0x398eaf,'style':_0x7227('0x25')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7227('0x26')}}};var _0x467c06={'headerRows':0x1,'body':[]};_0x467c06['body']['push'](getHeader(_0x3e278c[0x0]));var _0x4dcf27;for(var _0x5389aa=0x0;_0x5389aa<_0x3e278c['length'];_0x5389aa+=0x1){_0x4dcf27=[];for(var _0x2f1cfb in _0x3e278c[_0x5389aa]){if(_0x3e278c[_0x5389aa][_0x7227('0xc')](_0x2f1cfb)){_0x4dcf27[_0x7227('0xd')](_0x3e278c[_0x5389aa][_0x2f1cfb]?_[_0x7227('0x27')](_0x3e278c[_0x5389aa][_0x2f1cfb]):'');}}_0x467c06['body'][_0x7227('0xd')](_0x4dcf27);}_0x23adab[_0x7227('0x28')][_0x7227('0xd')]({'table':_0x467c06});return new BPromise(function(_0x213eec,_0x124660){var _0x52b32f=new PdfPrinter({'Roboto':{'normal':__dirname+_0x7227('0x29'),'bold':__dirname+_0x7227('0x2a'),'italics':__dirname+_0x7227('0x2b'),'bolditalics':__dirname+_0x7227('0x2c')}});var _0x241e7e=_0x52b32f['createPdfKitDocument'](_0x23adab);if(_0x23be11){_0x20872a=path['join'](_0x25192d,_0x355ef8,util[_0x7227('0x18')]('%s%d.%s',_0x355ef8,_0x797d02,_0x7227('0x2d')));}else{_0x20872a=path[_0x7227('0x1e')](_0x25192d,util[_0x7227('0x18')](_0x7227('0x2e'),_0x355ef8,_0x7227('0x2d')));}var _0x394cf2=_0x241e7e[_0x7227('0x2f')](fs['createWriteStream'](_0x20872a));_0x394cf2['on'](_0x7227('0x30'),function(){_0x213eec();});_0x394cf2['on']('error',function(_0x4e1fd1){console[_0x7227('0x31')](_0x7227('0x32'),_0x4e1fd1);_0x124660(_0x4e1fd1);});_0x241e7e[_0x7227('0x33')]();});});})['then'](function(){if(_0x23be11){return new BPromise(function(_0x4b9136,_0x247b52){zipdir(path[_0x7227('0x1e')](_0x25192d,_0x355ef8),{'saveTo':path[_0x7227('0x1e')](_0x25192d,util['format'](_0x7227('0x2e'),_0x355ef8,'zip'))},function(_0x41a1dc){if(_0x41a1dc){_0x247b52(_0x41a1dc);}else{_0x4b9136();}});});}})['then'](function(){if(_0x23be11){rimraf(path[_0x7227('0x1e')](_0x25192d,_0x355ef8),function(){});}})['then'](function(){logger[_0x7227('0x34')](util[_0x7227('0x18')](_0x7227('0x35'),EXTRACTED_REPORT_ID,_0x7227('0x36')));return analyticExtractedReport(_0x7227('0x37'),_0x23be11?util[_0x7227('0x18')]('%s.%s',_0x355ef8,_0x23be11?'zip':_0x7227('0x2d')):null);});}function main(){logger[_0x7227('0x34')](util[_0x7227('0x18')](_0x7227('0x38'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x7227('0xa')][_0x7227('0x39')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7227('0x3a')](function(_0x4f6651){_extractedReport=_0x4f6651;return dbH[_0x7227('0x16')][_0x7227('0x17')](util[_0x7227('0x18')](_0x7227('0x3b'),QUERY),{'type':dbH[_0x7227('0x16')][_0x7227('0x1a')][_0x7227('0x1b')]});})[_0x7227('0x3a')](extractReport)[_0x7227('0x3c')](function(_0x4d4f6f){logger[_0x7227('0x34')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7227('0x3d')),util[_0x7227('0x3e')](_0x4d4f6f,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x700c=['pipe','createWriteStream','finish','error','end','%s.%s','info','CSV','Completed','zip','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','push','tableHeader','num','Empty','basename','Setting','split','splitSizePdf','then','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','length','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','landscape','black','body','hasOwnProperty','toString','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','%s%d.%s'];(function(_0x4d1be0,_0x135738){var _0x47d662=function(_0xdd044e){while(--_0xdd044e){_0x4d1be0['push'](_0x4d1be0['shift']());}};_0x47d662(++_0x135738);}(_0x700c,0x93));var _0xc700=function(_0x40bbf5,_0x20da60){_0x40bbf5=_0x40bbf5-0x0;var _0x572ca7=_0x700c[_0x40bbf5];return _0x572ca7;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0xc700('0x0'));var util=require(_0xc700('0x1'));var path=require(_0xc700('0x2'));var moment=require(_0xc700('0x3'));var PdfPrinter=require(_0xc700('0x4'));var zipdir=require(_0xc700('0x5'));var rimraf=require(_0xc700('0x6'));var db=require(_0xc700('0x7'))['db'];var dbH=require(_0xc700('0x7'))[_0xc700('0x8')];var logger=require(_0xc700('0x9'))(_0xc700('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc700('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xc700('0xb')][0x5];var FORMAT=_0xc700('0xc');var _extractedReport;function analyticExtractedReport(_0x4ac70c,_0x2662af){var _0x5033e1={'status':_0x4ac70c};var _0xe4e649={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2662af){_0x5033e1[_0xc700('0xd')]=_0x2662af;}return db[_0xc700('0xe')][_0xc700('0xf')](_0x5033e1,_0xe4e649);}function getHeader(_0x2ae20c){var _0x2b783d=[];for(var _0x25fdbd in _0x2ae20c){if(_0x2ae20c['hasOwnProperty'](_0x25fdbd)){_0x2b783d[_0xc700('0x10')]({'text':_0x25fdbd,'style':_0xc700('0x11')});}}return _0x2b783d;}function extractReport(_0x49d266){var _0x1dbf89=0x1388;var _0x49bc67;if(!_0x49d266[0x0][_0xc700('0x12')]){return analyticExtractedReport(_0xc700('0x13'));}var _0x415065=[];var _0x4caa31=0x0;var _0x5d1e2c=!![];var _0x285d9e=path['dirname'](PATH);var _0x538086=path[_0xc700('0x14')](PATH,'.pdf');var _0x228c8d=![];var _0x149802=[];return db[_0xc700('0x15')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc700('0x16'),_0xc700('0x17')]})['then'](function(_0x5a4464){if(_0x5a4464){_0x49bc67=_0x5a4464;_0x1dbf89=_0x49bc67[_0xc700('0x17')]||0x3e8;}})[_0xc700('0x18')](function(){if(_0x49d266&&_0x49d266['length']){var _0x12953b=_0x49d266[0x0][_0xc700('0x12')]%(_0x4caa31+_0x1dbf89);if(_0x49bc67['split']){for(;_0x5d1e2c;_0x4caa31+=_0x1dbf89,_0x12953b=_0x49d266[0x0]['num']%(_0x4caa31+_0x1dbf89)){if(_0x12953b==0x0||_0x12953b==_0x49d266[0x0][_0xc700('0x12')]){_0x5d1e2c=![];}_0x415065[_0xc700('0x10')](dbH[_0xc700('0x19')][_0xc700('0x1a')](util[_0xc700('0x1b')](_0xc700('0x1c'),QUERY,_0x1dbf89,_0x4caa31),{'type':dbH[_0xc700('0x19')]['QueryTypes']['SELECT']}));}}else{_0x415065[_0xc700('0x10')](dbH[_0xc700('0x19')][_0xc700('0x1a')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xc700('0x1d')]}));}}_0x228c8d=_0x49bc67[_0xc700('0x16')]&&_0x415065[_0xc700('0x1e')]>0x1;if(!fs[_0xc700('0x1f')](path[_0xc700('0x20')](_0x285d9e,_0x538086))&&_0x228c8d){fs[_0xc700('0x21')](path[_0xc700('0x20')](_0x285d9e,_0x538086));}return BPromise[_0xc700('0x22')](_0x415065,function(_0x24fed5){_0x149802[_0xc700('0x10')](_0x24fed5);});})[_0xc700('0x18')](function(){return BPromise[_0xc700('0x22')](_0x415065,function(_0x1072d9,_0x556858){var _0x25d7cd;var _0xc534aa=util[_0xc700('0x1b')](_0xc700('0x23'),NAME,_extractedReport[_0xc700('0x24')],moment(_extractedReport['startDate'])[_0xc700('0x1b')](FORMAT),moment(_extractedReport['endDate'])[_0xc700('0x1b')](FORMAT));var _0x1bec6c={'pageSize':'A4','pageOrientation':_0xc700('0x25'),'content':[{'text':_0xc534aa,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc700('0x26')}}};var _0x4b58ab={'headerRows':0x1,'body':[]};_0x4b58ab[_0xc700('0x27')][_0xc700('0x10')](getHeader(_0x1072d9[0x0]));var _0x25ab2c;for(var _0x4658e2=0x0;_0x4658e2<_0x1072d9[_0xc700('0x1e')];_0x4658e2+=0x1){_0x25ab2c=[];for(var _0x450e20 in _0x1072d9[_0x4658e2]){if(_0x1072d9[_0x4658e2][_0xc700('0x28')](_0x450e20)){_0x25ab2c['push'](_0x1072d9[_0x4658e2][_0x450e20]?_[_0xc700('0x29')](_0x1072d9[_0x4658e2][_0x450e20]):'');}}_0x4b58ab[_0xc700('0x27')][_0xc700('0x10')](_0x25ab2c);}_0x1bec6c['content'][_0xc700('0x10')]({'table':_0x4b58ab});return new BPromise(function(_0x2365c5,_0x11011c){var _0x5b097c=new PdfPrinter({'Roboto':{'normal':__dirname+_0xc700('0x2a'),'bold':__dirname+_0xc700('0x2b'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x3f803a=_0x5b097c['createPdfKitDocument'](_0x1bec6c);if(_0x228c8d){_0x25d7cd=path['join'](_0x285d9e,_0x538086,util['format'](_0xc700('0x2c'),_0x538086,_0x556858,'pdf'));}else{_0x25d7cd=path[_0xc700('0x20')](_0x285d9e,util[_0xc700('0x1b')]('%s.%s',_0x538086,'pdf'));}var _0x4e15a8=_0x3f803a[_0xc700('0x2d')](fs[_0xc700('0x2e')](_0x25d7cd));_0x4e15a8['on'](_0xc700('0x2f'),function(){_0x2365c5();});_0x4e15a8['on'](_0xc700('0x30'),function(_0x15deb8){console['log']('err',_0x15deb8);_0x11011c(_0x15deb8);});_0x3f803a[_0xc700('0x31')]();});});})[_0xc700('0x18')](function(){if(_0x228c8d){return new BPromise(function(_0xc28891,_0x4c0de5){zipdir(path[_0xc700('0x20')](_0x285d9e,_0x538086),{'saveTo':path[_0xc700('0x20')](_0x285d9e,util['format'](_0xc700('0x32'),_0x538086,'zip'))},function(_0x50d951){if(_0x50d951){_0x4c0de5(_0x50d951);}else{_0xc28891();}});});}})[_0xc700('0x18')](function(){if(_0x228c8d){rimraf(path[_0xc700('0x20')](_0x285d9e,_0x538086),function(){});}})[_0xc700('0x18')](function(){logger[_0xc700('0x33')](util[_0xc700('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc700('0x34')));return analyticExtractedReport(_0xc700('0x35'),_0x228c8d?util[_0xc700('0x1b')](_0xc700('0x32'),_0x538086,_0x228c8d?_0xc700('0x36'):_0xc700('0x37')):null);});}function main(){logger['info'](util[_0xc700('0x1b')](_0xc700('0x38'),EXTRACTED_REPORT_ID,_0xc700('0x39')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc700('0x18')](function(_0x49fda8){_extractedReport=_0x49fda8;return dbH[_0xc700('0x19')][_0xc700('0x1a')](util['format'](_0xc700('0x3a'),QUERY),{'type':dbH['sequelize'][_0xc700('0x3b')][_0xc700('0x1d')]});})[_0xc700('0x18')](extractReport)[_0xc700('0x3c')](function(_0x5179d5){logger[_0xc700('0x33')](util[_0xc700('0x1b')](_0xc700('0x3d'),EXTRACTED_REPORT_ID,'PDF'),util[_0xc700('0x3e')](_0x5179d5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xc700('0x3f'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ab9a7cf..b663350 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 _0x1560=['%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','XLSX','Setting','find','split','splitSizeXlsx','then','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','num','sequelize','query'];(function(_0x21aebf,_0xef9b13){var _0x438f27=function(_0x18e56c){while(--_0x18e56c){_0x21aebf['push'](_0x21aebf['shift']());}};_0x438f27(++_0xef9b13);}(_0x1560,0x155));var _0x0156=function(_0x3f47fb,_0x21aed3){_0x3f47fb=_0x3f47fb-0x0;var _0x187213=_0x1560[_0x3f47fb];return _0x187213;};'use strict';var util=require(_0x0156('0x0'));var path=require('path');var _=require(_0x0156('0x1'));var fs=require('fs');var json2xls=require(_0x0156('0x2'));var BPromise=require(_0x0156('0x3'));var zipdir=require(_0x0156('0x4'));var rimraf=require('rimraf');var db=require(_0x0156('0x5'))['db'];var dbH=require(_0x0156('0x5'))[_0x0156('0x6')];var logger=require(_0x0156('0x7'))(_0x0156('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0156('0x9')][0x2]);var QUERY=process[_0x0156('0x9')][0x3];var PATH=process[_0x0156('0x9')][0x4];function analyticExtractedReport(_0x206a0d,_0x2be84a){var _0xf807e2={'status':_0x206a0d};var _0x20af42={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2be84a){_0xf807e2['savename']=_0x2be84a;}return db[_0x0156('0xa')][_0x0156('0xb')](_0xf807e2,_0x20af42);}function main(){var _0x1a4202=0x1388;var _0x4b4f4c;logger[_0x0156('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0156('0xd')));return db[_0x0156('0xe')][_0x0156('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0156('0x10'),_0x0156('0x11')]})[_0x0156('0x12')](function(_0x43d728){if(_0x43d728){_0x4b4f4c=_0x43d728;_0x1a4202=_0x4b4f4c[_0x0156('0x11')]||0x1388;}})[_0x0156('0x12')](function(){return dbH['sequelize']['query'](util[_0x0156('0x13')](_0x0156('0x14'),QUERY),{'type':dbH['sequelize'][_0x0156('0x15')][_0x0156('0x16')]});})[_0x0156('0x12')](function(_0x575e3d){if(!_0x575e3d[0x0]['num']){return analyticExtractedReport(_0x0156('0x17'));}var _0x36f8f9=[];var _0x2069de=0x0;var _0x58dc93=!![];if(_0x4b4f4c[_0x0156('0x10')]){if(_0x575e3d&&_0x575e3d['length']){var _0x266451=_0x575e3d[0x0][_0x0156('0x18')]%(_0x2069de+_0x1a4202);for(;_0x58dc93;_0x2069de+=_0x1a4202,_0x266451=_0x575e3d[0x0][_0x0156('0x18')]%(_0x2069de+_0x1a4202)){if(_0x266451==0x0||_0x266451==_0x575e3d[0x0][_0x0156('0x18')]){_0x58dc93=![];}_0x36f8f9['push'](dbH[_0x0156('0x19')][_0x0156('0x1a')](util[_0x0156('0x13')](_0x0156('0x1b'),QUERY,_0x1a4202,_0x2069de),{'type':dbH[_0x0156('0x19')][_0x0156('0x15')]['SELECT']}));}}}else{_0x36f8f9[_0x0156('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x0156('0x19')][_0x0156('0x15')][_0x0156('0x16')]}));}var _0x4eaeb2=path[_0x0156('0x1d')](PATH);var _0xa4d1fd=path[_0x0156('0x1e')](PATH,'.xlsx');var _0x2dcc8a=_0x4b4f4c['split']&&_0x36f8f9[_0x0156('0x1f')]>0x1;var _0xdc2e40=[];if(!fs[_0x0156('0x20')](path[_0x0156('0x21')](_0x4eaeb2,_0xa4d1fd))&&_0x2dcc8a){fs['mkdirSync'](path[_0x0156('0x21')](_0x4eaeb2,_0xa4d1fd));}return BPromise[_0x0156('0x22')](_0x36f8f9,function(_0x5854b3){_0xdc2e40['push'](_0x5854b3);})[_0x0156('0x12')](function(){for(var _0x5e32bf=0x0;_0x5e32bf<_0xdc2e40['length'];_0x5e32bf+=0x1){var _0x3ced7d;var _0x57c03d=_0xdc2e40[_0x5e32bf];if(_0x2dcc8a){_0x3ced7d=path['join'](_0x4eaeb2,_0xa4d1fd,util[_0x0156('0x13')](_0x0156('0x23'),_0xa4d1fd,_0x5e32bf,_0x0156('0x24')));}else{_0x3ced7d=path[_0x0156('0x21')](_0x4eaeb2,util['format'](_0x0156('0x25'),_0xa4d1fd,_0x0156('0x24')));}fs[_0x0156('0x26')](_0x3ced7d,json2xls(_0x57c03d),_0x0156('0x27'));}})[_0x0156('0x12')](function(){if(_0x2dcc8a){zipdir(path[_0x0156('0x21')](_0x4eaeb2,_0xa4d1fd),{'saveTo':path['join'](_0x4eaeb2,util['format'](_0x0156('0x25'),_0xa4d1fd,_0x0156('0x28')))},function(_0x17077a,_0x509592){});rimraf(path['join'](_0x4eaeb2,_0xa4d1fd),function(){});}})['then'](function(){logger[_0x0156('0xc')](util['format'](_0x0156('0x29'),EXTRACTED_REPORT_ID,_0x0156('0xd')));return analyticExtractedReport(_0x0156('0x2a'),_0x2dcc8a?util[_0x0156('0x13')]('%s.%s',_0xa4d1fd,_0x2dcc8a?_0x0156('0x28'):_0x0156('0x24')):null);});})[_0x0156('0x2b')](function(_0x2bdb02){logger[_0x0156('0xc')](util[_0x0156('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0156('0xd')),util[_0x0156('0x2c')](_0x2bdb02,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0156('0x2d'));});}main(); \ No newline at end of file +var _0xbd72=['Empty','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xbd72,0x11e));var _0x2bd7=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0xbd72[_0x5d3903];return _0x4b8bc9;};'use strict';var util=require(_0x2bd7('0x0'));var path=require(_0x2bd7('0x1'));var _=require(_0x2bd7('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x2bd7('0x3'));var zipdir=require(_0x2bd7('0x4'));var rimraf=require(_0x2bd7('0x5'));var db=require(_0x2bd7('0x6'))['db'];var dbH=require(_0x2bd7('0x6'))[_0x2bd7('0x7')];var logger=require('../../config/logger')(_0x2bd7('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x2bd7('0x9')][0x2]);var QUERY=process[_0x2bd7('0x9')][0x3];var PATH=process[_0x2bd7('0x9')][0x4];function analyticExtractedReport(_0x2acc8d,_0x1a0cad){var _0x2b41fc={'status':_0x2acc8d};var _0x175965={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1a0cad){_0x2b41fc['savename']=_0x1a0cad;}return db[_0x2bd7('0xa')]['update'](_0x2b41fc,_0x175965);}function main(){var _0xdbaea5=0x1388;var _0x2bbc75;logger['info'](util[_0x2bd7('0xb')](_0x2bd7('0xc'),EXTRACTED_REPORT_ID,_0x2bd7('0xd')));return db[_0x2bd7('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x2bd7('0xf')]})['then'](function(_0x29cf2e){if(_0x29cf2e){_0x2bbc75=_0x29cf2e;_0xdbaea5=_0x2bbc75[_0x2bd7('0xf')]||0x1388;}})[_0x2bd7('0x10')](function(){return dbH[_0x2bd7('0x11')][_0x2bd7('0x12')](util[_0x2bd7('0xb')](_0x2bd7('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x2bd7('0x14')]});})[_0x2bd7('0x10')](function(_0x5a56f5){if(!_0x5a56f5[0x0][_0x2bd7('0x15')]){return analyticExtractedReport(_0x2bd7('0x16'));}var _0x32bd60=[];var _0x4cf792=0x0;var _0x498e17=!![];if(_0x2bbc75[_0x2bd7('0x17')]){if(_0x5a56f5&&_0x5a56f5[_0x2bd7('0x18')]){var _0x8b3478=_0x5a56f5[0x0][_0x2bd7('0x15')]%(_0x4cf792+_0xdbaea5);for(;_0x498e17;_0x4cf792+=_0xdbaea5,_0x8b3478=_0x5a56f5[0x0][_0x2bd7('0x15')]%(_0x4cf792+_0xdbaea5)){if(_0x8b3478==0x0||_0x8b3478==_0x5a56f5[0x0][_0x2bd7('0x15')]){_0x498e17=![];}_0x32bd60[_0x2bd7('0x19')](dbH['sequelize'][_0x2bd7('0x12')](util[_0x2bd7('0xb')](_0x2bd7('0x1a'),QUERY,_0xdbaea5,_0x4cf792),{'type':dbH[_0x2bd7('0x11')][_0x2bd7('0x1b')]['SELECT']}));}}}else{_0x32bd60['push'](dbH[_0x2bd7('0x11')][_0x2bd7('0x12')](QUERY,{'type':dbH[_0x2bd7('0x11')][_0x2bd7('0x1b')][_0x2bd7('0x14')]}));}var _0x29775a=path[_0x2bd7('0x1c')](PATH);var _0x3ef2d7=path[_0x2bd7('0x1d')](PATH,_0x2bd7('0x1e'));var _0x17b635=_0x2bbc75['split']&&_0x32bd60[_0x2bd7('0x18')]>0x1;var _0x17c01c=[];if(!fs[_0x2bd7('0x1f')](path[_0x2bd7('0x20')](_0x29775a,_0x3ef2d7))&&_0x17b635){fs[_0x2bd7('0x21')](path[_0x2bd7('0x20')](_0x29775a,_0x3ef2d7));}return BPromise['each'](_0x32bd60,function(_0x35bb32){_0x17c01c[_0x2bd7('0x19')](_0x35bb32);})[_0x2bd7('0x10')](function(){for(var _0x1a7a4a=0x0;_0x1a7a4a<_0x17c01c[_0x2bd7('0x18')];_0x1a7a4a+=0x1){var _0x517526;var _0x197b7e=_0x17c01c[_0x1a7a4a];if(_0x17b635){_0x517526=path['join'](_0x29775a,_0x3ef2d7,util[_0x2bd7('0xb')](_0x2bd7('0x22'),_0x3ef2d7,_0x1a7a4a,_0x2bd7('0x23')));}else{_0x517526=path['join'](_0x29775a,util['format']('%s.%s',_0x3ef2d7,'xlsx'));}fs[_0x2bd7('0x24')](_0x517526,json2xls(_0x197b7e),_0x2bd7('0x25'));}})['then'](function(){if(_0x17b635){zipdir(path['join'](_0x29775a,_0x3ef2d7),{'saveTo':path[_0x2bd7('0x20')](_0x29775a,util[_0x2bd7('0xb')](_0x2bd7('0x26'),_0x3ef2d7,_0x2bd7('0x27')))},function(_0x176c29,_0x165184){});rimraf(path['join'](_0x29775a,_0x3ef2d7),function(){});}})[_0x2bd7('0x10')](function(){logger[_0x2bd7('0x28')](util[_0x2bd7('0xb')](_0x2bd7('0x29'),EXTRACTED_REPORT_ID,_0x2bd7('0xd')));return analyticExtractedReport(_0x2bd7('0x2a'),_0x17b635?util[_0x2bd7('0xb')](_0x2bd7('0x26'),_0x3ef2d7,_0x17b635?_0x2bd7('0x27'):_0x2bd7('0x23')):null);});})['catch'](function(_0x16da60){logger[_0x2bd7('0x28')](util[_0x2bd7('0xb')](_0x2bd7('0x2b'),EXTRACTED_REPORT_ID,_0x2bd7('0xd')),util['inspect'](_0x16da60,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4e2aaba..3aa07da 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 _0x8d8f=['findAll','VoiceExtension','IntervalId','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','type','context','CDR(destination)=','cutdigits','${EXTEN}','VoiceExtensionId','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','*,*,*,*','tag','CDR(tag)=','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','models','Interval'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d8f,0x84));var _0xf8d8=function(_0x53ccb1,_0x35e39a){_0x53ccb1=_0x53ccb1-0x0;var _0x4bfbb6=_0x8d8f[_0x53ccb1];return _0x4bfbb6;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x1f1869,_0x852df3){var _0x443f9f=this;return _0x1f1869[_0xf8d8('0x0')][_0xf8d8('0x1')][_0xf8d8('0x2')]({'raw':!![]})['then'](function(_0x30a013){_0x443f9f['intervals']=_0x30a013;return _0x1f1869['models'][_0xf8d8('0x3')][_0xf8d8('0x2')]({'where':{'IntervalId':_0x852df3[_0xf8d8('0x4')]},'raw':!![]});})[_0xf8d8('0x5')](function(_0x10d734){return _0x1f1869[_0xf8d8('0x0')][_0xf8d8('0x3')][_0xf8d8('0x2')]({'where':{'exten':{'$in':_[_0xf8d8('0x6')](_[_0xf8d8('0x7')](_0x10d734,'exten'))}},'order':[{'raw':_0xf8d8('0x8')}],'raw':!![]});})[_0xf8d8('0x5')](function(_0x56fb05){var _0x25ef08=_[_0xf8d8('0x9')](_0x56fb05,{'priority':'1'});var _0x4a775c=_[_0xf8d8('0x9')](_0x56fb05,{'isApp':0x1});var _0x143114=_[_0xf8d8('0xa')](_0x4a775c,_0xf8d8('0xb'));var _0x38a4ea=[_0xf8d8('0xc'),_0xf8d8('0xd')];var _0x20b198=[];var _0x463713=[];for(var _0x1f9803 in _0x143114){if(_0x143114[_0xf8d8('0xe')](_0x1f9803)){_0x443f9f[_0xf8d8('0xf')]=0x2;_0x443f9f[_0xf8d8('0x10')]=[];_0x443f9f[_0xf8d8('0x11')]=_[_0xf8d8('0x12')](_0x25ef08,{'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')]});_0x443f9f[_0xf8d8('0x10')][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0]['type'],'app':_0xf8d8('0x14'),'appdata':util[_0xf8d8('0x15')]('CDR(type)=%s',_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')]),'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0]['VoiceExtensionId']});if(_0x143114[_0x1f9803][0x0]['type']==='outbound'){if(_0x443f9f[_0xf8d8('0x11')]){_0x443f9f[_0xf8d8('0x10')]['push']({'type':_0x143114[_0x1f9803][0x0]['type'],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x18')+(_0x443f9f[_0xf8d8('0x11')][_0xf8d8('0x19')]?'${EXTEN:'+_0x443f9f[_0xf8d8('0x11')][_0xf8d8('0x19')]+'}':_0xf8d8('0x1a')),'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0]['VoiceExtensionId']});}_0x443f9f['extensions'][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':_0xf8d8('0x14'),'appdata':'CDR(routeid)='+_0x143114[_0x1f9803][0x0]['VoiceExtensionId'],'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});var _0x483623=_0x443f9f[_0xf8d8('0xf')]++;_0x443f9f[_0xf8d8('0x10')][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0]['type'],'app':'ExecIf','appdata':_0xf8d8('0x1c')+(_0x483623+0x2)+_0xf8d8('0x1d')+(_0x483623+0x1)+')','context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x483623,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});if(_0x443f9f[_0xf8d8('0x11')]){_0x443f9f[_0xf8d8('0x10')][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0]['type'],'app':'Set','appdata':_0x443f9f[_0xf8d8('0x11')]['cutdigits']?_0xf8d8('0x1e')+_0x443f9f[_0xf8d8('0x11')][_0xf8d8('0x19')]+'}':_0xf8d8('0x1f'),'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0]['exten'],'priority':_0x443f9f['priority']++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});}_0x443f9f['extensions']['push']({'type':_0x143114[_0x1f9803][0x0]['type'],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x20')+_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')],'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0]['exten'],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});if(_0x443f9f['extension']&&_0x443f9f[_0xf8d8('0x11')][_0xf8d8('0xe')](_0xf8d8('0x21'))&&_0x443f9f[_0xf8d8('0x11')][_0xf8d8('0x21')]!==_0xf8d8('0x22')){_0x443f9f['extensions'][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':_0xf8d8('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0]['exten'],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});_0x443f9f[_0xf8d8('0x10')]['push']({'type':_0x143114[_0x1f9803][0x0]['type'],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x23')+_0x443f9f[_0xf8d8('0x11')]['recordingFormat']||'wav','context':_0x143114[_0x1f9803][0x0]['context'],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f['priority']++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0]['VoiceExtensionId']});}}_0x443f9f['extensions']['push']({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x24'),'context':_0x143114[_0x1f9803][0x0]['context'],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});_0x443f9f['extensions'][_0xf8d8('0x13')]({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'priority':_0x443f9f[_0xf8d8('0xf')]++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0]['VoiceExtensionId']});_0x443f9f[_0xf8d8('0x10')]['push']({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':'Set','appdata':_0xf8d8('0x25'),'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'exten':_0x143114[_0x1f9803][0x0]['exten'],'priority':_0x443f9f['priority']++,'VoiceExtensionId':_0x143114[_0x1f9803][0x0]['VoiceExtensionId']});for(var _0x2f80dc=0x0,_0x2fb224=0x0;_0x2f80dc<_0x143114[_0x1f9803][_0xf8d8('0x26')];_0x2f80dc+=0x1,_0x2fb224=0x0){var _0x318020=_0x143114[_0x1f9803][_0x2f80dc];if(_0x318020[_0xf8d8('0x16')]){_0x318020[_0xf8d8('0x16')]=_0x318020[_0xf8d8('0x16')][_0xf8d8('0x27')]();}var _0x419458=[];var _0x1e989=[];delete _0x318020['id'];delete _0x318020['createdAt'];delete _0x318020['updatedAt'];var _0x484e7d=_0x318020[_0xf8d8('0x28')]!==_0xf8d8('0x29')?[_0x318020[_0xf8d8('0x28')]]:_0x318020[_0xf8d8('0x4')]?_[_0xf8d8('0x7')](_[_0xf8d8('0x9')](_0x443f9f['intervals'],{'IntervalId':_0x318020['IntervalId']}),_0xf8d8('0x28')):[];if(_0x318020[_0xf8d8('0xe')]('tag')){if(_0x318020[_0xf8d8('0x2a')]&&_0x318020[_0xf8d8('0x2a')]!=='--'){_0x419458[_0xf8d8('0x13')]({'type':_0x318020['type'],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x2b')+_0x318020[_0xf8d8('0x2a')],'context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020[_0xf8d8('0xb')],'priority':_0x484e7d[_0xf8d8('0x26')]+_0x443f9f[_0xf8d8('0xf')]+_0x2fb224++,'VoiceExtensionId':_0x318020[_0xf8d8('0x1b')]});}}if(_0x318020[_0xf8d8('0x16')]===_0xf8d8('0x2c')&&_0x318020[_0xf8d8('0xe')](_0xf8d8('0x2d'))){if(_0x318020[_0xf8d8('0x2d')]){_0x419458[_0xf8d8('0x13')]({'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x2e'),'appdata':_0xf8d8('0x2f')+_0x318020['callerID']+')','context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020['exten'],'priority':_0x484e7d[_0xf8d8('0x26')]+_0x443f9f[_0xf8d8('0xf')]+_0x2fb224++,'VoiceExtensionId':_0x318020[_0xf8d8('0x1b')]});}else{_0x419458[_0xf8d8('0x13')]({'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x2e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x318020['context'],'exten':_0x318020[_0xf8d8('0xb')],'priority':_0x484e7d['length']+_0x443f9f['priority']+_0x2fb224++,'VoiceExtensionId':_0x318020[_0xf8d8('0x1b')]});}}if(_0x318020[_0xf8d8('0xe')](_0xf8d8('0x30'))){if(_0x38a4ea[_0xf8d8('0x31')](_0x318020[_0xf8d8('0x32')]['toLowerCase']())>=0x0&&_0x318020['appType']!==_0xf8d8('0x33')){if(_0x318020[_0xf8d8('0x30')]){_0x419458['push']({'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x2e'),'appdata':_0xf8d8('0x34'),'context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020['exten'],'priority':_0x484e7d[_0xf8d8('0x26')]+_0x443f9f[_0xf8d8('0xf')]+_0x2fb224++,'VoiceExtensionId':_0x318020[_0xf8d8('0x1b')]});_0x419458[_0xf8d8('0x13')]({'type':_0x318020[_0xf8d8('0x16')],'app':'Set','appdata':_0xf8d8('0x35'),'context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020[_0xf8d8('0xb')],'priority':_0x484e7d[_0xf8d8('0x26')]+_0x443f9f[_0xf8d8('0xf')]+_0x2fb224++,'VoiceExtensionId':_0x318020['VoiceExtensionId']});}else{_0x419458['push']({'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x2e'),'appdata':_0xf8d8('0x36'),'context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020[_0xf8d8('0xb')],'priority':_0x484e7d['length']+_0x443f9f[_0xf8d8('0xf')]+_0x2fb224++,'VoiceExtensionId':_0x318020['VoiceExtensionId']});_0x419458[_0xf8d8('0x13')]({'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x14'),'appdata':_0xf8d8('0x37'),'context':_0x318020[_0xf8d8('0x17')],'exten':_0x318020[_0xf8d8('0xb')],'priority':_0x484e7d[_0xf8d8('0x26')]+_0x443f9f['priority']+_0x2fb224++,'VoiceExtensionId':_0x318020[_0xf8d8('0x1b')]});}}}for(var _0x3933d7=0x0;_0x3933d7<_0x484e7d[_0xf8d8('0x26')];_0x3933d7+=0x1){var _0x194601=_0x443f9f[_0xf8d8('0xf')]+_0x484e7d[_0xf8d8('0x26')];var _0x15db93=_0x3933d7===_0x484e7d[_0xf8d8('0x26')]-0x1?_0x443f9f[_0xf8d8('0xf')]+_0x419458[_0xf8d8('0x26')]+_0x1e989['length']+0x2:_0x443f9f[_0xf8d8('0xf')]+_0x3933d7+0x1;_0x419458[_0xf8d8('0x38')](_0x3933d7,0x0,{'type':_0x318020[_0xf8d8('0x16')],'app':_0xf8d8('0x39'),'appdata':_0x484e7d[_0x3933d7]+'?'+_0x318020[_0xf8d8('0x17')]+_0xf8d8('0x3a')+_0x194601+':'+_0x318020[_0xf8d8('0x17')]+_0xf8d8('0x3a')+_0x15db93,'exten':_0x318020[_0xf8d8('0xb')],'context':_0x318020[_0xf8d8('0x17')],'priority':_0x443f9f[_0xf8d8('0xf')]+_0x3933d7,'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});}_0x318020[_0xf8d8('0xf')]=_0x419458[_0xf8d8('0x26')]?_[_0xf8d8('0x3b')](_0x419458)[_0xf8d8('0xf')]+0x1:_0x443f9f['priority'];_0x443f9f[_0xf8d8('0xf')]=(_0x1e989['length']?_[_0xf8d8('0x3b')](_0x1e989)[_0xf8d8('0xf')]:_0x318020['priority'])+0x1;_0x443f9f[_0xf8d8('0x10')]=_[_0xf8d8('0x3c')](_0x443f9f['extensions'],_0x419458,[_0x318020],_0x1e989);}_0x443f9f[_0xf8d8('0x10')]['push']({'type':_0x143114[_0x1f9803][0x0][_0xf8d8('0x16')],'app':_0xf8d8('0x3d'),'exten':_0x143114[_0x1f9803][0x0][_0xf8d8('0xb')],'context':_0x143114[_0x1f9803][0x0][_0xf8d8('0x17')],'priority':_0x443f9f[_0xf8d8('0xf')],'VoiceExtensionId':_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]});_0x20b198[_0xf8d8('0x13')](_0x143114[_0x1f9803][0x0][_0xf8d8('0x1b')]);_0x463713=_['concat'](_0x463713,_0x443f9f[_0xf8d8('0x10')]);}}return _0x1f1869[_0xf8d8('0x3e')](function(_0x539411){return _0x1f1869[_0xf8d8('0x0')][_0xf8d8('0x3')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x20b198}},'transaction':_0x539411})[_0xf8d8('0x5')](function(_0xf02289){return _0x1f1869[_0xf8d8('0x0')][_0xf8d8('0x3')][_0xf8d8('0x3f')](_[_0xf8d8('0x40')](_0x463713,_0xf8d8('0xf')),{'transaction':_0x539411});});});})[_0xf8d8('0x41')](function(_0x2fb155){console[_0xf8d8('0x42')](_0x2fb155);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xa062=['*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','sortBy','error','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','outbound','Set','CDR(destination)=','cutdigits','${EXTEN:','VoiceExtensionId','context','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval'];(function(_0x47d7c4,_0x7a3fee){var _0x11b439=function(_0x2c6824){while(--_0x2c6824){_0x47d7c4['push'](_0x47d7c4['shift']());}};_0x11b439(++_0x7a3fee);}(_0xa062,0x9a));var _0x2a06=function(_0x1da3be,_0x21488d){_0x1da3be=_0x1da3be-0x0;var _0x2d4ae3=_0xa062[_0x1da3be];return _0x2d4ae3;};'use strict';var _=require(_0x2a06('0x0'));var util=require('util');function rewrite(_0x2d6b54,_0x4d4ce8){var _0x37bbe0=this;return _0x2d6b54[_0x2a06('0x1')]['Interval'][_0x2a06('0x2')]({'raw':!![]})[_0x2a06('0x3')](function(_0x592a5c){_0x37bbe0[_0x2a06('0x4')]=_0x592a5c;return _0x2d6b54[_0x2a06('0x1')][_0x2a06('0x5')][_0x2a06('0x2')]({'where':{'IntervalId':_0x4d4ce8[_0x2a06('0x6')]},'raw':!![]});})[_0x2a06('0x3')](function(_0x5699df){return _0x2d6b54[_0x2a06('0x1')][_0x2a06('0x5')][_0x2a06('0x2')]({'where':{'exten':{'$in':_[_0x2a06('0x7')](_['map'](_0x5699df,_0x2a06('0x8')))}},'order':[{'raw':_0x2a06('0x9')}],'raw':!![]});})['then'](function(_0x3faf4d){var _0x15cac8=_[_0x2a06('0xa')](_0x3faf4d,{'priority':'1'});var _0x3c9981=_[_0x2a06('0xa')](_0x3faf4d,{'isApp':0x1});var _0x547b3d=_[_0x2a06('0xb')](_0x3c9981,_0x2a06('0x8'));var _0x47ba40=[_0x2a06('0xc'),_0x2a06('0xd')];var _0x1c0ae2=[];var _0x117e12=[];for(var _0x244686 in _0x547b3d){if(_0x547b3d[_0x2a06('0xe')](_0x244686)){_0x37bbe0[_0x2a06('0xf')]=0x2;_0x37bbe0[_0x2a06('0x10')]=[];_0x37bbe0[_0x2a06('0x11')]=_[_0x2a06('0x12')](_0x15cac8,{'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')]});_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':'Set','appdata':util[_0x2a06('0x15')](_0x2a06('0x16'),_0x547b3d[_0x244686][0x0][_0x2a06('0x14')]),'context':_0x547b3d[_0x244686][0x0]['context'],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0]['VoiceExtensionId']});if(_0x547b3d[_0x244686][0x0][_0x2a06('0x14')]===_0x2a06('0x17')){if(_0x37bbe0[_0x2a06('0x11')]){_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0]['type'],'app':_0x2a06('0x18'),'appdata':_0x2a06('0x19')+(_0x37bbe0['extension'][_0x2a06('0x1a')]?_0x2a06('0x1b')+_0x37bbe0[_0x2a06('0x11')][_0x2a06('0x1a')]+'}':'${EXTEN}'),'context':_0x547b3d[_0x244686][0x0]['context'],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});}_0x37bbe0[_0x2a06('0x10')]['push']({'type':_0x547b3d[_0x244686][0x0]['type'],'app':_0x2a06('0x18'),'appdata':'CDR(routeid)='+_0x547b3d[_0x244686][0x0]['VoiceExtensionId'],'context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0]['VoiceExtensionId']});var _0x3fa3e4=_0x37bbe0[_0x2a06('0xf')]++;_0x37bbe0['extensions'][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0]['type'],'app':_0x2a06('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3fa3e4+0x2)+_0x2a06('0x1f')+(_0x3fa3e4+0x1)+')','context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x3fa3e4,'VoiceExtensionId':_0x547b3d[_0x244686][0x0]['VoiceExtensionId']});if(_0x37bbe0[_0x2a06('0x11')]){_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':_0x2a06('0x18'),'appdata':_0x37bbe0['extension'][_0x2a06('0x1a')]?_0x2a06('0x20')+_0x37bbe0['extension']['cutdigits']+'}':_0x2a06('0x21'),'context':_0x547b3d[_0x244686][0x0]['context'],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});}_0x37bbe0[_0x2a06('0x10')]['push']({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':'Set','appdata':_0x2a06('0x22')+_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')],'context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0['priority']++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});if(_0x37bbe0[_0x2a06('0x11')]&&_0x37bbe0[_0x2a06('0x11')][_0x2a06('0xe')](_0x2a06('0x23'))&&_0x37bbe0[_0x2a06('0x11')][_0x2a06('0x23')]!=='none'){_0x37bbe0['extensions']['push']({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':'Set','appdata':_0x2a06('0x24'),'context':_0x547b3d[_0x244686][0x0]['context'],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});_0x37bbe0['extensions']['push']({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':_0x2a06('0x18'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x37bbe0['extension'][_0x2a06('0x23')]||'wav','context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0['priority']++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});}}_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0]['type'],'app':_0x2a06('0x18'),'appdata':_0x2a06('0x25'),'context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});_0x37bbe0['extensions'][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':_0x2a06('0x18'),'appdata':_0x2a06('0x26'),'context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'exten':_0x547b3d[_0x244686][0x0]['exten'],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x547b3d[_0x244686][0x0]['context'],'exten':_0x547b3d[_0x244686][0x0][_0x2a06('0x8')],'priority':_0x37bbe0[_0x2a06('0xf')]++,'VoiceExtensionId':_0x547b3d[_0x244686][0x0]['VoiceExtensionId']});for(var _0x6ffe22=0x0,_0x296b70=0x0;_0x6ffe22<_0x547b3d[_0x244686][_0x2a06('0x27')];_0x6ffe22+=0x1,_0x296b70=0x0){var _0x3a6b0a=_0x547b3d[_0x244686][_0x6ffe22];if(_0x3a6b0a[_0x2a06('0x14')]){_0x3a6b0a['type']=_0x3a6b0a[_0x2a06('0x14')][_0x2a06('0x28')]();}var _0x532326=[];var _0x3da3ae=[];delete _0x3a6b0a['id'];delete _0x3a6b0a[_0x2a06('0x29')];delete _0x3a6b0a[_0x2a06('0x2a')];var _0x43f9ca=_0x3a6b0a[_0x2a06('0x2b')]!==_0x2a06('0x2c')?[_0x3a6b0a[_0x2a06('0x2b')]]:_0x3a6b0a[_0x2a06('0x6')]?_[_0x2a06('0x2d')](_[_0x2a06('0xa')](_0x37bbe0['intervals'],{'IntervalId':_0x3a6b0a[_0x2a06('0x6')]}),_0x2a06('0x2b')):[];if(_0x3a6b0a[_0x2a06('0xe')](_0x2a06('0x2e'))){if(_0x3a6b0a['tag']&&_0x3a6b0a['tag']!=='--'){_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a[_0x2a06('0x14')],'app':_0x2a06('0x18'),'appdata':_0x2a06('0x2f')+_0x3a6b0a['tag'],'context':_0x3a6b0a['context'],'exten':_0x3a6b0a[_0x2a06('0x8')],'priority':_0x43f9ca[_0x2a06('0x27')]+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});}}if(_0x3a6b0a[_0x2a06('0x14')]===_0x2a06('0x17')&&_0x3a6b0a[_0x2a06('0xe')](_0x2a06('0x30'))){if(_0x3a6b0a[_0x2a06('0x30')]){_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a['type'],'app':_0x2a06('0x1e'),'appdata':_0x2a06('0x31')+_0x3a6b0a[_0x2a06('0x30')]+')','context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a[_0x2a06('0x8')],'priority':_0x43f9ca[_0x2a06('0x27')]+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});}else{_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a['type'],'app':_0x2a06('0x1e'),'appdata':_0x2a06('0x32'),'context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a[_0x2a06('0x8')],'priority':_0x43f9ca[_0x2a06('0x27')]+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});}}if(_0x3a6b0a[_0x2a06('0xe')](_0x2a06('0x33'))){if(_0x47ba40[_0x2a06('0x34')](_0x3a6b0a['app'][_0x2a06('0x28')]())>=0x0&&_0x3a6b0a[_0x2a06('0x35')]!==_0x2a06('0x36')){if(_0x3a6b0a[_0x2a06('0x33')]){_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a[_0x2a06('0x14')],'app':_0x2a06('0x1e'),'appdata':_0x2a06('0x37'),'context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a['exten'],'priority':_0x43f9ca[_0x2a06('0x27')]+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a['type'],'app':'Set','appdata':_0x2a06('0x38'),'context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a[_0x2a06('0x8')],'priority':_0x43f9ca['length']+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});}else{_0x532326[_0x2a06('0x13')]({'type':_0x3a6b0a[_0x2a06('0x14')],'app':_0x2a06('0x1e'),'appdata':_0x2a06('0x39'),'context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a['exten'],'priority':_0x43f9ca['length']+_0x37bbe0[_0x2a06('0xf')]+_0x296b70++,'VoiceExtensionId':_0x3a6b0a[_0x2a06('0x1c')]});_0x532326['push']({'type':_0x3a6b0a[_0x2a06('0x14')],'app':_0x2a06('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3a6b0a[_0x2a06('0x1d')],'exten':_0x3a6b0a['exten'],'priority':_0x43f9ca[_0x2a06('0x27')]+_0x37bbe0['priority']+_0x296b70++,'VoiceExtensionId':_0x3a6b0a['VoiceExtensionId']});}}}for(var _0x44d682=0x0;_0x44d682<_0x43f9ca['length'];_0x44d682+=0x1){var _0x432608=_0x37bbe0[_0x2a06('0xf')]+_0x43f9ca[_0x2a06('0x27')];var _0x2d5581=_0x44d682===_0x43f9ca[_0x2a06('0x27')]-0x1?_0x37bbe0['priority']+_0x532326[_0x2a06('0x27')]+_0x3da3ae[_0x2a06('0x27')]+0x2:_0x37bbe0[_0x2a06('0xf')]+_0x44d682+0x1;_0x532326[_0x2a06('0x3a')](_0x44d682,0x0,{'type':_0x3a6b0a['type'],'app':_0x2a06('0x3b'),'appdata':_0x43f9ca[_0x44d682]+'?'+_0x3a6b0a[_0x2a06('0x1d')]+',${EXTEN},'+_0x432608+':'+_0x3a6b0a[_0x2a06('0x1d')]+_0x2a06('0x3c')+_0x2d5581,'exten':_0x3a6b0a[_0x2a06('0x8')],'context':_0x3a6b0a[_0x2a06('0x1d')],'priority':_0x37bbe0['priority']+_0x44d682,'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});}_0x3a6b0a[_0x2a06('0xf')]=_0x532326[_0x2a06('0x27')]?_[_0x2a06('0x3d')](_0x532326)['priority']+0x1:_0x37bbe0[_0x2a06('0xf')];_0x37bbe0[_0x2a06('0xf')]=(_0x3da3ae[_0x2a06('0x27')]?_[_0x2a06('0x3d')](_0x3da3ae)[_0x2a06('0xf')]:_0x3a6b0a[_0x2a06('0xf')])+0x1;_0x37bbe0[_0x2a06('0x10')]=_['concat'](_0x37bbe0[_0x2a06('0x10')],_0x532326,[_0x3a6b0a],_0x3da3ae);}_0x37bbe0[_0x2a06('0x10')][_0x2a06('0x13')]({'type':_0x547b3d[_0x244686][0x0][_0x2a06('0x14')],'app':_0x2a06('0x3e'),'exten':_0x547b3d[_0x244686][0x0]['exten'],'context':_0x547b3d[_0x244686][0x0][_0x2a06('0x1d')],'priority':_0x37bbe0[_0x2a06('0xf')],'VoiceExtensionId':_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]});_0x1c0ae2[_0x2a06('0x13')](_0x547b3d[_0x244686][0x0][_0x2a06('0x1c')]);_0x117e12=_['concat'](_0x117e12,_0x37bbe0[_0x2a06('0x10')]);}}return _0x2d6b54[_0x2a06('0x3f')](function(_0x21f619){return _0x2d6b54[_0x2a06('0x1')][_0x2a06('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1c0ae2}},'transaction':_0x21f619})[_0x2a06('0x3')](function(_0x3b436a){return _0x2d6b54[_0x2a06('0x1')][_0x2a06('0x5')]['bulkCreate'](_[_0x2a06('0x40')](_0x117e12,'priority'),{'transaction':_0x21f619});});});})['catch'](function(_0x5c32){console[_0x2a06('0x41')](_0x5c32);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b46552d..61f5881 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 _0x995a=['cmContact','checkHopper','inspect','into','cm_hopper','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','toString','fromQuery','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','insert','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','query','CampaignId','onlyIfOpen','all','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x995a,0xac));var _0xa995=function(_0x4c1d45,_0x3b76e2){_0x4c1d45=_0x4c1d45-0x0;var _0x43d4d5=_0x995a[_0x4c1d45];return _0x43d4d5;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xa995('0x0'));var fs=require('fs');var squel=require(_0xa995('0x1'));var Papa=require(_0xa995('0x2'));var Redis=require(_0xa995('0x3'));var db=require(_0xa995('0x4'))['db'];var config=require(_0xa995('0x5'));var logger=require(_0xa995('0x6'))('api');config['redis']=_['defaults'](config[_0xa995('0x7')],{'host':_0xa995('0x8'),'port':0x18eb});var socket=require(_0xa995('0x9'))(new Redis(config[_0xa995('0x7')]));require(_0xa995('0xa'))[_0xa995('0xb')](socket);try{if(!process[_0xa995('0xc')][0x2]||process['argv'][0x2]===_0xa995('0xd')||process[_0xa995('0xc')][0x2]===_0xa995('0xe')){throw new Error(_0xa995('0xf'));}var FILEPATH=process[_0xa995('0xc')][0x2];if(!process[_0xa995('0xc')][0x3]||process[_0xa995('0xc')][0x3]==='undefined'||process['argv'][0x3]===_0xa995('0xe')||!process['argv'][0x4]||process['argv'][0x4]===_0xa995('0xd')||process[_0xa995('0xc')][0x4]==='null'){throw new Error(_0xa995('0x10'));}var FIELDS=_[_0xa995('0x11')](process['argv'][0x3][_0xa995('0x12')](','),process[_0xa995('0xc')][0x4][_0xa995('0x12')](','));if(!process[_0xa995('0xc')][0x5]||process['argv'][0x5]===_0xa995('0xd')||process[_0xa995('0xc')][0x5]===_0xa995('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xa995('0xc')][0x5];var COMPANYID=process[_0xa995('0xc')][0x6]&&process[_0xa995('0xc')][0x6]!==_0xa995('0xd')&&process['argv'][0x6]!=='null'?process[_0xa995('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xa995('0xc')][0x7]!=='undefined'&&process[_0xa995('0xc')][0x7]!==_0xa995('0xe')?process[_0xa995('0xc')][0x7]:null;if(!process[_0xa995('0xc')][0x8]||process['argv'][0x8]==='undefined'||process['argv'][0x8]===_0xa995('0xe')){throw new Error(_0xa995('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x34ad6b){logger[_0xa995('0x14')](_0x34ad6b);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(_0x172df3,_0x4a1067,_0x53cdd3,_0x1d3c08){var _0x229bd6={'message':_0x4a1067};_0x229bd6[_0x172df3]=!![];if(_0x53cdd3){_0x229bd6['contact']=_0x53cdd3;}if(_0x1d3c08){_0x229bd6[_0xa995('0x15')]=_0x1d3c08;}return _0x229bd6;}function isEmail(_0x4fc07e){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))*$/[_0xa995('0x16')](_0x4fc07e);}function checkRow(_0x29c1ef,_0xd07d87,_0x435653){return new BPromise(function(_0x195cda,_0x3412b3){if(_['isNil'](_0x29c1ef)){return _0x3412b3(handleCheckRowError(_0xa995('0x14'),_0xa995('0x17'),null,_0x435653));}if(_0x29c1ef[_0xa995('0x18')]&&_0x29c1ef[_0xa995('0x18')]['length']){var _0x3b2adf=_[_0xa995('0x19')](_0x29c1ef['errors'],_0xa995('0x1a'))[_0xa995('0x1b')](';');return _0x3412b3(handleCheckRowError(_0xa995('0x14'),_0x3b2adf,null,_0x435653));}var _0x396f71={};for(var _0x2ee713 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2ee713)&&FIELDS[_0x2ee713]){_0x396f71[_0x2ee713]=_0x29c1ef[_0xa995('0x1c')][0x0][FIELDS[_0x2ee713]]||_0x29c1ef[_0xa995('0x1c')][0x0]['\ufeff'+FIELDS[_0x2ee713]];}}if(!_0x396f71['firstName']){return _0x3412b3(handleCheckRowError(_0xa995('0x14'),'firstName\x20not\x20specified!',null,_0x435653));}if(!_0x396f71['phone']){return _0x3412b3(handleCheckRowError(_0xa995('0x14'),_0xa995('0x1d'),null,_0x435653));}if(_0x396f71[_0xa995('0x1e')]){var _0x77e35a=moment(_0x396f71[_0xa995('0x1e')],_0xa995('0x1f'));if(!_0x77e35a[_0xa995('0x20')]()){return _0x3412b3(handleCheckRowError(_0xa995('0x14'),_0xa995('0x21'),null,_0x435653));}}if(_0x396f71[_0xa995('0x22')]){if(!isEmail(_0x396f71[_0xa995('0x22')])){return _0x3412b3(handleCheckRowError(_0xa995('0x14'),_0xa995('0x23'),null,_0x435653));}}_0x396f71[_0xa995('0x24')]=LISTID;_0x396f71[_0xa995('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa995('0x26')]&&_0xd07d87){var _0x43e048={};for(var _0x581095=0x0,_0x15541d=DUPLICATES[_0xa995('0x26')];_0x581095<_0x15541d;_0x581095+=0x1){_0x43e048[DUPLICATES[_0x581095]]=_0x396f71[DUPLICATES[_0x581095]];}var _0x162e96=_[_0xa995('0x27')](_0xd07d87,_0x43e048);if(_0x162e96){return _0x3412b3(handleCheckRowError(_0xa995('0x28'),_0xa995('0x29'),_0x162e96,_0x435653));}}return db['CmContact'][_0xa995('0x2a')](_0x396f71,{'raw':!![],'hooks':![],'fields':_[_0xa995('0x2b')](_0x396f71)})[_0xa995('0x2c')](function(_0x5e4c93){if(DUPLICATES&&DUPLICATES[_0xa995('0x26')]&&_0xd07d87){_0xd07d87[_0xa995('0x2d')](_['pick'](_0x396f71,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5e4c93['id'];return _0x195cda();})[_0xa995('0x2e')](function(_0x5b98dd){return _0x3412b3(handleCheckRowError('error',_0xa995('0x2f')+(_0x5b98dd[_0xa995('0x1a')]||JSON['stringify'](_0x5b98dd)),null,_0x435653));});});}function checkHopper(){function _0x573d71(){return function(_0x440d46){logger['error'](_0xa995('0x30'),_0xa995('0x31'),util[_0xa995('0x32')](_0x440d46,{'showHidden':![],'depth':null}));};}var _0x383110=function(_0x1522e4,_0x1afb96){var _0x419bcf=squel['insert']()[_0xa995('0x33')](_0xa995('0x34'))['fromQuery']([_0xa995('0x35'),_0xa995('0x36'),'ContactId',_0xa995('0x24'),_0x1afb96,_0xa995('0x37'),_0xa995('0x38')],squel[_0xa995('0x39')]()['field'](_0xa995('0x35'),_0xa995('0x35'))[_0xa995('0x3a')](_0xa995('0x3b'),_0xa995('0x36'))[_0xa995('0x3a')]('id',_0xa995('0x3c'))[_0xa995('0x3a')](LISTID['toString'](),_0xa995('0x24'))[_0xa995('0x3a')](_0x1522e4['id']['toString'](),_0x1afb96)[_0xa995('0x3a')](_0xa995('0x3b'),_0xa995('0x37'))[_0xa995('0x3a')](_0xa995('0x3b'),_0xa995('0x38'))[_0xa995('0x3d')](_0xa995('0x3e'))[_0xa995('0x3f')](_0xa995('0x40'))[_0xa995('0x3f')](_0xa995('0x41'),LISTID['toString']())[_0xa995('0x3f')](_0xa995('0x42'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xa995('0x34'))[_0xa995('0x3f')](_0x1afb96+'\x20=\x20?',_0x1522e4['id'][_0xa995('0x43')]())))[_0xa995('0x43')]();return _0x419bcf;};var _0x5ab591=function(_0x24d71b,_0x42f6c9){var _0x2b14a2=squel['insert']()[_0xa995('0x33')](_0xa995('0x34'))[_0xa995('0x44')]([_0xa995('0x35'),_0xa995('0x36'),_0xa995('0x3c'),_0xa995('0x24'),_0x42f6c9,_0xa995('0x37'),'updatedAt'],squel['select']()[_0xa995('0x3a')]('phone',_0xa995('0x35'))['field'](_0xa995('0x3b'),_0xa995('0x36'))[_0xa995('0x3a')]('id','ContactId')['field'](LISTID[_0xa995('0x43')](),_0xa995('0x24'))['field'](_0x24d71b['id']['toString'](),_0x42f6c9)['field'](_0xa995('0x3b'),_0xa995('0x37'))[_0xa995('0x3a')]('NOW()',_0xa995('0x38'))['from']('cm_contacts')[_0xa995('0x3f')](_0xa995('0x40'))[_0xa995('0x3f')](_0xa995('0x41'),LISTID[_0xa995('0x43')]())[_0xa995('0x3f')](_0xa995('0x45'),squel[_0xa995('0x46')](hopperContacts))[_0xa995('0x3f')](_0xa995('0x42'))[_0xa995('0x3f')](_0xa995('0x47'),squel[_0xa995('0x39')]()[_0xa995('0x3a')](_0xa995('0x48'))[_0xa995('0x3d')](_0xa995('0x49'))[_0xa995('0x3f')](_0x42f6c9+_0xa995('0x4a'),_0x24d71b['id'][_0xa995('0x43')]()))[_0xa995('0x3f')](_0xa995('0x47'),squel[_0xa995('0x39')]()[_0xa995('0x3a')]('phone')[_0xa995('0x3d')](_0xa995('0x34'))[_0xa995('0x3f')](_0x42f6c9+_0xa995('0x4a'),_0x24d71b['id']['toString']())))['toString']();return _0x2b14a2;};function _0x591e02(_0x38b6b0,_0x143145){var _0x283f36=squel[_0xa995('0x4b')]()['into']('cm_hopper')[_0xa995('0x44')]([_0xa995('0x35'),_0xa995('0x36'),_0xa995('0x3c'),_0xa995('0x24'),_0x143145,_0xa995('0x37'),_0xa995('0x38')],squel[_0xa995('0x39')]()[_0xa995('0x3a')](_0xa995('0x35'),_0xa995('0x35'))['field'](_0xa995('0x3b'),_0xa995('0x36'))['field']('id','ContactId')['field'](LISTID[_0xa995('0x43')](),_0xa995('0x24'))['field'](_0x38b6b0['id'][_0xa995('0x43')](),_0x143145)[_0xa995('0x3a')](_0xa995('0x3b'),'createdAt')['field']('NOW()',_0xa995('0x38'))[_0xa995('0x3d')](_0xa995('0x3e'))[_0xa995('0x3f')](_0xa995('0x40'))[_0xa995('0x3f')]('ListId\x20=\x20?',LISTID[_0xa995('0x43')]())[_0xa995('0x3f')]('id\x20IN\x20?',squel[_0xa995('0x46')](hopperContacts))[_0xa995('0x3f')](_0xa995('0x42')))[_0xa995('0x43')]();return _0x283f36;}function _0x4800a5(_0x45063a,_0x3c6ab3){var _0x246f6f=squel[_0xa995('0x4b')]()[_0xa995('0x33')](_0xa995('0x4c'))[_0xa995('0x44')]([_0xa995('0x35'),_0xa995('0x3c'),_0xa995('0x24'),_0x3c6ab3,_0xa995('0x37'),_0xa995('0x38')],squel[_0xa995('0x39')]()[_0xa995('0x3a')](_0xa995('0x35'),'phone')[_0xa995('0x3a')]('id',_0xa995('0x3c'))[_0xa995('0x3a')](LISTID[_0xa995('0x43')](),_0xa995('0x24'))[_0xa995('0x3a')](_0x45063a['id'][_0xa995('0x43')](),_0x3c6ab3)['field']('NOW()',_0xa995('0x37'))[_0xa995('0x3a')](_0xa995('0x3b'),_0xa995('0x38'))['from'](_0xa995('0x3e'))['where'](_0xa995('0x40'))[_0xa995('0x3f')](_0xa995('0x41'),LISTID[_0xa995('0x43')]())[_0xa995('0x3f')](_0xa995('0x45'),squel['str'](hopperContacts))['where'](_0xa995('0x42')))['toString']();return _0x246f6f;}return db[_0xa995('0x4d')][_0xa995('0x4e')]({'where':{'type':_0xa995('0x4f')},'attributes':['id',_0xa995('0x50')],'include':[{'model':db[_0xa995('0x51')],'as':_0xa995('0x52'),'where':{'id':LISTID}}]})[_0xa995('0x2c')](function(_0x204aa0){var _0x422cdc=[];if(_0x204aa0){var _0x4d5e85;for(var _0x21e7fa=0x0,_0x274f9f;_0x21e7fa<_0x204aa0[_0xa995('0x26')];_0x21e7fa+=0x1){_0x274f9f=_0x204aa0[_0x21e7fa][_0xa995('0x53')]({'plain':!![]});switch(_0x274f9f[_0xa995('0x50')]){case _0xa995('0x54'):_0x422cdc[_0xa995('0x2d')](db[_0xa995('0x55')]['query'](_0x5ab591(_0x274f9f,_0xa995('0x56')))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));break;case'onlyIfOpen':_0x422cdc['push'](db[_0xa995('0x55')]['query'](_0x383110(_0x274f9f,'VoiceQueueId'))[_0xa995('0x2c')](function(){})['catch'](_0x573d71()));break;default:_0x422cdc[_0xa995('0x2d')](db[_0xa995('0x55')][_0xa995('0x57')](_0x591e02(_0x274f9f,_0xa995('0x56')))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));}}}return _0x422cdc;})['all']()['then'](function(){return db[_0xa995('0x4d')][_0xa995('0x4e')]({'where':{'type':_0xa995('0x4f')},'attributes':['id'],'include':[{'model':db[_0xa995('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa995('0x2c')](function(_0x3b9ad6){var _0x23fadc=[];if(_0x3b9ad6){var _0x4e786c;for(var _0x468347=0x0,_0x456313;_0x468347<_0x3b9ad6[_0xa995('0x26')];_0x468347+=0x1){_0x456313=_0x3b9ad6[_0x468347]['get']({'plain':!![]});_0x23fadc[_0xa995('0x2d')](db['sequelize'][_0xa995('0x57')](_0x4800a5(_0x456313,_0xa995('0x56')))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));}}return _0x23fadc;})['all']();})[_0xa995('0x2c')](function(){return db['Campaign'][_0xa995('0x4e')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xa995('0x52'),'where':{'id':LISTID}}]})[_0xa995('0x2c')](function(_0x975ae3){var _0x177be7=[];if(_0x975ae3){for(var _0x531f55=0x0,_0x5441b5;_0x531f55<_0x975ae3[_0xa995('0x26')];_0x531f55+=0x1){_0x5441b5=_0x975ae3[_0x531f55]['get']({'plain':!![]});switch(_0x5441b5['dialCheckDuplicateType']){case'always':_0x177be7[_0xa995('0x2d')](db['sequelize'][_0xa995('0x57')](_0x5ab591(_0x5441b5,_0xa995('0x58')))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));break;case _0xa995('0x59'):_0x177be7['push'](db[_0xa995('0x55')][_0xa995('0x57')](_0x383110(_0x5441b5,_0xa995('0x58')))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));break;default:_0x177be7['push'](db[_0xa995('0x55')][_0xa995('0x57')](_0x591e02(_0x5441b5,_0xa995('0x58')))[_0xa995('0x2c')](function(){})['catch'](_0x573d71()));}}}return _0x177be7;})[_0xa995('0x5a')]();})[_0xa995('0x2c')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xa995('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa995('0x2c')](function(_0x2220b8){var _0x8d6993=[];if(_0x2220b8){for(var _0x4e9336=0x0,_0x170fb6;_0x4e9336<_0x2220b8['length'];_0x4e9336+=0x1){_0x170fb6=_0x2220b8[_0x4e9336]['get']({'plain':!![]});_0x8d6993[_0xa995('0x2d')](db[_0xa995('0x55')]['query'](_0x4800a5(_0x170fb6,'CampaignId'))[_0xa995('0x2c')](function(){})[_0xa995('0x2e')](_0x573d71()));}}return _0x8d6993;})[_0xa995('0x5a')]();})[_0xa995('0x2e')](function(_0x572d67){logger[_0xa995('0x14')](_0xa995('0x5b'),_0xa995('0x5c'),_0x572d67[_0xa995('0x1a')]);});}var processPromises=function(_0x348cf1){return BPromise[_0xa995('0x5a')](promises)['then'](function(_0x2e2738){})[_0xa995('0x2e')](function(_0x24b776){logger[_0xa995('0x14')](_0xa995('0x5d'),JSON[_0xa995('0x5e')](_0x24b776));})[_0xa995('0x5f')](function(){socket[_0xa995('0x60')](_0xa995('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x348cf1){return _0x348cf1[_0xa995('0x62')]();}});};var endCsv=function(){return BPromise[_0xa995('0x63')]()[_0xa995('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa995('0x64')](FILEPATH);}catch(_0xbe7f29){logger[_0xa995('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xa995('0x5e')](_0xbe7f29));}finally{process[_0xa995('0x65')](0x0);}});};process['on'](_0xa995('0x66'),function(){logger[_0xa995('0x67')](_0xa995('0x68'));endCsv();});function main(){return BPromise[_0xa995('0x63')]()[_0xa995('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xa995('0x69')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa995('0x2c')](function(_0x32cb4b){var _0x3a88a4=fs[_0xa995('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3a88a4,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd357eb,_0x2b954d){total+=0x1;var _0xeab8ff=total;promises[_0xa995('0x2d')](checkRow(_0xd357eb,_0x32cb4b,_0xeab8ff)[_0xa995('0x2c')](function(){success+=0x1;})[_0xa995('0x2e')](function(_0x4ca663){if(_0x4ca663[_0xa995('0x14')]){errors+=0x1;delete _0x4ca663['error'];}else if(_0x4ca663[_0xa995('0x28')]){duplicates+=0x1;delete _0x4ca663['duplicate'];}rows[_0xa995('0x2d')](_0x4ca663);}));if(total%0xc8===0x0){_0x2b954d[_0xa995('0x6b')]();return processPromises(_0x2b954d);}},'complete':function(){return processPromises()[_0xa995('0x2c')](function(){logger[_0xa995('0x67')](_0xa995('0x6c'));endCsv();});},'error':function(_0x4b4dd1,_0x579e96){logger[_0xa995('0x67')]('CSV\x20parse\x20error',JSON[_0xa995('0x5e')](_0x4b4dd1));endCsv();}});})[_0xa995('0x2e')](function(_0x45cbc0){logger['error'](_0xa995('0x6d'),JSON[_0xa995('0x5e')](_0x45cbc0));});}main(); \ No newline at end of file +var _0x1376=['contact:csv_','resume','resolve','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','field','NOW()','toString','createdAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','always','push','sequelize','VoiceQueueId','onlyIfOpen','query','all','BlackLists','get','Lists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','stringify','finally','emit'];(function(_0x19abc7,_0x5aadb6){var _0xc24f10=function(_0x16dd95){while(--_0x16dd95){_0x19abc7['push'](_0x19abc7['shift']());}};_0xc24f10(++_0x5aadb6);}(_0x1376,0x78));var _0x6137=function(_0x310cb6,_0x5a1c2b){_0x310cb6=_0x310cb6-0x0;var _0x2f3fc4=_0x1376[_0x310cb6];return _0x2f3fc4;};'use strict';var BPromise=require(_0x6137('0x0'));var util=require(_0x6137('0x1'));var _=require(_0x6137('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6137('0x3'));var Redis=require(_0x6137('0x4'));var db=require(_0x6137('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x6137('0x6'))('api');config[_0x6137('0x7')]=_['defaults'](config[_0x6137('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6137('0x7')]));require(_0x6137('0x8'))[_0x6137('0x9')](socket);try{if(!process[_0x6137('0xa')][0x2]||process[_0x6137('0xa')][0x2]===_0x6137('0xb')||process[_0x6137('0xa')][0x2]===_0x6137('0xc')){throw new Error(_0x6137('0xd'));}var FILEPATH=process[_0x6137('0xa')][0x2];if(!process[_0x6137('0xa')][0x3]||process[_0x6137('0xa')][0x3]==='undefined'||process[_0x6137('0xa')][0x3]===_0x6137('0xc')||!process[_0x6137('0xa')][0x4]||process[_0x6137('0xa')][0x4]===_0x6137('0xb')||process[_0x6137('0xa')][0x4]===_0x6137('0xc')){throw new Error(_0x6137('0xe'));}var FIELDS=_[_0x6137('0xf')](process[_0x6137('0xa')][0x3]['split'](','),process[_0x6137('0xa')][0x4][_0x6137('0x10')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x6137('0xb')||process[_0x6137('0xa')][0x5]===_0x6137('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6137('0xa')][0x5];var COMPANYID=process[_0x6137('0xa')][0x6]&&process[_0x6137('0xa')][0x6]!==_0x6137('0xb')&&process[_0x6137('0xa')][0x6]!==_0x6137('0xc')?process[_0x6137('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6137('0xa')][0x7]!==_0x6137('0xb')&&process[_0x6137('0xa')][0x7]!==_0x6137('0xc')?process[_0x6137('0xa')][0x7]:null;if(!process[_0x6137('0xa')][0x8]||process[_0x6137('0xa')][0x8]===_0x6137('0xb')||process[_0x6137('0xa')][0x8]==='null'){throw new Error(_0x6137('0x11'));}var SOCKET_TIMESTAMP=process[_0x6137('0xa')][0x8];}catch(_0x3dca1e){logger[_0x6137('0x12')](_0x3dca1e);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(_0x32baac,_0x4ea969,_0x55bac6,_0x2c956d){var _0x28ad81={'message':_0x4ea969};_0x28ad81[_0x32baac]=!![];if(_0x55bac6){_0x28ad81[_0x6137('0x13')]=_0x55bac6;}if(_0x2c956d){_0x28ad81[_0x6137('0x14')]=_0x2c956d;}return _0x28ad81;}function isEmail(_0x53e6b8){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))*$/[_0x6137('0x15')](_0x53e6b8);}function checkRow(_0x3addf2,_0x3a08a3,_0x3d1bf2){return new BPromise(function(_0x36aaba,_0x4d84bc){if(_[_0x6137('0x16')](_0x3addf2)){return _0x4d84bc(handleCheckRowError(_0x6137('0x12'),_0x6137('0x17'),null,_0x3d1bf2));}if(_0x3addf2[_0x6137('0x18')]&&_0x3addf2[_0x6137('0x18')][_0x6137('0x19')]){var _0x9df14=_[_0x6137('0x1a')](_0x3addf2[_0x6137('0x18')],_0x6137('0x1b'))[_0x6137('0x1c')](';');return _0x4d84bc(handleCheckRowError('error',_0x9df14,null,_0x3d1bf2));}var _0x1093ae={};for(var _0x5c3e1f in FIELDS){if(FIELDS[_0x6137('0x1d')](_0x5c3e1f)&&FIELDS[_0x5c3e1f]){_0x1093ae[_0x5c3e1f]=_0x3addf2['data'][0x0][FIELDS[_0x5c3e1f]]||_0x3addf2['data'][0x0]['\ufeff'+FIELDS[_0x5c3e1f]];}}if(!_0x1093ae[_0x6137('0x1e')]){return _0x4d84bc(handleCheckRowError(_0x6137('0x12'),_0x6137('0x1f'),null,_0x3d1bf2));}if(!_0x1093ae[_0x6137('0x20')]){return _0x4d84bc(handleCheckRowError('error',_0x6137('0x21'),null,_0x3d1bf2));}if(_0x1093ae['birthDate']){var _0x3558d1=moment(_0x1093ae['birthDate'],_0x6137('0x22'));if(!_0x3558d1['isValid']()){return _0x4d84bc(handleCheckRowError(_0x6137('0x12'),_0x6137('0x23'),null,_0x3d1bf2));}}if(_0x1093ae[_0x6137('0x24')]){if(!isEmail(_0x1093ae['email'])){return _0x4d84bc(handleCheckRowError('error',_0x6137('0x25'),null,_0x3d1bf2));}}_0x1093ae[_0x6137('0x26')]=LISTID;_0x1093ae[_0x6137('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3a08a3){var _0x5acd2d={};for(var _0x2980d2=0x0,_0x53602e=DUPLICATES[_0x6137('0x19')];_0x2980d2<_0x53602e;_0x2980d2+=0x1){_0x5acd2d[DUPLICATES[_0x2980d2]]=_0x1093ae[DUPLICATES[_0x2980d2]];}var _0x2abd3e=_[_0x6137('0x28')](_0x3a08a3,_0x5acd2d);if(_0x2abd3e){return _0x4d84bc(handleCheckRowError(_0x6137('0x29'),'Duplicate\x20Contact',_0x2abd3e,_0x3d1bf2));}}return db['CmContact'][_0x6137('0x2a')](_0x1093ae,{'raw':!![],'hooks':![],'fields':_[_0x6137('0x2b')](_0x1093ae)})[_0x6137('0x2c')](function(_0x1b085b){if(DUPLICATES&&DUPLICATES[_0x6137('0x19')]&&_0x3a08a3){_0x3a08a3['push'](_['pick'](_0x1093ae,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1b085b['id'];return _0x36aaba();})[_0x6137('0x2d')](function(_0x3c0be7){return _0x4d84bc(handleCheckRowError(_0x6137('0x12'),_0x6137('0x2e')+(_0x3c0be7['message']||JSON['stringify'](_0x3c0be7)),null,_0x3d1bf2));});});}function checkHopper(){function _0x1b5d5a(){return function(_0x2691fc){logger[_0x6137('0x12')](_0x6137('0x2f'),_0x6137('0x30'),util[_0x6137('0x31')](_0x2691fc,{'showHidden':![],'depth':null}));};}var _0x53394e=function(_0x3f0976,_0x1ac964){var _0x4a4699=squel[_0x6137('0x32')]()[_0x6137('0x33')](_0x6137('0x34'))[_0x6137('0x35')](['phone',_0x6137('0x36'),_0x6137('0x37'),_0x6137('0x26'),_0x1ac964,'createdAt',_0x6137('0x38')],squel['select']()[_0x6137('0x39')](_0x6137('0x20'),_0x6137('0x20'))[_0x6137('0x39')](_0x6137('0x3a'),'scheduledAt')[_0x6137('0x39')]('id',_0x6137('0x37'))[_0x6137('0x39')](LISTID[_0x6137('0x3b')](),_0x6137('0x26'))[_0x6137('0x39')](_0x3f0976['id'][_0x6137('0x3b')](),_0x1ac964)['field'](_0x6137('0x3a'),_0x6137('0x3c'))[_0x6137('0x39')]('NOW()',_0x6137('0x38'))['from'](_0x6137('0x3d'))[_0x6137('0x3e')](_0x6137('0x3f'))[_0x6137('0x3e')](_0x6137('0x40'),LISTID[_0x6137('0x3b')]())[_0x6137('0x3e')](_0x6137('0x41'))[_0x6137('0x3e')](_0x6137('0x42'),squel[_0x6137('0x43')]()['field'](_0x6137('0x20'))['from'](_0x6137('0x34'))[_0x6137('0x3e')](_0x1ac964+'\x20=\x20?',_0x3f0976['id'][_0x6137('0x3b')]())))['toString']();return _0x4a4699;};var _0x1f9554=function(_0x3d3270,_0x158033){var _0xf37157=squel[_0x6137('0x32')]()['into'](_0x6137('0x34'))[_0x6137('0x35')]([_0x6137('0x20'),_0x6137('0x36'),_0x6137('0x37'),_0x6137('0x26'),_0x158033,_0x6137('0x3c'),'updatedAt'],squel[_0x6137('0x43')]()['field'](_0x6137('0x20'),_0x6137('0x20'))['field'](_0x6137('0x3a'),'scheduledAt')[_0x6137('0x39')]('id',_0x6137('0x37'))[_0x6137('0x39')](LISTID[_0x6137('0x3b')](),'ListId')['field'](_0x3d3270['id'][_0x6137('0x3b')](),_0x158033)[_0x6137('0x39')]('NOW()',_0x6137('0x3c'))[_0x6137('0x39')]('NOW()',_0x6137('0x38'))[_0x6137('0x44')](_0x6137('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0x6137('0x3e')](_0x6137('0x40'),LISTID[_0x6137('0x3b')]())['where'](_0x6137('0x45'),squel[_0x6137('0x46')](hopperContacts))['where'](_0x6137('0x41'))[_0x6137('0x3e')](_0x6137('0x42'),squel[_0x6137('0x43')]()[_0x6137('0x39')](_0x6137('0x47'))['from'](_0x6137('0x48'))[_0x6137('0x3e')](_0x158033+_0x6137('0x49'),_0x3d3270['id'][_0x6137('0x3b')]()))[_0x6137('0x3e')](_0x6137('0x42'),squel[_0x6137('0x43')]()[_0x6137('0x39')](_0x6137('0x20'))['from'](_0x6137('0x34'))[_0x6137('0x3e')](_0x158033+_0x6137('0x49'),_0x3d3270['id'][_0x6137('0x3b')]())))[_0x6137('0x3b')]();return _0xf37157;};function _0x1b8e1a(_0x25814d,_0x305cfa){var _0x2c7e3a=squel[_0x6137('0x32')]()[_0x6137('0x33')](_0x6137('0x34'))[_0x6137('0x35')]([_0x6137('0x20'),'scheduledAt',_0x6137('0x37'),_0x6137('0x26'),_0x305cfa,_0x6137('0x3c'),_0x6137('0x38')],squel[_0x6137('0x43')]()[_0x6137('0x39')](_0x6137('0x20'),_0x6137('0x20'))[_0x6137('0x39')](_0x6137('0x3a'),_0x6137('0x36'))[_0x6137('0x39')]('id',_0x6137('0x37'))[_0x6137('0x39')](LISTID[_0x6137('0x3b')](),_0x6137('0x26'))[_0x6137('0x39')](_0x25814d['id'][_0x6137('0x3b')](),_0x305cfa)['field'](_0x6137('0x3a'),_0x6137('0x3c'))['field'](_0x6137('0x3a'),_0x6137('0x38'))[_0x6137('0x44')](_0x6137('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0x6137('0x3e')](_0x6137('0x40'),LISTID[_0x6137('0x3b')]())[_0x6137('0x3e')](_0x6137('0x45'),squel['str'](hopperContacts))[_0x6137('0x3e')](_0x6137('0x41')))[_0x6137('0x3b')]();return _0x2c7e3a;}function _0x1ba8a6(_0xfe2942,_0x5883e8){var _0x59f914=squel[_0x6137('0x32')]()['into'](_0x6137('0x4a'))[_0x6137('0x35')]([_0x6137('0x20'),_0x6137('0x37'),_0x6137('0x26'),_0x5883e8,_0x6137('0x3c'),_0x6137('0x38')],squel['select']()[_0x6137('0x39')](_0x6137('0x20'),'phone')[_0x6137('0x39')]('id',_0x6137('0x37'))[_0x6137('0x39')](LISTID['toString'](),_0x6137('0x26'))[_0x6137('0x39')](_0xfe2942['id'][_0x6137('0x3b')](),_0x5883e8)[_0x6137('0x39')]('NOW()',_0x6137('0x3c'))[_0x6137('0x39')](_0x6137('0x3a'),'updatedAt')[_0x6137('0x44')](_0x6137('0x3d'))[_0x6137('0x3e')](_0x6137('0x3f'))[_0x6137('0x3e')](_0x6137('0x40'),LISTID[_0x6137('0x3b')]())[_0x6137('0x3e')](_0x6137('0x45'),squel['str'](hopperContacts))[_0x6137('0x3e')](_0x6137('0x41')))[_0x6137('0x3b')]();return _0x59f914;}return db[_0x6137('0x4b')][_0x6137('0x4c')]({'where':{'type':_0x6137('0x4d')},'attributes':['id',_0x6137('0x4e')],'include':[{'model':db[_0x6137('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x6137('0x2c')](function(_0x3b5eb8){var _0x3ef8a1=[];if(_0x3b5eb8){var _0x54c7fe;for(var _0x76cce9=0x0,_0x390b02;_0x76cce9<_0x3b5eb8[_0x6137('0x19')];_0x76cce9+=0x1){_0x390b02=_0x3b5eb8[_0x76cce9]['get']({'plain':!![]});switch(_0x390b02[_0x6137('0x4e')]){case _0x6137('0x50'):_0x3ef8a1[_0x6137('0x51')](db[_0x6137('0x52')]['query'](_0x1f9554(_0x390b02,_0x6137('0x53')))[_0x6137('0x2c')](function(){})['catch'](_0x1b5d5a()));break;case _0x6137('0x54'):_0x3ef8a1[_0x6137('0x51')](db[_0x6137('0x52')][_0x6137('0x55')](_0x53394e(_0x390b02,_0x6137('0x53')))['then'](function(){})[_0x6137('0x2d')](_0x1b5d5a()));break;default:_0x3ef8a1[_0x6137('0x51')](db[_0x6137('0x52')][_0x6137('0x55')](_0x1b8e1a(_0x390b02,_0x6137('0x53')))[_0x6137('0x2c')](function(){})[_0x6137('0x2d')](_0x1b5d5a()));}}}return _0x3ef8a1;})[_0x6137('0x56')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x6137('0x4f')],'as':_0x6137('0x57'),'where':{'id':LISTID}}]})[_0x6137('0x2c')](function(_0x17b0e1){var _0x26e62c=[];if(_0x17b0e1){var _0x511f15;for(var _0x3077f9=0x0,_0x3dca3c;_0x3077f9<_0x17b0e1['length'];_0x3077f9+=0x1){_0x3dca3c=_0x17b0e1[_0x3077f9][_0x6137('0x58')]({'plain':!![]});_0x26e62c[_0x6137('0x51')](db[_0x6137('0x52')][_0x6137('0x55')](_0x1ba8a6(_0x3dca3c,'VoiceQueueId'))[_0x6137('0x2c')](function(){})[_0x6137('0x2d')](_0x1b5d5a()));}}return _0x26e62c;})[_0x6137('0x56')]();})[_0x6137('0x2c')](function(){return db['Campaign'][_0x6137('0x4c')]({'attributes':['id',_0x6137('0x4e')],'include':[{'model':db[_0x6137('0x4f')],'as':_0x6137('0x59'),'where':{'id':LISTID}}]})[_0x6137('0x2c')](function(_0x384803){var _0x396681=[];if(_0x384803){for(var _0x2e7bc0=0x0,_0x15b24f;_0x2e7bc0<_0x384803[_0x6137('0x19')];_0x2e7bc0+=0x1){_0x15b24f=_0x384803[_0x2e7bc0][_0x6137('0x58')]({'plain':!![]});switch(_0x15b24f['dialCheckDuplicateType']){case _0x6137('0x50'):_0x396681[_0x6137('0x51')](db['sequelize'][_0x6137('0x55')](_0x1f9554(_0x15b24f,'CampaignId'))['then'](function(){})[_0x6137('0x2d')](_0x1b5d5a()));break;case _0x6137('0x54'):_0x396681[_0x6137('0x51')](db[_0x6137('0x52')][_0x6137('0x55')](_0x53394e(_0x15b24f,'CampaignId'))[_0x6137('0x2c')](function(){})[_0x6137('0x2d')](_0x1b5d5a()));break;default:_0x396681[_0x6137('0x51')](db['sequelize'][_0x6137('0x55')](_0x1b8e1a(_0x15b24f,_0x6137('0x5a')))[_0x6137('0x2c')](function(){})[_0x6137('0x2d')](_0x1b5d5a()));}}}return _0x396681;})[_0x6137('0x56')]();})[_0x6137('0x2c')](function(){return db[_0x6137('0x5b')][_0x6137('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x6137('0x4f')],'as':_0x6137('0x57'),'where':{'id':LISTID}}]})[_0x6137('0x2c')](function(_0x59fd57){var _0x488828=[];if(_0x59fd57){for(var _0x4367e6=0x0,_0x40430f;_0x4367e6<_0x59fd57[_0x6137('0x19')];_0x4367e6+=0x1){_0x40430f=_0x59fd57[_0x4367e6][_0x6137('0x58')]({'plain':!![]});_0x488828['push'](db[_0x6137('0x52')][_0x6137('0x55')](_0x1ba8a6(_0x40430f,_0x6137('0x5a')))[_0x6137('0x2c')](function(){})[_0x6137('0x2d')](_0x1b5d5a()));}}return _0x488828;})[_0x6137('0x56')]();})['catch'](function(_0x5a713c){logger['error'](_0x6137('0x5c'),'generalCheckHopper',_0x5a713c[_0x6137('0x1b')]);});}var processPromises=function(_0x185070){return BPromise[_0x6137('0x56')](promises)['then'](function(_0x28f23e){})[_0x6137('0x2d')](function(_0x3117e8){logger[_0x6137('0x12')]('Error\x20processing\x20rows\x20block:',JSON[_0x6137('0x5d')](_0x3117e8));})[_0x6137('0x5e')](function(){socket[_0x6137('0x5f')](_0x6137('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x185070){return _0x185070[_0x6137('0x61')]();}});};var endCsv=function(){return BPromise[_0x6137('0x62')]()[_0x6137('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x6137('0x2c')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5b345c){logger[_0x6137('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x6137('0x5d')](_0x5b345c));}finally{process[_0x6137('0x63')](0x0);}});};process['on'](_0x6137('0x64'),function(){logger[_0x6137('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x6137('0x62')]()[_0x6137('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0x6137('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6137('0x2c')](function(_0x3b90b0){var _0x309941=fs[_0x6137('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6137('0x67')](_0x309941,{'header':!![],'skipEmptyLines':!![],'step':function(_0x271630,_0x3adf3c){total+=0x1;var _0x5513a5=total;promises['push'](checkRow(_0x271630,_0x3b90b0,_0x5513a5)[_0x6137('0x2c')](function(){success+=0x1;})[_0x6137('0x2d')](function(_0x57fcd2){if(_0x57fcd2[_0x6137('0x12')]){errors+=0x1;delete _0x57fcd2[_0x6137('0x12')];}else if(_0x57fcd2['duplicate']){duplicates+=0x1;delete _0x57fcd2[_0x6137('0x29')];}rows[_0x6137('0x51')](_0x57fcd2);}));if(total%0xc8===0x0){_0x3adf3c[_0x6137('0x68')]();return processPromises(_0x3adf3c);}},'complete':function(){return processPromises()[_0x6137('0x2c')](function(){logger['info'](_0x6137('0x69'));endCsv();});},'error':function(_0x43520b,_0x452dac){logger[_0x6137('0x65')](_0x6137('0x6a'),JSON['stringify'](_0x43520b));endCsv();}});})[_0x6137('0x2d')](function(_0x2bee21){logger['error'](_0x6137('0x6b'),JSON[_0x6137('0x5d')](_0x2bee21));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index e22f49b..8e422b4 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 _0x1415=['argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','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?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.id','cm_hopper_black','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','spread','main','stringify','start','binding','socket_timestamp','root','.csv','header','writeFileSync','parse','data','length','errors','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','Abort\x20parser','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','contact:import:','complete'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x1415,0x199));var _0x5141=function(_0x51cd4b,_0x39f2d4){_0x51cd4b=_0x51cd4b-0x0;var _0x22f671=_0x1415[_0x51cd4b];return _0x22f671;};'use strict';var fs=require('fs');var path=require(_0x5141('0x0'));var _=require(_0x5141('0x1'));var Papa=require(_0x5141('0x2'));var util=require(_0x5141('0x3'));var BPromise=require(_0x5141('0x4'));var moment=require(_0x5141('0x5'));var squel=require(_0x5141('0x6'));var Redis=require(_0x5141('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x5141('0x8'));var logger=require('../../../config/logger')('import');config[_0x5141('0x9')]=_['defaults'](config[_0x5141('0x9')],{'host':_0x5141('0xa'),'port':0x18eb});var socket=require(_0x5141('0xb'))(new Redis(config[_0x5141('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3e6d12){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))*$/[_0x5141('0xc')](_0x3e6d12);}function selectNotIn(_0xaf6085,_0x31ba39,_0x4eb9e5,_0xc9c98d,_0x438196){return squel[_0x5141('0xd')]()[_0x5141('0xe')](_0x5141('0xf'))[_0x5141('0x10')](_0xc9c98d)[_0x5141('0x11')](_0x31ba39,null,_0x31ba39+'.id\x20=\x20'+_0xc9c98d+'.'+_0x4eb9e5)[_0x5141('0x12')](_0xc9c98d+'.'+_0x4eb9e5+_0x5141('0x13')+_0xaf6085+'.'+_0x4eb9e5)[_0x5141('0x12')](_0x31ba39+_0x5141('0x14')+_0x438196[_0x5141('0x11')]()+')');}function insertCmHopper(_0x471a75,_0x5e2334,_0x4af56b,_0x3a6089,_0x1e6e2f){var _0x265e0f=['cm_contacts.phone',_0x5141('0x15'),'cm_contacts.id',_0x5141('0x16'),_0x5e2334+'.'+_0x3a6089,_0x5141('0x17'),_0x5141('0x18'),'cm_contacts.priority',_0x5141('0x19'),'\x22'+_0x1e6e2f+'\x22'];return squel[_0x5141('0x1a')]()[_0x5141('0x1b')]('cm_hopper')[_0x5141('0x1c')](['phone',_0x5141('0x1d'),_0x5141('0x1e'),_0x5141('0x1f'),_0x3a6089,_0x5141('0x20'),_0x5141('0x21'),_0x5141('0x22'),_0x5141('0x23'),_0x5141('0x24')],squel['select']()[_0x5141('0x25')](_0x265e0f)[_0x5141('0x10')](_0x5e2334)[_0x5141('0x11')](_0x5141('0x26'),null,_0x5141('0x27')+_0x5e2334+_0x5141('0x28'))['join'](_0x4af56b,null,_0x4af56b+_0x5141('0x29')+_0x5e2334+'.'+_0x3a6089)[_0x5141('0x12')](_0x5e2334+_0x5141('0x2a'),_0x471a75)[_0x5141('0x12')](_0x5141('0x2b'),NOW)['where'](_0x5141('0x2c'),selectNotIn(_0x5e2334,_0x4af56b,_0x3a6089,_0x5141('0x2d'),[_0x5141('0x2e'),_0x5141('0x2f')]))[_0x5141('0x12')](_0x5141('0x2c'),selectNotIn(_0x5e2334,_0x4af56b,_0x3a6089,_0x5141('0x2d'),[_0x5141('0x2e')])))[_0x5141('0x30')]();}function insertCmHopperBlack(_0x66055d,_0x21251d,_0x6ab226,_0x221ffd){var _0x4d6629=[_0x5141('0x31'),_0x5141('0x32'),'cm_contacts.ListId',_0x21251d+'.'+_0x221ffd,'cm_contacts.createdAt',_0x5141('0x18')];return squel[_0x5141('0x1a')]()[_0x5141('0x1b')](_0x5141('0x33'))['fromQuery']([_0x5141('0xf'),_0x5141('0x1e'),'ListId',_0x221ffd,_0x5141('0x20'),_0x5141('0x21')],squel[_0x5141('0xd')]()[_0x5141('0x25')](_0x4d6629)[_0x5141('0x10')](_0x21251d)[_0x5141('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x21251d+_0x5141('0x28'))['join'](_0x6ab226,null,_0x6ab226+_0x5141('0x29')+_0x21251d+'.'+_0x221ffd)['where'](_0x21251d+_0x5141('0x2a'),_0x66055d)[_0x5141('0x12')](_0x5141('0x2b'),NOW)[_0x5141('0x12')](_0x5141('0x2c'),squel[_0x5141('0xd')]()[_0x5141('0xe')](_0x5141('0xf'))[_0x5141('0x10')](_0x5141('0x33'))['where']('ListId\x20=\x20?',_0x66055d)[_0x5141('0x12')](_0x221ffd+_0x5141('0x34'),_0x21251d+'.'+_0x221ffd)))[_0x5141('0x30')]();}function insertCmContact(_0x3d31e9,_0x51fdc1,_0x36ee15,_0x5b5c3d){var _0x5eb9ad=_[_0x5141('0x35')](_[_0x5141('0x36')](_0x5b5c3d),[_0x5141('0x1f'),'CompanyId',_0x5141('0x20'),_0x5141('0x21')]);return squel[_0x5141('0x1a')]()[_0x5141('0x1b')](_0x5141('0x26'))['fromQuery'](_0x5eb9ad,squel[_0x5141('0xd')]()[_0x5141('0x25')](_0x5eb9ad)[_0x5141('0x10')](_0x51fdc1)[_0x5141('0x12')]('('+_0x36ee15[_0x5141('0x11')](',')+_0x5141('0x37'),squel['select']()[_0x5141('0x25')](_0x36ee15)[_0x5141('0x10')](_0x5141('0x26'))['where']('ListId\x20=\x20?',_0x3d31e9))['where'](_0x5141('0x38'),squel['select']()[_0x5141('0xe')](_0x5141('0x39'),_0x5141('0x3a'))[_0x5141('0x10')](_0x51fdc1)[_0x5141('0x3b')](_0x36ee15[_0x5141('0x11')](','))))[_0x5141('0x30')]();}function handleStop(){logger[_0x5141('0x3c')](_0x5141('0x3d'));stopped=!![];}function handleUncaughtException(_0x32740a){logger[_0x5141('0x3e')](_0x32740a[_0x5141('0x3f')]);process[_0x5141('0x40')](0x1);}function handleError(_0x1fce6c,_0x5d5eaf){stats['errors'][_0x5141('0x41')]({'name':_0x5d5eaf[_0x5141('0x42')],'message':_0x5d5eaf[_0x5141('0x3f')],'row':_0x1fce6c});}function handleQuery(_0x1f227b){logger[_0x5141('0x3c')](_0x1f227b);return db[_0x5141('0x43')]['query'](_0x1f227b)[_0x5141('0x44')](function(_0x10945f){results['push'](_0x10945f);})['catch'](function(_0x72be7d){logger[_0x5141('0x3e')](_0x72be7d[_0x5141('0x3f')]);});}function main(_0x298b19,_0x3212a0,_0x333095,_0x1c8037){logger[_0x5141('0x3c')](_0x5141('0x45'),_0x298b19,JSON[_0x5141('0x46')](_0x3212a0));process['send'](_0x5141('0x47'));var _0x4989c0=_0x3212a0[_0x5141('0x48')];var _0x436039=_0x3212a0[_0x5141('0x49')];var _0x15d67d=path[_0x5141('0x11')](config[_0x5141('0x4a')],'server/files/tmp',_0x436039+_0x5141('0x4b'));var _0x1c6988=_[_0x5141('0x36')](_0x4989c0)[_0x5141('0x11')]();logger[_0x5141('0x3c')](_0x5141('0x4c'),_0x1c6988);fs[_0x5141('0x4d')](_0x15d67d,_0x1c6988+'\x0a');Papa[_0x5141('0x4e')](fs['createReadStream'](_0x298b19),{'header':!![],'skipEmptyLines':!![],'step':function(_0x297070,_0x2291c5){try{for(var _0x3d1b99=0x0,_0x2cb84d=[];_0x3d1b99<_0x297070[_0x5141('0x4f')][_0x5141('0x50')];_0x3d1b99++){stats['rows']+=0x1;if(_0x297070[_0x5141('0x51')][_0x3d1b99]){handleError(_0x297070[_0x5141('0x4f')][_0x3d1b99],_0x297070[_0x5141('0x51')][_0x3d1b99]);}else{var _0x5efeb7=[];for(var _0x409093 in _0x4989c0){if(_0x4989c0['hasOwnProperty'](_0x409093)){if(_0x297070[_0x5141('0x4f')][_0x3d1b99][_0x4989c0[_0x409093]]){var _0x4548c6=_[_0x5141('0x52')](_0x297070[_0x5141('0x4f')][_0x3d1b99][_0x4989c0[_0x409093]]['replace'](/"/g,'\x27'));switch(_0x409093){case _0x5141('0x1d'):var _0x70e9a2=moment(_0x4548c6,_0x5141('0x53'),!![]);if(_0x70e9a2[_0x5141('0x54')]()){_0x2cb84d[_0x5141('0x41')]('\x22'+_0x4548c6+'\x22');}else{_0x5efeb7['push'](_0x5141('0x55'));}break;case _0x5141('0x22'):var _0x112739=parseInt(_0x4548c6);_0x4548c6=_['isNaN'](_0x112739)||_0x112739<0x0||_0x112739>0x4?_0x1c8037?0x3:0x2:_0x112739;_0x2cb84d['push']('\x22'+_0x4548c6+'\x22');break;case'UserId':var _0x547497=parseInt(_0x4548c6);if(_[_0x5141('0x56')](_0x547497)&&_['includes'](_0x333095,_0x547497)){_0x2cb84d[_0x5141('0x41')]('\x22'+_0x547497+'\x22');}else{_0x5efeb7[_0x5141('0x41')](_0x5141('0x57'));}break;case _0x5141('0x58'):if(isEmail(_0x4548c6)){_0x2cb84d[_0x5141('0x41')]('\x22'+_0x4548c6+'\x22');}else{_0x5efeb7[_0x5141('0x41')](_0x5141('0x59'));}break;case _0x5141('0x5a'):var _0x43d6db=moment(_0x4548c6,_0x5141('0x5b'),!![]);if(_0x43d6db[_0x5141('0x54')]()){_0x2cb84d[_0x5141('0x41')]('\x22'+_0x4548c6+'\x22');}else{_0x5efeb7[_0x5141('0x41')](_0x5141('0x5c'));}break;default:_0x2cb84d[_0x5141('0x41')]('\x22'+_0x4548c6+'\x22');}}else{switch(_0x409093){case _0x5141('0x5d'):case'phone':_0x5efeb7[_0x5141('0x41')](_0x409093+_0x5141('0x5e'));break;default:_0x2cb84d[_0x5141('0x41')]('\x22\x22');}}}}if(_0x5efeb7[_0x5141('0x50')]){handleError(_0x297070[_0x5141('0x4f')][_0x3d1b99],{'code':_0x5141('0x5f'),'message':_0x5efeb7[_0x5141('0x11')]()});}else{fs[_0x5141('0x60')](_0x15d67d,_0x2cb84d[_0x5141('0x11')]()+'\x0a');}_0x2cb84d=[];}if(!(stats[_0x5141('0x61')]%0xc8)){socket['emit']('contact:import:'+_0x436039,stats);stats[_0x5141('0x51')]=[];}}if(stopped){logger['info'](_0x5141('0x62'));_0x2291c5['abort']();}}catch(_0x132b9b){handleError(_0x297070[_0x5141('0x4f')][_0x3d1b99],{'code':'SystemError','message':_0x132b9b[_0x5141('0x3f')]});logger[_0x5141('0x3e')]('step',_0x132b9b[_0x5141('0x3f')]);}},'complete':function(){try{var _0x1665ff=[];var _0x3ba4a8='cm_contacts';if(_0x3212a0[_0x5141('0x63')]&&_0x3212a0[_0x5141('0x63')][_0x5141('0x50')]){_0x3ba4a8=_0x5141('0x64')+_0x436039;_0x1665ff['push'](_0x5141('0x65')+_0x3ba4a8+_0x5141('0x66'));}var _0x184c05=util[_0x5141('0x67')](_0x5141('0x68'),_0x15d67d,_0x3ba4a8,_0x1c6988,_0x3212a0['ListId'],_0x3212a0[_0x5141('0x69')]||null,NOW,NOW);if(_['isNil'](_0x4989c0[_0x5141('0x1d')])){_0x184c05+=_0x5141('0x6a');}_0x1665ff[_0x5141('0x41')](_0x184c05);if(_0x3212a0['duplicates']&&_0x3212a0[_0x5141('0x63')][_0x5141('0x50')]){_0x1665ff['push'](insertCmContact(_0x3212a0[_0x5141('0x1f')],_0x3ba4a8,_0x3212a0[_0x5141('0x63')],_0x4989c0));_0x1665ff['push'](_0x5141('0x6b')+_0x3ba4a8+';');}_0x1665ff[_0x5141('0x41')](insertCmHopper(_0x3212a0[_0x5141('0x1f')],_0x5141('0x6c'),'voice_queues',_0x5141('0x6d'),_0x1c8037));_0x1665ff[_0x5141('0x41')](insertCmHopperBlack(_0x3212a0[_0x5141('0x1f')],_0x5141('0x6e'),_0x5141('0x6f'),_0x5141('0x6d')));_0x1665ff[_0x5141('0x41')](insertCmHopper(_0x3212a0[_0x5141('0x1f')],_0x5141('0x70'),_0x5141('0x71'),_0x5141('0x72'),_0x1c8037));_0x1665ff[_0x5141('0x41')](insertCmHopperBlack(_0x3212a0[_0x5141('0x1f')],_0x5141('0x73'),'campaigns','CampaignId'));BPromise[_0x5141('0x74')](_0x1665ff,handleQuery)[_0x5141('0x75')](function(_0x3dcc37){stats[_0x5141('0x76')]=!![];stats['affectedRows']=_0x3212a0[_0x5141('0x63')]&&_0x3212a0[_0x5141('0x63')][_0x5141('0x50')]?results[0x2][_0x5141('0x77')]:results[0x0][_0x5141('0x77')];socket[_0x5141('0x78')](_0x5141('0x79')+_0x436039,stats);fs['unlink'](_0x298b19);fs['unlink'](_0x15d67d);process[_0x5141('0x40')](0x0);})['catch'](function(_0x181d54){logger[_0x5141('0x3e')](_0x181d54['message']);process[_0x5141('0x40')](0x1);});}catch(_0x33e2aa){logger['error'](_0x5141('0x7a'),_0x33e2aa['message']);process[_0x5141('0x40')](0x1);}},'error':function(_0xc114db,_0x2ad9ea,_0xc1365c,_0x505386){throw new Error(_0x505386);}});}function validate(){if(process[_0x5141('0x7b')]&&process[_0x5141('0x7b')]['length']<0x4){throw new Error(_0x5141('0x7c'));}var _0x155bab=path[_0x5141('0x11')](config['root'],_0x5141('0x7d'),process[_0x5141('0x7b')][0x2]);if(!fs[_0x5141('0x7e')](_0x155bab)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2b2a44={};try{_0x2b2a44=JSON['parse'](process[_0x5141('0x7b')][0x3]);if(!_0x2b2a44[_0x5141('0x48')]){throw new Error(_0x5141('0x7f'));}if(!_0x2b2a44[_0x5141('0x48')][_0x5141('0xf')]){throw new Error(_0x5141('0x80'));}if(!_0x2b2a44[_0x5141('0x48')][_0x5141('0x5d')]){throw new Error(_0x5141('0x81'));}var _0x3e115f=0x0;if(_0x2b2a44[_0x5141('0x48')][_0x5141('0x23')]){_0x3e115f=0x1;}if(!_0x2b2a44[_0x5141('0x1f')]){throw new Error(_0x5141('0x82'));}}catch(_0x66ae6e){throw new Error(_0x5141('0x83'));}var _0x339486=[];try{_0x339486=_['map'](JSON[_0x5141('0x4e')](process[_0x5141('0x7b')][0x4]),'id');}catch(_0x920eae){logger[_0x5141('0x3c')]('No\x20agent\x20available');}main(_0x155bab,_0x2b2a44,_0x339486,_0x3e115f);}validate();process['on']('SIGINT',handleStop);process['on'](_0x5141('0x84'),handleUncaughtException); \ No newline at end of file +var _0x6b7e=['cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','code','catch','main','stringify','start','binding','socket_timestamp','root','.csv','header','writeFileSync','parse','createReadStream','length','errors','data','hasOwnProperty','replace','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','rows','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','map','SIGINT','path','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt'];(function(_0x106a09,_0x553105){var _0x19c973=function(_0x225b05){while(--_0x225b05){_0x106a09['push'](_0x106a09['shift']());}};_0x19c973(++_0x553105);}(_0x6b7e,0x68));var _0xe6b7=function(_0x51a91f,_0x50fc2f){_0x51a91f=_0x51a91f-0x0;var _0x57626b=_0x6b7e[_0x51a91f];return _0x57626b;};'use strict';var fs=require('fs');var path=require(_0xe6b7('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xe6b7('0x1'));var moment=require(_0xe6b7('0x2'));var squel=require(_0xe6b7('0x3'));var Redis=require('ioredis');var db=require(_0xe6b7('0x4'))['db'];var config=require(_0xe6b7('0x5'));var logger=require(_0xe6b7('0x6'))(_0xe6b7('0x7'));config['redis']=_[_0xe6b7('0x8')](config[_0xe6b7('0x9')],{'host':_0xe6b7('0xa'),'port':0x18eb});var socket=require(_0xe6b7('0xb'))(new Redis(config[_0xe6b7('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xe6b7('0xc')](_0xe6b7('0xd'));function isEmail(_0x23df3f){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))*$/[_0xe6b7('0xe')](_0x23df3f);}function selectNotIn(_0x4901d1,_0x2fdd92,_0x57c59c,_0x3437d5,_0x56b659){return squel[_0xe6b7('0xf')]()[_0xe6b7('0x10')](_0xe6b7('0x11'))[_0xe6b7('0x12')](_0x3437d5)[_0xe6b7('0x13')](_0x2fdd92,null,_0x2fdd92+_0xe6b7('0x14')+_0x3437d5+'.'+_0x57c59c)[_0xe6b7('0x15')](_0x3437d5+'.'+_0x57c59c+'\x20=\x20'+_0x4901d1+'.'+_0x57c59c)['where'](_0x2fdd92+_0xe6b7('0x16')+_0x56b659['join']()+')');}function insertCmHopper(_0x22625a,_0x5d5bc6,_0x28aee2,_0x1b180f,_0x26fbc){var _0x39eff2=[_0xe6b7('0x17'),_0xe6b7('0x18'),_0xe6b7('0x19'),_0xe6b7('0x1a'),_0x5d5bc6+'.'+_0x1b180f,_0xe6b7('0x1b'),_0xe6b7('0x1c'),_0xe6b7('0x1d'),_0xe6b7('0x1e'),'\x22'+_0x26fbc+'\x22'];return squel[_0xe6b7('0x1f')]()[_0xe6b7('0x20')](_0xe6b7('0x21'))[_0xe6b7('0x22')](['phone',_0xe6b7('0x23'),_0xe6b7('0x24'),'ListId',_0x1b180f,_0xe6b7('0x25'),_0xe6b7('0x26'),_0xe6b7('0x27'),'UserId','recallme'],squel[_0xe6b7('0xf')]()[_0xe6b7('0x28')](_0x39eff2)[_0xe6b7('0x12')](_0x5d5bc6)['join'](_0xe6b7('0x29'),null,_0xe6b7('0x2a')+_0x5d5bc6+_0xe6b7('0x2b'))[_0xe6b7('0x13')](_0x28aee2,null,_0x28aee2+'.id\x20=\x20'+_0x5d5bc6+'.'+_0x1b180f)[_0xe6b7('0x15')](_0x5d5bc6+'.CmListId\x20=\x20?',_0x22625a)[_0xe6b7('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe6b7('0x15')](_0xe6b7('0x2c'),selectNotIn(_0x5d5bc6,_0x28aee2,_0x1b180f,_0xe6b7('0x21'),[_0xe6b7('0x2d'),_0xe6b7('0x2e')]))[_0xe6b7('0x15')](_0xe6b7('0x2c'),selectNotIn(_0x5d5bc6,_0x28aee2,_0x1b180f,_0xe6b7('0x21'),[_0xe6b7('0x2d')])))[_0xe6b7('0x2f')]();}function insertCmHopperBlack(_0x11afd3,_0x3664d3,_0x44030d,_0x361f20){var _0x15eecd=[_0xe6b7('0x17'),_0xe6b7('0x19'),'cm_contacts.ListId',_0x3664d3+'.'+_0x361f20,_0xe6b7('0x1b'),_0xe6b7('0x1c')];return squel[_0xe6b7('0x1f')]()['into'](_0xe6b7('0x30'))[_0xe6b7('0x22')](['phone',_0xe6b7('0x24'),_0xe6b7('0x31'),_0x361f20,_0xe6b7('0x25'),_0xe6b7('0x26')],squel['select']()[_0xe6b7('0x28')](_0x15eecd)[_0xe6b7('0x12')](_0x3664d3)[_0xe6b7('0x13')](_0xe6b7('0x29'),null,_0xe6b7('0x2a')+_0x3664d3+_0xe6b7('0x2b'))[_0xe6b7('0x13')](_0x44030d,null,_0x44030d+_0xe6b7('0x14')+_0x3664d3+'.'+_0x361f20)[_0xe6b7('0x15')](_0x3664d3+'.CmListId\x20=\x20?',_0x11afd3)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe6b7('0x15')](_0xe6b7('0x2c'),squel[_0xe6b7('0xf')]()[_0xe6b7('0x10')](_0xe6b7('0x11'))[_0xe6b7('0x12')](_0xe6b7('0x30'))['where'](_0xe6b7('0x32'),_0x11afd3)[_0xe6b7('0x15')](_0x361f20+_0xe6b7('0x33'),_0x3664d3+'.'+_0x361f20)))['toString']();}function insertCmContact(_0x118a65,_0x3c3836,_0x58ee32,_0x4fc793){var _0x2cc5a1=_[_0xe6b7('0x34')](_[_0xe6b7('0x35')](_0x4fc793),[_0xe6b7('0x31'),'CompanyId',_0xe6b7('0x25'),_0xe6b7('0x26')]);return squel['insert']()[_0xe6b7('0x20')](_0xe6b7('0x29'))[_0xe6b7('0x22')](_0x2cc5a1,squel[_0xe6b7('0xf')]()['fields'](_0x2cc5a1)[_0xe6b7('0x12')](_0x3c3836)[_0xe6b7('0x15')]('('+_0x58ee32[_0xe6b7('0x13')](',')+_0xe6b7('0x36'),squel['select']()[_0xe6b7('0x28')](_0x58ee32)[_0xe6b7('0x12')](_0xe6b7('0x29'))['where'](_0xe6b7('0x32'),_0x118a65))['where'](_0xe6b7('0x37'),squel['select']()[_0xe6b7('0x10')](_0xe6b7('0x38'),_0xe6b7('0x39'))['from'](_0x3c3836)[_0xe6b7('0x3a')](_0x58ee32[_0xe6b7('0x13')](','))))[_0xe6b7('0x2f')]();}function handleStop(){logger[_0xe6b7('0x3b')](_0xe6b7('0x3c'));stopped=!![];}function handleUncaughtException(_0x29b783){logger[_0xe6b7('0x3d')](_0x29b783[_0xe6b7('0x3e')]);process['exit'](0x1);}function handleError(_0x2534a7,_0x136f1e){stats['errors']['push']({'name':_0x136f1e[_0xe6b7('0x3f')],'message':_0x136f1e[_0xe6b7('0x3e')],'row':_0x2534a7});}function handleQuery(_0x433b0e){logger[_0xe6b7('0x3b')](_0x433b0e);return db['sequelize']['query'](_0x433b0e)['spread'](function(_0x4a0199){results['push'](_0x4a0199);})[_0xe6b7('0x40')](function(_0xf0ad35){logger[_0xe6b7('0x3d')](_0xf0ad35[_0xe6b7('0x3e')]);});}function main(_0x15e62e,_0x3691a4,_0x5d536d,_0x40a492){logger[_0xe6b7('0x3b')](_0xe6b7('0x41'),_0x15e62e,JSON[_0xe6b7('0x42')](_0x3691a4));process['send'](_0xe6b7('0x43'));var _0x50642f=_0x3691a4[_0xe6b7('0x44')];var _0x22fd2c=_0x3691a4[_0xe6b7('0x45')];var _0x426777=path[_0xe6b7('0x13')](config[_0xe6b7('0x46')],'server/files/tmp',_0x22fd2c+_0xe6b7('0x47'));var _0x3476de=_[_0xe6b7('0x35')](_0x50642f)['join']();logger['info'](_0xe6b7('0x48'),_0x3476de);fs[_0xe6b7('0x49')](_0x426777,_0x3476de+'\x0a');Papa[_0xe6b7('0x4a')](fs[_0xe6b7('0x4b')](_0x15e62e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x58c442,_0x5ebcc7){try{for(var _0x126426=0x0,_0x22cdc2=[];_0x126426<_0x58c442['data'][_0xe6b7('0x4c')];_0x126426++){stats['rows']+=0x1;if(_0x58c442[_0xe6b7('0x4d')][_0x126426]){handleError(_0x58c442[_0xe6b7('0x4e')][_0x126426],_0x58c442[_0xe6b7('0x4d')][_0x126426]);}else{var _0x5830cd=[];for(var _0x36ea03 in _0x50642f){if(_0x50642f[_0xe6b7('0x4f')](_0x36ea03)){if(_0x58c442[_0xe6b7('0x4e')][_0x126426][_0x50642f[_0x36ea03]]){var _0x167968=_['trim'](_0x58c442[_0xe6b7('0x4e')][_0x126426][_0x50642f[_0x36ea03]][_0xe6b7('0x50')](/"/g,'\x27'));switch(_0x36ea03){case _0xe6b7('0x23'):var _0x143938=moment(_0x167968,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x143938['isValid']()){_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x167968+'\x22');}else{_0x5830cd[_0xe6b7('0x51')](_0xe6b7('0x52'));}break;case _0xe6b7('0x27'):var _0xc8ae40=parseInt(_0x167968);_0x167968=_[_0xe6b7('0x53')](_0xc8ae40)||_0xc8ae40<0x0||_0xc8ae40>0x4?_0x40a492?0x3:0x2:_0xc8ae40;_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x167968+'\x22');break;case'UserId':var _0x4fdf7b=parseInt(_0x167968);if(_[_0xe6b7('0x54')](_0x4fdf7b)&&_['includes'](_0x5d536d,_0x4fdf7b)){_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x4fdf7b+'\x22');}else{_0x5830cd[_0xe6b7('0x51')](_0xe6b7('0x55'));}break;case _0xe6b7('0x56'):if(isEmail(_0x167968)){_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x167968+'\x22');}else{_0x5830cd[_0xe6b7('0x51')]('email\x20wrong\x20format');}break;case _0xe6b7('0x57'):var _0x4cadca=moment(_0x167968,_0xe6b7('0x58'),!![]);if(_0x4cadca[_0xe6b7('0x59')]()){_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x167968+'\x22');}else{_0x5830cd[_0xe6b7('0x51')](_0xe6b7('0x5a'));}break;default:_0x22cdc2[_0xe6b7('0x51')]('\x22'+_0x167968+'\x22');}}else{switch(_0x36ea03){case _0xe6b7('0x5b'):case'phone':_0x5830cd['push'](_0x36ea03+_0xe6b7('0x5c'));break;default:_0x22cdc2[_0xe6b7('0x51')]('\x22\x22');}}}}if(_0x5830cd['length']){handleError(_0x58c442[_0xe6b7('0x4e')][_0x126426],{'code':'SystemRow','message':_0x5830cd[_0xe6b7('0x13')]()});}else{fs[_0xe6b7('0x5d')](_0x426777,_0x22cdc2['join']()+'\x0a');}_0x22cdc2=[];}if(!(stats[_0xe6b7('0x5e')]%0xc8)){socket[_0xe6b7('0x5f')](_0xe6b7('0x60')+_0x22fd2c,stats);stats[_0xe6b7('0x4d')]=[];}}if(stopped){logger[_0xe6b7('0x3b')](_0xe6b7('0x61'));_0x5ebcc7['abort']();}}catch(_0x271068){handleError(_0x58c442['data'][_0x126426],{'code':'SystemError','message':_0x271068[_0xe6b7('0x3e')]});logger['error'](_0xe6b7('0x62'),_0x271068[_0xe6b7('0x3e')]);}},'complete':function(){try{var _0xc82777=[];var _0x26b2d8='cm_contacts';if(_0x3691a4[_0xe6b7('0x63')]&&_0x3691a4[_0xe6b7('0x63')]['length']){_0x26b2d8=_0xe6b7('0x64')+_0x22fd2c;_0xc82777[_0xe6b7('0x51')](_0xe6b7('0x65')+_0x26b2d8+_0xe6b7('0x66'));}var _0x138288=util[_0xe6b7('0xc')](_0xe6b7('0x67'),_0x426777,_0x26b2d8,_0x3476de,_0x3691a4['ListId'],_0x3691a4[_0xe6b7('0x68')]||null,NOW,NOW);if(_[_0xe6b7('0x69')](_0x50642f[_0xe6b7('0x23')])){_0x138288+=_0xe6b7('0x6a');}_0xc82777[_0xe6b7('0x51')](_0x138288);if(_0x3691a4[_0xe6b7('0x63')]&&_0x3691a4['duplicates'][_0xe6b7('0x4c')]){_0xc82777[_0xe6b7('0x51')](insertCmContact(_0x3691a4['ListId'],_0x26b2d8,_0x3691a4[_0xe6b7('0x63')],_0x50642f));_0xc82777[_0xe6b7('0x51')]('DROP\x20TABLE\x20'+_0x26b2d8+';');}_0xc82777['push'](insertCmHopper(_0x3691a4['ListId'],'voice_queues_has_cm_lists','voice_queues',_0xe6b7('0x6b'),_0x40a492));_0xc82777[_0xe6b7('0x51')](insertCmHopperBlack(_0x3691a4[_0xe6b7('0x31')],_0xe6b7('0x6c'),_0xe6b7('0x6d'),_0xe6b7('0x6b')));_0xc82777[_0xe6b7('0x51')](insertCmHopper(_0x3691a4[_0xe6b7('0x31')],_0xe6b7('0x6e'),'campaigns',_0xe6b7('0x6f'),_0x40a492));_0xc82777[_0xe6b7('0x51')](insertCmHopperBlack(_0x3691a4[_0xe6b7('0x31')],_0xe6b7('0x70'),_0xe6b7('0x71'),_0xe6b7('0x6f')));BPromise[_0xe6b7('0x72')](_0xc82777,handleQuery)[_0xe6b7('0x73')](function(_0x3885ef){stats[_0xe6b7('0x74')]=!![];stats[_0xe6b7('0x75')]=_0x3691a4[_0xe6b7('0x63')]&&_0x3691a4[_0xe6b7('0x63')][_0xe6b7('0x4c')]?results[0x2][_0xe6b7('0x75')]:results[0x0]['affectedRows'];socket[_0xe6b7('0x5f')](_0xe6b7('0x60')+_0x22fd2c,stats);fs['unlink'](_0x15e62e);fs[_0xe6b7('0x76')](_0x426777);process[_0xe6b7('0x77')](0x0);})[_0xe6b7('0x40')](function(_0x11c606){logger[_0xe6b7('0x3d')](_0x11c606['message']);process[_0xe6b7('0x77')](0x1);});}catch(_0x254954){logger['error'](_0xe6b7('0x78'),_0x254954[_0xe6b7('0x3e')]);process[_0xe6b7('0x77')](0x1);}},'error':function(_0x223ca2,_0xf2ba20,_0x53b080,_0x38a2e3){throw new Error(_0x38a2e3);}});}function validate(){if(process[_0xe6b7('0x79')]&&process[_0xe6b7('0x79')]['length']<0x4){throw new Error(_0xe6b7('0x7a'));}var _0x3520a3=path[_0xe6b7('0x13')](config[_0xe6b7('0x46')],_0xe6b7('0x7b'),process['argv'][0x2]);if(!fs['existsSync'](_0x3520a3)){throw new Error(_0xe6b7('0x7c'));}var _0x31a83d={};try{_0x31a83d=JSON[_0xe6b7('0x4a')](process[_0xe6b7('0x79')][0x3]);if(!_0x31a83d[_0xe6b7('0x44')]){throw new Error(_0xe6b7('0x7d'));}if(!_0x31a83d[_0xe6b7('0x44')]['phone']){throw new Error(_0xe6b7('0x7e'));}if(!_0x31a83d[_0xe6b7('0x44')][_0xe6b7('0x5b')]){throw new Error(_0xe6b7('0x7f'));}var _0x4e37af=0x0;if(_0x31a83d[_0xe6b7('0x44')][_0xe6b7('0x80')]){_0x4e37af=0x1;}if(!_0x31a83d['ListId']){throw new Error(_0xe6b7('0x81'));}}catch(_0x13ebe2){throw new Error('body\x20id\x20mandatory');}var _0x1046c1=[];try{_0x1046c1=_[_0xe6b7('0x82')](JSON[_0xe6b7('0x4a')](process[_0xe6b7('0x79')][0x4]),'id');}catch(_0x1c8acb){logger[_0xe6b7('0x3b')]('No\x20agent\x20available');}main(_0x3520a3,_0x31a83d,_0x1046c1,_0x4e37af);}validate();process['on'](_0xe6b7('0x83'),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 3477ba4..c0a52c1 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 _0x2ef3=['destexten','queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','uniqueid','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Call\x20To'];(function(_0x3f7575,_0xd400a6){var _0x38f5eb=function(_0x226f3a){while(--_0x226f3a){_0x3f7575['push'](_0x3f7575['shift']());}};_0x38f5eb(++_0xd400a6);}(_0x2ef3,0xba));var _0x32ef=function(_0x468383,_0xf9a77d){_0x468383=_0x468383-0x0;var _0x2929fd=_0x2ef3[_0x468383];return _0x2929fd;};'use strict';exports[_0x32ef('0x0')]=function(_0x11c049,_0x47513a){var _0x26e56e=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x2'),'variableName':null}];switch(_0x11c049['toLowerCase']()){case _0x32ef('0x3'):switch(_0x47513a[_0x32ef('0x4')]()){case'inbound':_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':'queue'});_0x26e56e['push']({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0x7')});break;case _0x32ef('0x8'):_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x1'),'content':_0x32ef('0x9'),'variableName':null});_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0xa')});break;}}return _0x26e56e;};exports[_0x32ef('0xb')]=function(_0x56eb42,_0x5780e9){var _0x401d0b=[];switch(_0x56eb42[_0x32ef('0x4')]()){case _0x32ef('0x3'):switch(_0x5780e9[_0x32ef('0x4')]()){case'inbound':_0x401d0b=[{'type':_0x32ef('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x32ef('0x6'),'variableName':'calleridname'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0xd'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0xe')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':_0x32ef('0xf')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x10'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x11'),'keyType':_0x32ef('0x6'),'variableName':'agentcalledAt'},{'type':_0x32ef('0x1'),'content':_0x32ef('0x12'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x32ef('0x13'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x14')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x15'),'keyType':_0x32ef('0x6'),'variableName':'destcalleridnum'},{'type':_0x32ef('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x16'),'keyType':'variable','variableName':_0x32ef('0x17')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x18'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x19'),'keyType':_0x32ef('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x32ef('0x1a'),'keyType':'variable','variableName':'holdtime'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1b'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x1c')}];break;case _0x32ef('0x8'):_0x401d0b=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x1d'),'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1e'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0xa')},{'type':_0x32ef('0xc'),'content':'','key':'Member\x20Name','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x1f')},{'type':'keyValue','content':'','key':_0x32ef('0x10'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x20')},{'type':_0x32ef('0xc'),'content':'','key':'Date','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x21')},{'type':_0x32ef('0x1'),'content':_0x32ef('0x22')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x23'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x32ef('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x24')},{'type':'keyValue','content':'','key':_0x32ef('0x25'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x26')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x401d0b;}; \ No newline at end of file +var _0xadb5=['uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','calleridname','Queue','UniqueId'];(function(_0x280303,_0x31d7c9){var _0x4339e3=function(_0x305a9d){while(--_0x305a9d){_0x280303['push'](_0x280303['shift']());}};_0x4339e3(++_0x31d7c9);}(_0xadb5,0xad));var _0x5adb=function(_0x4a9243,_0x14208a){_0x4a9243=_0x4a9243-0x0;var _0x270c50=_0xadb5[_0x4a9243];return _0x270c50;};'use strict';exports['getSubjects']=function(_0x2e4c9a,_0x49fc17){var _0x3d6340=[{'type':_0x5adb('0x0'),'content':_0x5adb('0x1'),'variableName':null}];switch(_0x2e4c9a['toLowerCase']()){case _0x5adb('0x2'):switch(_0x49fc17[_0x5adb('0x3')]()){case _0x5adb('0x4'):_0x3d6340['push']({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x6')});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x8')});break;case _0x5adb('0x9'):_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x0'),'content':_0x5adb('0xa'),'variableName':null});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0xb')});break;}}return _0x3d6340;};exports[_0x5adb('0xc')]=function(_0x275428,_0x563d86){var _0x4c268d=[];switch(_0x275428[_0x5adb('0x3')]()){case _0x5adb('0x2'):switch(_0x563d86[_0x5adb('0x3')]()){case'inbound':_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x8')},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xe')},{'type':_0x5adb('0xd'),'content':'','key':'Call\x20To','keyType':_0x5adb('0x5'),'variableName':'destexten'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0xf'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x6')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':'Date','keyType':_0x5adb('0x5'),'variableName':'agentcalledAt'},{'type':_0x5adb('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x5adb('0x12')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x13'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xb')},{'type':'string','content':_0x5adb('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x15')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x16'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x17')},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x18')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x19'),'keyType':_0x5adb('0x5'),'variableName':'holdtime'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1a'),'keyType':'variable','variableName':_0x5adb('0x1b')}];break;case _0x5adb('0x9'):_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1c'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0xb')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1d'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x5adb('0x1f')},{'type':_0x5adb('0x0'),'content':_0x5adb('0x14')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x20'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x21')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x22'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x5adb('0xd'),'content':'','key':'Duration','keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x23')},{'type':'keyValue','content':'','key':_0x5adb('0x24'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x25')}];break;}}return _0x4c268d;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index e721de5..ccf89a5 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 _0xf120=['stringify','Interaction','findOne','then','info','catch','error','tracked','user','clone','body','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','toUpperCase','name','role'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf120,0xe4));var _0x0f12=function(_0x28b913,_0x5a889d){_0x28b913=_0x28b913-0x0;var _0x39d2f0=_0xf120[_0x28b913];return _0x39d2f0;};'use strict';var _=require(_0x0f12('0x0'));var db=require(_0x0f12('0x1'))['db'];var loggers={'openchannel':require(_0x0f12('0x2'))(_0x0f12('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x0f12('0x2'))('fax-interactions'),'sms':require(_0x0f12('0x2'))(_0x0f12('0x4')),'chat':require(_0x0f12('0x2'))(_0x0f12('0x5'))};function getInteractionId(_0x9ff417,_0x23f4e8,_0x411e09){if(_0x9ff417&&_0x9ff417[_['upperFirst'](_0x411e09)+'InteractionId']){return _0x9ff417[_[_0x0f12('0x6')](_0x411e09)+_0x0f12('0x7')];}else if(_0x9ff417&&_0x9ff417['id']){return _0x9ff417['id'];}else if(_0x23f4e8&&_0x23f4e8['id']){return _0x23f4e8['id'];}else{return'unknown';}}function log(_0x58c9e1,_0x4a3ce8,_0xd34567,_0x4a89ef,_0x5d02d4,_0x35f16b){loggers[_0x5d02d4[_0x0f12('0x8')]()][_0x58c9e1]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35f16b[_0x0f12('0x9')](),_0x4a3ce8?_0x4a3ce8['id']:null,_0x4a3ce8?_0x4a3ce8[_0x0f12('0xa')]:null,_0x4a3ce8?_0x4a3ce8[_0x0f12('0xb')]:null,getInteractionId(_0xd34567,_0x4a89ef,_0x5d02d4),_0xd34567?JSON[_0x0f12('0xc')](_0xd34567):'null');}function updateUser(_0x77675c,_0x41bf26,_0x3e3138,_0x3d50a5,_0x2e1a6a){db[_[_0x0f12('0x6')](_0x3d50a5)+_0x0f12('0xd')][_0x0f12('0xe')]({'where':{'id':getInteractionId(_0x41bf26,_0x3e3138,_0x3d50a5)}})[_0x0f12('0xf')](function(_0x14e2a9){if(_0x14e2a9){return _0x14e2a9['update']({'UserId':_0x77675c?_0x77675c['id']:null});}})[_0x0f12('0xf')](function(_0x41e232){if(_0x41e232){log(_0x0f12('0x10'),_0x77675c,_0x41bf26,_0x3e3138,_0x3d50a5,_0x2e1a6a);}})[_0x0f12('0x11')](function(){log(_0x0f12('0x12'),_0x77675c,_0x41bf26,_0x3e3138,_0x3d50a5,_0x2e1a6a);});}exports[_0x0f12('0x13')]=function(_0x5d72bf,_0x51f552){return function(_0xbe1247,_0x5a7abe,_0x37bb8d){var _0x1da149=_0xbe1247[_0x0f12('0x14')];var _0x567c74={};var _0x462dc8=_0xbe1247['query'];if(_0x567c74){_0x567c74=_[_0x0f12('0x15')](_0xbe1247[_0x0f12('0x16')]);_0x567c74=_['omit'](_0x567c74,[_0x0f12('0x16'),'html','phone','fax',_0x0f12('0x17')]);}updateUser(_0x1da149,_0x567c74,_0x462dc8,_0x5d72bf,_0x51f552);_0x37bb8d(null);};}; \ No newline at end of file +var _0x36b6=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','html','lodash','../../mysqldb'];(function(_0x39e7cd,_0x31074b){var _0x45c608=function(_0x4e05f4){while(--_0x4e05f4){_0x39e7cd['push'](_0x39e7cd['shift']());}};_0x45c608(++_0x31074b);}(_0x36b6,0x186));var _0x636b=function(_0x57c8a3,_0x2e6a45){_0x57c8a3=_0x57c8a3-0x0;var _0xe9e762=_0x36b6[_0x57c8a3];return _0xe9e762;};'use strict';var _=require(_0x636b('0x0'));var db=require(_0x636b('0x1'))['db'];var loggers={'openchannel':require(_0x636b('0x2'))(_0x636b('0x3')),'mail':require('../../config/logger')(_0x636b('0x4')),'fax':require(_0x636b('0x2'))(_0x636b('0x5')),'sms':require('../../config/logger')(_0x636b('0x6')),'chat':require(_0x636b('0x2'))('chat-interactions')};function getInteractionId(_0x10bb4c,_0x5995ac,_0x2cbc1e){if(_0x10bb4c&&_0x10bb4c[_[_0x636b('0x7')](_0x2cbc1e)+_0x636b('0x8')]){return _0x10bb4c[_[_0x636b('0x7')](_0x2cbc1e)+_0x636b('0x8')];}else if(_0x10bb4c&&_0x10bb4c['id']){return _0x10bb4c['id'];}else if(_0x5995ac&&_0x5995ac['id']){return _0x5995ac['id'];}else{return _0x636b('0x9');}}function log(_0x2e68b6,_0x2a488a,_0xab58fd,_0x1675fc,_0x30c23c,_0x51cdfe){loggers[_0x30c23c['toLowerCase']()][_0x2e68b6](_0x636b('0xa'),_0x51cdfe[_0x636b('0xb')](),_0x2a488a?_0x2a488a['id']:null,_0x2a488a?_0x2a488a[_0x636b('0xc')]:null,_0x2a488a?_0x2a488a['role']:null,getInteractionId(_0xab58fd,_0x1675fc,_0x30c23c),_0xab58fd?JSON[_0x636b('0xd')](_0xab58fd):_0x636b('0xe'));}function updateUser(_0x3b7381,_0x233c42,_0xf1e7a0,_0x3e9112,_0x51d52b){db[_[_0x636b('0x7')](_0x3e9112)+_0x636b('0xf')][_0x636b('0x10')]({'where':{'id':getInteractionId(_0x233c42,_0xf1e7a0,_0x3e9112)}})[_0x636b('0x11')](function(_0x58cd73){if(_0x58cd73){return _0x58cd73[_0x636b('0x12')]({'UserId':_0x3b7381?_0x3b7381['id']:null});}})[_0x636b('0x11')](function(_0x472f02){if(_0x472f02){log(_0x636b('0x13'),_0x3b7381,_0x233c42,_0xf1e7a0,_0x3e9112,_0x51d52b);}})[_0x636b('0x14')](function(){log(_0x636b('0x15'),_0x3b7381,_0x233c42,_0xf1e7a0,_0x3e9112,_0x51d52b);});}exports[_0x636b('0x16')]=function(_0x2bfaad,_0xd92cbe){return function(_0x417359,_0x237672,_0x24b527){var _0x3465de=_0x417359[_0x636b('0x17')];var _0x529284={};var _0x29b1b8=_0x417359[_0x636b('0x18')];if(_0x529284){_0x529284=_[_0x636b('0x19')](_0x417359[_0x636b('0x1a')]);_0x529284=_['omit'](_0x529284,[_0x636b('0x1a'),_0x636b('0x1b'),'phone','fax','mobile']);}updateUser(_0x3465de,_0x529284,_0x29b1b8,_0x2bfaad,_0xd92cbe);_0x24b527(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index af1b238..30304e9 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 _0x4d4e=['status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','then','count'];(function(_0x297065,_0x2b8512){var _0x4d96ab=function(_0xd9a5ba){while(--_0xd9a5ba){_0x297065['push'](_0x297065['shift']());}};_0x4d96ab(++_0x2b8512);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x31ac6f,_0xac69ee){_0x31ac6f=_0x31ac6f-0x0;var _0x26653f=_0x4d4e[_0x31ac6f];return _0x26653f;};'use strict';var crypto=require(_0xe4d4('0x0'));var util=require('util');var compose=require(_0xe4d4('0x1'));var db=require(_0xe4d4('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1359db,_0x3edaf2){if(_0x1359db&&_0x3edaf2){if(_0x3edaf2[_0xe4d4('0x3')]&&_0x3edaf2[_0xe4d4('0x4')]){var _0x49cb69=_0x3edaf2['data1'];var _0x57550c=_0x3edaf2[_0xe4d4('0x4')];var _0x55bae3=_0x49cb69['split']('-')[0x4];var _0x4e9d70=_0x49cb69[_0xe4d4('0x5')]('-')[0x0];var _0x3e422b=crypto[_0xe4d4('0x6')](_0xe4d4('0x7'),util[_0xe4d4('0x8')]('%s:%s:%s',_0x55bae3,_0x49cb69,_0x4e9d70));var _0x5ebdc3=_0x3e422b[_0xe4d4('0x9')](_0x57550c,_0xe4d4('0xa'),_0xe4d4('0xb'));_0x5ebdc3+=_0x3e422b[_0xe4d4('0xc')](_0xe4d4('0xb'));var _0x224dd4=JSON[_0xe4d4('0xd')](_0x5ebdc3);return _0x224dd4[_0xe4d4('0xe')](_0x1359db)?_0x224dd4[_0x1359db]:null;}}return null;}function isLimit(_0x587990,_0x24ed69,_0x24d52a,_0x7daefc){var _0x4bdecc=_0x24ed69;return compose()[_0xe4d4('0xf')](function(_0x171b9f,_0x3914a1,_0x1adc63){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe4d4('0x10')](function(_0x5e7aa5){var _0xc30b58=getValueFromLicense(_0x587990,_0x5e7aa5);return _0xc30b58?_0xc30b58:_0x4bdecc;})[_0xe4d4('0x10')](function(_0x56d8c4){_0x4bdecc=_0x56d8c4;return _0x24d52a[_0xe4d4('0x11')](_0x7daefc);})[_0xe4d4('0x10')](function(_0x363d84){if(_0x363d84>=_0x4bdecc){return _0x3914a1[_0xe4d4('0x12')](0x193)[_0xe4d4('0x13')]({'message':util[_0xe4d4('0x8')](_0xe4d4('0x14'),_0x587990)});}_0x1adc63();})[_0xe4d4('0x15')](function(_0x40c107){_0x1adc63(_0x40c107);});});}function isUserLimit(){return isLimit(_0xe4d4('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xe4d4('0x17')},{'role':_0xe4d4('0x18')}]}});}exports[_0xe4d4('0x19')]=isUserLimit; \ No newline at end of file +var _0xe953=['then','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','createDecipher','%s:%s:%s','update','final','utf8','hasOwnProperty','use','License','findOne'];(function(_0x4428f1,_0x3b2bb2){var _0x51855e=function(_0x443565){while(--_0x443565){_0x4428f1['push'](_0x4428f1['shift']());}};_0x51855e(++_0x3b2bb2);}(_0xe953,0xf9));var _0x3e95=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xe953[_0x1e6db3];return _0x1de886;};'use strict';var crypto=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var compose=require(_0x3e95('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x3e95('0x3'));function getValueFromLicense(_0x1762e9,_0x3ca3ce){if(_0x1762e9&&_0x3ca3ce){if(_0x3ca3ce[_0x3e95('0x4')]&&_0x3ca3ce[_0x3e95('0x5')]){var _0x2a8222=_0x3ca3ce[_0x3e95('0x4')];var _0x57fc59=_0x3ca3ce['license'];var _0x2aaa3e=_0x2a8222['split']('-')[0x4];var _0x457ca6=_0x2a8222['split']('-')[0x0];var _0x342a5d=crypto[_0x3e95('0x6')]('aes-256-ctr',util['format'](_0x3e95('0x7'),_0x2aaa3e,_0x2a8222,_0x457ca6));var _0x521403=_0x342a5d[_0x3e95('0x8')](_0x57fc59,'base64','utf8');_0x521403+=_0x342a5d[_0x3e95('0x9')](_0x3e95('0xa'));var _0x20e4d3=JSON['parse'](_0x521403);return _0x20e4d3[_0x3e95('0xb')](_0x1762e9)?_0x20e4d3[_0x1762e9]:null;}}return null;}function isLimit(_0x8ee168,_0x3914d3,_0x330721,_0x405503){var _0x5576cf=_0x3914d3;return compose()[_0x3e95('0xc')](function(_0x16bd33,_0x241734,_0x570618){return db[_0x3e95('0xd')][_0x3e95('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x3e95('0xf')](function(_0x449d94){var _0x29f794=getValueFromLicense(_0x8ee168,_0x449d94);return _0x29f794?_0x29f794:_0x5576cf;})[_0x3e95('0xf')](function(_0x54d548){_0x5576cf=_0x54d548;return _0x330721['count'](_0x405503);})[_0x3e95('0xf')](function(_0x109055){if(_0x109055>=_0x5576cf){return _0x241734[_0x3e95('0x10')](0x193)['json']({'message':util[_0x3e95('0x11')](_0x3e95('0x12'),_0x8ee168)});}_0x570618();})[_0x3e95('0x13')](function(_0x4a5402){_0x570618(_0x4a5402);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x3e95('0x14')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x3e95('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d60bea7..6444013 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 _0xd837=['unsigned','ASC','isObject','isString','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','lodash','sequelize','filters','isEmpty','forOwn','isArray','parse','split','offset','sort','map','cast','col','priority','substr','DESC'];(function(_0xfadc1a,_0xc6a189){var _0x1be3a4=function(_0x1a9107){while(--_0x1a9107){_0xfadc1a['push'](_0xfadc1a['shift']());}};_0x1be3a4(++_0xc6a189);}(_0xd837,0x6d));var _0x7d83=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xd837[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x7d83('0x0'));var moment=require('moment');var sequelize=require(_0x7d83('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x3319a5){var _0x53a827=null;if(_0x3319a5){_0x53a827=_0x3319a5['split'](',');}return _0x53a827;};exports[_0x7d83('0x2')]=function(_0x339cac){var _0x2d5e84={};if(!_[_0x7d83('0x3')](_0x339cac)){_0x2d5e84={};_[_0x7d83('0x4')](_0x339cac,function(_0x47b7f9,_0x13843a){try{_0x2d5e84[_0x13843a]=_[_0x7d83('0x5')](_0x47b7f9)?_0x47b7f9:JSON[_0x7d83('0x6')](_0x47b7f9);}catch(_0x35a0c2){_0x2d5e84[_0x13843a]=_0x47b7f9[_0x7d83('0x7')](',');}});}return _0x2d5e84;};exports['limit']=function(_0x4b5245){_0x4b5245=parseInt(_0x4b5245,0xa);if(!_0x4b5245||_0x4b5245<0x0){_0x4b5245=LIMIT_VALUE;}return _0x4b5245;};exports[_0x7d83('0x8')]=function(_0x18c7fe){_0x18c7fe=parseInt(_0x18c7fe,0xa);if(!_0x18c7fe||_0x18c7fe<0x0){_0x18c7fe=0x0;}return _0x18c7fe;};exports[_0x7d83('0x9')]=function(_0x1d6564){var _0x36d95a,_0x4f27cc=null;if(_0x1d6564){_0x36d95a=_0x1d6564[_0x7d83('0x7')](',');_0x4f27cc=_[_0x7d83('0xa')](_0x36d95a,function(_0x56c9a7){if(_0x56c9a7['indexOf']('-')===0x0){return[_0x56c9a7==='priority'?sequelize[_0x7d83('0xb')](sequelize[_0x7d83('0xc')](_0x7d83('0xd')),'unsigned'):_0x56c9a7[_0x7d83('0xe')](0x1),_0x7d83('0xf')];}else{return[_0x56c9a7==='priority'?sequelize[_0x7d83('0xb')](sequelize[_0x7d83('0xc')](_0x7d83('0xd')),_0x7d83('0x10')):_0x56c9a7,_0x7d83('0x11')];}});}return _0x4f27cc;};exports['omit']=function(_0x41926a,_0x1e5c7b){if(_[_0x7d83('0x3')](_0x41926a)){return _0x41926a;}if(_[_0x7d83('0x5')](_0x41926a)){for(var _0x4a0271=0x0;_0x4a0271<_0x41926a['length'];_0x4a0271+=0x1){_0x41926a[_0x4a0271]=this['omit'](_0x41926a[_0x4a0271],_0x1e5c7b);}return _0x41926a;}if(!_[_0x7d83('0x12')](_0x41926a)){return _0x41926a;}if(_[_0x7d83('0x13')](_0x1e5c7b)){_0x1e5c7b=[_0x1e5c7b];}if(!_['isArray'](_0x1e5c7b)){return _0x41926a;}for(var _0xe4da2a=0x0;_0xe4da2a<_0x1e5c7b['length'];_0xe4da2a+=0x1){_['unset'](_0x41926a,_0x1e5c7b[_0xe4da2a]);}for(var _0x22cf9c in _0x41926a){if(_0x41926a[_0x7d83('0x14')](_0x22cf9c)){_0x41926a[_0x22cf9c]=this['omit'](_0x41926a[_0x22cf9c],_0x1e5c7b);}}return _0x41926a;};exports[_0x7d83('0x15')]=function(_0x2037d9){return _0x2037d9[_0x7d83('0x16')](RegExp(_0x7d83('0x17')))?!![]:![];};exports[_0x7d83('0x18')]=function(_0x26f275){return _0x26f275[_0x7d83('0x16')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x08ba=['length','unset','hasOwnProperty','isNumeric','^[0-9]*$','match','lodash','sequelize','fields','split','forOwn','limit','sort','map','cast','priority','unsigned','substr','DESC','col','ASC','omit','isEmpty','isArray'];(function(_0x4c0087,_0x442f1f){var _0x2ce6aa=function(_0x27cef9){while(--_0x27cef9){_0x4c0087['push'](_0x4c0087['shift']());}};_0x2ce6aa(++_0x442f1f);}(_0x08ba,0x96));var _0xa08b=function(_0x260a78,_0x20c234){_0x260a78=_0x260a78-0x0;var _0x56c872=_0x08ba[_0x260a78];return _0x56c872;};'use strict';var _=require(_0xa08b('0x0'));var moment=require('moment');var sequelize=require(_0xa08b('0x1'));var LIMIT_VALUE=0xfa;exports[_0xa08b('0x2')]=function(_0x3427c4){var _0x5cfe84=null;if(_0x3427c4){_0x5cfe84=_0x3427c4[_0xa08b('0x3')](',');}return _0x5cfe84;};exports['filters']=function(_0x4b7ebc){var _0x3b9287={};if(!_['isEmpty'](_0x4b7ebc)){_0x3b9287={};_[_0xa08b('0x4')](_0x4b7ebc,function(_0x5dbbb4,_0x29f729){try{_0x3b9287[_0x29f729]=_['isArray'](_0x5dbbb4)?_0x5dbbb4:JSON['parse'](_0x5dbbb4);}catch(_0x4d4a87){_0x3b9287[_0x29f729]=_0x5dbbb4[_0xa08b('0x3')](',');}});}return _0x3b9287;};exports[_0xa08b('0x5')]=function(_0x56861d){_0x56861d=parseInt(_0x56861d,0xa);if(!_0x56861d||_0x56861d<0x0){_0x56861d=LIMIT_VALUE;}return _0x56861d;};exports['offset']=function(_0x228c4c){_0x228c4c=parseInt(_0x228c4c,0xa);if(!_0x228c4c||_0x228c4c<0x0){_0x228c4c=0x0;}return _0x228c4c;};exports[_0xa08b('0x6')]=function(_0x3dec35){var _0x568f16,_0x1bfc1f=null;if(_0x3dec35){_0x568f16=_0x3dec35['split'](',');_0x1bfc1f=_[_0xa08b('0x7')](_0x568f16,function(_0x30ffc7){if(_0x30ffc7['indexOf']('-')===0x0){return[_0x30ffc7==='priority'?sequelize[_0xa08b('0x8')](sequelize['col'](_0xa08b('0x9')),_0xa08b('0xa')):_0x30ffc7[_0xa08b('0xb')](0x1),_0xa08b('0xc')];}else{return[_0x30ffc7==='priority'?sequelize[_0xa08b('0x8')](sequelize[_0xa08b('0xd')](_0xa08b('0x9')),_0xa08b('0xa')):_0x30ffc7,_0xa08b('0xe')];}});}return _0x1bfc1f;};exports[_0xa08b('0xf')]=function(_0x565b2e,_0x3a0ddb){if(_[_0xa08b('0x10')](_0x565b2e)){return _0x565b2e;}if(_[_0xa08b('0x11')](_0x565b2e)){for(var _0x2aa7f8=0x0;_0x2aa7f8<_0x565b2e[_0xa08b('0x12')];_0x2aa7f8+=0x1){_0x565b2e[_0x2aa7f8]=this[_0xa08b('0xf')](_0x565b2e[_0x2aa7f8],_0x3a0ddb);}return _0x565b2e;}if(!_['isObject'](_0x565b2e)){return _0x565b2e;}if(_['isString'](_0x3a0ddb)){_0x3a0ddb=[_0x3a0ddb];}if(!_['isArray'](_0x3a0ddb)){return _0x565b2e;}for(var _0xa2a145=0x0;_0xa2a145<_0x3a0ddb[_0xa08b('0x12')];_0xa2a145+=0x1){_[_0xa08b('0x13')](_0x565b2e,_0x3a0ddb[_0xa2a145]);}for(var _0x6a9238 in _0x565b2e){if(_0x565b2e[_0xa08b('0x14')](_0x6a9238)){_0x565b2e[_0x6a9238]=this[_0xa08b('0xf')](_0x565b2e[_0x6a9238],_0x3a0ddb);}}return _0x565b2e;};exports[_0xa08b('0x15')]=function(_0x236ab4){return _0x236ab4['match'](RegExp(_0xa08b('0x16')))?!![]:![];};exports['isEmail']=function(_0x44f37c){return _0x44f37c[_0xa08b('0x17')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 87899fb..2ed1a3f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['50mb','express','serve-favicon','body-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','get','use','public','favicon.ico','set','appPath','join','root','client','json\x20replacer','toISOString','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded'];(function(_0x245e2d,_0x1515a6){var _0x2d1b6f=function(_0xd5b890){while(--_0xd5b890){_0x245e2d['push'](_0x245e2d['shift']());}};_0x2d1b6f(++_0x1515a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var express=require(_0x0a9e('0x0'));var favicon=require(_0x0a9e('0x1'));var bodyParser=require(_0x0a9e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x0a9e('0x3'));var path=require('path');var passport=require(_0x0a9e('0x4'));var cors=require(_0x0a9e('0x5'));var moment=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var db=require(_0x0a9e('0x8'))['db'];exports['default']=function(_0x219af0){var _0x441e3a=_0x219af0[_0x0a9e('0x9')]('env');if(_0x441e3a==='production'){_0x219af0[_0x0a9e('0xa')](favicon(path['join'](config['root'],_0x0a9e('0xb'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],'public'));}if(_0x441e3a==='development'||_0x441e3a==='test'){_0x219af0['use'](favicon(path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],_0x0a9e('0x11'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path['join'](config[_0x0a9e('0x10')],_0x0a9e('0x11')));_0x219af0[_0x0a9e('0xa')](errorHandler());}_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x12'),function(_0x4d5611,_0x52a03d){if(this[_0x4d5611]instanceof Date){_0x52a03d=this[_0x4d5611][_0x0a9e('0x13')]()['split']('.')[0x0]+'Z';}return _0x52a03d;});_0x219af0[_0x0a9e('0xa')](express['static'](_0x219af0[_0x0a9e('0x9')](_0x0a9e('0xe'))));_0x219af0['set'](_0x0a9e('0x14'),config['root']+_0x0a9e('0x15'));_0x219af0[_0x0a9e('0x16')](_0x0a9e('0x17'),require(_0x0a9e('0x18'))[_0x0a9e('0x19')]);_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x1a'),_0x0a9e('0x17'));_0x219af0[_0x0a9e('0xa')](bodyParser[_0x0a9e('0x1b')]({'limit':_0x0a9e('0x1c'),'extended':!![]}));_0x219af0[_0x0a9e('0xa')](bodyParser['json']({'limit':_0x0a9e('0x1c')}));_0x219af0[_0x0a9e('0xa')](cors());_0x219af0['use'](methodOverride());_0x219af0[_0x0a9e('0xa')](cookieParser());_0x219af0['use'](passport['initialize']());}; \ No newline at end of file +var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1c42ca4..a57018d 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 _0xa808=['crypto','child_process','networkInterfaces','orderBy','keys','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','createHash','substring','lodash'];(function(_0x590985,_0x3a1e02){var _0x2d8d61=function(_0x406e48){while(--_0x406e48){_0x590985['push'](_0x590985['shift']());}};_0x2d8d61(++_0x3a1e02);}(_0xa808,0x12b));var _0x8a80=function(_0x315928,_0x1c7022){_0x315928=_0x315928-0x0;var _0x2aee52=_0xa808[_0x315928];return _0x2aee52;};'use strict';var _=require(_0x8a80('0x0'));var os=require('os');var crypto=require(_0x8a80('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x8a80('0x2'))['execSync'];function getInterfaces(){var _0x27856c=[];var _0x1513a0=os[_0x8a80('0x3')]();var _0x4b4c5b=_[_0x8a80('0x4')](_[_0x8a80('0x5')](_0x1513a0));for(var _0x17d2de=0x0;_0x17d2de<_0x4b4c5b[_0x8a80('0x6')];_0x17d2de++){var _0x3f4326=_0x1513a0[_0x4b4c5b[_0x17d2de]][_0x8a80('0x7')](function(_0x279058){return _0x279058['family']==='IPv4'&&_0x279058[_0x8a80('0x8')]===![];});_0x27856c=_0x27856c[_0x8a80('0x9')](_0x3f4326);}return _0x27856c;}function getFirstInterface(){var _0x4cca37=_[_0x8a80('0xa')](getInterfaces());return{'macAddress':_0x4cca37&&_0x4cca37[_0x8a80('0xb')]?_0x4cca37[_0x8a80('0xb')]:_0x8a80('0xc'),'ipAddress':_0x4cca37&&_0x4cca37[_0x8a80('0xd')]?_0x4cca37[_0x8a80('0xd')]:'127.0.0.1'};}exports[_0x8a80('0xe')]=getFirstInterface;function getCPUhash(){var _0x527d7a=_[_0x8a80('0x4')](os[_0x8a80('0xf')]()[_0x8a80('0x10')](function(_0x1a8248){return _0x1a8248[_0x8a80('0x11')];}))[_0x8a80('0x12')](':');return crypto['createHash'](_0x8a80('0x13'))[_0x8a80('0x14')](_0x527d7a)[_0x8a80('0x15')](_0x8a80('0x16'));}exports[_0x8a80('0x17')]=function(){switch(os['platform']()){case _0x8a80('0x18'):return exec(_0x8a80('0x19'),{'encoding':'utf8'})[_0x8a80('0x1a')]('\x0d\x0a','');default:var _0xb12687=getFirstInterface();var _0x52d1f7=getCPUhash();var _0x39db1b=_0x52d1f7+'|'+os['hostname']()+'|'+_0xb12687[_0x8a80('0x1b')]+'|'+_0xb12687['ipAddress'];var _0x31c66b=crypto[_0x8a80('0x1c')](_0x8a80('0x13'))[_0x8a80('0x14')](_0x39db1b)['digest'](_0x8a80('0x16'));return _0x31c66b[_0x8a80('0x1d')](0x0,0x8)+'-'+_0x31c66b['substring'](0x8,0xc)+'-'+_0x31c66b[_0x8a80('0x1d')](0xc,0x10)+'-'+_0x31c66b[_0x8a80('0x1d')](0x10,0x14)+'-'+_0x31c66b[_0x8a80('0x1d')](0x14);}}; \ No newline at end of file +var _0x4a7f=['macAddress','createHash','update','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','md5','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','hostname'];(function(_0x5a311e,_0x40c100){var _0x4d39c8=function(_0x2968e5){while(--_0x2968e5){_0x5a311e['push'](_0x5a311e['shift']());}};_0x4d39c8(++_0x40c100);}(_0x4a7f,0x1a4));var _0xf4a7=function(_0x3bcf29,_0x4a4d2d){_0x3bcf29=_0x3bcf29-0x0;var _0x2c13f7=_0x4a7f[_0x3bcf29];return _0x2c13f7;};'use strict';var _=require(_0xf4a7('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xf4a7('0x1'));var exec=require(_0xf4a7('0x2'))[_0xf4a7('0x3')];function getInterfaces(){var _0x1a8741=[];var _0x387098=os[_0xf4a7('0x4')]();var _0xfb7b3f=_[_0xf4a7('0x5')](_[_0xf4a7('0x6')](_0x387098));for(var _0x3ad162=0x0;_0x3ad162<_0xfb7b3f[_0xf4a7('0x7')];_0x3ad162++){var _0x4971ee=_0x387098[_0xfb7b3f[_0x3ad162]]['filter'](function(_0x5b461){return _0x5b461[_0xf4a7('0x8')]===_0xf4a7('0x9')&&_0x5b461['internal']===![];});_0x1a8741=_0x1a8741[_0xf4a7('0xa')](_0x4971ee);}return _0x1a8741;}function getFirstInterface(){var _0xddbef5=_[_0xf4a7('0xb')](getInterfaces());return{'macAddress':_0xddbef5&&_0xddbef5[_0xf4a7('0xc')]?_0xddbef5['mac']:_0xf4a7('0xd'),'ipAddress':_0xddbef5&&_0xddbef5['address']?_0xddbef5[_0xf4a7('0xe')]:_0xf4a7('0xf')};}exports[_0xf4a7('0x10')]=getFirstInterface;function getCPUhash(){var _0x559013=_[_0xf4a7('0x5')](os[_0xf4a7('0x11')]()[_0xf4a7('0x12')](function(_0x3cf321){return _0x3cf321[_0xf4a7('0x13')];}))['join'](':');return crypto['createHash'](_0xf4a7('0x14'))['update'](_0x559013)[_0xf4a7('0x15')](_0xf4a7('0x16'));}exports[_0xf4a7('0x17')]=function(){switch(os[_0xf4a7('0x18')]()){case _0xf4a7('0x19'):return exec(_0xf4a7('0x1a'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x2c67cb=getFirstInterface();var _0x9c219e=getCPUhash();var _0xc5d3b9=_0x9c219e+'|'+os[_0xf4a7('0x1b')]()+'|'+_0x2c67cb[_0xf4a7('0x1c')]+'|'+_0x2c67cb['ipAddress'];var _0x43018b=crypto[_0xf4a7('0x1d')]('md5')[_0xf4a7('0x1e')](_0xc5d3b9)['digest'](_0xf4a7('0x16'));return _0x43018b[_0xf4a7('0x1f')](0x0,0x8)+'-'+_0x43018b[_0xf4a7('0x1f')](0x8,0xc)+'-'+_0x43018b[_0xf4a7('0x1f')](0xc,0x10)+'-'+_0x43018b['substring'](0x10,0x14)+'-'+_0x43018b[_0xf4a7('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a883878..f658118 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 _0x52b3=['findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|email|','then','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','createDecipher','||FIELD||VALUE||\x0a','User'];(function(_0x509d8c,_0x2a68d5){var _0x46f902=function(_0x7efd92){while(--_0x7efd92){_0x509d8c['push'](_0x509d8c['shift']());}};_0x46f902(++_0x2a68d5);}(_0x52b3,0x12a));var _0x352b=function(_0x4ea3b0,_0x548d58){_0x4ea3b0=_0x4ea3b0-0x0;var _0x37b6fa=_0x52b3[_0x4ea3b0];return _0x37b6fa;};'use strict';var util=require(_0x352b('0x0'));var crypto=require('crypto');var moment=require(_0x352b('0x1'));var rp=require(_0x352b('0x2'));var BPromise=require(_0x352b('0x3'));var pkginfo=require(_0x352b('0x4'))(module,_0x352b('0x5'));var db=require(_0x352b('0x6'))['db'];var config=require(_0x352b('0x7'));var hardware=require(_0x352b('0x8'));var logger=require(_0x352b('0x9'))(_0x352b('0xa'));var jira=require('../../api/jira/jira.controller');var HOST=_0x352b('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x504ada){return new BPromise(function(_0x36dbbc,_0x10a53d){var _0x499423=util[_0x352b('0xc')](_0x352b('0xd'),HOST,_0x504ada,module[_0x352b('0xe')][_0x352b('0x5')]);if(oldToken){_0x499423=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x504ada,module['exports']['version'],oldToken);}var _0x490eb8={'uri':_0x499423,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x490eb8)['then'](function(_0x4582ec){_0x36dbbc(_0x4582ec);})[_0x352b('0xf')](function(_0x38abbd){_0x10a53d(_0x38abbd);});});}function encryptDate(_0x1c3450){var _0x1c5c04=crypto[_0x352b('0x10')](_0x352b('0x11'),config[_0x352b('0x12')][_0x352b('0x13')]);var _0x247529=_0x1c5c04[_0x352b('0x14')](_0x1c3450,_0x352b('0x15'),_0x352b('0x16'));_0x247529+=_0x1c5c04[_0x352b('0x17')](_0x352b('0x16'));return _0x247529;}function decryptDate(_0x112699){var _0x183e3c=crypto[_0x352b('0x18')](_0x352b('0x11'),config[_0x352b('0x12')][_0x352b('0x13')]);var _0x5b1be5=_0x183e3c[_0x352b('0x14')](_0x112699,'base64','utf8');_0x5b1be5+=_0x183e3c[_0x352b('0x17')](_0x352b('0x15'));return _0x5b1be5;}function sendJiraAlert(_0x222015,_0x11972e,_0x9a92a0){var _0x42f2c8=_0x352b('0x19');return db[_0x352b('0x1a')][_0x352b('0x1b')]({'where':{'role':_0x352b('0x1c')},'attributes':[_0x352b('0x1d'),_0x352b('0x1e')],'raw':!![]})['then'](function(_0x2115d9){ADMIN=_0x2115d9;_0x42f2c8+=_0x352b('0x1f')+_0x9a92a0+'|\x0a';_0x42f2c8+=_0x352b('0x20')+_0x222015+'|\x0a';_0x42f2c8+=_0x352b('0x21')+_0x11972e+'|\x0a';_0x42f2c8+='|name|'+ADMIN[_0x352b('0x1d')]+'|\x0a';_0x42f2c8+=_0x352b('0x22')+ADMIN[_0x352b('0x1e')]+'|\x0a';return _0x42f2c8;})[_0x352b('0x23')](function(_0x59aac6){var _0x14f910=hardware['getFirstInterface']()[_0x352b('0x24')];return jira[_0x352b('0x25')]({'key':'MOTLICENSE','summary':_0x352b('0x26'),'description':_0x59aac6,'issuetype':_0x352b('0x27'),'oldToken':_0x222015,'newToken':_0x11972e,'email':ADMIN[_0x352b('0x1e')],'name':ADMIN[_0x352b('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x14f910});});}function manageLicense(_0x4d1bdf,_0x5078b5){var _0x3221b5=_0x5078b5[_0x352b('0x28')]({'plain':!![]});httpRequest(_0x4d1bdf)[_0x352b('0x23')](function(_0x59ceda){if(oldToken){oldToken=undefined;}if(_0x59ceda[_0x352b('0x29')]){if(!_0x3221b5[_0x352b('0xa')]&&_0x3221b5[_0x352b('0xa')]!=_0x59ceda[_0x352b('0xa')]||_0x3221b5['license']&&_0x3221b5['data2']){logger[_0x352b('0x2a')](_0x352b('0x2b'));}if(_0x3221b5[_0x352b('0xa')]&&!_0x3221b5[_0x352b('0x2c')]&&_0x3221b5[_0x352b('0xa')]!=_0x59ceda['license']){logger['info'](_0x352b('0x2d'));}if(_0x3221b5[_0x352b('0xa')]&&!_0x3221b5[_0x352b('0x2c')]&&_0x3221b5[_0x352b('0xa')]==_0x59ceda[_0x352b('0xa')]){return _0x5078b5;}return _0x5078b5[_0x352b('0x14')]({'data1':_0x4d1bdf,'data2':null,'license':_0x59ceda[_0x352b('0xa')]});}else{if(_0x59ceda['license']||_0x3221b5[_0x352b('0xa')]){if(!_0x3221b5['data2']){if(_0x3221b5['data1']==_0x4d1bdf){GRAY_PERIOD_REASON=_0x352b('0x2e');logger[_0x352b('0x2a')](_0x352b('0x2f'));}else{GRAY_PERIOD_REASON=_0x352b('0x30');oldToken=_0x3221b5[_0x352b('0x31')];logger[_0x352b('0x2a')](_0x352b('0x32'),_0x3221b5[_0x352b('0x31')],_0x4d1bdf);}sendJiraAlert(_0x3221b5[_0x352b('0x31')],_0x59ceda['uuid'],GRAY_PERIOD_REASON);logger[_0x352b('0x2a')](_0x352b('0x33'),GRAY_PERIOD_REASON[_0x352b('0x34')](),moment()[_0x352b('0xc')](_0x352b('0x35')));return _0x5078b5[_0x352b('0x14')]({'data2':encryptDate(moment()[_0x352b('0xc')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x352b('0x36')](decryptDate(_0x3221b5['data2']),_0x352b('0x37'))>DAYS){logger[_0x352b('0x2a')](_0x352b('0x38'),moment()['format'](_0x352b('0x35')));return _0x5078b5['update']({'data1':_0x4d1bdf,'data2':null,'license':null});}}}else{if(_0x3221b5[_0x352b('0x31')]!=_0x4d1bdf){logger[_0x352b('0x2a')](_0x352b('0x32'),_0x3221b5[_0x352b('0x31')],_0x4d1bdf);return _0x5078b5['update']({'data1':_0x4d1bdf,'data2':null,'license':null});}}}return _0x5078b5;})[_0x352b('0x23')](function(_0x16b101){_0x5078b5=_0x16b101;})[_0x352b('0xf')](function(_0x99b3b2){logger['error'](_0x99b3b2['message']);})[_0x352b('0x39')](function(){setTimeout(function(){manageLicense(hardware[_0x352b('0x3a')](),_0x5078b5);},TIME);});}function defaultLicense(){var _0x344fb2=hardware[_0x352b('0x3a')]();if(_0x344fb2){return db[_0x352b('0x3b')][_0x352b('0x3c')]({'where':{'id':0x1},'defaults':{'data1':_0x344fb2}})[_0x352b('0x3d')](function(_0x9f40b1,_0x1364e5){logger[_0x352b('0x2a')](_0x352b('0x3e'),_0x344fb2);manageLicense(_0x344fb2,_0x9f40b1);})[_0x352b('0xf')](function(_0x3687fb){logger[_0x352b('0x3f')](_0x3687fb['message']);});}}exports[_0x352b('0x40')]=defaultLicense; \ No newline at end of file +var _0x9fac=['version','../logger','../../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','catch','createCipher','aes-256-ctr','secrets','update','base64','final','createDecipher','session','utf8','||FIELD||VALUE||\x0a','findOne','admin','fullname','then','|reason|','|name|','email','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird'];(function(_0x1114e4,_0xb535c4){var _0x2c426c=function(_0x2a07c3){while(--_0x2a07c3){_0x1114e4['push'](_0x1114e4['shift']());}};_0x2c426c(++_0xb535c4);}(_0x9fac,0xaf));var _0xc9fa=function(_0x4eaecc,_0x4956c4){_0x4eaecc=_0x4eaecc-0x0;var _0x239f4c=_0x9fac[_0x4eaecc];return _0x239f4c;};'use strict';var util=require(_0xc9fa('0x0'));var crypto=require(_0xc9fa('0x1'));var moment=require(_0xc9fa('0x2'));var rp=require(_0xc9fa('0x3'));var BPromise=require(_0xc9fa('0x4'));var pkginfo=require('pkginfo')(module,_0xc9fa('0x5'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0xc9fa('0x6'))('license');var jira=require(_0xc9fa('0x7'));var HOST=_0xc9fa('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x44590d){return new BPromise(function(_0x478990,_0x20a7c7){var _0x5b24b3=util[_0xc9fa('0x9')](_0xc9fa('0xa'),HOST,_0x44590d,module[_0xc9fa('0xb')]['version']);if(oldToken){_0x5b24b3=util[_0xc9fa('0x9')](_0xc9fa('0xc'),HOST,_0x44590d,module[_0xc9fa('0xb')]['version'],oldToken);}var _0xfc56f2={'uri':_0x5b24b3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xfc56f2)['then'](function(_0x28d971){_0x478990(_0x28d971);})[_0xc9fa('0xd')](function(_0x741e9e){_0x20a7c7(_0x741e9e);});});}function encryptDate(_0x35d9d7){var _0x5653c4=crypto[_0xc9fa('0xe')](_0xc9fa('0xf'),config[_0xc9fa('0x10')]['session']);var _0x102da1=_0x5653c4[_0xc9fa('0x11')](_0x35d9d7,'utf8',_0xc9fa('0x12'));_0x102da1+=_0x5653c4[_0xc9fa('0x13')](_0xc9fa('0x12'));return _0x102da1;}function decryptDate(_0x58f627){var _0x526336=crypto[_0xc9fa('0x14')]('aes-256-ctr',config['secrets'][_0xc9fa('0x15')]);var _0x464457=_0x526336[_0xc9fa('0x11')](_0x58f627,_0xc9fa('0x12'),_0xc9fa('0x16'));_0x464457+=_0x526336[_0xc9fa('0x13')](_0xc9fa('0x16'));return _0x464457;}function sendJiraAlert(_0xca60e6,_0x4cc6a8,_0x343668){var _0x27cf94=_0xc9fa('0x17');return db['User'][_0xc9fa('0x18')]({'where':{'role':_0xc9fa('0x19')},'attributes':[_0xc9fa('0x1a'),'email'],'raw':!![]})[_0xc9fa('0x1b')](function(_0x489c61){ADMIN=_0x489c61;_0x27cf94+=_0xc9fa('0x1c')+_0x343668+'|\x0a';_0x27cf94+='|uuid|'+_0xca60e6+'|\x0a';_0x27cf94+='|machineUuid|'+_0x4cc6a8+'|\x0a';_0x27cf94+=_0xc9fa('0x1d')+ADMIN[_0xc9fa('0x1a')]+'|\x0a';_0x27cf94+='|email|'+ADMIN[_0xc9fa('0x1e')]+'|\x0a';return _0x27cf94;})[_0xc9fa('0x1b')](function(_0x28b792){var _0x5443cc=hardware[_0xc9fa('0x1f')]()[_0xc9fa('0x20')];return jira[_0xc9fa('0x21')]({'key':'MOTLICENSE','summary':_0xc9fa('0x22'),'description':_0x28b792,'issuetype':_0xc9fa('0x23'),'oldToken':_0xca60e6,'newToken':_0x4cc6a8,'email':ADMIN[_0xc9fa('0x1e')],'name':ADMIN[_0xc9fa('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x5443cc});});}function manageLicense(_0x27ac5c,_0x37f200){var _0x4ce302=_0x37f200['get']({'plain':!![]});httpRequest(_0x27ac5c)[_0xc9fa('0x1b')](function(_0x23be65){if(oldToken){oldToken=undefined;}if(_0x23be65[_0xc9fa('0x24')]){if(!_0x4ce302[_0xc9fa('0x25')]&&_0x4ce302[_0xc9fa('0x25')]!=_0x23be65['license']||_0x4ce302[_0xc9fa('0x25')]&&_0x4ce302[_0xc9fa('0x26')]){logger[_0xc9fa('0x27')](_0xc9fa('0x28'));}if(_0x4ce302[_0xc9fa('0x25')]&&!_0x4ce302['data2']&&_0x4ce302[_0xc9fa('0x25')]!=_0x23be65['license']){logger[_0xc9fa('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4ce302['license']&&!_0x4ce302[_0xc9fa('0x26')]&&_0x4ce302['license']==_0x23be65[_0xc9fa('0x25')]){return _0x37f200;}return _0x37f200[_0xc9fa('0x11')]({'data1':_0x27ac5c,'data2':null,'license':_0x23be65[_0xc9fa('0x25')]});}else{if(_0x23be65[_0xc9fa('0x25')]||_0x4ce302[_0xc9fa('0x25')]){if(!_0x4ce302[_0xc9fa('0x26')]){if(_0x4ce302['data1']==_0x27ac5c){GRAY_PERIOD_REASON=_0xc9fa('0x29');logger[_0xc9fa('0x27')](_0xc9fa('0x2a'));}else{GRAY_PERIOD_REASON=_0xc9fa('0x2b');oldToken=_0x4ce302[_0xc9fa('0x2c')];logger[_0xc9fa('0x27')](_0xc9fa('0x2d'),_0x4ce302['data1'],_0x27ac5c);}sendJiraAlert(_0x4ce302[_0xc9fa('0x2c')],_0x23be65[_0xc9fa('0x2e')],GRAY_PERIOD_REASON);logger[_0xc9fa('0x27')](_0xc9fa('0x2f'),GRAY_PERIOD_REASON[_0xc9fa('0x30')](),moment()[_0xc9fa('0x9')](_0xc9fa('0x31')));return _0x37f200['update']({'data2':encryptDate(moment()[_0xc9fa('0x9')](_0xc9fa('0x31')))});}else{if(moment()['diff'](decryptDate(_0x4ce302[_0xc9fa('0x26')]),_0xc9fa('0x32'))>DAYS){logger[_0xc9fa('0x27')](_0xc9fa('0x33'),moment()[_0xc9fa('0x9')](_0xc9fa('0x31')));return _0x37f200['update']({'data1':_0x27ac5c,'data2':null,'license':null});}}}else{if(_0x4ce302[_0xc9fa('0x2c')]!=_0x27ac5c){logger[_0xc9fa('0x27')](_0xc9fa('0x2d'),_0x4ce302[_0xc9fa('0x2c')],_0x27ac5c);return _0x37f200[_0xc9fa('0x11')]({'data1':_0x27ac5c,'data2':null,'license':null});}}}return _0x37f200;})[_0xc9fa('0x1b')](function(_0x5a5f3d){_0x37f200=_0x5a5f3d;})['catch'](function(_0x16683f){logger[_0xc9fa('0x34')](_0x16683f[_0xc9fa('0x35')]);})[_0xc9fa('0x36')](function(){setTimeout(function(){manageLicense(hardware[_0xc9fa('0x37')](),_0x37f200);},TIME);});}function defaultLicense(){var _0x36cbf7=hardware[_0xc9fa('0x37')]();if(_0x36cbf7){return db['License'][_0xc9fa('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x36cbf7}})[_0xc9fa('0x39')](function(_0x21968c,_0xb74081){logger[_0xc9fa('0x27')](_0xc9fa('0x3a'),_0x36cbf7);manageLicense(_0x36cbf7,_0x21968c);})[_0xc9fa('0xd')](function(_0x57cd7e){logger['error'](_0x57cd7e['message']);});}}exports[_0xc9fa('0x3b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d9d1fa6..0d2ca01 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 _0x4091=['crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','parse','uuid','machineUuid','getUuid','secrets','session','update','final','add','days','format','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','find','defaults','checkLicense'];(function(_0x3b0b05,_0x425360){var _0x5ef8f5=function(_0x32c83a){while(--_0x32c83a){_0x3b0b05['push'](_0x3b0b05['shift']());}};_0x5ef8f5(++_0x425360);}(_0x4091,0x1ad));var _0x1409=function(_0x4b5df5,_0x50c91c){_0x4b5df5=_0x4b5df5-0x0;var _0x17098b=_0x4091[_0x4b5df5];return _0x17098b;};'use strict';var crypto=require(_0x1409('0x0'));var util=require(_0x1409('0x1'));var _=require(_0x1409('0x2'));var moment=require(_0x1409('0x3'));var hardware=require(_0x1409('0x4'));var config=require(_0x1409('0x5'));var db=require(_0x1409('0x6'))['db'];function checkLicense(_0x6b9309,_0x470ea9){if(_0x6b9309){try{var _0x581627=_0x470ea9||_0x6b9309[_0x1409('0x7')];if(_[_0x1409('0x8')](_0x581627)){throw new Error(_0x1409('0x9'));}var _0x57b33f=_0x6b9309[_0x1409('0xa')];var _0x2aafd8=_0x6b9309[_0x1409('0xb')];var _0x5b87ec=_0x57b33f[_0x1409('0xc')]('-')[0x4];var _0x435d33=_0x57b33f[_0x1409('0xc')]('-')[0x0];var _0x418513=crypto[_0x1409('0xd')](_0x1409('0xe'),util['format'](_0x1409('0xf'),_0x5b87ec,_0x57b33f,_0x435d33));var _0x1ace5b=_0x418513['update'](_0x581627,_0x1409('0x10'),_0x1409('0x11'));_0x1ace5b+=_0x418513['final'](_0x1409('0x11'));var _0x20a01c=JSON[_0x1409('0x12')](_0x1ace5b);_0x20a01c['demo']=![];_0x20a01c[_0x1409('0x13')]=_0x57b33f;_0x20a01c[_0x1409('0x14')]=hardware[_0x1409('0x15')]();if(_0x2aafd8){var _0x17e271=crypto[_0x1409('0xd')](_0x1409('0xe'),config[_0x1409('0x16')][_0x1409('0x17')]);var _0x1efb9a=_0x17e271[_0x1409('0x18')](_0x2aafd8,_0x1409('0x10'),_0x1409('0x11'));_0x1efb9a+=_0x17e271[_0x1409('0x19')](_0x1409('0x11'));_0x20a01c['gray']=_0x1efb9a;_0x20a01c['deadline']=moment(_0x1efb9a)[_0x1409('0x1a')](0x7,_0x1409('0x1b'))[_0x1409('0x1c')]();_0x20a01c['grayReason']=_0x20a01c[_0x1409('0x13')]!=_0x20a01c[_0x1409('0x14')]?_0x1409('0x1d'):_0x1409('0x1e');}return _0x20a01c;}catch(_0x3f5dae){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1409('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1409('0x20'),'uuid':_0x6b9309['data1'],'machineUuid':hardware[_0x1409('0x15')](),'message':_0x3f5dae[_0x1409('0x21')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1409('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1409('0x22'),'uuid':_0x6b9309['data1'],'machineUuid':hardware[_0x1409('0x15')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x297208){return db[_0x1409('0x23')][_0x1409('0x24')](_[_0x1409('0x25')](_0x297208,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x116db8){return checkLicense(_0x116db8,null);});};exports[_0x1409('0x26')]=checkLicense; \ No newline at end of file +var _0xc175=['crypto','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','parse','demo','machineUuid','getUuid','secrets','session','gray','deadline','days','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','find','then','checkLicense'];(function(_0x5107a3,_0x402944){var _0x1ebb36=function(_0x4b0cb9){while(--_0x4b0cb9){_0x5107a3['push'](_0x5107a3['shift']());}};_0x1ebb36(++_0x402944);}(_0xc175,0x144));var _0x5c17=function(_0x41e684,_0x2c8a48){_0x41e684=_0x41e684-0x0;var _0x213159=_0xc175[_0x41e684];return _0x213159;};'use strict';var crypto=require(_0x5c17('0x0'));var util=require('util');var _=require(_0x5c17('0x1'));var moment=require(_0x5c17('0x2'));var hardware=require(_0x5c17('0x3'));var config=require(_0x5c17('0x4'));var db=require(_0x5c17('0x5'))['db'];function checkLicense(_0xc3a092,_0x364c6e){if(_0xc3a092){try{var _0x32708c=_0x364c6e||_0xc3a092[_0x5c17('0x6')];if(_[_0x5c17('0x7')](_0x32708c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x33a0a1=_0xc3a092[_0x5c17('0x8')];var _0x211a1f=_0xc3a092[_0x5c17('0x9')];var _0x5a2d60=_0x33a0a1[_0x5c17('0xa')]('-')[0x4];var _0x5e45d8=_0x33a0a1[_0x5c17('0xa')]('-')[0x0];var _0xe7dc12=crypto[_0x5c17('0xb')](_0x5c17('0xc'),util['format'](_0x5c17('0xd'),_0x5a2d60,_0x33a0a1,_0x5e45d8));var _0x363ce0=_0xe7dc12[_0x5c17('0xe')](_0x32708c,_0x5c17('0xf'),_0x5c17('0x10'));_0x363ce0+=_0xe7dc12['final'](_0x5c17('0x10'));var _0x642ded=JSON[_0x5c17('0x11')](_0x363ce0);_0x642ded[_0x5c17('0x12')]=![];_0x642ded['uuid']=_0x33a0a1;_0x642ded[_0x5c17('0x13')]=hardware[_0x5c17('0x14')]();if(_0x211a1f){var _0x20ecfb=crypto[_0x5c17('0xb')](_0x5c17('0xc'),config[_0x5c17('0x15')][_0x5c17('0x16')]);var _0x24e718=_0x20ecfb[_0x5c17('0xe')](_0x211a1f,_0x5c17('0xf'),_0x5c17('0x10'));_0x24e718+=_0x20ecfb['final'](_0x5c17('0x10'));_0x642ded[_0x5c17('0x17')]=_0x24e718;_0x642ded[_0x5c17('0x18')]=moment(_0x24e718)['add'](0x7,_0x5c17('0x19'))['format']();_0x642ded[_0x5c17('0x1a')]=_0x642ded['uuid']!=_0x642ded[_0x5c17('0x13')]?'changed':_0x5c17('0x1b');}return _0x642ded;}catch(_0x2847df){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5c17('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5c17('0x1d'),'uuid':_0xc3a092[_0x5c17('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x2847df[_0x5c17('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5c17('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5c17('0x1f'),'uuid':_0xc3a092['data1'],'machineUuid':hardware[_0x5c17('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x5c17('0x20')]=function(_0x484239){return db['License'][_0x5c17('0x21')](_['defaults'](_0x484239,{'raw':!![],'where':{'id':0x1}}))[_0x5c17('0x22')](function(_0x482bf8){return checkLicense(_0x482bf8,null);});};exports[_0x5c17('0x23')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index b704e51..0659a85 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 _0x9de3=['app-id','secret','exports','myappanuglar-secret'];(function(_0x1ce3fa,_0x2a15c2){var _0x27a3b5=function(_0xa3f501){while(--_0xa3f501){_0x1ce3fa['push'](_0x1ce3fa['shift']());}};_0x27a3b5(++_0x2a15c2);}(_0x9de3,0xea));var _0x39de=function(_0x1d1720,_0x4366ed){_0x1d1720=_0x1d1720-0x0;var _0x2a0ed3=_0x9de3[_0x1d1720];return _0x2a0ed3;};'use strict';module[_0x39de('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x39de('0x1'),'GOOGLE_ID':_0x39de('0x2'),'GOOGLE_SECRET':_0x39de('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xf197=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0xf197,0x130));var _0x7f19=function(_0x432d81,_0x27c3d2){_0x432d81=_0x432d81-0x0;var _0x44fbd5=_0xf197[_0x432d81];return _0x44fbd5;};'use strict';module[_0x7f19('0x0')]={'DOMAIN':_0x7f19('0x1'),'SESSION_SECRET':_0x7f19('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5802cef..d21025e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa976=['Console','env','debugLevel','moment','util','path','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','%s-%s','error','transports','info'];(function(_0xaf94ae,_0x1edc05){var _0xdbb51d=function(_0x2dfcac){while(--_0x2dfcac){_0xaf94ae['push'](_0xaf94ae['shift']());}};_0xdbb51d(++_0x1edc05);}(_0xa976,0x1e7));var _0x6a97=function(_0x14bf3b,_0x47031a){_0x14bf3b=_0x14bf3b-0x0;var _0x4fb45b=_0xa976[_0x14bf3b];return _0x4fb45b;};'use strict';var moment=require(_0x6a97('0x0'));var winston=require('winston');var util=require(_0x6a97('0x1'));var path=require(_0x6a97('0x2'));var debugLevel='INFO';function filename(_0x1da473,_0x1d1559){return path[_0x6a97('0x3')](_0x6a97('0x4'),_0x6a97('0x5'),_0x6a97('0x6'),util[_0x6a97('0x7')](_0x6a97('0x8'),_0x1da473,_0x1d1559));}function formatter(_0x20b129,_0x427b2a){return util[_0x6a97('0x7')](_0x6a97('0x9'),moment()[_0x6a97('0x7')](_0x6a97('0xa')),_0x427b2a[_0x6a97('0xb')][_0x6a97('0xc')](),_0x20b129,_0x427b2a['message']);}module[_0x6a97('0xd')]=function(_0x1b1c60){return new winston[(_0x6a97('0xe'))]({'transports':[new winston['transports']['File']({'name':util[_0x6a97('0x7')](_0x6a97('0xf'),_0x1b1c60,'error'),'filename':filename(_0x1b1c60,_0x6a97('0x10')),'level':_0x6a97('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x45e8b7){return formatter(_0x1b1c60,_0x45e8b7);}}),new winston[(_0x6a97('0x11'))]['File']({'name':util[_0x6a97('0x7')](_0x6a97('0xf'),_0x1b1c60,'info'),'filename':filename(_0x1b1c60,_0x6a97('0x12')),'level':_0x6a97('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x36e8d2){return formatter(_0x1b1c60,_0x36e8d2);}}),new winston[(_0x6a97('0x11'))][(_0x6a97('0x13'))]({'level':process[_0x6a97('0x14')][_0x6a97('0x15')]||debugLevel,'json':![],'formatter':function(_0x40635f){return formatter(_0x1b1c60,_0x40635f);}})]});}; \ No newline at end of file +var _0xb6f2=['winston','path','INFO','join','/var','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment'];(function(_0x10eda4,_0x385ce1){var _0x287b7d=function(_0x186c74){while(--_0x186c74){_0x10eda4['push'](_0x10eda4['shift']());}};_0x287b7d(++_0x385ce1);}(_0xb6f2,0xa7));var _0x2b6f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb6f2[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0x2b6f('0x0'));var winston=require(_0x2b6f('0x1'));var util=require('util');var path=require(_0x2b6f('0x2'));var debugLevel=_0x2b6f('0x3');function filename(_0x5b3af1,_0x3be8d8){return path[_0x2b6f('0x4')](_0x2b6f('0x5'),'log',_0x2b6f('0x6'),util[_0x2b6f('0x7')]('%s-%s.log',_0x5b3af1,_0x3be8d8));}function formatter(_0x2594fe,_0xb1f470){return util[_0x2b6f('0x7')](_0x2b6f('0x8'),moment()[_0x2b6f('0x7')](_0x2b6f('0x9')),_0xb1f470['level'][_0x2b6f('0xa')](),_0x2594fe,_0xb1f470[_0x2b6f('0xb')]);}module[_0x2b6f('0xc')]=function(_0x256259){return new winston[(_0x2b6f('0xd'))]({'transports':[new winston[(_0x2b6f('0xe'))][(_0x2b6f('0xf'))]({'name':util['format'](_0x2b6f('0x10'),_0x256259,_0x2b6f('0x11')),'filename':filename(_0x256259,'error'),'level':_0x2b6f('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5ad6ba){return formatter(_0x256259,_0x5ad6ba);}}),new winston[(_0x2b6f('0xe'))][(_0x2b6f('0xf'))]({'name':util[_0x2b6f('0x7')](_0x2b6f('0x10'),_0x256259,_0x2b6f('0x12')),'filename':filename(_0x256259,'info'),'level':_0x2b6f('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e10f5){return formatter(_0x256259,_0x2e10f5);}}),new winston[(_0x2b6f('0xe'))][(_0x2b6f('0x13'))]({'level':process['env'][_0x2b6f('0x14')]||debugLevel,'json':![],'formatter':function(_0x392662){return formatter(_0x256259,_0x392662);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e873265..86e71d7 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 _0x2830=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','email'];(function(_0xf9a431,_0x3692ce){var _0x4d6740=function(_0x4bc38a){while(--_0x4bc38a){_0xf9a431['push'](_0xf9a431['shift']());}};_0x4d6740(++_0x3692ce);}(_0x2830,0x117));var _0x0283=function(_0xb509c2,_0xc778dd){_0xb509c2=_0xb509c2-0x0;var _0x1a63e1=_0x2830[_0xb509c2];return _0x1a63e1;};'use strict';var path=require(_0x0283('0x0'));var os=require('os');var config={'apps':[{'name':_0x0283('0x1'),'script':path[_0x0283('0x2')](__dirname,_0x0283('0x3'))},{'name':_0x0283('0x4'),'script':path[_0x0283('0x2')](__dirname,_0x0283('0x5'))},{'name':'agi','script':path[_0x0283('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x0283('0x6'),'script':path[_0x0283('0x2')](__dirname,_0x0283('0x7'))},{'name':_0x0283('0x8'),'script':path[_0x0283('0x2')](__dirname,_0x0283('0x9'))},{'name':_0x0283('0xa'),'script':path['join'](__dirname,_0x0283('0xb'))}]};module[_0x0283('0xc')]=config; \ No newline at end of file +var _0xe790=['xdr','../../services/xdr/index.js','exports','express','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x13e718,_0x3d6cf9){var _0x16be58=function(_0x888a10){while(--_0x888a10){_0x13e718['push'](_0x13e718['shift']());}};_0x16be58(++_0x3d6cf9);}(_0xe790,0x175));var _0x0e79=function(_0x4cc42e,_0x343d2b){_0x4cc42e=_0x4cc42e-0x0;var _0x570416=_0xe790[_0x4cc42e];return _0x570416;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x0e79('0x0'),'script':path[_0x0e79('0x1')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x0e79('0x1')](__dirname,_0x0e79('0x2'))},{'name':_0x0e79('0x3'),'script':path[_0x0e79('0x1')](__dirname,_0x0e79('0x4'))},{'name':_0x0e79('0x5'),'script':path[_0x0e79('0x1')](__dirname,_0x0e79('0x6'))},{'name':_0x0e79('0x7'),'script':path[_0x0e79('0x1')](__dirname,_0x0e79('0x8'))}]};module[_0x0e79('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4a1c8c0..3bbc914 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 _0x008c=['start','then','disconnect','stop','restart','list','describe','delete','pm2','bluebird','./config','connected'];(function(_0x5714b1,_0x4e94a2){var _0x4b7726=function(_0x1aa001){while(--_0x1aa001){_0x5714b1['push'](_0x5714b1['shift']());}};_0x4b7726(++_0x4e94a2);}(_0x008c,0x188));var _0xc008=function(_0x2ab3e7,_0x1f777d){_0x2ab3e7=_0x2ab3e7-0x0;var _0x2f2877=_0x008c[_0x2ab3e7];return _0x2f2877;};'use strict';var pm2=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var config=require(_0xc008('0x2'));function connect(){return new BPromise(function(_0xae17af,_0x1d119a){return pm2['connect'](function(_0x3641af){if(_0x3641af){return _0x1d119a(_0x3641af);}return _0xae17af(_0xc008('0x3'));});});};exports[_0xc008('0x4')]=function(_0x163bd9){return connect()[_0xc008('0x5')](function(){return new BPromise(function(_0x1679e0,_0x13aa7){return pm2[_0xc008('0x4')](_0x163bd9,function(_0x9c8cb2,_0x4af530){if(_0x9c8cb2){return _0x13aa7(_0x9c8cb2);}pm2[_0xc008('0x6')]();return _0x1679e0(_0x4af530);});});});};exports['stop']=function(_0x30be38){return connect()['then'](function(){return new BPromise(function(_0x52041f,_0x27830d){return pm2[_0xc008('0x7')](_0x30be38,function(_0x57c46d,_0x51ba7d){if(_0x57c46d){return _0x27830d(_0x57c46d);}pm2['disconnect']();return _0x52041f(_0x51ba7d);});});});};exports[_0xc008('0x8')]=function(_0xc881aa){return connect()['then'](function(){return new BPromise(function(_0xae2dab,_0x332fd4){return pm2[_0xc008('0x8')](_0xc881aa,function(_0x2a5b4e,_0x9ffa93){if(_0x2a5b4e){return _0x332fd4(_0x2a5b4e);}pm2[_0xc008('0x6')]();return _0xae2dab(_0x9ffa93);});});});};exports[_0xc008('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x560e28,_0x33f44c){return pm2['list'](function(_0x25e13f,_0x4584e1){if(_0x25e13f){return _0x33f44c(_0x25e13f);}pm2[_0xc008('0x6')]();return _0x560e28(_0x4584e1);});});});};exports[_0xc008('0xa')]=function(_0x3f0ecf){return connect()['then'](function(){return new BPromise(function(_0x5e894e,_0x4bd0f4){return pm2[_0xc008('0xa')](_0x3f0ecf,function(_0x15a6ad,_0x3cafe3){if(_0x15a6ad){return _0x4bd0f4(_0x15a6ad);}pm2[_0xc008('0x6')]();return _0x5e894e(_0x3cafe3);});});});};exports['delete']=function(_0x53b06e){return connect()['then'](function(){return new BPromise(function(_0x5c2668,_0x46042b){return pm2[_0xc008('0xb')](_0x53b06e,function(_0x501137,_0x813397){if(_0x501137){return _0x46042b(_0x501137);}pm2['disconnect']();return _0x5c2668(_0x813397);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x50261c,_0x5754a0){return pm2['dump'](function(_0x5560b1){if(_0x5560b1){return _0x5754a0(_0x5560b1);}return _0x50261c('saved');});});});}; \ No newline at end of file +var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x4d2277,_0x2d9718){var _0x49493a=function(_0x207043){while(--_0x207043){_0x4d2277['push'](_0x4d2277['shift']());}};_0x49493a(++_0x2d9718);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f440a,_0x1d1081){_0x3f440a=_0x3f440a-0x0;var _0x3db8ca=_0xedd9[_0x3f440a];return _0x3db8ca;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7e5b934..6605bf7 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 _0x2b81=['start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x2b81,0x1ef));var _0x12b8=function(_0x4de248,_0x4b3435){_0x4de248=_0x4de248-0x0;var _0x40b8c5=_0x2b81[_0x4de248];return _0x40b8c5;};'use strict';var _=require(_0x12b8('0x0'));var moment=require(_0x12b8('0x1'));var Redis=require(_0x12b8('0x2'));var db=require(_0x12b8('0x3'))['db'];var config=require(_0x12b8('0x4'));config[_0x12b8('0x5')]=_[_0x12b8('0x6')](config[_0x12b8('0x5')],{'host':_0x12b8('0x7'),'port':0x18eb});var io=require(_0x12b8('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x41db95=0x0;var _0x490284=[];return db[_0x12b8('0x9')][_0x12b8('0xa')]({'raw':!![],'attributes':['id',_0x12b8('0xb')],'where':{'id':0x1}})[_0x12b8('0xc')](function(_0x50a615){_0x41db95=_0x50a615[_0x12b8('0xb')];if(_0x41db95){return db[_0x12b8('0xd')][_0x12b8('0xe')]({'raw':!![],'attributes':['id',_0x12b8('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x12b8('0x10')](_0x50a615[_0x12b8('0xb')],_0x12b8('0x11'))}}});}else{return[];}})[_0x12b8('0xc')](function(_0x55e800){_0x490284=_0x55e800;if(_0x41db95){return db[_0x12b8('0xd')]['update']({'closeReason':'system','disposition':_0x12b8('0x12'),'closed':!![],'closedAt':moment()[_0x12b8('0x13')](_0x12b8('0x14'))},{'where':{'id':_['map'](_0x490284||[],'id')}});}})[_0x12b8('0xc')](function(_0x39826c){for(var _0x36323f=0x0;_0x36323f<_0x490284[_0x12b8('0x15')];_0x36323f++){io[_0x12b8('0x16')](_0x12b8('0x17'),{'id':_0x490284[_0x36323f]['id'],'closed':!![]});}})[_0x12b8('0x18')](function(_0x517940){console['error'](_0x517940);});}exports[_0x12b8('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4bd1=['defaults','redis','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','emit','catch','error','start','moment','../../mysqldb','../../config/environment'];(function(_0x21347c,_0x6dd182){var _0x4e280e=function(_0x284399){while(--_0x284399){_0x21347c['push'](_0x21347c['shift']());}};_0x4e280e(++_0x6dd182);}(_0x4bd1,0x90));var _0x14bd=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x4bd1[_0x1795df];return _0x3f13c0;};'use strict';var _=require('lodash');var moment=require(_0x14bd('0x0'));var Redis=require('ioredis');var db=require(_0x14bd('0x1'))['db'];var config=require(_0x14bd('0x2'));config['redis']=_[_0x14bd('0x3')](config[_0x14bd('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x14bd('0x5'))(new Redis(config[_0x14bd('0x4')]));function closeInteractions(){var _0x361ffa=0x0;var _0x31b468=[];return db['Setting'][_0x14bd('0x6')]({'raw':!![],'attributes':['id',_0x14bd('0x7')],'where':{'id':0x1}})[_0x14bd('0x8')](function(_0x2e9a2f){_0x361ffa=_0x2e9a2f[_0x14bd('0x7')];if(_0x361ffa){return db[_0x14bd('0x9')][_0x14bd('0xa')]({'raw':!![],'attributes':['id',_0x14bd('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2e9a2f['chatTimeout'],'minutes')}}});}else{return[];}})[_0x14bd('0x8')](function(_0x1621fa){_0x31b468=_0x1621fa;if(_0x361ffa){return db[_0x14bd('0x9')]['update']({'closeReason':_0x14bd('0xc'),'disposition':_0x14bd('0xd'),'closed':!![],'closedAt':moment()[_0x14bd('0xe')](_0x14bd('0xf'))},{'where':{'id':_[_0x14bd('0x10')](_0x31b468||[],'id')}});}})[_0x14bd('0x8')](function(_0x12f60a){for(var _0x44fd8d=0x0;_0x44fd8d<_0x31b468['length'];_0x44fd8d++){io[_0x14bd('0x11')]('chatInteraction:update',{'id':_0x31b468[_0x44fd8d]['id'],'closed':!![]});}})[_0x14bd('0x12')](function(_0x47e495){console[_0x14bd('0x13')](_0x47e495);});}exports[_0x14bd('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 7454ba9..f83296c 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 _0xba9f=['add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','moment','cron-job-manager','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','format','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','%s.%s','basename','savename','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','map','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt'];(function(_0x200152,_0x2c9a47){var _0xdbba14=function(_0x349a75){while(--_0x349a75){_0x200152['push'](_0x200152['shift']());}};_0xdbba14(++_0x2c9a47);}(_0xba9f,0x16b));var _0xfba9=function(_0x285934,_0x7d493f){_0x285934=_0x285934-0x0;var _0x5b12bf=_0xba9f[_0x285934];return _0x5b12bf;};'use strict';var fs=require('fs');var util=require(_0xfba9('0x0'));var path=require('path');var _=require(_0xfba9('0x1'));var moment=require(_0xfba9('0x2'));var CronJobManager=require(_0xfba9('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../logger')(_0xfba9('0x4'));var db=require(_0xfba9('0x5'))['db'];var analyticCustomReportController=require(_0xfba9('0x6'));var analyticDefaultReportController=require(_0xfba9('0x7'));var client=jayson[_0xfba9('0x8')][_0xfba9('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x377f5a,_0x170d25){return function(){logger[_0xfba9('0xa')](_0xfba9('0xb'),_0x377f5a[_0xfba9('0xc')]);var _0x17e0f4=!![];var _0x8dbd0={'tls':{'rejectUnauthorized':![]}};if(_0x377f5a[_0xfba9('0xd')]['Smtp'][_0xfba9('0xe')]){_0x8dbd0[_0xfba9('0xe')]=_0x377f5a[_0xfba9('0xd')][_0xfba9('0xf')][_0xfba9('0xe')];}else{_0x8dbd0[_0xfba9('0x10')]=_0x377f5a[_0xfba9('0xd')][_0xfba9('0xf')][_0xfba9('0x10')];_0x8dbd0[_0xfba9('0x11')]=_0x377f5a[_0xfba9('0xd')][_0xfba9('0xf')][_0xfba9('0x11')];_0x8dbd0[_0xfba9('0x12')]=_0x377f5a['MailAccount'][_0xfba9('0xf')][_0xfba9('0x12')];}if(_0x377f5a['MailAccount'][_0xfba9('0xf')][_0xfba9('0x13')]){_0x8dbd0[_0xfba9('0x14')]={'user':_0x377f5a[_0xfba9('0xd')][_0xfba9('0xf')]['user'],'pass':_0x377f5a['MailAccount'][_0xfba9('0xf')]['pass']};}var _0x20b7b2={'account':_0x8dbd0,'message':{'from':util[_0xfba9('0x15')]('\x22%s\x22\x20<%s>',_0x377f5a['MailAccount'][_0xfba9('0x16')],_0x377f5a[_0xfba9('0xd')][_0xfba9('0xc')]||_0x377f5a[_0xfba9('0xd')]['Smtp'][_0xfba9('0x17')]),'to':_0x377f5a[_0xfba9('0xc')],'cc':_0x377f5a['cc'],'bcc':_0x377f5a[_0xfba9('0x18')],'subject':util['format'](_0xfba9('0x19'),_0x170d25[_0xfba9('0x16')],_0x377f5a['subtractNumber'],_0x377f5a[_0xfba9('0x1a')])}};var _0x16ca51=path[_0xfba9('0x1b')](__dirname,_0xfba9('0x1c'));var _0x38b32d=_0x170d25['savename'];var _0x15f882=util['format'](_0xfba9('0x1d'),path[_0xfba9('0x1e')](_0x170d25['savename'],path['extname'](_0x170d25[_0xfba9('0x1f')])),_0xfba9('0x20'));var _0x5204d4=path[_0xfba9('0x1b')](_0x16ca51,_0x38b32d);var _0x1a58b0=path[_0xfba9('0x1b')](_0x16ca51,_0x15f882);if(fs['existsSync'](_0x5204d4)){_0x170d25[_0xfba9('0x21')]=_0xfba9('0x22');_0x20b7b2[_0xfba9('0x23')][_0xfba9('0x24')]=[{'filename':_0x38b32d,'path':_0x5204d4}];_0x20b7b2[_0xfba9('0x23')][_0xfba9('0x25')]=util[_0xfba9('0x15')](_0xfba9('0x26'),JSON['stringify'](_0x170d25,null,0x2));}else if(fs['existsSync'](_0x1a58b0)){_0x170d25['status']='Sent';_0x20b7b2[_0xfba9('0x23')]['attachments']=[{'filename':_0x15f882,'path':_0x1a58b0}];}else{_0x20b7b2[_0xfba9('0x23')][_0xfba9('0x25')]=_0xfba9('0x27');if(!_0x377f5a[_0xfba9('0x28')]){_0x17e0f4=![];logger[_0xfba9('0xa')](_0xfba9('0x29'));}}if(_0x17e0f4){return client['request'](_0xfba9('0x2a'),_0x20b7b2)[_0xfba9('0x2b')](function(_0xc86c22){if(_0xc86c22[_0xfba9('0x2c')]){return logger[_0xfba9('0x2c')](_0xfba9('0x2d'),JSON[_0xfba9('0x2e')](_0xc86c22));}return logger[_0xfba9('0xa')]('email\x20sent');})[_0xfba9('0x2f')](function(_0x36ea2a){return logger[_0xfba9('0x2c')]('error\x20mail',JSON['stringify'](_0x36ea2a));});}};}function handleError(){return function(_0x23269b){return logger[_0xfba9('0x2c')](JSON[_0xfba9('0x2e')](_0x23269b));};}function handleResult(_0x325493){return function(_0xff1c51){logger[_0xfba9('0xa')](_0xfba9('0x30'),JSON[_0xfba9('0x2e')](_0xff1c51));if(_0x325493[_0xfba9('0xd')]&&_0x325493[_0xfba9('0xd')][_0xfba9('0xf')]&&!_[_0xfba9('0x31')](_0x325493[_0xfba9('0xc')])){setTimeout(handleSendEmail(_0x325493,_0xff1c51),0x3c*0x3e8);}};}function handleJob(_0x288a5f){return function(){try{if(_[_0xfba9('0x31')](_0x288a5f[_0xfba9('0x32')])){return logger[_0xfba9('0xa')](_0xfba9('0x33'));}if(_['isNil'](_0x288a5f[_0xfba9('0x1a')])){return logger[_0xfba9('0xa')](_0xfba9('0x34'));}var _0x464d6a={'startDate':moment()[_0xfba9('0x35')](_0x288a5f['subtractNumber'],_0x288a5f[_0xfba9('0x1a')])['format'](_0xfba9('0x36')),'endDate':moment()[_0xfba9('0x15')](_0xfba9('0x36')),'type':_0xfba9('0x37'),'output':_0x288a5f[_0xfba9('0x38')],'name':_0x288a5f['name']};if(!_[_0xfba9('0x31')](_0x288a5f['DefaultReportId'])){logger[_0xfba9('0xa')](_0xfba9('0x39'),_0x288a5f[_0xfba9('0x3a')]);return analyticDefaultReportController[_0xfba9('0x3b')]({'id':_0x288a5f[_0xfba9('0x3a')]},_0x464d6a)[_0xfba9('0x2b')](handleResult(_0x288a5f))[_0xfba9('0x2f')](handleError());}if(!_[_0xfba9('0x31')](_0x288a5f[_0xfba9('0x3c')])){logger[_0xfba9('0xa')](_0xfba9('0x3d'),_0x288a5f[_0xfba9('0x3c')]);return analyticCustomReportController[_0xfba9('0x3b')]({'id':_0x288a5f[_0xfba9('0x3c')]},_0x464d6a)[_0xfba9('0x2b')](handleResult(_0x288a5f))[_0xfba9('0x2f')](handleError());}}catch(_0x8c4a31){logger[_0xfba9('0x2c')](JSON[_0xfba9('0x2e')](_0x8c4a31));}return logger[_0xfba9('0xa')](_0xfba9('0x3e'));};}function getJobs(_0x109218){var _0x45786b={};if(_0x109218){_0x45786b['id']=_0x109218;}return db[_0xfba9('0x3f')]['findAll']({'where':_0x45786b,'include':[{'model':db['MailAccount'],'attributes':['id',_0xfba9('0x16'),_0xfba9('0xc')],'include':[{'model':db[_0xfba9('0x40')],'as':_0xfba9('0xf')}]}]})['then'](function(_0x3e26b7){var _0x126099=_['keys'](manager['jobs']);var _0x4c227f=_[_0xfba9('0x41')](_0x3e26b7,function(_0xcba504){return _0xcba504['id'][_0xfba9('0x42')]();});var _0x32d2ab=_['keyBy'](_0x3e26b7,function(_0x3c9f9f){return _0x3c9f9f['id'][_0xfba9('0x42')]();});var _0x4e0e0b=_0x109218?_0x4c227f:_['difference'](_0x4c227f,_0x126099);var _0x34ad98=_[_0xfba9('0x43')](_0x4c227f,_0x126099);var _0x43194e=_[_0xfba9('0x44')](_0x126099,_0x4c227f);var _0xe1dd24;var _0x169dff;for(_0xe1dd24=0x0;_0xe1dd24<_0x43194e[_0xfba9('0x45')]&&!_0x109218;_0xe1dd24+=0x1){_0x169dff=_0x43194e[_0xe1dd24][_0xfba9('0x42')]();if(manager[_0xfba9('0x46')](_0x169dff)){manager[_0xfba9('0x47')](_0x169dff);manager[_0xfba9('0x48')](_0x169dff);logger['info'](_0xfba9('0x49'),_0x169dff);}}logger[_0xfba9('0xa')]('toRun',JSON[_0xfba9('0x2e')](_0x4e0e0b));for(_0xe1dd24=0x0;_0xe1dd24<_0x4e0e0b['length'];_0xe1dd24+=0x1){_0x169dff=_0x4e0e0b[_0xe1dd24][_0xfba9('0x42')]();logger['info']('index',_0x169dff);if(_0x109218){logger[_0xfba9('0xa')](_0xfba9('0x4a'),_0x109218);logger['info'](JSON[_0xfba9('0x2e')](_0x32d2ab[_0x169dff]));BPromise[_0xfba9('0x4b')]()['then'](handleJob(_0x32d2ab[_0x169dff]));logger[_0xfba9('0xa')](_0xfba9('0x4c'),_0x32d2ab[_0x169dff][_0xfba9('0x16')],_0x32d2ab[_0x169dff]['cron']);}else if(_0x32d2ab[_0x169dff][_0xfba9('0x4d')]&&_0x32d2ab[_0x169dff][_0xfba9('0x4e')]&&moment()[_0xfba9('0x4f')](_0x32d2ab[_0x169dff][_0xfba9('0x50')],_0x32d2ab[_0x169dff][_0xfba9('0x51')])){manager[_0xfba9('0x52')](_0x169dff,_0x32d2ab[_0x169dff]['cron'],handleJob(_0x32d2ab[_0x169dff]));manager[_0xfba9('0x53')](_0x169dff);logger[_0xfba9('0xa')](_0xfba9('0x54'),_0x32d2ab[_0x169dff][_0xfba9('0x16')],_0x32d2ab[_0x169dff][_0xfba9('0x4d')]);}else if(manager[_0xfba9('0x46')](_0x169dff)){manager[_0xfba9('0x47')](_0x169dff);manager[_0xfba9('0x48')](_0x169dff);logger[_0xfba9('0xa')](_0xfba9('0x55'),_0x32d2ab[_0x169dff][_0xfba9('0x16')],_0x32d2ab[_0x169dff][_0xfba9('0x4d')]);}}for(_0xe1dd24=0x0,_0x169dff;_0xe1dd24<_0x34ad98[_0xfba9('0x45')]&&!_0x109218;_0xe1dd24+=0x1){_0x169dff=_0x34ad98[_0xe1dd24]['toString']();if(manager[_0xfba9('0x46')](_0x169dff)){if(_0x32d2ab[_0x169dff][_0xfba9('0x4d')]&&_0x32d2ab[_0x169dff][_0xfba9('0x4e')]&&moment()[_0xfba9('0x4f')](_0x32d2ab[_0x169dff][_0xfba9('0x50')],_0x32d2ab[_0x169dff]['endAt'])){manager[_0xfba9('0x56')](_0x169dff,_0x32d2ab[_0x169dff][_0xfba9('0x4d')],handleJob(_0x32d2ab[_0x169dff]));logger[_0xfba9('0xa')](_0xfba9('0x57'),_0x32d2ab[_0x169dff][_0xfba9('0x16')],_0x32d2ab[_0x169dff]['cron']);}else{manager[_0xfba9('0x47')](_0x169dff);manager['deleteJob'](_0x169dff);logger[_0xfba9('0xa')](_0xfba9('0x55'),_0x32d2ab[_0x169dff][_0xfba9('0x16')],_0x32d2ab[_0x169dff]['cron']);}}}})['catch'](function(_0x82f680){logger[_0xfba9('0x2c')](JSON[_0xfba9('0x2e')](_0x82f680));});}exports[_0xfba9('0x58')]=function(_0x115f5b){return getJobs(_0x115f5b);};exports[_0xfba9('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf1bf=['host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractNumber','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','resolve','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','util','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','MailAccount','Smtp','service'];(function(_0x56180e,_0x3ac63a){var _0x59d258=function(_0x1f9372){while(--_0x1f9372){_0x56180e['push'](_0x56180e['shift']());}};_0x59d258(++_0x3ac63a);}(_0xf1bf,0x180));var _0xff1b=function(_0x1ce3f0,_0x4bcfa8){_0x1ce3f0=_0x1ce3f0-0x0;var _0x31b9dd=_0xf1bf[_0x1ce3f0];return _0x31b9dd;};'use strict';var fs=require('fs');var util=require(_0xff1b('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xff1b('0x1'));var CronJobManager=require(_0xff1b('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0xff1b('0x3'));var logger=require(_0xff1b('0x4'))(_0xff1b('0x5'));var db=require(_0xff1b('0x6'))['db'];var analyticCustomReportController=require(_0xff1b('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e4696,_0x282491){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x1e4696['email']);var _0x3ced77=!![];var _0x1211b2={'tls':{'rejectUnauthorized':![]}};if(_0x1e4696[_0xff1b('0x8')][_0xff1b('0x9')][_0xff1b('0xa')]){_0x1211b2[_0xff1b('0xa')]=_0x1e4696['MailAccount'][_0xff1b('0x9')]['service'];}else{_0x1211b2[_0xff1b('0xb')]=_0x1e4696[_0xff1b('0x8')][_0xff1b('0x9')][_0xff1b('0xb')];_0x1211b2[_0xff1b('0xc')]=_0x1e4696[_0xff1b('0x8')]['Smtp']['port'];_0x1211b2[_0xff1b('0xd')]=_0x1e4696[_0xff1b('0x8')]['Smtp'][_0xff1b('0xd')];}if(_0x1e4696[_0xff1b('0x8')][_0xff1b('0x9')]['authentication']){_0x1211b2[_0xff1b('0xe')]={'user':_0x1e4696['MailAccount'][_0xff1b('0x9')][_0xff1b('0xf')],'pass':_0x1e4696[_0xff1b('0x8')][_0xff1b('0x9')][_0xff1b('0x10')]};}var _0xde5664={'account':_0x1211b2,'message':{'from':util[_0xff1b('0x11')](_0xff1b('0x12'),_0x1e4696[_0xff1b('0x8')][_0xff1b('0x13')],_0x1e4696['MailAccount'][_0xff1b('0x14')]||_0x1e4696[_0xff1b('0x8')]['Smtp'][_0xff1b('0xf')]),'to':_0x1e4696[_0xff1b('0x14')],'cc':_0x1e4696['cc'],'bcc':_0x1e4696[_0xff1b('0x15')],'subject':util[_0xff1b('0x11')]('Report\x20%s\x20last\x20%s\x20%s',_0x282491['name'],_0x1e4696['subtractNumber'],_0x1e4696[_0xff1b('0x16')])}};var _0x2560e8=path['join'](__dirname,_0xff1b('0x17'));var _0x469898=_0x282491[_0xff1b('0x18')];var _0x3d1540=util[_0xff1b('0x11')](_0xff1b('0x19'),path[_0xff1b('0x1a')](_0x282491[_0xff1b('0x18')],path[_0xff1b('0x1b')](_0x282491[_0xff1b('0x18')])),_0xff1b('0x1c'));var _0x245dca=path[_0xff1b('0x1d')](_0x2560e8,_0x469898);var _0x5e283f=path[_0xff1b('0x1d')](_0x2560e8,_0x3d1540);if(fs[_0xff1b('0x1e')](_0x245dca)){_0x282491[_0xff1b('0x1f')]=_0xff1b('0x20');_0xde5664['message'][_0xff1b('0x21')]=[{'filename':_0x469898,'path':_0x245dca}];_0xde5664[_0xff1b('0x22')][_0xff1b('0x23')]=util[_0xff1b('0x11')](_0xff1b('0x24'),JSON[_0xff1b('0x25')](_0x282491,null,0x2));}else if(fs[_0xff1b('0x1e')](_0x5e283f)){_0x282491[_0xff1b('0x1f')]=_0xff1b('0x20');_0xde5664['message'][_0xff1b('0x21')]=[{'filename':_0x3d1540,'path':_0x5e283f}];}else{_0xde5664[_0xff1b('0x22')][_0xff1b('0x23')]=_0xff1b('0x26');if(!_0x1e4696['sendIfEmpty']){_0x3ced77=![];logger[_0xff1b('0x27')](_0xff1b('0x28'));}}if(_0x3ced77){return client[_0xff1b('0x29')](_0xff1b('0x2a'),_0xde5664)[_0xff1b('0x2b')](function(_0x152356){if(_0x152356['error']){return logger[_0xff1b('0x2c')](_0xff1b('0x2d'),JSON[_0xff1b('0x25')](_0x152356));}return logger[_0xff1b('0x27')](_0xff1b('0x2e'));})[_0xff1b('0x2f')](function(_0xbbcec5){return logger[_0xff1b('0x2c')](_0xff1b('0x2d'),JSON[_0xff1b('0x25')](_0xbbcec5));});}};}function handleError(){return function(_0x35bcac){return logger[_0xff1b('0x2c')](JSON[_0xff1b('0x25')](_0x35bcac));};}function handleResult(_0x219707){return function(_0x1d38b1){logger[_0xff1b('0x27')](_0xff1b('0x30'),JSON[_0xff1b('0x25')](_0x1d38b1));if(_0x219707['MailAccount']&&_0x219707[_0xff1b('0x8')][_0xff1b('0x9')]&&!_[_0xff1b('0x31')](_0x219707[_0xff1b('0x14')])){setTimeout(handleSendEmail(_0x219707,_0x1d38b1),0x3c*0x3e8);}};}function handleJob(_0x193813){return function(){try{if(_[_0xff1b('0x31')](_0x193813['subtractNumber'])){return logger[_0xff1b('0x27')](_0xff1b('0x32'));}if(_[_0xff1b('0x31')](_0x193813[_0xff1b('0x16')])){return logger[_0xff1b('0x27')]('subtractUnit\x20null\x20or\x20undefined');}var _0x6f0e5c={'startDate':moment()['subtract'](_0x193813[_0xff1b('0x33')],_0x193813[_0xff1b('0x16')])[_0xff1b('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xff1b('0x34'),'output':_0x193813['output'],'name':_0x193813[_0xff1b('0x13')]};if(!_[_0xff1b('0x31')](_0x193813[_0xff1b('0x35')])){logger['info'](_0xff1b('0x36'),_0x193813[_0xff1b('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x193813['DefaultReportId']},_0x6f0e5c)[_0xff1b('0x2b')](handleResult(_0x193813))[_0xff1b('0x2f')](handleError());}if(!_[_0xff1b('0x31')](_0x193813[_0xff1b('0x37')])){logger[_0xff1b('0x27')](_0xff1b('0x38'),_0x193813[_0xff1b('0x37')]);return analyticCustomReportController['runReport']({'id':_0x193813['CustomReportId']},_0x6f0e5c)[_0xff1b('0x2b')](handleResult(_0x193813))[_0xff1b('0x2f')](handleError());}}catch(_0x2937ad){logger[_0xff1b('0x2c')](JSON[_0xff1b('0x25')](_0x2937ad));}return logger[_0xff1b('0x27')](_0xff1b('0x39'));};}function getJobs(_0xcce1b7){var _0x44c632={};if(_0xcce1b7){_0x44c632['id']=_0xcce1b7;}return db['Schedule'][_0xff1b('0x3a')]({'where':_0x44c632,'include':[{'model':db['MailAccount'],'attributes':['id',_0xff1b('0x13'),_0xff1b('0x14')],'include':[{'model':db[_0xff1b('0x3b')],'as':_0xff1b('0x9')}]}]})[_0xff1b('0x2b')](function(_0x34f7b){var _0x18bf8b=_['keys'](manager[_0xff1b('0x3c')]);var _0x369819=_[_0xff1b('0x3d')](_0x34f7b,function(_0xd5122e){return _0xd5122e['id']['toString']();});var _0x23de04=_['keyBy'](_0x34f7b,function(_0x3b8b03){return _0x3b8b03['id'][_0xff1b('0x3e')]();});var _0x2def66=_0xcce1b7?_0x369819:_[_0xff1b('0x3f')](_0x369819,_0x18bf8b);var _0x2fef4e=_[_0xff1b('0x40')](_0x369819,_0x18bf8b);var _0x5db9cb=_[_0xff1b('0x3f')](_0x18bf8b,_0x369819);var _0x456f5a;var _0x531e5a;for(_0x456f5a=0x0;_0x456f5a<_0x5db9cb['length']&&!_0xcce1b7;_0x456f5a+=0x1){_0x531e5a=_0x5db9cb[_0x456f5a][_0xff1b('0x3e')]();if(manager[_0xff1b('0x41')](_0x531e5a)){manager[_0xff1b('0x42')](_0x531e5a);manager[_0xff1b('0x43')](_0x531e5a);logger[_0xff1b('0x27')](_0xff1b('0x44'),_0x531e5a);}}logger[_0xff1b('0x27')]('toRun',JSON[_0xff1b('0x25')](_0x2def66));for(_0x456f5a=0x0;_0x456f5a<_0x2def66[_0xff1b('0x45')];_0x456f5a+=0x1){_0x531e5a=_0x2def66[_0x456f5a][_0xff1b('0x3e')]();logger[_0xff1b('0x27')]('index',_0x531e5a);if(_0xcce1b7){logger[_0xff1b('0x27')]('my\x20id',_0xcce1b7);logger[_0xff1b('0x27')](JSON['stringify'](_0x23de04[_0x531e5a]));BPromise[_0xff1b('0x46')]()[_0xff1b('0x2b')](handleJob(_0x23de04[_0x531e5a]));logger[_0xff1b('0x27')]('run\x20job',_0x23de04[_0x531e5a][_0xff1b('0x13')],_0x23de04[_0x531e5a][_0xff1b('0x47')]);}else if(_0x23de04[_0x531e5a][_0xff1b('0x47')]&&_0x23de04[_0x531e5a][_0xff1b('0x48')]&&moment()[_0xff1b('0x49')](_0x23de04[_0x531e5a][_0xff1b('0x4a')],_0x23de04[_0x531e5a][_0xff1b('0x4b')])){manager['add'](_0x531e5a,_0x23de04[_0x531e5a][_0xff1b('0x47')],handleJob(_0x23de04[_0x531e5a]));manager[_0xff1b('0x4c')](_0x531e5a);logger['info'](_0xff1b('0x4d'),_0x23de04[_0x531e5a][_0xff1b('0x13')],_0x23de04[_0x531e5a]['cron']);}else if(manager['exists'](_0x531e5a)){manager['stop'](_0x531e5a);manager[_0xff1b('0x43')](_0x531e5a);logger[_0xff1b('0x27')](_0xff1b('0x4e'),_0x23de04[_0x531e5a][_0xff1b('0x13')],_0x23de04[_0x531e5a][_0xff1b('0x47')]);}}for(_0x456f5a=0x0,_0x531e5a;_0x456f5a<_0x2fef4e['length']&&!_0xcce1b7;_0x456f5a+=0x1){_0x531e5a=_0x2fef4e[_0x456f5a][_0xff1b('0x3e')]();if(manager[_0xff1b('0x41')](_0x531e5a)){if(_0x23de04[_0x531e5a]['cron']&&_0x23de04[_0x531e5a]['active']&&moment()['isBetween'](_0x23de04[_0x531e5a][_0xff1b('0x4a')],_0x23de04[_0x531e5a]['endAt'])){manager['update'](_0x531e5a,_0x23de04[_0x531e5a][_0xff1b('0x47')],handleJob(_0x23de04[_0x531e5a]));logger[_0xff1b('0x27')]('update\x20cron',_0x23de04[_0x531e5a]['name'],_0x23de04[_0x531e5a][_0xff1b('0x47')]);}else{manager[_0xff1b('0x42')](_0x531e5a);manager[_0xff1b('0x43')](_0x531e5a);logger['info']('stop\x20cron',_0x23de04[_0x531e5a]['name'],_0x23de04[_0x531e5a][_0xff1b('0x47')]);}}}})['catch'](function(_0x1a593f){logger[_0xff1b('0x2c')](JSON[_0xff1b('0x25')](_0x1a593f));});}exports['run']=function(_0x362db4){return getJobs(_0x362db4);};exports[_0xff1b('0x4c')]=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 d373051..bb5e0c7 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddb1=['CmHopper','bulkCreate','hopper2','catch','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','log','finished\x20populating','contacts1'];(function(_0x161b15,_0x3d0725){var _0x4a8e30=function(_0x2e4b74){while(--_0x2e4b74){_0x161b15['push'](_0x161b15['shift']());}};_0x4a8e30(++_0x3d0725);}(_0xddb1,0x144));var _0x1ddb=function(_0x447b09,_0xd49039){_0x447b09=_0x447b09-0x0;var _0xa8614a=_0xddb1[_0x447b09];return _0xa8614a;};'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[_0x1ddb('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1ddb('0x1')+i,'phone':0xf879fb460+i,'email':_0x1ddb('0x2')+i+_0x1ddb('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x1ddb('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1ddb('0x4')](),'updatedAt':Date[_0x1ddb('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1ddb('0x0')]({'id':i,'firstName':_0x1ddb('0x5')+i,'lastName':_0x1ddb('0x1')+i,'phone':0xf879fb460+i,'email':_0x1ddb('0x2')+i+_0x1ddb('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1ddb('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x1ddb('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1ddb('0x4')](),'updatedAt':Date[_0x1ddb('0x4')]()});}db[_0x1ddb('0x6')][_0x1ddb('0x7')]({'where':{}})[_0x1ddb('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x1ddb('0x8')](function(){console[_0x1ddb('0x9')](_0x1ddb('0xa'),_0x1ddb('0xb'));return db[_0x1ddb('0xc')][_0x1ddb('0x7')]({'where':{}});})[_0x1ddb('0x8')](function(){return db['CmHopper'][_0x1ddb('0xd')](hopper);})['then'](function(){console['log'](_0x1ddb('0xa'),'hopper1');return db[_0x1ddb('0x6')][_0x1ddb('0xd')](contacts2);})[_0x1ddb('0x8')](function(){console['log'](_0x1ddb('0xa'),'contacts2');return db[_0x1ddb('0xc')][_0x1ddb('0xd')](hopper2);})['then'](function(){console['log'](_0x1ddb('0xa'),_0x1ddb('0xe'));})[_0x1ddb('0xf')](function(_0x32d7d0){console['log'](_0x32d7d0);}); \ No newline at end of file +var _0x9398=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','hopper1','hopper2','util','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy'];(function(_0x5e33dc,_0x89dce5){var _0x28b62b=function(_0x342ba3){while(--_0x342ba3){_0x5e33dc['push'](_0x5e33dc['shift']());}};_0x28b62b(++_0x89dce5);}(_0x9398,0x17e));var _0x8939=function(_0x16ff8a,_0x1b6806){_0x16ff8a=_0x16ff8a-0x0;var _0x375507=_0x9398[_0x16ff8a];return _0x375507;};'use strict';var util=require(_0x8939('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8939('0x1')]({'id':i,'firstName':_0x8939('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8939('0x3')+i+_0x8939('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8939('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8939('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8939('0x5')](),'updatedAt':Date[_0x8939('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x8939('0x2')+i,'lastName':_0x8939('0x6')+i,'phone':0xf879fb460+i,'email':_0x8939('0x3')+i+_0x8939('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8939('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8939('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8939('0x5')](),'updatedAt':Date[_0x8939('0x5')]()});}db[_0x8939('0x7')][_0x8939('0x8')]({'where':{}})['then'](function(){return db[_0x8939('0x7')][_0x8939('0x9')](contacts);})['then'](function(){console[_0x8939('0xa')](_0x8939('0xb'),_0x8939('0xc'));return db[_0x8939('0xd')]['destroy']({'where':{}});})[_0x8939('0xe')](function(){return db[_0x8939('0xd')][_0x8939('0x9')](hopper);})[_0x8939('0xe')](function(){console[_0x8939('0xa')](_0x8939('0xb'),_0x8939('0xf'));return db['CmContact'][_0x8939('0x9')](contacts2);})[_0x8939('0xe')](function(){console[_0x8939('0xa')](_0x8939('0xb'),'contacts2');return db[_0x8939('0xd')][_0x8939('0x9')](hopper2);})['then'](function(){console['log'](_0x8939('0xb'),_0x8939('0x10'));})['catch'](function(_0x52d605){console['log'](_0x52d605);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4e7f8e0..0fdf4f4 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0b2=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','all'];(function(_0x16c0f6,_0x48316f){var _0x16b3ec=function(_0x155ee3){while(--_0x155ee3){_0x16c0f6['push'](_0x16c0f6['shift']());}};_0x16b3ec(++_0x48316f);}(_0xa0b2,0x170));var _0x2a0b=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xa0b2[_0x1acc2d];return _0xabfa6d;};'use strict';var util=require(_0x2a0b('0x0'));var db=require(_0x2a0b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2a0b('0x2')]({'name':util[_0x2a0b('0x3')](_0x2a0b('0x4'),'agent',i),'fullname':util[_0x2a0b('0x3')](_0x2a0b('0x4'),_0x2a0b('0x5'),i),'email':util[_0x2a0b('0x3')](_0x2a0b('0x6'),_0x2a0b('0x5'),i),'role':_0x2a0b('0x5'),'password':_0x2a0b('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x2a0b('0x8'),'ws','wss'],'disallow':[_0x2a0b('0x9')],'allow':[_0x2a0b('0xa')],'defaultuser':util[_0x2a0b('0x3')](_0x2a0b('0x4'),_0x2a0b('0x5'),i),'encryption':_0x2a0b('0xb'),'avpf':_0x2a0b('0xb'),'force_avp':_0x2a0b('0xb'),'icesupport':'yes','dtlsenable':_0x2a0b('0xb'),'dtlsverify':'no','dtlscertfile':_0x2a0b('0xc'),'dtlsprivatekey':_0x2a0b('0xd'),'dtlssetup':'actpass','callerid':util['format'](_0x2a0b('0xe'),util[_0x2a0b('0x3')](_0x2a0b('0x4'),'agent',i),0xfa0+i)});}db[_0x2a0b('0xf')][_0x2a0b('0x10')](users)[_0x2a0b('0x11')](function(){console[_0x2a0b('0x12')](_0x2a0b('0x13'));})[_0x2a0b('0x14')](function(_0x4b6df1){console[_0x2a0b('0x12')](_0x4b6df1);}); \ No newline at end of file +var _0x6525=['actpass','User','bulkCreate','then','log','util','../mysqldb','push','format','%s%s','agent','password','friend','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x5a6323,_0x47e8bb){var _0x26213c=function(_0x34d454){while(--_0x34d454){_0x5a6323['push'](_0x5a6323['shift']());}};_0x26213c(++_0x47e8bb);}(_0x6525,0x83));var _0x5652=function(_0x242c29,_0x168f0a){_0x242c29=_0x242c29-0x0;var _0x3f4d1c=_0x6525[_0x242c29];return _0x3f4d1c;};'use strict';var util=require(_0x5652('0x0'));var db=require(_0x5652('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5652('0x2')]({'name':util[_0x5652('0x3')]('%s%s','agent',i),'fullname':util[_0x5652('0x3')](_0x5652('0x4'),_0x5652('0x5'),i),'email':util[_0x5652('0x3')]('%s%s@xcally.com',_0x5652('0x5'),i),'role':_0x5652('0x5'),'password':_0x5652('0x6'),'internal':0xfa0+i,'type':_0x5652('0x7'),'transport':['udp','ws','wss'],'disallow':[_0x5652('0x8')],'allow':[_0x5652('0x9')],'defaultuser':util[_0x5652('0x3')](_0x5652('0x4'),_0x5652('0x5'),i),'encryption':'yes','avpf':_0x5652('0xa'),'force_avp':_0x5652('0xa'),'icesupport':'yes','dtlsenable':_0x5652('0xa'),'dtlsverify':'no','dtlscertfile':_0x5652('0xb'),'dtlsprivatekey':_0x5652('0xc'),'dtlssetup':_0x5652('0xd'),'callerid':util[_0x5652('0x3')]('\x22%s\x22\x20<%s>',util['format']('%s%s',_0x5652('0x5'),i),0xfa0+i)});}db[_0x5652('0xe')][_0x5652('0xf')](users)[_0x5652('0x10')](function(){console[_0x5652('0x11')]('add\x20user');})['catch'](function(_0xe14d55){console[_0x5652('0x11')](_0xe14d55);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0991aaf..e432358 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe29b=['SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','ivr','UserProfileSection','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','UserProfileResource','then','map','resourceId','User','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','user','VoiceQueues','MailQueues','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt'];(function(_0x32882d,_0x2aac4e){var _0x5b047a=function(_0x566bec){while(--_0x566bec){_0x32882d['push'](_0x32882d['shift']());}};_0x5b047a(++_0x2aac4e);}(_0xe29b,0x121));var _0xbe29=function(_0x4f6035,_0x4a2ae1){_0x4f6035=_0x4f6035-0x0;var _0x54569f=_0xe29b[_0x4f6035];return _0x54569f;};'use strict';var _=require(_0xbe29('0x0'));var util=require(_0xbe29('0x1'));var BPromise=require(_0xbe29('0x2'));var db=require(_0xbe29('0x3'))['db'];var config=require(_0xbe29('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xbe29('0x5'),'model':db['User'],'attributes':['id',_0xbe29('0x6'),_0xbe29('0x7')],'raw':!![],'where':{'role':_0xbe29('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xbe29('0x6')],'where':{'role':_0xbe29('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbe29('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0xbe29('0x6')],'where':{'role':_0xbe29('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbe29('0x6'),'type'],'where':{'type':_0xbe29('0xa')}};function getAssociatedResources(_0x3cca60,_0x1119e9,_0x5b2627){return db[_0xbe29('0xb')]['findOne']({'where':{'name':_0x3cca60,'userProfileId':_0x1119e9},'raw':!![]})['then'](function(_0x56269c){if(_0x56269c){if(_0x56269c[_0xbe29('0xc')]){switch(_0x3cca60){case'VoiceQueues':case _0xbe29('0xd'):case _0xbe29('0xe'):case _0xbe29('0xf'):case'MailQueues':case _0xbe29('0x10'):return db[_0x5b2627][_0xbe29('0x11')](queryQueues);case _0xbe29('0x12'):return db[_0x5b2627][_0xbe29('0x11')](queryTelephones);case'Trunks':return db[_0x5b2627][_0xbe29('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x5b2627]['findAll'](queryCampaigns);}}else{return db[_0xbe29('0x13')][_0xbe29('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x56269c['id']},'raw':!![]})[_0xbe29('0x14')](function(_0x1f78e8){if(_0x1f78e8){var _0x126378={'where':{'id':_[_0xbe29('0x15')](_0x1f78e8,_0xbe29('0x16'))},'raw':!![]};switch(_0x5b2627){case _0xbe29('0x17'):_0x126378[_0xbe29('0x18')][_0xbe29('0x7')]='telephone';break;case _0xbe29('0x19'):_0x126378[_0xbe29('0x18')][_0xbe29('0x1a')]='ivr';break;}return db[_0x5b2627][_0xbe29('0x11')](_0x126378);}else{return[];}});}}else{return[];}})[_0xbe29('0x14')](function(_0x4b1c86){return _0x4b1c86;});}function joinOrLeaveQueues(_0x26ff0a,_0x46c768,_0x50c1ac,_0x151178){_0x26ff0a[_0x46c768](util[_0xbe29('0x1b')](_0xbe29('0x1c'),_0x50c1ac,_0x151178[_0xbe29('0x6')]));if(_0x151178[_0xbe29('0x5')]){for(var _0x487b7b=0x0;_0x487b7b<_0x151178[_0xbe29('0x5')][_0xbe29('0x1d')];_0x487b7b+=0x1){_0x26ff0a[_0x46c768](util[_0xbe29('0x1b')](_0xbe29('0x1e'),_0x151178[_0xbe29('0x5')][_0x487b7b]['name']));}}}function joinOrLeave(_0x4ebdd7,_0x43c3c9,_0x78dc5b){var _0x49aa27;if(_0x4ebdd7[_0xbe29('0x1f')]['query']['id']){db[_0xbe29('0x17')][_0xbe29('0x20')]({'attributes':['id',_0xbe29('0x6'),'role',_0xbe29('0x21')],'where':{'id':_0x4ebdd7[_0xbe29('0x1f')]['query']['id']},'include':[{'model':db[_0xbe29('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xbe29('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xbe29('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbe29('0x25')],'as':_0xbe29('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xbe29('0x27')],'as':_0xbe29('0x28'),'attributes':['id'],'raw':!![]}]})[_0xbe29('0x14')](function(_0x236005){if(_0x236005){_0x49aa27=_0x236005;_0x4ebdd7[_0x43c3c9](util[_0xbe29('0x1b')]('user:%s',_0x236005[_0xbe29('0x6')]));var _0x1d0533=[];switch(_0x236005[_0xbe29('0x7')]){case _0xbe29('0x29'):_0x4ebdd7[_0x43c3c9](_0xbe29('0x2a'));_0x4ebdd7[_0x43c3c9](_0xbe29('0x2b'));if(queryQueues[_0xbe29('0x2c')](_0xbe29('0x2d'))){delete queryQueues[_0xbe29('0x2d')];}_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x2f')][_0xbe29('0x11')](queryQueues));_0x1d0533['push'](db[_0xbe29('0x30')][_0xbe29('0x11')](queryQueues));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x31')]['findAll'](queryQueues));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x32')][_0xbe29('0x11')](queryQueues));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x33')][_0xbe29('0x11')](queryQueues));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x34')][_0xbe29('0x11')](queryQueues));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x17')]['findAll'](queryTelephones));_0x1d0533[_0xbe29('0x2e')](db['Trunk']['findAll'](queryTrunks));_0x1d0533[_0xbe29('0x2e')](db['Campaign']['findAll'](queryCampaigns));_0x1d0533[_0xbe29('0x2e')](db['User'][_0xbe29('0x11')](queryAgents));break;case _0xbe29('0x35'):_0x4ebdd7[_0x43c3c9]('voice:inbound');_0x4ebdd7[_0x43c3c9]('voice:outbound');_0x1d0533[_0xbe29('0x2e')](getAssociatedResources(_0xbe29('0x36'),_0x236005[_0xbe29('0x21')],_0xbe29('0x2f')));_0x1d0533[_0xbe29('0x2e')](getAssociatedResources(_0xbe29('0xd'),_0x236005[_0xbe29('0x21')],'ChatQueue'));_0x1d0533[_0xbe29('0x2e')](getAssociatedResources('FaxQueues',_0x236005['userProfileId'],_0xbe29('0x31')));_0x1d0533['push'](getAssociatedResources(_0xbe29('0xf'),_0x236005[_0xbe29('0x21')],_0xbe29('0x32')));_0x1d0533['push'](getAssociatedResources(_0xbe29('0x37'),_0x236005[_0xbe29('0x21')],'MailQueue'));_0x1d0533[_0xbe29('0x2e')](getAssociatedResources(_0xbe29('0x10'),_0x236005[_0xbe29('0x21')],_0xbe29('0x34')));_0x1d0533[_0xbe29('0x2e')](getAssociatedResources(_0xbe29('0x12'),_0x236005[_0xbe29('0x21')],_0xbe29('0x17')));_0x1d0533[_0xbe29('0x2e')](getAssociatedResources('Trunks',_0x236005[_0xbe29('0x21')],_0xbe29('0x38')));_0x1d0533['push'](getAssociatedResources(_0xbe29('0x39'),_0x236005[_0xbe29('0x21')],_0xbe29('0x19')));_0x1d0533[_0xbe29('0x2e')](db[_0xbe29('0x17')][_0xbe29('0x11')](queryAgents));break;case _0xbe29('0x8'):_0x4ebdd7[_0x43c3c9](_0xbe29('0x2a'));_0x4ebdd7[_0x43c3c9](_0xbe29('0x2b'));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3a')]({'attributes':['id',_0xbe29('0x6')]}));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3b')]({'attributes':['id',_0xbe29('0x6')]}));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3c')]({'attributes':['id','name']}));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3d')]({'attributes':['id',_0xbe29('0x6')]}));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3e')]({'attributes':['id',_0xbe29('0x6')]}));_0x1d0533[_0xbe29('0x2e')](_0x236005[_0xbe29('0x3f')]({'attributes':['id',_0xbe29('0x6')]}));break;}return BPromise[_0xbe29('0x40')](_0x1d0533);}})[_0xbe29('0x14')](function(_0x166808){if(_0x166808&&_0x166808['length']){for(var _0x27fa52=0x0;_0x27fa52<_0x166808[_0xbe29('0x1d')];_0x27fa52+=0x1){for(var _0x2a2e6c=0x0;_0x2a2e6c<_0x166808[_0x27fa52]['length'];_0x2a2e6c+=0x1){switch(_0x27fa52){case 0x0:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,_0xbe29('0x41'),_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x1:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,_0xbe29('0x42'),_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x2:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,'fax',_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x3:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,'sms',_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x4:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,_0xbe29('0x43'),_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x5:joinOrLeaveQueues(_0x4ebdd7,_0x43c3c9,_0xbe29('0x44'),_0x166808[_0x27fa52][_0x2a2e6c]);break;case 0x6:_0x4ebdd7[_0x43c3c9](util['format'](_0xbe29('0x45'),_0x166808[_0x27fa52][_0x2a2e6c]['name']));break;case 0x7:_0x4ebdd7[_0x43c3c9](util[_0xbe29('0x1b')](_0xbe29('0x46'),_0x166808[_0x27fa52][_0x2a2e6c]['name']));break;case 0x8:_0x4ebdd7[_0x43c3c9](util['format'](_0xbe29('0x47'),_0x166808[_0x27fa52][_0x2a2e6c][_0xbe29('0x1a')],_0x166808[_0x27fa52][_0x2a2e6c][_0xbe29('0x6')]));break;case 0x9:_0x4ebdd7[_0x43c3c9](util[_0xbe29('0x1b')](_0xbe29('0x1e'),_0x166808[_0x27fa52][_0x2a2e6c][_0xbe29('0x6')]));break;}}}}})['then'](function(){if(_0x43c3c9===_0xbe29('0x48')){var _0x1e1b43=_[_0xbe29('0x15')](_0x49aa27[_0xbe29('0x49')],'id');return _0x49aa27[_0xbe29('0x4a')](_0x1e1b43)[_0xbe29('0x14')](function(){for(var _0x5f7d7a=0x0;_0x5f7d7a<_0x1e1b43[_0xbe29('0x1d')];_0x5f7d7a+=0x1){_0x78dc5b[_0xbe29('0x4b')](_0xbe29('0x4c'),{'ChatInteractionId':Number(_0x1e1b43[_0x5f7d7a]),'UserId':Number(_0x49aa27['id'])});}});}})[_0xbe29('0x14')](function(){if(_0x43c3c9===_0xbe29('0x48')){var _0x1e243e=_['map'](_0x49aa27[_0xbe29('0x23')],'id');return _0x49aa27[_0xbe29('0x4d')](_0x1e243e)[_0xbe29('0x14')](function(){for(var _0x1c5d24=0x0;_0x1c5d24<_0x1e243e[_0xbe29('0x1d')];_0x1c5d24+=0x1){_0x78dc5b[_0xbe29('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1e243e[_0x1c5d24]),'UserId':Number(_0x49aa27['id'])});}});}})[_0xbe29('0x14')](function(){if(_0x43c3c9===_0xbe29('0x48')){var _0x5c6d47=_['map'](_0x49aa27[_0xbe29('0x4e')],'id');return _0x49aa27['removeFaxInteractions'](_0x5c6d47)[_0xbe29('0x14')](function(){for(var _0x322cef=0x0;_0x322cef<_0x5c6d47[_0xbe29('0x1d')];_0x322cef+=0x1){_0x78dc5b[_0xbe29('0x4b')](_0xbe29('0x4f'),{'FaxInteractionId':Number(_0x5c6d47[_0x322cef]),'UserId':Number(_0x49aa27['id'])});}});}})[_0xbe29('0x14')](function(){if(_0x43c3c9===_0xbe29('0x48')){var _0x374d3f=_[_0xbe29('0x15')](_0x49aa27[_0xbe29('0x26')],'id');return _0x49aa27[_0xbe29('0x50')](_0x374d3f)[_0xbe29('0x14')](function(){for(var _0x1844d6=0x0;_0x1844d6<_0x374d3f[_0xbe29('0x1d')];_0x1844d6+=0x1){_0x78dc5b[_0xbe29('0x4b')](_0xbe29('0x51'),{'SmsInteractionId':Number(_0x374d3f[_0x1844d6]),'UserId':Number(_0x49aa27['id'])});}});}})['then'](function(){if(_0x43c3c9==='leave'){var _0x3a3258=_[_0xbe29('0x15')](_0x49aa27[_0xbe29('0x28')],'id');return _0x49aa27['removeOpenchannelInteractions'](_0x3a3258)[_0xbe29('0x14')](function(){for(var _0x388140=0x0;_0x388140<_0x3a3258['length'];_0x388140+=0x1){_0x78dc5b[_0xbe29('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3a3258[_0x388140]),'UserId':Number(_0x49aa27['id'])});}});}})['catch'](function(_0x625659){_0x4ebdd7[_0xbe29('0x52')](_0x625659);});}}function onDisconnect(_0x226a01,_0x4008c8){joinOrLeave(_0x226a01,'leave',_0x4008c8);}function onConnect(_0x4f030a){joinOrLeave(_0x4f030a,_0xbe29('0x53'));}exports[_0xbe29('0x54')]=function(_0x334131){_0x334131['on'](_0xbe29('0x55'),function(_0x3f1936){_0x3f1936[_0xbe29('0x56')](0x0);_0x3f1936[_0xbe29('0x57')]=_0x3f1936[_0xbe29('0x58')][_0xbe29('0x55')]['remoteAddress']+':'+_0x3f1936[_0xbe29('0x58')]['connection'][_0xbe29('0x59')];_0x3f1936[_0xbe29('0x5a')]=new Date();_0x3f1936['log']=function(_0x5e364a){console[_0xbe29('0x52')](_0xbe29('0x5b')+_0x3f1936[_0xbe29('0x5c')][_0xbe29('0x6')]+'['+_0x3f1936[_0xbe29('0x57')]+']',_0x5e364a);};_0x3f1936['on']('disconnect',function(){onDisconnect(_0x3f1936,_0x334131);_0x3f1936['log'](_0xbe29('0x5d'));});onConnect(_0x3f1936);_0x3f1936['log'](_0xbe29('0x5e'));});}; \ No newline at end of file +var _0x7161=['IvrCampaigns','UserProfileResource','resourceId','map','where','role','type','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','user','voice:inbound','Trunk','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','trunk:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','nsp','DISCONNECTED','CONNECTED','lodash','Agents','User','agent','name','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','Trunks','findAll'];(function(_0x4a9dfc,_0x523ee2){var _0x2ecb56=function(_0x5edd3a){while(--_0x5edd3a){_0x4a9dfc['push'](_0x4a9dfc['shift']());}};_0x2ecb56(++_0x523ee2);}(_0x7161,0x145));var _0x1716=function(_0xa66d3c,_0x645924){_0xa66d3c=_0xa66d3c-0x0;var _0x6bf3f3=_0x7161[_0xa66d3c];return _0x6bf3f3;};'use strict';var _=require(_0x1716('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x1716('0x1'),'model':db[_0x1716('0x2')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x1716('0x3')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1716('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1716('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1716('0x3')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1716('0x4'),'type'],'where':{'type':_0x1716('0x5')}};function getAssociatedResources(_0x2a80e8,_0xda88bc,_0x5ba8d5){return db[_0x1716('0x6')]['findOne']({'where':{'name':_0x2a80e8,'userProfileId':_0xda88bc},'raw':!![]})[_0x1716('0x7')](function(_0x494483){if(_0x494483){if(_0x494483['autoAssociation']){switch(_0x2a80e8){case _0x1716('0x8'):case _0x1716('0x9'):case _0x1716('0xa'):case'SmsQueues':case _0x1716('0xb'):case _0x1716('0xc'):return db[_0x5ba8d5]['findAll'](queryQueues);case'Telephones':return db[_0x5ba8d5]['findAll'](queryTelephones);case _0x1716('0xd'):return db[_0x5ba8d5][_0x1716('0xe')](queryTrunks);case _0x1716('0xf'):return db[_0x5ba8d5][_0x1716('0xe')](queryCampaigns);}}else{return db[_0x1716('0x10')][_0x1716('0xe')]({'attributes':[_0x1716('0x11')],'where':{'sectionId':_0x494483['id']},'raw':!![]})['then'](function(_0x310641){if(_0x310641){var _0x52f762={'where':{'id':_[_0x1716('0x12')](_0x310641,_0x1716('0x11'))},'raw':!![]};switch(_0x5ba8d5){case _0x1716('0x2'):_0x52f762[_0x1716('0x13')][_0x1716('0x14')]='telephone';break;case'Campaign':_0x52f762[_0x1716('0x13')][_0x1716('0x15')]=_0x1716('0x5');break;}return db[_0x5ba8d5][_0x1716('0xe')](_0x52f762);}else{return[];}});}}else{return[];}})[_0x1716('0x7')](function(_0x5840a8){return _0x5840a8;});}function joinOrLeaveQueues(_0x44b6a1,_0x52bf72,_0x2ae6e8,_0x43bfa0){_0x44b6a1[_0x52bf72](util[_0x1716('0x16')]('%s:queue:%s',_0x2ae6e8,_0x43bfa0[_0x1716('0x4')]));if(_0x43bfa0[_0x1716('0x1')]){for(var _0x1bbcd1=0x0;_0x1bbcd1<_0x43bfa0[_0x1716('0x1')][_0x1716('0x17')];_0x1bbcd1+=0x1){_0x44b6a1[_0x52bf72](util[_0x1716('0x16')](_0x1716('0x18'),_0x43bfa0[_0x1716('0x1')][_0x1bbcd1]['name']));}}}function joinOrLeave(_0x324464,_0x4a166d,_0x246e2a){var _0x38da37;if(_0x324464[_0x1716('0x19')][_0x1716('0x1a')]['id']){db[_0x1716('0x2')][_0x1716('0x1b')]({'attributes':['id',_0x1716('0x4'),_0x1716('0x14'),_0x1716('0x1c')],'where':{'id':_0x324464[_0x1716('0x19')][_0x1716('0x1a')]['id']},'include':[{'model':db[_0x1716('0x1d')],'as':_0x1716('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x1716('0x1f')],'as':_0x1716('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x1716('0x21')],'as':_0x1716('0x22'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x1716('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1716('0x24'),'attributes':['id'],'raw':!![]}]})[_0x1716('0x7')](function(_0x3afbec){if(_0x3afbec){_0x38da37=_0x3afbec;_0x324464[_0x4a166d](util[_0x1716('0x16')](_0x1716('0x18'),_0x3afbec[_0x1716('0x4')]));var _0x166c59=[];switch(_0x3afbec[_0x1716('0x14')]){case _0x1716('0x25'):_0x324464[_0x4a166d]('voice:inbound');_0x324464[_0x4a166d](_0x1716('0x26'));if(queryQueues[_0x1716('0x27')](_0x1716('0x28'))){delete queryQueues[_0x1716('0x28')];}_0x166c59['push'](db[_0x1716('0x29')][_0x1716('0xe')](queryQueues));_0x166c59[_0x1716('0x2a')](db[_0x1716('0x2b')]['findAll'](queryQueues));_0x166c59[_0x1716('0x2a')](db[_0x1716('0x2c')]['findAll'](queryQueues));_0x166c59['push'](db[_0x1716('0x2d')][_0x1716('0xe')](queryQueues));_0x166c59[_0x1716('0x2a')](db[_0x1716('0x2e')][_0x1716('0xe')](queryQueues));_0x166c59['push'](db[_0x1716('0x2f')][_0x1716('0xe')](queryQueues));_0x166c59[_0x1716('0x2a')](db['User'][_0x1716('0xe')](queryTelephones));_0x166c59[_0x1716('0x2a')](db['Trunk'][_0x1716('0xe')](queryTrunks));_0x166c59[_0x1716('0x2a')](db['Campaign'][_0x1716('0xe')](queryCampaigns));_0x166c59[_0x1716('0x2a')](db[_0x1716('0x2')][_0x1716('0xe')](queryAgents));break;case _0x1716('0x30'):_0x324464[_0x4a166d](_0x1716('0x31'));_0x324464[_0x4a166d](_0x1716('0x26'));_0x166c59[_0x1716('0x2a')](getAssociatedResources(_0x1716('0x8'),_0x3afbec['userProfileId'],_0x1716('0x29')));_0x166c59['push'](getAssociatedResources(_0x1716('0x9'),_0x3afbec[_0x1716('0x1c')],'ChatQueue'));_0x166c59[_0x1716('0x2a')](getAssociatedResources('FaxQueues',_0x3afbec[_0x1716('0x1c')],_0x1716('0x2c')));_0x166c59[_0x1716('0x2a')](getAssociatedResources('SmsQueues',_0x3afbec['userProfileId'],_0x1716('0x2d')));_0x166c59[_0x1716('0x2a')](getAssociatedResources(_0x1716('0xb'),_0x3afbec['userProfileId'],'MailQueue'));_0x166c59[_0x1716('0x2a')](getAssociatedResources('OpenchannelQueues',_0x3afbec[_0x1716('0x1c')],_0x1716('0x2f')));_0x166c59[_0x1716('0x2a')](getAssociatedResources('Telephones',_0x3afbec[_0x1716('0x1c')],_0x1716('0x2')));_0x166c59[_0x1716('0x2a')](getAssociatedResources(_0x1716('0xd'),_0x3afbec[_0x1716('0x1c')],_0x1716('0x32')));_0x166c59[_0x1716('0x2a')](getAssociatedResources('IvrCampaigns',_0x3afbec[_0x1716('0x1c')],'Campaign'));_0x166c59[_0x1716('0x2a')](db[_0x1716('0x2')]['findAll'](queryAgents));break;case _0x1716('0x3'):_0x324464[_0x4a166d]('voice:inbound');_0x324464[_0x4a166d]('voice:outbound');_0x166c59[_0x1716('0x2a')](_0x3afbec[_0x1716('0x33')]({'attributes':['id',_0x1716('0x4')]}));_0x166c59['push'](_0x3afbec['getChatQueues']({'attributes':['id','name']}));_0x166c59[_0x1716('0x2a')](_0x3afbec[_0x1716('0x34')]({'attributes':['id',_0x1716('0x4')]}));_0x166c59[_0x1716('0x2a')](_0x3afbec[_0x1716('0x35')]({'attributes':['id',_0x1716('0x4')]}));_0x166c59[_0x1716('0x2a')](_0x3afbec[_0x1716('0x36')]({'attributes':['id',_0x1716('0x4')]}));_0x166c59[_0x1716('0x2a')](_0x3afbec[_0x1716('0x37')]({'attributes':['id',_0x1716('0x4')]}));break;}return BPromise[_0x1716('0x38')](_0x166c59);}})[_0x1716('0x7')](function(_0x59136d){if(_0x59136d&&_0x59136d[_0x1716('0x17')]){for(var _0x226673=0x0;_0x226673<_0x59136d[_0x1716('0x17')];_0x226673+=0x1){for(var _0xd127f5=0x0;_0xd127f5<_0x59136d[_0x226673][_0x1716('0x17')];_0xd127f5+=0x1){switch(_0x226673){case 0x0:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x39'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x1:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x3a'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x2:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x3b'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x3:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x3c'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x4:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x3d'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x5:joinOrLeaveQueues(_0x324464,_0x4a166d,_0x1716('0x3e'),_0x59136d[_0x226673][_0xd127f5]);break;case 0x6:_0x324464[_0x4a166d](util['format']('telephone:%s',_0x59136d[_0x226673][_0xd127f5][_0x1716('0x4')]));break;case 0x7:_0x324464[_0x4a166d](util[_0x1716('0x16')](_0x1716('0x3f'),_0x59136d[_0x226673][_0xd127f5][_0x1716('0x4')]));break;case 0x8:_0x324464[_0x4a166d](util[_0x1716('0x16')]('campaign:%s:%s',_0x59136d[_0x226673][_0xd127f5][_0x1716('0x15')],_0x59136d[_0x226673][_0xd127f5][_0x1716('0x4')]));break;case 0x9:_0x324464[_0x4a166d](util[_0x1716('0x16')]('user:%s',_0x59136d[_0x226673][_0xd127f5]['name']));break;}}}}})['then'](function(){if(_0x4a166d==='leave'){var _0x469a8e=_[_0x1716('0x12')](_0x38da37[_0x1716('0x1e')],'id');return _0x38da37[_0x1716('0x40')](_0x469a8e)[_0x1716('0x7')](function(){for(var _0x7bc091=0x0;_0x7bc091<_0x469a8e[_0x1716('0x17')];_0x7bc091+=0x1){_0x246e2a[_0x1716('0x41')](_0x1716('0x42'),{'ChatInteractionId':Number(_0x469a8e[_0x7bc091]),'UserId':Number(_0x38da37['id'])});}});}})[_0x1716('0x7')](function(){if(_0x4a166d===_0x1716('0x43')){var _0x3c9c26=_[_0x1716('0x12')](_0x38da37[_0x1716('0x20')],'id');return _0x38da37[_0x1716('0x44')](_0x3c9c26)[_0x1716('0x7')](function(){for(var _0x20596c=0x0;_0x20596c<_0x3c9c26[_0x1716('0x17')];_0x20596c+=0x1){_0x246e2a['emit'](_0x1716('0x45'),{'MailInteractionId':Number(_0x3c9c26[_0x20596c]),'UserId':Number(_0x38da37['id'])});}});}})['then'](function(){if(_0x4a166d===_0x1716('0x43')){var _0x1e8f30=_[_0x1716('0x12')](_0x38da37[_0x1716('0x22')],'id');return _0x38da37[_0x1716('0x46')](_0x1e8f30)[_0x1716('0x7')](function(){for(var _0xbd228f=0x0;_0xbd228f<_0x1e8f30['length'];_0xbd228f+=0x1){_0x246e2a['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1e8f30[_0xbd228f]),'UserId':Number(_0x38da37['id'])});}});}})[_0x1716('0x7')](function(){if(_0x4a166d==='leave'){var _0x20dfc7=_['map'](_0x38da37[_0x1716('0x23')],'id');return _0x38da37['removeSmsInteractions'](_0x20dfc7)[_0x1716('0x7')](function(){for(var _0x222b5c=0x0;_0x222b5c<_0x20dfc7['length'];_0x222b5c+=0x1){_0x246e2a['emit'](_0x1716('0x47'),{'SmsInteractionId':Number(_0x20dfc7[_0x222b5c]),'UserId':Number(_0x38da37['id'])});}});}})[_0x1716('0x7')](function(){if(_0x4a166d==='leave'){var _0x1a590d=_['map'](_0x38da37[_0x1716('0x24')],'id');return _0x38da37['removeOpenchannelInteractions'](_0x1a590d)['then'](function(){for(var _0x1e4e24=0x0;_0x1e4e24<_0x1a590d[_0x1716('0x17')];_0x1e4e24+=0x1){_0x246e2a['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x1a590d[_0x1e4e24]),'UserId':Number(_0x38da37['id'])});}});}})[_0x1716('0x48')](function(_0x3d6281){_0x324464[_0x1716('0x49')](_0x3d6281);});}}function onDisconnect(_0x150c46,_0x126b10){joinOrLeave(_0x150c46,'leave',_0x126b10);}function onConnect(_0x177156){joinOrLeave(_0x177156,_0x1716('0x4a'));}exports[_0x1716('0x4b')]=function(_0x2dbc1d){_0x2dbc1d['on'](_0x1716('0x4c'),function(_0x53810f){_0x53810f[_0x1716('0x4d')](0x0);_0x53810f[_0x1716('0x4e')]=_0x53810f[_0x1716('0x4f')][_0x1716('0x4c')][_0x1716('0x50')]+':'+_0x53810f[_0x1716('0x4f')][_0x1716('0x4c')][_0x1716('0x51')];_0x53810f['connectedAt']=new Date();_0x53810f[_0x1716('0x49')]=function(_0x30fe76){console[_0x1716('0x49')]('SocketIO\x20'+_0x53810f[_0x1716('0x52')][_0x1716('0x4')]+'['+_0x53810f[_0x1716('0x4e')]+']',_0x30fe76);};_0x53810f['on']('disconnect',function(){onDisconnect(_0x53810f,_0x2dbc1d);_0x53810f[_0x1716('0x49')](_0x1716('0x53'));});onConnect(_0x53810f);_0x53810f[_0x1716('0x49')](_0x1716('0x54'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 0f80fab..4de4882 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 _0x2fac=['event','direction','UserId','User','find','name','interface','format','outgoingmessage','closed','SIP/%s','default','hasOwnProperty','model','callback','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel'];(function(_0x1b37be,_0x41b6aa){var _0x5804b5=function(_0x26fc10){while(--_0x26fc10){_0x1b37be['push'](_0x1b37be['shift']());}};_0x5804b5(++_0x41b6aa);}(_0x2fac,0x1c8));var _0xc2fa=function(_0x5ca30d,_0x30ed1d){_0x5ca30d=_0x5ca30d-0x0;var _0x149f57=_0x2fac[_0x5ca30d];return _0x149f57;};'use strict';var util=require('util');var db=require(_0xc2fa('0x0'))['db'];var jayson=require(_0xc2fa('0x1'));var logger=require('../logger')(_0xc2fa('0x2'));var client=jayson[_0xc2fa('0x3')][_0xc2fa('0x4')]({'port':0x232a});var triggers=[{'channel':_0xc2fa('0x5'),'model':_0xc2fa('0x6'),'event':_0xc2fa('0x7'),'condition':_0xc2fa('0x8'),'callback':afterCreate},{'channel':_0xc2fa('0x5'),'model':_0xc2fa('0x6'),'event':_0xc2fa('0x9'),'condition':_0xc2fa('0xa'),'callback':afterUpdate},{'channel':_0xc2fa('0x5'),'model':_0xc2fa('0xb'),'event':_0xc2fa('0x7'),'condition':_0xc2fa('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xc2fa('0xd'),'event':_0xc2fa('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc2fa('0xe'),'model':_0xc2fa('0xd'),'event':_0xc2fa('0x9'),'condition':_0xc2fa('0xa'),'callback':afterUpdate},{'channel':_0xc2fa('0xe'),'model':_0xc2fa('0xf'),'event':_0xc2fa('0x7'),'condition':_0xc2fa('0xc'),'callback':afterCreateMessage},{'channel':_0xc2fa('0x10'),'model':_0xc2fa('0x11'),'event':_0xc2fa('0x7'),'condition':_0xc2fa('0x8'),'callback':afterCreate},{'channel':_0xc2fa('0x10'),'model':'FaxInteraction','event':_0xc2fa('0x9'),'condition':_0xc2fa('0xa'),'callback':afterUpdate},{'channel':_0xc2fa('0x10'),'model':'FaxMessage','event':_0xc2fa('0x7'),'condition':_0xc2fa('0xc'),'callback':afterCreateMessage},{'channel':_0xc2fa('0x12'),'model':'MailInteraction','event':_0xc2fa('0x7'),'condition':_0xc2fa('0x8'),'callback':afterCreate},{'channel':_0xc2fa('0x12'),'model':_0xc2fa('0x13'),'event':_0xc2fa('0x9'),'condition':_0xc2fa('0xa'),'callback':afterUpdate},{'channel':_0xc2fa('0x12'),'model':_0xc2fa('0x14'),'event':_0xc2fa('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xc2fa('0x7'),'condition':_0xc2fa('0x8'),'callback':afterCreate},{'channel':_0xc2fa('0x15'),'model':_0xc2fa('0x16'),'event':_0xc2fa('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xc2fa('0x17'),'event':'afterCreate','condition':_0xc2fa('0xc'),'callback':afterCreateMessage}];function request(_0x112bb6){return client[_0xc2fa('0x18')](_0xc2fa('0x19'),_0x112bb6)[_0xc2fa('0x1a')](function(_0x26b521){logger[_0xc2fa('0x1b')](_0xc2fa('0x1c'),_0xc2fa('0x19'),_0x26b521);if(_0x26b521['error']){if(_0x26b521[_0xc2fa('0x1d')][_0xc2fa('0x1e')]===0x1f4){logger['error'](_0xc2fa('0x1c'),'EventManager',_0x26b521[_0xc2fa('0x1d')]);}}})[_0xc2fa('0x1f')](function(_0x206b41){logger[_0xc2fa('0x1d')]('Trigger,\x20%s',_0xc2fa('0x19'),_0x206b41);});}function afterCreateMessage(_0x1bf59e,_0x3319c6){return function(_0x48b1a9,_0x35cc03){_0x48b1a9=_0x48b1a9[_0xc2fa('0x20')]({'plain':!![]});_0x48b1a9[_0xc2fa('0x21')]=_0x1bf59e;_0x48b1a9[_0xc2fa('0x22')]=_0x48b1a9[_0xc2fa('0x23')];if(_0x48b1a9[_0xc2fa('0x24')]){return db[_0xc2fa('0x25')][_0xc2fa('0x26')]({'where':{'id':_0x48b1a9[_0xc2fa('0x24')]},'attributes':['id',_0xc2fa('0x27')],'raw':!![]})[_0xc2fa('0x1a')](function(_0x2d00ce){_0x48b1a9[_0xc2fa('0x28')]=util[_0xc2fa('0x29')]('SIP/%s',_0x2d00ce['name']);_0x48b1a9[_0xc2fa('0x21')]=_0x1bf59e;return request({'event':'incomingmessage','message':_0x48b1a9});})[_0xc2fa('0x1f')](function(_0x3013ff){console[_0xc2fa('0x1d')](_0x3013ff);});}else{return request({'event':_0xc2fa('0x2a'),'message':_0x48b1a9});}};}function afterCreate(_0x3517b9,_0x261a34){return function(_0x2ec139,_0x3215ca){_0x2ec139=_0x2ec139[_0xc2fa('0x20')]({'plain':!![]});_0x2ec139[_0xc2fa('0x21')]=_0x3517b9;_0x2ec139[_0xc2fa('0x22')]='opened';return request({'event':_0x261a34,'message':_0x2ec139});};}function afterUpdate(_0x4c19c2,_0x295297){return function(_0x860755,_0x1edc77){if(_0x860755['changed'](_0xc2fa('0x2b'))&&_0x860755[_0xc2fa('0x2b')]){_0x860755=_0x860755['get']({'plain':!![]});_0x860755['channel']=_0x4c19c2;_0x860755[_0xc2fa('0x22')]=_0xc2fa('0x2b');if(_0x860755['UserId']){return db[_0xc2fa('0x25')][_0xc2fa('0x26')]({'where':{'id':_0x860755[_0xc2fa('0x24')]},'attributes':['id','name'],'raw':!![]})['then'](function(_0x50e534){_0x860755['interface']=util['format'](_0xc2fa('0x2c'),_0x50e534[_0xc2fa('0x27')]);return request({'event':_0x295297,'message':_0x860755});})[_0xc2fa('0x1f')](function(_0x170120){console[_0xc2fa('0x1d')](_0x170120);});}else{return request({'event':_0x295297,'message':_0x860755});}}};}exports[_0xc2fa('0x2d')]=function(){for(var _0x5deaf5=0x0;_0x5deaf50x3){var _0x539ff1=/\((.+)\)/;var _0xa8ad7c=_0x5f03a9['rx'][_0x2a20('0x18')](_0x539ff1);if(_0xa8ad7c){_0x2cdcdb=_0xa8ad7c[0x1];}else{_0x2cdcdb=null;}}else{_0x2cdcdb=null;}_0x5f03a9['cb'](null,{'code':_0x2fec71,'result':_0x3c08e0,'extra':_0x2cdcdb});}});_0x2cb810['on'](_0x2a20('0x19'),function(_0x2abce5){_0x52217c[_0x2a20('0xd')](_0x2a20('0x19'),new AGIError(_0x2a20('0x1a'),_0x2abce5['code']));});_0x2cb810['on']('close',function(){_0x52217c['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2cb810['on']('timeout',function(){_0x52217c[_0x2a20('0xd')](_0x2a20('0x1b'),new AGIError(_0x2a20('0x1c')));_0x2cb810[_0x2a20('0x1d')]();});_0x2cb810[_0x2a20('0x1e')](_0x1e585a);this[_0x2a20('0x1f')]=function(_0x4b3603,_0x234c91){var _0x4b3603=_0x4b3603||'',_0x234c91=typeof _0x234c91==_0x2a20('0x12')?_0x234c91:new Function();_0x5f03a9={'tx':_0x4b3603,'rx':'','cb':_0x234c91};_0x2cb810[_0x2a20('0x20')](_0x4b3603+'\x0a');},this[_0x2a20('0x21')]=function(){_0x2cb810[_0x2a20('0x1d')]();};}util[_0x2a20('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x2a20('0x23')][_0x2a20('0x24')]=function(_0x4eede1){return this[_0x2a20('0x1f')]['sync'](this,_0x4eede1);};AGIChannel['prototype'][_0x2a20('0x25')]=function(){return this[_0x2a20('0x24')](_0x2a20('0x26'));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x27')]=function(_0x24571a,_0x5e1f35,_0x30e3ff){_0x24571a=_0x24571a===undefined?_0x2a20('0x28'):_0x24571a;_0x5e1f35=_0x5e1f35===undefined?'5':_0x5e1f35;_0x30e3ff=_0x30e3ff===undefined?'1':_0x30e3ff;return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x2a'),_0x24571a,_0x5e1f35*0x3e8,_0x30e3ff));};AGIChannel[_0x2a20('0x23')]['noop']=function(_0x102f6f){_0x102f6f=_0x102f6f||'NO\x20MESSAGE';return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x2b'),_0x102f6f));};AGIChannel['prototype'][_0x2a20('0x2c')]=function(_0xfcd6c,_0x2faded){if(_[_0x2a20('0x2d')](_0x2faded)){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x2e'),_0xfcd6c,_0x2faded[_0x2a20('0x2f')](',')));}return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x2e'),_0xfcd6c,_0x2faded));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x30')]=function(_0x16cbc4){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x31'),_0x16cbc4));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x32')]=function(_0x4faf77){return this[_0x2a20('0x24')](util[_0x2a20('0x29')]('SET\x20EXTENSION\x20%s',_0x4faf77));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x33')]=function(_0x4f5d13){return this['sendRequest'](util[_0x2a20('0x29')]('SET\x20PRIORITY\x20%s',_0x4f5d13));};AGIChannel[_0x2a20('0x23')][_0x2a20('0xc')]=function(){return this[_0x2a20('0x24')](_0x2a20('0x34'));};AGIChannel['prototype']['setVariable']=function(_0x5c34b5,_0x27b87b){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x35'),_0x5c34b5,_0x27b87b?_0x27b87b[_0x2a20('0x36')]()[_0x2a20('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2a20('0x23')]['sayNumber']=function(_0x10b2c4,_0x1d5294){return this['sendRequest'](util[_0x2a20('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x10b2c4,_0x1d5294));};AGIChannel[_0x2a20('0x23')]['sayDigits']=function(_0x2190e7,_0x1d379a){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x37'),_0x2190e7,_0x1d379a));};AGIChannel[_0x2a20('0x23')]['sayPhonetic']=function(_0xee189e,_0x5cb398){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x38'),_0xee189e,_0x5cb398));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x39')]=function(_0x5b456d,_0x8dcf8,_0x485e88){_0x8dcf8=_0x8dcf8||this[_0x2a20('0x3a')];_0x485e88=_0x485e88||0x1;this['setContext'](_0x5b456d);this[_0x2a20('0x32')](_0x8dcf8);this[_0x2a20('0x33')](_0x485e88);return this[_0x2a20('0x3b')](util[_0x2a20('0x29')](_0x2a20('0x3c'),_0x5b456d,_0x8dcf8,_0x485e88));};AGIChannel['prototype']['getVariable']=function(_0x5c7094){return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x3d'),_0x5c7094));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x3e')]=function(_0x524c87,_0x19b2d9,_0x5d5d99,_0x287449,_0x26456a,_0x5c7c99){_0x19b2d9=_0x19b2d9||_0x2a20('0x3f');_0x5d5d99=_0x5d5d99||'';_0x287449=_0x287449===undefined?-0x1:_0x287449==='-1'?-0x1:_0x287449*0x3e8;_0x26456a=_0x26456a===undefined?'':'s='+_0x26456a;_0x5c7c99=_0x5c7c99?_0x2a20('0x40'):'';return this[_0x2a20('0x24')](util[_0x2a20('0x29')](_0x2a20('0x41'),_0x524c87,_0x19b2d9,_0x5d5d99,_0x287449,_0x5c7c99,_0x26456a));};AGIChannel[_0x2a20('0x23')]['streamFile']=function(_0x456b91,_0x542f3f){_0x542f3f=_0x542f3f||'';return this['sendRequest'](util[_0x2a20('0x29')](_0x2a20('0x42'),_0x456b91,_0x542f3f));};AGIChannel[_0x2a20('0x23')][_0x2a20('0x43')]=function(_0x197426){return this['exec'](_0x2a20('0x44'),_0x197426);};AGIChannel[_0x2a20('0x23')][_0x2a20('0x45')]=function(_0x366049){return this[_0x2a20('0x2c')](_0x2a20('0x46'),_0x366049);};AGIChannel[_0x2a20('0x23')][_0x2a20('0x19')]=function(_0x40823f,_0x167499){this[_0x2a20('0x3b')](util['format'](_0x2a20('0x47'),_0x40823f['id'],_0x40823f[_0x2a20('0x48')],_0x167499));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2a20('0x49')]=AGIChannel; \ No newline at end of file +var _0x71ff=['join','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','EventEmitter','./error','call','setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s'];(function(_0xf61129,_0x523668){var _0xefa38a=function(_0x3c965f){while(--_0x3c965f){_0xf61129['push'](_0xf61129['shift']());}};_0xefa38a(++_0x523668);}(_0x71ff,0x144));var _0xf71f=function(_0x531c55,_0x3f5d48){_0x531c55=_0x531c55-0x0;var _0x2968f9=_0x71ff[_0x531c55];return _0x2968f9;};'use strict';var util=require(_0xf71f('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0xf71f('0x1')];var AGIReply=require('./reply');var AGIError=require(_0xf71f('0x2'));function AGIChannel(_0x2192d9){var _0xc8c2f=this,_0xee8bd0=new AGIReply(),_0x40b4e5=![],_0x1b22d1={};EventEmitter[_0xf71f('0x3')](_0xc8c2f);_0x2192d9[_0xf71f('0x4')](_0xf71f('0x5'));_0x2192d9['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0xee8bd0['setEncoding']('utf8');_0xee8bd0['on'](_0xf71f('0x6'),function(_0x9cbbe6){for(var _0x37f1e5 in _0x9cbbe6){_0xc8c2f[_0x37f1e5]=_0x9cbbe6[_0x37f1e5];}_0xc8c2f['emit'](_0xf71f('0x7'));});_0xee8bd0['on'](_0xf71f('0x8'),function(_0x29b79f){if(_0x29b79f[_0xf71f('0x9')]()==_0xf71f('0xa')){_0xc8c2f[_0xf71f('0xb')](_0xf71f('0xa'));return;}if(_0x29b79f[_0xf71f('0xc')](0x0,0xb)==_0xf71f('0xd')){_0x40b4e5=!![];}if(_0x40b4e5){_0x1b22d1['rx']+=_0x29b79f+'\x0a';if(_0x29b79f['search'](_0xf71f('0xe'))!=-0x1){_0x40b4e5=![];}}else{_0x1b22d1['rx']=_0x29b79f;}if(_0x40b4e5){return;}if(typeof _0x1b22d1['cb']==_0xf71f('0xf')){var _0x4df84b=_0x1b22d1['rx'][_0xf71f('0xc')](0x0,0x3),_0x2d9745=null,_0x27fc48=null;_0x4df84b=parseInt(_0x4df84b);if(isNaN(_0x4df84b)){_0x1b22d1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf71f('0x10')});return;}if(_0x4df84b!=0xc8){_0x1b22d1['cb'](null,{'code':_0x4df84b,'result':-0x1,'extra':'KO'});return;}_0x2d9745=_0x1b22d1['rx'][_0xf71f('0xc')](0x4)[_0xf71f('0x11')](_0xf71f('0x12'),'');if(_0x2d9745[_0xf71f('0x13')]('\x20')!=-0x1){_0x2d9745=_0x2d9745[_0xf71f('0x14')](0x0,_0x2d9745[_0xf71f('0x13')]('\x20'));}if(_[_0xf71f('0x15')](_0x2d9745,'-1')){_0x2d9745=parseInt(_0x2d9745);}_0x27fc48=_0x1b22d1['rx'][_0xf71f('0x16')]('\x20');if(_0x27fc48[_0xf71f('0x17')]==0x3){_0x27fc48=_0x27fc48[0x2][_0xf71f('0xc')](0x1,_0x27fc48[0x2][_0xf71f('0x17')]-0x1);}else if(_0x27fc48[_0xf71f('0x17')]>0x3){var _0xf053fb=/\((.+)\)/;var _0x5482f9=_0x1b22d1['rx'][_0xf71f('0x18')](_0xf053fb);if(_0x5482f9){_0x27fc48=_0x5482f9[0x1];}else{_0x27fc48=null;}}else{_0x27fc48=null;}_0x1b22d1['cb'](null,{'code':_0x4df84b,'result':_0x2d9745,'extra':_0x27fc48});}});_0x2192d9['on'](_0xf71f('0x19'),function(_0x329712){_0xc8c2f[_0xf71f('0xb')]('error',new AGIError(_0xf71f('0x1a'),_0x329712[_0xf71f('0x1b')]));});_0x2192d9['on'](_0xf71f('0x1c'),function(){_0xc8c2f[_0xf71f('0xb')](_0xf71f('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2192d9['on'](_0xf71f('0x1d'),function(){_0xc8c2f[_0xf71f('0xb')](_0xf71f('0x1d'),new AGIError(_0xf71f('0x1e')));_0x2192d9[_0xf71f('0x1f')]();});_0x2192d9[_0xf71f('0x20')](_0xee8bd0);this['command']=function(_0x2c2d11,_0x45562a){var _0x2c2d11=_0x2c2d11||'',_0x45562a=typeof _0x45562a==_0xf71f('0xf')?_0x45562a:new Function();_0x1b22d1={'tx':_0x2c2d11,'rx':'','cb':_0x45562a};_0x2192d9[_0xf71f('0x21')](_0x2c2d11+'\x0a');},this[_0xf71f('0x1c')]=function(){_0x2192d9[_0xf71f('0x1f')]();};}util[_0xf71f('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf71f('0x23')]['sendRequest']=function(_0x3e7bc4){return this[_0xf71f('0x24')][_0xf71f('0x25')](this,_0x3e7bc4);};AGIChannel[_0xf71f('0x23')][_0xf71f('0x26')]=function(){return this[_0xf71f('0x27')](_0xf71f('0x28'));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x29')]=function(_0x1b4e7e,_0x5ea761,_0x5d60de){_0x1b4e7e=_0x1b4e7e===undefined?_0xf71f('0x2a'):_0x1b4e7e;_0x5ea761=_0x5ea761===undefined?'5':_0x5ea761;_0x5d60de=_0x5d60de===undefined?'1':_0x5d60de;return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x2c'),_0x1b4e7e,_0x5ea761*0x3e8,_0x5d60de));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x2d')]=function(_0x43e7c1){_0x43e7c1=_0x43e7c1||_0xf71f('0x2e');return this['sendRequest'](util['format'](_0xf71f('0x2f'),_0x43e7c1));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x30')]=function(_0x2847af,_0x249cd9){if(_[_0xf71f('0x31')](_0x249cd9)){return this[_0xf71f('0x27')](util['format'](_0xf71f('0x32'),_0x2847af,_0x249cd9[_0xf71f('0x33')](',')));}return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x32'),_0x2847af,_0x249cd9));};AGIChannel[_0xf71f('0x23')]['setContext']=function(_0x1c0c5d){return this['sendRequest'](util[_0xf71f('0x2b')](_0xf71f('0x34'),_0x1c0c5d));};AGIChannel[_0xf71f('0x23')]['setExtension']=function(_0x458ee0){return this['sendRequest'](util['format']('SET\x20EXTENSION\x20%s',_0x458ee0));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x35')]=function(_0x5bef4d){return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x36'),_0x5bef4d));};AGIChannel[_0xf71f('0x23')][_0xf71f('0xa')]=function(){return this[_0xf71f('0x27')](_0xf71f('0x37'));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x38')]=function(_0xce39e9,_0x11dbcb){return this['sendRequest'](util[_0xf71f('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xce39e9,_0x11dbcb?_0x11dbcb['toString']()[_0xf71f('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x39')]=function(_0x1ba421,_0x214939){return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x3a'),_0x1ba421,_0x214939));};AGIChannel[_0xf71f('0x23')]['sayDigits']=function(_0x14a19d,_0x40d573){return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x3b'),_0x14a19d,_0x40d573));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x3c')]=function(_0x38c631,_0x59d717){return this[_0xf71f('0x27')](util[_0xf71f('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x38c631,_0x59d717));};AGIChannel['prototype'][_0xf71f('0x3d')]=function(_0x2c3f46,_0x435e7e,_0xc0743e){_0x435e7e=_0x435e7e||this[_0xf71f('0x3e')];_0xc0743e=_0xc0743e||0x1;this[_0xf71f('0x3f')](_0x2c3f46);this['setExtension'](_0x435e7e);this[_0xf71f('0x35')](_0xc0743e);return this[_0xf71f('0x2d')](util[_0xf71f('0x2b')](_0xf71f('0x40'),_0x2c3f46,_0x435e7e,_0xc0743e));};AGIChannel[_0xf71f('0x23')]['getVariable']=function(_0x1eb147){return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x41'),_0x1eb147));};AGIChannel['prototype'][_0xf71f('0x42')]=function(_0x1cdc7c,_0x4ab933,_0x3d391f,_0x1ac688,_0x3e3d00,_0x38b45d){_0x4ab933=_0x4ab933||_0xf71f('0x43');_0x3d391f=_0x3d391f||'';_0x1ac688=_0x1ac688===undefined?-0x1:_0x1ac688==='-1'?-0x1:_0x1ac688*0x3e8;_0x3e3d00=_0x3e3d00===undefined?'':'s='+_0x3e3d00;_0x38b45d=_0x38b45d?'BEEP':'';return this['sendRequest'](util[_0xf71f('0x2b')](_0xf71f('0x44'),_0x1cdc7c,_0x4ab933,_0x3d391f,_0x1ac688,_0x38b45d,_0x3e3d00));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x45')]=function(_0x575c50,_0xb09cbf){_0xb09cbf=_0xb09cbf||'';return this[_0xf71f('0x27')](util[_0xf71f('0x2b')](_0xf71f('0x46'),_0x575c50,_0xb09cbf));};AGIChannel[_0xf71f('0x23')][_0xf71f('0x47')]=function(_0x518947){return this[_0xf71f('0x30')]('AGI',_0x518947);};AGIChannel[_0xf71f('0x23')]['wait']=function(_0x1e40cb){return this[_0xf71f('0x30')](_0xf71f('0x48'),_0x1e40cb);};AGIChannel[_0xf71f('0x23')]['error']=function(_0x253827,_0x368f68){this[_0xf71f('0x2d')](util[_0xf71f('0x2b')](_0xf71f('0x49'),_0x253827['id'],_0x253827['label'],_0x368f68));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf71f('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index baafb54..2ea90f0 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 _0x6012=['Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x56b88d,_0x3c9201){var _0x1040c3=function(_0x2bb93f){while(--_0x2bb93f){_0x56b88d['push'](_0x56b88d['shift']());}};_0x1040c3(++_0x3c9201);}(_0x6012,0xcb));var _0x2601=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x6012[_0x492535];return _0x256620;};'use strict';var util=require(_0x2601('0x0'));var error={'E_AGI_UNDEFINED':_0x2601('0x1'),'E_AGI_ARGUMENT_PORT':_0x2601('0x2'),'E_AGI_SERVER_ERROR':_0x2601('0x3'),'E_AGI_SERVER_CLOSE':_0x2601('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x2601('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x2601('0x6'),'E_AGI_SOCKET_ERROR':_0x2601('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x2601('0x8'),'E_AGI_COMMAND_EMPTY':_0x2601('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2601('0xa'),'E_AGI_IVR_ENTRY':_0x2601('0xb')};function AGIError(_0x4ee5b7){var _0x4ee5b7=_0x4ee5b7||null,_0x4f3e73=_0x4f3e73||[],_0x42d49f=0x1,_0x4a4f80='';if(!error[_0x4ee5b7]){_0x4ee5b7='E_AGI_UNDEFINED';}_0x4f3e73[_0x2601('0xc')](error[_0x4ee5b7]);while(arguments[_0x42d49f]){_0x4f3e73[_0x2601('0xc')](arguments[_0x42d49f]);_0x42d49f++;}_0x4a4f80=util['format']['apply'](util,_0x4f3e73);this[_0x2601('0xd')]=_0x4a4f80;this[_0x2601('0xe')]=_0x4ee5b7;}module['exports']=AGIError; \ No newline at end of file +var _0xa623=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa623,0x16c));var _0x3a62=function(_0x1ac517,_0x6175d0){_0x1ac517=_0x1ac517-0x0;var _0x1518cf=_0xa623[_0x1ac517];return _0x1518cf;};'use strict';var util=require(_0x3a62('0x0'));var error={'E_AGI_UNDEFINED':_0x3a62('0x1'),'E_AGI_ARGUMENT_PORT':_0x3a62('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x3a62('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3a62('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x3a62('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x3a62('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x3a62('0x7')};function AGIError(_0x2023bb){var _0x2023bb=_0x2023bb||null,_0x2b987c=_0x2b987c||[],_0x64a948=0x1,_0x4436ec='';if(!error[_0x2023bb]){_0x2023bb='E_AGI_UNDEFINED';}_0x2b987c[_0x3a62('0x8')](error[_0x2023bb]);while(arguments[_0x64a948]){_0x2b987c['push'](arguments[_0x64a948]);_0x64a948++;}_0x4436ec=util[_0x3a62('0x9')][_0x3a62('0xa')](util,_0x2b987c);this[_0x3a62('0xb')]=_0x4436ec;this[_0x3a62('0xc')]=_0x2023bb;}module[_0x3a62('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4acbb8c..279b5c1 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 _0x3c81=['relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','prototype','addVertex','vertices','edges','addEdge','push','numberOfEdges','size'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x3c81,0x102));var _0x13c8=function(_0x19b43f,_0x296e14){_0x19b43f=_0x19b43f-0x0;var _0xa4fd9b=_0x3c81[_0x19b43f];return _0xa4fd9b;};'use strict';var _=require(_0x13c8('0x0'));var logger=require(_0x13c8('0x1'))('agi');var verticesWithRetry=[_0x13c8('0x2'),_0x13c8('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x13c8('0x4')][_0x13c8('0x5')]=function(_0x18bd0f){this[_0x13c8('0x6')][_0x18bd0f['id']]=_0x18bd0f;this[_0x13c8('0x7')][_0x18bd0f['id']]=[];};Graph[_0x13c8('0x4')][_0x13c8('0x8')]=function(_0x4f7bcc,_0x17c228,_0x4905c3){this[_0x13c8('0x7')][_0x4f7bcc][_0x13c8('0x9')]({'target':_0x17c228,'condition':_0x4905c3});this[_0x13c8('0xa')]+=0x1;};Graph[_0x13c8('0x4')][_0x13c8('0xb')]=function(){return _[_0x13c8('0xb')](this[_0x13c8('0x6')]);};Graph[_0x13c8('0x4')][_0x13c8('0xc')]=function(){return this[_0x13c8('0xa')];};Graph[_0x13c8('0x4')][_0x13c8('0xd')]=function(_0x28417e){return this[_0x13c8('0x6')][_0x28417e];};Graph['prototype'][_0x13c8('0xe')]=function(_0x7b6da8,_0x2304b5){if(!this[_0x13c8('0x6')][_0x7b6da8]){return logger['info'](_0x13c8('0xf'));}var _0x515681=_0x2304b5(this['vertices'][_0x7b6da8]);if(!_0x515681){return logger['info'](_0x13c8('0x10'));}if(this['edges'][_0x7b6da8][_0x13c8('0x11')]===0x0){return logger[_0x13c8('0x12')](_0x13c8('0x13'));}for(var _0x7cbfb=0x0,_0x5d7906=[],_0x13a9e1=![];_0x7cbfb\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','inspect','debug','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','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published'];(function(_0x75ddd6,_0x10af50){var _0x5b5d49=function(_0x58f141){while(--_0x58f141){_0x75ddd6['push'](_0x75ddd6['shift']());}};_0x5b5d49(++_0x10af50);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x6cf8d3,_0x4092cd){_0x6cf8d3=_0x6cf8d3-0x0;var _0x44704a=_0x9f5a[_0x6cf8d3];return _0x44704a;};'use strict';var parser=require(_0xa9f5('0x0'));var _=require(_0xa9f5('0x1'));var syncho=require(_0xa9f5('0x2'));var util=require(_0xa9f5('0x3'));var moment=require('moment');var config=require(_0xa9f5('0x4'));var logger=require(_0xa9f5('0x5'))(_0xa9f5('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0xa9f5('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0xa9f5('0x8'));var Vertices=require(_0xa9f5('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xa9f5('0xa')](config[_0xa9f5('0x6')],{'ip':_0xa9f5('0xb'),'port':0x11dd});function connectionHandler(_0x1f6c78){process[_0xa9f5('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1f6c78);agiHandler(_0x1f6c78);}catch(_0x22a318){logger[_0xa9f5('0xd')](_0x22a318['stack']);}});});}function listeningHandler(){console[_0xa9f5('0xe')](_0xa9f5('0xf'),config['agi'][_0xa9f5('0x10')]);logger[_0xa9f5('0x11')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xa9f5('0x6')]['ip'],config[_0xa9f5('0x6')][_0xa9f5('0x10')]));}function errorHandler(_0x40e07c){if(_0x40e07c&&_0x40e07c['name']&&_0x40e07c[_0xa9f5('0x12')]){logger[_0xa9f5('0xd')](util[_0xa9f5('0x13')]('[%s]\x20%s',_0x40e07c[_0xa9f5('0x14')],_0x40e07c[_0xa9f5('0x12')]));}else{logger['error'](util['format']('[ERROR]\x20%s',_0x40e07c[_0xa9f5('0x15')]));}}function closeHandler(){logger['info'](util['format'](_0xa9f5('0x16'),this[_0xa9f5('0x17')],this[_0xa9f5('0x18')],this[_0xa9f5('0x19')],this['dnid'],this[_0xa9f5('0x1a')]));try{createSquareReport(this);}catch(_0x401ae7){logger[_0xa9f5('0xd')](_0x401ae7[_0xa9f5('0x15')]);}}function timeoutHandler(){logger[_0xa9f5('0x11')](util[_0xa9f5('0x13')](_0xa9f5('0x1b'),this[_0xa9f5('0x17')],this[_0xa9f5('0x18')],this[_0xa9f5('0x19')],this[_0xa9f5('0x1c')],this[_0xa9f5('0x1a')]));}function hangupHandler(){logger['info'](util[_0xa9f5('0x13')](_0xa9f5('0x1d'),this[_0xa9f5('0x17')],this[_0xa9f5('0x18')],this[_0xa9f5('0x19')],this[_0xa9f5('0x1c')],this[_0xa9f5('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x1bf2c7){return parser[_0xa9f5('0x1e')](_0x1bf2c7,{'object':!![]})[_0xa9f5('0x1f')][_0xa9f5('0x20')];}function addVertex(_0xf15d71,_0x2626ca,_0x1a204e){_0x2626ca[_0xa9f5('0x21')]=_0x1a204e;if(_0x2626ca['hasOwnProperty'](_0xa9f5('0x22'))){_0x2626ca[_0xa9f5('0x23')]=parseInt(_0x2626ca[_0xa9f5('0x22')],0xa);}_0xf15d71[_0xa9f5('0x24')](_[_0xa9f5('0x25')](_0x2626ca,_0xa9f5('0x26')));}function initGraph(_0x4aa6ce,_0x3911c8){var _0x49e850=new Graph();for(var _0x53caa4 in _0x4aa6ce){if(_0x4aa6ce['hasOwnProperty'](_0x53caa4)){if(_[_0xa9f5('0x27')](_0x4aa6ce[_0x53caa4])){for(var _0x21c369=0x0;_0x21c369<_0x4aa6ce[_0x53caa4][_0xa9f5('0x28')];_0x21c369+=0x1){addVertex(_0x49e850,_0x4aa6ce[_0x53caa4][_0x21c369],_0x53caa4);}}else{addVertex(_0x49e850,_0x4aa6ce[_0x53caa4],_0x53caa4);}}}for(var _0x20a622=0x0;_0x20a622<_0x3911c8[_0xa9f5('0x28')];_0x20a622+=0x1){if(_0x3911c8[_0x20a622][_0xa9f5('0x29')]&&_0x3911c8[_0x20a622]['target']){_0x49e850[_0xa9f5('0x2a')](_0x3911c8[_0x20a622][_0xa9f5('0x29')],_0x3911c8[_0x20a622][_0xa9f5('0x2b')],_0x3911c8[_0x20a622][_0xa9f5('0x2c')]);}}return _0x49e850;}function getSquareProject(_0x23dee2,_0x1604d1){rpc[_0xa9f5('0x2d')](_0x23dee2)[_0xa9f5('0x2e')](function(_0x5a422b){_0x1604d1(null,_0x5a422b);})['catch'](function(_0x4a4386){_0x1604d1(null,_0x4a4386);});}function createSquareReport(_0x2229ed,_0x30b65f){rpc[_0xa9f5('0x2f')](_0x2229ed)[_0xa9f5('0x2e')](function(_0x33dd3a){if(_0x30b65f){_0x30b65f(null,_0x33dd3a);}})[_0xa9f5('0x30')](function(_0x43c3f3){if(_0x30b65f){_0x30b65f(null,_0x43c3f3);}});}function setChannelVariables(_0x68c4fb){for(var _0xba323c in _0x68c4fb){if(_0x68c4fb[_0xa9f5('0x31')](_0xba323c)){if(_0xba323c[_0xa9f5('0x32')](_0xa9f5('0x33'))===0x0){_0x68c4fb[_0xba323c[_0xa9f5('0x34')](0x4)]=_0x68c4fb[_0xba323c];delete _0x68c4fb[_0xba323c];}}}}function getLogFromObject(_0x553616){return util[_0xa9f5('0x35')](_0x553616,{'showHidden':![],'depth':null});}function agiHandler(_0x16a08e){var _0x2edec5,_0x4518bb,_0x2e36bf,_0x1d6217,_0x2fbdeb;logger[_0xa9f5('0x36')]('variables',JSON[_0xa9f5('0x37')](_0x16a08e,null,0x2));logger['info'](util[_0xa9f5('0x13')](_0xa9f5('0x38'),_0x16a08e['arg_1'],_0x16a08e[_0xa9f5('0x18')],_0x16a08e[_0xa9f5('0x19')],_0x16a08e[_0xa9f5('0x1c')],_0x16a08e[_0xa9f5('0x1a')]));_0x16a08e['on']('error',errorHandler);_0x16a08e['on'](_0xa9f5('0x39'),closeHandler);_0x16a08e['on'](_0xa9f5('0x3a'),timeoutHandler);_0x16a08e['evtHangup']=![];_0x16a08e['on'](_0xa9f5('0x3b'),hangupHandler);var _0x23232b=getSquareProject[_0xa9f5('0x3c')](null,_0x16a08e[_0xa9f5('0x17')]);if(_0x23232b){if(_0x23232b[_0xa9f5('0x3d')]){_0x2edec5=getRoot(_0x23232b[_0xa9f5('0x3d')]);if(_0x2edec5&&_0x2edec5[_0xa9f5('0x3e')]){logger[_0xa9f5('0x36')](_0xa9f5('0x20'),JSON['stringify'](_0x2edec5,null,0x2));_0x16a08e['joinAt']=moment()[_0xa9f5('0x13')](_0xa9f5('0x3f'));_0x4518bb=initGraph(_['omit'](_0x2edec5,_0xa9f5('0x26')),_0x2edec5[_0xa9f5('0x26')]);_0x2e36bf=new Vertices(_0x16a08e,rpc,mailRpc);logger[_0xa9f5('0x11')](util[_0xa9f5('0x13')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x16a08e[_0xa9f5('0x17')],_0x16a08e[_0xa9f5('0x18')],_0x16a08e['callerid'],_0x16a08e[_0xa9f5('0x1c')],_0x16a08e[_0xa9f5('0x1a')]));_0x4518bb['traverseBFS'](_0x2edec5[_0xa9f5('0x3e')]['id'],function(_0x40b5fb){try{_0x40b5fb=_0x2e36bf['clear'](_0x40b5fb);logger[_0xa9f5('0x36')](_0xa9f5('0x40'),JSON['stringify'](_0x40b5fb,null,0x2));if(_0x40b5fb[_0xa9f5('0x21')]===_0xa9f5('0x41')){logger['info'](_0xa9f5('0x42'));_0x16a08e['context']=_0x40b5fb[_0xa9f5('0x43')]||_0x16a08e[_0xa9f5('0x43')];_0x16a08e['extension']=_0x40b5fb[_0xa9f5('0x44')];_0x16a08e['priority']=_0x40b5fb['priority']?_0x40b5fb[_0xa9f5('0x45')]-0x1:0x1;return null;}else if(_0x40b5fb&&_0x2e36bf[_0x40b5fb[_0xa9f5('0x21')]]){_0x2fbdeb=_0x2e36bf[_0x40b5fb[_0xa9f5('0x21')]](_0x40b5fb);logger[_0xa9f5('0x11')](_0xa9f5('0x46'),JSON[_0xa9f5('0x37')](_0x2fbdeb,null,0x2));if(_0x2fbdeb&&_0x2fbdeb[_0xa9f5('0x47')]===AGI_CODE_SUCCESS&&_0x2fbdeb[_0xa9f5('0x48')]!==AGI_RESULT_ERROR&&!_0x16a08e[_0xa9f5('0x49')]){logger['debug'](_0xa9f5('0x46'),getLogFromObject(_0x2fbdeb));return _[_0xa9f5('0x4a')](_0x2fbdeb[_0xa9f5('0x48')])?null:_0x2fbdeb[_0xa9f5('0x48')][_0xa9f5('0x4b')]();}else{logger[_0xa9f5('0xd')](_0xa9f5('0x46'),getLogFromObject(_0x2fbdeb));return null;}}else{logger[_0xa9f5('0xd')](_0xa9f5('0x4c'));return null;}}catch(_0x21dbc9){logger[_0xa9f5('0xd')](_0x21dbc9[_0xa9f5('0x15')]);return null;}});if(_0x2edec5[_0xa9f5('0x4d')]){logger[_0xa9f5('0x11')](util[_0xa9f5('0x13')](_0xa9f5('0x4e'),_0x16a08e[_0xa9f5('0x17')],_0x16a08e[_0xa9f5('0x18')],_0x16a08e[_0xa9f5('0x19')],_0x16a08e['dnid'],_0x16a08e['uniqueid']));_0x4518bb[_0xa9f5('0x4f')](_0x2edec5[_0xa9f5('0x4d')]['id'],function(_0x52ff3e){try{_0x52ff3e=_0x2e36bf[_0xa9f5('0x50')](_0x52ff3e);logger[_0xa9f5('0x36')](_0xa9f5('0x40'),JSON['stringify'](_0x52ff3e,null,0x2));if(_0x52ff3e&&_0x2e36bf[_0x52ff3e[_0xa9f5('0x21')]]){_0x2fbdeb=_0x2e36bf[_0x52ff3e['agicommand']](_0x52ff3e);if(_0x2fbdeb){logger[_0xa9f5('0x36')](_0xa9f5('0x46'),getLogFromObject(_0x2fbdeb));return _[_0xa9f5('0x4a')](_0x2fbdeb[_0xa9f5('0x48')])?null:_0x2fbdeb[_0xa9f5('0x48')][_0xa9f5('0x4b')]();}else{logger['error'](_0xa9f5('0x46'),getLogFromObject(_0x2fbdeb));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x23edf2){logger['error'](_0x23edf2[_0xa9f5('0x15')]);return null;}});}logger['info'](util[_0xa9f5('0x13')](_0xa9f5('0x51'),_0x16a08e[_0xa9f5('0x17')],_0x16a08e['calleridname'],_0x16a08e[_0xa9f5('0x19')],_0x16a08e[_0xa9f5('0x1c')],_0x16a08e[_0xa9f5('0x1a')]));logger['info'](util[_0xa9f5('0x13')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x16a08e['context'],_0x16a08e[_0xa9f5('0x44')],parseInt(_0x16a08e[_0xa9f5('0x45')],0xa)+0x1));_0x16a08e[_0xa9f5('0x52')](_0x16a08e[_0xa9f5('0x43')],_0x16a08e['extension'],parseInt(_0x16a08e[_0xa9f5('0x45')],0xa)+0x1);_0x16a08e['close']();}}else{logger[_0xa9f5('0xd')](util[_0xa9f5('0x13')](_0xa9f5('0x53'),_0x16a08e['arg_1']));_0x16a08e['continueAt'](_0x16a08e[_0xa9f5('0x43')],_0x16a08e[_0xa9f5('0x44')],parseInt(_0x16a08e['priority'],0xa)+0x1);_0x16a08e[_0xa9f5('0x39')]();}}else{logger[_0xa9f5('0xd')](util[_0xa9f5('0x13')](_0xa9f5('0x54'),_0x16a08e[_0xa9f5('0x17')]));_0x16a08e[_0xa9f5('0x52')](_0x16a08e[_0xa9f5('0x43')],_0x16a08e[_0xa9f5('0x44')],parseInt(_0x16a08e['priority'],0xa)+0x1);_0x16a08e['close']();}}function main(){var _0x4b94e6;return utilLicense[_0xa9f5('0x55')]()['then'](function(_0x3a0cbb){if(_0x3a0cbb){if(_0x3a0cbb[_0xa9f5('0x56')]){if(_0x3a0cbb[_0xa9f5('0x57')]&&_0x3a0cbb[_0xa9f5('0x57')]>0x0){logger[_0xa9f5('0x11')](util[_0xa9f5('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3a0cbb[_0xa9f5('0x57')]));_0x4b94e6=_0x3a0cbb[_0xa9f5('0x57')];}else{logger[_0xa9f5('0x11')](_0xa9f5('0x58'));}}else{logger[_0xa9f5('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4b94e6=-0x1;}}})[_0xa9f5('0x30')](function(_0x556405){logger['error']('[LICENSE]',_0x556405[_0xa9f5('0x15')]);})['finally'](function(){var _0x36748d=require(_0xa9f5('0x59'))(config[_0xa9f5('0x6')]['port'],config['agi']['ip'],_0x4b94e6);_0x36748d['on'](_0xa9f5('0xd'),errorHandler);_0x36748d['on']('listening',listeningHandler);_0x36748d['on'](_0xa9f5('0x5a'),connectionHandler);_0x36748d['on'](_0xa9f5('0x39'),closeHandler);});}main(); \ No newline at end of file +var _0xf021=['createSquareReport','indexOf','agi_','inspect','debug','[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','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','stringify','context','extension','priority','response','code','result','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','../../config/license/util','./rpc','./vertices','defaults','agi','127.0.0.1','nextTick','error','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','calleridname','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','target','addEdge','source','getSquareProject','then','catch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf021,0x18f));var _0x1f02=function(_0x1937c8,_0x5a1f28){_0x1937c8=_0x1937c8-0x0;var _0x48bedf=_0xf021[_0x1937c8];return _0x48bedf;};'use strict';var parser=require(_0x1f02('0x0'));var _=require(_0x1f02('0x1'));var syncho=require(_0x1f02('0x2'));var util=require(_0x1f02('0x3'));var moment=require(_0x1f02('0x4'));var config=require('../../config/environment');var logger=require(_0x1f02('0x5'))('agi');var utilLicense=require(_0x1f02('0x6'));var rpc=require(_0x1f02('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x1f02('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x1f02('0x9')](config[_0x1f02('0xa')],{'ip':_0x1f02('0xb'),'port':0x11dd});function connectionHandler(_0x4193d2){process[_0x1f02('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4193d2);agiHandler(_0x4193d2);}catch(_0x4ec071){logger[_0x1f02('0xd')](_0x4ec071['stack']);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1f02('0xa')][_0x1f02('0xe')]);logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x11'),config['agi']['ip'],config[_0x1f02('0xa')][_0x1f02('0xe')]));}function errorHandler(_0x204e17){if(_0x204e17&&_0x204e17['name']&&_0x204e17[_0x1f02('0x12')]){logger[_0x1f02('0xd')](util[_0x1f02('0x10')]('[%s]\x20%s',_0x204e17['name'],_0x204e17['message']));}else{logger[_0x1f02('0xd')](util[_0x1f02('0x10')](_0x1f02('0x13'),_0x204e17[_0x1f02('0x14')]));}}function closeHandler(){logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x15'),this[_0x1f02('0x16')],this['calleridname'],this[_0x1f02('0x17')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x4a66a5){logger['error'](_0x4a66a5[_0x1f02('0x14')]);}}function timeoutHandler(){logger[_0x1f02('0xf')](util[_0x1f02('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1f02('0x16')],this[_0x1f02('0x18')],this[_0x1f02('0x17')],this[_0x1f02('0x19')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x1f02('0x10')](_0x1f02('0x1a'),this['arg_1'],this['calleridname'],this[_0x1f02('0x17')],this[_0x1f02('0x19')],this[_0x1f02('0x1b')]));this[_0x1f02('0x1c')]=!![];}function getRoot(_0x480297){return parser[_0x1f02('0x1d')](_0x480297,{'object':!![]})[_0x1f02('0x1e')][_0x1f02('0x1f')];}function addVertex(_0x2f422c,_0x43b3e7,_0x134398){_0x43b3e7[_0x1f02('0x20')]=_0x134398;if(_0x43b3e7['hasOwnProperty'](_0x1f02('0x21'))){_0x43b3e7[_0x1f02('0x22')]=parseInt(_0x43b3e7['retry'],0xa);}_0x2f422c[_0x1f02('0x23')](_[_0x1f02('0x24')](_0x43b3e7,'mxCell'));}function initGraph(_0x57bb58,_0x3f7426){var _0x36c8c1=new Graph();for(var _0x3c3fda in _0x57bb58){if(_0x57bb58[_0x1f02('0x25')](_0x3c3fda)){if(_[_0x1f02('0x26')](_0x57bb58[_0x3c3fda])){for(var _0x3f5577=0x0;_0x3f5577<_0x57bb58[_0x3c3fda][_0x1f02('0x27')];_0x3f5577+=0x1){addVertex(_0x36c8c1,_0x57bb58[_0x3c3fda][_0x3f5577],_0x3c3fda);}}else{addVertex(_0x36c8c1,_0x57bb58[_0x3c3fda],_0x3c3fda);}}}for(var _0x4c8891=0x0;_0x4c8891<_0x3f7426['length'];_0x4c8891+=0x1){if(_0x3f7426[_0x4c8891]['source']&&_0x3f7426[_0x4c8891][_0x1f02('0x28')]){_0x36c8c1[_0x1f02('0x29')](_0x3f7426[_0x4c8891][_0x1f02('0x2a')],_0x3f7426[_0x4c8891]['target'],_0x3f7426[_0x4c8891]['value']);}}return _0x36c8c1;}function getSquareProject(_0x227567,_0x6e88d5){rpc[_0x1f02('0x2b')](_0x227567)[_0x1f02('0x2c')](function(_0x220345){_0x6e88d5(null,_0x220345);})[_0x1f02('0x2d')](function(_0x442333){_0x6e88d5(null,_0x442333);});}function createSquareReport(_0x23fa22,_0x1c2a0d){rpc[_0x1f02('0x2e')](_0x23fa22)['then'](function(_0x137e06){if(_0x1c2a0d){_0x1c2a0d(null,_0x137e06);}})['catch'](function(_0xa61d8f){if(_0x1c2a0d){_0x1c2a0d(null,_0xa61d8f);}});}function setChannelVariables(_0x3b3b57){for(var _0x8a3f1e in _0x3b3b57){if(_0x3b3b57[_0x1f02('0x25')](_0x8a3f1e)){if(_0x8a3f1e[_0x1f02('0x2f')](_0x1f02('0x30'))===0x0){_0x3b3b57[_0x8a3f1e['substring'](0x4)]=_0x3b3b57[_0x8a3f1e];delete _0x3b3b57[_0x8a3f1e];}}}}function getLogFromObject(_0x48ae22){return util[_0x1f02('0x31')](_0x48ae22,{'showHidden':![],'depth':null});}function agiHandler(_0x15e655){var _0x4da1ea,_0x345e83,_0x4d1aec,_0x34b0d2,_0x4e7add;logger[_0x1f02('0x32')]('variables',JSON['stringify'](_0x15e655,null,0x2));logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x33'),_0x15e655[_0x1f02('0x16')],_0x15e655['calleridname'],_0x15e655[_0x1f02('0x17')],_0x15e655[_0x1f02('0x19')],_0x15e655[_0x1f02('0x1b')]));_0x15e655['on']('error',errorHandler);_0x15e655['on'](_0x1f02('0x34'),closeHandler);_0x15e655['on'](_0x1f02('0x35'),timeoutHandler);_0x15e655[_0x1f02('0x1c')]=![];_0x15e655['on'](_0x1f02('0x36'),hangupHandler);var _0x4292b7=getSquareProject[_0x1f02('0x37')](null,_0x15e655['arg_1']);if(_0x4292b7){if(_0x4292b7[_0x1f02('0x38')]){_0x4da1ea=getRoot(_0x4292b7[_0x1f02('0x38')]);if(_0x4da1ea&&_0x4da1ea[_0x1f02('0x39')]){logger['debug'](_0x1f02('0x1f'),JSON['stringify'](_0x4da1ea,null,0x2));_0x15e655[_0x1f02('0x3a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x345e83=initGraph(_[_0x1f02('0x24')](_0x4da1ea,'mxCell'),_0x4da1ea['mxCell']);_0x4d1aec=new Vertices(_0x15e655,rpc,mailRpc);logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x3b'),_0x15e655[_0x1f02('0x16')],_0x15e655['calleridname'],_0x15e655[_0x1f02('0x17')],_0x15e655['dnid'],_0x15e655[_0x1f02('0x1b')]));_0x345e83[_0x1f02('0x3c')](_0x4da1ea[_0x1f02('0x39')]['id'],function(_0x43e7bf){try{_0x43e7bf=_0x4d1aec[_0x1f02('0x3d')](_0x43e7bf);logger[_0x1f02('0x32')](_0x1f02('0x3e'),JSON[_0x1f02('0x3f')](_0x43e7bf,null,0x2));if(_0x43e7bf[_0x1f02('0x20')]==='gotoc'){logger[_0x1f02('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x15e655[_0x1f02('0x40')]=_0x43e7bf['context']||_0x15e655[_0x1f02('0x40')];_0x15e655[_0x1f02('0x41')]=_0x43e7bf[_0x1f02('0x41')];_0x15e655['priority']=_0x43e7bf['priority']?_0x43e7bf[_0x1f02('0x42')]-0x1:0x1;return null;}else if(_0x43e7bf&&_0x4d1aec[_0x43e7bf[_0x1f02('0x20')]]){_0x4e7add=_0x4d1aec[_0x43e7bf[_0x1f02('0x20')]](_0x43e7bf);logger[_0x1f02('0xf')](_0x1f02('0x43'),JSON[_0x1f02('0x3f')](_0x4e7add,null,0x2));if(_0x4e7add&&_0x4e7add[_0x1f02('0x44')]===AGI_CODE_SUCCESS&&_0x4e7add[_0x1f02('0x45')]!==AGI_RESULT_ERROR&&!_0x15e655[_0x1f02('0x1c')]){logger['debug'](_0x1f02('0x43'),getLogFromObject(_0x4e7add));return _['isUndefined'](_0x4e7add['result'])?null:_0x4e7add[_0x1f02('0x45')]['toString']();}else{logger['error'](_0x1f02('0x43'),getLogFromObject(_0x4e7add));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x46ba5a){logger[_0x1f02('0xd')](_0x46ba5a['stack']);return null;}});if(_0x4da1ea[_0x1f02('0x46')]){logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x47'),_0x15e655['arg_1'],_0x15e655[_0x1f02('0x18')],_0x15e655[_0x1f02('0x17')],_0x15e655[_0x1f02('0x19')],_0x15e655[_0x1f02('0x1b')]));_0x345e83[_0x1f02('0x3c')](_0x4da1ea[_0x1f02('0x46')]['id'],function(_0x439c20){try{_0x439c20=_0x4d1aec[_0x1f02('0x3d')](_0x439c20);logger[_0x1f02('0x32')](_0x1f02('0x3e'),JSON[_0x1f02('0x3f')](_0x439c20,null,0x2));if(_0x439c20&&_0x4d1aec[_0x439c20[_0x1f02('0x20')]]){_0x4e7add=_0x4d1aec[_0x439c20[_0x1f02('0x20')]](_0x439c20);if(_0x4e7add){logger[_0x1f02('0x32')]('response',getLogFromObject(_0x4e7add));return _[_0x1f02('0x48')](_0x4e7add['result'])?null:_0x4e7add[_0x1f02('0x45')]['toString']();}else{logger[_0x1f02('0xd')](_0x1f02('0x43'),getLogFromObject(_0x4e7add));return null;}}else{logger[_0x1f02('0xd')](_0x1f02('0x49'));return null;}}catch(_0x40bf99){logger[_0x1f02('0xd')](_0x40bf99[_0x1f02('0x14')]);return null;}});}logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x4a'),_0x15e655[_0x1f02('0x16')],_0x15e655['calleridname'],_0x15e655[_0x1f02('0x17')],_0x15e655[_0x1f02('0x19')],_0x15e655[_0x1f02('0x1b')]));logger[_0x1f02('0xf')](util[_0x1f02('0x10')](_0x1f02('0x4b'),_0x15e655[_0x1f02('0x40')],_0x15e655[_0x1f02('0x41')],parseInt(_0x15e655[_0x1f02('0x42')],0xa)+0x1));_0x15e655['continueAt'](_0x15e655[_0x1f02('0x40')],_0x15e655[_0x1f02('0x41')],parseInt(_0x15e655[_0x1f02('0x42')],0xa)+0x1);_0x15e655[_0x1f02('0x34')]();}}else{logger[_0x1f02('0xd')](util['format'](_0x1f02('0x4c'),_0x15e655['arg_1']));_0x15e655[_0x1f02('0x4d')](_0x15e655[_0x1f02('0x40')],_0x15e655[_0x1f02('0x41')],parseInt(_0x15e655[_0x1f02('0x42')],0xa)+0x1);_0x15e655[_0x1f02('0x34')]();}}else{logger[_0x1f02('0xd')](util[_0x1f02('0x10')](_0x1f02('0x4e'),_0x15e655[_0x1f02('0x16')]));_0x15e655[_0x1f02('0x4d')](_0x15e655['context'],_0x15e655['extension'],parseInt(_0x15e655['priority'],0xa)+0x1);_0x15e655[_0x1f02('0x34')]();}}function main(){var _0x5707ee;return utilLicense[_0x1f02('0x4f')]()[_0x1f02('0x2c')](function(_0x587873){if(_0x587873){if(_0x587873[_0x1f02('0x50')]){if(_0x587873['callysquare']&&_0x587873['callysquare']>0x0){logger['info'](util[_0x1f02('0x10')](_0x1f02('0x51'),_0x587873[_0x1f02('0x52')]));_0x5707ee=_0x587873[_0x1f02('0x52')];}else{logger[_0x1f02('0xf')](_0x1f02('0x53'));}}else{logger['info'](_0x1f02('0x54'));_0x5707ee=-0x1;}}})[_0x1f02('0x2d')](function(_0x496e3c){logger['error'](_0x1f02('0x55'),_0x496e3c[_0x1f02('0x14')]);})[_0x1f02('0x46')](function(){var _0x47efdf=require(_0x1f02('0x56'))(config['agi'][_0x1f02('0xe')],config['agi']['ip'],_0x5707ee);_0x47efdf['on'](_0x1f02('0xd'),errorHandler);_0x47efdf['on'](_0x1f02('0x57'),listeningHandler);_0x47efdf['on'](_0x1f02('0x58'),connectionHandler);_0x47efdf['on'](_0x1f02('0x34'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index ad3fc26..52dbca0 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(_0x3eea73,_0x556371){var _0x2f3735=function(_0x478f88){while(--_0x478f88){_0x3eea73['push'](_0x3eea73['shift']());}};_0x2f3735(++_0x556371);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x4a248e,_0x3baef5){var _0x114351=function(_0xe4446){while(--_0xe4446){_0x4a248e['push'](_0x4a248e['shift']());}};_0x114351(++_0x3baef5);}(_0x814b,0x1a2));var _0xb814=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x814b[_0x819464];return _0x49dcc0;};'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 247da4f..a843448 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0xb10b,0x12a));var _0xbb10=function(_0x475835,_0x3dd122){_0x475835=_0x475835-0x0;var _0x496aed=_0xb10b[_0x475835];return _0x496aed;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x30b159,_0x3fbb50){var _0x23c3f9=function(_0xa21305){while(--_0xa21305){_0x30b159['push'](_0x30b159['shift']());}};_0x23c3f9(++_0x3fbb50);}(_0xb10b,0x12a));var _0xbb10=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0xb10b[_0x17a0a0];return _0x4da752;};'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 b7c9d8d..8f244e0 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 _0x7f31=['lodash','util','jayson/promise','client','http','request','then','error','message','result','getSquareProject','production','Smtp','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','name','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getSoundById','ShowSound','save_name','ShowInterval','Intervals','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment'];(function(_0x3a312a,_0x55b0a7){var _0x8fedc3=function(_0x1dcb40){while(--_0x1dcb40){_0x3a312a['push'](_0x3a312a['shift']());}};_0x8fedc3(++_0x55b0a7);}(_0x7f31,0x13d));var _0x17f3=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x7f31[_0x18546c];return _0x46ef43;};'use strict';var BPromise=require('bluebird');var moment=require(_0x17f3('0x0'));var _=require(_0x17f3('0x1'));var util=require(_0x17f3('0x2'));var jayson=require(_0x17f3('0x3'));var client=jayson[_0x17f3('0x4')][_0x17f3('0x5')]({'port':0x2329});function request(_0x531a0d,_0x2ddccf){return new BPromise(function(_0x43f64a,_0x18d4c1){return client[_0x17f3('0x6')](_0x531a0d,_0x2ddccf)[_0x17f3('0x7')](function(_0x417611){if(_0x417611[_0x17f3('0x8')]){return _0x18d4c1(_0x417611['error'][_0x17f3('0x9')]);}else{return _0x43f64a(_0x417611[_0x17f3('0xa')]);}})['catch'](function(_0x1ff1bc){return _0x18d4c1(_0x1ff1bc);});});}exports[_0x17f3('0xb')]=function(_0x265c3f){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x265c3f},'attributes':[_0x17f3('0xc')]}});};exports['getMailAccountById']=function(_0x10b006){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x10b006},'include':[{'model':'MailServerOut','as':_0x17f3('0xd')}],'attributes':['id','name','email']}});};exports[_0x17f3('0xe')]=function(_0x4b08b1){return request('ShowSquareProject',{'options':{'where':{'id':_0x4b08b1},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x207afa){return request(_0x17f3('0xf'),{'options':{'where':{'id':_0x207afa},'attributes':['name']}});};exports[_0x17f3('0x10')]=function(_0x485c20){return request(_0x17f3('0x11'),{'options':{'where':{'id':_0x485c20},'attributes':[_0x17f3('0x12')]}});};exports[_0x17f3('0x13')]=function(_0x16283b){return request(_0x17f3('0x14'),{'options':{'where':{'id':_0x16283b},'attributes':[_0x17f3('0x15')]}});};exports[_0x17f3('0x16')]=function(_0x2e5256){return request(_0x17f3('0x17'),{'options':{'where':{'id':_0x2e5256},'attributes':[_0x17f3('0x12')]}});};exports['getTrunkById']=function(_0x334a6c){return request('ShowTrunk',{'options':{'where':{'id':_0x334a6c},'attributes':[_0x17f3('0x12')]}});};exports[_0x17f3('0x18')]=function(_0x4479d9){return request(_0x17f3('0x19'),{'options':{'where':{'id':_0x4479d9},'attributes':[_0x17f3('0x1a')]}});};exports['getIntervalById']=function(_0x19bd7b){return request(_0x17f3('0x1b'),{'options':{'raw':![],'where':{'id':_0x19bd7b},'include':[{'model':'Interval','as':_0x17f3('0x1c')}]}});};exports['getSmsAccountById']=function(_0x477e36){return request('ShowSmsAccount',{'options':{'where':{'id':_0x477e36},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x35d116){return request(_0x17f3('0x1d'),{'body':_0x35d116});};exports['createSquareDetailsReport']=function(_0xcc6ae5){return request(_0x17f3('0x1e'),{'body':_0xcc6ae5});};exports[_0x17f3('0x1f')]=function(_0xee9d60){return request('CreateSquareReport',{'body':_[_0x17f3('0x20')](_0xee9d60,{'project_name':_0xee9d60[_0x17f3('0x21')],'prev_project_name':_0xee9d60['arg_2']||'','is_subproject':_0xee9d60[_0x17f3('0x22')]?!![]:![],'leaveAt':moment()['format'](_0x17f3('0x23'))})});};exports[_0x17f3('0x24')]=function(_0x308e04){return request(_0x17f3('0x25'),{'body':_0x308e04});};exports[_0x17f3('0x26')]=function(_0x5ba5f7){return request(_0x17f3('0x27'),{'body':_0x5ba5f7});};exports[_0x17f3('0x28')]=function(_0x413fb8){return request(_0x17f3('0x29'),{'options':{'raw':![],'where':{'phone':_0x413fb8[_0x17f3('0x2a')],'ListId':_0x413fb8['ListId']}}})[_0x17f3('0x7')](function(_0x312ea4){if(_0x312ea4){return _0x312ea4;}return request(_0x17f3('0x2b'),{'body':_0x413fb8});});};exports[_0x17f3('0x2c')]=function(_0x381ff8){return request(_0x17f3('0x2d'),{'options':{'where':{'id':_0x381ff8},'attributes':[_0x17f3('0x12')]}});};exports[_0x17f3('0x2e')]=function(_0x13f663,_0x40afb8){return request(_0x17f3('0x2f'),{'body':{'interface':_0x40afb8},'options':{'where':_0x13f663}});};exports[_0x17f3('0x30')]=function(_0x10eedf,_0x5a3da0,_0x189a05){return request(_0x17f3('0x31'),{'body':{'type':_0x5a3da0,'uniqueid':_0x189a05},'options':{'where':_0x10eedf}});};exports['agentUnpause']=function(_0xb9d4d5){return request(_0x17f3('0x32'),{'body':{},'options':{'where':_0xb9d4d5}});};exports[_0x17f3('0x33')]=function(_0x5b92cb){return request(_0x17f3('0x34'),{'body':{},'options':{'where':_0x5b92cb}});}; \ No newline at end of file +var _0x59b9=['getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowTrunk','save_name','getIntervalById','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','CreateCmContact','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','lodash','util','jayson/promise','client','http','request','then','error','catch'];(function(_0x33a35d,_0x365515){var _0x1113a4=function(_0x2028c){while(--_0x2028c){_0x33a35d['push'](_0x33a35d['shift']());}};_0x1113a4(++_0x365515);}(_0x59b9,0x15b));var _0x959b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x59b9[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0x959b('0x0'));var moment=require('moment');var _=require(_0x959b('0x1'));var util=require(_0x959b('0x2'));var jayson=require(_0x959b('0x3'));var client=jayson[_0x959b('0x4')][_0x959b('0x5')]({'port':0x2329});function request(_0x4181ee,_0x2efae9){return new BPromise(function(_0x539d5e,_0x4fd095){return client[_0x959b('0x6')](_0x4181ee,_0x2efae9)[_0x959b('0x7')](function(_0x5f175c){if(_0x5f175c['error']){return _0x4fd095(_0x5f175c[_0x959b('0x8')]['message']);}else{return _0x539d5e(_0x5f175c['result']);}})[_0x959b('0x9')](function(_0x3b14e0){return _0x4fd095(_0x3b14e0);});});}exports[_0x959b('0xa')]=function(_0x230ec4){return request(_0x959b('0xb'),{'options':{'raw':![],'where':{'name':_0x230ec4},'attributes':[_0x959b('0xc')]}});};exports[_0x959b('0xd')]=function(_0x3668ea){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3668ea},'include':[{'model':_0x959b('0xe'),'as':_0x959b('0xf')}],'attributes':['id',_0x959b('0x10'),'email']}});};exports['getSquareProjectById']=function(_0x17391c){return request(_0x959b('0xb'),{'options':{'where':{'id':_0x17391c},'attributes':[_0x959b('0x10')]}});};exports[_0x959b('0x11')]=function(_0x18653f){return request(_0x959b('0x12'),{'options':{'where':{'id':_0x18653f},'attributes':[_0x959b('0x10')]}});};exports[_0x959b('0x13')]=function(_0x17a692){return request(_0x959b('0x14'),{'options':{'where':{'id':_0x17a692},'attributes':[_0x959b('0x10')]}});};exports['getSquareOdbcById']=function(_0x403cff){return request(_0x959b('0x15'),{'options':{'where':{'id':_0x403cff},'attributes':[_0x959b('0x16')]}});};exports[_0x959b('0x17')]=function(_0x1e06f5){return request('ShowUser',{'options':{'where':{'id':_0x1e06f5},'attributes':[_0x959b('0x10')]}});};exports['getTrunkById']=function(_0x5404a1){return request(_0x959b('0x18'),{'options':{'where':{'id':_0x5404a1},'attributes':[_0x959b('0x10')]}});};exports['getSoundById']=function(_0x4871cc){return request('ShowSound',{'options':{'where':{'id':_0x4871cc},'attributes':[_0x959b('0x19')]}});};exports[_0x959b('0x1a')]=function(_0x1f110c){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1f110c},'include':[{'model':_0x959b('0x1b'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x153e1d){return request(_0x959b('0x1c'),{'options':{'where':{'id':_0x153e1d},'attributes':['id',_0x959b('0x10')]}});};exports[_0x959b('0x1d')]=function(_0xb8aa0e){return request(_0x959b('0x1e'),{'body':_0xb8aa0e});};exports[_0x959b('0x1f')]=function(_0x1f7815){return request(_0x959b('0x20'),{'body':_0x1f7815});};exports[_0x959b('0x21')]=function(_0x462e3e){return request(_0x959b('0x22'),{'body':_[_0x959b('0x23')](_0x462e3e,{'project_name':_0x462e3e[_0x959b('0x24')],'prev_project_name':_0x462e3e[_0x959b('0x25')]||'','is_subproject':_0x462e3e['arg_2']?!![]:![],'leaveAt':moment()[_0x959b('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x24148){return request(_0x959b('0x27'),{'body':_0x24148});};exports[_0x959b('0x28')]=function(_0x42b686){return request(_0x959b('0x29'),{'body':_0x42b686});};exports['createCmContact']=function(_0x3bda3e){return request(_0x959b('0x2a'),{'options':{'raw':![],'where':{'phone':_0x3bda3e[_0x959b('0x2b')],'ListId':_0x3bda3e['ListId']}}})[_0x959b('0x7')](function(_0x3b1d4b){if(_0x3b1d4b){return _0x3b1d4b;}return request(_0x959b('0x2c'),{'body':_0x3bda3e});});};exports['getPauseById']=function(_0x55c3ec){return request(_0x959b('0x2d'),{'options':{'where':{'id':_0x55c3ec},'attributes':['name']}});};exports[_0x959b('0x2e')]=function(_0x130844,_0x691edf){return request('LoginUser',{'body':{'interface':_0x691edf},'options':{'where':_0x130844}});};exports['agentPause']=function(_0x2dfec7,_0x4cebc9,_0x34d63d){return request(_0x959b('0x2f'),{'body':{'type':_0x4cebc9,'uniqueid':_0x34d63d},'options':{'where':_0x2dfec7}});};exports[_0x959b('0x30')]=function(_0x403839){return request(_0x959b('0x31'),{'body':{},'options':{'where':_0x403839}});};exports['agentLogout']=function(_0x36cffb){return request(_0x959b('0x32'),{'body':{},'options':{'where':_0x36cffb}});}; \ 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 9357f2b..75e7017 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 _0x0689=['exports','./polly'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0689,0xdb));var _0x9068=function(_0x53cf14,_0x29e073){_0x53cf14=_0x53cf14-0x0;var _0x3e5981=_0x0689[_0x53cf14];return _0x3e5981;};var polly=require(_0x9068('0x0'));var lex=require('./lex');module[_0x9068('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6ec6=['./polly','./lex','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6ec6,0xc6));var _0x66ec=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x6ec6[_0x176317];return _0xef2759;};var polly=require(_0x66ec('0x0'));var lex=require(_0x66ec('0x1'));module[_0x66ec('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 279a9c0..6889f00 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 _0x34e8=['./lib/api','exports'];(function(_0x456c2a,_0x2aa589){var _0x4997c2=function(_0x3fb652){while(--_0x3fb652){_0x456c2a['push'](_0x456c2a['shift']());}};_0x4997c2(++_0x2aa589);}(_0x34e8,0x12c));var _0x834e=function(_0x50fe90,_0x494e1c){_0x50fe90=_0x50fe90-0x0;var _0x271881=_0x34e8[_0x50fe90];return _0x271881;};'use strict';var lex=require(_0x834e('0x0'));module[_0x834e('0x1')]=function(_0x8b339,_0x35e6fb,_0x530939,_0x832422,_0x21e2e0,_0x472111){return lex(_0x8b339,_0x35e6fb,_0x530939,_0x832422,_0x21e2e0,_0x472111);}; \ No newline at end of file +var _0x5c37=['./lib/api','exports'];(function(_0xc3b08e,_0x427235){var _0x4c5e08=function(_0x501784){while(--_0x501784){_0xc3b08e['push'](_0xc3b08e['shift']());}};_0x4c5e08(++_0x427235);}(_0x5c37,0x11e));var _0x75c3=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x5c37[_0x53b133];return _0x5647e0;};'use strict';var lex=require(_0x75c3('0x0'));module[_0x75c3('0x1')]=function(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1){return lex(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1);}; \ 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 9ee159b..1b2ac8f 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 _0x6c35=['LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x3e844c,_0x114926){var _0x349373=function(_0x2387e0){while(--_0x2387e0){_0x3e844c['push'](_0x3e844c['shift']());}};_0x349373(++_0x114926);}(_0x6c35,0xc8));var _0x56c3=function(_0x5859ea,_0x357cde){_0x5859ea=_0x5859ea-0x0;var _0x1d94d2=_0x6c35[_0x5859ea];return _0x1d94d2;};'use strict';var BPromise=require(_0x56c3('0x0'));var AWS=require(_0x56c3('0x1'));function lexResult(_0x58f404,_0x450753){return new BPromise(function(_0x2316ba,_0x463c7c){_0x58f404[_0x56c3('0x2')](_0x450753,function(_0x4c36b9,_0x5b3cf1){if(_0x4c36b9){_0x463c7c(_0x4c36b9);}if(_0x5b3cf1[_0x56c3('0x3')]){for(const _0x3e7ecd in _0x5b3cf1[_0x56c3('0x3')]){if(_0x5b3cf1[_0x56c3('0x3')][_0x56c3('0x4')](_0x3e7ecd)){var _0x379973=_0x5b3cf1[_0x56c3('0x3')][_0x3e7ecd];_0x5b3cf1[_0x56c3('0x5')+_0x3e7ecd]=_0x379973;}}}_0x2316ba(_0x5b3cf1);});});}module[_0x56c3('0x6')]=function(_0x3d0307,_0x54d66e,_0xf32256,_0x43a758,_0x14ce3e,_0x35d8c9){var _0x2d440b=new AWS[(_0x56c3('0x7'))]({'accessKeyId':_0x54d66e,'secretAccessKey':_0xf32256,'region':_0x43a758});var _0x27d0b5={'botAlias':_0x56c3('0x8'),'botName':_0x35d8c9,'inputText':_0x14ce3e,'userId':_0x3d0307};return lexResult(_0x2d440b,_0x27d0b5);}; \ No newline at end of file +var _0x8dd7=['slot_','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8dd7,0xdb));var _0x78dd=function(_0x110309,_0x36cd12){_0x110309=_0x110309-0x0;var _0x4c4030=_0x8dd7[_0x110309];return _0x4c4030;};'use strict';var BPromise=require(_0x78dd('0x0'));var AWS=require(_0x78dd('0x1'));function lexResult(_0x3db6a7,_0x222672){return new BPromise(function(_0x476dab,_0x3e3a8e){_0x3db6a7[_0x78dd('0x2')](_0x222672,function(_0xcf1d31,_0x202cf7){if(_0xcf1d31){_0x3e3a8e(_0xcf1d31);}if(_0x202cf7[_0x78dd('0x3')]){for(const _0x34cce6 in _0x202cf7[_0x78dd('0x3')]){if(_0x202cf7['slots'][_0x78dd('0x4')](_0x34cce6)){var _0x57e3cb=_0x202cf7[_0x78dd('0x3')][_0x34cce6];_0x202cf7[_0x78dd('0x5')+_0x34cce6]=_0x57e3cb;}}}_0x476dab(_0x202cf7);});});}module['exports']=function(_0x2a3dcf,_0xb9a713,_0x1af9fa,_0x2ad8b2,_0x417d74,_0x4b0b9e){var _0x2cc02c=new AWS[(_0x78dd('0x6'))]({'accessKeyId':_0xb9a713,'secretAccessKey':_0x1af9fa,'region':_0x2ad8b2});var _0x53f0ee={'botAlias':_0x78dd('0x7'),'botName':_0x4b0b9e,'inputText':_0x417d74,'userId':_0x2a3dcf};return lexResult(_0x2cc02c,_0x53f0ee);}; \ 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 f5cf413..4a5aade 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 _0xb485=['./lib/api'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0xb485,0x190));var _0x5b48=function(_0x48e359,_0x4ce2b8){_0x48e359=_0x48e359-0x0;var _0x1ece43=_0xb485[_0x48e359];return _0x1ece43;};'use strict';var polly=require(_0x5b48('0x0'));module['exports']=function(_0x44b71d,_0x335a73,_0x3e8906,_0x2bb47a,_0x49ca65,_0x551418,_0x2d277){return polly(_0x44b71d,_0x335a73,_0x3e8906,_0x2bb47a,_0x49ca65,_0x551418,_0x2d277);}; \ No newline at end of file +var _0x78b3=['exports','./lib/api'];(function(_0x46346a,_0x4c1d09){var _0x1ec809=function(_0x5eb0d8){while(--_0x5eb0d8){_0x46346a['push'](_0x46346a['shift']());}};_0x1ec809(++_0x4c1d09);}(_0x78b3,0x1b3));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0x378b('0x0'));module[_0x378b('0x1')]=function(_0xa91ae3,_0x541740,_0x101907,_0x216c6c,_0x2d6733,_0xaf4672,_0x41965e){return polly(_0xa91ae3,_0x541740,_0x101907,_0x216c6c,_0x2d6733,_0xaf4672,_0x41965e);}; \ 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 1853e1d..33db656 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 _0x57ad=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x799231,_0x5d329e){var _0x4d4568=function(_0x5cd6f8){while(--_0x5cd6f8){_0x799231['push'](_0x799231['shift']());}};_0x4d4568(++_0x5d329e);}(_0x57ad,0x95));var _0xd57a=function(_0x2af506,_0x18ede1){_0x2af506=_0x2af506-0x0;var _0x43bcae=_0x57ad[_0x2af506];return _0x43bcae;};'use strict';var fs=require('fs');var path=require(_0xd57a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xd57a('0x1'));function pollyResult(_0x349734,_0x51f620,_0x259133){return new BPromise(function(_0x340e97,_0x22c43d){_0x349734[_0xd57a('0x2')](_0x51f620,function(_0x3a5248,_0x3ce28b){if(_0x3a5248){_0x22c43d(_0x3a5248);}else if(_0x3ce28b){if(_0x3ce28b[_0xd57a('0x3')]instanceof Buffer){fs[_0xd57a('0x4')](_0x259133,_0x3ce28b['AudioStream'],function(_0x45c768){if(_0x45c768){_0x22c43d(_0x45c768);}else{_0x340e97();}});}else{_0x22c43d(new Error(_0xd57a('0x5')));}}else{_0x22c43d(new Error(_0xd57a('0x6')));}});});}module[_0xd57a('0x7')]=function(_0x5eaa95,_0xc9e898,_0x49c30b,_0x3d8de5,_0x428bc1,_0x5514c9,_0x3a3b0b){var _0x3fba8e=new AWS[(_0xd57a('0x8'))]({'accessKeyId':_0x5eaa95,'secretAccessKey':_0xc9e898,'region':_0x49c30b});var _0x3089df={'Text':_0x428bc1,'TextType':_0x5514c9||_0xd57a('0x9'),'OutputFormat':_0xd57a('0xa'),'VoiceId':_0x3d8de5};return pollyResult(_0x3fba8e,_0x3089df,_0x3a3b0b);}; \ No newline at end of file +var _0x7eb7=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x200221,_0x42c41f){var _0xcab7c4=function(_0x5aeab){while(--_0x5aeab){_0x200221['push'](_0x200221['shift']());}};_0xcab7c4(++_0x42c41f);}(_0x7eb7,0x69));var _0x77eb=function(_0x4f2519,_0x3cdd8c){_0x4f2519=_0x4f2519-0x0;var _0x28e520=_0x7eb7[_0x4f2519];return _0x28e520;};'use strict';var fs=require('fs');var path=require(_0x77eb('0x0'));var BPromise=require(_0x77eb('0x1'));var rs=require(_0x77eb('0x2'));var AWS=require(_0x77eb('0x3'));function pollyResult(_0x4e8d63,_0x1698d6,_0x3fe269){return new BPromise(function(_0x3adcd5,_0x4cea1a){_0x4e8d63[_0x77eb('0x4')](_0x1698d6,function(_0x178ae5,_0x535986){if(_0x178ae5){_0x4cea1a(_0x178ae5);}else if(_0x535986){if(_0x535986[_0x77eb('0x5')]instanceof Buffer){fs['writeFile'](_0x3fe269,_0x535986[_0x77eb('0x5')],function(_0x2b494b){if(_0x2b494b){_0x4cea1a(_0x2b494b);}else{_0x3adcd5();}});}else{_0x4cea1a(new Error(_0x77eb('0x6')));}}else{_0x4cea1a(new Error(_0x77eb('0x7')));}});});}module[_0x77eb('0x8')]=function(_0x59f3b1,_0x2c045c,_0x4706be,_0x14a902,_0xd97681,_0x361538,_0x4e4762){var _0x56dc4e=new AWS[(_0x77eb('0x9'))]({'accessKeyId':_0x59f3b1,'secretAccessKey':_0x2c045c,'region':_0x4706be});var _0x40d23f={'Text':_0xd97681,'TextType':_0x361538||_0x77eb('0xa'),'OutputFormat':'mp3','VoiceId':_0x14a902};return pollyResult(_0x56dc4e,_0x40d23f,_0x4e4762);}; \ 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 bc7cd6e..d238930 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x3e0003,_0x14ac4b,_0x3df035,_0x507afc){return asr(_0x3e0003,_0x14ac4b,_0x3df035);}; \ No newline at end of file +var _0x93e6=['./lib/api'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x93e6,0x11e));var _0x693e=function(_0x3d0240,_0x21509a){_0x3d0240=_0x3d0240-0x0;var _0xdf8a7d=_0x93e6[_0x3d0240];return _0xdf8a7d;};'use strict';var asr=require(_0x693e('0x0'));module['exports']=function(_0x5f4d40,_0x23dba9,_0x5c420e,_0x2adde0){return asr(_0x5f4d40,_0x23dba9,_0x5c420e);}; \ 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 884bbd0..291ea27 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 _0xa518=['readFileSync','toString','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0xa518,0x18b));var _0x8a51=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0xa518[_0x496333];return _0x44256e;};'use strict';var url=require(_0x8a51('0x0'));var BPromise=require(_0x8a51('0x1'));var fs=require('fs');var host=_0x8a51('0x2');module[_0x8a51('0x3')]=function(_0x5c2fb2,_0x6d0d3f,_0x3c447a){return new BPromise(function(_0x5b4785,_0x5f4d38){var _0x520ead;if(typeof _0x5c2fb2!=='string'||_0x5c2fb2[_0x8a51('0x4')]===0x0){return _0x5f4d38(_0x8a51('0x5'));}if(typeof _0x6d0d3f!==_0x8a51('0x6')||_0x6d0d3f[_0x8a51('0x4')]===0x0){return _0x5f4d38('key\x20should\x20be\x20a\x20string');}if(typeof _0x3c447a!==_0x8a51('0x7')&&(typeof _0x3c447a!=='string'||_0x3c447a[_0x8a51('0x4')]===0x0)){return _0x5f4d38('lang\x20should\x20be\x20a\x20string');}try{_0x520ead=fs[_0x8a51('0x8')](_0x5c2fb2)[_0x8a51('0x9')](_0x8a51('0xa'));}catch(_0x30d9ad){return _0x5f4d38(_0x30d9ad);}return _0x5b4785({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x6d0d3f,'body':{'config':{'encoding':_0x8a51('0xb'),'sampleRateHertz':_0x8a51('0xc'),'languageCode':_0x3c447a},'audio':{'content':_0x520ead}},'json':!![]});});}; \ No newline at end of file +var _0x896a=['string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','8000','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x23e9c1,_0x1715ba){var _0x511731=function(_0x413493){while(--_0x413493){_0x23e9c1['push'](_0x23e9c1['shift']());}};_0x511731(++_0x1715ba);}(_0x896a,0x15b));var _0xa896=function(_0x902efb,_0x438153){_0x902efb=_0x902efb-0x0;var _0x129bd7=_0x896a[_0x902efb];return _0x129bd7;};'use strict';var url=require('url');var BPromise=require(_0xa896('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa896('0x1')]=function(_0x22c0a5,_0x55a2c7,_0x2a69f6){return new BPromise(function(_0xd9f8af,_0xb60dff){var _0x506958;if(typeof _0x22c0a5!=='string'||_0x22c0a5[_0xa896('0x2')]===0x0){return _0xb60dff(_0xa896('0x3'));}if(typeof _0x55a2c7!==_0xa896('0x4')||_0x55a2c7[_0xa896('0x2')]===0x0){return _0xb60dff(_0xa896('0x5'));}if(typeof _0x2a69f6!==_0xa896('0x6')&&(typeof _0x2a69f6!==_0xa896('0x4')||_0x2a69f6['length']===0x0)){return _0xb60dff(_0xa896('0x7'));}try{_0x506958=fs[_0xa896('0x8')](_0x22c0a5)['toString'](_0xa896('0x9'));}catch(_0x1a31a4){return _0xb60dff(_0x1a31a4);}return _0xd9f8af({'method':_0xa896('0xa'),'uri':host+_0xa896('0xb')+_0x55a2c7,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa896('0xc'),'languageCode':_0x2a69f6},'audio':{'content':_0x506958}},'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 94e46dd..5e769c2 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 _0x008c=['./asr','exports'];(function(_0x57054d,_0x3f5d58){var _0x2729fc=function(_0x3c0899){while(--_0x3c0899){_0x57054d['push'](_0x57054d['shift']());}};_0x2729fc(++_0x3f5d58);}(_0x008c,0x188));var _0xc008=function(_0x1cc12d,_0x1325df){_0x1cc12d=_0x1cc12d-0x0;var _0x46395c=_0x008c[_0x1cc12d];return _0x46395c;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x4fe496,_0x1d8673){var _0x422b24=function(_0x27a644){while(--_0x27a644){_0x4fe496['push'](_0x4fe496['shift']());}};_0x422b24(++_0x1d8673);}(_0x34e8,0x12c));var _0x834e=function(_0x1e119f,_0x1dd437){_0x1e119f=_0x1e119f-0x0;var _0x409abd=_0x34e8[_0x1e119f];return _0x409abd;};var asr=require(_0x834e('0x0'));module[_0x834e('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 cd4c970..ed49e79 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 _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xb10b,0x12a));var _0xbb10=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0xb10b[_0x2242a1];return _0x2c298b;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xb10b,0x12a));var _0xbb10=function(_0x153e72,_0x1cde75){_0x153e72=_0x153e72-0x0;var _0x2d060f=_0xb10b[_0x153e72];return _0x2d060f;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=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 c953298..59751a4 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 _0xb271=['./nda'];(function(_0x58f8f6,_0x207b30){var _0x1569dc=function(_0x494d51){while(--_0x494d51){_0x58f8f6['push'](_0x58f8f6['shift']());}};_0x1569dc(++_0x207b30);}(_0xb271,0x145));var _0x1b27=function(_0x14d56e,_0x1fc3f8){_0x14d56e=_0x14d56e-0x0;var _0xc3870b=_0xb271[_0x14d56e];return _0xc3870b;};var nda=require(_0x1b27('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x0717=['exports'];(function(_0xb7b269,_0xf52b7c){var _0x50e687=function(_0x477399){while(--_0x477399){_0xb7b269['push'](_0xb7b269['shift']());}};_0x50e687(++_0xf52b7c);}(_0x0717,0x72));var _0x7071=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0717[_0x1035c1];return _0x308d67;};var nda=require('./nda');module[_0x7071('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index ca31e2d..c367a86 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 _0xd154=['ndauth_url','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve'];(function(_0x131060,_0x2bd42e){var _0x2258e7=function(_0x1ee654){while(--_0x1ee654){_0x131060['push'](_0x131060['shift']());}};_0x2258e7(++_0x2bd42e);}(_0xd154,0x156));var _0x4d15=function(_0x3ae4f9,_0xef2391){_0x3ae4f9=_0x3ae4f9-0x0;var _0x4339a7=_0xd154[_0x3ae4f9];return _0x4339a7;};'use strict';var rp=require(_0x4d15('0x0'));var url=require(_0x4d15('0x1'));var logger=require(_0x4d15('0x2'))(_0x4d15('0x3'));module['exports']=function(_0x510937,_0x13aff7){var _0x2953de={'method':_0x4d15('0x4'),'uri':url[_0x4d15('0x5')](_0x13aff7[_0x4d15('0x6')],'/token'),'form':{'grant_type':_0x4d15('0x7'),'username':_0x13aff7['username'],'password':_0x13aff7[_0x4d15('0x7')]},'json':!![]};return rp(_0x2953de)[_0x4d15('0x8')](function(_0x533505){var _0x547033={'method':_0x4d15('0x4'),'uri':url[_0x4d15('0x5')](_0x13aff7['ndassistant_url'],_0x4d15('0x9')),'body':{'type':_0x13aff7[_0x4d15('0xa')]||_0x4d15('0xb'),'channelId':_0x4d15('0xc'),'conversation':{'id':_0x510937['uniqueid']},'from':{'id':_0x510937[_0x4d15('0xd')],'name':_0x510937[_0x4d15('0xe')]},'recipient':{'id':_0x510937[_0x4d15('0xf')],'name':_0x510937[_0x4d15('0x10')]},'text':_0x13aff7['text'],'channelData':{}},'headers':{'Authorization':_0x4d15('0x11')+_0x533505['access_token']},'json':!![]};if(_0x13aff7[_0x4d15('0x12')]){_0x547033[_0x4d15('0x13')][_0x4d15('0x14')][_0x4d15('0x15')]=_0x13aff7[_0x4d15('0x12')];}if(_0x13aff7[_0x4d15('0x16')]=='1'){_0x547033[_0x4d15('0x13')]['channelData'][_0x4d15('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4d15('0x18')};}if(_0x13aff7[_0x4d15('0x19')]){_0x547033[_0x4d15('0x13')]['channelData'][_0x4d15('0x1a')]=_0x13aff7[_0x4d15('0x19')];if(_0x13aff7['custom_action_data']){_0x547033['body'][_0x4d15('0x14')][_0x4d15('0x1b')]=_0x13aff7['custom_action_data'];}}logger['info'](JSON[_0x4d15('0x1c')](_0x547033));return rp(_0x547033);});}; \ No newline at end of file +var _0xcf52=['resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','/token','password','then'];(function(_0x132c73,_0xce505){var _0xf86d59=function(_0x4b05a1){while(--_0x4b05a1){_0x132c73['push'](_0x132c73['shift']());}};_0xf86d59(++_0xce505);}(_0xcf52,0x9c));var _0x2cf5=function(_0x4cb1a5,_0x31ee32){_0x4cb1a5=_0x4cb1a5-0x0;var _0x5c2ae3=_0xcf52[_0x4cb1a5];return _0x5c2ae3;};'use strict';var rp=require(_0x2cf5('0x0'));var url=require(_0x2cf5('0x1'));var logger=require(_0x2cf5('0x2'))(_0x2cf5('0x3'));module[_0x2cf5('0x4')]=function(_0x5e8412,_0x296d0d){var _0x25c4d7={'method':_0x2cf5('0x5'),'uri':url['resolve'](_0x296d0d['ndauth_url'],_0x2cf5('0x6')),'form':{'grant_type':_0x2cf5('0x7'),'username':_0x296d0d['username'],'password':_0x296d0d[_0x2cf5('0x7')]},'json':!![]};return rp(_0x25c4d7)[_0x2cf5('0x8')](function(_0x39d1bc){var _0x19200c={'method':'POST','uri':url[_0x2cf5('0x9')](_0x296d0d[_0x2cf5('0xa')],_0x2cf5('0xb')),'body':{'type':_0x296d0d[_0x2cf5('0xc')]||_0x2cf5('0xd'),'channelId':_0x2cf5('0xe'),'conversation':{'id':_0x5e8412['uniqueid']},'from':{'id':_0x5e8412[_0x2cf5('0xf')],'name':_0x5e8412[_0x2cf5('0x10')]},'recipient':{'id':_0x5e8412['dnid'],'name':_0x5e8412['extension']},'text':_0x296d0d[_0x2cf5('0x11')],'channelData':{}},'headers':{'Authorization':_0x2cf5('0x12')+_0x39d1bc[_0x2cf5('0x13')]},'json':!![]};if(_0x296d0d['project']){_0x19200c[_0x2cf5('0x14')][_0x2cf5('0x15')][_0x2cf5('0x16')]=_0x296d0d[_0x2cf5('0x17')];}if(_0x296d0d[_0x2cf5('0x18')]=='1'){_0x19200c[_0x2cf5('0x14')]['channelData'][_0x2cf5('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2cf5('0x1a')};}if(_0x296d0d['custom_action']){_0x19200c[_0x2cf5('0x14')]['channelData'][_0x2cf5('0x1b')]=_0x296d0d[_0x2cf5('0x1c')];if(_0x296d0d[_0x2cf5('0x1d')]){_0x19200c[_0x2cf5('0x14')][_0x2cf5('0x15')][_0x2cf5('0x1e')]=_0x296d0d['custom_action_data'];}}logger[_0x2cf5('0x1f')](JSON[_0x2cf5('0x20')](_0x19200c));return rp(_0x19200c);});}; \ 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 61c2e43..7bbe0fa 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 _0x0db0=['exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x0db0,0x107));var _0x00db=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x0db0[_0x4de586];return _0x46baf5;};'use strict';var asr=require('./lib/api');module[_0x00db('0x0')]=function(_0x57f2e9,_0xd054b8,_0x2f9dec,_0x186168){return asr(_0x57f2e9,_0xd054b8,_0x2f9dec,_0x186168);}; \ No newline at end of file +var _0xb476=['./lib/api'];(function(_0x2f01bb,_0x26386a){var _0x2b7635=function(_0x2b6769){while(--_0x2b6769){_0x2f01bb['push'](_0x2f01bb['shift']());}};_0x2b7635(++_0x26386a);}(_0xb476,0x100));var _0x6b47=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xb476[_0x133277];return _0x5b4a22;};'use strict';var asr=require(_0x6b47('0x0'));module['exports']=function(_0x2f087f,_0x2ede82,_0x412fa7,_0x1bd902){return asr(_0x2f087f,_0x2ede82,_0x412fa7,_0x1bd902);}; \ 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 b72162c..04e5414 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 _0xd3b3=['result','final','Tilde\x20ASR\x20hypoteses','hypotheses','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','isObject','open','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','unix','send','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd3b3,0x6e));var _0x3d3b=function(_0x1f4e10,_0x1db2a1){_0x1f4e10=_0x1f4e10-0x0;var _0x4c9c4d=_0xd3b3[_0x1f4e10];return _0x4c9c4d;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3d3b('0x0'));var crypto=require(_0x3d3b('0x1'));var logger=require('../../../../../../config/logger')(_0x3d3b('0x2'));module[_0x3d3b('0x3')]=function(_0x419bc5,_0x410494,_0x48c7de,_0x176e16){return new BPromise(function(_0x514037,_0x1c4300){logger[_0x3d3b('0x4')]('Tilde\x20URI',_0x176e16||_0x3d3b('0x5'));var _0x5d8fca=new WebSocket(_0x176e16||_0x3d3b('0x5'),{'perMessageDeflate':![]});var _0x4909b5='';var _0x878f1d='0';var _0x4d10c6='1';var _0x15fdd2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x497aeb(_0x329e50){var _0x283a09=crypto['createHash'](_0x3d3b('0x6'));_0x283a09[_0x3d3b('0x7')](_0x329e50);return _0x283a09[_0x3d3b('0x8')](_0x3d3b('0x9'));}function _0x79171a(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x4da381=moment()[_0x3d3b('0xa')]();var _0x5e56e6=_0x497aeb(_0x4da381+_0x410494+_0x48c7de);_0x5d8fca[_0x3d3b('0xb')](JSON['stringify']({'appID':_0x410494,'timestamp':_0x4da381,'appKey':_0x5e56e6}));var _0x3df12c=fs[_0x3d3b('0xc')](_0x419bc5);_0x3df12c['on']('data',function(_0x1d27d2){_0x5d8fca[_0x3d3b('0xb')](_0x1d27d2);});_0x3df12c['on'](_0x3d3b('0xd'),function(){_0x5d8fca[_0x3d3b('0xb')](_0x3d3b('0xe'));});}catch(_0x546434){logger['error'](_0x3d3b('0xf'),JSON[_0x3d3b('0x10')](_0x546434));_0x5d8fca[_0x3d3b('0x11')]();}}function _0x1eef54(_0x4eee29){try{if(_0x4eee29){var _0x44b462=JSON['parse'](_0x4eee29);switch(_0x44b462['status']){case 0x0:if(_0x44b462[_0x3d3b('0x12')]){if(_0x44b462[_0x3d3b('0x12')][_0x3d3b('0x13')]){logger[_0x3d3b('0x4')](_0x3d3b('0x14'),JSON[_0x3d3b('0x10')](_0x44b462[_0x3d3b('0x12')][_0x3d3b('0x15')]));_0x4909b5=_0x44b462[_0x3d3b('0x12')]['hypotheses'][0x0]['transcript'];_0x878f1d=_0x44b462['result']['hypotheses'][0x0]['likelihood'];_0x4d10c6='0';_0x15fdd2='Success.';_0x5d8fca[_0x3d3b('0x11')]();}}break;case 0x1:logger[_0x3d3b('0x4')](_0x3d3b('0x16'));_0x4d10c6='1';_0x15fdd2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x3d3b('0x4')](_0x3d3b('0x17'));_0x4d10c6='2';_0x15fdd2=_0x3d3b('0x17');break;case 0x9:logger[_0x3d3b('0x4')](_0x3d3b('0x18'));_0x4d10c6='9';_0x15fdd2=_0x3d3b('0x18');break;case 0xa:logger[_0x3d3b('0x4')](_0x3d3b('0x19'));_0x4d10c6='10';_0x15fdd2=_0x3d3b('0x19');break;case 0xb:logger['info'](_0x3d3b('0x1a'));_0x4d10c6='11';_0x15fdd2=_0x3d3b('0x1a');}}}catch(_0x20d852){logger['error'](_0x3d3b('0x1b'),JSON['stringify'](_0x20d852));_0x5d8fca['terminate']();}}function _0x2d4ba5(){logger['info'](_0x3d3b('0x1c'));_0x514037({'transcript':_0x4909b5,'confidence':_0x878f1d,'status':_0x4d10c6,'status_message':_0x15fdd2});}function _0x46f913(_0x521c6f){logger[_0x3d3b('0x1d')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x521c6f)){logger[_0x3d3b('0x1d')](_[_0x3d3b('0x1e')](_0x521c6f)?JSON[_0x3d3b('0x10')](_0x521c6f):_0x521c6f);}}_0x5d8fca['on'](_0x3d3b('0x1f'),_0x79171a);_0x5d8fca['on']('message',_0x1eef54);_0x5d8fca['on'](_0x3d3b('0xd'),_0x2d4ba5);_0x5d8fca['on'](_0x3d3b('0x1d'),_0x46f913);});}; \ No newline at end of file +var _0xc17c=['Tilde\x20ASR\x20send\x20error','parse','result','hypotheses','transcript','likelihood','Success.','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','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error'];(function(_0x17244e,_0x2d1f5e){var _0x2953b1=function(_0x453f8f){while(--_0x453f8f){_0x17244e['push'](_0x17244e['shift']());}};_0x2953b1(++_0x2d1f5e);}(_0xc17c,0x15a));var _0xcc17=function(_0x18d486,_0x49bd8b){_0x18d486=_0x18d486-0x0;var _0x40e6e9=_0xc17c[_0x18d486];return _0x40e6e9;};'use strict';var BPromise=require(_0xcc17('0x0'));var _=require(_0xcc17('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcc17('0x2'));var crypto=require(_0xcc17('0x3'));var logger=require(_0xcc17('0x4'))('agi');module[_0xcc17('0x5')]=function(_0xe31af3,_0x46d415,_0x161516,_0xb4afe4){return new BPromise(function(_0x222c13,_0x326e20){logger[_0xcc17('0x6')](_0xcc17('0x7'),_0xb4afe4||_0xcc17('0x8'));var _0x11720e=new WebSocket(_0xb4afe4||_0xcc17('0x8'),{'perMessageDeflate':![]});var _0x5da61c='';var _0x51a6a8='0';var _0x22398d='1';var _0x2b06a3=_0xcc17('0x9');function _0x7a5382(_0x4762e1){var _0x3d00c7=crypto[_0xcc17('0xa')](_0xcc17('0xb'));_0x3d00c7[_0xcc17('0xc')](_0x4762e1);return _0x3d00c7[_0xcc17('0xd')](_0xcc17('0xe'));}function _0x2aba44(){try{logger[_0xcc17('0x6')](_0xcc17('0xf'));var _0x5cd432=moment()[_0xcc17('0x10')]();var _0x57c1fa=_0x7a5382(_0x5cd432+_0x46d415+_0x161516);_0x11720e[_0xcc17('0x11')](JSON[_0xcc17('0x12')]({'appID':_0x46d415,'timestamp':_0x5cd432,'appKey':_0x57c1fa}));var _0x3227fb=fs[_0xcc17('0x13')](_0xe31af3);_0x3227fb['on'](_0xcc17('0x14'),function(_0x5e96a4){_0x11720e[_0xcc17('0x11')](_0x5e96a4);});_0x3227fb['on'](_0xcc17('0x15'),function(){_0x11720e[_0xcc17('0x11')]('EOS');});}catch(_0xc1168e){logger[_0xcc17('0x16')](_0xcc17('0x17'),JSON[_0xcc17('0x12')](_0xc1168e));_0x11720e['terminate']();}}function _0x681d13(_0x1b591e){try{if(_0x1b591e){var _0x532bdd=JSON[_0xcc17('0x18')](_0x1b591e);switch(_0x532bdd['status']){case 0x0:if(_0x532bdd[_0xcc17('0x19')]){if(_0x532bdd[_0xcc17('0x19')]['final']){logger[_0xcc17('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xcc17('0x12')](_0x532bdd[_0xcc17('0x19')][_0xcc17('0x1a')]));_0x5da61c=_0x532bdd[_0xcc17('0x19')]['hypotheses'][0x0][_0xcc17('0x1b')];_0x51a6a8=_0x532bdd[_0xcc17('0x19')][_0xcc17('0x1a')][0x0][_0xcc17('0x1c')];_0x22398d='0';_0x2b06a3=_0xcc17('0x1d');_0x11720e['terminate']();}}break;case 0x1:logger[_0xcc17('0x6')](_0xcc17('0x9'));_0x22398d='1';_0x2b06a3=_0xcc17('0x9');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x22398d='2';_0x2b06a3='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xcc17('0x1e'));_0x22398d='9';_0x2b06a3=_0xcc17('0x1e');break;case 0xa:logger[_0xcc17('0x6')](_0xcc17('0x1f'));_0x22398d='10';_0x2b06a3=_0xcc17('0x1f');break;case 0xb:logger['info'](_0xcc17('0x20'));_0x22398d='11';_0x2b06a3=_0xcc17('0x20');}}}catch(_0x106197){logger['error'](_0xcc17('0x21'),JSON[_0xcc17('0x12')](_0x106197));_0x11720e[_0xcc17('0x22')]();}}function _0x47b4ef(){logger[_0xcc17('0x6')](_0xcc17('0x23'));_0x222c13({'transcript':_0x5da61c,'confidence':_0x51a6a8,'status':_0x22398d,'status_message':_0x2b06a3});}function _0x30095b(_0x12133a){logger['error'](_0xcc17('0x24'));if(!_[_0xcc17('0x25')](_0x12133a)){logger[_0xcc17('0x16')](_[_0xcc17('0x26')](_0x12133a)?JSON[_0xcc17('0x12')](_0x12133a):_0x12133a);}}_0x11720e['on'](_0xcc17('0x27'),_0x2aba44);_0x11720e['on'](_0xcc17('0x28'),_0x681d13);_0x11720e['on'](_0xcc17('0x15'),_0x47b4ef);_0x11720e['on'](_0xcc17('0x16'),_0x30095b);});}; \ 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 60d733d..10cb4be 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 _0x70e0=['exports','./asr'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0x70e0,0x17b));var _0x070e=function(_0x334df9,_0x2cb256){_0x334df9=_0x334df9-0x0;var _0x5d3975=_0x70e0[_0x334df9];return _0x5d3975;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 09b2ead..783f952 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 _0x6d08=['emit','E_AGI_ARGUMENT_PORT','listen','listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call'];(function(_0x45556a,_0x136646){var _0x45e82f=function(_0xf97f2a){while(--_0xf97f2a){_0x45556a['push'](_0x45556a['shift']());}};_0x45e82f(++_0x136646);}(_0x6d08,0x13d));var _0x86d0=function(_0x242fa1,_0x1675ab){_0x242fa1=_0x242fa1-0x0;var _0x412d85=_0x6d08[_0x242fa1];return _0x412d85;};'use strict';var util=require(_0x86d0('0x0'));var net=require(_0x86d0('0x1'));var EventEmitter=require(_0x86d0('0x2'))[_0x86d0('0x3')];var AGIError=require(_0x86d0('0x4'));var AGIChannel=require(_0x86d0('0x5'));var AGIServer=function(_0xcd89f0,_0x3bd75a,_0x40ec25){var _0x2c61fd=this,_0xcd89f0=_0xcd89f0||0x11dd,_0x3bd75a=_0x3bd75a||_0x86d0('0x6'),_0x183ef5=null,_0x286c74=0x0;EventEmitter[_0x86d0('0x7')](_0x2c61fd);function _0x2c4d1b(){if(!_0xcd89f0){_0x2c61fd[_0x86d0('0x8')]('error',new AGIError(_0x86d0('0x9')));return![];}_0x183ef5=net['createServer']();_0x183ef5[_0x86d0('0xa')](_0xcd89f0,_0x3bd75a);_0x183ef5['on']('listening',function(){_0x2c61fd[_0x86d0('0x8')](_0x86d0('0xb'));});_0x183ef5['on']('connection',function(_0x396f27){_0x183ef5[_0x86d0('0xc')](function(_0x332396,_0x2dc27d){if(_0x332396){_0x2c61fd[_0x86d0('0x8')](_0x86d0('0xd'),new AGIError(_0x86d0('0xe'),_0x332396));}else if(_0x40ec25&&_0x40ec25<0x0){_0x2c61fd['emit'](_0x86d0('0xd'),new AGIError(_0x86d0('0xf')));_0x396f27[_0x86d0('0x10')]();}else if(_0x40ec25&&_0x40ec25>0x0&&_0x40ec25<_0x2dc27d){_0x286c74+=0x1;_0x2c61fd[_0x86d0('0x8')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x286c74));_0x396f27['destroy']();}else{var _0xe798a8=new AGIChannel(_0x396f27);_0xe798a8['on'](_0x86d0('0x11'),function(){_0x2c61fd['emit'](_0x86d0('0x12'),_0xe798a8);});}});});_0x183ef5['on'](_0x86d0('0xd'),function(_0x3c47f3){_0x2c61fd[_0x86d0('0x8')](_0x86d0('0xd'),new AGIError(_0x86d0('0xe'),_0x3c47f3[_0x86d0('0x13')]));});_0x183ef5['on']('close',function(){_0x2c61fd[_0x86d0('0x8')](_0x86d0('0x14'),new AGIError(_0x86d0('0x15')));});}process[_0x86d0('0x16')](function(){_0x2c4d1b();});};util[_0x86d0('0x17')](AGIServer,EventEmitter);module[_0x86d0('0x18')]=function(_0x2b8e14,_0x520b84,_0x982644){return new AGIServer(_0x2b8e14,_0x520b84,_0x982644);}; \ No newline at end of file +var _0xc799=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0xc799,0x1a6));var _0x9c79=function(_0x34e81b,_0x2b96bd){_0x34e81b=_0x34e81b-0x0;var _0x5e22ea=_0xc799[_0x34e81b];return _0x5e22ea;};'use strict';var util=require(_0x9c79('0x0'));var net=require(_0x9c79('0x1'));var EventEmitter=require(_0x9c79('0x2'))[_0x9c79('0x3')];var AGIError=require(_0x9c79('0x4'));var AGIChannel=require(_0x9c79('0x5'));var AGIServer=function(_0x282b0f,_0x44a0b,_0x24b524){var _0x4c6ff7=this,_0x282b0f=_0x282b0f||0x11dd,_0x44a0b=_0x44a0b||_0x9c79('0x6'),_0x419a7f=null,_0x157883=0x0;EventEmitter[_0x9c79('0x7')](_0x4c6ff7);function _0x64c7c4(){if(!_0x282b0f){_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0x9'),new AGIError(_0x9c79('0xa')));return![];}_0x419a7f=net[_0x9c79('0xb')]();_0x419a7f[_0x9c79('0xc')](_0x282b0f,_0x44a0b);_0x419a7f['on'](_0x9c79('0xd'),function(){_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0xd'));});_0x419a7f['on'](_0x9c79('0xe'),function(_0x1021a6){_0x419a7f[_0x9c79('0xf')](function(_0x3b583d,_0x322c21){if(_0x3b583d){_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0x9'),new AGIError(_0x9c79('0x10'),_0x3b583d));}else if(_0x24b524&&_0x24b524<0x0){_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0x9'),new AGIError(_0x9c79('0x11')));_0x1021a6[_0x9c79('0x12')]();}else if(_0x24b524&&_0x24b524>0x0&&_0x24b524<_0x322c21){_0x157883+=0x1;_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0x9'),new AGIError(_0x9c79('0x13'),_0x157883));_0x1021a6[_0x9c79('0x12')]();}else{var _0x204c5d=new AGIChannel(_0x1021a6);_0x204c5d['on'](_0x9c79('0x14'),function(){_0x4c6ff7[_0x9c79('0x8')](_0x9c79('0xe'),_0x204c5d);});}});});_0x419a7f['on'](_0x9c79('0x9'),function(_0x3fe296){_0x4c6ff7['emit'](_0x9c79('0x9'),new AGIError(_0x9c79('0x10'),_0x3fe296[_0x9c79('0x15')]));});_0x419a7f['on'](_0x9c79('0x16'),function(){_0x4c6ff7[_0x9c79('0x8')]('close',new AGIError(_0x9c79('0x17')));});}process[_0x9c79('0x18')](function(){_0x64c7c4();});};util[_0x9c79('0x19')](AGIServer,EventEmitter);module[_0x9c79('0x1a')]=function(_0x30a05f,_0x4974ee,_0x2684d1){return new AGIServer(_0x30a05f,_0x4974ee,_0x2684d1);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 8b5c69a..3e43fe7 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 _0xb8d2=['trim','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceAllVariables','split','length','getAndSetVariable','extra','setVariable','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','timeout','wait','result','no\x20list\x20selected','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','grammar','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','url','Executed\x20command\x20%s','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','wav','%s.%s','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','replace','escape_digits','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','service','host','port','auth','pass','template_id','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','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','then','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','catch','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','calleridname','context','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL'];(function(_0x2ca814,_0x2ce63b){var _0x39ed44=function(_0x3002ca){while(--_0x3002ca){_0x2ca814['push'](_0x2ca814['shift']());}};_0x39ed44(++_0x2ce63b);}(_0xb8d2,0x138));var _0x2b8d=function(_0x4e4e83,_0x2f29a7){_0x4e4e83=_0x4e4e83-0x0;var _0x4cbeb6=_0xb8d2[_0x4e4e83];return _0x4cbeb6;};'use strict';var fs=require('fs');var path=require(_0x2b8d('0x0'));var util=require(_0x2b8d('0x1'));var _=require(_0x2b8d('0x2'));var sh=require(_0x2b8d('0x3'));var odbc=require(_0x2b8d('0x4'))();var rs=require(_0x2b8d('0x5'));var moment=require(_0x2b8d('0x6'));var Mustache=require(_0x2b8d('0x7'));var logger=require(_0x2b8d('0x8'))(_0x2b8d('0x9'));var config=require(_0x2b8d('0xa'));var scripts=require(_0x2b8d('0xb'));var FILES_PATH=_0x2b8d('0xc');var verticesWithRetry=[_0x2b8d('0xd'),_0x2b8d('0xe'),'getsecretdigits'];var AGIVertices=function(_0x46d259,_0x5111ae,_0x51b1dc){this[_0x2b8d('0xf')]=_0x46d259;this[_0x2b8d('0x10')]=_0x5111ae;this[_0x2b8d('0x11')]=_0x51b1dc;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x13')]=function(_0x1ca664,_0x3aa248){this['rpc']['getVariableById'](_0x1ca664)[_0x2b8d('0x14')](function(_0x44aed){_0x3aa248(null,_0x44aed?_0x44aed['name']:![]);})['catch'](function(_0x181a72){_0x3aa248(_0x181a72);});};AGIVertices['prototype'][_0x2b8d('0x15')]=function(_0x22a263,_0x18aa1f){this[_0x2b8d('0x10')][_0x2b8d('0x16')](_0x22a263)[_0x2b8d('0x14')](function(_0x5b949a){_0x18aa1f(null,_0x5b949a?_0x5b949a[_0x2b8d('0x17')]:![]);})['catch'](function(_0x1fa435){_0x18aa1f(_0x1fa435);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x18')]=function(_0x5215fb,_0xfddea3){this[_0x2b8d('0x10')][_0x2b8d('0x19')](_0x5215fb)[_0x2b8d('0x14')](function(_0x4bc185){_0xfddea3(null,_0x4bc185?_0x4bc185[_0x2b8d('0x17')]:![]);})[_0x2b8d('0x1a')](function(_0x5baefa){_0xfddea3(_0x5baefa);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x1b')]=function(_0x3fa286,_0x2777fc){this[_0x2b8d('0x10')]['getSquareOdbcById'](_0x3fa286)[_0x2b8d('0x14')](function(_0x33caad){_0x2777fc(null,_0x33caad?_0x33caad[_0x2b8d('0x1c')]:![]);})[_0x2b8d('0x1a')](function(_0x5718c4){_0x2777fc(_0x5718c4);});};AGIVertices['prototype'][_0x2b8d('0x1d')]=function(_0x1f4a7e,_0x4827a9){this[_0x2b8d('0x10')][_0x2b8d('0x1e')](_0x1f4a7e)['then'](function(_0x3b8500){_0x4827a9(null,_0x3b8500?_0x3b8500[_0x2b8d('0x17')]:![]);})[_0x2b8d('0x1a')](function(_0x83e6d6){_0x4827a9(_0x83e6d6);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x1f')]=function(_0x584409,_0x34bb5e){this[_0x2b8d('0x10')][_0x2b8d('0x20')](_0x584409)[_0x2b8d('0x14')](function(_0x3830ce){_0x34bb5e(null,_0x3830ce?_0x3830ce[_0x2b8d('0x17')]:![]);})[_0x2b8d('0x1a')](function(_0x2cdee8){_0x34bb5e(_0x2cdee8);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x21')]=function(_0x3201d7,_0x3e0e5f){var _0x5535cb=this;this[_0x2b8d('0x10')]['getSoundById'](_0x3201d7)[_0x2b8d('0x14')](function(_0x272b88){_0x3e0e5f(null,_0x272b88?_0x5535cb[_0x2b8d('0x22')](_0x272b88[_0x2b8d('0x23')]):![]);})[_0x2b8d('0x1a')](function(_0x3c3724){_0x3e0e5f(_0x3c3724);});};AGIVertices['prototype']['getMailAccount']=function(_0x1ae9d7,_0x3b7de7){this[_0x2b8d('0x10')][_0x2b8d('0x24')](_0x1ae9d7)[_0x2b8d('0x14')](function(_0x36ea7c){_0x3b7de7(null,_0x36ea7c?_0x36ea7c:![]);})['catch'](function(_0xf1ae80){_0x3b7de7(_0xf1ae80);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x25')]=function(_0x52cd73,_0x1fcf9d,_0x543d74){this['mailRpc'][_0x2b8d('0x25')](_0x52cd73,_0x1fcf9d)[_0x2b8d('0x14')](function(){_0x543d74(null);})[_0x2b8d('0x1a')](function(_0x47eeca){_0x543d74(_0x47eeca);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x26')]=function(_0x38356a,_0x555aed){this['rpc'][_0x2b8d('0x27')](_0x38356a)[_0x2b8d('0x14')](function(_0x15aa8f){if(_0x15aa8f){if(_0x15aa8f[_0x2b8d('0x28')]){_0x555aed(null,[_0x15aa8f[_0x2b8d('0x29')]]);}else{_0x555aed(null,_[_0x2b8d('0x2a')](_0x15aa8f[_0x2b8d('0x2b')],_0x2b8d('0x29')));}}else{_0x555aed(null,![]);}})['catch'](function(_0x56a904){_0x555aed(_0x56a904);});};AGIVertices[_0x2b8d('0x12')]['getSoundPath']=function(_0x4317f0){return util[_0x2b8d('0x2c')](_0x2b8d('0x2d'),FILES_PATH,_0x4317f0);};AGIVertices[_0x2b8d('0x12')]['getQueryOdbc']=function(_0x3485c8,_0x5d9aae,_0xb13607){odbc[_0x2b8d('0x2e')](_0x3485c8,function(_0x626be2){if(_0x626be2){logger['error'](_0x2b8d('0x2f'),_0x626be2);_0xb13607(_0x626be2);}else{logger[_0x2b8d('0x30')](_0x2b8d('0x31'));odbc[_0x2b8d('0x32')](_0x5d9aae,function(_0x5a957d,_0x7f3fa6){if(_0x5a957d){logger[_0x2b8d('0x30')](_0x2b8d('0x33'),_0x5d9aae);_0xb13607(_0x5a957d);}else{logger[_0x2b8d('0x30')]('Query\x20executed\x20correctly\x20%s',_0x5d9aae);odbc[_0x2b8d('0x34')](function(_0x39c7d9){if(_0x39c7d9){logger[_0x2b8d('0x35')](_0x2b8d('0x36'),_0x39c7d9);}_0xb13607(null,_0x7f3fa6);});}});}});};AGIVertices['prototype'][_0x2b8d('0x37')]=function(_0x170e01,_0x30d9bc){this[_0x2b8d('0x10')][_0x2b8d('0x38')](_0x170e01)[_0x2b8d('0x14')](function(_0x399a1d){_0x30d9bc(null,_0x399a1d?_0x399a1d:![]);})[_0x2b8d('0x1a')](function(_0x1398d7){_0x30d9bc(_0x1398d7);});};AGIVertices['prototype'][_0x2b8d('0x39')]=function(_0x283686,_0xa1be0a){this[_0x2b8d('0x10')]['createSmsMessage'](_0x283686)['then'](function(_0x42f8ca){_0xa1be0a(null,_0x42f8ca);})[_0x2b8d('0x1a')](function(_0x2a8d8c){_0xa1be0a(_0x2a8d8c);});};AGIVertices[_0x2b8d('0x12')]['createSquareDetailsReport']=function(_0x10c812,_0x695eed,_0x41c506){this[_0x2b8d('0x10')][_0x2b8d('0x3a')]({'uniqueid':this['channel'][_0x2b8d('0x3b')],'node':_0x10c812['label'],'application':_0x10c812[_0x2b8d('0x3c')],'data':_0x695eed||null,'project_name':this[_0x2b8d('0xf')][_0x2b8d('0x3d')],'callerid':this[_0x2b8d('0xf')]['callerid']})[_0x2b8d('0x14')](function(_0x26443a){if(_0x41c506){_0x41c506(null,_0x26443a);}})[_0x2b8d('0x1a')](function(_0x56fbc3){if(_0x41c506){_0x41c506(_0x56fbc3);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x2c7f5b,_0xf0eb2b,_0x3d6f0e,_0x4d954d){this[_0x2b8d('0x10')][_0x2b8d('0x3e')]({'uniqueid':this[_0x2b8d('0xf')]['uniqueid'],'callerid':this[_0x2b8d('0xf')]['callerid'],'calleridname':this[_0x2b8d('0xf')][_0x2b8d('0x3f')],'context':this['channel'][_0x2b8d('0x40')],'extension':this[_0x2b8d('0xf')][_0x2b8d('0x41')],'priority':this[_0x2b8d('0xf')]['priority'],'accountcode':this[_0x2b8d('0xf')]['accountcode'],'dnid':this[_0x2b8d('0xf')][_0x2b8d('0x42')],'projectName':this[_0x2b8d('0xf')][_0x2b8d('0x3d')],'saveName':_0xf0eb2b,'filename':_0x2c7f5b[_0x2b8d('0x43')]||_0xf0eb2b,'savePath':_0x3d6f0e})[_0x2b8d('0x14')](function(_0x2ffc6b){_0x4d954d(null,_0x2ffc6b);})[_0x2b8d('0x1a')](function(_0x57efb2){_0x4d954d(_0x57efb2);});};AGIVertices[_0x2b8d('0x12')]['createSquareMessage']=function(_0xde6a85,_0x3ced9a,_0x7fbfac){this[_0x2b8d('0x10')][_0x2b8d('0x44')]({'uniqueid':this['channel'][_0x2b8d('0x3b')],'body':_0xde6a85,'direction':_0x3ced9a})[_0x2b8d('0x14')](function(_0x847d8f){if(_0x7fbfac){_0x7fbfac(null,_0x847d8f);}})['catch'](function(_0x319896){if(_0x7fbfac){_0x7fbfac(_0x319896);}});};AGIVertices[_0x2b8d('0x12')]['createCmContact']=function(_0x2beb5c,_0x1a5bfd){this['rpc'][_0x2b8d('0x45')]({'firstName':_[_0x2b8d('0x46')](_0x2beb5c[_0x2b8d('0x17')])||_[_0x2b8d('0x47')](_0x2beb5c[_0x2b8d('0x17')])?_0x2b8d('0x48')+Math['random']():_0x2beb5c[_0x2b8d('0x17')],'lastName':_[_0x2b8d('0x46')](_0x2beb5c[_0x2b8d('0x49')])||_[_0x2b8d('0x47')](_0x2beb5c[_0x2b8d('0x49')])?null:_0x2beb5c[_0x2b8d('0x49')],'phone':_0x2beb5c[_0x2b8d('0x4a')],'ListId':_0x2beb5c[_0x2b8d('0x4b')],'scheduledAt':_0x2beb5c[_0x2b8d('0x4c')],'callbackUniqueid':this[_0x2b8d('0xf')]['uniqueid'],'tags':_0x2b8d('0x4d'),'description':_0x2b8d('0x4e')+_0x2beb5c[_0x2b8d('0x4c')][_0x2b8d('0x4f')](),'priority':_0x2beb5c[_0x2b8d('0x50')]})[_0x2b8d('0x14')](function(_0x4c3863){_0x1a5bfd(null,_0x4c3863);})['catch'](function(_0x283a87){_0x1a5bfd(_0x283a87);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x51')]=function(_0x4baa64,_0x152621){this[_0x2b8d('0x10')][_0x2b8d('0x52')](_0x4baa64)[_0x2b8d('0x14')](function(_0x3f3331){_0x152621(null,_0x3f3331?_0x3f3331[_0x2b8d('0x17')]:![]);})['catch'](function(_0x2b16cc){_0x152621(_0x2b16cc);});};AGIVertices['prototype'][_0x2b8d('0x53')]=function(_0x41144a,_0x269fe8,_0x26c9ea){var _0x3b5de8={'role':_0x2b8d('0x54')};_0x3b5de8[_0x41144a]=this[_0x2b8d('0xf')][_0x2b8d('0x55')];this[_0x2b8d('0x10')][_0x2b8d('0x53')](_0x3b5de8,_0x269fe8,this[_0x2b8d('0xf')][_0x2b8d('0x3b')])['then'](function(_0x30c243){_0x26c9ea(null,_[_0x2b8d('0x47')](_0x30c243)?![]:!![]);})[_0x2b8d('0x1a')](function(_0x37c86d){logger[_0x2b8d('0x35')](_0x37c86d);_0x26c9ea(null,![]);});};AGIVertices['prototype'][_0x2b8d('0x56')]=function(_0x233fe7,_0x443278){var _0x2dd34e={'role':_0x2b8d('0x54')};_0x2dd34e[_0x233fe7]=this[_0x2b8d('0xf')][_0x2b8d('0x55')];this[_0x2b8d('0x10')]['agentUnpause'](_0x2dd34e)['then'](function(_0x41849c){_0x443278(null,_[_0x2b8d('0x47')](_0x41849c)?![]:!![]);})[_0x2b8d('0x1a')](function(_0x1674f0){logger[_0x2b8d('0x35')](_0x1674f0);_0x443278(null,![]);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x57')]=function(_0x495dac,_0x246f95){var _0x49c504={'role':_0x2b8d('0x54')};_0x49c504[_0x495dac]=this[_0x2b8d('0xf')][_0x2b8d('0x55')];this[_0x2b8d('0x10')][_0x2b8d('0x57')](_0x49c504)['then'](function(_0x2031f){_0x246f95(null,_[_0x2b8d('0x47')](_0x2031f)?![]:!![]);})['catch'](function(_0x38b5e7){logger['error'](_0x38b5e7);_0x246f95(null,![]);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x58')]=function(_0x39baf3,_0x27c943){var _0x42081d={'role':'agent'};_0x42081d[_0x39baf3]=this[_0x2b8d('0xf')][_0x2b8d('0x55')];var _0x2090c0=_0x39baf3!=_0x2b8d('0x59')?util['format'](_0x2b8d('0x5a'),_0x2b8d('0x5b'),this['channel'][_0x2b8d('0x55')]):undefined;this['rpc'][_0x2b8d('0x58')](_0x42081d,_0x2090c0)[_0x2b8d('0x14')](function(_0x20dbb2){_0x27c943(null,_[_0x2b8d('0x47')](_0x20dbb2)?![]:!![]);})[_0x2b8d('0x1a')](function(_0x4e02c2){logger[_0x2b8d('0x35')](_0x4e02c2);_0x27c943(null,![]);});};AGIVertices[_0x2b8d('0x12')]['shellCommand']=function(_0x42fe65,_0x1914e0){sh['exec'](_[_0x2b8d('0x5c')](_0x42fe65),function(_0x562d5c,_0x3e31c0){var _0x13eae4=_0x3e31c0['replace'](/(\r\n|\n|\r)/gm,'');_0x1914e0(null,_0x13eae4);});};AGIVertices['prototype'][_0x2b8d('0x5d')]=function(_0x1ab844,_0x39b8e0){scripts[_0x2b8d('0x5d')](_0x1ab844[_0x2b8d('0x5e')],_0x1ab844[_0x2b8d('0x5f')]||'en',0x1)[_0x2b8d('0x14')](function(_0x547e95){_0x39b8e0(null,_0x547e95);})['catch'](function(_0x537a79){_0x39b8e0(_0x537a79);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x60')]=function(_0x68a50c,_0x4934f7){scripts[_0x2b8d('0x60')](this[_0x2b8d('0xf')][_0x2b8d('0x3b')],_0x68a50c[_0x2b8d('0x61')],_0x68a50c['text'],_0x68a50c[_0x2b8d('0x62')]||'en')['then'](function(_0xaa9693){_0x4934f7(null,_0xaa9693);})[_0x2b8d('0x1a')](function(_0x116206){_0x4934f7(_0x116206);});};AGIVertices['prototype'][_0x2b8d('0x63')]=function(_0x3b975c,_0x437712){scripts[_0x2b8d('0x63')](this[_0x2b8d('0xf')],_0x3b975c)[_0x2b8d('0x14')](function(_0x48f5a8){_0x437712(null,_0x48f5a8);})['catch'](function(_0x1987f8){_0x437712(_0x1987f8);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x64')]=function(_0xb30240,_0x24b600){scripts[_0x2b8d('0x64')](_0xb30240['key'],_0xb30240['text'],_0xb30240[_0x2b8d('0x65')]||'en-US',_0xb30240[_0x2b8d('0x66')])[_0x2b8d('0x14')](function(_0x427df3){_0x24b600(null,_0x427df3);})[_0x2b8d('0x1a')](function(_0x482e0b){_0x24b600(_0x482e0b);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x67')]=function(_0xf3668b,_0x1cb7c1,_0x1bbcd1){scripts['ispeechASR'](_0x1cb7c1,_0xf3668b[_0x2b8d('0x61')],_0xf3668b[_0x2b8d('0x68')]||_0x2b8d('0x69'),this[_0x2b8d('0x6a')](_0xf3668b[_0x2b8d('0x6b')])?_0xf3668b[_0x2b8d('0x6b')]:undefined)['then'](function(_0x51f827){_0x1bbcd1(null,_0x51f827);})['catch'](function(_0x1269da){_0x1bbcd1(_0x1269da);});};AGIVertices['prototype'][_0x2b8d('0x6c')]=function(_0x5c348c,_0x2cb0cb){scripts[_0x2b8d('0x6c')](_0x5c348c[_0x2b8d('0x6d')],_0x5c348c['aws_secret_access_key'],_0x5c348c[_0x2b8d('0x6e')],_0x5c348c[_0x2b8d('0x6f')]||_0x2b8d('0x70'),_0x5c348c['text'],_0x5c348c[_0x2b8d('0x71')]||'text')[_0x2b8d('0x14')](function(_0x4ebd64){_0x2cb0cb(null,_0x4ebd64);})[_0x2b8d('0x1a')](function(_0x5df788){_0x2cb0cb(_0x5df788);});};AGIVertices['prototype']['awsLex']=function(_0x2bb997,_0x48b8c1){scripts[_0x2b8d('0x72')](this[_0x2b8d('0xf')][_0x2b8d('0x3b')],_0x2bb997['aws_access_key_id'],_0x2bb997[_0x2b8d('0x73')],_0x2bb997[_0x2b8d('0x74')],_0x2bb997[_0x2b8d('0x5e')],_0x2bb997[_0x2b8d('0x75')])[_0x2b8d('0x14')](function(_0xb6fc63){_0x48b8c1(null,_0xb6fc63);})['catch'](function(_0x35a1b4){_0x48b8c1(_0x35a1b4);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x76')]=function(_0x18f23c,_0xc2ff80,_0x2e155d){scripts[_0x2b8d('0x76')](_0xc2ff80,_0x18f23c['key'],_0x18f23c[_0x2b8d('0x77')]||_0x2b8d('0x69'))[_0x2b8d('0x14')](function(_0x33f04d){_0x2e155d(null,_0x33f04d);})[_0x2b8d('0x1a')](function(_0x28b197){_0x2e155d(_0x28b197);});};AGIVertices[_0x2b8d('0x12')]['tildeASR']=function(_0x144620,_0x1866bb,_0x13a243){scripts[_0x2b8d('0x78')](_0x1866bb,_0x144620[_0x2b8d('0x79')],_0x144620[_0x2b8d('0x7a')],_0x144620[_0x2b8d('0x7b')])[_0x2b8d('0x14')](function(_0x152d7d){_0x13a243(null,_0x152d7d);})[_0x2b8d('0x1a')](function(_0x43c498){_0x13a243(_0x43c498);});};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x7c')]=function(_0x2ae656){var _0x7948c6=_['includes'](verticesWithRetry,_0x2ae656[_0x2b8d('0x3c')])?_0x2ae656:_[_0x2b8d('0x7d')](_0x2ae656);for(var _0x126738 in _0x7948c6){if(_0x7948c6['hasOwnProperty'](_0x126738)){if(_0x7948c6[_0x126738]&&_[_0x2b8d('0x7e')](_0x7948c6[_0x126738])){_0x7948c6[_0x126738]=this[_0x2b8d('0x7f')](_0x7948c6[_0x126738]);}}}return _0x7948c6;};AGIVertices[_0x2b8d('0x12')]['replaceAllVariables']=function(_0x203a0b){var _0x224b26=_0x203a0b[_0x2b8d('0x80')]('{');for(var _0x420988=0x1;_0x420988<_0x224b26[_0x2b8d('0x81')];_0x420988+=0x1){var _0x2e2a49=_0x224b26[_0x420988][_0x2b8d('0x80')]('}');if(_0x2e2a49[_0x2b8d('0x81')]>0x1){_0x203a0b=_0x203a0b['replaceAll']('{'+_0x2e2a49[0x0]+'}',this['channel'][_0x2b8d('0x13')](_0x2e2a49[0x0])['extra']||_0x2e2a49[0x0]);}}if(_0x224b26[_0x2b8d('0x81')]===0x1){return _0x203a0b[_0x2b8d('0x4f')]();}return this[_0x2b8d('0x7f')](_0x203a0b);};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x82')]=function(_0x5adc03,_0x131c86){var _0x5149ab=this[_0x2b8d('0xf')][_0x2b8d('0x13')](_0x5adc03);if(_0x5149ab['result']===-0x1){return _0x5149ab;}logger['info'](util[_0x2b8d('0x2c')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x131c86,_0x5149ab[_0x2b8d('0x83')]));return this['channel'][_0x2b8d('0x84')](_0x131c86,_0x5149ab[_0x2b8d('0x83')]);};AGIVertices[_0x2b8d('0x12')]['isConfigured']=function(_0x2d81b7){return _0x2d81b7&&_0x2d81b7!=='0'&&_0x2d81b7!=='-1'&&_0x2d81b7!=='';};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x85')]=function(_0x35d732){this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x35d732,'-');_0x35d732[_0x2b8d('0x87')]=_0x35d732['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x9')]=function(_0x19d377){logger['info'](util['format'](_0x2b8d('0x88'),_0x19d377[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x9')]([_0x19d377[_0x2b8d('0x8a')],_0x19d377[_0x2b8d('0x8b')]]);};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x8c')]=function(_0x2ddd42){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2ddd42['label']));if(this['isConfigured'](_0x2ddd42[_0x2b8d('0x8d')])){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2ddd42[_0x2b8d('0x8d')]));var _0x4cd4bc=this[_0x2b8d('0xf')][_0x2b8d('0x8e')](_0x2ddd42[_0x2b8d('0x8d')]);if(_0x4cd4bc[_0x2b8d('0x8f')]===-0x1){return _0x4cd4bc;}}return this[_0x2b8d('0xf')][_0x2b8d('0x8c')]();};AGIVertices['prototype'][_0x2b8d('0x4d')]=function(_0x4ba8b1){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4ba8b1[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x4ba8b1[_0x2b8d('0x4b')])){return this['channel']['error'](_0x4ba8b1,_0x2b8d('0x90'));}_0x4ba8b1['scheduledAt']=moment();if(this[_0x2b8d('0x6a')](_0x4ba8b1[_0x2b8d('0x91')])){_0x4ba8b1[_0x2b8d('0x4c')]=moment()['add'](_0x4ba8b1[_0x2b8d('0x91')],_0x2b8d('0x92'));}if(!this[_0x2b8d('0x6a')](_0x4ba8b1[_0x2b8d('0x50')])){_0x4ba8b1[_0x2b8d('0x50')]=0x2;}this[_0x2b8d('0x45')][_0x2b8d('0x86')](this,_0x4ba8b1);return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x94'),_0x4ba8b1['phone'],_0x4ba8b1[_0x2b8d('0x4b')],_0x4ba8b1[_0x2b8d('0x4c')]));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x95')]=function(_0x24738f){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x96'),_0x24738f['label']));var _0x21db93=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x24738f[_0x2b8d('0x98')],_0x24738f[_0x2b8d('0x99')]);if(_0x21db93[_0x2b8d('0x8f')]===-0x1){return _0x21db93;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x9a'),_0x24738f[_0x2b8d('0x98')],_0x24738f[_0x2b8d('0x99')]));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x9b')]=function(_0x10c5fe){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x10c5fe[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x10c5fe[_0x2b8d('0x5e')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x9c'));}var _0x5172b6='\x22'+_0x10c5fe[_0x2b8d('0x5e')]+'\x22';if(this[_0x2b8d('0x6a')](_0x10c5fe['options'])){_0x5172b6+=','+_0x10c5fe[_0x2b8d('0x99')];}var _0x387724=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0x9d'),_0x5172b6);if(_0x387724[_0x2b8d('0x8f')]===-0x1){return _0x387724;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5172b6));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x9e')]=function(_0x6b6715){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x9f'),_0x6b6715[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x6b6715[_0x2b8d('0x5e')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0x9c'));}var _0x3225cb='\x22'+_0x6b6715['text']+'\x22';if(this[_0x2b8d('0x6a')](_0x6b6715[_0x2b8d('0x99')])){_0x3225cb+=','+_0x6b6715[_0x2b8d('0x99')];}var _0x5002a4=this[_0x2b8d('0xf')]['exec'](_0x2b8d('0x9d'),_0x3225cb);if(_0x5002a4[_0x2b8d('0x8f')]===-0x1){return _0x5002a4;}return this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3225cb));};AGIVertices['prototype']['lumenvoxasr']=function(_0x2e7966){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0xa0'),_0x2e7966[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x2e7966['grammar'])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xa1'));}var _0x3256b9=_0x2e7966['grammar'];if(this[_0x2b8d('0x6a')](_0x2e7966[_0x2b8d('0x99')])){_0x3256b9+=','+_0x2e7966[_0x2b8d('0x99')];}var _0x1877df=this[_0x2b8d('0xf')]['exec'](_0x2b8d('0xa2'),_0x3256b9);if(_0x1877df[_0x2b8d('0x8f')]===-0x1){return _0x1877df;}var _0x46ff7c=this[_0x2b8d('0x82')]('RECOG_CONFIDENCE()',_0x2b8d('0xa3'));if(_0x46ff7c[_0x2b8d('0x8f')]===-0x1){return _0x46ff7c;}var _0x4ae062=this[_0x2b8d('0x82')](_0x2b8d('0xa4'),_0x2b8d('0xa5'));if(_0x4ae062[_0x2b8d('0x8f')]===-0x1){return _0x4ae062;}var _0x1d28a5=this['getAndSetVariable'](_0x2b8d('0xa6'),_0x2b8d('0xa7'));if(_0x1d28a5[_0x2b8d('0x8f')]===-0x1){return _0x1d28a5;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3256b9));};AGIVertices[_0x2b8d('0x12')]['sestekasr']=function(_0x565832){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0xa8'),_0x565832[_0x2b8d('0x89')]));if(!this['isConfigured'](_0x565832[_0x2b8d('0xa9')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0xa1'));}var _0x5b90a6=_0x565832[_0x2b8d('0xa9')];if(this['isConfigured'](_0x565832[_0x2b8d('0x99')])){_0x5b90a6+=','+_0x565832['options'];}var _0x386691=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0xa2'),_0x5b90a6);if(_0x386691[_0x2b8d('0x8f')]===-0x1){return _0x386691;}var _0x4dc64e=this[_0x2b8d('0x82')]('RECOG_CONFIDENCE()',_0x2b8d('0xaa'));if(_0x4dc64e[_0x2b8d('0x8f')]===-0x1){return _0x4dc64e;}var _0x15df22=this[_0x2b8d('0x82')]('RECOG_INPUT()',_0x2b8d('0xab'));if(_0x15df22[_0x2b8d('0x8f')]===-0x1){return _0x15df22;}var _0x1c5c52=this[_0x2b8d('0x82')]('RECOG_INSTANCE()',_0x2b8d('0xac'));if(_0x1c5c52['result']===-0x1){return _0x1c5c52;}return this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0xad'),_0x5b90a6));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xae')]=function(_0x3e7c2d){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0xaf'),_0x3e7c2d['label']));if(!this[_0x2b8d('0x6a')](_0x3e7c2d[_0x2b8d('0xb0')])){return this['channel'][_0x2b8d('0x35')](_0x3e7c2d,_0x2b8d('0xb1'));}var _0x18f8d9=this[_0x2b8d('0x1b')]['sync'](this,_0x3e7c2d[_0x2b8d('0xb0')]);if(!_0x18f8d9){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x3e7c2d,_0x2b8d('0xb2'));}if(!this[_0x2b8d('0x6a')](_0x3e7c2d[_0x2b8d('0x32')])){return this['channel'][_0x2b8d('0x35')](_0x3e7c2d,_0x2b8d('0xb3'));}var _0x1d045a=_0x3e7c2d[_0x2b8d('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0xb4'),_0x1d045a));var _0x42edcc=this[_0x2b8d('0xb5')][_0x2b8d('0x86')](this,_0x18f8d9,_0x1d045a);this[_0x2b8d('0x3a')]['sync'](this,_0x3e7c2d,_0x1d045a);if(!this['isConfigured'](_0x3e7c2d['variable_id'])){return this[_0x2b8d('0xf')]['noop'](_0x2b8d('0xb6'));}var _0x1ebea7=this[_0x2b8d('0x13')]['sync'](this,_0x3e7c2d[_0x2b8d('0xb7')]);if(!_0x1ebea7){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x3e7c2d,_0x2b8d('0xb8'));}var _0x74f783=this;_0x42edcc['forEach'](function(_0x11e6b1,_0x2211a6){Object[_0x2b8d('0xb9')](_0x11e6b1)['forEach'](function(_0x1b9379){_0x74f783[_0x2b8d('0xf')]['setVariable'](util[_0x2b8d('0x2c')](_0x2b8d('0xba'),_0x1ebea7,_0x2211a6,_0x1b9379),_0x11e6b1[_0x1b9379]);});});this[_0x2b8d('0xf')][_0x2b8d('0x84')](util[_0x2b8d('0x2c')](_0x2b8d('0xbb'),_0x1ebea7),_0x42edcc[_0x2b8d('0x81')]);return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util['format'](_0x2b8d('0xbc'),_0x1ebea7));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xbd')]=function(_0x3bf103){logger[_0x2b8d('0xbe')](util['format'](_0x2b8d('0xbf'),_0x3bf103['label']));if(!this['isConfigured'](_0x3bf103[_0x2b8d('0xc0')])){return this[_0x2b8d('0xf')]['error'](_0x3bf103,_0x2b8d('0xc1'));}var _0x51bd38=this[_0x2b8d('0x1d')]['sync'](this,_0x3bf103[_0x2b8d('0xc0')]);if(!_0x51bd38){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x3bf103,'no\x20user\x20found');}var _0x337835=this['channel']['exec'](_0x2b8d('0xc2'),[util[_0x2b8d('0x2c')](_0x2b8d('0xc3'),_0x51bd38),_0x3bf103[_0x2b8d('0x8d')],_0x3bf103['opts'],_0x3bf103[_0x2b8d('0xc4')]]);if(_0x337835[_0x2b8d('0x8f')]===-0x1){return _0x337835;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0xc5'),'DIAL'));};AGIVertices[_0x2b8d('0x12')]['dialogflow']=function(_0x3190f3){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3190f3[_0x2b8d('0x89')]));if(!this['isConfigured'](_0x3190f3[_0x2b8d('0x61')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xc6'));}if(!this[_0x2b8d('0x6a')](_0x3190f3['text'])){return this['channel'][_0x2b8d('0x93')]('no\x20text\x20configured');}this[_0x2b8d('0xf')][_0x2b8d('0xc7')]=!![];this[_0x2b8d('0x3a')](_0x3190f3);this[_0x2b8d('0x44')](_0x3190f3['text'],'in');this[_0x2b8d('0xf')]['noop'](util['format'](_0x2b8d('0xc8'),_0x3190f3[_0x2b8d('0x5e')]));var _0x2f0bcf=this[_0x2b8d('0x60')][_0x2b8d('0x86')](this,_0x3190f3);if(_0x2f0bcf){for(var _0x2d2449 in _0x2f0bcf){if(_0x2f0bcf[_0x2b8d('0xc9')](_0x2d2449)){this[_0x2b8d('0xf')]['setVariable'](util[_0x2b8d('0x2c')](_0x2b8d('0xca'),_0x2d2449[_0x2b8d('0xcb')]()),_0x2f0bcf[_0x2d2449]);}}this[_0x2b8d('0x44')](_0x2f0bcf[_0x2b8d('0xcc')],_0x2b8d('0xcd'));return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0xce'),_0x2f0bcf[_0x2b8d('0xcc')]));}return this['channel'][_0x2b8d('0x35')](_0x3190f3,_0x2b8d('0xcf'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xd0')]=function(_0x3ce5b9){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0xd1'),_0x3ce5b9[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x3ce5b9[_0x2b8d('0xd2')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xd3'));}if(!this['isConfigured'](_0x3ce5b9[_0x2b8d('0xd4')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xd5'));}if(!this[_0x2b8d('0x6a')](_0x3ce5b9[_0x2b8d('0xd6')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0xd7'));}if(!this['isConfigured'](_0x3ce5b9['ndassistant_url'])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x9c'));}this[_0x2b8d('0xf')][_0x2b8d('0xc7')]=!![];this[_0x2b8d('0x3a')](_0x3ce5b9);this['createSquareMessage'](_0x3ce5b9['text'],'in');this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0xd8'),_0x3ce5b9[_0x2b8d('0x5e')]));var _0x2887d4=this[_0x2b8d('0x63')]['sync'](this,_0x3ce5b9);if(_0x2887d4){for(var _0x33f248 in _0x2887d4){if(_0x2887d4['hasOwnProperty'](_0x33f248)){this[_0x2b8d('0xf')]['setVariable'](util[_0x2b8d('0x2c')]('SESTEK_NDA_%s',_0x33f248[_0x2b8d('0xcb')]()),_0x2887d4[_0x33f248]);}}this[_0x2b8d('0x44')](_0x2887d4['speech'],_0x2b8d('0xcd'));if(_0x2887d4[_0x2b8d('0xd9')]){this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0xda'),_0x2887d4[_0x2b8d('0xd9')]));var _0x3ab1fd=this[_0x2b8d('0xf')][_0x2b8d('0xdb')](_0x2887d4[_0x2b8d('0xd9')]);try{fs['unlink'](_0x2887d4[_0x2b8d('0xd9')]+_0x2b8d('0xdc'));}catch(_0x4f55cf){logger[_0x2b8d('0x35')](_0x4f55cf);}return _0x3ab1fd;}else{return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('SestekNDA\x20Result\x20%s',_0x2887d4['speech']));}}return this['channel']['error'](_0x3ce5b9,_0x2b8d('0xdd'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xde')]=function(_0x46b554){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0xdf'),_0x46b554['label']));return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xde'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xe0')]=function(_0x4c5d41){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0xe1'),_0x4c5d41[_0x2b8d('0x89')]));var _0x35dbc0='';if(_0x4c5d41['trunk_id']){if(!this[_0x2b8d('0x6a')](_0x4c5d41[_0x2b8d('0xe2')])){return this['channel']['error'](_0x4c5d41,_0x2b8d('0xe3'));}else{var _0x291eee=parseInt(_0x4c5d41['trunk_id'],0xa);if(isNaN(_0x291eee)){_0x35dbc0=_0x4c5d41[_0x2b8d('0xe2')];}else{_0x35dbc0=this['getTrunk']['sync'](this,_0x4c5d41[_0x2b8d('0xe2')]);if(!_0x35dbc0){return this[_0x2b8d('0xf')]['error'](_0x4c5d41,'no\x20trunk\x20found');}}}}else if(_0x4c5d41[_0x2b8d('0xe4')]){_0x35dbc0=_0x4c5d41[_0x2b8d('0xe4')];}else{return this['channel']['error'](_0x4c5d41,_0x2b8d('0xe3'));}var _0x1fc067=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0xc2'),[util[_0x2b8d('0x2c')](_0x2b8d('0xe5'),_0x35dbc0,_0x4c5d41[_0x2b8d('0x4a')]),_0x4c5d41['timeout'],_0x4c5d41[_0x2b8d('0xe6')],_0x4c5d41['url']]);if(_0x1fc067[_0x2b8d('0x8f')]===-0x1){return _0x1fc067;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0xc5'),_0x2b8d('0xc2')));};AGIVertices[_0x2b8d('0x12')]['finally']=function(_0x12a702){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0xe7'),_0x12a702[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xe8'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xe')]=function(_0x2d3893){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0xe9'),_0x2d3893['label']));if(_0x2d3893[_0x2b8d('0x87')]===0x0){return this[_0x2b8d('0x85')](_0x2d3893);}_0x2d3893[_0x2b8d('0x87')]-=0x1;if(!this[_0x2b8d('0x6a')](_0x2d3893['file_id'])){return this[_0x2b8d('0xf')]['error'](_0x2d3893,'no\x20file\x20audio\x20selected');}var _0x6bb827=this[_0x2b8d('0x21')][_0x2b8d('0x86')](this,_0x2d3893[_0x2b8d('0xea')]);if(!_0x6bb827){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x2d3893,_0x2b8d('0xeb'));}if(!this[_0x2b8d('0x6a')](_0x2d3893['variable_id'])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x2b8d('0xb6'));}var _0x6d2667=this[_0x2b8d('0xf')][_0x2b8d('0xec')](_0x6bb827,_0x2d3893['response'],_0x2d3893[_0x2b8d('0xed')]);var _0x498f9f=_0x6d2667[_0x2b8d('0x8f')]?_0x6d2667[_0x2b8d('0x8f')]['toString']():'';logger[_0x2b8d('0x30')](_0x2b8d('0xee'),JSON[_0x2b8d('0xef')](_0x6d2667));if(_0x6d2667[_0x2b8d('0x8f')]===-0x1){this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x2d3893,_0x498f9f);return _0x6d2667;}else if(_0x6d2667[_0x2b8d('0x83')]===_0x2b8d('0x8d')){_0x6d2667[_0x2b8d('0x8f')]=_0x498f9f[_0x2b8d('0x81')]>=parseInt(_0x2d3893['mindigit'])?'x':'i';}else{_0x6d2667[_0x2b8d('0x8f')]=_0x498f9f[_0x2b8d('0x81')]>=parseInt(_0x2d3893[_0x2b8d('0xf0')])&&_0x498f9f[_0x2b8d('0x81')]<=parseInt(_0x2d3893[_0x2b8d('0xed')])?'x':'i';}var _0x222f5d=this['getVariable'][_0x2b8d('0x86')](this,_0x2d3893[_0x2b8d('0xb7')]);if(!_0x222f5d){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x2d3893,_0x2b8d('0xb8'));}this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x222f5d,_0x498f9f);if(this[_0x2b8d('0x6a')](_0x2d3893[_0x2b8d('0xf1')])){var _0x1198fb=parseInt(_0x2d3893[_0x2b8d('0xf1')],0xa);var _0x100e1c=rs[_0x2b8d('0xf2')]({'charset':'*','length':_0x1198fb});var _0x58f600=_0x498f9f['length'];if(_0x58f600>0x0){if(_0x58f600>_0x1198fb){this['createSquareDetailsReport'][_0x2b8d('0x86')](this,_0x2d3893,_0x2d3893[_0x2b8d('0xf3')]===_0x2b8d('0xf4')?_0x100e1c+_0x498f9f['substr'](_0x1198fb):_0x498f9f['substr'](0x0,_0x58f600-_0x1198fb)+_0x100e1c);}else{this[_0x2b8d('0x3a')]['sync'](this,_0x2d3893,rs['generate']({'charset':'*','length':_0x58f600}));}}else{this[_0x2b8d('0x3a')]['sync'](this,_0x2d3893,'');}}else{this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x2d3893,_0x498f9f);}return _0x6d2667;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0xf5')]=function(_0x32832f){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0xf6'),_0x32832f[_0x2b8d('0x89')]));return this[_0x2b8d('0xe')](_0x32832f);};AGIVertices['prototype'][_0x2b8d('0xf7')]=function(_0x1daf17){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0xf8'),_0x1daf17['label']));this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x1daf17,_0x1daf17['goalname']);return this['channel'][_0x2b8d('0x93')](util['format'](_0x2b8d('0xf9'),_0x1daf17[_0x2b8d('0xfa')]));};AGIVertices[_0x2b8d('0x12')]['awspolly']=function(_0x1558fc){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0xfb'),_0x1558fc[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x1558fc['aws_access_key_id'])||!this['isConfigured'](_0x1558fc[_0x2b8d('0x73')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0xfc'));}if(!this['isConfigured'](_0x1558fc[_0x2b8d('0x5e')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x9c'));}this['channel'][_0x2b8d('0x93')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x1558fc[_0x2b8d('0x5e')]));var _0x421eab=this[_0x2b8d('0x6c')][_0x2b8d('0x86')](this,_0x1558fc);if(_0x421eab){this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0xfd'),_0x421eab));var _0x45751f=this['channel'][_0x2b8d('0xdb')](_0x421eab);try{fs['unlink'](_0x421eab+_0x2b8d('0xdc'));}catch(_0x2815a1){logger['error'](_0x2815a1);}return _0x45751f;}return this['channel'][_0x2b8d('0x35')](_0x1558fc,_0x2b8d('0xfe'));};AGIVertices[_0x2b8d('0x12')]['awslex']=function(_0x1472f1){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0xff'),_0x1472f1['label']));if(!this[_0x2b8d('0x6a')](_0x1472f1[_0x2b8d('0x6d')])||!this[_0x2b8d('0x6a')](_0x1472f1[_0x2b8d('0x73')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0xfc'));}if(!this['isConfigured'](_0x1472f1[_0x2b8d('0x75')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x100'));}if(!this[_0x2b8d('0x6a')](_0x1472f1[_0x2b8d('0x5e')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0x9c'));}this[_0x2b8d('0xf')][_0x2b8d('0xc7')]=!![];this[_0x2b8d('0x3a')](_0x1472f1);this['createSquareMessage'](_0x1472f1['text'],'in');this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('Trying\x20Amazon\x20Lex:\x20%s',_0x1472f1[_0x2b8d('0x5e')]));var _0x5ea5c8=this[_0x2b8d('0x72')][_0x2b8d('0x86')](this,_0x1472f1);if(_0x5ea5c8){for(var _0x5b6970 in _0x5ea5c8){if(_0x5ea5c8[_0x2b8d('0xc9')](_0x5b6970)&&_[_0x2b8d('0x7e')](_0x5ea5c8[_0x5b6970])){this['channel'][_0x2b8d('0x84')](util[_0x2b8d('0x2c')](_0x2b8d('0x101'),_0x5b6970['toUpperCase']()),_0x5ea5c8[_0x5b6970]);}}if(_[_0x2b8d('0x47')](_0x5ea5c8[_0x2b8d('0x102')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x103'));}else{this[_0x2b8d('0x44')](_0x5ea5c8[_0x2b8d('0x102')],_0x2b8d('0xcd'));return this['channel']['noop'](util[_0x2b8d('0x2c')]('Amazon\x20Lex\x20Result\x20%s',_0x5ea5c8['message']));}}return this[_0x2b8d('0xf')]['error'](_0x1472f1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x2b8d('0x12')]['googleasr']=function(_0x27fb40){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x27fb40['label'],_0x27fb40[_0x2b8d('0x8d')]));if(!this[_0x2b8d('0x6a')](_0x27fb40[_0x2b8d('0x61')])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0xc6'));}var _0x373dd3=_0x2b8d('0x104');var _0x58dd79=util[_0x2b8d('0x2c')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4d3d92=util['format'](_0x2b8d('0x105'),_0x58dd79,_0x373dd3);var _0x10226e=!![];if(_0x27fb40['beep']===_0x2b8d('0x106')){_0x10226e=![];}var _0x20d26f=this[_0x2b8d('0xf')][_0x2b8d('0x107')](_0x58dd79,_0x373dd3,_0x27fb40['intKey'],_0x27fb40[_0x2b8d('0x8d')],undefined,_0x10226e);if(_0x20d26f['result']!==-0x1){this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('google\x20%s\x20file\x20created',_0x4d3d92));var _0x2beece=this[_0x2b8d('0x76')]['sync'](this,_0x27fb40,_0x4d3d92);if(_0x2beece){for(var _0x567708 in _0x2beece){if(_0x2beece[_0x2b8d('0xc9')](_0x567708)){this['channel'][_0x2b8d('0x84')](util[_0x2b8d('0x2c')](_0x2b8d('0x108'),_0x567708[_0x2b8d('0xcb')]()),_0x2beece[_0x567708]);}}return this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')]('GoogleASR\x20Result\x20%s',JSON[_0x2b8d('0xef')](_0x2beece)));}}return _0x20d26f;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x109')]=function(_0x4fc72a){logger[_0x2b8d('0x30')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4fc72a['label']));if(!this[_0x2b8d('0x6a')](_0x4fc72a['appid'])){return this[_0x2b8d('0xf')]['noop'](_0x2b8d('0x10a'));}if(!this[_0x2b8d('0x6a')](_0x4fc72a['appsecret'])){return this['channel'][_0x2b8d('0x93')](_0x2b8d('0x10b'));}var _0x58b0af='wav';var _0x656a55=util[_0x2b8d('0x2c')](_0x2b8d('0x10c'),FILES_PATH,rs['generate'](0x4));var _0x29f64b=util[_0x2b8d('0x2c')]('%s.%s',_0x656a55,_0x58b0af);var _0x26eb0d=!![];if(_0x4fc72a[_0x2b8d('0x10d')]===_0x2b8d('0x106')){_0x26eb0d=![];}var _0x460530=this[_0x2b8d('0xf')]['recordFile'](_0x656a55,_0x58b0af,_0x4fc72a['intKey'],_0x4fc72a[_0x2b8d('0x8d')],undefined,_0x26eb0d);if(_0x460530['result']!==-0x1){this['channel']['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x10e'),_0x29f64b));var _0x2335a9=this[_0x2b8d('0x78')][_0x2b8d('0x86')](this,_0x4fc72a,_0x29f64b);if(_0x2335a9){for(var _0x5a4425 in _0x2335a9){if(_0x2335a9[_0x2b8d('0xc9')](_0x5a4425)){this[_0x2b8d('0xf')][_0x2b8d('0x84')](util[_0x2b8d('0x2c')]('TILDE_ASR_%s',_0x5a4425[_0x2b8d('0xcb')]()),_0x2335a9[_0x5a4425]);}}return this['channel'][_0x2b8d('0x93')](util['format'](_0x2b8d('0x10f'),JSON[_0x2b8d('0xef')](_0x2335a9)));}}return _0x460530;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x110')]=function(_0x42a01f){logger['info'](util['format'](_0x2b8d('0x111'),_0x42a01f[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x112')](_0x42a01f[_0x2b8d('0x40')],_0x42a01f[_0x2b8d('0x41')],_0x42a01f['priority']);};AGIVertices['prototype']['gotoif']=function(_0x259256){logger['info'](util['format'](_0x2b8d('0x113'),_0x259256[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x259256['condition'])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x259256,_0x2b8d('0x114'));}try{var _0xb6d507=eval(_0x259256[_0x2b8d('0x115')])?_0x2b8d('0x116'):_0x2b8d('0x117');this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x118'),_0x259256[_0x2b8d('0x115')],_0xb6d507));return{'code':0xc8,'result':_0xb6d507};}catch(_0x457090){return{'code':0xc8,'result':_0x2b8d('0x117')};}};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x119')]=function(_0x4a110c){logger[_0x2b8d('0x30')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4a110c['label']));if(!this['isConfigured'](_0x4a110c[_0x2b8d('0x11a')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x4a110c,'no\x20interval\x20configured');}var _0x41480b=this[_0x2b8d('0x26')][_0x2b8d('0x86')](this,_0x4a110c[_0x2b8d('0x11a')]);if(!_0x41480b){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x4a110c,_0x2b8d('0x11b'));}for(var _0x1145a2=0x0;_0x1145a2<_0x41480b[_0x2b8d('0x81')];_0x1145a2+=0x1){var _0x504236=this[_0x2b8d('0xf')][_0x2b8d('0x13')](util[_0x2b8d('0x2c')](_0x2b8d('0x11c'),_0x41480b[_0x1145a2]));if(_0x504236[_0x2b8d('0x8f')]===-0x1){return _0x504236;}logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x11d'),_0x41480b[_0x1145a2],_0x504236[_0x2b8d('0x83')]));if(_0x504236[_0x2b8d('0x83')]===_0x2b8d('0x116')){logger['info'](util['format'](_0x2b8d('0x11d'),_0x41480b[_0x1145a2],_0x2b8d('0x116')));this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x11d'),_0x41480b[_0x1145a2],_0x2b8d('0x116')));return{'code':0xc8,'result':_0x2b8d('0x116')};}else{logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x11d'),_0x41480b[_0x1145a2],_0x2b8d('0x117')));this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x11d'),_0x41480b[_0x1145a2],_0x2b8d('0x117')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x2b8d('0x11e')]=function(_0x3c0ebf){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3c0ebf[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x11e')]();};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x11f')]=function(_0x455fb7){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x120'),_0x455fb7[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x455fb7[_0x2b8d('0x61')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xc6'));}var _0x5d4572=_0x2b8d('0x104');var _0x309fef=util[_0x2b8d('0x2c')](_0x2b8d('0x10c'),FILES_PATH,rs[_0x2b8d('0xf2')](0x4));var _0x2f04dd=util[_0x2b8d('0x2c')]('%s.%s',_0x309fef,_0x5d4572);var _0x6f9b44=!![];if(_0x455fb7[_0x2b8d('0x10d')]==='NOBEEP'){_0x6f9b44=![];}var _0x3b31fd=this['channel'][_0x2b8d('0x107')](_0x309fef,_0x5d4572,_0x455fb7[_0x2b8d('0x121')],_0x455fb7['timeout'],undefined,_0x6f9b44);if(_0x3b31fd[_0x2b8d('0x8f')]!==-0x1){this[_0x2b8d('0xf')][_0x2b8d('0x93')](util['format'](_0x2b8d('0x122'),_0x2f04dd));var _0x53ba0a=this['ispeechASR'][_0x2b8d('0x86')](this,_0x455fb7,_0x2f04dd);if(_0x53ba0a){for(var _0x17ff9e in _0x53ba0a){if(_0x53ba0a[_0x2b8d('0xc9')](_0x17ff9e)){this[_0x2b8d('0xf')][_0x2b8d('0x84')](util[_0x2b8d('0x2c')]('ISPEECH_ASR_%s',_0x17ff9e[_0x2b8d('0xcb')]()),_0x53ba0a[_0x17ff9e]);}}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('IspeechASR\x20Result\x20%s',JSON[_0x2b8d('0xef')](_0x53ba0a)));}}return _0x3b31fd;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x123')]=function(_0x33912b){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x124'),_0x33912b[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x33912b[_0x2b8d('0x61')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')]('no\x20key\x20configured');}if(!this[_0x2b8d('0x6a')](_0x33912b[_0x2b8d('0x5e')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x9c'));}this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x125'),_0x33912b[_0x2b8d('0x5e')]));var _0x5b27c3=this['ispeechTTS'][_0x2b8d('0x86')](this,_0x33912b);if(_0x5b27c3){this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x122'),_0x5b27c3));var _0x4bb3cc=this[_0x2b8d('0xf')][_0x2b8d('0xdb')](_0x5b27c3,_0x33912b[_0x2b8d('0x121')]);try{fs[_0x2b8d('0x126')](_0x5b27c3+_0x2b8d('0xdc'));}catch(_0x579284){logger[_0x2b8d('0x35')](_0x579284);}return _0x4bb3cc;}return this['channel'][_0x2b8d('0x35')](_0x33912b,_0x2b8d('0x127'));};AGIVertices['prototype'][_0x2b8d('0x128')]=function(_0x303240){logger[_0x2b8d('0x30')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x303240[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x303240[_0x2b8d('0x129')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x303240,_0x2b8d('0x12a'));}logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x12b'),this['channel'][_0x2b8d('0x55')],_0x303240[_0x2b8d('0x129')]));var _0x1ff024=this['agentLogin'][_0x2b8d('0x86')](this,_0x303240[_0x2b8d('0x129')]);if(_0x1ff024){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x2b8d('0x55')],_0x303240[_0x2b8d('0x129')]));this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x12c'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x303240[_0x2b8d('0x129')]));return{'code':0xc8,'result':'success'};}else{logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x12d'),this[_0x2b8d('0xf')]['callerid'],_0x303240[_0x2b8d('0x129')]));this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x12d'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x303240[_0x2b8d('0x129')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2b8d('0x12')]['logout']=function(_0x288cc1){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x12e'),_0x288cc1[_0x2b8d('0x89')]));if(!this['isConfigured'](_0x288cc1[_0x2b8d('0x129')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x288cc1,'no\x20find\x20by\x20configured');}logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x12b'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x288cc1[_0x2b8d('0x129')]));var _0x31cf24=this[_0x2b8d('0x57')][_0x2b8d('0x86')](this,_0x288cc1[_0x2b8d('0x129')]);if(_0x31cf24){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x12c'),this['channel'][_0x2b8d('0x55')],_0x288cc1[_0x2b8d('0x129')]));this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x12c'),this['channel'][_0x2b8d('0x55')],_0x288cc1['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x12d'),this['channel'][_0x2b8d('0x55')],_0x288cc1['findBy']));this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2b8d('0xf')]['callerid'],_0x288cc1[_0x2b8d('0x129')]));return{'code':0xc8,'result':_0x2b8d('0x12f')};}};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x130')]=function(_0x60a160){logger[_0x2b8d('0x30')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x60a160[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x60a160[_0x2b8d('0x131')])){return this['channel'][_0x2b8d('0x35')](_0x60a160,'no\x20operation\x20configured');}this[_0x2b8d('0xf')][_0x2b8d('0x93')](util['format'](_0x2b8d('0x132'),_0x60a160[_0x2b8d('0x131')]));var _0x5a1239=eval(_0x60a160['operation']);if(!this[_0x2b8d('0x6a')](_0x60a160[_0x2b8d('0xb7')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0xb6'));}var _0x529781=this[_0x2b8d('0x13')][_0x2b8d('0x86')](this,_0x60a160[_0x2b8d('0xb7')]);if(!_0x529781){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x60a160,_0x2b8d('0xb8'));}if(_['isArray'](_0x5a1239)){var _0x9c6801=this;_0x5a1239[_0x2b8d('0x133')](function(_0x57035c,_0xbebfeb){_0x9c6801['channel']['setVariable'](util[_0x2b8d('0x2c')](_0x2b8d('0x134'),_0x529781,_0xbebfeb),_0x57035c);});return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x135'),_0x529781));}else{return this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x529781,_0x5a1239);}};AGIVertices[_0x2b8d('0x12')]['menu']=function(_0x15edc8){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x15edc8[_0x2b8d('0x89')]));if(_0x15edc8[_0x2b8d('0x87')]===0x0){return this[_0x2b8d('0x85')](_0x15edc8);}_0x15edc8[_0x2b8d('0x87')]-=0x1;if(!this[_0x2b8d('0x6a')](_0x15edc8[_0x2b8d('0xea')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x15edc8,_0x2b8d('0x136'));}var _0x4dcdc9=this[_0x2b8d('0x21')][_0x2b8d('0x86')](this,_0x15edc8[_0x2b8d('0xea')]);if(!_0x4dcdc9){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x15edc8,_0x2b8d('0xeb'));}var _0x22478d=this[_0x2b8d('0xf')]['getData'](_0x4dcdc9,_0x15edc8[_0x2b8d('0x137')],_0x15edc8[_0x2b8d('0x138')]);var _0x138f1e=_0x22478d[_0x2b8d('0x8f')];if(_0x22478d[_0x2b8d('0x8f')]===-0x1){this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x15edc8,'-1');return _0x22478d;}else if(_0x22478d[_0x2b8d('0x83')]===_0x2b8d('0x8d')){_0x22478d[_0x2b8d('0x8f')]=_0x22478d[_0x2b8d('0x8f')][_0x2b8d('0x81')]>0x0?_0x22478d['result']:'t';}else if(_[_0x2b8d('0x46')](_0x22478d[_0x2b8d('0x8f')])){_0x22478d[_0x2b8d('0x8f')]='#';_0x138f1e='#';}if(!this[_0x2b8d('0x6a')](_0x15edc8[_0x2b8d('0xb7')])){this[_0x2b8d('0xf')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4f7f49=this[_0x2b8d('0x13')][_0x2b8d('0x86')](this,_0x15edc8[_0x2b8d('0xb7')]);if(!_0x4f7f49){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x15edc8,_0x2b8d('0xb8'));}this[_0x2b8d('0xf')]['setVariable'](_0x4f7f49,_0x138f1e);}this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x15edc8,_0x138f1e);return _0x22478d;};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x93')]=function(_0x13c1b8){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x139'),_0x13c1b8[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x13c1b8[_0x2b8d('0x13a')]||_0x13c1b8['label']);};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x13b')]=function(_0x4e1cbb){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x13c'),_0x4e1cbb[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x4e1cbb[_0x2b8d('0x129')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x4e1cbb,_0x2b8d('0x12a'));}logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x12b'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x4e1cbb['findBy']));var _0x54ea27=this['getPause'][_0x2b8d('0x86')](this,_0x4e1cbb['pause_id']);var _0x56a119=this[_0x2b8d('0x53')]['sync'](this,_0x4e1cbb['findBy'],_0x54ea27);if(_0x56a119){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x12c'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x4e1cbb[_0x2b8d('0x129')]));this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x12c'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x4e1cbb['findBy']));return{'code':0xc8,'result':_0x2b8d('0x13d')};}else{logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x4e1cbb[_0x2b8d('0x129')]));this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x12c'),this['channel'][_0x2b8d('0x55')],_0x4e1cbb['findBy']));return{'code':0xc8,'result':_0x2b8d('0x12f')};}};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x13e')]=function(_0x22022d){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x13f'),_0x22022d[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x22022d[_0x2b8d('0xea')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x22022d,_0x2b8d('0x136'));}var _0x2a0f5f=this['getSound'][_0x2b8d('0x86')](this,_0x22022d[_0x2b8d('0xea')]);if(!_0x2a0f5f){return this['channel']['error'](_0x22022d,_0x2b8d('0xeb'));}var _0x1c277b=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0x140'),[_0x2a0f5f,_0x22022d[_0x2b8d('0xe6')]]);if(_0x1c277b[_0x2b8d('0x8f')]===-0x1){return _0x1c277b;}return this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x2a0f5f));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x141')]=function(_0x362a87){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x362a87[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x362a87[_0x2b8d('0x142')])){return this[_0x2b8d('0xf')]['error'](_0x362a87,'no\x20queue\x20selected');}var _0x578af8='';var _0x184843=parseInt(_0x362a87['queue_id'],0xa);if(isNaN(_0x184843)){_0x578af8=_0x362a87[_0x2b8d('0x142')];}else{_0x578af8=this['getVoiceQueue'][_0x2b8d('0x86')](this,_0x362a87[_0x2b8d('0x142')]);if(!_0x578af8){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x362a87,'no\x20queue\x20found');}}var _0x46ba3b='';if(this[_0x2b8d('0x6a')](_0x362a87['file_id'])){var _0x17ffc8=this[_0x2b8d('0x21')]['sync'](this,_0x362a87[_0x2b8d('0xea')]);if(_0x17ffc8){_0x46ba3b=_0x17ffc8;}}this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x362a87,_0x578af8);if(_0x362a87[_0x2b8d('0xe6')]['indexOf']('x')<0x0){_0x362a87[_0x2b8d('0xe6')]+='x';}if(_0x362a87[_0x2b8d('0xe6')][_0x2b8d('0x143')]('X')<0x0){_0x362a87['opts']+='X';}this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x2b8d('0x144'),_0x578af8?_0x578af8[_0x2b8d('0x145')]():'');var _0x2dc916=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0x146'),[_0x578af8,_0x362a87[_0x2b8d('0xe6')],_0x362a87[_0x2b8d('0xc4')],_0x46ba3b,_0x362a87['timeout'],_0x362a87['agi'],_0x362a87['macro'],_0x362a87[_0x2b8d('0x147')],'',_0x362a87['position']]);if(_0x2dc916[_0x2b8d('0x8f')]===-0x1){return _0x2dc916;}return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x9a'),_0x2b8d('0x146'),_0x578af8));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x148')]=function(_0x2f7819){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x149'),_0x2f7819[_0x2b8d('0x89')]));var _0x320d9a=_0x2f7819[_0x2b8d('0x14a')]||_0x2b8d('0x104');var _0x332e49=util[_0x2b8d('0x2c')](_0x2b8d('0x14b'),this['channel']['uniqueid'],rs[_0x2b8d('0xf2')](0x5));var _0x2e798e=util[_0x2b8d('0x2c')](_0x2b8d('0x14c'),FILES_PATH,_0x332e49,_0x320d9a);var _0x15e46e=util[_0x2b8d('0x2c')](_0x2b8d('0x10c'),FILES_PATH,_0x332e49);this['createSquareRecording'][_0x2b8d('0x86')](this,_0x2f7819,_0x332e49,_0x2e798e);this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x2b8d('0x14d'),_0x332e49);logger[_0x2b8d('0x30')](_0x2b8d('0x14e'),_0x15e46e,_0x320d9a,_0x2f7819['escape_digits'],_0x2f7819[_0x2b8d('0x8d')]);return this[_0x2b8d('0xf')][_0x2b8d('0x107')](_0x15e46e,_0x320d9a,_0x2f7819['escape_digits'],_0x2f7819['timeout'],undefined,!![]);};AGIVertices[_0x2b8d('0x12')]['saydigits']=function(_0x41baaa){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x14f'),_0x41baaa[_0x2b8d('0x89')]));return this['channel'][_0x2b8d('0x150')](_0x41baaa['digits'][_0x2b8d('0x151')](/\s+/g,''),_0x41baaa[_0x2b8d('0x152')]);};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x153')]=function(_0x1168a9){logger['info'](util[_0x2b8d('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1168a9['label']));return this[_0x2b8d('0xf')][_0x2b8d('0x154')](_0x1168a9[_0x2b8d('0x155')][_0x2b8d('0x151')](/\s+/g,''),_0x1168a9[_0x2b8d('0x152')]);};AGIVertices[_0x2b8d('0x12')]['sayphonetic']=function(_0x49ab0c){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x156'),_0x49ab0c[_0x2b8d('0x89')]));return this[_0x2b8d('0xf')][_0x2b8d('0x157')](_0x49ab0c['text'],_0x49ab0c[_0x2b8d('0x152')]);};AGIVertices['prototype'][_0x2b8d('0x158')]=function(_0x163fb2){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x159'),_0x163fb2[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x163fb2[_0x2b8d('0x15a')])){return this[_0x2b8d('0xf')]['noop'](_0x2b8d('0x15b'));}var _0x323a99=this[_0x2b8d('0x15c')]['sync'](this,_0x163fb2['account_id']);if(!_0x323a99||!_0x323a99[_0x2b8d('0x15d')]){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x163fb2,_0x2b8d('0x15e'));}var _0x53d765={'from':util[_0x2b8d('0x2c')](_0x2b8d('0x15f'),_0x323a99[_0x2b8d('0x17')],_0x323a99['email']||_0x323a99[_0x2b8d('0x15d')][_0x2b8d('0x160')]),'to':_0x163fb2['to']||'','cc':_0x163fb2['cc']||'','bcc':_0x163fb2['bcc']||'','subject':_0x163fb2[_0x2b8d('0x161')],'html':_0x163fb2[_0x2b8d('0x5e')],'text':_0x163fb2[_0x2b8d('0x5e')]};var _0x195906={'tls':{'rejectUnauthorized':![]}};if(_0x323a99['Smtp']['service']){_0x195906['service']=_0x323a99[_0x2b8d('0x15d')][_0x2b8d('0x162')];}else{_0x195906[_0x2b8d('0x163')]=_0x323a99[_0x2b8d('0x15d')][_0x2b8d('0x163')];_0x195906[_0x2b8d('0x164')]=_0x323a99[_0x2b8d('0x15d')][_0x2b8d('0x164')];_0x195906['secure']=_0x323a99[_0x2b8d('0x15d')]['secure'];}if(_0x323a99[_0x2b8d('0x15d')]['authentication']){_0x195906[_0x2b8d('0x165')]={'user':_0x323a99['Smtp'][_0x2b8d('0x160')],'pass':_0x323a99[_0x2b8d('0x15d')][_0x2b8d('0x166')]};}if(this['isConfigured'](_0x163fb2[_0x2b8d('0x167')])){}logger[_0x2b8d('0xbe')](_0x2b8d('0x168'),JSON[_0x2b8d('0xef')](_0x53d765));this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x163fb2,_0x163fb2['account_id']);this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x169'),_0x323a99[_0x2b8d('0x17')]));this[_0x2b8d('0x25')]['sync'](this,_0x195906,_0x53d765);return this['channel'][_0x2b8d('0x93')](_0x2b8d('0x16a'));};AGIVertices['prototype'][_0x2b8d('0x16b')]=function(_0x2369b2){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x16c'),_0x2369b2['label']));return this['channel']['noop'](_0x2b8d('0x16d'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x16e')]=function(_0x534689){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x16f'),_0x534689[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x534689[_0x2b8d('0x170')])){return this[_0x2b8d('0xf')]['noop']('no\x20sms\x20account\x20configured');}var _0xbe1925=this[_0x2b8d('0x37')][_0x2b8d('0x86')](this,_0x534689[_0x2b8d('0x170')]);if(!_0xbe1925){return this['channel'][_0x2b8d('0x35')](_0x534689,'no\x20sms\x20account\x20found');}var _0x3203aa={'body':_0x534689['sms_text'],'phone':_0x534689['to']||'','SmsAccountId':_0xbe1925['id']};logger[_0x2b8d('0xbe')](_0x2b8d('0x171'),JSON[_0x2b8d('0xef')](_0x3203aa));this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x534689,_0x534689[_0x2b8d('0x170')]);this['channel']['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x172'),_0xbe1925['name']));this[_0x2b8d('0x39')][_0x2b8d('0x86')](this,_0x3203aa);return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x173'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x174')]=function(_0x399e9f){logger['info'](util[_0x2b8d('0x2c')](_0x2b8d('0x175'),_0x399e9f[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x399e9f[_0x2b8d('0xb7')])){return this[_0x2b8d('0xf')]['error'](_0x399e9f,'no\x20variable\x20selected');}var _0x5b7793=this[_0x2b8d('0x13')][_0x2b8d('0x86')](this,_0x399e9f['variable_id']);if(!_0x5b7793){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x399e9f,_0x2b8d('0xb8'));}return this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x5b7793,_0x399e9f['variable_value']);};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x176')]=function(_0xe13e1f){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x177'),_0xe13e1f[_0x2b8d('0x89')]));this[_0x2b8d('0xf')]['noop']('START\x20CALLY\x20SQUARE');if(_0xe13e1f[_0x2b8d('0x8c')]===_0x2b8d('0x178')){this['channel'][_0x2b8d('0x93')](_0x2b8d('0x179'));return this[_0x2b8d('0xf')]['answer']();}return this['channel']['noop'](_0x2b8d('0x17a'));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x17b')]=function(_0x4b9401){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x17c'),_0x4b9401[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x4b9401[_0x2b8d('0x17d')])){return this['channel'][_0x2b8d('0x35')](_0x4b9401,_0x2b8d('0x17e'));}var _0x515923=this['getSquareProject'][_0x2b8d('0x86')](this,_0x4b9401[_0x2b8d('0x17d')]);if(!this['isConfigured'](_0x515923)){return this['channel'][_0x2b8d('0x35')](_0x4b9401,util['format'](_0x2b8d('0x17f'),_0x4b9401[_0x2b8d('0x17d')]));}if(_0x515923===this[_0x2b8d('0xf')]['arg_1']){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x4b9401,_0x2b8d('0x180'));}this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x4b9401,_0x515923);var _0x481b24=this[_0x2b8d('0xf')]['exec']('AGI',util[_0x2b8d('0x2c')](_0x2b8d('0x181'),config[_0x2b8d('0x9')][_0x2b8d('0x163')]||'127.0.0.1',_0x515923,this['channel'][_0x2b8d('0x3d')]));if(_0x481b24[_0x2b8d('0x8f')]===-0x1){return _0x481b24;}return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('Executed\x20command\x20%s\x20%s',_0x2b8d('0x182'),_0x515923));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x183')]=function(_0x50ac91){logger[_0x2b8d('0x30')](util['format'](_0x2b8d('0x184'),_0x50ac91[_0x2b8d('0x89')]));var _0x4c1fff=this['shellCommand'][_0x2b8d('0x86')](this,_0x50ac91[_0x2b8d('0x8a')]);this[_0x2b8d('0x3a')][_0x2b8d('0x86')](this,_0x50ac91,_0x50ac91[_0x2b8d('0x8a')]);if(this[_0x2b8d('0x6a')](_0x50ac91['variable_id'])){var _0x38615f=this[_0x2b8d('0x13')]['sync'](this,_0x50ac91['variable_id']);if(_0x38615f){this[_0x2b8d('0xf')][_0x2b8d('0x84')](_0x38615f,_0x4c1fff);return this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x50ac91['command'],_0x38615f));}}return this['channel']['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x185'),_0x50ac91[_0x2b8d('0x8a')]));};AGIVertices[_0x2b8d('0x12')]['tts']=function(_0x568f20){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x186'),_0x568f20[_0x2b8d('0x89')]));if(!this[_0x2b8d('0x6a')](_0x568f20[_0x2b8d('0x5e')])){return this[_0x2b8d('0xf')][_0x2b8d('0x93')](_0x2b8d('0x9c'));}this[_0x2b8d('0xf')][_0x2b8d('0x93')](util['format'](_0x2b8d('0x187'),_0x568f20[_0x2b8d('0x5e')]));var _0x39c047=this[_0x2b8d('0x5d')][_0x2b8d('0x86')](this,_0x568f20);if(_0x39c047){this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x188'),_0x39c047));var _0x1d22fd=this[_0x2b8d('0xf')][_0x2b8d('0xdb')](_0x39c047);try{fs[_0x2b8d('0x126')](_0x39c047+_0x2b8d('0xdc'));}catch(_0x49a0f5){logger[_0x2b8d('0x35')](_0x49a0f5);}return _0x1d22fd;}return this[_0x2b8d('0xf')]['error'](_0x568f20,_0x2b8d('0x189'));};AGIVertices[_0x2b8d('0x12')]['unpause']=function(_0x20be13){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x20be13['label']));if(!this[_0x2b8d('0x6a')](_0x20be13['findBy'])){return this[_0x2b8d('0xf')]['error'](_0x20be13,_0x2b8d('0x12a'));}logger['info'](util[_0x2b8d('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x20be13[_0x2b8d('0x129')]));var _0x6b8cf8=this['agentUnpause'][_0x2b8d('0x86')](this,_0x20be13[_0x2b8d('0x129')]);if(_0x6b8cf8){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x12c'),this[_0x2b8d('0xf')]['callerid'],_0x20be13[_0x2b8d('0x129')]));this[_0x2b8d('0xf')][_0x2b8d('0x93')](util[_0x2b8d('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x20be13['findBy']));return{'code':0xc8,'result':_0x2b8d('0x13d')};}else{logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x12d'),this[_0x2b8d('0xf')][_0x2b8d('0x55')],_0x20be13[_0x2b8d('0x129')]));this[_0x2b8d('0xf')]['noop'](util[_0x2b8d('0x2c')](_0x2b8d('0x12d'),this['channel']['callerid'],_0x20be13[_0x2b8d('0x129')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x18a')]=function(_0x1158a0){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x18b'),_0x1158a0[_0x2b8d('0x89')]));var _0xce0e72=this[_0x2b8d('0xf')][_0x2b8d('0x97')](_0x2b8d('0x18c'),[_0x1158a0[_0x2b8d('0x18d')],_0x1158a0[_0x2b8d('0x99')]]);if(_0xce0e72[_0x2b8d('0x8f')]===-0x1){return _0xce0e72;}return this['channel'][_0x2b8d('0x93')](util[_0x2b8d('0x2c')](_0x2b8d('0x9a'),_0x2b8d('0x18c'),_0x1158a0[_0x2b8d('0x18d')]));};AGIVertices[_0x2b8d('0x12')][_0x2b8d('0x18e')]=function(_0x23c343){logger[_0x2b8d('0x30')](util[_0x2b8d('0x2c')](_0x2b8d('0x18f'),_0x23c343['label']));if(!this[_0x2b8d('0x6a')](_0x23c343[_0x2b8d('0xb7')])){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x23c343,_0x2b8d('0x190'));}var _0x1eea67=this[_0x2b8d('0x13')][_0x2b8d('0x86')](this,_0x23c343[_0x2b8d('0xb7')]);if(!_0x1eea67){return this[_0x2b8d('0xf')][_0x2b8d('0x35')](_0x23c343,_0x2b8d('0xb8'));}var _0x584ad3=this[_0x2b8d('0xf')][_0x2b8d('0x13')](_0x1eea67);return{'code':0xc8,'result':_0x584ad3[_0x2b8d('0x83')]?_0x584ad3[_0x2b8d('0x83')]:'-'};};String[_0x2b8d('0x12')][_0x2b8d('0x191')]=function(_0x1d86bc,_0x111e68){return this[_0x2b8d('0x80')](_0x1d86bc)[_0x2b8d('0x192')](_0x111e68);};module[_0x2b8d('0x193')]=AGIVertices; \ No newline at end of file +var _0x9381=['ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','agicommand','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','label','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','timeout','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','options','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','bot','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','failure','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','subject','service','host','port','secure','auth','user','pass','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','moment','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','getVoiceQueue','getVoiceQueueById','name','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','then','dsn','getUser','getUserById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','callerid','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','exec','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA'];(function(_0xbb044b,_0x4a7ea9){var _0x6b3e96=function(_0x2328c2){while(--_0x2328c2){_0xbb044b['push'](_0xbb044b['shift']());}};_0x6b3e96(++_0x4a7ea9);}(_0x9381,0x13a));var _0x1938=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x9381[_0x3bab09];return _0x164376;};'use strict';var fs=require('fs');var path=require(_0x1938('0x0'));var util=require(_0x1938('0x1'));var _=require(_0x1938('0x2'));var sh=require(_0x1938('0x3'));var odbc=require(_0x1938('0x4'))();var rs=require(_0x1938('0x5'));var moment=require(_0x1938('0x6'));var Mustache=require('mustache');var logger=require('../../config/logger')(_0x1938('0x7'));var config=require(_0x1938('0x8'));var scripts=require(_0x1938('0x9'));var FILES_PATH=_0x1938('0xa');var verticesWithRetry=[_0x1938('0xb'),_0x1938('0xc'),_0x1938('0xd')];var AGIVertices=function(_0x536510,_0x2b104a,_0x2ee675){this[_0x1938('0xe')]=_0x536510;this[_0x1938('0xf')]=_0x2b104a;this[_0x1938('0x10')]=_0x2ee675;};AGIVertices[_0x1938('0x11')][_0x1938('0x12')]=function(_0x38c8e4,_0x442cd0){this['rpc'][_0x1938('0x13')](_0x38c8e4)['then'](function(_0x1880e2){_0x442cd0(null,_0x1880e2?_0x1880e2['name']:![]);})['catch'](function(_0x28ff49){_0x442cd0(_0x28ff49);});};AGIVertices[_0x1938('0x11')][_0x1938('0x14')]=function(_0x57cb1c,_0x4e775c){this['rpc'][_0x1938('0x15')](_0x57cb1c)['then'](function(_0x4525e1){_0x4e775c(null,_0x4525e1?_0x4525e1[_0x1938('0x16')]:![]);})['catch'](function(_0x26d450){_0x4e775c(_0x26d450);});};AGIVertices['prototype'][_0x1938('0x17')]=function(_0x49619f,_0x58e499){this[_0x1938('0xf')]['getSquareProjectById'](_0x49619f)['then'](function(_0x4924cc){_0x58e499(null,_0x4924cc?_0x4924cc[_0x1938('0x16')]:![]);})[_0x1938('0x18')](function(_0x477d66){_0x58e499(_0x477d66);});};AGIVertices['prototype'][_0x1938('0x19')]=function(_0x567d0e,_0x5c5da4){this[_0x1938('0xf')][_0x1938('0x1a')](_0x567d0e)[_0x1938('0x1b')](function(_0x727223){_0x5c5da4(null,_0x727223?_0x727223[_0x1938('0x1c')]:![]);})['catch'](function(_0x4e5644){_0x5c5da4(_0x4e5644);});};AGIVertices[_0x1938('0x11')][_0x1938('0x1d')]=function(_0x516804,_0x1037a3){this[_0x1938('0xf')][_0x1938('0x1e')](_0x516804)[_0x1938('0x1b')](function(_0x4ea6b3){_0x1037a3(null,_0x4ea6b3?_0x4ea6b3['name']:![]);})[_0x1938('0x18')](function(_0x350fd0){_0x1037a3(_0x350fd0);});};AGIVertices[_0x1938('0x11')]['getTrunk']=function(_0x1239c3,_0x589a86){this[_0x1938('0xf')]['getTrunkById'](_0x1239c3)[_0x1938('0x1b')](function(_0x1ad77f){_0x589a86(null,_0x1ad77f?_0x1ad77f['name']:![]);})['catch'](function(_0x4186d0){_0x589a86(_0x4186d0);});};AGIVertices[_0x1938('0x11')][_0x1938('0x1f')]=function(_0x52bdfe,_0x2052ef){var _0x5d3e70=this;this[_0x1938('0xf')][_0x1938('0x20')](_0x52bdfe)[_0x1938('0x1b')](function(_0x153140){_0x2052ef(null,_0x153140?_0x5d3e70[_0x1938('0x21')](_0x153140['save_name']):![]);})[_0x1938('0x18')](function(_0xf9a5ac){_0x2052ef(_0xf9a5ac);});};AGIVertices[_0x1938('0x11')][_0x1938('0x22')]=function(_0x4bcf52,_0x38f880){this[_0x1938('0xf')][_0x1938('0x23')](_0x4bcf52)[_0x1938('0x1b')](function(_0x3503ee){_0x38f880(null,_0x3503ee?_0x3503ee:![]);})[_0x1938('0x18')](function(_0x3ddb35){_0x38f880(_0x3ddb35);});};AGIVertices[_0x1938('0x11')][_0x1938('0x24')]=function(_0x1f9b9f,_0x5c1fcc,_0x4e8d53){this[_0x1938('0x10')][_0x1938('0x24')](_0x1f9b9f,_0x5c1fcc)[_0x1938('0x1b')](function(){_0x4e8d53(null);})[_0x1938('0x18')](function(_0x43f01a){_0x4e8d53(_0x43f01a);});};AGIVertices[_0x1938('0x11')][_0x1938('0x25')]=function(_0x328b83,_0x1afacf){this[_0x1938('0xf')][_0x1938('0x26')](_0x328b83)[_0x1938('0x1b')](function(_0x13aa9e){if(_0x13aa9e){if(_0x13aa9e[_0x1938('0x27')]){_0x1afacf(null,[_0x13aa9e[_0x1938('0x28')]]);}else{_0x1afacf(null,_[_0x1938('0x29')](_0x13aa9e[_0x1938('0x2a')],_0x1938('0x28')));}}else{_0x1afacf(null,![]);}})['catch'](function(_0x57f04a){_0x1afacf(_0x57f04a);});};AGIVertices[_0x1938('0x11')]['getSoundPath']=function(_0x632b67){return util[_0x1938('0x2b')](_0x1938('0x2c'),FILES_PATH,_0x632b67);};AGIVertices['prototype'][_0x1938('0x2d')]=function(_0x424814,_0x59ea71,_0x34db0e){odbc['open'](_0x424814,function(_0x2347ce){if(_0x2347ce){logger[_0x1938('0x2e')](_0x1938('0x2f'),_0x2347ce);_0x34db0e(_0x2347ce);}else{logger[_0x1938('0x30')](_0x1938('0x31'));odbc[_0x1938('0x32')](_0x59ea71,function(_0x4f4bad,_0x1610b5){if(_0x4f4bad){logger[_0x1938('0x30')](_0x1938('0x33'),_0x59ea71);_0x34db0e(_0x4f4bad);}else{logger['info'](_0x1938('0x34'),_0x59ea71);odbc[_0x1938('0x35')](function(_0x3cdad1){if(_0x3cdad1){logger[_0x1938('0x2e')](_0x1938('0x36'),_0x3cdad1);}_0x34db0e(null,_0x1610b5);});}});}});};AGIVertices[_0x1938('0x11')]['getSmsAccount']=function(_0x1a9d1f,_0x3a3062){this[_0x1938('0xf')][_0x1938('0x37')](_0x1a9d1f)['then'](function(_0x30c8d7){_0x3a3062(null,_0x30c8d7?_0x30c8d7:![]);})[_0x1938('0x18')](function(_0x403e57){_0x3a3062(_0x403e57);});};AGIVertices['prototype'][_0x1938('0x38')]=function(_0x3f3a97,_0xded207){this[_0x1938('0xf')][_0x1938('0x38')](_0x3f3a97)[_0x1938('0x1b')](function(_0x35098a){_0xded207(null,_0x35098a);})[_0x1938('0x18')](function(_0x49b1c7){_0xded207(_0x49b1c7);});};AGIVertices[_0x1938('0x11')]['createSquareDetailsReport']=function(_0x56098a,_0xba1572,_0x30fa50){this[_0x1938('0xf')][_0x1938('0x39')]({'uniqueid':this[_0x1938('0xe')][_0x1938('0x3a')],'node':_0x56098a['label'],'application':_0x56098a['agicommand'],'data':_0xba1572||null,'project_name':this[_0x1938('0xe')][_0x1938('0x3b')],'callerid':this[_0x1938('0xe')]['callerid']})[_0x1938('0x1b')](function(_0x595092){if(_0x30fa50){_0x30fa50(null,_0x595092);}})[_0x1938('0x18')](function(_0x9412ca){if(_0x30fa50){_0x30fa50(_0x9412ca);}});};AGIVertices[_0x1938('0x11')]['createSquareRecording']=function(_0x67c4db,_0x2c1193,_0x4d291c,_0xdb8e5c){this[_0x1938('0xf')][_0x1938('0x3c')]({'uniqueid':this[_0x1938('0xe')][_0x1938('0x3a')],'callerid':this[_0x1938('0xe')]['callerid'],'calleridname':this[_0x1938('0xe')][_0x1938('0x3d')],'context':this[_0x1938('0xe')][_0x1938('0x3e')],'extension':this[_0x1938('0xe')][_0x1938('0x3f')],'priority':this['channel'][_0x1938('0x40')],'accountcode':this['channel'][_0x1938('0x41')],'dnid':this[_0x1938('0xe')][_0x1938('0x42')],'projectName':this[_0x1938('0xe')][_0x1938('0x3b')],'saveName':_0x2c1193,'filename':_0x67c4db[_0x1938('0x43')]||_0x2c1193,'savePath':_0x4d291c})['then'](function(_0x590c15){_0xdb8e5c(null,_0x590c15);})[_0x1938('0x18')](function(_0x530189){_0xdb8e5c(_0x530189);});};AGIVertices[_0x1938('0x11')][_0x1938('0x44')]=function(_0x5906ab,_0x5312ab,_0x3b0e8f){this['rpc'][_0x1938('0x44')]({'uniqueid':this[_0x1938('0xe')][_0x1938('0x3a')],'body':_0x5906ab,'direction':_0x5312ab})[_0x1938('0x1b')](function(_0x39d4f3){if(_0x3b0e8f){_0x3b0e8f(null,_0x39d4f3);}})[_0x1938('0x18')](function(_0x18e2a8){if(_0x3b0e8f){_0x3b0e8f(_0x18e2a8);}});};AGIVertices[_0x1938('0x11')][_0x1938('0x45')]=function(_0x5f3c11,_0x2725ac){this[_0x1938('0xf')][_0x1938('0x45')]({'firstName':_[_0x1938('0x46')](_0x5f3c11[_0x1938('0x16')])||_[_0x1938('0x47')](_0x5f3c11[_0x1938('0x16')])?_0x1938('0x48')+Math[_0x1938('0x49')]():_0x5f3c11[_0x1938('0x16')],'lastName':_['isEmpty'](_0x5f3c11['lastName'])||_[_0x1938('0x47')](_0x5f3c11['lastName'])?null:_0x5f3c11[_0x1938('0x4a')],'phone':_0x5f3c11[_0x1938('0x4b')],'ListId':_0x5f3c11[_0x1938('0x4c')],'scheduledAt':_0x5f3c11['scheduledAt'],'callbackUniqueid':this[_0x1938('0xe')][_0x1938('0x3a')],'tags':_0x1938('0x4d'),'description':_0x1938('0x4e')+_0x5f3c11['scheduledAt'][_0x1938('0x4f')](),'priority':_0x5f3c11[_0x1938('0x50')]})[_0x1938('0x1b')](function(_0xd0dbe6){_0x2725ac(null,_0xd0dbe6);})[_0x1938('0x18')](function(_0x29ec4e){_0x2725ac(_0x29ec4e);});};AGIVertices[_0x1938('0x11')]['getPause']=function(_0x3c9392,_0x56c50a){this[_0x1938('0xf')]['getPauseById'](_0x3c9392)[_0x1938('0x1b')](function(_0xa3b943){_0x56c50a(null,_0xa3b943?_0xa3b943[_0x1938('0x16')]:![]);})[_0x1938('0x18')](function(_0x2933bc){_0x56c50a(_0x2933bc);});};AGIVertices[_0x1938('0x11')][_0x1938('0x51')]=function(_0x32e3da,_0x1cf972,_0x84f4a0){var _0x1b37e3={'role':_0x1938('0x52')};_0x1b37e3[_0x32e3da]=this[_0x1938('0xe')][_0x1938('0x53')];this['rpc'][_0x1938('0x51')](_0x1b37e3,_0x1cf972,this[_0x1938('0xe')]['uniqueid'])[_0x1938('0x1b')](function(_0x55f2aa){_0x84f4a0(null,_['isNil'](_0x55f2aa)?![]:!![]);})[_0x1938('0x18')](function(_0x2af3e2){logger[_0x1938('0x2e')](_0x2af3e2);_0x84f4a0(null,![]);});};AGIVertices[_0x1938('0x11')][_0x1938('0x54')]=function(_0x36d70b,_0x5deb87){var _0x3747e3={'role':_0x1938('0x52')};_0x3747e3[_0x36d70b]=this[_0x1938('0xe')][_0x1938('0x53')];this['rpc'][_0x1938('0x54')](_0x3747e3)[_0x1938('0x1b')](function(_0x48411d){_0x5deb87(null,_['isNil'](_0x48411d)?![]:!![]);})[_0x1938('0x18')](function(_0xddfaf1){logger[_0x1938('0x2e')](_0xddfaf1);_0x5deb87(null,![]);});};AGIVertices[_0x1938('0x11')][_0x1938('0x55')]=function(_0x5c34a7,_0x444a69){var _0x70f96c={'role':_0x1938('0x52')};_0x70f96c[_0x5c34a7]=this[_0x1938('0xe')]['callerid'];this['rpc'][_0x1938('0x55')](_0x70f96c)[_0x1938('0x1b')](function(_0x4ebc42){_0x444a69(null,_[_0x1938('0x47')](_0x4ebc42)?![]:!![]);})[_0x1938('0x18')](function(_0x1fe370){logger[_0x1938('0x2e')](_0x1fe370);_0x444a69(null,![]);});};AGIVertices[_0x1938('0x11')]['agentLogin']=function(_0x29afe2,_0x58ab96){var _0x123555={'role':'agent'};_0x123555[_0x29afe2]=this['channel'][_0x1938('0x53')];var _0x172ca1=_0x29afe2!=_0x1938('0x56')?util['format'](_0x1938('0x57'),_0x1938('0x58'),this[_0x1938('0xe')][_0x1938('0x53')]):undefined;this[_0x1938('0xf')][_0x1938('0x59')](_0x123555,_0x172ca1)[_0x1938('0x1b')](function(_0xac08eb){_0x58ab96(null,_[_0x1938('0x47')](_0xac08eb)?![]:!![]);})[_0x1938('0x18')](function(_0x58b02f){logger[_0x1938('0x2e')](_0x58b02f);_0x58ab96(null,![]);});};AGIVertices[_0x1938('0x11')]['shellCommand']=function(_0xf31bf4,_0x1e3626){sh[_0x1938('0x5a')](_['trim'](_0xf31bf4),function(_0x3e9578,_0x1fe17b){var _0x3faf4e=_0x1fe17b[_0x1938('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1e3626(null,_0x3faf4e);});};AGIVertices[_0x1938('0x11')][_0x1938('0x5c')]=function(_0x23e306,_0x1bca46){scripts[_0x1938('0x5c')](_0x23e306[_0x1938('0x5d')],_0x23e306[_0x1938('0x5e')]||'en',0x1)[_0x1938('0x1b')](function(_0x19a145){_0x1bca46(null,_0x19a145);})[_0x1938('0x18')](function(_0x3bd80a){_0x1bca46(_0x3bd80a);});};AGIVertices[_0x1938('0x11')]['googleDialogflow']=function(_0x2c536b,_0x440957){scripts[_0x1938('0x5f')](this[_0x1938('0xe')][_0x1938('0x3a')],_0x2c536b[_0x1938('0x60')],_0x2c536b[_0x1938('0x5d')],_0x2c536b[_0x1938('0x61')]||'en')[_0x1938('0x1b')](function(_0x378ddb){_0x440957(null,_0x378ddb);})[_0x1938('0x18')](function(_0x2c757e){_0x440957(_0x2c757e);});};AGIVertices['prototype'][_0x1938('0x62')]=function(_0x20cfc9,_0x4ed0cd){scripts['sestekNDA'](this[_0x1938('0xe')],_0x20cfc9)[_0x1938('0x1b')](function(_0x50bf2d){_0x4ed0cd(null,_0x50bf2d);})[_0x1938('0x18')](function(_0x458a85){_0x4ed0cd(_0x458a85);});};AGIVertices['prototype'][_0x1938('0x63')]=function(_0x49598d,_0x32843d){scripts[_0x1938('0x63')](_0x49598d[_0x1938('0x60')],_0x49598d[_0x1938('0x5d')],_0x49598d[_0x1938('0x64')]||'en-US',_0x49598d[_0x1938('0x65')])[_0x1938('0x1b')](function(_0x7616cd){_0x32843d(null,_0x7616cd);})[_0x1938('0x18')](function(_0x386e5e){_0x32843d(_0x386e5e);});};AGIVertices['prototype'][_0x1938('0x66')]=function(_0x79e0ed,_0x45e2d7,_0x9cb0bc){scripts['ispeechASR'](_0x45e2d7,_0x79e0ed[_0x1938('0x60')],_0x79e0ed[_0x1938('0x67')]||_0x1938('0x68'),this[_0x1938('0x69')](_0x79e0ed[_0x1938('0x6a')])?_0x79e0ed['model']:undefined)[_0x1938('0x1b')](function(_0x454f86){_0x9cb0bc(null,_0x454f86);})['catch'](function(_0x15c679){_0x9cb0bc(_0x15c679);});};AGIVertices[_0x1938('0x11')][_0x1938('0x6b')]=function(_0x27fe18,_0x3210ab){scripts[_0x1938('0x6b')](_0x27fe18[_0x1938('0x6c')],_0x27fe18[_0x1938('0x6d')],_0x27fe18[_0x1938('0x6e')],_0x27fe18[_0x1938('0x6f')]||'Amy',_0x27fe18[_0x1938('0x5d')],_0x27fe18[_0x1938('0x70')]||_0x1938('0x5d'))[_0x1938('0x1b')](function(_0xa0761e){_0x3210ab(null,_0xa0761e);})['catch'](function(_0x5dcacb){_0x3210ab(_0x5dcacb);});};AGIVertices[_0x1938('0x11')][_0x1938('0x71')]=function(_0x3b6751,_0x154ba9){scripts[_0x1938('0x71')](this[_0x1938('0xe')][_0x1938('0x3a')],_0x3b6751['aws_access_key_id'],_0x3b6751[_0x1938('0x6d')],_0x3b6751['aws_lex_region'],_0x3b6751[_0x1938('0x5d')],_0x3b6751[_0x1938('0x72')])[_0x1938('0x1b')](function(_0x1046cc){_0x154ba9(null,_0x1046cc);})[_0x1938('0x18')](function(_0x3ecdaf){_0x154ba9(_0x3ecdaf);});};AGIVertices['prototype']['googleASR']=function(_0x463844,_0x50412c,_0x2dc597){scripts[_0x1938('0x73')](_0x50412c,_0x463844[_0x1938('0x60')],_0x463844[_0x1938('0x74')]||_0x1938('0x68'))[_0x1938('0x1b')](function(_0xb74f09){_0x2dc597(null,_0xb74f09);})[_0x1938('0x18')](function(_0x36c19c){_0x2dc597(_0x36c19c);});};AGIVertices[_0x1938('0x11')][_0x1938('0x75')]=function(_0x237694,_0x266439,_0x27293a){scripts['tildeASR'](_0x266439,_0x237694[_0x1938('0x76')],_0x237694[_0x1938('0x77')],_0x237694[_0x1938('0x78')])[_0x1938('0x1b')](function(_0x520cd1){_0x27293a(null,_0x520cd1);})[_0x1938('0x18')](function(_0x297c45){_0x27293a(_0x297c45);});};AGIVertices[_0x1938('0x11')][_0x1938('0x79')]=function(_0x575ef0){var _0x1fbcda=_['includes'](verticesWithRetry,_0x575ef0[_0x1938('0x7a')])?_0x575ef0:_['clone'](_0x575ef0);for(var _0x574e44 in _0x1fbcda){if(_0x1fbcda[_0x1938('0x7b')](_0x574e44)){if(_0x1fbcda[_0x574e44]&&_[_0x1938('0x7c')](_0x1fbcda[_0x574e44])){_0x1fbcda[_0x574e44]=this['replaceAllVariables'](_0x1fbcda[_0x574e44]);}}}return _0x1fbcda;};AGIVertices[_0x1938('0x11')][_0x1938('0x7d')]=function(_0x58f741){var _0x12e095=_0x58f741[_0x1938('0x7e')]('{');for(var _0x8404f6=0x1;_0x8404f6<_0x12e095[_0x1938('0x7f')];_0x8404f6+=0x1){var _0x134243=_0x12e095[_0x8404f6][_0x1938('0x7e')]('}');if(_0x134243[_0x1938('0x7f')]>0x1){_0x58f741=_0x58f741[_0x1938('0x80')]('{'+_0x134243[0x0]+'}',this[_0x1938('0xe')][_0x1938('0x12')](_0x134243[0x0])[_0x1938('0x81')]||_0x134243[0x0]);}}if(_0x12e095[_0x1938('0x7f')]===0x1){return _0x58f741[_0x1938('0x4f')]();}return this['replaceAllVariables'](_0x58f741);};AGIVertices[_0x1938('0x11')][_0x1938('0x82')]=function(_0x26ff76,_0x1b6aac){var _0x212f95=this['channel'][_0x1938('0x12')](_0x26ff76);if(_0x212f95[_0x1938('0x83')]===-0x1){return _0x212f95;}logger['info'](util[_0x1938('0x2b')](_0x1938('0x84'),_0x1b6aac,_0x212f95[_0x1938('0x81')]));return this[_0x1938('0xe')][_0x1938('0x85')](_0x1b6aac,_0x212f95['extra']);};AGIVertices['prototype'][_0x1938('0x69')]=function(_0x18acdb){return _0x18acdb&&_0x18acdb!=='0'&&_0x18acdb!=='-1'&&_0x18acdb!=='';};AGIVertices[_0x1938('0x11')][_0x1938('0x86')]=function(_0x1503f9){this['createSquareDetailsReport'][_0x1938('0x87')](this,_0x1503f9,'-');_0x1503f9[_0x1938('0x88')]=_0x1503f9[_0x1938('0x86')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1938('0x11')][_0x1938('0x7')]=function(_0xd0f24e){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0xd0f24e[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x7')]([_0xd0f24e[_0x1938('0x8a')],_0xd0f24e[_0x1938('0x8b')]]);};AGIVertices[_0x1938('0x11')][_0x1938('0x8c')]=function(_0x27e5fa){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x8d'),_0x27e5fa['label']));if(this[_0x1938('0x69')](_0x27e5fa['timeout'])){logger['info'](util[_0x1938('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x27e5fa['timeout']));var _0x5420fe=this[_0x1938('0xe')][_0x1938('0x8e')](_0x27e5fa[_0x1938('0x8f')]);if(_0x5420fe[_0x1938('0x83')]===-0x1){return _0x5420fe;}}return this[_0x1938('0xe')]['answer']();};AGIVertices['prototype'][_0x1938('0x4d')]=function(_0x4251ba){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x90'),_0x4251ba[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x4251ba[_0x1938('0x4c')])){return this[_0x1938('0xe')]['error'](_0x4251ba,_0x1938('0x91'));}_0x4251ba[_0x1938('0x92')]=moment();if(this[_0x1938('0x69')](_0x4251ba[_0x1938('0x93')])){_0x4251ba[_0x1938('0x92')]=moment()['add'](_0x4251ba['delay'],_0x1938('0x94'));}if(!this['isConfigured'](_0x4251ba[_0x1938('0x50')])){_0x4251ba[_0x1938('0x50')]=0x2;}this['createCmContact'][_0x1938('0x87')](this,_0x4251ba);return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x96'),_0x4251ba['phone'],_0x4251ba[_0x1938('0x4c')],_0x4251ba[_0x1938('0x92')]));};AGIVertices['prototype'][_0x1938('0x97')]=function(_0x741580){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x741580[_0x1938('0x89')]));var _0x2523b1=this[_0x1938('0xe')][_0x1938('0x5a')](_0x741580[_0x1938('0x98')],_0x741580[_0x1938('0x99')]);if(_0x2523b1['result']===-0x1){return _0x2523b1;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')]('Executed\x20command\x20%s\x20%s',_0x741580[_0x1938('0x98')],_0x741580['options']));};AGIVertices[_0x1938('0x11')][_0x1938('0x9a')]=function(_0x4b4b3e){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x9b'),_0x4b4b3e[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x4b4b3e['text'])){return this[_0x1938('0xe')][_0x1938('0x95')]('no\x20text\x20configured');}var _0x25d26f='\x22'+_0x4b4b3e[_0x1938('0x5d')]+'\x22';if(this[_0x1938('0x69')](_0x4b4b3e[_0x1938('0x99')])){_0x25d26f+=','+_0x4b4b3e['options'];}var _0x4c52b3=this[_0x1938('0xe')]['exec'](_0x1938('0x9c'),_0x25d26f);if(_0x4c52b3[_0x1938('0x83')]===-0x1){return _0x4c52b3;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x9d'),_0x25d26f));};AGIVertices['prototype'][_0x1938('0x9e')]=function(_0x2d5072){logger[_0x1938('0x30')](util['format'](_0x1938('0x9f'),_0x2d5072['label']));if(!this[_0x1938('0x69')](_0x2d5072[_0x1938('0x5d')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xa0'));}var _0x484ed3='\x22'+_0x2d5072[_0x1938('0x5d')]+'\x22';if(this[_0x1938('0x69')](_0x2d5072[_0x1938('0x99')])){_0x484ed3+=','+_0x2d5072[_0x1938('0x99')];}var _0x43d9a3=this[_0x1938('0xe')]['exec'](_0x1938('0x9c'),_0x484ed3);if(_0x43d9a3[_0x1938('0x83')]===-0x1){return _0x43d9a3;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x484ed3));};AGIVertices[_0x1938('0x11')][_0x1938('0xa1')]=function(_0x279d61){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x279d61[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x279d61[_0x1938('0xa2')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xa3'));}var _0x4702d8=_0x279d61['grammar'];if(this['isConfigured'](_0x279d61[_0x1938('0x99')])){_0x4702d8+=','+_0x279d61[_0x1938('0x99')];}var _0x27ea06=this[_0x1938('0xe')][_0x1938('0x5a')]('MRCPRecog',_0x4702d8);if(_0x27ea06[_0x1938('0x83')]===-0x1){return _0x27ea06;}var _0x5a20c1=this['getAndSetVariable'](_0x1938('0xa4'),_0x1938('0xa5'));if(_0x5a20c1['result']===-0x1){return _0x5a20c1;}var _0x4dbab0=this['getAndSetVariable'](_0x1938('0xa6'),_0x1938('0xa7'));if(_0x4dbab0[_0x1938('0x83')]===-0x1){return _0x4dbab0;}var _0x2ccb8c=this[_0x1938('0x82')](_0x1938('0xa8'),_0x1938('0xa9'));if(_0x2ccb8c['result']===-0x1){return _0x2ccb8c;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xaa'),_0x4702d8));};AGIVertices[_0x1938('0x11')]['sestekasr']=function(_0x3a457f){logger['info'](util[_0x1938('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x3a457f['label']));if(!this[_0x1938('0x69')](_0x3a457f['grammar'])){return this['channel'][_0x1938('0x95')](_0x1938('0xa3'));}var _0x5d5b20=_0x3a457f[_0x1938('0xa2')];if(this[_0x1938('0x69')](_0x3a457f[_0x1938('0x99')])){_0x5d5b20+=','+_0x3a457f[_0x1938('0x99')];}var _0x295a8c=this[_0x1938('0xe')][_0x1938('0x5a')](_0x1938('0xab'),_0x5d5b20);if(_0x295a8c[_0x1938('0x83')]===-0x1){return _0x295a8c;}var _0x3cf4af=this[_0x1938('0x82')](_0x1938('0xa4'),_0x1938('0xac'));if(_0x3cf4af['result']===-0x1){return _0x3cf4af;}var _0x20d7dc=this[_0x1938('0x82')](_0x1938('0xa6'),_0x1938('0xad'));if(_0x20d7dc['result']===-0x1){return _0x20d7dc;}var _0x5db187=this[_0x1938('0x82')]('RECOG_INSTANCE()',_0x1938('0xae'));if(_0x5db187[_0x1938('0x83')]===-0x1){return _0x5db187;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xaa'),_0x5d5b20));};AGIVertices[_0x1938('0x11')][_0x1938('0xaf')]=function(_0x45638e){logger['info'](util[_0x1938('0x2b')](_0x1938('0xb0'),_0x45638e[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x45638e[_0x1938('0xb1')])){return this['channel']['error'](_0x45638e,_0x1938('0xb2'));}var _0x325d4d=this['getSquareOdbc'][_0x1938('0x87')](this,_0x45638e[_0x1938('0xb1')]);if(!_0x325d4d){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x45638e,'no\x20odbc\x20database\x20found');}if(!this[_0x1938('0x69')](_0x45638e[_0x1938('0x32')])){return this[_0x1938('0xe')]['error'](_0x45638e,_0x1938('0xb3'));}var _0x26997e=_0x45638e[_0x1938('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xb4'),_0x26997e));var _0x29a70a=this[_0x1938('0x2d')][_0x1938('0x87')](this,_0x325d4d,_0x26997e);this[_0x1938('0x39')][_0x1938('0x87')](this,_0x45638e,_0x26997e);if(!this[_0x1938('0x69')](_0x45638e[_0x1938('0xb5')])){return this[_0x1938('0xe')]['noop'](_0x1938('0xb6'));}var _0x497fe6=this[_0x1938('0x12')][_0x1938('0x87')](this,_0x45638e[_0x1938('0xb5')]);if(!_0x497fe6){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x45638e,_0x1938('0xb7'));}var _0x1523f0=this;_0x29a70a[_0x1938('0xb8')](function(_0x4d5d37,_0x507efc){Object['keys'](_0x4d5d37)[_0x1938('0xb8')](function(_0x102a75){_0x1523f0['channel'][_0x1938('0x85')](util[_0x1938('0x2b')]('%s[%s][%s]',_0x497fe6,_0x507efc,_0x102a75),_0x4d5d37[_0x102a75]);});});this[_0x1938('0xe')]['setVariable'](util[_0x1938('0x2b')]('%s_ROWS_COUNT',_0x497fe6),_0x29a70a[_0x1938('0x7f')]);return this[_0x1938('0xe')]['noop'](util[_0x1938('0x2b')](_0x1938('0xb9'),_0x497fe6));};AGIVertices[_0x1938('0x11')][_0x1938('0xba')]=function(_0xe0e97c){logger['debug'](util['format'](_0x1938('0xbb'),_0xe0e97c[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0xe0e97c['sip_id'])){return this[_0x1938('0xe')]['error'](_0xe0e97c,_0x1938('0xbc'));}var _0x33fb5a=this['getUser'][_0x1938('0x87')](this,_0xe0e97c['sip_id']);if(!_0x33fb5a){return this[_0x1938('0xe')][_0x1938('0x2e')](_0xe0e97c,_0x1938('0xbd'));}var _0x488602=this[_0x1938('0xe')][_0x1938('0x5a')](_0x1938('0xbe'),[util[_0x1938('0x2b')](_0x1938('0xbf'),_0x33fb5a),_0xe0e97c['timeout'],_0xe0e97c[_0x1938('0xc0')],_0xe0e97c[_0x1938('0xc1')]]);if(_0x488602[_0x1938('0x83')]===-0x1){return _0x488602;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xc2'),'DIAL'));};AGIVertices[_0x1938('0x11')][_0x1938('0xc3')]=function(_0x475582){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x475582['label']));if(!this[_0x1938('0x69')](_0x475582[_0x1938('0x60')])){return this[_0x1938('0xe')]['noop'](_0x1938('0xc4'));}if(!this[_0x1938('0x69')](_0x475582[_0x1938('0x5d')])){return this[_0x1938('0xe')][_0x1938('0x95')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x1938('0x39')](_0x475582);this[_0x1938('0x44')](_0x475582[_0x1938('0x5d')],'in');this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xc5'),_0x475582[_0x1938('0x5d')]));var _0x1fc546=this[_0x1938('0x5f')]['sync'](this,_0x475582);if(_0x1fc546){for(var _0xaab1f2 in _0x1fc546){if(_0x1fc546[_0x1938('0x7b')](_0xaab1f2)){this['channel'][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0xc6'),_0xaab1f2[_0x1938('0xc7')]()),_0x1fc546[_0xaab1f2]);}}this['createSquareMessage'](_0x1fc546[_0x1938('0xc8')],_0x1938('0xc9'));return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')]('Dialogflow\x20Result\x20%s',_0x1fc546[_0x1938('0xc8')]));}return this[_0x1938('0xe')][_0x1938('0x2e')](_0x475582,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1938('0x11')][_0x1938('0xca')]=function(_0x5bdbc9){logger[_0x1938('0x30')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5bdbc9[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x5bdbc9['ndauth_url'])){return this['channel'][_0x1938('0x95')](_0x1938('0xcb'));}if(!this[_0x1938('0x69')](_0x5bdbc9[_0x1938('0xcc')])){return this['channel'][_0x1938('0x95')](_0x1938('0xcd'));}if(!this[_0x1938('0x69')](_0x5bdbc9[_0x1938('0xce')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xcf'));}if(!this['isConfigured'](_0x5bdbc9[_0x1938('0xd0')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xa0'));}this['channel'][_0x1938('0xd1')]=!![];this[_0x1938('0x39')](_0x5bdbc9);this[_0x1938('0x44')](_0x5bdbc9['text'],'in');this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x5bdbc9[_0x1938('0x5d')]));var _0x5c11db=this[_0x1938('0x62')]['sync'](this,_0x5bdbc9);if(_0x5c11db){for(var _0x19de11 in _0x5c11db){if(_0x5c11db[_0x1938('0x7b')](_0x19de11)){this[_0x1938('0xe')][_0x1938('0x85')](util[_0x1938('0x2b')]('SESTEK_NDA_%s',_0x19de11[_0x1938('0xc7')]()),_0x5c11db[_0x19de11]);}}this[_0x1938('0x44')](_0x5c11db[_0x1938('0xc8')],_0x1938('0xc9'));if(_0x5c11db['audiofile']){this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0xd2'),_0x5c11db[_0x1938('0xd3')]));var _0x5e3f6c=this[_0x1938('0xe')]['streamFile'](_0x5c11db[_0x1938('0xd3')]);try{fs[_0x1938('0xd4')](_0x5c11db['audiofile']+_0x1938('0xd5'));}catch(_0x35494a){logger[_0x1938('0x2e')](_0x35494a);}return _0x5e3f6c;}else{return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xd6'),_0x5c11db['speech']));}}return this['channel']['error'](_0x5bdbc9,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x1938('0x11')]['end']=function(_0x5edec4){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5edec4[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xd7'));};AGIVertices[_0x1938('0x11')]['ext_dial']=function(_0x3dc54e){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3dc54e['label']));var _0x382dcc='';if(_0x3dc54e['trunk_id']){if(!this[_0x1938('0x69')](_0x3dc54e[_0x1938('0xd8')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x3dc54e,_0x1938('0xd9'));}else{var _0x260280=parseInt(_0x3dc54e[_0x1938('0xd8')],0xa);if(isNaN(_0x260280)){_0x382dcc=_0x3dc54e[_0x1938('0xd8')];}else{_0x382dcc=this[_0x1938('0xda')][_0x1938('0x87')](this,_0x3dc54e[_0x1938('0xd8')]);if(!_0x382dcc){return this['channel']['error'](_0x3dc54e,_0x1938('0xdb'));}}}}else if(_0x3dc54e['trunk_name']){_0x382dcc=_0x3dc54e[_0x1938('0xdc')];}else{return this[_0x1938('0xe')][_0x1938('0x2e')](_0x3dc54e,_0x1938('0xd9'));}var _0x528304=this['channel'][_0x1938('0x5a')](_0x1938('0xbe'),[util[_0x1938('0x2b')](_0x1938('0xdd'),_0x382dcc,_0x3dc54e['phone']),_0x3dc54e[_0x1938('0x8f')],_0x3dc54e[_0x1938('0xc0')],_0x3dc54e['url']]);if(_0x528304[_0x1938('0x83')]===-0x1){return _0x528304;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xc2'),_0x1938('0xbe')));};AGIVertices[_0x1938('0x11')][_0x1938('0xde')]=function(_0x15aa48){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0xdf'),_0x15aa48[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xde'));};AGIVertices['prototype'][_0x1938('0xc')]=function(_0x50b38a){logger['info'](util['format'](_0x1938('0xe0'),_0x50b38a[_0x1938('0x89')]));if(_0x50b38a[_0x1938('0x88')]===0x0){return this['maxRetry'](_0x50b38a);}_0x50b38a[_0x1938('0x88')]-=0x1;if(!this[_0x1938('0x69')](_0x50b38a[_0x1938('0xe1')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x50b38a,_0x1938('0xe2'));}var _0x3a0d7a=this['getSound']['sync'](this,_0x50b38a[_0x1938('0xe1')]);if(!_0x3a0d7a){return this['channel'][_0x1938('0x2e')](_0x50b38a,_0x1938('0xe3'));}if(!this[_0x1938('0x69')](_0x50b38a[_0x1938('0xb5')])){return this[_0x1938('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x369ca6=this[_0x1938('0xe')][_0x1938('0xe4')](_0x3a0d7a,_0x50b38a[_0x1938('0xe5')],_0x50b38a[_0x1938('0xe6')]);var _0x1fcf14=_0x369ca6[_0x1938('0x83')]?_0x369ca6[_0x1938('0x83')][_0x1938('0x4f')]():'';logger[_0x1938('0x30')](_0x1938('0xe7'),JSON[_0x1938('0xe8')](_0x369ca6));if(_0x369ca6[_0x1938('0x83')]===-0x1){this[_0x1938('0x39')][_0x1938('0x87')](this,_0x50b38a,_0x1fcf14);return _0x369ca6;}else if(_0x369ca6['extra']===_0x1938('0x8f')){_0x369ca6[_0x1938('0x83')]=_0x1fcf14['length']>=parseInt(_0x50b38a[_0x1938('0xe9')])?'x':'i';}else{_0x369ca6[_0x1938('0x83')]=_0x1fcf14[_0x1938('0x7f')]>=parseInt(_0x50b38a[_0x1938('0xe9')])&&_0x1fcf14[_0x1938('0x7f')]<=parseInt(_0x50b38a[_0x1938('0xe6')])?'x':'i';}var _0x2a9dc4=this[_0x1938('0x12')][_0x1938('0x87')](this,_0x50b38a['variable_id']);if(!_0x2a9dc4){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x50b38a,_0x1938('0xb7'));}this[_0x1938('0xe')][_0x1938('0x85')](_0x2a9dc4,_0x1fcf14);if(this['isConfigured'](_0x50b38a[_0x1938('0xea')])){var _0x37dc72=parseInt(_0x50b38a[_0x1938('0xea')],0xa);var _0x3ea59a=rs[_0x1938('0xeb')]({'charset':'*','length':_0x37dc72});var _0x4ee95d=_0x1fcf14['length'];if(_0x4ee95d>0x0){if(_0x4ee95d>_0x37dc72){this[_0x1938('0x39')][_0x1938('0x87')](this,_0x50b38a,_0x50b38a[_0x1938('0xec')]===_0x1938('0xed')?_0x3ea59a+_0x1fcf14[_0x1938('0xee')](_0x37dc72):_0x1fcf14['substr'](0x0,_0x4ee95d-_0x37dc72)+_0x3ea59a);}else{this[_0x1938('0x39')][_0x1938('0x87')](this,_0x50b38a,rs[_0x1938('0xeb')]({'charset':'*','length':_0x4ee95d}));}}else{this[_0x1938('0x39')][_0x1938('0x87')](this,_0x50b38a,'');}}else{this['createSquareDetailsReport'][_0x1938('0x87')](this,_0x50b38a,_0x1fcf14);}return _0x369ca6;};AGIVertices[_0x1938('0x11')][_0x1938('0xd')]=function(_0xc0bffe){logger['info'](util[_0x1938('0x2b')](_0x1938('0xef'),_0xc0bffe['label']));return this[_0x1938('0xc')](_0xc0bffe);};AGIVertices[_0x1938('0x11')][_0x1938('0xf0')]=function(_0x118c94){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x118c94[_0x1938('0x89')]));this[_0x1938('0x39')][_0x1938('0x87')](this,_0x118c94,_0x118c94[_0x1938('0xf1')]);return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xf2'),_0x118c94[_0x1938('0xf1')]));};AGIVertices[_0x1938('0x11')]['awspolly']=function(_0x24617e){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0xf3'),_0x24617e[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x24617e[_0x1938('0x6c')])||!this[_0x1938('0x69')](_0x24617e[_0x1938('0x6d')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xf4'));}if(!this[_0x1938('0x69')](_0x24617e[_0x1938('0x5d')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xa0'));}this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xf5'),_0x24617e['text']));var _0x258575=this[_0x1938('0x6b')][_0x1938('0x87')](this,_0x24617e);if(_0x258575){this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0xf6'),_0x258575));var _0x57207c=this[_0x1938('0xe')]['streamFile'](_0x258575);try{fs[_0x1938('0xd4')](_0x258575+_0x1938('0xd5'));}catch(_0x4268c0){logger['error'](_0x4268c0);}return _0x57207c;}return this[_0x1938('0xe')][_0x1938('0x2e')](_0x24617e,_0x1938('0xf7'));};AGIVertices[_0x1938('0x11')][_0x1938('0xf8')]=function(_0x2e865e){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0xf9'),_0x2e865e[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x2e865e['aws_access_key_id'])||!this['isConfigured'](_0x2e865e[_0x1938('0x6d')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xf4'));}if(!this[_0x1938('0x69')](_0x2e865e['aws_bot_name'])){return this[_0x1938('0xe')][_0x1938('0x95')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x2e865e['text'])){return this[_0x1938('0xe')]['noop'](_0x1938('0xa0'));}this['channel'][_0x1938('0xd1')]=!![];this[_0x1938('0x39')](_0x2e865e);this[_0x1938('0x44')](_0x2e865e[_0x1938('0x5d')],'in');this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xfa'),_0x2e865e[_0x1938('0x5d')]));var _0x57a5e4=this[_0x1938('0x71')][_0x1938('0x87')](this,_0x2e865e);if(_0x57a5e4){for(var _0x1c1c92 in _0x57a5e4){if(_0x57a5e4[_0x1938('0x7b')](_0x1c1c92)&&_[_0x1938('0x7c')](_0x57a5e4[_0x1c1c92])){this[_0x1938('0xe')][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0xfb'),_0x1c1c92['toUpperCase']()),_0x57a5e4[_0x1c1c92]);}}if(_[_0x1938('0x47')](_0x57a5e4['message'])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xfc'));}else{this[_0x1938('0x44')](_0x57a5e4['message'],_0x1938('0xc9'));return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0xfd'),_0x57a5e4[_0x1938('0xfe')]));}}return this[_0x1938('0xe')][_0x1938('0x2e')](_0x2e865e,_0x1938('0xff'));};AGIVertices[_0x1938('0x11')][_0x1938('0x100')]=function(_0x10cffb){logger['info'](util[_0x1938('0x2b')](_0x1938('0x101'),_0x10cffb[_0x1938('0x89')],_0x10cffb[_0x1938('0x8f')]));if(!this['isConfigured'](_0x10cffb[_0x1938('0x60')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xc4'));}var _0x5ab186=_0x1938('0x102');var _0x4988ad=util[_0x1938('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x1938('0xeb')](0x4));var _0x338f8e=util[_0x1938('0x2b')](_0x1938('0x103'),_0x4988ad,_0x5ab186);var _0x249848=!![];if(_0x10cffb[_0x1938('0x104')]===_0x1938('0x105')){_0x249848=![];}var _0x508c7d=this[_0x1938('0xe')]['recordFile'](_0x4988ad,_0x5ab186,_0x10cffb['intKey'],_0x10cffb[_0x1938('0x8f')],undefined,_0x249848);if(_0x508c7d[_0x1938('0x83')]!==-0x1){this['channel']['noop'](util[_0x1938('0x2b')](_0x1938('0x106'),_0x338f8e));var _0xa7c2bd=this[_0x1938('0x73')][_0x1938('0x87')](this,_0x10cffb,_0x338f8e);if(_0xa7c2bd){for(var _0x1b0a5c in _0xa7c2bd){if(_0xa7c2bd['hasOwnProperty'](_0x1b0a5c)){this[_0x1938('0xe')][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0x107'),_0x1b0a5c['toUpperCase']()),_0xa7c2bd[_0x1b0a5c]);}}return this[_0x1938('0xe')][_0x1938('0x95')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0xa7c2bd)));}}return _0x508c7d;};AGIVertices['prototype'][_0x1938('0x108')]=function(_0x39370d){logger[_0x1938('0x30')](util['format'](_0x1938('0x109'),_0x39370d[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x39370d[_0x1938('0x76')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x10a'));}if(!this[_0x1938('0x69')](_0x39370d[_0x1938('0x77')])){return this['channel'][_0x1938('0x95')](_0x1938('0x10b'));}var _0xa4d035=_0x1938('0x102');var _0x15e766=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x1938('0xeb')](0x4));var _0x54518c=util['format'](_0x1938('0x103'),_0x15e766,_0xa4d035);var _0x58ebce=!![];if(_0x39370d['beep']===_0x1938('0x105')){_0x58ebce=![];}var _0x16f281=this['channel'][_0x1938('0x10c')](_0x15e766,_0xa4d035,_0x39370d[_0x1938('0x10d')],_0x39370d[_0x1938('0x8f')],undefined,_0x58ebce);if(_0x16f281[_0x1938('0x83')]!==-0x1){this['channel']['noop'](util[_0x1938('0x2b')](_0x1938('0x10e'),_0x54518c));var _0x1918b4=this[_0x1938('0x75')]['sync'](this,_0x39370d,_0x54518c);if(_0x1918b4){for(var _0x50d322 in _0x1918b4){if(_0x1918b4[_0x1938('0x7b')](_0x50d322)){this['channel'][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0x10f'),_0x50d322['toUpperCase']()),_0x1918b4[_0x50d322]);}}return this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0x1938('0xe8')](_0x1918b4)));}}return _0x16f281;};AGIVertices[_0x1938('0x11')][_0x1938('0x110')]=function(_0xf8db6d){logger[_0x1938('0x30')](util['format'](_0x1938('0x111'),_0xf8db6d['label']));return this[_0x1938('0xe')]['continueAt'](_0xf8db6d['context'],_0xf8db6d[_0x1938('0x3f')],_0xf8db6d[_0x1938('0x40')]);};AGIVertices[_0x1938('0x11')][_0x1938('0x112')]=function(_0x41a096){logger['info'](util[_0x1938('0x2b')](_0x1938('0x113'),_0x41a096[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x41a096[_0x1938('0x114')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x41a096,_0x1938('0x115'));}try{var _0x1e64b9=eval(_0x41a096[_0x1938('0x114')])?_0x1938('0x116'):_0x1938('0x117');this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x118'),_0x41a096[_0x1938('0x114')],_0x1e64b9));return{'code':0xc8,'result':_0x1e64b9};}catch(_0x2e2eee){return{'code':0xc8,'result':_0x1938('0x117')};}};AGIVertices['prototype'][_0x1938('0x119')]=function(_0x1a0f78){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x11a'),_0x1a0f78[_0x1938('0x89')]));if(!this['isConfigured'](_0x1a0f78['interval_id'])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x1a0f78,_0x1938('0x11b'));}var _0x2b5fab=this['getIntervals']['sync'](this,_0x1a0f78[_0x1938('0x11c')]);if(!_0x2b5fab){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x1a0f78,_0x1938('0x11d'));}for(var _0x594363=0x0;_0x594363<_0x2b5fab[_0x1938('0x7f')];_0x594363+=0x1){var _0x4606bd=this[_0x1938('0xe')][_0x1938('0x12')](util[_0x1938('0x2b')](_0x1938('0x11e'),_0x2b5fab[_0x594363]));if(_0x4606bd[_0x1938('0x83')]===-0x1){return _0x4606bd;}logger['info'](util['format'](_0x1938('0x11f'),_0x2b5fab[_0x594363],_0x4606bd[_0x1938('0x81')]));if(_0x4606bd[_0x1938('0x81')]===_0x1938('0x116')){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x2b5fab[_0x594363],'true'));this['channel'][_0x1938('0x95')](util['format']('IFTIME\x20%s\x20%s',_0x2b5fab[_0x594363],'true'));return{'code':0xc8,'result':_0x1938('0x116')};}else{logger[_0x1938('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x2b5fab[_0x594363],_0x1938('0x117')));this['channel'][_0x1938('0x95')](util['format'](_0x1938('0x11f'),_0x2b5fab[_0x594363],_0x1938('0x117')));}}return{'code':0xc8,'result':_0x1938('0x117')};};AGIVertices[_0x1938('0x11')][_0x1938('0x120')]=function(_0x83ab41){logger['info'](util[_0x1938('0x2b')](_0x1938('0x121'),_0x83ab41[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x120')]();};AGIVertices[_0x1938('0x11')]['ispeechasr']=function(_0x1a4d83){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x122'),_0x1a4d83[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x1a4d83[_0x1938('0x60')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xc4'));}var _0x2a2dfa=_0x1938('0x102');var _0x5d9dcd=util[_0x1938('0x2b')](_0x1938('0x123'),FILES_PATH,rs[_0x1938('0xeb')](0x4));var _0x40a7ef=util[_0x1938('0x2b')]('%s.%s',_0x5d9dcd,_0x2a2dfa);var _0x3f877e=!![];if(_0x1a4d83['beep']===_0x1938('0x105')){_0x3f877e=![];}var _0x556763=this['channel'][_0x1938('0x10c')](_0x5d9dcd,_0x2a2dfa,_0x1a4d83['intKey'],_0x1a4d83[_0x1938('0x8f')],undefined,_0x3f877e);if(_0x556763[_0x1938('0x83')]!==-0x1){this['channel'][_0x1938('0x95')](util['format'](_0x1938('0x124'),_0x40a7ef));var _0x3c4571=this[_0x1938('0x66')]['sync'](this,_0x1a4d83,_0x40a7ef);if(_0x3c4571){for(var _0x2bf9e6 in _0x3c4571){if(_0x3c4571[_0x1938('0x7b')](_0x2bf9e6)){this[_0x1938('0xe')][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0x125'),_0x2bf9e6[_0x1938('0xc7')]()),_0x3c4571[_0x2bf9e6]);}}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x126'),JSON[_0x1938('0xe8')](_0x3c4571)));}}return _0x556763;};AGIVertices['prototype'][_0x1938('0x127')]=function(_0x466c1a){logger[_0x1938('0x30')](util['format'](_0x1938('0x128'),_0x466c1a[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x466c1a[_0x1938('0x60')])){return this['channel'][_0x1938('0x95')]('no\x20key\x20configured');}if(!this[_0x1938('0x69')](_0x466c1a['text'])){return this['channel'][_0x1938('0x95')](_0x1938('0xa0'));}this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x129'),_0x466c1a[_0x1938('0x5d')]));var _0x415017=this['ispeechTTS'][_0x1938('0x87')](this,_0x466c1a);if(_0x415017){this['channel'][_0x1938('0x95')](util['format'](_0x1938('0x124'),_0x415017));var _0x4463ac=this['channel'][_0x1938('0x12a')](_0x415017,_0x466c1a[_0x1938('0x10d')]);try{fs[_0x1938('0xd4')](_0x415017+_0x1938('0xd5'));}catch(_0x5a155d){logger['error'](_0x5a155d);}return _0x4463ac;}return this['channel']['error'](_0x466c1a,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1938('0x11')][_0x1938('0x12b')]=function(_0x534111){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x12c'),_0x534111[_0x1938('0x89')]));if(!this['isConfigured'](_0x534111[_0x1938('0x12d')])){return this['channel'][_0x1938('0x2e')](_0x534111,'no\x20find\x20by\x20configured');}logger[_0x1938('0x30')](util[_0x1938('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1938('0xe')][_0x1938('0x53')],_0x534111['findBy']));var _0x477b5b=this['agentLogin'][_0x1938('0x87')](this,_0x534111[_0x1938('0x12d')]);if(_0x477b5b){logger['info'](util[_0x1938('0x2b')](_0x1938('0x12e'),this['channel'][_0x1938('0x53')],_0x534111[_0x1938('0x12d')]));this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0x12e'),this[_0x1938('0xe')][_0x1938('0x53')],_0x534111[_0x1938('0x12d')]));return{'code':0xc8,'result':_0x1938('0x12f')};}else{logger[_0x1938('0x30')](util[_0x1938('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1938('0xe')]['callerid'],_0x534111[_0x1938('0x12d')]));this[_0x1938('0xe')]['noop'](util['format'](_0x1938('0x130'),this[_0x1938('0xe')][_0x1938('0x53')],_0x534111[_0x1938('0x12d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x33c3b1){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x131'),_0x33c3b1[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x33c3b1[_0x1938('0x12d')])){return this[_0x1938('0xe')]['error'](_0x33c3b1,_0x1938('0x132'));}logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x133'),this[_0x1938('0xe')][_0x1938('0x53')],_0x33c3b1[_0x1938('0x12d')]));var _0x43e745=this['agentLogout'][_0x1938('0x87')](this,_0x33c3b1['findBy']);if(_0x43e745){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1938('0xe')]['callerid'],_0x33c3b1[_0x1938('0x12d')]));this[_0x1938('0xe')]['noop'](util[_0x1938('0x2b')](_0x1938('0x12e'),this[_0x1938('0xe')]['callerid'],_0x33c3b1[_0x1938('0x12d')]));return{'code':0xc8,'result':_0x1938('0x12f')};}else{logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x130'),this[_0x1938('0xe')][_0x1938('0x53')],_0x33c3b1[_0x1938('0x12d')]));this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x130'),this['channel'][_0x1938('0x53')],_0x33c3b1['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x1938('0x134')]=function(_0xe3d886){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x135'),_0xe3d886['label']));if(!this[_0x1938('0x69')](_0xe3d886[_0x1938('0x136')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0xe3d886,_0x1938('0x137'));}this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x138'),_0xe3d886[_0x1938('0x136')]));var _0x12b98b=eval(_0xe3d886['operation']);if(!this['isConfigured'](_0xe3d886[_0x1938('0xb5')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0xb6'));}var _0x3c42fc=this[_0x1938('0x12')][_0x1938('0x87')](this,_0xe3d886[_0x1938('0xb5')]);if(!_0x3c42fc){return this['channel']['error'](_0xe3d886,_0x1938('0xb7'));}if(_[_0x1938('0x139')](_0x12b98b)){var _0x42dd4b=this;_0x12b98b[_0x1938('0xb8')](function(_0x54420c,_0x2d266c){_0x42dd4b[_0x1938('0xe')][_0x1938('0x85')](util[_0x1938('0x2b')](_0x1938('0x13a'),_0x3c42fc,_0x2d266c),_0x54420c);});return this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x13b'),_0x3c42fc));}else{return this[_0x1938('0xe')][_0x1938('0x85')](_0x3c42fc,_0x12b98b);}};AGIVertices[_0x1938('0x11')][_0x1938('0xb')]=function(_0x22e551){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x13c'),_0x22e551[_0x1938('0x89')]));if(_0x22e551[_0x1938('0x88')]===0x0){return this[_0x1938('0x86')](_0x22e551);}_0x22e551['retry']-=0x1;if(!this[_0x1938('0x69')](_0x22e551[_0x1938('0xe1')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x22e551,_0x1938('0xe2'));}var _0x46c886=this[_0x1938('0x1f')][_0x1938('0x87')](this,_0x22e551[_0x1938('0xe1')]);if(!_0x46c886){return this['channel'][_0x1938('0x2e')](_0x22e551,_0x1938('0xe3'));}var _0x41ed11=this[_0x1938('0xe')][_0x1938('0xe4')](_0x46c886,_0x22e551[_0x1938('0xe5')],_0x22e551[_0x1938('0x13d')]);var _0x7107a2=_0x41ed11[_0x1938('0x83')];if(_0x41ed11[_0x1938('0x83')]===-0x1){this[_0x1938('0x39')]['sync'](this,_0x22e551,'-1');return _0x41ed11;}else if(_0x41ed11['extra']===_0x1938('0x8f')){_0x41ed11['result']=_0x41ed11[_0x1938('0x83')][_0x1938('0x7f')]>0x0?_0x41ed11[_0x1938('0x83')]:'t';}else if(_[_0x1938('0x46')](_0x41ed11[_0x1938('0x83')])){_0x41ed11[_0x1938('0x83')]='#';_0x7107a2='#';}if(!this['isConfigured'](_0x22e551[_0x1938('0xb5')])){this[_0x1938('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5a203b=this[_0x1938('0x12')][_0x1938('0x87')](this,_0x22e551[_0x1938('0xb5')]);if(!_0x5a203b){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x22e551,_0x1938('0xb7'));}this[_0x1938('0xe')][_0x1938('0x85')](_0x5a203b,_0x7107a2);}this[_0x1938('0x39')][_0x1938('0x87')](this,_0x22e551,_0x7107a2);return _0x41ed11;};AGIVertices[_0x1938('0x11')][_0x1938('0x95')]=function(_0x282876){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x13e'),_0x282876[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x95')](_0x282876[_0x1938('0x13f')]||_0x282876['label']);};AGIVertices[_0x1938('0x11')][_0x1938('0x140')]=function(_0x1c1f4b){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x141'),_0x1c1f4b['label']));if(!this[_0x1938('0x69')](_0x1c1f4b[_0x1938('0x12d')])){return this[_0x1938('0xe')]['error'](_0x1c1f4b,_0x1938('0x132'));}logger['info'](util[_0x1938('0x2b')](_0x1938('0x133'),this[_0x1938('0xe')][_0x1938('0x53')],_0x1c1f4b[_0x1938('0x12d')]));var _0x57c272=this[_0x1938('0x142')][_0x1938('0x87')](this,_0x1c1f4b['pause_id']);var _0x85f778=this[_0x1938('0x51')]['sync'](this,_0x1c1f4b['findBy'],_0x57c272);if(_0x85f778){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x12e'),this['channel'][_0x1938('0x53')],_0x1c1f4b[_0x1938('0x12d')]));this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0x12e'),this['channel'][_0x1938('0x53')],_0x1c1f4b[_0x1938('0x12d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1938('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1938('0xe')][_0x1938('0x53')],_0x1c1f4b['findBy']));this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0x12e'),this[_0x1938('0xe')]['callerid'],_0x1c1f4b['findBy']));return{'code':0xc8,'result':_0x1938('0x143')};}};AGIVertices['prototype'][_0x1938('0x144')]=function(_0x29acf7){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x29acf7[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x29acf7[_0x1938('0xe1')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x29acf7,_0x1938('0xe2'));}var _0x319386=this[_0x1938('0x1f')][_0x1938('0x87')](this,_0x29acf7[_0x1938('0xe1')]);if(!_0x319386){return this[_0x1938('0xe')]['error'](_0x29acf7,_0x1938('0xe3'));}var _0xa880fa=this[_0x1938('0xe')][_0x1938('0x5a')](_0x1938('0x145'),[_0x319386,_0x29acf7[_0x1938('0xc0')]]);if(_0xa880fa[_0x1938('0x83')]===-0x1){return _0xa880fa;}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x146'),_0x1938('0x145'),_0x319386));};AGIVertices[_0x1938('0x11')]['queue']=function(_0x44989b){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x147'),_0x44989b[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x44989b[_0x1938('0x148')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x44989b,_0x1938('0x149'));}var _0x23d701='';var _0x248382=parseInt(_0x44989b[_0x1938('0x148')],0xa);if(isNaN(_0x248382)){_0x23d701=_0x44989b[_0x1938('0x148')];}else{_0x23d701=this[_0x1938('0x14')][_0x1938('0x87')](this,_0x44989b['queue_id']);if(!_0x23d701){return this['channel'][_0x1938('0x2e')](_0x44989b,_0x1938('0x14a'));}}var _0x2b235='';if(this['isConfigured'](_0x44989b[_0x1938('0xe1')])){var _0x35d9e0=this[_0x1938('0x1f')][_0x1938('0x87')](this,_0x44989b[_0x1938('0xe1')]);if(_0x35d9e0){_0x2b235=_0x35d9e0;}}this[_0x1938('0x39')][_0x1938('0x87')](this,_0x44989b,_0x23d701);if(_0x44989b['opts'][_0x1938('0x14b')]('x')<0x0){_0x44989b['opts']+='x';}if(_0x44989b[_0x1938('0xc0')][_0x1938('0x14b')]('X')<0x0){_0x44989b[_0x1938('0xc0')]+='X';}this[_0x1938('0xe')][_0x1938('0x85')](_0x1938('0x14c'),_0x23d701?_0x23d701[_0x1938('0x14d')]():'');var _0x79c9bf=this['channel'][_0x1938('0x5a')](_0x1938('0x14e'),[_0x23d701,_0x44989b[_0x1938('0xc0')],_0x44989b[_0x1938('0xc1')],_0x2b235,_0x44989b[_0x1938('0x8f')],_0x44989b[_0x1938('0x7')],_0x44989b['macro'],_0x44989b[_0x1938('0x14f')],'',_0x44989b[_0x1938('0x150')]]);if(_0x79c9bf[_0x1938('0x83')]===-0x1){return _0x79c9bf;}return this['channel'][_0x1938('0x95')](util['format']('Executed\x20command\x20%s\x20%s',_0x1938('0x14e'),_0x23d701));};AGIVertices[_0x1938('0x11')][_0x1938('0x151')]=function(_0x52d447){logger[_0x1938('0x30')](util['format'](_0x1938('0x152'),_0x52d447[_0x1938('0x89')]));var _0xa7210=_0x52d447['recordingFormat']||_0x1938('0x102');var _0x539dd5=util[_0x1938('0x2b')]('%s_%s',this[_0x1938('0xe')][_0x1938('0x3a')],rs[_0x1938('0xeb')](0x5));var _0x373d38=util[_0x1938('0x2b')](_0x1938('0x153'),FILES_PATH,_0x539dd5,_0xa7210);var _0x49fc28=util[_0x1938('0x2b')](_0x1938('0x123'),FILES_PATH,_0x539dd5);this[_0x1938('0x3c')][_0x1938('0x87')](this,_0x52d447,_0x539dd5,_0x373d38);this[_0x1938('0xe')][_0x1938('0x85')]('RECORDING_SAVENAME',_0x539dd5);logger['info'](_0x1938('0x154'),_0x49fc28,_0xa7210,_0x52d447[_0x1938('0x155')],_0x52d447[_0x1938('0x8f')]);return this[_0x1938('0xe')][_0x1938('0x10c')](_0x49fc28,_0xa7210,_0x52d447[_0x1938('0x155')],_0x52d447[_0x1938('0x8f')],undefined,!![]);};AGIVertices[_0x1938('0x11')][_0x1938('0x156')]=function(_0x197382){logger[_0x1938('0x30')](util['format'](_0x1938('0x157'),_0x197382[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x158')](_0x197382[_0x1938('0x159')][_0x1938('0x5b')](/\s+/g,''),_0x197382[_0x1938('0x155')]);};AGIVertices[_0x1938('0x11')]['saynumber']=function(_0x4feb17){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x15a'),_0x4feb17[_0x1938('0x89')]));return this[_0x1938('0xe')][_0x1938('0x15b')](_0x4feb17[_0x1938('0x15c')][_0x1938('0x5b')](/\s+/g,''),_0x4feb17[_0x1938('0x155')]);};AGIVertices[_0x1938('0x11')][_0x1938('0x15d')]=function(_0x1fb681){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x1fb681['label']));return this[_0x1938('0xe')][_0x1938('0x15e')](_0x1fb681[_0x1938('0x5d')],_0x1fb681[_0x1938('0x155')]);};AGIVertices['prototype'][_0x1938('0x15f')]=function(_0x5cad25){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x160'),_0x5cad25[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x5cad25[_0x1938('0x161')])){return this[_0x1938('0xe')]['noop'](_0x1938('0x162'));}var _0x4515f6=this[_0x1938('0x22')][_0x1938('0x87')](this,_0x5cad25[_0x1938('0x161')]);if(!_0x4515f6||!_0x4515f6[_0x1938('0x163')]){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x5cad25,_0x1938('0x164'));}var _0x3a021a={'from':util[_0x1938('0x2b')](_0x1938('0x165'),_0x4515f6['name'],_0x4515f6['email']||_0x4515f6['Smtp']['user']),'to':_0x5cad25['to']||'','cc':_0x5cad25['cc']||'','bcc':_0x5cad25['bcc']||'','subject':_0x5cad25[_0x1938('0x166')],'html':_0x5cad25['text'],'text':_0x5cad25[_0x1938('0x5d')]};var _0x42f7c3={'tls':{'rejectUnauthorized':![]}};if(_0x4515f6['Smtp'][_0x1938('0x167')]){_0x42f7c3[_0x1938('0x167')]=_0x4515f6[_0x1938('0x163')][_0x1938('0x167')];}else{_0x42f7c3['host']=_0x4515f6[_0x1938('0x163')][_0x1938('0x168')];_0x42f7c3[_0x1938('0x169')]=_0x4515f6['Smtp'][_0x1938('0x169')];_0x42f7c3[_0x1938('0x16a')]=_0x4515f6[_0x1938('0x163')][_0x1938('0x16a')];}if(_0x4515f6['Smtp']['authentication']){_0x42f7c3[_0x1938('0x16b')]={'user':_0x4515f6['Smtp'][_0x1938('0x16c')],'pass':_0x4515f6['Smtp'][_0x1938('0x16d')]};}if(this[_0x1938('0x69')](_0x5cad25['template_id'])){}logger[_0x1938('0x16e')](_0x1938('0x16f'),JSON[_0x1938('0xe8')](_0x3a021a));this[_0x1938('0x39')][_0x1938('0x87')](this,_0x5cad25,_0x5cad25['account_id']);this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x170'),_0x4515f6[_0x1938('0x16')]));this['sendMailMessage'][_0x1938('0x87')](this,_0x42f7c3,_0x3a021a);return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x171'));};AGIVertices[_0x1938('0x11')][_0x1938('0x172')]=function(_0x2bbe85){logger['info'](util[_0x1938('0x2b')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2bbe85['label']));return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x173'));};AGIVertices[_0x1938('0x11')][_0x1938('0x174')]=function(_0x443fa1){logger['info'](util[_0x1938('0x2b')](_0x1938('0x175'),_0x443fa1[_0x1938('0x89')]));if(!this['isConfigured'](_0x443fa1[_0x1938('0x176')])){return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x177'));}var _0x1449d1=this[_0x1938('0x178')][_0x1938('0x87')](this,_0x443fa1['sms_account_id']);if(!_0x1449d1){return this['channel']['error'](_0x443fa1,_0x1938('0x179'));}var _0x29e68a={'body':_0x443fa1[_0x1938('0x17a')],'phone':_0x443fa1['to']||'','SmsAccountId':_0x1449d1['id']};logger[_0x1938('0x16e')](_0x1938('0x17b'),JSON[_0x1938('0xe8')](_0x29e68a));this[_0x1938('0x39')]['sync'](this,_0x443fa1,_0x443fa1[_0x1938('0x176')]);this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x17c'),_0x1449d1[_0x1938('0x16')]));this[_0x1938('0x38')][_0x1938('0x87')](this,_0x29e68a);return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x17d'));};AGIVertices[_0x1938('0x11')]['set']=function(_0x3cde01){logger['info'](util[_0x1938('0x2b')](_0x1938('0x17e'),_0x3cde01[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x3cde01[_0x1938('0xb5')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x3cde01,_0x1938('0x17f'));}var _0x577ff5=this[_0x1938('0x12')][_0x1938('0x87')](this,_0x3cde01[_0x1938('0xb5')]);if(!_0x577ff5){return this['channel'][_0x1938('0x2e')](_0x3cde01,_0x1938('0xb7'));}return this[_0x1938('0xe')]['setVariable'](_0x577ff5,_0x3cde01[_0x1938('0x180')]);};AGIVertices['prototype'][_0x1938('0x181')]=function(_0x58e054){logger[_0x1938('0x30')](util['format'](_0x1938('0x182'),_0x58e054[_0x1938('0x89')]));this[_0x1938('0xe')]['noop'](_0x1938('0x183'));if(_0x58e054[_0x1938('0x8c')]===_0x1938('0x184')){this[_0x1938('0xe')][_0x1938('0x95')]('Answer');return this[_0x1938('0xe')]['answer']();}return this[_0x1938('0xe')][_0x1938('0x95')](_0x1938('0x185'));};AGIVertices[_0x1938('0x11')][_0x1938('0x186')]=function(_0x560a0f){logger['info'](util[_0x1938('0x2b')](_0x1938('0x187'),_0x560a0f[_0x1938('0x89')]));if(!this['isConfigured'](_0x560a0f[_0x1938('0x188')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x560a0f,_0x1938('0x189'));}var _0x570ee2=this[_0x1938('0x17')][_0x1938('0x87')](this,_0x560a0f[_0x1938('0x188')]);if(!this[_0x1938('0x69')](_0x570ee2)){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x560a0f,util['format'](_0x1938('0x18a'),_0x560a0f['project_id']));}if(_0x570ee2===this[_0x1938('0xe')][_0x1938('0x3b')]){return this[_0x1938('0xe')]['error'](_0x560a0f,_0x1938('0x18b'));}this[_0x1938('0x39')][_0x1938('0x87')](this,_0x560a0f,_0x570ee2);var _0x8cbd49=this[_0x1938('0xe')][_0x1938('0x5a')]('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x1938('0x7')][_0x1938('0x168')]||'127.0.0.1',_0x570ee2,this['channel'][_0x1938('0x3b')]));if(_0x8cbd49[_0x1938('0x83')]===-0x1){return _0x8cbd49;}return this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x146'),_0x1938('0x18c'),_0x570ee2));};AGIVertices[_0x1938('0x11')][_0x1938('0x18d')]=function(_0x3a9f49){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x18e'),_0x3a9f49[_0x1938('0x89')]));var _0x5160a7=this[_0x1938('0x18f')][_0x1938('0x87')](this,_0x3a9f49[_0x1938('0x8a')]);this[_0x1938('0x39')][_0x1938('0x87')](this,_0x3a9f49,_0x3a9f49[_0x1938('0x8a')]);if(this[_0x1938('0x69')](_0x3a9f49[_0x1938('0xb5')])){var _0xcd03e4=this[_0x1938('0x12')]['sync'](this,_0x3a9f49[_0x1938('0xb5')]);if(_0xcd03e4){this['channel']['setVariable'](_0xcd03e4,_0x5160a7);return this[_0x1938('0xe')][_0x1938('0x95')](util['format'](_0x1938('0x190'),_0x3a9f49[_0x1938('0x8a')],_0xcd03e4));}}return this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x191'),_0x3a9f49['command']));};AGIVertices['prototype']['tts']=function(_0x532909){logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x192'),_0x532909[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x532909[_0x1938('0x5d')])){return this[_0x1938('0xe')][_0x1938('0x95')]('no\x20text\x20configured');}this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x193'),_0x532909[_0x1938('0x5d')]));var _0x5c1275=this[_0x1938('0x5c')][_0x1938('0x87')](this,_0x532909);if(_0x5c1275){this['channel'][_0x1938('0x95')](util['format'](_0x1938('0x194'),_0x5c1275));var _0x2b5949=this[_0x1938('0xe')][_0x1938('0x12a')](_0x5c1275);try{fs[_0x1938('0xd4')](_0x5c1275+_0x1938('0xd5'));}catch(_0x9b40d1){logger[_0x1938('0x2e')](_0x9b40d1);}return _0x2b5949;}return this[_0x1938('0xe')][_0x1938('0x2e')](_0x532909,_0x1938('0x195'));};AGIVertices[_0x1938('0x11')][_0x1938('0x196')]=function(_0x27f2f0){logger['info'](util[_0x1938('0x2b')](_0x1938('0x197'),_0x27f2f0[_0x1938('0x89')]));if(!this[_0x1938('0x69')](_0x27f2f0[_0x1938('0x12d')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x27f2f0,'no\x20find\x20by\x20configured');}logger['info'](util[_0x1938('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x27f2f0[_0x1938('0x12d')]));var _0x2c5025=this[_0x1938('0x54')][_0x1938('0x87')](this,_0x27f2f0[_0x1938('0x12d')]);if(_0x2c5025){logger[_0x1938('0x30')](util['format'](_0x1938('0x12e'),this[_0x1938('0xe')][_0x1938('0x53')],_0x27f2f0[_0x1938('0x12d')]));this[_0x1938('0xe')][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x12e'),this[_0x1938('0xe')][_0x1938('0x53')],_0x27f2f0[_0x1938('0x12d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1938('0x30')](util[_0x1938('0x2b')](_0x1938('0x130'),this[_0x1938('0xe')][_0x1938('0x53')],_0x27f2f0[_0x1938('0x12d')]));this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1938('0xe')][_0x1938('0x53')],_0x27f2f0['findBy']));return{'code':0xc8,'result':_0x1938('0x143')};}};AGIVertices[_0x1938('0x11')][_0x1938('0x198')]=function(_0x134505){logger[_0x1938('0x30')](util[_0x1938('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x134505['label']));var _0x19acd6=this['channel']['exec']('VOICEMAIL',[_0x134505[_0x1938('0x199')],_0x134505[_0x1938('0x99')]]);if(_0x19acd6['result']===-0x1){return _0x19acd6;}return this['channel'][_0x1938('0x95')](util[_0x1938('0x2b')](_0x1938('0x146'),_0x1938('0x19a'),_0x134505[_0x1938('0x199')]));};AGIVertices[_0x1938('0x11')]['vswitch']=function(_0x566e9b){logger[_0x1938('0x30')](util['format'](_0x1938('0x19b'),_0x566e9b['label']));if(!this[_0x1938('0x69')](_0x566e9b[_0x1938('0xb5')])){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x566e9b,_0x1938('0x17f'));}var _0x219dd6=this[_0x1938('0x12')][_0x1938('0x87')](this,_0x566e9b[_0x1938('0xb5')]);if(!_0x219dd6){return this[_0x1938('0xe')][_0x1938('0x2e')](_0x566e9b,_0x1938('0xb7'));}var _0x2f8dd3=this['channel'][_0x1938('0x12')](_0x219dd6);return{'code':0xc8,'result':_0x2f8dd3[_0x1938('0x81')]?_0x2f8dd3[_0x1938('0x81')]:'-'};};String[_0x1938('0x11')][_0x1938('0x80')]=function(_0x2ac538,_0x13b5a9){return this[_0x1938('0x7e')](_0x2ac538)[_0x1938('0x19c')](_0x13b5a9);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3c40823..68b63ca 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 _0xa41a=['[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','attended','destlinkedid','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer'];(function(_0x36d8f8,_0x2b1fcf){var _0x172ffd=function(_0xc52cc0){while(--_0xc52cc0){_0x36d8f8['push'](_0x36d8f8['shift']());}};_0x172ffd(++_0x2b1fcf);}(_0xa41a,0x6b));var _0xaa41=function(_0x31c5b5,_0x40375e){_0x31c5b5=_0x31c5b5-0x0;var _0x3ace11=_0xa41a[_0x31c5b5];return _0x3ace11;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var moment=require('moment');var ami=require(_0xaa41('0x2'));var logger=require(_0xaa41('0x3'))(_0xaa41('0x4'));var RpcUser=require(_0xaa41('0x5'));var RpcVoiceAgentReport=require(_0xaa41('0x6'));function Acw(_0x3168be){this[_0xaa41('0x7')]=_0x3168be[_0xaa41('0x7')];this['agents']=_0x3168be[_0xaa41('0x8')];this[_0xaa41('0x9')]=_0x3168be['timers'];this['channels']={};ami['on'](_0xaa41('0xa'),this[_0xaa41('0xb')]['bind'](this));ami['on'](_0xaa41('0xc'),this[_0xaa41('0xd')][_0xaa41('0xe')](this));ami['on'](_0xaa41('0xf'),this[_0xaa41('0x10')][_0xaa41('0xe')](this));ami['on'](_0xaa41('0x11'),this[_0xaa41('0x12')][_0xaa41('0xe')](this));ami['on']('attendedtransfer',this[_0xaa41('0x13')][_0xaa41('0xe')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xaa41('0xe')](this));ami['on']('custom:agentConnectPreview',this[_0xaa41('0x14')][_0xaa41('0xe')](this));}function getDiff(_0x2f64bc){var _0x889d44=moment()[_0xaa41('0x15')](0x0);var _0x4eaf81=moment(_0x2f64bc)[_0xaa41('0x15')](0x0);return _0x889d44[_0xaa41('0x16')](_0x4eaf81,_0xaa41('0x17'));}Acw[_0xaa41('0x18')][_0xaa41('0x19')]=function(_0x2005ae){try{var _0x1e1e02=this;var _0x550ad5=this[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x1b')];var _0x4210fa=this[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x1c')];var _0xd20ddf=this[_0xaa41('0x7')][_0x4210fa];var _0x46e6d3=![];var _0x150ddf='ACW';if(_0xd20ddf['mandatoryDisposition']){if(_0xd20ddf[_0xaa41('0x1d')][_0xaa41('0x1e')]){_0x46e6d3=!![];_0x150ddf=_0xd20ddf[_0xaa41('0x1d')]['name'];}}ami[_0xaa41('0x1f')]({'action':_0xaa41('0x20'),'interface':_0x550ad5,'paused':!![],'reason':_0x150ddf})['then'](function(_0x513c61){if(_0x1e1e02[_0xaa41('0x8')][_0x550ad5]){return RpcUser['getAgent'](_0x1e1e02[_0xaa41('0x8')][_0x550ad5]['id'])[_0xaa41('0x21')](function(_0x3e2175){if(_0x3e2175&&!_0x3e2175[_0xaa41('0x22')]){logger[_0xaa41('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x550ad5,_0x4210fa);var _0x43c430=_0x1e1e02[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x24')]&&_0x1e1e02[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x25')]?_0x1e1e02[_0xaa41('0x1a')][_0x2005ae]['destlinkedid']:_0x2005ae;return RpcUser['savePause'](_0x1e1e02[_0xaa41('0x8')][_0x550ad5],_0x150ddf,_0x43c430)['then'](function(_0x493a10){if(!_0x46e6d3){_0x1e1e02[_0xaa41('0x9')][_0x550ad5]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x1e1e02[_0xaa41('0x7')][_0x4210fa][_0xaa41('0x26')],_0x550ad5,_0x4210fa);_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x27')]=setTimeout(_0x1e1e02[_0xaa41('0x28')][_0xaa41('0xe')](_0x1e1e02,_0x550ad5),_0x1e1e02['voiceQueues'][_0x4210fa][_0xaa41('0x26')]*0x3e8);_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x29')]=moment()[_0xaa41('0x2a')](_0xaa41('0x2b'));_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x2c')]=_0x2005ae;_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['queue']=_0x4210fa;_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['updateAcw']=function(){var _0x5dad80=getDiff(_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x29')]);clearTimeout(_0x1e1e02['timers'][_0x550ad5][_0xaa41('0x27')]);_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x5dad80},_0x1e1e02['timers'][_0x550ad5][_0xaa41('0x2c')],_0x550ad5)[_0xaa41('0x21')](function(_0x2a186e){logger[_0xaa41('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x2005ae,_0x5dad80,_0x2a186e);})[_0xaa41('0x2d')](function(_0x45c8fe){logger[_0xaa41('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x2005ae,_0x45c8fe);});delete _0x1e1e02[_0xaa41('0x9')][_0x550ad5];};}});}else{logger[_0xaa41('0x23')](_0xaa41('0x2f'),_0x2005ae,_0x550ad5,_0x4210fa);}});}})['catch'](function(_0x252c62){logger[_0xaa41('0x2e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x1e1e02[_0xaa41('0x7')][_0x4210fa][_0xaa41('0x26')],_0x550ad5,_0x4210fa);})[_0xaa41('0x30')](function(){delete _0x1e1e02['channels'][_0x2005ae];});}catch(_0x22b272){logger['error'](_0xaa41('0x31'),_0x22b272[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')]['stopAcw']=function(_0x526377){try{var _0x4cdd42=this;if(_0x4cdd42[_0xaa41('0x9')][_0x526377]){_0x4cdd42[_0xaa41('0x9')][_0x526377][_0xaa41('0x27')]=![];var _0x224eb3=_0x4cdd42['timers'][_0x526377]['uniqueid'];var _0x267999=_0x4cdd42[_0xaa41('0x9')][_0x526377][_0xaa41('0x1c')];var _0x4e8d2e=_0x4cdd42[_0xaa41('0x7')][_0x267999][_0xaa41('0x26')];logger[_0xaa41('0x23')]('[TIMER][STOP][AGENT:%s]',_0x526377);RpcUser[_0xaa41('0x33')](this[_0xaa41('0x8')][_0x526377]);RpcVoiceAgentReport[_0xaa41('0x34')]({'acwtime':_0x4e8d2e,'agentacw':!![]},_0x224eb3,_0x526377)[_0xaa41('0x21')](function(_0x57f1bf){logger['info'](_0xaa41('0x35'),_0x224eb3,_0x4e8d2e,_0x57f1bf);})[_0xaa41('0x2d')](function(_0x5eae08){logger[_0xaa41('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x224eb3,_0x5eae08);});}else{logger[_0xaa41('0x2e')](_0xaa41('0x36'),_0x526377);if(_0x4cdd42[_0xaa41('0x9')]){logger[_0xaa41('0x23')](_0xaa41('0x37'),JSON[_0xaa41('0x38')](_0x4cdd42[_0xaa41('0x9')]));}}}catch(_0x21f204){logger['error'](_0xaa41('0x39'),_0x21f204[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0xb')]=function(_0xc84fb8){try{if(this[_0xaa41('0x7')][_0xc84fb8['queue']]&&(this['voiceQueues'][_0xc84fb8[_0xaa41('0x1c')]]['acw']||this[_0xaa41('0x7')][_0xc84fb8[_0xaa41('0x1c')]][_0xaa41('0x3a')])){if(this[_0xaa41('0x8')][_0xc84fb8[_0xaa41('0x1b')]]){this[_0xaa41('0x1a')][_0xc84fb8[_0xaa41('0x2c')]]={'queue':_0xc84fb8['queue'],'interface':_0xc84fb8[_0xaa41('0x1b')],'destlinkedid':_0xc84fb8['destlinkedid']};}}}catch(_0x4dd842){logger[_0xaa41('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x4dd842['message']);}};Acw['prototype'][_0xaa41('0x14')]=function(_0x525b09){try{if(this[_0xaa41('0x7')][_0x525b09[_0xaa41('0x1c')]]&&(this['voiceQueues'][_0x525b09['queue']][_0xaa41('0x4')]||this[_0xaa41('0x7')][_0x525b09[_0xaa41('0x1c')]][_0xaa41('0x3a')])){if(this[_0xaa41('0x8')][_0x525b09[_0xaa41('0x1b')]]){this[_0xaa41('0x1a')][_0x525b09[_0xaa41('0x2c')]]={'queue':_0x525b09[_0xaa41('0x1c')],'interface':_0x525b09['interface']};}}}catch(_0x2eec35){logger[_0xaa41('0x2e')](_0xaa41('0x3b'),_0x2eec35[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0xd')]=function(_0x538b12){try{if(this[_0xaa41('0x1a')][_0x538b12[_0xaa41('0x2c')]]&&_[_0xaa41('0x3c')](this[_0xaa41('0x1a')][_0x538b12['uniqueid']][_0xaa41('0x24')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x538b12[_0xaa41('0x2c')]);this[_0xaa41('0x19')](_0x538b12[_0xaa41('0x2c')]);}else if(this['channels'][_0x538b12[_0xaa41('0x3d')]]&&_[_0xaa41('0x3c')](this[_0xaa41('0x1a')][_0x538b12['linkedid']][_0xaa41('0x24')])){logger[_0xaa41('0x23')](_0xaa41('0x3e'),_0x538b12[_0xaa41('0x3d')]);this[_0xaa41('0x19')](_0x538b12[_0xaa41('0x3d')]);}}catch(_0x333a9f){logger[_0xaa41('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x333a9f[_0xaa41('0x32')]);}};Acw['prototype']['syncHangup']=function(_0x1bdcd6){try{if(this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x2c')]]&&this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x2c')]][_0xaa41('0x24')]){logger[_0xaa41('0x23')](_0xaa41('0x3f'),_0x1bdcd6['uniqueid']);this[_0xaa41('0x19')](_0x1bdcd6[_0xaa41('0x2c')]);}else if(this[_0xaa41('0x1a')][_0x1bdcd6['linkedid']]&&this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x3d')]]['attended']){logger[_0xaa41('0x23')](_0xaa41('0x40'),_0x1bdcd6[_0xaa41('0x3d')]);this['startAcw'](_0x1bdcd6[_0xaa41('0x3d')]);}}catch(_0xc8e626){logger['error']('[ACW][syncHangup]\x20%s',_0xc8e626[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0x13')]=function(_0x4d20c6){try{if(!_[_0xaa41('0x41')](this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x42')]])){this[_0xaa41('0x19')](_0x4d20c6[_0xaa41('0x42')]);if(this['channels'][_0x4d20c6[_0xaa41('0x43')]]){this['channels'][_0x4d20c6['secondtransfereruniqueid']][_0xaa41('0x24')]=!![];this['channels'][_0x4d20c6[_0xaa41('0x44')]]=this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x43')]];delete this['channels'][_0x4d20c6[_0xaa41('0x43')]];}}else if(!_[_0xaa41('0x41')](this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x44')]])){this[_0xaa41('0x19')](_0x4d20c6[_0xaa41('0x44')]);if(this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x45')]]){this[_0xaa41('0x1a')][_0x4d20c6['origtransfereruniqueid']][_0xaa41('0x24')]=!![];this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x42')]]=this['channels'][_0x4d20c6[_0xaa41('0x45')]];delete this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x45')]];}}}catch(_0x134579){logger[_0xaa41('0x2e')](_0xaa41('0x46'),_0x134579[_0xaa41('0x32')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x5cb34d){try{if(this['channels'][_0x5cb34d['transfereruniqueid']]){logger['info'](_0xaa41('0x47'),JSON['stringify'](_0x5cb34d['transfereruniqueid']));this[_0xaa41('0x19')](_0x5cb34d[_0xaa41('0x48')]);}else if(this[_0xaa41('0x1a')][_0x5cb34d[_0xaa41('0x49')]]){logger['info'](_0xaa41('0x4a'),JSON[_0xaa41('0x38')](_0x5cb34d[_0xaa41('0x49')]));this[_0xaa41('0x19')](_0x5cb34d[_0xaa41('0x49')]);}}catch(_0x41ca40){logger[_0xaa41('0x2e')](_0xaa41('0x4b'),_0x41ca40[_0xaa41('0x32')]);}};Acw['prototype'][_0xaa41('0x12')]=function(_0x2d2af8){try{if(this['voiceQueues'][_0x2d2af8['queue']]&&this['voiceQueues'][_0x2d2af8[_0xaa41('0x1c')]]['autopause']===_0xaa41('0x4c')){if(this['agents'][_0x2d2af8[_0xaa41('0x1b')]]){logger[_0xaa41('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2d2af8[_0xaa41('0x2c')],_0x2d2af8[_0xaa41('0x1b')],_0x2d2af8[_0xaa41('0x1c')]);return RpcUser[_0xaa41('0x4d')](this['agents'][_0x2d2af8['interface']],_0xaa41('0x4e'),_0x2d2af8[_0xaa41('0x2c')]);}}}catch(_0x4d6d0c){logger['error'](_0xaa41('0x4f'),_0x4d6d0c[_0xaa41('0x32')]);}};module[_0xaa41('0x50')]=Acw; \ No newline at end of file +var _0xac31=['isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','startAcw','interface','ACW','mandatoryDispositionPause','name','then','getAgent','voicePause','info','destlinkedid','savePause','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s'];(function(_0x5d5e3b,_0xc516c3){var _0x4d559d=function(_0x3a25ed){while(--_0x3a25ed){_0x5d5e3b['push'](_0x5d5e3b['shift']());}};_0x4d559d(++_0xc516c3);}(_0xac31,0xca));var _0x1ac3=function(_0x29cc8a,_0x48dc6a){_0x29cc8a=_0x29cc8a-0x0;var _0x52246a=_0xac31[_0x29cc8a];return _0x52246a;};'use strict';var util=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var ami=require(_0x1ac3('0x3'));var logger=require(_0x1ac3('0x4'))(_0x1ac3('0x5'));var RpcUser=require(_0x1ac3('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x33b5ab){this[_0x1ac3('0x7')]=_0x33b5ab['voiceQueues'];this['agents']=_0x33b5ab[_0x1ac3('0x8')];this[_0x1ac3('0x9')]=_0x33b5ab[_0x1ac3('0x9')];this[_0x1ac3('0xa')]={};ami['on'](_0x1ac3('0xb'),this['syncAgentConnect'][_0x1ac3('0xc')](this));ami['on']('hanguprequest',this[_0x1ac3('0xd')][_0x1ac3('0xc')](this));ami['on'](_0x1ac3('0xe'),this['syncHangup'][_0x1ac3('0xc')](this));ami['on'](_0x1ac3('0xf'),this[_0x1ac3('0x10')][_0x1ac3('0xc')](this));ami['on'](_0x1ac3('0x11'),this[_0x1ac3('0x12')]['bind'](this));ami['on'](_0x1ac3('0x13'),this[_0x1ac3('0x14')][_0x1ac3('0xc')](this));ami['on'](_0x1ac3('0x15'),this['syncAgentConnectPreview'][_0x1ac3('0xc')](this));}function getDiff(_0x37d426){var _0x46c0e9=moment()[_0x1ac3('0x16')](0x0);var _0x53cc35=moment(_0x37d426)[_0x1ac3('0x16')](0x0);return _0x46c0e9[_0x1ac3('0x17')](_0x53cc35,'seconds');}Acw[_0x1ac3('0x18')][_0x1ac3('0x19')]=function(_0x38b52a){try{var _0x51f1e4=this;var _0x2f14ca=this[_0x1ac3('0xa')][_0x38b52a][_0x1ac3('0x1a')];var _0x541744=this[_0x1ac3('0xa')][_0x38b52a]['queue'];var _0x291616=this[_0x1ac3('0x7')][_0x541744];var _0x20091d=![];var _0x3b7e51=_0x1ac3('0x1b');if(_0x291616['mandatoryDisposition']){if(_0x291616[_0x1ac3('0x1c')][_0x1ac3('0x1d')]){_0x20091d=!![];_0x3b7e51=_0x291616[_0x1ac3('0x1c')][_0x1ac3('0x1d')];}}ami['Action']({'action':'QueuePause','interface':_0x2f14ca,'paused':!![],'reason':_0x3b7e51})[_0x1ac3('0x1e')](function(_0x3a32c7){if(_0x51f1e4[_0x1ac3('0x8')][_0x2f14ca]){return RpcUser[_0x1ac3('0x1f')](_0x51f1e4[_0x1ac3('0x8')][_0x2f14ca]['id'])[_0x1ac3('0x1e')](function(_0x23b767){if(_0x23b767&&!_0x23b767[_0x1ac3('0x20')]){logger[_0x1ac3('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x38b52a,_0x2f14ca,_0x541744);var _0x1e277f=_0x51f1e4[_0x1ac3('0xa')][_0x38b52a]['attended']&&_0x51f1e4[_0x1ac3('0xa')][_0x38b52a][_0x1ac3('0x22')]?_0x51f1e4['channels'][_0x38b52a][_0x1ac3('0x22')]:_0x38b52a;return RpcUser[_0x1ac3('0x23')](_0x51f1e4[_0x1ac3('0x8')][_0x2f14ca],_0x3b7e51,_0x1e277f)[_0x1ac3('0x1e')](function(_0x10db3d){if(!_0x20091d){_0x51f1e4['timers'][_0x2f14ca]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x38b52a,_0x51f1e4['voiceQueues'][_0x541744]['acwTimeout'],_0x2f14ca,_0x541744);_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca]['timer']=setTimeout(_0x51f1e4[_0x1ac3('0x24')][_0x1ac3('0xc')](_0x51f1e4,_0x2f14ca),_0x51f1e4[_0x1ac3('0x7')][_0x541744][_0x1ac3('0x25')]*0x3e8);_0x51f1e4['timers'][_0x2f14ca][_0x1ac3('0x26')]=moment()['format'](_0x1ac3('0x27'));_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x28')]=_0x38b52a;_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x29')]=_0x541744;_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x2a')]=function(){var _0x5351b2=getDiff(_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x26')]);clearTimeout(_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x2b')]);_0x51f1e4['timers'][_0x2f14ca][_0x1ac3('0x2b')]=![];RpcVoiceAgentReport[_0x1ac3('0x2c')]({'acwtime':_0x5351b2},_0x51f1e4[_0x1ac3('0x9')][_0x2f14ca][_0x1ac3('0x28')],_0x2f14ca)[_0x1ac3('0x1e')](function(_0x479b42){logger[_0x1ac3('0x21')](_0x1ac3('0x2d'),_0x38b52a,_0x5351b2,_0x479b42);})[_0x1ac3('0x2e')](function(_0x156ccd){logger[_0x1ac3('0x2f')](_0x1ac3('0x30'),_0x38b52a,_0x156ccd);});delete _0x51f1e4['timers'][_0x2f14ca];};}});}else{logger[_0x1ac3('0x21')](_0x1ac3('0x31'),_0x38b52a,_0x2f14ca,_0x541744);}});}})[_0x1ac3('0x2e')](function(_0xf6d79e){logger['error'](_0x1ac3('0x32'),_0x38b52a,_0x51f1e4[_0x1ac3('0x7')][_0x541744][_0x1ac3('0x25')],_0x2f14ca,_0x541744);})[_0x1ac3('0x33')](function(){delete _0x51f1e4[_0x1ac3('0xa')][_0x38b52a];});}catch(_0x170bb8){logger[_0x1ac3('0x2f')](_0x1ac3('0x34'),_0x170bb8[_0x1ac3('0x35')]);}};Acw['prototype'][_0x1ac3('0x24')]=function(_0x27b017){try{var _0x4e4a20=this;if(_0x4e4a20[_0x1ac3('0x9')][_0x27b017]){_0x4e4a20[_0x1ac3('0x9')][_0x27b017][_0x1ac3('0x2b')]=![];var _0x448fb5=_0x4e4a20[_0x1ac3('0x9')][_0x27b017][_0x1ac3('0x28')];var _0x1c8bf5=_0x4e4a20[_0x1ac3('0x9')][_0x27b017]['queue'];var _0x17fc8a=_0x4e4a20['voiceQueues'][_0x1c8bf5][_0x1ac3('0x25')];logger[_0x1ac3('0x21')](_0x1ac3('0x36'),_0x27b017);RpcUser[_0x1ac3('0x37')](this[_0x1ac3('0x8')][_0x27b017]);RpcVoiceAgentReport[_0x1ac3('0x2c')]({'acwtime':_0x17fc8a,'agentacw':!![]},_0x448fb5,_0x27b017)['then'](function(_0x3b5c1c){logger[_0x1ac3('0x21')](_0x1ac3('0x2d'),_0x448fb5,_0x17fc8a,_0x3b5c1c);})['catch'](function(_0x34380d){logger[_0x1ac3('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x448fb5,_0x34380d);});}else{logger[_0x1ac3('0x2f')](_0x1ac3('0x38'),_0x27b017);if(_0x4e4a20[_0x1ac3('0x9')]){logger[_0x1ac3('0x21')](_0x1ac3('0x39'),JSON[_0x1ac3('0x3a')](_0x4e4a20[_0x1ac3('0x9')]));}}}catch(_0x27d529){logger['error'](_0x1ac3('0x3b'),_0x27d529[_0x1ac3('0x35')]);}};Acw[_0x1ac3('0x18')][_0x1ac3('0x3c')]=function(_0x9fa503){try{if(this[_0x1ac3('0x7')][_0x9fa503[_0x1ac3('0x29')]]&&(this['voiceQueues'][_0x9fa503['queue']][_0x1ac3('0x5')]||this[_0x1ac3('0x7')][_0x9fa503['queue']][_0x1ac3('0x3d')])){if(this[_0x1ac3('0x8')][_0x9fa503['interface']]){this[_0x1ac3('0xa')][_0x9fa503['uniqueid']]={'queue':_0x9fa503[_0x1ac3('0x29')],'interface':_0x9fa503[_0x1ac3('0x1a')],'destlinkedid':_0x9fa503[_0x1ac3('0x22')]};}}}catch(_0xac1946){logger['error'](_0x1ac3('0x3e'),_0xac1946[_0x1ac3('0x35')]);}};Acw[_0x1ac3('0x18')][_0x1ac3('0x3f')]=function(_0x1b124a){try{if(this['voiceQueues'][_0x1b124a[_0x1ac3('0x29')]]&&(this[_0x1ac3('0x7')][_0x1b124a[_0x1ac3('0x29')]][_0x1ac3('0x5')]||this['voiceQueues'][_0x1b124a[_0x1ac3('0x29')]][_0x1ac3('0x3d')])){if(this[_0x1ac3('0x8')][_0x1b124a[_0x1ac3('0x1a')]]){this['channels'][_0x1b124a[_0x1ac3('0x28')]]={'queue':_0x1b124a[_0x1ac3('0x29')],'interface':_0x1b124a[_0x1ac3('0x1a')]};}}}catch(_0x522146){logger['error'](_0x1ac3('0x40'),_0x522146['message']);}};Acw[_0x1ac3('0x18')][_0x1ac3('0xd')]=function(_0x2e3347){try{if(this[_0x1ac3('0xa')][_0x2e3347[_0x1ac3('0x28')]]&&_[_0x1ac3('0x41')](this[_0x1ac3('0xa')][_0x2e3347['uniqueid']]['attended'])){logger[_0x1ac3('0x21')](_0x1ac3('0x42'),_0x2e3347[_0x1ac3('0x28')]);this['startAcw'](_0x2e3347['uniqueid']);}else if(this['channels'][_0x2e3347[_0x1ac3('0x43')]]&&_[_0x1ac3('0x41')](this['channels'][_0x2e3347[_0x1ac3('0x43')]][_0x1ac3('0x44')])){logger[_0x1ac3('0x21')](_0x1ac3('0x45'),_0x2e3347['linkedid']);this['startAcw'](_0x2e3347[_0x1ac3('0x43')]);}}catch(_0x4749da){logger['error'](_0x1ac3('0x46'),_0x4749da['message']);}};Acw['prototype'][_0x1ac3('0x47')]=function(_0x220dd0){try{if(this['channels'][_0x220dd0[_0x1ac3('0x28')]]&&this['channels'][_0x220dd0[_0x1ac3('0x28')]][_0x1ac3('0x44')]){logger[_0x1ac3('0x21')](_0x1ac3('0x48'),_0x220dd0[_0x1ac3('0x28')]);this[_0x1ac3('0x19')](_0x220dd0[_0x1ac3('0x28')]);}else if(this[_0x1ac3('0xa')][_0x220dd0[_0x1ac3('0x43')]]&&this[_0x1ac3('0xa')][_0x220dd0[_0x1ac3('0x43')]]['attended']){logger['info'](_0x1ac3('0x49'),_0x220dd0[_0x1ac3('0x43')]);this[_0x1ac3('0x19')](_0x220dd0[_0x1ac3('0x43')]);}}catch(_0x2dd5fa){logger[_0x1ac3('0x2f')](_0x1ac3('0x4a'),_0x2dd5fa[_0x1ac3('0x35')]);}};Acw[_0x1ac3('0x18')][_0x1ac3('0x12')]=function(_0x541bba){try{if(!_[_0x1ac3('0x4b')](this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4c')]])){this[_0x1ac3('0x19')](_0x541bba[_0x1ac3('0x4c')]);if(this['channels'][_0x541bba[_0x1ac3('0x4d')]]){this[_0x1ac3('0xa')][_0x541bba['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x541bba[_0x1ac3('0x4e')]]=this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4d')]];delete this['channels'][_0x541bba[_0x1ac3('0x4d')]];}}else if(!_['isNil'](this['channels'][_0x541bba['transfertargetuniqueid']])){this['startAcw'](_0x541bba[_0x1ac3('0x4e')]);if(this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4f')]]){this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4f')]]['attended']=!![];this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4c')]]=this['channels'][_0x541bba[_0x1ac3('0x4f')]];delete this[_0x1ac3('0xa')][_0x541bba[_0x1ac3('0x4f')]];}}}catch(_0x2e79b2){logger[_0x1ac3('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x2e79b2[_0x1ac3('0x35')]);}};Acw[_0x1ac3('0x18')][_0x1ac3('0x14')]=function(_0x2bbd51){try{if(this['channels'][_0x2bbd51[_0x1ac3('0x50')]]){logger[_0x1ac3('0x21')](_0x1ac3('0x51'),JSON[_0x1ac3('0x3a')](_0x2bbd51[_0x1ac3('0x50')]));this[_0x1ac3('0x19')](_0x2bbd51['transfereruniqueid']);}else if(this['channels'][_0x2bbd51['transfererlinkedid']]){logger['info'](_0x1ac3('0x52'),JSON['stringify'](_0x2bbd51[_0x1ac3('0x53')]));this[_0x1ac3('0x19')](_0x2bbd51[_0x1ac3('0x53')]);}}catch(_0x20fa43){logger[_0x1ac3('0x2f')](_0x1ac3('0x54'),_0x20fa43['message']);}};Acw[_0x1ac3('0x18')][_0x1ac3('0x10')]=function(_0x3597cb){try{if(this[_0x1ac3('0x7')][_0x3597cb['queue']]&&this[_0x1ac3('0x7')][_0x3597cb[_0x1ac3('0x29')]][_0x1ac3('0x55')]===_0x1ac3('0x56')){if(this[_0x1ac3('0x8')][_0x3597cb['interface']]){logger[_0x1ac3('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3597cb['uniqueid'],_0x3597cb[_0x1ac3('0x1a')],_0x3597cb[_0x1ac3('0x29')]);return RpcUser[_0x1ac3('0x23')](this[_0x1ac3('0x8')][_0x3597cb[_0x1ac3('0x1a')]],_0x1ac3('0x57'),_0x3597cb[_0x1ac3('0x28')]);}}}catch(_0xdda21a){logger[_0x1ac3('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0xdda21a[_0x1ac3('0x35')]);}};module[_0x1ac3('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2e2dfad..b0e6f94 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 _0xb245=['bluebird','moment','util','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','port','inspect','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionQueueSummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','then','actionCoreShowChannels','log','error','asterisk-manager'];(function(_0x2efd05,_0x261ee8){var _0x5a9e3f=function(_0x126577){while(--_0x126577){_0x2efd05['push'](_0x2efd05['shift']());}};_0x5a9e3f(++_0x261ee8);}(_0xb245,0xae));var _0x5b24=function(_0x1fd463,_0x1c95a3){_0x1fd463=_0x1fd463-0x0;var _0x391ec6=_0xb245[_0x1fd463];return _0x391ec6;};'use strict';var Manager=require(_0x5b24('0x0'));var BPromise=require(_0x5b24('0x1'));var moment=require(_0x5b24('0x2'));var util=require(_0x5b24('0x3'));var _=require('lodash');var logger=require(_0x5b24('0x4'))(_0x5b24('0x5'));var config=require(_0x5b24('0x6'));var ami=new Manager(config['asterisk']['port'],config[_0x5b24('0x7')]['ip'],config[_0x5b24('0x7')]['username'],config['asterisk'][_0x5b24('0x8')],!![]);ami[_0x5b24('0x9')]();ami[_0x5b24('0xa')]=BPromise[_0x5b24('0xb')](ami[_0x5b24('0xc')]);function error(_0x5cc2d0){logger['error'](util[_0x5b24('0xd')](_0x5b24('0xe'),config[_0x5b24('0x7')][_0x5b24('0xf')],config[_0x5b24('0x7')]['ip'],config[_0x5b24('0x7')][_0x5b24('0x10')],util[_0x5b24('0x11')](_0x5cc2d0,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x5b24('0x7')][_0x5b24('0xf')],config[_0x5b24('0x7')]['ip'],config['asterisk'][_0x5b24('0x10')]));}ami[_0x5b24('0x12')]=function(){return function(){return ami[_0x5b24('0xa')]({'action':'sipshowregistry'});};};ami[_0x5b24('0x13')]=function(){return function(){return ami['Action']({'action':_0x5b24('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x5b24('0xa')]({'action':'sippeerstatus'});};};ami[_0x5b24('0x15')]=function(){return function(){return ami[_0x5b24('0xa')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x5b24('0xa')]({'action':_0x5b24('0x16')});};};function connect(_0x42d1bf){logger['info'](util['format'](_0x5b24('0x17'),config['asterisk'][_0x5b24('0xf')],config['asterisk']['ip'],config[_0x5b24('0x7')]['port']));ami[_0x5b24('0x18')]('error',error);ami[_0x5b24('0x18')](_0x5b24('0x19'),close);}ami['on'](_0x5b24('0x1a'),connect);ami['on'](_0x5b24('0x1b'),function(_0x28b77a){logger[_0x5b24('0x1c')](util[_0x5b24('0xd')](_0x5b24('0x1d'),config[_0x5b24('0x7')]['username'],config['asterisk']['ip'],config['asterisk']['port'],util[_0x5b24('0x11')](_0x28b77a,![],null)));});ami['on']('fullybooted',function(_0x85cfd0){logger[_0x5b24('0x1c')](util[_0x5b24('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x5b24('0x7')]['username'],config[_0x5b24('0x7')]['ip'],config[_0x5b24('0x7')]['port']));return BPromise[_0x5b24('0x1e')]()['then'](ami[_0x5b24('0x12')]())[_0x5b24('0x1f')](ami[_0x5b24('0x13')]())[_0x5b24('0x1f')](ami['actionSipPeerStatus']())[_0x5b24('0x1f')](ami[_0x5b24('0x15')]())[_0x5b24('0x1f')](ami[_0x5b24('0x20')]())['catch'](function(_0x4a2b57){console[_0x5b24('0x21')](_0x4a2b57);});});ami['once'](_0x5b24('0x22'),error);ami[_0x5b24('0x18')]('close',close);module['exports']=ami; \ No newline at end of file +var _0xf9f7=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','queuesummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionSipPeerStatus','actionQueueSummary','catch','log','exports','bluebird','lodash','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','format','inspect'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xf9f7,0x112));var _0x7f9f=function(_0xb74c89,_0x246040){_0xb74c89=_0xb74c89-0x0;var _0xe4ccef=_0xf9f7[_0xb74c89];return _0xe4ccef;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x7f9f('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x7f9f('0x1'));var logger=require('../../config/logger')(_0x7f9f('0x2'));var config=require(_0x7f9f('0x3'));var ami=new Manager(config[_0x7f9f('0x4')][_0x7f9f('0x5')],config[_0x7f9f('0x4')]['ip'],config[_0x7f9f('0x4')]['username'],config['asterisk'][_0x7f9f('0x6')],!![]);ami[_0x7f9f('0x7')]();ami[_0x7f9f('0x8')]=BPromise[_0x7f9f('0x9')](ami[_0x7f9f('0xa')]);function error(_0x2b6db2){logger[_0x7f9f('0xb')](util[_0x7f9f('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7f9f('0x4')]['username'],config[_0x7f9f('0x4')]['ip'],config[_0x7f9f('0x4')][_0x7f9f('0x5')],util[_0x7f9f('0xd')](_0x2b6db2,![],null)));}function close(){logger[_0x7f9f('0xb')](util['format'](_0x7f9f('0xe'),config[_0x7f9f('0x4')][_0x7f9f('0xf')],config[_0x7f9f('0x4')]['ip'],config[_0x7f9f('0x4')][_0x7f9f('0x5')]));}ami[_0x7f9f('0x10')]=function(){return function(){return ami[_0x7f9f('0x8')]({'action':_0x7f9f('0x11')});};};ami[_0x7f9f('0x12')]=function(){return function(){return ami[_0x7f9f('0x8')]({'action':_0x7f9f('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x7f9f('0x8')]({'action':_0x7f9f('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x7f9f('0x8')]({'action':_0x7f9f('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x7f9f('0x8')]({'action':'coreshowchannels'});};};function connect(_0x297d98){logger[_0x7f9f('0x16')](util[_0x7f9f('0xc')](_0x7f9f('0x17'),config[_0x7f9f('0x4')][_0x7f9f('0xf')],config[_0x7f9f('0x4')]['ip'],config[_0x7f9f('0x4')][_0x7f9f('0x5')]));ami[_0x7f9f('0x18')](_0x7f9f('0xb'),error);ami[_0x7f9f('0x18')](_0x7f9f('0x19'),close);}ami['on'](_0x7f9f('0x1a'),connect);ami['on']('shutdown',function(_0x1fef24){logger[_0x7f9f('0x16')](util[_0x7f9f('0xc')](_0x7f9f('0x1b'),config[_0x7f9f('0x4')][_0x7f9f('0xf')],config[_0x7f9f('0x4')]['ip'],config[_0x7f9f('0x4')][_0x7f9f('0x5')],util[_0x7f9f('0xd')](_0x1fef24,![],null)));});ami['on'](_0x7f9f('0x1c'),function(_0xb7398){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7f9f('0x4')][_0x7f9f('0xf')],config['asterisk']['ip'],config[_0x7f9f('0x4')][_0x7f9f('0x5')]));return BPromise[_0x7f9f('0x1d')]()['then'](ami[_0x7f9f('0x10')]())[_0x7f9f('0x1e')](ami[_0x7f9f('0x12')]())['then'](ami[_0x7f9f('0x1f')]())['then'](ami[_0x7f9f('0x20')]())['then'](ami['actionCoreShowChannels']())[_0x7f9f('0x21')](function(_0x43e01e){console[_0x7f9f('0x22')](_0x43e01e);});});ami[_0x7f9f('0x18')](_0x7f9f('0xb'),error);ami[_0x7f9f('0x18')]('close',close);module[_0x7f9f('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5e027d9..6abf394 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 _0xdbf8=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','rpc','memberReport','error','message'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0xdbf8,0x8a));var _0x8dbf=function(_0x38a45c,_0x2df00b){_0x38a45c=_0x38a45c-0x0;var _0x49cfaa=_0xdbf8[_0x38a45c];return _0x49cfaa;};'use strict';var jayson=require(_0x8dbf('0x0'));var BPromise=require(_0x8dbf('0x1'));var logger=require(_0x8dbf('0x2'))('ami');var client=jayson[_0x8dbf('0x3')][_0x8dbf('0x4')]({'port':0x2329});client[_0x8dbf('0x5')]=function(_0x589480,_0x270764){return new BPromise(function(_0x413552,_0xcda0c9){return client[_0x8dbf('0x6')](_0x589480,_0x270764)['then'](function(_0x23cbdb){logger[_0x8dbf('0x7')](_0x8dbf('0x8'),_0x8dbf('0x9'),_0x589480,_0x270764,_0x23cbdb);if(_0x23cbdb[_0x8dbf('0xa')]){logger[_0x8dbf('0xa')]('rpc',_0x8dbf('0x9'),_0x589480,_0x23cbdb['error'][_0x8dbf('0xb')],_0x270764);return _0xcda0c9(_0x23cbdb[_0x8dbf('0xa')][_0x8dbf('0xb')]);}else{return _0x413552(_0x23cbdb[_0x8dbf('0xc')]);}})[_0x8dbf('0xd')](function(_0x41053e){logger['error']('rpc',_0x8dbf('0x9'),_0x589480,_0x41053e,_0x270764);return _0xcda0c9(_0x41053e);});});};module[_0x8dbf('0xe')]=client; \ No newline at end of file +var _0xdd1b=['jayson/promise','bluebird','../../config/logger','ami','client','Request','request','debug','memberReport','error','rpc','message','result','catch'];(function(_0x1fcf30,_0x221e1b){var _0x3c7c3d=function(_0x2bcc14){while(--_0x2bcc14){_0x1fcf30['push'](_0x1fcf30['shift']());}};_0x3c7c3d(++_0x221e1b);}(_0xdd1b,0x118));var _0xbdd1=function(_0x233602,_0x24afe3){_0x233602=_0x233602-0x0;var _0x214483=_0xdd1b[_0x233602];return _0x214483;};'use strict';var jayson=require(_0xbdd1('0x0'));var BPromise=require(_0xbdd1('0x1'));var logger=require(_0xbdd1('0x2'))(_0xbdd1('0x3'));var client=jayson[_0xbdd1('0x4')]['http']({'port':0x2329});client[_0xbdd1('0x5')]=function(_0x58a859,_0x33a56){return new BPromise(function(_0x12a2cd,_0x53d02f){return client[_0xbdd1('0x6')](_0x58a859,_0x33a56)['then'](function(_0x4d8714){logger[_0xbdd1('0x7')]('rpc',_0xbdd1('0x8'),_0x58a859,_0x33a56,_0x4d8714);if(_0x4d8714[_0xbdd1('0x9')]){logger[_0xbdd1('0x9')](_0xbdd1('0xa'),'memberReport',_0x58a859,_0x4d8714[_0xbdd1('0x9')][_0xbdd1('0xb')],_0x33a56);return _0x53d02f(_0x4d8714[_0xbdd1('0x9')][_0xbdd1('0xb')]);}else{return _0x12a2cd(_0x4d8714[_0xbdd1('0xc')]);}})[_0xbdd1('0xd')](function(_0x51a40b){logger[_0xbdd1('0x9')](_0xbdd1('0xa'),_0xbdd1('0x8'),_0x58a859,_0x51a40b,_0x33a56);return _0x53d02f(_0x51a40b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f3b425a..1520450 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 _0x31b2=['string','voiceQueue','uniqueid','name','Contact','phone','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','getQueue','util','moment','isNil'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x31b2,0xc5));var _0x231b=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0x31b2[_0x3f993e];return _0x39c135;};'use strict';var util=require(_0x231b('0x0'));var _=require('lodash');var moment=require(_0x231b('0x1'));function checkNameSurname(_0x190209,_0x5cb615,_0x1be04e){var _0x5496eb='';if(!_[_0x231b('0x2')](_0x5cb615)&&'string'===typeof _0x5cb615){_0x5496eb+=_0x5cb615;}if(!_[_0x231b('0x2')](_0x1be04e)&&_0x231b('0x3')===typeof _0x1be04e){_0x5496eb+='\x20'+_0x1be04e;}if(_0x5496eb!==''){return _0x5496eb;}return _0x190209;}function Action(_0x5276f9,_0x578450,_0x5d9c12){this[_0x231b('0x4')]=_0x5276f9;this[_0x231b('0x5')]=_0x5d9c12||undefined;this[_0x231b('0x6')]=checkNameSurname(_0x578450[_0x231b('0x7')][_0x231b('0x8')],_0x578450[_0x231b('0x7')][_0x231b('0x9')],_0x578450[_0x231b('0x7')]['lastName']);this['number']=_0x578450[_0x231b('0x7')][_0x231b('0x8')];this[_0x231b('0xa')]=_0x5276f9['name'];this['active']=_0x578450[_0x231b('0xb')]||![];this[_0x231b('0xc')]=_0x5276f9[_0x231b('0xc')];this[_0x231b('0xd')]=_0x5276f9['dialQueueTimeout']||0x3;this[_0x231b('0xe')]=_0x578450[_0x231b('0xe')];this['countbusyretry']=_0x578450[_0x231b('0xf')];this[_0x231b('0x10')]=_0x578450[_0x231b('0x10')];this[_0x231b('0x11')]=_0x578450[_0x231b('0x11')];this['ContactId']=_0x578450[_0x231b('0x12')];this['ListId']=_0x578450[_0x231b('0x13')];this[_0x231b('0x14')]=_0x578450[_0x231b('0x14')];this[_0x231b('0x15')]=_0x578450['VoiceQueueId'];this[_0x231b('0x16')]=_0x578450[_0x231b('0x16')];this[_0x231b('0x17')]=_0x578450['id'];this[_0x231b('0x18')]=_0x578450[_0x231b('0x7')][_0x231b('0x9')]||'';this[_0x231b('0x19')]=moment()[_0x231b('0x1a')](_0x231b('0x1b'));this[_0x231b('0x1c')]=_0x578450[_0x231b('0x1c')];this['callbackuniqueid']=_0x578450[_0x231b('0x1d')];this[_0x231b('0x1e')]=_0x578450[_0x231b('0x1e')];this[_0x231b('0x1f')]=_0x578450['recallme'];this['originatecalleridnum']='';this[_0x231b('0x20')]='';}Action[_0x231b('0x21')][_0x231b('0x22')]=function(){return util[_0x231b('0x1a')](_0x231b('0x23'),this[_0x231b('0x6')],this[_0x231b('0x4')]['dialCutDigit']>0x0?this['number'][_0x231b('0x24')](this[_0x231b('0x4')][_0x231b('0x25')]):this[_0x231b('0x26')]);};Action[_0x231b('0x21')][_0x231b('0x27')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x269d=['substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x4299a5,_0x33b03e){var _0x2d7a56=function(_0x1cbccc){while(--_0x1cbccc){_0x4299a5['push'](_0x4299a5['shift']());}};_0x2d7a56(++_0x33b03e);}(_0x269d,0x193));var _0xd269=function(_0x25dadd,_0x3183d8){_0x25dadd=_0x25dadd-0x0;var _0x512cca=_0x269d[_0x25dadd];return _0x512cca;};'use strict';var util=require('util');var _=require(_0xd269('0x0'));var moment=require(_0xd269('0x1'));function checkNameSurname(_0x2851bf,_0x2eb7e1,_0xfa23a4){var _0x2e984e='';if(!_[_0xd269('0x2')](_0x2eb7e1)&&_0xd269('0x3')===typeof _0x2eb7e1){_0x2e984e+=_0x2eb7e1;}if(!_['isNil'](_0xfa23a4)&&_0xd269('0x3')===typeof _0xfa23a4){_0x2e984e+='\x20'+_0xfa23a4;}if(_0x2e984e!==''){return _0x2e984e;}return _0x2851bf;}function Action(_0x4df548,_0x3e4238,_0x51ebfa){this[_0xd269('0x4')]=_0x4df548;this[_0xd269('0x5')]=_0x51ebfa||undefined;this[_0xd269('0x6')]=checkNameSurname(_0x3e4238[_0xd269('0x7')]['phone'],_0x3e4238[_0xd269('0x7')][_0xd269('0x8')],_0x3e4238[_0xd269('0x7')][_0xd269('0x9')]);this[_0xd269('0xa')]=_0x3e4238['Contact'][_0xd269('0xb')];this[_0xd269('0xc')]=_0x4df548[_0xd269('0x6')];this[_0xd269('0xd')]=_0x3e4238[_0xd269('0xd')]||![];this[_0xd269('0xe')]=_0x4df548['type'];this['dialQueueTimeout']=_0x4df548[_0xd269('0xf')]||0x3;this[_0xd269('0x10')]=_0x3e4238[_0xd269('0x10')];this[_0xd269('0x11')]=_0x3e4238[_0xd269('0x11')];this[_0xd269('0x12')]=_0x3e4238[_0xd269('0x12')];this[_0xd269('0x13')]=_0x3e4238[_0xd269('0x13')];this[_0xd269('0x14')]=_0x3e4238['ContactId'];this[_0xd269('0x15')]=_0x3e4238['ListId'];this[_0xd269('0x16')]=_0x3e4238[_0xd269('0x16')];this[_0xd269('0x17')]=_0x3e4238['VoiceQueueId'];this[_0xd269('0x18')]=_0x3e4238[_0xd269('0x18')];this['idHopper']=_0x3e4238['id'];this['ContactFirstName']=_0x3e4238[_0xd269('0x7')][_0xd269('0x8')]||'';this[_0xd269('0x19')]=moment()[_0xd269('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd269('0x1b')]=_0x3e4238[_0xd269('0x1b')];this[_0xd269('0x1c')]=_0x3e4238[_0xd269('0x1c')];this[_0xd269('0x1d')]=_0x3e4238['callbackat'];this[_0xd269('0x1e')]=_0x3e4238[_0xd269('0x1e')];this[_0xd269('0x1f')]='';this[_0xd269('0x20')]='';}Action[_0xd269('0x21')][_0xd269('0x22')]=function(){return util[_0xd269('0x1a')](_0xd269('0x23'),this['name'],this[_0xd269('0x4')][_0xd269('0x24')]>0x0?this[_0xd269('0xa')][_0xd269('0x25')](this[_0xd269('0x4')][_0xd269('0x24')]):this['number']);};Action[_0xd269('0x21')][_0xd269('0x26')]=function(){return this[_0xd269('0xc')];};module[_0xd269('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f8988c3..faaa554 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 _0xf57a=['countglobal','uniqueid','calleridnum','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x836bd2,_0x66cd66){var _0x5e4fec=function(_0x46fa97){while(--_0x46fa97){_0x836bd2['push'](_0x836bd2['shift']());}};_0x5e4fec(++_0x66cd66);}(_0xf57a,0x102));var _0xaf57=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xf57a[_0x5a776b];return _0xbbef59;};'use strict';var util=require(_0xaf57('0x0'));var _=require(_0xaf57('0x1'));var moment=require(_0xaf57('0x2'));function getSeconds(_0x202e67,_0x4ed622){var _0x4e9683=moment(_0x202e67)[_0xaf57('0x3')](0x0);var _0xe9a2f=moment(_0x4ed622)[_0xaf57('0x3')](0x0);return _0x4e9683[_0xaf57('0x4')](_0xe9a2f,_0xaf57('0x5'));}function AgentComplete(_0x488c1e,_0x1ee7a7){this[_0xaf57('0x6')]=0x4;this[_0xaf57('0x7')]=_0xaf57('0x8');this[_0xaf57('0x9')]=_0x488c1e[_0xaf57('0x9')];this['type']=_0x488c1e['type'];this[_0xaf57('0xa')]=_0x488c1e['type']==='outbound'?_0xaf57('0xb'):_0x488c1e['type'];this[_0xaf57('0xc')]=_0x488c1e[_0xaf57('0xc')];this[_0xaf57('0xd')]=_0x488c1e[_0xaf57('0xd')];this[_0xaf57('0xe')]=_0x488c1e['countnoanswerretry'];this[_0xaf57('0xf')]=_0x488c1e[_0xaf57('0xc')]+_0x488c1e[_0xaf57('0xd')]+_0x488c1e[_0xaf57('0xe')];this[_0xaf57('0x10')]=_0x1ee7a7[_0xaf57('0x10')];this['calleridname']=_0x488c1e['name'];this[_0xaf57('0x11')]=_0x488c1e['number'];this['starttime']=_0x488c1e['starttime'];this['responsetime']=_0x488c1e[_0xaf57('0x12')];this['answertime']=_0x488c1e[_0xaf57('0x13')];this[_0xaf57('0x14')]=moment()[_0xaf57('0x15')](_0xaf57('0x16'));this[_0xaf57('0x17')]=getSeconds(_0x488c1e[_0xaf57('0x12')],_0x488c1e['starttime']);this[_0xaf57('0x18')]=getSeconds(_0x488c1e['answertime'],_0x488c1e[_0xaf57('0x12')]);this[_0xaf57('0x19')]=getSeconds(this[_0xaf57('0x14')],_0x488c1e['answertime']);this['queue']=_0x1ee7a7[_0xaf57('0xb')];this[_0xaf57('0x1a')]=_0x1ee7a7[_0xaf57('0x1a')];this[_0xaf57('0x1b')]=_0x1ee7a7[_0xaf57('0x1b')];this[_0xaf57('0x1c')]=_0x488c1e[_0xaf57('0x1c')];this[_0xaf57('0x1d')]=_0x488c1e[_0xaf57('0x1d')];this[_0xaf57('0x1e')]=_0x488c1e['callbackat'];this[_0xaf57('0x1f')]=_0x488c1e[_0xaf57('0x1f')];this[_0xaf57('0x20')]=_0x488c1e['ContactId'];this[_0xaf57('0x21')]=_0x488c1e[_0xaf57('0x21')];this[_0xaf57('0x22')]=_0x488c1e[_0xaf57('0x22')];this['VoiceQueueId']=_0x488c1e[_0xaf57('0x23')];this['CampaignId']=_0x488c1e[_0xaf57('0x24')];this[_0xaf57('0x25')]=_0x488c1e[_0xaf57('0x25')]||'';this[_0xaf57('0x26')]=_0x488c1e[_0xaf57('0x26')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x756e=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x85b6de,_0xaa6f06){var _0x4ed1fb=function(_0x572ba3){while(--_0x572ba3){_0x85b6de['push'](_0x85b6de['shift']());}};_0x4ed1fb(++_0xaa6f06);}(_0x756e,0x1af));var _0xe756=function(_0x262ca6,_0x2c2adf){_0x262ca6=_0x262ca6-0x0;var _0x5b7406=_0x756e[_0x262ca6];return _0x5b7406;};'use strict';var util=require(_0xe756('0x0'));var _=require(_0xe756('0x1'));var moment=require(_0xe756('0x2'));function getSeconds(_0x57c291,_0x53a582){var _0x1ee1e0=moment(_0x57c291)[_0xe756('0x3')](0x0);var _0x774d87=moment(_0x53a582)[_0xe756('0x3')](0x0);return _0x1ee1e0[_0xe756('0x4')](_0x774d87,_0xe756('0x5'));}function AgentComplete(_0x3075c6,_0xce108c){this[_0xe756('0x6')]=0x4;this[_0xe756('0x7')]=_0xe756('0x8');this[_0xe756('0x9')]=_0x3075c6[_0xe756('0x9')];this[_0xe756('0xa')]=_0x3075c6['type'];this[_0xe756('0xb')]=_0x3075c6[_0xe756('0xa')]===_0xe756('0xc')?'queue':_0x3075c6[_0xe756('0xa')];this[_0xe756('0xd')]=_0x3075c6['countbusyretry'];this['countcongestionretry']=_0x3075c6[_0xe756('0xe')];this[_0xe756('0xf')]=_0x3075c6[_0xe756('0xf')];this[_0xe756('0x10')]=_0x3075c6[_0xe756('0xd')]+_0x3075c6[_0xe756('0xe')]+_0x3075c6[_0xe756('0xf')];this[_0xe756('0x11')]=_0xce108c[_0xe756('0x11')];this[_0xe756('0x12')]=_0x3075c6['name'];this[_0xe756('0x13')]=_0x3075c6['number'];this[_0xe756('0x14')]=_0x3075c6[_0xe756('0x14')];this['responsetime']=_0x3075c6[_0xe756('0x15')];this[_0xe756('0x16')]=_0x3075c6['answertime'];this[_0xe756('0x17')]=moment()[_0xe756('0x18')](_0xe756('0x19'));this[_0xe756('0x1a')]=getSeconds(_0x3075c6[_0xe756('0x15')],_0x3075c6[_0xe756('0x14')]);this[_0xe756('0x1b')]=getSeconds(_0x3075c6[_0xe756('0x16')],_0x3075c6[_0xe756('0x15')]);this[_0xe756('0x1c')]=getSeconds(this[_0xe756('0x17')],_0x3075c6[_0xe756('0x16')]);this[_0xe756('0x1d')]=_0xce108c[_0xe756('0x1d')];this[_0xe756('0x1e')]=_0xce108c[_0xe756('0x1e')];this[_0xe756('0x1f')]=_0xce108c[_0xe756('0x1f')];this[_0xe756('0x20')]=_0x3075c6[_0xe756('0x20')];this[_0xe756('0x21')]=_0x3075c6[_0xe756('0x21')];this[_0xe756('0x22')]=_0x3075c6[_0xe756('0x22')];this[_0xe756('0x23')]=_0x3075c6[_0xe756('0x23')];this[_0xe756('0x24')]=_0x3075c6[_0xe756('0x24')];this[_0xe756('0x25')]=_0x3075c6[_0xe756('0x25')];this[_0xe756('0x26')]=_0x3075c6['UserId'];this['VoiceQueueId']=_0x3075c6[_0xe756('0x27')];this[_0xe756('0x28')]=_0x3075c6['CampaignId'];this['originatecalleridnum']=_0x3075c6[_0xe756('0x29')]||'';this['originatecalleridname']=_0x3075c6[_0xe756('0x2a')]||'';}module[_0xe756('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 45dd83f..c9f17ab 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 _0x095b=['responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x095b,0x6e));var _0xb095=function(_0x2871ca,_0x722f6e){_0x2871ca=_0x2871ca-0x0;var _0x44cd7e=_0x095b[_0x2871ca];return _0x44cd7e;};'use strict';var util=require(_0xb095('0x0'));var _=require('lodash');var moment=require(_0xb095('0x1'));function getSeconds(_0x3fe3fb,_0x3e60de){var _0x33ef98=moment(_0x3fe3fb)[_0xb095('0x2')](0x0);var _0x48b909=moment(_0x3e60de)[_0xb095('0x2')](0x0);return _0x33ef98[_0xb095('0x3')](_0x48b909,_0xb095('0x4'));}function Final(_0x2f5412){this[_0xb095('0x5')]=_0x2f5412[_0xb095('0x5')];this[_0xb095('0x6')]=_0x2f5412[_0xb095('0x6')];this[_0xb095('0x7')]=_0x2f5412['type'];this[_0xb095('0x8')]=_0x2f5412[_0xb095('0x7')]===_0xb095('0x9')?_0xb095('0xa'):_0x2f5412[_0xb095('0x7')];this[_0xb095('0xb')]=_0x2f5412['countbusyretry'];this['countcongestionretry']=_0x2f5412[_0xb095('0xc')];this[_0xb095('0xd')]=_0x2f5412['countnoanswerretry'];this[_0xb095('0xe')]=_0x2f5412[_0xb095('0xb')]+_0x2f5412['countcongestionretry']+_0x2f5412[_0xb095('0xd')];this['queue']=_0x2f5412[_0xb095('0xa')];this[_0xb095('0xf')]=_0x2f5412[_0xb095('0xf')];this[_0xb095('0x10')]=_0x2f5412[_0xb095('0x10')];this[_0xb095('0x11')]=_0x2f5412[_0xb095('0x11')];this['responsetime']=_0x2f5412[_0xb095('0x12')];this[_0xb095('0x13')]=_0x2f5412[_0xb095('0x12')];this[_0xb095('0x14')]=_0x2f5412[_0xb095('0x14')]||0x0;this[_0xb095('0x15')]=_0x2f5412['holdtime']||0x0;this['talktime']=_0x2f5412['talktime']||0x0;this[_0xb095('0x16')]=_0x2f5412[_0xb095('0x16')];this[_0xb095('0x17')]=_0x2f5412[_0xb095('0x17')];this[_0xb095('0x18')]=_0x2f5412[_0xb095('0x18')];this['recallme']=_0x2f5412[_0xb095('0x19')];this[_0xb095('0x1a')]=_0x2f5412[_0xb095('0x1a')];this[_0xb095('0x1b')]=_0x2f5412['ListId'];this[_0xb095('0x1c')]=_0x2f5412[_0xb095('0x1c')];this[_0xb095('0x1d')]=_0x2f5412[_0xb095('0x1d')];this[_0xb095('0x1e')]=_0x2f5412[_0xb095('0x1e')];this['originatecalleridnum']=_0x2f5412[_0xb095('0x1f')]||'';this['originatecalleridname']=_0x2f5412['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0xb4d9=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','ringtime'];(function(_0x5f19c6,_0x50736b){var _0x40644f=function(_0x31041b){while(--_0x31041b){_0x5f19c6['push'](_0x5f19c6['shift']());}};_0x40644f(++_0x50736b);}(_0xb4d9,0xce));var _0x9b4d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb4d9[_0x45d3f0];return _0x314b79;};'use strict';var util=require(_0x9b4d('0x0'));var _=require(_0x9b4d('0x1'));var moment=require('moment');function getSeconds(_0x21d695,_0xccc4bc){var _0x62bfd7=moment(_0x21d695)['milliseconds'](0x0);var _0x16b539=moment(_0xccc4bc)[_0x9b4d('0x2')](0x0);return _0x62bfd7[_0x9b4d('0x3')](_0x16b539,_0x9b4d('0x4'));}function Final(_0x134ca1){this[_0x9b4d('0x5')]=_0x134ca1[_0x9b4d('0x5')];this[_0x9b4d('0x6')]=_0x134ca1[_0x9b4d('0x6')];this[_0x9b4d('0x7')]=_0x134ca1[_0x9b4d('0x7')];this['campaigntype']=_0x134ca1[_0x9b4d('0x7')]==='outbound'?_0x9b4d('0x8'):_0x134ca1['type'];this[_0x9b4d('0x9')]=_0x134ca1[_0x9b4d('0x9')];this[_0x9b4d('0xa')]=_0x134ca1[_0x9b4d('0xa')];this[_0x9b4d('0xb')]=_0x134ca1[_0x9b4d('0xb')];this[_0x9b4d('0xc')]=_0x134ca1[_0x9b4d('0x9')]+_0x134ca1[_0x9b4d('0xa')]+_0x134ca1[_0x9b4d('0xb')];this[_0x9b4d('0x8')]=_0x134ca1[_0x9b4d('0x8')];this['calleridname']=_0x134ca1[_0x9b4d('0xd')];this[_0x9b4d('0xe')]=_0x134ca1[_0x9b4d('0xe')];this[_0x9b4d('0xf')]=_0x134ca1['starttime'];this[_0x9b4d('0x10')]=_0x134ca1['responsetime'];this['endtime']=_0x134ca1[_0x9b4d('0x10')];this[_0x9b4d('0x11')]=_0x134ca1[_0x9b4d('0x11')]||0x0;this[_0x9b4d('0x12')]=_0x134ca1[_0x9b4d('0x12')]||0x0;this[_0x9b4d('0x13')]=_0x134ca1['talktime']||0x0;this['callback']=_0x134ca1[_0x9b4d('0x14')];this[_0x9b4d('0x15')]=_0x134ca1[_0x9b4d('0x15')];this[_0x9b4d('0x16')]=_0x134ca1[_0x9b4d('0x16')];this[_0x9b4d('0x17')]=_0x134ca1[_0x9b4d('0x17')];this[_0x9b4d('0x18')]=_0x134ca1[_0x9b4d('0x18')];this[_0x9b4d('0x19')]=_0x134ca1[_0x9b4d('0x19')];this[_0x9b4d('0x1a')]=_0x134ca1[_0x9b4d('0x1a')];this[_0x9b4d('0x1b')]=_0x134ca1[_0x9b4d('0x1b')];this[_0x9b4d('0x1c')]=_0x134ca1[_0x9b4d('0x1c')];this[_0x9b4d('0x1d')]=_0x134ca1[_0x9b4d('0x1d')]||'';this[_0x9b4d('0x1e')]=_0x134ca1['originatecalleridname']||'';}module[_0x9b4d('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0925986..cd16149 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0xf9ec3e,_0x51aad3){var _0x5cd9fd=function(_0x2fd18d){while(--_0x2fd18d){_0xf9ec3e['push'](_0xf9ec3e['shift']());}};_0x5cd9fd(++_0x51aad3);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x49d5a6,_0x3a1f12){var _0x56d4fa=function(_0x1faeb8){while(--_0x1faeb8){_0x49d5a6['push'](_0x49d5a6['shift']());}};_0x56d4fa(++_0x3a1f12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 744463a..bceb58d 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 _0xcea9=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','number','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0xf01579,_0x914885){var _0x146774=function(_0x57ebfc){while(--_0x57ebfc){_0xf01579['push'](_0xf01579['shift']());}};_0x146774(++_0x914885);}(_0xcea9,0x1c7));var _0x9cea=function(_0xab4582,_0x378a14){_0xab4582=_0xab4582-0x0;var _0x5d09ab=_0xcea9[_0xab4582];return _0x5d09ab;};'use strict';var util=require(_0x9cea('0x0'));var _=require(_0x9cea('0x1'));var moment=require(_0x9cea('0x2'));function getSeconds(_0x28595a,_0x209e1f){var _0x4544f8=moment(_0x28595a)['milliseconds'](0x0);var _0x2454bc=moment(_0x209e1f)[_0x9cea('0x3')](0x0);return _0x4544f8[_0x9cea('0x4')](_0x2454bc,_0x9cea('0x5'));}function History(_0x511f2f){this[_0x9cea('0x6')]=_0x511f2f[_0x9cea('0x6')];this[_0x9cea('0x7')]=_0x511f2f[_0x9cea('0x7')]||undefined;this[_0x9cea('0x8')]=_0x511f2f[_0x9cea('0x8')];this['campaigntype']=_0x511f2f[_0x9cea('0x8')]===_0x9cea('0x9')?_0x9cea('0xa'):_0x511f2f[_0x9cea('0x8')];this['countbusyretry']=_0x511f2f[_0x9cea('0xb')];this[_0x9cea('0xc')]=_0x511f2f[_0x9cea('0xc')];this[_0x9cea('0xd')]=_0x511f2f['countnoanswerretry'];this['countglobal']=_0x511f2f['countbusyretry']+_0x511f2f[_0x9cea('0xc')]+_0x511f2f['countnoanswerretry'];this[_0x9cea('0xa')]=_0x511f2f['queue'];this[_0x9cea('0xe')]=_0x511f2f['name'];this[_0x9cea('0xf')]=_0x511f2f[_0x9cea('0x10')];this[_0x9cea('0x11')]=_0x511f2f[_0x9cea('0x11')];this[_0x9cea('0x12')]=_0x511f2f['responsetime'];this[_0x9cea('0x13')]=_0x511f2f[_0x9cea('0x12')];this['ringtime']=getSeconds(_0x511f2f[_0x9cea('0x12')],_0x511f2f[_0x9cea('0x11')]);this[_0x9cea('0x14')]=0x0;this['talktime']=0x0;this[_0x9cea('0x15')]=_0x511f2f[_0x9cea('0x15')];this['callbackuniqueid']=_0x511f2f[_0x9cea('0x16')];this['callbackat']=_0x511f2f[_0x9cea('0x17')];this[_0x9cea('0x18')]=_0x511f2f['recallme'];this[_0x9cea('0x19')]=_0x511f2f[_0x9cea('0x19')];this[_0x9cea('0x1a')]=_0x511f2f[_0x9cea('0x1a')];this[_0x9cea('0x1b')]=_0x511f2f[_0x9cea('0x1b')];this['VoiceQueueId']=_0x511f2f[_0x9cea('0x1c')];this[_0x9cea('0x1d')]=_0x511f2f[_0x9cea('0x1d')];this[_0x9cea('0x1e')]=_0x511f2f[_0x9cea('0x1e')]||'';this['originatecalleridname']=_0x511f2f[_0x9cea('0x1f')]||'';}module[_0x9cea('0x20')]=History; \ No newline at end of file +var _0x32ea=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','starttime','responsetime','endtime'];(function(_0x519dc1,_0x1f872b){var _0x9edde5=function(_0x433c07){while(--_0x433c07){_0x519dc1['push'](_0x519dc1['shift']());}};_0x9edde5(++_0x1f872b);}(_0x32ea,0x14a));var _0xa32e=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x32ea[_0x593564];return _0x211a89;};'use strict';var util=require(_0xa32e('0x0'));var _=require('lodash');var moment=require(_0xa32e('0x1'));function getSeconds(_0x282111,_0x5b108b){var _0x15ec62=moment(_0x282111)['milliseconds'](0x0);var _0x31db05=moment(_0x5b108b)[_0xa32e('0x2')](0x0);return _0x15ec62[_0xa32e('0x3')](_0x31db05,_0xa32e('0x4'));}function History(_0x2395d7){this[_0xa32e('0x5')]=_0x2395d7[_0xa32e('0x5')];this[_0xa32e('0x6')]=_0x2395d7[_0xa32e('0x6')]||undefined;this[_0xa32e('0x7')]=_0x2395d7[_0xa32e('0x7')];this[_0xa32e('0x8')]=_0x2395d7['type']===_0xa32e('0x9')?_0xa32e('0xa'):_0x2395d7[_0xa32e('0x7')];this['countbusyretry']=_0x2395d7[_0xa32e('0xb')];this[_0xa32e('0xc')]=_0x2395d7[_0xa32e('0xc')];this['countnoanswerretry']=_0x2395d7[_0xa32e('0xd')];this[_0xa32e('0xe')]=_0x2395d7[_0xa32e('0xb')]+_0x2395d7[_0xa32e('0xc')]+_0x2395d7[_0xa32e('0xd')];this[_0xa32e('0xa')]=_0x2395d7['queue'];this[_0xa32e('0xf')]=_0x2395d7[_0xa32e('0x10')];this['calleridnum']=_0x2395d7['number'];this[_0xa32e('0x11')]=_0x2395d7[_0xa32e('0x11')];this['responsetime']=_0x2395d7[_0xa32e('0x12')];this[_0xa32e('0x13')]=_0x2395d7[_0xa32e('0x12')];this[_0xa32e('0x14')]=getSeconds(_0x2395d7[_0xa32e('0x12')],_0x2395d7[_0xa32e('0x11')]);this[_0xa32e('0x15')]=0x0;this[_0xa32e('0x16')]=0x0;this[_0xa32e('0x17')]=_0x2395d7['callback'];this[_0xa32e('0x18')]=_0x2395d7[_0xa32e('0x18')];this[_0xa32e('0x19')]=_0x2395d7['callbackat'];this[_0xa32e('0x1a')]=_0x2395d7[_0xa32e('0x1a')];this[_0xa32e('0x1b')]=_0x2395d7[_0xa32e('0x1b')];this['ListId']=_0x2395d7[_0xa32e('0x1c')];this[_0xa32e('0x1d')]=_0x2395d7[_0xa32e('0x1d')];this['VoiceQueueId']=_0x2395d7[_0xa32e('0x1e')];this[_0xa32e('0x1f')]=_0x2395d7[_0xa32e('0x1f')];this[_0xa32e('0x20')]=_0x2395d7[_0xa32e('0x20')]||'';this['originatecalleridname']=_0x2395d7[_0xa32e('0x21')]||'';}module[_0xa32e('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 52b7ff6..ffb222c 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 _0x6d5e=['stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','pTalking','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','uniqueid','variable','value','HANGUP','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','cause-txt','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','Abandoned','CALLEREXIT','syncNewExten','channel','actionid','locked','paused','stateinterface','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','ListId','CampaignId','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','idHopper','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','push','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','predictive','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','\x5cw{0,','pow','random','match','originate','Contact','phone','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDActive','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','OriginateError','starttime','[originate][error]','Error','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','minutes','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','countglobal','reason\x203\x20ringing\x20no\x20answer','Busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','handlePredictive','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','RUNNING','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncAgentComplete','syncHangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect'];(function(_0x2b92c1,_0x5892cb){var _0x581968=function(_0x46ef60){while(--_0x46ef60){_0x2b92c1['push'](_0x2b92c1['shift']());}};_0x581968(++_0x5892cb);}(_0x6d5e,0x15e));var _0xe6d5=function(_0x47a2d1,_0x1ec6d2){_0x47a2d1=_0x47a2d1-0x0;var _0xd157dd=_0x6d5e[_0x47a2d1];return _0xd157dd;};'use strict';var util=require(_0xe6d5('0x0'));var _=require(_0xe6d5('0x1'));var BPromise=require(_0xe6d5('0x2'));var uuid=require(_0xe6d5('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xe6d5('0x4'));var Redis=require(_0xe6d5('0x5'));var config=require(_0xe6d5('0x6'));var logger=require(_0xe6d5('0x7'))(_0xe6d5('0x8'));var loggerBooked=require(_0xe6d5('0x7'))('booked');var loggerPredictive=require(_0xe6d5('0x7'))('predictive');var loggerPredictiveCalls=require(_0xe6d5('0x7'))(_0xe6d5('0x9'));var loggerSyncQueueSummary=require(_0xe6d5('0x7'))(_0xe6d5('0xa'));var ami=require(_0xe6d5('0xb'));config[_0xe6d5('0xc')]=_[_0xe6d5('0xd')](config[_0xe6d5('0xc')],{'host':_0xe6d5('0xe'),'port':0x18eb});var io=require(_0xe6d5('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xe6d5('0x10'));var cmHopperFinal=require(_0xe6d5('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xe6d5('0x12'));var voiceQueueRt=require(_0xe6d5('0x13'));var Action=require(_0xe6d5('0x14'));var History=require(_0xe6d5('0x15'));var Final=require('./final');var AgentComplete=require(_0xe6d5('0x16'));var QueueCallerAbandon=require(_0xe6d5('0x17'));var Hangup=require(_0xe6d5('0x18'));var ipAgi=process[_0xe6d5('0x19')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xe6d5('0x1a'),'roundrobin':_0xe6d5('0x1b')};var Sequence=function(){};Sequence[_0xe6d5('0x1c')][_0xe6d5('0x1d')]=function(_0x1dd4b8){this[_0xe6d5('0x1e')]=this[_0xe6d5('0x1e')]?this[_0xe6d5('0x1e')]['finally'](_0x1dd4b8):_0x1dd4b8();};function Dialer(_0x559ed9,_0x2a152e){this[_0xe6d5('0x1f')]=new Sequence();this[_0xe6d5('0x20')]=_0x2a152e;this[_0xe6d5('0x21')]=_0x559ed9[_0xe6d5('0x21')];this[_0xe6d5('0x22')]=_0x559ed9[_0xe6d5('0x22')];this[_0xe6d5('0x23')]=_0x559ed9[_0xe6d5('0x23')];this[_0xe6d5('0x24')]=_0x559ed9[_0xe6d5('0x24')];this[_0xe6d5('0x25')]=config['maxNumberOriginate']||0x2;this[_0xe6d5('0x26')]={};this[_0xe6d5('0x27')]={};this[_0xe6d5('0x28')]={};this[_0xe6d5('0x29')]={};this[_0xe6d5('0x2a')]={};this['startPredictive']={};this[_0xe6d5('0x2b')]={};this[_0xe6d5('0x2c')]={};this[_0xe6d5('0x2d')]={};this['queueBookedRR']={};ami['on'](_0xe6d5('0x2e'),this[_0xe6d5('0x2f')][_0xe6d5('0x30')](this));ami['on'](_0xe6d5('0x31'),this['syncQueueCallerAbandon'][_0xe6d5('0x30')](this));ami['on'](_0xe6d5('0x32'),this['syncOriginateResponse'][_0xe6d5('0x30')](this));ami['on']('agentcomplete',this[_0xe6d5('0x33')][_0xe6d5('0x30')](this));ami['on']('custom:queuesummary',this[_0xe6d5('0xa')]['bind'](this));ami['on']('hangup',this[_0xe6d5('0x34')][_0xe6d5('0x30')](this));ami['on'](_0xe6d5('0x35'),this['syncNewExten']['bind'](this));ami['on'](_0xe6d5('0x36'),this[_0xe6d5('0x37')][_0xe6d5('0x30')](this));ami['on']('queuemember',this[_0xe6d5('0x38')]['bind'](this));ami['on'](_0xe6d5('0x39'),this[_0xe6d5('0x3a')][_0xe6d5('0x30')](this));this[_0xe6d5('0x3b')]();this[_0xe6d5('0x3c')]();}function isNotNull(_0x3c74f1){return _0x3c74f1!==null&&!_[_0xe6d5('0x3d')](_0x3c74f1);}function checkIsLoggedIn(_0x32142b,_0x472d8c){return function(){if(_0x472d8c<=0x0){_0x32142b[_0xe6d5('0x3e')]=_0xe6d5('0x3f');throw _0x32142b[_0xe6d5('0x40')]+_0xe6d5('0x41');}};}function isActive(_0x18db15){return _0x18db15;}function checkIsActive(_0x4eb70b,_0x1171dc){return function(){if(!isActive(_0x1171dc)){_0x4eb70b[_0xe6d5('0x3e')]=_0xe6d5('0x42');throw _0x4eb70b[_0xe6d5('0x40')]+_0xe6d5('0x43');}};}function checkInterval(_0x1314fd){return function(){if(!isNotNull(_0x1314fd['Interval'])){_0x1314fd[_0xe6d5('0x3e')]=_0xe6d5('0x44');throw _0x1314fd[_0xe6d5('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x1314fd[_0xe6d5('0x45')][_0xe6d5('0x46')])){_0x1314fd[_0xe6d5('0x3e')]=_0xe6d5('0x44');throw _0x1314fd[_0xe6d5('0x40')]+_0xe6d5('0x47');}if(!isNotNull(_[_0xe6d5('0x48')](_0x1314fd[_0xe6d5('0x45')][_0xe6d5('0x46')]))){_0x1314fd[_0xe6d5('0x3e')]=_0xe6d5('0x44');throw _0x1314fd[_0xe6d5('0x40')]+_0xe6d5('0x47');}};}function msgResponse(_0x3bfefa,_0x27c349,_0x3b7ec7){return{'action':_0x3bfefa,'response':_0x27c349,'message':_0x3b7ec7,'stack':_0x3b7ec7};}function myreject(_0xc8c923){return function(_0x12896a){return _0xc8c923(msgResponse(_0xe6d5('0x49'),'Error',JSON[_0xe6d5('0x4a')](_0x12896a)));};}function getSeconds(_0x3e90f7,_0x1f406c){var _0x20839a=moment(_0x3e90f7)[_0xe6d5('0x4b')](0x0);var _0x2b55b2=moment(_0x1f406c)[_0xe6d5('0x4b')](0x0);return _0x20839a['diff'](_0x2b55b2,_0xe6d5('0x4c'));}function emit(_0x4ff5c6,_0x2a22e4,_0x2a6b49){io['to'](_0x4ff5c6)[_0xe6d5('0x4d')](_0x2a22e4,_0x2a6b49);}function emitVoiceQueueSummary(_0x4675a8){if(_0x4675a8[_0xe6d5('0x4e')]===_0xe6d5('0x4f')){var _0x52fc3d={'id':_0x4675a8['id'],'name':_0x4675a8['name'],'strategy':_0x4675a8[_0xe6d5('0x50')],'answered':_0x4675a8[_0xe6d5('0x51')],'available':_0x4675a8[_0xe6d5('0x52')],'loggedIn':_0x4675a8[_0xe6d5('0x53')],'pTalking':_0x4675a8['pTalking'],'sumBillable':_0x4675a8[_0xe6d5('0x54')],'sumDuration':_0x4675a8[_0xe6d5('0x55')],'sumHoldTime':_0x4675a8[_0xe6d5('0x56')]||0x0,'talking':_0x4675a8[_0xe6d5('0x57')],'total':_0x4675a8[_0xe6d5('0x58')],'type':_0x4675a8['type'],'unmanaged':_0x4675a8[_0xe6d5('0x59')],'abandoned':_0x4675a8[_0xe6d5('0x5a')],'waiting':_0x4675a8['waiting'],'loggedInDb':_0x4675a8[_0xe6d5('0x5b')],'dialActive':_0x4675a8[_0xe6d5('0x5c')],'dialMethod':_0x4675a8[_0xe6d5('0x5d')],'dialOriginateCallerIdName':_0x4675a8[_0xe6d5('0x5e')],'dialOriginateCallerIdNumber':_0x4675a8['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4675a8[_0xe6d5('0x5f')],'dialPrefix':_0x4675a8['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4675a8[_0xe6d5('0x60')],'outboundAnswerCallsDay':_0x4675a8[_0xe6d5('0x61')],'outboundBlacklistCallsDay':_0x4675a8[_0xe6d5('0x62')],'outboundBusyCallsDay':_0x4675a8[_0xe6d5('0x63')],'outboundCongestionCallsDay':_0x4675a8['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4675a8[_0xe6d5('0x64')],'outboundDropCallsDayCallersExit':_0x4675a8[_0xe6d5('0x65')],'outboundDropCallsDayTimeout':_0x4675a8[_0xe6d5('0x66')],'outboundNoAnswerCallsDay':_0x4675a8[_0xe6d5('0x67')],'outboundNoSuchCallsDay':_0x4675a8['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4675a8[_0xe6d5('0x68')],'outboundReCallsDay':_0x4675a8['outboundReCallsDay'],'outboundRejectCallsDay':_0x4675a8['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4675a8[_0xe6d5('0x69')],'predictiveIntervalAnsweredCalls':_0x4675a8[_0xe6d5('0x6a')],'predictiveIntervalAvgHoldtime':_0x4675a8['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4675a8[_0xe6d5('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x4675a8[_0xe6d5('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x4675a8[_0xe6d5('0x6d')],'predictiveIntervalErlangCalls':_0x4675a8[_0xe6d5('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x4675a8['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4675a8['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4675a8[_0xe6d5('0x6f')],'predictiveIntervalPauses':_0x4675a8[_0xe6d5('0x70')],'predictiveIntervalAvailable':_0x4675a8[_0xe6d5('0x71')],'predictiveIntervalTotalCalls':_0x4675a8[_0xe6d5('0x72')],'message':_0x4675a8[_0xe6d5('0x3e')],'originated':_0x4675a8[_0xe6d5('0x73')],'erlangCalls':_0x4675a8['erlangCalls'],'erlangCallToSecond':_0x4675a8[_0xe6d5('0x74')],'erlangAbandonmentRate':_0x4675a8[_0xe6d5('0x75')],'erlangBusyFactor':_0x4675a8[_0xe6d5('0x76')],'startPredictive':_0x4675a8['startPredictive'],'startProgressive':_0x4675a8[_0xe6d5('0x2b')]};if(_0x4675a8[_0xe6d5('0x77')]){_0x52fc3d[_0xe6d5('0x77')]={'id':_0x4675a8[_0xe6d5('0x77')]['id'],'name':_0x4675a8[_0xe6d5('0x77')][_0xe6d5('0x40')],'active':_0x4675a8['Trunk']['active'],'callerid':_0x4675a8[_0xe6d5('0x77')][_0xe6d5('0x78')]};}if(_0x4675a8['Interval']){_0x52fc3d[_0xe6d5('0x45')]={'id':_0x4675a8[_0xe6d5('0x45')]['id'],'name':_0x4675a8[_0xe6d5('0x45')][_0xe6d5('0x40')]};}var _0x136184=md5(JSON[_0xe6d5('0x4a')](_0x52fc3d));if(_0x4675a8['md5']!==_0x136184){_0x4675a8['md5']=_0x136184;emit(util['format'](_0xe6d5('0x79'),_0x52fc3d['name']),_0xe6d5('0x7a'),_0x52fc3d);}}}function emitCampaignSummary(_0x499a8c){if(_0x499a8c['type']==='ivr'){emit(util[_0xe6d5('0x7b')](_0xe6d5('0x7c'),_0x499a8c['name']),_0xe6d5('0x7d'),_0x499a8c);}}function checkGetDataPredictive(_0x3d1e95){if(isNotNull(_0x3d1e95)){if(!_['isEmpty'](_0x3d1e95)){loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x7f'));loggerPredictive[_0xe6d5('0x7e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d1e95[_0xe6d5('0x72')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x80'),_0x3d1e95[_0xe6d5('0x6a')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x81'),_0x3d1e95['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x82'),_0x3d1e95[_0xe6d5('0x6c')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x83'),_0x3d1e95[_0xe6d5('0x84')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x85'),_0x3d1e95[_0xe6d5('0x6b')]);loggerPredictive['info'](_0xe6d5('0x86'));if(_0x3d1e95[_0xe6d5('0x72')]>0x0){if(!_[_0xe6d5('0x3d')](_0x3d1e95[_0xe6d5('0x6b')])&&_0x3d1e95[_0xe6d5('0x6b')]>0x0){return!![];}else{loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x87'));}if(!_[_0xe6d5('0x3d')](_0x3d1e95[_0xe6d5('0x84')])&&_0x3d1e95[_0xe6d5('0x84')]>0x0){return!![];}else{loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x88'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xe6d5('0x7e')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x89'));}return![];}function mergeDataErlangB(_0x4c8c4d){return function(_0x1f2a6e){loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x8a'));loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x8b'),_0x1f2a6e['erlangCalls']);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x8c'),_0x1f2a6e[_0xe6d5('0x74')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x8d'),_0x1f2a6e['erlangAbandonmentRate']);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x8e'),_0x1f2a6e['erlangBusyFactor']);loggerPredictive['info'](_0xe6d5('0x8d'),_0x1f2a6e[_0xe6d5('0x75')]);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x86'));_[_0xe6d5('0x8f')](_0x4c8c4d,_0x1f2a6e);};}function getDiff(_0x1b925f){var _0x1a61df=moment()[_0xe6d5('0x4b')](0x0);var _0x119901=moment(_0x1b925f)[_0xe6d5('0x4b')](0x0);return _0x1a61df[_0xe6d5('0x90')](_0x119901,_0xe6d5('0x4c'));}function ifInterval(_0x335403,_0x5a6f06){if(_[_0xe6d5('0x3d')](_0x5a6f06)){return![];}if(getDiff(_0x5a6f06)<_0x335403*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2450f8){if(isNotNull(_0x2450f8)){if(!_[_0xe6d5('0x3d')](_0x2450f8[_0xe6d5('0x2b')])){_0x2450f8['startProgressive']=undefined;loggerPredictive[_0xe6d5('0x7e')](_0x2450f8['name'],_0xe6d5('0x91'));}if(!_[_0xe6d5('0x3d')](_0x2450f8[_0xe6d5('0x92')])){_0x2450f8[_0xe6d5('0x92')]=undefined;loggerPredictive[_0xe6d5('0x7e')](_0x2450f8[_0xe6d5('0x40')],_0xe6d5('0x93'));}if(!_[_0xe6d5('0x3d')](_0x2450f8['handlePredictive'])){clearInterval(_0x2450f8['handlePredictive']);_0x2450f8['handlePredictive']=undefined;loggerPredictive['info'](_0x2450f8[_0xe6d5('0x40')],_0xe6d5('0x94'));}}}function erlangb(_0x49c13b,_0xcb0833){if(_0xcb0833===0x0){return 0x0;}var _0x22b531=0x1;for(var _0x3963d9=0x1;_0x3963d9<=_0xcb0833;_0x3963d9+=0x1){_0x22b531=0x1+_0x22b531*_0x3963d9/_0x49c13b;}return 0x1/_0x22b531;}function isVoiceQueueOutbound(_0xa1f07){return _0xa1f07===_0xe6d5('0x4f');}function isNotPreview(_0x4f9a13){return _0x4f9a13!=='preview';}function isCampaignIvr(_0x12e116){return _0x12e116===_0xe6d5('0x95');}function getCallerId(_0x1e9eb1,_0x52a158,_0x2d0bdf){if(!_[_0xe6d5('0x3d')](_0x2d0bdf)&&'string'===typeof _0x2d0bdf&&!_[_0xe6d5('0x48')](_0x2d0bdf)){if(!_[_0xe6d5('0x3d')](_0x52a158)&&_0xe6d5('0x96')===typeof _0x52a158&&!_[_0xe6d5('0x48')](_0x52a158)){return util[_0xe6d5('0x7b')](_0xe6d5('0x97'),_0x52a158,_0x2d0bdf);}return util[_0xe6d5('0x7b')](_0xe6d5('0x97'),_0x2d0bdf,_0x2d0bdf);}if(!_['isUndefined'](_0x1e9eb1)&&_0xe6d5('0x96')===typeof _0x1e9eb1&&!_[_0xe6d5('0x48')](_0x1e9eb1)){return _0x1e9eb1;}return _0xe6d5('0x98');}function loggerCatchQueueSummary(_0x38cb7b,_0x361570){return function(_0x234c4f){freeVariablesPredictive(_0x361570);emitVoiceQueueSummary(_0x361570);emitCampaignSummary(_0x361570);loggerSyncQueueSummary[_0xe6d5('0x99')](_0x38cb7b,util[_0xe6d5('0x9a')](_0x234c4f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1dd2b5,_0x3b0b3e){return function(_0x170f9e){loggerPredictive[_0xe6d5('0x99')](_0x3b0b3e[_0xe6d5('0x40')],_0x1dd2b5);loggerPredictive['error'](_0x170f9e[_0xe6d5('0x9b')]);freeVariablesPredictive(_0x3b0b3e);};}function loggerCatch(_0x47e173){return function(_0x18a991){logger['error'](_0x47e173,util[_0xe6d5('0x9a')](_0x18a991,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1fa6d5){return _0x1fa6d5&&!_[_0xe6d5('0x3d')](_0x1fa6d5)&&_0x1fa6d5[_0xe6d5('0x9c')]>0x0;}function decremetOriginate(_0x5da0a8){if(!_['isUndefined'](_0x5da0a8)&&_0x5da0a8!==null){if(_0x5da0a8[_0xe6d5('0x9d')](_0xe6d5('0x73'))){if(_0x5da0a8[_0xe6d5('0x73')]>0x0){_0x5da0a8[_0xe6d5('0x73')]-=0x1;}else{logger[_0xe6d5('0x99')](_0xe6d5('0x9e'));}}}else{logger[_0xe6d5('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x408998,_0x32e6df,_0x2803a9){if(_0x32e6df>_0x2803a9){for(var _0x167dcc=0x0;_0x167dcc<_0x32e6df-_0x2803a9;_0x167dcc+=0x1){decremetOriginate(_0x408998);}}}function loggerGetContactDialer(_0x115a90,_0x1ed8c8,_0x4708c1){return function(_0x3ddcd1){checkContactLowerLimitOriginate(_0x1ed8c8,_0x4708c1,0x0);logger[_0xe6d5('0x99')](_0x115a90,util[_0xe6d5('0x9a')](_0x3ddcd1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c1d9d){return function(_0x3a7024){if(isNotNull(_0x3a7024)&&isNotNull(_0x3a7024[0x0])){if(_0x3a7024[0x0][_0xe6d5('0x9f')]>0x0){_0x3c1d9d['message']=_0xe6d5('0xa0');logger[_0xe6d5('0x7e')]('[getContactDialer2][ReScheduled]'+_0x3c1d9d[_0xe6d5('0x40')],_0x3a7024[0x0][_0xe6d5('0x9f')],_0xe6d5('0xa1'));}else{_0x3c1d9d['message']=_0xe6d5('0xa2');logger['info'](_0xe6d5('0xa3')+_0x3c1d9d[_0xe6d5('0x40')]);}}};}function notSendMessagesQueue(_0x6feb){if(_0x6feb[_0xe6d5('0xa4')]){freeVariablesPredictive(_0x6feb);if(_0x6feb['originated']===0x0&&_0x6feb[_0xe6d5('0x57')]===0x0&&_0x6feb[_0xe6d5('0xa5')]===0x0&&(_0x6feb[_0xe6d5('0xa6')]||0x0)===0x0){_0x6feb[_0xe6d5('0xa4')]=![];_0x6feb[_0xe6d5('0x52')]=0x0;_0x6feb[_0xe6d5('0x3e')]=_0xe6d5('0x42');loggerSyncQueueSummary[_0xe6d5('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x6feb['name'],_0xe6d5('0xa7'));}else{_0x6feb[_0xe6d5('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xe6d5('0x99')](_0xe6d5('0xa8'),_0x6feb[_0xe6d5('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x6feb);}}function notSendMessagesCampaign(_0x4d136c){if(_0x4d136c['sendMessageOneNotActive']){if(_0x4d136c['originated']===0x0){_0x4d136c['sendMessageOneNotActive']=![];_0x4d136c[_0xe6d5('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xe6d5('0x99')](_0xe6d5('0xa9'),_0x4d136c[_0xe6d5('0x40')],_0xe6d5('0xa7'));}else{_0x4d136c[_0xe6d5('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xe6d5('0xa9'),_0x4d136c[_0xe6d5('0x40')],_0xe6d5('0xaa'));}emitCampaignSummary(_0x4d136c);}}function createObjHistory(_0x35b7e7,_0x390d23,_0x69a22c,_0x33ed1a,_0x152414){_0x35b7e7[_0xe6d5('0x3e')]=_0x69a22c;var _0x356d6f=new Action(_0x35b7e7,_0x390d23);var _0x5c423b=new History(_0x356d6f);_0x5c423b[_0xe6d5('0xab')]=_0x33ed1a;_0x5c423b['statedesc']=_0x152414;_0x5c423b[_0xe6d5('0xac')]=_0x356d6f['starttime'];return _0x5c423b;}Dialer[_0xe6d5('0x1c')][_0xe6d5('0x3c')]=function(){var _0x3e59df=this;setInterval(function(){_0x3e59df[_0xe6d5('0xad')](_0x3e59df[_0xe6d5('0x29')],_0xe6d5('0xae'));_0x3e59df[_0xe6d5('0xad')](_0x3e59df['actions'],_0xe6d5('0xaf'));},0x32c8);};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xad')]=function(_0x2bf957,_0x59e65a){var _0x2d6db7=this;for(var _0x49cddc in _0x2bf957){if(_0x2bf957['hasOwnProperty'](_0x49cddc)){this[_0xe6d5('0x1f')]['enqueue'](function(){if(!_[_0xe6d5('0xb0')](_0x2bf957[_0x49cddc])){return ami[_0xe6d5('0xb1')]({'action':'status','channel':_0x2bf957[_0x49cddc]['channel']})[_0xe6d5('0xb2')](function(_0x4a669d){if(_0x4a669d['message']===_0xe6d5('0xb3')){setTimeout(function(){if(_0x2bf957[_0x49cddc]&&_0x2bf957[_0x49cddc][_0xe6d5('0x4e')]!==_0xe6d5('0x95')){_0x2d6db7['updateOriginated'](_0x2d6db7[_0xe6d5('0x21')][_0x2bf957[_0x49cddc]['queue']]);logger[_0xe6d5('0x99')](_0xe6d5('0xb4'),_0x59e65a,_0x49cddc,_0x2bf957[_0x49cddc][_0xe6d5('0xb5')]);delete _0x2bf957[_0x49cddc];}if(_0x2bf957[_0x49cddc]&&_0x2bf957[_0x49cddc][_0xe6d5('0x4e')]===_0xe6d5('0x95')){_0x2d6db7[_0xe6d5('0xb6')](_0x2d6db7['campaigns'][_0x2bf957[_0x49cddc]['queue']]);logger[_0xe6d5('0x99')](_0xe6d5('0xb7'),_0x59e65a,_0x49cddc,_0x2bf957[_0x49cddc][_0xe6d5('0xb5')]);delete _0x2bf957[_0x49cddc];}},0x2328);}});}});}}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xb8')]=function(_0x57c9ea){return BPromise[_0xe6d5('0xb9')]()['then'](cmHopper['countReScheduled'](_0x57c9ea))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xba')));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xbb')]=function(_0x497470){return BPromise['resolve']()['then'](cmHopperBlack[_0xe6d5('0xbb')](_0x497470))[_0xe6d5('0xb2')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xbc')]=function(_0x4e1160){return BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](cmHopperBlack['checkIsBlackListIvr'](_0x4e1160))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xbe')));};Dialer[_0xe6d5('0x1c')]['averageHandleTime']=function(_0x28e299){return BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](cmHopperHistory[_0xe6d5('0xbf')](_0x28e299))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xc0')));};Dialer['prototype'][_0xe6d5('0xc1')]=function(_0x11d9b5){return BPromise[_0xe6d5('0xb9')]()['then'](cmHopper[_0xe6d5('0xc1')](_0x11d9b5))[_0xe6d5('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xc2')]=function(_0x541178,_0x9229f,_0x42a30b,_0x4ec74e){return BPromise['resolve']()[_0xe6d5('0xbd')](cmHopper[_0xe6d5('0xc2')](_0x541178,_0x9229f,_0x42a30b,_0x4ec74e))[_0xe6d5('0xb2')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xc3')]=function(_0x52dbd3,_0x72f532,_0x4e5d63){return BPromise['resolve']()[_0xe6d5('0xbd')](cmHopper[_0xe6d5('0xc3')](_0x52dbd3,_0x72f532,_0x4e5d63))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xc4')));};Dialer[_0xe6d5('0x1c')]['getVoiceQueueRtPauses']=function(_0xc69560){return BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](voiceQueueRt[_0xe6d5('0xc5')](_0xc69560))[_0xe6d5('0xb2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe6d5('0x1c')]['moveContactManagedDialer']=function(_0x1b77f3){return BPromise['resolve']()[_0xe6d5('0xbd')](cmHopper[_0xe6d5('0xc6')](_0x1b77f3))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xc7')));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xc8')]=function(_0x43f8ef){return BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](cmHopperHistory['createHistory'](_0x43f8ef))['catch'](loggerCatch(_0xe6d5('0xc9')));};Dialer[_0xe6d5('0x1c')]['updateOriginated']=function(_0x346adf){if(!_['isUndefined'](_0x346adf)&&_0x346adf!==null){if(_0x346adf[_0xe6d5('0x9d')]('originated')){if(_0x346adf[_0xe6d5('0x73')]>0x0){_0x346adf[_0xe6d5('0x73')]-=0x1;}else{logger[_0xe6d5('0x99')](_0xe6d5('0xca'));}}}else{logger[_0xe6d5('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x3c59ab,_0xb00856){var _0x55109a=this;return function(_0x549f66){_0x55109a[_0xe6d5('0xb6')](_0xb00856);logger[_0xe6d5('0x99')](_0x3c59ab,util[_0xe6d5('0x9a')](_0x549f66,{'showHidden':![],'depth':null}));};};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xcb')]=function(_0x228f01,_0x31e4fd,_0x144058){var _0x1fd4c6={'state':0x19,'statedesc':_0xe6d5('0xcc')};this[_0xe6d5('0xb6')](_0x31e4fd);this[_0xe6d5('0xcd')](_['merge'](_0x1fd4c6,_[_0xe6d5('0xce')](_0x144058,[_0xe6d5('0xcf'),'ListId',_0xe6d5('0xd0'),_0xe6d5('0xd1'),'CampaignId'])),_0xe6d5('0xd2'),_0xe6d5('0xd3'));logger[_0xe6d5('0x99')](_0x228f01);};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xd4')]=function(_0x2d29ff){return _0x2d29ff===_0xe6d5('0xd5');};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xd6')]=function(_0x36318d){return!_[_0xe6d5('0x3d')](_0x36318d)&&_0x36318d&&!_['isUndefined'](_0x36318d[_0xe6d5('0x40')])&&!_[_0xe6d5('0x3d')](_0x36318d[_0xe6d5('0xd7')])&&_0x36318d['active']&&(this[_0xe6d5('0x24')][util['format'](_0xe6d5('0xd8'),_0x36318d[_0xe6d5('0x40')])][_0xe6d5('0xd9')]===_0xe6d5('0xda')||this[_0xe6d5('0x24')][util[_0xe6d5('0x7b')](_0xe6d5('0xd8'),_0x36318d[_0xe6d5('0x40')])][_0xe6d5('0xd9')]===_0xe6d5('0xdb'));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xcd')]=function(_0x3c9866,_0x312ff9,_0x51c2d9){this[_0xe6d5('0xc8')](_0x3c9866)[_0xe6d5('0xb2')](loggerCatch(_0x312ff9));this[_0xe6d5('0xc6')](_0x3c9866)[_0xe6d5('0xb2')](loggerCatch(_0x51c2d9));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x37')]=function(_0x4dceb4){var _0x293e50=this[_0xe6d5('0x29')][_0x4dceb4[_0xe6d5('0xdc')]];var _0x16789e;if(!_[_0xe6d5('0xb0')](_0x4dceb4)&&!_[_0xe6d5('0xb0')](_0x4dceb4[_0xe6d5('0xdd')])&&!_['isNil'](_0x4dceb4['variable']['amdstatus'])&&_0x4dceb4['exten']==='xcally-motion-dialer'&&_0x293e50){if(_0x293e50[_0xe6d5('0x4e')]!==_0xe6d5('0x95')&&this['voiceQueues'][_0x293e50['queue']]['dialAMDActive']&&_0x4dceb4[_0xe6d5('0xde')]===_0xe6d5('0xdf')){delete this[_0xe6d5('0x29')][_0x4dceb4[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this[_0xe6d5('0x21')][_0x293e50['queue']]);this['voiceQueues'][_0x293e50[_0xe6d5('0xb5')]][_0xe6d5('0x61')]+=0x1;this[_0xe6d5('0x21')][_0x293e50['queue']][_0xe6d5('0x60')]+=0x1;_0x16789e=new Hangup(_0x293e50,_0x4dceb4);_0x16789e['state']=0x12;_0x16789e[_0xe6d5('0xe0')]=_0xe6d5('0xe1');_0x16789e[_0xe6d5('0xe2')]=_0xe6d5('0xe3');this[_0xe6d5('0xcd')](_0x16789e,_0xe6d5('0xe4'),_0xe6d5('0xe5'));}if(_0x293e50[_0xe6d5('0x4e')]!==_0xe6d5('0x95')&&this[_0xe6d5('0x21')][_0x293e50[_0xe6d5('0xb5')]]['dialAMDActive']&&_0x4dceb4[_0xe6d5('0xde')]===_0xe6d5('0xe6')){delete this[_0xe6d5('0x29')][_0x4dceb4[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this['voiceQueues'][_0x293e50[_0xe6d5('0xb5')]]);this[_0xe6d5('0x21')][_0x293e50['queue']][_0xe6d5('0x61')]+=0x1;this[_0xe6d5('0x21')][_0x293e50[_0xe6d5('0xb5')]][_0xe6d5('0x60')]+=0x1;_0x16789e=new Hangup(_0x293e50,_0x4dceb4);_0x16789e[_0xe6d5('0xab')]=0x13;_0x16789e['statedesc']=_0xe6d5('0xe7');_0x16789e[_0xe6d5('0xe2')]='AMD';_0x16789e[_0xe6d5('0xe8')]=!![];this[_0xe6d5('0xcd')](_0x16789e,'[syncMachine][createHistory]','[syncMachine]');}if(_0x293e50['type']===_0xe6d5('0x95')&&this[_0xe6d5('0x22')][_0x293e50[_0xe6d5('0xb5')]]['dialAMDActive']&&_0x4dceb4[_0xe6d5('0xde')]===_0xe6d5('0xdf')){delete this[_0xe6d5('0x29')][_0x4dceb4['uniqueid']];this[_0xe6d5('0xb6')](this[_0xe6d5('0x22')][_0x293e50[_0xe6d5('0xb5')]]);_0x16789e=new Hangup(_0x293e50,_0x4dceb4);_0x16789e[_0xe6d5('0xab')]=0x12;_0x16789e['statedesc']=_0xe6d5('0xe1');_0x16789e[_0xe6d5('0xe2')]='AMD';this[_0xe6d5('0xcd')](_0x16789e,_0xe6d5('0xe9'),_0xe6d5('0xea'));}if(_0x293e50[_0xe6d5('0x4e')]===_0xe6d5('0x95')&&this[_0xe6d5('0x22')][_0x293e50[_0xe6d5('0xb5')]]['dialAMDActive']&&_0x4dceb4[_0xe6d5('0xde')]===_0xe6d5('0xe6')){delete this[_0xe6d5('0x29')][_0x4dceb4[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this[_0xe6d5('0x22')][_0x293e50[_0xe6d5('0xb5')]]);_0x16789e=new Hangup(_0x293e50,_0x4dceb4);_0x16789e[_0xe6d5('0xab')]=0x13;_0x16789e[_0xe6d5('0xe0')]=_0xe6d5('0xe7');_0x16789e['membername']=_0xe6d5('0xe3');_0x16789e['amd']=!![];this[_0xe6d5('0xcd')](_0x16789e,_0xe6d5('0xeb'),_0xe6d5('0xec'));}}};Dialer[_0xe6d5('0x1c')]['syncHangup']=function(_0x478658){var _0x389a7c=this['uniqueId'][_0x478658[_0xe6d5('0xdc')]];var _0x3b10cb=this;var _0x45815b;if(_0x389a7c&&_0x389a7c[_0xe6d5('0x4e')]==='ivr'){delete this[_0xe6d5('0x29')][_0x478658['uniqueid']];this['updateOriginated'](this[_0xe6d5('0x22')][_0x389a7c[_0xe6d5('0xb5')]]);this[_0xe6d5('0x22')][_0x389a7c[_0xe6d5('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x45815b=new Hangup(_0x389a7c,_0x478658);this[_0xe6d5('0xc8')](_0x45815b)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xed')));this[_0xe6d5('0xc6')](_0x45815b)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xee')));}if(_0x389a7c&&_0x389a7c[_0xe6d5('0x4e')]!==_0xe6d5('0x95')&&isNotNull(this['voiceQueues'][_0x389a7c[_0xe6d5('0xb5')]]['dialQueueProject'])){delete this[_0xe6d5('0x29')][_0x478658[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this['voiceQueues'][_0x389a7c[_0xe6d5('0xb5')]]);this[_0xe6d5('0x21')][_0x389a7c[_0xe6d5('0xb5')]][_0xe6d5('0x61')]+=0x1;this['voiceQueues'][_0x389a7c[_0xe6d5('0xb5')]][_0xe6d5('0x60')]+=0x1;_0x45815b=new Hangup(_0x389a7c,_0x478658);_0x45815b['state']=0x10;_0x45815b[_0xe6d5('0xe0')]='AnswerAGI';_0x45815b['membername']=_0xe6d5('0xef');this[_0xe6d5('0xc8')](_0x45815b)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xed')));this[_0xe6d5('0xc6')](_0x45815b)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xee')));}if(_0x389a7c&&_0x389a7c[_0xe6d5('0x4e')]!==_0xe6d5('0x95')&&!isNotNull(this['voiceQueues'][_0x389a7c[_0xe6d5('0xb5')]]['dialQueueProject'])){delete this[_0xe6d5('0x29')][_0x478658[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this[_0xe6d5('0x21')][_0x389a7c[_0xe6d5('0xb5')]]);this[_0xe6d5('0x21')][_0x389a7c[_0xe6d5('0xb5')]][_0xe6d5('0x69')]+=0x1;_0x45815b=new Hangup(_0x389a7c,_0x478658);_0x45815b[_0xe6d5('0xab')]=0xc;_0x45815b['statedesc']=_0x478658[_0xe6d5('0xf0')];_0x45815b[_0xe6d5('0xe2')]='Unknow';this[_0xe6d5('0xc8')](_0x45815b)['catch'](loggerCatch(_0xe6d5('0xed')));this['moveContactManagedDialer'](_0x45815b)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xee')));}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x33')]=function(_0x58660e){var _0x547535=this['uniqueId'][_0x58660e[_0xe6d5('0xdc')]];var _0xed3dd1=this;if(this[_0xe6d5('0x21')][_0x58660e['queue']]){if(_0x547535&&_0x547535[_0xe6d5('0x4e')]!==_0xe6d5('0x95')){delete this['uniqueId'][_0x58660e['uniqueid']];this[_0xe6d5('0x21')][_0x58660e[_0xe6d5('0xb5')]][_0xe6d5('0x61')]+=0x1;var _0x428b1c=new AgentComplete(_0x547535,_0x58660e);if(_0x58660e['reason']===_0xe6d5('0xf1')){_0x428b1c[_0xe6d5('0xf2')]=this[_0xe6d5('0x21')][_0x58660e[_0xe6d5('0xb5')]]['dialQueueProject2']&&this['voiceQueues'][_0x58660e[_0xe6d5('0xb5')]][_0xe6d5('0xf3')]?moment()[_0xe6d5('0x7b')](_0xe6d5('0xf4')):undefined;}this['createHistory'](_0x428b1c)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xf5')));this[_0xe6d5('0xc6')](_0x428b1c)['catch'](loggerCatch(_0xe6d5('0xf6')));}}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x2f')]=function(_0x3fd9f7){if(this[_0xe6d5('0x21')][_0x3fd9f7[_0xe6d5('0xb5')]]){if(this[_0xe6d5('0x29')][_0x3fd9f7['uniqueid']]&&this[_0xe6d5('0x29')][_0x3fd9f7[_0xe6d5('0xdc')]][_0xe6d5('0x4e')]!==_0xe6d5('0x95')){this['updateOriginated'](this[_0xe6d5('0x21')][_0x3fd9f7[_0xe6d5('0xb5')]]);this[_0xe6d5('0x29')][_0x3fd9f7[_0xe6d5('0xdc')]]['answertime']=moment()['format'](_0xe6d5('0xf4'));}}};Dialer['prototype'][_0xe6d5('0xf7')]=function(_0x5260e3){this[_0xe6d5('0xc8')](_0x5260e3)['catch'](loggerCatch(_0xe6d5('0xf5')));this[_0xe6d5('0xc6')](_0x5260e3)['catch'](loggerCatch(_0xe6d5('0xf8')));};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xf9')]=function(_0x5cf78e){var _0xf797ce=this[_0xe6d5('0x29')][_0x5cf78e[_0xe6d5('0xdc')]];var _0xf42af5=this;if(this[_0xe6d5('0x21')][_0x5cf78e[_0xe6d5('0xb5')]]){if(_0xf797ce&&_0xf797ce['type']!==_0xe6d5('0x95')){delete this[_0xe6d5('0x29')][_0x5cf78e[_0xe6d5('0xdc')]];this[_0xe6d5('0xb6')](this[_0xe6d5('0x21')][_0x5cf78e[_0xe6d5('0xb5')]]);_0xf797ce[_0xe6d5('0xfa')]=moment()['format'](_0xe6d5('0xf4'));var _0x509b3d=new QueueCallerAbandon(_0xf797ce,_0x5cf78e);if(getSeconds(_0xf797ce[_0xe6d5('0xfa')],_0xf797ce[_0xe6d5('0xfb')])>=_0xf797ce[_0xe6d5('0xfc')]){this[_0xe6d5('0x21')][_0x5cf78e['queue']][_0xe6d5('0x6d')]+=0x1;this[_0xe6d5('0x21')][_0x5cf78e[_0xe6d5('0xb5')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xe6d5('0x21')][_0x5cf78e['queue']][_0xe6d5('0xfd')]+=0x1;_0x509b3d[_0xe6d5('0xab')]=0xa;_0x509b3d['statedesc']=_0xe6d5('0xfe');_0x509b3d[_0xe6d5('0xff')]=_0xe6d5('0x100');_0x509b3d[_0xe6d5('0xf2')]=this[_0xe6d5('0x21')][_0x5cf78e[_0xe6d5('0xb5')]][_0xe6d5('0x101')]?moment()[_0xe6d5('0x7b')](_0xe6d5('0xf4')):undefined;this['queueCallerAbandonCreateState'](_0x509b3d);}else{this['voiceQueues'][_0x5cf78e['queue']][_0xe6d5('0x6c')]+=0x1;this[_0xe6d5('0x21')][_0x5cf78e['queue']][_0xe6d5('0x65')]+=0x1;_0x509b3d[_0xe6d5('0xab')]=0xb;_0x509b3d['statedesc']=_0xe6d5('0x102');_0x509b3d[_0xe6d5('0xff')]=_0xe6d5('0x103');this['queueCallerAbandonCreateState'](_0x509b3d);}}}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x104')]=function(_0x1230c5){if(this[_0xe6d5('0x27')][_0x1230c5['uniqueid']]){this['actions'][_0x1230c5[_0xe6d5('0xdc')]][_0xe6d5('0x105')]=_0x1230c5['channel'];}if(this['uniqueId'][_0x1230c5[_0xe6d5('0xdc')]]){this['uniqueId'][_0x1230c5['uniqueid']][_0xe6d5('0x105')]=_0x1230c5[_0xe6d5('0x105')];}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x38')]=function(_0xce31b8){if(strategy[this[_0xe6d5('0x21')][this['actions'][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0xb5')]][_0xe6d5('0x50')]]===_0xe6d5('0x1b')){if(this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]]&&_[_0xe6d5('0xb0')](this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0x107')])&&_0xce31b8['status']==='1'&&_0xce31b8[_0xe6d5('0x108')]==='0'){if(this[_0xe6d5('0x23')][_0xce31b8[_0xe6d5('0x109')]]){if(!this['agents'][_0xce31b8[_0xe6d5('0x109')]]['locked']){this['agents'][_0xce31b8[_0xe6d5('0x109')]]['locked']=!![];this['actions'][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0x107')]=!![];this['actions'][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0x109')]=_0xce31b8[_0xe6d5('0x109')];}}}}else if((strategy[this[_0xe6d5('0x21')][this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0xb5')]][_0xe6d5('0x50')]]||_0xe6d5('0x1a'))===_0xe6d5('0x1a')){if(this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]]){if(this[_0xe6d5('0x23')][_0xce31b8['stateinterface']]){this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0x109')]=_0xce31b8[_0xe6d5('0x109')];if(_[_0xe6d5('0xb0')](this[_0xe6d5('0x2d')][this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0xb5')]])){this['queueBooked'][this['actions'][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]=[];}this[_0xe6d5('0x2d')][this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]['push'](_[_0xe6d5('0x8f')](_[_0xe6d5('0xce')](this[_0xe6d5('0x27')][_0xce31b8[_0xe6d5('0x106')]],['idHopper',_0xe6d5('0x109')]),{'status':_0xce31b8[_0xe6d5('0xd9')],'paused':_0xce31b8[_0xe6d5('0x108')]}));}}}};function unlockQueueStatus(_0x538bf0,_0x3d6d6b){setTimeout(function(){if(_[_0xe6d5('0x3d')](_0x538bf0[_0xe6d5('0x10a')])){loggerBooked['error'](_0xe6d5('0x10b'),_0x3d6d6b);}_0x538bf0[_0xe6d5('0x10a')]=!![];loggerBooked[_0xe6d5('0x7e')](_0xe6d5('0x10c'),_0x3d6d6b,JSON[_0xe6d5('0x4a')](_[_0xe6d5('0xce')](_0x538bf0,[_0xe6d5('0x40'),_0xe6d5('0x10a')])));},0x1f3);}Dialer[_0xe6d5('0x1c')][_0xe6d5('0x3a')]=function(_0x436561){var _0x6393ef=this;var _0x1d6ef2=_0x6393ef[_0xe6d5('0x21')][_0x6393ef[_0xe6d5('0x27')][_0x436561['actionid']][_0xe6d5('0xb5')]];if(strategy[this[_0xe6d5('0x21')][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]][_0xe6d5('0x50')]]===_0xe6d5('0x1b')){if(this['actions'][_0x436561['actionid']]&&this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0x109')]){this['preview'][_0xe6d5('0x10d')](this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]]['idHopper'],this['actions'][_0x436561[_0xe6d5('0x106')]]['stateinterface'])[_0xe6d5('0xb2')](function(_0x1cf09e){logger[_0xe6d5('0x99')](_0xe6d5('0x10e'),util['inspect'](_0x1cf09e,{'showHidden':![],'depth':null}));})[_0xe6d5('0x10f')](function(){_0x6393ef[_0xe6d5('0xb6')](_0x6393ef[_0xe6d5('0x21')][_0x6393ef[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]);_0x6393ef['agents'][_0x6393ef[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]]['stateinterface']][_0xe6d5('0x107')]=![];delete _0x6393ef['actions'][_0x436561['actionid']];unlockQueueStatus(_0x1d6ef2);});}else{this[_0xe6d5('0xb6')](this[_0xe6d5('0x21')][this['actions'][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xcf')],'ListId':this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0x110')],'VoiceQueueId':this['actions'][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xd1')]||undefined,'CampaignId':this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0x111')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]];unlockQueueStatus(_0x1d6ef2);}}else if((strategy[this['voiceQueues'][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]][_0xe6d5('0x50')]]||_0xe6d5('0x1a'))===_0xe6d5('0x1a')){var _0x47ef2a;if(this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]]&&!_[_0xe6d5('0x48')](this[_0xe6d5('0x2d')][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]])){if(this[_0xe6d5('0x112')][_0x6393ef[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]){this[_0xe6d5('0x112')][_0x6393ef['actions'][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]=this[_0xe6d5('0x112')][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]]['queue']]?this[_0xe6d5('0x112')][this[_0xe6d5('0x27')][_0x436561['actionid']][_0xe6d5('0xb5')]]:this[_0xe6d5('0x2d')][this['actions'][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]]?this[_0xe6d5('0x2d')][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]][_0xe6d5('0xb5')]][_0xe6d5('0x113')]||0x0:0x0;}this[_0xe6d5('0x2d')][this[_0xe6d5('0x27')][_0x436561['actionid']][_0xe6d5('0xb5')]][_0xe6d5('0x113')]=this[_0xe6d5('0x112')][this[_0xe6d5('0x27')][_0x436561[_0xe6d5('0x106')]]['queue']];for(var _0x105874=0x0;_0x105874=0x0?!![]:![];})[_0xe6d5('0xb2')](myreject(_0x38783f)));}}else{_0x38b16e[_0xe6d5('0x130')](ami[_0xe6d5('0xb1')]({'action':_0xe6d5('0x12b'),'command':util[_0xe6d5('0x7b')](_0xe6d5('0x12c'),_0x134737,!_[_0xe6d5('0x3d')](config[_0xe6d5('0x127')][_0x5ee8c8])?_0x5ee8c8:'')})[_0xe6d5('0xbd')](function(_0x5a1d82){return _0x5a1d82['content'][_0xe6d5('0x12e')](_0xe6d5('0x12f'))>=0x0?!![]:![];})['catch'](myreject(_0x38783f)));}BPromise[_0xe6d5('0x131')](_0x38b16e)[_0xe6d5('0xbd')](function(_0x3bad21){var _0x219fe8=_[_0xe6d5('0x132')](_0x3bad21);if(_0x219fe8){return _0x2d7198(_0x219fe8);}else{_0x39583d[_0xe6d5('0x3e')]=_0xb8dd98?_0xe6d5('0x133'):_0xe6d5('0x134');return _0x38783f(msgResponse('[ifTime][promiseAll]',_0xe6d5('0x124'),_0xe6d5('0x135')+_0xb8dd98+'\x20'+_0xccd5d+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x134737,{'showHidden':![],'depth':null})+_0xe6d5('0x136')+_0x5ee8c8));}})[_0xe6d5('0xb2')](function(_0x1b7745){return _0x38783f(msgResponse(_0xe6d5('0x123'),_0xe6d5('0x124'),JSON[_0xe6d5('0x4a')](_0x1b7745)));});});};Dialer[_0xe6d5('0x1c')]['checkDialMethod']=function(_0x3ae023){var _0x163a05=this;return function(){switch(_0x3ae023[_0xe6d5('0x5d')]){case'progressive':freeVariablesPredictive(_0x3ae023);_0x163a05[_0xe6d5('0x137')](_0x3ae023,0x1);break;case _0xe6d5('0x138'):freeVariablesPredictive(_0x3ae023);_0x163a05[_0xe6d5('0x137')](_0x3ae023,_0x3ae023[_0xe6d5('0x139')]);break;case _0xe6d5('0x13a'):_0x163a05[_0xe6d5('0x13a')](_0x3ae023);break;case _0xe6d5('0x13b'):freeVariablesPredictive(_0x3ae023);_0x163a05['handlePower'](_0x3ae023,0x1);break;default:freeVariablesPredictive(_0x3ae023);logger[_0xe6d5('0x99')](_0xe6d5('0x13c'),_0x3ae023[_0xe6d5('0x40')],_0xe6d5('0x13d'));}};};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x13e')]=function(_0x30add5){var _0x52a006=this;return function(){_0x52a006[_0xe6d5('0x13f')](_0x30add5);};};Dialer[_0xe6d5('0x1c')][_0xe6d5('0xa')]=function(_0x461ac1){var _0x4563d7=this;if(isNotPreview(_0x461ac1[_0xe6d5('0x5d')])){if(isVoiceQueueOutbound(_0x461ac1[_0xe6d5('0x4e')])&&isActive(_0x461ac1['dialActive'])){_0x461ac1[_0xe6d5('0xa4')]=!![];BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](checkIsLoggedIn(_0x461ac1,_0x461ac1[_0xe6d5('0x53')]))[_0xe6d5('0xbd')](checkIsActive(_0x461ac1,_0x461ac1[_0xe6d5('0x5c')]))[_0xe6d5('0xbd')](checkInterval(_0x461ac1))['then'](_0x4563d7[_0xe6d5('0x11e')](_0x461ac1))[_0xe6d5('0xbd')](_0x4563d7[_0xe6d5('0x121')](_0x461ac1[_0xe6d5('0x140')],_0x461ac1[_0xe6d5('0x141')],_0x461ac1[_0xe6d5('0x40')],_0x461ac1))[_0xe6d5('0xbd')](_0x4563d7['checkIfTimeIntervals'](_0x461ac1['Interval'],_0x461ac1[_0xe6d5('0x141')],_0x461ac1[_0xe6d5('0x40')],_0x461ac1))[_0xe6d5('0xbd')](_0x4563d7[_0xe6d5('0x142')](_0x461ac1))[_0xe6d5('0xb2')](loggerCatchQueueSummary(_0xe6d5('0x143'),_0x461ac1));}else{notSendMessagesQueue(_0x461ac1);}}else{freeVariablesPredictive(_0x461ac1);}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x11d')]=function(){var _0x27cce8=this;var _0xd673a8;for(var _0x563d38 in this['campaigns']){if(this[_0xe6d5('0x22')][_0xe6d5('0x9d')](_0x563d38)){_0xd673a8=this[_0xe6d5('0x22')][_0x563d38];if(isCampaignIvr(_0xd673a8[_0xe6d5('0x4e')])&&isActive(_0xd673a8[_0xe6d5('0xd7')])){_0xd673a8[_0xe6d5('0xa4')]=!![];BPromise[_0xe6d5('0xb9')]()[_0xe6d5('0xbd')](checkIsActive(_0xd673a8,_0xd673a8[_0xe6d5('0xd7')]))[_0xe6d5('0xbd')](checkInterval(_0xd673a8))[_0xe6d5('0xbd')](_0x27cce8[_0xe6d5('0x11e')](_0xd673a8))[_0xe6d5('0xbd')](_0x27cce8['checkIfTime'](_0xd673a8[_0xe6d5('0x140')],_0xd673a8[_0xe6d5('0x141')],_0xd673a8[_0xe6d5('0x40')],_0xd673a8))['then'](_0x27cce8[_0xe6d5('0x122')](_0xd673a8['Interval'],_0xd673a8[_0xe6d5('0x141')],_0xd673a8[_0xe6d5('0x40')],_0xd673a8))[_0xe6d5('0xbd')](_0x27cce8['launchHandleIvr'](_0xd673a8))[_0xe6d5('0xb2')](loggerCatchQueueSummary('[syncCampaigns]',_0xd673a8));}else{notSendMessagesCampaign(_0xd673a8);}}}};function getCallerIdRandom(_0x33331d,_0x2039c2){var _0x545b57,_0x67f5dc,_0x3153d7;if(_0x2039c2<=0x0){_0x2039c2=0x1;}_0x545b57=new RegExp(_0xe6d5('0x144')+_0x2039c2+'}$');_0x67f5dc=Math[_0xe6d5('0x145')](0xa,_0x2039c2-0x1);_0x3153d7=Math[_0xe6d5('0x145')](0xa,_0x2039c2)-0x1;return util[_0xe6d5('0x7b')]('%s',_['replace'](_0x33331d,_0x545b57,_[_0xe6d5('0x146')](_0x67f5dc,_0x3153d7)));}function extractCalleridName(_0x84a227){var _0x4ebf60=_0x84a227[_0xe6d5('0x147')](/"(.*?)"/);return _0x4ebf60?_0x4ebf60[0x1]:_0x84a227;}function extractCalleridNumber(_0x2a502a){var _0x45f811=_0x2a502a['match'](/<(.*?)>/);return _0x45f811?_0x45f811[0x1]:_0x2a502a;}Dialer[_0xe6d5('0x1c')]['actionOriginate']=function(_0x15d2eb,_0x381599){var _0x402068=this;var _0x26052d=uuid['v4']();this['actions'][_0x26052d]=new Action(_0x15d2eb,_0x381599,_0x26052d);return new BPromise(function(_0x128880,_0x4ff39f){if(_['isUndefined'](_0x15d2eb)&&'object'!==typeof _0x15d2eb){return _0x4ff39f(msgResponse(_0xe6d5('0x148'),_0xe6d5('0x124'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x381599[_0xe6d5('0x149')][_0xe6d5('0x14a')])||_0x381599[_0xe6d5('0x149')][_0xe6d5('0x14a')]===null){return _0x4ff39f(msgResponse('originate',_0xe6d5('0x124'),'contact\x20is\x20undefine'));}var _0x595480={'XMD-CALLERID':_0x402068[_0xe6d5('0x27')][_0x26052d][_0xe6d5('0x14b')](),'XMD-AGI':_0x15d2eb[_0xe6d5('0x14c')]?util[_0xe6d5('0x7b')](_0xe6d5('0x14d'),ipAgi,_0x15d2eb[_0xe6d5('0x14c')]):_0xe6d5('0x14e'),'XMD-AGIAFTER':_0x15d2eb[_0xe6d5('0x101')]?util[_0xe6d5('0x7b')](_0xe6d5('0x14d'),ipAgi,_0x15d2eb[_0xe6d5('0x101')]):_0xe6d5('0x14e'),'XMD-QUEUE':_0x15d2eb[_0xe6d5('0x4e')]===_0xe6d5('0x4f')?util['format'](_0xe6d5('0x14f'),_0x15d2eb[_0xe6d5('0x40')],_0x15d2eb[_0xe6d5('0x150')]||'',_0x15d2eb[_0xe6d5('0xf3')]?'c':'',_0x15d2eb['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x381599[_0xe6d5('0xcf')],'XMD-CDRTYPE':_0xe6d5('0x8'),'CALLERID(all)':_0x402068[_0xe6d5('0x27')][_0x26052d][_0xe6d5('0x14b')](),'XMD-AMD':_0x15d2eb[_0xe6d5('0x151')]?_0xe6d5('0x152'):_0xe6d5('0x14e'),'XMD-DESTINATION':_0xe6d5('0x153')};if(_0x15d2eb[_0xe6d5('0x151')]){_0x595480[_0xe6d5('0x154')]=_0x15d2eb[_0xe6d5('0x155')]||0x9c4;_0x595480[_0xe6d5('0x156')]=_0x15d2eb[_0xe6d5('0x157')]||0x5dc;_0x595480['XMD-AMDAFTERGREETINGSILENCE']=_0x15d2eb[_0xe6d5('0x158')]||0x320;_0x595480[_0xe6d5('0x159')]=_0x15d2eb[_0xe6d5('0x15a')]||0x1388;_0x595480['XMD-AMDMINWORDLENGTH']=_0x15d2eb[_0xe6d5('0x15b')]||0x64;_0x595480[_0xe6d5('0x15c')]=_0x15d2eb[_0xe6d5('0x15d')]||0x32;_0x595480['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x15d2eb[_0xe6d5('0x15e')]||0x3;_0x595480[_0xe6d5('0x15f')]=_0x15d2eb[_0xe6d5('0x160')]||0x100;_0x595480['XMD-AMDMAXIMUMWORDLENGTH']=_0x15d2eb[_0xe6d5('0x161')]||0x1388;}if(_0x15d2eb['type']===_0xe6d5('0x4f')){_0x595480[_0xe6d5('0x162')]=_0x381599['VoiceQueueId'];}else{_0x595480[_0xe6d5('0x163')]=_0x381599['CampaignId'];}for(var _0x144ad3 in _0x381599[_0xe6d5('0x149')]){if(_0x381599[_0xe6d5('0x149')][_0xe6d5('0x9d')](_0x144ad3)){if(isNotNull(_0x381599[_0xe6d5('0x149')][_0x144ad3])&&_0x144ad3!=='id'&&_0x144ad3!==_0xe6d5('0x164')&&_0x144ad3!=='createdAt'&&_0x144ad3!==_0xe6d5('0x165')){_0x595480[util[_0xe6d5('0x7b')](_0xe6d5('0x166'),_0xe6d5('0x167'),_[_0xe6d5('0x168')](_0x144ad3))]=_0x381599[_0xe6d5('0x149')][_0x144ad3];}}}var _0x537f92=_0x402068[_0xe6d5('0xd6')](_0x15d2eb[_0xe6d5('0x77')])?getCallerId(_0x15d2eb[_0xe6d5('0x77')][_0xe6d5('0x78')],_0x15d2eb[_0xe6d5('0x5e')],_0x15d2eb['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x15d2eb[_0xe6d5('0x169')],_0x15d2eb['dialRandomLastDigitCallerIdNumber']):_0x15d2eb['dialOriginateCallerIdNumber']):getCallerId(_[_0xe6d5('0xb0')](_0x15d2eb[_0xe6d5('0x11f')])?_0x15d2eb[_0xe6d5('0x77')][_0xe6d5('0x78')]:_0x15d2eb[_0xe6d5('0x11f')][_0xe6d5('0x78')],_0x15d2eb['dialOriginateCallerIdName'],_0x15d2eb[_0xe6d5('0x16a')]>0x0?getCallerIdRandom(_0x15d2eb[_0xe6d5('0x169')],_0x15d2eb['dialRandomLastDigitCallerIdNumber']):_0x15d2eb[_0xe6d5('0x169')]);if(_0x537f92){_0x595480[_0xe6d5('0x16b')]=_0x402068[_0xe6d5('0x27')][_0x26052d][_0xe6d5('0x16c')]=extractCalleridName(_0x537f92);_0x595480[_0xe6d5('0x16d')]=_0x402068['actions'][_0x26052d][_0xe6d5('0x16e')]=extractCalleridNumber(_0x537f92);}return ami['Action']({'actionid':_0x26052d,'action':'originate','channel':_0x402068['isTrunkReachable'](_0x15d2eb[_0xe6d5('0x77')])?util[_0xe6d5('0x7b')](_0xe6d5('0x16f'),_0x15d2eb[_0xe6d5('0x77')][_0xe6d5('0x40')],isNotNull(_0x15d2eb[_0xe6d5('0x170')])?_0x15d2eb[_0xe6d5('0x170')]['trim']()||'':'',_0x15d2eb[_0xe6d5('0x171')]>0x0?_0x381599[_0xe6d5('0x149')][_0xe6d5('0x14a')][_0xe6d5('0x172')](_0x15d2eb[_0xe6d5('0x171')]):_0x381599[_0xe6d5('0x149')][_0xe6d5('0x14a')]):util[_0xe6d5('0x7b')](_0xe6d5('0x16f'),_['isNil'](_0x15d2eb['TrunkBackup'])?_0x15d2eb[_0xe6d5('0x77')][_0xe6d5('0x40')]:_0x15d2eb['TrunkBackup'][_0xe6d5('0x40')],isNotNull(_0x15d2eb[_0xe6d5('0x170')])?_0x15d2eb[_0xe6d5('0x170')]['trim']()||'':'',_0x15d2eb[_0xe6d5('0x171')]>0x0?_0x381599[_0xe6d5('0x149')][_0xe6d5('0x14a')][_0xe6d5('0x172')](_0x15d2eb[_0xe6d5('0x171')]):_0x381599[_0xe6d5('0x149')]['phone']),'callerid':_0x537f92,'Exten':_0xe6d5('0x153'),'Context':'from-sip','Priority':'1','variable':_0x595480,'timeout':(_0x15d2eb[_0xe6d5('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x26052d})['then'](function(_0x584a81){return _0x128880(_0x584a81);})[_0xe6d5('0xb2')](function(_0x14f721){_0x15d2eb[_0xe6d5('0x68')]+=0x1;var _0x43bfe1=new History(_0x402068[_0xe6d5('0x27')][_0x26052d]);logger['error'](util[_0xe6d5('0x7b')]('[originateError]:\x20%s',JSON[_0xe6d5('0x4a')](_0x14f721)));_0x43bfe1[_0xe6d5('0xab')]=0xe;_0x43bfe1[_0xe6d5('0xe0')]=_0xe6d5('0x173');_0x43bfe1[_0xe6d5('0x174')]=moment()[_0xe6d5('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x43bfe1[_0xe6d5('0xac')]=_0x43bfe1[_0xe6d5('0x174')];_0x402068['createHistory'](_0x43bfe1)['catch'](loggerCatch(_0xe6d5('0x175')));_0x402068[_0xe6d5('0xc6')](_0x43bfe1)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x175')))[_0xe6d5('0x10f')](function(){delete _0x402068[_0xe6d5('0x27')][_0x26052d];return _0x4ff39f(msgResponse(_0xe6d5('0x148'),_0xe6d5('0x176'),_0xe6d5('0x177')));});});});};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x178')]=function(_0x46a1ad){var _0x9e63c9=this['actions'][_0x46a1ad[_0xe6d5('0x106')]];var _0x239be0=this;if(_0x9e63c9){delete this['actions'][_0x46a1ad[_0xe6d5('0x106')]];_0x9e63c9[_0xe6d5('0xfb')]=moment()[_0xe6d5('0x7b')](_0xe6d5('0xf4'));var _0x8dd34d=_0x9e63c9[_0xe6d5('0x4e')]===_0xe6d5('0x95')?this[_0xe6d5('0x22')][_0x9e63c9[_0xe6d5('0xb5')]]:this['voiceQueues'][_0x9e63c9[_0xe6d5('0x179')]()];if(!this[_0xe6d5('0xd4')](_0x46a1ad[_0xe6d5('0x17a')])){this[_0xe6d5('0xb6')](_0x8dd34d);return this[_0xe6d5('0x17b')](_0x9e63c9,_0x8dd34d,_0x46a1ad)[_0xe6d5('0xbd')](function(_0x359c03){})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x17c')));}else{this[_0xe6d5('0x29')][_0x46a1ad[_0xe6d5('0xdc')]]=_0x9e63c9;}}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x17d')]=function(_0x3aa62c,_0x3de09a,_0x33cb5b){var _0xd561cf=new History(_0x3de09a);if(_0xd561cf[_0xe6d5('0x17e')]+_0xd561cf[_0xe6d5('0x17f')]+_0xd561cf[_0xe6d5('0x180')]>=_0x33cb5b[_0xe6d5('0x181')]-0x1){return!![];}switch(_0x3aa62c){case 0x3:if(_0xd561cf[_0xe6d5('0x180')]>=_0x33cb5b[_0xe6d5('0x182')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0xd561cf[_0xe6d5('0x180')]+=0x1,'scheduledat':moment()[_0xe6d5('0x183')](_0x33cb5b['dialNoAnswerRetryFrequency'],'minutes')['format'](_0xe6d5('0xf4')),'ContactId':_0xd561cf[_0xe6d5('0xcf')],'ListId':_0xd561cf[_0xe6d5('0x110')],'VoiceQueueId':_0xd561cf['VoiceQueueId']||undefined,'CampaignId':_0xd561cf[_0xe6d5('0x111')]||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x184')));}break;case 0x5:if(_0xd561cf[_0xe6d5('0x17e')]>=_0x33cb5b['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xe6d5('0xc1')]({'active':![],'countbusyretry':_0xd561cf[_0xe6d5('0x17e')]+=0x1,'scheduledat':moment()[_0xe6d5('0x183')](_0x33cb5b[_0xe6d5('0x185')],_0xe6d5('0x186'))[_0xe6d5('0x7b')](_0xe6d5('0xf4')),'ContactId':_0xd561cf[_0xe6d5('0xcf')],'ListId':_0xd561cf[_0xe6d5('0x110')],'VoiceQueueId':_0xd561cf[_0xe6d5('0xd1')]||undefined,'CampaignId':_0xd561cf['CampaignId']||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x187')));}break;case 0x8:if(_0xd561cf[_0xe6d5('0x17f')]>=_0x33cb5b[_0xe6d5('0x188')]-0x1){return!![];}else{this[_0xe6d5('0xc1')]({'active':![],'countcongestionretry':_0xd561cf[_0xe6d5('0x17f')]+=0x1,'scheduledat':moment()[_0xe6d5('0x183')](_0x33cb5b[_0xe6d5('0x189')],_0xe6d5('0x186'))['format'](_0xe6d5('0xf4')),'ContactId':_0xd561cf[_0xe6d5('0xcf')],'ListId':_0xd561cf[_0xe6d5('0x110')],'VoiceQueueId':_0xd561cf[_0xe6d5('0xd1')]||undefined,'CampaignId':_0xd561cf[_0xe6d5('0x111')]||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x18a')));}break;default:return!![];}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x17b')]=function(_0x3c4d9d,_0x43e6a5,_0x23ec2d){var _0x5cfed8=this;var _0x1ec3b8=new History(_0x3c4d9d);return new BPromise(function(_0x2f0f85,_0x147a56){if(_[_0xe6d5('0x3d')](_0x43e6a5)&&_0xe6d5('0x18b')!==typeof _0x43e6a5){return _0x147a56(msgResponse('[callProgressDetecting]',_0xe6d5('0x124'),_0xe6d5('0x18c')));}if(_[_0xe6d5('0x3d')](_0x23ec2d)&&_0xe6d5('0x18b')!==typeof _0x23ec2d){return _0x147a56(msgResponse(_0xe6d5('0x18d'),_0xe6d5('0x124'),_0xe6d5('0x18e')));}switch(_0x23ec2d[_0xe6d5('0x18f')]){case'0':_0x43e6a5[_0xe6d5('0x190')]+=0x1;_0x1ec3b8[_0xe6d5('0xab')]=0x0;_0x1ec3b8['statedesc']=_0xe6d5('0x191');_0x5cfed8['createHistory'](_0x1ec3b8)[_0xe6d5('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5cfed8[_0xe6d5('0x17d')](0x0,_0x3c4d9d,_0x43e6a5)){if(_0x1ec3b8[_0xe6d5('0x17e')]+_0x1ec3b8['countcongestionretry']+_0x1ec3b8[_0xe6d5('0x180')]>=_0x43e6a5[_0xe6d5('0x181')]){_0x5cfed8[_0xe6d5('0x192')](_0x1ec3b8,_0x2f0f85,_0x147a56,'reason\x200\x20no\x20such\x20number....');}else{_0x5cfed8[_0xe6d5('0x193')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x194'));}}break;case'3':_0x43e6a5[_0xe6d5('0x67')]+=0x1;_0x1ec3b8[_0xe6d5('0xab')]=0x3;_0x1ec3b8[_0xe6d5('0xe0')]='NoAnswer';_0x1ec3b8[_0xe6d5('0x180')]+=0x1;_0x1ec3b8[_0xe6d5('0x195')]+=0x1;_0x5cfed8[_0xe6d5('0xc8')](_0x1ec3b8)[_0xe6d5('0xb2')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x5cfed8[_0xe6d5('0x17d')](0x3,_0x3c4d9d,_0x43e6a5)){if(_0x1ec3b8[_0xe6d5('0x180')]>=_0x43e6a5[_0xe6d5('0x182')]){_0x5cfed8['createStateFinal'](_0x1ec3b8,_0x2f0f85,_0x147a56,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5cfed8[_0xe6d5('0x192')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x196'));}}break;case'5':_0x43e6a5[_0xe6d5('0x63')]+=0x1;_0x1ec3b8[_0xe6d5('0xab')]=0x5;_0x1ec3b8['statedesc']=_0xe6d5('0x197');_0x1ec3b8[_0xe6d5('0x17e')]+=0x1;_0x1ec3b8[_0xe6d5('0x195')]+=0x1;_0x5cfed8[_0xe6d5('0xc8')](_0x1ec3b8)[_0xe6d5('0xb2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5cfed8[_0xe6d5('0x17d')](0x5,_0x3c4d9d,_0x43e6a5)){if(_0x1ec3b8[_0xe6d5('0x17e')]>=_0x43e6a5[_0xe6d5('0x198')]){_0x5cfed8[_0xe6d5('0x193')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x199'));}else{_0x5cfed8['stateGlobal'](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x199'));}}break;case'8':_0x43e6a5['outboundCongestionCallsDay']+=0x1;_0x1ec3b8[_0xe6d5('0xab')]=0x8;_0x1ec3b8['statedesc']=_0xe6d5('0x19a');_0x1ec3b8[_0xe6d5('0x17f')]+=0x1;_0x1ec3b8[_0xe6d5('0x195')]+=0x1;_0x5cfed8[_0xe6d5('0xc8')](_0x1ec3b8)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x19b')));if(_0x5cfed8[_0xe6d5('0x17d')](0x8,_0x3c4d9d,_0x43e6a5)){if(_0x1ec3b8[_0xe6d5('0x17f')]>=_0x43e6a5[_0xe6d5('0x188')]){_0x5cfed8['createStateFinal'](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x19c'));}else{_0x5cfed8[_0xe6d5('0x192')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0xe6d5('0x19c'));}}break;default:_0x43e6a5[_0xe6d5('0x69')]+=0x1;_0x1ec3b8['state']=0xc;_0x1ec3b8[_0xe6d5('0xe0')]=_0x23ec2d[_0xe6d5('0x18f')];_0x5cfed8[_0xe6d5('0xc8')](_0x1ec3b8)[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x19d')));if(_0x5cfed8[_0xe6d5('0x17d')](_0x23ec2d[_0xe6d5('0x18f')],_0x3c4d9d,_0x43e6a5)){if(_0x1ec3b8['countbusyretry']+_0x1ec3b8[_0xe6d5('0x17f')]+_0x1ec3b8[_0xe6d5('0x180')]>=_0x43e6a5['dialGlobalMaxRetry']){_0x5cfed8[_0xe6d5('0x192')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0x23ec2d[_0xe6d5('0x18f')]);}else{_0x5cfed8[_0xe6d5('0x193')](_0x1ec3b8,_0x2f0f85,_0x147a56,_0x23ec2d[_0xe6d5('0x18f')]);}}}});};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x192')]=function(_0x47320d,_0x4948a7,_0x37d353,_0x2c1a9d){var _0x4a698c=new Final(_0x47320d);_0x4a698c[_0xe6d5('0xab')]=0xf;_0x4a698c[_0xe6d5('0xe0')]=_0xe6d5('0x19e');this[_0xe6d5('0x193')](_0x4a698c,_0x4948a7,_0x37d353,_0x2c1a9d);};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x193')]=function(_0x12743d,_0x49d7bb,_0x49734e,_0x1c9e55){this[_0xe6d5('0xc6')](_0x12743d)[_0xe6d5('0xbd')](function(_0x412811){return _0x49d7bb(msgResponse(_0xe6d5('0x18d'),_0xe6d5('0xd5'),_0x1c9e55));})[_0xe6d5('0xb2')](function(_0x9e2465){return _0x49734e(msgResponse(_0xe6d5('0x19f'),_0xe6d5('0x124'),'contact\x20not\x20moved'));});};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x13a')]=function(_0x5e88aa){var _0x4429a1=this;var _0x52b518=_0x5e88aa[_0xe6d5('0x1a0')]/0x64;var _0x5ca8a0=_0x5e88aa[_0xe6d5('0x66')]/(_0x5e88aa[_0xe6d5('0x66')]+_0x5e88aa[_0xe6d5('0x61')]);var _0xa16b58=Math['round'](_0x5e88aa[_0xe6d5('0x71')]*(_0x5e88aa[_0xe6d5('0x1a1')]/0x64));var _0x55416b=Math[_0xe6d5('0x1a2')](_0x5e88aa[_0xe6d5('0x71')]*(_0x5e88aa[_0xe6d5('0x1a3')]/0x64));var _0x49e251=_0x5e88aa[_0xe6d5('0x52')]+_0x5e88aa['talking'];var _0x5a8a09=Math[_0xe6d5('0x1a4')](_0x5e88aa[_0xe6d5('0x1a5')]*_0x5e88aa[_0xe6d5('0x75')]*_0x5e88aa[_0xe6d5('0x1a6')]*_0x5e88aa['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x5e88aa['startProgressive'])){if(!_[_0xe6d5('0x3d')](_0x5e88aa[_0xe6d5('0x92')])){_0x5e88aa[_0xe6d5('0x92')]=undefined;loggerPredictive[_0xe6d5('0x99')](_0xe6d5('0x1a7'),_0xe6d5('0x1a8'));}if(!_[_0xe6d5('0x3d')](_0x5e88aa[_0xe6d5('0x1a9')])){loggerPredictive[_0xe6d5('0x99')](_0xe6d5('0x1a7'),_0xe6d5('0x1aa'));clearInterval(_0x5e88aa[_0xe6d5('0x1a9')]);_0x5e88aa[_0xe6d5('0x1a9')]=undefined;}_0x5e88aa[_0xe6d5('0x2b')]=moment()[_0xe6d5('0x7b')](_0xe6d5('0xf4'));loggerPredictive[_0xe6d5('0x7e')](_0x5e88aa[_0xe6d5('0x40')],_0xe6d5('0x1ab'),_0x5e88aa[_0xe6d5('0x2b')]);this[_0xe6d5('0x137')](_0x5e88aa,0x1);}else if(ifInterval(_0x5e88aa[_0xe6d5('0x1ac')],_0x5e88aa[_0xe6d5('0x2b')])){this[_0xe6d5('0x137')](_0x5e88aa,0x1);loggerPredictiveCalls['info'](_0xe6d5('0x1ad'),_0x5e88aa[_0xe6d5('0x2b')],_0x5e88aa[_0xe6d5('0x40')]);_0x5e88aa['erlangCalls']=0x0;_0x5e88aa[_0xe6d5('0xfd')]=0x0;}else if(_0x52b518<_0x5ca8a0&&_0x5e88aa[_0xe6d5('0x1ae')]===_0xe6d5('0x1af')){freeVariablesPredictive(_0x5e88aa);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1b0'),_0xe6d5('0x1b1'),_0x5ca8a0,_0xe6d5('0x2b'),_0x5e88aa[_0xe6d5('0x40')]);}else if(_0x5a8a09<_0x5e88aa['predictiveIntervalErlangCallsDroppedCalls']&&_0x5e88aa['dialPredictiveOptimization']===_0xe6d5('0x1af')){freeVariablesPredictive(_0x5e88aa);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1b2'),'Max\x20Drop\x20',_0x5a8a09,_0xe6d5('0x1b3'),_0x5e88aa[_0xe6d5('0xfd')],_0xe6d5('0x2b'),_0x5e88aa[_0xe6d5('0x40')]);}else if(!ifInterval(_0x5e88aa[_0xe6d5('0x1ac')],_0x5e88aa[_0xe6d5('0x2b')])&&_[_0xe6d5('0x3d')](_0x5e88aa['startPredictive'])&&!_['isUndefined'](_0x5e88aa[_0xe6d5('0x2b')])){_0x5e88aa['startPredictive']=moment()[_0xe6d5('0x7b')](_0xe6d5('0xf4'));loggerPredictive[_0xe6d5('0x7e')](_0x5e88aa[_0xe6d5('0x40')],_0xe6d5('0x1b4'),_0x5e88aa[_0xe6d5('0x92')]);this['averageHandleTime'](_0x5e88aa[_0xe6d5('0x1ac')])[_0xe6d5('0xbd')](this[_0xe6d5('0x1b5')](_0x5e88aa))['then'](mergeDataErlangB(_0x5e88aa))['then'](this[_0xe6d5('0x1b6')](_0x5e88aa))[_0xe6d5('0xb2')](loggerCatchPredictive(_0xe6d5('0x1b7'),_0x5e88aa));}else if(!ifInterval(_0x5e88aa[_0xe6d5('0x1ac')],_0x5e88aa[_0xe6d5('0x92')])){_0x5e88aa[_0xe6d5('0xfd')]=0x0;_0x5e88aa[_0xe6d5('0x92')]=moment()[_0xe6d5('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe6d5('0x7e')](_0x5e88aa['name'],_0xe6d5('0x1b8'),_0x5e88aa[_0xe6d5('0x92')]);clearInterval(_0x5e88aa[_0xe6d5('0x1a9')]);_0x5e88aa[_0xe6d5('0x1a9')]=undefined;this['averageHandleTime'](_0x5e88aa['dialPredictiveInterval'])[_0xe6d5('0xbd')](this[_0xe6d5('0x1b5')](_0x5e88aa))[_0xe6d5('0xbd')](mergeDataErlangB(_0x5e88aa))[_0xe6d5('0xbd')](this['startMethodPredictive'](_0x5e88aa))[_0xe6d5('0xb2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5e88aa));}else if(_0x5e88aa[_0xe6d5('0x71')]&&_0x49e251<_0x5e88aa['predictiveIntervalAvailable']-_0x55416b){freeVariablesPredictive(_0x5e88aa);loggerPredictive['info'](_0x5e88aa[_0xe6d5('0x40')],_0xe6d5('0x1b9'),_0x49e251,_0xe6d5('0x1ba'),_0x5e88aa[_0xe6d5('0x71')],'-',_0x55416b,'=',_0x5e88aa[_0xe6d5('0x71')]-_0x55416b,')');}else if(_0x5e88aa[_0xe6d5('0x71')]&&_0x49e251>_0x5e88aa[_0xe6d5('0x71')]+_0xa16b58){freeVariablesPredictive(_0x5e88aa);loggerPredictive[_0xe6d5('0x7e')](_0x5e88aa[_0xe6d5('0x40')],_0xe6d5('0x1b9'),_0x49e251,')\x20are\x20more\x20than\x20threshold\x20(',_0x5e88aa[_0xe6d5('0x71')],'+',_0xa16b58,'=',_0x5e88aa[_0xe6d5('0x71')]+_0xa16b58,')');}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x1b5')]=function(_0x5a1cd7){var _0x21aa14=this;return function(_0x2c9751){return new BPromise(function(_0x5973d2,_0x4534da){_[_0xe6d5('0x8f')](_0x5a1cd7,_0x2c9751[0x0]);if(checkGetDataPredictive(_0x2c9751[0x0])){var _0x57da0f=_0x5a1cd7[_0xe6d5('0x71')]=_0x5a1cd7[_0xe6d5('0x57')]+_0x5a1cd7[_0xe6d5('0x52')];var _0x2be9e1=_0x5a1cd7['dialPredictiveInterval']*0x3c;var _0x121a21=_0x2c9751[0x0][_0xe6d5('0x6b')]+_0x2c9751[0x0][_0xe6d5('0x84')];var _0x27c0df=(_0x2c9751[0x0][_0xe6d5('0x6a')]+_0x2c9751[0x0][_0xe6d5('0x6d')]+_0x2c9751[0x0][_0xe6d5('0x6c')])/_0x2c9751[0x0][_0xe6d5('0x72')];_0x5a1cd7[_0xe6d5('0x1a6')]=_0x27c0df>0x0?_0x27c0df:0x1;switch(_0x5a1cd7[_0xe6d5('0x1ae')]){case _0xe6d5('0x1af'):var _0x32219d=_0x5a1cd7[_0xe6d5('0x1a0')]/0x64;return _0x21aa14[_0xe6d5('0x1bb')](_0x57da0f,_0x2be9e1,_0x121a21,_0x27c0df,_0x32219d)[_0xe6d5('0xbd')](function(_0x3e180f){return _0x5973d2(_0x3e180f);});case'agentBusyFactor':var _0x2ad85d=_0x5a1cd7[_0xe6d5('0x1a0')]/0x64;return _0x21aa14[_0xe6d5('0x1bc')](_0x57da0f,_0x2be9e1,_0x121a21,_0x27c0df,_0x2ad85d)[_0xe6d5('0xbd')](function(_0x3ef2ff){return _0x5973d2(_0x3ef2ff);});default:return _0x4534da(msgResponse(_0xe6d5('0x1bd'),_0xe6d5('0x124'),'Unknown\x20Predictive'));}}else{return _0x4534da(msgResponse(_0xe6d5('0x1bd'),_0xe6d5('0x124'),'check\x20failure'));}});};};Dialer['prototype'][_0xe6d5('0x1be')]=function(_0x196123){var _0x48be23=this;return function(_0x56e46e){return new BPromise(function(_0x49a7b0,_0x3d21f9){_[_0xe6d5('0x8f')](_0x196123,_0x56e46e[0x0]);if(checkGetDataPredictive(_0x56e46e[0x0])){loggerPredictive[_0xe6d5('0x7e')](JSON['stringify'](_0x56e46e[0x0]));if(_0x196123[_0xe6d5('0x1ae')]===_0xe6d5('0x1af')){return _0x48be23[_0xe6d5('0xc5')](_0x196123['id'])[_0xe6d5('0xbd')](function(_0x29d656){var _0x5232dd=_0x196123[_0xe6d5('0x53')]-_0x29d656[0x0][_0xe6d5('0x1bf')];var _0x11a2c4=_0x196123[_0xe6d5('0x1ac')]*0x3c;var _0x1aa91b=_0x56e46e[0x0]['predictiveIntervalAvgTalktime']+_0x56e46e[0x0][_0xe6d5('0x84')];var _0x35ae6=(_0x56e46e[0x0][_0xe6d5('0x6a')]+_0x56e46e[0x0][_0xe6d5('0x6d')]+_0x56e46e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x56e46e[0x0][_0xe6d5('0x72')];var _0x35e2f3=_0x196123[_0xe6d5('0x1a0')]/0x64;_0x196123[_0xe6d5('0x70')]=_0x29d656[0x0][_0xe6d5('0x1bf')]||0x0;_0x196123[_0xe6d5('0x1a6')]=_0x35ae6>0x0?_0x35ae6:0x1;return _0x48be23['abandonmentRate'](_0x5232dd,_0x11a2c4,_0x1aa91b,_0x35ae6,_0x35e2f3);})[_0xe6d5('0xbd')](function(_0x4d983c){return _0x49a7b0(_0x4d983c);})[_0xe6d5('0xb2')](function(_0x4a8f65){return _0x3d21f9(msgResponse(_0xe6d5('0x1c0'),_0xe6d5('0x124'),JSON[_0xe6d5('0x4a')](_0x4a8f65)));});}if(_0x196123[_0xe6d5('0x1ae')]===_0xe6d5('0x1c1')){return _0x48be23[_0xe6d5('0xc5')](_0x196123['id'])[_0xe6d5('0xbd')](function(_0x264d72){var _0x4705f8=_0x196123[_0xe6d5('0x53')]-_0x264d72[0x0][_0xe6d5('0x1bf')];var _0x26e513=_0x196123[_0xe6d5('0x1ac')]*0x3c;var _0x3c3ab7=_0x56e46e[0x0][_0xe6d5('0x6b')]+_0x56e46e[0x0]['predictiveIntervalAvgHoldtime'];var _0x16389f=(_0x56e46e[0x0][_0xe6d5('0x6a')]+_0x56e46e[0x0][_0xe6d5('0x6d')]+_0x56e46e[0x0][_0xe6d5('0x6c')])/_0x56e46e[0x0]['predictiveIntervalTotalCalls'];var _0x6850e=_0x196123[_0xe6d5('0x1a0')]/0x64;_0x196123[_0xe6d5('0x70')]=_0x264d72[0x0][_0xe6d5('0x1bf')]||0x0;_0x196123[_0xe6d5('0x1a6')]=_0x16389f>0x0?_0x16389f:0x1;return _0x48be23[_0xe6d5('0x1bc')](_0x4705f8,_0x26e513,_0x3c3ab7,_0x16389f,_0x6850e);})[_0xe6d5('0xbd')](function(_0x1a484b){return _0x49a7b0(_0x1a484b);})[_0xe6d5('0xb2')](function(_0x3a30c6){return _0x3d21f9(msgResponse(_0xe6d5('0x1c0'),_0xe6d5('0x124'),JSON[_0xe6d5('0x4a')](_0x3a30c6)));});}}else{return _0x3d21f9(msgResponse(_0xe6d5('0x1bd'),_0xe6d5('0x124'),_0xe6d5('0x1c2')));}});};};Dialer[_0xe6d5('0x1c')]['startMethodPredictive']=function(_0x8348d8){var _0x4d253b=this;return function(){var _0x42a464=0x0;var _0x172a95=Math[_0xe6d5('0x1a4')](_0x8348d8['erlangCallToSecond']*0x3e8);if(_0x172a95>0x0){_0x172a95=_0x172a95<0x64?0x64:_0x172a95;loggerPredictive['info'](_0x8348d8[_0xe6d5('0x40')],_0xe6d5('0x1c3'),_0x172a95,'milliseconds');_0x8348d8[_0xe6d5('0x1a9')]=setInterval(function(){_0x4d253b[_0xe6d5('0x1a9')](_0x8348d8);loggerPredictiveCalls[_0xe6d5('0x7e')]('[handlePredictive]',_0x42a464+=0x1);},_0x172a95);}else{loggerPredictive[_0xe6d5('0x7e')](_0x8348d8[_0xe6d5('0x40')],_0xe6d5('0x1c4'));}};};Dialer['prototype'][_0xe6d5('0x1c5')]=function(_0x1f7d42,_0x33025c){var _0x517beb=this;return function(_0x460aeb){if(_[_0xe6d5('0x48')](_0x460aeb)){if(_[_0xe6d5('0xb0')](_0x33025c[_0xe6d5('0xd0')])||!_0x33025c['recallme']){if(_0x1f7d42[_0xe6d5('0x5d')]==='booked'){_0x1f7d42[_0xe6d5('0x10a')]=_[_0xe6d5('0x3d')](_0x1f7d42[_0xe6d5('0x10a')])?!![]:_0x1f7d42[_0xe6d5('0x10a')];var _0x3310f5=uuid['v4']();_0x517beb[_0xe6d5('0x27')][_0x3310f5]=new Action(_0x1f7d42,_0x33025c,_0x3310f5);loggerBooked[_0xe6d5('0x7e')](_0xe6d5('0x1c6'),_0x3310f5,_0xe6d5('0x1c7'),JSON['stringify'](_0x1f7d42[_0xe6d5('0x10a')]),'Queue:\x20',_0x1f7d42['name']);if(_0x1f7d42['queueStatusComplete']){_0x1f7d42[_0xe6d5('0x10a')]=![];_0x517beb[_0xe6d5('0x2d')][_0x517beb[_0xe6d5('0x27')][_0x3310f5][_0xe6d5('0xb5')]]=[];ami[_0xe6d5('0xb1')]({'actionid':_0x3310f5,'action':_0xe6d5('0x1c8'),'queue':_0x1f7d42['name']})[_0xe6d5('0xb2')](function(_0xd3ab46){_0x517beb['updateOriginated'](_0x1f7d42);_0x517beb[_0xe6d5('0xc1')]({'active':![],'ContactId':_0x517beb[_0xe6d5('0x27')][_0x3310f5][_0xe6d5('0xcf')],'ListId':_0x517beb['actions'][_0x3310f5][_0xe6d5('0x110')],'VoiceQueueId':_0x517beb['actions'][_0x3310f5]['VoiceQueueId']||undefined,'CampaignId':_0x517beb[_0xe6d5('0x27')][_0x3310f5]['CampaignId']||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x1c9')));delete _0x517beb[_0xe6d5('0x27')][_0x3310f5];});}else{loggerBooked[_0xe6d5('0x7e')](_0xe6d5('0x1ca'),JSON[_0xe6d5('0x4a')](_0x1f7d42[_0xe6d5('0x10a')]),'Queue:\x20',_0x1f7d42[_0xe6d5('0x40')]);_0x517beb[_0xe6d5('0xb6')](_0x1f7d42);_0x517beb[_0xe6d5('0xc1')]({'active':![],'ContactId':_0x517beb[_0xe6d5('0x27')][_0x3310f5]['ContactId'],'ListId':_0x517beb[_0xe6d5('0x27')][_0x3310f5]['ListId'],'VoiceQueueId':_0x517beb[_0xe6d5('0x27')][_0x3310f5][_0xe6d5('0xd1')]||undefined,'CampaignId':_0x517beb[_0xe6d5('0x27')][_0x3310f5][_0xe6d5('0x111')]||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x1c9')));delete _0x517beb[_0xe6d5('0x27')][_0x3310f5];}}else{return _0x517beb['actionOriginate'](_0x1f7d42,_0x33025c);}}else{if(getDiff(_0x33025c[_0xe6d5('0x1cb')])<_0x1f7d42[_0xe6d5('0x1cc')]*0x3c){_0x517beb[_0xe6d5('0x20')][_0xe6d5('0x10d')](_0x33025c['id'])[_0xe6d5('0x10f')](function(){_0x517beb[_0xe6d5('0xb6')](_0x1f7d42);});}else{_0x1f7d42[_0xe6d5('0x1cd')]+=0x1;_0x517beb[_0xe6d5('0xb6')](_0x1f7d42);if(_0x1f7d42['dialRecallInQueue']){_0x517beb[_0xe6d5('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x33025c[_0xe6d5('0xcf')],'ListId':_0x33025c['ListId'],'VoiceQueueId':_0x33025c['VoiceQueueId']||undefined,'CampaignId':_0x33025c[_0xe6d5('0x111')]||undefined})[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x1ce')));_0x517beb[_0xe6d5('0xc8')](createObjHistory(_0x1f7d42,_0x33025c,_0xe6d5('0x1cf'),0x17,_0xe6d5('0x1d0')))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0x1d1')));}else{_0x517beb[_0xe6d5('0xcd')](createObjHistory(_0x1f7d42,_0x33025c,'RECALLFAILEDTIMEOUT',0x16,_0xe6d5('0x1d2')),'[Originate][HistoryRecallClose][historyCatch]',_0xe6d5('0x1d3'));}}}}else{_0x1f7d42[_0xe6d5('0x62')]+=0x1;_0x517beb[_0xe6d5('0xcd')](createObjHistory(_0x1f7d42,_0x33025c,_0xe6d5('0x1d4'),0xd,_0xe6d5('0x1d5')),_0xe6d5('0x1d6'),_0xe6d5('0x1d7'));throw _0xe6d5('0x1d8');}};};Dialer[_0xe6d5('0x1c')]['handleIvr']=function(_0x173f3d){var _0x1ea557=this;var _0x2142ec=[];var _0x500bf9=_0x173f3d[_0xe6d5('0x1d9')]-_0x173f3d['originated']-_0x173f3d[_0xe6d5('0x1da')];emitCampaignSummary(_0x173f3d);if(_0x500bf9>0x0){if(_0x500bf9>this[_0xe6d5('0x25')]){_0x500bf9=this[_0xe6d5('0x25')];}_0x173f3d['temp']+=_0x500bf9;this[_0xe6d5('0xc3')](_0x173f3d['id'],_0x500bf9,_0x173f3d['dialOrderByScheduledAt'])[_0xe6d5('0xbd')](function(_0x1be0bd){_0x173f3d[_0xe6d5('0x1da')]-=_0x500bf9;_0x173f3d['temp']=_0x173f3d[_0xe6d5('0x1da')]>0x0?_0x173f3d[_0xe6d5('0x1da')]:0x0;if(!checkContactEmpty(_0x1be0bd)){_0x173f3d['message']=_0xe6d5('0xa2');logger[_0xe6d5('0x7e')](_0xe6d5('0x1db')+_0x173f3d['name']);}else{_0x173f3d[_0xe6d5('0x73')]+=_0x1be0bd[_0xe6d5('0x9c')];_0x173f3d[_0xe6d5('0x3e')]='RUNNING';for(var _0x277323=0x0;_0x277323<_0x1be0bd[_0xe6d5('0x9c')];_0x277323+=0x1){_0x173f3d[_0xe6d5('0x1dc')]+=0x1;if(_[_0xe6d5('0xb0')](_0x1be0bd[_0x277323])||_[_0xe6d5('0xb0')](_0x1be0bd[_0x277323][_0xe6d5('0x149')])||_['isNil'](_0x1be0bd[_0x277323][_0xe6d5('0x149')][_0xe6d5('0x14a')])){_0x1ea557[_0xe6d5('0xcb')](_0xe6d5('0x1dd'),_0x173f3d,_0x1be0bd[_0x277323]);}else{_0x1ea557[_0xe6d5('0xbc')](_[_0xe6d5('0xce')](_0x1be0bd[_0x277323],['CampaignId',_0xe6d5('0x1de')]))[_0xe6d5('0xbd')](_0x1ea557[_0xe6d5('0x1c5')](_0x173f3d,_0x1be0bd[_0x277323]))[_0xe6d5('0xb2')](_0x1ea557[_0xe6d5('0x1df')]('[actionOriginateIvr]\x20',_0x173f3d));}}}})['catch'](loggerGetContactDialer(_0xe6d5('0x1e0'),_0x173f3d,_0x500bf9));}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x137')]=function(_0x48645d,_0x238c46){var _0x42e70c=this;var _0x1631a4=[];var _0x286de0=_0x238c46>=0x1?_0x238c46:0x1;var _0x5628f8=[];if(_0x48645d[_0xe6d5('0x5d')]==='booked'){_0x286de0=0x1;}var _0x284f39=Math[_0xe6d5('0x1a4')](_0x48645d[_0xe6d5('0x52')]*_0x286de0)-_0x48645d['originated']-_0x48645d['temp'];emitVoiceQueueSummary(_0x48645d);if(_0x48645d['dialLimitQueue']>0x0){var _0x23a41f=_0x48645d[_0xe6d5('0x1e1')]-_0x48645d[_0xe6d5('0x73')]-_0x48645d[_0xe6d5('0x57')]-_0x48645d[_0xe6d5('0x1da')]-_0x48645d['pTalking'];if(_0x284f39>_0x23a41f){_0x284f39=_0x23a41f;}}if(_0x284f39>0x0){if(_0x48645d[_0xe6d5('0x5d')]===_0xe6d5('0x13b')){_0x284f39=0x1;}if(_0x284f39>this[_0xe6d5('0x25')]){_0x284f39=this['maxNumberOriginate'];}_0x48645d[_0xe6d5('0x1da')]+=_0x284f39;for(var _0x468eb8 in this[_0xe6d5('0x23')]){if(this[_0xe6d5('0x23')][_0xe6d5('0x9d')](_0x468eb8)){if(this[_0xe6d5('0x23')][_0x468eb8][_0xe6d5('0xab')]===_0xe6d5('0x1e2')&&this[_0xe6d5('0x23')][_0x468eb8][_0xe6d5('0xd9')]==='reachable'){_0x1631a4[_0xe6d5('0x130')](this['agents'][_0x468eb8]['id']);}}}this[_0xe6d5('0xc2')](_0x48645d['id'],_0x1631a4,_0x284f39,_0x48645d[_0xe6d5('0x1e3')])[_0xe6d5('0xbd')](function(_0x26d20a){_0x48645d[_0xe6d5('0x1da')]-=_0x284f39;_0x48645d[_0xe6d5('0x1da')]=_0x48645d[_0xe6d5('0x1da')]>0x0?_0x48645d[_0xe6d5('0x1da')]:0x0;if(!checkContactEmpty(_0x26d20a)){_0x42e70c[_0xe6d5('0xb8')](_0x48645d)[_0xe6d5('0xbd')](sendMessageReschedule(_0x48645d))[_0xe6d5('0xb2')](loggerCatch('[countReScheduled]\x20'));}else{_0x48645d[_0xe6d5('0x73')]+=_0x26d20a[_0xe6d5('0x9c')];_0x48645d[_0xe6d5('0x3e')]=_0x48645d[_0xe6d5('0x5d')]===_0xe6d5('0x13b')?_0xe6d5('0x152'):_0xe6d5('0x1e4');for(var _0x49638c=0x0;_0x49638c<_0x26d20a['length'];_0x49638c+=0x1){if(_[_0xe6d5('0xb0')](_0x26d20a[_0x49638c])||_[_0xe6d5('0xb0')](_0x26d20a[_0x49638c][_0xe6d5('0x149')])||_[_0xe6d5('0xb0')](_0x26d20a[_0x49638c]['Contact'][_0xe6d5('0x14a')])){_0x42e70c['emptyContact'](_0xe6d5('0x1dd'),_0x48645d,_0x26d20a[_0x49638c]);}else{_0x42e70c[_0xe6d5('0xbb')](_[_0xe6d5('0xce')](_0x26d20a[_0x49638c],[_0xe6d5('0xd1'),'Contact.phone']))[_0xe6d5('0xbd')](_0x42e70c[_0xe6d5('0x1c5')](_0x48645d,_0x26d20a[_0x49638c]))[_0xe6d5('0xb2')](_0x42e70c['loggerHandler'](_0xe6d5('0x1dd'),_0x48645d));}}}})[_0xe6d5('0xb2')](loggerGetContactDialer(_0xe6d5('0x1e5'),_0x48645d,_0x284f39));}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x1a9')]=function(_0x66b202){var _0x4f87c1=this;if(_0x66b202[_0xe6d5('0x1e1')]>0x0){var _0x258b24=_0x66b202[_0xe6d5('0x1e1')]-_0x66b202['originated']-_0x66b202['talking'];if(_0x258b24>0x0){this[_0xe6d5('0x1e6')](_0x66b202);}else{loggerPredictiveCalls[_0xe6d5('0x7e')]('[handlePredictive][limitChannel]');}}else{this[_0xe6d5('0x1e6')](_0x66b202);}};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x1e6')]=function(_0x10a763){var _0x58defa=this;var _0x4de641=[];_0x10a763['originated']+=0x1;for(var _0x18c9a3 in this[_0xe6d5('0x23')]){if(this['agents']['hasOwnProperty'](_0x18c9a3)){if(this[_0xe6d5('0x23')][_0x18c9a3]['state']===_0xe6d5('0x1e2')&&this[_0xe6d5('0x23')][_0x18c9a3][_0xe6d5('0xd9')]==='reachable'){_0x4de641[_0xe6d5('0x130')](this['agents'][_0x18c9a3]['id']);}}}this['getContactDialer'](_0x10a763['id'],_0x4de641,0x1,_0x10a763[_0xe6d5('0x1e3')])[_0xe6d5('0xbd')](function(_0x2e75bb){if(!checkContactEmpty(_0x2e75bb)){checkContactLowerLimitOriginate(_0x10a763,0x1,0x0);_0x58defa[_0xe6d5('0xb8')](_0x10a763)[_0xe6d5('0xbd')](sendMessageReschedule(_0x10a763))[_0xe6d5('0xb2')](loggerCatch(_0xe6d5('0xba')));}else{_0x10a763[_0xe6d5('0x3e')]='RUNNING';if(_[_0xe6d5('0xb0')](_0x2e75bb[0x0])||_[_0xe6d5('0xb0')](_0x2e75bb[0x0][_0xe6d5('0x149')])||_[_0xe6d5('0xb0')](_0x2e75bb[0x0]['Contact']['phone'])){_0x58defa[_0xe6d5('0xcb')](_0xe6d5('0x1dd'),_0x10a763,_0x2e75bb[0x0]);}else{_0x58defa['checkIsBlackList'](_[_0xe6d5('0xce')](_0x2e75bb[0x0],['VoiceQueueId',_0xe6d5('0x1de')]))[_0xe6d5('0xbd')](_0x58defa[_0xe6d5('0x1c5')](_0x10a763,_0x2e75bb[0x0]))[_0xe6d5('0xb2')](_0x58defa[_0xe6d5('0x1df')](_0xe6d5('0x1e7'),_0x10a763));}}})['catch'](loggerGetContactDialer(_0xe6d5('0x1e8'),_0x10a763,0x1));emitVoiceQueueSummary(_0x10a763);};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x1bb')]=function(_0x10dddc,_0x1b40bc,_0x24fee0,_0x1cf4fd,_0x1f2cf5,_0x44faa8){loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1e9'));loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1ea'),_0x10dddc);loggerPredictive['info'](_0xe6d5('0x1eb'),_0x1b40bc);loggerPredictive[_0xe6d5('0x7e')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24fee0);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1ec'),_0x1cf4fd);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1ed'),_0x1f2cf5);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x86'));return new BPromise(function(_0x4b003c,_0x3023ed){if(_0x10dddc<=0x0||isNaN(_0x10dddc)){return _0x3023ed(msgResponse(_0xe6d5('0x1ee'),'Error',_0xe6d5('0x1ef')+_0x10dddc));}if(_0x24fee0<=0x0||isNaN(_0x24fee0)){return _0x3023ed(msgResponse('[abandonmentRate]',_0xe6d5('0x176'),_0xe6d5('0x1f0')+_0x24fee0));}if(_0x1cf4fd<=0x0||isNaN(_0x1cf4fd)){return _0x3023ed(msgResponse(_0xe6d5('0x1ee'),_0xe6d5('0x176'),_0xe6d5('0x1f1')+_0x1cf4fd));}if(_0x1b40bc<=0x0||isNaN(_0x1b40bc)){return _0x3023ed(msgResponse(_0xe6d5('0x1ee'),_0xe6d5('0x176'),_0xe6d5('0x1f2')+_0x1b40bc));}if(_0x1f2cf5<=0x0||isNaN(_0x1f2cf5)){return _0x3023ed(msgResponse(_0xe6d5('0x1ee'),_0xe6d5('0x176'),_0xe6d5('0x1f3')+_0x1f2cf5));}_0x44faa8=_0x44faa8||0x0;var _0x582cab=0x1/_0x24fee0;var _0x301de0=0x0;var _0x50891f=0x0;var _0x4bc946=0x0;var _0x5f4f9c=0x0;for(var _0x2ff212=0x0;_0x4bc946<_0x1f2cf5;_0x2ff212+=0x1){_0x50891f=_0x2ff212/_0x1b40bc;_0x301de0=(_0x1cf4fd*_0x50891f+_0x44faa8)/_0x582cab;_0x4bc946=erlangb(_0x301de0,_0x10dddc);_0x5f4f9c=_0x301de0/_0x10dddc*(0x1-erlangb(_0x301de0,_0x10dddc));}return _0x4b003c({'erlangCalls':_0x2ff212,'erlangCallToSecond':_0x1b40bc/_0x2ff212,'erlangAbandonmentRate':_0x4bc946,'erlangBusyFactor':_0x5f4f9c});});};Dialer[_0xe6d5('0x1c')][_0xe6d5('0x1bc')]=function(_0x1c9980,_0x36edc4,_0x168618,_0x18ec61,_0x26c09e,_0x1e8563){loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1f4'));loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1ea'),_0x1c9980);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1eb'),_0x36edc4);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1f5'),_0x168618);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1ec'),_0x18ec61);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x1f6'),_0x26c09e);loggerPredictive[_0xe6d5('0x7e')](_0xe6d5('0x86'));return new BPromise(function(_0x4ed7e6,_0x78749b){if(_0x1c9980<=0x0||isNaN(_0x1c9980)){return _0x78749b(msgResponse('[busyFactor]',_0xe6d5('0x176'),'m\x20=\x20'+_0x1c9980));}if(_0x168618<=0x0||isNaN(_0x168618)){return _0x78749b(msgResponse(_0xe6d5('0x1f7'),'Error',_0xe6d5('0x1f0')+_0x168618));}if(_0x18ec61<=0x0||isNaN(_0x18ec61)){return _0x78749b(msgResponse(_0xe6d5('0x1f7'),'Error',_0xe6d5('0x1f1')+_0x18ec61));}if(_0x36edc4<=0x0||isNaN(_0x36edc4)){return _0x78749b(msgResponse(_0xe6d5('0x1f7'),_0xe6d5('0x176'),_0xe6d5('0x1f2')+_0x36edc4));}if(_0x26c09e<=0x0||isNaN(_0x26c09e)){return _0x78749b(msgResponse('[busyFactor]',_0xe6d5('0x176'),'Umin\x20=\x20'+_0x26c09e));}_0x1e8563=_0x1e8563||0x0;var _0x3e41cb=0x1/_0x168618;var _0x30d81c=0x0;var _0x2973d8=0x0;var _0x2c7cd2=0x0;var _0x316f6d=0x0;for(var _0x2d6bf=0x0;_0x316f6d<_0x26c09e;_0x2d6bf+=0x1){_0x2973d8=_0x2d6bf/_0x36edc4;_0x30d81c=(_0x18ec61*_0x2973d8+_0x1e8563)/_0x3e41cb;_0x2c7cd2=erlangb(_0x30d81c,_0x1c9980);_0x316f6d=_0x30d81c/_0x1c9980*(0x1-erlangb(_0x30d81c,_0x1c9980));}return _0x4ed7e6({'erlangCalls':_0x2d6bf,'erlangCallToSecond':_0x36edc4/_0x2d6bf,'erlangAbandonmentRate':_0x2c7cd2,'erlangBusyFactor':_0x316f6d});});};module[_0xe6d5('0x1f8')]=Dialer; \ No newline at end of file +var _0xedda=['Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','predictiveIntervalDroppedCallsCallersExit','Abandoned','CALLEREXIT','actions','actionid','locked','stateinterface','rrmemory','push','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','predictiveIntervalHitRate','[getDataPredictive]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','Contact.phone','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','RUNNING','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','bluebird','moment','md5','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x41a3f5,_0xa49b7){var _0x56ff73=function(_0x37899b){while(--_0x37899b){_0x41a3f5['push'](_0x41a3f5['shift']());}};_0x56ff73(++_0xa49b7);}(_0xedda,0x173));var _0xaedd=function(_0x43ca77,_0x41f9d3){_0x43ca77=_0x43ca77-0x0;var _0x2a7b44=_0xedda[_0x43ca77];return _0x2a7b44;};'use strict';var util=require(_0xaedd('0x0'));var _=require(_0xaedd('0x1'));var BPromise=require(_0xaedd('0x2'));var uuid=require('uuid');var moment=require(_0xaedd('0x3'));var rr=require('rr');var md5=require(_0xaedd('0x4'));var Redis=require('ioredis');var config=require(_0xaedd('0x5'));var logger=require(_0xaedd('0x6'))('dialer');var loggerBooked=require(_0xaedd('0x6'))(_0xaedd('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xaedd('0x6'))(_0xaedd('0x8'));var loggerSyncQueueSummary=require(_0xaedd('0x6'))(_0xaedd('0x9'));var ami=require(_0xaedd('0xa'));config[_0xaedd('0xb')]=_['defaults'](config[_0xaedd('0xb')],{'host':_0xaedd('0xc'),'port':0x18eb});var io=require(_0xaedd('0xd'))(new Redis(config[_0xaedd('0xb')]));var cmHopper=require(_0xaedd('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xaedd('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xaedd('0x10'));var Action=require(_0xaedd('0x11'));var History=require(_0xaedd('0x12'));var Final=require(_0xaedd('0x13'));var AgentComplete=require(_0xaedd('0x14'));var QueueCallerAbandon=require(_0xaedd('0x15'));var Hangup=require(_0xaedd('0x16'));var ipAgi=process['env'][_0xaedd('0x17')]||_0xaedd('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xaedd('0x19')};var Sequence=function(){};Sequence[_0xaedd('0x1a')][_0xaedd('0x1b')]=function(_0x397f57){this[_0xaedd('0x1c')]=this[_0xaedd('0x1c')]?this[_0xaedd('0x1c')][_0xaedd('0x1d')](_0x397f57):_0x397f57();};function Dialer(_0x315974,_0x5a9760){this[_0xaedd('0x1e')]=new Sequence();this['preview']=_0x5a9760;this[_0xaedd('0x1f')]=_0x315974['voiceQueues'];this[_0xaedd('0x20')]=_0x315974[_0xaedd('0x20')];this[_0xaedd('0x21')]=_0x315974['agents'];this[_0xaedd('0x22')]=_0x315974[_0xaedd('0x22')];this[_0xaedd('0x23')]=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this[_0xaedd('0x24')]={};this[_0xaedd('0x25')]={};this['optionPredictive']={};this[_0xaedd('0x26')]={};this[_0xaedd('0x27')]={};this['ivrOriginated']={};this[_0xaedd('0x28')]={};this[_0xaedd('0x29')]={};ami['on'](_0xaedd('0x2a'),this[_0xaedd('0x2b')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x2d'),this[_0xaedd('0x2e')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x2f'),this[_0xaedd('0x30')]['bind'](this));ami['on'](_0xaedd('0x31'),this[_0xaedd('0x32')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x33'),this[_0xaedd('0x9')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x34'),this['syncHangup'][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x35'),this[_0xaedd('0x36')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x37'),this[_0xaedd('0x38')][_0xaedd('0x2c')](this));ami['on'](_0xaedd('0x39'),this[_0xaedd('0x3a')][_0xaedd('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xaedd('0x3b')][_0xaedd('0x2c')](this));this[_0xaedd('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x56cb98){return _0x56cb98!==null&&!_['isUndefined'](_0x56cb98);}function checkIsLoggedIn(_0x352e6e,_0x1ca2a3){return function(){if(_0x1ca2a3<=0x0){_0x352e6e[_0xaedd('0x3d')]=_0xaedd('0x3e');throw _0x352e6e[_0xaedd('0x3f')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0xa4a13c){return _0xa4a13c;}function checkIsActive(_0x56e8b5,_0x2c1ff6){return function(){if(!isActive(_0x2c1ff6)){_0x56e8b5['message']='NOT_ACTIVE';throw _0x56e8b5[_0xaedd('0x3f')]+_0xaedd('0x40');}};}function checkInterval(_0x15591f){return function(){if(!isNotNull(_0x15591f['Interval'])){_0x15591f[_0xaedd('0x3d')]='INTERVAL_IS_NULL';throw _0x15591f[_0xaedd('0x3f')]+_0xaedd('0x41');}if(!isNotNull(_0x15591f[_0xaedd('0x42')][_0xaedd('0x43')])){_0x15591f[_0xaedd('0x3d')]=_0xaedd('0x44');throw _0x15591f[_0xaedd('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x15591f[_0xaedd('0x42')][_0xaedd('0x43')]))){_0x15591f['message']='INTERVAL_IS_NULL';throw _0x15591f[_0xaedd('0x3f')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5c4ca5,_0xca38cf,_0x66d50e){return{'action':_0x5c4ca5,'response':_0xca38cf,'message':_0x66d50e,'stack':_0x66d50e};}function myreject(_0x13d3a7){return function(_0x5e38eb){return _0x13d3a7(msgResponse(_0xaedd('0x45'),_0xaedd('0x46'),JSON[_0xaedd('0x47')](_0x5e38eb)));};}function getSeconds(_0x250e1a,_0x4dc233){var _0x2a17e2=moment(_0x250e1a)[_0xaedd('0x48')](0x0);var _0x4e8898=moment(_0x4dc233)['milliseconds'](0x0);return _0x2a17e2[_0xaedd('0x49')](_0x4e8898,_0xaedd('0x4a'));}function emit(_0x301088,_0x2ed5c2,_0x2d9ea5){io['to'](_0x301088)['emit'](_0x2ed5c2,_0x2d9ea5);}function emitVoiceQueueSummary(_0x10e45f){if(_0x10e45f[_0xaedd('0x4b')]===_0xaedd('0x4c')){var _0x1158de={'id':_0x10e45f['id'],'name':_0x10e45f['name'],'strategy':_0x10e45f[_0xaedd('0x4d')],'answered':_0x10e45f[_0xaedd('0x4e')],'available':_0x10e45f[_0xaedd('0x4f')],'loggedIn':_0x10e45f[_0xaedd('0x50')],'pTalking':_0x10e45f[_0xaedd('0x51')],'sumBillable':_0x10e45f['sumBillable'],'sumDuration':_0x10e45f[_0xaedd('0x52')],'sumHoldTime':_0x10e45f[_0xaedd('0x53')]||0x0,'talking':_0x10e45f[_0xaedd('0x54')],'total':_0x10e45f[_0xaedd('0x55')],'type':_0x10e45f[_0xaedd('0x4b')],'unmanaged':_0x10e45f[_0xaedd('0x56')],'abandoned':_0x10e45f[_0xaedd('0x57')],'waiting':_0x10e45f[_0xaedd('0x58')],'loggedInDb':_0x10e45f[_0xaedd('0x59')],'dialActive':_0x10e45f[_0xaedd('0x5a')],'dialMethod':_0x10e45f['dialMethod'],'dialOriginateCallerIdName':_0x10e45f[_0xaedd('0x5b')],'dialOriginateCallerIdNumber':_0x10e45f[_0xaedd('0x5c')],'dialOriginateTimeout':_0x10e45f[_0xaedd('0x5d')],'dialPrefix':_0x10e45f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x10e45f[_0xaedd('0x5e')],'outboundAnswerCallsDay':_0x10e45f[_0xaedd('0x5f')],'outboundBlacklistCallsDay':_0x10e45f[_0xaedd('0x60')],'outboundBusyCallsDay':_0x10e45f[_0xaedd('0x61')],'outboundCongestionCallsDay':_0x10e45f['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x10e45f[_0xaedd('0x62')],'outboundDropCallsDayCallersExit':_0x10e45f[_0xaedd('0x63')],'outboundDropCallsDayTimeout':_0x10e45f[_0xaedd('0x64')],'outboundNoAnswerCallsDay':_0x10e45f[_0xaedd('0x65')],'outboundNoSuchCallsDay':_0x10e45f[_0xaedd('0x66')],'outboundOriginateFailureCallsDay':_0x10e45f[_0xaedd('0x67')],'outboundReCallsDay':_0x10e45f[_0xaedd('0x68')],'outboundRejectCallsDay':_0x10e45f[_0xaedd('0x69')],'outboundUnknownCallsDay':_0x10e45f[_0xaedd('0x6a')],'predictiveIntervalAnsweredCalls':_0x10e45f[_0xaedd('0x6b')],'predictiveIntervalAvgHoldtime':_0x10e45f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x10e45f[_0xaedd('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x10e45f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x10e45f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x10e45f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x10e45f[_0xaedd('0x6d')],'predictiveIntervalHitRate':_0x10e45f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x10e45f[_0xaedd('0x6e')],'predictiveIntervalPauses':_0x10e45f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x10e45f[_0xaedd('0x6f')],'predictiveIntervalTotalCalls':_0x10e45f[_0xaedd('0x70')],'message':_0x10e45f['message'],'originated':_0x10e45f['originated'],'erlangCalls':_0x10e45f['erlangCalls'],'erlangCallToSecond':_0x10e45f[_0xaedd('0x71')],'erlangAbandonmentRate':_0x10e45f[_0xaedd('0x72')],'erlangBusyFactor':_0x10e45f[_0xaedd('0x73')],'startPredictive':_0x10e45f[_0xaedd('0x26')],'startProgressive':_0x10e45f['startProgressive']};if(_0x10e45f[_0xaedd('0x74')]){_0x1158de['Trunk']={'id':_0x10e45f[_0xaedd('0x74')]['id'],'name':_0x10e45f['Trunk']['name'],'active':_0x10e45f[_0xaedd('0x74')][_0xaedd('0x75')],'callerid':_0x10e45f[_0xaedd('0x74')][_0xaedd('0x76')]};}if(_0x10e45f[_0xaedd('0x42')]){_0x1158de['Interval']={'id':_0x10e45f[_0xaedd('0x42')]['id'],'name':_0x10e45f['Interval'][_0xaedd('0x3f')]};}var _0x3a7914=md5(JSON[_0xaedd('0x47')](_0x1158de));if(_0x10e45f['md5']!==_0x3a7914){_0x10e45f['md5']=_0x3a7914;emit(util[_0xaedd('0x77')](_0xaedd('0x78'),_0x1158de[_0xaedd('0x3f')]),_0xaedd('0x79'),_0x1158de);}}}function emitCampaignSummary(_0x5a969d){if(_0x5a969d[_0xaedd('0x4b')]===_0xaedd('0x7a')){emit(util[_0xaedd('0x77')]('campaign:ivr:%s',_0x5a969d[_0xaedd('0x3f')]),_0xaedd('0x7b'),_0x5a969d);}}function checkGetDataPredictive(_0xe079d6){if(isNotNull(_0xe079d6)){if(!_[_0xaedd('0x7c')](_0xe079d6)){loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x7e'));loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x7f'),_0xe079d6[_0xaedd('0x70')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x80'),_0xe079d6[_0xaedd('0x6b')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x81'),_0xe079d6[_0xaedd('0x82')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x83'),_0xe079d6['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe079d6['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xaedd('0x84'),_0xe079d6['predictiveIntervalAvgTalktime']);loggerPredictive[_0xaedd('0x7d')]('---------------------------');if(_0xe079d6[_0xaedd('0x70')]>0x0){if(!_[_0xaedd('0x85')](_0xe079d6[_0xaedd('0x6c')])&&_0xe079d6[_0xaedd('0x6c')]>0x0){return!![];}else{loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x86'));}if(!_[_0xaedd('0x85')](_0xe079d6['predictiveIntervalAvgHoldtime'])&&_0xe079d6[_0xaedd('0x87')]>0x0){return!![];}else{loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x88'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x89'));}return![];}function mergeDataErlangB(_0x3f8fcd){return function(_0x5c406c){loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x8a'));loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x8b'),_0x5c406c[_0xaedd('0x8c')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x8d'),_0x5c406c['erlangCallToSecond']);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x8e'),_0x5c406c[_0xaedd('0x72')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x8f'),_0x5c406c['erlangBusyFactor']);loggerPredictive[_0xaedd('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c406c[_0xaedd('0x72')]);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x90'));_['merge'](_0x3f8fcd,_0x5c406c);};}function getDiff(_0x2a1d65){var _0x2b0c4c=moment()['milliseconds'](0x0);var _0x3c2f94=moment(_0x2a1d65)[_0xaedd('0x48')](0x0);return _0x2b0c4c[_0xaedd('0x49')](_0x3c2f94,_0xaedd('0x4a'));}function ifInterval(_0x23cf84,_0x98227e){if(_[_0xaedd('0x85')](_0x98227e)){return![];}if(getDiff(_0x98227e)<_0x23cf84*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x49fb37){if(isNotNull(_0x49fb37)){if(!_[_0xaedd('0x85')](_0x49fb37[_0xaedd('0x27')])){_0x49fb37['startProgressive']=undefined;loggerPredictive[_0xaedd('0x7d')](_0x49fb37[_0xaedd('0x3f')],_0xaedd('0x91'));}if(!_[_0xaedd('0x85')](_0x49fb37['startPredictive'])){_0x49fb37[_0xaedd('0x26')]=undefined;loggerPredictive[_0xaedd('0x7d')](_0x49fb37[_0xaedd('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xaedd('0x85')](_0x49fb37['handlePredictive'])){clearInterval(_0x49fb37['handlePredictive']);_0x49fb37[_0xaedd('0x92')]=undefined;loggerPredictive[_0xaedd('0x7d')](_0x49fb37[_0xaedd('0x3f')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x2a0d7b,_0xc55238){if(_0xc55238===0x0){return 0x0;}var _0xa035b3=0x1;for(var _0x30937d=0x1;_0x30937d<=_0xc55238;_0x30937d+=0x1){_0xa035b3=0x1+_0xa035b3*_0x30937d/_0x2a0d7b;}return 0x1/_0xa035b3;}function isVoiceQueueOutbound(_0x31224f){return _0x31224f==='outbound';}function isNotPreview(_0x23eced){return _0x23eced!==_0xaedd('0x93');}function isCampaignIvr(_0x2c4614){return _0x2c4614===_0xaedd('0x7a');}function getCallerId(_0x4ae321,_0xa6bc94,_0x47f741){if(!_[_0xaedd('0x85')](_0x47f741)&&_0xaedd('0x94')===typeof _0x47f741&&!_[_0xaedd('0x7c')](_0x47f741)){if(!_[_0xaedd('0x85')](_0xa6bc94)&&_0xaedd('0x94')===typeof _0xa6bc94&&!_[_0xaedd('0x7c')](_0xa6bc94)){return util[_0xaedd('0x77')](_0xaedd('0x95'),_0xa6bc94,_0x47f741);}return util[_0xaedd('0x77')](_0xaedd('0x95'),_0x47f741,_0x47f741);}if(!_['isUndefined'](_0x4ae321)&&_0xaedd('0x94')===typeof _0x4ae321&&!_[_0xaedd('0x7c')](_0x4ae321)){return _0x4ae321;}return _0xaedd('0x96');}function loggerCatchQueueSummary(_0x5f20ec,_0x471c5c){return function(_0x4f811c){freeVariablesPredictive(_0x471c5c);emitVoiceQueueSummary(_0x471c5c);emitCampaignSummary(_0x471c5c);loggerSyncQueueSummary[_0xaedd('0x97')](_0x5f20ec,util[_0xaedd('0x98')](_0x4f811c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5168b6,_0x1aedd4){return function(_0x28cf7f){loggerPredictive[_0xaedd('0x97')](_0x1aedd4[_0xaedd('0x3f')],_0x5168b6);loggerPredictive['error'](_0x28cf7f[_0xaedd('0x99')]);freeVariablesPredictive(_0x1aedd4);};}function loggerCatch(_0x31e5de){return function(_0x2d5059){logger[_0xaedd('0x97')](_0x31e5de,util['inspect'](_0x2d5059,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3daaf6){return _0x3daaf6&&!_['isUndefined'](_0x3daaf6)&&_0x3daaf6[_0xaedd('0x9a')]>0x0;}function decremetOriginate(_0x30c49e){if(!_[_0xaedd('0x85')](_0x30c49e)&&_0x30c49e!==null){if(_0x30c49e[_0xaedd('0x9b')](_0xaedd('0x9c'))){if(_0x30c49e[_0xaedd('0x9c')]>0x0){_0x30c49e['originated']-=0x1;}else{logger[_0xaedd('0x97')](_0xaedd('0x9d'));}}}else{logger[_0xaedd('0x97')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x16962b,_0x2aec09,_0x374eb4){if(_0x2aec09>_0x374eb4){for(var _0x218fb1=0x0;_0x218fb1<_0x2aec09-_0x374eb4;_0x218fb1+=0x1){decremetOriginate(_0x16962b);}}}function loggerGetContactDialer(_0x2b7df5,_0x2ee7e6,_0x1fec10){return function(_0x26d92f){checkContactLowerLimitOriginate(_0x2ee7e6,_0x1fec10,0x0);logger[_0xaedd('0x97')](_0x2b7df5,util[_0xaedd('0x98')](_0x26d92f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5c1b78){return function(_0x4b40af){if(isNotNull(_0x4b40af)&&isNotNull(_0x4b40af[0x0])){if(_0x4b40af[0x0][_0xaedd('0x9e')]>0x0){_0x5c1b78[_0xaedd('0x3d')]=_0xaedd('0x9f');logger[_0xaedd('0x7d')](_0xaedd('0xa0')+_0x5c1b78[_0xaedd('0x3f')],_0x4b40af[0x0][_0xaedd('0x9e')],_0xaedd('0xa1'));}else{_0x5c1b78[_0xaedd('0x3d')]=_0xaedd('0xa2');logger['info'](_0xaedd('0xa3')+_0x5c1b78['name']);}}};}function notSendMessagesQueue(_0x2e6fad){if(_0x2e6fad[_0xaedd('0xa4')]){freeVariablesPredictive(_0x2e6fad);if(_0x2e6fad[_0xaedd('0x9c')]===0x0&&_0x2e6fad[_0xaedd('0x54')]===0x0&&_0x2e6fad[_0xaedd('0x58')]===0x0&&(_0x2e6fad['pTalking']||0x0)===0x0){_0x2e6fad[_0xaedd('0xa4')]=![];_0x2e6fad[_0xaedd('0x4f')]=0x0;_0x2e6fad['message']=_0xaedd('0xa5');loggerSyncQueueSummary[_0xaedd('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2e6fad[_0xaedd('0x3f')],'is\x20not\x20active');}else{_0x2e6fad[_0xaedd('0x3d')]=_0xaedd('0xa6');loggerSyncQueueSummary[_0xaedd('0x97')](_0xaedd('0xa7'),_0x2e6fad[_0xaedd('0x3f')],_0xaedd('0xa8'));}emitVoiceQueueSummary(_0x2e6fad);}}function notSendMessagesCampaign(_0x29eead){if(_0x29eead[_0xaedd('0xa4')]){if(_0x29eead['originated']===0x0){_0x29eead['sendMessageOneNotActive']=![];_0x29eead[_0xaedd('0x3d')]=_0xaedd('0xa5');loggerSyncQueueSummary[_0xaedd('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x29eead[_0xaedd('0x3f')],_0xaedd('0xa9'));}else{_0x29eead[_0xaedd('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xaedd('0xaa'),_0x29eead[_0xaedd('0x3f')],_0xaedd('0xa8'));}emitCampaignSummary(_0x29eead);}}function createObjHistory(_0x173861,_0xa61837,_0x2cc5a5,_0xd7c417,_0x4e8dda){_0x173861[_0xaedd('0x3d')]=_0x2cc5a5;var _0x43ca45=new Action(_0x173861,_0xa61837);var _0x451d5c=new History(_0x43ca45);_0x451d5c[_0xaedd('0xab')]=_0xd7c417;_0x451d5c[_0xaedd('0xac')]=_0x4e8dda;_0x451d5c['endtime']=_0x43ca45[_0xaedd('0xad')];return _0x451d5c;}Dialer[_0xaedd('0x1a')][_0xaedd('0xae')]=function(){var _0x466b27=this;setInterval(function(){_0x466b27[_0xaedd('0xaf')](_0x466b27['uniqueId'],_0xaedd('0xb0'));_0x466b27['clearZombieChannels'](_0x466b27['actions'],_0xaedd('0xb1'));},0x32c8);};Dialer[_0xaedd('0x1a')][_0xaedd('0xaf')]=function(_0x21a630,_0x18679c){var _0x224397=this;for(var _0x53da84 in _0x21a630){if(_0x21a630[_0xaedd('0x9b')](_0x53da84)){this['sequence']['enqueue'](function(){if(!_[_0xaedd('0xb2')](_0x21a630[_0x53da84])){return ami[_0xaedd('0xb3')]({'action':_0xaedd('0xb4'),'channel':_0x21a630[_0x53da84][_0xaedd('0xb5')]})[_0xaedd('0xb6')](function(_0x1a0007){if(_0x1a0007['message']===_0xaedd('0xb7')){setTimeout(function(){if(_0x21a630[_0x53da84]&&_0x21a630[_0x53da84][_0xaedd('0x4b')]!==_0xaedd('0x7a')){_0x224397[_0xaedd('0xb8')](_0x224397[_0xaedd('0x1f')][_0x21a630[_0x53da84][_0xaedd('0xb9')]]);logger[_0xaedd('0x97')](_0xaedd('0xba'),_0x18679c,_0x53da84,_0x21a630[_0x53da84][_0xaedd('0xb9')]);delete _0x21a630[_0x53da84];}if(_0x21a630[_0x53da84]&&_0x21a630[_0x53da84][_0xaedd('0x4b')]==='ivr'){_0x224397[_0xaedd('0xb8')](_0x224397[_0xaedd('0x20')][_0x21a630[_0x53da84][_0xaedd('0xb9')]]);logger['error'](_0xaedd('0xbb'),_0x18679c,_0x53da84,_0x21a630[_0x53da84][_0xaedd('0xb9')]);delete _0x21a630[_0x53da84];}},0x2328);}});}});}}};Dialer[_0xaedd('0x1a')][_0xaedd('0xbc')]=function(_0x2af90b){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopper[_0xaedd('0xbc')](_0x2af90b))['catch'](loggerCatch(_0xaedd('0xbf')));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc0')]=function(_0xa4a1b6){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopperBlack['checkIsBlackList'](_0xa4a1b6))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xc1')));};Dialer['prototype'][_0xaedd('0xc2')]=function(_0x5ad4ec){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopperBlack['checkIsBlackListIvr'](_0x5ad4ec))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc3')]=function(_0x1ecc82){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopperHistory['avgHandleTime'](_0x1ecc82))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xc4')));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc5')]=function(_0xd9286d){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopper['rescheduleContact'](_0xd9286d))[_0xaedd('0xb6')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc6')]=function(_0x44513d,_0x2d1b2d,_0x4283ec,_0x2e6778){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopper[_0xaedd('0xc6')](_0x44513d,_0x2d1b2d,_0x4283ec,_0x2e6778))[_0xaedd('0xb6')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc7')]=function(_0x44ff11,_0x20cf78,_0x298f64){return BPromise[_0xaedd('0xbd')]()['then'](cmHopper['getContactDialerIvr'](_0x44ff11,_0x20cf78,_0x298f64))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xc8')));};Dialer[_0xaedd('0x1a')][_0xaedd('0xc9')]=function(_0x3768e4){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3768e4))['catch'](loggerCatch(_0xaedd('0xca')));};Dialer[_0xaedd('0x1a')]['moveContactManagedDialer']=function(_0x5d9c42){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopper[_0xaedd('0xcb')](_0x5d9c42))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xcc')));};Dialer[_0xaedd('0x1a')]['createHistory']=function(_0x44da4c){return BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](cmHopperHistory[_0xaedd('0xcd')](_0x44da4c))['catch'](loggerCatch(_0xaedd('0xce')));};Dialer[_0xaedd('0x1a')]['updateOriginated']=function(_0x5d9253){if(!_['isUndefined'](_0x5d9253)&&_0x5d9253!==null){if(_0x5d9253[_0xaedd('0x9b')](_0xaedd('0x9c'))){if(_0x5d9253[_0xaedd('0x9c')]>0x0){_0x5d9253[_0xaedd('0x9c')]-=0x1;}else{logger[_0xaedd('0x97')](_0xaedd('0xcf'));}}}else{logger[_0xaedd('0x97')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xaedd('0x1a')][_0xaedd('0xd0')]=function(_0x4c8ea9,_0x1e68b7){var _0xce4214=this;return function(_0x38d51d){_0xce4214[_0xaedd('0xb8')](_0x1e68b7);logger['error'](_0x4c8ea9,util[_0xaedd('0x98')](_0x38d51d,{'showHidden':![],'depth':null}));};};Dialer[_0xaedd('0x1a')][_0xaedd('0xd1')]=function(_0x5a8aec,_0x3efff1,_0x61486c){var _0x2794b5={'state':0x19,'statedesc':'notFound'};this[_0xaedd('0xb8')](_0x3efff1);this[_0xaedd('0xd2')](_[_0xaedd('0xd3')](_0x2794b5,_[_0xaedd('0xd4')](_0x61486c,[_0xaedd('0xd5'),'ListId',_0xaedd('0xd6'),_0xaedd('0xd7'),_0xaedd('0xd8')])),_0xaedd('0xd9'),_0xaedd('0xda'));logger[_0xaedd('0x97')](_0x5a8aec);};Dialer[_0xaedd('0x1a')]['isSuccess']=function(_0xe6d20d){return _0xe6d20d===_0xaedd('0xdb');};Dialer['prototype'][_0xaedd('0xdc')]=function(_0x3fbdd1){return!_[_0xaedd('0x85')](_0x3fbdd1)&&_0x3fbdd1&&!_[_0xaedd('0x85')](_0x3fbdd1[_0xaedd('0x3f')])&&!_['isUndefined'](_0x3fbdd1[_0xaedd('0x75')])&&_0x3fbdd1[_0xaedd('0x75')]&&(this['trunks'][util['format'](_0xaedd('0xdd'),_0x3fbdd1['name'])][_0xaedd('0xb4')]===_0xaedd('0xde')||this['trunks'][util['format'](_0xaedd('0xdd'),_0x3fbdd1[_0xaedd('0x3f')])][_0xaedd('0xb4')]===_0xaedd('0xdf'));};Dialer[_0xaedd('0x1a')]['saveInDb']=function(_0x413129,_0x3af50f,_0x432294){this[_0xaedd('0xcd')](_0x413129)[_0xaedd('0xb6')](loggerCatch(_0x3af50f));this['moveContactManagedDialer'](_0x413129)['catch'](loggerCatch(_0x432294));};Dialer[_0xaedd('0x1a')][_0xaedd('0x38')]=function(_0x39a28b){var _0x9ea755=this[_0xaedd('0x25')][_0x39a28b[_0xaedd('0xe0')]];var _0x5b111e;if(!_[_0xaedd('0xb2')](_0x39a28b)&&!_[_0xaedd('0xb2')](_0x39a28b[_0xaedd('0xe1')])&&!_['isNil'](_0x39a28b['variable']['amdstatus'])&&_0x39a28b[_0xaedd('0xe2')]===_0xaedd('0xe3')&&_0x9ea755){if(_0x9ea755[_0xaedd('0x4b')]!==_0xaedd('0x7a')&&this[_0xaedd('0x1f')][_0x9ea755[_0xaedd('0xb9')]][_0xaedd('0xe4')]&&_0x39a28b[_0xaedd('0xe5')]===_0xaedd('0xe6')){delete this[_0xaedd('0x25')][_0x39a28b[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this['voiceQueues'][_0x9ea755[_0xaedd('0xb9')]]);this[_0xaedd('0x1f')][_0x9ea755['queue']][_0xaedd('0x5f')]+=0x1;this[_0xaedd('0x1f')][_0x9ea755[_0xaedd('0xb9')]][_0xaedd('0x5e')]+=0x1;_0x5b111e=new Hangup(_0x9ea755,_0x39a28b);_0x5b111e['state']=0x12;_0x5b111e[_0xaedd('0xac')]=_0xaedd('0xe7');_0x5b111e[_0xaedd('0xe8')]=_0xaedd('0xe9');this['saveInDb'](_0x5b111e,_0xaedd('0xea'),_0xaedd('0xeb'));}if(_0x9ea755[_0xaedd('0x4b')]!==_0xaedd('0x7a')&&this[_0xaedd('0x1f')][_0x9ea755['queue']]['dialAMDActive']&&_0x39a28b[_0xaedd('0xe5')]==='MACHINE'){delete this['uniqueId'][_0x39a28b[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this['voiceQueues'][_0x9ea755[_0xaedd('0xb9')]]);this[_0xaedd('0x1f')][_0x9ea755[_0xaedd('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x9ea755[_0xaedd('0xb9')]][_0xaedd('0x5e')]+=0x1;_0x5b111e=new Hangup(_0x9ea755,_0x39a28b);_0x5b111e[_0xaedd('0xab')]=0x13;_0x5b111e['statedesc']=_0xaedd('0xec');_0x5b111e[_0xaedd('0xe8')]=_0xaedd('0xe9');_0x5b111e[_0xaedd('0xed')]=!![];this[_0xaedd('0xd2')](_0x5b111e,_0xaedd('0xee'),_0xaedd('0xef'));}if(_0x9ea755[_0xaedd('0x4b')]===_0xaedd('0x7a')&&this[_0xaedd('0x20')][_0x9ea755[_0xaedd('0xb9')]]['dialAMDActive']&&_0x39a28b[_0xaedd('0xe5')]===_0xaedd('0xe6')){delete this[_0xaedd('0x25')][_0x39a28b[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this['campaigns'][_0x9ea755[_0xaedd('0xb9')]]);_0x5b111e=new Hangup(_0x9ea755,_0x39a28b);_0x5b111e[_0xaedd('0xab')]=0x12;_0x5b111e[_0xaedd('0xac')]=_0xaedd('0xe7');_0x5b111e[_0xaedd('0xe8')]=_0xaedd('0xe9');this[_0xaedd('0xd2')](_0x5b111e,_0xaedd('0xf0'),_0xaedd('0xf1'));}if(_0x9ea755[_0xaedd('0x4b')]===_0xaedd('0x7a')&&this[_0xaedd('0x20')][_0x9ea755[_0xaedd('0xb9')]]['dialAMDActive']&&_0x39a28b[_0xaedd('0xe5')]===_0xaedd('0xf2')){delete this['uniqueId'][_0x39a28b[_0xaedd('0xe0')]];this['updateOriginated'](this[_0xaedd('0x20')][_0x9ea755[_0xaedd('0xb9')]]);_0x5b111e=new Hangup(_0x9ea755,_0x39a28b);_0x5b111e[_0xaedd('0xab')]=0x13;_0x5b111e[_0xaedd('0xac')]=_0xaedd('0xec');_0x5b111e['membername']=_0xaedd('0xe9');_0x5b111e[_0xaedd('0xed')]=!![];this[_0xaedd('0xd2')](_0x5b111e,_0xaedd('0xf3'),_0xaedd('0xf4'));}}};Dialer['prototype'][_0xaedd('0xf5')]=function(_0x5286a5){var _0x56e5d0=this[_0xaedd('0x25')][_0x5286a5[_0xaedd('0xe0')]];var _0x5501ad=this;var _0x5134ae;if(_0x56e5d0&&_0x56e5d0[_0xaedd('0x4b')]===_0xaedd('0x7a')){delete this[_0xaedd('0x25')][_0x5286a5[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this['campaigns'][_0x56e5d0[_0xaedd('0xb9')]]);this[_0xaedd('0x20')][_0x56e5d0[_0xaedd('0xb9')]][_0xaedd('0xf6')]+=0x1;_0x5134ae=new Hangup(_0x56e5d0,_0x5286a5);this[_0xaedd('0xcd')](_0x5134ae)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xf7')));this[_0xaedd('0xcb')](_0x5134ae)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xf8')));}if(_0x56e5d0&&_0x56e5d0['type']!==_0xaedd('0x7a')&&isNotNull(this[_0xaedd('0x1f')][_0x56e5d0[_0xaedd('0xb9')]][_0xaedd('0xf9')])){delete this[_0xaedd('0x25')][_0x5286a5[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this[_0xaedd('0x1f')][_0x56e5d0['queue']]);this[_0xaedd('0x1f')][_0x56e5d0['queue']][_0xaedd('0x5f')]+=0x1;this[_0xaedd('0x1f')][_0x56e5d0[_0xaedd('0xb9')]][_0xaedd('0x5e')]+=0x1;_0x5134ae=new Hangup(_0x56e5d0,_0x5286a5);_0x5134ae[_0xaedd('0xab')]=0x10;_0x5134ae[_0xaedd('0xac')]=_0xaedd('0xfa');_0x5134ae[_0xaedd('0xe8')]=_0xaedd('0xfb');this[_0xaedd('0xcd')](_0x5134ae)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xf7')));this[_0xaedd('0xcb')](_0x5134ae)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xf8')));}if(_0x56e5d0&&_0x56e5d0[_0xaedd('0x4b')]!==_0xaedd('0x7a')&&!isNotNull(this[_0xaedd('0x1f')][_0x56e5d0[_0xaedd('0xb9')]][_0xaedd('0xf9')])){delete this[_0xaedd('0x25')][_0x5286a5[_0xaedd('0xe0')]];this[_0xaedd('0xb8')](this[_0xaedd('0x1f')][_0x56e5d0[_0xaedd('0xb9')]]);this['voiceQueues'][_0x56e5d0[_0xaedd('0xb9')]][_0xaedd('0x6a')]+=0x1;_0x5134ae=new Hangup(_0x56e5d0,_0x5286a5);_0x5134ae[_0xaedd('0xab')]=0xc;_0x5134ae[_0xaedd('0xac')]=_0x5286a5['cause-txt'];_0x5134ae[_0xaedd('0xe8')]=_0xaedd('0xfc');this[_0xaedd('0xcd')](_0x5134ae)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xf7')));this['moveContactManagedDialer'](_0x5134ae)['catch'](loggerCatch(_0xaedd('0xf8')));}};Dialer[_0xaedd('0x1a')][_0xaedd('0x32')]=function(_0x33d6f7){var _0x21910d=this[_0xaedd('0x25')][_0x33d6f7['uniqueid']];var _0x2e2668=this;if(this[_0xaedd('0x1f')][_0x33d6f7['queue']]){if(_0x21910d&&_0x21910d[_0xaedd('0x4b')]!==_0xaedd('0x7a')){delete this['uniqueId'][_0x33d6f7['uniqueid']];this[_0xaedd('0x1f')][_0x33d6f7['queue']][_0xaedd('0x5f')]+=0x1;var _0x3a1329=new AgentComplete(_0x21910d,_0x33d6f7);if(_0x33d6f7[_0xaedd('0xfd')]===_0xaedd('0xfe')){_0x3a1329[_0xaedd('0xff')]=this[_0xaedd('0x1f')][_0x33d6f7[_0xaedd('0xb9')]][_0xaedd('0x100')]&&this[_0xaedd('0x1f')][_0x33d6f7['queue']][_0xaedd('0x101')]?moment()['format'](_0xaedd('0x102')):undefined;}this[_0xaedd('0xcd')](_0x3a1329)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x103')));this[_0xaedd('0xcb')](_0x3a1329)['catch'](loggerCatch(_0xaedd('0x104')));}}};Dialer[_0xaedd('0x1a')]['syncAgentConnect']=function(_0x4b45cf){if(this[_0xaedd('0x1f')][_0x4b45cf[_0xaedd('0xb9')]]){if(this[_0xaedd('0x25')][_0x4b45cf['uniqueid']]&&this[_0xaedd('0x25')][_0x4b45cf[_0xaedd('0xe0')]][_0xaedd('0x4b')]!==_0xaedd('0x7a')){this[_0xaedd('0xb8')](this[_0xaedd('0x1f')][_0x4b45cf[_0xaedd('0xb9')]]);this[_0xaedd('0x25')][_0x4b45cf[_0xaedd('0xe0')]][_0xaedd('0x105')]=moment()['format'](_0xaedd('0x102'));}}};Dialer[_0xaedd('0x1a')][_0xaedd('0x106')]=function(_0x3123cc){this[_0xaedd('0xcd')](_0x3123cc)[_0xaedd('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xaedd('0xcb')](_0x3123cc)['catch'](loggerCatch(_0xaedd('0x107')));};Dialer[_0xaedd('0x1a')]['syncQueueCallerAbandon']=function(_0x439ea5){var _0x9a0112=this[_0xaedd('0x25')][_0x439ea5[_0xaedd('0xe0')]];var _0x2f013c=this;if(this[_0xaedd('0x1f')][_0x439ea5[_0xaedd('0xb9')]]){if(_0x9a0112&&_0x9a0112[_0xaedd('0x4b')]!==_0xaedd('0x7a')){delete this['uniqueId'][_0x439ea5['uniqueid']];this[_0xaedd('0xb8')](this[_0xaedd('0x1f')][_0x439ea5['queue']]);_0x9a0112['droptime']=moment()[_0xaedd('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1263c6=new QueueCallerAbandon(_0x9a0112,_0x439ea5);if(getSeconds(_0x9a0112[_0xaedd('0x108')],_0x9a0112[_0xaedd('0x109')])>=_0x9a0112[_0xaedd('0x10a')]){this[_0xaedd('0x1f')][_0x439ea5[_0xaedd('0xb9')]][_0xaedd('0x82')]+=0x1;this[_0xaedd('0x1f')][_0x439ea5['queue']][_0xaedd('0x64')]+=0x1;this[_0xaedd('0x1f')][_0x439ea5[_0xaedd('0xb9')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1263c6[_0xaedd('0xab')]=0xa;_0x1263c6[_0xaedd('0xac')]=_0xaedd('0x10b');_0x1263c6[_0xaedd('0x10c')]=_0xaedd('0x10d');_0x1263c6[_0xaedd('0xff')]=this['voiceQueues'][_0x439ea5[_0xaedd('0xb9')]][_0xaedd('0x100')]?moment()[_0xaedd('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xaedd('0x106')](_0x1263c6);}else{this[_0xaedd('0x1f')][_0x439ea5[_0xaedd('0xb9')]][_0xaedd('0x10e')]+=0x1;this[_0xaedd('0x1f')][_0x439ea5[_0xaedd('0xb9')]][_0xaedd('0x63')]+=0x1;_0x1263c6[_0xaedd('0xab')]=0xb;_0x1263c6[_0xaedd('0xac')]=_0xaedd('0x10f');_0x1263c6[_0xaedd('0x10c')]=_0xaedd('0x110');this[_0xaedd('0x106')](_0x1263c6);}}}};Dialer[_0xaedd('0x1a')][_0xaedd('0x36')]=function(_0x53e8fe){if(this[_0xaedd('0x111')][_0x53e8fe[_0xaedd('0xe0')]]){this[_0xaedd('0x111')][_0x53e8fe[_0xaedd('0xe0')]][_0xaedd('0xb5')]=_0x53e8fe[_0xaedd('0xb5')];}if(this[_0xaedd('0x25')][_0x53e8fe[_0xaedd('0xe0')]]){this[_0xaedd('0x25')][_0x53e8fe[_0xaedd('0xe0')]][_0xaedd('0xb5')]=_0x53e8fe[_0xaedd('0xb5')];}};Dialer['prototype'][_0xaedd('0x3a')]=function(_0xe70014){if(strategy[this[_0xaedd('0x1f')][this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]][_0xaedd('0xb9')]][_0xaedd('0x4d')]]===_0xaedd('0x19')){if(this['actions'][_0xe70014[_0xaedd('0x112')]]&&_[_0xaedd('0xb2')](this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]][_0xaedd('0x113')])&&_0xe70014[_0xaedd('0xb4')]==='1'&&_0xe70014['paused']==='0'){if(this[_0xaedd('0x21')][_0xe70014[_0xaedd('0x114')]]){if(!this[_0xaedd('0x21')][_0xe70014[_0xaedd('0x114')]][_0xaedd('0x113')]){this['agents'][_0xe70014[_0xaedd('0x114')]][_0xaedd('0x113')]=!![];this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]][_0xaedd('0x113')]=!![];this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]]['stateinterface']=_0xe70014[_0xaedd('0x114')];}}}}else if((strategy[this[_0xaedd('0x1f')][this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]][_0xaedd('0xb9')]][_0xaedd('0x4d')]]||'rrmemory')===_0xaedd('0x115')){if(this[_0xaedd('0x111')][_0xe70014['actionid']]){if(this[_0xaedd('0x21')][_0xe70014[_0xaedd('0x114')]]){this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]][_0xaedd('0x114')]=_0xe70014[_0xaedd('0x114')];if(_[_0xaedd('0xb2')](this[_0xaedd('0x28')][this[_0xaedd('0x111')][_0xe70014[_0xaedd('0x112')]]['queue']])){this[_0xaedd('0x28')][this['actions'][_0xe70014[_0xaedd('0x112')]][_0xaedd('0xb9')]]=[];}this['queueBooked'][this['actions'][_0xe70014[_0xaedd('0x112')]][_0xaedd('0xb9')]][_0xaedd('0x116')](_[_0xaedd('0xd3')](_[_0xaedd('0xd4')](this['actions'][_0xe70014[_0xaedd('0x112')]],[_0xaedd('0x117'),_0xaedd('0x114')]),{'status':_0xe70014[_0xaedd('0xb4')],'paused':_0xe70014[_0xaedd('0x118')]}));}}}};function unlockQueueStatus(_0xb7e985,_0x552719){setTimeout(function(){if(_['isUndefined'](_0xb7e985['queueStatusComplete'])){loggerBooked['error'](_0xaedd('0x119'),_0x552719);}_0xb7e985[_0xaedd('0x11a')]=!![];loggerBooked['info'](_0xaedd('0x11b'),_0x552719,JSON[_0xaedd('0x47')](_['pick'](_0xb7e985,[_0xaedd('0x3f'),_0xaedd('0x11a')])));},0x1f3);}Dialer[_0xaedd('0x1a')]['syncQueueStatusComplete']=function(_0x24bb0c){var _0x2c0719=this;var _0x53c554=_0x2c0719[_0xaedd('0x1f')][_0x2c0719[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]];if(strategy[this[_0xaedd('0x1f')][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]['strategy']]===_0xaedd('0x19')){if(this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]]&&this['actions'][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0x114')]){this['preview'][_0xaedd('0x11c')](this[_0xaedd('0x111')][_0x24bb0c['actionid']]['idHopper'],this[_0xaedd('0x111')][_0x24bb0c['actionid']][_0xaedd('0x114')])[_0xaedd('0xb6')](function(_0xd2a6af){logger[_0xaedd('0x97')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xaedd('0x98')](_0xd2a6af,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2c0719['updateOriginated'](_0x2c0719[_0xaedd('0x1f')][_0x2c0719[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]);_0x2c0719[_0xaedd('0x21')][_0x2c0719[_0xaedd('0x111')][_0x24bb0c['actionid']]['stateinterface']][_0xaedd('0x113')]=![];delete _0x2c0719['actions'][_0x24bb0c[_0xaedd('0x112')]];unlockQueueStatus(_0x53c554);});}else{this[_0xaedd('0xb8')](this[_0xaedd('0x1f')][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]);this[_0xaedd('0xc5')]({'active':![],'ContactId':this[_0xaedd('0x111')][_0x24bb0c['actionid']]['ContactId'],'ListId':this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0x11d')],'VoiceQueueId':this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xd7')]||undefined,'CampaignId':this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]]['CampaignId']||undefined})[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x11e')));delete this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]];unlockQueueStatus(_0x53c554);}}else if((strategy[this[_0xaedd('0x1f')][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]][_0xaedd('0x4d')]]||_0xaedd('0x115'))===_0xaedd('0x115')){var _0x21eb7e;if(this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]]&&!_[_0xaedd('0x7c')](this[_0xaedd('0x28')][this[_0xaedd('0x111')][_0x24bb0c['actionid']][_0xaedd('0xb9')]])){if(this[_0xaedd('0x29')][_0x2c0719[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]){this[_0xaedd('0x29')][_0x2c0719[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]=this[_0xaedd('0x29')][this[_0xaedd('0x111')][_0x24bb0c['actionid']]['queue']]?this[_0xaedd('0x29')][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]]:this[_0xaedd('0x28')][this[_0xaedd('0x111')][_0x24bb0c['actionid']][_0xaedd('0xb9')]]?this['queueBooked'][this[_0xaedd('0x111')][_0x24bb0c['actionid']][_0xaedd('0xb9')]][_0xaedd('0x11f')]||0x0:0x0;}this['queueBooked'][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]][_0xaedd('0xb9')]][_0xaedd('0x11f')]=this[_0xaedd('0x29')][this[_0xaedd('0x111')][_0x24bb0c[_0xaedd('0x112')]]['queue']];for(var _0x312f45=0x0;_0x312f45=0x0?!![]:![];})[_0xaedd('0xb6')](myreject(_0x2da7e3)));}}else{_0x1c8fd2[_0xaedd('0x116')](ami[_0xaedd('0xb3')]({'action':'command','command':util[_0xaedd('0x77')](_0xaedd('0x135'),_0x3a7afa,!_[_0xaedd('0x85')](config[_0xaedd('0x131')][_0x41017a])?_0x41017a:'')})[_0xaedd('0xbe')](function(_0x257128){return _0x257128['content'][_0xaedd('0x139')]('true')>=0x0?!![]:![];})[_0xaedd('0xb6')](myreject(_0x2da7e3)));}BPromise[_0xaedd('0x13a')](_0x1c8fd2)['then'](function(_0x412227){var _0x2856d3=_['some'](_0x412227);if(_0x2856d3){return _0x4cf3d2(_0x2856d3);}else{_0x3a9d27[_0xaedd('0x3d')]=_0x5a0cd0?_0xaedd('0x13b'):_0xaedd('0x13c');return _0x2da7e3(msgResponse(_0xaedd('0x13d'),_0xaedd('0x130'),_0xaedd('0x13e')+_0x5a0cd0+'\x20'+_0xd395fd+_0xaedd('0x13f')+util[_0xaedd('0x98')](_0x3a7afa,{'showHidden':![],'depth':null})+_0xaedd('0x140')+_0x41017a));}})[_0xaedd('0xb6')](function(_0x31a9f6){return _0x2da7e3(msgResponse('ifTime',_0xaedd('0x130'),JSON['stringify'](_0x31a9f6)));});});};Dialer[_0xaedd('0x1a')][_0xaedd('0x141')]=function(_0x5b941a){var _0x4888f6=this;return function(){switch(_0x5b941a[_0xaedd('0x142')]){case _0xaedd('0x143'):freeVariablesPredictive(_0x5b941a);_0x4888f6['handlePower'](_0x5b941a,0x1);break;case _0xaedd('0x144'):freeVariablesPredictive(_0x5b941a);_0x4888f6[_0xaedd('0x145')](_0x5b941a,_0x5b941a[_0xaedd('0x146')]);break;case _0xaedd('0x147'):_0x4888f6[_0xaedd('0x147')](_0x5b941a);break;case'booked':freeVariablesPredictive(_0x5b941a);_0x4888f6[_0xaedd('0x145')](_0x5b941a,0x1);break;default:freeVariablesPredictive(_0x5b941a);logger[_0xaedd('0x97')](_0xaedd('0x148'),_0x5b941a[_0xaedd('0x3f')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xaedd('0x149')]=function(_0x45ba2d){var _0x4b7647=this;return function(){_0x4b7647[_0xaedd('0x14a')](_0x45ba2d);};};Dialer[_0xaedd('0x1a')][_0xaedd('0x9')]=function(_0xcc916f){var _0x1f6e99=this;if(isNotPreview(_0xcc916f[_0xaedd('0x142')])){if(isVoiceQueueOutbound(_0xcc916f[_0xaedd('0x4b')])&&isActive(_0xcc916f['dialActive'])){_0xcc916f[_0xaedd('0xa4')]=!![];BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](checkIsLoggedIn(_0xcc916f,_0xcc916f['loggedIn']))[_0xaedd('0xbe')](checkIsActive(_0xcc916f,_0xcc916f[_0xaedd('0x5a')]))[_0xaedd('0xbe')](checkInterval(_0xcc916f))[_0xaedd('0xbe')](_0x1f6e99[_0xaedd('0x12a')](_0xcc916f))[_0xaedd('0xbe')](_0x1f6e99[_0xaedd('0x14b')](_0xcc916f[_0xaedd('0x14c')],_0xcc916f['dialTimezone'],_0xcc916f[_0xaedd('0x3f')],_0xcc916f))[_0xaedd('0xbe')](_0x1f6e99[_0xaedd('0x12f')](_0xcc916f['Interval'],_0xcc916f[_0xaedd('0x14d')],_0xcc916f[_0xaedd('0x3f')],_0xcc916f))['then'](_0x1f6e99[_0xaedd('0x141')](_0xcc916f))['catch'](loggerCatchQueueSummary(_0xaedd('0x14e'),_0xcc916f));}else{notSendMessagesQueue(_0xcc916f);}}else{freeVariablesPredictive(_0xcc916f);}};Dialer[_0xaedd('0x1a')][_0xaedd('0x129')]=function(){var _0x191dc2=this;var _0x1a5c0a;for(var _0x4c552e in this[_0xaedd('0x20')]){if(this[_0xaedd('0x20')][_0xaedd('0x9b')](_0x4c552e)){_0x1a5c0a=this[_0xaedd('0x20')][_0x4c552e];if(isCampaignIvr(_0x1a5c0a[_0xaedd('0x4b')])&&isActive(_0x1a5c0a['active'])){_0x1a5c0a[_0xaedd('0xa4')]=!![];BPromise[_0xaedd('0xbd')]()[_0xaedd('0xbe')](checkIsActive(_0x1a5c0a,_0x1a5c0a[_0xaedd('0x75')]))[_0xaedd('0xbe')](checkInterval(_0x1a5c0a))[_0xaedd('0xbe')](_0x191dc2['checkIsTrunkReachable'](_0x1a5c0a))['then'](_0x191dc2[_0xaedd('0x14b')](_0x1a5c0a[_0xaedd('0x14c')],_0x1a5c0a[_0xaedd('0x14d')],_0x1a5c0a[_0xaedd('0x3f')],_0x1a5c0a))[_0xaedd('0xbe')](_0x191dc2[_0xaedd('0x12f')](_0x1a5c0a[_0xaedd('0x42')],_0x1a5c0a['dialTimezone'],_0x1a5c0a[_0xaedd('0x3f')],_0x1a5c0a))[_0xaedd('0xbe')](_0x191dc2[_0xaedd('0x149')](_0x1a5c0a))[_0xaedd('0xb6')](loggerCatchQueueSummary(_0xaedd('0x14f'),_0x1a5c0a));}else{notSendMessagesCampaign(_0x1a5c0a);}}}};function getCallerIdRandom(_0x521663,_0x584e47){var _0x1f2621,_0x193ee9,_0x461904;if(_0x584e47<=0x0){_0x584e47=0x1;}_0x1f2621=new RegExp('\x5cw{0,'+_0x584e47+'}$');_0x193ee9=Math[_0xaedd('0x150')](0xa,_0x584e47-0x1);_0x461904=Math['pow'](0xa,_0x584e47)-0x1;return util['format']('%s',_[_0xaedd('0x151')](_0x521663,_0x1f2621,_[_0xaedd('0x152')](_0x193ee9,_0x461904)));}function extractCalleridName(_0x23265b){var _0x926a38=_0x23265b['match'](/"(.*?)"/);return _0x926a38?_0x926a38[0x1]:_0x23265b;}function extractCalleridNumber(_0x36c442){var _0x1c4dfa=_0x36c442[_0xaedd('0x153')](/<(.*?)>/);return _0x1c4dfa?_0x1c4dfa[0x1]:_0x36c442;}Dialer[_0xaedd('0x1a')][_0xaedd('0x154')]=function(_0x2a2ca1,_0x1e7fca){var _0x490cd0=this;var _0x448fab=uuid['v4']();this[_0xaedd('0x111')][_0x448fab]=new Action(_0x2a2ca1,_0x1e7fca,_0x448fab);return new BPromise(function(_0x2c9af2,_0x4f44cc){if(_[_0xaedd('0x85')](_0x2a2ca1)&&_0xaedd('0x155')!==typeof _0x2a2ca1){return _0x4f44cc(msgResponse(_0xaedd('0x156'),_0xaedd('0x130'),_0xaedd('0x157')));}if(_[_0xaedd('0x85')](_0x1e7fca['Contact']['phone'])||_0x1e7fca[_0xaedd('0x158')][_0xaedd('0x159')]===null){return _0x4f44cc(msgResponse(_0xaedd('0x156'),_0xaedd('0x130'),_0xaedd('0x15a')));}var _0x43ed08={'XMD-CALLERID':_0x490cd0[_0xaedd('0x111')][_0x448fab][_0xaedd('0x15b')](),'XMD-AGI':_0x2a2ca1[_0xaedd('0xf9')]?util[_0xaedd('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2a2ca1[_0xaedd('0xf9')]):_0xaedd('0x15c'),'XMD-AGIAFTER':_0x2a2ca1[_0xaedd('0x100')]?util['format'](_0xaedd('0x15d'),ipAgi,_0x2a2ca1['dialQueueProject2']):_0xaedd('0x15c'),'XMD-QUEUE':_0x2a2ca1[_0xaedd('0x4b')]===_0xaedd('0x4c')?util[_0xaedd('0x77')](_0xaedd('0x15e'),_0x2a2ca1['name'],_0x2a2ca1[_0xaedd('0x15f')]||'',_0x2a2ca1[_0xaedd('0x101')]?'c':'',_0x2a2ca1['dialQueueTimeout']||0x3):_0xaedd('0x15c'),'XMD-CONTACTID':_0x1e7fca['ContactId'],'XMD-CDRTYPE':_0xaedd('0x160'),'CALLERID(all)':_0x490cd0['actions'][_0x448fab][_0xaedd('0x15b')](),'XMD-AMD':_0x2a2ca1[_0xaedd('0xe4')]?_0xaedd('0x161'):_0xaedd('0x15c'),'XMD-DESTINATION':_0xaedd('0xe3')};if(_0x2a2ca1[_0xaedd('0xe4')]){_0x43ed08['XMD-AMDINITIALSILENCE']=_0x2a2ca1[_0xaedd('0x162')]||0x9c4;_0x43ed08[_0xaedd('0x163')]=_0x2a2ca1[_0xaedd('0x164')]||0x5dc;_0x43ed08['XMD-AMDAFTERGREETINGSILENCE']=_0x2a2ca1[_0xaedd('0x165')]||0x320;_0x43ed08['XMD-AMDTOTALANALYSISTIME']=_0x2a2ca1[_0xaedd('0x166')]||0x1388;_0x43ed08['XMD-AMDMINWORDLENGTH']=_0x2a2ca1[_0xaedd('0x167')]||0x64;_0x43ed08[_0xaedd('0x168')]=_0x2a2ca1['dialAMDBetweenWordsSilence']||0x32;_0x43ed08['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2a2ca1[_0xaedd('0x169')]||0x3;_0x43ed08[_0xaedd('0x16a')]=_0x2a2ca1[_0xaedd('0x16b')]||0x100;_0x43ed08[_0xaedd('0x16c')]=_0x2a2ca1[_0xaedd('0x16d')]||0x1388;}if(_0x2a2ca1[_0xaedd('0x4b')]==='outbound'){_0x43ed08[_0xaedd('0x16e')]=_0x1e7fca['VoiceQueueId'];}else{_0x43ed08[_0xaedd('0x16f')]=_0x1e7fca[_0xaedd('0xd8')];}for(var _0x165e49 in _0x1e7fca[_0xaedd('0x158')]){if(_0x1e7fca[_0xaedd('0x158')][_0xaedd('0x9b')](_0x165e49)){if(isNotNull(_0x1e7fca[_0xaedd('0x158')][_0x165e49])&&_0x165e49!=='id'&&_0x165e49!==_0xaedd('0x170')&&_0x165e49!==_0xaedd('0x171')&&_0x165e49!=='updatedAt'){_0x43ed08[util[_0xaedd('0x77')]('%s%s',_0xaedd('0x172'),_[_0xaedd('0x173')](_0x165e49))]=_0x1e7fca[_0xaedd('0x158')][_0x165e49];}}}var _0x51a978=_0x490cd0['isTrunkReachable'](_0x2a2ca1[_0xaedd('0x74')])?getCallerId(_0x2a2ca1['Trunk']['callerid'],_0x2a2ca1[_0xaedd('0x5b')],_0x2a2ca1[_0xaedd('0x174')]>0x0?getCallerIdRandom(_0x2a2ca1[_0xaedd('0x5c')],_0x2a2ca1[_0xaedd('0x174')]):_0x2a2ca1[_0xaedd('0x5c')]):getCallerId(_[_0xaedd('0xb2')](_0x2a2ca1['TrunkBackup'])?_0x2a2ca1[_0xaedd('0x74')][_0xaedd('0x76')]:_0x2a2ca1[_0xaedd('0x12b')]['callerid'],_0x2a2ca1[_0xaedd('0x5b')],_0x2a2ca1[_0xaedd('0x174')]>0x0?getCallerIdRandom(_0x2a2ca1['dialOriginateCallerIdNumber'],_0x2a2ca1['dialRandomLastDigitCallerIdNumber']):_0x2a2ca1['dialOriginateCallerIdNumber']);if(_0x51a978){_0x43ed08[_0xaedd('0x175')]=_0x490cd0[_0xaedd('0x111')][_0x448fab][_0xaedd('0x176')]=extractCalleridName(_0x51a978);_0x43ed08[_0xaedd('0x177')]=_0x490cd0[_0xaedd('0x111')][_0x448fab][_0xaedd('0x178')]=extractCalleridNumber(_0x51a978);}return ami[_0xaedd('0xb3')]({'actionid':_0x448fab,'action':'originate','channel':_0x490cd0['isTrunkReachable'](_0x2a2ca1[_0xaedd('0x74')])?util[_0xaedd('0x77')](_0xaedd('0x179'),_0x2a2ca1[_0xaedd('0x74')][_0xaedd('0x3f')],isNotNull(_0x2a2ca1[_0xaedd('0x17a')])?_0x2a2ca1[_0xaedd('0x17a')][_0xaedd('0x17b')]()||'':'',_0x2a2ca1[_0xaedd('0x17c')]>0x0?_0x1e7fca[_0xaedd('0x158')][_0xaedd('0x159')][_0xaedd('0x17d')](_0x2a2ca1[_0xaedd('0x17c')]):_0x1e7fca[_0xaedd('0x158')]['phone']):util[_0xaedd('0x77')](_0xaedd('0x179'),_[_0xaedd('0xb2')](_0x2a2ca1[_0xaedd('0x12b')])?_0x2a2ca1[_0xaedd('0x74')]['name']:_0x2a2ca1['TrunkBackup']['name'],isNotNull(_0x2a2ca1[_0xaedd('0x17a')])?_0x2a2ca1[_0xaedd('0x17a')][_0xaedd('0x17b')]()||'':'',_0x2a2ca1['dialCutDigit']>0x0?_0x1e7fca['Contact'][_0xaedd('0x159')][_0xaedd('0x17d')](_0x2a2ca1['dialCutDigit']):_0x1e7fca[_0xaedd('0x158')]['phone']),'callerid':_0x51a978,'Exten':_0xaedd('0xe3'),'Context':'from-sip','Priority':'1','variable':_0x43ed08,'timeout':(_0x2a2ca1[_0xaedd('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x448fab})[_0xaedd('0xbe')](function(_0x1c9628){return _0x2c9af2(_0x1c9628);})['catch'](function(_0x3f6518){_0x2a2ca1['outboundOriginateFailureCallsDay']+=0x1;var _0x404ea7=new History(_0x490cd0[_0xaedd('0x111')][_0x448fab]);logger[_0xaedd('0x97')](util[_0xaedd('0x77')](_0xaedd('0x17e'),JSON[_0xaedd('0x47')](_0x3f6518)));_0x404ea7[_0xaedd('0xab')]=0xe;_0x404ea7[_0xaedd('0xac')]=_0xaedd('0x17f');_0x404ea7[_0xaedd('0xad')]=moment()[_0xaedd('0x77')](_0xaedd('0x102'));_0x404ea7[_0xaedd('0x180')]=_0x404ea7['starttime'];_0x490cd0['createHistory'](_0x404ea7)['catch'](loggerCatch(_0xaedd('0x181')));_0x490cd0[_0xaedd('0xcb')](_0x404ea7)[_0xaedd('0xb6')](loggerCatch('[originate][error]'))[_0xaedd('0x1d')](function(){delete _0x490cd0['actions'][_0x448fab];return _0x4f44cc(msgResponse(_0xaedd('0x156'),'Error',_0xaedd('0x182')));});});});};Dialer[_0xaedd('0x1a')][_0xaedd('0x30')]=function(_0x3df0bc){var _0x439f30=this[_0xaedd('0x111')][_0x3df0bc[_0xaedd('0x112')]];var _0x3c2b7e=this;if(_0x439f30){delete this[_0xaedd('0x111')][_0x3df0bc['actionid']];_0x439f30[_0xaedd('0x109')]=moment()[_0xaedd('0x77')](_0xaedd('0x102'));var _0x1412bd=_0x439f30[_0xaedd('0x4b')]===_0xaedd('0x7a')?this[_0xaedd('0x20')][_0x439f30[_0xaedd('0xb9')]]:this['voiceQueues'][_0x439f30[_0xaedd('0x183')]()];if(!this[_0xaedd('0x184')](_0x3df0bc[_0xaedd('0x185')])){this['updateOriginated'](_0x1412bd);return this[_0xaedd('0x186')](_0x439f30,_0x1412bd,_0x3df0bc)[_0xaedd('0xbe')](function(_0x3dd14e){})[_0xaedd('0xb6')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0xaedd('0x25')][_0x3df0bc[_0xaedd('0xe0')]]=_0x439f30;}}};Dialer['prototype'][_0xaedd('0x187')]=function(_0x4f7d87,_0xbf1d82,_0x95497f){var _0x4a2f9d=new History(_0xbf1d82);if(_0x4a2f9d[_0xaedd('0x188')]+_0x4a2f9d[_0xaedd('0x189')]+_0x4a2f9d[_0xaedd('0x18a')]>=_0x95497f[_0xaedd('0x18b')]-0x1){return!![];}switch(_0x4f7d87){case 0x3:if(_0x4a2f9d[_0xaedd('0x18a')]>=_0x95497f['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xaedd('0xc5')]({'active':![],'countnoanswerretry':_0x4a2f9d[_0xaedd('0x18a')]+=0x1,'scheduledat':moment()['add'](_0x95497f[_0xaedd('0x18c')],_0xaedd('0x18d'))[_0xaedd('0x77')](_0xaedd('0x102')),'ContactId':_0x4a2f9d[_0xaedd('0xd5')],'ListId':_0x4a2f9d['ListId'],'VoiceQueueId':_0x4a2f9d[_0xaedd('0xd7')]||undefined,'CampaignId':_0x4a2f9d[_0xaedd('0xd8')]||undefined})[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x18e')));}break;case 0x5:if(_0x4a2f9d[_0xaedd('0x188')]>=_0x95497f[_0xaedd('0x18f')]-0x1){return!![];}else{this[_0xaedd('0xc5')]({'active':![],'countbusyretry':_0x4a2f9d[_0xaedd('0x188')]+=0x1,'scheduledat':moment()[_0xaedd('0x190')](_0x95497f[_0xaedd('0x191')],_0xaedd('0x18d'))[_0xaedd('0x77')](_0xaedd('0x102')),'ContactId':_0x4a2f9d[_0xaedd('0xd5')],'ListId':_0x4a2f9d['ListId'],'VoiceQueueId':_0x4a2f9d['VoiceQueueId']||undefined,'CampaignId':_0x4a2f9d[_0xaedd('0xd8')]||undefined})[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x192')));}break;case 0x8:if(_0x4a2f9d['countcongestionretry']>=_0x95497f[_0xaedd('0x193')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x4a2f9d[_0xaedd('0x189')]+=0x1,'scheduledat':moment()['add'](_0x95497f[_0xaedd('0x194')],'minutes')[_0xaedd('0x77')](_0xaedd('0x102')),'ContactId':_0x4a2f9d[_0xaedd('0xd5')],'ListId':_0x4a2f9d[_0xaedd('0x11d')],'VoiceQueueId':_0x4a2f9d[_0xaedd('0xd7')]||undefined,'CampaignId':_0x4a2f9d[_0xaedd('0xd8')]||undefined})['catch'](loggerCatch(_0xaedd('0x195')));}break;default:return!![];}};Dialer[_0xaedd('0x1a')][_0xaedd('0x186')]=function(_0x3e4506,_0x1d4897,_0x92764){var _0x53480b=this;var _0x1de49c=new History(_0x3e4506);return new BPromise(function(_0x3557c3,_0x13092f){if(_[_0xaedd('0x85')](_0x1d4897)&&_0xaedd('0x155')!==typeof _0x1d4897){return _0x13092f(msgResponse(_0xaedd('0x196'),'Failure',_0xaedd('0x197')));}if(_[_0xaedd('0x85')](_0x92764)&&_0xaedd('0x155')!==typeof _0x92764){return _0x13092f(msgResponse('[callProgressDetecting]',_0xaedd('0x130'),'evt\x20is\x20undefine'));}switch(_0x92764[_0xaedd('0xfd')]){case'0':_0x1d4897[_0xaedd('0x66')]+=0x1;_0x1de49c['state']=0x0;_0x1de49c[_0xaedd('0xac')]=_0xaedd('0x198');_0x53480b['createHistory'](_0x1de49c)['catch'](loggerCatch(_0xaedd('0x199')));if(_0x53480b['checkRetriveMax'](0x0,_0x3e4506,_0x1d4897)){if(_0x1de49c[_0xaedd('0x188')]+_0x1de49c['countcongestionretry']+_0x1de49c[_0xaedd('0x18a')]>=_0x1d4897[_0xaedd('0x18b')]){_0x53480b[_0xaedd('0x19a')](_0x1de49c,_0x3557c3,_0x13092f,_0xaedd('0x19b'));}else{_0x53480b[_0xaedd('0x19c')](_0x1de49c,_0x3557c3,_0x13092f,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1d4897[_0xaedd('0x65')]+=0x1;_0x1de49c[_0xaedd('0xab')]=0x3;_0x1de49c[_0xaedd('0xac')]=_0xaedd('0x19d');_0x1de49c[_0xaedd('0x18a')]+=0x1;_0x1de49c[_0xaedd('0x19e')]+=0x1;_0x53480b[_0xaedd('0xcd')](_0x1de49c)[_0xaedd('0xb6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x53480b[_0xaedd('0x187')](0x3,_0x3e4506,_0x1d4897)){if(_0x1de49c[_0xaedd('0x18a')]>=_0x1d4897['dialNoAnswerMaxRetry']){_0x53480b['createStateFinal'](_0x1de49c,_0x3557c3,_0x13092f,_0xaedd('0x19f'));}else{_0x53480b['stateGlobal'](_0x1de49c,_0x3557c3,_0x13092f,_0xaedd('0x19f'));}}break;case'5':_0x1d4897['outboundBusyCallsDay']+=0x1;_0x1de49c['state']=0x5;_0x1de49c['statedesc']=_0xaedd('0x1a0');_0x1de49c[_0xaedd('0x188')]+=0x1;_0x1de49c[_0xaedd('0x19e')]+=0x1;_0x53480b[_0xaedd('0xcd')](_0x1de49c)[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x1a1')));if(_0x53480b[_0xaedd('0x187')](0x5,_0x3e4506,_0x1d4897)){if(_0x1de49c[_0xaedd('0x188')]>=_0x1d4897[_0xaedd('0x18f')]){_0x53480b[_0xaedd('0x19c')](_0x1de49c,_0x3557c3,_0x13092f,'reason\x205\x20busy');}else{_0x53480b[_0xaedd('0x19a')](_0x1de49c,_0x3557c3,_0x13092f,_0xaedd('0x1a2'));}}break;case'8':_0x1d4897[_0xaedd('0x1a3')]+=0x1;_0x1de49c[_0xaedd('0xab')]=0x8;_0x1de49c[_0xaedd('0xac')]=_0xaedd('0x1a4');_0x1de49c[_0xaedd('0x189')]+=0x1;_0x1de49c['countglobal']+=0x1;_0x53480b[_0xaedd('0xcd')](_0x1de49c)['catch'](loggerCatch(_0xaedd('0x1a5')));if(_0x53480b[_0xaedd('0x187')](0x8,_0x3e4506,_0x1d4897)){if(_0x1de49c[_0xaedd('0x189')]>=_0x1d4897[_0xaedd('0x193')]){_0x53480b[_0xaedd('0x19c')](_0x1de49c,_0x3557c3,_0x13092f,'reason\x208\x20congestion');}else{_0x53480b[_0xaedd('0x19a')](_0x1de49c,_0x3557c3,_0x13092f,_0xaedd('0x1a6'));}}break;default:_0x1d4897[_0xaedd('0x6a')]+=0x1;_0x1de49c[_0xaedd('0xab')]=0xc;_0x1de49c[_0xaedd('0xac')]=_0x92764[_0xaedd('0xfd')];_0x53480b['createHistory'](_0x1de49c)[_0xaedd('0xb6')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x53480b[_0xaedd('0x187')](_0x92764[_0xaedd('0xfd')],_0x3e4506,_0x1d4897)){if(_0x1de49c[_0xaedd('0x188')]+_0x1de49c[_0xaedd('0x189')]+_0x1de49c[_0xaedd('0x18a')]>=_0x1d4897[_0xaedd('0x18b')]){_0x53480b[_0xaedd('0x19a')](_0x1de49c,_0x3557c3,_0x13092f,_0x92764['reason']);}else{_0x53480b[_0xaedd('0x19c')](_0x1de49c,_0x3557c3,_0x13092f,_0x92764['reason']);}}}});};Dialer[_0xaedd('0x1a')]['stateGlobal']=function(_0x2ac5c6,_0xeca918,_0x5dc972,_0x9cbf15){var _0x28f24e=new Final(_0x2ac5c6);_0x28f24e[_0xaedd('0xab')]=0xf;_0x28f24e[_0xaedd('0xac')]=_0xaedd('0x1a7');this[_0xaedd('0x19c')](_0x28f24e,_0xeca918,_0x5dc972,_0x9cbf15);};Dialer['prototype'][_0xaedd('0x19c')]=function(_0xdda63f,_0x4bf109,_0x2a1512,_0x1e5185){this['moveContactManagedDialer'](_0xdda63f)[_0xaedd('0xbe')](function(_0x29b3ed){return _0x4bf109(msgResponse(_0xaedd('0x196'),_0xaedd('0xdb'),_0x1e5185));})['catch'](function(_0x17e193){return _0x2a1512(msgResponse(_0xaedd('0x1a8'),_0xaedd('0x130'),_0xaedd('0x1a9')));});};Dialer['prototype']['predictive']=function(_0x5c1e25){var _0x4d94dc=this;var _0x2bfaf9=_0x5c1e25[_0xaedd('0x1aa')]/0x64;var _0x1f3635=_0x5c1e25[_0xaedd('0x64')]/(_0x5c1e25[_0xaedd('0x64')]+_0x5c1e25['outboundAnswerCallsDay']);var _0x54fbaf=Math[_0xaedd('0x1ab')](_0x5c1e25[_0xaedd('0x6f')]*(_0x5c1e25[_0xaedd('0x1ac')]/0x64));var _0x48cbd2=Math[_0xaedd('0x1ab')](_0x5c1e25['predictiveIntervalAvailable']*(_0x5c1e25[_0xaedd('0x1ad')]/0x64));var _0x475cc3=_0x5c1e25[_0xaedd('0x4f')]+_0x5c1e25[_0xaedd('0x54')];var _0x3aadf9=Math['floor'](_0x5c1e25['erlangCalls']*_0x5c1e25['erlangAbandonmentRate']*_0x5c1e25['predictiveIntervalHitRate']*_0x5c1e25[_0xaedd('0x6e')]);if(_[_0xaedd('0x85')](_0x5c1e25[_0xaedd('0x27')])){if(!_['isUndefined'](_0x5c1e25[_0xaedd('0x26')])){_0x5c1e25[_0xaedd('0x26')]=undefined;loggerPredictive['error'](_0xaedd('0x1ae'),_0xaedd('0x1af'));}if(!_['isUndefined'](_0x5c1e25[_0xaedd('0x92')])){loggerPredictive[_0xaedd('0x97')](_0xaedd('0x1ae'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5c1e25['handlePredictive']);_0x5c1e25[_0xaedd('0x92')]=undefined;}_0x5c1e25[_0xaedd('0x27')]=moment()[_0xaedd('0x77')](_0xaedd('0x102'));loggerPredictive['info'](_0x5c1e25[_0xaedd('0x3f')],_0xaedd('0x1b0'),_0x5c1e25['startProgressive']);this['handlePower'](_0x5c1e25,0x1);}else if(ifInterval(_0x5c1e25[_0xaedd('0x1b1')],_0x5c1e25[_0xaedd('0x27')])){this[_0xaedd('0x145')](_0x5c1e25,0x1);loggerPredictiveCalls[_0xaedd('0x7d')]('[startMethodPredictive][StartProgressive][Loop]',_0x5c1e25['startProgressive'],_0x5c1e25[_0xaedd('0x3f')]);_0x5c1e25['erlangCalls']=0x0;_0x5c1e25[_0xaedd('0x6d')]=0x0;}else if(_0x2bfaf9<_0x1f3635&&_0x5c1e25[_0xaedd('0x1b2')]===_0xaedd('0x1b3')){freeVariablesPredictive(_0x5c1e25);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1b4'),_0xaedd('0x1b5'),_0x1f3635,_0xaedd('0x27'),_0x5c1e25[_0xaedd('0x3f')]);}else if(_0x3aadf9<_0x5c1e25[_0xaedd('0x6d')]&&_0x5c1e25[_0xaedd('0x1b2')]==='dropRate'){freeVariablesPredictive(_0x5c1e25);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1b6'),_0xaedd('0x1b7'),_0x3aadf9,_0xaedd('0x1b8'),_0x5c1e25[_0xaedd('0x6d')],'startProgressive',_0x5c1e25[_0xaedd('0x3f')]);}else if(!ifInterval(_0x5c1e25[_0xaedd('0x1b1')],_0x5c1e25['startProgressive'])&&_['isUndefined'](_0x5c1e25[_0xaedd('0x26')])&&!_[_0xaedd('0x85')](_0x5c1e25[_0xaedd('0x27')])){_0x5c1e25[_0xaedd('0x26')]=moment()[_0xaedd('0x77')](_0xaedd('0x102'));loggerPredictive[_0xaedd('0x7d')](_0x5c1e25['name'],_0xaedd('0x1b9'),_0x5c1e25[_0xaedd('0x26')]);this[_0xaedd('0xc3')](_0x5c1e25[_0xaedd('0x1b1')])[_0xaedd('0xbe')](this[_0xaedd('0x1ba')](_0x5c1e25))[_0xaedd('0xbe')](mergeDataErlangB(_0x5c1e25))[_0xaedd('0xbe')](this['startMethodPredictive'](_0x5c1e25))['catch'](loggerCatchPredictive(_0xaedd('0x1bb'),_0x5c1e25));}else if(!ifInterval(_0x5c1e25['dialPredictiveInterval'],_0x5c1e25[_0xaedd('0x26')])){_0x5c1e25[_0xaedd('0x6d')]=0x0;_0x5c1e25[_0xaedd('0x26')]=moment()['format'](_0xaedd('0x102'));loggerPredictive[_0xaedd('0x7d')](_0x5c1e25[_0xaedd('0x3f')],_0xaedd('0x1bc'),_0x5c1e25['startPredictive']);clearInterval(_0x5c1e25[_0xaedd('0x92')]);_0x5c1e25[_0xaedd('0x92')]=undefined;this[_0xaedd('0xc3')](_0x5c1e25[_0xaedd('0x1b1')])['then'](this['getDataPredictive'](_0x5c1e25))[_0xaedd('0xbe')](mergeDataErlangB(_0x5c1e25))[_0xaedd('0xbe')](this[_0xaedd('0x1bd')](_0x5c1e25))[_0xaedd('0xb6')](loggerCatchPredictive(_0xaedd('0x1be'),_0x5c1e25));}else if(_0x5c1e25[_0xaedd('0x6f')]&&_0x475cc3<_0x5c1e25['predictiveIntervalAvailable']-_0x48cbd2){freeVariablesPredictive(_0x5c1e25);loggerPredictive[_0xaedd('0x7d')](_0x5c1e25[_0xaedd('0x3f')],_0xaedd('0x1bf'),_0x475cc3,_0xaedd('0x1c0'),_0x5c1e25[_0xaedd('0x6f')],'-',_0x48cbd2,'=',_0x5c1e25['predictiveIntervalAvailable']-_0x48cbd2,')');}else if(_0x5c1e25[_0xaedd('0x6f')]&&_0x475cc3>_0x5c1e25[_0xaedd('0x6f')]+_0x54fbaf){freeVariablesPredictive(_0x5c1e25);loggerPredictive[_0xaedd('0x7d')](_0x5c1e25[_0xaedd('0x3f')],_0xaedd('0x1bf'),_0x475cc3,_0xaedd('0x1c1'),_0x5c1e25[_0xaedd('0x6f')],'+',_0x54fbaf,'=',_0x5c1e25[_0xaedd('0x6f')]+_0x54fbaf,')');}};Dialer[_0xaedd('0x1a')][_0xaedd('0x1ba')]=function(_0xda237e){var _0x95bfc6=this;return function(_0x3dc2bc){return new BPromise(function(_0x4410fb,_0x1cfcde){_[_0xaedd('0xd3')](_0xda237e,_0x3dc2bc[0x0]);if(checkGetDataPredictive(_0x3dc2bc[0x0])){var _0x27eba2=_0xda237e[_0xaedd('0x6f')]=_0xda237e[_0xaedd('0x54')]+_0xda237e[_0xaedd('0x4f')];var _0x5b5c9d=_0xda237e['dialPredictiveInterval']*0x3c;var _0x590925=_0x3dc2bc[0x0]['predictiveIntervalAvgTalktime']+_0x3dc2bc[0x0][_0xaedd('0x87')];var _0x7a8389=(_0x3dc2bc[0x0]['predictiveIntervalAnsweredCalls']+_0x3dc2bc[0x0][_0xaedd('0x82')]+_0x3dc2bc[0x0][_0xaedd('0x10e')])/_0x3dc2bc[0x0]['predictiveIntervalTotalCalls'];_0xda237e['predictiveIntervalHitRate']=_0x7a8389>0x0?_0x7a8389:0x1;switch(_0xda237e[_0xaedd('0x1b2')]){case _0xaedd('0x1b3'):var _0x22b5bd=_0xda237e[_0xaedd('0x1aa')]/0x64;return _0x95bfc6[_0xaedd('0x1c2')](_0x27eba2,_0x5b5c9d,_0x590925,_0x7a8389,_0x22b5bd)[_0xaedd('0xbe')](function(_0x27a606){return _0x4410fb(_0x27a606);});case _0xaedd('0x1c3'):var _0x5d941f=_0xda237e[_0xaedd('0x1aa')]/0x64;return _0x95bfc6[_0xaedd('0x1c4')](_0x27eba2,_0x5b5c9d,_0x590925,_0x7a8389,_0x5d941f)[_0xaedd('0xbe')](function(_0x3d2e32){return _0x4410fb(_0x3d2e32);});default:return _0x1cfcde(msgResponse('[getDataPredictive]','Failure',_0xaedd('0x1c5')));}}else{return _0x1cfcde(msgResponse('[getDataPredictive]','Failure',_0xaedd('0x1c6')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x2777d8){var _0x505b3c=this;return function(_0x247f7f){return new BPromise(function(_0x4bc6b2,_0x5d368d){_['merge'](_0x2777d8,_0x247f7f[0x0]);if(checkGetDataPredictive(_0x247f7f[0x0])){loggerPredictive[_0xaedd('0x7d')](JSON[_0xaedd('0x47')](_0x247f7f[0x0]));if(_0x2777d8['dialPredictiveOptimization']===_0xaedd('0x1b3')){return _0x505b3c[_0xaedd('0xc9')](_0x2777d8['id'])['then'](function(_0x199268){var _0x312520=_0x2777d8[_0xaedd('0x50')]-_0x199268[0x0][_0xaedd('0x1c7')];var _0xf70c7d=_0x2777d8[_0xaedd('0x1b1')]*0x3c;var _0x4b1b63=_0x247f7f[0x0][_0xaedd('0x6c')]+_0x247f7f[0x0]['predictiveIntervalAvgHoldtime'];var _0x59523d=(_0x247f7f[0x0][_0xaedd('0x6b')]+_0x247f7f[0x0][_0xaedd('0x82')]+_0x247f7f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x247f7f[0x0][_0xaedd('0x70')];var _0x4fdc3e=_0x2777d8[_0xaedd('0x1aa')]/0x64;_0x2777d8['predictiveIntervalPauses']=_0x199268[0x0][_0xaedd('0x1c7')]||0x0;_0x2777d8['predictiveIntervalHitRate']=_0x59523d>0x0?_0x59523d:0x1;return _0x505b3c['abandonmentRate'](_0x312520,_0xf70c7d,_0x4b1b63,_0x59523d,_0x4fdc3e);})['then'](function(_0x424dec){return _0x4bc6b2(_0x424dec);})[_0xaedd('0xb6')](function(_0x4916d4){return _0x5d368d(msgResponse(_0xaedd('0x1c8'),_0xaedd('0x130'),JSON[_0xaedd('0x47')](_0x4916d4)));});}if(_0x2777d8[_0xaedd('0x1b2')]===_0xaedd('0x1c3')){return _0x505b3c[_0xaedd('0xc9')](_0x2777d8['id'])[_0xaedd('0xbe')](function(_0x494211){var _0x301200=_0x2777d8[_0xaedd('0x50')]-_0x494211[0x0]['outboundQueuePauses'];var _0x5ae05b=_0x2777d8[_0xaedd('0x1b1')]*0x3c;var _0x4684b8=_0x247f7f[0x0]['predictiveIntervalAvgTalktime']+_0x247f7f[0x0][_0xaedd('0x87')];var _0x50d720=(_0x247f7f[0x0][_0xaedd('0x6b')]+_0x247f7f[0x0][_0xaedd('0x82')]+_0x247f7f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x247f7f[0x0][_0xaedd('0x70')];var _0x3226be=_0x2777d8[_0xaedd('0x1aa')]/0x64;_0x2777d8['predictiveIntervalPauses']=_0x494211[0x0][_0xaedd('0x1c7')]||0x0;_0x2777d8[_0xaedd('0x1c9')]=_0x50d720>0x0?_0x50d720:0x1;return _0x505b3c['busyFactor'](_0x301200,_0x5ae05b,_0x4684b8,_0x50d720,_0x3226be);})[_0xaedd('0xbe')](function(_0x1c9f9c){return _0x4bc6b2(_0x1c9f9c);})[_0xaedd('0xb6')](function(_0x711c83){return _0x5d368d(msgResponse('[CatchErlangB]',_0xaedd('0x130'),JSON[_0xaedd('0x47')](_0x711c83)));});}}else{return _0x5d368d(msgResponse(_0xaedd('0x1ca'),_0xaedd('0x130'),_0xaedd('0x1c6')));}});};};Dialer['prototype'][_0xaedd('0x1bd')]=function(_0x16808f){var _0x45e34c=this;return function(){var _0x1aeb9d=0x0;var _0x1e30c3=Math[_0xaedd('0x1cb')](_0x16808f[_0xaedd('0x71')]*0x3e8);if(_0x1e30c3>0x0){_0x1e30c3=_0x1e30c3<0x64?0x64:_0x1e30c3;loggerPredictive['info'](_0x16808f[_0xaedd('0x3f')],_0xaedd('0x1cc'),_0x1e30c3,'milliseconds');_0x16808f[_0xaedd('0x92')]=setInterval(function(){_0x45e34c[_0xaedd('0x92')](_0x16808f);loggerPredictiveCalls['info'](_0xaedd('0x1cd'),_0x1aeb9d+=0x1);},_0x1e30c3);}else{loggerPredictive[_0xaedd('0x7d')](_0x16808f[_0xaedd('0x3f')],_0xaedd('0x1ce'));}};};Dialer['prototype'][_0xaedd('0x1cf')]=function(_0x2f1910,_0x5d0b95){var _0x1bf00b=this;return function(_0xba9ed7){if(_[_0xaedd('0x7c')](_0xba9ed7)){if(_[_0xaedd('0xb2')](_0x5d0b95[_0xaedd('0xd6')])||!_0x5d0b95[_0xaedd('0x1d0')]){if(_0x2f1910[_0xaedd('0x142')]===_0xaedd('0x7')){_0x2f1910[_0xaedd('0x11a')]=_[_0xaedd('0x85')](_0x2f1910['queueStatusComplete'])?!![]:_0x2f1910[_0xaedd('0x11a')];var _0x463aa4=uuid['v4']();_0x1bf00b[_0xaedd('0x111')][_0x463aa4]=new Action(_0x2f1910,_0x5d0b95,_0x463aa4);loggerBooked['info']('[booked][checkContactBlack]',_0x463aa4,_0xaedd('0x1d1'),JSON[_0xaedd('0x47')](_0x2f1910[_0xaedd('0x11a')]),'Queue:\x20',_0x2f1910['name']);if(_0x2f1910[_0xaedd('0x11a')]){_0x2f1910[_0xaedd('0x11a')]=![];_0x1bf00b['queueBooked'][_0x1bf00b[_0xaedd('0x111')][_0x463aa4][_0xaedd('0xb9')]]=[];ami[_0xaedd('0xb3')]({'actionid':_0x463aa4,'action':_0xaedd('0x1d2'),'queue':_0x2f1910[_0xaedd('0x3f')]})[_0xaedd('0xb6')](function(_0x4c4d09){_0x1bf00b['updateOriginated'](_0x2f1910);_0x1bf00b[_0xaedd('0xc5')]({'active':![],'ContactId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4]['ContactId'],'ListId':_0x1bf00b['actions'][_0x463aa4]['ListId'],'VoiceQueueId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4][_0xaedd('0xd7')]||undefined,'CampaignId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4][_0xaedd('0xd8')]||undefined})[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x1d3')));delete _0x1bf00b['actions'][_0x463aa4];});}else{loggerBooked[_0xaedd('0x7d')](_0xaedd('0x1d4'),JSON[_0xaedd('0x47')](_0x2f1910[_0xaedd('0x11a')]),'Queue:\x20',_0x2f1910['name']);_0x1bf00b[_0xaedd('0xb8')](_0x2f1910);_0x1bf00b[_0xaedd('0xc5')]({'active':![],'ContactId':_0x1bf00b['actions'][_0x463aa4][_0xaedd('0xd5')],'ListId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4][_0xaedd('0x11d')],'VoiceQueueId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4]['VoiceQueueId']||undefined,'CampaignId':_0x1bf00b[_0xaedd('0x111')][_0x463aa4][_0xaedd('0xd8')]||undefined})[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x1d3')));delete _0x1bf00b[_0xaedd('0x111')][_0x463aa4];}}else{return _0x1bf00b['actionOriginate'](_0x2f1910,_0x5d0b95);}}else{if(getDiff(_0x5d0b95[_0xaedd('0x1d5')])<_0x2f1910[_0xaedd('0x1d6')]*0x3c){_0x1bf00b[_0xaedd('0x93')]['run'](_0x5d0b95['id'])[_0xaedd('0x1d')](function(){_0x1bf00b[_0xaedd('0xb8')](_0x2f1910);});}else{_0x2f1910['outboundReCallsDay']+=0x1;_0x1bf00b[_0xaedd('0xb8')](_0x2f1910);if(_0x2f1910[_0xaedd('0x1d7')]){_0x1bf00b[_0xaedd('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5d0b95['ContactId'],'ListId':_0x5d0b95[_0xaedd('0x11d')],'VoiceQueueId':_0x5d0b95[_0xaedd('0xd7')]||undefined,'CampaignId':_0x5d0b95[_0xaedd('0xd8')]||undefined})['catch'](loggerCatch(_0xaedd('0x1d8')));_0x1bf00b[_0xaedd('0xcd')](createObjHistory(_0x2f1910,_0x5d0b95,_0xaedd('0x1d9'),0x17,_0xaedd('0x1da')))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0x1db')));}else{_0x1bf00b[_0xaedd('0xd2')](createObjHistory(_0x2f1910,_0x5d0b95,_0xaedd('0x1dc'),0x16,'RecallFailedTimeout'),_0xaedd('0x1dd'),'[Originate][HistoryRecallClose]');}}}}else{_0x2f1910[_0xaedd('0x60')]+=0x1;_0x1bf00b['saveInDb'](createObjHistory(_0x2f1910,_0x5d0b95,_0xaedd('0x1de'),0xd,_0xaedd('0x1df')),_0xaedd('0x1e0'),_0xaedd('0x1e1'));throw _0xaedd('0x1e2');}};};Dialer[_0xaedd('0x1a')][_0xaedd('0x14a')]=function(_0x42559f){var _0x588127=this;var _0x238fee=[];var _0x1b81c7=_0x42559f[_0xaedd('0x1e3')]-_0x42559f[_0xaedd('0x9c')]-_0x42559f[_0xaedd('0x1e4')];emitCampaignSummary(_0x42559f);if(_0x1b81c7>0x0){if(_0x1b81c7>this[_0xaedd('0x23')]){_0x1b81c7=this[_0xaedd('0x23')];}_0x42559f[_0xaedd('0x1e4')]+=_0x1b81c7;this[_0xaedd('0xc7')](_0x42559f['id'],_0x1b81c7,_0x42559f[_0xaedd('0x1e5')])[_0xaedd('0xbe')](function(_0x507108){_0x42559f[_0xaedd('0x1e4')]-=_0x1b81c7;_0x42559f[_0xaedd('0x1e4')]=_0x42559f['temp']>0x0?_0x42559f[_0xaedd('0x1e4')]:0x0;if(!checkContactEmpty(_0x507108)){_0x42559f[_0xaedd('0x3d')]=_0xaedd('0xa2');logger[_0xaedd('0x7d')](_0xaedd('0x1e6')+_0x42559f[_0xaedd('0x3f')]);}else{_0x42559f['originated']+=_0x507108[_0xaedd('0x9a')];_0x42559f[_0xaedd('0x3d')]='RUNNING';for(var _0x53117c=0x0;_0x53117c<_0x507108['length'];_0x53117c+=0x1){_0x42559f['ivrTotalCallsDays']+=0x1;if(_[_0xaedd('0xb2')](_0x507108[_0x53117c])||_[_0xaedd('0xb2')](_0x507108[_0x53117c]['Contact'])||_[_0xaedd('0xb2')](_0x507108[_0x53117c]['Contact'][_0xaedd('0x159')])){_0x588127['emptyContact'](_0xaedd('0x1e7'),_0x42559f,_0x507108[_0x53117c]);}else{_0x588127['checkIsBlackListIvr'](_[_0xaedd('0xd4')](_0x507108[_0x53117c],['CampaignId','Contact.phone']))[_0xaedd('0xbe')](_0x588127[_0xaedd('0x1cf')](_0x42559f,_0x507108[_0x53117c]))[_0xaedd('0xb6')](_0x588127['loggerHandler'](_0xaedd('0x1e8'),_0x42559f));}}}})[_0xaedd('0xb6')](loggerGetContactDialer(_0xaedd('0x1e9'),_0x42559f,_0x1b81c7));}};Dialer['prototype'][_0xaedd('0x145')]=function(_0x441ee6,_0xaf2a96){var _0x400e65=this;var _0x3838f0=[];var _0x12b8ff=_0xaf2a96>=0x1?_0xaf2a96:0x1;var _0x4cf368=[];if(_0x441ee6[_0xaedd('0x142')]===_0xaedd('0x7')){_0x12b8ff=0x1;}var _0x4e5395=Math[_0xaedd('0x1cb')](_0x441ee6['available']*_0x12b8ff)-_0x441ee6['originated']-_0x441ee6[_0xaedd('0x1e4')];emitVoiceQueueSummary(_0x441ee6);if(_0x441ee6[_0xaedd('0x1ea')]>0x0){var _0x634a81=_0x441ee6[_0xaedd('0x1ea')]-_0x441ee6[_0xaedd('0x9c')]-_0x441ee6['talking']-_0x441ee6[_0xaedd('0x1e4')]-_0x441ee6[_0xaedd('0x51')];if(_0x4e5395>_0x634a81){_0x4e5395=_0x634a81;}}if(_0x4e5395>0x0){if(_0x441ee6[_0xaedd('0x142')]===_0xaedd('0x7')){_0x4e5395=0x1;}if(_0x4e5395>this['maxNumberOriginate']){_0x4e5395=this['maxNumberOriginate'];}_0x441ee6['temp']+=_0x4e5395;for(var _0x2b418e in this[_0xaedd('0x21')]){if(this['agents']['hasOwnProperty'](_0x2b418e)){if(this[_0xaedd('0x21')][_0x2b418e][_0xaedd('0xab')]==='not_inuse'&&this[_0xaedd('0x21')][_0x2b418e][_0xaedd('0xb4')]==='reachable'){_0x3838f0[_0xaedd('0x116')](this['agents'][_0x2b418e]['id']);}}}this[_0xaedd('0xc6')](_0x441ee6['id'],_0x3838f0,_0x4e5395,_0x441ee6[_0xaedd('0x1e5')])[_0xaedd('0xbe')](function(_0x3e1ecb){_0x441ee6[_0xaedd('0x1e4')]-=_0x4e5395;_0x441ee6[_0xaedd('0x1e4')]=_0x441ee6[_0xaedd('0x1e4')]>0x0?_0x441ee6[_0xaedd('0x1e4')]:0x0;if(!checkContactEmpty(_0x3e1ecb)){_0x400e65[_0xaedd('0xbc')](_0x441ee6)[_0xaedd('0xbe')](sendMessageReschedule(_0x441ee6))[_0xaedd('0xb6')](loggerCatch(_0xaedd('0xbf')));}else{_0x441ee6[_0xaedd('0x9c')]+=_0x3e1ecb[_0xaedd('0x9a')];_0x441ee6[_0xaedd('0x3d')]=_0x441ee6['dialMethod']===_0xaedd('0x7')?'ACTIVE':'RUNNING';for(var _0x6ef20f=0x0;_0x6ef20f<_0x3e1ecb[_0xaedd('0x9a')];_0x6ef20f+=0x1){if(_['isNil'](_0x3e1ecb[_0x6ef20f])||_[_0xaedd('0xb2')](_0x3e1ecb[_0x6ef20f]['Contact'])||_[_0xaedd('0xb2')](_0x3e1ecb[_0x6ef20f][_0xaedd('0x158')][_0xaedd('0x159')])){_0x400e65[_0xaedd('0xd1')](_0xaedd('0x1e7'),_0x441ee6,_0x3e1ecb[_0x6ef20f]);}else{_0x400e65[_0xaedd('0xc0')](_['pick'](_0x3e1ecb[_0x6ef20f],['VoiceQueueId',_0xaedd('0x1eb')]))[_0xaedd('0xbe')](_0x400e65[_0xaedd('0x1cf')](_0x441ee6,_0x3e1ecb[_0x6ef20f]))[_0xaedd('0xb6')](_0x400e65[_0xaedd('0xd0')](_0xaedd('0x1e7'),_0x441ee6));}}}})[_0xaedd('0xb6')](loggerGetContactDialer(_0xaedd('0x1ec'),_0x441ee6,_0x4e5395));}};Dialer[_0xaedd('0x1a')][_0xaedd('0x92')]=function(_0x2dff5f){var _0x54ec14=this;if(_0x2dff5f[_0xaedd('0x1ea')]>0x0){var _0x21af1c=_0x2dff5f[_0xaedd('0x1ea')]-_0x2dff5f[_0xaedd('0x9c')]-_0x2dff5f['talking'];if(_0x21af1c>0x0){this['tryOriginatePredictive'](_0x2dff5f);}else{loggerPredictiveCalls['info'](_0xaedd('0x1ed'));}}else{this[_0xaedd('0x1ee')](_0x2dff5f);}};Dialer[_0xaedd('0x1a')][_0xaedd('0x1ee')]=function(_0x33697e){var _0x34acd7=this;var _0x14801f=[];_0x33697e[_0xaedd('0x9c')]+=0x1;for(var _0x1600a8 in this[_0xaedd('0x21')]){if(this[_0xaedd('0x21')][_0xaedd('0x9b')](_0x1600a8)){if(this[_0xaedd('0x21')][_0x1600a8][_0xaedd('0xab')]==='not_inuse'&&this[_0xaedd('0x21')][_0x1600a8][_0xaedd('0xb4')]===_0xaedd('0xde')){_0x14801f['push'](this[_0xaedd('0x21')][_0x1600a8]['id']);}}}this[_0xaedd('0xc6')](_0x33697e['id'],_0x14801f,0x1,_0x33697e[_0xaedd('0x1e5')])[_0xaedd('0xbe')](function(_0xc2d938){if(!checkContactEmpty(_0xc2d938)){checkContactLowerLimitOriginate(_0x33697e,0x1,0x0);_0x34acd7[_0xaedd('0xbc')](_0x33697e)[_0xaedd('0xbe')](sendMessageReschedule(_0x33697e))[_0xaedd('0xb6')](loggerCatch('[countReScheduled]\x20'));}else{_0x33697e['message']=_0xaedd('0x1ef');if(_['isNil'](_0xc2d938[0x0])||_['isNil'](_0xc2d938[0x0][_0xaedd('0x158')])||_[_0xaedd('0xb2')](_0xc2d938[0x0]['Contact'][_0xaedd('0x159')])){_0x34acd7[_0xaedd('0xd1')](_0xaedd('0x1e7'),_0x33697e,_0xc2d938[0x0]);}else{_0x34acd7['checkIsBlackList'](_[_0xaedd('0xd4')](_0xc2d938[0x0],['VoiceQueueId','Contact.phone']))['then'](_0x34acd7['checkContactBlack'](_0x33697e,_0xc2d938[0x0]))[_0xaedd('0xb6')](_0x34acd7[_0xaedd('0xd0')](_0xaedd('0x1f0'),_0x33697e));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x33697e,0x1));emitVoiceQueueSummary(_0x33697e);};Dialer['prototype'][_0xaedd('0x1c2')]=function(_0x84133c,_0x11df4e,_0x3fbabb,_0xa478e8,_0x391293,_0x4b4b6d){loggerPredictive['info'](_0xaedd('0x1f1'));loggerPredictive[_0xaedd('0x7d')]('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',_0x84133c);loggerPredictive['info'](_0xaedd('0x1f2'),_0x11df4e);loggerPredictive['info'](_0xaedd('0x1f3'),_0x3fbabb);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1f4'),_0xa478e8);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1f5'),_0x391293);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x90'));return new BPromise(function(_0x32212e,_0x2c1f47){if(_0x84133c<=0x0||isNaN(_0x84133c)){return _0x2c1f47(msgResponse(_0xaedd('0x1f6'),_0xaedd('0x46'),_0xaedd('0x1f7')+_0x84133c));}if(_0x3fbabb<=0x0||isNaN(_0x3fbabb)){return _0x2c1f47(msgResponse(_0xaedd('0x1f6'),_0xaedd('0x46'),_0xaedd('0x1f8')+_0x3fbabb));}if(_0xa478e8<=0x0||isNaN(_0xa478e8)){return _0x2c1f47(msgResponse(_0xaedd('0x1f6'),_0xaedd('0x46'),_0xaedd('0x1f9')+_0xa478e8));}if(_0x11df4e<=0x0||isNaN(_0x11df4e)){return _0x2c1f47(msgResponse(_0xaedd('0x1f6'),'Error',_0xaedd('0x1fa')+_0x11df4e));}if(_0x391293<=0x0||isNaN(_0x391293)){return _0x2c1f47(msgResponse('[abandonmentRate]',_0xaedd('0x46'),_0xaedd('0x1fb')+_0x391293));}_0x4b4b6d=_0x4b4b6d||0x0;var _0xac498a=0x1/_0x3fbabb;var _0x440dad=0x0;var _0x356373=0x0;var _0x27f034=0x0;var _0x55928a=0x0;for(var _0x1bddef=0x0;_0x27f034<_0x391293;_0x1bddef+=0x1){_0x356373=_0x1bddef/_0x11df4e;_0x440dad=(_0xa478e8*_0x356373+_0x4b4b6d)/_0xac498a;_0x27f034=erlangb(_0x440dad,_0x84133c);_0x55928a=_0x440dad/_0x84133c*(0x1-erlangb(_0x440dad,_0x84133c));}return _0x32212e({'erlangCalls':_0x1bddef,'erlangCallToSecond':_0x11df4e/_0x1bddef,'erlangAbandonmentRate':_0x27f034,'erlangBusyFactor':_0x55928a});});};Dialer['prototype'][_0xaedd('0x1c4')]=function(_0x5bc8cc,_0x954544,_0x2c4cec,_0x5bb43f,_0x426b80,_0x5d6fa9){loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1fc'));loggerPredictive['info'](_0xaedd('0x1fd'),_0x5bc8cc);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1f2'),_0x954544);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x1f3'),_0x2c4cec);loggerPredictive['info'](_0xaedd('0x1f4'),_0x5bb43f);loggerPredictive['info'](_0xaedd('0x1fe'),_0x426b80);loggerPredictive[_0xaedd('0x7d')](_0xaedd('0x90'));return new BPromise(function(_0x3b1865,_0x16facb){if(_0x5bc8cc<=0x0||isNaN(_0x5bc8cc)){return _0x16facb(msgResponse(_0xaedd('0x1ff'),_0xaedd('0x46'),_0xaedd('0x1f7')+_0x5bc8cc));}if(_0x2c4cec<=0x0||isNaN(_0x2c4cec)){return _0x16facb(msgResponse('[busyFactor]',_0xaedd('0x46'),'Ts\x20=\x20'+_0x2c4cec));}if(_0x5bb43f<=0x0||isNaN(_0x5bb43f)){return _0x16facb(msgResponse(_0xaedd('0x1ff'),_0xaedd('0x46'),_0xaedd('0x1f9')+_0x5bb43f));}if(_0x954544<=0x0||isNaN(_0x954544)){return _0x16facb(msgResponse('[busyFactor]',_0xaedd('0x46'),'interval\x20=\x20'+_0x954544));}if(_0x426b80<=0x0||isNaN(_0x426b80)){return _0x16facb(msgResponse(_0xaedd('0x1ff'),'Error',_0xaedd('0x200')+_0x426b80));}_0x5d6fa9=_0x5d6fa9||0x0;var _0x13cc41=0x1/_0x2c4cec;var _0x1b472c=0x0;var _0x424b5b=0x0;var _0x55b626=0x0;var _0x1f0c10=0x0;for(var _0x3b2adf=0x0;_0x1f0c10<_0x426b80;_0x3b2adf+=0x1){_0x424b5b=_0x3b2adf/_0x954544;_0x1b472c=(_0x5bb43f*_0x424b5b+_0x5d6fa9)/_0x13cc41;_0x55b626=erlangb(_0x1b472c,_0x5bc8cc);_0x1f0c10=_0x1b472c/_0x5bc8cc*(0x1-erlangb(_0x1b472c,_0x5bc8cc));}return _0x3b1865({'erlangCalls':_0x3b2adf,'erlangCallToSecond':_0x954544/_0x3b2adf,'erlangAbandonmentRate':_0x55b626,'erlangBusyFactor':_0x1f0c10});});};module[_0xaedd('0x201')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 82e0b4b..d3fafc1 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 _0x9acb=['droptime','ringtime','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','exports','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9acb,0x13a));var _0xb9ac=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9acb[_0x5447fd];return _0x15b28a;};'use strict';var util=require('util');var _=require(_0xb9ac('0x0'));var moment=require('moment');function getSeconds(_0x233be6,_0x30d1d4){var _0x47a5e0=moment(_0x233be6)[_0xb9ac('0x1')](0x0);var _0x1eaf66=moment(_0x30d1d4)[_0xb9ac('0x1')](0x0);return _0x47a5e0['diff'](_0x1eaf66,_0xb9ac('0x2'));}function QueueCallerAbandon(_0x255050,_0x19e399){this[_0xb9ac('0x3')]=_0x255050['scheduledat'];this[_0xb9ac('0x4')]=_0x255050[_0xb9ac('0x4')];this[_0xb9ac('0x5')]=_0x255050['type']===_0xb9ac('0x6')?'queue':_0x255050[_0xb9ac('0x4')];this[_0xb9ac('0x7')]=_0x255050[_0xb9ac('0x7')];this[_0xb9ac('0x8')]=_0x255050[_0xb9ac('0x8')];this[_0xb9ac('0x9')]=_0x255050[_0xb9ac('0x9')];this[_0xb9ac('0xa')]=_0x255050['countbusyretry']+_0x255050[_0xb9ac('0x8')]+_0x255050[_0xb9ac('0x9')];this[_0xb9ac('0xb')]=_0x19e399[_0xb9ac('0xb')];this[_0xb9ac('0xc')]=_0x255050['name'];this['calleridnum']=_0x255050[_0xb9ac('0xd')];this[_0xb9ac('0xe')]=_0x255050[_0xb9ac('0xe')];this[_0xb9ac('0xf')]=_0x255050[_0xb9ac('0xf')];this[_0xb9ac('0x10')]=_0x255050['droptime'];this['endtime']=this[_0xb9ac('0x10')];this[_0xb9ac('0x11')]=getSeconds(_0x255050['responsetime'],_0x255050[_0xb9ac('0xe')]);this[_0xb9ac('0x12')]=getSeconds(this['droptime'],_0x255050[_0xb9ac('0xf')]);this[_0xb9ac('0x13')]=0x0;this[_0xb9ac('0x14')]=_0x19e399[_0xb9ac('0x14')];this['membername']=_0x19e399[_0xb9ac('0x15')];this[_0xb9ac('0x16')]=_0x19e399[_0xb9ac('0x16')];this[_0xb9ac('0x17')]=_0x255050[_0xb9ac('0x17')];this[_0xb9ac('0x18')]=_0x255050[_0xb9ac('0x18')];this['callbackat']=_0x255050[_0xb9ac('0x19')];this[_0xb9ac('0x1a')]=_0x255050[_0xb9ac('0x1a')];this[_0xb9ac('0x1b')]=_0x255050[_0xb9ac('0x1b')];this[_0xb9ac('0x1c')]=_0x255050['ListId'];this[_0xb9ac('0x1d')]=_0x255050[_0xb9ac('0x1d')];this[_0xb9ac('0x1e')]=_0x255050['VoiceQueueId'];this['CampaignId']=_0x255050['CampaignId'];this['originatecalleridnum']=_0x255050[_0xb9ac('0x1f')]||'';this['originatecalleridname']=_0x255050['originatecalleridname']||'';}module[_0xb9ac('0x20')]=QueueCallerAbandon; \ No newline at end of file +var _0xdc28=['countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x2c9fb2,_0x2fb863){var _0x351207=function(_0x127516){while(--_0x127516){_0x2c9fb2['push'](_0x2c9fb2['shift']());}};_0x351207(++_0x2fb863);}(_0xdc28,0x119));var _0x8dc2=function(_0x132066,_0x15da82){_0x132066=_0x132066-0x0;var _0x5beac3=_0xdc28[_0x132066];return _0x5beac3;};'use strict';var util=require(_0x8dc2('0x0'));var _=require(_0x8dc2('0x1'));var moment=require(_0x8dc2('0x2'));function getSeconds(_0xa7e7c6,_0xe325c0){var _0x599bd2=moment(_0xa7e7c6)[_0x8dc2('0x3')](0x0);var _0x564380=moment(_0xe325c0)[_0x8dc2('0x3')](0x0);return _0x599bd2[_0x8dc2('0x4')](_0x564380,_0x8dc2('0x5'));}function QueueCallerAbandon(_0x54010c,_0x46f5f8){this['scheduledat']=_0x54010c[_0x8dc2('0x6')];this[_0x8dc2('0x7')]=_0x54010c[_0x8dc2('0x7')];this[_0x8dc2('0x8')]=_0x54010c[_0x8dc2('0x7')]===_0x8dc2('0x9')?_0x8dc2('0xa'):_0x54010c[_0x8dc2('0x7')];this[_0x8dc2('0xb')]=_0x54010c[_0x8dc2('0xb')];this[_0x8dc2('0xc')]=_0x54010c['countcongestionretry'];this[_0x8dc2('0xd')]=_0x54010c[_0x8dc2('0xd')];this[_0x8dc2('0xe')]=_0x54010c[_0x8dc2('0xb')]+_0x54010c[_0x8dc2('0xc')]+_0x54010c[_0x8dc2('0xd')];this[_0x8dc2('0xf')]=_0x46f5f8[_0x8dc2('0xf')];this[_0x8dc2('0x10')]=_0x54010c[_0x8dc2('0x11')];this[_0x8dc2('0x12')]=_0x54010c[_0x8dc2('0x13')];this[_0x8dc2('0x14')]=_0x54010c['starttime'];this['responsetime']=_0x54010c[_0x8dc2('0x15')];this[_0x8dc2('0x16')]=_0x54010c[_0x8dc2('0x16')];this[_0x8dc2('0x17')]=this[_0x8dc2('0x16')];this[_0x8dc2('0x18')]=getSeconds(_0x54010c[_0x8dc2('0x15')],_0x54010c[_0x8dc2('0x14')]);this[_0x8dc2('0x19')]=getSeconds(this['droptime'],_0x54010c[_0x8dc2('0x15')]);this[_0x8dc2('0x1a')]=0x0;this[_0x8dc2('0xa')]=_0x46f5f8[_0x8dc2('0xa')];this[_0x8dc2('0x1b')]=_0x46f5f8[_0x8dc2('0x1c')];this[_0x8dc2('0x1d')]=_0x46f5f8[_0x8dc2('0x1d')];this['callback']=_0x54010c[_0x8dc2('0x1e')];this[_0x8dc2('0x1f')]=_0x54010c[_0x8dc2('0x1f')];this[_0x8dc2('0x20')]=_0x54010c[_0x8dc2('0x20')];this[_0x8dc2('0x21')]=_0x54010c['recallme'];this[_0x8dc2('0x22')]=_0x54010c[_0x8dc2('0x22')];this[_0x8dc2('0x23')]=_0x54010c['ListId'];this[_0x8dc2('0x24')]=_0x54010c[_0x8dc2('0x24')];this[_0x8dc2('0x25')]=_0x54010c[_0x8dc2('0x25')];this[_0x8dc2('0x26')]=_0x54010c[_0x8dc2('0x26')];this[_0x8dc2('0x27')]=_0x54010c[_0x8dc2('0x27')]||'';this[_0x8dc2('0x28')]=_0x54010c[_0x8dc2('0x28')]||'';}module[_0x8dc2('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bd306bf..40b5e9a 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 _0x5c9b=['%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment','uniqueid'];(function(_0x3c3407,_0x54bc76){var _0xd8eb13=function(_0x5a41ce){while(--_0x5a41ce){_0x3c3407['push'](_0x3c3407['shift']());}};_0xd8eb13(++_0x54bc76);}(_0x5c9b,0x1d0));var _0xb5c9=function(_0x176a0f,_0x90ada5){_0x176a0f=_0x176a0f-0x0;var _0x4b58e2=_0x5c9b[_0x176a0f];return _0x4b58e2;};'use strict';var util=require(_0xb5c9('0x0'));var _=require(_0xb5c9('0x1'));var moment=require(_0xb5c9('0x2'));function Action(_0x181813,_0x1fbe80,_0x2d5d6f){this[_0xb5c9('0x3')]=_0x181813||undefined;this['channel']=util['format'](_0xb5c9('0x4'),_0x1fbe80[_0xb5c9('0x5')],_0x1fbe80[_0xb5c9('0x6')][_0xb5c9('0x7')],_0x2d5d6f['fax']);this[_0xb5c9('0x8')]=_0x1fbe80[_0xb5c9('0x8')];this[_0xb5c9('0x9')]=_0x1fbe80[_0xb5c9('0x9')];this[_0xb5c9('0xa')]=_0x2d5d6f[_0xb5c9('0xa')];this[_0xb5c9('0xb')]=_0x2d5d6f[_0xb5c9('0xb')];}module[_0xb5c9('0xc')]=Action; \ No newline at end of file +var _0x910b=['format','%s/%s/%s','tech','Trunk','name','headerinfo','path','AttachmentId','exports','util','channel'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x910b,0xb9));var _0xb910=function(_0x411999,_0x3c654a){_0x411999=_0x411999-0x0;var _0x783919=_0x910b[_0x411999];return _0x783919;};'use strict';var util=require(_0xb910('0x0'));var _=require('lodash');var moment=require('moment');function Action(_0x97cdc8,_0x267ee7,_0x44a1e4){this['uniqueid']=_0x97cdc8||undefined;this[_0xb910('0x1')]=util[_0xb910('0x2')](_0xb910('0x3'),_0x267ee7[_0xb910('0x4')],_0x267ee7[_0xb910('0x5')][_0xb910('0x6')],_0x44a1e4['fax']);this['localstationid']=_0x267ee7['localstationid'];this[_0xb910('0x7')]=_0x267ee7[_0xb910('0x7')];this[_0xb910('0x8')]=_0x44a1e4[_0xb910('0x8')];this[_0xb910('0x9')]=_0x44a1e4[_0xb910('0x9')];}module[_0xb910('0xa')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index b27a141..c700c59 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 _0x8b77=['info','channelstate','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','then','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','isValid','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','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','util','lodash','bluebird','path','../../../config/logger','fax','../ami','./rpcDb','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name'];(function(_0x3fa666,_0x140e26){var _0x201f49=function(_0x5951e6){while(--_0x5951e6){_0x3fa666['push'](_0x3fa666['shift']());}};_0x201f49(++_0x140e26);}(_0x8b77,0xbb));var _0x78b7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b77[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x78b7('0x0'));var _=require(_0x78b7('0x1'));var BPromise=require(_0x78b7('0x2'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x78b7('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x78b7('0x4'))(_0x78b7('0x5'));var ami=require(_0x78b7('0x6'));var rpcDb=require(_0x78b7('0x7'));var Channel=require(_0x78b7('0x8'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x78b7('0x9'));var attachment=require(_0x78b7('0xa'));var faxMessage=require(_0x78b7('0xb'));function Fax(_0x1ddc2b){this[_0x78b7('0xc')]={};this[_0x78b7('0xd')]=_0x1ddc2b['faxAccounts'];this['trunks']=_0x1ddc2b[_0x78b7('0xe')];this[_0x78b7('0xf')]={};ami['on'](_0x78b7('0x10'),this[_0x78b7('0x11')][_0x78b7('0x12')](this));ami['on']('varset',this[_0x78b7('0x13')]['bind'](this));ami['on'](_0x78b7('0x14'),this['syncNewState'][_0x78b7('0x12')](this));ami['on'](_0x78b7('0x15'),this[_0x78b7('0x16')][_0x78b7('0x12')](this));ami['on'](_0x78b7('0x17'),this[_0x78b7('0x18')]['bind'](this));ami['on'](_0x78b7('0x19'),this[_0x78b7('0x1a')]['bind'](this));ami['on'](_0x78b7('0x1b'),this[_0x78b7('0x1c')][_0x78b7('0x12')](this));ami['on']('originateresponse',this[_0x78b7('0x1d')]['bind'](this));}Fax[_0x78b7('0x1e')][_0x78b7('0x11')]=function(_0x3070a1){if(_0x3070a1[_0x78b7('0x1f')]===_0x78b7('0x20')){for(var _0x194f92 in this[_0x78b7('0xd')]){if(this[_0x78b7('0xd')][_0x78b7('0x21')](_0x194f92)){if(_0x3070a1[_0x78b7('0x22')]===this[_0x78b7('0xd')][_0x194f92][_0x78b7('0x23')]){this['channels'][_0x3070a1[_0x78b7('0x24')]]={};this[_0x78b7('0xc')][_0x3070a1[_0x78b7('0x24')]][_0x78b7('0x25')]=_0x3070a1[_0x78b7('0x25')];this[_0x78b7('0xc')][_0x3070a1[_0x78b7('0x24')]]['id']=this[_0x78b7('0xd')][_0x194f92]['id'];this[_0x78b7('0xc')][_0x3070a1[_0x78b7('0x24')]][_0x78b7('0x26')]=this['faxAccounts'][_0x194f92]['name'];logger['info'](_0x3070a1['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x78b7('0xf')][_0x3070a1[_0x78b7('0x24')]]){this[_0x78b7('0xc')][_0x3070a1['uniqueid']]={};this[_0x78b7('0xc')][_0x3070a1[_0x78b7('0x24')]][_0x78b7('0x25')]=_0x3070a1[_0x78b7('0x25')];logger[_0x78b7('0x27')](_0x3070a1[_0x78b7('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x78b7('0x1e')][_0x78b7('0x13')]=function(_0x1fb88b){if(this['channels'][_0x1fb88b[_0x78b7('0x24')]]){for(var _0x295eb4 in _0x1fb88b['variable']){if(_0x1fb88b['variable'][_0x78b7('0x21')](_0x295eb4)){this[_0x78b7('0xc')][_0x1fb88b[_0x78b7('0x24')]][_0x295eb4]=_0x1fb88b['value'];}}}};Fax['prototype']['syncNewState']=function(_0x1a50ff){if(this[_0x78b7('0xc')][_0x1a50ff[_0x78b7('0x24')]]){this[_0x78b7('0xc')][_0x1a50ff[_0x78b7('0x24')]][_0x78b7('0x28')]=_0x1a50ff[_0x78b7('0x28')];this['channels'][_0x1a50ff[_0x78b7('0x24')]]['channelstatedesc']=_0x1a50ff['channelstatedesc'];}};Fax[_0x78b7('0x1e')][_0x78b7('0x16')]=function(_0x2f357d){if(this['channels'][_0x2f357d[_0x78b7('0x24')]]){for(var _0x5b9368 in _0x2f357d[_0x78b7('0x29')]){if(_0x2f357d['variable'][_0x78b7('0x21')](_0x5b9368)){this['channels'][_0x2f357d['uniqueid']][_0x5b9368]=_0x2f357d['value'];}}}};Fax[_0x78b7('0x1e')][_0x78b7('0x18')]=function(_0x339c3f){if(this[_0x78b7('0xc')][_0x339c3f[_0x78b7('0x24')]]){this['channels'][_0x339c3f[_0x78b7('0x24')]][_0x78b7('0x2a')]=_0x339c3f[_0x78b7('0x2a')];this[_0x78b7('0xc')][_0x339c3f['uniqueid']]['status']=_0x339c3f[_0x78b7('0x2b')];this['channels'][_0x339c3f[_0x78b7('0x24')]]['localstationid']=_0x339c3f[_0x78b7('0x23')];this[_0x78b7('0xc')][_0x339c3f[_0x78b7('0x24')]][_0x78b7('0x2c')]=_0x339c3f['filename'];logger[_0x78b7('0x27')](_0x339c3f[_0x78b7('0x24')],_0x78b7('0x2d'));}};Fax[_0x78b7('0x1e')][_0x78b7('0x1a')]=function(_0x1de412){var _0x781412=this;if(this['channels'][_0x1de412[_0x78b7('0x24')]]){var _0x1f295d=this[_0x78b7('0xc')][_0x1de412[_0x78b7('0x24')]]['id'];this[_0x78b7('0xc')][_0x1de412[_0x78b7('0x24')]][_0x78b7('0x2e')]=_0x1de412[_0x78b7('0x2e')];this[_0x78b7('0xc')][_0x1de412[_0x78b7('0x24')]][_0x78b7('0x2f')]=_0x1de412[_0x78b7('0x2f')];this['channels'][_0x1de412[_0x78b7('0x24')]][_0x78b7('0x23')]=_0x1de412['localstationid'];this['channels'][_0x1de412['uniqueid']][_0x78b7('0x30')]=_0x1de412['resolution'];this[_0x78b7('0xc')][_0x1de412[_0x78b7('0x24')]][_0x78b7('0x31')]=_0x1de412[_0x78b7('0x31')];this['channels'][_0x1de412['uniqueid']][_0x78b7('0x2c')]=_0x1de412['filename'];this[_0x78b7('0xc')][_0x1de412[_0x78b7('0x24')]][_0x78b7('0x32')]=_0x1de412[_0x78b7('0x32')];if(this['channels'][_0x1de412['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x1de412[_0x78b7('0x2c')],_0x78b7('0x33'),function(_0x54a922){logger[_0x78b7('0x27')](_0x1de412['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x54a922[_0x78b7('0x34')]);attachment[_0x78b7('0x35')]({'name':path[_0x78b7('0x36')](_0x1de412['filename'])[_0x78b7('0x26')],'basename':path[_0x78b7('0x36')](_0x1de412[_0x78b7('0x2c')])[_0x78b7('0x26')]+_0x78b7('0x37'),'type':_0x78b7('0x38')})['then'](function(_0x500a50){faxAccount['notify'](_0x1f295d,{'from':_0x1de412[_0x78b7('0x32')],'mapKey':_0x78b7('0x5'),'body':path['parse'](_0x1de412[_0x78b7('0x2c')])[_0x78b7('0x26')]+'.pdf','AttachmentId':_0x500a50['id']})[_0x78b7('0x39')](function(_0x44e93b){logger[_0x78b7('0x3a')](_0x1de412['uniqueid'],_0x78b7('0x3b'),JSON['stringify'](_0x44e93b));});})[_0x78b7('0x39')](function(_0x5136d4){logger[_0x78b7('0x3a')](_0x1de412[_0x78b7('0x24')],_0x78b7('0x3c'),JSON['stringify'](_0x5136d4));});});}logger[_0x78b7('0x27')](_0x1de412[_0x78b7('0x24')],_0x78b7('0x3c'));}};Fax[_0x78b7('0x1e')]['syncOriginateResponse']=function(_0x432f1d){if(this[_0x78b7('0xf')][_0x432f1d[_0x78b7('0x24')]]){_[_0x78b7('0x3d')](this['channels'][_0x432f1d[_0x78b7('0x24')]],_[_0x78b7('0x3e')](_0x432f1d,[_0x78b7('0x3f'),_0x78b7('0x40')]));}};function updateStatus(_0x33e3e5){if(_0x33e3e5[_0x78b7('0x41')]){faxMessage[_0x78b7('0x42')](_0x33e3e5['AttachmentId'],{'failMessage':_0x78b7('0x43')})['then'](function(_0xc6a029){ut[_0x78b7('0x44')]('[Fax][Message][Error][Updated]',_0xc6a029);})[_0x78b7('0x39')](function(_0x368c35){ut[_0x78b7('0x44')](_0x78b7('0x45'),_0x368c35);});}else{ut[_0x78b7('0x44')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x78b7('0x46')]=function(_0x2b72d0,_0x154d05,_0x38022a){var _0x403fc2=this;var _0xe15bd1={};if(_0x154d05){_0xe15bd1={'read':_0x154d05};}else{_0xe15bd1={'failMessage':_0x38022a};}if(this[_0x78b7('0xf')][_0x2b72d0][_0x78b7('0x41')]){faxMessage['update'](this[_0x78b7('0xf')][_0x2b72d0][_0x78b7('0x41')],_0xe15bd1)['then'](function(_0x1a55c2){ut['logger'](_0x78b7('0x47'),_0x1a55c2);})[_0x78b7('0x39')](function(_0x1ae75a){ut['logger'](_0x78b7('0x48'),_0x1ae75a);})[_0x78b7('0x49')](function(){delete _0x403fc2[_0x78b7('0xc')][_0x2b72d0];delete _0x403fc2[_0x78b7('0xf')][_0x2b72d0];});}else{ut[_0x78b7('0x44')](_0x78b7('0x4a'));delete this[_0x78b7('0xc')][_0x2b72d0];delete this[_0x78b7('0xf')][_0x2b72d0];}};Fax[_0x78b7('0x1e')]['syncHangup']=function(_0x2fa2a5){var _0x3d8c7e=this;if(this['channels'][_0x2fa2a5['uniqueid']]){if(this[_0x78b7('0xf')][_0x2fa2a5[_0x78b7('0x24')]]){this['channels'][_0x2fa2a5[_0x78b7('0x24')]]['id']=this[_0x78b7('0xf')][_0x2fa2a5[_0x78b7('0x24')]]['id'];this[_0x78b7('0xc')][_0x2fa2a5['uniqueid']][_0x78b7('0x26')]=this[_0x78b7('0xf')][_0x2fa2a5['uniqueid']][_0x78b7('0x26')];}logger[_0x78b7('0x27')](_0x2fa2a5[_0x78b7('0x24')],this[_0x78b7('0xf')][_0x2fa2a5[_0x78b7('0x24')]]?_0x78b7('0x4b'):_0x78b7('0x4c'),JSON[_0x78b7('0x4d')](this[_0x78b7('0xc')][_0x2fa2a5[_0x78b7('0x24')]]));if(this['actions'][_0x2fa2a5[_0x78b7('0x24')]]){if(this[_0x78b7('0xc')][_0x2fa2a5['uniqueid']][_0x78b7('0x4e')]>0x0&&this['channels'][_0x2fa2a5['uniqueid']][_0x78b7('0x17')]===_0x78b7('0x4f')){this[_0x78b7('0x46')](_0x2fa2a5[_0x78b7('0x24')],!![]);}else{this[_0x78b7('0x46')](_0x2fa2a5['uniqueid'],![],this[_0x78b7('0xc')][_0x2fa2a5['uniqueid']][_0x78b7('0x50')]?_0x78b7('0x51')+this[_0x78b7('0xc')][_0x2fa2a5[_0x78b7('0x24')]][_0x78b7('0x50')]:'SENDING\x20FAILED');}}}};Fax[_0x78b7('0x1e')]['send']=function(_0x489f14){var _0x48b920=this;return new BPromise(function(_0x351020,_0x3a6ff5){_0x48b920['execOriginate'](_0x489f14,_0x48b920[_0x78b7('0xd')][_0x489f14['FaxAccountId']])[_0x78b7('0x52')](function(_0x6d8d98){ut['logger'](_0x78b7('0x53'),_0x6d8d98);_0x351020(ut[_0x78b7('0x34')](_0x78b7('0x54')));})[_0x78b7('0x39')](function(_0x3828d2){ut[_0x78b7('0x44')]('[Fax][execOriginate][failure]',_0x3828d2);updateStatus(_0x489f14);_0x3a6ff5(ut['message'](_0x78b7('0x55')));});});};Fax['prototype'][_0x78b7('0x56')]=function(_0x31f85e){var _0x288a56=this;return new BPromise(function(_0x77fa4c,_0xc807c7){var _0x4b7818=_0x288a56['checkTrunk'](_0x288a56[_0x78b7('0xd')][_0x31f85e['FaxAccountId']]['Trunk'],_0x31f85e);if(_0x4b7818[_0x78b7('0x57')]){_0x77fa4c(ut[_0x78b7('0x34')](_0x78b7('0x58')));}else{_0xc807c7(ut[_0x78b7('0x34')](_0x4b7818[_0x78b7('0x34')]));}});};function originate(_0x205618,_0x4d43da,_0x42cfc9){return new BPromise(function(_0x557095,_0x22367d){if(_0x42cfc9){var _0x14694e=util['format'](_0x78b7('0x59'),path[_0x78b7('0x36')](_0x205618[_0x78b7('0x3')])[_0x78b7('0x26')],_0x205618[_0x78b7('0x3')]);gs[_0x78b7('0x5a')](_0x14694e)[_0x78b7('0x52')](function(){_0x205618['path']=util[_0x78b7('0x5b')](_0x78b7('0x5c'),path[_0x78b7('0x36')](_0x205618[_0x78b7('0x3')])[_0x78b7('0x5d')],path[_0x78b7('0x36')](_0x205618['path'])[_0x78b7('0x26')]);_0x4d43da[_0x78b7('0x5e')]=_0x205618[_0x78b7('0x3')];ut[_0x78b7('0x44')](_0x78b7('0x5f'),'');ami['Action'](ut['variablesAction'](_0x205618,_0x4d43da))[_0x78b7('0x52')](function(_0x1cc2a9){_0x557095(_0x1cc2a9);})[_0x78b7('0x39')](function(_0x4a6012){_0x22367d(_0x4a6012);});})[_0x78b7('0x39')](function(_0x2402c7){_0x22367d(_0x2402c7);});}else{ami[_0x78b7('0x60')](ut['variablesAction'](_0x205618,_0x4d43da))[_0x78b7('0x52')](function(_0xf18562){_0x557095(_0xf18562);})[_0x78b7('0x39')](function(_0x37e209){_0x22367d(_0x37e209);});}});}Fax[_0x78b7('0x1e')][_0x78b7('0x61')]=function(_0x5badf6,_0x326c64){var _0x3bbf96=this;return new BPromise(function(_0x4c065f,_0x3b51ef){var _0x3147d6=uuid['v4']();var _0x3906f0=ut[_0x78b7('0x62')](_0x5badf6,_0x326c64);_0x3bbf96[_0x78b7('0xf')][_0x3147d6]=new Action(_0x3147d6,_0x326c64,_0x5badf6);var _0x14353a=_0x3bbf96[_0x78b7('0xf')][_0x3147d6];if(path[_0x78b7('0x36')](_0x5badf6[_0x78b7('0x3')])[_0x78b7('0x63')]===_0x78b7('0x37')){originate(_0x14353a,_0x3906f0,!![])[_0x78b7('0x52')](function(_0x1a48d0){_0x4c065f(_0x1a48d0);})[_0x78b7('0x39')](function(_0x61e1f0){_0x3b51ef(_0x61e1f0);});}else{originate(_0x14353a,_0x3906f0,![])[_0x78b7('0x52')](function(_0xfa053f){_0x4c065f(_0xfa053f);})['catch'](function(_0x473044){_0x3b51ef(_0x473044);});}});};Fax[_0x78b7('0x1e')][_0x78b7('0x64')]=function(_0x48fc9e){return!_[_0x78b7('0x65')](_0x48fc9e)&&!_['isNil'](_0x48fc9e[_0x78b7('0x26')])&&!_[_0x78b7('0x65')](_0x48fc9e[_0x78b7('0x66')])&&_0x48fc9e[_0x78b7('0x66')]&&!_[_0x78b7('0x65')](this[_0x78b7('0xe')][util[_0x78b7('0x5b')](_0x78b7('0x67'),_0x48fc9e['name'])])&&!_[_0x78b7('0x65')](this[_0x78b7('0xe')][util[_0x78b7('0x5b')](_0x78b7('0x67'),_0x48fc9e['name'])][_0x78b7('0x2b')])&&(this[_0x78b7('0xe')][util[_0x78b7('0x5b')](_0x78b7('0x67'),_0x48fc9e['name'])][_0x78b7('0x2b')]===_0x78b7('0x68')||this[_0x78b7('0xe')][util['format']('SIP/%s',_0x48fc9e[_0x78b7('0x26')])]['status']===_0x78b7('0x69'));};Fax['prototype'][_0x78b7('0x6a')]=function(_0x1a863d,_0x36165f){if(!this[_0x78b7('0x64')](_0x1a863d)){ut[_0x78b7('0x44')](_0x78b7('0x6b'),_[_0x78b7('0x65')](_0x1a863d)?'':_0x1a863d[_0x78b7('0x26')]+_0x78b7('0x6c'));return{'isValid':![],'message':_0x78b7('0x6d')};}if(_[_0x78b7('0x65')](_0x36165f[_0x78b7('0x5')])){ut[_0x78b7('0x44')](_0x78b7('0x6e'),JSON[_0x78b7('0x4d')](_0x36165f));return{'isValid':![],'message':_0x78b7('0x6f')};}if(_[_0x78b7('0x65')](_0x36165f[_0x78b7('0x3')])){ut[_0x78b7('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x36165f));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x78b7('0x70')};};module['exports']=Fax; \ No newline at end of file +var _0xf337=['bind','varset','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','calleridnum','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','actions','pick','response','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./action','faxAccounts','trunks','newchannel','syncNewchannel'];(function(_0x3a0f53,_0x386552){var _0x1b1106=function(_0x2c43ac){while(--_0x2c43ac){_0x3a0f53['push'](_0x3a0f53['shift']());}};_0x1b1106(++_0x386552);}(_0xf337,0x67));var _0x7f33=function(_0x40f152,_0x6655a2){_0x40f152=_0x40f152-0x0;var _0x1b30ec=_0xf337[_0x40f152];return _0x1b30ec;};'use strict';var util=require(_0x7f33('0x0'));var _=require(_0x7f33('0x1'));var BPromise=require(_0x7f33('0x2'));var uuid=require(_0x7f33('0x3'));var moment=require(_0x7f33('0x4'));var path=require(_0x7f33('0x5'));var tiff2pdf=require(_0x7f33('0x6'));var gs=require('./util/gs');var logger=require(_0x7f33('0x7'))(_0x7f33('0x8'));var ami=require('../ami');var rpcDb=require(_0x7f33('0x9'));var Channel=require(_0x7f33('0xa'));var ut=require('./util/util');var Action=require(_0x7f33('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x218a05){this['channels']={};this[_0x7f33('0xc')]=_0x218a05[_0x7f33('0xc')];this[_0x7f33('0xd')]=_0x218a05[_0x7f33('0xd')];this['actions']={};ami['on'](_0x7f33('0xe'),this[_0x7f33('0xf')][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x11'),this[_0x7f33('0x12')][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x13'),this['syncNewState'][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x14'),this[_0x7f33('0x15')][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x16'),this[_0x7f33('0x17')]['bind'](this));ami['on'](_0x7f33('0x18'),this[_0x7f33('0x19')][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x1a'),this[_0x7f33('0x1b')][_0x7f33('0x10')](this));ami['on'](_0x7f33('0x1c'),this[_0x7f33('0x1d')]['bind'](this));}Fax[_0x7f33('0x1e')][_0x7f33('0xf')]=function(_0x211fb3){if(_0x211fb3[_0x7f33('0x1f')]===_0x7f33('0x20')){for(var _0x3b70bc in this[_0x7f33('0xc')]){if(this['faxAccounts'][_0x7f33('0x21')](_0x3b70bc)){if(_0x211fb3['exten']===this[_0x7f33('0xc')][_0x3b70bc][_0x7f33('0x22')]){this[_0x7f33('0x23')][_0x211fb3['uniqueid']]={};this[_0x7f33('0x23')][_0x211fb3[_0x7f33('0x24')]][_0x7f33('0x25')]=_0x211fb3[_0x7f33('0x25')];this[_0x7f33('0x23')][_0x211fb3[_0x7f33('0x24')]]['id']=this[_0x7f33('0xc')][_0x3b70bc]['id'];this[_0x7f33('0x23')][_0x211fb3[_0x7f33('0x24')]][_0x7f33('0x26')]=this[_0x7f33('0xc')][_0x3b70bc]['name'];logger['info'](_0x211fb3['uniqueid'],_0x7f33('0x27'));}}}}if(this['actions'][_0x211fb3['uniqueid']]){this['channels'][_0x211fb3[_0x7f33('0x24')]]={};this[_0x7f33('0x23')][_0x211fb3[_0x7f33('0x24')]][_0x7f33('0x25')]=_0x211fb3['channel'];logger['info'](_0x211fb3[_0x7f33('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x7f33('0x1e')][_0x7f33('0x12')]=function(_0x2171d2){if(this['channels'][_0x2171d2[_0x7f33('0x24')]]){for(var _0xd64cd8 in _0x2171d2[_0x7f33('0x28')]){if(_0x2171d2[_0x7f33('0x28')][_0x7f33('0x21')](_0xd64cd8)){this[_0x7f33('0x23')][_0x2171d2[_0x7f33('0x24')]][_0xd64cd8]=_0x2171d2[_0x7f33('0x29')];}}}};Fax[_0x7f33('0x1e')]['syncNewState']=function(_0x32d8dc){if(this[_0x7f33('0x23')][_0x32d8dc['uniqueid']]){this[_0x7f33('0x23')][_0x32d8dc[_0x7f33('0x24')]][_0x7f33('0x2a')]=_0x32d8dc[_0x7f33('0x2a')];this[_0x7f33('0x23')][_0x32d8dc['uniqueid']][_0x7f33('0x2b')]=_0x32d8dc[_0x7f33('0x2b')];}};Fax[_0x7f33('0x1e')][_0x7f33('0x15')]=function(_0x31ac1b){if(this[_0x7f33('0x23')][_0x31ac1b['uniqueid']]){for(var _0xc470c9 in _0x31ac1b[_0x7f33('0x28')]){if(_0x31ac1b[_0x7f33('0x28')][_0x7f33('0x21')](_0xc470c9)){this[_0x7f33('0x23')][_0x31ac1b[_0x7f33('0x24')]][_0xc470c9]=_0x31ac1b[_0x7f33('0x29')];}}}};Fax[_0x7f33('0x1e')][_0x7f33('0x17')]=function(_0x41a034){if(this['channels'][_0x41a034[_0x7f33('0x24')]]){this[_0x7f33('0x23')][_0x41a034[_0x7f33('0x24')]]['operation']=_0x41a034[_0x7f33('0x2c')];this[_0x7f33('0x23')][_0x41a034['uniqueid']]['status']=_0x41a034['status'];this['channels'][_0x41a034['uniqueid']]['localstationid']=_0x41a034[_0x7f33('0x22')];this[_0x7f33('0x23')][_0x41a034[_0x7f33('0x24')]][_0x7f33('0x2d')]=_0x41a034[_0x7f33('0x2d')];logger[_0x7f33('0x2e')](_0x41a034['uniqueid'],_0x7f33('0x2f'));}};Fax[_0x7f33('0x1e')][_0x7f33('0x19')]=function(_0x20e264){var _0x4d8f8d=this;if(this[_0x7f33('0x23')][_0x20e264['uniqueid']]){var _0x346a26=this[_0x7f33('0x23')][_0x20e264[_0x7f33('0x24')]]['id'];this[_0x7f33('0x23')][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x30')]=_0x20e264[_0x7f33('0x30')];this['channels'][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x31')]=_0x20e264[_0x7f33('0x31')];this['channels'][_0x20e264['uniqueid']][_0x7f33('0x22')]=_0x20e264[_0x7f33('0x22')];this[_0x7f33('0x23')][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x32')]=_0x20e264[_0x7f33('0x32')];this['channels'][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x33')]=_0x20e264[_0x7f33('0x33')];this[_0x7f33('0x23')][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x2d')]=_0x20e264[_0x7f33('0x2d')];this['channels'][_0x20e264[_0x7f33('0x24')]]['calleridnum']=_0x20e264['calleridnum'];if(this[_0x7f33('0x23')][_0x20e264[_0x7f33('0x24')]][_0x7f33('0x31')]>0x0){tiff2pdf(_0x20e264[_0x7f33('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x26bc7b){logger[_0x7f33('0x2e')](_0x20e264[_0x7f33('0x24')],_0x7f33('0x34'),_0x26bc7b[_0x7f33('0x35')]);attachment[_0x7f33('0x36')]({'name':path[_0x7f33('0x37')](_0x20e264['filename'])[_0x7f33('0x26')],'basename':path[_0x7f33('0x37')](_0x20e264[_0x7f33('0x2d')])[_0x7f33('0x26')]+_0x7f33('0x38'),'type':_0x7f33('0x39')})[_0x7f33('0x3a')](function(_0x3998ac){faxAccount[_0x7f33('0x3b')](_0x346a26,{'from':_0x20e264[_0x7f33('0x3c')],'mapKey':'fax','body':path['parse'](_0x20e264['filename'])['name']+_0x7f33('0x38'),'AttachmentId':_0x3998ac['id']})[_0x7f33('0x3d')](function(_0x2a5d0f){logger[_0x7f33('0x3e')](_0x20e264[_0x7f33('0x24')],_0x7f33('0x3f'),JSON[_0x7f33('0x40')](_0x2a5d0f));});})['catch'](function(_0x13b071){logger[_0x7f33('0x3e')](_0x20e264[_0x7f33('0x24')],_0x7f33('0x41'),JSON[_0x7f33('0x40')](_0x13b071));});});}logger[_0x7f33('0x2e')](_0x20e264[_0x7f33('0x24')],_0x7f33('0x41'));}};Fax[_0x7f33('0x1e')][_0x7f33('0x1d')]=function(_0x1b48ac){if(this[_0x7f33('0x42')][_0x1b48ac[_0x7f33('0x24')]]){_['merge'](this['channels'][_0x1b48ac[_0x7f33('0x24')]],_[_0x7f33('0x43')](_0x1b48ac,[_0x7f33('0x44'),'reason']));}};function updateStatus(_0xc418d2){if(_0xc418d2['AttachmentId']){faxMessage[_0x7f33('0x45')](_0xc418d2[_0x7f33('0x46')],{'failMessage':_0x7f33('0x47')})[_0x7f33('0x3a')](function(_0x5473da){ut[_0x7f33('0x48')](_0x7f33('0x49'),_0x5473da);})[_0x7f33('0x3d')](function(_0xe0c19b){ut['logger'](_0x7f33('0x4a'),_0xe0c19b);});}else{ut[_0x7f33('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7f33('0x1e')]['updateStatus']=function(_0x556788,_0x5d6271,_0x1af068){var _0x3b2e31=this;var _0x2d58c0={};if(_0x5d6271){_0x2d58c0={'read':_0x5d6271};}else{_0x2d58c0={'failMessage':_0x1af068};}if(this['actions'][_0x556788][_0x7f33('0x46')]){faxMessage['update'](this[_0x7f33('0x42')][_0x556788][_0x7f33('0x46')],_0x2d58c0)[_0x7f33('0x3a')](function(_0x5f3ed8){ut['logger']('[Fax][Message][Updated]',_0x5f3ed8);})[_0x7f33('0x3d')](function(_0x30a71d){ut['logger'](_0x7f33('0x4b'),_0x30a71d);})[_0x7f33('0x4c')](function(){delete _0x3b2e31[_0x7f33('0x23')][_0x556788];delete _0x3b2e31['actions'][_0x556788];});}else{ut[_0x7f33('0x48')](_0x7f33('0x4d'));delete this[_0x7f33('0x23')][_0x556788];delete this[_0x7f33('0x42')][_0x556788];}};Fax['prototype'][_0x7f33('0x1b')]=function(_0x16f68d){var _0x2ccf2d=this;if(this[_0x7f33('0x23')][_0x16f68d[_0x7f33('0x24')]]){if(this[_0x7f33('0x42')][_0x16f68d[_0x7f33('0x24')]]){this[_0x7f33('0x23')][_0x16f68d[_0x7f33('0x24')]]['id']=this[_0x7f33('0x42')][_0x16f68d[_0x7f33('0x24')]]['id'];this['channels'][_0x16f68d[_0x7f33('0x24')]][_0x7f33('0x26')]=this['actions'][_0x16f68d['uniqueid']]['name'];}logger[_0x7f33('0x2e')](_0x16f68d[_0x7f33('0x24')],this[_0x7f33('0x42')][_0x16f68d['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x7f33('0x4e'),JSON[_0x7f33('0x40')](this[_0x7f33('0x23')][_0x16f68d[_0x7f33('0x24')]]));if(this[_0x7f33('0x42')][_0x16f68d[_0x7f33('0x24')]]){if(this[_0x7f33('0x23')][_0x16f68d[_0x7f33('0x24')]]['faxpages']>0x0&&this['channels'][_0x16f68d[_0x7f33('0x24')]][_0x7f33('0x16')]==='SUCCESS'){this[_0x7f33('0x4f')](_0x16f68d[_0x7f33('0x24')],!![]);}else{this['updateStatus'](_0x16f68d[_0x7f33('0x24')],![],this[_0x7f33('0x23')][_0x16f68d[_0x7f33('0x24')]][_0x7f33('0x50')]?_0x7f33('0x51')+this[_0x7f33('0x23')][_0x16f68d['uniqueid']][_0x7f33('0x50')]:_0x7f33('0x52'));}}}};Fax[_0x7f33('0x1e')][_0x7f33('0x53')]=function(_0x3358c7){var _0x2cf9e0=this;return new BPromise(function(_0x4a3f40,_0x254191){_0x2cf9e0[_0x7f33('0x54')](_0x3358c7,_0x2cf9e0[_0x7f33('0xc')][_0x3358c7[_0x7f33('0x55')]])[_0x7f33('0x3a')](function(_0x3a23e6){ut[_0x7f33('0x48')](_0x7f33('0x56'),_0x3a23e6);_0x4a3f40(ut['message'](_0x7f33('0x57')));})[_0x7f33('0x3d')](function(_0x3414b7){ut[_0x7f33('0x48')](_0x7f33('0x58'),_0x3414b7);updateStatus(_0x3358c7);_0x254191(ut[_0x7f33('0x35')](_0x7f33('0x59')));});});};Fax['prototype'][_0x7f33('0x5a')]=function(_0x5dcdd3){var _0x304e34=this;return new BPromise(function(_0xd29134,_0x1beea1){var _0x463046=_0x304e34[_0x7f33('0x5b')](_0x304e34['faxAccounts'][_0x5dcdd3['FaxAccountId']][_0x7f33('0x5c')],_0x5dcdd3);if(_0x463046[_0x7f33('0x5d')]){_0xd29134(ut[_0x7f33('0x35')](_0x7f33('0x5e')));}else{_0x1beea1(ut[_0x7f33('0x35')](_0x463046['message']));}});};function originate(_0x2be2a8,_0x28271f,_0x486565){return new BPromise(function(_0x2eb311,_0x477a53){if(_0x486565){var _0xcbe01f=util[_0x7f33('0x5f')](_0x7f33('0x60'),path[_0x7f33('0x37')](_0x2be2a8[_0x7f33('0x5')])[_0x7f33('0x26')],_0x2be2a8[_0x7f33('0x5')]);gs[_0x7f33('0x61')](_0xcbe01f)[_0x7f33('0x3a')](function(){_0x2be2a8[_0x7f33('0x5')]=util[_0x7f33('0x5f')](_0x7f33('0x62'),path[_0x7f33('0x37')](_0x2be2a8[_0x7f33('0x5')])[_0x7f33('0x63')],path[_0x7f33('0x37')](_0x2be2a8[_0x7f33('0x5')])[_0x7f33('0x26')]);_0x28271f[_0x7f33('0x64')]=_0x2be2a8[_0x7f33('0x5')];ut[_0x7f33('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x7f33('0x65')](ut[_0x7f33('0x66')](_0x2be2a8,_0x28271f))[_0x7f33('0x3a')](function(_0x5978e5){_0x2eb311(_0x5978e5);})[_0x7f33('0x3d')](function(_0x5724dc){_0x477a53(_0x5724dc);});})[_0x7f33('0x3d')](function(_0x54534d){_0x477a53(_0x54534d);});}else{ami['Action'](ut[_0x7f33('0x66')](_0x2be2a8,_0x28271f))[_0x7f33('0x3a')](function(_0x9b7e6d){_0x2eb311(_0x9b7e6d);})[_0x7f33('0x3d')](function(_0x28fcb7){_0x477a53(_0x28fcb7);});}});}Fax['prototype'][_0x7f33('0x54')]=function(_0x9729e3,_0x325bfc){var _0x326278=this;return new BPromise(function(_0x4be2b4,_0x3062ec){var _0x1fbf51=uuid['v4']();var _0x4da8c1=ut[_0x7f33('0x67')](_0x9729e3,_0x325bfc);_0x326278[_0x7f33('0x42')][_0x1fbf51]=new Action(_0x1fbf51,_0x325bfc,_0x9729e3);var _0x28aed4=_0x326278[_0x7f33('0x42')][_0x1fbf51];if(path[_0x7f33('0x37')](_0x9729e3[_0x7f33('0x5')])[_0x7f33('0x68')]===_0x7f33('0x38')){originate(_0x28aed4,_0x4da8c1,!![])[_0x7f33('0x3a')](function(_0x46ff2e){_0x4be2b4(_0x46ff2e);})[_0x7f33('0x3d')](function(_0x3a6dd1){_0x3062ec(_0x3a6dd1);});}else{originate(_0x28aed4,_0x4da8c1,![])['then'](function(_0x408782){_0x4be2b4(_0x408782);})[_0x7f33('0x3d')](function(_0x382c30){_0x3062ec(_0x382c30);});}});};Fax[_0x7f33('0x1e')][_0x7f33('0x69')]=function(_0x2ca047){return!_[_0x7f33('0x6a')](_0x2ca047)&&!_[_0x7f33('0x6a')](_0x2ca047[_0x7f33('0x26')])&&!_[_0x7f33('0x6a')](_0x2ca047['active'])&&_0x2ca047[_0x7f33('0x6b')]&&!_[_0x7f33('0x6a')](this[_0x7f33('0xd')][util['format'](_0x7f33('0x6c'),_0x2ca047[_0x7f33('0x26')])])&&!_[_0x7f33('0x6a')](this[_0x7f33('0xd')][util[_0x7f33('0x5f')]('SIP/%s',_0x2ca047[_0x7f33('0x26')])][_0x7f33('0x6d')])&&(this[_0x7f33('0xd')][util[_0x7f33('0x5f')]('SIP/%s',_0x2ca047[_0x7f33('0x26')])][_0x7f33('0x6d')]===_0x7f33('0x6e')||this['trunks'][util[_0x7f33('0x5f')](_0x7f33('0x6c'),_0x2ca047[_0x7f33('0x26')])]['status']===_0x7f33('0x6f'));};Fax['prototype'][_0x7f33('0x5b')]=function(_0x37fd79,_0x1a5a76){if(!this[_0x7f33('0x69')](_0x37fd79)){ut[_0x7f33('0x48')](_0x7f33('0x70'),_[_0x7f33('0x6a')](_0x37fd79)?'':_0x37fd79[_0x7f33('0x26')]+_0x7f33('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x7f33('0x6a')](_0x1a5a76[_0x7f33('0x8')])){ut[_0x7f33('0x48')](_0x7f33('0x72'),JSON[_0x7f33('0x40')](_0x1a5a76));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x7f33('0x6a')](_0x1a5a76[_0x7f33('0x5')])){ut[_0x7f33('0x48')](_0x7f33('0x73'),JSON['stringify'](_0x1a5a76));return{'isValid':![],'message':_0x7f33('0x74')};}return{'isValid':!![],'message':_0x7f33('0x75')};};module[_0x7f33('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 0baf597..032b754 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 _0x7cbd=['../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash'];(function(_0x4db40c,_0x5aebda){var _0x572a4b=function(_0x4cb854){while(--_0x4cb854){_0x4db40c['push'](_0x4db40c['shift']());}};_0x572a4b(++_0x5aebda);}(_0x7cbd,0xb0));var _0xd7cb=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x7cbd[_0x3f5dca];return _0x5b833a;};'use strict';var util=require(_0xd7cb('0x0'));var BPromise=require('bluebird');var logger=require(_0xd7cb('0x1'))(_0xd7cb('0x2'));var _=require(_0xd7cb('0x3'));var faxAccount=require(_0xd7cb('0x4'));function loggerCatch(_0x11c204){return function(_0x2f0e8b){logger[_0xd7cb('0x5')](_0x11c204,util[_0xd7cb('0x6')](_0x2f0e8b,{'showHidden':![],'depth':null}));};}exports[_0xd7cb('0x7')]=function(_0x14afb9,_0xe27b01){return BPromise[_0xd7cb('0x8')]()[_0xd7cb('0x9')](faxAccount[_0xd7cb('0x7')](_0x14afb9,_0xe27b01))[_0xd7cb('0xa')](loggerCatch(_0xd7cb('0xb')));}; \ No newline at end of file +var _0x8b5d=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x50959f,_0x13ebdd){var _0x125060=function(_0x4a67d4){while(--_0x4a67d4){_0x50959f['push'](_0x50959f['shift']());}};_0x125060(++_0x13ebdd);}(_0x8b5d,0x138));var _0xd8b5=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x8b5d[_0x17882c];return _0x355a59;};'use strict';var util=require('util');var BPromise=require(_0xd8b5('0x0'));var logger=require(_0xd8b5('0x1'))(_0xd8b5('0x2'));var _=require(_0xd8b5('0x3'));var faxAccount=require(_0xd8b5('0x4'));function loggerCatch(_0x1866a3){return function(_0x33f469){logger[_0xd8b5('0x5')](_0x1866a3,util[_0xd8b5('0x6')](_0x33f469,{'showHidden':![],'depth':null}));};}exports[_0xd8b5('0x7')]=function(_0x2255e3,_0x1dfcad){return BPromise[_0xd8b5('0x8')]()[_0xd8b5('0x9')](faxAccount[_0xd8b5('0x7')](_0x2255e3,_0x1dfcad))[_0xd8b5('0xa')](loggerCatch(_0xd8b5('0xb')));}; \ 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 0380f43..d0e7519 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 _0xca41=['bluebird','child_process','execute','info','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0xad13de,_0x40c6d5){var _0x27553a=function(_0x441bb8){while(--_0x441bb8){_0xad13de['push'](_0xad13de['shift']());}};_0x27553a(++_0x40c6d5);}(_0xca41,0xc5));var _0x1ca4=function(_0x583858,_0xad33e3){_0x583858=_0x583858-0x0;var _0x576e3d=_0xca41[_0x583858];return _0x576e3d;};'use strict';var util=require(_0x1ca4('0x0'));var logger=require(_0x1ca4('0x1'))(_0x1ca4('0x2'));var BPromise=require(_0x1ca4('0x3'));var exec=require(_0x1ca4('0x4'))['exec'];exports[_0x1ca4('0x5')]=function(_0x233d4b){return new BPromise(function(_0x1b1ca6,_0x18001d){exec(_0x233d4b,function(_0x37da17,_0x24a288,_0x3e0d00){logger[_0x1ca4('0x6')]('Exec\x20gs',_0x24a288);if(_0x37da17){logger['info']('Exec\x20gs',_0x1ca4('0x7'),util['inspect'](_0x37da17,{'showHidden':![],'depth':null}),_0x24a288,_0x3e0d00);_0x18001d(_0x37da17);}_0x1b1ca6(_0x24a288);});});}; \ No newline at end of file +var _0x7e0c=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x5a23e2,_0x429316){var _0xd47fbc=function(_0x347e91){while(--_0x347e91){_0x5a23e2['push'](_0x5a23e2['shift']());}};_0xd47fbc(++_0x429316);}(_0x7e0c,0xbd));var _0xc7e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e0c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc7e0('0x0'));var logger=require(_0xc7e0('0x1'))(_0xc7e0('0x2'));var BPromise=require(_0xc7e0('0x3'));var exec=require(_0xc7e0('0x4'))[_0xc7e0('0x5')];exports[_0xc7e0('0x6')]=function(_0x214aea){return new BPromise(function(_0x1b70af,_0x5dfb86){exec(_0x214aea,function(_0x386ab6,_0x3f2f2b,_0x4a367f){logger[_0xc7e0('0x7')](_0xc7e0('0x8'),_0x3f2f2b);if(_0x386ab6){logger[_0xc7e0('0x7')](_0xc7e0('0x8'),_0xc7e0('0x9'),util[_0xc7e0('0xa')](_0x386ab6,{'showHidden':![],'depth':null}),_0x3f2f2b,_0x4a367f);_0x5dfb86(_0x386ab6);}_0x1b70af(_0x3f2f2b);});});}; \ 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 dac8597..b4beab1 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 _0xfdc7=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','logger'];(function(_0x551b9b,_0x1f69ec){var _0x2dfa99=function(_0x1099ff){while(--_0x1099ff){_0x551b9b['push'](_0x551b9b['shift']());}};_0x2dfa99(++_0x1f69ec);}(_0xfdc7,0x118));var _0x7fdc=function(_0x3ea3ae,_0x29dd29){_0x3ea3ae=_0x3ea3ae-0x0;var _0x2aa587=_0xfdc7[_0x3ea3ae];return _0x2aa587;};'use strict';var util=require(_0x7fdc('0x0'));var _=require(_0x7fdc('0x1'));var moment=require(_0x7fdc('0x2'));var logger=require(_0x7fdc('0x3'))('fax');exports[_0x7fdc('0x4')]=function(_0x111491){return{'message':_0x111491};};exports[_0x7fdc('0x5')]=function(_0x5a17c0,_0x44f2e6){logger['info'](_0x5a17c0,util[_0x7fdc('0x6')](_0x44f2e6,{'showHidden':![],'depth':null}));};exports[_0x7fdc('0x7')]=function(_0xe9b6f3,_0x38eb06){var _0x2a2b05={'XMF-ECM':_0x38eb06[_0x7fdc('0x8')],'XMF-HEADERINFO':_0x38eb06[_0x7fdc('0x9')],'XMF-MINRATE':_0x38eb06[_0x7fdc('0xa')],'XMF-MAXRATE':_0x38eb06[_0x7fdc('0xb')],'XMF-MODEM':util[_0x7fdc('0xc')](_0x7fdc('0xd'),_0x38eb06[_0x7fdc('0xe')]),'XMF-GATEWAY':_0x38eb06[_0x7fdc('0xf')],'XMF-FAXDETECT':_0x38eb06[_0x7fdc('0x10')],'XMF-T38TIMEOUT':_0x38eb06[_0x7fdc('0x11')],'XMF-LOCALSTATIONID':_0x38eb06[_0x7fdc('0x12')],'XMF-PATH':_0xe9b6f3[_0x7fdc('0x13')]};return _0x2a2b05;};exports[_0x7fdc('0x14')]=function(_0x3e20b3,_0x425348){return{'actionid':_0x3e20b3[_0x7fdc('0x15')],'action':'originate','channel':_0x3e20b3[_0x7fdc('0x16')],'Exten':_0x7fdc('0x17'),'Context':_0x7fdc('0x18'),'Priority':'1','callerid':util['format'](_0x7fdc('0x19'),_0x3e20b3[_0x7fdc('0x9')]?_0x3e20b3[_0x7fdc('0x9')]:'',_0x3e20b3[_0x7fdc('0x12')]),'variable':_0x425348,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3e20b3[_0x7fdc('0x15')]};}; \ No newline at end of file +var _0x076c=['addVariables','headerinfo','minrate','format','modem','gateway','faxdetect','t38timeout','localstationid','originate','channel','from-sip','util','lodash','moment','../../../../config/logger','fax','message','info'];(function(_0x2484d8,_0x5b666e){var _0x30c173=function(_0x2839a7){while(--_0x2839a7){_0x2484d8['push'](_0x2484d8['shift']());}};_0x30c173(++_0x5b666e);}(_0x076c,0x6b));var _0xc076=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x076c[_0x5e2152];return _0x5ddcf6;};'use strict';var util=require(_0xc076('0x0'));var _=require(_0xc076('0x1'));var moment=require(_0xc076('0x2'));var logger=require(_0xc076('0x3'))(_0xc076('0x4'));exports[_0xc076('0x5')]=function(_0x535659){return{'message':_0x535659};};exports['logger']=function(_0x5013bb,_0x44c806){logger[_0xc076('0x6')](_0x5013bb,util['inspect'](_0x44c806,{'showHidden':![],'depth':null}));};exports[_0xc076('0x7')]=function(_0x81cf9a,_0x391c4c){var _0x27d6a0={'XMF-ECM':_0x391c4c['ecm'],'XMF-HEADERINFO':_0x391c4c[_0xc076('0x8')],'XMF-MINRATE':_0x391c4c[_0xc076('0x9')],'XMF-MAXRATE':_0x391c4c['maxrate'],'XMF-MODEM':util[_0xc076('0xa')]('\x22%s\x22',_0x391c4c[_0xc076('0xb')]),'XMF-GATEWAY':_0x391c4c[_0xc076('0xc')],'XMF-FAXDETECT':_0x391c4c[_0xc076('0xd')],'XMF-T38TIMEOUT':_0x391c4c[_0xc076('0xe')],'XMF-LOCALSTATIONID':_0x391c4c[_0xc076('0xf')],'XMF-PATH':_0x81cf9a['path']};return _0x27d6a0;};exports['variablesAction']=function(_0xc2e23b,_0x4834b2){return{'actionid':_0xc2e23b['uniqueid'],'action':_0xc076('0x10'),'channel':_0xc2e23b[_0xc076('0x11')],'Exten':'xcally-motion-fax','Context':_0xc076('0x12'),'Priority':'1','callerid':util[_0xc076('0xa')]('\x22%s\x22\x20<%s>',_0xc2e23b[_0xc076('0x8')]?_0xc2e23b[_0xc076('0x8')]:'',_0xc2e23b['localstationid']),'variable':_0x4834b2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xc2e23b['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f613a04..c969753 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 _0x733b=['getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','hour','get','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts'];(function(_0x6da8f7,_0x41adb8){var _0x7645dd=function(_0x365e28){while(--_0x365e28){_0x6da8f7['push'](_0x6da8f7['shift']());}};_0x7645dd(++_0x41adb8);}(_0x733b,0xc0));var _0xb733=function(_0x22eb76,_0xda956a){_0x22eb76=_0x22eb76-0x0;var _0x22bc81=_0x733b[_0x22eb76];return _0x22bc81;};'use strict';var BPromise=require(_0xb733('0x0'));var util=require(_0xb733('0x1'));var moment=require(_0xb733('0x2'));var server=require(_0xb733('0x3'));var Realtime=require(_0xb733('0x4'));var Report=require(_0xb733('0x5'));var Acw=require(_0xb733('0x6'));var Trigger=require(_0xb733('0x7'));var Dialer=require(_0xb733('0x8'));var Preview=require(_0xb733('0x9'));var Fax=require(_0xb733('0xa'));var user=require(_0xb733('0xb'));var voiceQueue=require(_0xb733('0xc'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xb733('0xd'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0xb733('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xb733('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xb733('0x10'));var zendesk=require(_0xb733('0x11'));var salesforce=require(_0xb733('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xb733('0x13'));var desk=require(_0xb733('0x14'));var zoho=require(_0xb733('0x15'));var vtiger=require(_0xb733('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xb733('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xb733('0x18')](_0xb733('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xb733('0x19')]()[_0xb733('0x1a')](user[_0xb733('0x1b')]())[_0xb733('0x1a')](realtime[_0xb733('0x1c')]())[_0xb733('0x1a')](user['getTelephones']())['then'](realtime[_0xb733('0x1d')]())[_0xb733('0x1a')](trunk[_0xb733('0x1e')]())[_0xb733('0x1a')](realtime[_0xb733('0x1f')]())[_0xb733('0x1a')](voiceQueue[_0xb733('0x20')]())[_0xb733('0x1a')](realtime[_0xb733('0x21')]())[_0xb733('0x1a')](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0xb733('0x1a')](template[_0xb733('0x22')]())[_0xb733('0x1a')](realtime['initTemplates']())['then'](zendesk[_0xb733('0x23')]())[_0xb733('0x1a')](realtime[_0xb733('0x24')]())[_0xb733('0x1a')](salesforce[_0xb733('0x25')]())[_0xb733('0x1a')](realtime[_0xb733('0x26')]())[_0xb733('0x1a')](sugarcrm[_0xb733('0x27')]())[_0xb733('0x1a')](realtime[_0xb733('0x28')]())[_0xb733('0x1a')](freshdesk[_0xb733('0x29')]())['then'](realtime[_0xb733('0x2a')]())['then'](desk[_0xb733('0x2b')]())[_0xb733('0x1a')](realtime['initDeskAccounts']())[_0xb733('0x1a')](zoho[_0xb733('0x2c')]())[_0xb733('0x1a')](realtime[_0xb733('0x2d')]())[_0xb733('0x1a')](vtiger[_0xb733('0x2e')]())[_0xb733('0x1a')](realtime['initVtigerAccounts']())[_0xb733('0x1a')](servicenow['getServicenowAccounts']())[_0xb733('0x1a')](realtime[_0xb733('0x2f')]())[_0xb733('0x1a')](dynamics365[_0xb733('0x30')]())[_0xb733('0x1a')](realtime[_0xb733('0x31')]())[_0xb733('0x1a')](campaign['getCampaigns']())[_0xb733('0x1a')](realtime['initCampaigns']())[_0xb733('0x1a')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0xb733('0x32')]())['then'](faxAccount[_0xb733('0x33')]())['then'](realtime['initFaxAccounts']())[_0xb733('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xb733('0x19')]()[_0xb733('0x1a')](voiceQueueReport[_0xb733('0x34')]())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xb733('0x1a')](realtime[_0xb733('0x35')]())['then'](cmHopperHistory[_0xb733('0x36')]())[_0xb733('0x1a')](realtime['initCampaignHopperHistory']())[_0xb733('0x1a')](voiceCallReport[_0xb733('0x37')]())[_0xb733('0x1a')](realtime[_0xb733('0x38')]())['then'](function(_0x39d9b6){})[_0xb733('0x39')](function(_0x57c75d){console[_0xb733('0x3a')](_0x57c75d);});}function main(){return server[_0xb733('0x3b')](realtime,preview,fax)[_0xb733('0x1a')](function(_0x1a7956){return initRealtime();})[_0xb733('0x1a')](function(){return initParams();})[_0xb733('0x1a')](function(){report[_0xb733('0x3c')]();setInterval(initRealtime,0x1388);})[_0xb733('0x39')](function(_0x5df290){console['log'](_0x5df290);});}main(); \ No newline at end of file +var _0x3551=['./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','util','moment','./server','./realtime','./acw','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/freshdesk'];(function(_0x7df376,_0x397398){var _0xbe9220=function(_0x36c904){while(--_0x36c904){_0x7df376['push'](_0x7df376['shift']());}};_0xbe9220(++_0x397398);}(_0x3551,0x194));var _0x1355=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0x3551[_0x45d56b];return _0xd62e37;};'use strict';var BPromise=require('bluebird');var util=require(_0x1355('0x0'));var moment=require(_0x1355('0x1'));var server=require(_0x1355('0x2'));var Realtime=require(_0x1355('0x3'));var Report=require('./report');var Acw=require(_0x1355('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x1355('0x5'));var user=require('./rpc/user');var voiceQueue=require(_0x1355('0x6'));var voiceQueueReport=require(_0x1355('0x7'));var voiceCallReport=require(_0x1355('0x8'));var trunk=require(_0x1355('0x9'));var trigger=require(_0x1355('0xa'));var template=require(_0x1355('0xb'));var cmHopperHistory=require(_0x1355('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1355('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x1355('0xe'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x1355('0xf'));var desk=require(_0x1355('0x10'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x1355('0x11'));var servicenow=require(_0x1355('0x12'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1355('0x13')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1355('0x13')](_0x1355('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1355('0x15')]()['then'](user[_0x1355('0x16')]())['then'](realtime[_0x1355('0x17')]())[_0x1355('0x18')](user[_0x1355('0x19')]())[_0x1355('0x18')](realtime[_0x1355('0x1a')]())['then'](trunk[_0x1355('0x1b')]())['then'](realtime[_0x1355('0x1c')]())['then'](voiceQueue[_0x1355('0x1d')]())[_0x1355('0x18')](realtime[_0x1355('0x1e')]())['then'](trigger[_0x1355('0x1f')]())[_0x1355('0x18')](realtime['initTriggers']())[_0x1355('0x18')](template['getTemplates']())['then'](realtime[_0x1355('0x20')]())[_0x1355('0x18')](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0x1355('0x18')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x1355('0x21')]())['then'](sugarcrm[_0x1355('0x22')]())[_0x1355('0x18')](realtime['initSugarcrmAccounts']())[_0x1355('0x18')](freshdesk['getFreshdeskAccounts']())[_0x1355('0x18')](realtime[_0x1355('0x23')]())[_0x1355('0x18')](desk[_0x1355('0x24')]())[_0x1355('0x18')](realtime[_0x1355('0x25')]())[_0x1355('0x18')](zoho[_0x1355('0x26')]())[_0x1355('0x18')](realtime[_0x1355('0x27')]())['then'](vtiger[_0x1355('0x28')]())['then'](realtime['initVtigerAccounts']())[_0x1355('0x18')](servicenow[_0x1355('0x29')]())[_0x1355('0x18')](realtime[_0x1355('0x2a')]())['then'](dynamics365[_0x1355('0x2b')]())[_0x1355('0x18')](realtime[_0x1355('0x2c')]())['then'](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0x1355('0x18')](voiceExtension[_0x1355('0x2d')]())['then'](realtime[_0x1355('0x2e')]())[_0x1355('0x18')](faxAccount[_0x1355('0x2f')]())['then'](realtime[_0x1355('0x30')]())[_0x1355('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x1355('0x15')]()['then'](voiceQueueReport[_0x1355('0x31')]())[_0x1355('0x18')](realtime[_0x1355('0x32')]())[_0x1355('0x18')](cmHopperHistory[_0x1355('0x33')]())[_0x1355('0x18')](realtime[_0x1355('0x34')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x1355('0x18')](realtime[_0x1355('0x35')]())[_0x1355('0x18')](voiceCallReport[_0x1355('0x36')]())['then'](realtime[_0x1355('0x37')]())['then'](function(_0x7539a2){})[_0x1355('0x38')](function(_0x28779e){console[_0x1355('0x39')](_0x28779e);});}function main(){return server[_0x1355('0x3a')](realtime,preview,fax)['then'](function(_0xd891b8){return initRealtime();})[_0x1355('0x18')](function(){return initParams();})[_0x1355('0x18')](function(){report[_0x1355('0x3b')]();setInterval(initRealtime,0x1388);})[_0x1355('0x38')](function(_0x4c1420){console[_0x1355('0x39')](_0x4c1420);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index df30054..d651352 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 _0xa572=['email','accountcode','fullname','state','unknown','stateTime','status','address','phone','interface','online','voiceStatus','voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse','idle','talking','voiceStatusTime','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x5630ae,_0x937a7e){var _0x1c026c=function(_0x351054){while(--_0x351054){_0x5630ae['push'](_0x5630ae['shift']());}};_0x1c026c(++_0x937a7e);}(_0xa572,0x171));var _0x2a57=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xa572[_0x7a3247];return _0x1bfde5;};'use strict';var _=require(_0x2a57('0x0'));var util=require(_0x2a57('0x1'));var moment=require(_0x2a57('0x2'));var md5=require(_0x2a57('0x3'));var Redis=require(_0x2a57('0x4'));var config=require(_0x2a57('0x5'));config[_0x2a57('0x6')]=_[_0x2a57('0x7')](config[_0x2a57('0x6')],{'host':_0x2a57('0x8'),'port':0x18eb});var io=require(_0x2a57('0x9'))(new Redis(config['redis']));function Agent(_0x2ab15a){this['id']=_0x2ab15a['id']||0x0;this[_0x2a57('0xa')]=_0x2ab15a[_0x2a57('0xa')]||'';this[_0x2a57('0xb')]=_0x2ab15a['email']||'';this[_0x2a57('0xc')]=_0x2ab15a[_0x2a57('0xc')]||'';this[_0x2a57('0xd')]=_0x2ab15a['fullname']||'';this[_0x2a57('0xe')]=_0x2a57('0xf');this[_0x2a57('0x10')]=0x0;this[_0x2a57('0x11')]=_0x2a57('0xf');this[_0x2a57('0x12')]='';this[_0x2a57('0x13')]='';this['mobile']='';this[_0x2a57('0x14')]='';this['online']=_0x2ab15a[_0x2a57('0x15')]||![];this[_0x2a57('0x16')]=_0x2a57('0xf');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x2a57('0x17')]='';this[_0x2a57('0x18')]=![];this['local']=![];this[_0x2a57('0x3')]='';}Agent[_0x2a57('0x19')]['updateStatusRealtime']=function(_0x28b52d){var _0x19e7d1;if(_0x28b52d&&_0x28b52d[_0x2a57('0xe')]){_0x19e7d1=_0x28b52d[_0x2a57('0xe')][_0x2a57('0x1a')]();switch(_0x19e7d1){case _0x2a57('0x1b'):_0x19e7d1=_0x2a57('0x1c');break;case'inuse':_0x19e7d1=_0x2a57('0x1d');break;}}if(_0x19e7d1&&this[_0x2a57('0x16')]!==_0x19e7d1||_0x28b52d['statePause']){this[_0x2a57('0x1e')]=_[_0x2a57('0x1f')](moment()[_0x2a57('0x20')]('x'));}if(_0x19e7d1){this[_0x2a57('0x16')]=_0x19e7d1;}var _0x5de912={'id':this['id'],'name':this[_0x2a57('0xa')],'email':this[_0x2a57('0xb')],'accountcode':this[_0x2a57('0xc')],'fullname':this[_0x2a57('0xd')],'state':this['state'],'stateTime':this[_0x2a57('0x10')],'status':this['status'],'address':this[_0x2a57('0x12')],'online':this[_0x2a57('0x15')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x2a57('0x1e')],'voiceStatusCallerIdNumber':this[_0x2a57('0x21')],'voiceStatusQueue':this[_0x2a57('0x17')],'interface':this[_0x2a57('0x14')],'onhold':this[_0x2a57('0x18')]};var _0x8cacd8=md5(JSON[_0x2a57('0x22')](_0x5de912));if(this[_0x2a57('0x3')]!==_0x8cacd8){this[_0x2a57('0x3')]=_0x8cacd8;io['to'](util['format'](_0x2a57('0x23'),_0x5de912[_0x2a57('0xa')]))['emit'](_0x2a57('0x24'),_0x5de912);}};module[_0x2a57('0x25')]=Agent; \ No newline at end of file +var _0x21f7=['interface','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','state','toLowerCase','not_inuse','idle','inuse','voiceStatus','statePause','toNumber','format','fullname','stateTime','online','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','redis','defaults','localhost','name','email','accountcode','status','unknown','address','phone','mobile'];(function(_0x3401ce,_0x5d1579){var _0x1bb79d=function(_0x46985e){while(--_0x46985e){_0x3401ce['push'](_0x3401ce['shift']());}};_0x1bb79d(++_0x5d1579);}(_0x21f7,0x19d));var _0x721f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x21f7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x721f('0x0'));var util=require(_0x721f('0x1'));var moment=require(_0x721f('0x2'));var md5=require(_0x721f('0x3'));var Redis=require(_0x721f('0x4'));var config=require('../../../config/environment');config[_0x721f('0x5')]=_[_0x721f('0x6')](config[_0x721f('0x5')],{'host':_0x721f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x721f('0x5')]));function Agent(_0x562c59){this['id']=_0x562c59['id']||0x0;this[_0x721f('0x8')]=_0x562c59[_0x721f('0x8')]||'';this[_0x721f('0x9')]=_0x562c59[_0x721f('0x9')]||'';this[_0x721f('0xa')]=_0x562c59[_0x721f('0xa')]||'';this['fullname']=_0x562c59['fullname']||'';this['state']='unknown';this['stateTime']=0x0;this[_0x721f('0xb')]=_0x721f('0xc');this[_0x721f('0xd')]='';this[_0x721f('0xe')]='';this[_0x721f('0xf')]='';this[_0x721f('0x10')]='';this['online']=_0x562c59['online']||![];this['voiceStatus']=_0x721f('0xc');this[_0x721f('0x11')]=0x0;this[_0x721f('0x12')]='';this[_0x721f('0x13')]='';this[_0x721f('0x14')]=![];this['local']=![];this[_0x721f('0x3')]='';}Agent[_0x721f('0x15')]['updateStatusRealtime']=function(_0x3625a5){var _0x58fc23;if(_0x3625a5&&_0x3625a5['state']){_0x58fc23=_0x3625a5[_0x721f('0x16')][_0x721f('0x17')]();switch(_0x58fc23){case _0x721f('0x18'):_0x58fc23=_0x721f('0x19');break;case _0x721f('0x1a'):_0x58fc23='talking';break;}}if(_0x58fc23&&this[_0x721f('0x1b')]!==_0x58fc23||_0x3625a5[_0x721f('0x1c')]){this[_0x721f('0x11')]=_[_0x721f('0x1d')](moment()[_0x721f('0x1e')]('x'));}if(_0x58fc23){this['voiceStatus']=_0x58fc23;}var _0x1480a7={'id':this['id'],'name':this[_0x721f('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x721f('0x1f')],'state':this[_0x721f('0x16')],'stateTime':this[_0x721f('0x20')],'status':this[_0x721f('0xb')],'address':this[_0x721f('0xd')],'online':this[_0x721f('0x21')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x721f('0x11')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x721f('0x10')],'onhold':this[_0x721f('0x14')]};var _0x346f2c=md5(JSON[_0x721f('0x22')](_0x1480a7));if(this['md5']!==_0x346f2c){this['md5']=_0x346f2c;io['to'](util['format'](_0x721f('0x23'),_0x1480a7[_0x721f('0x8')]))[_0x721f('0x24')](_0x721f('0x25'),_0x1480a7);}};module[_0x721f('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 ef64f86..0ec4337 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 _0xbc9d=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x43bc3e,_0x5438aa){_0x43bc3e=_0x43bc3e-0x0;var _0xd3dd61=_0xbc9d[_0x43bc3e];return _0xd3dd61;};'use strict';function Campaign(_0x1a39c9){this['id']=_0x1a39c9['id']||0x0;this[_0xdbc9('0x0')]=_0x1a39c9[_0xdbc9('0x0')]||'';this[_0xdbc9('0x1')]=_0x1a39c9[_0xdbc9('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this[_0xdbc9('0x2')]=0x0;this[_0xdbc9('0x3')]=0x0;this[_0xdbc9('0x4')]='';this[_0xdbc9('0x5')]=!![];this[_0xdbc9('0x6')]=_0x1a39c9[_0xdbc9('0x6')];this[_0xdbc9('0x7')]=_0x1a39c9['limitCalls'];this[_0xdbc9('0x8')]=_0x1a39c9[_0xdbc9('0x8')]||null;this[_0xdbc9('0x9')]=_0x1a39c9['dialGlobalInterval']?_0x1a39c9[_0xdbc9('0x9')]:null;this['dialOriginateCallerIdName']=_0x1a39c9['dialOriginateCallerIdName'];this[_0xdbc9('0xa')]=_0x1a39c9[_0xdbc9('0xa')];this[_0xdbc9('0xb')]=_0x1a39c9[_0xdbc9('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x1a39c9[_0xdbc9('0xc')];this[_0xdbc9('0xd')]=_0x1a39c9[_0xdbc9('0xd')];this[_0xdbc9('0xe')]=_0x1a39c9[_0xdbc9('0xe')];this[_0xdbc9('0xf')]=_0x1a39c9['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1a39c9[_0xdbc9('0x10')];this[_0xdbc9('0x11')]=_0x1a39c9[_0xdbc9('0x11')];this[_0xdbc9('0x12')]=_0x1a39c9[_0xdbc9('0x12')];this['dialOrderByScheduledAt']=_0x1a39c9[_0xdbc9('0x13')]||_0xdbc9('0x14');this[_0xdbc9('0x15')]=_0x1a39c9['dialPrefix']||undefined;this[_0xdbc9('0x16')]=_0x1a39c9[_0xdbc9('0x16')]||undefined;this['dialCutDigit']=_0x1a39c9[_0xdbc9('0x17')]||undefined;this[_0xdbc9('0x18')]=_0x1a39c9[_0xdbc9('0x18')]?_0x1a39c9[_0xdbc9('0x18')]:undefined;this[_0xdbc9('0x19')]=_0x1a39c9[_0xdbc9('0x19')]?_0x1a39c9[_0xdbc9('0x19')]:undefined;this[_0xdbc9('0x1a')]=_0x1a39c9[_0xdbc9('0x1a')]?_0x1a39c9[_0xdbc9('0x1a')]:undefined;this['SquareProject']=_0x1a39c9[_0xdbc9('0x1b')]?_0x1a39c9['SquareProject']:undefined;this[_0xdbc9('0x1c')]=_0x1a39c9[_0xdbc9('0x1b')]?_0x1a39c9['SquareProject'][_0xdbc9('0x0')]:undefined;this['dialAMDActive']=_0x1a39c9['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x1a39c9['dialAMDInitialSilence'];this[_0xdbc9('0x1d')]=_0x1a39c9[_0xdbc9('0x1d')];this['dialAMDAfterGreetingSilence']=_0x1a39c9[_0xdbc9('0x1e')];this[_0xdbc9('0x1f')]=_0x1a39c9['dialAMDTotalAnalysisTime'];this[_0xdbc9('0x20')]=_0x1a39c9[_0xdbc9('0x20')];this[_0xdbc9('0x21')]=_0x1a39c9[_0xdbc9('0x21')];this[_0xdbc9('0x22')]=_0x1a39c9[_0xdbc9('0x22')];this[_0xdbc9('0x23')]=_0x1a39c9[_0xdbc9('0x23')];this[_0xdbc9('0x24')]=_0x1a39c9['dialAMDMaximumWordLength'];}module[_0xdbc9('0x25')]=Campaign; \ No newline at end of file +var _0xa446=['campaign','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type'];(function(_0x2e9a6,_0x129f89){var _0x4c2152=function(_0x5dc947){while(--_0x5dc947){_0x2e9a6['push'](_0x2e9a6['shift']());}};_0x4c2152(++_0x129f89);}(_0xa446,0xc6));var _0x6a44=function(_0x19b72c,_0x720b7f){_0x19b72c=_0x19b72c-0x0;var _0x529d88=_0xa446[_0x19b72c];return _0x529d88;};'use strict';function Campaign(_0x148241){this['id']=_0x148241['id']||0x0;this[_0x6a44('0x0')]=_0x148241['name']||'';this[_0x6a44('0x1')]=_0x148241['type']||_0x6a44('0x2');this['originated']=0x0;this[_0x6a44('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x6a44('0x4')]=0x0;this[_0x6a44('0x5')]='';this[_0x6a44('0x6')]=!![];this[_0x6a44('0x7')]=_0x148241[_0x6a44('0x7')];this[_0x6a44('0x8')]=_0x148241['limitCalls'];this[_0x6a44('0x9')]=_0x148241[_0x6a44('0x9')]||null;this[_0x6a44('0xa')]=_0x148241[_0x6a44('0xa')]?_0x148241[_0x6a44('0xa')]:null;this['dialOriginateCallerIdName']=_0x148241[_0x6a44('0xb')];this[_0x6a44('0xc')]=_0x148241[_0x6a44('0xc')];this[_0x6a44('0xd')]=_0x148241[_0x6a44('0xd')]||0x1e;this[_0x6a44('0xe')]=_0x148241[_0x6a44('0xe')];this['dialCongestionRetryFrequency']=_0x148241[_0x6a44('0xf')];this[_0x6a44('0x10')]=_0x148241['dialBusyMaxRetry'];this[_0x6a44('0x11')]=_0x148241[_0x6a44('0x11')];this[_0x6a44('0x12')]=_0x148241['dialNoAnswerMaxRetry'];this[_0x6a44('0x13')]=_0x148241[_0x6a44('0x13')];this[_0x6a44('0x14')]=_0x148241[_0x6a44('0x14')];this[_0x6a44('0x15')]=_0x148241[_0x6a44('0x15')]||'DESC';this['dialPrefix']=_0x148241[_0x6a44('0x16')]||undefined;this[_0x6a44('0x17')]=_0x148241['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6a44('0x18')]=_0x148241[_0x6a44('0x18')]||undefined;this[_0x6a44('0x19')]=_0x148241[_0x6a44('0x19')]?_0x148241[_0x6a44('0x19')]:undefined;this[_0x6a44('0x1a')]=_0x148241[_0x6a44('0x1a')]?_0x148241[_0x6a44('0x1a')]:undefined;this[_0x6a44('0x1b')]=_0x148241[_0x6a44('0x1b')]?_0x148241[_0x6a44('0x1b')]:undefined;this[_0x6a44('0x1c')]=_0x148241[_0x6a44('0x1c')]?_0x148241[_0x6a44('0x1c')]:undefined;this['dialQueueProject']=_0x148241['SquareProject']?_0x148241['SquareProject'][_0x6a44('0x0')]:undefined;this[_0x6a44('0x1d')]=_0x148241[_0x6a44('0x1d')]||![];this[_0x6a44('0x1e')]=_0x148241['dialAMDInitialSilence'];this[_0x6a44('0x1f')]=_0x148241[_0x6a44('0x1f')];this['dialAMDAfterGreetingSilence']=_0x148241[_0x6a44('0x20')];this[_0x6a44('0x21')]=_0x148241[_0x6a44('0x21')];this[_0x6a44('0x22')]=_0x148241[_0x6a44('0x22')];this[_0x6a44('0x23')]=_0x148241[_0x6a44('0x23')];this[_0x6a44('0x24')]=_0x148241[_0x6a44('0x24')];this['dialAMDSilenceThreshold']=_0x148241[_0x6a44('0x25')];this[_0x6a44('0x26')]=_0x148241[_0x6a44('0x26')];}module[_0x6a44('0x27')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index be36eaf..4100599 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 _0xbd9e=['lastapplication','duration','billableseconds','holdtime','type','tag','monitor','queue','transfercalleridnum','transferconnectedlinenum','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','answered','answertime','endtime','unmanaged','abandoned'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0xbd9e,0x108));var _0xebd9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbd9e[_0x397e5f];return _0x5302b8;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xebd9('0x0')]='';this['calleridnum']=0x0;this[_0xebd9('0x1')]='';this[_0xebd9('0x2')]=undefined;this[_0xebd9('0x3')]=undefined;this[_0xebd9('0x4')]=0x0;this[_0xebd9('0x5')]='';this['uniqueid']=0x0;this[_0xebd9('0x6')]=0x0;this['exten']=0x0;this[_0xebd9('0x7')]=![];this[_0xebd9('0x8')]=null;this[_0xebd9('0x9')]=null;this[_0xebd9('0xa')]=![];this[_0xebd9('0xb')]=![];this[_0xebd9('0xc')]='';this['lastdata']='';this[_0xebd9('0xd')]=0x0;this[_0xebd9('0xe')]=0x0;this[_0xebd9('0xf')]=0x0;this[_0xebd9('0x10')]=null;this[_0xebd9('0x11')]=null;this['disposition']=null;this[_0xebd9('0x12')]=![];this['monitorFilename']=null;this[_0xebd9('0x13')]=null;this['monitors']=[];this[_0xebd9('0x14')]=undefined;this[_0xebd9('0x15')]=undefined;this['mohtime']=0x0;}module[_0xebd9('0x16')]=Channel; \ No newline at end of file +var _0x8969=['monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','answertime','endtime','unmanaged','lastapplication','lastdata','duration','holdtime','type','disposition'];(function(_0x26a5cf,_0x31be5f){var _0x4c5568=function(_0x2ef8ae){while(--_0x2ef8ae){_0x26a5cf['push'](_0x26a5cf['shift']());}};_0x4c5568(++_0x31be5f);}(_0x8969,0x130));var _0x9896=function(_0x1a268f,_0x2f4759){_0x1a268f=_0x1a268f-0x0;var _0x63fe77=_0x8969[_0x1a268f];return _0x63fe77;};'use strict';function Channel(){this[_0x9896('0x0')]=null;this['channel']='';this[_0x9896('0x1')]='';this[_0x9896('0x2')]=0x0;this[_0x9896('0x3')]='';this[_0x9896('0x4')]=undefined;this[_0x9896('0x5')]=undefined;this[_0x9896('0x6')]=0x0;this[_0x9896('0x7')]='';this['uniqueid']=0x0;this[_0x9896('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x9896('0x9')]=null;this[_0x9896('0xa')]=null;this[_0x9896('0xb')]=![];this['abandoned']=![];this[_0x9896('0xc')]='';this[_0x9896('0xd')]='';this[_0x9896('0xe')]=0x0;this['billableseconds']=0x0;this[_0x9896('0xf')]=0x0;this[_0x9896('0x10')]=null;this['tag']=null;this[_0x9896('0x11')]=null;this[_0x9896('0x12')]=![];this['monitorFilename']=null;this[_0x9896('0x13')]=null;this[_0x9896('0x14')]=[];this[_0x9896('0x15')]=undefined;this[_0x9896('0x16')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 22e2402..8ccde8e 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 _0x19d0=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0x19d0,0xd9));var _0x019d=function(_0x221bf4,_0x2fafcc){_0x221bf4=_0x221bf4-0x0;var _0x4271c5=_0x19d0[_0x221bf4];return _0x4271c5;};'use strict';function DeskAccount(_0xd82df5){this['id']=_0xd82df5['id']||0x0;this[_0x019d('0x0')]=_0xd82df5[_0x019d('0x0')]||'';this[_0x019d('0x1')]=_0xd82df5[_0x019d('0x1')]||'';this[_0x019d('0x2')]=_0xd82df5['remoteUri']||'';this[_0x019d('0x3')]=_0xd82df5[_0x019d('0x3')]||'';this[_0x019d('0x4')]=_0xd82df5[_0x019d('0x4')]||'';this[_0x019d('0x5')]=_0xd82df5[_0x019d('0x5')]||'';this[_0x019d('0x6')]=_0xd82df5[_0x019d('0x6')]||'';this[_0x019d('0x7')]=_0xd82df5[_0x019d('0x7')]||'';this[_0x019d('0x8')]=_0xd82df5[_0x019d('0x8')]||'';this[_0x019d('0x9')]=_0xd82df5[_0x019d('0x9')]||'';this[_0x019d('0xa')]=_0xd82df5[_0x019d('0xa')]||'';this['Configurations']=_0xd82df5[_0x019d('0xb')]||{};}module[_0x019d('0xc')]=DeskAccount; \ No newline at end of file +var _0xaee0=['type','Configurations','exports','username','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xaee0,0xf3));var _0x0aee=function(_0x496590,_0x3426e9){_0x496590=_0x496590-0x0;var _0x585ebc=_0xaee0[_0x496590];return _0x585ebc;};'use strict';function DeskAccount(_0x899fe8){this['id']=_0x899fe8['id']||0x0;this['name']=_0x899fe8['name']||'';this[_0x0aee('0x0')]=_0x899fe8['username']||'';this['remoteUri']=_0x899fe8['remoteUri']||'';this[_0x0aee('0x1')]=_0x899fe8[_0x0aee('0x1')]||'';this[_0x0aee('0x2')]=_0x899fe8['password']||'';this[_0x0aee('0x3')]=_0x899fe8[_0x0aee('0x3')]||'';this[_0x0aee('0x4')]=_0x899fe8['consumerSecret']||'';this[_0x0aee('0x5')]=_0x899fe8[_0x0aee('0x5')]||'';this[_0x0aee('0x6')]=_0x899fe8[_0x0aee('0x6')]||'';this[_0x0aee('0x7')]=_0x899fe8[_0x0aee('0x7')]||'';this['serverUrl']=_0x899fe8['serverUrl']||'';this[_0x0aee('0x8')]=_0x899fe8[_0x0aee('0x8')]||{};}module[_0x0aee('0x9')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 731a848..f9ee1b0 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 _0xd7c8=['clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId','clientId'];(function(_0x58e5f9,_0x263d3e){var _0x3e7a03=function(_0x46ae86){while(--_0x46ae86){_0x58e5f9['push'](_0x58e5f9['shift']());}};_0x3e7a03(++_0x263d3e);}(_0xd7c8,0x8a));var _0x8d7c=function(_0xe7ffe1,_0x925877){_0xe7ffe1=_0xe7ffe1-0x0;var _0x3a8773=_0xd7c8[_0xe7ffe1];return _0x3a8773;};'use strict';function Dynamics365Account(_0x27b4c8){this['id']=_0x27b4c8['id']||0x0;this[_0x8d7c('0x0')]=_0x27b4c8[_0x8d7c('0x0')]||'';this[_0x8d7c('0x1')]=_0x27b4c8[_0x8d7c('0x1')]||'';this[_0x8d7c('0x2')]=_0x27b4c8[_0x8d7c('0x2')]||'';this['remoteUri']=_0x27b4c8[_0x8d7c('0x3')]||'';this[_0x8d7c('0x4')]=_0x27b4c8[_0x8d7c('0x4')]||'';this[_0x8d7c('0x5')]=_0x27b4c8[_0x8d7c('0x5')]||'';this['clientSecret']=_0x27b4c8[_0x8d7c('0x6')]||{};this[_0x8d7c('0x7')]=_0x27b4c8['serverUrl']||'';this[_0x8d7c('0x8')]=_0x27b4c8[_0x8d7c('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x15e5=['clientSecret','Configurations','exports','username','password','remoteUri','tenantId','clientId'];(function(_0x5d90b8,_0x528b3a){var _0x5712b3=function(_0x478049){while(--_0x478049){_0x5d90b8['push'](_0x5d90b8['shift']());}};_0x5712b3(++_0x528b3a);}(_0x15e5,0x18b));var _0x515e=function(_0xa7f796,_0x449908){_0xa7f796=_0xa7f796-0x0;var _0x19ceb7=_0x15e5[_0xa7f796];return _0x19ceb7;};'use strict';function Dynamics365Account(_0x38f9b8){this['id']=_0x38f9b8['id']||0x0;this['name']=_0x38f9b8['name']||'';this[_0x515e('0x0')]=_0x38f9b8[_0x515e('0x0')]||'';this[_0x515e('0x1')]=_0x38f9b8[_0x515e('0x1')]||'';this[_0x515e('0x2')]=_0x38f9b8['remoteUri']||'';this[_0x515e('0x3')]=_0x38f9b8['tenantId']||'';this[_0x515e('0x4')]=_0x38f9b8['clientId']||'';this[_0x515e('0x5')]=_0x38f9b8[_0x515e('0x5')]||{};this['serverUrl']=_0x38f9b8['serverUrl']||'';this[_0x515e('0x6')]=_0x38f9b8[_0x515e('0x6')]||{};}module[_0x515e('0x7')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 98fd876..f1d1d78 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 _0x91a7=['faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway'];(function(_0x47c61c,_0x3f4408){var _0x1cb4be=function(_0x512d07){while(--_0x512d07){_0x47c61c['push'](_0x47c61c['shift']());}};_0x1cb4be(++_0x3f4408);}(_0x91a7,0xe7));var _0x791a=function(_0x1c5ade,_0x217132){_0x1c5ade=_0x1c5ade-0x0;var _0x3005e4=_0x91a7[_0x1c5ade];return _0x3005e4;};'use strict';function FaxAccount(_0x27c92e){this['id']=_0x27c92e['id']||0x0;this[_0x791a('0x0')]=_0x27c92e[_0x791a('0x0')]||'';this[_0x791a('0x1')]=_0x27c92e['description'];this[_0x791a('0x2')]=_0x27c92e['ecm'];this[_0x791a('0x3')]=_0x27c92e['headerinfo'];this['localstationid']=_0x27c92e[_0x791a('0x4')];this[_0x791a('0x5')]=_0x27c92e['minrate']||0x960;this[_0x791a('0x6')]=_0x27c92e['maxrate']||0x3840;this[_0x791a('0x7')]=_0x27c92e[_0x791a('0x7')]||'v17,v27,v29';this[_0x791a('0x8')]=_0x27c92e[_0x791a('0x8')]||'no';this[_0x791a('0x9')]=_0x27c92e[_0x791a('0x9')]||'no';this[_0x791a('0xa')]=_0x27c92e['t38timeout']||0x1388;this[_0x791a('0xb')]=_0x27c92e[_0x791a('0xb')]||'SIP';this[_0x791a('0xc')]=_0x27c92e[_0x791a('0xc')]?_0x27c92e[_0x791a('0xc')]:undefined;this[_0x791a('0xd')]=_0x27c92e[_0x791a('0xd')];this[_0x791a('0xe')]=_0x27c92e['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0xa478=['Trunk','ListId','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x25d92a,_0x15c760){var _0x1077c7=function(_0x40f11c){while(--_0x40f11c){_0x25d92a['push'](_0x25d92a['shift']());}};_0x1077c7(++_0x15c760);}(_0xa478,0x136));var _0x8a47=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xa478[_0x2b0a86];return _0x955940;};'use strict';function FaxAccount(_0x22222c){this['id']=_0x22222c['id']||0x0;this[_0x8a47('0x0')]=_0x22222c[_0x8a47('0x0')]||'';this[_0x8a47('0x1')]=_0x22222c[_0x8a47('0x1')];this[_0x8a47('0x2')]=_0x22222c[_0x8a47('0x2')];this[_0x8a47('0x3')]=_0x22222c[_0x8a47('0x3')];this[_0x8a47('0x4')]=_0x22222c[_0x8a47('0x4')];this[_0x8a47('0x5')]=_0x22222c['minrate']||0x960;this[_0x8a47('0x6')]=_0x22222c[_0x8a47('0x6')]||0x3840;this[_0x8a47('0x7')]=_0x22222c[_0x8a47('0x7')]||'v17,v27,v29';this[_0x8a47('0x8')]=_0x22222c['gateway']||'no';this[_0x8a47('0x9')]=_0x22222c[_0x8a47('0x9')]||'no';this[_0x8a47('0xa')]=_0x22222c['t38timeout']||0x1388;this[_0x8a47('0xb')]=_0x22222c[_0x8a47('0xb')]||'SIP';this[_0x8a47('0xc')]=_0x22222c['Trunk']?_0x22222c[_0x8a47('0xc')]:undefined;this[_0x8a47('0xd')]=_0x22222c[_0x8a47('0xd')];this['key']=_0x22222c['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f4e0a78..fb668f5 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 _0x2180=['serverUrl','name','username','apiKey','token'];(function(_0x189612,_0x3a868b){var _0x6d8789=function(_0x49dc88){while(--_0x49dc88){_0x189612['push'](_0x189612['shift']());}};_0x6d8789(++_0x3a868b);}(_0x2180,0xba));var _0x0218=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x2180[_0xc87d08];return _0x30a714;};'use strict';function FreshdeskAccount(_0x14c567){this['id']=_0x14c567['id']||0x0;this[_0x0218('0x0')]=_0x14c567[_0x0218('0x0')]||'';this[_0x0218('0x1')]=_0x14c567['username']||'';this[_0x0218('0x2')]=_0x14c567[_0x0218('0x3')]||'';this['remoteUri']=_0x14c567['remoteUri']||'';this[_0x0218('0x4')]=_0x14c567['serverUrl']||'';this['Configurations']=_0x14c567['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x760d=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x760d,0x8d));var _0xd760=function(_0x1cc18d,_0x4b77ce){_0x1cc18d=_0x1cc18d-0x0;var _0x1a08b4=_0x760d[_0x1cc18d];return _0x1a08b4;};'use strict';function FreshdeskAccount(_0x36f479){this['id']=_0x36f479['id']||0x0;this['name']=_0x36f479[_0xd760('0x0')]||'';this[_0xd760('0x1')]=_0x36f479[_0xd760('0x1')]||'';this['apiKey']=_0x36f479[_0xd760('0x2')]||'';this[_0xd760('0x3')]=_0x36f479['remoteUri']||'';this['serverUrl']=_0x36f479[_0xd760('0x4')]||'';this[_0xd760('0x5')]=_0x36f479[_0xd760('0x5')]||{};}module[_0xd760('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 2e48a3d..8342493 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 _0x6f55=['variables','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','mohtime'];(function(_0x3616bf,_0x5e81e2){var _0x518fd6=function(_0xba0811){while(--_0xba0811){_0x3616bf['push'](_0x3616bf['shift']());}};_0x518fd6(++_0x5e81e2);}(_0x6f55,0x112));var _0x56f5=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6f55[_0x13d07a];return _0x5ee0ee;};'use strict';function QueueReport(){this[_0x56f5('0x0')]=_0x56f5('0x1');this['uniqueid']='';this[_0x56f5('0x2')]='';this[_0x56f5('0x3')]='';this['queue']='';this[_0x56f5('0x4')]=null;this[_0x56f5('0x5')]=null;this['position']=0x1;this[_0x56f5('0x6')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x56f5('0x7')]=null;this[_0x56f5('0x8')]=![];this[_0x56f5('0x9')]=null;this[_0x56f5('0xa')]=0x1;this[_0x56f5('0xb')]='';this['connectedlinenum']='';this[_0x56f5('0xc')]='';this[_0x56f5('0xd')]='';this[_0x56f5('0xe')]='';this[_0x56f5('0xf')]='';this[_0x56f5('0x10')]='';this[_0x56f5('0x11')]=0x0;this['assigned']=![];this[_0x56f5('0x12')]='';this[_0x56f5('0x13')]=0x0;this[_0x56f5('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xb850=['mohtime','variables','exports','type','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','context','exten','priority','holdtime'];(function(_0x17b535,_0x546a62){var _0x24100e=function(_0x1df419){while(--_0x1df419){_0x17b535['push'](_0x17b535['shift']());}};_0x24100e(++_0x546a62);}(_0xb850,0xe7));var _0x0b85=function(_0x455e82,_0x522f6f){_0x455e82=_0x455e82-0x0;var _0x2d0520=_0xb850[_0x455e82];return _0x2d0520;};'use strict';function QueueReport(){this[_0x0b85('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x0b85('0x1')]='';this['queue']='';this[_0x0b85('0x2')]=null;this[_0x0b85('0x3')]=null;this['position']=0x1;this[_0x0b85('0x4')]=0x1;this['queuecallerabandon']=![];this[_0x0b85('0x5')]=null;this[_0x0b85('0x6')]=![];this[_0x0b85('0x7')]=null;this['queuecallerexit']=![];this[_0x0b85('0x8')]=null;this[_0x0b85('0x9')]=0x1;this['channel']='';this[_0x0b85('0xa')]='';this[_0x0b85('0xb')]='';this['accountcode']='';this[_0x0b85('0xc')]='';this[_0x0b85('0xd')]='';this[_0x0b85('0xe')]='';this[_0x0b85('0xf')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x0b85('0x10')]=0x0;this[_0x0b85('0x11')]={};}module[_0x0b85('0x12')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 876cf08..a4c72e5 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 _0x67a0=['remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x4655d1,_0x25f49e){var _0x50c6ee=function(_0x120660){while(--_0x120660){_0x4655d1['push'](_0x4655d1['shift']());}};_0x50c6ee(++_0x25f49e);}(_0x67a0,0x8a));var _0x067a=function(_0x4e65f9,_0x27570d){_0x4e65f9=_0x4e65f9-0x0;var _0x59444=_0x67a0[_0x4e65f9];return _0x59444;};'use strict';function SalesforceAccount(_0x316ac2){this['id']=_0x316ac2['id']||0x0;this[_0x067a('0x0')]=_0x316ac2[_0x067a('0x0')]||'';this[_0x067a('0x1')]=_0x316ac2[_0x067a('0x1')]||'';this[_0x067a('0x2')]=_0x316ac2[_0x067a('0x2')]||'';this['password']=_0x316ac2[_0x067a('0x3')]||'';this[_0x067a('0x4')]=_0x316ac2[_0x067a('0x4')]||'';this[_0x067a('0x5')]=_0x316ac2[_0x067a('0x5')]||'';this['securityToken']=_0x316ac2['securityToken']||'';this['type']=_0x316ac2[_0x067a('0x6')]||_0x067a('0x7');this[_0x067a('0x8')]=_0x316ac2['serverUrl']||'';this[_0x067a('0x9')]=_0x316ac2[_0x067a('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x5632=['clientId','clientSecret','securityToken','type','integrationTab','Configurations','name','username','remoteUri','password'];(function(_0x3ffffe,_0x33f2f7){var _0x57d219=function(_0x1b2bef){while(--_0x1b2bef){_0x3ffffe['push'](_0x3ffffe['shift']());}};_0x57d219(++_0x33f2f7);}(_0x5632,0xce));var _0x2563=function(_0x3cec95,_0x891f0f){_0x3cec95=_0x3cec95-0x0;var _0x5052ac=_0x5632[_0x3cec95];return _0x5052ac;};'use strict';function SalesforceAccount(_0xf60ad3){this['id']=_0xf60ad3['id']||0x0;this[_0x2563('0x0')]=_0xf60ad3[_0x2563('0x0')]||'';this[_0x2563('0x1')]=_0xf60ad3[_0x2563('0x1')]||'';this['remoteUri']=_0xf60ad3[_0x2563('0x2')]||'';this[_0x2563('0x3')]=_0xf60ad3[_0x2563('0x3')]||'';this[_0x2563('0x4')]=_0xf60ad3[_0x2563('0x4')]||'';this['clientSecret']=_0xf60ad3[_0x2563('0x5')]||'';this[_0x2563('0x6')]=_0xf60ad3[_0x2563('0x6')]||'';this[_0x2563('0x7')]=_0xf60ad3['type']||_0x2563('0x8');this['serverUrl']=_0xf60ad3['serverUrl']||'';this[_0x2563('0x9')]=_0xf60ad3[_0x2563('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 0009939..016c9ac 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 _0xd841=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xf00667,_0x369a42){var _0x4af45a=function(_0x24a070){while(--_0x24a070){_0xf00667['push'](_0xf00667['shift']());}};_0x4af45a(++_0x369a42);}(_0xd841,0x1b6));var _0x1d84=function(_0x510e92,_0x2fe5d5){_0x510e92=_0x510e92-0x0;var _0x311495=_0xd841[_0x510e92];return _0x311495;};'use strict';function ServicenowAccount(_0x438692){this['id']=_0x438692['id']||0x0;this[_0x1d84('0x0')]=_0x438692[_0x1d84('0x0')]||'';this['username']=_0x438692[_0x1d84('0x1')]||'';this[_0x1d84('0x2')]=_0x438692[_0x1d84('0x2')]||'';this[_0x1d84('0x3')]=_0x438692[_0x1d84('0x3')]||'';this['serverUrl']=_0x438692[_0x1d84('0x4')]||'';this[_0x1d84('0x5')]=_0x438692[_0x1d84('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x1190=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3ffcc0,_0x457002){var _0x25c15b=function(_0x4551f3){while(--_0x4551f3){_0x3ffcc0['push'](_0x3ffcc0['shift']());}};_0x25c15b(++_0x457002);}(_0x1190,0x157));var _0x0119=function(_0x204612,_0x5ec275){_0x204612=_0x204612-0x0;var _0x3943be=_0x1190[_0x204612];return _0x3943be;};'use strict';function ServicenowAccount(_0x54d439){this['id']=_0x54d439['id']||0x0;this[_0x0119('0x0')]=_0x54d439[_0x0119('0x0')]||'';this['username']=_0x54d439[_0x0119('0x1')]||'';this[_0x0119('0x2')]=_0x54d439[_0x0119('0x2')]||'';this[_0x0119('0x3')]=_0x54d439[_0x0119('0x3')]||'';this[_0x0119('0x4')]=_0x54d439['serverUrl']||'';this[_0x0119('0x5')]=_0x54d439['Configurations']||{};}module[_0x0119('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 c22475b..4ef9091 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 _0x4f4a=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4f4a,0xa4));var _0xa4f4=function(_0x24f311,_0x1e65e5){_0x24f311=_0x24f311-0x0;var _0x12299a=_0x4f4a[_0x24f311];return _0x12299a;};'use strict';function SugarcrmAccount(_0x164a4f){this['id']=_0x164a4f['id']||0x0;this[_0xa4f4('0x0')]=_0x164a4f['name']||'';this[_0xa4f4('0x1')]=_0x164a4f['username']||'';this['password']=_0x164a4f['password']||'';this[_0xa4f4('0x2')]=_0x164a4f['remoteUri']||'';this[_0xa4f4('0x3')]=_0x164a4f[_0xa4f4('0x3')]||'';this[_0xa4f4('0x4')]=_0x164a4f[_0xa4f4('0x4')]||{};}module[_0xa4f4('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x6ae7=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x162b4e,_0x555b63){var _0x257b28=function(_0x1baf7d){while(--_0x1baf7d){_0x162b4e['push'](_0x162b4e['shift']());}};_0x257b28(++_0x555b63);}(_0x6ae7,0xf8));var _0x76ae=function(_0x2957c6,_0x4dd434){_0x2957c6=_0x2957c6-0x0;var _0x463791=_0x6ae7[_0x2957c6];return _0x463791;};'use strict';function SugarcrmAccount(_0xc89436){this['id']=_0xc89436['id']||0x0;this['name']=_0xc89436[_0x76ae('0x0')]||'';this[_0x76ae('0x1')]=_0xc89436[_0x76ae('0x1')]||'';this['password']=_0xc89436[_0x76ae('0x2')]||'';this[_0x76ae('0x3')]=_0xc89436['remoteUri']||'';this[_0x76ae('0x4')]=_0xc89436['serverUrl']||'';this[_0x76ae('0x5')]=_0xc89436[_0x76ae('0x5')]||{};}module[_0x76ae('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 b363ed7..46df772 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 _0x588c=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x47b965,_0x3bf935){var _0x20417a=function(_0x148574){while(--_0x148574){_0x47b965['push'](_0x47b965['shift']());}};_0x20417a(++_0x3bf935);}(_0x588c,0x68));var _0xc588=function(_0x56bf09,_0x29f256){_0x56bf09=_0x56bf09-0x0;var _0x3ac81c=_0x588c[_0x56bf09];return _0x3ac81c;};'use strict';function Telephone(_0x6dbfab){this['id']=_0x6dbfab['id']||0x0;this['name']=_0x6dbfab[_0xc588('0x0')]||'';this[_0xc588('0x1')]=_0x6dbfab[_0xc588('0x1')]||'';this[_0xc588('0x2')]=_0xc588('0x3');this[_0xc588('0x4')]=0x0;this[_0xc588('0x5')]='unknown';this[_0xc588('0x6')]='';}module[_0xc588('0x7')]=Telephone; \ No newline at end of file +var _0x332c=['accountcode','unknown','stateTime','status','address','name'];(function(_0x5230ed,_0x2eb03e){var _0x43bb42=function(_0x407331){while(--_0x407331){_0x5230ed['push'](_0x5230ed['shift']());}};_0x43bb42(++_0x2eb03e);}(_0x332c,0xd1));var _0xc332=function(_0x5a4744,_0x2310bd){_0x5a4744=_0x5a4744-0x0;var _0x41f496=_0x332c[_0x5a4744];return _0x41f496;};'use strict';function Telephone(_0x4fcbe6){this['id']=_0x4fcbe6['id']||0x0;this[_0xc332('0x0')]=_0x4fcbe6['name']||'';this[_0xc332('0x1')]=_0x4fcbe6['accountcode']||'';this['state']=_0xc332('0x2');this[_0xc332('0x3')]=0x0;this[_0xc332('0x4')]=_0xc332('0x2');this[_0xc332('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index d07670e..fc8cecb 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 _0x1cc7=['name'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x1cc7,0x15a));var _0x71cc=function(_0x2a5eba,_0x47a133){_0x2a5eba=_0x2a5eba-0x0;var _0x10026c=_0x1cc7[_0x2a5eba];return _0x10026c;};'use strict';function template(_0x2bdc35){this['id']=_0x2bdc35['id']||0x0;this[_0x71cc('0x0')]=_0x2bdc35[_0x71cc('0x0')]||'';this['html']=_0x2bdc35['html']||'';}module['exports']=template; \ No newline at end of file +var _0xe13a=['name','html'];(function(_0x58f4de,_0x5350c4){var _0x53b579=function(_0x832c86){while(--_0x832c86){_0x58f4de['push'](_0x58f4de['shift']());}};_0x53b579(++_0x5350c4);}(_0xe13a,0x178));var _0xae13=function(_0x179273,_0x498eca){_0x179273=_0x179273-0x0;var _0x390f4a=_0xe13a[_0x179273];return _0x390f4a;};'use strict';function template(_0x15d8ff){this['id']=_0x15d8ff['id']||0x0;this[_0xae13('0x0')]=_0x15d8ff[_0xae13('0x0')]||'';this[_0xae13('0x1')]=_0x15d8ff[_0xae13('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 305e359..036dc52 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 _0x4b65=['AllConditions','AnyConditions','Actions','name','channel','status'];(function(_0x4cba55,_0x4b9acd){var _0x13728a=function(_0xbab46e){while(--_0xbab46e){_0x4cba55['push'](_0x4cba55['shift']());}};_0x13728a(++_0x4b9acd);}(_0x4b65,0x18f));var _0x54b6=function(_0x5b7395,_0x4bf86b){_0x5b7395=_0x5b7395-0x0;var _0x4ff9ad=_0x4b65[_0x5b7395];return _0x4ff9ad;};'use strict';function Trigger(_0xdb9e16){this['id']=_0xdb9e16['id']||0x0;this[_0x54b6('0x0')]=_0xdb9e16['name']||'';this['channel']=_0xdb9e16[_0x54b6('0x1')]||'voice';this[_0x54b6('0x2')]=_0xdb9e16[_0x54b6('0x2')]||![];this[_0x54b6('0x3')]=_0xdb9e16[_0x54b6('0x3')]||[];this[_0x54b6('0x4')]=_0xdb9e16[_0x54b6('0x4')]||[];this[_0x54b6('0x5')]=_0xdb9e16[_0x54b6('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xddbb=['name','channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xddbb,0xa0));var _0xbddb=function(_0x623e53,_0x9bd3e3){_0x623e53=_0x623e53-0x0;var _0x5b2f6a=_0xddbb[_0x623e53];return _0x5b2f6a;};'use strict';function Trigger(_0x29dffc){this['id']=_0x29dffc['id']||0x0;this[_0xbddb('0x0')]=_0x29dffc[_0xbddb('0x0')]||'';this[_0xbddb('0x1')]=_0x29dffc['channel']||_0xbddb('0x2');this[_0xbddb('0x3')]=_0x29dffc['status']||![];this[_0xbddb('0x4')]=_0x29dffc[_0xbddb('0x4')]||[];this[_0xbddb('0x5')]=_0x29dffc[_0xbddb('0x5')]||[];this[_0xbddb('0x6')]=_0x29dffc[_0xbddb('0x6')]||[];}module[_0xbddb('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a3ae21c..efe7f89 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 _0x8e6d=['indexOf','split','host','domain','domainport','refresh','address','exports','name','state','unknown','registry'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x8e6d,0x1c4));var _0xd8e6=function(_0x1ee2e2,_0x4ee61e){_0x1ee2e2=_0x1ee2e2-0x0;var _0x5ce5be=_0x8e6d[_0x1ee2e2];return _0x5ce5be;};'use strict';function Trunk(_0x630d26){this['id']=_0x630d26['id']||0x0;this['active']=_0x630d26['active']||![];this[_0xd8e6('0x0')]=_0x630d26[_0xd8e6('0x0')]||'';this[_0xd8e6('0x1')]=_0xd8e6('0x2');this['stateTime']=0x0;this['status']=_0xd8e6('0x2');this[_0xd8e6('0x3')]=_0x630d26[_0xd8e6('0x3')]&&_0x630d26[_0xd8e6('0x3')][_0xd8e6('0x4')](':')?_0x630d26[_0xd8e6('0x3')][_0xd8e6('0x5')](':')[0x0]:'';this[_0xd8e6('0x6')]='';this['port']='';this[_0xd8e6('0x7')]='';this[_0xd8e6('0x8')]='';this[_0xd8e6('0x9')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0xd8e6('0xa')]='';}module[_0xd8e6('0xb')]=Trunk; \ No newline at end of file +var _0x484a=['port','domain','domainport','refresh','stateRegistry','address','exports','active','stateTime','status','unknown','registry','split','host'];(function(_0x1af3ce,_0x20d958){var _0x5c1546=function(_0x596e9f){while(--_0x596e9f){_0x1af3ce['push'](_0x1af3ce['shift']());}};_0x5c1546(++_0x20d958);}(_0x484a,0x1c7));var _0xa484=function(_0x519e23,_0x37f954){_0x519e23=_0x519e23-0x0;var _0x3e5d45=_0x484a[_0x519e23];return _0x3e5d45;};'use strict';function Trunk(_0x336c54){this['id']=_0x336c54['id']||0x0;this[_0xa484('0x0')]=_0x336c54[_0xa484('0x0')]||![];this['name']=_0x336c54['name']||'';this['state']='unknown';this[_0xa484('0x1')]=0x0;this[_0xa484('0x2')]=_0xa484('0x3');this[_0xa484('0x4')]=_0x336c54['registry']&&_0x336c54[_0xa484('0x4')]['indexOf'](':')?_0x336c54[_0xa484('0x4')][_0xa484('0x5')](':')[0x0]:'';this[_0xa484('0x6')]='';this[_0xa484('0x7')]='';this[_0xa484('0x8')]='';this[_0xa484('0x9')]='';this[_0xa484('0xa')]='';this[_0xa484('0xb')]=_0xa484('0x3');this['registrationtime']='';this[_0xa484('0xc')]='';}module[_0xa484('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 1c8b2d3..fbe83a5 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 _0x9346=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x9346,0xf1));var _0x6934=function(_0xa46f8d,_0x4fa60d){_0xa46f8d=_0xa46f8d-0x0;var _0x5f1e51=_0x9346[_0xa46f8d];return _0x5f1e51;};'use strict';function voiceExtension(_0x32d757){this['id']=_0x32d757['id']||0x0;this[_0x6934('0x0')]=_0x32d757[_0x6934('0x0')]||'';this[_0x6934('0x1')]=_0x32d757[_0x6934('0x1')]||'none';this['mandatoryDisposition']=_0x32d757[_0x6934('0x2')]||![];}module[_0x6934('0x3')]=voiceExtension; \ No newline at end of file +var _0x2670=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x52a174,_0x4c53dc){var _0x29aad0=function(_0x327903){while(--_0x327903){_0x52a174['push'](_0x52a174['shift']());}};_0x29aad0(++_0x4c53dc);}(_0x2670,0xf5));var _0x0267=function(_0x450b00,_0x1cc659){_0x450b00=_0x450b00-0x0;var _0x219b54=_0x2670[_0x450b00];return _0x219b54;};'use strict';function voiceExtension(_0x268ab3){this['id']=_0x268ab3['id']||0x0;this[_0x0267('0x0')]=_0x268ab3['exten']||'';this[_0x0267('0x1')]=_0x268ab3['recordingFormat']||'none';this['mandatoryDisposition']=_0x268ab3[_0x0267('0x2')]||![];}module[_0x0267('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index a04fe22..60376c8 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 _0x42b2=['wav49','gsm','name','monitor_format','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','ringing','ringinuse','onhold','wav'];(function(_0x1b32b6,_0x2d38b2){var _0x1335b4=function(_0x1afcaf){while(--_0x1afcaf){_0x1b32b6['push'](_0x1b32b6['shift']());}};_0x1335b4(++_0x2d38b2);}(_0x42b2,0xc5));var _0x242b=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x42b2[_0x13ea00];return _0x1f7347;};'use strict';var statusDesc=[_0x242b('0x0'),'not_inuse','inuse',_0x242b('0x1'),_0x242b('0x2'),'unavailable',_0x242b('0x3'),_0x242b('0x4'),_0x242b('0x5')];var monitorFormat={'wav':_0x242b('0x6'),'wav49':_0x242b('0x7'),'gsm':_0x242b('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x5e213d){this['id']=_0x5e213d['id']||0x0;this[_0x242b('0x9')]=_0x5e213d[_0x242b('0x9')]||'';this[_0x242b('0xa')]=_0x5e213d[_0x242b('0xa')]||'';this['type']=_0x5e213d['type']||_0x242b('0xb');this['waiting']=0x0;this[_0x242b('0xc')]=0x0;this[_0x242b('0xd')]=0x0;this[_0x242b('0xe')]=0x0;this[_0x242b('0xf')]=0x0;this[_0x242b('0x10')]=0x0;this[_0x242b('0x11')]=0x0;this[_0x242b('0x12')]=0x0;this[_0x242b('0x13')]=0x0;this[_0x242b('0x14')]=0x0;this['available']=0x0;this[_0x242b('0x15')]=_0x5e213d['acw']||![];this[_0x242b('0x16')]=_0x5e213d['acwTimeout']||0xa;this['autopause']=_0x5e213d[_0x242b('0x17')]||'no';this[_0x242b('0x18')]=!![];this['message']='';this[_0x242b('0x19')]=0x0;this[_0x242b('0x1a')]=0x0;this[_0x242b('0x1b')]=_0x5e213d[_0x242b('0x1b')]||null;this[_0x242b('0x1c')]=_0x5e213d['dialGlobalInterval']?_0x5e213d[_0x242b('0x1c')]:null;this[_0x242b('0x1d')]=_0x5e213d[_0x242b('0x1d')];this[_0x242b('0x1e')]=_0x5e213d[_0x242b('0x1e')]||_0x242b('0x1f');this['dialLimitChannel']=_0x5e213d[_0x242b('0x20')]||0x0;this[_0x242b('0x21')]=_0x5e213d['dialLimitQueue']||0x0;this[_0x242b('0x22')]=_0x5e213d['dialPowerLevel']||0x1;this[_0x242b('0x23')]=_0x5e213d[_0x242b('0x23')]||'dropRate';this[_0x242b('0x24')]=_0x5e213d[_0x242b('0x24')]||0.03;this[_0x242b('0x25')]=_0x5e213d['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x5e213d['dialOriginateCallerIdName']||'anonymous';this[_0x242b('0x26')]=_0x5e213d[_0x242b('0x26')]||'anonymous';this[_0x242b('0x27')]=_0x5e213d[_0x242b('0x27')]||0x1e;this[_0x242b('0x28')]=_0x5e213d[_0x242b('0x28')]||'tTxX';this['dialQueueTimeout']=_0x5e213d[_0x242b('0x29')]||0x3;this[_0x242b('0x2a')]=_0x5e213d[_0x242b('0x2a')]||undefined;this[_0x242b('0x2b')]=_0x5e213d[_0x242b('0x2b')]||0x3;this[_0x242b('0x2c')]=_0x5e213d[_0x242b('0x2c')]||0x96;this[_0x242b('0x2d')]=_0x5e213d[_0x242b('0x2d')]||0x3;this[_0x242b('0x2e')]=_0x5e213d[_0x242b('0x2e')]||0x96;this['dialNoAnswerMaxRetry']=_0x5e213d[_0x242b('0x2f')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5e213d['dialNoAnswerRetryFrequency']||0x96;this[_0x242b('0x30')]=_0x5e213d[_0x242b('0x30')]||0x4;this[_0x242b('0x31')]=_0x5e213d[_0x242b('0x31')]?_0x5e213d['Trunk']:undefined;this[_0x242b('0x32')]=_0x5e213d[_0x242b('0x32')]?_0x5e213d[_0x242b('0x32')]:undefined;this['dialPrefix']=_0x5e213d[_0x242b('0x33')]||undefined;this[_0x242b('0x34')]=_0x5e213d[_0x242b('0x34')]?_0x5e213d[_0x242b('0x34')]:undefined;this[_0x242b('0x35')]=_0x5e213d[_0x242b('0x35')]||'DESC';this[_0x242b('0x36')]=_0x5e213d[_0x242b('0x36')]||undefined;this[_0x242b('0x37')]=_0x5e213d['dialCutDigit']||undefined;this['strategy']=strategy[_0x5e213d[_0x242b('0x38')]]||_0x242b('0x39');this[_0x242b('0x3a')]=!![];this[_0x242b('0x3b')]=_0x5e213d[_0x242b('0x3b')]||![];this['dialAMDInitialSilence']=_0x5e213d[_0x242b('0x3c')];this[_0x242b('0x3d')]=_0x5e213d[_0x242b('0x3d')];this[_0x242b('0x3e')]=_0x5e213d[_0x242b('0x3e')];this[_0x242b('0x3f')]=_0x5e213d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5e213d[_0x242b('0x40')];this[_0x242b('0x41')]=_0x5e213d[_0x242b('0x41')];this[_0x242b('0x42')]=_0x5e213d['dialAMDMaximumNumberOfWords'];this[_0x242b('0x43')]=_0x5e213d['dialAMDSilenceThreshold'];this[_0x242b('0x44')]=_0x5e213d[_0x242b('0x44')];this[_0x242b('0x45')]=0x0;this[_0x242b('0x46')]=0x0;this[_0x242b('0x47')]=_0x5e213d[_0x242b('0x47')];this['outboundAnswerCallsDay']=0x0;this[_0x242b('0x48')]=0x0;this[_0x242b('0x49')]=0x0;this[_0x242b('0x4a')]=0x0;this[_0x242b('0x4b')]=0x0;this[_0x242b('0x4c')]=0x0;this[_0x242b('0x4d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x242b('0x4e')]=0x0;this[_0x242b('0x4f')]=0x0;this[_0x242b('0x50')]=0x0;this[_0x242b('0x51')]=0x0;this[_0x242b('0x52')]=0x0;this[_0x242b('0x53')]=undefined;this[_0x242b('0x54')]=undefined;this[_0x242b('0x55')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x242b('0x56')]=0x0;this[_0x242b('0x57')]=0x0;this[_0x242b('0x58')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x242b('0x59')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x242b('0x5a')]=_0x5e213d['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x242b('0x5b')]=_0x5e213d['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x242b('0x5c')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x242b('0x5d')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x242b('0x5e')]=0x0;this[_0x242b('0x5f')]=_0x5e213d[_0x242b('0x5f')]||0x1e;this[_0x242b('0x60')]=_0x5e213d[_0x242b('0x60')]||![];this['dialQueueProject2']=_0x5e213d[_0x242b('0x61')]||undefined;this['dialAgiAfterHangupClient']=_0x5e213d['dialAgiAfterHangupClient']||![];this[_0x242b('0x62')]=_0x5e213d['dialAgiAfterHangupAgent']||![];this[_0x242b('0xa')]=monitorFormat[_0x5e213d['monitor_format']]?monitorFormat[_0x5e213d[_0x242b('0xa')]]:undefined;this[_0x242b('0x63')]=_0x5e213d[_0x242b('0x63')]||![];this[_0x242b('0x64')]=_0x5e213d[_0x242b('0x64')]?_0x5e213d['mandatoryDispositionPause']:undefined;}module[_0x242b('0x65')]=VoiceQueue; \ No newline at end of file +var _0x3968=['dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x2dbaf7,_0x1eee1a){var _0x2bac8c=function(_0x504328){while(--_0x504328){_0x2dbaf7['push'](_0x2dbaf7['shift']());}};_0x2bac8c(++_0x1eee1a);}(_0x3968,0x75));var _0x8396=function(_0x357320,_0xfdce1f){_0x357320=_0x357320-0x0;var _0x30237f=_0x3968[_0x357320];return _0x30237f;};'use strict';var statusDesc=[_0x8396('0x0'),_0x8396('0x1'),_0x8396('0x2'),'busy',_0x8396('0x3'),_0x8396('0x4'),_0x8396('0x5'),_0x8396('0x6'),_0x8396('0x7')];var monitorFormat={'wav':_0x8396('0x8'),'wav49':'wav49','gsm':_0x8396('0x9')};var strategy={'rrmemory':_0x8396('0xa'),'roundrobin':_0x8396('0xb')};function VoiceQueue(_0xc6706d){this['id']=_0xc6706d['id']||0x0;this[_0x8396('0xc')]=_0xc6706d[_0x8396('0xc')]||'';this['monitor_format']=_0xc6706d[_0x8396('0xd')]||'';this[_0x8396('0xe')]=_0xc6706d[_0x8396('0xe')]||_0x8396('0xf');this[_0x8396('0x10')]=0x0;this[_0x8396('0x11')]=0x0;this['total']=0x0;this[_0x8396('0x12')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x8396('0x13')]=0x0;this[_0x8396('0x14')]=0x0;this[_0x8396('0x15')]=0x0;this[_0x8396('0x16')]=0x0;this['acw']=_0xc6706d[_0x8396('0x17')]||![];this[_0x8396('0x18')]=_0xc6706d[_0x8396('0x18')]||0xa;this[_0x8396('0x19')]=_0xc6706d['autopause']||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x8396('0x1a')]=0x0;this[_0x8396('0x1b')]=0x0;this['dialTimezone']=_0xc6706d[_0x8396('0x1c')]||null;this['dialGlobalInterval']=_0xc6706d['dialGlobalInterval']?_0xc6706d[_0x8396('0x1d')]:null;this['dialActive']=_0xc6706d[_0x8396('0x1e')];this[_0x8396('0x1f')]=_0xc6706d['dialMethod']||_0x8396('0x20');this[_0x8396('0x21')]=_0xc6706d['dialLimitChannel']||0x0;this[_0x8396('0x22')]=_0xc6706d[_0x8396('0x22')]||0x0;this[_0x8396('0x23')]=_0xc6706d['dialPowerLevel']||0x1;this[_0x8396('0x24')]=_0xc6706d[_0x8396('0x24')]||_0x8396('0x25');this['dialPredictiveOptimizationPercentage']=_0xc6706d[_0x8396('0x26')]||0.03;this[_0x8396('0x27')]=_0xc6706d[_0x8396('0x27')]||0x258;this[_0x8396('0x28')]=_0xc6706d[_0x8396('0x28')]||_0x8396('0x29');this[_0x8396('0x2a')]=_0xc6706d[_0x8396('0x2a')]||'anonymous';this['dialOriginateTimeout']=_0xc6706d[_0x8396('0x2b')]||0x1e;this['dialQueueOptions']=_0xc6706d[_0x8396('0x2c')]||_0x8396('0x2d');this[_0x8396('0x2e')]=_0xc6706d[_0x8396('0x2e')]||0x3;this[_0x8396('0x2f')]=_0xc6706d[_0x8396('0x2f')]||undefined;this[_0x8396('0x30')]=_0xc6706d[_0x8396('0x30')]||0x3;this[_0x8396('0x31')]=_0xc6706d['dialCongestionRetryFrequency']||0x96;this[_0x8396('0x32')]=_0xc6706d['dialBusyMaxRetry']||0x3;this[_0x8396('0x33')]=_0xc6706d[_0x8396('0x33')]||0x96;this[_0x8396('0x34')]=_0xc6706d[_0x8396('0x34')]||0x3;this[_0x8396('0x35')]=_0xc6706d[_0x8396('0x35')]||0x96;this['dialGlobalMaxRetry']=_0xc6706d[_0x8396('0x36')]||0x4;this['Trunk']=_0xc6706d[_0x8396('0x37')]?_0xc6706d[_0x8396('0x37')]:undefined;this[_0x8396('0x38')]=_0xc6706d[_0x8396('0x38')]?_0xc6706d[_0x8396('0x38')]:undefined;this[_0x8396('0x39')]=_0xc6706d[_0x8396('0x39')]||undefined;this[_0x8396('0x3a')]=_0xc6706d[_0x8396('0x3a')]?_0xc6706d[_0x8396('0x3a')]:undefined;this[_0x8396('0x3b')]=_0xc6706d[_0x8396('0x3b')]||_0x8396('0x3c');this[_0x8396('0x3d')]=_0xc6706d[_0x8396('0x3d')]||undefined;this[_0x8396('0x3e')]=_0xc6706d[_0x8396('0x3e')]||undefined;this[_0x8396('0x3f')]=strategy[_0xc6706d[_0x8396('0x3f')]]||'rrmemory';this[_0x8396('0x40')]=!![];this[_0x8396('0x41')]=_0xc6706d[_0x8396('0x41')]||![];this['dialAMDInitialSilence']=_0xc6706d['dialAMDInitialSilence'];this[_0x8396('0x42')]=_0xc6706d[_0x8396('0x42')];this[_0x8396('0x43')]=_0xc6706d[_0x8396('0x43')];this[_0x8396('0x44')]=_0xc6706d[_0x8396('0x44')];this[_0x8396('0x45')]=_0xc6706d[_0x8396('0x45')];this[_0x8396('0x46')]=_0xc6706d[_0x8396('0x46')];this['dialAMDMaximumNumberOfWords']=_0xc6706d['dialAMDMaximumNumberOfWords'];this[_0x8396('0x47')]=_0xc6706d[_0x8396('0x47')];this[_0x8396('0x48')]=_0xc6706d[_0x8396('0x48')];this[_0x8396('0x49')]=0x0;this['pTalking']=0x0;this[_0x8396('0x4a')]=_0xc6706d['timeout'];this[_0x8396('0x4b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x8396('0x4c')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x8396('0x4d')]=0x0;this[_0x8396('0x4e')]=0x0;this[_0x8396('0x4f')]=0x0;this[_0x8396('0x50')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x8396('0x51')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x8396('0x52')]=0x0;this[_0x8396('0x53')]=undefined;this[_0x8396('0x54')]=undefined;this[_0x8396('0x55')]=undefined;this[_0x8396('0x56')]=1.05;this[_0x8396('0x57')]=0x0;this[_0x8396('0x58')]=0x0;this[_0x8396('0x59')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x8396('0x5a')]=0x0;this[_0x8396('0x5b')]=0x0;this[_0x8396('0x5c')]=0x0;this[_0x8396('0x5d')]=0x0;this[_0x8396('0x5e')]=_0xc6706d[_0x8396('0x5f')]||0x14;this['predictiveIntervalMinThreshold']=_0xc6706d[_0x8396('0x5f')]||0xa;this[_0x8396('0x60')]=0x0;this[_0x8396('0x61')]=0x0;this[_0x8396('0x62')]=0x1;this[_0x8396('0x63')]=0x0;this[_0x8396('0x64')]=0x0;this[_0x8396('0x65')]=0x0;this[_0x8396('0x66')]=0x0;this[_0x8396('0x67')]=_0xc6706d[_0x8396('0x67')]||0x1e;this[_0x8396('0x68')]=_0xc6706d[_0x8396('0x68')]||![];this['dialQueueProject2']=_0xc6706d[_0x8396('0x69')]||undefined;this['dialAgiAfterHangupClient']=_0xc6706d['dialAgiAfterHangupClient']||![];this[_0x8396('0x6a')]=_0xc6706d['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0xc6706d[_0x8396('0xd')]]?monitorFormat[_0xc6706d[_0x8396('0xd')]]:undefined;this[_0x8396('0x6b')]=_0xc6706d[_0x8396('0x6b')]||![];this['mandatoryDispositionPause']=_0xc6706d[_0x8396('0x6c')]?_0xc6706d[_0x8396('0x6c')]:undefined;}module[_0x8396('0x6d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index bdfe724..29d884f 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 _0x6bfa=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x12203a,_0x3838be){var _0x4aaf2b=function(_0x3a311b){while(--_0x3a311b){_0x12203a['push'](_0x12203a['shift']());}};_0x4aaf2b(++_0x3838be);}(_0x6bfa,0x125));var _0xa6bf=function(_0x5a8bf5,_0x2c816a){_0x5a8bf5=_0x5a8bf5-0x0;var _0x4e27c6=_0x6bfa[_0x5a8bf5];return _0x4e27c6;};'use strict';function VtigerAccount(_0x386b7b){this['id']=_0x386b7b['id']||0x0;this[_0xa6bf('0x0')]=_0x386b7b[_0xa6bf('0x0')]||'';this[_0xa6bf('0x1')]=_0x386b7b[_0xa6bf('0x1')]||'';this[_0xa6bf('0x2')]=_0x386b7b['accessKey']||'';this[_0xa6bf('0x3')]=_0x386b7b[_0xa6bf('0x3')]||'';this[_0xa6bf('0x4')]=_0x386b7b[_0xa6bf('0x4')]||'';this[_0xa6bf('0x5')]=_0x386b7b[_0xa6bf('0x5')]||{};}module[_0xa6bf('0x6')]=VtigerAccount; \ No newline at end of file +var _0xabde=['accessKey','serverUrl','Configurations','exports','name','username'];(function(_0x40d42e,_0x356026){var _0x4d830c=function(_0xd56353){while(--_0xd56353){_0x40d42e['push'](_0x40d42e['shift']());}};_0x4d830c(++_0x356026);}(_0xabde,0x8e));var _0xeabd=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xabde[_0x5a79e2];return _0x266c45;};'use strict';function VtigerAccount(_0x1557a5){this['id']=_0x1557a5['id']||0x0;this['name']=_0x1557a5[_0xeabd('0x0')]||'';this['username']=_0x1557a5[_0xeabd('0x1')]||'';this[_0xeabd('0x2')]=_0x1557a5[_0xeabd('0x2')]||'';this['remoteUri']=_0x1557a5['remoteUri']||'';this[_0xeabd('0x3')]=_0x1557a5[_0xeabd('0x3')]||'';this[_0xeabd('0x4')]=_0x1557a5[_0xeabd('0x4')]||{};}module[_0xeabd('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 80cb409..faa881c 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 _0x31dd=['remoteUri','authType','type','Configurations','exports','name','username','password','token'];(function(_0x3c7545,_0xc1b54f){var _0x295ae1=function(_0x27cb6a){while(--_0x27cb6a){_0x3c7545['push'](_0x3c7545['shift']());}};_0x295ae1(++_0xc1b54f);}(_0x31dd,0x10a));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';function ZendeskAccount(_0x4a7ce8){this['id']=_0x4a7ce8['id']||0x0;this[_0xd31d('0x0')]=_0x4a7ce8[_0xd31d('0x0')]||'';this[_0xd31d('0x1')]=_0x4a7ce8[_0xd31d('0x1')]||'';this[_0xd31d('0x2')]=_0x4a7ce8[_0xd31d('0x2')]||'';this[_0xd31d('0x3')]=_0x4a7ce8[_0xd31d('0x3')]||'';this[_0xd31d('0x4')]=_0x4a7ce8['remoteUri']||'';this[_0xd31d('0x5')]=_0x4a7ce8['authType']||'';this[_0xd31d('0x6')]=_0x4a7ce8[_0xd31d('0x6')]||'integrationTab';this['serverUrl']=_0x4a7ce8['serverUrl']||'';this[_0xd31d('0x7')]=_0x4a7ce8['Configurations']||{};}module[_0xd31d('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x2fe2=['password','token','authType','integrationTab','serverUrl','Configurations','name'];(function(_0x4b9aa9,_0x183f48){var _0x32a854=function(_0x124c35){while(--_0x124c35){_0x4b9aa9['push'](_0x4b9aa9['shift']());}};_0x32a854(++_0x183f48);}(_0x2fe2,0x92));var _0x22fe=function(_0x2985d5,_0x2d972c){_0x2985d5=_0x2985d5-0x0;var _0x1ba3e4=_0x2fe2[_0x2985d5];return _0x1ba3e4;};'use strict';function ZendeskAccount(_0x57d24a){this['id']=_0x57d24a['id']||0x0;this[_0x22fe('0x0')]=_0x57d24a[_0x22fe('0x0')]||'';this['username']=_0x57d24a['username']||'';this[_0x22fe('0x1')]=_0x57d24a['password']||'';this[_0x22fe('0x2')]=_0x57d24a[_0x22fe('0x2')]||'';this['remoteUri']=_0x57d24a['remoteUri']||'';this[_0x22fe('0x3')]=_0x57d24a[_0x22fe('0x3')]||'';this['type']=_0x57d24a['type']||_0x22fe('0x4');this[_0x22fe('0x5')]=_0x57d24a[_0x22fe('0x5')]||'';this[_0x22fe('0x6')]=_0x57d24a[_0x22fe('0x6')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b991678..e1d0597 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 _0x1967=['serverUrl','name','authToken','host','Configurations'];(function(_0x567791,_0x425699){var _0x335625=function(_0x24bf84){while(--_0x24bf84){_0x567791['push'](_0x567791['shift']());}};_0x335625(++_0x425699);}(_0x1967,0x173));var _0x7196=function(_0x3fff83,_0x1f55e7){_0x3fff83=_0x3fff83-0x0;var _0x4b518d=_0x1967[_0x3fff83];return _0x4b518d;};'use strict';function ZohoAccount(_0x193fee){this['id']=_0x193fee['id']||0x0;this[_0x7196('0x0')]=_0x193fee[_0x7196('0x0')]||'';this[_0x7196('0x1')]=_0x193fee[_0x7196('0x1')]||'';this[_0x7196('0x2')]=_0x193fee[_0x7196('0x2')]||'';this[_0x7196('0x3')]=_0x193fee[_0x7196('0x3')]||{};this[_0x7196('0x4')]=_0x193fee[_0x7196('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file +var _0x7096=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0x1a4cac,_0x116f47){var _0x142f2f=function(_0x4a1e47){while(--_0x4a1e47){_0x1a4cac['push'](_0x1a4cac['shift']());}};_0x142f2f(++_0x116f47);}(_0x7096,0x10c));var _0x6709=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7096[_0xbb091];return _0x467a04;};'use strict';function ZohoAccount(_0x442821){this['id']=_0x442821['id']||0x0;this[_0x6709('0x0')]=_0x442821['name']||'';this[_0x6709('0x1')]=_0x442821['authToken']||'';this[_0x6709('0x2')]=_0x442821[_0x6709('0x2')]||'';this[_0x6709('0x3')]=_0x442821[_0x6709('0x3')]||{};this[_0x6709('0x4')]=_0x442821[_0x6709('0x4')]||'';}module[_0x6709('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index eb72891..1e3dc75 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 _0x4606=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','isNil','Agent','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4606,0x19b));var _0x6460=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4606[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x6460('0x0'));var _=require(_0x6460('0x1'));var moment=require(_0x6460('0x2'));function checkNameSurname(_0x468768,_0x29f0b0,_0x3ffa6a){var _0x1a9b89='';if(!_['isNil'](_0x29f0b0)&&'string'===typeof _0x29f0b0){_0x1a9b89+=_0x29f0b0;}if(!_['isNil'](_0x3ffa6a)&&_0x6460('0x3')===typeof _0x3ffa6a){_0x1a9b89+='\x20'+_0x3ffa6a;}if(_0x1a9b89!==''){return _0x1a9b89;}return _0x468768;}function Action(_0x51752f,_0x36f3f4,_0x5fd5e1,_0x15b2a1,_0x11bb5c){this[_0x6460('0x4')]=_0x5fd5e1||undefined;this[_0x6460('0x5')]=_0x51752f['id'];this[_0x6460('0x6')]=_0x36f3f4[_0x6460('0x7')];this[_0x6460('0x8')]=_0x36f3f4[_0x6460('0x8')];this[_0x6460('0x9')]=_0x6460('0x6');this[_0x6460('0xa')]=![];this['membername']=_[_0x6460('0xb')](_0x51752f[_0x6460('0xc')])?undefined:_0x51752f['Agent'][_0x6460('0x7')];this[_0x6460('0xd')]=this[_0x6460('0xe')]?util[_0x6460('0xf')](_0x6460('0x10'),this[_0x6460('0xe')]):_0x15b2a1||undefined;this[_0x6460('0x11')]=checkNameSurname(_0x51752f['Contact'][_0x6460('0x12')],_0x51752f[_0x6460('0x13')][_0x6460('0x14')],_0x51752f[_0x6460('0x13')][_0x6460('0x15')]);this['active']=_0x51752f['active']||![];this[_0x6460('0x16')]=_0x51752f[_0x6460('0x13')][_0x6460('0x12')];this['scheduledat']=_0x51752f[_0x6460('0x17')];this[_0x6460('0x18')]=_0x51752f[_0x6460('0x18')]||0x0;this[_0x6460('0x19')]=_0x51752f[_0x6460('0x19')]||0x0;this[_0x6460('0x1a')]=_0x51752f[_0x6460('0x1a')]||0x0;this[_0x6460('0x1b')]=(_0x51752f[_0x6460('0x18')]||0x0)+(_0x51752f[_0x6460('0x19')]||0x0)+(_0x51752f['countnoanswerretry']||0x0);this['callback']=_0x51752f[_0x6460('0x1c')];this[_0x6460('0x1d')]=_0x51752f['callbackuniqueid'];this[_0x6460('0x1e')]=_0x51752f[_0x6460('0x1e')];this['recallme']=_0x51752f[_0x6460('0x1f')];this[_0x6460('0x20')]=_0x51752f[_0x6460('0x20')];this[_0x6460('0x21')]=_0x51752f['ListId'];this[_0x6460('0x22')]=_[_0x6460('0xb')](_0x51752f[_0x6460('0xc')])?_0x51752f[_0x6460('0x22')]:_0x51752f['Agent']['id'];this[_0x6460('0x23')]=_0x51752f[_0x6460('0x23')];this['originatecalleridnum']='';this[_0x6460('0x24')]='';}Action[_0x6460('0x25')]['getCaller']=function(){return util[_0x6460('0xf')](_0x6460('0x26'),this[_0x6460('0x11')],this['number']);};module[_0x6460('0x27')]=Action; \ No newline at end of file +var _0xab53=['util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number'];(function(_0x305999,_0x460549){var _0x5c4546=function(_0x3bf697){while(--_0x3bf697){_0x305999['push'](_0x305999['shift']());}};_0x5c4546(++_0x460549);}(_0xab53,0xbe));var _0x3ab5=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xab53[_0x349367];return _0x14179b;};'use strict';var util=require(_0x3ab5('0x0'));var _=require('lodash');var moment=require(_0x3ab5('0x1'));function checkNameSurname(_0x46c373,_0x55918b,_0x3b855d){var _0x50047c='';if(!_[_0x3ab5('0x2')](_0x55918b)&&'string'===typeof _0x55918b){_0x50047c+=_0x55918b;}if(!_[_0x3ab5('0x2')](_0x3b855d)&&_0x3ab5('0x3')===typeof _0x3b855d){_0x50047c+='\x20'+_0x3b855d;}if(_0x50047c!==''){return _0x50047c;}return _0x46c373;}function Action(_0x30e263,_0x200dad,_0x261f81,_0x481a06,_0x57a7fa){this[_0x3ab5('0x4')]=_0x261f81||undefined;this['idContact']=_0x30e263['id'];this[_0x3ab5('0x5')]=_0x200dad[_0x3ab5('0x6')];this[_0x3ab5('0x7')]=_0x200dad[_0x3ab5('0x7')];this[_0x3ab5('0x8')]=_0x3ab5('0x5');this[_0x3ab5('0x9')]=![];this[_0x3ab5('0xa')]=_[_0x3ab5('0x2')](_0x30e263[_0x3ab5('0xb')])?undefined:_0x30e263[_0x3ab5('0xb')]['name'];this[_0x3ab5('0xc')]=this[_0x3ab5('0xa')]?util['format']('SIP/%s',this['membername']):_0x481a06||undefined;this[_0x3ab5('0xd')]=checkNameSurname(_0x30e263[_0x3ab5('0xe')][_0x3ab5('0xf')],_0x30e263[_0x3ab5('0xe')][_0x3ab5('0x10')],_0x30e263[_0x3ab5('0xe')][_0x3ab5('0x11')]);this[_0x3ab5('0x12')]=_0x30e263[_0x3ab5('0x12')]||![];this[_0x3ab5('0x13')]=_0x30e263['Contact']['phone'];this[_0x3ab5('0x14')]=_0x30e263[_0x3ab5('0x14')];this[_0x3ab5('0x15')]=_0x30e263[_0x3ab5('0x15')]||0x0;this[_0x3ab5('0x16')]=_0x30e263[_0x3ab5('0x16')]||0x0;this['countnoanswerretry']=_0x30e263[_0x3ab5('0x17')]||0x0;this[_0x3ab5('0x18')]=(_0x30e263[_0x3ab5('0x15')]||0x0)+(_0x30e263[_0x3ab5('0x16')]||0x0)+(_0x30e263[_0x3ab5('0x17')]||0x0);this[_0x3ab5('0x19')]=_0x30e263[_0x3ab5('0x19')];this[_0x3ab5('0x1a')]=_0x30e263[_0x3ab5('0x1a')];this[_0x3ab5('0x1b')]=_0x30e263[_0x3ab5('0x1b')];this['recallme']=_0x30e263['recallme'];this[_0x3ab5('0x1c')]=_0x30e263[_0x3ab5('0x1c')];this['ListId']=_0x30e263[_0x3ab5('0x1d')];this[_0x3ab5('0x1e')]=_['isNil'](_0x30e263['Agent'])?_0x30e263[_0x3ab5('0x1e')]:_0x30e263[_0x3ab5('0xb')]['id'];this[_0x3ab5('0x1f')]=_0x30e263['VoiceQueueId'];this[_0x3ab5('0x20')]='';this[_0x3ab5('0x21')]='';}Action[_0x3ab5('0x22')][_0x3ab5('0x23')]=function(){return util['format'](_0x3ab5('0x24'),this[_0x3ab5('0xd')],this[_0x3ab5('0x25')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 498c201..3826e2a 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 _0x9baf=['clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','length','scheduledat','dialRecallMeTimeout','run','then','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','activeContact','NOANSWER','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','unlockAgent','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','Global','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','disableContact','idContact','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','phone','substring','dialCutDigit','SIP/%s/%s%s','trim','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','Action','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','variables','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','preview','setMessage','recallMe'];(function(_0x83d0ad,_0x36efe7){var _0x5077aa=function(_0x240784){while(--_0x240784){_0x83d0ad['push'](_0x83d0ad['shift']());}};_0x5077aa(++_0x36efe7);}(_0x9baf,0xc9));var _0xf9ba=function(_0x55e3c3,_0x4a5a4e){_0x55e3c3=_0x55e3c3-0x0;var _0x4258ee=_0x9baf[_0x55e3c3];return _0x4258ee;};'use strict';var util=require(_0xf9ba('0x0'));var _=require(_0xf9ba('0x1'));var BPromise=require('bluebird');var uuid=require(_0xf9ba('0x2'));var moment=require('moment');var md5=require(_0xf9ba('0x3'));var Redis=require(_0xf9ba('0x4'));var config=require(_0xf9ba('0x5'));var logger=require(_0xf9ba('0x6'))('preview');var loggerAction=require('../../../config/logger')(_0xf9ba('0x7'));var ami=require(_0xf9ba('0x8'));var rpcDb=require(_0xf9ba('0x9'));var Action=require('./action');var ut=require('./util/util');config['redis']=_[_0xf9ba('0xa')](config[_0xf9ba('0xb')],{'host':_0xf9ba('0xc'),'port':0x18eb});var io=require(_0xf9ba('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xf9ba('0xe')]=function(_0x53a61b){this[_0xf9ba('0xf')]=this[_0xf9ba('0xf')]?this[_0xf9ba('0xf')][_0xf9ba('0x10')](_0x53a61b):_0x53a61b();};function Preview(_0xd88cc5){this['sequence']=new Sequence();this[_0xf9ba('0x11')]=_0xd88cc5[_0xf9ba('0x12')];this['trunks']=_0xd88cc5[_0xf9ba('0x13')];this[_0xf9ba('0x14')]={};this[_0xf9ba('0x15')]=_0xd88cc5[_0xf9ba('0x15')];this[_0xf9ba('0x16')]=0x0;ami['on'](_0xf9ba('0x17'),this[_0xf9ba('0x18')][_0xf9ba('0x19')](this));ami['on'](_0xf9ba('0x1a'),this[_0xf9ba('0x1b')][_0xf9ba('0x19')](this));ami['on']('hanguprequest',this[_0xf9ba('0x1c')][_0xf9ba('0x19')](this));ami['on'](_0xf9ba('0x1d'),this['syncDialEnd'][_0xf9ba('0x19')](this));ami['on'](_0xf9ba('0x1e'),this[_0xf9ba('0x1f')][_0xf9ba('0x19')](this));ami['on']('varset',this[_0xf9ba('0x20')]['bind'](this));ami['on'](_0xf9ba('0x21'),this[_0xf9ba('0x22')]['bind'](this));ami['on'](_0xf9ba('0x23'),this[_0xf9ba('0x24')][_0xf9ba('0x19')](this));this[_0xf9ba('0x25')](this[_0xf9ba('0x11')]);}function emit(_0x1ad3a2,_0x176880,_0x55d54c){io['to'](_0x1ad3a2)[_0xf9ba('0x26')](_0x176880,_0x55d54c);}function emitCampaignPreview(_0x31274d){if(_0x31274d[_0xf9ba('0x27')]==='outbound'){var _0x3962a9={'id':_0x31274d['id'],'name':_0x31274d[_0xf9ba('0x28')],'strategy':_0x31274d[_0xf9ba('0x29')],'answered':_0x31274d[_0xf9ba('0x2a')],'available':_0x31274d[_0xf9ba('0x2b')],'loggedIn':_0x31274d[_0xf9ba('0x2c')],'pTalking':_0x31274d[_0xf9ba('0x2d')],'sumBillable':_0x31274d[_0xf9ba('0x2e')],'sumDuration':_0x31274d[_0xf9ba('0x2f')],'sumHoldTime':_0x31274d['sumHoldTime']||0x0,'talking':_0x31274d[_0xf9ba('0x30')],'total':_0x31274d['total'],'type':_0x31274d[_0xf9ba('0x27')],'unmanaged':_0x31274d[_0xf9ba('0x31')],'abandoned':_0x31274d[_0xf9ba('0x32')],'waiting':_0x31274d[_0xf9ba('0x33')],'loggedInDb':_0x31274d[_0xf9ba('0x34')],'dialActive':_0x31274d[_0xf9ba('0x35')],'dialMethod':_0x31274d['dialMethod'],'dialOriginateCallerIdName':_0x31274d[_0xf9ba('0x36')],'dialOriginateCallerIdNumber':_0x31274d[_0xf9ba('0x37')],'dialOriginateTimeout':_0x31274d[_0xf9ba('0x38')],'dialPrefix':_0x31274d[_0xf9ba('0x39')],'outboundAnswerAgiCallsDay':_0x31274d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x31274d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x31274d[_0xf9ba('0x3a')],'outboundBusyCallsDay':_0x31274d[_0xf9ba('0x3b')],'outboundCongestionCallsDay':_0x31274d[_0xf9ba('0x3c')],'outboundDropCallsDayACS':_0x31274d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x31274d[_0xf9ba('0x3d')],'outboundDropCallsDayTimeout':_0x31274d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x31274d[_0xf9ba('0x3e')],'outboundNoSuchCallsDay':_0x31274d[_0xf9ba('0x3f')],'outboundOriginateFailureCallsDay':_0x31274d[_0xf9ba('0x40')],'outboundReCallsDay':_0x31274d[_0xf9ba('0x41')],'outboundRejectCallsDay':_0x31274d[_0xf9ba('0x42')],'outboundUnknownCallsDay':_0x31274d[_0xf9ba('0x43')],'predictiveIntervalAnsweredCalls':_0x31274d[_0xf9ba('0x44')],'predictiveIntervalAvgHoldtime':_0x31274d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x31274d[_0xf9ba('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x31274d[_0xf9ba('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x31274d[_0xf9ba('0x47')],'predictiveIntervalErlangCalls':_0x31274d[_0xf9ba('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x31274d[_0xf9ba('0x49')],'predictiveIntervalHitRate':_0x31274d[_0xf9ba('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x31274d[_0xf9ba('0x4b')],'predictiveIntervalPauses':_0x31274d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x31274d[_0xf9ba('0x4c')],'predictiveIntervalTotalCalls':_0x31274d[_0xf9ba('0x4d')],'message':_0x31274d[_0xf9ba('0x4e')],'originated':_0x31274d[_0xf9ba('0x4f')],'erlangCalls':_0x31274d[_0xf9ba('0x50')],'erlangCallToSecond':_0x31274d['erlangCallToSecond'],'erlangAbandonmentRate':_0x31274d['erlangAbandonmentRate'],'erlangBusyFactor':_0x31274d['erlangBusyFactor'],'startPredictive':_0x31274d['startPredictive'],'startProgressive':_0x31274d[_0xf9ba('0x51')]};if(_0x31274d[_0xf9ba('0x52')]){_0x3962a9[_0xf9ba('0x52')]={'id':_0x31274d['Trunk']['id'],'name':_0x31274d[_0xf9ba('0x52')][_0xf9ba('0x28')],'active':_0x31274d[_0xf9ba('0x52')][_0xf9ba('0x53')],'callerid':_0x31274d[_0xf9ba('0x52')][_0xf9ba('0x54')]};}if(_0x31274d[_0xf9ba('0x55')]){_0x3962a9['Interval']={'id':_0x31274d[_0xf9ba('0x55')]['id'],'name':_0x31274d[_0xf9ba('0x55')]['name']};}var _0x56e094=md5(JSON[_0xf9ba('0x56')](_0x3962a9));if(_0x31274d['md5']!==_0x56e094){_0x31274d[_0xf9ba('0x3')]=_0x56e094;emit(util[_0xf9ba('0x57')](_0xf9ba('0x58'),_0x3962a9['name']),'voice_queue:save',_0x3962a9);}}}function emitVoiceQueueChannelRemove(_0x2435b5){emit(util[_0xf9ba('0x57')](_0xf9ba('0x58'),_0x2435b5[_0xf9ba('0x28')]),_0xf9ba('0x59'),_0x2435b5);}function notSendMessagesQueue(_0xf95381){if(_0xf95381[_0xf9ba('0x5a')]){if(_0xf95381['originated']===0x0&&_0xf95381[_0xf9ba('0x2d')]===0x0){_0xf95381['sendMessageOneNotActive']=![];_0xf95381[_0xf9ba('0x2b')]=0x0;_0xf95381[_0xf9ba('0x5b')]=0x0;_0xf95381[_0xf9ba('0x4e')]=_0xf9ba('0x5c');ut[_0xf9ba('0x5d')](_0xf9ba('0x5e'),_0xf95381[_0xf9ba('0x28')]+_0xf9ba('0x5f'));}else{_0xf95381[_0xf9ba('0x4e')]=_0xf9ba('0x60');ut['logger'](_0xf9ba('0x5e'),_0xf95381[_0xf9ba('0x28')]+_0xf9ba('0x61'));}emitCampaignPreview(_0xf95381);}}Preview[_0xf9ba('0x62')]['loopCampaigns']=function(){var _0x365b13=this;setInterval(function(){_0x365b13[_0xf9ba('0x63')]();},0x7cf);};Preview[_0xf9ba('0x62')]['syncCampaigns']=function(){var _0x1396d2=this[_0xf9ba('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x3a7fbb in _0x1396d2){if(_0x1396d2[_0xf9ba('0x64')](_0x3a7fbb)&&(_0x1396d2[_0x3a7fbb]['dialMethod']==='preview'||_0x1396d2[_0x3a7fbb][_0xf9ba('0x65')]===_0xf9ba('0x66'))&&_0x1396d2[_0x3a7fbb][_0xf9ba('0x27')]==='outbound'){if(this[_0xf9ba('0x16')]>0x7){this[_0xf9ba('0x16')]=0x0;this[_0xf9ba('0x67')]();}}if(_0x1396d2[_0xf9ba('0x64')](_0x3a7fbb)&&_0x1396d2[_0x3a7fbb][_0xf9ba('0x65')]===_0xf9ba('0x68')&&_0x1396d2[_0x3a7fbb]['type']==='outbound'){if(_0x1396d2[_0x3a7fbb][_0xf9ba('0x35')]){this[_0xf9ba('0x69')](_0x1396d2[_0x3a7fbb]);this[_0xf9ba('0x6a')](_0x1396d2[_0x3a7fbb]);}else{notSendMessagesQueue(_0x1396d2[_0x3a7fbb]);}}}};Preview['prototype'][_0xf9ba('0x6b')]=function(_0x85e66c){var _0x5802ee=this;this[_0xf9ba('0x6c')]['enqueue'](function(){if(!_[_0xf9ba('0x6d')](_0x5802ee[_0xf9ba('0x14')][_0x85e66c])){loggerAction[_0xf9ba('0x6e')](_0xf9ba('0x6f'),_0x85e66c,_0xf9ba('0x70'),_0x5802ee['actions'][_0x85e66c][_0xf9ba('0x71')],_0xf9ba('0x72'),JSON[_0xf9ba('0x56')](_0x5802ee[_0xf9ba('0x11')][_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x71')]][_0xf9ba('0x4f')]),_0xf9ba('0x73'),JSON[_0xf9ba('0x56')](_0x5802ee['campaignsPreview'][_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x71')]][_0xf9ba('0x2d')]),JSON[_0xf9ba('0x56')](_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x74')]),JSON[_0xf9ba('0x56')](_[_0xf9ba('0x75')](_0x5802ee[_0xf9ba('0x14')][_0x85e66c],[_0xf9ba('0x76'),_0xf9ba('0x77'),_0xf9ba('0x78'),_0xf9ba('0x79')])));return ami['Action']({'action':_0xf9ba('0x7a'),'channel':_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x7b')]})[_0xf9ba('0x7c')](function(_0x1f2d0c){if(_0x1f2d0c['message']===_0xf9ba('0x7d')){setTimeout(function(){if(_0x5802ee[_0xf9ba('0x14')][_0x85e66c]){ut['updateOriginated'](_0x5802ee[_0xf9ba('0x11')][_0x5802ee[_0xf9ba('0x14')][_0x85e66c]['queue']],_0xf9ba('0x7e'));if(_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x74')]===!![]){ut[_0xf9ba('0x7f')](_0x5802ee[_0xf9ba('0x11')][_0x5802ee[_0xf9ba('0x14')][_0x85e66c]['queue']],_0xf9ba('0x7e'));ut[_0xf9ba('0x80')](_0xf9ba('0x81')+_0x85e66c,_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x71')]);}ut[_0xf9ba('0x80')](_0xf9ba('0x82')+_0x85e66c,_0x5802ee[_0xf9ba('0x14')][_0x85e66c][_0xf9ba('0x71')]);delete _0x5802ee[_0xf9ba('0x14')][_0x85e66c];}},0x2328);}});}});};Preview[_0xf9ba('0x62')][_0xf9ba('0x67')]=function(){var _0xa6bf19=this;loggerAction['info']('[action]',_[_0xf9ba('0x83')](this[_0xf9ba('0x14')]));for(var _0x3f4f79 in this[_0xf9ba('0x14')]){if(_0xa6bf19[_0xf9ba('0x14')][_0xf9ba('0x64')](_0x3f4f79)){_0xa6bf19[_0xf9ba('0x6b')](_0x3f4f79);}}};Preview[_0xf9ba('0x62')][_0xf9ba('0x6a')]=function(_0x1b2412){var _0x134e48=this;rpcDb[_0xf9ba('0x84')](_0x1b2412['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x3a37e1){if(!_[_0xf9ba('0x6d')](_0x3a37e1)){for(var _0x1a75aa=0x0;_0x1a75aa<_0x3a37e1[_0xf9ba('0x85')];_0x1a75aa+=0x1){if(ut['getDiff'](_0x3a37e1[_0x1a75aa][_0xf9ba('0x86')])<_0x1b2412[_0xf9ba('0x87')]*0x3c){_0x134e48[_0xf9ba('0x88')](_0x3a37e1[_0x1a75aa]['id'])[_0xf9ba('0x89')](ut[_0xf9ba('0x8a')](_0xf9ba('0x8b')))[_0xf9ba('0x7c')](ut[_0xf9ba('0x8a')](_0xf9ba('0x8b')));}else{var _0x457053=new Action(_0x3a37e1[_0x1a75aa],_0x1b2412);_0x457053[_0xf9ba('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1b2412[_0xf9ba('0x41')]+=0x1;ut[_0xf9ba('0x8d')](_0x457053,0x17,_0xf9ba('0x8e'));if(_0x1b2412[_0xf9ba('0x8f')]){rpcDb['rescheduleContactInQueue'](ut[_0xf9ba('0x90')](_0x3a37e1[_0x1a75aa]));rpcDb[_0xf9ba('0x91')](_0x457053,_0xf9ba('0x92'));}else{ut['logCustomer'](_0x457053,0x16,_0xf9ba('0x93'));rpcDb[_0xf9ba('0x91')](_0x457053,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x457053,_0xf9ba('0x94'));}}}}})[_0xf9ba('0x7c')](ut[_0xf9ba('0x8a')]('[getContactRecallMe]'));};Preview[_0xf9ba('0x62')][_0xf9ba('0x69')]=function(_0x4752a1){_0x4752a1['sendMessageOneNotActive']=!![];if(ut[_0xf9ba('0x95')](_0x4752a1[_0xf9ba('0x2c')])){_0x4752a1[_0xf9ba('0x4e')]=_0xf9ba('0x96');}else if(!ut[_0xf9ba('0x97')](_0x4752a1[_0xf9ba('0x35')])){_0x4752a1[_0xf9ba('0x4e')]='NOT_ACTIVE';}else if(!this[_0xf9ba('0x98')](_0x4752a1[_0xf9ba('0x52')])){if(!this[_0xf9ba('0x98')](_0x4752a1[_0xf9ba('0x99')])){_0x4752a1[_0xf9ba('0x4e')]=_0xf9ba('0x9a');}else{_0x4752a1['message']=_0xf9ba('0x9b');}}else{_0x4752a1[_0xf9ba('0x4e')]=_0xf9ba('0x9b');}emitCampaignPreview(_0x4752a1);};Preview[_0xf9ba('0x62')]['callProgressDetectingCustomer']=function(_0x3c9924,_0x4e240d,_0x3c944e){var _0x49347a=this;var _0x146c62=this[_0xf9ba('0x14')][_0x4e240d];var _0x3847ea=this[_0xf9ba('0x11')][_0x146c62[_0xf9ba('0x71')]];var _0x44d700;if(_0x3847ea){switch(_0x3c944e){case'1':_0x3847ea[_0xf9ba('0x3f')]+=0x1;_0x146c62[_0xf9ba('0x9c')]=ut[_0xf9ba('0x9d')](_0x146c62);ut['logCustomer'](_0x146c62,0x0,_0xf9ba('0x9e'));rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0x9f'));if(ut[_0xf9ba('0x9d')](_0x146c62)>=_0x3847ea[_0xf9ba('0xa0')]){_0x44d700=ut[_0xf9ba('0xa1')](_0x146c62,0xf,'Global');rpcDb[_0xf9ba('0xa2')](_0x44d700,_0xf9ba('0xa3'));}else{rpcDb[_0xf9ba('0xa2')](_0x146c62,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this['actions'][_0x3c9924[_0xf9ba('0xa4')]];break;case _0xf9ba('0xa5'):var _0x26d068=moment()['format'](_0xf9ba('0xa6'));_0x146c62[_0xf9ba('0xa7')]=_0x26d068;_0x146c62[_0xf9ba('0xa8')]=_0x26d068;_0x146c62[_0xf9ba('0x74')]=!![];_0x3847ea[_0xf9ba('0x2d')]+=0x1;logger['info'](_0xf9ba('0xa9'),_0x146c62['uniqueid'],_0xf9ba('0xaa'),_0x3847ea['name'],_0xf9ba('0x73'),_0x3847ea[_0xf9ba('0x2d')]);ami['emit']('custom:agentconnect',ut[_0xf9ba('0xab')](_0x146c62,_0xf9ba('0xac')));if(_0x3847ea['acw']){ami[_0xf9ba('0x26')](_0xf9ba('0xad'),ut[_0xf9ba('0xae')](_0x146c62));}break;case'16':ami[_0xf9ba('0x26')](_0xf9ba('0xaf'),ut['buildObj'](_0x146c62,'complete'));emitVoiceQueueChannelRemove(ut[_0xf9ba('0xab')](_0x146c62,_0xf9ba('0xb0')));_0x3847ea['outboundAnswerCallsDay']+=0x1;_0x3847ea[_0xf9ba('0xb1')]+=0x1;_0x3847ea['answered']+=0x1;ut['decrementTalkink'](_0x3847ea,_0xf9ba('0xb2'));_0x146c62['countglobal']=ut[_0xf9ba('0x9d')](_0x146c62);ut[_0xf9ba('0x8d')](_0x146c62,0x4,_0xf9ba('0xb3'));rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xb4'));rpcDb['createCustomerFinal'](_0x146c62,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf9ba('0xb5')](_0x146c62);_0x3847ea[_0xf9ba('0x2f')]+=_0x146c62[_0xf9ba('0xb6')];_0x3847ea[_0xf9ba('0x2e')]+=_0x146c62[_0xf9ba('0xb6')];logger[_0xf9ba('0x6e')](_0xf9ba('0xb7'),_0x146c62[_0xf9ba('0xb8')],'\x20Queue',_0x3847ea[_0xf9ba('0x28')],_0xf9ba('0x73'),_0x3847ea[_0xf9ba('0x2d')]);delete this[_0xf9ba('0x14')][_0x3c9924[_0xf9ba('0xa4')]];break;case _0xf9ba('0xb9'):_0x3847ea[_0xf9ba('0x3b')]+=0x1;_0x146c62[_0xf9ba('0xba')]+=0x1;_0x146c62[_0xf9ba('0x9c')]=ut['totalGlobal'](_0x146c62);ut[_0xf9ba('0x8d')](_0x146c62,0x5,_0xf9ba('0xbb'));rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xbc'));if(ut[_0xf9ba('0x9d')](_0x146c62)>=_0x3847ea[_0xf9ba('0xa0')]){_0x44d700=ut[_0xf9ba('0xa1')](_0x146c62,0xf,'Global');rpcDb['createCustomerFinal'](_0x44d700,_0xf9ba('0xbd'));}else{if(_0x146c62[_0xf9ba('0xba')]>=_0x3847ea[_0xf9ba('0xbe')]){rpcDb['createCustomerFinal'](_0x146c62,_0xf9ba('0xbc'));}else{rpcDb['rescheduleContact'](ut[_0xf9ba('0xbf')](_0x146c62,_0xf9ba('0xba'),_0x3847ea['dialBusyRetryFrequency']),_0x146c62['unlockAgent'],_0x146c62[_0xf9ba('0xc0')]);}}break;case _0xf9ba('0xc1'):_0x3847ea['outboundNoAnswerCallsDay']+=0x1;_0x146c62['countnoanswerretry']+=0x1;_0x146c62['countglobal']=ut['totalGlobal'](_0x146c62);ut['logCustomer'](_0x146c62,0x3,'NoAnswer');rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xc2'));if(ut[_0xf9ba('0x9d')](_0x146c62)>=_0x3847ea['dialGlobalMaxRetry']){_0x44d700=ut['cloneAction'](_0x146c62,0xf,'Global');rpcDb[_0xf9ba('0xa2')](_0x44d700,_0xf9ba('0xc3'));}else{if(_0x146c62[_0xf9ba('0xc4')]>=_0x3847ea[_0xf9ba('0xc5')]){rpcDb[_0xf9ba('0xa2')](_0x146c62,_0xf9ba('0xc2'));}else{rpcDb[_0xf9ba('0xc6')](ut[_0xf9ba('0xbf')](_0x146c62,_0xf9ba('0xc4'),_0x3847ea[_0xf9ba('0xc7')]),_0x146c62[_0xf9ba('0xc8')],_0x146c62['activeContact']);}}break;case'CONGESTION':_0x3847ea[_0xf9ba('0x3c')]+=0x1;_0x146c62[_0xf9ba('0xc9')]+=0x1;_0x146c62[_0xf9ba('0x9c')]=ut[_0xf9ba('0x9d')](_0x146c62);ut[_0xf9ba('0x8d')](_0x146c62,0x8,'Congestion');rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xca'));if(ut['totalGlobal'](_0x146c62)>=_0x3847ea[_0xf9ba('0xa0')]){_0x44d700=ut[_0xf9ba('0xa1')](_0x146c62,0xf,_0xf9ba('0xcb'));rpcDb[_0xf9ba('0xa2')](_0x44d700,_0xf9ba('0xcc'));}else{if(_0x146c62[_0xf9ba('0xc9')]>=_0x3847ea[_0xf9ba('0xcd')]){rpcDb[_0xf9ba('0xa2')](_0x146c62,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xf9ba('0xbf')](_0x146c62,_0xf9ba('0xc9'),_0x3847ea[_0xf9ba('0xce')]),_0x146c62[_0xf9ba('0xc8')],_0x146c62[_0xf9ba('0xc0')]);}}break;case _0xf9ba('0xcf'):_0x3847ea['outboundRejectCallsDay']+=0x1;_0x146c62[_0xf9ba('0x9c')]=ut[_0xf9ba('0x9d')](_0x146c62);ut[_0xf9ba('0x8d')](_0x146c62,0x14,_0xf9ba('0xd0'));rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xd1'));if(_0x146c62[_0xf9ba('0xc8')]){rpcDb[_0xf9ba('0xd2')](_0x146c62['idContact']);}if(_0x146c62[_0xf9ba('0xc0')]){rpcDb[_0xf9ba('0xd3')](_0x146c62[_0xf9ba('0xd4')]);}break;default:if(_0x146c62[_0xf9ba('0x74')]){ut['decrementTalkink'](_0x3847ea,'[default]');ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3847ea[_0xf9ba('0x28')],_0x3c9924);}_0x3847ea[_0xf9ba('0x43')]+=0x1;_0x146c62[_0xf9ba('0x9c')]=ut['totalGlobal'](_0x146c62);ut[_0xf9ba('0x8d')](_0x146c62,0xc,_0x3c9924[_0xf9ba('0xd5')]||_0x3c9924[_0xf9ba('0xd6')]);rpcDb[_0xf9ba('0x91')](_0x146c62,_0xf9ba('0xd7'));if(ut['totalGlobal'](_0x146c62)>=_0x3847ea[_0xf9ba('0xa0')]){_0x44d700=ut[_0xf9ba('0xa1')](_0x146c62,0xf,_0xf9ba('0xcb'));rpcDb[_0xf9ba('0xa2')](_0x44d700,_0xf9ba('0xd8'));}else{rpcDb[_0xf9ba('0xa2')](_0x146c62,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xf9ba('0x14')][_0x3c9924[_0xf9ba('0xa4')]];}if(!(_0x146c62['dialAnswer']&&_0x3c944e==='16')){ut[_0xf9ba('0xd9')](_0x3847ea,_0xf9ba('0xda'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x146c62[_0xf9ba('0xb8')],'\x20Queue',_0x3847ea[_0xf9ba('0x28')],_0xf9ba('0x72'),_0x3847ea[_0xf9ba('0x4f')]);}if(_0x3c944e!=='ANSWER'){delete this[_0xf9ba('0x14')][_0x3c9924['linkedid']];delete this[_0xf9ba('0x14')][_0x3c9924[_0xf9ba('0xdb')]];}}};Preview['prototype'][_0xf9ba('0xdc')]=function(_0xd14525,_0x6f99b5,_0x138440){if(_['isUndefined'](_0x6f99b5)&&_0xf9ba('0xdd')!==typeof _0x6f99b5){return;}if(_['isUndefined'](_0x138440)&&_0xf9ba('0xdd')!==typeof _0x138440){return;}switch(_0x138440[_0xf9ba('0xde')]){case'0':ut[_0xf9ba('0xdf')](_0xd14525,0x0,_0xf9ba('0x9e'));rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe1'));break;case'3':ut[_0xf9ba('0xdf')](_0xd14525,0x3,'NoAnswer');rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe2'));break;case'5':ut[_0xf9ba('0xdf')](_0xd14525,0x5,_0xf9ba('0xbb'));rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe3'));break;case'8':ut['logAgent'](_0xd14525,0x8,_0xf9ba('0xe4'));rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe5'));break;case'22':ut[_0xf9ba('0xdf')](_0xd14525,0x16,_0xf9ba('0xe6'));rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe7'));break;default:ut[_0xf9ba('0xdf')](_0xd14525,0xc,_0x138440[_0xf9ba('0xde')]);rpcDb[_0xf9ba('0xe0')](_0xd14525,_0xf9ba('0xe5'));}ut[_0xf9ba('0xd9')](_0x6f99b5,_0xf9ba('0xe8'));logger[_0xf9ba('0x6e')](_0xf9ba('0xe9'),_0xd14525[_0xf9ba('0xb8')],_0xf9ba('0xaa'),_0x6f99b5[_0xf9ba('0x28')],'originated:\x20',_0x6f99b5[_0xf9ba('0x4f')]);delete this[_0xf9ba('0x14')][_0xd14525['uniqueid']];};Preview[_0xf9ba('0x62')]['checkInBlack']=function(_0x463926,_0x597a73,_0x1d621e,_0x552664,_0x2c3b4d){var _0x56e87c=this;return new BPromise(function(_0x286cea,_0x1d8904){if(_[_0xf9ba('0x6d')](_0x597a73)||_[_0xf9ba('0x6d')](_0x597a73[_0xf9ba('0xea')])||_[_0xf9ba('0x6d')](_0x597a73[_0xf9ba('0xea')]['phone'])||_[_0xf9ba('0x6d')](_0x597a73['VoiceQueueId'])){_0x1d8904(ut['message'](_0xf9ba('0xeb'),_0x552664,_0x2c3b4d));return;}var _0x377d31=uuid['v4']();var _0x5c3a98=_0x56e87c[_0xf9ba('0x11')][_0x597a73[_0xf9ba('0x70')][_0xf9ba('0x28')]];var _0x2bc46c=_0x1d621e?_0x56e87c['agents'][_0x1d621e]['id']:undefined;_0x56e87c[_0xf9ba('0x14')][_0x377d31]=new Action(_0x597a73,_0x5c3a98,_0x377d31,_0x1d621e,_0x2bc46c);var _0x18c6ab=_0x56e87c[_0xf9ba('0x14')][_0x377d31];_0x18c6ab[_0xf9ba('0xc8')]=_0x552664;_0x18c6ab[_0xf9ba('0xc0')]=_0x2c3b4d;_0x18c6ab[_0xf9ba('0xec')]=_0x1d621e;if(_['isEmpty'](_0x463926)){_0x56e87c[_0xf9ba('0xed')](_0x18c6ab,_0x5c3a98,_0x597a73,_0x1d621e)['then'](function(_0x511912){logger['info'](_0xf9ba('0xee'),_0xf9ba('0xef')+_0x18c6ab[_0xf9ba('0x71')]+_0xf9ba('0xf0')+_0x18c6ab[_0xf9ba('0xd4')],JSON['stringify'](_0x511912));ami[_0xf9ba('0x26')]('custom:agentcalled',ut[_0xf9ba('0xab')](_0x18c6ab,_0xf9ba('0xf1')));_0x286cea(ut[_0xf9ba('0x4e')](_0xf9ba('0xf2')));})[_0xf9ba('0x7c')](function(_0x48ecf9){ut[_0xf9ba('0x5d')](_0xf9ba('0xf3'),_0x48ecf9);_0x1d8904(ut['message']('Call\x20failed',_0x552664,_0x2c3b4d));});}else{_0x5c3a98[_0xf9ba('0x3a')]+=0x1;ut[_0xf9ba('0xf4')](_0x18c6ab);rpcDb[_0xf9ba('0xf5')](_0x18c6ab,_0xf9ba('0xf6'));delete _0x56e87c['actions'][_0x377d31];_0x1d8904(ut[_0xf9ba('0x4e')](_0xf9ba('0xf7'),_0x552664,_0x2c3b4d));}});};Preview[_0xf9ba('0x62')][_0xf9ba('0x98')]=function(_0x3cd55f){return!_[_0xf9ba('0x6d')](_0x3cd55f)&&!_[_0xf9ba('0x6d')](_0x3cd55f['name'])&&!_[_0xf9ba('0x6d')](_0x3cd55f['active'])&&_0x3cd55f['active']&&!_[_0xf9ba('0x6d')](this[_0xf9ba('0x13')][util[_0xf9ba('0x57')](_0xf9ba('0xf8'),_0x3cd55f[_0xf9ba('0x28')])])&&!_[_0xf9ba('0x6d')](this[_0xf9ba('0x13')][util[_0xf9ba('0x57')](_0xf9ba('0xf8'),_0x3cd55f[_0xf9ba('0x28')])][_0xf9ba('0x7a')])&&(this['trunks'][util[_0xf9ba('0x57')](_0xf9ba('0xf8'),_0x3cd55f['name'])][_0xf9ba('0x7a')]===_0xf9ba('0xf9')||this[_0xf9ba('0x13')][util['format']('SIP/%s',_0x3cd55f['name'])][_0xf9ba('0x7a')]===_0xf9ba('0xfa'));};Preview[_0xf9ba('0x62')][_0xf9ba('0x88')]=function(_0x23f231,_0x48b1ef){var _0x4d626b=this;return new BPromise(function(_0x319cb3,_0x4c6c4e){_0x4d626b['execRun'](_0x23f231,_0x48b1ef)[_0xf9ba('0x89')](function(_0xd02e40){_0x319cb3(_['pick'](_0xd02e40,['message']));})[_0xf9ba('0x7c')](function(_0x57aa13){if(_0x57aa13['unlock']){rpcDb[_0xf9ba('0xd2')](_0x23f231);}if(_0x57aa13['active']){rpcDb[_0xf9ba('0xd3')](_0x23f231);}_0x4c6c4e(_[_0xf9ba('0x75')](_0x57aa13,['message']));});});};Preview[_0xf9ba('0x62')][_0xf9ba('0xfb')]=function(_0x364570,_0x50fdd8){var _0x284b61=this;return new BPromise(function(_0x47ca94,_0x230688){var _0x531011,_0x63b111;rpcDb['getContactPreview'](_0x364570)[_0xf9ba('0x89')](function(_0x4f8c23){if(!_[_0xf9ba('0x6d')](_0x4f8c23[0x0])){_0x63b111=_0x4f8c23[0x0][_0xf9ba('0xfc')]?![]:!![];_0x531011=_0x4f8c23[0x0][_0xf9ba('0xfc')]?!![]:![];_0x531011=_0x50fdd8?!![]:_0x531011;}var _0x4eb0f3=_0x284b61[_0xf9ba('0xfd')](_0x4f8c23);if(_0x4eb0f3[_0xf9ba('0xfe')]){rpcDb[_0xf9ba('0xff')](_[_0xf9ba('0x75')](_0x4f8c23[0x0],[_0xf9ba('0x78'),_0xf9ba('0x100')]))[_0xf9ba('0x89')](function(_0x5dc444){_0x284b61['checkInBlack'](_0x5dc444,_0x4f8c23[0x0],_0x50fdd8,_0x63b111,_0x531011)[_0xf9ba('0x89')](function(_0x1f7531){_0x47ca94(_0x1f7531);})[_0xf9ba('0x7c')](function(_0x54e70c){_0x230688(_0x54e70c);});})['catch'](function(_0xb09ae4){ut['logger']('[Preview][checkIsBlackList]',_0xb09ae4);_0x230688(ut[_0xf9ba('0x4e')](_0xf9ba('0x101'),_0x63b111,_0x531011));});}else{_0x230688(ut['message'](_0x4eb0f3['message'],_0x63b111,_0x531011));}})[_0xf9ba('0x7c')](function(_0x4b3227){ut[_0xf9ba('0x5d')](_0xf9ba('0x102'),_0x4b3227);_0x230688(ut[_0xf9ba('0x4e')](_0xf9ba('0x101'),![],!![]));});});};Preview[_0xf9ba('0x62')][_0xf9ba('0xfd')]=function(_0x2882c9){if(_['isNil'](_0x2882c9)||_[_0xf9ba('0x103')](_0x2882c9)||!_['isNil'](_0x2882c9[0x0][_0xf9ba('0x104')])&&_[_0xf9ba('0x6d')](_0x2882c9[0x0][_0xf9ba('0x104')][_0xf9ba('0x28')])){ut[_0xf9ba('0x5d')](_0xf9ba('0x105'),_0x2882c9);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3a3570=this[_0xf9ba('0x11')][_0x2882c9[0x0][_0xf9ba('0x70')]['name']];_0x3a3570[_0xf9ba('0x4e')]=_0xf9ba('0x9b');if(_['isNil'](_0x3a3570)){ut['logger'](_0xf9ba('0x106'),_0x3a3570);return{'isValid':![],'message':_0xf9ba('0x107')};}if(!this[_0xf9ba('0x98')](_0x3a3570[_0xf9ba('0x52')])){ut[_0xf9ba('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xf9ba('0x108')+_0x3a3570[_0xf9ba('0x28')]+_0xf9ba('0x109'));if(!this['isTrunkReachable'](_0x3a3570['TrunkBackup'])){ut[_0xf9ba('0x5d')](_0xf9ba('0x10a'),_0x3a3570[_0xf9ba('0x28')]+_0xf9ba('0x10b'));return{'isValid':![],'message':_0xf9ba('0x10c')};}}if(!ut[_0xf9ba('0x97')](_0x3a3570['dialActive'])){ut[_0xf9ba('0x5d')](_0xf9ba('0x10d'),_0x3a3570[_0xf9ba('0x28')]+_0xf9ba('0x10e'));return{'isValid':![],'message':_0xf9ba('0x108')+_0x3a3570[_0xf9ba('0x28')]+_0xf9ba('0x10e')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x278ab9,_0x18de6c,_0xb94268,_0x4d0c2d){var _0x23785f=this;return new BPromise(function(_0x511b69,_0x4790eb){var _0x35df24=_0x278ab9[_0xf9ba('0xb8')];var _0xe98422=_0x23785f[_0xf9ba('0x98')](_0x18de6c[_0xf9ba('0x52')])?util[_0xf9ba('0x57')]('SIP/%s/%s%s',_0x18de6c[_0xf9ba('0x52')][_0xf9ba('0x28')],_['isNil'](_0x18de6c[_0xf9ba('0x39')])?'':_0x18de6c[_0xf9ba('0x39')]['trim']()||'',_0x18de6c['dialCutDigit']>0x0?_0xb94268[_0xf9ba('0xea')][_0xf9ba('0x10f')][_0xf9ba('0x110')](_0x18de6c[_0xf9ba('0x111')]):_0xb94268[_0xf9ba('0xea')][_0xf9ba('0x10f')]):util[_0xf9ba('0x57')](_0xf9ba('0x112'),_['isNil'](_0x18de6c['TrunkBackup'])?_0x18de6c[_0xf9ba('0x52')][_0xf9ba('0x28')]:_0x18de6c[_0xf9ba('0x99')][_0xf9ba('0x28')],_[_0xf9ba('0x6d')](_0x18de6c['dialPrefix'])?'':_0x18de6c['dialPrefix'][_0xf9ba('0x113')]()||'',_0x18de6c['dialCutDigit']>0x0?_0xb94268[_0xf9ba('0xea')]['phone']['substring'](_0x18de6c[_0xf9ba('0x111')]):_0xb94268[_0xf9ba('0xea')][_0xf9ba('0x10f')]);var _0x4c1333=_0x23785f[_0xf9ba('0x98')](_0x18de6c[_0xf9ba('0x52')])?ut['getCallerId'](_0x18de6c[_0xf9ba('0x52')][_0xf9ba('0x54')],_0x18de6c[_0xf9ba('0x36')],_0x18de6c[_0xf9ba('0x114')]>0x0?ut[_0xf9ba('0x115')](_0x18de6c[_0xf9ba('0x37')],_0x18de6c['dialRandomLastDigitCallerIdNumber']):_0x18de6c['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xf9ba('0x6d')](_0x18de6c[_0xf9ba('0x99')])?_0x18de6c[_0xf9ba('0x52')]['callerid']:_0x18de6c[_0xf9ba('0x99')]['callerid'],_0x18de6c[_0xf9ba('0x36')],_0x18de6c[_0xf9ba('0x114')]>0x0?ut[_0xf9ba('0x115')](_0x18de6c[_0xf9ba('0x37')],_0x18de6c[_0xf9ba('0x114')]):_0x18de6c['dialOriginateCallerIdNumber']);if(_0x4c1333){_0x278ab9[_0xf9ba('0x116')]=ut[_0xf9ba('0x117')](_0x4c1333);_0x278ab9[_0xf9ba('0x118')]=ut[_0xf9ba('0x119')](_0x4c1333);}var _0x1a9f78=ut['addVariables'](_0x18de6c,_0xb94268,_0xe98422,_0x4c1333,_0x35df24,_0x278ab9);_['merge'](_0x278ab9,ut[_0xf9ba('0x11a')](_0x1a9f78));_0x278ab9['starttime']=moment()[_0xf9ba('0x57')](_0xf9ba('0xa6'));ami[_0xf9ba('0x11b')](ut['variablesAction'](_0x278ab9,_0x18de6c,_0x1a9f78,_0x278ab9[_0xf9ba('0xc0')],_0x4d0c2d))[_0xf9ba('0x89')](function(_0x97ef45){_0x18de6c[_0xf9ba('0x4f')]+=0x1;logger[_0xf9ba('0x6e')]('[originated][increment]',_0x35df24,_0xf9ba('0xaa'),_0x18de6c[_0xf9ba('0x28')],'originated:\x20',_0x18de6c['originated']);_0x511b69(_0x97ef45);})[_0xf9ba('0x7c')](function(_0x533f11){ut['logAgent'](_0x278ab9,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x278ab9,_0xf9ba('0x11c'));_0x4790eb(_0x533f11);});});};Preview[_0xf9ba('0x62')][_0xf9ba('0x1f')]=function(_0x2a4ebc){if(this[_0xf9ba('0x14')][_0x2a4ebc[_0xf9ba('0xa4')]]){this[_0xf9ba('0x14')][_0x2a4ebc[_0xf9ba('0xa4')]][_0xf9ba('0x7b')]=_0x2a4ebc['channel'];}};Preview[_0xf9ba('0x62')][_0xf9ba('0x18')]=function(_0x299756){var _0x14937d=this;var _0x88d8ad=this[_0xf9ba('0x14')][_0x299756[_0xf9ba('0x11d')]];if(_0x88d8ad){if(_0x88d8ad[_0xf9ba('0xec')]&&this['agents'][_0x88d8ad[_0xf9ba('0xec')]]){ut[_0xf9ba('0x11e')](_0x88d8ad,this[_0xf9ba('0x15')][_0x88d8ad[_0xf9ba('0xec')]][_0xf9ba('0x28')],this[_0xf9ba('0x15')][_0x88d8ad['lookAgent']]['id']);}var _0x35fa19=_[_0xf9ba('0x11f')](_0x88d8ad);_0x35fa19[_0xf9ba('0xa7')]=moment()['format'](_0xf9ba('0xa6'));var _0x354439=_0x14937d[_0xf9ba('0x11')][_0x88d8ad[_0xf9ba('0x71')]];if(ut[_0xf9ba('0x120')](_0x299756[_0xf9ba('0x121')])){if(_0x88d8ad[_0xf9ba('0xc8')]){rpcDb[_0xf9ba('0xd2')](_0x88d8ad[_0xf9ba('0xd4')]);}if(_0x88d8ad[_0xf9ba('0xc0')]){rpcDb[_0xf9ba('0xd3')](_0x88d8ad[_0xf9ba('0xd4')]);}ami['emit'](_0xf9ba('0x122'),ut[_0xf9ba('0xab')](_0x88d8ad,_0xf9ba('0x123')));this[_0xf9ba('0xdc')](_0x35fa19,_0x354439,_0x299756);}else{_0x88d8ad[_0xf9ba('0x8c')]=moment()[_0xf9ba('0x57')](_0xf9ba('0xa6'));ut[_0xf9ba('0xdf')](_0x35fa19,0x4,_0xf9ba('0xb3'));rpcDb['createAgentHistory'](_0x35fa19,_0xf9ba('0x124'));}}};Preview['prototype'][_0xf9ba('0x1b')]=function(_0x561aa7){var _0x2bb41c=this;var _0x2e170f=this['actions'][_0x561aa7[_0xf9ba('0xa4')]];var _0x5bea36;if(_0x2e170f){_0x5bea36=this[_0xf9ba('0x11')][_0x2e170f['queue']];logger[_0xf9ba('0x6e')](_0xf9ba('0x125'),_0x561aa7['linkedid'],'\x20Queue',_0x5bea36[_0xf9ba('0x28')],_0xf9ba('0x73'),_0x5bea36['pTalking']);}if(this['actions'][_0x561aa7['linkedid']]&&_0x561aa7[_0xf9ba('0xa4')]!==_0x561aa7[_0xf9ba('0xb8')]){if(_0x561aa7['cause']==='16'&&this[_0xf9ba('0x14')][_0x561aa7['linkedid']]['dialAnswer']){this[_0xf9ba('0x126')](_0x561aa7,_0x561aa7[_0xf9ba('0xa4')],_0x561aa7[_0xf9ba('0x127')]);}else if(this[_0xf9ba('0x14')][_0x561aa7['linkedid']][_0xf9ba('0x74')]){logger[_0xf9ba('0x6e')](_0xf9ba('0x128'),_0x561aa7['linkedid'],_0x561aa7[_0xf9ba('0x127')],_0xf9ba('0xaa'),_0x5bea36[_0xf9ba('0x28')],'pTalking:\x20',_0x5bea36['pTalking']);this[_0xf9ba('0x126')](_0x561aa7,_0x561aa7['linkedid'],_0x561aa7[_0xf9ba('0x127')]);}}else if(_0x2e170f&&_[_0xf9ba('0x6d')](_0x2e170f[_0xf9ba('0x129')])&&_0x5bea36[_0xf9ba('0x12a')]&&_0x561aa7['linkedid']===_0x561aa7[_0xf9ba('0xb8')]&&_[_0xf9ba('0x6d')](_0x561aa7[_0xf9ba('0xde')])&&_0x561aa7['cause']==='16'&&_0x561aa7['channelstate']==='6'&&_['isUndefined'](_0x2e170f[_0xf9ba('0x12b')])){if(_0x2e170f['unlockAgent']){rpcDb[_0xf9ba('0xd2')](_0x2e170f[_0xf9ba('0xd4')]);}if(_0x2e170f[_0xf9ba('0xc0')]){rpcDb[_0xf9ba('0xd3')](_0x2e170f['idContact']);}_0x561aa7[_0xf9ba('0xde')]='22';this[_0xf9ba('0xdc')](_0x2e170f,_0x5bea36,_0x561aa7);}else if(_0x2e170f&&_0x2e170f[_0xf9ba('0x12b')]){if(_0x561aa7[_0xf9ba('0x127')]==='16'&&this['actions'][_0x561aa7[_0xf9ba('0xa4')]][_0xf9ba('0x74')]){logger[_0xf9ba('0x6e')]('[syncHangup][talking][transfer]',_0x561aa7[_0xf9ba('0xa4')],_0x561aa7['cause'],'\x20Queue',_0x5bea36[_0xf9ba('0x28')],_0xf9ba('0x73'),_0x5bea36[_0xf9ba('0x2d')]);this[_0xf9ba('0x126')](_0x561aa7,_0x561aa7['linkedid'],_0x561aa7[_0xf9ba('0x127')]);}else if(this['actions'][_0x561aa7[_0xf9ba('0xa4')]][_0xf9ba('0x74')]){logger[_0xf9ba('0x6e')](_0xf9ba('0x128'),_0x561aa7[_0xf9ba('0xa4')],_0x561aa7[_0xf9ba('0x127')],_0xf9ba('0xaa'),_0x5bea36[_0xf9ba('0x28')],'pTalking:\x20',_0x5bea36[_0xf9ba('0x2d')]);this[_0xf9ba('0x126')](_0x561aa7,_0x561aa7[_0xf9ba('0xa4')],_0x561aa7[_0xf9ba('0x127')]);}}};Preview['prototype']['syncDialEnd']=function(_0xf6a706){if(this[_0xf9ba('0x14')][_0xf6a706[_0xf9ba('0xdb')]]&&_0xf6a706[_0xf9ba('0xdb')]!==_0xf6a706['destuniqueid']){this[_0xf9ba('0x126')](_0xf6a706,_0xf6a706[_0xf9ba('0xdb')],_0xf6a706[_0xf9ba('0xd6')]);}};Preview['prototype'][_0xf9ba('0x1c')]=function(_0x115d27){if(this[_0xf9ba('0x14')][_0x115d27[_0xf9ba('0xa4')]]&&_0x115d27[_0xf9ba('0xa4')]!==_0x115d27[_0xf9ba('0xb8')]&&!this[_0xf9ba('0x14')][_0x115d27[_0xf9ba('0xa4')]]['dialAnswer']){if(_0x115d27[_0xf9ba('0x127')]==='1'){this[_0xf9ba('0x126')](_0x115d27,_0x115d27['linkedid'],_0x115d27[_0xf9ba('0x127')]);}}};Preview[_0xf9ba('0x62')]['addVariable']=function(_0x2e3c4c,_0xd19396,_0xf51c83){if(this[_0xf9ba('0x14')][_0x2e3c4c]){if(_[_0xf9ba('0x6d')](this[_0xf9ba('0x14')][_0x2e3c4c][_0xf9ba('0x12c')])){this['actions'][_0x2e3c4c][_0xf9ba('0x12c')]={};}this[_0xf9ba('0x14')][_0x2e3c4c][_0xf9ba('0x12c')][_0xd19396]=_0xf51c83;}};Preview[_0xf9ba('0x62')][_0xf9ba('0x20')]=function(_0x35d579){try{if(!_[_0xf9ba('0x6d')](_0x35d579)){if(ut['filterKey'](_[_0xf9ba('0x12d')](_0x35d579['variable'])[0x0])){this['addVariable'](_0x35d579[_0xf9ba('0xb8')],_['keys'](_0x35d579['variable'])[0x0],_0x35d579[_0xf9ba('0x12e')]);}}}catch(_0x479e3f){logger[_0xf9ba('0x12f')](_0xf9ba('0x130'),util['inspect'](_0x479e3f,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xf9ba('0x22')]=function(_0x58ad76){if(_0x58ad76){if(this['actions'][_0x58ad76[_0xf9ba('0x131')]]){this['actions'][_0x58ad76[_0xf9ba('0x131')]]['transfer']=!![];}}};Preview[_0xf9ba('0x62')]['syncBlindTransfer']=function(_0x5e79c5){if(_0x5e79c5){if(this[_0xf9ba('0x14')][_0x5e79c5[_0xf9ba('0x132')]]){this['actions'][_0x5e79c5['transfererlinkedid']]['transfer']=!![];}}};module[_0xf9ba('0x133')]=Preview; \ No newline at end of file +var _0xa552=['dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','answered','pTalking','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','sendMessageOneNotActive','available','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','contactId','UserId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','scheduledAt','dialNoAnswerRetryFrequency','activeContact','outboundCongestionCallsDay','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','CANCEL','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','buildObj','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','SIP/%s','status','reachable','unlock','pick','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','actionid','lookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','destlinkedid','addVariable','variables','keys','variable','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest'];(function(_0x1febf8,_0x3cba83){var _0x168127=function(_0x23f4d9){while(--_0x23f4d9){_0x1febf8['push'](_0x1febf8['shift']());}};_0x168127(++_0x3cba83);}(_0xa552,0x116));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x2a55('0x0'));var BPromise=require(_0x2a55('0x1'));var uuid=require(_0x2a55('0x2'));var moment=require(_0x2a55('0x3'));var md5=require(_0x2a55('0x4'));var Redis=require(_0x2a55('0x5'));var config=require(_0x2a55('0x6'));var logger=require(_0x2a55('0x7'))('preview');var loggerAction=require(_0x2a55('0x7'))(_0x2a55('0x8'));var ami=require(_0x2a55('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x2a55('0xa'));var ut=require(_0x2a55('0xb'));config[_0x2a55('0xc')]=_[_0x2a55('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2a55('0xe'))(new Redis(config[_0x2a55('0xc')]));var Sequence=function(){};Sequence[_0x2a55('0xf')][_0x2a55('0x10')]=function(_0x5c0d99){this['tail']=this['tail']?this[_0x2a55('0x11')][_0x2a55('0x12')](_0x5c0d99):_0x5c0d99();};function Preview(_0x239835){this[_0x2a55('0x13')]=new Sequence();this[_0x2a55('0x14')]=_0x239835[_0x2a55('0x15')];this[_0x2a55('0x16')]=_0x239835[_0x2a55('0x16')];this[_0x2a55('0x17')]={};this[_0x2a55('0x18')]=_0x239835['agents'];this[_0x2a55('0x19')]=0x0;ami['on'](_0x2a55('0x1a'),this[_0x2a55('0x1b')]['bind'](this));ami['on'](_0x2a55('0x1c'),this[_0x2a55('0x1d')][_0x2a55('0x1e')](this));ami['on'](_0x2a55('0x1f'),this['syncHangupRequest'][_0x2a55('0x1e')](this));ami['on'](_0x2a55('0x20'),this[_0x2a55('0x21')]['bind'](this));ami['on']('newexten',this[_0x2a55('0x22')][_0x2a55('0x1e')](this));ami['on']('varset',this[_0x2a55('0x23')][_0x2a55('0x1e')](this));ami['on'](_0x2a55('0x24'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x2a55('0x25'),this[_0x2a55('0x26')][_0x2a55('0x1e')](this));this[_0x2a55('0x27')](this[_0x2a55('0x14')]);}function emit(_0x34aca8,_0x5d3634,_0x4fc651){io['to'](_0x34aca8)['emit'](_0x5d3634,_0x4fc651);}function emitCampaignPreview(_0x1d35d2){if(_0x1d35d2[_0x2a55('0x28')]===_0x2a55('0x29')){var _0xbc4913={'id':_0x1d35d2['id'],'name':_0x1d35d2[_0x2a55('0x2a')],'strategy':_0x1d35d2['strategy'],'answered':_0x1d35d2[_0x2a55('0x2b')],'available':_0x1d35d2['available'],'loggedIn':_0x1d35d2['loggedIn'],'pTalking':_0x1d35d2[_0x2a55('0x2c')],'sumBillable':_0x1d35d2['sumBillable'],'sumDuration':_0x1d35d2['sumDuration'],'sumHoldTime':_0x1d35d2[_0x2a55('0x2d')]||0x0,'talking':_0x1d35d2[_0x2a55('0x2e')],'total':_0x1d35d2[_0x2a55('0x2f')],'type':_0x1d35d2[_0x2a55('0x28')],'unmanaged':_0x1d35d2[_0x2a55('0x30')],'abandoned':_0x1d35d2['abandoned'],'waiting':_0x1d35d2[_0x2a55('0x31')],'loggedInDb':_0x1d35d2[_0x2a55('0x32')],'dialActive':_0x1d35d2[_0x2a55('0x33')],'dialMethod':_0x1d35d2[_0x2a55('0x34')],'dialOriginateCallerIdName':_0x1d35d2[_0x2a55('0x35')],'dialOriginateCallerIdNumber':_0x1d35d2['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1d35d2[_0x2a55('0x36')],'dialPrefix':_0x1d35d2['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1d35d2[_0x2a55('0x37')],'outboundAnswerCallsDay':_0x1d35d2[_0x2a55('0x38')],'outboundBlacklistCallsDay':_0x1d35d2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1d35d2[_0x2a55('0x39')],'outboundCongestionCallsDay':_0x1d35d2['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1d35d2['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1d35d2[_0x2a55('0x3a')],'outboundDropCallsDayTimeout':_0x1d35d2[_0x2a55('0x3b')],'outboundNoAnswerCallsDay':_0x1d35d2[_0x2a55('0x3c')],'outboundNoSuchCallsDay':_0x1d35d2[_0x2a55('0x3d')],'outboundOriginateFailureCallsDay':_0x1d35d2[_0x2a55('0x3e')],'outboundReCallsDay':_0x1d35d2[_0x2a55('0x3f')],'outboundRejectCallsDay':_0x1d35d2[_0x2a55('0x40')],'outboundUnknownCallsDay':_0x1d35d2[_0x2a55('0x41')],'predictiveIntervalAnsweredCalls':_0x1d35d2['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1d35d2[_0x2a55('0x42')],'predictiveIntervalAvgTalktime':_0x1d35d2[_0x2a55('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x1d35d2[_0x2a55('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x1d35d2[_0x2a55('0x45')],'predictiveIntervalErlangCalls':_0x1d35d2[_0x2a55('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d35d2[_0x2a55('0x47')],'predictiveIntervalHitRate':_0x1d35d2[_0x2a55('0x48')],'predictiveIntervalMultiplicativeFactor':_0x1d35d2[_0x2a55('0x49')],'predictiveIntervalPauses':_0x1d35d2['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1d35d2[_0x2a55('0x4a')],'predictiveIntervalTotalCalls':_0x1d35d2[_0x2a55('0x4b')],'message':_0x1d35d2[_0x2a55('0x4c')],'originated':_0x1d35d2[_0x2a55('0x4d')],'erlangCalls':_0x1d35d2[_0x2a55('0x4e')],'erlangCallToSecond':_0x1d35d2[_0x2a55('0x4f')],'erlangAbandonmentRate':_0x1d35d2[_0x2a55('0x50')],'erlangBusyFactor':_0x1d35d2['erlangBusyFactor'],'startPredictive':_0x1d35d2[_0x2a55('0x51')],'startProgressive':_0x1d35d2[_0x2a55('0x52')]};if(_0x1d35d2[_0x2a55('0x53')]){_0xbc4913[_0x2a55('0x53')]={'id':_0x1d35d2[_0x2a55('0x53')]['id'],'name':_0x1d35d2[_0x2a55('0x53')]['name'],'active':_0x1d35d2[_0x2a55('0x53')][_0x2a55('0x54')],'callerid':_0x1d35d2[_0x2a55('0x53')][_0x2a55('0x55')]};}if(_0x1d35d2[_0x2a55('0x56')]){_0xbc4913[_0x2a55('0x56')]={'id':_0x1d35d2[_0x2a55('0x56')]['id'],'name':_0x1d35d2[_0x2a55('0x56')][_0x2a55('0x2a')]};}var _0x24becd=md5(JSON[_0x2a55('0x57')](_0xbc4913));if(_0x1d35d2[_0x2a55('0x4')]!==_0x24becd){_0x1d35d2[_0x2a55('0x4')]=_0x24becd;emit(util[_0x2a55('0x58')](_0x2a55('0x59'),_0xbc4913[_0x2a55('0x2a')]),_0x2a55('0x5a'),_0xbc4913);}}}function emitVoiceQueueChannelRemove(_0x1ed7de){emit(util[_0x2a55('0x58')](_0x2a55('0x59'),_0x1ed7de[_0x2a55('0x2a')]),'voice_queue_channel:remove',_0x1ed7de);}function notSendMessagesQueue(_0x2e8fec){if(_0x2e8fec[_0x2a55('0x5b')]){if(_0x2e8fec[_0x2a55('0x4d')]===0x0&&_0x2e8fec[_0x2a55('0x2c')]===0x0){_0x2e8fec[_0x2a55('0x5b')]=![];_0x2e8fec[_0x2a55('0x5c')]=0x0;_0x2e8fec['paused']=0x0;_0x2e8fec[_0x2a55('0x4c')]=_0x2a55('0x5d');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2e8fec[_0x2a55('0x2a')]+_0x2a55('0x5e'));}else{_0x2e8fec[_0x2a55('0x4c')]=_0x2a55('0x5f');ut[_0x2a55('0x60')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2e8fec[_0x2a55('0x2a')]+_0x2a55('0x61'));}emitCampaignPreview(_0x2e8fec);}}Preview[_0x2a55('0xf')][_0x2a55('0x27')]=function(){var _0x4e6d1b=this;setInterval(function(){_0x4e6d1b[_0x2a55('0x62')]();},0x7cf);};Preview[_0x2a55('0xf')][_0x2a55('0x62')]=function(){var _0x17d9d9=this[_0x2a55('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x48d195 in _0x17d9d9){if(_0x17d9d9[_0x2a55('0x63')](_0x48d195)&&(_0x17d9d9[_0x48d195]['dialMethod']===_0x2a55('0x64')||_0x17d9d9[_0x48d195][_0x2a55('0x34')]===_0x2a55('0x65'))&&_0x17d9d9[_0x48d195][_0x2a55('0x28')]===_0x2a55('0x29')){if(this[_0x2a55('0x19')]>0x7){this[_0x2a55('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x17d9d9[_0x2a55('0x63')](_0x48d195)&&_0x17d9d9[_0x48d195][_0x2a55('0x34')]===_0x2a55('0x64')&&_0x17d9d9[_0x48d195][_0x2a55('0x28')]===_0x2a55('0x29')){if(_0x17d9d9[_0x48d195]['dialActive']){this[_0x2a55('0x66')](_0x17d9d9[_0x48d195]);this[_0x2a55('0x67')](_0x17d9d9[_0x48d195]);}else{notSendMessagesQueue(_0x17d9d9[_0x48d195]);}}}};Preview[_0x2a55('0xf')][_0x2a55('0x68')]=function(_0x1e6f6d){var _0x594fa4=this;this[_0x2a55('0x13')][_0x2a55('0x10')](function(){if(!_[_0x2a55('0x69')](_0x594fa4['actions'][_0x1e6f6d])){loggerAction[_0x2a55('0x6a')](_0x2a55('0x6b'),_0x1e6f6d,_0x2a55('0x6c'),_0x594fa4[_0x2a55('0x17')][_0x1e6f6d][_0x2a55('0x6d')],_0x2a55('0x6e'),JSON[_0x2a55('0x57')](_0x594fa4[_0x2a55('0x14')][_0x594fa4['actions'][_0x1e6f6d][_0x2a55('0x6d')]][_0x2a55('0x4d')]),'pTalking:\x20',JSON[_0x2a55('0x57')](_0x594fa4[_0x2a55('0x14')][_0x594fa4[_0x2a55('0x17')][_0x1e6f6d][_0x2a55('0x6d')]][_0x2a55('0x2c')]),JSON[_0x2a55('0x57')](_0x594fa4[_0x2a55('0x17')][_0x1e6f6d][_0x2a55('0x6f')]),JSON[_0x2a55('0x57')](_['pick'](_0x594fa4['actions'][_0x1e6f6d],[_0x2a55('0x70'),_0x2a55('0x71'),'VoiceQueueId',_0x2a55('0x72')])));return ami[_0x2a55('0x73')]({'action':'status','channel':_0x594fa4[_0x2a55('0x17')][_0x1e6f6d][_0x2a55('0x74')]})[_0x2a55('0x75')](function(_0x2b0ae7){if(_0x2b0ae7[_0x2a55('0x4c')]===_0x2a55('0x76')){setTimeout(function(){if(_0x594fa4[_0x2a55('0x17')][_0x1e6f6d]){ut[_0x2a55('0x77')](_0x594fa4['campaignsPreview'][_0x594fa4[_0x2a55('0x17')][_0x1e6f6d]['queue']],_0x2a55('0x78'));if(_0x594fa4[_0x2a55('0x17')][_0x1e6f6d][_0x2a55('0x6f')]===!![]){ut[_0x2a55('0x79')](_0x594fa4['campaignsPreview'][_0x594fa4[_0x2a55('0x17')][_0x1e6f6d]['queue']],'[clearZombieChannel]');ut[_0x2a55('0x7a')](_0x2a55('0x7b')+_0x1e6f6d,_0x594fa4[_0x2a55('0x17')][_0x1e6f6d]['queue']);}ut['loggerError'](_0x2a55('0x7c')+_0x1e6f6d,_0x594fa4[_0x2a55('0x17')][_0x1e6f6d]['queue']);delete _0x594fa4[_0x2a55('0x17')][_0x1e6f6d];}},0x2328);}});}});};Preview['prototype'][_0x2a55('0x7d')]=function(){var _0x3b681d=this;loggerAction[_0x2a55('0x6a')]('[action]',_[_0x2a55('0x7e')](this[_0x2a55('0x17')]));for(var _0x2ea5b4 in this[_0x2a55('0x17')]){if(_0x3b681d[_0x2a55('0x17')]['hasOwnProperty'](_0x2ea5b4)){_0x3b681d[_0x2a55('0x68')](_0x2ea5b4);}}};Preview['prototype'][_0x2a55('0x67')]=function(_0x4de8ec){var _0x303190=this;rpcDb[_0x2a55('0x7f')](_0x4de8ec['id'],ut[_0x2a55('0x80')](this['agents']))[_0x2a55('0x81')](function(_0x577964){if(!_[_0x2a55('0x69')](_0x577964)){for(var _0x2a40a3=0x0;_0x2a40a3<_0x577964['length'];_0x2a40a3+=0x1){if(ut[_0x2a55('0x82')](_0x577964[_0x2a40a3]['scheduledat'])<_0x4de8ec[_0x2a55('0x83')]*0x3c){_0x303190[_0x2a55('0x84')](_0x577964[_0x2a40a3]['id'])[_0x2a55('0x81')](ut[_0x2a55('0x85')]('[RecallMe]'))[_0x2a55('0x75')](ut[_0x2a55('0x85')](_0x2a55('0x86')));}else{var _0x240c4f=new Action(_0x577964[_0x2a40a3],_0x4de8ec);_0x240c4f[_0x2a55('0x87')]=moment()[_0x2a55('0x58')](_0x2a55('0x88'));_0x4de8ec[_0x2a55('0x3f')]+=0x1;ut[_0x2a55('0x89')](_0x240c4f,0x17,_0x2a55('0x8a'));if(_0x4de8ec['dialRecallInQueue']){rpcDb[_0x2a55('0x8b')](ut[_0x2a55('0x8c')](_0x577964[_0x2a40a3]));rpcDb[_0x2a55('0x8d')](_0x240c4f,_0x2a55('0x8e'));}else{ut[_0x2a55('0x89')](_0x240c4f,0x16,'RecallFailedTimeout');rpcDb[_0x2a55('0x8d')](_0x240c4f,_0x2a55('0x8f'));rpcDb[_0x2a55('0x90')](_0x240c4f,_0x2a55('0x8f'));}}}}})[_0x2a55('0x75')](ut[_0x2a55('0x85')](_0x2a55('0x91')));};Preview['prototype'][_0x2a55('0x66')]=function(_0x36a90b){_0x36a90b['sendMessageOneNotActive']=!![];if(ut[_0x2a55('0x92')](_0x36a90b['loggedIn'])){_0x36a90b[_0x2a55('0x4c')]=_0x2a55('0x93');}else if(!ut[_0x2a55('0x94')](_0x36a90b['dialActive'])){_0x36a90b[_0x2a55('0x4c')]='NOT_ACTIVE';}else if(!this[_0x2a55('0x95')](_0x36a90b[_0x2a55('0x53')])){if(!this[_0x2a55('0x95')](_0x36a90b[_0x2a55('0x96')])){_0x36a90b[_0x2a55('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x36a90b['message']=_0x2a55('0x97');}}else{_0x36a90b[_0x2a55('0x4c')]=_0x2a55('0x97');}emitCampaignPreview(_0x36a90b);};Preview['prototype'][_0x2a55('0x98')]=function(_0x4e4900,_0x12d293,_0x53d756){var _0x11874f=this;var _0x369d90=this[_0x2a55('0x17')][_0x12d293];var _0x697267=this[_0x2a55('0x14')][_0x369d90[_0x2a55('0x6d')]];var _0x8ca9ac;if(_0x697267){switch(_0x53d756){case'1':_0x697267[_0x2a55('0x3d')]+=0x1;_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0x0,_0x2a55('0x9b'));rpcDb[_0x2a55('0x8d')](_0x369d90,_0x2a55('0x9c'));if(ut[_0x2a55('0x9a')](_0x369d90)>=_0x697267[_0x2a55('0x9d')]){_0x8ca9ac=ut[_0x2a55('0x9e')](_0x369d90,0xf,_0x2a55('0x9f'));rpcDb[_0x2a55('0x90')](_0x8ca9ac,_0x2a55('0xa0'));}else{rpcDb[_0x2a55('0x90')](_0x369d90,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x2a55('0x17')][_0x4e4900['linkedid']];break;case _0x2a55('0xa1'):var _0x32cf3e=moment()['format'](_0x2a55('0x88'));_0x369d90[_0x2a55('0xa2')]=_0x32cf3e;_0x369d90[_0x2a55('0xa3')]=_0x32cf3e;_0x369d90['dialAnswer']=!![];_0x697267[_0x2a55('0x2c')]+=0x1;logger[_0x2a55('0x6a')](_0x2a55('0xa4'),_0x369d90[_0x2a55('0xa5')],_0x2a55('0xa6'),_0x697267['name'],_0x2a55('0xa7'),_0x697267['pTalking']);ami[_0x2a55('0xa8')](_0x2a55('0xa9'),ut['buildObj'](_0x369d90,_0x2a55('0xaa')));if(_0x697267[_0x2a55('0xab')]){ami['emit'](_0x2a55('0xac'),ut[_0x2a55('0xad')](_0x369d90));}break;case'16':ami[_0x2a55('0xa8')]('custom:agentcomplete',ut['buildObj'](_0x369d90,'complete'));emitVoiceQueueChannelRemove(ut['buildObj'](_0x369d90,'complete'));_0x697267[_0x2a55('0x38')]+=0x1;_0x697267['total']+=0x1;_0x697267[_0x2a55('0x2b')]+=0x1;ut['decrementTalkink'](_0x697267,'[16]');_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0x4,'Answer');rpcDb[_0x2a55('0x8d')](_0x369d90,_0x2a55('0xae'));rpcDb[_0x2a55('0x90')](_0x369d90,_0x2a55('0xaf'));rpcDb[_0x2a55('0xb0')](_0x369d90);_0x697267['sumDuration']+=_0x369d90[_0x2a55('0xb1')];_0x697267['sumBillable']+=_0x369d90[_0x2a55('0xb1')];logger[_0x2a55('0x6a')](_0x2a55('0xb2'),_0x369d90['uniqueid'],'\x20Queue',_0x697267[_0x2a55('0x2a')],_0x2a55('0xa7'),_0x697267[_0x2a55('0x2c')]);delete this[_0x2a55('0x17')][_0x4e4900['linkedid']];break;case'BUSY':_0x697267[_0x2a55('0x39')]+=0x1;_0x369d90[_0x2a55('0xb3')]+=0x1;_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0x5,_0x2a55('0xb4'));rpcDb[_0x2a55('0x8d')](_0x369d90,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x369d90)>=_0x697267[_0x2a55('0x9d')]){_0x8ca9ac=ut[_0x2a55('0x9e')](_0x369d90,0xf,_0x2a55('0x9f'));rpcDb[_0x2a55('0x90')](_0x8ca9ac,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x369d90[_0x2a55('0xb3')]>=_0x697267[_0x2a55('0xb5')]){rpcDb['createCustomerFinal'](_0x369d90,_0x2a55('0xb6'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x369d90,_0x2a55('0xb3'),_0x697267[_0x2a55('0xb7')]),_0x369d90[_0x2a55('0xb8')],_0x369d90['activeContact']);}}break;case'NOANSWER':_0x697267[_0x2a55('0x3c')]+=0x1;_0x369d90[_0x2a55('0xb9')]+=0x1;_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0x3,_0x2a55('0xba'));rpcDb[_0x2a55('0x8d')](_0x369d90,_0x2a55('0xbb'));if(ut['totalGlobal'](_0x369d90)>=_0x697267['dialGlobalMaxRetry']){_0x8ca9ac=ut[_0x2a55('0x9e')](_0x369d90,0xf,_0x2a55('0x9f'));rpcDb[_0x2a55('0x90')](_0x8ca9ac,_0x2a55('0xbc'));}else{if(_0x369d90['countnoanswerretry']>=_0x697267[_0x2a55('0xbd')]){rpcDb[_0x2a55('0x90')](_0x369d90,_0x2a55('0xbb'));}else{rpcDb[_0x2a55('0xbe')](ut[_0x2a55('0xbf')](_0x369d90,_0x2a55('0xb9'),_0x697267[_0x2a55('0xc0')]),_0x369d90[_0x2a55('0xb8')],_0x369d90[_0x2a55('0xc1')]);}}break;case'CONGESTION':_0x697267[_0x2a55('0xc2')]+=0x1;_0x369d90['countcongestionretry']+=0x1;_0x369d90['countglobal']=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0x8,_0x2a55('0xc3'));rpcDb[_0x2a55('0x8d')](_0x369d90,_0x2a55('0xc4'));if(ut[_0x2a55('0x9a')](_0x369d90)>=_0x697267[_0x2a55('0x9d')]){_0x8ca9ac=ut[_0x2a55('0x9e')](_0x369d90,0xf,_0x2a55('0x9f'));rpcDb[_0x2a55('0x90')](_0x8ca9ac,_0x2a55('0xc5'));}else{if(_0x369d90['countcongestionretry']>=_0x697267[_0x2a55('0xc6')]){rpcDb[_0x2a55('0x90')](_0x369d90,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x2a55('0xbe')](ut[_0x2a55('0xbf')](_0x369d90,_0x2a55('0xc7'),_0x697267[_0x2a55('0xb7')]),_0x369d90[_0x2a55('0xb8')],_0x369d90[_0x2a55('0xc1')]);}}break;case _0x2a55('0xc8'):_0x697267['outboundRejectCallsDay']+=0x1;_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut['logCustomer'](_0x369d90,0x14,'AgentReject');rpcDb[_0x2a55('0x8d')](_0x369d90,_0x2a55('0xc9'));if(_0x369d90[_0x2a55('0xb8')]){rpcDb[_0x2a55('0xca')](_0x369d90[_0x2a55('0xcb')]);}if(_0x369d90['activeContact']){rpcDb[_0x2a55('0xcc')](_0x369d90[_0x2a55('0xcb')]);}break;default:if(_0x369d90['dialAnswer']){ut['decrementTalkink'](_0x697267,_0x2a55('0xcd'));ut[_0x2a55('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x697267[_0x2a55('0x2a')],_0x4e4900);}_0x697267[_0x2a55('0x41')]+=0x1;_0x369d90[_0x2a55('0x99')]=ut[_0x2a55('0x9a')](_0x369d90);ut[_0x2a55('0x89')](_0x369d90,0xc,_0x4e4900[_0x2a55('0xce')]||_0x4e4900[_0x2a55('0xcf')]);rpcDb['createCustomerHistory'](_0x369d90,_0x2a55('0xd0'));if(ut[_0x2a55('0x9a')](_0x369d90)>=_0x697267[_0x2a55('0x9d')]){_0x8ca9ac=ut[_0x2a55('0x9e')](_0x369d90,0xf,'Global');rpcDb[_0x2a55('0x90')](_0x8ca9ac,_0x2a55('0xd1'));}else{rpcDb[_0x2a55('0x90')](_0x369d90,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x4e4900[_0x2a55('0xd2')]];}if(!(_0x369d90[_0x2a55('0x6f')]&&_0x53d756==='16')){ut[_0x2a55('0x77')](_0x697267,_0x2a55('0xd3'));logger[_0x2a55('0x6a')](_0x2a55('0xd4'),_0x369d90[_0x2a55('0xa5')],_0x2a55('0xa6'),_0x697267['name'],_0x2a55('0x6e'),_0x697267[_0x2a55('0x4d')]);}if(_0x53d756!==_0x2a55('0xa1')){delete this[_0x2a55('0x17')][_0x4e4900[_0x2a55('0xd2')]];delete this[_0x2a55('0x17')][_0x4e4900['destlinkedid']];}}};Preview[_0x2a55('0xf')][_0x2a55('0xd5')]=function(_0x52f777,_0x4dfdf0,_0x2252df){if(_[_0x2a55('0xd6')](_0x4dfdf0)&&_0x2a55('0xd7')!==typeof _0x4dfdf0){return;}if(_[_0x2a55('0xd6')](_0x2252df)&&'object'!==typeof _0x2252df){return;}switch(_0x2252df[_0x2a55('0xd8')]){case'0':ut['logAgent'](_0x52f777,0x0,_0x2a55('0x9b'));rpcDb['createAgentHistory'](_0x52f777,_0x2a55('0xd9'));break;case'3':ut[_0x2a55('0xda')](_0x52f777,0x3,_0x2a55('0xba'));rpcDb[_0x2a55('0xdb')](_0x52f777,_0x2a55('0xdc'));break;case'5':ut[_0x2a55('0xda')](_0x52f777,0x5,'Busy');rpcDb['createAgentHistory'](_0x52f777,_0x2a55('0xdd'));break;case'8':ut[_0x2a55('0xda')](_0x52f777,0x8,'Congestion');rpcDb['createAgentHistory'](_0x52f777,_0x2a55('0xde'));break;case'22':ut[_0x2a55('0xda')](_0x52f777,0x16,_0x2a55('0xdf'));rpcDb['createAgentHistory'](_0x52f777,_0x2a55('0xe0'));break;default:ut[_0x2a55('0xda')](_0x52f777,0xc,_0x2252df['reason']);rpcDb[_0x2a55('0xdb')](_0x52f777,'[callProgressDetectingAgent][logCongestion]');}ut[_0x2a55('0x77')](_0x4dfdf0,_0x2a55('0xe1'));logger[_0x2a55('0x6a')](_0x2a55('0xe2'),_0x52f777[_0x2a55('0xa5')],_0x2a55('0xa6'),_0x4dfdf0[_0x2a55('0x2a')],'originated:\x20',_0x4dfdf0[_0x2a55('0x4d')]);delete this['actions'][_0x52f777['uniqueid']];};Preview[_0x2a55('0xf')]['checkInBlack']=function(_0x480f88,_0x31ada6,_0xa4a3a1,_0x2561a2,_0x71050d){var _0x1d0bb1=this;return new BPromise(function(_0x531cfd,_0x10db42){if(_[_0x2a55('0x69')](_0x31ada6)||_[_0x2a55('0x69')](_0x31ada6[_0x2a55('0xe3')])||_[_0x2a55('0x69')](_0x31ada6[_0x2a55('0xe3')][_0x2a55('0xe4')])||_[_0x2a55('0x69')](_0x31ada6[_0x2a55('0xe5')])){_0x10db42(ut[_0x2a55('0x4c')](_0x2a55('0xe6'),_0x2561a2,_0x71050d));return;}var _0x4050e0=uuid['v4']();var _0x187dc3=_0x1d0bb1['campaignsPreview'][_0x31ada6['Queue'][_0x2a55('0x2a')]];var _0x463d52=_0xa4a3a1?_0x1d0bb1[_0x2a55('0x18')][_0xa4a3a1]['id']:undefined;_0x1d0bb1[_0x2a55('0x17')][_0x4050e0]=new Action(_0x31ada6,_0x187dc3,_0x4050e0,_0xa4a3a1,_0x463d52);var _0x5e31f9=_0x1d0bb1['actions'][_0x4050e0];_0x5e31f9['unlockAgent']=_0x2561a2;_0x5e31f9['activeContact']=_0x71050d;_0x5e31f9['lookAgent']=_0xa4a3a1;if(_[_0x2a55('0xe7')](_0x480f88)){_0x1d0bb1[_0x2a55('0xe8')](_0x5e31f9,_0x187dc3,_0x31ada6,_0xa4a3a1)[_0x2a55('0x81')](function(_0x1f43ff){logger['info']('[Preview][execCall][success]','Queue:\x20'+_0x5e31f9['queue']+_0x2a55('0xe9')+_0x5e31f9['idContact'],JSON[_0x2a55('0x57')](_0x1f43ff));ami[_0x2a55('0xa8')](_0x2a55('0xea'),ut[_0x2a55('0xeb')](_0x5e31f9,'called'));_0x531cfd(ut[_0x2a55('0x4c')](_0x2a55('0xec')));})[_0x2a55('0x75')](function(_0x1d3267){ut[_0x2a55('0x60')](_0x2a55('0xed'),_0x1d3267);_0x10db42(ut['message'](_0x2a55('0xee'),_0x2561a2,_0x71050d));});}else{_0x187dc3[_0x2a55('0xef')]+=0x1;ut[_0x2a55('0xf0')](_0x5e31f9);rpcDb[_0x2a55('0xf1')](_0x5e31f9,'[Blacklist][error]');delete _0x1d0bb1['actions'][_0x4050e0];_0x10db42(ut['message']('Contact\x20in\x20black\x20List',_0x2561a2,_0x71050d));}});};Preview[_0x2a55('0xf')][_0x2a55('0x95')]=function(_0x1058f6){return!_[_0x2a55('0x69')](_0x1058f6)&&!_[_0x2a55('0x69')](_0x1058f6[_0x2a55('0x2a')])&&!_[_0x2a55('0x69')](_0x1058f6['active'])&&_0x1058f6[_0x2a55('0x54')]&&!_['isNil'](this['trunks'][util['format'](_0x2a55('0xf2'),_0x1058f6['name'])])&&!_['isNil'](this[_0x2a55('0x16')][util['format'](_0x2a55('0xf2'),_0x1058f6[_0x2a55('0x2a')])]['status'])&&(this[_0x2a55('0x16')][util[_0x2a55('0x58')](_0x2a55('0xf2'),_0x1058f6[_0x2a55('0x2a')])][_0x2a55('0xf3')]===_0x2a55('0xf4')||this[_0x2a55('0x16')][util[_0x2a55('0x58')](_0x2a55('0xf2'),_0x1058f6[_0x2a55('0x2a')])]['status']==='unmonitored');};Preview[_0x2a55('0xf')][_0x2a55('0x84')]=function(_0x5effb3,_0x3a70cc){var _0x36791e=this;return new BPromise(function(_0x7e7061,_0x511c54){_0x36791e['execRun'](_0x5effb3,_0x3a70cc)[_0x2a55('0x81')](function(_0x162974){_0x7e7061(_['pick'](_0x162974,['message']));})['catch'](function(_0x588c9c){if(_0x588c9c[_0x2a55('0xf5')]){rpcDb[_0x2a55('0xca')](_0x5effb3);}if(_0x588c9c['active']){rpcDb[_0x2a55('0xcc')](_0x5effb3);}_0x511c54(_[_0x2a55('0xf6')](_0x588c9c,[_0x2a55('0x4c')]));});});};Preview[_0x2a55('0xf')][_0x2a55('0xf7')]=function(_0x4c4034,_0x12deb3){var _0x41564d=this;return new BPromise(function(_0x585481,_0x3be24c){var _0x322da8,_0x915a82;rpcDb[_0x2a55('0xf8')](_0x4c4034)[_0x2a55('0x81')](function(_0x1dc861){if(!_[_0x2a55('0x69')](_0x1dc861[0x0])){_0x915a82=_0x1dc861[0x0][_0x2a55('0xf9')]?![]:!![];_0x322da8=_0x1dc861[0x0][_0x2a55('0xf9')]?!![]:![];_0x322da8=_0x12deb3?!![]:_0x322da8;}var _0x16e75c=_0x41564d[_0x2a55('0xfa')](_0x1dc861);if(_0x16e75c[_0x2a55('0xfb')]){rpcDb[_0x2a55('0xfc')](_[_0x2a55('0xf6')](_0x1dc861[0x0],[_0x2a55('0xe5'),_0x2a55('0xfd')]))[_0x2a55('0x81')](function(_0x54a60d){_0x41564d[_0x2a55('0xfe')](_0x54a60d,_0x1dc861[0x0],_0x12deb3,_0x915a82,_0x322da8)[_0x2a55('0x81')](function(_0x324566){_0x585481(_0x324566);})['catch'](function(_0x1d45ba){_0x3be24c(_0x1d45ba);});})[_0x2a55('0x75')](function(_0x1623c4){ut[_0x2a55('0x60')](_0x2a55('0xff'),_0x1623c4);_0x3be24c(ut['message']('Call\x20unsuccessful',_0x915a82,_0x322da8));});}else{_0x3be24c(ut[_0x2a55('0x4c')](_0x16e75c['message'],_0x915a82,_0x322da8));}})[_0x2a55('0x75')](function(_0x1e862c){ut[_0x2a55('0x60')](_0x2a55('0x100'),_0x1e862c);_0x3be24c(ut[_0x2a55('0x4c')](_0x2a55('0x101'),![],!![]));});});};Preview[_0x2a55('0xf')][_0x2a55('0xfa')]=function(_0x57dc94){if(_[_0x2a55('0x69')](_0x57dc94)||_['isEmpty'](_0x57dc94)||!_['isNil'](_0x57dc94[0x0][_0x2a55('0x102')])&&_['isNil'](_0x57dc94[0x0][_0x2a55('0x102')]['name'])){ut[_0x2a55('0x60')](_0x2a55('0x103'),_0x57dc94);return{'isValid':![],'message':_0x2a55('0x104')};}var _0x27632a=this[_0x2a55('0x14')][_0x57dc94[0x0][_0x2a55('0x6c')][_0x2a55('0x2a')]];_0x27632a['message']=_0x2a55('0x97');if(_['isNil'](_0x27632a)){ut[_0x2a55('0x60')](_0x2a55('0x105'),_0x27632a);return{'isValid':![],'message':_0x2a55('0x106')};}if(!this['isTrunkReachable'](_0x27632a['Trunk'])){ut[_0x2a55('0x60')](_0x2a55('0x107'),_0x2a55('0x108')+_0x27632a[_0x2a55('0x2a')]+_0x2a55('0x109'));if(!this[_0x2a55('0x95')](_0x27632a[_0x2a55('0x96')])){ut[_0x2a55('0x60')](_0x2a55('0x107'),_0x27632a['name']+_0x2a55('0x10a'));return{'isValid':![],'message':_0x2a55('0x10b')};}}if(!ut['isActive'](_0x27632a[_0x2a55('0x33')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x27632a[_0x2a55('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x27632a[_0x2a55('0x2a')]+_0x2a55('0x10c')};}return{'isValid':!![],'message':_0x2a55('0x10d')};};Preview['prototype']['execCall']=function(_0x1ba3ef,_0x4dd55b,_0x1a2f0e,_0x323328){var _0x4fe962=this;return new BPromise(function(_0x30881f,_0x19b2bd){var _0x5bc012=_0x1ba3ef[_0x2a55('0xa5')];var _0x216c50=_0x4fe962[_0x2a55('0x95')](_0x4dd55b[_0x2a55('0x53')])?util[_0x2a55('0x58')]('SIP/%s/%s%s',_0x4dd55b[_0x2a55('0x53')][_0x2a55('0x2a')],_[_0x2a55('0x69')](_0x4dd55b[_0x2a55('0x10e')])?'':_0x4dd55b[_0x2a55('0x10e')][_0x2a55('0x10f')]()||'',_0x4dd55b['dialCutDigit']>0x0?_0x1a2f0e['Contact']['phone'][_0x2a55('0x110')](_0x4dd55b[_0x2a55('0x111')]):_0x1a2f0e['Contact']['phone']):util[_0x2a55('0x58')](_0x2a55('0x112'),_[_0x2a55('0x69')](_0x4dd55b[_0x2a55('0x96')])?_0x4dd55b[_0x2a55('0x53')]['name']:_0x4dd55b[_0x2a55('0x96')][_0x2a55('0x2a')],_[_0x2a55('0x69')](_0x4dd55b[_0x2a55('0x10e')])?'':_0x4dd55b['dialPrefix'][_0x2a55('0x10f')]()||'',_0x4dd55b[_0x2a55('0x111')]>0x0?_0x1a2f0e[_0x2a55('0xe3')][_0x2a55('0xe4')][_0x2a55('0x110')](_0x4dd55b[_0x2a55('0x111')]):_0x1a2f0e[_0x2a55('0xe3')][_0x2a55('0xe4')]);var _0x47d984=_0x4fe962[_0x2a55('0x95')](_0x4dd55b[_0x2a55('0x53')])?ut[_0x2a55('0x113')](_0x4dd55b[_0x2a55('0x53')][_0x2a55('0x55')],_0x4dd55b[_0x2a55('0x35')],_0x4dd55b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x2a55('0x114')](_0x4dd55b[_0x2a55('0x115')],_0x4dd55b['dialRandomLastDigitCallerIdNumber']):_0x4dd55b[_0x2a55('0x115')]):ut[_0x2a55('0x113')](_[_0x2a55('0x69')](_0x4dd55b[_0x2a55('0x96')])?_0x4dd55b[_0x2a55('0x53')][_0x2a55('0x55')]:_0x4dd55b[_0x2a55('0x96')][_0x2a55('0x55')],_0x4dd55b[_0x2a55('0x35')],_0x4dd55b['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4dd55b['dialOriginateCallerIdNumber'],_0x4dd55b['dialRandomLastDigitCallerIdNumber']):_0x4dd55b[_0x2a55('0x115')]);if(_0x47d984){_0x1ba3ef['originatecalleridname']=ut[_0x2a55('0x116')](_0x47d984);_0x1ba3ef[_0x2a55('0x117')]=ut[_0x2a55('0x118')](_0x47d984);}var _0x4052eb=ut['addVariables'](_0x4dd55b,_0x1a2f0e,_0x216c50,_0x47d984,_0x5bc012,_0x1ba3ef);_[_0x2a55('0x119')](_0x1ba3ef,ut[_0x2a55('0x11a')](_0x4052eb));_0x1ba3ef[_0x2a55('0x87')]=moment()[_0x2a55('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x2a55('0x73')](ut[_0x2a55('0x11b')](_0x1ba3ef,_0x4dd55b,_0x4052eb,_0x1ba3ef[_0x2a55('0xc1')],_0x323328))[_0x2a55('0x81')](function(_0x4f83ab){_0x4dd55b['originated']+=0x1;logger[_0x2a55('0x6a')]('[originated][increment]',_0x5bc012,'\x20Queue',_0x4dd55b[_0x2a55('0x2a')],_0x2a55('0x6e'),_0x4dd55b[_0x2a55('0x4d')]);_0x30881f(_0x4f83ab);})['catch'](function(_0x1a0a88){ut[_0x2a55('0xda')](_0x1ba3ef,0xe,'OriginateError');rpcDb[_0x2a55('0xdb')](_0x1ba3ef,'[originateFailure][logOriginateFailure]');_0x19b2bd(_0x1a0a88);});});};Preview[_0x2a55('0xf')][_0x2a55('0x22')]=function(_0x5639b8){if(this[_0x2a55('0x17')][_0x5639b8['linkedid']]){this[_0x2a55('0x17')][_0x5639b8[_0x2a55('0xd2')]][_0x2a55('0x74')]=_0x5639b8[_0x2a55('0x74')];}};Preview['prototype'][_0x2a55('0x1b')]=function(_0x316fdd){var _0x18f785=this;var _0x54f100=this[_0x2a55('0x17')][_0x316fdd[_0x2a55('0x11c')]];if(_0x54f100){if(_0x54f100[_0x2a55('0x11d')]&&this[_0x2a55('0x18')][_0x54f100[_0x2a55('0x11d')]]){ut['logLookAgent'](_0x54f100,this[_0x2a55('0x18')][_0x54f100[_0x2a55('0x11d')]][_0x2a55('0x2a')],this[_0x2a55('0x18')][_0x54f100[_0x2a55('0x11d')]]['id']);}var _0x5bc01e=_[_0x2a55('0x11e')](_0x54f100);_0x5bc01e[_0x2a55('0xa2')]=moment()[_0x2a55('0x58')](_0x2a55('0x88'));var _0x12048f=_0x18f785[_0x2a55('0x14')][_0x54f100[_0x2a55('0x6d')]];if(ut[_0x2a55('0x11f')](_0x316fdd[_0x2a55('0x120')])){if(_0x54f100[_0x2a55('0xb8')]){rpcDb[_0x2a55('0xca')](_0x54f100[_0x2a55('0xcb')]);}if(_0x54f100[_0x2a55('0xc1')]){rpcDb[_0x2a55('0xcc')](_0x54f100[_0x2a55('0xcb')]);}ami[_0x2a55('0xa8')](_0x2a55('0x121'),ut[_0x2a55('0xeb')](_0x54f100,_0x2a55('0x122')));this[_0x2a55('0xd5')](_0x5bc01e,_0x12048f,_0x316fdd);}else{_0x54f100[_0x2a55('0x87')]=moment()[_0x2a55('0x58')](_0x2a55('0x88'));ut[_0x2a55('0xda')](_0x5bc01e,0x4,'Answer');rpcDb['createAgentHistory'](_0x5bc01e,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x2a55('0xf')][_0x2a55('0x1d')]=function(_0x8d88e8){var _0x33cbd4=this;var _0x33ef6a=this[_0x2a55('0x17')][_0x8d88e8[_0x2a55('0xd2')]];var _0x39fb5f;if(_0x33ef6a){_0x39fb5f=this[_0x2a55('0x14')][_0x33ef6a[_0x2a55('0x6d')]];logger[_0x2a55('0x6a')](_0x2a55('0x123'),_0x8d88e8[_0x2a55('0xd2')],_0x2a55('0xa6'),_0x39fb5f[_0x2a55('0x2a')],_0x2a55('0xa7'),_0x39fb5f[_0x2a55('0x2c')]);}if(this[_0x2a55('0x17')][_0x8d88e8[_0x2a55('0xd2')]]&&_0x8d88e8[_0x2a55('0xd2')]!==_0x8d88e8[_0x2a55('0xa5')]){if(_0x8d88e8['cause']==='16'&&this[_0x2a55('0x17')][_0x8d88e8[_0x2a55('0xd2')]][_0x2a55('0x6f')]){this['callProgressDetectingCustomer'](_0x8d88e8,_0x8d88e8[_0x2a55('0xd2')],_0x8d88e8[_0x2a55('0x124')]);}else if(this[_0x2a55('0x17')][_0x8d88e8['linkedid']][_0x2a55('0x6f')]){logger[_0x2a55('0x6a')](_0x2a55('0x125'),_0x8d88e8['linkedid'],_0x8d88e8[_0x2a55('0x124')],'\x20Queue',_0x39fb5f[_0x2a55('0x2a')],_0x2a55('0xa7'),_0x39fb5f[_0x2a55('0x2c')]);this[_0x2a55('0x98')](_0x8d88e8,_0x8d88e8[_0x2a55('0xd2')],_0x8d88e8[_0x2a55('0x124')]);}}else if(_0x33ef6a&&_[_0x2a55('0x69')](_0x33ef6a[_0x2a55('0x126')])&&_0x39fb5f[_0x2a55('0x127')]&&_0x8d88e8[_0x2a55('0xd2')]===_0x8d88e8['uniqueid']&&_[_0x2a55('0x69')](_0x8d88e8[_0x2a55('0xd8')])&&_0x8d88e8[_0x2a55('0x124')]==='16'&&_0x8d88e8[_0x2a55('0x128')]==='6'&&_[_0x2a55('0xd6')](_0x33ef6a[_0x2a55('0x129')])){if(_0x33ef6a['unlockAgent']){rpcDb['unlockContact'](_0x33ef6a[_0x2a55('0xcb')]);}if(_0x33ef6a['activeContact']){rpcDb[_0x2a55('0xcc')](_0x33ef6a[_0x2a55('0xcb')]);}_0x8d88e8[_0x2a55('0xd8')]='22';this[_0x2a55('0xd5')](_0x33ef6a,_0x39fb5f,_0x8d88e8);}else if(_0x33ef6a&&_0x33ef6a[_0x2a55('0x129')]){if(_0x8d88e8[_0x2a55('0x124')]==='16'&&this[_0x2a55('0x17')][_0x8d88e8[_0x2a55('0xd2')]][_0x2a55('0x6f')]){logger[_0x2a55('0x6a')]('[syncHangup][talking][transfer]',_0x8d88e8['linkedid'],_0x8d88e8[_0x2a55('0x124')],'\x20Queue',_0x39fb5f['name'],'pTalking:\x20',_0x39fb5f[_0x2a55('0x2c')]);this[_0x2a55('0x98')](_0x8d88e8,_0x8d88e8['linkedid'],_0x8d88e8[_0x2a55('0x124')]);}else if(this[_0x2a55('0x17')][_0x8d88e8[_0x2a55('0xd2')]][_0x2a55('0x6f')]){logger[_0x2a55('0x6a')]('[syncHangup][talking][cause]',_0x8d88e8[_0x2a55('0xd2')],_0x8d88e8['cause'],_0x2a55('0xa6'),_0x39fb5f[_0x2a55('0x2a')],_0x2a55('0xa7'),_0x39fb5f[_0x2a55('0x2c')]);this[_0x2a55('0x98')](_0x8d88e8,_0x8d88e8[_0x2a55('0xd2')],_0x8d88e8['cause']);}}};Preview['prototype'][_0x2a55('0x21')]=function(_0x124d6e){if(this['actions'][_0x124d6e['destlinkedid']]&&_0x124d6e['destlinkedid']!==_0x124d6e[_0x2a55('0x12a')]){this[_0x2a55('0x98')](_0x124d6e,_0x124d6e[_0x2a55('0x12b')],_0x124d6e['dialstatus']);}};Preview[_0x2a55('0xf')]['syncHangupRequest']=function(_0x208e52){if(this[_0x2a55('0x17')][_0x208e52[_0x2a55('0xd2')]]&&_0x208e52[_0x2a55('0xd2')]!==_0x208e52['uniqueid']&&!this[_0x2a55('0x17')][_0x208e52[_0x2a55('0xd2')]][_0x2a55('0x6f')]){if(_0x208e52[_0x2a55('0x124')]==='1'){this['callProgressDetectingCustomer'](_0x208e52,_0x208e52[_0x2a55('0xd2')],_0x208e52[_0x2a55('0x124')]);}}};Preview[_0x2a55('0xf')][_0x2a55('0x12c')]=function(_0x227ecc,_0x546c63,_0x129874){if(this[_0x2a55('0x17')][_0x227ecc]){if(_[_0x2a55('0x69')](this['actions'][_0x227ecc]['variables'])){this[_0x2a55('0x17')][_0x227ecc][_0x2a55('0x12d')]={};}this[_0x2a55('0x17')][_0x227ecc][_0x2a55('0x12d')][_0x546c63]=_0x129874;}};Preview[_0x2a55('0xf')][_0x2a55('0x23')]=function(_0x3d6529){try{if(!_['isNil'](_0x3d6529)){if(ut['filterKey'](_[_0x2a55('0x12e')](_0x3d6529['variable'])[0x0])){this['addVariable'](_0x3d6529[_0x2a55('0xa5')],_[_0x2a55('0x12e')](_0x3d6529[_0x2a55('0x12f')])[0x0],_0x3d6529[_0x2a55('0x130')]);}}}catch(_0x4fca6f){logger[_0x2a55('0x131')]('[syncVarSet][Preview]',util[_0x2a55('0x132')](_0x4fca6f,{'showHidden':![],'depth':null}));}};Preview[_0x2a55('0xf')][_0x2a55('0x133')]=function(_0x1dd4d2){if(_0x1dd4d2){if(this[_0x2a55('0x17')][_0x1dd4d2[_0x2a55('0x134')]]){this['actions'][_0x1dd4d2[_0x2a55('0x134')]][_0x2a55('0x129')]=!![];}}};Preview[_0x2a55('0xf')][_0x2a55('0x26')]=function(_0x134018){if(_0x134018){if(this[_0x2a55('0x17')][_0x134018[_0x2a55('0x135')]]){this[_0x2a55('0x17')][_0x134018[_0x2a55('0x135')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a2c0c9d..227007c 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 _0xd109=['COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason'];(function(_0x1d3ce8,_0x2775e4){var _0x483045=function(_0x1f9dc6){while(--_0x1f9dc6){_0x1d3ce8['push'](_0x1d3ce8['shift']());}};_0x483045(++_0x2775e4);}(_0xd109,0x1da));var _0x9d10=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xd109[_0x49b207];return _0x2dc8fa;};'use strict';var util=require(_0x9d10('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x9d10('0x1'));var cmHopper=require(_0x9d10('0x2'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x9d10('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x9d10('0x4'));function loggerCatch(_0x5cddb1){return function(_0x3da241){logger[_0x9d10('0x5')](_0x5cddb1,util['inspect'](_0x3da241,{'showHidden':![],'depth':null}));};}function create(_0x6ac5d){return BPromise[_0x9d10('0x6')]()[_0x9d10('0x7')](cmHopperHistory[_0x9d10('0x8')](_0x6ac5d))[_0x9d10('0x9')](loggerCatch(_0x9d10('0xa')));}function createAgent(_0x47086f){return BPromise['resolve']()['then'](agentReportPreview[_0x9d10('0x8')](_0x47086f))[_0x9d10('0x9')](loggerCatch(_0x9d10('0xa')));}function moveContact(_0xeb3ccb){return BPromise[_0x9d10('0x6')]()[_0x9d10('0x7')](cmHopper['moveContactManagedDialer'](_0xeb3ccb,!![]))[_0x9d10('0x9')](loggerCatch(_0x9d10('0xb')));}exports['checkIsBlackList']=function(_0x55679e){return BPromise[_0x9d10('0x6')]()[_0x9d10('0x7')](cmHopperBlack[_0x9d10('0xc')](_0x55679e))['catch'](loggerCatch(_0x9d10('0xd')));};exports[_0x9d10('0xe')]=function(_0xe5f48c){return BPromise[_0x9d10('0x6')]()['then'](cmHopper[_0x9d10('0xe')](_0xe5f48c))[_0x9d10('0x9')](loggerCatch(_0x9d10('0xf')));};exports[_0x9d10('0x8')]=function(_0x25b525,_0x225b39){create(_0x25b525)[_0x9d10('0x9')](loggerCatch(_0x225b39));moveContact(_0x25b525)[_0x9d10('0x9')](loggerCatch(_0x225b39));};exports[_0x9d10('0x10')]=function(_0x421947,_0x2f36c6){createAgent(_0x421947)[_0x9d10('0x9')](loggerCatch(_0x2f36c6));};exports[_0x9d10('0x11')]=function(_0x5e0bd4,_0x5a8c38){create(_0x5e0bd4)[_0x9d10('0x9')](loggerCatch(_0x5a8c38));};exports['createCustomerFinal']=function(_0x178342,_0xf53aa9){moveContact(_0x178342)['catch'](loggerCatch(_0xf53aa9));};exports[_0x9d10('0x12')]=function(_0x2c5841,_0x251af3,_0x2e95b2){if(_0x251af3){_0x2c5841[_0x9d10('0x13')]=null;}if(_0x2e95b2){_0x2c5841[_0x9d10('0x14')]=![];}return BPromise['resolve']()[_0x9d10('0x7')](cmHopper[_0x9d10('0x12')](_0x2c5841))[_0x9d10('0x9')](loggerCatch(_0x9d10('0x15')));};exports[_0x9d10('0x16')]=function(_0x9639ff){return BPromise[_0x9d10('0x6')]()[_0x9d10('0x7')](cmHopper[_0x9d10('0x16')](_0x9639ff))[_0x9d10('0x9')](loggerCatch('[countReScheduled]\x20'));};exports[_0x9d10('0x17')]=function(_0x43511b){return BPromise['resolve']()[_0x9d10('0x7')](cmHopper[_0x9d10('0x17')]({'UserId':null},_0x43511b,0x1))['catch'](loggerCatch(_0x9d10('0x18')));};exports[_0x9d10('0x19')]=function(_0x27eff1){return BPromise[_0x9d10('0x6')]()[_0x9d10('0x7')](cmHopper[_0x9d10('0x17')]({'active':![]},_0x27eff1,0x1))[_0x9d10('0x9')](loggerCatch(_0x9d10('0x1a')));};exports[_0x9d10('0x1b')]=function(_0x3faf6b){var _0x32f024={};_0x32f024[_0x9d10('0x1c')]=_0x3faf6b[_0x9d10('0x1c')];_0x32f024[_0x9d10('0x1d')]=_0x3faf6b[_0x9d10('0x1d')];_0x32f024['calleridnum']=_0x3faf6b[_0x9d10('0x1e')];_0x32f024['calleridname']=_0x3faf6b[_0x9d10('0x1f')];_0x32f024[_0x9d10('0x20')]=_0x3faf6b['queue'];_0x32f024[_0x9d10('0x21')]=_0x3faf6b[_0x9d10('0x22')];_0x32f024[_0x9d10('0x23')]=_0x3faf6b[_0x9d10('0x22')];_0x32f024[_0x9d10('0x24')]=0x1;_0x32f024['queuecallercompleteAt']=_0x3faf6b[_0x9d10('0x25')];_0x32f024[_0x9d10('0x26')]=_0x3faf6b['membername'];_0x32f024[_0x9d10('0x27')]=_0x9d10('0x28');_0x32f024[_0x9d10('0x29')]=_0x9d10('0x2a');_0x32f024['holdtime']=0x0;_0x32f024[_0x9d10('0x2b')]=0x1;_0x32f024[_0x9d10('0x2c')]=_0x3faf6b['membername'];_0x32f024[_0x9d10('0x2d')]=_0x9d10('0x2e');return BPromise['resolve']()['then'](voiceQueueReport[_0x9d10('0x2f')](_0x32f024))[_0x9d10('0x9')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x9d10('0x30')]=function(_0x73c689,_0x5483f7){return BPromise['resolve']()[_0x9d10('0x7')](cmHopper['getContactRecallMe'](_0x73c689,_0x5483f7))[_0x9d10('0x9')](loggerCatch(_0x9d10('0x31')));};exports[_0x9d10('0x32')]=function(_0x263987){return BPromise['resolve']()[_0x9d10('0x7')](cmHopper[_0x9d10('0x12')](_0x263987,!![],!![]))[_0x9d10('0x9')](loggerCatch(_0x9d10('0x33')));}; \ No newline at end of file +var _0x626a=['then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','holdtime','assigned','lastAssignedTo','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20'];(function(_0x11d161,_0x34e5b8){var _0x17eaec=function(_0x3b1525){while(--_0x3b1525){_0x11d161['push'](_0x11d161['shift']());}};_0x17eaec(++_0x34e5b8);}(_0x626a,0x160));var _0xa626=function(_0x153e5a,_0x63415){_0x153e5a=_0x153e5a-0x0;var _0x47153e=_0x626a[_0x153e5a];return _0x47153e;};'use strict';var util=require(_0xa626('0x0'));var BPromise=require(_0xa626('0x1'));var logger=require(_0xa626('0x2'))('preview');var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xa626('0x3'));var voiceQueueRt=require(_0xa626('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xa626('0x5'));function loggerCatch(_0x4b8280){return function(_0x3d6480){logger[_0xa626('0x6')](_0x4b8280,util[_0xa626('0x7')](_0x3d6480,{'showHidden':![],'depth':null}));};}function create(_0x2917b6){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x2917b6))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x10d086){return BPromise[_0xa626('0x8')]()['then'](agentReportPreview[_0xa626('0x9')](_0x10d086))[_0xa626('0xa')](loggerCatch(_0xa626('0xb')));}function moveContact(_0x637ea0){return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](cmHopper[_0xa626('0xd')](_0x637ea0,!![]))[_0xa626('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x53b26b){return BPromise['resolve']()[_0xa626('0xc')](cmHopperBlack[_0xa626('0xe')](_0x53b26b))[_0xa626('0xa')](loggerCatch(_0xa626('0xf')));};exports[_0xa626('0x10')]=function(_0x1a6477){return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](cmHopper[_0xa626('0x10')](_0x1a6477))[_0xa626('0xa')](loggerCatch(_0xa626('0x11')));};exports[_0xa626('0x9')]=function(_0x4bac4b,_0x4a699b){create(_0x4bac4b)['catch'](loggerCatch(_0x4a699b));moveContact(_0x4bac4b)[_0xa626('0xa')](loggerCatch(_0x4a699b));};exports[_0xa626('0x12')]=function(_0x2238e4,_0x370c6f){createAgent(_0x2238e4)['catch'](loggerCatch(_0x370c6f));};exports[_0xa626('0x13')]=function(_0x366b3b,_0x30dfec){create(_0x366b3b)['catch'](loggerCatch(_0x30dfec));};exports[_0xa626('0x14')]=function(_0x2a97ce,_0x62a8ca){moveContact(_0x2a97ce)[_0xa626('0xa')](loggerCatch(_0x62a8ca));};exports[_0xa626('0x15')]=function(_0x6aeb64,_0x190399,_0x5782b3){if(_0x190399){_0x6aeb64[_0xa626('0x16')]=null;}if(_0x5782b3){_0x6aeb64[_0xa626('0x17')]=![];}return BPromise[_0xa626('0x8')]()['then'](cmHopper[_0xa626('0x15')](_0x6aeb64))[_0xa626('0xa')](loggerCatch(_0xa626('0x18')));};exports[_0xa626('0x19')]=function(_0xec685c){return BPromise[_0xa626('0x8')]()['then'](cmHopper[_0xa626('0x19')](_0xec685c))['catch'](loggerCatch(_0xa626('0x1a')));};exports[_0xa626('0x1b')]=function(_0x4b7919){return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](cmHopper['unlockContact']({'UserId':null},_0x4b7919,0x1))[_0xa626('0xa')](loggerCatch(_0xa626('0x1c')));};exports[_0xa626('0x1d')]=function(_0xcc52fc){return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](cmHopper[_0xa626('0x1b')]({'active':![]},_0xcc52fc,0x1))[_0xa626('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0xa626('0x1e')]=function(_0x413b21){var _0x236e53={};_0x236e53[_0xa626('0x1f')]=_0x413b21['type'];_0x236e53[_0xa626('0x20')]=_0x413b21['uniqueid'];_0x236e53[_0xa626('0x21')]=_0x413b21[_0xa626('0x21')];_0x236e53[_0xa626('0x22')]=_0x413b21[_0xa626('0x22')];_0x236e53['queue']=_0x413b21[_0xa626('0x23')];_0x236e53[_0xa626('0x24')]=_0x413b21[_0xa626('0x25')];_0x236e53['queuecallerleaveAt']=_0x413b21[_0xa626('0x25')];_0x236e53[_0xa626('0x26')]=0x1;_0x236e53[_0xa626('0x27')]=_0x413b21[_0xa626('0x28')];_0x236e53[_0xa626('0x29')]=_0x413b21[_0xa626('0x2a')];_0x236e53[_0xa626('0x2b')]='from-sip';_0x236e53['exten']='xcally-motion-preview';_0x236e53[_0xa626('0x2c')]=0x0;_0x236e53[_0xa626('0x2d')]=0x1;_0x236e53[_0xa626('0x2e')]=_0x413b21['membername'];_0x236e53['queuecallerexitreason']=_0xa626('0x2f');return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](voiceQueueReport['create'](_0x236e53))[_0xa626('0xa')](loggerCatch(_0xa626('0x30')));};exports[_0xa626('0x31')]=function(_0x17a872,_0xcd53a4){return BPromise[_0xa626('0x8')]()['then'](cmHopper[_0xa626('0x31')](_0x17a872,_0xcd53a4))[_0xa626('0xa')](loggerCatch(_0xa626('0x32')));};exports['rescheduleContactInQueue']=function(_0x259c5c){return BPromise[_0xa626('0x8')]()[_0xa626('0xc')](cmHopper[_0xa626('0x15')](_0x259c5c,!![],!![]))[_0xa626('0xa')](loggerCatch(_0xa626('0x33')));}; \ 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 e014331..fbf2e29 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 _0xb3a0=['loggerCatch','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','XMD-','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','extractCalleridNumber','match','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds'];(function(_0x399077,_0x549ab7){var _0x5bfeae=function(_0x4505d1){while(--_0x4505d1){_0x399077['push'](_0x399077['shift']());}};_0x5bfeae(++_0x549ab7);}(_0xb3a0,0x190));var _0x0b3a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb3a0[_0x1facfa];return _0x9ec701;};'use strict';var util=require('util');var _=require(_0x0b3a('0x0'));var moment=require('moment');var logger=require(_0x0b3a('0x1'))('preview');var ipAgi=process[_0x0b3a('0x2')][_0x0b3a('0x3')]||_0x0b3a('0x4');function getSeconds(_0x1c7f05,_0x3b023a){var _0x1e05c0=moment(_0x1c7f05)[_0x0b3a('0x5')](0x0);var _0x1866b1=moment(_0x3b023a)[_0x0b3a('0x5')](0x0);return _0x1e05c0[_0x0b3a('0x6')](_0x1866b1,_0x0b3a('0x7'));}exports[_0x0b3a('0x8')]=function(_0x19d0da){return function(_0x4bf460){logger[_0x0b3a('0x9')](_0x19d0da,util[_0x0b3a('0xa')](_0x4bf460,{'showHidden':![],'depth':null}));};};exports[_0x0b3a('0xb')]=function(_0x43d5e8,_0x5a372e){logger['info'](_0x43d5e8,util[_0x0b3a('0xa')](_0x5a372e,{'showHidden':![],'depth':null}));};exports[_0x0b3a('0xc')]=function(_0x2c6c38,_0x5a9f97){logger['error'](_0x2c6c38,util['inspect'](_0x5a9f97,{'showHidden':![],'depth':null}));};exports[_0x0b3a('0xd')]=function(_0x511da0){return function(_0x428c83){logger[_0x0b3a('0xe')](_0x511da0,util['inspect'](_0x428c83,{'showHidden':![],'depth':null}));};};exports[_0x0b3a('0xf')]=function(_0x534e1f,_0x2464d9,_0x112c17){return{'message':_0x534e1f,'unlock':_0x2464d9,'active':_0x112c17};};exports[_0x0b3a('0x10')]=function(_0x5a82fe,_0x142732,_0x138f90){if(!_[_0x0b3a('0x11')](_0x138f90)&&_0x0b3a('0x12')===typeof _0x138f90&&!_[_0x0b3a('0x13')](_0x138f90)){if(!_['isUndefined'](_0x142732)&&_0x0b3a('0x12')===typeof _0x142732&&!_['isEmpty'](_0x142732)){return util[_0x0b3a('0x14')](_0x0b3a('0x15'),_0x142732,_0x138f90);}return util[_0x0b3a('0x14')](_0x0b3a('0x15'),_0x138f90,_0x138f90);}if(!_['isUndefined'](_0x5a82fe)&&'string'===typeof _0x5a82fe&&!_[_0x0b3a('0x13')](_0x5a82fe)){return _0x5a82fe;}return _0x0b3a('0x16');};exports['isActive']=function(_0x20a5ca){if(_[_0x0b3a('0x17')](_0x20a5ca)){return![];}return _0x20a5ca;};exports[_0x0b3a('0x18')]=function(_0x545e33,_0x276b19,_0x320f9e,_0x355390,_0x2453d2,_0x5c5c8a){var _0x4a731d={'XMD-QUEUE':_0x276b19[_0x0b3a('0x19')]?_0x276b19[_0x0b3a('0x19')][_0x0b3a('0x1a')]:'','XMD-CALLERID':_0x355390,'XMD-CALLERID-PREVIEW':_0x5c5c8a?util['format'](_0x0b3a('0x15'),_0x5c5c8a['calleridname'],_0x5c5c8a['calleridnum']):_0x355390,'XMD-DIALID':_0x2453d2,'XMD-CONTACTID':_0x276b19[_0x0b3a('0x1b')],'XMD-CDRTYPE':_0x0b3a('0x1c'),'CALLERID(all)':_0x355390,'XMD-VOICEQUEUEID':_0x276b19[_0x0b3a('0x1d')],'XMD-DIALCHANNEL':_0x320f9e,'XMD-DIALTIMEOUT':_0x545e33[_0x0b3a('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x0b3a('0x14')]('\x22rtTxX%s%s\x22',_0x545e33[_0x0b3a('0x1f')]?'g':'',_[_0x0b3a('0x13')](_0x545e33['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x545e33[_0x0b3a('0x20')]||'','XMD-AGI':_0x545e33['dialQueueProject']?util[_0x0b3a('0x14')](_0x0b3a('0x21'),ipAgi,_0x545e33['dialQueueProject']):_0x0b3a('0x22'),'XMD-AGIAFTER':_0x545e33[_0x0b3a('0x1f')]?util[_0x0b3a('0x14')](_0x0b3a('0x21'),ipAgi,_0x545e33[_0x0b3a('0x1f')]):_0x0b3a('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x5c5c8a?_0x5c5c8a[_0x0b3a('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x5c5c8a?_0x5c5c8a['originatecalleridname']:'','XMD-DESTINATION':_0x0b3a('0x24')};if(!_['isEmpty'](_0x545e33[_0x0b3a('0x25')])){_0x4a731d[util[_0x0b3a('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x545e33[_0x0b3a('0x25')];_0x4a731d[util[_0x0b3a('0x14')]('%s',_0x0b3a('0x26'))]=_0x2453d2;}if(_0x276b19&&_0x276b19['Contact']){for(var _0x591d9d in _0x276b19['Contact']){if(_0x276b19[_0x0b3a('0x27')]['hasOwnProperty'](_0x591d9d)){if(!_['isNil'](_0x276b19[_0x0b3a('0x27')][_0x591d9d])&&_0x591d9d!=='id'&&_0x591d9d!==_0x0b3a('0x28')&&_0x591d9d!==_0x0b3a('0x29')&&_0x591d9d!==_0x0b3a('0x2a')){_0x4a731d[util['format']('%s%s',_0x0b3a('0x2b'),_['toUpper'](_0x591d9d))]=_0x276b19['Contact'][_0x591d9d];}}}}return _0x4a731d;};exports[_0x0b3a('0x2c')]=function(_0x55ec6f){var _0x2cbaaf={};for(var _0x5db573 in _0x55ec6f){if(_0x55ec6f[_0x0b3a('0x2d')](_0x5db573)){_0x2cbaaf[util[_0x0b3a('0x14')]('%s',_['toLower'](_0x5db573))]=_0x55ec6f[_0x5db573];}}return{'variables':_0x2cbaaf};};exports[_0x0b3a('0x2e')]=function(_0x290486,_0x3c4583){if(!_[_0x0b3a('0x17')](_0x290486)){if(_0x290486[_0x0b3a('0x2d')](_0x0b3a('0x2f'))){if(_0x290486[_0x0b3a('0x2f')]>0x0){_0x290486[_0x0b3a('0x2f')]-=0x1;}else{logger[_0x0b3a('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3c4583);}}}else{logger[_0x0b3a('0x9')](_0x0b3a('0x30'),_0x3c4583);}};exports[_0x0b3a('0x31')]=function(_0x2c97d6){var _0x18799e=moment()[_0x0b3a('0x14')](_0x0b3a('0x32'));_0x2c97d6[_0x0b3a('0x33')]=0xd;_0x2c97d6['statedesc']=_0x0b3a('0x34');_0x2c97d6[_0x0b3a('0x35')]=_0x18799e;_0x2c97d6[_0x0b3a('0x36')]=_0x18799e;_0x2c97d6[_0x0b3a('0x37')]=_0x18799e;};exports[_0x0b3a('0x38')]=function(_0x3d175c,_0x4a3e6a,_0x2ba566){var _0x725636=moment()[_0x0b3a('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d175c[_0x0b3a('0x33')]=_0x4a3e6a;_0x3d175c[_0x0b3a('0x39')]=_0x2ba566;_0x3d175c[_0x0b3a('0x36')]=_0x725636;_0x3d175c['ringtime']=getSeconds(_0x3d175c[_0x0b3a('0x36')],_0x3d175c[_0x0b3a('0x35')]);};exports[_0x0b3a('0x3a')]=function(_0x1706df,_0x4cdd58,_0x495dd0){_0x1706df[_0x0b3a('0x3b')]=_0x4cdd58;_0x1706df[_0x0b3a('0x3c')]=_0x495dd0;};exports[_0x0b3a('0x3d')]=function(_0x1a42ad,_0xaf5f73,_0x634fe7){var _0xe34860=moment()[_0x0b3a('0x14')](_0x0b3a('0x32'));_0x1a42ad[_0x0b3a('0x33')]=_0xaf5f73;_0x1a42ad[_0x0b3a('0x39')]=_0x634fe7;_0x1a42ad['responsetime']=_0x1a42ad['responsetime']?_0x1a42ad[_0x0b3a('0x36')]:_0xe34860;_0x1a42ad[_0x0b3a('0x37')]=_0x1a42ad['endtime']?_0x1a42ad[_0x0b3a('0x37')]:_0xe34860;_0x1a42ad[_0x0b3a('0x3e')]=getSeconds(_0x1a42ad[_0x0b3a('0x36')]||0x0,_0x1a42ad[_0x0b3a('0x35')]||0x0);_0x1a42ad[_0x0b3a('0x3f')]=_0x1a42ad[_0x0b3a('0x40')]?getSeconds(_0x1a42ad[_0x0b3a('0x37')],_0x1a42ad[_0x0b3a('0x40')]):0x0;};exports[_0x0b3a('0x41')]=function(_0x561e6e){return _0x561e6e===_0x0b3a('0x42');};exports[_0x0b3a('0x43')]=function(_0x138228,_0x450813,_0x350179,_0x5c34b6,_0x10178d){var _0x2de40b=_0x5c34b6?_0x0b3a('0x44'):_0x138228[_0x0b3a('0x45')];_0x2de40b=_0x10178d?_0x0b3a('0x46'):_0x2de40b;return{'actionid':_0x138228[_0x0b3a('0x47')],'action':'originate','channel':_0x138228[_0x0b3a('0x48')],'callerid':util[_0x0b3a('0x14')](_0x0b3a('0x15'),_0x2de40b,_0x138228[_0x0b3a('0x49')]),'Exten':_0x0b3a('0x24'),'Context':'from-sip','Priority':'1','variable':_0x350179,'timeout':(_0x450813[_0x0b3a('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x138228['uniqueid']};};exports[_0x0b3a('0x4b')]=function(_0x3dc08e){return _0x3dc08e[_0x0b3a('0x4c')]+_0x3dc08e[_0x0b3a('0x4d')]+_0x3dc08e[_0x0b3a('0x4e')];};exports['cloneAction']=function(_0x4838b9){var _0x419aac=_['clone'](_0x4838b9);_0x419aac[_0x0b3a('0x33')]=0xf;_0x419aac[_0x0b3a('0x39')]=_0x0b3a('0x4f');return _0x419aac;};exports[_0x0b3a('0x50')]=function(_0x2a7683,_0x3c6253,_0x2bbe1a){var _0x343919={};_0x343919[_0x3c6253]=_0x2a7683[_0x3c6253];_0x343919['active']=![];_0x343919[_0x0b3a('0x51')]=moment()[_0x0b3a('0x52')](_0x2bbe1a,'minutes')[_0x0b3a('0x14')](_0x0b3a('0x32'));_0x343919[_0x0b3a('0x1b')]=_0x2a7683[_0x0b3a('0x1b')];_0x343919[_0x0b3a('0x53')]=_0x2a7683[_0x0b3a('0x53')];_0x343919[_0x0b3a('0x1d')]=_0x2a7683[_0x0b3a('0x1d')]||undefined;return _0x343919;};exports[_0x0b3a('0x54')]=function(_0x12319c,_0x3700b9){if(!_[_0x0b3a('0x17')](_0x12319c)){if(_0x12319c[_0x0b3a('0x55')]>0x0){_0x12319c[_0x0b3a('0x55')]-=0x1;}else{logger[_0x0b3a('0x9')](_0x3700b9,_0x0b3a('0x56'));}}else{logger[_0x0b3a('0x9')](_0x3700b9,_0x0b3a('0x57'));}};exports['IsNotLoggedIn']=function(_0x7e3c52){if(_0x7e3c52<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3e9c19,_0x424ee3){_0x3e9c19[_0x0b3a('0x58')]=_0x424ee3;_0x3e9c19[_0x0b3a('0x1a')]=_0x3e9c19[_0x0b3a('0x59')];_0x3e9c19[_0x0b3a('0x5a')]=_0x3e9c19[_0x0b3a('0x48')];return _0x3e9c19;};exports[_0x0b3a('0x5b')]=function(_0x573adb){var _0x49bc26={};_0x49bc26[_0x0b3a('0x59')]=_0x573adb['queue'];_0x49bc26['interface']=_0x573adb[_0x0b3a('0x48')];_0x49bc26[_0x0b3a('0x47')]=_0x573adb[_0x0b3a('0x47')];return _0x49bc26;};exports[_0x0b3a('0x5c')]=function(_0x27353b){var _0x4d82e5=[];for(var _0x47caf1 in _0x27353b){if(_0x27353b[_0x0b3a('0x2d')](_0x47caf1)){if(!_[_0x0b3a('0x17')](_0x27353b[_0x47caf1])&&_0x27353b[_0x47caf1][_0x0b3a('0x33')]===_0x0b3a('0x5d')&&_0x27353b[_0x47caf1][_0x0b3a('0x5e')]===_0x0b3a('0x5f')){_0x4d82e5[_0x0b3a('0x60')](_0x27353b[_0x47caf1]['id']);}}}return _0x4d82e5;};exports[_0x0b3a('0x61')]=function(_0xee3fff){var _0xf51123=moment()['milliseconds'](0x0);var _0x35b5b0=moment(_0xee3fff)['milliseconds'](0x0);return _0xf51123['diff'](_0x35b5b0,'seconds');};exports['createBody']=function(_0x3509e4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3509e4['ContactId'],'ListId':_0x3509e4[_0x0b3a('0x53')],'VoiceQueueId':_0x3509e4['VoiceQueueId']||undefined,'CampaignId':_0x3509e4[_0x0b3a('0x62')]||undefined};};exports[_0x0b3a('0x63')]=function(_0xdeac19){if(_0xdeac19===_0x0b3a('0x47')||_0xdeac19===_0x0b3a('0x64')||_0xdeac19==='queue'||_0xdeac19===_0x0b3a('0x65')||_0xdeac19===_0x0b3a('0x66')||_0xdeac19===_0x0b3a('0x67')||_0xdeac19===_0x0b3a('0x3b')||_0xdeac19===_0x0b3a('0x48')||_0xdeac19===_0x0b3a('0x45')||_0xdeac19===_0x0b3a('0x68')||_0xdeac19===_0x0b3a('0x49')||_0xdeac19===_0x0b3a('0x51')||_0xdeac19===_0x0b3a('0x4c')||_0xdeac19==='countcongestionretry'||_0xdeac19===_0x0b3a('0x4e')||_0xdeac19===_0x0b3a('0x69')||_0xdeac19==='callback'||_0xdeac19===_0x0b3a('0x6a')||_0xdeac19===_0x0b3a('0x6b')||_0xdeac19==='recallme'||_0xdeac19===_0x0b3a('0x1b')||_0xdeac19===_0x0b3a('0x53')||_0xdeac19===_0x0b3a('0x3c')||_0xdeac19==='VoiceQueueId'||_0xdeac19===_0x0b3a('0x6c')||_0xdeac19===_0x0b3a('0x6d')||_0xdeac19===_0x0b3a('0x6e')||_0xdeac19===_0x0b3a('0x6f')||_0xdeac19==='xmd-listid'||_0xdeac19==='xmd-dialurl'||_0xdeac19==='xmd-dialtimeout'||_0xdeac19===_0x0b3a('0x70')||_0xdeac19===_0x0b3a('0x71')||_0xdeac19===_0x0b3a('0x72')||_0xdeac19===_0x0b3a('0x73')||_0xdeac19===_0x0b3a('0x74')||_0xdeac19===_0x0b3a('0x75')||_0xdeac19===_0x0b3a('0x76')||_0xdeac19===_0x0b3a('0x77')||_0xdeac19===_0x0b3a('0x78')||_0xdeac19==='rtpaudioqosbridged'||_0xdeac19==='rtpaudioqosjitter'||_0xdeac19===_0x0b3a('0x79')||_0xdeac19===_0x0b3a('0x7a')||_0xdeac19===_0x0b3a('0x7b')||_0xdeac19==='rtpaudioqosrtt'||_0xdeac19===_0x0b3a('0x7c')||_0xdeac19===_0x0b3a('0x78')||_0xdeac19===_0x0b3a('0x7d')||_0xdeac19===_0x0b3a('0x7e')||_0xdeac19===_0x0b3a('0x79')||_0xdeac19===_0x0b3a('0x7a')||_0xdeac19==='rtpaudioqoslossbridged'||_0xdeac19===_0x0b3a('0x7f')||_0xdeac19===_0x0b3a('0x7c')||_0xdeac19===_0x0b3a('0x80')||_0xdeac19===_0x0b3a('0x81')||_0xdeac19===_0x0b3a('0x33')||_0xdeac19===_0x0b3a('0x39')){return![];}return!![];};exports[_0x0b3a('0x82')]=function(_0x1b5554,_0x3b7e56){var _0x48f1a8,_0x37e074,_0x1d9f00;if(_0x3b7e56<=0x0){_0x3b7e56=0x1;}_0x48f1a8=new RegExp('\x5cw{0,'+_0x3b7e56+'}$');_0x37e074=Math[_0x0b3a('0x83')](0xa,_0x3b7e56-0x1);_0x1d9f00=Math[_0x0b3a('0x83')](0xa,_0x3b7e56)-0x1;return util[_0x0b3a('0x14')]('%s',_['replace'](_0x1b5554,_0x48f1a8,_[_0x0b3a('0x84')](_0x37e074,_0x1d9f00)));};exports[_0x0b3a('0x85')]=function(_0x426197){var _0x352041=_0x426197['match'](/"(.*?)"/);return _0x352041?_0x352041[0x1]:_0x426197;};exports[_0x0b3a('0x86')]=function(_0x4688b2){var _0x99b98e=_0x4688b2[_0x0b3a('0x87')](/<(.*?)>/);return _0x99b98e?_0x99b98e[0x1]:_0x4688b2;}; \ No newline at end of file +var _0x2c90=['error','info','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','clone','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','channelAgent','buildAcw','agentReadyId','not_inuse','status','push','CampaignId','filterKey','type','membername','countglobal','callback','callbackuniqueid','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','pow','replace','random','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','loggerError'];(function(_0xef7aa5,_0x363328){var _0x2d4b99=function(_0x7a05ed){while(--_0x7a05ed){_0xef7aa5['push'](_0xef7aa5['shift']());}};_0x2d4b99(++_0x363328);}(_0x2c90,0xfb));var _0x02c9=function(_0x111283,_0x245da0){_0x111283=_0x111283-0x0;var _0x8be36e=_0x2c90[_0x111283];return _0x8be36e;};'use strict';var util=require(_0x02c9('0x0'));var _=require(_0x02c9('0x1'));var moment=require(_0x02c9('0x2'));var logger=require(_0x02c9('0x3'))(_0x02c9('0x4'));var ipAgi=process[_0x02c9('0x5')][_0x02c9('0x6')]||_0x02c9('0x7');function getSeconds(_0x39f3e4,_0x448050){var _0x3b2f70=moment(_0x39f3e4)[_0x02c9('0x8')](0x0);var _0x248a77=moment(_0x448050)[_0x02c9('0x8')](0x0);return _0x3b2f70[_0x02c9('0x9')](_0x248a77,'seconds');}exports[_0x02c9('0xa')]=function(_0x3d372d){return function(_0x46df71){logger['error'](_0x3d372d,util[_0x02c9('0xb')](_0x46df71,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x55ea00,_0x165a04){logger['info'](_0x55ea00,util['inspect'](_0x165a04,{'showHidden':![],'depth':null}));};exports[_0x02c9('0xc')]=function(_0x519478,_0x41ebec){logger[_0x02c9('0xd')](_0x519478,util['inspect'](_0x41ebec,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x104287){return function(_0x375f31){logger[_0x02c9('0xe')](_0x104287,util[_0x02c9('0xb')](_0x375f31,{'showHidden':![],'depth':null}));};};exports[_0x02c9('0xf')]=function(_0x365025,_0x113d02,_0x2e7cf8){return{'message':_0x365025,'unlock':_0x113d02,'active':_0x2e7cf8};};exports[_0x02c9('0x10')]=function(_0x406427,_0x48f96a,_0x5e5f28){if(!_['isUndefined'](_0x5e5f28)&&_0x02c9('0x11')===typeof _0x5e5f28&&!_[_0x02c9('0x12')](_0x5e5f28)){if(!_[_0x02c9('0x13')](_0x48f96a)&&_0x02c9('0x11')===typeof _0x48f96a&&!_[_0x02c9('0x12')](_0x48f96a)){return util['format'](_0x02c9('0x14'),_0x48f96a,_0x5e5f28);}return util[_0x02c9('0x15')](_0x02c9('0x14'),_0x5e5f28,_0x5e5f28);}if(!_[_0x02c9('0x13')](_0x406427)&&_0x02c9('0x11')===typeof _0x406427&&!_[_0x02c9('0x12')](_0x406427)){return _0x406427;}return'\x22\x22\x20<>';};exports[_0x02c9('0x16')]=function(_0x5e05ed){if(_['isNil'](_0x5e05ed)){return![];}return _0x5e05ed;};exports[_0x02c9('0x17')]=function(_0x3db766,_0x500a18,_0x41eaa3,_0x54a9e0,_0x4e5d0f,_0x5b4a84){var _0x2baedd={'XMD-QUEUE':_0x500a18[_0x02c9('0x18')]?_0x500a18[_0x02c9('0x18')][_0x02c9('0x19')]:'','XMD-CALLERID':_0x54a9e0,'XMD-CALLERID-PREVIEW':_0x5b4a84?util[_0x02c9('0x15')](_0x02c9('0x14'),_0x5b4a84[_0x02c9('0x1a')],_0x5b4a84[_0x02c9('0x1b')]):_0x54a9e0,'XMD-DIALID':_0x4e5d0f,'XMD-CONTACTID':_0x500a18[_0x02c9('0x1c')],'XMD-CDRTYPE':_0x02c9('0x1d'),'CALLERID(all)':_0x54a9e0,'XMD-VOICEQUEUEID':_0x500a18[_0x02c9('0x1e')],'XMD-DIALCHANNEL':_0x41eaa3,'XMD-DIALTIMEOUT':_0x3db766[_0x02c9('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x02c9('0x20'),_0x3db766[_0x02c9('0x21')]?'g':'',_['isEmpty'](_0x3db766['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3db766['dialPreviewUrl']||'','XMD-AGI':_0x3db766[_0x02c9('0x22')]?util['format'](_0x02c9('0x23'),ipAgi,_0x3db766[_0x02c9('0x22')]):_0x02c9('0x24'),'XMD-AGIAFTER':_0x3db766[_0x02c9('0x21')]?util[_0x02c9('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3db766[_0x02c9('0x21')]):_0x02c9('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x5b4a84?_0x5b4a84[_0x02c9('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x5b4a84?_0x5b4a84[_0x02c9('0x26')]:'','XMD-DESTINATION':_0x02c9('0x27')};if(!_[_0x02c9('0x12')](_0x3db766[_0x02c9('0x28')])){_0x2baedd[util['format']('%s',_0x02c9('0x29'))]=_0x3db766[_0x02c9('0x28')];_0x2baedd[util[_0x02c9('0x15')]('%s',_0x02c9('0x2a'))]=_0x4e5d0f;}if(_0x500a18&&_0x500a18['Contact']){for(var _0x138cfa in _0x500a18[_0x02c9('0x2b')]){if(_0x500a18[_0x02c9('0x2b')]['hasOwnProperty'](_0x138cfa)){if(!_['isNil'](_0x500a18['Contact'][_0x138cfa])&&_0x138cfa!=='id'&&_0x138cfa!==_0x02c9('0x2c')&&_0x138cfa!==_0x02c9('0x2d')&&_0x138cfa!==_0x02c9('0x2e')){_0x2baedd[util[_0x02c9('0x15')](_0x02c9('0x2f'),_0x02c9('0x30'),_[_0x02c9('0x31')](_0x138cfa))]=_0x500a18['Contact'][_0x138cfa];}}}}return _0x2baedd;};exports[_0x02c9('0x32')]=function(_0x2fff9e){var _0x4feb14={};for(var _0x626403 in _0x2fff9e){if(_0x2fff9e[_0x02c9('0x33')](_0x626403)){_0x4feb14[util['format']('%s',_[_0x02c9('0x34')](_0x626403))]=_0x2fff9e[_0x626403];}}return{'variables':_0x4feb14};};exports[_0x02c9('0x35')]=function(_0x29f725,_0x2d3693){if(!_[_0x02c9('0x36')](_0x29f725)){if(_0x29f725[_0x02c9('0x33')](_0x02c9('0x37'))){if(_0x29f725[_0x02c9('0x37')]>0x0){_0x29f725['originated']-=0x1;}else{logger[_0x02c9('0xd')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2d3693);}}}else{logger[_0x02c9('0xd')](_0x02c9('0x38'),_0x2d3693);}};exports[_0x02c9('0x39')]=function(_0x554d8d){var _0x37de6e=moment()[_0x02c9('0x15')](_0x02c9('0x3a'));_0x554d8d[_0x02c9('0x3b')]=0xd;_0x554d8d[_0x02c9('0x3c')]=_0x02c9('0x3d');_0x554d8d[_0x02c9('0x3e')]=_0x37de6e;_0x554d8d[_0x02c9('0x3f')]=_0x37de6e;_0x554d8d['endtime']=_0x37de6e;};exports['logAgent']=function(_0x2317c1,_0x5d6743,_0x76cbf0){var _0x3bde96=moment()['format'](_0x02c9('0x3a'));_0x2317c1['state']=_0x5d6743;_0x2317c1['statedesc']=_0x76cbf0;_0x2317c1[_0x02c9('0x3f')]=_0x3bde96;_0x2317c1[_0x02c9('0x40')]=getSeconds(_0x2317c1['responsetime'],_0x2317c1[_0x02c9('0x3e')]);};exports[_0x02c9('0x41')]=function(_0x5ef98e,_0x7e0623,_0x571e5a){_0x5ef98e['membername']=_0x7e0623;_0x5ef98e[_0x02c9('0x42')]=_0x571e5a;};exports[_0x02c9('0x43')]=function(_0x38bd4c,_0x5be41f,_0x22a2dc){var _0x391a5d=moment()[_0x02c9('0x15')](_0x02c9('0x3a'));_0x38bd4c['state']=_0x5be41f;_0x38bd4c[_0x02c9('0x3c')]=_0x22a2dc;_0x38bd4c[_0x02c9('0x3f')]=_0x38bd4c['responsetime']?_0x38bd4c[_0x02c9('0x3f')]:_0x391a5d;_0x38bd4c[_0x02c9('0x44')]=_0x38bd4c['endtime']?_0x38bd4c[_0x02c9('0x44')]:_0x391a5d;_0x38bd4c[_0x02c9('0x40')]=getSeconds(_0x38bd4c[_0x02c9('0x3f')]||0x0,_0x38bd4c['starttime']||0x0);_0x38bd4c[_0x02c9('0x45')]=_0x38bd4c[_0x02c9('0x46')]?getSeconds(_0x38bd4c[_0x02c9('0x44')],_0x38bd4c['answertime']):0x0;};exports[_0x02c9('0x47')]=function(_0x20e833){return _0x20e833===_0x02c9('0x48');};exports[_0x02c9('0x49')]=function(_0x3b9704,_0x650859,_0xf6cba3,_0x1333c0,_0x485f7e){var _0x59aad5=_0x1333c0?_0x02c9('0x4a'):_0x3b9704[_0x02c9('0x1a')];_0x59aad5=_0x485f7e?_0x02c9('0x4b'):_0x59aad5;return{'actionid':_0x3b9704[_0x02c9('0x4c')],'action':'originate','channel':_0x3b9704['channelAgent'],'callerid':util[_0x02c9('0x15')](_0x02c9('0x14'),_0x59aad5,_0x3b9704[_0x02c9('0x1b')]),'Exten':_0x02c9('0x27'),'Context':_0x02c9('0x4d'),'Priority':'1','variable':_0xf6cba3,'timeout':(_0x650859['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3b9704[_0x02c9('0x4c')]};};exports['totalGlobal']=function(_0x26e5c2){return _0x26e5c2[_0x02c9('0x4e')]+_0x26e5c2[_0x02c9('0x4f')]+_0x26e5c2[_0x02c9('0x50')];};exports['cloneAction']=function(_0x19241b){var _0x1c0f40=_[_0x02c9('0x51')](_0x19241b);_0x1c0f40[_0x02c9('0x3b')]=0xf;_0x1c0f40['statedesc']='Global';return _0x1c0f40;};exports['scheduledAt']=function(_0x4e9f71,_0x1bc822,_0x463db7){var _0xb664e1={};_0xb664e1[_0x1bc822]=_0x4e9f71[_0x1bc822];_0xb664e1[_0x02c9('0x52')]=![];_0xb664e1[_0x02c9('0x53')]=moment()[_0x02c9('0x54')](_0x463db7,_0x02c9('0x55'))['format'](_0x02c9('0x3a'));_0xb664e1[_0x02c9('0x1c')]=_0x4e9f71[_0x02c9('0x1c')];_0xb664e1[_0x02c9('0x56')]=_0x4e9f71[_0x02c9('0x56')];_0xb664e1[_0x02c9('0x1e')]=_0x4e9f71[_0x02c9('0x1e')]||undefined;return _0xb664e1;};exports[_0x02c9('0x57')]=function(_0x598442,_0x1985b9){if(!_[_0x02c9('0x36')](_0x598442)){if(_0x598442[_0x02c9('0x58')]>0x0){_0x598442['pTalking']-=0x1;}else{logger[_0x02c9('0xd')](_0x1985b9,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x02c9('0xd')](_0x1985b9,_0x02c9('0x59'));}};exports[_0x02c9('0x5a')]=function(_0x25da43){if(_0x25da43<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1156cc,_0x3ca87c){_0x1156cc['lastevent']=_0x3ca87c;_0x1156cc[_0x02c9('0x19')]=_0x1156cc[_0x02c9('0x5b')];_0x1156cc[_0x02c9('0x5c')]=_0x1156cc[_0x02c9('0x5d')];return _0x1156cc;};exports[_0x02c9('0x5e')]=function(_0x5593c4){var _0x511486={};_0x511486[_0x02c9('0x5b')]=_0x5593c4[_0x02c9('0x5b')];_0x511486[_0x02c9('0x5c')]=_0x5593c4[_0x02c9('0x5d')];_0x511486[_0x02c9('0x4c')]=_0x5593c4['uniqueid'];return _0x511486;};exports[_0x02c9('0x5f')]=function(_0x388f75){var _0x43e465=[];for(var _0x4bc1e4 in _0x388f75){if(_0x388f75[_0x02c9('0x33')](_0x4bc1e4)){if(!_['isNil'](_0x388f75[_0x4bc1e4])&&_0x388f75[_0x4bc1e4][_0x02c9('0x3b')]===_0x02c9('0x60')&&_0x388f75[_0x4bc1e4][_0x02c9('0x61')]==='reachable'){_0x43e465[_0x02c9('0x62')](_0x388f75[_0x4bc1e4]['id']);}}}return _0x43e465;};exports['getDiff']=function(_0x5c7539){var _0x457df9=moment()[_0x02c9('0x8')](0x0);var _0x20bb3f=moment(_0x5c7539)['milliseconds'](0x0);return _0x457df9[_0x02c9('0x9')](_0x20bb3f,'seconds');};exports['createBody']=function(_0x2ae280){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ae280[_0x02c9('0x1c')],'ListId':_0x2ae280['ListId'],'VoiceQueueId':_0x2ae280[_0x02c9('0x1e')]||undefined,'CampaignId':_0x2ae280[_0x02c9('0x63')]||undefined};};exports[_0x02c9('0x64')]=function(_0x8e167f){if(_0x8e167f===_0x02c9('0x4c')||_0x8e167f==='idContact'||_0x8e167f===_0x02c9('0x5b')||_0x8e167f===_0x02c9('0x65')||_0x8e167f==='campaigntype'||_0x8e167f==='dialAnswer'||_0x8e167f===_0x02c9('0x66')||_0x8e167f===_0x02c9('0x5d')||_0x8e167f===_0x02c9('0x1a')||_0x8e167f===_0x02c9('0x52')||_0x8e167f===_0x02c9('0x1b')||_0x8e167f===_0x02c9('0x53')||_0x8e167f===_0x02c9('0x4e')||_0x8e167f===_0x02c9('0x4f')||_0x8e167f===_0x02c9('0x50')||_0x8e167f===_0x02c9('0x67')||_0x8e167f===_0x02c9('0x68')||_0x8e167f===_0x02c9('0x69')||_0x8e167f==='callbackat'||_0x8e167f==='recallme'||_0x8e167f==='ContactId'||_0x8e167f===_0x02c9('0x56')||_0x8e167f===_0x02c9('0x42')||_0x8e167f==='VoiceQueueId'||_0x8e167f===_0x02c9('0x6a')||_0x8e167f==='xmd-voicequeueid'||_0x8e167f===_0x02c9('0x6b')||_0x8e167f===_0x02c9('0x6c')||_0x8e167f===_0x02c9('0x6d')||_0x8e167f===_0x02c9('0x6e')||_0x8e167f===_0x02c9('0x6f')||_0x8e167f===_0x02c9('0x70')||_0x8e167f===_0x02c9('0x71')||_0x8e167f===_0x02c9('0x72')||_0x8e167f===_0x02c9('0x73')||_0x8e167f==='xmd-cdrtype'||_0x8e167f==='xmd-callerid'||_0x8e167f===_0x02c9('0x74')||_0x8e167f===_0x02c9('0x75')||_0x8e167f==='rtpaudioqos'||_0x8e167f===_0x02c9('0x76')||_0x8e167f==='rtpaudioqosjitter'||_0x8e167f===_0x02c9('0x77')||_0x8e167f===_0x02c9('0x78')||_0x8e167f==='rtpaudioqoslossbridged'||_0x8e167f==='rtpaudioqosrtt'||_0x8e167f===_0x02c9('0x79')||_0x8e167f===_0x02c9('0x7a')||_0x8e167f===_0x02c9('0x76')||_0x8e167f===_0x02c9('0x7b')||_0x8e167f===_0x02c9('0x77')||_0x8e167f===_0x02c9('0x78')||_0x8e167f===_0x02c9('0x7c')||_0x8e167f===_0x02c9('0x7d')||_0x8e167f===_0x02c9('0x79')||_0x8e167f===_0x02c9('0x7e')||_0x8e167f==='bridgepvtcallid'||_0x8e167f==='state'||_0x8e167f===_0x02c9('0x3c')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3b165e,_0x5819b6){var _0x53f17c,_0x46e0e2,_0x256c34;if(_0x5819b6<=0x0){_0x5819b6=0x1;}_0x53f17c=new RegExp('\x5cw{0,'+_0x5819b6+'}$');_0x46e0e2=Math[_0x02c9('0x7f')](0xa,_0x5819b6-0x1);_0x256c34=Math[_0x02c9('0x7f')](0xa,_0x5819b6)-0x1;return util[_0x02c9('0x15')]('%s',_[_0x02c9('0x80')](_0x3b165e,_0x53f17c,_[_0x02c9('0x81')](_0x46e0e2,_0x256c34)));};exports['extractCalleridName']=function(_0x1e6064){var _0x4a809b=_0x1e6064['match'](/"(.*?)"/);return _0x4a809b?_0x4a809b[0x1]:_0x1e6064;};exports[_0x02c9('0x82')]=function(_0x51e14c){var _0x5b7ea2=_0x51e14c[_0x02c9('0x83')](/<(.*?)>/);return _0x5b7ea2?_0x5b7ea2[0x1]:_0x51e14c;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d8dbf2e..25bebf6 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 _0x3d6d=['string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x5ea797,_0x2d39dd){_0x5ea797=_0x5ea797-0x0;var _0x500783=_0x3d6d[_0x5ea797];return _0x500783;};'use strict';exports[_0xd3d6('0x0')]={'queue':{'type':_0xd3d6('0x1'),'required':!![]},'interface':{'type':_0xd3d6('0x1'),'required':!![]},'membername':{'type':_0xd3d6('0x1'),'required':!![]},'penalty':{'type':_0xd3d6('0x2'),'required':![]},'paused':{'type':_0xd3d6('0x3'),'required':![]}};exports[_0xd3d6('0x4')]={'queue':{'type':_0xd3d6('0x1'),'required':!![]},'interface':{'type':_0xd3d6('0x1'),'required':!![]}};exports[_0xd3d6('0x5')]={'interface':{'type':_0xd3d6('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xd3d6('0x6')]={'module':{'type':_0xd3d6('0x1'),'required':![]}};exports[_0xd3d6('0x7')]={'uniqueid':{'type':_0xd3d6('0x1'),'required':!![]}};exports[_0xd3d6('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd3d6('0x1')},'format':{'type':_0xd3d6('0x1')},'mixmonitorid':{'type':_0xd3d6('0x1')}};exports[_0xd3d6('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd3d6('0x1'),'required':!![]},'exten':{'type':_0xd3d6('0x1'),'required':!![]},'context':{'type':_0xd3d6('0x1')}}; \ No newline at end of file +var _0xdb94=['queueremove','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdb94,0xe5));var _0x4db9=function(_0x418c0e,_0x3b863e){_0x418c0e=_0x418c0e-0x0;var _0x4dbfaf=_0xdb94[_0x418c0e];return _0x4dbfaf;};'use strict';exports['queueadd']={'queue':{'type':_0x4db9('0x0'),'required':!![]},'interface':{'type':_0x4db9('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x4db9('0x1'),'required':![]},'paused':{'type':_0x4db9('0x2'),'required':![]}};exports[_0x4db9('0x3')]={'queue':{'type':_0x4db9('0x0'),'required':!![]},'interface':{'type':_0x4db9('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x4db9('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x4db9('0x0'),'required':![]}};exports[_0x4db9('0x4')]={'module':{'type':_0x4db9('0x0'),'required':![]}};exports[_0x4db9('0x5')]={'uniqueid':{'type':_0x4db9('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x4db9('0x0'),'required':!![]},'filename':{'type':_0x4db9('0x0')},'format':{'type':_0x4db9('0x0')},'mixmonitorid':{'type':_0x4db9('0x0')}};exports[_0x4db9('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x4db9('0x7')]={'uniqueid':{'type':_0x4db9('0x0'),'required':!![]},'exten':{'type':_0x4db9('0x0'),'required':!![]},'context':{'type':_0x4db9('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4e86756..93b05d1 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 _0x4676=['faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaignHopperHistory','bluebird','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts'];(function(_0x56a86e,_0x51f246){var _0x48ae90=function(_0x1a46a8){while(--_0x1a46a8){_0x56a86e['push'](_0x56a86e['shift']());}};_0x48ae90(++_0x51f246);}(_0x4676,0x1e4));var _0x6467=function(_0x46cf44,_0x21bad2){_0x46cf44=_0x46cf44-0x0;var _0x4415e1=_0x4676[_0x46cf44];return _0x4415e1;};'use strict';var BPromise=require(_0x6467('0x0'));var util=require('util');var _=require(_0x6467('0x1'));var moment=require(_0x6467('0x2'));var Agent=require(_0x6467('0x3'));var Telephone=require(_0x6467('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x6467('0x5'));var Trigger=require(_0x6467('0x6'));var Template=require(_0x6467('0x7'));var Campaign=require(_0x6467('0x8'));var VoiceExtension=require(_0x6467('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x6467('0xa'));var SugarcrmAccount=require(_0x6467('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x6467('0xc'));var ServicenowAccount=require(_0x6467('0xd'));var Dynamics365Account=require(_0x6467('0xe'));var FaxAccount=require(_0x6467('0xf'));var Realtime=function(){this[_0x6467('0x10')]={};this['telephones']={};this[_0x6467('0x11')]={};this[_0x6467('0x12')]={};this[_0x6467('0x13')]={};this[_0x6467('0x14')]={};this[_0x6467('0x15')]={};this[_0x6467('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6467('0x17')]={};this[_0x6467('0x18')]={};this[_0x6467('0x19')]={};this[_0x6467('0x1a')]={};this[_0x6467('0x1b')]={};this[_0x6467('0x1c')]={};this[_0x6467('0x1d')]={};this[_0x6467('0x1e')]={};this[_0x6467('0x1f')]={};this[_0x6467('0x20')]={};this[_0x6467('0x21')]={};this['vtigerAccounts']={};this[_0x6467('0x22')]={};this[_0x6467('0x23')]={};this[_0x6467('0x24')]={};};function freeIsNotKey(_0x86e55e,_0x599a96,_0xf89d03){var _0xf8a519=_[_0x6467('0x25')](_0x86e55e,function(_0x17f6a5,_0x51d567){return _0x17f6a5[_0xf89d03];});for(var _0x4b0def in _0x599a96){if(_0x599a96[_0x6467('0x26')](_0x4b0def)){if(!_0xf8a519[_0x4b0def]){delete _0x599a96[_0x4b0def];}}}}function freeIsNotKeySip(_0x51edbd,_0x4fb005){var _0xefba83=_['mapKeys'](_0x51edbd,function(_0x5da2b6,_0x23cb05){return util[_0x6467('0x27')](_0x6467('0x28'),_0x5da2b6[_0x6467('0x29')]);});for(var _0x52c035 in _0x4fb005){if(_0x4fb005[_0x6467('0x26')](_0x52c035)){if(!_0xefba83[_0x52c035]){delete _0x4fb005[_0x52c035];}}}}function freeIsNotKeyAgent(_0x3c3054,_0x56d637){var _0x29b806=_['mapKeys'](_0x3c3054,function(_0xd31c79,_0xea8e3d){var _0x3658d2=_[_0x6467('0x2a')](_0xd31c79[_0x6467('0x2b')])?util[_0x6467('0x27')](_0x6467('0x28'),_0xd31c79[_0x6467('0x29')]):_0xd31c79[_0x6467('0x2b')];return _0x3658d2;});for(var _0x3378b6 in _0x56d637){if(_0x56d637[_0x6467('0x26')](_0x3378b6)){if(!_0x29b806[_0x3378b6]){delete _0x56d637[_0x3378b6];}}}}function clearVoiceCallReports(_0x1b4f4a){_0x1b4f4a[_0x6467('0x2c')]=0x0;_0x1b4f4a[_0x6467('0x2d')]=0x0;_0x1b4f4a[_0x6467('0x2e')]=0x0;_0x1b4f4a['sumDuration']=0x0;_0x1b4f4a[_0x6467('0x2f')]=0x0;}function clearCampaigns(_0x515c16){if(!_[_0x6467('0x30')](_0x515c16)){for(var _0x27866e in _0x515c16){if(_0x515c16['hasOwnProperty'](_0x27866e)){_0x515c16[_0x27866e][_0x6467('0x31')]=0x0;_0x515c16[_0x27866e][_0x6467('0x32')]=0x0;}}}}function clearVoiceQueues(_0x1ed059){if(!_[_0x6467('0x30')](_0x1ed059)){for(var _0x3ce464 in _0x1ed059){if(_0x1ed059[_0x6467('0x26')](_0x3ce464)){_0x1ed059[_0x3ce464]['total']=0x0;_0x1ed059[_0x3ce464][_0x6467('0x2d')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x33')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x34')]=0x0;_0x1ed059[_0x3ce464]['sumHoldTime']=0x0;_0x1ed059[_0x3ce464][_0x6467('0x35')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x2f')]=0x0;_0x1ed059[_0x3ce464]['outboundAnswerAgiCallsDay']=0x0;_0x1ed059[_0x3ce464][_0x6467('0x36')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x37')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x38')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x39')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3a')]=0x0;_0x1ed059[_0x3ce464]['outboundDropCallsDayTimeout']=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3b')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3c')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3d')]=0x0;_0x1ed059[_0x3ce464]['outboundRejectCallsDay']=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3e')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x3f')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x40')]=0x0;_0x1ed059[_0x3ce464][_0x6467('0x41')]=!![];}}}}Realtime['prototype'][_0x6467('0x42')]=function(_0x47d271,_0x3a77b9){for(var _0xc6ae61 in _0x3a77b9){if(_0x47d271[_0x6467('0x26')](_0xc6ae61)){_0x47d271[_0xc6ae61]=_0x3a77b9[_0xc6ae61];}}};Realtime[_0x6467('0x43')][_0x6467('0x44')]=function(){var _0xd2cd83=this;return function(_0x245078){if(_0x245078){freeIsNotKeyAgent(_0x245078,_0xd2cd83[_0x6467('0x10')]);for(var _0x592b41=0x0,_0x40f77c={},_0x2d9e04={};_0x592b41<_0x245078[_0x6467('0x45')];_0x592b41+=0x1){_0x40f77c=_0x245078[_0x592b41];var _0x4e31ce=_[_0x6467('0x2a')](_0x40f77c[_0x6467('0x2b')])?util[_0x6467('0x27')](_0x6467('0x28'),_0x40f77c[_0x6467('0x29')]):_0x40f77c[_0x6467('0x2b')];if(_[_0x6467('0x46')](_0xd2cd83[_0x6467('0x10')][_0x4e31ce])){_0xd2cd83[_0x6467('0x10')][_0x4e31ce]=new Agent(_0x40f77c);}else{_0xd2cd83[_0x6467('0x42')](_0xd2cd83[_0x6467('0x10')][_0x4e31ce],_0x40f77c);}}}return _0xd2cd83['agents'];};};Realtime[_0x6467('0x43')][_0x6467('0x47')]=function(){var _0x1e2fab=this;return function(_0x2c48ca){if(_0x2c48ca){freeIsNotKeySip(_0x2c48ca,_0x1e2fab[_0x6467('0x48')]);for(var _0x5b3f0c=0x0,_0xc782a9={},_0x56899f={};_0x5b3f0c<_0x2c48ca['length'];_0x5b3f0c+=0x1){_0xc782a9=_0x2c48ca[_0x5b3f0c];if(_[_0x6467('0x46')](_0x1e2fab[_0x6467('0x48')][util[_0x6467('0x27')](_0x6467('0x28'),_0xc782a9[_0x6467('0x29')])])){_0x1e2fab[_0x6467('0x48')][util[_0x6467('0x27')](_0x6467('0x28'),_0xc782a9[_0x6467('0x29')])]=new Telephone(_0xc782a9);}else{_0x1e2fab[_0x6467('0x42')](_0x1e2fab[_0x6467('0x48')][util[_0x6467('0x27')](_0x6467('0x28'),_0xc782a9[_0x6467('0x29')])],_0xc782a9);}}}return _0x1e2fab['telephones'];};};Realtime[_0x6467('0x43')][_0x6467('0x49')]=function(){var _0x4c168f=this;return function(_0x37b1a4){if(_0x37b1a4){freeIsNotKeySip(_0x37b1a4,_0x4c168f['trunks']);for(var _0x20f215=0x0,_0x1029c1={},_0x48bd40={};_0x20f215<_0x37b1a4[_0x6467('0x45')];_0x20f215+=0x1){_0x1029c1=_0x37b1a4[_0x20f215];if(_[_0x6467('0x46')](_0x4c168f[_0x6467('0x11')][util['format'](_0x6467('0x28'),_0x1029c1['name'])])){_0x4c168f[_0x6467('0x11')][util[_0x6467('0x27')](_0x6467('0x28'),_0x1029c1[_0x6467('0x29')])]=new Trunk(_0x1029c1);}else{_0x4c168f['mergeFromDatabase'](_0x4c168f[_0x6467('0x11')][util[_0x6467('0x27')](_0x6467('0x28'),_0x1029c1[_0x6467('0x29')])],_0x1029c1);}}}return _0x4c168f[_0x6467('0x11')];};};Realtime[_0x6467('0x43')][_0x6467('0x4a')]=function(){var _0xe379f6=this;return function(_0x2d9a64){if(_0x2d9a64){freeIsNotKey(_0x2d9a64,_0xe379f6[_0x6467('0x12')],_0x6467('0x29'));for(var _0x54fc38=0x0,_0x11c2c9={},_0x244b0b={};_0x54fc38<_0x2d9a64[_0x6467('0x45')];_0x54fc38+=0x1){_0x11c2c9=_0x2d9a64[_0x54fc38];if(_[_0x6467('0x46')](_0xe379f6[_0x6467('0x12')][_0x11c2c9[_0x6467('0x29')]])){_0xe379f6[_0x6467('0x12')][_0x11c2c9['name']]=new VoiceQueue(_0x11c2c9);}else{_0xe379f6['mergeFromDatabase'](_0xe379f6[_0x6467('0x12')][_0x11c2c9[_0x6467('0x29')]],_0x11c2c9);}}}return _0xe379f6[_0x6467('0x12')];};};Realtime[_0x6467('0x43')][_0x6467('0x4b')]=function(){var _0x2ebddf=this;return function(_0x43c0cf){if(_0x43c0cf){freeIsNotKey(_0x43c0cf,_0x2ebddf[_0x6467('0x13')],'id');for(var _0xe2c219=0x0,_0x54b331={},_0x2bc33b={};_0xe2c219<_0x43c0cf['length'];_0xe2c219+=0x1){_0x54b331=_0x43c0cf[_0xe2c219];if(_[_0x6467('0x46')](_0x2ebddf[_0x6467('0x13')][_0x54b331['id']])){_0x2ebddf['triggers'][_0x54b331['id']]=new Trigger(_0x54b331);}else{_0x2ebddf[_0x6467('0x42')](_0x2ebddf['triggers'][_0x54b331['id']],_0x54b331);}}}return _0x2ebddf[_0x6467('0x13')];};};Realtime[_0x6467('0x43')][_0x6467('0x4c')]=function(){var _0x417f9a=this;return function(_0x1fb47d){if(_0x1fb47d){freeIsNotKey(_0x1fb47d,_0x417f9a[_0x6467('0x15')],'id');for(var _0xaab10d=0x0,_0x5bfdc9={},_0x546c90={};_0xaab10d<_0x1fb47d['length'];_0xaab10d+=0x1){_0x5bfdc9=_0x1fb47d[_0xaab10d];if(_['isUndefined'](_0x417f9a['templates'][_0x5bfdc9['id']])){_0x417f9a[_0x6467('0x15')][_0x5bfdc9['id']]=new Template(_0x5bfdc9);}else{_0x417f9a[_0x6467('0x42')](_0x417f9a[_0x6467('0x15')][_0x5bfdc9['id']],_0x5bfdc9);}}}return _0x417f9a[_0x6467('0x15')];};};Realtime[_0x6467('0x43')][_0x6467('0x4d')]=function(){var _0x5debc3=this;return function(_0xccac1){if(_0xccac1){freeIsNotKey(_0xccac1,_0x5debc3['zendeskAccounts'],'id');for(var _0x555193=0x0,_0x4ac4dd={},_0x304c4a={};_0x555193<_0xccac1[_0x6467('0x45')];_0x555193+=0x1){_0x4ac4dd=_0xccac1[_0x555193];if(_[_0x6467('0x46')](_0x5debc3[_0x6467('0x1c')][_0x4ac4dd['id']])){_0x5debc3[_0x6467('0x1c')][_0x4ac4dd['id']]=new ZendeskAccount(_0x4ac4dd);}else{_0x5debc3[_0x6467('0x42')](_0x5debc3[_0x6467('0x1c')][_0x4ac4dd['id']],_0x4ac4dd);}}}return _0x5debc3[_0x6467('0x1c')];};};Realtime['prototype'][_0x6467('0x4e')]=function(){var _0x2a8b15=this;return function(_0x572853){if(_0x572853){freeIsNotKey(_0x572853,_0x2a8b15[_0x6467('0x1d')],'id');for(var _0x5c0eef=0x0,_0x5d19bd={},_0x27f9c5={};_0x5c0eef<_0x572853[_0x6467('0x45')];_0x5c0eef+=0x1){_0x5d19bd=_0x572853[_0x5c0eef];if(_[_0x6467('0x46')](_0x2a8b15['salesforceAccounts'][_0x5d19bd['id']])){_0x2a8b15[_0x6467('0x1d')][_0x5d19bd['id']]=new SalesforceAccount(_0x5d19bd);}else{_0x2a8b15['mergeFromDatabase'](_0x2a8b15[_0x6467('0x1d')][_0x5d19bd['id']],_0x5d19bd);}}}return _0x2a8b15[_0x6467('0x1d')];};};Realtime[_0x6467('0x43')][_0x6467('0x4f')]=function(){var _0x1e54ed=this;return function(_0x5785b2){if(_0x5785b2){freeIsNotKey(_0x5785b2,_0x1e54ed[_0x6467('0x1f')],'id');for(var _0x23ab62=0x0,_0x1622f7={},_0x2f2bae={};_0x23ab62<_0x5785b2['length'];_0x23ab62+=0x1){_0x1622f7=_0x5785b2[_0x23ab62];if(_[_0x6467('0x46')](_0x1e54ed[_0x6467('0x1f')][_0x1622f7['id']])){_0x1e54ed[_0x6467('0x1f')][_0x1622f7['id']]=new FreshdeskAccount(_0x1622f7);}else{_0x1e54ed[_0x6467('0x42')](_0x1e54ed[_0x6467('0x1f')][_0x1622f7['id']],_0x1622f7);}}}return _0x1e54ed['freshdeskAccounts'];};};Realtime[_0x6467('0x43')]['initZohoAccounts']=function(){var _0x5d1dd7=this;return function(_0x5bb268){if(_0x5bb268){freeIsNotKey(_0x5bb268,_0x5d1dd7['zohoAccounts'],'id');for(var _0x365445=0x0,_0x34c495={},_0x366d64={};_0x365445<_0x5bb268['length'];_0x365445+=0x1){_0x34c495=_0x5bb268[_0x365445];if(_[_0x6467('0x46')](_0x5d1dd7[_0x6467('0x20')][_0x34c495['id']])){_0x5d1dd7[_0x6467('0x20')][_0x34c495['id']]=new ZohoAccount(_0x34c495);}else{_0x5d1dd7[_0x6467('0x42')](_0x5d1dd7['zohoAccounts'][_0x34c495['id']],_0x34c495);}}}return _0x5d1dd7[_0x6467('0x20')];};};Realtime[_0x6467('0x43')][_0x6467('0x50')]=function(){var _0x5a5376=this;return function(_0xe0f700){if(_0xe0f700){freeIsNotKey(_0xe0f700,_0x5a5376[_0x6467('0x21')],'id');for(var _0x23d176=0x0,_0x39bc28={},_0x370330={};_0x23d176<_0xe0f700['length'];_0x23d176+=0x1){_0x39bc28=_0xe0f700[_0x23d176];if(_['isUndefined'](_0x5a5376[_0x6467('0x21')][_0x39bc28['id']])){_0x5a5376[_0x6467('0x21')][_0x39bc28['id']]=new DeskAccount(_0x39bc28);}else{_0x5a5376[_0x6467('0x42')](_0x5a5376[_0x6467('0x21')][_0x39bc28['id']],_0x39bc28);}}}return _0x5a5376[_0x6467('0x21')];};};Realtime[_0x6467('0x43')][_0x6467('0x51')]=function(){var _0x5e3524=this;return function(_0x2aeeb4){if(_0x2aeeb4){freeIsNotKey(_0x2aeeb4,_0x5e3524[_0x6467('0x1e')],'id');for(var _0x397e2c=0x0,_0xfa7126={},_0x4f1382={};_0x397e2c<_0x2aeeb4[_0x6467('0x45')];_0x397e2c+=0x1){_0xfa7126=_0x2aeeb4[_0x397e2c];if(_[_0x6467('0x46')](_0x5e3524[_0x6467('0x1e')][_0xfa7126['id']])){_0x5e3524[_0x6467('0x1e')][_0xfa7126['id']]=new SugarcrmAccount(_0xfa7126);}else{_0x5e3524[_0x6467('0x42')](_0x5e3524[_0x6467('0x1e')][_0xfa7126['id']],_0xfa7126);}}}return _0x5e3524[_0x6467('0x1e')];};};Realtime[_0x6467('0x43')][_0x6467('0x52')]=function(){var _0x526589=this;return function(_0x4ae662){if(_0x4ae662){freeIsNotKey(_0x4ae662,_0x526589[_0x6467('0x53')],'id');for(var _0x5b409c=0x0,_0x27ffde={},_0x5d49eb={};_0x5b409c<_0x4ae662[_0x6467('0x45')];_0x5b409c+=0x1){_0x27ffde=_0x4ae662[_0x5b409c];if(_[_0x6467('0x46')](_0x526589[_0x6467('0x53')][_0x27ffde['id']])){_0x526589[_0x6467('0x53')][_0x27ffde['id']]=new VtigerAccount(_0x27ffde);}else{_0x526589[_0x6467('0x42')](_0x526589['vtigerAccounts'][_0x27ffde['id']],_0x27ffde);}}}return _0x526589['vtigerAccounts'];};};Realtime['prototype'][_0x6467('0x54')]=function(){var _0x2c0200=this;return function(_0x3be88f){if(_0x3be88f){freeIsNotKey(_0x3be88f,_0x2c0200['servicenowAccounts'],'id');for(var _0x121876=0x0,_0x2f561a={},_0x59c0f3={};_0x121876<_0x3be88f[_0x6467('0x45')];_0x121876+=0x1){_0x2f561a=_0x3be88f[_0x121876];if(_['isUndefined'](_0x2c0200[_0x6467('0x22')][_0x2f561a['id']])){_0x2c0200[_0x6467('0x22')][_0x2f561a['id']]=new ServicenowAccount(_0x2f561a);}else{_0x2c0200[_0x6467('0x42')](_0x2c0200[_0x6467('0x22')][_0x2f561a['id']],_0x2f561a);}}}return _0x2c0200['servicenowAccounts'];};};Realtime[_0x6467('0x43')][_0x6467('0x55')]=function(){var _0x31650e=this;return function(_0x539d91){if(_0x539d91){freeIsNotKey(_0x539d91,_0x31650e[_0x6467('0x23')],'id');for(var _0x6f21fc=0x0,_0x2b50d7={},_0x725815={};_0x6f21fc<_0x539d91[_0x6467('0x45')];_0x6f21fc+=0x1){_0x2b50d7=_0x539d91[_0x6f21fc];if(_[_0x6467('0x46')](_0x31650e[_0x6467('0x23')][_0x2b50d7['id']])){_0x31650e['dynamics365Accounts'][_0x2b50d7['id']]=new Dynamics365Account(_0x2b50d7);}else{_0x31650e[_0x6467('0x42')](_0x31650e[_0x6467('0x23')][_0x2b50d7['id']],_0x2b50d7);}}}return _0x31650e[_0x6467('0x23')];};};Realtime[_0x6467('0x43')]['initVoiceQueueHopperHistory']=function(){var _0x3bcebc=this;return function(_0x8ef66){for(var _0x3f0727=0x0;_0x3f0727<_0x8ef66[_0x6467('0x45')];_0x3f0727+=0x1){_[_0x6467('0x56')](_0x3bcebc[_0x6467('0x12')][_0x8ef66[_0x3f0727][_0x6467('0x29')]],_0x8ef66[_0x3f0727]);}return _0x3bcebc[_0x6467('0x12')];};};Realtime['prototype'][_0x6467('0x57')]=function(){var _0x46e4c6=this;return function(_0x1dcccd){clearVoiceQueues(_0x46e4c6[_0x6467('0x12')]);if(_0x1dcccd){_0x1dcccd=_[_0x6467('0x58')](_0x1dcccd,'uniqueid');for(var _0x242d3d in _0x1dcccd){if(_0x1dcccd[_0x6467('0x26')](_0x242d3d)){var _0x5cc272={};for(var _0x416d39=0x0;_0x416d39<_0x1dcccd[_0x242d3d][_0x6467('0x45')];_0x416d39+=0x1){var _0x182e30=_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x59')];if(_0x46e4c6[_0x6467('0x12')][_0x182e30]){if(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5a')]){_0x46e4c6[_0x6467('0x12')][_0x182e30]['unmanaged']+=0x1;}if(_0x1dcccd[_0x242d3d][_0x416d39]['queuecallerabandon']){_0x46e4c6['voiceQueues'][_0x182e30]['abandoned']+=0x1;}_0x46e4c6['voiceQueues'][_0x182e30][_0x6467('0x2e')]+=moment(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5b')])[_0x6467('0x5c')](moment(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5d')]),_0x6467('0x5e'))||0x0;if(_0x416d39===_0x1dcccd[_0x242d3d][_0x6467('0x45')]-0x1){_0x46e4c6[_0x6467('0x12')][_0x182e30][_0x6467('0x35')]+=moment(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5f')]||_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x60')]||_0x1dcccd[_0x242d3d][_0x416d39]['queuecallerexitAt'])[_0x6467('0x5c')](moment(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5d')]),'seconds')||0x0;_0x46e4c6[_0x6467('0x12')][_0x182e30][_0x6467('0x2c')]+=0x1;if(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x61')]){_0x46e4c6['voiceQueues'][_0x182e30][_0x6467('0x2d')]+=0x1;_0x46e4c6[_0x6467('0x12')][_0x182e30][_0x6467('0x2f')]+=moment(_0x1dcccd[_0x242d3d][_0x416d39]['queuecallercompleteAt'])['diff'](moment(_0x1dcccd[_0x242d3d][_0x416d39][_0x6467('0x5b')]),_0x6467('0x5e'))||0x0;}}else{_0x46e4c6[_0x6467('0x12')][_0x182e30][_0x6467('0x35')]+=_0x46e4c6[_0x6467('0x12')][_0x182e30][_0x6467('0x2e')]||0x0;}}}}}}return _0x46e4c6[_0x6467('0x12')];};};Realtime['prototype'][_0x6467('0x62')]=function(){var _0x418b75=this;return function(_0x48569f){clearVoiceCallReports(_0x418b75[_0x6467('0x16')]);if(_0x48569f){for(var _0x50734c=0x0;_0x50734c<_0x48569f[_0x6467('0x45')];_0x50734c+=0x1){_0x418b75[_0x6467('0x16')][_0x6467('0x2c')]+=0x1;_0x418b75[_0x6467('0x16')][_0x6467('0x35')]+=_0x48569f[_0x50734c][_0x6467('0x63')];if(_0x48569f[_0x50734c][_0x6467('0x64')]===_0x6467('0x65')){_0x418b75[_0x6467('0x16')]['answered']+=0x1;_0x418b75['outbound'][_0x6467('0x2e')]+=_0x48569f[_0x50734c][_0x6467('0x63')]-_0x48569f[_0x50734c][_0x6467('0x66')]||0x0;_0x418b75[_0x6467('0x16')][_0x6467('0x2f')]+=_0x48569f[_0x50734c][_0x6467('0x66')];}}}return _0x418b75[_0x6467('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x3f9710=this;return function(_0x459114){if(_0x459114){freeIsNotKey(_0x459114,_0x3f9710['campaigns'],'name');for(var _0x3f3548=0x0,_0x41b3d={};_0x3f3548<_0x459114[_0x6467('0x45')];_0x3f3548+=0x1){_0x41b3d=_0x459114[_0x3f3548];if(_[_0x6467('0x46')](_0x3f9710[_0x6467('0x14')][_0x41b3d[_0x6467('0x29')]])){_0x3f9710[_0x6467('0x14')][_0x41b3d[_0x6467('0x29')]]=new Campaign(_0x41b3d);}else{_0x3f9710['mergeFromDatabase'](_0x3f9710[_0x6467('0x14')][_0x41b3d['name']],_0x41b3d);}}}return _0x3f9710[_0x6467('0x14')];};};Realtime[_0x6467('0x43')]['initVoiceExtensions']=function(){var _0x93fadc=this;return function(_0x5cddeb){if(_0x5cddeb){freeIsNotKey(_0x5cddeb,_0x93fadc['voiceExtensions'],'id');for(var _0x41dae5=0x0,_0x4b2e43={};_0x41dae5<_0x5cddeb[_0x6467('0x45')];_0x41dae5+=0x1){_0x4b2e43=_0x5cddeb[_0x41dae5];if(_[_0x6467('0x46')](_0x93fadc['voiceExtensions'][_0x4b2e43['id']])){_0x93fadc[_0x6467('0x17')][_0x4b2e43['id']]=new VoiceExtension(_0x4b2e43);}else{_0x93fadc['mergeFromDatabase'](_0x93fadc[_0x6467('0x17')][_0x4b2e43['id']],_0x4b2e43);}}}return _0x93fadc['voiceExtensions'];};};Realtime['prototype'][_0x6467('0x67')]=function(){var _0x11a259=this;return function(_0x49d84a){clearCampaigns(_0x11a259['campaigns']);for(var _0x1aa0a0=0x0;_0x1aa0a0<_0x49d84a['length'];_0x1aa0a0+=0x1){_['merge'](_0x11a259['campaigns'][_0x49d84a[_0x1aa0a0][_0x6467('0x29')]],_0x49d84a[_0x1aa0a0]);}return _0x11a259[_0x6467('0x14')];};};Realtime[_0x6467('0x43')]['initFaxAccounts']=function(){var _0x1f6644=this;return function(_0xb6262){if(_0xb6262){freeIsNotKey(_0xb6262,_0x1f6644[_0x6467('0x24')],'id');for(var _0x105d0a=0x0,_0x78886f={},_0x26f729={};_0x105d0a<_0xb6262[_0x6467('0x45')];_0x105d0a+=0x1){_0x78886f=_0xb6262[_0x105d0a];if(_['isUndefined'](_0x1f6644[_0x6467('0x24')][_0x78886f['id']])){_0x1f6644[_0x6467('0x24')][_0x78886f['id']]=new FaxAccount(_0x78886f);}else{_0x1f6644[_0x6467('0x42')](_0x1f6644[_0x6467('0x24')][_0x78886f['id']],_0x78886f);}}}return _0x1f6644[_0x6467('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0x4b68=['billableseconds','initCampaigns','initCampaignHopperHistory','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','faxAccounts','mapKeys','format','SIP/%s','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','hasOwnProperty','ivrTotalCallsDays','total','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','initVoiceQueues','initTemplates','templates','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','duration','disposition','ANSWERED'];(function(_0x147e86,_0x320160){var _0x3b20c2=function(_0x457518){while(--_0x457518){_0x147e86['push'](_0x147e86['shift']());}};_0x3b20c2(++_0x320160);}(_0x4b68,0x129));var _0x84b6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4b68[_0xfae23b];return _0x200640;};'use strict';var BPromise=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var _=require(_0x84b6('0x2'));var moment=require(_0x84b6('0x3'));var Agent=require(_0x84b6('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x84b6('0x5'));var VoiceQueue=require(_0x84b6('0x6'));var Trigger=require(_0x84b6('0x7'));var Template=require(_0x84b6('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x84b6('0x9'));var ZendeskAccount=require(_0x84b6('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x84b6('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x84b6('0xc'));var DeskAccount=require(_0x84b6('0xd'));var VtigerAccount=require(_0x84b6('0xe'));var ServicenowAccount=require(_0x84b6('0xf'));var Dynamics365Account=require(_0x84b6('0x10'));var FaxAccount=require(_0x84b6('0x11'));var Realtime=function(){this['agents']={};this[_0x84b6('0x12')]={};this[_0x84b6('0x13')]={};this[_0x84b6('0x14')]={};this[_0x84b6('0x15')]={};this[_0x84b6('0x16')]={};this['templates']={};this[_0x84b6('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x84b6('0x18')]={};this[_0x84b6('0x19')]={};this['queueChannels']={};this[_0x84b6('0x1a')]={};this[_0x84b6('0x1b')]={};this[_0x84b6('0x1c')]={};this[_0x84b6('0x1d')]={};this[_0x84b6('0x1e')]={};this[_0x84b6('0x1f')]={};this['zohoAccounts']={};this[_0x84b6('0x20')]={};this[_0x84b6('0x21')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0x84b6('0x22')]={};};function freeIsNotKey(_0x13be87,_0x43591e,_0x5166ab){var _0x589e84=_[_0x84b6('0x23')](_0x13be87,function(_0x16ae4d,_0x40dbe0){return _0x16ae4d[_0x5166ab];});for(var _0x1cfc07 in _0x43591e){if(_0x43591e['hasOwnProperty'](_0x1cfc07)){if(!_0x589e84[_0x1cfc07]){delete _0x43591e[_0x1cfc07];}}}}function freeIsNotKeySip(_0x5310a6,_0x24fb95){var _0x3b8af5=_[_0x84b6('0x23')](_0x5310a6,function(_0x37a6d9,_0x5344fd){return util[_0x84b6('0x24')](_0x84b6('0x25'),_0x37a6d9[_0x84b6('0x26')]);});for(var _0x44fb33 in _0x24fb95){if(_0x24fb95['hasOwnProperty'](_0x44fb33)){if(!_0x3b8af5[_0x44fb33]){delete _0x24fb95[_0x44fb33];}}}}function freeIsNotKeyAgent(_0x2a1155,_0x548529){var _0x2f2095=_[_0x84b6('0x23')](_0x2a1155,function(_0x1a0df5,_0x43f876){var _0xba4687=_[_0x84b6('0x27')](_0x1a0df5[_0x84b6('0x28')])?util['format'](_0x84b6('0x25'),_0x1a0df5[_0x84b6('0x26')]):_0x1a0df5[_0x84b6('0x28')];return _0xba4687;});for(var _0x2cb07b in _0x548529){if(_0x548529['hasOwnProperty'](_0x2cb07b)){if(!_0x2f2095[_0x2cb07b]){delete _0x548529[_0x2cb07b];}}}}function clearVoiceCallReports(_0x70a21c){_0x70a21c['total']=0x0;_0x70a21c['answered']=0x0;_0x70a21c[_0x84b6('0x29')]=0x0;_0x70a21c[_0x84b6('0x2a')]=0x0;_0x70a21c[_0x84b6('0x2b')]=0x0;}function clearCampaigns(_0x268b75){if(!_[_0x84b6('0x2c')](_0x268b75)){for(var _0x5ee128 in _0x268b75){if(_0x268b75[_0x84b6('0x2d')](_0x5ee128)){_0x268b75[_0x5ee128][_0x84b6('0x2e')]=0x0;_0x268b75[_0x5ee128]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x55f4c3){if(!_[_0x84b6('0x2c')](_0x55f4c3)){for(var _0x207bd3 in _0x55f4c3){if(_0x55f4c3['hasOwnProperty'](_0x207bd3)){_0x55f4c3[_0x207bd3][_0x84b6('0x2f')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x30')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x31')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x32')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x29')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x2a')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x2b')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x33')]=0x0;_0x55f4c3[_0x207bd3]['outboundNoAnswerCallsDay']=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x34')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x35')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x36')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x37')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x38')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x39')]=0x0;_0x55f4c3[_0x207bd3]['outboundBlacklistCallsDay']=0x0;_0x55f4c3[_0x207bd3]['outboundOriginateFailureCallsDay']=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x3a')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x3b')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x33')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x3c')]=0x0;_0x55f4c3[_0x207bd3][_0x84b6('0x3d')]=!![];}}}}Realtime[_0x84b6('0x3e')][_0x84b6('0x3f')]=function(_0x4d921c,_0x348731){for(var _0x38ed40 in _0x348731){if(_0x4d921c[_0x84b6('0x2d')](_0x38ed40)){_0x4d921c[_0x38ed40]=_0x348731[_0x38ed40];}}};Realtime[_0x84b6('0x3e')][_0x84b6('0x40')]=function(){var _0x4cbf29=this;return function(_0x1a69da){if(_0x1a69da){freeIsNotKeyAgent(_0x1a69da,_0x4cbf29['agents']);for(var _0x4d0444=0x0,_0x202423={},_0x588fdb={};_0x4d0444<_0x1a69da[_0x84b6('0x41')];_0x4d0444+=0x1){_0x202423=_0x1a69da[_0x4d0444];var _0x1200b0=_[_0x84b6('0x27')](_0x202423[_0x84b6('0x28')])?util[_0x84b6('0x24')](_0x84b6('0x25'),_0x202423[_0x84b6('0x26')]):_0x202423['interface'];if(_[_0x84b6('0x42')](_0x4cbf29['agents'][_0x1200b0])){_0x4cbf29[_0x84b6('0x43')][_0x1200b0]=new Agent(_0x202423);}else{_0x4cbf29[_0x84b6('0x3f')](_0x4cbf29[_0x84b6('0x43')][_0x1200b0],_0x202423);}}}return _0x4cbf29[_0x84b6('0x43')];};};Realtime['prototype']['initTelephones']=function(){var _0x83503b=this;return function(_0x405498){if(_0x405498){freeIsNotKeySip(_0x405498,_0x83503b[_0x84b6('0x12')]);for(var _0x10a3d7=0x0,_0x482d06={},_0x452be6={};_0x10a3d7<_0x405498['length'];_0x10a3d7+=0x1){_0x482d06=_0x405498[_0x10a3d7];if(_['isUndefined'](_0x83503b[_0x84b6('0x12')][util[_0x84b6('0x24')](_0x84b6('0x25'),_0x482d06[_0x84b6('0x26')])])){_0x83503b['telephones'][util[_0x84b6('0x24')]('SIP/%s',_0x482d06['name'])]=new Telephone(_0x482d06);}else{_0x83503b[_0x84b6('0x3f')](_0x83503b[_0x84b6('0x12')][util[_0x84b6('0x24')](_0x84b6('0x25'),_0x482d06[_0x84b6('0x26')])],_0x482d06);}}}return _0x83503b['telephones'];};};Realtime[_0x84b6('0x3e')]['initTrunks']=function(){var _0x15894c=this;return function(_0x5cbca5){if(_0x5cbca5){freeIsNotKeySip(_0x5cbca5,_0x15894c[_0x84b6('0x13')]);for(var _0x152925=0x0,_0x527768={},_0x2318c8={};_0x152925<_0x5cbca5[_0x84b6('0x41')];_0x152925+=0x1){_0x527768=_0x5cbca5[_0x152925];if(_[_0x84b6('0x42')](_0x15894c[_0x84b6('0x13')][util[_0x84b6('0x24')]('SIP/%s',_0x527768[_0x84b6('0x26')])])){_0x15894c[_0x84b6('0x13')][util[_0x84b6('0x24')](_0x84b6('0x25'),_0x527768[_0x84b6('0x26')])]=new Trunk(_0x527768);}else{_0x15894c[_0x84b6('0x3f')](_0x15894c['trunks'][util[_0x84b6('0x24')]('SIP/%s',_0x527768['name'])],_0x527768);}}}return _0x15894c['trunks'];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x44')]=function(){var _0xe187f4=this;return function(_0x5a2b53){if(_0x5a2b53){freeIsNotKey(_0x5a2b53,_0xe187f4[_0x84b6('0x14')],'name');for(var _0x2529fe=0x0,_0xef9c98={},_0x2978b7={};_0x2529fe<_0x5a2b53[_0x84b6('0x41')];_0x2529fe+=0x1){_0xef9c98=_0x5a2b53[_0x2529fe];if(_[_0x84b6('0x42')](_0xe187f4['voiceQueues'][_0xef9c98[_0x84b6('0x26')]])){_0xe187f4[_0x84b6('0x14')][_0xef9c98[_0x84b6('0x26')]]=new VoiceQueue(_0xef9c98);}else{_0xe187f4['mergeFromDatabase'](_0xe187f4[_0x84b6('0x14')][_0xef9c98[_0x84b6('0x26')]],_0xef9c98);}}}return _0xe187f4[_0x84b6('0x14')];};};Realtime[_0x84b6('0x3e')]['initTriggers']=function(){var _0x23a00c=this;return function(_0x34c17a){if(_0x34c17a){freeIsNotKey(_0x34c17a,_0x23a00c['triggers'],'id');for(var _0x2838ad=0x0,_0x2bd140={},_0x3ac811={};_0x2838ad<_0x34c17a[_0x84b6('0x41')];_0x2838ad+=0x1){_0x2bd140=_0x34c17a[_0x2838ad];if(_[_0x84b6('0x42')](_0x23a00c[_0x84b6('0x15')][_0x2bd140['id']])){_0x23a00c[_0x84b6('0x15')][_0x2bd140['id']]=new Trigger(_0x2bd140);}else{_0x23a00c['mergeFromDatabase'](_0x23a00c[_0x84b6('0x15')][_0x2bd140['id']],_0x2bd140);}}}return _0x23a00c[_0x84b6('0x15')];};};Realtime['prototype'][_0x84b6('0x45')]=function(){var _0x41f227=this;return function(_0x38e72f){if(_0x38e72f){freeIsNotKey(_0x38e72f,_0x41f227['templates'],'id');for(var _0x181f86=0x0,_0x5bbabe={},_0x2b8783={};_0x181f86<_0x38e72f[_0x84b6('0x41')];_0x181f86+=0x1){_0x5bbabe=_0x38e72f[_0x181f86];if(_['isUndefined'](_0x41f227['templates'][_0x5bbabe['id']])){_0x41f227[_0x84b6('0x46')][_0x5bbabe['id']]=new Template(_0x5bbabe);}else{_0x41f227['mergeFromDatabase'](_0x41f227[_0x84b6('0x46')][_0x5bbabe['id']],_0x5bbabe);}}}return _0x41f227[_0x84b6('0x46')];};};Realtime[_0x84b6('0x3e')]['initZendeskAccounts']=function(){var _0x574712=this;return function(_0x281b1c){if(_0x281b1c){freeIsNotKey(_0x281b1c,_0x574712[_0x84b6('0x1c')],'id');for(var _0x5cfa1a=0x0,_0x55ed6e={},_0x328608={};_0x5cfa1a<_0x281b1c[_0x84b6('0x41')];_0x5cfa1a+=0x1){_0x55ed6e=_0x281b1c[_0x5cfa1a];if(_[_0x84b6('0x42')](_0x574712[_0x84b6('0x1c')][_0x55ed6e['id']])){_0x574712[_0x84b6('0x1c')][_0x55ed6e['id']]=new ZendeskAccount(_0x55ed6e);}else{_0x574712[_0x84b6('0x3f')](_0x574712[_0x84b6('0x1c')][_0x55ed6e['id']],_0x55ed6e);}}}return _0x574712[_0x84b6('0x1c')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0xc56bc3=this;return function(_0x1a76c8){if(_0x1a76c8){freeIsNotKey(_0x1a76c8,_0xc56bc3[_0x84b6('0x1d')],'id');for(var _0x4a593d=0x0,_0x31a459={},_0x53c219={};_0x4a593d<_0x1a76c8[_0x84b6('0x41')];_0x4a593d+=0x1){_0x31a459=_0x1a76c8[_0x4a593d];if(_[_0x84b6('0x42')](_0xc56bc3[_0x84b6('0x1d')][_0x31a459['id']])){_0xc56bc3[_0x84b6('0x1d')][_0x31a459['id']]=new SalesforceAccount(_0x31a459);}else{_0xc56bc3['mergeFromDatabase'](_0xc56bc3[_0x84b6('0x1d')][_0x31a459['id']],_0x31a459);}}}return _0xc56bc3[_0x84b6('0x1d')];};};Realtime[_0x84b6('0x3e')]['initFreshdeskAccounts']=function(){var _0x32dd35=this;return function(_0xf1331f){if(_0xf1331f){freeIsNotKey(_0xf1331f,_0x32dd35[_0x84b6('0x1f')],'id');for(var _0x52d7ac=0x0,_0x2e7641={},_0x9c67ee={};_0x52d7ac<_0xf1331f[_0x84b6('0x41')];_0x52d7ac+=0x1){_0x2e7641=_0xf1331f[_0x52d7ac];if(_['isUndefined'](_0x32dd35[_0x84b6('0x1f')][_0x2e7641['id']])){_0x32dd35[_0x84b6('0x1f')][_0x2e7641['id']]=new FreshdeskAccount(_0x2e7641);}else{_0x32dd35[_0x84b6('0x3f')](_0x32dd35[_0x84b6('0x1f')][_0x2e7641['id']],_0x2e7641);}}}return _0x32dd35[_0x84b6('0x1f')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x47')]=function(){var _0x56d220=this;return function(_0x54ece1){if(_0x54ece1){freeIsNotKey(_0x54ece1,_0x56d220[_0x84b6('0x48')],'id');for(var _0x32d894=0x0,_0x44ba33={},_0x39ca04={};_0x32d894<_0x54ece1[_0x84b6('0x41')];_0x32d894+=0x1){_0x44ba33=_0x54ece1[_0x32d894];if(_[_0x84b6('0x42')](_0x56d220[_0x84b6('0x48')][_0x44ba33['id']])){_0x56d220['zohoAccounts'][_0x44ba33['id']]=new ZohoAccount(_0x44ba33);}else{_0x56d220[_0x84b6('0x3f')](_0x56d220[_0x84b6('0x48')][_0x44ba33['id']],_0x44ba33);}}}return _0x56d220['zohoAccounts'];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x49')]=function(){var _0x71145a=this;return function(_0x512521){if(_0x512521){freeIsNotKey(_0x512521,_0x71145a['deskAccounts'],'id');for(var _0x508352=0x0,_0x5c59ee={},_0x4430dd={};_0x508352<_0x512521[_0x84b6('0x41')];_0x508352+=0x1){_0x5c59ee=_0x512521[_0x508352];if(_['isUndefined'](_0x71145a[_0x84b6('0x20')][_0x5c59ee['id']])){_0x71145a[_0x84b6('0x20')][_0x5c59ee['id']]=new DeskAccount(_0x5c59ee);}else{_0x71145a['mergeFromDatabase'](_0x71145a[_0x84b6('0x20')][_0x5c59ee['id']],_0x5c59ee);}}}return _0x71145a[_0x84b6('0x20')];};};Realtime[_0x84b6('0x3e')]['initSugarcrmAccounts']=function(){var _0x100b4f=this;return function(_0x1c258e){if(_0x1c258e){freeIsNotKey(_0x1c258e,_0x100b4f[_0x84b6('0x1e')],'id');for(var _0x34d383=0x0,_0x45b3fa={},_0x3fd673={};_0x34d383<_0x1c258e[_0x84b6('0x41')];_0x34d383+=0x1){_0x45b3fa=_0x1c258e[_0x34d383];if(_[_0x84b6('0x42')](_0x100b4f[_0x84b6('0x1e')][_0x45b3fa['id']])){_0x100b4f[_0x84b6('0x1e')][_0x45b3fa['id']]=new SugarcrmAccount(_0x45b3fa);}else{_0x100b4f[_0x84b6('0x3f')](_0x100b4f[_0x84b6('0x1e')][_0x45b3fa['id']],_0x45b3fa);}}}return _0x100b4f[_0x84b6('0x1e')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x4a')]=function(){var _0x92abe0=this;return function(_0x2443ee){if(_0x2443ee){freeIsNotKey(_0x2443ee,_0x92abe0[_0x84b6('0x21')],'id');for(var _0x5bca18=0x0,_0x50d9c5={},_0x582b3e={};_0x5bca18<_0x2443ee[_0x84b6('0x41')];_0x5bca18+=0x1){_0x50d9c5=_0x2443ee[_0x5bca18];if(_[_0x84b6('0x42')](_0x92abe0['vtigerAccounts'][_0x50d9c5['id']])){_0x92abe0[_0x84b6('0x21')][_0x50d9c5['id']]=new VtigerAccount(_0x50d9c5);}else{_0x92abe0[_0x84b6('0x3f')](_0x92abe0['vtigerAccounts'][_0x50d9c5['id']],_0x50d9c5);}}}return _0x92abe0[_0x84b6('0x21')];};};Realtime[_0x84b6('0x3e')]['initServicenowAccounts']=function(){var _0x5e2773=this;return function(_0xe4851c){if(_0xe4851c){freeIsNotKey(_0xe4851c,_0x5e2773['servicenowAccounts'],'id');for(var _0x183ec6=0x0,_0x45368a={},_0x61558b={};_0x183ec6<_0xe4851c['length'];_0x183ec6+=0x1){_0x45368a=_0xe4851c[_0x183ec6];if(_['isUndefined'](_0x5e2773[_0x84b6('0x4b')][_0x45368a['id']])){_0x5e2773[_0x84b6('0x4b')][_0x45368a['id']]=new ServicenowAccount(_0x45368a);}else{_0x5e2773[_0x84b6('0x3f')](_0x5e2773[_0x84b6('0x4b')][_0x45368a['id']],_0x45368a);}}}return _0x5e2773[_0x84b6('0x4b')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x4c')]=function(){var _0x7d641e=this;return function(_0x37ff48){if(_0x37ff48){freeIsNotKey(_0x37ff48,_0x7d641e['dynamics365Accounts'],'id');for(var _0x24e788=0x0,_0x53cfb6={},_0x167833={};_0x24e788<_0x37ff48[_0x84b6('0x41')];_0x24e788+=0x1){_0x53cfb6=_0x37ff48[_0x24e788];if(_[_0x84b6('0x42')](_0x7d641e[_0x84b6('0x4d')][_0x53cfb6['id']])){_0x7d641e[_0x84b6('0x4d')][_0x53cfb6['id']]=new Dynamics365Account(_0x53cfb6);}else{_0x7d641e['mergeFromDatabase'](_0x7d641e[_0x84b6('0x4d')][_0x53cfb6['id']],_0x53cfb6);}}}return _0x7d641e[_0x84b6('0x4d')];};};Realtime['prototype'][_0x84b6('0x4e')]=function(){var _0x2be68f=this;return function(_0xbf6eb4){for(var _0x461af8=0x0;_0x461af8<_0xbf6eb4[_0x84b6('0x41')];_0x461af8+=0x1){_[_0x84b6('0x4f')](_0x2be68f['voiceQueues'][_0xbf6eb4[_0x461af8][_0x84b6('0x26')]],_0xbf6eb4[_0x461af8]);}return _0x2be68f[_0x84b6('0x14')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x50')]=function(){var _0x1ee9ab=this;return function(_0x3e9d65){clearVoiceQueues(_0x1ee9ab['voiceQueues']);if(_0x3e9d65){_0x3e9d65=_[_0x84b6('0x51')](_0x3e9d65,'uniqueid');for(var _0x48a206 in _0x3e9d65){if(_0x3e9d65[_0x84b6('0x2d')](_0x48a206)){var _0x924616={};for(var _0x5a0373=0x0;_0x5a0373<_0x3e9d65[_0x48a206][_0x84b6('0x41')];_0x5a0373+=0x1){var _0x37c6d6=_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x52')];if(_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6]){if(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x53')]){_0x1ee9ab['voiceQueues'][_0x37c6d6][_0x84b6('0x31')]+=0x1;}if(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x54')]){_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6][_0x84b6('0x32')]+=0x1;}_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6][_0x84b6('0x29')]+=moment(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x55')])[_0x84b6('0x56')](moment(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x57')]),_0x84b6('0x58'))||0x0;if(_0x5a0373===_0x3e9d65[_0x48a206]['length']-0x1){_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6][_0x84b6('0x2a')]+=moment(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x59')]||_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x5a')]||_0x3e9d65[_0x48a206][_0x5a0373]['queuecallerexitAt'])['diff'](moment(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x57')]),_0x84b6('0x58'))||0x0;_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6]['total']+=0x1;if(_0x3e9d65[_0x48a206][_0x5a0373][_0x84b6('0x5b')]){_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6][_0x84b6('0x30')]+=0x1;_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6][_0x84b6('0x2b')]+=moment(_0x3e9d65[_0x48a206][_0x5a0373]['queuecallercompleteAt'])[_0x84b6('0x56')](moment(_0x3e9d65[_0x48a206][_0x5a0373]['queuecallerleaveAt']),_0x84b6('0x58'))||0x0;}}else{_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6]['sumDuration']+=_0x1ee9ab[_0x84b6('0x14')][_0x37c6d6]['sumHoldTime']||0x0;}}}}}}return _0x1ee9ab[_0x84b6('0x14')];};};Realtime[_0x84b6('0x3e')]['initVoiceCallReports']=function(){var _0x527910=this;return function(_0xdf6963){clearVoiceCallReports(_0x527910[_0x84b6('0x17')]);if(_0xdf6963){for(var _0x4f9c6f=0x0;_0x4f9c6f<_0xdf6963[_0x84b6('0x41')];_0x4f9c6f+=0x1){_0x527910[_0x84b6('0x17')][_0x84b6('0x2f')]+=0x1;_0x527910[_0x84b6('0x17')]['sumDuration']+=_0xdf6963[_0x4f9c6f][_0x84b6('0x5c')];if(_0xdf6963[_0x4f9c6f][_0x84b6('0x5d')]===_0x84b6('0x5e')){_0x527910['outbound']['answered']+=0x1;_0x527910[_0x84b6('0x17')][_0x84b6('0x29')]+=_0xdf6963[_0x4f9c6f][_0x84b6('0x5c')]-_0xdf6963[_0x4f9c6f][_0x84b6('0x5f')]||0x0;_0x527910[_0x84b6('0x17')][_0x84b6('0x2b')]+=_0xdf6963[_0x4f9c6f][_0x84b6('0x5f')];}}}return _0x527910[_0x84b6('0x17')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x60')]=function(){var _0x1a9cc8=this;return function(_0x173740){if(_0x173740){freeIsNotKey(_0x173740,_0x1a9cc8[_0x84b6('0x16')],_0x84b6('0x26'));for(var _0x4bf924=0x0,_0x4ded80={};_0x4bf924<_0x173740[_0x84b6('0x41')];_0x4bf924+=0x1){_0x4ded80=_0x173740[_0x4bf924];if(_[_0x84b6('0x42')](_0x1a9cc8[_0x84b6('0x16')][_0x4ded80[_0x84b6('0x26')]])){_0x1a9cc8[_0x84b6('0x16')][_0x4ded80[_0x84b6('0x26')]]=new Campaign(_0x4ded80);}else{_0x1a9cc8[_0x84b6('0x3f')](_0x1a9cc8[_0x84b6('0x16')][_0x4ded80[_0x84b6('0x26')]],_0x4ded80);}}}return _0x1a9cc8[_0x84b6('0x16')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x324405=this;return function(_0x11ddcd){if(_0x11ddcd){freeIsNotKey(_0x11ddcd,_0x324405[_0x84b6('0x18')],'id');for(var _0x56aec6=0x0,_0x399e16={};_0x56aec6<_0x11ddcd[_0x84b6('0x41')];_0x56aec6+=0x1){_0x399e16=_0x11ddcd[_0x56aec6];if(_[_0x84b6('0x42')](_0x324405['voiceExtensions'][_0x399e16['id']])){_0x324405[_0x84b6('0x18')][_0x399e16['id']]=new VoiceExtension(_0x399e16);}else{_0x324405[_0x84b6('0x3f')](_0x324405[_0x84b6('0x18')][_0x399e16['id']],_0x399e16);}}}return _0x324405[_0x84b6('0x18')];};};Realtime[_0x84b6('0x3e')][_0x84b6('0x61')]=function(){var _0x138987=this;return function(_0x3dfc77){clearCampaigns(_0x138987[_0x84b6('0x16')]);for(var _0x4097e1=0x0;_0x4097e1<_0x3dfc77[_0x84b6('0x41')];_0x4097e1+=0x1){_[_0x84b6('0x4f')](_0x138987['campaigns'][_0x3dfc77[_0x4097e1][_0x84b6('0x26')]],_0x3dfc77[_0x4097e1]);}return _0x138987['campaigns'];};};Realtime[_0x84b6('0x3e')]['initFaxAccounts']=function(){var _0x28d2f9=this;return function(_0x15a231){if(_0x15a231){freeIsNotKey(_0x15a231,_0x28d2f9[_0x84b6('0x22')],'id');for(var _0x237e72=0x0,_0x2ab2e7={},_0x21891f={};_0x237e72<_0x15a231['length'];_0x237e72+=0x1){_0x2ab2e7=_0x15a231[_0x237e72];if(_[_0x84b6('0x42')](_0x28d2f9[_0x84b6('0x22')][_0x2ab2e7['id']])){_0x28d2f9[_0x84b6('0x22')][_0x2ab2e7['id']]=new FaxAccount(_0x2ab2e7);}else{_0x28d2f9[_0x84b6('0x3f')](_0x28d2f9['faxAccounts'][_0x2ab2e7['id']],_0x2ab2e7);}}}return _0x28d2f9[_0x84b6('0x22')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 80a9f20..a1ce2f5 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 _0x9d2b=['voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','format','name','length','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','dialer','lastapplication','queue','context','from-voip-provider','callerid','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','calleridpreview','calleridnum','disposition','ANSWERED','calleridname','create','monitor','monitors','monitorFilename','filename','connectedlinename','connectedlinenum','membername','exten','xcally-motion-dialer','isArray','forEach','Local','indexOf','mobile','phone','substring','lastIndexOf','blindTransfer','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport'];(function(_0x3aba7d,_0x13e136){var _0x7b0814=function(_0x163f04){while(--_0x163f04){_0x3aba7d['push'](_0x3aba7d['shift']());}};_0x7b0814(++_0x13e136);}(_0x9d2b,0x1a0));var _0xb9d2=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x9d2b[_0x47568e];return _0x33815b;};'use strict';var BPromise=require(_0xb9d2('0x0'));var _=require(_0xb9d2('0x1'));var moment=require(_0xb9d2('0x2'));var util=require(_0xb9d2('0x3'));var config=require(_0xb9d2('0x4'));var logger=require(_0xb9d2('0x5'))('ami');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xb9d2('0x6'));var RpcVoiceCallReport=require(_0xb9d2('0x7'));var RpcVoiceDialReport=require(_0xb9d2('0x8'));var RpcMemberReport=require(_0xb9d2('0x9'));var RpcVoiceQueueReport=require(_0xb9d2('0xa'));var RpcVoiceRecording=require(_0xb9d2('0xb'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xb9d2('0xc'));var VoiceCallReport=require(_0xb9d2('0xd'));var VoiceAgentReport=require(_0xb9d2('0xe'));var VoiceDialReport=require(_0xb9d2('0xf'));var UserReport=require(_0xb9d2('0x10'));function Report(_0x4af16c){this[_0xb9d2('0x11')]=_0x4af16c;this[_0xb9d2('0x12')]=_0x4af16c[_0xb9d2('0x12')];this[_0xb9d2('0x13')]=_0x4af16c[_0xb9d2('0x13')];}Report[_0xb9d2('0x14')][_0xb9d2('0x15')]=function(_0x182f6f){var _0x3a2b30=new VoiceQueueReport(this[_0xb9d2('0x11')]);var _0xcbe8e=new VoiceAgentReport(this[_0xb9d2('0x11')]);var _0x2ffeeb=new VoiceDialReport(this[_0xb9d2('0x11')]);var _0x840ced=new VoiceCallReport(this[_0xb9d2('0x11')]);var _0x299c18=new UserReport(this['realtime']);if(config[_0xb9d2('0x16')]&&config[_0xb9d2('0x16')]['disabled']){ami['on'](_0xb9d2('0x17'),this[_0xb9d2('0x18')]['bind'](this));ami['on'](_0xb9d2('0x19'),this[_0xb9d2('0x1a')][_0xb9d2('0x1b')](this));ami['on'](_0xb9d2('0x1c'),this[_0xb9d2('0x1d')][_0xb9d2('0x1b')](this));ami['on'](_0xb9d2('0x1e'),this[_0xb9d2('0x1f')][_0xb9d2('0x1b')](this));ami['on'](_0xb9d2('0x20'),this['blindTransfer'][_0xb9d2('0x1b')](this));ami['on'](_0xb9d2('0x21'),this[_0xb9d2('0x22')]['bind'](this));}};Report[_0xb9d2('0x14')][_0xb9d2('0x23')]=function(_0x45df3d){var _0xa465f=undefined;_0xa465f=_[_0xb9d2('0x24')](this['agents'],function(_0x2954f4){return _0x2954f4[_0xb9d2('0x25')]==_0x45df3d||_0x2954f4['name']==_0x45df3d;});if(_[_0xb9d2('0x26')](_0xa465f)){var _0x3b01d1=_[_0xb9d2('0x24')](this['telephones'],function(_0x33b6c7){return _0x33b6c7[_0xb9d2('0x25')]==_0x45df3d||_0x33b6c7['name']==_0x45df3d;});if(_0x3b01d1){_0xa465f=_[_0xb9d2('0x24')](this[_0xb9d2('0x12')],function(_0x238dbe){return _0x238dbe[_0xb9d2('0x27')]==util[_0xb9d2('0x28')]('SIP/%s',_0x3b01d1[_0xb9d2('0x29')]);});}}return _0xa465f;};Report[_0xb9d2('0x14')][_0xb9d2('0x18')]=function(_0x599b22){for(var _0x554e52=0x0;_0x554e52<_0x599b22[_0xb9d2('0x2a')];_0x554e52+=0x1){var _0x4c1b34=this[_0xb9d2('0x23')](_0x599b22[_0x554e52]['connectedlinenum']);if(_0x4c1b34){_0x599b22[_0x554e52][_0xb9d2('0x25')]=_0x4c1b34[_0xb9d2('0x25')];_0x599b22[_0x554e52][_0xb9d2('0x2b')]=!![];_0x599b22[_0x554e52][_0xb9d2('0x2c')]=_0x4c1b34[_0xb9d2('0x29')];_0x599b22[_0x554e52][_0xb9d2('0x27')]=_[_0xb9d2('0x26')](_0x4c1b34['interface'])?util['format'](_0xb9d2('0x2d'),_0x4c1b34[_0xb9d2('0x29')]):_0x4c1b34[_0xb9d2('0x27')];if(_0x599b22[_0x554e52][_0xb9d2('0x2e')]){_0x599b22[_0x554e52][_0xb9d2('0x2f')]=moment()['format'](_0xb9d2('0x30'));}if(_0x599b22[_0x554e52][_0xb9d2('0x31')]){_0x599b22[_0x554e52][_0xb9d2('0x32')]=moment()[_0xb9d2('0x28')](_0xb9d2('0x30'));}RpcMemberReport[_0xb9d2('0x18')](_0x599b22[_0x554e52]);}RpcVoiceQueueReport['create'](_0x599b22[_0x554e52]);}};function extractCalleridNumber(_0x368cf2){var _0x16d742=_0x368cf2[_0xb9d2('0x33')](/<(.*?)>/);return _0x16d742?_0x16d742[0x1]:_0x368cf2;}Report[_0xb9d2('0x14')][_0xb9d2('0x1a')]=function(_0x4d9afc){_0x4d9afc['destination']=_0x4d9afc[_0xb9d2('0x34')]||_0x4d9afc['exten'];if(_0x4d9afc['type']==_0xb9d2('0x35')){_0x4d9afc[_0xb9d2('0x36')]=_0xb9d2('0x37');_0x4d9afc['lastdata']=_0x4d9afc['queue'];if(_0x4d9afc[_0xb9d2('0x38')]==_0xb9d2('0x39')){_0x4d9afc[_0xb9d2('0x25')]='';_0x4d9afc[_0xb9d2('0x34')]=extractCalleridNumber(_0x4d9afc[_0xb9d2('0x3a')]);}else if(_0x4d9afc[_0xb9d2('0x38')]=='from-sip'){if(_0x4d9afc['destination']==_0xb9d2('0x3b')){_0x4d9afc[_0xb9d2('0x34')]=extractCalleridNumber(_0x4d9afc['calleridpreview']);_0x4d9afc['calleridnum']=_0x4d9afc[_0xb9d2('0x3c')];_0x4d9afc[_0xb9d2('0x3d')]=[_0x4d9afc[_0xb9d2('0x3e')],_0x4d9afc[_0xb9d2('0x3e')]=_0x4d9afc[_0xb9d2('0x3d')]][0x0];_0x4d9afc['callerid']=_0x4d9afc[_0xb9d2('0x3f')];}else{_0x4d9afc[_0xb9d2('0x34')]=_0x4d9afc[_0xb9d2('0x40')];_0x4d9afc[_0xb9d2('0x40')]=_0x4d9afc[_0xb9d2('0x3c')];if(_0x4d9afc[_0xb9d2('0x41')]==_0xb9d2('0x42')){_0x4d9afc[_0xb9d2('0x25')]=_0x4d9afc['connectedlinenum'];}else{_0x4d9afc[_0xb9d2('0x25')]='';}}}}else{_0x4d9afc['callerid']=util[_0xb9d2('0x28')]('\x22%s\x22\x20<%s>',_0x4d9afc[_0xb9d2('0x43')],_0x4d9afc[_0xb9d2('0x40')]);}RpcVoiceCallReport[_0xb9d2('0x44')](_0x4d9afc);if(_0x4d9afc[_0xb9d2('0x45')]){for(var _0x516566=0x0;_0x516566<_0x4d9afc[_0xb9d2('0x46')][_0xb9d2('0x2a')];_0x516566+=0x1){_0x4d9afc[_0xb9d2('0x47')]=_0x4d9afc[_0xb9d2('0x46')][_0x516566][_0xb9d2('0x48')];_0x4d9afc['createdAt']=_0x4d9afc[_0xb9d2('0x46')][_0x516566]['createdAt'];if(_0x4d9afc['exten']==_0xb9d2('0x3b')){_0x4d9afc['calleridnum']=_0x4d9afc['connectedlinenum'];_0x4d9afc[_0xb9d2('0x43')]=_0x4d9afc[_0xb9d2('0x49')];_0x4d9afc[_0xb9d2('0x4a')]=_0x4d9afc[_0xb9d2('0x25')];_0x4d9afc[_0xb9d2('0x49')]=_0x4d9afc[_0xb9d2('0x4b')];_0x4d9afc[_0xb9d2('0x4c')]=_0x4d9afc['originatecalleridnum'];}else if(_0x4d9afc['exten']==_0xb9d2('0x4d')){_0x4d9afc[_0xb9d2('0x40')]=_0x4d9afc[_0xb9d2('0x34')];_0x4d9afc[_0xb9d2('0x4c')]=_0x4d9afc['originatecalleridnum'];}RpcVoiceRecording['create'](_0x4d9afc);}}};Report[_0xb9d2('0x14')][_0xb9d2('0x1d')]=function(_0x481bea){if(_[_0xb9d2('0x4e')](_0x481bea)){_0x481bea[_0xb9d2('0x4f')](function(_0x194815){RpcVoiceAgentReport['create'](_0x194815);});}else{RpcVoiceAgentReport[_0xb9d2('0x44')](_0x481bea);}};Report['prototype'][_0xb9d2('0x1f')]=function(_0x29e494){RpcVoiceDialReport[_0xb9d2('0x44')](_0x29e494);var _0x5d50bb=undefined;var _0x21dc6b=_0x29e494['channel'];if(_['startsWith'](_0x21dc6b,_0xb9d2('0x50'))){var _0x4d163e=_0x21dc6b['substring'](_0x21dc6b[_0xb9d2('0x51')]('/')+0x1,_0x21dc6b[_0xb9d2('0x51')]('@'));_0x5d50bb=_['find'](this[_0xb9d2('0x12')],function(_0x433878){return _0x433878[_0xb9d2('0x52')]==_0x4d163e||_0x433878[_0xb9d2('0x53')]==_0x4d163e||_0x433878[_0xb9d2('0x25')]==_0x4d163e;});}else{var _0x4d163e=_0x21dc6b[_0xb9d2('0x54')](_0x21dc6b['indexOf']('/')+0x1,_0x21dc6b[_0xb9d2('0x55')]('-'));_0x5d50bb=this[_0xb9d2('0x23')](_0x4d163e);}if(_0x5d50bb){_0x29e494[_0xb9d2('0x27')]=_[_0xb9d2('0x26')](_0x5d50bb['interface'])?util[_0xb9d2('0x28')](_0xb9d2('0x2d'),_0x5d50bb[_0xb9d2('0x29')]):_0x5d50bb[_0xb9d2('0x27')];_0x29e494[_0xb9d2('0x4b')]=_0x5d50bb[_0xb9d2('0x29')];_0x29e494[_0xb9d2('0x25')]=_0x5d50bb[_0xb9d2('0x25')];RpcMemberReport[_0xb9d2('0x1f')](_0x29e494);}};Report[_0xb9d2('0x14')]['blindTransfer']=function(_0x463e22){RpcVoiceTransferReport[_0xb9d2('0x56')](_0x463e22);};Report['prototype'][_0xb9d2('0x22')]=function(_0x725371){RpcVoiceTransferReport[_0xb9d2('0x22')](_0x725371);};module[_0xb9d2('0x57')]=Report; \ No newline at end of file +var _0x23ef=['connectedlinename','membername','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','lodash','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','isNil','name','interface','SIP/%s','length','findAgent','connectedlinenum','assigned','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','type','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','create','monitorFilename','monitors','filename','createdAt','calleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23ef,0xb0));var _0xf23e=function(_0x3cf467,_0x2a6e08){_0x3cf467=_0x3cf467-0x0;var _0x4cb991=_0x23ef[_0x3cf467];return _0x4cb991;};'use strict';var BPromise=require(_0xf23e('0x0'));var _=require(_0xf23e('0x1'));var moment=require('moment');var util=require('util');var config=require('../../../config/environment');var logger=require(_0xf23e('0x2'))(_0xf23e('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xf23e('0x4'));var RpcVoiceCallReport=require(_0xf23e('0x5'));var RpcVoiceDialReport=require(_0xf23e('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xf23e('0x7'));var RpcVoiceTransferReport=require(_0xf23e('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xf23e('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xf23e('0xa'));function Report(_0x226799){this[_0xf23e('0xb')]=_0x226799;this[_0xf23e('0xc')]=_0x226799[_0xf23e('0xc')];this['telephones']=_0x226799[_0xf23e('0xd')];}Report['prototype'][_0xf23e('0xe')]=function(_0x32de0e){var _0x2ac50c=new VoiceQueueReport(this[_0xf23e('0xb')]);var _0x328aa3=new VoiceAgentReport(this['realtime']);var _0x56c4b7=new VoiceDialReport(this[_0xf23e('0xb')]);var _0x545265=new VoiceCallReport(this[_0xf23e('0xb')]);var _0x2c68c5=new UserReport(this['realtime']);if(config[_0xf23e('0xf')]&&config[_0xf23e('0xf')][_0xf23e('0x10')]){ami['on'](_0xf23e('0x11'),this[_0xf23e('0x12')][_0xf23e('0x13')](this));ami['on']('custom:voiceCallReport',this[_0xf23e('0x14')][_0xf23e('0x13')](this));ami['on'](_0xf23e('0x15'),this[_0xf23e('0x16')][_0xf23e('0x13')](this));ami['on'](_0xf23e('0x17'),this[_0xf23e('0x18')]['bind'](this));ami['on']('blindtransfer',this[_0xf23e('0x19')][_0xf23e('0x13')](this));ami['on'](_0xf23e('0x1a'),this[_0xf23e('0x1b')][_0xf23e('0x13')](this));}};Report[_0xf23e('0x1c')]['findAgent']=function(_0xd1e3a2){var _0x58846b=undefined;_0x58846b=_[_0xf23e('0x1d')](this[_0xf23e('0xc')],function(_0x11cbb7){return _0x11cbb7[_0xf23e('0x1e')]==_0xd1e3a2||_0x11cbb7['name']==_0xd1e3a2;});if(_[_0xf23e('0x1f')](_0x58846b)){var _0x21522a=_[_0xf23e('0x1d')](this[_0xf23e('0xd')],function(_0x552088){return _0x552088[_0xf23e('0x1e')]==_0xd1e3a2||_0x552088[_0xf23e('0x20')]==_0xd1e3a2;});if(_0x21522a){_0x58846b=_[_0xf23e('0x1d')](this[_0xf23e('0xc')],function(_0x448258){return _0x448258[_0xf23e('0x21')]==util['format'](_0xf23e('0x22'),_0x21522a[_0xf23e('0x20')]);});}}return _0x58846b;};Report[_0xf23e('0x1c')][_0xf23e('0x12')]=function(_0x55cc00){for(var _0x180e26=0x0;_0x180e26<_0x55cc00[_0xf23e('0x23')];_0x180e26+=0x1){var _0x51881c=this[_0xf23e('0x24')](_0x55cc00[_0x180e26][_0xf23e('0x25')]);if(_0x51881c){_0x55cc00[_0x180e26][_0xf23e('0x1e')]=_0x51881c[_0xf23e('0x1e')];_0x55cc00[_0x180e26][_0xf23e('0x26')]=!![];_0x55cc00[_0x180e26]['lastAssignedTo']=_0x51881c[_0xf23e('0x20')];_0x55cc00[_0x180e26][_0xf23e('0x21')]=_[_0xf23e('0x1f')](_0x51881c[_0xf23e('0x21')])?util['format'](_0xf23e('0x22'),_0x51881c[_0xf23e('0x20')]):_0x51881c[_0xf23e('0x21')];if(_0x55cc00[_0x180e26]['queuecallercomplete']){_0x55cc00[_0x180e26][_0xf23e('0x27')]=moment()[_0xf23e('0x28')](_0xf23e('0x29'));}if(_0x55cc00[_0x180e26][_0xf23e('0x2a')]){_0x55cc00[_0x180e26][_0xf23e('0x2b')]=moment()['format'](_0xf23e('0x29'));}RpcMemberReport[_0xf23e('0x12')](_0x55cc00[_0x180e26]);}RpcVoiceQueueReport['create'](_0x55cc00[_0x180e26]);}};function extractCalleridNumber(_0x4b762b){var _0x3251e9=_0x4b762b[_0xf23e('0x2c')](/<(.*?)>/);return _0x3251e9?_0x3251e9[0x1]:_0x4b762b;}Report[_0xf23e('0x1c')][_0xf23e('0x14')]=function(_0xe5605c){_0xe5605c['destination']=_0xe5605c[_0xf23e('0x2d')]||_0xe5605c[_0xf23e('0x2e')];if(_0xe5605c[_0xf23e('0x2f')]=='dialer'){_0xe5605c[_0xf23e('0x30')]='queue';_0xe5605c[_0xf23e('0x31')]=_0xe5605c[_0xf23e('0x32')];if(_0xe5605c[_0xf23e('0x33')]==_0xf23e('0x34')){_0xe5605c[_0xf23e('0x1e')]='';_0xe5605c['destination']=extractCalleridNumber(_0xe5605c['callerid']);}else if(_0xe5605c['context']==_0xf23e('0x35')){if(_0xe5605c[_0xf23e('0x2d')]==_0xf23e('0x36')){_0xe5605c[_0xf23e('0x2d')]=extractCalleridNumber(_0xe5605c['calleridpreview']);_0xe5605c[_0xf23e('0x37')]=_0xe5605c[_0xf23e('0x38')];_0xe5605c[_0xf23e('0x39')]=[_0xe5605c[_0xf23e('0x3a')],_0xe5605c[_0xf23e('0x3a')]=_0xe5605c[_0xf23e('0x39')]][0x0];_0xe5605c[_0xf23e('0x3b')]=_0xe5605c[_0xf23e('0x3c')];}else{_0xe5605c[_0xf23e('0x2d')]=_0xe5605c[_0xf23e('0x37')];_0xe5605c['calleridnum']=_0xe5605c[_0xf23e('0x38')];if(_0xe5605c[_0xf23e('0x3d')]==_0xf23e('0x3e')){_0xe5605c[_0xf23e('0x1e')]=_0xe5605c['connectedlinenum'];}else{_0xe5605c['accountcode']='';}}}}else{_0xe5605c[_0xf23e('0x3b')]=util[_0xf23e('0x28')](_0xf23e('0x3f'),_0xe5605c['calleridname'],_0xe5605c[_0xf23e('0x37')]);}RpcVoiceCallReport[_0xf23e('0x40')](_0xe5605c);if(_0xe5605c['monitor']){for(var _0x2dd389=0x0;_0x2dd389<_0xe5605c['monitors'][_0xf23e('0x23')];_0x2dd389+=0x1){_0xe5605c[_0xf23e('0x41')]=_0xe5605c[_0xf23e('0x42')][_0x2dd389][_0xf23e('0x43')];_0xe5605c[_0xf23e('0x44')]=_0xe5605c['monitors'][_0x2dd389]['createdAt'];if(_0xe5605c[_0xf23e('0x2e')]==_0xf23e('0x36')){_0xe5605c[_0xf23e('0x37')]=_0xe5605c['connectedlinenum'];_0xe5605c[_0xf23e('0x45')]=_0xe5605c[_0xf23e('0x46')];_0xe5605c[_0xf23e('0x25')]=_0xe5605c[_0xf23e('0x1e')];_0xe5605c['connectedlinename']=_0xe5605c[_0xf23e('0x47')];_0xe5605c['exten']=_0xe5605c[_0xf23e('0x38')];}else if(_0xe5605c[_0xf23e('0x2e')]=='xcally-motion-dialer'){_0xe5605c[_0xf23e('0x37')]=_0xe5605c[_0xf23e('0x2d')];_0xe5605c[_0xf23e('0x2e')]=_0xe5605c['originatecalleridnum'];}RpcVoiceRecording[_0xf23e('0x40')](_0xe5605c);}}};Report['prototype']['voiceAgentReport']=function(_0x1d557f){if(_[_0xf23e('0x48')](_0x1d557f)){_0x1d557f[_0xf23e('0x49')](function(_0x370ba9){RpcVoiceAgentReport[_0xf23e('0x40')](_0x370ba9);});}else{RpcVoiceAgentReport['create'](_0x1d557f);}};Report[_0xf23e('0x1c')][_0xf23e('0x18')]=function(_0x485e2a){RpcVoiceDialReport['create'](_0x485e2a);var _0x47ed09=undefined;var _0x333a4d=_0x485e2a[_0xf23e('0x3a')];if(_[_0xf23e('0x4a')](_0x333a4d,_0xf23e('0x4b'))){var _0x1ca874=_0x333a4d[_0xf23e('0x4c')](_0x333a4d[_0xf23e('0x4d')]('/')+0x1,_0x333a4d[_0xf23e('0x4d')]('@'));_0x47ed09=_['find'](this['agents'],function(_0x54eb93){return _0x54eb93[_0xf23e('0x4e')]==_0x1ca874||_0x54eb93[_0xf23e('0x4f')]==_0x1ca874||_0x54eb93[_0xf23e('0x1e')]==_0x1ca874;});}else{var _0x1ca874=_0x333a4d[_0xf23e('0x4c')](_0x333a4d[_0xf23e('0x4d')]('/')+0x1,_0x333a4d[_0xf23e('0x50')]('-'));_0x47ed09=this[_0xf23e('0x24')](_0x1ca874);}if(_0x47ed09){_0x485e2a[_0xf23e('0x21')]=_[_0xf23e('0x1f')](_0x47ed09['interface'])?util['format'](_0xf23e('0x22'),_0x47ed09['name']):_0x47ed09[_0xf23e('0x21')];_0x485e2a['membername']=_0x47ed09[_0xf23e('0x20')];_0x485e2a[_0xf23e('0x1e')]=_0x47ed09[_0xf23e('0x1e')];RpcMemberReport[_0xf23e('0x18')](_0x485e2a);}};Report[_0xf23e('0x1c')][_0xf23e('0x19')]=function(_0x569abc){RpcVoiceTransferReport[_0xf23e('0x19')](_0x569abc);};Report[_0xf23e('0x1c')][_0xf23e('0x1b')]=function(_0x1fe201){RpcVoiceTransferReport[_0xf23e('0x1b')](_0x1fe201);};module[_0xf23e('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 835da8c..ba54ede 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 _0xcd56=['substring','indexOf','find','phone','accountcode','inspect','peer','registered','address','status','telephone:%s','trunk:%s','[syncPeerStatus][UserReport]','exports','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','[loopSyncRealTimeShow]','error','prototype','actionSipShowRegistry','catch','isNotNull','isUndefined','emit','username','stateRegistry','merge','omit','event','actionid','state','format','name','[syncRegistry][UserReport]','device','toLowerCase','inuse','local','updateStatusRealtime','stateTime','toNumber','telephone:save','trunk:save','startsWith','Local'];(function(_0x500abc,_0x532cbf){var _0x268b6d=function(_0xcc278f){while(--_0xcc278f){_0x500abc['push'](_0x500abc['shift']());}};_0x268b6d(++_0x532cbf);}(_0xcd56,0x116));var _0x6cd5=function(_0x503272,_0x1bcbfb){_0x503272=_0x503272-0x0;var _0x24e7e4=_0xcd56[_0x503272];return _0x24e7e4;};'use strict';var _=require('lodash');var moment=require(_0x6cd5('0x0'));var BPromise=require('bluebird');var util=require(_0x6cd5('0x1'));var Redis=require(_0x6cd5('0x2'));var config=require(_0x6cd5('0x3'));var logger=require('../../../config/logger')(_0x6cd5('0x4'));var ami=require(_0x6cd5('0x5'));config['redis']=_[_0x6cd5('0x6')](config[_0x6cd5('0x7')],{'host':_0x6cd5('0x8'),'port':0x18eb});var io=require(_0x6cd5('0x9'))(new Redis(config[_0x6cd5('0x7')]));function UserReport(_0x30b613){this[_0x6cd5('0xa')]=_0x30b613['trunks'];this[_0x6cd5('0xb')]=_0x30b613['agents'];this[_0x6cd5('0xc')]=_0x30b613[_0x6cd5('0xc')];ami['on']('registryentry',this[_0x6cd5('0xd')][_0x6cd5('0xe')](this));ami['on']('registry',this[_0x6cd5('0xd')][_0x6cd5('0xe')](this));ami['on']('devicestatechange',this[_0x6cd5('0xf')][_0x6cd5('0xe')](this));ami['on'](_0x6cd5('0x10'),this[_0x6cd5('0x11')][_0x6cd5('0xe')](this));this[_0x6cd5('0x12')]();return BPromise[_0x6cd5('0x13')]()['then'](ami['actionSipShowRegistry']())[_0x6cd5('0x14')](ami[_0x6cd5('0x15')]())[_0x6cd5('0x14')](ami[_0x6cd5('0x16')]())['catch'](loggerCatch(_0x6cd5('0x17')));}function loggerCatch(_0x124be5){return function(_0x2d6343){logger[_0x6cd5('0x18')](_0x124be5,util['inspect'](_0x2d6343,{'showHidden':![],'depth':null}));};}UserReport[_0x6cd5('0x19')][_0x6cd5('0x12')]=function(){setInterval(function(){BPromise[_0x6cd5('0x13')]()[_0x6cd5('0x14')](ami[_0x6cd5('0x1a')]())[_0x6cd5('0x14')](ami['actionDeviceStateList']())[_0x6cd5('0x14')](ami[_0x6cd5('0x16')]())[_0x6cd5('0x1b')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x6cd5('0x19')][_0x6cd5('0x1c')]=function(_0x318ab2){return _0x318ab2!==null&&!_[_0x6cd5('0x1d')](_0x318ab2);};UserReport[_0x6cd5('0x19')][_0x6cd5('0x1e')]=function(_0x196322,_0x25f7ce,_0x32e0ad){io['to'](_0x196322)[_0x6cd5('0x1e')](_0x25f7ce,_0x32e0ad);};UserReport[_0x6cd5('0x19')][_0x6cd5('0xd')]=function(_0x256ea8){try{if(this['isNotNull'](_0x256ea8)){var _0xb1462c=_['find'](this[_0x6cd5('0xa')],{'registry':_0x256ea8[_0x6cd5('0x1f')]});if(_0xb1462c){_0x256ea8[_0x6cd5('0x20')]=_0x256ea8['state'];_[_0x6cd5('0x21')](_0xb1462c,_[_0x6cd5('0x22')](_0x256ea8,[_0x6cd5('0x23'),_0x6cd5('0x24'),_0x6cd5('0x1f'),_0x6cd5('0x25')]));this[_0x6cd5('0x1e')](util[_0x6cd5('0x26')]('trunk:%s',_0xb1462c[_0x6cd5('0x27')]),'trunk:save',_0xb1462c);}}}catch(_0x3a5632){logger['error'](_0x6cd5('0x28'),util['inspect'](_0x3a5632,{'showHidden':![],'depth':null}));}};UserReport[_0x6cd5('0x19')][_0x6cd5('0xf')]=function(_0x2c3ab3){try{if(this[_0x6cd5('0x1c')](_0x2c3ab3)){if(this[_0x6cd5('0xb')][_0x2c3ab3[_0x6cd5('0x29')]]){if(!this['agents'][_0x2c3ab3[_0x6cd5('0x29')]]['local']||_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]()==_0x6cd5('0x2b')){this['agents'][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x2c')]=![];if(this['agents'][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x25')]!==_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]()){this[_0x6cd5('0xb')][_0x2c3ab3[_0x6cd5('0x29')]]['stateTime']=_['toNumber'](moment()[_0x6cd5('0x26')]('x'));}this[_0x6cd5('0xb')][_0x2c3ab3['device']]['state']=_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]();this[_0x6cd5('0xb')][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x2d')](_0x2c3ab3);}}else if(this[_0x6cd5('0xc')][_0x2c3ab3[_0x6cd5('0x29')]]){if(this[_0x6cd5('0xc')][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x25')]!==_0x2c3ab3[_0x6cd5('0x25')]['toLowerCase']()){this['telephones'][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x2e')]=_[_0x6cd5('0x2f')](moment()[_0x6cd5('0x26')]('x'));}this['telephones'][_0x2c3ab3[_0x6cd5('0x29')]]['state']=_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]();this[_0x6cd5('0x1e')](util[_0x6cd5('0x26')]('telephone:%s',this[_0x6cd5('0xc')][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x27')]),_0x6cd5('0x30'),this[_0x6cd5('0xc')][_0x2c3ab3['device']]);}else if(this[_0x6cd5('0xa')][_0x2c3ab3['device']]){if(this[_0x6cd5('0xa')][_0x2c3ab3[_0x6cd5('0x29')]]['state']!==_0x2c3ab3['state']['toLowerCase']()){this['trunks'][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x2e')]=_[_0x6cd5('0x2f')](moment()[_0x6cd5('0x26')]('x'));}this[_0x6cd5('0xa')][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x25')]=_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]();this[_0x6cd5('0x1e')](util[_0x6cd5('0x26')]('trunk:%s',this[_0x6cd5('0xa')][_0x2c3ab3[_0x6cd5('0x29')]][_0x6cd5('0x27')]),_0x6cd5('0x31'),this[_0x6cd5('0xa')][_0x2c3ab3[_0x6cd5('0x29')]]);}else if(_[_0x6cd5('0x32')](_0x2c3ab3[_0x6cd5('0x29')],'Queue')){}else if(_[_0x6cd5('0x32')](_0x2c3ab3[_0x6cd5('0x29')],_0x6cd5('0x33'))){var _0x449acc=_0x2c3ab3[_0x6cd5('0x29')];var _0x28b57d=_0x449acc[_0x6cd5('0x34')](_0x449acc[_0x6cd5('0x35')]('/')+0x1,_0x449acc['indexOf']('@'));var _0x1c629d=_[_0x6cd5('0x36')](this['agents'],function(_0x1ff6d7){return _0x1ff6d7['mobile']==_0x28b57d||_0x1ff6d7[_0x6cd5('0x37')]==_0x28b57d||_0x1ff6d7[_0x6cd5('0x38')]==_0x28b57d;});if(_0x1c629d){if(_0x1c629d[_0x6cd5('0x25')]!==_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]()){_0x1c629d[_0x6cd5('0x2e')]=_[_0x6cd5('0x2f')](moment()[_0x6cd5('0x26')]('x'));}_0x1c629d['state']=_0x2c3ab3[_0x6cd5('0x25')][_0x6cd5('0x2a')]();_0x1c629d[_0x6cd5('0x2c')]=!![];_0x1c629d[_0x6cd5('0x2d')](_0x2c3ab3);}}else{}}}catch(_0x557b67){logger['error']('[syncDeviceState][UserReport]',util[_0x6cd5('0x39')](_0x557b67,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6cd5('0x11')]=function(_0x4c0961){try{if(this['isNotNull'](_0x4c0961)&&this[_0x6cd5('0x1c')](_0x4c0961[_0x6cd5('0x10')])){if(this[_0x6cd5('0xb')][_0x4c0961[_0x6cd5('0x3a')]]){if(!this['agents'][_0x4c0961[_0x6cd5('0x3a')]]['local']||_0x4c0961[_0x6cd5('0x10')]['toLowerCase']()==_0x6cd5('0x3b')){this['agents'][_0x4c0961['peer']][_0x6cd5('0x2c')]=![];this[_0x6cd5('0xb')][_0x4c0961[_0x6cd5('0x3a')]]['status']=_0x4c0961[_0x6cd5('0x10')][_0x6cd5('0x2a')]();this['agents'][_0x4c0961[_0x6cd5('0x3a')]]['address']=_0x4c0961[_0x6cd5('0x3c')];this[_0x6cd5('0xb')][_0x4c0961['peer']][_0x6cd5('0x2d')](_0x4c0961);}}else if(this[_0x6cd5('0xc')][_0x4c0961['peer']]){this[_0x6cd5('0xc')][_0x4c0961[_0x6cd5('0x3a')]][_0x6cd5('0x3d')]=_0x4c0961['peerstatus'][_0x6cd5('0x2a')]();this[_0x6cd5('0xc')][_0x4c0961['peer']][_0x6cd5('0x3c')]=_0x4c0961[_0x6cd5('0x3c')];this[_0x6cd5('0x1e')](util[_0x6cd5('0x26')](_0x6cd5('0x3e'),this['telephones'][_0x4c0961['peer']][_0x6cd5('0x27')]),'telephone:save',this[_0x6cd5('0xc')][_0x4c0961[_0x6cd5('0x3a')]]);}else if(this['trunks'][_0x4c0961['peer']]){this[_0x6cd5('0xa')][_0x4c0961[_0x6cd5('0x3a')]][_0x6cd5('0x3d')]=_0x4c0961[_0x6cd5('0x10')][_0x6cd5('0x2a')]();this[_0x6cd5('0xa')][_0x4c0961[_0x6cd5('0x3a')]][_0x6cd5('0x3c')]=_0x4c0961['address'];this['emit'](util[_0x6cd5('0x26')](_0x6cd5('0x3f'),this[_0x6cd5('0xa')][_0x4c0961[_0x6cd5('0x3a')]][_0x6cd5('0x27')]),_0x6cd5('0x31'),this[_0x6cd5('0xa')][_0x4c0961[_0x6cd5('0x3a')]]);}else{}}}catch(_0x3400bf){logger[_0x6cd5('0x18')](_0x6cd5('0x40'),util[_0x6cd5('0x39')](_0x3400bf,{'showHidden':![],'depth':null}));}};module[_0x6cd5('0x41')]=UserReport; \ No newline at end of file +var _0x4b7c=['bind','registry','devicestatechange','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','loopSyncRealTimeShow','actionDeviceStateList','prototype','isNotNull','isUndefined','find','username','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','name','trunk:save','syncDeviceState','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','emit','telephone:%s','telephone:save','Queue','substring','indexOf','mobile','phone','accountcode','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x4b7c,0x104));var _0xc4b7=function(_0x3689f8,_0x21ddda){_0x3689f8=_0x3689f8-0x0;var _0x11fa69=_0x4b7c[_0x3689f8];return _0x11fa69;};'use strict';var _=require(_0xc4b7('0x0'));var moment=require(_0xc4b7('0x1'));var BPromise=require(_0xc4b7('0x2'));var util=require(_0xc4b7('0x3'));var Redis=require('ioredis');var config=require(_0xc4b7('0x4'));var logger=require(_0xc4b7('0x5'))(_0xc4b7('0x6'));var ami=require(_0xc4b7('0x7'));config[_0xc4b7('0x8')]=_[_0xc4b7('0x9')](config[_0xc4b7('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc4b7('0xa'))(new Redis(config[_0xc4b7('0x8')]));function UserReport(_0x28132c){this[_0xc4b7('0xb')]=_0x28132c[_0xc4b7('0xb')];this[_0xc4b7('0xc')]=_0x28132c[_0xc4b7('0xc')];this['telephones']=_0x28132c[_0xc4b7('0xd')];ami['on'](_0xc4b7('0xe'),this[_0xc4b7('0xf')][_0xc4b7('0x10')](this));ami['on'](_0xc4b7('0x11'),this[_0xc4b7('0xf')][_0xc4b7('0x10')](this));ami['on'](_0xc4b7('0x12'),this['syncDeviceState'][_0xc4b7('0x10')](this));ami['on'](_0xc4b7('0x13'),this[_0xc4b7('0x14')]['bind'](this));this['loopSyncRealTimeShow']();return BPromise[_0xc4b7('0x15')]()[_0xc4b7('0x16')](ami[_0xc4b7('0x17')]())['then'](ami['actionDeviceStateList']())[_0xc4b7('0x16')](ami[_0xc4b7('0x18')]())[_0xc4b7('0x19')](loggerCatch(_0xc4b7('0x1a')));}function loggerCatch(_0x25710e){return function(_0x2a5189){logger[_0xc4b7('0x1b')](_0x25710e,util[_0xc4b7('0x1c')](_0x2a5189,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xc4b7('0x1d')]=function(){setInterval(function(){BPromise[_0xc4b7('0x15')]()[_0xc4b7('0x16')](ami[_0xc4b7('0x17')]())[_0xc4b7('0x16')](ami[_0xc4b7('0x1e')]())[_0xc4b7('0x16')](ami[_0xc4b7('0x18')]())[_0xc4b7('0x19')](loggerCatch(_0xc4b7('0x1a')));},0x32c8);};UserReport[_0xc4b7('0x1f')][_0xc4b7('0x20')]=function(_0x273b76){return _0x273b76!==null&&!_[_0xc4b7('0x21')](_0x273b76);};UserReport[_0xc4b7('0x1f')]['emit']=function(_0x5066c5,_0x12e3a8,_0x464c6e){io['to'](_0x5066c5)['emit'](_0x12e3a8,_0x464c6e);};UserReport[_0xc4b7('0x1f')][_0xc4b7('0xf')]=function(_0x4f5ca1){try{if(this[_0xc4b7('0x20')](_0x4f5ca1)){var _0xf72634=_[_0xc4b7('0x22')](this['trunks'],{'registry':_0x4f5ca1[_0xc4b7('0x23')]});if(_0xf72634){_0x4f5ca1[_0xc4b7('0x24')]=_0x4f5ca1[_0xc4b7('0x25')];_[_0xc4b7('0x26')](_0xf72634,_[_0xc4b7('0x27')](_0x4f5ca1,[_0xc4b7('0x28'),_0xc4b7('0x29'),_0xc4b7('0x23'),_0xc4b7('0x25')]));this['emit'](util[_0xc4b7('0x2a')](_0xc4b7('0x2b'),_0xf72634[_0xc4b7('0x2c')]),_0xc4b7('0x2d'),_0xf72634);}}}catch(_0x56842b){logger[_0xc4b7('0x1b')]('[syncRegistry][UserReport]',util[_0xc4b7('0x1c')](_0x56842b,{'showHidden':![],'depth':null}));}};UserReport[_0xc4b7('0x1f')][_0xc4b7('0x2e')]=function(_0x4354b3){try{if(this[_0xc4b7('0x20')](_0x4354b3)){if(this[_0xc4b7('0xc')][_0x4354b3[_0xc4b7('0x2f')]]){if(!this['agents'][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x30')]||_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]()==_0xc4b7('0x32')){this['agents'][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x30')]=![];if(this[_0xc4b7('0xc')][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x25')]!==_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]()){this[_0xc4b7('0xc')][_0x4354b3['device']][_0xc4b7('0x33')]=_[_0xc4b7('0x34')](moment()[_0xc4b7('0x2a')]('x'));}this['agents'][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x25')]=_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]();this[_0xc4b7('0xc')][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x35')](_0x4354b3);}}else if(this['telephones'][_0x4354b3['device']]){if(this[_0xc4b7('0xd')][_0x4354b3[_0xc4b7('0x2f')]]['state']!==_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]()){this[_0xc4b7('0xd')][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x33')]=_[_0xc4b7('0x34')](moment()[_0xc4b7('0x2a')]('x'));}this[_0xc4b7('0xd')][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x25')]=_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]();this[_0xc4b7('0x36')](util[_0xc4b7('0x2a')](_0xc4b7('0x37'),this[_0xc4b7('0xd')][_0x4354b3['device']][_0xc4b7('0x2c')]),_0xc4b7('0x38'),this[_0xc4b7('0xd')][_0x4354b3[_0xc4b7('0x2f')]]);}else if(this['trunks'][_0x4354b3['device']]){if(this['trunks'][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x25')]!==_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]()){this[_0xc4b7('0xb')][_0x4354b3[_0xc4b7('0x2f')]][_0xc4b7('0x33')]=_['toNumber'](moment()[_0xc4b7('0x2a')]('x'));}this[_0xc4b7('0xb')][_0x4354b3['device']]['state']=_0x4354b3['state'][_0xc4b7('0x31')]();this[_0xc4b7('0x36')](util[_0xc4b7('0x2a')](_0xc4b7('0x2b'),this[_0xc4b7('0xb')][_0x4354b3['device']][_0xc4b7('0x2c')]),_0xc4b7('0x2d'),this[_0xc4b7('0xb')][_0x4354b3[_0xc4b7('0x2f')]]);}else if(_['startsWith'](_0x4354b3[_0xc4b7('0x2f')],_0xc4b7('0x39'))){}else if(_['startsWith'](_0x4354b3[_0xc4b7('0x2f')],'Local')){var _0x35a5fe=_0x4354b3[_0xc4b7('0x2f')];var _0x3e73a2=_0x35a5fe[_0xc4b7('0x3a')](_0x35a5fe[_0xc4b7('0x3b')]('/')+0x1,_0x35a5fe[_0xc4b7('0x3b')]('@'));var _0xec276d=_[_0xc4b7('0x22')](this[_0xc4b7('0xc')],function(_0x10795a){return _0x10795a[_0xc4b7('0x3c')]==_0x3e73a2||_0x10795a[_0xc4b7('0x3d')]==_0x3e73a2||_0x10795a[_0xc4b7('0x3e')]==_0x3e73a2;});if(_0xec276d){if(_0xec276d['state']!==_0x4354b3['state'][_0xc4b7('0x31')]()){_0xec276d[_0xc4b7('0x33')]=_['toNumber'](moment()[_0xc4b7('0x2a')]('x'));}_0xec276d[_0xc4b7('0x25')]=_0x4354b3[_0xc4b7('0x25')][_0xc4b7('0x31')]();_0xec276d[_0xc4b7('0x30')]=!![];_0xec276d[_0xc4b7('0x35')](_0x4354b3);}}else{}}}catch(_0x4b8576){logger[_0xc4b7('0x1b')]('[syncDeviceState][UserReport]',util[_0xc4b7('0x1c')](_0x4b8576,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xc4b7('0x14')]=function(_0x21382e){try{if(this[_0xc4b7('0x20')](_0x21382e)&&this[_0xc4b7('0x20')](_0x21382e[_0xc4b7('0x13')])){if(this[_0xc4b7('0xc')][_0x21382e[_0xc4b7('0x3f')]]){if(!this[_0xc4b7('0xc')][_0x21382e['peer']][_0xc4b7('0x30')]||_0x21382e[_0xc4b7('0x13')][_0xc4b7('0x31')]()==_0xc4b7('0x40')){this[_0xc4b7('0xc')][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x30')]=![];this[_0xc4b7('0xc')][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x41')]=_0x21382e[_0xc4b7('0x13')][_0xc4b7('0x31')]();this['agents'][_0x21382e['peer']]['address']=_0x21382e[_0xc4b7('0x42')];this[_0xc4b7('0xc')][_0x21382e['peer']][_0xc4b7('0x35')](_0x21382e);}}else if(this[_0xc4b7('0xd')][_0x21382e[_0xc4b7('0x3f')]]){this[_0xc4b7('0xd')][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x41')]=_0x21382e[_0xc4b7('0x13')][_0xc4b7('0x31')]();this[_0xc4b7('0xd')][_0x21382e['peer']][_0xc4b7('0x42')]=_0x21382e['address'];this[_0xc4b7('0x36')](util['format'](_0xc4b7('0x37'),this[_0xc4b7('0xd')][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x2c')]),_0xc4b7('0x38'),this[_0xc4b7('0xd')][_0x21382e[_0xc4b7('0x3f')]]);}else if(this[_0xc4b7('0xb')][_0x21382e[_0xc4b7('0x3f')]]){this['trunks'][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x41')]=_0x21382e[_0xc4b7('0x13')][_0xc4b7('0x31')]();this[_0xc4b7('0xb')][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x42')]=_0x21382e['address'];this[_0xc4b7('0x36')](util[_0xc4b7('0x2a')](_0xc4b7('0x2b'),this['trunks'][_0x21382e[_0xc4b7('0x3f')]][_0xc4b7('0x2c')]),'trunk:save',this['trunks'][_0x21382e['peer']]);}else{}}}catch(_0x57dbd4){logger[_0xc4b7('0x1b')](_0xc4b7('0x43'),util[_0xc4b7('0x1c')](_0x57dbd4,{'showHidden':![],'depth':null}));}};module[_0xc4b7('0x44')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index d4b9db6..ccb721a 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 _0x2ba8=['isNotNull','isUndefined','prototype','channels','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','privilege','custom:agentcalled','format','user:%s','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','destchannelstate','destchannelstatedesc','interface','pick','membername','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','inspect','syncAgentRingNoAnswer','reason','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','complete','talktime','transfer','agent','agentacw','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','syncBlindTransfer','channel','substring','[syncMusicOnHoldStart][VoiceAgentReport]','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','../../../config/logger','ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','emit'];(function(_0x3d6bab,_0x3242db){var _0x348415=function(_0x324f3b){while(--_0x324f3b){_0x3d6bab['push'](_0x3d6bab['shift']());}};_0x348415(++_0x3242db);}(_0x2ba8,0x1b7));var _0x82ba=function(_0x378095,_0x2899b8){_0x378095=_0x378095-0x0;var _0x54a8da=_0x2ba8[_0x378095];return _0x54a8da;};'use strict';var _=require('lodash');var moment=require(_0x82ba('0x0'));var util=require(_0x82ba('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x82ba('0x2'))(_0x82ba('0x3'));var ami=require('../ami');config[_0x82ba('0x4')]=_[_0x82ba('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x82ba('0x6'))(new Redis(config[_0x82ba('0x4')]));function VoiceAgentReport(_0x45b686){this['channels']={};this['voiceQueues']=_0x45b686[_0x82ba('0x7')];this['agents']=_0x45b686[_0x82ba('0x8')];this[_0x82ba('0x9')]={};ami['on'](_0x82ba('0xa'),this[_0x82ba('0xb')][_0x82ba('0xc')](this));ami['on'](_0x82ba('0xd'),this[_0x82ba('0xe')][_0x82ba('0xc')](this));ami['on'](_0x82ba('0xf'),this['syncAgentRingNoAnswer'][_0x82ba('0xc')](this));ami['on'](_0x82ba('0x10'),this[_0x82ba('0x11')]['bind'](this));ami['on'](_0x82ba('0x12'),this[_0x82ba('0x13')][_0x82ba('0xc')](this));ami['on'](_0x82ba('0x14'),this[_0x82ba('0x15')][_0x82ba('0xc')](this));ami['on']('hangup',this[_0x82ba('0x16')][_0x82ba('0xc')](this));ami['on'](_0x82ba('0x17'),this[_0x82ba('0x18')][_0x82ba('0xc')](this));ami['on']('musiconholdstop',this[_0x82ba('0x19')][_0x82ba('0xc')](this));ami['on'](_0x82ba('0x1a'),this[_0x82ba('0x1b')][_0x82ba('0xc')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x82ba('0xc')](this));}VoiceAgentReport['prototype']['emit']=function(_0x58bd3a,_0x4f38b5,_0x218f74){io['to'](_0x58bd3a)[_0x82ba('0x1c')](_0x4f38b5,_0x218f74);};VoiceAgentReport['prototype'][_0x82ba('0x1d')]=function(_0xa5e602){return _0xa5e602!==null&&!_[_0x82ba('0x1e')](_0xa5e602);};VoiceAgentReport[_0x82ba('0x1f')][_0x82ba('0xb')]=function(_0x3e34c9){try{if(this['isNotNull'](_0x3e34c9)){if(_[_0x82ba('0x1e')](this[_0x82ba('0x20')][_0x3e34c9[_0x82ba('0x21')]])){this[_0x82ba('0x20')][_0x3e34c9[_0x82ba('0x21')]]={};}if(_[_0x82ba('0x1e')](this['channels'][_0x3e34c9[_0x82ba('0x21')]][_0x3e34c9[_0x82ba('0x22')]])){this['channels'][_0x3e34c9['uniqueid']][_0x3e34c9[_0x82ba('0x22')]]={'agentcalledAt':moment()['format'](_0x82ba('0x23')),'lastevent':_0x82ba('0x24'),'variables':this[_0x82ba('0x9')][_0x3e34c9[_0x82ba('0x21')]],'type':this['voiceQueues'][_0x3e34c9[_0x82ba('0x25')]]?this[_0x82ba('0x7')][_0x3e34c9[_0x82ba('0x25')]][_0x82ba('0x26')]||'inbound':_0x82ba('0x27')};}_[_0x82ba('0x28')](this[_0x82ba('0x20')][_0x3e34c9[_0x82ba('0x21')]][_0x3e34c9[_0x82ba('0x22')]],_['omit'](_0x3e34c9,['event',_0x82ba('0x29')]));ami[_0x82ba('0x1c')](_0x82ba('0x2a'),this[_0x82ba('0x20')][_0x3e34c9['uniqueid']][_0x3e34c9[_0x82ba('0x22')]]);this[_0x82ba('0x1c')](util[_0x82ba('0x2b')](_0x82ba('0x2c'),_0x3e34c9['membername']),'user:called',this[_0x82ba('0x20')][_0x3e34c9[_0x82ba('0x21')]][_0x3e34c9[_0x82ba('0x22')]]);}}catch(_0x512e9b){logger['error']('[syncAgentCalled][VoiceAgentReport]',util['inspect'](_0x512e9b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x82ba('0xe')]=function(_0x5a1dba){try{if(this['isNotNull'](_0x5a1dba)){if(this[_0x82ba('0x20')][_0x5a1dba['uniqueid']]){for(var _0x167d6e in this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]]){if(this['channels'][_0x5a1dba[_0x82ba('0x21')]][_0x82ba('0x2d')](_0x167d6e)){if(_0x5a1dba['destuniqueid']===_0x167d6e){this[_0x82ba('0x20')][_0x5a1dba['uniqueid']][_0x167d6e][_0x82ba('0x2e')]=moment()[_0x82ba('0x2b')](_0x82ba('0x23'));this[_0x82ba('0x20')][_0x5a1dba['uniqueid']][_0x167d6e][_0x82ba('0x2f')]=_0x82ba('0x30');this['channels'][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]['holdtime']=_0x5a1dba[_0x82ba('0x31')];this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e][_0x82ba('0x32')]=_0x5a1dba[_0x82ba('0x32')];this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]['connectedlinename']=_0x5a1dba['connectedlinename'];this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e][_0x82ba('0x33')]=_0x5a1dba[_0x82ba('0x33')];this['channels'][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e][_0x82ba('0x34')]=_0x5a1dba[_0x82ba('0x34')];_[_0x82ba('0x28')](this[_0x82ba('0x8')][_0x5a1dba[_0x82ba('0x35')]],_[_0x82ba('0x36')](_0x5a1dba,[_0x82ba('0x25'),'destconnectedlinenum']));this[_0x82ba('0x1c')](util[_0x82ba('0x2b')]('user:%s',_0x5a1dba[_0x82ba('0x37')]),_0x82ba('0x38'),this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x5a1dba['destuniqueid']]);ami[_0x82ba('0x1c')](_0x82ba('0x39'),this['channels'][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]);}else if(!this['channels'][_0x5a1dba['uniqueid']][_0x167d6e]['agentringnoanswer']&&!this['channels'][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e][_0x82ba('0x12')]){this[_0x82ba('0x20')][_0x5a1dba['uniqueid']][_0x167d6e]['agentringnoanswer']=!![];this[_0x82ba('0x20')][_0x5a1dba['uniqueid']][_0x167d6e][_0x82ba('0x3a')]=moment()['format'](_0x82ba('0x23'));this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]['reason']=_0x82ba('0x3b');this['channels'][_0x5a1dba['uniqueid']][_0x167d6e][_0x82ba('0x2f')]=_0x82ba('0x3b');this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]['answeredelsewheredestinationuniqueid']=_0x5a1dba[_0x82ba('0x22')];this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e][_0x82ba('0x3c')]=_0x5a1dba[_0x82ba('0x37')];ami['emit'](_0x82ba('0x3d'),this[_0x82ba('0x20')][_0x5a1dba[_0x82ba('0x21')]][_0x167d6e]);}}}}}}catch(_0x2fb1af){logger[_0x82ba('0x3e')](_0x82ba('0x3f'),util[_0x82ba('0x40')](_0x2fb1af,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x82ba('0x41')]=function(_0x331380){try{if(this[_0x82ba('0x1d')](_0x331380)){if(this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]]&&this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]][_0x331380['destuniqueid']]){this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]][_0x331380[_0x82ba('0x22')]][_0x82ba('0xf')]=!![];this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]][_0x331380[_0x82ba('0x22')]][_0x82ba('0x3a')]=moment()[_0x82ba('0x2b')](_0x82ba('0x23'));this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]][_0x331380[_0x82ba('0x22')]][_0x82ba('0x42')]='rejected';this[_0x82ba('0x20')][_0x331380['uniqueid']][_0x331380[_0x82ba('0x22')]][_0x82ba('0x2f')]=_0x82ba('0x43');ami[_0x82ba('0x1c')](_0x82ba('0x44'),this[_0x82ba('0x20')][_0x331380[_0x82ba('0x21')]][_0x331380[_0x82ba('0x22')]]);}}}catch(_0x9f2f7c){logger[_0x82ba('0x3e')](_0x82ba('0x45'),util[_0x82ba('0x40')](_0x9f2f7c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x82ba('0x1f')][_0x82ba('0x11')]=function(_0x136658){try{if(this[_0x82ba('0x1d')](_0x136658)){if(this[_0x82ba('0x20')][_0x136658['uniqueid']]){for(var _0x56a5f7 in this['channels'][_0x136658[_0x82ba('0x21')]]){if(this['channels'][_0x136658[_0x82ba('0x21')]][_0x82ba('0x2d')](_0x56a5f7)&&!this[_0x82ba('0x20')][_0x136658[_0x82ba('0x21')]][_0x56a5f7]['agentringnoanswer']&&!this[_0x82ba('0x20')][_0x136658[_0x82ba('0x21')]][_0x56a5f7][_0x82ba('0x12')]){this['channels'][_0x136658[_0x82ba('0x21')]][_0x56a5f7]['agentringnoanswer']=!![];this[_0x82ba('0x20')][_0x136658[_0x82ba('0x21')]][_0x56a5f7]['agentringnoanswerAt']=moment()['format'](_0x82ba('0x23'));this[_0x82ba('0x20')][_0x136658[_0x82ba('0x21')]][_0x56a5f7]['reason']=_0x82ba('0x46');this[_0x82ba('0x20')][_0x136658['uniqueid']][_0x56a5f7][_0x82ba('0x2f')]=_0x82ba('0x46');ami[_0x82ba('0x1c')](_0x82ba('0x47'),this[_0x82ba('0x20')][_0x136658[_0x82ba('0x21')]][_0x56a5f7]);}}}}}catch(_0x109cae){logger[_0x82ba('0x3e')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x82ba('0x40')](_0x109cae,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x1e15db){try{if(this[_0x82ba('0x1d')](_0x1e15db)){if(this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]]){for(var _0x508216 in this[_0x82ba('0x20')][_0x1e15db['uniqueid']]){if(this['channels'][_0x1e15db[_0x82ba('0x21')]]['hasOwnProperty'](_0x508216)){if(this['channels'][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x2e')]&&!this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x12')]){this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x12')]=!![];this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x2f')]=_0x82ba('0x48');this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x49')]=_0x1e15db[_0x82ba('0x49')];this[_0x82ba('0x20')][_0x1e15db['uniqueid']][_0x508216]['reason']=_0x1e15db['reason']==_0x82ba('0x4a')?_0x82ba('0x4b'):_0x1e15db[_0x82ba('0x42')];if(this[_0x82ba('0x7')][_0x1e15db[_0x82ba('0x25')]]&&this[_0x82ba('0x7')][_0x1e15db[_0x82ba('0x25')]]['acw']){this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216][_0x82ba('0x4c')]=!![];this[_0x82ba('0x20')][_0x1e15db['uniqueid']][_0x508216][_0x82ba('0x4d')]=this[_0x82ba('0x7')][_0x1e15db[_0x82ba('0x25')]][_0x82ba('0x4e')];}this[_0x82ba('0x8')][_0x1e15db[_0x82ba('0x35')]]=_[_0x82ba('0x4f')](this['agents'][_0x1e15db['interface']],[_0x82ba('0x25'),'destconnectedlinenum']);this[_0x82ba('0x1c')](util['format']('user:%s',_0x1e15db[_0x82ba('0x37')]),_0x82ba('0x50'),this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216]);ami[_0x82ba('0x1c')](_0x82ba('0x51'),this[_0x82ba('0x20')][_0x1e15db[_0x82ba('0x21')]][_0x508216]);}}}}}}catch(_0x50c3a4){logger[_0x82ba('0x3e')](_0x82ba('0x52'),util[_0x82ba('0x40')](_0x50c3a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x82ba('0x1f')]['syncVarSet']=function(_0x551bea){try{if(this['isNotNull'](_0x551bea)){this[_0x82ba('0x53')](_0x551bea['uniqueid'],_[_0x82ba('0x54')](_0x551bea[_0x82ba('0x55')])[0x0],_0x551bea['value']);if(this['channels'][_0x551bea[_0x82ba('0x21')]]){for(var _0x4fd0db in this[_0x82ba('0x20')][_0x551bea[_0x82ba('0x21')]]){if(this['channels'][_0x551bea[_0x82ba('0x21')]]['hasOwnProperty'](_0x4fd0db)){if(_[_0x82ba('0x1e')](this[_0x82ba('0x20')][_0x551bea['uniqueid']][_0x4fd0db][_0x82ba('0x9')])){this[_0x82ba('0x20')][_0x551bea[_0x82ba('0x21')]][_0x4fd0db][_0x82ba('0x9')]={};}this[_0x82ba('0x20')][_0x551bea['uniqueid']][_0x4fd0db][_0x82ba('0x9')]=this[_0x82ba('0x9')][_0x551bea[_0x82ba('0x21')]];}}}}}catch(_0x9d298e){logger[_0x82ba('0x3e')](_0x82ba('0x56'),util[_0x82ba('0x40')](_0x9d298e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x8167b,_0x5054ae,_0x5dc39d){var _0x5199f5=['rtpaudioqos','rtpaudioqosbridged',_0x82ba('0x57'),_0x82ba('0x58'),_0x82ba('0x59'),_0x82ba('0x5a'),_0x82ba('0x5b'),_0x82ba('0x5c'),_0x82ba('0x5d'),_0x82ba('0x5e'),_0x82ba('0x5f'),_0x82ba('0x60'),'membercalls',_0x82ba('0x61'),_0x82ba('0x62'),_0x82ba('0x63'),'membername','memberpenalty',_0x82ba('0x64')];if(!_[_0x82ba('0x65')](_0x5054ae)&&!_['includes'](_0x5199f5,_0x5054ae)){if(_['isUndefined'](this['variables'][_0x8167b])){this['variables'][_0x8167b]={};}this[_0x82ba('0x9')][_0x8167b][_0x5054ae]=_0x5dc39d;}};VoiceAgentReport['prototype'][_0x82ba('0x16')]=function(_0x485f6){try{if(this[_0x82ba('0x1d')](_0x485f6)){if(this[_0x82ba('0x20')][_0x485f6[_0x82ba('0x21')]]){for(var _0x8b2b16 in this[_0x82ba('0x20')][_0x485f6['uniqueid']]){if(this[_0x82ba('0x20')][_0x485f6['uniqueid']][_0x82ba('0x2d')](_0x8b2b16)){if(this[_0x82ba('0x20')][_0x485f6['uniqueid']][_0x8b2b16][_0x82ba('0x42')]=='transfer'&&this[_0x82ba('0x20')][_0x485f6['uniqueid']][_0x8b2b16][_0x82ba('0x12')]){this[_0x82ba('0x20')][_0x485f6[_0x82ba('0x21')]][_0x8b2b16][_0x82ba('0x66')]=moment()['format'](_0x82ba('0x23'));}}}ami[_0x82ba('0x1c')](_0x82ba('0x67'),_[_0x82ba('0x68')](this[_0x82ba('0x20')][_0x485f6[_0x82ba('0x21')]]));delete this[_0x82ba('0x20')][_0x485f6['uniqueid']];}if(this[_0x82ba('0x9')][_0x485f6[_0x82ba('0x21')]]){delete this[_0x82ba('0x9')][_0x485f6[_0x82ba('0x21')]];}}}catch(_0x1cdee6){logger['error'](_0x82ba('0x69'),util[_0x82ba('0x40')](_0x1cdee6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x82ba('0x1f')]['syncAttendedTransfer']=function(_0x38cfaf){try{if(this['isNotNull'](_0x38cfaf)){if(this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6a')]]){for(var _0x5498f7 in this[_0x82ba('0x20')][_0x38cfaf['transfereeuniqueid']]){if(this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6a')]][_0x82ba('0x2d')](_0x5498f7)){if(_0x38cfaf[_0x82ba('0x6b')]===_0x5498f7){var _0x715495=moment();this[_0x82ba('0x20')][_0x38cfaf['transfereeuniqueid']][_0x5498f7]['agentcomplete']=!![];this['channels'][_0x38cfaf[_0x82ba('0x6a')]][_0x5498f7][_0x82ba('0x66')]=moment()[_0x82ba('0x2b')](_0x82ba('0x23'));this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6a')]][_0x5498f7][_0x82ba('0x42')]=_0x82ba('0x4a');this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6a')]][_0x5498f7][_0x82ba('0x2f')]=_0x82ba('0x48');this['channels'][_0x38cfaf[_0x82ba('0x6a')]][_0x5498f7][_0x82ba('0x49')]=_0x715495[_0x82ba('0x6c')](this[_0x82ba('0x20')][_0x38cfaf['transfereeuniqueid']][_0x5498f7][_0x82ba('0x2e')],'seconds');}}}}if(this['channels'][_0x38cfaf[_0x82ba('0x6d')]]){var _0x14c425=this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6d')]];this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6d')]]=this[_0x82ba('0x20')][_0x38cfaf[_0x82ba('0x6a')]];this['channels'][_0x38cfaf['transfereeuniqueid']]=_0x14c425;}}}catch(_0x242292){logger[_0x82ba('0x3e')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0x82ba('0x40')](_0x242292,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x82ba('0x6e')]=function(_0xd6ba95){try{if(this['isNotNull'](_0xd6ba95)){if(this[_0x82ba('0x20')][_0xd6ba95['transfereeuniqueid']]){for(var _0x142b2b in this[_0x82ba('0x20')][_0xd6ba95[_0x82ba('0x6a')]]){if(this[_0x82ba('0x20')][_0xd6ba95[_0x82ba('0x6a')]][_0x82ba('0x2d')](_0x142b2b)){if(_0xd6ba95['transfereruniqueid']===_0x142b2b){var _0x35f64e=moment();this[_0x82ba('0x20')][_0xd6ba95['transfereeuniqueid']][_0x142b2b][_0x82ba('0x12')]=!![];this[_0x82ba('0x20')][_0xd6ba95['transfereeuniqueid']][_0x142b2b][_0x82ba('0x66')]=_0x35f64e;this['channels'][_0xd6ba95[_0x82ba('0x6a')]][_0x142b2b]['reason']=_0x82ba('0x4a');this['channels'][_0xd6ba95['transfereeuniqueid']][_0x142b2b][_0x82ba('0x2f')]=_0x82ba('0x48');this[_0x82ba('0x20')][_0xd6ba95['transfereeuniqueid']][_0x142b2b][_0x82ba('0x49')]=_0x35f64e[_0x82ba('0x6c')](this[_0x82ba('0x20')][_0xd6ba95[_0x82ba('0x6a')]][_0x142b2b][_0x82ba('0x2e')],'seconds');}}}}}}catch(_0x2f781d){logger[_0x82ba('0x3e')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x82ba('0x40')](_0x2f781d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x82ba('0x1f')]['syncMusicOnHoldStart']=function(_0x9bb288){var _0x5837a7='';try{if(this[_0x82ba('0x1d')](_0x9bb288)){if(_0x9bb288[_0x82ba('0x6f')]){_0x5837a7=_0x9bb288[_0x82ba('0x6f')][_0x82ba('0x70')](0x0,_0x9bb288[_0x82ba('0x6f')]['lastIndexOf']('-'));if(this[_0x82ba('0x8')][_0x5837a7]){this[_0x82ba('0x8')][_0x5837a7]['onhold']=!![];}}}}catch(_0x32922e){logger[_0x82ba('0x3e')](_0x82ba('0x71'),util['inspect'](_0x32922e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x82ba('0x1f')][_0x82ba('0x19')]=function(_0x50d328){var _0x2bd6d9='';try{if(this[_0x82ba('0x1d')](_0x50d328)){if(_0x50d328[_0x82ba('0x6f')]){_0x2bd6d9=_0x50d328[_0x82ba('0x6f')][_0x82ba('0x70')](0x0,_0x50d328[_0x82ba('0x6f')][_0x82ba('0x72')]('-'));if(this[_0x82ba('0x8')][_0x2bd6d9]){this['agents'][_0x2bd6d9]['onhold']=![];}}}}catch(_0x43a64b){logger[_0x82ba('0x3e')](_0x82ba('0x73'),util[_0x82ba('0x40')](_0x43a64b,{'showHidden':![],'depth':null}));}};module[_0x82ba('0x74')]=VoiceAgentReport; \ No newline at end of file +var _0xbbac=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','omit','custom:agentcalled','format','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','user:%s','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','acw','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','variables','rtpaudioqos','rtpaudioqosbridged'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xbbac,0x9f));var _0xcbba=function(_0x43b6b0,_0x5ad96f){_0x43b6b0=_0x43b6b0-0x0;var _0x7ea336=_0xbbac[_0x43b6b0];return _0x7ea336;};'use strict';var _=require(_0xcbba('0x0'));var moment=require(_0xcbba('0x1'));var util=require('util');var Redis=require(_0xcbba('0x2'));var config=require(_0xcbba('0x3'));var logger=require(_0xcbba('0x4'))(_0xcbba('0x5'));var ami=require(_0xcbba('0x6'));config[_0xcbba('0x7')]=_[_0xcbba('0x8')](config[_0xcbba('0x7')],{'host':_0xcbba('0x9'),'port':0x18eb});var io=require(_0xcbba('0xa'))(new Redis(config[_0xcbba('0x7')]));function VoiceAgentReport(_0x2cabf6){this[_0xcbba('0xb')]={};this[_0xcbba('0xc')]=_0x2cabf6[_0xcbba('0xc')];this[_0xcbba('0xd')]=_0x2cabf6[_0xcbba('0xd')];this['variables']={};ami['on']('agentcalled',this[_0xcbba('0xe')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x10'),this[_0xcbba('0x11')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x12'),this[_0xcbba('0x13')]['bind'](this));ami['on'](_0xcbba('0x14'),this[_0xcbba('0x15')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x16'),this[_0xcbba('0x17')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x18'),this[_0xcbba('0x19')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x1a'),this[_0xcbba('0x1b')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x1c'),this[_0xcbba('0x1d')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x1e'),this[_0xcbba('0x1f')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x20'),this[_0xcbba('0x21')][_0xcbba('0xf')](this));ami['on'](_0xcbba('0x22'),this[_0xcbba('0x23')]['bind'](this));}VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x25')]=function(_0x376ca2,_0x561d54,_0x52d3a1){io['to'](_0x376ca2)['emit'](_0x561d54,_0x52d3a1);};VoiceAgentReport['prototype'][_0xcbba('0x26')]=function(_0x3c3a4e){return _0x3c3a4e!==null&&!_[_0xcbba('0x27')](_0x3c3a4e);};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0xe')]=function(_0x193b7f){try{if(this[_0xcbba('0x26')](_0x193b7f)){if(_[_0xcbba('0x27')](this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]])){this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]]={};}if(_[_0xcbba('0x27')](this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]][_0x193b7f[_0xcbba('0x29')]])){this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]][_0x193b7f[_0xcbba('0x29')]]={'agentcalledAt':moment()['format'](_0xcbba('0x2a')),'lastevent':_0xcbba('0x2b'),'variables':this['variables'][_0x193b7f[_0xcbba('0x28')]],'type':this[_0xcbba('0xc')][_0x193b7f[_0xcbba('0x2c')]]?this[_0xcbba('0xc')][_0x193b7f['queue']]['type']||_0xcbba('0x2d'):_0xcbba('0x2d')};}_[_0xcbba('0x2e')](this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]][_0x193b7f[_0xcbba('0x29')]],_[_0xcbba('0x2f')](_0x193b7f,['event','privilege']));ami[_0xcbba('0x25')](_0xcbba('0x30'),this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]][_0x193b7f[_0xcbba('0x29')]]);this[_0xcbba('0x25')](util[_0xcbba('0x31')]('user:%s',_0x193b7f[_0xcbba('0x32')]),_0xcbba('0x33'),this[_0xcbba('0xb')][_0x193b7f[_0xcbba('0x28')]][_0x193b7f[_0xcbba('0x29')]]);}}catch(_0x227794){logger[_0xcbba('0x34')](_0xcbba('0x35'),util[_0xcbba('0x36')](_0x227794,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x11')]=function(_0x4391b7){try{if(this[_0xcbba('0x26')](_0x4391b7)){if(this[_0xcbba('0xb')][_0x4391b7['uniqueid']]){for(var _0x5935d6 in this['channels'][_0x4391b7[_0xcbba('0x28')]]){if(this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0xcbba('0x37')](_0x5935d6)){if(_0x4391b7[_0xcbba('0x29')]===_0x5935d6){this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6][_0xcbba('0x38')]=moment()['format'](_0xcbba('0x2a'));this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6][_0xcbba('0x39')]=_0xcbba('0x3a');this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6]['holdtime']=_0x4391b7[_0xcbba('0x3b')];this['channels'][_0x4391b7[_0xcbba('0x28')]][_0x5935d6][_0xcbba('0x3c')]=_0x4391b7[_0xcbba('0x3c')];this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x5935d6]['connectedlinename']=_0x4391b7[_0xcbba('0x3d')];this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6]['destchannelstate']=_0x4391b7[_0xcbba('0x3e')];this['channels'][_0x4391b7['uniqueid']][_0x5935d6][_0xcbba('0x3f')]=_0x4391b7[_0xcbba('0x3f')];_[_0xcbba('0x2e')](this[_0xcbba('0xd')][_0x4391b7[_0xcbba('0x40')]],_['pick'](_0x4391b7,[_0xcbba('0x2c'),_0xcbba('0x41')]));this['emit'](util[_0xcbba('0x31')](_0xcbba('0x42'),_0x4391b7[_0xcbba('0x32')]),_0xcbba('0x43'),this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x4391b7[_0xcbba('0x29')]]);ami[_0xcbba('0x25')](_0xcbba('0x44'),this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6]);}else if(!this['channels'][_0x4391b7['uniqueid']][_0x5935d6]['agentringnoanswer']&&!this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6][_0xcbba('0x16')]){this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x5935d6]['agentringnoanswer']=!![];this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x5935d6][_0xcbba('0x45')]=moment()[_0xcbba('0x31')](_0xcbba('0x2a'));this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6][_0xcbba('0x46')]='answered_elsewhere';this[_0xcbba('0xb')][_0x4391b7['uniqueid']][_0x5935d6]['lastevent']='answered_elsewhere';this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x5935d6][_0xcbba('0x47')]=_0x4391b7[_0xcbba('0x29')];this[_0xcbba('0xb')][_0x4391b7[_0xcbba('0x28')]][_0x5935d6][_0xcbba('0x48')]=_0x4391b7['membername'];ami[_0xcbba('0x25')](_0xcbba('0x49'),this['channels'][_0x4391b7[_0xcbba('0x28')]][_0x5935d6]);}}}}}}catch(_0x22ea27){logger[_0xcbba('0x34')](_0xcbba('0x4a'),util[_0xcbba('0x36')](_0x22ea27,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x13')]=function(_0x2140a5){try{if(this[_0xcbba('0x26')](_0x2140a5)){if(this[_0xcbba('0xb')][_0x2140a5[_0xcbba('0x28')]]&&this[_0xcbba('0xb')][_0x2140a5[_0xcbba('0x28')]][_0x2140a5[_0xcbba('0x29')]]){this[_0xcbba('0xb')][_0x2140a5[_0xcbba('0x28')]][_0x2140a5['destuniqueid']]['agentringnoanswer']=!![];this['channels'][_0x2140a5[_0xcbba('0x28')]][_0x2140a5[_0xcbba('0x29')]][_0xcbba('0x45')]=moment()[_0xcbba('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcbba('0xb')][_0x2140a5['uniqueid']][_0x2140a5[_0xcbba('0x29')]]['reason']='rejected';this[_0xcbba('0xb')][_0x2140a5[_0xcbba('0x28')]][_0x2140a5[_0xcbba('0x29')]][_0xcbba('0x39')]='rejected';ami['emit']('custom:agentringnoanswer',this[_0xcbba('0xb')][_0x2140a5[_0xcbba('0x28')]][_0x2140a5[_0xcbba('0x29')]]);}}}catch(_0x1a1fc5){logger['error'](_0xcbba('0x4b'),util[_0xcbba('0x36')](_0x1a1fc5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')]['syncQueueCallerAbandon']=function(_0x4c8b6b){try{if(this['isNotNull'](_0x4c8b6b)){if(this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]]){for(var _0x26760b in this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]]){if(this['channels'][_0x4c8b6b[_0xcbba('0x28')]][_0xcbba('0x37')](_0x26760b)&&!this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b][_0xcbba('0x12')]&&!this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b]['agentcomplete']){this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b][_0xcbba('0x12')]=!![];this['channels'][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b][_0xcbba('0x45')]=moment()[_0xcbba('0x31')](_0xcbba('0x2a'));this[_0xcbba('0xb')][_0x4c8b6b['uniqueid']][_0x26760b][_0xcbba('0x46')]=_0xcbba('0x4c');this[_0xcbba('0xb')][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b][_0xcbba('0x39')]=_0xcbba('0x4c');ami[_0xcbba('0x25')](_0xcbba('0x4d'),this['channels'][_0x4c8b6b[_0xcbba('0x28')]][_0x26760b]);}}}}}catch(_0x4dd1de){logger[_0xcbba('0x34')](_0xcbba('0x4e'),util[_0xcbba('0x36')](_0x4dd1de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x17')]=function(_0x2393e6){try{if(this[_0xcbba('0x26')](_0x2393e6)){if(this[_0xcbba('0xb')][_0x2393e6['uniqueid']]){for(var _0x32d9d3 in this[_0xcbba('0xb')][_0x2393e6['uniqueid']]){if(this[_0xcbba('0xb')][_0x2393e6['uniqueid']][_0xcbba('0x37')](_0x32d9d3)){if(this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3]['agentconnectAt']&&!this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x16')]){this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x16')]=!![];this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x4f')]=moment()[_0xcbba('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x39')]=_0xcbba('0x50');this['channels'][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x51')]=_0x2393e6[_0xcbba('0x51')];this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3][_0xcbba('0x46')]=_0x2393e6[_0xcbba('0x46')]==_0xcbba('0x52')?_0xcbba('0x53'):_0x2393e6[_0xcbba('0x46')];if(this[_0xcbba('0xc')][_0x2393e6['queue']]&&this[_0xcbba('0xc')][_0x2393e6[_0xcbba('0x2c')]][_0xcbba('0x54')]){this['channels'][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3]['agentacw']=!![];this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3]['acwtime']=this[_0xcbba('0xc')][_0x2393e6[_0xcbba('0x2c')]][_0xcbba('0x55')];}this[_0xcbba('0xd')][_0x2393e6['interface']]=_['omit'](this['agents'][_0x2393e6[_0xcbba('0x40')]],['queue',_0xcbba('0x41')]);this['emit'](util[_0xcbba('0x31')](_0xcbba('0x42'),_0x2393e6[_0xcbba('0x32')]),_0xcbba('0x56'),this[_0xcbba('0xb')][_0x2393e6['uniqueid']][_0x32d9d3]);ami[_0xcbba('0x25')](_0xcbba('0x57'),this[_0xcbba('0xb')][_0x2393e6[_0xcbba('0x28')]][_0x32d9d3]);}}}}}}catch(_0x1d6573){logger[_0xcbba('0x34')](_0xcbba('0x58'),util[_0xcbba('0x36')](_0x1d6573,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x19')]=function(_0x301287){try{if(this[_0xcbba('0x26')](_0x301287)){this[_0xcbba('0x59')](_0x301287[_0xcbba('0x28')],_[_0xcbba('0x5a')](_0x301287[_0xcbba('0x5b')])[0x0],_0x301287['value']);if(this[_0xcbba('0xb')][_0x301287[_0xcbba('0x28')]]){for(var _0x198a75 in this['channels'][_0x301287['uniqueid']]){if(this[_0xcbba('0xb')][_0x301287[_0xcbba('0x28')]][_0xcbba('0x37')](_0x198a75)){if(_[_0xcbba('0x27')](this[_0xcbba('0xb')][_0x301287[_0xcbba('0x28')]][_0x198a75][_0xcbba('0x5c')])){this[_0xcbba('0xb')][_0x301287[_0xcbba('0x28')]][_0x198a75][_0xcbba('0x5c')]={};}this['channels'][_0x301287[_0xcbba('0x28')]][_0x198a75][_0xcbba('0x5c')]=this['variables'][_0x301287['uniqueid']];}}}}}catch(_0x334249){logger[_0xcbba('0x34')]('[syncVarSet][VoiceAgentReport]',util[_0xcbba('0x36')](_0x334249,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')]['addVariable']=function(_0xa49a17,_0x31b687,_0x280c53){var _0x1b911a=[_0xcbba('0x5d'),_0xcbba('0x5e'),_0xcbba('0x5f'),_0xcbba('0x60'),_0xcbba('0x61'),_0xcbba('0x62'),_0xcbba('0x63'),_0xcbba('0x64'),_0xcbba('0x65'),_0xcbba('0x66'),_0xcbba('0x67'),_0xcbba('0x68'),_0xcbba('0x69'),_0xcbba('0x6a'),_0xcbba('0x6b'),_0xcbba('0x6c'),_0xcbba('0x32'),_0xcbba('0x6d'),_0xcbba('0x6e')];if(!_['isNil'](_0x31b687)&&!_[_0xcbba('0x6f')](_0x1b911a,_0x31b687)){if(_['isUndefined'](this[_0xcbba('0x5c')][_0xa49a17])){this['variables'][_0xa49a17]={};}this['variables'][_0xa49a17][_0x31b687]=_0x280c53;}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x1b')]=function(_0x2a3d9e){try{if(this[_0xcbba('0x26')](_0x2a3d9e)){if(this[_0xcbba('0xb')][_0x2a3d9e[_0xcbba('0x28')]]){for(var _0x54073c in this[_0xcbba('0xb')][_0x2a3d9e['uniqueid']]){if(this[_0xcbba('0xb')][_0x2a3d9e['uniqueid']]['hasOwnProperty'](_0x54073c)){if(this[_0xcbba('0xb')][_0x2a3d9e[_0xcbba('0x28')]][_0x54073c][_0xcbba('0x46')]=='transfer'&&this[_0xcbba('0xb')][_0x2a3d9e[_0xcbba('0x28')]][_0x54073c][_0xcbba('0x16')]){this[_0xcbba('0xb')][_0x2a3d9e[_0xcbba('0x28')]][_0x54073c]['agentcompleteAt']=moment()[_0xcbba('0x31')](_0xcbba('0x2a'));}}}ami[_0xcbba('0x25')]('custom:voiceAgentReport',_[_0xcbba('0x70')](this[_0xcbba('0xb')][_0x2a3d9e['uniqueid']]));delete this[_0xcbba('0xb')][_0x2a3d9e[_0xcbba('0x28')]];}if(this[_0xcbba('0x5c')][_0x2a3d9e[_0xcbba('0x28')]]){delete this[_0xcbba('0x5c')][_0x2a3d9e[_0xcbba('0x28')]];}}}catch(_0x18faa8){logger['error'](_0xcbba('0x71'),util['inspect'](_0x18faa8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x21')]=function(_0x163593){try{if(this['isNotNull'](_0x163593)){if(this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]]){for(var _0x48ce33 in this['channels'][_0x163593[_0xcbba('0x72')]]){if(this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]]['hasOwnProperty'](_0x48ce33)){if(_0x163593['origtransfereruniqueid']===_0x48ce33){var _0x44bf4c=moment();this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]][_0x48ce33][_0xcbba('0x16')]=!![];this['channels'][_0x163593['transfereeuniqueid']][_0x48ce33][_0xcbba('0x4f')]=moment()[_0xcbba('0x31')](_0xcbba('0x2a'));this[_0xcbba('0xb')][_0x163593['transfereeuniqueid']][_0x48ce33][_0xcbba('0x46')]=_0xcbba('0x52');this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]][_0x48ce33][_0xcbba('0x39')]=_0xcbba('0x50');this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]][_0x48ce33][_0xcbba('0x51')]=_0x44bf4c[_0xcbba('0x73')](this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]][_0x48ce33][_0xcbba('0x38')],_0xcbba('0x74'));}}}}if(this[_0xcbba('0xb')][_0x163593[_0xcbba('0x75')]]){var _0x43b800=this[_0xcbba('0xb')][_0x163593[_0xcbba('0x75')]];this[_0xcbba('0xb')][_0x163593[_0xcbba('0x75')]]=this[_0xcbba('0xb')][_0x163593['transfereeuniqueid']];this[_0xcbba('0xb')][_0x163593[_0xcbba('0x72')]]=_0x43b800;}}}catch(_0x2ece18){logger[_0xcbba('0x34')](_0xcbba('0x76'),util[_0xcbba('0x36')](_0x2ece18,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x23')]=function(_0x5c31ad){try{if(this[_0xcbba('0x26')](_0x5c31ad)){if(this['channels'][_0x5c31ad[_0xcbba('0x72')]]){for(var _0x295432 in this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]]){if(this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]]['hasOwnProperty'](_0x295432)){if(_0x5c31ad[_0xcbba('0x77')]===_0x295432){var _0x359c6f=moment();this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]][_0x295432][_0xcbba('0x16')]=!![];this['channels'][_0x5c31ad['transfereeuniqueid']][_0x295432]['agentcompleteAt']=_0x359c6f;this[_0xcbba('0xb')][_0x5c31ad['transfereeuniqueid']][_0x295432]['reason']='transfer';this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]][_0x295432][_0xcbba('0x39')]=_0xcbba('0x50');this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]][_0x295432][_0xcbba('0x51')]=_0x359c6f[_0xcbba('0x73')](this[_0xcbba('0xb')][_0x5c31ad[_0xcbba('0x72')]][_0x295432][_0xcbba('0x38')],_0xcbba('0x74'));}}}}}}catch(_0x5cfc5a){logger[_0xcbba('0x34')]('[syncBlindTransfer][VoiceAgentReport]',util[_0xcbba('0x36')](_0x5cfc5a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcbba('0x1d')]=function(_0x1d48eb){var _0x575e06='';try{if(this[_0xcbba('0x26')](_0x1d48eb)){if(_0x1d48eb['channel']){_0x575e06=_0x1d48eb[_0xcbba('0x78')][_0xcbba('0x79')](0x0,_0x1d48eb[_0xcbba('0x78')][_0xcbba('0x7a')]('-'));if(this[_0xcbba('0xd')][_0x575e06]){this[_0xcbba('0xd')][_0x575e06][_0xcbba('0x7b')]=!![];}}}}catch(_0x2a28ae){logger['error'](_0xcbba('0x7c'),util['inspect'](_0x2a28ae,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcbba('0x24')][_0xcbba('0x1f')]=function(_0x3179a2){var _0x460256='';try{if(this['isNotNull'](_0x3179a2)){if(_0x3179a2[_0xcbba('0x78')]){_0x460256=_0x3179a2[_0xcbba('0x78')][_0xcbba('0x79')](0x0,_0x3179a2[_0xcbba('0x78')][_0xcbba('0x7a')]('-'));if(this[_0xcbba('0xd')][_0x460256]){this[_0xcbba('0xd')][_0x460256][_0xcbba('0x7b')]=![];}}}}catch(_0x285fd2){logger[_0xcbba('0x34')](_0xcbba('0x7d'),util[_0xcbba('0x36')](_0x285fd2,{'showHidden':![],'depth':null}));}};module[_0xcbba('0x7e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 8a75249..2fa5938 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 _0x7971=['type','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','sipcallid','sipcalluniqueid','mixmonitor_filename','[syncVarSet][VoiceCallReport]','endtime','seconds','billableseconds','answertime','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','isNil','mohtime','milliseconds','mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','exports','moment','path','ioredis','../../../config/environment','ami','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','newexten','syncNewExten','bind','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','then','catch','log','isNotNull','isUndefined','prototype','emit','uniqueid','linkedid','merge','pick','keys','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','exten','application','toLowerCase','applicationdata','appdata','duration','subtract','includes','lastapplication','lastdata','set','cdr(','match','[syncNewExten][VoiceCallReport]','inspect','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','rec','variable','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','xmd-cdrtype'];(function(_0x5d43d8,_0x22a4f6){var _0x27ae1d=function(_0x43bcef){while(--_0x43bcef){_0x5d43d8['push'](_0x5d43d8['shift']());}};_0x27ae1d(++_0x22a4f6);}(_0x7971,0xbf));var _0x1797=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x7971[_0x2d2c16];return _0x53f2fb;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0x1797('0x0'));var util=require('util');var path=require(_0x1797('0x1'));var Redis=require(_0x1797('0x2'));var config=require(_0x1797('0x3'));var logger=require('../../../config/logger')(_0x1797('0x4'));var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0x1797('0x5'),_0x1797('0x6'),_0x1797('0x7'),_0x1797('0x8'),_0x1797('0x9'),_0x1797('0xa'),_0x1797('0xb'),_0x1797('0xc'),_0x1797('0xd')];var applications=['set',_0x1797('0xe'),_0x1797('0xf'),_0x1797('0x10'),_0x1797('0x11'),_0x1797('0x12')];var dispositions=[_0x1797('0x13'),'FAILED',_0x1797('0x14'),_0x1797('0x13'),_0x1797('0x13'),'NO\x20ANSWER',_0x1797('0x15'),_0x1797('0x16'),_0x1797('0x14'),_0x1797('0x14'),_0x1797('0x14')];var actions={};config[_0x1797('0x17')]=_[_0x1797('0x18')](config[_0x1797('0x17')],{'host':_0x1797('0x19'),'port':0x18eb});var io=require(_0x1797('0x1a'))(new Redis(config['redis']));function VoiceCallReport(_0x378c6e){this[_0x1797('0x1b')]=_0x378c6e[_0x1797('0x1b')];this[_0x1797('0x1c')]=_0x378c6e[_0x1797('0x1c')];ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on'](_0x1797('0x1d'),this[_0x1797('0x1e')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x20'),this[_0x1797('0x21')][_0x1797('0x1f')](this));ami['on']('newstate',this[_0x1797('0x22')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x23'),this[_0x1797('0x24')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x25'),this[_0x1797('0x26')]['bind'](this));ami['on'](_0x1797('0x27'),this[_0x1797('0x28')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x29'),this[_0x1797('0x2a')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x2b'),this[_0x1797('0x2c')][_0x1797('0x1f')](this));ami['on'](_0x1797('0x2d'),this[_0x1797('0x2e')]['bind'](this));ami['on']('musiconholdstop',this[_0x1797('0x2f')][_0x1797('0x1f')](this));return BPromise[_0x1797('0x30')]()[_0x1797('0x31')](ami['actionCoreShowChannels']())[_0x1797('0x32')](function(_0x56e111){console[_0x1797('0x33')](_0x56e111);});}VoiceCallReport['prototype'][_0x1797('0x34')]=function(_0x33cfd1){return _0x33cfd1!==null&&!_[_0x1797('0x35')](_0x33cfd1);};VoiceCallReport[_0x1797('0x36')][_0x1797('0x37')]=function(_0x42ee80,_0x417877,_0x19c064){io['to'](_0x42ee80)[_0x1797('0x37')](_0x417877,_0x19c064);};VoiceCallReport[_0x1797('0x36')]['syncNewCallerId']=function(_0x1120c5){try{if(this['isNotNull'](_0x1120c5)){if(_0x1120c5[_0x1797('0x38')]===_0x1120c5[_0x1797('0x39')]){if(!_[_0x1797('0x35')](this[_0x1797('0x1b')][_0x1120c5['uniqueid']])){_[_0x1797('0x3a')](this[_0x1797('0x1b')][_0x1120c5[_0x1797('0x38')]],_[_0x1797('0x3b')](_0x1120c5,_[_0x1797('0x3c')](this['channels'][_0x1120c5[_0x1797('0x38')]])));}}}}catch(_0xf73e04){logger['error'](_0x1797('0x3d'),util['inspect'](_0xf73e04,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x21')]=function(_0x31ca94){try{if(this[_0x1797('0x34')](_0x31ca94)){if(_0x31ca94[_0x1797('0x38')]===_0x31ca94[_0x1797('0x39')]&&_0x31ca94[_0x1797('0x3e')]!=_0x1797('0x3f')){if(_['isUndefined'](this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]])){this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]]=new Channel();this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]][_0x1797('0x40')]=moment()[_0x1797('0x41')](_0x1797('0x42'));this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]][_0x1797('0x43')]=dispositions[_[_0x1797('0x44')](_0x31ca94[_0x1797('0x45')])];_[_0x1797('0x3a')](this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]],_[_0x1797('0x3b')](_0x31ca94,_[_0x1797('0x3c')](this[_0x1797('0x1b')][_0x31ca94[_0x1797('0x38')]])));if(_0x31ca94[_0x1797('0x46')]===_0x1797('0x47')){if(this[_0x1797('0x1c')][_0x31ca94[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]]){this['agents'][_0x31ca94[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]][_0x1797('0x49')]=_0x31ca94['exten'];this[_0x1797('0x37')](util['format'](_0x1797('0x4a'),this[_0x1797('0x1c')][_0x31ca94['channel'][_0x1797('0x48')]('-')[0x0]][_0x1797('0x4b')]),_0x1797('0x4c'),{'destaccountcode':this[_0x1797('0x1c')][_0x31ca94[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]][_0x1797('0x4d')],'destconnectedlinenum':_0x31ca94['exten']});}}}}}}catch(_0x445bea){logger[_0x1797('0x4e')](_0x1797('0x4f'),util['inspect'](_0x445bea,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x1e')]=function(_0x849938){try{if(this[_0x1797('0x34')](_0x849938)){if(_0x849938[_0x1797('0x38')]===_0x849938[_0x1797('0x39')]&&_0x849938[_0x1797('0x50')]!='h'&&_0x849938[_0x1797('0x3e')]!=_0x1797('0x3f')){_0x849938[_0x1797('0x51')]=_0x849938[_0x1797('0x51')][_0x1797('0x52')]();_0x849938[_0x1797('0x53')]=(_0x849938[_0x1797('0x54')]||_0x849938['applicationdata'])[_0x1797('0x52')]();if(_[_0x1797('0x35')](this[_0x1797('0x1b')][_0x849938[_0x1797('0x38')]])){this[_0x1797('0x1b')][_0x849938[_0x1797('0x38')]]=new Channel();this[_0x1797('0x1b')][_0x849938[_0x1797('0x38')]][_0x1797('0x40')]=_0x849938[_0x1797('0x55')]?moment()[_0x1797('0x56')](moment[_0x1797('0x55')](_0x849938[_0x1797('0x55')])['seconds'](),'seconds')[_0x1797('0x41')](_0x1797('0x42')):moment()[_0x1797('0x41')](_0x1797('0x42'));this[_0x1797('0x1b')][_0x849938['uniqueid']]['disposition']='NO\x20ANSWER';}_[_0x1797('0x3a')](this['channels'][_0x849938[_0x1797('0x38')]],_[_0x1797('0x3b')](_0x849938,_[_0x1797('0x3c')](this[_0x1797('0x1b')][_0x849938[_0x1797('0x38')]])));if(_[_0x1797('0x57')](applications,_0x849938[_0x1797('0x51')])){this[_0x1797('0x1b')][_0x849938[_0x1797('0x38')]][_0x1797('0x58')]=_0x849938[_0x1797('0x51')];this['channels'][_0x849938[_0x1797('0x38')]][_0x1797('0x59')]=_0x849938[_0x1797('0x53')];if(_0x849938['application']===_0x1797('0x5a')&&_['startsWith'](_0x849938['applicationdata'],_0x1797('0x5b'))){var _0x54f9e7=_0x849938[_0x1797('0x53')][_0x1797('0x48')]('=');var _0x986208=_0x54f9e7[0x0][_0x1797('0x5c')](/cdr\((.*)\)/);if(_0x986208){this[_0x1797('0x1b')][_0x849938['uniqueid']][_0x986208[0x1]]=_0x54f9e7[0x1];}}else if(_0x849938['application']===_0x1797('0xe')){this[_0x1797('0x1b')][_0x849938['uniqueid']]['queue']=_0x849938[_0x1797('0x53')]['split'](',')[0x0];}}}}}catch(_0x53de2e){logger[_0x1797('0x4e')](_0x1797('0x5d'),util[_0x1797('0x5e')](_0x53de2e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x22')]=function(_0xdc4a37){try{if(this[_0x1797('0x34')](_0xdc4a37)){if(_0xdc4a37['uniqueid']!==_0xdc4a37[_0x1797('0x39')]){if(this['channels'][_0xdc4a37['linkedid']]){if(_0xdc4a37[_0x1797('0x45')]==='6'){if(!this['channels'][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x5f')]){var _0x2400f2=moment();this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x5f')]=!![];this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]]['answertime']=_0x2400f2[_0x1797('0x41')](_0x1797('0x42'));if(this[_0x1797('0x1b')][_0xdc4a37['linkedid']][_0x1797('0x40')]){this['channels'][_0xdc4a37['linkedid']][_0x1797('0x60')]=_0x2400f2[_0x1797('0x61')](this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x40')],'seconds');}}this[_0x1797('0x1b')][_0xdc4a37['linkedid']]['linkedid']=_0xdc4a37[_0x1797('0x38')];if(_0xdc4a37[_0x1797('0x62')]!==_0x1797('0x63')){this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x64')]=_0xdc4a37['calleridnum'];}this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x65')]=_0xdc4a37[_0x1797('0x66')];this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x67')]=_0xdc4a37[_0x1797('0x3e')];this['channels'][_0xdc4a37[_0x1797('0x39')]][_0x1797('0x43')]=dispositions[_['toNumber'](_0xdc4a37[_0x1797('0x45')])];if(this[_0x1797('0x1c')][_0xdc4a37[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]]){this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x39')]]['UserId']=this[_0x1797('0x1c')][_0xdc4a37['channel'][_0x1797('0x48')]('-')[0x0]]['id'];this[_0x1797('0x1b')][_0xdc4a37['linkedid']][_0x1797('0x68')]=this[_0x1797('0x1c')][_0xdc4a37[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]][_0x1797('0x4b')];}}}}else{if(this['channels'][_0xdc4a37['uniqueid']]){if(_0xdc4a37[_0x1797('0x45')]==='6'){if(this['agents'][_0xdc4a37['channel'][_0x1797('0x48')]('-')[0x0]]){this[_0x1797('0x1b')][_0xdc4a37[_0x1797('0x38')]][_0x1797('0x69')]=this[_0x1797('0x1c')][_0xdc4a37['channel'][_0x1797('0x48')]('-')[0x0]]['id'];this['channels'][_0xdc4a37[_0x1797('0x38')]][_0x1797('0x68')]=this['agents'][_0xdc4a37['channel'][_0x1797('0x48')]('-')[0x0]]['name'];}}}}}}catch(_0x19d121){logger[_0x1797('0x4e')](_0x1797('0x6a'),util[_0x1797('0x5e')](_0x19d121,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')]['syncMixMonitorFilename']=function(_0x4f4a83,_0x53eb85){if(this[_0x1797('0x1b')][_0x4f4a83]){this[_0x1797('0x1b')][_0x4f4a83][_0x1797('0x6b')]=!![];if(_['endsWith'](_0x53eb85,_0x1797('0x6c'))){_0x53eb85=_0x53eb85[_0x1797('0x6d')](_0x1797('0x6c'),_0x1797('0x6e'));}this[_0x1797('0x1b')][_0x4f4a83][_0x1797('0x6f')]=_0x53eb85;var _0x34a4ce=_[_0x1797('0x70')](this[_0x1797('0x1b')][_0x4f4a83][_0x1797('0x71')],{'filename':_0x53eb85});if(_['isNil'](_0x34a4ce)){this['channels'][_0x4f4a83][_0x1797('0x71')]['push']({'filename':_0x53eb85,'createdAt':moment()[_0x1797('0x41')](_0x1797('0x42')),'mixmonitorid':'','status':_0x1797('0x72')});}}};VoiceCallReport[_0x1797('0x36')]['syncVarSet']=function(_0x3538d6){try{if(this[_0x1797('0x34')](_0x3538d6)){if(this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]]&&_0x3538d6[_0x1797('0x3e')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x3538d6[_0x1797('0x73')])){if(this[_0x1797('0x34')](_0x3538d6['variable']['mixmonitor_filename'])){this[_0x1797('0x74')](_0x3538d6[_0x1797('0x38')],_0x3538d6[_0x1797('0x75')]);}else if(this['isNotNull'](_0x3538d6[_0x1797('0x73')][_0x1797('0x76')])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]][_0x1797('0x62')]=_0x3538d6['value'];}else if(this['isNotNull'](_0x3538d6[_0x1797('0x73')][_0x1797('0x77')])){this[_0x1797('0x1b')][_0x3538d6['uniqueid']]['callerid']=_0x3538d6[_0x1797('0x75')];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')][_0x1797('0x78')])){this['channels'][_0x3538d6[_0x1797('0x38')]][_0x1797('0x79')]=_0x3538d6[_0x1797('0x75')];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')]['xmd-queue'])){this['channels'][_0x3538d6[_0x1797('0x38')]][_0x1797('0xe')]=_0x3538d6[_0x1797('0x75')][_0x1797('0x48')](',')[0x0];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')][_0x1797('0x7a')])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]][_0x1797('0x7b')]=_0x3538d6[_0x1797('0x75')];}else if(this['isNotNull'](_0x3538d6[_0x1797('0x73')][_0x1797('0x7c')])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]]['destination']=_0x3538d6[_0x1797('0x75')];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')]['xmd-callerid-preview'])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]]['calleridpreview']=_0x3538d6['value'];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')]['xmcs-queue'])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x38')]][_0x1797('0xe')]=_0x3538d6[_0x1797('0x75')];}else if(this[_0x1797('0x34')](_0x3538d6[_0x1797('0x73')][_0x1797('0x7d')])){this['channels'][_0x3538d6[_0x1797('0x38')]][_0x1797('0x7e')]=_0x3538d6[_0x1797('0x75')];}}}else if(this['isNotNull'](_0x3538d6[_0x1797('0x73')][_0x1797('0x7f')])){if(_0x3538d6[_0x1797('0x75')]){var _0x5ac52a=path['parse'](_0x3538d6[_0x1797('0x75')])['name'];this[_0x1797('0x74')](_0x5ac52a,_0x3538d6['value']);}}else if(this[_0x1797('0x1b')][_0x3538d6['linkedid']]){if(this['isNotNull'](_0x3538d6[_0x1797('0x73')])){if(this['isNotNull'](_0x3538d6['variable'][_0x1797('0x7d')])){this[_0x1797('0x1b')][_0x3538d6[_0x1797('0x39')]]['sipcalllinkedid']=_0x3538d6[_0x1797('0x75')];}}}}}catch(_0x1da8e6){logger[_0x1797('0x4e')](_0x1797('0x80'),util[_0x1797('0x5e')](_0x1da8e6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x26')]=function(_0x57d5d0){try{if(this['isNotNull'](_0x57d5d0)){if(this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]]){var _0x451e91=moment();this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]][_0x1797('0x81')]=_0x451e91[_0x1797('0x41')](_0x1797('0x42'));this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]][_0x1797('0x55')]=_0x451e91['diff'](this['channels'][_0x57d5d0[_0x1797('0x38')]]['starttime'],_0x1797('0x82'));if(this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]][_0x1797('0x5f')]){this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]][_0x1797('0x83')]=_0x451e91[_0x1797('0x61')](this[_0x1797('0x1b')][_0x57d5d0['uniqueid']][_0x1797('0x84')],_0x1797('0x82'));this['channels'][_0x57d5d0[_0x1797('0x38')]][_0x1797('0x60')]=this[_0x1797('0x1b')][_0x57d5d0['uniqueid']]['duration']-this[_0x1797('0x1b')][_0x57d5d0['uniqueid']][_0x1797('0x83')];}if(_0x57d5d0[_0x1797('0x46')]===_0x1797('0x47')){if(this[_0x1797('0x1c')][_0x57d5d0[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]]){this[_0x1797('0x1c')][_0x57d5d0[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]]=_['omit'](this[_0x1797('0x1c')][_0x57d5d0[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]],[_0x1797('0x49')]);this['emit'](util[_0x1797('0x41')]('user:%s',this[_0x1797('0x1c')][_0x57d5d0[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]]['name']),_0x1797('0x85'),{'destaccountcode':this[_0x1797('0x1c')][_0x57d5d0[_0x1797('0x3e')][_0x1797('0x48')]('-')[0x0]][_0x1797('0x4d')]});}}ami['emit']('custom:voiceCallReport',this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]]);delete this[_0x1797('0x1b')][_0x57d5d0[_0x1797('0x38')]];}}}catch(_0x1b76b9){logger[_0x1797('0x4e')](_0x1797('0x86'),util[_0x1797('0x5e')](_0x1b76b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x2a')]=function(_0x120c61){try{if(this[_0x1797('0x34')](_0x120c61)){if(this['channels'][_0x120c61[_0x1797('0x87')]]){this[_0x1797('0x1b')][_0x120c61['transfereeuniqueid']][_0x1797('0x88')]=_0x120c61[_0x1797('0x89')];this['channels'][_0x120c61[_0x1797('0x87')]][_0x1797('0x8a')]=_0x120c61['transfertargetcalleridnum'];if(this[_0x1797('0x1b')][_0x120c61['secondtransfereruniqueid']]){var _0x16dd8d=this['channels'][_0x120c61[_0x1797('0x8b')]];this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8b')]]=this[_0x1797('0x1b')][_0x120c61[_0x1797('0x87')]];this[_0x1797('0x1b')][_0x120c61[_0x1797('0x87')]]=_0x16dd8d;}}else if(this[_0x1797('0x1b')][_0x120c61['transfertargetuniqueid']]){this[_0x1797('0x1b')][_0x120c61['transfertargetuniqueid']][_0x1797('0x88')]=_0x120c61[_0x1797('0x89')];this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8c')]][_0x1797('0x8a')]=_0x120c61[_0x1797('0x8d')];if(this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8e')]]){var _0x16dd8d=this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8e')]];this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8e')]]=this['channels'][_0x120c61[_0x1797('0x8c')]];this[_0x1797('0x1b')][_0x120c61[_0x1797('0x8c')]]=_0x16dd8d;}}}}catch(_0x148757){logger['error'](_0x1797('0x8f'),util[_0x1797('0x5e')](_0x148757,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x2c')]=function(_0x10d130){try{if(this[_0x1797('0x34')](_0x10d130)){if(this[_0x1797('0x1b')][_0x10d130['transfereeuniqueid']]){this[_0x1797('0x1b')][_0x10d130[_0x1797('0x87')]][_0x1797('0x88')]=_0x10d130[_0x1797('0x90')];this[_0x1797('0x1b')][_0x10d130[_0x1797('0x87')]][_0x1797('0x8a')]=_0x10d130[_0x1797('0x91')];this['syncHangup']({'event':_0x1797('0x92'),'uniqueid':_0x10d130[_0x1797('0x87')],'context':_0x10d130[_0x1797('0x46')],'channel':_0x10d130[_0x1797('0x93')]});}}}catch(_0x4ededa){logger[_0x1797('0x4e')](_0x1797('0x94'),util[_0x1797('0x5e')](_0x4ededa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x2e')]=function(_0x3fc11b){try{if(this[_0x1797('0x34')](_0x3fc11b)){if(this['channels'][_0x3fc11b[_0x1797('0x38')]]){if(!_['isNil'](this[_0x1797('0x1b')][_0x3fc11b[_0x1797('0x38')]][_0x1797('0x84')])){this[_0x1797('0x1b')][_0x3fc11b[_0x1797('0x38')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x3fb869){logger[_0x1797('0x4e')](_0x1797('0x95'),util[_0x1797('0x5e')](_0x3fb869,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1797('0x36')][_0x1797('0x2f')]=function(_0x133a16){try{if(this[_0x1797('0x34')](_0x133a16)){if(this[_0x1797('0x1b')][_0x133a16['uniqueid']]){if(!_[_0x1797('0x96')](this['channels'][_0x133a16[_0x1797('0x38')]]['mohstarttime'])){this[_0x1797('0x1b')][_0x133a16[_0x1797('0x38')]][_0x1797('0x97')]+=moment()[_0x1797('0x98')](0x0)['diff'](this[_0x1797('0x1b')][_0x133a16[_0x1797('0x38')]]['mohstarttime'],_0x1797('0x82'));delete this[_0x1797('0x1b')][_0x133a16[_0x1797('0x38')]][_0x1797('0x99')];}}}}catch(_0x36cf45){logger[_0x1797('0x4e')](_0x1797('0x9a'),util[_0x1797('0x5e')](_0x36cf45,{'showHidden':![],'depth':null}));}};module[_0x1797('0x9b')]=VoiceCallReport; \ No newline at end of file +var _0xa27e=['transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','exports','bluebird','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','actionCoreShowChannels','catch','log','prototype','isUndefined','emit','isNotNull','linkedid','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','disposition','toNumber','context','from-sip','channel','split','exten','format','user:%s','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','starttime','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','match','queue','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','holdtime','diff','calleridnum','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','find','monitors','isNil','push','variable','mixmonitor_filename','value','xmd-phone','callerid','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmcs-queue','sipcallid','parse','name','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','destconnectedlinenum','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum'];(function(_0x109033,_0x49a6be){var _0x1d9732=function(_0x159407){while(--_0x159407){_0x109033['push'](_0x109033['shift']());}};_0x1d9732(++_0x49a6be);}(_0xa27e,0x12d));var _0xea27=function(_0x8e9d66,_0x4b5f95){_0x8e9d66=_0x8e9d66-0x0;var _0x34d678=_0xa27e[_0x8e9d66];return _0x34d678;};'use strict';var BPromise=require(_0xea27('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var path=require('path');var Redis=require('ioredis');var config=require(_0xea27('0x1'));var logger=require(_0xea27('0x2'))(_0xea27('0x3'));var ami=require(_0xea27('0x4'));var Channel=require(_0xea27('0x5'));var statusDesc=[_0xea27('0x6'),_0xea27('0x7'),_0xea27('0x8'),_0xea27('0x9'),_0xea27('0xa'),_0xea27('0xb'),_0xea27('0xc'),'ringinuse',_0xea27('0xd')];var applications=[_0xea27('0xe'),'queue',_0xea27('0xf'),'dial',_0xea27('0x10'),_0xea27('0x11')];var dispositions=['NO\x20ANSWER',_0xea27('0x12'),'FAILED',_0xea27('0x13'),_0xea27('0x13'),_0xea27('0x13'),_0xea27('0x14'),_0xea27('0x15'),'FAILED',_0xea27('0x12'),_0xea27('0x12')];var actions={};config[_0xea27('0x16')]=_['defaults'](config[_0xea27('0x16')],{'host':'localhost','port':0x18eb});var io=require(_0xea27('0x17'))(new Redis(config[_0xea27('0x16')]));function VoiceCallReport(_0x1ade57){this[_0xea27('0x18')]=_0x1ade57[_0xea27('0x18')];this[_0xea27('0x19')]=_0x1ade57[_0xea27('0x19')];ami['on'](_0xea27('0x1a'),this[_0xea27('0x1b')][_0xea27('0x1c')](this));ami['on'](_0xea27('0x1d'),this['syncNewExten'][_0xea27('0x1c')](this));ami['on'](_0xea27('0x1e'),this[_0xea27('0x1f')]['bind'](this));ami['on'](_0xea27('0x20'),this[_0xea27('0x21')][_0xea27('0x1c')](this));ami['on'](_0xea27('0x22'),this[_0xea27('0x23')]['bind'](this));ami['on'](_0xea27('0x24'),this[_0xea27('0x25')][_0xea27('0x1c')](this));ami['on'](_0xea27('0x26'),this[_0xea27('0x27')][_0xea27('0x1c')](this));ami['on'](_0xea27('0x28'),this[_0xea27('0x29')]['bind'](this));ami['on']('blindtransfer',this[_0xea27('0x2a')][_0xea27('0x1c')](this));ami['on'](_0xea27('0x2b'),this[_0xea27('0x2c')][_0xea27('0x1c')](this));ami['on']('musiconholdstop',this[_0xea27('0x2d')]['bind'](this));return BPromise[_0xea27('0x2e')]()['then'](ami[_0xea27('0x2f')]())[_0xea27('0x30')](function(_0x216caf){console[_0xea27('0x31')](_0x216caf);});}VoiceCallReport[_0xea27('0x32')]['isNotNull']=function(_0x23a8b6){return _0x23a8b6!==null&&!_[_0xea27('0x33')](_0x23a8b6);};VoiceCallReport['prototype'][_0xea27('0x34')]=function(_0x59ab36,_0x17a6b3,_0x49c804){io['to'](_0x59ab36)[_0xea27('0x34')](_0x17a6b3,_0x49c804);};VoiceCallReport[_0xea27('0x32')][_0xea27('0x27')]=function(_0x3b86a4){try{if(this[_0xea27('0x35')](_0x3b86a4)){if(_0x3b86a4['uniqueid']===_0x3b86a4[_0xea27('0x36')]){if(!_[_0xea27('0x33')](this['channels'][_0x3b86a4[_0xea27('0x37')]])){_[_0xea27('0x38')](this[_0xea27('0x18')][_0x3b86a4['uniqueid']],_[_0xea27('0x39')](_0x3b86a4,_[_0xea27('0x3a')](this[_0xea27('0x18')][_0x3b86a4[_0xea27('0x37')]])));}}}}catch(_0x48c57e){logger[_0xea27('0x3b')](_0xea27('0x3c'),util[_0xea27('0x3d')](_0x48c57e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')][_0xea27('0x1f')]=function(_0x3322fc){try{if(this[_0xea27('0x35')](_0x3322fc)){if(_0x3322fc['uniqueid']===_0x3322fc[_0xea27('0x36')]&&_0x3322fc['channel']!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0xea27('0x18')][_0x3322fc[_0xea27('0x37')]])){this[_0xea27('0x18')][_0x3322fc['uniqueid']]=new Channel();this[_0xea27('0x18')][_0x3322fc[_0xea27('0x37')]]['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xea27('0x18')][_0x3322fc['uniqueid']][_0xea27('0x3e')]=dispositions[_[_0xea27('0x3f')](_0x3322fc['channelstate'])];_['merge'](this[_0xea27('0x18')][_0x3322fc['uniqueid']],_['pick'](_0x3322fc,_[_0xea27('0x3a')](this[_0xea27('0x18')][_0x3322fc[_0xea27('0x37')]])));if(_0x3322fc[_0xea27('0x40')]===_0xea27('0x41')){if(this['agents'][_0x3322fc[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]){this[_0xea27('0x19')][_0x3322fc[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x3322fc[_0xea27('0x44')];this[_0xea27('0x34')](util[_0xea27('0x45')](_0xea27('0x46'),this[_0xea27('0x19')][_0x3322fc['channel'][_0xea27('0x43')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xea27('0x19')][_0x3322fc['channel']['split']('-')[0x0]][_0xea27('0x47')],'destconnectedlinenum':_0x3322fc[_0xea27('0x44')]});}}}}}}catch(_0x4d030a){logger['error'](_0xea27('0x48'),util[_0xea27('0x3d')](_0x4d030a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')]['syncNewExten']=function(_0x29c99d){try{if(this[_0xea27('0x35')](_0x29c99d)){if(_0x29c99d[_0xea27('0x37')]===_0x29c99d['linkedid']&&_0x29c99d[_0xea27('0x44')]!='h'&&_0x29c99d[_0xea27('0x42')]!='OutgoingSpoolFailed'){_0x29c99d['application']=_0x29c99d[_0xea27('0x49')][_0xea27('0x4a')]();_0x29c99d[_0xea27('0x4b')]=(_0x29c99d['appdata']||_0x29c99d['applicationdata'])[_0xea27('0x4a')]();if(_['isUndefined'](this[_0xea27('0x18')][_0x29c99d[_0xea27('0x37')]])){this['channels'][_0x29c99d[_0xea27('0x37')]]=new Channel();this['channels'][_0x29c99d['uniqueid']][_0xea27('0x4c')]=_0x29c99d['duration']?moment()['subtract'](moment[_0xea27('0x4d')](_0x29c99d['duration'])[_0xea27('0x4e')](),_0xea27('0x4e'))['format'](_0xea27('0x4f')):moment()[_0xea27('0x45')](_0xea27('0x4f'));this[_0xea27('0x18')][_0x29c99d['uniqueid']][_0xea27('0x3e')]=_0xea27('0x13');}_[_0xea27('0x38')](this[_0xea27('0x18')][_0x29c99d[_0xea27('0x37')]],_['pick'](_0x29c99d,_[_0xea27('0x3a')](this[_0xea27('0x18')][_0x29c99d[_0xea27('0x37')]])));if(_[_0xea27('0x50')](applications,_0x29c99d[_0xea27('0x49')])){this[_0xea27('0x18')][_0x29c99d[_0xea27('0x37')]][_0xea27('0x51')]=_0x29c99d[_0xea27('0x49')];this['channels'][_0x29c99d[_0xea27('0x37')]][_0xea27('0x52')]=_0x29c99d[_0xea27('0x4b')];if(_0x29c99d[_0xea27('0x49')]===_0xea27('0xe')&&_['startsWith'](_0x29c99d[_0xea27('0x4b')],_0xea27('0x53'))){var _0x31ccb5=_0x29c99d[_0xea27('0x4b')][_0xea27('0x43')]('=');var _0x53a5f5=_0x31ccb5[0x0][_0xea27('0x54')](/cdr\((.*)\)/);if(_0x53a5f5){this[_0xea27('0x18')][_0x29c99d['uniqueid']][_0x53a5f5[0x1]]=_0x31ccb5[0x1];}}else if(_0x29c99d['application']===_0xea27('0x55')){this[_0xea27('0x18')][_0x29c99d['uniqueid']]['queue']=_0x29c99d['applicationdata'][_0xea27('0x43')](',')[0x0];}}}}}catch(_0x3b0cd){logger['error'](_0xea27('0x56'),util[_0xea27('0x3d')](_0x3b0cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')][_0xea27('0x21')]=function(_0x4124f8){try{if(this['isNotNull'](_0x4124f8)){if(_0x4124f8[_0xea27('0x37')]!==_0x4124f8[_0xea27('0x36')]){if(this[_0xea27('0x18')][_0x4124f8['linkedid']]){if(_0x4124f8[_0xea27('0x57')]==='6'){if(!this[_0xea27('0x18')][_0x4124f8['linkedid']][_0xea27('0x58')]){var _0x2eea0c=moment();this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]]['answered']=!![];this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]][_0xea27('0x59')]=_0x2eea0c[_0xea27('0x45')](_0xea27('0x4f'));if(this[_0xea27('0x18')][_0x4124f8['linkedid']]['starttime']){this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]][_0xea27('0x5a')]=_0x2eea0c[_0xea27('0x5b')](this['channels'][_0x4124f8[_0xea27('0x36')]][_0xea27('0x4c')],_0xea27('0x4e'));}}this[_0xea27('0x18')][_0x4124f8['linkedid']][_0xea27('0x36')]=_0x4124f8[_0xea27('0x37')];if(_0x4124f8['calleridnum']!=='xcally-motion-preview'){this['channels'][_0x4124f8[_0xea27('0x36')]]['connectedlinenum']=_0x4124f8[_0xea27('0x5c')];}this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]]['connectedlinename']=_0x4124f8[_0xea27('0x5d')];this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]][_0xea27('0x5e')]=_0x4124f8['channel'];this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]][_0xea27('0x3e')]=dispositions[_[_0xea27('0x3f')](_0x4124f8['channelstate'])];if(this[_0xea27('0x19')][_0x4124f8[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]){this['channels'][_0x4124f8[_0xea27('0x36')]][_0xea27('0x5f')]=this[_0xea27('0x19')][_0x4124f8['channel'][_0xea27('0x43')]('-')[0x0]]['id'];this[_0xea27('0x18')][_0x4124f8[_0xea27('0x36')]][_0xea27('0x60')]=this[_0xea27('0x19')][_0x4124f8[_0xea27('0x42')]['split']('-')[0x0]]['name'];}}}}else{if(this[_0xea27('0x18')][_0x4124f8[_0xea27('0x37')]]){if(_0x4124f8['channelstate']==='6'){if(this[_0xea27('0x19')][_0x4124f8[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]){this[_0xea27('0x18')][_0x4124f8['uniqueid']][_0xea27('0x5f')]=this['agents'][_0x4124f8[_0xea27('0x42')]['split']('-')[0x0]]['id'];this[_0xea27('0x18')][_0x4124f8[_0xea27('0x37')]][_0xea27('0x60')]=this[_0xea27('0x19')][_0x4124f8[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]['name'];}}}}}}catch(_0x1e7ca4){logger[_0xea27('0x3b')](_0xea27('0x61'),util[_0xea27('0x3d')](_0x1e7ca4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')][_0xea27('0x62')]=function(_0x22f5e8,_0x3911e4){if(this[_0xea27('0x18')][_0x22f5e8]){this['channels'][_0x22f5e8][_0xea27('0x63')]=!![];if(_['endsWith'](_0x3911e4,_0xea27('0x64'))){_0x3911e4=_0x3911e4[_0xea27('0x65')](_0xea27('0x64'),_0xea27('0x66'));}this[_0xea27('0x18')][_0x22f5e8]['monitorFilename']=_0x3911e4;var _0x452e9a=_[_0xea27('0x67')](this[_0xea27('0x18')][_0x22f5e8][_0xea27('0x68')],{'filename':_0x3911e4});if(_[_0xea27('0x69')](_0x452e9a)){this[_0xea27('0x18')][_0x22f5e8]['monitors'][_0xea27('0x6a')]({'filename':_0x3911e4,'createdAt':moment()[_0xea27('0x45')](_0xea27('0x4f')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xea27('0x32')][_0xea27('0x23')]=function(_0x436a9a){try{if(this[_0xea27('0x35')](_0x436a9a)){if(this[_0xea27('0x18')][_0x436a9a[_0xea27('0x37')]]&&_0x436a9a['channel']!='OutgoingSpoolFailed'){if(this[_0xea27('0x35')](_0x436a9a['variable'])){if(this['isNotNull'](_0x436a9a[_0xea27('0x6b')][_0xea27('0x6c')])){this[_0xea27('0x62')](_0x436a9a[_0xea27('0x37')],_0x436a9a[_0xea27('0x6d')]);}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x6e')])){this[_0xea27('0x18')][_0x436a9a['uniqueid']][_0xea27('0x5c')]=_0x436a9a[_0xea27('0x6d')];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')]['xmd-callerid'])){this['channels'][_0x436a9a['uniqueid']][_0xea27('0x6f')]=_0x436a9a['value'];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x70')])){this['channels'][_0x436a9a[_0xea27('0x37')]]['type']=_0x436a9a[_0xea27('0x6d')];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x71')])){this[_0xea27('0x18')][_0x436a9a[_0xea27('0x37')]][_0xea27('0x55')]=_0x436a9a[_0xea27('0x6d')]['split'](',')[0x0];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x72')])){this[_0xea27('0x18')][_0x436a9a['uniqueid']][_0xea27('0x73')]=_0x436a9a[_0xea27('0x6d')];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x74')])){this[_0xea27('0x18')][_0x436a9a[_0xea27('0x37')]]['destination']=_0x436a9a[_0xea27('0x6d')];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')]['xmd-callerid-preview'])){this[_0xea27('0x18')][_0x436a9a[_0xea27('0x37')]]['calleridpreview']=_0x436a9a['value'];}else if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x75')])){this[_0xea27('0x18')][_0x436a9a['uniqueid']][_0xea27('0x55')]=_0x436a9a[_0xea27('0x6d')];}else if(this['isNotNull'](_0x436a9a[_0xea27('0x6b')][_0xea27('0x76')])){this[_0xea27('0x18')][_0x436a9a[_0xea27('0x37')]]['sipcalluniqueid']=_0x436a9a[_0xea27('0x6d')];}}}else if(this['isNotNull'](_0x436a9a[_0xea27('0x6b')]['mixmonitor_filename'])){if(_0x436a9a[_0xea27('0x6d')]){var _0x504b1f=path[_0xea27('0x77')](_0x436a9a[_0xea27('0x6d')])[_0xea27('0x78')];this[_0xea27('0x62')](_0x504b1f,_0x436a9a[_0xea27('0x6d')]);}}else if(this[_0xea27('0x18')][_0x436a9a[_0xea27('0x36')]]){if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')])){if(this[_0xea27('0x35')](_0x436a9a[_0xea27('0x6b')][_0xea27('0x76')])){this[_0xea27('0x18')][_0x436a9a['linkedid']][_0xea27('0x79')]=_0x436a9a[_0xea27('0x6d')];}}}}}catch(_0x219ff9){logger['error'](_0xea27('0x7a'),util['inspect'](_0x219ff9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')]['syncHangup']=function(_0x406209){try{if(this[_0xea27('0x35')](_0x406209)){if(this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]]){var _0x37e456=moment();this['channels'][_0x406209['uniqueid']][_0xea27('0x7b')]=_0x37e456[_0xea27('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xea27('0x18')][_0x406209['uniqueid']][_0xea27('0x4d')]=_0x37e456[_0xea27('0x5b')](this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]][_0xea27('0x4c')],_0xea27('0x4e'));if(this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]]['answered']){this[_0xea27('0x18')][_0x406209['uniqueid']][_0xea27('0x7c')]=_0x37e456[_0xea27('0x5b')](this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]][_0xea27('0x59')],_0xea27('0x4e'));this['channels'][_0x406209[_0xea27('0x37')]][_0xea27('0x5a')]=this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]][_0xea27('0x4d')]-this[_0xea27('0x18')][_0x406209['uniqueid']]['billableseconds'];}if(_0x406209[_0xea27('0x40')]===_0xea27('0x41')){if(this[_0xea27('0x19')][_0x406209[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]){this[_0xea27('0x19')][_0x406209[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]]=_[_0xea27('0x7d')](this[_0xea27('0x19')][_0x406209['channel']['split']('-')[0x0]],[_0xea27('0x7e')]);this[_0xea27('0x34')](util[_0xea27('0x45')]('user:%s',this['agents'][_0x406209[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]][_0xea27('0x78')]),_0xea27('0x7f'),{'destaccountcode':this[_0xea27('0x19')][_0x406209[_0xea27('0x42')][_0xea27('0x43')]('-')[0x0]][_0xea27('0x47')]});}}ami[_0xea27('0x34')]('custom:voiceCallReport',this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]]);delete this[_0xea27('0x18')][_0x406209[_0xea27('0x37')]];}}}catch(_0x11a4ef){logger['error'](_0xea27('0x80'),util[_0xea27('0x3d')](_0x11a4ef,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')]['syncAttendedTransfer']=function(_0x545783){try{if(this['isNotNull'](_0x545783)){if(this['channels'][_0x545783['transfereeuniqueid']]){this[_0xea27('0x18')][_0x545783[_0xea27('0x81')]]['transfercalleridnum']=_0x545783[_0xea27('0x82')];this['channels'][_0x545783[_0xea27('0x81')]][_0xea27('0x83')]=_0x545783[_0xea27('0x84')];if(this[_0xea27('0x18')][_0x545783[_0xea27('0x85')]]){var _0x757423=this[_0xea27('0x18')][_0x545783[_0xea27('0x85')]];this[_0xea27('0x18')][_0x545783['secondtransfereruniqueid']]=this[_0xea27('0x18')][_0x545783['transfereeuniqueid']];this[_0xea27('0x18')][_0x545783[_0xea27('0x81')]]=_0x757423;}}else if(this[_0xea27('0x18')][_0x545783[_0xea27('0x86')]]){this['channels'][_0x545783['transfertargetuniqueid']][_0xea27('0x87')]=_0x545783[_0xea27('0x82')];this['channels'][_0x545783['transfertargetuniqueid']][_0xea27('0x83')]=_0x545783[_0xea27('0x84')];if(this['channels'][_0x545783[_0xea27('0x88')]]){var _0x757423=this[_0xea27('0x18')][_0x545783[_0xea27('0x88')]];this['channels'][_0x545783['origtransfereruniqueid']]=this['channels'][_0x545783['transfertargetuniqueid']];this['channels'][_0x545783[_0xea27('0x86')]]=_0x757423;}}}}catch(_0x192f04){logger[_0xea27('0x3b')](_0xea27('0x89'),util[_0xea27('0x3d')](_0x192f04,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')]['syncBlindTransfer']=function(_0x1f311d){try{if(this[_0xea27('0x35')](_0x1f311d)){if(this[_0xea27('0x18')][_0x1f311d[_0xea27('0x81')]]){this[_0xea27('0x18')][_0x1f311d[_0xea27('0x81')]][_0xea27('0x87')]=_0x1f311d[_0xea27('0x8a')];this[_0xea27('0x18')][_0x1f311d['transfereeuniqueid']][_0xea27('0x83')]=_0x1f311d['extension'];this[_0xea27('0x25')]({'event':_0xea27('0x8b'),'uniqueid':_0x1f311d[_0xea27('0x81')],'context':_0x1f311d[_0xea27('0x40')],'channel':_0x1f311d['transfererchannel']});}}}catch(_0x2fda35){logger[_0xea27('0x3b')]('[syncBlindTransfer][VoiceCallReport]',util[_0xea27('0x3d')](_0x2fda35,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xea27('0x2c')]=function(_0x3c9507){try{if(this[_0xea27('0x35')](_0x3c9507)){if(this['channels'][_0x3c9507[_0xea27('0x37')]]){if(!_['isNil'](this['channels'][_0x3c9507[_0xea27('0x37')]]['answertime'])){this[_0xea27('0x18')][_0x3c9507[_0xea27('0x37')]][_0xea27('0x8c')]=moment()[_0xea27('0x45')](_0xea27('0x4f'));}}}}catch(_0x3c4c57){logger[_0xea27('0x3b')](_0xea27('0x8d'),util[_0xea27('0x3d')](_0x3c4c57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xea27('0x32')][_0xea27('0x2d')]=function(_0x5e4a20){try{if(this[_0xea27('0x35')](_0x5e4a20)){if(this[_0xea27('0x18')][_0x5e4a20['uniqueid']]){if(!_[_0xea27('0x69')](this['channels'][_0x5e4a20[_0xea27('0x37')]]['mohstarttime'])){this['channels'][_0x5e4a20[_0xea27('0x37')]]['mohtime']+=moment()[_0xea27('0x8e')](0x0)[_0xea27('0x5b')](this[_0xea27('0x18')][_0x5e4a20[_0xea27('0x37')]][_0xea27('0x8c')],_0xea27('0x4e'));delete this[_0xea27('0x18')][_0x5e4a20[_0xea27('0x37')]]['mohstarttime'];}}}}catch(_0x5fd4b7){logger[_0xea27('0x3b')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x5fd4b7,{'showHidden':![],'depth':null}));}};module[_0xea27('0x8f')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index ea43367..b5bdfad 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 _0xc896=['ANSWER','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys','variable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','seconds','complete','total','answered','holdtime','sumHoldTime','sumBillable','billableseconds','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc896,0x1c8));var _0x6c89=function(_0x130fff,_0x3bc81a){_0x130fff=_0x130fff-0x0;var _0x1b5241=_0xc896[_0x130fff];return _0x1b5241;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x6c89('0x0'));var Redis=require(_0x6c89('0x1'));var config=require(_0x6c89('0x2'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0x6c89('0x3')]=_[_0x6c89('0x4')](config[_0x6c89('0x3')],{'host':_0x6c89('0x5'),'port':0x18eb});var io=require(_0x6c89('0x6'))(new Redis(config[_0x6c89('0x3')]));function VoiceDialReport(_0x56efe0){this[_0x6c89('0x7')]=_0x56efe0[_0x6c89('0x8')];this[_0x6c89('0x9')]=_0x56efe0[_0x6c89('0x9')];this[_0x6c89('0xa')]={};ami['on'](_0x6c89('0xb'),this['syncDialBegin'][_0x6c89('0xc')](this));ami['on'](_0x6c89('0xd'),this[_0x6c89('0xe')][_0x6c89('0xc')](this));ami['on'](_0x6c89('0xf'),this['syncVarSet'][_0x6c89('0xc')](this));ami['on'](_0x6c89('0x10'),this[_0x6c89('0x11')][_0x6c89('0xc')](this));}VoiceDialReport[_0x6c89('0x12')][_0x6c89('0x13')]=function(_0x397cf1){return _0x397cf1!==null&&!_[_0x6c89('0x14')](_0x397cf1);};VoiceDialReport[_0x6c89('0x12')][_0x6c89('0x15')]=function(_0x6ecb48,_0x588962,_0x4beb07){io['to'](_0x6ecb48)[_0x6c89('0x15')](_0x588962,_0x4beb07);};VoiceDialReport[_0x6c89('0x12')]['syncDialBegin']=function(_0x50ba17){try{if(this[_0x6c89('0x13')](_0x50ba17)){if(this[_0x6c89('0x7')][_0x50ba17[_0x6c89('0x16')]]){_['merge'](this[_0x6c89('0x7')][_0x50ba17['uniqueid']],{'starttime':moment()['format'](_0x6c89('0x17')),'lastevent':'called','interface':_0x50ba17['channel']['substring'](0x0,_0x50ba17[_0x6c89('0x18')][_0x6c89('0x19')]('-')),'membername':_0x50ba17[_0x6c89('0x18')][_0x6c89('0x1a')](_0x50ba17['channel']['lastIndexOf']('/')+0x1,_0x50ba17['channel'][_0x6c89('0x19')]('-'))},_[_0x6c89('0x1b')](_0x50ba17,[_0x6c89('0x1c'),_0x6c89('0x1d')]));this[_0x6c89('0x15')](_0x6c89('0x1e'),_0x6c89('0x1f'),this[_0x6c89('0x7')][_0x50ba17['uniqueid']]);ami['emit'](_0x6c89('0x20'),this[_0x6c89('0x7')][_0x50ba17['uniqueid']]);}}}catch(_0x245914){logger['error'](_0x6c89('0x21'),util[_0x6c89('0x22')](_0x245914,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6c89('0x12')][_0x6c89('0xe')]=function(_0x12600d){try{if(this[_0x6c89('0x13')](_0x12600d)){if(this[_0x6c89('0x7')][_0x12600d[_0x6c89('0x16')]]){this[_0x6c89('0x7')][_0x12600d['uniqueid']][_0x6c89('0x23')]=_0x12600d[_0x6c89('0x23')];if(_0x12600d['dialstatus']===_0x6c89('0x24')){this['channels'][_0x12600d['uniqueid']]['connectedlinenum']=_0x12600d['connectedlinenum'];this[_0x6c89('0x7')][_0x12600d['uniqueid']][_0x6c89('0x25')]=_0x12600d[_0x6c89('0x25')];this[_0x6c89('0x7')][_0x12600d['uniqueid']][_0x6c89('0x26')]=moment()[_0x6c89('0x27')](_0x6c89('0x17'));this['channels'][_0x12600d[_0x6c89('0x16')]][_0x6c89('0x28')]=_0x6c89('0x29');ami[_0x6c89('0x15')](_0x6c89('0x2a'),this[_0x6c89('0x7')][_0x12600d[_0x6c89('0x16')]]);}this[_0x6c89('0x15')]('voice:outbound',_0x6c89('0x1f'),this[_0x6c89('0x7')][_0x12600d[_0x6c89('0x16')]]);}}}catch(_0x4c9c03){logger[_0x6c89('0x2b')](_0x6c89('0x2c'),util['inspect'](_0x4c9c03,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6c89('0x12')][_0x6c89('0x2d')]=function(_0x18dbfe){try{if(this[_0x6c89('0x13')](_0x18dbfe)){this[_0x6c89('0x2e')](_0x18dbfe[_0x6c89('0x16')],_[_0x6c89('0x2f')](_0x18dbfe['variable'])[0x0],_0x18dbfe['value']);if(this[_0x6c89('0x13')](_0x18dbfe[_0x6c89('0x30')])&&this[_0x6c89('0x13')](_0x18dbfe[_0x6c89('0x30')]['outboundrouteid'])){if(_['isUndefined'](this[_0x6c89('0x7')][_0x18dbfe[_0x6c89('0x16')]])){this['channels'][_0x18dbfe[_0x6c89('0x16')]]={'routeId':_0x18dbfe['value'],'variables':this[_0x6c89('0xa')][_0x18dbfe['uniqueid']]};this[_0x6c89('0x15')](_0x6c89('0x1e'),_0x6c89('0x1f'),this['channels'][_0x18dbfe[_0x6c89('0x16')]]);}}}}catch(_0x5ef5f2){logger[_0x6c89('0x2b')]('[syncVarSet][VoiceDialReport]',util[_0x6c89('0x22')](_0x5ef5f2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6c89('0x12')][_0x6c89('0x2e')]=function(_0x3ead86,_0x5b8b57,_0x56bec4){var _0x14b5e7=['rtpaudioqos',_0x6c89('0x31'),_0x6c89('0x32'),_0x6c89('0x33'),_0x6c89('0x34'),'rtpaudioqoslossbridged',_0x6c89('0x35'),_0x6c89('0x36'),_0x6c89('0x37'),_0x6c89('0x38'),_0x6c89('0x39'),_0x6c89('0x3a'),_0x6c89('0x3b'),_0x6c89('0x3c'),'memberinterface','memberlastcall',_0x6c89('0x3d'),_0x6c89('0x3e'),_0x6c89('0x3f')];if(!_[_0x6c89('0x40')](_0x5b8b57)&&!_[_0x6c89('0x41')](_0x14b5e7,_0x5b8b57)){if(_[_0x6c89('0x14')](this[_0x6c89('0xa')][_0x3ead86])){this[_0x6c89('0xa')][_0x3ead86]={};}this[_0x6c89('0xa')][_0x3ead86][_0x5b8b57]=_0x56bec4;}};VoiceDialReport[_0x6c89('0x12')][_0x6c89('0x11')]=function(_0x2217e3){try{if(this[_0x6c89('0x13')](_0x2217e3)){if(this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]]){this['channels'][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x42')]=moment()[_0x6c89('0x27')](_0x6c89('0x17'));this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x43')]=moment(this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x42')])[_0x6c89('0x44')](this[_0x6c89('0x7')][_0x2217e3['uniqueid']][_0x6c89('0x45')],_0x6c89('0x46'));this[_0x6c89('0x7')][_0x2217e3['uniqueid']]['lastevent']=_0x6c89('0x47');this[_0x6c89('0x9')][_0x6c89('0x48')]+=0x1;if(this[_0x6c89('0x7')][_0x2217e3['uniqueid']][_0x6c89('0x26')]){this[_0x6c89('0x9')][_0x6c89('0x49')]+=0x1;this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x4a')]=moment(this[_0x6c89('0x7')][_0x2217e3['uniqueid']][_0x6c89('0x26')])[_0x6c89('0x44')](this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x45')],_0x6c89('0x46'));this[_0x6c89('0x7')][_0x2217e3['uniqueid']]['billableseconds']=moment(this[_0x6c89('0x7')][_0x2217e3['uniqueid']][_0x6c89('0x42')])['diff'](this[_0x6c89('0x7')][_0x2217e3['uniqueid']][_0x6c89('0x26')],'seconds');this[_0x6c89('0x9')][_0x6c89('0x4b')]+=this[_0x6c89('0x7')][_0x2217e3['uniqueid']]['holdtime']||0x0;this[_0x6c89('0x9')][_0x6c89('0x4c')]+=this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]][_0x6c89('0x4d')];}this[_0x6c89('0x9')]['sumDuration']+=this[_0x6c89('0x7')][_0x2217e3['uniqueid']]['duration'];ami[_0x6c89('0x15')]('custom:voiceDialReport',this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]]);ami[_0x6c89('0x15')](_0x6c89('0x4e'),this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]]);this[_0x6c89('0x15')](_0x6c89('0x1e'),_0x6c89('0x4f'),this[_0x6c89('0x9')]);this[_0x6c89('0x15')]('voice:outbound',_0x6c89('0x50'),this['channels'][_0x2217e3[_0x6c89('0x16')]]);delete this[_0x6c89('0x7')][_0x2217e3[_0x6c89('0x16')]];}if(this[_0x6c89('0xa')][_0x2217e3[_0x6c89('0x16')]]){delete this['variables'][_0x2217e3['uniqueid']];}}}catch(_0x5f528b){logger[_0x6c89('0x2b')](_0x6c89('0x51'),util['inspect'](_0x5f528b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x0022=['membername','memberpenalty','memberrealtime','isNil','includes','duration','endtime','diff','starttime','complete','total','holdtime','seconds','billableseconds','sumHoldTime','sumDuration','custom:voiceDialReport','voice_outbound:save','[syncHangup][VoiceDialReport]','exports','lodash','moment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','dialend','bind','syncVarSet','syncHangup','prototype','isUndefined','emit','isNotNull','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','variable','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall'];(function(_0x5c7010,_0xf080fd){var _0x48339a=function(_0x45cf30){while(--_0x45cf30){_0x5c7010['push'](_0x5c7010['shift']());}};_0x48339a(++_0xf080fd);}(_0x0022,0x113));var _0x2002=function(_0x2aa788,_0x498eb8){_0x2aa788=_0x2aa788-0x0;var _0x5be967=_0x0022[_0x2aa788];return _0x5be967;};'use strict';var _=require(_0x2002('0x0'));var moment=require(_0x2002('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x2002('0x2'))('ami');var ami=require(_0x2002('0x3'));config[_0x2002('0x4')]=_[_0x2002('0x5')](config[_0x2002('0x4')],{'host':_0x2002('0x6'),'port':0x18eb});var io=require(_0x2002('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x5f1351){this[_0x2002('0x8')]=_0x5f1351[_0x2002('0x9')];this[_0x2002('0xa')]=_0x5f1351['outbound'];this[_0x2002('0xb')]={};ami['on'](_0x2002('0xc'),this[_0x2002('0xd')]['bind'](this));ami['on'](_0x2002('0xe'),this['syncDialEnd'][_0x2002('0xf')](this));ami['on']('varset',this[_0x2002('0x10')][_0x2002('0xf')](this));ami['on']('hangup',this[_0x2002('0x11')]['bind'](this));}VoiceDialReport[_0x2002('0x12')]['isNotNull']=function(_0xf63c4e){return _0xf63c4e!==null&&!_[_0x2002('0x13')](_0xf63c4e);};VoiceDialReport[_0x2002('0x12')][_0x2002('0x14')]=function(_0x3c09d4,_0xb19281,_0x3e2247){io['to'](_0x3c09d4)[_0x2002('0x14')](_0xb19281,_0x3e2247);};VoiceDialReport[_0x2002('0x12')][_0x2002('0xd')]=function(_0x206d1f){try{if(this[_0x2002('0x15')](_0x206d1f)){if(this[_0x2002('0x8')][_0x206d1f['uniqueid']]){_['merge'](this[_0x2002('0x8')][_0x206d1f[_0x2002('0x16')]],{'starttime':moment()[_0x2002('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x2002('0x18'),'interface':_0x206d1f[_0x2002('0x19')][_0x2002('0x1a')](0x0,_0x206d1f['channel']['lastIndexOf']('-')),'membername':_0x206d1f['channel'][_0x2002('0x1a')](_0x206d1f[_0x2002('0x19')][_0x2002('0x1b')]('/')+0x1,_0x206d1f[_0x2002('0x19')][_0x2002('0x1b')]('-'))},_[_0x2002('0x1c')](_0x206d1f,[_0x2002('0x1d'),_0x2002('0x1e')]));this['emit'](_0x2002('0x1f'),'voice_outbound_channel:save',this[_0x2002('0x8')][_0x206d1f['uniqueid']]);ami[_0x2002('0x14')](_0x2002('0x20'),this[_0x2002('0x8')][_0x206d1f[_0x2002('0x16')]]);}}}catch(_0x418aa3){logger[_0x2002('0x21')](_0x2002('0x22'),util[_0x2002('0x23')](_0x418aa3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2002('0x12')][_0x2002('0x24')]=function(_0x19a2ee){try{if(this[_0x2002('0x15')](_0x19a2ee)){if(this[_0x2002('0x8')][_0x19a2ee[_0x2002('0x16')]]){this[_0x2002('0x8')][_0x19a2ee[_0x2002('0x16')]]['dialstatus']=_0x19a2ee[_0x2002('0x25')];if(_0x19a2ee[_0x2002('0x25')]==='ANSWER'){this[_0x2002('0x8')][_0x19a2ee['uniqueid']][_0x2002('0x26')]=_0x19a2ee[_0x2002('0x26')];this['channels'][_0x19a2ee[_0x2002('0x16')]][_0x2002('0x27')]=_0x19a2ee[_0x2002('0x27')];this[_0x2002('0x8')][_0x19a2ee[_0x2002('0x16')]][_0x2002('0x28')]=moment()[_0x2002('0x17')](_0x2002('0x29'));this['channels'][_0x19a2ee['uniqueid']][_0x2002('0x2a')]=_0x2002('0x2b');ami[_0x2002('0x14')]('custom:dialconnect',this[_0x2002('0x8')][_0x19a2ee[_0x2002('0x16')]]);}this['emit'](_0x2002('0x1f'),'voice_outbound_channel:save',this[_0x2002('0x8')][_0x19a2ee[_0x2002('0x16')]]);}}}catch(_0x39eb61){logger['error'](_0x2002('0x2c'),util[_0x2002('0x23')](_0x39eb61,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x2002('0x10')]=function(_0x3cdc08){try{if(this[_0x2002('0x15')](_0x3cdc08)){this[_0x2002('0x2d')](_0x3cdc08['uniqueid'],_[_0x2002('0x2e')](_0x3cdc08['variable'])[0x0],_0x3cdc08[_0x2002('0x2f')]);if(this[_0x2002('0x15')](_0x3cdc08['variable'])&&this[_0x2002('0x15')](_0x3cdc08[_0x2002('0x30')][_0x2002('0x31')])){if(_[_0x2002('0x13')](this['channels'][_0x3cdc08[_0x2002('0x16')]])){this[_0x2002('0x8')][_0x3cdc08[_0x2002('0x16')]]={'routeId':_0x3cdc08['value'],'variables':this[_0x2002('0xb')][_0x3cdc08['uniqueid']]};this[_0x2002('0x14')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x3cdc08[_0x2002('0x16')]]);}}}}catch(_0x5c46ab){logger[_0x2002('0x21')](_0x2002('0x32'),util[_0x2002('0x23')](_0x5c46ab,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2002('0x12')]['addVariable']=function(_0x4a4497,_0x1f61e7,_0x61cbae){var _0x243c42=[_0x2002('0x33'),_0x2002('0x34'),_0x2002('0x35'),_0x2002('0x36'),_0x2002('0x37'),_0x2002('0x38'),_0x2002('0x39'),_0x2002('0x3a'),'sipcallid',_0x2002('0x3b'),'bridgepeer',_0x2002('0x3c'),_0x2002('0x3d'),_0x2002('0x3e'),_0x2002('0x3f'),_0x2002('0x40'),_0x2002('0x41'),_0x2002('0x42'),_0x2002('0x43')];if(!_[_0x2002('0x44')](_0x1f61e7)&&!_[_0x2002('0x45')](_0x243c42,_0x1f61e7)){if(_[_0x2002('0x13')](this['variables'][_0x4a4497])){this[_0x2002('0xb')][_0x4a4497]={};}this['variables'][_0x4a4497][_0x1f61e7]=_0x61cbae;}};VoiceDialReport['prototype']['syncHangup']=function(_0x3eec8f){try{if(this['isNotNull'](_0x3eec8f)){if(this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]]){this[_0x2002('0x8')][_0x3eec8f['uniqueid']]['endtime']=moment()[_0x2002('0x17')](_0x2002('0x29'));this['channels'][_0x3eec8f['uniqueid']][_0x2002('0x46')]=moment(this[_0x2002('0x8')][_0x3eec8f['uniqueid']][_0x2002('0x47')])[_0x2002('0x48')](this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x49')],'seconds');this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x2a')]=_0x2002('0x4a');this[_0x2002('0xa')][_0x2002('0x4b')]+=0x1;if(this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x28')]){this[_0x2002('0xa')]['answered']+=0x1;this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x4c')]=moment(this['channels'][_0x3eec8f['uniqueid']]['answertime'])[_0x2002('0x48')](this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x49')],_0x2002('0x4d'));this['channels'][_0x3eec8f['uniqueid']][_0x2002('0x4e')]=moment(this[_0x2002('0x8')][_0x3eec8f['uniqueid']][_0x2002('0x47')])[_0x2002('0x48')](this[_0x2002('0x8')][_0x3eec8f['uniqueid']][_0x2002('0x28')],_0x2002('0x4d'));this[_0x2002('0xa')][_0x2002('0x4f')]+=this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]]['holdtime']||0x0;this[_0x2002('0xa')]['sumBillable']+=this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x4e')];}this[_0x2002('0xa')][_0x2002('0x50')]+=this['channels'][_0x3eec8f[_0x2002('0x16')]][_0x2002('0x46')];ami[_0x2002('0x14')](_0x2002('0x51'),this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]]);ami[_0x2002('0x14')]('custom:dialend',this['channels'][_0x3eec8f[_0x2002('0x16')]]);this[_0x2002('0x14')](_0x2002('0x1f'),_0x2002('0x52'),this[_0x2002('0xa')]);this['emit'](_0x2002('0x1f'),'voice_outbound_channel:remove',this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]]);delete this[_0x2002('0x8')][_0x3eec8f[_0x2002('0x16')]];}if(this[_0x2002('0xb')][_0x3eec8f[_0x2002('0x16')]]){delete this['variables'][_0x3eec8f[_0x2002('0x16')]];}}}catch(_0x347cd5){logger[_0x2002('0x21')](_0x2002('0x53'),util[_0x2002('0x23')](_0x347cd5,{'showHidden':![],'depth':null}));}};module[_0x2002('0x54')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 82f359a..3b61520 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 _0xebe5=['Interval','stringify','isNotNull','loopQueueShow','clearZombieChannels','then','[queuesummary]','queue','countBy','callers','waiting','toNumber','available','loggedin','talking','emitVoiceQueueSummary','[syncQueueSummary][VoiceQueueReport]','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','reason','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','queuestatus','value','CONTINUE','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','includes','length','diff','milliseconds','sumBillable','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLIND','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','prototype','enqueue','tail','finally','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','queueStatusComplete','unlockRR','channels','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:remove','type','inbound','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk'];(function(_0x44d1d1,_0x53d20b){var _0x2c9241=function(_0x1508db){while(--_0x1508db){_0x44d1d1['push'](_0x44d1d1['shift']());}};_0x2c9241(++_0x53d20b);}(_0xebe5,0x1e5));var _0x5ebe=function(_0x1b9cb3,_0x41cf0b){_0x1b9cb3=_0x1b9cb3-0x0;var _0x3b22d9=_0xebe5[_0x1b9cb3];return _0x3b22d9;};'use strict';var _=require(_0x5ebe('0x0'));var moment=require(_0x5ebe('0x1'));var BPromise=require(_0x5ebe('0x2'));var util=require(_0x5ebe('0x3'));var md5=require(_0x5ebe('0x4'));var Redis=require('ioredis');var config=require(_0x5ebe('0x5'));var logger=require('../../../config/logger')(_0x5ebe('0x6'));var ami=require(_0x5ebe('0x7'));var QueueReport=require(_0x5ebe('0x8'));config[_0x5ebe('0x9')]=_[_0x5ebe('0xa')](config['redis'],{'host':_0x5ebe('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5ebe('0x9')]));var Sequence=function(){};Sequence[_0x5ebe('0xc')][_0x5ebe('0xd')]=function(_0xf5d965){this[_0x5ebe('0xe')]=this[_0x5ebe('0xe')]?this['tail'][_0x5ebe('0xf')](_0xf5d965):_0xf5d965();};function VoiceQueueReport(_0x3a7934){this['sequence']=new Sequence();this['queueReports']={};this[_0x5ebe('0x10')]=_0x3a7934[_0x5ebe('0x10')];this['channels']=_0x3a7934[_0x5ebe('0x11')];this[_0x5ebe('0x12')]=_0x3a7934[_0x5ebe('0x12')];this[_0x5ebe('0x13')]=!![];this[_0x5ebe('0x14')]=_0x3a7934['campaigns'];this[_0x5ebe('0x15')]={};ami['on'](_0x5ebe('0x16'),this[_0x5ebe('0x17')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x19'),this[_0x5ebe('0x1a')]['bind'](this));ami['on'](_0x5ebe('0x1b'),this[_0x5ebe('0x1c')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x1d'),this[_0x5ebe('0x1e')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x1f'),this[_0x5ebe('0x20')][_0x5ebe('0x18')](this));ami['on']('agentcomplete',this[_0x5ebe('0x21')][_0x5ebe('0x18')](this));ami['on']('agentconnect',this[_0x5ebe('0x22')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x23'),this[_0x5ebe('0x24')]['bind'](this));ami['on'](_0x5ebe('0x25'),this[_0x5ebe('0x26')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x27'),this[_0x5ebe('0x28')][_0x5ebe('0x18')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x5ebe('0x29'),this['syncMusicOnHoldStop'][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x2a'),this[_0x5ebe('0x2b')][_0x5ebe('0x18')](this));ami['on'](_0x5ebe('0x2c'),this[_0x5ebe('0x2d')]['bind'](this));this[_0x5ebe('0x2e')]();this['loopQueueShow']();}function isNotNull(_0x476b5b){return _0x476b5b!==null&&!_[_0x5ebe('0x2f')](_0x476b5b);}function clearChannels(_0x3f00fc){if(!_[_0x5ebe('0x30')](_0x3f00fc)){for(var _0x1c2c76 in _0x3f00fc){if(_0x3f00fc[_0x5ebe('0x31')](_0x1c2c76)){delete _0x3f00fc[_0x1c2c76];}}}}function clearCampaigns(_0x41b88e){if(!_[_0x5ebe('0x30')](_0x41b88e)){for(var _0xd309a5 in _0x41b88e){if(_0x41b88e['hasOwnProperty'](_0xd309a5)){_0x41b88e[_0xd309a5][_0x5ebe('0x32')]=0x0;}}}}function clearVoiceQueues(_0x2811d2){if(!_[_0x5ebe('0x30')](_0x2811d2)){for(var _0x3999e8 in _0x2811d2){if(_0x2811d2[_0x5ebe('0x31')](_0x3999e8)){_0x2811d2[_0x3999e8]['originated']=0x0;_0x2811d2[_0x3999e8]['talking']=0x0;_0x2811d2[_0x3999e8]['pTalking']=0x0;_0x2811d2[_0x3999e8]['waiting']=0x0;_0x2811d2[_0x3999e8][_0x5ebe('0x33')]=!![];}}}}function clearAgentBooked(_0xaf729d){if(!_[_0x5ebe('0x30')](_0xaf729d)){for(var _0x8f51 in _0xaf729d){if(_0xaf729d['hasOwnProperty'](_0x8f51)){_0xaf729d[_0x8f51][_0x5ebe('0x34')]=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0xb75229=this;for(var _0x1160bc in this[_0x5ebe('0x35')]){if(this[_0x5ebe('0x35')][_0x5ebe('0x31')](_0x1160bc)&&!this['channels'][_0x1160bc]['switch']){this[_0x5ebe('0x36')]['enqueue'](function(){if(!_[_0x5ebe('0x37')](_0xb75229[_0x5ebe('0x35')][_0x1160bc])){return ami[_0x5ebe('0x38')]({'action':_0x5ebe('0x39'),'channel':_0xb75229[_0x5ebe('0x35')][_0x1160bc][_0x5ebe('0x3a')]})[_0x5ebe('0x3b')](function(_0x3a5544){if(_0x3a5544['message']===_0x5ebe('0x3c')){setTimeout(function(){if(_0xb75229[_0x5ebe('0x35')][_0x1160bc]){delete _0xb75229['channels'][_0x1160bc];logger[_0x5ebe('0x3d')](_0x5ebe('0x3e'),_0x1160bc);}if(_0xb75229[_0x5ebe('0x3f')][_0x1160bc]){delete _0xb75229[_0x5ebe('0x3f')][_0x1160bc];logger[_0x5ebe('0x3d')](_0x5ebe('0x40'),_0x1160bc);}if(_0xb75229[_0x5ebe('0x15')][_0x1160bc]){delete _0xb75229[_0x5ebe('0x15')][_0x1160bc];logger[_0x5ebe('0x3d')](_0x5ebe('0x41'),_0x1160bc);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x5ebe('0x28')]=function(){logger['error'](_0x5ebe('0x42'));clearChannels(this[_0x5ebe('0x35')]);this[_0x5ebe('0x43')](this[_0x5ebe('0x3f')]);clearAgentBooked(this[_0x5ebe('0x10')]);clearVoiceQueues(this[_0x5ebe('0x12')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x43')]=function(_0x31fc32){var _0x1a97e1=this;if(!_[_0x5ebe('0x30')](_0x31fc32)){for(var _0x43f8b8 in _0x31fc32){if(_0x31fc32[_0x5ebe('0x31')](_0x43f8b8)){_0x1a97e1[_0x5ebe('0x44')](_0x31fc32[_0x43f8b8]);delete _0x31fc32[_0x43f8b8];}}}};function loggerCatch(_0x4ec06a){return function(_0x6e0e6c){logger[_0x5ebe('0x3d')](_0x4ec06a,util[_0x5ebe('0x45')](_0x6e0e6c,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x46')]=function(_0xf428e1,_0x59885f,_0x1bfb7e){io['to'](_0xf428e1)[_0x5ebe('0x46')](_0x59885f,_0x1bfb7e);};VoiceQueueReport['prototype'][_0x5ebe('0x47')]=function(_0x2abc1b){this[_0x5ebe('0x46')](util[_0x5ebe('0x48')](_0x5ebe('0x49'),_0x2abc1b[_0x5ebe('0x4a')]),'voice_queue_channel:save',_0x2abc1b);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x1c548f){this[_0x5ebe('0x46')](util[_0x5ebe('0x48')](_0x5ebe('0x49'),_0x1c548f[_0x5ebe('0x4a')]),_0x5ebe('0x4b'),_0x1c548f);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x5829a1){if(_0x5829a1[_0x5ebe('0x4c')]===_0x5ebe('0x4d')){var _0x47d925={'id':_0x5829a1['id'],'name':_0x5829a1['name'],'strategy':_0x5829a1[_0x5ebe('0x4e')],'answered':_0x5829a1[_0x5ebe('0x4f')],'available':_0x5829a1['available'],'loggedIn':_0x5829a1[_0x5ebe('0x50')],'pTalking':_0x5829a1[_0x5ebe('0x51')],'sumBillable':_0x5829a1['sumBillable'],'sumDuration':_0x5829a1[_0x5ebe('0x52')],'sumHoldTime':_0x5829a1[_0x5ebe('0x53')]||0x0,'talking':_0x5829a1['talking'],'total':_0x5829a1[_0x5ebe('0x54')],'type':_0x5829a1[_0x5ebe('0x4c')],'unmanaged':_0x5829a1[_0x5ebe('0x55')],'abandoned':_0x5829a1[_0x5ebe('0x56')],'waiting':_0x5829a1['waiting']};if(_0x5829a1['Trunk']){_0x47d925[_0x5ebe('0x57')]={'id':_0x5829a1[_0x5ebe('0x57')]['id'],'name':_0x5829a1[_0x5ebe('0x57')][_0x5ebe('0x4a')],'active':_0x5829a1[_0x5ebe('0x57')]['active'],'callerid':_0x5829a1[_0x5ebe('0x57')]['callerid']};}if(_0x5829a1[_0x5ebe('0x58')]){_0x47d925[_0x5ebe('0x58')]={'id':_0x5829a1[_0x5ebe('0x58')]['id'],'name':_0x5829a1[_0x5ebe('0x58')][_0x5ebe('0x4a')]};}var _0xc7e6c1=md5(JSON[_0x5ebe('0x59')](_0x47d925));if(_0x5829a1['md5']!==_0xc7e6c1){_0x5829a1['md5']=_0xc7e6c1;this[_0x5ebe('0x46')](util['format'](_0x5ebe('0x49'),_0x47d925[_0x5ebe('0x4a')]),'voice_queue:save',_0x47d925);}}};VoiceQueueReport['prototype'][_0x5ebe('0x5a')]=function(_0x3fd396){return _0x3fd396!==null&&!_[_0x5ebe('0x2f')](_0x3fd396);};VoiceQueueReport['prototype'][_0x5ebe('0x5b')]=function(){var _0x15fe04=this;setInterval(function(){_0x15fe04[_0x5ebe('0x5c')]();ami[_0x5ebe('0x38')]({'action':'queues'})[_0x5ebe('0x3b')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x2e')]=function(){var _0x1ca331=this;setInterval(function(){if(_0x1ca331[_0x5ebe('0x13')]){return ami[_0x5ebe('0x38')]({'action':'queuesummary'})[_0x5ebe('0x5d')](function(_0x278c74){_0x1ca331[_0x5ebe('0x13')]=![];})[_0x5ebe('0x3b')](loggerCatch(_0x5ebe('0x5e')));}},0x3e8);};VoiceQueueReport['prototype'][_0x5ebe('0x17')]=function(_0x30c890){try{if(this[_0x5ebe('0x5a')](_0x30c890)&&this[_0x5ebe('0x5a')](_0x30c890[_0x5ebe('0x5f')])){if(this[_0x5ebe('0x12')][_0x30c890[_0x5ebe('0x5f')]]){var _0xb87e9a=_[_0x5ebe('0x60')](this['channels'],_0x5ebe('0x5f'))[_0x30c890['queue']]||0x0;var _0x5f5ad1=_0xb87e9a-_0x30c890[_0x5ebe('0x61')];if(this['voiceQueues'][_0x30c890[_0x5ebe('0x5f')]][_0x5ebe('0x62')]!==_[_0x5ebe('0x63')](_0x30c890[_0x5ebe('0x61')])||this['voiceQueues'][_0x30c890[_0x5ebe('0x5f')]][_0x5ebe('0x50')]!==_[_0x5ebe('0x63')](_0x30c890['loggedin'])||this['voiceQueues'][_0x30c890['queue']][_0x5ebe('0x64')]!==_[_0x5ebe('0x63')](_0x30c890[_0x5ebe('0x64')])||this[_0x5ebe('0x12')][_0x30c890[_0x5ebe('0x5f')]]['talking']!==_0x5f5ad1){this[_0x5ebe('0x12')][_0x30c890[_0x5ebe('0x5f')]]['waiting']=_[_0x5ebe('0x63')](_0x30c890['callers']);this['voiceQueues'][_0x30c890[_0x5ebe('0x5f')]][_0x5ebe('0x50')]=_['toNumber'](_0x30c890[_0x5ebe('0x65')]);this['voiceQueues'][_0x30c890[_0x5ebe('0x5f')]][_0x5ebe('0x64')]=_[_0x5ebe('0x63')](_0x30c890[_0x5ebe('0x64')]);this[_0x5ebe('0x12')][_0x30c890['queue']][_0x5ebe('0x66')]=_0x5f5ad1>0x0?_0x5f5ad1:0x0;this[_0x5ebe('0x12')][_0x30c890['queue']][_0x5ebe('0x66')]=this[_0x5ebe('0x12')][_0x30c890['queue']][_0x5ebe('0x66')]>_[_0x5ebe('0x63')](_0x30c890['loggedin'])?_[_0x5ebe('0x63')](_0x30c890[_0x5ebe('0x65')]):this[_0x5ebe('0x12')][_0x30c890['queue']][_0x5ebe('0x66')];this[_0x5ebe('0x67')](this['voiceQueues'][_0x30c890[_0x5ebe('0x5f')]]);}ami[_0x5ebe('0x46')]('custom:queuesummary',this[_0x5ebe('0x12')][_0x30c890[_0x5ebe('0x5f')]]);}}}catch(_0x3ce9aa){logger['error'](_0x5ebe('0x68'),util['inspect'](_0x3ce9aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5ebe('0x1a')]=function(_0x4258b2){this[_0x5ebe('0x13')]=!![];};VoiceQueueReport[_0x5ebe('0xc')]['syncNewExten']=function(_0x17c2a6){};VoiceQueueReport['prototype'][_0x5ebe('0x1c')]=function(_0x29344a){try{if(this[_0x5ebe('0x5a')](_0x29344a)){if(_[_0x5ebe('0x2f')](this['queueReports'][_0x29344a['uniqueid']])){this[_0x5ebe('0x3f')][_0x29344a[_0x5ebe('0x69')]]=[];this[_0x5ebe('0x35')][_0x29344a[_0x5ebe('0x69')]]={};}var _0x487993=new QueueReport();_0x487993[_0x5ebe('0x4a')]=_0x29344a[_0x5ebe('0x5f')];_0x487993[_0x5ebe('0x4c')]=this['voiceQueues'][_0x487993[_0x5ebe('0x4a')]]&&this[_0x5ebe('0x12')][_0x487993[_0x5ebe('0x4a')]]['type']?this['voiceQueues'][_0x487993[_0x5ebe('0x4a')]][_0x5ebe('0x4c')]||'inbound':_0x5ebe('0x4d');_0x487993[_0x5ebe('0x5f')]=_0x29344a[_0x5ebe('0x5f')];_0x487993['queuecallerjoinAt']=moment()['format'](_0x5ebe('0x6a'));_0x487993[_0x5ebe('0x6b')]=_0x29344a[_0x5ebe('0x6b')];_0x487993[_0x5ebe('0x6c')]=_0x29344a[_0x5ebe('0x6c')];_['merge'](_0x487993,_[_0x5ebe('0x6d')](_0x29344a,_['keys'](_0x487993)));this[_0x5ebe('0x3f')][_0x29344a[_0x5ebe('0x69')]][_0x5ebe('0x6e')](_0x487993);this[_0x5ebe('0x35')][_0x29344a['uniqueid']]=_0x487993;this[_0x5ebe('0x47')](_0x487993);}}catch(_0x4c1652){logger[_0x5ebe('0x3d')]('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x4c1652,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ebe('0xc')]['syncQueueCallerAbandon']=function(_0x3f812b){try{if(this[_0x5ebe('0x5a')](_0x3f812b)){if(this['queueReports'][_0x3f812b[_0x5ebe('0x69')]]){var _0x3d1a9a=_[_0x5ebe('0x6f')](this[_0x5ebe('0x3f')][_0x3f812b[_0x5ebe('0x69')]]);_0x3d1a9a[_0x5ebe('0x70')]=![];_0x3d1a9a[_0x5ebe('0x71')]=null;_0x3d1a9a[_0x5ebe('0x72')]=_0x3f812b[_0x5ebe('0x72')];_0x3d1a9a[_0x5ebe('0x73')]=_0x3f812b[_0x5ebe('0x73')];_0x3d1a9a[_0x5ebe('0x1d')]=!![];_0x3d1a9a[_0x5ebe('0x74')]=moment()[_0x5ebe('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d1a9a[_0x5ebe('0x75')]='ABANDONED';_0x3d1a9a[_0x5ebe('0x76')]=null;this[_0x5ebe('0x35')][_0x3f812b[_0x5ebe('0x69')]]=_0x3d1a9a;this['emitVoiceQueueChannelRemove'](_0x3d1a9a);}}}catch(_0x6ecca7){logger[_0x5ebe('0x3d')](_0x5ebe('0x77'),util[_0x5ebe('0x45')](_0x6ecca7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x20')]=function(_0x36d03c){try{if(this[_0x5ebe('0x5a')](_0x36d03c)){if(this[_0x5ebe('0x3f')][_0x36d03c[_0x5ebe('0x69')]]){var _0x56d77d=_[_0x5ebe('0x6f')](this[_0x5ebe('0x3f')][_0x36d03c[_0x5ebe('0x69')]]);_0x56d77d[_0x5ebe('0x78')]=moment()['format'](_0x5ebe('0x6a'));_0x56d77d[_0x5ebe('0x79')]=_0x36d03c[_0x5ebe('0x79')];_0x56d77d['connectedlinename']=_0x36d03c['connectedlinename'];this[_0x5ebe('0x35')][_0x36d03c['uniqueid']]=_0x56d77d;this[_0x5ebe('0x47')](_0x56d77d);}}}catch(_0x22ab12){logger[_0x5ebe('0x3d')](_0x5ebe('0x7a'),util[_0x5ebe('0x45')](_0x22ab12,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x22')]=function(_0x201717){try{if(this[_0x5ebe('0x5a')](_0x201717)){if(this['queueReports'][_0x201717[_0x5ebe('0x69')]]){var _0x3f2169=_[_0x5ebe('0x6f')](this['queueReports'][_0x201717['uniqueid']]);_0x3f2169['queuecallercomplete']=!![];_0x3f2169[_0x5ebe('0x75')]=_0x5ebe('0x7b');}}}catch(_0x414f59){logger[_0x5ebe('0x3d')](_0x5ebe('0x7c'),util[_0x5ebe('0x45')](_0x414f59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x21')]=function(_0x12ba6c){try{if(this[_0x5ebe('0x5a')](_0x12ba6c)){if(this['queueReports'][_0x12ba6c[_0x5ebe('0x69')]]){var _0x1d003b=_['last'](this[_0x5ebe('0x3f')][_0x12ba6c[_0x5ebe('0x69')]]);_0x1d003b['queuecallerabandon']=![];_0x1d003b[_0x5ebe('0x74')]=null;_0x1d003b[_0x5ebe('0x7d')]=!![];_0x1d003b[_0x5ebe('0x76')]=_0x12ba6c['membername'];_0x1d003b[_0x5ebe('0x72')]=_0x12ba6c['holdtime'];_0x1d003b[_0x5ebe('0x70')]=!![];_0x1d003b[_0x5ebe('0x7e')]=![];_0x1d003b[_0x5ebe('0x7f')]=null;if(!_0x1d003b['transfer']){if(_0x12ba6c['reason']==_0x5ebe('0x80')){_0x1d003b[_0x5ebe('0x75')]=_0x5ebe('0x81');}else{if(_[_0x5ebe('0x82')](_0x12ba6c[_0x5ebe('0x3a')][_0x5ebe('0x83')](),'local/')){if(this['queueReports'][_0x12ba6c[_0x5ebe('0x84')]]){var _0x528ecc=_[_0x5ebe('0x6f')](this[_0x5ebe('0x3f')][_0x12ba6c[_0x5ebe('0x84')]]);_0x528ecc['queuecallercomplete']=![];_0x528ecc[_0x5ebe('0x7e')]=!![];_0x528ecc[_0x5ebe('0x7f')]=moment(_0x1d003b[_0x5ebe('0x85')])[_0x5ebe('0x86')](_0x12ba6c[_0x5ebe('0x72')],_0x5ebe('0x87'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x528ecc[_0x5ebe('0x75')]=_0x5ebe('0x88');_0x528ecc[_0x5ebe('0x80')]=!![];_0x528ecc[_0x5ebe('0x89')]=_0x5ebe('0x8a');_0x528ecc[_0x5ebe('0x8b')]=_0x12ba6c['destexten'];_0x528ecc['transferuniqueid']=_0x12ba6c[_0x5ebe('0x69')];var _0x568d0d=this['queueReports'][_0x12ba6c[_0x5ebe('0x84')]];this[_0x5ebe('0x3f')][_0x12ba6c[_0x5ebe('0x84')]]=this['queueReports'][_0x12ba6c[_0x5ebe('0x69')]];this[_0x5ebe('0x3f')][_0x12ba6c[_0x5ebe('0x69')]]=_0x568d0d;}}else{_0x1d003b[_0x5ebe('0x75')]='COMPLETEDBY'+_0x12ba6c[_0x5ebe('0x8c')]['toUpperCase']();}}}this[_0x5ebe('0x35')][_0x12ba6c[_0x5ebe('0x69')]]=_0x1d003b;this[_0x5ebe('0x44')](_0x1d003b);}}}catch(_0x5172a2){logger['error'](_0x5ebe('0x8d'),util[_0x5ebe('0x45')](_0x5172a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x4709b8){try{if(this[_0x5ebe('0x5a')](_0x4709b8)){this[_0x5ebe('0x8e')](_0x4709b8[_0x5ebe('0x69')],_['keys'](_0x4709b8['variable'])[0x0],_0x4709b8['value']);if(this[_0x5ebe('0x3f')][_0x4709b8[_0x5ebe('0x69')]]){var _0x41f723=_[_0x5ebe('0x6f')](this[_0x5ebe('0x3f')][_0x4709b8[_0x5ebe('0x69')]]);if(_0x41f723){if(this[_0x5ebe('0x5a')](_0x4709b8[_0x5ebe('0x8f')])&&this['isNotNull'](_0x4709b8[_0x5ebe('0x8f')][_0x5ebe('0x90')])){switch(_0x4709b8[_0x5ebe('0x91')]){case _0x5ebe('0x92'):_0x41f723[_0x5ebe('0x7e')]=![];_0x41f723[_0x5ebe('0x7f')]=null;break;default:_0x41f723['queuecallerexit']=!![];_0x41f723[_0x5ebe('0x7f')]=moment()['format'](_0x5ebe('0x6a'));_0x41f723['queuecallerleaveAt']=moment()[_0x5ebe('0x48')](_0x5ebe('0x6a'));}_0x41f723['queuecallerabandon']=![];_0x41f723[_0x5ebe('0x74')]=null;_0x41f723[_0x5ebe('0x75')]=_0x4709b8['value'];this['channels'][_0x4709b8['uniqueid']]=_0x41f723;this[_0x5ebe('0x44')](_0x41f723);}else if(this['isNotNull'](_0x4709b8[_0x5ebe('0x8f')])&&this[_0x5ebe('0x5a')](_0x4709b8[_0x5ebe('0x8f')]['queueposition'])){if(!_0x41f723['queuecallerabandon']){_0x41f723[_0x5ebe('0x7e')]=!![];_0x41f723[_0x5ebe('0x7f')]=moment()[_0x5ebe('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x41f723[_0x5ebe('0x75')]=_0x5ebe('0x93');_0x41f723[_0x5ebe('0x78')]=moment()[_0x5ebe('0x48')](_0x5ebe('0x6a'));this['channels'][_0x4709b8[_0x5ebe('0x69')]]=_0x41f723;}}_0x41f723[_0x5ebe('0x15')]=this[_0x5ebe('0x15')][_0x4709b8[_0x5ebe('0x69')]];}}}}catch(_0x5bd5c1){logger['error'](_0x5ebe('0x94'),util[_0x5ebe('0x45')](_0x5bd5c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x8e')]=function(_0x1cab67,_0xf1c9ee,_0x19248e){var _0x1e657f=['rtpaudioqos',_0x5ebe('0x95'),'rtpaudioqosjitter',_0x5ebe('0x96'),_0x5ebe('0x97'),'rtpaudioqoslossbridged',_0x5ebe('0x98'),'rtpaudioqosrttbridged',_0x5ebe('0x99'),_0x5ebe('0x9a'),_0x5ebe('0x9b'),'bridgepvtcallid',_0x5ebe('0x9c'),_0x5ebe('0x9d'),'memberinterface',_0x5ebe('0x9e'),_0x5ebe('0x9f'),_0x5ebe('0xa0'),'memberrealtime'];if(!_[_0x5ebe('0x37')](_0xf1c9ee)&&!_[_0x5ebe('0xa1')](_0x1e657f,_0xf1c9ee)){if(_['isUndefined'](this[_0x5ebe('0x15')][_0x1cab67])){this['variables'][_0x1cab67]={};}this[_0x5ebe('0x15')][_0x1cab67][_0xf1c9ee]=_0x19248e;}};VoiceQueueReport[_0x5ebe('0xc')][_0x5ebe('0x26')]=function(_0x2f8f7b){try{if(this['isNotNull'](_0x2f8f7b)){if(this[_0x5ebe('0x3f')][_0x2f8f7b[_0x5ebe('0x69')]]){for(var _0x325076=0x0,_0x19acce={};_0x3250760x0?_0x417a32:0x0;this['voiceQueues'][_0x2ae208[_0x1a39('0x5d')]][_0x1a39('0x62')]=this[_0x1a39('0x10')][_0x2ae208['queue']][_0x1a39('0x62')]>_[_0x1a39('0x60')](_0x2ae208['loggedin'])?_[_0x1a39('0x60')](_0x2ae208[_0x1a39('0x61')]):this[_0x1a39('0x10')][_0x2ae208['queue']]['talking'];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x2ae208[_0x1a39('0x5d')]]);}ami[_0x1a39('0x3f')](_0x1a39('0x63'),this['voiceQueues'][_0x2ae208['queue']]);}}}catch(_0x57b8e4){logger['error'](_0x1a39('0x64'),util[_0x1a39('0x3e')](_0x57b8e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1a39('0x17')]=function(_0x1fb2d7){this[_0x1a39('0x11')]=!![];};VoiceQueueReport[_0x1a39('0x2f')]['syncNewExten']=function(_0x5af81b){};VoiceQueueReport[_0x1a39('0x2f')]['syncQueueCallerJoin']=function(_0x2bb539){try{if(this[_0x1a39('0x56')](_0x2bb539)){if(_[_0x1a39('0x57')](this['queueReports'][_0x2bb539[_0x1a39('0x65')]])){this[_0x1a39('0xd')][_0x2bb539[_0x1a39('0x65')]]=[];this['channels'][_0x2bb539['uniqueid']]={};}var _0x47ec78=new QueueReport();_0x47ec78[_0x1a39('0x43')]=_0x2bb539[_0x1a39('0x5d')];_0x47ec78[_0x1a39('0x45')]=this[_0x1a39('0x10')][_0x47ec78[_0x1a39('0x43')]]&&this[_0x1a39('0x10')][_0x47ec78[_0x1a39('0x43')]][_0x1a39('0x45')]?this['voiceQueues'][_0x47ec78[_0x1a39('0x43')]][_0x1a39('0x45')]||_0x1a39('0x46'):'inbound';_0x47ec78[_0x1a39('0x5d')]=_0x2bb539['queue'];_0x47ec78['queuecallerjoinAt']=moment()[_0x1a39('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x47ec78[_0x1a39('0x66')]=_0x2bb539['position'];_0x47ec78[_0x1a39('0x67')]=_0x2bb539[_0x1a39('0x67')];_[_0x1a39('0x68')](_0x47ec78,_[_0x1a39('0x69')](_0x2bb539,_[_0x1a39('0x6a')](_0x47ec78)));this[_0x1a39('0xd')][_0x2bb539[_0x1a39('0x65')]][_0x1a39('0x6b')](_0x47ec78);this[_0x1a39('0x31')][_0x2bb539[_0x1a39('0x65')]]=_0x47ec78;this['emitVoiceQueueChannelSave'](_0x47ec78);}}catch(_0x1b3981){logger[_0x1a39('0x38')](_0x1a39('0x6c'),util['inspect'](_0x1b3981,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x3d6fc8){try{if(this[_0x1a39('0x56')](_0x3d6fc8)){if(this[_0x1a39('0xd')][_0x3d6fc8[_0x1a39('0x65')]]){var _0x3ec187=_[_0x1a39('0x6d')](this[_0x1a39('0xd')][_0x3d6fc8['uniqueid']]);_0x3ec187['queuecallercomplete']=![];_0x3ec187[_0x1a39('0x6e')]=null;_0x3ec187[_0x1a39('0x6f')]=_0x3d6fc8[_0x1a39('0x6f')];_0x3ec187[_0x1a39('0x70')]=_0x3d6fc8[_0x1a39('0x70')];_0x3ec187[_0x1a39('0x1a')]=!![];_0x3ec187[_0x1a39('0x71')]=moment()[_0x1a39('0x41')](_0x1a39('0x72'));_0x3ec187[_0x1a39('0x73')]=_0x1a39('0x74');_0x3ec187[_0x1a39('0x75')]=null;this[_0x1a39('0x31')][_0x3d6fc8[_0x1a39('0x65')]]=_0x3ec187;this[_0x1a39('0x3d')](_0x3ec187);}}}catch(_0x1d55bb){logger[_0x1a39('0x38')](_0x1a39('0x76'),util[_0x1a39('0x3e')](_0x1d55bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1a39('0x2f')][_0x1a39('0x77')]=function(_0x5d420a){try{if(this['isNotNull'](_0x5d420a)){if(this['queueReports'][_0x5d420a['uniqueid']]){var _0x43ebe9=_[_0x1a39('0x6d')](this['queueReports'][_0x5d420a[_0x1a39('0x65')]]);_0x43ebe9[_0x1a39('0x78')]=moment()[_0x1a39('0x41')](_0x1a39('0x72'));_0x43ebe9[_0x1a39('0x79')]=_0x5d420a[_0x1a39('0x79')];_0x43ebe9[_0x1a39('0x7a')]=_0x5d420a[_0x1a39('0x7a')];this['channels'][_0x5d420a[_0x1a39('0x65')]]=_0x43ebe9;this['emitVoiceQueueChannelSave'](_0x43ebe9);}}}catch(_0x2cd3cc){logger[_0x1a39('0x38')](_0x1a39('0x7b'),util[_0x1a39('0x3e')](_0x2cd3cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1a39('0x2f')][_0x1a39('0x7c')]=function(_0x4d6bde){try{if(this[_0x1a39('0x56')](_0x4d6bde)){if(this[_0x1a39('0xd')][_0x4d6bde[_0x1a39('0x65')]]){var _0x38f994=_['last'](this[_0x1a39('0xd')][_0x4d6bde[_0x1a39('0x65')]]);_0x38f994[_0x1a39('0x7d')]=!![];_0x38f994[_0x1a39('0x73')]=_0x1a39('0x7e');}}}catch(_0x24d395){logger['error'](_0x1a39('0x7f'),util['inspect'](_0x24d395,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1a39('0x2f')][_0x1a39('0x1d')]=function(_0x570745){try{if(this[_0x1a39('0x56')](_0x570745)){if(this[_0x1a39('0xd')][_0x570745[_0x1a39('0x65')]]){var _0x1c72ef=_[_0x1a39('0x6d')](this['queueReports'][_0x570745[_0x1a39('0x65')]]);_0x1c72ef[_0x1a39('0x1a')]=![];_0x1c72ef[_0x1a39('0x71')]=null;_0x1c72ef['assigned']=!![];_0x1c72ef['lastAssignedTo']=_0x570745[_0x1a39('0x80')];_0x1c72ef['holdtime']=_0x570745['holdtime'];_0x1c72ef[_0x1a39('0x7d')]=!![];_0x1c72ef[_0x1a39('0x81')]=![];_0x1c72ef['queuecallerexitAt']=null;if(!_0x1c72ef['transfer']){if(_0x570745[_0x1a39('0x82')]==_0x1a39('0x83')){_0x1c72ef['queuecallerexitreason']=_0x1a39('0x84');}else{if(_[_0x1a39('0x85')](_0x570745['channel'][_0x1a39('0x86')](),_0x1a39('0x87'))){if(this['queueReports'][_0x570745['linkedid']]){var _0x53f275=_[_0x1a39('0x6d')](this[_0x1a39('0xd')][_0x570745[_0x1a39('0x88')]]);_0x53f275[_0x1a39('0x7d')]=![];_0x53f275['queuecallerexit']=!![];_0x53f275[_0x1a39('0x89')]=moment(_0x1c72ef[_0x1a39('0x8a')])[_0x1a39('0x8b')](_0x570745['holdtime'],_0x1a39('0x8c'))[_0x1a39('0x41')](_0x1a39('0x72'));_0x53f275['queuecallerexitreason']=_0x1a39('0x8d');_0x53f275['transfer']=!![];_0x53f275[_0x1a39('0x8e')]=_0x1a39('0x8f');_0x53f275[_0x1a39('0x90')]=_0x570745['destexten'];_0x53f275['transferuniqueid']=_0x570745[_0x1a39('0x65')];var _0x4e007e=this[_0x1a39('0xd')][_0x570745['linkedid']];this['queueReports'][_0x570745[_0x1a39('0x88')]]=this[_0x1a39('0xd')][_0x570745[_0x1a39('0x65')]];this['queueReports'][_0x570745[_0x1a39('0x65')]]=_0x4e007e;}}else{_0x1c72ef['queuecallerexitreason']='COMPLETEDBY'+_0x570745[_0x1a39('0x82')]['toUpperCase']();}}}this[_0x1a39('0x31')][_0x570745[_0x1a39('0x65')]]=_0x1c72ef;this['emitVoiceQueueChannelRemove'](_0x1c72ef);}}}catch(_0x454b28){logger[_0x1a39('0x38')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x454b28,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1a39('0x20')]=function(_0x466ae5){try{if(this[_0x1a39('0x56')](_0x466ae5)){this[_0x1a39('0x91')](_0x466ae5[_0x1a39('0x65')],_[_0x1a39('0x6a')](_0x466ae5['variable'])[0x0],_0x466ae5[_0x1a39('0x92')]);if(this['queueReports'][_0x466ae5[_0x1a39('0x65')]]){var _0x3a16bc=_[_0x1a39('0x6d')](this[_0x1a39('0xd')][_0x466ae5[_0x1a39('0x65')]]);if(_0x3a16bc){if(this['isNotNull'](_0x466ae5[_0x1a39('0x93')])&&this['isNotNull'](_0x466ae5[_0x1a39('0x93')]['queuestatus'])){switch(_0x466ae5[_0x1a39('0x92')]){case _0x1a39('0x94'):_0x3a16bc['queuecallerexit']=![];_0x3a16bc[_0x1a39('0x89')]=null;break;default:_0x3a16bc[_0x1a39('0x81')]=!![];_0x3a16bc[_0x1a39('0x89')]=moment()[_0x1a39('0x41')](_0x1a39('0x72'));_0x3a16bc[_0x1a39('0x78')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3a16bc[_0x1a39('0x1a')]=![];_0x3a16bc['queuecallerabandonAt']=null;_0x3a16bc['queuecallerexitreason']=_0x466ae5[_0x1a39('0x92')];this[_0x1a39('0x31')][_0x466ae5[_0x1a39('0x65')]]=_0x3a16bc;this['emitVoiceQueueChannelRemove'](_0x3a16bc);}else if(this['isNotNull'](_0x466ae5[_0x1a39('0x93')])&&this['isNotNull'](_0x466ae5[_0x1a39('0x93')][_0x1a39('0x95')])){if(!_0x3a16bc[_0x1a39('0x1a')]){_0x3a16bc[_0x1a39('0x81')]=!![];_0x3a16bc[_0x1a39('0x89')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3a16bc[_0x1a39('0x73')]=_0x1a39('0x96');_0x3a16bc[_0x1a39('0x78')]=moment()['format'](_0x1a39('0x72'));this['channels'][_0x466ae5[_0x1a39('0x65')]]=_0x3a16bc;}}_0x3a16bc[_0x1a39('0x13')]=this[_0x1a39('0x13')][_0x466ae5['uniqueid']];}}}}catch(_0x1566d6){logger[_0x1a39('0x38')](_0x1a39('0x97'),util['inspect'](_0x1566d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1a39('0x2f')][_0x1a39('0x91')]=function(_0x42dfa7,_0x15893c,_0x34b63a){var _0x235c5c=[_0x1a39('0x98'),_0x1a39('0x99'),_0x1a39('0x9a'),'rtpaudioqosjitterbridged',_0x1a39('0x9b'),'rtpaudioqoslossbridged',_0x1a39('0x9c'),_0x1a39('0x9d'),_0x1a39('0x9e'),'sipuri',_0x1a39('0x9f'),'bridgepvtcallid',_0x1a39('0xa0'),_0x1a39('0xa1'),_0x1a39('0xa2'),_0x1a39('0xa3'),'membername',_0x1a39('0xa4'),'memberrealtime'];if(!_[_0x1a39('0x34')](_0x15893c)&&!_[_0x1a39('0xa5')](_0x235c5c,_0x15893c)){if(_[_0x1a39('0x57')](this[_0x1a39('0x13')][_0x42dfa7])){this[_0x1a39('0x13')][_0x42dfa7]={};}this[_0x1a39('0x13')][_0x42dfa7][_0x15893c]=_0x34b63a;}};VoiceQueueReport[_0x1a39('0x2f')]['syncHangup']=function(_0x5e66fc){try{if(this[_0x1a39('0x56')](_0x5e66fc)){if(this[_0x1a39('0xd')][_0x5e66fc['uniqueid']]){for(var _0x5180f7=0x0,_0x51c646={};_0x5180f7=0x0?moment(_0x5c1b21[_0x45c0('0x17')])[_0x45c0('0x18')](_0x5c1b21[_0x45c0('0x16')],_0x45c0('0xc')):null,'data1':_0x45c0('0x19'),'data2':_0x5c1b21[_0x45c0('0x10')],'data3':_0x5c1b21[_0x45c0('0x1a')],'data4':_0x5c1b21[_0x45c0('0x1b')]||null,'role':_0x45c0('0xf'),'internal':_0x5c1b21[_0x45c0('0x10')]?_[_0x45c0('0x11')](_0x5c1b21[_0x45c0('0x10')]):undefined,'uniqueid':_0x5c1b21['uniqueid']},'log':_0x45c0('0x13')});}; \ No newline at end of file +var _0x1a1f=['toNumber','uniqueid','voiceDialReport','starttime','endtime','outbound','dialstring','agent','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','interface','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','accountcode'];(function(_0x57ba72,_0x2c0fa8){var _0xa0fa68=function(_0x47a686){while(--_0x47a686){_0x57ba72['push'](_0x57ba72['shift']());}};_0xa0fa68(++_0x2c0fa8);}(_0x1a1f,0xe8));var _0xf1a1=function(_0x3f4968,_0x2d6824){_0x3f4968=_0x3f4968-0x0;var _0x55cfd5=_0x1a1f[_0x3f4968];return _0x55cfd5;};'use strict';var moment=require(_0xf1a1('0x0'));var _=require(_0xf1a1('0x1'));var util=require(_0xf1a1('0x2'));var client=require('../client');exports[_0xf1a1('0x3')]=function(_0x5a6f41){var _0x995977=_0x5a6f41[_0xf1a1('0x4')]||_0x5a6f41[_0xf1a1('0x5')];return client[_0xf1a1('0x6')](_0xf1a1('0x7'),{'body':{'channel':_0xf1a1('0x8'),'membername':_0x5a6f41[_0xf1a1('0x9')],'interface':_[_0xf1a1('0xa')](_0x5a6f41['interface'])?util[_0xf1a1('0xb')]('SIP/%s',_0x5a6f41[_0xf1a1('0x9')]):_0x5a6f41[_0xf1a1('0xc')],'type':'TALKING','enterAt':_0x5a6f41[_0xf1a1('0xd')],'exitAt':_0x995977,'duration':moment(_0x995977)[_0xf1a1('0xe')](_0x5a6f41[_0xf1a1('0xd')],_0xf1a1('0xf')),'data1':_0xf1a1('0x10'),'data2':_0x5a6f41[_0xf1a1('0x11')],'data3':_0x5a6f41[_0xf1a1('0x12')],'data4':null,'data5':_0x5a6f41['queue'],'role':'agent','internal':_0x5a6f41[_0xf1a1('0x13')]?_[_0xf1a1('0x14')](_0x5a6f41[_0xf1a1('0x13')]):undefined,'uniqueid':_0x5a6f41[_0xf1a1('0x15')]},'log':'CreateMemberReport'});};exports[_0xf1a1('0x16')]=function(_0x39ec19){return client[_0xf1a1('0x6')](_0xf1a1('0x7'),{'body':{'channel':_0xf1a1('0x8'),'membername':_0x39ec19['membername'],'interface':_0x39ec19[_0xf1a1('0xc')],'type':'TALKING','enterAt':_0x39ec19[_0xf1a1('0x17')],'exitAt':_0x39ec19[_0xf1a1('0x18')],'duration':moment(_0x39ec19[_0xf1a1('0x18')])[_0xf1a1('0xe')](_0x39ec19[_0xf1a1('0x17')],_0xf1a1('0xf'))>=0x0?moment(_0x39ec19[_0xf1a1('0x18')])[_0xf1a1('0xe')](_0x39ec19[_0xf1a1('0x17')],_0xf1a1('0xf')):null,'data1':_0xf1a1('0x19'),'data2':_0x39ec19[_0xf1a1('0x13')],'data3':_0x39ec19[_0xf1a1('0x12')],'data4':_0x39ec19[_0xf1a1('0x1a')]||null,'role':_0xf1a1('0x1b'),'internal':_0x39ec19[_0xf1a1('0x13')]?_['toNumber'](_0x39ec19['accountcode']):undefined,'uniqueid':_0x39ec19[_0xf1a1('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index acc56f7..665c31b 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 _0x2b11=['../client','getTemplates','GetTemplate'];(function(_0x175828,_0x23a42d){var _0x5606b9=function(_0x1fd714){while(--_0x1fd714){_0x175828['push'](_0x175828['shift']());}};_0x5606b9(++_0x23a42d);}(_0x2b11,0x150));var _0x12b1=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x2b11[_0x426711];return _0x592991;};'use strict';var client=require(_0x12b1('0x0'));exports[_0x12b1('0x1')]=function(_0x40b2df){return function(_0x2db823){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x12b1('0x2')});};}; \ No newline at end of file +var _0xbb6e=['GetTemplate','html','getTemplates','Request'];(function(_0x2388be,_0x43ebae){var _0x13ac52=function(_0xa6b025){while(--_0xa6b025){_0x2388be['push'](_0x2388be['shift']());}};_0x13ac52(++_0x43ebae);}(_0xbb6e,0x96));var _0xebb6=function(_0x236245,_0x5ee3cf){_0x236245=_0x236245-0x0;var _0xaa129=_0xbb6e[_0x236245];return _0xaa129;};'use strict';var client=require('../client');exports[_0xebb6('0x0')]=function(_0x9f0256){return function(_0x3f6c5b){return client[_0xebb6('0x1')](_0xebb6('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xebb6('0x3')]},'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 987b438..b33cb4d 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0xff11fd,_0x99808d){var _0xb0de97=function(_0x5cde6a){while(--_0x5cde6a){_0xff11fd['push'](_0xff11fd['shift']());}};_0xb0de97(++_0x99808d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x17b6e1,_0x2a91f3){var _0x272ac4=function(_0x5ce243){while(--_0x5ce243){_0x17b6e1['push'](_0x17b6e1['shift']());}};_0x272ac4(++_0x2a91f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 13f862b..ba9a104 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 _0x9c20=['GetTrunk','../client','getTrunks','Request'];(function(_0xa064f1,_0x2f16be){var _0x3f61fa=function(_0x33a0bb){while(--_0x33a0bb){_0xa064f1['push'](_0xa064f1['shift']());}};_0x3f61fa(++_0x2f16be);}(_0x9c20,0x189));var _0x09c2=function(_0x487605,_0x17306e){_0x487605=_0x487605-0x0;var _0x42c167=_0x9c20[_0x487605];return _0x42c167;};'use strict';var client=require(_0x09c2('0x0'));exports[_0x09c2('0x1')]=function(_0x505dab){return function(_0x101cc8){return client[_0x09c2('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0x09c2('0x3')});};}; \ No newline at end of file +var _0x3251=['GetTrunk','../client','getTrunks','Request'];(function(_0x245337,_0x2108b3){var _0x2f8674=function(_0x56098c){while(--_0x56098c){_0x245337['push'](_0x245337['shift']());}};_0x2f8674(++_0x2108b3);}(_0x3251,0xb5));var _0x1325=function(_0x5c7c32,_0x48796d){_0x5c7c32=_0x5c7c32-0x0;var _0x48a135=_0x3251[_0x5c7c32];return _0x48a135;};'use strict';var client=require(_0x1325('0x0'));exports[_0x1325('0x1')]=function(_0x5efe25){return function(_0x3a3936){return client[_0x1325('0x2')](_0x1325('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0x1325('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 1ce62f2..d11dcf5 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 _0x7179=['GetUser','name','email','accountcode','fullname','online','pauseType','lastPauseAt','phone','mobile','interface','getTelephones','Request','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','lastLoginAt','voicePause','../client','getAgents'];(function(_0x10531d,_0x4d39bf){var _0x10ed67=function(_0x1abe97){while(--_0x1abe97){_0x10531d['push'](_0x10531d['shift']());}};_0x10ed67(++_0x4d39bf);}(_0x7179,0x18e));var _0x9717=function(_0x379d2a,_0x107328){_0x379d2a=_0x379d2a-0x0;var _0xc270f1=_0x7179[_0x379d2a];return _0xc270f1;};'use strict';var client=require(_0x9717('0x0'));exports[_0x9717('0x1')]=function(){return function(){return client['Request'](_0x9717('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x9717('0x3'),_0x9717('0x4'),_0x9717('0x5'),_0x9717('0x6'),_0x9717('0x7'),'lastLoginAt',_0x9717('0x8'),_0x9717('0x9'),'voicePause',_0x9717('0xa'),_0x9717('0xb'),_0x9717('0xc')]},'log':_0x9717('0x1')});};};exports[_0x9717('0xd')]=function(){return function(){return client[_0x9717('0xe')](_0x9717('0x2'),{'options':{'raw':!![],'where':{'role':_0x9717('0xf')},'attributes':['id',_0x9717('0x3'),_0x9717('0x5'),_0x9717('0x10')]},'log':_0x9717('0xd')});};};exports[_0x9717('0x11')]=function(_0x2b3a71,_0x3aa010,_0x5d9c4e){return client[_0x9717('0xe')](_0x9717('0x12'),{'body':{'type':_0x3aa010,'uniqueid':_0x5d9c4e},'options':{'where':{'id':_0x2b3a71['id']}},'log':_0x9717('0x11')});};exports[_0x9717('0x13')]=function(_0x59f1f7){return client[_0x9717('0xe')](_0x9717('0x14'),{'body':{},'options':{'where':{'id':_0x59f1f7['id']}},'log':_0x9717('0x11')});};exports[_0x9717('0x15')]=function(_0x35d290){return client[_0x9717('0xe')](_0x9717('0x16'),{'options':{'raw':![],'where':{'role':'agent','id':_0x35d290},'attributes':['id','name',_0x9717('0x4'),_0x9717('0x5'),_0x9717('0x6'),_0x9717('0x7'),_0x9717('0x17'),_0x9717('0x8'),_0x9717('0x9'),_0x9717('0x18'),_0x9717('0xc')]},'log':_0x9717('0x15')});}; \ No newline at end of file +var _0x5916=['../client','getAgents','GetUser','agent','name','email','accountcode','online','lastLoginAt','pauseType','voicePause','phone','interface','getTelephones','Request','telephone','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','fullname','lastPauseAt','getAgent'];(function(_0x2d36a6,_0x2f8cd0){var _0x59cec0=function(_0x5a56d0){while(--_0x5a56d0){_0x2d36a6['push'](_0x2d36a6['shift']());}};_0x59cec0(++_0x2f8cd0);}(_0x5916,0x1b0));var _0x6591=function(_0xc36513,_0x530493){_0xc36513=_0xc36513-0x0;var _0x2ff7fe=_0x5916[_0xc36513];return _0x2ff7fe;};'use strict';var client=require(_0x6591('0x0'));exports[_0x6591('0x1')]=function(){return function(){return client['Request'](_0x6591('0x2'),{'options':{'raw':![],'where':{'role':_0x6591('0x3')},'attributes':['id',_0x6591('0x4'),_0x6591('0x5'),_0x6591('0x6'),'fullname',_0x6591('0x7'),_0x6591('0x8'),_0x6591('0x9'),'lastPauseAt',_0x6591('0xa'),_0x6591('0xb'),'mobile',_0x6591('0xc')]},'log':_0x6591('0x1')});};};exports[_0x6591('0xd')]=function(){return function(){return client[_0x6591('0xe')](_0x6591('0x2'),{'options':{'raw':!![],'where':{'role':_0x6591('0xf')},'attributes':['id',_0x6591('0x4'),_0x6591('0x6'),'internal']},'log':_0x6591('0xd')});};};exports['savePause']=function(_0x13c5d2,_0x37607d,_0x8e86e8){return client[_0x6591('0xe')](_0x6591('0x10'),{'body':{'type':_0x37607d,'uniqueid':_0x8e86e8},'options':{'where':{'id':_0x13c5d2['id']}},'log':_0x6591('0x11')});};exports[_0x6591('0x12')]=function(_0x4f0575){return client[_0x6591('0xe')](_0x6591('0x13'),{'body':{},'options':{'where':{'id':_0x4f0575['id']}},'log':'savePause'});};exports['getAgent']=function(_0x510aac){return client[_0x6591('0xe')](_0x6591('0x14'),{'options':{'raw':![],'where':{'role':_0x6591('0x3'),'id':_0x510aac},'attributes':['id','name',_0x6591('0x5'),_0x6591('0x6'),_0x6591('0x15'),_0x6591('0x7'),'lastLoginAt',_0x6591('0x9'),_0x6591('0x16'),_0x6591('0xa'),_0x6591('0xc')]},'log':_0x6591('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c6f8ba1..68ac756 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 _0xf1f3=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x39428c,_0x34b23a){var _0x52d069=function(_0x394962){while(--_0x394962){_0x39428c['push'](_0x39428c['shift']());}};_0x52d069(++_0x34b23a);}(_0xf1f3,0x6f));var _0x3f1f=function(_0x3171b5,_0x47b84d){_0x3171b5=_0x3171b5-0x0;var _0x2e805c=_0xf1f3[_0x3171b5];return _0x2e805c;};'use strict';var client=require(_0x3f1f('0x0'));exports['create']=function(_0x3a0959){return client[_0x3f1f('0x1')](_0x3f1f('0x2'),{'body':_0x3a0959,'log':_0x3f1f('0x2')});};exports[_0x3f1f('0x3')]=function(_0x25846a,_0x546bf8,_0x2570a7){return client[_0x3f1f('0x1')]('UpdateVoiceAgentReport',{'body':_0x25846a,'options':{'where':{'uniqueid':_0x546bf8,'interface':_0x2570a7}},'log':_0x3f1f('0x4')});}; \ No newline at end of file +var _0x86f2=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x478719,_0x3a66b7){var _0x25fe4c=function(_0x41198f){while(--_0x41198f){_0x478719['push'](_0x478719['shift']());}};_0x25fe4c(++_0x3a66b7);}(_0x86f2,0xc2));var _0x286f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x86f2[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x286f('0x0'));exports[_0x286f('0x1')]=function(_0x4edc2d){return client[_0x286f('0x2')]('CreateVoiceAgentReport',{'body':_0x4edc2d,'log':_0x286f('0x3')});};exports[_0x286f('0x4')]=function(_0x468226,_0x5f3202,_0x2d6239){return client[_0x286f('0x2')](_0x286f('0x5'),{'body':_0x468226,'options':{'where':{'uniqueid':_0x5f3202,'interface':_0x2d6239}},'log':_0x286f('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 7a30459..b1dff84 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 _0x16cc=['context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format','type','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x19cbf2,_0x203c25){var _0xdb4e92=function(_0x3c92dc){while(--_0x3c92dc){_0x19cbf2['push'](_0x19cbf2['shift']());}};_0xdb4e92(++_0x203c25);}(_0x16cc,0x76));var _0xc16c=function(_0x583ccc,_0x38d0d9){_0x583ccc=_0x583ccc-0x0;var _0x101a77=_0x16cc[_0x583ccc];return _0x101a77;};'use strict';var moment=require(_0xc16c('0x0'));var util=require(_0xc16c('0x1'));var _=require(_0xc16c('0x2'));var client=require(_0xc16c('0x3'));exports['create']=function(_0x3ee8cf){return client[_0xc16c('0x4')](_0xc16c('0x5'),{'body':_[_0xc16c('0x6')](_0x3ee8cf,{'source':_0x3ee8cf[_0xc16c('0x7')],'destinationcontext':_0x3ee8cf[_0xc16c('0x8')],'callerid':_0x3ee8cf[_0xc16c('0x9')],'amaflags':_0xc16c('0xa')}),'log':_0xc16c('0x5')});};exports[_0xc16c('0xb')]=function(){return function(){return client[_0xc16c('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xc16c('0xc')],'createdAt':{'$between':[moment()['startOf'](_0xc16c('0xd'))['format'](_0xc16c('0xe')),moment()['endOf'](_0xc16c('0xd'))[_0xc16c('0xf')](_0xc16c('0xe'))]}},'attributes':[_0xc16c('0x10'),'disposition','duration','billableseconds']},'log':_0xc16c('0x11')});};}; \ No newline at end of file +var _0x4f1a=['lodash','../client','create','Request','merge','calleridnum','context','CreateVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','util'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x4f1a,0x10f));var _0xa4f1=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0x4f1a[_0x1945a5];return _0x5817a5;};'use strict';var moment=require('moment');var util=require(_0xa4f1('0x0'));var _=require(_0xa4f1('0x1'));var client=require(_0xa4f1('0x2'));exports[_0xa4f1('0x3')]=function(_0x4668dd){return client[_0xa4f1('0x4')]('CreateVoiceCallReport',{'body':_[_0xa4f1('0x5')](_0x4668dd,{'source':_0x4668dd[_0xa4f1('0x6')],'destinationcontext':_0x4668dd[_0xa4f1('0x7')],'callerid':_0x4668dd['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xa4f1('0x8')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xa4f1('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xa4f1('0x9')](_0xa4f1('0xa'))[_0xa4f1('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0xa4f1('0xb')](_0xa4f1('0xc'))]}},'attributes':[_0xa4f1('0xd'),_0xa4f1('0xe'),_0xa4f1('0xf'),'billableseconds']},'log':_0xa4f1('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fd1f41e..62fefe8 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 _0xfa21=['create','Request','CreateVoiceDialReport','../client'];(function(_0x2745e8,_0x4e1e9c){var _0x319805=function(_0x1336fe){while(--_0x1336fe){_0x2745e8['push'](_0x2745e8['shift']());}};_0x319805(++_0x4e1e9c);}(_0xfa21,0x16b));var _0x1fa2=function(_0x5248f1,_0x3e7c69){_0x5248f1=_0x5248f1-0x0;var _0x3862cd=_0xfa21[_0x5248f1];return _0x3862cd;};'use strict';var client=require(_0x1fa2('0x0'));exports[_0x1fa2('0x1')]=function(_0x5ebb2c){return client[_0x1fa2('0x2')]('CreateVoiceDialReport',{'body':_0x5ebb2c,'log':_0x1fa2('0x3')});}; \ No newline at end of file +var _0x07fa=['../client','create','CreateVoiceDialReport'];(function(_0x27abb6,_0x619052){var _0x255b80=function(_0x11ae92){while(--_0x11ae92){_0x27abb6['push'](_0x27abb6['shift']());}};_0x255b80(++_0x619052);}(_0x07fa,0x1ef));var _0xa07f=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x07fa[_0xaa1b3e];return _0x454d7d;};'use strict';var client=require(_0xa07f('0x0'));exports[_0xa07f('0x1')]=function(_0x243421){return client['Request'](_0xa07f('0x2'),{'body':_0x243421,'log':_0xa07f('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 4bddc3f..a99ba41 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 _0xf63a=['../client','recordingFormat','getVoiceExtensions'];(function(_0x29d49d,_0x4c3303){var _0xeea975=function(_0x1a0a9c){while(--_0x1a0a9c){_0x29d49d['push'](_0x29d49d['shift']());}};_0xeea975(++_0x4c3303);}(_0xf63a,0x1b6));var _0xaf63=function(_0x1206d7,_0x1b0ed7){_0x1206d7=_0x1206d7-0x0;var _0x5e1142=_0xf63a[_0x1206d7];return _0x5e1142;};'use strict';var client=require(_0xaf63('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xaf63('0x1')],'where':{'VoiceExtensionId':null}},'log':_0xaf63('0x2')});};}; \ No newline at end of file +var _0xf367=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x298986,_0x470dd9){var _0x3c420f=function(_0x4cc41b){while(--_0x4cc41b){_0x298986['push'](_0x298986['shift']());}};_0x3c420f(++_0x470dd9);}(_0xf367,0x150));var _0x7f36=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0xf367[_0xd60cb];return _0x47eecd;};'use strict';var client=require(_0x7f36('0x0'));exports[_0x7f36('0x1')]=function(){return function(){return client[_0x7f36('0x2')](_0x7f36('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7f36('0x4'),_0x7f36('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4a87b5b..efdb63f 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 _0x4c55=['dialPredictiveIntervalMinThreshold','Trunk','active','Pause','callerid','Interval','interval','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','mandatoryDisposition','dialPredictiveIntervalMaxThreshold'];(function(_0x446970,_0x2e8abc){var _0xccb49a=function(_0x49d1f1){while(--_0x49d1f1){_0x446970['push'](_0x446970['shift']());}};_0xccb49a(++_0x2e8abc);}(_0x4c55,0x16c));var _0x54c5=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x4c55[_0x1385dc];return _0x2f6469;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x54c5('0x0')](_0x54c5('0x1'),{'options':{'raw':![],'attributes':['id',_0x54c5('0x2'),_0x54c5('0x3'),_0x54c5('0x4'),_0x54c5('0x5'),_0x54c5('0x6'),_0x54c5('0x7'),_0x54c5('0x8'),_0x54c5('0x9'),_0x54c5('0xa'),_0x54c5('0xb'),_0x54c5('0xc'),_0x54c5('0xd'),_0x54c5('0xe'),_0x54c5('0xf'),_0x54c5('0x10'),_0x54c5('0x11'),_0x54c5('0x12'),_0x54c5('0x13'),'dialQueueTimeout',_0x54c5('0x14'),_0x54c5('0x15'),_0x54c5('0x16'),_0x54c5('0x17'),_0x54c5('0x18'),_0x54c5('0x19'),_0x54c5('0x1a'),_0x54c5('0x1b'),_0x54c5('0x1c'),_0x54c5('0x1d'),_0x54c5('0x1e'),_0x54c5('0x1f'),'dialAMDActive',_0x54c5('0x20'),_0x54c5('0x21'),'dialAMDAfterGreetingSilence',_0x54c5('0x22'),_0x54c5('0x23'),'dialAMDBetweenWordsSilence',_0x54c5('0x24'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x54c5('0x25'),_0x54c5('0x26'),'dialRecallInQueue','dialOrderByScheduledAt',_0x54c5('0x27'),_0x54c5('0x28'),_0x54c5('0x29'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x54c5('0x2a'),_0x54c5('0x2b'),_0x54c5('0x2c')],'include':[{'model':'Trunk','as':_0x54c5('0x2d'),'attributes':['id',_0x54c5('0x2'),'callerid',_0x54c5('0x2e')]},{'model':_0x54c5('0x2f'),'as':'mandatoryDispositionPause','attributes':['id',_0x54c5('0x2')]},{'model':_0x54c5('0x2d'),'as':'TrunkBackup','attributes':['id',_0x54c5('0x2'),_0x54c5('0x30'),_0x54c5('0x2e')]},{'model':_0x54c5('0x31'),'as':_0x54c5('0x31'),'attributes':['id',_0x54c5('0x2')],'include':[{'model':_0x54c5('0x31'),'as':'Intervals','attributes':['id',_0x54c5('0x2'),_0x54c5('0x32')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x4b6f=['dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b6f,0xea));var _0xf4b6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4b6f[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0xf4b6('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xf4b6('0x1')](_0xf4b6('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf4b6('0x3'),_0xf4b6('0x4'),_0xf4b6('0x5'),_0xf4b6('0x6'),_0xf4b6('0x7'),_0xf4b6('0x8'),_0xf4b6('0x9'),_0xf4b6('0xa'),_0xf4b6('0xb'),'dialPowerLevel','dialPredictiveOptimization',_0xf4b6('0xc'),_0xf4b6('0xd'),_0xf4b6('0xe'),_0xf4b6('0xf'),'dialOriginateTimeout','dialQueueOptions',_0xf4b6('0x10'),_0xf4b6('0x11'),'dialCongestionMaxRetry',_0xf4b6('0x12'),_0xf4b6('0x13'),_0xf4b6('0x14'),_0xf4b6('0x15'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xf4b6('0x16'),_0xf4b6('0x17'),'dialPrefix','dialCheckDuplicateType',_0xf4b6('0x18'),_0xf4b6('0x19'),_0xf4b6('0x1a'),_0xf4b6('0x1b'),_0xf4b6('0x1c'),_0xf4b6('0x1d'),_0xf4b6('0x1e'),_0xf4b6('0x1f'),_0xf4b6('0x20'),_0xf4b6('0x21'),_0xf4b6('0x22'),_0xf4b6('0x23'),_0xf4b6('0x24'),'dialOrderByScheduledAt',_0xf4b6('0x25'),_0xf4b6('0x26'),_0xf4b6('0x27'),_0xf4b6('0x6'),_0xf4b6('0x28'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xf4b6('0x29'),_0xf4b6('0x2a'),_0xf4b6('0x2b')],'include':[{'model':_0xf4b6('0x2c'),'as':_0xf4b6('0x2c'),'attributes':['id',_0xf4b6('0x2d'),'callerid',_0xf4b6('0x2e')]},{'model':_0xf4b6('0x2f'),'as':_0xf4b6('0x30'),'attributes':['id',_0xf4b6('0x2d')]},{'model':_0xf4b6('0x2c'),'as':_0xf4b6('0x31'),'attributes':['id','name',_0xf4b6('0x32'),_0xf4b6('0x2e')]},{'model':_0xf4b6('0x33'),'as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':_0xf4b6('0x34'),'attributes':['id',_0xf4b6('0x2d'),_0xf4b6('0x35')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 279d05a..df2932c 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 _0x91c6=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports'];(function(_0x13187c,_0x198c2e){var _0x40f203=function(_0x209746){while(--_0x209746){_0x13187c['push'](_0x13187c['shift']());}};_0x40f203(++_0x198c2e);}(_0x91c6,0x64));var _0x691c=function(_0x37ffde,_0x4e745f){_0x37ffde=_0x37ffde-0x0;var _0x35c0fc=_0x91c6[_0x37ffde];return _0x35c0fc;};'use strict';var moment=require(_0x691c('0x0'));var _=require(_0x691c('0x1'));var client=require('../client');exports['create']=function(_0x15880f){return client[_0x691c('0x2')](_0x691c('0x3'),{'body':_0x15880f,'log':_0x691c('0x3')});};exports[_0x691c('0x4')]=function(){return function(){return client[_0x691c('0x2')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0x691c('0x5')](_0x691c('0x6')),moment()[_0x691c('0x7')]('day')[_0x691c('0x5')](_0x691c('0x6'))]}},'attributes':[_0x691c('0x8'),'queue',_0x691c('0x9'),_0x691c('0xa'),'queuecallercomplete','queuecallercompleteAt',_0x691c('0xb'),_0x691c('0xc'),'queuecallerabandon',_0x691c('0xd')]},'log':_0x691c('0xe')});};}; \ No newline at end of file +var _0x7846=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','moment','lodash','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport'];(function(_0x25b9f5,_0x259db4){var _0x2f81d0=function(_0x244b09){while(--_0x244b09){_0x25b9f5['push'](_0x25b9f5['shift']());}};_0x2f81d0(++_0x259db4);}(_0x7846,0x6b));var _0x6784=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x7846[_0x15dbca];return _0x326533;};'use strict';var moment=require(_0x6784('0x0'));var _=require(_0x6784('0x1'));var client=require(_0x6784('0x2'));exports[_0x6784('0x3')]=function(_0x381066){return client[_0x6784('0x4')]('CreateVoiceQueueReport',{'body':_0x381066,'log':_0x6784('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x6784('0x4')](_0x6784('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x6784('0x7')](_0x6784('0x8'))[_0x6784('0x9')](_0x6784('0xa')),moment()[_0x6784('0xb')](_0x6784('0x8'))[_0x6784('0x9')](_0x6784('0xa'))]}},'attributes':[_0x6784('0xc'),'queue',_0x6784('0xd'),_0x6784('0xe'),'queuecallercomplete',_0x6784('0xf'),_0x6784('0x10'),_0x6784('0x11'),_0x6784('0x12'),'queuecallerabandonAt']},'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 f76e74f..2565483 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 _0x1c29=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x5ca219,_0x4b4f89){var _0xee42f2=function(_0x11e1d3){while(--_0x11e1d3){_0x5ca219['push'](_0x5ca219['shift']());}};_0xee42f2(++_0x4b4f89);}(_0x1c29,0xed));var _0x91c2=function(_0x5dbc6a,_0x3e26b6){_0x5dbc6a=_0x5dbc6a-0x0;var _0x694811=_0x1c29[_0x5dbc6a];return _0x694811;};'use strict';var client=require(_0x91c2('0x0'));exports[_0x91c2('0x1')]=function(_0x56c51f){return function(){return client[_0x91c2('0x2')](_0x91c2('0x3'),{'options':{'where':{'VoiceQueueId':_0x56c51f,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xaf72=['Request','../client','getVoiceQueueRtPauses'];(function(_0x10e116,_0x18796d){var _0x2c5cb8=function(_0x29f74d){while(--_0x29f74d){_0x10e116['push'](_0x10e116['shift']());}};_0x2c5cb8(++_0x18796d);}(_0xaf72,0x82));var _0x2af7=function(_0x37d108,_0x17c13f){_0x37d108=_0x37d108-0x0;var _0x598dea=_0xaf72[_0x37d108];return _0x598dea;};'use strict';var client=require(_0x2af7('0x0'));exports[_0x2af7('0x1')]=function(_0x5090d7){return function(){return client[_0x2af7('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5090d7,'paused':!![]},'raw':!![]},'log':_0x2af7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f323a47..ea345cb 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 _0xea36=['merge','lodash','../client','create','CreateVoiceRecording'];(function(_0x209bcf,_0x5a92c9){var _0x4939cc=function(_0x88455e){while(--_0x88455e){_0x209bcf['push'](_0x209bcf['shift']());}};_0x4939cc(++_0x5a92c9);}(_0xea36,0x128));var _0x6ea3=function(_0x2adce9,_0x341b4b){_0x2adce9=_0x2adce9-0x0;var _0x507065=_0xea36[_0x2adce9];return _0x507065;};'use strict';var _=require(_0x6ea3('0x0'));var client=require(_0x6ea3('0x1'));exports[_0x6ea3('0x2')]=function(_0x5e9c31){return client['Request'](_0x6ea3('0x3'),{'body':_[_0x6ea3('0x4')](_0x5e9c31,{'value':_0x5e9c31['monitorFilename']}),'log':_0x6ea3('0x3')});}; \ No newline at end of file +var _0x31f6=['monitorFilename','../client','Request','CreateVoiceRecording'];(function(_0x5ad1da,_0x202aaf){var _0x46d88e=function(_0x3a6bf2){while(--_0x3a6bf2){_0x5ad1da['push'](_0x5ad1da['shift']());}};_0x46d88e(++_0x202aaf);}(_0x31f6,0xc5));var _0x631f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x31f6[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var client=require(_0x631f('0x0'));exports['create']=function(_0x138393){return client[_0x631f('0x1')](_0x631f('0x2'),{'body':_['merge'](_0x138393,{'value':_0x138393[_0x631f('0x3')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index c91b87a..c6b7c51 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 _0xed49=['blindTransfer','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','blind','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed49,0x14c));var _0x9ed4=function(_0x1c59b9,_0x5df21c){_0x1c59b9=_0x1c59b9-0x0;var _0x3802b2=_0xed49[_0x1c59b9];return _0x3802b2;};'use strict';var client=require(_0x9ed4('0x0'));exports[_0x9ed4('0x1')]=function(_0x2a708b){return client[_0x9ed4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2a708b['result'],'transfererchannel':_0x2a708b[_0x9ed4('0x3')],'transferercalleridnum':_0x2a708b[_0x9ed4('0x4')],'transferercalleridname':_0x2a708b[_0x9ed4('0x5')],'transfererconnectedlinenum':_0x2a708b[_0x9ed4('0x6')],'transfererconnectedlinename':_0x2a708b[_0x9ed4('0x7')],'transfereraccountcode':_0x2a708b[_0x9ed4('0x8')],'transferercontext':_0x2a708b[_0x9ed4('0x9')],'transfererexten':_0x2a708b['transfererexten'],'transfererlinkedid':_0x2a708b[_0x9ed4('0xa')],'transfereechannel':_0x2a708b[_0x9ed4('0xb')],'transfereecalleridnum':_0x2a708b['transfereecalleridnum'],'transfereecalleridname':_0x2a708b['transfereecalleridname'],'transfereeconnectedlinenum':_0x2a708b['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2a708b[_0x9ed4('0xc')],'transfereeaccountcode':_0x2a708b[_0x9ed4('0xd')],'transfereecontext':_0x2a708b[_0x9ed4('0xe')],'transfereeexten':_0x2a708b['transfereeexten'],'transfereelinkedid':_0x2a708b[_0x9ed4('0xf')],'isexternal':_0x2a708b[_0x9ed4('0x10')],'context':_0x2a708b[_0x9ed4('0x11')],'extension':_0x2a708b['extension'],'type':_0x9ed4('0x12')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x295e10){return client[_0x9ed4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x295e10[_0x9ed4('0x13')],'transfererchannel':_0x295e10[_0x9ed4('0x14')],'transferercalleridnum':_0x295e10[_0x9ed4('0x15')],'transferercalleridname':_0x295e10[_0x9ed4('0x16')],'transfererconnectedlinenum':_0x295e10[_0x9ed4('0x17')],'transfererconnectedlinename':_0x295e10[_0x9ed4('0x18')],'transfereraccountcode':_0x295e10[_0x9ed4('0x19')],'transferercontext':_0x295e10['secondtransferercontext'],'transfererexten':_0x295e10[_0x9ed4('0x1a')],'transfererlinkedid':_0x295e10[_0x9ed4('0x1b')],'transfereechannel':_0x295e10[_0x9ed4('0x1c')],'transfereecalleridnum':_0x295e10[_0x9ed4('0x1d')],'transfereecalleridname':_0x295e10['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x295e10['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x295e10[_0x9ed4('0x1e')],'transfereeaccountcode':_0x295e10[_0x9ed4('0x1f')],'transfereecontext':_0x295e10[_0x9ed4('0x20')],'transfereeexten':_0x295e10[_0x9ed4('0x21')],'transfereelinkedid':_0x295e10[_0x9ed4('0x22')],'isexternal':_0x295e10[_0x9ed4('0x10')],'context':_0x295e10[_0x9ed4('0x23')],'extension':_0x295e10[_0x9ed4('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x8b0e=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x36a68c,_0xd76338){var _0x15447e=function(_0x5a8e54){while(--_0x5a8e54){_0x36a68c['push'](_0x36a68c['shift']());}};_0x15447e(++_0xd76338);}(_0x8b0e,0x13d));var _0xe8b0=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0x8b0e[_0x7b4397];return _0x16de0b;};'use strict';var client=require(_0xe8b0('0x0'));exports['blindTransfer']=function(_0x16c493){return client[_0xe8b0('0x1')](_0xe8b0('0x2'),{'body':{'result':_0x16c493[_0xe8b0('0x3')],'transfererchannel':_0x16c493[_0xe8b0('0x4')],'transferercalleridnum':_0x16c493[_0xe8b0('0x5')],'transferercalleridname':_0x16c493[_0xe8b0('0x6')],'transfererconnectedlinenum':_0x16c493['transfererconnectedlinenum'],'transfererconnectedlinename':_0x16c493[_0xe8b0('0x7')],'transfereraccountcode':_0x16c493[_0xe8b0('0x8')],'transferercontext':_0x16c493['transferercontext'],'transfererexten':_0x16c493[_0xe8b0('0x9')],'transfererlinkedid':_0x16c493[_0xe8b0('0xa')],'transfereechannel':_0x16c493[_0xe8b0('0xb')],'transfereecalleridnum':_0x16c493[_0xe8b0('0xc')],'transfereecalleridname':_0x16c493[_0xe8b0('0xd')],'transfereeconnectedlinenum':_0x16c493[_0xe8b0('0xe')],'transfereeconnectedlinename':_0x16c493[_0xe8b0('0xf')],'transfereeaccountcode':_0x16c493[_0xe8b0('0x10')],'transfereecontext':_0x16c493[_0xe8b0('0x11')],'transfereeexten':_0x16c493[_0xe8b0('0x12')],'transfereelinkedid':_0x16c493[_0xe8b0('0x13')],'isexternal':_0x16c493['isexternal'],'context':_0x16c493[_0xe8b0('0x14')],'extension':_0x16c493[_0xe8b0('0x15')],'type':_0xe8b0('0x16')},'log':_0xe8b0('0x2')});};exports['attendedTransfer']=function(_0x5bdb8f){return client[_0xe8b0('0x1')](_0xe8b0('0x2'),{'body':{'result':_0x5bdb8f[_0xe8b0('0x3')],'transfererchannel':_0x5bdb8f[_0xe8b0('0x17')],'transferercalleridnum':_0x5bdb8f[_0xe8b0('0x18')],'transferercalleridname':_0x5bdb8f[_0xe8b0('0x19')],'transfererconnectedlinenum':_0x5bdb8f[_0xe8b0('0x1a')],'transfererconnectedlinename':_0x5bdb8f[_0xe8b0('0x1b')],'transfereraccountcode':_0x5bdb8f[_0xe8b0('0x1c')],'transferercontext':_0x5bdb8f[_0xe8b0('0x1d')],'transfererexten':_0x5bdb8f[_0xe8b0('0x1e')],'transfererlinkedid':_0x5bdb8f[_0xe8b0('0x1f')],'transfereechannel':_0x5bdb8f[_0xe8b0('0x20')],'transfereecalleridnum':_0x5bdb8f[_0xe8b0('0x21')],'transfereecalleridname':_0x5bdb8f[_0xe8b0('0x22')],'transfereeconnectedlinenum':_0x5bdb8f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5bdb8f[_0xe8b0('0x23')],'transfereeaccountcode':_0x5bdb8f[_0xe8b0('0x24')],'transfereecontext':_0x5bdb8f[_0xe8b0('0x25')],'transfereeexten':_0x5bdb8f[_0xe8b0('0x26')],'transfereelinkedid':_0x5bdb8f[_0xe8b0('0x27')],'isexternal':_0x5bdb8f[_0xe8b0('0x28')],'context':_0x5bdb8f[_0xe8b0('0x29')],'extension':_0x5bdb8f[_0xe8b0('0x2a')],'type':_0xe8b0('0x2b')},'log':_0xe8b0('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8b3c8ed..84aa443 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 _0x5fc5=['name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','values','channels','voicechannel','find','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','then','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','uniqueid','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','status','filename','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','catch','message','command','Command','Action','content','hasOwnProperty','voiceQueues'];(function(_0x2896f6,_0x180922){var _0x42d237=function(_0x3fa515){while(--_0x3fa515){_0x2896f6['push'](_0x2896f6['shift']());}};_0x42d237(++_0x180922);}(_0x5fc5,0xe9));var _0x55fc=function(_0x22aa32,_0x15988a){_0x22aa32=_0x22aa32-0x0;var _0x52deb6=_0x5fc5[_0x22aa32];return _0x52deb6;};'use strict';var _=require(_0x55fc('0x0'));var util=require('util');var jayson=require(_0x55fc('0x1'));var schema=require(_0x55fc('0x2'));var BPromise=require(_0x55fc('0x3'));var moment=require(_0x55fc('0x4'));var config=require(_0x55fc('0x5'));var properties=require(_0x55fc('0x6'));var ami=require(_0x55fc('0x7'));exports[_0x55fc('0x8')]=function(_0x344d8a,_0xbcc938,_0x884b47){return new BPromise(function(_0x3552e2,_0x465c94){var _0xe91a8c={'QueuePause':function(_0x2ff2b1){return new Promise(function(_0x24250e,_0x46d6d4){var _0x361405=util[_0x55fc('0x9')](_0x55fc('0xa'),_0x55fc('0xb'),_0x2ff2b1['name']);if(_0x344d8a[_0x55fc('0xc')]&&_0x344d8a['timers'][_0x361405]&&_0x344d8a[_0x55fc('0xc')][_0x361405][_0x55fc('0xd')]){_0x344d8a[_0x55fc('0xc')][_0x361405][_0x55fc('0xe')]();}if(_0x344d8a[_0x55fc('0xf')][_0x361405]){_0x344d8a['agents'][_0x361405]['updateStatusRealtime']({'statePause':_0x2ff2b1['pause']?!![]:![]});}_0x24250e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x364a99){var _0x514d6b=this;return new Promise(function(_0x5b0af7,_0x33994e){if(ami[_0x55fc('0x10')]()==![]){return _0x33994e(_0x514d6b[_0x55fc('0x11')](0x1f4,[config[_0x55fc('0x12')]['ip'],config['asterisk'][_0x55fc('0x13')],_0x55fc('0x14')][_0x55fc('0x15')]('\x20')));}_0x364a99=_[_0x55fc('0x16')](_0x364a99,_[_0x55fc('0x17')](properties[_0x55fc('0x18')]));_0x364a99[_0x55fc('0x19')]=_0x55fc('0x1a');return ami['Action'](_0x364a99)['then'](function(_0x30a3fc){_0x5b0af7({'code':0xc8,'message':_0x30a3fc['message']});})[_0x55fc('0x1b')](function(_0x82cfd1){_0x33994e(_0x514d6b['error'](0x1f5,_0x82cfd1[_0x55fc('0x1c')]));});});},'Command':function(_0x50d3a0){var _0x2e364e=this;return new Promise(function(_0x3311be,_0x58371a){if(ami[_0x55fc('0x10')]()==![]){return _0x58371a(_0x2e364e['error'](0x1f4,[config[_0x55fc('0x12')]['ip'],config[_0x55fc('0x12')]['username'],_0x55fc('0x14')][_0x55fc('0x15')]('\x20')));}_0x50d3a0=_['pick'](_0x50d3a0,_0x55fc('0x1d'));_0x50d3a0[_0x55fc('0x19')]=_0x55fc('0x1e');return ami[_0x55fc('0x1f')](_0x50d3a0)['then'](function(_0x3e8a92){_0x3311be({'code':0xc8,'message':_0x3e8a92[_0x55fc('0x20')]});})[_0x55fc('0x1b')](function(_0x60e279){_0x58371a(_0x2e364e[_0x55fc('0x11')](0x1f5,_0x60e279[_0x55fc('0x1c')]));});});},'VoiceQueues':function(_0x12ed24){return new Promise(function(_0x166f26,_0x32dfa6){var _0x44eec9=[];for(var _0x30bf3b in _0x344d8a['voiceQueues']){if(_0x344d8a['voiceQueues'][_0x55fc('0x21')](_0x30bf3b)){var _0x4d8c17=_0x344d8a[_0x55fc('0x22')][_0x30bf3b];var _0xdbc09={'id':_0x4d8c17['id'],'name':_0x4d8c17[_0x55fc('0x23')],'strategy':_0x4d8c17[_0x55fc('0x24')],'answered':_0x4d8c17[_0x55fc('0x25')],'available':_0x4d8c17[_0x55fc('0x26')],'loggedIn':_0x4d8c17[_0x55fc('0x27')],'pTalking':_0x4d8c17[_0x55fc('0x28')],'sumBillable':_0x4d8c17['sumBillable'],'sumDuration':_0x4d8c17[_0x55fc('0x29')],'sumHoldTime':_0x4d8c17[_0x55fc('0x2a')]||0x0,'talking':_0x4d8c17['talking'],'total':_0x4d8c17['total'],'type':_0x4d8c17[_0x55fc('0x2b')],'unmanaged':_0x4d8c17[_0x55fc('0x2c')],'abandoned':_0x4d8c17['abandoned'],'waiting':_0x4d8c17[_0x55fc('0x2d')],'loggedInDb':_0x4d8c17[_0x55fc('0x2e')]};if(_0x4d8c17[_0x55fc('0x2b')]===_0x55fc('0x2f')){_0xdbc09['dialActive']=_0x4d8c17[_0x55fc('0x30')];_0xdbc09[_0x55fc('0x31')]=_0x4d8c17['dialMethod'];_0xdbc09[_0x55fc('0x32')]=_0x4d8c17['dialOriginateCallerIdName'];_0xdbc09[_0x55fc('0x33')]=_0x4d8c17[_0x55fc('0x33')];_0xdbc09[_0x55fc('0x34')]=_0x4d8c17[_0x55fc('0x34')];_0xdbc09['dialPrefix']=_0x4d8c17[_0x55fc('0x35')];_0xdbc09[_0x55fc('0x36')]=_0x4d8c17[_0x55fc('0x36')];_0xdbc09[_0x55fc('0x37')]=_0x4d8c17[_0x55fc('0x37')];_0xdbc09[_0x55fc('0x38')]=_0x4d8c17['outboundBlacklistCallsDay'];_0xdbc09[_0x55fc('0x39')]=_0x4d8c17[_0x55fc('0x39')];_0xdbc09[_0x55fc('0x3a')]=_0x4d8c17[_0x55fc('0x3a')];_0xdbc09[_0x55fc('0x3b')]=_0x4d8c17[_0x55fc('0x3b')];_0xdbc09[_0x55fc('0x3c')]=_0x4d8c17[_0x55fc('0x3c')];_0xdbc09[_0x55fc('0x3d')]=_0x4d8c17[_0x55fc('0x3d')];_0xdbc09[_0x55fc('0x3e')]=_0x4d8c17[_0x55fc('0x3e')];_0xdbc09[_0x55fc('0x3f')]=_0x4d8c17[_0x55fc('0x3f')];_0xdbc09[_0x55fc('0x40')]=_0x4d8c17['outboundOriginateFailureCallsDay'];_0xdbc09['outboundReCallsDay']=_0x4d8c17['outboundReCallsDay'];_0xdbc09[_0x55fc('0x41')]=_0x4d8c17[_0x55fc('0x41')];_0xdbc09['outboundUnknownCallsDay']=_0x4d8c17[_0x55fc('0x42')];_0xdbc09[_0x55fc('0x43')]=_0x4d8c17[_0x55fc('0x43')];_0xdbc09[_0x55fc('0x44')]=_0x4d8c17['predictiveIntervalAvgHoldtime'];_0xdbc09[_0x55fc('0x45')]=_0x4d8c17['predictiveIntervalAvgTalktime'];_0xdbc09[_0x55fc('0x46')]=_0x4d8c17[_0x55fc('0x46')];_0xdbc09[_0x55fc('0x47')]=_0x4d8c17['predictiveIntervalDroppedCallsTimeout'];_0xdbc09[_0x55fc('0x48')]=_0x4d8c17[_0x55fc('0x48')];_0xdbc09[_0x55fc('0x49')]=_0x4d8c17[_0x55fc('0x49')];_0xdbc09[_0x55fc('0x4a')]=_0x4d8c17[_0x55fc('0x4a')];_0xdbc09[_0x55fc('0x4b')]=_0x4d8c17[_0x55fc('0x4b')];_0xdbc09[_0x55fc('0x4c')]=_0x4d8c17[_0x55fc('0x4c')];_0xdbc09[_0x55fc('0x4d')]=_0x4d8c17[_0x55fc('0x4d')];_0xdbc09[_0x55fc('0x4e')]=_0x4d8c17['predictiveIntervalTotalCalls'];_0xdbc09['message']=_0x4d8c17['message'];_0xdbc09['originated']=_0x4d8c17[_0x55fc('0x4f')];_0xdbc09[_0x55fc('0x50')]=_0x4d8c17['erlangCalls'];_0xdbc09[_0x55fc('0x51')]=_0x4d8c17['erlangCallToSecond'];_0xdbc09[_0x55fc('0x52')]=_0x4d8c17[_0x55fc('0x52')];_0xdbc09[_0x55fc('0x53')]=_0x4d8c17[_0x55fc('0x53')];_0xdbc09[_0x55fc('0x54')]=_0x4d8c17['startPredictive'];_0xdbc09[_0x55fc('0x55')]=_0x4d8c17[_0x55fc('0x55')];}if(_0x4d8c17[_0x55fc('0x56')]){_0xdbc09['Trunk']={'id':_0x4d8c17[_0x55fc('0x56')]['id'],'name':_0x4d8c17[_0x55fc('0x56')][_0x55fc('0x23')],'active':_0x4d8c17['Trunk']['active'],'callerid':_0x4d8c17[_0x55fc('0x56')][_0x55fc('0x57')]};}if(_0x4d8c17[_0x55fc('0x58')]){_0xdbc09[_0x55fc('0x58')]={'id':_0x4d8c17[_0x55fc('0x58')]['id'],'name':_0x4d8c17[_0x55fc('0x58')][_0x55fc('0x23')]};}_0x44eec9[_0x55fc('0x59')](_0xdbc09);}}_0x166f26({'count':_0x44eec9[_0x55fc('0x5a')],'rows':_0x44eec9});});},'VoiceChannels':function(_0x44b8a3){return new Promise(function(_0x1af7c0,_0xb57e27){var _0x3c76c3=_[_0x55fc('0x5b')](_0x344d8a[_0x55fc('0x5c')]);_0x1af7c0({'count':_0x3c76c3[_0x55fc('0x5a')],'rows':_0x3c76c3});});},'VoiceChannelMixMonitor':function(_0x5a47f6){var _0x5e6393=this;return new Promise(function(_0x4be0c0,_0x33bfd2){if(ami[_0x55fc('0x10')]()==![]){return _0x33bfd2(_0x5e6393[_0x55fc('0x11')](0x1f4,[config[_0x55fc('0x12')]['ip'],config[_0x55fc('0x12')][_0x55fc('0x13')],_0x55fc('0x14')]['join']('\x20')));}var _0x5c2fc3=schema(properties[_0x55fc('0x5d')])[_0x55fc('0x2')](_0x5a47f6);if(_0x5c2fc3[_0x55fc('0x5a')]>0x0){return _0x33bfd2(_0x5e6393[_0x55fc('0x11')](0x1f4,_['map'](_0x5c2fc3,'message')[_0x55fc('0x15')](',\x20')));}var _0x2ee88c=_[_0x55fc('0x5e')](_0x344d8a[_0x55fc('0x5c')],{'uniqueid':_0x5a47f6['uniqueid']});if(_0x2ee88c&&_0x2ee88c[_0x55fc('0x5f')]){var _0x11e586=util[_0x55fc('0x9')](_0x55fc('0x60'),_0x5a47f6['filename']||_0x5a47f6['uniqueid'],_0x5a47f6[_0x55fc('0x9')]||_0x55fc('0x61'));return ami[_0x55fc('0x1f')]({'action':_0x55fc('0x62'),'channel':_0x2ee88c[_0x55fc('0x5f')],'file':_0x11e586,'options':_0x55fc('0x63')})[_0x55fc('0x64')](function(_0x2f75cf){var _0x5cf7e6=_[_0x55fc('0x5e')](_0x2ee88c[_0x55fc('0x65')],{'filename':_0x55fc('0x66')+_0x11e586['toLowerCase']()});if(_[_0x55fc('0x67')](_0x5cf7e6)){_0x2ee88c[_0x55fc('0x65')][_0x55fc('0x59')]({'filename':_0x55fc('0x66')+_0x11e586[_0x55fc('0x68')](),'createdAt':moment()[_0x55fc('0x9')](_0x55fc('0x69')),'mixmonitorid':_0x2f75cf[_0x55fc('0x6a')],'status':_0x55fc('0x6b')});}else{_0x5cf7e6[_0x55fc('0x6a')]=_0x2f75cf[_0x55fc('0x6a')];_0x5cf7e6['status']=_0x55fc('0x6b');}_0x4be0c0({'code':0xc8,'message':[_0x5a47f6[_0x55fc('0x6c')],_0x55fc('0x6d'),_0x2f75cf[_0x55fc('0x6a')]][_0x55fc('0x15')]('\x20'),'mixmonitorid':_0x2f75cf[_0x55fc('0x6a')]});})['catch'](function(_0x2f580c){_0x33bfd2(_0x5e6393[_0x55fc('0x11')](0x1f5,[_0x5a47f6[_0x55fc('0x6c')],_0x2f580c[_0x55fc('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x33bfd2(_0x5e6393[_0x55fc('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5b475f){var _0x20e467=this;return new Promise(function(_0x4cc2a9,_0x3e8795){if(ami[_0x55fc('0x10')]()==![]){return _0x3e8795(_0x20e467[_0x55fc('0x11')](0x1f4,[config[_0x55fc('0x12')]['ip'],config[_0x55fc('0x12')][_0x55fc('0x13')],'ami\x20disconnected'][_0x55fc('0x15')]('\x20')));}var _0x10818f=schema(properties[_0x55fc('0x5d')])[_0x55fc('0x2')](_0x5b475f);if(_0x10818f[_0x55fc('0x5a')]>0x0){return _0x3e8795(_0x20e467[_0x55fc('0x11')](0x1f4,_[_0x55fc('0x6e')](_0x10818f,_0x55fc('0x1c'))[_0x55fc('0x15')](',\x20')));}var _0x131baf=_[_0x55fc('0x5e')](_0x344d8a[_0x55fc('0x5c')],{'uniqueid':_0x5b475f[_0x55fc('0x6c')]});if(_0x131baf){return BPromise[_0x55fc('0x6f')]()['then'](function(){if(_0x131baf[_0x55fc('0x5f')]){return ami['Action']({'action':_0x55fc('0x70'),'channel':_0x131baf[_0x55fc('0x5f')],'mixmonitorid':_0x5b475f['mixmonitorid']})[_0x55fc('0x1b')](function(_0x424b22){});}})['then'](function(){if(_0x131baf['destinationchannel']){return ami[_0x55fc('0x1f')]({'action':_0x55fc('0x70'),'channel':_0x131baf[_0x55fc('0x71')],'mixmonitorid':_0x5b475f['mixmonitorid']})[_0x55fc('0x1b')](function(_0x1d395d){});}})[_0x55fc('0x64')](function(_0x5cf111){var _0x5cb073=_[_0x55fc('0x5e')](_0x131baf[_0x55fc('0x65')],{'mixmonitorid':_0x5b475f[_0x55fc('0x6a')]});if(_0x5cb073){_0x5cb073[_0x55fc('0x72')]='stop';}})[_0x55fc('0x64')](function(){var _0x9636a1=util[_0x55fc('0x9')](_0x55fc('0x60'),_0x5b475f[_0x55fc('0x73')]||_0x5b475f['uniqueid'],_0x5b475f[_0x55fc('0x9')]||_0x55fc('0x61'));var _0x511b32=_[_0x55fc('0x5e')](_0x131baf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x9636a1[_0x55fc('0x68')]()});if(_0x511b32){_0x511b32['status']='stop';}})['then'](function(){_0x4cc2a9({'code':0xc8,'message':[_0x5b475f[_0x55fc('0x6c')],_0x55fc('0x74')][_0x55fc('0x15')]('\x20')});})['catch'](function(_0x5bf625){_0x3e8795(_0x20e467['error'](0x1f5,[_0x5b475f['uniqueid'],_0x5bf625[_0x55fc('0x1c')][_0x55fc('0x68')]()][_0x55fc('0x15')]('\x20')));});}else{return _0x3e8795(_0x20e467[_0x55fc('0x11')](0x1f5,_0x55fc('0x75')));}});},'VoiceQueuesChannels':function(_0x19f946){return new Promise(function(_0x12f2ad,_0x583a7e){var _0x367141=_[_0x55fc('0x5b')](_0x344d8a[_0x55fc('0x76')]);_0x12f2ad({'count':_0x367141[_0x55fc('0x5a')],'rows':_0x367141});});},'VoiceQueuesChannel':function(_0x1d8d4f){var _0x1304f4=this;return new Promise(function(_0x225d57,_0x447d25){var _0x1c79b6=schema(properties[_0x55fc('0x77')])['validate'](_0x1d8d4f);if(_0x1c79b6[_0x55fc('0x5a')]>0x0){return _0x447d25(_0x1304f4[_0x55fc('0x11')](0x1f4,_[_0x55fc('0x6e')](_0x1c79b6,_0x55fc('0x1c'))[_0x55fc('0x15')](',\x20')));}var _0xbbb13=_['find'](_0x344d8a[_0x55fc('0x76')],{'uniqueid':_0x1d8d4f[_0x55fc('0x6c')]});if(_0xbbb13){_0x225d57(_0xbbb13);}else{return _0x447d25(_0x1304f4['error'](0x1f5,_0x55fc('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x332a97){var _0x5845f5=this;return new Promise(function(_0x5f52a3,_0x14f052){if(ami[_0x55fc('0x10')]()==![]){return _0x14f052(_0x5845f5[_0x55fc('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x55fc('0x12')][_0x55fc('0x13')],'ami\x20disconnected'][_0x55fc('0x15')]('\x20')));}var _0x4bad7e=schema(properties[_0x55fc('0x78')])['validate'](_0x332a97);if(_0x4bad7e[_0x55fc('0x5a')]>0x0){return _0x14f052(_0x5845f5['error'](0x1f4,_['map'](_0x4bad7e,_0x55fc('0x1c'))[_0x55fc('0x15')](',\x20')));}var _0x2ef7e0=_['find'](_0x344d8a[_0x55fc('0x76')],{'uniqueid':_0x332a97['uniqueid']});if(_0x2ef7e0&&_0x2ef7e0[_0x55fc('0x5f')]){return ami[_0x55fc('0x1f')]({'action':_0x55fc('0x79'),'channel':_0x2ef7e0['channel']})['then'](function(_0x5bb94c){_0x5f52a3({'code':0xc8,'message':[_0x332a97['uniqueid'],_0x5bb94c['message']['toLowerCase']()][_0x55fc('0x15')]('\x20')});})[_0x55fc('0x1b')](function(_0x4ce5dc){_0x14f052(_0x5845f5[_0x55fc('0x11')](0x1f5,[_0x332a97['uniqueid'],_0x4ce5dc['message']['toLowerCase']()][_0x55fc('0x15')]('\x20')));});}else{return _0x14f052(_0x5845f5['error'](0x1f5,_0x55fc('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x1860f1){var _0x45e333=this;return new Promise(function(_0x586c34,_0x2de123){if(ami['isConnected']()==![]){return _0x2de123(_0x45e333[_0x55fc('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x55fc('0x12')]['username'],_0x55fc('0x14')]['join']('\x20')));}var _0x290e3f=schema(properties[_0x55fc('0x7a')])['validate'](_0x1860f1);if(_0x290e3f['length']>0x0){return _0x2de123(_0x45e333[_0x55fc('0x11')](0x1f4,_[_0x55fc('0x6e')](_0x290e3f,_0x55fc('0x1c'))[_0x55fc('0x15')](',\x20')));}var _0x40f199=_['find'](_0x344d8a[_0x55fc('0x76')],{'uniqueid':_0x1860f1[_0x55fc('0x6c')]});if(_0x40f199&&_0x40f199[_0x55fc('0x5f')]){return ami[_0x55fc('0x1f')]({'action':'Redirect','channel':_0x40f199[_0x55fc('0x5f')],'exten':_0x1860f1['exten'],'context':_0x1860f1[_0x55fc('0x7b')]||_0x40f199[_0x55fc('0x7b')],'priority':0x1})[_0x55fc('0x64')](function(_0x524c74){_0x586c34({'code':0xc8,'message':[_0x1860f1[_0x55fc('0x6c')],_0x524c74[_0x55fc('0x1c')]['toLowerCase']()]['join']('\x20')});})[_0x55fc('0x1b')](function(_0x1b6cd0){_0x2de123(_0x45e333['error'](0x1f5,[_0x1860f1[_0x55fc('0x6c')],_0x1b6cd0[_0x55fc('0x1c')][_0x55fc('0x68')]()][_0x55fc('0x15')]('\x20')));});}else{return _0x2de123(_0x45e333[_0x55fc('0x11')](0x1f5,_0x55fc('0x75')));}});},'Agents':function(_0x5228ab){return new Promise(function(_0x389648,_0x22215c){var _0x2e792f=_[_0x55fc('0x5b')](_0x344d8a[_0x55fc('0xf')]);_0x389648({'count':_0x2e792f[_0x55fc('0x5a')],'rows':_0x2e792f});});},'Telephones':function(_0x14bf5c){return new Promise(function(_0x514fca,_0x15cf92){var _0x328f9d=_[_0x55fc('0x5b')](_0x344d8a['telephones']);_0x514fca({'count':_0x328f9d['length'],'rows':_0x328f9d});});},'Trunks':function(_0x3030b1){return new Promise(function(_0x34c7f3,_0x126663){var _0x2e542f=_['values'](_0x344d8a[_0x55fc('0x7c')]);_0x34c7f3({'count':_0x2e542f[_0x55fc('0x5a')],'rows':_0x2e542f});});},'OutboundChannels':function(_0x17c5f6){return new Promise(function(_0x42f8ec,_0x5d5270){var _0x39c24c=_[_0x55fc('0x5b')](_0x344d8a['outboundChannels']);_0x42f8ec({'count':_0x39c24c['length'],'rows':_0x39c24c});});},'Outbound':function(_0xba9f58){return new Promise(function(_0x371568,_0x33a949){_0x371568(_0x344d8a['outbound']);});},'Campaigns':function(_0x5f4333){return new Promise(function(_0x27f9a5,_0x1c668d){var _0x50b57d=_[_0x55fc('0x5b')](_0x344d8a[_0x55fc('0x7d')]);_0x27f9a5({'count':_0x50b57d[_0x55fc('0x5a')],'rows':_0x50b57d});});},'VoiceQueuesPreview':function(_0x2e1537){var _0x27d706=this;return new Promise(function(_0x194d42,_0x22b7d8){_0xbcc938[_0x55fc('0x7e')](_0x2e1537['id'])[_0x55fc('0x64')](function(_0x57f17f){_0x194d42({'code':0xc8,'message':_0x57f17f['message']});})[_0x55fc('0x1b')](function(_0x5a415c){_0x22b7d8(_0x27d706[_0x55fc('0x11')](0x1f4,_0x5a415c[_0x55fc('0x1c')]));});});},'EventManager':function(_0x46565f){var _0x35bf0a=this;return new Promise(function(_0x5471d7,_0x1c7222){if(!_0x46565f[_0x55fc('0x7f')]){return _0x1c7222(_0x35bf0a['error'](0x1f4,_0x55fc('0x80')));}ami['emit']('custom:'+_0x46565f[_0x55fc('0x7f')],_0x46565f[_0x55fc('0x1c')]);_0x5471d7({'code':0xc8,'message':_0x46565f});});},'FaxAccounts':function(_0x252af6){return new Promise(function(_0x1f1259,_0xf671d3){var _0x383766=_[_0x55fc('0x5b')](_0x344d8a[_0x55fc('0x81')]);_0x1f1259({'count':_0x383766['length'],'rows':_0x383766});});},'SendFax':function(_0x11d08b){var _0x423921=this;return new Promise(function(_0x25e31a,_0x31b0a9){_0x884b47[_0x55fc('0x82')](_0x11d08b)[_0x55fc('0x64')](function(_0x30c72a){_0x25e31a({'code':0xc8,'message':_0x30c72a[_0x55fc('0x1c')]});})[_0x55fc('0x1b')](function(_0x13307f){_0x31b0a9(_0x423921[_0x55fc('0x11')](0x1f4,_0x13307f['message']));});});},'CheckAfterSend':function(_0x3fa663){var _0x2b0847=this;return new Promise(function(_0x4dcd39,_0x29716e){_0x884b47[_0x55fc('0x83')](_0x3fa663)['then'](function(_0x57f0f9){_0x4dcd39({'code':0xc8,'message':_0x57f0f9[_0x55fc('0x1c')]});})[_0x55fc('0x1b')](function(_0x27c6ad){_0x29716e(_0x2b0847[_0x55fc('0x11')](0x1f4,_0x27c6ad[_0x55fc('0x1c')]));});});}};var _0x923aa3=jayson['server'](_0xe91a8c)['http']();_0x923aa3['on'](_0x55fc('0x11'),function(_0x363cd9){return _0x465c94(_0x363cd9);});_0x923aa3[_0x55fc('0x8')](0x232a,_0x55fc('0x84'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3552e2(_0x55fc('0x85')+0x232a);});});}; \ No newline at end of file +var _0x2d86=['type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','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','Interval','push','length','voicechannel','map','find','channels','channel','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','status','rec','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','validate','resolve','destinationchannel','StopMixMonitor','monitors','wav','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','checkAfterSend','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../properties','../ami','format','SIP','name','timers','updateAcw','agents','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','action','Action','message','error','Command','then','content','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x2d86,0x1ee));var _0x62d8=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x2d86[_0x1911ed];return _0x11edaa;};'use strict';var _=require(_0x62d8('0x0'));var util=require(_0x62d8('0x1'));var jayson=require(_0x62d8('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x62d8('0x3'));var config=require(_0x62d8('0x4'));var properties=require(_0x62d8('0x5'));var ami=require(_0x62d8('0x6'));exports['listen']=function(_0xc3d5db,_0x1dd569,_0x3570c0){return new BPromise(function(_0x264eaf,_0x59b1fc){var _0x4c909d={'QueuePause':function(_0x3ac6b3){return new Promise(function(_0x590f52,_0x232a16){var _0x3d4d38=util[_0x62d8('0x7')]('%s/%s',_0x62d8('0x8'),_0x3ac6b3[_0x62d8('0x9')]);if(_0xc3d5db[_0x62d8('0xa')]&&_0xc3d5db['timers'][_0x3d4d38]&&_0xc3d5db[_0x62d8('0xa')][_0x3d4d38]['timer']){_0xc3d5db[_0x62d8('0xa')][_0x3d4d38][_0x62d8('0xb')]();}if(_0xc3d5db[_0x62d8('0xc')][_0x3d4d38]){_0xc3d5db[_0x62d8('0xc')][_0x3d4d38]['updateStatusRealtime']({'statePause':_0x3ac6b3[_0x62d8('0xd')]?!![]:![]});}_0x590f52({'code':0xc8,'message':_0x62d8('0xe')});});},'Reload':function(_0xa58b9a){var _0x45146c=this;return new Promise(function(_0xe6604,_0x44151e){if(ami[_0x62d8('0xf')]()==![]){return _0x44151e(_0x45146c['error'](0x1f4,[config[_0x62d8('0x10')]['ip'],config['asterisk'][_0x62d8('0x11')],_0x62d8('0x12')][_0x62d8('0x13')]('\x20')));}_0xa58b9a=_[_0x62d8('0x14')](_0xa58b9a,_['keys'](properties['module']));_0xa58b9a[_0x62d8('0x15')]='Reload';return ami[_0x62d8('0x16')](_0xa58b9a)['then'](function(_0x502e21){_0xe6604({'code':0xc8,'message':_0x502e21[_0x62d8('0x17')]});})['catch'](function(_0x4486dd){_0x44151e(_0x45146c[_0x62d8('0x18')](0x1f5,_0x4486dd[_0x62d8('0x17')]));});});},'Command':function(_0x33e029){var _0x1b0aa2=this;return new Promise(function(_0x529a63,_0x1feacf){if(ami[_0x62d8('0xf')]()==![]){return _0x1feacf(_0x1b0aa2[_0x62d8('0x18')](0x1f4,[config[_0x62d8('0x10')]['ip'],config[_0x62d8('0x10')][_0x62d8('0x11')],'ami\x20disconnected'][_0x62d8('0x13')]('\x20')));}_0x33e029=_[_0x62d8('0x14')](_0x33e029,'command');_0x33e029[_0x62d8('0x15')]=_0x62d8('0x19');return ami[_0x62d8('0x16')](_0x33e029)[_0x62d8('0x1a')](function(_0x3d18d3){_0x529a63({'code':0xc8,'message':_0x3d18d3[_0x62d8('0x1b')]});})['catch'](function(_0x18b98f){_0x1feacf(_0x1b0aa2[_0x62d8('0x18')](0x1f5,_0x18b98f[_0x62d8('0x17')]));});});},'VoiceQueues':function(_0x448552){return new Promise(function(_0x1e5479,_0x2f90b3){var _0x25918c=[];for(var _0x1c84e6 in _0xc3d5db['voiceQueues']){if(_0xc3d5db[_0x62d8('0x1c')][_0x62d8('0x1d')](_0x1c84e6)){var _0x23fab3=_0xc3d5db[_0x62d8('0x1c')][_0x1c84e6];var _0x26d8c0={'id':_0x23fab3['id'],'name':_0x23fab3[_0x62d8('0x9')],'strategy':_0x23fab3[_0x62d8('0x1e')],'answered':_0x23fab3[_0x62d8('0x1f')],'available':_0x23fab3[_0x62d8('0x20')],'loggedIn':_0x23fab3['loggedIn'],'pTalking':_0x23fab3[_0x62d8('0x21')],'sumBillable':_0x23fab3[_0x62d8('0x22')],'sumDuration':_0x23fab3[_0x62d8('0x23')],'sumHoldTime':_0x23fab3[_0x62d8('0x24')]||0x0,'talking':_0x23fab3[_0x62d8('0x25')],'total':_0x23fab3['total'],'type':_0x23fab3[_0x62d8('0x26')],'unmanaged':_0x23fab3[_0x62d8('0x27')],'abandoned':_0x23fab3['abandoned'],'waiting':_0x23fab3[_0x62d8('0x28')],'loggedInDb':_0x23fab3[_0x62d8('0x29')]};if(_0x23fab3[_0x62d8('0x26')]==='outbound'){_0x26d8c0[_0x62d8('0x2a')]=_0x23fab3['dialActive'];_0x26d8c0[_0x62d8('0x2b')]=_0x23fab3[_0x62d8('0x2b')];_0x26d8c0[_0x62d8('0x2c')]=_0x23fab3[_0x62d8('0x2c')];_0x26d8c0[_0x62d8('0x2d')]=_0x23fab3[_0x62d8('0x2d')];_0x26d8c0[_0x62d8('0x2e')]=_0x23fab3['dialOriginateTimeout'];_0x26d8c0[_0x62d8('0x2f')]=_0x23fab3[_0x62d8('0x2f')];_0x26d8c0['outboundAnswerAgiCallsDay']=_0x23fab3['outboundAnswerAgiCallsDay'];_0x26d8c0[_0x62d8('0x30')]=_0x23fab3[_0x62d8('0x30')];_0x26d8c0['outboundBlacklistCallsDay']=_0x23fab3[_0x62d8('0x31')];_0x26d8c0['outboundBusyCallsDay']=_0x23fab3[_0x62d8('0x32')];_0x26d8c0['outboundCongestionCallsDay']=_0x23fab3[_0x62d8('0x33')];_0x26d8c0['outboundDropCallsDayACS']=_0x23fab3[_0x62d8('0x34')];_0x26d8c0[_0x62d8('0x35')]=_0x23fab3[_0x62d8('0x35')];_0x26d8c0[_0x62d8('0x36')]=_0x23fab3[_0x62d8('0x36')];_0x26d8c0[_0x62d8('0x37')]=_0x23fab3[_0x62d8('0x37')];_0x26d8c0[_0x62d8('0x38')]=_0x23fab3[_0x62d8('0x38')];_0x26d8c0[_0x62d8('0x39')]=_0x23fab3[_0x62d8('0x39')];_0x26d8c0[_0x62d8('0x3a')]=_0x23fab3['outboundReCallsDay'];_0x26d8c0[_0x62d8('0x3b')]=_0x23fab3[_0x62d8('0x3b')];_0x26d8c0[_0x62d8('0x3c')]=_0x23fab3[_0x62d8('0x3c')];_0x26d8c0[_0x62d8('0x3d')]=_0x23fab3['predictiveIntervalAnsweredCalls'];_0x26d8c0['predictiveIntervalAvgHoldtime']=_0x23fab3[_0x62d8('0x3e')];_0x26d8c0[_0x62d8('0x3f')]=_0x23fab3['predictiveIntervalAvgTalktime'];_0x26d8c0[_0x62d8('0x40')]=_0x23fab3[_0x62d8('0x40')];_0x26d8c0[_0x62d8('0x41')]=_0x23fab3[_0x62d8('0x41')];_0x26d8c0[_0x62d8('0x42')]=_0x23fab3['predictiveIntervalErlangCalls'];_0x26d8c0[_0x62d8('0x43')]=_0x23fab3[_0x62d8('0x43')];_0x26d8c0[_0x62d8('0x44')]=_0x23fab3[_0x62d8('0x44')];_0x26d8c0[_0x62d8('0x45')]=_0x23fab3[_0x62d8('0x45')];_0x26d8c0[_0x62d8('0x46')]=_0x23fab3[_0x62d8('0x46')];_0x26d8c0[_0x62d8('0x47')]=_0x23fab3['predictiveIntervalAvailable'];_0x26d8c0[_0x62d8('0x48')]=_0x23fab3['predictiveIntervalTotalCalls'];_0x26d8c0['message']=_0x23fab3[_0x62d8('0x17')];_0x26d8c0[_0x62d8('0x49')]=_0x23fab3['originated'];_0x26d8c0[_0x62d8('0x4a')]=_0x23fab3['erlangCalls'];_0x26d8c0['erlangCallToSecond']=_0x23fab3[_0x62d8('0x4b')];_0x26d8c0[_0x62d8('0x4c')]=_0x23fab3[_0x62d8('0x4c')];_0x26d8c0[_0x62d8('0x4d')]=_0x23fab3[_0x62d8('0x4d')];_0x26d8c0[_0x62d8('0x4e')]=_0x23fab3['startPredictive'];_0x26d8c0[_0x62d8('0x4f')]=_0x23fab3[_0x62d8('0x4f')];}if(_0x23fab3[_0x62d8('0x50')]){_0x26d8c0['Trunk']={'id':_0x23fab3[_0x62d8('0x50')]['id'],'name':_0x23fab3[_0x62d8('0x50')][_0x62d8('0x9')],'active':_0x23fab3[_0x62d8('0x50')][_0x62d8('0x51')],'callerid':_0x23fab3[_0x62d8('0x50')]['callerid']};}if(_0x23fab3[_0x62d8('0x52')]){_0x26d8c0['Interval']={'id':_0x23fab3['Interval']['id'],'name':_0x23fab3[_0x62d8('0x52')]['name']};}_0x25918c[_0x62d8('0x53')](_0x26d8c0);}}_0x1e5479({'count':_0x25918c['length'],'rows':_0x25918c});});},'VoiceChannels':function(_0x3cac60){return new Promise(function(_0x156345,_0xfc60f8){var _0x2499a4=_['values'](_0xc3d5db['channels']);_0x156345({'count':_0x2499a4[_0x62d8('0x54')],'rows':_0x2499a4});});},'VoiceChannelMixMonitor':function(_0x29b0a6){var _0x397bc8=this;return new Promise(function(_0x5f549a,_0x52c284){if(ami[_0x62d8('0xf')]()==![]){return _0x52c284(_0x397bc8[_0x62d8('0x18')](0x1f4,[config[_0x62d8('0x10')]['ip'],config[_0x62d8('0x10')][_0x62d8('0x11')],_0x62d8('0x12')][_0x62d8('0x13')]('\x20')));}var _0x4e226d=schema(properties[_0x62d8('0x55')])['validate'](_0x29b0a6);if(_0x4e226d[_0x62d8('0x54')]>0x0){return _0x52c284(_0x397bc8[_0x62d8('0x18')](0x1f4,_[_0x62d8('0x56')](_0x4e226d,_0x62d8('0x17'))[_0x62d8('0x13')](',\x20')));}var _0x129bd7=_[_0x62d8('0x57')](_0xc3d5db[_0x62d8('0x58')],{'uniqueid':_0x29b0a6['uniqueid']});if(_0x129bd7&&_0x129bd7[_0x62d8('0x59')]){var _0x3a0dd9=util[_0x62d8('0x7')](_0x62d8('0x5a'),_0x29b0a6[_0x62d8('0x5b')]||_0x29b0a6[_0x62d8('0x5c')],_0x29b0a6[_0x62d8('0x7')]||'wav');return ami['Action']({'action':_0x62d8('0x5d'),'channel':_0x129bd7[_0x62d8('0x59')],'file':_0x3a0dd9,'options':_0x62d8('0x5e')})[_0x62d8('0x1a')](function(_0x7a9800){var _0x1b947f=_[_0x62d8('0x57')](_0x129bd7['monitors'],{'filename':_0x62d8('0x5f')+_0x3a0dd9[_0x62d8('0x60')]()});if(_['isNil'](_0x1b947f)){_0x129bd7['monitors'][_0x62d8('0x53')]({'filename':_0x62d8('0x5f')+_0x3a0dd9[_0x62d8('0x60')](),'createdAt':moment()[_0x62d8('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x7a9800[_0x62d8('0x61')],'status':'rec'});}else{_0x1b947f[_0x62d8('0x61')]=_0x7a9800[_0x62d8('0x61')];_0x1b947f[_0x62d8('0x62')]=_0x62d8('0x63');}_0x5f549a({'code':0xc8,'message':[_0x29b0a6[_0x62d8('0x5c')],_0x62d8('0x64'),_0x7a9800[_0x62d8('0x61')]]['join']('\x20'),'mixmonitorid':_0x7a9800[_0x62d8('0x61')]});})[_0x62d8('0x65')](function(_0x1d5564){_0x52c284(_0x397bc8['error'](0x1f5,[_0x29b0a6[_0x62d8('0x5c')],_0x1d5564[_0x62d8('0x17')][_0x62d8('0x60')]()]['join']('\x20')));});}else{return _0x52c284(_0x397bc8[_0x62d8('0x18')](0x1f5,_0x62d8('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x325790){var _0x2e894e=this;return new Promise(function(_0x24ca07,_0x199045){if(ami['isConnected']()==![]){return _0x199045(_0x2e894e['error'](0x1f4,[config[_0x62d8('0x10')]['ip'],config[_0x62d8('0x10')][_0x62d8('0x11')],_0x62d8('0x12')]['join']('\x20')));}var _0x24a3d9=schema(properties['voicechannel'])[_0x62d8('0x67')](_0x325790);if(_0x24a3d9['length']>0x0){return _0x199045(_0x2e894e[_0x62d8('0x18')](0x1f4,_[_0x62d8('0x56')](_0x24a3d9,_0x62d8('0x17'))[_0x62d8('0x13')](',\x20')));}var _0x5a37db=_[_0x62d8('0x57')](_0xc3d5db['channels'],{'uniqueid':_0x325790['uniqueid']});if(_0x5a37db){return BPromise[_0x62d8('0x68')]()[_0x62d8('0x1a')](function(){if(_0x5a37db['channel']){return ami[_0x62d8('0x16')]({'action':'StopMixMonitor','channel':_0x5a37db[_0x62d8('0x59')],'mixmonitorid':_0x325790[_0x62d8('0x61')]})[_0x62d8('0x65')](function(_0x4f2ebe){});}})[_0x62d8('0x1a')](function(){if(_0x5a37db[_0x62d8('0x69')]){return ami[_0x62d8('0x16')]({'action':_0x62d8('0x6a'),'channel':_0x5a37db[_0x62d8('0x69')],'mixmonitorid':_0x325790[_0x62d8('0x61')]})['catch'](function(_0x18887e){});}})['then'](function(_0xe9f130){var _0xcc62c1=_[_0x62d8('0x57')](_0x5a37db[_0x62d8('0x6b')],{'mixmonitorid':_0x325790['mixmonitorid']});if(_0xcc62c1){_0xcc62c1[_0x62d8('0x62')]='stop';}})[_0x62d8('0x1a')](function(){var _0x432a1f=util[_0x62d8('0x7')]('%s.%s',_0x325790[_0x62d8('0x5b')]||_0x325790['uniqueid'],_0x325790[_0x62d8('0x7')]||_0x62d8('0x6c'));var _0x3bc03c=_[_0x62d8('0x57')](_0x5a37db['monitors'],{'filename':_0x62d8('0x5f')+_0x432a1f[_0x62d8('0x60')]()});if(_0x3bc03c){_0x3bc03c['status']=_0x62d8('0x6d');}})[_0x62d8('0x1a')](function(){_0x24ca07({'code':0xc8,'message':[_0x325790[_0x62d8('0x5c')],_0x62d8('0x6e')][_0x62d8('0x13')]('\x20')});})[_0x62d8('0x65')](function(_0x42be06){_0x199045(_0x2e894e[_0x62d8('0x18')](0x1f5,[_0x325790[_0x62d8('0x5c')],_0x42be06[_0x62d8('0x17')][_0x62d8('0x60')]()][_0x62d8('0x13')]('\x20')));});}else{return _0x199045(_0x2e894e[_0x62d8('0x18')](0x1f5,_0x62d8('0x66')));}});},'VoiceQueuesChannels':function(_0xabd4ab){return new Promise(function(_0x8dd71a,_0x13c05f){var _0x3a2483=_[_0x62d8('0x6f')](_0xc3d5db[_0x62d8('0x70')]);_0x8dd71a({'count':_0x3a2483[_0x62d8('0x54')],'rows':_0x3a2483});});},'VoiceQueuesChannel':function(_0x265ef8){var _0x48d015=this;return new Promise(function(_0x31cbb3,_0x4031d7){var _0xfa4f53=schema(properties[_0x62d8('0x71')])['validate'](_0x265ef8);if(_0xfa4f53[_0x62d8('0x54')]>0x0){return _0x4031d7(_0x48d015[_0x62d8('0x18')](0x1f4,_[_0x62d8('0x56')](_0xfa4f53,'message')[_0x62d8('0x13')](',\x20')));}var _0x5c58ac=_[_0x62d8('0x57')](_0xc3d5db[_0x62d8('0x70')],{'uniqueid':_0x265ef8[_0x62d8('0x5c')]});if(_0x5c58ac){_0x31cbb3(_0x5c58ac);}else{return _0x4031d7(_0x48d015[_0x62d8('0x18')](0x1f5,_0x62d8('0x66')));}});},'VoiceQueuesChannelHangup':function(_0x5ca456){var _0x1753ec=this;return new Promise(function(_0x47c870,_0x1e5da0){if(ami[_0x62d8('0xf')]()==![]){return _0x1e5da0(_0x1753ec[_0x62d8('0x18')](0x1f4,[config['asterisk']['ip'],config[_0x62d8('0x10')][_0x62d8('0x11')],'ami\x20disconnected'][_0x62d8('0x13')]('\x20')));}var _0x3c47cf=schema(properties[_0x62d8('0x72')])[_0x62d8('0x67')](_0x5ca456);if(_0x3c47cf[_0x62d8('0x54')]>0x0){return _0x1e5da0(_0x1753ec[_0x62d8('0x18')](0x1f4,_[_0x62d8('0x56')](_0x3c47cf,'message')[_0x62d8('0x13')](',\x20')));}var _0x2529de=_['find'](_0xc3d5db[_0x62d8('0x70')],{'uniqueid':_0x5ca456[_0x62d8('0x5c')]});if(_0x2529de&&_0x2529de['channel']){return ami['Action']({'action':_0x62d8('0x73'),'channel':_0x2529de[_0x62d8('0x59')]})['then'](function(_0x34f97d){_0x47c870({'code':0xc8,'message':[_0x5ca456[_0x62d8('0x5c')],_0x34f97d['message'][_0x62d8('0x60')]()][_0x62d8('0x13')]('\x20')});})[_0x62d8('0x65')](function(_0x4283b3){_0x1e5da0(_0x1753ec['error'](0x1f5,[_0x5ca456['uniqueid'],_0x4283b3[_0x62d8('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x1e5da0(_0x1753ec[_0x62d8('0x18')](0x1f5,_0x62d8('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x458233){var _0x4c0fb0=this;return new Promise(function(_0x21982c,_0x4b5450){if(ami[_0x62d8('0xf')]()==![]){return _0x4b5450(_0x4c0fb0[_0x62d8('0x18')](0x1f4,[config[_0x62d8('0x10')]['ip'],config[_0x62d8('0x10')][_0x62d8('0x11')],_0x62d8('0x12')][_0x62d8('0x13')]('\x20')));}var _0x32f45e=schema(properties['voicequeuechannelredirect'])['validate'](_0x458233);if(_0x32f45e[_0x62d8('0x54')]>0x0){return _0x4b5450(_0x4c0fb0[_0x62d8('0x18')](0x1f4,_['map'](_0x32f45e,_0x62d8('0x17'))['join'](',\x20')));}var _0x2f97b0=_[_0x62d8('0x57')](_0xc3d5db[_0x62d8('0x70')],{'uniqueid':_0x458233['uniqueid']});if(_0x2f97b0&&_0x2f97b0[_0x62d8('0x59')]){return ami[_0x62d8('0x16')]({'action':_0x62d8('0x74'),'channel':_0x2f97b0[_0x62d8('0x59')],'exten':_0x458233[_0x62d8('0x75')],'context':_0x458233[_0x62d8('0x76')]||_0x2f97b0[_0x62d8('0x76')],'priority':0x1})[_0x62d8('0x1a')](function(_0x436e45){_0x21982c({'code':0xc8,'message':[_0x458233[_0x62d8('0x5c')],_0x436e45[_0x62d8('0x17')][_0x62d8('0x60')]()]['join']('\x20')});})[_0x62d8('0x65')](function(_0x4e7d86){_0x4b5450(_0x4c0fb0[_0x62d8('0x18')](0x1f5,[_0x458233[_0x62d8('0x5c')],_0x4e7d86[_0x62d8('0x17')][_0x62d8('0x60')]()]['join']('\x20')));});}else{return _0x4b5450(_0x4c0fb0[_0x62d8('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ff6cf){return new Promise(function(_0x1c8b4c,_0x42fc1f){var _0x19f974=_[_0x62d8('0x6f')](_0xc3d5db[_0x62d8('0xc')]);_0x1c8b4c({'count':_0x19f974[_0x62d8('0x54')],'rows':_0x19f974});});},'Telephones':function(_0x4027cf){return new Promise(function(_0x28f6cc,_0x5aec5c){var _0x11af73=_[_0x62d8('0x6f')](_0xc3d5db[_0x62d8('0x77')]);_0x28f6cc({'count':_0x11af73['length'],'rows':_0x11af73});});},'Trunks':function(_0xe6e4ca){return new Promise(function(_0x4e2ed7,_0x30c7f5){var _0x13003d=_['values'](_0xc3d5db['trunks']);_0x4e2ed7({'count':_0x13003d[_0x62d8('0x54')],'rows':_0x13003d});});},'OutboundChannels':function(_0x23e5f8){return new Promise(function(_0x288662,_0x226d36){var _0x1f41ac=_[_0x62d8('0x6f')](_0xc3d5db[_0x62d8('0x78')]);_0x288662({'count':_0x1f41ac[_0x62d8('0x54')],'rows':_0x1f41ac});});},'Outbound':function(_0x1596d3){return new Promise(function(_0x98028c,_0x2a7132){_0x98028c(_0xc3d5db['outbound']);});},'Campaigns':function(_0x226c45){return new Promise(function(_0x266757,_0x2fce5f){var _0x40e57a=_['values'](_0xc3d5db[_0x62d8('0x79')]);_0x266757({'count':_0x40e57a[_0x62d8('0x54')],'rows':_0x40e57a});});},'VoiceQueuesPreview':function(_0x42b40f){var _0xdb6b6e=this;return new Promise(function(_0x2f2899,_0xffebd8){_0x1dd569[_0x62d8('0x7a')](_0x42b40f['id'])['then'](function(_0x98c737){_0x2f2899({'code':0xc8,'message':_0x98c737[_0x62d8('0x17')]});})[_0x62d8('0x65')](function(_0xcdc52d){_0xffebd8(_0xdb6b6e[_0x62d8('0x18')](0x1f4,_0xcdc52d[_0x62d8('0x17')]));});});},'EventManager':function(_0x576072){var _0xf0dbda=this;return new Promise(function(_0x4b97b6,_0x3b9a04){if(!_0x576072[_0x62d8('0x7b')]){return _0x3b9a04(_0xf0dbda[_0x62d8('0x18')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x62d8('0x7c')](_0x62d8('0x7d')+_0x576072[_0x62d8('0x7b')],_0x576072['message']);_0x4b97b6({'code':0xc8,'message':_0x576072});});},'FaxAccounts':function(_0xb93548){return new Promise(function(_0x52653c,_0x5879a2){var _0x58a9eb=_[_0x62d8('0x6f')](_0xc3d5db[_0x62d8('0x7e')]);_0x52653c({'count':_0x58a9eb[_0x62d8('0x54')],'rows':_0x58a9eb});});},'SendFax':function(_0x43c52d){var _0xd2a164=this;return new Promise(function(_0x5c144e,_0x598128){_0x3570c0['send'](_0x43c52d)[_0x62d8('0x1a')](function(_0x4b8635){_0x5c144e({'code':0xc8,'message':_0x4b8635[_0x62d8('0x17')]});})[_0x62d8('0x65')](function(_0x5c6011){_0x598128(_0xd2a164[_0x62d8('0x18')](0x1f4,_0x5c6011['message']));});});},'CheckAfterSend':function(_0x3c0209){var _0x5e7e0f=this;return new Promise(function(_0x500a3c,_0x4fab50){_0x3570c0[_0x62d8('0x7f')](_0x3c0209)['then'](function(_0x196e79){_0x500a3c({'code':0xc8,'message':_0x196e79[_0x62d8('0x17')]});})[_0x62d8('0x65')](function(_0x12b090){_0x4fab50(_0x5e7e0f[_0x62d8('0x18')](0x1f4,_0x12b090[_0x62d8('0x17')]));});});}};var _0x1847a6=jayson['server'](_0x4c909d)[_0x62d8('0x80')]();_0x1847a6['on'](_0x62d8('0x18'),function(_0x47aa9c){return _0x59b1fc(_0x47aa9c);});_0x1847a6[_0x62d8('0x81')](0x232a,'127.0.0.1',function(){console[_0x62d8('0x82')](_0x62d8('0x83'),0x232a);return _0x264eaf(_0x62d8('0x84')+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 da6a3b0..c679157 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 _0x9262=['uniqueid','then','showContact','omit','format','user:%s','name','action','toLowerCase','merge','resolve','catch','Error\x20creating\x20contact','trigger:%s','bluebird','lodash','ioredis','../../../../config/environment','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','routeId','firstName','calleridname','','calleridnum','destcalleridname','destcalleridnum','phone'];(function(_0xbd716f,_0x5eaff5){var _0x215593=function(_0x240400){while(--_0x240400){_0xbd716f['push'](_0xbd716f['shift']());}};_0x215593(++_0x5eaff5);}(_0x9262,0x111));var _0x2926=function(_0x1f5358,_0x459d33){_0x1f5358=_0x1f5358-0x0;var _0x371d0f=_0x9262[_0x1f5358];return _0x371d0f;};'use strict';var BPromise=require(_0x2926('0x0'));var util=require('util');var _=require(_0x2926('0x1'));var Redis=require(_0x2926('0x2'));var config=require(_0x2926('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x2926('0x4'));config[_0x2926('0x5')]=_['defaults'](config[_0x2926('0x5')],{'host':_0x2926('0x6'),'port':0x18eb});var io=require(_0x2926('0x7'))(new Redis(config['redis']));function emit(_0x471dea,_0x4401cd,_0x5d62f2){logger[_0x2926('0x8')](_0x471dea,_0x4401cd,JSON[_0x2926('0x9')](_0x5d62f2));io['to'](_0x471dea)[_0x2926('0xa')](_0x4401cd,_0x5d62f2);}exports[_0x2926('0xb')]=function(_0x1229b0,_0x5e3325,_0x514b87){_0x514b87[_0x2926('0xc')]=0x0;if(_0x5e3325[_0x2926('0xd')]&&parseInt(_0x5e3325[_0x2926('0xd')],0xa)){var _0x11af69={'ListId':parseInt(_0x5e3325[_0x2926('0xe')],0xa),'phone':_0x514b87['calleridnum']};if(_['isNil'](_0x514b87[_0x2926('0xf')])){_0x11af69[_0x2926('0x10')]=_0x514b87[_0x2926('0x11')]&&_0x514b87[_0x2926('0x11')]!==_0x2926('0x12')?_0x514b87['calleridname']:_0x514b87[_0x2926('0x13')]||_0x514b87['uniqueid'];}else{_0x11af69[_0x2926('0x10')]=_0x514b87[_0x2926('0x14')]&&_0x514b87['destcalleridname']!==_0x2926('0x12')?_0x514b87[_0x2926('0x14')]:_0x514b87[_0x2926('0x15')]||_0x514b87['uniqueid'];_0x11af69[_0x2926('0x16')]=_0x514b87[_0x2926('0x14')]&&_0x514b87['destcalleridname']!==_0x2926('0x12')?_0x514b87['destcalleridname']:_0x514b87[_0x2926('0x15')]||_0x514b87[_0x2926('0x17')];}BPromise['resolve']()[_0x2926('0x18')](cmContactRpc[_0x2926('0x19')]({'where':_[_0x2926('0x1a')](_0x11af69,[_0x2926('0x10')])}))[_0x2926('0x18')](function(_0x56d5fb){if(_0x56d5fb){_0x514b87['xmd-contactid2']=_0x56d5fb['id'];emit(util[_0x2926('0x1b')](_0x2926('0x1c'),_0x1229b0[_0x2926('0x1d')]),util[_0x2926('0x1b')]('trigger:%s',_0x5e3325[_0x2926('0x1e')][_0x2926('0x1f')]()),_[_0x2926('0x20')](_0x514b87,{'ListId':parseInt(_0x5e3325[_0x2926('0xe')],0xa)}));return;}else{return BPromise[_0x2926('0x21')]()[_0x2926('0x18')](cmContactRpc['createContact'](_0x11af69));}})[_0x2926('0x18')](function(_0x464d5b){if(_0x464d5b){_0x514b87['xmd-contactid2']=_0x464d5b['id'];emit(util['format']('user:%s',_0x1229b0[_0x2926('0x1d')]),util['format']('trigger:%s',_0x5e3325[_0x2926('0x1e')][_0x2926('0x1f')]()),_[_0x2926('0x20')](_0x514b87,{'ListId':parseInt(_0x5e3325['data1'],0xa)}));}})[_0x2926('0x22')](function(_0x1c3a04){logger['error'](_0x2926('0x23'),JSON['stringify'](_0x1c3a04));});}else{if(_0x1229b0){emit(util[_0x2926('0x1b')](_0x2926('0x1c'),_0x1229b0[_0x2926('0x1d')]),util['format'](_0x2926('0x24'),_0x5e3325[_0x2926('0x1e')][_0x2926('0x1f')]()),_[_0x2926('0x20')]({'ListId':parseInt(_0x5e3325[_0x2926('0xe')],0xa)},_0x514b87));}}}; \ No newline at end of file +var _0xe4af=['showContact','omit','xmd-contactid2','format','user:%s','name','toLowerCase','merge','createContact','trigger:%s','action','catch','error','util','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','calleridname','','destcalleridname','destcalleridnum','uniqueid','phone','resolve','then'];(function(_0xa510e7,_0xe93cfc){var _0x493758=function(_0x39f0fc){while(--_0x39f0fc){_0xa510e7['push'](_0xa510e7['shift']());}};_0x493758(++_0xe93cfc);}(_0xe4af,0xa9));var _0xfe4a=function(_0x11e33e,_0x3fcd0e){_0x11e33e=_0x11e33e-0x0;var _0x4a54dc=_0xe4af[_0x11e33e];return _0x4a54dc;};'use strict';var BPromise=require('bluebird');var util=require(_0xfe4a('0x0'));var _=require('lodash');var Redis=require(_0xfe4a('0x1'));var config=require(_0xfe4a('0x2'));var logger=require(_0xfe4a('0x3'))(_0xfe4a('0x4'));var cmContactRpc=require(_0xfe4a('0x5'));config[_0xfe4a('0x6')]=_[_0xfe4a('0x7')](config['redis'],{'host':_0xfe4a('0x8'),'port':0x18eb});var io=require(_0xfe4a('0x9'))(new Redis(config['redis']));function emit(_0x5fafb9,_0x2f68be,_0x1679ac){logger['info'](_0x5fafb9,_0x2f68be,JSON[_0xfe4a('0xa')](_0x1679ac));io['to'](_0x5fafb9)['emit'](_0x2f68be,_0x1679ac);}exports[_0xfe4a('0xb')]=function(_0xfd3fc9,_0x3aeedb,_0x425605){_0x425605[_0xfe4a('0xc')]=0x0;if(_0x3aeedb[_0xfe4a('0xd')]&&parseInt(_0x3aeedb[_0xfe4a('0xd')],0xa)){var _0x267244={'ListId':parseInt(_0x3aeedb[_0xfe4a('0xe')],0xa),'phone':_0x425605[_0xfe4a('0xf')]};if(_[_0xfe4a('0x10')](_0x425605[_0xfe4a('0x11')])){_0x267244['firstName']=_0x425605['calleridname']&&_0x425605[_0xfe4a('0x12')]!==_0xfe4a('0x13')?_0x425605[_0xfe4a('0x12')]:_0x425605[_0xfe4a('0xf')]||_0x425605['uniqueid'];}else{_0x267244['firstName']=_0x425605['destcalleridname']&&_0x425605['destcalleridname']!==_0xfe4a('0x13')?_0x425605[_0xfe4a('0x14')]:_0x425605[_0xfe4a('0x15')]||_0x425605[_0xfe4a('0x16')];_0x267244[_0xfe4a('0x17')]=_0x425605[_0xfe4a('0x14')]&&_0x425605[_0xfe4a('0x14')]!==_0xfe4a('0x13')?_0x425605[_0xfe4a('0x14')]:_0x425605['destcalleridnum']||_0x425605[_0xfe4a('0x16')];}BPromise[_0xfe4a('0x18')]()[_0xfe4a('0x19')](cmContactRpc[_0xfe4a('0x1a')]({'where':_[_0xfe4a('0x1b')](_0x267244,['firstName'])}))[_0xfe4a('0x19')](function(_0x5d869f){if(_0x5d869f){_0x425605[_0xfe4a('0x1c')]=_0x5d869f['id'];emit(util[_0xfe4a('0x1d')](_0xfe4a('0x1e'),_0xfd3fc9[_0xfe4a('0x1f')]),util[_0xfe4a('0x1d')]('trigger:%s',_0x3aeedb['action'][_0xfe4a('0x20')]()),_[_0xfe4a('0x21')](_0x425605,{'ListId':parseInt(_0x3aeedb[_0xfe4a('0xe')],0xa)}));return;}else{return BPromise[_0xfe4a('0x18')]()[_0xfe4a('0x19')](cmContactRpc[_0xfe4a('0x22')](_0x267244));}})[_0xfe4a('0x19')](function(_0x3c048f){if(_0x3c048f){_0x425605[_0xfe4a('0x1c')]=_0x3c048f['id'];emit(util[_0xfe4a('0x1d')]('user:%s',_0xfd3fc9['name']),util[_0xfe4a('0x1d')](_0xfe4a('0x23'),_0x3aeedb[_0xfe4a('0x24')]['toLowerCase']()),_['merge'](_0x425605,{'ListId':parseInt(_0x3aeedb[_0xfe4a('0xe')],0xa)}));}})[_0xfe4a('0x25')](function(_0x89f152){logger[_0xfe4a('0x26')]('Error\x20creating\x20contact',JSON[_0xfe4a('0xa')](_0x89f152));});}else{if(_0xfd3fc9){emit(util[_0xfe4a('0x1d')]('user:%s',_0xfd3fc9[_0xfe4a('0x1f')]),util[_0xfe4a('0x1d')](_0xfe4a('0x23'),_0x3aeedb[_0xfe4a('0x24')][_0xfe4a('0x20')]()),_[_0xfe4a('0x21')]({'ListId':parseInt(_0x3aeedb['data1'],0xa)},_0x425605));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4e326dd..a9d01aa 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 _0xbe1e=['buildUri','parse','query','search','AllConditions','length','every','checkConditions','some','AnyConditions','channel','field','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','exports','util','url','mustache','./urlforward','./cmContact','./script','../../../config/logger','../ami','redis','defaults','localhost','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','clone','checkTriggers','prototype','agents','status','checkTrigger','merge','variables','Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','data3','data4','location','windowWidth','data5','800','isNil','600','data6','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xbe1e,0xf8));var _0xebe1=function(_0x5cd4b6,_0xed678d){_0x5cd4b6=_0x5cd4b6-0x0;var _0x5c04df=_0xbe1e[_0x5cd4b6];return _0x5c04df;};'use strict';var util=require(_0xebe1('0x0'));var _=require('lodash');var url=require(_0xebe1('0x1'));var Mustache=require(_0xebe1('0x2'));var Redis=require('ioredis');var urlforward=require(_0xebe1('0x3'));var integration=require('./integration');var cmContact=require(_0xebe1('0x4'));var script=require(_0xebe1('0x5'));var cmContactRpc=require('../rpc/cmContact');var config=require('../../../config/environment');var logger=require(_0xebe1('0x6'))('trigger');var ami=require(_0xebe1('0x7'));config[_0xebe1('0x8')]=_[_0xebe1('0x9')](config['redis'],{'host':_0xebe1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebe1('0x8')]));var operators={'equals':function(_0x2a7b52,_0x593938){return _0x2a7b52==_0x593938;},'not_equals':function(_0x530bed,_0x26e929){return _0x530bed!=_0x26e929;}};var barAndWebActions=[_0xebe1('0xb'),_0xebe1('0x1'),_0xebe1('0xc')];function Trigger(_0x1e20ea){this[_0xebe1('0xd')]=_0x1e20ea['triggers'];this['agents']=_0x1e20ea['agents'];this[_0xebe1('0xe')]=_0x1e20ea[_0xebe1('0xe')];this['templates']=_0x1e20ea[_0xebe1('0xf')];this[_0xebe1('0x10')]=_0x1e20ea[_0xebe1('0x10')];this[_0xebe1('0x11')]=_0x1e20ea['zendeskAccounts'];this[_0xebe1('0x12')]=_0x1e20ea[_0xebe1('0x12')];this[_0xebe1('0x13')]=_0x1e20ea[_0xebe1('0x13')];this[_0xebe1('0x14')]=_0x1e20ea[_0xebe1('0x14')];this[_0xebe1('0x15')]=_0x1e20ea[_0xebe1('0x15')];this[_0xebe1('0x16')]=_0x1e20ea[_0xebe1('0x16')];this['vtigerAccounts']=_0x1e20ea[_0xebe1('0x17')];this[_0xebe1('0x18')]=_0x1e20ea['servicenowAccounts'];this[_0xebe1('0x19')]=_0x1e20ea[_0xebe1('0x19')];this[_0xebe1('0x1a')]={'zendesk':this[_0xebe1('0x11')],'salesforce':this[_0xebe1('0x13')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xebe1('0x14')],'zoho':this[_0xebe1('0x15')],'desk':this[_0xebe1('0x16')],'vtiger':this[_0xebe1('0x17')],'servicenow':this[_0xebe1('0x18')],'dynamics365':this[_0xebe1('0x19')]};ami['on']('custom:agentcalled',this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x1d'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x1e'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x1f'),this['syncCustomEvent'][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x20'),this[_0xebe1('0x21')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x22'),this[_0xebe1('0x21')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x23'),this['syncAgentDial'][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x24'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x25'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x26'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xebe1('0x28'),this[_0xebe1('0x1b')][_0xebe1('0x1c')](this));ami['on'](_0xebe1('0x29'),this['syncCustomEvent'][_0xebe1('0x1c')](this));}Trigger['prototype'][_0xebe1('0x2a')]=function(_0x5bc0a5,_0x915844,_0x5b12b3){logger[_0xebe1('0x2b')](_0x5bc0a5,_0x915844,JSON['stringify'](_0x5b12b3));io['to'](_0x5bc0a5)[_0xebe1('0x2a')](_0x915844,_0x5b12b3);};Trigger['prototype'][_0xebe1('0x1b')]=function(_0x14eddd){var _0x48e085=_[_0xebe1('0x2c')](_0x14eddd);this[_0xebe1('0x2d')](_0x48e085);};Trigger[_0xebe1('0x2e')]['syncAgentDial']=function(_0x4a3be5){if(this[_0xebe1('0x2f')][_0x4a3be5['interface']]){this[_0xebe1('0x1b')](_0x4a3be5);}};Trigger[_0xebe1('0x2e')][_0xebe1('0x2d')]=function(_0x2f951f){var _0x3fb988;for(var _0x233e12 in this['triggers']){if(this[_0xebe1('0xd')]['hasOwnProperty'](_0x233e12)){if(this[_0xebe1('0xd')][_0x233e12][_0xebe1('0x30')]){_0x3fb988=this[_0xebe1('0x31')](this['triggers'][_0x233e12],_0x2f951f);if(_0x3fb988){_[_0xebe1('0x32')](_0x2f951f,_0x2f951f[_0xebe1('0x33')]);for(var _0x90af6b=0x0,_0x5998f8,_0x1c4ffc,_0x278ce6;_0x90af6b0x0){_0x176b44=_[_0x6ec7('0x29')](_0x32602e,_0x27f900);}return _0x176b44;}function getCustomFields(_0x49771c,_0x235747){var _0x3cdcc6=[];var _0x568d7c={'custom_fields':{}};if(_0x49771c[_0x6ec7('0x28')]>0x0){_['forEach'](_0x49771c,function(_0x3db01e){if(_0x3db01e['type']==='string'&&_0x3db01e[_0x6ec7('0x2a')]&&!_0x3db01e[_0x6ec7('0x2b')]){_0x568d7c[_0x3db01e[_0x6ec7('0x2a')][_0x6ec7('0x2c')]()]=_0x3db01e[_0x6ec7('0x2d')][_0x6ec7('0x21')]();}else if(_0x3db01e[_0x6ec7('0x2e')]==='string'&&_0x3db01e['idField']&&_0x3db01e[_0x6ec7('0x2b')]){_0x568d7c['custom_fields'][_0x3db01e['idField']]=_0x3db01e[_0x6ec7('0x2d')][_0x6ec7('0x21')]();}else if(_0x3db01e[_0x6ec7('0x2e')]===_0x6ec7('0x2f')&&_0x3db01e['variableName']&&_0x3db01e[_0x6ec7('0x30')]&&_0x3db01e[_0x6ec7('0x2b')]){_0x235747[_0x3db01e[_0x6ec7('0x31')]]&&(_0x568d7c[_0x6ec7('0x32')][_0x3db01e[_0x6ec7('0x30')]]=_0x235747[_0x3db01e[_0x6ec7('0x31')]]['toString']());}else if(_0x3db01e[_0x6ec7('0x2e')]===_0x6ec7('0x33')&&_0x3db01e['Variable']&&_0x3db01e[_0x6ec7('0x34')][_0x6ec7('0x35')]&&_0x3db01e['idField']&&_0x3db01e[_0x6ec7('0x2b')]){_0x235747[_0x3db01e[_0x6ec7('0x34')][_0x6ec7('0x35')][_0x6ec7('0x2c')]()]&&(_0x568d7c[_0x6ec7('0x32')][_0x3db01e[_0x6ec7('0x30')]]=_0x235747[_0x3db01e[_0x6ec7('0x34')][_0x6ec7('0x35')][_0x6ec7('0x2c')]()][_0x6ec7('0x21')]());}});}if(_0x568d7c['priority']){_0x568d7c['priority']=Number(_0x568d7c[_0x6ec7('0x36')]);}return _0x568d7c;}function getTicket(_0x1e12f0,_0x3c5e59,_0x5606ea,_0x5318f2,_0x2b50b4){logger[_0x6ec7('0x13')]('Creating\x20new\x20ticket...');var _0xc697d5=_['merge']({'subject':intUtil[_0x6ec7('0x37')](_0x5318f2['Subjects'],_0x2b50b4,'\x20'),'type':_0x6ec7('0x38'),'status':_0x6ec7('0x39'),'labels':[_0x6ec7('0x3a'),_0x6ec7('0x3b'),'CTI']['concat'](getTags(_0x5318f2['Tags'],_0x6ec7('0x35'))),'description':intUtil[_0x6ec7('0x37')](_0x5318f2[_0x6ec7('0x3c')],_0x2b50b4,'\x0a'),'_links':{'assigned_user':{'href':util[_0x6ec7('0xa')](_0x6ec7('0x3d'),_0x3c5e59['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x6ec7('0x37')](_0x5318f2[_0x6ec7('0x3c')],_0x2b50b4,'\x0a')}},getCustomFields(_0x5318f2[_0x6ec7('0x3e')],_0x2b50b4));return request({'uri':util[_0x6ec7('0xa')](_0x6ec7('0x3f'),_0x1e12f0[_0x6ec7('0xc')],_0x5606ea['id']),'method':_0x6ec7('0x26'),'body':_0xc697d5});}exports[_0x6ec7('0x40')]=function(_0x3ccad8,_0x2d7e60,_0x347bd1,_0x270ddd,_0x46d90e,_0x2a8271){var _0x41482f,_0x410347;_0x2a8271['remoteUri']=intUtil[_0x6ec7('0x41')](_0x2a8271[_0x6ec7('0xc')]);_0x2a8271[_0x6ec7('0x42')]=intUtil[_0x6ec7('0x41')](_0x2a8271[_0x6ec7('0x42')]);if(_0x46d90e&&_0x46d90e[_0x6ec7('0x43')]){logger[_0x6ec7('0x13')](_0x6ec7('0x44'),'Recording\x20is\x20enabled!');_0x2d7e60[_0x6ec7('0x45')]=util[_0x6ec7('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a8271[_0x6ec7('0x42')],_0x2d7e60[_0x6ec7('0x46')],md5(_0x2d7e60[_0x6ec7('0x46')]));}else{_0x2d7e60[_0x6ec7('0x45')]='';}headers[_0x6ec7('0x47')]=getAuth(_0x2a8271);return getUser(_0x2a8271,_0x270ddd[_0x6ec7('0x48')])[_0x6ec7('0xd')](function(_0x5633b2){_0x41482f=_0x5633b2;logger[_0x6ec7('0x13')](_0x6ec7('0x49'),_0x41482f['id']);return getEndUser(_0x2a8271,_0x2d7e60[_0x6ec7('0x4a')],_0x2d7e60[_0x6ec7('0x4b')]);})['then'](function(_0x3928c5){_0x410347=_0x3928c5;logger[_0x6ec7('0x13')](_0x6ec7('0x4c'),_0x410347['id']);return getTicket(_0x2a8271,_0x41482f,_0x410347,_0x347bd1,_0x2d7e60);})[_0x6ec7('0xd')](function(_0x425e61){if(_0x425e61){logger[_0x6ec7('0x13')](_0x6ec7('0x4d'));logger[_0x6ec7('0x13')](_0x6ec7('0x4e'),_0x425e61['id']);switch(_0x2a8271[_0x6ec7('0x2e')]){case'integrationTab':logger[_0x6ec7('0x13')]('[QUEUE]',_0x6ec7('0x4f'));emit(util[_0x6ec7('0xa')](_0x6ec7('0x50'),_0x270ddd[_0x6ec7('0x35')]),_0x6ec7('0x51'),{'recordId':_0x425e61['id']});break;case _0x6ec7('0x52'):logger[_0x6ec7('0x13')](_0x6ec7('0x44'),_0x6ec7('0x53'));emit(util[_0x6ec7('0xa')](_0x6ec7('0x50'),_0x270ddd[_0x6ec7('0x35')]),_0x6ec7('0x54'),{'uri':util['format'](_0x6ec7('0x55'),_0x425e61['id'])});break;default:logger[_0x6ec7('0x56')](_0x6ec7('0x44'),_0x6ec7('0x57'));}}})[_0x6ec7('0x58')](function(_0x44c972){console['error'](_0x44c972);logger[_0x6ec7('0x56')](_0x6ec7('0x44'),JSON['stringify'](_0x44c972));});};exports[_0x6ec7('0x59')]=function(_0x4017e7,_0x4f9dbf,_0x35efc4,_0x26cb3f,_0x4d5889,_0xb87773,_0x3cc76b){var _0x1506d3,_0x248042;_0xb87773['remoteUri']=intUtil[_0x6ec7('0x41')](_0xb87773[_0x6ec7('0xc')]);_0xb87773[_0x6ec7('0x42')]=intUtil[_0x6ec7('0x41')](_0xb87773['serverUrl']);if(_0x3cc76b&&_0x3cc76b['recordingFormat']&&_0x3cc76b[_0x6ec7('0x5a')]!==_0x6ec7('0x5b')){logger[_0x6ec7('0x13')](_0x6ec7('0x5c'),_0x6ec7('0x5d'));_0x4f9dbf['recordingURL']=util[_0x6ec7('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb87773[_0x6ec7('0x42')],_0x4f9dbf[_0x6ec7('0x46')],md5(_0x4f9dbf[_0x6ec7('0x46')]));}headers[_0x6ec7('0x47')]=getAuth(_0xb87773);return getUser(_0xb87773,_0x26cb3f[_0x6ec7('0x48')])[_0x6ec7('0xd')](function(_0x55d301){_0x1506d3=_0x55d301;logger[_0x6ec7('0x13')](_0x6ec7('0x49'),_0x1506d3['id']);return getEndUser(_0xb87773,_0x4f9dbf[_0x6ec7('0x5e')],_0x4f9dbf[_0x6ec7('0x5f')]);})[_0x6ec7('0xd')](function(_0x4d4248){_0x248042=_0x4d4248;logger[_0x6ec7('0x13')](_0x6ec7('0x4c'),_0x248042['id']);return getTicket(_0xb87773,_0x1506d3,_0x248042,_0x35efc4,_0x4f9dbf);})[_0x6ec7('0xd')](function(_0x32a7ee){if(_0x32a7ee){logger['info'](_0x6ec7('0x4d'));logger['info'](_0x6ec7('0x4e'),_0x32a7ee['id']);switch(_0xb87773[_0x6ec7('0x2e')]){case _0x6ec7('0x60'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x6ec7('0xa')](_0x6ec7('0x50'),_0x26cb3f[_0x6ec7('0x35')]),_0x6ec7('0x51'),{'recordId':_0x32a7ee['id']});break;case _0x6ec7('0x52'):logger[_0x6ec7('0x13')](_0x6ec7('0x44'),_0x6ec7('0x53'));emit(util['format'](_0x6ec7('0x50'),_0x26cb3f['name']),_0x6ec7('0x54'),{'uri':util[_0x6ec7('0xa')](_0x6ec7('0x61'),_0xb87773['remoteUri'],_0x32a7ee['id'])});break;default:logger[_0x6ec7('0x56')](_0x6ec7('0x5c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x6ec7('0x58')](function(_0x53384e){logger[_0x6ec7('0x56')](_0x6ec7('0x5c'),JSON['stringify'](_0x53384e));});};exports[_0x6ec7('0x62')]=function(_0x139c93,_0x3f1234,_0x2675e9,_0x28c566,_0x2ff95e,_0x3bc11d){var _0x3283d8,_0x55d0e7;_0x3bc11d[_0x6ec7('0xc')]=intUtil[_0x6ec7('0x41')](_0x3bc11d[_0x6ec7('0xc')]);_0x3bc11d[_0x6ec7('0x42')]=intUtil['stripTrailingSlash'](_0x3bc11d['serverUrl']);if(_0x2ff95e&&_0x2ff95e[_0x6ec7('0x43')]){logger['info'](_0x6ec7('0x63'),'Recording\x20is\x20enabled!');_0x3f1234[_0x6ec7('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3bc11d['serverUrl'],_0x3f1234[_0x6ec7('0x46')],md5(_0x3f1234[_0x6ec7('0x46')]));}else{_0x3f1234[_0x6ec7('0x45')]='';}headers['Authorization']=getAuth(_0x3bc11d);return getUser(_0x3bc11d)[_0x6ec7('0xd')](function(_0x2a1d28){_0x3283d8=_0x2a1d28;logger[_0x6ec7('0x13')](_0x6ec7('0x49'),_0x3283d8['id']);return getEndUser(_0x3bc11d,_0x3f1234['calleridname'],_0x3f1234[_0x6ec7('0x4b')]);})['then'](function(_0x17f4c1){_0x55d0e7=_0x17f4c1;logger[_0x6ec7('0x13')](_0x6ec7('0x4c'),_0x55d0e7['id']);return getTicket(_0x3bc11d,_0x3283d8,_0x55d0e7,_0x2675e9,_0x3f1234);})[_0x6ec7('0xd')](function(_0x217d26){if(_0x217d26){logger[_0x6ec7('0x13')](_0x6ec7('0x4d'));logger[_0x6ec7('0x13')]('The\x20Ticket\x20ID\x20is:',_0x217d26['id']);}})['catch'](function(_0x39fa95){logger['error'](_0x6ec7('0x63'),JSON[_0x6ec7('0x18')](_0x39fa95));});}; \ No newline at end of file +var _0x1e1f=['queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:desk:display','newTab','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','email','destcalleridname','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','stringify','abandoned','[ABANDONED]','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','format','%s/users','remoteUri','then','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','authType','basic','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','string','nameField','customField','toLowerCase','idField','type','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','CTI','concat','/api/v2/users/%d','user','Descriptions','Fields','%s/customers/%d/cases'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x1e1f,0x89));var _0xf1e1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1e1f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf1e1('0x0'));var rp=require('request-promise');var md5=require(_0xf1e1('0x1'));var util=require(_0xf1e1('0x2'));var Redis=require(_0xf1e1('0x3'));var intUtil=require('./util');var config=require(_0xf1e1('0x4'));var logger=require(_0xf1e1('0x5'))(_0xf1e1('0x6'));config['redis']=_[_0xf1e1('0x7')](config[_0xf1e1('0x8')],{'host':_0xf1e1('0x9'),'port':0x18eb});var io=require(_0xf1e1('0xa'))(new Redis(config['redis']));function emit(_0xce3d53,_0x2d0779,_0x46bb25){io['to'](_0xce3d53)[_0xf1e1('0xb')](_0x2d0779,_0x46bb25);}var headers={'Content-Type':_0xf1e1('0xc'),'Accept':_0xf1e1('0xc')};function getUser(_0x2bbd6e,_0x8f1321){if(intUtil[_0xf1e1('0xd')](_0x8f1321)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0x8f1321);return request({'uri':util[_0xf1e1('0xe')](_0xf1e1('0xf'),_0x2bbd6e[_0xf1e1('0x10')])})[_0xf1e1('0x11')](function(_0x2e8f44){if(_0x2e8f44['total_entries']){return _['find'](_0x2e8f44[_0xf1e1('0x12')][_0xf1e1('0x13')],{'email':_0x8f1321});}})[_0xf1e1('0x11')](function(_0x4669cd){if(_0x4669cd){logger[_0xf1e1('0x14')](_0xf1e1('0x15'));return _0x4669cd;}else{logger[_0xf1e1('0x14')](_0xf1e1('0x16'));return request({'uri':util[_0xf1e1('0xe')](_0xf1e1('0x17'),_0x2bbd6e[_0xf1e1('0x10')])});}});}else{logger[_0xf1e1('0x14')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf1e1('0xe')](_0xf1e1('0x17'),_0x2bbd6e[_0xf1e1('0x10')])});}}function request(_0x4ff421){logger[_0xf1e1('0x18')](_0xf1e1('0x19'),JSON['stringify'](_0x4ff421));return rp(_[_0xf1e1('0x7')](_0x4ff421,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x5afdcf){var _0x251dd5;if(_0x5afdcf[_0xf1e1('0x1a')]===_0xf1e1('0x1b')){_0x251dd5=util[_0xf1e1('0xe')](_0xf1e1('0x1c'),_0x5afdcf['username'],_0x5afdcf[_0xf1e1('0x1d')]);}else if(_0x5afdcf['authType']===_0xf1e1('0x1e')){_0x251dd5=util[_0xf1e1('0xe')](_0xf1e1('0x1f'),_0x5afdcf[_0xf1e1('0x20')],_0x5afdcf[_0xf1e1('0x1e')]);}return util[_0xf1e1('0xe')](_0xf1e1('0x21'),new Buffer(_0x251dd5)[_0xf1e1('0x22')]('base64'));}function getEndUser(_0x4c2dad,_0x4f19d1,_0x1a6607){logger[_0xf1e1('0x14')]('Searching\x20enduser\x20with\x20phone',_0x1a6607);return request({'uri':util[_0xf1e1('0xe')]('%s/customers/search',_0x4c2dad['remoteUri']),'qs':{'phone':_0x1a6607}})[_0xf1e1('0x11')](function(_0xb0a92b){if(_0xb0a92b[_0xf1e1('0x23')]){logger['info'](_0xf1e1('0x24'));return _0xb0a92b[_0xf1e1('0x12')][_0xf1e1('0x13')][0x0];}else{logger[_0xf1e1('0x14')](_0xf1e1('0x25'));return request({'uri':util[_0xf1e1('0xe')](_0xf1e1('0x26'),_0x4c2dad[_0xf1e1('0x10')]),'method':_0xf1e1('0x27'),'body':{'first_name':_0x4f19d1,'title':_0x4f19d1,'phone_numbers':[{'type':'work','value':_0x1a6607}]}});}});}function getTags(_0x18d834,_0x5eac0b){var _0x1bb34c=[];if(_0x18d834&&_0x18d834[_0xf1e1('0x28')]>0x0){_0x1bb34c=_[_0xf1e1('0x29')](_0x18d834,_0x5eac0b);}return _0x1bb34c;}function getCustomFields(_0x2475f8,_0x5b9edc){var _0x2cac23=[];var _0x931193={'custom_fields':{}};if(_0x2475f8[_0xf1e1('0x28')]>0x0){_['forEach'](_0x2475f8,function(_0x3b34f8){if(_0x3b34f8['type']===_0xf1e1('0x2a')&&_0x3b34f8[_0xf1e1('0x2b')]&&!_0x3b34f8[_0xf1e1('0x2c')]){_0x931193[_0x3b34f8[_0xf1e1('0x2b')][_0xf1e1('0x2d')]()]=_0x3b34f8['content'][_0xf1e1('0x22')]();}else if(_0x3b34f8['type']===_0xf1e1('0x2a')&&_0x3b34f8[_0xf1e1('0x2e')]&&_0x3b34f8[_0xf1e1('0x2c')]){_0x931193['custom_fields'][_0x3b34f8[_0xf1e1('0x2e')]]=_0x3b34f8['content'][_0xf1e1('0x22')]();}else if(_0x3b34f8[_0xf1e1('0x2f')]===_0xf1e1('0x30')&&_0x3b34f8[_0xf1e1('0x31')]&&_0x3b34f8[_0xf1e1('0x2e')]&&_0x3b34f8[_0xf1e1('0x2c')]){_0x5b9edc[_0x3b34f8[_0xf1e1('0x31')]]&&(_0x931193['custom_fields'][_0x3b34f8['idField']]=_0x5b9edc[_0x3b34f8[_0xf1e1('0x31')]][_0xf1e1('0x22')]());}else if(_0x3b34f8[_0xf1e1('0x2f')]===_0xf1e1('0x32')&&_0x3b34f8[_0xf1e1('0x33')]&&_0x3b34f8[_0xf1e1('0x33')]['name']&&_0x3b34f8[_0xf1e1('0x2e')]&&_0x3b34f8[_0xf1e1('0x2c')]){_0x5b9edc[_0x3b34f8['Variable'][_0xf1e1('0x34')][_0xf1e1('0x2d')]()]&&(_0x931193['custom_fields'][_0x3b34f8[_0xf1e1('0x2e')]]=_0x5b9edc[_0x3b34f8['Variable'][_0xf1e1('0x34')]['toLowerCase']()][_0xf1e1('0x22')]());}});}if(_0x931193['priority']){_0x931193[_0xf1e1('0x35')]=Number(_0x931193[_0xf1e1('0x35')]);}return _0x931193;}function getTicket(_0x35f05e,_0x30ef67,_0x57c805,_0x445644,_0x214ceb){logger['info'](_0xf1e1('0x36'));var _0x4da025=_[_0xf1e1('0x37')]({'subject':intUtil[_0xf1e1('0x38')](_0x445644[_0xf1e1('0x39')],_0x214ceb,'\x20'),'type':_0xf1e1('0x3a'),'status':_0xf1e1('0x3b'),'labels':['xCALLY','Motion',_0xf1e1('0x3c')][_0xf1e1('0x3d')](getTags(_0x445644['Tags'],_0xf1e1('0x34'))),'description':intUtil[_0xf1e1('0x38')](_0x445644['Descriptions'],_0x214ceb,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xf1e1('0x3e'),_0x30ef67['id']),'class':_0xf1e1('0x3f')}},'message':{'direction':'in','body':intUtil[_0xf1e1('0x38')](_0x445644[_0xf1e1('0x40')],_0x214ceb,'\x0a')}},getCustomFields(_0x445644[_0xf1e1('0x41')],_0x214ceb));return request({'uri':util[_0xf1e1('0xe')](_0xf1e1('0x42'),_0x35f05e['remoteUri'],_0x57c805['id']),'method':_0xf1e1('0x27'),'body':_0x4da025});}exports[_0xf1e1('0x43')]=function(_0x592cbe,_0x497645,_0x727087,_0x230663,_0x191d0b,_0x3d578f){var _0x3e4645,_0x1a272e;_0x3d578f[_0xf1e1('0x10')]=intUtil['stripTrailingSlash'](_0x3d578f[_0xf1e1('0x10')]);_0x3d578f[_0xf1e1('0x44')]=intUtil[_0xf1e1('0x45')](_0x3d578f[_0xf1e1('0x44')]);if(_0x191d0b&&_0x191d0b[_0xf1e1('0x46')]){logger[_0xf1e1('0x14')](_0xf1e1('0x47'),_0xf1e1('0x48'));_0x497645[_0xf1e1('0x49')]=util[_0xf1e1('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d578f[_0xf1e1('0x44')],_0x497645['uniqueid'],md5(_0x497645[_0xf1e1('0x4a')]));}else{_0x497645[_0xf1e1('0x49')]='';}headers['Authorization']=getAuth(_0x3d578f);return getUser(_0x3d578f,_0x230663['email'])[_0xf1e1('0x11')](function(_0x2f64b6){_0x3e4645=_0x2f64b6;logger[_0xf1e1('0x14')](_0xf1e1('0x4b'),_0x3e4645['id']);return getEndUser(_0x3d578f,_0x497645[_0xf1e1('0x4c')],_0x497645[_0xf1e1('0x4d')]);})[_0xf1e1('0x11')](function(_0x561bf2){_0x1a272e=_0x561bf2;logger[_0xf1e1('0x14')](_0xf1e1('0x4e'),_0x1a272e['id']);return getTicket(_0x3d578f,_0x3e4645,_0x1a272e,_0x727087,_0x497645);})[_0xf1e1('0x11')](function(_0x46497b){if(_0x46497b){logger[_0xf1e1('0x14')]('Ticket\x20created!');logger[_0xf1e1('0x14')](_0xf1e1('0x4f'),_0x46497b['id']);switch(_0x3d578f[_0xf1e1('0x2f')]){case'integrationTab':logger[_0xf1e1('0x14')](_0xf1e1('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf1e1('0xe')](_0xf1e1('0x50'),_0x230663[_0xf1e1('0x34')]),_0xf1e1('0x51'),{'recordId':_0x46497b['id']});break;case _0xf1e1('0x52'):logger[_0xf1e1('0x14')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf1e1('0xe')](_0xf1e1('0x50'),_0x230663[_0xf1e1('0x34')]),_0xf1e1('0x53'),{'uri':util[_0xf1e1('0xe')](_0xf1e1('0x54'),_0x46497b['id'])});break;default:logger['error'](_0xf1e1('0x47'),_0xf1e1('0x55'));}}})[_0xf1e1('0x56')](function(_0xf5687b){console[_0xf1e1('0x57')](_0xf5687b);logger['error'](_0xf1e1('0x47'),JSON['stringify'](_0xf5687b));});};exports[_0xf1e1('0x58')]=function(_0x3a7cc5,_0x4fc149,_0x16277e,_0x192816,_0x554d18,_0x4a5229,_0x96bc00){var _0x55e448,_0x10787f;_0x4a5229[_0xf1e1('0x10')]=intUtil[_0xf1e1('0x45')](_0x4a5229[_0xf1e1('0x10')]);_0x4a5229[_0xf1e1('0x44')]=intUtil[_0xf1e1('0x45')](_0x4a5229[_0xf1e1('0x44')]);if(_0x96bc00&&_0x96bc00[_0xf1e1('0x59')]&&_0x96bc00['recordingFormat']!==_0xf1e1('0x5a')){logger['info'](_0xf1e1('0x5b'),_0xf1e1('0x48'));_0x4fc149['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a5229[_0xf1e1('0x44')],_0x4fc149['uniqueid'],md5(_0x4fc149[_0xf1e1('0x4a')]));}headers[_0xf1e1('0x5c')]=getAuth(_0x4a5229);return getUser(_0x4a5229,_0x192816[_0xf1e1('0x5d')])['then'](function(_0x2f8999){_0x55e448=_0x2f8999;logger[_0xf1e1('0x14')](_0xf1e1('0x4b'),_0x55e448['id']);return getEndUser(_0x4a5229,_0x4fc149[_0xf1e1('0x5e')],_0x4fc149['destcalleridnum']);})[_0xf1e1('0x11')](function(_0x1b8b7c){_0x10787f=_0x1b8b7c;logger['info'](_0xf1e1('0x4e'),_0x10787f['id']);return getTicket(_0x4a5229,_0x55e448,_0x10787f,_0x16277e,_0x4fc149);})[_0xf1e1('0x11')](function(_0x59c89c){if(_0x59c89c){logger[_0xf1e1('0x14')](_0xf1e1('0x5f'));logger[_0xf1e1('0x14')]('The\x20Ticket\x20ID\x20is:',_0x59c89c['id']);switch(_0x4a5229[_0xf1e1('0x2f')]){case _0xf1e1('0x60'):logger[_0xf1e1('0x14')](_0xf1e1('0x47'),_0xf1e1('0x61'));emit(util[_0xf1e1('0xe')](_0xf1e1('0x50'),_0x192816['name']),_0xf1e1('0x51'),{'recordId':_0x59c89c['id']});break;case _0xf1e1('0x52'):logger[_0xf1e1('0x14')]('[QUEUE]',_0xf1e1('0x62'));emit(util['format'](_0xf1e1('0x50'),_0x192816[_0xf1e1('0x34')]),_0xf1e1('0x53'),{'uri':util[_0xf1e1('0xe')]('%s/agent/tickets/%s',_0x4a5229['remoteUri'],_0x59c89c['id'])});break;default:logger[_0xf1e1('0x57')](_0xf1e1('0x5b'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xf1e1('0x56')](function(_0xf62f2b){logger[_0xf1e1('0x57')](_0xf1e1('0x5b'),JSON[_0xf1e1('0x63')](_0xf62f2b));});};exports[_0xf1e1('0x64')]=function(_0x53a113,_0x2192e5,_0x1db26d,_0x4e4209,_0xcb8ecb,_0x78ecd8){var _0x2ffdf8,_0xadf6b9;_0x78ecd8[_0xf1e1('0x10')]=intUtil[_0xf1e1('0x45')](_0x78ecd8['remoteUri']);_0x78ecd8['serverUrl']=intUtil[_0xf1e1('0x45')](_0x78ecd8[_0xf1e1('0x44')]);if(_0xcb8ecb&&_0xcb8ecb['monitor_format']){logger[_0xf1e1('0x14')](_0xf1e1('0x65'),_0xf1e1('0x48'));_0x2192e5['recordingURL']=util[_0xf1e1('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x78ecd8[_0xf1e1('0x44')],_0x2192e5[_0xf1e1('0x4a')],md5(_0x2192e5['uniqueid']));}else{_0x2192e5[_0xf1e1('0x49')]='';}headers['Authorization']=getAuth(_0x78ecd8);return getUser(_0x78ecd8)[_0xf1e1('0x11')](function(_0x3aad24){_0x2ffdf8=_0x3aad24;logger[_0xf1e1('0x14')](_0xf1e1('0x4b'),_0x2ffdf8['id']);return getEndUser(_0x78ecd8,_0x2192e5['calleridname'],_0x2192e5['calleridnum']);})[_0xf1e1('0x11')](function(_0x55eb67){_0xadf6b9=_0x55eb67;logger[_0xf1e1('0x14')](_0xf1e1('0x4e'),_0xadf6b9['id']);return getTicket(_0x78ecd8,_0x2ffdf8,_0xadf6b9,_0x1db26d,_0x2192e5);})['then'](function(_0x3746f8){if(_0x3746f8){logger[_0xf1e1('0x14')](_0xf1e1('0x5f'));logger[_0xf1e1('0x14')](_0xf1e1('0x4f'),_0x3746f8['id']);}})[_0xf1e1('0x56')](function(_0x2e659f){logger['error'](_0xf1e1('0x65'),JSON['stringify'](_0x2e659f));});}; \ 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 152151a..b8acfcf 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 _0x8d7e=['headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','inspect','lodash','request-promise','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','telephone1','contactid','enduserId',']\x20Enduser\x20Created!','forEach','string','nameField','indexOf','content','ticketType','incidents','assign','Subjects','Descriptions','/contacts(','Fields','phonecall','getString','callDirection','queue'];(function(_0x21acb2,_0x4c46ac){var _0x1c95c7=function(_0x3c2bbc){while(--_0x3c2bbc){_0x21acb2['push'](_0x21acb2['shift']());}};_0x1c95c7(++_0x4c46ac);}(_0x8d7e,0x7d));var _0xe8d7=function(_0x1fb46e,_0x42853e){_0x1fb46e=_0x1fb46e-0x0;var _0x211983=_0x8d7e[_0x1fb46e];return _0x211983;};'use strict';var _=require(_0xe8d7('0x0'));var BPromise=require('bluebird');var rp=require(_0xe8d7('0x1'));var util=require('util');var intUtil=require(_0xe8d7('0x2'));var md5=require(_0xe8d7('0x3'));var Redis=require(_0xe8d7('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0xe8d7('0x5'));config[_0xe8d7('0x6')]=_[_0xe8d7('0x7')](config['redis'],{'host':_0xe8d7('0x8'),'port':0x18eb});var io=require(_0xe8d7('0x9'))(new Redis(config[_0xe8d7('0x6')]));function getAuthToken(_0x3f5465,_0x1a783d,_0x283d23){var _0x4387e6={'method':_0xe8d7('0xa'),'uri':_0x1a783d,'form':{'client_id':_0x3f5465['clientId'],'resource':_0x3f5465['remoteUri'],'username':_0x3f5465['username'],'password':_0x3f5465['password'],'grant_type':'password','client_secret':_0x3f5465[_0xe8d7('0xb')]},'json':!![]};return rp(_0x4387e6)[_0xe8d7('0xc')](function(_0x44d8e4){return _0x44d8e4[_0xe8d7('0xd')];})[_0xe8d7('0xe')](function(_0x20a258){logger['error']('['+[_0x283d23[_0xe8d7('0xf')]()]+_0xe8d7('0x10'));return _0x20a258[_0xe8d7('0x11')];});}function getUser(_0x51fea1,_0x38847d,_0x57c9b1,_0x2b13c7,_0x3c7482,_0x20b37f){return new BPromise(function(_0x1e13af,_0x7d0c){return getAuthToken(_0x38847d,_0x2b13c7,_0x20b37f)[_0xe8d7('0xc')](function(_0x5da271){var _0x59d0e3={'method':_0xe8d7('0x12'),'uri':_0x3c7482+_0xe8d7('0x13'),'headers':{'Authorization':_0xe8d7('0x14')+_0x5da271,'OData-Version':_0xe8d7('0x15')},'json':!![]};return rp(_0x59d0e3);})[_0xe8d7('0xc')](function(_0x2161e9){var _0x5ee4e2=_0x2161e9[_0xe8d7('0x16')];var _0x4959ce=![];var _0xd4b2c5=null;if(!_[_0xe8d7('0x17')](_0x57c9b1)){if(intUtil[_0xe8d7('0x18')](_0x57c9b1[_0xe8d7('0x19')])){_0x51fea1[_0xe8d7('0x1a')]=_0x57c9b1[_0xe8d7('0x19')];for(_0xd4b2c5=0x0;_0xd4b2c5<_0x5ee4e2['length'];_0xd4b2c5++){if(_0x5ee4e2[_0xd4b2c5]['internalemailaddress']===_0x57c9b1['email']&&!_0x5ee4e2[_0xd4b2c5][_0xe8d7('0x1b')]){_0x4959ce=!![];logger['info']('['+[_0x20b37f[_0xe8d7('0xf')]()]+_0xe8d7('0x1c')+_0x5ee4e2[_0xd4b2c5]['systemuserid']+'!');_0x51fea1[_0xe8d7('0x1d')]=_0x5ee4e2[_0xd4b2c5][_0xe8d7('0x1e')];}}}}if(!_0x4959ce){logger[_0xe8d7('0x1f')]('['+[_0x20b37f[_0xe8d7('0xf')]()]+_0xe8d7('0x20'));_0x51fea1[_0xe8d7('0x1a')]=_0x38847d[_0xe8d7('0x21')];for(_0xd4b2c5=0x0;_0xd4b2c5<_0x5ee4e2[_0xe8d7('0x22')];_0xd4b2c5++){if(_0x5ee4e2[_0xd4b2c5][_0xe8d7('0x23')]===_0x38847d['username']){_0x51fea1[_0xe8d7('0x1d')]=_0x5ee4e2[_0xd4b2c5][_0xe8d7('0x1e')];}}}_0x1e13af(_0x51fea1);})['catch'](function(_0x1f9c18){_0x7d0c(_0x1f9c18[_0xe8d7('0x11')]);});});}function createEndUser(_0x436257,_0x8ce294,_0x1f7ae3,_0x1b506c,_0x583880,_0x486424){return new BPromise(function(_0x3a690d,_0x38d7be){return getAuthToken(_0x8ce294,_0x1f7ae3,_0x486424)[_0xe8d7('0xc')](function(_0x5ae85c){var _0x3d09ae=_0x486424[_0xe8d7('0x24')]()===_0xe8d7('0x25')?_0x583880[_0xe8d7('0x26')]:_0x583880[_0xe8d7('0x27')];var _0x5b5c4b={'method':_0xe8d7('0xa'),'uri':_0x1b506c+_0xe8d7('0x28'),'body':{'telephone1':_0x3d09ae,'fullname':_0x3d09ae,'firstname':_0x3d09ae,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe8d7('0x29')+_0x436257[_0xe8d7('0x1d')]+')'},'headers':{'Authorization':_0xe8d7('0x14')+_0x5ae85c,'OData-Version':_0xe8d7('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5b5c4b);})[_0xe8d7('0xc')](function(_0x30ed33){var _0xe9b1dd=_0x30ed33['headers'][_0xe8d7('0x2a')];var _0x49cb45=_0xe9b1dd[_0xe8d7('0x2b')](_0xe9b1dd['lastIndexOf']('(')+0x1,_0xe9b1dd[_0xe8d7('0x2c')](')'));_0x436257['enduserId']=_0x49cb45;_0x3a690d(_0x436257);})['catch'](function(_0x4132e5){_0x38d7be(_0x4132e5['message']);});});}function getEndUser(_0x48e9d1,_0x46efbc,_0x521065,_0x55ef9c,_0x46bb0d,_0x12183a){return new BPromise(function(_0x24a34e,_0x17ca1c){return getAuthToken(_0x46efbc,_0x521065,_0x12183a)[_0xe8d7('0xc')](function(_0x7d062d){var _0x4133bc={'method':'GET','uri':_0x55ef9c+'contacts?$select=telephone1','headers':{'Authorization':_0xe8d7('0x14')+_0x7d062d,'If-None-Match':null,'OData-Version':_0xe8d7('0x15')},'json':!![]};return rp(_0x4133bc);})[_0xe8d7('0xc')](function(_0x357a04){var _0x3c0cd1=null;if(_0x357a04){var _0x3db5f8=_0x357a04[_0xe8d7('0x16')];var _0x13a52b=![];for(_0x3c0cd1=0x0;_0x3c0cd1<_0x3db5f8[_0xe8d7('0x22')];_0x3c0cd1++){var _0x32ac8e=_0x12183a[_0xe8d7('0x24')]()===_0xe8d7('0x25')?_0x46bb0d['destcalleridnum']:_0x46bb0d[_0xe8d7('0x27')];if(_0x3db5f8[_0x3c0cd1][_0xe8d7('0x2d')]===_0x32ac8e){_0x13a52b=!![];_0x48e9d1['enduserId']=_0x3db5f8[_0x3c0cd1][_0xe8d7('0x2e')];}}if(_0x13a52b){_0x24a34e(_0x48e9d1);}else{return createEndUser(_0x48e9d1,_0x46efbc,_0x521065,_0x55ef9c,_0x46bb0d,_0x12183a)[_0xe8d7('0xc')](function(_0x19feda){logger['info']('['+[_0x12183a['toUpperCase']()]+']\x20Enduser\x20created!',_0x19feda[_0xe8d7('0x2f')]);_0x24a34e(_0x19feda);});}}else{return createEndUser(_0x48e9d1,_0x46efbc,_0x521065,_0x55ef9c,_0x46bb0d,_0x12183a)['then'](function(_0x3435ec){logger[_0xe8d7('0x1f')]('['+[_0x12183a['toUpperCase']()]+_0xe8d7('0x30'),_0x3435ec[_0xe8d7('0x2f')]);_0x24a34e(_0x3435ec);});}});});}function getCustomFields(_0x4e0c7e,_0x132bb4,_0x305068){var _0x5e3f22={};if(_0x4e0c7e[_0xe8d7('0x22')]>0x0){_[_0xe8d7('0x31')](_0x4e0c7e,function(_0x3bb8d7){if(_0x3bb8d7['type']===_0xe8d7('0x32')&&_0x3bb8d7[_0xe8d7('0x33')]&&!_0x3bb8d7['customField']){var _0x4ef34c=_0x3bb8d7['idField'][_0xe8d7('0x24')]();var _0x522c3c=_0x4ef34c[_0xe8d7('0x2b')](0x0,_0x4ef34c[_0xe8d7('0x34')]('_'));var _0x3c67c6=_0x4ef34c[_0xe8d7('0x2b')](_0x4ef34c['indexOf']('_')+0x1);if(_0x522c3c===_0x305068){_0x5e3f22[_0x3c67c6]=_0x3bb8d7[_0xe8d7('0x35')];}}});}return _0x5e3f22;}function getTicket(_0x39c6a1,_0x329b93,_0x44ac5a,_0x523e50,_0x3777a3,_0x49806c,_0x335c3c){return new BPromise(function(_0x1d71a9,_0x1be7ef){var _0x1c30ab;return getAuthToken(_0x329b93,_0x44ac5a,_0x335c3c)[_0xe8d7('0xc')](function(_0x31caf3){if(_0x49806c[_0xe8d7('0x36')]==='incident'){_0x1c30ab={'method':'POST','uri':_0x523e50+_0xe8d7('0x37'),'body':Object[_0xe8d7('0x38')]({},{'title':intUtil['getString'](_0x49806c[_0xe8d7('0x39')],_0x3777a3,'\x20'),'description':intUtil['getString'](_0x49806c[_0xe8d7('0x3a')],_0x3777a3,'\x0a'),'customerid_contact@odata.bind':_0xe8d7('0x3b')+_0x39c6a1[_0xe8d7('0x2f')]+')','ownerid@odata.bind':_0xe8d7('0x29')+_0x39c6a1[_0xe8d7('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x49806c[_0xe8d7('0x3c')],_0x3777a3,_0x49806c[_0xe8d7('0x36')])),'headers':{'Authorization':_0xe8d7('0x14')+_0x31caf3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x49806c[_0xe8d7('0x36')]===_0xe8d7('0x3d')){_0x1c30ab={'method':_0xe8d7('0xa'),'uri':_0x523e50+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xe8d7('0x3e')](_0x49806c[_0xe8d7('0x39')],_0x3777a3,'\x20'),'phonenumber':String(_0x3777a3[_0xe8d7('0x27')]),'description':intUtil[_0xe8d7('0x3e')](_0x49806c[_0xe8d7('0x3a')],_0x3777a3,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe8d7('0x3b')+_0x39c6a1[_0xe8d7('0x2f')]+')','ownerid@odata.bind':_0xe8d7('0x29')+_0x39c6a1[_0xe8d7('0x1d')]+')','directioncode':_0x39c6a1['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xe8d7('0x29')+_0x39c6a1[_0xe8d7('0x1d')]+')','participationtypemask':_0x39c6a1[_0xe8d7('0x3f')]===_0xe8d7('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0xe8d7('0x3b')+_0x39c6a1[_0xe8d7('0x2f')]+')','participationtypemask':_0x39c6a1[_0xe8d7('0x3f')]===_0xe8d7('0x40')?0x1:0x2}]},getCustomFields(_0x49806c['Fields'],_0x3777a3,_0x49806c[_0xe8d7('0x36')])),'headers':{'Authorization':_0xe8d7('0x14')+_0x31caf3,'OData-Version':_0xe8d7('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1c30ab);})['then'](function(_0x172251){var _0x4f5380=_0x172251[_0xe8d7('0x41')][_0xe8d7('0x2a')];var _0x174713=_0x4f5380['substring'](_0x4f5380[_0xe8d7('0x2c')]('(')+0x1,_0x4f5380[_0xe8d7('0x2c')](')'));_0x39c6a1[_0xe8d7('0x42')]=_0x174713;_0x1d71a9(_0x39c6a1);})[_0xe8d7('0xe')](function(_0x2549b2){_0x1be7ef(_0x2549b2[_0xe8d7('0x11')]);});});}function emit(_0x504f85,_0x196159,_0x3d2220,_0x1bdfec){var _0x410d0d={'uri':util['format'](_0xe8d7('0x43'),_0x504f85,_0x3d2220,_0x1bdfec)};io['to'](util[_0xe8d7('0x44')](_0xe8d7('0x45'),_0x196159))[_0xe8d7('0x46')](_0xe8d7('0x47'),_0x410d0d);}exports['cs']=function(_0x105fb8,_0x16eaaa,_0x33eacd,_0x2eee32,_0xdf6430,_0xf3eb66,_0x5232c8,_0x205b12){var _0x91b606={};_0xf3eb66['remoteUri']=intUtil['stripTrailingSlash'](_0xf3eb66[_0xe8d7('0x48')]);_0xf3eb66[_0xe8d7('0x49')]=intUtil[_0xe8d7('0x4a')](_0xf3eb66[_0xe8d7('0x49')]);_0x91b606[_0xe8d7('0x3f')]=_0x205b12===_0xe8d7('0x40')||_0x205b12===_0xe8d7('0x4b')?_0xe8d7('0x40'):'outbound';var _0x3f04da=util[_0xe8d7('0x44')](_0xe8d7('0x4c'),_0xf3eb66[_0xe8d7('0x48')]);var _0x2b4cc2=util[_0xe8d7('0x44')]('https://login.microsoftonline.com/%s/oauth2/token',_0xf3eb66[_0xe8d7('0x4d')]);var _0xd2bd2b=util[_0xe8d7('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf3eb66[_0xe8d7('0x49')],_0x16eaaa[_0xe8d7('0x4e')],md5(_0x16eaaa['uniqueid']));if(_0xdf6430&&_0xdf6430['monitor_format']){logger[_0xe8d7('0x1f')](_0xe8d7('0x4f'),_0xe8d7('0x50'));_0x16eaaa[_0xe8d7('0x51')]=_0xd2bd2b;}else if(_0x5232c8&&_0x5232c8['recordingFormat']&&_0x5232c8[_0xe8d7('0x52')]!==_0xe8d7('0x53')){logger[_0xe8d7('0x1f')](_0xe8d7('0x54'),_0xe8d7('0x50'));_0x16eaaa[_0xe8d7('0x51')]=_0xd2bd2b;}else{_0x16eaaa[_0xe8d7('0x51')]='';}return getUser(_0x91b606,_0xf3eb66,_0x2eee32,_0x2b4cc2,_0x3f04da,_0x205b12)[_0xe8d7('0xc')](function(_0x47a6cc){logger['info']('['+_0x205b12['toUpperCase']()+_0xe8d7('0x55'),_0x47a6cc[_0xe8d7('0x1d')]);logger[_0xe8d7('0x1f')]('['+_0x205b12[_0xe8d7('0xf')]()+_0xe8d7('0x56'),_0x47a6cc[_0xe8d7('0x1a')]);return getEndUser(_0x47a6cc,_0xf3eb66,_0x2b4cc2,_0x3f04da,_0x16eaaa,_0x205b12);})['then'](function(_0x2e4906){logger[_0xe8d7('0x1f')]('['+_0x205b12['toUpperCase']()+_0xe8d7('0x57'),_0x2e4906[_0xe8d7('0x2f')]);logger[_0xe8d7('0x1f')]('['+_0x205b12[_0xe8d7('0xf')]()+_0xe8d7('0x58'),_0x16eaaa[_0xe8d7('0x27')]);return getTicket(_0x2e4906,_0xf3eb66,_0x2b4cc2,_0x3f04da,_0x16eaaa,_0x33eacd,_0x205b12);})[_0xe8d7('0xc')](function(_0x5a801c){logger[_0xe8d7('0x1f')](util['format']('['+_0x205b12['toUpperCase']()+_0xe8d7('0x59'),_0x33eacd['ticketType'],_0x5a801c[_0xe8d7('0x42')]));logger['info'](util[_0xe8d7('0x44')]('['+_0x205b12['toUpperCase']()+_0xe8d7('0x5a'),_0x205b12));if(_0x205b12!==_0xe8d7('0x4b')){logger['info']('['+_0x205b12[_0xe8d7('0xf')]()+']',_0xe8d7('0x5b'));emit(_0xf3eb66[_0xe8d7('0x48')],_0x2eee32[_0xe8d7('0x5c')],_0x33eacd[_0xe8d7('0x36')],_0x5a801c[_0xe8d7('0x42')]);}})[_0xe8d7('0xe')](function(_0x1302bf){logger[_0xe8d7('0x5d')]('['+_0x205b12[_0xe8d7('0xf')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xe8d7('0x5e')](_0x1302bf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc718=['username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','internalemailaddress','catch','toLowerCase','destcalleridnum','calleridnum','POST','/systemusers(','userId','Bearer\x20','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','telephone1','contactid',']\x20Enduser\x20created!','forEach','type','string','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','headers','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','md5','ioredis','../../../../config/environment','localhost','redis','clientId','remoteUri'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xc718,0xb6));var _0x8c71=function(_0x564d3f,_0x380496){_0x564d3f=_0x564d3f-0x0;var _0x187a4f=_0xc718[_0x564d3f];return _0x187a4f;};'use strict';var _=require(_0x8c71('0x0'));var BPromise=require('bluebird');var rp=require(_0x8c71('0x1'));var util=require(_0x8c71('0x2'));var intUtil=require('./util');var md5=require(_0x8c71('0x3'));var Redis=require(_0x8c71('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x8c71('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x8c71('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8c71('0x7')]));function getAuthToken(_0x10c4a,_0x29f3b7,_0x143ca0){var _0x45e21c={'method':'POST','uri':_0x29f3b7,'form':{'client_id':_0x10c4a[_0x8c71('0x8')],'resource':_0x10c4a[_0x8c71('0x9')],'username':_0x10c4a[_0x8c71('0xa')],'password':_0x10c4a[_0x8c71('0xb')],'grant_type':_0x8c71('0xb'),'client_secret':_0x10c4a[_0x8c71('0xc')]},'json':!![]};return rp(_0x45e21c)[_0x8c71('0xd')](function(_0x6d309e){return _0x6d309e[_0x8c71('0xe')];})['catch'](function(_0x386eea){logger[_0x8c71('0xf')]('['+[_0x143ca0[_0x8c71('0x10')]()]+_0x8c71('0x11'));return _0x386eea[_0x8c71('0x12')];});}function getUser(_0x244644,_0xa05caf,_0x2b26f1,_0xccdc43,_0x1a29b7,_0x38fd39){return new BPromise(function(_0x310a66,_0x165edf){return getAuthToken(_0xa05caf,_0xccdc43,_0x38fd39)[_0x8c71('0xd')](function(_0x2c56a3){var _0x157334={'method':_0x8c71('0x13'),'uri':_0x1a29b7+_0x8c71('0x14'),'headers':{'Authorization':'Bearer\x20'+_0x2c56a3,'OData-Version':_0x8c71('0x15')},'json':!![]};return rp(_0x157334);})[_0x8c71('0xd')](function(_0x4ffa9a){var _0x4f9403=_0x4ffa9a[_0x8c71('0x16')];var _0x18986c=![];var _0x4bdfa7=null;if(!_[_0x8c71('0x17')](_0x2b26f1)){if(intUtil['validateEmail'](_0x2b26f1[_0x8c71('0x18')])){_0x244644['userEmail']=_0x2b26f1[_0x8c71('0x18')];for(_0x4bdfa7=0x0;_0x4bdfa7<_0x4f9403[_0x8c71('0x19')];_0x4bdfa7++){if(_0x4f9403[_0x4bdfa7]['internalemailaddress']===_0x2b26f1[_0x8c71('0x18')]&&!_0x4f9403[_0x4bdfa7][_0x8c71('0x1a')]){_0x18986c=!![];logger[_0x8c71('0x1b')]('['+[_0x38fd39[_0x8c71('0x10')]()]+_0x8c71('0x1c')+_0x4f9403[_0x4bdfa7][_0x8c71('0x1d')]+'!');_0x244644['userId']=_0x4f9403[_0x4bdfa7][_0x8c71('0x1d')];}}}}if(!_0x18986c){logger['info']('['+[_0x38fd39['toUpperCase']()]+_0x8c71('0x1e'));_0x244644[_0x8c71('0x1f')]=_0xa05caf['username'];for(_0x4bdfa7=0x0;_0x4bdfa7<_0x4f9403[_0x8c71('0x19')];_0x4bdfa7++){if(_0x4f9403[_0x4bdfa7][_0x8c71('0x20')]===_0xa05caf['username']){_0x244644['userId']=_0x4f9403[_0x4bdfa7][_0x8c71('0x1d')];}}}_0x310a66(_0x244644);})[_0x8c71('0x21')](function(_0x2e39ce){_0x165edf(_0x2e39ce[_0x8c71('0x12')]);});});}function createEndUser(_0x332bce,_0x359392,_0x4c3800,_0x3c4d5d,_0x4b07dd,_0x4c12af){return new BPromise(function(_0x4f69ce,_0x1d93cd){return getAuthToken(_0x359392,_0x4c3800,_0x4c12af)['then'](function(_0x2415f0){var _0x17f22e=_0x4c12af[_0x8c71('0x22')]()==='outbound'?_0x4b07dd[_0x8c71('0x23')]:_0x4b07dd[_0x8c71('0x24')];var _0x4d7072={'method':_0x8c71('0x25'),'uri':_0x3c4d5d+'contacts','body':{'telephone1':_0x17f22e,'fullname':_0x17f22e,'firstname':_0x17f22e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8c71('0x26')+_0x332bce[_0x8c71('0x27')]+')'},'headers':{'Authorization':_0x8c71('0x28')+_0x2415f0,'OData-Version':_0x8c71('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4d7072);})[_0x8c71('0xd')](function(_0x2964c5){var _0x2fc088=_0x2964c5['headers']['odata-entityid'];var _0x291ebd=_0x2fc088[_0x8c71('0x29')](_0x2fc088[_0x8c71('0x2a')]('(')+0x1,_0x2fc088['lastIndexOf'](')'));_0x332bce[_0x8c71('0x2b')]=_0x291ebd;_0x4f69ce(_0x332bce);})[_0x8c71('0x21')](function(_0x4ab3cf){_0x1d93cd(_0x4ab3cf[_0x8c71('0x12')]);});});}function getEndUser(_0x795447,_0x3da3a5,_0x55dbc4,_0x5c3772,_0x257958,_0x4cc9d7){return new BPromise(function(_0x1b931b,_0x615bf7){return getAuthToken(_0x3da3a5,_0x55dbc4,_0x4cc9d7)[_0x8c71('0xd')](function(_0x1f6805){var _0x133a6a={'method':_0x8c71('0x13'),'uri':_0x5c3772+_0x8c71('0x2c'),'headers':{'Authorization':_0x8c71('0x28')+_0x1f6805,'If-None-Match':null,'OData-Version':_0x8c71('0x15')},'json':!![]};return rp(_0x133a6a);})[_0x8c71('0xd')](function(_0x3dca3d){var _0x5a1726=null;if(_0x3dca3d){var _0x176506=_0x3dca3d['value'];var _0x34bc3f=![];for(_0x5a1726=0x0;_0x5a1726<_0x176506[_0x8c71('0x19')];_0x5a1726++){var _0xfcde3d=_0x4cc9d7[_0x8c71('0x22')]()===_0x8c71('0x2d')?_0x257958[_0x8c71('0x23')]:_0x257958[_0x8c71('0x24')];if(_0x176506[_0x5a1726][_0x8c71('0x2e')]===_0xfcde3d){_0x34bc3f=!![];_0x795447[_0x8c71('0x2b')]=_0x176506[_0x5a1726][_0x8c71('0x2f')];}}if(_0x34bc3f){_0x1b931b(_0x795447);}else{return createEndUser(_0x795447,_0x3da3a5,_0x55dbc4,_0x5c3772,_0x257958,_0x4cc9d7)[_0x8c71('0xd')](function(_0x15f40f){logger[_0x8c71('0x1b')]('['+[_0x4cc9d7[_0x8c71('0x10')]()]+_0x8c71('0x30'),_0x15f40f[_0x8c71('0x2b')]);_0x1b931b(_0x15f40f);});}}else{return createEndUser(_0x795447,_0x3da3a5,_0x55dbc4,_0x5c3772,_0x257958,_0x4cc9d7)['then'](function(_0x14c66c){logger[_0x8c71('0x1b')]('['+[_0x4cc9d7['toUpperCase']()]+']\x20Enduser\x20Created!',_0x14c66c[_0x8c71('0x2b')]);_0x1b931b(_0x14c66c);});}});});}function getCustomFields(_0xf584f5,_0x3c886c,_0x5d805e){var _0xf91329={};if(_0xf584f5[_0x8c71('0x19')]>0x0){_[_0x8c71('0x31')](_0xf584f5,function(_0x2c0e20){if(_0x2c0e20[_0x8c71('0x32')]===_0x8c71('0x33')&&_0x2c0e20[_0x8c71('0x34')]&&!_0x2c0e20[_0x8c71('0x35')]){var _0x387707=_0x2c0e20[_0x8c71('0x36')][_0x8c71('0x22')]();var _0x42920f=_0x387707[_0x8c71('0x29')](0x0,_0x387707[_0x8c71('0x37')]('_'));var _0x3b9fe6=_0x387707[_0x8c71('0x29')](_0x387707[_0x8c71('0x37')]('_')+0x1);if(_0x42920f===_0x5d805e){_0xf91329[_0x3b9fe6]=_0x2c0e20[_0x8c71('0x38')];}}});}return _0xf91329;}function getTicket(_0x179d52,_0x5015c3,_0x2004fd,_0x2c9610,_0x229bfd,_0x2d893c,_0x2b3cd2){return new BPromise(function(_0x18c266,_0x249890){var _0x3a5c81;return getAuthToken(_0x5015c3,_0x2004fd,_0x2b3cd2)[_0x8c71('0xd')](function(_0x560f6e){if(_0x2d893c[_0x8c71('0x39')]===_0x8c71('0x3a')){_0x3a5c81={'method':_0x8c71('0x25'),'uri':_0x2c9610+_0x8c71('0x3b'),'body':Object[_0x8c71('0x3c')]({},{'title':intUtil[_0x8c71('0x3d')](_0x2d893c[_0x8c71('0x3e')],_0x229bfd,'\x20'),'description':intUtil[_0x8c71('0x3d')](_0x2d893c[_0x8c71('0x3f')],_0x229bfd,'\x0a'),'customerid_contact@odata.bind':_0x8c71('0x40')+_0x179d52[_0x8c71('0x2b')]+')','ownerid@odata.bind':_0x8c71('0x26')+_0x179d52[_0x8c71('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x2d893c[_0x8c71('0x41')],_0x229bfd,_0x2d893c[_0x8c71('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0x560f6e,'OData-Version':_0x8c71('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2d893c['ticketType']==='phonecall'){_0x3a5c81={'method':_0x8c71('0x25'),'uri':_0x2c9610+'phonecalls','body':Object[_0x8c71('0x3c')]({},{'subject':intUtil[_0x8c71('0x3d')](_0x2d893c[_0x8c71('0x3e')],_0x229bfd,'\x20'),'phonenumber':String(_0x229bfd[_0x8c71('0x24')]),'description':intUtil['getString'](_0x2d893c[_0x8c71('0x3f')],_0x229bfd,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x179d52['enduserId']+')','ownerid@odata.bind':_0x8c71('0x26')+_0x179d52[_0x8c71('0x27')]+')','directioncode':_0x179d52[_0x8c71('0x42')]===_0x8c71('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x179d52[_0x8c71('0x27')]+')','participationtypemask':_0x179d52['callDirection']===_0x8c71('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x8c71('0x40')+_0x179d52[_0x8c71('0x2b')]+')','participationtypemask':_0x179d52[_0x8c71('0x42')]==='queue'?0x1:0x2}]},getCustomFields(_0x2d893c[_0x8c71('0x41')],_0x229bfd,_0x2d893c[_0x8c71('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0x560f6e,'OData-Version':_0x8c71('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3a5c81);})[_0x8c71('0xd')](function(_0x337483){var _0xd4e0cd=_0x337483[_0x8c71('0x44')][_0x8c71('0x45')];var _0x57717e=_0xd4e0cd['substring'](_0xd4e0cd[_0x8c71('0x2a')]('(')+0x1,_0xd4e0cd['lastIndexOf'](')'));_0x179d52['ticketId']=_0x57717e;_0x18c266(_0x179d52);})[_0x8c71('0x21')](function(_0x1aa48e){_0x249890(_0x1aa48e[_0x8c71('0x12')]);});});}function emit(_0x3a25d3,_0x4890fc,_0x1eb058,_0x4e448b){var _0x25e9e5={'uri':util[_0x8c71('0x46')](_0x8c71('0x47'),_0x3a25d3,_0x1eb058,_0x4e448b)};io['to'](util[_0x8c71('0x46')](_0x8c71('0x48'),_0x4890fc))[_0x8c71('0x49')]('trigger:browser:url',_0x25e9e5);}exports['cs']=function(_0x5f1193,_0xd40fe0,_0x40ae31,_0x336940,_0x17e39f,_0x5f269a,_0x10df81,_0x2b95af){var _0x268938={};_0x5f269a[_0x8c71('0x9')]=intUtil['stripTrailingSlash'](_0x5f269a['remoteUri']);_0x5f269a[_0x8c71('0x4a')]=intUtil[_0x8c71('0x4b')](_0x5f269a[_0x8c71('0x4a')]);_0x268938['callDirection']=_0x2b95af===_0x8c71('0x43')||_0x2b95af===_0x8c71('0x4c')?'queue':'outbound';var _0x37675=util[_0x8c71('0x46')](_0x8c71('0x4d'),_0x5f269a['remoteUri']);var _0x2000e4=util[_0x8c71('0x46')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5f269a[_0x8c71('0x4e')]);var _0x4dda90=util['format'](_0x8c71('0x4f'),_0x5f269a[_0x8c71('0x4a')],_0xd40fe0['uniqueid'],md5(_0xd40fe0[_0x8c71('0x50')]));if(_0x17e39f&&_0x17e39f[_0x8c71('0x51')]){logger[_0x8c71('0x1b')](_0x8c71('0x52'),_0x8c71('0x53'));_0xd40fe0['recordingURL']=_0x4dda90;}else if(_0x10df81&&_0x10df81['recordingFormat']&&_0x10df81[_0x8c71('0x54')]!==_0x8c71('0x55')){logger[_0x8c71('0x1b')](_0x8c71('0x56'),_0x8c71('0x53'));_0xd40fe0[_0x8c71('0x57')]=_0x4dda90;}else{_0xd40fe0[_0x8c71('0x57')]='';}return getUser(_0x268938,_0x5f269a,_0x336940,_0x2000e4,_0x37675,_0x2b95af)['then'](function(_0x249ab3){logger[_0x8c71('0x1b')]('['+_0x2b95af[_0x8c71('0x10')]()+']\x20The\x20User\x20ID\x20is:',_0x249ab3[_0x8c71('0x27')]);logger[_0x8c71('0x1b')]('['+_0x2b95af[_0x8c71('0x10')]()+_0x8c71('0x58'),_0x249ab3['userEmail']);return getEndUser(_0x249ab3,_0x5f269a,_0x2000e4,_0x37675,_0xd40fe0,_0x2b95af);})['then'](function(_0x80f1a6){logger[_0x8c71('0x1b')]('['+_0x2b95af[_0x8c71('0x10')]()+_0x8c71('0x59'),_0x80f1a6[_0x8c71('0x2b')]);logger[_0x8c71('0x1b')]('['+_0x2b95af[_0x8c71('0x10')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd40fe0[_0x8c71('0x24')]);return getTicket(_0x80f1a6,_0x5f269a,_0x2000e4,_0x37675,_0xd40fe0,_0x40ae31,_0x2b95af);})['then'](function(_0x4e789f){logger[_0x8c71('0x1b')](util['format']('['+_0x2b95af[_0x8c71('0x10')]()+_0x8c71('0x5a'),_0x40ae31[_0x8c71('0x39')],_0x4e789f[_0x8c71('0x5b')]));logger[_0x8c71('0x1b')](util[_0x8c71('0x46')]('['+_0x2b95af[_0x8c71('0x10')]()+']\x20Call\x20direction:\x20%s',_0x2b95af));if(_0x2b95af!=='abandoned'){logger[_0x8c71('0x1b')]('['+_0x2b95af[_0x8c71('0x10')]()+']',_0x8c71('0x5c'));emit(_0x5f269a[_0x8c71('0x9')],_0x336940[_0x8c71('0x5d')],_0x40ae31['ticketType'],_0x4e789f[_0x8c71('0x5b')]);}})[_0x8c71('0x21')](function(_0xe3d3ee){logger[_0x8c71('0xf')]('['+_0x2b95af[_0x8c71('0x10')]()+_0x8c71('0x5e'),util[_0x8c71('0x5f')](_0xe3d3ee,{'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 a3ea53e..81b859b 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 _0x0ba2=['The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','recordingFormat','none','destcalleridname','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','catch','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','calleridname','calleridnum','getString','Descriptions','Tags','name','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','remoteUri','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','apiKey','toString','base64','[HTTP]','stringify','map','forEach','string','nameField','customField','content','type','push','idField','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:'];(function(_0x26447e,_0x2e9c94){var _0x38cc1a=function(_0x4f1170){while(--_0x4f1170){_0x26447e['push'](_0x26447e['shift']());}};_0x38cc1a(++_0x2e9c94);}(_0x0ba2,0x118));var _0x20ba=function(_0x49e132,_0xaf827a){_0x49e132=_0x49e132-0x0;var _0x6403c2=_0x0ba2[_0x49e132];return _0x6403c2;};'use strict';var _=require(_0x20ba('0x0'));var rp=require(_0x20ba('0x1'));var md5=require(_0x20ba('0x2'));var util=require(_0x20ba('0x3'));var Redis=require('ioredis');var intUtil=require(_0x20ba('0x4'));var config=require(_0x20ba('0x5'));var logger=require(_0x20ba('0x6'))('freshdesk');config[_0x20ba('0x7')]=_[_0x20ba('0x8')](config['redis'],{'host':_0x20ba('0x9'),'port':0x18eb});var io=require(_0x20ba('0xa'))(new Redis(config[_0x20ba('0x7')]));var headers={'Content-Type':_0x20ba('0xb'),'Accept':'application/json'};function emit(_0x12e7de,_0x1a55e7,_0x200749){io['to'](_0x12e7de)[_0x20ba('0xc')](_0x1a55e7,_0x200749);}function getTicket(_0x35726b,_0x5d24f7,_0x545bc4,_0x1cad6a,_0x471fa8){logger['info'](_0x20ba('0xd'));var _0x4f95a4=_['merge']({'responder_id':_0x5d24f7['id'],'requester_id':_0x545bc4['id'],'name':util['format']('Caller\x20-\x20%s',_0x471fa8[_0x20ba('0xe')]),'phone':_0x471fa8[_0x20ba('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x20ba('0x10')](_0x1cad6a['Subjects'],_0x471fa8,'\x20'),'description':intUtil[_0x20ba('0x10')](_0x1cad6a[_0x20ba('0x11')],_0x471fa8,'
'),'tags':getTags(_0x1cad6a[_0x20ba('0x12')],_0x20ba('0x13'))},getCustomFields(_0x1cad6a['Fields'],_0x471fa8));_0x4f95a4['custom_fields']=_[_0x20ba('0x14')](_[_0x20ba('0x15')](_0x4f95a4[_0x20ba('0x16')],'id'),_0x20ba('0x17'));return request({'uri':util[_0x20ba('0x18')](_0x20ba('0x19'),_0x35726b[_0x20ba('0x1a')]),'method':'POST','body':_0x4f95a4})[_0x20ba('0x1b')](function(_0x512c92){logger[_0x20ba('0x1c')]('Ticket\x20created!');return _0x512c92;});}function getUser(_0x546e01,_0x30eb33){if(intUtil[_0x20ba('0x1d')](_0x30eb33)){return request({'uri':util['format'](_0x20ba('0x1e'),_0x546e01[_0x20ba('0x1a')]),'qs':{'email':_0x30eb33}})[_0x20ba('0x1b')](function(_0x322eb3){if(_0x322eb3[_0x20ba('0x1f')]){logger[_0x20ba('0x1c')](_0x20ba('0x20'));return _[_0x20ba('0x21')](_0x322eb3,function(_0x48fb73){return _0x48fb73['contact'][_0x20ba('0x22')]===_0x30eb33;});}else{logger[_0x20ba('0x1c')](_0x20ba('0x23'));return request({'uri':util[_0x20ba('0x18')](_0x20ba('0x24'),_0x546e01[_0x20ba('0x1a')])})['then'](function(_0x1fb8c2){logger['info'](_0x20ba('0x25'));return _0x1fb8c2;});}});}else{logger[_0x20ba('0x1c')](_0x20ba('0x26'));return request({'uri':util[_0x20ba('0x18')](_0x20ba('0x24'),_0x546e01[_0x20ba('0x1a')])})['then'](function(_0xb20ac1){logger['info']('Admin\x20account\x20selected.');return _0xb20ac1;});}}function getEndUser(_0x24ba30,_0x59ad36,_0x287684){logger[_0x20ba('0x1c')]('Searching\x20enduser\x20with\x20phone',_0x287684);return request({'uri':util['format'](_0x20ba('0x27'),_0x24ba30[_0x20ba('0x1a')]),'qs':{'phone':_0x287684}})[_0x20ba('0x1b')](function(_0x4dc7b9){if(_0x4dc7b9[_0x20ba('0x1f')]){logger[_0x20ba('0x1c')]('Enduser\x20found!');return _[_0x20ba('0x21')](_0x4dc7b9,{'phone':_0x287684});}else{logger['info'](_0x20ba('0x28'));return request({'uri':util[_0x20ba('0x18')]('%s/api/v2/contacts',_0x24ba30[_0x20ba('0x1a')]),'method':_0x20ba('0x29'),'body':{'name':_0x59ad36,'phone':_0x287684}})[_0x20ba('0x1b')](function(_0x3d98bf){logger[_0x20ba('0x1c')]('Enduser\x20created.');return _0x3d98bf;});}});}function getAuth(_0x18c1a8){return util[_0x20ba('0x18')]('Basic\x20%s',new Buffer(_0x18c1a8[_0x20ba('0x2a')]+':X')[_0x20ba('0x2b')](_0x20ba('0x2c')));}function request(_0xecd167){logger['debug'](_0x20ba('0x2d'),JSON[_0x20ba('0x2e')](_0xecd167));return rp(_['defaults'](_0xecd167,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x17661f,_0x61de6a){var _0x5b4f30=[];if(_0x17661f&&_0x17661f['length']>0x0){_0x5b4f30=_[_0x20ba('0x2f')](_0x17661f,_0x61de6a);}return _0x5b4f30;}function getCustomFields(_0x5a55ac,_0x4b86ed){var _0x54947f=[];var _0x1de66d={'custom_fields':[]};if(_0x5a55ac[_0x20ba('0x1f')]>0x0){_[_0x20ba('0x30')](_0x5a55ac,function(_0x136ed2){if(_0x136ed2['type']===_0x20ba('0x31')&&_0x136ed2[_0x20ba('0x32')]&&!_0x136ed2[_0x20ba('0x33')]){_0x1de66d[_0x136ed2[_0x20ba('0x32')]['toLowerCase']()]=_0x136ed2[_0x20ba('0x34')][_0x20ba('0x2b')]();}else if(_0x136ed2[_0x20ba('0x35')]===_0x20ba('0x31')&&_0x136ed2['idField']&&_0x136ed2[_0x20ba('0x33')]){_0x1de66d[_0x20ba('0x16')][_0x20ba('0x36')]({'id':_0x136ed2[_0x20ba('0x37')],'value':_0x136ed2['content']['toString']()});}else if(_0x136ed2[_0x20ba('0x35')]===_0x20ba('0x38')&&_0x136ed2['variableName']&&_0x136ed2[_0x20ba('0x37')]&&_0x136ed2[_0x20ba('0x33')]){_0x4b86ed[_0x136ed2[_0x20ba('0x39')]]&&_0x1de66d[_0x20ba('0x16')]['push']({'id':_0x136ed2[_0x20ba('0x37')],'value':_0x4b86ed[_0x136ed2[_0x20ba('0x39')]][_0x20ba('0x2b')]()});}else if(_0x136ed2[_0x20ba('0x35')]===_0x20ba('0x3a')&&_0x136ed2[_0x20ba('0x3b')]&&_0x136ed2[_0x20ba('0x3b')][_0x20ba('0x13')]&&_0x136ed2[_0x20ba('0x37')]&&_0x136ed2[_0x20ba('0x33')]){_0x4b86ed[_0x136ed2[_0x20ba('0x3b')][_0x20ba('0x13')][_0x20ba('0x3c')]()]&&_0x1de66d[_0x20ba('0x16')][_0x20ba('0x36')]({'id':_0x136ed2[_0x20ba('0x37')],'value':_0x4b86ed[_0x136ed2['Variable'][_0x20ba('0x13')]['toLowerCase']()][_0x20ba('0x2b')]()});}});}return _0x1de66d;}exports[_0x20ba('0x3d')]=function(_0x43bc71,_0x585af2,_0x511c0d,_0x4728f2,_0x52f745,_0x3a5c63){var _0xe661c0,_0x1cf2b3;_0x3a5c63[_0x20ba('0x1a')]=intUtil[_0x20ba('0x3e')](_0x3a5c63[_0x20ba('0x1a')]);_0x3a5c63[_0x20ba('0x3f')]=intUtil[_0x20ba('0x3e')](_0x3a5c63[_0x20ba('0x3f')]);if(_0x52f745&&_0x52f745[_0x20ba('0x40')]){logger[_0x20ba('0x1c')](_0x20ba('0x41'),_0x20ba('0x42'));_0x585af2[_0x20ba('0x43')]=util['format'](_0x20ba('0x44'),_0x3a5c63[_0x20ba('0x3f')],_0x585af2[_0x20ba('0x45')],md5(_0x585af2[_0x20ba('0x45')]));}else{_0x585af2[_0x20ba('0x43')]='';}headers[_0x20ba('0x46')]=getAuth(_0x3a5c63);return getUser(_0x3a5c63,_0x4728f2[_0x20ba('0x22')])[_0x20ba('0x1b')](function(_0x118704){_0xe661c0=_0x118704;logger[_0x20ba('0x1c')](_0x20ba('0x47'),_0xe661c0['id']);return getEndUser(_0x3a5c63,_0x585af2[_0x20ba('0xe')],_0x585af2['calleridnum']);})['then'](function(_0xfcaace){_0x1cf2b3=_0xfcaace;logger[_0x20ba('0x1c')](_0x20ba('0x48'),_0x1cf2b3['id']);return getTicket(_0x3a5c63,_0xe661c0,_0x1cf2b3,_0x511c0d,_0x585af2);})[_0x20ba('0x1b')](function(_0x2a6635){if(_0x2a6635&&_0x2a6635['id']){logger['info']('Ticket\x20created!');logger[_0x20ba('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x2a6635['id']);logger[_0x20ba('0x1c')](_0x20ba('0x41'),_0x20ba('0x49'));emit(util['format'](_0x20ba('0x4a'),_0x4728f2[_0x20ba('0x13')]),_0x20ba('0x4b'),{'uri':util[_0x20ba('0x18')]('%s/helpdesk/tickets/%d',_0x3a5c63[_0x20ba('0x1a')],_0x2a6635['id'])});}})['catch'](function(_0x1472d8){logger[_0x20ba('0x4c')](_0x20ba('0x41'),JSON[_0x20ba('0x2e')](_0x1472d8));});};exports['outbound']=function(_0x4edbcc,_0x3f966d,_0x11b4ff,_0x2df00e,_0x42cf48,_0x237846,_0xee149e){var _0x3637f1,_0x138836;_0x237846[_0x20ba('0x1a')]=intUtil['stripTrailingSlash'](_0x237846[_0x20ba('0x1a')]);_0x237846[_0x20ba('0x3f')]=intUtil[_0x20ba('0x3e')](_0x237846['serverUrl']);if(_0xee149e&&_0xee149e[_0x20ba('0x4d')]&&_0xee149e['recordingFormat']!==_0x20ba('0x4e')){logger['info']('[OUTBOUND]',_0x20ba('0x42'));_0x3f966d['recordingURL']=util[_0x20ba('0x18')](_0x20ba('0x44'),_0x237846[_0x20ba('0x3f')],_0x3f966d[_0x20ba('0x45')],md5(_0x3f966d[_0x20ba('0x45')]));}headers[_0x20ba('0x46')]=getAuth(_0x237846);return getUser(_0x237846,_0x2df00e['email'])[_0x20ba('0x1b')](function(_0x30173f){_0x3637f1=_0x30173f;logger['info']('The\x20User\x20ID\x20is:',_0x3637f1['id']);return getEndUser(_0x237846,_0x3f966d[_0x20ba('0x4f')],_0x3f966d[_0x20ba('0x50')]);})[_0x20ba('0x1b')](function(_0x5d2517){_0x138836=_0x5d2517;logger['info'](_0x20ba('0x48'),_0x138836['id']);return getTicket(_0x237846,_0x3637f1,_0x138836,_0x11b4ff,_0x3f966d);})[_0x20ba('0x1b')](function(_0x35dd1a){if(_0x35dd1a&&_0x35dd1a['id']){logger[_0x20ba('0x1c')](_0x20ba('0x51'));logger[_0x20ba('0x1c')](_0x20ba('0x52'),_0x35dd1a['id']);logger['info'](_0x20ba('0x53'),_0x20ba('0x49'));emit(util[_0x20ba('0x18')](_0x20ba('0x4a'),_0x2df00e[_0x20ba('0x13')]),_0x20ba('0x4b'),{'uri':util[_0x20ba('0x18')](_0x20ba('0x54'),_0x237846[_0x20ba('0x1a')],_0x35dd1a['id'])});}})['catch'](function(_0xfaa5bc){logger[_0x20ba('0x4c')](_0x20ba('0x53'),JSON[_0x20ba('0x2e')](_0xfaa5bc));});};exports[_0x20ba('0x55')]=function(_0x27d0e5,_0x1a9204,_0x5556d0,_0x1b43ee,_0x313283,_0x53d546){var _0x2a5514,_0x45606e;_0x53d546['remoteUri']=intUtil['stripTrailingSlash'](_0x53d546[_0x20ba('0x1a')]);_0x53d546[_0x20ba('0x3f')]=intUtil[_0x20ba('0x3e')](_0x53d546[_0x20ba('0x3f')]);if(_0x313283&&_0x313283['monitor_format']){logger[_0x20ba('0x1c')](_0x20ba('0x56'),_0x20ba('0x42'));_0x1a9204[_0x20ba('0x43')]=util[_0x20ba('0x18')](_0x20ba('0x44'),_0x53d546[_0x20ba('0x3f')],_0x1a9204[_0x20ba('0x45')],md5(_0x1a9204[_0x20ba('0x45')]));}else{_0x1a9204[_0x20ba('0x43')]='';}headers[_0x20ba('0x46')]=getAuth(_0x53d546);return getUser(_0x53d546,'')[_0x20ba('0x1b')](function(_0x1347b2){_0x2a5514=_0x1347b2;logger[_0x20ba('0x1c')](_0x20ba('0x47'),_0x2a5514['id']);return getEndUser(_0x53d546,_0x1a9204[_0x20ba('0xe')],_0x1a9204[_0x20ba('0xf')]);})[_0x20ba('0x1b')](function(_0x30a0d0){_0x45606e=_0x30a0d0;logger[_0x20ba('0x1c')](_0x20ba('0x48'),_0x45606e['id']);return getTicket(_0x53d546,_0x2a5514,_0x45606e,_0x5556d0,_0x1a9204);})[_0x20ba('0x1b')](function(_0x5a19db){if(_0x5a19db){logger[_0x20ba('0x1c')](_0x20ba('0x51'));logger[_0x20ba('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x5a19db['id']);}})[_0x20ba('0x57')](function(_0x186c4c){logger[_0x20ba('0x4c')](_0x20ba('0x56'),JSON[_0x20ba('0x2e')](_0x186c4c));});}; \ No newline at end of file +var _0xc1b4=['content','idField','push','type','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','error','lodash','request-promise','md5','util','ioredis','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','nameField','customField'];(function(_0x1f96d7,_0x20d141){var _0x728705=function(_0x55e0fd){while(--_0x55e0fd){_0x1f96d7['push'](_0x1f96d7['shift']());}};_0x728705(++_0x20d141);}(_0xc1b4,0x81));var _0x4c1b=function(_0x1805f4,_0xd126d3){_0x1805f4=_0x1805f4-0x0;var _0x490928=_0xc1b4[_0x1805f4];return _0x490928;};'use strict';var _=require(_0x4c1b('0x0'));var rp=require(_0x4c1b('0x1'));var md5=require(_0x4c1b('0x2'));var util=require(_0x4c1b('0x3'));var Redis=require(_0x4c1b('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x4c1b('0x5'))(_0x4c1b('0x6'));config[_0x4c1b('0x7')]=_[_0x4c1b('0x8')](config[_0x4c1b('0x7')],{'host':_0x4c1b('0x9'),'port':0x18eb});var io=require(_0x4c1b('0xa'))(new Redis(config[_0x4c1b('0x7')]));var headers={'Content-Type':_0x4c1b('0xb'),'Accept':'application/json'};function emit(_0x303db0,_0x36eb83,_0x6a43b2){io['to'](_0x303db0)[_0x4c1b('0xc')](_0x36eb83,_0x6a43b2);}function getTicket(_0x2d8c2c,_0x5efdee,_0x245c37,_0x384937,_0x461203){logger[_0x4c1b('0xd')]('Creating\x20new\x20ticket...');var _0x1792ea=_[_0x4c1b('0xe')]({'responder_id':_0x5efdee['id'],'requester_id':_0x245c37['id'],'name':util[_0x4c1b('0xf')]('Caller\x20-\x20%s',_0x461203[_0x4c1b('0x10')]),'phone':_0x461203[_0x4c1b('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4c1b('0x12')](_0x384937[_0x4c1b('0x13')],_0x461203,'\x20'),'description':intUtil['getString'](_0x384937[_0x4c1b('0x14')],_0x461203,_0x4c1b('0x15')),'tags':getTags(_0x384937[_0x4c1b('0x16')],_0x4c1b('0x17'))},getCustomFields(_0x384937[_0x4c1b('0x18')],_0x461203));_0x1792ea[_0x4c1b('0x19')]=_[_0x4c1b('0x1a')](_[_0x4c1b('0x1b')](_0x1792ea[_0x4c1b('0x19')],'id'),_0x4c1b('0x1c'));return request({'uri':util[_0x4c1b('0xf')](_0x4c1b('0x1d'),_0x2d8c2c[_0x4c1b('0x1e')]),'method':_0x4c1b('0x1f'),'body':_0x1792ea})['then'](function(_0x582110){logger['info'](_0x4c1b('0x20'));return _0x582110;});}function getUser(_0x197e12,_0x15e7db){if(intUtil[_0x4c1b('0x21')](_0x15e7db)){return request({'uri':util[_0x4c1b('0xf')](_0x4c1b('0x22'),_0x197e12['remoteUri']),'qs':{'email':_0x15e7db}})[_0x4c1b('0x23')](function(_0x4deba7){if(_0x4deba7[_0x4c1b('0x24')]){logger['info'](_0x4c1b('0x25'));return _[_0x4c1b('0x26')](_0x4deba7,function(_0x3955d8){return _0x3955d8[_0x4c1b('0x27')]['email']===_0x15e7db;});}else{logger['info'](_0x4c1b('0x28'));return request({'uri':util[_0x4c1b('0xf')]('%s/api/v2/agents/me',_0x197e12['remoteUri'])})[_0x4c1b('0x23')](function(_0x4543c){logger[_0x4c1b('0xd')](_0x4c1b('0x29'));return _0x4543c;});}});}else{logger[_0x4c1b('0xd')](_0x4c1b('0x2a'));return request({'uri':util[_0x4c1b('0xf')](_0x4c1b('0x2b'),_0x197e12[_0x4c1b('0x1e')])})[_0x4c1b('0x23')](function(_0x1dff17){logger[_0x4c1b('0xd')]('Admin\x20account\x20selected.');return _0x1dff17;});}}function getEndUser(_0x6e146f,_0x2e1ca7,_0x293a1a){logger[_0x4c1b('0xd')](_0x4c1b('0x2c'),_0x293a1a);return request({'uri':util[_0x4c1b('0xf')]('%s/api/v2/contacts',_0x6e146f['remoteUri']),'qs':{'phone':_0x293a1a}})[_0x4c1b('0x23')](function(_0x1602f6){if(_0x1602f6[_0x4c1b('0x24')]){logger['info'](_0x4c1b('0x2d'));return _[_0x4c1b('0x26')](_0x1602f6,{'phone':_0x293a1a});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4c1b('0xf')](_0x4c1b('0x2e'),_0x6e146f['remoteUri']),'method':_0x4c1b('0x1f'),'body':{'name':_0x2e1ca7,'phone':_0x293a1a}})[_0x4c1b('0x23')](function(_0x10f0f2){logger[_0x4c1b('0xd')](_0x4c1b('0x2f'));return _0x10f0f2;});}});}function getAuth(_0x3e7dc6){return util[_0x4c1b('0xf')](_0x4c1b('0x30'),new Buffer(_0x3e7dc6['apiKey']+':X')[_0x4c1b('0x31')](_0x4c1b('0x32')));}function request(_0x216f8d){logger['debug'](_0x4c1b('0x33'),JSON[_0x4c1b('0x34')](_0x216f8d));return rp(_[_0x4c1b('0x8')](_0x216f8d,{'method':_0x4c1b('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x4c1b55,_0x267509){var _0x480fb7=[];if(_0x4c1b55&&_0x4c1b55[_0x4c1b('0x24')]>0x0){_0x480fb7=_[_0x4c1b('0x36')](_0x4c1b55,_0x267509);}return _0x480fb7;}function getCustomFields(_0x3efd91,_0x14ec91){var _0x23a51c=[];var _0x76f0d8={'custom_fields':[]};if(_0x3efd91['length']>0x0){_[_0x4c1b('0x37')](_0x3efd91,function(_0x2f5717){if(_0x2f5717['type']===_0x4c1b('0x38')&&_0x2f5717[_0x4c1b('0x39')]&&!_0x2f5717[_0x4c1b('0x3a')]){_0x76f0d8[_0x2f5717['nameField']['toLowerCase']()]=_0x2f5717[_0x4c1b('0x3b')][_0x4c1b('0x31')]();}else if(_0x2f5717['type']===_0x4c1b('0x38')&&_0x2f5717[_0x4c1b('0x3c')]&&_0x2f5717[_0x4c1b('0x3a')]){_0x76f0d8[_0x4c1b('0x19')][_0x4c1b('0x3d')]({'id':_0x2f5717[_0x4c1b('0x3c')],'value':_0x2f5717['content'][_0x4c1b('0x31')]()});}else if(_0x2f5717[_0x4c1b('0x3e')]===_0x4c1b('0x3f')&&_0x2f5717[_0x4c1b('0x40')]&&_0x2f5717['idField']&&_0x2f5717['customField']){_0x14ec91[_0x2f5717[_0x4c1b('0x40')]]&&_0x76f0d8[_0x4c1b('0x19')][_0x4c1b('0x3d')]({'id':_0x2f5717[_0x4c1b('0x3c')],'value':_0x14ec91[_0x2f5717['variableName']][_0x4c1b('0x31')]()});}else if(_0x2f5717['type']===_0x4c1b('0x41')&&_0x2f5717[_0x4c1b('0x42')]&&_0x2f5717[_0x4c1b('0x42')][_0x4c1b('0x17')]&&_0x2f5717['idField']&&_0x2f5717['customField']){_0x14ec91[_0x2f5717[_0x4c1b('0x42')][_0x4c1b('0x17')][_0x4c1b('0x43')]()]&&_0x76f0d8[_0x4c1b('0x19')][_0x4c1b('0x3d')]({'id':_0x2f5717['idField'],'value':_0x14ec91[_0x2f5717[_0x4c1b('0x42')][_0x4c1b('0x17')][_0x4c1b('0x43')]()][_0x4c1b('0x31')]()});}});}return _0x76f0d8;}exports[_0x4c1b('0x44')]=function(_0x1c705b,_0x1d2a63,_0x232d44,_0x4f5611,_0x34c522,_0xacce80){var _0x411e76,_0x5a328f;_0xacce80[_0x4c1b('0x1e')]=intUtil[_0x4c1b('0x45')](_0xacce80[_0x4c1b('0x1e')]);_0xacce80[_0x4c1b('0x46')]=intUtil[_0x4c1b('0x45')](_0xacce80[_0x4c1b('0x46')]);if(_0x34c522&&_0x34c522['monitor_format']){logger[_0x4c1b('0xd')](_0x4c1b('0x47'),_0x4c1b('0x48'));_0x1d2a63[_0x4c1b('0x49')]=util[_0x4c1b('0xf')](_0x4c1b('0x4a'),_0xacce80[_0x4c1b('0x46')],_0x1d2a63['uniqueid'],md5(_0x1d2a63[_0x4c1b('0x4b')]));}else{_0x1d2a63[_0x4c1b('0x49')]='';}headers[_0x4c1b('0x4c')]=getAuth(_0xacce80);return getUser(_0xacce80,_0x4f5611[_0x4c1b('0x4d')])[_0x4c1b('0x23')](function(_0x2e0a7c){_0x411e76=_0x2e0a7c;logger[_0x4c1b('0xd')](_0x4c1b('0x4e'),_0x411e76['id']);return getEndUser(_0xacce80,_0x1d2a63[_0x4c1b('0x10')],_0x1d2a63['calleridnum']);})[_0x4c1b('0x23')](function(_0x5d280e){_0x5a328f=_0x5d280e;logger[_0x4c1b('0xd')](_0x4c1b('0x4f'),_0x5a328f['id']);return getTicket(_0xacce80,_0x411e76,_0x5a328f,_0x232d44,_0x1d2a63);})[_0x4c1b('0x23')](function(_0x37fb7e){if(_0x37fb7e&&_0x37fb7e['id']){logger[_0x4c1b('0xd')](_0x4c1b('0x20'));logger[_0x4c1b('0xd')](_0x4c1b('0x50'),_0x37fb7e['id']);logger[_0x4c1b('0xd')](_0x4c1b('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4c1b('0x51'),_0x4f5611[_0x4c1b('0x17')]),'trigger:browser:url',{'uri':util['format'](_0x4c1b('0x52'),_0xacce80[_0x4c1b('0x1e')],_0x37fb7e['id'])});}})[_0x4c1b('0x53')](function(_0x3e86d8){logger['error'](_0x4c1b('0x47'),JSON[_0x4c1b('0x34')](_0x3e86d8));});};exports[_0x4c1b('0x54')]=function(_0x5f38b4,_0x24633d,_0x1bd081,_0x2a4890,_0x558428,_0x1e70fe,_0x326154){var _0x206e80,_0x1635b3;_0x1e70fe[_0x4c1b('0x1e')]=intUtil[_0x4c1b('0x45')](_0x1e70fe[_0x4c1b('0x1e')]);_0x1e70fe[_0x4c1b('0x46')]=intUtil[_0x4c1b('0x45')](_0x1e70fe['serverUrl']);if(_0x326154&&_0x326154['recordingFormat']&&_0x326154[_0x4c1b('0x55')]!==_0x4c1b('0x56')){logger[_0x4c1b('0xd')](_0x4c1b('0x57'),_0x4c1b('0x48'));_0x24633d[_0x4c1b('0x49')]=util[_0x4c1b('0xf')](_0x4c1b('0x4a'),_0x1e70fe[_0x4c1b('0x46')],_0x24633d['uniqueid'],md5(_0x24633d[_0x4c1b('0x4b')]));}headers[_0x4c1b('0x4c')]=getAuth(_0x1e70fe);return getUser(_0x1e70fe,_0x2a4890[_0x4c1b('0x4d')])['then'](function(_0x32941d){_0x206e80=_0x32941d;logger[_0x4c1b('0xd')](_0x4c1b('0x4e'),_0x206e80['id']);return getEndUser(_0x1e70fe,_0x24633d[_0x4c1b('0x58')],_0x24633d[_0x4c1b('0x59')]);})[_0x4c1b('0x23')](function(_0x4f44a2){_0x1635b3=_0x4f44a2;logger[_0x4c1b('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1635b3['id']);return getTicket(_0x1e70fe,_0x206e80,_0x1635b3,_0x1bd081,_0x24633d);})[_0x4c1b('0x23')](function(_0x50a474){if(_0x50a474&&_0x50a474['id']){logger[_0x4c1b('0xd')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x50a474['id']);logger[_0x4c1b('0xd')](_0x4c1b('0x57'),_0x4c1b('0x5a'));emit(util['format'](_0x4c1b('0x51'),_0x2a4890[_0x4c1b('0x17')]),'trigger:browser:url',{'uri':util[_0x4c1b('0xf')](_0x4c1b('0x52'),_0x1e70fe[_0x4c1b('0x1e')],_0x50a474['id'])});}})[_0x4c1b('0x53')](function(_0x14bf5d){logger['error']('[OUTBOUND]',JSON[_0x4c1b('0x34')](_0x14bf5d));});};exports[_0x4c1b('0x5b')]=function(_0xe6fca0,_0x151023,_0x4484f4,_0x5e3f29,_0x95ab5a,_0x16c445){var _0xe1748c,_0x497e25;_0x16c445[_0x4c1b('0x1e')]=intUtil['stripTrailingSlash'](_0x16c445[_0x4c1b('0x1e')]);_0x16c445[_0x4c1b('0x46')]=intUtil[_0x4c1b('0x45')](_0x16c445[_0x4c1b('0x46')]);if(_0x95ab5a&&_0x95ab5a['monitor_format']){logger[_0x4c1b('0xd')](_0x4c1b('0x5c'),_0x4c1b('0x48'));_0x151023[_0x4c1b('0x49')]=util[_0x4c1b('0xf')](_0x4c1b('0x4a'),_0x16c445[_0x4c1b('0x46')],_0x151023['uniqueid'],md5(_0x151023[_0x4c1b('0x4b')]));}else{_0x151023[_0x4c1b('0x49')]='';}headers['Authorization']=getAuth(_0x16c445);return getUser(_0x16c445,'')[_0x4c1b('0x23')](function(_0x2e132c){_0xe1748c=_0x2e132c;logger['info']('The\x20User\x20ID\x20is:',_0xe1748c['id']);return getEndUser(_0x16c445,_0x151023[_0x4c1b('0x10')],_0x151023[_0x4c1b('0x11')]);})[_0x4c1b('0x23')](function(_0x176076){_0x497e25=_0x176076;logger[_0x4c1b('0xd')](_0x4c1b('0x4f'),_0x497e25['id']);return getTicket(_0x16c445,_0xe1748c,_0x497e25,_0x4484f4,_0x151023);})[_0x4c1b('0x23')](function(_0x4647ea){if(_0x4647ea){logger[_0x4c1b('0xd')](_0x4c1b('0x20'));logger[_0x4c1b('0xd')](_0x4c1b('0x50'),_0x4647ea['id']);}})['catch'](function(_0x38d71b){logger[_0x4c1b('0x5d')]('[ABANDONED]',JSON[_0x4c1b('0x34')](_0x38d71b));});}; \ 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 276d3d8..a72b2d9 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 _0xeb25=['servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','queue','routeId','EVENT\x20UNKNOWN','salesforce','vtiger','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','format','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','zendesk','sugarcrm','freshdesk','zoho'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xeb25,0xe1));var _0x5eb2=function(_0x366733,_0x44a293){_0x366733=_0x366733-0x0;var _0x12fbc3=_0xeb25[_0x366733];return _0x12fbc3;};'use strict';var _=require(_0x5eb2('0x0'));var util=require('util');var zendesk=require(_0x5eb2('0x1'));var salesforce=require(_0x5eb2('0x2'));var sugarcrm=require(_0x5eb2('0x3'));var freshdesk=require(_0x5eb2('0x4'));var zoho=require(_0x5eb2('0x5'));var desk=require(_0x5eb2('0x6'));var vtiger=require(_0x5eb2('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x5eb2('0x8'));var integrations=[_0x5eb2('0x9'),'salesforce',_0x5eb2('0xa'),_0x5eb2('0xb'),_0x5eb2('0xc'),'desk','vtiger',_0x5eb2('0xd'),_0x5eb2('0xe')];exports[_0x5eb2('0xf')]=function(_0x9cb961,_0x882c7c,_0x45dc7f,_0x3bf989,_0x256c78,_0x183337){if(_0x45dc7f){if(_[_0x5eb2('0x10')](integrations,_0x9cb961[_0x5eb2('0x11')][_0x5eb2('0x12')]())){try{var _0x5039b9=null;var _0x2547a0='';var _0x131cb0=_0x45dc7f[_0x9cb961[_0x5eb2('0x11')][_0x5eb2('0x12')]()];if(_0x131cb0){var _0x4a4211=_0x131cb0[_0x9cb961[_0x5eb2('0x13')]];if(_0x4a4211){var _0x1e04c9=_[_0x5eb2('0x14')](_0x4a4211['Configurations'],{'id':parseInt(_0x9cb961['data3'],0xa)});if(_0x1e04c9){if(_0x3bf989){if(_0x256c78&&_0x882c7c[_0x5eb2('0x15')]){_0x2547a0=_0x5eb2('0x15');}else if(_0x882c7c[_0x5eb2('0x16')]){_0x2547a0='outbound';}else{console['log'](_0x5eb2('0x17'),_0x882c7c);}}else{_0x2547a0='abandoned';}switch(_0x9cb961[_0x5eb2('0x11')]['toLowerCase']()){case _0x5eb2('0x9'):zendesk[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0x18'):salesforce[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0xa'):sugarcrm[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0xb'):freshdesk[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0xc'):zoho[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case'desk':desk[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0x19'):vtiger[_0x2547a0](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337);break;case _0x5eb2('0xd'):servicenow['cs'](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337,_0x2547a0);break;case'dynamics365':dynamics365['cs'](_0x9cb961,_0x882c7c,_0x1e04c9,_0x3bf989,_0x256c78,_0x4a4211,_0x183337,_0x2547a0);break;default:console[_0x5eb2('0x1a')](_0x5eb2('0x1b'));}}else{_0x5039b9=require(_0x5eb2('0x1c'))(_0x9cb961['data1'][_0x5eb2('0x12')]());_0x5039b9[_0x5eb2('0x1d')](_0x5eb2('0x1e'),util['format'](_0x5eb2('0x1f'),_0x9cb961[_0x5eb2('0x11')][_0x5eb2('0x12')](),_0x9cb961[_0x5eb2('0x20')]));}}else{_0x5039b9=require(_0x5eb2('0x1c'))(_0x9cb961[_0x5eb2('0x11')][_0x5eb2('0x12')]());_0x5039b9['error'](_0x5eb2('0x1e'),util[_0x5eb2('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x9cb961[_0x5eb2('0x11')][_0x5eb2('0x12')](),_0x9cb961['data2']));}}else{}}catch(_0x2cf17a){console['error'](_0x2cf17a);}}}}; \ No newline at end of file +var _0x9fa8=['data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','sugarcrm','unknown\x20integration','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','error','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','includes','toLowerCase','data1','Configurations'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x9fa8,0x1bf));var _0x89fa=function(_0x4dbe01,_0x47b396){_0x4dbe01=_0x4dbe01-0x0;var _0x2186b6=_0x9fa8[_0x4dbe01];return _0x2186b6;};'use strict';var _=require(_0x89fa('0x0'));var util=require(_0x89fa('0x1'));var zendesk=require(_0x89fa('0x2'));var salesforce=require(_0x89fa('0x3'));var sugarcrm=require(_0x89fa('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x89fa('0x5'));var desk=require(_0x89fa('0x6'));var vtiger=require(_0x89fa('0x7'));var servicenow=require(_0x89fa('0x8'));var dynamics365=require(_0x89fa('0x9'));var integrations=[_0x89fa('0xa'),'salesforce','sugarcrm',_0x89fa('0xb'),_0x89fa('0xc'),_0x89fa('0xd'),_0x89fa('0xe'),_0x89fa('0xf'),_0x89fa('0x10')];exports['exec']=function(_0xf5bb57,_0x3cfdf5,_0x1f6342,_0x21f68f,_0x50a2a6,_0xf8defc){if(_0x1f6342){if(_[_0x89fa('0x11')](integrations,_0xf5bb57['data1'][_0x89fa('0x12')]())){try{var _0x79e394=null;var _0x5c368c='';var _0xb742cc=_0x1f6342[_0xf5bb57[_0x89fa('0x13')][_0x89fa('0x12')]()];if(_0xb742cc){var _0x22355a=_0xb742cc[_0xf5bb57['data2']];if(_0x22355a){var _0x1dbc93=_['find'](_0x22355a[_0x89fa('0x14')],{'id':parseInt(_0xf5bb57[_0x89fa('0x15')],0xa)});if(_0x1dbc93){if(_0x21f68f){if(_0x50a2a6&&_0x3cfdf5[_0x89fa('0x16')]){_0x5c368c=_0x89fa('0x16');}else if(_0x3cfdf5[_0x89fa('0x17')]){_0x5c368c=_0x89fa('0x18');}else{console[_0x89fa('0x19')](_0x89fa('0x1a'),_0x3cfdf5);}}else{_0x5c368c='abandoned';}switch(_0xf5bb57[_0x89fa('0x13')]['toLowerCase']()){case _0x89fa('0xa'):zendesk[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case _0x89fa('0x1b'):salesforce[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case _0x89fa('0x1c'):sugarcrm[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case _0x89fa('0xb'):freshdesk[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case'zoho':zoho[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case _0x89fa('0xd'):desk[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case _0x89fa('0xe'):vtiger[_0x5c368c](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc);break;case'servicenow':servicenow['cs'](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc,_0x5c368c);break;case _0x89fa('0x10'):dynamics365['cs'](_0xf5bb57,_0x3cfdf5,_0x1dbc93,_0x21f68f,_0x50a2a6,_0x22355a,_0xf8defc,_0x5c368c);break;default:console[_0x89fa('0x19')](_0x89fa('0x1d'));}}else{_0x79e394=require('../../../../config/logger')(_0xf5bb57[_0x89fa('0x13')][_0x89fa('0x12')]());_0x79e394['error'](_0x89fa('0x1e'),util['format'](_0x89fa('0x1f'),_0xf5bb57[_0x89fa('0x13')][_0x89fa('0x12')](),_0xf5bb57[_0x89fa('0x15')]));}}else{_0x79e394=require('../../../../config/logger')(_0xf5bb57['data1'][_0x89fa('0x12')]());_0x79e394[_0x89fa('0x20')](_0x89fa('0x1e'),util[_0x89fa('0x21')](_0x89fa('0x22'),_0xf5bb57[_0x89fa('0x13')][_0x89fa('0x12')](),_0xf5bb57[_0x89fa('0x23')]));}}else{}}catch(_0x3e560b){console[_0x89fa('0x20')](_0x3e560b);}}}}; \ 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 8bbcea6..29f81b6 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 _0xa9e0=['identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','error','catch','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x5a3483,_0x2712b6){var _0x325874=function(_0x329701){while(--_0x329701){_0x5a3483['push'](_0x5a3483['shift']());}};_0x325874(++_0x2712b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x0a9e('0x3'));var util=require('util');var Redis=require(_0x0a9e('0x4'));var intUtil=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe42b77,_0x56465b,_0x52cace){io['to'](_0xe42b77)[_0x0a9e('0xc')](_0x56465b,_0x52cace);}function getTicket(_0xf81284,_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){var _0x4cfe67={};if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xe')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'ActivityDate':moment[_0x0a9e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b[_0x0a9e('0x12')],_0xbd1168,'\x20'),'Description':intUtil['getString'](_0xfeb75b[_0x0a9e('0x13')],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x14')]=_0x3ab53f['id'];}}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x15')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b['Subjects'],_0xbd1168,'\x20'),'Description':intUtil[_0x0a9e('0x11')](_0xfeb75b['Descriptions'],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x16')]=_0x3ab53f['id'];}}return _0x50dfb2['sobject'](_0xfeb75b[_0x0a9e('0xd')])[_0x0a9e('0x17')](_0x4cfe67);}function getUser(_0x48f32d,_0x225616,_0x5a0a06){if(!_[_0x0a9e('0x18')](_0x225616)&&intUtil[_0x0a9e('0x19')](_0x225616)){var _0x106033={'Email':_0x225616};var _0x205fd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a0a06[_0x0a9e('0x1a')](_0x0a9e('0x1b'))[_0x0a9e('0x1c')](_0x106033,_0x205fd6)[_0x0a9e('0x1d')]()[_0x0a9e('0x1e')](function(_0x112016){if(_0x112016[_0x0a9e('0x1f')]){var _0x105080=_['find'](_0x112016,function(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')]===_0x225616;});if(_0x105080){logger['info'](_0x0a9e('0x21'),_0x225616);return BPromise['resolve']({'id':_0x105080['Id'],'name':_0x105080['Name']});}}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x4abc77){return BPromise[_0x0a9e('0x25')]({'id':_0x4abc77[_0x0a9e('0x26')],'name':_0x4abc77[_0x0a9e('0x27')]});});}});}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x5ea472){return BPromise['resolve']({'id':_0x5ea472[_0x0a9e('0x26')],'name':_0x5ea472[_0x0a9e('0x27')]});});}}function getEndUser(_0x40c424,_0x33161b,_0x526cf3,_0x384319,_0x479bc4){var _0x45a1e7={'Phone':_0x384319};var _0x5bfb33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a9e('0x25')]()[_0x0a9e('0x1e')](function(){if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger[_0x0a9e('0x22')](_0x0a9e('0x28'),_0x384319,_0x33161b[_0x0a9e('0x29')]);switch(_0x33161b[_0x0a9e('0x29')]){case'contact_lead':return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]()['then'](function(_0x15b200){if(_0x15b200&&_0x15b200[_0x0a9e('0x1f')]){return _0x15b200;}else{return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);}});case _0x0a9e('0x2c'):return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)['execute']();case _0x0a9e('0x2d'):return _0x479bc4['sobject'](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);default:return null;}}else if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0x15')){logger[_0x0a9e('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x384319,_0x0a9e('0x2c'));return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]();}})[_0x0a9e('0x1e')](function(_0x332d35){if(_0x332d35&&_0x332d35[_0x0a9e('0x1f')]){var _0x5583a4=_[_0x0a9e('0x1c')](_0x332d35,function(_0x5e7238){return _0x5e7238[_0x0a9e('0x2e')]===_0x384319;});if(_0x5583a4){return BPromise[_0x0a9e('0x25')]({'id':_0x5583a4['Id'],'name':_0x5583a4[_0x0a9e('0x2f')],'phone':_0x5583a4[_0x0a9e('0x2e')]});}}})['then'](function(_0x191e91){if(_0x191e91){logger[_0x0a9e('0x22')](_0x0a9e('0x30'),_0x384319);return BPromise[_0x0a9e('0x25')](_0x191e91);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x384319);var _0x1e8694={'LastName':_0x526cf3!==''?_0x526cf3:util[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x384319),'Phone':_0x384319};if(_0x33161b[_0x0a9e('0x33')]){if(_0x33161b[_0x0a9e('0x33')]==='contact'){logger[_0x0a9e('0x22')](_0x0a9e('0x34'),_0x384319,_0x33161b[_0x0a9e('0x33')]);}else if(_0x33161b['moduleCreate']===_0x0a9e('0x2d')&&_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x384319,_0x33161b[_0x0a9e('0x33')]);_0x1e8694[_0x0a9e('0x35')]='No\x20Company';}else{return null;}}return _0x479bc4[_0x0a9e('0x1a')](_[_0x0a9e('0x36')](_0x33161b[_0x0a9e('0x33')]))[_0x0a9e('0x17')](_0x1e8694);}});}function getCustomFields(_0x4b38d9,_0x5a594b){var _0x15e37d={};if(_0x4b38d9[_0x0a9e('0x1f')]>0x0){_['forEach'](_0x4b38d9,function(_0x183991){if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x38')&&_0x183991['idField']){_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x183991[_0x0a9e('0x3a')][_0x0a9e('0x3b')]();}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3c')&&_0x183991[_0x0a9e('0x3d')]&&_0x183991[_0x0a9e('0x39')]){_0x5a594b[_0x183991[_0x0a9e('0x3d')]]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3d')]][_0x0a9e('0x3b')]());}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3e')&&_0x183991[_0x0a9e('0x3f')]&&_0x183991[_0x0a9e('0x3f')]['name']&&_0x183991['idField']){_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()][_0x0a9e('0x3b')]());}});}return _0x15e37d;}function getConnection(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x42')][_0x0a9e('0x43')](_0x432fcc['securityToken']);var _0x117c99=new jsforce[(_0x0a9e('0x44'))]({'oauth2':{'loginUrl':_0x432fcc[_0x0a9e('0x45')]||_0x0a9e('0x46'),'clientId':_0x432fcc[_0x0a9e('0x47')],'clientSecret':_0x432fcc[_0x0a9e('0x48')]}});return _0x117c99[_0x0a9e('0x49')](_0x432fcc[_0x0a9e('0x4a')],_0x25c6e6)['then'](function(){logger[_0x0a9e('0x22')]('Connection\x20established.');return _0x117c99;});}exports[_0x0a9e('0x4b')]=function(_0x476688,_0x8d6dd1,_0x562fb4,_0x14bec2,_0x7f6eb1,_0x4774f4){var _0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f;_0x4774f4['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x4d')]);_0x4774f4[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x45')]);if(_0x7f6eb1&&_0x7f6eb1[_0x0a9e('0x4e')]){logger[_0x0a9e('0x22')](_0x0a9e('0x4f'),_0x0a9e('0x50'));_0x8d6dd1['recordingURL']=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x4774f4['serverUrl'],_0x8d6dd1['uniqueid'],md5(_0x8d6dd1['uniqueid']));}else{_0x8d6dd1[_0x0a9e('0x52')]='';}return getConnection(_0x4774f4)[_0x0a9e('0x1e')](function(_0x37edaa){_0x45bf7f=_0x37edaa;return getUser(_0x4774f4,_0x14bec2[_0x0a9e('0x53')],_0x45bf7f);})[_0x0a9e('0x1e')](function(_0x30decb){_0x34aa5a=_0x30decb;return getEndUser(_0x4774f4,_0x562fb4,_0x8d6dd1[_0x0a9e('0x54')],_0x8d6dd1[_0x0a9e('0x55')],_0x45bf7f);})['then'](function(_0x4b1b9f){_0x45c845=_0x4b1b9f;return getTicket(_0x4774f4,_0x34aa5a,_0x45c845,_0x562fb4,_0x8d6dd1,_0x562fb4['Fields'],_0x45bf7f,_0x0a9e('0x4b'));})[_0x0a9e('0x1e')](function(_0x14d602){_0x37be73=_0x14d602;logger['info'](_0x0a9e('0x56'),_0x37be73['id']);logger[_0x0a9e('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37be73['id'],_0x14bec2['name'],_0x4774f4[_0x0a9e('0x37')]);switch(_0x4774f4['type']){case _0x0a9e('0x57'):emit(util['format'](_0x0a9e('0x58'),_0x14bec2[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x37be73['id']});break;case'newTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x14bec2['name']),'trigger:browser:url',{'uri':util[_0x0a9e('0x31')](_0x0a9e('0x5a'),_0x45bf7f['instanceUrl'],_0x37be73['id'])});break;default:logger[_0x0a9e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0a9e('0x5c')](function(_0x523cd2){logger[_0x0a9e('0x5b')]('[QUEUE]',JSON['stringify'](_0x523cd2));});};exports['outbound']=function(_0x2da03c,_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df,_0x232830){var _0x272738,_0xd10662,_0x28d814,_0x4e67ab;_0x19b4df[_0x0a9e('0x4d')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x4d')]);_0x19b4df[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x45')]);if(_0x232830&&_0x232830['recordingFormat']&&_0x232830[_0x0a9e('0x5d')]!==_0x0a9e('0x5e')){logger['info'](_0x0a9e('0x5f'),'Recording\x20is\x20enabled!');_0x47de4c[_0x0a9e('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19b4df['serverUrl'],_0x47de4c[_0x0a9e('0x60')],md5(_0x47de4c['uniqueid']));}return getConnection(_0x19b4df)[_0x0a9e('0x1e')](function(_0x1fc70e){_0x4e67ab=_0x1fc70e;return getUser(_0x19b4df,_0x65432[_0x0a9e('0x53')],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x1cca9f){_0x272738=_0x1cca9f;return getEndUser(_0x19b4df,_0x2f7092,_0x47de4c[_0x0a9e('0x61')],_0x47de4c['destcalleridnum'],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x5854cc){_0xd10662=_0x5854cc;return getTicket(_0x19b4df,_0x272738,_0xd10662,_0x2f7092,_0x47de4c,_0x2f7092[_0x0a9e('0x62')],_0x4e67ab,_0x0a9e('0x63'));})[_0x0a9e('0x1e')](function(_0x5adf8f){_0x28d814=_0x5adf8f;logger[_0x0a9e('0x22')](_0x0a9e('0x64'),_0x28d814['id']);logger[_0x0a9e('0x22')](_0x0a9e('0x65'),_0x28d814['id'],_0x65432['name'],_0x19b4df[_0x0a9e('0x37')]);switch(_0x19b4df[_0x0a9e('0x37')]){case'integrationTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x28d814['id']});break;case _0x0a9e('0x66'):emit(util['format'](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x67'),{'uri':util['format'](_0x0a9e('0x5a'),_0x4e67ab['instanceUrl'],_0x28d814['id'])});break;default:logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x68'));}})[_0x0a9e('0x5c')](function(_0x19c995){logger[_0x0a9e('0x5b')](_0x0a9e('0x5f'),JSON[_0x0a9e('0x69')](_0x19c995));});};exports[_0x0a9e('0x6a')]=function(_0x2d7205,_0x1cc4f3,_0x2e89b7,_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898,_0x412a72,_0x2a28c0,_0x4257c9;_0x2b8192['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x2b8192[_0x0a9e('0x4d')]);_0x2b8192[_0x0a9e('0x45')]=intUtil['stripTrailingSlash'](_0x2b8192[_0x0a9e('0x45')]);if(_0x2bbb86&&_0x2bbb86[_0x0a9e('0x4e')]){logger['info'](_0x0a9e('0x6b'),_0x0a9e('0x50'));_0x1cc4f3[_0x0a9e('0x52')]=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x2b8192['serverUrl'],_0x1cc4f3['uniqueid'],md5(_0x1cc4f3['uniqueid']));}else{_0x1cc4f3[_0x0a9e('0x52')]='';}return getConnection(_0x2b8192)[_0x0a9e('0x1e')](function(_0x1104ad){_0x4257c9=_0x1104ad;if(!_[_0x0a9e('0x18')](_0x19012b)){return getUser(_0x2b8192,_0x19012b[_0x0a9e('0x40')],_0x4257c9);}else{return getUser(_0x2b8192,null,_0x4257c9);}})[_0x0a9e('0x1e')](function(_0xeef20){_0x320898=_0xeef20;return getEndUser(_0x2b8192,_0x2e89b7,_0x1cc4f3[_0x0a9e('0x54')],_0x1cc4f3['calleridnum'],_0x4257c9);})[_0x0a9e('0x1e')](function(_0xcbc8b2){_0x412a72=_0xcbc8b2;return getTicket(_0x2b8192,_0x320898,_0x412a72,_0x2e89b7,_0x1cc4f3,_0x2e89b7[_0x0a9e('0x62')],_0x4257c9);})['then'](function(_0x2bdc44){_0x2a28c0=_0x2bdc44;logger['info'](_0x0a9e('0x6c'),_0x2a28c0['id']);logger[_0x0a9e('0x22')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x2b8192[_0x0a9e('0x37')]);})[_0x0a9e('0x5c')](function(_0x2cc7a7){logger[_0x0a9e('0x5b')]('[ABANDONED]',JSON[_0x0a9e('0x69')](_0x2cc7a7));});}; \ No newline at end of file +var _0x70e0=['Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','create','length','type','string','idField','content','toString','variable','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','stringify','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/logger','redis','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Descriptions','ContactId','sobject','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','lead','Contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x70e0,0x17b));var _0x070e=function(_0x21dc73,_0x406a1b){_0x21dc73=_0x21dc73-0x0;var _0x5978b4=_0x70e0[_0x21dc73];return _0x5978b4;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x070e('0x3'));var util=require(_0x070e('0x4'));var Redis=require(_0x070e('0x5'));var intUtil=require(_0x070e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x070e('0x7'))('salesforce');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));function emit(_0x604664,_0x2611e6,_0x111743){io['to'](_0x604664)[_0x070e('0xa')](_0x2611e6,_0x111743);}function getTicket(_0x11ffa8,_0x4e99e6,_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37,_0xb8d819,_0xa927a2){var _0xffcdd6={};if(_0x50f4eb[_0x070e('0xb')]===_0x070e('0xc')){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'ActivityDate':moment[_0x070e('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6['WhoId']=_0x49b2fb['id'];}}else if(_0x50f4eb['ticketType']==='Case'){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6[_0x070e('0x11')]=_0x49b2fb['id'];}}return _0xb8d819[_0x070e('0x12')](_0x50f4eb[_0x070e('0xb')])['create'](_0xffcdd6);}function getUser(_0x49861b,_0x17e2e4,_0x2bd937){if(!_[_0x070e('0x13')](_0x17e2e4)&&intUtil[_0x070e('0x14')](_0x17e2e4)){var _0x364b3f={'Email':_0x17e2e4};var _0x5037eb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2bd937[_0x070e('0x12')](_0x070e('0x15'))[_0x070e('0x16')](_0x364b3f,_0x5037eb)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0x5c16fd){if(_0x5c16fd['length']){var _0x4e958f=_[_0x070e('0x16')](_0x5c16fd,function(_0x3004f0){return _0x3004f0[_0x070e('0x19')]===_0x17e2e4;});if(_0x4e958f){logger['info'](_0x070e('0x1a'),_0x17e2e4);return BPromise['resolve']({'id':_0x4e958f['Id'],'name':_0x4e958f[_0x070e('0x1b')]});}}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()[_0x070e('0x18')](function(_0xa86797){return BPromise[_0x070e('0x1f')]({'id':_0xa86797[_0x070e('0x20')],'name':_0xa86797['display_name']});});}});}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()['then'](function(_0xf17c56){return BPromise['resolve']({'id':_0xf17c56['user_id'],'name':_0xf17c56[_0x070e('0x21')]});});}}function getEndUser(_0x25f6e,_0x41deb1,_0x1743cc,_0x4763c6,_0x497f58){var _0x374c54={'Phone':_0x4763c6};var _0x219e48={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x070e('0x1f')]()[_0x070e('0x18')](function(){if(_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,_0x41deb1['moduleSearch']);switch(_0x41deb1[_0x070e('0x23')]){case _0x070e('0x24'):return _0x497f58[_0x070e('0x12')]('Contact')['find'](_0x374c54,_0x219e48)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0xa6c0ab){if(_0xa6c0ab&&_0xa6c0ab['length']){return _0xa6c0ab;}else{return _0x497f58[_0x070e('0x12')](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);}});case _0x070e('0x26'):return _0x497f58['sobject']('Contact')['find'](_0x374c54,_0x219e48)['execute']();case _0x070e('0x27'):return _0x497f58['sobject'](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);default:return null;}}else if(_0x41deb1['ticketType']==='Case'){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,'contact');return _0x497f58['sobject'](_0x070e('0x28'))[_0x070e('0x16')](_0x374c54,_0x219e48)[_0x070e('0x17')]();}})[_0x070e('0x18')](function(_0x18f0ad){if(_0x18f0ad&&_0x18f0ad['length']){var _0x482cc2=_[_0x070e('0x16')](_0x18f0ad,function(_0x3011c4){return _0x3011c4[_0x070e('0x29')]===_0x4763c6;});if(_0x482cc2){return BPromise[_0x070e('0x1f')]({'id':_0x482cc2['Id'],'name':_0x482cc2[_0x070e('0x1b')],'phone':_0x482cc2['Phone']});}}})[_0x070e('0x18')](function(_0x1927f4){if(_0x1927f4){logger['info'](_0x070e('0x2a'),_0x4763c6);return BPromise[_0x070e('0x1f')](_0x1927f4);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x4763c6);var _0x5ddbe9={'LastName':_0x1743cc!==_0x070e('0x2b')?_0x1743cc:util[_0x070e('0x2c')](_0x070e('0x2d'),_0x4763c6),'Phone':_0x4763c6};if(_0x41deb1[_0x070e('0x2e')]){if(_0x41deb1[_0x070e('0x2e')]==='contact'){logger[_0x070e('0x1c')](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);}else if(_0x41deb1['moduleCreate']===_0x070e('0x27')&&_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger['info'](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);_0x5ddbe9['Company']=_0x070e('0x30');}else{return null;}}return _0x497f58['sobject'](_[_0x070e('0x31')](_0x41deb1[_0x070e('0x2e')]))[_0x070e('0x32')](_0x5ddbe9);}});}function getCustomFields(_0x30319c,_0xd03404){var _0x47b929={};if(_0x30319c[_0x070e('0x33')]>0x0){_['forEach'](_0x30319c,function(_0x5bd39a){if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x35')&&_0x5bd39a[_0x070e('0x36')]){_0x47b929[_0x5bd39a['idField']]=_0x5bd39a[_0x070e('0x37')][_0x070e('0x38')]();}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x39')&&_0x5bd39a['variableName']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['variableName']]&&(_0x47b929[_0x5bd39a['idField']]=_0xd03404[_0x5bd39a['variableName']][_0x070e('0x38')]());}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x3a')&&_0x5bd39a[_0x070e('0x3b')]&&_0x5bd39a[_0x070e('0x3b')]['name']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['Variable'][_0x070e('0x3c')][_0x070e('0x3d')]()]&&(_0x47b929[_0x5bd39a[_0x070e('0x36')]]=_0xd03404[_0x5bd39a['Variable']['name'][_0x070e('0x3d')]()]['toString']());}});}return _0x47b929;}function getConnection(_0x35349f){var _0x3fdb75=_0x35349f[_0x070e('0x3e')]['concat'](_0x35349f[_0x070e('0x3f')]);var _0x20a1ee=new jsforce['Connection']({'oauth2':{'loginUrl':_0x35349f['remoteUri']||_0x070e('0x40'),'clientId':_0x35349f[_0x070e('0x41')],'clientSecret':_0x35349f[_0x070e('0x42')]}});return _0x20a1ee[_0x070e('0x43')](_0x35349f[_0x070e('0x44')],_0x3fdb75)['then'](function(){logger[_0x070e('0x1c')](_0x070e('0x45'));return _0x20a1ee;});}exports[_0x070e('0x46')]=function(_0x391dee,_0x79eaa0,_0xcd1c61,_0x1f54d5,_0x1b5374,_0xd67987){var _0x66a3f3,_0x210c4d,_0x3be553,_0x5254f8;_0xd67987[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0xd67987['serverUrl']);_0xd67987[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0xd67987[_0x070e('0x49')]);if(_0x1b5374&&_0x1b5374[_0x070e('0x4a')]){logger[_0x070e('0x1c')](_0x070e('0x4b'),_0x070e('0x4c'));_0x79eaa0[_0x070e('0x4d')]=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd67987[_0x070e('0x47')],_0x79eaa0['uniqueid'],md5(_0x79eaa0[_0x070e('0x4e')]));}else{_0x79eaa0[_0x070e('0x4d')]='';}return getConnection(_0xd67987)['then'](function(_0x991d23){_0x5254f8=_0x991d23;return getUser(_0xd67987,_0x1f54d5[_0x070e('0x4f')],_0x5254f8);})[_0x070e('0x18')](function(_0xa74805){_0x66a3f3=_0xa74805;return getEndUser(_0xd67987,_0xcd1c61,_0x79eaa0[_0x070e('0x50')],_0x79eaa0[_0x070e('0x51')],_0x5254f8);})[_0x070e('0x18')](function(_0x5694fa){_0x210c4d=_0x5694fa;return getTicket(_0xd67987,_0x66a3f3,_0x210c4d,_0xcd1c61,_0x79eaa0,_0xcd1c61[_0x070e('0x52')],_0x5254f8,'queue');})['then'](function(_0x3a06c6){_0x3be553=_0x3a06c6;logger[_0x070e('0x1c')](_0x070e('0x53'),_0x3be553['id']);logger[_0x070e('0x1c')](_0x070e('0x54'),_0x3be553['id'],_0x1f54d5[_0x070e('0x3c')],_0xd67987[_0x070e('0x34')]);switch(_0xd67987[_0x070e('0x34')]){case'integrationTab':emit(util[_0x070e('0x2c')]('user:%s',_0x1f54d5['name']),_0x070e('0x55'),{'recordId':_0x3be553['id']});break;case _0x070e('0x56'):emit(util['format'](_0x070e('0x57'),_0x1f54d5[_0x070e('0x3c')]),_0x070e('0x58'),{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x5254f8[_0x070e('0x5a')],_0x3be553['id'])});break;default:logger[_0x070e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5943e3){logger[_0x070e('0x5b')](_0x070e('0x4b'),JSON[_0x070e('0x5c')](_0x5943e3));});};exports[_0x070e('0x5d')]=function(_0x5ac0b5,_0x25f34c,_0x5d3c3a,_0x212710,_0x1cbb7e,_0x476804,_0x24f303){var _0x3ab11c,_0x15dbc4,_0x5561ed,_0x20ff87;_0x476804[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x476804['serverUrl']);_0x476804[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0x476804['remoteUri']);if(_0x24f303&&_0x24f303[_0x070e('0x5e')]&&_0x24f303['recordingFormat']!==_0x070e('0x5f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25f34c[_0x070e('0x4d')]=util[_0x070e('0x2c')](_0x070e('0x60'),_0x476804[_0x070e('0x47')],_0x25f34c[_0x070e('0x4e')],md5(_0x25f34c[_0x070e('0x4e')]));}return getConnection(_0x476804)['then'](function(_0x841c89){_0x20ff87=_0x841c89;return getUser(_0x476804,_0x212710['email'],_0x20ff87);})[_0x070e('0x18')](function(_0x52becf){_0x3ab11c=_0x52becf;return getEndUser(_0x476804,_0x5d3c3a,_0x25f34c[_0x070e('0x61')],_0x25f34c[_0x070e('0x62')],_0x20ff87);})['then'](function(_0x1bcdc3){_0x15dbc4=_0x1bcdc3;return getTicket(_0x476804,_0x3ab11c,_0x15dbc4,_0x5d3c3a,_0x25f34c,_0x5d3c3a['Fields'],_0x20ff87,_0x070e('0x5d'));})[_0x070e('0x18')](function(_0x2f1604){_0x5561ed=_0x2f1604;logger[_0x070e('0x1c')](_0x070e('0x63'),_0x5561ed['id']);logger[_0x070e('0x1c')](_0x070e('0x64'),_0x5561ed['id'],_0x212710[_0x070e('0x3c')],_0x476804[_0x070e('0x34')]);switch(_0x476804[_0x070e('0x34')]){case _0x070e('0x65'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:salesforce:display',{'recordId':_0x5561ed['id']});break;case _0x070e('0x56'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:browser:url',{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x20ff87[_0x070e('0x5a')],_0x5561ed['id'])});break;default:logger[_0x070e('0x5b')](_0x070e('0x66'),_0x070e('0x67'));}})['catch'](function(_0x5251d6){logger[_0x070e('0x5b')](_0x070e('0x66'),JSON[_0x070e('0x5c')](_0x5251d6));});};exports['abandoned']=function(_0x8b9c73,_0x52804d,_0x10d95d,_0x36373d,_0x3a1ad2,_0x150bf6){var _0x2a20d4,_0x50ef9f,_0x2e48f9,_0x2e38c6;_0x150bf6[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x150bf6['serverUrl']);_0x150bf6[_0x070e('0x49')]=intUtil['stripTrailingSlash'](_0x150bf6[_0x070e('0x49')]);if(_0x3a1ad2&&_0x3a1ad2[_0x070e('0x4a')]){logger[_0x070e('0x1c')]('[ABANDONED]',_0x070e('0x4c'));_0x52804d['recordingURL']=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x150bf6[_0x070e('0x47')],_0x52804d[_0x070e('0x4e')],md5(_0x52804d['uniqueid']));}else{_0x52804d[_0x070e('0x4d')]='';}return getConnection(_0x150bf6)['then'](function(_0x1c831f){_0x2e38c6=_0x1c831f;if(!_[_0x070e('0x13')](_0x36373d)){return getUser(_0x150bf6,_0x36373d['name'],_0x2e38c6);}else{return getUser(_0x150bf6,null,_0x2e38c6);}})['then'](function(_0x29ee66){_0x2a20d4=_0x29ee66;return getEndUser(_0x150bf6,_0x10d95d,_0x52804d[_0x070e('0x50')],_0x52804d[_0x070e('0x51')],_0x2e38c6);})[_0x070e('0x18')](function(_0x25f1d0){_0x50ef9f=_0x25f1d0;return getTicket(_0x150bf6,_0x2a20d4,_0x50ef9f,_0x10d95d,_0x52804d,_0x10d95d[_0x070e('0x52')],_0x2e38c6);})[_0x070e('0x18')](function(_0x332c8a){_0x2e48f9=_0x332c8a;logger[_0x070e('0x1c')](_0x070e('0x68'),_0x2e48f9['id']);logger[_0x070e('0x1c')](_0x070e('0x69'),_0x150bf6[_0x070e('0x34')]);})['catch'](function(_0x3308b5){logger[_0x070e('0x5b')]('[ABANDONED]',JSON['stringify'](_0x3308b5));});}; \ 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 57a5dbd..d304e0d 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 _0x28e3=['Descriptions','Fields','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','forEach','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','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','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','then','endUserId','],\x20getEndUser\x20input\x20crm','GET','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','customField','idField','toString','type','toLowerCase','content','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString'];(function(_0x565e88,_0x5e32ea){var _0x34997e=function(_0x3d31d0){while(--_0x3d31d0){_0x565e88['push'](_0x565e88['shift']());}};_0x34997e(++_0x5e32ea);}(_0x28e3,0x106));var _0x328e=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x28e3[_0x56fe98];return _0x212f4f;};'use strict';var _=require(_0x328e('0x0'));var Promise=require(_0x328e('0x1'));var rp=require(_0x328e('0x2'));var util=require(_0x328e('0x3'));var md5=require('md5');var Redis=require(_0x328e('0x4'));var intUtil=require(_0x328e('0x5'));var config=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));config[_0x328e('0x9')]=_[_0x328e('0xa')](config[_0x328e('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x2bddaa,_0x3696b6,_0x3467ee,_0x6a5414,_0x1bc607,_0x4a4f53){return new Promise(function(_0x30af7c,_0x1b3bb8){var _0x2d58e9={'method':'GET','uri':_0x6a5414+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x1bc607+'&'+_0x4a4f53,'auth':_0x3696b6,'json':!![]};return rp(_0x2d58e9)['then'](function(_0x2f90f7){if(_0x2f90f7[_0x328e('0xb')][_0x328e('0xc')]>0x0){_0x3467ee[_0x328e('0xd')]=_0x2f90f7[_0x328e('0xb')][0x0][_0x328e('0xe')];}logger[_0x328e('0xf')]('['+[_0x2bddaa[_0x328e('0x10')]()]+_0x328e('0x11'),_0x3467ee);_0x30af7c(_0x3467ee);})[_0x328e('0x12')](function(_0xb252e5){logger['error']('['+[_0x2bddaa[_0x328e('0x10')]()]+']',_0xb252e5[_0x328e('0x13')]);_0x1b3bb8(_0xb252e5[_0x328e('0x13')]);});});}function getUser(_0x1a035d,_0x29f8bf,_0x397b16,_0x2a8096,_0x3c5b37){return function(_0x20901e){logger['info']('['+[_0x1a035d[_0x328e('0x10')]()]+_0x328e('0x14'),_0x20901e);return new Promise(function(_0x116f46,_0x1adadc){if(intUtil[_0x328e('0x15')](_0x20901e[_0x328e('0x16')])){var _0x41a6bb={'method':'GET','uri':_0x397b16+_0x328e('0x17')+_0x20901e[_0x328e('0x16')]+'&'+_0x2a8096+'&'+_0x3c5b37,'auth':_0x29f8bf,'json':!![]};logger[_0x328e('0xf')]('['+[_0x1a035d[_0x328e('0x10')]()]+_0x328e('0x18'),_0x41a6bb);return rp(_0x41a6bb)['then'](function(_0x62e84d){logger[_0x328e('0xf')]('['+[_0x1a035d[_0x328e('0x10')]()]+'],\x20getUser\x20entity',_0x62e84d);if(_0x62e84d[_0x328e('0xb')][_0x328e('0xc')]>0x0&&String(_0x62e84d[_0x328e('0xb')][0x0][_0x328e('0x19')])===_0x328e('0x1a')){_0x20901e[_0x328e('0x1b')]=_0x62e84d[_0x328e('0xb')][0x0][_0x328e('0xe')];}else{_0x20901e[_0x328e('0x1b')]=_0x20901e['adminId'];_0x20901e['userEmail']=_0x20901e[_0x328e('0x1c')];}logger[_0x328e('0xf')]('['+[_0x1a035d[_0x328e('0x10')]()]+_0x328e('0x1d'),_0x20901e);_0x116f46(_0x20901e);})[_0x328e('0x12')](function(_0x4a62a8){logger[_0x328e('0x1e')]('['+[_0x1a035d['toUpperCase']()]+']',_0x4a62a8[_0x328e('0x13')]);_0x1adadc(_0x4a62a8[_0x328e('0x13')]);});}else{logger[_0x328e('0xf')]('['+[_0x1a035d[_0x328e('0x10')]()]+_0x328e('0x1f'));_0x20901e['userId']=_0x20901e['adminId'];_0x20901e[_0x328e('0x16')]=_0x20901e['adminEmail'];_0x116f46(_0x20901e);}});};}function createEndUser(_0x5d9172,_0xf80664,_0x270d58,_0x5873d1,_0x232ec7){logger[_0x328e('0xf')]('['+[_0x5d9172['toUpperCase']()]+_0x328e('0x20'),_0x270d58);return new Promise(function(_0x2448bc,_0x2b5589){var _0x2304b6={'method':_0x328e('0x21'),'uri':_0x5873d1+'sys_user?'+_0x232ec7,'body':{'user_name':_0x270d58[_0x328e('0x22')],'roles':_0x328e('0x23'),'first_name':_0x270d58[_0x328e('0x22')],'active':_0x328e('0x1a'),'date_format':_0x328e('0x24'),'phone':_0x270d58[_0x328e('0x22')]},'auth':_0xf80664,'json':!![]};return rp(_0x2304b6)[_0x328e('0x25')](function(_0x123099){logger[_0x328e('0xf')]('['+[_0x5d9172['toUpperCase']()]+'],\x20EndUser\x20schema',_0x123099[_0x328e('0xb')]);_0x270d58[_0x328e('0x26')]=_0x123099['result']['sys_id'];_0x2448bc(_0x270d58);})['catch'](function(_0xba5335){logger[_0x328e('0x1e')]('['+[_0x5d9172[_0x328e('0x10')]()]+']',_0xba5335[_0x328e('0x13')]);_0x2b5589(_0xba5335[_0x328e('0x13')]);});});}function getEndUser(_0x42da8c,_0x2f9e80,_0x50fdad,_0x27ed20,_0x5c67e4){return function(_0x479550){logger[_0x328e('0xf')]('['+[_0x42da8c['toUpperCase']()]+_0x328e('0x27'),_0x479550);return new Promise(function(_0x3d131d,_0x1b8103){var _0x4d8b0d={'method':_0x328e('0x28'),'uri':_0x50fdad+'sys_user?sysparm_query=phone%3D'+_0x479550[_0x328e('0x22')]+'&'+_0x27ed20+'&'+_0x5c67e4,'auth':_0x2f9e80,'json':!![]};return rp(_0x4d8b0d)[_0x328e('0x25')](function(_0x4702a2){if(_0x4702a2[_0x328e('0xb')]['length']>0x0){_0x479550[_0x328e('0x26')]=_0x4702a2['result'][0x0][_0x328e('0xe')];logger['info']('['+[_0x42da8c['toUpperCase']()]+_0x328e('0x29'),_0x479550);_0x3d131d(_0x479550);}else{return createEndUser(_0x42da8c,_0x2f9e80,_0x479550,_0x50fdad,_0x27ed20)['then'](function(_0x3efc1d){logger[_0x328e('0xf')]('['+[_0x42da8c[_0x328e('0x10')]()]+_0x328e('0x2a'),_0x3efc1d);_0x3d131d(_0x3efc1d);});}})['catch'](function(_0x676dee){logger[_0x328e('0x1e')]('['+[_0x42da8c[_0x328e('0x10')]()]+']',_0x676dee[_0x328e('0x13')]);_0x1b8103(_0x676dee[_0x328e('0x13')]);});});};}function getCustomFields(_0x4d21a7,_0xf05003){var _0x2be20c={};if(_0x4d21a7[_0x328e('0xc')]>0x0){_['forEach'](_0x4d21a7,function(_0x4cf739){if(_0x4cf739['type']===_0x328e('0x2b')&&_0x4cf739['nameField']&&!_0x4cf739[_0x328e('0x2c')]){_0x2be20c[_0x4cf739[_0x328e('0x2d')]['toLowerCase']()]=_0x4cf739['content'][_0x328e('0x2e')]();}else if(_0x4cf739[_0x328e('0x2f')]===_0x328e('0x2b')&&_0x4cf739[_0x328e('0x2d')]&&_0x4cf739[_0x328e('0x2c')]){_0x2be20c[_0x4cf739[_0x328e('0x2d')][_0x328e('0x30')]()]=_0x4cf739[_0x328e('0x31')][_0x328e('0x2e')]();}else if(_0x4cf739[_0x328e('0x2f')]===_0x328e('0x32')&&_0x4cf739[_0x328e('0x33')]&&_0x4cf739['idField']&&_0x4cf739[_0x328e('0x2c')]){_0x2be20c[_0x4cf739['idField']['toLowerCase']()]=_0xf05003[_0x4cf739[_0x328e('0x33')]][_0x328e('0x2e')]();}else if(_0x4cf739[_0x328e('0x2f')]==='customVariable'&&_0x4cf739[_0x328e('0x34')]&&_0x4cf739[_0x328e('0x34')][_0x328e('0x35')]&&_0x4cf739[_0x328e('0x2d')]&&_0x4cf739[_0x328e('0x2c')]){_0x2be20c[_0x4cf739[_0x328e('0x2d')][_0x328e('0x30')]()]=_0xf05003[_0x4cf739['Variable']['name'][_0x328e('0x30')]()][_0x328e('0x2e')]();}});}return _0x2be20c;}function getTicket(_0x59a964,_0x3bd43b,_0x22c843,_0x3dd68c,_0x4fbdb1,_0x42ee2e){return function(_0x242fac){logger[_0x328e('0xf')]('['+[_0x59a964[_0x328e('0x10')]()]+_0x328e('0x36'),_0x242fac);return new Promise(function(_0x2ef923,_0x3baed0){var _0x4e4ba2=_0x59a964[_0x328e('0x30')]()===_0x328e('0x37')?_0x242fac[_0x328e('0x1b')]:_0x242fac['endUserId'];var _0x1aa84f={'method':_0x328e('0x21'),'uri':_0x22c843+_0x328e('0x38')+'?'+_0x42ee2e,'body':Object[_0x328e('0x39')]({},{'active':_0x328e('0x1a'),'caller_id':_0x4e4ba2,'assigned_to':_0x242fac[_0x328e('0x1b')],'short_description':intUtil[_0x328e('0x3a')](_0x3dd68c['Subjects'],_0x4fbdb1,'\x20'),'description':intUtil[_0x328e('0x3a')](_0x3dd68c[_0x328e('0x3b')],_0x4fbdb1,'\x0a')},getCustomFields(_0x3dd68c[_0x328e('0x3c')],_0x4fbdb1)),'auth':_0x3bd43b,'json':!![]};return rp(_0x1aa84f)[_0x328e('0x25')](function(_0x7a0939){logger[_0x328e('0xf')]('['+[_0x59a964[_0x328e('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x7a0939['result']);_0x242fac['ticketId']=_0x7a0939[_0x328e('0xb')][_0x328e('0xe')];_0x242fac[_0x328e('0x3d')]=_0x7a0939[_0x328e('0xb')]['number'];logger[_0x328e('0xf')]('['+[_0x59a964['toUpperCase']()]+_0x328e('0x3e'),_0x242fac);_0x2ef923(_0x242fac);})[_0x328e('0x12')](function(_0x287ea4){logger[_0x328e('0x1e')]('['+[_0x59a964[_0x328e('0x10')]()]+']',_0x287ea4[_0x328e('0x13')]);_0x3baed0(_0x287ea4['message']);});});};}function createRemoteTag(_0x1bdc0c,_0x3b78c3,_0x297832,_0x1dfdfe){return new Promise(function(_0x4b97bd,_0x4adeab){var _0x2f5992={'method':_0x328e('0x21'),'uri':_0x297832+_0x328e('0x3f')+'?'+_0x1dfdfe,'body':{'short_description':_0x1bdc0c,'global':!![],'active':!![],'name':_0x1bdc0c},'auth':_0x3b78c3,'json':!![]};return rp(_0x2f5992)[_0x328e('0x25')](function(_0x514cb6){var _0x5d9bb2=_0x514cb6['result'][_0x328e('0xe')];_0x4b97bd(_0x5d9bb2);});});}function getRemoteTag(_0x1b57e5,_0x313c61,_0x1be462,_0x1bb39b,_0x221986){return new Promise(function(_0x217b5e,_0x178ff9){var _0x138c0d={'method':_0x328e('0x28'),'uri':_0x1be462+_0x328e('0x3f')+_0x328e('0x40')+_0x1b57e5+'&'+_0x1bb39b,'auth':_0x313c61,'json':!![]};return rp(_0x138c0d)[_0x328e('0x25')](function(_0x26a2f7){if(_0x26a2f7['result']['length']>0x0){var _0x55e09b=_0x26a2f7[_0x328e('0xb')][0x0][_0x328e('0xe')];_0x217b5e(_0x55e09b);}else{return createRemoteTag(_0x1b57e5,_0x313c61,_0x1be462,_0x1bb39b)[_0x328e('0x25')](function(_0x57e072){_0x217b5e(_0x57e072);});}});});}function assignTagToIncident(_0x1fb5bd,_0x281512,_0x2a7336,_0xf7ec24,_0xbd687f){return new Promise(function(_0x2956bf,_0x1bc273){var _0x171fb2={'method':_0x328e('0x21'),'uri':_0x2a7336+_0x328e('0x41')+'?'+_0xbd687f,'body':{'label':_0x1fb5bd,'table':_0x328e('0x38'),'id_type':_0x328e('0x42'),'table_key':_0xf7ec24['ticketId'],'title':'Incident\x20-\x20'+_0xf7ec24['ticketNumber'],'id_display':_0xf7ec24[_0x328e('0x3d')]},'auth':_0x281512,'json':!![]};return rp(_0x171fb2)['then'](function(_0x2a71f4){_0x2956bf();})[_0x328e('0x12')](function(){_0x2956bf();});});}function manageTags(_0xc18cfa,_0x334807,_0x95ce72,_0x265079,_0x4ddb85,_0x42476d,_0x25d176){return new Promise(function(_0x8bf820,_0x4a5205){var _0x91b501=[];_0x334807[_0x328e('0x43')](function(_0x13fa08){_0x91b501['push'](getRemoteTag(_0x13fa08,_0x95ce72,_0x265079,_0x42476d,_0x25d176));});return Promise[_0x328e('0x44')](_0x91b501)[_0x328e('0x25')](function(_0x297db8){if(_0x297db8[_0x328e('0xc')]){logger[_0x328e('0xf')]('['+[_0xc18cfa['toUpperCase']()]+_0x328e('0x45'),_0x297db8);var _0x305f66=[];_0x297db8[_0x328e('0x43')](function(_0xda6eaa){_0x305f66[_0x328e('0x46')](assignTagToIncident(_0xda6eaa,_0x95ce72,_0x265079,_0x4ddb85,_0x42476d));});return Promise[_0x328e('0x44')](_0x305f66)[_0x328e('0x25')](function(){_0x8bf820();})['catch'](function(){_0x8bf820();});}else{_0x8bf820();}});});}function getTags(_0x28fcc3,_0x5519fb,_0x5bd7c3,_0x191bf9,_0x20e475,_0x35f877){return function(_0x1170c5){return new Promise(function(_0xadf20e,_0x2bad99){var _0x50685a=[];var _0x72a88=_0x191bf9[_0x328e('0x47')];if(_0x72a88&&_0x72a88['length']>0x0){_0x50685a=_[_0x328e('0x48')](_0x72a88,_0x328e('0x35'));}if(_0x50685a['length']>0x0){return manageTags(_0x28fcc3,_0x50685a,_0x5519fb,_0x5bd7c3,_0x1170c5,_0x20e475,_0x35f877)[_0x328e('0x25')](function(){_0xadf20e(_0x1170c5);});}else{_0xadf20e(_0x1170c5);}});};}function emit(_0x45053e,_0x27659e,_0x4c19f8){var _0x499a6d=_0x328e('0x49')+_0x328e('0x4a')+_0x328e('0x4b')+_0x328e('0x4c');var _0x294e0e={'uri':_0x45053e+_0x328e('0x4d')+_0x4c19f8+_0x499a6d};io['to'](util[_0x328e('0x4e')](_0x328e('0x4f'),_0x27659e))['emit'](_0x328e('0x50'),_0x294e0e);}exports['cs']=function(_0x5e6999,_0x5b6edb,_0x1e4744,_0x2df68e,_0x6317c3,_0x31ceb3,_0x5004d7,_0x1d7612){var _0x4d077b={};var _0x4b9417={'user':_0x31ceb3[_0x328e('0x51')],'pass':_0x31ceb3[_0x328e('0x52')]};var _0x3df494=_0x328e('0x53');var _0x1dd3a7='sysparm_display_value=true';_0x31ceb3['remoteUri']=intUtil['stripTrailingSlash'](_0x31ceb3[_0x328e('0x54')]);_0x31ceb3['serverUrl']=intUtil[_0x328e('0x55')](_0x31ceb3[_0x328e('0x56')]);var _0x44c056=util[_0x328e('0x4e')](_0x328e('0x57'),_0x31ceb3[_0x328e('0x54')]);_0x4d077b[_0x328e('0x16')]=!_['isNil'](_0x2df68e)?_0x2df68e[_0x328e('0x58')]:null;_0x4d077b[_0x328e('0x1c')]=_0x31ceb3[_0x328e('0x58')];_0x4d077b[_0x328e('0x22')]=_0x1d7612['toLowerCase']()===_0x328e('0x37')?_0x5b6edb[_0x328e('0x59')]:_0x5b6edb[_0x328e('0x5a')];_0x4d077b['callDirection']=_0x1d7612===_0x328e('0x5b')||_0x1d7612===_0x328e('0x5c')?'queue':_0x328e('0x37');var _0x35337b=util[_0x328e('0x4e')](_0x328e('0x5d'),_0x31ceb3[_0x328e('0x56')],_0x5b6edb[_0x328e('0x5e')],md5(_0x5b6edb[_0x328e('0x5e')]));if(_0x6317c3&&_0x6317c3[_0x328e('0x5f')]){logger['info'](_0x328e('0x60'),_0x328e('0x61'));_0x5b6edb[_0x328e('0x62')]=_0x35337b;}else if(_0x5004d7&&_0x5004d7['recordingFormat']&&_0x5004d7[_0x328e('0x63')]!==_0x328e('0x64')){logger[_0x328e('0xf')](_0x328e('0x65'),_0x328e('0x61'));_0x5b6edb[_0x328e('0x62')]=_0x35337b;}else{_0x5b6edb[_0x328e('0x62')]='';}return getAdminUser(_0x1d7612,_0x4b9417,_0x4d077b,_0x44c056,_0x1dd3a7,_0x3df494)[_0x328e('0x25')](getUser(_0x1d7612,_0x4b9417,_0x44c056,_0x1dd3a7,_0x3df494))['then'](getEndUser(_0x1d7612,_0x4b9417,_0x44c056,_0x1dd3a7,_0x3df494))[_0x328e('0x25')](getTicket(_0x1d7612,_0x4b9417,_0x44c056,_0x1e4744,_0x5b6edb,_0x1dd3a7))[_0x328e('0x25')](function(_0x29a570){logger[_0x328e('0xf')](util['format'](_0x328e('0x66'),_0x29a570[_0x328e('0x67')]));logger[_0x328e('0xf')](util['format'](_0x328e('0x68'),_0x1d7612));if(_0x1d7612!==_0x328e('0x5c')){logger[_0x328e('0xf')]('['+[_0x1d7612['toUpperCase']()]+']',_0x328e('0x69'));emit(_0x31ceb3[_0x328e('0x54')],_0x2df68e[_0x328e('0x35')],_0x29a570[_0x328e('0x67')]);}})[_0x328e('0x12')](function(_0x53b9ed){logger['error']('['+[_0x1d7612['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x328e('0x6a')](_0x53b9ed,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3663=['serverUrl','stripTrailingSlash','isNil','email','calleridnum','callDirection','queue','abandoned','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','toString','content','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3663,0x1cf));var _0x3366=function(_0x2e183e,_0x20a4f5){_0x2e183e=_0x2e183e-0x0;var _0x2cf1f7=_0x3663[_0x2e183e];return _0x2cf1f7;};'use strict';var _=require(_0x3366('0x0'));var Promise=require(_0x3366('0x1'));var rp=require(_0x3366('0x2'));var util=require('util');var md5=require(_0x3366('0x3'));var Redis=require(_0x3366('0x4'));var intUtil=require('./util');var config=require(_0x3366('0x5'));var logger=require(_0x3366('0x6'))(_0x3366('0x7'));config[_0x3366('0x8')]=_[_0x3366('0x9')](config['redis'],{'host':_0x3366('0xa'),'port':0x18eb});var io=require(_0x3366('0xb'))(new Redis(config['redis']));function getAdminUser(_0x5c10c1,_0x1d802b,_0x304f68,_0x5945d7,_0x1f9474,_0x2a681e){return new Promise(function(_0x1ee7a6,_0x5898d5){var _0x204105={'method':_0x3366('0xc'),'uri':_0x5945d7+_0x3366('0xd')+'&'+_0x1f9474+'&'+_0x2a681e,'auth':_0x1d802b,'json':!![]};return rp(_0x204105)[_0x3366('0xe')](function(_0x38d814){if(_0x38d814[_0x3366('0xf')][_0x3366('0x10')]>0x0){_0x304f68['adminId']=_0x38d814['result'][0x0][_0x3366('0x11')];}logger[_0x3366('0x12')]('['+[_0x5c10c1[_0x3366('0x13')]()]+_0x3366('0x14'),_0x304f68);_0x1ee7a6(_0x304f68);})[_0x3366('0x15')](function(_0x2a20bb){logger['error']('['+[_0x5c10c1['toUpperCase']()]+']',_0x2a20bb[_0x3366('0x16')]);_0x5898d5(_0x2a20bb['message']);});});}function getUser(_0xa0b467,_0x293f69,_0x190524,_0x334d91,_0xb5d3e4){return function(_0x58a86c){logger[_0x3366('0x12')]('['+[_0xa0b467[_0x3366('0x13')]()]+_0x3366('0x17'),_0x58a86c);return new Promise(function(_0x8529a5,_0x3377be){if(intUtil[_0x3366('0x18')](_0x58a86c['userEmail'])){var _0x581cf9={'method':_0x3366('0xc'),'uri':_0x190524+'sys_user?sysparm_query=email%3D'+_0x58a86c[_0x3366('0x19')]+'&'+_0x334d91+'&'+_0xb5d3e4,'auth':_0x293f69,'json':!![]};logger[_0x3366('0x12')]('['+[_0xa0b467[_0x3366('0x13')]()]+_0x3366('0x1a'),_0x581cf9);return rp(_0x581cf9)[_0x3366('0xe')](function(_0x284548){logger['info']('['+[_0xa0b467[_0x3366('0x13')]()]+_0x3366('0x1b'),_0x284548);if(_0x284548[_0x3366('0xf')][_0x3366('0x10')]>0x0&&String(_0x284548[_0x3366('0xf')][0x0]['active'])==='true'){_0x58a86c[_0x3366('0x1c')]=_0x284548[_0x3366('0xf')][0x0][_0x3366('0x11')];}else{_0x58a86c['userId']=_0x58a86c['adminId'];_0x58a86c[_0x3366('0x19')]=_0x58a86c[_0x3366('0x1d')];}logger[_0x3366('0x12')]('['+[_0xa0b467['toUpperCase']()]+_0x3366('0x1e'),_0x58a86c);_0x8529a5(_0x58a86c);})['catch'](function(_0x271c15){logger[_0x3366('0x1f')]('['+[_0xa0b467[_0x3366('0x13')]()]+']',_0x271c15[_0x3366('0x16')]);_0x3377be(_0x271c15[_0x3366('0x16')]);});}else{logger[_0x3366('0x12')]('['+[_0xa0b467[_0x3366('0x13')]()]+_0x3366('0x20'));_0x58a86c[_0x3366('0x1c')]=_0x58a86c[_0x3366('0x21')];_0x58a86c['userEmail']=_0x58a86c[_0x3366('0x1d')];_0x8529a5(_0x58a86c);}});};}function createEndUser(_0x3355c9,_0x5de970,_0x320866,_0x1826e5,_0x1354c6){logger[_0x3366('0x12')]('['+[_0x3355c9[_0x3366('0x13')]()]+_0x3366('0x22'),_0x320866);return new Promise(function(_0x13e923,_0x45f801){var _0x3e7246={'method':_0x3366('0x23'),'uri':_0x1826e5+_0x3366('0x24')+_0x1354c6,'body':{'user_name':_0x320866['endUserNumber'],'roles':'user','first_name':_0x320866[_0x3366('0x25')],'active':_0x3366('0x26'),'date_format':_0x3366('0x27'),'phone':_0x320866[_0x3366('0x25')]},'auth':_0x5de970,'json':!![]};return rp(_0x3e7246)['then'](function(_0x31721f){logger[_0x3366('0x12')]('['+[_0x3355c9['toUpperCase']()]+_0x3366('0x28'),_0x31721f[_0x3366('0xf')]);_0x320866[_0x3366('0x29')]=_0x31721f['result'][_0x3366('0x11')];_0x13e923(_0x320866);})[_0x3366('0x15')](function(_0x36ff55){logger['error']('['+[_0x3355c9[_0x3366('0x13')]()]+']',_0x36ff55['message']);_0x45f801(_0x36ff55[_0x3366('0x16')]);});});}function getEndUser(_0x422b45,_0x3f2e1b,_0x1abcd6,_0x4f3f2a,_0x5a0b71){return function(_0x16d0a1){logger[_0x3366('0x12')]('['+[_0x422b45[_0x3366('0x13')]()]+_0x3366('0x2a'),_0x16d0a1);return new Promise(function(_0x272e27,_0x5123ab){var _0x458388={'method':_0x3366('0xc'),'uri':_0x1abcd6+_0x3366('0x2b')+_0x16d0a1[_0x3366('0x25')]+'&'+_0x4f3f2a+'&'+_0x5a0b71,'auth':_0x3f2e1b,'json':!![]};return rp(_0x458388)[_0x3366('0xe')](function(_0xd8156a){if(_0xd8156a[_0x3366('0xf')]['length']>0x0){_0x16d0a1[_0x3366('0x29')]=_0xd8156a[_0x3366('0xf')][0x0]['sys_id'];logger[_0x3366('0x12')]('['+[_0x422b45[_0x3366('0x13')]()]+'],\x20getEndUser\x20crm',_0x16d0a1);_0x272e27(_0x16d0a1);}else{return createEndUser(_0x422b45,_0x3f2e1b,_0x16d0a1,_0x1abcd6,_0x4f3f2a)['then'](function(_0x2871cf){logger[_0x3366('0x12')]('['+[_0x422b45[_0x3366('0x13')]()]+_0x3366('0x2c'),_0x2871cf);_0x272e27(_0x2871cf);});}})['catch'](function(_0x493e0b){logger[_0x3366('0x1f')]('['+[_0x422b45[_0x3366('0x13')]()]+']',_0x493e0b[_0x3366('0x16')]);_0x5123ab(_0x493e0b['message']);});});};}function getCustomFields(_0x2a7f55,_0x9e79ef){var _0x4fcedb={};if(_0x2a7f55[_0x3366('0x10')]>0x0){_[_0x3366('0x2d')](_0x2a7f55,function(_0x8c1fc1){if(_0x8c1fc1[_0x3366('0x2e')]===_0x3366('0x2f')&&_0x8c1fc1[_0x3366('0x30')]&&!_0x8c1fc1[_0x3366('0x31')]){_0x4fcedb[_0x8c1fc1[_0x3366('0x32')][_0x3366('0x33')]()]=_0x8c1fc1['content'][_0x3366('0x34')]();}else if(_0x8c1fc1['type']==='string'&&_0x8c1fc1[_0x3366('0x32')]&&_0x8c1fc1[_0x3366('0x31')]){_0x4fcedb[_0x8c1fc1[_0x3366('0x32')][_0x3366('0x33')]()]=_0x8c1fc1[_0x3366('0x35')]['toString']();}else if(_0x8c1fc1['type']==='variable'&&_0x8c1fc1[_0x3366('0x36')]&&_0x8c1fc1[_0x3366('0x32')]&&_0x8c1fc1[_0x3366('0x31')]){_0x4fcedb[_0x8c1fc1[_0x3366('0x32')][_0x3366('0x33')]()]=_0x9e79ef[_0x8c1fc1['variableName']][_0x3366('0x34')]();}else if(_0x8c1fc1[_0x3366('0x2e')]===_0x3366('0x37')&&_0x8c1fc1[_0x3366('0x38')]&&_0x8c1fc1[_0x3366('0x38')][_0x3366('0x39')]&&_0x8c1fc1[_0x3366('0x32')]&&_0x8c1fc1[_0x3366('0x31')]){_0x4fcedb[_0x8c1fc1[_0x3366('0x32')]['toLowerCase']()]=_0x9e79ef[_0x8c1fc1['Variable'][_0x3366('0x39')][_0x3366('0x33')]()][_0x3366('0x34')]();}});}return _0x4fcedb;}function getTicket(_0x3fe803,_0x1027a4,_0x15028c,_0x35fd57,_0x3378e3,_0x63549b){return function(_0x3c89e3){logger['info']('['+[_0x3fe803[_0x3366('0x13')]()]+_0x3366('0x3a'),_0x3c89e3);return new Promise(function(_0x46abf2,_0x525eab){var _0x296d32=_0x3fe803[_0x3366('0x33')]()===_0x3366('0x3b')?_0x3c89e3[_0x3366('0x1c')]:_0x3c89e3[_0x3366('0x29')];var _0x34b811={'method':'POST','uri':_0x15028c+_0x3366('0x3c')+'?'+_0x63549b,'body':Object[_0x3366('0x3d')]({},{'active':_0x3366('0x26'),'caller_id':_0x296d32,'assigned_to':_0x3c89e3[_0x3366('0x1c')],'short_description':intUtil['getString'](_0x35fd57['Subjects'],_0x3378e3,'\x20'),'description':intUtil[_0x3366('0x3e')](_0x35fd57[_0x3366('0x3f')],_0x3378e3,'\x0a')},getCustomFields(_0x35fd57[_0x3366('0x40')],_0x3378e3)),'auth':_0x1027a4,'json':!![]};return rp(_0x34b811)['then'](function(_0x3ac55d){logger[_0x3366('0x12')]('['+[_0x3fe803[_0x3366('0x13')]()]+_0x3366('0x41'),_0x3ac55d[_0x3366('0xf')]);_0x3c89e3[_0x3366('0x42')]=_0x3ac55d[_0x3366('0xf')][_0x3366('0x11')];_0x3c89e3[_0x3366('0x43')]=_0x3ac55d['result'][_0x3366('0x44')];logger[_0x3366('0x12')]('['+[_0x3fe803[_0x3366('0x13')]()]+_0x3366('0x45'),_0x3c89e3);_0x46abf2(_0x3c89e3);})[_0x3366('0x15')](function(_0x3c9324){logger[_0x3366('0x1f')]('['+[_0x3fe803[_0x3366('0x13')]()]+']',_0x3c9324[_0x3366('0x16')]);_0x525eab(_0x3c9324[_0x3366('0x16')]);});});};}function createRemoteTag(_0x4a68a0,_0x315bfc,_0x514632,_0x4ea93e){return new Promise(function(_0x504cd1,_0x529d9e){var _0x2df86b={'method':_0x3366('0x23'),'uri':_0x514632+'label'+'?'+_0x4ea93e,'body':{'short_description':_0x4a68a0,'global':!![],'active':!![],'name':_0x4a68a0},'auth':_0x315bfc,'json':!![]};return rp(_0x2df86b)[_0x3366('0xe')](function(_0x18048b){var _0x2a8fa7=_0x18048b[_0x3366('0xf')][_0x3366('0x11')];_0x504cd1(_0x2a8fa7);});});}function getRemoteTag(_0x296e68,_0x3d61dc,_0x451386,_0x1f334a,_0x23c453){return new Promise(function(_0x19e741,_0x38fa27){var _0x571ee3={'method':'GET','uri':_0x451386+_0x3366('0x46')+_0x3366('0x47')+_0x296e68+'&'+_0x1f334a,'auth':_0x3d61dc,'json':!![]};return rp(_0x571ee3)[_0x3366('0xe')](function(_0x223860){if(_0x223860['result'][_0x3366('0x10')]>0x0){var _0x133edc=_0x223860[_0x3366('0xf')][0x0][_0x3366('0x11')];_0x19e741(_0x133edc);}else{return createRemoteTag(_0x296e68,_0x3d61dc,_0x451386,_0x1f334a)[_0x3366('0xe')](function(_0x20a535){_0x19e741(_0x20a535);});}});});}function assignTagToIncident(_0x3ce03f,_0x23996b,_0x2c5c79,_0x5b70fd,_0x18bda2){return new Promise(function(_0xd80f32,_0x7e3a17){var _0x5d6665={'method':_0x3366('0x23'),'uri':_0x2c5c79+_0x3366('0x48')+'?'+_0x18bda2,'body':{'label':_0x3ce03f,'table':_0x3366('0x3c'),'id_type':_0x3366('0x49'),'table_key':_0x5b70fd[_0x3366('0x42')],'title':_0x3366('0x4a')+_0x5b70fd[_0x3366('0x43')],'id_display':_0x5b70fd[_0x3366('0x43')]},'auth':_0x23996b,'json':!![]};return rp(_0x5d6665)['then'](function(_0x1ba198){_0xd80f32();})['catch'](function(){_0xd80f32();});});}function manageTags(_0x4b48c7,_0x6f5d3b,_0x4abf99,_0x2f3b9e,_0xf17e51,_0x16413e,_0x5e7b9e){return new Promise(function(_0x484b22,_0x139bc5){var _0x2c5161=[];_0x6f5d3b[_0x3366('0x2d')](function(_0x537623){_0x2c5161[_0x3366('0x4b')](getRemoteTag(_0x537623,_0x4abf99,_0x2f3b9e,_0x16413e,_0x5e7b9e));});return Promise['all'](_0x2c5161)['then'](function(_0x4fc6d1){if(_0x4fc6d1[_0x3366('0x10')]){logger['info']('['+[_0x4b48c7[_0x3366('0x13')]()]+_0x3366('0x4c'),_0x4fc6d1);var _0x40552c=[];_0x4fc6d1['forEach'](function(_0x53c3ce){_0x40552c['push'](assignTagToIncident(_0x53c3ce,_0x4abf99,_0x2f3b9e,_0xf17e51,_0x16413e));});return Promise[_0x3366('0x4d')](_0x40552c)['then'](function(){_0x484b22();})[_0x3366('0x15')](function(){_0x484b22();});}else{_0x484b22();}});});}function getTags(_0x35652e,_0x36e1ad,_0x1c6462,_0x173c1c,_0x23a0c7,_0x5cb456){return function(_0x2997a4){return new Promise(function(_0x2ee65f,_0x54da9d){var _0x295c66=[];var _0x9c8682=_0x173c1c[_0x3366('0x4e')];if(_0x9c8682&&_0x9c8682[_0x3366('0x10')]>0x0){_0x295c66=_[_0x3366('0x4f')](_0x9c8682,'name');}if(_0x295c66[_0x3366('0x10')]>0x0){return manageTags(_0x35652e,_0x295c66,_0x36e1ad,_0x1c6462,_0x2997a4,_0x23a0c7,_0x5cb456)[_0x3366('0xe')](function(){_0x2ee65f(_0x2997a4);});}else{_0x2ee65f(_0x2997a4);}});};}function emit(_0x130947,_0x15ea16,_0x16c92e){var _0x160e86=_0x3366('0x50')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x3366('0x51')+'%255EORDERBYDESCnumber';var _0x24c531={'uri':_0x130947+_0x3366('0x52')+_0x16c92e+_0x160e86};io['to'](util[_0x3366('0x53')](_0x3366('0x54'),_0x15ea16))[_0x3366('0x55')](_0x3366('0x56'),_0x24c531);}exports['cs']=function(_0x2d660c,_0x49e83f,_0x3706d2,_0x72a64e,_0x1d499e,_0x2350ec,_0x559d8f,_0x5802ac){var _0x3447a2={};var _0x2c4dec={'user':_0x2350ec[_0x3366('0x57')],'pass':_0x2350ec[_0x3366('0x58')]};var _0x31133c=_0x3366('0x59');var _0x47781e=_0x3366('0x5a');_0x2350ec['remoteUri']=intUtil['stripTrailingSlash'](_0x2350ec[_0x3366('0x5b')]);_0x2350ec[_0x3366('0x5c')]=intUtil[_0x3366('0x5d')](_0x2350ec['serverUrl']);var _0x533d15=util[_0x3366('0x53')]('%s/api/now/table/',_0x2350ec[_0x3366('0x5b')]);_0x3447a2['userEmail']=!_[_0x3366('0x5e')](_0x72a64e)?_0x72a64e[_0x3366('0x5f')]:null;_0x3447a2[_0x3366('0x1d')]=_0x2350ec[_0x3366('0x5f')];_0x3447a2['endUserNumber']=_0x5802ac['toLowerCase']()==='outbound'?_0x49e83f['destcalleridnum']:_0x49e83f[_0x3366('0x60')];_0x3447a2[_0x3366('0x61')]=_0x5802ac===_0x3366('0x62')||_0x5802ac===_0x3366('0x63')?'queue':'outbound';var _0x437a17=util[_0x3366('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2350ec[_0x3366('0x5c')],_0x49e83f[_0x3366('0x64')],md5(_0x49e83f[_0x3366('0x64')]));if(_0x1d499e&&_0x1d499e[_0x3366('0x65')]){logger['info']('[QUEUE]',_0x3366('0x66'));_0x49e83f['recordingURL']=_0x437a17;}else if(_0x559d8f&&_0x559d8f[_0x3366('0x67')]&&_0x559d8f[_0x3366('0x67')]!==_0x3366('0x68')){logger[_0x3366('0x12')](_0x3366('0x69'),_0x3366('0x66'));_0x49e83f[_0x3366('0x6a')]=_0x437a17;}else{_0x49e83f[_0x3366('0x6a')]='';}return getAdminUser(_0x5802ac,_0x2c4dec,_0x3447a2,_0x533d15,_0x47781e,_0x31133c)[_0x3366('0xe')](getUser(_0x5802ac,_0x2c4dec,_0x533d15,_0x47781e,_0x31133c))[_0x3366('0xe')](getEndUser(_0x5802ac,_0x2c4dec,_0x533d15,_0x47781e,_0x31133c))[_0x3366('0xe')](getTicket(_0x5802ac,_0x2c4dec,_0x533d15,_0x3706d2,_0x49e83f,_0x47781e))[_0x3366('0xe')](function(_0xb22b64){logger[_0x3366('0x12')](util[_0x3366('0x53')](_0x3366('0x6b'),_0xb22b64['ticketId']));logger[_0x3366('0x12')](util[_0x3366('0x53')](_0x3366('0x6c'),_0x5802ac));if(_0x5802ac!=='abandoned'){logger[_0x3366('0x12')]('['+[_0x5802ac[_0x3366('0x13')]()]+']',_0x3366('0x6d'));emit(_0x2350ec[_0x3366('0x5b')],_0x72a64e[_0x3366('0x39')],_0xb22b64['ticketId']);}})['catch'](function(_0x44161b){logger[_0x3366('0x1f')]('['+[_0x5802ac[_0x3366('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x3366('0x6e')](_0x44161b,{'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 58c980f..12462e9 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 _0x72f7=['get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','then','entry_list','find','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','customField','toLowerCase','content','string','push','custom_fields','idField','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','[QUEUE]','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','users','error','abandoned','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','isNil','info','Getting\x20agent\x20with\x20name'];(function(_0x4cb3ac,_0x331897){var _0x156f24=function(_0x5d7ea4){while(--_0x5d7ea4){_0x4cb3ac['push'](_0x4cb3ac['shift']());}};_0x156f24(++_0x331897);}(_0x72f7,0xcd));var _0x772f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x772f('0x0'));var rp=require(_0x772f('0x1'));var BPromise=require('bluebird');var md5=require(_0x772f('0x2'));var util=require(_0x772f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x772f('0x4'));var config=require(_0x772f('0x5'));var logger=require(_0x772f('0x6'))('sugarcrm');config[_0x772f('0x7')]=_[_0x772f('0x8')](config[_0x772f('0x7')],{'host':_0x772f('0x9'),'port':0x18eb});var io=require(_0x772f('0xa'))(new Redis(config[_0x772f('0x7')]));var def={'method':_0x772f('0xb'),'json':!![]};function emit(_0x2bcba4,_0x5f1446,_0x45e37d){io['to'](_0x2bcba4)[_0x772f('0xc')](_0x5f1446,_0x45e37d);}function getTicket(_0x2576b7,_0x5d8528,_0x349bd0,_0x193396,_0x3173b2,_0x339d16,_0x4e8d7a,_0x9abf1c){logger['info'](_0x772f('0xd'));var _0x548024=new Date();var _0x104f33=[{'name':'name','value':intUtil[_0x772f('0xe')](_0x193396[_0x772f('0xf')],_0x3173b2,'\x20')},{'name':_0x772f('0x10'),'value':_0x5d8528['id']},{'name':_0x772f('0x11'),'value':_0x5d8528['id']},{'name':'description','value':intUtil['getString'](_0x193396['Descriptions'],_0x3173b2,'\x0a')},{'name':_0x772f('0x12'),'value':_0x548024[_0x772f('0x13')]()[_0x772f('0x14')](0x0,0x13)[_0x772f('0x15')]('T','\x20')},{'name':_0x772f('0x16'),'value':'0'},{'name':_0x772f('0x17'),'value':'15'},{'name':_0x772f('0x18'),'value':_0x349bd0['id']},{'name':_0x772f('0x19'),'value':_0x772f('0x1a')},{'name':_0x772f('0x1b'),'value':_0x349bd0['name']},{'name':_0x772f('0x1c'),'value':_0x9abf1c}];if(_0x339d16['length']){_[_0x772f('0x1d')](_0x339d16,function(_0x514b68){if(_0x3173b2[_0x514b68[_0x772f('0x1e')]]){_0x104f33['push']({'name':_0x514b68['idField'],'value':_0x3173b2[_0x514b68[_0x772f('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x772f('0x1f'),'response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'session':_0x4e8d7a['id'],'module_name':_0x772f('0x21'),'name_value_list':_0x104f33})}});}function getAuth(_0x4f3cc6){return util[_0x772f('0x22')](_0x772f('0x23'),new Buffer(_0x4f3cc6[_0x772f('0x24')]+':X')[_0x772f('0x25')]('base64'));}function getServerInfo(_0x25edf2){return request({'form':{'method':'get_server_info','input_type':_0x772f('0x1f'),'response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'session':_0x25edf2['id']})}});}function getUser(_0x225915,_0x53bcc7,_0x28f1ee){if(!_[_0x772f('0x26')](_0x53bcc7)){logger[_0x772f('0x27')](_0x772f('0x28'),_0x53bcc7);return request({'form':{'method':_0x772f('0x29'),'input_type':_0x772f('0x1f'),'response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'session':_0x28f1ee['id'],'module_name':_0x772f('0x2a'),'query':util[_0x772f('0x22')](_0x772f('0x2b'),_0x53bcc7),'order_by':'','offset':'0','select_fields':['id',_0x772f('0x2c'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x772f('0x2d')](function(_0x23bf2d){if(_0x23bf2d[_0x772f('0x2e')]['length']){var _0x631f51=_[_0x772f('0x2f')](_0x23bf2d['entry_list'],function(_0x2f6c87){return _0x2f6c87['name_value_list']['user_name'][_0x772f('0x30')]===_0x53bcc7;});if(_0x631f51){logger['info'](_0x772f('0x31'));return BPromise['resolve']({'id':_0x631f51[_0x772f('0x32')]['id'][_0x772f('0x30')],'name':_0x631f51['name_value_list'][_0x772f('0x2c')]['value']});}}logger[_0x772f('0x27')](_0x772f('0x33'));return BPromise[_0x772f('0x34')]({'id':_0x28f1ee[_0x772f('0x32')][_0x772f('0x35')]['value'],'name':_0x28f1ee['name_value_list'][_0x772f('0x36')][_0x772f('0x30')]});});}else{logger['info'](_0x772f('0x37'));return BPromise[_0x772f('0x34')]({'id':_0x28f1ee[_0x772f('0x32')][_0x772f('0x35')][_0x772f('0x30')],'name':_0x28f1ee['name_value_list'][_0x772f('0x36')][_0x772f('0x30')]});}}function getEndUser(_0x1faf34,_0x26ef8b,_0x208768,_0x357fc9){logger['info']('Searching\x20enduser\x20with\x20phone',_0x208768);return request({'form':{'method':'get_entry_list','input_type':_0x772f('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x357fc9['id'],'module_name':'Contacts','query':util[_0x772f('0x22')](_0x772f('0x38'),_0x208768),'order_by':'','offset':'0','select_fields':['id',_0x772f('0x2c'),_0x772f('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x772f('0x2d')](function(_0x30f612){if(_0x30f612[_0x772f('0x2e')][_0x772f('0x3a')]){var _0x15fe06=_['find'](_0x30f612[_0x772f('0x2e')],function(_0x2017b3){return _0x2017b3[_0x772f('0x32')][_0x772f('0x39')][_0x772f('0x30')]===_0x208768;});if(_0x15fe06){logger[_0x772f('0x27')]('Enduser\x20found!');return BPromise[_0x772f('0x34')]({'id':_0x15fe06[_0x772f('0x32')]['id']['value'],'name':_0x15fe06['name_value_list'][_0x772f('0x2c')][_0x772f('0x30')],'phone':_0x15fe06[_0x772f('0x32')][_0x772f('0x39')][_0x772f('0x30')]});}}else{logger['info'](_0x772f('0x3b'));return request({'form':{'method':_0x772f('0x3c'),'input_type':'JSON','response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'session':_0x357fc9['id'],'module_name':_0x772f('0x1a'),'name_value_list':[{'name':'first_name','value':_0x26ef8b!==''?_0x26ef8b:util[_0x772f('0x22')](_0x772f('0x3d'),_0x208768)},{'name':'phone_home','value':_0x208768}]})}})[_0x772f('0x2d')](function(_0x559801){logger[_0x772f('0x27')](_0x772f('0x3e'));return BPromise['resolve']({'id':_0x559801['id'],'name':_0x559801['entry_list']['first_name'][_0x772f('0x30')],'phone':_0x559801[_0x772f('0x2e')][_0x772f('0x39')][_0x772f('0x30')]});});}});}function request(_0xdf5a91){logger[_0x772f('0x3f')](_0x772f('0x40'),JSON['stringify'](_0xdf5a91));return rp(_[_0x772f('0x41')](def,_0xdf5a91));}function getTags(_0x1dc3d7,_0x47754c){var _0x3aa1ec=[];if(_0x1dc3d7&&_0x1dc3d7['length']>0x0){_0x3aa1ec=_[_0x772f('0x42')](_0x1dc3d7,_0x47754c);}return _0x3aa1ec;}function getCustomFields(_0x4a7876,_0x401fd6){var _0x51376b=[];var _0x36c826={'custom_fields':[]};if(_0x4a7876[_0x772f('0x3a')]>0x0){_[_0x772f('0x1d')](_0x4a7876,function(_0x1df7db){if(_0x1df7db[_0x772f('0x43')]==='string'&&_0x1df7db[_0x772f('0x44')]&&!_0x1df7db[_0x772f('0x45')]){_0x36c826[_0x1df7db[_0x772f('0x44')][_0x772f('0x46')]()]=_0x1df7db[_0x772f('0x47')][_0x772f('0x25')]();}else if(_0x1df7db[_0x772f('0x43')]===_0x772f('0x48')&&_0x1df7db['idField']&&_0x1df7db[_0x772f('0x45')]){_0x36c826['custom_fields'][_0x772f('0x49')]({'id':_0x1df7db['idField'],'value':_0x1df7db[_0x772f('0x47')][_0x772f('0x25')]()});}else if(_0x1df7db['type']==='variable'&&_0x1df7db['variableName']&&_0x1df7db['idField']&&_0x1df7db['customField']){_0x401fd6[_0x1df7db['variableName']]&&_0x36c826[_0x772f('0x4a')][_0x772f('0x49')]({'id':_0x1df7db[_0x772f('0x4b')],'value':_0x401fd6[_0x1df7db[_0x772f('0x1e')]][_0x772f('0x25')]()});}else if(_0x1df7db[_0x772f('0x43')]===_0x772f('0x4c')&&_0x1df7db[_0x772f('0x4d')]&&_0x1df7db[_0x772f('0x4d')][_0x772f('0x2c')]&&_0x1df7db[_0x772f('0x4b')]&&_0x1df7db[_0x772f('0x45')]){_0x401fd6[_0x1df7db[_0x772f('0x4d')][_0x772f('0x2c')]['toLowerCase']()]&&_0x36c826['custom_fields'][_0x772f('0x49')]({'id':_0x1df7db[_0x772f('0x4b')],'value':_0x401fd6[_0x1df7db['Variable'][_0x772f('0x2c')][_0x772f('0x46')]()][_0x772f('0x25')]()});}});}return _0x36c826;}function getConnection(_0x49324f){return request({'method':_0x772f('0xb'),'form':{'method':_0x772f('0x4e'),'input_type':_0x772f('0x1f'),'response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'user_auth':{'user_name':_0x49324f['username'],'password':_0x49324f[_0x772f('0x4f')],'encryption':_0x772f('0x50')},'application':_0x772f('0x51')})}})['then'](function(_0x141045){var _0x1b44d4=_0x141045;if(_0x1b44d4['id']){def['sessionID']=_0x1b44d4['id'];return BPromise[_0x772f('0x34')](_0x1b44d4);}else{throw new Error(util['format'](_0x772f('0x52'),_0x49324f['id']));}});}function setRelationship(_0x31f4b9,_0x545d2b,_0x33b03a,_0x19e5d9){return request({'form':{'method':_0x772f('0x53'),'input_type':_0x772f('0x1f'),'response_type':_0x772f('0x1f'),'rest_data':JSON[_0x772f('0x20')]({'session':_0x31f4b9['id'],'module_name':_0x772f('0x21'),'module_id':_0x33b03a['id'],'link_field_name':_0x19e5d9,'related_ids':[_0x545d2b['id']]})}});}exports[_0x772f('0x54')]=function(_0x3ebb61,_0x55b6cd,_0x54c169,_0x259f97,_0x445429,_0x5ab745){var _0x2731f9,_0x4c0007,_0x2a7822,_0x6ae4cd;_0x5ab745[_0x772f('0x55')]=intUtil[_0x772f('0x56')](_0x5ab745[_0x772f('0x55')]);_0x5ab745[_0x772f('0x57')]=intUtil[_0x772f('0x56')](_0x5ab745['serverUrl']);def['uri']=util['format'](_0x772f('0x58'),_0x5ab745[_0x772f('0x55')]);if(_0x445429&&_0x445429[_0x772f('0x59')]){logger[_0x772f('0x27')]('[QUEUE]',_0x772f('0x5a'));_0x55b6cd[_0x772f('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ab745[_0x772f('0x57')],_0x55b6cd[_0x772f('0x5c')],md5(_0x55b6cd[_0x772f('0x5c')]));}else{_0x55b6cd[_0x772f('0x5b')]='';}return getConnection(_0x5ab745)[_0x772f('0x2d')](function(_0x1ab141){_0x6ae4cd=_0x1ab141;return getUser(_0x5ab745,_0x259f97[_0x772f('0x2c')],_0x6ae4cd);})[_0x772f('0x2d')](function(_0xd9c630){_0x2731f9=_0xd9c630;logger[_0x772f('0x27')]('The\x20User\x20ID\x20is:',_0x2731f9['id']);return getEndUser(_0x5ab745,_0x55b6cd[_0x772f('0x5d')],_0x55b6cd[_0x772f('0x5e')],_0x6ae4cd);})[_0x772f('0x2d')](function(_0x292b1b){_0x4c0007=_0x292b1b;logger[_0x772f('0x27')](_0x772f('0x5f'),_0x4c0007['id']);return getTicket(_0x5ab745,_0x2731f9,_0x4c0007,_0x54c169,_0x55b6cd,_0x54c169[_0x772f('0x60')],_0x6ae4cd,_0x772f('0x61'));})[_0x772f('0x2d')](function(_0x56d9e9){_0x2a7822=_0x56d9e9;logger['info'](_0x772f('0x62'));logger[_0x772f('0x27')](_0x772f('0x63'),_0x2a7822['id']);return setRelationship(_0x6ae4cd,_0x2731f9,_0x2a7822,'users');})[_0x772f('0x2d')](function(){return setRelationship(_0x6ae4cd,_0x4c0007,_0x2a7822,_0x772f('0x64'));})['then'](function(){return getServerInfo(_0x6ae4cd);})[_0x772f('0x2d')](function(_0x4871ce){var _0x207190=parseInt(_0x4871ce[_0x772f('0x65')][_0x772f('0x66')](0x0));var _0x2431bd=util[_0x772f('0x22')](_0x772f('0x67'),_0x5ab745['remoteUri'],_0x2a7822['id']);if(_0x207190>0x6){_0x2431bd=util[_0x772f('0x22')](_0x772f('0x68'),_0x5ab745[_0x772f('0x55')],_0x2a7822['id']);}logger['info']('[QUEUE]',_0x772f('0x69'));emit(util['format'](_0x772f('0x6a'),_0x259f97['name']),_0x772f('0x6b'),{'uri':_0x2431bd});})[_0x772f('0x6c')](function(_0x2cc6e9){logger['error'](_0x772f('0x6d'),JSON[_0x772f('0x20')](_0x2cc6e9));});};exports[_0x772f('0x6e')]=function(_0x5c0823,_0x1f06f9,_0x4a2f86,_0x1629df,_0x1ade08,_0x51c945,_0x2a341d){var _0x239da7,_0x3107e9,_0x1a06df,_0x252c03;_0x51c945[_0x772f('0x55')]=intUtil[_0x772f('0x56')](_0x51c945[_0x772f('0x55')]);_0x51c945[_0x772f('0x57')]=intUtil[_0x772f('0x56')](_0x51c945['serverUrl']);def[_0x772f('0x6f')]=util[_0x772f('0x22')](_0x772f('0x58'),_0x51c945[_0x772f('0x55')]);if(_0x2a341d&&_0x2a341d[_0x772f('0x70')]&&_0x2a341d['recordingFormat']!==_0x772f('0x71')){logger[_0x772f('0x27')](_0x772f('0x72'),_0x772f('0x5a'));_0x1f06f9[_0x772f('0x5b')]=util[_0x772f('0x22')](_0x772f('0x73'),_0x51c945['serverUrl'],_0x1f06f9[_0x772f('0x5c')],md5(_0x1f06f9[_0x772f('0x5c')]));}return getConnection(_0x51c945)[_0x772f('0x2d')](function(_0x41be86){_0x252c03=_0x41be86;return getUser(_0x51c945,_0x1629df['name'],_0x252c03);})[_0x772f('0x2d')](function(_0x490b00){_0x239da7=_0x490b00;logger[_0x772f('0x27')](_0x772f('0x74'),_0x239da7['id']);return getEndUser(_0x51c945,_0x1f06f9['destcalleridname'],_0x1f06f9[_0x772f('0x75')],_0x252c03);})[_0x772f('0x2d')](function(_0x3ab8bc){_0x3107e9=_0x3ab8bc;logger[_0x772f('0x27')]('The\x20Enduser\x20ID\x20is:',_0x3107e9['id']);return getTicket(_0x51c945,_0x239da7,_0x3107e9,_0x4a2f86,_0x1f06f9,_0x4a2f86[_0x772f('0x60')],_0x252c03,_0x772f('0x76'));})['then'](function(_0x27a12f){_0x1a06df=_0x27a12f;logger[_0x772f('0x27')](_0x772f('0x62'));logger[_0x772f('0x27')](_0x772f('0x63'),_0x1a06df['id']);return setRelationship(_0x252c03,_0x239da7,_0x1a06df,_0x772f('0x77'));})[_0x772f('0x2d')](function(){return setRelationship(_0x252c03,_0x3107e9,_0x1a06df,_0x772f('0x64'));})[_0x772f('0x2d')](function(){return getServerInfo(_0x252c03);})[_0x772f('0x2d')](function(_0x1b2221){var _0x2ff64c=parseInt(_0x1b2221['version'][_0x772f('0x66')](0x0));var _0x500926=util[_0x772f('0x22')](_0x772f('0x67'),_0x51c945[_0x772f('0x55')],_0x1a06df['id']);if(_0x2ff64c>0x6){_0x500926=util[_0x772f('0x22')](_0x772f('0x68'),_0x51c945[_0x772f('0x55')],_0x1a06df['id']);}logger[_0x772f('0x27')](_0x772f('0x72'),_0x772f('0x69'));emit(util[_0x772f('0x22')](_0x772f('0x6a'),_0x1629df[_0x772f('0x2c')]),_0x772f('0x6b'),{'uri':_0x500926});})[_0x772f('0x6c')](function(_0x4bab2f){logger[_0x772f('0x78')](_0x772f('0x72'),JSON['stringify'](_0x4bab2f));});};exports[_0x772f('0x79')]=function(_0xdbedc9,_0x4adb1,_0x5769a8,_0x29d088,_0x53dce4,_0x15d435){var _0x56dc26,_0x45acca,_0x16ce31,_0x1dee76;_0x15d435[_0x772f('0x55')]=intUtil[_0x772f('0x56')](_0x15d435[_0x772f('0x55')]);_0x15d435['serverUrl']=intUtil[_0x772f('0x56')](_0x15d435[_0x772f('0x57')]);def[_0x772f('0x6f')]=util['format'](_0x772f('0x58'),_0x15d435[_0x772f('0x55')]);if(_0x53dce4&&_0x53dce4[_0x772f('0x59')]){logger[_0x772f('0x27')](_0x772f('0x7a'),_0x772f('0x5a'));_0x4adb1['recordingURL']=util[_0x772f('0x22')](_0x772f('0x73'),_0x15d435['serverUrl'],_0x4adb1[_0x772f('0x5c')],md5(_0x4adb1[_0x772f('0x5c')]));}else{_0x4adb1[_0x772f('0x5b')]='';}return getConnection(_0x15d435)[_0x772f('0x2d')](function(_0x16cc46){_0x1dee76=_0x16cc46;if(!_[_0x772f('0x26')](_0x29d088)){return getUser(_0x15d435,_0x29d088[_0x772f('0x2c')],_0x1dee76);}else{return getUser(_0x15d435,null,_0x1dee76);}})[_0x772f('0x2d')](function(_0x18ebc5){_0x56dc26=_0x18ebc5;logger['info'](_0x772f('0x74'),_0x56dc26['id']);return getEndUser(_0x15d435,_0x4adb1[_0x772f('0x5d')],_0x4adb1[_0x772f('0x5e')],_0x1dee76);})[_0x772f('0x2d')](function(_0x75c698){_0x45acca=_0x75c698;logger[_0x772f('0x27')]('The\x20Enduser\x20ID\x20is:',_0x45acca['id']);return getTicket(_0x15d435,_0x56dc26,_0x45acca,_0x5769a8,_0x4adb1,_0x5769a8[_0x772f('0x60')],_0x1dee76,_0x772f('0x61'));})[_0x772f('0x2d')](function(_0x52d15a){_0x16ce31=_0x52d15a;logger[_0x772f('0x27')](_0x772f('0x62'));logger[_0x772f('0x27')](_0x772f('0x63'),_0x16ce31['id']);return setRelationship(_0x1dee76,_0x56dc26,_0x16ce31,_0x772f('0x77'));})['then'](function(){return setRelationship(_0x1dee76,_0x45acca,_0x16ce31,'contacts');})[_0x772f('0x2d')](function(){return getServerInfo(_0x1dee76);})[_0x772f('0x6c')](function(_0x1d13d4){logger[_0x772f('0x78')](_0x772f('0x7a'),JSON[_0x772f('0x20')](_0x1d13d4));});}; \ No newline at end of file +var _0xabd5=['Caller\x20-\x20%s','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','idField','content','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','users','version','error','monitor_format','The\x20User\x20ID\x20is:','calleridnum','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name',''];(function(_0x23519d,_0x1c1979){var _0x225f62=function(_0x74b6f8){while(--_0x74b6f8){_0x23519d['push'](_0x23519d['shift']());}};_0x225f62(++_0x1c1979);}(_0xabd5,0x18e));var _0x5abd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xabd5[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require(_0x5abd('0x0'));var BPromise=require(_0x5abd('0x1'));var md5=require(_0x5abd('0x2'));var util=require(_0x5abd('0x3'));var Redis=require(_0x5abd('0x4'));var intUtil=require(_0x5abd('0x5'));var config=require(_0x5abd('0x6'));var logger=require(_0x5abd('0x7'))(_0x5abd('0x8'));config[_0x5abd('0x9')]=_['defaults'](config[_0x5abd('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x5abd('0xa'))(new Redis(config['redis']));var def={'method':_0x5abd('0xb'),'json':!![]};function emit(_0x59515d,_0x54bc42,_0x1d8a60){io['to'](_0x59515d)['emit'](_0x54bc42,_0x1d8a60);}function getTicket(_0xfa6f54,_0x3ec6c3,_0x566291,_0x3b78df,_0x2cb4f3,_0x4c7061,_0x419ba5,_0x419d4e){logger[_0x5abd('0xc')](_0x5abd('0xd'));var _0xffb5a4=new Date();var _0x3774af=[{'name':'name','value':intUtil[_0x5abd('0xe')](_0x3b78df[_0x5abd('0xf')],_0x2cb4f3,'\x20')},{'name':_0x5abd('0x10'),'value':_0x3ec6c3['id']},{'name':_0x5abd('0x11'),'value':_0x3ec6c3['id']},{'name':_0x5abd('0x12'),'value':intUtil[_0x5abd('0xe')](_0x3b78df['Descriptions'],_0x2cb4f3,'\x0a')},{'name':_0x5abd('0x13'),'value':_0xffb5a4['toISOString']()[_0x5abd('0x14')](0x0,0x13)[_0x5abd('0x15')]('T','\x20')},{'name':_0x5abd('0x16'),'value':'0'},{'name':_0x5abd('0x17'),'value':'15'},{'name':'parent_id','value':_0x566291['id']},{'name':_0x5abd('0x18'),'value':_0x5abd('0x19')},{'name':_0x5abd('0x1a'),'value':_0x566291[_0x5abd('0x1b')]},{'name':_0x5abd('0x1c'),'value':_0x419d4e}];if(_0x4c7061[_0x5abd('0x1d')]){_[_0x5abd('0x1e')](_0x4c7061,function(_0x1d9327){if(_0x2cb4f3[_0x1d9327[_0x5abd('0x1f')]]){_0x3774af[_0x5abd('0x20')]({'name':_0x1d9327['idField'],'value':_0x2cb4f3[_0x1d9327[_0x5abd('0x1f')]]});}});}return request({'form':{'method':_0x5abd('0x21'),'input_type':_0x5abd('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x419ba5['id'],'module_name':_0x5abd('0x23'),'name_value_list':_0x3774af})}});}function getAuth(_0x1f1333){return util[_0x5abd('0x24')](_0x5abd('0x25'),new Buffer(_0x1f1333[_0x5abd('0x26')]+':X')['toString'](_0x5abd('0x27')));}function getServerInfo(_0xaf2432){return request({'form':{'method':_0x5abd('0x28'),'input_type':_0x5abd('0x22'),'response_type':_0x5abd('0x22'),'rest_data':JSON[_0x5abd('0x29')]({'session':_0xaf2432['id']})}});}function getUser(_0xc33ed0,_0x3fd00a,_0x2f48b7){if(!_[_0x5abd('0x2a')](_0x3fd00a)){logger['info']('Getting\x20agent\x20with\x20name',_0x3fd00a);return request({'form':{'method':_0x5abd('0x2b'),'input_type':_0x5abd('0x22'),'response_type':'JSON','rest_data':JSON[_0x5abd('0x29')]({'session':_0x2f48b7['id'],'module_name':_0x5abd('0x2c'),'query':util[_0x5abd('0x24')](_0x5abd('0x2d'),_0x3fd00a),'order_by':'','offset':'0','select_fields':['id',_0x5abd('0x1b'),_0x5abd('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5abd('0x2f')](function(_0x434443){if(_0x434443[_0x5abd('0x30')]['length']){var _0x51f704=_[_0x5abd('0x31')](_0x434443[_0x5abd('0x30')],function(_0x486da5){return _0x486da5[_0x5abd('0x32')][_0x5abd('0x2e')][_0x5abd('0x33')]===_0x3fd00a;});if(_0x51f704){logger[_0x5abd('0xc')](_0x5abd('0x34'));return BPromise[_0x5abd('0x35')]({'id':_0x51f704[_0x5abd('0x32')]['id']['value'],'name':_0x51f704['name_value_list'][_0x5abd('0x1b')][_0x5abd('0x33')]});}}logger[_0x5abd('0xc')](_0x5abd('0x36'));return BPromise[_0x5abd('0x35')]({'id':_0x2f48b7[_0x5abd('0x32')][_0x5abd('0x37')]['value'],'name':_0x2f48b7[_0x5abd('0x32')][_0x5abd('0x2e')][_0x5abd('0x33')]});});}else{logger['info'](_0x5abd('0x38'));return BPromise['resolve']({'id':_0x2f48b7[_0x5abd('0x32')][_0x5abd('0x37')]['value'],'name':_0x2f48b7['name_value_list'][_0x5abd('0x2e')][_0x5abd('0x33')]});}}function getEndUser(_0x39f72c,_0x36fd49,_0x312d7b,_0x4c28d7){logger['info']('Searching\x20enduser\x20with\x20phone',_0x312d7b);return request({'form':{'method':'get_entry_list','input_type':_0x5abd('0x22'),'response_type':_0x5abd('0x22'),'rest_data':JSON[_0x5abd('0x29')]({'session':_0x4c28d7['id'],'module_name':_0x5abd('0x19'),'query':util[_0x5abd('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x312d7b),'order_by':'','offset':'0','select_fields':['id','name',_0x5abd('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5abd('0x2f')](function(_0xaa3144){if(_0xaa3144[_0x5abd('0x30')][_0x5abd('0x1d')]){var _0x265882=_[_0x5abd('0x31')](_0xaa3144[_0x5abd('0x30')],function(_0x53a5f8){return _0x53a5f8[_0x5abd('0x32')][_0x5abd('0x39')][_0x5abd('0x33')]===_0x312d7b;});if(_0x265882){logger['info'](_0x5abd('0x3a'));return BPromise['resolve']({'id':_0x265882[_0x5abd('0x32')]['id'][_0x5abd('0x33')],'name':_0x265882[_0x5abd('0x32')][_0x5abd('0x1b')][_0x5abd('0x33')],'phone':_0x265882[_0x5abd('0x32')][_0x5abd('0x39')]['value']});}}else{logger[_0x5abd('0xc')](_0x5abd('0x3b'));return request({'form':{'method':_0x5abd('0x21'),'input_type':_0x5abd('0x22'),'response_type':_0x5abd('0x22'),'rest_data':JSON[_0x5abd('0x29')]({'session':_0x4c28d7['id'],'module_name':_0x5abd('0x19'),'name_value_list':[{'name':_0x5abd('0x3c'),'value':_0x36fd49!==_0x5abd('0x3d')?_0x36fd49:util['format'](_0x5abd('0x3e'),_0x312d7b)},{'name':_0x5abd('0x39'),'value':_0x312d7b}]})}})[_0x5abd('0x2f')](function(_0x5570c2){logger[_0x5abd('0xc')]('Enduser\x20created.');return BPromise[_0x5abd('0x35')]({'id':_0x5570c2['id'],'name':_0x5570c2[_0x5abd('0x30')][_0x5abd('0x3c')]['value'],'phone':_0x5570c2[_0x5abd('0x30')][_0x5abd('0x39')][_0x5abd('0x33')]});});}});}function request(_0x4a3928){logger['debug']('[HTTP]',JSON[_0x5abd('0x29')](_0x4a3928));return rp(_['merge'](def,_0x4a3928));}function getTags(_0x31c15f,_0x25845d){var _0x356bc0=[];if(_0x31c15f&&_0x31c15f[_0x5abd('0x1d')]>0x0){_0x356bc0=_[_0x5abd('0x3f')](_0x31c15f,_0x25845d);}return _0x356bc0;}function getCustomFields(_0x2ba762,_0x5b1faa){var _0x3c3a9f=[];var _0x169687={'custom_fields':[]};if(_0x2ba762[_0x5abd('0x1d')]>0x0){_[_0x5abd('0x1e')](_0x2ba762,function(_0x1be997){if(_0x1be997[_0x5abd('0x40')]===_0x5abd('0x41')&&_0x1be997[_0x5abd('0x42')]&&!_0x1be997[_0x5abd('0x43')]){_0x169687[_0x1be997[_0x5abd('0x42')][_0x5abd('0x44')]()]=_0x1be997['content'][_0x5abd('0x45')]();}else if(_0x1be997[_0x5abd('0x40')]===_0x5abd('0x41')&&_0x1be997['idField']&&_0x1be997[_0x5abd('0x43')]){_0x169687[_0x5abd('0x46')]['push']({'id':_0x1be997[_0x5abd('0x47')],'value':_0x1be997[_0x5abd('0x48')][_0x5abd('0x45')]()});}else if(_0x1be997[_0x5abd('0x40')]===_0x5abd('0x49')&&_0x1be997[_0x5abd('0x1f')]&&_0x1be997[_0x5abd('0x47')]&&_0x1be997[_0x5abd('0x43')]){_0x5b1faa[_0x1be997['variableName']]&&_0x169687[_0x5abd('0x46')][_0x5abd('0x20')]({'id':_0x1be997[_0x5abd('0x47')],'value':_0x5b1faa[_0x1be997[_0x5abd('0x1f')]][_0x5abd('0x45')]()});}else if(_0x1be997['type']===_0x5abd('0x4a')&&_0x1be997[_0x5abd('0x4b')]&&_0x1be997[_0x5abd('0x4b')][_0x5abd('0x1b')]&&_0x1be997[_0x5abd('0x47')]&&_0x1be997[_0x5abd('0x43')]){_0x5b1faa[_0x1be997['Variable'][_0x5abd('0x1b')]['toLowerCase']()]&&_0x169687['custom_fields']['push']({'id':_0x1be997[_0x5abd('0x47')],'value':_0x5b1faa[_0x1be997[_0x5abd('0x4b')][_0x5abd('0x1b')][_0x5abd('0x44')]()]['toString']()});}});}return _0x169687;}function getConnection(_0x141243){return request({'method':'POST','form':{'method':_0x5abd('0x4c'),'input_type':_0x5abd('0x22'),'response_type':_0x5abd('0x22'),'rest_data':JSON[_0x5abd('0x29')]({'user_auth':{'user_name':_0x141243['username'],'password':_0x141243[_0x5abd('0x4d')],'encryption':_0x5abd('0x4e')},'application':_0x5abd('0x4f')})}})[_0x5abd('0x2f')](function(_0x1584c3){var _0x7d9462=_0x1584c3;if(_0x7d9462['id']){def[_0x5abd('0x50')]=_0x7d9462['id'];return BPromise[_0x5abd('0x35')](_0x7d9462);}else{throw new Error(util[_0x5abd('0x24')](_0x5abd('0x51'),_0x141243['id']));}});}function setRelationship(_0x5a48b7,_0x5cc67c,_0x43ace3,_0x1a0219){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x5abd('0x22'),'rest_data':JSON[_0x5abd('0x29')]({'session':_0x5a48b7['id'],'module_name':'Calls','module_id':_0x43ace3['id'],'link_field_name':_0x1a0219,'related_ids':[_0x5cc67c['id']]})}});}exports[_0x5abd('0x52')]=function(_0x1ac6bd,_0x1c9e47,_0x1f6dd5,_0x5d346a,_0x313678,_0x30a77f){var _0x55febf,_0x3a848b,_0x45fb06,_0x28edd6;_0x30a77f[_0x5abd('0x53')]=intUtil[_0x5abd('0x54')](_0x30a77f['remoteUri']);_0x30a77f[_0x5abd('0x55')]=intUtil[_0x5abd('0x54')](_0x30a77f[_0x5abd('0x55')]);def[_0x5abd('0x56')]=util[_0x5abd('0x24')](_0x5abd('0x57'),_0x30a77f[_0x5abd('0x53')]);if(_0x313678&&_0x313678['monitor_format']){logger[_0x5abd('0xc')](_0x5abd('0x58'),_0x5abd('0x59'));_0x1c9e47[_0x5abd('0x5a')]=util[_0x5abd('0x24')](_0x5abd('0x5b'),_0x30a77f[_0x5abd('0x55')],_0x1c9e47[_0x5abd('0x5c')],md5(_0x1c9e47[_0x5abd('0x5c')]));}else{_0x1c9e47[_0x5abd('0x5a')]='';}return getConnection(_0x30a77f)['then'](function(_0xc952ff){_0x28edd6=_0xc952ff;return getUser(_0x30a77f,_0x5d346a['name'],_0x28edd6);})['then'](function(_0x3bf89c){_0x55febf=_0x3bf89c;logger['info']('The\x20User\x20ID\x20is:',_0x55febf['id']);return getEndUser(_0x30a77f,_0x1c9e47[_0x5abd('0x5d')],_0x1c9e47['calleridnum'],_0x28edd6);})[_0x5abd('0x2f')](function(_0x3dbaf8){_0x3a848b=_0x3dbaf8;logger[_0x5abd('0xc')](_0x5abd('0x5e'),_0x3a848b['id']);return getTicket(_0x30a77f,_0x55febf,_0x3a848b,_0x1f6dd5,_0x1c9e47,_0x1f6dd5[_0x5abd('0x5f')],_0x28edd6,_0x5abd('0x60'));})['then'](function(_0x1793f3){_0x45fb06=_0x1793f3;logger[_0x5abd('0xc')](_0x5abd('0x61'));logger[_0x5abd('0xc')]('The\x20Ticket\x20ID\x20is:',_0x45fb06['id']);return setRelationship(_0x28edd6,_0x55febf,_0x45fb06,'users');})[_0x5abd('0x2f')](function(){return setRelationship(_0x28edd6,_0x3a848b,_0x45fb06,_0x5abd('0x62'));})[_0x5abd('0x2f')](function(){return getServerInfo(_0x28edd6);})['then'](function(_0x325bf1){var _0x31409a=parseInt(_0x325bf1['version'][_0x5abd('0x63')](0x0));var _0x16c156=util[_0x5abd('0x24')](_0x5abd('0x64'),_0x30a77f[_0x5abd('0x53')],_0x45fb06['id']);if(_0x31409a>0x6){_0x16c156=util[_0x5abd('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x30a77f[_0x5abd('0x53')],_0x45fb06['id']);}logger['info'](_0x5abd('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5abd('0x24')](_0x5abd('0x65'),_0x5d346a['name']),_0x5abd('0x66'),{'uri':_0x16c156});})[_0x5abd('0x67')](function(_0x7d8c13){logger['error'](_0x5abd('0x58'),JSON[_0x5abd('0x29')](_0x7d8c13));});};exports['outbound']=function(_0x1f5ed6,_0x60a87c,_0x941907,_0xa2a1a9,_0x1f43c9,_0x2c80bf,_0x55b647){var _0x1cd3fa,_0x2cce70,_0x499331,_0xb18f36;_0x2c80bf[_0x5abd('0x53')]=intUtil[_0x5abd('0x54')](_0x2c80bf['remoteUri']);_0x2c80bf['serverUrl']=intUtil[_0x5abd('0x54')](_0x2c80bf[_0x5abd('0x55')]);def['uri']=util[_0x5abd('0x24')](_0x5abd('0x57'),_0x2c80bf[_0x5abd('0x53')]);if(_0x55b647&&_0x55b647[_0x5abd('0x68')]&&_0x55b647[_0x5abd('0x68')]!=='none'){logger[_0x5abd('0xc')](_0x5abd('0x69'),_0x5abd('0x59'));_0x60a87c[_0x5abd('0x5a')]=util[_0x5abd('0x24')](_0x5abd('0x5b'),_0x2c80bf[_0x5abd('0x55')],_0x60a87c[_0x5abd('0x5c')],md5(_0x60a87c[_0x5abd('0x5c')]));}return getConnection(_0x2c80bf)[_0x5abd('0x2f')](function(_0x326e2d){_0xb18f36=_0x326e2d;return getUser(_0x2c80bf,_0xa2a1a9[_0x5abd('0x1b')],_0xb18f36);})[_0x5abd('0x2f')](function(_0x2608d9){_0x1cd3fa=_0x2608d9;logger['info']('The\x20User\x20ID\x20is:',_0x1cd3fa['id']);return getEndUser(_0x2c80bf,_0x60a87c[_0x5abd('0x6a')],_0x60a87c[_0x5abd('0x6b')],_0xb18f36);})['then'](function(_0x196d48){_0x2cce70=_0x196d48;logger[_0x5abd('0xc')](_0x5abd('0x5e'),_0x2cce70['id']);return getTicket(_0x2c80bf,_0x1cd3fa,_0x2cce70,_0x941907,_0x60a87c,_0x941907[_0x5abd('0x5f')],_0xb18f36,'Outbound');})[_0x5abd('0x2f')](function(_0x160c5a){_0x499331=_0x160c5a;logger['info'](_0x5abd('0x61'));logger[_0x5abd('0xc')](_0x5abd('0x6c'),_0x499331['id']);return setRelationship(_0xb18f36,_0x1cd3fa,_0x499331,_0x5abd('0x6d'));})[_0x5abd('0x2f')](function(){return setRelationship(_0xb18f36,_0x2cce70,_0x499331,_0x5abd('0x62'));})[_0x5abd('0x2f')](function(){return getServerInfo(_0xb18f36);})[_0x5abd('0x2f')](function(_0xb7e385){var _0x298f7c=parseInt(_0xb7e385[_0x5abd('0x6e')]['charAt'](0x0));var _0x57f2da=util[_0x5abd('0x24')](_0x5abd('0x64'),_0x2c80bf['remoteUri'],_0x499331['id']);if(_0x298f7c>0x6){_0x57f2da=util[_0x5abd('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2c80bf['remoteUri'],_0x499331['id']);}logger[_0x5abd('0xc')](_0x5abd('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0xa2a1a9['name']),_0x5abd('0x66'),{'uri':_0x57f2da});})['catch'](function(_0x4a0a4a){logger[_0x5abd('0x6f')](_0x5abd('0x69'),JSON[_0x5abd('0x29')](_0x4a0a4a));});};exports['abandoned']=function(_0x507e37,_0x28b9d8,_0x331c5f,_0x5a3f87,_0x51daba,_0x15940f){var _0x51dd40,_0x4d0bf3,_0x491adb,_0x2a7bfe;_0x15940f['remoteUri']=intUtil[_0x5abd('0x54')](_0x15940f[_0x5abd('0x53')]);_0x15940f['serverUrl']=intUtil['stripTrailingSlash'](_0x15940f['serverUrl']);def[_0x5abd('0x56')]=util[_0x5abd('0x24')]('%s/service/v4_1/rest.php',_0x15940f[_0x5abd('0x53')]);if(_0x51daba&&_0x51daba[_0x5abd('0x70')]){logger[_0x5abd('0xc')]('[ABANDONED]',_0x5abd('0x59'));_0x28b9d8[_0x5abd('0x5a')]=util[_0x5abd('0x24')](_0x5abd('0x5b'),_0x15940f[_0x5abd('0x55')],_0x28b9d8[_0x5abd('0x5c')],md5(_0x28b9d8[_0x5abd('0x5c')]));}else{_0x28b9d8['recordingURL']='';}return getConnection(_0x15940f)['then'](function(_0x41617f){_0x2a7bfe=_0x41617f;if(!_[_0x5abd('0x2a')](_0x5a3f87)){return getUser(_0x15940f,_0x5a3f87[_0x5abd('0x1b')],_0x2a7bfe);}else{return getUser(_0x15940f,null,_0x2a7bfe);}})[_0x5abd('0x2f')](function(_0x59486c){_0x51dd40=_0x59486c;logger[_0x5abd('0xc')](_0x5abd('0x71'),_0x51dd40['id']);return getEndUser(_0x15940f,_0x28b9d8['calleridname'],_0x28b9d8[_0x5abd('0x72')],_0x2a7bfe);})[_0x5abd('0x2f')](function(_0x2aaa99){_0x4d0bf3=_0x2aaa99;logger[_0x5abd('0xc')](_0x5abd('0x5e'),_0x4d0bf3['id']);return getTicket(_0x15940f,_0x51dd40,_0x4d0bf3,_0x331c5f,_0x28b9d8,_0x331c5f['Fields'],_0x2a7bfe,_0x5abd('0x60'));})['then'](function(_0x19faad){_0x491adb=_0x19faad;logger[_0x5abd('0xc')]('Ticket\x20created!');logger[_0x5abd('0xc')](_0x5abd('0x6c'),_0x491adb['id']);return setRelationship(_0x2a7bfe,_0x51dd40,_0x491adb,_0x5abd('0x6d'));})[_0x5abd('0x2f')](function(){return setRelationship(_0x2a7bfe,_0x4d0bf3,_0x491adb,_0x5abd('0x62'));})['then'](function(){return getServerInfo(_0x2a7bfe);})[_0x5abd('0x67')](function(_0x8dd377){logger[_0x5abd('0x6f')]('[ABANDONED]',JSON[_0x5abd('0x29')](_0x8dd377));});}; \ 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 1eae958..feada90 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 _0x1a28=['keyValue','keyType','string','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','push','type','variableName','customVariable','Variable','name','toLowerCase','toString'];(function(_0xcccec5,_0x28d587){var _0x5d6d3c=function(_0x1d3ce7){while(--_0x1d3ce7){_0xcccec5['push'](_0xcccec5['shift']());}};_0x5d6d3c(++_0x28d587);}(_0x1a28,0xb2));var _0x81a2=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x1a28[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));exports['getString']=function(_0xa59e34,_0x52aa46,_0x5df2fa){var _0x101827=[];if(_0xa59e34[_0x81a2('0x2')]>0x0){var _0x2d00a4=_['sortBy'](_0xa59e34,['id']);for(var _0x55951b=0x0;_0x55951b<_0x2d00a4[_0x81a2('0x2')];_0x55951b++){var _0x204aa4=_0x2d00a4[_0x55951b];if(_0x204aa4['type']==='string'){_0x101827[_0x81a2('0x3')](_0x204aa4['content']);}else if(_0x204aa4[_0x81a2('0x4')]==='variable'&&_0x204aa4[_0x81a2('0x5')]){_0x52aa46[_0x204aa4[_0x81a2('0x5')]]&&_0x101827[_0x81a2('0x3')](_0x52aa46[_0x204aa4[_0x81a2('0x5')]]['toString']());}else if(_0x204aa4[_0x81a2('0x4')]===_0x81a2('0x6')&&_0x204aa4[_0x81a2('0x7')]&&_0x204aa4[_0x81a2('0x7')][_0x81a2('0x8')]){_0x52aa46[_0x204aa4['Variable']['name'][_0x81a2('0x9')]()]&&_0x101827[_0x81a2('0x3')](_0x52aa46[_0x204aa4[_0x81a2('0x7')][_0x81a2('0x8')]['toLowerCase']()][_0x81a2('0xa')]());}else if(_0x204aa4[_0x81a2('0x4')]===_0x81a2('0xb')){if(_0x204aa4[_0x81a2('0xc')]===_0x81a2('0xd')&&_0x204aa4[_0x81a2('0xe')]){_0x101827[_0x81a2('0x3')](util[_0x81a2('0xf')](_0x81a2('0x10'),_0x204aa4[_0x81a2('0xe')],_0x204aa4[_0x81a2('0x11')]));}else if(_0x204aa4[_0x81a2('0xc')]===_0x81a2('0x12')&&_0x204aa4['variableName']&&_0x204aa4[_0x81a2('0xe')]){_0x52aa46[_0x204aa4[_0x81a2('0x5')]]&&_0x101827['push'](util[_0x81a2('0xf')]('%s:\x20%s',_0x204aa4[_0x81a2('0xe')],_0x52aa46[_0x204aa4['variableName']]));}else if(_0x204aa4[_0x81a2('0xc')]==='customVariable'&&_0x204aa4[_0x81a2('0x7')]&&_0x204aa4[_0x81a2('0x7')][_0x81a2('0x8')]&&_0x204aa4[_0x81a2('0xe')]){_0x52aa46[_0x204aa4[_0x81a2('0x7')]['name'][_0x81a2('0x9')]()]&&_0x101827[_0x81a2('0x3')](util[_0x81a2('0xf')](_0x81a2('0x10'),_0x204aa4[_0x81a2('0xe')],_0x52aa46[_0x204aa4[_0x81a2('0x7')][_0x81a2('0x8')][_0x81a2('0x9')]()]));}}}}return _0x101827[_0x81a2('0x13')](_0x5df2fa);};exports[_0x81a2('0x14')]=function(_0x4b6686){var _0x2d7a6c=_0x4b6686[_0x81a2('0x15')](-0x1);if(_0x2d7a6c==='/'){_0x4b6686=_0x4b6686[_0x81a2('0x16')](0x0,_0x4b6686[_0x81a2('0x17')](_0x2d7a6c));}return _0x4b6686;};exports[_0x81a2('0x18')]=function(_0x1b640e){if(!_[_0x81a2('0x19')](_0x1b640e)&&_0x1b640e!==''){var _0x2b117e=/^(([^<>()\[\]\\.,;:\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 _0x2b117e[_0x81a2('0x1a')](String(_0x1b640e)[_0x81a2('0x9')]());}else{return![];}}; \ No newline at end of file +var _0x452b=['customVariable','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','string','%s:\x20%s','key','keyContent','format'];(function(_0x5a4934,_0x462691){var _0x5483d8=function(_0x52ddde){while(--_0x52ddde){_0x5a4934['push'](_0x5a4934['shift']());}};_0x5483d8(++_0x462691);}(_0x452b,0xcc));var _0xb452=function(_0x3130c0,_0x1309a3){_0x3130c0=_0x3130c0-0x0;var _0x5e08e7=_0x452b[_0x3130c0];return _0x5e08e7;};'use strict';var _=require(_0xb452('0x0'));var util=require(_0xb452('0x1'));exports['getString']=function(_0x503796,_0x12cbac,_0x2cb3b0){var _0xfe2a5d=[];if(_0x503796[_0xb452('0x2')]>0x0){var _0x8e15a9=_[_0xb452('0x3')](_0x503796,['id']);for(var _0x25ada2=0x0;_0x25ada2<_0x8e15a9['length'];_0x25ada2++){var _0x2feb66=_0x8e15a9[_0x25ada2];if(_0x2feb66[_0xb452('0x4')]==='string'){_0xfe2a5d[_0xb452('0x5')](_0x2feb66[_0xb452('0x6')]);}else if(_0x2feb66[_0xb452('0x4')]===_0xb452('0x7')&&_0x2feb66[_0xb452('0x8')]){_0x12cbac[_0x2feb66[_0xb452('0x8')]]&&_0xfe2a5d['push'](_0x12cbac[_0x2feb66['variableName']][_0xb452('0x9')]());}else if(_0x2feb66[_0xb452('0x4')]==='customVariable'&&_0x2feb66[_0xb452('0xa')]&&_0x2feb66[_0xb452('0xa')][_0xb452('0xb')]){_0x12cbac[_0x2feb66[_0xb452('0xa')][_0xb452('0xb')][_0xb452('0xc')]()]&&_0xfe2a5d[_0xb452('0x5')](_0x12cbac[_0x2feb66[_0xb452('0xa')][_0xb452('0xb')]['toLowerCase']()][_0xb452('0x9')]());}else if(_0x2feb66[_0xb452('0x4')]===_0xb452('0xd')){if(_0x2feb66[_0xb452('0xe')]===_0xb452('0xf')&&_0x2feb66['key']){_0xfe2a5d['push'](util['format'](_0xb452('0x10'),_0x2feb66[_0xb452('0x11')],_0x2feb66[_0xb452('0x12')]));}else if(_0x2feb66['keyType']==='variable'&&_0x2feb66[_0xb452('0x8')]&&_0x2feb66['key']){_0x12cbac[_0x2feb66[_0xb452('0x8')]]&&_0xfe2a5d[_0xb452('0x5')](util[_0xb452('0x13')](_0xb452('0x10'),_0x2feb66['key'],_0x12cbac[_0x2feb66['variableName']]));}else if(_0x2feb66[_0xb452('0xe')]===_0xb452('0x14')&&_0x2feb66[_0xb452('0xa')]&&_0x2feb66['Variable'][_0xb452('0xb')]&&_0x2feb66['key']){_0x12cbac[_0x2feb66['Variable'][_0xb452('0xb')]['toLowerCase']()]&&_0xfe2a5d[_0xb452('0x5')](util[_0xb452('0x13')](_0xb452('0x10'),_0x2feb66[_0xb452('0x11')],_0x12cbac[_0x2feb66['Variable'][_0xb452('0xb')]['toLowerCase']()]));}}}}return _0xfe2a5d[_0xb452('0x15')](_0x2cb3b0);};exports[_0xb452('0x16')]=function(_0x5215a0){var _0x36c302=_0x5215a0[_0xb452('0x17')](-0x1);if(_0x36c302==='/'){_0x5215a0=_0x5215a0['substring'](0x0,_0x5215a0[_0xb452('0x18')](_0x36c302));}return _0x5215a0;};exports[_0xb452('0x19')]=function(_0x577152){if(!_[_0xb452('0x1a')](_0x577152)&&_0x577152!==''){var _0x5b1fb7=/^(([^<>()\[\]\\.,;:\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 _0x5b1fb7[_0xb452('0x1b')](String(_0x577152)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index ea54244..a6f348e 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 _0x2917=['Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','abandoned','[ABANDONED]','calleridname','The\x20Enduser\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','getString','Subjects','POST','%s/webservice.php','remoteUri','admin','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','Enduser\x20created.','lastname','phone','getEndUser','accessKey','GET','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','Fields'];(function(_0x35ac7a,_0x3db70a){var _0x2be7d8=function(_0x26736a){while(--_0x26736a){_0x35ac7a['push'](_0x35ac7a['shift']());}};_0x2be7d8(++_0x3db70a);}(_0x2917,0x142));var _0x7291=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x2917[_0x4a5f6c];return _0x281ffd;};'use strict';var _=require(_0x7291('0x0'));var rp=require(_0x7291('0x1'));var BPromise=require(_0x7291('0x2'));var md5=require(_0x7291('0x3'));var util=require(_0x7291('0x4'));var Redis=require(_0x7291('0x5'));var intUtil=require(_0x7291('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7291('0x7'));config[_0x7291('0x8')]=_[_0x7291('0x9')](config[_0x7291('0x8')],{'host':_0x7291('0xa'),'port':0x18eb});var io=require(_0x7291('0xb'))(new Redis(config[_0x7291('0x8')]));function emit(_0x1f0fd8,_0x452fc5,_0xb013b3){io['to'](_0x1f0fd8)[_0x7291('0xc')](_0x452fc5,_0xb013b3);}function getCustomFields(_0xdf62dc,_0x27f037){var _0x15298e={};if(_0xdf62dc[_0x7291('0xd')]>0x0){_['forEach'](_0xdf62dc,function(_0x2d67e6){if(_0x2d67e6[_0x7291('0xe')]===_0x7291('0xf')&&_0x2d67e6[_0x7291('0x10')]){_0x15298e[_0x2d67e6[_0x7291('0x10')]]=_0x2d67e6[_0x7291('0x11')]['toString']();}else if(_0x2d67e6['type']===_0x7291('0x12')&&_0x2d67e6[_0x7291('0x13')]&&_0x2d67e6[_0x7291('0x10')]&&_0x27f037[_0x2d67e6[_0x7291('0x13')]]){_0x15298e[_0x2d67e6[_0x7291('0x10')]]=_0x27f037[_0x2d67e6[_0x7291('0x13')]][_0x7291('0x14')]();}else if(_0x2d67e6['type']===_0x7291('0x15')&&_0x2d67e6[_0x7291('0x16')]&&_0x2d67e6[_0x7291('0x16')]['name']&&_0x2d67e6['idField']&&_0x27f037[_0x2d67e6[_0x7291('0x16')][_0x7291('0x17')][_0x7291('0x18')]()]){_0x15298e[_0x2d67e6[_0x7291('0x10')]]=_0x27f037[_0x2d67e6[_0x7291('0x16')][_0x7291('0x17')]['toLowerCase']()][_0x7291('0x14')]();}});}return _0x15298e;}function createTicket(_0x1680d2,_0x9c2228,_0x4264ed,_0x1634c1,_0x4f6fea,_0x365e3c,_0x52d5a7){logger[_0x7291('0x19')](_0x7291('0x1a'));var _0x382134=_['merge']({'parent_id':'','assigned_user_id':_0x9c2228['id'],'ticketpriorities':_0x7291('0x1b'),'ticketstatus':'Open','ticket_title':intUtil[_0x7291('0x1c')](_0x1634c1[_0x7291('0x1d')],_0x4f6fea,'\x20'),'description':intUtil['getString'](_0x1634c1['Descriptions'],_0x4f6fea,'\x0a'),'contact_id':_0x4264ed['id']},getCustomFields(_0x365e3c,_0x4f6fea));var _0x56bf5f={'method':_0x7291('0x1e'),'uri':util['format'](_0x7291('0x1f'),_0x1680d2[_0x7291('0x20')]),'form':{'operation':'create','username':_0x7291('0x21'),'sessionName':_0x52d5a7['sessionName'],'elementType':_0x7291('0x22'),'element':JSON[_0x7291('0x23')](_0x382134)},'json':!![]};return request(_0x56bf5f)['then'](function(_0x3fd6fc){if(_0x3fd6fc[_0x7291('0x24')]){return BPromise[_0x7291('0x25')]({'id':_0x3fd6fc[_0x7291('0x26')]['id']});}else{throw new Error(util[_0x7291('0x27')](_0x7291('0x28'),JSON[_0x7291('0x23')](_0x3fd6fc[_0x7291('0x29')])));}})[_0x7291('0x2a')](function(_0x572880){var _0x35d666=_0x572880[_0x7291('0x2b')]||0x1f4;logger['error'](_0x7291('0x2c'),_0x7291('0x2d'),_0x35d666,JSON['stringify'](_0x572880));});}function getUser(_0x386667,_0x45762f,_0x522ef7){if(intUtil[_0x7291('0x2e')](_0x45762f)){logger[_0x7291('0x19')](_0x7291('0x2f'),_0x45762f);return request({'method':'GET','uri':util[_0x7291('0x27')]('%s/webservice.php',_0x386667['remoteUri']),'qs':{'operation':_0x7291('0x30'),'username':_0x7291('0x21'),'sessionName':_0x522ef7[_0x7291('0x31')],'query':util[_0x7291('0x27')](_0x7291('0x32'),_0x45762f)},'json':!![]})[_0x7291('0x33')](function(_0x438542){if(_0x438542[_0x7291('0x24')]&&_0x438542[_0x7291('0x26')][_0x7291('0xd')]){logger[_0x7291('0x19')](_0x7291('0x34'));return BPromise[_0x7291('0x25')]({'id':_0x438542['result'][0x0]['id'],'email':_0x438542[_0x7291('0x26')][0x0]['email1'],'name':_0x438542['result'][0x0]['first_name']+'\x20'+_0x438542[_0x7291('0x26')][_0x7291('0x35')]});}else{logger[_0x7291('0x19')](_0x7291('0x36'));return BPromise[_0x7291('0x25')]({'id':_0x522ef7['userId'],'email':_0x386667[_0x7291('0x37')],'name':_0x7291('0x21')});}})['catch'](function(_0x42058e){var _0x193b6b=_0x42058e[_0x7291('0x2b')]||0x1f4;logger[_0x7291('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x193b6b,JSON[_0x7291('0x23')](_0x42058e));});}else{logger[_0x7291('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x522ef7[_0x7291('0x38')],'email':_0x386667[_0x7291('0x37')],'name':_0x7291('0x21')})[_0x7291('0x2a')](function(_0x255484){var _0x51cc38=_0x255484['statusCode']||0x1f4;logger[_0x7291('0x29')](_0x7291('0x2c'),_0x7291('0x39'),_0x51cc38,JSON[_0x7291('0x23')](_0x255484));});}}function getEndUser(_0x1103d2,_0x4c6faf,_0x41e04f,_0x595675){logger[_0x7291('0x19')](_0x7291('0x3a'),_0x41e04f);return request({'method':'GET','uri':util['format'](_0x7291('0x1f'),_0x1103d2[_0x7291('0x20')]),'qs':{'operation':_0x7291('0x30'),'username':_0x7291('0x21'),'sessionName':_0x595675[_0x7291('0x31')],'query':util[_0x7291('0x27')](_0x7291('0x3b'),_0x41e04f,_0x41e04f,_0x41e04f,_0x41e04f,_0x41e04f)},'json':!![]})[_0x7291('0x33')](function(_0x301ed6){if(_0x301ed6[_0x7291('0x24')]&&_0x301ed6[_0x7291('0x26')][_0x7291('0xd')]){logger['info'](_0x7291('0x3c'));return BPromise[_0x7291('0x25')]({'id':_0x301ed6[_0x7291('0x26')][0x0]['id'],'name':_0x301ed6[_0x7291('0x26')][0x0][_0x7291('0x3d')]+'\x20'+_0x301ed6[_0x7291('0x26')][0x0]['lastname'],'phone':_0x41e04f});}else{logger[_0x7291('0x19')](_0x7291('0x3e'));return request({'method':_0x7291('0x1e'),'uri':util[_0x7291('0x27')]('%s/webservice.php',_0x1103d2[_0x7291('0x20')]),'form':{'operation':_0x7291('0x3f'),'sessionName':_0x595675[_0x7291('0x31')],'elementType':_0x7291('0x40'),'element':JSON[_0x7291('0x23')]({'lastname':_0x4c6faf,'phone':_0x41e04f,'assigned_user_id':'\x20'})},'json':!![]})[_0x7291('0x33')](function(_0x3c976a){logger[_0x7291('0x19')](_0x7291('0x41'));return BPromise['resolve']({'id':_0x3c976a[_0x7291('0x26')]['id'],'name':_0x3c976a['result'][_0x7291('0x42')],'phone':_0x3c976a[_0x7291('0x26')][_0x7291('0x43')]});})[_0x7291('0x2a')](function(_0x142e5e){var _0x1d88e9=_0x142e5e[_0x7291('0x2b')]||0x1f4;logger[_0x7291('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x7291('0x44'),_0x1d88e9,JSON[_0x7291('0x23')](_0x142e5e));});}});}function getConnection(_0x228de8){var _0x1bcd17=_0x228de8[_0x7291('0x37')];var _0xc9e37e=_0x228de8[_0x7291('0x45')];return request({'method':_0x7291('0x46'),'uri':util[_0x7291('0x27')](_0x7291('0x1f'),_0x228de8[_0x7291('0x20')]),'qs':{'operation':_0x7291('0x47'),'username':_0x1bcd17},'json':!![]})[_0x7291('0x33')](function(_0x165576){if(_0x165576[_0x7291('0x24')]){return request({'method':_0x7291('0x1e'),'uri':util['format'](_0x7291('0x1f'),_0x228de8[_0x7291('0x20')]),'form':{'operation':'login','username':_0x7291('0x21'),'accessKey':md5(_0x165576[_0x7291('0x26')][_0x7291('0x48')]+_0xc9e37e)},'json':!![]});}})['then'](function(_0x4f7540){if(_0x4f7540[_0x7291('0x24')]){return BPromise['resolve'](_0x4f7540['result']);}else{throw new Error(util[_0x7291('0x27')](_0x7291('0x49'),_0x228de8['id']));}})[_0x7291('0x2a')](function(_0x567f63){var _0x2379cd=_0x567f63[_0x7291('0x2b')]||0x1f4;logger[_0x7291('0x29')](_0x7291('0x2c'),'getConnection',_0x2379cd,JSON[_0x7291('0x23')](_0x567f63));});}function request(_0x55580f){logger[_0x7291('0x19')](_0x7291('0x4a'),JSON[_0x7291('0x23')](_0x55580f));return rp(_0x55580f);}exports[_0x7291('0x4b')]=function(_0x1b93b9,_0x3cb537,_0xb2abe7,_0x21392c,_0x2f4165,_0x187143){var _0x4e1624,_0x42121a,_0x28197f,_0x5c17fc;_0x187143[_0x7291('0x20')]=intUtil[_0x7291('0x4c')](_0x187143['remoteUri']);if(_0x2f4165&&_0x2f4165['monitor_format']){logger[_0x7291('0x19')]('[QUEUE]',_0x7291('0x4d'));_0x3cb537[_0x7291('0x4e')]=util['format'](_0x7291('0x4f'),_0x187143[_0x7291('0x50')],_0x3cb537[_0x7291('0x51')],md5(_0x3cb537[_0x7291('0x51')]));}else{_0x3cb537['recordingURL']='';}return getConnection(_0x187143)['then'](function(_0x47c488){_0x5c17fc=_0x47c488;return getUser(_0x187143,_0x21392c[_0x7291('0x52')],_0x5c17fc);})[_0x7291('0x33')](function(_0x3379a1){_0x4e1624=_0x3379a1;logger[_0x7291('0x19')](_0x7291('0x53'),_0x4e1624['id']);return getEndUser(_0x187143,_0x3cb537['calleridname'],_0x3cb537[_0x7291('0x54')],_0x5c17fc);})[_0x7291('0x33')](function(_0x33f742){_0x42121a=_0x33f742;logger[_0x7291('0x19')]('The\x20Enduser\x20ID\x20is:',_0x42121a['id']);return createTicket(_0x187143,_0x4e1624,_0x42121a,_0xb2abe7,_0x3cb537,_0xb2abe7[_0x7291('0x55')],_0x5c17fc);})[_0x7291('0x33')](function(_0x2e56cb){_0x28197f=_0x2e56cb;logger['info'](_0x7291('0x56'));logger[_0x7291('0x19')]('The\x20Ticket\x20ID\x20is:',_0x28197f['id']);var _0xa1f1f9=util[_0x7291('0x27')](_0x7291('0x57'),_0x187143[_0x7291('0x20')],_[_0x7291('0x58')](_0x28197f['id'],'x')[0x1]);logger['info'](_0x7291('0x59'),_0x7291('0x5a'));emit(util['format'](_0x7291('0x5b'),_0x21392c[_0x7291('0x17')]),_0x7291('0x5c'),{'uri':_0xa1f1f9});})[_0x7291('0x2a')](function(_0x351d71){logger[_0x7291('0x29')](_0x7291('0x59'),JSON['stringify'](_0x351d71));});};exports[_0x7291('0x5d')]=function(_0x1cac3e,_0x4f8320,_0x595cb0,_0xf28521,_0x1a6ac1,_0x1de55c,_0x1bca69){var _0x23e2f5,_0x2ee706,_0xb921b0,_0x53b8b8;_0x1de55c[_0x7291('0x20')]=intUtil[_0x7291('0x4c')](_0x1de55c[_0x7291('0x20')]);_0x1de55c['serverUrl']=intUtil[_0x7291('0x4c')](_0x1de55c[_0x7291('0x50')]);if(_0x1bca69&&_0x1bca69[_0x7291('0x5e')]&&_0x1bca69[_0x7291('0x5e')]!=='none'){logger[_0x7291('0x19')](_0x7291('0x5f'),'Recording\x20is\x20enabled!');_0x4f8320[_0x7291('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1de55c[_0x7291('0x50')],_0x4f8320[_0x7291('0x51')],md5(_0x4f8320[_0x7291('0x51')]));}return getConnection(_0x1de55c)[_0x7291('0x33')](function(_0x4af4f8){_0x53b8b8=_0x4af4f8;return getUser(_0x1de55c,_0xf28521[_0x7291('0x52')],_0x53b8b8);})[_0x7291('0x33')](function(_0x11cd35){_0x23e2f5=_0x11cd35;logger[_0x7291('0x19')](_0x7291('0x53'),_0x23e2f5['id']);return getEndUser(_0x1de55c,_0x4f8320[_0x7291('0x60')],_0x4f8320['destcalleridnum'],_0x53b8b8);})['then'](function(_0x46beac){_0x2ee706=_0x46beac;logger[_0x7291('0x19')]('The\x20Enduser\x20ID\x20is:',_0x2ee706['id']);return createTicket(_0x1de55c,_0x23e2f5,_0x2ee706,_0x595cb0,_0x4f8320,_0x595cb0[_0x7291('0x55')],_0x53b8b8);})[_0x7291('0x33')](function(_0x56af00){_0xb921b0=_0x56af00;logger[_0x7291('0x19')](_0x7291('0x56'));logger['info'](_0x7291('0x61'),_0xb921b0['id']);var _0x2f2a40=util[_0x7291('0x27')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1de55c[_0x7291('0x20')],_[_0x7291('0x58')](_0xb921b0['id'],'x')[0x1]);logger[_0x7291('0x19')](_0x7291('0x5f'),_0x7291('0x5a'));emit(util[_0x7291('0x27')]('user:%s',_0xf28521['name']),_0x7291('0x5c'),{'uri':_0x2f2a40});})[_0x7291('0x2a')](function(_0x309485){logger[_0x7291('0x29')](_0x7291('0x5f'),JSON[_0x7291('0x23')](_0x309485));});};exports[_0x7291('0x62')]=function(_0x412f6c,_0x493136,_0x2b7046,_0x3fd6c6,_0x42e20b,_0x57346d){var _0x2e31ef,_0x52ac94,_0x53ed59,_0x1bcab3;_0x57346d[_0x7291('0x20')]=intUtil[_0x7291('0x4c')](_0x57346d[_0x7291('0x20')]);_0x57346d[_0x7291('0x50')]=intUtil[_0x7291('0x4c')](_0x57346d[_0x7291('0x50')]);if(_0x42e20b&&_0x42e20b['monitor_format']){logger[_0x7291('0x19')](_0x7291('0x63'),_0x7291('0x4d'));_0x493136[_0x7291('0x4e')]=util[_0x7291('0x27')](_0x7291('0x4f'),_0x57346d[_0x7291('0x50')],_0x493136[_0x7291('0x51')],md5(_0x493136['uniqueid']));}else{_0x493136[_0x7291('0x4e')]='';}return getConnection(_0x57346d)[_0x7291('0x33')](function(_0x2ced90){_0x1bcab3=_0x2ced90;return getUser(_0x57346d,'',_0x1bcab3);})[_0x7291('0x33')](function(_0x211161){_0x2e31ef=_0x211161;logger[_0x7291('0x19')](_0x7291('0x53'),_0x2e31ef['id']);return getEndUser(_0x57346d,_0x493136[_0x7291('0x64')],_0x493136[_0x7291('0x54')],_0x1bcab3);})[_0x7291('0x33')](function(_0x2ef165){_0x52ac94=_0x2ef165;logger['info'](_0x7291('0x65'),_0x52ac94['id']);return createTicket(_0x57346d,_0x2e31ef,_0x52ac94,_0x2b7046,_0x493136,_0x2b7046[_0x7291('0x55')],_0x1bcab3);})[_0x7291('0x33')](function(_0x79479a){_0x53ed59=_0x79479a;logger[_0x7291('0x19')](_0x7291('0x56'));logger[_0x7291('0x19')](_0x7291('0x61'),_0x53ed59['id']);})[_0x7291('0x2a')](function(_0x5933b2){logger[_0x7291('0x29')](_0x7291('0x63'),JSON[_0x7291('0x23')](_0x5933b2));});}; \ No newline at end of file +var _0x0fec=['stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','GET','%s/webservice.php','remoteUri','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','resolve','userId','catch','getUser','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','Searching\x20end\x20user\x20with\x20phone','query','Enduser\x20found!','lastname','Contacts','then','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','email','destcalleridnum','Fields','abandoned','[ABANDONED]','The\x20User\x20ID\x20is:','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','emit','length','string','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','getString','Subjects','Descriptions','POST','format','create','admin','sessionName'];(function(_0x37b590,_0x31caaf){var _0x39a999=function(_0x977d67){while(--_0x977d67){_0x37b590['push'](_0x37b590['shift']());}};_0x39a999(++_0x31caaf);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x578081,_0x48fdf2){_0x578081=_0x578081-0x0;var _0xba77b8=_0x0fec[_0x578081];return _0xba77b8;};'use strict';var _=require(_0xc0fe('0x0'));var rp=require(_0xc0fe('0x1'));var BPromise=require(_0xc0fe('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xc0fe('0x3'));var intUtil=require('./util');var config=require(_0xc0fe('0x4'));var logger=require(_0xc0fe('0x5'))('vTiger');config[_0xc0fe('0x6')]=_['defaults'](config[_0xc0fe('0x6')],{'host':_0xc0fe('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5b3f5a,_0x326ab7,_0x2cd914){io['to'](_0x5b3f5a)[_0xc0fe('0x8')](_0x326ab7,_0x2cd914);}function getCustomFields(_0x4e8d11,_0x5e33c4){var _0x545ee7={};if(_0x4e8d11[_0xc0fe('0x9')]>0x0){_['forEach'](_0x4e8d11,function(_0x3844d8){if(_0x3844d8['type']===_0xc0fe('0xa')&&_0x3844d8[_0xc0fe('0xb')]){_0x545ee7[_0x3844d8[_0xc0fe('0xb')]]=_0x3844d8[_0xc0fe('0xc')][_0xc0fe('0xd')]();}else if(_0x3844d8[_0xc0fe('0xe')]==='variable'&&_0x3844d8[_0xc0fe('0xf')]&&_0x3844d8[_0xc0fe('0xb')]&&_0x5e33c4[_0x3844d8['variableName']]){_0x545ee7[_0x3844d8['idField']]=_0x5e33c4[_0x3844d8['variableName']][_0xc0fe('0xd')]();}else if(_0x3844d8[_0xc0fe('0xe')]===_0xc0fe('0x10')&&_0x3844d8['Variable']&&_0x3844d8[_0xc0fe('0x11')][_0xc0fe('0x12')]&&_0x3844d8['idField']&&_0x5e33c4[_0x3844d8['Variable'][_0xc0fe('0x12')][_0xc0fe('0x13')]()]){_0x545ee7[_0x3844d8[_0xc0fe('0xb')]]=_0x5e33c4[_0x3844d8[_0xc0fe('0x11')][_0xc0fe('0x12')][_0xc0fe('0x13')]()][_0xc0fe('0xd')]();}});}return _0x545ee7;}function createTicket(_0x15fe4b,_0x4d1dd3,_0x42b841,_0x2e52aa,_0x18f483,_0x2e5bf3,_0x17504f){logger[_0xc0fe('0x14')](_0xc0fe('0x15'));var _0x402127=_['merge']({'parent_id':'','assigned_user_id':_0x4d1dd3['id'],'ticketpriorities':_0xc0fe('0x16'),'ticketstatus':_0xc0fe('0x17'),'ticket_title':intUtil[_0xc0fe('0x18')](_0x2e52aa[_0xc0fe('0x19')],_0x18f483,'\x20'),'description':intUtil[_0xc0fe('0x18')](_0x2e52aa[_0xc0fe('0x1a')],_0x18f483,'\x0a'),'contact_id':_0x42b841['id']},getCustomFields(_0x2e5bf3,_0x18f483));var _0x44fb50={'method':_0xc0fe('0x1b'),'uri':util[_0xc0fe('0x1c')]('%s/webservice.php',_0x15fe4b['remoteUri']),'form':{'operation':_0xc0fe('0x1d'),'username':_0xc0fe('0x1e'),'sessionName':_0x17504f[_0xc0fe('0x1f')],'elementType':'HelpDesk','element':JSON[_0xc0fe('0x20')](_0x402127)},'json':!![]};return request(_0x44fb50)['then'](function(_0x29b349){if(_0x29b349[_0xc0fe('0x21')]){return BPromise['resolve']({'id':_0x29b349[_0xc0fe('0x22')]['id']});}else{throw new Error(util['format'](_0xc0fe('0x23'),JSON[_0xc0fe('0x20')](_0x29b349[_0xc0fe('0x24')])));}})['catch'](function(_0x325bbf){var _0x5a6f96=_0x325bbf[_0xc0fe('0x25')]||0x1f4;logger[_0xc0fe('0x24')](_0xc0fe('0x26'),_0xc0fe('0x27'),_0x5a6f96,JSON['stringify'](_0x325bbf));});}function getUser(_0x2d17cd,_0x406f25,_0x413dbf){if(intUtil['validateEmail'](_0x406f25)){logger['info']('Getting\x20agent\x20with\x20email',_0x406f25);return request({'method':_0xc0fe('0x28'),'uri':util['format'](_0xc0fe('0x29'),_0x2d17cd[_0xc0fe('0x2a')]),'qs':{'operation':'query','username':_0xc0fe('0x1e'),'sessionName':_0x413dbf['sessionName'],'query':util[_0xc0fe('0x1c')](_0xc0fe('0x2b'),_0x406f25)},'json':!![]})['then'](function(_0x13b856){if(_0x13b856[_0xc0fe('0x21')]&&_0x13b856[_0xc0fe('0x22')][_0xc0fe('0x9')]){logger[_0xc0fe('0x14')](_0xc0fe('0x2c'));return BPromise['resolve']({'id':_0x13b856['result'][0x0]['id'],'email':_0x13b856[_0xc0fe('0x22')][0x0][_0xc0fe('0x2d')],'name':_0x13b856[_0xc0fe('0x22')][0x0][_0xc0fe('0x2e')]+'\x20'+_0x13b856[_0xc0fe('0x22')][_0xc0fe('0x2f')]});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc0fe('0x30')]({'id':_0x413dbf[_0xc0fe('0x31')],'email':_0x2d17cd['username'],'name':_0xc0fe('0x1e')});}})[_0xc0fe('0x32')](function(_0x50d51d){var _0x27e1c0=_0x50d51d[_0xc0fe('0x25')]||0x1f4;logger[_0xc0fe('0x24')](_0xc0fe('0x26'),_0xc0fe('0x33'),_0x27e1c0,JSON[_0xc0fe('0x20')](_0x50d51d));});}else{logger[_0xc0fe('0x14')](_0xc0fe('0x34'));return BPromise[_0xc0fe('0x30')]({'id':_0x413dbf[_0xc0fe('0x31')],'email':_0x2d17cd[_0xc0fe('0x35')],'name':_0xc0fe('0x1e')})[_0xc0fe('0x32')](function(_0x4f2c45){var _0x2d71b7=_0x4f2c45[_0xc0fe('0x25')]||0x1f4;logger[_0xc0fe('0x24')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xc0fe('0x33'),_0x2d71b7,JSON[_0xc0fe('0x20')](_0x4f2c45));});}}function getEndUser(_0x37e513,_0x46c087,_0xe435e6,_0x4117fe){logger[_0xc0fe('0x14')](_0xc0fe('0x36'),_0xe435e6);return request({'method':_0xc0fe('0x28'),'uri':util[_0xc0fe('0x1c')](_0xc0fe('0x29'),_0x37e513[_0xc0fe('0x2a')]),'qs':{'operation':_0xc0fe('0x37'),'username':'admin','sessionName':_0x4117fe['sessionName'],'query':util['format']('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;',_0xe435e6,_0xe435e6,_0xe435e6,_0xe435e6,_0xe435e6)},'json':!![]})['then'](function(_0x84ba95){if(_0x84ba95[_0xc0fe('0x21')]&&_0x84ba95[_0xc0fe('0x22')]['length']){logger[_0xc0fe('0x14')](_0xc0fe('0x38'));return BPromise[_0xc0fe('0x30')]({'id':_0x84ba95[_0xc0fe('0x22')][0x0]['id'],'name':_0x84ba95[_0xc0fe('0x22')][0x0]['firstname']+'\x20'+_0x84ba95[_0xc0fe('0x22')][0x0][_0xc0fe('0x39')],'phone':_0xe435e6});}else{logger[_0xc0fe('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util[_0xc0fe('0x1c')](_0xc0fe('0x29'),_0x37e513[_0xc0fe('0x2a')]),'form':{'operation':_0xc0fe('0x1d'),'sessionName':_0x4117fe[_0xc0fe('0x1f')],'elementType':_0xc0fe('0x3a'),'element':JSON['stringify']({'lastname':_0x46c087,'phone':_0xe435e6,'assigned_user_id':'\x20'})},'json':!![]})[_0xc0fe('0x3b')](function(_0x3f43ee){logger[_0xc0fe('0x14')](_0xc0fe('0x3c'));return BPromise[_0xc0fe('0x30')]({'id':_0x3f43ee[_0xc0fe('0x22')]['id'],'name':_0x3f43ee[_0xc0fe('0x22')][_0xc0fe('0x39')],'phone':_0x3f43ee[_0xc0fe('0x22')][_0xc0fe('0x3d')]});})[_0xc0fe('0x32')](function(_0x3f6d8f){var _0x446a6d=_0x3f6d8f[_0xc0fe('0x25')]||0x1f4;logger['error'](_0xc0fe('0x26'),_0xc0fe('0x3e'),_0x446a6d,JSON[_0xc0fe('0x20')](_0x3f6d8f));});}});}function getConnection(_0xa67f4a){var _0x4a7468=_0xa67f4a[_0xc0fe('0x35')];var _0x579306=_0xa67f4a[_0xc0fe('0x3f')];return request({'method':'GET','uri':util[_0xc0fe('0x1c')](_0xc0fe('0x29'),_0xa67f4a['remoteUri']),'qs':{'operation':_0xc0fe('0x40'),'username':_0x4a7468},'json':!![]})[_0xc0fe('0x3b')](function(_0x499faf){if(_0x499faf[_0xc0fe('0x21')]){return request({'method':'POST','uri':util[_0xc0fe('0x1c')](_0xc0fe('0x29'),_0xa67f4a['remoteUri']),'form':{'operation':_0xc0fe('0x41'),'username':'admin','accessKey':md5(_0x499faf[_0xc0fe('0x22')][_0xc0fe('0x42')]+_0x579306)},'json':!![]});}})['then'](function(_0x2fe67c){if(_0x2fe67c['success']){return BPromise[_0xc0fe('0x30')](_0x2fe67c[_0xc0fe('0x22')]);}else{throw new Error(util[_0xc0fe('0x1c')]('Account\x20%d\x20is\x20not\x20valid',_0xa67f4a['id']));}})['catch'](function(_0x4a4dc0){var _0x1a132a=_0x4a4dc0[_0xc0fe('0x25')]||0x1f4;logger[_0xc0fe('0x24')](_0xc0fe('0x26'),_0xc0fe('0x43'),_0x1a132a,JSON[_0xc0fe('0x20')](_0x4a4dc0));});}function request(_0x1c033a){logger['info'](_0xc0fe('0x44'),JSON['stringify'](_0x1c033a));return rp(_0x1c033a);}exports[_0xc0fe('0x45')]=function(_0x3cfad7,_0x1704e1,_0x74c5b8,_0x411ab7,_0x1a68d0,_0x78495d){var _0x446c1e,_0x5ebbb9,_0x22217a,_0x4bbdb5;_0x78495d['remoteUri']=intUtil[_0xc0fe('0x46')](_0x78495d[_0xc0fe('0x2a')]);if(_0x1a68d0&&_0x1a68d0[_0xc0fe('0x47')]){logger[_0xc0fe('0x14')](_0xc0fe('0x48'),_0xc0fe('0x49'));_0x1704e1[_0xc0fe('0x4a')]=util['format'](_0xc0fe('0x4b'),_0x78495d['serverUrl'],_0x1704e1[_0xc0fe('0x4c')],md5(_0x1704e1[_0xc0fe('0x4c')]));}else{_0x1704e1[_0xc0fe('0x4a')]='';}return getConnection(_0x78495d)['then'](function(_0x5504d3){_0x4bbdb5=_0x5504d3;return getUser(_0x78495d,_0x411ab7['email'],_0x4bbdb5);})[_0xc0fe('0x3b')](function(_0x440a4e){_0x446c1e=_0x440a4e;logger[_0xc0fe('0x14')]('The\x20User\x20ID\x20is:',_0x446c1e['id']);return getEndUser(_0x78495d,_0x1704e1[_0xc0fe('0x4d')],_0x1704e1[_0xc0fe('0x4e')],_0x4bbdb5);})[_0xc0fe('0x3b')](function(_0x10b0c4){_0x5ebbb9=_0x10b0c4;logger['info'](_0xc0fe('0x4f'),_0x5ebbb9['id']);return createTicket(_0x78495d,_0x446c1e,_0x5ebbb9,_0x74c5b8,_0x1704e1,_0x74c5b8['Fields'],_0x4bbdb5);})[_0xc0fe('0x3b')](function(_0x5d0575){_0x22217a=_0x5d0575;logger[_0xc0fe('0x14')](_0xc0fe('0x50'));logger[_0xc0fe('0x14')](_0xc0fe('0x51'),_0x22217a['id']);var _0x404ca1=util[_0xc0fe('0x1c')](_0xc0fe('0x52'),_0x78495d[_0xc0fe('0x2a')],_[_0xc0fe('0x53')](_0x22217a['id'],'x')[0x1]);logger[_0xc0fe('0x14')](_0xc0fe('0x48'),_0xc0fe('0x54'));emit(util[_0xc0fe('0x1c')](_0xc0fe('0x55'),_0x411ab7[_0xc0fe('0x12')]),_0xc0fe('0x56'),{'uri':_0x404ca1});})[_0xc0fe('0x32')](function(_0x21c0c0){logger[_0xc0fe('0x24')](_0xc0fe('0x48'),JSON[_0xc0fe('0x20')](_0x21c0c0));});};exports[_0xc0fe('0x57')]=function(_0x1d8995,_0x4ad793,_0x49abe3,_0x2f637f,_0x46d861,_0x1a9249,_0x89e023){var _0x4819ee,_0x2f441b,_0x1c5be5,_0x5a1cdb;_0x1a9249[_0xc0fe('0x2a')]=intUtil[_0xc0fe('0x46')](_0x1a9249[_0xc0fe('0x2a')]);_0x1a9249[_0xc0fe('0x58')]=intUtil['stripTrailingSlash'](_0x1a9249[_0xc0fe('0x58')]);if(_0x89e023&&_0x89e023[_0xc0fe('0x59')]&&_0x89e023['recordingFormat']!==_0xc0fe('0x5a')){logger[_0xc0fe('0x14')](_0xc0fe('0x5b'),_0xc0fe('0x49'));_0x4ad793[_0xc0fe('0x4a')]=util[_0xc0fe('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a9249[_0xc0fe('0x58')],_0x4ad793[_0xc0fe('0x4c')],md5(_0x4ad793[_0xc0fe('0x4c')]));}return getConnection(_0x1a9249)[_0xc0fe('0x3b')](function(_0x57323b){_0x5a1cdb=_0x57323b;return getUser(_0x1a9249,_0x2f637f[_0xc0fe('0x5c')],_0x5a1cdb);})['then'](function(_0x1ea5c5){_0x4819ee=_0x1ea5c5;logger[_0xc0fe('0x14')]('The\x20User\x20ID\x20is:',_0x4819ee['id']);return getEndUser(_0x1a9249,_0x4ad793['destcalleridname'],_0x4ad793[_0xc0fe('0x5d')],_0x5a1cdb);})[_0xc0fe('0x3b')](function(_0x2a437b){_0x2f441b=_0x2a437b;logger[_0xc0fe('0x14')]('The\x20Enduser\x20ID\x20is:',_0x2f441b['id']);return createTicket(_0x1a9249,_0x4819ee,_0x2f441b,_0x49abe3,_0x4ad793,_0x49abe3[_0xc0fe('0x5e')],_0x5a1cdb);})['then'](function(_0x52e16){_0x1c5be5=_0x52e16;logger[_0xc0fe('0x14')]('Ticket\x20created!');logger[_0xc0fe('0x14')](_0xc0fe('0x51'),_0x1c5be5['id']);var _0x569c33=util[_0xc0fe('0x1c')](_0xc0fe('0x52'),_0x1a9249[_0xc0fe('0x2a')],_[_0xc0fe('0x53')](_0x1c5be5['id'],'x')[0x1]);logger['info'](_0xc0fe('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc0fe('0x1c')](_0xc0fe('0x55'),_0x2f637f[_0xc0fe('0x12')]),'trigger:browser:url',{'uri':_0x569c33});})[_0xc0fe('0x32')](function(_0x52d624){logger[_0xc0fe('0x24')](_0xc0fe('0x5b'),JSON[_0xc0fe('0x20')](_0x52d624));});};exports[_0xc0fe('0x5f')]=function(_0x465ab6,_0x48e554,_0x18816a,_0x5aea9a,_0x2c5adb,_0x21fab4){var _0x2f9d45,_0x1c9d16,_0x56822b,_0x267e99;_0x21fab4['remoteUri']=intUtil[_0xc0fe('0x46')](_0x21fab4['remoteUri']);_0x21fab4['serverUrl']=intUtil[_0xc0fe('0x46')](_0x21fab4[_0xc0fe('0x58')]);if(_0x2c5adb&&_0x2c5adb[_0xc0fe('0x47')]){logger[_0xc0fe('0x14')](_0xc0fe('0x60'),'Recording\x20is\x20enabled!');_0x48e554[_0xc0fe('0x4a')]=util[_0xc0fe('0x1c')](_0xc0fe('0x4b'),_0x21fab4['serverUrl'],_0x48e554['uniqueid'],md5(_0x48e554[_0xc0fe('0x4c')]));}else{_0x48e554[_0xc0fe('0x4a')]='';}return getConnection(_0x21fab4)['then'](function(_0x3d4b3d){_0x267e99=_0x3d4b3d;return getUser(_0x21fab4,'',_0x267e99);})['then'](function(_0x145bbd){_0x2f9d45=_0x145bbd;logger[_0xc0fe('0x14')](_0xc0fe('0x61'),_0x2f9d45['id']);return getEndUser(_0x21fab4,_0x48e554[_0xc0fe('0x4d')],_0x48e554[_0xc0fe('0x4e')],_0x267e99);})['then'](function(_0x134902){_0x1c9d16=_0x134902;logger[_0xc0fe('0x14')](_0xc0fe('0x4f'),_0x1c9d16['id']);return createTicket(_0x21fab4,_0x2f9d45,_0x1c9d16,_0x18816a,_0x48e554,_0x18816a[_0xc0fe('0x5e')],_0x267e99);})[_0xc0fe('0x3b')](function(_0x415e46){_0x56822b=_0x415e46;logger['info'](_0xc0fe('0x50'));logger[_0xc0fe('0x14')](_0xc0fe('0x51'),_0x56822b['id']);})[_0xc0fe('0x32')](function(_0x4887fb){logger[_0xc0fe('0x24')](_0xc0fe('0x60'),JSON[_0xc0fe('0x20')](_0x4887fb));});}; \ 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 8892c5b..dd10a4e 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 _0xff27=['Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','end-user','authType','password','%s:%s','token','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','custom_fields','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','monitor_format','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','Subjects','getString'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xff27,0x11d));var _0x7ff2=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0xff27[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x7ff2('0x0'));var rp=require(_0x7ff2('0x1'));var md5=require(_0x7ff2('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x7ff2('0x3'));var config=require(_0x7ff2('0x4'));var logger=require('../../../../config/logger')(_0x7ff2('0x5'));config[_0x7ff2('0x6')]=_['defaults'](config[_0x7ff2('0x6')],{'host':_0x7ff2('0x7'),'port':0x18eb});var io=require(_0x7ff2('0x8'))(new Redis(config[_0x7ff2('0x6')]));function emit(_0x9b6b5f,_0x405acd,_0x1c33cb){io['to'](_0x9b6b5f)[_0x7ff2('0x9')](_0x405acd,_0x1c33cb);}var headers={'Content-Type':_0x7ff2('0xa'),'Accept':_0x7ff2('0xa')};function getTicket(_0x19d0b7,_0x464474,_0x2a6a3b,_0x769f56,_0x329481){logger[_0x7ff2('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0xd'),_0x19d0b7[_0x7ff2('0xe')]),'method':_0x7ff2('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x2a6a3b['id'],'submitter_id':_0x464474?_0x464474['id']:undefined,'assignee_id':_0x464474?_0x464474['id']:undefined,'tags':getTags(_0x769f56['Tags'],'name'),'subject':intUtil['getString'](_0x769f56[_0x7ff2('0x10')],_0x329481,'\x20'),'description':intUtil[_0x7ff2('0x11')](_0x769f56['Descriptions'],_0x329481,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7ff2('0x11')](_0x769f56[_0x7ff2('0x12')],_0x329481,'\x0a')}},getCustomFields(_0x769f56['Fields'],_0x329481))}})[_0x7ff2('0x13')](function(_0x55c177){logger[_0x7ff2('0xb')](_0x7ff2('0x14'));return _0x55c177[_0x7ff2('0x15')];});}function getUser(_0x9a7e64,_0x2a9fdd){if(intUtil['validateEmail'](_0x2a9fdd)){logger[_0x7ff2('0xb')](_0x7ff2('0x16'),_0x2a9fdd);return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0x17'),_0x9a7e64[_0x7ff2('0xe')]),'qs':{'query':util['format'](_0x7ff2('0x18'),_0x2a9fdd)}})[_0x7ff2('0x13')](function(_0x284717){if(_0x284717[_0x7ff2('0x19')]){logger['info'](_0x7ff2('0x1a'));return _['find'](_0x284717[_0x7ff2('0x1b')],{'email':_0x2a9fdd,'role':_0x7ff2('0x1c')});}else{logger['info'](_0x7ff2('0x1d'));return request({'uri':util['format'](_0x7ff2('0x1e'),_0x9a7e64['remoteUri'])})[_0x7ff2('0x13')](function(_0x46453c){logger['info'](_0x7ff2('0x1f'));return _0x46453c['user'];});}});}else{logger['info'](_0x7ff2('0x1d'));return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0x1e'),_0x9a7e64[_0x7ff2('0xe')])})['then'](function(_0x42bdef){logger[_0x7ff2('0xb')](_0x7ff2('0x1f'));return _0x42bdef[_0x7ff2('0x20')];});}}function getEndUser(_0x16f862,_0x485470,_0x34974c){logger[_0x7ff2('0xb')](_0x7ff2('0x21'),_0x34974c);return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0x17'),_0x16f862[_0x7ff2('0xe')]),'qs':{'query':util[_0x7ff2('0xc')](_0x7ff2('0x22'),_0x34974c)}})[_0x7ff2('0x13')](function(_0x57fd58){var _0x25f46a;if(_0x57fd58[_0x7ff2('0x1b')][_0x7ff2('0x23')]){_0x57fd58[_0x7ff2('0x1b')]=_[_0x7ff2('0x24')](_0x57fd58[_0x7ff2('0x1b')],{'suspended':![],'role':'end-user'});if(_0x57fd58['results'][_0x7ff2('0x23')]){_0x25f46a=_[_0x7ff2('0x25')](_0x57fd58[_0x7ff2('0x1b')]);}}if(_0x25f46a){logger['info']('Enduser\x20found!');return _0x25f46a;}else{logger[_0x7ff2('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7ff2('0xc')]('%s/users.json',_0x16f862[_0x7ff2('0xe')]),'method':_0x7ff2('0xf'),'body':{'user':{'role':_0x7ff2('0x26'),'name':util[_0x7ff2('0xc')]('Caller\x20-\x20%s',_0x485470||_0x34974c),'phone':_0x34974c}}})[_0x7ff2('0x13')](function(_0x2fcae1){logger[_0x7ff2('0xb')]('Enduser\x20created.');return _0x2fcae1[_0x7ff2('0x20')];});}});}function getAuth(_0x2f7a68){var _0x5c782b;if(_0x2f7a68[_0x7ff2('0x27')]===_0x7ff2('0x28')){_0x5c782b=util[_0x7ff2('0xc')](_0x7ff2('0x29'),_0x2f7a68['username'],_0x2f7a68[_0x7ff2('0x28')]);}else if(_0x2f7a68[_0x7ff2('0x27')]===_0x7ff2('0x2a')){_0x5c782b=util['format']('%s/token:%s',_0x2f7a68[_0x7ff2('0x2b')],_0x2f7a68[_0x7ff2('0x2a')]);}return util[_0x7ff2('0xc')](_0x7ff2('0x2c'),new Buffer(_0x5c782b)[_0x7ff2('0x2d')](_0x7ff2('0x2e')));}function request(_0x5e1e34){logger[_0x7ff2('0x2f')](_0x7ff2('0x30'),JSON[_0x7ff2('0x31')](_0x5e1e34));return rp(_[_0x7ff2('0x32')](_0x5e1e34,{'method':_0x7ff2('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x3f8374,_0x3ac91e){var _0x4c0a0c=[];if(_0x3f8374&&_0x3f8374[_0x7ff2('0x23')]>0x0){_0x4c0a0c=_[_0x7ff2('0x34')](_0x3f8374,_0x3ac91e);}return _0x4c0a0c;}function getCustomFields(_0x33e862,_0x598e50){var _0x3442a0=[];var _0xcdaf6e={'custom_fields':[]};if(_0x33e862[_0x7ff2('0x23')]>0x0){_[_0x7ff2('0x35')](_0x33e862,function(_0x2229e2){if(_0x2229e2['type']===_0x7ff2('0x36')&&_0x2229e2[_0x7ff2('0x37')]&&!_0x2229e2[_0x7ff2('0x38')]){_0xcdaf6e[_0x2229e2[_0x7ff2('0x37')][_0x7ff2('0x39')]()]=_0x2229e2[_0x7ff2('0x3a')]['toString']();}else if(_0x2229e2[_0x7ff2('0x3b')]===_0x7ff2('0x36')&&_0x2229e2[_0x7ff2('0x3c')]&&_0x2229e2[_0x7ff2('0x38')]){_0xcdaf6e['custom_fields'][_0x7ff2('0x3d')]({'id':_0x2229e2[_0x7ff2('0x3c')],'value':_0x2229e2[_0x7ff2('0x3a')][_0x7ff2('0x2d')]()});}else if(_0x2229e2[_0x7ff2('0x3b')]===_0x7ff2('0x3e')&&_0x2229e2['variableName']&&_0x2229e2['idField']&&_0x2229e2[_0x7ff2('0x38')]){_0x598e50[_0x2229e2[_0x7ff2('0x3f')]]&&_0xcdaf6e[_0x7ff2('0x40')][_0x7ff2('0x3d')]({'id':_0x2229e2['idField'],'value':_0x598e50[_0x2229e2['variableName']][_0x7ff2('0x2d')]()});}else if(_0x2229e2[_0x7ff2('0x3b')]===_0x7ff2('0x41')&&_0x2229e2[_0x7ff2('0x42')]&&_0x2229e2[_0x7ff2('0x42')][_0x7ff2('0x43')]&&_0x2229e2[_0x7ff2('0x3c')]&&_0x2229e2['customField']){_0x598e50[_0x2229e2[_0x7ff2('0x42')][_0x7ff2('0x43')]['toLowerCase']()]&&_0xcdaf6e[_0x7ff2('0x40')]['push']({'id':_0x2229e2[_0x7ff2('0x3c')],'value':_0x598e50[_0x2229e2[_0x7ff2('0x42')][_0x7ff2('0x43')][_0x7ff2('0x39')]()]['toString']()});}});}return _0xcdaf6e;}exports[_0x7ff2('0x44')]=function(_0x43bd54,_0x124bbe,_0x5e5634,_0x4fbabc,_0x29bf03,_0x5bdd02){var _0xd7091,_0x3e876b;_0x5bdd02[_0x7ff2('0xe')]=intUtil[_0x7ff2('0x45')](_0x5bdd02[_0x7ff2('0xe')]);_0x5bdd02[_0x7ff2('0x46')]=intUtil[_0x7ff2('0x45')](_0x5bdd02[_0x7ff2('0x46')]);if(_0x29bf03&&_0x29bf03['monitor_format']){logger[_0x7ff2('0xb')](_0x7ff2('0x47'),_0x7ff2('0x48'));_0x124bbe[_0x7ff2('0x49')]=util['format'](_0x7ff2('0x4a'),_0x5bdd02[_0x7ff2('0x46')],_0x124bbe['uniqueid'],md5(_0x124bbe[_0x7ff2('0x4b')]));}else{_0x124bbe[_0x7ff2('0x49')]='';}headers[_0x7ff2('0x4c')]=getAuth(_0x5bdd02);return getUser(_0x5bdd02,_0x4fbabc['email'])[_0x7ff2('0x13')](function(_0x5e20e2){_0xd7091=_0x5e20e2;logger[_0x7ff2('0xb')](_0x7ff2('0x4d'),_0xd7091['id']);return getEndUser(_0x5bdd02,_0x124bbe[_0x7ff2('0x4e')],_0x124bbe[_0x7ff2('0x4f')]);})['then'](function(_0x5a982f){_0x3e876b=_0x5a982f;logger[_0x7ff2('0xb')](_0x7ff2('0x50'),_0x3e876b['id']);return getTicket(_0x5bdd02,_0xd7091,_0x3e876b,_0x5e5634,_0x124bbe);})[_0x7ff2('0x13')](function(_0x555cd8){if(_0x555cd8){logger[_0x7ff2('0xb')](_0x7ff2('0x51'),_0x555cd8['id']);switch(_0x5bdd02[_0x7ff2('0x3b')]){case _0x7ff2('0x52'):logger[_0x7ff2('0xb')](_0x7ff2('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0x53'),_0x5bdd02[_0x7ff2('0xe')],_0xd7091['id'],_0x555cd8['id']),'method':_0x7ff2('0xf')});case _0x7ff2('0x54'):logger[_0x7ff2('0xb')](_0x7ff2('0x47'),_0x7ff2('0x55'));emit(util[_0x7ff2('0xc')]('user:%s',_0x4fbabc[_0x7ff2('0x43')]),_0x7ff2('0x56'),{'uri':util[_0x7ff2('0xc')](_0x7ff2('0x57'),_0x5bdd02[_0x7ff2('0xe')],_0x555cd8['id'])});break;default:logger['error'](_0x7ff2('0x47'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7ff2('0x58')](function(_0x3bbe47){logger[_0x7ff2('0x59')](_0x7ff2('0x5a'),util[_0x7ff2('0x5b')](_0x3bbe47,{'showHidden':!![],'depth':null}));});};exports[_0x7ff2('0x5c')]=function(_0x3f8656,_0x411b0f,_0x32994e,_0xe750a5,_0x51afa9,_0xb60146,_0x1e4846){var _0x566c40,_0x5077b9;_0xb60146[_0x7ff2('0xe')]=intUtil[_0x7ff2('0x45')](_0xb60146[_0x7ff2('0xe')]);_0xb60146[_0x7ff2('0x46')]=intUtil[_0x7ff2('0x45')](_0xb60146[_0x7ff2('0x46')]);if(_0x1e4846&&_0x1e4846[_0x7ff2('0x5d')]&&_0x1e4846[_0x7ff2('0x5d')]!==_0x7ff2('0x5e')){logger[_0x7ff2('0xb')](_0x7ff2('0x5f'),_0x7ff2('0x48'));_0x411b0f[_0x7ff2('0x49')]=util[_0x7ff2('0xc')](_0x7ff2('0x4a'),_0xb60146['serverUrl'],_0x411b0f[_0x7ff2('0x4b')],md5(_0x411b0f[_0x7ff2('0x4b')]));}headers[_0x7ff2('0x4c')]=getAuth(_0xb60146);return getUser(_0xb60146,_0xe750a5['email'])['then'](function(_0x5d3487){_0x566c40=_0x5d3487;logger[_0x7ff2('0xb')]('The\x20User\x20ID\x20is:',_0x566c40['id']);return getEndUser(_0xb60146,_0x411b0f[_0x7ff2('0x60')],_0x411b0f['destcalleridnum']);})[_0x7ff2('0x13')](function(_0x4e4978){_0x5077b9=_0x4e4978;logger[_0x7ff2('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5077b9['id']);return getTicket(_0xb60146,_0x566c40,_0x5077b9,_0x32994e,_0x411b0f);})[_0x7ff2('0x13')](function(_0x1806ae){if(_0x1806ae){logger[_0x7ff2('0xb')](_0x7ff2('0x51'),_0x1806ae['id']);switch(_0xb60146['type']){case'integrationTab':logger['info'](_0x7ff2('0x5f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7ff2('0xc')](_0x7ff2('0x53'),_0xb60146[_0x7ff2('0xe')],_0x566c40['id'],_0x1806ae['id']),'method':_0x7ff2('0xf')});case _0x7ff2('0x54'):logger['info']('[OUTBOUND]',_0x7ff2('0x55'));emit(util['format'](_0x7ff2('0x61'),_0xe750a5[_0x7ff2('0x43')]),_0x7ff2('0x56'),{'uri':util[_0x7ff2('0xc')](_0x7ff2('0x57'),_0xb60146[_0x7ff2('0xe')],_0x1806ae['id'])});break;default:logger['error'](_0x7ff2('0x5f'),_0x7ff2('0x62'));}}})['catch'](function(_0x32c93e){logger[_0x7ff2('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x7ff2('0x5b')](_0x32c93e,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x479be6,_0x21e979,_0x35b67c,_0x4bd921,_0x474f2d,_0x36b302){var _0x5c0546,_0x35fc96;_0x36b302[_0x7ff2('0xe')]=intUtil[_0x7ff2('0x45')](_0x36b302[_0x7ff2('0xe')]);_0x36b302[_0x7ff2('0x46')]=intUtil['stripTrailingSlash'](_0x36b302[_0x7ff2('0x46')]);if(_0x474f2d&&_0x474f2d[_0x7ff2('0x63')]){logger[_0x7ff2('0xb')]('[ABANDONED]',_0x7ff2('0x48'));_0x21e979[_0x7ff2('0x49')]=util['format'](_0x7ff2('0x4a'),_0x36b302[_0x7ff2('0x46')],_0x21e979[_0x7ff2('0x4b')],md5(_0x21e979[_0x7ff2('0x4b')]));}else{_0x21e979[_0x7ff2('0x49')]='';}headers[_0x7ff2('0x4c')]=getAuth(_0x36b302);return getUser(_0x36b302)[_0x7ff2('0x13')](function(_0x373d36){_0x5c0546=_0x373d36;logger[_0x7ff2('0xb')]('The\x20User\x20ID\x20is:',_0x5c0546['id']);return getEndUser(_0x36b302,_0x21e979[_0x7ff2('0x4e')],_0x21e979[_0x7ff2('0x4f')]);})[_0x7ff2('0x13')](function(_0x497ab5){_0x35fc96=_0x497ab5;logger[_0x7ff2('0xb')](_0x7ff2('0x50'),_0x35fc96['id']);return getTicket(_0x36b302,_0x5c0546,_0x35fc96,_0x35b67c,_0x21e979);})[_0x7ff2('0x13')](function(_0x4bcab7){if(_0x4bcab7){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4bcab7['id']);}})['catch'](function(_0x51010b){logger[_0x7ff2('0x59')](_0x7ff2('0x64'),util['inspect'](_0x51010b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3e78=['uniqueid','recordingURL','Authorization','email','calleridname','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','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]','catch','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','then','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','map','type','string','nameField','customField','idField','custom_fields','push','content','variable','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x557a3b,_0x5ab2c2){var _0x1c048b=function(_0x1c29f8){while(--_0x1c29f8){_0x557a3b['push'](_0x557a3b['shift']());}};_0x1c048b(++_0x5ab2c2);}(_0x3e78,0x1cb));var _0x83e7=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x3e78[_0x11ba83];return _0x3f3925;};'use strict';var _=require('lodash');var rp=require(_0x83e7('0x0'));var md5=require(_0x83e7('0x1'));var util=require(_0x83e7('0x2'));var Redis=require(_0x83e7('0x3'));var intUtil=require(_0x83e7('0x4'));var config=require(_0x83e7('0x5'));var logger=require(_0x83e7('0x6'))(_0x83e7('0x7'));config[_0x83e7('0x8')]=_[_0x83e7('0x9')](config[_0x83e7('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x83e7('0xa'))(new Redis(config[_0x83e7('0x8')]));function emit(_0x5e9fe4,_0x23f9a0,_0xd411ff){io['to'](_0x5e9fe4)['emit'](_0x23f9a0,_0xd411ff);}var headers={'Content-Type':_0x83e7('0xb'),'Accept':'application/json'};function getTicket(_0x17bd12,_0x3b393d,_0x25e037,_0x5989fd,_0x5b5ce6){logger[_0x83e7('0xc')](_0x83e7('0xd'));return request({'uri':util[_0x83e7('0xe')]('%s/tickets.json',_0x17bd12[_0x83e7('0xf')]),'method':_0x83e7('0x10'),'body':{'ticket':_[_0x83e7('0x11')]({'requester_id':_0x25e037['id'],'submitter_id':_0x3b393d?_0x3b393d['id']:undefined,'assignee_id':_0x3b393d?_0x3b393d['id']:undefined,'tags':getTags(_0x5989fd[_0x83e7('0x12')],_0x83e7('0x13')),'subject':intUtil[_0x83e7('0x14')](_0x5989fd['Subjects'],_0x5b5ce6,'\x20'),'description':intUtil['getString'](_0x5989fd['Descriptions'],_0x5b5ce6,'\x0a'),'comment':{'public':![],'body':intUtil[_0x83e7('0x14')](_0x5989fd[_0x83e7('0x15')],_0x5b5ce6,'\x0a')}},getCustomFields(_0x5989fd[_0x83e7('0x16')],_0x5b5ce6))}})['then'](function(_0x73c15d){logger[_0x83e7('0xc')](_0x83e7('0x17'));return _0x73c15d['ticket'];});}function getUser(_0x727a64,_0x22f94f){if(intUtil[_0x83e7('0x18')](_0x22f94f)){logger[_0x83e7('0xc')]('Getting\x20agent\x20with\x20email',_0x22f94f);return request({'uri':util['format'](_0x83e7('0x19'),_0x727a64['remoteUri']),'qs':{'query':util['format'](_0x83e7('0x1a'),_0x22f94f)}})['then'](function(_0x46325d){if(_0x46325d[_0x83e7('0x1b')]){logger[_0x83e7('0xc')](_0x83e7('0x1c'));return _['find'](_0x46325d[_0x83e7('0x1d')],{'email':_0x22f94f,'role':'agent'});}else{logger[_0x83e7('0xc')](_0x83e7('0x1e'));return request({'uri':util[_0x83e7('0xe')](_0x83e7('0x1f'),_0x727a64[_0x83e7('0xf')])})['then'](function(_0x35694b){logger['info'](_0x83e7('0x20'));return _0x35694b[_0x83e7('0x21')];});}});}else{logger[_0x83e7('0xc')](_0x83e7('0x1e'));return request({'uri':util[_0x83e7('0xe')]('%s/users/me.json',_0x727a64['remoteUri'])})['then'](function(_0x1e367f){logger[_0x83e7('0xc')](_0x83e7('0x20'));return _0x1e367f[_0x83e7('0x21')];});}}function getEndUser(_0x4eaa3c,_0x583d87,_0x140b8f){logger[_0x83e7('0xc')](_0x83e7('0x22'),_0x140b8f);return request({'uri':util[_0x83e7('0xe')]('%s/search.json',_0x4eaa3c['remoteUri']),'qs':{'query':util[_0x83e7('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x140b8f)}})[_0x83e7('0x23')](function(_0xbc71a2){var _0x3d126c;if(_0xbc71a2['results']['length']){_0xbc71a2[_0x83e7('0x1d')]=_[_0x83e7('0x24')](_0xbc71a2[_0x83e7('0x1d')],{'suspended':![],'role':_0x83e7('0x25')});if(_0xbc71a2[_0x83e7('0x1d')][_0x83e7('0x26')]){_0x3d126c=_[_0x83e7('0x27')](_0xbc71a2[_0x83e7('0x1d')]);}}if(_0x3d126c){logger['info'](_0x83e7('0x28'));return _0x3d126c;}else{logger['info'](_0x83e7('0x29'));return request({'uri':util['format'](_0x83e7('0x2a'),_0x4eaa3c[_0x83e7('0xf')]),'method':_0x83e7('0x10'),'body':{'user':{'role':_0x83e7('0x25'),'name':util[_0x83e7('0xe')](_0x83e7('0x2b'),_0x583d87||_0x140b8f),'phone':_0x140b8f}}})[_0x83e7('0x23')](function(_0x15b0c6){logger['info'](_0x83e7('0x2c'));return _0x15b0c6['user'];});}});}function getAuth(_0x69a498){var _0x4001c6;if(_0x69a498[_0x83e7('0x2d')]===_0x83e7('0x2e')){_0x4001c6=util[_0x83e7('0xe')](_0x83e7('0x2f'),_0x69a498[_0x83e7('0x30')],_0x69a498['password']);}else if(_0x69a498[_0x83e7('0x2d')]===_0x83e7('0x31')){_0x4001c6=util[_0x83e7('0xe')](_0x83e7('0x32'),_0x69a498[_0x83e7('0x30')],_0x69a498[_0x83e7('0x31')]);}return util[_0x83e7('0xe')]('Basic\x20%s',new Buffer(_0x4001c6)[_0x83e7('0x33')](_0x83e7('0x34')));}function request(_0x39ce87){logger[_0x83e7('0x35')](_0x83e7('0x36'),JSON[_0x83e7('0x37')](_0x39ce87));return rp(_['defaults'](_0x39ce87,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xe7363b,_0x506a11){var _0x5f3c8e=[];if(_0xe7363b&&_0xe7363b['length']>0x0){_0x5f3c8e=_[_0x83e7('0x38')](_0xe7363b,_0x506a11);}return _0x5f3c8e;}function getCustomFields(_0x38557c,_0x3e0dbb){var _0xf117df=[];var _0x11b383={'custom_fields':[]};if(_0x38557c[_0x83e7('0x26')]>0x0){_['forEach'](_0x38557c,function(_0x267cd0){if(_0x267cd0[_0x83e7('0x39')]===_0x83e7('0x3a')&&_0x267cd0[_0x83e7('0x3b')]&&!_0x267cd0[_0x83e7('0x3c')]){_0x11b383[_0x267cd0['nameField']['toLowerCase']()]=_0x267cd0['content'][_0x83e7('0x33')]();}else if(_0x267cd0[_0x83e7('0x39')]===_0x83e7('0x3a')&&_0x267cd0[_0x83e7('0x3d')]&&_0x267cd0[_0x83e7('0x3c')]){_0x11b383[_0x83e7('0x3e')][_0x83e7('0x3f')]({'id':_0x267cd0[_0x83e7('0x3d')],'value':_0x267cd0[_0x83e7('0x40')][_0x83e7('0x33')]()});}else if(_0x267cd0[_0x83e7('0x39')]===_0x83e7('0x41')&&_0x267cd0['variableName']&&_0x267cd0[_0x83e7('0x3d')]&&_0x267cd0[_0x83e7('0x3c')]){_0x3e0dbb[_0x267cd0['variableName']]&&_0x11b383[_0x83e7('0x3e')][_0x83e7('0x3f')]({'id':_0x267cd0['idField'],'value':_0x3e0dbb[_0x267cd0['variableName']][_0x83e7('0x33')]()});}else if(_0x267cd0[_0x83e7('0x39')]===_0x83e7('0x42')&&_0x267cd0[_0x83e7('0x43')]&&_0x267cd0[_0x83e7('0x43')][_0x83e7('0x13')]&&_0x267cd0[_0x83e7('0x3d')]&&_0x267cd0['customField']){_0x3e0dbb[_0x267cd0['Variable'][_0x83e7('0x13')][_0x83e7('0x44')]()]&&_0x11b383['custom_fields'][_0x83e7('0x3f')]({'id':_0x267cd0[_0x83e7('0x3d')],'value':_0x3e0dbb[_0x267cd0[_0x83e7('0x43')]['name'][_0x83e7('0x44')]()][_0x83e7('0x33')]()});}});}return _0x11b383;}exports[_0x83e7('0x45')]=function(_0xe0789c,_0x15ea4a,_0x8f1f78,_0x354464,_0x24baec,_0x2e5684){var _0x14a604,_0x4e4d0a;_0x2e5684['remoteUri']=intUtil[_0x83e7('0x46')](_0x2e5684[_0x83e7('0xf')]);_0x2e5684[_0x83e7('0x47')]=intUtil[_0x83e7('0x46')](_0x2e5684[_0x83e7('0x47')]);if(_0x24baec&&_0x24baec[_0x83e7('0x48')]){logger[_0x83e7('0xc')](_0x83e7('0x49'),_0x83e7('0x4a'));_0x15ea4a['recordingURL']=util[_0x83e7('0xe')](_0x83e7('0x4b'),_0x2e5684['serverUrl'],_0x15ea4a['uniqueid'],md5(_0x15ea4a[_0x83e7('0x4c')]));}else{_0x15ea4a[_0x83e7('0x4d')]='';}headers[_0x83e7('0x4e')]=getAuth(_0x2e5684);return getUser(_0x2e5684,_0x354464[_0x83e7('0x4f')])[_0x83e7('0x23')](function(_0x6c094b){_0x14a604=_0x6c094b;logger['info']('The\x20User\x20ID\x20is:',_0x14a604['id']);return getEndUser(_0x2e5684,_0x15ea4a[_0x83e7('0x50')],_0x15ea4a[_0x83e7('0x51')]);})[_0x83e7('0x23')](function(_0x482eac){_0x4e4d0a=_0x482eac;logger[_0x83e7('0xc')](_0x83e7('0x52'),_0x4e4d0a['id']);return getTicket(_0x2e5684,_0x14a604,_0x4e4d0a,_0x8f1f78,_0x15ea4a);})[_0x83e7('0x23')](function(_0x1777d0){if(_0x1777d0){logger[_0x83e7('0xc')](_0x83e7('0x53'),_0x1777d0['id']);switch(_0x2e5684[_0x83e7('0x39')]){case'integrationTab':logger[_0x83e7('0xc')](_0x83e7('0x49'),_0x83e7('0x54'));return request({'uri':util[_0x83e7('0xe')](_0x83e7('0x55'),_0x2e5684[_0x83e7('0xf')],_0x14a604['id'],_0x1777d0['id']),'method':'POST'});case _0x83e7('0x56'):logger[_0x83e7('0xc')](_0x83e7('0x49'),_0x83e7('0x57'));emit(util[_0x83e7('0xe')](_0x83e7('0x58'),_0x354464['name']),'trigger:browser:url',{'uri':util[_0x83e7('0xe')](_0x83e7('0x59'),_0x2e5684[_0x83e7('0xf')],_0x1777d0['id'])});break;default:logger[_0x83e7('0x5a')]('[QUEUE]',_0x83e7('0x5b'));}}})['catch'](function(_0x4e8ea1){logger[_0x83e7('0x5a')](_0x83e7('0x5c'),util['inspect'](_0x4e8ea1,{'showHidden':!![],'depth':null}));});};exports[_0x83e7('0x5d')]=function(_0x548b2f,_0x119604,_0xcdd60c,_0x58aba3,_0x35e993,_0x550b5a,_0x5ba9b3){var _0x3e8165,_0x31c89b;_0x550b5a['remoteUri']=intUtil[_0x83e7('0x46')](_0x550b5a[_0x83e7('0xf')]);_0x550b5a[_0x83e7('0x47')]=intUtil[_0x83e7('0x46')](_0x550b5a[_0x83e7('0x47')]);if(_0x5ba9b3&&_0x5ba9b3[_0x83e7('0x5e')]&&_0x5ba9b3[_0x83e7('0x5e')]!=='none'){logger[_0x83e7('0xc')](_0x83e7('0x5f'),'Recording\x20is\x20enabled!');_0x119604['recordingURL']=util[_0x83e7('0xe')](_0x83e7('0x4b'),_0x550b5a[_0x83e7('0x47')],_0x119604['uniqueid'],md5(_0x119604['uniqueid']));}headers[_0x83e7('0x4e')]=getAuth(_0x550b5a);return getUser(_0x550b5a,_0x58aba3[_0x83e7('0x4f')])[_0x83e7('0x23')](function(_0x4b5659){_0x3e8165=_0x4b5659;logger[_0x83e7('0xc')](_0x83e7('0x60'),_0x3e8165['id']);return getEndUser(_0x550b5a,_0x119604[_0x83e7('0x61')],_0x119604[_0x83e7('0x62')]);})[_0x83e7('0x23')](function(_0x110bea){_0x31c89b=_0x110bea;logger[_0x83e7('0xc')]('The\x20Enduser\x20ID\x20is:',_0x31c89b['id']);return getTicket(_0x550b5a,_0x3e8165,_0x31c89b,_0xcdd60c,_0x119604);})[_0x83e7('0x23')](function(_0x3981e3){if(_0x3981e3){logger[_0x83e7('0xc')](_0x83e7('0x53'),_0x3981e3['id']);switch(_0x550b5a[_0x83e7('0x39')]){case _0x83e7('0x63'):logger['info']('[OUTBOUND]',_0x83e7('0x54'));return request({'uri':util[_0x83e7('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x550b5a['remoteUri'],_0x3e8165['id'],_0x3981e3['id']),'method':_0x83e7('0x10')});case _0x83e7('0x56'):logger[_0x83e7('0xc')](_0x83e7('0x5f'),_0x83e7('0x57'));emit(util[_0x83e7('0xe')]('user:%s',_0x58aba3['name']),_0x83e7('0x64'),{'uri':util[_0x83e7('0xe')](_0x83e7('0x59'),_0x550b5a[_0x83e7('0xf')],_0x3981e3['id'])});break;default:logger[_0x83e7('0x5a')](_0x83e7('0x5f'),_0x83e7('0x5b'));}}})['catch'](function(_0xcc1147){logger[_0x83e7('0x5a')](_0x83e7('0x65'),util[_0x83e7('0x66')](_0xcc1147,{'showHidden':!![],'depth':null}));});};exports[_0x83e7('0x67')]=function(_0x1c75c5,_0xf35b1d,_0x444527,_0x54da88,_0xdafd3a,_0x96f8d6){var _0x128301,_0x21012c;_0x96f8d6[_0x83e7('0xf')]=intUtil['stripTrailingSlash'](_0x96f8d6[_0x83e7('0xf')]);_0x96f8d6[_0x83e7('0x47')]=intUtil[_0x83e7('0x46')](_0x96f8d6[_0x83e7('0x47')]);if(_0xdafd3a&&_0xdafd3a[_0x83e7('0x48')]){logger[_0x83e7('0xc')](_0x83e7('0x68'),_0x83e7('0x4a'));_0xf35b1d[_0x83e7('0x4d')]=util[_0x83e7('0xe')](_0x83e7('0x4b'),_0x96f8d6[_0x83e7('0x47')],_0xf35b1d['uniqueid'],md5(_0xf35b1d[_0x83e7('0x4c')]));}else{_0xf35b1d['recordingURL']='';}headers[_0x83e7('0x4e')]=getAuth(_0x96f8d6);return getUser(_0x96f8d6)[_0x83e7('0x23')](function(_0x26ce82){_0x128301=_0x26ce82;logger[_0x83e7('0xc')](_0x83e7('0x60'),_0x128301['id']);return getEndUser(_0x96f8d6,_0xf35b1d['calleridname'],_0xf35b1d['calleridnum']);})[_0x83e7('0x23')](function(_0x6b249f){_0x21012c=_0x6b249f;logger[_0x83e7('0xc')](_0x83e7('0x52'),_0x21012c['id']);return getTicket(_0x96f8d6,_0x128301,_0x21012c,_0x444527,_0xf35b1d);})[_0x83e7('0x23')](function(_0x423512){if(_0x423512){logger['info']('The\x20Ticket\x20ID\x20is:',_0x423512['id']);}})[_0x83e7('0x69')](function(_0x1b6b8d){logger['error'](_0x83e7('0x6a'),util[_0x83e7('0x66')](_0x1b6b8d,{'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 814140f..bad7066 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 _0x9501=['GET','AllUsers','authToken','users','log','zoho\x20data\x20users','user','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','monitor_format','calleridname','[ABANDONED]','lodash','md5','util','./util','xml2json','entities','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','merge','inbound','starttime','agentcalledAt','Subjects','getString','Descriptions','lastevent','called','Called','complete','connect','Answered','rejected','Call\x20Result','abandoned','talktime','Call\x20Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','CONTACTID','LEADID','SEMODULE','Leads','hasOwnProperty','%s','encodeXML','','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','then','parse','toJson','response','result','recorddetail','Error\x20on\x20call\x20creation:\x20','stringify'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x9501,0x15b));var _0x1950=function(_0x146a20,_0x77e5dd){_0x146a20=_0x146a20-0x0;var _0x53348f=_0x9501[_0x146a20];return _0x53348f;};'use strict';var _=require(_0x1950('0x0'));var rp=require('request-promise');var md5=require(_0x1950('0x1'));var util=require(_0x1950('0x2'));var intUtil=require(_0x1950('0x3'));var parser=require(_0x1950('0x4'));var entities=require(_0x1950('0x5'));var moment=require(_0x1950('0x6'));var Redis=require(_0x1950('0x7'));var config=require('../../../../config/environment');var logger=require(_0x1950('0x8'))(_0x1950('0x9'));config[_0x1950('0xa')]=_[_0x1950('0xb')](config[_0x1950('0xa')],{'host':_0x1950('0xc'),'port':0x18eb});var io=require(_0x1950('0xd'))(new Redis(config[_0x1950('0xa')]));function emit(_0x4f38de,_0xec2584,_0x16767b){io['to'](_0x4f38de)[_0x1950('0xe')](_0xec2584,_0x16767b);}var headers={'Content-Type':_0x1950('0xf'),'Accept':_0x1950('0xf')};function getCall(_0x36ed56,_0x583b9d,_0x35700f,_0x271da,_0xe1ac1a,_0x17533b){logger[_0x1950('0x10')]('Creating\x20new\x20call...');var _0x420c5f=_[_0x1950('0x11')]({'SMOWNERID':_0x583b9d['id'],'Call Type':_0x17533b||_0x1950('0x12'),'Call Start Time':(_0x17533b==='outbound'?_0xe1ac1a[_0x1950('0x13')]:_0xe1ac1a[_0x1950('0x14')])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil['getString'](_0x271da[_0x1950('0x15')],_0xe1ac1a,'\x20'),'Description':intUtil[_0x1950('0x16')](_0x271da[_0x1950('0x17')],_0xe1ac1a,'\x0a')},getCustomFields(_0x271da['Fields'],_0xe1ac1a));switch(_0xe1ac1a[_0x1950('0x18')]){case _0x1950('0x19'):_0x420c5f['Call\x20Result']=_0x1950('0x1a');break;case _0x1950('0x1b'):case _0x1950('0x1c'):_0x420c5f['Call\x20Result']=_0x1950('0x1d');break;case _0x1950('0x1e'):_0x420c5f[_0x1950('0x1f')]='Rejected';break;case _0x1950('0x20'):_0x420c5f[_0x1950('0x1f')]='Abandoned';break;default:}if(_0xe1ac1a[_0x1950('0x21')]){_0x420c5f[_0x1950('0x22')]=moment[_0x1950('0x23')](parseInt(_0xe1ac1a[_0x1950('0x21')])*0x3e8)[_0x1950('0x24')](_0x1950('0x25'));}else if(_0xe1ac1a[_0x1950('0x26')]&&_0xe1ac1a[_0x1950('0x27')]){_0x420c5f['Call\x20Duration']=moment[_0x1950('0x23')](moment(_0xe1ac1a[_0x1950('0x27')],_0x1950('0x28'))[_0x1950('0x29')](moment(_0xe1ac1a['starttime'],_0x1950('0x28'))))[_0x1950('0x24')](_0x1950('0x25'));}if(_0x35700f[_0x1950('0x2a')]){_0x420c5f['CONTACTID']=_0x35700f[_0x1950('0x2a')];}else if(_0x35700f[_0x1950('0x2b')]){_0x420c5f[_0x1950('0x2c')]=_0x1950('0x2d');_0x420c5f['SEID']=_0x35700f[_0x1950('0x2b')];}var _0x3b2f0b='';for(var _0x5b6ac5 in _0x420c5f){if(_0x420c5f[_0x1950('0x2e')](_0x5b6ac5)){_0x3b2f0b+=util[_0x1950('0x24')](_0x1950('0x2f'),entities[_0x1950('0x30')](_0x5b6ac5),entities['encodeXML'](_0x420c5f[_0x5b6ac5]));}}_0x3b2f0b+=_0x1950('0x31');return request({'method':'POST','uri':util[_0x1950('0x24')](_0x1950('0x32'),_0x36ed56[_0x1950('0x33')]),'qs':{'authtoken':_0x36ed56['authToken'],'scope':_0x1950('0x34'),'xmlData':_0x3b2f0b},'json':!![]})[_0x1950('0x35')](function(_0x197f6f){_0x197f6f=JSON[_0x1950('0x36')](parser[_0x1950('0x37')](_0x197f6f));if(_0x197f6f[_0x1950('0x38')]){if(_0x197f6f['response'][_0x1950('0x39')]&&_0x197f6f[_0x1950('0x38')][_0x1950('0x39')]['recorddetail']){logger[_0x1950('0x10')]('Call\x20created!');return{'id':_0x197f6f['response'][_0x1950('0x39')][_0x1950('0x3a')]['FL'][0x0]['$t']};}}throw new Error(_0x1950('0x3b')+JSON[_0x1950('0x3c')](_0x197f6f));});}function getUser(_0x2d6d4a,_0x2ab6e7){return request({'method':_0x1950('0x3d'),'uri':util[_0x1950('0x24')]('https://crm.%s/crm/private/json/Users/getUsers',_0x2d6d4a[_0x1950('0x33')]),'qs':{'type':_0x1950('0x3e'),'authtoken':_0x2d6d4a[_0x1950('0x3f')],'scope':_0x1950('0x34')},'json':!![]})['then'](function(_0x2c9b03){if(_0x2c9b03['users']&&_0x2c9b03[_0x1950('0x40')]['user']){var _0x4aaf2f;console[_0x1950('0x41')](_0x1950('0x42'),_0x2c9b03[_0x1950('0x40')][_0x1950('0x43')]);if(_['isArrayLikeObject'](_0x2c9b03[_0x1950('0x40')][_0x1950('0x43')])){console['log']('zoho\x20data\x20users',_0x2c9b03[_0x1950('0x40')][_0x1950('0x43')]);if(!_[_0x1950('0x44')](_0x2ab6e7)){_0x4aaf2f=_[_0x1950('0x45')](_0x2c9b03[_0x1950('0x40')][_0x1950('0x43')],{'email':_0x2ab6e7,'profile':_0x1950('0x46'),'status':_0x1950('0x47')});}if(!_[_0x1950('0x44')](_0x4aaf2f)){logger[_0x1950('0x10')](_0x1950('0x48'));}else{logger[_0x1950('0x10')](_0x1950('0x49'));_0x4aaf2f=_[_0x1950('0x45')](_0x2c9b03[_0x1950('0x40')]['user'],{'profile':'Administrator'});}console[_0x1950('0x41')]('zoho\x20user',_0x4aaf2f);return _0x4aaf2f;}else{if(_0x2c9b03[_0x1950('0x40')][_0x1950('0x43')][_0x1950('0x4a')]===_0x1950('0x4b')){logger['info'](_0x1950('0x49'));_0x4aaf2f=_0x2c9b03['users'][_0x1950('0x43')];return _0x4aaf2f;}else{logger['error'](_0x1950('0x4c'),JSON['stringify'](_0x2c9b03));throw new Error(_0x1950('0x4d')+JSON['stringify'](_0x2c9b03));}}}else{logger[_0x1950('0x4e')](_0x1950('0x4c'),JSON[_0x1950('0x3c')](_0x2c9b03));throw new Error(_0x1950('0x4d')+JSON[_0x1950('0x3c')](_0x2c9b03));}});}function getEndUser(_0x960e6a,_0x425ab9,_0x5890ac){logger[_0x1950('0x10')](_0x1950('0x4f'),_0x5890ac);return request({'method':'GET','uri':util[_0x1950('0x24')](_0x1950('0x50'),_0x960e6a[_0x1950('0x33')]),'qs':{'authtoken':_0x960e6a[_0x1950('0x3f')],'scope':_0x1950('0x34'),'criteria':util[_0x1950('0x24')]('((Phone:%s))',_0x5890ac)},'json':!![]})[_0x1950('0x35')](function(_0x5e2fea){if(_0x5e2fea[_0x1950('0x38')]&&_0x5e2fea['response'][_0x1950('0x39')]){logger[_0x1950('0x10')](_0x1950('0x51'));var _0x375808={};var _0x3a01c1=_0x5e2fea[_0x1950('0x38')]['result'][_0x1950('0x52')][_0x1950('0x53')]['no']?_0x5e2fea[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x52')]['row']['FL']:_0x5e2fea[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x52')][_0x1950('0x53')][0x0]['FL'];for(var _0x2ffbd2=0x0,_0x581705=_0x3a01c1[_0x1950('0x54')];_0x2ffbd2<_0x581705;_0x2ffbd2++){_0x375808[_0x3a01c1[_0x2ffbd2][_0x1950('0x55')]]=_0x3a01c1[_0x2ffbd2][_0x1950('0x56')];}return _0x375808;}else{return request({'method':_0x1950('0x3d'),'uri':util[_0x1950('0x24')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x960e6a[_0x1950('0x33')]),'qs':{'authtoken':_0x960e6a['authToken'],'scope':_0x1950('0x34'),'criteria':util[_0x1950('0x24')](_0x1950('0x57'),_0x5890ac)},'json':!![]})[_0x1950('0x35')](function(_0x597a58){if(_0x597a58[_0x1950('0x38')]&&_0x597a58[_0x1950('0x38')][_0x1950('0x39')]){logger[_0x1950('0x10')](_0x1950('0x58'));var _0x21bf4a={};var _0xeae18=_0x597a58[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x2d')][_0x1950('0x53')]['no']?_0x597a58['response'][_0x1950('0x39')][_0x1950('0x2d')][_0x1950('0x53')]['FL']:_0x597a58[_0x1950('0x38')]['result'][_0x1950('0x2d')][_0x1950('0x53')][0x0]['FL'];for(var _0x1bfcd8=0x0,_0x3f3619=_0xeae18[_0x1950('0x54')];_0x1bfcd8<_0x3f3619;_0x1bfcd8++){_0x21bf4a[_0xeae18[_0x1bfcd8]['val']]=_0xeae18[_0x1bfcd8][_0x1950('0x56')];}return _0x21bf4a;}else{logger['info'](_0x1950('0x59'));_0x425ab9=getName(_0x425ab9);return request({'method':'POST','uri':util[_0x1950('0x24')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x960e6a[_0x1950('0x33')]),'qs':{'authtoken':_0x960e6a['authToken'],'scope':_0x1950('0x34'),'xmlData':util['format'](_0x1950('0x5a'),entities[_0x1950('0x30')](_0x425ab9[0x0]),entities[_0x1950('0x30')](_0x425ab9[0x1]),_0x5890ac)},'json':!![]})[_0x1950('0x35')](function(_0x1a12c9){_0x1a12c9=JSON[_0x1950('0x36')](parser[_0x1950('0x37')](_0x1a12c9));if(_0x1a12c9[_0x1950('0x38')]){if(_0x1a12c9[_0x1950('0x38')][_0x1950('0x39')]&&_0x1a12c9[_0x1950('0x38')][_0x1950('0x39')]['recorddetail']){logger['info'](_0x1950('0x5b'));return request({'method':_0x1950('0x3d'),'uri':util[_0x1950('0x24')](_0x1950('0x5c'),_0x960e6a[_0x1950('0x33')]),'qs':{'authtoken':_0x960e6a['authToken'],'scope':'crmapi','id':_0x1a12c9[_0x1950('0x38')][_0x1950('0x39')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x1950('0x5d')+JSON[_0x1950('0x3c')](_0x1a12c9));})['then'](function(_0x3873bd){if(_0x3873bd['response']){if(_0x3873bd[_0x1950('0x38')]['result']){var _0x53dbe0={};for(var _0x1d80c8=0x0,_0xa3478a=_0x3873bd[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x2d')][_0x1950('0x53')]['FL'][_0x1950('0x54')];_0x1d80c8<_0xa3478a;_0x1d80c8++){_0x53dbe0[_0x3873bd[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x2d')][_0x1950('0x53')]['FL'][_0x1d80c8][_0x1950('0x55')]]=_0x3873bd[_0x1950('0x38')][_0x1950('0x39')][_0x1950('0x2d')][_0x1950('0x53')]['FL'][_0x1d80c8][_0x1950('0x56')];}return _0x53dbe0;}}throw new Error(_0x1950('0x5e')+JSON['stringify'](_0x3873bd));});}});}});}function request(_0x15d506){logger[_0x1950('0x5f')]('[HTTP]',JSON['stringify'](_0x15d506));return rp(_0x15d506);}function getCustomFields(_0x528c9b,_0x2225af){var _0x4b4644={};if(_0x528c9b[_0x1950('0x54')]>0x0){_[_0x1950('0x60')](_0x528c9b,function(_0x4e376e){if(_0x4e376e[_0x1950('0x61')]==='string'&&_0x4e376e[_0x1950('0x62')]){_0x4b4644[_0x4e376e[_0x1950('0x62')]]=_0x4e376e[_0x1950('0x56')][_0x1950('0x63')]();}else if(_0x4e376e['type']===_0x1950('0x64')&&_0x4e376e['variableName']&&_0x4e376e[_0x1950('0x62')]&&_0x2225af[_0x4e376e[_0x1950('0x65')]]){_0x4b4644[_0x4e376e[_0x1950('0x62')]]=_0x2225af[_0x4e376e[_0x1950('0x65')]][_0x1950('0x63')]();}else if(_0x4e376e['type']===_0x1950('0x66')&&_0x4e376e[_0x1950('0x67')]&&_0x4e376e['Variable'][_0x1950('0x68')]&&_0x4e376e[_0x1950('0x62')]&&_0x2225af[_0x4e376e[_0x1950('0x67')][_0x1950('0x68')][_0x1950('0x69')]()]){_0x4b4644[_0x4e376e[_0x1950('0x62')]]=_0x2225af[_0x4e376e[_0x1950('0x67')][_0x1950('0x68')][_0x1950('0x69')]()][_0x1950('0x63')]();}});}return _0x4b4644;}function getName(_0x1c99e4){if(_0x1c99e4[_0x1950('0x6a')]('\x20')>0x0){var _0x112859=_0x1c99e4[_0x1950('0x6b')](/ (.+)/);if(_0x112859[0x1]){return _0x112859;}}return[_0x1c99e4,_0x1c99e4];}exports[_0x1950('0x6c')]=function(_0x570cf8,_0x232569,_0x1ce5a0,_0x26b0e6,_0x3b0ea4,_0xc450d0){var _0x300112,_0x3b08b8;_0xc450d0['host']=intUtil[_0x1950('0x6d')](_0xc450d0['host']);_0xc450d0[_0x1950('0x6e')]=intUtil[_0x1950('0x6d')](_0xc450d0[_0x1950('0x6e')]);if(_0x3b0ea4&&_0x3b0ea4['monitor_format']){logger['info']('[QUEUE]',_0x1950('0x6f'));_0x232569[_0x1950('0x70')]=util[_0x1950('0x24')](_0x1950('0x71'),_0xc450d0[_0x1950('0x6e')],_0x232569['uniqueid'],md5(_0x232569['uniqueid']));}else{_0x232569[_0x1950('0x70')]='';}return getUser(_0xc450d0,_0x26b0e6[_0x1950('0x72')])[_0x1950('0x35')](function(_0x113121){_0x300112=_0x113121;logger[_0x1950('0x10')](_0x1950('0x73'),_0x300112['id']);return getEndUser(_0xc450d0,_0x232569['calleridname'],_0x232569[_0x1950('0x74')]);})[_0x1950('0x35')](function(_0x4ed361){_0x3b08b8=_0x4ed361;logger['info'](_0x1950('0x75'),_0x3b08b8[_0x1950('0x2a')]||_0x3b08b8[_0x1950('0x2b')]);return getCall(_0xc450d0,_0x300112,_0x3b08b8,_0x1ce5a0,_0x232569,_0x1950('0x76'));})[_0x1950('0x35')](function(_0x4712aa){if(_0x4712aa){logger[_0x1950('0x10')](_0x1950('0x77'),_0x4712aa['id']);logger[_0x1950('0x10')](_0x1950('0x78'),_0x1950('0x79'));emit(util[_0x1950('0x24')](_0x1950('0x7a'),_0x26b0e6[_0x1950('0x68')]),_0x1950('0x7b'),{'uri':util[_0x1950('0x24')](_0x1950('0x7c'),_0xc450d0[_0x1950('0x33')],_0x4712aa['id'])});}})[_0x1950('0x7d')](function(_0x54e8d4){logger['error'](_0x1950('0x78'),JSON[_0x1950('0x3c')](_0x54e8d4));});};exports[_0x1950('0x7e')]=function(_0x584293,_0x455571,_0x26f2ec,_0x1c117f,_0x54d7d5,_0x2dabc0,_0x35af0b){var _0x5678fd,_0x3383e8;_0x2dabc0[_0x1950('0x33')]=intUtil[_0x1950('0x6d')](_0x2dabc0[_0x1950('0x33')]);_0x2dabc0[_0x1950('0x6e')]=intUtil[_0x1950('0x6d')](_0x2dabc0[_0x1950('0x6e')]);if(_0x35af0b&&_0x35af0b['recordingFormat']&&_0x35af0b[_0x1950('0x7f')]!==_0x1950('0x80')){logger[_0x1950('0x10')](_0x1950('0x81'),_0x1950('0x6f'));_0x455571['recordingURL']=util[_0x1950('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dabc0['serverUrl'],_0x455571['uniqueid'],md5(_0x455571[_0x1950('0x82')]));}return getUser(_0x2dabc0,_0x1c117f[_0x1950('0x72')])[_0x1950('0x35')](function(_0x45f0a7){_0x5678fd=_0x45f0a7;logger[_0x1950('0x10')](_0x1950('0x73'),_0x5678fd['id']);return getEndUser(_0x2dabc0,_0x455571[_0x1950('0x83')],_0x455571[_0x1950('0x84')]);})['then'](function(_0x33a041){_0x3383e8=_0x33a041;logger[_0x1950('0x10')](_0x1950('0x75'),_0x3383e8[_0x1950('0x2a')]||_0x3383e8[_0x1950('0x2b')]);return getCall(_0x2dabc0,_0x5678fd,_0x3383e8,_0x26f2ec,_0x455571,'Outbound');})[_0x1950('0x35')](function(_0x30db1e){if(_0x30db1e){logger[_0x1950('0x10')](_0x1950('0x77'),_0x30db1e['id']);logger[_0x1950('0x10')](_0x1950('0x81'),_0x1950('0x79'));emit(util[_0x1950('0x24')](_0x1950('0x7a'),_0x1c117f[_0x1950('0x68')]),'trigger:browser:url',{'uri':util['format'](_0x1950('0x7c'),_0x2dabc0[_0x1950('0x33')],_0x30db1e['id'])});}})[_0x1950('0x7d')](function(_0xbc673b){logger[_0x1950('0x4e')](_0x1950('0x81'),JSON[_0x1950('0x3c')](_0xbc673b));});};exports[_0x1950('0x20')]=function(_0x3c9c6a,_0x330285,_0x3bc1ad,_0x3221d7,_0x52746e,_0x7f2857){var _0x5f5779,_0x378d75;_0x7f2857[_0x1950('0x33')]=intUtil[_0x1950('0x6d')](_0x7f2857[_0x1950('0x33')]);_0x7f2857[_0x1950('0x6e')]=intUtil[_0x1950('0x6d')](_0x7f2857[_0x1950('0x6e')]);if(_0x52746e&&_0x52746e[_0x1950('0x85')]){logger[_0x1950('0x10')]('[ABANDONED]',_0x1950('0x6f'));_0x330285['recordingURL']=util[_0x1950('0x24')](_0x1950('0x71'),_0x7f2857[_0x1950('0x6e')],_0x330285[_0x1950('0x82')],md5(_0x330285[_0x1950('0x82')]));}else{_0x330285['recordingURL']='';}return getUser(_0x7f2857)[_0x1950('0x35')](function(_0x1aa14c){_0x5f5779=_0x1aa14c;logger['info'](_0x1950('0x73'),_0x5f5779['id']);return getEndUser(_0x7f2857,_0x330285[_0x1950('0x86')],_0x330285[_0x1950('0x74')]);})[_0x1950('0x35')](function(_0x39a8c5){_0x378d75=_0x39a8c5;logger[_0x1950('0x10')](_0x1950('0x75'),_0x378d75[_0x1950('0x2a')]||_0x378d75['LEADID']);return getCall(_0x7f2857,_0x5f5779,_0x378d75,_0x3bc1ad,_0x330285,_0x1950('0x76'));})['then'](function(_0xda09ba){if(_0xda09ba){logger[_0x1950('0x10')](_0x1950('0x77'),_0xda09ba['id']);}})[_0x1950('0x7d')](function(_0x401b20){logger[_0x1950('0x4e')](_0x1950('0x87'),JSON[_0x1950('0x3c')](_0x401b20));});}; \ No newline at end of file +var _0xb9b7=['error','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','row','Contacts','length','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Leads','val','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','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:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','none','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','trigger:browser:url','abandoned','[ABANDONED]','Inbound','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Call\x20Result','Called','complete','connect','rejected','Rejected','talktime','utc','format','answertime','Call\x20Duration','endtime','diff','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','parse','toJson','response','result','recorddetail','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','then','users','user','zoho\x20data\x20users','log','find','Standard','active','isNil','Using\x20the\x20admin\x20account!','zoho\x20user','profile','Administrator'];(function(_0x2563e4,_0x456262){var _0x53e6d8=function(_0x288a4c){while(--_0x288a4c){_0x2563e4['push'](_0x2563e4['shift']());}};_0x53e6d8(++_0x456262);}(_0xb9b7,0xbb));var _0x7b9b=function(_0x32dc56,_0x162800){_0x32dc56=_0x32dc56-0x0;var _0x285ad2=_0xb9b7[_0x32dc56];return _0x285ad2;};'use strict';var _=require(_0x7b9b('0x0'));var rp=require(_0x7b9b('0x1'));var md5=require(_0x7b9b('0x2'));var util=require(_0x7b9b('0x3'));var intUtil=require('./util');var parser=require('xml2json');var entities=require('entities');var moment=require('moment');var Redis=require('ioredis');var config=require(_0x7b9b('0x4'));var logger=require(_0x7b9b('0x5'))(_0x7b9b('0x6'));config[_0x7b9b('0x7')]=_['defaults'](config[_0x7b9b('0x7')],{'host':_0x7b9b('0x8'),'port':0x18eb});var io=require(_0x7b9b('0x9'))(new Redis(config[_0x7b9b('0x7')]));function emit(_0x3fc806,_0x39e752,_0x5396e2){io['to'](_0x3fc806)[_0x7b9b('0xa')](_0x39e752,_0x5396e2);}var headers={'Content-Type':_0x7b9b('0xb'),'Accept':_0x7b9b('0xb')};function getCall(_0x5e48de,_0x5308c5,_0x191bf5,_0x55847c,_0x413a18,_0x2ff6ae){logger[_0x7b9b('0xc')](_0x7b9b('0xd'));var _0x1515b2=_[_0x7b9b('0xe')]({'SMOWNERID':_0x5308c5['id'],'Call Type':_0x2ff6ae||_0x7b9b('0xf'),'Call Start Time':(_0x2ff6ae===_0x7b9b('0x10')?_0x413a18[_0x7b9b('0x11')]:_0x413a18[_0x7b9b('0x12')])||moment()['format'](_0x7b9b('0x13')),'Subject':intUtil[_0x7b9b('0x14')](_0x55847c[_0x7b9b('0x15')],_0x413a18,'\x20'),'Description':intUtil[_0x7b9b('0x14')](_0x55847c[_0x7b9b('0x16')],_0x413a18,'\x0a')},getCustomFields(_0x55847c[_0x7b9b('0x17')],_0x413a18));switch(_0x413a18[_0x7b9b('0x18')]){case _0x7b9b('0x19'):_0x1515b2[_0x7b9b('0x1a')]=_0x7b9b('0x1b');break;case _0x7b9b('0x1c'):case _0x7b9b('0x1d'):_0x1515b2[_0x7b9b('0x1a')]='Answered';break;case _0x7b9b('0x1e'):_0x1515b2[_0x7b9b('0x1a')]=_0x7b9b('0x1f');break;case'abandoned':_0x1515b2[_0x7b9b('0x1a')]='Abandoned';break;default:}if(_0x413a18[_0x7b9b('0x20')]){_0x1515b2['Call\x20Duration']=moment[_0x7b9b('0x21')](parseInt(_0x413a18[_0x7b9b('0x20')])*0x3e8)[_0x7b9b('0x22')]('mm:ss');}else if(_0x413a18[_0x7b9b('0x23')]&&_0x413a18['endtime']){_0x1515b2[_0x7b9b('0x24')]=moment[_0x7b9b('0x21')](moment(_0x413a18[_0x7b9b('0x25')],_0x7b9b('0x13'))[_0x7b9b('0x26')](moment(_0x413a18[_0x7b9b('0x11')],_0x7b9b('0x13'))))['format'](_0x7b9b('0x27'));}if(_0x191bf5[_0x7b9b('0x28')]){_0x1515b2[_0x7b9b('0x28')]=_0x191bf5[_0x7b9b('0x28')];}else if(_0x191bf5[_0x7b9b('0x29')]){_0x1515b2[_0x7b9b('0x2a')]='Leads';_0x1515b2[_0x7b9b('0x2b')]=_0x191bf5[_0x7b9b('0x29')];}var _0xa89f9d=_0x7b9b('0x2c');for(var _0x5dfba1 in _0x1515b2){if(_0x1515b2['hasOwnProperty'](_0x5dfba1)){_0xa89f9d+=util[_0x7b9b('0x22')]('%s',entities['encodeXML'](_0x5dfba1),entities[_0x7b9b('0x2d')](_0x1515b2[_0x5dfba1]));}}_0xa89f9d+=_0x7b9b('0x2e');return request({'method':_0x7b9b('0x2f'),'uri':util['format'](_0x7b9b('0x30'),_0x5e48de[_0x7b9b('0x31')]),'qs':{'authtoken':_0x5e48de[_0x7b9b('0x32')],'scope':_0x7b9b('0x33'),'xmlData':_0xa89f9d},'json':!![]})['then'](function(_0x2d422a){_0x2d422a=JSON[_0x7b9b('0x34')](parser[_0x7b9b('0x35')](_0x2d422a));if(_0x2d422a[_0x7b9b('0x36')]){if(_0x2d422a[_0x7b9b('0x36')][_0x7b9b('0x37')]&&_0x2d422a[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x38')]){logger[_0x7b9b('0xc')]('Call\x20created!');return{'id':_0x2d422a['response']['result']['recorddetail']['FL'][0x0]['$t']};}}throw new Error(_0x7b9b('0x39')+JSON[_0x7b9b('0x3a')](_0x2d422a));});}function getUser(_0x23af94,_0x5c77e1){return request({'method':_0x7b9b('0x3b'),'uri':util[_0x7b9b('0x22')](_0x7b9b('0x3c'),_0x23af94['host']),'qs':{'type':_0x7b9b('0x3d'),'authtoken':_0x23af94[_0x7b9b('0x32')],'scope':'crmapi'},'json':!![]})[_0x7b9b('0x3e')](function(_0x3b3222){if(_0x3b3222[_0x7b9b('0x3f')]&&_0x3b3222['users'][_0x7b9b('0x40')]){var _0x10d21f;console['log'](_0x7b9b('0x41'),_0x3b3222[_0x7b9b('0x3f')][_0x7b9b('0x40')]);if(_['isArrayLikeObject'](_0x3b3222[_0x7b9b('0x3f')]['user'])){console[_0x7b9b('0x42')](_0x7b9b('0x41'),_0x3b3222[_0x7b9b('0x3f')][_0x7b9b('0x40')]);if(!_['isNil'](_0x5c77e1)){_0x10d21f=_[_0x7b9b('0x43')](_0x3b3222[_0x7b9b('0x3f')][_0x7b9b('0x40')],{'email':_0x5c77e1,'profile':_0x7b9b('0x44'),'status':_0x7b9b('0x45')});}if(!_[_0x7b9b('0x46')](_0x10d21f)){logger['info']('Agent\x20found!');}else{logger[_0x7b9b('0xc')](_0x7b9b('0x47'));_0x10d21f=_[_0x7b9b('0x43')](_0x3b3222[_0x7b9b('0x3f')]['user'],{'profile':'Administrator'});}console['log'](_0x7b9b('0x48'),_0x10d21f);return _0x10d21f;}else{if(_0x3b3222[_0x7b9b('0x3f')][_0x7b9b('0x40')][_0x7b9b('0x49')]===_0x7b9b('0x4a')){logger[_0x7b9b('0xc')](_0x7b9b('0x47'));_0x10d21f=_0x3b3222['users'][_0x7b9b('0x40')];return _0x10d21f;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x7b9b('0x3a')](_0x3b3222));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x3b3222));}}}else{logger[_0x7b9b('0x4b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x3b3222));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7b9b('0x3a')](_0x3b3222));}});}function getEndUser(_0x451619,_0x51118a,_0x1f794d){logger[_0x7b9b('0xc')](_0x7b9b('0x4c'),_0x1f794d);return request({'method':'GET','uri':util[_0x7b9b('0x22')](_0x7b9b('0x4d'),_0x451619[_0x7b9b('0x31')]),'qs':{'authtoken':_0x451619[_0x7b9b('0x32')],'scope':_0x7b9b('0x33'),'criteria':util[_0x7b9b('0x22')](_0x7b9b('0x4e'),_0x1f794d)},'json':!![]})[_0x7b9b('0x3e')](function(_0x1bf84f){if(_0x1bf84f[_0x7b9b('0x36')]&&_0x1bf84f['response']['result']){logger[_0x7b9b('0xc')]('Enduser\x20found\x20in\x20Contacts!');var _0x12b184={};var _0x511564=_0x1bf84f['response'][_0x7b9b('0x37')]['Contacts'][_0x7b9b('0x4f')]['no']?_0x1bf84f[_0x7b9b('0x36')]['result']['Contacts'][_0x7b9b('0x4f')]['FL']:_0x1bf84f[_0x7b9b('0x36')]['result'][_0x7b9b('0x50')][_0x7b9b('0x4f')][0x0]['FL'];for(var _0x14df88=0x0,_0x29eb3b=_0x511564[_0x7b9b('0x51')];_0x14df88<_0x29eb3b;_0x14df88++){_0x12b184[_0x511564[_0x14df88]['val']]=_0x511564[_0x14df88]['content'];}return _0x12b184;}else{return request({'method':'GET','uri':util['format'](_0x7b9b('0x52'),_0x451619['host']),'qs':{'authtoken':_0x451619[_0x7b9b('0x32')],'scope':_0x7b9b('0x33'),'criteria':util[_0x7b9b('0x22')](_0x7b9b('0x4e'),_0x1f794d)},'json':!![]})['then'](function(_0x3f28c0){if(_0x3f28c0[_0x7b9b('0x36')]&&_0x3f28c0[_0x7b9b('0x36')][_0x7b9b('0x37')]){logger['info'](_0x7b9b('0x53'));var _0x49924a={};var _0x5c60e0=_0x3f28c0[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x54')][_0x7b9b('0x4f')]['no']?_0x3f28c0[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x54')][_0x7b9b('0x4f')]['FL']:_0x3f28c0[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x54')][_0x7b9b('0x4f')][0x0]['FL'];for(var _0x56f973=0x0,_0x3dd73c=_0x5c60e0[_0x7b9b('0x51')];_0x56f973<_0x3dd73c;_0x56f973++){_0x49924a[_0x5c60e0[_0x56f973][_0x7b9b('0x55')]]=_0x5c60e0[_0x56f973][_0x7b9b('0x56')];}return _0x49924a;}else{logger[_0x7b9b('0xc')](_0x7b9b('0x57'));_0x51118a=getName(_0x51118a);return request({'method':_0x7b9b('0x2f'),'uri':util[_0x7b9b('0x22')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x451619['host']),'qs':{'authtoken':_0x451619['authToken'],'scope':_0x7b9b('0x33'),'xmlData':util[_0x7b9b('0x22')]('%s%s%s',entities[_0x7b9b('0x2d')](_0x51118a[0x0]),entities[_0x7b9b('0x2d')](_0x51118a[0x1]),_0x1f794d)},'json':!![]})[_0x7b9b('0x3e')](function(_0x124731){_0x124731=JSON[_0x7b9b('0x34')](parser[_0x7b9b('0x35')](_0x124731));if(_0x124731[_0x7b9b('0x36')]){if(_0x124731[_0x7b9b('0x36')][_0x7b9b('0x37')]&&_0x124731[_0x7b9b('0x36')][_0x7b9b('0x37')]['recorddetail']){logger[_0x7b9b('0xc')](_0x7b9b('0x58'));return request({'method':'GET','uri':util[_0x7b9b('0x22')](_0x7b9b('0x59'),_0x451619[_0x7b9b('0x31')]),'qs':{'authtoken':_0x451619[_0x7b9b('0x32')],'scope':_0x7b9b('0x33'),'id':_0x124731[_0x7b9b('0x36')][_0x7b9b('0x37')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0x7b9b('0x3a')](_0x124731));})['then'](function(_0x3faa54){if(_0x3faa54['response']){if(_0x3faa54[_0x7b9b('0x36')]['result']){var _0x105e6e={};for(var _0x1155db=0x0,_0x6d5d3b=_0x3faa54[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x54')][_0x7b9b('0x4f')]['FL'][_0x7b9b('0x51')];_0x1155db<_0x6d5d3b;_0x1155db++){_0x105e6e[_0x3faa54[_0x7b9b('0x36')][_0x7b9b('0x37')][_0x7b9b('0x54')]['row']['FL'][_0x1155db][_0x7b9b('0x55')]]=_0x3faa54[_0x7b9b('0x36')]['result'][_0x7b9b('0x54')][_0x7b9b('0x4f')]['FL'][_0x1155db][_0x7b9b('0x56')];}return _0x105e6e;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON['stringify'](_0x3faa54));});}});}});}function request(_0xa77b5){logger[_0x7b9b('0x5a')](_0x7b9b('0x5b'),JSON[_0x7b9b('0x3a')](_0xa77b5));return rp(_0xa77b5);}function getCustomFields(_0x2617f7,_0x3fd14a){var _0x483774={};if(_0x2617f7[_0x7b9b('0x51')]>0x0){_[_0x7b9b('0x5c')](_0x2617f7,function(_0x4ea0b1){if(_0x4ea0b1[_0x7b9b('0x5d')]===_0x7b9b('0x5e')&&_0x4ea0b1[_0x7b9b('0x5f')]){_0x483774[_0x4ea0b1[_0x7b9b('0x5f')]]=_0x4ea0b1['content'][_0x7b9b('0x60')]();}else if(_0x4ea0b1[_0x7b9b('0x5d')]===_0x7b9b('0x61')&&_0x4ea0b1[_0x7b9b('0x62')]&&_0x4ea0b1[_0x7b9b('0x5f')]&&_0x3fd14a[_0x4ea0b1[_0x7b9b('0x62')]]){_0x483774[_0x4ea0b1[_0x7b9b('0x5f')]]=_0x3fd14a[_0x4ea0b1[_0x7b9b('0x62')]][_0x7b9b('0x60')]();}else if(_0x4ea0b1['type']===_0x7b9b('0x63')&&_0x4ea0b1[_0x7b9b('0x64')]&&_0x4ea0b1['Variable'][_0x7b9b('0x65')]&&_0x4ea0b1['idField']&&_0x3fd14a[_0x4ea0b1[_0x7b9b('0x64')][_0x7b9b('0x65')]['toLowerCase']()]){_0x483774[_0x4ea0b1[_0x7b9b('0x5f')]]=_0x3fd14a[_0x4ea0b1[_0x7b9b('0x64')][_0x7b9b('0x65')][_0x7b9b('0x66')]()][_0x7b9b('0x60')]();}});}return _0x483774;}function getName(_0x5f4580){if(_0x5f4580[_0x7b9b('0x67')]('\x20')>0x0){var _0x48bc04=_0x5f4580[_0x7b9b('0x68')](/ (.+)/);if(_0x48bc04[0x1]){return _0x48bc04;}}return[_0x5f4580,_0x5f4580];}exports['queue']=function(_0x12e7b2,_0x1dd928,_0x56c9b0,_0x21ee22,_0x5b4d4c,_0x34323a){var _0x9822d2,_0x47cefc;_0x34323a[_0x7b9b('0x31')]=intUtil[_0x7b9b('0x69')](_0x34323a['host']);_0x34323a[_0x7b9b('0x6a')]=intUtil[_0x7b9b('0x69')](_0x34323a[_0x7b9b('0x6a')]);if(_0x5b4d4c&&_0x5b4d4c[_0x7b9b('0x6b')]){logger[_0x7b9b('0xc')](_0x7b9b('0x6c'),_0x7b9b('0x6d'));_0x1dd928['recordingURL']=util[_0x7b9b('0x22')](_0x7b9b('0x6e'),_0x34323a[_0x7b9b('0x6a')],_0x1dd928[_0x7b9b('0x6f')],md5(_0x1dd928[_0x7b9b('0x6f')]));}else{_0x1dd928[_0x7b9b('0x70')]='';}return getUser(_0x34323a,_0x21ee22[_0x7b9b('0x71')])[_0x7b9b('0x3e')](function(_0x1429c7){_0x9822d2=_0x1429c7;logger[_0x7b9b('0xc')](_0x7b9b('0x72'),_0x9822d2['id']);return getEndUser(_0x34323a,_0x1dd928[_0x7b9b('0x73')],_0x1dd928[_0x7b9b('0x74')]);})[_0x7b9b('0x3e')](function(_0x1d6bf4){_0x47cefc=_0x1d6bf4;logger['info']('The\x20Enduser\x20ID\x20is:',_0x47cefc[_0x7b9b('0x28')]||_0x47cefc[_0x7b9b('0x29')]);return getCall(_0x34323a,_0x9822d2,_0x47cefc,_0x56c9b0,_0x1dd928,'Inbound');})['then'](function(_0xa6405b){if(_0xa6405b){logger['info'](_0x7b9b('0x75'),_0xa6405b['id']);logger[_0x7b9b('0xc')](_0x7b9b('0x6c'),_0x7b9b('0x76'));emit(util['format'](_0x7b9b('0x77'),_0x21ee22[_0x7b9b('0x65')]),'trigger:browser:url',{'uri':util[_0x7b9b('0x22')](_0x7b9b('0x78'),_0x34323a[_0x7b9b('0x31')],_0xa6405b['id'])});}})[_0x7b9b('0x79')](function(_0x45dff0){logger[_0x7b9b('0x4b')](_0x7b9b('0x6c'),JSON[_0x7b9b('0x3a')](_0x45dff0));});};exports['outbound']=function(_0x2f1200,_0x5489bb,_0x3c92a2,_0x195846,_0x4a5090,_0x40f832,_0x57fc51){var _0x1fa2a9,_0x2568f7;_0x40f832[_0x7b9b('0x31')]=intUtil['stripTrailingSlash'](_0x40f832[_0x7b9b('0x31')]);_0x40f832['serverUrl']=intUtil[_0x7b9b('0x69')](_0x40f832[_0x7b9b('0x6a')]);if(_0x57fc51&&_0x57fc51['recordingFormat']&&_0x57fc51['recordingFormat']!==_0x7b9b('0x7a')){logger['info'](_0x7b9b('0x7b'),_0x7b9b('0x6d'));_0x5489bb['recordingURL']=util[_0x7b9b('0x22')](_0x7b9b('0x6e'),_0x40f832[_0x7b9b('0x6a')],_0x5489bb['uniqueid'],md5(_0x5489bb[_0x7b9b('0x6f')]));}return getUser(_0x40f832,_0x195846[_0x7b9b('0x71')])[_0x7b9b('0x3e')](function(_0x4b4a07){_0x1fa2a9=_0x4b4a07;logger[_0x7b9b('0xc')](_0x7b9b('0x72'),_0x1fa2a9['id']);return getEndUser(_0x40f832,_0x5489bb['destcalleridname'],_0x5489bb[_0x7b9b('0x7c')]);})[_0x7b9b('0x3e')](function(_0x147614){_0x2568f7=_0x147614;logger[_0x7b9b('0xc')](_0x7b9b('0x7d'),_0x2568f7[_0x7b9b('0x28')]||_0x2568f7[_0x7b9b('0x29')]);return getCall(_0x40f832,_0x1fa2a9,_0x2568f7,_0x3c92a2,_0x5489bb,_0x7b9b('0x7e'));})[_0x7b9b('0x3e')](function(_0x5a8fec){if(_0x5a8fec){logger[_0x7b9b('0xc')](_0x7b9b('0x75'),_0x5a8fec['id']);logger[_0x7b9b('0xc')](_0x7b9b('0x7b'),_0x7b9b('0x76'));emit(util[_0x7b9b('0x22')]('user:%s',_0x195846[_0x7b9b('0x65')]),_0x7b9b('0x7f'),{'uri':util[_0x7b9b('0x22')](_0x7b9b('0x78'),_0x40f832[_0x7b9b('0x31')],_0x5a8fec['id'])});}})[_0x7b9b('0x79')](function(_0x7affc4){logger[_0x7b9b('0x4b')](_0x7b9b('0x7b'),JSON[_0x7b9b('0x3a')](_0x7affc4));});};exports[_0x7b9b('0x80')]=function(_0x3a5064,_0x3a3cb4,_0x385748,_0xfde8eb,_0x52275f,_0x1d555d){var _0x41e902,_0x326496;_0x1d555d[_0x7b9b('0x31')]=intUtil['stripTrailingSlash'](_0x1d555d[_0x7b9b('0x31')]);_0x1d555d[_0x7b9b('0x6a')]=intUtil[_0x7b9b('0x69')](_0x1d555d[_0x7b9b('0x6a')]);if(_0x52275f&&_0x52275f[_0x7b9b('0x6b')]){logger[_0x7b9b('0xc')](_0x7b9b('0x81'),_0x7b9b('0x6d'));_0x3a3cb4[_0x7b9b('0x70')]=util[_0x7b9b('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d555d[_0x7b9b('0x6a')],_0x3a3cb4[_0x7b9b('0x6f')],md5(_0x3a3cb4[_0x7b9b('0x6f')]));}else{_0x3a3cb4[_0x7b9b('0x70')]='';}return getUser(_0x1d555d)['then'](function(_0x1ddde8){_0x41e902=_0x1ddde8;logger[_0x7b9b('0xc')](_0x7b9b('0x72'),_0x41e902['id']);return getEndUser(_0x1d555d,_0x3a3cb4[_0x7b9b('0x73')],_0x3a3cb4[_0x7b9b('0x74')]);})['then'](function(_0x32eb9f){_0x326496=_0x32eb9f;logger[_0x7b9b('0xc')](_0x7b9b('0x7d'),_0x326496[_0x7b9b('0x28')]||_0x326496[_0x7b9b('0x29')]);return getCall(_0x1d555d,_0x41e902,_0x326496,_0x385748,_0x3a3cb4,_0x7b9b('0x82'));})[_0x7b9b('0x3e')](function(_0x1664c8){if(_0x1664c8){logger[_0x7b9b('0xc')](_0x7b9b('0x75'),_0x1664c8['id']);}})[_0x7b9b('0x79')](function(_0x2604e2){logger[_0x7b9b('0x4b')](_0x7b9b('0x81'),JSON[_0x7b9b('0x3a')](_0x2604e2));});}; \ 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 ac961dd..770c02f 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(_0x4b3ca7,_0x1f3bef){var _0x208ed1=function(_0x5a93fd){while(--_0x5a93fd){_0x4b3ca7['push'](_0x4b3ca7['shift']());}};_0x208ed1(++_0x1f3bef);}(_0x7a54,0x106));var _0x47a5=function(_0x5dfedb,_0x52884b){_0x5dfedb=_0x5dfedb-0x0;var _0x223b0c=_0x7a54[_0x5dfedb];return _0x223b0c;};'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(_0x3eda95,_0x5a1f52){var _0x423a19=function(_0x353344){while(--_0x353344){_0x3eda95['push'](_0x3eda95['shift']());}};_0x423a19(++_0x5a1f52);}(_0x7a54,0x106));var _0x47a5=function(_0x346edf,_0x4a8743){_0x346edf=_0x346edf-0x0;var _0x232094=_0x7a54[_0x346edf];return _0x232094;};'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 f1501f7..adff44c 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 _0xf682=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','exec','data1','toUpperCase','render','headers','data6','error','stack','GET','POST','PUT','data7','body','parse','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode'];(function(_0x1b88df,_0x4a8a75){var _0x47e210=function(_0x404454){while(--_0x404454){_0x1b88df['push'](_0x1b88df['shift']());}};_0x47e210(++_0x4a8a75);}(_0xf682,0x12f));var _0x2f68=function(_0x4819ef,_0x253492){_0x4819ef=_0x4819ef-0x0;var _0x9f429=_0xf682[_0x4819ef];return _0x9f429;};'use strict';var rp=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var _=require(_0x2f68('0x2'));var Mustache=require(_0x2f68('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0x2f68('0x4')]=function(_0x260814,_0x1703e0){var _0x39c412,_0x4a1466;var _0x382bd8={'method':_0x260814[_0x2f68('0x5')][_0x2f68('0x6')](),'uri':encodeURI(Mustache[_0x2f68('0x7')](_0x260814['data2'],_0x1703e0)),'json':!![],'resolveWithFullResponse':!![]};try{_0x382bd8[_0x2f68('0x8')]=_0x260814[_0x2f68('0x9')]?JSON['parse'](Mustache['render'](_0x260814['data6'],_0x1703e0)):{};}catch(_0x57a6b0){logger[_0x2f68('0xa')](_0x57a6b0[_0x2f68('0xb')]);}switch(_0x260814[_0x2f68('0x5')][_0x2f68('0x6')]()){case _0x2f68('0xc'):_0x382bd8['qs']=_0x1703e0;break;case _0x2f68('0xd'):case _0x2f68('0xe'):_0x39c412={};if(_0x260814[_0x2f68('0xf')]){_0x39c412=Mustache[_0x2f68('0x7')](_0x260814[_0x2f68('0xf')],_0x1703e0);}else{_0x39c412=_0x1703e0;}_0x382bd8[_0x2f68('0x10')]=JSON[_0x2f68('0x11')](_0x39c412);break;}logger[_0x2f68('0x12')](util[_0x2f68('0x13')](_0x2f68('0x14'),_0x260814[_0x2f68('0x5')],_0x260814['data2'],JSON[_0x2f68('0x15')](_0x382bd8)));rp(_0x382bd8)[_0x2f68('0x16')](function(_0x455ab1){_0x39c412=!_[_0x2f68('0x17')](_0x39c412)?_0x2f68('0x18')+_0x39c412:'';_0x4a1466=typeof _0x455ab1[_0x2f68('0x10')]===_0x2f68('0x19')?JSON[_0x2f68('0x15')](_0x455ab1['body']):_0x455ab1[_0x2f68('0x10')];logger[_0x2f68('0x12')](util[_0x2f68('0x13')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x260814[_0x2f68('0x5')],_0x260814['data2'],_0x455ab1[_0x2f68('0x1a')],_0x4a1466));})['catch'](function(_0x36abc4){logger[_0x2f68('0xa')](util[_0x2f68('0x13')](_0x2f68('0x1b'),_0x260814[_0x2f68('0x5')],_0x260814['data2'],_0x36abc4[_0x2f68('0x1a')],_0x36abc4[_0x2f68('0x1c')],_0x36abc4[_0x2f68('0x1d')]));});}; \ No newline at end of file +var _0xb75c=['info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','stringify','then','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','exec','toUpperCase','render','data2','data6','stack','POST','data7','body'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb75c,0x1ce));var _0xcb75=function(_0x5afd5b,_0x21a5a0){_0x5afd5b=_0x5afd5b-0x0;var _0x31e0d3=_0xb75c[_0x5afd5b];return _0x31e0d3;};'use strict';var rp=require(_0xcb75('0x0'));var util=require(_0xcb75('0x1'));var _=require(_0xcb75('0x2'));var Mustache=require('mustache');var logger=require(_0xcb75('0x3'))('trigger');exports[_0xcb75('0x4')]=function(_0x12aaaa,_0x390961){var _0x4a39a6,_0x2364fd;var _0x51e361={'method':_0x12aaaa['data1'][_0xcb75('0x5')](),'uri':encodeURI(Mustache[_0xcb75('0x6')](_0x12aaaa[_0xcb75('0x7')],_0x390961)),'json':!![],'resolveWithFullResponse':!![]};try{_0x51e361['headers']=_0x12aaaa['data6']?JSON['parse'](Mustache[_0xcb75('0x6')](_0x12aaaa[_0xcb75('0x8')],_0x390961)):{};}catch(_0x20b642){logger['error'](_0x20b642[_0xcb75('0x9')]);}switch(_0x12aaaa['data1'][_0xcb75('0x5')]()){case'GET':_0x51e361['qs']=_0x390961;break;case _0xcb75('0xa'):case'PUT':_0x4a39a6={};if(_0x12aaaa[_0xcb75('0xb')]){_0x4a39a6=Mustache[_0xcb75('0x6')](_0x12aaaa[_0xcb75('0xb')],_0x390961);}else{_0x4a39a6=_0x390961;}_0x51e361[_0xcb75('0xc')]=JSON['parse'](_0x4a39a6);break;}logger[_0xcb75('0xd')](util[_0xcb75('0xe')](_0xcb75('0xf'),_0x12aaaa[_0xcb75('0x10')],_0x12aaaa[_0xcb75('0x7')],JSON[_0xcb75('0x11')](_0x51e361)));rp(_0x51e361)[_0xcb75('0x12')](function(_0x2c14a1){_0x4a39a6=!_['isNil'](_0x4a39a6)?',\x20request\x20body:\x20'+_0x4a39a6:'';_0x2364fd=typeof _0x2c14a1[_0xcb75('0xc')]===_0xcb75('0x13')?JSON['stringify'](_0x2c14a1[_0xcb75('0xc')]):_0x2c14a1[_0xcb75('0xc')];logger['info'](util[_0xcb75('0xe')](_0xcb75('0x14'),_0x12aaaa[_0xcb75('0x10')],_0x12aaaa[_0xcb75('0x7')],_0x2c14a1['statusCode'],_0x2364fd));})[_0xcb75('0x15')](function(_0x32a66f){logger['error'](util[_0xcb75('0xe')](_0xcb75('0x16'),_0x12aaaa[_0xcb75('0x10')],_0x12aaaa[_0xcb75('0x7')],_0x32a66f['statusCode'],_0x32a66f[_0xcb75('0x17')],_0x32a66f[_0xcb75('0x18')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8502d92..2eaba0f 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 _0x7f42=['error','message','result','catch','jayson/promise','../../config/logger','routing','http','request','debug','rpc'];(function(_0x43e2fb,_0x34b25b){var _0x2e9ffb=function(_0xf869fd){while(--_0xf869fd){_0x43e2fb['push'](_0x43e2fb['shift']());}};_0x2e9ffb(++_0x34b25b);}(_0x7f42,0x1dd));var _0x27f4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7f42[_0x4a9fb1];return _0x348672;};'use strict';var jayson=require(_0x27f4('0x0'));var BPromise=require('bluebird');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var client=jayson['client'][_0x27f4('0x3')]({'port':0x2329});client['Request']=function(_0x10627e,_0x4e1ac1){return new BPromise(function(_0x2ca4b0,_0x55ed40){return client[_0x27f4('0x4')](_0x10627e,_0x4e1ac1)['then'](function(_0x256ac9){logger[_0x27f4('0x5')](_0x27f4('0x6'),_0x27f4('0x2'),_0x10627e,_0x4e1ac1,_0x256ac9);if(_0x256ac9[_0x27f4('0x7')]){logger[_0x27f4('0x7')](_0x27f4('0x6'),_0x27f4('0x2'),_0x10627e,_0x256ac9[_0x27f4('0x7')][_0x27f4('0x8')],_0x4e1ac1);return _0x55ed40(_0x256ac9[_0x27f4('0x7')][_0x27f4('0x8')]);}else{return _0x2ca4b0(_0x256ac9[_0x27f4('0x9')]);}})[_0x27f4('0xa')](function(_0x3b1d50){logger[_0x27f4('0x7')](_0x27f4('0x6'),_0x27f4('0x2'),_0x10627e,_0x3b1d50,_0x4e1ac1);return _0x55ed40(_0x3b1d50);});});};module['exports']=client; \ No newline at end of file +var _0x029b=['routing','client','Request','request','then','debug','error','message','result','rpc','exports','jayson/promise','bluebird'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x029b,0x66));var _0xb029=function(_0x46729c,_0x26a871){_0x46729c=_0x46729c-0x0;var _0x29092f=_0x029b[_0x46729c];return _0x29092f;};'use strict';var jayson=require(_0xb029('0x0'));var BPromise=require(_0xb029('0x1'));var logger=require('../../config/logger')(_0xb029('0x2'));var client=jayson[_0xb029('0x3')]['http']({'port':0x2329});client[_0xb029('0x4')]=function(_0xd6ac43,_0x5933af){return new BPromise(function(_0x58cdef,_0x9620bd){return client[_0xb029('0x5')](_0xd6ac43,_0x5933af)[_0xb029('0x6')](function(_0x448fc5){logger[_0xb029('0x7')]('rpc',_0xb029('0x2'),_0xd6ac43,_0x5933af,_0x448fc5);if(_0x448fc5['error']){logger[_0xb029('0x8')]('rpc',_0xb029('0x2'),_0xd6ac43,_0x448fc5['error'][_0xb029('0x9')],_0x5933af);return _0x9620bd(_0x448fc5['error'][_0xb029('0x9')]);}else{return _0x58cdef(_0x448fc5[_0xb029('0xa')]);}})['catch'](function(_0x266df5){logger[_0xb029('0x8')](_0xb029('0xb'),_0xb029('0x2'),_0xd6ac43,_0x266df5,_0x5933af);return _0x9620bd(_0x266df5);});});};module[_0xb029('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 0e8cc9e..72f1a0d 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 _0xef99=['catch','bluebird','./realtime','./rpc/mailAccount','resolve','getMailAccounts','then','mailAccounts','listen'];(function(_0x2295aa,_0x443e44){var _0x54213f=function(_0x94d2ac){while(--_0x94d2ac){_0x2295aa['push'](_0x2295aa['shift']());}};_0x54213f(++_0x443e44);}(_0xef99,0xb5));var _0x9ef9=function(_0x12fca9,_0x9321dc){_0x12fca9=_0x12fca9-0x0;var _0x4ecfa0=_0xef99[_0x12fca9];return _0x4ecfa0;};'use strict';var BPromise=require(_0x9ef9('0x0'));var server=require('./server');var Realtime=require(_0x9ef9('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x9ef9('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9ef9('0x3')]()['then'](mailAccount[_0x9ef9('0x4')]())[_0x9ef9('0x5')](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0x9ef9('0x6')]);return realtime;});}function main(){return server[_0x9ef9('0x7')](realtime,email)[_0x9ef9('0x5')](function(_0x4a0489){return initRealtime();})[_0x9ef9('0x5')](function(_0x2c46e9){return setInterval(initRealtime,0x2710);})[_0x9ef9('0x8')](function(_0x5ec980){console['log'](_0x5ec980);});}main(); \ No newline at end of file +var _0xe174=['./realtime','./lib/email','./rpc/mailAccount','resolve','then','initMailAccounts','refresh','mailAccounts','listen','catch','log','bluebird','./server'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0xe174,0xc1));var _0x4e17=function(_0x3eca3b,_0x4a2198){_0x3eca3b=_0x3eca3b-0x0;var _0xec2064=_0xe174[_0x3eca3b];return _0xec2064;};'use strict';var BPromise=require(_0x4e17('0x0'));var server=require(_0x4e17('0x1'));var Realtime=require(_0x4e17('0x2'));var EmailChannel=require(_0x4e17('0x3'));var mailAccount=require(_0x4e17('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4e17('0x5')]()[_0x4e17('0x6')](mailAccount['getMailAccounts']())[_0x4e17('0x6')](realtime[_0x4e17('0x7')]())[_0x4e17('0x6')](function(){email[_0x4e17('0x8')](realtime[_0x4e17('0x9')]);return realtime;});}function main(){return server[_0x4e17('0xa')](realtime,email)[_0x4e17('0x6')](function(_0x40e388){return initRealtime();})['then'](function(_0x315d40){return setInterval(initRealtime,0x2710);})[_0x4e17('0xb')](function(_0x32c40e){console[_0x4e17('0xc')](_0x32c40e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b4bfe44..dc2b9b1 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 _0x5f2f=['lastSync','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','box','bind','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','name','messages','handleImapEmail','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f2f,0x73));var _0xf5f2=function(_0x308146,_0x54dcc8){_0x308146=_0x308146-0x0;var _0x40a219=_0x5f2f[_0x308146];return _0x40a219;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var md5=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var config=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));config['redis']=_['defaults'](config[_0xf5f2('0x8')],{'host':_0xf5f2('0x9'),'port':0x18eb});var io=require(_0xf5f2('0xa'))(new Redis(config[_0xf5f2('0x8')]));var EmailImap=require(_0xf5f2('0xb'));var EmailSmtp=require(_0xf5f2('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x466882){logger[_0xf5f2('0xd')](_0xf5f2('0xe'));this['mailAccounts']=_0x466882[_0xf5f2('0xf')];this[_0xf5f2('0x10')]={};this[_0xf5f2('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xf5f2('0x12')]=function(_0x4ebbbe){var _0x53fb33=this[_0xf5f2('0xf')][_0x4ebbbe];var _0x151aba={'id':_0x53fb33['id'],'name':_0x53fb33['name'],'key':_0x53fb33[_0xf5f2('0x13')],'active':_0x53fb33[_0xf5f2('0x14')],'Imap':{'status':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x16')],'messageStatus':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x17')],'total':_0x53fb33['Imap'][_0xf5f2('0x18')]}};if(_[_0xf5f2('0x19')](md5Accounts[_0x4ebbbe])){md5Accounts[_0x4ebbbe]={};}var _0x269909=md5(JSON[_0xf5f2('0x1a')](_0x151aba));if(md5Accounts[_0x4ebbbe][_0xf5f2('0x3')]!==_0x269909){md5Accounts[_0x4ebbbe]['md5']=_0x269909;io[_0xf5f2('0x12')](_0xf5f2('0x1b'),_0x151aba);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x1d')]=function(_0x23e23a){for(var _0x3a9dbb in _0x23e23a){if(_0x23e23a[_0xf5f2('0x1e')](_0x3a9dbb)){if(_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')]&&_0x23e23a[_0x3a9dbb][_0xf5f2('0x14')]){var _0x228ace=_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')];if(!this[_0xf5f2('0x10')][_0xf5f2('0x1e')](_0x228ace['id'])){this[_0xf5f2('0x10')][_0x228ace['id']]=new EmailImap(_0x228ace,_0x23e23a[_0x3a9dbb][_0xf5f2('0x7')]);this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x1f'),this['handleImapBox'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('email',this['handleImapEmail'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('end',this[_0xf5f2('0x21')][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x22'),this[_0xf5f2('0x23')]['bind'](this,_0x3a9dbb));}}else{if(_[_0xf5f2('0x19')](this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')])){this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')]={};}this['mailAccounts'][_0x3a9dbb]['Imap'][_0xf5f2('0x16')]=_0xf5f2('0x24');this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')][_0xf5f2('0x17')]='';this[_0xf5f2('0x12')](_0x3a9dbb);}}}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x25')]=function(_0x294414,_0x4ab014){if(this[_0xf5f2('0xf')][_0x294414]){this[_0xf5f2('0xf')][_0x294414][_0xf5f2('0x15')][_0xf5f2('0x16')]=_0xf5f2('0x26');this[_0xf5f2('0xf')][_0x294414]['Imap']['messageStatus']=_0x4ab014[_0xf5f2('0x27')];if(_0x4ab014[_0xf5f2('0x28')]){this[_0xf5f2('0xf')][_0x294414]['Imap']['total']=_0x4ab014[_0xf5f2('0x28')][_0xf5f2('0x18')];}return this[_0xf5f2('0x12')](_0x294414);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x29')]=function(_0x54c0c8,_0x52e959){logger[_0xf5f2('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x52e959[_0xf5f2('0x2a')],_0x52e959['lastName'],_0x52e959[_0xf5f2('0x2b')],_0x54c0c8);if(this[_0xf5f2('0xf')][_0x54c0c8]){return mailAccount[_0xf5f2('0x2c')](_0x54c0c8,_0x52e959)[_0xf5f2('0x2d')](function(_0x256bd9){if(_0x256bd9){logger[_0xf5f2('0xd')](_0xf5f2('0x2e'));}})[_0xf5f2('0x2f')](function(_0x5ca917){logger[_0xf5f2('0x22')](_0xf5f2('0x30'),JSON[_0xf5f2('0x1a')](_0x5ca917));});}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x21')]=function(_0x27c0e7){if(this[_0xf5f2('0xf')][_0x27c0e7]&&this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]){if(this[_0xf5f2('0x10')][this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]['id']]){delete this['imapAccounts'][this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['id']];}this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['lastSync']=moment();this['emit'](_0x27c0e7);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x23')]=function(_0x20eb74,_0x4ec8fb){if(this[_0xf5f2('0xf')][_0x20eb74]){this['mailAccounts'][_0x20eb74][_0xf5f2('0x15')]['status']=_0xf5f2('0x22');this[_0xf5f2('0xf')][_0x20eb74]['Imap'][_0xf5f2('0x17')]=_0x4ec8fb;return this[_0xf5f2('0x12')](_0x20eb74);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x31')]=function(_0x542cd6,_0x5d2d82){return this[_0xf5f2('0x11')][_0xf5f2('0x32')](_0x542cd6,_0x5d2d82);};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x33')]=function(_0x2c7f65){var _0xe62b57=this;if(this[_0xf5f2('0xf')][_0x2c7f65['id']]){if(_['isNil'](this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')])){this['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')]={};}this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x35')]=moment();return new BPromise(function(_0xd10701,_0x3b6372){return _0xe62b57[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65)['then'](function(_0x31c3c){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')]['status']='verified';_0xe62b57['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]='';_0xe62b57['emit'](_0x2c7f65['id']);_0xd10701(_0x31c3c);})[_0xf5f2('0x2f')](function(_0xeed03d){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x16')]=_0xf5f2('0x22');_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]=_0xeed03d;_0xe62b57[_0xf5f2('0x12')](_0x2c7f65['id']);_0x3b6372(_0xeed03d);});});}return this[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65);};module[_0xf5f2('0x37')]=EmailChannel; \ No newline at end of file +var _0x4888=['handleImapEnd','error','handleImapError','connected','messageStatus','messages','info','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','isNil','mailAccount:update','refresh','hasOwnProperty','active','box','handleImapBox','bind','handleImapEmail','end'];(function(_0x9e8c25,_0x2c4ee3){var _0x130b1d=function(_0x4234cc){while(--_0x4234cc){_0x9e8c25['push'](_0x9e8c25['shift']());}};_0x130b1d(++_0x2c4ee3);}(_0x4888,0x198));var _0x8488=function(_0x530db1,_0x2b9531){_0x530db1=_0x530db1-0x0;var _0x31c1f2=_0x4888[_0x530db1];return _0x31c1f2;};'use strict';var _=require('lodash');var moment=require(_0x8488('0x0'));var BPromise=require(_0x8488('0x1'));var md5=require(_0x8488('0x2'));var Redis=require(_0x8488('0x3'));var config=require(_0x8488('0x4'));var logger=require(_0x8488('0x5'))(_0x8488('0x6'));config['redis']=_[_0x8488('0x7')](config[_0x8488('0x8')],{'host':_0x8488('0x9'),'port':0x18eb});var io=require(_0x8488('0xa'))(new Redis(config[_0x8488('0x8')]));var EmailImap=require(_0x8488('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x56aad0){logger['info'](_0x8488('0xc'));this[_0x8488('0xd')]=_0x56aad0['mailAccounts'];this[_0x8488('0xe')]={};this[_0x8488('0xf')]=new EmailSmtp();}EmailChannel[_0x8488('0x10')][_0x8488('0x11')]=function(_0x515ea8){var _0x377d3b=this[_0x8488('0xd')][_0x515ea8];var _0x468896={'id':_0x377d3b['id'],'name':_0x377d3b[_0x8488('0x12')],'key':_0x377d3b[_0x8488('0x13')],'active':_0x377d3b['active'],'Imap':{'status':_0x377d3b[_0x8488('0x14')][_0x8488('0x15')],'messageStatus':_0x377d3b['Imap']['messageStatus'],'total':_0x377d3b[_0x8488('0x14')]['total']}};if(_[_0x8488('0x16')](md5Accounts[_0x515ea8])){md5Accounts[_0x515ea8]={};}var _0x4e94fc=md5(JSON['stringify'](_0x468896));if(md5Accounts[_0x515ea8][_0x8488('0x2')]!==_0x4e94fc){md5Accounts[_0x515ea8][_0x8488('0x2')]=_0x4e94fc;io[_0x8488('0x11')](_0x8488('0x17'),_0x468896);}};EmailChannel[_0x8488('0x10')][_0x8488('0x18')]=function(_0x165139){for(var _0x4e44af in _0x165139){if(_0x165139[_0x8488('0x19')](_0x4e44af)){if(_0x165139[_0x4e44af][_0x8488('0x14')]&&_0x165139[_0x4e44af][_0x8488('0x1a')]){var _0x37361d=_0x165139[_0x4e44af][_0x8488('0x14')];if(!this[_0x8488('0xe')][_0x8488('0x19')](_0x37361d['id'])){this[_0x8488('0xe')][_0x37361d['id']]=new EmailImap(_0x37361d,_0x165139[_0x4e44af][_0x8488('0x6')]);this[_0x8488('0xe')][_0x37361d['id']]['on'](_0x8488('0x1b'),this[_0x8488('0x1c')][_0x8488('0x1d')](this,_0x4e44af));this['imapAccounts'][_0x37361d['id']]['on']('email',this[_0x8488('0x1e')][_0x8488('0x1d')](this,_0x4e44af));this[_0x8488('0xe')][_0x37361d['id']]['on'](_0x8488('0x1f'),this[_0x8488('0x20')][_0x8488('0x1d')](this,_0x4e44af));this[_0x8488('0xe')][_0x37361d['id']]['on'](_0x8488('0x21'),this[_0x8488('0x22')]['bind'](this,_0x4e44af));}}else{if(_[_0x8488('0x16')](this[_0x8488('0xd')][_0x4e44af][_0x8488('0x14')])){this[_0x8488('0xd')][_0x4e44af][_0x8488('0x14')]={};}this['mailAccounts'][_0x4e44af]['Imap']['status']='disabled';this[_0x8488('0xd')][_0x4e44af]['Imap']['messageStatus']='';this[_0x8488('0x11')](_0x4e44af);}}}};EmailChannel[_0x8488('0x10')][_0x8488('0x1c')]=function(_0x6ebee0,_0x287662){if(this['mailAccounts'][_0x6ebee0]){this[_0x8488('0xd')][_0x6ebee0][_0x8488('0x14')][_0x8488('0x15')]=_0x8488('0x23');this[_0x8488('0xd')][_0x6ebee0][_0x8488('0x14')][_0x8488('0x24')]=_0x287662[_0x8488('0x12')];if(_0x287662[_0x8488('0x25')]){this[_0x8488('0xd')][_0x6ebee0][_0x8488('0x14')]['total']=_0x287662['messages']['total'];}return this[_0x8488('0x11')](_0x6ebee0);}};EmailChannel[_0x8488('0x10')][_0x8488('0x1e')]=function(_0x121dcc,_0x117321){logger[_0x8488('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x117321[_0x8488('0x27')],_0x117321[_0x8488('0x28')],_0x117321[_0x8488('0x29')],_0x121dcc);if(this[_0x8488('0xd')][_0x121dcc]){return mailAccount[_0x8488('0x2a')](_0x121dcc,_0x117321)['then'](function(_0x46c95b){if(_0x46c95b){logger[_0x8488('0x26')]('Mail\x20accepted\x20from\x20routing');}})[_0x8488('0x2b')](function(_0x21dff0){logger[_0x8488('0x21')](_0x8488('0x2c'),JSON[_0x8488('0x2d')](_0x21dff0));});}};EmailChannel['prototype'][_0x8488('0x20')]=function(_0x1f3ea5){if(this[_0x8488('0xd')][_0x1f3ea5]&&this['mailAccounts'][_0x1f3ea5][_0x8488('0x14')]){if(this['imapAccounts'][this[_0x8488('0xd')][_0x1f3ea5][_0x8488('0x14')]['id']]){delete this[_0x8488('0xe')][this[_0x8488('0xd')][_0x1f3ea5]['Imap']['id']];}this[_0x8488('0xd')][_0x1f3ea5][_0x8488('0x14')][_0x8488('0x2e')]=moment();this['emit'](_0x1f3ea5);}};EmailChannel[_0x8488('0x10')][_0x8488('0x22')]=function(_0x387c6b,_0x3d257a){if(this[_0x8488('0xd')][_0x387c6b]){this[_0x8488('0xd')][_0x387c6b][_0x8488('0x14')][_0x8488('0x15')]=_0x8488('0x21');this[_0x8488('0xd')][_0x387c6b][_0x8488('0x14')]['messageStatus']=_0x3d257a;return this['emit'](_0x387c6b);}};EmailChannel[_0x8488('0x10')][_0x8488('0x2f')]=function(_0x3abb68,_0x390a17){return this[_0x8488('0xf')][_0x8488('0x30')](_0x3abb68,_0x390a17);};EmailChannel[_0x8488('0x10')][_0x8488('0x31')]=function(_0x1dab58){var _0x5f561c=this;if(this[_0x8488('0xd')][_0x1dab58['id']]){if(_[_0x8488('0x16')](this[_0x8488('0xd')][_0x1dab58['id']]['Smtp'])){this[_0x8488('0xd')][_0x1dab58['id']][_0x8488('0x32')]={};}this[_0x8488('0xd')][_0x1dab58['id']][_0x8488('0x32')][_0x8488('0x2e')]=moment();return new BPromise(function(_0x156246,_0x1aac4b){return _0x5f561c['smtp'][_0x8488('0x33')](_0x1dab58)[_0x8488('0x34')](function(_0x891cff){_0x5f561c['mailAccounts'][_0x1dab58['id']][_0x8488('0x32')]['status']=_0x8488('0x35');_0x5f561c[_0x8488('0xd')][_0x1dab58['id']]['Smtp'][_0x8488('0x24')]='';_0x5f561c[_0x8488('0x11')](_0x1dab58['id']);_0x156246(_0x891cff);})[_0x8488('0x2b')](function(_0x25ef13){_0x5f561c[_0x8488('0xd')][_0x1dab58['id']]['Smtp'][_0x8488('0x15')]='error';_0x5f561c[_0x8488('0xd')][_0x1dab58['id']][_0x8488('0x32')][_0x8488('0x24')]=_0x25ef13;_0x5f561c[_0x8488('0x11')](_0x1dab58['id']);_0x1aac4b(_0x25ef13);});});}return this[_0x8488('0xf')][_0x8488('0x33')](_0x1dab58);};module[_0x8488('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 48fac72..a7a29ea 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 _0xcc8d=['handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','port','tls','autotls','required','password','host','getHost','anonymous@xcally.com','prototype','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd'];(function(_0x57af9b,_0x34bc){var _0x2b64eb=function(_0x244640){while(--_0x244640){_0x57af9b['push'](_0x57af9b['shift']());}};_0x2b64eb(++_0x34bc);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0xcc8d[_0x22b70f];return _0x100985;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xdcc8('0x0'));var Imap=require(_0xdcc8('0x1'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0xdcc8('0x2'))[_0xdcc8('0x3')];var Iconv=require(_0xdcc8('0x4'))[_0xdcc8('0x5')];var EventEmitter=require(_0xdcc8('0x6'))[_0xdcc8('0x7')];var utils=require(_0xdcc8('0x8'));var logger=require('../../../config/logger')(_0xdcc8('0x9'));function EmailImap(_0xfeebba,_0x10dd63){this[_0xdcc8('0xa')]=_0xdcc8('0xb');this['account']=this[_0xdcc8('0xc')](_0xfeebba,_0x10dd63);this[_0xdcc8('0x1')]=new Imap(this[_0xdcc8('0xd')]);this[_0xdcc8('0x1')][_0xdcc8('0xe')](_0xdcc8('0xf'),this[_0xdcc8('0x10')][_0xdcc8('0x11')](this));this[_0xdcc8('0x1')][_0xdcc8('0xe')](_0xdcc8('0x12'),this[_0xdcc8('0x13')]['bind'](this));this[_0xdcc8('0x1')]['on'](_0xdcc8('0x14'),this['handleError'][_0xdcc8('0x11')](this));this[_0xdcc8('0x1')][_0xdcc8('0x15')]();}util[_0xdcc8('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xdcc8('0xc')]=function(_0x446b5c,_0x52ba88){var _0x2bd45c={'connTimeout':_0x446b5c['connTimeout']?_0x446b5c[_0xdcc8('0x17')]*0x3e8:0x2710,'authTimeout':_0x446b5c[_0xdcc8('0x18')]?_0x446b5c[_0xdcc8('0x18')]*0x3e8:0x1388};if(_[_0xdcc8('0x19')](_0x446b5c[_0xdcc8('0x1a')])){if(_0x446b5c[_0xdcc8('0x1b')]){_0x2bd45c[_0xdcc8('0x1c')]=_0x446b5c['user'];_0x2bd45c['password']=_0x446b5c['password'];}_0x2bd45c['host']=_0x446b5c['host'];_0x2bd45c[_0xdcc8('0x1d')]=_0x446b5c['port']||0x3e1;if(_0x446b5c[_0xdcc8('0x1e')]){_0x2bd45c[_0xdcc8('0x1e')]=!![];}else{_0x2bd45c[_0xdcc8('0x1e')]=![];_0x2bd45c[_0xdcc8('0x1f')]=_0xdcc8('0x20');}}else{_0x2bd45c['user']=_0x446b5c['user'];_0x2bd45c[_0xdcc8('0x21')]=_0x446b5c[_0xdcc8('0x21')];_0x2bd45c[_0xdcc8('0x22')]=utils[_0xdcc8('0x23')](_0x446b5c[_0xdcc8('0x1a')]);_0x2bd45c[_0xdcc8('0x1d')]=0x3e1;_0x2bd45c[_0xdcc8('0x1e')]=!![];}_0x2bd45c[_0xdcc8('0x9')]=_0x52ba88||_0x446b5c[_0xdcc8('0x1c')]||_0xdcc8('0x24');return _0x2bd45c;};EmailImap[_0xdcc8('0x25')]['handleReady']=function(){this['imap']['openBox'](this['mailbox'],![],this[_0xdcc8('0x26')][_0xdcc8('0x11')](this));};EmailImap[_0xdcc8('0x25')][_0xdcc8('0x26')]=function(_0x1f7c0a,_0x2271d7){if(_0x1f7c0a){this[_0xdcc8('0x27')](_0x1f7c0a,!![]);}else{this[_0xdcc8('0x28')](_0xdcc8('0x29'),_0x2271d7);this[_0xdcc8('0x2a')]();}};EmailImap['prototype'][_0xdcc8('0x2b')]=function(_0x938201){if(_0x938201){this[_0xdcc8('0x27')](_0x938201,!![]);}else{this['imap'][_0xdcc8('0x12')]();}};EmailImap['prototype'][_0xdcc8('0x2a')]=function(){this[_0xdcc8('0x1')][_0xdcc8('0x2c')]([_0xdcc8('0x2d')],this[_0xdcc8('0x2e')]['bind'](this));};EmailImap[_0xdcc8('0x25')][_0xdcc8('0x2e')]=function(_0x3aba80,_0x4722f9){if(_0x3aba80){this['handleError'](_0x3aba80,!![]);}else{if(_0x4722f9['length']){try{var _0x3bd04b=this[_0xdcc8('0x1')]['fetch'](_0x4722f9,{'bodies':'','markSeen':!![]});_0x3bd04b['on'](_0xdcc8('0x2f'),this['handleFetchMessage'][_0xdcc8('0x11')](this));_0x3bd04b['once'](_0xdcc8('0x14'),this['handleFetchError'][_0xdcc8('0x11')](this));_0x3bd04b[_0xdcc8('0xe')](_0xdcc8('0x12'),this['handleFetchEnd'][_0xdcc8('0x11')](this));}catch(_0x599eb2){logger[_0xdcc8('0x14')](_0x599eb2);}}else{this[_0xdcc8('0x1')]['closeBox'](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xdcc8('0x25')][_0xdcc8('0x30')]=function(_0x2e506a,_0x1e6bf7){_0x2e506a['on'](_0xdcc8('0x31'),this[_0xdcc8('0x32')][_0xdcc8('0x11')](this));_0x2e506a[_0xdcc8('0xe')]('attributes',this[_0xdcc8('0x33')]['bind'](this));_0x2e506a['once'](_0xdcc8('0x12'),this[_0xdcc8('0x34')]['bind'](this));};EmailImap[_0xdcc8('0x25')]['handleMessageBody']=function(_0x14b6c3,_0x23f6a3){simpleParser(_0x14b6c3,{'Iconv':Iconv},this[_0xdcc8('0x35')][_0xdcc8('0x11')](this));};EmailImap[_0xdcc8('0x25')]['handleMessageAttributes']=function(_0x15538a){};EmailImap['prototype'][_0xdcc8('0x34')]=function(){};EmailImap['prototype'][_0xdcc8('0x35')]=function(_0x374df4,_0x1c1b0d){if(_0x374df4){logger[_0xdcc8('0x14')](_0x374df4);}else{var _0x54c73a=this;utils[_0xdcc8('0x36')](this[_0xdcc8('0xd')],_0x1c1b0d,function(_0x2fbc18){_0x54c73a[_0xdcc8('0x28')]('email',_0x2fbc18);});}};EmailImap[_0xdcc8('0x25')]['handleFetchEnd']=function(){this[_0xdcc8('0x1')][_0xdcc8('0x37')](!![],this[_0xdcc8('0x2b')]['bind'](this));};EmailImap[_0xdcc8('0x25')]['handleFetchError']=function(_0x1c2c10){this[_0xdcc8('0x27')](_0x1c2c10);this[_0xdcc8('0x1')]['closeBox'](!![],this[_0xdcc8('0x2b')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this[_0xdcc8('0x28')]('end');};EmailImap[_0xdcc8('0x25')]['handleError']=function(_0x380e71,_0x37a395){logger[_0xdcc8('0x14')](_0xdcc8('0x27'),this[_0xdcc8('0xd')][_0xdcc8('0x9')],JSON[_0xdcc8('0x38')](_0x380e71));var _0x4f3f75='';if(_0x380e71){if(_0x380e71['textCode']){_0x4f3f75=_0x380e71[_0xdcc8('0x39')];}else{for(var _0x2b1612 in _0x380e71){if(_0x380e71[_0xdcc8('0x3a')](_0x2b1612)){_0x4f3f75+=_['upperFirst'](_0x2b1612)+':\x20'+_0x380e71[_0x2b1612]+'\x0a';}}}}if(_0x37a395){this[_0xdcc8('0x1')][_0xdcc8('0x12')]();}else{this['emit']('error',_0x4f3f75);this[_0xdcc8('0x28')](_0xdcc8('0x12'));}};module[_0xdcc8('0x3b')]=EmailImap; \ No newline at end of file +var _0x851d=['once','handleReady','bind','error','handleError','connect','prototype','getAccount','connTimeout','authTimeout','isNil','authentication','user','password','host','tls','autotls','required','getHost','service','port','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','handleFetchMessage','body','handleMessageBody','end','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','closeBox','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','email','mailbox','INBOX','account'];(function(_0x2d5ec0,_0x34ecdd){var _0x2682b2=function(_0x40c6e3){while(--_0x40c6e3){_0x2d5ec0['push'](_0x2d5ec0['shift']());}};_0x2682b2(++_0x34ecdd);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xd851('0x0'));var util=require('util');var Imap=require(_0xd851('0x1'));var _=require(_0xd851('0x2'));var rs=require('randomstring');var simpleParser=require(_0xd851('0x3'))[_0xd851('0x4')];var Iconv=require(_0xd851('0x5'))[_0xd851('0x6')];var EventEmitter=require(_0xd851('0x7'))[_0xd851('0x8')];var utils=require('./utils');var logger=require('../../../config/logger')(_0xd851('0x9'));function EmailImap(_0x2b63e4,_0x3d2383){this[_0xd851('0xa')]=_0xd851('0xb');this[_0xd851('0xc')]=this['getAccount'](_0x2b63e4,_0x3d2383);this[_0xd851('0x1')]=new Imap(this['account']);this[_0xd851('0x1')][_0xd851('0xd')]('ready',this[_0xd851('0xe')][_0xd851('0xf')](this));this[_0xd851('0x1')][_0xd851('0xd')]('end',this['handleEnd'][_0xd851('0xf')](this));this[_0xd851('0x1')]['on'](_0xd851('0x10'),this[_0xd851('0x11')]['bind'](this));this[_0xd851('0x1')][_0xd851('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xd851('0x13')][_0xd851('0x14')]=function(_0x237dda,_0x4fd686){var _0x144fc4={'connTimeout':_0x237dda[_0xd851('0x15')]?_0x237dda[_0xd851('0x15')]*0x3e8:0x2710,'authTimeout':_0x237dda[_0xd851('0x16')]?_0x237dda[_0xd851('0x16')]*0x3e8:0x1388};if(_[_0xd851('0x17')](_0x237dda['service'])){if(_0x237dda[_0xd851('0x18')]){_0x144fc4[_0xd851('0x19')]=_0x237dda[_0xd851('0x19')];_0x144fc4[_0xd851('0x1a')]=_0x237dda[_0xd851('0x1a')];}_0x144fc4[_0xd851('0x1b')]=_0x237dda[_0xd851('0x1b')];_0x144fc4['port']=_0x237dda['port']||0x3e1;if(_0x237dda[_0xd851('0x1c')]){_0x144fc4[_0xd851('0x1c')]=!![];}else{_0x144fc4[_0xd851('0x1c')]=![];_0x144fc4[_0xd851('0x1d')]=_0xd851('0x1e');}}else{_0x144fc4[_0xd851('0x19')]=_0x237dda[_0xd851('0x19')];_0x144fc4[_0xd851('0x1a')]=_0x237dda[_0xd851('0x1a')];_0x144fc4[_0xd851('0x1b')]=utils[_0xd851('0x1f')](_0x237dda[_0xd851('0x20')]);_0x144fc4[_0xd851('0x21')]=0x3e1;_0x144fc4['tls']=!![];}_0x144fc4[_0xd851('0x9')]=_0x4fd686||_0x237dda[_0xd851('0x19')]||'anonymous@xcally.com';return _0x144fc4;};EmailImap[_0xd851('0x13')][_0xd851('0xe')]=function(){this[_0xd851('0x1')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0xd851('0xf')](this));};EmailImap[_0xd851('0x13')][_0xd851('0x22')]=function(_0x3c0dd9,_0xf82f66){if(_0x3c0dd9){this['handleError'](_0x3c0dd9,!![]);}else{this[_0xd851('0x23')]('box',_0xf82f66);this[_0xd851('0x24')]();}};EmailImap[_0xd851('0x13')][_0xd851('0x25')]=function(_0x36457c){if(_0x36457c){this[_0xd851('0x11')](_0x36457c,!![]);}else{this[_0xd851('0x1')]['end']();}};EmailImap[_0xd851('0x13')][_0xd851('0x24')]=function(){this[_0xd851('0x1')][_0xd851('0x26')]([_0xd851('0x27')],this[_0xd851('0x28')][_0xd851('0xf')](this));};EmailImap[_0xd851('0x13')][_0xd851('0x28')]=function(_0x2ef08d,_0xce3947){if(_0x2ef08d){this[_0xd851('0x11')](_0x2ef08d,!![]);}else{if(_0xce3947['length']){try{var _0x15ce59=this[_0xd851('0x1')][_0xd851('0x29')](_0xce3947,{'bodies':'','markSeen':!![]});_0x15ce59['on'](_0xd851('0x2a'),this['handleFetchMessage'][_0xd851('0xf')](this));_0x15ce59['once']('error',this[_0xd851('0x2b')][_0xd851('0xf')](this));_0x15ce59['once']('end',this[_0xd851('0x2c')][_0xd851('0xf')](this));}catch(_0x156641){logger[_0xd851('0x10')](_0x156641);}}else{this[_0xd851('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xd851('0xf')](this));}}};EmailImap[_0xd851('0x13')][_0xd851('0x2d')]=function(_0x1f3d7e,_0x1b382e){_0x1f3d7e['on'](_0xd851('0x2e'),this[_0xd851('0x2f')][_0xd851('0xf')](this));_0x1f3d7e['once']('attributes',this['handleMessageAttributes'][_0xd851('0xf')](this));_0x1f3d7e[_0xd851('0xd')](_0xd851('0x30'),this[_0xd851('0x31')][_0xd851('0xf')](this));};EmailImap['prototype'][_0xd851('0x2f')]=function(_0x1e4fae,_0x5bcbc8){simpleParser(_0x1e4fae,{'Iconv':Iconv},this[_0xd851('0x32')][_0xd851('0xf')](this));};EmailImap[_0xd851('0x13')][_0xd851('0x33')]=function(_0x51d409){};EmailImap['prototype'][_0xd851('0x31')]=function(){};EmailImap['prototype'][_0xd851('0x32')]=function(_0x12ee55,_0x77dbe6){if(_0x12ee55){logger['error'](_0x12ee55);}else{var _0x4ad910=this;utils[_0xd851('0x34')](this[_0xd851('0xc')],_0x77dbe6,function(_0xd6e4e6){_0x4ad910['emit'](_0xd851('0x9'),_0xd6e4e6);});}};EmailImap[_0xd851('0x13')][_0xd851('0x2c')]=function(){this[_0xd851('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xd851('0xf')](this));};EmailImap[_0xd851('0x13')][_0xd851('0x2b')]=function(_0x5056bc){this[_0xd851('0x11')](_0x5056bc);this[_0xd851('0x1')][_0xd851('0x35')](!![],this['handleCloseBox'][_0xd851('0xf')](this));};EmailImap[_0xd851('0x13')][_0xd851('0x36')]=function(){this[_0xd851('0x23')](_0xd851('0x30'));};EmailImap[_0xd851('0x13')][_0xd851('0x11')]=function(_0x3b9e0c,_0x23dc50){logger[_0xd851('0x10')](_0xd851('0x11'),this[_0xd851('0xc')]['email'],JSON['stringify'](_0x3b9e0c));var _0x4fe987='';if(_0x3b9e0c){if(_0x3b9e0c[_0xd851('0x37')]){_0x4fe987=_0x3b9e0c[_0xd851('0x37')];}else{for(var _0x4d2efd in _0x3b9e0c){if(_0x3b9e0c[_0xd851('0x38')](_0x4d2efd)){_0x4fe987+=_[_0xd851('0x39')](_0x4d2efd)+':\x20'+_0x3b9e0c[_0x4d2efd]+'\x0a';}}}}if(_0x23dc50){this[_0xd851('0x1')][_0xd851('0x30')]();}else{this['emit'](_0xd851('0x10'),_0x4fe987);this[_0xd851('0x23')](_0xd851('0x30'));}};module[_0xd851('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 7d8408a..a6adbb1 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 _0x2254=['createTransport','use','compile','verify','bluebird','prototype','send'];(function(_0x2a91bf,_0x14bc7e){var _0x41128a=function(_0x3bfb12){while(--_0x3bfb12){_0x2a91bf['push'](_0x2a91bf['shift']());}};_0x41128a(++_0x14bc7e);}(_0x2254,0xf9));var _0x4225=function(_0x5d26ec,_0x3c2874){_0x5d26ec=_0x5d26ec-0x0;var _0x5dea0d=_0x2254[_0x5d26ec];return _0x5dea0d;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x4225('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x4225('0x1')][_0x4225('0x2')]=function(_0x38efbc,_0x132cc3){return new BPromise(function(_0x43859e,_0x7e390f){var _0x2c400e=nodemailer[_0x4225('0x3')](_0x38efbc);_0x2c400e[_0x4225('0x4')](_0x4225('0x5'),inlineBase64());_0x2c400e['sendMail'](_0x132cc3,function(_0x753393,_0x2ef2e9){if(_0x753393){_0x7e390f(_0x753393['toString']());}else{_0x43859e(_0x2ef2e9);}});});};EmailSmtp[_0x4225('0x1')][_0x4225('0x6')]=function(_0x15dca0){return new BPromise(function(_0x5f0865,_0x41c563){var _0x391610=nodemailer[_0x4225('0x3')](_0x15dca0);_0x391610[_0x4225('0x6')](function(_0xf95f2a,_0x437105){if(_0xf95f2a){_0x41c563(_0xf95f2a['toString']());}else{if(_0x437105){_0x5f0865(_0x437105);}else{_0x41c563('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x97c9=['toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x5cb80d,_0x13c850){var _0x536e3d=function(_0x13bdd2){while(--_0x13bdd2){_0x5cb80d['push'](_0x5cb80d['shift']());}};_0x536e3d(++_0x13c850);}(_0x97c9,0x13c));var _0x997c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c9[_0x20a584];return _0x4b41a8;};'use strict';var nodemailer=require(_0x997c('0x0'));var BPromise=require(_0x997c('0x1'));var inlineBase64=require(_0x997c('0x2'));function EmailSmtp(){}EmailSmtp[_0x997c('0x3')][_0x997c('0x4')]=function(_0x54d5ff,_0x20d240){return new BPromise(function(_0xf40f83,_0x5320d5){var _0x58db14=nodemailer[_0x997c('0x5')](_0x54d5ff);_0x58db14[_0x997c('0x6')](_0x997c('0x7'),inlineBase64());_0x58db14[_0x997c('0x8')](_0x20d240,function(_0x26c604,_0x43fe4e){if(_0x26c604){_0x5320d5(_0x26c604[_0x997c('0x9')]());}else{_0xf40f83(_0x43fe4e);}});});};EmailSmtp[_0x997c('0x3')]['verify']=function(_0x3b32d5){return new BPromise(function(_0xd6da80,_0xbbba4c){var _0x55af7a=nodemailer[_0x997c('0x5')](_0x3b32d5);_0x55af7a[_0x997c('0xa')](function(_0x5a2c34,_0x25b04f){if(_0x5a2c34){_0xbbba4c(_0x5a2c34['toString']());}else{if(_0x25b04f){_0xd6da80(_0x25b04f);}else{_0xbbba4c(_0x997c('0xb'));}}});});};module[_0x997c('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 54e817e..9a76774 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 _0x24ba=['isEmpty','html','replace','textAsHtml','body','originTo','message','originCc','includes','bcc','attachments','type','attachment','%s-%s','now','root','server/files/attachments/','writeFileSync','from','messageId','inReplyTo','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','parseBuffer','first','

Empty\x20message

','Attachments','push','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','path','util','node-tnef','email','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name','split','slice','join','Anonymous','length','pop'];(function(_0x57975e,_0x30b13c){var _0x23d511=function(_0x139792){while(--_0x139792){_0x57975e['push'](_0x57975e['shift']());}};_0x23d511(++_0x30b13c);}(_0x24ba,0xa1));var _0xa24b=function(_0x5746a3,_0x3cc07d){_0x5746a3=_0x5746a3-0x0;var _0x30139e=_0x24ba[_0x5746a3];return _0x30139e;};'use strict';var _=require(_0xa24b('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xa24b('0x1'));var util=require(_0xa24b('0x2'));var tnef=require(_0xa24b('0x3'));var logger=require('../../../config/logger')(_0xa24b('0x4'));var config=require(_0xa24b('0x5'));function getAddress(_0x4d73cf){var _0x24ed1f=_['head'](_0x4d73cf['value']);return _0x24ed1f&&_0x24ed1f[_0xa24b('0x6')]?_0x24ed1f['address']:_0xa24b('0x7')+random[_0xa24b('0x8')](0x6)+_0xa24b('0x9');}function getFirstName(_0x2a12e5){var _0x4107dc=_[_0xa24b('0xa')](_0x2a12e5[_0xa24b('0xb')]);if(_0x4107dc&&_0x4107dc[_0xa24b('0xc')]){var _0x177245=_0x4107dc['name'][_0xa24b('0xd')](/\s+/);return _0x177245['length']?_0x177245[_0xa24b('0xe')](0x0,-0x1)[_0xa24b('0xf')]('\x20'):_0x4107dc[_0xa24b('0xc')];}return _0xa24b('0x10');}function getLastName(_0x43a3f1){var _0x6fd085=_['head'](_0x43a3f1['value']);if(_0x6fd085&&_0x6fd085[_0xa24b('0xc')]){var _0x3dd71e=_0x6fd085[_0xa24b('0xc')][_0xa24b('0xd')](/\s+/);return _0x3dd71e[_0xa24b('0x11')]>0x1?_0x3dd71e[_0xa24b('0x12')]():'';}return'';}function getMails(_0x32995e,_0x2f2664){var _0x354efe='';for(var _0x8a402f=0x0;_0x8a402f<_0x2f2664[_0xa24b('0xb')][_0xa24b('0x11')];_0x8a402f+=0x1){if(_0x2f2664['value'][_0x8a402f][_0xa24b('0x6')]!==_0x32995e){if(!_[_0xa24b('0x13')](_0x354efe)){_0x354efe+=',';}_0x354efe+=_0x2f2664['value'][_0x8a402f][_0xa24b('0xc')]||_0x2f2664[_0xa24b('0xb')][_0x8a402f][_0xa24b('0x6')]||'';_0x354efe+='\x20<';_0x354efe+=_0x2f2664[_0xa24b('0xb')][_0x8a402f][_0xa24b('0x6')]?_0x2f2664[_0xa24b('0xb')][_0x8a402f][_0xa24b('0x6')]:_0xa24b('0x7')+random[_0xa24b('0x8')](0x6)+'@xcally.com';_0x354efe+='>';}}return _0x354efe;}function parseEmail(_0x52331d,_0x225306,_0x543a8f){if(_0x225306['html']){var _0x3e6052=/)<[^<]*)*<\/script>/gi;while(_0x3e6052['test'](_0x225306[_0xa24b('0x14')])){_0x225306[_0xa24b('0x14')]=_0x225306[_0xa24b('0x14')][_0xa24b('0x15')](_0x3e6052,'');}_0x543a8f['body']=_0x225306['html'];}else{_0x543a8f['body']=_0x225306[_0xa24b('0x16')];}if(_0x543a8f[_0xa24b('0x17')]){_0x543a8f[_0xa24b('0x17')]=_0x543a8f[_0xa24b('0x17')][_0xa24b('0x15')](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','moment','randomstring','path','node-tnef','../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','split','slice','Anonymous','length','pop','isEmpty','html','test','replace','textAsHtml','body','0x1?_0x3388e1[_0x6218('0x11')]():'';}return'';}function getMails(_0x4cd209,_0x190aa4){var _0x4d7a65='';for(var _0x3a740d=0x0;_0x3a740d<_0x190aa4['value']['length'];_0x3a740d+=0x1){if(_0x190aa4[_0x6218('0x6')][_0x3a740d][_0x6218('0x7')]!==_0x4cd209){if(!_[_0x6218('0x12')](_0x4d7a65)){_0x4d7a65+=',';}_0x4d7a65+=_0x190aa4['value'][_0x3a740d][_0x6218('0xc')]||_0x190aa4[_0x6218('0x6')][_0x3a740d][_0x6218('0x7')]||'';_0x4d7a65+='\x20<';_0x4d7a65+=_0x190aa4[_0x6218('0x6')][_0x3a740d][_0x6218('0x7')]?_0x190aa4[_0x6218('0x6')][_0x3a740d][_0x6218('0x7')]:_0x6218('0x8')+random[_0x6218('0x9')](0x6)+_0x6218('0xa');_0x4d7a65+='>';}}return _0x4d7a65;}function parseEmail(_0x6243b,_0x48f7fb,_0x313ffd){if(_0x48f7fb[_0x6218('0x13')]){var _0x5d217d=/)<[^<]*)*<\/script>/gi;while(_0x5d217d[_0x6218('0x14')](_0x48f7fb[_0x6218('0x13')])){_0x48f7fb[_0x6218('0x13')]=_0x48f7fb[_0x6218('0x13')][_0x6218('0x15')](_0x5d217d,'');}_0x313ffd['body']=_0x48f7fb[_0x6218('0x13')];}else{_0x313ffd['body']=_0x48f7fb[_0x6218('0x16')];}if(_0x313ffd[_0x6218('0x17')]){_0x313ffd[_0x6218('0x17')]=_0x313ffd[_0x6218('0x17')][_0x6218('0x15')](/0x0){if(this[_0x50902a+_0x4efe('0x1f')]>0x0&&this[_0x50902a+_0x4efe('0x1e')]>=this[_0x50902a+'Capacity']){return'maxcapacity';}else{return _0x4efe('0x20');}}else{return'idle';}};Agent['prototype'][_0x4efe('0x21')]=function(){var _0x199e98=['mail',_0x4efe('0x22'),_0x4efe('0x23'),'fax',_0x4efe('0x24')];for(var _0x19c705=0x0;_0x19c705<_0x199e98['length'];_0x19c705+=0x1){var _0x4a7f8e=this[_0x4efe('0x1d')](_0x199e98[_0x19c705]);if(this[_0x199e98[_0x19c705]+_0x4efe('0x25')]!==_0x4a7f8e){this[_0x199e98[_0x19c705]+_0x4efe('0x26')]=_[_0x4efe('0x27')](moment()[_0x4efe('0x28')]('x'));}this[_0x199e98[_0x19c705]+_0x4efe('0x25')]=_0x4a7f8e;}var _0x2f0748={'id':this['id'],'name':this[_0x4efe('0x5')],'online':this['online'],'voicePause':this[_0x4efe('0x7')],'chatPause':this[_0x4efe('0x8')],'mailPause':this[_0x4efe('0x9')],'smsPause':this[_0x4efe('0x29')],'faxPause':this[_0x4efe('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x4efe('0xc')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x4efe('0xe')],'chatCurrentCapacity':this[_0x4efe('0x2a')],'mailStatus':this[_0x4efe('0xf')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x4efe('0x11')],'mailCurrentCapacity':this[_0x4efe('0x12')],'faxStatus':this[_0x4efe('0x13')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x4efe('0x14')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x4efe('0x2b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x4efe('0x17')],'smsCurrentCapacity':this[_0x4efe('0x18')],'openchannelStatus':this[_0x4efe('0x19')],'openchannelStatusTime':this[_0x4efe('0x2c')],'openchannelCapacity':this[_0x4efe('0x1a')],'openchannelCurrentCapacity':this[_0x4efe('0x1b')],'busy':this[_0x4efe('0x2d')],'busyQueue':this[_0x4efe('0x1c')]};var _0x22a2ba=md5(JSON['stringify'](_0x2f0748));if(this[_0x4efe('0x2e')]!==_0x22a2ba){this[_0x4efe('0x2e')]=_0x22a2ba;io[_0x4efe('0x2f')](_0x4efe('0x30'),_0x2f0748);}};module[_0x4efe('0x31')]=Agent; \ No newline at end of file +var _0x27be=['openchannelStatus','busyQueue','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','openchannelCapacity','busy','updateRealtime','prototype','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','length','getChannelStatus','Status','toNumber','openchannelPause','mailCurrentCapacity','faxCurrentCapacity','smsStatusTime','smsCurrentCapacity'];(function(_0x132f02,_0x52f76a){var _0x4a29ce=function(_0x90dcf5){while(--_0x90dcf5){_0x132f02['push'](_0x132f02['shift']());}};_0x4a29ce(++_0x52f76a);}(_0x27be,0x150));var _0xe27b=function(_0x54bed0,_0x13dba1){_0x54bed0=_0x54bed0-0x0;var _0x56768b=_0x27be[_0x54bed0];return _0x56768b;};'use strict';var _=require(_0xe27b('0x0'));var moment=require(_0xe27b('0x1'));var md5=require(_0xe27b('0x2'));var Redis=require(_0xe27b('0x3'));var config=require('../../../config/environment');config[_0xe27b('0x4')]=_[_0xe27b('0x5')](config[_0xe27b('0x4')],{'host':_0xe27b('0x6'),'port':0x18eb});var io=require(_0xe27b('0x7'))(new Redis(config[_0xe27b('0x4')]));function Agent(_0x4c2b43){this['id']=_0x4c2b43['id']||0x0;this[_0xe27b('0x8')]=_0x4c2b43[_0xe27b('0x8')]||'';this[_0xe27b('0x9')]=_0x4c2b43[_0xe27b('0x9')]||!![];this[_0xe27b('0xa')]=_0x4c2b43[_0xe27b('0xa')]||![];this[_0xe27b('0xb')]=_0x4c2b43[_0xe27b('0xb')]||![];this[_0xe27b('0xc')]=_0x4c2b43[_0xe27b('0xc')]||![];this['faxPause']=_0x4c2b43[_0xe27b('0xd')]||![];this['smsPause']=_0x4c2b43[_0xe27b('0xe')]||![];this['openchannelPause']=_0x4c2b43['openchannelPause']||![];this[_0xe27b('0xf')]='unknown';this[_0xe27b('0x10')]=0x0;this['chatCapacity']=_0x4c2b43[_0xe27b('0x11')]||0x0;this[_0xe27b('0x12')]=0x0;this[_0xe27b('0x13')]=_0xe27b('0x14');this[_0xe27b('0x15')]=0x0;this[_0xe27b('0x16')]=_0x4c2b43[_0xe27b('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xe27b('0x17')]=_0xe27b('0x14');this[_0xe27b('0x18')]=0x0;this[_0xe27b('0x19')]=_0x4c2b43[_0xe27b('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xe27b('0x1a')]='unknown';this['smsStatusTime']=0x0;this[_0xe27b('0x1b')]=_0x4c2b43['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this[_0xe27b('0x1c')]=_0x4c2b43['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xe27b('0x1d')]=![];this['busyQueue']=undefined;this[_0xe27b('0x2')]='';this[_0xe27b('0x1e')]();}Agent[_0xe27b('0x1f')]['getChannelStatus']=function(_0x54f5b8){if(this[_0x54f5b8+_0xe27b('0x20')]>0x0){if(this[_0x54f5b8+'Capacity']>0x0&&this[_0x54f5b8+_0xe27b('0x20')]>=this[_0x54f5b8+'Capacity']){return _0xe27b('0x21');}else{return'working';}}else{return _0xe27b('0x22');}};Agent[_0xe27b('0x1f')][_0xe27b('0x1e')]=function(){var _0x7c57d8=[_0xe27b('0x23'),_0xe27b('0x24'),_0xe27b('0x25'),_0xe27b('0x26'),_0xe27b('0x27')];for(var _0x11e9f4=0x0;_0x11e9f4<_0x7c57d8[_0xe27b('0x28')];_0x11e9f4+=0x1){var _0x570f49=this[_0xe27b('0x29')](_0x7c57d8[_0x11e9f4]);if(this[_0x7c57d8[_0x11e9f4]+_0xe27b('0x2a')]!==_0x570f49){this[_0x7c57d8[_0x11e9f4]+'StatusTime']=_[_0xe27b('0x2b')](moment()['format']('x'));}this[_0x7c57d8[_0x11e9f4]+'Status']=_0x570f49;}var _0x42e4f5={'id':this['id'],'name':this[_0xe27b('0x8')],'online':this[_0xe27b('0x9')],'voicePause':this[_0xe27b('0xa')],'chatPause':this[_0xe27b('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xe27b('0xe')],'faxPause':this[_0xe27b('0xd')],'openchannelPause':this[_0xe27b('0x2c')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xe27b('0x10')],'chatCapacity':this[_0xe27b('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xe27b('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xe27b('0x16')],'mailCurrentCapacity':this[_0xe27b('0x2d')],'faxStatus':this[_0xe27b('0x17')],'faxStatusTime':this[_0xe27b('0x18')],'faxCapacity':this[_0xe27b('0x19')],'faxCurrentCapacity':this[_0xe27b('0x2e')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xe27b('0x2f')],'smsCapacity':this[_0xe27b('0x1b')],'smsCurrentCapacity':this[_0xe27b('0x30')],'openchannelStatus':this[_0xe27b('0x31')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xe27b('0x1c')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xe27b('0x32')]};var _0x2822ab=md5(JSON[_0xe27b('0x33')](_0x42e4f5));if(this['md5']!==_0x2822ab){this['md5']=_0x2822ab;io[_0xe27b('0x34')](_0xe27b('0x35'),_0x42e4f5);}};module[_0xe27b('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index db2f917..b6118fc 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 _0x1fdb=['strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x2f4d68,_0x236f51){var _0x2e1cee=function(_0xefea9f){while(--_0xefea9f){_0x2f4d68['push'](_0x2f4d68['shift']());}};_0x2e1cee(++_0x236f51);}(_0x1fdb,0x1f4));var _0xb1fd=function(_0x2715cd,_0x2049b4){_0x2715cd=_0x2715cd-0x0;var _0x839b8b=_0x1fdb[_0x2715cd];return _0x839b8b;};'use strict';var _=require(_0xb1fd('0x0'));var md5=require(_0xb1fd('0x1'));var util=require(_0xb1fd('0x2'));var Redis=require(_0xb1fd('0x3'));var config=require(_0xb1fd('0x4'));config[_0xb1fd('0x5')]=_['defaults'](config[_0xb1fd('0x5')],{'host':_0xb1fd('0x6'),'port':0x18eb});var io=require(_0xb1fd('0x7'))(new Redis(config[_0xb1fd('0x5')]));function ChatQueue(_0x5b2d8e){this['id']=_0x5b2d8e['id']||0x0;this['name']=_0x5b2d8e[_0xb1fd('0x8')]||'';this['timeout']=_0x5b2d8e[_0xb1fd('0x9')]||0xa;this[_0xb1fd('0xa')]=_0x5b2d8e[_0xb1fd('0xa')]||_0xb1fd('0xb');this[_0xb1fd('0xc')]=_0x5b2d8e['Agents'];this['mapAgentsId']={};this[_0xb1fd('0xd')]=0x0;this[_0xb1fd('0x1')]='';this[_0xb1fd('0xe')]();this[_0xb1fd('0xf')]();}ChatQueue['prototype'][_0xb1fd('0xe')]=function(){var _0x3f2beb=this['mapAgentsId'][_0xb1fd('0x10')];this[_0xb1fd('0x11')]=_['map'](this['Agents'],'id');this[_0xb1fd('0x11')][_0xb1fd('0x10')]=_0x3f2beb;};ChatQueue['prototype'][_0xb1fd('0xf')]=function(){this[_0xb1fd('0x12')]=0x0;this[_0xb1fd('0x13')]=0x0;for(var _0x1ab7cb=0x0;_0x1ab7cb=0x0?this[_0xb1fd('0x17')]:0x0;var _0x2a2a36={'id':this['id'],'available':this[_0xb1fd('0x17')],'loggedIn':this[_0xb1fd('0x12')],'name':this[_0xb1fd('0x8')],'paused':this['paused'],'waiting':this[_0xb1fd('0xd')]};var _0x1b9d64=md5(JSON[_0xb1fd('0x18')](_0x2a2a36));if(this[_0xb1fd('0x1')]!==_0x1b9d64){this['md5']=_0x1b9d64;io['to'](util[_0xb1fd('0x19')](_0xb1fd('0x1a'),_0x2a2a36[_0xb1fd('0x8')]))[_0xb1fd('0x1b')](_0xb1fd('0x1c'),_0x2a2a36);}};module[_0xb1fd('0x1d')]=ChatQueue; \ No newline at end of file +var _0x78d1=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','exports','lodash'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x78d1,0x6f));var _0x178d=function(_0x5c985c,_0x409b54){_0x5c985c=_0x5c985c-0x0;var _0x1c3ac1=_0x78d1[_0x5c985c];return _0x1c3ac1;};'use strict';var _=require(_0x178d('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x178d('0x1')]=_[_0x178d('0x2')](config[_0x178d('0x1')],{'host':_0x178d('0x3'),'port':0x18eb});var io=require(_0x178d('0x4'))(new Redis(config[_0x178d('0x1')]));function ChatQueue(_0x47bdce){this['id']=_0x47bdce['id']||0x0;this[_0x178d('0x5')]=_0x47bdce[_0x178d('0x5')]||'';this[_0x178d('0x6')]=_0x47bdce['timeout']||0xa;this[_0x178d('0x7')]=_0x47bdce[_0x178d('0x7')]||_0x178d('0x8');this[_0x178d('0x9')]=_0x47bdce['Agents'];this[_0x178d('0xa')]={};this[_0x178d('0xb')]=0x0;this[_0x178d('0xc')]='';this['updateRouting']();this[_0x178d('0xd')]();}ChatQueue[_0x178d('0xe')][_0x178d('0xf')]=function(){var _0x25adcf=this['mapAgentsId'][_0x178d('0x10')];this[_0x178d('0xa')]=_[_0x178d('0x11')](this[_0x178d('0x9')],'id');this['mapAgentsId'][_0x178d('0x10')]=_0x25adcf;};ChatQueue['prototype'][_0x178d('0xd')]=function(){this[_0x178d('0x12')]=0x0;this['paused']=0x0;for(var _0x2ea5a2=0x0;_0x2ea5a2=0x0?this['available']:0x0;var _0x5cc3aa={'id':this['id'],'available':this[_0x178d('0x17')],'loggedIn':this[_0x178d('0x12')],'name':this[_0x178d('0x5')],'paused':this[_0x178d('0x16')],'waiting':this[_0x178d('0xb')]};var _0x1dcabd=md5(JSON[_0x178d('0x18')](_0x5cc3aa));if(this[_0x178d('0xc')]!==_0x1dcabd){this[_0x178d('0xc')]=_0x1dcabd;io['to'](util[_0x178d('0x19')](_0x178d('0x1a'),_0x5cc3aa[_0x178d('0x5')]))['emit']('chat_queue:save',_0x5cc3aa);}};module[_0x178d('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8ae3af1..669d1dc 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 _0x8574=['exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','waiting','format','fax:queue:%s','emit','fax_queue:save'];(function(_0x138500,_0x2f3305){var _0x3f2df0=function(_0x2d57f0){while(--_0x2d57f0){_0x138500['push'](_0x138500['shift']());}};_0x3f2df0(++_0x2f3305);}(_0x8574,0x75));var _0x4857=function(_0x53f125,_0x4ba12e){_0x53f125=_0x53f125-0x0;var _0x209b38=_0x8574[_0x53f125];return _0x209b38;};'use strict';var _=require('lodash');var md5=require(_0x4857('0x0'));var util=require(_0x4857('0x1'));var Redis=require(_0x4857('0x2'));var config=require(_0x4857('0x3'));config['redis']=_[_0x4857('0x4')](config[_0x4857('0x5')],{'host':_0x4857('0x6'),'port':0x18eb});var io=require(_0x4857('0x7'))(new Redis(config[_0x4857('0x5')]));function FaxQueue(_0x19e86e){this['id']=_0x19e86e['id']||0x0;this[_0x4857('0x8')]=_0x19e86e[_0x4857('0x8')]||'';this[_0x4857('0x9')]=_0x19e86e[_0x4857('0x9')]||0xa;this[_0x4857('0xa')]=_0x19e86e[_0x4857('0xa')]||'beepall';this[_0x4857('0xb')]=_0x19e86e[_0x4857('0xb')];this[_0x4857('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x4857('0xd')]();this[_0x4857('0xe')]();}FaxQueue[_0x4857('0xf')]['updateRouting']=function(){var _0x706893=this['mapAgentsId'][_0x4857('0x10')];this[_0x4857('0xc')]=_[_0x4857('0x11')](this[_0x4857('0xb')],'id');this[_0x4857('0xc')]['_rr']=_0x706893;};FaxQueue[_0x4857('0xf')][_0x4857('0xe')]=function(){this[_0x4857('0x12')]=0x0;this[_0x4857('0x13')]=0x0;for(var _0x59076a=0x0;_0x59076a=0x0?this[_0x4857('0x16')]:0x0;var _0x2a1965={'id':this['id'],'available':this[_0x4857('0x16')],'loggedIn':this[_0x4857('0x12')],'name':this[_0x4857('0x8')],'paused':this['paused'],'waiting':this[_0x4857('0x17')]};var _0x3ca62f=md5(JSON['stringify'](_0x2a1965));if(this[_0x4857('0x0')]!==_0x3ca62f){this['md5']=_0x3ca62f;io['to'](util[_0x4857('0x18')](_0x4857('0x19'),_0x2a1965[_0x4857('0x8')]))[_0x4857('0x1a')](_0x4857('0x1b'),_0x2a1965);}};module[_0x4857('0x1c')]=FaxQueue; \ No newline at end of file +var _0x8c39=['format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','map','_rr','prototype','updateRealtime','loggedIn','length','online','paused','available','waiting','stringify'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x8c39,0xa0));var _0x98c3=function(_0xb33e92,_0x1edcf3){_0xb33e92=_0xb33e92-0x0;var _0x57dfee=_0x8c39[_0xb33e92];return _0x57dfee;};'use strict';var _=require(_0x98c3('0x0'));var md5=require(_0x98c3('0x1'));var util=require(_0x98c3('0x2'));var Redis=require('ioredis');var config=require(_0x98c3('0x3'));config[_0x98c3('0x4')]=_[_0x98c3('0x5')](config[_0x98c3('0x4')],{'host':_0x98c3('0x6'),'port':0x18eb});var io=require(_0x98c3('0x7'))(new Redis(config[_0x98c3('0x4')]));function FaxQueue(_0x443c2b){this['id']=_0x443c2b['id']||0x0;this['name']=_0x443c2b[_0x98c3('0x8')]||'';this[_0x98c3('0x9')]=_0x443c2b[_0x98c3('0x9')]||0xa;this['strategy']=_0x443c2b[_0x98c3('0xa')]||_0x98c3('0xb');this[_0x98c3('0xc')]=_0x443c2b['Agents'];this[_0x98c3('0xd')]={};this['waiting']=0x0;this[_0x98c3('0x1')]='';this[_0x98c3('0xe')]();this['updateRealtime']();}FaxQueue['prototype'][_0x98c3('0xe')]=function(){var _0x3e8fba=this[_0x98c3('0xd')]['_rr'];this['mapAgentsId']=_[_0x98c3('0xf')](this['Agents'],'id');this[_0x98c3('0xd')][_0x98c3('0x10')]=_0x3e8fba;};FaxQueue[_0x98c3('0x11')][_0x98c3('0x12')]=function(){this[_0x98c3('0x13')]=0x0;this['paused']=0x0;for(var _0x2938b4=0x0;_0x2938b4=0x0?this['available']:0x0;var _0x5554f2={'id':this['id'],'available':this[_0x98c3('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x98c3('0x16')],'waiting':this[_0x98c3('0x18')]};var _0x193ac3=md5(JSON[_0x98c3('0x19')](_0x5554f2));if(this['md5']!==_0x193ac3){this['md5']=_0x193ac3;io['to'](util[_0x98c3('0x1a')](_0x98c3('0x1b'),_0x5554f2[_0x98c3('0x8')]))[_0x98c3('0x1c')](_0x98c3('0x1d'),_0x5554f2);}};module[_0x98c3('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3e0404c..e6ab0d4 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 _0x701d=['exports','Intervals'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x701d,0x8f));var _0xd701=function(_0xb9580,_0x441821){_0xb9580=_0xb9580-0x0;var _0x532515=_0x701d[_0xb9580];return _0x532515;};'use strict';function Interval(_0x5aae1a){this['id']=_0x5aae1a['id']||0x0;this['name']=_0x5aae1a['name']||'';this['Intervals']=_0x5aae1a[_0xd701('0x0')]||{};}module[_0xd701('0x1')]=Interval; \ No newline at end of file +var _0x686c=['name','Intervals'];(function(_0x16bf61,_0x3ba308){var _0x9b598=function(_0x2f9307){while(--_0x2f9307){_0x16bf61['push'](_0x16bf61['shift']());}};_0x9b598(++_0x3ba308);}(_0x686c,0x1de));var _0xc686=function(_0x2fcfeb,_0x3e1913){_0x2fcfeb=_0x2fcfeb-0x0;var _0x5a3387=_0x686c[_0x2fcfeb];return _0x5a3387;};'use strict';function Interval(_0x1b5f72){this['id']=_0x1b5f72['id']||0x0;this['name']=_0x1b5f72[_0xc686('0x0')]||'';this[_0xc686('0x1')]=_0x1b5f72['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 004a52e..c76e6f8 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 _0x97ce=['waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','online','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x1b3c3d,_0x21bfef){var _0x47e5bb=function(_0x185a6c){while(--_0x185a6c){_0x1b3c3d['push'](_0x1b3c3d['shift']());}};_0x47e5bb(++_0x21bfef);}(_0x97ce,0x151));var _0xe97c=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x97ce[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0xe97c('0x0'));var md5=require(_0xe97c('0x1'));var util=require(_0xe97c('0x2'));var Redis=require(_0xe97c('0x3'));var config=require('../../../config/environment');config[_0xe97c('0x4')]=_['defaults'](config[_0xe97c('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe97c('0x5'))(new Redis(config[_0xe97c('0x4')]));function MailQueue(_0x41d9b0){this['id']=_0x41d9b0['id']||0x0;this[_0xe97c('0x6')]=_0x41d9b0[_0xe97c('0x6')]||'';this[_0xe97c('0x7')]=_0x41d9b0['timeout']||0xa;this[_0xe97c('0x8')]=_0x41d9b0[_0xe97c('0x8')]||_0xe97c('0x9');this['Agents']=_0x41d9b0[_0xe97c('0xa')];this['mapAgentsId']={};this[_0xe97c('0xb')]=0x0;this[_0xe97c('0x1')]='';this[_0xe97c('0xc')]();this[_0xe97c('0xd')]();}MailQueue[_0xe97c('0xe')][_0xe97c('0xc')]=function(){var _0xcb42d6=this['mapAgentsId'][_0xe97c('0xf')];this[_0xe97c('0x10')]=_[_0xe97c('0x11')](this[_0xe97c('0xa')],'id');this[_0xe97c('0x10')][_0xe97c('0xf')]=_0xcb42d6;};MailQueue[_0xe97c('0xe')][_0xe97c('0xd')]=function(){this[_0xe97c('0x12')]=0x0;this['paused']=0x0;for(var _0x4e0b5e=0x0;_0x4e0b5e=0x0?this[_0xe97c('0x16')]:0x0;var _0x1ceb22={'id':this['id'],'available':this[_0xe97c('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xe97c('0x6')],'paused':this[_0xe97c('0x15')],'waiting':this[_0xe97c('0xb')]};var _0x3b9aa6=md5(JSON[_0xe97c('0x17')](_0x1ceb22));if(this['md5']!==_0x3b9aa6){this[_0xe97c('0x1')]=_0x3b9aa6;io['to'](util[_0xe97c('0x18')](_0xe97c('0x19'),_0x1ceb22[_0xe97c('0x6')]))[_0xe97c('0x1a')](_0xe97c('0x1b'),_0x1ceb22);}};module[_0xe97c('0x1c')]=MailQueue; \ No newline at end of file +var _0xfc46=['loggedIn','paused','length','online','mailPause','available','waiting','format','emit','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x302c7e,_0x2c2172){var _0x2d0502=function(_0xbee622){while(--_0xbee622){_0x302c7e['push'](_0x302c7e['shift']());}};_0x2d0502(++_0x2c2172);}(_0xfc46,0x9a));var _0x6fc4=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0xfc46[_0x152136];return _0x20df44;};'use strict';var _=require(_0x6fc4('0x0'));var md5=require('md5');var util=require(_0x6fc4('0x1'));var Redis=require(_0x6fc4('0x2'));var config=require(_0x6fc4('0x3'));config['redis']=_[_0x6fc4('0x4')](config[_0x6fc4('0x5')],{'host':_0x6fc4('0x6'),'port':0x18eb});var io=require(_0x6fc4('0x7'))(new Redis(config['redis']));function MailQueue(_0x1504a6){this['id']=_0x1504a6['id']||0x0;this[_0x6fc4('0x8')]=_0x1504a6[_0x6fc4('0x8')]||'';this[_0x6fc4('0x9')]=_0x1504a6[_0x6fc4('0x9')]||0xa;this[_0x6fc4('0xa')]=_0x1504a6['strategy']||_0x6fc4('0xb');this['Agents']=_0x1504a6[_0x6fc4('0xc')];this[_0x6fc4('0xd')]={};this['waiting']=0x0;this[_0x6fc4('0xe')]='';this[_0x6fc4('0xf')]();this[_0x6fc4('0x10')]();}MailQueue[_0x6fc4('0x11')][_0x6fc4('0xf')]=function(){var _0x38b084=this[_0x6fc4('0xd')][_0x6fc4('0x12')];this[_0x6fc4('0xd')]=_[_0x6fc4('0x13')](this[_0x6fc4('0xc')],'id');this[_0x6fc4('0xd')][_0x6fc4('0x12')]=_0x38b084;};MailQueue[_0x6fc4('0x11')][_0x6fc4('0x10')]=function(){this[_0x6fc4('0x14')]=0x0;this[_0x6fc4('0x15')]=0x0;for(var _0x519c52=0x0;_0x519c52=0x0?this['available']:0x0;var _0x5b4b71={'id':this['id'],'available':this[_0x6fc4('0x19')],'loggedIn':this[_0x6fc4('0x14')],'name':this['name'],'paused':this[_0x6fc4('0x15')],'waiting':this[_0x6fc4('0x1a')]};var _0x20f362=md5(JSON['stringify'](_0x5b4b71));if(this[_0x6fc4('0xe')]!==_0x20f362){this[_0x6fc4('0xe')]=_0x20f362;io['to'](util[_0x6fc4('0x1b')]('mail:queue:%s',_0x5b4b71[_0x6fc4('0x8')]))[_0x6fc4('0x1c')]('mail_queue:save',_0x5b4b71);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 978c4a0..f895ec2 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 _0x815d=['socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','paused','length','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x815d,0x1c8));var _0xd815=function(_0x4c8a67,_0x465097){_0x4c8a67=_0x4c8a67-0x0;var _0x433cb5=_0x815d[_0x4c8a67];return _0x433cb5;};'use strict';var _=require(_0xd815('0x0'));var md5=require(_0xd815('0x1'));var util=require(_0xd815('0x2'));var Redis=require(_0xd815('0x3'));var config=require(_0xd815('0x4'));config[_0xd815('0x5')]=_[_0xd815('0x6')](config['redis'],{'host':_0xd815('0x7'),'port':0x18eb});var io=require(_0xd815('0x8'))(new Redis(config[_0xd815('0x5')]));function OpenchannelQueue(_0x2fcee4){this['id']=_0x2fcee4['id']||0x0;this[_0xd815('0x9')]=_0x2fcee4['name']||'';this[_0xd815('0xa')]=_0x2fcee4[_0xd815('0xa')]||0xa;this[_0xd815('0xb')]=_0x2fcee4[_0xd815('0xb')]||_0xd815('0xc');this[_0xd815('0xd')]=_0x2fcee4[_0xd815('0xd')];this['mapAgentsId']={};this[_0xd815('0xe')]=0x0;this[_0xd815('0x1')]='';this[_0xd815('0xf')]();this[_0xd815('0x10')]();}OpenchannelQueue['prototype'][_0xd815('0xf')]=function(){var _0x531a87=this[_0xd815('0x11')][_0xd815('0x12')];this[_0xd815('0x11')]=_['map'](this[_0xd815('0xd')],'id');this[_0xd815('0x11')][_0xd815('0x12')]=_0x531a87;};OpenchannelQueue['prototype'][_0xd815('0x10')]=function(){this['loggedIn']=0x0;this[_0xd815('0x13')]=0x0;for(var _0xee2b01=0x0;_0xee2b01=0x0?this[_0xd815('0x17')]:0x0;var _0x414769={'id':this['id'],'available':this[_0xd815('0x17')],'loggedIn':this[_0xd815('0x15')],'name':this['name'],'paused':this[_0xd815('0x13')],'waiting':this[_0xd815('0xe')]};var _0x5b1b00=md5(JSON[_0xd815('0x18')](_0x414769));if(this['md5']!==_0x5b1b00){this['md5']=_0x5b1b00;io['to'](util[_0xd815('0x19')](_0xd815('0x1a'),_0x414769[_0xd815('0x9')]))['emit'](_0xd815('0x1b'),_0x414769);}};module[_0xd815('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xb9f6=['md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','online','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports'];(function(_0x35868f,_0x54367e){var _0x47985c=function(_0x492bb5){while(--_0x492bb5){_0x35868f['push'](_0x35868f['shift']());}};_0x47985c(++_0x54367e);}(_0xb9f6,0x1ed));var _0x6b9f=function(_0x50725f,_0x4e1db5){_0x50725f=_0x50725f-0x0;var _0x1fabd6=_0xb9f6[_0x50725f];return _0x1fabd6;};'use strict';var _=require('lodash');var md5=require(_0x6b9f('0x0'));var util=require(_0x6b9f('0x1'));var Redis=require(_0x6b9f('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x6b9f('0x3')],{'host':_0x6b9f('0x4'),'port':0x18eb});var io=require(_0x6b9f('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x476bbb){this['id']=_0x476bbb['id']||0x0;this[_0x6b9f('0x6')]=_0x476bbb[_0x6b9f('0x6')]||'';this[_0x6b9f('0x7')]=_0x476bbb[_0x6b9f('0x7')]||0xa;this['strategy']=_0x476bbb[_0x6b9f('0x8')]||_0x6b9f('0x9');this[_0x6b9f('0xa')]=_0x476bbb[_0x6b9f('0xa')];this[_0x6b9f('0xb')]={};this[_0x6b9f('0xc')]=0x0;this[_0x6b9f('0x0')]='';this[_0x6b9f('0xd')]();this[_0x6b9f('0xe')]();}OpenchannelQueue[_0x6b9f('0xf')][_0x6b9f('0xd')]=function(){var _0x27858d=this[_0x6b9f('0xb')][_0x6b9f('0x10')];this[_0x6b9f('0xb')]=_[_0x6b9f('0x11')](this[_0x6b9f('0xa')],'id');this['mapAgentsId'][_0x6b9f('0x10')]=_0x27858d;};OpenchannelQueue[_0x6b9f('0xf')][_0x6b9f('0xe')]=function(){this['loggedIn']=0x0;this[_0x6b9f('0x12')]=0x0;for(var _0x4977c6=0x0;_0x4977c6=0x0?this[_0x6b9f('0x16')]:0x0;var _0x131f0d={'id':this['id'],'available':this[_0x6b9f('0x16')],'loggedIn':this[_0x6b9f('0x14')],'name':this[_0x6b9f('0x6')],'paused':this[_0x6b9f('0x12')],'waiting':this[_0x6b9f('0xc')]};var _0x34a5e7=md5(JSON[_0x6b9f('0x17')](_0x131f0d));if(this[_0x6b9f('0x0')]!==_0x34a5e7){this[_0x6b9f('0x0')]=_0x34a5e7;io['to'](util[_0x6b9f('0x18')](_0x6b9f('0x19'),_0x131f0d[_0x6b9f('0x6')]))[_0x6b9f('0x1a')](_0x6b9f('0x1b'),_0x131f0d);}};module[_0x6b9f('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 e6b2692..642722f 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 _0x7a79=['emit','sms_queue:save','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online','available','format','sms:queue:%s'];(function(_0x5993f3,_0x5b5156){var _0x4dcef0=function(_0xc21d56){while(--_0xc21d56){_0x5993f3['push'](_0x5993f3['shift']());}};_0x4dcef0(++_0x5b5156);}(_0x7a79,0xfc));var _0x97a7=function(_0x2bbad9,_0x1f3892){_0x2bbad9=_0x2bbad9-0x0;var _0x1683cb=_0x7a79[_0x2bbad9];return _0x1683cb;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x97a7('0x0'));var config=require('../../../config/environment');config[_0x97a7('0x1')]=_[_0x97a7('0x2')](config[_0x97a7('0x1')],{'host':'localhost','port':0x18eb});var io=require(_0x97a7('0x3'))(new Redis(config['redis']));function SmsQueue(_0x239062){this['id']=_0x239062['id']||0x0;this[_0x97a7('0x4')]=_0x239062[_0x97a7('0x4')]||'';this[_0x97a7('0x5')]=_0x239062['timeout']||0xa;this['strategy']=_0x239062[_0x97a7('0x6')]||'beepall';this['Agents']=_0x239062[_0x97a7('0x7')];this['mapAgentsId']={};this[_0x97a7('0x8')]=0x0;this[_0x97a7('0x9')]='';this[_0x97a7('0xa')]();this['updateRealtime']();}SmsQueue[_0x97a7('0xb')][_0x97a7('0xa')]=function(){var _0x432db5=this[_0x97a7('0xc')]['_rr'];this['mapAgentsId']=_[_0x97a7('0xd')](this[_0x97a7('0x7')],'id');this[_0x97a7('0xc')][_0x97a7('0xe')]=_0x432db5;};SmsQueue['prototype'][_0x97a7('0xf')]=function(){this[_0x97a7('0x10')]=0x0;this[_0x97a7('0x11')]=0x0;for(var _0xc85abf=0x0;_0xc85abf=0x0?this[_0x97a7('0x14')]:0x0;var _0x14d8da={'id':this['id'],'available':this[_0x97a7('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x97a7('0x4')],'paused':this['paused'],'waiting':this[_0x97a7('0x8')]};var _0x406579=md5(JSON['stringify'](_0x14d8da));if(this[_0x97a7('0x9')]!==_0x406579){this[_0x97a7('0x9')]=_0x406579;io['to'](util[_0x97a7('0x15')](_0x97a7('0x16'),_0x14d8da['name']))[_0x97a7('0x17')](_0x97a7('0x18'),_0x14d8da);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x05f1=['online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x22cb10,_0x20db4f){var _0x38a6f8=function(_0xdb4b16){while(--_0xdb4b16){_0x22cb10['push'](_0x22cb10['shift']());}};_0x38a6f8(++_0x20db4f);}(_0x05f1,0x1e8));var _0x105f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x05f1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x105f('0x0'));var md5=require(_0x105f('0x1'));var util=require(_0x105f('0x2'));var Redis=require(_0x105f('0x3'));var config=require('../../../config/environment');config[_0x105f('0x4')]=_[_0x105f('0x5')](config[_0x105f('0x4')],{'host':_0x105f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x16d849){this['id']=_0x16d849['id']||0x0;this[_0x105f('0x7')]=_0x16d849[_0x105f('0x7')]||'';this['timeout']=_0x16d849[_0x105f('0x8')]||0xa;this[_0x105f('0x9')]=_0x16d849[_0x105f('0x9')]||_0x105f('0xa');this[_0x105f('0xb')]=_0x16d849['Agents'];this[_0x105f('0xc')]={};this[_0x105f('0xd')]=0x0;this['md5']='';this[_0x105f('0xe')]();this[_0x105f('0xf')]();}SmsQueue[_0x105f('0x10')][_0x105f('0xe')]=function(){var _0x51c04a=this[_0x105f('0xc')][_0x105f('0x11')];this[_0x105f('0xc')]=_[_0x105f('0x12')](this[_0x105f('0xb')],'id');this[_0x105f('0xc')]['_rr']=_0x51c04a;};SmsQueue[_0x105f('0x10')][_0x105f('0xf')]=function(){this[_0x105f('0x13')]=0x0;this[_0x105f('0x14')]=0x0;for(var _0x41b657=0x0;_0x41b657=0x0?this[_0x105f('0x18')]:0x0;var _0x54d148={'id':this['id'],'available':this[_0x105f('0x18')],'loggedIn':this[_0x105f('0x13')],'name':this[_0x105f('0x7')],'paused':this['paused'],'waiting':this[_0x105f('0xd')]};var _0x2308fe=md5(JSON[_0x105f('0x19')](_0x54d148));if(this[_0x105f('0x1')]!==_0x2308fe){this['md5']=_0x2308fe;io['to'](util[_0x105f('0x1a')](_0x105f('0x1b'),_0x54d148[_0x105f('0x7')]))['emit'](_0x105f('0x1c'),_0x54d148);}};module[_0x105f('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 486844a..870c15e 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 _0x360a=['initFaxQueues','faxQueues','exports','util','lodash','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/faxQueue','agents','chatQueues','smsQueues','mailQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','prototype','initAgents','length','isUndefined','intervals','initOpenchannelQueues','openchannelQueues','updateRealtime','updateRouting','initSmsQueues','initMailQueues'];(function(_0x4471ff,_0x4bb7de){var _0xe723ca=function(_0xf3cc76){while(--_0xf3cc76){_0x4471ff['push'](_0x4471ff['shift']());}};_0xe723ca(++_0x4bb7de);}(_0x360a,0x1c5));var _0xa360=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x360a[_0x27af45];return _0x18df21;};'use strict';var BPromise=require('bluebird');var util=require(_0xa360('0x0'));var _=require(_0xa360('0x1'));var moment=require('moment');var Agent=require(_0xa360('0x2'));var Interval=require(_0xa360('0x3'));var OpenchannelQueue=require(_0xa360('0x4'));var ChatQueue=require(_0xa360('0x5'));var SmsQueue=require(_0xa360('0x6'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0xa360('0x7'));var Realtime=function(){this[_0xa360('0x8')]={};this['intervals']={};this['openchannelQueues']={};this[_0xa360('0x9')]={};this[_0xa360('0xa')]={};this[_0xa360('0xb')]={};this['faxQueues']={};this[_0xa360('0xc')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xa360('0xd')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x4d5f3a,_0x5002e3,_0x58ebf9){var _0x7f2851=_['mapKeys'](_0x4d5f3a,function(_0x47b592,_0x49c20b){return _0x47b592[_0x58ebf9];});for(var _0x17223c in _0x5002e3){if(_0x5002e3[_0xa360('0xe')](_0x17223c)){if(!_0x7f2851[_0x17223c]){delete _0x5002e3[_0x17223c];}}}}Realtime['prototype'][_0xa360('0xf')]=function(_0x27c044,_0x4cfec7){for(var _0x29dd29 in _0x4cfec7){if(_0x27c044[_0xa360('0xe')](_0x29dd29)){_0x27c044[_0x29dd29]=_0x4cfec7[_0x29dd29];}}};Realtime[_0xa360('0x10')][_0xa360('0x11')]=function(){var _0x5b130f=this;return function(_0x483923){if(_0x483923){freeIsNotKey(_0x483923,_0x5b130f[_0xa360('0x8')],'id');for(var _0x35a3d8=0x0,_0x1ca5d7={},_0x3a6e52={};_0x35a3d8<_0x483923[_0xa360('0x12')];_0x35a3d8+=0x1){_0x1ca5d7=_0x483923[_0x35a3d8];if(_[_0xa360('0x13')](_0x5b130f['agents'][_0x1ca5d7['id']])){_0x5b130f['agents'][_0x1ca5d7['id']]=new Agent(_0x1ca5d7);}else{_0x5b130f[_0xa360('0xf')](_0x5b130f[_0xa360('0x8')][_0x1ca5d7['id']],_0x1ca5d7);}}}return _0x5b130f[_0xa360('0x8')];};};Realtime[_0xa360('0x10')]['initIntervals']=function(){var _0x215958=this;return function(_0x272abe){if(_0x272abe){freeIsNotKey(_0x272abe,_0x215958['intervals'],'id');for(var _0x21e3b8=0x0,_0x1b22b8={},_0x21e338={};_0x21e3b8<_0x272abe['length'];_0x21e3b8+=0x1){_0x1b22b8=_0x272abe[_0x21e3b8];if(_[_0xa360('0x13')](_0x215958[_0xa360('0x14')][_0x1b22b8['id']])){_0x215958['intervals'][_0x1b22b8['id']]=new Interval(_0x1b22b8);}else{_0x215958['mergeFromDatabase'](_0x215958[_0xa360('0x14')][_0x1b22b8['id']],_0x1b22b8);}}}return _0x215958['intervals'];};};Realtime['prototype'][_0xa360('0x15')]=function(){var _0x3520e8=this;return function(_0x4c8613){if(_0x4c8613){freeIsNotKey(_0x4c8613,_0x3520e8[_0xa360('0x16')],'id');for(var _0x4a8b27=0x0,_0x3b9144={},_0x3cd02c={};_0x4a8b27<_0x4c8613['length'];_0x4a8b27+=0x1){_0x3b9144=_0x4c8613[_0x4a8b27];if(_['isUndefined'](_0x3520e8['openchannelQueues'][_0x3b9144['id']])){_0x3520e8[_0xa360('0x16')][_0x3b9144['id']]=new OpenchannelQueue(_0x3b9144);}else{_0x3520e8[_0xa360('0xf')](_0x3520e8[_0xa360('0x16')][_0x3b9144['id']],_0x3b9144);}_0x3520e8[_0xa360('0x16')][_0x3b9144['id']]['updateRouting']();_0x3520e8['openchannelQueues'][_0x3b9144['id']][_0xa360('0x17')]();}}return _0x3520e8[_0xa360('0x16')];};};Realtime[_0xa360('0x10')]['initChatQueues']=function(){var _0x35b7d5=this;return function(_0xfd4372){if(_0xfd4372){freeIsNotKey(_0xfd4372,_0x35b7d5[_0xa360('0x9')],'id');for(var _0x49a500=0x0,_0x695079={},_0x1f04ed={};_0x49a500<_0xfd4372[_0xa360('0x12')];_0x49a500+=0x1){_0x695079=_0xfd4372[_0x49a500];if(_[_0xa360('0x13')](_0x35b7d5[_0xa360('0x9')][_0x695079['id']])){_0x35b7d5[_0xa360('0x9')][_0x695079['id']]=new ChatQueue(_0x695079);}else{_0x35b7d5[_0xa360('0xf')](_0x35b7d5['chatQueues'][_0x695079['id']],_0x695079);}_0x35b7d5[_0xa360('0x9')][_0x695079['id']][_0xa360('0x18')]();_0x35b7d5[_0xa360('0x9')][_0x695079['id']]['updateRealtime']();}}return _0x35b7d5[_0xa360('0x9')];};};Realtime[_0xa360('0x10')][_0xa360('0x19')]=function(){var _0xc33e14=this;return function(_0x3e9d57){if(_0x3e9d57){freeIsNotKey(_0x3e9d57,_0xc33e14[_0xa360('0xa')],'id');for(var _0x8c7691=0x0,_0x3d6c24={},_0x1c9b00={};_0x8c7691<_0x3e9d57[_0xa360('0x12')];_0x8c7691+=0x1){_0x3d6c24=_0x3e9d57[_0x8c7691];if(_[_0xa360('0x13')](_0xc33e14[_0xa360('0xa')][_0x3d6c24['id']])){_0xc33e14['smsQueues'][_0x3d6c24['id']]=new SmsQueue(_0x3d6c24);}else{_0xc33e14[_0xa360('0xf')](_0xc33e14[_0xa360('0xa')][_0x3d6c24['id']],_0x3d6c24);}_0xc33e14['smsQueues'][_0x3d6c24['id']]['updateRouting']();_0xc33e14[_0xa360('0xa')][_0x3d6c24['id']][_0xa360('0x17')]();}}return _0xc33e14['smsQueues'];};};Realtime[_0xa360('0x10')][_0xa360('0x1a')]=function(){var _0x43765e=this;return function(_0x5652d5){if(_0x5652d5){freeIsNotKey(_0x5652d5,_0x43765e['mailQueues'],'id');for(var _0x493a54=0x0,_0x1751d5={},_0x5a86ef={};_0x493a54<_0x5652d5[_0xa360('0x12')];_0x493a54+=0x1){_0x1751d5=_0x5652d5[_0x493a54];if(_[_0xa360('0x13')](_0x43765e[_0xa360('0xb')][_0x1751d5['id']])){_0x43765e[_0xa360('0xb')][_0x1751d5['id']]=new MailQueue(_0x1751d5);}else{_0x43765e[_0xa360('0xf')](_0x43765e['mailQueues'][_0x1751d5['id']],_0x1751d5);}_0x43765e[_0xa360('0xb')][_0x1751d5['id']][_0xa360('0x18')]();_0x43765e[_0xa360('0xb')][_0x1751d5['id']][_0xa360('0x17')]();}}return _0x43765e[_0xa360('0xb')];};};Realtime[_0xa360('0x10')][_0xa360('0x1b')]=function(){var _0x2f78bb=this;return function(_0x2d1990){if(_0x2d1990){freeIsNotKey(_0x2d1990,_0x2f78bb['faxQueues'],'id');for(var _0x270bbe=0x0,_0x5df88={},_0x190daa={};_0x270bbe<_0x2d1990[_0xa360('0x12')];_0x270bbe+=0x1){_0x5df88=_0x2d1990[_0x270bbe];if(_['isUndefined'](_0x2f78bb[_0xa360('0x1c')][_0x5df88['id']])){_0x2f78bb[_0xa360('0x1c')][_0x5df88['id']]=new FaxQueue(_0x5df88);}else{_0x2f78bb[_0xa360('0xf')](_0x2f78bb[_0xa360('0x1c')][_0x5df88['id']],_0x5df88);}_0x2f78bb[_0xa360('0x1c')][_0x5df88['id']]['updateRouting']();_0x2f78bb[_0xa360('0x1c')][_0x5df88['id']][_0xa360('0x17')]();}}return _0x2f78bb[_0xa360('0x1c')];};};module[_0xa360('0x1d')]=Realtime; \ No newline at end of file +var _0x512a=['../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRealtime','updateRouting','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','lodash','moment'];(function(_0x49d931,_0x28440d){var _0xdbd5b0=function(_0x1e3db3){while(--_0x1e3db3){_0x49d931['push'](_0x49d931['shift']());}};_0xdbd5b0(++_0x28440d);}(_0x512a,0x104));var _0xa512=function(_0x3e8b4c,_0x561cff){_0x3e8b4c=_0x3e8b4c-0x0;var _0x2bce4e=_0x512a[_0x3e8b4c];return _0x2bce4e;};'use strict';var BPromise=require(_0xa512('0x0'));var util=require(_0xa512('0x1'));var _=require(_0xa512('0x2'));var moment=require(_0xa512('0x3'));var Agent=require(_0xa512('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xa512('0x5'));var ChatQueue=require(_0xa512('0x6'));var SmsQueue=require(_0xa512('0x7'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0xa512('0x8'));var Realtime=function(){this[_0xa512('0x9')]={};this[_0xa512('0xa')]={};this[_0xa512('0xb')]={};this[_0xa512('0xc')]={};this['smsQueues']={};this[_0xa512('0xd')]={};this[_0xa512('0xe')]={};this[_0xa512('0xf')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xa512('0x10')]={};this[_0xa512('0x11')]={};};function freeIsNotKey(_0x3bb647,_0x52e7e7,_0x366ae3){var _0x1977ba=_[_0xa512('0x12')](_0x3bb647,function(_0x38fede,_0x258913){return _0x38fede[_0x366ae3];});for(var _0x5a416b in _0x52e7e7){if(_0x52e7e7[_0xa512('0x13')](_0x5a416b)){if(!_0x1977ba[_0x5a416b]){delete _0x52e7e7[_0x5a416b];}}}}Realtime['prototype'][_0xa512('0x14')]=function(_0x13a4b6,_0x18e953){for(var _0x619029 in _0x18e953){if(_0x13a4b6[_0xa512('0x13')](_0x619029)){_0x13a4b6[_0x619029]=_0x18e953[_0x619029];}}};Realtime[_0xa512('0x15')][_0xa512('0x16')]=function(){var _0x4a1b53=this;return function(_0x5f45ee){if(_0x5f45ee){freeIsNotKey(_0x5f45ee,_0x4a1b53[_0xa512('0x9')],'id');for(var _0x2131ff=0x0,_0x172a8b={},_0x32ff0d={};_0x2131ff<_0x5f45ee[_0xa512('0x17')];_0x2131ff+=0x1){_0x172a8b=_0x5f45ee[_0x2131ff];if(_[_0xa512('0x18')](_0x4a1b53[_0xa512('0x9')][_0x172a8b['id']])){_0x4a1b53[_0xa512('0x9')][_0x172a8b['id']]=new Agent(_0x172a8b);}else{_0x4a1b53[_0xa512('0x14')](_0x4a1b53[_0xa512('0x9')][_0x172a8b['id']],_0x172a8b);}}}return _0x4a1b53[_0xa512('0x9')];};};Realtime[_0xa512('0x15')][_0xa512('0x19')]=function(){var _0x41bfbb=this;return function(_0x48147a){if(_0x48147a){freeIsNotKey(_0x48147a,_0x41bfbb[_0xa512('0xa')],'id');for(var _0x40e7c8=0x0,_0x412dc5={},_0x11dd0b={};_0x40e7c8<_0x48147a[_0xa512('0x17')];_0x40e7c8+=0x1){_0x412dc5=_0x48147a[_0x40e7c8];if(_[_0xa512('0x18')](_0x41bfbb['intervals'][_0x412dc5['id']])){_0x41bfbb[_0xa512('0xa')][_0x412dc5['id']]=new Interval(_0x412dc5);}else{_0x41bfbb[_0xa512('0x14')](_0x41bfbb[_0xa512('0xa')][_0x412dc5['id']],_0x412dc5);}}}return _0x41bfbb[_0xa512('0xa')];};};Realtime['prototype'][_0xa512('0x1a')]=function(){var _0x267c93=this;return function(_0x4595e7){if(_0x4595e7){freeIsNotKey(_0x4595e7,_0x267c93['openchannelQueues'],'id');for(var _0x6224cc=0x0,_0x35a809={},_0x534e65={};_0x6224cc<_0x4595e7[_0xa512('0x17')];_0x6224cc+=0x1){_0x35a809=_0x4595e7[_0x6224cc];if(_[_0xa512('0x18')](_0x267c93[_0xa512('0xb')][_0x35a809['id']])){_0x267c93[_0xa512('0xb')][_0x35a809['id']]=new OpenchannelQueue(_0x35a809);}else{_0x267c93['mergeFromDatabase'](_0x267c93[_0xa512('0xb')][_0x35a809['id']],_0x35a809);}_0x267c93[_0xa512('0xb')][_0x35a809['id']]['updateRouting']();_0x267c93[_0xa512('0xb')][_0x35a809['id']][_0xa512('0x1b')]();}}return _0x267c93['openchannelQueues'];};};Realtime['prototype']['initChatQueues']=function(){var _0x512f65=this;return function(_0xd30928){if(_0xd30928){freeIsNotKey(_0xd30928,_0x512f65[_0xa512('0xc')],'id');for(var _0x1de6d0=0x0,_0x1fafa9={},_0x375540={};_0x1de6d0<_0xd30928['length'];_0x1de6d0+=0x1){_0x1fafa9=_0xd30928[_0x1de6d0];if(_['isUndefined'](_0x512f65['chatQueues'][_0x1fafa9['id']])){_0x512f65['chatQueues'][_0x1fafa9['id']]=new ChatQueue(_0x1fafa9);}else{_0x512f65[_0xa512('0x14')](_0x512f65[_0xa512('0xc')][_0x1fafa9['id']],_0x1fafa9);}_0x512f65[_0xa512('0xc')][_0x1fafa9['id']][_0xa512('0x1c')]();_0x512f65['chatQueues'][_0x1fafa9['id']]['updateRealtime']();}}return _0x512f65[_0xa512('0xc')];};};Realtime[_0xa512('0x15')]['initSmsQueues']=function(){var _0x4d0d57=this;return function(_0x3189df){if(_0x3189df){freeIsNotKey(_0x3189df,_0x4d0d57[_0xa512('0x1d')],'id');for(var _0xdf0251=0x0,_0x7c6ceb={},_0xae14ff={};_0xdf0251<_0x3189df[_0xa512('0x17')];_0xdf0251+=0x1){_0x7c6ceb=_0x3189df[_0xdf0251];if(_[_0xa512('0x18')](_0x4d0d57[_0xa512('0x1d')][_0x7c6ceb['id']])){_0x4d0d57[_0xa512('0x1d')][_0x7c6ceb['id']]=new SmsQueue(_0x7c6ceb);}else{_0x4d0d57[_0xa512('0x14')](_0x4d0d57[_0xa512('0x1d')][_0x7c6ceb['id']],_0x7c6ceb);}_0x4d0d57['smsQueues'][_0x7c6ceb['id']][_0xa512('0x1c')]();_0x4d0d57[_0xa512('0x1d')][_0x7c6ceb['id']][_0xa512('0x1b')]();}}return _0x4d0d57[_0xa512('0x1d')];};};Realtime[_0xa512('0x15')][_0xa512('0x1e')]=function(){var _0x38626=this;return function(_0x43fcec){if(_0x43fcec){freeIsNotKey(_0x43fcec,_0x38626[_0xa512('0xd')],'id');for(var _0x2d6704=0x0,_0x331373={},_0x5d9770={};_0x2d6704<_0x43fcec[_0xa512('0x17')];_0x2d6704+=0x1){_0x331373=_0x43fcec[_0x2d6704];if(_[_0xa512('0x18')](_0x38626[_0xa512('0xd')][_0x331373['id']])){_0x38626['mailQueues'][_0x331373['id']]=new MailQueue(_0x331373);}else{_0x38626[_0xa512('0x14')](_0x38626[_0xa512('0xd')][_0x331373['id']],_0x331373);}_0x38626[_0xa512('0xd')][_0x331373['id']]['updateRouting']();_0x38626[_0xa512('0xd')][_0x331373['id']][_0xa512('0x1b')]();}}return _0x38626[_0xa512('0xd')];};};Realtime['prototype'][_0xa512('0x1f')]=function(){var _0x199cbb=this;return function(_0x1c7a71){if(_0x1c7a71){freeIsNotKey(_0x1c7a71,_0x199cbb['faxQueues'],'id');for(var _0x306811=0x0,_0x508683={},_0x48023e={};_0x306811<_0x1c7a71[_0xa512('0x17')];_0x306811+=0x1){_0x508683=_0x1c7a71[_0x306811];if(_['isUndefined'](_0x199cbb[_0xa512('0xe')][_0x508683['id']])){_0x199cbb['faxQueues'][_0x508683['id']]=new FaxQueue(_0x508683);}else{_0x199cbb[_0xa512('0x14')](_0x199cbb['faxQueues'][_0x508683['id']],_0x508683);}_0x199cbb[_0xa512('0xe')][_0x508683['id']][_0xa512('0x1c')]();_0x199cbb[_0xa512('0xe')][_0x508683['id']][_0xa512('0x1b')]();}}return _0x199cbb[_0xa512('0xe')];};};module[_0xa512('0x20')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index d85f868..ce2f83b 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 _0x6b96=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4c62db,_0x31f9bf){var _0x48e398=function(_0x3003b8){while(--_0x3003b8){_0x4c62db['push'](_0x4c62db['shift']());}};_0x48e398(++_0x31f9bf);}(_0x6b96,0xcf));var _0x66b9=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6b96[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0x66b9('0x0'));exports[_0x66b9('0x1')]=function(_0x59365e,_0xba3870){return client[_0x66b9('0x2')]('UpdateChatInteraction',{'body':_0xba3870,'options':{'where':{'id':_0x59365e}},'log':_0x66b9('0x3')});};exports[_0x66b9('0x4')]=function(_0x52b678,_0x2f6b5e){return client[_0x66b9('0x2')](_0x66b9('0x5'),{'body':_0x2f6b5e,'options':{'where':{'id':_0x52b678}},'log':_0x66b9('0x6')});}; \ No newline at end of file +var _0x16d1=['addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x14735c,_0x56c131){var _0x44e4f4=function(_0x5d565f){while(--_0x5d565f){_0x14735c['push'](_0x14735c['shift']());}};_0x44e4f4(++_0x56c131);}(_0x16d1,0x7f));var _0x116d=function(_0x3e1a10,_0x45a7f1){_0x3e1a10=_0x3e1a10-0x0;var _0x2edcc4=_0x16d1[_0x3e1a10];return _0x2edcc4;};'use strict';var client=require(_0x116d('0x0'));exports[_0x116d('0x1')]=function(_0x423078,_0x3282e8){return client['Request'](_0x116d('0x2'),{'body':_0x3282e8,'options':{'where':{'id':_0x423078}},'log':_0x116d('0x3')});};exports[_0x116d('0x4')]=function(_0x418ec9,_0x1416bc){return client['Request']('AddTagsToChatInteraction',{'body':_0x1416bc,'options':{'where':{'id':_0x418ec9}},'log':_0x116d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 33367bf..8718a0f 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 _0x9772=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x276b63,_0x5000a0){var _0x1de015=function(_0x4813ca){while(--_0x4813ca){_0x276b63['push'](_0x276b63['shift']());}};_0x1de015(++_0x5000a0);}(_0x9772,0x14c));var _0x2977=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x9772[_0xbd08b4];return _0x314f1e;};'use strict';var client=require('../client');exports[_0x2977('0x0')]=function(_0x4805a1){return client[_0x2977('0x1')](_0x2977('0x2'),{'body':_0x4805a1,'log':_0x2977('0x3')});}; \ No newline at end of file +var _0x87b4=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x449acc,_0x416458){var _0x15d15d=function(_0x5626a0){while(--_0x5626a0){_0x449acc['push'](_0x449acc['shift']());}};_0x15d15d(++_0x416458);}(_0x87b4,0x13b));var _0x487b=function(_0x446c00,_0x3b369a){_0x446c00=_0x446c00-0x0;var _0x4b8ab7=_0x87b4[_0x446c00];return _0x4b8ab7;};'use strict';var client=require(_0x487b('0x0'));exports[_0x487b('0x1')]=function(_0x27d229){return client[_0x487b('0x2')](_0x487b('0x3'),{'body':_0x27d229,'log':_0x487b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 33fc33b..5a98dc2 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 _0xcdb0=['name','online','getChatQueues','Request','GetChatQueue','timeout','strategy','Agents'];(function(_0x2a0674,_0x4948b9){var _0x45085a=function(_0x1a4a29){while(--_0x1a4a29){_0x2a0674['push'](_0x2a0674['shift']());}};_0x45085a(++_0x4948b9);}(_0xcdb0,0x6a));var _0x0cdb=function(_0x2300e4,_0x405675){_0x2300e4=_0x2300e4-0x0;var _0x36b134=_0xcdb0[_0x2300e4];return _0x36b134;};'use strict';var client=require('../client');exports[_0x0cdb('0x0')]=function(){return function(){return client[_0x0cdb('0x1')](_0x0cdb('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0cdb('0x3'),_0x0cdb('0x4')],'include':[{'model':'User','as':_0x0cdb('0x5'),'attributes':['id',_0x0cdb('0x6'),_0x0cdb('0x7'),'chatPause']}]},'log':_0x0cdb('0x0')});};}; \ No newline at end of file +var _0x3a0f=['name','strategy','Agents','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x392f1e,_0x1cd4b8){var _0xfc2059=function(_0x40e974){while(--_0x40e974){_0x392f1e['push'](_0x392f1e['shift']());}};_0xfc2059(++_0x1cd4b8);}(_0x3a0f,0x100));var _0xf3a0=function(_0x4e08c0,_0x551f16){_0x4e08c0=_0x4e08c0-0x0;var _0xf519df=_0x3a0f[_0x4e08c0];return _0xf519df;};'use strict';var client=require(_0xf3a0('0x0'));exports[_0xf3a0('0x1')]=function(){return function(){return client['Request'](_0xf3a0('0x2'),{'options':{'raw':![],'attributes':['id',_0xf3a0('0x3'),'timeout',_0xf3a0('0x4')],'include':[{'model':'User','as':_0xf3a0('0x5'),'attributes':['id','name','online',_0xf3a0('0x6')]}]},'log':_0xf3a0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 97d4074..50bb666 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 _0x1ae3=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x2bdd62,_0x3f0389){var _0xd3d0e9=function(_0x295311){while(--_0x295311){_0x2bdd62['push'](_0x2bdd62['shift']());}};_0xd3d0e9(++_0x3f0389);}(_0x1ae3,0x139));var _0x31ae=function(_0x236470,_0x752a84){_0x236470=_0x236470-0x0;var _0x2b858d=_0x1ae3[_0x236470];return _0x2b858d;};'use strict';var client=require(_0x31ae('0x0'));exports[_0x31ae('0x1')]=function(_0x50dfb3){return client[_0x31ae('0x2')](_0x31ae('0x3'),{'body':_0x50dfb3,'log':_0x31ae('0x3')});};exports[_0x31ae('0x4')]=function(_0x4f03c3,_0x16eaa4){return client[_0x31ae('0x2')](_0x31ae('0x5'),{'body':_0x16eaa4,'options':{'where':{'uniqueid':_0x4f03c3},'order':[['id',_0x31ae('0x6')]],'limit':0x1},'log':_0x31ae('0x5')});}; \ No newline at end of file +var _0x27c5=['DESC','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3043e2,_0x2fa9ac){var _0x108d92=function(_0xbda989){while(--_0xbda989){_0x3043e2['push'](_0x3043e2['shift']());}};_0x108d92(++_0x2fa9ac);}(_0x27c5,0x173));var _0x527c=function(_0x41358a,_0x322144){_0x41358a=_0x41358a-0x0;var _0x8c40ce=_0x27c5[_0x41358a];return _0x8c40ce;};'use strict';var client=require('../client');exports['create']=function(_0x157017){return client[_0x527c('0x0')](_0x527c('0x1'),{'body':_0x157017,'log':'CreateChatQueueReport'});};exports[_0x527c('0x2')]=function(_0x458db1,_0x371ae5){return client[_0x527c('0x0')](_0x527c('0x3'),{'body':_0x371ae5,'options':{'where':{'uniqueid':_0x458db1},'order':[['id',_0x527c('0x4')]],'limit':0x1},'log':_0x527c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d3091ec..ce0b0b4 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 _0x2613=['addTags','addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction'];(function(_0x4343ec,_0x4a4229){var _0x3470e7=function(_0x47cebc){while(--_0x47cebc){_0x4343ec['push'](_0x4343ec['shift']());}};_0x3470e7(++_0x4a4229);}(_0x2613,0x74));var _0x3261=function(_0xb7e2a4,_0x45cea5){_0xb7e2a4=_0xb7e2a4-0x0;var _0x58b4c1=_0x2613[_0xb7e2a4];return _0x58b4c1;};'use strict';var client=require(_0x3261('0x0'));exports[_0x3261('0x1')]=function(_0x477edc,_0x43ebaa){return client[_0x3261('0x2')](_0x3261('0x3'),{'body':_0x43ebaa,'options':{'where':{'id':_0x477edc}},'log':'updateFaxInteraction'});};exports[_0x3261('0x4')]=function(_0x395c84,_0x3a2aad){return client[_0x3261('0x2')]('AddTagsToFaxInteraction',{'body':_0x3a2aad,'options':{'where':{'id':_0x395c84}},'log':_0x3261('0x5')});}; \ No newline at end of file +var _0x3088=['addTags','../client','update','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x2be54e,_0x46de00){var _0x25abd0=function(_0x38a8cc){while(--_0x38a8cc){_0x2be54e['push'](_0x2be54e['shift']());}};_0x25abd0(++_0x46de00);}(_0x3088,0x85));var _0x8308=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x3088[_0x5cb97e];return _0x1714b4;};'use strict';var client=require(_0x8308('0x0'));exports[_0x8308('0x1')]=function(_0x3e23e7,_0x33a61f){return client[_0x8308('0x2')](_0x8308('0x3'),{'body':_0x33a61f,'options':{'where':{'id':_0x3e23e7}},'log':_0x8308('0x4')});};exports[_0x8308('0x5')]=function(_0x2b65d1,_0x5003fc){return client[_0x8308('0x2')]('AddTagsToFaxInteraction',{'body':_0x5003fc,'options':{'where':{'id':_0x2b65d1}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 378d791..33904b5 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 _0x3cc4=['../client','create','Request','CreateFaxMessage'];(function(_0x1e9ae6,_0x44fd4b){var _0x492cb9=function(_0x5c442f){while(--_0x5c442f){_0x1e9ae6['push'](_0x1e9ae6['shift']());}};_0x492cb9(++_0x44fd4b);}(_0x3cc4,0x1ac));var _0x43cc=function(_0x17efe2,_0x55516f){_0x17efe2=_0x17efe2-0x0;var _0x1130a3=_0x3cc4[_0x17efe2];return _0x1130a3;};'use strict';var client=require(_0x43cc('0x0'));exports[_0x43cc('0x1')]=function(_0x5e3b66){return client[_0x43cc('0x2')](_0x43cc('0x3'),{'body':_0x5e3b66,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x77c2=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x1253a7,_0xd89ec5){var _0x155530=function(_0x1516d6){while(--_0x1516d6){_0x1253a7['push'](_0x1253a7['shift']());}};_0x155530(++_0xd89ec5);}(_0x77c2,0x1a6));var _0x277c=function(_0x2d5887,_0xace828){_0x2d5887=_0x2d5887-0x0;var _0x257084=_0x77c2[_0x2d5887];return _0x257084;};'use strict';var client=require(_0x277c('0x0'));exports['create']=function(_0x1c010c){return client[_0x277c('0x1')](_0x277c('0x2'),{'body':_0x1c010c,'log':_0x277c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 3e93ce4..a813f48 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 _0x8811=['online','faxPause','getFaxQueues','Request','timeout','strategy','User','name'];(function(_0x23fb62,_0x56739d){var _0x7a4d4b=function(_0x2f16fb){while(--_0x2f16fb){_0x23fb62['push'](_0x23fb62['shift']());}};_0x7a4d4b(++_0x56739d);}(_0x8811,0x93));var _0x1881=function(_0x2a67ca,_0x4ac246){_0x2a67ca=_0x2a67ca-0x0;var _0x8f75e7=_0x8811[_0x2a67ca];return _0x8f75e7;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x1881('0x0')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x1881('0x1'),_0x1881('0x2')],'include':[{'model':_0x1881('0x3'),'as':'Agents','attributes':['id',_0x1881('0x4'),_0x1881('0x5'),_0x1881('0x6')]}]},'log':_0x1881('0x7')});};}; \ No newline at end of file +var _0x1a86=['strategy','Agents','name','online','faxPause','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x1a86,0xa8));var _0x61a8=function(_0x41f419,_0x4f00b7){_0x41f419=_0x41f419-0x0;var _0xba891f=_0x1a86[_0x41f419];return _0xba891f;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x61a8('0x0')](_0x61a8('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x61a8('0x2'),_0x61a8('0x3')],'include':[{'model':'User','as':_0x61a8('0x4'),'attributes':['id',_0x61a8('0x5'),_0x61a8('0x6'),_0x61a8('0x7')]}]},'log':_0x61a8('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c670b77..1449a3b 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 _0x8066=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x5227f2,_0x37f89b){var _0x847e83=function(_0xc02429){while(--_0xc02429){_0x5227f2['push'](_0x5227f2['shift']());}};_0x847e83(++_0x37f89b);}(_0x8066,0x83));var _0x6806=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x8066[_0x4e9d3c];return _0x2d0825;};'use strict';var client=require(_0x6806('0x0'));exports[_0x6806('0x1')]=function(_0x47bcfe){return client[_0x6806('0x2')](_0x6806('0x3'),{'body':_0x47bcfe,'log':_0x6806('0x3')});};exports['update']=function(_0x5e85c8,_0xa32000){return client[_0x6806('0x2')](_0x6806('0x4'),{'body':_0xa32000,'options':{'where':{'uniqueid':_0x5e85c8},'order':[['id','DESC']],'limit':0x1},'log':_0x6806('0x4')});}; \ No newline at end of file +var _0x4062=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x365d62,_0x12a21c){var _0x2f169e=function(_0x725b0e){while(--_0x725b0e){_0x365d62['push'](_0x365d62['shift']());}};_0x2f169e(++_0x12a21c);}(_0x4062,0x1ae));var _0x2406=function(_0x1bf92f,_0xdf611b){_0x1bf92f=_0x1bf92f-0x0;var _0x1b872c=_0x4062[_0x1bf92f];return _0x1b872c;};'use strict';var client=require('../client');exports[_0x2406('0x0')]=function(_0x4ace97){return client[_0x2406('0x1')]('CreateFaxQueueReport',{'body':_0x4ace97,'log':_0x2406('0x2')});};exports['update']=function(_0x1272de,_0x5239c5){return client[_0x2406('0x1')](_0x2406('0x3'),{'body':_0x5239c5,'options':{'where':{'uniqueid':_0x1272de},'order':[['id',_0x2406('0x4')]],'limit':0x1},'log':_0x2406('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 777bfff..253ec53 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 _0xc2da=['name','Intervals','interval','getIntervals','../client','Request'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xc2da,0x124));var _0xac2d=function(_0x2fe4b5,_0x439480){_0x2fe4b5=_0x2fe4b5-0x0;var _0x2b9c0b=_0xc2da[_0x2fe4b5];return _0x2b9c0b;};'use strict';var client=require(_0xac2d('0x0'));exports['getIntervals']=function(){return function(){return client[_0xac2d('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xac2d('0x2')],'include':[{'model':'Interval','as':_0xac2d('0x3'),'attributes':['id',_0xac2d('0x2'),_0xac2d('0x4')]}]},'log':_0xac2d('0x5')});};}; \ No newline at end of file +var _0x8603=['GetInterval','Intervals','name','interval','getIntervals','Request'];(function(_0x357f5d,_0x380aa6){var _0xed31f3=function(_0x1e3c69){while(--_0x1e3c69){_0x357f5d['push'](_0x357f5d['shift']());}};_0xed31f3(++_0x380aa6);}(_0x8603,0x190));var _0x3860=function(_0x54927d,_0x24b59f){_0x54927d=_0x54927d-0x0;var _0x1afb67=_0x8603[_0x54927d];return _0x1afb67;};'use strict';var client=require('../client');exports[_0x3860('0x0')]=function(){return function(){return client[_0x3860('0x1')](_0x3860('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x3860('0x3'),'attributes':['id',_0x3860('0x4'),_0x3860('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 59c03f8..726aa20 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 _0x2a0a=['update','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x384939,_0x3a32e0){var _0x5be50b=function(_0x2c94de){while(--_0x2c94de){_0x384939['push'](_0x384939['shift']());}};_0x5be50b(++_0x3a32e0);}(_0x2a0a,0x12c));var _0xa2a0=function(_0x3e0f9d,_0x4c8c8){_0x3e0f9d=_0x3e0f9d-0x0;var _0x3aea26=_0x2a0a[_0x3e0f9d];return _0x3aea26;};'use strict';var client=require(_0xa2a0('0x0'));exports[_0xa2a0('0x1')]=function(_0x58dac6,_0x1ccf4a){return client['Request'](_0xa2a0('0x2'),{'body':_0x1ccf4a,'options':{'where':{'id':_0x58dac6}},'log':_0xa2a0('0x3')});};exports[_0xa2a0('0x4')]=function(_0x33f55c,_0x488852){return client['Request'](_0xa2a0('0x5'),{'body':_0x488852,'options':{'where':{'id':_0x33f55c}},'log':_0xa2a0('0x6')});}; \ No newline at end of file +var _0x954e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','../client'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x954e,0x103));var _0xe954=function(_0x392d61,_0x5e29cd){_0x392d61=_0x392d61-0x0;var _0x3f5c1f=_0x954e[_0x392d61];return _0x3f5c1f;};'use strict';var client=require(_0xe954('0x0'));exports['update']=function(_0x40dd6f,_0x3fa659){return client[_0xe954('0x1')](_0xe954('0x2'),{'body':_0x3fa659,'options':{'where':{'id':_0x40dd6f}},'log':_0xe954('0x3')});};exports[_0xe954('0x4')]=function(_0x30e75c,_0x3b55eb){return client[_0xe954('0x1')]('AddTagsToMailInteraction',{'body':_0x3b55eb,'options':{'where':{'id':_0x30e75c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f0ad067..7c45c49 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 _0xf428=['create','CreateMailMessage','../client'];(function(_0x16cac4,_0x42f3a6){var _0x4403e4=function(_0x3ab2b4){while(--_0x3ab2b4){_0x16cac4['push'](_0x16cac4['shift']());}};_0x4403e4(++_0x42f3a6);}(_0xf428,0x1a6));var _0x8f42=function(_0x527f90,_0x19ac22){_0x527f90=_0x527f90-0x0;var _0x1d2a8d=_0xf428[_0x527f90];return _0x1d2a8d;};'use strict';var client=require(_0x8f42('0x0'));exports[_0x8f42('0x1')]=function(_0x4ad3a8){return client['Request'](_0x8f42('0x2'),{'body':_0x4ad3a8,'log':'createMailMessage'});}; \ No newline at end of file +var _0xfceb=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfceb,0x121));var _0xbfce=function(_0xb6f96b,_0x4f17fb){_0xb6f96b=_0xb6f96b-0x0;var _0x550dd9=_0xfceb[_0xb6f96b];return _0x550dd9;};'use strict';var client=require(_0xbfce('0x0'));exports['create']=function(_0x3dd5da){return client[_0xbfce('0x1')](_0xbfce('0x2'),{'body':_0x3dd5da,'log':_0xbfce('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ef510a9..db0ef54 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 _0xb61a=['strategy','User','Agents','mailPause','getMailQueues','../client','Request','name','timeout'];(function(_0x5cd933,_0x2039f6){var _0x30c5cb=function(_0x50cf3c){while(--_0x50cf3c){_0x5cd933['push'](_0x5cd933['shift']());}};_0x30c5cb(++_0x2039f6);}(_0xb61a,0x113));var _0xab61=function(_0x132e65,_0xb0a666){_0x132e65=_0x132e65-0x0;var _0x525420=_0xb61a[_0x132e65];return _0x525420;};'use strict';var client=require(_0xab61('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xab61('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xab61('0x2'),_0xab61('0x3'),_0xab61('0x4')],'include':[{'model':_0xab61('0x5'),'as':_0xab61('0x6'),'attributes':['id',_0xab61('0x2'),'online',_0xab61('0x7')]}]},'log':_0xab61('0x8')});};}; \ No newline at end of file +var _0x9aaf=['strategy','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name'];(function(_0x188c4a,_0x4f4fb7){var _0x4f08e6=function(_0x2edfe3){while(--_0x2edfe3){_0x188c4a['push'](_0x188c4a['shift']());}};_0x4f08e6(++_0x4f4fb7);}(_0x9aaf,0x1e2));var _0xf9aa=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x9aaf[_0x4067ac];return _0x53d74d;};'use strict';var client=require(_0xf9aa('0x0'));exports[_0xf9aa('0x1')]=function(){return function(){return client['Request'](_0xf9aa('0x2'),{'options':{'raw':![],'attributes':['id',_0xf9aa('0x3'),'timeout',_0xf9aa('0x4')],'include':[{'model':_0xf9aa('0x5'),'as':_0xf9aa('0x6'),'attributes':['id',_0xf9aa('0x3'),_0xf9aa('0x7'),_0xf9aa('0x8')]}]},'log':_0xf9aa('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d3d220c..adb6d3b 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 _0x9edc=['update','Request','DESC','../client','create','CreateMailQueueReport'];(function(_0xcbce9b,_0x527316){var _0x1c4cf3=function(_0x5f0eab){while(--_0x5f0eab){_0xcbce9b['push'](_0xcbce9b['shift']());}};_0x1c4cf3(++_0x527316);}(_0x9edc,0xed));var _0xc9ed=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x9edc[_0x14363e];return _0x17c56d;};'use strict';var client=require(_0xc9ed('0x0'));exports[_0xc9ed('0x1')]=function(_0x357050){return client['Request'](_0xc9ed('0x2'),{'body':_0x357050,'log':_0xc9ed('0x2')});};exports[_0xc9ed('0x3')]=function(_0x4f0729,_0x591f5e){return client[_0xc9ed('0x4')]('UpdateMailQueueReport',{'body':_0x591f5e,'options':{'where':{'uniqueid':_0x4f0729},'order':[['id',_0xc9ed('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x0e89=['../client','create','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x5c9014,_0x40b3b2){var _0x12545f=function(_0x521ae9){while(--_0x521ae9){_0x5c9014['push'](_0x5c9014['shift']());}};_0x12545f(++_0x40b3b2);}(_0x0e89,0xea));var _0x90e8=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0e89[_0x465028];return _0xb783d4;};'use strict';var client=require(_0x90e8('0x0'));exports[_0x90e8('0x1')]=function(_0x33da30){return client['Request'](_0x90e8('0x2'),{'body':_0x33da30,'log':'CreateMailQueueReport'});};exports[_0x90e8('0x3')]=function(_0x2d6194,_0x2307b7){return client['Request'](_0x90e8('0x4'),{'body':_0x2307b7,'options':{'where':{'uniqueid':_0x2d6194},'order':[['id',_0x90e8('0x5')]],'limit':0x1},'log':_0x90e8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 36cc50a..f011acf 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 _0x73ee=['addTagsToChatInteraction','../client','Request','addTags','AddTagsToOpenchannelInteraction'];(function(_0x12d271,_0x360d5e){var _0x4b7f1f=function(_0x4cd428){while(--_0x4cd428){_0x12d271['push'](_0x12d271['shift']());}};_0x4b7f1f(++_0x360d5e);}(_0x73ee,0x164));var _0xe73e=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x73ee[_0x3d42d8];return _0x27fc41;};'use strict';var client=require(_0xe73e('0x0'));exports['update']=function(_0x50a35e,_0x27dca6){return client[_0xe73e('0x1')]('UpdateOpenchannelInteraction',{'body':_0x27dca6,'options':{'where':{'id':_0x50a35e}},'log':'updateOpenchannelInteraction'});};exports[_0xe73e('0x2')]=function(_0x552cdb,_0x55dd9c){return client[_0xe73e('0x1')](_0xe73e('0x3'),{'body':_0x55dd9c,'options':{'where':{'id':_0x552cdb}},'log':_0xe73e('0x4')});}; \ No newline at end of file +var _0xe121=['updateOpenchannelInteraction','../client','Request'];(function(_0x1621fe,_0x6a6f4c){var _0x199616=function(_0x26a557){while(--_0x26a557){_0x1621fe['push'](_0x1621fe['shift']());}};_0x199616(++_0x6a6f4c);}(_0xe121,0x106));var _0x1e12=function(_0x4f1f23,_0x58456b){_0x4f1f23=_0x4f1f23-0x0;var _0x482667=_0xe121[_0x4f1f23];return _0x482667;};'use strict';var client=require(_0x1e12('0x0'));exports['update']=function(_0x18afd1,_0x1e42d7){return client[_0x1e12('0x1')]('UpdateOpenchannelInteraction',{'body':_0x1e42d7,'options':{'where':{'id':_0x18afd1}},'log':_0x1e12('0x2')});};exports['addTags']=function(_0x560bd0,_0x54b05e){return client[_0x1e12('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x54b05e,'options':{'where':{'id':_0x560bd0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2f03193..5ae397c 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 _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x4ac9b8,_0x5324db){var _0x4eaea4=function(_0x36edf6){while(--_0x36edf6){_0x4ac9b8['push'](_0x4ac9b8['shift']());}};_0x4eaea4(++_0x5324db);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x239193,_0x1585ef){_0x239193=_0x239193-0x0;var _0x4f51c3=_0xf3cd[_0x239193];return _0x4f51c3;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});}; \ No newline at end of file +var _0x9f62=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x49e843,_0x3f70b0){var _0x3334f5=function(_0x25b586){while(--_0x25b586){_0x49e843['push'](_0x49e843['shift']());}};_0x3334f5(++_0x3f70b0);}(_0x9f62,0x154));var _0x29f6=function(_0x1635bb,_0x49ae8d){_0x1635bb=_0x1635bb-0x0;var _0x305c06=_0x9f62[_0x1635bb];return _0x305c06;};'use strict';var client=require('../client');exports[_0x29f6('0x0')]=function(_0x4ce7cb){return client[_0x29f6('0x1')](_0x29f6('0x2'),{'body':_0x4ce7cb,'log':_0x29f6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 0700f49..36721e9 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 _0x21ee=['getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0x5a9cfe,_0x597e44){var _0x4e41fa=function(_0x262018){while(--_0x262018){_0x5a9cfe['push'](_0x5a9cfe['shift']());}};_0x4e41fa(++_0x597e44);}(_0x21ee,0x132));var _0xe21e=function(_0xf374fe,_0x53819d){_0xf374fe=_0xf374fe-0x0;var _0x567be8=_0x21ee[_0xf374fe];return _0x567be8;};'use strict';var client=require('../client');exports[_0xe21e('0x0')]=function(){return function(){return client[_0xe21e('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xe21e('0x2'),_0xe21e('0x3'),_0xe21e('0x4')],'include':[{'model':_0xe21e('0x5'),'as':_0xe21e('0x6'),'attributes':['id',_0xe21e('0x2'),_0xe21e('0x7'),_0xe21e('0x8')]}]},'log':_0xe21e('0x0')});};}; \ No newline at end of file +var _0xba05=['name','GetOpenchannelQueue','timeout','strategy','Agents'];(function(_0x5002f3,_0x3e23ff){var _0x5ab5c5=function(_0x53b204){while(--_0x53b204){_0x5002f3['push'](_0x5002f3['shift']());}};_0x5ab5c5(++_0x3e23ff);}(_0xba05,0x191));var _0x5ba0=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xba05[_0x27af45];return _0x18df21;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x5ba0('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x5ba0('0x1'),_0x5ba0('0x2')],'include':[{'model':'User','as':_0x5ba0('0x3'),'attributes':['id',_0x5ba0('0x4'),'online','openchannelPause']}]},'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 ce86e6b..b138e3a 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 _0x5b89=['update','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5b89,0xc0));var _0x95b8=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x5b89[_0x3a73bc];return _0x32891b;};'use strict';var client=require(_0x95b8('0x0'));exports[_0x95b8('0x1')]=function(_0x5a4c64){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x5a4c64,'log':_0x95b8('0x2')});};exports[_0x95b8('0x3')]=function(_0x39f7b7,_0x478c7a){return client['Request'](_0x95b8('0x4'),{'body':_0x478c7a,'options':{'where':{'uniqueid':_0x39f7b7},'order':[['id','DESC']],'limit':0x1},'log':_0x95b8('0x4')});}; \ No newline at end of file +var _0x99fd=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x99fd,0x174));var _0xd99f=function(_0x178738,_0x3f2eb8){_0x178738=_0x178738-0x0;var _0x3a867c=_0x99fd[_0x178738];return _0x3a867c;};'use strict';var client=require('../client');exports[_0xd99f('0x0')]=function(_0x18255a){return client['Request'](_0xd99f('0x1'),{'body':_0x18255a,'log':_0xd99f('0x1')});};exports[_0xd99f('0x2')]=function(_0xc6712f,_0x4b2019){return client[_0xd99f('0x3')](_0xd99f('0x4'),{'body':_0x4b2019,'options':{'where':{'uniqueid':_0xc6712f},'order':[['id',_0xd99f('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 4ca8c7e..858123d 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 _0xa731=['addTagsToSmsInteraction','Request','UpdateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x129787,_0x2614fc){var _0xc5d53=function(_0x2821e6){while(--_0x2821e6){_0x129787['push'](_0x129787['shift']());}};_0xc5d53(++_0x2614fc);}(_0xa731,0x1c5));var _0x1a73=function(_0x890983,_0x18a0d5){_0x890983=_0x890983-0x0;var _0x3e5ca6=_0xa731[_0x890983];return _0x3e5ca6;};'use strict';var client=require('../client');exports['update']=function(_0xfc2c6d,_0x3afb71){return client[_0x1a73('0x0')](_0x1a73('0x1'),{'body':_0x3afb71,'options':{'where':{'id':_0xfc2c6d}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x1a5ec3,_0x3e5e3f){return client[_0x1a73('0x0')](_0x1a73('0x2'),{'body':_0x3e5e3f,'options':{'where':{'id':_0x1a5ec3}},'log':_0x1a73('0x3')});}; \ No newline at end of file +var _0x2a96=['UpdateSmsInteraction','updateSmsInteraction','addTags','update','Request'];(function(_0x2228f7,_0x176dd1){var _0x40b592=function(_0x42483c){while(--_0x42483c){_0x2228f7['push'](_0x2228f7['shift']());}};_0x40b592(++_0x176dd1);}(_0x2a96,0x1ca));var _0x62a9=function(_0x45cbcf,_0xfbdbc2){_0x45cbcf=_0x45cbcf-0x0;var _0x52ece8=_0x2a96[_0x45cbcf];return _0x52ece8;};'use strict';var client=require('../client');exports[_0x62a9('0x0')]=function(_0x2bc99f,_0x34b5fb){return client[_0x62a9('0x1')](_0x62a9('0x2'),{'body':_0x34b5fb,'options':{'where':{'id':_0x2bc99f}},'log':_0x62a9('0x3')});};exports[_0x62a9('0x4')]=function(_0x3b7576,_0x2e4e7d){return client['Request']('AddTagsToSmsInteraction',{'body':_0x2e4e7d,'options':{'where':{'id':_0x3b7576}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3e9ba7b..f35fe7d 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 _0x8210=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x35a923,_0xeab730){var _0x3ac555=function(_0x45a7e6){while(--_0x45a7e6){_0x35a923['push'](_0x35a923['shift']());}};_0x3ac555(++_0xeab730);}(_0x8210,0xdc));var _0x0821=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8210[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x0821('0x0'));exports['create']=function(_0x3df424){return client[_0x0821('0x1')](_0x0821('0x2'),{'body':_0x3df424,'log':_0x0821('0x3')});}; \ No newline at end of file +var _0x3c5f=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x1a436c,_0x8d6959){var _0x5420eb=function(_0x5fd84f){while(--_0x5fd84f){_0x1a436c['push'](_0x1a436c['shift']());}};_0x5420eb(++_0x8d6959);}(_0x3c5f,0xb0));var _0xf3c5=function(_0x1df588,_0x4fdece){_0x1df588=_0x1df588-0x0;var _0x3ce24a=_0x3c5f[_0x1df588];return _0x3ce24a;};'use strict';var client=require(_0xf3c5('0x0'));exports[_0xf3c5('0x1')]=function(_0x42ae32){return client['Request'](_0xf3c5('0x2'),{'body':_0x42ae32,'log':_0xf3c5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0edad4f..5fc8eab 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 _0x855f=['name','timeout','strategy','Agents','getSmsQueues','../client','Request','GetSmsQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x855f,0x145));var _0xf855=function(_0x4da9dc,_0x384e59){_0x4da9dc=_0x4da9dc-0x0;var _0x1a9053=_0x855f[_0x4da9dc];return _0x1a9053;};'use strict';var client=require(_0xf855('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0xf855('0x1')](_0xf855('0x2'),{'options':{'raw':![],'attributes':['id',_0xf855('0x3'),_0xf855('0x4'),_0xf855('0x5')],'include':[{'model':'User','as':_0xf855('0x6'),'attributes':['id',_0xf855('0x3'),'online','smsPause']}]},'log':_0xf855('0x7')});};}; \ No newline at end of file +var _0x30c5=['Request','GetSmsQueue','name','timeout','strategy','User','online','../client','getSmsQueues'];(function(_0x4de3d9,_0x41ecac){var _0x29508d=function(_0x122373){while(--_0x122373){_0x4de3d9['push'](_0x4de3d9['shift']());}};_0x29508d(++_0x41ecac);}(_0x30c5,0x1e4));var _0x530c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x30c5[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x530c('0x0'));exports[_0x530c('0x1')]=function(){return function(){return client[_0x530c('0x2')](_0x530c('0x3'),{'options':{'raw':![],'attributes':['id',_0x530c('0x4'),_0x530c('0x5'),_0x530c('0x6')],'include':[{'model':_0x530c('0x7'),'as':'Agents','attributes':['id','name',_0x530c('0x8'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5b5fb2c..640cc4f 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 _0x83cd=['UpdateSmsQueueReport','../client','create','Request','CreateSmsQueueReport','update','DESC'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x83cd,0x17b));var _0xd83c=function(_0x30cdb7,_0x106d49){_0x30cdb7=_0x30cdb7-0x0;var _0x46abf3=_0x83cd[_0x30cdb7];return _0x46abf3;};'use strict';var client=require(_0xd83c('0x0'));exports[_0xd83c('0x1')]=function(_0x155e14){return client[_0xd83c('0x2')](_0xd83c('0x3'),{'body':_0x155e14,'log':'CreateSmsQueueReport'});};exports[_0xd83c('0x4')]=function(_0x1e79ec,_0x3bf389){return client[_0xd83c('0x2')]('UpdateSmsQueueReport',{'body':_0x3bf389,'options':{'where':{'uniqueid':_0x1e79ec},'order':[['id',_0xd83c('0x5')]],'limit':0x1},'log':_0xd83c('0x6')});}; \ No newline at end of file +var _0xe468=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x5d9507,_0x36a258){var _0x37fc07=function(_0x576ca1){while(--_0x576ca1){_0x5d9507['push'](_0x5d9507['shift']());}};_0x37fc07(++_0x36a258);}(_0xe468,0x92));var _0x8e46=function(_0x5c691f,_0x2336a7){_0x5c691f=_0x5c691f-0x0;var _0xc291cc=_0xe468[_0x5c691f];return _0xc291cc;};'use strict';var client=require(_0x8e46('0x0'));exports[_0x8e46('0x1')]=function(_0x27b7a6){return client[_0x8e46('0x2')]('CreateSmsQueueReport',{'body':_0x27b7a6,'log':_0x8e46('0x3')});};exports['update']=function(_0x8d642e,_0x2e1bc3){return client[_0x8e46('0x2')](_0x8e46('0x4'),{'body':_0x2e1bc3,'options':{'where':{'uniqueid':_0x8d642e},'order':[['id',_0x8e46('0x5')]],'limit':0x1},'log':_0x8e46('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 9c6a1d7..4e908e2 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 _0xf68f=['getAgents','Request','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity'];(function(_0x1314ff,_0x3e1b1a){var _0x19a986=function(_0x22d8be){while(--_0x22d8be){_0x1314ff['push'](_0x1314ff['shift']());}};_0x19a986(++_0x3e1b1a);}(_0xf68f,0x12c));var _0xff68=function(_0x5d6b1d,_0xd56a3a){_0x5d6b1d=_0x5d6b1d-0x0;var _0x927b2c=_0xf68f[_0x5d6b1d];return _0x927b2c;};'use strict';var client=require('../client');exports[_0xff68('0x0')]=function(){return function(){return client[_0xff68('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xff68('0x2')},'attributes':['id',_0xff68('0x3'),_0xff68('0x4'),_0xff68('0x5'),_0xff68('0x6'),_0xff68('0x7'),_0xff68('0x8'),_0xff68('0x9'),_0xff68('0xa'),'smsPause',_0xff68('0xb'),_0xff68('0xc'),_0xff68('0xd'),_0xff68('0xe'),'smsCapacity','openchannelCapacity']},'log':_0xff68('0x0')});};}; \ No newline at end of file +var _0x45e9=['openchannelCapacity','../client','getAgents','Request','agent','online','pauseType','mailPause','faxPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity'];(function(_0x12a3eb,_0x5ab078){var _0x3f902e=function(_0x4b99c9){while(--_0x4b99c9){_0x12a3eb['push'](_0x12a3eb['shift']());}};_0x3f902e(++_0x5ab078);}(_0x45e9,0x76));var _0x945e=function(_0x34d270,_0x33feff){_0x34d270=_0x34d270-0x0;var _0x5358b1=_0x45e9[_0x34d270];return _0x5358b1;};'use strict';var client=require(_0x945e('0x0'));exports[_0x945e('0x1')]=function(){return function(){return client[_0x945e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x945e('0x3')},'attributes':['id','name',_0x945e('0x4'),_0x945e('0x5'),'lastPauseAt','voicePause','chatPause',_0x945e('0x6'),_0x945e('0x7'),'smsPause',_0x945e('0x8'),'chatCapacity',_0x945e('0x9'),_0x945e('0xa'),_0x945e('0xb'),_0x945e('0xc')]},'log':'getAgents'});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index a3a5514..6bd535a 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 _0x8bfd=['stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message'];(function(_0x51d482,_0x172f4a){var _0xbe0fe5=function(_0x2b10e7){while(--_0x2b10e7){_0x51d482['push'](_0x51d482['shift']());}};_0xbe0fe5(++_0x172f4a);}(_0x8bfd,0x7a));var _0xd8bf=function(_0x486ab6,_0x257c0a){_0x486ab6=_0x486ab6-0x0;var _0x1ce5ea=_0x8bfd[_0x486ab6];return _0x1ce5ea;};'use strict';var schema=require(_0xd8bf('0x0'));var _=require(_0xd8bf('0x1'));var util=require('util');var seqqueue=require(_0xd8bf('0x2'));var logger=require(_0xd8bf('0x3'))(_0xd8bf('0x4'));var strategy=require(_0xd8bf('0x5'));var queue=schema({'name':{'type':_0xd8bf('0x6'),'required':!![],'message':_0xd8bf('0x7')},'timeout':{'type':_0xd8bf('0x8'),'message':_0xd8bf('0x9')}});function writeLog(_0x26ac4f,_0x2c0ffc,_0x2f3827){return logger['info'](util[_0xd8bf('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x26ac4f,_0x2c0ffc[_0xd8bf('0xb')],_0x2f3827));}function handleFindAgent(_0x2b1734){return function(_0x2cb473){return _0x2cb473['name'][_0xd8bf('0xc')]()===_0x2b1734[_0xd8bf('0xc')]();};}exports[_0xd8bf('0xd')]=function(_0x406592,_0x339d94,_0x1bc719,_0x5bfbc8){return function(_0x3e8492){try{var _0x5b9219={'name':_0x339d94[0x0],'timeout':_0x339d94[0x1]};var _0x17aa26=queue[_0xd8bf('0x0')](_0x5b9219,{'typecast':!![]});if(_0x17aa26['length']){logger[_0xd8bf('0xe')](_0xd8bf('0xf'),_0x406592,_[_0xd8bf('0x10')](_0x17aa26,_0xd8bf('0x11'))['join'](',\x20'));_0x3e8492[_0xd8bf('0x12')]();}else{var _0x6e9467=_[_0xd8bf('0x13')](_0x1bc719[_0xd8bf('0x14')],handleFindAgent(_0x5b9219['name']));if(_0x6e9467){var _0x705ef=(_0x5b9219[_0xd8bf('0x15')]||0xa)*0x3e8;var _0x1509c6,_0xc72b55;var _0x10ce71=seqqueue[_0xd8bf('0x16')](_0x705ef);_0x10ce71['id']=_0x406592;_0x10ce71[_0xd8bf('0x17')]=_0x705ef;_0x10ce71[_0xd8bf('0x18')]=_0x5bfbc8[_0xd8bf('0x18')];writeLog(_0x406592,_0x6e9467,util['format'](_0xd8bf('0x19'),_0x705ef));_0x1bc719[_0xd8bf('0x1a')][_0x406592]['on']('end',function(){_0x10ce71[_0xd8bf('0x1b')]();clearTimeout(_0xc72b55);_0xc72b55=undefined;if(_0x1bc719[_0xd8bf('0x1a')][_0x406592]){delete _0x1bc719[_0xd8bf('0x1a')][_0x406592];}logger[_0xd8bf('0x1c')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x406592);_0x3e8492['stop']();});_0xc72b55=setTimeout(function(){clearTimeout(_0xc72b55);_0x10ce71[_0xd8bf('0x1b')]();logger[_0xd8bf('0x1c')](_0xd8bf('0x1d'),_0x406592);_0x3e8492[_0xd8bf('0x1e')]();},_0x705ef);strategy[_0xd8bf('0x1f')](_0x10ce71,_0x6e9467,_0x1bc719,_0x5bfbc8);}else{logger[_0xd8bf('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x406592,_0x5b9219[_0xd8bf('0xb')]);_0x3e8492[_0xd8bf('0x12')]();}}}catch(_0x4f2dd8){console[_0xd8bf('0x20')](_0x4f2dd8);logger[_0xd8bf('0xe')](_0xd8bf('0x21'),_0x406592,_0x4f2dd8[_0xd8bf('0x22')]);_0x3e8492[_0xd8bf('0x12')]();}};}; \ No newline at end of file +var _0xadd2=['validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','join','stop','find','agents','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack'];(function(_0xc79ff0,_0x11ac4b){var _0x4c0049=function(_0x12bc56){while(--_0x12bc56){_0xc79ff0['push'](_0xc79ff0['shift']());}};_0x4c0049(++_0x11ac4b);}(_0xadd2,0x193));var _0x2add=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xadd2[_0x178e48];return _0x440d7e;};'use strict';var schema=require(_0x2add('0x0'));var _=require(_0x2add('0x1'));var util=require(_0x2add('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x2add('0x3'))(_0x2add('0x4'));var strategy=require(_0x2add('0x5'));var queue=schema({'name':{'type':_0x2add('0x6'),'required':!![],'message':_0x2add('0x7')},'timeout':{'type':_0x2add('0x8'),'message':_0x2add('0x9')}});function writeLog(_0x51f955,_0x528257,_0x4887bd){return logger[_0x2add('0xa')](util['format'](_0x2add('0xb'),_0x51f955,_0x528257[_0x2add('0xc')],_0x4887bd));}function handleFindAgent(_0x3e771e){return function(_0x32194a){return _0x32194a[_0x2add('0xc')]['toLowerCase']()===_0x3e771e[_0x2add('0xd')]();};}exports[_0x2add('0xe')]=function(_0x40ad54,_0x136929,_0x1a41e0,_0xe5a0d9){return function(_0x27526a){try{var _0xb4fd61={'name':_0x136929[0x0],'timeout':_0x136929[0x1]};var _0x11ce68=queue['validate'](_0xb4fd61,{'typecast':!![]});if(_0x11ce68['length']){logger[_0x2add('0xf')]('[%s][AGENT]\x20%s',_0x40ad54,_['map'](_0x11ce68,'message')[_0x2add('0x10')](',\x20'));_0x27526a[_0x2add('0x11')]();}else{var _0x2d9c7d=_[_0x2add('0x12')](_0x1a41e0[_0x2add('0x13')],handleFindAgent(_0xb4fd61[_0x2add('0xc')]));if(_0x2d9c7d){var _0x47e991=(_0xb4fd61['timeout']||0xa)*0x3e8;var _0x53135c,_0x54638b;var _0x3a0115=seqqueue['createQueue'](_0x47e991);_0x3a0115['id']=_0x40ad54;_0x3a0115[_0x2add('0x14')]=_0x47e991;_0x3a0115[_0x2add('0x15')]=_0xe5a0d9[_0x2add('0x15')];writeLog(_0x40ad54,_0x2d9c7d,util['format'](_0x2add('0x16'),_0x47e991));_0x1a41e0['rules'][_0x40ad54]['on']('end',function(){_0x3a0115['close']();clearTimeout(_0x54638b);_0x54638b=undefined;if(_0x1a41e0[_0x2add('0x17')][_0x40ad54]){delete _0x1a41e0['rules'][_0x40ad54];}logger['info'](_0x2add('0x18'),_0x40ad54);_0x27526a[_0x2add('0x11')]();});_0x54638b=setTimeout(function(){clearTimeout(_0x54638b);_0x3a0115['close']();logger['info'](_0x2add('0x19'),_0x40ad54);_0x27526a[_0x2add('0x1a')]();},_0x47e991);strategy[_0x2add('0x1b')](_0x3a0115,_0x2d9c7d,_0x1a41e0,_0xe5a0d9);}else{logger[_0x2add('0xf')](_0x2add('0x1c'),_0x40ad54,_0xb4fd61[_0x2add('0xc')]);_0x27526a[_0x2add('0x11')]();}}}catch(_0x3dc221){console['log'](_0x3dc221);logger[_0x2add('0xf')](_0x2add('0x1d'),_0x40ad54,_0x3dc221[_0x2add('0x1e')]);_0x27526a[_0x2add('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index a005521..80fd524 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 _0x4b50=['toString','then','dialogState','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message'];(function(_0x39da12,_0x2365e3){var _0x3c68a3=function(_0x464264){while(--_0x464264){_0x39da12['push'](_0x39da12['shift']());}};_0x3c68a3(++_0x2365e3);}(_0x4b50,0x79));var _0x04b5=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x4b50[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0x04b5('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x04b5('0x1'));var logger=require(_0x04b5('0x2'))(_0x04b5('0x3'));var rpc={'chatMessage':require(_0x04b5('0x4')),'openchannelMessage':require(_0x04b5('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x04b5('0x6'))};exports[_0x04b5('0x7')]=function(_0x477aeb,_0x492e7f){return function(_0x10d619){try{if(!_[_0x04b5('0x8')](this[_0x04b5('0x9')]['UserId'])){logger[_0x04b5('0xa')](_0x04b5('0xb'),_0x477aeb,_0x04b5('0xc'));return _0x10d619[_0x04b5('0xd')]();}var _0x3dbf58={'ContactId':this[_0x04b5('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x04b5('0xf')};var _0x3bb6bc=this[_0x04b5('0x10')];if(_0x3bb6bc==='chat'){_0x3dbf58['ChatWebsiteId']=this[_0x04b5('0x11')]['id'];}else{_0x3dbf58[_[_0x04b5('0x12')](_0x3bb6bc)+_0x04b5('0x13')]=this[_0x04b5('0x11')]['id'];}_0x3dbf58[_[_0x04b5('0x12')](_0x3bb6bc)+_0x04b5('0x14')]=this[_0x04b5('0x9')]['id'];if(this[_0x04b5('0x9')][_0x04b5('0x15')]){var _0x27ad6e=_0x492e7f[0x4];if(!_[_0x04b5('0x16')](_0x27ad6e)){_0x3dbf58[_0x04b5('0x17')]=utils['getMustacheRender'](_0x27ad6e,this);return rpc[_0x3bb6bc+_0x04b5('0x18')][_0x04b5('0x19')](_0x3dbf58)['then'](function(_0x12bda5){logger[_0x04b5('0xa')](_0x04b5('0xb'),_0x477aeb,_0x3dbf58[_0x04b5('0x17')]);})['catch'](function(_0x5cbd2e){logger[_0x04b5('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x477aeb,JSON[_0x04b5('0x1b')](_0x5cbd2e));})[_0x04b5('0x1c')](function(){logger[_0x04b5('0xa')](_0x04b5('0x1d'),_0x477aeb);_0x10d619[_0x04b5('0x1e')]();});}else{logger[_0x04b5('0xa')](_0x04b5('0x1f'),_0x477aeb);_0x10d619[_0x04b5('0x1e')]();}}else{var _0x3c6178=this;var _0x30af91=new AWS[(_0x04b5('0x20'))]({'accessKeyId':_0x492e7f[0x0],'secretAccessKey':_0x492e7f[0x1],'region':_0x492e7f[0x2]});var _0x2f33ae={'botAlias':_0x04b5('0x21'),'botName':_0x492e7f[0x3],'inputText':this[_0x04b5('0x22')]['body'],'userId':this['interaction']['id'][_0x04b5('0x23')]()};_0x30af91['postText'](_0x2f33ae,function(_0x1c4e7c,_0x2dc4e0){if(_0x1c4e7c){logger['error']('[%s][AMAZONLEX]\x20%s',_0x477aeb,_0x1c4e7c[_0x04b5('0x22')]);_0x10d619[_0x04b5('0xd')]();}else if(_0x2dc4e0&&_0x2dc4e0['message']){_0x3c6178[_0x04b5('0x17')]['amazonlex']=_0x2dc4e0;_0x3dbf58[_0x04b5('0x17')]=_0x2dc4e0[_0x04b5('0x22')];return rpc[_0x3bb6bc+_0x04b5('0x18')][_0x04b5('0x19')](_0x3dbf58)[_0x04b5('0x24')](function(_0x1cb8e5){logger[_0x04b5('0xa')]('[%s][AMAZONLEX]\x20%s',_0x477aeb,_0x3dbf58['body']);if(_0x2dc4e0[_0x04b5('0x25')]==_0x04b5('0x26')){_0x10d619[_0x04b5('0xd')]();}else{_0x10d619['stop']();}})['catch'](function(_0x32f8b2){logger['error']('[%s][AMAZONLEX]\x20%s',_0x477aeb,JSON['stringify'](_0x32f8b2));_0x10d619[_0x04b5('0xd')]();});}else{_0x10d619[_0x04b5('0xd')]();}});}}catch(_0x4296f1){logger[_0x04b5('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x477aeb,JSON[_0x04b5('0x1b')](_0x4296f1));_0x10d619['stop']();}};}; \ No newline at end of file +var _0x4d0e=['amazonlex','dialogState','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','Message','create','info','body','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message'];(function(_0x2e7ed0,_0x210592){var _0x475459=function(_0x38ae37){while(--_0x38ae37){_0x2e7ed0['push'](_0x2e7ed0['shift']());}};_0x475459(++_0x210592);}(_0x4d0e,0x163));var _0xe4d0=function(_0x1974ba,_0x5bb491){_0x1974ba=_0x1974ba-0x0;var _0x3883b1=_0x4d0e[_0x1974ba];return _0x3883b1;};'use strict';var _=require(_0xe4d0('0x0'));var moment=require(_0xe4d0('0x1'));var AWS=require(_0xe4d0('0x2'));var utils=require(_0xe4d0('0x3'));var logger=require(_0xe4d0('0x4'))(_0xe4d0('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe4d0('0x6')),'mailMessage':require(_0xe4d0('0x7')),'smsMessage':require(_0xe4d0('0x8')),'faxMessage':require(_0xe4d0('0x9'))};exports[_0xe4d0('0xa')]=function(_0x530745,_0x55379d){return function(_0x3eb82c){try{if(!_[_0xe4d0('0xb')](this[_0xe4d0('0xc')][_0xe4d0('0xd')])){logger['info'](_0xe4d0('0xe'),_0x530745,_0xe4d0('0xf'));return _0x3eb82c[_0xe4d0('0x10')]();}var _0x7aad79={'ContactId':this[_0xe4d0('0x11')]['id'],'sentAt':moment()[_0xe4d0('0x12')](_0xe4d0('0x13')),'direction':'out'};var _0x192a2d=this[_0xe4d0('0x14')];if(_0x192a2d===_0xe4d0('0x15')){_0x7aad79[_0xe4d0('0x16')]=this[_0xe4d0('0x17')]['id'];}else{_0x7aad79[_[_0xe4d0('0x18')](_0x192a2d)+_0xe4d0('0x19')]=this['account']['id'];}_0x7aad79[_[_0xe4d0('0x18')](_0x192a2d)+_0xe4d0('0x1a')]=this[_0xe4d0('0xc')]['id'];if(this[_0xe4d0('0xc')][_0xe4d0('0x1b')]){var _0x13692a=_0x55379d[0x4];if(!_['isEmpty'](_0x13692a)){_0x7aad79['body']=utils['getMustacheRender'](_0x13692a,this);return rpc[_0x192a2d+_0xe4d0('0x1c')][_0xe4d0('0x1d')](_0x7aad79)['then'](function(_0x5279e2){logger[_0xe4d0('0x1e')](_0xe4d0('0xe'),_0x530745,_0x7aad79[_0xe4d0('0x1f')]);})['catch'](function(_0x20534f){logger[_0xe4d0('0x20')](_0xe4d0('0xe'),_0x530745,JSON[_0xe4d0('0x21')](_0x20534f));})['finally'](function(){logger[_0xe4d0('0x1e')](_0xe4d0('0x22'),_0x530745);_0x3eb82c[_0xe4d0('0x23')]();});}else{logger[_0xe4d0('0x1e')](_0xe4d0('0x24'),_0x530745);_0x3eb82c[_0xe4d0('0x23')]();}}else{var _0x36241d=this;var _0x1d3592=new AWS[(_0xe4d0('0x25'))]({'accessKeyId':_0x55379d[0x0],'secretAccessKey':_0x55379d[0x1],'region':_0x55379d[0x2]});var _0x38ff8a={'botAlias':'$LATEST','botName':_0x55379d[0x3],'inputText':this['message'][_0xe4d0('0x1f')],'userId':this['interaction']['id'][_0xe4d0('0x26')]()};_0x1d3592[_0xe4d0('0x27')](_0x38ff8a,function(_0x16abb8,_0x1812a3){if(_0x16abb8){logger['error'](_0xe4d0('0xe'),_0x530745,_0x16abb8['message']);_0x3eb82c[_0xe4d0('0x10')]();}else if(_0x1812a3&&_0x1812a3[_0xe4d0('0x28')]){_0x36241d[_0xe4d0('0x1f')][_0xe4d0('0x29')]=_0x1812a3;_0x7aad79[_0xe4d0('0x1f')]=_0x1812a3[_0xe4d0('0x28')];return rpc[_0x192a2d+_0xe4d0('0x1c')][_0xe4d0('0x1d')](_0x7aad79)['then'](function(_0x320d03){logger[_0xe4d0('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x530745,_0x7aad79[_0xe4d0('0x1f')]);if(_0x1812a3[_0xe4d0('0x2a')]=='Failed'){_0x3eb82c[_0xe4d0('0x10')]();}else{_0x3eb82c[_0xe4d0('0x23')]();}})[_0xe4d0('0x2b')](function(_0x3d7432){logger['error'](_0xe4d0('0xe'),_0x530745,JSON[_0xe4d0('0x21')](_0x3d7432));_0x3eb82c[_0xe4d0('0x10')]();});}else{_0x3eb82c[_0xe4d0('0x10')]();}});}}catch(_0x360eb4){logger[_0xe4d0('0x20')](_0xe4d0('0xe'),_0x530745,JSON[_0xe4d0('0x21')](_0x360eb4));_0x3eb82c[_0xe4d0('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 3969b67..7808c16 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 aab0128..0b902ab 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 _0x530f=['then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction'];(function(_0x38168e,_0x1b7cb0){var _0x47cc70=function(_0x1a590c){while(--_0x1a590c){_0x38168e['push'](_0x38168e['shift']());}};_0x47cc70(++_0x1b7cb0);}(_0x530f,0x167));var _0xf530=function(_0x330a51,_0x42c33b){_0x330a51=_0x330a51-0x0;var _0x55aa63=_0x530f[_0x330a51];return _0x55aa63;};'use strict';var moment=require('moment');var logger=require(_0xf530('0x0'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf530('0x1')),'smsInteraction':require(_0xf530('0x2')),'mailInteraction':require(_0xf530('0x3')),'faxInteraction':require(_0xf530('0x4'))};exports[_0xf530('0x5')]=function(_0x2bacf8,_0x5cb04f,_0xa4e5b7,_0x58f5f8){return function(_0x3a0301){try{logger[_0xf530('0x6')](_0xf530('0x7'),_0x2bacf8,_0x5cb04f[0x0]);var _0x50682f={'closed':0x1,'closedAt':moment()[_0xf530('0x8')](_0xf530('0x9')),'closeReason':_0xf530('0xa'),'disposition':_0x5cb04f[0x0]};if(rpc[_0x58f5f8[_0xf530('0xb')]+_0xf530('0xc')]){rpc[_0x58f5f8[_0xf530('0xb')]+'Interaction'][_0xf530('0xd')](_0x58f5f8[_0xf530('0xe')]['id'],_0x50682f)[_0xf530('0xf')](function(_0x3fa562){logger[_0xf530('0x6')](_0xf530('0x10'),_0x2bacf8,_0x58f5f8['interaction']['id']);})['catch'](function(_0x35c314){logger[_0xf530('0x11')](_0xf530('0x12'),_0x2bacf8,JSON[_0xf530('0x13')](_0x35c314));})[_0xf530('0x14')](function(){_0x3a0301['stop']();});}}catch(_0x3f1917){logger[_0xf530('0x11')](_0xf530('0x12'),_0x2bacf8,JSON[_0xf530('0x13')](_0x3f1917));_0x3a0301[_0xf530('0x15')]();}};}; \ No newline at end of file +var _0x7a40=['interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a40,0x197));var _0x07a4=function(_0x96df96,_0x1284e4){_0x96df96=_0x96df96-0x0;var _0x40054e=_0x7a40[_0x96df96];return _0x40054e;};'use strict';var moment=require(_0x07a4('0x0'));var logger=require(_0x07a4('0x1'))(_0x07a4('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x07a4('0x3')),'smsInteraction':require(_0x07a4('0x4')),'mailInteraction':require(_0x07a4('0x5')),'faxInteraction':require(_0x07a4('0x6'))};exports[_0x07a4('0x7')]=function(_0x48a3da,_0x334e7a,_0x130748,_0x3a53fb){return function(_0x399d0f){try{logger[_0x07a4('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x48a3da,_0x334e7a[0x0]);var _0xd06c30={'closed':0x1,'closedAt':moment()[_0x07a4('0x9')](_0x07a4('0xa')),'closeReason':'system','disposition':_0x334e7a[0x0]};if(rpc[_0x3a53fb['channel']+_0x07a4('0xb')]){rpc[_0x3a53fb[_0x07a4('0xc')]+'Interaction']['update'](_0x3a53fb[_0x07a4('0xd')]['id'],_0xd06c30)['then'](function(_0x44342a){logger['info'](_0x07a4('0xe'),_0x48a3da,_0x3a53fb['interaction']['id']);})[_0x07a4('0xf')](function(_0x224bf9){logger[_0x07a4('0x10')](_0x07a4('0x11'),_0x48a3da,JSON['stringify'](_0x224bf9));})[_0x07a4('0x12')](function(){_0x399d0f[_0x07a4('0x13')]();});}}catch(_0x1f75b2){logger['error'](_0x07a4('0x11'),_0x48a3da,JSON['stringify'](_0x1f75b2));_0x399d0f[_0x07a4('0x13')]();}};}; \ 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 4715878..5efe027 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 _0x6f5b=['endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','interaction','UserId','next','contact','out','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','Message','info','[%s][DIALOGFLOW]\x20%s','catch','error','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','then','dialogflow','result','fulfillment','speech','create'];(function(_0x2b55fa,_0x4db49a){var _0xd0ceff=function(_0x5c4f14){while(--_0x5c4f14){_0x2b55fa['push'](_0x2b55fa['shift']());}};_0xd0ceff(++_0x4db49a);}(_0x6f5b,0x17b));var _0xb6f5=function(_0x556e7b,_0x4c8896){_0x556e7b=_0x556e7b-0x0;var _0x60e380=_0x6f5b[_0x556e7b];return _0x60e380;};'use strict';var _=require(_0xb6f5('0x0'));var moment=require('moment');var apiai=require(_0xb6f5('0x1'));var md5=require(_0xb6f5('0x2'));var utils=require(_0xb6f5('0x3'));var logger=require(_0xb6f5('0x4'))(_0xb6f5('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb6f5('0x6')),'mailMessage':require(_0xb6f5('0x7')),'smsMessage':require(_0xb6f5('0x8')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xb6f5('0x9')]=function(_0x2e8853,_0x2241de){return function(_0x1342f7){try{if(!_['isNil'](this[_0xb6f5('0xa')][_0xb6f5('0xb')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2e8853,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1342f7[_0xb6f5('0xc')]();}var _0x4cebd2={'ContactId':this[_0xb6f5('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb6f5('0xe')};var _0xfec832=this['channel'];if(_0xfec832==='chat'){_0x4cebd2[_0xb6f5('0xf')]=this[_0xb6f5('0x10')]['id'];}else{_0x4cebd2[_['upperFirst'](_0xfec832)+_0xb6f5('0x11')]=this[_0xb6f5('0x10')]['id'];}_0x4cebd2[_[_0xb6f5('0x12')](_0xfec832)+_0xb6f5('0x13')]=this[_0xb6f5('0xa')]['id'];if(this[_0xb6f5('0xa')][_0xb6f5('0x14')]){var _0x1ebb62=_0x2241de[0x2];if(!_['isEmpty'](_0x1ebb62)){_0x4cebd2[_0xb6f5('0x15')]=utils[_0xb6f5('0x16')](_0x1ebb62,this);return rpc[_0xfec832+_0xb6f5('0x17')]['create'](_0x4cebd2)['then'](function(_0x58e98f){logger[_0xb6f5('0x18')](_0xb6f5('0x19'),_0x2e8853,_0x4cebd2[_0xb6f5('0x15')]);})[_0xb6f5('0x1a')](function(_0x58bfea){logger[_0xb6f5('0x1b')](_0xb6f5('0x19'),_0x2e8853,JSON[_0xb6f5('0x1c')](_0x58bfea));})[_0xb6f5('0x1d')](function(){logger[_0xb6f5('0x18')](_0xb6f5('0x1e'),_0x2e8853);_0x1342f7['stop']();});}else{logger['info'](_0xb6f5('0x1f'),_0x2e8853);_0x1342f7[_0xb6f5('0x20')]();}}else{var _0xa6bab2=this;var _0xb378a5=apiai(_0x2241de[0x0],{'language':_0x2241de[0x1]||'en'});return _0xb378a5[_0xb6f5('0x21')](this[_0xb6f5('0x22')]['body'],{'sessionId':md5(this[_0xb6f5('0xa')]['id'])})[_0xb6f5('0x23')](function(_0x5c1e73){_0xa6bab2[_0xb6f5('0x15')][_0xb6f5('0x24')]=_0x5c1e73;_0x4cebd2[_0xb6f5('0x15')]=_0x5c1e73[_0xb6f5('0x25')][_0xb6f5('0x26')][_0xb6f5('0x27')];return rpc[_0xfec832+_0xb6f5('0x17')][_0xb6f5('0x28')](_0x4cebd2)[_0xb6f5('0x23')](function(_0x555355){logger[_0xb6f5('0x18')](_0xb6f5('0x19'),_0x2e8853,_0x4cebd2[_0xb6f5('0x15')]);if(_0x5c1e73['result']['metadata'][_0xb6f5('0x29')]){_0x1342f7['next']();}else{_0x1342f7[_0xb6f5('0x20')]();}})[_0xb6f5('0x1a')](function(_0x46b51d){logger[_0xb6f5('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x2e8853,JSON[_0xb6f5('0x1c')](_0x46b51d));_0x1342f7[_0xb6f5('0xc')]();});})[_0xb6f5('0x1a')](function(_0x474ba9){logger[_0xb6f5('0x1b')](_0xb6f5('0x19'),_0x2e8853,_0x474ba9[_0xb6f5('0x22')]);_0x1342f7[_0xb6f5('0xc')]();});}}catch(_0x562459){logger[_0xb6f5('0x1b')](_0xb6f5('0x19'),_0x2e8853,JSON[_0xb6f5('0x1c')](_0x562459));_0x1342f7[_0xb6f5('0x20')]();}};}; \ No newline at end of file +var _0x9ceb=['UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','chat','ChatWebsiteId','upperFirst','AccountId','account','isEmpty','body','getMustacheRender','create','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','then','dialogflow','result','fulfillment','speech','metadata','moment','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','interaction'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9ceb,0x1a4));var _0xb9ce=function(_0x3289c0,_0x300cb4){_0x3289c0=_0x3289c0-0x0;var _0x52409c=_0x9ceb[_0x3289c0];return _0x52409c;};'use strict';var _=require('lodash');var moment=require(_0xb9ce('0x0'));var apiai=require('apiai-promise');var md5=require(_0xb9ce('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xb9ce('0x2'));var rpc={'chatMessage':require(_0xb9ce('0x3')),'openchannelMessage':require(_0xb9ce('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb9ce('0x5')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xb9ce('0x6')]=function(_0x665df,_0x46f238){return function(_0x3f1759){try{if(!_[_0xb9ce('0x7')](this[_0xb9ce('0x8')][_0xb9ce('0x9')])){logger[_0xb9ce('0xa')](_0xb9ce('0xb'),_0x665df,_0xb9ce('0xc'));return _0x3f1759[_0xb9ce('0xd')]();}var _0xff140f={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb9ce('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb9ce('0xf')};var _0x1d8ea7=this['channel'];if(_0x1d8ea7===_0xb9ce('0x10')){_0xff140f[_0xb9ce('0x11')]=this['account']['id'];}else{_0xff140f[_[_0xb9ce('0x12')](_0x1d8ea7)+_0xb9ce('0x13')]=this[_0xb9ce('0x14')]['id'];}_0xff140f[_['upperFirst'](_0x1d8ea7)+'InteractionId']=this[_0xb9ce('0x8')]['id'];if(this[_0xb9ce('0x8')]['created']){var _0x22eab2=_0x46f238[0x2];if(!_[_0xb9ce('0x15')](_0x22eab2)){_0xff140f[_0xb9ce('0x16')]=utils[_0xb9ce('0x17')](_0x22eab2,this);return rpc[_0x1d8ea7+'Message'][_0xb9ce('0x18')](_0xff140f)['then'](function(_0x351030){logger[_0xb9ce('0xa')](_0xb9ce('0xb'),_0x665df,_0xff140f[_0xb9ce('0x16')]);})[_0xb9ce('0x19')](function(_0x4f05f8){logger[_0xb9ce('0x1a')](_0xb9ce('0xb'),_0x665df,JSON[_0xb9ce('0x1b')](_0x4f05f8));})[_0xb9ce('0x1c')](function(){logger[_0xb9ce('0xa')](_0xb9ce('0x1d'),_0x665df);_0x3f1759[_0xb9ce('0x1e')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x665df);_0x3f1759['stop']();}}else{var _0x19caa1=this;var _0x52020b=apiai(_0x46f238[0x0],{'language':_0x46f238[0x1]||'en'});return _0x52020b[_0xb9ce('0x1f')](this[_0xb9ce('0x20')]['body'],{'sessionId':md5(this[_0xb9ce('0x8')]['id'])})[_0xb9ce('0x21')](function(_0x48ca68){_0x19caa1[_0xb9ce('0x16')][_0xb9ce('0x22')]=_0x48ca68;_0xff140f[_0xb9ce('0x16')]=_0x48ca68[_0xb9ce('0x23')][_0xb9ce('0x24')][_0xb9ce('0x25')];return rpc[_0x1d8ea7+'Message'][_0xb9ce('0x18')](_0xff140f)[_0xb9ce('0x21')](function(_0x367917){logger[_0xb9ce('0xa')](_0xb9ce('0xb'),_0x665df,_0xff140f[_0xb9ce('0x16')]);if(_0x48ca68[_0xb9ce('0x23')][_0xb9ce('0x26')]['endConversation']){_0x3f1759[_0xb9ce('0xd')]();}else{_0x3f1759['stop']();}})[_0xb9ce('0x19')](function(_0x74646b){logger['error'](_0xb9ce('0xb'),_0x665df,JSON[_0xb9ce('0x1b')](_0x74646b));_0x3f1759[_0xb9ce('0xd')]();});})[_0xb9ce('0x19')](function(_0x4d118b){logger[_0xb9ce('0x1a')](_0xb9ce('0xb'),_0x665df,_0x4d118b[_0xb9ce('0x20')]);_0x3f1759['next']();});}}catch(_0x2e18ff){logger[_0xb9ce('0x1a')](_0xb9ce('0xb'),_0x665df,JSON['stringify'](_0x2e18ff));_0x3f1759[_0xb9ce('0x1e')]();}};}; \ 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 fdf5d1b..88e79c6 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 _0xc4c4=['[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error'];(function(_0x35b88f,_0x3432b8){var _0x2440bb=function(_0x252861){while(--_0x252861){_0x35b88f['push'](_0x35b88f['shift']());}};_0x2440bb(++_0x3432b8);}(_0xc4c4,0x196));var _0x4c4c=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0xc4c4[_0x364b32];return _0x3f3ea0;};'use strict';var schema=require(_0x4c4c('0x0'));var _=require(_0x4c4c('0x1'));var htmlToText=require(_0x4c4c('0x2'));var utils=require(_0x4c4c('0x3'));var logger=require('../../../../config/logger')(_0x4c4c('0x4'));var gotoif=schema({'condition':{'type':_0x4c4c('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4c4c('0x6'),'message':_0x4c4c('0x7')},'priorityFalse':{'type':_0x4c4c('0x6'),'message':_0x4c4c('0x8')}});exports[_0x4c4c('0x9')]=function(_0x30e4af,_0x4d9759){return function(_0x85bcb8){try{var _0xc135a={'condition':htmlToText[_0x4c4c('0xa')](utils[_0x4c4c('0xb')](_0x4d9759[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4d9759[0x1],'priorityFalse':_0x4d9759[0x2]};var _0x15c316=gotoif['validate'](_0xc135a,{'typecast':!![]});if(_0x15c316[_0x4c4c('0xc')]){logger[_0x4c4c('0xd')](_0x4c4c('0xe'),_0x30e4af,_[_0x4c4c('0xf')](_0x15c316,_0x4c4c('0x10'))[_0x4c4c('0x11')](',\x20'));_0x85bcb8[_0x4c4c('0x12')]();}else{try{var _0x25c522=eval('('+_0xc135a['condition']+')');var _0x3461dd=_0x25c522?_0xc135a[_0x4c4c('0x13')]:_0xc135a[_0x4c4c('0x14')];logger[_0x4c4c('0x15')](_0x4c4c('0x16'),_0x30e4af,_0xc135a[_0x4c4c('0x17')],_0x25c522,_0x3461dd||'next');if(_0x3461dd){var _0x3f9dab=_[_0x4c4c('0x18')](_0x85bcb8[_0x4c4c('0x19')](),{'p':_0x3461dd});if(_0x3f9dab>=0x0){logger[_0x4c4c('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x30e4af,_0x3461dd||'next',_0x3f9dab);_0x85bcb8['next'](_0x3f9dab);}else{logger[_0x4c4c('0x15')](_0x4c4c('0x1a'),_0x30e4af,_0x3461dd||_0x4c4c('0x1b'));_0x85bcb8['stop']();}}else{_0x85bcb8[_0x4c4c('0x1b')]();}}catch(_0x36fc6b){logger[_0x4c4c('0xd')](_0x4c4c('0x1c'),_0x30e4af,_0x36fc6b[_0x4c4c('0x10')]);_0x85bcb8[_0x4c4c('0x12')]();}}}catch(_0x5c989e){logger[_0x4c4c('0xd')]('[%s][GOTOIF]\x20%s',_0x30e4af,JSON[_0x4c4c('0x1d')](_0x5c989e));_0x85bcb8[_0x4c4c('0x12')]();}};}; \ No newline at end of file +var _0x22af=['lodash','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','map','message','stop','priorityFalse','info','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x22af,0x128));var _0xf22a=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0x22af[_0x4bb593];return _0x2da2d8;};'use strict';var schema=require(_0xf22a('0x0'));var _=require(_0xf22a('0x1'));var htmlToText=require(_0xf22a('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf22a('0x3'));var gotoif=schema({'condition':{'type':_0xf22a('0x4'),'required':!![],'message':_0xf22a('0x5')},'priorityTrue':{'type':_0xf22a('0x6'),'message':_0xf22a('0x7')},'priorityFalse':{'type':'number','message':_0xf22a('0x8')}});exports[_0xf22a('0x9')]=function(_0x95922e,_0x3ff04a){return function(_0x3df20f){try{var _0x1de756={'condition':htmlToText[_0xf22a('0xa')](utils[_0xf22a('0xb')](_0x3ff04a[0x0],this),{'wordwrap':![]})[_0xf22a('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3ff04a[0x1],'priorityFalse':_0x3ff04a[0x2]};var _0xd30ca1=gotoif[_0xf22a('0x0')](_0x1de756,{'typecast':!![]});if(_0xd30ca1['length']){logger['error'](_0xf22a('0xd'),_0x95922e,_[_0xf22a('0xe')](_0xd30ca1,_0xf22a('0xf'))['join'](',\x20'));_0x3df20f[_0xf22a('0x10')]();}else{try{var _0x290c0d=eval('('+_0x1de756['condition']+')');var _0x1b5710=_0x290c0d?_0x1de756['priorityTrue']:_0x1de756[_0xf22a('0x11')];logger[_0xf22a('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x95922e,_0x1de756[_0xf22a('0x13')],_0x290c0d,_0x1b5710||_0xf22a('0x14'));if(_0x1b5710){var _0x51b3a2=_['findIndex'](_0x3df20f[_0xf22a('0x15')](),{'p':_0x1b5710});if(_0x51b3a2>=0x0){logger[_0xf22a('0x12')](_0xf22a('0x16'),_0x95922e,_0x1b5710||_0xf22a('0x14'),_0x51b3a2);_0x3df20f[_0xf22a('0x14')](_0x51b3a2);}else{logger[_0xf22a('0x12')](_0xf22a('0x17'),_0x95922e,_0x1b5710||'next');_0x3df20f[_0xf22a('0x10')]();}}else{_0x3df20f[_0xf22a('0x14')]();}}catch(_0x4194bb){logger[_0xf22a('0x18')](_0xf22a('0x19'),_0x95922e,_0x4194bb['message']);_0x3df20f[_0xf22a('0x10')]();}}}catch(_0x2fb4ec){logger['error'](_0xf22a('0xd'),_0x95922e,JSON[_0xf22a('0x1a')](_0x2fb4ec));_0x3df20f[_0xf22a('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 56dbf28..42094f8 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 _0xd386=['stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xd386,0x141));var _0x6d38=function(_0x2a7f29,_0x2c89dc){_0x2a7f29=_0x2a7f29-0x0;var _0x38924b=_0xd386[_0x2a7f29];return _0x38924b;};'use strict';var schema=require(_0x6d38('0x0'));var _=require(_0x6d38('0x1'));var logger=require('../../../../config/logger')(_0x6d38('0x2'));var gotop=schema({'priority':{'type':_0x6d38('0x3'),'required':!![],'message':_0x6d38('0x4')}});exports[_0x6d38('0x5')]=function(_0x55904d,_0x4b3827){return function(_0x528614){try{var _0x32c66e={'priority':_0x4b3827[0x0]};var _0xd49bba=gotop['validate'](_0x32c66e,{'typecast':!![]});if(_0xd49bba[_0x6d38('0x6')]){logger[_0x6d38('0x7')]('[%s][GOTOP]\x20%s',_0x55904d,_[_0x6d38('0x8')](_0xd49bba,'message')[_0x6d38('0x9')](',\x20'));_0x528614[_0x6d38('0xa')]();}else{logger[_0x6d38('0xb')](_0x6d38('0xc'),_0x55904d,_0x32c66e[_0x6d38('0xd')]);if(_0x32c66e[_0x6d38('0xd')]){var _0x3f8b8e=_[_0x6d38('0xe')](_0x528614[_0x6d38('0xf')](),{'p':_0x32c66e[_0x6d38('0xd')]});if(_0x3f8b8e>=0x0){logger[_0x6d38('0xb')](_0x6d38('0x10'),_0x55904d,_0x32c66e[_0x6d38('0xd')]||_0x6d38('0x11'),_0x3f8b8e);_0x528614[_0x6d38('0x11')](_0x3f8b8e);}else{logger[_0x6d38('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x55904d,_0x32c66e[_0x6d38('0xd')]||_0x6d38('0x11'));_0x528614['stop']();}}else{_0x528614[_0x6d38('0x11')]();}}}catch(_0x6b2097){logger[_0x6d38('0x7')](_0x6d38('0x12'),_0x55904d,JSON[_0x6d38('0x13')](_0x6b2097));_0x528614[_0x6d38('0xa')]();}};}; \ No newline at end of file +var _0x4203=['consequence','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x265f8d,_0x197a54){var _0x4970be=function(_0x23d191){while(--_0x23d191){_0x265f8d['push'](_0x265f8d['shift']());}};_0x4970be(++_0x197a54);}(_0x4203,0xc3));var _0x3420=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4203[_0x164eca];return _0x2ce562;};'use strict';var schema=require('validate');var _=require(_0x3420('0x0'));var logger=require(_0x3420('0x1'))(_0x3420('0x2'));var gotop=schema({'priority':{'type':_0x3420('0x3'),'required':!![],'message':_0x3420('0x4')}});exports[_0x3420('0x5')]=function(_0x5c6218,_0x1d5e68){return function(_0x4897fc){try{var _0x46931e={'priority':_0x1d5e68[0x0]};var _0x4ed60f=gotop['validate'](_0x46931e,{'typecast':!![]});if(_0x4ed60f[_0x3420('0x6')]){logger[_0x3420('0x7')](_0x3420('0x8'),_0x5c6218,_[_0x3420('0x9')](_0x4ed60f,'message')[_0x3420('0xa')](',\x20'));_0x4897fc[_0x3420('0xb')]();}else{logger[_0x3420('0xc')](_0x3420('0xd'),_0x5c6218,_0x46931e[_0x3420('0xe')]);if(_0x46931e[_0x3420('0xe')]){var _0x4085d1=_[_0x3420('0xf')](_0x4897fc[_0x3420('0x10')](),{'p':_0x46931e[_0x3420('0xe')]});if(_0x4085d1>=0x0){logger[_0x3420('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5c6218,_0x46931e[_0x3420('0xe')]||_0x3420('0x11'),_0x4085d1);_0x4897fc['next'](_0x4085d1);}else{logger['info'](_0x3420('0x12'),_0x5c6218,_0x46931e[_0x3420('0xe')]||_0x3420('0x11'));_0x4897fc['stop']();}}else{_0x4897fc[_0x3420('0x11')]();}}}catch(_0x402f70){logger[_0x3420('0x7')](_0x3420('0x8'),_0x5c6218,JSON[_0x3420('0x13')](_0x402f70));_0x4897fc[_0x3420('0xb')]();}};}; \ 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 be34fc1..c0f6237 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 _0x617d=['channel','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','stop','error','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','chat','account','upperFirst'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x617d,0x1dd));var _0xd617=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x617d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0xd617('0x0'))('routing');var rpc={'chatMessage':require(_0xd617('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd617('0x2')),'smsMessage':require(_0xd617('0x3')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x658557,_0x115243){return function(_0x26a19f){try{var _0x2cdc32={'body':utils[_0xd617('0x4')](_0x115243[0x0],this),'ContactId':this[_0xd617('0x5')]['id']};if(this['channel']===_0xd617('0x6')){_0x2cdc32['ChatWebsiteId']=this[_0xd617('0x7')]['id'];}else{_0x2cdc32[_[_0xd617('0x8')](this[_0xd617('0x9')])+'AccountId']=this[_0xd617('0x7')]['id'];}_0x2cdc32[_[_0xd617('0x8')](this[_0xd617('0x9')])+'InteractionId']=this[_0xd617('0xa')]['id'];if(rpc[this['channel']+_0xd617('0xb')]){return rpc[this[_0xd617('0x9')]+'Message'][_0xd617('0xc')](_0x2cdc32)[_0xd617('0xd')](function(_0x2313b2){logger['info'](_0xd617('0xe'),_0x658557,_0x2cdc32['body']);_0x26a19f[_0xd617('0xf')]();})['catch'](function(_0x6b0b43){logger['error'](_0xd617('0xe'),_0x658557,JSON['stringify'](_0x6b0b43));_0x26a19f[_0xd617('0x10')]();});}}catch(_0x1e6281){logger[_0xd617('0x11')]('[%s][MESSAGE]\x20%s',_0x658557,JSON['stringify'](_0x1e6281));_0x26a19f[_0xd617('0x10')]();}};}; \ No newline at end of file +var _0x7cb3=['lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','AccountId','account','interaction','Message','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop'];(function(_0x5f221f,_0xe2f7be){var _0x49d4cd=function(_0x459135){while(--_0x459135){_0x5f221f['push'](_0x5f221f['shift']());}};_0x49d4cd(++_0xe2f7be);}(_0x7cb3,0x12b));var _0x37cb=function(_0x49bb08,_0x5e51ec){_0x49bb08=_0x49bb08-0x0;var _0x992beb=_0x7cb3[_0x49bb08];return _0x992beb;};'use strict';var _=require(_0x37cb('0x0'));var utils=require(_0x37cb('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x37cb('0x2')),'mailMessage':require(_0x37cb('0x3')),'smsMessage':require(_0x37cb('0x4')),'faxMessage':require(_0x37cb('0x5'))};exports[_0x37cb('0x6')]=function(_0x50e858,_0x15334d){return function(_0x270afb){try{var _0x554749={'body':utils[_0x37cb('0x7')](_0x15334d[0x0],this),'ContactId':this[_0x37cb('0x8')]['id']};if(this[_0x37cb('0x9')]===_0x37cb('0xa')){_0x554749['ChatWebsiteId']=this['account']['id'];}else{_0x554749[_[_0x37cb('0xb')](this[_0x37cb('0x9')])+_0x37cb('0xc')]=this[_0x37cb('0xd')]['id'];}_0x554749[_[_0x37cb('0xb')](this['channel'])+'InteractionId']=this[_0x37cb('0xe')]['id'];if(rpc[this[_0x37cb('0x9')]+_0x37cb('0xf')]){return rpc[this[_0x37cb('0x9')]+_0x37cb('0xf')]['create'](_0x554749)['then'](function(_0x5bc29c){logger['info'](_0x37cb('0x10'),_0x50e858,_0x554749[_0x37cb('0x11')]);_0x270afb[_0x37cb('0x12')]();})[_0x37cb('0x13')](function(_0x1a0adc){logger[_0x37cb('0x14')](_0x37cb('0x10'),_0x50e858,JSON['stringify'](_0x1a0adc));_0x270afb['stop']();});}}catch(_0x430f20){logger[_0x37cb('0x14')](_0x37cb('0x10'),_0x50e858,JSON[_0x37cb('0x15')](_0x430f20));_0x270afb[_0x37cb('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 9d4c395..7a4f428 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 _0x2be4=['stop','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error'];(function(_0x1c067b,_0xf80ffa){var _0x439f91=function(_0x49afde){while(--_0x49afde){_0x1c067b['push'](_0x1c067b['shift']());}};_0x439f91(++_0xf80ffa);}(_0x2be4,0xef));var _0x42be=function(_0x48889c,_0x514e1a){_0x48889c=_0x48889c-0x0;var _0x4cea76=_0x2be4[_0x48889c];return _0x4cea76;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x42be('0x0'));exports[_0x42be('0x1')]=function(_0x465912,_0x57a2e3){return function(_0xa572b6){try{logger[_0x42be('0x2')](_0x42be('0x3'),_0x465912,utils[_0x42be('0x4')](_0x57a2e3[0x0],this));_0xa572b6['next']();}catch(_0x25069c){logger[_0x42be('0x5')](_0x42be('0x3'),_0x465912,JSON['stringify'](_0x25069c));_0xa572b6[_0x42be('0x6')]();}};}; \ No newline at end of file +var _0x82b1=['[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0x82b1,0xa6));var _0x182b=function(_0x2865ce,_0x351229){_0x2865ce=_0x2865ce-0x0;var _0x2839aa=_0x82b1[_0x2865ce];return _0x2839aa;};'use strict';var utils=require(_0x182b('0x0'));var logger=require(_0x182b('0x1'))(_0x182b('0x2'));exports[_0x182b('0x3')]=function(_0x486ccb,_0x56acac){return function(_0x5423a5){try{logger[_0x182b('0x4')](_0x182b('0x5'),_0x486ccb,utils[_0x182b('0x6')](_0x56acac[0x0],this));_0x5423a5['next']();}catch(_0x40067d){logger['error'](_0x182b('0x5'),_0x486ccb,JSON[_0x182b('0x7')](_0x40067d));_0x5423a5[_0x182b('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 5708f5c..b2456fa 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 _0xaf5a=['redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','chat','AccountId','account','info','name','message','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xaf5a,0xe6));var _0xaaf5=function(_0x3b4585,_0x16a9c2){_0x3b4585=_0x3b4585-0x0;var _0x551be9=_0xaf5a[_0x3b4585];return _0x551be9;};'use strict';var schema=require(_0xaaf5('0x0'));var _=require(_0xaaf5('0x1'));var util=require(_0xaaf5('0x2'));var seqqueue=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var Redis=require('ioredis');var config=require(_0xaaf5('0x5'));var logger=require('../../../../config/logger')(_0xaaf5('0x6'));var strategy=require('./strategy');config[_0xaaf5('0x7')]=_[_0xaaf5('0x8')](config[_0xaaf5('0x7')],{'host':_0xaaf5('0x9'),'port':0x18eb});var io=require(_0xaaf5('0xa'))(new Redis(config[_0xaaf5('0x7')]));var attributes=['id',_0xaaf5('0xb'),'account',_0xaaf5('0xc'),_0xaaf5('0xd'),_0xaaf5('0xe')];function emit(_0x24f1b6,_0x51ced0,_0x1b7423){io['to'](_0x24f1b6)[_0xaaf5('0xf')](_0x51ced0,_0x1b7423);}function emitChannelQueueInteraction(_0x4f903b,_0x28f9a7,_0x1acc43,_0x422779,_0x34fa76,_0x4988ef,_0x1cf4ae,_0x44358b){_0x1acc43[_0xaaf5('0xb')]=_0x44358b;_0x1acc43['queue']=_0x28f9a7;_0x1acc43['account']=_0x422779;_0x1acc43['id']=_0x34fa76;if(_0x4988ef){_0x1cf4ae[util[_0xaaf5('0x10')](_0xaaf5('0x11'),_0x4f903b)][_0x34fa76]=_[_0xaaf5('0x12')](_0x1acc43,attributes);}else{delete _0x1cf4ae[util['format'](_0xaaf5('0x11'),_0x4f903b)][_0x34fa76];}emit(util[_0xaaf5('0x10')](_0xaaf5('0x13'),_0x4f903b,_0x28f9a7),util[_0xaaf5('0x10')](_0xaaf5('0x14'),_0x4f903b,_0x4988ef?_0xaaf5('0x15'):'remove'),_[_0xaaf5('0x12')](_0x1acc43,attributes));}var rpc={'openchannelQueueReport':require(_0xaaf5('0x16')),'mailQueueReport':require(_0xaaf5('0x17')),'chatQueueReport':require(_0xaaf5('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xaaf5('0x19'))};var queue=schema({'name':{'type':_0xaaf5('0x1a'),'required':!![],'message':_0xaaf5('0x1b')},'timeout':{'type':'number','message':_0xaaf5('0x1c')}});function startRouting(_0x1f3334,_0x17dfde,_0x24e442,_0xa13929){if(_0x1f3334&&_0x17dfde&&_0x24e442){_0x17dfde[_0xaaf5('0x1d')]+=0x1;var _0xa070={'uniqueid':_0x1f3334,'from':_0x24e442[_0xaaf5('0x1e')]?_0x24e442['body']['from']:'','joinAt':moment()[_0xaaf5('0x10')](_0xaaf5('0x1f')),'ContactId':_0x24e442[_0xaaf5('0x20')]?_0x24e442['contact']['id']:null,'ListId':_0x24e442[_0xaaf5('0x21')]?_0x24e442[_0xaaf5('0x21')]['id']:null};_0xa070[_['upperFirst'](_0x24e442[_0xaaf5('0x22')])+_0xaaf5('0x23')]=_0x17dfde['id']||null;_0xa070[_[_0xaaf5('0x24')](_0x24e442['channel'])+_0xaaf5('0x25')]=_0x24e442[_0xaaf5('0x26')]?_0x24e442[_0xaaf5('0x26')]['id']:null;_0xa070[_['upperFirst'](_0x24e442[_0xaaf5('0x22')])+_0xaaf5('0x27')]=_0x24e442['message']?_0x24e442['message']['id']:null;_0xa070[_['upperFirst'](_0x24e442[_0xaaf5('0x22')])+(_0x24e442[_0xaaf5('0x22')]!==_0xaaf5('0x28')?_0xaaf5('0x29'):'WebsiteId')]=_0x24e442['account']?_0x24e442[_0xaaf5('0x2a')]['id']:null;logger[_0xaaf5('0x2b')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x1f3334,_0x17dfde[_0xaaf5('0x2c')]));emitChannelQueueInteraction(_0x24e442['channel'],_0x17dfde['name'],_0xa070,_0x24e442[_0xaaf5('0x2a')][_0xaaf5('0x2c')],_0x24e442[_0xaaf5('0x2d')]['id'],!![],_0xa13929,_0x17dfde['id']);if(rpc[_0x24e442['channel']+_0xaaf5('0x2e')]){return rpc[_0x24e442['channel']+_0xaaf5('0x2e')][_0xaaf5('0x2f')](_0xa070)['catch'](function(_0x54116e){logger[_0xaaf5('0x30')](_0xaaf5('0x31'));});}}}function stopRouting(_0x2050b0,_0x44f5ca,_0x3db659,_0x520521){if(_0x2050b0&&_0x44f5ca){_0x44f5ca[_0xaaf5('0x1d')]-=0x1;var _0x4c51ad={'leaveAt':moment()['format'](_0xaaf5('0x1f')),'acceptAt':moment()['format'](_0xaaf5('0x1f')),'reason':_0xaaf5('0x32')};logger[_0xaaf5('0x2b')](util[_0xaaf5('0x10')](_0xaaf5('0x33'),_0x2050b0,_0x44f5ca[_0xaaf5('0x2c')]));emitChannelQueueInteraction(_0x3db659['channel'],_0x44f5ca['name'],_0x3db659[_0xaaf5('0x1e')],_0x3db659[_0xaaf5('0x2a')][_0xaaf5('0x2c')],_0x3db659[_0xaaf5('0x2d')]['id'],![],_0x520521,_0x44f5ca['id']);if(rpc[_0x3db659[_0xaaf5('0x22')]+_0xaaf5('0x2e')]){return rpc[_0x3db659[_0xaaf5('0x22')]+'QueueReport']['update'](_0x2050b0,_0x4c51ad)[_0xaaf5('0x34')](function(_0x845800){logger[_0xaaf5('0x30')](_0xaaf5('0x35'));});}}}function endRouting(_0x48ff15,_0x659b35,_0x2450ba,_0xf123f3){if(_0x48ff15&&_0x659b35){_0x659b35[_0xaaf5('0x1d')]-=0x1;var _0x25ef8f={'leaveAt':moment()[_0xaaf5('0x10')](_0xaaf5('0x1f')),'exitAt':moment()[_0xaaf5('0x10')](_0xaaf5('0x1f')),'reason':_0xaaf5('0x36')};logger[_0xaaf5('0x2b')](util[_0xaaf5('0x10')](_0xaaf5('0x37'),_0x48ff15,_0x659b35[_0xaaf5('0x2c')]));emitChannelQueueInteraction(_0x2450ba[_0xaaf5('0x22')],_0x659b35['name'],_0x2450ba[_0xaaf5('0x1e')],_0x2450ba[_0xaaf5('0x2a')][_0xaaf5('0x2c')],_0x2450ba[_0xaaf5('0x2d')]['id'],![],_0xf123f3);if(rpc[_0x2450ba[_0xaaf5('0x22')]+'QueueReport']){return rpc[_0x2450ba[_0xaaf5('0x22')]+_0xaaf5('0x2e')][_0xaaf5('0x38')](_0x48ff15,_0x25ef8f)[_0xaaf5('0x34')](function(_0x221143){logger[_0xaaf5('0x30')](_0xaaf5('0x35'));});}}}function handleFindQueue(_0x398b9f){return function(_0x3375d0){return _0x3375d0[_0xaaf5('0x2c')][_0xaaf5('0x39')]()===_0x398b9f['toLowerCase']();};}exports[_0xaaf5('0x3a')]=function(_0x51879b,_0x51b2f1,_0x2ba912,_0x64b517){return function(_0x5d4ac7){try{var _0x3087e5={'name':_0x51b2f1[0x0],'timeout':_0x51b2f1[0x1]};var _0xe6a2ca=queue[_0xaaf5('0x0')](_0x3087e5,{'typecast':!![]});if(_0xe6a2ca[_0xaaf5('0x3b')]){logger[_0xaaf5('0x30')](_0xaaf5('0x3c'),_0x51879b,_[_0xaaf5('0x3d')](_0xe6a2ca,_0xaaf5('0x2d'))[_0xaaf5('0x3e')](',\x20'));_0x5d4ac7[_0xaaf5('0x3f')]();}else{var _0x44c743=_['find'](_0x2ba912[_0x64b517[_0xaaf5('0x22')]+_0xaaf5('0x40')],handleFindQueue(_0x3087e5[_0xaaf5('0x2c')]));if(_0x44c743){startRouting(_0x51879b,_0x44c743,_0x64b517,_0x2ba912);var _0x2aed5b=(_0x44c743[_0xaaf5('0x36')]||0xa)*0x3e8;var _0x5a9c93=(_0x3087e5[_0xaaf5('0x36')]||0x14)*0x3e8;var _0x4bf773,_0x183924;if(_0x2aed5b>_0x5a9c93){_0x5a9c93=_0x2aed5b;}var _0x390ce4=seqqueue[_0xaaf5('0x41')](_0x2aed5b);_0x390ce4['id']=_0x51879b;_0x390ce4['atimeout']=_0x2aed5b;_0x390ce4[_0xaaf5('0x42')]=_0x5a9c93;_0x390ce4[_0xaaf5('0x22')]=_0x64b517[_0xaaf5('0x22')];_0x2ba912['rules'][_0x51879b]['on'](_0xaaf5('0x43'),function(){stopRouting(_0x51879b,_0x44c743,_0x64b517,_0x2ba912);_0x390ce4[_0xaaf5('0x44')](!![]);clearTimeout(_0x4bf773);_0x4bf773=undefined;if(_0x2ba912[_0xaaf5('0x45')][_0x51879b]){delete _0x2ba912[_0xaaf5('0x45')][_0x51879b];}logger[_0xaaf5('0x2b')](_0xaaf5('0x46'),_0x51879b);_0x5d4ac7['stop']();});_0x4bf773=setTimeout(function(){endRouting(_0x51879b,_0x44c743,_0x64b517,_0x2ba912);clearTimeout(_0x4bf773);_0x390ce4[_0xaaf5('0x44')](!![]);logger['info'](_0xaaf5('0x47'),_0x51879b);_0x5d4ac7[_0xaaf5('0x48')]();},_0x5a9c93);switch(_0x44c743[_0xaaf5('0x49')]){case _0xaaf5('0x4a'):strategy[_0xaaf5('0x4a')](_0x390ce4,_0x44c743,_0x2ba912,_0x64b517);break;default:strategy[_0xaaf5('0x4b')](_0x390ce4,_0x44c743,_0x2ba912,_0x64b517);}}else{logger[_0xaaf5('0x30')](_0xaaf5('0x4c'),_0x51879b,_0x3087e5['name']);_0x5d4ac7[_0xaaf5('0x3f')]();}}}catch(_0xde91c7){console[_0xaaf5('0x4d')](_0xde91c7);logger[_0xaaf5('0x30')](_0xaaf5('0x3c'),_0x51879b,_0xde91c7[_0xaaf5('0x4e')]);_0x5d4ac7[_0xaaf5('0x3f')]();}};}; \ No newline at end of file +var _0xbe37=['end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','from','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','create\x20queue\x20report','waiting','accepted','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','Queues','createQueue','atimeout'];(function(_0x179b74,_0x5dc97d){var _0x268f76=function(_0x19c8c2){while(--_0x19c8c2){_0x179b74['push'](_0x179b74['shift']());}};_0x268f76(++_0x5dc97d);}(_0xbe37,0x144));var _0x7be3=function(_0x465b38,_0x28d6e6){_0x465b38=_0x465b38-0x0;var _0x41be7c=_0xbe37[_0x465b38];return _0x41be7c;};'use strict';var schema=require(_0x7be3('0x0'));var _=require(_0x7be3('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0x7be3('0x2'));var Redis=require('ioredis');var config=require(_0x7be3('0x3'));var logger=require(_0x7be3('0x4'))(_0x7be3('0x5'));var strategy=require('./strategy');config[_0x7be3('0x6')]=_[_0x7be3('0x7')](config[_0x7be3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7be3('0x8'))(new Redis(config[_0x7be3('0x6')]));var attributes=['id',_0x7be3('0x9'),_0x7be3('0xa'),_0x7be3('0xb'),_0x7be3('0xc'),'joinAt'];function emit(_0x26f740,_0x48b8a6,_0x80d5f4){io['to'](_0x26f740)[_0x7be3('0xd')](_0x48b8a6,_0x80d5f4);}function emitChannelQueueInteraction(_0x42275a,_0x3b79a2,_0x35f749,_0x37849b,_0xcb93b9,_0x256a17,_0x460b8c,_0x4d14ad){_0x35f749[_0x7be3('0x9')]=_0x4d14ad;_0x35f749[_0x7be3('0xb')]=_0x3b79a2;_0x35f749['account']=_0x37849b;_0x35f749['id']=_0xcb93b9;if(_0x256a17){_0x460b8c[util[_0x7be3('0xe')](_0x7be3('0xf'),_0x42275a)][_0xcb93b9]=_['pick'](_0x35f749,attributes);}else{delete _0x460b8c[util[_0x7be3('0xe')](_0x7be3('0xf'),_0x42275a)][_0xcb93b9];}emit(util[_0x7be3('0xe')](_0x7be3('0x10'),_0x42275a,_0x3b79a2),util[_0x7be3('0xe')](_0x7be3('0x11'),_0x42275a,_0x256a17?'save':_0x7be3('0x12')),_[_0x7be3('0x13')](_0x35f749,attributes));}var rpc={'openchannelQueueReport':require(_0x7be3('0x14')),'mailQueueReport':require(_0x7be3('0x15')),'chatQueueReport':require(_0x7be3('0x16')),'smsQueueReport':require(_0x7be3('0x17')),'faxQueueReport':require(_0x7be3('0x18'))};var queue=schema({'name':{'type':_0x7be3('0x19'),'required':!![],'message':_0x7be3('0x1a')},'timeout':{'type':_0x7be3('0x1b'),'message':_0x7be3('0x1c')}});function startRouting(_0x4a406c,_0x20238a,_0x2f3140,_0x568356){if(_0x4a406c&&_0x20238a&&_0x2f3140){_0x20238a['waiting']+=0x1;var _0x249fdc={'uniqueid':_0x4a406c,'from':_0x2f3140[_0x7be3('0x1d')]?_0x2f3140[_0x7be3('0x1d')]['from']:'','joinAt':moment()[_0x7be3('0xe')](_0x7be3('0x1e')),'ContactId':_0x2f3140[_0x7be3('0x1f')]?_0x2f3140['contact']['id']:null,'ListId':_0x2f3140[_0x7be3('0x20')]?_0x2f3140[_0x7be3('0x20')]['id']:null};_0x249fdc[_[_0x7be3('0x21')](_0x2f3140[_0x7be3('0x22')])+_0x7be3('0x23')]=_0x20238a['id']||null;_0x249fdc[_[_0x7be3('0x21')](_0x2f3140[_0x7be3('0x22')])+_0x7be3('0x24')]=_0x2f3140['interaction']?_0x2f3140[_0x7be3('0x25')]['id']:null;_0x249fdc[_[_0x7be3('0x21')](_0x2f3140['channel'])+_0x7be3('0x26')]=_0x2f3140['message']?_0x2f3140['message']['id']:null;_0x249fdc[_[_0x7be3('0x21')](_0x2f3140['channel'])+(_0x2f3140[_0x7be3('0x22')]!==_0x7be3('0x27')?_0x7be3('0x28'):_0x7be3('0x29'))]=_0x2f3140[_0x7be3('0xa')]?_0x2f3140[_0x7be3('0xa')]['id']:null;logger[_0x7be3('0x2a')](util[_0x7be3('0xe')](_0x7be3('0x2b'),_0x4a406c,_0x20238a['name']));emitChannelQueueInteraction(_0x2f3140[_0x7be3('0x22')],_0x20238a[_0x7be3('0x2c')],_0x249fdc,_0x2f3140[_0x7be3('0xa')][_0x7be3('0x2c')],_0x2f3140[_0x7be3('0x2d')]['id'],!![],_0x568356,_0x20238a['id']);if(rpc[_0x2f3140[_0x7be3('0x22')]+_0x7be3('0x2e')]){return rpc[_0x2f3140[_0x7be3('0x22')]+_0x7be3('0x2e')][_0x7be3('0x2f')](_0x249fdc)['catch'](function(_0x368b3f){logger['error'](_0x7be3('0x30'));});}}}function stopRouting(_0x267f36,_0x25d6ff,_0xfc54d8,_0xeefa21){if(_0x267f36&&_0x25d6ff){_0x25d6ff[_0x7be3('0x31')]-=0x1;var _0x3e6bb5={'leaveAt':moment()[_0x7be3('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x7be3('0xe')](_0x7be3('0x1e')),'reason':_0x7be3('0x32')};logger['info'](util[_0x7be3('0xe')]('[%s][STOP:QUEUE][NAME:%s]',_0x267f36,_0x25d6ff[_0x7be3('0x2c')]));emitChannelQueueInteraction(_0xfc54d8[_0x7be3('0x22')],_0x25d6ff[_0x7be3('0x2c')],_0xfc54d8[_0x7be3('0x1d')],_0xfc54d8[_0x7be3('0xa')]['name'],_0xfc54d8[_0x7be3('0x2d')]['id'],![],_0xeefa21,_0x25d6ff['id']);if(rpc[_0xfc54d8[_0x7be3('0x22')]+_0x7be3('0x2e')]){return rpc[_0xfc54d8[_0x7be3('0x22')]+_0x7be3('0x2e')][_0x7be3('0x33')](_0x267f36,_0x3e6bb5)[_0x7be3('0x34')](function(_0x531760){logger['error'](_0x7be3('0x35'));});}}}function endRouting(_0x38b339,_0x535e58,_0x2f9016,_0x462949){if(_0x38b339&&_0x535e58){_0x535e58[_0x7be3('0x31')]-=0x1;var _0x46099b={'leaveAt':moment()[_0x7be3('0xe')](_0x7be3('0x1e')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7be3('0x36')};logger[_0x7be3('0x2a')](util[_0x7be3('0xe')](_0x7be3('0x37'),_0x38b339,_0x535e58[_0x7be3('0x2c')]));emitChannelQueueInteraction(_0x2f9016[_0x7be3('0x22')],_0x535e58['name'],_0x2f9016[_0x7be3('0x1d')],_0x2f9016[_0x7be3('0xa')]['name'],_0x2f9016[_0x7be3('0x2d')]['id'],![],_0x462949);if(rpc[_0x2f9016[_0x7be3('0x22')]+_0x7be3('0x2e')]){return rpc[_0x2f9016[_0x7be3('0x22')]+_0x7be3('0x2e')][_0x7be3('0x33')](_0x38b339,_0x46099b)[_0x7be3('0x34')](function(_0x35e896){logger[_0x7be3('0x38')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x424c93){return function(_0x2af797){return _0x2af797[_0x7be3('0x2c')]['toLowerCase']()===_0x424c93[_0x7be3('0x39')]();};}exports[_0x7be3('0x3a')]=function(_0x49cf28,_0x435ce3,_0x1b6b2a,_0x118303){return function(_0x172fe3){try{var _0x2c8934={'name':_0x435ce3[0x0],'timeout':_0x435ce3[0x1]};var _0x627246=queue[_0x7be3('0x0')](_0x2c8934,{'typecast':!![]});if(_0x627246[_0x7be3('0x3b')]){logger[_0x7be3('0x38')](_0x7be3('0x3c'),_0x49cf28,_['map'](_0x627246,_0x7be3('0x2d'))[_0x7be3('0x3d')](',\x20'));_0x172fe3['stop']();}else{var _0x5774d0=_[_0x7be3('0x3e')](_0x1b6b2a[_0x118303[_0x7be3('0x22')]+_0x7be3('0x3f')],handleFindQueue(_0x2c8934[_0x7be3('0x2c')]));if(_0x5774d0){startRouting(_0x49cf28,_0x5774d0,_0x118303,_0x1b6b2a);var _0x358385=(_0x5774d0[_0x7be3('0x36')]||0xa)*0x3e8;var _0x2c9383=(_0x2c8934['timeout']||0x14)*0x3e8;var _0x257369,_0xe2a462;if(_0x358385>_0x2c9383){_0x2c9383=_0x358385;}var _0x340ad2=seqqueue[_0x7be3('0x40')](_0x358385);_0x340ad2['id']=_0x49cf28;_0x340ad2[_0x7be3('0x41')]=_0x358385;_0x340ad2['qtimeout']=_0x2c9383;_0x340ad2[_0x7be3('0x22')]=_0x118303[_0x7be3('0x22')];_0x1b6b2a['rules'][_0x49cf28]['on'](_0x7be3('0x42'),function(){stopRouting(_0x49cf28,_0x5774d0,_0x118303,_0x1b6b2a);_0x340ad2[_0x7be3('0x43')](!![]);clearTimeout(_0x257369);_0x257369=undefined;if(_0x1b6b2a[_0x7be3('0x44')][_0x49cf28]){delete _0x1b6b2a[_0x7be3('0x44')][_0x49cf28];}logger[_0x7be3('0x2a')](_0x7be3('0x45'),_0x49cf28);_0x172fe3[_0x7be3('0x46')]();});_0x257369=setTimeout(function(){endRouting(_0x49cf28,_0x5774d0,_0x118303,_0x1b6b2a);clearTimeout(_0x257369);_0x340ad2[_0x7be3('0x43')](!![]);logger[_0x7be3('0x2a')](_0x7be3('0x47'),_0x49cf28);_0x172fe3['next']();},_0x2c9383);switch(_0x5774d0[_0x7be3('0x48')]){case _0x7be3('0x49'):strategy[_0x7be3('0x49')](_0x340ad2,_0x5774d0,_0x1b6b2a,_0x118303);break;default:strategy[_0x7be3('0x4a')](_0x340ad2,_0x5774d0,_0x1b6b2a,_0x118303);}}else{logger[_0x7be3('0x38')](_0x7be3('0x4b'),_0x49cf28,_0x2c8934['name']);_0x172fe3[_0x7be3('0x46')]();}}}catch(_0x25d265){console[_0x7be3('0x4c')](_0x25d265);logger[_0x7be3('0x38')](_0x7be3('0x3c'),_0x49cf28,_0x25d265[_0x7be3('0x4d')]);_0x172fe3[_0x7be3('0x46')]();}};}; \ 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 cc082fc..d5962d4 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 _0x30cf=[':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','writeLog','STOP','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','info','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification'];(function(_0x3e000a,_0x84f846){var _0x2e119e=function(_0x3ccbdd){while(--_0x3ccbdd){_0x3e000a['push'](_0x3e000a['shift']());}};_0x2e119e(++_0x84f846);}(_0x30cf,0x8a));var _0xf30c=function(_0x2bc170,_0x4d1cb8){_0x2bc170=_0x2bc170-0x0;var _0x18d372=_0x30cf[_0x2bc170];return _0x18d372;};'use strict';var _=require(_0xf30c('0x0'));var uuid=require(_0xf30c('0x1'));var util=require(_0xf30c('0x2'));var logger=require(_0xf30c('0x3'))('routing');var Agent=function(_0x5d567b,_0x49c34e,_0x5a666e,_0x11b5fb){this[_0xf30c('0x4')]=uuid['v4']();this[_0xf30c('0x5')]=_0x5d567b;this['agent']=_0x49c34e;this[_0xf30c('0x6')]=_0x5a666e;this[_0xf30c('0x7')]=_0x11b5fb;this[_0xf30c('0x5')][_0xf30c('0x8')](this['handleRun'][_0xf30c('0x9')](this),this[_0xf30c('0xa')]['bind'](this));this[_0xf30c('0x5')]['on'](_0xf30c('0xb'),this[_0xf30c('0xa')]['bind'](this));this[_0xf30c('0x5')]['on'](_0xf30c('0xc'),this['handleDrained'][_0xf30c('0x9')](this));};Agent[_0xf30c('0xd')][_0xf30c('0x8')]=function(){this['squeue'][_0xf30c('0x8')](this[_0xf30c('0xe')][_0xf30c('0x9')](this),this['handleTimeout'][_0xf30c('0x9')](this));};Agent[_0xf30c('0xd')][_0xf30c('0xf')]=function(){this[_0xf30c('0xa')](!![]);};Agent['prototype'][_0xf30c('0xe')]=function(_0x5ad8ce){logger[_0xf30c('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this['agent']['id']);if(_[_0xf30c('0x11')](this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']])){logger[_0xf30c('0x10')](_0xf30c('0x14'),this[_0xf30c('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xf30c('0x8')][_0xf30c('0x9')](this),0x3e8);}else{if(this[_0xf30c('0x7')][_0xf30c('0x15')]||util[_0xf30c('0x16')](this['squeue']['id'],this[_0xf30c('0x6')][_0xf30c('0x12')][this['agent']['id']],this[_0xf30c('0x5')][_0xf30c('0x17')],![])){this['realtime'][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']][_0xf30c('0x18')]=!![];this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']][_0xf30c('0x19')]=undefined;util[_0xf30c('0x1a')](this[_0xf30c('0x4')],this[_0xf30c('0x5')]['id'],this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']],null,this['routing']);util['writeLog'](this[_0xf30c('0x5')]['id'],this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']],'RINGING'+(this['routing'][_0xf30c('0x15')]?_0xf30c('0x1b'):''));}else{logger['info'](_0xf30c('0x1c'),this[_0xf30c('0x5')]['id'],this[_0xf30c('0x13')]['id']);setTimeout(this[_0xf30c('0x8')][_0xf30c('0x9')](this),0x3e8);}}};Agent[_0xf30c('0xd')][_0xf30c('0xa')]=function(_0x2e0153){if(_['isNil'](this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']])){return logger[_0xf30c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf30c('0x5')]['id'],this[_0xf30c('0x13')]['id']);}else{logger[_0xf30c('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xf30c('0x5')]['id'],this['agent']['id']);util[_0xf30c('0x1d')](this[_0xf30c('0x4')],this[_0xf30c('0x5')]['id'],this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']],null,this[_0xf30c('0x7')]);this['realtime']['agents'][this[_0xf30c('0x13')]['id']][_0xf30c('0x18')]=![];this[_0xf30c('0x6')][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']][_0xf30c('0x19')]=undefined;util[_0xf30c('0x1e')](this[_0xf30c('0x5')]['id'],this['realtime'][_0xf30c('0x12')][this[_0xf30c('0x13')]['id']],_0x2e0153?_0xf30c('0x1f'):'TIMEOUT');}if(!_0x2e0153){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2a8a10,_0x2fc4de,_0x4e806e,_0x2bbdf0){return new Agent(_0x2a8a10,_0x2fc4de,_0x4e806e,_0x2bbdf0);}module[_0xf30c('0x20')]=agent; \ No newline at end of file +var _0x769e=['writeLog','RINGING',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','squeue','agent','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','notificationId'];(function(_0x33fe6a,_0x23638b){var _0x35babe=function(_0x143a31){while(--_0x143a31){_0x33fe6a['push'](_0x33fe6a['shift']());}};_0x35babe(++_0x23638b);}(_0x769e,0xcf));var _0xe769=function(_0x28f6c0,_0x34a894){_0x28f6c0=_0x28f6c0-0x0;var _0x5531e7=_0x769e[_0x28f6c0];return _0x5531e7;};'use strict';var _=require('lodash');var uuid=require(_0xe769('0x0'));var util=require(_0xe769('0x1'));var logger=require(_0xe769('0x2'))(_0xe769('0x3'));var Agent=function(_0x16985a,_0xf66407,_0x440631,_0x4fe78f){this['notificationId']=uuid['v4']();this[_0xe769('0x4')]=_0x16985a;this[_0xe769('0x5')]=_0xf66407;this['realtime']=_0x440631;this['routing']=_0x4fe78f;this[_0xe769('0x4')][_0xe769('0x6')](this[_0xe769('0x7')][_0xe769('0x8')](this),this[_0xe769('0x9')]['bind'](this));this[_0xe769('0x4')]['on'](_0xe769('0xa'),this['handleTimeout'][_0xe769('0x8')](this));this['squeue']['on']('drained',this[_0xe769('0xb')][_0xe769('0x8')](this));};Agent[_0xe769('0xc')][_0xe769('0x6')]=function(){this[_0xe769('0x4')]['push'](this['handleRun'][_0xe769('0x8')](this),this['handleTimeout'][_0xe769('0x8')](this));};Agent['prototype'][_0xe769('0xb')]=function(){this[_0xe769('0x9')](!![]);};Agent['prototype'][_0xe769('0x7')]=function(_0x27ca94){logger['info'](_0xe769('0xd'),this[_0xe769('0x4')]['id'],this[_0xe769('0x5')]['id']);if(_['isNil'](this[_0xe769('0xe')]['agents'][this[_0xe769('0x5')]['id']])){logger[_0xe769('0xf')](_0xe769('0x10'),this[_0xe769('0x4')]['id'],this[_0xe769('0x5')]['id']);setTimeout(this[_0xe769('0x6')][_0xe769('0x8')](this),0x3e8);}else{if(this['routing'][_0xe769('0x11')]||util[_0xe769('0x12')](this[_0xe769('0x4')]['id'],this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']],this['squeue'][_0xe769('0x14')],![])){this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']][_0xe769('0x15')]=!![];this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']][_0xe769('0x16')]=undefined;util['showNotification'](this[_0xe769('0x17')],this['squeue']['id'],this['realtime'][_0xe769('0x13')][this[_0xe769('0x5')]['id']],null,this[_0xe769('0x3')]);util[_0xe769('0x18')](this[_0xe769('0x4')]['id'],this['realtime'][_0xe769('0x13')][this['agent']['id']],_0xe769('0x19')+(this[_0xe769('0x3')]['forcedOwnership']?_0xe769('0x1a'):''));}else{logger[_0xe769('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xe769('0x4')]['id'],this[_0xe769('0x5')]['id']);setTimeout(this[_0xe769('0x6')][_0xe769('0x8')](this),0x3e8);}}};Agent['prototype'][_0xe769('0x9')]=function(_0x2aabff){if(_[_0xe769('0x1b')](this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']])){return logger[_0xe769('0xf')](_0xe769('0x10'),this['squeue']['id'],this[_0xe769('0x5')]['id']);}else{logger['info'](_0xe769('0x1c'),this['squeue']['id'],this[_0xe769('0x5')]['id']);util[_0xe769('0x1d')](this[_0xe769('0x17')],this[_0xe769('0x4')]['id'],this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']],null,this[_0xe769('0x3')]);this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']]['busy']=![];this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']][_0xe769('0x16')]=undefined;util[_0xe769('0x18')](this[_0xe769('0x4')]['id'],this[_0xe769('0xe')][_0xe769('0x13')][this[_0xe769('0x5')]['id']],_0x2aabff?_0xe769('0x1e'):_0xe769('0x1f'));}if(!_0x2aabff){setTimeout(this[_0xe769('0x6')][_0xe769('0x8')](this),0x3e8);}};function agent(_0x52f8ee,_0x1b6db2,_0x9dcee5,_0xd2d05){return new Agent(_0x52f8ee,_0x1b6db2,_0x9dcee5,_0xd2d05);}module[_0xe769('0x20')]=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 5d55c94..cadef77 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 _0xb338=['length','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','notificationId','queue','squeue','push','handleRun','bind','handleTimeout','handleDrained','prototype','isNil','Agents'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb338,0x1e1));var _0x8b33=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0xb338[_0x79c6de];return _0x321a56;};'use strict';var _=require('lodash');var uuid=require(_0x8b33('0x0'));var util=require(_0x8b33('0x1'));var logger=require(_0x8b33('0x2'))(_0x8b33('0x3'));var Beepall=function(_0x684220,_0x4352a3,_0xedb195,_0xabd6d7){this[_0x8b33('0x4')]=uuid['v4']();this['squeue']=_0x684220;this[_0x8b33('0x5')]=_0x4352a3;this['realtime']=_0xedb195;this['routing']=_0xabd6d7;this[_0x8b33('0x6')][_0x8b33('0x7')](this[_0x8b33('0x8')][_0x8b33('0x9')](this),this['handleTimeout']['bind'](this));this[_0x8b33('0x6')]['on']('timeout',this[_0x8b33('0xa')][_0x8b33('0x9')](this));this['squeue']['on']('drained',this[_0x8b33('0xb')][_0x8b33('0x9')](this));};Beepall['prototype'][_0x8b33('0x7')]=function(){this[_0x8b33('0x6')][_0x8b33('0x7')](this[_0x8b33('0x8')]['bind'](this),this[_0x8b33('0xa')][_0x8b33('0x9')](this));};Beepall[_0x8b33('0xc')][_0x8b33('0xb')]=function(_0x4b4a0f){this[_0x8b33('0xa')](!![]);};Beepall[_0x8b33('0xc')][_0x8b33('0x8')]=function(_0x502d02){var _0x452ddb=!![];if(!_[_0x8b33('0xd')](this[_0x8b33('0x5')])&&!_['isNil'](this[_0x8b33('0x5')][_0x8b33('0xe')])&&this[_0x8b33('0x5')]['Agents']['length']>0x0){for(var _0x3b177d=0x0,_0x5719d5;_0x3b177d0x0){for(var _0x5340a7=0x0,_0x4912da;_0x5340a70x0&&_0x1812c2[_0x404267+_0xa269('0x22')]>=_0x1812c2[_0x404267+_0xa269('0x21')]){writeLog(_0x4bb143,_0x1812c2,_0x404267[_0xa269('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x1ac923,_0x361985,_0x58301e,_0x14f868,_0x14a13f){return sendNotification(!![],_0x1ac923,_0x361985,_0x58301e,_0x14f868,_0x14a13f);};exports[_0xa269('0x24')]=function(_0x7bf6a9,_0x3119b8,_0x1a0ac6,_0xf48aeb,_0xb2ff3f){return sendNotification(![],_0x7bf6a9,_0x3119b8,_0x1a0ac6,_0xf48aeb,_0xb2ff3f);};exports[_0xa269('0x25')]=writeLog; \ No newline at end of file +var _0x19c0=['\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x19c0,0x137));var _0x019c=function(_0x322739,_0x5db41f){_0x322739=_0x322739-0x0;var _0x14e096=_0x19c0[_0x322739];return _0x14e096;};'use strict';var _=require(_0x019c('0x0'));var util=require(_0x019c('0x1'));var utils=require(_0x019c('0x2'));var Mustache=require(_0x019c('0x3'));var Redis=require(_0x019c('0x4'));var config=require(_0x019c('0x5'));var logger=require(_0x019c('0x6'))(_0x019c('0x7'));config[_0x019c('0x8')]=_[_0x019c('0x9')](config['redis'],{'host':_0x019c('0xa'),'port':0x18eb});var io=require(_0x019c('0xb'))(new Redis(config[_0x019c('0x8')]));function emit(_0xeba0e8,_0x30571f,_0x2d87ad){io['to'](_0xeba0e8)[_0x019c('0xc')](_0x30571f,_0x2d87ad);}function sendNotification(_0x349eaa,_0x3c23c7,_0x30a0b5,_0x11df37,_0x44d003,_0x5b95ab){io['to'](util[_0x019c('0xd')](_0x019c('0xe'),_0x11df37['name']))['emit'](_0x019c('0xf'),_0x11df37);var _0xac163a=_0x5b95ab||{};var _0x1633d0=_0x30a0b5['split']('.');var _0x54eb53={'uniqueid':_0x3c23c7,'channel':_0x1633d0[0x0],'id':_0x1633d0[0x1],'title':_0x1633d0[0x0]+_0x019c('0x10'),'interactionId':_0x1633d0[0x2],'queue':_0x44d003?_0x44d003[_0x019c('0x11')]:null,'sound':_0xac163a[_0x019c('0x12')][_0x019c('0x13')],'shake':_0xac163a[_0x019c('0x12')][_0x019c('0x14')]};try{if(!_0xac163a[_0x019c('0x15')]){_0xac163a[_0x019c('0x15')]={};}if(_0x44d003){_0xac163a[_0x019c('0x15')][_0x019c('0x16')]=_0x44d003;}else if(_0xac163a['body']['queue']){delete _0xac163a[_0x019c('0x15')]['queue'];}_0x54eb53[_0x019c('0x17')]=utils['getMustacheRender'](_0xac163a[_0x019c('0x12')][_0x019c('0x18')],_0xac163a);}catch(_0x33add1){_0x54eb53[_0x019c('0x17')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x019c('0x19')](util[_0x019c('0xd')](_0x019c('0x1a'),_0x3c23c7,_0x33add1[_0x019c('0x1b')]));}io['to'](util[_0x019c('0xd')](_0x019c('0xe'),_0x11df37[_0x019c('0x11')]))['emit'](util[_0x019c('0xd')](_0x019c('0x1c'),_0x349eaa?_0x019c('0x1d'):_0x019c('0x1e')),_0x54eb53);}function writeLog(_0x84bb7e,_0x4f8ef4,_0xe24331){return logger[_0x019c('0x1f')](util[_0x019c('0xd')](_0x019c('0x20'),_0x84bb7e,_0x4f8ef4[_0x019c('0x11')],_0xe24331));}exports[_0x019c('0x21')]=function(_0x228632,_0x45a624,_0x7c6e56,_0xfb1663){if(_0x45a624[_0x019c('0x22')]){writeLog(_0x228632,_0x45a624,_0x019c('0x23'));return![];}if(!_0x45a624[_0x019c('0x24')]){writeLog(_0x228632,_0x45a624,'OFFLINE');return![];}if(_0x45a624[_0x7c6e56+'Pause']){writeLog(_0x228632,_0x45a624,'PAUSE');return![];}if(_0xfb1663&&_0x45a624[_0x019c('0x25')](_0x7c6e56+_0x019c('0x26'))&&_0x45a624['hasOwnProperty'](_0x7c6e56+'CurrentCapacity')){if(_0x45a624[_0x7c6e56+_0x019c('0x26')]>0x0&&_0x45a624[_0x7c6e56+_0x019c('0x27')]>=_0x45a624[_0x7c6e56+_0x019c('0x26')]){writeLog(_0x228632,_0x45a624,_0x7c6e56[_0x019c('0x28')]()+_0x019c('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x256593,_0x472fc4,_0x504916,_0x233184,_0x494e50){return sendNotification(!![],_0x256593,_0x472fc4,_0x504916,_0x233184,_0x494e50);};exports[_0x019c('0x2a')]=function(_0x3d41cc,_0x2bad1f,_0x34a529,_0x2c385f,_0x45aa3f){return sendNotification(![],_0x3d41cc,_0x2bad1f,_0x34a529,_0x2c385f,_0x45aa3f);};exports[_0x019c('0x2b')]=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 b5c4a5b..208b3f8 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 _0xe5c9=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','validate','shelljs','lodash','./utils','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','join','info'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe5c9,0x137));var _0x9e5c=function(_0x57c455,_0x2387e8){_0x57c455=_0x57c455-0x0;var _0x70aa12=_0xe5c9[_0x57c455];return _0x70aa12;};'use strict';var schema=require(_0x9e5c('0x0'));var sh=require(_0x9e5c('0x1'));var _=require(_0x9e5c('0x2'));var utils=require(_0x9e5c('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x9e5c('0x4')}});exports[_0x9e5c('0x5')]=function(_0x58d6b0,_0x370af8){return function(_0x6b9e36){try{var _0xa21975={'command':_0x370af8[0x0]};var _0x5d957e=system[_0x9e5c('0x0')](_0xa21975,{'typecast':!![]});if(_0x5d957e[_0x9e5c('0x6')]){logger['error'](_0x9e5c('0x7'),_0x58d6b0,_[_0x9e5c('0x8')](_0x5d957e,'message')[_0x9e5c('0x9')](',\x20'));logger[_0x9e5c('0xa')](_0x9e5c('0xb'),_0x58d6b0);_0x6b9e36[_0x9e5c('0xc')]();}else{var _0x210cb4=this;var _0x5bef2a=utils['getMustacheRender'](_0x370af8[0x0],this);logger[_0x9e5c('0xa')](_0x9e5c('0xd'),_0x58d6b0,_0x5bef2a);sh[_0x9e5c('0xe')](_[_0x9e5c('0xf')](_0x5bef2a),function(_0x52abf1,_0x1dddfc){logger[_0x9e5c('0xa')](_0x9e5c('0x10'),_0x58d6b0,_0x52abf1);if(_0x52abf1==0x0){var _0xf111a1=_0x1dddfc[_0x9e5c('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x370af8[0x1])||_['isEmpty'](_0x370af8[0x1])){logger['info'](_0x9e5c('0x12'),_0x58d6b0);_0x210cb4[_0x9e5c('0x13')][_0x370af8[0x1]]=_0xf111a1;}else{logger[_0x9e5c('0xa')](_0x9e5c('0x14'),_0x58d6b0,_0x370af8[0x1],_0xf111a1);_0x210cb4[_0x9e5c('0x13')][_0x370af8[0x1]]=_0xf111a1;}}_0x6b9e36['next']();});}}catch(_0x3e2e25){logger[_0x9e5c('0x15')](_0x9e5c('0x7'),_0x58d6b0,_[_0x9e5c('0x16')](_0x3e2e25)?JSON['stringify'](_0x3e2e25):_0x3e2e25);logger[_0x9e5c('0xa')](_0x9e5c('0xb'),_0x58d6b0);_0x6b9e36[_0x9e5c('0xc')]();}};}; \ No newline at end of file +var _0xfb67=['error','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x283800,_0x4c258f){var _0x273391=function(_0x56a99c){while(--_0x56a99c){_0x283800['push'](_0x283800['shift']());}};_0x273391(++_0x4c258f);}(_0xfb67,0xc2));var _0x7fb6=function(_0x5e0200,_0x3cd34b){_0x5e0200=_0x5e0200-0x0;var _0x6aefc9=_0xfb67[_0x5e0200];return _0x6aefc9;};'use strict';var schema=require(_0x7fb6('0x0'));var sh=require('shelljs');var _=require(_0x7fb6('0x1'));var utils=require(_0x7fb6('0x2'));var logger=require(_0x7fb6('0x3'))('routing');var system=schema({'command':{'type':_0x7fb6('0x4'),'required':!![],'message':_0x7fb6('0x5')}});exports['consequence']=function(_0x1f9ee0,_0x4cc2e){return function(_0x4fa88c){try{var _0x535bcb={'command':_0x4cc2e[0x0]};var _0x470dc7=system[_0x7fb6('0x0')](_0x535bcb,{'typecast':!![]});if(_0x470dc7['length']){logger[_0x7fb6('0x6')]('[%s][SYSTEM]\x20%s',_0x1f9ee0,_[_0x7fb6('0x7')](_0x470dc7,'message')[_0x7fb6('0x8')](',\x20'));logger['info'](_0x7fb6('0x9'),_0x1f9ee0);_0x4fa88c[_0x7fb6('0xa')]();}else{var _0x296fac=this;var _0x5279ea=utils[_0x7fb6('0xb')](_0x4cc2e[0x0],this);logger['info'](_0x7fb6('0xc'),_0x1f9ee0,_0x5279ea);sh[_0x7fb6('0xd')](_[_0x7fb6('0xe')](_0x5279ea),function(_0x5f026f,_0x367c18){logger[_0x7fb6('0xf')](_0x7fb6('0x10'),_0x1f9ee0,_0x5f026f);if(_0x5f026f==0x0){var _0x4e9d34=_0x367c18[_0x7fb6('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x7fb6('0x12')](_0x4cc2e[0x1])||_['isEmpty'](_0x4cc2e[0x1])){logger[_0x7fb6('0xf')](_0x7fb6('0x13'),_0x1f9ee0);_0x296fac[_0x7fb6('0x14')][_0x4cc2e[0x1]]=_0x4e9d34;}else{logger[_0x7fb6('0xf')](_0x7fb6('0x15'),_0x1f9ee0,_0x4cc2e[0x1],_0x4e9d34);_0x296fac[_0x7fb6('0x14')][_0x4cc2e[0x1]]=_0x4e9d34;}}_0x4fa88c['next']();});}}catch(_0xf42f48){logger['error'](_0x7fb6('0x16'),_0x1f9ee0,_[_0x7fb6('0x17')](_0xf42f48)?JSON[_0x7fb6('0x18')](_0xf42f48):_0xf42f48);logger[_0x7fb6('0xf')](_0x7fb6('0x9'),_0x1f9ee0);_0x4fa88c['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 2fcb75b..dbf6f04 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(_0x15035b,_0x3eba0a){var _0x2cc7b1=function(_0x144b32){while(--_0x144b32){_0x15035b['push'](_0x15035b['shift']());}};_0x2cc7b1(++_0x3eba0a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(_0x5c4b92,_0x3dd96d){var _0x49fbf6=function(_0x3c646b){while(--_0x3c646b){_0x5c4b92['push'](_0x5c4b92['shift']());}};_0x49fbf6(++_0x3dd96d);}(_0x7a54,0x106));var _0x47a5=function(_0x5ded65,_0x2e8a85){_0x5ded65=_0x5ded65-0x0;var _0x2c1a43=_0x7a54[_0x5ded65];return _0x2c1a43;};'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 8facca6..6352403 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 _0xfdb5=['message','interaction','mustache','lodash','exports','render','merge'];(function(_0x5e70ea,_0x59c669){var _0x53d057=function(_0x2f87af){while(--_0x2f87af){_0x5e70ea['push'](_0x5e70ea['shift']());}};_0x53d057(++_0x59c669);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfdb5[_0x4c445a];return _0x2f611c;};'use strict';var Mustache=require(_0x5fdb('0x0'));var _=require(_0x5fdb('0x1'));module[_0x5fdb('0x2')]={'getMustacheRender':function(_0x517697,_0x190bc2){return Mustache[_0x5fdb('0x3')](_0x517697,_[_0x5fdb('0x4')](_0x190bc2['body'],{'contact':_0x190bc2['contact'],'message':_0x190bc2[_0x5fdb('0x5')],'account':_0x190bc2['account'],'interaction':_0x190bc2[_0x5fdb('0x6')],'list':_0x190bc2['list']}))||'';}}; \ No newline at end of file +var _0x1280=['render','merge','body','contact','account','interaction','mustache','lodash','exports'];(function(_0x408983,_0x89a483){var _0x1b609b=function(_0x4359e3){while(--_0x4359e3){_0x408983['push'](_0x408983['shift']());}};_0x1b609b(++_0x89a483);}(_0x1280,0xba));var _0x0128=function(_0x4144ca,_0x3f22e3){_0x4144ca=_0x4144ca-0x0;var _0x2de8ee=_0x1280[_0x4144ca];return _0x2de8ee;};'use strict';var Mustache=require(_0x0128('0x0'));var _=require(_0x0128('0x1'));module[_0x0128('0x2')]={'getMustacheRender':function(_0x869975,_0x259f2a){return Mustache[_0x0128('0x3')](_0x869975,_[_0x0128('0x4')](_0x259f2a[_0x0128('0x5')],{'contact':_0x259f2a[_0x0128('0x6')],'message':_0x259f2a['message'],'account':_0x259f2a[_0x0128('0x7')],'interaction':_0x259f2a[_0x0128('0x8')],'list':_0x259f2a['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 413410e..00ba6a5 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 _0x34b8=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','appdata','split','push','dialogflow','amazonlex','slice','tag','TagId','format','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','error','rules','execute','Applications\x20executed','stringify','stack','emit','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues'];(function(_0x357f22,_0x238e08){var _0x34dd5c=function(_0x30f05b){while(--_0x30f05b){_0x357f22['push'](_0x357f22['shift']());}};_0x34dd5c(++_0x238e08);}(_0x34b8,0x112));var _0x834b=function(_0x42ded3,_0x37f186){_0x42ded3=_0x42ded3-0x0;var _0x496e1f=_0x34b8[_0x42ded3];return _0x496e1f;};'use strict';var _=require(_0x834b('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x834b('0x1'));var BPromise=require(_0x834b('0x2'));var uuid=require(_0x834b('0x3'));var config=require(_0x834b('0x4'));var logger=require('../../../config/logger')(_0x834b('0x5'));var rpc={'openchannelQueueReport':require(_0x834b('0x6'))};var rpc={'openchannelQueueReport':require(_0x834b('0x6')),'mailQueueReport':require(_0x834b('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x834b('0x8')),'faxQueueReport':require(_0x834b('0x9'))};var RuleEngine=require(_0x834b('0xa'));function getId(_0xb37a7d,_0x18d028,_0x20f3f1){return util['format'](_0x834b('0xb'),_0xb37a7d,_0x18d028||0x0,_0x20f3f1||0x0);}function getIntervals(_0xc34d10,_0x1d6b3f){var _0x16ebc0=[];if(!_[_0x834b('0xc')](_0x1d6b3f[_0x834b('0xd')])&&!_['isNil'](_0xc34d10[_0x1d6b3f['IntervalId']])&&!_[_0x834b('0xc')](_0xc34d10[_0x1d6b3f['IntervalId']][_0x834b('0xe')])){_0x16ebc0=_[_0x834b('0xf')](_0xc34d10[_0x1d6b3f['IntervalId']][_0x834b('0xe')],_0x834b('0x10'));}else if(!_['isNil'](_0x1d6b3f['interval'])){_0x16ebc0=[_0x1d6b3f[_0x834b('0x10')]];}return _0x16ebc0;}exports[_0x834b('0x11')]=function(_0x49cf3c){_0x49cf3c['rules']={};return new BPromise(function(_0x3c8918,_0xd2542b){var _0x433215={'Start':function(_0x4f4998){var _0x434430=this;return new Promise(function(_0x29c522,_0x499678){if(_0x4f4998){try{var _0x12ff4b=[];var _0x2d092d=getId(_0x4f4998[_0x834b('0x12')],_0x4f4998[_0x834b('0x13')]?_0x4f4998[_0x834b('0x13')]['id']:0x0,_0x4f4998[_0x834b('0x14')]?_0x4f4998['interaction']['id']:0x0);if(_0x4f4998[_0x834b('0x15')]&&_[_0x834b('0x16')](_0x4f4998[_0x834b('0x15')])&&_0x4f4998[_0x834b('0x15')][_0x834b('0x17')]){for(var _0x1f1bc2=0x0;_0x1f1bc2<_0x4f4998[_0x834b('0x15')][_0x834b('0x17')];_0x1f1bc2+=0x1){var _0x158bd4=_0x4f4998[_0x834b('0x15')][_0x1f1bc2];if(fs['existsSync'](path[_0x834b('0x18')](__dirname,_0x834b('0x15'),_0x158bd4[_0x834b('0x19')]+_0x834b('0x1a')))){var _0xeff9fd=[];switch(_0x158bd4[_0x834b('0x19')][_0x834b('0x1b')]()){case'autoreply':var _0x2cce0f=_0x158bd4[_0x834b('0x1c')][_0x834b('0x1d')](',');_0xeff9fd['push'](_0x2cce0f[0x0]);_0xeff9fd[_0x834b('0x1e')](_0x2cce0f['slice'](0x1,_0x2cce0f[_0x834b('0x17')])['join'](','));break;case _0x834b('0x1f'):var _0x2cce0f=_0x158bd4[_0x834b('0x1c')]['split'](',');_0xeff9fd['push'](_0x2cce0f[0x0]);_0xeff9fd[_0x834b('0x1e')](_0x2cce0f[0x1]);_0xeff9fd['push'](_0x2cce0f['slice'](0x2,_0x2cce0f[_0x834b('0x17')])[_0x834b('0x18')](','));break;case _0x834b('0x20'):var _0x2cce0f=_0x158bd4[_0x834b('0x1c')][_0x834b('0x1d')](',');_0xeff9fd['push'](_0x2cce0f[0x0]);_0xeff9fd['push'](_0x2cce0f[0x1]);_0xeff9fd['push'](_0x2cce0f[0x2]);_0xeff9fd[_0x834b('0x1e')](_0x2cce0f[0x3]);_0xeff9fd[_0x834b('0x1e')](_0x2cce0f[_0x834b('0x21')](0x4,_0x2cce0f[_0x834b('0x17')])[_0x834b('0x18')](','));break;case'message':_0xeff9fd['push'](_0x158bd4[_0x834b('0x1c')]);break;case _0x834b('0x22'):_0xeff9fd[_0x834b('0x1e')](_0x158bd4[_0x834b('0x23')]);_0xeff9fd['push'](_0x158bd4['appdata']);break;default:_0xeff9fd=_[_0x834b('0xc')](_0x158bd4[_0x834b('0x1c')])?[]:_0x158bd4[_0x834b('0x1c')][_0x834b('0x1d')](',');}var _0x3fbd78={'id':util[_0x834b('0x24')](_0x834b('0x25'),_0x2d092d,_0x158bd4['id'],_0x158bd4[_0x834b('0x19')]),'condition':require(_0x834b('0x26'))[_0x834b('0x27')](_0x2d092d,getIntervals(_0x49cf3c['intervals'],_0x158bd4),_0x49cf3c),'consequence':require(_0x834b('0x28')+_0x158bd4[_0x834b('0x19')])[_0x834b('0x29')](_0x2d092d,_0xeff9fd,_0x49cf3c,_0x4f4998),'p':_0x158bd4[_0x834b('0x2a')]||0x0};logger[_0x834b('0x2b')](_0x834b('0x2c'),_0x3fbd78['id'],_0x834b('0x2d'),getIntervals(_0x49cf3c[_0x834b('0x2e')],_0x158bd4)[_0x834b('0x18')]('\x20|\x20'));_0x12ff4b[_0x834b('0x1e')](_0x3fbd78);}else{logger[_0x834b('0x2f')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x834b('0x18')](__dirname,_0x834b('0x15'),_0x158bd4[_0x834b('0x19')]+_0x834b('0x1a')));}}_0x49cf3c['rules'][_0x2d092d]=new RuleEngine(_0x12ff4b);_0x49cf3c[_0x834b('0x30')][_0x2d092d][_0x834b('0x31')](_0x4f4998,function(_0x58747f){logger[_0x834b('0x2b')](_0x834b('0x32'),JSON[_0x834b('0x33')](_0x58747f['matchPath']));if(_0x49cf3c['rules'][_0x2d092d]){_0x49cf3c[_0x834b('0x30')][_0x2d092d]['emit']('end');}});return _0x29c522({'code':0xc8,'message':_0x4f4998});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x29c522({'code':0xc8,'message':_0x4f4998});}}catch(_0x147b9c){logger[_0x834b('0x2f')](_0x147b9c[_0x834b('0x34')]);return _0x499678(_0x434430['error'](0x1f4,_0x147b9c));}}return _0x499678('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3f303b){var _0x5c739b=this;return new Promise(function(_0x11912c,_0x3276ed){if(_0x3f303b[_0x834b('0x13')]&&_0x3f303b[_0x834b('0x13')]['id']){try{var _0x3ce1b5=getId(_0x3f303b[_0x834b('0x12')],_0x3f303b[_0x834b('0x13')]?_0x3f303b[_0x834b('0x13')]['id']:0x0,_0x3f303b[_0x834b('0x14')]?_0x3f303b[_0x834b('0x14')]['id']:0x0);if(_0x49cf3c[_0x834b('0x30')][_0x3ce1b5]){_0x49cf3c[_0x834b('0x30')][_0x3ce1b5][_0x834b('0x35')]('end');if(rpc[_0x3f303b[_0x834b('0x12')]+_0x834b('0x36')]){rpc[_0x3f303b[_0x834b('0x12')]+'QueueReport'][_0x834b('0x37')](_0x3ce1b5,{'UserId':_0x3f303b[_0x834b('0x13')]['UserId']})['catch'](function(_0x22ab87){logger['error'](_0x834b('0x38'));});}}return _0x11912c({'code':0xc8,'message':_0x3f303b});}catch(_0x2f110f){logger[_0x834b('0x2f')](_0x2f110f['stack']);return _0x3276ed(_0x5c739b[_0x834b('0x2f')](0x1f4,_0x2f110f));}}logger[_0x834b('0x2f')](_0x834b('0x39'));return _0x3276ed(_0x5c739b[_0x834b('0x2f')](0x1f4,_0x834b('0x39')));});},'RejectMessage':function(_0x2a3015){var _0x472176=this;return new Promise(function(_0xc9d114,_0x4105c0){if(_0x2a3015[_0x834b('0x3a')]&&_0x2a3015[_0x834b('0x3a')]['id']){try{if(_0x49cf3c['agents'][_0x2a3015['agent']['id']]){_0x49cf3c[_0x834b('0x3b')][_0x2a3015[_0x834b('0x3a')]['id']][_0x834b('0x3c')]=![];_0x49cf3c[_0x834b('0x3b')][_0x2a3015[_0x834b('0x3a')]['id']][_0x834b('0x3d')]=undefined;}return _0xc9d114({'code':0xc8,'message':_0x2a3015});}catch(_0x5a12c2){logger['error'](_0x5a12c2[_0x834b('0x34')]);return _0x4105c0(_0x472176[_0x834b('0x2f')](0x1f4,_0x5a12c2));}}logger[_0x834b('0x2f')]('message\x20is\x20empty');return _0x4105c0(_0x472176['error'](0x1f4,_0x834b('0x39')));});},'AbandonInteraction':function(_0x4fafb8){var _0x27bdca=this;return new Promise(function(_0xcb58e4,_0x57f92e){if(_0x4fafb8[_0x834b('0x12')]&&_0x4fafb8[_0x834b('0x14')]&&_0x4fafb8[_0x834b('0x14')]['id']){try{var _0xb5816=getId(_0x4fafb8[_0x834b('0x12')],_0x4fafb8[_0x834b('0x13')]?_0x4fafb8[_0x834b('0x13')]['id']:0x0,_0x4fafb8[_0x834b('0x14')]?_0x4fafb8[_0x834b('0x14')]['id']:0x0);if(_0x49cf3c[_0x834b('0x30')][_0xb5816]){_0x49cf3c[_0x834b('0x30')][_0xb5816]['emit'](_0x834b('0x3e'));}return _0xcb58e4({'code':0xc8,'message':_0x4fafb8});}catch(_0x3fddb9){logger['error'](_0x3fddb9['stack']);return _0x57f92e(_0x27bdca[_0x834b('0x2f')](0x1f4,_0x3fddb9));}}logger[_0x834b('0x2f')]('message\x20is\x20empty');return _0x57f92e(_0x27bdca[_0x834b('0x2f')](0x1f4,_0x834b('0x39')));});},'AgentCapacity':function(_0x57052b){var _0xfde293=this;return new Promise(function(_0x339c08,_0xc5ccf0){if(_0x49cf3c[_0x834b('0x3b')][_0x834b('0x3f')](_0x57052b['id'])){for(var _0x32a28e in _0x57052b[_0x834b('0x40')]){if(_0x57052b[_0x834b('0x40')][_0x834b('0x3f')](_0x32a28e)){if(_0x49cf3c[_0x834b('0x3b')][_0x57052b['id']][_0x834b('0x3f')](_0x32a28e+_0x834b('0x41'))){_0x49cf3c['agents'][_0x57052b['id']][_0x32a28e+_0x834b('0x41')]=parseInt(_0x57052b['capacity'][_0x32a28e],0xa);}}}_0x49cf3c[_0x834b('0x3b')][_0x57052b['id']][_0x834b('0x42')]();return _0x339c08({'code':0xc8,'message':_0x49cf3c[_0x834b('0x3b')][_0x57052b['id']]});}else{return _0xc5ccf0(_0xfde293[_0x834b('0x2f')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x17194c){return new Promise(function(_0x1e688e,_0x567d49){var _0x1ccde2=_[_0x834b('0x43')](_0x49cf3c[_0x834b('0x3b')]);_0x1e688e({'count':_0x1ccde2[_0x834b('0x17')],'rows':_0x1ccde2});});},'ChatQueues':function(_0x528c75){return new Promise(function(_0x194c22,_0x157d8a){var _0x4b176e=[];for(var _0xa9c11 in _0x49cf3c[_0x834b('0x44')]){if(_0x49cf3c[_0x834b('0x44')]['hasOwnProperty'](_0xa9c11)){var _0x29fbad=_0x49cf3c[_0x834b('0x44')][_0xa9c11];var _0xbd05ce={'id':_0x29fbad['id'],'available':_0x29fbad[_0x834b('0x45')],'loggedIn':_0x29fbad[_0x834b('0x46')],'name':_0x29fbad[_0x834b('0x47')],'paused':_0x29fbad['paused'],'waiting':_0x29fbad['waiting']};_0x4b176e[_0x834b('0x1e')](_0xbd05ce);}}_0x194c22({'count':_0x4b176e[_0x834b('0x17')],'rows':_0x4b176e});});},'MailQueues':function(_0x4030f8){return new Promise(function(_0x51c9da,_0x2fc8b5){var _0x1a3e17=[];for(var _0x230026 in _0x49cf3c[_0x834b('0x48')]){if(_0x49cf3c[_0x834b('0x48')][_0x834b('0x3f')](_0x230026)){var _0x11d30a=_0x49cf3c[_0x834b('0x48')][_0x230026];var _0x1738ed={'id':_0x11d30a['id'],'available':_0x11d30a[_0x834b('0x45')],'loggedIn':_0x11d30a[_0x834b('0x46')],'name':_0x11d30a[_0x834b('0x47')],'paused':_0x11d30a[_0x834b('0x49')],'waiting':_0x11d30a[_0x834b('0x4a')]};_0x1a3e17[_0x834b('0x1e')](_0x1738ed);}}_0x51c9da({'count':_0x1a3e17[_0x834b('0x17')],'rows':_0x1a3e17});});},'OpenchannelQueues':function(_0x5c516a){return new Promise(function(_0xe368a9,_0x1aaa48){var _0x963c84=[];for(var _0x42a5f8 in _0x49cf3c[_0x834b('0x4b')]){if(_0x49cf3c[_0x834b('0x4b')]['hasOwnProperty'](_0x42a5f8)){var _0xae25b=_0x49cf3c[_0x834b('0x4b')][_0x42a5f8];var _0xdb89f={'id':_0xae25b['id'],'available':_0xae25b[_0x834b('0x45')],'loggedIn':_0xae25b[_0x834b('0x46')],'name':_0xae25b['name'],'paused':_0xae25b['paused'],'waiting':_0xae25b[_0x834b('0x4a')]};_0x963c84[_0x834b('0x1e')](_0xdb89f);}}_0xe368a9({'count':_0x963c84[_0x834b('0x17')],'rows':_0x963c84});});},'SmsQueues':function(_0x5454f1){return new Promise(function(_0x462601,_0x4e30a7){var _0x42131a=[];for(var _0x31a70c in _0x49cf3c[_0x834b('0x4c')]){if(_0x49cf3c[_0x834b('0x4c')]['hasOwnProperty'](_0x31a70c)){var _0x53797a=_0x49cf3c['smsQueues'][_0x31a70c];var _0x727ad5={'id':_0x53797a['id'],'available':_0x53797a[_0x834b('0x45')],'loggedIn':_0x53797a[_0x834b('0x46')],'name':_0x53797a['name'],'paused':_0x53797a[_0x834b('0x49')],'waiting':_0x53797a['waiting']};_0x42131a[_0x834b('0x1e')](_0x727ad5);}}_0x462601({'count':_0x42131a[_0x834b('0x17')],'rows':_0x42131a});});},'FaxQueues':function(_0x314fca){return new Promise(function(_0x5f4ce1,_0x425b94){var _0x13ca70=[];for(var _0x37e35a in _0x49cf3c[_0x834b('0x4d')]){if(_0x49cf3c[_0x834b('0x4d')][_0x834b('0x3f')](_0x37e35a)){var _0x347da2=_0x49cf3c[_0x834b('0x4d')][_0x37e35a];var _0x2f0d92={'id':_0x347da2['id'],'available':_0x347da2[_0x834b('0x45')],'loggedIn':_0x347da2[_0x834b('0x46')],'name':_0x347da2['name'],'paused':_0x347da2[_0x834b('0x49')],'waiting':_0x347da2['waiting']};_0x13ca70[_0x834b('0x1e')](_0x2f0d92);}}_0x5f4ce1({'count':_0x13ca70[_0x834b('0x17')],'rows':_0x13ca70});});},'ChatQueuesWaitingInteractions':function(_0x53813c){return new Promise(function(_0x418598,_0x412f24){var _0x19663c=_[_0x834b('0x43')](_0x49cf3c[_0x834b('0x4e')]);_0x418598({'count':_0x19663c['length'],'rows':_0x19663c});});},'MailQueuesWaitingInteractions':function(_0x1887db){return new Promise(function(_0x37f15f,_0x3d8e2e){var _0x8f3194=_[_0x834b('0x43')](_0x49cf3c[_0x834b('0x4f')]);_0x37f15f({'count':_0x8f3194[_0x834b('0x17')],'rows':_0x8f3194});});},'OpenchannelQueuesWaitingInteractions':function(_0x256894){return new Promise(function(_0x1ad43d,_0x19a065){var _0x53eb81=_['values'](_0x49cf3c[_0x834b('0x50')]);_0x1ad43d({'count':_0x53eb81[_0x834b('0x17')],'rows':_0x53eb81});});},'SmsQueuesWaitingInteractions':function(_0x4efd76){return new Promise(function(_0x341a41,_0x5575af){var _0x2e215b=_[_0x834b('0x43')](_0x49cf3c[_0x834b('0x51')]);_0x341a41({'count':_0x2e215b[_0x834b('0x17')],'rows':_0x2e215b});});},'FaxQueuesWaitingInteractions':function(_0x3a3e5e){return new Promise(function(_0x34f364,_0x1f427c){var _0x4dc7ae=_[_0x834b('0x43')](_0x49cf3c['faxQueuesWaitingInteractions']);_0x34f364({'count':_0x4dc7ae[_0x834b('0x17')],'rows':_0x4dc7ae});});}};var _0xdec323=jayson[_0x834b('0x52')](_0x433215)[_0x834b('0x53')]();_0xdec323['on'](_0x834b('0x2f'),function(_0x5a9917){logger[_0x834b('0x2f')](JSON['stringify'](_0x5a9917));return _0xd2542b(_0x5a9917);});_0xdec323[_0x834b('0x11')](0x232c,_0x834b('0x54'),function(){console[_0x834b('0x55')](_0x834b('0x56'),0x232c);return _0x3c8918(_0x834b('0x57')+0x232c);});});}; \ No newline at end of file +var _0x8e20=['../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','channel','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','Applications\x20executed','matchPath','end','stack','routing\x20is\x20empty','emit','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agents','agent','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport'];(function(_0x4253d8,_0x3d72d2){var _0x2814ca=function(_0x306288){while(--_0x306288){_0x4253d8['push'](_0x4253d8['shift']());}};_0x2814ca(++_0x3d72d2);}(_0x8e20,0x1ae));var _0x08e2=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x8e20[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0x08e2('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x08e2('0x1'));var BPromise=require(_0x08e2('0x2'));var uuid=require(_0x08e2('0x3'));var config=require(_0x08e2('0x4'));var logger=require(_0x08e2('0x5'))(_0x08e2('0x6'));var rpc={'openchannelQueueReport':require(_0x08e2('0x7'))};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x08e2('0x8')),'chatQueueReport':require(_0x08e2('0x9')),'smsQueueReport':require(_0x08e2('0xa')),'faxQueueReport':require(_0x08e2('0xb'))};var RuleEngine=require(_0x08e2('0xc'));function getId(_0xa5426f,_0x511a58,_0xc74a68){return util[_0x08e2('0xd')](_0x08e2('0xe'),_0xa5426f,_0x511a58||0x0,_0xc74a68||0x0);}function getIntervals(_0x815425,_0x5b25b0){var _0x13974a=[];if(!_[_0x08e2('0xf')](_0x5b25b0['IntervalId'])&&!_[_0x08e2('0xf')](_0x815425[_0x5b25b0[_0x08e2('0x10')]])&&!_[_0x08e2('0xf')](_0x815425[_0x5b25b0[_0x08e2('0x10')]]['Intervals'])){_0x13974a=_[_0x08e2('0x11')](_0x815425[_0x5b25b0[_0x08e2('0x10')]]['Intervals'],_0x08e2('0x12'));}else if(!_[_0x08e2('0xf')](_0x5b25b0['interval'])){_0x13974a=[_0x5b25b0[_0x08e2('0x12')]];}return _0x13974a;}exports[_0x08e2('0x13')]=function(_0x51bd4c){_0x51bd4c['rules']={};return new BPromise(function(_0x3377ab,_0x4a694b){var _0x587997={'Start':function(_0xac219b){var _0x306954=this;return new Promise(function(_0x5d9a21,_0x5ed7bc){if(_0xac219b){try{var _0x3a1883=[];var _0x239486=getId(_0xac219b[_0x08e2('0x14')],_0xac219b['message']?_0xac219b[_0x08e2('0x15')]['id']:0x0,_0xac219b[_0x08e2('0x16')]?_0xac219b['interaction']['id']:0x0);if(_0xac219b[_0x08e2('0x17')]&&_['isArray'](_0xac219b[_0x08e2('0x17')])&&_0xac219b[_0x08e2('0x17')][_0x08e2('0x18')]){for(var _0x68df55=0x0;_0x68df55<_0xac219b[_0x08e2('0x17')]['length'];_0x68df55+=0x1){var _0x511623=_0xac219b['applications'][_0x68df55];if(fs[_0x08e2('0x19')](path[_0x08e2('0x1a')](__dirname,_0x08e2('0x17'),_0x511623[_0x08e2('0x1b')]+_0x08e2('0x1c')))){var _0xbb4dc0=[];switch(_0x511623[_0x08e2('0x1b')][_0x08e2('0x1d')]()){case _0x08e2('0x1e'):var _0x422e7b=_0x511623[_0x08e2('0x1f')][_0x08e2('0x20')](',');_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x0]);_0xbb4dc0['push'](_0x422e7b[_0x08e2('0x22')](0x1,_0x422e7b[_0x08e2('0x18')])['join'](','));break;case _0x08e2('0x23'):var _0x422e7b=_0x511623[_0x08e2('0x1f')][_0x08e2('0x20')](',');_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x0]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x1]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[_0x08e2('0x22')](0x2,_0x422e7b[_0x08e2('0x18')])[_0x08e2('0x1a')](','));break;case _0x08e2('0x24'):var _0x422e7b=_0x511623[_0x08e2('0x1f')][_0x08e2('0x20')](',');_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x0]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x1]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x2]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[0x3]);_0xbb4dc0[_0x08e2('0x21')](_0x422e7b[_0x08e2('0x22')](0x4,_0x422e7b[_0x08e2('0x18')])[_0x08e2('0x1a')](','));break;case _0x08e2('0x15'):_0xbb4dc0['push'](_0x511623[_0x08e2('0x1f')]);break;case _0x08e2('0x25'):_0xbb4dc0[_0x08e2('0x21')](_0x511623['TagId']);_0xbb4dc0[_0x08e2('0x21')](_0x511623[_0x08e2('0x1f')]);break;default:_0xbb4dc0=_[_0x08e2('0xf')](_0x511623[_0x08e2('0x1f')])?[]:_0x511623[_0x08e2('0x1f')][_0x08e2('0x20')](',');}var _0x1a049f={'id':util['format'](_0x08e2('0x26'),_0x239486,_0x511623['id'],_0x511623[_0x08e2('0x1b')]),'condition':require(_0x08e2('0x27'))[_0x08e2('0x28')](_0x239486,getIntervals(_0x51bd4c[_0x08e2('0x29')],_0x511623),_0x51bd4c),'consequence':require(_0x08e2('0x2a')+_0x511623[_0x08e2('0x1b')])['consequence'](_0x239486,_0xbb4dc0,_0x51bd4c,_0xac219b),'p':_0x511623[_0x08e2('0x2b')]||0x0};logger[_0x08e2('0x2c')](_0x08e2('0x2d'),_0x1a049f['id'],_0x08e2('0x2e'),getIntervals(_0x51bd4c[_0x08e2('0x29')],_0x511623)['join']('\x20|\x20'));_0x3a1883['push'](_0x1a049f);}else{logger[_0x08e2('0x2f')](_0x08e2('0x30'),path[_0x08e2('0x1a')](__dirname,_0x08e2('0x17'),_0x511623[_0x08e2('0x1b')]+_0x08e2('0x1c')));}}_0x51bd4c[_0x08e2('0x31')][_0x239486]=new RuleEngine(_0x3a1883);_0x51bd4c['rules'][_0x239486]['execute'](_0xac219b,function(_0x17d4bd){logger[_0x08e2('0x2c')](_0x08e2('0x32'),JSON['stringify'](_0x17d4bd[_0x08e2('0x33')]));if(_0x51bd4c[_0x08e2('0x31')][_0x239486]){_0x51bd4c[_0x08e2('0x31')][_0x239486]['emit'](_0x08e2('0x34'));}});return _0x5d9a21({'code':0xc8,'message':_0xac219b});}else{logger[_0x08e2('0x2c')]('No\x20applications\x20to\x20execute');return _0x5d9a21({'code':0xc8,'message':_0xac219b});}}catch(_0xb3eea7){logger[_0x08e2('0x2f')](_0xb3eea7[_0x08e2('0x35')]);return _0x5ed7bc(_0x306954[_0x08e2('0x2f')](0x1f4,_0xb3eea7));}}return _0x5ed7bc(_0x08e2('0x36'));});},'AcceptMessage':function(_0x5a3e34){var _0x190205=this;return new Promise(function(_0x3f79f6,_0x516c51){if(_0x5a3e34[_0x08e2('0x15')]&&_0x5a3e34['message']['id']){try{var _0x5c4642=getId(_0x5a3e34[_0x08e2('0x14')],_0x5a3e34[_0x08e2('0x15')]?_0x5a3e34['message']['id']:0x0,_0x5a3e34[_0x08e2('0x16')]?_0x5a3e34[_0x08e2('0x16')]['id']:0x0);if(_0x51bd4c['rules'][_0x5c4642]){_0x51bd4c[_0x08e2('0x31')][_0x5c4642][_0x08e2('0x37')](_0x08e2('0x34'));if(rpc[_0x5a3e34[_0x08e2('0x14')]+'QueueReport']){rpc[_0x5a3e34['channel']+_0x08e2('0x38')][_0x08e2('0x39')](_0x5c4642,{'UserId':_0x5a3e34[_0x08e2('0x15')][_0x08e2('0x3a')]})['catch'](function(_0x32ebe4){logger[_0x08e2('0x2f')](_0x08e2('0x3b'));});}}return _0x3f79f6({'code':0xc8,'message':_0x5a3e34});}catch(_0x1762b0){logger[_0x08e2('0x2f')](_0x1762b0[_0x08e2('0x35')]);return _0x516c51(_0x190205[_0x08e2('0x2f')](0x1f4,_0x1762b0));}}logger[_0x08e2('0x2f')](_0x08e2('0x3c'));return _0x516c51(_0x190205['error'](0x1f4,_0x08e2('0x3c')));});},'RejectMessage':function(_0x95405f){var _0x47e82e=this;return new Promise(function(_0xe50775,_0x75a14){if(_0x95405f['agent']&&_0x95405f['agent']['id']){try{if(_0x51bd4c[_0x08e2('0x3d')][_0x95405f[_0x08e2('0x3e')]['id']]){_0x51bd4c[_0x08e2('0x3d')][_0x95405f['agent']['id']][_0x08e2('0x3f')]=![];_0x51bd4c[_0x08e2('0x3d')][_0x95405f[_0x08e2('0x3e')]['id']]['busyQueue']=undefined;}return _0xe50775({'code':0xc8,'message':_0x95405f});}catch(_0x199b83){logger[_0x08e2('0x2f')](_0x199b83[_0x08e2('0x35')]);return _0x75a14(_0x47e82e[_0x08e2('0x2f')](0x1f4,_0x199b83));}}logger[_0x08e2('0x2f')]('message\x20is\x20empty');return _0x75a14(_0x47e82e['error'](0x1f4,_0x08e2('0x3c')));});},'AbandonInteraction':function(_0x380147){var _0x510b71=this;return new Promise(function(_0x5866ac,_0x199fd1){if(_0x380147['channel']&&_0x380147[_0x08e2('0x16')]&&_0x380147[_0x08e2('0x16')]['id']){try{var _0x5043be=getId(_0x380147['channel'],_0x380147[_0x08e2('0x15')]?_0x380147['message']['id']:0x0,_0x380147[_0x08e2('0x16')]?_0x380147['interaction']['id']:0x0);if(_0x51bd4c[_0x08e2('0x31')][_0x5043be]){_0x51bd4c[_0x08e2('0x31')][_0x5043be][_0x08e2('0x37')](_0x08e2('0x34'));}return _0x5866ac({'code':0xc8,'message':_0x380147});}catch(_0x2281a1){logger['error'](_0x2281a1[_0x08e2('0x35')]);return _0x199fd1(_0x510b71[_0x08e2('0x2f')](0x1f4,_0x2281a1));}}logger[_0x08e2('0x2f')](_0x08e2('0x3c'));return _0x199fd1(_0x510b71[_0x08e2('0x2f')](0x1f4,_0x08e2('0x3c')));});},'AgentCapacity':function(_0x28089c){var _0x180ae1=this;return new Promise(function(_0x475173,_0x2872e7){if(_0x51bd4c[_0x08e2('0x3d')]['hasOwnProperty'](_0x28089c['id'])){for(var _0x132185 in _0x28089c['capacity']){if(_0x28089c[_0x08e2('0x40')][_0x08e2('0x41')](_0x132185)){if(_0x51bd4c[_0x08e2('0x3d')][_0x28089c['id']][_0x08e2('0x41')](_0x132185+_0x08e2('0x42'))){_0x51bd4c[_0x08e2('0x3d')][_0x28089c['id']][_0x132185+_0x08e2('0x42')]=parseInt(_0x28089c[_0x08e2('0x40')][_0x132185],0xa);}}}_0x51bd4c[_0x08e2('0x3d')][_0x28089c['id']][_0x08e2('0x43')]();return _0x475173({'code':0xc8,'message':_0x51bd4c[_0x08e2('0x3d')][_0x28089c['id']]});}else{return _0x2872e7(_0x180ae1[_0x08e2('0x2f')](0x1f4,_0x08e2('0x44')));}});},'Agents':function(_0x4fae8c){return new Promise(function(_0xfd65a1,_0x1ce40a){var _0x2113d4=_[_0x08e2('0x45')](_0x51bd4c[_0x08e2('0x3d')]);_0xfd65a1({'count':_0x2113d4[_0x08e2('0x18')],'rows':_0x2113d4});});},'ChatQueues':function(_0x1939f9){return new Promise(function(_0x397d83,_0x146e5a){var _0x2e67d2=[];for(var _0xcd3d6 in _0x51bd4c[_0x08e2('0x46')]){if(_0x51bd4c[_0x08e2('0x46')][_0x08e2('0x41')](_0xcd3d6)){var _0x557f67=_0x51bd4c[_0x08e2('0x46')][_0xcd3d6];var _0x1c7a45={'id':_0x557f67['id'],'available':_0x557f67['available'],'loggedIn':_0x557f67[_0x08e2('0x47')],'name':_0x557f67[_0x08e2('0x48')],'paused':_0x557f67[_0x08e2('0x49')],'waiting':_0x557f67[_0x08e2('0x4a')]};_0x2e67d2[_0x08e2('0x21')](_0x1c7a45);}}_0x397d83({'count':_0x2e67d2[_0x08e2('0x18')],'rows':_0x2e67d2});});},'MailQueues':function(_0x731167){return new Promise(function(_0x391592,_0x2798b7){var _0x2e96d6=[];for(var _0x2f6bd1 in _0x51bd4c[_0x08e2('0x4b')]){if(_0x51bd4c[_0x08e2('0x4b')][_0x08e2('0x41')](_0x2f6bd1)){var _0x6e7e71=_0x51bd4c[_0x08e2('0x4b')][_0x2f6bd1];var _0x327441={'id':_0x6e7e71['id'],'available':_0x6e7e71[_0x08e2('0x4c')],'loggedIn':_0x6e7e71[_0x08e2('0x47')],'name':_0x6e7e71[_0x08e2('0x48')],'paused':_0x6e7e71[_0x08e2('0x49')],'waiting':_0x6e7e71[_0x08e2('0x4a')]};_0x2e96d6['push'](_0x327441);}}_0x391592({'count':_0x2e96d6[_0x08e2('0x18')],'rows':_0x2e96d6});});},'OpenchannelQueues':function(_0x318ab1){return new Promise(function(_0x512900,_0x3b862b){var _0x3a792f=[];for(var _0x3fa5e7 in _0x51bd4c[_0x08e2('0x4d')]){if(_0x51bd4c[_0x08e2('0x4d')]['hasOwnProperty'](_0x3fa5e7)){var _0x5c9ebe=_0x51bd4c[_0x08e2('0x4d')][_0x3fa5e7];var _0x4c818b={'id':_0x5c9ebe['id'],'available':_0x5c9ebe['available'],'loggedIn':_0x5c9ebe[_0x08e2('0x47')],'name':_0x5c9ebe['name'],'paused':_0x5c9ebe[_0x08e2('0x49')],'waiting':_0x5c9ebe[_0x08e2('0x4a')]};_0x3a792f[_0x08e2('0x21')](_0x4c818b);}}_0x512900({'count':_0x3a792f[_0x08e2('0x18')],'rows':_0x3a792f});});},'SmsQueues':function(_0x540f81){return new Promise(function(_0x2bff69,_0x475beb){var _0x3f47e9=[];for(var _0x47cb97 in _0x51bd4c[_0x08e2('0x4e')]){if(_0x51bd4c[_0x08e2('0x4e')][_0x08e2('0x41')](_0x47cb97)){var _0x3e868e=_0x51bd4c[_0x08e2('0x4e')][_0x47cb97];var _0x231ab0={'id':_0x3e868e['id'],'available':_0x3e868e[_0x08e2('0x4c')],'loggedIn':_0x3e868e['loggedIn'],'name':_0x3e868e[_0x08e2('0x48')],'paused':_0x3e868e['paused'],'waiting':_0x3e868e['waiting']};_0x3f47e9['push'](_0x231ab0);}}_0x2bff69({'count':_0x3f47e9['length'],'rows':_0x3f47e9});});},'FaxQueues':function(_0x32f563){return new Promise(function(_0x511358,_0x565c5c){var _0x4ee36f=[];for(var _0x2390aa in _0x51bd4c[_0x08e2('0x4f')]){if(_0x51bd4c[_0x08e2('0x4f')][_0x08e2('0x41')](_0x2390aa)){var _0x137dc1=_0x51bd4c[_0x08e2('0x4f')][_0x2390aa];var _0x2b3404={'id':_0x137dc1['id'],'available':_0x137dc1[_0x08e2('0x4c')],'loggedIn':_0x137dc1['loggedIn'],'name':_0x137dc1[_0x08e2('0x48')],'paused':_0x137dc1['paused'],'waiting':_0x137dc1['waiting']};_0x4ee36f[_0x08e2('0x21')](_0x2b3404);}}_0x511358({'count':_0x4ee36f[_0x08e2('0x18')],'rows':_0x4ee36f});});},'ChatQueuesWaitingInteractions':function(_0x5e1d87){return new Promise(function(_0x590bb7,_0x52bb13){var _0x13796a=_[_0x08e2('0x45')](_0x51bd4c[_0x08e2('0x50')]);_0x590bb7({'count':_0x13796a[_0x08e2('0x18')],'rows':_0x13796a});});},'MailQueuesWaitingInteractions':function(_0x284999){return new Promise(function(_0x192123,_0x4c6cc7){var _0x540819=_[_0x08e2('0x45')](_0x51bd4c[_0x08e2('0x51')]);_0x192123({'count':_0x540819['length'],'rows':_0x540819});});},'OpenchannelQueuesWaitingInteractions':function(_0xf72249){return new Promise(function(_0x50b14a,_0x24aba9){var _0x3b11e2=_[_0x08e2('0x45')](_0x51bd4c[_0x08e2('0x52')]);_0x50b14a({'count':_0x3b11e2['length'],'rows':_0x3b11e2});});},'SmsQueuesWaitingInteractions':function(_0x48d4cf){return new Promise(function(_0x1b5d59,_0x16f961){var _0x2c2262=_[_0x08e2('0x45')](_0x51bd4c['smsQueuesWaitingInteractions']);_0x1b5d59({'count':_0x2c2262['length'],'rows':_0x2c2262});});},'FaxQueuesWaitingInteractions':function(_0x2ffddf){return new Promise(function(_0x4dde3b,_0x466df1){var _0x12b068=_[_0x08e2('0x45')](_0x51bd4c['faxQueuesWaitingInteractions']);_0x4dde3b({'count':_0x12b068['length'],'rows':_0x12b068});});}};var _0x11d1bd=jayson[_0x08e2('0x53')](_0x587997)[_0x08e2('0x54')]();_0x11d1bd['on'](_0x08e2('0x2f'),function(_0x1c2191){logger[_0x08e2('0x2f')](JSON['stringify'](_0x1c2191));return _0x4a694b(_0x1c2191);});_0x11d1bd['listen'](0x232c,'127.0.0.1',function(){console[_0x08e2('0x55')](_0x08e2('0x56'),0x232c);return _0x3377ab(_0x08e2('0x57')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b98693c..96d7263 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 _0xce5e=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','request','then','error','message','catch','condition','rules'];(function(_0x395b29,_0x2bc143){var _0x49bacb=function(_0x18db2d){while(--_0x18db2d){_0x395b29['push'](_0x395b29['shift']());}};_0x49bacb(++_0x2bc143);}(_0xce5e,0x189));var _0xece5=function(_0xb43381,_0x90890a){_0xb43381=_0xb43381-0x0;var _0x5cd4f1=_0xce5e[_0xb43381];return _0x5cd4f1;};'use strict';var util=require(_0xece5('0x0'));var BPromise=require(_0xece5('0x1'));var jayson=require(_0xece5('0x2'));var _=require(_0xece5('0x3'));var logger=require(_0xece5('0x4'))(_0xece5('0x5'));var client=jayson['client']['http']({'port':0x232a});function request(_0x106aad,_0x5a4226){return new BPromise(function(_0xa3f07f,_0x2f29ee){return client[_0xece5('0x6')](_0x106aad,_0x5a4226)[_0xece5('0x7')](function(_0x27f629){if(_0x27f629[_0xece5('0x8')]){return _0x2f29ee(_0x27f629['error'][_0xece5('0x9')]);}else{return _0xa3f07f(_0x27f629['result']);}})[_0xece5('0xa')](function(_0x1903e4){return _0x2f29ee(_0x1903e4);});});}exports[_0xece5('0xb')]=function(_0x1752d9,_0x3a72cd,_0x4876ef){return function(_0x8bd258){if(_0x4876ef[_0xece5('0xc')]&&!_0x4876ef['rules'][_0x1752d9]){logger['info'](_0xece5('0xd'),_0x1752d9);return _0x8bd258[_0xece5('0xe')]();}var _0x625632=[];for(var _0x34ff33=0x0;_0x34ff33<_0x3a72cd[_0xece5('0xf')];_0x34ff33+=0x1){_0x625632[_0xece5('0x10')](request('Command',{'command':util[_0xece5('0x11')](_0xece5('0x12'),_0x3a72cd[_0x34ff33])})[_0xece5('0x7')](function(_0x3b64c0){return _0x3b64c0&&_0x3b64c0[_0xece5('0x9')]&&_0x3b64c0[_0xece5('0x9')][_0xece5('0x13')](_0xece5('0x14'))>=0x0?!![]:![];})[_0xece5('0xa')](function(_0x5713b6){logger[_0xece5('0x8')]('[%s][INTERVAL]\x20%s',_0x1752d9,_0x3a72cd[_0x34ff33]);}));}BPromise[_0xece5('0x15')](_0x625632)[_0xece5('0x7')](function(_0x3ca0a7){var _0x53c634=_[_0xece5('0x16')](_0x3ca0a7);logger[_0xece5('0x17')](_0xece5('0x18'),_0x1752d9,_0x3a72cd[_0xece5('0x19')]('\x20|\x20'),_0x53c634);_0x8bd258[_0xece5('0x1a')](_0x53c634);})['catch'](function(_0x6818e9){console['log'](_0x6818e9);logger[_0xece5('0x8')](_0xece5('0x18'),_0x1752d9,_0x3a72cd[_0xece5('0x19')](_0xece5('0x1b')),_0x6818e9[_0xece5('0x1c')]);_0x8bd258[_0xece5('0xe')]();});};}; \ No newline at end of file +var _0x9925=['true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','stop','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','iftime\x20%s','indexOf'];(function(_0x3735c1,_0x8aec9b){var _0x1cd283=function(_0x49e414){while(--_0x49e414){_0x3735c1['push'](_0x3735c1['shift']());}};_0x1cd283(++_0x8aec9b);}(_0x9925,0x19f));var _0x5992=function(_0x2469e1,_0x42e9e6){_0x2469e1=_0x2469e1-0x0;var _0x2a90a1=_0x9925[_0x2469e1];return _0x2a90a1;};'use strict';var util=require(_0x5992('0x0'));var BPromise=require(_0x5992('0x1'));var jayson=require('jayson/promise');var _=require(_0x5992('0x2'));var logger=require(_0x5992('0x3'))(_0x5992('0x4'));var client=jayson[_0x5992('0x5')][_0x5992('0x6')]({'port':0x232a});function request(_0x5ecd5d,_0x33d5b3){return new BPromise(function(_0x1dbd7d,_0x53c2c9){return client[_0x5992('0x7')](_0x5ecd5d,_0x33d5b3)[_0x5992('0x8')](function(_0x4a9bc5){if(_0x4a9bc5[_0x5992('0x9')]){return _0x53c2c9(_0x4a9bc5[_0x5992('0x9')][_0x5992('0xa')]);}else{return _0x1dbd7d(_0x4a9bc5['result']);}})[_0x5992('0xb')](function(_0x336db2){return _0x53c2c9(_0x336db2);});});}exports[_0x5992('0xc')]=function(_0x45ffc2,_0x2b8108,_0x91cf04){return function(_0x4acf83){if(_0x91cf04[_0x5992('0xd')]&&!_0x91cf04['rules'][_0x45ffc2]){logger[_0x5992('0xe')](_0x5992('0xf'),_0x45ffc2);return _0x4acf83['stop']();}var _0x34939f=[];for(var _0x235e55=0x0;_0x235e55<_0x2b8108[_0x5992('0x10')];_0x235e55+=0x1){_0x34939f[_0x5992('0x11')](request('Command',{'command':util['format'](_0x5992('0x12'),_0x2b8108[_0x235e55])})[_0x5992('0x8')](function(_0x161740){return _0x161740&&_0x161740[_0x5992('0xa')]&&_0x161740['message'][_0x5992('0x13')](_0x5992('0x14'))>=0x0?!![]:![];})['catch'](function(_0x22602c){logger['error'](_0x5992('0x15'),_0x45ffc2,_0x2b8108[_0x235e55]);}));}BPromise['all'](_0x34939f)[_0x5992('0x8')](function(_0x4bb79a){var _0x58979c=_[_0x5992('0x16')](_0x4bb79a);logger[_0x5992('0xe')](_0x5992('0x17'),_0x45ffc2,_0x2b8108[_0x5992('0x18')](_0x5992('0x19')),_0x58979c);_0x4acf83[_0x5992('0x1a')](_0x58979c);})['catch'](function(_0x51ae0c){console['log'](_0x51ae0c);logger[_0x5992('0x9')](_0x5992('0x17'),_0x45ffc2,_0x2b8108[_0x5992('0x18')]('\x20|\x20'),_0x51ae0c[_0x5992('0x1b')]);_0x4acf83[_0x5992('0x1c')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b842457..67cffb4 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 _0x600f=['origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','agent','lodash','util','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','interface','queue','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalledAt','now','lastevent','connectedlinename','error','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','holdtime','ringtime','stack','queuecallerabandon','forIn','abandoned','talktime','agentconnect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcompleteAt','diffTime','complete','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid'];(function(_0x33a6d7,_0xa301b7){var _0x12c641=function(_0xef5802){while(--_0xef5802){_0x33a6d7['push'](_0x33a6d7['shift']());}};_0x12c641(++_0xa301b7);}(_0x600f,0x110));var _0xf600=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0x600f[_0xf33afd];return _0x5f432a;};'use strict';var _=require(_0xf600('0x0'));var util=require(_0xf600('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x18d009,_0x389e42){utils['info'](util[_0xf600('0x2')](_0xf600('0x3'),_0x18d009['uniqueid'],_0x18d009[_0xf600('0x4')],_0x18d009['queue'],_0x18d009['membername'],_0x18d009[_0xf600('0x5')],_0x18d009['calleridnum'],_0x18d009['connectedlinenum'],_0x18d009['lastevent']));if(_0x18d009['queue']){utils['getVoiceQueueByName'](_0x18d009[_0xf600('0x6')])[_0xf600('0x7')](function(_0x630f31){if(_0x630f31){_0x18d009['type']=_0x630f31[_0xf600('0x8')];_0x18d009[_0xf600('0x9')]=_0x18d009[_0xf600('0xa')]?_0x630f31[_0xf600('0xb')]:![];_0x18d009[_0xf600('0xc')]=_0x18d009[_0xf600('0x9')]?_0x630f31[_0xf600('0xd')]:0x0;}utils[_0xf600('0xe')]('CreateVoiceAgentReport',_0x18d009);});}else{utils[_0xf600('0xe')](_0xf600('0xf'),_0x18d009);}if(_0x389e42){delete transfers[_0x18d009[_0xf600('0x10')]];}else{delete agents[_0x18d009['destuniqueid']];}}exports['agentcalled']=function(_0x30a074){try{agents[_0x30a074[_0xf600('0x11')]]=_0x30a074;agents[_0x30a074[_0xf600('0x11')]][_0xf600('0x12')]=utils[_0xf600('0x13')]();agents[_0x30a074[_0xf600('0x11')]][_0xf600('0x14')]='called';agents[_0x30a074[_0xf600('0x11')]]['connectedlinenum']=null;agents[_0x30a074['destuniqueid']][_0xf600('0x15')]=null;}catch(_0x1f5ab9){utils[_0xf600('0x16')](_0x1f5ab9['stack']);}};exports[_0xf600('0x17')]=function(_0x5d521c){try{if(!_[_0xf600('0x18')](agents[_0x5d521c[_0xf600('0x11')]])){agents[_0x5d521c['destuniqueid']][_0xf600('0x17')]=!![];agents[_0x5d521c[_0xf600('0x11')]][_0xf600('0x19')]=utils[_0xf600('0x13')]();agents[_0x5d521c[_0xf600('0x11')]][_0xf600('0x14')]=_0xf600('0x1a');agents[_0x5d521c[_0xf600('0x11')]][_0xf600('0x1b')]=_0xf600('0x1a');agents[_0x5d521c['destuniqueid']][_0xf600('0x1c')]=_0x5d521c[_0xf600('0x1d')]?parseInt(_0x5d521c[_0xf600('0x1d')])/0x3e8:0x0;agents[_0x5d521c['destuniqueid']]['talktime']=0x0;writeDB(agents[_0x5d521c[_0xf600('0x11')]]);}}catch(_0x259c5d){utils['error'](_0x259c5d[_0xf600('0x1e')]);}};exports[_0xf600('0x1f')]=function(_0xcc33f3){try{_[_0xf600('0x20')](agents,function(_0x208f4a,_0x43ef4d){if(_0x208f4a[_0xf600('0x10')]==_0xcc33f3[_0xf600('0x10')]){_0x208f4a[_0xf600('0x17')]=!![];_0x208f4a[_0xf600('0x19')]=utils[_0xf600('0x13')]();_0x208f4a[_0xf600('0x14')]=_0xf600('0x21');_0x208f4a[_0xf600('0x1b')]=_0xf600('0x21');_0x208f4a['holdtime']=_0xcc33f3['holdtime'];_0x208f4a[_0xf600('0x22')]=0x0;writeDB(_0x208f4a);}});}catch(_0x122a39){utils[_0xf600('0x16')](_0x122a39[_0xf600('0x1e')]);}};exports[_0xf600('0x23')]=function(_0x2eb165){try{if(agents[_0x2eb165[_0xf600('0x11')]]){agents[_0x2eb165['destuniqueid']][_0xf600('0x24')]=utils[_0xf600('0x13')]();agents[_0x2eb165[_0xf600('0x11')]][_0xf600('0x25')]=_0x2eb165[_0xf600('0x25')];agents[_0x2eb165[_0xf600('0x11')]]['connectedlinename']=_0x2eb165['connectedlinename'];agents[_0x2eb165[_0xf600('0x11')]]['holdtime']=_0x2eb165[_0xf600('0x1d')];agents[_0x2eb165[_0xf600('0x11')]][_0xf600('0x14')]=_0xf600('0x26');_[_0xf600('0x20')](agents,function(_0x48839e,_0x30e491){if(_0x48839e['destuniqueid']!=_0x2eb165[_0xf600('0x11')]&&_0x48839e[_0xf600('0x10')]==_0x2eb165[_0xf600('0x10')]){_0x48839e[_0xf600('0x22')]=0x0;_0x48839e[_0xf600('0x1c')]=_0x2eb165[_0xf600('0x1d')];_0x48839e['agentringnoanswer']=!![];_0x48839e[_0xf600('0x19')]=utils[_0xf600('0x13')]();_0x48839e['lastevent']=_0xf600('0x27');_0x48839e['reason']=_0xf600('0x27');_0x48839e[_0xf600('0x28')]=_0x2eb165[_0xf600('0x11')];_0x48839e[_0xf600('0x29')]=_0x2eb165[_0xf600('0x2a')];writeDB(_0x48839e);}});}}catch(_0xc3279c){utils['error'](_0xc3279c[_0xf600('0x1e')]);}};exports[_0xf600('0xa')]=function(_0x579e86){try{if(!_['isNil'](agents[_0x579e86[_0xf600('0x11')]])){agents[_0x579e86[_0xf600('0x11')]][_0xf600('0xa')]=!![];agents[_0x579e86[_0xf600('0x11')]][_0xf600('0x2b')]=utils[_0xf600('0x13')]();agents[_0x579e86[_0xf600('0x11')]]['talktime']=utils[_0xf600('0x2c')](agents[_0x579e86[_0xf600('0x11')]][_0xf600('0x2b')],agents[_0x579e86[_0xf600('0x11')]][_0xf600('0x24')]);agents[_0x579e86[_0xf600('0x11')]][_0xf600('0x1b')]=_0x579e86[_0xf600('0x1b')];agents[_0x579e86['destuniqueid']][_0xf600('0x14')]=_0xf600('0x2d');writeDB(agents[_0x579e86[_0xf600('0x11')]]);}}catch(_0x1ab8d4){utils['error'](_0x1ab8d4['stack']);}};exports['blindtransfer']=function(_0x5b7165){try{if(!_[_0xf600('0x18')](agents[_0x5b7165[_0xf600('0x2e')]])){agents[_0x5b7165[_0xf600('0x2e')]][_0xf600('0x2f')]=!![];agents[_0x5b7165[_0xf600('0x2e')]][_0xf600('0x30')]=_0xf600('0x31');agents[_0x5b7165[_0xf600('0x2e')]][_0xf600('0x32')]=_0x5b7165['extension'];agents[_0x5b7165[_0xf600('0x2e')]][_0xf600('0x33')]=agents[_0x5b7165[_0xf600('0x2e')]][_0xf600('0x10')];}}catch(_0x1cbfcc){utils[_0xf600('0x16')](_0x1cbfcc[_0xf600('0x1e')]);}};exports['attendedtransfer']=function(_0x21e825){try{if(_0x21e825[_0xf600('0x34')]==_0x21e825[_0xf600('0x35')]){if(!_[_0xf600('0x18')](agents[_0x21e825['secondtransfereruniqueid']])){agents[_0x21e825[_0xf600('0x36')]][_0xf600('0x2f')]=!![];agents[_0x21e825[_0xf600('0x36')]][_0xf600('0x30')]='ATTENDED';agents[_0x21e825[_0xf600('0x36')]][_0xf600('0x32')]=_0x21e825[_0xf600('0x37')];agents[_0x21e825['secondtransfereruniqueid']][_0xf600('0x33')]=_0x21e825['origtransfereruniqueid'];}if(_0x21e825['transfereeuniqueid']&&agents[_0x21e825[_0xf600('0x38')]]){agents[_0x21e825[_0xf600('0x38')]][_0xf600('0x39')]=0x1;transfers[_0x21e825[_0xf600('0x38')]]=_['clone'](agents[_0x21e825[_0xf600('0x38')]]);transfers[_0x21e825['transfereeuniqueid']][_0xf600('0x3a')]=agents[_0x21e825[_0xf600('0x36')]][_0xf600('0x3a')];transfers[_0x21e825['transfereeuniqueid']]['calleridname']=agents[_0x21e825['secondtransfereruniqueid']][_0xf600('0x3b')];transfers[_0x21e825[_0xf600('0x38')]][_0xf600('0x12')]=utils[_0xf600('0x13')]();transfers[_0x21e825[_0xf600('0x38')]][_0xf600('0x24')]=utils['now']();transfers[_0x21e825[_0xf600('0x38')]][_0xf600('0x1c')]=0x0;transfers[_0x21e825[_0xf600('0x38')]]['agententerreason']=0x2;}}else if(_0x21e825['secondtransfereruniqueid']==_0x21e825[_0xf600('0x3c')]){if(!_[_0xf600('0x18')](agents[_0x21e825['origtransfereruniqueid']])){agents[_0x21e825[_0xf600('0x34')]][_0xf600('0x2f')]=!![];agents[_0x21e825[_0xf600('0x34')]][_0xf600('0x30')]=_0xf600('0x3d');agents[_0x21e825[_0xf600('0x34')]]['transferexten']=_0x21e825[_0xf600('0x3e')];agents[_0x21e825['origtransfereruniqueid']][_0xf600('0x33')]=_0x21e825[_0xf600('0x36')];}if(_0x21e825[_0xf600('0x3f')]&&agents[_0x21e825[_0xf600('0x3f')]]){agents[_0x21e825[_0xf600('0x3f')]][_0xf600('0x39')]=0x1;transfers[_0x21e825[_0xf600('0x3f')]]=_['clone'](agents[_0x21e825['transfertargetuniqueid']]);transfers[_0x21e825[_0xf600('0x3f')]]['calleridnum']=agents[_0x21e825[_0xf600('0x34')]][_0xf600('0x3a')];transfers[_0x21e825['transfertargetuniqueid']]['calleridname']=agents[_0x21e825[_0xf600('0x34')]][_0xf600('0x3b')];transfers[_0x21e825[_0xf600('0x3f')]][_0xf600('0x12')]=utils['now']();transfers[_0x21e825['transfertargetuniqueid']][_0xf600('0x24')]=utils['now']();transfers[_0x21e825['transfertargetuniqueid']][_0xf600('0x1c')]=0x0;transfers[_0x21e825[_0xf600('0x3f')]][_0xf600('0x39')]=0x2;}}}catch(_0x12dc89){utils['error'](_0x12dc89[_0xf600('0x1e')]);}};exports['hangup']=function(_0x328a6f){try{if(transfers[_0x328a6f[_0xf600('0x10')]]){transfers[_0x328a6f[_0xf600('0x10')]][_0xf600('0xa')]=!![];transfers[_0x328a6f[_0xf600('0x10')]][_0xf600('0x2b')]=utils[_0xf600('0x13')]();transfers[_0x328a6f[_0xf600('0x10')]]['talktime']=utils[_0xf600('0x2c')](transfers[_0x328a6f[_0xf600('0x10')]][_0xf600('0x2b')],transfers[_0x328a6f['uniqueid']][_0xf600('0x24')]);transfers[_0x328a6f[_0xf600('0x10')]][_0xf600('0x1b')]=_0xf600('0x40');transfers[_0x328a6f['uniqueid']][_0xf600('0x14')]='complete';writeDB(transfers[_0x328a6f['uniqueid']],!![]);}if(agents[_0x328a6f[_0xf600('0x10')]]&&agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x24')]){agents[_0x328a6f[_0xf600('0x10')]]['agentcomplete']=!![];agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x2b')]=utils['now']();agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x22')]=utils[_0xf600('0x2c')](agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x2b')],agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x24')]);agents[_0x328a6f['uniqueid']][_0xf600('0x1b')]=agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x2f')]?_0xf600('0x2f'):'agent';agents[_0x328a6f[_0xf600('0x10')]][_0xf600('0x14')]=_0xf600('0x2d');writeDB(agents[_0x328a6f['uniqueid']]);}}catch(_0x43110b){utils[_0xf600('0x16')](_0x43110b[_0xf600('0x1e')]);}}; \ No newline at end of file +var _0xdda5=['talktime','forIn','abandoned','agentconnect','connect','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','reason','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','destuniqueid','agentcalledAt','now','called','connectedlinename','error','stack','isNil','agentringnoanswer','agentringnoanswerAt','rejected','holdtime','ringtime'];(function(_0x2f4112,_0x4a2758){var _0x12d4a0=function(_0x2c79ff){while(--_0x2c79ff){_0x2f4112['push'](_0x2f4112['shift']());}};_0x12d4a0(++_0x4a2758);}(_0xdda5,0xa8));var _0x5dda=function(_0x38f867,_0x115796){_0x38f867=_0x38f867-0x0;var _0x59ae1d=_0xdda5[_0x38f867];return _0x59ae1d;};'use strict';var _=require(_0x5dda('0x0'));var util=require(_0x5dda('0x1'));var utils=require(_0x5dda('0x2'));var agents={};var transfers={};function writeDB(_0x19918e,_0x3dfe04){utils[_0x5dda('0x3')](util[_0x5dda('0x4')](_0x5dda('0x5'),_0x19918e[_0x5dda('0x6')],_0x19918e[_0x5dda('0x7')],_0x19918e[_0x5dda('0x8')],_0x19918e[_0x5dda('0x9')],_0x19918e['interface'],_0x19918e[_0x5dda('0xa')],_0x19918e[_0x5dda('0xb')],_0x19918e[_0x5dda('0xc')]));if(_0x19918e[_0x5dda('0x8')]){utils[_0x5dda('0xd')](_0x19918e[_0x5dda('0x8')])[_0x5dda('0xe')](function(_0xb25baa){if(_0xb25baa){_0x19918e[_0x5dda('0xf')]=_0xb25baa[_0x5dda('0xf')];_0x19918e[_0x5dda('0x10')]=_0x19918e['agentcomplete']?_0xb25baa[_0x5dda('0x11')]:![];_0x19918e[_0x5dda('0x12')]=_0x19918e[_0x5dda('0x10')]?_0xb25baa[_0x5dda('0x13')]:0x0;}utils['request'](_0x5dda('0x14'),_0x19918e);});}else{utils[_0x5dda('0x15')](_0x5dda('0x14'),_0x19918e);}if(_0x3dfe04){delete transfers[_0x19918e[_0x5dda('0x6')]];}else{delete agents[_0x19918e['destuniqueid']];}}exports[_0x5dda('0x16')]=function(_0x58fb55){try{agents[_0x58fb55[_0x5dda('0x17')]]=_0x58fb55;agents[_0x58fb55[_0x5dda('0x17')]][_0x5dda('0x18')]=utils[_0x5dda('0x19')]();agents[_0x58fb55['destuniqueid']][_0x5dda('0xc')]=_0x5dda('0x1a');agents[_0x58fb55[_0x5dda('0x17')]][_0x5dda('0xb')]=null;agents[_0x58fb55[_0x5dda('0x17')]][_0x5dda('0x1b')]=null;}catch(_0x429b6a){utils[_0x5dda('0x1c')](_0x429b6a[_0x5dda('0x1d')]);}};exports['agentringnoanswer']=function(_0x481cca){try{if(!_[_0x5dda('0x1e')](agents[_0x481cca[_0x5dda('0x17')]])){agents[_0x481cca[_0x5dda('0x17')]][_0x5dda('0x1f')]=!![];agents[_0x481cca[_0x5dda('0x17')]][_0x5dda('0x20')]=utils[_0x5dda('0x19')]();agents[_0x481cca[_0x5dda('0x17')]][_0x5dda('0xc')]=_0x5dda('0x21');agents[_0x481cca[_0x5dda('0x17')]]['reason']=_0x5dda('0x21');agents[_0x481cca[_0x5dda('0x17')]][_0x5dda('0x22')]=_0x481cca[_0x5dda('0x23')]?parseInt(_0x481cca[_0x5dda('0x23')])/0x3e8:0x0;agents[_0x481cca['destuniqueid']][_0x5dda('0x24')]=0x0;writeDB(agents[_0x481cca[_0x5dda('0x17')]]);}}catch(_0x49f19a){utils[_0x5dda('0x1c')](_0x49f19a[_0x5dda('0x1d')]);}};exports['queuecallerabandon']=function(_0x1093e3){try{_[_0x5dda('0x25')](agents,function(_0x1d4d90,_0x2b880a){if(_0x1d4d90[_0x5dda('0x6')]==_0x1093e3[_0x5dda('0x6')]){_0x1d4d90[_0x5dda('0x1f')]=!![];_0x1d4d90[_0x5dda('0x20')]=utils['now']();_0x1d4d90[_0x5dda('0xc')]=_0x5dda('0x26');_0x1d4d90['reason']=_0x5dda('0x26');_0x1d4d90['holdtime']=_0x1093e3['holdtime'];_0x1d4d90[_0x5dda('0x24')]=0x0;writeDB(_0x1d4d90);}});}catch(_0x51db9c){utils[_0x5dda('0x1c')](_0x51db9c[_0x5dda('0x1d')]);}};exports[_0x5dda('0x27')]=function(_0x32b9e3){try{if(agents[_0x32b9e3[_0x5dda('0x17')]]){agents[_0x32b9e3['destuniqueid']]['agentconnectAt']=utils[_0x5dda('0x19')]();agents[_0x32b9e3[_0x5dda('0x17')]][_0x5dda('0xb')]=_0x32b9e3[_0x5dda('0xb')];agents[_0x32b9e3[_0x5dda('0x17')]]['connectedlinename']=_0x32b9e3[_0x5dda('0x1b')];agents[_0x32b9e3[_0x5dda('0x17')]]['holdtime']=_0x32b9e3[_0x5dda('0x23')];agents[_0x32b9e3['destuniqueid']][_0x5dda('0xc')]=_0x5dda('0x28');_[_0x5dda('0x25')](agents,function(_0x14a8fb,_0x41aa09){if(_0x14a8fb[_0x5dda('0x17')]!=_0x32b9e3['destuniqueid']&&_0x14a8fb[_0x5dda('0x6')]==_0x32b9e3[_0x5dda('0x6')]){_0x14a8fb[_0x5dda('0x24')]=0x0;_0x14a8fb[_0x5dda('0x22')]=_0x32b9e3['ringtime'];_0x14a8fb[_0x5dda('0x1f')]=!![];_0x14a8fb[_0x5dda('0x20')]=utils[_0x5dda('0x19')]();_0x14a8fb[_0x5dda('0xc')]='answered_elsewhere';_0x14a8fb['reason']='answered_elsewhere';_0x14a8fb[_0x5dda('0x29')]=_0x32b9e3[_0x5dda('0x17')];_0x14a8fb[_0x5dda('0x2a')]=_0x32b9e3[_0x5dda('0x9')];writeDB(_0x14a8fb);}});}}catch(_0x168e54){utils[_0x5dda('0x1c')](_0x168e54[_0x5dda('0x1d')]);}};exports[_0x5dda('0x2b')]=function(_0x26fd9e){try{if(!_[_0x5dda('0x1e')](agents[_0x26fd9e[_0x5dda('0x17')]])){agents[_0x26fd9e['destuniqueid']][_0x5dda('0x2b')]=!![];agents[_0x26fd9e[_0x5dda('0x17')]][_0x5dda('0x2c')]=utils['now']();agents[_0x26fd9e['destuniqueid']][_0x5dda('0x24')]=utils[_0x5dda('0x2d')](agents[_0x26fd9e[_0x5dda('0x17')]]['agentcompleteAt'],agents[_0x26fd9e[_0x5dda('0x17')]][_0x5dda('0x2e')]);agents[_0x26fd9e[_0x5dda('0x17')]]['reason']=_0x26fd9e[_0x5dda('0x2f')];agents[_0x26fd9e['destuniqueid']][_0x5dda('0xc')]=_0x5dda('0x30');writeDB(agents[_0x26fd9e[_0x5dda('0x17')]]);}}catch(_0x4c39c3){utils[_0x5dda('0x1c')](_0x4c39c3['stack']);}};exports[_0x5dda('0x31')]=function(_0x49468e){try{if(!_[_0x5dda('0x1e')](agents[_0x49468e['transfereruniqueid']])){agents[_0x49468e[_0x5dda('0x32')]][_0x5dda('0x33')]=!![];agents[_0x49468e[_0x5dda('0x32')]][_0x5dda('0x34')]=_0x5dda('0x35');agents[_0x49468e['transfereruniqueid']][_0x5dda('0x36')]=_0x49468e['extension'];agents[_0x49468e[_0x5dda('0x32')]]['transferuniqueid']=agents[_0x49468e[_0x5dda('0x32')]][_0x5dda('0x6')];}}catch(_0x8dd1d5){utils[_0x5dda('0x1c')](_0x8dd1d5['stack']);}};exports[_0x5dda('0x37')]=function(_0xfbc0b5){try{if(_0xfbc0b5[_0x5dda('0x38')]==_0xfbc0b5[_0x5dda('0x39')]){if(!_[_0x5dda('0x1e')](agents[_0xfbc0b5[_0x5dda('0x3a')]])){agents[_0xfbc0b5['secondtransfereruniqueid']][_0x5dda('0x33')]=!![];agents[_0xfbc0b5[_0x5dda('0x3a')]][_0x5dda('0x34')]=_0x5dda('0x3b');agents[_0xfbc0b5[_0x5dda('0x3a')]][_0x5dda('0x36')]=_0xfbc0b5[_0x5dda('0x3c')];agents[_0xfbc0b5[_0x5dda('0x3a')]][_0x5dda('0x3d')]=_0xfbc0b5['origtransfereruniqueid'];}if(_0xfbc0b5[_0x5dda('0x3e')]&&agents[_0xfbc0b5[_0x5dda('0x3e')]]){agents[_0xfbc0b5[_0x5dda('0x3e')]]['agententerreason']=0x1;transfers[_0xfbc0b5['transfereeuniqueid']]=_[_0x5dda('0x3f')](agents[_0xfbc0b5[_0x5dda('0x3e')]]);transfers[_0xfbc0b5[_0x5dda('0x3e')]][_0x5dda('0xa')]=agents[_0xfbc0b5[_0x5dda('0x3a')]][_0x5dda('0xa')];transfers[_0xfbc0b5[_0x5dda('0x3e')]][_0x5dda('0x40')]=agents[_0xfbc0b5[_0x5dda('0x3a')]][_0x5dda('0x40')];transfers[_0xfbc0b5['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0xfbc0b5[_0x5dda('0x3e')]][_0x5dda('0x2e')]=utils[_0x5dda('0x19')]();transfers[_0xfbc0b5['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xfbc0b5[_0x5dda('0x3e')]][_0x5dda('0x41')]=0x2;}}else if(_0xfbc0b5['secondtransfereruniqueid']==_0xfbc0b5['secondtransfererlinkedid']){if(!_['isNil'](agents[_0xfbc0b5[_0x5dda('0x38')]])){agents[_0xfbc0b5['origtransfereruniqueid']][_0x5dda('0x33')]=!![];agents[_0xfbc0b5[_0x5dda('0x38')]][_0x5dda('0x34')]=_0x5dda('0x3b');agents[_0xfbc0b5[_0x5dda('0x38')]]['transferexten']=_0xfbc0b5[_0x5dda('0x42')];agents[_0xfbc0b5['origtransfereruniqueid']][_0x5dda('0x3d')]=_0xfbc0b5[_0x5dda('0x3a')];}if(_0xfbc0b5['transfertargetuniqueid']&&agents[_0xfbc0b5['transfertargetuniqueid']]){agents[_0xfbc0b5['transfertargetuniqueid']][_0x5dda('0x41')]=0x1;transfers[_0xfbc0b5['transfertargetuniqueid']]=_[_0x5dda('0x3f')](agents[_0xfbc0b5[_0x5dda('0x43')]]);transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0xa')]=agents[_0xfbc0b5['origtransfereruniqueid']][_0x5dda('0xa')];transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0x40')]=agents[_0xfbc0b5[_0x5dda('0x38')]]['calleridname'];transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0x18')]=utils['now']();transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0x2e')]=utils[_0x5dda('0x19')]();transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0x22')]=0x0;transfers[_0xfbc0b5[_0x5dda('0x43')]][_0x5dda('0x41')]=0x2;}}}catch(_0x2c19e3){utils[_0x5dda('0x1c')](_0x2c19e3['stack']);}};exports['hangup']=function(_0x5a84b0){try{if(transfers[_0x5a84b0[_0x5dda('0x6')]]){transfers[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2b')]=!![];transfers[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2c')]=utils[_0x5dda('0x19')]();transfers[_0x5a84b0['uniqueid']]['talktime']=utils['diffTime'](transfers[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2c')],transfers[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2e')]);transfers[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2f')]='agent';transfers[_0x5a84b0['uniqueid']][_0x5dda('0xc')]='complete';writeDB(transfers[_0x5a84b0[_0x5dda('0x6')]],!![]);}if(agents[_0x5a84b0[_0x5dda('0x6')]]&&agents[_0x5a84b0[_0x5dda('0x6')]]['agentconnectAt']){agents[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2b')]=!![];agents[_0x5a84b0['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x5a84b0['uniqueid']][_0x5dda('0x24')]=utils[_0x5dda('0x2d')](agents[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2c')],agents[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x2e')]);agents[_0x5a84b0['uniqueid']][_0x5dda('0x2f')]=agents[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0x33')]?_0x5dda('0x33'):'agent';agents[_0x5a84b0[_0x5dda('0x6')]][_0x5dda('0xc')]=_0x5dda('0x30');writeDB(agents[_0x5a84b0[_0x5dda('0x6')]]);}}catch(_0x1d52b9){utils[_0x5dda('0x1c')](_0x1d52b9[_0x5dda('0x1d')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d0fde81..db5c101 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 _0xa082=['calleridnum','exten','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','context','transfer','destinationchannel','answertime','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','userfield','_attended','origtransfererchannel','musiconholdstartAt','musiconholdstop','mohtime','now','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','routeid','sipcallid','newexten','application','toLowerCase','set','appdata','split','substring','lastIndexOf','includes','gotoif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed'];(function(_0x34f1d5,_0xad0957){var _0x3cad6a=function(_0x10debf){while(--_0x10debf){_0x34f1d5['push'](_0x34f1d5['shift']());}};_0x3cad6a(++_0xad0957);}(_0xa082,0x8b));var _0x2a08=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa082[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x2a08('0x0'));var util=require(_0x2a08('0x1'));var utils=require(_0x2a08('0x2'));var dispositions=[_0x2a08('0x3'),'FAILED',_0x2a08('0x4'),_0x2a08('0x3'),_0x2a08('0x3'),_0x2a08('0x3'),_0x2a08('0x5'),_0x2a08('0x6'),_0x2a08('0x4'),'FAILED',_0x2a08('0x4')];var channels={};function writeDB(_0x2e2048){utils[_0x2a08('0x7')](util[_0x2a08('0x8')](_0x2a08('0x9'),_0x2e2048[_0x2a08('0xa')],_0x2e2048[_0x2a08('0xb')],_0x2e2048[_0x2a08('0xc')],_0x2e2048[_0x2a08('0xd')],_0x2e2048[_0x2a08('0xe')],_0x2e2048[_0x2a08('0xf')],_0x2e2048[_0x2a08('0x10')],_0x2e2048['disposition']));if(_0x2e2048['accountcode']){utils[_0x2a08('0x11')](_0x2e2048[_0x2a08('0xd')])[_0x2a08('0x12')](function(_0x781933){if(_0x781933){_0x2e2048[_0x2a08('0x13')]=_0x781933['id'];}utils[_0x2a08('0x14')]('CreateVoiceCallReport',_0x2e2048);});}else{utils[_0x2a08('0x14')](_0x2a08('0x15'),_0x2e2048);}if(channels[_0x2e2048[_0x2a08('0xa')]]){delete channels[_0x2e2048[_0x2a08('0xa')]];}}exports[_0x2a08('0x16')]=function(_0xabe796){try{if(_0xabe796[_0x2a08('0xa')]==_0xabe796[_0x2a08('0x17')]&&_0xabe796['channel']!=_0x2a08('0x18')){channels[_0xabe796[_0x2a08('0xa')]]={'uniqueid':_0xabe796[_0x2a08('0xa')],'accountcode':_0xabe796[_0x2a08('0xd')],'source':_0xabe796[_0x2a08('0x19')],'destination':_0xabe796[_0x2a08('0x1a')],'destinationcontext':_0xabe796['context'],'channel':_0xabe796[_0x2a08('0xb')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2a08('0x3'),'amaflags':_0x2a08('0x1b')};}}catch(_0x26a0d2){utils[_0x2a08('0x1c')](_0x26a0d2[_0x2a08('0x1d')]);}};exports[_0x2a08('0x1e')]=function(_0x54857e){try{if(!_[_0x2a08('0x1f')](channels[_0x54857e[_0x2a08('0xa')]])&&_0x54857e[_0x2a08('0x20')]==0x6){if(_[_0x2a08('0x1f')](channels[_0x54857e['uniqueid']][_0x2a08('0x21')])){channels[_0x54857e[_0x2a08('0xa')]][_0x2a08('0x21')]=utils['now']();}}else if(!_[_0x2a08('0x1f')](channels[_0x54857e[_0x2a08('0x17')]])&&_0x54857e['channelstate']==0x6&&_0x54857e[_0x2a08('0x22')]!=_0x2a08('0x23')){channels[_0x54857e['linkedid']]['accountcode']=_0x54857e[_0x2a08('0xd')];channels[_0x54857e[_0x2a08('0x17')]][_0x2a08('0x24')]=_0x54857e['channel'];if(_['isNil'](channels[_0x54857e[_0x2a08('0x17')]][_0x2a08('0x25')])){channels[_0x54857e[_0x2a08('0x17')]][_0x2a08('0x25')]=utils['now']();}channels[_0x54857e['linkedid']]['disposition']=dispositions[_['toNumber'](_0x54857e[_0x2a08('0x20')])]||_0x2a08('0x5');}}catch(_0x1f32db){utils[_0x2a08('0x1c')](_0x1f32db[_0x2a08('0x1d')]);}};exports[_0x2a08('0x26')]=function(_0x40bbb7){try{if(!_['isNil'](channels[_0x40bbb7[_0x2a08('0xa')]])){if(_[_0x2a08('0x1f')](channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x10')])){channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x10')]=_0x40bbb7[_0x2a08('0x27')]+'\x20<'+_0x40bbb7[_0x2a08('0x19')]+'>';}channels[_0x40bbb7['uniqueid']][_0x2a08('0x28')]=utils['now']();channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x29')]=utils[_0x2a08('0x2a')](channels[_0x40bbb7['uniqueid']][_0x2a08('0x28')],channels[_0x40bbb7['uniqueid']][_0x2a08('0x2b')]);channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x2c')]=channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x25')]?utils['diffTime'](channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x28')],channels[_0x40bbb7[_0x2a08('0xa')]][_0x2a08('0x25')]):0x0;writeDB(channels[_0x40bbb7[_0x2a08('0xa')]]);}}catch(_0x35eb08){utils[_0x2a08('0x1c')](_0x35eb08[_0x2a08('0x1d')]);}};exports[_0x2a08('0x2d')]=function(_0x36b988){try{if(!_[_0x2a08('0x1f')](channels[_0x36b988[_0x2a08('0x2e')]])){if(channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0xb')]==_0x36b988[_0x2a08('0x2f')]){channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0x24')]=_0x36b988['secondtransfererchannel'];channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0x30')]=_0x2a08('0x31');}else if(channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0xb')]=_0x36b988['transfertargetchannel']){channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0x24')]=_0x36b988[_0x2a08('0x32')];channels[_0x36b988[_0x2a08('0x2e')]][_0x2a08('0x30')]='_attended';}}}catch(_0x58ea40){utils[_0x2a08('0x1c')](_0x58ea40[_0x2a08('0x1d')]);}};exports['musiconholdstart']=function(_0x5781d9){try{if(!_['isNil'](channels[_0x5781d9[_0x2a08('0xa')]])){channels[_0x5781d9['uniqueid']][_0x2a08('0x33')]=utils['now']();}}catch(_0x2cf29a){utils[_0x2a08('0x1c')](_0x2cf29a['stack']);}};exports[_0x2a08('0x34')]=function(_0x1ae3ad){try{if(!_[_0x2a08('0x1f')](channels[_0x1ae3ad['uniqueid']])){if(!_[_0x2a08('0x1f')](channels[_0x1ae3ad[_0x2a08('0xa')]][_0x2a08('0x33')])){channels[_0x1ae3ad[_0x2a08('0xa')]][_0x2a08('0x35')]+=utils[_0x2a08('0x2a')](utils[_0x2a08('0x36')](),channels[_0x1ae3ad[_0x2a08('0xa')]][_0x2a08('0x33')]);delete channels[_0x1ae3ad[_0x2a08('0xa')]][_0x2a08('0x33')];}}}catch(_0x461467){utils[_0x2a08('0x1c')](_0x461467[_0x2a08('0x1d')]);}};exports['varset']=function(_0x4bc121){try{if(!_[_0x2a08('0x1f')](channels[_0x4bc121[_0x2a08('0xa')]])){if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')]['xmd-originatecalleridnum'])){channels[_0x4bc121[_0x2a08('0xa')]][_0x2a08('0xe')]=_0x4bc121[_0x2a08('0x38')];}if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x39')])){channels[_0x4bc121['uniqueid']]['destination']=_0x4bc121[_0x2a08('0x38')];channels[_0x4bc121[_0x2a08('0xa')]][_0x2a08('0x10')]='\x22'+_0x4bc121[_0x2a08('0x38')]+_0x2a08('0x3a')+_0x4bc121[_0x2a08('0x38')]+'>';}if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x3b')])||!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x3c')])){channels[_0x4bc121[_0x2a08('0xa')]]['callerid']=_0x4bc121[_0x2a08('0x38')];}if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x3d')])||!_['isNil'](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x3e')])){channels[_0x4bc121[_0x2a08('0xa')]]['lastapplication']=_0x2a08('0x3f');channels[_0x4bc121['uniqueid']][_0x2a08('0x40')]=_0x4bc121[_0x2a08('0x38')];channels[_0x4bc121[_0x2a08('0xa')]][_0x2a08('0x41')]=!![];}if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')][_0x2a08('0x42')])){channels[_0x4bc121['uniqueid']][_0x2a08('0x43')]=_0x4bc121[_0x2a08('0x38')];}if(!_['isNil'](_0x4bc121['variable'][_0x2a08('0x44')])){channels[_0x4bc121[_0x2a08('0xa')]]['type']=_0x4bc121[_0x2a08('0x38')];}if(!_['isNil'](_0x4bc121[_0x2a08('0x37')]['outboundrouteid'])){channels[_0x4bc121[_0x2a08('0xa')]][_0x2a08('0x45')]=_0x4bc121[_0x2a08('0x38')];}if(!_[_0x2a08('0x1f')](_0x4bc121[_0x2a08('0x37')]['sipcallid'])){channels[_0x4bc121[_0x2a08('0xa')]][_0x2a08('0x46')]=_0x4bc121['value'];}}}catch(_0xf07c02){utils['error'](_0xf07c02[_0x2a08('0x1d')]);}};exports[_0x2a08('0x47')]=function(_0x5accf2){try{if(!_['isNil'](channels[_0x5accf2['uniqueid']])){if(_0x5accf2[_0x2a08('0x48')][_0x2a08('0x49')]()==_0x2a08('0x4a')&&_['startsWith'](_0x5accf2[_0x2a08('0x4b')][_0x2a08('0x49')](),'cdr')){var _0x565b09=_0x5accf2['appdata'][_0x2a08('0x4c')]('=');var _0x299ee4=_0x565b09[0x0][_0x2a08('0x4d')](_0x565b09[0x0][_0x2a08('0x4e')]('(')+0x1,_0x565b09[0x0][_0x2a08('0x4e')](')'));var _0x33d78f=_0x565b09[0x1];channels[_0x5accf2[_0x2a08('0xa')]][_0x299ee4]=_0x33d78f;}if(!_[_0x2a08('0x4f')](['hangup','noop','execif','set',_0x2a08('0x50')],_0x5accf2['application'][_0x2a08('0x49')]())){channels[_0x5accf2[_0x2a08('0xa')]][_0x2a08('0x51')]=_0x5accf2[_0x2a08('0x48')];channels[_0x5accf2[_0x2a08('0xa')]][_0x2a08('0x40')]=_0x5accf2[_0x2a08('0x4b')];}}}catch(_0x1d9c4b){utils['error'](_0x1d9c4b[_0x2a08('0x1d')]);}}; \ No newline at end of file +var _0x850f=['musiconholdstop','varset','xmd-originatecalleridnum','value','variable','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','xmd-contactid','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','hangup','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','format','accountcode','source','destination','callerid','disposition','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','channel','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','error','channelstate','systemanswertime','isNil','transfer','destinationchannel','answertime','toNumber','stack','calleridname','calleridnum','endtime','duration','diffTime','starttime','attendedtransfer','secondtransfererchannel','localtwolinkedid','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x850f,0x164));var _0xf850=function(_0x45817a,_0x5ca981){_0x45817a=_0x45817a-0x0;var _0x2bfad3=_0x850f[_0x45817a];return _0x2bfad3;};'use strict';var _=require(_0xf850('0x0'));var util=require(_0xf850('0x1'));var utils=require(_0xf850('0x2'));var dispositions=[_0xf850('0x3'),'FAILED',_0xf850('0x4'),_0xf850('0x3'),_0xf850('0x3'),_0xf850('0x3'),'ANSWERED',_0xf850('0x5'),_0xf850('0x4'),_0xf850('0x4'),_0xf850('0x4')];var channels={};function writeDB(_0x44aa53){utils['info'](util[_0xf850('0x6')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x44aa53['uniqueid'],_0x44aa53['channel'],_0x44aa53['type'],_0x44aa53[_0xf850('0x7')],_0x44aa53[_0xf850('0x8')],_0x44aa53[_0xf850('0x9')],_0x44aa53[_0xf850('0xa')],_0x44aa53[_0xf850('0xb')]));if(_0x44aa53['accountcode']){utils['getUserByInternal'](_0x44aa53['accountcode'])[_0xf850('0xc')](function(_0x435833){if(_0x435833){_0x44aa53[_0xf850('0xd')]=_0x435833['id'];}utils[_0xf850('0xe')](_0xf850('0xf'),_0x44aa53);});}else{utils[_0xf850('0xe')](_0xf850('0xf'),_0x44aa53);}if(channels[_0x44aa53[_0xf850('0x10')]]){delete channels[_0x44aa53[_0xf850('0x10')]];}}exports[_0xf850('0x11')]=function(_0x5d8dd3){try{if(_0x5d8dd3[_0xf850('0x10')]==_0x5d8dd3[_0xf850('0x12')]&&_0x5d8dd3[_0xf850('0x13')]!=_0xf850('0x14')){channels[_0x5d8dd3[_0xf850('0x10')]]={'uniqueid':_0x5d8dd3['uniqueid'],'accountcode':_0x5d8dd3[_0xf850('0x7')],'source':_0x5d8dd3['calleridnum'],'destination':_0x5d8dd3[_0xf850('0x15')],'destinationcontext':_0x5d8dd3[_0xf850('0x16')],'channel':_0x5d8dd3['channel'],'starttime':utils[_0xf850('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf850('0x3'),'amaflags':_0xf850('0x18')};}}catch(_0x17420d){utils[_0xf850('0x19')](_0x17420d['stack']);}};exports['newstate']=function(_0x146c80){try{if(!_['isNil'](channels[_0x146c80['uniqueid']])&&_0x146c80[_0xf850('0x1a')]==0x6){if(_['isNil'](channels[_0x146c80['uniqueid']][_0xf850('0x1b')])){channels[_0x146c80['uniqueid']][_0xf850('0x1b')]=utils[_0xf850('0x17')]();}}else if(!_[_0xf850('0x1c')](channels[_0x146c80[_0xf850('0x12')]])&&_0x146c80[_0xf850('0x1a')]==0x6&&_0x146c80[_0xf850('0x16')]!=_0xf850('0x1d')){channels[_0x146c80[_0xf850('0x12')]][_0xf850('0x7')]=_0x146c80[_0xf850('0x7')];channels[_0x146c80[_0xf850('0x12')]][_0xf850('0x1e')]=_0x146c80[_0xf850('0x13')];if(_[_0xf850('0x1c')](channels[_0x146c80[_0xf850('0x12')]][_0xf850('0x1f')])){channels[_0x146c80[_0xf850('0x12')]][_0xf850('0x1f')]=utils[_0xf850('0x17')]();}channels[_0x146c80[_0xf850('0x12')]][_0xf850('0xb')]=dispositions[_[_0xf850('0x20')](_0x146c80['channelstate'])]||'ANSWERED';}}catch(_0x59217a){utils[_0xf850('0x19')](_0x59217a[_0xf850('0x21')]);}};exports['hangup']=function(_0x194ab7){try{if(!_[_0xf850('0x1c')](channels[_0x194ab7[_0xf850('0x10')]])){if(_[_0xf850('0x1c')](channels[_0x194ab7[_0xf850('0x10')]][_0xf850('0xa')])){channels[_0x194ab7[_0xf850('0x10')]][_0xf850('0xa')]=_0x194ab7[_0xf850('0x22')]+'\x20<'+_0x194ab7[_0xf850('0x23')]+'>';}channels[_0x194ab7[_0xf850('0x10')]][_0xf850('0x24')]=utils[_0xf850('0x17')]();channels[_0x194ab7[_0xf850('0x10')]][_0xf850('0x25')]=utils[_0xf850('0x26')](channels[_0x194ab7[_0xf850('0x10')]]['endtime'],channels[_0x194ab7[_0xf850('0x10')]][_0xf850('0x27')]);channels[_0x194ab7[_0xf850('0x10')]]['billableseconds']=channels[_0x194ab7['uniqueid']][_0xf850('0x1f')]?utils['diffTime'](channels[_0x194ab7['uniqueid']][_0xf850('0x24')],channels[_0x194ab7['uniqueid']][_0xf850('0x1f')]):0x0;writeDB(channels[_0x194ab7[_0xf850('0x10')]]);}}catch(_0x2cfddb){utils[_0xf850('0x19')](_0x2cfddb[_0xf850('0x21')]);}};exports[_0xf850('0x28')]=function(_0x2b95af){try{if(!_['isNil'](channels[_0x2b95af['localtwolinkedid']])){if(channels[_0x2b95af['localtwolinkedid']][_0xf850('0x13')]==_0x2b95af['transfereechannel']){channels[_0x2b95af['localtwolinkedid']][_0xf850('0x1e')]=_0x2b95af[_0xf850('0x29')];channels[_0x2b95af[_0xf850('0x2a')]][_0xf850('0x2b')]=_0xf850('0x2c');}else if(channels[_0x2b95af['localtwolinkedid']][_0xf850('0x13')]=_0x2b95af[_0xf850('0x2d')]){channels[_0x2b95af[_0xf850('0x2a')]]['destinationchannel']=_0x2b95af[_0xf850('0x2e')];channels[_0x2b95af[_0xf850('0x2a')]]['userfield']=_0xf850('0x2c');}}}catch(_0x3505ee){utils[_0xf850('0x19')](_0x3505ee[_0xf850('0x21')]);}};exports[_0xf850('0x2f')]=function(_0x4fd892){try{if(!_['isNil'](channels[_0x4fd892['uniqueid']])){channels[_0x4fd892[_0xf850('0x10')]][_0xf850('0x30')]=utils[_0xf850('0x17')]();}}catch(_0x3bfd7b){utils['error'](_0x3bfd7b[_0xf850('0x21')]);}};exports[_0xf850('0x31')]=function(_0x65b6fa){try{if(!_['isNil'](channels[_0x65b6fa['uniqueid']])){if(!_[_0xf850('0x1c')](channels[_0x65b6fa['uniqueid']][_0xf850('0x30')])){channels[_0x65b6fa[_0xf850('0x10')]]['mohtime']+=utils[_0xf850('0x26')](utils[_0xf850('0x17')](),channels[_0x65b6fa[_0xf850('0x10')]]['musiconholdstartAt']);delete channels[_0x65b6fa['uniqueid']][_0xf850('0x30')];}}}catch(_0x52124d){utils[_0xf850('0x19')](_0x52124d[_0xf850('0x21')]);}};exports[_0xf850('0x32')]=function(_0x285e7d){try{if(!_['isNil'](channels[_0x285e7d[_0xf850('0x10')]])){if(!_['isNil'](_0x285e7d['variable'][_0xf850('0x33')])){channels[_0x285e7d['uniqueid']]['source']=_0x285e7d[_0xf850('0x34')];}if(!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x36')])){channels[_0x285e7d['uniqueid']][_0xf850('0x9')]=_0x285e7d[_0xf850('0x34')];channels[_0x285e7d[_0xf850('0x10')]][_0xf850('0xa')]='\x22'+_0x285e7d[_0xf850('0x34')]+_0xf850('0x37')+_0x285e7d[_0xf850('0x34')]+'>';}if(!_[_0xf850('0x1c')](_0x285e7d['variable'][_0xf850('0x38')])||!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x39')])){channels[_0x285e7d[_0xf850('0x10')]][_0xf850('0xa')]=_0x285e7d[_0xf850('0x34')];}if(!_['isNil'](_0x285e7d[_0xf850('0x35')][_0xf850('0x3a')])||!_[_0xf850('0x1c')](_0x285e7d['variable']['xmcs-queue'])){channels[_0x285e7d['uniqueid']][_0xf850('0x3b')]=_0xf850('0x3c');channels[_0x285e7d[_0xf850('0x10')]]['lastdata']=_0x285e7d['value'];channels[_0x285e7d[_0xf850('0x10')]]['queue']=!![];}if(!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x3d')])){channels[_0x285e7d['uniqueid']]['ContactId']=_0x285e7d[_0xf850('0x34')];}if(!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x3e')])){channels[_0x285e7d[_0xf850('0x10')]][_0xf850('0x3f')]=_0x285e7d['value'];}if(!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x40')])){channels[_0x285e7d[_0xf850('0x10')]][_0xf850('0x41')]=_0x285e7d[_0xf850('0x34')];}if(!_[_0xf850('0x1c')](_0x285e7d[_0xf850('0x35')][_0xf850('0x42')])){channels[_0x285e7d['uniqueid']]['sipcallid']=_0x285e7d[_0xf850('0x34')];}}}catch(_0x19baee){utils[_0xf850('0x19')](_0x19baee['stack']);}};exports[_0xf850('0x43')]=function(_0x51f753){try{if(!_[_0xf850('0x1c')](channels[_0x51f753[_0xf850('0x10')]])){if(_0x51f753[_0xf850('0x44')][_0xf850('0x45')]()==_0xf850('0x46')&&_[_0xf850('0x47')](_0x51f753[_0xf850('0x48')][_0xf850('0x45')](),_0xf850('0x49'))){var _0x4d889e=_0x51f753[_0xf850('0x48')][_0xf850('0x4a')]('=');var _0x5ed50d=_0x4d889e[0x0][_0xf850('0x4b')](_0x4d889e[0x0][_0xf850('0x4c')]('(')+0x1,_0x4d889e[0x0][_0xf850('0x4c')](')'));var _0x729505=_0x4d889e[0x1];channels[_0x51f753[_0xf850('0x10')]][_0x5ed50d]=_0x729505;}if(!_[_0xf850('0x4d')]([_0xf850('0x4e'),'noop','execif','set',_0xf850('0x4f')],_0x51f753[_0xf850('0x44')][_0xf850('0x45')]())){channels[_0x51f753['uniqueid']]['lastapplication']=_0x51f753[_0xf850('0x44')];channels[_0x51f753[_0xf850('0x10')]][_0xf850('0x50')]=_0x51f753['appdata'];}}}catch(_0x4efa93){utils[_0xf850('0x19')](_0x4efa93[_0xf850('0x21')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6c2d5cc..011426c 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 _0xf2ca=['CLOSE','managerevent','./utils','lodash','connect','CONNECTED','shutdown','info','SHUTDOWN','fullybooted','error','close'];(function(_0x36d035,_0x387d3b){var _0x5528f9=function(_0x2c39a5){while(--_0x2c39a5){_0x36d035['push'](_0x36d035['shift']());}};_0x5528f9(++_0x387d3b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2a6fd5,_0x3d6deb){_0x2a6fd5=_0x2a6fd5-0x0;var _0x43c6a4=_0xf2ca[_0x2a6fd5];return _0x43c6a4;};'use strict';var utils=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));exports[_0xaf2c('0x2')]=function(){utils['info'](_0xaf2c('0x3'));};exports[_0xaf2c('0x4')]=function(){utils[_0xaf2c('0x5')](_0xaf2c('0x6'));};exports[_0xaf2c('0x7')]=function(){utils[_0xaf2c('0x5')]('FULLYBOOTED');};exports[_0xaf2c('0x8')]=function(_0x100d17){utils[_0xaf2c('0x8')](_0x100d17);};exports[_0xaf2c('0x9')]=function(){utils['info'](_0xaf2c('0xa'));};exports[_0xaf2c('0xb')]=function(_0x4a7397){}; \ No newline at end of file +var _0xce50=['CLOSE','managerevent','lodash','connect','info','CONNECTED','shutdown','fullybooted','error','close'];(function(_0x56b390,_0x3de8d9){var _0x3650a3=function(_0x4172b0){while(--_0x4172b0){_0x56b390['push'](_0x56b390['shift']());}};_0x3650a3(++_0x3de8d9);}(_0xce50,0x1d8));var _0x0ce5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xce50[_0x24f31b];return _0x488401;};'use strict';var utils=require('./utils');var _=require(_0x0ce5('0x0'));exports[_0x0ce5('0x1')]=function(){utils[_0x0ce5('0x2')](_0x0ce5('0x3'));};exports[_0x0ce5('0x4')]=function(){utils['info']('SHUTDOWN');};exports[_0x0ce5('0x5')]=function(){utils['info']('FULLYBOOTED');};exports[_0x0ce5('0x6')]=function(_0x42fadd){utils[_0x0ce5('0x6')](_0x42fadd);};exports[_0x0ce5('0x7')]=function(){utils['info'](_0x0ce5('0x8'));};exports[_0x0ce5('0x9')]=function(_0x4d9a49){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 74a47db..6af5bb9 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 _0x3163=['answertime','hangup','diffTime','holdtime','endtime','billableseconds','lodash','util','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','varset','outboundrouteid','isNil','assign','starttime','now','lastevent','called'];(function(_0x585072,_0x2505c8){var _0x1acf5b=function(_0x3b42e9){while(--_0x3b42e9){_0x585072['push'](_0x585072['shift']());}};_0x1acf5b(++_0x2505c8);}(_0x3163,0x6c));var _0x3316=function(_0xd25f35,_0x5eb2d5){_0xd25f35=_0xd25f35-0x0;var _0x116b1b=_0x3163[_0xd25f35];return _0x116b1b;};'use strict';var _=require(_0x3316('0x0'));var util=require(_0x3316('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x49c471){utils['info'](util[_0x3316('0x2')](_0x3316('0x3'),_0x49c471[_0x3316('0x4')],_0x49c471[_0x3316('0x5')],_0x49c471[_0x3316('0x6')],_0x49c471[_0x3316('0x7')],_0x49c471[_0x3316('0x8')],_0x49c471[_0x3316('0x9')]));utils['request'](_0x3316('0xa'),_0x49c471);delete dials[_0x49c471['uniqueid']];}exports[_0x3316('0xb')]=function(_0x36aaf0){try{if(_0x36aaf0['application'][_0x3316('0xc')]()==_0x3316('0xd')&&_[_0x3316('0xe')](_0x36aaf0[_0x3316('0xf')]['toLowerCase'](),_0x3316('0x10'))){var _0x22e75b=_0x36aaf0[_0x3316('0xf')][_0x3316('0x11')]('=');dials[_0x36aaf0[_0x3316('0x4')]]={'routeId':_0x22e75b[0x1]};}}catch(_0x548ce8){utils[_0x3316('0x12')](_0x548ce8[_0x3316('0x13')]);}};exports[_0x3316('0x14')]=function(_0x176664){try{if(!_['isNil'](_0x176664['variable'][_0x3316('0x15')])){dials[_0x176664[_0x3316('0x4')]]={'routeId':_0x176664['value']};}}catch(_0x356e94){utils[_0x3316('0x12')](_0x356e94[_0x3316('0x13')]);}};exports['dialbegin']=function(_0x72e722){try{if(!_[_0x3316('0x16')](dials[_0x72e722[_0x3316('0x4')]])){dials[_0x72e722[_0x3316('0x4')]]=_[_0x3316('0x17')](dials[_0x72e722[_0x3316('0x4')]],_0x72e722);dials[_0x72e722[_0x3316('0x4')]][_0x3316('0x18')]=utils[_0x3316('0x19')]();dials[_0x72e722[_0x3316('0x4')]][_0x3316('0x1a')]=_0x3316('0x1b');}}catch(_0x1ef86d){utils[_0x3316('0x12')](_0x1ef86d[_0x3316('0x13')]);}};exports['dialend']=function(_0x2f7c1a){try{if(!_['isNil'](dials[_0x2f7c1a[_0x3316('0x4')]])){dials[_0x2f7c1a[_0x3316('0x4')]]['dialstatus']=_0x2f7c1a[_0x3316('0x9')];if(_0x2f7c1a['dialstatus']=='ANSWER'){dials[_0x2f7c1a[_0x3316('0x4')]]=_[_0x3316('0x17')](dials[_0x2f7c1a[_0x3316('0x4')]],_0x2f7c1a);dials[_0x2f7c1a[_0x3316('0x4')]][_0x3316('0x1c')]=utils[_0x3316('0x19')]();dials[_0x2f7c1a[_0x3316('0x4')]][_0x3316('0x1a')]='connect';}}}catch(_0x12b9f5){utils['error'](_0x12b9f5['stack']);}};exports[_0x3316('0x1d')]=function(_0x166e9c){try{if(!_['isNil'](dials[_0x166e9c[_0x3316('0x4')]])){dials[_0x166e9c['uniqueid']]=_[_0x3316('0x17')](dials[_0x166e9c[_0x3316('0x4')]],{'endtime':utils[_0x3316('0x19')](),'lastevent':'complete'});dials[_0x166e9c['uniqueid']]['duration']=utils[_0x3316('0x1e')](dials[_0x166e9c[_0x3316('0x4')]]['endtime'],dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x18')]);dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x1f')]=utils['diffTime'](dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x1c')]||dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x20')],dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x18')]);dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x21')]=dials[_0x166e9c['uniqueid']][_0x3316('0x1c')]?utils[_0x3316('0x1e')](dials[_0x166e9c[_0x3316('0x4')]]['endtime'],dials[_0x166e9c[_0x3316('0x4')]][_0x3316('0x1c')]):0x0;writeDB(dials[_0x166e9c[_0x3316('0x4')]]);}}catch(_0x57a56f){utils[_0x3316('0x12')](_0x57a56f[_0x3316('0x13')]);}}; \ No newline at end of file +var _0x6ffb=['now','called','dialend','ANSWER','assign','lastevent','connect','hangup','complete','diffTime','holdtime','endtime','billableseconds','answertime','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','varset','variable','outboundrouteid','value','isNil','starttime'];(function(_0x3ca269,_0x12efee){var _0x561e21=function(_0xd0090){while(--_0xd0090){_0x3ca269['push'](_0x3ca269['shift']());}};_0x561e21(++_0x12efee);}(_0x6ffb,0x156));var _0xb6ff=function(_0x4a506c,_0x311430){_0x4a506c=_0x4a506c-0x0;var _0x5a667e=_0x6ffb[_0x4a506c];return _0x5a667e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xb6ff('0x0'));var dials={};function writeDB(_0x28d8fd){utils[_0xb6ff('0x1')](util[_0xb6ff('0x2')](_0xb6ff('0x3'),_0x28d8fd[_0xb6ff('0x4')],_0x28d8fd[_0xb6ff('0x5')],_0x28d8fd[_0xb6ff('0x6')],_0x28d8fd[_0xb6ff('0x7')],_0x28d8fd[_0xb6ff('0x8')],_0x28d8fd[_0xb6ff('0x9')]));utils[_0xb6ff('0xa')]('CreateVoiceDialReport',_0x28d8fd);delete dials[_0x28d8fd[_0xb6ff('0x4')]];}exports[_0xb6ff('0xb')]=function(_0x577bd6){try{if(_0x577bd6[_0xb6ff('0xc')][_0xb6ff('0xd')]()==_0xb6ff('0xe')&&_[_0xb6ff('0xf')](_0x577bd6[_0xb6ff('0x10')][_0xb6ff('0xd')](),_0xb6ff('0x11'))){var _0xcfb5c=_0x577bd6['appdata'][_0xb6ff('0x12')]('=');dials[_0x577bd6[_0xb6ff('0x4')]]={'routeId':_0xcfb5c[0x1]};}}catch(_0x48f5c0){utils[_0xb6ff('0x13')](_0x48f5c0[_0xb6ff('0x14')]);}};exports[_0xb6ff('0x15')]=function(_0x14ed96){try{if(!_['isNil'](_0x14ed96[_0xb6ff('0x16')][_0xb6ff('0x17')])){dials[_0x14ed96[_0xb6ff('0x4')]]={'routeId':_0x14ed96[_0xb6ff('0x18')]};}}catch(_0x1d19b9){utils[_0xb6ff('0x13')](_0x1d19b9[_0xb6ff('0x14')]);}};exports['dialbegin']=function(_0x4fd988){try{if(!_[_0xb6ff('0x19')](dials[_0x4fd988[_0xb6ff('0x4')]])){dials[_0x4fd988[_0xb6ff('0x4')]]=_['assign'](dials[_0x4fd988['uniqueid']],_0x4fd988);dials[_0x4fd988[_0xb6ff('0x4')]][_0xb6ff('0x1a')]=utils[_0xb6ff('0x1b')]();dials[_0x4fd988[_0xb6ff('0x4')]]['lastevent']=_0xb6ff('0x1c');}}catch(_0x5a09dd){utils[_0xb6ff('0x13')](_0x5a09dd[_0xb6ff('0x14')]);}};exports[_0xb6ff('0x1d')]=function(_0x55d01e){try{if(!_[_0xb6ff('0x19')](dials[_0x55d01e['uniqueid']])){dials[_0x55d01e[_0xb6ff('0x4')]][_0xb6ff('0x9')]=_0x55d01e['dialstatus'];if(_0x55d01e[_0xb6ff('0x9')]==_0xb6ff('0x1e')){dials[_0x55d01e[_0xb6ff('0x4')]]=_[_0xb6ff('0x1f')](dials[_0x55d01e[_0xb6ff('0x4')]],_0x55d01e);dials[_0x55d01e['uniqueid']]['answertime']=utils[_0xb6ff('0x1b')]();dials[_0x55d01e['uniqueid']][_0xb6ff('0x20')]=_0xb6ff('0x21');}}}catch(_0x1d8518){utils[_0xb6ff('0x13')](_0x1d8518['stack']);}};exports[_0xb6ff('0x22')]=function(_0x3e7e8d){try{if(!_[_0xb6ff('0x19')](dials[_0x3e7e8d[_0xb6ff('0x4')]])){dials[_0x3e7e8d['uniqueid']]=_[_0xb6ff('0x1f')](dials[_0x3e7e8d[_0xb6ff('0x4')]],{'endtime':utils[_0xb6ff('0x1b')](),'lastevent':_0xb6ff('0x23')});dials[_0x3e7e8d[_0xb6ff('0x4')]]['duration']=utils[_0xb6ff('0x24')](dials[_0x3e7e8d[_0xb6ff('0x4')]]['endtime'],dials[_0x3e7e8d[_0xb6ff('0x4')]][_0xb6ff('0x1a')]);dials[_0x3e7e8d[_0xb6ff('0x4')]][_0xb6ff('0x25')]=utils['diffTime'](dials[_0x3e7e8d['uniqueid']]['answertime']||dials[_0x3e7e8d['uniqueid']][_0xb6ff('0x26')],dials[_0x3e7e8d[_0xb6ff('0x4')]]['starttime']);dials[_0x3e7e8d[_0xb6ff('0x4')]][_0xb6ff('0x27')]=dials[_0x3e7e8d['uniqueid']][_0xb6ff('0x28')]?utils[_0xb6ff('0x24')](dials[_0x3e7e8d[_0xb6ff('0x4')]][_0xb6ff('0x26')],dials[_0x3e7e8d['uniqueid']]['answertime']):0x0;writeDB(dials[_0x3e7e8d[_0xb6ff('0x4')]]);}}catch(_0x341f48){utils['error'](_0x341f48[_0xb6ff('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 534e18f..a473390 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 _0x7227=['blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr'];(function(_0x34b71e,_0x58f44d){var _0x2cb29b=function(_0x49282a){while(--_0x49282a){_0x34b71e['push'](_0x34b71e['shift']());}};_0x2cb29b(++_0x58f44d);}(_0x7227,0xe3));var _0x7722=function(_0x4b281d,_0x17ec63){_0x4b281d=_0x4b281d-0x0;var _0x103c12=_0x7227[_0x4b281d];return _0x103c12;};var AsteriskManager=require('asterisk-manager');var config=require(_0x7722('0x0'));var utils=require(_0x7722('0x1'));var ami=new AsteriskManager(config[_0x7722('0x2')][_0x7722('0x3')],config[_0x7722('0x2')]['ip'],config['asterisk'][_0x7722('0x4')],config[_0x7722('0x2')][_0x7722('0x5')],!![]);ami[_0x7722('0x6')]();if(config[_0x7722('0x7')]&&config[_0x7722('0x7')][_0x7722('0x8')]){utils[_0x7722('0x9')](_0x7722('0xa'));}else{var agents=require(_0x7722('0xb'));var calls=require(_0x7722('0xc'));var queues=require(_0x7722('0xd'));var recordings=require(_0x7722('0xe'));var members=require(_0x7722('0xf'));var dials=require(_0x7722('0x10'));var transfers=require(_0x7722('0x11'));var core=require(_0x7722('0x12'));ami['on'](_0x7722('0x13'),core['connect']);ami['on'](_0x7722('0x14'),core['shutdown']);ami['on'](_0x7722('0x15'),core[_0x7722('0x15')]);ami['on'](_0x7722('0x16'),core[_0x7722('0x16')]);ami['on']('close',core['close']);ami['on'](_0x7722('0x17'),core[_0x7722('0x17')]);ami['on'](_0x7722('0x18'),function(_0x56fbe6){try{members['devicestatechange'](_0x56fbe6);}catch(_0x5cdd25){utils[_0x7722('0x16')](_0x5cdd25);}});ami['on'](_0x7722('0x19'),function(_0x347bbf){try{agents[_0x7722('0x19')](_0x347bbf);}catch(_0x29a952){utils[_0x7722('0x16')](_0x29a952);}});ami['on']('agentringnoanswer',function(_0x5bd67e){try{agents[_0x7722('0x1a')](_0x5bd67e);}catch(_0x33c541){utils[_0x7722('0x16')](_0x33c541);}});ami['on'](_0x7722('0x1b'),function(_0xae5969){try{agents[_0x7722('0x1b')](_0xae5969);queues[_0x7722('0x1b')](_0xae5969);}catch(_0x290e6a){utils[_0x7722('0x16')](_0x290e6a);}});ami['on']('agentcomplete',function(_0x29e3a8){try{agents[_0x7722('0x1c')](_0x29e3a8);queues[_0x7722('0x1c')](_0x29e3a8);members[_0x7722('0x1c')](_0x29e3a8);}catch(_0x35edbd){utils['error'](_0x35edbd);}});ami['on'](_0x7722('0x1d'),function(_0xa88cd5){try{agents[_0x7722('0x1d')](_0xa88cd5);queues[_0x7722('0x1d')](_0xa88cd5);}catch(_0x8c30c7){utils['error'](_0x8c30c7);}});ami['on'](_0x7722('0x1e'),function(_0x4b8851){try{queues[_0x7722('0x1e')](_0x4b8851);recordings['queuecallerjoin'](_0x4b8851);}catch(_0x38d896){utils['error'](_0x38d896);}});ami['on']('queuecallerleave',function(_0x3816da){try{queues[_0x7722('0x1f')](_0x3816da);}catch(_0x247dc2){utils[_0x7722('0x16')](_0x247dc2);}});ami['on'](_0x7722('0x20'),function(_0x12979d){try{queues[_0x7722('0x20')](_0x12979d);calls[_0x7722('0x20')](_0x12979d);}catch(_0x24134f){utils[_0x7722('0x16')](_0x24134f);}});ami['on']('musiconholdstop',function(_0x701011){try{queues[_0x7722('0x21')](_0x701011);calls[_0x7722('0x21')](_0x701011);}catch(_0xa60b90){utils[_0x7722('0x16')](_0xa60b90);}});ami['on'](_0x7722('0x22'),function(_0x490e60){try{calls[_0x7722('0x22')](_0x490e60);recordings[_0x7722('0x22')](_0x490e60);}catch(_0x4f1499){utils[_0x7722('0x16')](_0x4f1499);}});ami['on']('hangup',function(_0x3721c5){try{calls[_0x7722('0x23')](_0x3721c5);recordings[_0x7722('0x23')](_0x3721c5);dials[_0x7722('0x23')](_0x3721c5);agents[_0x7722('0x23')](_0x3721c5);queues[_0x7722('0x23')](_0x3721c5);}catch(_0x5ec9f9){utils['error'](_0x5ec9f9);}});ami['on'](_0x7722('0x24'),function(_0x7ce947){try{members[_0x7722('0x24')](_0x7ce947);}catch(_0x58a737){utils[_0x7722('0x16')](_0x58a737);}});ami['on']('blindtransfer',function(_0x5af387){try{queues['blindtransfer'](_0x5af387);agents[_0x7722('0x25')](_0x5af387);transfers[_0x7722('0x25')](_0x5af387);}catch(_0x1e9048){utils[_0x7722('0x16')](_0x1e9048);}});ami['on'](_0x7722('0x26'),function(_0x163c83){try{queues['attendedtransfer'](_0x163c83);transfers[_0x7722('0x26')](_0x163c83);agents[_0x7722('0x26')](_0x163c83);calls['attendedtransfer'](_0x163c83);}catch(_0x5715d0){utils[_0x7722('0x16')](_0x5715d0);}});ami['on'](_0x7722('0x27'),function(_0x33b924){try{queues[_0x7722('0x27')](_0x33b924);recordings[_0x7722('0x27')](_0x33b924);calls['varset'](_0x33b924);dials[_0x7722('0x27')](_0x33b924);}catch(_0x3eeab4){utils[_0x7722('0x16')](_0x3eeab4);}});ami['on'](_0x7722('0x28'),function(_0x4e6aa9){try{calls[_0x7722('0x28')](_0x4e6aa9);recordings[_0x7722('0x28')](_0x4e6aa9);dials[_0x7722('0x28')](_0x4e6aa9);}catch(_0x746dcc){utils[_0x7722('0x16')](_0x746dcc);}});ami['on'](_0x7722('0x29'),function(_0x1f7710){try{calls[_0x7722('0x29')](_0x1f7710);recordings[_0x7722('0x29')](_0x1f7710);}catch(_0x381231){utils[_0x7722('0x16')](_0x381231);}});ami['on'](_0x7722('0x2a'),function(_0x19dab9){try{dials[_0x7722('0x2a')](_0x19dab9);}catch(_0x1c51e8){utils['error'](_0x1c51e8);}});ami['on']('dialend',function(_0x52410d){try{dials[_0x7722('0x2b')](_0x52410d);}catch(_0xea6bc){utils['error'](_0xea6bc);}});} \ No newline at end of file +var _0x2e68=['disabled','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','username','password','xdr'];(function(_0x30694c,_0x810cd8){var _0x22c27c=function(_0x28fad6){while(--_0x28fad6){_0x30694c['push'](_0x30694c['shift']());}};_0x22c27c(++_0x810cd8);}(_0x2e68,0x129));var _0x82e6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2e68[_0x5b644e];return _0x49c6bf;};var AsteriskManager=require(_0x82e6('0x0'));var config=require(_0x82e6('0x1'));var utils=require(_0x82e6('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0x82e6('0x3')][_0x82e6('0x4')],config[_0x82e6('0x3')][_0x82e6('0x5')],!![]);ami['keepConnected']();if(config[_0x82e6('0x6')]&&config[_0x82e6('0x6')][_0x82e6('0x7')]){utils[_0x82e6('0x8')](_0x82e6('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0x82e6('0xa'));var queues=require('./queues.controller');var recordings=require(_0x82e6('0xb'));var members=require('./members.controller');var dials=require(_0x82e6('0xc'));var transfers=require('./transfers.controller');var core=require(_0x82e6('0xd'));ami['on'](_0x82e6('0xe'),core[_0x82e6('0xe')]);ami['on'](_0x82e6('0xf'),core[_0x82e6('0xf')]);ami['on'](_0x82e6('0x10'),core[_0x82e6('0x10')]);ami['on'](_0x82e6('0x11'),core['error']);ami['on'](_0x82e6('0x12'),core[_0x82e6('0x12')]);ami['on'](_0x82e6('0x13'),core['managerevent']);ami['on'](_0x82e6('0x14'),function(_0x152b17){try{members['devicestatechange'](_0x152b17);}catch(_0x1273e1){utils[_0x82e6('0x11')](_0x1273e1);}});ami['on']('agentcalled',function(_0x54f3c5){try{agents['agentcalled'](_0x54f3c5);}catch(_0x4c6111){utils[_0x82e6('0x11')](_0x4c6111);}});ami['on']('agentringnoanswer',function(_0xbad1f9){try{agents[_0x82e6('0x15')](_0xbad1f9);}catch(_0xf43b8){utils[_0x82e6('0x11')](_0xf43b8);}});ami['on']('agentconnect',function(_0x12b036){try{agents[_0x82e6('0x16')](_0x12b036);queues[_0x82e6('0x16')](_0x12b036);}catch(_0x2fef95){utils[_0x82e6('0x11')](_0x2fef95);}});ami['on'](_0x82e6('0x17'),function(_0x5f54e9){try{agents[_0x82e6('0x17')](_0x5f54e9);queues[_0x82e6('0x17')](_0x5f54e9);members[_0x82e6('0x17')](_0x5f54e9);}catch(_0x50dfc9){utils['error'](_0x50dfc9);}});ami['on'](_0x82e6('0x18'),function(_0x19013d){try{agents[_0x82e6('0x18')](_0x19013d);queues['queuecallerabandon'](_0x19013d);}catch(_0x517a11){utils['error'](_0x517a11);}});ami['on'](_0x82e6('0x19'),function(_0x12ed7c){try{queues[_0x82e6('0x19')](_0x12ed7c);recordings[_0x82e6('0x19')](_0x12ed7c);}catch(_0x3ea980){utils[_0x82e6('0x11')](_0x3ea980);}});ami['on']('queuecallerleave',function(_0x58c04d){try{queues['queuecallerleave'](_0x58c04d);}catch(_0x32d45d){utils[_0x82e6('0x11')](_0x32d45d);}});ami['on'](_0x82e6('0x1a'),function(_0x17b366){try{queues[_0x82e6('0x1a')](_0x17b366);calls['musiconholdstart'](_0x17b366);}catch(_0x20e3bf){utils['error'](_0x20e3bf);}});ami['on'](_0x82e6('0x1b'),function(_0x534b38){try{queues['musiconholdstop'](_0x534b38);calls[_0x82e6('0x1b')](_0x534b38);}catch(_0x56dac5){utils[_0x82e6('0x11')](_0x56dac5);}});ami['on'](_0x82e6('0x1c'),function(_0x68a1ca){try{calls[_0x82e6('0x1c')](_0x68a1ca);recordings[_0x82e6('0x1c')](_0x68a1ca);}catch(_0x34cc68){utils[_0x82e6('0x11')](_0x34cc68);}});ami['on'](_0x82e6('0x1d'),function(_0x288245){try{calls['hangup'](_0x288245);recordings[_0x82e6('0x1d')](_0x288245);dials['hangup'](_0x288245);agents[_0x82e6('0x1d')](_0x288245);queues['hangup'](_0x288245);}catch(_0x206594){utils['error'](_0x206594);}});ami['on']('cdr',function(_0x2c6a93){try{members[_0x82e6('0x1e')](_0x2c6a93);}catch(_0x28bc45){utils['error'](_0x28bc45);}});ami['on'](_0x82e6('0x1f'),function(_0x444637){try{queues[_0x82e6('0x1f')](_0x444637);agents[_0x82e6('0x1f')](_0x444637);transfers[_0x82e6('0x1f')](_0x444637);}catch(_0x38496e){utils[_0x82e6('0x11')](_0x38496e);}});ami['on'](_0x82e6('0x20'),function(_0xab49bc){try{queues['attendedtransfer'](_0xab49bc);transfers['attendedtransfer'](_0xab49bc);agents[_0x82e6('0x20')](_0xab49bc);calls[_0x82e6('0x20')](_0xab49bc);}catch(_0x39e9ed){utils[_0x82e6('0x11')](_0x39e9ed);}});ami['on'](_0x82e6('0x21'),function(_0x522f26){try{queues['varset'](_0x522f26);recordings[_0x82e6('0x21')](_0x522f26);calls[_0x82e6('0x21')](_0x522f26);dials[_0x82e6('0x21')](_0x522f26);}catch(_0x494f55){utils[_0x82e6('0x11')](_0x494f55);}});ami['on']('newexten',function(_0x5e13e9){try{calls[_0x82e6('0x22')](_0x5e13e9);recordings[_0x82e6('0x22')](_0x5e13e9);dials[_0x82e6('0x22')](_0x5e13e9);}catch(_0x31c845){utils[_0x82e6('0x11')](_0x31c845);}});ami['on'](_0x82e6('0x23'),function(_0x396056){try{calls[_0x82e6('0x23')](_0x396056);recordings['newchannel'](_0x396056);}catch(_0x3f906d){utils[_0x82e6('0x11')](_0x3f906d);}});ami['on']('dialbegin',function(_0xc065d4){try{dials[_0x82e6('0x24')](_0xc065d4);}catch(_0x50e82a){utils[_0x82e6('0x11')](_0x50e82a);}});ami['on'](_0x82e6('0x25'),function(_0x3140d0){try{dials[_0x82e6('0x25')](_0x3140d0);}catch(_0x215e45){utils[_0x82e6('0x11')](_0x215e45);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 505c194..1abab49 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 _0x8c6a=['state','INUSE','device','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','queue','cdr','source','data3','destinationchannel','assign','data1','destination','lodash','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','split','error','some','startsWith'];(function(_0x35ad5b,_0x37d838){var _0x5b0a30=function(_0x2051fe){while(--_0x2051fe){_0x35ad5b['push'](_0x35ad5b['shift']());}};_0x5b0a30(++_0x37d838);}(_0x8c6a,0x15c));var _0xa8c6=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x8c6a[_0x14d896];return _0x28679a;};'use strict';var _=require(_0xa8c6('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xa8c6('0x1'),_0xa8c6('0x2')];function writeDB(_0x2d9d65){utils[_0xa8c6('0x3')](util[_0xa8c6('0x4')](_0xa8c6('0x5'),_0x2d9d65[_0xa8c6('0x6')],_0x2d9d65[_0xa8c6('0x7')],_0x2d9d65[_0xa8c6('0x8')],_0x2d9d65[_0xa8c6('0x9')],_0x2d9d65[_0xa8c6('0xa')],_0x2d9d65[_0xa8c6('0xb')]));if(_0x2d9d65[_0xa8c6('0x7')]){utils[_0xa8c6('0xc')](_0x2d9d65[_0xa8c6('0x7')])['then'](function(_0x322675){if(_0x322675){_0x2d9d65[_0xa8c6('0xa')]=_0x322675[_0xa8c6('0xd')];_0x2d9d65[_0xa8c6('0xe')]=_0x322675[_0xa8c6('0xe')];utils[_0xa8c6('0xf')](_0xa8c6('0x10'),_0x2d9d65);}else{utils['getUserByName'](_0x2d9d65[_0xa8c6('0x7')][_0xa8c6('0x11')]('/')[0x1])['then'](function(_0x2a2b40){if(_0x2a2b40){_0x2d9d65[_0xa8c6('0xa')]=_0x2a2b40[_0xa8c6('0xd')];_0x2d9d65[_0xa8c6('0xe')]=_0x2a2b40[_0xa8c6('0xe')];utils[_0xa8c6('0xf')](_0xa8c6('0x10'),_0x2d9d65);}});}})['catch'](function(_0x11a50c){utils[_0xa8c6('0x12')](_0x11a50c);});}delete members[_0x2d9d65[_0xa8c6('0x7')]];}function startsWith(_0x3b6207,_0x249f02){return _[_0xa8c6('0x13')](_0x3b6207,function(_0x36ce6d){return _[_0xa8c6('0x14')](_0x249f02,_0x36ce6d);});}exports['devicestatechange']=function(_0xdd5f0a){switch(_0xdd5f0a[_0xa8c6('0x15')]){case _0xa8c6('0x16'):case'BUSY':if(!startsWith(exclude,_0xdd5f0a[_0xa8c6('0x17')])){members[_0xdd5f0a['device']]={'channel':'voice','interface':_0xdd5f0a['device'],'type':_0xa8c6('0x18'),'enterAt':utils[_0xa8c6('0x19')](),'role':_0xa8c6('0x1a')};}break;case _0xa8c6('0x1b'):if(!_[_0xa8c6('0x1c')](members[_0xdd5f0a[_0xa8c6('0x17')]])){members[_0xdd5f0a[_0xa8c6('0x17')]]['exitAt']=utils[_0xa8c6('0x19')]();members[_0xdd5f0a[_0xa8c6('0x17')]][_0xa8c6('0x1d')]=utils[_0xa8c6('0x1e')](members[_0xdd5f0a[_0xa8c6('0x17')]][_0xa8c6('0x1f')],members[_0xdd5f0a[_0xa8c6('0x17')]][_0xa8c6('0x20')]);if(members[_0xdd5f0a['device']][_0xa8c6('0x6')]){writeDB(members[_0xdd5f0a[_0xa8c6('0x17')]]);}}default:break;}};exports['agentcomplete']=function(_0xc2c9ab){if(!_['isNil'](members[_0xc2c9ab[_0xa8c6('0x7')]])){members[_0xc2c9ab['interface']]=_['assign'](members[_0xc2c9ab['interface']],{'data4':_0xc2c9ab[_0xa8c6('0x21')],'uniqueid':_0xc2c9ab[_0xa8c6('0x6')]});}};exports[_0xa8c6('0x22')]=function(_0x3f43aa){if(_0x3f43aa[_0xa8c6('0x8')]){var _0x376d93=_0x3f43aa['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x376d93])){members[_0x376d93]=_['assign'](members[_0x376d93],{'data1':members[_0x376d93]['data1']||_0x3f43aa['type'],'data2':members[_0x376d93][_0xa8c6('0x9')]||_0x3f43aa[_0xa8c6('0x23')],'data3':members[_0x376d93][_0xa8c6('0x24')]||_0x3f43aa['destination'],'uniqueid':members[_0x376d93]['uniqueid']||_0x3f43aa[_0xa8c6('0x6')]});if(members[_0x376d93][_0xa8c6('0x1f')]){writeDB(members[_0x376d93]);}}}if(_0x3f43aa[_0xa8c6('0x25')]){var _0x98de00=_0x3f43aa[_0xa8c6('0x25')][_0xa8c6('0x11')]('-')[0x0];if(!_['isNil'](members[_0x98de00])){members[_0x98de00]=_[_0xa8c6('0x26')](members[_0x98de00],{'data1':members[_0x98de00][_0xa8c6('0x27')]||_0x3f43aa[_0xa8c6('0xb')],'data2':members[_0x98de00][_0xa8c6('0x9')]||_0x3f43aa[_0xa8c6('0x23')],'data3':members[_0x98de00][_0xa8c6('0x24')]||_0x3f43aa[_0xa8c6('0x28')],'uniqueid':members[_0x98de00][_0xa8c6('0x6')]||_0x3f43aa['uniqueid']});if(members[_0x98de00][_0xa8c6('0x1f')]){writeDB(members[_0x98de00]);}}}}; \ No newline at end of file +var _0xd6dd=['internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','state','BUSY','device','TALKING','NOT_INUSE','isNil','now','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','data3','destination','destinationchannel','source','exitAt','lodash','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name'];(function(_0x2f27c5,_0x332b2b){var _0xa6a23d=function(_0x52eb18){while(--_0x52eb18){_0x2f27c5['push'](_0x2f27c5['shift']());}};_0xa6a23d(++_0x332b2b);}(_0xd6dd,0xa5));var _0xdd6d=function(_0x413b13,_0x4a25de){_0x413b13=_0x413b13-0x0;var _0x1cad2e=_0xd6dd[_0x413b13];return _0x1cad2e;};'use strict';var _=require(_0xdd6d('0x0'));var util=require('util');var utils=require(_0xdd6d('0x1'));var members={};var exclude=[_0xdd6d('0x2'),'Queue:'];function writeDB(_0x1be9cf){utils[_0xdd6d('0x3')](util[_0xdd6d('0x4')](_0xdd6d('0x5'),_0x1be9cf[_0xdd6d('0x6')],_0x1be9cf[_0xdd6d('0x7')],_0x1be9cf[_0xdd6d('0x8')],_0x1be9cf[_0xdd6d('0x9')],_0x1be9cf[_0xdd6d('0xa')],_0x1be9cf[_0xdd6d('0xb')]));if(_0x1be9cf[_0xdd6d('0x7')]){utils[_0xdd6d('0xc')](_0x1be9cf[_0xdd6d('0x7')])[_0xdd6d('0xd')](function(_0x510980){if(_0x510980){_0x1be9cf['membername']=_0x510980[_0xdd6d('0xe')];_0x1be9cf[_0xdd6d('0xf')]=_0x510980[_0xdd6d('0xf')];utils[_0xdd6d('0x10')](_0xdd6d('0x11'),_0x1be9cf);}else{utils[_0xdd6d('0x12')](_0x1be9cf[_0xdd6d('0x7')][_0xdd6d('0x13')]('/')[0x1])[_0xdd6d('0xd')](function(_0x4ed928){if(_0x4ed928){_0x1be9cf[_0xdd6d('0xa')]=_0x4ed928['name'];_0x1be9cf[_0xdd6d('0xf')]=_0x4ed928['internal'];utils['request']('CreateMemberReport',_0x1be9cf);}});}})[_0xdd6d('0x14')](function(_0x1b5d30){utils[_0xdd6d('0x15')](_0x1b5d30);});}delete members[_0x1be9cf[_0xdd6d('0x7')]];}function startsWith(_0xc2ca3c,_0x49f185){return _[_0xdd6d('0x16')](_0xc2ca3c,function(_0x526f46){return _[_0xdd6d('0x17')](_0x49f185,_0x526f46);});}exports[_0xdd6d('0x18')]=function(_0x38dcec){switch(_0x38dcec[_0xdd6d('0x19')]){case'INUSE':case _0xdd6d('0x1a'):if(!startsWith(exclude,_0x38dcec['device'])){members[_0x38dcec[_0xdd6d('0x1b')]]={'channel':'voice','interface':_0x38dcec['device'],'type':_0xdd6d('0x1c'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xdd6d('0x1d'):if(!_[_0xdd6d('0x1e')](members[_0x38dcec[_0xdd6d('0x1b')]])){members[_0x38dcec['device']]['exitAt']=utils[_0xdd6d('0x1f')]();members[_0x38dcec[_0xdd6d('0x1b')]][_0xdd6d('0x20')]=utils[_0xdd6d('0x21')](members[_0x38dcec[_0xdd6d('0x1b')]]['exitAt'],members[_0x38dcec[_0xdd6d('0x1b')]][_0xdd6d('0x22')]);if(members[_0x38dcec[_0xdd6d('0x1b')]][_0xdd6d('0x6')]){writeDB(members[_0x38dcec[_0xdd6d('0x1b')]]);}}default:break;}};exports[_0xdd6d('0x23')]=function(_0x51d08a){if(!_[_0xdd6d('0x1e')](members[_0x51d08a[_0xdd6d('0x7')]])){members[_0x51d08a[_0xdd6d('0x7')]]=_[_0xdd6d('0x24')](members[_0x51d08a['interface']],{'data4':_0x51d08a[_0xdd6d('0x25')],'uniqueid':_0x51d08a[_0xdd6d('0x6')]});}};exports[_0xdd6d('0x26')]=function(_0x173bba){if(_0x173bba[_0xdd6d('0x8')]){var _0x5d73a4=_0x173bba[_0xdd6d('0x8')]['split']('-')[0x0];if(!_[_0xdd6d('0x1e')](members[_0x5d73a4])){members[_0x5d73a4]=_[_0xdd6d('0x24')](members[_0x5d73a4],{'data1':members[_0x5d73a4][_0xdd6d('0x27')]||_0x173bba[_0xdd6d('0xb')],'data2':members[_0x5d73a4]['data2']||_0x173bba['source'],'data3':members[_0x5d73a4][_0xdd6d('0x28')]||_0x173bba[_0xdd6d('0x29')],'uniqueid':members[_0x5d73a4][_0xdd6d('0x6')]||_0x173bba[_0xdd6d('0x6')]});if(members[_0x5d73a4]['exitAt']){writeDB(members[_0x5d73a4]);}}}if(_0x173bba[_0xdd6d('0x2a')]){var _0x5f0874=_0x173bba[_0xdd6d('0x2a')]['split']('-')[0x0];if(!_[_0xdd6d('0x1e')](members[_0x5f0874])){members[_0x5f0874]=_[_0xdd6d('0x24')](members[_0x5f0874],{'data1':members[_0x5f0874][_0xdd6d('0x27')]||_0x173bba['type'],'data2':members[_0x5f0874]['data2']||_0x173bba[_0xdd6d('0x2b')],'data3':members[_0x5f0874][_0xdd6d('0x28')]||_0x173bba['destination'],'uniqueid':members[_0x5f0874]['uniqueid']||_0x173bba[_0xdd6d('0x6')]});if(members[_0x5f0874][_0xdd6d('0x2c')]){writeDB(members[_0x5f0874]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 50a7b7a..b99c87c 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 _0x2bbb=['musiconholdstart','musiconholdstartAt','musiconholdstop','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','position','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','varset','queuestatus','queuecallerabandonAt','now','toUpperCase','variable','queueposition','queuecallerexitAt','EXITWITHKEY','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','assigned','membername','agentcomplete','reason','transfer','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','queuecallerenterreason','error','stack'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0x2bbb,0x1a1));var _0xb2bb=function(_0x4f4066,_0x124a50){_0x4f4066=_0x4f4066-0x0;var _0xc6d2bf=_0x2bbb[_0x4f4066];return _0xc6d2bf;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0xf23213){utils['info'](util[_0xb2bb('0x0')](_0xb2bb('0x1'),_0xf23213[_0xb2bb('0x2')],_0xf23213['channel'],_0xf23213[_0xb2bb('0x3')],_0xf23213[_0xb2bb('0x4')],_0xf23213[_0xb2bb('0x5')],_0xf23213[_0xb2bb('0x6')],_0xf23213[_0xb2bb('0x7')]));if(_0xf23213[_0xb2bb('0x3')]){utils[_0xb2bb('0x8')](_0xf23213[_0xb2bb('0x3')])[_0xb2bb('0x9')](function(_0x3e4642){if(_0x3e4642){_0xf23213[_0xb2bb('0xa')]=_0x3e4642[_0xb2bb('0xa')];}utils[_0xb2bb('0xb')]('CreateVoiceQueueReport',_0xf23213);});}else{utils[_0xb2bb('0xb')](_0xb2bb('0xc'),_0xf23213);}if(_0xf23213[_0xb2bb('0xd')]){delete queues[_0xf23213[_0xb2bb('0xd')]];}else{delete queues[_0xf23213[_0xb2bb('0x2')]];}}exports['queuecallerjoin']=function(_0x1d3ed4){queues[_0x1d3ed4[_0xb2bb('0x2')]]=_['assign'](_0x1d3ed4,{'originalposition':_0x1d3ed4[_0xb2bb('0xe')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports['hangup']=function(_0x4a79cb){if(!_[_0xb2bb('0xf')](queues[_0x4a79cb[_0xb2bb('0x2')]])){if(queues[_0x4a79cb['uniqueid']][_0xb2bb('0x10')]){if(!queues[_0x4a79cb[_0xb2bb('0x2')]][_0xb2bb('0x11')]&&!queues[_0x4a79cb[_0xb2bb('0x2')]][_0xb2bb('0x12')]){queues[_0x4a79cb[_0xb2bb('0x2')]][_0xb2bb('0x13')]=!![];queues[_0x4a79cb[_0xb2bb('0x2')]][_0xb2bb('0x14')]=utils['now']();queues[_0x4a79cb['uniqueid']][_0xb2bb('0x7')]=_0xb2bb('0x15');}writeDB(queues[_0x4a79cb[_0xb2bb('0x2')]]);}else{if(queues[_0x4a79cb['uniqueid']][_0xb2bb('0xd')]){queues[queues[_0x4a79cb['uniqueid']][_0xb2bb('0xd')]]=queues[_0x4a79cb[_0xb2bb('0x2')]];queues[queues[_0x4a79cb[_0xb2bb('0x2')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x4a79cb[_0xb2bb('0x2')]];}}}};exports[_0xb2bb('0x16')]=function(_0x36d00a){if(!_[_0xb2bb('0xf')](_0x36d00a['variable'][_0xb2bb('0x17')])){if(!_[_0xb2bb('0xf')](queues[_0x36d00a['uniqueid']])){queues[_0x36d00a['uniqueid']][_0xb2bb('0x11')]=![];queues[_0x36d00a[_0xb2bb('0x2')]][_0xb2bb('0x18')]=null;queues[_0x36d00a[_0xb2bb('0x2')]][_0xb2bb('0x12')]=!![];queues[_0x36d00a[_0xb2bb('0x2')]]['queuecallerexitAt']=utils[_0xb2bb('0x19')]();queues[_0x36d00a[_0xb2bb('0x2')]]['queuecallerexitreason']=_0x36d00a['value'][_0xb2bb('0x1a')]();writeDB(queues[_0x36d00a['uniqueid']]);}}else if(!_[_0xb2bb('0xf')](_0x36d00a[_0xb2bb('0x1b')][_0xb2bb('0x1c')])){if(!_[_0xb2bb('0xf')](queues[_0x36d00a[_0xb2bb('0x2')]])&&!queues[_0x36d00a[_0xb2bb('0x2')]][_0xb2bb('0x11')]){queues[_0x36d00a[_0xb2bb('0x2')]]['queuecallerabandon']=![];queues[_0x36d00a['uniqueid']][_0xb2bb('0x18')]=null;queues[_0x36d00a[_0xb2bb('0x2')]][_0xb2bb('0x12')]=!![];queues[_0x36d00a['uniqueid']][_0xb2bb('0x1d')]=utils['now']();queues[_0x36d00a['uniqueid']][_0xb2bb('0x7')]=_0xb2bb('0x1e');}}};exports[_0xb2bb('0x11')]=function(_0x1c34f6){if(!_[_0xb2bb('0xf')](queues[_0x1c34f6[_0xb2bb('0x2')]])){queues[_0x1c34f6[_0xb2bb('0x2')]][_0xb2bb('0x12')]=![];queues[_0x1c34f6[_0xb2bb('0x2')]]['queuecallerexitAt']=null;queues[_0x1c34f6['uniqueid']][_0xb2bb('0x11')]=!![];queues[_0x1c34f6[_0xb2bb('0x2')]][_0xb2bb('0x18')]=utils[_0xb2bb('0x19')]();queues[_0x1c34f6['uniqueid']]['queuecallerexitreason']='ABANDONED';}};exports[_0xb2bb('0x1f')]=function(_0x46f0ff){if(!_[_0xb2bb('0xf')](queues[_0x46f0ff[_0xb2bb('0x2')]])){queues[_0x46f0ff[_0xb2bb('0x2')]][_0xb2bb('0x1f')]=!![];queues[_0x46f0ff[_0xb2bb('0x2')]][_0xb2bb('0x10')]=utils['now']();queues[_0x46f0ff['uniqueid']][_0xb2bb('0x20')]=utils[_0xb2bb('0x21')](queues[_0x46f0ff[_0xb2bb('0x2')]]['queuecallerleaveAt'],queues[_0x46f0ff[_0xb2bb('0x2')]][_0xb2bb('0x22')]);queues[_0x46f0ff[_0xb2bb('0x2')]][_0xb2bb('0xe')]=_0x46f0ff[_0xb2bb('0xe')];queues[_0x46f0ff[_0xb2bb('0x2')]][_0xb2bb('0x23')]=_0x46f0ff[_0xb2bb('0x23')];queues[_0x46f0ff[_0xb2bb('0x2')]]['connectedlinenum']=_0x46f0ff['connectedlinenum'];queues[_0x46f0ff['uniqueid']][_0xb2bb('0x24')]=_0x46f0ff[_0xb2bb('0x24')];}};exports[_0xb2bb('0x25')]=function(_0x1c9c78){if(!_[_0xb2bb('0xf')](queues[_0x1c9c78[_0xb2bb('0x2')]])){queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x11')]=![];queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x11')]=![];queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x18')]=null;queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x12')]=![];queues[_0x1c9c78[_0xb2bb('0x2')]]['queuecallerexitAt']=null;queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x26')]=!![];queues[_0x1c9c78[_0xb2bb('0x2')]][_0xb2bb('0x6')]=_0x1c9c78['destaccountcode'];queues[_0x1c9c78['uniqueid']][_0xb2bb('0x4')]=_0x1c9c78[_0xb2bb('0x27')];}};exports[_0xb2bb('0x28')]=function(_0x34952f){if(!_[_0xb2bb('0xf')](queues[_0x34952f[_0xb2bb('0x2')]])){if(queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x10')]){queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x11')]=![];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x11')]=![];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x18')]=null;queues[_0x34952f[_0xb2bb('0x2')]]['queuecallerexit']=![];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x1d')]=null;queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x26')]=!![];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x4')]=_0x34952f[_0xb2bb('0x27')];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x13')]=!![];queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x14')]=utils[_0xb2bb('0x19')]();if(_0x34952f[_0xb2bb('0x29')]==_0xb2bb('0x2a')){if(!queues[_0x34952f['uniqueid']][_0xb2bb('0x2a')]){queues[_0x34952f['uniqueid']][_0xb2bb('0x7')]='TRANSFER';}}else{queues[_0x34952f[_0xb2bb('0x2')]][_0xb2bb('0x7')]='COMPLETEDBY'+_0x34952f[_0xb2bb('0x29')][_0xb2bb('0x1a')]();}writeDB(queues[_0x34952f[_0xb2bb('0x2')]]);}}};exports[_0xb2bb('0x2b')]=function(_0x14f40c){if(!_[_0xb2bb('0xf')](queues[_0x14f40c[_0xb2bb('0x2c')]])){queues[_0x14f40c[_0xb2bb('0x2c')]][_0xb2bb('0x2a')]=!![];queues[_0x14f40c[_0xb2bb('0x2c')]][_0xb2bb('0x2d')]='BLIND';queues[_0x14f40c['transfereeuniqueid']][_0xb2bb('0x2e')]=_0x14f40c[_0xb2bb('0x2f')];queues[_0x14f40c['transfereeuniqueid']]['transferuniqueid']=_0x14f40c[_0xb2bb('0x2c')];queues[_0x14f40c[_0xb2bb('0x2c')]][_0xb2bb('0x7')]='BLINDTRANSFER';}};exports[_0xb2bb('0x30')]=function(_0x50561d){try{if(_0x50561d[_0xb2bb('0x31')]==_0x50561d[_0xb2bb('0x32')]){if(!_['isNil'](queues[_0x50561d[_0xb2bb('0x33')]])){queues[_0x50561d[_0xb2bb('0x33')]]['transfer']=!![];queues[_0x50561d[_0xb2bb('0x33')]][_0xb2bb('0x2d')]='ATTENDED';queues[_0x50561d['secondtransfererlinkedid']][_0xb2bb('0x2e')]=_0x50561d['origtransfererexten'];queues[_0x50561d[_0xb2bb('0x33')]][_0xb2bb('0x34')]=_0x50561d['origtransfereruniqueid'];queues[_0x50561d[_0xb2bb('0x33')]][_0xb2bb('0x7')]=_0xb2bb('0x35');}if(!_[_0xb2bb('0xf')](queues[_0x50561d[_0xb2bb('0x32')]])){if(_0x50561d[_0xb2bb('0x36')]&&queues[_0x50561d[_0xb2bb('0x36')]]){queues[_0x50561d[_0xb2bb('0x36')]]['queuecallerenterreason']=0x1;queues[_0x50561d[_0xb2bb('0x2c')]]=_[_0xb2bb('0x37')](queues[_0x50561d[_0xb2bb('0x36')]]);queues[_0x50561d['transfereeuniqueid']][_0xb2bb('0xd')]=_0x50561d[_0xb2bb('0x38')];queues[_0x50561d[_0xb2bb('0x2c')]]['queuecallerenterreason']=0x2;queues[_0x50561d[_0xb2bb('0x2c')]][_0xb2bb('0x5')]=queues[_0x50561d[_0xb2bb('0x33')]]['calleridnum'];queues[_0x50561d['transfereeuniqueid']][_0xb2bb('0x39')]=queues[_0x50561d['secondtransfererlinkedid']][_0xb2bb('0x39')];queues[_0x50561d[_0xb2bb('0x2c')]][_0xb2bb('0x22')]=utils[_0xb2bb('0x19')]();queues[_0x50561d[_0xb2bb('0x2c')]][_0xb2bb('0x10')]=utils['now']();queues[_0x50561d[_0xb2bb('0x2c')]][_0xb2bb('0x20')]=0x0;queues[_0x50561d[_0xb2bb('0x2c')]][_0xb2bb('0x3a')]=0x0;}else{queues[_0x50561d['origtransfererlinkedid']][_0xb2bb('0xd')]=_0x50561d[_0xb2bb('0x33')];}}}else if(_0x50561d[_0xb2bb('0x3b')]==_0x50561d[_0xb2bb('0x33')]){if(!_[_0xb2bb('0xf')](queues[_0x50561d[_0xb2bb('0x32')]])){queues[_0x50561d['origtransfererlinkedid']][_0xb2bb('0x2a')]=!![];queues[_0x50561d[_0xb2bb('0x32')]][_0xb2bb('0x2d')]=_0xb2bb('0x3c');queues[_0x50561d[_0xb2bb('0x32')]][_0xb2bb('0x2e')]=_0x50561d[_0xb2bb('0x3d')];queues[_0x50561d[_0xb2bb('0x32')]][_0xb2bb('0x34')]=_0x50561d[_0xb2bb('0x3b')];queues[_0x50561d[_0xb2bb('0x32')]][_0xb2bb('0x7')]=_0xb2bb('0x35');}if(!_[_0xb2bb('0xf')](queues[_0x50561d[_0xb2bb('0x33')]])){if(_0x50561d[_0xb2bb('0x3e')]&&queues[_0x50561d[_0xb2bb('0x3e')]]){queues[_0x50561d[_0xb2bb('0x3e')]]['queuecallerenterreason']=0x1;queues[_0x50561d[_0xb2bb('0x38')]]=_['clone'](queues[_0x50561d['transfertargetlinkedid']]);queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0xd')]=_0x50561d['transfertargetuniqueid'];queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x3f')]=0x2;queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x5')]=queues[_0x50561d[_0xb2bb('0x32')]][_0xb2bb('0x5')];queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x39')]=queues[_0x50561d['origtransfererlinkedid']][_0xb2bb('0x39')];queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x22')]=utils[_0xb2bb('0x19')]();queues[_0x50561d[_0xb2bb('0x38')]]['queuecallerleaveAt']=utils[_0xb2bb('0x19')]();queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x20')]=0x0;queues[_0x50561d[_0xb2bb('0x38')]][_0xb2bb('0x3a')]=0x0;}else{queues[_0x50561d[_0xb2bb('0x33')]]['transfereduniqueid']=_0x50561d[_0xb2bb('0x32')];}}}}catch(_0x5321e1){utils[_0xb2bb('0x40')](_0x5321e1[_0xb2bb('0x41')]);}};exports[_0xb2bb('0x42')]=function(_0x21ed79){if(!_[_0xb2bb('0xf')](queues[_0x21ed79[_0xb2bb('0x2')]])){queues[_0x21ed79[_0xb2bb('0x2')]][_0xb2bb('0x43')]=utils[_0xb2bb('0x19')]();}};exports[_0xb2bb('0x44')]=function(_0x28c61c){if(!_['isNil'](queues[_0x28c61c[_0xb2bb('0x2')]])){if(!_[_0xb2bb('0xf')](queues[_0x28c61c[_0xb2bb('0x2')]][_0xb2bb('0x43')])){queues[_0x28c61c['uniqueid']][_0xb2bb('0x3a')]+=utils[_0xb2bb('0x21')](utils[_0xb2bb('0x19')](),queues[_0x28c61c[_0xb2bb('0x2')]][_0xb2bb('0x43')]);delete queues[_0x28c61c['uniqueid']][_0xb2bb('0x43')];}}}; \ No newline at end of file +var _0x1da9=['variable','queuestatus','queuecallerabandon','queuecallerexitAt','value','toUpperCase','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','agentcomplete','assigned','membername','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridname','mohtime','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','error','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','transfereduniqueid','uniqueid','position','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now'];(function(_0x3045eb,_0x131fdf){var _0xb9583b=function(_0x82c98a){while(--_0x82c98a){_0x3045eb['push'](_0x3045eb['shift']());}};_0xb9583b(++_0x131fdf);}(_0x1da9,0xcb));var _0x91da=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1da9[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x91da('0x0'));var util=require(_0x91da('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x268c99){utils['info'](util['format'](_0x91da('0x2'),_0x268c99['uniqueid'],_0x268c99[_0x91da('0x3')],_0x268c99[_0x91da('0x4')],_0x268c99[_0x91da('0x5')],_0x268c99[_0x91da('0x6')],_0x268c99[_0x91da('0x7')],_0x268c99[_0x91da('0x8')]));if(_0x268c99[_0x91da('0x4')]){utils['getVoiceQueueByName'](_0x268c99['queue'])[_0x91da('0x9')](function(_0x51581f){if(_0x51581f){_0x268c99[_0x91da('0xa')]=_0x51581f['type'];}utils['request']('CreateVoiceQueueReport',_0x268c99);});}else{utils[_0x91da('0xb')]('CreateVoiceQueueReport',_0x268c99);}if(_0x268c99[_0x91da('0xc')]){delete queues[_0x268c99[_0x91da('0xc')]];}else{delete queues[_0x268c99[_0x91da('0xd')]];}}exports['queuecallerjoin']=function(_0x4d8cb4){queues[_0x4d8cb4[_0x91da('0xd')]]=_['assign'](_0x4d8cb4,{'originalposition':_0x4d8cb4[_0x91da('0xe')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x91da('0xf')]=function(_0x1015b4){if(!_[_0x91da('0x10')](queues[_0x1015b4[_0x91da('0xd')]])){if(queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0x11')]){if(!queues[_0x1015b4['uniqueid']]['queuecallerabandon']&&!queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0x12')]){queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0x13')]=!![];queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0x14')]=utils[_0x91da('0x15')]();queues[_0x1015b4['uniqueid']][_0x91da('0x8')]='COMPLETEDBYAGENT';}writeDB(queues[_0x1015b4[_0x91da('0xd')]]);}else{if(queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0xc')]){queues[queues[_0x1015b4['uniqueid']]['transfereduniqueid']]=queues[_0x1015b4[_0x91da('0xd')]];queues[queues[_0x1015b4[_0x91da('0xd')]][_0x91da('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x1015b4[_0x91da('0xd')]];}}}};exports['varset']=function(_0x3410d7){if(!_[_0x91da('0x10')](_0x3410d7[_0x91da('0x16')][_0x91da('0x17')])){if(!_['isNil'](queues[_0x3410d7[_0x91da('0xd')]])){queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x18')]=![];queues[_0x3410d7[_0x91da('0xd')]]['queuecallerabandonAt']=null;queues[_0x3410d7['uniqueid']]['queuecallerexit']=!![];queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x19')]=utils[_0x91da('0x15')]();queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x8')]=_0x3410d7[_0x91da('0x1a')][_0x91da('0x1b')]();writeDB(queues[_0x3410d7['uniqueid']]);}}else if(!_['isNil'](_0x3410d7[_0x91da('0x16')][_0x91da('0x1c')])){if(!_['isNil'](queues[_0x3410d7[_0x91da('0xd')]])&&!queues[_0x3410d7[_0x91da('0xd')]]['queuecallerabandon']){queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x18')]=![];queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x1d')]=null;queues[_0x3410d7[_0x91da('0xd')]]['queuecallerexit']=!![];queues[_0x3410d7['uniqueid']][_0x91da('0x19')]=utils['now']();queues[_0x3410d7[_0x91da('0xd')]][_0x91da('0x8')]=_0x91da('0x1e');}}};exports[_0x91da('0x18')]=function(_0x116e1e){if(!_[_0x91da('0x10')](queues[_0x116e1e[_0x91da('0xd')]])){queues[_0x116e1e['uniqueid']][_0x91da('0x12')]=![];queues[_0x116e1e[_0x91da('0xd')]][_0x91da('0x19')]=null;queues[_0x116e1e[_0x91da('0xd')]][_0x91da('0x18')]=!![];queues[_0x116e1e[_0x91da('0xd')]][_0x91da('0x1d')]=utils['now']();queues[_0x116e1e[_0x91da('0xd')]][_0x91da('0x8')]=_0x91da('0x1f');}};exports[_0x91da('0x20')]=function(_0x327807){if(!_['isNil'](queues[_0x327807[_0x91da('0xd')]])){queues[_0x327807['uniqueid']][_0x91da('0x20')]=!![];queues[_0x327807[_0x91da('0xd')]][_0x91da('0x11')]=utils[_0x91da('0x15')]();queues[_0x327807[_0x91da('0xd')]][_0x91da('0x21')]=utils[_0x91da('0x22')](queues[_0x327807[_0x91da('0xd')]]['queuecallerleaveAt'],queues[_0x327807[_0x91da('0xd')]][_0x91da('0x23')]);queues[_0x327807[_0x91da('0xd')]][_0x91da('0xe')]=_0x327807['position'];queues[_0x327807[_0x91da('0xd')]][_0x91da('0x24')]=_0x327807[_0x91da('0x24')];queues[_0x327807[_0x91da('0xd')]][_0x91da('0x25')]=_0x327807[_0x91da('0x25')];queues[_0x327807[_0x91da('0xd')]]['connectedlinename']=_0x327807[_0x91da('0x26')];}};exports[_0x91da('0x27')]=function(_0x52d26c){if(!_[_0x91da('0x10')](queues[_0x52d26c[_0x91da('0xd')]])){queues[_0x52d26c[_0x91da('0xd')]][_0x91da('0x18')]=![];queues[_0x52d26c[_0x91da('0xd')]][_0x91da('0x18')]=![];queues[_0x52d26c['uniqueid']]['queuecallerabandonAt']=null;queues[_0x52d26c['uniqueid']][_0x91da('0x12')]=![];queues[_0x52d26c[_0x91da('0xd')]][_0x91da('0x19')]=null;queues[_0x52d26c[_0x91da('0xd')]]['assigned']=!![];queues[_0x52d26c[_0x91da('0xd')]][_0x91da('0x7')]=_0x52d26c[_0x91da('0x28')];queues[_0x52d26c[_0x91da('0xd')]][_0x91da('0x5')]=_0x52d26c['membername'];}};exports[_0x91da('0x29')]=function(_0x74cd73){if(!_[_0x91da('0x10')](queues[_0x74cd73[_0x91da('0xd')]])){if(queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x11')]){queues[_0x74cd73['uniqueid']]['queuecallerabandon']=![];queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x18')]=![];queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x1d')]=null;queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x12')]=![];queues[_0x74cd73['uniqueid']]['queuecallerexitAt']=null;queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x2a')]=!![];queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x5')]=_0x74cd73[_0x91da('0x2b')];queues[_0x74cd73[_0x91da('0xd')]]['queuecallercomplete']=!![];queues[_0x74cd73['uniqueid']][_0x91da('0x14')]=utils[_0x91da('0x15')]();if(_0x74cd73['reason']==_0x91da('0x2c')){if(!queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x2c')]){queues[_0x74cd73['uniqueid']][_0x91da('0x8')]=_0x91da('0x2d');}}else{queues[_0x74cd73[_0x91da('0xd')]][_0x91da('0x8')]=_0x91da('0x2e')+_0x74cd73[_0x91da('0x2f')][_0x91da('0x1b')]();}writeDB(queues[_0x74cd73[_0x91da('0xd')]]);}}};exports[_0x91da('0x30')]=function(_0xf6b575){if(!_[_0x91da('0x10')](queues[_0xf6b575[_0x91da('0x31')]])){queues[_0xf6b575['transfereeuniqueid']][_0x91da('0x2c')]=!![];queues[_0xf6b575[_0x91da('0x31')]][_0x91da('0x32')]=_0x91da('0x33');queues[_0xf6b575[_0x91da('0x31')]]['transferexten']=_0xf6b575[_0x91da('0x34')];queues[_0xf6b575[_0x91da('0x31')]][_0x91da('0x35')]=_0xf6b575[_0x91da('0x31')];queues[_0xf6b575['transfereeuniqueid']][_0x91da('0x8')]=_0x91da('0x36');}};exports[_0x91da('0x37')]=function(_0x12aee8){try{if(_0x12aee8['origtransfereruniqueid']==_0x12aee8[_0x91da('0x38')]){if(!_[_0x91da('0x10')](queues[_0x12aee8[_0x91da('0x39')]])){queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x2c')]=!![];queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x32')]=_0x91da('0x3a');queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x3b')]=_0x12aee8[_0x91da('0x3c')];queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x35')]=_0x12aee8[_0x91da('0x3d')];queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x8')]=_0x91da('0x3e');}if(!_[_0x91da('0x10')](queues[_0x12aee8[_0x91da('0x38')]])){if(_0x12aee8['transfereelinkedid']&&queues[_0x12aee8[_0x91da('0x3f')]]){queues[_0x12aee8['transfereelinkedid']][_0x91da('0x40')]=0x1;queues[_0x12aee8['transfereeuniqueid']]=_[_0x91da('0x41')](queues[_0x12aee8['transfereelinkedid']]);queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0xc')]=_0x12aee8['transfertargetuniqueid'];queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x40')]=0x2;queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x6')]=queues[_0x12aee8[_0x91da('0x39')]][_0x91da('0x6')];queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x42')]=queues[_0x12aee8[_0x91da('0x39')]]['calleridname'];queues[_0x12aee8['transfereeuniqueid']][_0x91da('0x23')]=utils[_0x91da('0x15')]();queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x11')]=utils[_0x91da('0x15')]();queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x21')]=0x0;queues[_0x12aee8[_0x91da('0x31')]][_0x91da('0x43')]=0x0;}else{queues[_0x12aee8['origtransfererlinkedid']]['transfereduniqueid']=_0x12aee8['secondtransfererlinkedid'];}}}else if(_0x12aee8['secondtransfereruniqueid']==_0x12aee8[_0x91da('0x39')]){if(!_[_0x91da('0x10')](queues[_0x12aee8[_0x91da('0x38')]])){queues[_0x12aee8[_0x91da('0x38')]][_0x91da('0x2c')]=!![];queues[_0x12aee8[_0x91da('0x38')]]['transfertype']=_0x91da('0x3a');queues[_0x12aee8[_0x91da('0x38')]][_0x91da('0x3b')]=_0x12aee8[_0x91da('0x44')];queues[_0x12aee8['origtransfererlinkedid']][_0x91da('0x35')]=_0x12aee8['secondtransfereruniqueid'];queues[_0x12aee8[_0x91da('0x38')]]['queuecallerexitreason']=_0x91da('0x3e');}if(!_[_0x91da('0x10')](queues[_0x12aee8[_0x91da('0x39')]])){if(_0x12aee8['transfertargetlinkedid']&&queues[_0x12aee8[_0x91da('0x45')]]){queues[_0x12aee8[_0x91da('0x45')]][_0x91da('0x40')]=0x1;queues[_0x12aee8[_0x91da('0x46')]]=_[_0x91da('0x41')](queues[_0x12aee8[_0x91da('0x45')]]);queues[_0x12aee8[_0x91da('0x46')]][_0x91da('0xc')]=_0x12aee8['transfertargetuniqueid'];queues[_0x12aee8[_0x91da('0x46')]][_0x91da('0x40')]=0x2;queues[_0x12aee8[_0x91da('0x46')]]['calleridnum']=queues[_0x12aee8[_0x91da('0x38')]]['calleridnum'];queues[_0x12aee8[_0x91da('0x46')]][_0x91da('0x42')]=queues[_0x12aee8['origtransfererlinkedid']][_0x91da('0x42')];queues[_0x12aee8[_0x91da('0x46')]][_0x91da('0x23')]=utils['now']();queues[_0x12aee8[_0x91da('0x46')]]['queuecallerleaveAt']=utils[_0x91da('0x15')]();queues[_0x12aee8['transfertargetuniqueid']][_0x91da('0x21')]=0x0;queues[_0x12aee8['transfertargetuniqueid']]['mohtime']=0x0;}else{queues[_0x12aee8['secondtransfererlinkedid']][_0x91da('0xc')]=_0x12aee8['origtransfererlinkedid'];}}}}catch(_0x322a55){utils[_0x91da('0x47')](_0x322a55['stack']);}};exports[_0x91da('0x48')]=function(_0x5824cf){if(!_[_0x91da('0x10')](queues[_0x5824cf[_0x91da('0xd')]])){queues[_0x5824cf[_0x91da('0xd')]][_0x91da('0x49')]=utils[_0x91da('0x15')]();}};exports[_0x91da('0x4a')]=function(_0x3fd7d2){if(!_[_0x91da('0x10')](queues[_0x3fd7d2[_0x91da('0xd')]])){if(!_[_0x91da('0x10')](queues[_0x3fd7d2[_0x91da('0xd')]][_0x91da('0x49')])){queues[_0x3fd7d2['uniqueid']][_0x91da('0x43')]+=utils[_0x91da('0x22')](utils[_0x91da('0x15')](),queues[_0x3fd7d2['uniqueid']][_0x91da('0x49')]);delete queues[_0x3fd7d2['uniqueid']][_0x91da('0x49')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 59b8174..1a6c911 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x4f3029,_0x29f581){var _0x3f7a31=function(_0x209f06){while(--_0x209f06){_0x4f3029['push'](_0x4f3029['shift']());}};_0x3f7a31(++_0x29f581);}(_0x70e0,0x17b));var _0x070e=function(_0x1e6589,_0x34c22d){_0x1e6589=_0x1e6589-0x0;var _0x1cf410=_0x70e0[_0x1e6589];return _0x1cf410;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file +var _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(_0x5a6e55,_0x3e2d5a){var _0x5353a2=function(_0x1d6d48){while(--_0x1d6d48){_0x5a6e55['push'](_0x5a6e55['shift']());}};_0x5353a2(++_0x3e2d5a);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a4871af..e333fc1 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 _0x4b0b=['lodash','util','./utils','info','format','request','blindtransfer','type','blind','error','stack','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten'];(function(_0x221850,_0xfb5cc1){var _0x5593f8=function(_0xfe17b5){while(--_0xfe17b5){_0x221850['push'](_0x221850['shift']());}};_0x5593f8(++_0xfb5cc1);}(_0x4b0b,0x134));var _0xb4b0=function(_0x35f73e,_0x59be93){_0x35f73e=_0x35f73e-0x0;var _0x2b2211=_0x4b0b[_0x35f73e];return _0x2b2211;};'use strict';var _=require(_0xb4b0('0x0'));var util=require(_0xb4b0('0x1'));var utils=require(_0xb4b0('0x2'));function writeDB(_0x2cffb8){utils[_0xb4b0('0x3')](util[_0xb4b0('0x4')]('TRANSFER|%s',_0x2cffb8['type']));utils[_0xb4b0('0x5')]('CreateVoiceTransferReport',_0x2cffb8);}exports[_0xb4b0('0x6')]=function(_0x149b32){try{_0x149b32[_0xb4b0('0x7')]=_0xb4b0('0x8');writeDB(_0x149b32);}catch(_0x3bfbed){utils[_0xb4b0('0x9')](_0x3bfbed[_0xb4b0('0xa')]);}};exports['attendedtransfer']=function(_0x195fd8){try{_0x195fd8=_['assign'](_0x195fd8,{'transfererchannel':_0x195fd8['origtransfererchannel'],'transferercalleridnum':_0x195fd8['origtransferercalleridnum'],'transferercalleridname':_0x195fd8[_0xb4b0('0xb')],'transfererconnectedlinenum':_0x195fd8[_0xb4b0('0xc')],'transfererconnectedlinename':_0x195fd8[_0xb4b0('0xd')],'transfereraccountcode':_0x195fd8[_0xb4b0('0xe')],'transferercontext':_0x195fd8['secondtransferercontext'],'transfererexten':_0x195fd8[_0xb4b0('0xf')],'transfererlinkedid':_0x195fd8['origtransfererlinkedid'],'context':_0x195fd8['origtransferercontext'],'extension':_0x195fd8[_0xb4b0('0x10')],'type':_0xb4b0('0x11')});if(_[_0xb4b0('0x12')](_0x195fd8[_0xb4b0('0x13')])){_0x195fd8=_[_0xb4b0('0x14')](_0x195fd8,{'transfereechannel':_0x195fd8[_0xb4b0('0x15')],'transfereecalleridnum':_0x195fd8[_0xb4b0('0x16')],'transfereecalleridname':_0x195fd8[_0xb4b0('0x17')],'transfereeconnectedlinenum':_0x195fd8[_0xb4b0('0x18')],'transfereeconnectedlinename':_0x195fd8['transfertargetconnectedlinename'],'transfereeaccountcode':_0x195fd8[_0xb4b0('0x19')],'transfereecontext':_0x195fd8[_0xb4b0('0x1a')],'transfereeexten':_0x195fd8[_0xb4b0('0x1b')],'transfereelinkedid':_0x195fd8['transfertargetlinkedid']});}writeDB(_0x195fd8);}catch(_0x202404){utils[_0xb4b0('0x9')](_0x202404[_0xb4b0('0xa')]);}}; \ No newline at end of file +var _0xdba2=['attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','TRANSFER|%s','type','CreateVoiceTransferReport','blindtransfer','blind','error','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext'];(function(_0x4ace3a,_0x1acf5f){var _0x258fec=function(_0x18ca56){while(--_0x18ca56){_0x4ace3a['push'](_0x4ace3a['shift']());}};_0x258fec(++_0x1acf5f);}(_0xdba2,0x135));var _0x2dba=function(_0x5f5855,_0x133448){_0x5f5855=_0x5f5855-0x0;var _0x2aa6d2=_0xdba2[_0x5f5855];return _0x2aa6d2;};'use strict';var _=require(_0x2dba('0x0'));var util=require(_0x2dba('0x1'));var utils=require(_0x2dba('0x2'));function writeDB(_0x365b89){utils[_0x2dba('0x3')](util[_0x2dba('0x4')](_0x2dba('0x5'),_0x365b89[_0x2dba('0x6')]));utils['request'](_0x2dba('0x7'),_0x365b89);}exports[_0x2dba('0x8')]=function(_0x158062){try{_0x158062['type']=_0x2dba('0x9');writeDB(_0x158062);}catch(_0x8703df){utils[_0x2dba('0xa')](_0x8703df['stack']);}};exports[_0x2dba('0xb')]=function(_0x5356a3){try{_0x5356a3=_[_0x2dba('0xc')](_0x5356a3,{'transfererchannel':_0x5356a3[_0x2dba('0xd')],'transferercalleridnum':_0x5356a3[_0x2dba('0xe')],'transferercalleridname':_0x5356a3['origtransferercalleridname'],'transfererconnectedlinenum':_0x5356a3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5356a3[_0x2dba('0xf')],'transfereraccountcode':_0x5356a3[_0x2dba('0x10')],'transferercontext':_0x5356a3[_0x2dba('0x11')],'transfererexten':_0x5356a3[_0x2dba('0x12')],'transfererlinkedid':_0x5356a3[_0x2dba('0x13')],'context':_0x5356a3[_0x2dba('0x14')],'extension':_0x5356a3['origtransfererexten'],'type':_0x2dba('0x15')});if(_['isNil'](_0x5356a3[_0x2dba('0x16')])){_0x5356a3=_[_0x2dba('0xc')](_0x5356a3,{'transfereechannel':_0x5356a3[_0x2dba('0x17')],'transfereecalleridnum':_0x5356a3[_0x2dba('0x18')],'transfereecalleridname':_0x5356a3['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5356a3[_0x2dba('0x19')],'transfereeconnectedlinename':_0x5356a3[_0x2dba('0x1a')],'transfereeaccountcode':_0x5356a3[_0x2dba('0x1b')],'transfereecontext':_0x5356a3[_0x2dba('0x1c')],'transfereeexten':_0x5356a3[_0x2dba('0x1d')],'transfereelinkedid':_0x5356a3['transfertargetlinkedid']});}writeDB(_0x5356a3);}catch(_0x13b663){utils[_0x2dba('0xa')](_0x13b663['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 17ec8de..139592b 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 _0x7724=['getUserByInternal','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','xdr','info','debug','stack','request','then','stringify','catch','error','GetUser','internal','name','GETUSER|','result','length','NOTFOUND'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x7724,0x10b));var _0x4772=function(_0x4dcbd6,_0x2ea31b){_0x4dcbd6=_0x4dcbd6-0x0;var _0x27bfd7=_0x7724[_0x4dcbd6];return _0x27bfd7;};'use strict';var jayson=require(_0x4772('0x0'));var moment=require(_0x4772('0x1'));var BPromise=require(_0x4772('0x2'));var client=jayson[_0x4772('0x3')][_0x4772('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x4772('0x5'));exports['info']=function(_0x509521){logger[_0x4772('0x6')](_0x509521);};exports[_0x4772('0x7')]=function(_0x3530db){logger[_0x4772('0x7')](JSON['stringify'](_0x3530db));};exports['error']=function(_0x23de44){logger['error'](_0x23de44[_0x4772('0x8')]);};exports[_0x4772('0x9')]=function(_0x514302,_0x3e891d){return client[_0x4772('0x9')](_0x514302,{'body':_0x3e891d})[_0x4772('0xa')](function(_0x7f6230){logger[_0x4772('0x7')](JSON[_0x4772('0xb')](_0x7f6230));})[_0x4772('0xc')](function(_0x10e475){logger[_0x4772('0xd')](_0x10e475[_0x4772('0x8')]);});};function getUser(_0x305608){return client['request'](_0x4772('0xe'),{'options':{'raw':!![],'attributes':['id',_0x4772('0xf'),_0x4772('0x10'),'interface'],'where':_0x305608,'limit':0x1}})[_0x4772('0xa')](function(_0x3ef320){logger['info'](_0x4772('0x11')+JSON['stringify'](_0x305608)+'|'+(_0x3ef320[_0x4772('0x12')][_0x4772('0x13')]?'FOUND':_0x4772('0x14')));return _0x3ef320['result']['length']?_0x3ef320[_0x4772('0x12')][0x0]:null;});}exports[_0x4772('0x15')]=function(_0x6854d1){return new BPromise(function(_0x29edd9,_0x87dca4){if(_0x6854d1){return getUser({'internal':_0x6854d1})[_0x4772('0xa')](function(_0x5b8d59){return _0x29edd9(_0x5b8d59);})[_0x4772('0xc')](function(_0x461dd1){logger[_0x4772('0xd')](_0x461dd1[_0x4772('0x8')]);return _0x29edd9(null);});}else{return _0x29edd9(null);}});};exports['getUserByInterface']=function(_0x1c1c5d){return new BPromise(function(_0x3c6da7,_0xe8cc73){if(_0x1c1c5d){return getUser({'interface':_0x1c1c5d})[_0x4772('0xa')](function(_0x2c0282){return _0x3c6da7(_0x2c0282);})[_0x4772('0xc')](function(_0x133171){logger[_0x4772('0xd')](_0x133171[_0x4772('0x8')]);return _0x3c6da7(null);});}else{return _0x3c6da7(null);}});};exports['getUserByName']=function(_0x281efc){return new BPromise(function(_0x3db90a,_0x1288c0){if(_0x281efc){return getUser({'name':_0x281efc})[_0x4772('0xa')](function(_0x252bc9){return _0x3db90a(_0x252bc9);})[_0x4772('0xc')](function(_0x410bed){logger[_0x4772('0xd')](_0x410bed['stack']);return _0x3db90a(null);});}else{return _0x3db90a(null);}});};exports[_0x4772('0x16')]=function(_0xdd3ed4){return new BPromise(function(_0x21910a,_0x6fb10f){if(_0xdd3ed4){return client[_0x4772('0x9')](_0x4772('0x17'),{'options':{'raw':!![],'attributes':['id',_0x4772('0x10'),_0x4772('0x18'),'acw',_0x4772('0x19')],'where':{'name':_0xdd3ed4},'limit':0x1}})['then'](function(_0x445068){logger[_0x4772('0x6')](_0x4772('0x1a')+_0xdd3ed4+'|'+(_0x445068['result']['length']?'FOUND':_0x4772('0x14')));return _0x21910a(_0x445068['result'][_0x4772('0x13')]?_0x445068[_0x4772('0x12')][0x0]:null);})[_0x4772('0xc')](function(_0x41a404){logger[_0x4772('0xd')](_0x41a404[_0x4772('0x8')]);return _0x21910a(null);});}else{return _0x21910a(null);}});};exports['addTime']=function(_0x21fc1f,_0x5a2648){return moment(_0x21fc1f)[_0x4772('0x1b')](_0x5a2648,'seconds')[_0x4772('0x1c')](_0x4772('0x1d'));};exports[_0x4772('0x1e')]=function(_0x54be19,_0x45a8b2){return moment(_0x54be19)[_0x4772('0x1f')](_0x45a8b2,'seconds')[_0x4772('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4772('0x20')]=function(_0x146995,_0x57f4b0){return moment(_0x146995)['diff'](moment(_0x57f4b0),'seconds');};exports['sumTime']=function(_0x52755b,_0x430e8d){return parseInt(_0x52755b,0xa)+parseInt(_0x430e8d,0xa);};exports[_0x4772('0x21')]=function(){return moment()[_0x4772('0x1c')](_0x4772('0x1d'));};exports['isAfter']=function(_0x3756cb,_0x130266){if(_0x130266){return moment(_0x3756cb)[_0x4772('0x22')](_0x130266);}else{return!![];}};exports[_0x4772('0x23')]=function(_0x42f9e2,_0x4926a0){if(_0x4926a0){return moment(_0x42f9e2)[_0x4772('0x23')](_0x4926a0);}else if(_0x42f9e2){return!![];}else{return![];}}; \ No newline at end of file +var _0x089e=['diffTime','diff','sumTime','now','isAfter','isBefore','moment','xdr','info','debug','stringify','error','stack','request','then','GetUser','internal','interface','result','length','FOUND','NOTFOUND','getUserByInternal','catch','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract'];(function(_0x5f0a46,_0x9f2b6f){var _0xea297e=function(_0x5b5cb9){while(--_0x5b5cb9){_0x5f0a46['push'](_0x5f0a46['shift']());}};_0xea297e(++_0x9f2b6f);}(_0x089e,0x6f));var _0xe089=function(_0x341554,_0x53b488){_0x341554=_0x341554-0x0;var _0x52d2d8=_0x089e[_0x341554];return _0x52d2d8;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xe089('0x0'));var BPromise=require('bluebird');var client=jayson['client']['http']({'port':0x2329});var logger=require('../../config/logger')(_0xe089('0x1'));exports[_0xe089('0x2')]=function(_0x53e746){logger[_0xe089('0x2')](_0x53e746);};exports['debug']=function(_0x158baa){logger[_0xe089('0x3')](JSON[_0xe089('0x4')](_0x158baa));};exports[_0xe089('0x5')]=function(_0x294bcd){logger[_0xe089('0x5')](_0x294bcd[_0xe089('0x6')]);};exports[_0xe089('0x7')]=function(_0x221296,_0x548cf1){return client[_0xe089('0x7')](_0x221296,{'body':_0x548cf1})[_0xe089('0x8')](function(_0x330252){logger[_0xe089('0x3')](JSON[_0xe089('0x4')](_0x330252));})['catch'](function(_0x50a213){logger[_0xe089('0x5')](_0x50a213[_0xe089('0x6')]);});};function getUser(_0xf60e0b){return client[_0xe089('0x7')](_0xe089('0x9'),{'options':{'raw':!![],'attributes':['id',_0xe089('0xa'),'name',_0xe089('0xb')],'where':_0xf60e0b,'limit':0x1}})[_0xe089('0x8')](function(_0xdc936d){logger[_0xe089('0x2')]('GETUSER|'+JSON[_0xe089('0x4')](_0xf60e0b)+'|'+(_0xdc936d[_0xe089('0xc')][_0xe089('0xd')]?_0xe089('0xe'):_0xe089('0xf')));return _0xdc936d[_0xe089('0xc')][_0xe089('0xd')]?_0xdc936d[_0xe089('0xc')][0x0]:null;});}exports[_0xe089('0x10')]=function(_0x1c4a20){return new BPromise(function(_0x13b873,_0xb862b3){if(_0x1c4a20){return getUser({'internal':_0x1c4a20})['then'](function(_0x43c6a2){return _0x13b873(_0x43c6a2);})['catch'](function(_0x4f6b07){logger[_0xe089('0x5')](_0x4f6b07[_0xe089('0x6')]);return _0x13b873(null);});}else{return _0x13b873(null);}});};exports['getUserByInterface']=function(_0x1179bf){return new BPromise(function(_0x505dd9,_0x59f26f){if(_0x1179bf){return getUser({'interface':_0x1179bf})[_0xe089('0x8')](function(_0x16fd3f){return _0x505dd9(_0x16fd3f);})[_0xe089('0x11')](function(_0x54b32b){logger['error'](_0x54b32b[_0xe089('0x6')]);return _0x505dd9(null);});}else{return _0x505dd9(null);}});};exports['getUserByName']=function(_0x2e059f){return new BPromise(function(_0x1e03fa,_0x48eb0e){if(_0x2e059f){return getUser({'name':_0x2e059f})['then'](function(_0x5683c3){return _0x1e03fa(_0x5683c3);})[_0xe089('0x11')](function(_0x2d0768){logger[_0xe089('0x5')](_0x2d0768['stack']);return _0x1e03fa(null);});}else{return _0x1e03fa(null);}});};exports['getVoiceQueueByName']=function(_0x1748d9){return new BPromise(function(_0x1c4dd6,_0x2a9405){if(_0x1748d9){return client[_0xe089('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xe089('0x12'),_0xe089('0x13'),_0xe089('0x14'),_0xe089('0x15')],'where':{'name':_0x1748d9},'limit':0x1}})['then'](function(_0x262916){logger[_0xe089('0x2')](_0xe089('0x16')+_0x1748d9+'|'+(_0x262916[_0xe089('0xc')][_0xe089('0xd')]?_0xe089('0xe'):_0xe089('0xf')));return _0x1c4dd6(_0x262916[_0xe089('0xc')]['length']?_0x262916[_0xe089('0xc')][0x0]:null);})[_0xe089('0x11')](function(_0x80e27c){logger[_0xe089('0x5')](_0x80e27c[_0xe089('0x6')]);return _0x1c4dd6(null);});}else{return _0x1c4dd6(null);}});};exports[_0xe089('0x17')]=function(_0x58eee1,_0x1020f9){return moment(_0x58eee1)['add'](_0x1020f9,_0xe089('0x18'))[_0xe089('0x19')](_0xe089('0x1a'));};exports[_0xe089('0x1b')]=function(_0x8646ff,_0x57b3ca){return moment(_0x8646ff)[_0xe089('0x1c')](_0x57b3ca,_0xe089('0x18'))[_0xe089('0x19')](_0xe089('0x1a'));};exports[_0xe089('0x1d')]=function(_0x4b4753,_0x209e31){return moment(_0x4b4753)[_0xe089('0x1e')](moment(_0x209e31),_0xe089('0x18'));};exports[_0xe089('0x1f')]=function(_0x1b1cb4,_0x4121e9){return parseInt(_0x1b1cb4,0xa)+parseInt(_0x4121e9,0xa);};exports[_0xe089('0x20')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe089('0x21')]=function(_0x4eaee5,_0x2b1a7f){if(_0x2b1a7f){return moment(_0x4eaee5)[_0xe089('0x21')](_0x2b1a7f);}else{return!![];}};exports[_0xe089('0x22')]=function(_0x4bafd0,_0x1e0e4f){if(_0x1e0e4f){return moment(_0x4bafd0)[_0xe089('0x22')](_0x1e0e4f);}else if(_0x4bafd0){return!![];}else{return![];}}; \ No newline at end of file diff --git a/snippet/1.0.13/styles/mobile.css b/snippet/1.0.13/styles/mobile.css new file mode 100644 index 0000000..da3f877 --- /dev/null +++ b/snippet/1.0.13/styles/mobile.css @@ -0,0 +1,140 @@ +/* IFRAME GENERALE*/ +iframe[id='motion-chat-iframe'] { + /* Style attributes*/ + + position: fixed; + height: 450px; + border: 0; + /* box-shadow: 0px 0px 10px 2px #333333; */ + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + /* overflow: hidden; */ + +} + +/* IFRAME BASSO-DESTRA*/ +.motion-chat-iframe-bottom_right { + /* Style attributes*/ + + width: 320px; + bottom: -400px; + right: 0; + +} + +/* IFRAME DESTRA*/ +.motion-chat-iframe-right { + /* Style attributes*/ + + width: 295px; + right: -312px; + +} + +/* LINGUETTA DESTRA*/ +.motion-chat-div-right { + /* Style attributes*/ + + display: none; + right: 0px; + position: fixed; + cursor: pointer; + height: 100px; + width: 25px; + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + +} + +/* IFRAME SINISTRA*/ +.motion-chat-iframe-left { + /* Style attributes*/ + + width: 295px; + left: -297px; + +} + +/* LINGUETTA SINISTRA*/ +.motion-chat-div-left { + /* Style attributes*/ + + left: 0px; + display: none; + position: fixed; + cursor: pointer; + height: 100px; + width: 25px; + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + +} + +@media only screen and (max-width: 320px) { + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-right { + /* Style attributes*/ + + width: 295px; + bottom: 0px; + right: 0; + + } + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-left { + /* Style attributes*/ + + width: 295px; + bottom: 0px; + right: 0; + + } + +} + +@media only screen and (max-height: 450px) { + + /* IFRAME BASSO-DESTRA*/ + iframe[id='motion-chat-iframe'] { + /* Style attributes*/ + height: 100% !important; + + } + + .motion-chat-iframe-right { + /* Style attributes*/ + + top: 0px !important; + + } + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-left { + /* Style attributes*/ + + top: 0px !important; + + } + + div[id='motion-chat-iframe-tab'] { + /* Style attributes*/ + + top: auto !important; + bottom: 0px !important; + + } +} \ No newline at end of file